asheeui 0.7.0 → 1.0.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.d.ts.map +1 -1
- package/dist/AsheeUIProvider.js +22 -15
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +9 -7
- package/dist/components/alert/Alert.d.ts +88 -0
- package/dist/components/alert/Alert.d.ts.map +1 -0
- package/dist/components/alert/Alert.js +61 -0
- package/dist/components/alert/alert-config.d.ts +56 -0
- package/dist/components/alert/alert-config.d.ts.map +1 -0
- package/dist/components/alert/alert-config.js +14 -0
- package/dist/components/alert/alert-styles.d.ts +32 -0
- package/dist/components/alert/alert-styles.d.ts.map +1 -0
- package/dist/components/alert/alert-styles.js +20 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +3 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +6 -6
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +94 -58
- package/dist/components/autocomplete/autocomplete-config.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts +87 -0
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.js +43 -0
- package/dist/components/avatar/avatar-config.d.ts +48 -0
- package/dist/components/avatar/avatar-config.d.ts.map +1 -0
- package/dist/components/avatar/avatar-config.js +14 -0
- package/dist/components/avatar/avatar-styles.d.ts +21 -0
- package/dist/components/avatar/avatar-styles.d.ts.map +1 -0
- package/dist/components/avatar/avatar-styles.js +13 -0
- package/dist/components/avatar/avatar.helpers.d.ts +19 -0
- package/dist/components/avatar/avatar.helpers.d.ts.map +1 -0
- package/dist/components/avatar/avatar.helpers.js +11 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +4 -0
- package/dist/components/badge/Badge.d.ts +69 -0
- package/dist/components/badge/Badge.d.ts.map +1 -0
- package/dist/components/badge/Badge.js +39 -0
- package/dist/components/badge/badge-config.d.ts +63 -0
- package/dist/components/badge/badge-config.d.ts.map +1 -0
- package/dist/components/badge/badge-config.js +15 -0
- package/dist/components/badge/badge-styles.d.ts +27 -0
- package/dist/components/badge/badge-styles.d.ts.map +1 -0
- package/dist/components/badge/badge-styles.js +25 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +106 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +52 -0
- package/dist/components/breadcrumb/breadcrumb-config.d.ts +41 -0
- package/dist/components/breadcrumb/breadcrumb-config.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb-config.js +10 -0
- package/dist/components/breadcrumb/breadcrumb-styles.d.ts +28 -0
- package/dist/components/breadcrumb/breadcrumb-styles.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb-styles.js +17 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +3 -0
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +10 -7
- package/dist/components/{date-picker/DatePicker.d.ts → calendar/Calendar.d.ts} +21 -21
- package/dist/components/calendar/Calendar.d.ts.map +1 -0
- package/dist/components/{date-picker/DatePicker.js → calendar/Calendar.js} +11 -11
- package/dist/components/{date-picker/Calendar.d.ts → calendar/DateGrid.d.ts} +7 -7
- package/dist/components/calendar/DateGrid.d.ts.map +1 -0
- package/dist/components/calendar/DateGrid.js +194 -0
- package/dist/components/calendar/TimeSpinner.d.ts.map +1 -0
- package/dist/components/{date-picker → calendar}/TimeSpinner.js +3 -3
- package/dist/components/{date-picker/date-picker-config.d.ts → calendar/calendar-config.d.ts} +17 -17
- package/dist/components/calendar/calendar-config.d.ts.map +1 -0
- package/dist/components/{date-picker/date-picker-config.js → calendar/calendar-config.js} +3 -3
- package/dist/components/{date-picker/date-picker-styles.d.ts → calendar/calendar-styles.d.ts} +1 -1
- package/dist/components/calendar/calendar-styles.d.ts.map +1 -0
- package/dist/components/{date-picker/date-picker-styles.js → calendar/calendar-styles.js} +1 -1
- package/dist/components/{date-picker/date-picker.helpers.d.ts → calendar/calendar.helpers.d.ts} +9 -9
- package/dist/components/calendar/calendar.helpers.d.ts.map +1 -0
- package/dist/components/{date-picker/date-picker.helpers.js → calendar/calendar.helpers.js} +4 -4
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +6 -0
- package/dist/components/card/Card.d.ts +6 -6
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +8 -8
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +85 -83
- package/dist/components/carousel/carousel-styles.d.ts +1 -20
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +5 -5
- package/dist/components/drawer/Drawer.d.ts +8 -4
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -38
- package/dist/components/{select/Select.d.ts → dropmenu/Dropmenu.d.ts} +21 -21
- package/dist/components/{select/Select.d.ts.map → dropmenu/Dropmenu.d.ts.map} +1 -1
- package/dist/components/dropmenu/Dropmenu.js +102 -0
- package/dist/components/{select/select-config.d.ts → dropmenu/dropmenu-config.d.ts} +8 -8
- package/dist/components/dropmenu/dropmenu-config.d.ts.map +1 -0
- package/dist/components/{select/select-config.js → dropmenu/dropmenu-config.js} +3 -3
- package/dist/components/{select/select-styles.d.ts → dropmenu/dropmenu-styles.d.ts} +1 -1
- package/dist/components/dropmenu/dropmenu-styles.d.ts.map +1 -0
- package/dist/components/{select/select-styles.js → dropmenu/dropmenu-styles.js} +1 -1
- package/dist/components/dropmenu/index.d.ts +3 -0
- package/dist/components/dropmenu/index.d.ts.map +1 -0
- package/dist/components/dropmenu/index.js +3 -0
- package/dist/components/field/FieldShell.d.ts +13 -1
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/FieldShell.js +16 -15
- package/dist/components/form/Form.d.ts +109 -0
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.js +42 -0
- package/dist/components/form/form-config.d.ts +57 -0
- package/dist/components/form/form-config.d.ts.map +1 -0
- package/dist/components/form/form-config.js +12 -0
- package/dist/components/form/form-styles.d.ts +27 -0
- package/dist/components/form/form-styles.d.ts.map +1 -0
- package/dist/components/form/form-styles.js +5 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/image/Image.d.ts +4 -5
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +5 -5
- package/dist/components/input/Input.js +5 -5
- package/dist/components/link/Link.d.ts +12 -10
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +1 -1
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +36 -33
- package/dist/components/{select-menu/SelectMenu.d.ts → menu/Menu.d.ts} +52 -19
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/Menu.js +161 -0
- package/dist/components/menu/index.d.ts +5 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +4 -0
- package/dist/components/{select-menu/select-menu-config.d.ts → menu/menu-config.d.ts} +5 -5
- package/dist/components/menu/menu-config.d.ts.map +1 -0
- package/dist/components/{select-menu/select-menu-config.js → menu/menu-config.js} +2 -2
- package/dist/components/menu/menu-navigation.d.ts +38 -0
- package/dist/components/menu/menu-navigation.d.ts.map +1 -0
- package/dist/components/menu/menu-navigation.js +20 -0
- package/dist/components/{select-menu/use-select-floating.d.ts → menu/use-menu-floating.d.ts} +10 -10
- package/dist/components/menu/use-menu-floating.d.ts.map +1 -0
- package/dist/components/{select-menu/use-select-floating.js → menu/use-menu-floating.js} +2 -2
- package/dist/components/modal/Modal.d.ts +6 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +62 -45
- package/dist/components/multi-select/MultiSelect.d.ts +11 -10
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +99 -86
- package/dist/components/multi-select/multi-select-config.d.ts +1 -1
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +91 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.js +66 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +4 -0
- package/dist/components/pagination/pagination-config.d.ts +66 -0
- package/dist/components/pagination/pagination-config.d.ts.map +1 -0
- package/dist/components/pagination/pagination-config.js +19 -0
- package/dist/components/pagination/pagination-styles.d.ts +19 -0
- package/dist/components/pagination/pagination-styles.d.ts.map +1 -0
- package/dist/components/pagination/pagination-styles.js +5 -0
- package/dist/components/pagination/pagination.helpers.d.ts +26 -0
- package/dist/components/pagination/pagination.helpers.d.ts.map +1 -0
- package/dist/components/pagination/pagination.helpers.js +12 -0
- package/dist/components/radio/Radio.d.ts +53 -107
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +50 -36
- package/dist/components/radio/RadioGroup.d.ts +107 -53
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +43 -49
- package/dist/components/radio/index.d.ts +0 -1
- package/dist/components/radio/index.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.d.ts +4 -4
- package/dist/components/scrollbar/index.js +1 -0
- package/dist/components/scrollbar/scrollbar-config.js +13 -0
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +92 -90
- package/dist/components/skeleton/Skeleton.d.ts +65 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/Skeleton.js +29 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +3 -0
- package/dist/components/skeleton/skeleton-config.d.ts +40 -0
- package/dist/components/skeleton/skeleton-config.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-config.js +13 -0
- package/dist/components/skeleton/skeleton-styles.d.ts +19 -0
- package/dist/components/skeleton/skeleton-styles.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-styles.js +5 -0
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +7 -5
- package/dist/components/table/Table.js +3 -3
- package/dist/components/tabs/Tabs.js +3 -3
- package/dist/components/textarea/Textarea.d.ts +10 -10
- package/dist/components/textarea/Textarea.js +7 -7
- package/dist/components/textarea/textarea-config.d.ts +2 -2
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +8 -7
- package/dist/components/tooltip/Tooltip.js +5 -5
- package/dist/components/typography/Typography.d.ts +60 -0
- package/dist/components/typography/Typography.d.ts.map +1 -0
- package/dist/components/typography/Typography.js +28 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/components/typography/index.d.ts.map +1 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/typography/typography-config.d.ts +54 -0
- package/dist/components/typography/typography-config.d.ts.map +1 -0
- package/dist/components/typography/typography-config.js +12 -0
- package/dist/components/typography/typography-styles.d.ts +21 -0
- package/dist/components/typography/typography-styles.d.ts.map +1 -0
- package/dist/components/typography/typography-styles.js +19 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +2 -2
- package/dist/config/index.js +1 -0
- package/dist/config/validate-config.d.ts +34 -0
- package/dist/config/validate-config.d.ts.map +1 -0
- package/dist/config/validate-config.js +190 -0
- package/dist/index.d.ts +15 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -47
- package/dist/libs/index.js +3 -0
- package/dist/libs/use-body-scroll-lock.d.ts +21 -0
- package/dist/libs/use-body-scroll-lock.d.ts.map +1 -0
- package/dist/libs/use-body-scroll-lock.js +27 -0
- package/dist/libs/use-dialog-overlay.d.ts +21 -0
- package/dist/libs/use-dialog-overlay.d.ts.map +1 -0
- package/dist/libs/use-dialog-overlay.js +21 -0
- package/dist/libs/use-prefers-reduced-motion.d.ts +23 -0
- package/dist/libs/use-prefers-reduced-motion.d.ts.map +1 -0
- package/dist/libs/use-prefers-reduced-motion.js +19 -0
- package/dist/scripts/AsheeThemeScript.js +43 -8
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/typography.d.ts +81 -0
- package/dist/shared/typography.d.ts.map +1 -0
- package/dist/shared/typography.js +137 -0
- package/dist/utils/stacking.d.ts +2 -2
- package/dist/utils/stacking.d.ts.map +1 -1
- package/package.json +13 -6
- package/dist/components/date-picker/Calendar.d.ts.map +0 -1
- package/dist/components/date-picker/Calendar.js +0 -143
- package/dist/components/date-picker/DatePicker.d.ts.map +0 -1
- package/dist/components/date-picker/TimeSpinner.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker-styles.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +0 -1
- package/dist/components/date-picker/index.d.ts +0 -3
- package/dist/components/date-picker/index.d.ts.map +0 -1
- package/dist/components/date-picker/index.js +0 -6
- package/dist/components/select/Select.js +0 -98
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js +0 -3
- package/dist/components/select/select-config.d.ts.map +0 -1
- package/dist/components/select/select-styles.d.ts.map +0 -1
- package/dist/components/select-menu/SelectMenu.d.ts.map +0 -1
- package/dist/components/select-menu/SelectMenu.js +0 -104
- package/dist/components/select-menu/index.d.ts +0 -4
- package/dist/components/select-menu/index.d.ts.map +0 -1
- package/dist/components/select-menu/index.js +0 -3
- package/dist/components/select-menu/select-menu-config.d.ts.map +0 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +0 -1
- /package/dist/components/{date-picker → calendar}/TimeSpinner.d.ts +0 -0
|
@@ -1,124 +1,126 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as
|
|
7
|
-
import { ChevronLeftIcon as ee } from "../../icons/ChevronLeftIcon.js";
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
|
+
import { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as ee } from "../../utils/resolve-token.js";
|
|
8
7
|
import { ChevronRightIcon as te } from "../../icons/ChevronRightIcon.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { ChevronLeftIcon as ne } from "../../icons/ChevronLeftIcon.js";
|
|
9
|
+
import { usePrefersReducedMotion as re } from "../../libs/use-prefers-reduced-motion.js";
|
|
10
|
+
import { FALLBACK_CAROUSEL_CONFIG as a } from "./carousel-config.js";
|
|
11
|
+
import { CAROUSEL_HEIGHT_CLASS as o, CAROUSEL_PADDING_CLASS as s, CAROUSEL_VARIANT_CLASS as c } from "./carousel-styles.js";
|
|
12
|
+
import { forwardRef as l, useCallback as u, useEffect as ie, useId as ae, useMemo as oe, useRef as se, useState as d } from "react";
|
|
13
|
+
import { Fragment as ce, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
13
14
|
//#region src/components/carousel/Carousel.tsx
|
|
14
|
-
var
|
|
15
|
-
let
|
|
15
|
+
var le = 50, m = l(({ items: l = [], variant: m, size: ue, radius: de, autoPlay: h, autoPlayInterval: g, loop: fe, showControls: pe, showIndicators: me, pauseOnHover: he, disableAnimation: ge = !1, defaultIndex: _e = 0, index: _, onIndexChange: v, renderPrevControl: y, renderNextControl: b, itemClassName: ve, controlClassName: x, indicatorClassName: ye, className: be, style: xe, children: S, id: C, ...w }, T) => {
|
|
16
|
+
let E = n(), D = E.components?.carousel, O = ae(), k = C ?? O, A = r(ue, D?.size, void 0, a.size), j = r(m, D?.variant, E.defaultVariant, a.variant), M = ee(de, D?.radius, E.defaultRadius, a.radius), N = r(h, D?.autoPlay, void 0, a.autoPlay), P = r(g, D?.autoPlayInterval, void 0, a.autoPlayInterval), F = r(fe, D?.loop, void 0, a.loop), I = r(pe, D?.showControls, void 0, a.showControls), Se = r(me, D?.showIndicators, void 0, a.showIndicators), L = r(he, D?.pauseOnHover, void 0, a.pauseOnHover), Ce = i(A, o, a.size), we = i(A, s, a.size), Te = i(M, t, a.radius), Ee = c[j] ?? c.bordered, R = oe(() => l.length > 0 ? l : S ? (Array.isArray(S) ? S : [S]).map((e, t) => ({
|
|
16
17
|
id: `slide-${t}`,
|
|
17
18
|
content: e
|
|
18
|
-
})) : [], [l,
|
|
19
|
-
if (
|
|
20
|
-
let t =
|
|
21
|
-
t < 0 ? t =
|
|
19
|
+
})) : [], [l, S]), z = _ !== void 0, [De, B] = d(_e), V = z ? _ : De, [H, U] = d(!1), [W, G] = d(!1), [K, q] = d(0), J = se(0), Y = u((e) => {
|
|
20
|
+
if (R.length <= 1) return;
|
|
21
|
+
let t = V + e;
|
|
22
|
+
t < 0 ? t = F ? R.length - 1 : 0 : t >= R.length && (t = F ? 0 : R.length - 1), t !== V && (z || B(t), v?.(t));
|
|
22
23
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]),
|
|
29
|
-
e ===
|
|
24
|
+
V,
|
|
25
|
+
R.length,
|
|
26
|
+
F,
|
|
27
|
+
z,
|
|
28
|
+
v
|
|
29
|
+
]), Oe = u((e) => {
|
|
30
|
+
e === V || e < 0 || e >= R.length || (z || B(e), v?.(e));
|
|
30
31
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
if (!
|
|
32
|
+
V,
|
|
33
|
+
R.length,
|
|
34
|
+
z,
|
|
35
|
+
v
|
|
36
|
+
]), X = re();
|
|
37
|
+
ie(() => {
|
|
38
|
+
if (!N || X || L && H || W || R.length <= 1) return;
|
|
38
39
|
let e = setInterval(() => {
|
|
39
|
-
|
|
40
|
-
},
|
|
40
|
+
Y(1);
|
|
41
|
+
}, P);
|
|
41
42
|
return () => clearInterval(e);
|
|
42
43
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
N,
|
|
45
|
+
P,
|
|
46
|
+
L,
|
|
47
|
+
H,
|
|
48
|
+
W,
|
|
49
|
+
X,
|
|
50
|
+
R.length,
|
|
51
|
+
Y
|
|
50
52
|
]);
|
|
51
|
-
let
|
|
52
|
-
e.target.closest("button") || (
|
|
53
|
-
},
|
|
54
|
-
if (!
|
|
55
|
-
let t = e.clientX -
|
|
56
|
-
|
|
53
|
+
let ke = (e) => {
|
|
54
|
+
e.target.closest("button") || (G(!0), J.current = e.clientX, q(0), e.currentTarget.setPointerCapture(e.pointerId));
|
|
55
|
+
}, Ae = (e) => {
|
|
56
|
+
if (!W) return;
|
|
57
|
+
let t = e.clientX - J.current;
|
|
58
|
+
q(t);
|
|
57
59
|
}, Z = () => {
|
|
58
|
-
|
|
59
|
-
}, Q = !
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
ref:
|
|
62
|
-
id:
|
|
63
|
-
onMouseEnter: () =>
|
|
64
|
-
onMouseLeave: () =>
|
|
65
|
-
onFocus: () =>
|
|
66
|
-
onBlur: () =>
|
|
67
|
-
className: e("relative scrollbar-hide overflow-hidden w-full select-none flex flex-col group",
|
|
68
|
-
style:
|
|
69
|
-
...
|
|
60
|
+
W && (G(!1), K < -50 ? Y(1) : K > le && Y(-1), q(0));
|
|
61
|
+
}, Q = !F && V === 0, $ = !F && V === R.length - 1;
|
|
62
|
+
return /* @__PURE__ */ p("div", {
|
|
63
|
+
ref: T,
|
|
64
|
+
id: k,
|
|
65
|
+
onMouseEnter: () => U(!0),
|
|
66
|
+
onMouseLeave: () => U(!1),
|
|
67
|
+
onFocus: () => U(!0),
|
|
68
|
+
onBlur: () => U(!1),
|
|
69
|
+
className: e("relative scrollbar-hide overflow-hidden w-full select-none flex flex-col group", Ee, Te, Ce, be),
|
|
70
|
+
style: xe,
|
|
71
|
+
...w,
|
|
70
72
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
onPointerDown:
|
|
73
|
-
onPointerMove:
|
|
73
|
+
/* @__PURE__ */ f("div", {
|
|
74
|
+
onPointerDown: ke,
|
|
75
|
+
onPointerMove: Ae,
|
|
74
76
|
onPointerUp: Z,
|
|
75
77
|
onPointerCancel: Z,
|
|
76
78
|
className: "relative w-full h-full scrollbar-hide overflow-hidden flex-1 touch-pan-y cursor-grab active:cursor-grabbing",
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
className: e("flex w-full h-full", !
|
|
79
|
-
style: { transform: `translate3d(calc(${-
|
|
80
|
-
children:
|
|
81
|
-
className: e("w-full h-full shrink-0 flex items-center justify-center scrollbar-hide overflow-hidden",
|
|
79
|
+
children: /* @__PURE__ */ f("div", {
|
|
80
|
+
className: e("flex w-full h-full", !W && !ge && !X && "transition-transform duration-300 ease-out"),
|
|
81
|
+
style: { transform: `translate3d(calc(${-V * 100}% + ${K}px), 0, 0)` },
|
|
82
|
+
children: R.map((t, n) => /* @__PURE__ */ f("div", {
|
|
83
|
+
className: e("w-full h-full shrink-0 flex items-center justify-center scrollbar-hide overflow-hidden", we, ve),
|
|
82
84
|
children: t.content
|
|
83
85
|
}, t.id || n))
|
|
84
86
|
})
|
|
85
87
|
}),
|
|
86
|
-
|
|
87
|
-
onClick: () =>
|
|
88
|
+
I && R.length > 1 && /* @__PURE__ */ p(ce, { children: [y ? y({
|
|
89
|
+
onClick: () => Y(-1),
|
|
88
90
|
disabled: Q
|
|
89
|
-
}) : /* @__PURE__ */
|
|
91
|
+
}) : /* @__PURE__ */ f("button", {
|
|
90
92
|
type: "button",
|
|
91
93
|
"aria-label": "Previous Slide",
|
|
92
94
|
disabled: Q,
|
|
93
|
-
onClick: () =>
|
|
94
|
-
className: e("absolute left-3 top-1/2 -translate-y-1/2 z-20 p-2.5 rounded-full bg-background/80 hover:bg-background text-foreground border border-border/50 backdrop-blur-md shadow-md transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-30 disabled:cursor-not-allowed",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
}),
|
|
97
|
-
onClick: () =>
|
|
95
|
+
onClick: () => Y(-1),
|
|
96
|
+
className: e("absolute left-3 top-1/2 -translate-y-1/2 z-20 p-2.5 rounded-full bg-background/80 hover:bg-background text-foreground border border-border/50 backdrop-blur-md shadow-md transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-30 disabled:cursor-not-allowed", x),
|
|
97
|
+
children: /* @__PURE__ */ f(ne, { className: "w-5 h-5" })
|
|
98
|
+
}), b ? b({
|
|
99
|
+
onClick: () => Y(1),
|
|
98
100
|
disabled: $
|
|
99
|
-
}) : /* @__PURE__ */
|
|
101
|
+
}) : /* @__PURE__ */ f("button", {
|
|
100
102
|
type: "button",
|
|
101
103
|
"aria-label": "Next Slide",
|
|
102
104
|
disabled: $,
|
|
103
|
-
onClick: () =>
|
|
104
|
-
className: e("absolute right-3 top-1/2 -translate-y-1/2 z-20 p-2.5 rounded-full bg-background/80 hover:bg-background text-foreground border border-border/50 backdrop-blur-md shadow-md transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-30 disabled:cursor-not-allowed",
|
|
105
|
-
children: /* @__PURE__ */
|
|
105
|
+
onClick: () => Y(1),
|
|
106
|
+
className: e("absolute right-3 top-1/2 -translate-y-1/2 z-20 p-2.5 rounded-full bg-background/80 hover:bg-background text-foreground border border-border/50 backdrop-blur-md shadow-md transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-30 disabled:cursor-not-allowed", x),
|
|
107
|
+
children: /* @__PURE__ */ f(te, { className: "w-5 h-5" })
|
|
106
108
|
})] }),
|
|
107
|
-
|
|
109
|
+
Se && R.length > 1 && /* @__PURE__ */ f("div", {
|
|
108
110
|
className: "absolute bottom-3 inset-x-0 z-20 flex justify-center items-center gap-1.5 pointer-events-none",
|
|
109
|
-
children: /* @__PURE__ */
|
|
110
|
-
className: "flex items-center gap-1.5 p-1.5 rounded-full bg-background/40 backdrop-blur-md pointer-events-auto border border-
|
|
111
|
-
children:
|
|
111
|
+
children: /* @__PURE__ */ f("div", {
|
|
112
|
+
className: "flex items-center gap-1.5 p-1.5 rounded-full bg-background/40 backdrop-blur-md pointer-events-auto border border-foreground/10",
|
|
113
|
+
children: R.map((t, n) => /* @__PURE__ */ f("button", {
|
|
112
114
|
type: "button",
|
|
113
115
|
"aria-label": `Go to slide ${n + 1}`,
|
|
114
|
-
onClick: () =>
|
|
115
|
-
className: e("h-2 rounded-full transition-all duration-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-primary", n ===
|
|
116
|
+
onClick: () => Oe(n),
|
|
117
|
+
className: e("h-2 rounded-full transition-all duration-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-primary", n === V ? "w-6 bg-primary" : "w-2 bg-foreground/40 hover:bg-foreground/70", ye)
|
|
116
118
|
}, t.id || n))
|
|
117
119
|
})
|
|
118
120
|
})
|
|
119
121
|
]
|
|
120
122
|
});
|
|
121
123
|
});
|
|
122
|
-
|
|
124
|
+
m.displayName = "Carousel";
|
|
123
125
|
//#endregion
|
|
124
|
-
export {
|
|
126
|
+
export { m as Carousel };
|
|
@@ -10,26 +10,7 @@ export declare const CAROUSEL_HEIGHT_CLASS: Record<Size, string>;
|
|
|
10
10
|
* Controls the internal padding of each slide.
|
|
11
11
|
*/
|
|
12
12
|
export declare const CAROUSEL_PADDING_CLASS: Record<Size, string>;
|
|
13
|
-
/**
|
|
14
|
-
import type { CarouselVariant } from "./carousel-config";
|
|
15
|
-
|
|
16
|
-
export const CAROUSEL_HEIGHT_CLASS: Record<Size, string> = {
|
|
17
|
-
sm: "h-60 md:h-80",
|
|
18
|
-
md: "h-80 md:h-[420px]",
|
|
19
|
-
lg: "h-[400px] md:h-[520px]",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const CAROUSEL_PADDING_CLASS: Record<Size, string> = {
|
|
23
|
-
sm: "p-4",
|
|
24
|
-
md: "p-6",
|
|
25
|
-
lg: "p-8",
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const CAROUSEL_VARIANT_CLASS: Record<CarouselVariant, string> = {
|
|
29
|
-
bordered: "bg-background border-2 border-border",
|
|
30
|
-
ghost: "bg-transparent",
|
|
31
|
-
};
|
|
32
|
-
|
|
13
|
+
/**
|
|
33
14
|
* CSS classes for carousel variants.
|
|
34
15
|
* Each variant has a distinct background and border treatment.
|
|
35
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-styles.d.ts","sourceRoot":"","sources":["../../../src/components/carousel/carousel-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAItD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIvD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"carousel-styles.d.ts","sourceRoot":"","sources":["../../../src/components/carousel/carousel-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAItD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAGlE,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { resolveVariantClass as n } from "../../shared/variant.js";
|
|
6
|
+
import { useAsheeConfig as r } from "../../libs/context.js";
|
|
7
7
|
import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
|
|
8
8
|
import { CloseIcon as s } from "../../icons/CloseIcon.js";
|
|
9
9
|
import { FALLBACK_CHIP_CONFIG as c } from "./chip-config.js";
|
|
@@ -12,7 +12,7 @@ import { forwardRef as m } from "react";
|
|
|
12
12
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/chip/Chip.tsx
|
|
14
14
|
var _ = m(({ variant: m, color: _, size: v, radius: y, isDisabled: b = !1, startIcon: x, endIcon: S, avatar: C, dot: w, onClose: T, closeIcon: E, children: D, className: O, style: k, onClick: A, ...j }, M) => {
|
|
15
|
-
let N =
|
|
15
|
+
let N = r(), P = N.components?.chip, F = i(m, P?.variant, N.defaultVariant, c.variant), I = F === "underlined" ? "bordered" : F, L = i(_, P?.color, N.defaultColor, c.color), R = i(v, P?.size, void 0, c.size), z = o(y, P?.radius, N.defaultRadius, c.radius), B = a(R, d, c.size), V = a(R, p, c.size), H = a(R, l, c.size), U = a(R, u, c.size), W = a(R, f, c.size), G = a(z, t, c.radius), K = (e) => {
|
|
16
16
|
e.stopPropagation(), !b && T?.(e);
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ g("div", {
|
|
@@ -44,7 +44,7 @@ var _ = m(({ variant: m, color: _, size: v, radius: y, isDisabled: b = !1, start
|
|
|
44
44
|
A?.(t);
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
className: e("inline-flex items-center font-medium transition-all duration-200 select-none shrink-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
47
|
+
className: e("inline-flex items-center font-medium transition-all duration-200 select-none shrink-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", n(I, L), B, V, H, U, G, b && "opacity-50 pointer-events-none cursor-not-allowed", A && !b && "cursor-pointer hover:opacity-90 active:scale-[0.98]", O),
|
|
48
48
|
style: k,
|
|
49
49
|
...j,
|
|
50
50
|
children: [
|
|
@@ -55,9 +55,13 @@ export interface DrawerProps extends BaseDrawerProps {
|
|
|
55
55
|
* the standard AsheeUI cascade: prop, component config, global theme
|
|
56
56
|
* defaults, and the built-in fallback.
|
|
57
57
|
*
|
|
58
|
-
* The
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* The drawer renders in a portal with dialog semantics and locks body scroll
|
|
59
|
+
* while it is open. Focus moves into the drawer, cannot leave it, and returns
|
|
60
|
+
* to the element that was focused before it opened. The dialog element is the
|
|
61
|
+
* container that receives the consumer's attributes, so a consumer names the
|
|
62
|
+
* drawer with the standard `aria-label` or `aria-labelledby` attribute.
|
|
63
|
+
* The component manages its own animation states to prevent transition
|
|
64
|
+
* flashes.
|
|
61
65
|
*
|
|
62
66
|
* @param props - Drawer configuration options and HTML div props.
|
|
63
67
|
* @param props.isOpen - Whether the drawer is open.
|
|
@@ -108,7 +112,7 @@ export interface DrawerProps extends BaseDrawerProps {
|
|
|
108
112
|
* onClose={onClose}
|
|
109
113
|
* placement="bottom"
|
|
110
114
|
* size="full"
|
|
111
|
-
* overlay={{ className: "bg-
|
|
115
|
+
* overlay={{ className: "bg-background/80" }}
|
|
112
116
|
* >
|
|
113
117
|
* <div className="p-6 max-h-[80vh] overflow-y-auto">
|
|
114
118
|
* {content}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/Drawer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAOf,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AASzB,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,eAAO,MAAM,MAAM,wGA4NlB,CAAC"}
|
|
@@ -4,52 +4,68 @@ import { cn as e } from "../../utils/cn.js";
|
|
|
4
4
|
import { ASHEE_GLOBAL_LAYER as t } from "../../utils/stacking.js";
|
|
5
5
|
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
6
|
import { resolveCascade as r, resolveClassKey as i } from "../../utils/resolve-token.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { useBodyScrollLock as a } from "../../libs/use-body-scroll-lock.js";
|
|
8
|
+
import { useDialogOverlay as o } from "../../libs/use-dialog-overlay.js";
|
|
9
|
+
import { FALLBACK_DRAWER_CONFIG as s } from "./drawer-config.js";
|
|
10
|
+
import { DRAWER_ANIMATION_STATE as c, DRAWER_BORDER_PLACEMENT_CLASS as l, DRAWER_CONTAINER_PLACEMENT_CLASS as u, DRAWER_HEIGHT_CLASS as d, DRAWER_WIDTH_CLASS as f } from "./drawer-styles.js";
|
|
11
|
+
import { forwardRef as p, useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
|
|
12
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
|
+
import { FloatingFocusManager as ee, FloatingPortal as b } from "@floating-ui/react";
|
|
11
14
|
//#region src/components/drawer/Drawer.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
if (
|
|
16
|
-
|
|
15
|
+
var x = p(({ isOpen: p, onClose: x, placement: S, size: te, animated: ne, closeOnOverlayClick: C, closeOnEsc: w, overlay: T, content: E, className: D, children: O, style: k, ...A }, j) => {
|
|
16
|
+
let M = n().components?.drawer, [N, P] = _(p ? "open" : "unmounted");
|
|
17
|
+
h(() => {
|
|
18
|
+
if (p) {
|
|
19
|
+
P("opening");
|
|
17
20
|
let e = requestAnimationFrame(() => {
|
|
18
|
-
|
|
21
|
+
P("open");
|
|
19
22
|
});
|
|
20
23
|
return () => cancelAnimationFrame(e);
|
|
21
24
|
}
|
|
22
|
-
if (
|
|
23
|
-
|
|
25
|
+
if (N !== "unmounted") {
|
|
26
|
+
P("closing");
|
|
24
27
|
let e = setTimeout(() => {
|
|
25
|
-
|
|
28
|
+
P("unmounted");
|
|
26
29
|
}, 250);
|
|
27
30
|
return () => clearTimeout(e);
|
|
28
31
|
}
|
|
29
|
-
}, [
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
}, [p]);
|
|
33
|
+
let { context: F, setDialogRef: I } = o(p), L = g(null), R = m((e) => {
|
|
34
|
+
L.current = e, I(e), typeof j == "function" ? j(e) : j && (j.current = e);
|
|
35
|
+
}, [j, I]);
|
|
36
|
+
a(p);
|
|
37
|
+
let z = r(te, M?.size, void 0, s.size), B = r(S, M?.placement, void 0, s.placement), V = r(C, M?.closeOnOverlayClick, void 0, s.closeOnOverlayClick), H = r(w, M?.closeOnEsc, void 0, s.closeOnEsc), U = r(ne, M?.animated, void 0, s.animated), W = T?.className ?? "bg-background/80 backdrop-blur-md", G = E?.className ?? "bg-secondary", K = B === "left" || B === "right", q = K ? i(z, f, s.size) : "w-full", J = K ? "h-full" : i(z, d, s.size), Y = u[B] ?? u.right, X = l[B] ?? l.right, Z = c[B], Q = N === "open" || N === "opening", re = U ? Q ? Z.open : Z.closed : "", ie = U ? Q ? "drawer-backdrop-in" : "drawer-backdrop-out" : "", $ = m((e) => {
|
|
38
|
+
H && e.key === "Escape" && x && x();
|
|
39
|
+
}, [H, x]);
|
|
40
|
+
return h(() => {
|
|
41
|
+
if (N !== "unmounted") return window.addEventListener("keydown", $), () => window.removeEventListener("keydown", $);
|
|
42
|
+
}, [N, $]), N === "unmounted" ? null : /* @__PURE__ */ v(b, { children: /* @__PURE__ */ v(ee, {
|
|
43
|
+
context: F,
|
|
44
|
+
modal: !0,
|
|
45
|
+
initialFocus: L,
|
|
46
|
+
returnFocus: !0,
|
|
47
|
+
closeOnFocusOut: !1,
|
|
48
|
+
children: /* @__PURE__ */ y("div", {
|
|
49
|
+
ref: R,
|
|
50
|
+
role: "dialog",
|
|
51
|
+
"aria-modal": "true",
|
|
52
|
+
tabIndex: -1,
|
|
53
|
+
className: e("fixed inset-0 flex w-full h-full outline-none", Y, D),
|
|
54
|
+
style: { zIndex: t.overlay },
|
|
55
|
+
...A,
|
|
56
|
+
children: [/* @__PURE__ */ v("div", {
|
|
57
|
+
"data-ashee-backdrop": "",
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
onClick: V ? x : void 0,
|
|
60
|
+
className: e("absolute inset-0", W, ie)
|
|
61
|
+
}), /* @__PURE__ */ v("div", {
|
|
62
|
+
style: k,
|
|
63
|
+
className: e("relative z-10 flex flex-col text-foreground shadow-2xl border-border", X, q, J, G, re),
|
|
64
|
+
children: O
|
|
65
|
+
})]
|
|
66
|
+
})
|
|
67
|
+
}) });
|
|
52
68
|
});
|
|
53
|
-
|
|
69
|
+
x.displayName = "Drawer";
|
|
54
70
|
//#endregion
|
|
55
|
-
export {
|
|
71
|
+
export { x as Drawer };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { InputProps } from '../input/Input';
|
|
3
|
-
import { MenuProps } from '../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { MenuProps } from '../menu/Menu';
|
|
4
|
+
import { MenuOption } from '../menu/menu-config';
|
|
5
|
+
import { DropmenuConfig } from './dropmenu-config';
|
|
6
6
|
/**
|
|
7
|
-
* Field-related props that
|
|
7
|
+
* Field-related props that Dropmenu inherits from Input.
|
|
8
8
|
* Picked to avoid conflicts with Button-specific props.
|
|
9
9
|
*/
|
|
10
10
|
type SelectFieldProps = Pick<InputProps, "label" | "description" | "message" | "required" | "isLoading" | "status" | "labelAlign" | "className" | "id" | "style">;
|
|
11
11
|
/**
|
|
12
|
-
* Configuration options for the
|
|
13
|
-
* Extends field props from Input, and
|
|
12
|
+
* Configuration options for the Dropmenu component.
|
|
13
|
+
* Extends field props from Input, and DropmenuConfig for
|
|
14
14
|
* component-specific options. Uses Button for trigger styling.
|
|
15
15
|
*/
|
|
16
|
-
export interface
|
|
16
|
+
export interface DropmenuProps extends SelectFieldProps, Omit<DropmenuConfig, "menu"> {
|
|
17
17
|
/**
|
|
18
18
|
* Available options to select from.
|
|
19
19
|
* Each option must have a label and a unique value.
|
|
20
20
|
*/
|
|
21
|
-
options:
|
|
21
|
+
options: MenuOption[];
|
|
22
22
|
/**
|
|
23
23
|
* Controlled selected value.
|
|
24
24
|
*/
|
|
@@ -63,7 +63,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
63
63
|
/**
|
|
64
64
|
* Placeholder text shown when no value is selected.
|
|
65
65
|
*
|
|
66
|
-
* @default "
|
|
66
|
+
* @default "Dropmenu..."
|
|
67
67
|
*/
|
|
68
68
|
placeholder?: string;
|
|
69
69
|
/**
|
|
@@ -95,7 +95,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
95
95
|
/**
|
|
96
96
|
* A dropdown selector with search, label, validation, and configurable styles.
|
|
97
97
|
*
|
|
98
|
-
*
|
|
98
|
+
* Dropmenu renders a dropdown that allows selecting a single option from a list.
|
|
99
99
|
* It supports search filtering, controlled and uncontrolled selection state,
|
|
100
100
|
* validation states, custom menu and trigger styles, and start/end content
|
|
101
101
|
* slots. Visual tokens resolve through the standard AsheeUI cascade system.
|
|
@@ -108,10 +108,10 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
108
108
|
* By default, the dropdown menu uses Floating UI's FloatingPortal to render
|
|
109
109
|
* at the document body level. This ensures the menu escapes CSS containment,
|
|
110
110
|
* overflow clipping, and stacking context issues. The portal can be disabled
|
|
111
|
-
* via the `menu.portal` prop or `components.
|
|
111
|
+
* via the `menu.portal` prop or `components.dropmenu.menu.portal` in the config
|
|
112
112
|
* if the menu needs to stay within a specific parent container.
|
|
113
113
|
*
|
|
114
|
-
* @param props -
|
|
114
|
+
* @param props - Dropmenu configuration options.
|
|
115
115
|
* @param props.options - Available options to select from.
|
|
116
116
|
* @param props.value - Controlled selected value.
|
|
117
117
|
* @param props.onChange - Native change event handler.
|
|
@@ -127,7 +127,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
127
127
|
* @param props.searchInputName - Name attribute for the search input. Defaults to "select-search".
|
|
128
128
|
* @param props.initialValue - Initial value for uncontrolled usage.
|
|
129
129
|
* @param props.belowList - Content below the options list.
|
|
130
|
-
* @param props.placeholder - Placeholder text. Defaults to "
|
|
130
|
+
* @param props.placeholder - Placeholder text. Defaults to "Dropmenu...".
|
|
131
131
|
* @param props.size - Size of the trigger. Defaults to "md".
|
|
132
132
|
* @param props.radius - Corner rounding. Defaults to "md".
|
|
133
133
|
* @param props.variant - Visual style variant. Defaults to "bordered".
|
|
@@ -143,7 +143,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
143
143
|
*
|
|
144
144
|
* @example
|
|
145
145
|
* ```tsx
|
|
146
|
-
* import {
|
|
146
|
+
* import { Dropmenu } from "asheeui";
|
|
147
147
|
* import { useState } from "react";
|
|
148
148
|
*
|
|
149
149
|
* export function Example() {
|
|
@@ -156,11 +156,11 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
156
156
|
* ];
|
|
157
157
|
*
|
|
158
158
|
* return (
|
|
159
|
-
* <
|
|
159
|
+
* <Dropmenu
|
|
160
160
|
* options={options}
|
|
161
161
|
* value={value}
|
|
162
162
|
* onValueChange={setValue}
|
|
163
|
-
* label="
|
|
163
|
+
* label="Dropmenu Framework"
|
|
164
164
|
* placeholder="Choose a framework..."
|
|
165
165
|
* />
|
|
166
166
|
* );
|
|
@@ -170,7 +170,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
170
170
|
* @example
|
|
171
171
|
* ```tsx
|
|
172
172
|
* // With search, validation, and menu configuration
|
|
173
|
-
* <
|
|
173
|
+
* <Dropmenu
|
|
174
174
|
* options={fruits}
|
|
175
175
|
* label="Favorite Fruit"
|
|
176
176
|
* isSearch
|
|
@@ -187,12 +187,12 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
187
187
|
* />
|
|
188
188
|
* ```
|
|
189
189
|
*
|
|
190
|
-
* @see
|
|
190
|
+
* @see DropmenuConfig - The configuration type for component defaults.
|
|
191
191
|
* @see Input - The input component that provides field capabilities.
|
|
192
192
|
* @see Button - The button component used as the trigger.
|
|
193
|
-
* @see
|
|
193
|
+
* @see Menu - The dropdown menu component.
|
|
194
194
|
* @see FieldShell - The wrapper component for label and validation.
|
|
195
195
|
*/
|
|
196
|
-
export declare const
|
|
196
|
+
export declare const Dropmenu: import('react').ForwardRefExoticComponent<DropmenuProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
197
197
|
export {};
|
|
198
|
-
//# sourceMappingURL=
|
|
198
|
+
//# sourceMappingURL=Dropmenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"Dropmenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropmenu/Dropmenu.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,EAAQ,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKhF;;;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,aACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,OAAO,EAAE,UAAU,EAAE,CAAC;IAEtB;;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,QAAQ,6GA8QpB,CAAC"}
|