@foi/design-system 0.0.19 → 0.0.20

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.
@@ -1 +0,0 @@
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,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Callback 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
@@ -1 +0,0 @@
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":";;;;;AAIA,IAAM,KAAa,MAAoC;CACrD,IAAM,IAAS,EAAS,SAAS,OAAO,EAClC,IAAW,EAAS,SAAS,SAAS,EACtC,IAAQ,EAAS,WAAW,MAAM;CAExC,OADI,IAAiB,IAAQ,sBAAsB,qBAC5C,IAAS,sBAAsB;GAGlC,KAAc,MAA4B,CAAS;sBACnC,EAAU,E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,EAAM;GACpB,KAAK,EAAU,EAAS;GACxB,aAAU;GACV,eAAY;GACZ,eAAa,GAAG,EAAM;aAErB,EAAM,KAAI,MACT,kBAAC,GAAD;IAA6B,GAAI;IAAa;IAAU,eAAe,EAAQ,EAAE,GAAG;IAAI,EAAjE,EAAE,GAA+D,CACxF;GACE,CAAA,CACgB;;GCjEf,UAAiB;CAC5B,IAAM,IAAM,EAAW,EAAa;CACpC,IAAI,CAAC,GAAK,MAAU,MAAM,+CAA+C;CACzE,OAAO"}
package/dist/atoms.d.ts DELETED
@@ -1,21 +0,0 @@
1
- export { default as Button } from './components/atoms/Button';
2
- export { default as Icon } from './components/atoms/Icon';
3
- export { default as Checkbox } from './components/atoms/Checkbox';
4
- export { default as DatePicker } from './components/atoms/DatePicker';
5
- export { default as IconButton } from './components/atoms/IconButton';
6
- export { default as TextField } from './components/atoms/TextField';
7
- export { default as NumberField } from './components/atoms/NumberField';
8
- export { default as Radio } from './components/atoms/Radio';
9
- export { default as Select } from './components/atoms/Select';
10
- export { default as Slider } from './components/atoms/Slider';
11
- export { default as Switch } from './components/atoms/Switch';
12
- export type { ButtonStyleProps } from './components/atoms/Button/Button.interface';
13
- export type { CheckboxStyleProps } from './components/atoms/Checkbox/Checkbox.interface';
14
- export type { DatePickerStyleProps } from './components/atoms/DatePicker/DatePicker.interface';
15
- export type { IconButtonStyleProps } from './components/atoms/IconButton/IconButton.interface';
16
- export type { TextFieldStyleProps } from './components/atoms/TextField/TextField.interface';
17
- export type { NumberFieldStyleProps } from './components/atoms/NumberField/NumberField.interface';
18
- export type { RadioStyleProps } from './components/atoms/Radio/Radio.interface';
19
- export type { SelectStyleProps } from './components/atoms/Select/Select.interface';
20
- export type { SliderStyleProps } from './components/atoms/Slider/Slider.interface';
21
- export type { SwitchStyleProps } from './components/atoms/Switch/Switch.interface';
package/dist/atoms.mjs DELETED
@@ -1,4 +0,0 @@
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 };
package/dist/hocs.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as ThemeProvider } from './hocs/ThemeProvider';
2
- export type { Theme } from './hocs/ThemeProvider/ThemeProvider.interface';
package/dist/hocs.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { t as e } from "./ThemeProvider-C_PzAJz3.js";
2
- export { e as ThemeProvider };
@@ -1,10 +0,0 @@
1
- export { default as CheckboxGroup } from './components/molecules/CheckboxGroup';
2
- export { default as CheckboxTree } from './components/molecules/CheckboxTree';
3
- export { default as Modal } from './components/molecules/Modal';
4
- export { ToastProvider } from './components/molecules/Toast';
5
- export type { ToastApi, ToastOptions } from './components/molecules/Toast';
6
- export { default as RadioGroup } from './components/molecules/RadioGroup';
7
- export type { CheckboxGroupStyleProps } from './components/molecules/CheckboxGroup/CheckboxGroup.interface';
8
- export type { CheckboxTreeStyleProps } from './components/molecules/CheckboxTree/CheckboxTree.interface';
9
- export type { ModalStyleProps } from './components/molecules/Modal/Modal.interface';
10
- export type { RadioGroupStyleProps } from './components/molecules/RadioGroup/RadioGroup.interface';
@@ -1,3 +0,0 @@
1
- import { i as e, n as t, r as n, t as r } from "./RadioGroup-Cvt9MtvM.js";
2
- import { n as i } from "./Toast-_9W7YGxS.js";
3
- export { e as CheckboxGroup, n as CheckboxTree, t as Modal, r as RadioGroup, i as ToastProvider };
@@ -1,32 +0,0 @@
1
- import { useCallback as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
- //#region src/hooks/useOnClickOutside.ts
3
- var a = ({ ref: e, onAction: i, isActive: a, exceptRef: o }) => {
4
- let s = r(i);
5
- n(() => {
6
- s.current = i;
7
- }), t(() => {
8
- let t = (t) => {
9
- if (!e.current || !a) return;
10
- let n = t.target, r = !e.current.contains(n), i = o?.current ? o.current.contains(n) : !1;
11
- r && !i && s.current();
12
- };
13
- return document.addEventListener("mousedown", t), document.addEventListener("keydown", t), () => {
14
- document.removeEventListener("mousedown", t), document.removeEventListener("keydown", t);
15
- };
16
- }, [
17
- e,
18
- o,
19
- a
20
- ]);
21
- }, o = (n) => {
22
- let [a, o] = i(n), s = r(void 0), c = e((e, t) => {
23
- s.current = t, o(e);
24
- }, []);
25
- return t(() => {
26
- s.current &&= (s.current(a), void 0);
27
- }, [a]), [a, c];
28
- };
29
- //#endregion
30
- export { a as n, o as t };
31
-
32
- //# sourceMappingURL=useStateCallback-B4O93zzK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStateCallback-B4O93zzK.js","names":[],"sources":["../src/hooks/useOnClickOutside.ts","../src/hooks/useStateCallback.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, type RefObject } from 'react';\n\ninterface UseClickOutsideAlerter {\n ref: RefObject<Element | null>;\n isActive: boolean;\n onAction: () => void;\n exceptRef?: RefObject<Element | null>;\n}\n\nexport const useOnClickOutside = ({ ref, onAction, isActive, exceptRef }: UseClickOutsideAlerter) => {\n const onActionRef = useRef(onAction);\n useLayoutEffect(() => {\n onActionRef.current = onAction;\n });\n\n useEffect(() => {\n const handler = (event: Event) => {\n if (!ref.current || !isActive) return;\n const target = event.target as Node;\n const clickedOutside = !ref.current.contains(target);\n const clickedExcept = exceptRef?.current ? exceptRef.current.contains(target) : false;\n if (clickedOutside && !clickedExcept) onActionRef.current();\n };\n\n document.addEventListener('mousedown', handler);\n document.addEventListener('keydown', handler);\n return () => {\n document.removeEventListener('mousedown', handler);\n document.removeEventListener('keydown', handler);\n };\n }, [ref, exceptRef, isActive]);\n};\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport const useStateCallback = <T>(initialState: T): [T, (state: T, cb?: (state: T) => void) => void] => {\n const [state, setState] = useState(initialState);\n const cbRef = useRef<((state: T) => void) | undefined>(undefined); // init mutable ref container for callbacks\n\n const setStateCallback = useCallback((state: T, cb?: (state: T) => void) => {\n cbRef.current = cb; // store current, passed callback in ref\n setState(state);\n }, []); // keep object reference stable, exactly like `useState`\n\n useEffect(() => {\n // cb.current is `undefined` on initial render,\n // so we only invoke callback on state *updates*\n if (cbRef.current) {\n cbRef.current(state);\n cbRef.current = undefined; // reset callback after execution\n }\n }, [state]);\n\n return [state, setStateCallback];\n};\n"],"mappings":";;AASA,IAAa,KAAqB,EAAE,QAAK,aAAU,aAAU,mBAAwC;CACnG,IAAM,IAAc,EAAO,EAAS;CAKpC,AAJA,QAAsB;EACpB,EAAY,UAAU;GACtB,EAEF,QAAgB;EACd,IAAM,KAAW,MAAiB;GAChC,IAAI,CAAC,EAAI,WAAW,CAAC,GAAU;GAC/B,IAAM,IAAS,EAAM,QACf,IAAiB,CAAC,EAAI,QAAQ,SAAS,EAAO,EAC9C,IAAgB,GAAW,UAAU,EAAU,QAAQ,SAAS,EAAO,GAAG;GAChF,AAAI,KAAkB,CAAC,KAAe,EAAY,SAAS;;EAK7D,OAFA,SAAS,iBAAiB,aAAa,EAAQ,EAC/C,SAAS,iBAAiB,WAAW,EAAQ,QAChC;GAEX,AADA,SAAS,oBAAoB,aAAa,EAAQ,EAClD,SAAS,oBAAoB,WAAW,EAAQ;;IAEjD;EAAC;EAAK;EAAW;EAAS,CAAC;GC5BnB,KAAuB,MAAsE;CACxG,IAAM,CAAC,GAAO,KAAY,EAAS,EAAa,EAC1C,IAAQ,EAAyC,KAAA,EAAU,EAE3D,IAAmB,GAAa,GAAU,MAA4B;EAE1E,AADA,EAAM,UAAU,GAChB,EAAS,EAAM;IACd,EAAE,CAAC;CAWN,OATA,QAAgB;EAGd,AAEE,EAAM,aADN,EAAM,QAAQ,EAAM,EACJ,KAAA;IAEjB,CAAC,EAAM,CAAC,EAEJ,CAAC,GAAO,EAAiB"}