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
|
@@ -83,8 +83,8 @@ export interface ResizableScreenProps extends BaseResizableScreenProps {
|
|
|
83
83
|
* maxSize={70}
|
|
84
84
|
* orientation="horizontal"
|
|
85
85
|
* >
|
|
86
|
-
* <div className="bg-
|
|
87
|
-
* <div className="bg-
|
|
86
|
+
* <div className="bg-primary/10 p-4">Left Panel</div>
|
|
87
|
+
* <div className="bg-success/10 p-4">Right Panel</div>
|
|
88
88
|
* </ResizableScreen>
|
|
89
89
|
* );
|
|
90
90
|
* }
|
|
@@ -102,8 +102,8 @@ export interface ResizableScreenProps extends BaseResizableScreenProps {
|
|
|
102
102
|
* minSize={25}
|
|
103
103
|
* maxSize={75}
|
|
104
104
|
* >
|
|
105
|
-
* <div className="bg-
|
|
106
|
-
* <div className="bg-
|
|
105
|
+
* <div className="bg-danger/10 p-4">Top Panel</div>
|
|
106
|
+
* <div className="bg-primary/10 p-4">Bottom Panel</div>
|
|
107
107
|
* </ResizableScreen>
|
|
108
108
|
* ```
|
|
109
109
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./scrollbar-config.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/scrollbar/scrollbar-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
width: "10px",
|
|
6
|
+
radius: "9999px",
|
|
7
|
+
thumbBorder: "3px",
|
|
8
|
+
gutter: "stable",
|
|
9
|
+
fallbackWidth: "thin"
|
|
10
|
+
};
|
|
11
|
+
e("scrollbar", t);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as defaultScrollbarConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/Sidebar.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,kBAAkB,CAAC;AAqB1B,KAAK,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GACpD,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,gBAAgB;IAChE;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE1C;;;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,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,MAAM,EACN,OAAO,EACP,kBAAkB,EAAE,sBAAsB,EAC1C,WAAW,EAAE,eAAe,EAC5B,gBAAgB,EAAE,oBAAoB,EACtC,OAAO,EACP,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,WAAW,EACX,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,YAAY,CAAC,CAAC,CAAC,+BA+ZjB;yBA3be,OAAO"}
|
|
@@ -1,149 +1,151 @@
|
|
|
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 { Button as s } from "../button/Button.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ArrowLeftIcon as
|
|
12
|
-
import { Tooltip as
|
|
9
|
+
import { ChevronRightIcon as c } from "../../icons/ChevronRightIcon.js";
|
|
10
|
+
import { ChevronLeftIcon as ee } from "../../icons/ChevronLeftIcon.js";
|
|
11
|
+
import { ArrowLeftIcon as l } from "../../icons/ArrowLeftIcon.js";
|
|
12
|
+
import { Tooltip as u } from "../tooltip/Tooltip.js";
|
|
13
13
|
import { FALLBACK_SIDEBAR_CONFIG as d } from "./sidebar-config.js";
|
|
14
|
-
import { SIDEBAR_COLLAPSED_WIDTH_CLASS as te, SIDEBAR_EXPANDED_WIDTH_CLASS as ne, SIDEBAR_HEADER_CLASS as
|
|
15
|
-
import { useCallback as
|
|
16
|
-
import { Fragment as
|
|
14
|
+
import { SIDEBAR_COLLAPSED_WIDTH_CLASS as te, SIDEBAR_EXPANDED_WIDTH_CLASS as ne, SIDEBAR_HEADER_CLASS as re, SIDEBAR_ITEM_CLASS as ie, SIDEBAR_SECTION_LABEL_CLASS as ae, SIDEBAR_VARIANT_CLASS as oe } from "./sidebar-styles.js";
|
|
15
|
+
import { useCallback as f, useEffect as p, useMemo as m, useState as se } from "react";
|
|
16
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/sidebar/Sidebar.tsx
|
|
18
|
-
function
|
|
18
|
+
function v(e) {
|
|
19
19
|
return "items" in e && Array.isArray(e.items);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
let
|
|
27
|
-
if (!
|
|
28
|
-
let e = !
|
|
29
|
-
|
|
21
|
+
function y({ items: y, activeKey: ce, onSelect: b, isCollapsed: x, onCollapseChange: S, title: C, onBack: w, backIcon: le, userRole: T, footer: E, variant: ue, size: de, radius: fe, options: D, showCollapseButton: O, collapsible: k, defaultCollapsed: A, tooltip: j, headerClassName: M, bodyClassName: N, sectionLabelClassName: P, footerClassName: F, anchorProps: I, link: L, className: R, style: z, ...B }) {
|
|
22
|
+
let V = r(), H = V.components?.sidebar, U = i(k, H?.collapsible, void 0, d.collapsible), W = i(O, H?.showCollapseButton, void 0, d.showCollapseButton), pe = i(A, H?.defaultCollapsed, void 0, d.defaultCollapsed), [me, G] = se(x ?? pe);
|
|
23
|
+
p(() => {
|
|
24
|
+
x !== void 0 && G(x);
|
|
25
|
+
}, [x]);
|
|
26
|
+
let K = x ?? me, he = f(() => {
|
|
27
|
+
if (!U) return;
|
|
28
|
+
let e = !K;
|
|
29
|
+
x === void 0 && G(e), S?.(e);
|
|
30
30
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
K,
|
|
32
|
+
x,
|
|
33
|
+
S,
|
|
34
|
+
U
|
|
35
|
+
]), q = i(de, H?.size, void 0, d.size), ge = i(ue, H?.variant, void 0, d.variant), J = (e) => e === "full" ? "xl" : e, _e = o(J(fe), J(H?.radius), V.defaultRadius, d.radius), Y = o(J(D?.radius), J(H?.options?.radius), V.defaultRadius, d.options.radius), X = i(D?.inactive?.variant, H?.options?.inactive?.variant, V.defaultVariant, d.options.inactive.variant), ve = i(D?.inactive?.color, H?.options?.inactive?.color, void 0, d.options.inactive.color), ye = i(D?.active?.variant, H?.options?.active?.variant, V.defaultVariant, d.options.active.variant), be = i(D?.active?.color, H?.options?.active?.color, V.defaultColor, d.options.active.color), xe = n(ye, be), Se = n(X, ve), Ce = i(j?.show, H?.tooltip?.show, void 0, d.tooltip.show), we = i(j?.placement, H?.tooltip?.placement, void 0, d.tooltip.placement), Z = i(j?.variant, H?.tooltip?.variant, void 0, d.tooltip.variant), Te = i(j?.color, H?.tooltip?.color, void 0, d.tooltip.color), Q = y, $ = m(() => {
|
|
35
36
|
if (!Q) return [];
|
|
36
37
|
let e = Q[0];
|
|
37
|
-
return e ?
|
|
38
|
+
return e ? v(e) ? Q : [{
|
|
38
39
|
id: "__root",
|
|
39
40
|
label: void 0,
|
|
40
41
|
items: Q
|
|
41
42
|
}] : [];
|
|
42
|
-
}, [Q]), Ee =
|
|
43
|
+
}, [Q]), Ee = m(() => $.filter((e) => !e.roles || e.roles.length === 0 ? !0 : T ? e.roles.includes(T) : !1).map((e) => ({
|
|
43
44
|
...e,
|
|
44
|
-
items: e.items?.filter((e) => !e.roles || e.roles.length === 0 ? !0 :
|
|
45
|
-
})).filter((e) => e.items && e.items.length > 0), [$,
|
|
45
|
+
items: e.items?.filter((e) => !e.roles || e.roles.length === 0 ? !0 : T ? e.roles.includes(T) : !1)
|
|
46
|
+
})).filter((e) => e.items && e.items.length > 0), [$, T]), De = f((e, t) => {
|
|
46
47
|
if (t.disabled) {
|
|
47
48
|
e.preventDefault();
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
let r =
|
|
53
|
-
href:
|
|
54
|
-
target:
|
|
55
|
-
rel:
|
|
56
|
-
|
|
51
|
+
b?.(t);
|
|
52
|
+
}, [b]), Oe = K ? te[q] : ne[q], ke = (n) => {
|
|
53
|
+
let r = n.id === ce, i = e("w-full flex items-center gap-3 transition-all truncate no-underline", ie[q], K ? "justify-center px-0" : "justify-start", r && "font-medium", r ? xe : Se, n.disabled && "opacity-50 cursor-not-allowed pointer-events-none", a(X === "underlined" ? "none" : Y, t, d.options.radius), D?.itemClassName), o = L?.component || "a", s = {
|
|
54
|
+
href: n.disabled ? void 0 : n.href,
|
|
55
|
+
target: n.target,
|
|
56
|
+
rel: n.rel,
|
|
57
|
+
"aria-current": r ? "page" : void 0,
|
|
58
|
+
onClick: (e) => De(e, n),
|
|
57
59
|
className: i,
|
|
58
|
-
...
|
|
59
|
-
...
|
|
60
|
-
}, c = /* @__PURE__ */
|
|
60
|
+
...I,
|
|
61
|
+
...L?.props ?? {}
|
|
62
|
+
}, c = /* @__PURE__ */ _(o, {
|
|
61
63
|
...s,
|
|
62
|
-
children: [
|
|
63
|
-
className: e("shrink-0 flex items-center justify-center",
|
|
64
|
-
children:
|
|
65
|
-
}), !
|
|
64
|
+
children: [n.icon && /* @__PURE__ */ g("span", {
|
|
65
|
+
className: e("shrink-0 flex items-center justify-center", K && "w-full"),
|
|
66
|
+
children: n.icon
|
|
67
|
+
}), !K && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
|
|
66
68
|
className: "truncate flex-1 text-left",
|
|
67
|
-
children:
|
|
68
|
-
}),
|
|
69
|
+
children: n.label
|
|
70
|
+
}), n.badge && /* @__PURE__ */ g("span", {
|
|
69
71
|
className: "shrink-0",
|
|
70
|
-
children:
|
|
72
|
+
children: n.badge
|
|
71
73
|
})] })]
|
|
72
|
-
}, String(
|
|
73
|
-
return
|
|
74
|
-
content:
|
|
75
|
-
placement:
|
|
76
|
-
variant:
|
|
74
|
+
}, String(n.id));
|
|
75
|
+
return K && Ce ? /* @__PURE__ */ g(u, {
|
|
76
|
+
content: n.label,
|
|
77
|
+
placement: we,
|
|
78
|
+
variant: Z,
|
|
77
79
|
color: Te,
|
|
78
|
-
radius:
|
|
80
|
+
radius: Y,
|
|
79
81
|
children: c
|
|
80
|
-
}, String(
|
|
81
|
-
}, Ae = (t) => !t.items || t.items.length === 0 ? null : /* @__PURE__ */
|
|
82
|
+
}, String(n.id)) : c;
|
|
83
|
+
}, Ae = (t) => !t.items || t.items.length === 0 ? null : /* @__PURE__ */ _("div", {
|
|
82
84
|
className: "flex flex-col gap-0.5",
|
|
83
|
-
children: [!
|
|
84
|
-
className: e("text-foreground/70 font-medium uppercase tracking-wider truncate",
|
|
85
|
+
children: [!K && t.label && /* @__PURE__ */ g("div", {
|
|
86
|
+
className: e("text-foreground/70 font-medium uppercase tracking-wider truncate", ae[q], P),
|
|
85
87
|
children: t.label
|
|
86
88
|
}), t.items.map(ke)]
|
|
87
89
|
}, String(t.id));
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
className: e("h-full flex flex-col transition-all duration-200 select-none shrink-0", Oe,
|
|
90
|
-
style:
|
|
91
|
-
...
|
|
90
|
+
return /* @__PURE__ */ _("aside", {
|
|
91
|
+
className: e("h-full flex flex-col transition-all duration-200 select-none shrink-0", Oe, oe[ge], a(_e, t, d.radius), R),
|
|
92
|
+
style: z,
|
|
93
|
+
...B,
|
|
92
94
|
children: [
|
|
93
|
-
(
|
|
94
|
-
className: e("flex items-center gap-3 border-b border-border border-dashed shrink-0",
|
|
95
|
-
children: [
|
|
95
|
+
(w || C) && /* @__PURE__ */ _("div", {
|
|
96
|
+
className: e("flex items-center gap-3 border-b border-border border-dashed shrink-0", re[q], K && "justify-center px-0", M),
|
|
97
|
+
children: [w && /* @__PURE__ */ g(s, {
|
|
96
98
|
icon: !0,
|
|
97
99
|
"aria-label": "Go back",
|
|
98
|
-
variant:
|
|
100
|
+
variant: X,
|
|
99
101
|
color: "secondary",
|
|
100
|
-
size:
|
|
101
|
-
radius:
|
|
102
|
-
onClick:
|
|
102
|
+
size: q,
|
|
103
|
+
radius: Y,
|
|
104
|
+
onClick: w,
|
|
103
105
|
className: "shrink-0",
|
|
104
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ g("span", {
|
|
105
107
|
className: e("flex items-center justify-center transition-transform duration-200"),
|
|
106
|
-
children:
|
|
108
|
+
children: le ?? /* @__PURE__ */ g(l, { className: "size-4" })
|
|
107
109
|
})
|
|
108
|
-
}), !
|
|
110
|
+
}), !K && C && /* @__PURE__ */ g("span", {
|
|
109
111
|
className: "font-semibold text-foreground truncate tracking-tight transition-opacity duration-200",
|
|
110
|
-
children:
|
|
112
|
+
children: C
|
|
111
113
|
})]
|
|
112
114
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
className: e("flex-1 overflow-y-auto py-3 px-2 flex flex-col gap-3 scrollable-hidden",
|
|
115
|
+
/* @__PURE__ */ g("nav", {
|
|
116
|
+
className: e("flex-1 overflow-y-auto py-3 px-2 flex flex-col gap-3 scrollable-hidden", N),
|
|
115
117
|
children: Ee.map(Ae)
|
|
116
118
|
}),
|
|
117
|
-
|
|
118
|
-
className: e("border-t border-border shrink-0",
|
|
119
|
-
children: [!
|
|
119
|
+
W && U && /* @__PURE__ */ _("div", {
|
|
120
|
+
className: e("border-t border-border shrink-0", K ? "p-2" : "p-3", F),
|
|
121
|
+
children: [!K && E && /* @__PURE__ */ g("div", {
|
|
120
122
|
className: "mb-2",
|
|
121
|
-
children:
|
|
122
|
-
}), /* @__PURE__ */
|
|
123
|
+
children: E
|
|
124
|
+
}), /* @__PURE__ */ g(s, {
|
|
123
125
|
icon: !0,
|
|
124
|
-
"aria-label":
|
|
125
|
-
variant:
|
|
126
|
+
"aria-label": K ? "Expand sidebar" : "Collapse sidebar",
|
|
127
|
+
variant: X,
|
|
126
128
|
color: "secondary",
|
|
127
|
-
size:
|
|
128
|
-
radius:
|
|
129
|
-
onClick:
|
|
130
|
-
className: e("w-full",
|
|
131
|
-
children: /* @__PURE__ */
|
|
129
|
+
size: q,
|
|
130
|
+
radius: Y,
|
|
131
|
+
onClick: he,
|
|
132
|
+
className: e("w-full", K ? "justify-center px-0" : "justify-start"),
|
|
133
|
+
children: /* @__PURE__ */ g("span", {
|
|
132
134
|
className: "flex items-center gap-2",
|
|
133
|
-
children:
|
|
135
|
+
children: K ? /* @__PURE__ */ g(c, { className: "size-4" }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ee, { className: "size-4" }), /* @__PURE__ */ g("span", {
|
|
134
136
|
className: "text-sm",
|
|
135
137
|
children: "Collapse"
|
|
136
138
|
})] })
|
|
137
139
|
})
|
|
138
140
|
})]
|
|
139
141
|
}),
|
|
140
|
-
!
|
|
141
|
-
className: e("border-t border-border shrink-0 p-3",
|
|
142
|
-
children:
|
|
142
|
+
!W && E && /* @__PURE__ */ g("div", {
|
|
143
|
+
className: e("border-t border-border shrink-0 p-3", F),
|
|
144
|
+
children: E
|
|
143
145
|
})
|
|
144
146
|
]
|
|
145
147
|
});
|
|
146
148
|
}
|
|
147
|
-
|
|
149
|
+
y.displayName = "Sidebar";
|
|
148
150
|
//#endregion
|
|
149
|
-
export {
|
|
151
|
+
export { y as Sidebar };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { SkeletonConfig } from './skeleton-config';
|
|
3
|
+
type BaseSkeletonProps = SkeletonConfig & Omit<HTMLAttributes<HTMLDivElement>, "color" | "children">;
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the Skeleton component.
|
|
6
|
+
*/
|
|
7
|
+
export interface SkeletonProps extends BaseSkeletonProps {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the placeholder stands in for a region that is loading rather than
|
|
10
|
+
* appear as decoration.
|
|
11
|
+
*
|
|
12
|
+
* When true the placeholder becomes a labelled busy status, so assistive
|
|
13
|
+
* technology is told that loading is in progress. When false it is hidden
|
|
14
|
+
* from assistive technology, because a placeholder carries no information.
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isBusy?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Text announced while the placeholder is a busy status.
|
|
21
|
+
*
|
|
22
|
+
* @default "Loading"
|
|
23
|
+
*/
|
|
24
|
+
label?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A loading placeholder.
|
|
28
|
+
*
|
|
29
|
+
* Skeleton renders a neutral surface that stands in for content while it
|
|
30
|
+
* loads. Size it with the standard layout classes, because it has no size axis
|
|
31
|
+
* of its own: `className="h-40 w-full"` is the intended usage.
|
|
32
|
+
*
|
|
33
|
+
* Two accessibility contracts hold here. A decorative placeholder is hidden
|
|
34
|
+
* from assistive technology, because it conveys nothing on its own. A
|
|
35
|
+
* placeholder marked as busy is exposed as a labelled status instead, so a
|
|
36
|
+
* consumer who needs the state announced gets it. Neither replaces a status
|
|
37
|
+
* announcement for a wait the consumer knows will be long: use the framework's
|
|
38
|
+
* notification or a status region for that.
|
|
39
|
+
*
|
|
40
|
+
* The shimmer is applied through the reduced-motion-safe variant, so it stops
|
|
41
|
+
* for a consumer who asked for less motion without any script running.
|
|
42
|
+
*
|
|
43
|
+
* @param props - Skeleton configuration options and div attributes.
|
|
44
|
+
* @param props.isBusy - Expose the placeholder as a labelled busy status. Defaults to false.
|
|
45
|
+
* @param props.label - Text announced while busy. Defaults to "Loading".
|
|
46
|
+
* @param props.radius - Corner rounding. Defaults to "sm".
|
|
47
|
+
* @param props.isAnimated - Whether the placeholder shimmers. Defaults to true.
|
|
48
|
+
* @param props.className - Extra classes applied last, which is where sizing belongs.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <Skeleton className="h-4 w-40" />
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // The region is loading and the state should be announced.
|
|
58
|
+
* <Skeleton isBusy label="Loading invoices" className="h-4 w-full" />
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @see SkeletonConfig - The configuration type for component defaults.
|
|
62
|
+
*/
|
|
63
|
+
export declare const Skeleton: import('react').ForwardRefExoticComponent<SkeletonProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/Skeleton.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAMxD,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAM3B,KAAK,iBAAiB,GAAG,cAAc,GACrC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,QAAQ,0GAsDpB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.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 } from "../../utils/resolve-token.js";
|
|
7
|
+
import { FALLBACK_SKELETON_CONFIG as a } from "./skeleton-config.js";
|
|
8
|
+
import { SKELETON_BASE_CLASS as o } from "./skeleton-styles.js";
|
|
9
|
+
import { forwardRef as s } from "react";
|
|
10
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/skeleton/Skeleton.tsx
|
|
12
|
+
var l = s(({ radius: s, isAnimated: l, isBusy: u = !1, label: d = "Loading", className: f, ...p }, m) => {
|
|
13
|
+
let h = n(), g = h.components?.skeleton, _ = r(s, g?.radius, h.defaultRadius, a.radius), v = r(l, g?.isAnimated, void 0, a.isAnimated), y = i(_, t, a.radius);
|
|
14
|
+
return /* @__PURE__ */ c("div", {
|
|
15
|
+
ref: m,
|
|
16
|
+
role: u ? "status" : void 0,
|
|
17
|
+
"aria-busy": u ? !0 : void 0,
|
|
18
|
+
"aria-hidden": !u || void 0,
|
|
19
|
+
className: e(o, v && "motion-safe:animate-pulse", y, f),
|
|
20
|
+
...p,
|
|
21
|
+
children: u && /* @__PURE__ */ c("span", {
|
|
22
|
+
className: "sr-only",
|
|
23
|
+
children: d
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
l.displayName = "Skeleton";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { l as Skeleton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Radius } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the Skeleton component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.skeleton` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level fallback tier of the theme cascade.
|
|
7
|
+
*/
|
|
8
|
+
export interface SkeletonConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Corner rounding.
|
|
11
|
+
* Controls the border-radius of the placeholder.
|
|
12
|
+
*
|
|
13
|
+
* @default "sm"
|
|
14
|
+
*/
|
|
15
|
+
radius?: Radius;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the placeholder shimmers while it is visible.
|
|
18
|
+
* When true the animation is applied through a reduced-motion-safe class, so
|
|
19
|
+
* a consumer who asked for less motion sees a static placeholder.
|
|
20
|
+
*
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
isAnimated?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Default config values registered for the Skeleton component.
|
|
27
|
+
*/
|
|
28
|
+
export declare const defaultSkeletonConfig: SkeletonConfig;
|
|
29
|
+
/**
|
|
30
|
+
* Hard fallback values used when no config tier provides a value.
|
|
31
|
+
* These values are used when instance props, component config,
|
|
32
|
+
* and global defaults are all undefined.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FALLBACK_SKELETON_CONFIG: Required<SkeletonConfig>;
|
|
35
|
+
declare module "../../libs/registry" {
|
|
36
|
+
interface ComponentTypeConfigRegistry {
|
|
37
|
+
skeleton: SkeletonConfig;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=skeleton-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-config.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAGnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,cAAc,CAGpD,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/skeleton/skeleton-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
radius: "sm",
|
|
6
|
+
isAnimated: !0
|
|
7
|
+
}, n = {
|
|
8
|
+
radius: "sm",
|
|
9
|
+
isAnimated: !0
|
|
10
|
+
};
|
|
11
|
+
e("skeleton", t);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as FALLBACK_SKELETON_CONFIG, t as defaultSkeletonConfig };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton component styles for AsheeUI.
|
|
3
|
+
* This file provides the static classes the Skeleton component is built from.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base classes for the placeholder surface.
|
|
7
|
+
* The surface colour resolves through the theme's secondary token, so the
|
|
8
|
+
* placeholder follows the active theme.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SKELETON_BASE_CLASS = "block h-4 w-full bg-secondary/60 select-none pointer-events-none";
|
|
11
|
+
/**
|
|
12
|
+
* The shimmer.
|
|
13
|
+
*
|
|
14
|
+
* It is applied through the `motion-safe` variant rather than from a script, so
|
|
15
|
+
* a consumer who asked for reduced motion sees a static placeholder and the
|
|
16
|
+
* media query decides before hydration.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SKELETON_ANIMATION_CLASS = "motion-safe:animate-pulse";
|
|
19
|
+
//# sourceMappingURL=skeleton-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-styles.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton-styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qEACoC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,mBAAmB,EAIzB,MAAM,OAAO,CAAC;AAWf,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAS5E,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GACjD,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAC3C,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC7E;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,mBAAmB,EAIzB,MAAM,OAAO,CAAC;AAWf,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAS5E,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GACjD,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAC3C,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC7E;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,MAAM,0GA4KlB,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 { FieldShell as s } from "../field/FieldShell.js";
|
|
9
9
|
import { FALLBACK_SWITCH_CONFIG as c } from "./switch-config.js";
|
|
@@ -12,7 +12,7 @@ import { forwardRef as f, useCallback as p, useId as m, useState as h } from "re
|
|
|
12
12
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/switch/Switch.tsx
|
|
14
14
|
var v = f(({ size: f, color: v, radius: y, label: b, labelAlign: x, description: S, required: C, isLoading: w, id: T, className: E, style: D, disabled: O, checked: k, defaultChecked: A = !1, onChange: j, ...M }, N) => {
|
|
15
|
-
let P =
|
|
15
|
+
let P = r(), F = P.components?.switch, I = m(), L = T ?? I, [R, z] = h(A), B = k ?? R, V = i(f, F?.size, void 0, c.size), H = i(v, F?.color, P.defaultColor, c.color), U = o(y, F?.radius, void 0, c.radius), W = i(x, F?.labelAlign, void 0, c.labelAlign), G = a(V, d, c.size), K = a(V, l, c.size), q = a(V, u, c.size), J = a(U, t, c.radius), Y = n("solid", H), X = O || w, Z = S ? `${L}-description` : void 0, Q = p((e) => {
|
|
16
16
|
if (X) return;
|
|
17
17
|
let t = e.target.checked;
|
|
18
18
|
k === void 0 && z(t), j?.(t, e);
|
|
@@ -26,6 +26,7 @@ var v = f(({ size: f, color: v, radius: y, label: b, labelAlign: x, description:
|
|
|
26
26
|
label: b,
|
|
27
27
|
labelAlign: W,
|
|
28
28
|
description: S,
|
|
29
|
+
descriptionId: Z,
|
|
29
30
|
required: C,
|
|
30
31
|
isLoading: w,
|
|
31
32
|
children: /* @__PURE__ */ g("label", {
|
|
@@ -44,7 +45,8 @@ var v = f(({ size: f, color: v, radius: y, label: b, labelAlign: x, description:
|
|
|
44
45
|
required: C,
|
|
45
46
|
"aria-checked": B,
|
|
46
47
|
"aria-busy": w,
|
|
47
|
-
|
|
48
|
+
"aria-describedby": Z,
|
|
49
|
+
onChange: Q,
|
|
48
50
|
className: "sr-only peer",
|
|
49
51
|
...M
|
|
50
52
|
}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
6
|
import { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as a } from "../../utils/resolve-token.js";
|
|
7
7
|
import { FALLBACK_TABLE_CONFIG as o } from "./table-config.js";
|
|
8
8
|
import { TABLE_CELL_PADDING_X_CLASS as s, TABLE_CELL_PADDING_Y_CLASS as c, TABLE_COLOR_STYLES as l, TABLE_FONT_CLASS as u, TABLE_HEADER_FONT_CLASS as d } from "./table-styles.js";
|
|
@@ -10,7 +10,7 @@ import { useCallback as f } from "react";
|
|
|
10
10
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/table/Table.tsx
|
|
12
12
|
function h({ data: h = [], columns: g = [], gridClasses: _, rowKeyAccessor: v, handleClick: y, handleDoubleClick: b, selectedRowKey: x, emptyMessage: S = "No items available", isClickable: C, variant: w, color: T, size: E, radius: D, headerClassName: O, rowClassName: k, cellClassName: A, className: j, style: M, ...N }) {
|
|
13
|
-
let P =
|
|
13
|
+
let P = n(), F = P.components?.table, I = r(E, F?.size, void 0, o.size), L = r(w, F?.variant, void 0, o.variant), R = r(T, F?.color, P.defaultColor, o.color), z = (e) => e === "full" ? "xl" : e, B = a(z(D), z(F?.radius), P.defaultRadius, o.radius), V = i(I, c, o.size), H = i(I, s, o.size), U = i(I, u, o.size), W = i(I, d, o.size), G = i(B, t, o.radius), K = l[R] ?? l.primary, q = f((e, t) => {
|
|
14
14
|
if (v) try {
|
|
15
15
|
return v(e);
|
|
16
16
|
} catch {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
6
|
import { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as a } from "../../utils/resolve-token.js";
|
|
7
7
|
import { Button as o } from "../button/Button.js";
|
|
8
8
|
import { FALLBACK_TABS_CONFIG as s } from "./tabs-config.js";
|
|
@@ -11,7 +11,7 @@ import { forwardRef as d, useCallback as f, useId as p, useMemo as m, useRef as
|
|
|
11
11
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/tabs/Tabs.tsx
|
|
13
13
|
var y = d(({ tabs: d = [], activeId: y, defaultActiveId: b, onChange: x, variant: S, size: C, radius: w, options: T, fullWidth: ee = !1, tabListClassName: te, tabPanelClassName: E, className: D, style: O, ...k }, A) => {
|
|
14
|
-
let j =
|
|
14
|
+
let j = n(), M = j.components?.tabs, N = p(), P = h(/* @__PURE__ */ new Map()), [F, I] = g(() => b ?? d[0]?.id), L = y !== void 0, R = L ? y : F, z = r(C, M?.size, void 0, s.size), B = r(S, M?.variant, void 0, s.variant), V = r(T?.active?.variant, M?.options?.active?.variant, j.defaultVariant, s.options.active.variant), H = r(T?.active?.color, M?.options?.active?.color, j.defaultColor, s.options.active.color), U = r(T?.inactive?.variant, M?.options?.inactive?.variant, void 0, s.options.inactive.variant), W = r(T?.inactive?.color, M?.options?.inactive?.color, void 0, s.options.inactive.color), G = a(w, M?.radius, j.defaultRadius, s.radius), K = a(T?.active?.radius, M?.options?.active?.radius, j.defaultRadius, s.options.active.radius), q = a(T?.inactive?.radius, M?.options?.inactive?.radius, G, s.options.inactive.radius), J = i(z, l, s.size), Y = i(z, u, s.size), X = i(z, c, s.size), Z = i(G, t, s.radius), Q = f((e) => {
|
|
15
15
|
L || I(e), x?.(e);
|
|
16
16
|
}, [L, x]), ne = (e, t) => {
|
|
17
17
|
if (d.filter((e) => !e.disabled).length === 0) return;
|