asheeui 0.6.15 → 0.7.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/dist/AsheeUIProvider.js +22 -24
- package/dist/components/accordion/Accordion.js +79 -173
- package/dist/components/accordion/accordion-config.js +12 -13
- package/dist/components/accordion/accordion-styles.js +21 -24
- package/dist/components/autocomplete/Autocomplete.js +78 -136
- package/dist/components/autocomplete/autocomplete-config.js +7 -12
- package/dist/components/button/Button.d.ts +29 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +47 -108
- package/dist/components/button/button-config.js +16 -17
- package/dist/components/button/button-styles.js +10 -11
- package/dist/components/card/Card.d.ts +36 -16
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +115 -205
- package/dist/components/card/card-config.js +24 -21
- package/dist/components/card/card-styles.js +19 -22
- package/dist/components/carousel/Carousel.js +123 -248
- package/dist/components/carousel/carousel-config.js +24 -25
- package/dist/components/carousel/carousel-styles.js +14 -16
- package/dist/components/chip/Chip.js +84 -191
- package/dist/components/chip/chip-config.js +13 -14
- package/dist/components/chip/chip-styles.js +22 -26
- package/dist/components/date-picker/Calendar.d.ts +3 -3
- package/dist/components/date-picker/Calendar.d.ts.map +1 -1
- package/dist/components/date-picker/Calendar.js +141 -222
- package/dist/components/date-picker/DatePicker.d.ts +5 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +122 -220
- package/dist/components/date-picker/TimeSpinner.js +58 -82
- package/dist/components/date-picker/date-picker-config.d.ts +4 -4
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -11
- package/dist/components/date-picker/date-picker-styles.js +44 -45
- package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.helpers.js +74 -102
- package/dist/components/drawer/Drawer.d.ts +26 -8
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -131
- package/dist/components/drawer/drawer-config.js +14 -15
- package/dist/components/drawer/drawer-styles.js +38 -42
- package/dist/components/field/FieldShell.js +49 -56
- package/dist/components/field/field-config.js +17 -18
- package/dist/components/field/field-styles.js +8 -8
- package/dist/components/image/Image.d.ts +7 -7
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +65 -132
- package/dist/components/image/image-config.js +17 -18
- package/dist/components/image/image-styles.js +14 -15
- package/dist/components/input/Input.js +65 -150
- package/dist/components/input/PasswordInput.js +30 -49
- package/dist/components/input/input-config.js +7 -7
- package/dist/components/input/input-styles.js +9 -10
- package/dist/components/keyboard/KeyboardContext.js +10 -11
- package/dist/components/keyboard/KeyboardProvider.js +100 -181
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
- package/dist/components/keyboard/keyboard-config.js +59 -57
- package/dist/components/keyboard/keyboard-styles.js +10 -11
- package/dist/components/keyboard/use-keyboard-field.js +29 -21
- package/dist/components/link/Link.js +47 -137
- package/dist/components/link/link-config.js +14 -15
- package/dist/components/link/link-styles.js +25 -29
- package/dist/components/marquee/Marquee.js +55 -144
- package/dist/components/marquee/marquee-config.js +18 -19
- package/dist/components/marquee/marquee-styles.js +13 -15
- package/dist/components/modal/Modal.d.ts +26 -10
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +56 -136
- package/dist/components/modal/modal-config.js +15 -16
- package/dist/components/modal/modal-styles.js +13 -14
- package/dist/components/multi-select/MultiSelect.d.ts +18 -2
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +149 -283
- package/dist/components/multi-select/multi-select-config.d.ts +23 -18
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +18 -21
- package/dist/components/multi-select/multi-select-styles.js +17 -20
- package/dist/components/radio/Radio.js +43 -80
- package/dist/components/radio/RadioGroup.js +57 -155
- package/dist/components/radio/radio-config.js +15 -16
- package/dist/components/radio/radio-context.js +6 -6
- package/dist/components/radio/radio-styles.js +55 -60
- package/dist/components/resizable-screen/ResizableScreen.js +87 -177
- package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
- package/dist/components/select/Select.d.ts +3 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +97 -195
- package/dist/components/select/select-config.js +8 -9
- package/dist/components/select/select-styles.js +5 -5
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +102 -196
- package/dist/components/select-menu/select-menu-config.js +12 -12
- package/dist/components/select-menu/use-select-floating.d.ts +11 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +41 -48
- package/dist/components/sidebar/Sidebar.d.ts +43 -22
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +146 -331
- package/dist/components/sidebar/sidebar-config.d.ts +98 -31
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +47 -33
- package/dist/components/sidebar/sidebar-styles.js +27 -32
- package/dist/components/spinner/spinner-config.js +12 -13
- package/dist/components/spinner/spinner-styles.js +13 -14
- package/dist/components/spinner/spinner.js +39 -82
- package/dist/components/switch/Switch.js +62 -154
- package/dist/components/switch/switch-config.js +11 -12
- package/dist/components/switch/switch-styles.js +14 -16
- package/dist/components/table/Table.js +64 -186
- package/dist/components/table/table-config.js +17 -18
- package/dist/components/table/table-styles.js +48 -52
- package/dist/components/tabs/Tabs.d.ts +16 -8
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +93 -208
- package/dist/components/tabs/tabs-config.d.ts +42 -20
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-config.js +26 -18
- package/dist/components/tabs/tabs-styles.js +15 -17
- package/dist/components/textarea/Textarea.js +52 -138
- package/dist/components/textarea/textarea-config.js +10 -11
- package/dist/components/textarea/textarea-styles.js +9 -10
- package/dist/components/toast/ToastContext.js +22 -26
- package/dist/components/toast/ToastItem.js +82 -144
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +128 -190
- package/dist/components/toast/toast-config.js +23 -24
- package/dist/components/toast/toast-styles.js +50 -55
- package/dist/components/toast/use-pausable-timeout.js +17 -13
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +68 -158
- package/dist/components/tooltip/tooltip-config.d.ts +25 -0
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +26 -22
- package/dist/components/tooltip/tooltip-styles.js +15 -17
- package/dist/config/default-config.js +11 -34
- package/dist/config/resolve-color.js +23 -23
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/config/resolve-config.js +14 -12
- package/dist/icons/ArrowLeftIcon.js +16 -19
- package/dist/icons/CalendarIcon.js +43 -24
- package/dist/icons/CheckIcon.js +16 -19
- package/dist/icons/ChevronDownIcon.js +15 -21
- package/dist/icons/ChevronLeftIcon.js +16 -19
- package/dist/icons/ChevronRightIcon.js +16 -19
- package/dist/icons/ChevronUpIcon.js +16 -19
- package/dist/icons/ClearIcon.js +26 -22
- package/dist/icons/ClockIcon.js +20 -22
- package/dist/icons/CloseIcon.js +26 -22
- package/dist/icons/ErrorIcon.js +16 -19
- package/dist/icons/ExternalLinkIcon.js +25 -23
- package/dist/icons/EyeIcon.js +20 -22
- package/dist/icons/EyeOffIcon.js +21 -22
- package/dist/icons/InfoIcon.js +16 -19
- package/dist/icons/SearchIcon.js +25 -22
- package/dist/icons/WarningIcon.js +16 -19
- package/dist/index.js +65 -163
- package/dist/libs/context.js +10 -13
- package/dist/libs/index.js +1 -0
- package/dist/libs/registry.js +10 -12
- package/dist/libs/use-floating-z-index.d.ts +32 -0
- package/dist/libs/use-floating-z-index.d.ts.map +1 -0
- package/dist/libs/use-floating-z-index.js +16 -0
- package/dist/libs/use-isomorphic-layout-effect.js +5 -5
- package/dist/scripts/AsheeThemeScript.js +35 -44
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/radius.js +12 -13
- package/dist/shared/variant.js +46 -134
- package/dist/theme/color.js +28 -28
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +65 -178
- package/dist/theme/useTheme.js +13 -44
- package/dist/utils/cn.js +7 -7
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-object.js +13 -14
- package/dist/utils/resolve-token.js +11 -14
- package/dist/utils/stacking.d.ts +76 -0
- package/dist/utils/stacking.d.ts.map +1 -0
- package/dist/utils/stacking.js +34 -0
- package/package.json +12 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { FIELD_STATUS_BORDER_CLASS as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
2
|
+
import { FIELD_STATUS_BORDER_CLASS as e } from "../field/field-styles.js";
|
|
3
|
+
//#region src/components/select/select-styles.ts
|
|
4
|
+
var t = e;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { t as SELECT_STATUS_BORDER_CLASS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenu.d.ts","sourceRoot":"","sources":["../../../src/components/select-menu/SelectMenu.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AASf,OAAO,EAEL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
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
t == null ? void 0 : t.itemColor,
|
|
102
|
-
e == null ? void 0 : e.itemColor,
|
|
103
|
-
h.defaultColor,
|
|
104
|
-
d.itemColor
|
|
105
|
-
), G = a(
|
|
106
|
-
t == null ? void 0 : t.activeItemVariant,
|
|
107
|
-
e == null ? void 0 : e.activeItemVariant,
|
|
108
|
-
h.defaultVariant,
|
|
109
|
-
d.activeItemVariant
|
|
110
|
-
), U = a(
|
|
111
|
-
t == null ? void 0 : t.activeItemColor,
|
|
112
|
-
e == null ? void 0 : e.activeItemColor,
|
|
113
|
-
h.defaultColor,
|
|
114
|
-
d.activeItemColor
|
|
115
|
-
), F = ot(
|
|
116
|
-
t == null ? void 0 : t.radius,
|
|
117
|
-
e == null ? void 0 : e.radius,
|
|
118
|
-
h.defaultRadius,
|
|
119
|
-
d.radius
|
|
120
|
-
), M = a(
|
|
121
|
-
t == null ? void 0 : t.size,
|
|
122
|
-
e == null ? void 0 : e.size,
|
|
123
|
-
void 0,
|
|
124
|
-
d.size
|
|
125
|
-
);
|
|
126
|
-
if (!y) return null;
|
|
127
|
-
const T = /* @__PURE__ */ l(
|
|
128
|
-
u,
|
|
129
|
-
{
|
|
130
|
-
context: w,
|
|
131
|
-
modal: !1,
|
|
132
|
-
initialFocus: Q,
|
|
133
|
-
returnFocus: R,
|
|
134
|
-
children: /* @__PURE__ */ A(
|
|
135
|
-
"div",
|
|
136
|
-
{
|
|
137
|
-
ref: b,
|
|
138
|
-
style: { ...v },
|
|
139
|
-
className: dt(
|
|
140
|
-
"z-30 w-full outline-none max-h-60 shadow-xl bg-background border border-border p-1 flex flex-col gap-0.5 overflow-y-auto scrollable-hidden",
|
|
141
|
-
// Explicitly disable transitions on the floating element. Floating UI
|
|
142
|
-
// positions this node via a `transform` written on every scroll tick
|
|
143
|
-
// (through floatingStyles). If any transition — global, inherited, or
|
|
144
|
-
// otherwise — applies to `transform` on this element, the browser eases
|
|
145
|
-
// toward each new position instead of snapping to it, which compounds
|
|
146
|
-
// under rapid scroll ticks into a visible spring/bounce effect that
|
|
147
|
-
// worsens with scroll speed. transition-none guarantees position
|
|
148
|
-
// updates apply instantly.
|
|
149
|
-
"transition-none",
|
|
150
|
-
I ? "animate-in fade-in-0 zoom-in-95 slide-in-from-top-1 duration-150 ease-out" : "invisible opacity-0 pointer-events-none",
|
|
151
|
-
t == null ? void 0 : t.className
|
|
152
|
-
),
|
|
153
|
-
...x(),
|
|
154
|
-
children: [
|
|
155
|
-
s && /* @__PURE__ */ l("div", { className: "w-full p-1 mb-1 sticky top-0 z-10 border-b border-border", children: /* @__PURE__ */ l(
|
|
156
|
-
at,
|
|
157
|
-
{
|
|
158
|
-
name: V,
|
|
159
|
-
type: "text",
|
|
160
|
-
variant: "bordered",
|
|
161
|
-
radius: F,
|
|
162
|
-
color: L,
|
|
163
|
-
size: M,
|
|
164
|
-
value: n,
|
|
165
|
-
onChange: (r) => _(r.target.value),
|
|
166
|
-
startContent: /* @__PURE__ */ l(et, { className: "w-3.5 h-3.5 text-foreground/70" }),
|
|
167
|
-
placeholder: S,
|
|
168
|
-
autoFocus: !0,
|
|
169
|
-
className: "w-full pl-8 h-8 text-xs bg-secondary/30 border-none focus-visible:ring-0"
|
|
170
|
-
}
|
|
171
|
-
) }),
|
|
172
|
-
/* @__PURE__ */ l(
|
|
173
|
-
ct,
|
|
174
|
-
{
|
|
175
|
-
filteredOptions: Y,
|
|
176
|
-
selectedValues: f,
|
|
177
|
-
onSelectMenuOption: N,
|
|
178
|
-
renderOption: E,
|
|
179
|
-
itemVariant: D,
|
|
180
|
-
itemColor: L,
|
|
181
|
-
activeItemVariant: G,
|
|
182
|
-
activeItemColor: U,
|
|
183
|
-
radius: F,
|
|
184
|
-
size: M
|
|
185
|
-
}
|
|
186
|
-
),
|
|
187
|
-
k && /* @__PURE__ */ l("div", { className: "border-t border-border pt-1 mt-1", children: k })
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
return B ? /* @__PURE__ */ l(m, { root: O, children: T }) : T;
|
|
194
|
-
};
|
|
195
|
-
it.displayName = "SelectMenu";
|
|
196
|
-
export {
|
|
197
|
-
it as SelectMenu
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveCascade as n, resolveRadiusKey as r } from "../../utils/resolve-token.js";
|
|
6
|
+
import { Button as i } from "../button/Button.js";
|
|
7
|
+
import { Input as a } from "../input/Input.js";
|
|
8
|
+
import { CheckIcon as o } from "../../icons/CheckIcon.js";
|
|
9
|
+
import { SearchIcon as s } from "../../icons/SearchIcon.js";
|
|
10
|
+
import { FALLBACK_SELECT_MENU_CONFIG as c } from "./select-menu-config.js";
|
|
11
|
+
import { memo as l, useEffect as u, useMemo as d, useState as f } from "react";
|
|
12
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
|
+
import { FloatingFocusManager as g, FloatingPortal as _ } from "@floating-ui/react";
|
|
14
|
+
//#region src/components/select-menu/SelectMenu.tsx
|
|
15
|
+
var v = l(function({ filteredOptions: e, selectedValues: t, onSelectMenuOption: n, renderOption: r, itemVariant: a, itemColor: s, activeItemVariant: c, activeItemColor: l, radius: u, size: d }) {
|
|
16
|
+
let f = (e) => t.includes(e);
|
|
17
|
+
return e.length === 0 ? /* @__PURE__ */ m("div", {
|
|
18
|
+
className: "px-3 py-4 text-xs text-foreground/70 text-center",
|
|
19
|
+
children: "No options found"
|
|
20
|
+
}) : /* @__PURE__ */ m(p, { children: e.map((e) => {
|
|
21
|
+
let t = f(e.value);
|
|
22
|
+
return r ? r(e, t) : /* @__PURE__ */ h(i, {
|
|
23
|
+
variant: t ? c : a,
|
|
24
|
+
color: t ? l : s,
|
|
25
|
+
radius: u,
|
|
26
|
+
size: d,
|
|
27
|
+
isDisabled: e.disabled,
|
|
28
|
+
onClick: () => n(e),
|
|
29
|
+
className: "w-full justify-between font-normal text-left transition-colors truncate",
|
|
30
|
+
children: [/* @__PURE__ */ m("span", { children: e.label }), t && /* @__PURE__ */ m(o, { className: "w-3.5 h-3.5 shrink-0 ml-2" })]
|
|
31
|
+
}, String(e.value));
|
|
32
|
+
}) });
|
|
33
|
+
}), y = ({ isOpen: i, floatingStyles: o, context: l, getFloatingProps: p, setFloatingRef: y, isPositioned: b = !0, options: x = [], selectedValues: S = [], onSelectMenuOption: C, isSearch: w = !0, searchPlaceholder: T = "Search...", searchInputName: E = "select-menu-search", searchQuery: D, onSearchChange: O, belowList: k, menuConfig: A, menuProps: j = {}, renderOption: M, initialFocus: N, returnFocus: P }) => {
|
|
34
|
+
let F = t(), [I, L] = f(""), R = D ?? I, z = (e) => {
|
|
35
|
+
O ? O(e) : L(e);
|
|
36
|
+
}, B = n(j?.lockScroll, A?.lockScroll, void 0, c.lockScroll), V = n(j?.portal, A?.portal, void 0, c.portal), H = n(j?.portalTarget, A?.portalTarget, void 0, typeof document < "u" ? document.body : null);
|
|
37
|
+
u(() => {
|
|
38
|
+
if (!i || !B) return;
|
|
39
|
+
let e = window.scrollY, t = document.body.style.position, n = document.body.style.top, r = document.body.style.left, a = document.body.style.right, o = document.body.style.width, s = document.body.style.overflow;
|
|
40
|
+
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", document.body.style.width = "100%", document.body.style.overflow = "hidden", () => {
|
|
41
|
+
document.body.style.position = t, document.body.style.top = n, document.body.style.left = r, document.body.style.right = a, document.body.style.width = o, document.body.style.overflow = s, window.scrollTo(0, e);
|
|
42
|
+
};
|
|
43
|
+
}, [i, B]);
|
|
44
|
+
let U = d(() => !w || !R.trim() ? x : x.filter((e) => e.label.toLowerCase().includes(R.toLowerCase())), [
|
|
45
|
+
x,
|
|
46
|
+
w,
|
|
47
|
+
R
|
|
48
|
+
]), W = n(j?.itemVariant, A?.itemVariant, void 0, c.itemVariant), G = n(j?.itemColor, A?.itemColor, F.defaultColor, c.itemColor), K = n(j?.activeItemVariant, A?.activeItemVariant, F.defaultVariant, c.activeItemVariant), q = n(j?.activeItemColor, A?.activeItemColor, F.defaultColor, c.activeItemColor), J = r(j?.radius, A?.radius, F.defaultRadius, c.radius), Y = n(j?.size, A?.size, void 0, c.size);
|
|
49
|
+
if (!i) return null;
|
|
50
|
+
let X = /* @__PURE__ */ m(g, {
|
|
51
|
+
context: l,
|
|
52
|
+
modal: !1,
|
|
53
|
+
initialFocus: N,
|
|
54
|
+
returnFocus: P,
|
|
55
|
+
children: /* @__PURE__ */ h("div", {
|
|
56
|
+
ref: y,
|
|
57
|
+
style: { ...o },
|
|
58
|
+
className: e("w-full outline-none max-h-60 shadow-xl bg-background border border-border p-1 flex flex-col gap-0.5 overflow-y-auto scrollable-hidden", "transition-none", b ? "animate-in fade-in-0 zoom-in-95 slide-in-from-top-1 duration-150 ease-out" : "invisible opacity-0 pointer-events-none", j?.className),
|
|
59
|
+
...p(),
|
|
60
|
+
children: [
|
|
61
|
+
w && /* @__PURE__ */ m("div", {
|
|
62
|
+
className: "w-full p-1 mb-1 sticky top-0 z-10 border-b border-border",
|
|
63
|
+
children: /* @__PURE__ */ m(a, {
|
|
64
|
+
name: E,
|
|
65
|
+
type: "text",
|
|
66
|
+
variant: "bordered",
|
|
67
|
+
radius: J,
|
|
68
|
+
color: G,
|
|
69
|
+
size: Y,
|
|
70
|
+
value: R,
|
|
71
|
+
onChange: (e) => z(e.target.value),
|
|
72
|
+
startContent: /* @__PURE__ */ m(s, { className: "w-3.5 h-3.5 text-foreground/70" }),
|
|
73
|
+
placeholder: T,
|
|
74
|
+
autoFocus: !0,
|
|
75
|
+
className: "w-full pl-8 h-8 text-xs bg-secondary/30 border-none focus-visible:ring-0"
|
|
76
|
+
})
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ m(v, {
|
|
79
|
+
filteredOptions: U,
|
|
80
|
+
selectedValues: S,
|
|
81
|
+
onSelectMenuOption: C,
|
|
82
|
+
renderOption: M,
|
|
83
|
+
itemVariant: W,
|
|
84
|
+
itemColor: G,
|
|
85
|
+
activeItemVariant: K,
|
|
86
|
+
activeItemColor: q,
|
|
87
|
+
radius: J,
|
|
88
|
+
size: Y
|
|
89
|
+
}),
|
|
90
|
+
k && /* @__PURE__ */ m("div", {
|
|
91
|
+
className: "border-t border-border pt-1 mt-1",
|
|
92
|
+
children: k
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
return V ? /* @__PURE__ */ m(_, {
|
|
98
|
+
root: H,
|
|
99
|
+
children: X
|
|
100
|
+
}) : X;
|
|
198
101
|
};
|
|
102
|
+
y.displayName = "SelectMenu";
|
|
103
|
+
//#endregion
|
|
104
|
+
export { y as SelectMenu };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
t as FALLBACK_SELECT_MENU_CONFIG
|
|
2
|
+
//#region src/components/select-menu/select-menu-config.ts
|
|
3
|
+
var e = {
|
|
4
|
+
radius: "md",
|
|
5
|
+
size: "md",
|
|
6
|
+
itemVariant: "ghost",
|
|
7
|
+
itemColor: "primary",
|
|
8
|
+
activeItemVariant: "faded",
|
|
9
|
+
activeItemColor: "primary",
|
|
10
|
+
lockScroll: !0,
|
|
11
|
+
portal: !0
|
|
14
12
|
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as FALLBACK_SELECT_MENU_CONFIG };
|
|
@@ -58,6 +58,15 @@ export interface UseSelectFloatingProps {
|
|
|
58
58
|
* @default "listbox"
|
|
59
59
|
*/
|
|
60
60
|
role?: "listbox" | "menu" | "dialog" | "tooltip" | "grid" | "tree";
|
|
61
|
+
/**
|
|
62
|
+
* Layer delta added to the trigger's detected stacking-context z-index to
|
|
63
|
+
* resolve the floating element's final `z-index`. Keeps anchored popups
|
|
64
|
+
* above their own container (for example a navbar) while staying underneath
|
|
65
|
+
* unrelated app chrome.
|
|
66
|
+
*
|
|
67
|
+
* @default ASHEE_LAYER.dropdown
|
|
68
|
+
*/
|
|
69
|
+
zIndex?: number;
|
|
61
70
|
}
|
|
62
71
|
/**
|
|
63
72
|
* Return value of useSelectFloating. Combines Floating UI's positioning
|
|
@@ -93,6 +102,7 @@ export interface UseSelectFloatingReturn<T extends HTMLElement> {
|
|
|
93
102
|
* @param props.padding - Viewport padding for shift middleware. Defaults to 8.
|
|
94
103
|
* @param props.matchReferenceWidth - Whether to match reference width. Defaults to true.
|
|
95
104
|
* @param props.role - ARIA role for the floating element. Defaults to "listbox".
|
|
105
|
+
* @param props.zIndex - Layer delta for the floating element. Defaults to `ASHEE_LAYER.dropdown`.
|
|
96
106
|
* @returns Floating UI refs/context/styles plus `isPositioned` and the
|
|
97
107
|
* resolved `getReferenceProps`/`getFloatingProps` prop-getters.
|
|
98
108
|
*
|
|
@@ -120,5 +130,5 @@ export interface UseSelectFloatingReturn<T extends HTMLElement> {
|
|
|
120
130
|
* @see useFloating - The underlying Floating UI hook.
|
|
121
131
|
* @see Select - The select component that uses this hook.
|
|
122
132
|
*/
|
|
123
|
-
export declare function useSelectFloating<T extends HTMLElement = HTMLElement>({ isOpen, onOpenChange, disabled, placement, offsetDistance, padding, matchReferenceWidth, role, }: UseSelectFloatingProps): UseSelectFloatingReturn<T>;
|
|
133
|
+
export declare function useSelectFloating<T extends HTMLElement = HTMLElement>({ isOpen, onOpenChange, disabled, placement, offsetDistance, padding, matchReferenceWidth, role, zIndex, }: UseSelectFloatingProps): UseSelectFloatingReturn<T>;
|
|
124
134
|
//# sourceMappingURL=use-select-floating.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-select-floating.d.ts","sourceRoot":"","sources":["../../../src/components/select-menu/use-select-floating.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAIL,KAAK,SAAS,EAKd,WAAW,EAGZ,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-select-floating.d.ts","sourceRoot":"","sources":["../../../src/components/select-menu/use-select-floating.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAIL,KAAK,SAAS,EAKd,WAAW,EAGZ,MAAM,oBAAoB,CAAC;AAI5B;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAEnE;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,WAAW;IAC5D,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACtD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;CAC7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,EACrE,MAAM,EACN,YAAY,EACZ,QAAgB,EAChB,SAA0B,EAC1B,cAAkB,EAClB,OAAW,EACX,mBAA0B,EAC1B,IAAgB,EAChB,MAA6B,GAC9B,EAAE,sBAAsB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAmDrD"}
|
|
@@ -1,50 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
context: t,
|
|
42
|
-
floatingStyles: e.floatingStyles,
|
|
43
|
-
isPositioned: e.isPositioned,
|
|
44
|
-
getReferenceProps: m,
|
|
45
|
-
getFloatingProps: x
|
|
46
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { ASHEE_LAYER as e } from "../../utils/stacking.js";
|
|
4
|
+
import { useFloatingZIndex as t } from "../../libs/use-floating-z-index.js";
|
|
5
|
+
import { autoUpdate as n, flip as r, offset as i, shift as a, size as o, useClick as s, useDismiss as c, useFloating as l, useInteractions as u, useRole as d } from "@floating-ui/react";
|
|
6
|
+
//#region src/components/select-menu/use-select-floating.ts
|
|
7
|
+
function f({ isOpen: f, onOpenChange: p, disabled: m = !1, placement: h = "bottom-start", offsetDistance: g = 4, padding: _ = 8, matchReferenceWidth: v = !0, role: y = "listbox", zIndex: b = e.dropdown }) {
|
|
8
|
+
let x = l({
|
|
9
|
+
open: f,
|
|
10
|
+
onOpenChange: (e) => !m && p(e),
|
|
11
|
+
placement: h,
|
|
12
|
+
strategy: "fixed",
|
|
13
|
+
whileElementsMounted: n,
|
|
14
|
+
middleware: [
|
|
15
|
+
i(g),
|
|
16
|
+
r(),
|
|
17
|
+
a({ padding: _ }),
|
|
18
|
+
o({ apply({ availableHeight: e, elements: t }) {
|
|
19
|
+
Object.assign(t.floating.style, {
|
|
20
|
+
maxHeight: `${e}px`,
|
|
21
|
+
...v && { width: `${t.reference.getBoundingClientRect().width}px` }
|
|
22
|
+
});
|
|
23
|
+
} })
|
|
24
|
+
]
|
|
25
|
+
}), S = t(x.refs.reference, f, b), { context: C } = x, w = s(C, { enabled: !m }), T = c(C), E = d(C, { role: y }), { getReferenceProps: D, getFloatingProps: O } = u([
|
|
26
|
+
w,
|
|
27
|
+
T,
|
|
28
|
+
E
|
|
29
|
+
]);
|
|
30
|
+
return {
|
|
31
|
+
refs: x.refs,
|
|
32
|
+
context: C,
|
|
33
|
+
floatingStyles: {
|
|
34
|
+
...x.floatingStyles,
|
|
35
|
+
zIndex: S
|
|
36
|
+
},
|
|
37
|
+
isPositioned: x.isPositioned,
|
|
38
|
+
getReferenceProps: D,
|
|
39
|
+
getFloatingProps: O
|
|
40
|
+
};
|
|
47
41
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { f as useSelectFloating };
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { SidebarConfig, SidebarItem, SidebarItems } from './sidebar-config';
|
|
3
|
-
type BaseSidebarProps = SidebarConfig & Omit<HTMLAttributes<HTMLElement>, "color" | "size" | "onSelect" | "title">;
|
|
2
|
+
import { SidebarConfig, SidebarItem, SidebarItems, SidebarOptionsConfig, SidebarTooltipConfig } from './sidebar-config';
|
|
3
|
+
type BaseSidebarProps = Omit<SidebarConfig, "options"> & Omit<HTMLAttributes<HTMLElement>, "color" | "size" | "onSelect" | "title">;
|
|
4
|
+
/**
|
|
5
|
+
* Options props for the sidebar's navigation items.
|
|
6
|
+
* Extends the options config with sidebar-local props.
|
|
7
|
+
*/
|
|
8
|
+
export interface SidebarOptionProps extends SidebarOptionsConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Class override applied to every navigation item.
|
|
11
|
+
*/
|
|
12
|
+
itemClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for the sidebar's navigation links.
|
|
16
|
+
* Holds the instance-only link component and its props.
|
|
17
|
+
*/
|
|
18
|
+
export interface SidebarLinkProps {
|
|
19
|
+
/**
|
|
20
|
+
* Custom link component (e.g., Next.js Link, TanStack Router Link).
|
|
21
|
+
* When provided, this component is used instead of the native <a> tag.
|
|
22
|
+
*/
|
|
23
|
+
component?: ElementType;
|
|
24
|
+
/**
|
|
25
|
+
* Additional props to pass to the custom link component (e.g. { prefetch: true }).
|
|
26
|
+
* These take precedence over the component's own props.
|
|
27
|
+
*/
|
|
28
|
+
props?: Record<string, unknown>;
|
|
29
|
+
}
|
|
4
30
|
/**
|
|
5
31
|
* Configuration options for the Sidebar component.
|
|
6
32
|
*/
|
|
@@ -63,9 +89,14 @@ export interface SidebarProps<T = string> extends BaseSidebarProps {
|
|
|
63
89
|
*/
|
|
64
90
|
bodyClassName?: string;
|
|
65
91
|
/**
|
|
66
|
-
*
|
|
92
|
+
* Options configuration for the sidebar's navigation items
|
|
93
|
+
* (radius and active/inactive styling), plus item-local props.
|
|
67
94
|
*/
|
|
68
|
-
|
|
95
|
+
options?: SidebarOptionProps;
|
|
96
|
+
/**
|
|
97
|
+
* Tooltip configuration for collapsed sidebar items.
|
|
98
|
+
*/
|
|
99
|
+
tooltip?: SidebarTooltipConfig;
|
|
69
100
|
/**
|
|
70
101
|
* Section label class override.
|
|
71
102
|
*/
|
|
@@ -79,15 +110,10 @@ export interface SidebarProps<T = string> extends BaseSidebarProps {
|
|
|
79
110
|
*/
|
|
80
111
|
anchorProps?: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "children" | "onClick" | "className">;
|
|
81
112
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*/
|
|
85
|
-
linkComponent?: ElementType;
|
|
86
|
-
/**
|
|
87
|
-
* Additional props to pass to the custom link component (e.g., { prefetch: true }).
|
|
88
|
-
* These take precedence over the component's own props.
|
|
113
|
+
* Link configuration for navigation items.
|
|
114
|
+
* Provides the custom link component and props forwarded to it.
|
|
89
115
|
*/
|
|
90
|
-
|
|
116
|
+
link?: SidebarLinkProps;
|
|
91
117
|
}
|
|
92
118
|
/**
|
|
93
119
|
* A collapsible navigation sidebar with support for sections, items,
|
|
@@ -116,16 +142,11 @@ export interface SidebarProps<T = string> extends BaseSidebarProps {
|
|
|
116
142
|
* @param props.size - Size scale. Defaults to "md".
|
|
117
143
|
* @param props.variant - Visual style variant. Defaults to "default".
|
|
118
144
|
* @param props.radius - Corner rounding of the sidebar.
|
|
119
|
-
* @param props.
|
|
120
|
-
* @param props.
|
|
121
|
-
* @param props.activeItemVariant - Visual variant for active items.
|
|
122
|
-
* @param props.activeItemColor - Theme color for active items.
|
|
123
|
-
* @param props.showTooltips - Whether tooltips are shown. Defaults to true.
|
|
124
|
-
* @param props.tooltipPlacement - Placement of tooltips. Defaults to "right".
|
|
145
|
+
* @param props.options - Navigation item options (radius, active/inactive variant and color).
|
|
146
|
+
* @param props.tooltip - Tooltip configuration for collapsed items (show, placement, variant, color).
|
|
125
147
|
* @param props.showCollapseButton - Whether the collapse button is shown. Defaults to true.
|
|
126
148
|
* @param props.collapsible - Whether the sidebar can be collapsed. Defaults to true.
|
|
127
|
-
* @param props.
|
|
128
|
-
* @param props.linkProps - Props for the custom link component.
|
|
149
|
+
* @param props.link - Link configuration for navigation items (component and props).
|
|
129
150
|
*
|
|
130
151
|
* @example
|
|
131
152
|
* ```tsx
|
|
@@ -159,7 +180,7 @@ export interface SidebarProps<T = string> extends BaseSidebarProps {
|
|
|
159
180
|
* { id: "main", label: "Main", items: mainItems },
|
|
160
181
|
* { id: "admin", label: "Admin", items: adminItems },
|
|
161
182
|
* ]}
|
|
162
|
-
*
|
|
183
|
+
* link={{ component: NextLink }}
|
|
163
184
|
* userRole="admin"
|
|
164
185
|
* />
|
|
165
186
|
* ```
|
|
@@ -167,7 +188,7 @@ export interface SidebarProps<T = string> extends BaseSidebarProps {
|
|
|
167
188
|
* @see SidebarConfig - The configuration type for component defaults.
|
|
168
189
|
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
169
190
|
*/
|
|
170
|
-
export declare function Sidebar<T = string>({ items: itemsProp, activeKey, onSelect, isCollapsed: isCollapsedProp, onCollapseChange, title, onBack, backIcon, userRole, footer, variant, size, radius,
|
|
191
|
+
export declare function Sidebar<T = string>({ items: itemsProp, activeKey, onSelect, isCollapsed: isCollapsedProp, onCollapseChange, title, onBack, backIcon, userRole, footer, variant, size, radius, options, showCollapseButton: showCollapseButtonProp, collapsible: collapsibleProp, defaultCollapsed: defaultCollapsedProp, tooltip, headerClassName, bodyClassName, sectionLabelClassName, footerClassName, anchorProps, link, className, style, ...props }: SidebarProps<T>): import("react").JSX.Element;
|
|
171
192
|
export declare namespace Sidebar {
|
|
172
193
|
var displayName: string;
|
|
173
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/Sidebar.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW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