asheeui 0.6.14 → 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/README.md +1 -14
- 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,179 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
5
|
import { resolveCascade as n } from "../../utils/resolve-token.js";
|
|
6
|
-
import { FALLBACK_RESIZABLE_SCREEN_CONFIG as
|
|
7
|
-
import {
|
|
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
|
-
|
|
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
|
-
ref: (e) => {
|
|
92
|
-
x.current = e, typeof u == "function" ? u(e) : u && (u.current = e);
|
|
93
|
-
},
|
|
94
|
-
className: c(
|
|
95
|
-
"flex relative",
|
|
96
|
-
o && "select-none",
|
|
97
|
-
i ? "flex-row" : "flex-col",
|
|
98
|
-
U
|
|
99
|
-
),
|
|
100
|
-
style: {
|
|
101
|
-
cursor: o ? i ? "col-resize" : "row-resize" : "default",
|
|
102
|
-
// Ensure sensible minimums so the component works even when no
|
|
103
|
-
// ancestor provides a definite size. These are fallbacks only.
|
|
104
|
-
minHeight: `${j}px`,
|
|
105
|
-
minWidth: `${B}px`,
|
|
106
|
-
..._
|
|
107
|
-
},
|
|
108
|
-
...F,
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ v(
|
|
111
|
-
"div",
|
|
112
|
-
{
|
|
113
|
-
className: c(
|
|
114
|
-
"min-w-0 min-h-0 overflow-auto",
|
|
115
|
-
o ? "transition-none" : "transition-[width,height] duration-150 ease-out"
|
|
116
|
-
),
|
|
117
|
-
style: {
|
|
118
|
-
[i ? "width" : "height"]: `${a}%`,
|
|
119
|
-
flexShrink: 0,
|
|
120
|
-
flexGrow: 0
|
|
121
|
-
},
|
|
122
|
-
children: J
|
|
123
|
-
}
|
|
124
|
-
),
|
|
125
|
-
!G && // biome-ignore lint/a11y/useSemanticElements: interactive resizable handle requires div styling
|
|
126
|
-
/* @__PURE__ */ v(
|
|
127
|
-
"div",
|
|
128
|
-
{
|
|
129
|
-
role: "separator",
|
|
130
|
-
tabIndex: 0,
|
|
131
|
-
"aria-valuenow": Math.round(a),
|
|
132
|
-
"aria-valuemin": h,
|
|
133
|
-
"aria-valuemax": f,
|
|
134
|
-
"aria-orientation": i ? "horizontal" : "vertical",
|
|
135
|
-
"aria-label": "Resize panel split",
|
|
136
|
-
onPointerDown: Y,
|
|
137
|
-
onPointerMove: Z,
|
|
138
|
-
onPointerUp: P,
|
|
139
|
-
onPointerCancel: P,
|
|
140
|
-
onKeyDown: q,
|
|
141
|
-
className: c(
|
|
142
|
-
"relative z-20 shrink-0 flex items-center justify-center outline-none select-none group touch-none",
|
|
143
|
-
i ? "w-4 self-stretch cursor-col-resize -mx-2" : "h-4 self-stretch w-full cursor-row-resize -my-2"
|
|
144
|
-
),
|
|
145
|
-
children: /* @__PURE__ */ v(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
className: c(
|
|
149
|
-
"transition-colors duration-150",
|
|
150
|
-
i ? "w-1 self-stretch" : "h-1 self-stretch w-full",
|
|
151
|
-
S || (o ? "bg-primary" : "bg-border group-hover:bg-primary/70 group-focus-visible:bg-primary")
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ v(
|
|
158
|
-
"div",
|
|
159
|
-
{
|
|
160
|
-
className: c(
|
|
161
|
-
"min-w-0 min-h-0 overflow-auto",
|
|
162
|
-
o ? "transition-none" : "transition-[width,height] duration-150 ease-out"
|
|
163
|
-
),
|
|
164
|
-
style: {
|
|
165
|
-
[i ? "width" : "height"]: `${100 - a}%`,
|
|
166
|
-
flex: 1
|
|
167
|
-
},
|
|
168
|
-
children: Q
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
]
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
ie.displayName = "ResizableScreen";
|
|
177
|
-
export {
|
|
178
|
-
ie as ResizableScreen
|
|
179
|
-
};
|
|
6
|
+
import { FALLBACK_RESIZABLE_SCREEN_CONFIG as r } from "./resizable-screen-config.js";
|
|
7
|
+
import { forwardRef as i, useCallback as a, useRef as o, useState as s } from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/resizable-screen/ResizableScreen.tsx
|
|
10
|
+
var u = i(({ children: i, left: u, size: d, defaultSize: f, minSize: p, maxSize: m, step: h, orientation: g, hideHandle: _, onSizeChange: v, handleClassName: y, minContainerHeight: b = 200, minContainerWidth: x = 200, className: S, style: C, ...w }, T) => {
|
|
11
|
+
let E = t().components?.resizableScreen, D = n(p, E?.minSize, void 0, r.minSize), O = n(m, E?.maxSize, void 0, r.maxSize), k = n(h, E?.step, void 0, r.step), A = n(g, E?.orientation, void 0, r.orientation), j = n(_, E?.hideHandle, void 0, r.hideHandle), M = n(f, E?.defaultSize, void 0, r.defaultSize), [N, P] = s(d ?? u ?? M), [F, I] = s(!1), L = o(null), R = d !== void 0, z = R ? d : N, B = a((e) => Math.min(Math.max(e, D), O), [D, O]), V = a((e) => {
|
|
12
|
+
let t = B(e);
|
|
13
|
+
R || P(t), v?.(t);
|
|
14
|
+
}, [
|
|
15
|
+
B,
|
|
16
|
+
R,
|
|
17
|
+
v
|
|
18
|
+
]), H = (e) => {
|
|
19
|
+
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), I(!0);
|
|
20
|
+
}, U = (e) => {
|
|
21
|
+
if (!F || !L.current) return;
|
|
22
|
+
let t = L.current.getBoundingClientRect(), n = A === "horizontal", r = n ? t.width : t.height, i = n ? e.clientX - t.left : e.clientY - t.top;
|
|
23
|
+
if (r > 0) {
|
|
24
|
+
let e = i / r * 100;
|
|
25
|
+
V(e);
|
|
26
|
+
}
|
|
27
|
+
}, W = (e) => {
|
|
28
|
+
if (F) {
|
|
29
|
+
try {
|
|
30
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
31
|
+
} catch {}
|
|
32
|
+
I(!1);
|
|
33
|
+
}
|
|
34
|
+
}, G = (e) => {
|
|
35
|
+
let t = A === "horizontal", n = t ? "ArrowLeft" : "ArrowUp", r = t ? "ArrowRight" : "ArrowDown";
|
|
36
|
+
e.key === n ? (e.preventDefault(), V(z - k)) : e.key === r ? (e.preventDefault(), V(z + k)) : e.key === "Home" ? (e.preventDefault(), V(D)) : e.key === "End" && (e.preventDefault(), V(O));
|
|
37
|
+
}, [K, q] = i, J = A === "horizontal";
|
|
38
|
+
return /* @__PURE__ */ l("div", {
|
|
39
|
+
ref: (e) => {
|
|
40
|
+
L.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
|
|
41
|
+
},
|
|
42
|
+
className: e("flex relative", F && "select-none", J ? "flex-row" : "flex-col", S),
|
|
43
|
+
style: {
|
|
44
|
+
cursor: F ? J ? "col-resize" : "row-resize" : "default",
|
|
45
|
+
minHeight: `${b}px`,
|
|
46
|
+
minWidth: `${x}px`,
|
|
47
|
+
...C
|
|
48
|
+
},
|
|
49
|
+
...w,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ c("div", {
|
|
52
|
+
className: e("min-w-0 min-h-0 overflow-auto", F ? "transition-none" : "transition-[width,height] duration-150 ease-out"),
|
|
53
|
+
style: {
|
|
54
|
+
[J ? "width" : "height"]: `${z}%`,
|
|
55
|
+
flexShrink: 0,
|
|
56
|
+
flexGrow: 0
|
|
57
|
+
},
|
|
58
|
+
children: K
|
|
59
|
+
}),
|
|
60
|
+
!j && /* @__PURE__ */ c("div", {
|
|
61
|
+
role: "separator",
|
|
62
|
+
tabIndex: 0,
|
|
63
|
+
"aria-valuenow": Math.round(z),
|
|
64
|
+
"aria-valuemin": D,
|
|
65
|
+
"aria-valuemax": O,
|
|
66
|
+
"aria-orientation": J ? "horizontal" : "vertical",
|
|
67
|
+
"aria-label": "Resize panel split",
|
|
68
|
+
onPointerDown: H,
|
|
69
|
+
onPointerMove: U,
|
|
70
|
+
onPointerUp: W,
|
|
71
|
+
onPointerCancel: W,
|
|
72
|
+
onKeyDown: G,
|
|
73
|
+
className: e("relative z-20 shrink-0 flex items-center justify-center outline-none select-none group touch-none", J ? "w-4 self-stretch cursor-col-resize -mx-2" : "h-4 self-stretch w-full cursor-row-resize -my-2"),
|
|
74
|
+
children: /* @__PURE__ */ c("div", { className: e("transition-colors duration-150", J ? "w-1 self-stretch" : "h-1 self-stretch w-full", y || (F ? "bg-primary" : "bg-border group-hover:bg-primary/70 group-focus-visible:bg-primary")) })
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ c("div", {
|
|
77
|
+
className: e("min-w-0 min-h-0 overflow-auto", F ? "transition-none" : "transition-[width,height] duration-150 ease-out"),
|
|
78
|
+
style: {
|
|
79
|
+
[J ? "width" : "height"]: `${100 - z}%`,
|
|
80
|
+
flex: 1
|
|
81
|
+
},
|
|
82
|
+
children: q
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
u.displayName = "ResizableScreen";
|
|
88
|
+
//#endregion
|
|
89
|
+
export { u as ResizableScreen };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
//#region src/components/resizable-screen/resizable-screen-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
defaultSize: 50,
|
|
6
|
+
minSize: 20,
|
|
7
|
+
maxSize: 80,
|
|
8
|
+
step: 2,
|
|
9
|
+
orientation: "horizontal"
|
|
9
10
|
}, n = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
e("resizableScreen", i);
|
|
18
|
-
export {
|
|
19
|
-
n as FALLBACK_RESIZABLE_SCREEN_CONFIG,
|
|
20
|
-
i as defaultResizableScreenConfig
|
|
11
|
+
defaultSize: 50,
|
|
12
|
+
minSize: 20,
|
|
13
|
+
maxSize: 80,
|
|
14
|
+
step: 2,
|
|
15
|
+
orientation: "horizontal",
|
|
16
|
+
hideHandle: !1
|
|
21
17
|
};
|
|
18
|
+
e("resizableScreen", t);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as FALLBACK_RESIZABLE_SCREEN_CONFIG, t as defaultResizableScreenConfig };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { InputProps } from '../input/Input';
|
|
3
|
-
import {
|
|
3
|
+
import { MenuProps } from '../select-menu/SelectMenu';
|
|
4
|
+
import { SelectMenuOption } from '../select-menu/select-menu-config';
|
|
4
5
|
import { SelectConfig } from './select-config';
|
|
5
6
|
/**
|
|
6
7
|
* Field-related props that Select inherits from Input.
|
|
@@ -89,7 +90,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
89
90
|
* Menu configuration overrides including portal, portalTarget, className, and visual styles.
|
|
90
91
|
* All menu-related props should be passed through this object.
|
|
91
92
|
*/
|
|
92
|
-
menu?:
|
|
93
|
+
menu?: MenuProps;
|
|
93
94
|
}
|
|
94
95
|
/**
|
|
95
96
|
* A dropdown selector with search, label, validation, and configurable styles.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,gBAAgB,GAAG,IAAI,CAC1B,UAAU,EACR,OAAO,GACP,aAAa,GACb,SAAS,GACT,UAAU,GACV,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,IAAI,GACJ,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,WACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEjD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoGG;AACH,eAAO,MAAM,MAAM,2GAsPlB,CAAC"}
|
|
@@ -1,196 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { resolveCascade as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { SelectMenu as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
-
[r]
|
|
100
|
-
), ce = le();
|
|
101
|
-
return /* @__PURE__ */ l(
|
|
102
|
-
xe,
|
|
103
|
-
{
|
|
104
|
-
id: c,
|
|
105
|
-
label: z,
|
|
106
|
-
labelAlign: ee,
|
|
107
|
-
description: S,
|
|
108
|
-
descriptionId: S ? `${c}-description` : void 0,
|
|
109
|
-
message: h,
|
|
110
|
-
messageId: h ? `${c}-message` : void 0,
|
|
111
|
-
status: m,
|
|
112
|
-
required: M,
|
|
113
|
-
isLoading: x,
|
|
114
|
-
children: /* @__PURE__ */ O("div", { className: "w-full relative inline-block", children: [
|
|
115
|
-
/* @__PURE__ */ l(
|
|
116
|
-
he,
|
|
117
|
-
{
|
|
118
|
-
ref: (t) => {
|
|
119
|
-
L.setReference(t), typeof i == "function" ? i(t) : i && (i.current = t);
|
|
120
|
-
},
|
|
121
|
-
type: "button",
|
|
122
|
-
variant: Z,
|
|
123
|
-
color: C,
|
|
124
|
-
animate: !1,
|
|
125
|
-
size: Y,
|
|
126
|
-
radius: V,
|
|
127
|
-
isDisabled: A,
|
|
128
|
-
isLoading: x,
|
|
129
|
-
fullWidth: !0,
|
|
130
|
-
"aria-expanded": u,
|
|
131
|
-
"aria-haspopup": "listbox",
|
|
132
|
-
"aria-invalid": m === "error",
|
|
133
|
-
"aria-describedby": [S ? `${c}-description` : void 0].filter(Boolean).join(" ") || void 0,
|
|
134
|
-
className: y(
|
|
135
|
-
"font-normal text-left justify-between",
|
|
136
|
-
te,
|
|
137
|
-
Q
|
|
138
|
-
),
|
|
139
|
-
style: W,
|
|
140
|
-
startContent: q,
|
|
141
|
-
endContent: /* @__PURE__ */ O(me, { children: [
|
|
142
|
-
H,
|
|
143
|
-
/* @__PURE__ */ l(
|
|
144
|
-
Se,
|
|
145
|
-
{
|
|
146
|
-
className: y(
|
|
147
|
-
"shrink-0 text-foreground/70 transition-transform duration-200",
|
|
148
|
-
u && "rotate-180"
|
|
149
|
-
)
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
] }),
|
|
153
|
-
...ce,
|
|
154
|
-
children: /* @__PURE__ */ l(
|
|
155
|
-
"span",
|
|
156
|
-
{
|
|
157
|
-
className: y(
|
|
158
|
-
"truncate",
|
|
159
|
-
s || n ? "text-foreground" : "text-foreground/70"
|
|
160
|
-
),
|
|
161
|
-
children: ie
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
),
|
|
166
|
-
/* @__PURE__ */ l(
|
|
167
|
-
Ae,
|
|
168
|
-
{
|
|
169
|
-
isOpen: u,
|
|
170
|
-
context: re,
|
|
171
|
-
floatingStyles: se,
|
|
172
|
-
getFloatingProps: ae,
|
|
173
|
-
setFloatingRef: L.setFloating,
|
|
174
|
-
isPositioned: oe,
|
|
175
|
-
options: p,
|
|
176
|
-
selectedValues: de,
|
|
177
|
-
onSelectMenuOption: ne,
|
|
178
|
-
isSearch: T,
|
|
179
|
-
searchPlaceholder: k,
|
|
180
|
-
searchInputName: D,
|
|
181
|
-
searchQuery: X,
|
|
182
|
-
onSearchChange: K,
|
|
183
|
-
belowList: $,
|
|
184
|
-
menuProps: U,
|
|
185
|
-
menuConfig: e == null ? void 0 : e.menu
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
] })
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
Ie.displayName = "Select";
|
|
194
|
-
export {
|
|
195
|
-
Ie as Select
|
|
196
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { ChevronDownIcon as n } from "../../icons/ChevronDownIcon.js";
|
|
6
|
+
import { resolveCascade as r, resolveRadiusKey as i } from "../../utils/resolve-token.js";
|
|
7
|
+
import { FieldShell as a } from "../field/FieldShell.js";
|
|
8
|
+
import { Button as o } from "../button/Button.js";
|
|
9
|
+
import { SelectMenu as s } from "../select-menu/SelectMenu.js";
|
|
10
|
+
import { useSelectFloating as c } from "../select-menu/use-select-floating.js";
|
|
11
|
+
import { FALLBACK_SELECT_CONFIG as l } from "./select-config.js";
|
|
12
|
+
import { SELECT_STATUS_BORDER_CLASS as u } from "./select-styles.js";
|
|
13
|
+
import { forwardRef as d, useCallback as ee, useId as f, useMemo as p, useState as m } from "react";
|
|
14
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
+
//#region src/components/select/Select.tsx
|
|
16
|
+
var v = d(({ options: d = [], value: v, onChange: y, onValueChange: b, size: te, radius: x, variant: S, color: C, status: ne, label: re, labelAlign: ie, description: w, message: T, required: E, isLoading: D, disabled: O, isSearch: k = !1, searchPlaceholder: A = "Search options...", searchInputName: j = "select-search", initialValue: M, belowList: N, placeholder: P = "Select...", className: F, id: I, name: L, menu: R, style: z, startContent: B, endContent: V }, H) => {
|
|
17
|
+
let U = t(), W = U.components?.select, G = f(), K = I ?? G, [q, J] = m(!1), [Y, X] = m(""), ae = r(te, W?.size, void 0, l.size), oe = r(S, W?.variant, U.defaultVariant, l.variant), se = r(C, W?.color, U.defaultColor, l.color), ce = i(x, W?.radius, U.defaultRadius, l.radius), Z = ne ?? l.status, le = r(ie, W?.labelAlign, void 0, l.labelAlign), ue = Z === "default" ? "" : u[Z], Q = p(() => d.find((e) => e.value === v), [d, v]), { refs: $, context: de, floatingStyles: fe, isPositioned: pe, getReferenceProps: me, getFloatingProps: he } = c({
|
|
18
|
+
isOpen: q,
|
|
19
|
+
onOpenChange: J,
|
|
20
|
+
disabled: O
|
|
21
|
+
}), ge = ee((e) => {
|
|
22
|
+
b?.(e.value), y && y({ target: {
|
|
23
|
+
value: e.value,
|
|
24
|
+
name: L ?? ""
|
|
25
|
+
} }), J(!1), X("");
|
|
26
|
+
}, [
|
|
27
|
+
L,
|
|
28
|
+
y,
|
|
29
|
+
b
|
|
30
|
+
]), _e = p(() => Q?.label ? Q.label : M === void 0 ? P : String(M), [
|
|
31
|
+
Q,
|
|
32
|
+
M,
|
|
33
|
+
P
|
|
34
|
+
]), ve = p(() => v == null ? [] : [v], [v]), ye = me();
|
|
35
|
+
return /* @__PURE__ */ g(a, {
|
|
36
|
+
id: K,
|
|
37
|
+
label: re,
|
|
38
|
+
labelAlign: le,
|
|
39
|
+
description: w,
|
|
40
|
+
descriptionId: w ? `${K}-description` : void 0,
|
|
41
|
+
message: T,
|
|
42
|
+
messageId: T ? `${K}-message` : void 0,
|
|
43
|
+
status: Z,
|
|
44
|
+
required: E,
|
|
45
|
+
isLoading: D,
|
|
46
|
+
children: /* @__PURE__ */ _("div", {
|
|
47
|
+
className: "w-full relative inline-block",
|
|
48
|
+
children: [/* @__PURE__ */ g(o, {
|
|
49
|
+
ref: (e) => {
|
|
50
|
+
$.setReference(e), typeof H == "function" ? H(e) : H && (H.current = e);
|
|
51
|
+
},
|
|
52
|
+
type: "button",
|
|
53
|
+
variant: oe,
|
|
54
|
+
color: se,
|
|
55
|
+
animate: !1,
|
|
56
|
+
size: ae,
|
|
57
|
+
radius: ce,
|
|
58
|
+
isDisabled: O,
|
|
59
|
+
isLoading: D,
|
|
60
|
+
fullWidth: !0,
|
|
61
|
+
"aria-expanded": q,
|
|
62
|
+
"aria-haspopup": "listbox",
|
|
63
|
+
"aria-invalid": Z === "error",
|
|
64
|
+
"aria-describedby": [w ? `${K}-description` : void 0].filter(Boolean).join(" ") || void 0,
|
|
65
|
+
className: e("font-normal text-left justify-between", ue, F),
|
|
66
|
+
style: z,
|
|
67
|
+
startContent: B,
|
|
68
|
+
endContent: /* @__PURE__ */ _(h, { children: [V, /* @__PURE__ */ g(n, { className: e("shrink-0 text-foreground/70 transition-transform duration-200", q && "rotate-180") })] }),
|
|
69
|
+
...ye,
|
|
70
|
+
children: /* @__PURE__ */ g("span", {
|
|
71
|
+
className: e("truncate", Q || M ? "text-foreground" : "text-foreground/70"),
|
|
72
|
+
children: _e
|
|
73
|
+
})
|
|
74
|
+
}), /* @__PURE__ */ g(s, {
|
|
75
|
+
isOpen: q,
|
|
76
|
+
context: de,
|
|
77
|
+
floatingStyles: fe,
|
|
78
|
+
getFloatingProps: he,
|
|
79
|
+
setFloatingRef: $.setFloating,
|
|
80
|
+
isPositioned: pe,
|
|
81
|
+
options: d,
|
|
82
|
+
selectedValues: ve,
|
|
83
|
+
onSelectMenuOption: ge,
|
|
84
|
+
isSearch: k,
|
|
85
|
+
searchPlaceholder: A,
|
|
86
|
+
searchInputName: j,
|
|
87
|
+
searchQuery: Y,
|
|
88
|
+
onSearchChange: X,
|
|
89
|
+
belowList: N,
|
|
90
|
+
menuProps: R,
|
|
91
|
+
menuConfig: W?.menu
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
v.displayName = "Select";
|
|
97
|
+
//#endregion
|
|
98
|
+
export { v as Select };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
import { defaultInputConfig as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as t } from "../field/field-config.js";
|
|
4
|
+
import { defaultInputConfig as n } from "../input/input-config.js";
|
|
5
|
+
//#region src/components/select/select-config.ts
|
|
6
|
+
var r = n, i = t;
|
|
7
|
+
e("select", r);
|
|
8
|
+
//#endregion
|
|
9
|
+
export { i as FALLBACK_SELECT_CONFIG, r as defaultSelectConfig };
|