@nexus-cross/design-system 1.0.6-beta.2 → 1.0.7
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/DESIGN.md +185 -0
- package/cursor-rules/nexus-ui-api.mdc +223 -7
- package/cursor-rules/nexus-ui-components.mdc +44 -17
- package/dist/alert.js +16 -0
- package/dist/alert.mjs +3 -0
- package/dist/badge.js +16 -0
- package/dist/badge.mjs +3 -0
- package/dist/breadcrumb.js +12 -0
- package/dist/breadcrumb.mjs +3 -0
- package/dist/chunks/chunk-22O6YUYH.mjs +5 -0
- package/dist/chunks/chunk-2N2EPBO4.js +120 -0
- package/dist/chunks/{chunk-AFSEYJZT.js → chunk-2T7RUYEK.js} +175 -50
- package/dist/chunks/chunk-2UPGFY6E.mjs +76 -0
- package/dist/chunks/{chunk-VGO4Z2WH.js → chunk-3RK3UT2O.js} +50 -12
- package/dist/chunks/chunk-3ZWN66YH.js +53 -0
- package/dist/chunks/chunk-5PQ3UCKF.js +99 -0
- package/dist/chunks/chunk-6BWOKTVQ.mjs +87 -0
- package/dist/chunks/chunk-6DBRL6NA.mjs +81 -0
- package/dist/chunks/{chunk-HNLI646G.mjs → chunk-AAITRHED.mjs} +51 -13
- package/dist/chunks/chunk-B5O6W3Z4.mjs +73 -0
- package/dist/chunks/chunk-BJM3NDT2.mjs +368 -0
- package/dist/chunks/chunk-C2DSAJTL.js +109 -0
- package/dist/chunks/chunk-CUTMLBC3.mjs +86 -0
- package/dist/chunks/chunk-CV4GMFWP.js +174 -0
- package/dist/chunks/chunk-DICN6GKE.js +99 -0
- package/dist/chunks/chunk-DYPPVXQF.js +143 -0
- package/dist/chunks/chunk-EJY7IVSK.mjs +31 -0
- package/dist/chunks/chunk-FUIBYZZ4.mjs +98 -0
- package/dist/chunks/chunk-H2G5FMRN.mjs +75 -0
- package/dist/chunks/chunk-H2V7RHYV.mjs +120 -0
- package/dist/chunks/chunk-MMCA33FW.mjs +85 -0
- package/dist/chunks/chunk-NZHK76R3.js +109 -0
- package/dist/chunks/chunk-OE5BAEBE.js +7 -0
- package/dist/chunks/chunk-P73MEU7N.mjs +150 -0
- package/dist/chunks/chunk-PDJTSQOC.js +59 -0
- package/dist/chunks/chunk-S2GMEC43.js +109 -0
- package/dist/chunks/chunk-X3CTJ7TD.js +108 -0
- package/dist/chunks/chunk-XGIJZ3NZ.js +160 -0
- package/dist/chunks/chunk-YO5MSDPX.mjs +36 -0
- package/dist/chunks/chunk-ZI4LN2B2.js +96 -0
- package/dist/chunks/chunk-ZU4AWAFT.mjs +137 -0
- package/dist/component-tokens/button.d.ts +3 -0
- package/dist/component-tokens/button.d.ts.map +1 -0
- package/dist/component-tokens/index.d.ts +3 -0
- package/dist/component-tokens/index.d.ts.map +1 -0
- package/dist/component-tokens/types.d.ts +19 -0
- package/dist/component-tokens/types.d.ts.map +1 -0
- package/dist/{accordion.d.mts → components/Accordion.d.ts} +2 -3
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Alert.d.ts +16 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/{avatar.d.mts → components/Avatar.d.ts} +5 -6
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Badge.d.ts +17 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Breadcrumb.d.ts +15 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/{button.d.mts → components/Button.d.ts} +5 -6
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/{carousel.d.mts → components/Carousel.d.ts} +5 -6
- package/dist/components/Carousel.d.ts.map +1 -0
- package/dist/{checkbox.d.mts → components/CheckBox.d.ts} +6 -7
- package/dist/components/CheckBox.d.ts.map +1 -0
- package/dist/{chip.d.mts → components/Chip.d.ts} +6 -7
- package/dist/components/Chip.d.ts.map +1 -0
- package/dist/{client-only.d.mts → components/ClientOnly.d.ts} +4 -5
- package/dist/components/ClientOnly.d.ts.map +1 -0
- package/dist/{countdown.d.mts → components/Countdown.d.ts} +3 -3
- package/dist/components/Countdown.d.ts.map +1 -0
- package/dist/{counter.d.mts → components/Counter.d.ts} +3 -3
- package/dist/components/Counter.d.ts.map +1 -0
- package/dist/{data-list.d.mts → components/DataList.d.ts} +4 -5
- package/dist/components/DataList.d.ts.map +1 -0
- package/dist/components/DatePicker.d.ts +17 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/{divider.d.mts → components/Divider.d.ts} +5 -6
- package/dist/components/Divider.d.ts.map +1 -0
- package/dist/{drawer.d.mts → components/Drawer.d.ts} +13 -15
- package/dist/components/Drawer.d.ts.map +1 -0
- package/dist/components/DropdownMenu.d.ts +30 -0
- package/dist/components/DropdownMenu.d.ts.map +1 -0
- package/dist/{ellipsis.d.mts → components/Ellipsis.d.ts} +4 -5
- package/dist/components/Ellipsis.d.ts.map +1 -0
- package/dist/components/EmptyState.d.ts +15 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/{error-boundary.d.mts → components/ErrorBoundary.d.ts} +4 -5
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/{infinite-scroll.d.mts → components/InfiniteScroll.d.ts} +5 -6
- package/dist/components/InfiniteScroll.d.ts.map +1 -0
- package/dist/{marquee.d.mts → components/Marquee.d.ts} +3 -3
- package/dist/components/Marquee.d.ts.map +1 -0
- package/dist/{number-input.d.mts → components/NumberInput.d.ts} +10 -12
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/components/NxImage.d.ts +13 -0
- package/dist/components/NxImage.d.ts.map +1 -0
- package/dist/{pagination.d.mts → components/Pagination.d.ts} +6 -7
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Popover.d.ts +23 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/{price-input.d.mts → components/PriceInput.d.ts} +5 -6
- package/dist/components/PriceInput.d.ts.map +1 -0
- package/dist/components/Progress.d.ts +17 -0
- package/dist/components/Progress.d.ts.map +1 -0
- package/dist/{radio-group.d.mts → components/RadioGroup.d.ts} +6 -7
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/{select.d.mts → components/Select.d.ts} +7 -10
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/{skeleton.d.mts → components/Skeleton.d.ts} +3 -3
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Slider.d.ts +19 -0
- package/dist/components/Slider.d.ts.map +1 -0
- package/dist/{spinner.d.mts → components/Spinner.d.ts} +3 -3
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Stepper.d.ts +19 -0
- package/dist/components/Stepper.d.ts.map +1 -0
- package/dist/{switch.d.mts → components/Switch.d.ts} +5 -6
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/{tab.d.mts → components/Tab.d.ts} +7 -9
- package/dist/components/Tab.d.ts.map +1 -0
- package/dist/components/TagInput.d.ts +20 -0
- package/dist/components/TagInput.d.ts.map +1 -0
- package/dist/components/TextArea.d.ts +18 -0
- package/dist/components/TextArea.d.ts.map +1 -0
- package/dist/{text-input.d.mts → components/TextInput.d.ts} +5 -6
- package/dist/components/TextInput.d.ts.map +1 -0
- package/dist/{theme-provider.d.mts → components/ThemeProvider.d.ts} +3 -3
- package/dist/components/ThemeProvider.d.ts.map +1 -0
- package/dist/components/ToggleGroup.d.ts +35 -0
- package/dist/components/ToggleGroup.d.ts.map +1 -0
- package/dist/{tooltip.d.mts → components/Tooltip.d.ts} +6 -10
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/{virtual-scroll.d.mts → components/VirtualScroll.d.ts} +4 -4
- package/dist/components/VirtualScroll.d.ts.map +1 -0
- package/dist/date-picker.js +12 -0
- package/dist/date-picker.mjs +3 -0
- package/dist/dropdown-menu.js +32 -0
- package/dist/dropdown-menu.mjs +3 -0
- package/dist/empty-state.js +16 -0
- package/dist/empty-state.mjs +3 -0
- package/dist/hooks/useCheckDevice.d.ts +4 -4
- package/dist/hooks/useCheckDevice.d.ts.map +1 -0
- package/dist/hooks/useClickOutside.d.ts +2 -2
- package/dist/hooks/useClickOutside.d.ts.map +1 -0
- package/dist/hooks/useDraggableBottomSheet.d.ts +3 -3
- package/dist/hooks/useDraggableBottomSheet.d.ts.map +1 -0
- package/dist/hooks/useDraggableWindow.d.ts +5 -7
- package/dist/hooks/useDraggableWindow.d.ts.map +1 -0
- package/dist/hooks/useInView.d.ts +3 -3
- package/dist/hooks/useInView.d.ts.map +1 -0
- package/dist/hooks/useModal.d.ts +48 -2
- package/dist/hooks/useModal.d.ts.map +1 -0
- package/dist/index.d.ts +100 -77
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +269 -157
- package/dist/index.mjs +30 -18
- package/dist/modal/Modal.d.ts +52 -0
- package/dist/modal/Modal.d.ts.map +1 -0
- package/dist/modal/components/ModalComponent.d.ts +22 -0
- package/dist/modal/components/ModalComponent.d.ts.map +1 -0
- package/dist/modal/components/ModalContainer.d.ts +9 -0
- package/dist/modal/components/ModalContainer.d.ts.map +1 -0
- package/dist/modal/components/ModalPortal.d.ts +8 -0
- package/dist/modal/components/ModalPortal.d.ts.map +1 -0
- package/dist/modal/components/ModalPortalTarget.d.ts +7 -0
- package/dist/modal/components/ModalPortalTarget.d.ts.map +1 -0
- package/dist/modal/components/ModalTemplate.d.ts +20 -0
- package/dist/modal/components/ModalTemplate.d.ts.map +1 -0
- package/dist/modal/components/ModalTemplate.variants.d.ts +29 -0
- package/dist/modal/components/ModalTemplate.variants.d.ts.map +1 -0
- package/dist/modal/constants.d.ts +3 -0
- package/dist/modal/constants.d.ts.map +1 -0
- package/dist/modal/index.d.ts +11 -82
- package/dist/modal/index.d.ts.map +1 -0
- package/dist/modal/index.js +12 -12
- package/dist/modal/index.mjs +3 -3
- package/dist/modal/types.d.ts +90 -0
- package/dist/modal/types.d.ts.map +1 -0
- package/dist/number-input.js +4 -4
- package/dist/number-input.mjs +1 -1
- package/dist/nx-image.js +12 -0
- package/dist/nx-image.mjs +3 -0
- package/dist/progress.js +16 -0
- package/dist/progress.mjs +3 -0
- package/dist/schemas/_all.json +840 -13
- package/dist/schemas/accordion.d.ts +67 -0
- package/dist/schemas/accordion.d.ts.map +1 -0
- package/dist/schemas/alert.d.ts +30 -0
- package/dist/schemas/alert.d.ts.map +1 -0
- package/dist/schemas/alert.json +49 -0
- package/dist/schemas/avatar.d.ts +30 -0
- package/dist/schemas/avatar.d.ts.map +1 -0
- package/dist/schemas/badge.d.ts +33 -0
- package/dist/schemas/badge.d.ts.map +1 -0
- package/dist/schemas/badge.json +76 -0
- package/dist/schemas/breadcrumb.d.ts +38 -0
- package/dist/schemas/breadcrumb.d.ts.map +1 -0
- package/dist/schemas/breadcrumb.json +47 -0
- package/dist/schemas/button.d.ts +42 -0
- package/dist/schemas/button.d.ts.map +1 -0
- package/dist/schemas/carousel.d.ts +48 -0
- package/dist/schemas/carousel.d.ts.map +1 -0
- package/dist/schemas/checkbox.d.ts +48 -0
- package/dist/schemas/checkbox.d.ts.map +1 -0
- package/dist/schemas/chip.d.ts +30 -0
- package/dist/schemas/chip.d.ts.map +1 -0
- package/dist/schemas/client-only.d.ts +12 -0
- package/dist/schemas/client-only.d.ts.map +1 -0
- package/dist/schemas/countdown.d.ts +52 -0
- package/dist/schemas/countdown.d.ts.map +1 -0
- package/dist/schemas/counter.d.ts +36 -0
- package/dist/schemas/counter.d.ts.map +1 -0
- package/dist/schemas/data-list.d.ts +33 -0
- package/dist/schemas/data-list.d.ts.map +1 -0
- package/dist/schemas/date-picker.d.ts +36 -0
- package/dist/schemas/date-picker.d.ts.map +1 -0
- package/dist/schemas/datePicker.json +56 -0
- package/dist/schemas/divider.d.ts +21 -0
- package/dist/schemas/divider.d.ts.map +1 -0
- package/dist/schemas/drawer.d.ts +95 -0
- package/dist/schemas/drawer.d.ts.map +1 -0
- package/dist/schemas/dropdown-menu.d.ts +64 -0
- package/dist/schemas/dropdown-menu.d.ts.map +1 -0
- package/dist/schemas/dropdownMenu.json +83 -0
- package/dist/schemas/ellipsis.d.ts +30 -0
- package/dist/schemas/ellipsis.d.ts.map +1 -0
- package/dist/schemas/empty-state.d.ts +27 -0
- package/dist/schemas/empty-state.d.ts.map +1 -0
- package/dist/schemas/emptyState.json +44 -0
- package/dist/schemas/error-boundary.d.ts +15 -0
- package/dist/schemas/error-boundary.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +47 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/infinite-scroll.d.ts +39 -0
- package/dist/schemas/infinite-scroll.d.ts.map +1 -0
- package/dist/schemas/marquee.d.ts +27 -0
- package/dist/schemas/marquee.d.ts.map +1 -0
- package/dist/schemas/modal.d.ts +176 -0
- package/dist/schemas/modal.d.ts.map +1 -0
- package/dist/schemas/number-input.d.ts +72 -0
- package/dist/schemas/number-input.d.ts.map +1 -0
- package/dist/schemas/numberInput.json +27 -8
- package/dist/schemas/nx-image.d.ts +33 -0
- package/dist/schemas/nx-image.d.ts.map +1 -0
- package/dist/schemas/nxImage.json +56 -0
- package/dist/schemas/pagination.d.ts +27 -0
- package/dist/schemas/pagination.d.ts.map +1 -0
- package/dist/schemas/popover.d.ts +39 -0
- package/dist/schemas/popover.d.ts.map +1 -0
- package/dist/schemas/price-input.d.ts +63 -0
- package/dist/schemas/price-input.d.ts.map +1 -0
- package/dist/schemas/progress.d.ts +30 -0
- package/dist/schemas/progress.d.ts.map +1 -0
- package/dist/schemas/progress.json +63 -0
- package/dist/schemas/radio-group.d.ts +61 -0
- package/dist/schemas/radio-group.d.ts.map +1 -0
- package/dist/schemas/select.d.ts +52 -0
- package/dist/schemas/select.d.ts.map +1 -0
- package/dist/schemas/skeleton.d.ts +27 -0
- package/dist/schemas/skeleton.d.ts.map +1 -0
- package/dist/schemas/slider.d.ts +45 -0
- package/dist/schemas/slider.d.ts.map +1 -0
- package/dist/schemas/slider.json +78 -0
- package/dist/schemas/spinner.d.ts +21 -0
- package/dist/schemas/spinner.d.ts.map +1 -0
- package/dist/schemas/stepper.d.ts +39 -0
- package/dist/schemas/stepper.d.ts.map +1 -0
- package/dist/schemas/stepper.json +73 -0
- package/dist/schemas/switch.d.ts +33 -0
- package/dist/schemas/switch.d.ts.map +1 -0
- package/dist/schemas/tab.d.ts +61 -0
- package/dist/schemas/tab.d.ts.map +1 -0
- package/dist/schemas/table.d.ts +113 -0
- package/dist/schemas/table.d.ts.map +1 -0
- package/dist/schemas/tag-input.d.ts +39 -0
- package/dist/schemas/tag-input.d.ts.map +1 -0
- package/dist/schemas/tagInput.json +70 -0
- package/dist/schemas/text-area.d.ts +69 -0
- package/dist/schemas/text-area.d.ts.map +1 -0
- package/dist/schemas/text-input.d.ts +78 -0
- package/dist/schemas/text-input.d.ts.map +1 -0
- package/dist/schemas/textArea.json +26 -1
- package/dist/schemas/theme-provider.d.ts +36 -0
- package/dist/schemas/theme-provider.d.ts.map +1 -0
- package/dist/schemas/toast.d.ts +91 -0
- package/dist/schemas/toast.d.ts.map +1 -0
- package/dist/schemas/toggle-group.d.ts +58 -0
- package/dist/schemas/toggle-group.d.ts.map +1 -0
- package/dist/schemas/toggleGroup.json +88 -0
- package/dist/schemas/tooltip.d.ts +33 -0
- package/dist/schemas/tooltip.d.ts.map +1 -0
- package/dist/schemas/virtual-scroll.d.ts +67 -0
- package/dist/schemas/virtual-scroll.d.ts.map +1 -0
- package/dist/schemas.js +177 -7
- package/dist/schemas.mjs +166 -8
- package/dist/slider.js +16 -0
- package/dist/slider.mjs +3 -0
- package/dist/stepper.js +16 -0
- package/dist/stepper.mjs +3 -0
- package/dist/styles/.generated/built.d.ts +3 -0
- package/dist/styles/.generated/built.d.ts.map +1 -0
- package/dist/styles/inject-layer.d.ts +2 -0
- package/dist/styles/inject-layer.d.ts.map +1 -0
- package/dist/styles/inject.d.ts +2 -0
- package/dist/styles/inject.d.ts.map +1 -0
- package/dist/styles/layer.js +2 -2
- package/dist/styles/layer.mjs +1 -1
- package/dist/styles.css +1655 -162
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +1655 -162
- package/dist/styles.mjs +1 -1
- package/dist/table/Table.d.ts +20 -0
- package/dist/table/Table.d.ts.map +1 -0
- package/dist/table/TableHighlightContext.d.ts +11 -0
- package/dist/table/TableHighlightContext.d.ts.map +1 -0
- package/dist/table/TableRow.d.ts +17 -0
- package/dist/table/TableRow.d.ts.map +1 -0
- package/dist/table/TdColumn.d.ts +14 -0
- package/dist/table/TdColumn.d.ts.map +1 -0
- package/dist/table/index.d.ts +23 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/types.d.ts +27 -0
- package/dist/table/types.d.ts.map +1 -0
- package/dist/table.js +7 -7
- package/dist/table.mjs +1 -1
- package/dist/tag-input.js +16 -0
- package/dist/tag-input.mjs +3 -0
- package/dist/text-area.js +3 -3
- package/dist/text-area.mjs +1 -1
- package/dist/toast/Toast.d.ts +8 -0
- package/dist/toast/Toast.d.ts.map +1 -0
- package/dist/toast/index.d.ts +6 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/{toast.d.ts → toast/useToast.d.ts} +4 -14
- package/dist/toast/useToast.d.ts.map +1 -0
- package/dist/toggle-group.js +16 -0
- package/dist/toggle-group.mjs +3 -0
- package/dist/utils/cn.d.ts +3 -5
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/scroll.d.ts +3 -4
- package/dist/utils/scroll.d.ts.map +1 -0
- package/package.json +104 -38
- package/scripts/setup-cursor-rules.cjs +15 -1
- package/dist/accordion.d.ts +0 -28
- package/dist/avatar.d.ts +0 -17
- package/dist/button.d.ts +0 -17
- package/dist/carousel.d.ts +0 -36
- package/dist/checkbox.d.ts +0 -21
- package/dist/chip.d.ts +0 -16
- package/dist/chunks/chunk-26BUGBOY.mjs +0 -57
- package/dist/chunks/chunk-CLGH2RTS.js +0 -7
- package/dist/chunks/chunk-ECVAVQUY.mjs +0 -243
- package/dist/chunks/chunk-UPCWJWXR.mjs +0 -5
- package/dist/chunks/chunk-WR55D4ZS.js +0 -80
- package/dist/client-only.d.ts +0 -13
- package/dist/countdown.d.ts +0 -27
- package/dist/counter.d.ts +0 -15
- package/dist/data-list.d.ts +0 -33
- package/dist/divider.d.ts +0 -14
- package/dist/drawer.d.ts +0 -42
- package/dist/ellipsis.d.ts +0 -16
- package/dist/error-boundary.d.ts +0 -20
- package/dist/hooks/useCheckDevice.d.mts +0 -47
- package/dist/hooks/useClickOutside.d.mts +0 -12
- package/dist/hooks/useDraggableBottomSheet.d.mts +0 -24
- package/dist/hooks/useDraggableWindow.d.mts +0 -21
- package/dist/hooks/useInView.d.mts +0 -14
- package/dist/hooks/useModal.d.mts +0 -2
- package/dist/index.d.mts +0 -77
- package/dist/infinite-scroll.d.ts +0 -26
- package/dist/marquee.d.ts +0 -12
- package/dist/modal/index.d.mts +0 -87
- package/dist/number-input.d.ts +0 -38
- package/dist/pagination.d.ts +0 -22
- package/dist/popover.d.mts +0 -25
- package/dist/popover.d.ts +0 -25
- package/dist/price-input.d.ts +0 -36
- package/dist/radio-group.d.ts +0 -29
- package/dist/schemas.d.mts +0 -1689
- package/dist/schemas.d.ts +0 -1689
- package/dist/select.d.ts +0 -31
- package/dist/skeleton.d.ts +0 -15
- package/dist/spinner.d.ts +0 -9
- package/dist/styles/layer.d.mts +0 -3
- package/dist/styles/layer.d.ts +0 -3
- package/dist/styles.d.mts +0 -3
- package/dist/styles.d.ts +0 -3
- package/dist/switch.d.ts +0 -15
- package/dist/tab.d.ts +0 -36
- package/dist/table.d.mts +0 -80
- package/dist/table.d.ts +0 -80
- package/dist/text-area.d.mts +0 -15
- package/dist/text-area.d.ts +0 -15
- package/dist/text-input.d.ts +0 -21
- package/dist/theme-provider.d.ts +0 -25
- package/dist/toast.d.mts +0 -42
- package/dist/tooltip.d.ts +0 -24
- package/dist/useModal-BsGIcP8t.d.mts +0 -128
- package/dist/useModal-BsGIcP8t.d.ts +0 -128
- package/dist/utils/cn.d.mts +0 -5
- package/dist/utils/scroll.d.mts +0 -4
- package/dist/virtual-scroll.d.ts +0 -34
- package/dist/chunks/{chunk-3VFBPFZF.mjs → chunk-CWMLTXOH.mjs} +2 -2
- package/dist/chunks/{chunk-U53UA76K.js → chunk-HFBTS42N.js} +2 -2
|
@@ -27,21 +27,62 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
27
27
|
|
|
28
28
|
var numberInputVariants = classVarianceAuthority.cva("nexus-number-input", {
|
|
29
29
|
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
basic: "nexus-number-input--basic",
|
|
32
|
+
bind: "nexus-number-input--bind"
|
|
33
|
+
},
|
|
30
34
|
size: {
|
|
31
|
-
sm: "nexus-number-input--sm",
|
|
32
|
-
md: "nexus-number-input--md",
|
|
33
35
|
lg: "nexus-number-input--lg",
|
|
34
36
|
xl: "nexus-number-input--xl"
|
|
35
|
-
},
|
|
36
|
-
state: {
|
|
37
|
-
default: "nexus-number-input--default",
|
|
38
|
-
error: "nexus-number-input--error"
|
|
39
37
|
}
|
|
40
38
|
},
|
|
41
|
-
defaultVariants: {
|
|
39
|
+
defaultVariants: { variant: "basic", size: "lg" }
|
|
42
40
|
});
|
|
43
|
-
var
|
|
44
|
-
var
|
|
41
|
+
var CHEVRON_PATH = "M3.606.179C3.82-.06 4.18-.06 4.394.179L7.846 4.01C8.18 4.382 7.934 5 7.452 5H.548C.066 5-.18 4.382.154 4.01L3.606.179Z";
|
|
42
|
+
var ChevronUpIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
className: "nexus-number-input__chevron-icon",
|
|
46
|
+
viewBox: "0 0 8 5",
|
|
47
|
+
fill: "currentColor",
|
|
48
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: CHEVRON_PATH })
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
var ChevronDownIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
"svg",
|
|
53
|
+
{
|
|
54
|
+
className: "nexus-number-input__chevron-icon nexus-number-input__chevron-icon--down",
|
|
55
|
+
viewBox: "0 0 8 5",
|
|
56
|
+
fill: "currentColor",
|
|
57
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: CHEVRON_PATH })
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
var MinusIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
"svg",
|
|
62
|
+
{
|
|
63
|
+
className: "nexus-number-input__bind-icon",
|
|
64
|
+
viewBox: "0 0 16 16",
|
|
65
|
+
fill: "none",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: "1.33",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round",
|
|
70
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.333 8h9.334" })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
var PlusIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
"svg",
|
|
75
|
+
{
|
|
76
|
+
className: "nexus-number-input__bind-icon",
|
|
77
|
+
viewBox: "0 0 16 16",
|
|
78
|
+
fill: "none",
|
|
79
|
+
stroke: "currentColor",
|
|
80
|
+
strokeWidth: "1.33",
|
|
81
|
+
strokeLinecap: "round",
|
|
82
|
+
strokeLinejoin: "round",
|
|
83
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.333 8h9.334M8 3.333v9.334" })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
45
86
|
function clampValue(val, min, max) {
|
|
46
87
|
let result = val;
|
|
47
88
|
if (min !== void 0) result = Math.max(min, result);
|
|
@@ -65,6 +106,7 @@ function numberInputBind(ref, direction) {
|
|
|
65
106
|
var NumberInput = React__namespace.forwardRef(
|
|
66
107
|
({
|
|
67
108
|
className,
|
|
109
|
+
variant = "basic",
|
|
68
110
|
size,
|
|
69
111
|
error,
|
|
70
112
|
value,
|
|
@@ -72,6 +114,9 @@ var NumberInput = React__namespace.forwardRef(
|
|
|
72
114
|
max,
|
|
73
115
|
step = 1,
|
|
74
116
|
digit = 0,
|
|
117
|
+
label,
|
|
118
|
+
description,
|
|
119
|
+
showMax,
|
|
75
120
|
hideButtons = false,
|
|
76
121
|
disabled,
|
|
77
122
|
readOnly,
|
|
@@ -80,8 +125,9 @@ var NumberInput = React__namespace.forwardRef(
|
|
|
80
125
|
...props
|
|
81
126
|
}, ref) => {
|
|
82
127
|
const inputRef = React__namespace.useRef(null);
|
|
83
|
-
const
|
|
84
|
-
|
|
128
|
+
const [internalValue, setInternalValue] = React__namespace.useState(
|
|
129
|
+
value?.toString() ?? ""
|
|
130
|
+
);
|
|
85
131
|
const internalValueRef = React__namespace.useRef(internalValue);
|
|
86
132
|
const timeoutRef = React__namespace.useRef(null);
|
|
87
133
|
const pressCountRef = React__namespace.useRef(0);
|
|
@@ -189,72 +235,151 @@ var NumberInput = React__namespace.forwardRef(
|
|
|
189
235
|
}),
|
|
190
236
|
[step]
|
|
191
237
|
);
|
|
192
|
-
const
|
|
193
|
-
|
|
238
|
+
const handleMaxClick = React__namespace.useCallback(() => {
|
|
239
|
+
if (disabled || readOnly || max === void 0) return;
|
|
240
|
+
const maxStr = max.toString();
|
|
241
|
+
internalValueRef.current = maxStr;
|
|
242
|
+
setInternalValue(maxStr);
|
|
243
|
+
onValueChange?.(max);
|
|
244
|
+
inputRef.current?.focus();
|
|
245
|
+
}, [disabled, readOnly, max, onValueChange]);
|
|
194
246
|
const numValue = parseFloat(internalValue) || 0;
|
|
195
247
|
const isMinDisabled = min !== void 0 && numValue <= min;
|
|
196
248
|
const isMaxDisabled = max !== void 0 && numValue >= max;
|
|
249
|
+
const isMaxExceeded = max !== void 0 && numValue > max;
|
|
250
|
+
const displayMax = showMax ?? max !== void 0;
|
|
251
|
+
const showHeader = !!label || displayMax;
|
|
252
|
+
const isError = error || isMaxExceeded;
|
|
253
|
+
const showBtns = !hideButtons && !readOnly;
|
|
254
|
+
const isBasic = variant !== "bind";
|
|
197
255
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
198
256
|
"div",
|
|
199
257
|
{
|
|
200
258
|
className: chunkCZC76ZD5_js.cn(
|
|
201
|
-
numberInputVariants({
|
|
259
|
+
numberInputVariants({ variant, size }),
|
|
260
|
+
isError && "nexus-number-input--error",
|
|
202
261
|
disabled && "nexus-number-input--disabled",
|
|
203
262
|
className
|
|
204
263
|
),
|
|
205
264
|
children: [
|
|
206
|
-
/* @__PURE__ */ jsxRuntime.
|
|
207
|
-
"
|
|
208
|
-
|
|
209
|
-
ref: inputRef,
|
|
210
|
-
type: "text",
|
|
211
|
-
inputMode: "decimal",
|
|
212
|
-
role: "spinbutton",
|
|
213
|
-
className: chunkCZC76ZD5_js.cn("nexus-number-input__field", padSize),
|
|
214
|
-
value: internalValue,
|
|
215
|
-
disabled,
|
|
216
|
-
readOnly,
|
|
217
|
-
placeholder,
|
|
218
|
-
"aria-invalid": error || void 0,
|
|
219
|
-
"aria-valuemin": min,
|
|
220
|
-
"aria-valuemax": max,
|
|
221
|
-
"aria-valuenow": internalValue ? parseFloat(internalValue) || void 0 : void 0,
|
|
222
|
-
onChange: handleInputChange,
|
|
223
|
-
onBlur: handleBlur,
|
|
224
|
-
onKeyDown: handleKeyDown,
|
|
225
|
-
...props
|
|
226
|
-
}
|
|
227
|
-
),
|
|
228
|
-
showButtons && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-number-input__buttons", children: [
|
|
229
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-number-input__header", children: [
|
|
266
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-number-input__label", children: label }),
|
|
267
|
+
displayMax && max !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
230
268
|
"button",
|
|
231
269
|
{
|
|
232
270
|
type: "button",
|
|
271
|
+
className: "nexus-number-input__max",
|
|
272
|
+
onClick: handleMaxClick,
|
|
273
|
+
disabled: disabled || readOnly,
|
|
233
274
|
tabIndex: -1,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-number-input__max-text", children: "Max" }),
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
278
|
+
"span",
|
|
279
|
+
{
|
|
280
|
+
className: chunkCZC76ZD5_js.cn(
|
|
281
|
+
"nexus-number-input__max-value",
|
|
282
|
+
isMaxExceeded && "nexus-number-input__max-value--exceeded"
|
|
283
|
+
),
|
|
284
|
+
children: max
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] }),
|
|
291
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-number-input__container", children: [
|
|
292
|
+
!isBasic && showBtns && /* @__PURE__ */ jsxRuntime.jsx(
|
|
293
|
+
"button",
|
|
294
|
+
{
|
|
295
|
+
type: "button",
|
|
296
|
+
tabIndex: -1,
|
|
297
|
+
disabled: disabled || isMinDisabled,
|
|
298
|
+
className: "nexus-number-input__bind-btn",
|
|
299
|
+
onPointerDown: (e) => startRepeat(-step, e),
|
|
237
300
|
onPointerUp: stopRepeat,
|
|
238
301
|
onPointerLeave: stopRepeat,
|
|
239
|
-
"aria-label": "
|
|
240
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
302
|
+
"aria-label": "Decrease",
|
|
303
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MinusIcon, {})
|
|
241
304
|
}
|
|
242
305
|
),
|
|
243
306
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
"input",
|
|
308
|
+
{
|
|
309
|
+
ref: inputRef,
|
|
310
|
+
type: "text",
|
|
311
|
+
inputMode: "decimal",
|
|
312
|
+
role: "spinbutton",
|
|
313
|
+
className: "nexus-number-input__field",
|
|
314
|
+
value: internalValue,
|
|
315
|
+
disabled,
|
|
316
|
+
readOnly,
|
|
317
|
+
placeholder: placeholder ?? "0",
|
|
318
|
+
"aria-invalid": isError || void 0,
|
|
319
|
+
"aria-valuemin": min,
|
|
320
|
+
"aria-valuemax": max,
|
|
321
|
+
"aria-valuenow": internalValue ? parseFloat(internalValue) || void 0 : void 0,
|
|
322
|
+
onChange: handleInputChange,
|
|
323
|
+
onBlur: handleBlur,
|
|
324
|
+
onKeyDown: handleKeyDown,
|
|
325
|
+
...props
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
!isBasic && showBtns && /* @__PURE__ */ jsxRuntime.jsx(
|
|
244
329
|
"button",
|
|
245
330
|
{
|
|
246
331
|
type: "button",
|
|
247
332
|
tabIndex: -1,
|
|
248
|
-
disabled:
|
|
249
|
-
className: "nexus-number-
|
|
250
|
-
onPointerDown: (e) => startRepeat(
|
|
333
|
+
disabled: disabled || isMaxDisabled,
|
|
334
|
+
className: "nexus-number-input__bind-btn",
|
|
335
|
+
onPointerDown: (e) => startRepeat(step, e),
|
|
251
336
|
onPointerUp: stopRepeat,
|
|
252
337
|
onPointerLeave: stopRepeat,
|
|
253
|
-
"aria-label": "
|
|
254
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
338
|
+
"aria-label": "Increase",
|
|
339
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PlusIcon, {})
|
|
255
340
|
}
|
|
256
|
-
)
|
|
257
|
-
|
|
341
|
+
),
|
|
342
|
+
isBasic && showBtns && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-number-input__buttons", children: [
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
344
|
+
"button",
|
|
345
|
+
{
|
|
346
|
+
type: "button",
|
|
347
|
+
tabIndex: -1,
|
|
348
|
+
disabled: disabled || isMaxDisabled,
|
|
349
|
+
className: "nexus-number-input__step nexus-number-input__step--up",
|
|
350
|
+
onPointerDown: (e) => startRepeat(step, e),
|
|
351
|
+
onPointerUp: stopRepeat,
|
|
352
|
+
onPointerLeave: stopRepeat,
|
|
353
|
+
"aria-label": "Increase",
|
|
354
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUpIcon, {})
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
358
|
+
"button",
|
|
359
|
+
{
|
|
360
|
+
type: "button",
|
|
361
|
+
tabIndex: -1,
|
|
362
|
+
disabled: disabled || isMinDisabled,
|
|
363
|
+
className: "nexus-number-input__step nexus-number-input__step--down",
|
|
364
|
+
onPointerDown: (e) => startRepeat(-step, e),
|
|
365
|
+
onPointerUp: stopRepeat,
|
|
366
|
+
onPointerLeave: stopRepeat,
|
|
367
|
+
"aria-label": "Decrease",
|
|
368
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, {})
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
] })
|
|
372
|
+
] }),
|
|
373
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
374
|
+
"p",
|
|
375
|
+
{
|
|
376
|
+
className: chunkCZC76ZD5_js.cn(
|
|
377
|
+
"nexus-number-input__description",
|
|
378
|
+
isError && "nexus-number-input__description--error"
|
|
379
|
+
),
|
|
380
|
+
children: description
|
|
381
|
+
}
|
|
382
|
+
)
|
|
258
383
|
]
|
|
259
384
|
}
|
|
260
385
|
);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var alertVariants = cva("nexus-alert", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
info: "nexus-alert--info",
|
|
10
|
+
success: "nexus-alert--success",
|
|
11
|
+
warning: "nexus-alert--warning",
|
|
12
|
+
danger: "nexus-alert--danger"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "info"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var statusIcons = {
|
|
20
|
+
info: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
21
|
+
success: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
22
|
+
warning: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
23
|
+
danger: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
24
|
+
};
|
|
25
|
+
var CloseIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M4 4l8 8M12 4l-8 8", strokeLinecap: "round" }) });
|
|
26
|
+
var Alert = React.forwardRef(
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
variant = "info",
|
|
31
|
+
title,
|
|
32
|
+
icon,
|
|
33
|
+
closable = false,
|
|
34
|
+
onClose,
|
|
35
|
+
action,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const [visible, setVisible] = React.useState(true);
|
|
39
|
+
const handleClose = React.useCallback(() => {
|
|
40
|
+
setVisible(false);
|
|
41
|
+
onClose?.();
|
|
42
|
+
}, [onClose]);
|
|
43
|
+
if (!visible) return null;
|
|
44
|
+
const IconComp = icon === void 0 ? statusIcons[variant ?? "info"] : null;
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
role: "alert",
|
|
50
|
+
className: cn(alertVariants({ variant }), className),
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
(icon || IconComp) && /* @__PURE__ */ jsx("span", { className: "nexus-alert__icon", children: icon ?? (IconComp && /* @__PURE__ */ jsx(IconComp, { className: "nexus-alert__icon-svg" })) }),
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "nexus-alert__body", children: [
|
|
55
|
+
title && /* @__PURE__ */ jsx("p", { className: "nexus-alert__title", children: title }),
|
|
56
|
+
children && /* @__PURE__ */ jsx("div", { className: "nexus-alert__description", children })
|
|
57
|
+
] }),
|
|
58
|
+
action && /* @__PURE__ */ jsx("div", { className: "nexus-alert__action", children: action }),
|
|
59
|
+
closable && /* @__PURE__ */ jsx(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
type: "button",
|
|
63
|
+
className: "nexus-alert__close",
|
|
64
|
+
onClick: handleClose,
|
|
65
|
+
"aria-label": "Close",
|
|
66
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "nexus-alert__close-icon" })
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
Alert.displayName = "Alert";
|
|
75
|
+
|
|
76
|
+
export { Alert, alertVariants };
|
|
@@ -41,7 +41,8 @@ var TdColumn = ({
|
|
|
41
41
|
rowSpan,
|
|
42
42
|
align = "left",
|
|
43
43
|
textOverflow = "truncate",
|
|
44
|
-
highlightKey
|
|
44
|
+
highlightKey,
|
|
45
|
+
style
|
|
45
46
|
}) => {
|
|
46
47
|
const { highlightValue, setHighlightValue } = useTableHighlight();
|
|
47
48
|
const isHighlighted = !!highlightKey && !!highlightValue && highlightKey === highlightValue;
|
|
@@ -52,6 +53,7 @@ var TdColumn = ({
|
|
|
52
53
|
if (highlightKey) setHighlightValue(null);
|
|
53
54
|
}, [highlightKey, setHighlightValue]);
|
|
54
55
|
const sizeStyle = size ? { width: typeof size === "number" ? `${size}px` : size, flex: `0 0 ${typeof size === "number" ? `${size}px` : size}` } : void 0;
|
|
56
|
+
const mergedStyle = { ...sizeStyle, ...style };
|
|
55
57
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
58
|
"td",
|
|
57
59
|
{
|
|
@@ -59,7 +61,7 @@ var TdColumn = ({
|
|
|
59
61
|
title: textOverflow === "truncate" && typeof children === "string" ? children : void 0,
|
|
60
62
|
colSpan,
|
|
61
63
|
rowSpan,
|
|
62
|
-
style:
|
|
64
|
+
style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
|
|
63
65
|
onMouseEnter: handleMouseEnter,
|
|
64
66
|
onMouseLeave: handleMouseLeave,
|
|
65
67
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -110,6 +112,25 @@ var TableRow = ({ className = "", children, onClick, variant = "default" }) => {
|
|
|
110
112
|
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: chunkCZC76ZD5_js.cn(tableRowVariants({ variant }), className), onClick, children: columnList });
|
|
111
113
|
};
|
|
112
114
|
TableRow.displayName = "TableRow";
|
|
115
|
+
var SIZING_STYLE_KEYS = [
|
|
116
|
+
"width",
|
|
117
|
+
"minWidth",
|
|
118
|
+
"maxWidth",
|
|
119
|
+
"flex",
|
|
120
|
+
"flexBasis",
|
|
121
|
+
"flexGrow",
|
|
122
|
+
"flexShrink"
|
|
123
|
+
];
|
|
124
|
+
function extractSizingStyle(style) {
|
|
125
|
+
if (!style) return void 0;
|
|
126
|
+
const result = {};
|
|
127
|
+
for (const key of SIZING_STYLE_KEYS) {
|
|
128
|
+
if (style[key] !== void 0) {
|
|
129
|
+
result[key] = style[key];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
133
|
+
}
|
|
113
134
|
var DefaultSortIcon = ({ direction }) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "nexus-table-sort-icon", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
114
135
|
direction === "asc" && /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 4l4 5H4z" }),
|
|
115
136
|
direction === "desc" && /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 12l4-5H4z" }),
|
|
@@ -181,7 +202,10 @@ function Table({
|
|
|
181
202
|
const component = column;
|
|
182
203
|
const tdClassName = component?.props?.className;
|
|
183
204
|
const widthClassName = tdClassName?.match(
|
|
184
|
-
/(fold:|mobile-sm:|tablet:|desktop-sm:|desktop:|desktop-lg:|wide-desktop:|xs:|sm:|md:|lg:|xl:|2xl:)?(w-\[[
|
|
205
|
+
/(fold:|mobile-sm:|tablet:|desktop-sm:|desktop:|desktop-lg:|wide-desktop:|xs:|sm:|md:|lg:|xl:|2xl:)?(w-\[[^\]]+\]|w-full|w-\d+\/\d+|w-\d+|min-w-[^\s"]+|max-w-[^\s"]+|flex-[^\s"]+|basis-[^\s"]+|grow(-[^\s"]+)?|shrink(-[^\s"]+)?)/g
|
|
206
|
+
);
|
|
207
|
+
const sizingStyle = extractSizingStyle(
|
|
208
|
+
component.props?.style
|
|
185
209
|
);
|
|
186
210
|
return {
|
|
187
211
|
className: component.props?.className ?? "",
|
|
@@ -194,6 +218,7 @@ function Table({
|
|
|
194
218
|
rowSpan: component.props?.rowSpan,
|
|
195
219
|
colSpan: component.props?.colSpan,
|
|
196
220
|
size: component.props?.size,
|
|
221
|
+
sizingStyle,
|
|
197
222
|
widthClassName: widthClassName && widthClassName.join(" "),
|
|
198
223
|
align: component.props?.align ?? "left",
|
|
199
224
|
order: component.props?.order ?? ""
|
|
@@ -220,10 +245,13 @@ function Table({
|
|
|
220
245
|
"td",
|
|
221
246
|
{
|
|
222
247
|
className: chunkCZC76ZD5_js.cn(thData.widthClassName, "nexus-table-skeleton-td"),
|
|
223
|
-
style:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
248
|
+
style: {
|
|
249
|
+
...thData.size ? {
|
|
250
|
+
width: typeof thData.size === "number" ? `${thData.size}px` : thData.size,
|
|
251
|
+
flex: `0 0 ${typeof thData.size === "number" ? `${thData.size}px` : thData.size}`
|
|
252
|
+
} : void 0,
|
|
253
|
+
...thData.sizingStyle
|
|
254
|
+
},
|
|
227
255
|
children: /* @__PURE__ */ jsxRuntime.jsx(chunkBLGQHR3M_js.Skeleton, { className: "nexus-table-skeleton-bar" })
|
|
228
256
|
},
|
|
229
257
|
`skeleton-td-${tdIndex}`
|
|
@@ -288,10 +316,13 @@ function Table({
|
|
|
288
316
|
ALIGN_CLASSES2[thData.align ?? "left"],
|
|
289
317
|
thData.widthClassName
|
|
290
318
|
),
|
|
291
|
-
style:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
319
|
+
style: {
|
|
320
|
+
...thData.size ? {
|
|
321
|
+
width: typeof thData.size === "number" ? `${thData.size}px` : thData.size,
|
|
322
|
+
flex: `0 0 ${typeof thData.size === "number" ? `${thData.size}px` : thData.size}`
|
|
323
|
+
} : void 0,
|
|
324
|
+
...thData.sizingStyle
|
|
325
|
+
},
|
|
295
326
|
children: thData.enableSorting ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
296
327
|
"button",
|
|
297
328
|
{
|
|
@@ -328,7 +359,14 @@ function Table({
|
|
|
328
359
|
] }) }) });
|
|
329
360
|
}
|
|
330
361
|
|
|
331
|
-
|
|
362
|
+
// src/table/index.ts
|
|
363
|
+
var Table2 = Object.assign(Table, {
|
|
364
|
+
Row: TableRow,
|
|
365
|
+
Column: TdColumn,
|
|
366
|
+
HighlightProvider: TableHighlightProvider
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
exports.Table = Table2;
|
|
332
370
|
exports.TableHighlightProvider = TableHighlightProvider;
|
|
333
371
|
exports.TableRow = TableRow;
|
|
334
372
|
exports.TdColumn = TdColumn;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var ChevronRight = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 4l4 4-4 4", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
28
|
+
var Breadcrumb = React__namespace.forwardRef(
|
|
29
|
+
({ className, items, separator, maxItems, ...props }, ref) => {
|
|
30
|
+
let displayItems = items;
|
|
31
|
+
let collapsed = false;
|
|
32
|
+
if (maxItems && maxItems > 2 && items.length > maxItems) {
|
|
33
|
+
displayItems = [
|
|
34
|
+
items[0],
|
|
35
|
+
{ label: "..." },
|
|
36
|
+
...items.slice(-(maxItems - 2))
|
|
37
|
+
];
|
|
38
|
+
collapsed = true;
|
|
39
|
+
}
|
|
40
|
+
const sep = separator ?? /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "nexus-breadcrumb__separator-icon" });
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "Breadcrumb", className: chunkCZC76ZD5_js.cn("nexus-breadcrumb", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "nexus-breadcrumb__list", children: displayItems.map((item, i) => {
|
|
42
|
+
const isLast = i === displayItems.length - 1;
|
|
43
|
+
const isCollapsed = collapsed && i === 1;
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "nexus-breadcrumb__item", children: [
|
|
45
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__separator", "aria-hidden": "true", children: sep }),
|
|
46
|
+
isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__ellipsis", children: "\u2026" }) : isLast ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: "nexus-breadcrumb__link", onClick: item.onClick, children: item.label }) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nexus-breadcrumb__link nexus-breadcrumb__link--btn", onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__link", children: item.label })
|
|
47
|
+
] }, i);
|
|
48
|
+
}) }) });
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
52
|
+
|
|
53
|
+
exports.Breadcrumb = Breadcrumb;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
var alertVariants = classVarianceAuthority.cva("nexus-alert", {
|
|
29
|
+
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
info: "nexus-alert--info",
|
|
32
|
+
success: "nexus-alert--success",
|
|
33
|
+
warning: "nexus-alert--warning",
|
|
34
|
+
danger: "nexus-alert--danger"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "info"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var statusIcons = {
|
|
42
|
+
info: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
43
|
+
success: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
44
|
+
warning: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
45
|
+
danger: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
46
|
+
};
|
|
47
|
+
var CloseIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", strokeLinecap: "round" }) });
|
|
48
|
+
var Alert = React__namespace.forwardRef(
|
|
49
|
+
({
|
|
50
|
+
className,
|
|
51
|
+
children,
|
|
52
|
+
variant = "info",
|
|
53
|
+
title,
|
|
54
|
+
icon,
|
|
55
|
+
closable = false,
|
|
56
|
+
onClose,
|
|
57
|
+
action,
|
|
58
|
+
...props
|
|
59
|
+
}, ref) => {
|
|
60
|
+
const [visible, setVisible] = React__namespace.useState(true);
|
|
61
|
+
const handleClose = React__namespace.useCallback(() => {
|
|
62
|
+
setVisible(false);
|
|
63
|
+
onClose?.();
|
|
64
|
+
}, [onClose]);
|
|
65
|
+
if (!visible) return null;
|
|
66
|
+
const IconComp = icon === void 0 ? statusIcons[variant ?? "info"] : null;
|
|
67
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
role: "alert",
|
|
72
|
+
className: chunkCZC76ZD5_js.cn(alertVariants({ variant }), className),
|
|
73
|
+
...props,
|
|
74
|
+
children: [
|
|
75
|
+
(icon || IconComp) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-alert__icon", children: icon ?? (IconComp && /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: "nexus-alert__icon-svg" })) }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-alert__body", children: [
|
|
77
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "nexus-alert__title", children: title }),
|
|
78
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-alert__description", children })
|
|
79
|
+
] }),
|
|
80
|
+
action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-alert__action", children: action }),
|
|
81
|
+
closable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
type: "button",
|
|
85
|
+
className: "nexus-alert__close",
|
|
86
|
+
onClick: handleClose,
|
|
87
|
+
"aria-label": "Close",
|
|
88
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "nexus-alert__close-icon" })
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
Alert.displayName = "Alert";
|
|
97
|
+
|
|
98
|
+
exports.Alert = Alert;
|
|
99
|
+
exports.alertVariants = alertVariants;
|