Skip to content

Commit

Permalink
Merge pull request #22 from Opetushallitus/OK-673
Browse files Browse the repository at this point in the history
OK-673
  • Loading branch information
pretseli authored Dec 10, 2024
2 parents 2f6401f + 2eea089 commit d094060
Show file tree
Hide file tree
Showing 91 changed files with 3,553 additions and 3,478 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
paths-ignore:
- '**.md'

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
.next
storybook-static
dist
lcov-report
coverage
__snapshots__/__diff_output__
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ storybook-static
node_modules
lcov
coverage
dist
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Varmista myös, että vertaisriippuvuudet (peer dependency) on asennettu:
"peerDependencies": {
"@mui/material": "^6",
"next": "^14 || ^15", // Pakollinen vain, jos käytät Next.js:ää
"react": "^18"
"react": "^18 || ^19"
}
}
```
Expand Down Expand Up @@ -173,7 +173,8 @@ Komponenttikirjaston jakeluversio muodostetaan komennolla:
npm run build
```
Komento muodostaa EcmaScript-moduulit `/dist`-hakemistoon käyttäen [tsup-työkalua](https://tsup.egoist.dev/). Kyseinen komento ajetaan myös aina kun tämän projektin riippuvuudet asennetaan (prepare-skripti package.json-tiedostossa). Tämä on välttämätöntä, että komponenttikirjastoa voi käyttää riippuvuutena. [Package.json-tiedoston](./package.json) export-kentässä on määritelty moduulit, jotka jakeluversio tarjoaa.
Komento muodostaa EcmaScript-moduulit `/dist`-hakemistoon käyttäen [tsup-työkalua](https://tsup.egoist.dev/). [Package.json-tiedoston](./package.json) export-kentässä on määritelty moduulit, jotka jakeluversio tarjoaa.
Jakeluversion tiedostot on lisätty myös Git-säilöön `/dist`-hakemistoon, jotta komentoa ei tarvitse ajaa kirjaston asennuksen yhteydessä.
## Esimerkkiprojekti
Expand Down
5 changes: 5 additions & 0 deletions dist/OphButton.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Button } from '@mui/material';

declare const OphButton: typeof Button;

export { OphButton };
8 changes: 8 additions & 0 deletions dist/OphButton.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/OphButton.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions dist/OphCheckbox.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { CheckboxProps, FormControlLabelProps } from '@mui/material';
import react__default from 'react';

type OphCheckboxProps = Omit<CheckboxProps, 'centerRipple' | 'checkedIcon' | 'disableRipple' | 'icon' | 'indeterminateIcon' | 'size' | 'LinkComponent'> & {
formControlLabelProps?: Omit<FormControlLabelProps, 'label' | 'control'>;
label?: react__default.ReactNode;
error?: boolean;
};
declare const OphCheckbox: react__default.ForwardRefExoticComponent<Omit<OphCheckboxProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;

export { OphCheckbox, type OphCheckboxProps };
8 changes: 8 additions & 0 deletions dist/OphCheckbox.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/OphCheckbox.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions dist/OphLink.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { LinkOwnProps, Theme } from '@mui/material';
import { SystemProps } from '@mui/system';
import { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent';

type OmittedPropNames = keyof SystemProps<Theme> | 'paragraph' | 'TypographyClasses' | 'variantMapping' | 'align' | 'gutterBottom' | 'underline';
interface OphAdditionalLinkProps {
/** Icon visibility override. If not given, icon visibility is deduced from href (relative links without icon) */
iconVisible?: boolean;
}
interface OphLinkTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'a'> {
props: AdditionalProps & Omit<LinkOwnProps, OmittedPropNames>;
defaultComponent: RootComponent;
}
type MuiOphLinkProps<RootComponent extends React.ElementType = OphLinkTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<OphLinkTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType;
};
type OphLinkProps<C extends React.ElementType = React.ElementType, D extends React.ElementType = OphLinkTypeMap['defaultComponent']> = {
component?: C;
} & Omit<MuiOphLinkProps<D, OphAdditionalLinkProps>, 'component'>;
declare const OphLink: OverridableComponent<OphLinkTypeMap<OphLinkProps>>;

export { OphLink, type OphLinkProps };
9 changes: 9 additions & 0 deletions dist/OphLink.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/OphLink.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions dist/OphSelect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { SelectProps } from '@mui/material';

type OphSelectValue<T> = SelectProps<T>['value'];
interface OphSelectOption<T> {
label: string;
value: OphSelectValue<T>;
}
interface OphSelectProps<T> extends Omit<SelectProps<T>, 'children' | 'label' | 'variant'> {
options: Array<OphSelectOption<T>>;
clearable?: boolean;
placeholder?: string;
}
declare const OphSelect: <T extends string>({ placeholder, clearable, options, ...props }: OphSelectProps<T | "">) => react_jsx_runtime.JSX.Element;

export { OphSelect, type OphSelectOption, type OphSelectProps, type OphSelectValue };
8 changes: 8 additions & 0 deletions dist/OphSelect.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/OphSelect.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions dist/OphTypography.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as react from 'react';
import { TypographyProps, Theme } from '@mui/material';
import { SystemProps } from '@mui/system';

type OmittedSystemPropNames = keyof Omit<SystemProps<Theme>, 'color'>;
type OphTypographyProps = Omit<TypographyProps & {
variant?: 'button' | 'body1' | 'body2' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'label';
}, OmittedSystemPropNames | 'paragraph' | 'variantMapping'>;
declare const OphTypography: react.ForwardRefExoticComponent<Omit<OphTypographyProps, "ref"> & react.RefAttributes<HTMLElement>>;

export { OphTypography, type OphTypographyProps };
7 changes: 7 additions & 0 deletions dist/OphTypography.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/OphTypography.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions dist/chunk-5ST33H5N.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/chunk-5ST33H5N.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions dist/chunk-5VLNADN3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/chunk-5VLNADN3.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d094060

Please sign in to comment.