@bioturing/components 0.31.0 → 0.32.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/components/badge/component.d.ts +7 -0
- package/dist/components/badge/component.d.ts.map +1 -0
- package/dist/components/badge/component.js.map +1 -1
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/component.d.ts +6 -0
- package/dist/components/breadcrumb/component.d.ts.map +1 -0
- package/dist/components/breadcrumb/component.js.map +1 -1
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/types.d.ts +19 -0
- package/dist/components/breadcrumb/types.d.ts.map +1 -0
- package/dist/components/breadcrumb/useItemRender.d.ts +7 -0
- package/dist/components/breadcrumb/useItemRender.d.ts.map +1 -0
- package/dist/components/breadcrumb/useItemRender.js.map +1 -1
- package/dist/components/button/component.d.ts +14 -0
- package/dist/components/button/component.d.ts.map +1 -0
- package/dist/components/button/component.js.map +1 -1
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/checkbox/component.d.ts +16 -0
- package/dist/components/checkbox/component.d.ts.map +1 -0
- package/dist/components/checkbox/component.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/choice-list/component.d.ts +35 -0
- package/dist/components/choice-list/component.d.ts.map +1 -0
- package/dist/components/choice-list/component.js.map +1 -1
- package/dist/components/choice-list/index.d.ts +2 -0
- package/dist/components/choice-list/index.d.ts.map +1 -0
- package/dist/components/cmdk/command-score.d.ts +2 -0
- package/dist/components/cmdk/command-score.d.ts.map +1 -0
- package/dist/components/cmdk/command-score.js.map +1 -1
- package/dist/components/cmdk/index.d.ts +440 -0
- package/dist/components/cmdk/index.d.ts.map +1 -0
- package/dist/components/cmdk/index.js +332 -348
- package/dist/components/cmdk/index.js.map +1 -1
- package/dist/components/code-block/component.d.ts +3 -0
- package/dist/components/code-block/component.d.ts.map +1 -0
- package/dist/components/code-block/component.js +83 -84
- package/dist/components/code-block/component.js.map +1 -1
- package/dist/components/code-block/index.d.ts +3 -0
- package/dist/components/code-block/index.d.ts.map +1 -0
- package/dist/components/code-block/types.d.ts +64 -0
- package/dist/components/code-block/types.d.ts.map +1 -0
- package/dist/components/collapse/component.d.ts +14 -0
- package/dist/components/collapse/component.d.ts.map +1 -0
- package/dist/components/collapse/component.js.map +1 -1
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/collapse/index.d.ts.map +1 -0
- package/dist/components/color-select/component.d.ts +36 -0
- package/dist/components/color-select/component.d.ts.map +1 -0
- package/dist/components/color-select/component.js +28 -30
- package/dist/components/color-select/component.js.map +1 -1
- package/dist/components/color-select/index.d.ts +2 -0
- package/dist/components/color-select/index.d.ts.map +1 -0
- package/dist/components/combobox/component.d.ts +119 -0
- package/dist/components/combobox/component.d.ts.map +1 -0
- package/dist/components/combobox/component.js +166 -162
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.d.ts.map +1 -0
- package/dist/components/command-palette/component.d.ts +41 -0
- package/dist/components/command-palette/component.d.ts.map +1 -0
- package/dist/components/command-palette/component.js +36 -36
- package/dist/components/command-palette/component.js.map +1 -1
- package/dist/components/command-palette/index.d.ts +2 -0
- package/dist/components/command-palette/index.d.ts.map +1 -0
- package/dist/components/command-palette/style.css +1 -1
- package/dist/components/drag-drop/context.d.ts +10 -0
- package/dist/components/drag-drop/context.d.ts.map +1 -0
- package/dist/components/drag-drop/context.js.map +1 -1
- package/dist/components/drag-drop/draggable.d.ts +6 -0
- package/dist/components/drag-drop/draggable.d.ts.map +1 -0
- package/dist/components/drag-drop/draggable.js.map +1 -1
- package/dist/components/drag-drop/droppable.d.ts +9 -0
- package/dist/components/drag-drop/droppable.d.ts.map +1 -0
- package/dist/components/drag-drop/droppable.js.map +1 -1
- package/dist/components/drag-drop/hooks.d.ts +42 -0
- package/dist/components/drag-drop/hooks.d.ts.map +1 -0
- package/dist/components/drag-drop/hooks.js +71 -73
- package/dist/components/drag-drop/hooks.js.map +1 -1
- package/dist/components/drag-drop/index.d.ts +26 -0
- package/dist/components/drag-drop/index.d.ts.map +1 -0
- package/dist/components/drag-drop/index.js.map +1 -1
- package/dist/components/drag-drop/types.d.ts +232 -0
- package/dist/components/drag-drop/types.d.ts.map +1 -0
- package/dist/components/drag-drop/value.d.ts +8 -0
- package/dist/components/drag-drop/value.d.ts.map +1 -0
- package/dist/components/drag-drop/value.js +66 -66
- package/dist/components/drag-drop/value.js.map +1 -1
- package/dist/components/dropdown-menu/component.d.ts +79 -0
- package/dist/components/dropdown-menu/component.d.ts.map +1 -0
- package/dist/components/dropdown-menu/component.js +108 -106
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/divider.d.ts +6 -0
- package/dist/components/dropdown-menu/divider.d.ts.map +1 -0
- package/dist/components/dropdown-menu/divider.js.map +1 -1
- package/dist/components/dropdown-menu/index.d.ts +4 -0
- package/dist/components/dropdown-menu/index.d.ts.map +1 -0
- package/dist/components/dropdown-menu/item.d.ts +56 -0
- package/dist/components/dropdown-menu/item.d.ts.map +1 -0
- package/dist/components/dropdown-menu/item.js +72 -66
- package/dist/components/dropdown-menu/item.js.map +1 -1
- package/dist/components/dropdown-menu/types.d.ts +88 -0
- package/dist/components/dropdown-menu/types.d.ts.map +1 -0
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +58 -0
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -0
- package/dist/components/dropdown-menu/useDropdownMenu.js +80 -77
- package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
- package/dist/components/ds-root/component.d.ts +14 -0
- package/dist/components/ds-root/component.d.ts.map +1 -0
- package/dist/components/ds-root/component.js.map +1 -1
- package/dist/components/ds-root/context.d.ts +8 -0
- package/dist/components/ds-root/context.d.ts.map +1 -0
- package/dist/components/ds-root/index.d.ts +3 -0
- package/dist/components/ds-root/index.d.ts.map +1 -0
- package/dist/components/empty/component.d.ts +13 -0
- package/dist/components/empty/component.d.ts.map +1 -0
- package/dist/components/empty/component.js.map +1 -1
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.d.ts.map +1 -0
- package/dist/components/field/component.d.ts +42 -0
- package/dist/components/field/component.d.ts.map +1 -0
- package/dist/components/field/component.js.map +1 -1
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.d.ts.map +1 -0
- package/dist/components/form/component.d.ts +22 -0
- package/dist/components/form/component.d.ts.map +1 -0
- package/dist/components/form/component.js.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/item.d.ts +24 -0
- package/dist/components/form/item.d.ts.map +1 -0
- package/dist/components/form/item.js +24 -24
- package/dist/components/form/item.js.map +1 -1
- package/dist/components/form/label.d.ts +32 -0
- package/dist/components/form/label.d.ts.map +1 -0
- package/dist/components/form/label.js.map +1 -1
- package/dist/components/hooks/antd.d.ts +11 -0
- package/dist/components/hooks/antd.d.ts.map +1 -0
- package/dist/components/hooks/antd.js.map +1 -1
- package/dist/components/hooks/base-ui.d.ts +11 -0
- package/dist/components/hooks/base-ui.d.ts.map +1 -0
- package/dist/components/hooks/base-ui.js +22 -25
- package/dist/components/hooks/base-ui.js.map +1 -1
- package/dist/components/hooks/index.d.ts +11 -0
- package/dist/components/hooks/index.d.ts.map +1 -0
- package/dist/components/hooks/useBreakpoint.d.ts +39 -0
- package/dist/components/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/components/hooks/useBreakpoint.js +14 -15
- package/dist/components/hooks/useBreakpoint.js.map +1 -1
- package/dist/components/hooks/useCSSVariables.d.ts +7 -0
- package/dist/components/hooks/useCSSVariables.d.ts.map +1 -0
- package/dist/components/hooks/useCSSVariables.js.map +1 -1
- package/dist/components/hooks/useCharts.d.ts +41 -0
- package/dist/components/hooks/useCharts.d.ts.map +1 -0
- package/dist/components/hooks/useCharts.js.map +1 -1
- package/dist/components/hooks/useControlledState.d.ts +13 -0
- package/dist/components/hooks/useControlledState.d.ts.map +1 -0
- package/dist/components/hooks/useControlledState.js.map +1 -1
- package/dist/components/hooks/useDraggable.d.ts +4 -0
- package/dist/components/hooks/useDraggable.d.ts.map +1 -0
- package/dist/components/hooks/useDraggable.js +19 -20
- package/dist/components/hooks/useDraggable.js.map +1 -1
- package/dist/components/hooks/useHover.d.ts +5 -0
- package/dist/components/hooks/useHover.d.ts.map +1 -0
- package/dist/components/hooks/useHover.js +16 -17
- package/dist/components/hooks/useHover.js.map +1 -1
- package/dist/components/hooks/useResizeObserver.d.ts +9 -0
- package/dist/components/hooks/useResizeObserver.d.ts.map +1 -0
- package/dist/components/hooks/useResizeObserver.js +29 -30
- package/dist/components/hooks/useResizeObserver.js.map +1 -1
- package/dist/components/hooks/useTransitionStatus.d.ts +13 -0
- package/dist/components/hooks/useTransitionStatus.d.ts.map +1 -0
- package/dist/components/hooks/useTransitionStatus.js.map +1 -1
- package/dist/components/hooks/useWindowSize.d.ts +5 -0
- package/dist/components/hooks/useWindowSize.d.ts.map +1 -0
- package/dist/components/hooks/useWindowSize.js.map +1 -1
- package/dist/components/icon-button/component.d.ts +45 -0
- package/dist/components/icon-button/component.d.ts.map +1 -0
- package/dist/components/icon-button/component.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +53 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/input/component.d.ts +29 -0
- package/dist/components/input/component.d.ts.map +1 -0
- package/dist/components/input/component.js +42 -41
- package/dist/components/input/component.js.map +1 -1
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/keyboard-shortcut/component.d.ts +15 -0
- package/dist/components/keyboard-shortcut/component.d.ts.map +1 -0
- package/dist/components/keyboard-shortcut/component.js.map +1 -1
- package/dist/components/keyboard-shortcut/index.d.ts +2 -0
- package/dist/components/keyboard-shortcut/index.d.ts.map +1 -0
- package/dist/components/loader/component.d.ts +5 -0
- package/dist/components/loader/component.d.ts.map +1 -0
- package/dist/components/loader/component.js.map +1 -1
- package/dist/components/loader/index.d.ts +2 -0
- package/dist/components/loader/index.d.ts.map +1 -0
- package/dist/components/modal/Modal.d.ts +85 -0
- package/dist/components/modal/Modal.d.ts.map +1 -0
- package/dist/components/modal/Modal.js +75 -75
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/ModalProvider.d.ts +6 -0
- package/dist/components/modal/ModalProvider.d.ts.map +1 -0
- package/dist/components/modal/ModalProvider.js +25 -25
- package/dist/components/modal/ModalProvider.js.map +1 -1
- package/dist/components/modal/ModalService.d.ts +34 -0
- package/dist/components/modal/ModalService.d.ts.map +1 -0
- package/dist/components/modal/ModalService.js +5 -10
- package/dist/components/modal/ModalService.js.map +1 -1
- package/dist/components/modal/constants.d.ts +10 -0
- package/dist/components/modal/constants.d.ts.map +1 -0
- package/dist/components/modal/constants.js.map +1 -1
- package/dist/components/modal/functions.d.ts +28 -0
- package/dist/components/modal/functions.d.ts.map +1 -0
- package/dist/components/modal/functions.js.map +1 -1
- package/dist/components/modal/index.d.ts +16 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/modal/index.js.map +1 -1
- package/dist/components/nav/context.d.ts +10 -0
- package/dist/components/nav/context.d.ts.map +1 -0
- package/dist/components/nav/context.js.map +1 -1
- package/dist/components/nav/group.d.ts +15 -0
- package/dist/components/nav/group.d.ts.map +1 -0
- package/dist/components/nav/group.js.map +1 -1
- package/dist/components/nav/heading.d.ts +6 -0
- package/dist/components/nav/heading.d.ts.map +1 -0
- package/dist/components/nav/heading.js.map +1 -1
- package/dist/components/nav/index.d.ts +12 -0
- package/dist/components/nav/index.d.ts.map +1 -0
- package/dist/components/nav/item.d.ts +35 -0
- package/dist/components/nav/item.d.ts.map +1 -0
- package/dist/components/nav/item.js.map +1 -1
- package/dist/components/popover/component.d.ts +10 -0
- package/dist/components/popover/component.d.ts.map +1 -0
- package/dist/components/popover/component.js.map +1 -1
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popup-panel/component.d.ts +100 -0
- package/dist/components/popup-panel/component.d.ts.map +1 -0
- package/dist/components/popup-panel/component.js +105 -105
- package/dist/components/popup-panel/component.js.map +1 -1
- package/dist/components/popup-panel/constants.d.ts +8 -0
- package/dist/components/popup-panel/constants.d.ts.map +1 -0
- package/dist/components/popup-panel/constants.js.map +1 -1
- package/dist/components/popup-panel/index.d.ts +2 -0
- package/dist/components/popup-panel/index.d.ts.map +1 -0
- package/dist/components/radio/component.d.ts +8 -0
- package/dist/components/radio/component.d.ts.map +1 -0
- package/dist/components/radio/component.js.map +1 -1
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio/index.d.ts.map +1 -0
- package/dist/components/radio/interface.d.ts +6 -0
- package/dist/components/radio/interface.d.ts.map +1 -0
- package/dist/components/resizable/component.d.ts +70 -0
- package/dist/components/resizable/component.d.ts.map +1 -0
- package/dist/components/resizable/component.js +147 -147
- package/dist/components/resizable/component.js.map +1 -1
- package/dist/components/resizable/index.d.ts +3 -0
- package/dist/components/resizable/index.d.ts.map +1 -0
- package/dist/components/scroll-area/component.d.ts +67 -0
- package/dist/components/scroll-area/component.d.ts.map +1 -0
- package/dist/components/scroll-area/component.js +75 -56
- package/dist/components/scroll-area/component.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/segmented/component.d.ts +10 -0
- package/dist/components/segmented/component.d.ts.map +1 -0
- package/dist/components/segmented/component.js.map +1 -1
- package/dist/components/segmented/index.d.ts +2 -0
- package/dist/components/segmented/index.d.ts.map +1 -0
- package/dist/components/select/component.d.ts +48 -0
- package/dist/components/select/component.d.ts.map +1 -0
- package/dist/components/select/component.js +93 -94
- package/dist/components/select/component.js.map +1 -1
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.d.ts.map +1 -0
- package/dist/components/select/item.d.ts +14 -0
- package/dist/components/select/item.d.ts.map +1 -0
- package/dist/components/select/item.js.map +1 -1
- package/dist/components/select-trigger/component.d.ts +45 -0
- package/dist/components/select-trigger/component.d.ts.map +1 -0
- package/dist/components/select-trigger/component.js +96 -96
- package/dist/components/select-trigger/component.js.map +1 -1
- package/dist/components/select-trigger/index.d.ts +3 -0
- package/dist/components/select-trigger/index.d.ts.map +1 -0
- package/dist/components/slider/component.d.ts +6 -0
- package/dist/components/slider/component.d.ts.map +1 -0
- package/dist/components/slider/component.js.map +1 -1
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.d.ts.map +1 -0
- package/dist/components/spin/component.d.ts +6 -0
- package/dist/components/spin/component.d.ts.map +1 -0
- package/dist/components/spin/component.js.map +1 -1
- package/dist/components/spin/index.d.ts +2 -0
- package/dist/components/spin/index.d.ts.map +1 -0
- package/dist/components/splitter/component.d.ts +10 -0
- package/dist/components/splitter/component.d.ts.map +1 -0
- package/dist/components/splitter/component.js +7 -7
- package/dist/components/splitter/component.js.map +1 -1
- package/dist/components/splitter/context.d.ts +5 -0
- package/dist/components/splitter/context.d.ts.map +1 -0
- package/dist/components/splitter/context.js.map +1 -1
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/splitter-panel.d.ts +12 -0
- package/dist/components/splitter/splitter-panel.d.ts.map +1 -0
- package/dist/components/splitter/splitter-panel.js.map +1 -1
- package/dist/components/splitter/splitter.d.ts +11 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/splitter/splitter.js +112 -112
- package/dist/components/splitter/splitter.js.map +1 -1
- package/dist/components/splitter/useSizes.d.ts +9 -0
- package/dist/components/splitter/useSizes.d.ts.map +1 -0
- package/dist/components/splitter/useSizes.js +35 -35
- package/dist/components/splitter/useSizes.js.map +1 -1
- package/dist/components/stack/Stack.d.ts +40 -0
- package/dist/components/stack/Stack.d.ts.map +1 -0
- package/dist/components/stack/Stack.js.map +1 -1
- package/dist/components/stack/StackChild.d.ts +31 -0
- package/dist/components/stack/StackChild.d.ts.map +1 -0
- package/dist/components/stack/StackChild.js.map +1 -1
- package/dist/components/stack/index.d.ts +8 -0
- package/dist/components/stack/index.d.ts.map +1 -0
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/status-icon/component.d.ts +23 -0
- package/dist/components/status-icon/component.d.ts.map +1 -0
- package/dist/components/status-icon/component.js.map +1 -1
- package/dist/components/status-icon/index.d.ts +2 -0
- package/dist/components/status-icon/index.d.ts.map +1 -0
- package/dist/components/switch/component.d.ts +9 -0
- package/dist/components/switch/component.d.ts.map +1 -0
- package/dist/components/switch/component.js.map +1 -1
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/table/component.d.ts +32 -0
- package/dist/components/table/component.d.ts.map +1 -0
- package/dist/components/table/component.js +57 -58
- package/dist/components/table/component.js.map +1 -1
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/tag/component.d.ts +22 -0
- package/dist/components/tag/component.d.ts.map +1 -0
- package/dist/components/tag/component.js.map +1 -1
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/index.d.ts.map +1 -0
- package/dist/components/theme-provider/component.d.ts +7 -0
- package/dist/components/theme-provider/component.d.ts.map +1 -0
- package/dist/components/theme-provider/component.js.map +1 -1
- package/dist/components/theme-provider/index.d.ts +2 -0
- package/dist/components/theme-provider/index.d.ts.map +1 -0
- package/dist/components/toast/component.d.ts +15 -0
- package/dist/components/toast/component.d.ts.map +1 -0
- package/dist/components/toast/component.js +49 -50
- package/dist/components/toast/component.js.map +1 -1
- package/dist/components/toast/function.d.ts +11 -0
- package/dist/components/toast/function.d.ts.map +1 -0
- package/dist/components/toast/function.js.map +1 -1
- package/dist/components/toast/index.d.ts +4 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/components/toast/types.d.ts +4 -0
- package/dist/components/toast/types.d.ts.map +1 -0
- package/dist/components/tooltip/component.d.ts +10 -0
- package/dist/components/tooltip/component.d.ts.map +1 -0
- package/dist/components/tooltip/component.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tour/component.d.ts +8 -0
- package/dist/components/tour/component.d.ts.map +1 -0
- package/dist/components/tour/component.js.map +1 -1
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/transition/component.d.ts +30 -0
- package/dist/components/transition/component.d.ts.map +1 -0
- package/dist/components/transition/component.js +32 -32
- package/dist/components/transition/component.js.map +1 -1
- package/dist/components/transition/index.d.ts +2 -0
- package/dist/components/transition/index.d.ts.map +1 -0
- package/dist/components/tree/components.d.ts +14 -0
- package/dist/components/tree/components.d.ts.map +1 -0
- package/dist/components/tree/components.js.map +1 -1
- package/dist/components/tree/helpers.d.ts +6 -0
- package/dist/components/tree/helpers.d.ts.map +1 -0
- package/dist/components/tree/helpers.js.map +1 -1
- package/dist/components/tree/index.d.ts +5 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/types.d.ts +56 -0
- package/dist/components/tree/types.d.ts.map +1 -0
- package/dist/components/tree/useTreeCommon.d.ts +179 -0
- package/dist/components/tree/useTreeCommon.d.ts.map +1 -0
- package/dist/components/tree/useTreeCommon.js +29 -29
- package/dist/components/tree/useTreeCommon.js.map +1 -1
- package/dist/components/tree/useUniqueKeysTree.d.ts +34 -0
- package/dist/components/tree/useUniqueKeysTree.d.ts.map +1 -0
- package/dist/components/tree/useUniqueKeysTree.js.map +1 -1
- package/dist/components/truncate/component.d.ts +17 -0
- package/dist/components/truncate/component.d.ts.map +1 -0
- package/dist/components/truncate/component.js +38 -39
- package/dist/components/truncate/component.js.map +1 -1
- package/dist/components/truncate/helpers.d.ts +17 -0
- package/dist/components/truncate/helpers.d.ts.map +1 -0
- package/dist/components/truncate/helpers.js +27 -30
- package/dist/components/truncate/helpers.js.map +1 -1
- package/dist/components/truncate/index.d.ts +2 -0
- package/dist/components/truncate/index.d.ts.map +1 -0
- package/dist/components/upload/component.d.ts +17 -0
- package/dist/components/upload/component.d.ts.map +1 -0
- package/dist/components/upload/component.js.map +1 -1
- package/dist/components/upload/dragger.d.ts +14 -0
- package/dist/components/upload/dragger.d.ts.map +1 -0
- package/dist/components/upload/dragger.js.map +1 -1
- package/dist/components/upload/hooks.d.ts +6 -0
- package/dist/components/upload/hooks.d.ts.map +1 -0
- package/dist/components/upload/hooks.js.map +1 -1
- package/dist/components/upload/index.d.ts +4 -0
- package/dist/components/upload/index.d.ts.map +1 -0
- package/dist/components/upload/item.d.ts +12 -0
- package/dist/components/upload/item.d.ts.map +1 -0
- package/dist/components/upload/item.js.map +1 -1
- package/dist/components/upload/utils.d.ts +2 -0
- package/dist/components/upload/utils.d.ts.map +1 -0
- package/dist/components/upload/utils.js.map +1 -1
- package/dist/components/utils/WithAntdTokens.d.ts +8 -0
- package/dist/components/utils/WithAntdTokens.d.ts.map +1 -0
- package/dist/components/utils/WithAntdTokens.js.map +1 -1
- package/dist/components/utils/WithRenderProp.d.ts +14 -0
- package/dist/components/utils/WithRenderProp.d.ts.map +1 -0
- package/dist/components/utils/WithRenderProp.js.map +1 -1
- package/dist/components/utils/antdUtils.d.ts +11 -0
- package/dist/components/utils/antdUtils.d.ts.map +1 -0
- package/dist/components/utils/antdUtils.js +9 -12
- package/dist/components/utils/antdUtils.js.map +1 -1
- package/dist/components/utils/client.d.ts +6 -0
- package/dist/components/utils/client.d.ts.map +1 -0
- package/dist/components/utils/cn.d.ts +5 -0
- package/dist/components/utils/cn.d.ts.map +1 -0
- package/dist/components/utils/cn.js.map +1 -1
- package/dist/components/utils/colors.d.ts +2 -0
- package/dist/components/utils/colors.d.ts.map +1 -0
- package/dist/components/utils/constants.d.ts +15 -0
- package/dist/components/utils/constants.d.ts.map +1 -0
- package/dist/components/utils/index.d.ts +6 -0
- package/dist/components/utils/index.d.ts.map +1 -0
- package/dist/components/utils/isTracebackError.d.ts +2 -0
- package/dist/components/utils/isTracebackError.d.ts.map +1 -0
- package/dist/components/utils/isTracebackError.js.map +1 -1
- package/dist/components/utils/main.d.ts +7 -0
- package/dist/components/utils/main.d.ts.map +1 -0
- package/dist/components/utils/placement.d.ts +21 -0
- package/dist/components/utils/placement.d.ts.map +1 -0
- package/dist/components/utils/placement.js.map +1 -1
- package/dist/components/utils/reactElement.d.ts +2 -0
- package/dist/components/utils/reactElement.d.ts.map +1 -0
- package/dist/components/utils/reactToString.d.ts +3 -0
- package/dist/components/utils/reactToString.d.ts.map +1 -0
- package/dist/components/utils/reactToString.js.map +1 -1
- package/dist/components/utils/selectionRange.d.ts +2 -0
- package/dist/components/utils/selectionRange.d.ts.map +1 -0
- package/dist/components/utils/selectionRange.js.map +1 -1
- package/dist/components/utils/theme.d.ts +6 -0
- package/dist/components/utils/theme.d.ts.map +1 -0
- package/dist/components/utils/theme.js.map +1 -1
- package/dist/components/utils/types.d.ts +12 -0
- package/dist/components/utils/types.d.ts.map +1 -0
- package/dist/components/vertical-collapsible-panel/component.d.ts +65 -0
- package/dist/components/vertical-collapsible-panel/component.d.ts.map +1 -0
- package/dist/components/vertical-collapsible-panel/component.js.map +1 -1
- package/dist/components/vertical-collapsible-panel/index.d.ts +2 -0
- package/dist/components/vertical-collapsible-panel/index.d.ts.map +1 -0
- package/dist/index.d.ts +4 -4390
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +166 -164
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +446 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js.map +1 -1
- package/dist/tokens/and-theme/index.d.ts +2 -0
- package/dist/tokens/and-theme/index.d.ts.map +1 -0
- package/dist/tokens/and-theme/tokens.d.ts +6 -0
- package/dist/tokens/and-theme/tokens.d.ts.map +1 -0
- package/dist/tokens/and-theme/tokens.js.map +1 -1
- package/dist/tokens/charts/index.d.ts +5 -0
- package/dist/tokens/charts/index.d.ts.map +1 -0
- package/dist/tokens/charts/palettes/cloudscape.d.ts +460 -0
- package/dist/tokens/charts/palettes/cloudscape.d.ts.map +1 -0
- package/dist/tokens/charts/palettes/cloudscape.js.map +1 -1
- package/dist/tokens/charts/palettes/colorbrewer.d.ts +338 -0
- package/dist/tokens/charts/palettes/colorbrewer.d.ts.map +1 -0
- package/dist/tokens/charts/palettes/colorbrewer.js.map +1 -1
- package/dist/tokens/charts/palettes/index.d.ts +24 -0
- package/dist/tokens/charts/palettes/index.d.ts.map +1 -0
- package/dist/tokens/charts/palettes/index.js.map +1 -1
- package/dist/tokens/charts/palettes/tableau.d.ts +11 -0
- package/dist/tokens/charts/palettes/tableau.d.ts.map +1 -0
- package/dist/tokens/index.d.ts +5 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/types.d.ts +10 -0
- package/dist/tokens/types.d.ts.map +1 -0
- package/dist/tokens/utils.d.ts +9 -0
- package/dist/tokens/utils.d.ts.map +1 -0
- package/dist/tokens/utils.js.map +1 -1
- package/package.json +2 -2
- package/dist/tailwind.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/field/component.tsx"],"sourcesContent":["\"use client\";\nimport type { InputProps, InputRef, SelectProps } from \"antd\";\nimport { Input, Select } from \"antd\";\nimport { SizeType } from \"antd/es/config-provider/SizeContext\";\nimport { RefSelectProps } from \"antd/es/select\";\nimport { ForwardedRef, forwardRef, useId } from \"react\";\nimport { clsx, useCls, useAntdCssVarClassname } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type FieldType = \"input\" | \"select\";\n\ntype RefType<T extends FieldType> = T extends \"input\"\n ? InputRef\n : T extends \"select\"\n ? RefSelectProps\n : never;\n\ninterface BaseFieldProps extends React.HTMLAttributes<HTMLDivElement> {\n label?: React.ReactNode;\n /**\n * Block or inline display\n * @default false\n */\n block?: boolean;\n /**\n * Size of the field\n * @default \"small\"\n */\n size?: SizeType;\n /**\n * Colon after label\n * @default true\n */\n colon?: boolean;\n}\n\ntype InputFieldProps = BaseFieldProps & {\n type?: \"input\";\n inputProps: InputProps;\n};\n\ntype SelectFieldProps = BaseFieldProps & {\n type: \"select\";\n selectProps: SelectProps;\n};\n\nexport type FieldProps<T extends FieldType = \"input\"> = T extends \"input\"\n ? InputFieldProps\n : SelectFieldProps;\n\n/**\n * Generic Field component that forwards ref to Input or Select\n */\nconst FieldInner = <T extends FieldType>(\n {\n label,\n className,\n size = \"small\",\n colon = true,\n type = \"input\",\n ...rest\n }: FieldProps<T>,\n ref: ForwardedRef<RefType<T>>\n) => {\n const cls = useCls();\n const id = useId();\n const cssVarClassname = useAntdCssVarClassname();\n const renderInputOrSelect = () => {\n if (type === \"select\") {\n return (\n // @ts-expect-error: this is a workaround for the type error\n <Select id={id} ref={ref} size={size} {...(rest.selectProps || {})} />\n );\n }\n // @ts-expect-error: this is a workaround for the type error\n return <Input id={id} ref={ref} size={size} {...(rest.inputProps || {})} />;\n };\n return (\n <div className={clsx(cls(\"field\"), cssVarClassname, className)}>\n {label && (\n <label htmlFor={id} className={cls(\"field-label\")}>\n {label}\n {colon ? \":\" : \"\"}\n </label>\n )}\n {renderInputOrSelect()}\n </div>\n );\n};\n\nexport const Field = forwardRef(FieldInner) as <T extends FieldType>(\n props: FieldProps<T> & { ref?: ForwardedRef<RefType<T>> }\n) => ReturnType<typeof FieldInner<T>>;\n"],"names":["FieldInner","label","className","size","colon","type","rest","ref","cls","useCls","id","useId","cssVarClassname","useAntdCssVarClassname","renderInputOrSelect","jsx","Select","Input","jsxs","clsx","Field","forwardRef"],"mappings":";;;;;;;AAuDA,MAAMA,IAAa,CACjB;AAAA,EACE,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/field/component.tsx"],"sourcesContent":["\"use client\";\nimport type { InputProps, InputRef, SelectProps } from \"antd\";\nimport { Input, Select } from \"antd\";\nimport { SizeType } from \"antd/es/config-provider/SizeContext\";\nimport { RefSelectProps } from \"antd/es/select\";\nimport { ForwardedRef, forwardRef, useId } from \"react\";\nimport { clsx, useCls, useAntdCssVarClassname } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type FieldType = \"input\" | \"select\";\n\ntype RefType<T extends FieldType> = T extends \"input\"\n ? InputRef\n : T extends \"select\"\n ? RefSelectProps\n : never;\n\ninterface BaseFieldProps extends React.HTMLAttributes<HTMLDivElement> {\n label?: React.ReactNode;\n /**\n * Block or inline display\n * @default false\n */\n block?: boolean;\n /**\n * Size of the field\n * @default \"small\"\n */\n size?: SizeType;\n /**\n * Colon after label\n * @default true\n */\n colon?: boolean;\n}\n\ntype InputFieldProps = BaseFieldProps & {\n type?: \"input\";\n inputProps: InputProps;\n};\n\ntype SelectFieldProps = BaseFieldProps & {\n type: \"select\";\n selectProps: SelectProps;\n};\n\nexport type FieldProps<T extends FieldType = \"input\"> = T extends \"input\"\n ? InputFieldProps\n : SelectFieldProps;\n\n/**\n * Generic Field component that forwards ref to Input or Select\n */\nconst FieldInner = <T extends FieldType>(\n {\n label,\n className,\n size = \"small\",\n colon = true,\n type = \"input\",\n ...rest\n }: FieldProps<T>,\n ref: ForwardedRef<RefType<T>>\n) => {\n const cls = useCls();\n const id = useId();\n const cssVarClassname = useAntdCssVarClassname();\n const renderInputOrSelect = () => {\n if (type === \"select\") {\n return (\n // @ts-expect-error: this is a workaround for the type error\n <Select id={id} ref={ref} size={size} {...(rest.selectProps || {})} />\n );\n }\n // @ts-expect-error: this is a workaround for the type error\n return <Input id={id} ref={ref} size={size} {...(rest.inputProps || {})} />;\n };\n return (\n <div className={clsx(cls(\"field\"), cssVarClassname, className)}>\n {label && (\n <label htmlFor={id} className={cls(\"field-label\")}>\n {label}\n {colon ? \":\" : \"\"}\n </label>\n )}\n {renderInputOrSelect()}\n </div>\n );\n};\n\nexport const Field = forwardRef(FieldInner) as <T extends FieldType>(\n props: FieldProps<T> & { ref?: ForwardedRef<RefType<T>> }\n) => ReturnType<typeof FieldInner<T>>;\n"],"names":["FieldInner","label","className","size","colon","type","rest","ref","cls","useCls","id","useId","cssVarClassname","useAntdCssVarClassname","renderInputOrSelect","jsx","Select","Input","jsxs","clsx","Field","forwardRef"],"mappings":";;;;;;;AAuDA,MAAMA,IAAa,CACjB;AAAA,EACE,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,EAAA,GACNC,IAAKC,EAAA,GACLC,IAAkBC,EAAA,GAClBC,IAAsB,MACtBT,MAAS;AAAA;AAAA,IAGT,gBAAAU,EAACC,KAAO,IAAAN,GAAQ,KAAAH,GAAU,MAAAJ,GAAa,GAAIG,EAAK,eAAe,GAAC,CAAI;AAAA,MAIjE,gBAAAS,EAACE,KAAM,IAAAP,GAAQ,KAAAH,GAAU,MAAAJ,GAAa,GAAIG,EAAK,cAAc,CAAA,GAAK;AAE3E,SACE,gBAAAY,EAAC,SAAI,WAAWC,EAAKX,EAAI,OAAO,GAAGI,GAAiBV,CAAS,GAC1D,UAAA;AAAA,IAAAD,uBACE,SAAA,EAAM,SAASS,GAAI,WAAWF,EAAI,aAAa,GAC7C,UAAA;AAAA,MAAAP;AAAA,MACAG,IAAQ,MAAM;AAAA,IAAA,GACjB;AAAA,IAEDU,EAAA;AAAA,EAAoB,GACvB;AAEJ,GAEaM,IAAQC,EAAWrB,CAAU;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/field/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FormProps as AntdFormProps, default as AntdInternalForm, useForm, useWatch } from 'antd/es/form/Form';
|
|
2
|
+
import { default as useFormInstance } from 'antd/es/form/hooks/useFormInstance';
|
|
3
|
+
import { FormItemProps } from './item';
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
export interface FormProps<Values = unknown> extends AntdFormProps<Values> {
|
|
6
|
+
}
|
|
7
|
+
interface InternalFormProps<Values = unknown> extends React.ComponentProps<typeof AntdInternalForm<Values>> {
|
|
8
|
+
}
|
|
9
|
+
export declare const Form: (<Values = unknown>({ ...rest }: InternalFormProps<Values>) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
|
+
useForm: typeof useForm;
|
|
11
|
+
useFormInstance: typeof useFormInstance;
|
|
12
|
+
useWatch: typeof useWatch;
|
|
13
|
+
Item: <Values = unknown>({ tooltip, label, optionalMark, requiredMark, labelRender, required, rules, children, ...rest }: FormItemProps<Values>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
List: React.FC<import('antd/es/form').FormListProps>;
|
|
15
|
+
ErrorList: React.FC<import('antd/es/form').ErrorListProps>;
|
|
16
|
+
Provider: React.FC<import('antd/es/form/context').FormProviderProps>;
|
|
17
|
+
Label: <E extends React.ElementType = "label">(props: import('./label').FormLabelProps<E> & {
|
|
18
|
+
ref?: React.ComponentPropsWithRef<E>["ref"];
|
|
19
|
+
}) => ReturnType<(<E_1 extends React.ElementType = "label">({ label, tooltip, optionalMark, requiredMark, className, as, render, ...rest }: import('./label').FormLabelProps<E_1>, ref: React.Ref<import('..').ElementTypeToDOMType<E_1>>) => import("react/jsx-runtime").JSX.Element)>;
|
|
20
|
+
};
|
|
21
|
+
export type { FormItemProps };
|
|
22
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,OAAO,IAAI,gBAAgB,EAC3B,OAAO,EACP,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAG3B,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAItD,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,SAAS,CAAC,MAAM,GAAG,OAAO,CAAE,SAAQ,aAAa,CAAC,MAAM,CAAC;CAAG;AAE7E,UAAU,iBAAiB,CAAC,MAAM,GAAG,OAAO,CAC1C,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;CAAG;AAQlE,eAAO,MAAM,IAAI,IANK,MAAM,yBAEzB,iBAAiB,CAAC,MAAM,CAAC;;;;;;;;;WAgB2iD,CAAC;;CAHtkD,CAAC;AAEH,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/form/component.tsx"],"sourcesContent":["\"use client\";\nimport ErrorList from \"antd/es/form/ErrorList\";\nimport {\n FormProps as AntdFormProps,\n default as AntdInternalForm,\n useForm,\n useWatch,\n} from \"antd/es/form/Form\";\nimport FormList from \"antd/es/form/FormList\";\nimport { FormProvider } from \"antd/es/form/context\";\nimport useFormInstance from \"antd/es/form/hooks/useFormInstance\";\nimport * as React from \"react\";\nimport { FormItem, type FormItemProps } from \"./item\";\nimport { FormLabel } from \"./label\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface FormProps<Values = unknown> extends AntdFormProps<Values> {}\n\ninterface InternalFormProps<Values = unknown>\n extends React.ComponentProps<typeof AntdInternalForm<Values>> {}\n\nconst InternalForm = <Values = unknown,>({\n ...rest\n}: InternalFormProps<Values>) => {\n return <AntdInternalForm {...rest} />;\n};\n\nexport const Form = Object.assign(InternalForm, {\n useForm,\n useFormInstance,\n useWatch,\n Item: FormItem,\n List: FormList,\n ErrorList,\n Provider: FormProvider,\n Label: FormLabel,\n});\n\nexport type { FormItemProps };\n"],"names":["InternalForm","rest","jsx","AntdInternalForm","Form","useForm","useFormInstance","useWatch","FormItem","FormList","ErrorList","FormProvider","FormLabel"],"mappings":";;;;;;;;;;AAuBA,MAAMA,IAAe,CAAoB;AAAA,EACvC,GAAGC;AACL,MACS,gBAAAC,EAACC,
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/form/component.tsx"],"sourcesContent":["\"use client\";\nimport ErrorList from \"antd/es/form/ErrorList\";\nimport {\n FormProps as AntdFormProps,\n default as AntdInternalForm,\n useForm,\n useWatch,\n} from \"antd/es/form/Form\";\nimport FormList from \"antd/es/form/FormList\";\nimport { FormProvider } from \"antd/es/form/context\";\nimport useFormInstance from \"antd/es/form/hooks/useFormInstance\";\nimport * as React from \"react\";\nimport { FormItem, type FormItemProps } from \"./item\";\nimport { FormLabel } from \"./label\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface FormProps<Values = unknown> extends AntdFormProps<Values> {}\n\ninterface InternalFormProps<Values = unknown>\n extends React.ComponentProps<typeof AntdInternalForm<Values>> {}\n\nconst InternalForm = <Values = unknown,>({\n ...rest\n}: InternalFormProps<Values>) => {\n return <AntdInternalForm {...rest} />;\n};\n\nexport const Form = Object.assign(InternalForm, {\n useForm,\n useFormInstance,\n useWatch,\n Item: FormItem,\n List: FormList,\n ErrorList,\n Provider: FormProvider,\n Label: FormLabel,\n});\n\nexport type { FormItemProps };\n"],"names":["InternalForm","rest","jsx","AntdInternalForm","Form","useForm","useFormInstance","useWatch","FormItem","FormList","ErrorList","FormProvider","FormLabel"],"mappings":";;;;;;;;;;AAuBA,MAAMA,IAAe,CAAoB;AAAA,EACvC,GAAGC;AACL,MACS,gBAAAC,EAACC,GAAA,EAAkB,GAAGF,EAAA,CAAM,GAGxBG,IAAO,OAAO,OAAOJ,GAAc;AAAA,EAC9C,SAAAK;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAUC;AAAA,EACV,OAAOC;AACT,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FormItemProps as AntdFormItemProps } from 'antd/es/form/FormItem';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface FormItemProps<Values = unknown> extends Omit<AntdFormItemProps<Values>, "children"> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether show the optional mark. By default, optional item will not show the optional mark.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
optionalMark?: boolean | React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Whether show the asterisk when the field is required
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
requiredMark?: boolean | React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Custom render function for the label
|
|
16
|
+
*/
|
|
17
|
+
labelRender?: (label: React.ReactElement) => React.ReactElement;
|
|
18
|
+
/**
|
|
19
|
+
* Form item children - can be React nodes or render functions
|
|
20
|
+
*/
|
|
21
|
+
children?: AntdFormItemProps<Values>["children"];
|
|
22
|
+
}
|
|
23
|
+
export declare const FormItem: <Values = unknown>({ tooltip, label, optionalMark, requiredMark, labelRender, required, rules, children, ...rest }: FormItemProps<Values>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/components/form/item.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,IAAI,iBAAiB,EACxC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,aAAa,CAAC,MAAM,GAAG,OAAO,CAC7C,SAAQ,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAEnD;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACzC;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,OAAO,EAAG,iGAUzC,aAAa,CAAC,MAAM,CAAC,4CA0BvB,CAAC"}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
3
|
import q from "antd/es/form/FormItem";
|
|
4
|
-
import { FormLabel as
|
|
5
|
-
import { isPlainObject as
|
|
6
|
-
const
|
|
7
|
-
tooltip:
|
|
8
|
-
label:
|
|
9
|
-
optionalMark:
|
|
10
|
-
requiredMark:
|
|
11
|
-
labelRender:
|
|
12
|
-
required:
|
|
13
|
-
rules:
|
|
4
|
+
import { FormLabel as u } from "./label.js";
|
|
5
|
+
import { isPlainObject as F } from "es-toolkit";
|
|
6
|
+
const I = ({
|
|
7
|
+
tooltip: a,
|
|
8
|
+
label: o,
|
|
9
|
+
optionalMark: p = !1,
|
|
10
|
+
requiredMark: d = !0,
|
|
11
|
+
labelRender: t,
|
|
12
|
+
required: e,
|
|
13
|
+
rules: i,
|
|
14
14
|
children: c,
|
|
15
15
|
...f
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
(r) =>
|
|
19
|
-
)
|
|
20
|
-
|
|
17
|
+
const m = e || i?.some(
|
|
18
|
+
(r) => F(r) && "required" in r && r.required
|
|
19
|
+
), n = o ? /* @__PURE__ */ s(
|
|
20
|
+
u,
|
|
21
21
|
{
|
|
22
|
-
label:
|
|
23
|
-
tooltip:
|
|
24
|
-
optionalMark: !
|
|
25
|
-
requiredMark:
|
|
22
|
+
label: o,
|
|
23
|
+
tooltip: a,
|
|
24
|
+
optionalMark: !m && p,
|
|
25
|
+
requiredMark: m && d,
|
|
26
26
|
as: "span"
|
|
27
27
|
}
|
|
28
28
|
) : void 0;
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ s(
|
|
30
30
|
q,
|
|
31
31
|
{
|
|
32
|
-
required:
|
|
33
|
-
label:
|
|
34
|
-
rules:
|
|
32
|
+
required: e,
|
|
33
|
+
label: t ? t(n) : n,
|
|
34
|
+
rules: i,
|
|
35
35
|
...f,
|
|
36
36
|
children: c
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
I as FormItem
|
|
42
42
|
};
|
|
43
43
|
//# sourceMappingURL=item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../src/components/form/item.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntdFormItem,\n type FormItemProps as AntdFormItemProps,\n} from \"antd/es/form/FormItem\";\nimport { FormLabel } from \"./label\";\nimport { isPlainObject } from \"es-toolkit\";\nimport type React from \"react\";\n\nexport interface FormItemProps<Values = unknown>\n extends Omit<AntdFormItemProps<Values>, \"children\"> {\n // tooltip?: React.ReactNode | TooltipProps;\n /**\n * Whether show the optional mark. By default, optional item will not show the optional mark.\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether show the asterisk when the field is required\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n /**\n * Custom render function for the label\n */\n labelRender?: (label: React.ReactElement) => React.ReactElement;\n /**\n * Form item children - can be React nodes or render functions\n */\n children?: AntdFormItemProps<Values>[\"children\"];\n}\n\nexport const FormItem = <Values = unknown,>({\n tooltip,\n label,\n optionalMark = false,\n requiredMark = true,\n labelRender,\n required,\n rules,\n children,\n ...rest\n}: FormItemProps<Values>) => {\n const isRequired =\n required ||\n rules?.some(\n (rule) => isPlainObject(rule) && \"required\" in rule && rule.required\n );\n const renderedLabel = label ? (\n <FormLabel\n label={label}\n tooltip={tooltip}\n optionalMark={!isRequired && optionalMark}\n requiredMark={isRequired && requiredMark}\n as=\"span\"\n />\n ) : undefined;\n\n return (\n <AntdFormItem\n required={required}\n label={labelRender ? labelRender(renderedLabel) : renderedLabel}\n rules={rules}\n {...rest}\n >\n {children}\n </AntdFormItem>\n );\n};\n"],"names":["FormItem","tooltip","label","optionalMark","requiredMark","labelRender","required","rules","children","rest","isRequired","rule","isPlainObject","renderedLabel","jsx","FormLabel","AntdFormItem"],"mappings":";;;;;AAgCO,MAAMA,IAAW,CAAoB;AAAA,EAC1C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA6B;
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../../../src/components/form/item.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntdFormItem,\n type FormItemProps as AntdFormItemProps,\n} from \"antd/es/form/FormItem\";\nimport { FormLabel } from \"./label\";\nimport { isPlainObject } from \"es-toolkit\";\nimport type React from \"react\";\n\nexport interface FormItemProps<Values = unknown>\n extends Omit<AntdFormItemProps<Values>, \"children\"> {\n // tooltip?: React.ReactNode | TooltipProps;\n /**\n * Whether show the optional mark. By default, optional item will not show the optional mark.\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether show the asterisk when the field is required\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n /**\n * Custom render function for the label\n */\n labelRender?: (label: React.ReactElement) => React.ReactElement;\n /**\n * Form item children - can be React nodes or render functions\n */\n children?: AntdFormItemProps<Values>[\"children\"];\n}\n\nexport const FormItem = <Values = unknown,>({\n tooltip,\n label,\n optionalMark = false,\n requiredMark = true,\n labelRender,\n required,\n rules,\n children,\n ...rest\n}: FormItemProps<Values>) => {\n const isRequired =\n required ||\n rules?.some(\n (rule) => isPlainObject(rule) && \"required\" in rule && rule.required\n );\n const renderedLabel = label ? (\n <FormLabel\n label={label}\n tooltip={tooltip}\n optionalMark={!isRequired && optionalMark}\n requiredMark={isRequired && requiredMark}\n as=\"span\"\n />\n ) : undefined;\n\n return (\n <AntdFormItem\n required={required}\n label={labelRender ? labelRender(renderedLabel) : renderedLabel}\n rules={rules}\n {...rest}\n >\n {children}\n </AntdFormItem>\n );\n};\n"],"names":["FormItem","tooltip","label","optionalMark","requiredMark","labelRender","required","rules","children","rest","isRequired","rule","isPlainObject","renderedLabel","jsx","FormLabel","AntdFormItem"],"mappings":";;;;;AAgCO,MAAMA,IAAW,CAAoB;AAAA,EAC1C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA6B;AAC3B,QAAMC,IACJJ,KACAC,GAAO;AAAA,IACL,CAACI,MAASC,EAAcD,CAAI,KAAK,cAAcA,KAAQA,EAAK;AAAA,EAAA,GAE1DE,IAAgBX,IACpB,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAb;AAAA,MACA,SAAAD;AAAA,MACA,cAAc,CAACS,KAAcP;AAAA,MAC7B,cAAcO,KAAcN;AAAA,MAC5B,IAAG;AAAA,IAAA;AAAA,EAAA,IAEH;AAEJ,SACE,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAV;AAAA,MACA,OAAOD,IAAcA,EAAYQ,CAAa,IAAIA;AAAA,MAClD,OAAAN;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as React, ElementType, Ref, ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { WithRenderPropProps, ElementTypeToDOMType } from '../utils';
|
|
3
|
+
import { WrapperTooltipProps } from 'antd/es/form/FormItemLabel';
|
|
4
|
+
export type FormLabelProps<E extends ElementType = "label"> = WithRenderPropProps<E> & {
|
|
5
|
+
/**
|
|
6
|
+
* Label content to display
|
|
7
|
+
*/
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Optional tooltip to display next to the label
|
|
11
|
+
*/
|
|
12
|
+
tooltip?: React.ReactNode | WrapperTooltipProps;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to show optional mark or custom optional mark content
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
optionalMark?: boolean | React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to show required mark or custom required mark content
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
requiredMark?: boolean | React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Implementation of the FormLabel component
|
|
26
|
+
*/
|
|
27
|
+
declare const FormLabelImpl: <E extends ElementType = "label">({ label, tooltip, optionalMark, requiredMark, className, as, render, ...rest }: FormLabelProps<E>, ref: Ref<ElementTypeToDOMType<E>>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const FormLabel: <E extends ElementType = "label">(props: FormLabelProps<E> & {
|
|
29
|
+
ref?: ComponentPropsWithRef<E>["ref"];
|
|
30
|
+
}) => ReturnType<typeof FormLabelImpl>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/components/form/label.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAEZ,KAAK,WAAW,EAChB,KAAK,GAAG,EACR,qBAAqB,EAEtB,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,mBAAmB,EAEnB,oBAAoB,EAErB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,OAAO,IACxD,mBAAmB,CAAC,CAAC,CAAC,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,mBAAmB,CAAC;IAChD;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;CAC1C,CAAC;AAEJ;;GAEG;AACH,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,GAAG,OAAO,EACpD,gFASG,cAAc,CAAC,CAAC,CAAC,EACpB,KAAK,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,4CAqDlC,CAAC;AAGF,eAAO,MAAM,SAAS,EAAgC,CACpD,CAAC,SAAS,WAAW,GAAG,OAAO,EAE/B,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;CAAE,KACjE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sources":["../../../src/components/form/label.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n forwardRef,\n type ElementType,\n type Ref,\n ComponentPropsWithRef,\n isValidElement,\n} from \"react\";\nimport {\n useCls,\n WithRenderPropProps,\n WithRenderProp,\n ElementTypeToDOMType,\n cn,\n} from \"../utils\";\nimport { IconButton } from \"../icon-button\";\nimport { QuestionIcon } from \"@bioturing/assets\";\nimport { WrapperTooltipProps } from \"antd/es/form/FormItemLabel\";\n\nexport type FormLabelProps<E extends ElementType = \"label\"> =\n WithRenderPropProps<E> & {\n /**\n * Label content to display\n */\n label: React.ReactNode;\n /**\n * Optional tooltip to display next to the label\n */\n tooltip?: React.ReactNode | WrapperTooltipProps;\n /**\n * Whether to show optional mark or custom optional mark content\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether to show required mark or custom required mark content\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n };\n\n/**\n * Implementation of the FormLabel component\n */\nconst FormLabelImpl = <E extends ElementType = \"label\">(\n {\n label,\n tooltip,\n optionalMark,\n requiredMark,\n className,\n as,\n render,\n ...rest\n }: FormLabelProps<E>,\n ref: Ref<ElementTypeToDOMType<E>>\n) => {\n const cls = useCls();\n\n const labelContent = [\n label,\n tooltip && (\n <IconButton\n key=\"tooltip\"\n className={cls(\"form-item-explaination-icon\")}\n label={\n typeof tooltip === \"string\" || isValidElement(tooltip)\n ? tooltip\n : undefined\n }\n >\n <QuestionIcon />\n </IconButton>\n ),\n optionalMark && (\n <span key=\"optional\" className={cls(\"form-item-label-optional-mark\")}>\n {typeof optionalMark === \"boolean\" ? \"(optional)\" : optionalMark}\n </span>\n ),\n requiredMark && (\n <span\n key=\"required\"\n className={cls(\n \"form-item-label-required-mark\",\n typeof requiredMark === \"boolean\"\n ? \"form-item-label-required-mark-asterisk\"\n : \"\"\n )}\n >\n {typeof requiredMark === \"boolean\" ? \"*\" : requiredMark}\n </span>\n ),\n ];\n\n const elementProps = {\n ref,\n className: cn(\n cls(\n \"form-item-label-inner\",\n requiredMark && \"form-item-label-with-required-mark\"\n ),\n className\n ),\n children: labelContent,\n ...rest,\n };\n\n return <WithRenderProp as={as || \"span\"} render={render} {...elementProps} />;\n};\n\n// Export with correct typing\nexport const FormLabel = forwardRef(FormLabelImpl) as <\n E extends ElementType = \"label\"\n>(\n props: FormLabelProps<E> & { ref?: ComponentPropsWithRef<E>[\"ref\"] }\n) => ReturnType<typeof FormLabelImpl>;\n"],"names":["FormLabelImpl","label","tooltip","optionalMark","requiredMark","className","as","render","rest","ref","cls","useCls","labelContent","jsx","IconButton","isValidElement","QuestionIcon","elementProps","cn","WithRenderProp","FormLabel","forwardRef"],"mappings":";;;;;;;;AA4CA,MAAMA,IAAgB,CACpB;AAAA,EACE,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../../../src/components/form/label.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n forwardRef,\n type ElementType,\n type Ref,\n ComponentPropsWithRef,\n isValidElement,\n} from \"react\";\nimport {\n useCls,\n WithRenderPropProps,\n WithRenderProp,\n ElementTypeToDOMType,\n cn,\n} from \"../utils\";\nimport { IconButton } from \"../icon-button\";\nimport { QuestionIcon } from \"@bioturing/assets\";\nimport { WrapperTooltipProps } from \"antd/es/form/FormItemLabel\";\n\nexport type FormLabelProps<E extends ElementType = \"label\"> =\n WithRenderPropProps<E> & {\n /**\n * Label content to display\n */\n label: React.ReactNode;\n /**\n * Optional tooltip to display next to the label\n */\n tooltip?: React.ReactNode | WrapperTooltipProps;\n /**\n * Whether to show optional mark or custom optional mark content\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether to show required mark or custom required mark content\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n };\n\n/**\n * Implementation of the FormLabel component\n */\nconst FormLabelImpl = <E extends ElementType = \"label\">(\n {\n label,\n tooltip,\n optionalMark,\n requiredMark,\n className,\n as,\n render,\n ...rest\n }: FormLabelProps<E>,\n ref: Ref<ElementTypeToDOMType<E>>\n) => {\n const cls = useCls();\n\n const labelContent = [\n label,\n tooltip && (\n <IconButton\n key=\"tooltip\"\n className={cls(\"form-item-explaination-icon\")}\n label={\n typeof tooltip === \"string\" || isValidElement(tooltip)\n ? tooltip\n : undefined\n }\n >\n <QuestionIcon />\n </IconButton>\n ),\n optionalMark && (\n <span key=\"optional\" className={cls(\"form-item-label-optional-mark\")}>\n {typeof optionalMark === \"boolean\" ? \"(optional)\" : optionalMark}\n </span>\n ),\n requiredMark && (\n <span\n key=\"required\"\n className={cls(\n \"form-item-label-required-mark\",\n typeof requiredMark === \"boolean\"\n ? \"form-item-label-required-mark-asterisk\"\n : \"\"\n )}\n >\n {typeof requiredMark === \"boolean\" ? \"*\" : requiredMark}\n </span>\n ),\n ];\n\n const elementProps = {\n ref,\n className: cn(\n cls(\n \"form-item-label-inner\",\n requiredMark && \"form-item-label-with-required-mark\"\n ),\n className\n ),\n children: labelContent,\n ...rest,\n };\n\n return <WithRenderProp as={as || \"span\"} render={render} {...elementProps} />;\n};\n\n// Export with correct typing\nexport const FormLabel = forwardRef(FormLabelImpl) as <\n E extends ElementType = \"label\"\n>(\n props: FormLabelProps<E> & { ref?: ComponentPropsWithRef<E>[\"ref\"] }\n) => ReturnType<typeof FormLabelImpl>;\n"],"names":["FormLabelImpl","label","tooltip","optionalMark","requiredMark","className","as","render","rest","ref","cls","useCls","labelContent","jsx","IconButton","isValidElement","QuestionIcon","elementProps","cn","WithRenderProp","FormLabel","forwardRef"],"mappings":";;;;;;;;AA4CA,MAAMA,IAAgB,CACpB;AAAA,EACE,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,EAAA,GAENC,IAAe;AAAA,IACnBX;AAAA,IACAC,KACE,gBAAAW;AAAA,MAACC;AAAA,MAAA;AAAA,QAEC,WAAWJ,EAAI,6BAA6B;AAAA,QAC5C,OACE,OAAOR,KAAY,YAAYa,EAAeb,CAAO,IACjDA,IACA;AAAA,QAGN,4BAACc,GAAA,CAAA,CAAa;AAAA,MAAA;AAAA,MARV;AAAA,IAAA;AAAA,IAWRb,KACE,gBAAAU,EAAC,QAAA,EAAoB,WAAWH,EAAI,+BAA+B,GAChE,UAAA,OAAOP,KAAiB,YAAY,eAAeA,EAAA,GAD5C,UAEV;AAAA,IAEFC,KACE,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWH;AAAA,UACT;AAAA,UACA,OAAON,KAAiB,YACpB,2CACA;AAAA,QAAA;AAAA,QAGL,UAAA,OAAOA,KAAiB,YAAY,MAAMA;AAAA,MAAA;AAAA,MARvC;AAAA,IAAA;AAAA,EASN,GAIEa,IAAe;AAAA,IACnB,KAAAR;AAAA,IACA,WAAWS;AAAA,MACTR;AAAA,QACE;AAAA,QACAN,KAAgB;AAAA,MAAA;AAAA,MAElBC;AAAA,IAAA;AAAA,IAEF,UAAUO;AAAA,IACV,GAAGJ;AAAA,EAAA;AAGL,2BAAQW,GAAA,EAAe,IAAIb,KAAM,QAAQ,QAAAC,GAAiB,GAAGU,GAAc;AAC7E,GAGaG,IAAYC,EAAWrB,CAAa;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as useApp } from 'antd/es/app/useApp';
|
|
2
|
+
export declare const useToken: () => {
|
|
3
|
+
theme: import('@ant-design/cssinjs').Theme<import('antd/es/theme/internal').SeedToken, import('antd/es/theme/internal').AliasToken>;
|
|
4
|
+
token: import('antd').GlobalToken;
|
|
5
|
+
hashId: string;
|
|
6
|
+
};
|
|
7
|
+
export { useForm, useWatch } from 'antd/es/form/Form';
|
|
8
|
+
export declare const useMessage: () => import('antd/es/message/interface').MessageInstance;
|
|
9
|
+
export declare const useModal: () => import('antd/es/modal/useModal').HookAPI;
|
|
10
|
+
export { useApp };
|
|
11
|
+
//# sourceMappingURL=antd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antd.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/antd.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,eAAO,MAAM,QAAQ;kBAGkB,qBAEnC,eAAe,wBAAa,oBACd,wBAAa;;;CANO,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,UAAU,2DAGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,gDAGpB,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"antd.js","sources":["../../../src/components/hooks/antd.ts"],"sourcesContent":["\"use client\";\nimport theme from \"antd/es/theme\";\n// import Grid from \"antd/es/grid\";\nimport useApp from \"antd/es/app/useApp\";\n\nexport const useToken = theme.useToken;\n// export const useBreakpoint = Grid.useBreakpoint;\n\nexport { useForm, useWatch } from \"antd/es/form/Form\";\n\nexport const useMessage = () => {\n const { message } = useApp();\n return message;\n};\n\nexport const useModal = () => {\n const { modal } = useApp();\n return modal;\n};\n\nexport { useApp };\n"],"names":["useToken","theme","useMessage","message","useApp","useModal","modal"],"mappings":";;;;;AAKO,MAAMA,IAAWC,EAAM,UAKjBC,IAAa,MAAM;
|
|
1
|
+
{"version":3,"file":"antd.js","sources":["../../../src/components/hooks/antd.ts"],"sourcesContent":["\"use client\";\nimport theme from \"antd/es/theme\";\n// import Grid from \"antd/es/grid\";\nimport useApp from \"antd/es/app/useApp\";\n\nexport const useToken = theme.useToken;\n// export const useBreakpoint = Grid.useBreakpoint;\n\nexport { useForm, useWatch } from \"antd/es/form/Form\";\n\nexport const useMessage = () => {\n const { message } = useApp();\n return message;\n};\n\nexport const useModal = () => {\n const { modal } = useApp();\n return modal;\n};\n\nexport { useApp };\n"],"names":["useToken","theme","useMessage","message","useApp","useModal","modal"],"mappings":";;;;;AAKO,MAAMA,IAAWC,EAAM,UAKjBC,IAAa,MAAM;AAC9B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA;AACpB,SAAOD;AACT,GAEaE,IAAW,MAAM;AAC5B,QAAM,EAAE,OAAAC,EAAA,IAAUF,EAAA;AAClB,SAAOE;AACT;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
type AnyFunction = (...args: any[]) => any;
|
|
3
|
+
export declare const useEnhancedEffect: typeof useLayoutEffect;
|
|
4
|
+
export declare function useEventCallback<Fn extends AnyFunction>(fn?: Fn): Fn;
|
|
5
|
+
export declare function useLatestRef<T>(value: T): import('react').RefObject<T>;
|
|
6
|
+
export declare function useAnimationsFinished(ref: React.RefObject<HTMLElement | null>, { waitForNextTick, subtree, }: {
|
|
7
|
+
waitForNextTick?: boolean;
|
|
8
|
+
subtree?: boolean;
|
|
9
|
+
}): (fnToExecute: () => void) => void;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=base-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-ui.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/base-ui.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAkC,MAAM,OAAO,CAAC;AAIxE,KAAK,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE3C,eAAO,MAAM,iBAAiB,wBAC+B,CAAC;AAE9D,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE,GAQzD,EAAE,CACR;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,gCAMvC;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,EACE,eAAuB,EACvB,OAAe,GAChB,EAAE;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,iBAYqC,MAAM,IAAI,UAwCjD"}
|
|
@@ -1,46 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useLayoutEffect as p, useEffect as m, useRef as
|
|
2
|
+
import { useLayoutEffect as p, useEffect as m, useRef as r, useCallback as h } from "react";
|
|
3
3
|
import { flushSync as A } from "react-dom";
|
|
4
4
|
const l = typeof window < "u" ? p : m;
|
|
5
|
-
function a(
|
|
6
|
-
const
|
|
5
|
+
function a(e) {
|
|
6
|
+
const t = r(e);
|
|
7
7
|
return l(() => {
|
|
8
|
-
|
|
8
|
+
t.current = e;
|
|
9
9
|
}), h(
|
|
10
|
-
(...
|
|
11
|
-
var n;
|
|
12
|
-
return (n = e.current) == null ? void 0 : n.call(e, ...i);
|
|
13
|
-
},
|
|
10
|
+
(...c) => t.current?.(...c),
|
|
14
11
|
[]
|
|
15
12
|
);
|
|
16
13
|
}
|
|
17
|
-
function E(
|
|
18
|
-
const
|
|
14
|
+
function E(e) {
|
|
15
|
+
const t = r(e);
|
|
19
16
|
return l(() => {
|
|
20
|
-
|
|
21
|
-
}),
|
|
17
|
+
t.current = e;
|
|
18
|
+
}), t;
|
|
22
19
|
}
|
|
23
|
-
function R(
|
|
24
|
-
waitForNextTick:
|
|
25
|
-
subtree:
|
|
20
|
+
function R(e, {
|
|
21
|
+
waitForNextTick: t = !1,
|
|
22
|
+
subtree: c = !1
|
|
26
23
|
}) {
|
|
27
|
-
const
|
|
28
|
-
cancelAnimationFrame(
|
|
24
|
+
const s = r(-1), u = r(-1), i = a(() => {
|
|
25
|
+
cancelAnimationFrame(s.current), clearTimeout(u.current);
|
|
29
26
|
});
|
|
30
|
-
return m(() =>
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
27
|
+
return m(() => i, [i]), a((o) => {
|
|
28
|
+
i();
|
|
29
|
+
const n = e.current;
|
|
30
|
+
n && (typeof n.getAnimations != "function" ? o() : s.current = requestAnimationFrame(() => {
|
|
34
31
|
function f() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
subtree:
|
|
32
|
+
n && Promise.allSettled(
|
|
33
|
+
n.getAnimations({
|
|
34
|
+
subtree: c
|
|
38
35
|
}).map((d) => d.finished)
|
|
39
36
|
).then(() => {
|
|
40
37
|
A(o);
|
|
41
38
|
});
|
|
42
39
|
}
|
|
43
|
-
|
|
40
|
+
t ? u.current = window.setTimeout(f) : f();
|
|
44
41
|
}));
|
|
45
42
|
});
|
|
46
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-ui.js","sources":["../../../src/components/hooks/base-ui.ts"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect, useEffect, useRef, useCallback } from \"react\";\nimport { flushSync } from \"react-dom\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFunction = (...args: any[]) => any;\n\nexport const useEnhancedEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport function useEventCallback<Fn extends AnyFunction>(fn?: Fn) {\n const ref = useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return useCallback<AnyFunction>(\n (...args) => ref.current?.(...args),\n []\n ) as Fn;\n}\n\nexport function useLatestRef<T>(value: T) {\n const ref = useRef(value);\n useEnhancedEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\nexport function useAnimationsFinished(\n ref: React.RefObject<HTMLElement | null>,\n {\n waitForNextTick = false,\n subtree = false,\n }: {\n waitForNextTick?: boolean;\n subtree?: boolean;\n }\n) {\n const frameRef = useRef(-1);\n const timeoutRef = useRef(-1);\n\n const cancelTasks = useEventCallback(() => {\n cancelAnimationFrame(frameRef.current);\n clearTimeout(timeoutRef.current);\n });\n\n useEffect(() => cancelTasks, [cancelTasks]);\n\n return useEventCallback((fnToExecute: () => void) => {\n cancelTasks();\n\n const element = ref.current;\n\n if (!element) {\n return;\n }\n\n if (typeof element.getAnimations !== \"function\") {\n fnToExecute();\n } else {\n frameRef.current = requestAnimationFrame(() => {\n function exec() {\n if (!element) {\n return;\n }\n\n Promise.allSettled(\n element\n .getAnimations({\n subtree,\n })\n .map((anim) => anim.finished)\n ).then(() => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n flushSync(fnToExecute);\n });\n }\n\n // `open: true` animations need to wait for the next tick to be detected\n if (waitForNextTick) {\n timeoutRef.current = window.setTimeout(exec);\n } else {\n exec();\n }\n });\n }\n });\n}\n"],"names":["useEnhancedEffect","useLayoutEffect","useEffect","useEventCallback","fn","ref","useRef","useCallback","args","
|
|
1
|
+
{"version":3,"file":"base-ui.js","sources":["../../../src/components/hooks/base-ui.ts"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect, useEffect, useRef, useCallback } from \"react\";\nimport { flushSync } from \"react-dom\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFunction = (...args: any[]) => any;\n\nexport const useEnhancedEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport function useEventCallback<Fn extends AnyFunction>(fn?: Fn) {\n const ref = useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return useCallback<AnyFunction>(\n (...args) => ref.current?.(...args),\n []\n ) as Fn;\n}\n\nexport function useLatestRef<T>(value: T) {\n const ref = useRef(value);\n useEnhancedEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\nexport function useAnimationsFinished(\n ref: React.RefObject<HTMLElement | null>,\n {\n waitForNextTick = false,\n subtree = false,\n }: {\n waitForNextTick?: boolean;\n subtree?: boolean;\n }\n) {\n const frameRef = useRef(-1);\n const timeoutRef = useRef(-1);\n\n const cancelTasks = useEventCallback(() => {\n cancelAnimationFrame(frameRef.current);\n clearTimeout(timeoutRef.current);\n });\n\n useEffect(() => cancelTasks, [cancelTasks]);\n\n return useEventCallback((fnToExecute: () => void) => {\n cancelTasks();\n\n const element = ref.current;\n\n if (!element) {\n return;\n }\n\n if (typeof element.getAnimations !== \"function\") {\n fnToExecute();\n } else {\n frameRef.current = requestAnimationFrame(() => {\n function exec() {\n if (!element) {\n return;\n }\n\n Promise.allSettled(\n element\n .getAnimations({\n subtree,\n })\n .map((anim) => anim.finished)\n ).then(() => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n flushSync(fnToExecute);\n });\n }\n\n // `open: true` animations need to wait for the next tick to be detected\n if (waitForNextTick) {\n timeoutRef.current = window.setTimeout(exec);\n } else {\n exec();\n }\n });\n }\n });\n}\n"],"names":["useEnhancedEffect","useLayoutEffect","useEffect","useEventCallback","fn","ref","useRef","useCallback","args","useLatestRef","value","useAnimationsFinished","waitForNextTick","subtree","frameRef","timeoutRef","cancelTasks","fnToExecute","element","exec","anim","flushSync"],"mappings":";;;AAOO,MAAMA,IACX,OAAO,SAAW,MAAcC,IAAkBC;AAE7C,SAASC,EAAyCC,GAAS;AAChE,QAAMC,IAAMC,EAAOF,CAAE;AACrB,SAAAJ,EAAkB,MAAM;AACtB,IAAAK,EAAI,UAAUD;AAAA,EAChB,CAAC,GACMG;AAAA,IACL,IAAIC,MAASH,EAAI,UAAU,GAAGG,CAAI;AAAA,IAClC,CAAA;AAAA,EAAC;AAEL;AAEO,SAASC,EAAgBC,GAAU;AACxC,QAAML,IAAMC,EAAOI,CAAK;AACxB,SAAAV,EAAkB,MAAM;AACtB,IAAAK,EAAI,UAAUK;AAAA,EAChB,CAAC,GACML;AACT;AAEO,SAASM,EACdN,GACA;AAAA,EACE,iBAAAO,IAAkB;AAAA,EAClB,SAAAC,IAAU;AACZ,GAIA;AACA,QAAMC,IAAWR,EAAO,EAAE,GACpBS,IAAaT,EAAO,EAAE,GAEtBU,IAAcb,EAAiB,MAAM;AACzC,yBAAqBW,EAAS,OAAO,GACrC,aAAaC,EAAW,OAAO;AAAA,EACjC,CAAC;AAED,SAAAb,EAAU,MAAMc,GAAa,CAACA,CAAW,CAAC,GAEnCb,EAAiB,CAACc,MAA4B;AACnD,IAAAD,EAAA;AAEA,UAAME,IAAUb,EAAI;AAEpB,IAAKa,MAID,OAAOA,EAAQ,iBAAkB,aACnCD,EAAA,IAEAH,EAAS,UAAU,sBAAsB,MAAM;AAC7C,eAASK,IAAO;AACd,QAAKD,KAIL,QAAQ;AAAA,UACNA,EACG,cAAc;AAAA,YACb,SAAAL;AAAA,UAAA,CACD,EACA,IAAI,CAACO,MAASA,EAAK,QAAQ;AAAA,QAAA,EAC9B,KAAK,MAAM;AAGX,UAAAC,EAAUJ,CAAW;AAAA,QACvB,CAAC;AAAA,MACH;AAGA,MAAIL,IACFG,EAAW,UAAU,OAAO,WAAWI,CAAI,IAE3CA,EAAA;AAAA,IAEJ,CAAC;AAAA,EAEL,CAAC;AACH;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './antd';
|
|
2
|
+
export * from './base-ui';
|
|
3
|
+
export * from './useControlledState';
|
|
4
|
+
export * from './useCharts';
|
|
5
|
+
export * from './useCSSVariables';
|
|
6
|
+
export * from './useHover';
|
|
7
|
+
export * from './useDraggable';
|
|
8
|
+
export * from './useBreakpoint';
|
|
9
|
+
export * from './useWindowSize';
|
|
10
|
+
export * from './useResizeObserver';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2
|
+
export declare const BREAKPOINTS: {
|
|
3
|
+
sm: number;
|
|
4
|
+
md: number;
|
|
5
|
+
lg: number;
|
|
6
|
+
xl: number;
|
|
7
|
+
"2xl": number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A responsive breakpoint hook using window.matchMedia for optimal performance.
|
|
11
|
+
*
|
|
12
|
+
* @param ssrBreakpoint - The breakpoint to use during SSR and before hydration.
|
|
13
|
+
* Defaults to "lg" for better SEO (search engines typically use desktop viewports).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Default: uses "lg" for SSR
|
|
18
|
+
* const bp = useBreakpoint();
|
|
19
|
+
*
|
|
20
|
+
* // Custom SSR breakpoint
|
|
21
|
+
* const bp = useBreakpoint("md");
|
|
22
|
+
*
|
|
23
|
+
* // Usage
|
|
24
|
+
* bp.breakpoint // Current breakpoint: "sm" | "md" | "lg" | "xl" | "2xl"
|
|
25
|
+
* bp.up("md") // true if screen >= 768px
|
|
26
|
+
* bp.down("lg") // true if screen < 1024px
|
|
27
|
+
* bp.between("md", "xl") // true if 768px <= screen < 1280px
|
|
28
|
+
* bp.only("lg") // true if screen is exactly in "lg" range
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const useBreakpoint: (ssrBreakpoint?: Breakpoint) => {
|
|
32
|
+
breakpoint: Breakpoint;
|
|
33
|
+
up: (bp: Breakpoint) => boolean;
|
|
34
|
+
down: (bp: Breakpoint) => boolean;
|
|
35
|
+
between: (minBp: Breakpoint, maxBp: Breakpoint) => boolean;
|
|
36
|
+
only: (bp: Breakpoint) => boolean;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=useBreakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useBreakpoint.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5D,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,aAAa,GAAI,gBAAe,UAAiB;;aAoDhC,UAAU;eAUR,UAAU;qBAUJ,UAAU,SAAS,UAAU;eAUnC,UAAU;CAiCzC,CAAC"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as c, useMemo as y, useEffect as r, useCallback as m } from "react";
|
|
3
3
|
const e = {
|
|
4
4
|
sm: 640,
|
|
5
5
|
md: 768,
|
|
6
6
|
lg: 1024,
|
|
7
7
|
xl: 1280,
|
|
8
8
|
"2xl": 1536
|
|
9
|
-
}, q = (
|
|
10
|
-
const [i,
|
|
9
|
+
}, q = (x = "lg") => {
|
|
10
|
+
const [i, h] = c(x), [d, l] = c(!1), a = y(() => {
|
|
11
11
|
const t = {};
|
|
12
12
|
return typeof window < "u" && (t.sm = window.matchMedia(`(max-width: ${e.md - 1}px)`), t.md = window.matchMedia(`(min-width: ${e.md}px) and (max-width: ${e.lg - 1}px)`), t.lg = window.matchMedia(`(min-width: ${e.lg}px) and (max-width: ${e.xl - 1}px)`), t.xl = window.matchMedia(`(min-width: ${e.xl}px) and (max-width: ${e["2xl"] - 1}px)`), t["2xl"] = window.matchMedia(`(min-width: ${e["2xl"]}px)`)), t;
|
|
13
13
|
}, []);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, []),
|
|
14
|
+
r(() => {
|
|
15
|
+
l(!0);
|
|
16
|
+
}, []), r(() => {
|
|
17
17
|
if (typeof window > "u" || !d) return;
|
|
18
18
|
const t = () => {
|
|
19
|
-
var m, o, s, c;
|
|
20
19
|
let n = "sm";
|
|
21
|
-
|
|
20
|
+
a["2xl"]?.matches ? n = "2xl" : a.xl?.matches ? n = "xl" : a.lg?.matches ? n = "lg" : a.md?.matches ? n = "md" : n = "sm", h(n);
|
|
22
21
|
};
|
|
23
22
|
return t(), Object.values(a).forEach((n) => {
|
|
24
23
|
n && n.addEventListener("change", t);
|
|
@@ -28,19 +27,19 @@ const e = {
|
|
|
28
27
|
});
|
|
29
28
|
};
|
|
30
29
|
}, [a, d]);
|
|
31
|
-
const
|
|
30
|
+
const u = m((t) => typeof window > "u" || !d ? e[i] >= e[t] : window.matchMedia(`(min-width: ${e[t]}px)`).matches, [d, i]), f = m((t) => typeof window > "u" || !d ? e[i] < e[t] : window.matchMedia(`(max-width: ${e[t] - 1}px)`).matches, [d, i]), p = m((t, n) => typeof window > "u" || !d ? e[i] >= e[t] && e[i] < e[n] : window.matchMedia(`(min-width: ${e[t]}px) and (max-width: ${e[n] - 1}px)`).matches, [d, i]), $ = m((t) => {
|
|
32
31
|
if (typeof window > "u" || !d)
|
|
33
32
|
return i === t;
|
|
34
|
-
const n = Object.keys(e),
|
|
33
|
+
const n = Object.keys(e), o = n.indexOf(t), w = n[o + 1];
|
|
35
34
|
let s;
|
|
36
|
-
return
|
|
35
|
+
return o === 0 ? s = `(max-width: ${e.md - 1}px)` : w ? s = `(min-width: ${e[t]}px) and (max-width: ${e[w] - 1}px)` : s = `(min-width: ${e[t]}px)`, window.matchMedia(s).matches;
|
|
37
36
|
}, [d, i]);
|
|
38
37
|
return {
|
|
39
38
|
breakpoint: i,
|
|
40
|
-
up:
|
|
41
|
-
down:
|
|
42
|
-
between:
|
|
43
|
-
only:
|
|
39
|
+
up: u,
|
|
40
|
+
down: f,
|
|
41
|
+
between: p,
|
|
42
|
+
only: $
|
|
44
43
|
};
|
|
45
44
|
};
|
|
46
45
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoint.js","sources":["../../../src/components/hooks/useBreakpoint.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useState, useCallback, useMemo } from \"react\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\n\nexport const BREAKPOINTS = {\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n \"2xl\": 1536,\n};\n\n/**\n * A responsive breakpoint hook using window.matchMedia for optimal performance.\n *\n * @param ssrBreakpoint - The breakpoint to use during SSR and before hydration.\n * Defaults to \"lg\" for better SEO (search engines typically use desktop viewports).\n *\n * @example\n * ```tsx\n * // Default: uses \"lg\" for SSR\n * const bp = useBreakpoint();\n *\n * // Custom SSR breakpoint\n * const bp = useBreakpoint(\"md\");\n *\n * // Usage\n * bp.breakpoint // Current breakpoint: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\"\n * bp.up(\"md\") // true if screen >= 768px\n * bp.down(\"lg\") // true if screen < 1024px\n * bp.between(\"md\", \"xl\") // true if 768px <= screen < 1280px\n * bp.only(\"lg\") // true if screen is exactly in \"lg\" range\n * ```\n */\nexport const useBreakpoint = (ssrBreakpoint: Breakpoint = \"lg\") => {\n const [breakpoint, setBreakpoint] = useState<Breakpoint>(ssrBreakpoint);\n const [isHydrated, setIsHydrated] = useState(false);\n\n // Generate media queries\n const mediaQueries = useMemo(() => {\n const queries: Record<Breakpoint, MediaQueryList> = {} as any;\n if (typeof window !== 'undefined') {\n queries.sm = window.matchMedia(`(max-width: ${BREAKPOINTS.md - 1}px)`);\n queries.md = window.matchMedia(`(min-width: ${BREAKPOINTS.md}px) and (max-width: ${BREAKPOINTS.lg - 1}px)`);\n queries.lg = window.matchMedia(`(min-width: ${BREAKPOINTS.lg}px) and (max-width: ${BREAKPOINTS.xl - 1}px)`);\n queries.xl = window.matchMedia(`(min-width: ${BREAKPOINTS.xl}px) and (max-width: ${BREAKPOINTS[\"2xl\"] - 1}px)`);\n queries[\"2xl\"] = window.matchMedia(`(min-width: ${BREAKPOINTS[\"2xl\"]}px)`);\n }\n return queries;\n }, []);\n\n useEffect(() => {\n setIsHydrated(true);\n }, []);\n\n useEffect(() => {\n if (typeof window === 'undefined' || !isHydrated) return;\n\n const updateBreakpoint = () => {\n let currentBp: Breakpoint = \"sm\";\n\n if (mediaQueries[\"2xl\"]?.matches) currentBp = \"2xl\";\n else if (mediaQueries.xl?.matches) currentBp = \"xl\";\n else if (mediaQueries.lg?.matches) currentBp = \"lg\";\n else if (mediaQueries.md?.matches) currentBp = \"md\";\n else currentBp = \"sm\";\n\n setBreakpoint(currentBp);\n };\n\n // Initial check\n updateBreakpoint();\n\n // Add listeners\n Object.values(mediaQueries).forEach(mq => {\n if (mq) mq.addEventListener('change', updateBreakpoint);\n });\n\n return () => {\n Object.values(mediaQueries).forEach(mq => {\n if (mq) mq.removeEventListener('change', updateBreakpoint);\n });\n };\n }, [mediaQueries, isHydrated]);\n\n // Min width check: is current width >= breakpoint\n const up = useCallback((bp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if ssrBreakpoint >= bp\n return BREAKPOINTS[breakpoint] >= BREAKPOINTS[bp];\n }\n const mq = window.matchMedia(`(min-width: ${BREAKPOINTS[bp]}px)`);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n // Max width check: is current width < breakpoint\n const down = useCallback((bp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if ssrBreakpoint < bp\n return BREAKPOINTS[breakpoint] < BREAKPOINTS[bp];\n }\n const mq = window.matchMedia(`(max-width: ${BREAKPOINTS[bp] - 1}px)`);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n // Range check: is current width between min and max breakpoints\n const between = useCallback((minBp: Breakpoint, maxBp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if minBp <= ssrBreakpoint < maxBp\n return BREAKPOINTS[breakpoint] >= BREAKPOINTS[minBp] && BREAKPOINTS[breakpoint] < BREAKPOINTS[maxBp];\n }\n const mq = window.matchMedia(`(min-width: ${BREAKPOINTS[minBp]}px) and (max-width: ${BREAKPOINTS[maxBp] - 1}px)`);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n // Only check: is current width only within this breakpoint range\n const only = useCallback((bp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if ssrBreakpoint === bp\n return breakpoint === bp;\n }\n\n const breakpointKeys = Object.keys(BREAKPOINTS) as Breakpoint[];\n const currentIndex = breakpointKeys.indexOf(bp);\n const nextBp = breakpointKeys[currentIndex + 1];\n\n let query: string;\n if (currentIndex === 0) {\n // For 'sm', check if width < md\n query = `(max-width: ${BREAKPOINTS.md - 1}px)`;\n } else if (!nextBp) {\n // For highest breakpoint, check if width >= current\n query = `(min-width: ${BREAKPOINTS[bp]}px)`;\n } else {\n // For middle breakpoints, check range\n query = `(min-width: ${BREAKPOINTS[bp]}px) and (max-width: ${BREAKPOINTS[nextBp] - 1}px)`;\n }\n\n const mq = window.matchMedia(query);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n return {\n breakpoint,\n up,\n down,\n between,\n only,\n };\n};\n"],"names":["BREAKPOINTS","useBreakpoint","ssrBreakpoint","breakpoint","setBreakpoint","useState","isHydrated","setIsHydrated","mediaQueries","useMemo","queries","useEffect","updateBreakpoint","currentBp","
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","sources":["../../../src/components/hooks/useBreakpoint.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useState, useCallback, useMemo } from \"react\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\n\nexport const BREAKPOINTS = {\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n \"2xl\": 1536,\n};\n\n/**\n * A responsive breakpoint hook using window.matchMedia for optimal performance.\n *\n * @param ssrBreakpoint - The breakpoint to use during SSR and before hydration.\n * Defaults to \"lg\" for better SEO (search engines typically use desktop viewports).\n *\n * @example\n * ```tsx\n * // Default: uses \"lg\" for SSR\n * const bp = useBreakpoint();\n *\n * // Custom SSR breakpoint\n * const bp = useBreakpoint(\"md\");\n *\n * // Usage\n * bp.breakpoint // Current breakpoint: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\"\n * bp.up(\"md\") // true if screen >= 768px\n * bp.down(\"lg\") // true if screen < 1024px\n * bp.between(\"md\", \"xl\") // true if 768px <= screen < 1280px\n * bp.only(\"lg\") // true if screen is exactly in \"lg\" range\n * ```\n */\nexport const useBreakpoint = (ssrBreakpoint: Breakpoint = \"lg\") => {\n const [breakpoint, setBreakpoint] = useState<Breakpoint>(ssrBreakpoint);\n const [isHydrated, setIsHydrated] = useState(false);\n\n // Generate media queries\n const mediaQueries = useMemo(() => {\n const queries: Record<Breakpoint, MediaQueryList> = {} as any;\n if (typeof window !== 'undefined') {\n queries.sm = window.matchMedia(`(max-width: ${BREAKPOINTS.md - 1}px)`);\n queries.md = window.matchMedia(`(min-width: ${BREAKPOINTS.md}px) and (max-width: ${BREAKPOINTS.lg - 1}px)`);\n queries.lg = window.matchMedia(`(min-width: ${BREAKPOINTS.lg}px) and (max-width: ${BREAKPOINTS.xl - 1}px)`);\n queries.xl = window.matchMedia(`(min-width: ${BREAKPOINTS.xl}px) and (max-width: ${BREAKPOINTS[\"2xl\"] - 1}px)`);\n queries[\"2xl\"] = window.matchMedia(`(min-width: ${BREAKPOINTS[\"2xl\"]}px)`);\n }\n return queries;\n }, []);\n\n useEffect(() => {\n setIsHydrated(true);\n }, []);\n\n useEffect(() => {\n if (typeof window === 'undefined' || !isHydrated) return;\n\n const updateBreakpoint = () => {\n let currentBp: Breakpoint = \"sm\";\n\n if (mediaQueries[\"2xl\"]?.matches) currentBp = \"2xl\";\n else if (mediaQueries.xl?.matches) currentBp = \"xl\";\n else if (mediaQueries.lg?.matches) currentBp = \"lg\";\n else if (mediaQueries.md?.matches) currentBp = \"md\";\n else currentBp = \"sm\";\n\n setBreakpoint(currentBp);\n };\n\n // Initial check\n updateBreakpoint();\n\n // Add listeners\n Object.values(mediaQueries).forEach(mq => {\n if (mq) mq.addEventListener('change', updateBreakpoint);\n });\n\n return () => {\n Object.values(mediaQueries).forEach(mq => {\n if (mq) mq.removeEventListener('change', updateBreakpoint);\n });\n };\n }, [mediaQueries, isHydrated]);\n\n // Min width check: is current width >= breakpoint\n const up = useCallback((bp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if ssrBreakpoint >= bp\n return BREAKPOINTS[breakpoint] >= BREAKPOINTS[bp];\n }\n const mq = window.matchMedia(`(min-width: ${BREAKPOINTS[bp]}px)`);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n // Max width check: is current width < breakpoint\n const down = useCallback((bp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if ssrBreakpoint < bp\n return BREAKPOINTS[breakpoint] < BREAKPOINTS[bp];\n }\n const mq = window.matchMedia(`(max-width: ${BREAKPOINTS[bp] - 1}px)`);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n // Range check: is current width between min and max breakpoints\n const between = useCallback((minBp: Breakpoint, maxBp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if minBp <= ssrBreakpoint < maxBp\n return BREAKPOINTS[breakpoint] >= BREAKPOINTS[minBp] && BREAKPOINTS[breakpoint] < BREAKPOINTS[maxBp];\n }\n const mq = window.matchMedia(`(min-width: ${BREAKPOINTS[minBp]}px) and (max-width: ${BREAKPOINTS[maxBp] - 1}px)`);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n // Only check: is current width only within this breakpoint range\n const only = useCallback((bp: Breakpoint) => {\n if (typeof window === 'undefined' || !isHydrated) {\n // SSR fallback: check if ssrBreakpoint === bp\n return breakpoint === bp;\n }\n\n const breakpointKeys = Object.keys(BREAKPOINTS) as Breakpoint[];\n const currentIndex = breakpointKeys.indexOf(bp);\n const nextBp = breakpointKeys[currentIndex + 1];\n\n let query: string;\n if (currentIndex === 0) {\n // For 'sm', check if width < md\n query = `(max-width: ${BREAKPOINTS.md - 1}px)`;\n } else if (!nextBp) {\n // For highest breakpoint, check if width >= current\n query = `(min-width: ${BREAKPOINTS[bp]}px)`;\n } else {\n // For middle breakpoints, check range\n query = `(min-width: ${BREAKPOINTS[bp]}px) and (max-width: ${BREAKPOINTS[nextBp] - 1}px)`;\n }\n\n const mq = window.matchMedia(query);\n return mq.matches;\n }, [isHydrated, breakpoint]);\n\n return {\n breakpoint,\n up,\n down,\n between,\n only,\n };\n};\n"],"names":["BREAKPOINTS","useBreakpoint","ssrBreakpoint","breakpoint","setBreakpoint","useState","isHydrated","setIsHydrated","mediaQueries","useMemo","queries","useEffect","updateBreakpoint","currentBp","mq","up","useCallback","bp","down","between","minBp","maxBp","only","breakpointKeys","currentIndex","nextBp","query"],"mappings":";;AAKO,MAAMA,IAAc;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AACT,GAwBaC,IAAgB,CAACC,IAA4B,SAAS;AACjE,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAqBH,CAAa,GAChE,CAACI,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAG5CG,IAAeC,EAAQ,MAAM;AACjC,UAAMC,IAA8C,CAAA;AACpD,WAAI,OAAO,SAAW,QACpBA,EAAQ,KAAK,OAAO,WAAW,eAAeV,EAAY,KAAK,CAAC,KAAK,GACrEU,EAAQ,KAAK,OAAO,WAAW,eAAeV,EAAY,EAAE,uBAAuBA,EAAY,KAAK,CAAC,KAAK,GAC1GU,EAAQ,KAAK,OAAO,WAAW,eAAeV,EAAY,EAAE,uBAAuBA,EAAY,KAAK,CAAC,KAAK,GAC1GU,EAAQ,KAAK,OAAO,WAAW,eAAeV,EAAY,EAAE,uBAAuBA,EAAY,KAAK,IAAI,CAAC,KAAK,GAC9GU,EAAQ,KAAK,IAAI,OAAO,WAAW,eAAeV,EAAY,KAAK,CAAC,KAAK,IAEpEU;AAAA,EACT,GAAG,CAAA,CAAE;AAEL,EAAAC,EAAU,MAAM;AACd,IAAAJ,EAAc,EAAI;AAAA,EACpB,GAAG,CAAA,CAAE,GAELI,EAAU,MAAM;AACd,QAAI,OAAO,SAAW,OAAe,CAACL,EAAY;AAElD,UAAMM,IAAmB,MAAM;AAC7B,UAAIC,IAAwB;AAE5B,MAAIL,EAAa,KAAK,GAAG,UAASK,IAAY,QACrCL,EAAa,IAAI,UAASK,IAAY,OACtCL,EAAa,IAAI,UAASK,IAAY,OACtCL,EAAa,IAAI,UAASK,IAAY,OAC1CA,IAAY,MAEjBT,EAAcS,CAAS;AAAA,IACzB;AAGA,WAAAD,EAAA,GAGA,OAAO,OAAOJ,CAAY,EAAE,QAAQ,CAAAM,MAAM;AACxC,MAAIA,KAAIA,EAAG,iBAAiB,UAAUF,CAAgB;AAAA,IACxD,CAAC,GAEM,MAAM;AACX,aAAO,OAAOJ,CAAY,EAAE,QAAQ,CAAAM,MAAM;AACxC,QAAIA,KAAIA,EAAG,oBAAoB,UAAUF,CAAgB;AAAA,MAC3D,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAACJ,GAAcF,CAAU,CAAC;AAG7B,QAAMS,IAAKC,EAAY,CAACC,MAClB,OAAO,SAAW,OAAe,CAACX,IAE7BN,EAAYG,CAAU,KAAKH,EAAYiB,CAAE,IAEvC,OAAO,WAAW,eAAejB,EAAYiB,CAAE,CAAC,KAAK,EACtD,SACT,CAACX,GAAYH,CAAU,CAAC,GAGrBe,IAAOF,EAAY,CAACC,MACpB,OAAO,SAAW,OAAe,CAACX,IAE7BN,EAAYG,CAAU,IAAIH,EAAYiB,CAAE,IAEtC,OAAO,WAAW,eAAejB,EAAYiB,CAAE,IAAI,CAAC,KAAK,EAC1D,SACT,CAACX,GAAYH,CAAU,CAAC,GAGrBgB,IAAUH,EAAY,CAACI,GAAmBC,MAC1C,OAAO,SAAW,OAAe,CAACf,IAE7BN,EAAYG,CAAU,KAAKH,EAAYoB,CAAK,KAAKpB,EAAYG,CAAU,IAAIH,EAAYqB,CAAK,IAE1F,OAAO,WAAW,eAAerB,EAAYoB,CAAK,CAAC,uBAAuBpB,EAAYqB,CAAK,IAAI,CAAC,KAAK,EACtG,SACT,CAACf,GAAYH,CAAU,CAAC,GAGrBmB,IAAON,EAAY,CAACC,MAAmB;AAC3C,QAAI,OAAO,SAAW,OAAe,CAACX;AAEpC,aAAOH,MAAec;AAGxB,UAAMM,IAAiB,OAAO,KAAKvB,CAAW,GACxCwB,IAAeD,EAAe,QAAQN,CAAE,GACxCQ,IAASF,EAAeC,IAAe,CAAC;AAE9C,QAAIE;AACJ,WAAIF,MAAiB,IAEnBE,IAAQ,eAAe1B,EAAY,KAAK,CAAC,QAC/ByB,IAKVC,IAAQ,eAAe1B,EAAYiB,CAAE,CAAC,uBAAuBjB,EAAYyB,CAAM,IAAI,CAAC,QAHpFC,IAAQ,eAAe1B,EAAYiB,CAAE,CAAC,OAM7B,OAAO,WAAWS,CAAK,EACxB;AAAA,EACZ,GAAG,CAACpB,GAAYH,CAAU,CAAC;AAE3B,SAAO;AAAA,IACL,YAAAA;AAAA,IACA,IAAAY;AAAA,IACA,MAAAG;AAAA,IACA,SAAAC;AAAA,IACA,MAAAG;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCSSVariables.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useCSSVariables.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,GAAG,MAAM,EAAE,2BAQ3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCSSVariables.js","sources":["../../../src/components/hooks/useCSSVariables.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Get CSS variables from the document\n * @param variables CSS variable names\n * @returns CSS variable values\n */\nexport const useCSSVariables = (variables: string | string[]) => {\n const variablesList = Array.isArray(variables) ? variables : [variables];\n const el = window.getComputedStyle(document.body);\n return variablesList.reduce((acc, variable) => {\n const variableName = variable.startsWith(\"--\") ? variable : `--${variable}`;\n acc[variableName] = el.getPropertyValue(variableName);\n return acc;\n }, {} as Record<string, string>);\n};\n"],"names":["useCSSVariables","variables","variablesList","el","acc","variable","variableName"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useCSSVariables.js","sources":["../../../src/components/hooks/useCSSVariables.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Get CSS variables from the document\n * @param variables CSS variable names\n * @returns CSS variable values\n */\nexport const useCSSVariables = (variables: string | string[]) => {\n const variablesList = Array.isArray(variables) ? variables : [variables];\n const el = window.getComputedStyle(document.body);\n return variablesList.reduce((acc, variable) => {\n const variableName = variable.startsWith(\"--\") ? variable : `--${variable}`;\n acc[variableName] = el.getPropertyValue(variableName);\n return acc;\n }, {} as Record<string, string>);\n};\n"],"names":["useCSSVariables","variables","variablesList","el","acc","variable","variableName"],"mappings":";AAOO,MAAMA,IAAkB,CAACC,MAAiC;AAC/D,QAAMC,IAAgB,MAAM,QAAQD,CAAS,IAAIA,IAAY,CAACA,CAAS,GACjEE,IAAK,OAAO,iBAAiB,SAAS,IAAI;AAChD,SAAOD,EAAc,OAAO,CAACE,GAAKC,MAAa;AAC7C,UAAMC,IAAeD,EAAS,WAAW,IAAI,IAAIA,IAAW,KAAKA,CAAQ;AACzE,WAAAD,EAAIE,CAAY,IAAIH,EAAG,iBAAiBG,CAAY,GAC7CF;AAAA,EACT,GAAG,CAAA,CAA4B;AACjC;"}
|