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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Color, Radius, Size, Variant } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Visual style of the badge.
|
|
4
|
+
*
|
|
5
|
+
* The `underlined` button variant is excluded because a badge has no baseline
|
|
6
|
+
* an underline could sit on.
|
|
7
|
+
*/
|
|
8
|
+
export type BadgeVariant = Exclude<Variant, "underlined">;
|
|
9
|
+
/**
|
|
10
|
+
* Theme configuration options for the Badge component.
|
|
11
|
+
*
|
|
12
|
+
* Set under `components.badge` in the AsheeUI config. Values feed the
|
|
13
|
+
* component-level fallback tier of the theme cascade.
|
|
14
|
+
*/
|
|
15
|
+
export interface BadgeConfig {
|
|
16
|
+
/**
|
|
17
|
+
* Visual style variant.
|
|
18
|
+
* Controls the badge's background, border, and text treatment.
|
|
19
|
+
*
|
|
20
|
+
* @default "faded"
|
|
21
|
+
*/
|
|
22
|
+
variant?: BadgeVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Theme accent color.
|
|
25
|
+
* Controls the badge's colour within the variant treatment.
|
|
26
|
+
*
|
|
27
|
+
* @default "primary"
|
|
28
|
+
*/
|
|
29
|
+
color?: Color;
|
|
30
|
+
/**
|
|
31
|
+
* Height and font-size scale.
|
|
32
|
+
* Controls the density and text size of the badge.
|
|
33
|
+
*
|
|
34
|
+
* @default "md"
|
|
35
|
+
*/
|
|
36
|
+
size?: Size;
|
|
37
|
+
/**
|
|
38
|
+
* Corner rounding.
|
|
39
|
+
* Controls the border-radius of the badge.
|
|
40
|
+
*
|
|
41
|
+
* @default "full"
|
|
42
|
+
*/
|
|
43
|
+
radius?: Radius;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Default config values registered for the Badge component.
|
|
47
|
+
*
|
|
48
|
+
* `variant` and `color` are intentionally absent so they inherit from the
|
|
49
|
+
* global `defaultVariant` and `defaultColor`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const defaultBadgeConfig: BadgeConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Hard fallback values used when no config tier provides a value.
|
|
54
|
+
* These values are used when instance props, component config,
|
|
55
|
+
* and global defaults are all undefined.
|
|
56
|
+
*/
|
|
57
|
+
export declare const FALLBACK_BADGE_CONFIG: Required<BadgeConfig>;
|
|
58
|
+
declare module "../../libs/registry" {
|
|
59
|
+
interface ComponentTypeConfigRegistry {
|
|
60
|
+
badge: BadgeConfig;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=badge-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-config.d.ts","sourceRoot":"","sources":["../../../src/components/badge/badge-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAGhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAK9C,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,KAAK,EAAE,WAAW,CAAC;KACpB;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/badge/badge-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
radius: "full"
|
|
7
|
+
}, n = {
|
|
8
|
+
variant: "faded",
|
|
9
|
+
color: "primary",
|
|
10
|
+
size: "md",
|
|
11
|
+
radius: "full"
|
|
12
|
+
};
|
|
13
|
+
e("badge", t);
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as FALLBACK_BADGE_CONFIG, t as defaultBadgeConfig };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for badge height based on size.
|
|
4
|
+
* Controls the vertical dimension of the badge.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BADGE_HEIGHT_CLASS: Record<Size, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for badge horizontal padding based on size.
|
|
9
|
+
* Controls the left and right padding of the badge.
|
|
10
|
+
*/
|
|
11
|
+
export declare const BADGE_PADDING_CLASS: Record<Size, string>;
|
|
12
|
+
/**
|
|
13
|
+
* CSS classes for badge font size based on size.
|
|
14
|
+
* Controls the text size of the badge content.
|
|
15
|
+
*/
|
|
16
|
+
export declare const BADGE_FONT_CLASS: Record<Size, string>;
|
|
17
|
+
/**
|
|
18
|
+
* CSS classes for badge gap based on size.
|
|
19
|
+
* Controls the spacing between an icon and the badge content.
|
|
20
|
+
*/
|
|
21
|
+
export declare const BADGE_GAP_CLASS: Record<Size, string>;
|
|
22
|
+
/**
|
|
23
|
+
* CSS classes for icon size based on size.
|
|
24
|
+
* Applied to the icon slot so an icon matches the badge's scale.
|
|
25
|
+
*/
|
|
26
|
+
export declare const BADGE_ICON_SIZE_CLASS: Record<Size, string>;
|
|
27
|
+
//# sourceMappingURL=badge-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-styles.d.ts","sourceRoot":"","sources":["../../../src/components/badge/badge-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAInD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAItD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/badge/badge-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "h-5",
|
|
5
|
+
md: "h-6",
|
|
6
|
+
lg: "h-7"
|
|
7
|
+
}, t = {
|
|
8
|
+
sm: "px-1.5",
|
|
9
|
+
md: "px-2",
|
|
10
|
+
lg: "px-2.5"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "text-[10px]",
|
|
13
|
+
md: "text-xs",
|
|
14
|
+
lg: "text-sm"
|
|
15
|
+
}, r = {
|
|
16
|
+
sm: "gap-1",
|
|
17
|
+
md: "gap-1.5",
|
|
18
|
+
lg: "gap-1.5"
|
|
19
|
+
}, i = {
|
|
20
|
+
sm: "[&_svg]:size-3",
|
|
21
|
+
md: "[&_svg]:size-3.5",
|
|
22
|
+
lg: "[&_svg]:size-4"
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as BADGE_FONT_CLASS, r as BADGE_GAP_CLASS, e as BADGE_HEIGHT_CLASS, i as BADGE_ICON_SIZE_CLASS, t as BADGE_PADDING_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BreadcrumbConfig } from './breadcrumb-config';
|
|
3
|
+
/**
|
|
4
|
+
* One step of a breadcrumb trail.
|
|
5
|
+
*/
|
|
6
|
+
export interface BreadcrumbItem {
|
|
7
|
+
/**
|
|
8
|
+
* Stable identifier for the step.
|
|
9
|
+
* Defaults to the step's position in the trail.
|
|
10
|
+
*/
|
|
11
|
+
id?: string | number;
|
|
12
|
+
/**
|
|
13
|
+
* Visible label of the step.
|
|
14
|
+
*/
|
|
15
|
+
label: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Destination of the step.
|
|
18
|
+
* Without one the step is presented as text, which is what the current
|
|
19
|
+
* location of the trail needs.
|
|
20
|
+
*/
|
|
21
|
+
href?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Content before the label, typically an icon.
|
|
24
|
+
*/
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Whether this step is the current location.
|
|
28
|
+
* Defaults to the last step of the trail, unless another step marks itself
|
|
29
|
+
* as the current location.
|
|
30
|
+
*/
|
|
31
|
+
isCurrent?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the step leads to an external resource.
|
|
34
|
+
*/
|
|
35
|
+
isExternal?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Component that replaces the anchor for this step, such as a framework
|
|
38
|
+
* router link. Passed to {@link Link} as its `component`.
|
|
39
|
+
*/
|
|
40
|
+
component?: ElementType;
|
|
41
|
+
/**
|
|
42
|
+
* Additional props for that component, passed to {@link Link}.
|
|
43
|
+
*/
|
|
44
|
+
componentProps?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
type BaseBreadcrumbProps = BreadcrumbConfig & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
47
|
+
/**
|
|
48
|
+
* Configuration options for the Breadcrumb component.
|
|
49
|
+
*/
|
|
50
|
+
export interface BreadcrumbProps extends BaseBreadcrumbProps {
|
|
51
|
+
/**
|
|
52
|
+
* The trail, from the root to the current location.
|
|
53
|
+
*/
|
|
54
|
+
items: BreadcrumbItem[];
|
|
55
|
+
/**
|
|
56
|
+
* Content shown between two steps.
|
|
57
|
+
* It is decoration and is not read by assistive technology.
|
|
58
|
+
*/
|
|
59
|
+
separator?: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Name of the navigation landmark.
|
|
62
|
+
* A trail is a navigation landmark, so it carries a name that distinguishes
|
|
63
|
+
* it from the consumer's other navigation regions.
|
|
64
|
+
*
|
|
65
|
+
* @default "Breadcrumb"
|
|
66
|
+
*/
|
|
67
|
+
label?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A hierarchical navigation trail.
|
|
71
|
+
*
|
|
72
|
+
* Breadcrumb shows where the consumer is in a hierarchy and offers a way back
|
|
73
|
+
* up it. The trail is a navigation landmark with a name of its own, its steps
|
|
74
|
+
* are an ordered list, and the current location is presented as text with
|
|
75
|
+
* `aria-current` instead of as a link, because a link to where you already are
|
|
76
|
+
* leads nowhere.
|
|
77
|
+
*
|
|
78
|
+
* Linked steps are rendered through the framework's {@link Link} primitive, so
|
|
79
|
+
* a consumer keeps its router link by passing `component` on the step (or
|
|
80
|
+
* on the whole trail through the framework's substitution pattern).
|
|
81
|
+
*
|
|
82
|
+
* @param props - Breadcrumb configuration options and navigation attributes.
|
|
83
|
+
* @param props.items - The trail, from the root to the current location.
|
|
84
|
+
* @param props.separator - Content between two steps. Decorative.
|
|
85
|
+
* @param props.label - Name of the navigation landmark. Defaults to "Breadcrumb".
|
|
86
|
+
* @param props.size - Text and spacing scale. Defaults to "md".
|
|
87
|
+
* @param props.color - Colour of the links. Defaults to the configured value.
|
|
88
|
+
* @param props.className - Extra classes applied last.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* <Breadcrumb
|
|
93
|
+
* items={[
|
|
94
|
+
* { label: "Invoices", href: "/invoices" },
|
|
95
|
+
* { label: "March", href: "/invoices/2026-03" },
|
|
96
|
+
* { label: "INV-0042" },
|
|
97
|
+
* ]}
|
|
98
|
+
* />
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @see BreadcrumbConfig - The configuration type for component defaults.
|
|
102
|
+
* @see Link - The framework's link primitive.
|
|
103
|
+
*/
|
|
104
|
+
export declare const Breadcrumb: import('react').ForwardRefExoticComponent<BreadcrumbProps & import('react').RefAttributes<HTMLElement>>;
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAef,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,UAAU,yGA0GtB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveCascade as n, resolveClassKey as r } from "../../utils/resolve-token.js";
|
|
6
|
+
import { ChevronRightIcon as i } from "../../icons/ChevronRightIcon.js";
|
|
7
|
+
import { Link as a } from "../link/Link.js";
|
|
8
|
+
import { BREADCRUMB_BASE_CLASS as o, BREADCRUMB_CURRENT_CLASS as s, BREADCRUMB_FONT_CLASS as c, BREADCRUMB_GAP_CLASS as l, BREADCRUMB_LIST_CLASS as u, BREADCRUMB_SEPARATOR_ICON_CLASS as d } from "./breadcrumb-styles.js";
|
|
9
|
+
import { FALLBACK_BREADCRUMB_CONFIG as f } from "./breadcrumb-config.js";
|
|
10
|
+
import { forwardRef as p } from "react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/breadcrumb/Breadcrumb.tsx
|
|
13
|
+
var g = p(({ items: p, separator: g, label: _ = "Breadcrumb", size: v, color: y, className: b, ...x }, S) => {
|
|
14
|
+
let C = t(), w = C.components?.breadcrumb, T = n(v, w?.size, void 0, f.size), E = n(y, w?.color, C.defaultColor, f.color), D = r(T, c, f.size), O = r(T, l, f.size), k = r(T, d, f.size), A = g ?? /* @__PURE__ */ m(i, { "aria-hidden": "true" }), j = p.some((e) => e.isCurrent);
|
|
15
|
+
return /* @__PURE__ */ m("nav", {
|
|
16
|
+
ref: S,
|
|
17
|
+
"aria-label": _,
|
|
18
|
+
className: e(o, D, b),
|
|
19
|
+
...x,
|
|
20
|
+
children: /* @__PURE__ */ m("ol", {
|
|
21
|
+
className: e(u, O),
|
|
22
|
+
children: p.map((t, n) => {
|
|
23
|
+
let r = t.isCurrent ?? (!j && n === p.length - 1);
|
|
24
|
+
return /* @__PURE__ */ h("li", {
|
|
25
|
+
className: e("inline-flex items-center min-w-0", O),
|
|
26
|
+
children: [n > 0 && /* @__PURE__ */ m("span", {
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
className: e("inline-flex items-center text-foreground/50", k),
|
|
29
|
+
children: A
|
|
30
|
+
}), r || !t.href ? /* @__PURE__ */ h("span", {
|
|
31
|
+
"aria-current": r ? "page" : void 0,
|
|
32
|
+
className: s,
|
|
33
|
+
children: [t.icon, t.label]
|
|
34
|
+
}) : /* @__PURE__ */ m(a, {
|
|
35
|
+
href: t.href,
|
|
36
|
+
color: E,
|
|
37
|
+
size: T,
|
|
38
|
+
isExternal: t.isExternal,
|
|
39
|
+
component: t.component,
|
|
40
|
+
componentProps: t.componentProps,
|
|
41
|
+
startIcon: t.icon,
|
|
42
|
+
className: e(D, "min-w-0 truncate"),
|
|
43
|
+
children: t.label
|
|
44
|
+
})]
|
|
45
|
+
}, t.id ?? n);
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
g.displayName = "Breadcrumb";
|
|
51
|
+
//#endregion
|
|
52
|
+
export { g as Breadcrumb };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Color, Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the Breadcrumb component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.breadcrumb` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level fallback tier of the theme cascade.
|
|
7
|
+
*/
|
|
8
|
+
export interface BreadcrumbConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Text and spacing scale of the trail.
|
|
11
|
+
*
|
|
12
|
+
* @default "md"
|
|
13
|
+
*/
|
|
14
|
+
size?: Size;
|
|
15
|
+
/**
|
|
16
|
+
* Theme accent colour of the links in the trail.
|
|
17
|
+
* The current location is presented in the foreground colour instead.
|
|
18
|
+
*
|
|
19
|
+
* @default "primary"
|
|
20
|
+
*/
|
|
21
|
+
color?: Color;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Default config values registered for the Breadcrumb component.
|
|
25
|
+
*
|
|
26
|
+
* `color` is intentionally absent so it inherits from the global
|
|
27
|
+
* `defaultColor`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const defaultBreadcrumbConfig: BreadcrumbConfig;
|
|
30
|
+
/**
|
|
31
|
+
* Hard fallback values used when no config tier provides a value.
|
|
32
|
+
* These values are used when instance props, component config,
|
|
33
|
+
* and global defaults are all undefined.
|
|
34
|
+
*/
|
|
35
|
+
export declare const FALLBACK_BREADCRUMB_CONFIG: Required<BreadcrumbConfig>;
|
|
36
|
+
declare module "../../libs/registry" {
|
|
37
|
+
interface ComponentTypeConfigRegistry {
|
|
38
|
+
breadcrumb: BreadcrumbConfig;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=breadcrumb-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb-config.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/breadcrumb-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAErC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,gBAAgB,CAGxD,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,UAAU,EAAE,gBAAgB,CAAC;KAC9B;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/breadcrumb/breadcrumb-config.ts
|
|
4
|
+
var t = { size: "md" }, n = {
|
|
5
|
+
size: "md",
|
|
6
|
+
color: "primary"
|
|
7
|
+
};
|
|
8
|
+
e("breadcrumb", t);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as FALLBACK_BREADCRUMB_CONFIG, t as defaultBreadcrumbConfig };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for the trail's text size based on size.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BREADCRUMB_FONT_CLASS: Record<Size, string>;
|
|
6
|
+
/**
|
|
7
|
+
* CSS classes for the gap between trail items based on size.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BREADCRUMB_GAP_CLASS: Record<Size, string>;
|
|
10
|
+
/**
|
|
11
|
+
* CSS classes for the separator's icon size based on size.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BREADCRUMB_SEPARATOR_ICON_CLASS: Record<Size, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Base classes for the navigation landmark.
|
|
16
|
+
*/
|
|
17
|
+
export declare const BREADCRUMB_BASE_CLASS = "w-full";
|
|
18
|
+
/**
|
|
19
|
+
* Classes for the ordered list that holds the trail.
|
|
20
|
+
*/
|
|
21
|
+
export declare const BREADCRUMB_LIST_CLASS = "flex items-center flex-wrap list-none p-0 m-0";
|
|
22
|
+
/**
|
|
23
|
+
* Classes for the current location.
|
|
24
|
+
* It is presented in the foreground colour so it reads as the end of the
|
|
25
|
+
* trail rather than as another link.
|
|
26
|
+
*/
|
|
27
|
+
export declare const BREADCRUMB_CURRENT_CLASS = "inline-flex items-center gap-1.5 min-w-0 truncate font-medium text-foreground";
|
|
28
|
+
//# sourceMappingURL=breadcrumb-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb-styles.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/breadcrumb-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAItD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,qBAAqB,kDACe,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,kFAC4C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/breadcrumb/breadcrumb-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "text-xs",
|
|
5
|
+
md: "text-sm",
|
|
6
|
+
lg: "text-base"
|
|
7
|
+
}, t = {
|
|
8
|
+
sm: "gap-1",
|
|
9
|
+
md: "gap-1.5",
|
|
10
|
+
lg: "gap-2"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "[&_svg]:size-3",
|
|
13
|
+
md: "[&_svg]:size-3.5",
|
|
14
|
+
lg: "[&_svg]:size-4"
|
|
15
|
+
}, r = "w-full", i = "flex items-center flex-wrap list-none p-0 m-0", a = "inline-flex items-center gap-1.5 min-w-0 truncate font-medium text-foreground";
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as BREADCRUMB_BASE_CLASS, a as BREADCRUMB_CURRENT_CLASS, e as BREADCRUMB_FONT_CLASS, t as BREADCRUMB_GAP_CLASS, i as BREADCRUMB_LIST_CLASS, n as BREADCRUMB_SEPARATOR_ICON_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiBf,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiBf,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,eAAO,MAAM,MAAM,2GA0IlB,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, UnderlineRadius as n } from "../../shared/radius.js";
|
|
5
|
+
import { resolveVariantClass as r } from "../../shared/variant.js";
|
|
6
|
+
import { useAsheeConfig as i } from "../../libs/context.js";
|
|
7
7
|
import { resolveCascade as a, resolveClassKey as o, resolveRadiusKey as s } from "../../utils/resolve-token.js";
|
|
8
8
|
import { Spinner as c } from "../spinner/spinner.js";
|
|
9
9
|
import { FALLBACK_BUTTON_CONFIG as l } from "./button-config.js";
|
|
@@ -12,13 +12,13 @@ import { forwardRef as f } from "react";
|
|
|
12
12
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/button/Button.tsx
|
|
14
14
|
var h = f((f, h) => {
|
|
15
|
-
let { variant: g, color: _, size: v, radius: y, animate: b, fullWidth: x, isDisabled: S, isLoading: C, icon: w, className: T, children: E, type: D = "button", onClick: O, startContent: k, endContent: A, href: j, link: M, ...N } = f, P =
|
|
15
|
+
let { variant: g, color: _, size: v, radius: y, animate: b, fullWidth: x, isDisabled: S, isLoading: C, icon: w, className: T, children: E, type: D = "button", onClick: O, startContent: k, endContent: A, href: j, link: M, ...N } = f, P = i(), F = P.components?.button, I = a(g, F?.variant, P.defaultVariant, l.variant), L = a(_, F?.color, P.defaultColor, l.color), R = a(v, F?.size, void 0, l.size), z = s(y, F?.radius, P.defaultRadius, l.radius), B = a(b, F?.animate, l.animate, l.animate), V = a(x, F?.fullWidth, void 0, l.fullWidth), H = w ? u[R] : d[R], U = S || C, W = !!(j || M), G = M?.component ?? (W ? "a" : "button"), { onClick: K, ...q } = M?.props ?? {}, J = (e) => {
|
|
16
16
|
if (U) {
|
|
17
17
|
e.preventDefault();
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
O?.(e), K?.(e);
|
|
21
|
-
}, Y = e("inline-flex items-center justify-center font-medium transition-colors select-none shrink-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", "aria-disabled:pointer-events-none aria-disabled:opacity-50", V && "w-full", B && "motion-safe:transition-transform motion-safe:duration-100 motion-safe:active:scale-[0.99]",
|
|
21
|
+
}, Y = e("inline-flex items-center justify-center font-medium transition-colors select-none shrink-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", "aria-disabled:pointer-events-none aria-disabled:opacity-50", V && "w-full", B && "motion-safe:transition-transform motion-safe:duration-100 motion-safe:active:scale-[0.99]", r(I, L), H, o(n(I, z), t, n(I, l.radius)), T);
|
|
22
22
|
return /* @__PURE__ */ m(G, {
|
|
23
23
|
ref: h,
|
|
24
24
|
...W ? { href: j } : {
|
|
@@ -35,10 +35,13 @@ var h = f((f, h) => {
|
|
|
35
35
|
C && /* @__PURE__ */ p(c, { className: R }),
|
|
36
36
|
C && /* @__PURE__ */ p("span", {
|
|
37
37
|
className: "sr-only",
|
|
38
|
-
children: "Loading"
|
|
38
|
+
children: "Loading "
|
|
39
39
|
}),
|
|
40
|
+
C ? /* @__PURE__ */ p("span", {
|
|
41
|
+
className: "sr-only",
|
|
42
|
+
children: E
|
|
43
|
+
}) : E,
|
|
40
44
|
!C && k,
|
|
41
|
-
!C && E,
|
|
42
45
|
!C && A
|
|
43
46
|
]
|
|
44
47
|
});
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { InputProps } from '../input/Input';
|
|
2
|
-
import {
|
|
2
|
+
import { CalendarConfig, CalendarPickerConfig } from './calendar-config';
|
|
3
3
|
/**
|
|
4
4
|
* Props for the picker (calendar popover).
|
|
5
|
-
* Extends
|
|
5
|
+
* Extends CalendarPickerConfig with instance-only props.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface CalendarPickerProps extends CalendarPickerConfig {
|
|
8
8
|
/**
|
|
9
9
|
* Extra CSS classes for the calendar popover.
|
|
10
10
|
*/
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Base
|
|
15
|
-
* Combines
|
|
14
|
+
* Base Calendar props excluding the picker configuration.
|
|
15
|
+
* Combines CalendarConfig (minus picker) with InputProps (minus value-related props).
|
|
16
16
|
*/
|
|
17
|
-
export type
|
|
17
|
+
export type BaseCalendarProps = Omit<CalendarConfig, "picker"> & Omit<InputProps, "onChange" | "value" | "defaultValue" | "endContent" | "startContent">;
|
|
18
18
|
/**
|
|
19
|
-
* Configuration options for the
|
|
19
|
+
* Configuration options for the Calendar component.
|
|
20
20
|
* Extends InputProps but omits value-related props that are replaced
|
|
21
21
|
* with date-specific equivalents.
|
|
22
22
|
*/
|
|
23
|
-
export interface
|
|
23
|
+
export interface CalendarProps extends BaseCalendarProps {
|
|
24
24
|
/**
|
|
25
25
|
* The currently selected date.
|
|
26
26
|
* Pass null for no selection.
|
|
@@ -35,7 +35,7 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
35
35
|
* Picker configuration overrides including portal, portalTarget, and className.
|
|
36
36
|
* All picker-related props should be passed through this object.
|
|
37
37
|
*/
|
|
38
|
-
picker?:
|
|
38
|
+
picker?: CalendarPickerProps;
|
|
39
39
|
/**
|
|
40
40
|
* Whether a clear button is shown in the input.
|
|
41
41
|
* When true, a clear button appears when a date is selected.
|
|
@@ -54,7 +54,7 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
54
54
|
/**
|
|
55
55
|
* A date/time picker component with calendar popover and time selection.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
57
|
+
* Calendar renders an input field with a calendar popover that allows
|
|
58
58
|
* selecting dates and/or times. It supports date, time, and datetime modes,
|
|
59
59
|
* clearable selection, and future date restrictions. The component integrates
|
|
60
60
|
* with Floating UI for popover positioning and follows the standard AsheeUI
|
|
@@ -64,10 +64,10 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
64
64
|
* render at the document body level. This ensures the popover escapes CSS
|
|
65
65
|
* containment, overflow clipping, and stacking context issues. The portal
|
|
66
66
|
* can be disabled via the `picker.portal` prop or
|
|
67
|
-
* `components.
|
|
67
|
+
* `components.calendar.picker.portal` in the config if the popover needs
|
|
68
68
|
* to stay within a specific parent container.
|
|
69
69
|
*
|
|
70
|
-
* @param props -
|
|
70
|
+
* @param props - Calendar configuration options.
|
|
71
71
|
* @param props.selected - Currently selected date or null.
|
|
72
72
|
* @param props.onChange - Callback fired when the date changes.
|
|
73
73
|
* @param props.mode - Selection mode: "date", "time", or "datetime". Defaults to "date".
|
|
@@ -89,17 +89,17 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
89
89
|
*
|
|
90
90
|
* @example
|
|
91
91
|
* ```tsx
|
|
92
|
-
* import {
|
|
92
|
+
* import { Calendar } from "asheeui";
|
|
93
93
|
* import { useState } from "react";
|
|
94
94
|
*
|
|
95
95
|
* export function Example() {
|
|
96
96
|
* const [selected, setSelected] = useState<Date | null>(null);
|
|
97
97
|
*
|
|
98
98
|
* return (
|
|
99
|
-
* <
|
|
99
|
+
* <Calendar
|
|
100
100
|
* selected={selected}
|
|
101
101
|
* onChange={setSelected}
|
|
102
|
-
* label="
|
|
102
|
+
* label="Dropmenu Date"
|
|
103
103
|
* isClearable
|
|
104
104
|
* />
|
|
105
105
|
* );
|
|
@@ -109,9 +109,9 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
109
109
|
* @example
|
|
110
110
|
* ```tsx
|
|
111
111
|
* // With datetime mode and custom picker configuration
|
|
112
|
-
* <
|
|
112
|
+
* <Calendar
|
|
113
113
|
* mode="datetime"
|
|
114
|
-
* label="
|
|
114
|
+
* label="Dropmenu Date and Time"
|
|
115
115
|
* isClearable
|
|
116
116
|
* picker={{
|
|
117
117
|
* className: "custom-calendar",
|
|
@@ -120,9 +120,9 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
120
120
|
* />
|
|
121
121
|
* ```
|
|
122
122
|
*
|
|
123
|
-
* @see
|
|
123
|
+
* @see CalendarConfig - The configuration type for component defaults.
|
|
124
124
|
* @see Input - The underlying input component.
|
|
125
|
-
* @see
|
|
125
|
+
* @see DateGrid - The calendar popover component.
|
|
126
126
|
*/
|
|
127
|
-
export declare const
|
|
128
|
-
//# sourceMappingURL=
|
|
127
|
+
export declare const Calendar: import('react').ForwardRefExoticComponent<CalendarProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
128
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/Calendar.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASxD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,GAC5D,IAAI,CACF,UAAU,EACV,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CACtE,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,eAAO,MAAM,QAAQ,4GA+VpB,CAAC"}
|