@foi/design-system 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +104 -51
  2. package/dist/{RadioGroup-D2s7AY6E.js → RadioGroup-BL2bdmZx.js} +98 -100
  3. package/dist/RadioGroup-BL2bdmZx.js.map +1 -0
  4. package/dist/{RadioGroup.context-zJGC5Sjc.js → RadioGroup.context-BdRgENJJ.js} +149 -99
  5. package/dist/RadioGroup.context-BdRgENJJ.js.map +1 -0
  6. package/dist/{Switch-CKpSiHQK.js → Switch-BS8iwAJ5.js} +630 -637
  7. package/dist/Switch-BS8iwAJ5.js.map +1 -0
  8. package/dist/ThemeProvider-JlN3U_r2.js +39 -0
  9. package/dist/ThemeProvider-JlN3U_r2.js.map +1 -0
  10. package/dist/atoms.d.ts +1 -0
  11. package/dist/atoms.mjs +3 -3
  12. package/dist/components/atoms/Checkbox/Checkbox.interface.d.ts +4 -0
  13. package/dist/components/atoms/Checkbox/index.d.ts +1 -1
  14. package/dist/components/atoms/Icon/Icon.d.ts +10 -0
  15. package/dist/components/atoms/Icon/Icon.emotion.d.ts +2 -0
  16. package/dist/components/atoms/Icon/Icon.interface.d.ts +17 -0
  17. package/dist/components/atoms/Icon/index.d.ts +1 -0
  18. package/dist/{emotion-react-jsx-runtime.browser.esm-BFNmScj4.js → emotion-react-jsx-runtime.browser.esm-ClrpcFMG.js} +169 -167
  19. package/dist/emotion-react-jsx-runtime.browser.esm-ClrpcFMG.js.map +1 -0
  20. package/dist/hocs/ThemeProvider/ThemeProvider.interface.d.ts +2 -2
  21. package/dist/hocs/ThemeProvider/components/Button.d.ts +17 -27
  22. package/dist/hocs/ThemeProvider/components/Checkbox.d.ts +23 -45
  23. package/dist/hocs/ThemeProvider/components/CheckboxGroup.d.ts +11 -14
  24. package/dist/hocs/ThemeProvider/components/CheckboxTree.d.ts +11 -14
  25. package/dist/hocs/ThemeProvider/components/DatePicker.d.ts +23 -45
  26. package/dist/hocs/ThemeProvider/components/DatePickerMenu.d.ts +17 -27
  27. package/dist/hocs/ThemeProvider/components/IconButton.d.ts +20 -28
  28. package/dist/hocs/ThemeProvider/components/Input.d.ts +23 -45
  29. package/dist/hocs/ThemeProvider/components/Radio.d.ts +23 -45
  30. package/dist/hocs/ThemeProvider/components/RadioGroup.d.ts +11 -14
  31. package/dist/hocs/ThemeProvider/components/Select.d.ts +23 -45
  32. package/dist/hocs/ThemeProvider/components/SelectMenu.d.ts +16 -24
  33. package/dist/hocs/ThemeProvider/components/Slider.d.ts +15 -26
  34. package/dist/hocs/ThemeProvider/components/Switch.d.ts +18 -30
  35. package/dist/hocs/ThemeProvider/createComponentStyles.d.ts +2 -1
  36. package/dist/hocs/ThemeProvider/useThemeProvider.hook.d.ts +1 -1
  37. package/dist/hocs.mjs +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.mjs +6 -6
  40. package/dist/molecules.mjs +1 -1
  41. package/dist/theme/dark/components/Button.d.ts +29 -27
  42. package/dist/theme/dark/components/Checkbox.d.ts +117 -54
  43. package/dist/theme/dark/components/CheckboxGroup.d.ts +13 -11
  44. package/dist/theme/dark/components/CheckboxTree.d.ts +12 -10
  45. package/dist/theme/dark/components/DatePicker.d.ts +53 -51
  46. package/dist/theme/dark/components/DatePickerMenu.d.ts +24 -22
  47. package/dist/theme/dark/components/IconButton.d.ts +24 -22
  48. package/dist/theme/dark/components/Input.d.ts +53 -51
  49. package/dist/theme/dark/components/Radio.d.ts +56 -54
  50. package/dist/theme/dark/components/RadioGroup.d.ts +13 -11
  51. package/dist/theme/dark/components/Select.d.ts +53 -51
  52. package/dist/theme/dark/components/SelectMenu.d.ts +23 -21
  53. package/dist/theme/dark/components/Slider.d.ts +41 -39
  54. package/dist/theme/dark/components/Switch.d.ts +49 -47
  55. package/dist/theme/dark/components/index.d.ts +567 -478
  56. package/dist/theme/dark/index.d.ts +567 -478
  57. package/dist/theme/index.d.ts +567 -478
  58. package/dist/{theme-DEqiATmv.js → theme-D18AZjTt.js} +112 -61
  59. package/dist/theme-D18AZjTt.js.map +1 -0
  60. package/dist/theme.mjs +1 -1
  61. package/package.json +1 -4
  62. package/dist/RadioGroup-D2s7AY6E.js.map +0 -1
  63. package/dist/RadioGroup.context-zJGC5Sjc.js.map +0 -1
  64. package/dist/Switch-CKpSiHQK.js.map +0 -1
  65. package/dist/ThemeProvider-oFEpvMxv.js +0 -37
  66. package/dist/ThemeProvider-oFEpvMxv.js.map +0 -1
  67. package/dist/emotion-react-jsx-runtime.browser.esm-BFNmScj4.js.map +0 -1
  68. package/dist/theme-DEqiATmv.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeProvider-JlN3U_r2.js","names":[],"sources":["../src/hocs/ThemeProvider/fonts/loadFonts.ts","../src/hocs/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["const mulishRegular = new URL('../../../assets/fonts/Mulish/Mulish-Regular.ttf', import.meta.url).href;\nconst mulishMedium = new URL('../../../assets/fonts/Mulish/Mulish-Medium.ttf', import.meta.url).href;\nconst mulishSemiBold = new URL('../../../assets/fonts/Mulish/Mulish-SemiBold.ttf', import.meta.url).href;\nconst mulishBold = new URL('../../../assets/fonts/Mulish/Mulish-Bold.ttf', import.meta.url).href;\n\nconst leagueSpartanRegular = new URL('../../../assets/fonts/LeagueSpartan/LeagueSpartan-Regular.ttf', import.meta.url)\n .href;\nconst leagueSpartanBold = new URL('../../../assets/fonts/LeagueSpartan/LeagueSpartan-Bold.ttf', import.meta.url).href;\n\nconst googleSansCodeLight = new URL('../../../assets/fonts/GoogleSansCode/Light.ttf', import.meta.url).href;\nconst googleSansCodeLightItalic = new URL('../../../assets/fonts/GoogleSansCode/LightItalic.ttf', import.meta.url).href;\nconst googleSansCodeRegular = new URL('../../../assets/fonts/GoogleSansCode/Regular.ttf', import.meta.url).href;\nconst googleSansCodeItalic = new URL('../../../assets/fonts/GoogleSansCode/Italic.ttf', import.meta.url).href;\nconst googleSansCodeMedium = new URL('../../../assets/fonts/GoogleSansCode/Medium.ttf', import.meta.url).href;\nconst googleSansCodeMediumItalic = new URL('../../../assets/fonts/GoogleSansCode/MediumItalic.ttf', import.meta.url)\n .href;\nconst googleSansCodeSemiBold = new URL('../../../assets/fonts/GoogleSansCode/SemiBold.ttf', import.meta.url).href;\nconst googleSansCodeSemiBoldItalic = new URL('../../../assets/fonts/GoogleSansCode/SemiBoldItalic.ttf', import.meta.url)\n .href;\nconst googleSansCodeBold = new URL('../../../assets/fonts/GoogleSansCode/Bold.ttf', import.meta.url).href;\nconst googleSansCodeBoldItalic = new URL('../../../assets/fonts/GoogleSansCode/BoldItalic.ttf', import.meta.url).href;\n\nconst materialSymbolsRounded = new URL(\n '../../../assets/fonts/MaterialSymbolsRounded/MaterialSymbolsRounded.woff2',\n import.meta.url,\n).href;\n\nconst fontFaceCSS = `\n@font-face { font-family: 'Mulish'; src: url('${mulishRegular}') format('truetype'); }\n@font-face { font-family: 'Mulish'; src: url('${mulishMedium}') format('truetype'); font-weight: 500; }\n@font-face { font-family: 'Mulish'; src: url('${mulishSemiBold}') format('truetype'); font-weight: 600; }\n@font-face { font-family: 'Mulish'; src: url('${mulishBold}') format('truetype'); font-weight: 700; }\n\n@font-face { font-family: 'League Spartan'; src: url('${leagueSpartanRegular}') format('truetype'); }\n@font-face { font-family: 'League Spartan'; src: url('${leagueSpartanBold}') format('truetype'); font-weight: bold; }\n\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeLight}') format('truetype'); font-weight: 300; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeLightItalic}') format('truetype'); font-weight: 300; font-style: italic; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeRegular}') format('truetype'); font-weight: 400; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeItalic}') format('truetype'); font-weight: 400; font-style: italic; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeMedium}') format('truetype'); font-weight: 500; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeMediumItalic}') format('truetype'); font-weight: 500; font-style: italic; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeSemiBold}') format('truetype'); font-weight: 600; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeSemiBoldItalic}') format('truetype'); font-weight: 600; font-style: italic; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeBold}') format('truetype'); font-weight: 700; }\n@font-face { font-family: 'Google Sans Code'; src: url('${googleSansCodeBoldItalic}') format('truetype'); font-weight: 700; font-style: italic; }\n\n@font-face { font-family: 'Material Symbols Rounded'; src: url('${materialSymbolsRounded}') format('woff2'); font-weight: 100 900; font-style: normal; font-display: block; }\n`;\n\nlet injected = false;\n\nexport const loadFonts = () => {\n console.log('loadFonts called, injected:', injected);\n if (typeof document === 'undefined' || injected) return;\n injected = true;\n const style = document.createElement('style');\n style.textContent = fontFaceCSS;\n document.head.appendChild(style);\n console.log('font style injected');\n};\n","import { useLayoutEffect } from 'react';\nimport { ThemeProviderComponent } from './ThemeProvider.interface';\nimport type { Theme } from './ThemeProvider.interface';\nimport { useCreateThemeStyles } from './useThemeProvider.hook';\nimport { loadFonts } from './fonts/loadFonts';\n\nconst ThemeProvider = <T extends readonly Theme[]>(props: ThemeProviderComponent<T>) => {\n const { themes, theme: selectedTheme, children } = props;\n useCreateThemeStyles(themes, selectedTheme);\n useLayoutEffect(() => {\n loadFonts();\n }, []);\n\n return <>{children}</>;\n};\n\nexport default ThemeProvider;\n"],"mappings":";;;AA2BA,IAAM,IAAc;gDA3BE,IAAA,IAAA,iv1IAAA,KAAA,OAAA,KAAA,IAA2E,CAAC,KA4BpC;gDA3BzC,IAAA,IAAA,qy1IAAA,KAAA,OAAA,KAAA,IAA0E,CAAC,KA4BnC;gDA3BtC,IAAA,IAAA,qt1IAAA,KAAA,OAAA,KAAA,IAA4E,CAAC,KA4BrC;gDA3B5C,IAAA,IA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F,IAAM,EAAE,WAAQ,OAAO,GAAe,gBAAa;CAMnD,OALA,EAAqB,GAAQ,EAAc,EAC3C,QAAsB;EACpB,GAAW;IACV,EAAE,CAAC,EAEC,kBAAA,GAAA,EAAG,aAAY,CAAA"}
