@foi/design-system 0.0.18 → 0.0.19
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.
- package/README.md +658 -63
- package/dist/{DatePicker.utils-ytCEcs6T.js → DatePicker.utils-BAUVa26Q.js} +2 -2
- package/dist/{DatePicker.utils-ytCEcs6T.js.map → DatePicker.utils-BAUVa26Q.js.map} +1 -1
- package/dist/{emotion-react-jsx-runtime.browser.esm-Ct_bZ5JG.js → IconButton-C3x-E-ot.js} +458 -248
- package/dist/IconButton-C3x-E-ot.js.map +1 -0
- package/dist/{RadioGroup-D_R-nwCD.js → RadioGroup-Cvt9MtvM.js} +71 -71
- package/dist/{RadioGroup-D_R-nwCD.js.map → RadioGroup-Cvt9MtvM.js.map} +1 -1
- package/dist/RadioGroup.context-v_CCYB7_.js +392 -0
- package/dist/RadioGroup.context-v_CCYB7_.js.map +1 -0
- package/dist/{Switch-DK5hEXUS.js → Switch-6eNmT34-.js} +315 -315
- package/dist/{Switch-DK5hEXUS.js.map → Switch-6eNmT34-.js.map} +1 -1
- package/dist/{ThemeProvider-BlqXHfU_.js → ThemeProvider-C_PzAJz3.js} +11 -6
- package/dist/{ThemeProvider-BlqXHfU_.js.map → ThemeProvider-C_PzAJz3.js.map} +1 -1
- package/dist/Toast-_9W7YGxS.js +146 -0
- package/dist/Toast-_9W7YGxS.js.map +1 -0
- package/dist/atoms.mjs +4 -3
- package/dist/components/atoms/Button/Button.interface.d.ts +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.interface.d.ts +3 -3
- package/dist/components/atoms/Chip/Chip.d.ts +4 -0
- package/dist/components/atoms/Chip/Chip.emotion.d.ts +2 -0
- package/dist/components/atoms/Chip/Chip.interface.d.ts +14 -0
- package/dist/components/atoms/Chip/index.d.ts +5 -0
- package/dist/components/atoms/DatePicker/DatePicker.interface.d.ts +2 -2
- package/dist/components/atoms/DatePicker/DatePickerMenu/DatePickerMenu.interface.d.ts +3 -3
- package/dist/components/atoms/IconButton/IconButton.interface.d.ts +2 -2
- package/dist/components/atoms/NumberField/NumberField.interface.d.ts +2 -2
- package/dist/components/atoms/Radio/Radio.interface.d.ts +2 -2
- package/dist/components/atoms/Select/Select.interface.d.ts +2 -2
- package/dist/components/atoms/Select/SelectMenu/SelectMenu.interface.d.ts +1 -1
- package/dist/components/atoms/Slider/Slider.interface.d.ts +4 -4
- package/dist/components/atoms/Switch/Switch.interface.d.ts +1 -1
- package/dist/components/atoms/TextField/TextField.interface.d.ts +2 -2
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.interface.d.ts +2 -2
- package/dist/components/molecules/CheckboxTree/CheckboxTree.interface.d.ts +2 -2
- package/dist/components/molecules/Modal/Modal.interface.d.ts +4 -4
- package/dist/components/molecules/RadioGroup/RadioGroup.interface.d.ts +2 -2
- package/dist/components/molecules/Toast/Toast.context.d.ts +2 -0
- package/dist/components/molecules/Toast/Toast.d.ts +4 -0
- package/dist/components/molecules/Toast/Toast.emotion.d.ts +4 -0
- package/dist/components/molecules/Toast/Toast.hook.d.ts +1 -0
- package/dist/components/molecules/Toast/Toast.interface.d.ts +33 -0
- package/dist/components/molecules/Toast/Toast.provider.d.ts +3 -0
- package/dist/components/molecules/Toast/index.d.ts +3 -0
- package/dist/components/organisms/DataGrid/DataGrid.interface.d.ts +3 -3
- package/dist/components/organisms/DataGrid/DataGridMenu/DataGridMenu.interface.d.ts +1 -1
- package/dist/hocs/ThemeProvider/ThemeProvider.interface.d.ts +6 -0
- package/dist/hocs/ThemeProvider/components/{Button.d.ts → atoms/Button.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Checkbox.d.ts → atoms/Checkbox.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/atoms/Chip.d.ts +13 -0
- package/dist/hocs/ThemeProvider/components/{DatePicker.d.ts → atoms/DatePicker.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{DatePickerMenu.d.ts → atoms/DatePickerMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{IconButton.d.ts → atoms/IconButton.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{NumberField.d.ts → atoms/NumberField.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Pagination.d.ts → atoms/Pagination.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{PaginationMenu.d.ts → atoms/PaginationMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Radio.d.ts → atoms/Radio.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Select.d.ts → atoms/Select.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{SelectMenu.d.ts → atoms/SelectMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Slider.d.ts → atoms/Slider.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Switch.d.ts → atoms/Switch.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{TextField.d.ts → atoms/TextField.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/index.d.ts +23 -17
- package/dist/hocs/ThemeProvider/components/{CheckboxGroup.d.ts → molecules/CheckboxGroup.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{CheckboxTree.d.ts → molecules/CheckboxTree.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Modal.d.ts → molecules/Modal.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{RadioGroup.d.ts → molecules/RadioGroup.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/molecules/Toast.d.ts +16 -0
- package/dist/hocs/ThemeProvider/components/{DataGrid.d.ts → organisms/DataGrid.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{DataGridMenu.d.ts → organisms/DataGridMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/interfaces/Components.interface.d.ts +2 -0
- package/dist/hocs.mjs +1 -1
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +247 -239
- package/dist/index.mjs.map +1 -1
- package/dist/molecules.d.ts +2 -0
- package/dist/molecules.mjs +3 -2
- package/dist/theme/dark/components/atoms/Chip.d.ts +13 -0
- package/dist/theme/dark/components/index.d.ts +287 -263
- package/dist/theme/dark/components/molecules/Toast.d.ts +17 -0
- package/dist/theme/dark/index.d.ts +287 -263
- package/dist/theme/index.d.ts +287 -263
- package/dist/{theme-CLkxVsoE.js → theme-BjrtNRDQ.js} +230 -218
- package/dist/theme-BjrtNRDQ.js.map +1 -0
- package/dist/theme.mjs +1 -1
- package/dist/utilities.mjs +1 -1
- package/package.json +1 -1
- package/dist/RadioGroup.context-CdFGi5z1.js +0 -601
- package/dist/RadioGroup.context-CdFGi5z1.js.map +0 -1
- package/dist/emotion-react-jsx-runtime.browser.esm-Ct_bZ5JG.js.map +0 -1
- package/dist/theme-CLkxVsoE.js.map +0 -1
- /package/dist/theme/dark/components/{Button.d.ts → atoms/Button.d.ts} +0 -0
- /package/dist/theme/dark/components/{Checkbox.d.ts → atoms/Checkbox.d.ts} +0 -0
- /package/dist/theme/dark/components/{DatePicker.d.ts → atoms/DatePicker.d.ts} +0 -0
- /package/dist/theme/dark/components/{DatePickerMenu.d.ts → atoms/DatePickerMenu.d.ts} +0 -0
- /package/dist/theme/dark/components/{IconButton.d.ts → atoms/IconButton.d.ts} +0 -0
- /package/dist/theme/dark/components/{NumberField.d.ts → atoms/NumberField.d.ts} +0 -0
- /package/dist/theme/dark/components/{Pagination.d.ts → atoms/Pagination.d.ts} +0 -0
- /package/dist/theme/dark/components/{PaginationMenu.d.ts → atoms/PaginationMenu.d.ts} +0 -0
- /package/dist/theme/dark/components/{Radio.d.ts → atoms/Radio.d.ts} +0 -0
- /package/dist/theme/dark/components/{Select.d.ts → atoms/Select.d.ts} +0 -0
- /package/dist/theme/dark/components/{SelectMenu.d.ts → atoms/SelectMenu.d.ts} +0 -0
- /package/dist/theme/dark/components/{Slider.d.ts → atoms/Slider.d.ts} +0 -0
- /package/dist/theme/dark/components/{Switch.d.ts → atoms/Switch.d.ts} +0 -0
- /package/dist/theme/dark/components/{TextField.d.ts → atoms/TextField.d.ts} +0 -0
- /package/dist/theme/dark/components/{CheckboxGroup.d.ts → molecules/CheckboxGroup.d.ts} +0 -0
- /package/dist/theme/dark/components/{CheckboxTree.d.ts → molecules/CheckboxTree.d.ts} +0 -0
- /package/dist/theme/dark/components/{Modal.d.ts → molecules/Modal.d.ts} +0 -0
- /package/dist/theme/dark/components/{RadioGroup.d.ts → molecules/RadioGroup.d.ts} +0 -0
- /package/dist/theme/dark/components/{DataGrid.d.ts → organisms/DataGrid.d.ts} +0 -0
- /package/dist/theme/dark/components/{DataGridMenu.d.ts → organisms/DataGridMenu.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider-
|
|
1
|
+
{"version":3,"file":"ThemeProvider-C_PzAJz3.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 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};\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';\nimport { ToastProvider } from '@components/molecules/Toast';\n\nconst ThemeProvider = <T extends readonly Theme[]>(props: ThemeProviderComponent<T>) => {\n const { themes, theme: selectedTheme, children, toast } = props;\n useCreateThemeStyles(themes, selectedTheme);\n useLayoutEffect(() => {\n loadFonts();\n }, []);\n\n return (\n <ToastProvider position={toast?.position} duration={toast?.duration}>\n {children}\n </ToastProvider>\n );\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,IAAA,iz1IAAA,KAAA,OAAA,KAAA,IAAwE,CAAC,KA4BjC;;wDA1B9B,IAAA,IAAA,im0EAAA,KAAA,OAAA,KAAA,IAAyF,CACnH,KA2B0E;wDA1BnD,IAAA,IAAA,yv0EAAA,KAAA,OAAA,KAAA,IAAsF,CAAC,KA2BvC;;0DAzB9C,IAAA,IAAA,qgvEAAA,KAAA,OAAA,KAAA,IAA0E,CAAC,KA2BzB;0DA1B5C,IAAA,IAAA,q30EAAA,KAAA,OAAA,KAAA,IAAgF,CAAC,KA2B/B;0DA1BtD,IAAA,IAAA,yqvEAAA,KAAA,OAAA,KAAA,IAA4E,CAAC,KA2B3B;0DA1BnD,IAAA,IAAA,y80EAAA,KAAA,OAAA,KAAA,IAA2E,CAAC,KA2B1B;0DA1BlD,IAAA,IAAA,ykvEAAA,KAAA,OAAA,KAAA,IAA2E,CAAC,KA2B1B;0DA1B5C,IAAA,IAAA,qj1EAAA,KAAA,OAAA,KAAA,IAAiF,CACjH,KA0BkF;0DAzBtD,IAAA,IAAA,ihwEAAA,KAAA,OAAA,KAAA,IAA6E,CAAC,KA0B5B;0DAzB5C,IAAA,IAAA,y/1EAAA,KAAA,OAAA,KAAA,IAAmF,CACrH,KAyBoF;0DAxB5D,IAAA,IAAA,qxwEAAA,KAAA,OAAA,KAAA,IAAyE,CAAC,KAyBxB;0DAxB5C,IAAA,IAAA,qo2EAAA,KAAA,OAAA,KAAA,IAA+E,CAAC,KAyB9B;;kEAvBpD,IAAA,IAAA,m7pxNAAA,KAAA,OAAA,KAAA,IAG9B,CAAC,KAsBuF;GAGrF,IAAW,IAEF,UAAkB;CAC7B,IAAI,OAAO,WAAa,OAAe,GAAU;CACjD,IAAW;CACX,IAAM,IAAQ,SAAS,cAAc,QAAQ;CAE7C,AADA,EAAM,cAAc,GACpB,SAAS,KAAK,YAAY,EAAM;GClD5B,KAA6C,MAAqC;CACtF,IAAM,EAAE,WAAQ,OAAO,GAAe,aAAU,aAAU;CAM1D,OALA,EAAqB,GAAQ,EAAc,EAC3C,QAAsB;EACpB,GAAW;IACV,EAAE,CAAC,EAGJ,kBAAC,GAAD;EAAe,UAAU,GAAO;EAAU,UAAU,GAAO;EACxD;EACa,CAAA"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { a as e, i as t, n, o as r, s as i, t as a } from "./IconButton-C3x-E-ot.js";
|
|
2
|
+
import { r as o } from "./theme-BjrtNRDQ.js";
|
|
3
|
+
import { createContext as s, useCallback as c, useContext as l, useMemo as u, useState as d } from "react";
|
|
4
|
+
import { css as f, keyframes as p } from "@emotion/react";
|
|
5
|
+
//#region src/components/molecules/Toast/Toast.emotion.ts
|
|
6
|
+
var m = (e) => {
|
|
7
|
+
let t = e.endsWith("left"), n = e.endsWith("center"), r = e.startsWith("top");
|
|
8
|
+
return n ? r ? "translateY(-20px)" : "translateY(20px)" : t ? "translateX(-20px)" : "translateX(20px)";
|
|
9
|
+
}, h = (e) => p`
|
|
10
|
+
from { transform: ${m(e)}; opacity: 0; }
|
|
11
|
+
to { transform: none; opacity: 1; }
|
|
12
|
+
`, g = (e) => p`
|
|
13
|
+
from { transform: none; opacity: 1; }
|
|
14
|
+
to { transform: ${m(e)}; opacity: 0; }
|
|
15
|
+
`, _ = (e = "bottom-right") => {
|
|
16
|
+
let t = e.startsWith("top"), n = e.endsWith("center"), r = e.endsWith("left");
|
|
17
|
+
return f`
|
|
18
|
+
&.--TOAST-zone {
|
|
19
|
+
position: fixed;
|
|
20
|
+
${t ? "top: 24px;" : "bottom: 24px;"}
|
|
21
|
+
${n ? "left: 50%; transform: translateX(-50%);" : r ? "left: 24px;" : "right: 24px;"}
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: ${t ? "column" : "column-reverse"};
|
|
24
|
+
gap: 8px;
|
|
25
|
+
z-index: 9000;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
}, v = (e) => `
|
|
30
|
+
// BORDERS
|
|
31
|
+
${o(e, "border-color", "--TOAST-EVENTS-ENABLED-BORDER-COLOR")}
|
|
32
|
+
${o(e, "border-width", "--TOAST-EVENTS-ENABLED-BORDER-WIDTH")}
|
|
33
|
+
${o(e, "border-style", "--TOAST-EVENTS-ENABLED-BORDER-STYLE")}
|
|
34
|
+
`, y = (e, t = "bottom-right") => f`
|
|
35
|
+
&.--TOAST {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: 10px;
|
|
39
|
+
padding: 12px;
|
|
40
|
+
min-width: 280px;
|
|
41
|
+
max-width: 420px;
|
|
42
|
+
height: 48px;
|
|
43
|
+
pointer-events: auto;
|
|
44
|
+
box-shadow:
|
|
45
|
+
rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,
|
|
46
|
+
rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
|
|
47
|
+
rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
animation: ${h(t)} 150ms ease-in-out;
|
|
50
|
+
|
|
51
|
+
&.--TOAST-exiting {
|
|
52
|
+
animation: ${g(t)} 150ms ease-in-out forwards;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
${o(e, "border-radius", "--TOAST-ROOT-BORDER-RADIUS")};
|
|
56
|
+
${o(e, "background-color", "--TOAST-EVENTS-ENABLED-BACKGROUND-COLOR")};
|
|
57
|
+
${o(e, "color", "--TOAST-EVENTS-ENABLED-COLOR-PRIMARY")};
|
|
58
|
+
${v(e)};
|
|
59
|
+
|
|
60
|
+
.--TOAST-icon {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
${o(e, "color", "--TOAST-EVENTS-ENABLED-ICON-COLOR")};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.--TOAST-message {
|
|
68
|
+
flex: 1;
|
|
69
|
+
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
70
|
+
font-size: 0.875rem;
|
|
71
|
+
line-height: 1.4;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`, b = "--TOAST", x = ({ message: r, icon: i, style: o = {}, position: s = "bottom-right", exiting: c, closable: l, onClose: u }) => /* @__PURE__ */ e("div", {
|
|
75
|
+
className: [b, c ? `${b}-exiting` : ""].filter(Boolean).join(" "),
|
|
76
|
+
css: y(o, s),
|
|
77
|
+
role: "status",
|
|
78
|
+
"data-testid": b,
|
|
79
|
+
children: [
|
|
80
|
+
i && /* @__PURE__ */ t("span", {
|
|
81
|
+
className: `${b}-icon`,
|
|
82
|
+
"data-testid": `${b}-icon`,
|
|
83
|
+
children: /* @__PURE__ */ t(n, { name: i })
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ t("span", {
|
|
86
|
+
className: `${b}-message`,
|
|
87
|
+
"data-testid": `${b}-message`,
|
|
88
|
+
children: r
|
|
89
|
+
}),
|
|
90
|
+
l && u && /* @__PURE__ */ t(a, {
|
|
91
|
+
icon: /* @__PURE__ */ t(n, { name: "close" }),
|
|
92
|
+
onClick: u,
|
|
93
|
+
"data-testid": `${b}-close`
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}), S = s(null), C = "--TOAST", w = 300, T = ({ message: e, variant: n, icon: a, position: o, exiting: s, closable: c, onClose: l }) => {
|
|
97
|
+
let { componentStyles: u } = i([r.TOAST], void 0, n.toUpperCase());
|
|
98
|
+
return /* @__PURE__ */ t(x, {
|
|
99
|
+
message: e,
|
|
100
|
+
icon: a,
|
|
101
|
+
style: u,
|
|
102
|
+
position: o,
|
|
103
|
+
exiting: s,
|
|
104
|
+
closable: c,
|
|
105
|
+
onClose: l
|
|
106
|
+
});
|
|
107
|
+
}, E = ({ children: n, duration: r = 3e3, position: i = "bottom-right" }) => {
|
|
108
|
+
let [a, o] = d([]), s = c((e) => {
|
|
109
|
+
o((t) => t.map((t) => t.id === e ? {
|
|
110
|
+
...t,
|
|
111
|
+
exiting: !0
|
|
112
|
+
} : t)), window.setTimeout(() => o((t) => t.filter((t) => t.id !== e)), w);
|
|
113
|
+
}, []), l = c((e, t = {}) => {
|
|
114
|
+
let { variant: n = "default", icon: i, duration: a, closable: c } = t, l = crypto.randomUUID();
|
|
115
|
+
o((t) => [...t, {
|
|
116
|
+
id: l,
|
|
117
|
+
message: e,
|
|
118
|
+
variant: n,
|
|
119
|
+
icon: i,
|
|
120
|
+
closable: c
|
|
121
|
+
}]), window.setTimeout(() => s(l), a ?? r);
|
|
122
|
+
}, [r, s]), f = u(() => ({ push: l }), [l]);
|
|
123
|
+
return /* @__PURE__ */ e(S.Provider, {
|
|
124
|
+
value: f,
|
|
125
|
+
children: [n, /* @__PURE__ */ t("div", {
|
|
126
|
+
className: `${C}-zone`,
|
|
127
|
+
css: _(i),
|
|
128
|
+
"aria-live": "polite",
|
|
129
|
+
"aria-atomic": "true",
|
|
130
|
+
"data-testid": `${C}-zone`,
|
|
131
|
+
children: a.map((e) => /* @__PURE__ */ t(T, {
|
|
132
|
+
...e,
|
|
133
|
+
position: i,
|
|
134
|
+
onClose: () => s(e.id)
|
|
135
|
+
}, e.id))
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
}, D = () => {
|
|
139
|
+
let e = l(S);
|
|
140
|
+
if (!e) throw Error("useToast must be used inside <ToastProvider>");
|
|
141
|
+
return e;
|
|
142
|
+
};
|
|
143
|
+
//#endregion
|
|
144
|
+
export { E as n, D as t };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=Toast-_9W7YGxS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast-_9W7YGxS.js","names":[],"sources":["../src/components/molecules/Toast/Toast.emotion.ts","../src/components/molecules/Toast/Toast.tsx","../src/components/molecules/Toast/Toast.context.ts","../src/components/molecules/Toast/Toast.provider.tsx","../src/components/molecules/Toast/Toast.hook.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\nimport { getStyle } from '@utilities/emotion/styles';\nimport type { ToastPosition } from './Toast.interface';\n\nconst getOffset = (position: ToastPosition): string => {\n const isLeft = position.endsWith('left');\n const isCenter = position.endsWith('center');\n const isTop = position.startsWith('top');\n if (isCenter) return isTop ? 'translateY(-20px)' : 'translateY(20px)';\n return isLeft ? 'translateX(-20px)' : 'translateX(20px)';\n};\n\nconst getToastIn = (position: ToastPosition) => keyframes`\n from { transform: ${getOffset(position)}; opacity: 0; }\n to { transform: none; opacity: 1; }\n`;\n\nconst getToastOut = (position: ToastPosition) => keyframes`\n from { transform: none; opacity: 1; }\n to { transform: ${getOffset(position)}; opacity: 0; }\n`;\n\nexport const zoneStyle = (position: ToastPosition = 'bottom-right') => {\n const isTop = position.startsWith('top');\n const isCenter = position.endsWith('center');\n const isLeft = position.endsWith('left');\n\n return css`\n &.--TOAST-zone {\n position: fixed;\n ${isTop ? 'top: 24px;' : 'bottom: 24px;'}\n ${isCenter ? 'left: 50%; transform: translateX(-50%);' : isLeft ? 'left: 24px;' : 'right: 24px;'}\n display: flex;\n flex-direction: ${isTop ? 'column' : 'column-reverse'};\n gap: 8px;\n z-index: 9000;\n pointer-events: none;\n }\n `;\n};\n\nconst border = (theme: Record<string, string>): string => {\n return `\n // BORDERS\n ${getStyle(theme, 'border-color', `--TOAST-EVENTS-ENABLED-BORDER-COLOR`)}\n ${getStyle(theme, 'border-width', `--TOAST-EVENTS-ENABLED-BORDER-WIDTH`)}\n ${getStyle(theme, 'border-style', `--TOAST-EVENTS-ENABLED-BORDER-STYLE`)}\n `;\n};\n\nconst itemStyle = (theme: Record<string, string>, position: ToastPosition = 'bottom-right') => css`\n &.--TOAST {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 12px;\n min-width: 280px;\n max-width: 420px;\n height: 48px;\n pointer-events: auto;\n box-shadow:\n rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,\n rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,\n rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;\n box-sizing: border-box;\n animation: ${getToastIn(position)} 150ms ease-in-out;\n\n &.--TOAST-exiting {\n animation: ${getToastOut(position)} 150ms ease-in-out forwards;\n }\n\n ${getStyle(theme, 'border-radius', '--TOAST-ROOT-BORDER-RADIUS')};\n ${getStyle(theme, 'background-color', '--TOAST-EVENTS-ENABLED-BACKGROUND-COLOR')};\n ${getStyle(theme, 'color', '--TOAST-EVENTS-ENABLED-COLOR-PRIMARY')};\n ${border(theme)};\n\n .--TOAST-icon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n ${getStyle(theme, 'color', '--TOAST-EVENTS-ENABLED-ICON-COLOR')};\n }\n\n .--TOAST-message {\n flex: 1;\n font-family: ${theme['--FONTFAMILY-PRIMARY']};\n font-size: 0.875rem;\n line-height: 1.4;\n }\n }\n`;\n\nexport default itemStyle;\n","import type { FC } from 'react';\nimport Icon from '@components/atoms/Icon';\nimport IconButton from '@components/atoms/IconButton';\nimport itemStyle from './Toast.emotion';\nimport type { ToastBaseProps } from './Toast.interface';\n\nconst CLASS = '--TOAST';\n\nconst Toast: FC<ToastBaseProps> = ({\n message,\n icon,\n style = {},\n position = 'bottom-right',\n exiting,\n closable,\n onClose,\n}) => (\n <div\n className={[CLASS, exiting ? `${CLASS}-exiting` : ''].filter(Boolean).join(' ')}\n css={itemStyle(style, position)}\n role='status'\n data-testid={CLASS}\n >\n {icon && (\n <span className={`${CLASS}-icon`} data-testid={`${CLASS}-icon`}>\n <Icon name={icon} />\n </span>\n )}\n <span className={`${CLASS}-message`} data-testid={`${CLASS}-message`}>\n {message}\n </span>\n {closable && onClose && (\n <IconButton icon={<Icon name='close' />} onClick={onClose} data-testid={`${CLASS}-close`} />\n )}\n </div>\n);\n\nexport default Toast;\n","import { createContext } from 'react';\nimport type { ToastApi } from './Toast.interface';\n\nexport const ToastContext = createContext<ToastApi | null>(null);\n","import { useCallback, useMemo, useState, type FC } from 'react';\nimport { useCreateComponentStyles } from '@hocs/ThemeProvider/useThemeProvider.hook';\nimport { Component } from '@hocs/ThemeProvider/interfaces';\nimport { zoneStyle } from './Toast.emotion';\nimport ToastBase from './Toast';\nimport type { ToastItem, ToastApi, ToastOptions, ToastProviderProps, ToastPosition } from './Toast.interface';\nimport { ToastContext } from './Toast.context';\n\nconst CLASS = '--TOAST';\nconst ANIM_DURATION = 300;\n\nconst ToastItemWrapper: FC<ToastItem & { position: ToastPosition; onClose: () => void }> = ({\n message,\n variant,\n icon,\n position,\n exiting,\n closable,\n onClose,\n}) => {\n const { componentStyles } = useCreateComponentStyles([Component.TOAST], undefined, variant.toUpperCase());\n return (\n <ToastBase\n message={message}\n icon={icon}\n style={componentStyles}\n position={position}\n exiting={exiting}\n closable={closable}\n onClose={onClose}\n />\n );\n};\n\nexport const ToastProvider: FC<ToastProviderProps> = ({ children, duration = 3000, position = 'bottom-right' }) => {\n const [items, setItems] = useState<ToastItem[]>([]);\n\n const dismiss = useCallback((id: string) => {\n setItems(prev => prev.map(t => (t.id === id ? { ...t, exiting: true } : t)));\n window.setTimeout(() => setItems(prev => prev.filter(t => t.id !== id)), ANIM_DURATION);\n }, []);\n\n const push = useCallback(\n (message: ToastItem['message'], options: ToastOptions = {}) => {\n const { variant = 'default', icon, duration: d, closable } = options;\n const id = crypto.randomUUID();\n setItems(prev => [...prev, { id, message, variant, icon, closable }]);\n window.setTimeout(() => dismiss(id), d ?? duration);\n },\n [duration, dismiss],\n );\n\n const api = useMemo<ToastApi>(() => ({ push }), [push]);\n\n return (\n <ToastContext.Provider value={api}>\n {children}\n <div\n className={`${CLASS}-zone`}\n css={zoneStyle(position)}\n aria-live='polite'\n aria-atomic='true'\n data-testid={`${CLASS}-zone`}\n >\n {items.map(t => (\n <ToastItemWrapper key={t.id} {...t} position={position} onClose={() => dismiss(t.id)} />\n ))}\n </div>\n </ToastContext.Provider>\n );\n};\n","import { useContext } from 'react';\nimport { ToastContext } from './Toast.context';\n\nexport const useToast = () => {\n const ctx = useContext(ToastContext);\n if (!ctx) throw new Error('useToast must be used inside <ToastProvider>');\n return ctx;\n};\n"],"mappings":"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"}
|
package/dist/atoms.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { n as e,
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
1
|
+
import { n as e, t } from "./IconButton-C3x-E-ot.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-6eNmT34-.js";
|
|
3
|
+
import { n as u } from "./RadioGroup.context-v_CCYB7_.js";
|
|
4
|
+
export { r as Button, u as Checkbox, c as DatePicker, e as Icon, t as IconButton, n as NumberField, i as Radio, s as Select, a as Slider, l as Switch, o as TextField };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode, type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Button';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Button';
|
|
3
3
|
export interface ButtonStyleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
4
4
|
/** Content rendered inside the button. Can be a string, element, or any React node.
|
|
5
5
|
* @default 'Click me!'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Checkbox';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Checkbox';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
|
-
/** Internal props used by CheckboxBase
|
|
4
|
+
/** Internal props used by CheckboxBase — the headless presentational layer. */
|
|
5
5
|
export interface CheckboxBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'checked' | 'style'> {
|
|
6
6
|
/** Text label displayed next to the checkbox. */
|
|
7
7
|
label?: string;
|
|
@@ -57,7 +57,7 @@ export interface CheckboxStyleProps<TFieldValues extends FieldValues = FieldValu
|
|
|
57
57
|
* @default 'default'
|
|
58
58
|
*/
|
|
59
59
|
variant?: string;
|
|
60
|
-
/** Controlled mode
|
|
60
|
+
/** Controlled mode — callback fired when the checked state changes.
|
|
61
61
|
* Use this prop together with the `checked` attribute instead of RHF `control`.
|
|
62
62
|
*/
|
|
63
63
|
onChecked?: (checked: boolean) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Chip';
|
|
3
|
+
export type ChipVariant = 'default' | 'ok' | 'warn' | 'err' | 'blue' | 'ghost';
|
|
4
|
+
export interface ChipBaseProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface ChipStyleProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
variant?: ChipVariant;
|
|
13
|
+
theme?: EVENTS;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/DatePicker';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/DatePicker';
|
|
3
3
|
export interface DatePickerStyleProps<TFieldValues extends FieldValues = FieldValues> {
|
|
4
4
|
/** RHF field name. The form value will be a `Date`. */
|
|
5
5
|
name: string;
|
|
@@ -76,7 +76,7 @@ export declare enum DaysEsProps {
|
|
|
76
76
|
Mi = "Mi",
|
|
77
77
|
Ju = "Ju",
|
|
78
78
|
Vi = "Vi",
|
|
79
|
-
Sa = "S\
|
|
79
|
+
Sa = "S\u00C3\u00A1",
|
|
80
80
|
Do = "Do"
|
|
81
81
|
}
|
|
82
82
|
export declare enum MonthsEnProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DateCell } from '../DatePicker.interface';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/DatePickerMenu';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/DatePickerMenu';
|
|
3
3
|
export interface DatePickerMenuStyleProps {
|
|
4
4
|
/** Whether the calendar popup is visible. */
|
|
5
5
|
isOpen: boolean;
|
|
@@ -23,13 +23,13 @@ export interface DatePickerMenuStyleProps {
|
|
|
23
23
|
weeks?: DateCell[][];
|
|
24
24
|
/** Year rows for the year-picker grid. */
|
|
25
25
|
years?: DateCell[][];
|
|
26
|
-
/** Short weekday labels ordered for the current language (Mon
|
|
26
|
+
/** Short weekday labels ordered for the current language (Mon–Sun or Sun–Sat). */
|
|
27
27
|
daysOfWeek?: string[];
|
|
28
28
|
/** Currently selected `Date` value (used to highlight the selected day). */
|
|
29
29
|
selectedValue?: Date;
|
|
30
30
|
/** date-fns format string matching the cells' `value` strings. */
|
|
31
31
|
format?: string;
|
|
32
|
-
/** Today's date
|
|
32
|
+
/** Today's date — used to render the "today" dot indicator. */
|
|
33
33
|
today?: Date;
|
|
34
34
|
/** Index into the flattened `weeks` array that currently has keyboard focus. */
|
|
35
35
|
focusedElement?: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/IconButton';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/IconButton';
|
|
3
3
|
export interface IconButtonStyleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
4
4
|
/** The icon element rendered inside the button. */
|
|
5
5
|
icon: JSX.Element;
|
|
6
|
-
/** Click handler. Required
|
|
6
|
+
/** Click handler. Required — IconButton is always interactive. */
|
|
7
7
|
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
8
8
|
/** When `true`, horizontally mirrors the icon via a CSS transform.
|
|
9
9
|
* Useful for directional icons (e.g. an arrow that should point left).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/NumberField';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/NumberField';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
|
-
/** Internal props used by NumberFieldBase
|
|
4
|
+
/** Internal props used by NumberFieldBase — the headless presentational layer. */
|
|
5
5
|
export interface NumberFieldBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'style' | 'value' | 'type'> {
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Radio';
|
|
3
|
-
/** Internal props used by RadioBase
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Radio';
|
|
3
|
+
/** Internal props used by RadioBase — the headless presentational layer. */
|
|
4
4
|
export interface RadioBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'checked' | 'style'> {
|
|
5
5
|
/** The string value this radio option represents. Matched against the RadioGroup's selected value. */
|
|
6
6
|
value: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Select';
|
|
1
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Select';
|
|
2
2
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
3
3
|
import type { OptionProp } from '@interfaces';
|
|
4
4
|
export interface SelectStyleProps<TFieldValues extends FieldValues = FieldValues> {
|
|
@@ -14,7 +14,7 @@ export interface SelectStyleProps<TFieldValues extends FieldValues = FieldValues
|
|
|
14
14
|
* @default false
|
|
15
15
|
*/
|
|
16
16
|
disabled?: boolean;
|
|
17
|
-
/** Number of options rendered per "page"
|
|
17
|
+
/** Number of options rendered per "page" — additional options are loaded as the user scrolls.
|
|
18
18
|
* Must be greater than 3 to activate virtual scrolling. Defaults to all options at once.
|
|
19
19
|
* @default 100
|
|
20
20
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/SelectMenu';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/SelectMenu';
|
|
3
3
|
import type { MenuOption } from '@interfaces';
|
|
4
4
|
export interface SelectMenuStyleProps {
|
|
5
5
|
/** The current list of options to render. Controlled by the parent Select. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Slider';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Slider';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
4
|
export interface SliderStyleProps<TFieldValues extends FieldValues = FieldValues> {
|
|
5
5
|
/** RHF field name. The form value must be `number[]`.
|
|
@@ -20,7 +20,7 @@ export interface SliderStyleProps<TFieldValues extends FieldValues = FieldValues
|
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
disabled?: boolean;
|
|
23
|
-
/** Granularity of the value
|
|
23
|
+
/** Granularity of the value — each thumb snaps to multiples of `step`.
|
|
24
24
|
* @default 1
|
|
25
25
|
*/
|
|
26
26
|
step?: number;
|
|
@@ -45,8 +45,8 @@ export interface SliderStyleProps<TFieldValues extends FieldValues = FieldValues
|
|
|
45
45
|
*/
|
|
46
46
|
direction?: 'horizontal' | 'vertical';
|
|
47
47
|
/** Controls which side of the thumb the filled track appears on.
|
|
48
|
-
* - `'normal'`
|
|
49
|
-
* - `'inverted'`
|
|
48
|
+
* - `'normal'` — fills from `min` toward the value (or between thumbs in range mode).
|
|
49
|
+
* - `'inverted'` — fills from the value toward `max` (or outside the thumbs in range mode).
|
|
50
50
|
* @default 'normal'
|
|
51
51
|
*/
|
|
52
52
|
track?: 'normal' | 'inverted';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Switch';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Switch';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
4
|
export interface SwitchStyleProps<TFieldValues extends FieldValues = FieldValues> extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'style'> {
|
|
5
5
|
/** RHF field name. The form value will be a `boolean`. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/TextField';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/TextField';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
|
-
/** Internal props used by TextFieldBase
|
|
4
|
+
/** Internal props used by TextFieldBase — the headless presentational layer. */
|
|
5
5
|
export interface TextFieldBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'style' | 'value'> {
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/CheckboxGroup';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/molecules/CheckboxGroup';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
4
|
export interface CheckboxGroupStyleProps<TFieldValues extends FieldValues = FieldValues> {
|
|
5
|
-
/** RHF field name. The form value will be `string[]`
|
|
5
|
+
/** RHF field name. The form value will be `string[]` — the `value` props of all checked children. */
|
|
6
6
|
name: string;
|
|
7
7
|
/** RHF control object. */
|
|
8
8
|
control: Control<TFieldValues>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { type JSX } from 'react';
|
|
2
2
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
3
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Checkbox';
|
|
3
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/atoms/Checkbox';
|
|
4
4
|
export interface CheckboxTreeStyleProps<TFieldValues extends FieldValues = FieldValues> {
|
|
5
|
-
/** RHF field name. The form value will be `string[]`
|
|
5
|
+
/** RHF field name. The form value will be `string[]` — the `value` props of all checked children. */
|
|
6
6
|
name: string;
|
|
7
7
|
/** RHF control object. */
|
|
8
8
|
control: Control<TFieldValues>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/Modal';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/molecules/Modal';
|
|
3
3
|
export interface ModalStyleProps {
|
|
4
4
|
/** Controls visibility of the modal. */
|
|
5
5
|
open: boolean;
|
|
@@ -9,13 +9,13 @@ export interface ModalStyleProps {
|
|
|
9
9
|
* Use `--MODAL-title` class on your title element to apply the themed title styles.
|
|
10
10
|
*/
|
|
11
11
|
header?: ReactNode;
|
|
12
|
-
/** When `true`, renders a
|
|
12
|
+
/** When `true`, renders a × close button at the end of the header bar.
|
|
13
13
|
* @default true
|
|
14
14
|
*/
|
|
15
15
|
showCloseButton?: boolean;
|
|
16
16
|
/** Width preset.
|
|
17
|
-
* - `'md'`
|
|
18
|
-
* - `'lg'`
|
|
17
|
+
* - `'md'` — 480 px (default)
|
|
18
|
+
* - `'lg'` — 720 px
|
|
19
19
|
* @default 'md'
|
|
20
20
|
*/
|
|
21
21
|
size?: 'md' | 'lg';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/RadioGroup';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/molecules/RadioGroup';
|
|
3
3
|
import type { Control, FieldValues } from 'react-hook-form';
|
|
4
4
|
export interface RadioGroupStyleProps<TFieldValues extends FieldValues = FieldValues> {
|
|
5
|
-
/** RHF field name. The form value will be a `string`
|
|
5
|
+
/** RHF field name. The form value will be a `string` — the `value` prop of the selected Radio. */
|
|
6
6
|
name: string;
|
|
7
7
|
/** RHF control object. */
|
|
8
8
|
control: Control<TFieldValues>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToastPosition } from './Toast.interface';
|
|
2
|
+
export declare const zoneStyle: (position?: ToastPosition) => import("@emotion/utils").SerializedStyles;
|
|
3
|
+
declare const itemStyle: (theme: Record<string, string>, position?: ToastPosition) => import("@emotion/utils").SerializedStyles;
|
|
4
|
+
export default itemStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useToast: () => import("./Toast.interface").ToastApi;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ToastItem {
|
|
3
|
+
id: string;
|
|
4
|
+
message: ReactNode;
|
|
5
|
+
variant: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
closable?: boolean;
|
|
8
|
+
exiting?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ToastOptions {
|
|
11
|
+
variant?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
duration?: number;
|
|
14
|
+
closable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ToastApi {
|
|
17
|
+
push: (message: ReactNode, options?: ToastOptions) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface ToastBaseProps {
|
|
20
|
+
message: ReactNode;
|
|
21
|
+
icon?: string;
|
|
22
|
+
style?: Record<string, string>;
|
|
23
|
+
position?: ToastPosition;
|
|
24
|
+
exiting?: boolean;
|
|
25
|
+
closable?: boolean;
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
29
|
+
export interface ToastProviderProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
duration?: number;
|
|
32
|
+
position?: ToastPosition;
|
|
33
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/DataGrid';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/organisms/DataGrid';
|
|
3
3
|
/** Determines the filter UI rendered in the column header popover. */
|
|
4
4
|
export type DataGridFilterType = 'search' | 'multiselect' | 'multiselect-search';
|
|
5
5
|
/** A single option entry used by `multiselect` and `multiselect-search` column filters. */
|
|
@@ -90,8 +90,8 @@ export interface DataGridStyleProps<T = Record<string, unknown>> {
|
|
|
90
90
|
*/
|
|
91
91
|
onFetch: (params: DataGridFetchParams) => Promise<DataGridFetchResult<T>>;
|
|
92
92
|
/** Controls how more rows are loaded when the user reaches the end of the current view.
|
|
93
|
-
* - `'pagination'`
|
|
94
|
-
* - `'scroll'`
|
|
93
|
+
* - `'pagination'` — shows a pagination bar below the table.
|
|
94
|
+
* - `'scroll'` — loads the next page automatically when the user scrolls to the bottom.
|
|
95
95
|
* @default 'pagination'
|
|
96
96
|
*/
|
|
97
97
|
paginationType?: DataGridPaginationType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataGridFilterType, DataGridFilterOption } from '../DataGrid.interface';
|
|
2
|
-
import type { EVENTS } from '@hocs/ThemeProvider/components/DataGridMenu';
|
|
2
|
+
import type { EVENTS } from '@hocs/ThemeProvider/components/organisms/DataGridMenu';
|
|
3
3
|
export interface DataGridMenuStyleProps {
|
|
4
4
|
/** Determines which filter UI is rendered inside the popover. */
|
|
5
5
|
filterType: DataGridFilterType;
|
|
@@ -2,6 +2,7 @@ import { type JSX } from 'react';
|
|
|
2
2
|
import COMPONTENTS from './components';
|
|
3
3
|
import { Component } from './interfaces';
|
|
4
4
|
import FONTS from './fonts';
|
|
5
|
+
import type { ToastPosition } from '@components/molecules/Toast';
|
|
5
6
|
export interface Theme {
|
|
6
7
|
name: string;
|
|
7
8
|
components: COMPONTENTS;
|
|
@@ -22,8 +23,13 @@ export type ThemeNames<T extends readonly {
|
|
|
22
23
|
}[] = readonly {
|
|
23
24
|
name: string;
|
|
24
25
|
}[]> = T[number]['name'];
|
|
26
|
+
export interface ToastConfig {
|
|
27
|
+
position?: ToastPosition;
|
|
28
|
+
duration?: number;
|
|
29
|
+
}
|
|
25
30
|
export interface ThemeProviderComponent<T extends readonly Theme[] = readonly Theme[]> {
|
|
26
31
|
themes: T;
|
|
27
32
|
theme: ThemeNames<T>;
|
|
28
33
|
children: JSX.Element;
|
|
34
|
+
toast?: ToastConfig;
|
|
29
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Event, StyleValues, Styles } from '
|
|
1
|
+
import { Component, Event, StyleValues, Styles } from '../../interfaces';
|
|
2
2
|
export type ROOT = Pick<Styles, StyleValues.BORDER_RADIUS>;
|
|
3
3
|
export type ENABLED = Pick<Styles, StyleValues.BACKGROUND_COLOR | StyleValues.COLOR_PRIMARY | StyleValues.BORDER_COLOR | StyleValues.BORDER_WIDTH | StyleValues.BORDER_STYLE>;
|
|
4
4
|
export type HOVER = Pick<Styles, StyleValues.BACKGROUND_COLOR>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Event, StyleValues, Styles } from '
|
|
1
|
+
import { Component, Event, StyleValues, Styles } from '../../interfaces';
|
|
2
2
|
export type ROOT = Pick<Styles, StyleValues.BORDER_RADIUS>;
|
|
3
3
|
export type ENABLED = Pick<Styles, StyleValues.COLOR_PRIMARY | StyleValues.COLOR_SECONDARY | StyleValues.ICON_COLOR | StyleValues.BACKGROUND_COLOR | StyleValues.BORDER_COLOR | StyleValues.BORDER_WIDTH | StyleValues.BORDER_STYLE>;
|
|
4
4
|
export type VALUE = ENABLED;
|