@fuf-stack/pixels 0.0.8 → 0.1.1
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/dist/Button/Button.cjs +3 -1
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.d.cts +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +1 -1
- package/dist/Button/index.cjs +3 -1
- package/dist/Button/index.cjs.map +1 -1
- package/dist/Button/index.js +3 -5
- package/dist/Button/index.js.map +1 -1
- package/dist/Label/Label.cjs +58 -0
- package/dist/Label/Label.cjs.map +1 -0
- package/dist/Label/Label.d.cts +24 -0
- package/dist/Label/Label.d.ts +24 -0
- package/dist/Label/Label.js +7 -0
- package/dist/Label/Label.js.map +1 -0
- package/dist/Label/index.cjs +63 -0
- package/dist/Label/index.cjs.map +1 -0
- package/dist/Label/index.d.cts +8 -0
- package/dist/Label/index.d.ts +8 -0
- package/dist/Label/index.js +10 -0
- package/dist/Label/index.js.map +1 -0
- package/dist/Menu/Menu.cjs +184 -0
- package/dist/Menu/Menu.cjs.map +1 -0
- package/dist/Menu/Menu.d.cts +55 -0
- package/dist/Menu/Menu.d.ts +55 -0
- package/dist/Menu/Menu.js +10 -0
- package/dist/Menu/Menu.js.map +1 -0
- package/dist/Menu/index.cjs +189 -0
- package/dist/Menu/index.cjs.map +1 -0
- package/dist/Menu/index.d.cts +7 -0
- package/dist/Menu/index.d.ts +7 -0
- package/dist/Menu/index.js +13 -0
- package/dist/Menu/index.js.map +1 -0
- package/dist/Modal/Modal.cjs +86 -0
- package/dist/Modal/Modal.cjs.map +1 -0
- package/dist/Modal/Modal.d.cts +29 -0
- package/dist/Modal/Modal.d.ts +29 -0
- package/dist/Modal/Modal.js +9 -0
- package/dist/Modal/Modal.js.map +1 -0
- package/dist/Modal/index.cjs +85 -0
- package/dist/Modal/index.cjs.map +1 -0
- package/dist/Modal/index.d.cts +7 -0
- package/dist/Modal/index.d.ts +7 -0
- package/dist/Modal/index.js +10 -0
- package/dist/Modal/index.js.map +1 -0
- package/dist/Popover/Popover.cjs +72 -0
- package/dist/Popover/Popover.cjs.map +1 -0
- package/dist/Popover/Popover.d.cts +31 -0
- package/dist/Popover/Popover.d.ts +31 -0
- package/dist/Popover/Popover.js +7 -0
- package/dist/Popover/Popover.js.map +1 -0
- package/dist/Popover/index.cjs +77 -0
- package/dist/Popover/index.cjs.map +1 -0
- package/dist/Popover/index.d.cts +8 -0
- package/dist/Popover/index.d.ts +8 -0
- package/dist/Popover/index.js +10 -0
- package/dist/Popover/index.js.map +1 -0
- package/dist/Tooltip/Tooltip.cjs +68 -0
- package/dist/Tooltip/Tooltip.cjs.map +1 -0
- package/dist/Tooltip/Tooltip.d.cts +27 -0
- package/dist/Tooltip/Tooltip.d.ts +27 -0
- package/dist/Tooltip/Tooltip.js +9 -0
- package/dist/Tooltip/Tooltip.js.map +1 -0
- package/dist/Tooltip/index.cjs +67 -0
- package/dist/Tooltip/index.cjs.map +1 -0
- package/dist/Tooltip/index.d.cts +7 -0
- package/dist/Tooltip/index.d.ts +7 -0
- package/dist/Tooltip/index.js +10 -0
- package/dist/Tooltip/index.js.map +1 -0
- package/dist/{chunk-ZXTDGCUF.js → chunk-6QVKZ4AT.js} +4 -2
- package/dist/{chunk-ZXTDGCUF.js.map → chunk-6QVKZ4AT.js.map} +1 -1
- package/dist/chunk-CEUL4NWH.js +28 -0
- package/dist/chunk-CEUL4NWH.js.map +1 -0
- package/dist/chunk-EYUTNORZ.js +58 -0
- package/dist/chunk-EYUTNORZ.js.map +1 -0
- package/dist/chunk-K3QI56MF.js +80 -0
- package/dist/chunk-K3QI56MF.js.map +1 -0
- package/dist/chunk-NFWS2SSN.js +11 -0
- package/dist/chunk-NFWS2SSN.js.map +1 -0
- package/dist/chunk-ONXXZTZY.js +34 -0
- package/dist/chunk-ONXXZTZY.js.map +1 -0
- package/dist/chunk-SGAWYTO7.js +42 -0
- package/dist/chunk-SGAWYTO7.js.map +1 -0
- package/package.json +1 -1
package/dist/Button/Button.cjs
CHANGED
|
@@ -83,7 +83,8 @@ var Button = ({
|
|
|
83
83
|
size = void 0,
|
|
84
84
|
testId = void 0,
|
|
85
85
|
type = void 0,
|
|
86
|
-
variant = "solid"
|
|
86
|
+
variant = "solid",
|
|
87
|
+
...passthrouhProps
|
|
87
88
|
}) => {
|
|
88
89
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
89
90
|
import_button.Button,
|
|
@@ -100,6 +101,7 @@ var Button = ({
|
|
|
100
101
|
spinner: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingSpinner_default, {}),
|
|
101
102
|
type,
|
|
102
103
|
variant,
|
|
104
|
+
...passthrouhProps,
|
|
103
105
|
children: [
|
|
104
106
|
icon,
|
|
105
107
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button/Button.tsx","../../src/Button/subcomponents/LoadingSpinner.tsx"],"sourcesContent":["import type { ButtonProps as NextButtonProps } from '@nextui-org/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as NextButton } from '@nextui-org/button';\nimport cn from 'classnames';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport interface ButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** next ui button color */\n color?: NextButtonProps['color'];\n /** disables function of the button. */\n disabled?: boolean;\n /** If set loading animation is shown */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** on click event */\n onClick?: NextButtonProps['onPress'];\n /** 3 size options */\n size?: NextButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** sets the button type. */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** next ui button variants */\n variant?: NextButtonProps['variant'];\n}\n\n/**\n * Button component based on [NextUI Button](https://nextui.org/docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disabled = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n}: ButtonProps) => {\n return (\n <NextButton\n aria-label={ariaLabel}\n className={cn(className)}\n color={color}\n data-testid={testId}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n >\n {icon}\n {children}\n </NextButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://nextui.org/docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"animate-spin h-5 w-5 text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AACrC,wBAAe;;;ACCb;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;
|
|
1
|
+
{"version":3,"sources":["../../src/Button/Button.tsx","../../src/Button/subcomponents/LoadingSpinner.tsx"],"sourcesContent":["import type { ButtonProps as NextButtonProps } from '@nextui-org/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as NextButton } from '@nextui-org/button';\nimport cn from 'classnames';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport interface ButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** next ui button color */\n color?: NextButtonProps['color'];\n /** disables function of the button. */\n disabled?: boolean;\n /** If set loading animation is shown */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** on click event */\n onClick?: NextButtonProps['onPress'];\n /** 3 size options */\n size?: NextButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** sets the button type. */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** next ui button variants */\n variant?: NextButtonProps['variant'];\n}\n\n/**\n * Button component based on [NextUI Button](https://nextui.org/docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disabled = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n ...passthrouhProps\n}: ButtonProps) => {\n return (\n <NextButton\n aria-label={ariaLabel}\n className={cn(className)}\n color={color}\n data-testid={testId}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n {...passthrouhProps}\n >\n {icon}\n {children}\n </NextButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://nextui.org/docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"animate-spin h-5 w-5 text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AACrC,wBAAe;;;ACCb;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;AD8BE,IAAAA,sBAAA;AAhBJ,IAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,GAAG;AACL,MAAmB;AACjB,SACE;AAAA,IAAC,cAAAC;AAAA,IAAA;AAAA,MACC,cAAY;AAAA,MACZ,eAAW,kBAAAC,SAAG,SAAS;AAAA,MACvB;AAAA,MACA,eAAa;AAAA,MACb,YAAY;AAAA,MACZ,YAAY,CAAC,EAAE,QAAQ,CAAC;AAAA,MACxB,WAAW;AAAA,MACX,SAAS;AAAA,MACT;AAAA,MACA,SAAS,6CAAC,0BAAe;AAAA,MACzB;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,iBAAQ;","names":["import_jsx_runtime","NextButton","cn"]}
|
package/dist/Button/Button.d.cts
CHANGED
|
@@ -31,6 +31,6 @@ interface ButtonProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Button component based on [NextUI Button](https://nextui.org/docs/components/button)
|
|
33
33
|
*/
|
|
34
|
-
declare const Button: ({ ariaLabel, children, className, color, disabled, icon, loading, onClick, size, testId, type, variant, }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare const Button: ({ ariaLabel, children, className, color, disabled, icon, loading, onClick, size, testId, type, variant, ...passthrouhProps }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
35
35
|
|
|
36
36
|
export { type ButtonProps, Button as default };
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -31,6 +31,6 @@ interface ButtonProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Button component based on [NextUI Button](https://nextui.org/docs/components/button)
|
|
33
33
|
*/
|
|
34
|
-
declare const Button: ({ ariaLabel, children, className, color, disabled, icon, loading, onClick, size, testId, type, variant, }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare const Button: ({ ariaLabel, children, className, color, disabled, icon, loading, onClick, size, testId, type, variant, ...passthrouhProps }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
35
35
|
|
|
36
36
|
export { type ButtonProps, Button as default };
|
package/dist/Button/Button.js
CHANGED
package/dist/Button/index.cjs
CHANGED
|
@@ -85,7 +85,8 @@ var Button = ({
|
|
|
85
85
|
size = void 0,
|
|
86
86
|
testId = void 0,
|
|
87
87
|
type = void 0,
|
|
88
|
-
variant = "solid"
|
|
88
|
+
variant = "solid",
|
|
89
|
+
...passthrouhProps
|
|
89
90
|
}) => {
|
|
90
91
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
91
92
|
import_button.Button,
|
|
@@ -102,6 +103,7 @@ var Button = ({
|
|
|
102
103
|
spinner: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingSpinner_default, {}),
|
|
103
104
|
type,
|
|
104
105
|
variant,
|
|
106
|
+
...passthrouhProps,
|
|
105
107
|
children: [
|
|
106
108
|
icon,
|
|
107
109
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button/index.ts","../../src/Button/Button.tsx","../../src/Button/subcomponents/LoadingSpinner.tsx"],"sourcesContent":["import type { ButtonProps } from './Button';\n\nimport Button from './Button';\n\nexport default Button;\n\nexport type { ButtonProps };\n","import type { ButtonProps as NextButtonProps } from '@nextui-org/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as NextButton } from '@nextui-org/button';\nimport cn from 'classnames';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport interface ButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** next ui button color */\n color?: NextButtonProps['color'];\n /** disables function of the button. */\n disabled?: boolean;\n /** If set loading animation is shown */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** on click event */\n onClick?: NextButtonProps['onPress'];\n /** 3 size options */\n size?: NextButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** sets the button type. */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** next ui button variants */\n variant?: NextButtonProps['variant'];\n}\n\n/**\n * Button component based on [NextUI Button](https://nextui.org/docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disabled = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n}: ButtonProps) => {\n return (\n <NextButton\n aria-label={ariaLabel}\n className={cn(className)}\n color={color}\n data-testid={testId}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n >\n {icon}\n {children}\n </NextButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://nextui.org/docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"animate-spin h-5 w-5 text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACGA,oBAAqC;AACrC,wBAAe;;;ACCb;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;
|
|
1
|
+
{"version":3,"sources":["../../src/Button/index.ts","../../src/Button/Button.tsx","../../src/Button/subcomponents/LoadingSpinner.tsx"],"sourcesContent":["import type { ButtonProps } from './Button';\n\nimport Button from './Button';\n\nexport default Button;\n\nexport type { ButtonProps };\n","import type { ButtonProps as NextButtonProps } from '@nextui-org/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as NextButton } from '@nextui-org/button';\nimport cn from 'classnames';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport interface ButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** next ui button color */\n color?: NextButtonProps['color'];\n /** disables function of the button. */\n disabled?: boolean;\n /** If set loading animation is shown */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** on click event */\n onClick?: NextButtonProps['onPress'];\n /** 3 size options */\n size?: NextButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** sets the button type. */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** next ui button variants */\n variant?: NextButtonProps['variant'];\n}\n\n/**\n * Button component based on [NextUI Button](https://nextui.org/docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disabled = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n ...passthrouhProps\n}: ButtonProps) => {\n return (\n <NextButton\n aria-label={ariaLabel}\n className={cn(className)}\n color={color}\n data-testid={testId}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n {...passthrouhProps}\n >\n {icon}\n {children}\n </NextButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://nextui.org/docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"animate-spin h-5 w-5 text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACGA,oBAAqC;AACrC,wBAAe;;;ACCb;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;AD8BE,IAAAC,sBAAA;AAhBJ,IAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,GAAG;AACL,MAAmB;AACjB,SACE;AAAA,IAAC,cAAAC;AAAA,IAAA;AAAA,MACC,cAAY;AAAA,MACZ,eAAW,kBAAAC,SAAG,SAAS;AAAA,MACvB;AAAA,MACA,eAAa;AAAA,MACb,YAAY;AAAA,MACZ,YAAY,CAAC,EAAE,QAAQ,CAAC;AAAA,MACxB,WAAW;AAAA,MACX,SAAS;AAAA,MACT;AAAA,MACA,SAAS,6CAAC,0BAAe;AAAA,MACzB;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,iBAAQ;;;ADvEf,IAAOC,kBAAQ;","names":["Button_default","import_jsx_runtime","NextButton","cn","Button_default"]}
|
package/dist/Button/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NFWS2SSN.js";
|
|
4
|
+
import "../chunk-6QVKZ4AT.js";
|
|
4
5
|
import "../chunk-ZFEVTQWW.js";
|
|
5
|
-
|
|
6
|
-
// src/Button/index.ts
|
|
7
|
-
var Button_default2 = Button_default;
|
|
8
6
|
export {
|
|
9
|
-
|
|
7
|
+
Button_default as default
|
|
10
8
|
};
|
|
11
9
|
//# sourceMappingURL=index.js.map
|
package/dist/Button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/Label/Label.tsx
|
|
31
|
+
var Label_exports = {};
|
|
32
|
+
__export(Label_exports, {
|
|
33
|
+
default: () => Label_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Label_exports);
|
|
36
|
+
var import_chip = require("@nextui-org/chip");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"), 1);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var Label = ({
|
|
40
|
+
children,
|
|
41
|
+
className = void 0,
|
|
42
|
+
color = "default",
|
|
43
|
+
endContent = void 0,
|
|
44
|
+
size = "md",
|
|
45
|
+
startContent = void 0
|
|
46
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
import_chip.Chip,
|
|
48
|
+
{
|
|
49
|
+
className: (0, import_classnames.default)(className),
|
|
50
|
+
color,
|
|
51
|
+
endContent,
|
|
52
|
+
size,
|
|
53
|
+
startContent,
|
|
54
|
+
children
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
var Label_default = Label;
|
|
58
|
+
//# sourceMappingURL=Label.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Label/Label.tsx"],"sourcesContent":["import type { ChipProps } from '@nextui-org/chip';\nimport type { ReactNode } from 'react';\n\nimport { Chip as NextLabel } from '@nextui-org/chip';\nimport cn from 'classnames';\n\nexport interface LabelProps {\n /** content of the label */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the label */\n color?: ChipProps['color'];\n /** element to be rendered in the right side of the label */\n endContent?: ChipProps['endContent'];\n /** size of the label */\n size?: ChipProps['size'];\n /** element to be rendered in the left side of the label */\n startContent?: ChipProps['startContent'];\n}\n\n/**\n * Label component based on [NextUI Chip](https://nextui.org/docs/components/chip)\n */\nconst Label = ({\n children,\n className = undefined,\n color = 'default',\n endContent = undefined,\n size = 'md',\n startContent = undefined,\n}: LabelProps) => (\n <NextLabel\n className={cn(className)}\n color={color}\n endContent={endContent}\n size={size}\n startContent={startContent}\n >\n {children}\n </NextLabel>\n);\n\nexport default Label;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAkC;AAClC,wBAAe;AA4Bb;AARF,IAAM,QAAQ,CAAC;AAAA,EACb;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AACjB,MACE;AAAA,EAAC,YAAAA;AAAA,EAAA;AAAA,IACC,eAAW,kBAAAC,SAAG,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEC;AAAA;AACH;AAGF,IAAO,gBAAQ;","names":["NextLabel","cn"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ChipProps } from '@nextui-org/chip';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
interface LabelProps {
|
|
6
|
+
/** content of the label */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** CSS class name */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** color of the label */
|
|
11
|
+
color?: ChipProps['color'];
|
|
12
|
+
/** element to be rendered in the right side of the label */
|
|
13
|
+
endContent?: ChipProps['endContent'];
|
|
14
|
+
/** size of the label */
|
|
15
|
+
size?: ChipProps['size'];
|
|
16
|
+
/** element to be rendered in the left side of the label */
|
|
17
|
+
startContent?: ChipProps['startContent'];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Label component based on [NextUI Chip](https://nextui.org/docs/components/chip)
|
|
21
|
+
*/
|
|
22
|
+
declare const Label: ({ children, className, color, endContent, size, startContent, }: LabelProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { type LabelProps, Label as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ChipProps } from '@nextui-org/chip';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
interface LabelProps {
|
|
6
|
+
/** content of the label */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** CSS class name */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** color of the label */
|
|
11
|
+
color?: ChipProps['color'];
|
|
12
|
+
/** element to be rendered in the right side of the label */
|
|
13
|
+
endContent?: ChipProps['endContent'];
|
|
14
|
+
/** size of the label */
|
|
15
|
+
size?: ChipProps['size'];
|
|
16
|
+
/** element to be rendered in the left side of the label */
|
|
17
|
+
startContent?: ChipProps['startContent'];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Label component based on [NextUI Chip](https://nextui.org/docs/components/chip)
|
|
21
|
+
*/
|
|
22
|
+
declare const Label: ({ children, className, color, endContent, size, startContent, }: LabelProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { type LabelProps, Label as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/Label/index.ts
|
|
31
|
+
var Label_exports = {};
|
|
32
|
+
__export(Label_exports, {
|
|
33
|
+
default: () => Label_default2
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Label_exports);
|
|
36
|
+
|
|
37
|
+
// src/Label/Label.tsx
|
|
38
|
+
var import_chip = require("@nextui-org/chip");
|
|
39
|
+
var import_classnames = __toESM(require("classnames"), 1);
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var Label = ({
|
|
42
|
+
children,
|
|
43
|
+
className = void 0,
|
|
44
|
+
color = "default",
|
|
45
|
+
endContent = void 0,
|
|
46
|
+
size = "md",
|
|
47
|
+
startContent = void 0
|
|
48
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
import_chip.Chip,
|
|
50
|
+
{
|
|
51
|
+
className: (0, import_classnames.default)(className),
|
|
52
|
+
color,
|
|
53
|
+
endContent,
|
|
54
|
+
size,
|
|
55
|
+
startContent,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
var Label_default = Label;
|
|
60
|
+
|
|
61
|
+
// src/Label/index.ts
|
|
62
|
+
var Label_default2 = Label_default;
|
|
63
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Label/index.ts","../../src/Label/Label.tsx"],"sourcesContent":["import Label from './Label';\n\nexport default Label;\n","import type { ChipProps } from '@nextui-org/chip';\nimport type { ReactNode } from 'react';\n\nimport { Chip as NextLabel } from '@nextui-org/chip';\nimport cn from 'classnames';\n\nexport interface LabelProps {\n /** content of the label */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the label */\n color?: ChipProps['color'];\n /** element to be rendered in the right side of the label */\n endContent?: ChipProps['endContent'];\n /** size of the label */\n size?: ChipProps['size'];\n /** element to be rendered in the left side of the label */\n startContent?: ChipProps['startContent'];\n}\n\n/**\n * Label component based on [NextUI Chip](https://nextui.org/docs/components/chip)\n */\nconst Label = ({\n children,\n className = undefined,\n color = 'default',\n endContent = undefined,\n size = 'md',\n startContent = undefined,\n}: LabelProps) => (\n <NextLabel\n className={cn(className)}\n color={color}\n endContent={endContent}\n size={size}\n startContent={startContent}\n >\n {children}\n </NextLabel>\n);\n\nexport default Label;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACGA,kBAAkC;AAClC,wBAAe;AA4Bb;AARF,IAAM,QAAQ,CAAC;AAAA,EACb;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AACjB,MACE;AAAA,EAAC,YAAAC;AAAA,EAAA;AAAA,IACC,eAAW,kBAAAC,SAAG,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEC;AAAA;AACH;AAGF,IAAO,gBAAQ;;;ADzCf,IAAOC,iBAAQ;","names":["Label_default","NextLabel","cn","Label_default"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Label/index.ts"],"sourcesContent":["import Label from './Label';\n\nexport default Label;\n"],"mappings":";;;;;AAEA,IAAOA,iBAAQ;","names":["Label_default"]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/Menu/Menu.tsx
|
|
31
|
+
var Menu_exports = {};
|
|
32
|
+
__export(Menu_exports, {
|
|
33
|
+
default: () => Menu_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Menu_exports);
|
|
36
|
+
var import_fa6 = require("react-icons/fa6");
|
|
37
|
+
var import_dropdown = require("@nextui-org/dropdown");
|
|
38
|
+
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
39
|
+
var import_debug = __toESM(require("debug"), 1);
|
|
40
|
+
|
|
41
|
+
// src/Button/Button.tsx
|
|
42
|
+
var import_button = require("@nextui-org/button");
|
|
43
|
+
var import_classnames = __toESM(require("classnames"), 1);
|
|
44
|
+
|
|
45
|
+
// src/Button/subcomponents/LoadingSpinner.tsx
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
+
var LoadingSpinner_default = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
48
|
+
"svg",
|
|
49
|
+
{
|
|
50
|
+
className: "animate-spin h-5 w-5 text-current",
|
|
51
|
+
fill: "none",
|
|
52
|
+
viewBox: "0 0 24 24",
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
"circle",
|
|
57
|
+
{
|
|
58
|
+
className: "opacity-25",
|
|
59
|
+
cx: "12",
|
|
60
|
+
cy: "12",
|
|
61
|
+
r: "10",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
strokeWidth: "4"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
"path",
|
|
68
|
+
{
|
|
69
|
+
className: "opacity-75",
|
|
70
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",
|
|
71
|
+
fill: "currentColor"
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// src/Button/Button.tsx
|
|
79
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
80
|
+
var Button = ({
|
|
81
|
+
ariaLabel = void 0,
|
|
82
|
+
children = void 0,
|
|
83
|
+
className = void 0,
|
|
84
|
+
color = "default",
|
|
85
|
+
disabled = false,
|
|
86
|
+
icon = void 0,
|
|
87
|
+
loading = false,
|
|
88
|
+
onClick = void 0,
|
|
89
|
+
size = void 0,
|
|
90
|
+
testId = void 0,
|
|
91
|
+
type = void 0,
|
|
92
|
+
variant = "solid",
|
|
93
|
+
...passthrouhProps
|
|
94
|
+
}) => {
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
96
|
+
import_button.Button,
|
|
97
|
+
{
|
|
98
|
+
"aria-label": ariaLabel,
|
|
99
|
+
className: (0, import_classnames.default)(className),
|
|
100
|
+
color,
|
|
101
|
+
"data-testid": testId,
|
|
102
|
+
isDisabled: disabled,
|
|
103
|
+
isIconOnly: !!(icon && !children),
|
|
104
|
+
isLoading: loading,
|
|
105
|
+
onPress: onClick,
|
|
106
|
+
size,
|
|
107
|
+
spinner: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingSpinner_default, {}),
|
|
108
|
+
type,
|
|
109
|
+
variant,
|
|
110
|
+
...passthrouhProps,
|
|
111
|
+
children: [
|
|
112
|
+
icon,
|
|
113
|
+
children
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
var Button_default = Button;
|
|
119
|
+
|
|
120
|
+
// src/Button/index.ts
|
|
121
|
+
var Button_default2 = Button_default;
|
|
122
|
+
|
|
123
|
+
// src/Menu/Menu.tsx
|
|
124
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
125
|
+
var debug = (0, import_debug.default)("component:Menu");
|
|
126
|
+
var getDisabledKeys = (items) => {
|
|
127
|
+
return items.map((item) => typeof item?.items === "undefined" ? item : item.items).flat().filter((item) => {
|
|
128
|
+
return Object.hasOwn(item, "disabled") && item.disabled === true;
|
|
129
|
+
}).map((item) => item.key);
|
|
130
|
+
};
|
|
131
|
+
var renderMenuItem = (item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
132
|
+
import_dropdown.DropdownItem,
|
|
133
|
+
{
|
|
134
|
+
className: item.className,
|
|
135
|
+
"data-testid": item.testId || item.key,
|
|
136
|
+
description: item.description,
|
|
137
|
+
onClick: item.onClick,
|
|
138
|
+
startContent: item.icon,
|
|
139
|
+
children: item.label
|
|
140
|
+
},
|
|
141
|
+
item.key
|
|
142
|
+
);
|
|
143
|
+
var Menu = ({
|
|
144
|
+
children = null,
|
|
145
|
+
className = void 0,
|
|
146
|
+
onAction = void 0,
|
|
147
|
+
testId = void 0,
|
|
148
|
+
isDisabled = false,
|
|
149
|
+
items
|
|
150
|
+
}) => {
|
|
151
|
+
debug("Menu", { items });
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_dropdown.Dropdown, { isDisabled, children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dropdown.DropdownTrigger, { className: (0, import_classnames2.default)(className), "data-testid": testId, children: children ? (
|
|
154
|
+
// eslint-disable-next-line react/button-has-type
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { children })
|
|
156
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button_default2, { size: "sm", variant: "bordered", className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_fa6.FaEllipsisVertical, {}) }) }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
158
|
+
import_dropdown.DropdownMenu,
|
|
159
|
+
{
|
|
160
|
+
items,
|
|
161
|
+
disabledKeys: getDisabledKeys(items),
|
|
162
|
+
onAction,
|
|
163
|
+
children: (item) => {
|
|
164
|
+
if ("items" in item) {
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
166
|
+
import_dropdown.DropdownSection,
|
|
167
|
+
{
|
|
168
|
+
items: item.items,
|
|
169
|
+
title: item.label,
|
|
170
|
+
children: (sectionItem) => {
|
|
171
|
+
return renderMenuItem(sectionItem);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
item.key
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
return renderMenuItem(item);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] });
|
|
182
|
+
};
|
|
183
|
+
var Menu_default = Menu;
|
|
184
|
+
//# sourceMappingURL=Menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Menu/Menu.tsx","../../src/Button/Button.tsx","../../src/Button/subcomponents/LoadingSpinner.tsx","../../src/Button/index.ts"],"sourcesContent":["import type { DropdownSectionProps } from '@nextui-org/dropdown';\nimport type { Key, MouseEventHandler, ReactNode } from 'react';\n\nimport { FaEllipsisVertical } from 'react-icons/fa6';\n\nimport {\n Dropdown as NextDropdown,\n DropdownItem as NextDropdownItem,\n DropdownMenu as NextDropdownMenu,\n DropdownSection as NextDropdownSection,\n DropdownTrigger as NextDropdownTrigger,\n} from '@nextui-org/dropdown';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nimport Button from '../Button';\n\nconst debug = createDebug('component:Menu');\n\n/**\n * Menu item type\n */\nexport interface MenuItem {\n /** unique identifier */\n key: string;\n /** CSS class name */\n className?: string;\n /** additional description shown under the label */\n description?: string;\n /** disables the menu item */\n disabled?: boolean;\n /** menu item icon */\n icon?: ReactNode;\n /** menu item name */\n label: ReactNode;\n /** click event handler */\n onClick?: MouseEventHandler<HTMLLIElement>;\n /** e2e test identifier */\n testId?: string;\n}\n\n/**\n * Menu section type\n */\nexport interface MenuSection {\n /** unique identifier */\n key: string;\n /** section label */\n label: ReactNode;\n /** section items (array of MenuItem) */\n items: MenuItem[];\n}\n\nexport interface MenuProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** menu item structure */\n items: (MenuSection | MenuItem)[];\n /** disable menu trigger */\n isDisabled?: boolean;\n /** called if item is selected */\n onAction?: (key: Key) => void;\n}\n\n/** returns String[] of disabled items/keys */\nconst getDisabledKeys = (items: (MenuSection | MenuItem)[]) => {\n return (\n items\n // @ts-expect-error typing issue with MenuSection | MenuItem\n .map((item) => (typeof item?.items === 'undefined' ? item : item.items))\n .flat<MenuItem[]>()\n .filter((item) => {\n return Object.hasOwn(item, 'disabled') && item.disabled === true;\n })\n .map((item) => item.key)\n );\n};\n\nconst renderMenuItem = (item: MenuItem) => (\n <NextDropdownItem\n className={item.className}\n data-testid={item.testId || item.key}\n description={item.description}\n key={item.key}\n onClick={item.onClick}\n startContent={item.icon}\n >\n {item.label}\n </NextDropdownItem>\n);\n\n/**\n * Dropdown menu component based on [NextUI Dropdown](https://nextui.org/docs/components/dropdown)\n */\nconst Menu = ({\n children = null,\n className = undefined,\n onAction = undefined,\n testId = undefined,\n isDisabled = false,\n items,\n}: MenuProps) => {\n debug('Menu', { items });\n\n return (\n <NextDropdown isDisabled={isDisabled}>\n <NextDropdownTrigger className={cn(className)} data-testid={testId}>\n {children ? (\n // eslint-disable-next-line react/button-has-type\n <button>{children}</button>\n ) : (\n <Button size=\"sm\" variant=\"bordered\" className=\"min-w-0\">\n <FaEllipsisVertical />\n </Button>\n )}\n </NextDropdownTrigger>\n <NextDropdownMenu\n // aria-label=\"Dynamic Actions\"\n items={items}\n disabledKeys={getDisabledKeys(items)}\n onAction={onAction}\n >\n {(item) => {\n if ('items' in item) {\n return (\n <NextDropdownSection\n items={item.items as MenuSection['items']}\n title={item.label as DropdownSectionProps['title']}\n key={item.key}\n >\n {/* @ts-expect-error ts problem here with render fn */}\n {(sectionItem) => {\n return renderMenuItem(sectionItem);\n }}\n </NextDropdownSection>\n );\n }\n return renderMenuItem(item);\n }}\n </NextDropdownMenu>\n </NextDropdown>\n );\n};\n\nexport default Menu;\n","import type { ButtonProps as NextButtonProps } from '@nextui-org/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as NextButton } from '@nextui-org/button';\nimport cn from 'classnames';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport interface ButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** next ui button color */\n color?: NextButtonProps['color'];\n /** disables function of the button. */\n disabled?: boolean;\n /** If set loading animation is shown */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** on click event */\n onClick?: NextButtonProps['onPress'];\n /** 3 size options */\n size?: NextButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** sets the button type. */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** next ui button variants */\n variant?: NextButtonProps['variant'];\n}\n\n/**\n * Button component based on [NextUI Button](https://nextui.org/docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disabled = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n ...passthrouhProps\n}: ButtonProps) => {\n return (\n <NextButton\n aria-label={ariaLabel}\n className={cn(className)}\n color={color}\n data-testid={testId}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n {...passthrouhProps}\n >\n {icon}\n {children}\n </NextButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://nextui.org/docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"animate-spin h-5 w-5 text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n","import type { ButtonProps } from './Button';\n\nimport Button from './Button';\n\nexport default Button;\n\nexport type { ButtonProps };\n"],"mappings":"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","names":["import_classnames","import_jsx_runtime","NextButton","cn","Button_default","import_jsx_runtime","createDebug","NextDropdownItem","NextDropdown","NextDropdownTrigger","cn","Button_default","NextDropdownMenu","NextDropdownSection"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, MouseEventHandler, Key } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Menu item type
|
|
6
|
+
*/
|
|
7
|
+
interface MenuItem {
|
|
8
|
+
/** unique identifier */
|
|
9
|
+
key: string;
|
|
10
|
+
/** CSS class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** additional description shown under the label */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** disables the menu item */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** menu item icon */
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
/** menu item name */
|
|
19
|
+
label: ReactNode;
|
|
20
|
+
/** click event handler */
|
|
21
|
+
onClick?: MouseEventHandler<HTMLLIElement>;
|
|
22
|
+
/** e2e test identifier */
|
|
23
|
+
testId?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Menu section type
|
|
27
|
+
*/
|
|
28
|
+
interface MenuSection {
|
|
29
|
+
/** unique identifier */
|
|
30
|
+
key: string;
|
|
31
|
+
/** section label */
|
|
32
|
+
label: ReactNode;
|
|
33
|
+
/** section items (array of MenuItem) */
|
|
34
|
+
items: MenuItem[];
|
|
35
|
+
}
|
|
36
|
+
interface MenuProps {
|
|
37
|
+
/** child components */
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
/** CSS class name */
|
|
40
|
+
className?: string | string[];
|
|
41
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
42
|
+
testId?: string;
|
|
43
|
+
/** menu item structure */
|
|
44
|
+
items: (MenuSection | MenuItem)[];
|
|
45
|
+
/** disable menu trigger */
|
|
46
|
+
isDisabled?: boolean;
|
|
47
|
+
/** called if item is selected */
|
|
48
|
+
onAction?: (key: Key) => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Dropdown menu component based on [NextUI Dropdown](https://nextui.org/docs/components/dropdown)
|
|
52
|
+
*/
|
|
53
|
+
declare const Menu: ({ children, className, onAction, testId, isDisabled, items, }: MenuProps) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
export { type MenuItem, type MenuProps, type MenuSection, Menu as default };
|