@nexus-cross/design-system 1.0.6 → 1.0.8
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/breadcrumb.js +6 -2
- package/dist/breadcrumb.mjs +1 -1
- package/dist/chunks/{chunk-PXBZEAZQ.mjs → chunk-22O6YUYH.mjs} +1 -1
- package/dist/chunks/{chunk-SUIT4XKB.js → chunk-3RK3UT2O.js} +42 -11
- package/dist/chunks/{chunk-GN6X27QI.mjs → chunk-AAITRHED.mjs} +42 -11
- package/dist/chunks/chunk-DDY7ENHX.mjs +53 -0
- package/dist/chunks/{chunk-QRNHFOLG.js → chunk-OE5BAEBE.js} +1 -1
- package/dist/chunks/chunk-WATCVNBT.js +76 -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/{alert.d.mts → components/Alert.d.ts} +5 -6
- 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/{badge.d.mts → components/Badge.d.ts} +5 -6
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Breadcrumb.d.ts +23 -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/{date-picker.d.mts → components/DatePicker.d.ts} +3 -3
- 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/{dropdown-menu.d.mts → components/DropdownMenu.d.ts} +4 -4
- 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/{empty-state.d.mts → components/EmptyState.d.ts} +5 -6
- 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} +5 -6
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/{nx-image.d.mts → components/NxImage.d.ts} +3 -3
- 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.ts → components/PriceInput.d.ts} +5 -6
- package/dist/components/PriceInput.d.ts.map +1 -0
- package/dist/{progress.d.mts → components/Progress.d.ts} +5 -6
- 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/{slider.d.mts → components/Slider.d.ts} +5 -6
- 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/{stepper.d.mts → components/Stepper.d.ts} +5 -6
- 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/{tag-input.d.mts → components/TagInput.d.ts} +5 -6
- package/dist/components/TagInput.d.ts.map +1 -0
- package/dist/{text-area.d.mts → components/TextArea.d.ts} +5 -6
- 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/{toggle-group.d.mts → components/ToggleGroup.d.ts} +5 -6
- 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/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 -91
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -9
- package/dist/index.mjs +2 -2
- 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/types.d.ts +90 -0
- package/dist/modal/types.d.ts.map +1 -0
- package/dist/schemas/_all.json +6 -26
- 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/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/breadcrumb.d.ts +28 -0
- package/dist/schemas/breadcrumb.d.ts.map +1 -0
- package/dist/schemas/breadcrumb.json +6 -26
- 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/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/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/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/nx-image.d.ts +33 -0
- package/dist/schemas/nx-image.d.ts.map +1 -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/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/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/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/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/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/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 +11 -10
- package/dist/schemas.mjs +11 -10
- 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 +96 -33
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +96 -33
- 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/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.mts → toast/useToast.d.ts} +4 -14
- package/dist/toast/useToast.d.ts.map +1 -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 +49 -49
- package/dist/accordion.d.ts +0 -28
- package/dist/alert.d.ts +0 -17
- package/dist/avatar.d.ts +0 -17
- package/dist/badge.d.ts +0 -18
- package/dist/breadcrumb.d.mts +0 -15
- package/dist/breadcrumb.d.ts +0 -15
- 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-3ZWN66YH.js +0 -53
- package/dist/chunks/chunk-EJY7IVSK.mjs +0 -31
- 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/date-picker.d.ts +0 -17
- package/dist/divider.d.ts +0 -14
- package/dist/drawer.d.ts +0 -42
- package/dist/dropdown-menu.d.ts +0 -30
- package/dist/ellipsis.d.ts +0 -16
- package/dist/empty-state.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 -91
- 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 -37
- package/dist/nx-image.d.ts +0 -13
- 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.mts +0 -36
- package/dist/progress.d.ts +0 -18
- package/dist/radio-group.d.ts +0 -29
- package/dist/schemas.d.mts +0 -2173
- package/dist/schemas.d.ts +0 -2173
- package/dist/select.d.ts +0 -31
- package/dist/skeleton.d.ts +0 -15
- package/dist/slider.d.ts +0 -20
- package/dist/spinner.d.ts +0 -9
- package/dist/stepper.d.ts +0 -20
- 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 -95
- package/dist/table.d.ts +0 -95
- package/dist/tag-input.d.ts +0 -21
- package/dist/text-area.d.ts +0 -19
- package/dist/text-input.d.ts +0 -21
- package/dist/theme-provider.d.ts +0 -25
- package/dist/toast.d.ts +0 -42
- package/dist/toggle-group.d.ts +0 -36
- 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
|
@@ -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
|
{
|
|
@@ -35,7 +35,8 @@ var TdColumn = ({
|
|
|
35
35
|
rowSpan,
|
|
36
36
|
align = "left",
|
|
37
37
|
textOverflow = "truncate",
|
|
38
|
-
highlightKey
|
|
38
|
+
highlightKey,
|
|
39
|
+
style
|
|
39
40
|
}) => {
|
|
40
41
|
const { highlightValue, setHighlightValue } = useTableHighlight();
|
|
41
42
|
const isHighlighted = !!highlightKey && !!highlightValue && highlightKey === highlightValue;
|
|
@@ -46,6 +47,7 @@ var TdColumn = ({
|
|
|
46
47
|
if (highlightKey) setHighlightValue(null);
|
|
47
48
|
}, [highlightKey, setHighlightValue]);
|
|
48
49
|
const sizeStyle = size ? { width: typeof size === "number" ? `${size}px` : size, flex: `0 0 ${typeof size === "number" ? `${size}px` : size}` } : void 0;
|
|
50
|
+
const mergedStyle = { ...sizeStyle, ...style };
|
|
49
51
|
return /* @__PURE__ */ jsx(
|
|
50
52
|
"td",
|
|
51
53
|
{
|
|
@@ -53,7 +55,7 @@ var TdColumn = ({
|
|
|
53
55
|
title: textOverflow === "truncate" && typeof children === "string" ? children : void 0,
|
|
54
56
|
colSpan,
|
|
55
57
|
rowSpan,
|
|
56
|
-
style:
|
|
58
|
+
style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
|
|
57
59
|
onMouseEnter: handleMouseEnter,
|
|
58
60
|
onMouseLeave: handleMouseLeave,
|
|
59
61
|
children: /* @__PURE__ */ jsx(
|
|
@@ -104,6 +106,25 @@ var TableRow = ({ className = "", children, onClick, variant = "default" }) => {
|
|
|
104
106
|
return /* @__PURE__ */ jsx("tr", { className: cn(tableRowVariants({ variant }), className), onClick, children: columnList });
|
|
105
107
|
};
|
|
106
108
|
TableRow.displayName = "TableRow";
|
|
109
|
+
var SIZING_STYLE_KEYS = [
|
|
110
|
+
"width",
|
|
111
|
+
"minWidth",
|
|
112
|
+
"maxWidth",
|
|
113
|
+
"flex",
|
|
114
|
+
"flexBasis",
|
|
115
|
+
"flexGrow",
|
|
116
|
+
"flexShrink"
|
|
117
|
+
];
|
|
118
|
+
function extractSizingStyle(style) {
|
|
119
|
+
if (!style) return void 0;
|
|
120
|
+
const result = {};
|
|
121
|
+
for (const key of SIZING_STYLE_KEYS) {
|
|
122
|
+
if (style[key] !== void 0) {
|
|
123
|
+
result[key] = style[key];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
127
|
+
}
|
|
107
128
|
var DefaultSortIcon = ({ direction }) => /* @__PURE__ */ jsxs("svg", { className: "nexus-table-sort-icon", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
108
129
|
direction === "asc" && /* @__PURE__ */ jsx("path", { d: "M8 4l4 5H4z" }),
|
|
109
130
|
direction === "desc" && /* @__PURE__ */ jsx("path", { d: "M8 12l4-5H4z" }),
|
|
@@ -175,7 +196,10 @@ function Table({
|
|
|
175
196
|
const component = column;
|
|
176
197
|
const tdClassName = component?.props?.className;
|
|
177
198
|
const widthClassName = tdClassName?.match(
|
|
178
|
-
/(fold:|mobile-sm:|tablet:|desktop-sm:|desktop:|desktop-lg:|wide-desktop:|xs:|sm:|md:|lg:|xl:|2xl:)?(w-\[[
|
|
199
|
+
/(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
|
|
200
|
+
);
|
|
201
|
+
const sizingStyle = extractSizingStyle(
|
|
202
|
+
component.props?.style
|
|
179
203
|
);
|
|
180
204
|
return {
|
|
181
205
|
className: component.props?.className ?? "",
|
|
@@ -188,6 +212,7 @@ function Table({
|
|
|
188
212
|
rowSpan: component.props?.rowSpan,
|
|
189
213
|
colSpan: component.props?.colSpan,
|
|
190
214
|
size: component.props?.size,
|
|
215
|
+
sizingStyle,
|
|
191
216
|
widthClassName: widthClassName && widthClassName.join(" "),
|
|
192
217
|
align: component.props?.align ?? "left",
|
|
193
218
|
order: component.props?.order ?? ""
|
|
@@ -214,10 +239,13 @@ function Table({
|
|
|
214
239
|
"td",
|
|
215
240
|
{
|
|
216
241
|
className: cn(thData.widthClassName, "nexus-table-skeleton-td"),
|
|
217
|
-
style:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
242
|
+
style: {
|
|
243
|
+
...thData.size ? {
|
|
244
|
+
width: typeof thData.size === "number" ? `${thData.size}px` : thData.size,
|
|
245
|
+
flex: `0 0 ${typeof thData.size === "number" ? `${thData.size}px` : thData.size}`
|
|
246
|
+
} : void 0,
|
|
247
|
+
...thData.sizingStyle
|
|
248
|
+
},
|
|
221
249
|
children: /* @__PURE__ */ jsx(Skeleton, { className: "nexus-table-skeleton-bar" })
|
|
222
250
|
},
|
|
223
251
|
`skeleton-td-${tdIndex}`
|
|
@@ -282,10 +310,13 @@ function Table({
|
|
|
282
310
|
ALIGN_CLASSES2[thData.align ?? "left"],
|
|
283
311
|
thData.widthClassName
|
|
284
312
|
),
|
|
285
|
-
style:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
313
|
+
style: {
|
|
314
|
+
...thData.size ? {
|
|
315
|
+
width: typeof thData.size === "number" ? `${thData.size}px` : thData.size,
|
|
316
|
+
flex: `0 0 ${typeof thData.size === "number" ? `${thData.size}px` : thData.size}`
|
|
317
|
+
} : void 0,
|
|
318
|
+
...thData.sizingStyle
|
|
319
|
+
},
|
|
289
320
|
children: thData.enableSorting ? /* @__PURE__ */ jsxs(
|
|
290
321
|
"button",
|
|
291
322
|
{
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var ChevronRight = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M6 4l4 4-4 4", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
6
|
+
var BreadcrumbItem = ({ children, className }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx("span", { className, children });
|
|
8
|
+
};
|
|
9
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
10
|
+
var Breadcrumb = Object.assign(
|
|
11
|
+
React.forwardRef(
|
|
12
|
+
({ className, children, separator, maxItems, ...props }, ref) => {
|
|
13
|
+
const items = React.Children.toArray(children).filter(
|
|
14
|
+
(child) => React.isValidElement(child) && child.type?.displayName === "BreadcrumbItem"
|
|
15
|
+
);
|
|
16
|
+
const entries = [];
|
|
17
|
+
if (maxItems && maxItems > 2 && items.length > maxItems) {
|
|
18
|
+
entries.push({ type: "item", element: items[0], isLast: false });
|
|
19
|
+
entries.push({ type: "ellipsis" });
|
|
20
|
+
const tail = items.slice(-(maxItems - 2));
|
|
21
|
+
tail.forEach(
|
|
22
|
+
(el, i) => entries.push({ type: "item", element: el, isLast: i === tail.length - 1 })
|
|
23
|
+
);
|
|
24
|
+
} else {
|
|
25
|
+
items.forEach(
|
|
26
|
+
(el, i) => entries.push({ type: "item", element: el, isLast: i === items.length - 1 })
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const sep = separator ?? /* @__PURE__ */ jsx(ChevronRight, { className: "nexus-breadcrumb__separator-icon" });
|
|
30
|
+
return /* @__PURE__ */ jsx("nav", { ref, "aria-label": "Breadcrumb", className: cn("nexus-breadcrumb", className), ...props, children: /* @__PURE__ */ jsx("ol", { className: "nexus-breadcrumb__list", children: entries.map((entry, i) => /* @__PURE__ */ jsxs(
|
|
31
|
+
"li",
|
|
32
|
+
{
|
|
33
|
+
className: "nexus-breadcrumb__item",
|
|
34
|
+
...entry.type === "item" && entry.isLast ? { "aria-current": "page" } : void 0,
|
|
35
|
+
children: [
|
|
36
|
+
i > 0 && /* @__PURE__ */ jsx("span", { className: "nexus-breadcrumb__separator", "aria-hidden": "true", children: sep }),
|
|
37
|
+
entry.type === "ellipsis" ? /* @__PURE__ */ jsx("span", { className: "nexus-breadcrumb__ellipsis", children: "\u2026" }) : React.cloneElement(entry.element, {
|
|
38
|
+
className: cn(
|
|
39
|
+
entry.isLast ? "nexus-breadcrumb__current" : void 0,
|
|
40
|
+
entry.element.props.className
|
|
41
|
+
)
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
i
|
|
46
|
+
)) }) });
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
{ Item: BreadcrumbItem }
|
|
50
|
+
);
|
|
51
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
52
|
+
|
|
53
|
+
export { Breadcrumb, BreadcrumbItem };
|