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
package/README.md
CHANGED
|
@@ -207,17 +207,4 @@ See the [Theming docs](/docs/theming) for the full token list.
|
|
|
207
207
|
|
|
208
208
|
## License
|
|
209
209
|
|
|
210
|
-
MIT
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
### Key changes from your draft
|
|
215
|
-
|
|
216
|
-
- **Added a title and tagline** — npm shows this at the top, so a proper `# asheeui` heading and one-line description is important.
|
|
217
|
-
- **Added a Features section** — npm readers skim; highlighting the key selling points (config-driven, Tailwind v4, theming, TypeScript) helps them decide quickly.
|
|
218
|
-
- **Folded the framework-specific installation guides into a "Framework guides" list** — the full TanStack/Vite/Next installation content belongs in the docs site, not the npm README. Linking out keeps the README scannable.
|
|
219
|
-
- **Added a real "Configuration" section** — your draft mentioned config-driven but never showed it. I pulled the precedence rules and an example from your Configuration docs.
|
|
220
|
-
- **Added a "Theming" section** — same reasoning. The `useTheme` hook and custom theme example are the library's headline features, so they belong on the front page.
|
|
221
|
-
- **Added License and Links sections** — standard npm README conventions.
|
|
222
|
-
- **Tightened the Quick start** — kept the CLI-first flow but made the manual setup explicit so readers without the CLI aren't stranded.
|
|
223
|
-
- **Preserved all `<PackageManagerTabs>` references** where they belong (docs site) but replaced them with plain `bash` blocks in the README, since npm's markdown renderer won't execute your React components.
|
|
210
|
+
MIT
|
package/dist/AsheeUIProvider.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { resolveConfig as
|
|
5
|
-
import { AsheeConfigContext as
|
|
6
|
-
import { useIsomorphicLayoutEffect as
|
|
7
|
-
import { AsheeThemeScript as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
] });
|
|
2
|
+
"use client";
|
|
3
|
+
import { themeController as e } from "./theme/controller.js";
|
|
4
|
+
import { resolveConfig as t } from "./config/resolve-config.js";
|
|
5
|
+
import { AsheeConfigContext as n } from "./libs/context.js";
|
|
6
|
+
import { useIsomorphicLayoutEffect as r } from "./libs/use-isomorphic-layout-effect.js";
|
|
7
|
+
import { AsheeThemeScript as i } from "./scripts/AsheeThemeScript.js";
|
|
8
|
+
import { useMemo as a } from "react";
|
|
9
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
10
|
+
//#region src/AsheeUIProvider.tsx
|
|
11
|
+
function c({ config: c = {}, children: l }) {
|
|
12
|
+
let u = a(() => t(c), [c]);
|
|
13
|
+
return r(() => {
|
|
14
|
+
e.configure({
|
|
15
|
+
defaultTheme: u.defaultTheme ?? "system",
|
|
16
|
+
themes: Object.keys(u.color)
|
|
17
|
+
});
|
|
18
|
+
}, [u]), /* @__PURE__ */ s(n.Provider, {
|
|
19
|
+
value: u,
|
|
20
|
+
children: [/* @__PURE__ */ o(i, { config: u }), l]
|
|
21
|
+
});
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { c as AsheeUIProvider };
|
|
@@ -1,174 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
-
id: m,
|
|
82
|
-
className: n(
|
|
83
|
-
"w-full",
|
|
84
|
-
U,
|
|
85
|
-
i !== "ghost" && i !== "flush" && I,
|
|
86
|
-
V
|
|
87
|
-
),
|
|
88
|
-
style: F,
|
|
89
|
-
...k,
|
|
90
|
-
children: g.map((e, N) => {
|
|
91
|
-
const r = e.id || `item-${N}`, l = a.includes(r), c = `${m}-header-${r}`, y = `${m}-content-${r}`;
|
|
92
|
-
return /* @__PURE__ */ u(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
className: n(
|
|
96
|
-
"w-full transition-colors box-border",
|
|
97
|
-
q,
|
|
98
|
-
(i === "separated" || i === "ghost") && I,
|
|
99
|
-
$
|
|
100
|
-
),
|
|
101
|
-
children: [
|
|
102
|
-
/* @__PURE__ */ u(
|
|
103
|
-
"button",
|
|
104
|
-
{
|
|
105
|
-
id: c,
|
|
106
|
-
type: "button",
|
|
107
|
-
"aria-expanded": l,
|
|
108
|
-
"aria-controls": y,
|
|
109
|
-
disabled: e.disabled,
|
|
110
|
-
onClick: () => X(r, e.disabled),
|
|
111
|
-
className: n(
|
|
112
|
-
"w-full min-w-full text-left flex items-center justify-between gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed select-none box-border",
|
|
113
|
-
J,
|
|
114
|
-
M
|
|
115
|
-
),
|
|
116
|
-
children: [
|
|
117
|
-
/* @__PURE__ */ u("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: [
|
|
118
|
-
e.icon && /* @__PURE__ */ t("span", { className: "shrink-0 text-foreground/70", children: e.icon }),
|
|
119
|
-
/* @__PURE__ */ u("div", { className: "flex flex-col min-w-0", children: [
|
|
120
|
-
/* @__PURE__ */ t("span", { className: "font-semibold truncate", children: e.title }),
|
|
121
|
-
e.subtitle && /* @__PURE__ */ t("span", { className: "text-xs text-foreground/70 truncate", children: e.subtitle })
|
|
122
|
-
] })
|
|
123
|
-
] }),
|
|
124
|
-
/* @__PURE__ */ t(
|
|
125
|
-
"div",
|
|
126
|
-
{
|
|
127
|
-
className: n(
|
|
128
|
-
"text-foreground/70 shrink-0 ml-2 transition-transform duration-200 ease-in-out",
|
|
129
|
-
h ? "transition-none" : "",
|
|
130
|
-
l && "rotate-180"
|
|
131
|
-
),
|
|
132
|
-
children: T || /* @__PURE__ */ t(re, { className: "w-4 h-4" })
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
/* @__PURE__ */ t(
|
|
139
|
-
"section",
|
|
140
|
-
{
|
|
141
|
-
id: y,
|
|
142
|
-
"aria-labelledby": c,
|
|
143
|
-
"data-state": l ? "open" : "closed",
|
|
144
|
-
className: n(
|
|
145
|
-
"w-full grid transition-[grid-template-rows,opacity] duration-250 ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
146
|
-
h ? "transition-none" : "",
|
|
147
|
-
l ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"
|
|
148
|
-
),
|
|
149
|
-
children: /* @__PURE__ */ t("div", { className: "scrollbar-hide overflow-hidden w-full", children: /* @__PURE__ */ t(
|
|
150
|
-
"div",
|
|
151
|
-
{
|
|
152
|
-
className: n(
|
|
153
|
-
"text-foreground/70 leading-relaxed pt-0",
|
|
154
|
-
P,
|
|
155
|
-
j
|
|
156
|
-
),
|
|
157
|
-
children: e.content
|
|
158
|
-
}
|
|
159
|
-
) })
|
|
160
|
-
}
|
|
161
|
-
)
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
r
|
|
165
|
-
);
|
|
166
|
-
})
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
le.displayName = "Accordion";
|
|
172
|
-
export {
|
|
173
|
-
le as Accordion
|
|
174
|
-
};
|
|
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 { RADIUS_CLASS as r } from "../../shared/radius.js";
|
|
7
|
+
import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
|
|
8
|
+
import { FALLBACK_ACCORDION_CONFIG as s } from "./accordion-config.js";
|
|
9
|
+
import { ACCORDION_CONTENT_SIZE_CLASS as c, ACCORDION_HEADER_SIZE_CLASS as l, ACCORDION_VARIANT_CONTAINER_CLASS as u, ACCORDION_VARIANT_ITEM_CLASS as d } from "./accordion-styles.js";
|
|
10
|
+
import { forwardRef as f, useCallback as p, useId as m, useState as h } from "react";
|
|
11
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/accordion/Accordion.tsx
|
|
13
|
+
var v = f(({ items: f = [], variant: v, size: y, radius: b, allowMultiple: x, defaultValue: S, value: C, onValueChange: w, expandIcon: T, disableAnimation: E = !1, itemClassName: D, headerClassName: O, contentClassName: k, className: A, style: j, id: M, ...N }, P) => {
|
|
14
|
+
let F = t(), I = F.components?.accordion, L = m(), R = M ?? L, z = i(y, I?.size, void 0, s.size), B = i(v, I?.variant, F.defaultVariant, s.variant), V = i(x, I?.allowMultiple, void 0, s.allowMultiple), H = o(b, I?.radius, F.defaultRadius, s.radius), U = u[B] ?? u.separated, W = d[B] ?? d.separated, G = a(z, l, s.size), K = a(z, c, s.size), q = a(H, r, s.radius), J = C !== void 0, Y = p((e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], []), [X, Z] = h(() => Y(S)), Q = J ? Y(C) : X, $ = p((e, t) => {
|
|
15
|
+
if (t) return;
|
|
16
|
+
let n;
|
|
17
|
+
n = Q.includes(e) ? Q.filter((t) => t !== e) : V ? [...Q, e] : [e], J || Z(n), w?.(n);
|
|
18
|
+
}, [
|
|
19
|
+
Q,
|
|
20
|
+
J,
|
|
21
|
+
w,
|
|
22
|
+
V
|
|
23
|
+
]);
|
|
24
|
+
return /* @__PURE__ */ g("div", {
|
|
25
|
+
ref: P,
|
|
26
|
+
id: R,
|
|
27
|
+
className: e("w-full", U, B !== "ghost" && B !== "flush" && q, A),
|
|
28
|
+
style: j,
|
|
29
|
+
...N,
|
|
30
|
+
children: f.map((t, r) => {
|
|
31
|
+
let i = t.id || `item-${r}`, a = Q.includes(i), o = `${R}-header-${i}`, s = `${R}-content-${i}`;
|
|
32
|
+
return /* @__PURE__ */ _("div", {
|
|
33
|
+
className: e("w-full transition-colors box-border", W, (B === "separated" || B === "ghost") && q, D),
|
|
34
|
+
children: [/* @__PURE__ */ _("button", {
|
|
35
|
+
id: o,
|
|
36
|
+
type: "button",
|
|
37
|
+
"aria-expanded": a,
|
|
38
|
+
"aria-controls": s,
|
|
39
|
+
disabled: t.disabled,
|
|
40
|
+
onClick: () => $(i, t.disabled),
|
|
41
|
+
className: e("w-full min-w-full text-left flex items-center justify-between gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed select-none box-border", G, O),
|
|
42
|
+
children: [/* @__PURE__ */ _("div", {
|
|
43
|
+
className: "flex items-center gap-3 min-w-0 flex-1",
|
|
44
|
+
children: [t.icon && /* @__PURE__ */ g("span", {
|
|
45
|
+
className: "shrink-0 text-foreground/70",
|
|
46
|
+
children: t.icon
|
|
47
|
+
}), /* @__PURE__ */ _("div", {
|
|
48
|
+
className: "flex flex-col min-w-0",
|
|
49
|
+
children: [/* @__PURE__ */ g("span", {
|
|
50
|
+
className: "font-semibold truncate",
|
|
51
|
+
children: t.title
|
|
52
|
+
}), t.subtitle && /* @__PURE__ */ g("span", {
|
|
53
|
+
className: "text-xs text-foreground/70 truncate",
|
|
54
|
+
children: t.subtitle
|
|
55
|
+
})]
|
|
56
|
+
})]
|
|
57
|
+
}), /* @__PURE__ */ g("div", {
|
|
58
|
+
className: e("text-foreground/70 shrink-0 ml-2 transition-transform duration-200 ease-in-out", E ? "transition-none" : "", a && "rotate-180"),
|
|
59
|
+
children: T || /* @__PURE__ */ g(n, { className: "w-4 h-4" })
|
|
60
|
+
})]
|
|
61
|
+
}), /* @__PURE__ */ g("section", {
|
|
62
|
+
id: s,
|
|
63
|
+
"aria-labelledby": o,
|
|
64
|
+
"data-state": a ? "open" : "closed",
|
|
65
|
+
className: e("w-full grid transition-[grid-template-rows,opacity] duration-250 ease-[cubic-bezier(0.16,1,0.3,1)]", E ? "transition-none" : "", a ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
|
|
66
|
+
children: /* @__PURE__ */ g("div", {
|
|
67
|
+
className: "scrollbar-hide overflow-hidden w-full",
|
|
68
|
+
children: /* @__PURE__ */ g("div", {
|
|
69
|
+
className: e("text-foreground/70 leading-relaxed pt-0", K, k),
|
|
70
|
+
children: t.content
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
}, i);
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
v.displayName = "Accordion";
|
|
79
|
+
//#endregion
|
|
80
|
+
export { v as Accordion };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
//#region src/components/accordion/accordion-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
allowMultiple: !1
|
|
6
7
|
};
|
|
7
|
-
e("accordion",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
t as FALLBACK_ACCORDION_CONFIG,
|
|
16
|
-
o as defaultAccordionConfig
|
|
8
|
+
e("accordion", t);
|
|
9
|
+
var n = {
|
|
10
|
+
size: "md",
|
|
11
|
+
variant: "separated",
|
|
12
|
+
radius: "md",
|
|
13
|
+
allowMultiple: !1
|
|
17
14
|
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as FALLBACK_ACCORDION_CONFIG, t as defaultAccordionConfig };
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
e as ACCORDION_CONTENT_SIZE_CLASS,
|
|
23
|
-
r as ACCORDION_HEADER_SIZE_CLASS,
|
|
24
|
-
o as ACCORDION_VARIANT_CONTAINER_CLASS,
|
|
25
|
-
s as ACCORDION_VARIANT_ITEM_CLASS
|
|
2
|
+
//#region src/components/accordion/accordion-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "px-3.5 py-2 text-xs",
|
|
5
|
+
md: "px-5 py-3.5 text-sm",
|
|
6
|
+
lg: "px-6 py-4 text-base"
|
|
7
|
+
}, t = {
|
|
8
|
+
sm: "px-3.5 pb-2 text-xs",
|
|
9
|
+
md: "px-5 pb-3.5 text-sm",
|
|
10
|
+
lg: "px-6 pb-4 text-base"
|
|
11
|
+
}, n = {
|
|
12
|
+
bordered: "border border-border divide-y divide-border",
|
|
13
|
+
separated: "space-y-3",
|
|
14
|
+
ghost: "divide-y divide-border border-y border-border",
|
|
15
|
+
flush: "space-y-1"
|
|
16
|
+
}, r = {
|
|
17
|
+
bordered: "bg-secondary transition-colors hover:bg-foreground/10",
|
|
18
|
+
separated: "border border-border bg-secondary transition-colors hover:bg-secondary/30 shadow-xs",
|
|
19
|
+
ghost: "bg-transparent transition-colors hover:bg-secondary/20",
|
|
20
|
+
flush: "bg-transparent hover:bg-secondary/50 transition-colors"
|
|
26
21
|
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { t as ACCORDION_CONTENT_SIZE_CLASS, e as ACCORDION_HEADER_SIZE_CLASS, n as ACCORDION_VARIANT_CONTAINER_CLASS, r as ACCORDION_VARIANT_ITEM_CLASS };
|
|
@@ -1,137 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
-
[r]
|
|
82
|
-
), h = F(
|
|
83
|
-
() => s != null ? [s] : [],
|
|
84
|
-
[s]
|
|
85
|
-
);
|
|
86
|
-
return /* @__PURE__ */ V("div", { className: "w-full relative inline-block", children: [
|
|
87
|
-
/* @__PURE__ */ A(
|
|
88
|
-
le,
|
|
89
|
-
{
|
|
90
|
-
ref: (t) => {
|
|
91
|
-
x.setReference(t), typeof c == "function" ? c(t) : c && (c.current = t);
|
|
92
|
-
},
|
|
93
|
-
variant: D,
|
|
94
|
-
radius: I,
|
|
95
|
-
color: G,
|
|
96
|
-
size: U,
|
|
97
|
-
disabled: O,
|
|
98
|
-
placeholder: j,
|
|
99
|
-
value: a,
|
|
100
|
-
onChange: $,
|
|
101
|
-
onClick: (t) => {
|
|
102
|
-
O || m(!0), n == null || n(t);
|
|
103
|
-
},
|
|
104
|
-
"aria-expanded": S,
|
|
105
|
-
"aria-autocomplete": "none",
|
|
106
|
-
endContent: T,
|
|
107
|
-
className: _,
|
|
108
|
-
...X(B)
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
/* @__PURE__ */ A(
|
|
112
|
-
ce,
|
|
113
|
-
{
|
|
114
|
-
isOpen: S,
|
|
115
|
-
floatingStyles: H,
|
|
116
|
-
context: d,
|
|
117
|
-
getFloatingProps: Y,
|
|
118
|
-
setFloatingRef: x.setFloating,
|
|
119
|
-
isPositioned: q,
|
|
120
|
-
options: Z,
|
|
121
|
-
selectedValues: h,
|
|
122
|
-
onSelectMenuOption: k,
|
|
123
|
-
isSearch: !1,
|
|
124
|
-
belowList: M,
|
|
125
|
-
menuProps: P,
|
|
126
|
-
menuConfig: e == null ? void 0 : e.menu,
|
|
127
|
-
initialFocus: -1,
|
|
128
|
-
returnFocus: !1
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
] });
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
me.displayName = "Autocomplete";
|
|
135
|
-
export {
|
|
136
|
-
me as Autocomplete
|
|
137
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { useAsheeConfig as e } from "../../libs/context.js";
|
|
4
|
+
import { resolveCascade as t, resolveRadiusKey as n } from "../../utils/resolve-token.js";
|
|
5
|
+
import { Input as r } from "../input/Input.js";
|
|
6
|
+
import { SelectMenu as i } from "../select-menu/SelectMenu.js";
|
|
7
|
+
import { useSelectFloating as a } from "../select-menu/use-select-floating.js";
|
|
8
|
+
import { FALLBACK_AUTOCOMPLETE_CONFIG as o } from "./autocomplete-config.js";
|
|
9
|
+
import { forwardRef as s, useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
import { useDismiss as m, useFocus as h, useInteractions as g, useRole as _ } from "@floating-ui/react";
|
|
12
|
+
//#region src/components/autocomplete/Autocomplete.tsx
|
|
13
|
+
var v = s(({ options: s = [], value: v, onValueChange: y, onInputChange: b, allowCustomValue: x = !1, belowList: S, menu: C, variant: w, color: T, radius: E, size: D, endContent: O, onClick: k, disabled: A, placeholder: j = "Type to search...", className: M, ...N }, P) => {
|
|
14
|
+
let F = e(), I = F.components?.autocomplete, L = t(w, I?.variant, F.defaultVariant, o.variant), R = t(T, I?.color, F.defaultColor, o.color), z = n(E, I?.radius, F.defaultRadius, o.radius), ee = t(D, I?.size, void 0, o.size), B = u(() => s.find((e) => e.value === v), [s, v]), [V, H] = d(!1), [U, W] = d(() => B ? B.label : String(v ?? ""));
|
|
15
|
+
l(() => {
|
|
16
|
+
B ? W(B.label) : v != null && W(String(v));
|
|
17
|
+
}, [B, v]);
|
|
18
|
+
let { refs: G, context: K, isPositioned: q, floatingStyles: J } = a({
|
|
19
|
+
isOpen: V,
|
|
20
|
+
onOpenChange: H,
|
|
21
|
+
disabled: A
|
|
22
|
+
}), Y = h(K), X = m(K), Z = _(K, { role: "combobox" }), { getReferenceProps: Q, getFloatingProps: $ } = g([
|
|
23
|
+
Y,
|
|
24
|
+
X,
|
|
25
|
+
Z
|
|
26
|
+
]), te = u(() => U.trim() ? s.filter((e) => e.label.toLowerCase().includes(U.toLowerCase())) : s, [s, U]), ne = c((e) => {
|
|
27
|
+
let t = e.target.value;
|
|
28
|
+
W(t), b?.(t), H(!0), x && y?.(t);
|
|
29
|
+
}, [
|
|
30
|
+
x,
|
|
31
|
+
b,
|
|
32
|
+
y
|
|
33
|
+
]), re = c((e) => {
|
|
34
|
+
W(e.label), y?.(e.value, e), H(!1);
|
|
35
|
+
}, [y]), ie = u(() => v == null ? [] : [v], [v]);
|
|
36
|
+
return /* @__PURE__ */ p("div", {
|
|
37
|
+
className: "w-full relative inline-block",
|
|
38
|
+
children: [/* @__PURE__ */ f(r, {
|
|
39
|
+
ref: (e) => {
|
|
40
|
+
G.setReference(e), typeof P == "function" ? P(e) : P && (P.current = e);
|
|
41
|
+
},
|
|
42
|
+
variant: L,
|
|
43
|
+
radius: z,
|
|
44
|
+
color: R,
|
|
45
|
+
size: ee,
|
|
46
|
+
disabled: A,
|
|
47
|
+
placeholder: j,
|
|
48
|
+
value: U,
|
|
49
|
+
onChange: ne,
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
A || H(!0), k?.(e);
|
|
52
|
+
},
|
|
53
|
+
"aria-expanded": V,
|
|
54
|
+
"aria-autocomplete": "none",
|
|
55
|
+
endContent: O,
|
|
56
|
+
className: M,
|
|
57
|
+
...Q(N)
|
|
58
|
+
}), /* @__PURE__ */ f(i, {
|
|
59
|
+
isOpen: V,
|
|
60
|
+
floatingStyles: J,
|
|
61
|
+
context: K,
|
|
62
|
+
getFloatingProps: $,
|
|
63
|
+
setFloatingRef: G.setFloating,
|
|
64
|
+
isPositioned: q,
|
|
65
|
+
options: te,
|
|
66
|
+
selectedValues: ie,
|
|
67
|
+
onSelectMenuOption: re,
|
|
68
|
+
isSearch: !1,
|
|
69
|
+
belowList: S,
|
|
70
|
+
menuProps: C,
|
|
71
|
+
menuConfig: I?.menu,
|
|
72
|
+
initialFocus: -1,
|
|
73
|
+
returnFocus: !1
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
v.displayName = "Autocomplete";
|
|
78
|
+
//#endregion
|
|
79
|
+
export { v as Autocomplete };
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
3
|
import { FALLBACK_FIELD_CONFIG as t } from "../field/field-config.js";
|
|
4
|
-
import { defaultInputConfig as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
o("autocomplete", m);
|
|
11
|
-
export {
|
|
12
|
-
p as FALLBACK_AUTOCOMPLETE_CONFIG,
|
|
13
|
-
m as defaultAutocompleteConfig
|
|
14
|
-
};
|
|
4
|
+
import { defaultInputConfig as n } from "../input/input-config.js";
|
|
5
|
+
//#region src/components/autocomplete/autocomplete-config.ts
|
|
6
|
+
var r = { ...n }, i = { ...t };
|
|
7
|
+
e("autocomplete", r);
|
|
8
|
+
//#endregion
|
|
9
|
+
export { i as FALLBACK_AUTOCOMPLETE_CONFIG, r as defaultAutocompleteConfig };
|