@duestel/ui 0.1.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/README.md +110 -0
- package/dist/components/accordion/Accordion.d.ts +34 -0
- package/dist/components/accordion/Accordion.js +54 -0
- package/dist/components/accordion/Accordion.js.map +1 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/alert-dialog/AlertDialog.d.ts +53 -0
- package/dist/components/alert-dialog/AlertDialog.js +69 -0
- package/dist/components/alert-dialog/AlertDialog.js.map +1 -0
- package/dist/components/alert-dialog/index.d.ts +1 -0
- package/dist/components/alert-dialog/index.js +2 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +90 -0
- package/dist/components/autocomplete/Autocomplete.js +137 -0
- package/dist/components/autocomplete/Autocomplete.js.map +1 -0
- package/dist/components/autocomplete/index.d.ts +1 -0
- package/dist/components/autocomplete/index.js +2 -0
- package/dist/components/avatar/Avatar.d.ts +44 -0
- package/dist/components/avatar/Avatar.js +45 -0
- package/dist/components/avatar/Avatar.js.map +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/badge/Badge.d.ts +43 -0
- package/dist/components/badge/Badge.js +32 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/button/Button.d.ts +60 -0
- package/dist/components/button/Button.js +61 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/carousel/Carousel.d.ts +32 -0
- package/dist/components/carousel/Carousel.js +113 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/carousel/index.js +2 -0
- package/dist/components/checkbox/Checkbox.d.ts +64 -0
- package/dist/components/checkbox/Checkbox.js +59 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/collapsible/Collapsible.d.ts +28 -0
- package/dist/components/collapsible/Collapsible.js +40 -0
- package/dist/components/collapsible/Collapsible.js.map +1 -0
- package/dist/components/collapsible/index.d.ts +1 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/combobox/Combobox.d.ts +113 -0
- package/dist/components/combobox/Combobox.js +189 -0
- package/dist/components/combobox/Combobox.js.map +1 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/command/Command.d.ts +37 -0
- package/dist/components/command/Command.js +90 -0
- package/dist/components/command/Command.js.map +1 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/command/index.js +2 -0
- package/dist/components/context-menu/ContextMenu.d.ts +76 -0
- package/dist/components/context-menu/ContextMenu.js +132 -0
- package/dist/components/context-menu/ContextMenu.js.map +1 -0
- package/dist/components/context-menu/index.d.ts +1 -0
- package/dist/components/context-menu/index.js +2 -0
- package/dist/components/data-table/DataTable.d.ts +32 -0
- package/dist/components/data-table/DataTable.js +102 -0
- package/dist/components/data-table/DataTable.js.map +1 -0
- package/dist/components/data-table/Table.d.ts +51 -0
- package/dist/components/data-table/Table.js +69 -0
- package/dist/components/data-table/Table.js.map +1 -0
- package/dist/components/data-table/index.d.ts +3 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/date-picker/DatePicker.d.ts +63 -0
- package/dist/components/date-picker/DatePicker.js +247 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/dialog/Dialog.d.ts +59 -0
- package/dist/components/dialog/Dialog.js +71 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/drawer/Drawer.d.ts +93 -0
- package/dist/components/drawer/Drawer.js +106 -0
- package/dist/components/drawer/Drawer.js.map +1 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/form/Field.d.ts +52 -0
- package/dist/components/form/Field.js +54 -0
- package/dist/components/form/Field.js.map +1 -0
- package/dist/components/form/Fieldset.d.ts +24 -0
- package/dist/components/form/Fieldset.js +24 -0
- package/dist/components/form/Fieldset.js.map +1 -0
- package/dist/components/form/Form.d.ts +18 -0
- package/dist/components/form/Form.js +14 -0
- package/dist/components/form/Form.js.map +1 -0
- package/dist/components/form/Input.d.ts +33 -0
- package/dist/components/form/Input.js +99 -0
- package/dist/components/form/Input.js.map +1 -0
- package/dist/components/form/app-form.d.ts +71 -0
- package/dist/components/form/app-form.js +95 -0
- package/dist/components/form/app-form.js.map +1 -0
- package/dist/components/form/index.d.ts +5 -0
- package/dist/components/form/index.js +6 -0
- package/dist/components/hotkeys/Kbd.d.ts +20 -0
- package/dist/components/hotkeys/Kbd.js +31 -0
- package/dist/components/hotkeys/Kbd.js.map +1 -0
- package/dist/components/hotkeys/hotkeys.d.ts +14 -0
- package/dist/components/hotkeys/hotkeys.js +2 -0
- package/dist/components/hotkeys/index.d.ts +2 -0
- package/dist/components/hotkeys/index.js +3 -0
- package/dist/components/menu/Menu.d.ts +84 -0
- package/dist/components/menu/Menu.js +142 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/menu/index.js +2 -0
- package/dist/components/menubar/Menubar.d.ts +87 -0
- package/dist/components/menubar/Menubar.js +142 -0
- package/dist/components/menubar/Menubar.js.map +1 -0
- package/dist/components/menubar/index.d.ts +1 -0
- package/dist/components/menubar/index.js +2 -0
- package/dist/components/meter/Meter.d.ts +33 -0
- package/dist/components/meter/Meter.js +45 -0
- package/dist/components/meter/Meter.js.map +1 -0
- package/dist/components/meter/index.d.ts +1 -0
- package/dist/components/meter/index.js +2 -0
- package/dist/components/navigation-menu/NavigationMenu.d.ts +81 -0
- package/dist/components/navigation-menu/NavigationMenu.js +112 -0
- package/dist/components/navigation-menu/NavigationMenu.js.map +1 -0
- package/dist/components/navigation-menu/index.d.ts +1 -0
- package/dist/components/navigation-menu/index.js +2 -0
- package/dist/components/number-field/NumberField.d.ts +53 -0
- package/dist/components/number-field/NumberField.js +72 -0
- package/dist/components/number-field/NumberField.js.map +1 -0
- package/dist/components/number-field/index.d.ts +1 -0
- package/dist/components/number-field/index.js +2 -0
- package/dist/components/otp-field/OtpField.d.ts +33 -0
- package/dist/components/otp-field/OtpField.js +31 -0
- package/dist/components/otp-field/OtpField.js.map +1 -0
- package/dist/components/otp-field/index.d.ts +1 -0
- package/dist/components/otp-field/index.js +2 -0
- package/dist/components/pagination/Pagination.d.ts +17 -0
- package/dist/components/pagination/Pagination.js +75 -0
- package/dist/components/pagination/Pagination.js.map +1 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/popover/Popover.d.ts +73 -0
- package/dist/components/popover/Popover.js +97 -0
- package/dist/components/popover/Popover.js.map +1 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/preview-card/PreviewCard.d.ts +60 -0
- package/dist/components/preview-card/PreviewCard.js +83 -0
- package/dist/components/preview-card/PreviewCard.js.map +1 -0
- package/dist/components/preview-card/index.d.ts +1 -0
- package/dist/components/preview-card/index.js +2 -0
- package/dist/components/progress/Progress.d.ts +36 -0
- package/dist/components/progress/Progress.js +45 -0
- package/dist/components/progress/Progress.js.map +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.js +2 -0
- package/dist/components/radio/Radio.d.ts +39 -0
- package/dist/components/radio/Radio.js +39 -0
- package/dist/components/radio/Radio.js.map +1 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/index.js +2 -0
- package/dist/components/resizable/Resizable.d.ts +35 -0
- package/dist/components/resizable/Resizable.js +38 -0
- package/dist/components/resizable/Resizable.js.map +1 -0
- package/dist/components/resizable/index.d.ts +1 -0
- package/dist/components/resizable/index.js +2 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +37 -0
- package/dist/components/scroll-area/ScrollArea.js +52 -0
- package/dist/components/scroll-area/ScrollArea.js.map +1 -0
- package/dist/components/scroll-area/index.d.ts +1 -0
- package/dist/components/scroll-area/index.js +2 -0
- package/dist/components/select/Select.d.ts +94 -0
- package/dist/components/select/Select.js +151 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/separator/Separator.d.ts +29 -0
- package/dist/components/separator/Separator.js +20 -0
- package/dist/components/separator/Separator.js.map +1 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/slider/Slider.d.ts +53 -0
- package/dist/components/slider/Slider.js +70 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/switch/Switch.d.ts +28 -0
- package/dist/components/switch/Switch.js +31 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/tabs/Tabs.d.ts +41 -0
- package/dist/components/tabs/Tabs.js +45 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/toast/Toast.d.ts +70 -0
- package/dist/components/toast/Toast.js +95 -0
- package/dist/components/toast/Toast.js.map +1 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toggle/Toggle.d.ts +38 -0
- package/dist/components/toggle/Toggle.js +30 -0
- package/dist/components/toggle/Toggle.js.map +1 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/index.js +2 -0
- package/dist/components/toolbar/Toolbar.d.ts +50 -0
- package/dist/components/toolbar/Toolbar.js +59 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/toolbar/index.d.ts +1 -0
- package/dist/components/toolbar/index.js +2 -0
- package/dist/components/tooltip/Tooltip.d.ts +58 -0
- package/dist/components/tooltip/Tooltip.js +57 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +48 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.js +29 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/theme.css +109 -0
- package/package.json +131 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { Check as t, ChevronDown as n, ChevronUp as r } from "lucide-react";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import { Select as a } from "@base-ui/react/select";
|
|
5
|
+
//#region src/components/select/Select.tsx
|
|
6
|
+
var o = a.Root, s = a.Portal;
|
|
7
|
+
function c({ className: t, ...n }) {
|
|
8
|
+
return /* @__PURE__ */ i(a.Label, {
|
|
9
|
+
className: e("mb-1.5 block text-label-large text-on-surface", t),
|
|
10
|
+
...n
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function l({ className: t, ...n }) {
|
|
14
|
+
return /* @__PURE__ */ i(a.Trigger, {
|
|
15
|
+
className: e("group flex h-14 min-w-48 cursor-pointer select-none items-center justify-between gap-3 pl-4 pr-3", "rounded-extra-small border border-outline bg-surface text-body-large text-on-surface", "transition-colors hover:bg-on-surface/[0.08]", "focus-visible:border-primary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "data-[popup-open]:border-primary", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]", t),
|
|
16
|
+
...n
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function u({ className: t, ...n }) {
|
|
20
|
+
return /* @__PURE__ */ i(a.Value, {
|
|
21
|
+
className: e("truncate text-left data-[placeholder]:text-on-surface-variant", t),
|
|
22
|
+
...n
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function d({ className: t, children: r, ...o }) {
|
|
26
|
+
return /* @__PURE__ */ i(a.Icon, {
|
|
27
|
+
className: e("flex shrink-0 text-on-surface-variant", "transition-transform duration-200 ease-out group-data-[popup-open]:rotate-180", t),
|
|
28
|
+
...o,
|
|
29
|
+
children: r ?? /* @__PURE__ */ i(n, {
|
|
30
|
+
"aria-hidden": !0,
|
|
31
|
+
className: "size-5"
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function f({ className: t, ...n }) {
|
|
36
|
+
return /* @__PURE__ */ i(a.Backdrop, {
|
|
37
|
+
className: e("fixed inset-0 z-40", t),
|
|
38
|
+
...n
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function p({ className: t, ...n }) {
|
|
42
|
+
return /* @__PURE__ */ i(a.Positioner, {
|
|
43
|
+
sideOffset: 4,
|
|
44
|
+
alignItemWithTrigger: !1,
|
|
45
|
+
className: e("z-50 outline-none", t),
|
|
46
|
+
...n
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function m({ className: t, ...n }) {
|
|
50
|
+
return /* @__PURE__ */ i(a.Popup, {
|
|
51
|
+
className: e("max-h-[min(24rem,var(--available-height))] w-(--anchor-width) overflow-y-auto overscroll-contain", "rounded-small bg-surface-container py-2 text-on-surface shadow-mm-2", "origin-(--transform-origin) transition-[transform,opacity] duration-150 ease-out", "outline-none data-[ending-style]:scale-95 data-[ending-style]:opacity-0", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", t),
|
|
52
|
+
...n
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function h({ className: t, ...n }) {
|
|
56
|
+
return /* @__PURE__ */ i(a.Arrow, {
|
|
57
|
+
className: e("flex", t),
|
|
58
|
+
...n
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function g({ className: t, ...n }) {
|
|
62
|
+
return /* @__PURE__ */ i(a.List, {
|
|
63
|
+
className: e("outline-none", t),
|
|
64
|
+
...n
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function _({ className: t, ...n }) {
|
|
68
|
+
return /* @__PURE__ */ i(a.Item, {
|
|
69
|
+
className: e("grid min-h-12 cursor-pointer select-none grid-cols-[1fr_auto] items-center gap-3 px-4", "text-label-large text-on-surface outline-none transition-colors", "data-[highlighted]:bg-on-surface/[0.08]", "data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]", t),
|
|
70
|
+
...n
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function v({ className: t, ...n }) {
|
|
74
|
+
return /* @__PURE__ */ i(a.ItemText, {
|
|
75
|
+
className: e("truncate", t),
|
|
76
|
+
...n
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function y({ className: n, children: r, ...o }) {
|
|
80
|
+
return /* @__PURE__ */ i(a.ItemIndicator, {
|
|
81
|
+
className: e("col-start-2 flex shrink-0 items-center text-primary", n),
|
|
82
|
+
...o,
|
|
83
|
+
children: r ?? /* @__PURE__ */ i(t, {
|
|
84
|
+
"aria-hidden": !0,
|
|
85
|
+
className: "size-5"
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function b({ className: t, children: n, ...o }) {
|
|
90
|
+
return /* @__PURE__ */ i(a.ScrollUpArrow, {
|
|
91
|
+
className: e("sticky top-0 z-10 flex w-full items-center justify-center py-1", "bg-surface-container text-on-surface-variant", t),
|
|
92
|
+
...o,
|
|
93
|
+
children: n ?? /* @__PURE__ */ i(r, {
|
|
94
|
+
"aria-hidden": !0,
|
|
95
|
+
className: "size-4"
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function x({ className: t, children: r, ...o }) {
|
|
100
|
+
return /* @__PURE__ */ i(a.ScrollDownArrow, {
|
|
101
|
+
className: e("sticky bottom-0 z-10 flex w-full items-center justify-center py-1", "bg-surface-container text-on-surface-variant", t),
|
|
102
|
+
...o,
|
|
103
|
+
children: r ?? /* @__PURE__ */ i(n, {
|
|
104
|
+
"aria-hidden": !0,
|
|
105
|
+
className: "size-4"
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function S({ className: t, ...n }) {
|
|
110
|
+
return /* @__PURE__ */ i(a.Group, {
|
|
111
|
+
className: e(t),
|
|
112
|
+
...n
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function C({ className: t, ...n }) {
|
|
116
|
+
return /* @__PURE__ */ i(a.GroupLabel, {
|
|
117
|
+
className: e("px-4 pb-1 pt-3 text-label-medium text-on-surface-variant", t),
|
|
118
|
+
...n
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function w({ className: t, ...n }) {
|
|
122
|
+
return /* @__PURE__ */ i(a.Separator, {
|
|
123
|
+
className: e("mx-4 my-2 h-px bg-outline-variant", t),
|
|
124
|
+
...n
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
var T = {
|
|
128
|
+
Root: o,
|
|
129
|
+
Label: c,
|
|
130
|
+
Trigger: l,
|
|
131
|
+
Value: u,
|
|
132
|
+
Icon: d,
|
|
133
|
+
Portal: s,
|
|
134
|
+
Backdrop: f,
|
|
135
|
+
Positioner: p,
|
|
136
|
+
Popup: m,
|
|
137
|
+
Arrow: h,
|
|
138
|
+
List: g,
|
|
139
|
+
Item: _,
|
|
140
|
+
ItemText: v,
|
|
141
|
+
ItemIndicator: y,
|
|
142
|
+
ScrollUpArrow: b,
|
|
143
|
+
ScrollDownArrow: x,
|
|
144
|
+
Group: S,
|
|
145
|
+
GroupLabel: C,
|
|
146
|
+
Separator: w
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { h as Arrow, f as Backdrop, S as Group, C as GroupLabel, d as Icon, _ as Item, y as ItemIndicator, v as ItemText, c as Label, g as List, m as Popup, s as Portal, p as Positioner, o as Root, x as ScrollDownArrow, b as ScrollUpArrow, T as Select, w as Separator, l as Trigger, u as Value };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","names":[],"sources":["../../../src/components/select/Select.tsx"],"sourcesContent":["import { Select as BaseSelect } from '@base-ui/react/select'\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Select — Material 3 styled wrapper over Base UI's headless Select.\n * Behaviour/accessibility (listbox semantics, typeahead, keyboard navigation,\n * form integration via hidden input): Base UI\n * (https://base-ui.com/react/components/select).\n * Visuals: M3 \"exposed dropdown menu\" anatomy — outlined text-field trigger\n * (56px, extra-small corner, outline → primary while open/focused, trailing\n * chevron), menu popup on surface-container with small corner + level-2\n * elevation, 48px list items with state layers and a trailing selected check.\n * Design refs: port/core/ui/components/dropdown, port/core/ui/components/text-field\n * (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Select.Root>\n * <Select.Label>Fruit</Select.Label>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Pick a fruit\" />\n * <Select.Icon />\n * </Select.Trigger>\n * <Select.Portal>\n * <Select.Positioner>\n * <Select.Popup>\n * <Select.List>\n * <Select.Item value=\"apple\">\n * <Select.ItemText>Apple</Select.ItemText>\n * <Select.ItemIndicator />\n * </Select.Item>\n * </Select.List>\n * </Select.Popup>\n * </Select.Positioner>\n * </Select.Portal>\n * </Select.Root>\n */\n\n// These parts render no HTML element of their own, so there is nothing to\n// style — re-export them directly (preserves Root's value generics).\nconst Root = BaseSelect.Root\nconst Portal = BaseSelect.Portal\n\n/** M3 label above the field (label-large, on-surface). */\nfunction Label({ className, ...props }: ComponentProps<typeof BaseSelect.Label>) {\n return (\n <BaseSelect.Label\n className={cn('mb-1.5 block text-label-large text-on-surface', className)}\n {...props}\n />\n )\n}\n\n/**\n * The M3 outlined text-field box (56px, extra-small corner): outline turns\n * primary while focused or while the popup is open.\n */\nfunction Trigger({ className, ...props }: ComponentProps<typeof BaseSelect.Trigger>) {\n return (\n <BaseSelect.Trigger\n className={cn(\n 'group flex h-14 min-w-48 cursor-pointer select-none items-center justify-between gap-3 pl-4 pr-3',\n 'rounded-extra-small border border-outline bg-surface text-body-large text-on-surface',\n 'transition-colors hover:bg-on-surface/[0.08]',\n 'focus-visible:border-primary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary',\n 'data-[popup-open]:border-primary',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Selected-item text; shows the on-surface-variant placeholder when empty. */\nfunction Value({ className, ...props }: ComponentProps<typeof BaseSelect.Value>) {\n return (\n <BaseSelect.Value\n className={cn('truncate text-left data-[placeholder]:text-on-surface-variant', className)}\n {...props}\n />\n )\n}\n\n/** Trailing chevron; flips while the popup is open (parent Trigger is `group`). */\nfunction Icon({ className, children, ...props }: ComponentProps<typeof BaseSelect.Icon>) {\n return (\n <BaseSelect.Icon\n className={cn(\n 'flex shrink-0 text-on-surface-variant',\n 'transition-transform duration-200 ease-out group-data-[popup-open]:rotate-180',\n className,\n )}\n {...props}\n >\n {children ?? <ChevronDown aria-hidden className=\"size-5\" />}\n </BaseSelect.Icon>\n )\n}\n\nfunction Backdrop({ className, ...props }: ComponentProps<typeof BaseSelect.Backdrop>) {\n return <BaseSelect.Backdrop className={cn('fixed inset-0 z-40', className)} {...props} />\n}\n\n/**\n * Positions the popup as an M3 menu below the field (4px gap) instead of\n * Base UI's native-like \"align selected item with trigger\" default.\n */\nfunction Positioner({ className, ...props }: ComponentProps<typeof BaseSelect.Positioner>) {\n return (\n <BaseSelect.Positioner\n sideOffset={4}\n alignItemWithTrigger={false}\n className={cn('z-50 outline-none', className)}\n {...props}\n />\n )\n}\n\n/** M3 menu container: surface-container, small corner, level-2 elevation. */\nfunction Popup({ className, ...props }: ComponentProps<typeof BaseSelect.Popup>) {\n return (\n <BaseSelect.Popup\n className={cn(\n 'max-h-[min(24rem,var(--available-height))] w-(--anchor-width) overflow-y-auto overscroll-contain',\n 'rounded-small bg-surface-container py-2 text-on-surface shadow-mm-2',\n 'origin-(--transform-origin) transition-[transform,opacity] duration-150 ease-out',\n 'outline-none data-[ending-style]:scale-95 data-[ending-style]:opacity-0',\n 'data-[starting-style]:scale-95 data-[starting-style]:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Arrow({ className, ...props }: ComponentProps<typeof BaseSelect.Arrow>) {\n return <BaseSelect.Arrow className={cn('flex', className)} {...props} />\n}\n\nfunction List({ className, ...props }: ComponentProps<typeof BaseSelect.List>) {\n return <BaseSelect.List className={cn('outline-none', className)} {...props} />\n}\n\n/** M3 menu item: 48px row, label-large, hover/highlight state layers. */\nfunction Item({ className, ...props }: ComponentProps<typeof BaseSelect.Item>) {\n return (\n <BaseSelect.Item\n className={cn(\n 'grid min-h-12 cursor-pointer select-none grid-cols-[1fr_auto] items-center gap-3 px-4',\n 'text-label-large text-on-surface outline-none transition-colors',\n 'data-[highlighted]:bg-on-surface/[0.08]',\n 'data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** The item's label text; mirrored into the trigger's Value when selected. */\nfunction ItemText({ className, ...props }: ComponentProps<typeof BaseSelect.ItemText>) {\n return <BaseSelect.ItemText className={cn('truncate', className)} {...props} />\n}\n\n/** Trailing selected check (primary role); only mounted while selected. */\nfunction ItemIndicator({\n className,\n children,\n ...props\n}: ComponentProps<typeof BaseSelect.ItemIndicator>) {\n return (\n <BaseSelect.ItemIndicator\n className={cn('col-start-2 flex shrink-0 items-center text-primary', className)}\n {...props}\n >\n {children ?? <Check aria-hidden className=\"size-5\" />}\n </BaseSelect.ItemIndicator>\n )\n}\n\n/** Hover-to-scroll affordance pinned to the top of an overflowing popup. */\nfunction ScrollUpArrow({\n className,\n children,\n ...props\n}: ComponentProps<typeof BaseSelect.ScrollUpArrow>) {\n return (\n <BaseSelect.ScrollUpArrow\n className={cn(\n 'sticky top-0 z-10 flex w-full items-center justify-center py-1',\n 'bg-surface-container text-on-surface-variant',\n className,\n )}\n {...props}\n >\n {children ?? <ChevronUp aria-hidden className=\"size-4\" />}\n </BaseSelect.ScrollUpArrow>\n )\n}\n\n/** Hover-to-scroll affordance pinned to the bottom of an overflowing popup. */\nfunction ScrollDownArrow({\n className,\n children,\n ...props\n}: ComponentProps<typeof BaseSelect.ScrollDownArrow>) {\n return (\n <BaseSelect.ScrollDownArrow\n className={cn(\n 'sticky bottom-0 z-10 flex w-full items-center justify-center py-1',\n 'bg-surface-container text-on-surface-variant',\n className,\n )}\n {...props}\n >\n {children ?? <ChevronDown aria-hidden className=\"size-4\" />}\n </BaseSelect.ScrollDownArrow>\n )\n}\n\nfunction Group({ className, ...props }: ComponentProps<typeof BaseSelect.Group>) {\n return <BaseSelect.Group className={cn(className)} {...props} />\n}\n\n/** M3 list subheader. */\nfunction GroupLabel({ className, ...props }: ComponentProps<typeof BaseSelect.GroupLabel>) {\n return (\n <BaseSelect.GroupLabel\n className={cn('px-4 pb-1 pt-3 text-label-medium text-on-surface-variant', className)}\n {...props}\n />\n )\n}\n\nfunction Separator({ className, ...props }: ComponentProps<typeof BaseSelect.Separator>) {\n return (\n <BaseSelect.Separator\n className={cn('mx-4 my-2 h-px bg-outline-variant', className)}\n {...props}\n />\n )\n}\n\nexport const Select = {\n Root,\n Label,\n Trigger,\n Value,\n Icon,\n Portal,\n Backdrop,\n Positioner,\n Popup,\n Arrow,\n List,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpArrow,\n ScrollDownArrow,\n Group,\n GroupLabel,\n Separator,\n}\nexport {\n Root,\n Label,\n Trigger,\n Value,\n Icon,\n Portal,\n Backdrop,\n Positioner,\n Popup,\n Arrow,\n List,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpArrow,\n ScrollDownArrow,\n Group,\n GroupLabel,\n Separator,\n}\n"],"mappings":";;;;;AA0CA,IAAM,IAAO,EAAW,MAClB,IAAS,EAAW;AAG1B,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EAAG,iDAAiD,CAAS;EACxE,GAAI;CACL,CAAA;AAEL;AAMA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAoD;CACnF,OACE,kBAAC,EAAW,SAAZ;EACE,WAAW,EACT,oGACA,wFACA,gDACA,sHACA,oCACA,qEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EAAG,iEAAiE,CAAS;EACxF,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAK,EAAE,cAAW,aAAU,GAAG,KAAiD;CACvF,OACE,kBAAC,EAAW,MAAZ;EACE,WAAW,EACT,yCACA,iFACA,CACF;EACA,GAAI;YAEH,KAAY,kBAAC,GAAD;GAAa,eAAA;GAAY,WAAU;EAAU,CAAA;CAC3C,CAAA;AAErB;AAEA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAqD;CACrF,OAAO,kBAAC,EAAW,UAAZ;EAAqB,WAAW,EAAG,sBAAsB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC1F;AAMA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAuD;CACzF,OACE,kBAAC,EAAW,YAAZ;EACE,YAAY;EACZ,sBAAsB;EACtB,WAAW,EAAG,qBAAqB,CAAS;EAC5C,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EACT,oGACA,uEACA,oFACA,2EACA,kEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OAAO,kBAAC,EAAW,OAAZ;EAAkB,WAAW,EAAG,QAAQ,CAAS;EAAG,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAiD;CAC7E,OAAO,kBAAC,EAAW,MAAZ;EAAiB,WAAW,EAAG,gBAAgB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAChF;AAGA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAiD;CAC7E,OACE,kBAAC,EAAW,MAAZ;EACE,WAAW,EACT,yFACA,mEACA,2CACA,sFACA,qEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAqD;CACrF,OAAO,kBAAC,EAAW,UAAZ;EAAqB,WAAW,EAAG,YAAY,CAAS;EAAG,GAAI;CAAQ,CAAA;AAChF;AAGA,SAAS,EAAc,EACrB,cACA,aACA,GAAG,KAC+C;CAClD,OACE,kBAAC,EAAW,eAAZ;EACE,WAAW,EAAG,uDAAuD,CAAS;EAC9E,GAAI;YAEH,KAAY,kBAAC,GAAD;GAAO,eAAA;GAAY,WAAU;EAAU,CAAA;CAC5B,CAAA;AAE9B;AAGA,SAAS,EAAc,EACrB,cACA,aACA,GAAG,KAC+C;CAClD,OACE,kBAAC,EAAW,eAAZ;EACE,WAAW,EACT,kEACA,gDACA,CACF;EACA,GAAI;YAEH,KAAY,kBAAC,GAAD;GAAW,eAAA;GAAY,WAAU;EAAU,CAAA;CAChC,CAAA;AAE9B;AAGA,SAAS,EAAgB,EACvB,cACA,aACA,GAAG,KACiD;CACpD,OACE,kBAAC,EAAW,iBAAZ;EACE,WAAW,EACT,qEACA,gDACA,CACF;EACA,GAAI;YAEH,KAAY,kBAAC,GAAD;GAAa,eAAA;GAAY,WAAU;EAAU,CAAA;CAChC,CAAA;AAEhC;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OAAO,kBAAC,EAAW,OAAZ;EAAkB,WAAW,EAAG,CAAS;EAAG,GAAI;CAAQ,CAAA;AACjE;AAGA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAuD;CACzF,OACE,kBAAC,EAAW,YAAZ;EACE,WAAW,EAAG,4DAA4D,CAAS;EACnF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAsD;CACvF,OACE,kBAAC,EAAW,WAAZ;EACE,WAAW,EAAG,qCAAqC,CAAS;EAC5D,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select, Root, Label, Trigger, Value, Icon, Portal, Backdrop, Positioner, Popup, Arrow, List, Item, ItemText, ItemIndicator, ScrollUpArrow, ScrollDownArrow, Group, GroupLabel, Separator, } from './Select';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Arrow as e, Backdrop as t, Group as n, GroupLabel as r, Icon as i, Item as a, ItemIndicator as o, ItemText as s, Label as c, List as l, Popup as u, Portal as d, Positioner as f, Root as p, ScrollDownArrow as m, ScrollUpArrow as h, Select as g, Separator as _, Trigger as v, Value as y } from "./Select.js";
|
|
2
|
+
export { e as Arrow, t as Backdrop, n as Group, r as GroupLabel, i as Icon, a as Item, o as ItemIndicator, s as ItemText, c as Label, l as List, u as Popup, d as Portal, f as Positioner, p as Root, m as ScrollDownArrow, h as ScrollUpArrow, g as Select, _ as Separator, v as Trigger, y as Value };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Separator as BaseSeparator } from '@base-ui/react/separator';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Separator — Material 3 styled wrapper over Base UI's headless Separator.
|
|
5
|
+
* Behaviour/accessibility (role="separator", data-orientation): Base UI
|
|
6
|
+
* (https://base-ui.com/react/components/separator).
|
|
7
|
+
* Visuals: M3 divider anatomy — 1px hairline in the outline-variant role, with
|
|
8
|
+
* full-width, inset, and middle-inset variants (m3.material.io/components/divider).
|
|
9
|
+
* Design ref: port/core/ui/components/divider (see CLAUDE.md).
|
|
10
|
+
*
|
|
11
|
+
* Compound API mirrors Base UI (single part):
|
|
12
|
+
* <Separator.Root /> // full-width horizontal divider
|
|
13
|
+
* <Separator.Root inset="middle" /> // middle-inset divider
|
|
14
|
+
* <Separator.Root orientation="vertical" /> // vertical divider (stretches in flex rows)
|
|
15
|
+
*/
|
|
16
|
+
type RootProps = ComponentProps<typeof BaseSeparator> & {
|
|
17
|
+
/**
|
|
18
|
+
* M3 divider inset variant.
|
|
19
|
+
* - `'none'` (default): full-width / full-height.
|
|
20
|
+
* - `'inset'`: indented on the leading edge (e.g. to align with list text).
|
|
21
|
+
* - `'middle'`: indented on both edges.
|
|
22
|
+
*/
|
|
23
|
+
inset?: 'none' | 'inset' | 'middle';
|
|
24
|
+
};
|
|
25
|
+
declare function Root({ className, inset, ...props }: RootProps): import("react").JSX.Element;
|
|
26
|
+
export declare const Separator: {
|
|
27
|
+
Root: typeof Root;
|
|
28
|
+
};
|
|
29
|
+
export { Root };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Separator as n } from "@base-ui/react/separator";
|
|
4
|
+
//#region src/components/separator/Separator.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
none: "",
|
|
7
|
+
inset: "data-[orientation=horizontal]:ml-4 data-[orientation=vertical]:mt-4",
|
|
8
|
+
middle: "data-[orientation=horizontal]:mx-4 data-[orientation=vertical]:my-4"
|
|
9
|
+
};
|
|
10
|
+
function i({ className: i, inset: a = "none", ...o }) {
|
|
11
|
+
return /* @__PURE__ */ t(n, {
|
|
12
|
+
className: e("shrink-0 bg-outline-variant", "data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full", "data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch", r[a], i),
|
|
13
|
+
...o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
var a = { Root: i };
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as Root, a as Separator };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=Separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Separator.js","names":[],"sources":["../../../src/components/separator/Separator.tsx"],"sourcesContent":["import { Separator as BaseSeparator } from '@base-ui/react/separator'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Separator — Material 3 styled wrapper over Base UI's headless Separator.\n * Behaviour/accessibility (role=\"separator\", data-orientation): Base UI\n * (https://base-ui.com/react/components/separator).\n * Visuals: M3 divider anatomy — 1px hairline in the outline-variant role, with\n * full-width, inset, and middle-inset variants (m3.material.io/components/divider).\n * Design ref: port/core/ui/components/divider (see CLAUDE.md).\n *\n * Compound API mirrors Base UI (single part):\n * <Separator.Root /> // full-width horizontal divider\n * <Separator.Root inset=\"middle\" /> // middle-inset divider\n * <Separator.Root orientation=\"vertical\" /> // vertical divider (stretches in flex rows)\n */\n\ntype RootProps = ComponentProps<typeof BaseSeparator> & {\n /**\n * M3 divider inset variant.\n * - `'none'` (default): full-width / full-height.\n * - `'inset'`: indented on the leading edge (e.g. to align with list text).\n * - `'middle'`: indented on both edges.\n */\n inset?: 'none' | 'inset' | 'middle'\n}\n\nconst insetClasses: Record<NonNullable<RootProps['inset']>, string> = {\n none: '',\n inset: 'data-[orientation=horizontal]:ml-4 data-[orientation=vertical]:mt-4',\n middle: 'data-[orientation=horizontal]:mx-4 data-[orientation=vertical]:my-4',\n}\n\nfunction Root({ className, inset = 'none', ...props }: RootProps) {\n return (\n <BaseSeparator\n className={cn(\n 'shrink-0 bg-outline-variant',\n 'data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch',\n insetClasses[inset],\n className,\n )}\n {...props}\n />\n )\n}\n\nexport const Separator = { Root }\nexport { Root }\n"],"mappings":";;;;AA6BA,IAAM,IAAgE;CACpE,MAAM;CACN,OAAO;CACP,QAAQ;AACV;AAEA,SAAS,EAAK,EAAE,cAAW,WAAQ,QAAQ,GAAG,KAAoB;CAChE,OACE,kBAAC,GAAD;EACE,WAAW,EACT,+BACA,2EACA,6EACA,EAAa,IACb,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAY,EAAE,QAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Separator';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Slider — Material 3 styled wrapper over Base UI's headless Slider.
|
|
5
|
+
* Behaviour/accessibility (pointer + keyboard dragging, hidden range inputs,
|
|
6
|
+
* aria-valuenow/-text, range support): Base UI
|
|
7
|
+
* (https://base-ui.com/react/components/slider).
|
|
8
|
+
* Visuals: M3 slider anatomy — 6px rounded inactive track in
|
|
9
|
+
* surface-container-high, primary active indicator, 20px primary handle with
|
|
10
|
+
* shadow and a 12px hover/focus/drag state-layer halo.
|
|
11
|
+
* Design ref: port/core/ui/components/sliders + the range-input thumb rules in
|
|
12
|
+
* port/styles/globals.css (see CLAUDE.md).
|
|
13
|
+
*
|
|
14
|
+
* Compound API mirrors Base UI:
|
|
15
|
+
* <Slider.Root defaultValue={50}>
|
|
16
|
+
* <Slider.Label>Volume</Slider.Label>
|
|
17
|
+
* <Slider.Value />
|
|
18
|
+
* <Slider.Control>
|
|
19
|
+
* <Slider.Track>
|
|
20
|
+
* <Slider.Indicator />
|
|
21
|
+
* <Slider.Thumb />
|
|
22
|
+
* </Slider.Track>
|
|
23
|
+
* </Slider.Control>
|
|
24
|
+
* </Slider.Root>
|
|
25
|
+
*
|
|
26
|
+
* Range sliders take an array value and one <Slider.Thumb index={n}> per value.
|
|
27
|
+
*/
|
|
28
|
+
declare function Root({ className, ...props }: ComponentProps<typeof BaseSlider.Root>): import("react").JSX.Element;
|
|
29
|
+
declare function Label({ className, ...props }: ComponentProps<typeof BaseSlider.Label>): import("react").JSX.Element;
|
|
30
|
+
declare function Value({ className, ...props }: ComponentProps<typeof BaseSlider.Value>): import("react").JSX.Element;
|
|
31
|
+
declare function Control({ className, ...props }: ComponentProps<typeof BaseSlider.Control>): import("react").JSX.Element;
|
|
32
|
+
declare function Track({ className, ...props }: ComponentProps<typeof BaseSlider.Track>): import("react").JSX.Element;
|
|
33
|
+
declare function Indicator({ className, ...props }: ComponentProps<typeof BaseSlider.Indicator>): import("react").JSX.Element;
|
|
34
|
+
declare function Thumb({ className, ...props }: ComponentProps<typeof BaseSlider.Thumb>): import("react").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* Value bubble above the thumb, ported from port/core/ui/components/sliders:
|
|
37
|
+
* 32px surface-container-high pill with a caret pointing at the thumb,
|
|
38
|
+
* body-small on-surface text. Place inside <Slider.Thumb> — it rides along
|
|
39
|
+
* with the thumb, no position math needed (port computed `left` via refs).
|
|
40
|
+
* Put <Slider.Value /> (or any content) inside it.
|
|
41
|
+
*/
|
|
42
|
+
declare function Tooltip({ className, children, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
43
|
+
export declare const Slider: {
|
|
44
|
+
Root: typeof Root;
|
|
45
|
+
Label: typeof Label;
|
|
46
|
+
Value: typeof Value;
|
|
47
|
+
Control: typeof Control;
|
|
48
|
+
Track: typeof Track;
|
|
49
|
+
Indicator: typeof Indicator;
|
|
50
|
+
Thumb: typeof Thumb;
|
|
51
|
+
Tooltip: typeof Tooltip;
|
|
52
|
+
};
|
|
53
|
+
export { Root, Label, Value, Control, Track, Indicator, Thumb, Tooltip };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { Slider as r } from "@base-ui/react/slider";
|
|
4
|
+
//#region src/components/slider/Slider.tsx
|
|
5
|
+
function i({ className: n, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t(r.Root, {
|
|
7
|
+
className: e("flex w-full flex-col gap-1 text-on-surface", n),
|
|
8
|
+
...i
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function a({ className: n, ...i }) {
|
|
12
|
+
return /* @__PURE__ */ t(r.Label, {
|
|
13
|
+
className: e("text-label-large text-on-surface", n),
|
|
14
|
+
...i
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function o({ className: n, ...i }) {
|
|
18
|
+
return /* @__PURE__ */ t(r.Value, {
|
|
19
|
+
className: e("text-label-medium text-on-surface-variant tabular-nums", n),
|
|
20
|
+
...i
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function s({ className: n, ...i }) {
|
|
24
|
+
return /* @__PURE__ */ t(r.Control, {
|
|
25
|
+
className: e("relative flex h-6 w-full cursor-pointer touch-none items-center select-none", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]", n),
|
|
26
|
+
...i
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function c({ className: n, ...i }) {
|
|
30
|
+
return /* @__PURE__ */ t(r.Track, {
|
|
31
|
+
className: e("relative h-1.5 w-full rounded-full bg-surface-container-high select-none", n),
|
|
32
|
+
...i
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function l({ className: n, ...i }) {
|
|
36
|
+
return /* @__PURE__ */ t(r.Indicator, {
|
|
37
|
+
className: e("rounded-full bg-primary select-none", n),
|
|
38
|
+
...i
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function u({ className: n, ...i }) {
|
|
42
|
+
return /* @__PURE__ */ t(r.Thumb, {
|
|
43
|
+
className: e("size-5 rounded-full bg-primary shadow-mm-1 select-none", "transition-shadow duration-150 ease-out", "hover:ring-[12px] hover:ring-surface-container-highest/30", "has-[:focus-visible]:ring-[12px] has-[:focus-visible]:ring-surface-container-highest/30", "data-[dragging]:ring-[12px] data-[dragging]:ring-surface-container-highest/30", n),
|
|
44
|
+
...i
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function d({ className: r, children: i, ...a }) {
|
|
48
|
+
return /* @__PURE__ */ n("div", {
|
|
49
|
+
className: e("pointer-events-none absolute -top-10 left-1/2 z-10 -translate-x-1/2", "flex h-8 min-w-8 max-w-24 items-center justify-center gap-0.5 rounded-full", "bg-surface-container-high px-1 text-body-small whitespace-nowrap text-on-surface select-none", r),
|
|
50
|
+
...a,
|
|
51
|
+
children: [i, /* @__PURE__ */ t("div", {
|
|
52
|
+
"aria-hidden": !0,
|
|
53
|
+
className: "absolute -bottom-[5px] left-1/2 -translate-x-1/2 border-l-[10px] border-r-[10px] border-t-[8.5px] border-l-transparent border-r-transparent border-t-surface-container-high"
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
var f = {
|
|
58
|
+
Root: i,
|
|
59
|
+
Label: a,
|
|
60
|
+
Value: o,
|
|
61
|
+
Control: s,
|
|
62
|
+
Track: c,
|
|
63
|
+
Indicator: l,
|
|
64
|
+
Thumb: u,
|
|
65
|
+
Tooltip: d
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { s as Control, l as Indicator, a as Label, i as Root, f as Slider, u as Thumb, d as Tooltip, c as Track, o as Value };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","names":[],"sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["import { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Slider — Material 3 styled wrapper over Base UI's headless Slider.\n * Behaviour/accessibility (pointer + keyboard dragging, hidden range inputs,\n * aria-valuenow/-text, range support): Base UI\n * (https://base-ui.com/react/components/slider).\n * Visuals: M3 slider anatomy — 6px rounded inactive track in\n * surface-container-high, primary active indicator, 20px primary handle with\n * shadow and a 12px hover/focus/drag state-layer halo.\n * Design ref: port/core/ui/components/sliders + the range-input thumb rules in\n * port/styles/globals.css (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Slider.Root defaultValue={50}>\n * <Slider.Label>Volume</Slider.Label>\n * <Slider.Value />\n * <Slider.Control>\n * <Slider.Track>\n * <Slider.Indicator />\n * <Slider.Thumb />\n * </Slider.Track>\n * </Slider.Control>\n * </Slider.Root>\n *\n * Range sliders take an array value and one <Slider.Thumb index={n}> per value.\n */\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseSlider.Root>) {\n return (\n <BaseSlider.Root\n className={cn('flex w-full flex-col gap-1 text-on-surface', className)}\n {...props}\n />\n )\n}\n\nfunction Label({ className, ...props }: ComponentProps<typeof BaseSlider.Label>) {\n return (\n <BaseSlider.Label className={cn('text-label-large text-on-surface', className)} {...props} />\n )\n}\n\nfunction Value({ className, ...props }: ComponentProps<typeof BaseSlider.Value>) {\n return (\n <BaseSlider.Value\n className={cn('text-label-medium text-on-surface-variant tabular-nums', className)}\n {...props}\n />\n )\n}\n\nfunction Control({ className, ...props }: ComponentProps<typeof BaseSlider.Control>) {\n return (\n <BaseSlider.Control\n className={cn(\n 'relative flex h-6 w-full cursor-pointer touch-none items-center select-none',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Track({ className, ...props }: ComponentProps<typeof BaseSlider.Track>) {\n return (\n <BaseSlider.Track\n className={cn(\n 'relative h-1.5 w-full rounded-full bg-surface-container-high select-none',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Indicator({ className, ...props }: ComponentProps<typeof BaseSlider.Indicator>) {\n return (\n <BaseSlider.Indicator\n className={cn('rounded-full bg-primary select-none', className)}\n {...props}\n />\n )\n}\n\nfunction Thumb({ className, ...props }: ComponentProps<typeof BaseSlider.Thumb>) {\n return (\n <BaseSlider.Thumb\n className={cn(\n 'size-5 rounded-full bg-primary shadow-mm-1 select-none',\n 'transition-shadow duration-150 ease-out',\n // 12px state-layer halo from the port range-thumb rules; held while dragging.\n 'hover:ring-[12px] hover:ring-surface-container-highest/30',\n 'has-[:focus-visible]:ring-[12px] has-[:focus-visible]:ring-surface-container-highest/30',\n 'data-[dragging]:ring-[12px] data-[dragging]:ring-surface-container-highest/30',\n className,\n )}\n {...props}\n />\n )\n}\n\n/**\n * Value bubble above the thumb, ported from port/core/ui/components/sliders:\n * 32px surface-container-high pill with a caret pointing at the thumb,\n * body-small on-surface text. Place inside <Slider.Thumb> — it rides along\n * with the thumb, no position math needed (port computed `left` via refs).\n * Put <Slider.Value /> (or any content) inside it.\n */\nfunction Tooltip({ className, children, ...props }: ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'pointer-events-none absolute -top-10 left-1/2 z-10 -translate-x-1/2',\n 'flex h-8 min-w-8 max-w-24 items-center justify-center gap-0.5 rounded-full',\n 'bg-surface-container-high px-1 text-body-small whitespace-nowrap text-on-surface select-none',\n className,\n )}\n {...props}\n >\n {children}\n <div\n aria-hidden\n className=\"absolute -bottom-[5px] left-1/2 -translate-x-1/2 border-l-[10px] border-r-[10px] border-t-[8.5px] border-l-transparent border-r-transparent border-t-surface-container-high\"\n />\n </div>\n )\n}\n\nexport const Slider = { Root, Label, Value, Control, Track, Indicator, Thumb, Tooltip }\nexport { Root, Label, Value, Control, Track, Indicator, Thumb, Tooltip }\n"],"mappings":";;;;AA+BA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAiD;CAC7E,OACE,kBAAC,EAAW,MAAZ;EACE,WAAW,EAAG,8CAA8C,CAAS;EACrE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EAAkB,WAAW,EAAG,oCAAoC,CAAS;EAAG,GAAI;CAAQ,CAAA;AAEhG;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EAAG,0DAA0D,CAAS;EACjF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAoD;CACnF,OACE,kBAAC,EAAW,SAAZ;EACE,WAAW,EACT,+EACA,qEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EACT,4EACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAsD;CACvF,OACE,kBAAC,EAAW,WAAZ;EACE,WAAW,EAAG,uCAAuC,CAAS;EAC9D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EACT,0DACA,2CAEA,6DACA,2FACA,iFACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AASA,SAAS,EAAQ,EAAE,cAAW,aAAU,GAAG,KAAgC;CACzE,OACE,kBAAC,OAAD;EACE,WAAW,EACT,uEACA,8EACA,gGACA,CACF;EACA,GAAI;YAPN,CASG,GACD,kBAAC,OAAD;GACE,eAAA;GACA,WAAU;EACX,CAAA,CACE;;AAET;AAEA,IAAa,IAAS;CAAE;CAAM;CAAO;CAAO;CAAS;CAAO;CAAW;CAAO;AAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slider, Root, Label, Value, Control, Track, Indicator, Thumb, Tooltip } from './Slider';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Switch as BaseSwitch } from '@base-ui/react/switch';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Switch — Material 3 styled wrapper over Base UI's headless Switch.
|
|
5
|
+
* Behaviour/accessibility (role="switch", hidden input, keyboard toggling,
|
|
6
|
+
* form submission): Base UI (https://base-ui.com/react/components/switch).
|
|
7
|
+
* Visuals: M3 switch anatomy — 52x32 track (2px outline + surface-container-
|
|
8
|
+
* highest when off, primary fill when on); 16px outline-colored thumb that
|
|
9
|
+
* grows to a 24px on-primary thumb when checked, with a 40px hover state
|
|
10
|
+
* layer halo around the thumb.
|
|
11
|
+
* Design ref: port/core/ui/elements/common/Switch.tsx +
|
|
12
|
+
* port/pages/examples/selection (see CLAUDE.md).
|
|
13
|
+
*
|
|
14
|
+
* Compound API mirrors Base UI:
|
|
15
|
+
* <Switch.Root defaultChecked>
|
|
16
|
+
* <Switch.Thumb />
|
|
17
|
+
* </Switch.Root>
|
|
18
|
+
*/
|
|
19
|
+
declare function Root({ className, ...props }: ComponentProps<typeof BaseSwitch.Root>): import("react").JSX.Element;
|
|
20
|
+
declare function Thumb({ className, ...props }: ComponentProps<typeof BaseSwitch.Thumb>): import("react").JSX.Element;
|
|
21
|
+
/** Convenience `<label>` row pairing the switch with its M3 body-medium text. */
|
|
22
|
+
declare function Label({ className, ...props }: ComponentProps<'label'>): import("react").JSX.Element;
|
|
23
|
+
export declare const Switch: {
|
|
24
|
+
Root: typeof Root;
|
|
25
|
+
Thumb: typeof Thumb;
|
|
26
|
+
Label: typeof Label;
|
|
27
|
+
};
|
|
28
|
+
export { Root, Thumb, Label };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Switch as n } from "@base-ui/react/switch";
|
|
4
|
+
//#region src/components/switch/Switch.tsx
|
|
5
|
+
function r({ className: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
7
|
+
className: e("group relative inline-flex h-8 w-[52px] shrink-0 cursor-pointer rounded-full", "border-2 border-outline bg-surface-container-highest", "transition-colors duration-200 ease-out", "data-[checked]:border-primary data-[checked]:bg-primary", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]", "data-[readonly]:cursor-default", r),
|
|
8
|
+
...i
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function i({ className: r, ...i }) {
|
|
12
|
+
return /* @__PURE__ */ t(n.Thumb, {
|
|
13
|
+
className: e("absolute top-1/2 left-0 size-4 -translate-y-1/2 translate-x-[6px]", "rounded-full bg-outline transition-all duration-200 ease-out", "ring-0 ring-on-surface/[0.08] group-hover:ring-8", "data-[checked]:size-6 data-[checked]:translate-x-[22px]", "data-[checked]:bg-on-primary data-[checked]:ring-primary/[0.08]", r),
|
|
14
|
+
...i
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function a({ className: n, ...r }) {
|
|
18
|
+
return /* @__PURE__ */ t("label", {
|
|
19
|
+
className: e("flex cursor-pointer items-center gap-3 text-body-medium text-on-surface", "has-data-[disabled]:cursor-not-allowed", n),
|
|
20
|
+
...r
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
var o = {
|
|
24
|
+
Root: r,
|
|
25
|
+
Thumb: i,
|
|
26
|
+
Label: a
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { a as Label, r as Root, o as Switch, i as Thumb };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","names":[],"sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import { Switch as BaseSwitch } from '@base-ui/react/switch'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Switch — Material 3 styled wrapper over Base UI's headless Switch.\n * Behaviour/accessibility (role=\"switch\", hidden input, keyboard toggling,\n * form submission): Base UI (https://base-ui.com/react/components/switch).\n * Visuals: M3 switch anatomy — 52x32 track (2px outline + surface-container-\n * highest when off, primary fill when on); 16px outline-colored thumb that\n * grows to a 24px on-primary thumb when checked, with a 40px hover state\n * layer halo around the thumb.\n * Design ref: port/core/ui/elements/common/Switch.tsx +\n * port/pages/examples/selection (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Switch.Root defaultChecked>\n * <Switch.Thumb />\n * </Switch.Root>\n */\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseSwitch.Root>) {\n return (\n <BaseSwitch.Root\n className={cn(\n 'group relative inline-flex h-8 w-[52px] shrink-0 cursor-pointer rounded-full',\n 'border-2 border-outline bg-surface-container-highest',\n 'transition-colors duration-200 ease-out',\n 'data-[checked]:border-primary data-[checked]:bg-primary',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]',\n 'data-[readonly]:cursor-default',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Thumb({\n className,\n ...props\n}: ComponentProps<typeof BaseSwitch.Thumb>) {\n return (\n <BaseSwitch.Thumb\n className={cn(\n // Off: 16px thumb, centered 16px from the track's left edge\n // (6px offset inside the 2px border).\n 'absolute top-1/2 left-0 size-4 -translate-y-1/2 translate-x-[6px]',\n 'rounded-full bg-outline transition-all duration-200 ease-out',\n // 40px M3 state layer halo around the thumb on hover.\n 'ring-0 ring-on-surface/[0.08] group-hover:ring-8',\n // On: thumb grows to 24px, on-primary, 4px shy of the right edge.\n 'data-[checked]:size-6 data-[checked]:translate-x-[22px]',\n 'data-[checked]:bg-on-primary data-[checked]:ring-primary/[0.08]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Convenience `<label>` row pairing the switch with its M3 body-medium text. */\nfunction Label({ className, ...props }: ComponentProps<'label'>) {\n return (\n <label\n className={cn(\n 'flex cursor-pointer items-center gap-3 text-body-medium text-on-surface',\n 'has-data-[disabled]:cursor-not-allowed',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport const Switch = { Root, Thumb, Label }\nexport { Root, Thumb, Label }\n"],"mappings":";;;;AAsBA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAiD;CAC7E,OACE,kBAAC,EAAW,MAAZ;EACE,WAAW,EACT,gFACA,wDACA,2CACA,2DACA,wFACA,qEACA,kCACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,cACA,GAAG,KACuC;CAC1C,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EAGT,qEACA,gEAEA,oDAEA,2DACA,mEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkC;CAC/D,OACE,kBAAC,SAAD;EACE,WAAW,EACT,2EACA,0CACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAS;CAAE;CAAM;CAAO;AAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch, Root, Thumb, Label } from './Switch';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Tabs — Material 3 styled wrapper over Base UI's headless Tabs.
|
|
5
|
+
* Behaviour/accessibility (roving focus, arrow-key navigation, aria-selected
|
|
6
|
+
* wiring): Base UI (https://base-ui.com/react/components/tabs).
|
|
7
|
+
* Visuals: M3 primary tabs anatomy — 48px tab row over an outline-variant
|
|
8
|
+
* divider, label-large labels (on-surface-variant inactive / primary active),
|
|
9
|
+
* on-surface state layers, and a 3px primary active-indicator bar that slides
|
|
10
|
+
* between tabs via Base UI's --active-tab-left/--active-tab-width CSS vars.
|
|
11
|
+
* Design ref: port/core/ui/components/tabs (see CLAUDE.md).
|
|
12
|
+
*
|
|
13
|
+
* Compound API mirrors Base UI:
|
|
14
|
+
* <Tabs.Root defaultValue="one">
|
|
15
|
+
* <Tabs.List>
|
|
16
|
+
* <Tabs.Tab value="one">One</Tabs.Tab>
|
|
17
|
+
* <Tabs.Tab value="two">Two</Tabs.Tab>
|
|
18
|
+
* <Tabs.Indicator />
|
|
19
|
+
* </Tabs.List>
|
|
20
|
+
* <Tabs.Panel value="one">…</Tabs.Panel>
|
|
21
|
+
* <Tabs.Panel value="two">…</Tabs.Panel>
|
|
22
|
+
* </Tabs.Root>
|
|
23
|
+
*/
|
|
24
|
+
declare function Root({ className, ...props }: ComponentProps<typeof BaseTabs.Root>): import("react").JSX.Element;
|
|
25
|
+
declare function List({ className, ...props }: ComponentProps<typeof BaseTabs.List>): import("react").JSX.Element;
|
|
26
|
+
declare function Tab({ className, ...props }: ComponentProps<typeof BaseTabs.Tab>): import("react").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* M3 primary active-indicator: a 3px primary bar with rounded top corners that
|
|
29
|
+
* slides under the active tab. Inset 12px per side to hug the label (the M3
|
|
30
|
+
* primary variant's content-width indicator) rather than span the full tab.
|
|
31
|
+
*/
|
|
32
|
+
declare function Indicator({ className, ...props }: ComponentProps<typeof BaseTabs.Indicator>): import("react").JSX.Element;
|
|
33
|
+
declare function Panel({ className, ...props }: ComponentProps<typeof BaseTabs.Panel>): import("react").JSX.Element;
|
|
34
|
+
export declare const Tabs: {
|
|
35
|
+
Root: typeof Root;
|
|
36
|
+
List: typeof List;
|
|
37
|
+
Tab: typeof Tab;
|
|
38
|
+
Indicator: typeof Indicator;
|
|
39
|
+
Panel: typeof Panel;
|
|
40
|
+
};
|
|
41
|
+
export { Root, List, Tab, Indicator, Panel };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Tabs as n } from "@base-ui/react/tabs";
|
|
4
|
+
//#region src/components/tabs/Tabs.tsx
|
|
5
|
+
function r({ className: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
7
|
+
className: e("flex w-full flex-col", r),
|
|
8
|
+
...i
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function i({ className: r, ...i }) {
|
|
12
|
+
return /* @__PURE__ */ t(n.List, {
|
|
13
|
+
className: e("relative flex flex-row items-end overflow-x-auto border-b border-outline-variant", r),
|
|
14
|
+
...i
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function a({ className: r, ...i }) {
|
|
18
|
+
return /* @__PURE__ */ t(n.Tab, {
|
|
19
|
+
className: e("flex h-12 min-w-[80px] flex-auto cursor-pointer items-center justify-center gap-2", "whitespace-nowrap px-4 text-label-large text-on-surface-variant sm:min-w-max", "transition-colors hover:bg-on-surface/[0.08]", "data-[active]:text-primary data-[active]:hover:bg-primary/[0.08]", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "disabled:cursor-not-allowed disabled:opacity-[0.38]", r),
|
|
20
|
+
...i
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function o({ className: r, ...i }) {
|
|
24
|
+
return /* @__PURE__ */ t(n.Indicator, {
|
|
25
|
+
className: e("absolute bottom-0 left-0 h-[3px] rounded-t-full bg-primary", "w-[calc(var(--active-tab-width)-24px)] translate-x-[calc(var(--active-tab-left)+12px)]", "transition-[translate,width] duration-200 ease-out", r),
|
|
26
|
+
...i
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function s({ className: r, ...i }) {
|
|
30
|
+
return /* @__PURE__ */ t(n.Panel, {
|
|
31
|
+
className: e("flex w-full flex-col gap-4 p-4 text-body-medium text-on-surface", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", r),
|
|
32
|
+
...i
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var c = {
|
|
36
|
+
Root: r,
|
|
37
|
+
List: i,
|
|
38
|
+
Tab: a,
|
|
39
|
+
Indicator: o,
|
|
40
|
+
Panel: s
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { o as Indicator, i as List, s as Panel, r as Root, a as Tab, c as Tabs };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":[],"sources":["../../../src/components/tabs/Tabs.tsx"],"sourcesContent":["import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Tabs — Material 3 styled wrapper over Base UI's headless Tabs.\n * Behaviour/accessibility (roving focus, arrow-key navigation, aria-selected\n * wiring): Base UI (https://base-ui.com/react/components/tabs).\n * Visuals: M3 primary tabs anatomy — 48px tab row over an outline-variant\n * divider, label-large labels (on-surface-variant inactive / primary active),\n * on-surface state layers, and a 3px primary active-indicator bar that slides\n * between tabs via Base UI's --active-tab-left/--active-tab-width CSS vars.\n * Design ref: port/core/ui/components/tabs (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Tabs.Root defaultValue=\"one\">\n * <Tabs.List>\n * <Tabs.Tab value=\"one\">One</Tabs.Tab>\n * <Tabs.Tab value=\"two\">Two</Tabs.Tab>\n * <Tabs.Indicator />\n * </Tabs.List>\n * <Tabs.Panel value=\"one\">…</Tabs.Panel>\n * <Tabs.Panel value=\"two\">…</Tabs.Panel>\n * </Tabs.Root>\n */\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseTabs.Root>) {\n return <BaseTabs.Root className={cn('flex w-full flex-col', className)} {...props} />\n}\n\nfunction List({ className, ...props }: ComponentProps<typeof BaseTabs.List>) {\n return (\n <BaseTabs.List\n className={cn(\n 'relative flex flex-row items-end overflow-x-auto border-b border-outline-variant',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Tab({ className, ...props }: ComponentProps<typeof BaseTabs.Tab>) {\n return (\n <BaseTabs.Tab\n className={cn(\n 'flex h-12 min-w-[80px] flex-auto cursor-pointer items-center justify-center gap-2',\n 'whitespace-nowrap px-4 text-label-large text-on-surface-variant sm:min-w-max',\n 'transition-colors hover:bg-on-surface/[0.08]',\n 'data-[active]:text-primary data-[active]:hover:bg-primary/[0.08]',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary',\n 'disabled:cursor-not-allowed disabled:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/**\n * M3 primary active-indicator: a 3px primary bar with rounded top corners that\n * slides under the active tab. Inset 12px per side to hug the label (the M3\n * primary variant's content-width indicator) rather than span the full tab.\n */\nfunction Indicator({ className, ...props }: ComponentProps<typeof BaseTabs.Indicator>) {\n return (\n <BaseTabs.Indicator\n className={cn(\n 'absolute bottom-0 left-0 h-[3px] rounded-t-full bg-primary',\n 'w-[calc(var(--active-tab-width)-24px)] translate-x-[calc(var(--active-tab-left)+12px)]',\n 'transition-[translate,width] duration-200 ease-out',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Panel({ className, ...props }: ComponentProps<typeof BaseTabs.Panel>) {\n return (\n <BaseTabs.Panel\n className={cn(\n 'flex w-full flex-col gap-4 p-4 text-body-medium text-on-surface',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport const Tabs = { Root, List, Tab, Indicator, Panel }\nexport { Root, List, Tab, Indicator, Panel }\n"],"mappings":";;;;AA2BA,SAAS,EAAK,EAAE,cAAW,GAAG,KAA+C;CAC3E,OAAO,kBAAC,EAAS,MAAV;EAAe,WAAW,EAAG,wBAAwB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACtF;AAEA,SAAS,EAAK,EAAE,cAAW,GAAG,KAA+C;CAC3E,OACE,kBAAC,EAAS,MAAV;EACE,WAAW,EACT,oFACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAI,EAAE,cAAW,GAAG,KAA8C;CACzE,OACE,kBAAC,EAAS,KAAV;EACE,WAAW,EACT,qFACA,gFACA,gDACA,oEACA,yFACA,uDACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAOA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAoD;CACrF,OACE,kBAAC,EAAS,WAAV;EACE,WAAW,EACT,8DACA,0FACA,sDACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAgD;CAC7E,OACE,kBAAC,EAAS,OAAV;EACE,WAAW,EACT,mEACA,yFACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAO;CAAE;CAAM;CAAM;CAAK;CAAW;AAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs, Root, List, Tab, Indicator, Panel } from './Tabs';
|