@constructive-io/ui 0.4.1 → 0.6.0
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/LICENSE +21 -0
- package/README.md +17 -22
- package/dist/components/alert-dialog.cjs +333 -0
- package/dist/components/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog.d.cts +32 -0
- package/dist/components/alert-dialog.d.ts +16 -15
- package/dist/components/alert-dialog.js +89 -102
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +119 -0
- package/dist/components/alert.cjs.map +1 -0
- package/dist/components/alert.d.cts +19 -0
- package/dist/components/alert.d.ts +10 -5
- package/dist/components/alert.js +62 -6
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-bar.cjs +367 -0
- package/dist/components/app-bar.cjs.map +1 -0
- package/dist/components/app-bar.d.cts +26 -0
- package/dist/components/app-bar.d.ts +26 -0
- package/dist/components/app-bar.js +344 -0
- package/dist/components/app-bar.js.map +1 -0
- package/dist/components/app-shell.cjs +1792 -0
- package/dist/components/app-shell.cjs.map +1 -0
- package/dist/components/app-shell.d.cts +106 -0
- package/dist/components/app-shell.d.ts +106 -0
- package/dist/components/app-shell.js +1771 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/autocomplete.cjs +418 -0
- package/dist/components/autocomplete.cjs.map +1 -0
- package/dist/components/autocomplete.d.cts +28 -0
- package/dist/components/autocomplete.d.ts +15 -15
- package/dist/components/autocomplete.js +9 -30
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +51 -0
- package/dist/components/avatar.cjs.map +1 -0
- package/dist/components/avatar.d.cts +12 -0
- package/dist/components/avatar.d.ts +3 -4
- package/dist/components/avatar.js +11 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +66 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +15 -0
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +118 -0
- package/dist/components/breadcrumb.cjs.map +1 -0
- package/dist/components/breadcrumb.d.cts +14 -0
- package/dist/components/breadcrumb.d.ts +9 -9
- package/dist/components/breadcrumb.js +19 -83
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +169 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +20 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +105 -21
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +85 -0
- package/dist/components/calendar-rac.cjs.map +1 -0
- package/dist/components/calendar-rac.d.cts +13 -0
- package/dist/components/calendar-rac.d.ts +3 -3
- package/dist/components/card.cjs +99 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +18 -0
- package/dist/components/card.d.ts +7 -8
- package/dist/components/card.js +23 -8
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +18 -0
- package/dist/components/checkbox-group.cjs.map +1 -0
- package/dist/components/checkbox-group.d.cts +7 -0
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox.cjs +121 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +8 -0
- package/dist/components/checkbox.d.ts +3 -3
- package/dist/components/checkbox.js +73 -41
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +127 -0
- package/dist/components/collapsible.cjs.map +1 -0
- package/dist/components/collapsible.d.cts +44 -0
- package/dist/components/collapsible.d.ts +8 -18
- package/dist/components/collapsible.js +7 -27
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +551 -0
- package/dist/components/combobox.cjs.map +1 -0
- package/dist/components/combobox.d.cts +43 -0
- package/dist/components/combobox.d.ts +17 -18
- package/dist/components/combobox.js +37 -48
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +236 -0
- package/dist/components/command.cjs.map +1 -0
- package/dist/components/command.d.cts +23 -0
- package/dist/components/command.d.ts +14 -15
- package/dist/components/command.js +5 -38
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +431 -0
- package/dist/components/dialog.cjs.map +1 -0
- package/dist/components/dialog.d.cts +30 -0
- package/dist/components/dialog.d.ts +13 -18
- package/dist/components/dialog.js +75 -119
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +121 -0
- package/dist/components/dock.cjs.map +1 -0
- package/dist/components/dock.d.cts +30 -0
- package/dist/components/dock.d.ts +1 -2
- package/dist/components/dock.js +7 -5
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +149 -0
- package/dist/components/drawer.cjs.map +1 -0
- package/dist/components/drawer.d.cts +15 -0
- package/dist/components/drawer.d.ts +10 -11
- package/dist/components/drawer.js +11 -40
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +292 -0
- package/dist/components/dropdown-menu.cjs.map +1 -0
- package/dist/components/dropdown-menu.d.cts +52 -0
- package/dist/components/dropdown-menu.d.ts +23 -21
- package/dist/components/dropdown-menu.js +67 -191
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +106 -0
- package/dist/components/empty.cjs.map +1 -0
- package/dist/components/empty.d.cts +15 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +99 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.cjs +295 -0
- package/dist/components/field.cjs.map +1 -0
- package/dist/components/field.d.cts +46 -0
- package/dist/components/field.d.ts +34 -39
- package/dist/components/field.js +220 -72
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +176 -0
- package/dist/components/flickering-grid.cjs.map +1 -0
- package/dist/components/flickering-grid.d.cts +15 -0
- package/dist/components/flickering-grid.js +25 -2
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +194 -0
- package/dist/components/flow-zoom-panel.cjs.map +1 -0
- package/dist/components/flow-zoom-panel.d.cts +12 -0
- package/dist/components/flow-zoom-panel.d.ts +12 -0
- package/dist/components/flow-zoom-panel.js +173 -0
- package/dist/components/flow-zoom-panel.js.map +1 -0
- package/dist/components/form-control.cjs +193 -0
- package/dist/components/form-control.cjs.map +1 -0
- package/dist/components/form-control.d.cts +14 -0
- package/dist/components/form-control.d.ts +1 -2
- package/dist/components/form-control.js +2 -4
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +208 -0
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +36 -0
- package/dist/components/form.d.ts +7 -8
- package/dist/components/input-group.cjs +184 -0
- package/dist/components/input-group.cjs.map +1 -0
- package/dist/components/input-group.d.cts +17 -0
- package/dist/components/input-group.d.ts +6 -7
- package/dist/components/input-group.js +3 -2
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.cjs +62 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +10 -0
- package/dist/components/input.d.ts +1 -2
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.cjs +351 -0
- package/dist/components/json-input.cjs.map +1 -0
- package/dist/components/json-input.d.cts +25 -0
- package/dist/components/json-input.d.ts +3 -3
- package/dist/components/json-input.js +89 -112
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/label.cjs +29 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +10 -0
- package/dist/components/label.d.ts +1 -2
- package/dist/components/motion-grid.cjs +108 -0
- package/dist/components/motion-grid.cjs.map +1 -0
- package/dist/components/motion-grid.d.cts +19 -0
- package/dist/components/motion-grid.d.ts +1 -2
- package/dist/components/motion-grid.js +9 -4
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +796 -0
- package/dist/components/multi-select.cjs.map +1 -0
- package/dist/components/multi-select.d.cts +198 -0
- package/dist/components/multi-select.js +54 -162
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +19 -0
- package/dist/components/page-header.cjs.map +1 -0
- package/dist/components/page-header.d.cts +17 -0
- package/dist/components/page-header.d.ts +2 -2
- package/dist/components/pagination.cjs +295 -0
- package/dist/components/pagination.cjs.map +1 -0
- package/dist/components/pagination.d.cts +18 -0
- package/dist/components/pagination.d.ts +7 -8
- package/dist/components/pagination.js +152 -29
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.cjs +140 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +39 -0
- package/dist/components/popover.d.ts +13 -9
- package/dist/components/popover.js +56 -132
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.cjs +109 -0
- package/dist/components/portal.cjs.map +1 -0
- package/dist/components/portal.d.cts +117 -0
- package/dist/components/portal.d.ts +16 -7
- package/dist/components/portal.js +13 -8
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.cjs +31 -0
- package/dist/components/progress.cjs.map +1 -0
- package/dist/components/progress.d.cts +9 -0
- package/dist/components/progress.d.ts +1 -2
- package/dist/components/progress.js +1 -2
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +144 -0
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
- package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
- package/dist/components/progressive-blur-scroll-container.d.ts +2 -2
- package/dist/components/progressive-blur.cjs +70 -0
- package/dist/components/progressive-blur.cjs.map +1 -0
- package/dist/components/progressive-blur.d.cts +16 -0
- package/dist/components/progressive-blur.d.ts +2 -2
- package/dist/components/radio-group.cjs +52 -0
- package/dist/components/radio-group.cjs.map +1 -0
- package/dist/components/radio-group.d.cts +10 -0
- package/dist/components/radio-group.d.ts +3 -3
- package/dist/components/radio-group.js +21 -10
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +420 -0
- package/dist/components/record-picker.cjs.map +1 -0
- package/dist/components/record-picker.d.cts +16 -0
- package/dist/components/record-picker.d.ts +2 -2
- package/dist/components/record-picker.js +76 -43
- package/dist/components/record-picker.js.map +1 -1
- package/dist/components/resizable.cjs +76 -0
- package/dist/components/resizable.cjs.map +1 -0
- package/dist/components/resizable.d.cts +10 -0
- package/dist/components/resizable.d.ts +3 -4
- package/dist/components/responsive-diagram.cjs +67 -0
- package/dist/components/responsive-diagram.cjs.map +1 -0
- package/dist/components/responsive-diagram.d.cts +10 -0
- package/dist/components/responsive-diagram.d.ts +2 -2
- package/dist/components/scroll-area.cjs +92 -0
- package/dist/components/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area.d.cts +11 -0
- package/dist/components/scroll-area.d.ts +5 -6
- package/dist/components/select.cjs +329 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +46 -0
- package/dist/components/select.d.ts +13 -14
- package/dist/components/select.js +76 -67
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +26 -0
- package/dist/components/separator.cjs.map +1 -0
- package/dist/components/separator.d.cts +10 -0
- package/dist/components/separator.d.ts +1 -2
- package/dist/components/sheet.cjs +489 -0
- package/dist/components/sheet.cjs.map +1 -0
- package/dist/components/sheet.d.cts +107 -0
- package/dist/components/sheet.d.ts +14 -19
- package/dist/components/sheet.js +119 -264
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.cjs +1300 -0
- package/dist/components/sidebar.cjs.map +1 -0
- package/dist/components/sidebar.d.cts +70 -0
- package/dist/components/sidebar.d.ts +32 -39
- package/dist/components/sidebar.js +401 -362
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.cjs +36 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +10 -0
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +19 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/sonner.cjs +25 -0
- package/dist/components/sonner.cjs.map +1 -0
- package/dist/components/sonner.d.cts +10 -0
- package/dist/components/sonner.d.ts +2 -2
- package/dist/components/stack/index.cjs +1516 -0
- package/dist/components/stack/index.cjs.map +1 -0
- package/dist/components/stack/index.d.cts +672 -0
- package/dist/components/stack/index.d.ts +36 -38
- package/dist/components/stack/index.js +42 -31
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/stepper.cjs +314 -0
- package/dist/components/stepper.cjs.map +1 -0
- package/dist/components/stepper.d.cts +31 -0
- package/dist/components/stepper.d.ts +9 -8
- package/dist/components/stepper.js +22 -15
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +46 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +7 -0
- package/dist/components/switch.d.ts +1 -2
- package/dist/components/switch.js +9 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +133 -0
- package/dist/components/table.cjs.map +1 -0
- package/dist/components/table.d.cts +22 -0
- package/dist/components/table.d.ts +19 -12
- package/dist/components/table.js +72 -13
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +53 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +9 -0
- package/dist/components/tabs.d.ts +4 -5
- package/dist/components/tabs.js +2 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +451 -0
- package/dist/components/tags.cjs.map +1 -0
- package/dist/components/tags.d.cts +40 -0
- package/dist/components/tags.d.ts +10 -10
- package/dist/components/tags.js +129 -154
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +56 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +9 -0
- package/dist/components/textarea.d.ts +1 -2
- package/dist/components/toast/index.cjs +612 -0
- package/dist/components/toast/index.cjs.map +1 -0
- package/dist/components/toast/index.d.cts +52 -0
- package/dist/components/toast/index.js +90 -127
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/tooltip.cjs +92 -0
- package/dist/components/tooltip.cjs.map +1 -0
- package/dist/components/tooltip.d.cts +28 -0
- package/dist/components/tooltip.d.ts +5 -6
- package/dist/components/tooltip.js +23 -130
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +197 -0
- package/dist/components/unlink-button.cjs.map +1 -0
- package/dist/components/unlink-button.d.cts +14 -0
- package/dist/components/unlink-button.d.ts +2 -2
- package/dist/components/unlink-button.js +105 -21
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/index.cjs +2074 -2723
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +492 -904
- package/dist/index.d.ts +492 -904
- package/dist/index.js +1897 -2569
- package/dist/index.js.map +1 -1
- package/package.json +286 -45
- package/src/styles/globals.css +155 -203
- package/dist/components/org-chart/index.d.ts +0 -54
- package/dist/components/org-chart/index.js +0 -861
- package/dist/components/org-chart/index.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var _switch = require('@base-ui/react/switch');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
function Switch({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14
|
+
_switch.Switch.Root,
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "switch",
|
|
17
|
+
className: cn(
|
|
18
|
+
`peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none
|
|
19
|
+
before:pointer-events-none before:absolute before:left-1/2 before:top-1/2 before:h-[1.15rem]
|
|
20
|
+
before:w-8 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:border
|
|
21
|
+
before:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]
|
|
22
|
+
data-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80
|
|
23
|
+
focus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50
|
|
24
|
+
transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96]
|
|
25
|
+
motion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props,
|
|
29
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
_switch.Switch.Thumb,
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "switch-thumb",
|
|
33
|
+
className: cn(
|
|
34
|
+
`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground
|
|
35
|
+
pointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform
|
|
36
|
+
data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.Switch = Switch;
|
|
45
|
+
//# sourceMappingURL=switch.cjs.map
|
|
46
|
+
//# sourceMappingURL=switch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/switch.tsx"],"names":["twMerge","clsx","jsx","SwitchPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACIA,SAAS,MAAA,CAAO,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgB;AACrD,EAAA,uBACCC,cAAA;AAAA,IAACC,cAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oHAAA,CAAA;AAAA,QAQA;AAAA,OACD;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAD,cAAA;AAAA,QAACC,cAAA,CAAgB,KAAA;AAAA,QAAhB;AAAA,UACA,WAAA,EAAU,cAAA;AAAA,UACV,SAAA,EAAW,EAAA;AAAA,YACV,CAAA;AAAA;AAAA,+EAAA;AAAA;AAGD;AAAA;AACD;AAAA,GACD;AAEF","file":"switch.cjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '../lib/utils';\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\n\nfunction Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t`peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none\n\t\t\t\t\tbefore:pointer-events-none before:absolute before:left-1/2 before:top-1/2 before:h-[1.15rem]\n\t\t\t\t\tbefore:w-8 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:border\n\t\t\t\t\tbefore:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]\n\t\t\t\t\tdata-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80\n\t\t\t\t\tfocus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50\n\t\t\t\t\ttransition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96]\n\t\t\t\t\tmotion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SwitchPrimitive.Thumb\n\t\t\t\tdata-slot=\"switch-thumb\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground\n\t\t\t\t\tpointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform\n\t\t\t\t\tdata-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`,\n\t\t\t\t)}\n\t\t\t/>\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n\nexport { Switch };\nexport type { SwitchProps };\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
3
|
+
|
|
4
|
+
type SwitchProps = React.ComponentProps<typeof Switch$1.Root>;
|
|
5
|
+
declare function Switch({ className, ...props }: SwitchProps): React.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { Switch, type SwitchProps };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
4
3
|
|
|
5
4
|
type SwitchProps = React.ComponentProps<typeof Switch$1.Root>;
|
|
6
|
-
declare function Switch({ className, ...props }: SwitchProps):
|
|
5
|
+
declare function Switch({ className, ...props }: SwitchProps): React.JSX.Element;
|
|
7
6
|
|
|
8
7
|
export { Switch, type SwitchProps };
|
|
@@ -13,10 +13,14 @@ function Switch({ className, ...props }) {
|
|
|
13
13
|
{
|
|
14
14
|
"data-slot": "switch",
|
|
15
15
|
className: cn(
|
|
16
|
-
`peer
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
`peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none
|
|
17
|
+
before:pointer-events-none before:absolute before:left-1/2 before:top-1/2 before:h-[1.15rem]
|
|
18
|
+
before:w-8 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:border
|
|
19
|
+
before:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]
|
|
20
|
+
data-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80
|
|
21
|
+
focus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50
|
|
22
|
+
transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96]
|
|
23
|
+
motion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,
|
|
20
24
|
className
|
|
21
25
|
),
|
|
22
26
|
...props,
|
|
@@ -26,7 +30,7 @@ function Switch({ className, ...props }) {
|
|
|
26
30
|
"data-slot": "switch-thumb",
|
|
27
31
|
className: cn(
|
|
28
32
|
`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground
|
|
29
|
-
pointer-events-none block size-4 rounded-full ring-0 transition-transform
|
|
33
|
+
pointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform
|
|
30
34
|
data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`
|
|
31
35
|
)
|
|
32
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/switch.tsx"],"names":["SwitchPrimitive"],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACIA,SAAS,MAAA,CAAO,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgB;AACrD,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/switch.tsx"],"names":["SwitchPrimitive"],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACIA,SAAS,MAAA,CAAO,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgB;AACrD,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oHAAA,CAAA;AAAA,QAQA;AAAA,OACD;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA;AAAA,QAACA,QAAA,CAAgB,KAAA;AAAA,QAAhB;AAAA,UACA,WAAA,EAAU,cAAA;AAAA,UACV,SAAA,EAAW,EAAA;AAAA,YACV,CAAA;AAAA;AAAA,+EAAA;AAAA;AAGD;AAAA;AACD;AAAA,GACD;AAEF","file":"switch.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '../lib/utils';\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\n\nfunction Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t`peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none\n\t\t\t\t\tbefore:pointer-events-none before:absolute before:left-1/2 before:top-1/2 before:h-[1.15rem]\n\t\t\t\t\tbefore:w-8 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:border\n\t\t\t\t\tbefore:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]\n\t\t\t\t\tdata-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80\n\t\t\t\t\tfocus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50\n\t\t\t\t\ttransition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96]\n\t\t\t\t\tmotion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SwitchPrimitive.Thumb\n\t\t\t\tdata-slot=\"switch-thumb\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground\n\t\t\t\t\tpointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform\n\t\t\t\t\tdata-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`,\n\t\t\t\t)}\n\t\t\t/>\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n\nexport { Switch };\nexport type { SwitchProps };\n"]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
// src/lib/utils.ts
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
function Table({ className, containerClassName, containerProps, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "table-container",
|
|
17
|
+
...containerProps,
|
|
18
|
+
className: cn("relative w-full overflow-x-auto", containerClassName),
|
|
19
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
|
+
"table",
|
|
21
|
+
{
|
|
22
|
+
"data-slot": "table",
|
|
23
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function TableHeader({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
"thead",
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "table-header",
|
|
35
|
+
className: cn(
|
|
36
|
+
// Quiet band under headers; kill row hover on thead
|
|
37
|
+
"bg-muted/35 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function TableBody({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
46
|
+
"tbody",
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "table-body",
|
|
49
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function TableFooter({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
"tfoot",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "table-footer",
|
|
59
|
+
className: cn(
|
|
60
|
+
"border-t border-border/60 bg-muted/30 font-medium",
|
|
61
|
+
"[&>tr]:border-b-0 [&>tr]:hover:bg-transparent",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function TableRow({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
+
"tr",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "table-row",
|
|
73
|
+
className: cn(
|
|
74
|
+
"border-b border-border/60",
|
|
75
|
+
// Specific properties only — interruptible hover/selection
|
|
76
|
+
"transition-colors duration-150 ease-out",
|
|
77
|
+
"hover:bg-muted/40 data-[state=selected]:bg-muted",
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function TableHead({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"th",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "table-head",
|
|
89
|
+
className: cn(
|
|
90
|
+
"h-11 px-4 text-left align-middle text-xs font-medium tracking-wide text-muted-foreground",
|
|
91
|
+
"whitespace-nowrap",
|
|
92
|
+
"[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px",
|
|
93
|
+
className
|
|
94
|
+
),
|
|
95
|
+
...props
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function TableCell({ className, ...props }) {
|
|
100
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
101
|
+
"td",
|
|
102
|
+
{
|
|
103
|
+
"data-slot": "table-cell",
|
|
104
|
+
className: cn(
|
|
105
|
+
"px-4 py-3 align-middle whitespace-nowrap",
|
|
106
|
+
"[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function TableCaption({ className, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
115
|
+
"caption",
|
|
116
|
+
{
|
|
117
|
+
"data-slot": "table-caption",
|
|
118
|
+
className: cn("mt-3 text-pretty text-sm text-muted-foreground", className),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
exports.Table = Table;
|
|
125
|
+
exports.TableBody = TableBody;
|
|
126
|
+
exports.TableCaption = TableCaption;
|
|
127
|
+
exports.TableCell = TableCell;
|
|
128
|
+
exports.TableFooter = TableFooter;
|
|
129
|
+
exports.TableHead = TableHead;
|
|
130
|
+
exports.TableHeader = TableHeader;
|
|
131
|
+
exports.TableRow = TableRow;
|
|
132
|
+
//# sourceMappingURL=table.cjs.map
|
|
133
|
+
//# sourceMappingURL=table.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/table.tsx"],"names":["twMerge","clsx","jsx"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACUA,SAAS,MAAM,EAAE,SAAA,EAAW,oBAAoB,cAAA,EAAgB,GAAG,OAAM,EAAe;AACvF,EAAA,uBACCC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,iBAAA;AAAA,MACT,GAAG,cAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,iCAAA,EAAmC,kBAAkB,CAAA;AAAA,MAEnE,QAAA,kBAAAA,cAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACA,WAAA,EAAU,OAAA;AAAA,UACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,UACvD,GAAG;AAAA;AAAA;AACL;AAAA,GACD;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkC;AAC5E,EAAA,uBACCA,cAAA;AAAA,IAAC,OAAA;AAAA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GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,SAAA,CAAU,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AACvE,EAAA,uBACCA,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,YAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,0CAAA;AAAA,QACA,kEAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AAC/E,EAAA,uBACCA,cAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,gDAAA,EAAkD,SAAS,CAAA;AAAA,MACxE,GAAG;AAAA;AAAA,GACL;AAEF","file":"table.cjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype TableProps = React.ComponentProps<'table'> & {\n\t/** Classes for the horizontal scroll wrapper around the table */\n\tcontainerClassName?: string;\n\t/** Extra props for the scroll wrapper (e.g. ref, data attributes) */\n\tcontainerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;\n};\n\n/**\n * Semantic table primitives. `Table` wraps the native element in an overflow\n * container so wide content scrolls without breaking page layout.\n */\nfunction Table({ className, containerClassName, containerProps, ...props }: TableProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\t{...containerProps}\n\t\t\tclassName={cn('relative w-full overflow-x-auto', containerClassName)}\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn('w-full caption-bottom text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t// Quiet band under headers; kill row hover on thead\n\t\t\t\t'bg-muted/35 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn('[&_tr:last-child]:border-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-t border-border/60 bg-muted/30 font-medium',\n\t\t\t\t'[&>tr]:border-b-0 [&>tr]:hover:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-b border-border/60',\n\t\t\t\t// Specific properties only — interruptible hover/selection\n\t\t\t\t'transition-colors duration-150 ease-out',\n\t\t\t\t'hover:bg-muted/40 data-[state=selected]:bg-muted',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t'h-11 px-4 text-left align-middle text-xs font-medium tracking-wide text-muted-foreground',\n\t\t\t\t'whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\n\t\t\t\t'px-4 py-3 align-middle whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn('mt-3 text-pretty text-sm text-muted-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableBody,\n\tTableCaption,\n\tTableCell,\n\tTableFooter,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n};\nexport type { TableProps };\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type TableProps = React.ComponentProps<'table'> & {
|
|
4
|
+
/** Classes for the horizontal scroll wrapper around the table */
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
/** Extra props for the scroll wrapper (e.g. ref, data attributes) */
|
|
7
|
+
containerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Semantic table primitives. `Table` wraps the native element in an overflow
|
|
11
|
+
* container so wide content scrolls without breaking page layout.
|
|
12
|
+
*/
|
|
13
|
+
declare function Table({ className, containerClassName, containerProps, ...props }: TableProps): React.JSX.Element;
|
|
14
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
|
|
15
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
|
|
16
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
|
|
17
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): React.JSX.Element;
|
|
18
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): React.JSX.Element;
|
|
19
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): React.JSX.Element;
|
|
20
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): React.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow };
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
type TableProps = React.ComponentProps<'table'> & {
|
|
4
|
+
/** Classes for the horizontal scroll wrapper around the table */
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
/** Extra props for the scroll wrapper (e.g. ref, data attributes) */
|
|
7
|
+
containerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Semantic table primitives. `Table` wraps the native element in an overflow
|
|
11
|
+
* container so wide content scrolls without breaking page layout.
|
|
12
|
+
*/
|
|
13
|
+
declare function Table({ className, containerClassName, containerProps, ...props }: TableProps): React.JSX.Element;
|
|
14
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
|
|
15
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
|
|
16
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
|
|
17
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): React.JSX.Element;
|
|
18
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): React.JSX.Element;
|
|
19
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): React.JSX.Element;
|
|
20
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): React.JSX.Element;
|
|
14
21
|
|
|
15
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
22
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow };
|
package/dist/components/table.js
CHANGED
|
@@ -7,24 +7,58 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
7
7
|
function cn(...inputs) {
|
|
8
8
|
return twMerge(clsx(inputs));
|
|
9
9
|
}
|
|
10
|
-
function Table({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
function Table({ className, containerClassName, containerProps, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "table-container",
|
|
15
|
+
...containerProps,
|
|
16
|
+
className: cn("relative w-full overflow-x-auto", containerClassName),
|
|
17
|
+
children: /* @__PURE__ */ jsx(
|
|
18
|
+
"table",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "table",
|
|
21
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
);
|
|
15
27
|
}
|
|
16
28
|
function TableHeader({ className, ...props }) {
|
|
17
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
"thead",
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "table-header",
|
|
33
|
+
className: cn(
|
|
34
|
+
// Quiet band under headers; kill row hover on thead
|
|
35
|
+
"bg-muted/35 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent",
|
|
36
|
+
className
|
|
37
|
+
),
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
);
|
|
18
41
|
}
|
|
19
42
|
function TableBody({ className, ...props }) {
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
"tbody",
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "table-body",
|
|
47
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
21
51
|
}
|
|
22
52
|
function TableFooter({ className, ...props }) {
|
|
23
53
|
return /* @__PURE__ */ jsx(
|
|
24
54
|
"tfoot",
|
|
25
55
|
{
|
|
26
56
|
"data-slot": "table-footer",
|
|
27
|
-
className: cn(
|
|
57
|
+
className: cn(
|
|
58
|
+
"border-t border-border/60 bg-muted/30 font-medium",
|
|
59
|
+
"[&>tr]:border-b-0 [&>tr]:hover:bg-transparent",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
28
62
|
...props
|
|
29
63
|
}
|
|
30
64
|
);
|
|
@@ -34,7 +68,13 @@ function TableRow({ className, ...props }) {
|
|
|
34
68
|
"tr",
|
|
35
69
|
{
|
|
36
70
|
"data-slot": "table-row",
|
|
37
|
-
className: cn(
|
|
71
|
+
className: cn(
|
|
72
|
+
"border-b border-border/60",
|
|
73
|
+
// Specific properties only — interruptible hover/selection
|
|
74
|
+
"transition-colors duration-150 ease-out",
|
|
75
|
+
"hover:bg-muted/40 data-[state=selected]:bg-muted",
|
|
76
|
+
className
|
|
77
|
+
),
|
|
38
78
|
...props
|
|
39
79
|
}
|
|
40
80
|
);
|
|
@@ -45,8 +85,9 @@ function TableHead({ className, ...props }) {
|
|
|
45
85
|
{
|
|
46
86
|
"data-slot": "table-head",
|
|
47
87
|
className: cn(
|
|
48
|
-
|
|
49
|
-
|
|
88
|
+
"h-11 px-4 text-left align-middle text-xs font-medium tracking-wide text-muted-foreground",
|
|
89
|
+
"whitespace-nowrap",
|
|
90
|
+
"[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px",
|
|
50
91
|
className
|
|
51
92
|
),
|
|
52
93
|
...props
|
|
@@ -54,10 +95,28 @@ function TableHead({ className, ...props }) {
|
|
|
54
95
|
);
|
|
55
96
|
}
|
|
56
97
|
function TableCell({ className, ...props }) {
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
"td",
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "table-cell",
|
|
102
|
+
className: cn(
|
|
103
|
+
"px-4 py-3 align-middle whitespace-nowrap",
|
|
104
|
+
"[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px",
|
|
105
|
+
className
|
|
106
|
+
),
|
|
107
|
+
...props
|
|
108
|
+
}
|
|
109
|
+
);
|
|
58
110
|
}
|
|
59
111
|
function TableCaption({ className, ...props }) {
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
112
|
+
return /* @__PURE__ */ jsx(
|
|
113
|
+
"caption",
|
|
114
|
+
{
|
|
115
|
+
"data-slot": "table-caption",
|
|
116
|
+
className: cn("mt-3 text-pretty text-sm text-muted-foreground", className),
|
|
117
|
+
...props
|
|
118
|
+
}
|
|
119
|
+
);
|
|
61
120
|
}
|
|
62
121
|
|
|
63
122
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/table.tsx"],"names":[],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/table.tsx"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","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype TableProps = React.ComponentProps<'table'> & {\n\t/** Classes for the horizontal scroll wrapper around the table */\n\tcontainerClassName?: string;\n\t/** Extra props for the scroll wrapper (e.g. ref, data attributes) */\n\tcontainerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;\n};\n\n/**\n * Semantic table primitives. `Table` wraps the native element in an overflow\n * container so wide content scrolls without breaking page layout.\n */\nfunction Table({ className, containerClassName, containerProps, ...props }: TableProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\t{...containerProps}\n\t\t\tclassName={cn('relative w-full overflow-x-auto', containerClassName)}\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn('w-full caption-bottom text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t// Quiet band under headers; kill row hover on thead\n\t\t\t\t'bg-muted/35 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn('[&_tr:last-child]:border-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-t border-border/60 bg-muted/30 font-medium',\n\t\t\t\t'[&>tr]:border-b-0 [&>tr]:hover:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-b border-border/60',\n\t\t\t\t// Specific properties only — interruptible hover/selection\n\t\t\t\t'transition-colors duration-150 ease-out',\n\t\t\t\t'hover:bg-muted/40 data-[state=selected]:bg-muted',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t'h-11 px-4 text-left align-middle text-xs font-medium tracking-wide text-muted-foreground',\n\t\t\t\t'whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\n\t\t\t\t'px-4 py-3 align-middle whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn('mt-3 text-pretty text-sm text-muted-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableBody,\n\tTableCaption,\n\tTableCell,\n\tTableFooter,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n};\nexport type { TableProps };\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var tabs = require('@base-ui/react/tabs');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
function Tabs({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.Root, { "data-slot": "tabs", className: cn("flex flex-col gap-2", className), ...props });
|
|
14
|
+
}
|
|
15
|
+
function TabsList({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
+
tabs.Tabs.List,
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "tabs-list",
|
|
20
|
+
className: cn(
|
|
21
|
+
"bg-muted text-muted-foreground/70 inline-flex w-fit items-center justify-center rounded-md p-0.5",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function TabsTrigger({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
tabs.Tabs.Tab,
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "tabs-trigger",
|
|
33
|
+
className: cn(
|
|
34
|
+
`hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground
|
|
35
|
+
focus-visible:border-ring focus-visible:ring-ring/50 inline-flex min-h-10 min-w-10 items-center justify-center rounded-[calc(var(--radius-md)-2px)] px-3
|
|
36
|
+
text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] outline-none pointer-coarse:min-h-11 focus-visible:ring-[3px]
|
|
37
|
+
data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[active]:shadow-xs [&_svg]:shrink-0`,
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function TabsContent({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.Panel, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports.Tabs = Tabs;
|
|
49
|
+
exports.TabsContent = TabsContent;
|
|
50
|
+
exports.TabsList = TabsList;
|
|
51
|
+
exports.TabsTrigger = TabsTrigger;
|
|
52
|
+
//# sourceMappingURL=tabs.cjs.map
|
|
53
|
+
//# sourceMappingURL=tabs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/tabs.tsx"],"names":["twMerge","clsx","jsx","TabsPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,SAAS,IAAA,CAAK,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AACvF,EAAA,uBAAOC,cAAA,CAACC,SAAA,CAAc,IAAA,EAAd,EAAmB,WAAA,EAAU,MAAA,EAAO,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACzG;AAEA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AAC3F,EAAA,uBACCD,cAAA;AAAA,IAACC,SAAA,CAAc,IAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,kGAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAmD;AAC7F,EAAA,uBACCD,cAAA;AAAA,IAACC,SAAA,CAAc,GAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,2GAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqD;AAC/F,EAAA,uBAAOD,cAAA,CAACC,SAAA,CAAc,KAAA,EAAd,EAAoB,WAAA,EAAU,cAAA,EAAe,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClH","file":"tabs.cjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn <TabsPrimitive.Root data-slot=\"tabs\" className={cn('flex flex-col gap-2', className)} {...props} />;\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tdata-slot=\"tabs-list\"\n\t\t\tclassName={cn(\n\t\t\t\t'bg-muted text-muted-foreground/70 inline-flex w-fit items-center justify-center rounded-md p-0.5',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>) {\n\treturn (\n\t\t<TabsPrimitive.Tab\n\t\t\tdata-slot=\"tabs-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t`hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground\n\t\t\t\t\tfocus-visible:border-ring focus-visible:ring-ring/50 inline-flex min-h-10 min-w-10 items-center justify-center rounded-[calc(var(--radius-md)-2px)] px-3\n\t\t\t\t\ttext-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] outline-none pointer-coarse:min-h-11 focus-visible:ring-[3px]\n\t\t\t\tdata-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[active]:shadow-xs [&_svg]:shrink-0`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>) {\n\treturn <TabsPrimitive.Panel data-slot=\"tabs-content\" className={cn('flex-1 outline-none', className)} {...props} />;\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
3
|
+
|
|
4
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof Tabs$1.Root>): React.JSX.Element;
|
|
5
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>): React.JSX.Element;
|
|
6
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Tab>): React.JSX.Element;
|
|
7
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Panel>): React.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
4
3
|
|
|
5
|
-
declare function Tabs({ className, ...props }: React.ComponentProps<typeof Tabs$1.Root>):
|
|
6
|
-
declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>):
|
|
7
|
-
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Tab>):
|
|
8
|
-
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Panel>):
|
|
4
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof Tabs$1.Root>): React.JSX.Element;
|
|
5
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>): React.JSX.Element;
|
|
6
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Tab>): React.JSX.Element;
|
|
7
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Panel>): React.JSX.Element;
|
|
9
8
|
|
|
10
9
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
package/dist/components/tabs.js
CHANGED
|
@@ -30,8 +30,8 @@ function TabsTrigger({ className, ...props }) {
|
|
|
30
30
|
"data-slot": "tabs-trigger",
|
|
31
31
|
className: cn(
|
|
32
32
|
`hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
focus-visible:border-ring focus-visible:ring-ring/50 inline-flex min-h-10 min-w-10 items-center justify-center rounded-[calc(var(--radius-md)-2px)] px-3
|
|
34
|
+
text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] outline-none pointer-coarse:min-h-11 focus-visible:ring-[3px]
|
|
35
35
|
data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[active]:shadow-xs [&_svg]:shrink-0`,
|
|
36
36
|
className
|
|
37
37
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/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 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn <TabsPrimitive.Root data-slot=\"tabs\" className={cn('flex flex-col gap-2', className)} {...props} />;\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tdata-slot=\"tabs-list\"\n\t\t\tclassName={cn(\n\t\t\t\t'bg-muted text-muted-foreground/70 inline-flex w-fit items-center justify-center rounded-md p-0.5',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>) {\n\treturn (\n\t\t<TabsPrimitive.Tab\n\t\t\tdata-slot=\"tabs-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t`hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground\n\t\t\t\tfocus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center justify-center rounded-
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/tabs.tsx"],"names":["TabsPrimitive"],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,SAAS,IAAA,CAAK,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AACvF,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAc,IAAA,EAAd,EAAmB,WAAA,EAAU,MAAA,EAAO,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACzG;AAEA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AAC3F,EAAA,uBACC,GAAA;AAAA,IAACA,MAAA,CAAc,IAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,kGAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAmD;AAC7F,EAAA,uBACC,GAAA;AAAA,IAACA,MAAA,CAAc,GAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,2GAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqD;AAC/F,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAc,KAAA,EAAd,EAAoB,WAAA,EAAU,cAAA,EAAe,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClH","file":"tabs.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn <TabsPrimitive.Root data-slot=\"tabs\" className={cn('flex flex-col gap-2', className)} {...props} />;\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tdata-slot=\"tabs-list\"\n\t\t\tclassName={cn(\n\t\t\t\t'bg-muted text-muted-foreground/70 inline-flex w-fit items-center justify-center rounded-md p-0.5',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>) {\n\treturn (\n\t\t<TabsPrimitive.Tab\n\t\t\tdata-slot=\"tabs-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t`hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground\n\t\t\t\t\tfocus-visible:border-ring focus-visible:ring-ring/50 inline-flex min-h-10 min-w-10 items-center justify-center rounded-[calc(var(--radius-md)-2px)] px-3\n\t\t\t\t\ttext-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] outline-none pointer-coarse:min-h-11 focus-visible:ring-[3px]\n\t\t\t\tdata-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[active]:shadow-xs [&_svg]:shrink-0`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>) {\n\treturn <TabsPrimitive.Panel data-slot=\"tabs-content\" className={cn('flex-1 outline-none', className)} {...props} />;\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"]}
|