@adgytec/adgytec-web-ui-components 1.1.3 → 1.1.5
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/LICENSE +21 -21
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/BaseCard.css +1 -1
- package/dist/assets/ButtonChild.css +1 -1
- package/dist/assets/Disclosure.css +1 -1
- package/dist/assets/Label.css +1 -0
- package/dist/assets/Menu.css +1 -1
- package/dist/assets/MenuLabel.css +1 -1
- package/dist/assets/Separator.css +1 -0
- package/dist/assets/Tooltip.css +1 -1
- package/dist/assets/button.css +1 -0
- package/dist/chunks/Avatar +20 -19
- package/dist/chunks/Avatar.map +1 -0
- package/dist/chunks/BaseCard +21 -20
- package/dist/chunks/BaseCard.map +1 -0
- package/dist/chunks/Button +7 -6
- package/dist/chunks/Button.map +1 -0
- package/dist/chunks/ButtonChild +19 -18
- package/dist/chunks/ButtonChild.map +1 -0
- package/dist/chunks/ButtonLink +7 -6
- package/dist/chunks/ButtonLink.map +1 -0
- package/dist/chunks/ComponentShapeSwitcher +22 -22
- package/dist/chunks/ComponentShapeSwitcher.map +1 -0
- package/dist/chunks/Container +1 -0
- package/dist/chunks/Container.map +1 -0
- package/dist/chunks/Disclosure +16 -15
- package/dist/chunks/Disclosure.map +1 -0
- package/dist/chunks/DisclousreGroup +5 -4
- package/dist/chunks/DisclousreGroup.map +1 -0
- package/dist/chunks/DisplayError +9 -0
- package/dist/chunks/DisplayError.map +1 -0
- package/dist/chunks/{Success → DisplaySuccess} +3 -2
- package/dist/chunks/DisplaySuccess.map +1 -0
- package/dist/chunks/FilledButton +1 -0
- package/dist/chunks/FilledButton.map +1 -0
- package/dist/chunks/FilledButtonLink +1 -0
- package/dist/chunks/FilledButtonLink.map +1 -0
- package/dist/chunks/Form +13 -12
- package/dist/chunks/Form.map +1 -0
- package/dist/chunks/GradientCard +1 -0
- package/dist/chunks/GradientCard.map +1 -0
- package/dist/chunks/Image +20 -14
- package/dist/chunks/Image.map +1 -0
- package/dist/chunks/Input +3 -2
- package/dist/chunks/Input.map +1 -0
- package/dist/chunks/Label +26 -0
- package/dist/chunks/Label.map +1 -0
- package/dist/chunks/Link +7 -6
- package/dist/chunks/Link.map +1 -0
- package/dist/chunks/Loader +4 -3
- package/dist/chunks/Loader.map +1 -0
- package/dist/chunks/Menu +34 -32
- package/dist/chunks/Menu.map +1 -0
- package/dist/chunks/MenuButton +18 -4
- package/dist/chunks/MenuButton.map +1 -0
- package/dist/chunks/MenuLabel +21 -10
- package/dist/chunks/MenuLabel.map +1 -0
- package/dist/chunks/ModalAction +5 -4
- package/dist/chunks/ModalAction.map +1 -0
- package/dist/chunks/ModalBase +2 -1
- package/dist/chunks/ModalBase.map +1 -0
- package/dist/chunks/NavigationMenu +21 -17
- package/dist/chunks/NavigationMenu.map +1 -0
- package/dist/chunks/NavigationResponsive +1 -0
- package/dist/chunks/NavigationResponsive.map +1 -0
- package/dist/chunks/NavigationSidebar +13 -12
- package/dist/chunks/NavigationSidebar.map +1 -0
- package/dist/chunks/OutlinedButton +1 -0
- package/dist/chunks/OutlinedButton.map +1 -0
- package/dist/chunks/OutlinedButtonLink +1 -0
- package/dist/chunks/OutlinedButtonLink.map +1 -0
- package/dist/chunks/Popover +5 -4
- package/dist/chunks/Popover.map +1 -0
- package/dist/chunks/PopoverDialog +1 -0
- package/dist/chunks/PopoverDialog.map +1 -0
- package/dist/chunks/Select +27 -26
- package/dist/chunks/Select.map +1 -0
- package/dist/chunks/Separator +10 -0
- package/dist/chunks/Separator.map +1 -0
- package/dist/chunks/Sidebar +2 -1
- package/dist/chunks/Sidebar.map +1 -0
- package/dist/chunks/SolidCard +1 -0
- package/dist/chunks/SolidCard.map +1 -0
- package/dist/chunks/TextArea +3 -2
- package/dist/chunks/TextArea.map +1 -0
- package/dist/chunks/TextButton +1 -0
- package/dist/chunks/TextButton.map +1 -0
- package/dist/chunks/ThemeSwitcher +21 -22
- package/dist/chunks/ThemeSwitcher.map +1 -0
- package/dist/chunks/Toast +8 -7
- package/dist/chunks/Toast.map +1 -0
- package/dist/chunks/ToggleButton +10 -9
- package/dist/chunks/ToggleButton.map +1 -0
- package/dist/chunks/ToggleButtonGroup +7 -6
- package/dist/chunks/ToggleButtonGroup.map +1 -0
- package/dist/chunks/Tooltip +24 -20
- package/dist/chunks/Tooltip.map +1 -0
- package/dist/chunks/Tree +12 -12
- package/dist/chunks/Tree.map +1 -0
- package/dist/chunks/Viewport +5 -5
- package/dist/chunks/Viewport.map +1 -0
- package/dist/chunks/button.module +48 -0
- package/dist/chunks/button.module.map +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Button/ButtonBase/index.js +1 -0
- package/dist/components/Button/ButtonBase/index.js.map +1 -0
- package/dist/components/Button/ButtonBase/types.d.ts +1 -1
- package/dist/components/Button/ButtonChild/index.js +1 -0
- package/dist/components/Button/ButtonChild/index.js.map +1 -0
- package/dist/components/Button/FilledButton/index.js +1 -0
- package/dist/components/Button/FilledButton/index.js.map +1 -0
- package/dist/components/Button/OutlinedButton/index.js +1 -0
- package/dist/components/Button/OutlinedButton/index.js.map +1 -0
- package/dist/components/Button/TextButton/index.js +1 -0
- package/dist/components/Button/TextButton/index.js.map +1 -0
- package/dist/components/Button/ToggleButton/index.js +1 -0
- package/dist/components/Button/ToggleButton/index.js.map +1 -0
- package/dist/components/Card/BaseCard/index.d.ts +1 -1
- package/dist/components/Card/BaseCard/index.js +1 -0
- package/dist/components/Card/BaseCard/index.js.map +1 -0
- package/dist/components/Card/BaseCard/types.d.ts +1 -1
- package/dist/components/Card/GradientCard/index.js +1 -0
- package/dist/components/Card/GradientCard/index.js.map +1 -0
- package/dist/components/Card/SolidCard/index.js +1 -0
- package/dist/components/Card/SolidCard/index.js.map +1 -0
- package/dist/components/Container/index.d.ts +1 -1
- package/dist/components/Container/index.js +1 -0
- package/dist/components/Container/index.js.map +1 -0
- package/dist/components/Disclosure/Disclosure/index.js +1 -0
- package/dist/components/Disclosure/Disclosure/index.js.map +1 -0
- package/dist/components/Disclosure/Disclosure/types.d.ts +1 -1
- package/dist/components/Disclosure/DisclousureGroup/index.js +1 -0
- package/dist/components/Disclosure/DisclousureGroup/index.js.map +1 -0
- package/dist/components/DisplayError/DisplayError.d.ts +2 -0
- package/dist/components/DisplayError/index.d.ts +2 -0
- package/dist/components/DisplayError/index.js +5 -0
- package/dist/components/DisplayError/index.js.map +1 -0
- package/dist/components/{Error → DisplayError}/types.d.ts +1 -1
- package/dist/components/DisplaySuccess/DisplaySuccess.d.ts +2 -0
- package/dist/components/DisplaySuccess/index.d.ts +2 -0
- package/dist/components/DisplaySuccess/index.js +5 -0
- package/dist/components/DisplaySuccess/index.js.map +1 -0
- package/dist/components/{Success → DisplaySuccess}/types.d.ts +1 -1
- package/dist/components/Form/Form/Form.d.ts +2 -2
- package/dist/components/Form/Form/index.d.ts +1 -1
- package/dist/components/Form/Form/index.js +1 -0
- package/dist/components/Form/Form/index.js.map +1 -0
- package/dist/components/Form/Form/types.d.ts +5 -3
- package/dist/components/Form/Input/index.js +1 -0
- package/dist/components/Form/Input/index.js.map +1 -0
- package/dist/components/Form/Input/types.d.ts +1 -1
- package/dist/components/Form/TextArea/index.js +1 -0
- package/dist/components/Form/TextArea/index.js.map +1 -0
- package/dist/components/Form/TextArea/types.d.ts +1 -1
- package/dist/components/Image/index.d.ts +1 -1
- package/dist/components/Image/index.js +1 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Link/FilledButtonLink/index.js +1 -0
- package/dist/components/Link/FilledButtonLink/index.js.map +1 -0
- package/dist/components/Link/LinkBase/index.js +1 -0
- package/dist/components/Link/LinkBase/index.js.map +1 -0
- package/dist/components/Link/LinkBase/types.d.ts +1 -1
- package/dist/components/Link/OutlinedButtonLink/index.js +1 -0
- package/dist/components/Link/OutlinedButtonLink/index.js.map +1 -0
- package/dist/components/Loader/index.js +1 -0
- package/dist/components/Loader/index.js.map +1 -0
- package/dist/components/Menu/MenuBase/Menu.d.ts +1 -1
- package/dist/components/Menu/MenuBase/index.js +1 -0
- package/dist/components/Menu/MenuBase/index.js.map +1 -0
- package/dist/components/Menu/MenuBase/types.d.ts +9 -7
- package/dist/components/Menu/MenuButton/MenuButton.d.ts +1 -1
- package/dist/components/Menu/MenuButton/index.js +1 -0
- package/dist/components/Menu/MenuButton/index.js.map +1 -0
- package/dist/components/Menu/MenuLabel/MenuLabel.d.ts +1 -1
- package/dist/components/Menu/MenuLabel/index.js +1 -0
- package/dist/components/Menu/MenuLabel/index.js.map +1 -0
- package/dist/components/Modal/ModalAction/index.js +1 -0
- package/dist/components/Modal/ModalAction/index.js.map +1 -0
- package/dist/components/Modal/ModalAction/types.d.ts +1 -1
- package/dist/components/Modal/ModalBase/index.js +1 -0
- package/dist/components/Modal/ModalBase/index.js.map +1 -0
- package/dist/components/Modal/ModalBase/types.d.ts +1 -1
- package/dist/components/Navigation/NavigationMenu/index.js +1 -0
- package/dist/components/Navigation/NavigationMenu/index.js.map +1 -0
- package/dist/components/Navigation/NavigationResponsive/index.js +1 -0
- package/dist/components/Navigation/NavigationResponsive/index.js.map +1 -0
- package/dist/components/Navigation/NavigationResponsive/types.d.ts +2 -2
- package/dist/components/Navigation/NavigationSidebar/index.js +1 -0
- package/dist/components/Navigation/NavigationSidebar/index.js.map +1 -0
- package/dist/components/Navigation/NavigationSidebar/types.d.ts +2 -2
- package/dist/components/Popover/PopoverBase/index.js +1 -0
- package/dist/components/Popover/PopoverBase/index.js.map +1 -0
- package/dist/components/Popover/PopoverDialog/index.js +1 -0
- package/dist/components/Popover/PopoverDialog/index.js.map +1 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Select/types.d.ts +1 -1
- package/dist/components/Separator/Separator.d.ts +1 -0
- package/dist/components/Separator/index.d.ts +1 -0
- package/dist/components/Separator/index.js +5 -0
- package/dist/components/Separator/index.js.map +1 -0
- package/dist/components/Sidebar/index.js +1 -0
- package/dist/components/Sidebar/index.js.map +1 -0
- package/dist/components/Sidebar/types.d.ts +1 -1
- package/dist/components/Splash/useSplash.d.ts +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/index.js +1 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/ToggleButtonGroup/index.js +1 -0
- package/dist/components/ToggleButtonGroup/index.js.map +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tree/index.js +1 -0
- package/dist/components/Tree/index.js.map +1 -0
- package/dist/components/Tree/types.d.ts +3 -3
- package/dist/components/Viewport/Viewport.d.ts +1 -1
- package/dist/components/Viewport/index.js +1 -0
- package/dist/components/Viewport/index.js.map +1 -0
- package/dist/components/VisualSettings/ComponentShapeSwitcher/index.js +1 -0
- package/dist/components/VisualSettings/ComponentShapeSwitcher/index.js.map +1 -0
- package/dist/components/VisualSettings/ThemeSwitcher/index.js +1 -0
- package/dist/components/VisualSettings/ThemeSwitcher/index.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +67 -64
- package/dist/index.js.map +1 -0
- package/dist/utils/form.d.ts +1 -1
- package/dist/utils/types.d.ts +9 -0
- package/package.json +26 -27
- package/dist/assets/FieldError.css +0 -1
- package/dist/assets/useSplash.css +0 -1
- package/dist/chunks/Error +0 -8
- package/dist/chunks/FieldError +0 -25
- package/dist/chunks/useSplash +0 -48
- package/dist/components/Error/Error.d.ts +0 -2
- package/dist/components/Error/index.d.ts +0 -2
- package/dist/components/Error/index.js +0 -4
- package/dist/components/Success/Success.d.ts +0 -2
- package/dist/components/Success/index.d.ts +0 -2
- package/dist/components/Success/index.js +0 -4
- /package/dist/assets/{Error.css → DisplayError.css} +0 -0
- /package/dist/assets/{Success.css → DisplaySuccess.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisplaySuccess","sources":["../../src/components/DisplaySuccess/DisplaySuccess.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport styles from \"./displaySuccess.module.css\";\nimport type { DisplaySuccessProps } from \"./types\";\n\nexport const DisplaySuccess = ({ children }: DisplaySuccessProps) => {\n return <p className={clsx(styles[\"success\"])}>{children}</p>;\n};\n"],"names":["DisplaySuccess","children","jsx","clsx","styles"],"mappings":";;;;GAIaA,IAAiB,CAAC,EAAE,UAAAC,QACtB,gBAAAC,EAAC,OAAE,WAAWC,EAAKC,EAAO,OAAU,GAAI,UAAAH,GAAS;"}
|
package/dist/chunks/FilledButton
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilledButton","sources":["../../src/components/Button/FilledButton/FilledButton.tsx"],"sourcesContent":["import type { ButtonVariantProps } from \"@/components/Button/ButtonBase\";\nimport { Button } from \"@/components/Button/ButtonBase/Button\";\n\nexport const FilledButton = (props: ButtonVariantProps) => {\n const { children } = props;\n return (\n <Button {...props} variant=\"filled\">\n {children}\n </Button>\n );\n};\n"],"names":["FilledButton","props","children","Button"],"mappings":";;AAGO,MAAMA,IAAe,CAACC,MAA8B;AACvD,QAAM,EAAE,UAAAC,MAAaD;AACrB,2BACKE,GAAA,EAAQ,GAAGF,GAAO,SAAQ,UACtB,UAAAC,GACL;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilledButtonLink","sources":["../../src/components/Link/FilledButtonLink/FilledButtonLink.tsx"],"sourcesContent":["import { ButtonLink } from \"@/components/Button/ButtonBase/ButtonLink\";\nimport type { LinkProps } from \"@/components/Link/LinkBase/types\";\n\nexport const FilledButtonLink = (props: LinkProps) => {\n return <ButtonLink {...props} variant=\"filled\" />;\n};\n"],"names":["FilledButtonLink","props","jsx","ButtonLink"],"mappings":";;AAGO,MAAMA,IAAmB,CAACC,MACtB,gBAAAC,EAACC,GAAA,EAAY,GAAGF,GAAO,SAAQ,UAAS;"}
|
package/dist/chunks/Form
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import '../assets/Form.css';const E =
|
|
7
|
-
form: E
|
|
8
|
-
}, v = (s, t) => {
|
|
2
|
+
import { clsx as i } from "clsx";
|
|
3
|
+
import { useState as l } from "react";
|
|
4
|
+
import { Form as d } from "react-aria-components";
|
|
5
|
+
import * as F from "zod";
|
|
6
|
+
import '../assets/Form.css';const E = (s, t) => {
|
|
9
7
|
const e = Object.fromEntries(new FormData(s)), r = t.safeParse(e);
|
|
10
8
|
return r.success ? {
|
|
11
9
|
success: !0,
|
|
12
10
|
data: r.data
|
|
13
11
|
} : {
|
|
14
12
|
success: !1,
|
|
15
|
-
errors:
|
|
13
|
+
errors: F.flattenError(r.error).fieldErrors
|
|
16
14
|
};
|
|
15
|
+
}, b = "_form_7gvgt_1", v = {
|
|
16
|
+
form: b
|
|
17
17
|
}, _ = ({
|
|
18
18
|
schema: s,
|
|
19
19
|
onSubmit: t,
|
|
20
20
|
children: e,
|
|
21
21
|
...r
|
|
22
22
|
}) => {
|
|
23
|
-
const [u, o] =
|
|
23
|
+
const [u, o] = l({});
|
|
24
24
|
return /* @__PURE__ */ f(
|
|
25
|
-
|
|
25
|
+
d,
|
|
26
26
|
{
|
|
27
27
|
...r,
|
|
28
28
|
validationErrors: u,
|
|
29
29
|
onSubmit: async (m) => {
|
|
30
30
|
m.preventDefault(), o({});
|
|
31
|
-
const n = m.currentTarget, a =
|
|
31
|
+
const n = m.currentTarget, a = E(n, s);
|
|
32
32
|
if (!a.success) {
|
|
33
33
|
o(a.errors);
|
|
34
34
|
return;
|
|
@@ -42,7 +42,7 @@ import '../assets/Form.css';const E = "_form_7gvgt_1", b = {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
className:
|
|
45
|
+
className: i(v.form, r.className),
|
|
46
46
|
children: e
|
|
47
47
|
}
|
|
48
48
|
);
|
|
@@ -50,3 +50,4 @@ import '../assets/Form.css';const E = "_form_7gvgt_1", b = {
|
|
|
50
50
|
export {
|
|
51
51
|
_ as F
|
|
52
52
|
};
|
|
53
|
+
//# sourceMappingURL=Form.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form","sources":["../../src/utils/form.ts","../../src/components/Form/Form/Form.tsx"],"sourcesContent":["import * as z from \"zod\";\n\ninterface FormValidateSuccessResult<T> {\n success: true;\n data: T;\n}\n\ninterface FormValidateFailureResult<T> {\n success: false;\n errors: Partial<Record<keyof T, string | string[]>>;\n}\n\ntype FormValidateResult<T> =\n | FormValidateSuccessResult<T>\n | FormValidateFailureResult<T>;\n\nexport type ValidateAndGetFormValues = <T extends z.ZodTypeAny>(\n formElement: HTMLFormElement,\n schema: T\n) => FormValidateResult<z.infer<T>>;\n\nexport const validateAndGetFormValues: ValidateAndGetFormValues = (\n formElement,\n schema\n) => {\n const valueObject = Object.fromEntries(new FormData(formElement));\n const result = schema.safeParse(valueObject);\n if (result.success) {\n return {\n success: true,\n data: result.data,\n };\n }\n\n return {\n success: false,\n errors: z.flattenError(result.error).fieldErrors,\n };\n};\n","import { clsx } from \"clsx\";\nimport { type SyntheticEvent, useState } from \"react\";\nimport { Form as UnstyledForm } from \"react-aria-components\";\nimport type * as z from \"zod\";\nimport { validateAndGetFormValues } from \"@/utils/form\";\nimport styles from \"./form.module.css\";\nimport type { FormProps } from \"./types\";\n\nexport const Form = <T extends z.ZodTypeAny>({\n schema,\n onSubmit,\n children,\n ...props\n}: FormProps<T>) => {\n const [errors, setErrors] = useState({});\n\n const handleFormSubmit = async (e: SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n setErrors({});\n\n const formElement = e.currentTarget;\n\n const values = validateAndGetFormValues(formElement, schema);\n if (!values.success) {\n setErrors(values.errors);\n return;\n }\n\n const submitErrors = await onSubmit(values.data, () =>\n formElement.reset()\n );\n if (submitErrors) {\n setErrors(submitErrors);\n return;\n }\n };\n\n return (\n <UnstyledForm\n {...props}\n validationErrors={errors}\n onSubmit={handleFormSubmit}\n className={clsx(styles[\"form\"], props.className)}\n >\n {children}\n </UnstyledForm>\n );\n};\n"],"names":["validateAndGetFormValues","formElement","schema","valueObject","result","z","Form","onSubmit","children","props","errors","setErrors","useState","jsx","UnstyledForm","e","values","submitErrors","clsx","styles"],"mappings":";;;;;AAqBO,MAAMA,IAAqD,CAC9DC,GACAC,MACC;AACD,QAAMC,IAAc,OAAO,YAAY,IAAI,SAASF,CAAW,CAAC,GAC1DG,IAASF,EAAO,UAAUC,CAAW;AAC3C,SAAIC,EAAO,UACA;AAAA,IACH,SAAS;AAAA,IACT,MAAMA,EAAO;AAAA,EAAA,IAId;AAAA,IACH,SAAS;AAAA,IACT,QAAQC,EAAE,aAAaD,EAAO,KAAK,EAAE;AAAA,EAAA;AAE7C;;GC9BaE,IAAO,CAAyB;AAAA,EACzC,QAAAJ;AAAA,EACA,UAAAK;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACP,MAAoB;AAChB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,CAAA,CAAE;AAuBvC,SACI,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACI,GAAGL;AAAA,MACJ,kBAAkBC;AAAA,MAClB,UAzBiB,OAAOK,MAAuC;AACnE,QAAAA,EAAE,eAAA,GACFJ,EAAU,CAAA,CAAE;AAEZ,cAAMV,IAAcc,EAAE,eAEhBC,IAAShB,EAAyBC,GAAaC,CAAM;AAC3D,YAAI,CAACc,EAAO,SAAS;AACjB,UAAAL,EAAUK,EAAO,MAAM;AACvB;AAAA,QACJ;AAEA,cAAMC,IAAe,MAAMV;AAAA,UAASS,EAAO;AAAA,UAAM,MAC7Cf,EAAY,MAAA;AAAA,QAAM;AAEtB,YAAIgB,GAAc;AACd,UAAAN,EAAUM,CAAY;AACtB;AAAA,QACJ;AAAA,MACJ;AAAA,MAOQ,WAAWC,EAAKC,EAAO,MAASV,EAAM,SAAS;AAAA,MAE9C,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
package/dist/chunks/GradientCard
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientCard","sources":["../../src/components/Card/GradientCard/GradientCard.tsx"],"sourcesContent":["import { BaseCard, type StyledBaseCardProps } from \"../BaseCard\";\n\nexport const GradientCard: React.FC<StyledBaseCardProps> = ({ ...props }) => {\n return <BaseCard {...props} background=\"gradient\" />;\n};\n"],"names":["GradientCard","props","jsx","BaseCard"],"mappings":";;AAEO,MAAMA,IAA8C,CAAC,EAAE,GAAGC,QACtD,gBAAAC,EAACC,GAAA,EAAU,GAAGF,GAAO,YAAW,YAAW;"}
|
package/dist/chunks/Image
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
const
|
|
2
|
+
const u = ({
|
|
3
|
+
src: t,
|
|
4
|
+
alt: r = "",
|
|
5
|
+
...n
|
|
6
|
+
}) => /* @__PURE__ */ e("img", { src: t, ...n, alt: r }), g = [
|
|
3
7
|
"medium",
|
|
4
8
|
"large",
|
|
5
9
|
"extraLarge",
|
|
6
10
|
"small",
|
|
7
11
|
"thumbnail"
|
|
8
|
-
],
|
|
12
|
+
], I = {
|
|
9
13
|
thumbnail: 150,
|
|
10
14
|
small: 320,
|
|
11
15
|
medium: 640,
|
|
12
16
|
large: 1024,
|
|
13
17
|
extraLarge: 1600
|
|
14
|
-
},
|
|
18
|
+
}, f = ({
|
|
15
19
|
original: t,
|
|
16
20
|
variants: r,
|
|
17
|
-
|
|
21
|
+
alt: n = "",
|
|
22
|
+
...c
|
|
18
23
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
(
|
|
24
|
+
const m = g.filter(
|
|
25
|
+
(a) => r[a]?.trim()
|
|
21
26
|
);
|
|
22
|
-
if (
|
|
23
|
-
return /* @__PURE__ */ e("img", { src: t, ...
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
return `${
|
|
27
|
+
if (m.length === 0)
|
|
28
|
+
return /* @__PURE__ */ e("img", { src: t, ...c, alt: n });
|
|
29
|
+
const i = r[m[0]], s = m.map((a) => {
|
|
30
|
+
const o = r[a], l = I[a];
|
|
31
|
+
return `${o} ${l}w`;
|
|
27
32
|
}).join(", ");
|
|
28
|
-
return /* @__PURE__ */ e("img", { src:
|
|
29
|
-
},
|
|
33
|
+
return /* @__PURE__ */ e("img", { src: i, srcSet: s, ...c, alt: n });
|
|
34
|
+
}, x = (t) => t.type === "source" ? /* @__PURE__ */ e(u, { ...t }) : /* @__PURE__ */ e(f, { ...t });
|
|
30
35
|
export {
|
|
31
|
-
|
|
36
|
+
x as I
|
|
32
37
|
};
|
|
38
|
+
//# sourceMappingURL=Image.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image","sources":["../../src/components/Image/ImageSource.tsx","../../src/components/Image/ImageVariants.tsx","../../src/components/Image/Image.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { ImageSourceProps } from \"./types\";\n\nexport const ImageSource: React.FC<ImageSourceProps> = ({\n src,\n alt = \"\",\n ...props\n}) => {\n return <img src={src} {...props} alt={alt} />;\n};\n","import type React from \"react\";\nimport type { ImageVariant, ImageVariantProps } from \"./types\";\n\nconst VARIANT_PRIORITY: ImageVariant[] = [\n \"medium\",\n \"large\",\n \"extraLarge\",\n \"small\",\n \"thumbnail\",\n];\n\nconst VARIANT_WIDTH: Record<ImageVariant, number> = {\n thumbnail: 150,\n small: 320,\n medium: 640,\n large: 1024,\n extraLarge: 1600,\n};\n\nexport const ImageVariants: React.FC<ImageVariantProps> = ({\n original,\n variants,\n alt = \"\",\n ...props\n}) => {\n const availableVariants = VARIANT_PRIORITY.filter((key) =>\n variants[key]?.trim()\n );\n\n // All variants empty, use original\n if (availableVariants.length === 0) {\n return <img src={original} {...props} alt={alt} />;\n }\n\n // get source\n const src = variants[availableVariants[0]];\n\n // Build srcSet\n const srcSet = availableVariants\n .map((key) => {\n const val = variants[key];\n const width = VARIANT_WIDTH[key];\n\n return `${val} ${width}w`;\n })\n .join(\", \");\n\n return <img src={src} srcSet={srcSet} {...props} alt={alt} />;\n};\n","import type React from \"react\";\nimport { ImageSource } from \"./ImageSource\";\nimport { ImageVariants } from \"./ImageVariants\";\nimport type { ImageProps } from \"./types\";\n\nexport const Image: React.FC<ImageProps> = (props) => {\n if (props.type === \"source\") {\n return <ImageSource {...props} />;\n }\n\n return <ImageVariants {...props} />;\n};\n"],"names":["ImageSource","src","alt","props","jsx","VARIANT_PRIORITY","VARIANT_WIDTH","ImageVariants","original","variants","availableVariants","key","srcSet","val","width","Image"],"mappings":";AAGO,MAAMA,IAA0C,CAAC;AAAA,EACpD,KAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,GAAGC;AACP,MACW,gBAAAC,EAAC,OAAA,EAAI,KAAAH,GAAW,GAAGE,GAAO,KAAAD,GAAU,GCLzCG,IAAmC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEMC,IAA8C;AAAA,EAChD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,YAAY;AAChB,GAEaC,IAA6C,CAAC;AAAA,EACvD,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,KAAAP,IAAM;AAAA,EACN,GAAGC;AACP,MAAM;AACF,QAAMO,IAAoBL,EAAiB;AAAA,IAAO,CAACM,MAC/CF,EAASE,CAAG,GAAG,KAAA;AAAA,EAAK;AAIxB,MAAID,EAAkB,WAAW;AAC7B,6BAAQ,OAAA,EAAI,KAAKF,GAAW,GAAGL,GAAO,KAAAD,GAAU;AAIpD,QAAMD,IAAMQ,EAASC,EAAkB,CAAC,CAAC,GAGnCE,IAASF,EACV,IAAI,CAACC,MAAQ;AACV,UAAME,IAAMJ,EAASE,CAAG,GAClBG,IAAQR,EAAcK,CAAG;AAE/B,WAAO,GAAGE,CAAG,IAAIC,CAAK;AAAA,EAC1B,CAAC,EACA,KAAK,IAAI;AAEd,2BAAQ,OAAA,EAAI,KAAAb,GAAU,QAAAW,GAAiB,GAAGT,GAAO,KAAAD,GAAU;AAC/D,GC3Caa,IAA8B,CAACZ,MACpCA,EAAM,SAAS,WACR,gBAAAC,EAACJ,GAAA,EAAa,GAAGG,EAAA,CAAO,IAG5B,gBAAAC,EAACG,GAAA,EAAe,GAAGJ,EAAA,CAAO;"}
|
package/dist/chunks/Input
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { TextField as c, Input as p } from "react-aria-components";
|
|
3
|
-
import { L as l, F as d } from "./FieldError";
|
|
4
2
|
import n from "clsx";
|
|
3
|
+
import { TextField as c, Input as p } from "react-aria-components";
|
|
4
|
+
import { L as l, F as d } from "./Label";
|
|
5
5
|
import '../assets/Input.css';const u = "_input_1nh7a_1", _ = "_editor_1nh7a_6", a = {
|
|
6
6
|
input: u,
|
|
7
7
|
editor: _
|
|
@@ -32,3 +32,4 @@ import '../assets/Input.css';const u = "_input_1nh7a_1", _ = "_editor_1nh7a_6",
|
|
|
32
32
|
export {
|
|
33
33
|
N as I
|
|
34
34
|
};
|
|
35
|
+
//# sourceMappingURL=Input.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input","sources":["../../src/components/Form/Input/Input.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { Input as AriaInput, TextField } from \"react-aria-components\";\nimport { FieldError } from \"@/components/Form/FieldError/FieldError.tsx\";\nimport { Label } from \"@/components/Form/Label/Label\";\nimport styles from \"./input.module.css\";\nimport type { InputProps } from \"./types\";\n\nexport const Input = ({\n label,\n textFieldProps,\n inputProps,\n labelProps,\n fieldErrorProps,\n}: InputProps) => {\n return (\n <TextField\n {...textFieldProps}\n className={clsx(styles[\"input\"], textFieldProps?.className)}\n >\n {label && <Label {...labelProps}>{label}</Label>}\n <AriaInput\n {...inputProps}\n className={clsx(styles[\"editor\"], inputProps?.className)}\n />\n <FieldError {...fieldErrorProps} />\n </TextField>\n );\n};\n"],"names":["Input","label","textFieldProps","inputProps","labelProps","fieldErrorProps","jsxs","TextField","clsx","styles","jsx","Label","AriaInput","FieldError"],"mappings":";;;;;;;GAOaA,IAAQ,CAAC;AAAA,EAClB,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AACJ,MAEQ,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACI,GAAGL;AAAA,IACJ,WAAWM,EAAKC,EAAO,OAAUP,GAAgB,SAAS;AAAA,IAEzD,UAAA;AAAA,MAAAD,KAAS,gBAAAS,EAACC,GAAA,EAAO,GAAGP,GAAa,UAAAH,GAAM;AAAA,MACxC,gBAAAS;AAAA,QAACE;AAAAA,QAAA;AAAA,UACI,GAAGT;AAAA,UACJ,WAAWK,EAAKC,EAAO,QAAWN,GAAY,SAAS;AAAA,QAAA;AAAA,MAAA;AAAA,MAE3D,gBAAAO,EAACG,GAAA,EAAY,GAAGR,EAAA,CAAiB;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import l, { clsx as s } from "clsx";
|
|
3
|
+
import { FieldError as a, Label as o } from "react-aria-components";
|
|
4
|
+
import '../assets/Label.css';const c = "_error_1sdpb_1", t = {
|
|
5
|
+
error: c
|
|
6
|
+
}, _ = (r) => /* @__PURE__ */ e(
|
|
7
|
+
a,
|
|
8
|
+
{
|
|
9
|
+
...r,
|
|
10
|
+
className: s(t.error, r.className)
|
|
11
|
+
}
|
|
12
|
+
), m = "_label_1qkol_1", n = {
|
|
13
|
+
label: m
|
|
14
|
+
}, x = (r) => /* @__PURE__ */ e(
|
|
15
|
+
o,
|
|
16
|
+
{
|
|
17
|
+
...r,
|
|
18
|
+
className: l(n.label, r?.className),
|
|
19
|
+
children: r.children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
export {
|
|
23
|
+
_ as F,
|
|
24
|
+
x as L
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=Label.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label","sources":["../../src/components/Form/FieldError/FieldError.tsx","../../src/components/Form/Label/Label.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n type FieldErrorProps,\n FieldError as UnstyledFieldError,\n} from \"react-aria-components\";\nimport styles from \"./fieldError.module.css\";\n\nexport const FieldError = (props: FieldErrorProps) => {\n return (\n <UnstyledFieldError\n {...props}\n className={clsx(styles[\"error\"], props.className)}\n />\n );\n};\n","import clsx from \"clsx\";\nimport { type LabelProps, Label as UnstyledLabel } from \"react-aria-components\";\nimport styles from \"./label.module.css\";\n\nexport const Label = (props: LabelProps) => {\n return (\n <UnstyledLabel\n {...props}\n className={clsx(styles[\"label\"], props?.className)}\n >\n {props.children}\n </UnstyledLabel>\n );\n};\n"],"names":["FieldError","props","jsx","UnstyledFieldError","clsx","styles","Label","UnstyledLabel"],"mappings":";;;;;GAOaA,IAAa,CAACC,MAEnB,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACI,GAAGF;AAAA,IACJ,WAAWG,EAAKC,EAAO,OAAUJ,EAAM,SAAS;AAAA,EAAA;AAAA;;GCP/CK,IAAQ,CAACL,MAEd,gBAAAC;AAAA,EAACK;AAAAA,EAAA;AAAA,IACI,GAAGN;AAAA,IACJ,WAAWG,EAAKC,EAAO,OAAUJ,GAAO,SAAS;AAAA,IAEhD,UAAAA,EAAM;AAAA,EAAA;AAAA;"}
|
package/dist/chunks/Link
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { clsx as n } from "clsx";
|
|
3
|
+
import { Link as t } from "react-aria-components";
|
|
4
|
+
import { T as _ } from "./Tooltip";
|
|
5
5
|
import '../assets/Link.css';const l = "_link_ocbdl_1", m = "_primary_ocbdl_33", d = "_secondary_ocbdl_41", y = "_tertiary_ocbdl_45", p = "_error_ocbdl_49", u = "_success_ocbdl_57", c = {
|
|
6
6
|
link: l,
|
|
7
7
|
primary: m,
|
|
@@ -17,11 +17,11 @@ import '../assets/Link.css';const l = "_link_ocbdl_1", m = "_primary_ocbdl_33",
|
|
|
17
17
|
underline: i = !0,
|
|
18
18
|
children: e,
|
|
19
19
|
...s
|
|
20
|
-
}) => /* @__PURE__ */ o(
|
|
21
|
-
|
|
20
|
+
}) => /* @__PURE__ */ o(_, { description: a, theme: r, children: /* @__PURE__ */ o(
|
|
21
|
+
t,
|
|
22
22
|
{
|
|
23
23
|
...s,
|
|
24
|
-
className:
|
|
24
|
+
className: n(c.link, c[r], s.className),
|
|
25
25
|
...i && { "data-underline": !0 },
|
|
26
26
|
children: e
|
|
27
27
|
}
|
|
@@ -29,3 +29,4 @@ import '../assets/Link.css';const l = "_link_ocbdl_1", m = "_primary_ocbdl_33",
|
|
|
29
29
|
export {
|
|
30
30
|
L
|
|
31
31
|
};
|
|
32
|
+
//# sourceMappingURL=Link.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link","sources":["../../src/components/Link/LinkBase/Link.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link as UnstyledLink } from \"react-aria-components\";\nimport { Tooltip } from \"@/components/Tooltip/Tooltip\";\nimport styles from \"./link.module.css\";\nimport type { LinkProps } from \"./types\";\n\nexport const Link = ({\n theme = \"primary\",\n description,\n underline = true,\n children,\n ...props\n}: LinkProps) => {\n return (\n <Tooltip description={description} theme={theme}>\n <UnstyledLink\n {...props}\n className={clsx(styles[\"link\"], styles[theme], props.className)}\n {...(underline && { \"data-underline\": true })}\n >\n {children}\n </UnstyledLink>\n </Tooltip>\n );\n};\n"],"names":["Link","theme","description","underline","children","props","jsx","Tooltip","UnstyledLink","clsx","styles"],"mappings":";;;;;;;;;;;;;GAMaA,IAAO,CAAC;AAAA,EACjB,OAAAC,IAAQ;AAAA,EACR,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,GAAGC;AACP,MAEQ,gBAAAC,EAACC,GAAA,EAAQ,aAAAL,GAA0B,OAAAD,GAC/B,UAAA,gBAAAK;AAAA,EAACE;AAAAA,EAAA;AAAA,IACI,GAAGH;AAAA,IACJ,WAAWI,EAAKC,EAAO,MAASA,EAAOT,CAAK,GAAGI,EAAM,SAAS;AAAA,IAC7D,GAAIF,KAAa,EAAE,kBAAkB,GAAA;AAAA,IAErC,UAAAC;AAAA,EAAA;AAAA,GAET;"}
|
package/dist/chunks/Loader
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { clsx as r } from "clsx";
|
|
3
|
+
import { LoaderCircle as e } from "lucide-react";
|
|
4
4
|
import '../assets/Loader.css';const s = "_loader_9ec9z_1", a = {
|
|
5
5
|
loader: s
|
|
6
|
-
}, m = () => /* @__PURE__ */ o(
|
|
6
|
+
}, m = () => /* @__PURE__ */ o(e, { className: r(a.loader) });
|
|
7
7
|
export {
|
|
8
8
|
m as L
|
|
9
9
|
};
|
|
10
|
+
//# sourceMappingURL=Loader.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader","sources":["../../src/components/Loader/Loader.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { LoaderCircle } from \"lucide-react\";\nimport styles from \"./loader.module.css\";\n\nexport const Loader = () => {\n return <LoaderCircle className={clsx(styles[\"loader\"])} />;\n};\n"],"names":["Loader","LoaderCircle","clsx","styles"],"mappings":";;;;;GAIaA,IAAS,wBACVC,GAAA,EAAa,WAAWC,EAAKC,EAAO,MAAS,GAAG;"}
|
package/dist/chunks/Menu
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { B as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"item
|
|
11
|
-
|
|
12
|
-
}, l = ({ menuItem: e, cardBackground:
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as u } from "clsx";
|
|
3
|
+
import { ChevronRight as d } from "lucide-react";
|
|
4
|
+
import { MenuTrigger as h, Menu as c, MenuItem as f, SubmenuTrigger as g } from "react-aria-components";
|
|
5
|
+
import { B as a } from "./BaseCard";
|
|
6
|
+
import { P as p } from "./Popover";
|
|
7
|
+
import { S as _ } from "./Separator";
|
|
8
|
+
import '../assets/Menu.css';const b = "_menu_1nouc_1", i = {
|
|
9
|
+
menu: b,
|
|
10
|
+
"menu-item": "_menu-item_1nouc_7",
|
|
11
|
+
"item-node": "_item-node_1nouc_12"
|
|
12
|
+
}, l = ({ menuItem: e, cardBackground: s }) => {
|
|
13
13
|
if (e.type === "separator")
|
|
14
|
-
return /* @__PURE__ */ r(
|
|
15
|
-
const
|
|
16
|
-
|
|
14
|
+
return /* @__PURE__ */ r(_, {});
|
|
15
|
+
const t = !!e.subItems && e.subItems.length > 0, n = /* @__PURE__ */ m(
|
|
16
|
+
f,
|
|
17
17
|
{
|
|
18
|
-
className:
|
|
18
|
+
className: u(i["menu-item"], i[e.type]),
|
|
19
19
|
onAction: e.onPress,
|
|
20
20
|
href: e.href,
|
|
21
21
|
target: e.target,
|
|
22
22
|
children: [
|
|
23
23
|
e.node,
|
|
24
|
-
|
|
24
|
+
t && /* @__PURE__ */ r(d, {})
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */ r(
|
|
28
|
+
return t ? /* @__PURE__ */ m(g, { children: [
|
|
29
|
+
n,
|
|
30
|
+
/* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(a, { background: s, children: /* @__PURE__ */ r(c, { className: u(i.menu), children: e.subItems.map((o) => /* @__PURE__ */ r(
|
|
31
31
|
l,
|
|
32
32
|
{
|
|
33
|
-
menuItem:
|
|
34
|
-
cardBackground:
|
|
33
|
+
menuItem: o,
|
|
34
|
+
cardBackground: s
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
o.id
|
|
37
37
|
)) }) }) })
|
|
38
|
-
] }) :
|
|
39
|
-
},
|
|
38
|
+
] }) : n;
|
|
39
|
+
}, j = ({
|
|
40
40
|
children: e,
|
|
41
|
-
menuItems:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
menuItems: s,
|
|
42
|
+
triggerType: t = "press",
|
|
43
|
+
cardBackground: n = "solid"
|
|
44
|
+
}) => /* @__PURE__ */ m(h, { trigger: t, children: [
|
|
44
45
|
e,
|
|
45
|
-
/* @__PURE__ */ r(
|
|
46
|
+
/* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(a, { background: n, children: /* @__PURE__ */ r(c, { className: u(i.menu), children: s.map((o) => /* @__PURE__ */ r(
|
|
46
47
|
l,
|
|
47
48
|
{
|
|
48
49
|
cardBackground: n,
|
|
49
|
-
menuItem:
|
|
50
|
+
menuItem: o
|
|
50
51
|
},
|
|
51
|
-
|
|
52
|
+
o.id
|
|
52
53
|
)) }) }) })
|
|
53
54
|
] });
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
j as M
|
|
56
57
|
};
|
|
58
|
+
//# sourceMappingURL=Menu.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu","sources":["../../src/components/Menu/MenuBase/Menu.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ChevronRight } from \"lucide-react\";\nimport {\n MenuItem,\n MenuTrigger,\n SubmenuTrigger,\n Menu as UnstyledMenu,\n} from \"react-aria-components\";\nimport { BaseCard } from \"@/components/Card/BaseCard\";\nimport { Popover } from \"@/components/Popover/PopoverBase\";\nimport { Separator } from \"@/components/Separator/Separator\";\nimport styles from \"./menu.module.css\";\nimport type { MenuProps, RenderMenuProps } from \"./types\";\n\nconst RenderMenu = ({ menuItem, cardBackground }: RenderMenuProps) => {\n if (menuItem.type === \"separator\") {\n return <Separator />;\n }\n\n const hasSubmenu = !!menuItem.subItems && menuItem.subItems.length > 0;\n const menuComp = (\n <MenuItem\n className={clsx(styles[\"menu-item\"], styles[menuItem.type])}\n onAction={menuItem.onPress}\n href={menuItem.href}\n target={menuItem.target}\n >\n {menuItem.node}\n\n {hasSubmenu && <ChevronRight />}\n </MenuItem>\n );\n\n if (!hasSubmenu) return menuComp;\n\n return (\n <SubmenuTrigger>\n {menuComp}\n <Popover>\n <BaseCard background={cardBackground}>\n <UnstyledMenu className={clsx(styles[\"menu\"])}>\n {menuItem.subItems.map((subMenu) => {\n return (\n <RenderMenu\n key={subMenu.id}\n menuItem={subMenu}\n cardBackground={cardBackground}\n />\n );\n })}\n </UnstyledMenu>\n </BaseCard>\n </Popover>\n </SubmenuTrigger>\n );\n};\n\nexport const Menu = ({\n children,\n menuItems,\n triggerType = \"press\",\n cardBackground = \"solid\",\n}: MenuProps) => {\n return (\n <MenuTrigger trigger={triggerType}>\n {children}\n <Popover>\n <BaseCard background={cardBackground}>\n <UnstyledMenu className={clsx(styles[\"menu\"])}>\n {menuItems.map((item) => {\n return (\n <RenderMenu\n key={item.id}\n cardBackground={cardBackground}\n menuItem={item}\n />\n );\n })}\n </UnstyledMenu>\n </BaseCard>\n </Popover>\n </MenuTrigger>\n );\n};\n"],"names":["RenderMenu","menuItem","cardBackground","Separator","hasSubmenu","menuComp","jsxs","MenuItem","clsx","styles","ChevronRight","SubmenuTrigger","Popover","jsx","BaseCard","UnstyledMenu","subMenu","Menu","children","menuItems","triggerType","MenuTrigger","item"],"mappings":";;;;;;;;;;;GAcMA,IAAa,CAAC,EAAE,UAAAC,GAAU,gBAAAC,QAAsC;AAClE,MAAID,EAAS,SAAS;AAClB,6BAAQE,GAAA,EAAU;AAGtB,QAAMC,IAAa,CAAC,CAACH,EAAS,YAAYA,EAAS,SAAS,SAAS,GAC/DI,IACF,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAWC,EAAKC,EAAO,WAAW,GAAGA,EAAOR,EAAS,IAAI,CAAC;AAAA,MAC1D,UAAUA,EAAS;AAAA,MACnB,MAAMA,EAAS;AAAA,MACf,QAAQA,EAAS;AAAA,MAEhB,UAAA;AAAA,QAAAA,EAAS;AAAA,QAETG,uBAAeM,GAAA,CAAA,CAAa;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIrC,SAAKN,sBAGAO,GAAA,EACI,UAAA;AAAA,IAAAN;AAAA,sBACAO,GAAA,EACG,UAAA,gBAAAC,EAACC,KAAS,YAAYZ,GAClB,4BAACa,GAAA,EAAa,WAAWP,EAAKC,EAAO,IAAO,GACvC,YAAS,SAAS,IAAI,CAACO,MAEhB,gBAAAH;AAAA,MAACb;AAAA,MAAA;AAAA,QAEG,UAAUgB;AAAA,QACV,gBAAAd;AAAA,MAAA;AAAA,MAFKc,EAAQ;AAAA,IAAA,CAKxB,EAAA,CACL,EAAA,CACJ,EAAA,CACJ;AAAA,EAAA,GACJ,IApBoBX;AAsB5B,GAEaY,IAAO,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,gBAAAlB,IAAiB;AACrB,MAEQ,gBAAAI,EAACe,GAAA,EAAY,SAASD,GACjB,UAAA;AAAA,EAAAF;AAAA,oBACAN,GAAA,EACG,UAAA,gBAAAC,EAACC,GAAA,EAAS,YAAYZ,GAClB,UAAA,gBAAAW,EAACE,GAAA,EAAa,WAAWP,EAAKC,EAAO,IAAO,GACvC,UAAAU,EAAU,IAAI,CAACG,MAER,gBAAAT;AAAA,IAACb;AAAA,IAAA;AAAA,MAEG,gBAAAE;AAAA,MACA,UAAUoB;AAAA,IAAA;AAAA,IAFLA,EAAK;AAAA,EAAA,CAKrB,EAAA,CACL,EAAA,CACJ,EAAA,CACJ;AAAA,GACJ;"}
|
package/dist/chunks/MenuButton
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { M as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { M as m } from "./Menu";
|
|
3
|
+
const M = ({
|
|
4
|
+
children: o,
|
|
5
|
+
menuItems: r,
|
|
6
|
+
triggerType: t,
|
|
7
|
+
cardBackground: n
|
|
8
|
+
}) => /* @__PURE__ */ e(
|
|
9
|
+
m,
|
|
10
|
+
{
|
|
11
|
+
menuItems: r,
|
|
12
|
+
triggerType: t,
|
|
13
|
+
cardBackground: n,
|
|
14
|
+
children: o
|
|
15
|
+
}
|
|
16
|
+
);
|
|
4
17
|
export {
|
|
5
|
-
|
|
18
|
+
M
|
|
6
19
|
};
|
|
20
|
+
//# sourceMappingURL=MenuButton.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuButton","sources":["../../src/components/Menu/MenuButton/MenuButton.tsx"],"sourcesContent":["import { Menu } from \"@/components/Menu/MenuBase/Menu\";\nimport type { MenuButtonProps } from \"@/components/Menu/MenuBase/types\";\n\nexport const MenuButton = ({\n children,\n menuItems,\n triggerType,\n cardBackground,\n}: MenuButtonProps) => {\n return (\n <Menu\n menuItems={menuItems}\n triggerType={triggerType}\n cardBackground={cardBackground}\n >\n {children}\n </Menu>\n );\n};\n"],"names":["MenuButton","children","menuItems","triggerType","cardBackground","jsx","Menu"],"mappings":";;AAGO,MAAMA,IAAa,CAAC;AAAA,EACvB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACJ,MAEQ,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACG,WAAAJ;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IAEC,UAAAH;AAAA,EAAA;AAAA;"}
|
package/dist/chunks/MenuLabel
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import '../assets/MenuLabel.css';const
|
|
7
|
-
pressable:
|
|
8
|
-
},
|
|
2
|
+
import l from "clsx";
|
|
3
|
+
import { Button as m } from "react-aria-components";
|
|
4
|
+
import { M as a } from "./Menu";
|
|
5
|
+
import { T as n } from "./Tooltip";
|
|
6
|
+
import '../assets/MenuLabel.css';const i = "_pressable_c37di_1", c = {
|
|
7
|
+
pressable: i
|
|
8
|
+
}, x = ({
|
|
9
9
|
children: r,
|
|
10
10
|
menuItems: e,
|
|
11
|
-
description: o
|
|
12
|
-
|
|
11
|
+
description: o,
|
|
12
|
+
triggerType: t,
|
|
13
|
+
cardBackground: p
|
|
14
|
+
}) => /* @__PURE__ */ s(
|
|
15
|
+
a,
|
|
16
|
+
{
|
|
17
|
+
menuItems: e,
|
|
18
|
+
triggerType: t,
|
|
19
|
+
cardBackground: p,
|
|
20
|
+
children: /* @__PURE__ */ s(n, { description: o, children: /* @__PURE__ */ s(m, { type: "button", className: l(c.pressable), children: r }) })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
13
23
|
export {
|
|
14
|
-
M
|
|
24
|
+
x as M
|
|
15
25
|
};
|
|
26
|
+
//# sourceMappingURL=MenuLabel.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuLabel","sources":["../../src/components/Menu/MenuLabel/MenuLabel.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { Button } from \"react-aria-components\";\nimport { Menu } from \"@/components/Menu/MenuBase/Menu\";\nimport type { MenuLabelProps } from \"@/components/Menu/MenuBase/types\";\nimport { Tooltip } from \"@/components/Tooltip/Tooltip\";\nimport styles from \"./menuLabel.module.css\";\n\nexport const MenuLabel = ({\n children,\n menuItems,\n description,\n triggerType,\n cardBackground,\n}: MenuLabelProps) => {\n return (\n <Menu\n menuItems={menuItems}\n triggerType={triggerType}\n cardBackground={cardBackground}\n >\n <Tooltip description={description}>\n <Button type=\"button\" className={clsx(styles[\"pressable\"])}>\n {children}\n </Button>\n </Tooltip>\n </Menu>\n );\n};\n"],"names":["MenuLabel","children","menuItems","description","triggerType","cardBackground","jsx","Menu","Tooltip","Button","clsx","styles"],"mappings":";;;;;;;GAOaA,IAAY,CAAC;AAAA,EACtB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACJ,MAEQ,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACG,WAAAL;AAAA,IACA,aAAAE;AAAA,IACA,gBAAAC;AAAA,IAEA,UAAA,gBAAAC,EAACE,GAAA,EAAQ,aAAAL,GACL,UAAA,gBAAAG,EAACG,KAAO,MAAK,UAAS,WAAWC,EAAKC,EAAO,SAAY,GACpD,UAAAV,GACL,EAAA,CACJ;AAAA,EAAA;AAAA;"}
|
package/dist/chunks/ModalAction
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { M as x } from "./ModalBase";
|
|
3
|
-
import { T as h } from "./TextButton";
|
|
4
2
|
import a from "clsx";
|
|
3
|
+
import { T as x } from "./TextButton";
|
|
4
|
+
import { M as h } from "./ModalBase";
|
|
5
5
|
import '../assets/ModalAction.css';const f = "_modal_x3bbs_1", p = "_end_x3bbs_20", o = {
|
|
6
6
|
modal: f,
|
|
7
7
|
"modal-header": "_modal-header_x3bbs_6",
|
|
@@ -20,7 +20,7 @@ import '../assets/ModalAction.css';const f = "_modal_x3bbs_1", p = "_end_x3bbs_2
|
|
|
20
20
|
}) => {
|
|
21
21
|
const b = typeof e == "function";
|
|
22
22
|
return /* @__PURE__ */ s(
|
|
23
|
-
|
|
23
|
+
h,
|
|
24
24
|
{
|
|
25
25
|
trigger: r,
|
|
26
26
|
modalOverlayProps: {
|
|
@@ -39,7 +39,7 @@ import '../assets/ModalAction.css';const f = "_modal_x3bbs_1", p = "_end_x3bbs_2
|
|
|
39
39
|
),
|
|
40
40
|
children: [
|
|
41
41
|
b ? e({ close: t }) : e,
|
|
42
|
-
/* @__PURE__ */ s(
|
|
42
|
+
/* @__PURE__ */ s(x, { onPress: t, theme: "inverse-surface", children: c })
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
)
|
|
@@ -50,3 +50,4 @@ import '../assets/ModalAction.css';const f = "_modal_x3bbs_1", p = "_end_x3bbs_2
|
|
|
50
50
|
export {
|
|
51
51
|
N as M
|
|
52
52
|
};
|
|
53
|
+
//# sourceMappingURL=ModalAction.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalAction","sources":["../../src/components/Modal/ModalAction/ModalAction.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { TextButton } from \"@/components/Button/TextButton\";\nimport { ModalBase } from \"@/components/Modal/ModalBase/ModalBase\";\nimport styles from \"./modalAction.module.css\";\nimport type { ModalActionProps } from \"./types\";\n\nexport const ModalAction = ({\n trigger,\n header,\n children,\n actionPlacement = \"start\",\n modalAction,\n closeText,\n isDismissable,\n isKeyboardDismissableDisabled,\n}: ModalActionProps) => {\n const isActionFunction = typeof modalAction === \"function\";\n\n return (\n <ModalBase\n trigger={trigger}\n modalOverlayProps={{\n isDismissable: isDismissable,\n isKeyboardDismissDisabled: isKeyboardDismissableDisabled,\n }}\n >\n {({ close }) => {\n return (\n <div className={clsx(styles[\"modal\"])}>\n {header && (\n <h2 className={clsx(styles[\"modal-header\"])}>\n {header}\n </h2>\n )}\n\n <div className={clsx(styles[\"modal-content\"])}>\n {children}\n </div>\n\n <div\n className={clsx(\n styles[\"modal-action\"],\n styles[actionPlacement]\n )}\n >\n {isActionFunction\n ? modalAction({ close })\n : modalAction}\n\n <TextButton onPress={close} theme=\"inverse-surface\">\n {closeText}\n </TextButton>\n </div>\n </div>\n );\n }}\n </ModalBase>\n );\n};\n"],"names":["ModalAction","trigger","header","children","actionPlacement","modalAction","closeText","isDismissable","isKeyboardDismissableDisabled","isActionFunction","jsx","ModalBase","close","clsx","styles","jsxs","TextButton"],"mappings":";;;;;;;;;;GAMaA,IAAc,CAAC;AAAA,EACxB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,+BAAAC;AACJ,MAAwB;AACpB,QAAMC,IAAmB,OAAOJ,KAAgB;AAEhD,SACI,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,SAAAV;AAAA,MACA,mBAAmB;AAAA,QACf,eAAAM;AAAA,QACA,2BAA2BC;AAAA,MAAA;AAAA,MAG9B,UAAA,CAAC,EAAE,OAAAI,0BAEK,OAAA,EAAI,WAAWC,EAAKC,EAAO,KAAQ,GAC/B,UAAA;AAAA,QAAAZ,KACG,gBAAAQ,EAAC,QAAG,WAAWG,EAAKC,EAAO,cAAc,CAAC,GACrC,UAAAZ,EAAA,CACL;AAAA,QAGJ,gBAAAQ,EAAC,SAAI,WAAWG,EAAKC,EAAO,eAAe,CAAC,GACvC,UAAAX,GACL;AAAA,QAEA,gBAAAY;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAWF;AAAA,cACPC,EAAO,cAAc;AAAA,cACrBA,EAAOV,CAAe;AAAA,YAAA;AAAA,YAGzB,UAAA;AAAA,cAAAK,IACKJ,EAAY,EAAE,OAAAO,EAAA,CAAO,IACrBP;AAAA,gCAELW,GAAA,EAAW,SAASJ,GAAO,OAAM,mBAC7B,UAAAN,EAAA,CACL;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ,GACJ;AAAA,IAER;AAAA,EAAA;AAGZ;"}
|
package/dist/chunks/ModalBase
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as l } from "clsx";
|
|
2
3
|
import { DialogTrigger as t, ModalOverlay as n, Modal as f, Dialog as g } from "react-aria-components";
|
|
3
4
|
import { B as p } from "./BaseCard";
|
|
4
|
-
import { clsx as l } from "clsx";
|
|
5
5
|
import '../assets/ModalBase.css';const y = "_modal_1pyzf_1", r = {
|
|
6
6
|
"modal-overlay": "_modal-overlay_1pyzf_1",
|
|
7
7
|
modal: y
|
|
@@ -29,3 +29,4 @@ import '../assets/ModalBase.css';const y = "_modal_1pyzf_1", r = {
|
|
|
29
29
|
export {
|
|
30
30
|
v as M
|
|
31
31
|
};
|
|
32
|
+
//# sourceMappingURL=ModalBase.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalBase","sources":["../../src/components/Modal/ModalBase/ModalBase.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n Dialog,\n DialogTrigger,\n Modal,\n ModalOverlay,\n} from \"react-aria-components\";\nimport { BaseCard } from \"@/components/Card/BaseCard\";\nimport styles from \"./modalBase.module.css\";\nimport type { ModalBaseProps } from \"./types\";\n\nexport const ModalBase = ({\n cardBackground = \"gradient\",\n trigger,\n modalOverlayProps,\n dialogTriggerProps,\n modalProps,\n ...dialogProps\n}: ModalBaseProps) => {\n return (\n <DialogTrigger {...dialogTriggerProps}>\n {trigger}\n\n <ModalOverlay\n {...modalOverlayProps}\n className={clsx(\n styles[\"modal-overlay\"],\n modalOverlayProps?.className\n )}\n >\n <Modal {...modalProps} className={clsx(styles[\"modal\"])}>\n <BaseCard background={cardBackground}>\n <Dialog {...dialogProps} />\n </BaseCard>\n </Modal>\n </ModalOverlay>\n </DialogTrigger>\n );\n};\n"],"names":["ModalBase","cardBackground","trigger","modalOverlayProps","dialogTriggerProps","modalProps","dialogProps","jsxs","DialogTrigger","jsx","ModalOverlay","clsx","styles","Modal","BaseCard","Dialog"],"mappings":";;;;;;;GAWaA,IAAY,CAAC;AAAA,EACtB,gBAAAC,IAAiB;AAAA,EACjB,SAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACP,MAEQ,gBAAAC,EAACC,GAAA,EAAe,GAAGJ,GACd,UAAA;AAAA,EAAAF;AAAA,EAED,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACI,GAAGP;AAAA,MACJ,WAAWQ;AAAA,QACPC,EAAO,eAAe;AAAA,QACtBT,GAAmB;AAAA,MAAA;AAAA,MAGvB,4BAACU,GAAA,EAAO,GAAGR,GAAY,WAAWM,EAAKC,EAAO,KAAQ,GAClD,UAAA,gBAAAH,EAACK,GAAA,EAAS,YAAYb,GAClB,UAAA,gBAAAQ,EAACM,KAAQ,GAAGT,GAAa,GAC7B,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AACJ,GACJ;"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as r,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as c } from "clsx";
|
|
3
|
+
import { ChevronDown as u } from "lucide-react";
|
|
4
|
+
import { Fragment as n } from "react";
|
|
5
|
+
import { L as i } from "./Link";
|
|
6
|
+
import { T as d } from "./TextButton";
|
|
7
|
+
import { M as m } from "./MenuLabel";
|
|
8
|
+
import '../assets/NavigationMenu.css';const l = "_menu_vmcq5_1", p = {
|
|
9
|
+
menu: l
|
|
10
|
+
}, k = ({ items: s, className: o }) => {
|
|
11
|
+
const t = s.filter((e) => e.type !== "separator");
|
|
12
|
+
return /* @__PURE__ */ r("div", { className: c(p.menu, o), children: t.map((e) => {
|
|
12
13
|
switch (e.type) {
|
|
13
14
|
case "sub-items":
|
|
14
|
-
return /* @__PURE__ */ a(
|
|
15
|
+
return /* @__PURE__ */ a(m, { menuItems: e.subItems, children: [
|
|
15
16
|
e.node,
|
|
16
|
-
/* @__PURE__ */ r(
|
|
17
|
+
/* @__PURE__ */ r(u, {})
|
|
17
18
|
] }, e.id);
|
|
18
19
|
case "item-node":
|
|
19
|
-
return /* @__PURE__ */ r(
|
|
20
|
+
return /* @__PURE__ */ r(n, { children: e.node }, e.id);
|
|
20
21
|
case "link":
|
|
21
22
|
return /* @__PURE__ */ r(
|
|
22
|
-
|
|
23
|
+
i,
|
|
23
24
|
{
|
|
24
25
|
href: e.href,
|
|
25
26
|
target: e.target,
|
|
@@ -31,7 +32,7 @@ import '../assets/NavigationMenu.css';const h = "_menu_vmcq5_1", l = {
|
|
|
31
32
|
);
|
|
32
33
|
case "button":
|
|
33
34
|
return /* @__PURE__ */ r(
|
|
34
|
-
|
|
35
|
+
d,
|
|
35
36
|
{
|
|
36
37
|
onPress: e.onPress,
|
|
37
38
|
theme: "inverse-surface",
|
|
@@ -40,9 +41,12 @@ import '../assets/NavigationMenu.css';const h = "_menu_vmcq5_1", l = {
|
|
|
40
41
|
},
|
|
41
42
|
e.id
|
|
42
43
|
);
|
|
44
|
+
default:
|
|
45
|
+
return /* @__PURE__ */ r(n, {}, "never");
|
|
43
46
|
}
|
|
44
47
|
}) });
|
|
45
48
|
};
|
|
46
49
|
export {
|
|
47
|
-
|
|
50
|
+
k as N
|
|
48
51
|
};
|
|
52
|
+
//# sourceMappingURL=NavigationMenu.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationMenu","sources":["../../src/components/Navigation/NavigationMenu/NavigationMenu.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ChevronDown } from \"lucide-react\";\nimport { Fragment } from \"react\";\nimport { Link } from \"@/components/Link/LinkBase/Link\";\nimport { TextButton } from \"../../Button/TextButton\";\nimport { MenuLabel } from \"../../Menu/MenuLabel\";\nimport styles from \"./navigationMenu.module.css\";\nimport type { NavigationMenuProps } from \"./types\";\n\nexport const NavigationMenu = ({ items, className }: NavigationMenuProps) => {\n const normalizedItems = items.filter((item) => item.type !== \"separator\");\n\n return (\n <div className={clsx(styles[\"menu\"], className)}>\n {normalizedItems.map((item) => {\n switch (item.type) {\n case \"sub-items\":\n return (\n <MenuLabel key={item.id} menuItems={item.subItems}>\n {item.node}\n <ChevronDown />\n </MenuLabel>\n );\n case \"item-node\":\n return <Fragment key={item.id}>{item.node}</Fragment>;\n case \"link\":\n return (\n <Link\n key={item.id}\n href={item.href}\n target={item.target}\n underline={item.active}\n theme={\n item.active ? \"primary\" : \"inverse-surface\"\n }\n >\n {item.node}\n </Link>\n );\n case \"button\":\n return (\n <TextButton\n key={item.id}\n onPress={item.onPress}\n theme=\"inverse-surface\"\n shape=\"shrink\"\n >\n {item.node}\n </TextButton>\n );\n default:\n return <Fragment key={\"never\"}></Fragment>;\n }\n })}\n </div>\n );\n};\n"],"names":["NavigationMenu","items","className","normalizedItems","item","jsx","clsx","styles","jsxs","MenuLabel","ChevronDown","Fragment","Link","TextButton"],"mappings":";;;;;;;;;GASaA,IAAiB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAqC;AACzE,QAAMC,IAAkBF,EAAM,OAAO,CAACG,MAASA,EAAK,SAAS,WAAW;AAExE,SACI,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAKC,EAAO,MAASL,CAAS,GACzC,UAAAC,EAAgB,IAAI,CAACC,MAAS;AAC3B,YAAQA,EAAK,MAAA;AAAA,MACT,KAAK;AACD,eACI,gBAAAI,EAACC,GAAA,EAAwB,WAAWL,EAAK,UACpC,UAAA;AAAA,UAAAA,EAAK;AAAA,4BACLM,GAAA,CAAA,CAAY;AAAA,QAAA,EAAA,GAFDN,EAAK,EAGrB;AAAA,MAER,KAAK;AACD,eAAO,gBAAAC,EAACM,GAAA,EAAwB,UAAAP,EAAK,KAAA,GAAfA,EAAK,EAAe;AAAA,MAC9C,KAAK;AACD,eACI,gBAAAC;AAAA,UAACO;AAAA,UAAA;AAAA,YAEG,MAAMR,EAAK;AAAA,YACX,QAAQA,EAAK;AAAA,YACb,WAAWA,EAAK;AAAA,YAChB,OACIA,EAAK,SAAS,YAAY;AAAA,YAG7B,UAAAA,EAAK;AAAA,UAAA;AAAA,UARDA,EAAK;AAAA,QAAA;AAAA,MAWtB,KAAK;AACD,eACI,gBAAAC;AAAA,UAACQ;AAAA,UAAA;AAAA,YAEG,SAAST,EAAK;AAAA,YACd,OAAM;AAAA,YACN,OAAM;AAAA,YAEL,UAAAA,EAAK;AAAA,UAAA;AAAA,UALDA,EAAK;AAAA,QAAA;AAAA,MAQtB;AACI,eAAO,gBAAAC,EAACM,OAAc,OAAS;AAAA,IAAA;AAAA,EAE3C,CAAC,EAAA,CACL;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationResponsive","sources":["../../src/components/Navigation/NavigationResponsive/NavigationResponsive.tsx"],"sourcesContent":["import { useMediaQuery } from \"usehooks-ts\";\nimport { NavigationMenu } from \"@/components/Navigation/NavigationMenu/NavigationMenu\";\nimport { NavigationSidebar } from \"@/components/Navigation/NavigationSidebar/NavigationSidebar\";\nimport type { NavigationResponsiveProps } from \"./types\";\n\nexport const NavigationResponsive = ({\n items,\n mediaQuery,\n ...sidebarProps\n}: NavigationResponsiveProps) => {\n const matches = useMediaQuery(`(${mediaQuery})`);\n\n return matches ? (\n <NavigationMenu items={items} />\n ) : (\n <NavigationSidebar items={items} {...sidebarProps} />\n );\n};\n"],"names":["NavigationResponsive","items","mediaQuery","sidebarProps","useMediaQuery","NavigationMenu","jsx","NavigationSidebar"],"mappings":";;;;AAKO,MAAMA,IAAuB,CAAC;AAAA,EACjC,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACP,MACoBC,EAAc,IAAIF,CAAU,GAAG,sBAG1CG,GAAA,EAAe,OAAAJ,EAAA,CAAc,IAE9B,gBAAAK,EAACC,GAAA,EAAkB,OAAAN,GAAe,GAAGE,EAAA,CAAc;"}
|