package/dist/atoms.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as Button } from './components/atoms/Button';
2
+ export { default as Icon } from './components/atoms/Icon';
2
3
  export { default as Checkbox } from './components/atoms/Checkbox';
3
4
  export { default as DatePicker } from './components/atoms/DatePicker';
4
5
  export { default as IconButton } from './components/atoms/IconButton';
package/dist/atoms.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as e } from "./RadioGroup.context-zJGC5Sjc.js";
2
- import { a as t, c as n, i as r, n as i, o as a, r as o, s, t as c } from "./Switch-CKpSiHQK.js";
3
- export { n as Button, e as Checkbox, a as DatePicker, s as IconButton, t as Input, r as Radio, o as Select, i as Slider, c as Switch };
1
+ import { a as e, n as t } from "./RadioGroup.context-BdRgENJJ.js";
2
+ import { a as n, c as r, i, n as a, o, r as s, s as c, t as l } from "./Switch-BS8iwAJ5.js";
3
+ export { r as Button, t as Checkbox, o as DatePicker, e as Icon, c as IconButton, n as Input, i as Radio, s as Select, a as Slider, l as Switch };
@@ -53,6 +53,10 @@ export interface CheckboxStyleProps<TFieldValues extends FieldValues = FieldValu
53
53
  className?: string;
