pentatrion-design 0.3.0 → 1.0.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/.github/workflows/deploy-storybook.yml +2 -4
- package/.vscode/launch.json +7 -0
- package/README.md +1 -1
- package/dist/components/accordion/Accordion.d.ts +10 -0
- package/dist/components/accordion/Accordion.d.ts.map +1 -0
- package/dist/components/accordion/Accordion.js +21 -0
- package/dist/components/accordion/AccordionContent.d.ts +7 -0
- package/dist/components/accordion/AccordionContent.d.ts.map +1 -0
- package/dist/components/accordion/AccordionContent.js +20 -0
- package/dist/components/accordion/AccordionItem.d.ts +7 -0
- package/dist/components/accordion/AccordionItem.d.ts.map +1 -0
- package/dist/components/accordion/AccordionItem.js +7 -0
- package/dist/components/accordion/AccordionTrigger.d.ts +7 -0
- package/dist/components/accordion/AccordionTrigger.d.ts.map +1 -0
- package/dist/components/accordion/AccordionTrigger.js +7 -0
- package/dist/components/accordion/index.d.ts +4 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +3 -0
- package/dist/components/accordion/useAccordion.d.ts +9 -0
- package/dist/components/accordion/useAccordion.d.ts.map +1 -0
- package/dist/components/accordion/useAccordion.js +9 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +3 -3
- package/dist/components/autocomplete/Autocomplete.js +8 -8
- package/dist/components/autocomplete/AutocompleteOption.d.ts +1 -1
- package/dist/components/autocomplete/AutocompleteOption.js +2 -2
- package/dist/components/autocomplete/LazyAutocomplete.d.ts +2 -2
- package/dist/components/autocomplete/LazyAutocomplete.js +3 -3
- package/dist/components/autocomplete/SimpleAutocomplete.d.ts +2 -2
- package/dist/components/autocomplete/SimpleAutocomplete.js +3 -3
- package/dist/components/autocomplete/index.d.ts +6 -6
- package/dist/components/autocomplete/index.js +6 -6
- package/dist/components/autocomplete/useAutocompleteContext.d.ts +1 -1
- package/dist/components/autocomplete/util.d.ts +1 -1
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.js +4 -4
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/Button.d.ts +4 -4
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +18 -8
- package/dist/components/button/HrefButton.d.ts +7 -0
- package/dist/components/button/HrefButton.d.ts.map +1 -0
- package/dist/components/button/HrefButton.js +11 -0
- package/dist/components/button/LinkButton.d.ts +3 -3
- package/dist/components/button/LinkButton.js +3 -3
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button/index.js +3 -3
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/code/index.d.ts +1 -1
- package/dist/components/code/index.js +1 -1
- package/dist/components/context-menu/ContextMenu.js +2 -2
- package/dist/components/context-menu/index.d.ts +2 -2
- package/dist/components/context-menu/index.js +2 -2
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/draggable/index.d.ts +6 -6
- package/dist/components/draggable/index.js +6 -6
- package/dist/components/draggable/useDraggableItem.d.ts +1 -1
- package/dist/components/draggable/useDraggableItem.js +1 -1
- package/dist/components/draggable/useDraggableMonitor.js +2 -2
- package/dist/components/draggable/useDraggableMonitorIndex.js +2 -2
- package/dist/components/draggable/util.d.ts +1 -1
- package/dist/components/draggable/util.js +1 -1
- package/dist/components/draggable-advanced/_fixtures.d.ts +1 -1
- package/dist/components/draggable-advanced/context.d.ts +1 -1
- package/dist/components/draggable-advanced/context.js +1 -1
- package/dist/components/draggable-advanced/registry.js +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +3 -2
- package/dist/components/dropdown-menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.js +6 -6
- package/dist/components/dropdown-menu/DropdownMenuItem.js +2 -2
- package/dist/components/dropdown-menu/index.d.ts +5 -5
- package/dist/components/dropdown-menu/index.js +4 -4
- package/dist/components/dropdown-menu/interface.d.ts +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts.map +1 -1
- package/dist/components/dropdown-menu-nested/DropdownMenuNested.d.ts +1 -1
- package/dist/components/dropdown-menu-nested/DropdownMenuNested.js +1 -1
- package/dist/components/dropdown-menu-nested/MenuItem.js +1 -1
- package/dist/components/dropdown-menu-nested/MenuItemWithChildren.d.ts +1 -1
- package/dist/components/dropdown-menu-nested/MenuItemWithChildren.js +3 -3
- package/dist/components/dropdown-menu-nested/index.d.ts +3 -3
- package/dist/components/dropdown-menu-nested/index.js +3 -3
- package/dist/components/flash/Flash.d.ts +1 -1
- package/dist/components/flash/Flash.js +1 -1
- package/dist/components/flash/index.d.ts +1 -1
- package/dist/components/flash/index.js +1 -1
- package/dist/components/form/InputField.d.ts.map +1 -1
- package/dist/components/form/InputField.js +3 -2
- package/dist/components/form/SelectField.d.ts +1 -1
- package/dist/components/form/SelectField.js +1 -1
- package/dist/components/form/index.d.ts +2 -2
- package/dist/components/form/index.js +2 -2
- package/dist/components/highlight/index.d.ts +1 -1
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/href/index.d.ts +2 -2
- package/dist/components/href/index.d.ts.map +1 -1
- package/dist/components/href/index.js +2 -2
- package/dist/components/input/AudioRange.d.ts +16 -0
- package/dist/components/input/AudioRange.d.ts.map +1 -0
- package/dist/components/input/AudioRange.js +38 -0
- package/dist/components/input/Checkbox.d.ts +3 -2
- package/dist/components/input/Checkbox.d.ts.map +1 -1
- package/dist/components/input/Checkbox.js +1 -1
- package/dist/components/input/Color.d.ts +1 -1
- package/dist/components/input/Color.d.ts.map +1 -1
- package/dist/components/input/Color.js +2 -2
- package/dist/components/input/Input.d.ts +1 -1
- package/dist/components/input/InputButton.d.ts +1 -1
- package/dist/components/input/InputButton.js +1 -1
- package/dist/components/input/MappedStars.js +2 -2
- package/dist/components/input/Radio.d.ts +4 -2
- package/dist/components/input/Radio.d.ts.map +1 -1
- package/dist/components/input/Radio.js +4 -1
- package/dist/components/input/Range.d.ts +3 -2
- package/dist/components/input/Range.d.ts.map +1 -1
- package/dist/components/input/Range.js +6 -3
- package/dist/components/input/Stars.js +2 -2
- package/dist/components/input/Toggle.d.ts +1 -1
- package/dist/components/input/TotpInput.d.ts +12 -0
- package/dist/components/input/TotpInput.d.ts.map +1 -0
- package/dist/components/input/TotpInput.js +113 -0
- package/dist/components/input/index.d.ts +11 -9
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/input/index.js +11 -9
- package/dist/components/loader/Loader.d.ts +1 -1
- package/dist/components/loader/Loader.js +1 -1
- package/dist/components/loader/index.d.ts +1 -1
- package/dist/components/loader/index.js +1 -1
- package/dist/components/media-preview/FileIcon.d.ts +2 -2
- package/dist/components/media-preview/FileIcon.d.ts.map +1 -1
- package/dist/components/media-preview/FileIcon.js +2 -2
- package/dist/components/media-preview/MediaPreview.d.ts +10 -6
- package/dist/components/media-preview/MediaPreview.d.ts.map +1 -1
- package/dist/components/media-preview/MediaPreview.js +4 -4
- package/dist/components/media-preview/index.d.ts +5 -5
- package/dist/components/media-preview/index.d.ts.map +1 -1
- package/dist/components/media-preview/index.js +4 -4
- package/dist/components/media-preview/types.d.ts +2 -2
- package/dist/components/media-preview/types.d.ts.map +1 -1
- package/dist/components/media-preview/util.d.ts +2 -2
- package/dist/components/media-preview/util.d.ts.map +1 -1
- package/dist/components/modal/Components.js +3 -3
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/Modal.js +2 -2
- package/dist/components/modal/ModalContent.d.ts +2 -1
- package/dist/components/modal/ModalContent.d.ts.map +1 -1
- package/dist/components/modal/ModalContent.js +4 -4
- package/dist/components/modal/ModalTrigger.d.ts +1 -1
- package/dist/components/modal/ModalTrigger.js +2 -2
- package/dist/components/modal/index.d.ts +7 -7
- package/dist/components/modal/index.js +6 -6
- package/dist/components/modal/interface.d.ts +1 -1
- package/dist/components/modal/useModal.d.ts +2 -2
- package/dist/components/modal/useModal.d.ts.map +1 -1
- package/dist/components/modal/useModalContext.d.ts +2 -2
- package/dist/components/modal/useModalContext.d.ts.map +1 -1
- package/dist/components/notification/NotificationsContext.d.ts +1 -1
- package/dist/components/notification/NotificationsContext.js +1 -1
- package/dist/components/notification/NotificationsProvider.js +2 -2
- package/dist/components/notification/index.d.ts +4 -4
- package/dist/components/notification/index.js +4 -4
- package/dist/components/notification/useContextNotifications.d.ts +1 -1
- package/dist/components/notification/useContextNotifications.js +1 -1
- package/dist/components/notification/useFetch.d.ts +1 -1
- package/dist/components/notification/useFetch.js +2 -2
- package/dist/components/popover/Components.js +2 -2
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/popover/PopoverContent.js +3 -3
- package/dist/components/popover/PopoverTrigger.js +3 -3
- package/dist/components/popover/index.d.ts +7 -7
- package/dist/components/popover/index.js +6 -6
- package/dist/components/popover/interface.d.ts +1 -1
- package/dist/components/popover/usePopover.d.ts +2 -2
- package/dist/components/popover/usePopover.d.ts.map +1 -1
- package/dist/components/popover/usePopoverContext.d.ts +2 -2
- package/dist/components/popover/usePopoverContext.d.ts.map +1 -1
- package/dist/components/portal/index.d.ts +1 -1
- package/dist/components/portal/index.js +1 -1
- package/dist/components/resizable/Resizable.d.ts +7 -0
- package/dist/components/resizable/Resizable.d.ts.map +1 -0
- package/dist/components/resizable/Resizable.js +32 -0
- package/dist/components/resizable/ResizableHandle.d.ts +7 -0
- package/dist/components/resizable/ResizableHandle.d.ts.map +1 -0
- package/dist/components/resizable/ResizableHandle.js +35 -0
- package/dist/components/resizable/ResizablePanel.d.ts +7 -0
- package/dist/components/resizable/ResizablePanel.d.ts.map +1 -0
- package/dist/components/resizable/ResizablePanel.js +10 -0
- package/dist/components/resizable/context.d.ts +7 -0
- package/dist/components/resizable/context.d.ts.map +1 -0
- package/dist/components/resizable/context.js +2 -0
- package/dist/components/resizable/index.d.ts +4 -0
- package/dist/components/resizable/index.d.ts.map +1 -0
- package/dist/components/resizable/index.js +3 -0
- package/dist/components/resizable/util.d.ts +6 -0
- package/dist/components/resizable/util.d.ts.map +1 -0
- package/dist/components/resizable/util.js +26 -0
- package/dist/components/resize-area/index.d.ts +1 -1
- package/dist/components/resize-area/index.js +1 -1
- package/dist/components/scroll/index.d.ts +1 -1
- package/dist/components/scroll/index.js +1 -1
- package/dist/components/select/Select.d.ts +3 -3
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +8 -8
- package/dist/components/select/SelectOption.d.ts +1 -1
- package/dist/components/select/SelectOption.js +1 -1
- package/dist/components/select/SelectSelection.d.ts +1 -1
- package/dist/components/select/SelectSelection.js +1 -1
- package/dist/components/select/index.d.ts +5 -5
- package/dist/components/select/index.js +4 -4
- package/dist/components/slot/Slot.d.ts +9 -4
- package/dist/components/slot/Slot.d.ts.map +1 -1
- package/dist/components/slot/Slot.js +70 -50
- package/dist/components/slot/index.d.ts +1 -1
- package/dist/components/slot/index.js +1 -1
- package/dist/components/snack/Snack.d.ts +1 -1
- package/dist/components/snack/Snack.js +4 -4
- package/dist/components/snack/index.d.ts +1 -1
- package/dist/components/snack/index.js +1 -1
- package/dist/components/steps/index.d.ts +2 -2
- package/dist/components/steps/index.js +2 -2
- package/dist/components/table/index.d.ts +7 -7
- package/dist/components/table/index.js +7 -7
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/textarea/Textarea.d.ts +1 -1
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/toast/Toasts.js +2 -2
- package/dist/components/toast/index.d.ts +3 -3
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toastsManager.d.ts +1 -1
- package/dist/components/toast/toastsManager.js +1 -1
- package/dist/components/tooltip/SimpleTooltip.d.ts +1 -1
- package/dist/components/tooltip/SimpleTooltip.js +3 -3
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +2 -2
- package/dist/components/tooltip/TooltipContent.js +4 -4
- package/dist/components/tooltip/TooltipTrigger.js +2 -2
- package/dist/components/tooltip/index.d.ts +6 -6
- package/dist/components/tooltip/index.js +6 -6
- package/dist/components/tooltip/interface.d.ts +1 -1
- package/dist/components/tooltip/useTooltip.d.ts +2 -2
- package/dist/components/tooltip/useTooltip.d.ts.map +1 -1
- package/dist/components/tooltip/useTooltipContext.d.ts +2 -2
- package/dist/components/tooltip/useTooltipContext.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +12 -11
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +12 -11
- package/dist/hooks/useDoubleCheck.d.ts +6 -0
- package/dist/hooks/useDoubleCheck.d.ts.map +1 -0
- package/dist/hooks/useDoubleCheck.js +32 -0
- package/dist/hooks/useEventListener.js +1 -1
- package/dist/hooks/useOnClickOutside.js +1 -1
- package/dist/hooks/useRipple.js +1 -1
- package/dist/lib/compose-refs.d.ts +4 -3
- package/dist/lib/compose-refs.d.ts.map +1 -1
- package/dist/lib/compose-refs.js +33 -4
- package/dist/lib/error.d.ts +1 -1
- package/dist/lib/index.d.ts +6 -6
- package/dist/lib/index.js +6 -6
- package/dist/lib/tailwindVariants.d.ts +1 -1
- package/package.json +25 -18
- package/src/components/accordion/Accordion.stories.tsx +50 -0
- package/src/components/accordion/Accordion.tsx +41 -0
- package/src/components/accordion/AccordionContent.tsx +46 -0
- package/src/components/accordion/AccordionTrigger.tsx +24 -0
- package/src/components/accordion/index.ts +3 -0
- package/src/components/accordion/useAccordion.tsx +16 -0
- package/src/components/autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/components/button/Button.stories.tsx +57 -33
- package/src/components/button/Button.tsx +17 -7
- package/src/components/button/{LinkButton.stories.tsx → HrefButton.stories.tsx} +4 -4
- package/src/components/button/{LinkButton.tsx → HrefButton.tsx} +3 -3
- package/src/components/button/index.ts +1 -1
- package/src/components/dropdown-menu/DropdownMenu.tsx +4 -2
- package/src/components/form/InputField.tsx +3 -1
- package/src/components/href/index.ts +2 -2
- package/src/components/input/AudioRange.test.tsx +15 -0
- package/src/components/input/AudioRange.tsx +131 -0
- package/src/components/input/Checkbox.tsx +2 -2
- package/src/components/input/Color.tsx +9 -2
- package/src/components/input/Radio.stories.tsx +3 -0
- package/src/components/input/Radio.tsx +6 -2
- package/src/components/input/Range.stories.tsx +17 -1
- package/src/components/input/Range.tsx +15 -3
- package/src/components/input/TotpInput.stories.tsx +1 -1
- package/src/components/input/TotpInput.tsx +6 -3
- package/src/components/input/index.ts +2 -0
- package/src/components/media-preview/FileIcon.tsx +3 -3
- package/src/components/media-preview/MediaPreview.tsx +18 -7
- package/src/components/media-preview/index.ts +1 -1
- package/src/components/media-preview/types.ts +2 -2
- package/src/components/media-preview/util.ts +2 -2
- package/src/components/modal/ModalContent.tsx +6 -2
- package/src/components/notification/Notification.stories.tsx +1 -1
- package/src/components/popover/PopoverTrigger.tsx +1 -1
- package/src/components/resizable/Resizable.stories.tsx +36 -0
- package/src/components/resizable/Resizable.tsx +48 -0
- package/src/components/resizable/ResizableHandle.tsx +71 -0
- package/src/components/resizable/ResizablePanel.tsx +18 -0
- package/src/components/resizable/context.ts +7 -0
- package/src/components/resizable/index.ts +3 -0
- package/src/components/resizable/util.ts +31 -0
- package/src/components/select/Select.tsx +9 -1
- package/src/components/slot/Slot.tsx +88 -57
- package/src/components/toast/Toast.stories.tsx +1 -1
- package/src/components/tooltip/Tooltip.stories.tsx +42 -5
- package/src/components/tooltip/TooltipContent.tsx +1 -1
- package/src/components/tooltip/TooltipTrigger.tsx +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDoubleCheck.ts +41 -0
- package/src/lib/compose-refs.ts +35 -9
- package/src/tailwind/base.css +29 -3
- package/src/tailwind/components-input-outline.css +20 -4
- package/src/tailwind/components-range.css +39 -8
- package/src/tailwind/theme.css +18 -21
- package/tsconfig.build.json +0 -3
- package/tsconfig.json +12 -14
|
@@ -20,12 +20,10 @@ jobs:
|
|
|
20
20
|
- uses: actions/checkout@v4
|
|
21
21
|
|
|
22
22
|
- uses: pnpm/action-setup@v4
|
|
23
|
-
|
|
24
|
-
version: 9
|
|
25
|
-
|
|
23
|
+
# pnpm version is specified in the package.json packageManager section
|
|
26
24
|
- uses: actions/setup-node@v4
|
|
27
25
|
with:
|
|
28
|
-
node-version:
|
|
26
|
+
node-version: 22
|
|
29
27
|
cache: pnpm
|
|
30
28
|
|
|
31
29
|
- name: Setup Pages
|
package/.vscode/launch.json
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
"name": "pnpm run storybook",
|
|
10
10
|
"request": "launch",
|
|
11
11
|
"type": "node-terminal"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Vitest unit current file",
|
|
15
|
+
"request": "launch",
|
|
16
|
+
"type": "node",
|
|
17
|
+
"runtimeExecutable": "vitest",
|
|
18
|
+
"runtimeArgs": ["-c", "vitest.config.ts", "${relativeFile}"]
|
|
12
19
|
}
|
|
13
20
|
]
|
|
14
21
|
}
|
package/README.md
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
value?: string | null;
|
|
4
|
+
defaultValue?: string | null;
|
|
5
|
+
onChange?: (value: string | null) => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function Accordion({ value: controlledValue, defaultValue, onChange, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAIrD,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID,wBAAgB,SAAS,CAAC,EACxB,KAAK,EAAE,eAAe,EACtB,YAAY,EACZ,QAAe,EACf,QAAQ,GACT,EAAE,KAAK,2CAsBP"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { AccordionContext } from "./useAccordion";
|
|
4
|
+
import { useEffectEvent } from "../../hooks";
|
|
5
|
+
const noop = () => { };
|
|
6
|
+
export function Accordion({ value: controlledValue, defaultValue, onChange = noop, children, }) {
|
|
7
|
+
const isControlled = typeof controlledValue !== "undefined";
|
|
8
|
+
const [unControlledValue, setUnControlledValue] = useState(defaultValue ?? null);
|
|
9
|
+
const value = (isControlled ? controlledValue : unControlledValue) ?? null;
|
|
10
|
+
const stableOnChange = useEffectEvent(onChange);
|
|
11
|
+
const context = useMemo(() => ({
|
|
12
|
+
value,
|
|
13
|
+
onChange(value) {
|
|
14
|
+
if (!isControlled) {
|
|
15
|
+
setUnControlledValue(value);
|
|
16
|
+
}
|
|
17
|
+
stableOnChange(value);
|
|
18
|
+
},
|
|
19
|
+
}), [value, stableOnChange, isControlled]);
|
|
20
|
+
return _jsx(AccordionContext.Provider, { value: context, children: children });
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
interface Props extends ComponentProps<"div"> {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function AccordionContent({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AccordionContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContent.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAI1D,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAqClE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useAccordion } from "./useAccordion";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
export function AccordionContent({ name, children, ...rest }) {
|
|
6
|
+
const { value } = useAccordion();
|
|
7
|
+
const wrapperRef = useRef(null);
|
|
8
|
+
const contentRef = useRef(null);
|
|
9
|
+
const isOpen = value === name;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const updateHeight = () => {
|
|
12
|
+
wrapperRef.current.style.setProperty("--accordion-content-height", `${contentRef.current.scrollHeight}px`);
|
|
13
|
+
};
|
|
14
|
+
updateHeight();
|
|
15
|
+
const observer = new ResizeObserver(updateHeight);
|
|
16
|
+
observer.observe(contentRef.current);
|
|
17
|
+
return () => observer.disconnect();
|
|
18
|
+
}, []);
|
|
19
|
+
return (_jsx("div", { ref: wrapperRef, className: clsx("overflow-hidden transition-[height] ease-in-out", isOpen ? "h-(--accordion-content-height)" : "h-0"), ...rest, children: _jsx("div", { className: "p-2", ref: contentRef, children: children }) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
interface Props extends ComponentProps<"div"> {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function AccordionItem({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAQ/D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAccordion } from "./useAccordion";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
export function AccordionItem({ name, children, ...rest }) {
|
|
5
|
+
const { value } = useAccordion();
|
|
6
|
+
return (_jsx("div", { ...rest, className: clsx(value !== name && "hidden"), children: children }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
interface Props extends ComponentProps<"button"> {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function AccordionTrigger({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AccordionTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,KAAM,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAelE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAccordion } from "./useAccordion";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
export function AccordionTrigger({ name, children, ...rest }) {
|
|
5
|
+
const { value, onChange } = useAccordion();
|
|
6
|
+
return (_jsxs("button", { type: "button", onClick: () => onChange(name === value ? null : name), ...rest, className: "border-l-yellow-4 bg-gray-0 hover:border-l-yellow-4 relative mt-[-1px] flex h-12 w-full cursor-pointer border border-l-4 border-black/5 hover:z-[1] hover:border-black/15", children: [_jsx("div", { className: "flex-center h-12 w-12", children: _jsx("i", { className: clsx("fe-angle-up transition-transform", name !== value && "rotate-180") }) }), _jsx("div", { className: "flex flex-1 items-center", children: children })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const AccordionContext: import("react").Context<{
|
|
2
|
+
value: string | null;
|
|
3
|
+
onChange: (value: string | null) => void;
|
|
4
|
+
} | null>;
|
|
5
|
+
export declare const useAccordion: () => {
|
|
6
|
+
value: string | null;
|
|
7
|
+
onChange: (value: string | null) => void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useAccordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/useAccordion.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;WACpB,MAAM,GAAG,IAAI;cACV,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;SAC3B,CAAC;AAEhB,eAAO,MAAM,YAAY;WAJhB,MAAM,GAAG,IAAI;cACV,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;CAWzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
export const AccordionContext = createContext(null);
|
|
3
|
+
export const useAccordion = () => {
|
|
4
|
+
const context = useContext(AccordionContext);
|
|
5
|
+
if (context === null) {
|
|
6
|
+
throw new Error("useAccordion to be use inside Accordion component");
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode, ComponentProps, RefObject } from "react";
|
|
2
|
-
import type { OptionLike, Option } from "../select
|
|
3
|
-
import { AutocompleteOptionProps } from "./AutocompleteOption
|
|
2
|
+
import type { OptionLike, Option } from "../select";
|
|
3
|
+
import { AutocompleteOptionProps } from "./AutocompleteOption";
|
|
4
4
|
import { Placement } from "@floating-ui/react";
|
|
5
|
-
import { ThemeColor } from "../../types
|
|
5
|
+
import { ThemeColor } from "../../types";
|
|
6
6
|
export interface AutocompleteProps<O extends OptionLike = Option> extends ComponentProps<"input"> {
|
|
7
7
|
icon?: boolean | ReactNode;
|
|
8
8
|
color?: ThemeColor;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo, useRef, useState, } from "react";
|
|
4
|
-
import { AutocompleteOption } from "./AutocompleteOption
|
|
4
|
+
import { AutocompleteOption } from "./AutocompleteOption";
|
|
5
5
|
import { FloatingFocusManager, FloatingList, FloatingPortal, autoUpdate, flip, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, } from "@floating-ui/react";
|
|
6
|
-
import { AutocompleteContext } from "./useAutocompleteContext
|
|
6
|
+
import { AutocompleteContext } from "./useAutocompleteContext";
|
|
7
7
|
import clsx from "clsx";
|
|
8
|
-
import { useEffectEvent } from "../../hooks
|
|
9
|
-
import { getOptionLabel, getOptionValue } from "./util
|
|
10
|
-
import { Button } from "../button
|
|
11
|
-
import { Dialog } from "../dialog
|
|
12
|
-
import { Loader } from "../loader
|
|
13
|
-
import { inputConfig, sizeVariant } from "../input/Input
|
|
8
|
+
import { useEffectEvent } from "../../hooks";
|
|
9
|
+
import { getOptionLabel, getOptionValue } from "./util";
|
|
10
|
+
import { Button } from "../button";
|
|
11
|
+
import { Dialog } from "../dialog";
|
|
12
|
+
import { Loader } from "../loader";
|
|
13
|
+
import { inputConfig, sizeVariant } from "../input/Input";
|
|
14
14
|
export function Autocomplete({ className, autoFocus = false, icon = true, color = "yellow", noSearchSuffix, suffix, placement = "bottom", placeholder = "Search...", selection = null, onChangeSelection, autocompleteOptionComponent, loading = false, clearSearchButton = false, searchValue, onChangeSearchValue, options, selectOnFocus = true, readOnly = false, ref, ...rest }) {
|
|
15
15
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
16
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionLike } from "../select
|
|
1
|
+
import { OptionLike } from "../select";
|
|
2
2
|
export type AutocompleteOptionProps<O extends OptionLike> = O;
|
|
3
3
|
export declare const AutocompleteOption: import("react").MemoExoticComponent<(<O extends OptionLike>(props: AutocompleteOptionProps<O>) => import("react/jsx-runtime").JSX.Element)>;
|
|
4
4
|
//# sourceMappingURL=AutocompleteOption.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useId } from "react";
|
|
3
3
|
import { useListItem } from "@floating-ui/react";
|
|
4
|
-
import { useAutocomplete } from "./useAutocompleteContext
|
|
4
|
+
import { useAutocomplete } from "./useAutocompleteContext";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import { getOptionLabel, getOptionValue } from "./util
|
|
6
|
+
import { getOptionLabel, getOptionValue } from "./util";
|
|
7
7
|
export const AutocompleteOption = memo(function AutocompleteOption(props) {
|
|
8
8
|
const label = getOptionLabel(props);
|
|
9
9
|
const id = useId();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AutocompleteProps } from "./Autocomplete
|
|
2
|
-
import { OptionLike, Option } from "../select
|
|
1
|
+
import { AutocompleteProps } from "./Autocomplete";
|
|
2
|
+
import { OptionLike, Option } from "../select";
|
|
3
3
|
interface Props<O extends OptionLike = Option> extends Omit<AutocompleteProps<O>, "searchValue" | "onChangeSearchValue" | "options" | "selectOnFocus"> {
|
|
4
4
|
onChangeSearchValueCallback: (searchValue: string) => Promise<O[]>;
|
|
5
5
|
debounce?: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Autocomplete } from "./Autocomplete
|
|
4
|
-
import { getOptionLabel } from "./util
|
|
5
|
-
import { useStateDebounce, useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks
|
|
3
|
+
import { Autocomplete } from "./Autocomplete";
|
|
4
|
+
import { getOptionLabel } from "./util";
|
|
5
|
+
import { useStateDebounce, useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks";
|
|
6
6
|
export function LazyAutocomplete({ onChangeSearchValueCallback, debounce = 5000, selection = null, onChangeSelection, ...rest }) {
|
|
7
7
|
const onChangeSelectionStable = useEffectEvent(onChangeSelection);
|
|
8
8
|
const onChangeSearchValueCallbackStable = useEffectEvent(onChangeSearchValueCallback);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AutocompleteProps } from "./Autocomplete
|
|
2
|
-
import { Option, OptionLike } from "../select
|
|
1
|
+
import { AutocompleteProps } from "./Autocomplete";
|
|
2
|
+
import { Option, OptionLike } from "../select";
|
|
3
3
|
interface Props<O extends OptionLike = Option> extends Omit<AutocompleteProps<O>, "searchValue" | "onChangeSearchValue" | "loading" | "clearSearchButton" | "selectOnFocus"> {
|
|
4
4
|
}
|
|
5
5
|
export declare function SimpleAutocomplete<O extends OptionLike = Option>({ options, selection, onChangeSelection, ...rest }: Props<O>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
|
-
import { Autocomplete } from "./Autocomplete
|
|
4
|
-
import { useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks
|
|
5
|
-
import { getOptionLabel } from "./util
|
|
3
|
+
import { Autocomplete } from "./Autocomplete";
|
|
4
|
+
import { useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks";
|
|
5
|
+
import { getOptionLabel } from "./util";
|
|
6
6
|
export function SimpleAutocomplete({ options, selection = null, onChangeSelection, ...rest }) {
|
|
7
7
|
const onChangeSelectionStable = useEffectEvent(onChangeSelection);
|
|
8
8
|
const [searchValue, setSearchValue] = useState(selection ? getOptionLabel(selection) : "");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Autocomplete, type AutocompleteProps } from "./Autocomplete
|
|
2
|
-
export { SimpleAutocomplete } from "./SimpleAutocomplete
|
|
3
|
-
export { AutocompleteOption } from "./AutocompleteOption
|
|
4
|
-
export { LazyAutocomplete } from "./LazyAutocomplete
|
|
5
|
-
export { useAutocomplete } from "./useAutocompleteContext
|
|
6
|
-
export { getOptionValue, getOptionLabel } from "./util
|
|
1
|
+
export { Autocomplete, type AutocompleteProps } from "./Autocomplete";
|
|
2
|
+
export { SimpleAutocomplete } from "./SimpleAutocomplete";
|
|
3
|
+
export { AutocompleteOption } from "./AutocompleteOption";
|
|
4
|
+
export { LazyAutocomplete } from "./LazyAutocomplete";
|
|
5
|
+
export { useAutocomplete } from "./useAutocompleteContext";
|
|
6
|
+
export { getOptionValue, getOptionLabel } from "./util";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Autocomplete } from "./Autocomplete
|
|
2
|
-
export { SimpleAutocomplete } from "./SimpleAutocomplete
|
|
3
|
-
export { AutocompleteOption } from "./AutocompleteOption
|
|
4
|
-
export { LazyAutocomplete } from "./LazyAutocomplete
|
|
5
|
-
export { useAutocomplete } from "./useAutocompleteContext
|
|
6
|
-
export { getOptionValue, getOptionLabel } from "./util
|
|
1
|
+
export { Autocomplete } from "./Autocomplete";
|
|
2
|
+
export { SimpleAutocomplete } from "./SimpleAutocomplete";
|
|
3
|
+
export { AutocompleteOption } from "./AutocompleteOption";
|
|
4
|
+
export { LazyAutocomplete } from "./LazyAutocomplete";
|
|
5
|
+
export { useAutocomplete } from "./useAutocompleteContext";
|
|
6
|
+
export { getOptionValue, getOptionLabel } from "./util";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionLike } from "../select
|
|
1
|
+
import { OptionLike } from "../select";
|
|
2
2
|
export declare function getOptionLabel(option: OptionLike): string;
|
|
3
3
|
export declare function getOptionValue(option: OptionLike): string | number;
|
|
4
4
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { buttonVariants } from "../button/Button
|
|
4
|
-
import { Tooltip } from "../tooltip/Tooltip
|
|
5
|
-
import { TooltipContent } from "../tooltip/TooltipContent
|
|
6
|
-
import { TooltipTrigger } from "../tooltip/TooltipTrigger
|
|
3
|
+
import { buttonVariants } from "../button/Button";
|
|
4
|
+
import { Tooltip } from "../tooltip/Tooltip";
|
|
5
|
+
import { TooltipContent } from "../tooltip/TooltipContent";
|
|
6
|
+
import { TooltipTrigger } from "../tooltip/TooltipTrigger";
|
|
7
7
|
export function Badge({ children, className, onRemove, onClick, tooltip, url, color = "yellow", }) {
|
|
8
8
|
const badge = (_jsxs("span", { "data-color": color, className: clsx("text-body-xs w-fit rounded-full", buttonVariants({
|
|
9
9
|
variant: "contained",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Badge } from "./Badge
|
|
1
|
+
export { Badge } from "./Badge";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Badge } from "./Badge
|
|
1
|
+
export { Badge } from "./Badge";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, RefObject } from "react";
|
|
2
|
-
import { ThemeColor } from "../../types
|
|
2
|
+
import { ThemeColor } from "../../types";
|
|
3
3
|
export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
4
4
|
withRipple?: boolean;
|
|
5
5
|
variant?: "contained" | "light" | "outlined" | "text" | "ghost";
|
|
6
6
|
size?: "small" | "medium" | "large" | "custom" | "input";
|
|
7
|
-
color?: ThemeColor;
|
|
7
|
+
color?: ThemeColor | "yellow-alpha" | "gray-alpha";
|
|
8
8
|
width?: "fit" | "full" | "custom";
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
@@ -19,10 +19,10 @@ export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const buttonVariants: (props?: ({
|
|
21
21
|
clickable?: boolean | null | undefined;
|
|
22
|
-
size?: "small" | "input" | "
|
|
22
|
+
size?: "small" | "input" | "medium" | "large" | "custom" | null | undefined;
|
|
23
23
|
icon?: boolean | "custom" | null | undefined;
|
|
24
24
|
width?: "custom" | "fit" | "full" | null | undefined;
|
|
25
|
-
variant?: "
|
|
25
|
+
variant?: "light" | "text" | "contained" | "outlined" | "ghost" | null | undefined;
|
|
26
26
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
27
|
export declare function Button({ withRipple, variant, loading, color, size, focusable, className, disabled, children, selected, icon, asChild, width, ref, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAazC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEzD,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IAEnD,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAElC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc;;;;;;8EAoD1B,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,UAAiB,EACjB,OAAqB,EACrB,OAAe,EACf,KAAgB,EAChB,IAAe,EACf,SAAgB,EAChB,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,OAAe,EACf,KAAa,EACb,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,2CAyDb"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useImperativeHandle, useRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { Loader } from "../loader
|
|
5
|
-
import { useRipple } from "../../hooks
|
|
6
|
-
import { Slot } from "../slot
|
|
4
|
+
import { Loader } from "../loader";
|
|
5
|
+
import { useRipple } from "../../hooks";
|
|
6
|
+
import { Slot } from "../slot";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
8
|
+
function loaderColor(color) {
|
|
9
|
+
switch (color) {
|
|
10
|
+
case "yellow-alpha":
|
|
11
|
+
return "yellow";
|
|
12
|
+
case "gray-alpha":
|
|
13
|
+
return "gray";
|
|
14
|
+
default:
|
|
15
|
+
return color;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
8
18
|
export const buttonVariants = cva("relative box-border inline-flex items-center leading-5 no-underline focus-visible-has:outline-2 truncate", {
|
|
9
19
|
variants: {
|
|
10
20
|
clickable: {
|
|
@@ -19,13 +29,13 @@ export const buttonVariants = cva("relative box-border inline-flex items-center
|
|
|
19
29
|
custom: "",
|
|
20
30
|
},
|
|
21
31
|
icon: {
|
|
22
|
-
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg)]:pr-4",
|
|
32
|
+
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg,strong)]:pr-4",
|
|
23
33
|
false: "rounded-2xl px-4",
|
|
24
34
|
custom: "",
|
|
25
35
|
},
|
|
26
36
|
width: {
|
|
27
37
|
fit: "w-full max-w-fit",
|
|
28
|
-
full: "w-full",
|
|
38
|
+
full: "w-full justify-center",
|
|
29
39
|
custom: "",
|
|
30
40
|
},
|
|
31
41
|
variant: {
|
|
@@ -39,9 +49,9 @@ export const buttonVariants = cva("relative box-border inline-flex items-center
|
|
|
39
49
|
*/
|
|
40
50
|
contained: "shadow-sm hover:shadow-md active:shadow-md-active outline-offset-0 text-custom-text bg-custom-3 hover:bg-custom-4 current:bg-custom-4 focus-visible-has:outline-custom-5",
|
|
41
51
|
light: "shadow-sm hover:shadow-md has-checked:shadow-md focus:shadow-md active:shadow-md-active outline-offset-0 bg-custom-1 text-gray-text hover:text-custom-text hover:bg-custom-3 current:bg-custom-3 focus-visible-has:outline-custom-4",
|
|
42
|
-
outlined: "bg-
|
|
52
|
+
outlined: "bg-custom-0 hover:shadow-xs active:shadow-xs-active text-gray-7 outline-offset-0 border-1 hover:bg-custom-1 border-custom-3 focus-visible-has:outline-custom-5 current:bg-custom-3 focus-visible-has:border-transparent",
|
|
43
53
|
text: "bg-transparent hover:shadow-xs active:shadow-xs-active outline-offset-0 hover:bg-custom-1 dark:hover:bg-custom-1/50 text-gray-7 hover:text-gray-8 current:bg-custom-3 focus-visible-has:outline-custom-5",
|
|
44
|
-
ghost: "
|
|
54
|
+
ghost: "outline-offset-0 current:bg-custom-1 focus-visible-has:outline-custom-5",
|
|
45
55
|
},
|
|
46
56
|
},
|
|
47
57
|
defaultVariants: {
|
|
@@ -63,5 +73,5 @@ export function Button({ withRipple = true, variant = "contained", loading = fal
|
|
|
63
73
|
size,
|
|
64
74
|
width,
|
|
65
75
|
icon: width === "custom" && !icon ? "custom" : icon,
|
|
66
|
-
}), className, loading && !icon && "text-transparent"), "data-color": color, "data-variant": variant, "aria-checked": selected, disabled: typeof disabled === "boolean" ? disabled : undefined, suppressHydrationWarning: true, "aria-busy": loading, ...props, children: asChild ? (children) : (_jsxs(_Fragment, { children: [!notClickable && withRipple && ripples, children, loading && (_jsx(Loader, { color: color, className: clsx("top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"), position: "absolute" }))] })) }));
|
|
76
|
+
}), className, loading && !icon && "text-transparent"), "data-color": color, "data-variant": variant, "aria-checked": selected, disabled: typeof disabled === "boolean" ? disabled : undefined, suppressHydrationWarning: true, "aria-busy": loading, ...props, children: asChild ? (children) : (_jsxs(_Fragment, { children: [!notClickable && withRipple && ripples, children, loading && (_jsx(Loader, { color: loaderColor(color), className: clsx("top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"), position: "absolute" }))] })) }));
|
|
67
77
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps, RefObject } from "react";
|
|
2
|
+
import { ButtonProps } from "./Button";
|
|
3
|
+
export type HrefButtonProps = ComponentProps<"a"> & Pick<ButtonProps, "withRipple" | "variant" | "size" | "color" | "selected" | "icon" | "disabled" | "width"> & {
|
|
4
|
+
ref?: RefObject<HTMLAnchorElement>;
|
|
5
|
+
};
|
|
6
|
+
export declare function HrefButton({ withRipple, variant, color, size, width, className, disabled, children, selected, icon, href, ref, ...props }: HrefButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=HrefButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HrefButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/HrefButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,GAC/C,IAAI,CACF,WAAW,EACX,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACzF,GAAG;IAAE,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAA;CAAE,CAAC;AAE7C,wBAAgB,UAAU,CAAC,EACzB,UAAiB,EACjB,OAAqB,EACrB,KAAgB,EAChB,IAAe,EACf,KAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,IAAI,EACJ,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,2CA8BjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useImperativeHandle, useRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { useRipple } from "../../hooks/useRipple";
|
|
5
|
+
import { buttonVariants } from "./Button";
|
|
6
|
+
export function HrefButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", width = "fit", className, disabled, children, selected = false, icon = false, href, ref, ...props }) {
|
|
7
|
+
const anchorRef = useRef(null);
|
|
8
|
+
useImperativeHandle(ref, () => anchorRef.current);
|
|
9
|
+
const ripples = useRipple(anchorRef);
|
|
10
|
+
return (_jsxs("a", { role: "button", href: href, ref: anchorRef, className: clsx(buttonVariants({ variant, size, width, icon: size === "custom" ? "custom" : icon }), className, selected && "active"), "data-color": color, "data-variant": variant, "aria-checked": selected, "aria-disabled": disabled, ...props, children: [!disabled && withRipple && ripples, children] }));
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, RefObject } from "react";
|
|
2
|
-
import { ButtonProps } from "./Button
|
|
3
|
-
export type
|
|
2
|
+
import { ButtonProps } from "./Button";
|
|
3
|
+
export type HrefButtonProps = ComponentProps<"a"> & Pick<ButtonProps, "withRipple" | "variant" | "size" | "color" | "selected" | "icon" | "disabled" | "width"> & {
|
|
4
4
|
ref?: RefObject<HTMLAnchorElement>;
|
|
5
5
|
};
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function HrefButton({ withRipple, variant, color, size, width, className, disabled, children, selected, icon, href, ref, ...props }: HrefButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=LinkButton.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useImperativeHandle, useRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { useRipple } from "../../hooks/useRipple
|
|
5
|
-
import { buttonVariants } from "./Button
|
|
6
|
-
export function
|
|
4
|
+
import { useRipple } from "../../hooks/useRipple";
|
|
5
|
+
import { buttonVariants } from "./Button";
|
|
6
|
+
export function HrefButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", width = "fit", className, disabled, children, selected = false, icon = false, href, ref, ...props }) {
|
|
7
7
|
const anchorRef = useRef(null);
|
|
8
8
|
useImperativeHandle(ref, () => anchorRef.current);
|
|
9
9
|
const ripples = useRipple(anchorRef);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Button, type ButtonProps, buttonVariants } from "./Button
|
|
2
|
-
export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup
|
|
3
|
-
export {
|
|
1
|
+
export { Button, type ButtonProps, buttonVariants } from "./Button";
|
|
2
|
+
export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup";
|
|
3
|
+
export { HrefButton } from "./HrefButton";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Button, buttonVariants } from "./Button
|
|
2
|
-
export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup
|
|
3
|
-
export {
|
|
1
|
+
export { Button, buttonVariants } from "./Button";
|
|
2
|
+
export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup";
|
|
3
|
+
export { HrefButton } from "./HrefButton";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { cardConfig } from "./config
|
|
1
|
+
export { cardConfig } from "./config";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cardConfig } from "./config
|
|
1
|
+
export { cardConfig } from "./config";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Code } from "./Code
|
|
1
|
+
export { Code } from "./Code";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Code } from "./Code
|
|
1
|
+
export { Code } from "./Code";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Children, cloneElement, isValidElement, useEffect, useRef, useState, } from "react";
|
|
3
3
|
import { FloatingFocusManager, FloatingPortal, autoUpdate, flip, offset, shift, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTypeahead, } from "@floating-ui/react";
|
|
4
|
-
import { Dialog } from "../dialog/Dialog
|
|
5
|
-
import { useEffectEvent, useRefDebounce } from "../../hooks
|
|
4
|
+
import { Dialog } from "../dialog/Dialog";
|
|
5
|
+
import { useEffectEvent, useRefDebounce } from "../../hooks";
|
|
6
6
|
export function ContextMenu({ targetRef, children, style, eventName = "contextmenu" }) {
|
|
7
7
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
8
8
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ContextMenu } from "./ContextMenu
|
|
2
|
-
export { ContextMenuItem, type ContextMenuItemMouseEvent } from "./ContextMenuItem
|
|
1
|
+
export { ContextMenu } from "./ContextMenu";
|
|
2
|
+
export { ContextMenuItem, type ContextMenuItemMouseEvent } from "./ContextMenuItem";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ContextMenu } from "./ContextMenu
|
|
2
|
-
export { ContextMenuItem } from "./ContextMenuItem
|
|
1
|
+
export { ContextMenu } from "./ContextMenu";
|
|
2
|
+
export { ContextMenuItem } from "./ContextMenuItem";
|