@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,142 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { ChevronRight as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Menu as i } from "@base-ui/react/menu";
|
|
5
|
+
import { Menubar as a } from "@base-ui/react/menubar";
|
|
6
|
+
//#region src/components/menubar/Menubar.tsx
|
|
7
|
+
function o({ className: t, ...r }) {
|
|
8
|
+
return /* @__PURE__ */ n(a, {
|
|
9
|
+
className: e("flex w-fit items-center gap-1 rounded-full bg-surface-container p-1 text-on-surface", "data-[orientation=vertical]:flex-col data-[orientation=vertical]:rounded-medium", "data-[orientation=vertical]:items-stretch", t),
|
|
10
|
+
...r
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
var s = i.Root, c = i.Portal, l = i.SubmenuRoot;
|
|
14
|
+
function u({ className: t, ...r }) {
|
|
15
|
+
return /* @__PURE__ */ n(i.Trigger, {
|
|
16
|
+
className: e("inline-flex h-10 cursor-pointer select-none items-center justify-center rounded-full px-4", "text-label-large text-on-surface outline-none transition-colors", "hover:bg-on-surface/[0.08] data-[popup-open]:bg-secondary-container data-[popup-open]:text-on-secondary-container", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "disabled:cursor-not-allowed disabled:opacity-[0.38]", t),
|
|
17
|
+
...r
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function d({ className: t, ...r }) {
|
|
21
|
+
return /* @__PURE__ */ n(i.Backdrop, {
|
|
22
|
+
className: e("fixed inset-0 z-40", t),
|
|
23
|
+
...r
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function f({ className: t, ...r }) {
|
|
27
|
+
return /* @__PURE__ */ n(i.Positioner, {
|
|
28
|
+
align: "start",
|
|
29
|
+
sideOffset: 4,
|
|
30
|
+
className: e("z-50 outline-none", t),
|
|
31
|
+
...r
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function p({ className: t, ...r }) {
|
|
35
|
+
return /* @__PURE__ */ n(i.Popup, {
|
|
36
|
+
className: e("flex max-h-[310px] min-w-[112px] max-w-[280px] flex-col overflow-y-auto", "rounded-small bg-surface-container py-2 text-on-surface shadow-mm-2", "origin-(--transform-origin) transition-[opacity,transform] duration-150 ease-out focus:outline-none", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", t),
|
|
37
|
+
...r
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function m({ className: t, ...r }) {
|
|
41
|
+
return /* @__PURE__ */ n(i.Arrow, {
|
|
42
|
+
className: e(t),
|
|
43
|
+
...r
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function h({ className: t, ...r }) {
|
|
47
|
+
return /* @__PURE__ */ n(i.Group, {
|
|
48
|
+
className: e("flex flex-col", t),
|
|
49
|
+
...r
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function g({ className: t, ...r }) {
|
|
53
|
+
return /* @__PURE__ */ n(i.GroupLabel, {
|
|
54
|
+
className: e("px-3 py-2 text-label-small text-on-surface-variant", t),
|
|
55
|
+
...r
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
var _ = e("flex h-12 cursor-pointer select-none items-center gap-3 pl-3 pr-6", "text-label-large text-on-surface outline-none transition-colors", "data-[highlighted]:bg-on-surface/[0.08]", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]");
|
|
59
|
+
function v({ className: t, ...r }) {
|
|
60
|
+
return /* @__PURE__ */ n(i.Item, {
|
|
61
|
+
className: e(_, t),
|
|
62
|
+
...r
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function y({ className: t, ...r }) {
|
|
66
|
+
return /* @__PURE__ */ n(i.LinkItem, {
|
|
67
|
+
className: e(_, "no-underline", t),
|
|
68
|
+
...r
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function b({ className: t, ...r }) {
|
|
72
|
+
return /* @__PURE__ */ n(i.CheckboxItem, {
|
|
73
|
+
className: e(_, t),
|
|
74
|
+
...r
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function x({ className: t, ...r }) {
|
|
78
|
+
return /* @__PURE__ */ n(i.CheckboxItemIndicator, {
|
|
79
|
+
className: e("flex size-5 shrink-0 items-center justify-center text-on-surface data-[unchecked]:invisible", t),
|
|
80
|
+
...r
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function S({ className: t, ...r }) {
|
|
84
|
+
return /* @__PURE__ */ n(i.RadioGroup, {
|
|
85
|
+
className: e("flex flex-col", t),
|
|
86
|
+
...r
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function C({ className: t, ...r }) {
|
|
90
|
+
return /* @__PURE__ */ n(i.RadioItem, {
|
|
91
|
+
className: e(_, t),
|
|
92
|
+
...r
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function w({ className: t, ...r }) {
|
|
96
|
+
return /* @__PURE__ */ n(i.RadioItemIndicator, {
|
|
97
|
+
className: e("flex size-5 shrink-0 items-center justify-center text-on-surface data-[unchecked]:invisible", t),
|
|
98
|
+
...r
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function T({ className: a, children: o, ...s }) {
|
|
102
|
+
return /* @__PURE__ */ r(i.SubmenuTrigger, {
|
|
103
|
+
className: e(_, "data-[popup-open]:bg-on-surface/[0.08]", a),
|
|
104
|
+
...s,
|
|
105
|
+
children: [o, /* @__PURE__ */ n(t, {
|
|
106
|
+
"aria-hidden": !0,
|
|
107
|
+
className: "ml-auto size-5 shrink-0 text-on-surface-variant"
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function E({ className: t, ...r }) {
|
|
112
|
+
return /* @__PURE__ */ n(i.Separator, {
|
|
113
|
+
className: e("my-2 h-px shrink-0 bg-outline-variant", t),
|
|
114
|
+
...r
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
var D = {
|
|
118
|
+
Root: o,
|
|
119
|
+
Menu: s,
|
|
120
|
+
Trigger: u,
|
|
121
|
+
Portal: c,
|
|
122
|
+
Backdrop: d,
|
|
123
|
+
Positioner: f,
|
|
124
|
+
Popup: p,
|
|
125
|
+
Arrow: m,
|
|
126
|
+
Group: h,
|
|
127
|
+
GroupLabel: g,
|
|
128
|
+
Item: v,
|
|
129
|
+
LinkItem: y,
|
|
130
|
+
CheckboxItem: b,
|
|
131
|
+
CheckboxItemIndicator: x,
|
|
132
|
+
RadioGroup: S,
|
|
133
|
+
RadioItem: C,
|
|
134
|
+
RadioItemIndicator: w,
|
|
135
|
+
SubmenuRoot: l,
|
|
136
|
+
SubmenuTrigger: T,
|
|
137
|
+
Separator: E
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
export { m as Arrow, d as Backdrop, b as CheckboxItem, x as CheckboxItemIndicator, h as Group, g as GroupLabel, v as Item, y as LinkItem, s as Menu, D as Menubar, p as Popup, c as Portal, f as Positioner, S as RadioGroup, C as RadioItem, w as RadioItemIndicator, o as Root, E as Separator, l as SubmenuRoot, T as SubmenuTrigger, u as Trigger };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=Menubar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menubar.js","names":[],"sources":["../../../src/components/menubar/Menubar.tsx"],"sourcesContent":["import { Menubar as BaseMenubar } from '@base-ui/react/menubar'\nimport { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { ChevronRight } from 'lucide-react'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Menubar — Material 3 styled wrapper over Base UI's headless Menubar.\n * Behaviour/accessibility (roving focus across triggers, arrow-key navigation,\n * hover-to-switch open menus, typeahead, submenus): Base UI\n * (https://base-ui.com/react/components/menubar). The menubar package exports\n * only the container; each menu inside is composed from `@base-ui/react/menu`\n * parts, all wrapped here.\n * Visuals: M3 — surface-container bar with full-shape text-button triggers\n * (top-app-bar action anatomy), menus as surface-container at elevation 2,\n * small (8px) corner, 48px label-large items with leading/trailing slots.\n * Design ref: port/core/ui/components/top-app-bar + dropdown (see CLAUDE.md).\n *\n * Compound API:\n * <Menubar.Root>\n * <Menubar.Menu>\n * <Menubar.Trigger>File</Menubar.Trigger>\n * <Menubar.Portal>\n * <Menubar.Positioner>\n * <Menubar.Popup>\n * <Menubar.Item>New…</Menubar.Item>\n * <Menubar.Separator />\n * <Menubar.SubmenuRoot>\n * <Menubar.SubmenuTrigger>Share</Menubar.SubmenuTrigger>\n * …\n * </Menubar.SubmenuRoot>\n * </Menubar.Popup>\n * </Menubar.Positioner>\n * </Menubar.Portal>\n * </Menubar.Menu>\n * </Menubar.Root>\n */\n\n/** The horizontal bar that hosts the menus (M3: surface-container strip). */\nfunction Root({ className, ...props }: ComponentProps<typeof BaseMenubar>) {\n return (\n <BaseMenubar\n className={cn(\n 'flex w-fit items-center gap-1 rounded-full bg-surface-container p-1 text-on-surface',\n 'data-[orientation=vertical]:flex-col data-[orientation=vertical]:rounded-medium',\n 'data-[orientation=vertical]:items-stretch',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** One menu inside the bar — Base UI Menu.Root (renders no element itself). */\nconst Menu = BaseMenu.Root\nconst Portal = BaseMenu.Portal\nconst SubmenuRoot = BaseMenu.SubmenuRoot\n\n/** Menubar button (M3 text-button anatomy: 40px, full shape, label-large). */\nfunction Trigger({ className, ...props }: ComponentProps<typeof BaseMenu.Trigger>) {\n return (\n <BaseMenu.Trigger\n className={cn(\n 'inline-flex h-10 cursor-pointer select-none items-center justify-center rounded-full px-4',\n 'text-label-large text-on-surface outline-none transition-colors',\n 'hover:bg-on-surface/[0.08] data-[popup-open]:bg-secondary-container data-[popup-open]:text-on-secondary-container',\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/** Invisible click-capture layer behind an open menu (menus use no scrim). */\nfunction Backdrop({ className, ...props }: ComponentProps<typeof BaseMenu.Backdrop>) {\n return <BaseMenu.Backdrop className={cn('fixed inset-0 z-40', className)} {...props} />\n}\n\nfunction Positioner({ className, ...props }: ComponentProps<typeof BaseMenu.Positioner>) {\n return (\n <BaseMenu.Positioner\n align=\"start\"\n sideOffset={4}\n className={cn('z-50 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction Popup({ className, ...props }: ComponentProps<typeof BaseMenu.Popup>) {\n return (\n <BaseMenu.Popup\n className={cn(\n 'flex max-h-[310px] min-w-[112px] max-w-[280px] flex-col overflow-y-auto',\n 'rounded-small bg-surface-container py-2 text-on-surface shadow-mm-2',\n 'origin-(--transform-origin) transition-[opacity,transform] duration-150 ease-out focus:outline-none',\n 'data-[starting-style]:scale-95 data-[starting-style]:opacity-0',\n 'data-[ending-style]:scale-95 data-[ending-style]:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Optional pointer toward the anchor — rarely used for menus; unstyled hook point. */\nfunction Arrow({ className, ...props }: ComponentProps<typeof BaseMenu.Arrow>) {\n return <BaseMenu.Arrow className={cn(className)} {...props} />\n}\n\nfunction Group({ className, ...props }: ComponentProps<typeof BaseMenu.Group>) {\n return <BaseMenu.Group className={cn('flex flex-col', className)} {...props} />\n}\n\nfunction GroupLabel({ className, ...props }: ComponentProps<typeof BaseMenu.GroupLabel>) {\n return (\n <BaseMenu.GroupLabel\n className={cn('px-3 py-2 text-label-small text-on-surface-variant', className)}\n {...props}\n />\n )\n}\n\n/** Shared M3 list-item recipe: 48px row, label-large, state layers. */\nconst itemClasses = cn(\n 'flex h-12 cursor-pointer select-none items-center gap-3 pl-3 pr-6',\n 'text-label-large text-on-surface outline-none transition-colors',\n 'data-[highlighted]:bg-on-surface/[0.08]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-[0.38]',\n)\n\nfunction Item({ className, ...props }: ComponentProps<typeof BaseMenu.Item>) {\n return <BaseMenu.Item className={cn(itemClasses, className)} {...props} />\n}\n\n/** Menu item that renders an anchor element. */\nfunction LinkItem({ className, ...props }: ComponentProps<typeof BaseMenu.LinkItem>) {\n return <BaseMenu.LinkItem className={cn(itemClasses, 'no-underline', className)} {...props} />\n}\n\nfunction CheckboxItem({ className, ...props }: ComponentProps<typeof BaseMenu.CheckboxItem>) {\n return <BaseMenu.CheckboxItem className={cn(itemClasses, className)} {...props} />\n}\n\n/** Leading 20px slot for the check mark — pass `keepMounted` to hold alignment. */\nfunction CheckboxItemIndicator({\n className,\n ...props\n}: ComponentProps<typeof BaseMenu.CheckboxItemIndicator>) {\n return (\n <BaseMenu.CheckboxItemIndicator\n className={cn(\n 'flex size-5 shrink-0 items-center justify-center text-on-surface data-[unchecked]:invisible',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction RadioGroup({ className, ...props }: ComponentProps<typeof BaseMenu.RadioGroup>) {\n return <BaseMenu.RadioGroup className={cn('flex flex-col', className)} {...props} />\n}\n\nfunction RadioItem({ className, ...props }: ComponentProps<typeof BaseMenu.RadioItem>) {\n return <BaseMenu.RadioItem className={cn(itemClasses, className)} {...props} />\n}\n\n/** Leading 20px slot for the selected mark — pass `keepMounted` to hold alignment. */\nfunction RadioItemIndicator({\n className,\n ...props\n}: ComponentProps<typeof BaseMenu.RadioItemIndicator>) {\n return (\n <BaseMenu.RadioItemIndicator\n className={cn(\n 'flex size-5 shrink-0 items-center justify-center text-on-surface data-[unchecked]:invisible',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Item that opens a nested menu; renders a trailing chevron automatically. */\nfunction SubmenuTrigger({\n className,\n children,\n ...props\n}: ComponentProps<typeof BaseMenu.SubmenuTrigger>) {\n return (\n <BaseMenu.SubmenuTrigger\n className={cn(itemClasses, 'data-[popup-open]:bg-on-surface/[0.08]', className)}\n {...props}\n >\n {children}\n <ChevronRight aria-hidden className=\"ml-auto size-5 shrink-0 text-on-surface-variant\" />\n </BaseMenu.SubmenuTrigger>\n )\n}\n\n/** M3 divider between menu sections. */\nfunction Separator({ className, ...props }: ComponentProps<typeof BaseMenu.Separator>) {\n return (\n <BaseMenu.Separator\n className={cn('my-2 h-px shrink-0 bg-outline-variant', className)}\n {...props}\n />\n )\n}\n\nexport const Menubar = {\n Root,\n Menu,\n Trigger,\n Portal,\n Backdrop,\n Positioner,\n Popup,\n Arrow,\n Group,\n GroupLabel,\n Item,\n LinkItem,\n CheckboxItem,\n CheckboxItemIndicator,\n RadioGroup,\n RadioItem,\n RadioItemIndicator,\n SubmenuRoot,\n SubmenuTrigger,\n Separator,\n}\nexport {\n Root,\n Menu,\n Trigger,\n Portal,\n Backdrop,\n Positioner,\n Popup,\n Arrow,\n Group,\n GroupLabel,\n Item,\n LinkItem,\n CheckboxItem,\n CheckboxItemIndicator,\n RadioGroup,\n RadioItem,\n RadioItemIndicator,\n SubmenuRoot,\n SubmenuTrigger,\n Separator,\n}\n"],"mappings":";;;;;;AAwCA,SAAS,EAAK,EAAE,cAAW,GAAG,KAA6C;CACzE,OACE,kBAAC,GAAD;EACE,WAAW,EACT,uFACA,mFACA,6CACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,IAAM,IAAO,EAAS,MAChB,IAAS,EAAS,QAClB,IAAc,EAAS;AAG7B,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAkD;CACjF,OACE,kBAAC,EAAS,SAAV;EACE,WAAW,EACT,6FACA,mEACA,qHACA,yFACA,uDACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAmD;CACnF,OAAO,kBAAC,EAAS,UAAV;EAAmB,WAAW,EAAG,sBAAsB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACxF;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAqD;CACvF,OACE,kBAAC,EAAS,YAAV;EACE,OAAM;EACN,YAAY;EACZ,WAAW,EAAG,qBAAqB,CAAS;EAC5C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAgD;CAC7E,OACE,kBAAC,EAAS,OAAV;EACE,WAAW,EACT,2EACA,uEACA,uGACA,kEACA,8DACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAgD;CAC7E,OAAO,kBAAC,EAAS,OAAV;EAAgB,WAAW,EAAG,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC/D;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAgD;CAC7E,OAAO,kBAAC,EAAS,OAAV;EAAgB,WAAW,EAAG,iBAAiB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAChF;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAqD;CACvF,OACE,kBAAC,EAAS,YAAV;EACE,WAAW,EAAG,sDAAsD,CAAS;EAC7E,GAAI;CACL,CAAA;AAEL;AAGA,IAAM,IAAc,EAClB,qEACA,mEACA,2CACA,mEACF;AAEA,SAAS,EAAK,EAAE,cAAW,GAAG,KAA+C;CAC3E,OAAO,kBAAC,EAAS,MAAV;EAAe,WAAW,EAAG,GAAa,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC3E;AAGA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAmD;CACnF,OAAO,kBAAC,EAAS,UAAV;EAAmB,WAAW,EAAG,GAAa,gBAAgB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC/F;AAEA,SAAS,EAAa,EAAE,cAAW,GAAG,KAAuD;CAC3F,OAAO,kBAAC,EAAS,cAAV;EAAuB,WAAW,EAAG,GAAa,CAAS;EAAG,GAAI;CAAQ,CAAA;AACnF;AAGA,SAAS,EAAsB,EAC7B,cACA,GAAG,KACqD;CACxD,OACE,kBAAC,EAAS,uBAAV;EACE,WAAW,EACT,+FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAqD;CACvF,OAAO,kBAAC,EAAS,YAAV;EAAqB,WAAW,EAAG,iBAAiB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACrF;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAoD;CACrF,OAAO,kBAAC,EAAS,WAAV;EAAoB,WAAW,EAAG,GAAa,CAAS;EAAG,GAAI;CAAQ,CAAA;AAChF;AAGA,SAAS,EAAmB,EAC1B,cACA,GAAG,KACkD;CACrD,OACE,kBAAC,EAAS,oBAAV;EACE,WAAW,EACT,+FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAe,EACtB,cACA,aACA,GAAG,KAC8C;CACjD,OACE,kBAAC,EAAS,gBAAV;EACE,WAAW,EAAG,GAAa,0CAA0C,CAAS;EAC9E,GAAI;YAFN,CAIG,GACD,kBAAC,GAAD;GAAc,eAAA;GAAY,WAAU;EAAmD,CAAA,CAChE;;AAE7B;AAGA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAoD;CACrF,OACE,kBAAC,EAAS,WAAV;EACE,WAAW,EAAG,yCAAyC,CAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAU;CACrB;CACA,MAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Menubar, Root, Menu, Trigger, Portal, Backdrop, Positioner, Popup, Arrow, Group, GroupLabel, Item, LinkItem, CheckboxItem, CheckboxItemIndicator, RadioGroup, RadioItem, RadioItemIndicator, SubmenuRoot, SubmenuTrigger, Separator, } from './Menubar';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Arrow as e, Backdrop as t, CheckboxItem as n, CheckboxItemIndicator as r, Group as i, GroupLabel as a, Item as o, LinkItem as s, Menu as c, Menubar as l, Popup as u, Portal as d, Positioner as f, RadioGroup as p, RadioItem as m, RadioItemIndicator as h, Root as g, Separator as _, SubmenuRoot as v, SubmenuTrigger as y, Trigger as b } from "./Menubar.js";
|
|
2
|
+
export { e as Arrow, t as Backdrop, n as CheckboxItem, r as CheckboxItemIndicator, i as Group, a as GroupLabel, o as Item, s as LinkItem, c as Menu, l as Menubar, u as Popup, d as Portal, f as Positioner, p as RadioGroup, m as RadioItem, h as RadioItemIndicator, g as Root, _ as Separator, v as SubmenuRoot, y as SubmenuTrigger, b as Trigger };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meter as BaseMeter } from '@base-ui/react/meter';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Meter — Material 3 styled wrapper over Base UI's headless Meter.
|
|
5
|
+
* Behaviour/accessibility (role="meter", aria-valuenow/-min/-max, formatted
|
|
6
|
+
* value text): Base UI (https://base-ui.com/react/components/meter).
|
|
7
|
+
* Visuals: M3 linear progress-indicator anatomy — 4px rounded track in
|
|
8
|
+
* surface-container-high with a primary active indicator, label-large label
|
|
9
|
+
* and label-medium value text.
|
|
10
|
+
* Design ref: port/core/ui/components/progress-bar (see CLAUDE.md).
|
|
11
|
+
*
|
|
12
|
+
* Compound API mirrors Base UI:
|
|
13
|
+
* <Meter.Root value={65}>
|
|
14
|
+
* <Meter.Label>Storage used</Meter.Label>
|
|
15
|
+
* <Meter.Value />
|
|
16
|
+
* <Meter.Track>
|
|
17
|
+
* <Meter.Indicator />
|
|
18
|
+
* </Meter.Track>
|
|
19
|
+
* </Meter.Root>
|
|
20
|
+
*/
|
|
21
|
+
declare function Root({ className, ...props }: ComponentProps<typeof BaseMeter.Root>): import("react").JSX.Element;
|
|
22
|
+
declare function Label({ className, ...props }: ComponentProps<typeof BaseMeter.Label>): import("react").JSX.Element;
|
|
23
|
+
declare function Value({ className, ...props }: ComponentProps<typeof BaseMeter.Value>): import("react").JSX.Element;
|
|
24
|
+
declare function Track({ className, ...props }: ComponentProps<typeof BaseMeter.Track>): import("react").JSX.Element;
|
|
25
|
+
declare function Indicator({ className, ...props }: ComponentProps<typeof BaseMeter.Indicator>): import("react").JSX.Element;
|
|
26
|
+
export declare const Meter: {
|
|
27
|
+
Root: typeof Root;
|
|
28
|
+
Label: typeof Label;
|
|
29
|
+
Value: typeof Value;
|
|
30
|
+
Track: typeof Track;
|
|
31
|
+
Indicator: typeof Indicator;
|
|
32
|
+
};
|
|
33
|
+
export { Root, Label, Value, Track, Indicator };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Meter as n } from "@base-ui/react/meter";
|
|
4
|
+
//#region src/components/meter/Meter.tsx
|
|
5
|
+
function r({ className: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
7
|
+
className: e("flex w-full flex-col gap-2 text-on-surface", r),
|
|
8
|
+
...i
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function i({ className: r, ...i }) {
|
|
12
|
+
return /* @__PURE__ */ t(n.Label, {
|
|
13
|
+
className: e("text-label-large text-on-surface", r),
|
|
14
|
+
...i
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function a({ className: r, ...i }) {
|
|
18
|
+
return /* @__PURE__ */ t(n.Value, {
|
|
19
|
+
className: e("text-label-medium text-on-surface-variant tabular-nums", r),
|
|
20
|
+
...i
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function o({ className: r, ...i }) {
|
|
24
|
+
return /* @__PURE__ */ t(n.Track, {
|
|
25
|
+
className: e("relative h-1 w-full overflow-hidden rounded-full bg-surface-container-high", r),
|
|
26
|
+
...i
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function s({ className: r, ...i }) {
|
|
30
|
+
return /* @__PURE__ */ t(n.Indicator, {
|
|
31
|
+
className: e("absolute rounded-full bg-primary transition-[width] duration-500 ease-out", r),
|
|
32
|
+
...i
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var c = {
|
|
36
|
+
Root: r,
|
|
37
|
+
Label: i,
|
|
38
|
+
Value: a,
|
|
39
|
+
Track: o,
|
|
40
|
+
Indicator: s
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { s as Indicator, i as Label, c as Meter, r as Root, o as Track, a as Value };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=Meter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Meter.js","names":[],"sources":["../../../src/components/meter/Meter.tsx"],"sourcesContent":["import { Meter as BaseMeter } from '@base-ui/react/meter'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Meter — Material 3 styled wrapper over Base UI's headless Meter.\n * Behaviour/accessibility (role=\"meter\", aria-valuenow/-min/-max, formatted\n * value text): Base UI (https://base-ui.com/react/components/meter).\n * Visuals: M3 linear progress-indicator anatomy — 4px rounded track in\n * surface-container-high with a primary active indicator, label-large label\n * and label-medium value text.\n * Design ref: port/core/ui/components/progress-bar (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Meter.Root value={65}>\n * <Meter.Label>Storage used</Meter.Label>\n * <Meter.Value />\n * <Meter.Track>\n * <Meter.Indicator />\n * </Meter.Track>\n * </Meter.Root>\n */\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseMeter.Root>) {\n return (\n <BaseMeter.Root\n className={cn('flex w-full flex-col gap-2 text-on-surface', className)}\n {...props}\n />\n )\n}\n\nfunction Label({ className, ...props }: ComponentProps<typeof BaseMeter.Label>) {\n return (\n <BaseMeter.Label\n className={cn('text-label-large text-on-surface', className)}\n {...props}\n />\n )\n}\n\nfunction Value({ className, ...props }: ComponentProps<typeof BaseMeter.Value>) {\n return (\n <BaseMeter.Value\n className={cn('text-label-medium text-on-surface-variant tabular-nums', className)}\n {...props}\n />\n )\n}\n\nfunction Track({ className, ...props }: ComponentProps<typeof BaseMeter.Track>) {\n return (\n <BaseMeter.Track\n className={cn(\n 'relative h-1 w-full overflow-hidden rounded-full bg-surface-container-high',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Indicator({ className, ...props }: ComponentProps<typeof BaseMeter.Indicator>) {\n return (\n <BaseMeter.Indicator\n className={cn(\n 'absolute rounded-full bg-primary transition-[width] duration-500 ease-out',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport const Meter = { Root, Label, Value, Track, Indicator }\nexport { Root, Label, Value, Track, Indicator }\n"],"mappings":";;;;AAwBA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAgD;CAC5E,OACE,kBAAC,EAAU,MAAX;EACE,WAAW,EAAG,8CAA8C,CAAS;EACrE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAiD;CAC9E,OACE,kBAAC,EAAU,OAAX;EACE,WAAW,EAAG,oCAAoC,CAAS;EAC3D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAiD;CAC9E,OACE,kBAAC,EAAU,OAAX;EACE,WAAW,EAAG,0DAA0D,CAAS;EACjF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAiD;CAC9E,OACE,kBAAC,EAAU,OAAX;EACE,WAAW,EACT,8EACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAqD;CACtF,OACE,kBAAC,EAAU,WAAX;EACE,WAAW,EACT,6EACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAQ;CAAE;CAAM;CAAO;CAAO;CAAO;AAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Meter, Root, Label, Value, Track, Indicator } from './Meter';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { NavigationMenu as BaseNavigationMenu } from '@base-ui/react/navigation-menu';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* NavigationMenu — Material 3 styled wrapper over Base UI's headless
|
|
5
|
+
* Navigation Menu. Behaviour/accessibility (hover/click open, keyboard
|
|
6
|
+
* navigation, content teleported into a shared animated popup):
|
|
7
|
+
* Base UI (https://base-ui.com/react/components/navigation-menu).
|
|
8
|
+
* Visuals: M3 navigation anatomy — surface-container bar with pill (full
|
|
9
|
+
* radius) label-large items and secondary-container active indicator, plus an
|
|
10
|
+
* elevated medium-corner menu surface for the flyout panel.
|
|
11
|
+
* Design ref: port/core/ui/components/navigation-bar + top-app-bar (see CLAUDE.md).
|
|
12
|
+
*
|
|
13
|
+
* Compound API mirrors Base UI:
|
|
14
|
+
* <NavigationMenu.Root>
|
|
15
|
+
* <NavigationMenu.List>
|
|
16
|
+
* <NavigationMenu.Item>
|
|
17
|
+
* <NavigationMenu.Trigger>
|
|
18
|
+
* Products <NavigationMenu.Icon />
|
|
19
|
+
* </NavigationMenu.Trigger>
|
|
20
|
+
* <NavigationMenu.Content>
|
|
21
|
+
* <NavigationMenu.Link href="…">…</NavigationMenu.Link>
|
|
22
|
+
* </NavigationMenu.Content>
|
|
23
|
+
* </NavigationMenu.Item>
|
|
24
|
+
* </NavigationMenu.List>
|
|
25
|
+
* <NavigationMenu.Portal>
|
|
26
|
+
* <NavigationMenu.Backdrop />
|
|
27
|
+
* <NavigationMenu.Positioner sideOffset={8}>
|
|
28
|
+
* <NavigationMenu.Popup>
|
|
29
|
+
* <NavigationMenu.Arrow />
|
|
30
|
+
* <NavigationMenu.Viewport />
|
|
31
|
+
* </NavigationMenu.Popup>
|
|
32
|
+
* </NavigationMenu.Positioner>
|
|
33
|
+
* </NavigationMenu.Portal>
|
|
34
|
+
* </NavigationMenu.Root>
|
|
35
|
+
*/
|
|
36
|
+
declare const Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').NavigationMenuPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare function Root({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Root>): import("react").JSX.Element;
|
|
38
|
+
/** The menu bar itself — M3 surface-container pill, like the navigation bar. */
|
|
39
|
+
declare function List({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.List>): import("react").JSX.Element;
|
|
40
|
+
declare function Item({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Item>): import("react").JSX.Element;
|
|
41
|
+
/** Pill-shaped bar item; active indicator uses M3 secondary-container. */
|
|
42
|
+
declare function Trigger({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Trigger>): import("react").JSX.Element;
|
|
43
|
+
/** Trailing chevron inside a Trigger; rotates while the popup is open. */
|
|
44
|
+
declare function Icon({ className, children, ...props }: ComponentProps<typeof BaseNavigationMenu.Icon>): import("react").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* Per-item panel content; teleported into the shared popup viewport and
|
|
47
|
+
* cross-faded with a directional slide when the active item changes.
|
|
48
|
+
*/
|
|
49
|
+
declare function Content({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Content>): import("react").JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* Navigation link — M3 list-row recipe for panel content. For top-level bar
|
|
52
|
+
* usage, override with Trigger-like pill classes. `data-active` marks the
|
|
53
|
+
* current page (secondary-container indicator).
|
|
54
|
+
*/
|
|
55
|
+
declare function Link({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Link>): import("react").JSX.Element;
|
|
56
|
+
/** Invisible click-capture layer behind the popup (M3 menus use no scrim). */
|
|
57
|
+
declare function Backdrop({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Backdrop>): import("react").JSX.Element;
|
|
58
|
+
/** Tracks the active trigger; CSS vars drive the sliding reposition. */
|
|
59
|
+
declare function Positioner({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Positioner>): import("react").JSX.Element;
|
|
60
|
+
/** Elevated M3 menu surface that animates its size to fit the active content. */
|
|
61
|
+
declare function Popup({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Popup>): import("react").JSX.Element;
|
|
62
|
+
/** Clips the active Content while panels cross-fade inside the popup. */
|
|
63
|
+
declare function Viewport({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Viewport>): import("react").JSX.Element;
|
|
64
|
+
/** Pointer toward the active trigger; fill matches the popup surface. */
|
|
65
|
+
declare function Arrow({ className, children, ...props }: ComponentProps<typeof BaseNavigationMenu.Arrow>): import("react").JSX.Element;
|
|
66
|
+
export declare const NavigationMenu: {
|
|
67
|
+
Root: typeof Root;
|
|
68
|
+
List: typeof List;
|
|
69
|
+
Item: typeof Item;
|
|
70
|
+
Trigger: typeof Trigger;
|
|
71
|
+
Icon: typeof Icon;
|
|
72
|
+
Content: typeof Content;
|
|
73
|
+
Link: typeof Link;
|
|
74
|
+
Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').NavigationMenuPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
75
|
+
Backdrop: typeof Backdrop;
|
|
76
|
+
Positioner: typeof Positioner;
|
|
77
|
+
Popup: typeof Popup;
|
|
78
|
+
Viewport: typeof Viewport;
|
|
79
|
+
Arrow: typeof Arrow;
|
|
80
|
+
};
|
|
81
|
+
export { Root, List, Item, Trigger, Icon, Content, Link, Portal, Backdrop, Positioner, Popup, Viewport, Arrow, };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { ChevronDown as t } from "lucide-react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { NavigationMenu as r } from "@base-ui/react/navigation-menu";
|
|
5
|
+
//#region src/components/navigation-menu/NavigationMenu.tsx
|
|
6
|
+
var i = r.Portal;
|
|
7
|
+
function a({ className: t, ...i }) {
|
|
8
|
+
return /* @__PURE__ */ n(r.Root, {
|
|
9
|
+
className: e("relative", t),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function o({ className: t, ...i }) {
|
|
14
|
+
return /* @__PURE__ */ n(r.List, {
|
|
15
|
+
className: e("relative m-0 flex list-none items-center gap-1 rounded-full bg-surface-container p-1 text-on-surface", t),
|
|
16
|
+
...i
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function s({ className: t, ...i }) {
|
|
20
|
+
return /* @__PURE__ */ n(r.Item, {
|
|
21
|
+
className: e("flex", t),
|
|
22
|
+
...i
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function c({ className: t, ...i }) {
|
|
26
|
+
return /* @__PURE__ */ n(r.Trigger, {
|
|
27
|
+
className: e("group flex h-10 cursor-pointer select-none items-center gap-1.5 rounded-full px-4", "text-label-large text-on-surface transition-colors", "hover:bg-on-surface/[0.08]", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "data-[popup-open]:bg-secondary-container data-[popup-open]:text-on-secondary-container", "disabled:cursor-not-allowed disabled:opacity-[0.38]", t),
|
|
28
|
+
...i
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function l({ className: i, children: a, ...o }) {
|
|
32
|
+
return /* @__PURE__ */ n(r.Icon, {
|
|
33
|
+
className: e("flex shrink-0 items-center justify-center transition-transform duration-200 ease-out", "data-[popup-open]:rotate-180", i),
|
|
34
|
+
...o,
|
|
35
|
+
children: a ?? /* @__PURE__ */ n(t, {
|
|
36
|
+
"aria-hidden": !0,
|
|
37
|
+
className: "size-4"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function u({ className: t, ...i }) {
|
|
42
|
+
return /* @__PURE__ */ n(r.Content, {
|
|
43
|
+
className: e("w-max min-w-[260px] max-w-[calc(100vw-2.5rem)] p-2", "transition-[opacity,translate] duration-300 ease-out", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", "data-[ending-style]:absolute data-[ending-style]:left-0 data-[ending-style]:top-0", "data-[starting-style]:data-[activation-direction=left]:-translate-x-1/2", "data-[starting-style]:data-[activation-direction=right]:translate-x-1/2", "data-[ending-style]:data-[activation-direction=left]:translate-x-1/2", "data-[ending-style]:data-[activation-direction=right]:-translate-x-1/2", t),
|
|
44
|
+
...i
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function d({ className: t, ...i }) {
|
|
48
|
+
return /* @__PURE__ */ n(r.Link, {
|
|
49
|
+
className: e("block rounded-small p-3 text-on-surface no-underline transition-colors", "hover:bg-on-surface/[0.08]", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "data-[active]:bg-secondary-container data-[active]:text-on-secondary-container", t),
|
|
50
|
+
...i
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function f({ className: t, ...i }) {
|
|
54
|
+
return /* @__PURE__ */ n(r.Backdrop, {
|
|
55
|
+
className: e("fixed inset-0 z-40", t),
|
|
56
|
+
...i
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function p({ className: t, ...i }) {
|
|
60
|
+
return /* @__PURE__ */ n(r.Positioner, {
|
|
61
|
+
className: e("absolute z-50 flex h-(--positioner-height) w-(--positioner-width) max-w-(--available-width)", "transition-[top,left,right,bottom] duration-300 ease-out", "data-[instant]:transition-none", t),
|
|
62
|
+
...i
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function m({ className: t, ...i }) {
|
|
66
|
+
return /* @__PURE__ */ n(r.Popup, {
|
|
67
|
+
className: e("relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin)", "rounded-medium bg-surface-container text-on-surface shadow-mm-2", "transition-[opacity,scale,width,height] duration-300 ease-out focus:outline-none", "data-[ending-style]:scale-90 data-[ending-style]:opacity-0", "data-[starting-style]:scale-90 data-[starting-style]:opacity-0", t),
|
|
68
|
+
...i
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function h({ className: t, ...i }) {
|
|
72
|
+
return /* @__PURE__ */ n(r.Viewport, {
|
|
73
|
+
className: e("relative h-full w-full overflow-hidden rounded-[inherit]", t),
|
|
74
|
+
...i
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function g({ className: t, children: i, ...a }) {
|
|
78
|
+
return /* @__PURE__ */ n(r.Arrow, {
|
|
79
|
+
className: e("flex transition-[left,right] duration-300 ease-out", "data-[side=bottom]:-top-2", "data-[side=top]:-bottom-2 data-[side=top]:rotate-180", "data-[side=left]:-right-3 data-[side=left]:rotate-90", "data-[side=right]:-left-3 data-[side=right]:-rotate-90", t),
|
|
80
|
+
...a,
|
|
81
|
+
children: i ?? /* @__PURE__ */ n("svg", {
|
|
82
|
+
width: "20",
|
|
83
|
+
height: "8",
|
|
84
|
+
viewBox: "0 0 20 8",
|
|
85
|
+
fill: "none",
|
|
86
|
+
"aria-hidden": !0,
|
|
87
|
+
children: /* @__PURE__ */ n("path", {
|
|
88
|
+
d: "M0 8 L10 0 L20 8 Z",
|
|
89
|
+
className: "fill-surface-container"
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
var _ = {
|
|
95
|
+
Root: a,
|
|
96
|
+
List: o,
|
|
97
|
+
Item: s,
|
|
98
|
+
Trigger: c,
|
|
99
|
+
Icon: l,
|
|
100
|
+
Content: u,
|
|
101
|
+
Link: d,
|
|
102
|
+
Portal: i,
|
|
103
|
+
Backdrop: f,
|
|
104
|
+
Positioner: p,
|
|
105
|
+
Popup: m,
|
|
106
|
+
Viewport: h,
|
|
107
|
+
Arrow: g
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { g as Arrow, f as Backdrop, u as Content, l as Icon, s as Item, d as Link, o as List, _ as NavigationMenu, m as Popup, i as Portal, p as Positioner, a as Root, c as Trigger, h as Viewport };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=NavigationMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationMenu.js","names":[],"sources":["../../../src/components/navigation-menu/NavigationMenu.tsx"],"sourcesContent":["import { NavigationMenu as BaseNavigationMenu } from '@base-ui/react/navigation-menu'\nimport { ChevronDown } from 'lucide-react'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * NavigationMenu — Material 3 styled wrapper over Base UI's headless\n * Navigation Menu. Behaviour/accessibility (hover/click open, keyboard\n * navigation, content teleported into a shared animated popup):\n * Base UI (https://base-ui.com/react/components/navigation-menu).\n * Visuals: M3 navigation anatomy — surface-container bar with pill (full\n * radius) label-large items and secondary-container active indicator, plus an\n * elevated medium-corner menu surface for the flyout panel.\n * Design ref: port/core/ui/components/navigation-bar + top-app-bar (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <NavigationMenu.Root>\n * <NavigationMenu.List>\n * <NavigationMenu.Item>\n * <NavigationMenu.Trigger>\n * Products <NavigationMenu.Icon />\n * </NavigationMenu.Trigger>\n * <NavigationMenu.Content>\n * <NavigationMenu.Link href=\"…\">…</NavigationMenu.Link>\n * </NavigationMenu.Content>\n * </NavigationMenu.Item>\n * </NavigationMenu.List>\n * <NavigationMenu.Portal>\n * <NavigationMenu.Backdrop />\n * <NavigationMenu.Positioner sideOffset={8}>\n * <NavigationMenu.Popup>\n * <NavigationMenu.Arrow />\n * <NavigationMenu.Viewport />\n * </NavigationMenu.Popup>\n * </NavigationMenu.Positioner>\n * </NavigationMenu.Portal>\n * </NavigationMenu.Root>\n */\n\nconst Portal = BaseNavigationMenu.Portal\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Root>) {\n return <BaseNavigationMenu.Root className={cn('relative', className)} {...props} />\n}\n\n/** The menu bar itself — M3 surface-container pill, like the navigation bar. */\nfunction List({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.List>) {\n return (\n <BaseNavigationMenu.List\n className={cn(\n 'relative m-0 flex list-none items-center gap-1 rounded-full bg-surface-container p-1 text-on-surface',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Item({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Item>) {\n return <BaseNavigationMenu.Item className={cn('flex', className)} {...props} />\n}\n\n/** Pill-shaped bar item; active indicator uses M3 secondary-container. */\nfunction Trigger({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Trigger>) {\n return (\n <BaseNavigationMenu.Trigger\n className={cn(\n 'group flex h-10 cursor-pointer select-none items-center gap-1.5 rounded-full px-4',\n 'text-label-large text-on-surface transition-colors',\n 'hover:bg-on-surface/[0.08]',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary',\n 'data-[popup-open]:bg-secondary-container data-[popup-open]:text-on-secondary-container',\n 'disabled:cursor-not-allowed disabled:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Trailing chevron inside a Trigger; rotates while the popup is open. */\nfunction Icon({ className, children, ...props }: ComponentProps<typeof BaseNavigationMenu.Icon>) {\n return (\n <BaseNavigationMenu.Icon\n className={cn(\n 'flex shrink-0 items-center justify-center transition-transform duration-200 ease-out',\n 'data-[popup-open]:rotate-180',\n className,\n )}\n {...props}\n >\n {children ?? <ChevronDown aria-hidden className=\"size-4\" />}\n </BaseNavigationMenu.Icon>\n )\n}\n\n/**\n * Per-item panel content; teleported into the shared popup viewport and\n * cross-faded with a directional slide when the active item changes.\n */\nfunction Content({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Content>) {\n return (\n <BaseNavigationMenu.Content\n className={cn(\n 'w-max min-w-[260px] max-w-[calc(100vw-2.5rem)] p-2',\n 'transition-[opacity,translate] duration-300 ease-out',\n 'data-[ending-style]:opacity-0 data-[starting-style]:opacity-0',\n 'data-[ending-style]:absolute data-[ending-style]:left-0 data-[ending-style]:top-0',\n 'data-[starting-style]:data-[activation-direction=left]:-translate-x-1/2',\n 'data-[starting-style]:data-[activation-direction=right]:translate-x-1/2',\n 'data-[ending-style]:data-[activation-direction=left]:translate-x-1/2',\n 'data-[ending-style]:data-[activation-direction=right]:-translate-x-1/2',\n className,\n )}\n {...props}\n />\n )\n}\n\n/**\n * Navigation link — M3 list-row recipe for panel content. For top-level bar\n * usage, override with Trigger-like pill classes. `data-active` marks the\n * current page (secondary-container indicator).\n */\nfunction Link({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Link>) {\n return (\n <BaseNavigationMenu.Link\n className={cn(\n 'block rounded-small p-3 text-on-surface no-underline transition-colors',\n 'hover:bg-on-surface/[0.08]',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary',\n 'data-[active]:bg-secondary-container data-[active]:text-on-secondary-container',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Invisible click-capture layer behind the popup (M3 menus use no scrim). */\nfunction Backdrop({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Backdrop>) {\n return <BaseNavigationMenu.Backdrop className={cn('fixed inset-0 z-40', className)} {...props} />\n}\n\n/** Tracks the active trigger; CSS vars drive the sliding reposition. */\nfunction Positioner({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Positioner>) {\n return (\n <BaseNavigationMenu.Positioner\n className={cn(\n 'absolute z-50 flex h-(--positioner-height) w-(--positioner-width) max-w-(--available-width)',\n 'transition-[top,left,right,bottom] duration-300 ease-out',\n 'data-[instant]:transition-none',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Elevated M3 menu surface that animates its size to fit the active content. */\nfunction Popup({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Popup>) {\n return (\n <BaseNavigationMenu.Popup\n className={cn(\n 'relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin)',\n 'rounded-medium bg-surface-container text-on-surface shadow-mm-2',\n 'transition-[opacity,scale,width,height] duration-300 ease-out focus:outline-none',\n 'data-[ending-style]:scale-90 data-[ending-style]:opacity-0',\n 'data-[starting-style]:scale-90 data-[starting-style]:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Clips the active Content while panels cross-fade inside the popup. */\nfunction Viewport({ className, ...props }: ComponentProps<typeof BaseNavigationMenu.Viewport>) {\n return (\n <BaseNavigationMenu.Viewport\n className={cn('relative h-full w-full overflow-hidden rounded-[inherit]', className)}\n {...props}\n />\n )\n}\n\n/** Pointer toward the active trigger; fill matches the popup surface. */\nfunction Arrow({ className, children, ...props }: ComponentProps<typeof BaseNavigationMenu.Arrow>) {\n return (\n <BaseNavigationMenu.Arrow\n className={cn(\n 'flex transition-[left,right] duration-300 ease-out',\n 'data-[side=bottom]:-top-2',\n 'data-[side=top]:-bottom-2 data-[side=top]:rotate-180',\n 'data-[side=left]:-right-3 data-[side=left]:rotate-90',\n 'data-[side=right]:-left-3 data-[side=right]:-rotate-90',\n className,\n )}\n {...props}\n >\n {children ?? (\n <svg width=\"20\" height=\"8\" viewBox=\"0 0 20 8\" fill=\"none\" aria-hidden>\n <path d=\"M0 8 L10 0 L20 8 Z\" className=\"fill-surface-container\" />\n </svg>\n )}\n </BaseNavigationMenu.Arrow>\n )\n}\n\nexport const NavigationMenu = {\n Root,\n List,\n Item,\n Trigger,\n Icon,\n Content,\n Link,\n Portal,\n Backdrop,\n Positioner,\n Popup,\n Viewport,\n Arrow,\n}\nexport {\n Root,\n List,\n Item,\n Trigger,\n Icon,\n Content,\n Link,\n Portal,\n Backdrop,\n Positioner,\n Popup,\n Viewport,\n Arrow,\n}\n"],"mappings":";;;;;AAwCA,IAAM,IAAS,EAAmB;AAElC,SAAS,EAAK,EAAE,cAAW,GAAG,KAAyD;CACrF,OAAO,kBAAC,EAAmB,MAApB;EAAyB,WAAW,EAAG,YAAY,CAAS;EAAG,GAAI;CAAQ,CAAA;AACpF;AAGA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAyD;CACrF,OACE,kBAAC,EAAmB,MAApB;EACE,WAAW,EACT,wGACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAyD;CACrF,OAAO,kBAAC,EAAmB,MAApB;EAAyB,WAAW,EAAG,QAAQ,CAAS;EAAG,GAAI;CAAQ,CAAA;AAChF;AAGA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAA4D;CAC3F,OACE,kBAAC,EAAmB,SAApB;EACE,WAAW,EACT,qFACA,sDACA,8BACA,yFACA,0FACA,uDACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAK,EAAE,cAAW,aAAU,GAAG,KAAyD;CAC/F,OACE,kBAAC,EAAmB,MAApB;EACE,WAAW,EACT,wFACA,gCACA,CACF;EACA,GAAI;YAEH,KAAY,kBAAC,GAAD;GAAa,eAAA;GAAY,WAAU;EAAU,CAAA;CACnC,CAAA;AAE7B;AAMA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAA4D;CAC3F,OACE,kBAAC,EAAmB,SAApB;EACE,WAAW,EACT,sDACA,wDACA,iEACA,qFACA,2EACA,2EACA,wEACA,0EACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAOA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAyD;CACrF,OACE,kBAAC,EAAmB,MAApB;EACE,WAAW,EACT,0EACA,8BACA,yFACA,kFACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAS,EAAE,cAAW,GAAG,KAA6D;CAC7F,OAAO,kBAAC,EAAmB,UAApB;EAA6B,WAAW,EAAG,sBAAsB,CAAS;EAAG,GAAI;CAAQ,CAAA;AAClG;AAGA,SAAS,EAAW,EAAE,cAAW,GAAG,KAA+D;CACjG,OACE,kBAAC,EAAmB,YAApB;EACE,WAAW,EACT,+FACA,4DACA,kCACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAA0D;CACvF,OACE,kBAAC,EAAmB,OAApB;EACE,WAAW,EACT,6EACA,mEACA,oFACA,8DACA,kEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAS,EAAE,cAAW,GAAG,KAA6D;CAC7F,OACE,kBAAC,EAAmB,UAApB;EACE,WAAW,EAAG,4DAA4D,CAAS;EACnF,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,aAAU,GAAG,KAA0D;CACjG,OACE,kBAAC,EAAmB,OAApB;EACE,WAAW,EACT,sDACA,6BACA,wDACA,wDACA,0DACA,CACF;EACA,GAAI;YAEH,KACC,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAI,SAAQ;GAAW,MAAK;GAAO,eAAA;aACxD,kBAAC,QAAD;IAAM,GAAE;IAAqB,WAAU;GAA0B,CAAA;EAC9D,CAAA;CAEiB,CAAA;AAE9B;AAEA,IAAa,IAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavigationMenu, Root, List, Item, Trigger, Icon, Content, Link, Portal, Backdrop, Positioner, Popup, Viewport, Arrow, } from './NavigationMenu';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Arrow as e, Backdrop as t, Content as n, Icon as r, Item as i, Link as a, List as o, NavigationMenu as s, Popup as c, Portal as l, Positioner as u, Root as d, Trigger as f, Viewport as p } from "./NavigationMenu.js";
|
|
2
|
+
export { e as Arrow, t as Backdrop, n as Content, r as Icon, i as Item, a as Link, o as List, s as NavigationMenu, c as Popup, l as Portal, u as Positioner, d as Root, f as Trigger, p as Viewport };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NumberField as BaseNumberField } from '@base-ui/react/number-field';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* NumberField — Material 3 styled wrapper over Base UI's headless Number Field.
|
|
5
|
+
* Behaviour/accessibility (spinbutton semantics, locale-aware parsing/formatting,
|
|
6
|
+
* pointer scrubbing, wheel + keyboard stepping): Base UI
|
|
7
|
+
* (https://base-ui.com/react/components/number-field).
|
|
8
|
+
* Visuals: M3 outlined text field anatomy — 56px field box, extra-small corner,
|
|
9
|
+
* outline border (primary on focus), body-large input text, on-surface-variant
|
|
10
|
+
* stepper icons with state layers.
|
|
11
|
+
* Design ref: port/core/ui/components/text-field (see CLAUDE.md).
|
|
12
|
+
*
|
|
13
|
+
* Compound API mirrors Base UI:
|
|
14
|
+
* <NumberField.Root defaultValue={100}>
|
|
15
|
+
* <NumberField.ScrubArea>
|
|
16
|
+
* <label>Amount</label>
|
|
17
|
+
* <NumberField.ScrubAreaCursor />
|
|
18
|
+
* </NumberField.ScrubArea>
|
|
19
|
+
* <NumberField.Group>
|
|
20
|
+
* <NumberField.Decrement />
|
|
21
|
+
* <NumberField.Input />
|
|
22
|
+
* <NumberField.Increment />
|
|
23
|
+
* </NumberField.Group>
|
|
24
|
+
* </NumberField.Root>
|
|
25
|
+
*/
|
|
26
|
+
declare function Root({ className, ...props }: ComponentProps<typeof BaseNumberField.Root>): import("react").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* The visual field box (M3 outlined text field container): outline border,
|
|
29
|
+
* extra-small corner, primary border + ring while the input inside has focus.
|
|
30
|
+
*/
|
|
31
|
+
declare function Group({ className, ...props }: ComponentProps<typeof BaseNumberField.Group>): import("react").JSX.Element;
|
|
32
|
+
/** Stepper button that decreases the value; renders a minus icon by default. */
|
|
33
|
+
declare function Decrement({ className, children, ...props }: ComponentProps<typeof BaseNumberField.Decrement>): import("react").JSX.Element;
|
|
34
|
+
/** Stepper button that increases the value; renders a plus icon by default. */
|
|
35
|
+
declare function Increment({ className, children, ...props }: ComponentProps<typeof BaseNumberField.Increment>): import("react").JSX.Element;
|
|
36
|
+
declare function Input({ className, ...props }: ComponentProps<typeof BaseNumberField.Input>): import("react").JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* Click-and-drag area (usually wrapping the label) that scrubs the value
|
|
39
|
+
* horizontally, like a video-editing slider.
|
|
40
|
+
*/
|
|
41
|
+
declare function ScrubArea({ className, ...props }: ComponentProps<typeof BaseNumberField.ScrubArea>): import("react").JSX.Element;
|
|
42
|
+
/** Virtual cursor shown while scrubbing; renders a horizontal-move icon by default. */
|
|
43
|
+
declare function ScrubAreaCursor({ className, children, ...props }: ComponentProps<typeof BaseNumberField.ScrubAreaCursor>): import("react").JSX.Element;
|
|
44
|
+
export declare const NumberField: {
|
|
45
|
+
Root: typeof Root;
|
|
46
|
+
Group: typeof Group;
|
|
47
|
+
Decrement: typeof Decrement;
|
|
48
|
+
Input: typeof Input;
|
|
49
|
+
Increment: typeof Increment;
|
|
50
|
+
ScrubArea: typeof ScrubArea;
|
|
51
|
+
ScrubAreaCursor: typeof ScrubAreaCursor;
|
|
52
|
+
};
|
|
53
|
+
export { Root, Group, Decrement, Input, Increment, ScrubArea, ScrubAreaCursor };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { Minus as t, MoveHorizontal as n, Plus as r } from "lucide-react";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import { NumberField as a } from "@base-ui/react/number-field";
|
|
5
|
+
//#region src/components/number-field/NumberField.tsx
|
|
6
|
+
function o({ className: t, ...n }) {
|
|
7
|
+
return /* @__PURE__ */ i(a.Root, {
|
|
8
|
+
className: e("flex flex-col items-start gap-1 text-on-surface", t),
|
|
9
|
+
...n
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function s({ className: t, ...n }) {
|
|
13
|
+
return /* @__PURE__ */ i(a.Group, {
|
|
14
|
+
className: e("flex h-14 items-stretch overflow-hidden rounded-extra-small border border-outline bg-surface", "transition-colors hover:border-on-surface", "focus-within:border-primary focus-within:ring-1 focus-within:ring-primary focus-within:hover:border-primary", "data-[disabled]:pointer-events-none data-[disabled]:opacity-[0.38]", t),
|
|
15
|
+
...n
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function c({ className: n, children: r, ...o }) {
|
|
19
|
+
return /* @__PURE__ */ i(a.Decrement, {
|
|
20
|
+
className: e("flex w-12 shrink-0 cursor-pointer items-center justify-center", "border-r border-outline-variant text-on-surface-variant transition-colors", "hover:bg-on-surface/[0.08] active:bg-on-surface/[0.12]", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "disabled:cursor-not-allowed disabled:opacity-[0.38] disabled:hover:bg-transparent", n),
|
|
21
|
+
...o,
|
|
22
|
+
children: r ?? /* @__PURE__ */ i(t, {
|
|
23
|
+
"aria-hidden": !0,
|
|
24
|
+
className: "size-5"
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function l({ className: t, children: n, ...o }) {
|
|
29
|
+
return /* @__PURE__ */ i(a.Increment, {
|
|
30
|
+
className: e("flex w-12 shrink-0 cursor-pointer items-center justify-center", "border-l border-outline-variant text-on-surface-variant transition-colors", "hover:bg-on-surface/[0.08] active:bg-on-surface/[0.12]", "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", "disabled:cursor-not-allowed disabled:opacity-[0.38] disabled:hover:bg-transparent", t),
|
|
31
|
+
...o,
|
|
32
|
+
children: n ?? /* @__PURE__ */ i(r, {
|
|
33
|
+
"aria-hidden": !0,
|
|
34
|
+
className: "size-5"
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function u({ className: t, ...n }) {
|
|
39
|
+
return /* @__PURE__ */ i(a.Input, {
|
|
40
|
+
className: e("h-full w-full min-w-0 bg-transparent px-3 text-center text-body-large tabular-nums", "text-on-surface placeholder:text-on-surface-variant focus:outline-none", t),
|
|
41
|
+
...n
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function d({ className: t, ...n }) {
|
|
45
|
+
return /* @__PURE__ */ i(a.ScrubArea, {
|
|
46
|
+
className: e("cursor-ew-resize select-none text-label-medium text-on-surface-variant", t),
|
|
47
|
+
...n
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function f({ className: t, children: r, ...o }) {
|
|
51
|
+
return /* @__PURE__ */ i(a.ScrubAreaCursor, {
|
|
52
|
+
className: e("text-on-surface drop-shadow-sm", t),
|
|
53
|
+
...o,
|
|
54
|
+
children: r ?? /* @__PURE__ */ i(n, {
|
|
55
|
+
"aria-hidden": !0,
|
|
56
|
+
className: "size-5"
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var p = {
|
|
61
|
+
Root: o,
|
|
62
|
+
Group: s,
|
|
63
|
+
Decrement: c,
|
|
64
|
+
Input: u,
|
|
65
|
+
Increment: l,
|
|
66
|
+
ScrubArea: d,
|
|
67
|
+
ScrubAreaCursor: f
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { c as Decrement, s as Group, l as Increment, u as Input, p as NumberField, o as Root, d as ScrubArea, f as ScrubAreaCursor };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=NumberField.js.map
|