54
54
  /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
55
55
  theme?: EVENTS;
56
+ /** Selects the style variant defined in the theme.
57
+ * @default 'default'
58
+ */
59
+ variant?: string;
56
60
  /** Controlled mode — callback fired when the checked state changes.
57
61
  * Use this prop together with the `checked` attribute instead of RHF `control`.
58
62
  */
@@ -1,4 +1,4 @@
1
1
  import type { CheckboxStyleProps } from './Checkbox.interface';
2
2
  import type { FieldValues } from 'react-hook-form';
3
- declare const Checkbox: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: CheckboxStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
3
+ declare const Checkbox: <TFieldValues extends FieldValues = FieldValues>({ theme, variant, ...rest }: CheckboxStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
4
  export default Checkbox;
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { IconProps } from './Icon.interface';
3
+ /**
4
+ * Renders a single Material Symbols Rounded icon using font ligatures.
5
+ *
6
+ * Pass the ligature name as `name` (e.g. `'home'`, `'search'`, `'close'`).
7
+ * The icon font is loaded once by `ThemeProvider` — no extra requests per icon.
8
+ */
9
+ declare const Icon: FC<IconProps>;
10
+ export default Icon;
@@ -0,0 +1,2 @@
1
+ declare const Style: () => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,17 @@
1
+ import type { CSSProperties } from 'react';
2
+ export interface IconProps {
3
+ /** Material Symbols ligature name, e.g. `'home'`, `'search'`, `'close'`. */
4
+ name: string;
5
+ /** When `true`, renders the filled variant of the icon.
6
+ * @default false
7
+ */
8
+ fill?: boolean;
9
+ /** Icon size. `'md'` corresponds to 20 px (default).
10
+ * @default 'md'
11
+ */
12
+ size?: 'sm' | 'md' | 'lg' | 'xl';
13
+ /** Additional CSS class applied to the root element. */
14
+ className?: string;
15
+ /** Inline styles applied to the root element. */
16
+ style?: CSSProperties;
17
+ }
@@ -0,0 +1 @@
1
+ export { default } from './Icon';