asheeui 0.6.2 → 0.6.3
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 +34 -0
- package/dist/AsheeUIProvider.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.d.ts +55 -44
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +27 -27
- package/dist/components/accordion/accordion-config.d.ts +41 -12
- package/dist/components/accordion/accordion-config.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.d.ts +20 -0
- package/dist/components/accordion/accordion-styles.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.js +1 -1
- package/dist/components/autocomplete/Autocomplete.d.ts +59 -39
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +98 -91
- package/dist/components/autocomplete/autocomplete-config.d.ts +9 -62
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +6 -21
- package/dist/components/button/Button.d.ts +50 -51
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +19 -19
- package/dist/components/button/button-config.d.ts +23 -15
- package/dist/components/button/button-config.d.ts.map +1 -1
- package/dist/components/button/button-styles.d.ts +11 -1
- package/dist/components/button/button-styles.d.ts.map +1 -1
- package/dist/components/card/Card.d.ts +85 -43
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +49 -49
- package/dist/components/card/card-config.d.ts +35 -18
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +0 -2
- package/dist/components/card/card-styles.d.ts +17 -1
- package/dist/components/card/card-styles.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.d.ts +107 -12
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +63 -64
- package/dist/components/carousel/carousel-config.d.ts +94 -7
- package/dist/components/carousel/carousel-config.d.ts.map +1 -1
- package/dist/components/carousel/carousel-config.js +6 -4
- package/dist/components/carousel/carousel-styles.d.ts +32 -1
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/chip/Chip.d.ts +55 -34
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +71 -72
- package/dist/components/chip/chip-config.d.ts +29 -15
- package/dist/components/chip/chip-config.d.ts.map +1 -1
- package/dist/components/chip/chip-config.js +5 -6
- package/dist/components/chip/chip-styles.d.ts +21 -1
- package/dist/components/chip/chip-styles.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +166 -2
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +110 -99
- package/dist/components/date-picker/date-picker-config.d.ts +31 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +8 -16
- package/dist/components/date-picker/date-picker-styles.d.ts +21 -1
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +7 -11
- package/dist/components/drawer/Drawer.d.ts +97 -7
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +9 -9
- package/dist/components/drawer/drawer-config.d.ts +54 -1
- package/dist/components/drawer/drawer-config.d.ts.map +1 -1
- package/dist/components/drawer/drawer-styles.d.ts +21 -0
- package/dist/components/drawer/drawer-styles.d.ts.map +1 -1
- package/dist/components/field/FieldShell.d.ts +86 -0
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/field-config.d.ts +66 -3
- package/dist/components/field/field-config.d.ts.map +1 -1
- package/dist/components/field/field-config.js +2 -1
- package/dist/components/field/field-styles.d.ts +22 -0
- package/dist/components/field/field-styles.d.ts.map +1 -1
- package/dist/components/field/field-styles.js +10 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/image/Image.d.ts +35 -28
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +7 -7
- package/dist/components/image/image-config.d.ts +25 -7
- package/dist/components/image/image-config.d.ts.map +1 -1
- package/dist/components/image/image-styles.d.ts +9 -0
- package/dist/components/image/image-styles.d.ts.map +1 -1
- package/dist/components/input/Input.d.ts +117 -10
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +20 -20
- package/dist/components/input/PasswordInput.d.ts +48 -0
- package/dist/components/input/PasswordInput.d.ts.map +1 -1
- package/dist/components/input/input-config.d.ts +10 -1
- package/dist/components/input/input-config.d.ts.map +1 -1
- package/dist/components/input/input-config.js +5 -8
- package/dist/components/input/input-styles.d.ts +10 -0
- package/dist/components/input/input-styles.d.ts.map +1 -1
- package/dist/components/input/input-styles.js +5 -9
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +58 -8
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +49 -48
- package/dist/components/keyboard/index.js +1 -1
- package/dist/components/keyboard/keyboard-config.d.ts +88 -3
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/{default-keyboard-config.js → keyboard-config.js} +7 -1
- package/dist/components/keyboard/keyboard-context.d.ts +103 -13
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +66 -68
- package/dist/components/keyboard/use-keyboard-field.d.ts +37 -0
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/link/Link.d.ts +118 -9
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +29 -30
- package/dist/components/link/link-config.d.ts +58 -5
- package/dist/components/link/link-config.d.ts.map +1 -1
- package/dist/components/link/link-styles.d.ts +24 -4
- package/dist/components/link/link-styles.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.d.ts +77 -8
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +5 -5
- package/dist/components/marquee/marquee-config.d.ts +74 -0
- package/dist/components/marquee/marquee-config.d.ts.map +1 -1
- package/dist/components/marquee/marquee-styles.d.ts +12 -0
- package/dist/components/marquee/marquee-styles.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts +113 -25
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +75 -82
- package/dist/components/modal/modal-config.d.ts +59 -1
- package/dist/components/modal/modal-config.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.d.ts +8 -1
- package/dist/components/modal/modal-styles.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.js +4 -11
- package/dist/components/multi-select/MultiSelect.d.ts +152 -23
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +195 -217
- package/dist/components/multi-select/multi-select-config.d.ts +61 -23
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +16 -25
- package/dist/components/multi-select/multi-select-styles.d.ts +17 -0
- package/dist/components/multi-select/multi-select-styles.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-styles.js +9 -13
- package/dist/components/radio/Radio.d.ts +137 -13
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +66 -141
- package/dist/components/radio/RadioGroup.d.ts +88 -23
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +141 -66
- package/dist/components/radio/radio-config.d.ts +36 -11
- package/dist/components/radio/radio-config.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +9 -11
- package/dist/components/radio/radio-context.d.ts +44 -1
- package/dist/components/radio/radio-context.d.ts.map +1 -1
- package/dist/components/radio/radio-styles.d.ts +24 -1
- package/dist/components/radio/radio-styles.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.d.ts +79 -32
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +77 -72
- package/dist/components/resizable-screen/resizable-screen-config.d.ts +62 -0
- package/dist/components/resizable-screen/resizable-screen-config.d.ts.map +1 -1
- package/dist/components/scrollbar/scrollbar-config.d.ts +44 -9
- package/dist/components/scrollbar/scrollbar-config.d.ts.map +1 -1
- package/dist/components/select/Select.d.ts +157 -17
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +141 -152
- package/dist/components/select/select-config.d.ts +26 -19
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +5 -21
- package/dist/components/select/select-styles.d.ts +10 -0
- package/dist/components/select/select-styles.d.ts.map +1 -1
- package/dist/components/select/select-styles.js +5 -9
- package/dist/components/select-menu/SelectMenu.d.ts +125 -8
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +107 -79
- package/dist/components/select-menu/index.d.ts +2 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +82 -0
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -0
- package/dist/components/select-menu/select-menu-config.js +12 -0
- package/dist/components/sidebar/Sidebar.d.ts +151 -51
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +211 -232
- package/dist/components/sidebar/sidebar-config.d.ts +140 -21
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +9 -12
- package/dist/components/sidebar/sidebar-styles.d.ts +24 -0
- package/dist/components/sidebar/sidebar-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner-config.d.ts +15 -9
- package/dist/components/spinner/spinner-config.d.ts.map +1 -1
- package/dist/components/spinner/spinner-styles.d.ts +10 -3
- package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner.d.ts +27 -20
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +18 -18
- package/dist/components/switch/Switch.d.ts +109 -9
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +19 -19
- package/dist/components/switch/switch-config.d.ts +20 -6
- package/dist/components/switch/switch-config.d.ts.map +1 -1
- package/dist/components/switch/switch-config.js +8 -16
- package/dist/components/switch/switch-styles.d.ts +17 -0
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/table/Table.d.ts +101 -28
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +56 -56
- package/dist/components/table/table-config.d.ts +75 -8
- package/dist/components/table/table-config.d.ts.map +1 -1
- package/dist/components/table/table-styles.d.ts +25 -6
- package/dist/components/table/table-styles.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +84 -31
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +44 -44
- package/dist/components/tabs/tabs-config.d.ts +102 -9
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-styles.d.ts +16 -4
- package/dist/components/tabs/tabs-styles.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +105 -11
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +27 -24
- package/dist/components/textarea/textarea-config.d.ts +21 -0
- package/dist/components/textarea/textarea-config.d.ts.map +1 -1
- package/dist/components/textarea/textarea-config.js +8 -16
- package/dist/components/textarea/textarea-styles.d.ts +9 -0
- package/dist/components/textarea/textarea-styles.d.ts.map +1 -1
- package/dist/components/textarea/textarea-styles.js +5 -9
- package/dist/components/toast/ToastItem.d.ts +58 -4
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +18 -18
- package/dist/components/toast/toast-config.d.ts +104 -6
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-context.d.ts +123 -11
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +19 -19
- package/dist/components/toast/toast-styles.d.ts +27 -5
- package/dist/components/toast/toast-styles.d.ts.map +1 -1
- package/dist/components/toast/use-pausable-timeout.d.ts +29 -0
- package/dist/components/toast/use-pausable-timeout.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +76 -16
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +25 -25
- package/dist/components/tooltip/tooltip-config.d.ts +73 -3
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-styles.d.ts +12 -0
- package/dist/components/tooltip/tooltip-styles.d.ts.map +1 -1
- package/dist/config/config.d.ts +50 -2
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-config.d.ts +5 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +23 -0
- package/dist/config/define-config.d.ts +23 -0
- package/dist/config/define-config.d.ts.map +1 -1
- package/dist/config/resolve-color.d.ts +25 -0
- package/dist/config/resolve-color.d.ts.map +1 -1
- package/dist/config/resolve-config.d.ts +23 -0
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/index.css +43 -7
- package/dist/index.d.ts +30 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -115
- package/dist/libs/context.d.ts +50 -1
- package/dist/libs/context.d.ts.map +1 -1
- package/dist/libs/registry.d.ts +61 -5
- package/dist/libs/registry.d.ts.map +1 -1
- package/dist/libs/use-isomorphic-layout-effect.d.ts +18 -0
- package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/radius.d.ts +37 -1
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/variant.d.ts +31 -0
- package/dist/shared/variant.d.ts.map +1 -1
- package/dist/shared/variant.js +132 -45
- package/dist/theme/color.d.ts +89 -1
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/controller.d.ts +121 -0
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +84 -0
- package/dist/theme/useTheme.d.ts +68 -0
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +23 -0
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +101 -0
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/keyboard/default-keyboard-config.d.ts +0 -10
- package/dist/components/keyboard/default-keyboard-config.d.ts.map +0 -1
- package/dist/shared/size.d.ts +0 -2
- package/dist/shared/size.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-config.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"toast-config.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7E;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,YAAY,GACZ,eAAe,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAQhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;mBAClB,IAAI;wBACQ,cAAc;sBACpB,OAAO;qBACX,MAAM;;;;CAId,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,KAAK,EAAE,WAAW,CAAC;KACpB;CACF"}
|
|
@@ -1,31 +1,143 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ToastConfig, ToastItemData } from './toast-config';
|
|
3
|
+
/**
|
|
4
|
+
* Options for showing a toast notification.
|
|
5
|
+
* Extends ToastItemData but makes id optional.
|
|
6
|
+
*/
|
|
5
7
|
export interface ToastShowOptions extends Omit<ToastItemData, "id"> {
|
|
8
|
+
/**
|
|
9
|
+
* Optional unique identifier for the toast.
|
|
10
|
+
* If not provided, a random ID is generated.
|
|
11
|
+
*/
|
|
6
12
|
id?: string;
|
|
7
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Context type for the toast system.
|
|
16
|
+
* Provides methods for showing and managing toast notifications.
|
|
17
|
+
*/
|
|
8
18
|
export interface ToastContextType {
|
|
19
|
+
/**
|
|
20
|
+
* Array of currently active toast items.
|
|
21
|
+
*/
|
|
9
22
|
toasts: ToastItemData[];
|
|
23
|
+
/**
|
|
24
|
+
* Show a toast with the given options.
|
|
25
|
+
* Returns the toast ID.
|
|
26
|
+
*/
|
|
10
27
|
toast: (options: ToastShowOptions | string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Show a success toast.
|
|
30
|
+
* Returns the toast ID.
|
|
31
|
+
*/
|
|
11
32
|
success: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Show an error toast.
|
|
35
|
+
* Returns the toast ID.
|
|
36
|
+
*/
|
|
12
37
|
error: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Show an info toast.
|
|
40
|
+
* Returns the toast ID.
|
|
41
|
+
*/
|
|
13
42
|
info: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
43
|
+
/**
|
|
44
|
+
* Show a warning toast.
|
|
45
|
+
* Returns the toast ID.
|
|
46
|
+
*/
|
|
14
47
|
warning: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Remove a toast by ID.
|
|
50
|
+
*/
|
|
15
51
|
removeToast: (id: string) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Clear all active toasts.
|
|
54
|
+
*/
|
|
16
55
|
clearToasts: () => void;
|
|
17
56
|
}
|
|
18
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Props for the ToastProvider component.
|
|
59
|
+
* Extends ToastConfig with children and className.
|
|
60
|
+
*/
|
|
61
|
+
export interface ToastProviderProps extends ToastConfig {
|
|
62
|
+
/**
|
|
63
|
+
* Child components to render.
|
|
64
|
+
*/
|
|
19
65
|
children: ReactNode;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
radius?: Radius;
|
|
24
|
-
defaultTimeout?: number;
|
|
25
|
-
maxToasts?: number;
|
|
26
|
-
animated?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Extra classes for the toast container.
|
|
68
|
+
*/
|
|
27
69
|
className?: string;
|
|
28
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Provider component for the toast notification system.
|
|
73
|
+
*
|
|
74
|
+
* ToastProvider wraps your application and provides toast notification
|
|
75
|
+
* functionality through the useToast hook. It manages the toast queue,
|
|
76
|
+
* rendering, and dismissal logic, and automatically positions toasts
|
|
77
|
+
* based on the configured placement.
|
|
78
|
+
*
|
|
79
|
+
* @param props - ToastProvider configuration options.
|
|
80
|
+
* @param props.children - Child components.
|
|
81
|
+
* @param props.size - Size scale of toasts. Defaults to "md".
|
|
82
|
+
* @param props.placement - Placement of toasts. Defaults to "top-right".
|
|
83
|
+
* @param props.variant - Visual style variant. Defaults to "bordered".
|
|
84
|
+
* @param props.radius - Corner rounding. Defaults to "md".
|
|
85
|
+
* @param props.defaultTimeout - Default timeout in ms. Defaults to 3500.
|
|
86
|
+
* @param props.maxToasts - Maximum number of toasts. Defaults to 5.
|
|
87
|
+
* @param props.animated - Whether toasts have animations. Defaults to true.
|
|
88
|
+
* @param props.className - Extra classes for the toast container.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* import { ToastProvider, useToast } from "asheeui";
|
|
93
|
+
*
|
|
94
|
+
* function App() {
|
|
95
|
+
* return (
|
|
96
|
+
* <ToastProvider>
|
|
97
|
+
* <MyComponent />
|
|
98
|
+
* </ToastProvider>
|
|
99
|
+
* );
|
|
100
|
+
* }
|
|
101
|
+
*
|
|
102
|
+
* function MyComponent() {
|
|
103
|
+
* const toast = useToast();
|
|
104
|
+
*
|
|
105
|
+
* return (
|
|
106
|
+
* <button onClick={() => toast.success("Operation successful!")}>
|
|
107
|
+
* Show Toast
|
|
108
|
+
* </button>
|
|
109
|
+
* );
|
|
110
|
+
* }
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @see useToast - Hook for showing toast notifications.
|
|
114
|
+
* @see ToastConfig - The configuration type for the toast system.
|
|
115
|
+
*/
|
|
29
116
|
export declare function ToastProvider({ children, size, placement, variant, radius, defaultTimeout, maxToasts, animated, className, }: ToastProviderProps): import("react").JSX.Element;
|
|
117
|
+
/**
|
|
118
|
+
* Hook for accessing the toast system.
|
|
119
|
+
*
|
|
120
|
+
* useToast returns methods for showing toast notifications with
|
|
121
|
+
* different types (success, error, info, warning). It must be used
|
|
122
|
+
* within a ToastProvider component.
|
|
123
|
+
*
|
|
124
|
+
* @returns The toast context with methods for showing and managing toasts.
|
|
125
|
+
* If used outside a ToastProvider, returns safe fallback methods.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```tsx
|
|
129
|
+
* function MyComponent() {
|
|
130
|
+
* const toast = useToast();
|
|
131
|
+
*
|
|
132
|
+
* const handleClick = () => {
|
|
133
|
+
* toast.success("Saved successfully!");
|
|
134
|
+
* };
|
|
135
|
+
*
|
|
136
|
+
* return <button onClick={handleClick}>Save</button>;
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @see ToastProvider - The provider component that enables the toast system.
|
|
141
|
+
*/
|
|
30
142
|
export declare function useToast(): ToastContextType;
|
|
31
143
|
//# sourceMappingURL=toast-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-context.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast-context.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-context.tsx"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAMf,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AAIxB;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC;IACjE;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,EAAE,aAAa,EAAE,CAAC;IAExB;;;OAGG;IACH,KAAK,EAAE,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,KAAK,MAAM,CAAC;IAEtD;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAE7E;;;OAGG;IACH,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAE3E;;;OAGG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAE1E;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAE7E;;OAEG;IACH,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAMD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,+BA4KpB;AAID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,qBAevB"}
|
|
@@ -9,8 +9,8 @@ import { cn as X } from "../../utils/cn.js";
|
|
|
9
9
|
const D = H(null);
|
|
10
10
|
function st({
|
|
11
11
|
children: m,
|
|
12
|
-
size:
|
|
13
|
-
placement:
|
|
12
|
+
size: K,
|
|
13
|
+
placement: I,
|
|
14
14
|
variant: S,
|
|
15
15
|
radius: U,
|
|
16
16
|
defaultTimeout: j,
|
|
@@ -19,25 +19,25 @@ function st({
|
|
|
19
19
|
className: R
|
|
20
20
|
}) {
|
|
21
21
|
var h;
|
|
22
|
-
const [
|
|
23
|
-
|
|
22
|
+
const [c, l] = g([]), d = J(), t = (h = d.components) == null ? void 0 : h.toast, V = i(
|
|
23
|
+
K,
|
|
24
24
|
t == null ? void 0 : t.size,
|
|
25
25
|
void 0,
|
|
26
26
|
n.size
|
|
27
27
|
), r = i(
|
|
28
|
-
|
|
28
|
+
I,
|
|
29
29
|
t == null ? void 0 : t.placement,
|
|
30
30
|
void 0,
|
|
31
31
|
n.placement
|
|
32
32
|
), F = i(
|
|
33
33
|
S,
|
|
34
34
|
t == null ? void 0 : t.variant,
|
|
35
|
-
|
|
35
|
+
d.defaultVariant,
|
|
36
36
|
n.variant
|
|
37
37
|
), L = Q(
|
|
38
38
|
U,
|
|
39
39
|
t == null ? void 0 : t.radius,
|
|
40
|
-
|
|
40
|
+
d.defaultRadius,
|
|
41
41
|
n.radius
|
|
42
42
|
), v = i(
|
|
43
43
|
N,
|
|
@@ -54,14 +54,14 @@ function st({
|
|
|
54
54
|
t == null ? void 0 : t.animated,
|
|
55
55
|
void 0,
|
|
56
56
|
n.animated
|
|
57
|
-
),
|
|
58
|
-
|
|
57
|
+
), p = a((e) => {
|
|
58
|
+
l((o) => o.filter((f) => f.id !== e));
|
|
59
59
|
}, []), x = a(() => {
|
|
60
|
-
|
|
60
|
+
l([]);
|
|
61
61
|
}, []), s = a(
|
|
62
62
|
(e) => {
|
|
63
63
|
var z;
|
|
64
|
-
const o = typeof e == "object" && e.id ? e.id : typeof window < "u" && ((z = window.crypto) != null && z.randomUUID) ? window.crypto.randomUUID() : String(Date.now()),
|
|
64
|
+
const o = typeof e == "object" && e.id ? e.id : typeof window < "u" && ((z = window.crypto) != null && z.randomUUID) ? window.crypto.randomUUID() : String(Date.now()), f = typeof e == "string" ? {
|
|
65
65
|
id: o,
|
|
66
66
|
message: e,
|
|
67
67
|
timeout: u,
|
|
@@ -72,9 +72,9 @@ function st({
|
|
|
72
72
|
timeout: e.timeout ?? u,
|
|
73
73
|
type: e.type ?? "info"
|
|
74
74
|
};
|
|
75
|
-
return
|
|
75
|
+
return l((_) => {
|
|
76
76
|
const k = _.filter((B) => B.id !== o);
|
|
77
|
-
return [
|
|
77
|
+
return [f, ...k].slice(0, v);
|
|
78
78
|
}), o;
|
|
79
79
|
},
|
|
80
80
|
[u, v]
|
|
@@ -92,16 +92,16 @@ function st({
|
|
|
92
92
|
[s]
|
|
93
93
|
), O = q(
|
|
94
94
|
() => ({
|
|
95
|
-
toasts:
|
|
95
|
+
toasts: c,
|
|
96
96
|
toast: s,
|
|
97
97
|
success: T,
|
|
98
98
|
error: y,
|
|
99
99
|
info: w,
|
|
100
100
|
warning: b,
|
|
101
|
-
removeToast:
|
|
101
|
+
removeToast: p,
|
|
102
102
|
clearToasts: x
|
|
103
103
|
}),
|
|
104
|
-
[
|
|
104
|
+
[c, s, T, y, w, b, p, x]
|
|
105
105
|
);
|
|
106
106
|
return /* @__PURE__ */ G(D.Provider, { value: O, children: [
|
|
107
107
|
m,
|
|
@@ -110,7 +110,7 @@ function st({
|
|
|
110
110
|
{
|
|
111
111
|
"aria-label": "Notifications",
|
|
112
112
|
className: X(
|
|
113
|
-
"fixed z-50 flex flex-col gap-3 pointer-events-none p-4 max-h-screen overflow-
|
|
113
|
+
"fixed z-50 flex flex-col gap-3 pointer-events-none p-4 max-h-screen overflow-clip",
|
|
114
114
|
r === "top-right" && "top-0 right-0 items-end",
|
|
115
115
|
r === "top-left" && "top-0 left-0 items-start",
|
|
116
116
|
r === "bottom-right" && "bottom-0 right-0 items-end",
|
|
@@ -119,7 +119,7 @@ function st({
|
|
|
119
119
|
r === "bottom-center" && "bottom-0 left-1/2 -translate-x-1/2 items-center",
|
|
120
120
|
R
|
|
121
121
|
),
|
|
122
|
-
children:
|
|
122
|
+
children: c.map((e) => /* @__PURE__ */ A(
|
|
123
123
|
W,
|
|
124
124
|
{
|
|
125
125
|
...e,
|
|
@@ -127,7 +127,7 @@ function st({
|
|
|
127
127
|
size: V,
|
|
128
128
|
variant: F,
|
|
129
129
|
radius: L,
|
|
130
|
-
onDismiss:
|
|
130
|
+
onDismiss: p,
|
|
131
131
|
animated: M
|
|
132
132
|
},
|
|
133
133
|
e.id
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
import { ToastPlacement } from './toast-config';
|
|
3
|
+
/**
|
|
4
|
+
* CSS classes for toast width based on size.
|
|
5
|
+
* Maps size keys to Tailwind width classes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TOAST_WIDTH_CLASS: Record<Size, string>;
|
|
8
|
+
/**
|
|
9
|
+
* CSS classes for toast padding based on size.
|
|
10
|
+
* Maps size keys to Tailwind padding classes.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TOAST_PADDING_CLASS: Record<Size, string>;
|
|
13
|
+
/**
|
|
14
|
+
* CSS classes for toast message font size.
|
|
15
|
+
* Maps size keys to Tailwind text size classes.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TOAST_FONT_CLASS: Record<Size, string>;
|
|
18
|
+
/**
|
|
19
|
+
* CSS classes for toast title font size.
|
|
20
|
+
* Maps size keys to Tailwind text size and weight classes.
|
|
21
|
+
*/
|
|
22
|
+
export declare const TOAST_TITLE_FONT_CLASS: Record<Size, string>;
|
|
23
|
+
/**
|
|
24
|
+
* CSS classes for toast enter and exit animations.
|
|
25
|
+
* Each placement has its own enter and exit animation classes.
|
|
26
|
+
* These classes should be defined in your global CSS with keyframe animations.
|
|
27
|
+
*/
|
|
6
28
|
export declare const TOAST_ANIMATION_STATE: Record<ToastPlacement, {
|
|
7
29
|
enter: string;
|
|
8
30
|
exit: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-styles.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"toast-styles.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIlD,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,sBAAsB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,cAAc,EACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA0BhC,CAAC"}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that creates a pausable timeout.
|
|
3
|
+
*
|
|
4
|
+
* usePausableTimeout returns pause and resume functions that control
|
|
5
|
+
* a timeout callback. This is useful for scenarios like toast notifications
|
|
6
|
+
* where the auto-dismiss timer should pause when the user hovers over the
|
|
7
|
+
* element and resume when they leave.
|
|
8
|
+
*
|
|
9
|
+
* @param callback - The function to call when the timeout completes.
|
|
10
|
+
* @param delay - The delay in milliseconds before the callback is called.
|
|
11
|
+
* If 0 or negative, the timeout is disabled.
|
|
12
|
+
* @returns An object with pause and resume functions.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { pause, resume } = usePausableTimeout(() => {
|
|
17
|
+
* console.log('Timeout completed!');
|
|
18
|
+
* }, 3000);
|
|
19
|
+
*
|
|
20
|
+
* return (
|
|
21
|
+
* <div
|
|
22
|
+
* onMouseEnter={pause}
|
|
23
|
+
* onMouseLeave={resume}
|
|
24
|
+
* >
|
|
25
|
+
* Hover to pause the timeout
|
|
26
|
+
* </div>
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
1
30
|
export declare function usePausableTimeout(callback: () => void, delay?: number): {
|
|
2
31
|
pause: () => void;
|
|
3
32
|
resume: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pausable-timeout.d.ts","sourceRoot":"","sources":["../../../src/components/toast/use-pausable-timeout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-pausable-timeout.d.ts","sourceRoot":"","sources":["../../../src/components/toast/use-pausable-timeout.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM;;;EA8BtE"}
|
|
@@ -1,23 +1,83 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { TooltipConfig } from './tooltip-config';
|
|
3
|
+
type BaseTooltipProps = TooltipConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the Tooltip component.
|
|
6
|
+
*/
|
|
7
|
+
export interface TooltipProps extends BaseTooltipProps {
|
|
8
|
+
/**
|
|
9
|
+
* The content to display inside the tooltip.
|
|
10
|
+
* When empty or null, the tooltip is not shown.
|
|
11
|
+
*/
|
|
6
12
|
content: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The child element that triggers the tooltip.
|
|
15
|
+
* Can be any React element or a string.
|
|
16
|
+
*/
|
|
7
17
|
children: ReactElement | ReactNode;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
close?: number;
|
|
15
|
-
};
|
|
16
|
-
offset?: number;
|
|
17
|
-
radius?: Radius;
|
|
18
|
-
showArrow?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the tooltip is disabled.
|
|
20
|
+
* When true, the tooltip does not appear on hover or focus.
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
19
24
|
isDisabled?: boolean;
|
|
20
|
-
className?: string;
|
|
21
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* A floating tooltip that appears on hover or focus of a child element.
|
|
28
|
+
*
|
|
29
|
+
* Tooltip renders a floating popup with additional information that appears
|
|
30
|
+
* when the user hovers or focuses the trigger element. It supports configurable
|
|
31
|
+
* placement, delay, offset, radius, arrow, and styling through the standard
|
|
32
|
+
* AsheeUI cascade system.
|
|
33
|
+
*
|
|
34
|
+
* The component uses Floating UI for positioning and accessibility, and
|
|
35
|
+
* automatically handles viewport edge detection and flipping. It is fully
|
|
36
|
+
* accessible with keyboard focus support.
|
|
37
|
+
*
|
|
38
|
+
* @param props - Tooltip configuration options.
|
|
39
|
+
* @param props.content - The content to display inside the tooltip.
|
|
40
|
+
* @param props.children - The child element that triggers the tooltip.
|
|
41
|
+
* @param props.isDisabled - Whether the tooltip is disabled. Defaults to false.
|
|
42
|
+
* @param props.variant - Visual style variant. Defaults to "solid".
|
|
43
|
+
* @param props.color - Theme accent color. Defaults to "secondary".
|
|
44
|
+
* @param props.size - Size scale. Defaults to "md".
|
|
45
|
+
* @param props.placement - Placement relative to the trigger. Defaults to "top".
|
|
46
|
+
* @param props.delay - Delay before showing/hiding. Defaults to 200.
|
|
47
|
+
* @param props.offset - Offset from the trigger. Defaults to 8.
|
|
48
|
+
* @param props.radius - Corner rounding. Defaults to "md".
|
|
49
|
+
* @param props.showArrow - Whether to show a pointer arrow. Defaults to false.
|
|
50
|
+
* @param props.className - Extra classes for the tooltip.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* import { Tooltip, Button } from "asheeui";
|
|
55
|
+
*
|
|
56
|
+
* export function Example() {
|
|
57
|
+
* return (
|
|
58
|
+
* <Tooltip content="This is a tooltip">
|
|
59
|
+
* <Button>Hover me</Button>
|
|
60
|
+
* </Tooltip>
|
|
61
|
+
* );
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* // With custom placement and arrow
|
|
68
|
+
* <Tooltip
|
|
69
|
+
* content="Delete this item"
|
|
70
|
+
* placement="bottom"
|
|
71
|
+
* showArrow
|
|
72
|
+
* color="danger"
|
|
73
|
+
* >
|
|
74
|
+
* <TrashIcon />
|
|
75
|
+
* </Tooltip>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @see TooltipConfig - The configuration type for component defaults.
|
|
79
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
80
|
+
*/
|
|
22
81
|
export declare const Tooltip: import('react').ForwardRefExoticComponent<TooltipProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
82
|
+
export {};
|
|
23
83
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAcf,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,kBAAkB,CAAC;AAO1B,KAAK,gBAAgB,GAAG,aAAa,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IAEnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,OAAO,yGAyMnB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, Fragment as
|
|
2
|
+
import { jsx as a, Fragment as S, jsxs as h } from "react/jsx-runtime";
|
|
3
3
|
import { offset as J, flip as Q, shift as W, arrow as Z, useFloating as $, autoUpdate as ee, useHover as se, useFocus as oe, useDismiss as re, useRole as te, useInteractions as ae, FloatingPortal as le, FloatingArrow as ne } from "@floating-ui/react";
|
|
4
4
|
import { forwardRef as de, useRef as ie, useState as me, isValidElement as pe, cloneElement as ce } from "react";
|
|
5
5
|
import { useAsheeConfig as ue } from "../../libs/context.js";
|
|
6
|
-
import {
|
|
7
|
-
import { resolveVariantClass as ve } from "../../shared/variant.js";
|
|
8
|
-
import { resolveCascade as o, resolveRadiusKey as we, resolveClassKey as i } from "../../utils/resolve-token.js";
|
|
6
|
+
import { resolveCascade as o, resolveRadiusKey as fe, resolveClassKey as i } from "../../utils/resolve-token.js";
|
|
9
7
|
import { FALLBACK_TOOLTIP_CONFIG as s } from "./tooltip-config.js";
|
|
10
|
-
import { TOOLTIP_PADDING_X_CLASS as
|
|
11
|
-
import {
|
|
8
|
+
import { TOOLTIP_PADDING_X_CLASS as ve, TOOLTIP_PADDING_Y_CLASS as we, TOOLTIP_FONT_CLASS as ye } from "./tooltip-styles.js";
|
|
9
|
+
import { RADIUS_CLASS as Ae } from "../../shared/radius.js";
|
|
10
|
+
import { cn as Oe } from "../../utils/cn.js";
|
|
11
|
+
import { resolveVariantClass as Se } from "../../shared/variant.js";
|
|
12
12
|
const he = de(
|
|
13
13
|
({
|
|
14
14
|
content: u,
|
|
@@ -24,13 +24,13 @@ const he = de(
|
|
|
24
24
|
isDisabled: l = !1,
|
|
25
25
|
className: z
|
|
26
26
|
}, n) => {
|
|
27
|
-
var
|
|
28
|
-
const d = ue(), e = (
|
|
27
|
+
var O;
|
|
28
|
+
const d = ue(), e = (O = d.components) == null ? void 0 : O.tooltip, f = ie(null), [v, K] = me(!1), m = o(
|
|
29
29
|
_,
|
|
30
30
|
e == null ? void 0 : e.size,
|
|
31
31
|
void 0,
|
|
32
32
|
s.size
|
|
33
|
-
),
|
|
33
|
+
), x = o(
|
|
34
34
|
F,
|
|
35
35
|
e == null ? void 0 : e.placement,
|
|
36
36
|
void 0,
|
|
@@ -55,50 +55,50 @@ const he = de(
|
|
|
55
55
|
e == null ? void 0 : e.showArrow,
|
|
56
56
|
void 0,
|
|
57
57
|
s.showArrow
|
|
58
|
-
), E =
|
|
58
|
+
), E = fe(
|
|
59
59
|
N,
|
|
60
60
|
e == null ? void 0 : e.radius,
|
|
61
61
|
d.defaultRadius,
|
|
62
62
|
s.radius
|
|
63
63
|
), G = i(
|
|
64
64
|
m,
|
|
65
|
-
|
|
65
|
+
ve,
|
|
66
66
|
s.size
|
|
67
67
|
), j = i(
|
|
68
68
|
m,
|
|
69
|
-
|
|
69
|
+
we,
|
|
70
70
|
s.size
|
|
71
71
|
), U = i(
|
|
72
72
|
m,
|
|
73
|
-
|
|
73
|
+
ye,
|
|
74
74
|
s.size
|
|
75
75
|
), X = i(
|
|
76
76
|
E,
|
|
77
|
-
|
|
77
|
+
Ae,
|
|
78
78
|
s.radius
|
|
79
|
-
),
|
|
79
|
+
), y = [
|
|
80
80
|
J(g),
|
|
81
81
|
Q({ padding: 8 }),
|
|
82
82
|
W({ padding: 8 })
|
|
83
83
|
];
|
|
84
|
-
w &&
|
|
84
|
+
w && y.push(Z({ element: f }));
|
|
85
85
|
const { refs: p, floatingStyles: Y, context: t } = $({
|
|
86
86
|
open: v && !l,
|
|
87
|
-
onOpenChange:
|
|
88
|
-
placement:
|
|
87
|
+
onOpenChange: K,
|
|
88
|
+
placement: x,
|
|
89
89
|
whileElementsMounted: ee,
|
|
90
|
-
middleware:
|
|
90
|
+
middleware: y
|
|
91
91
|
}), k = se(t, {
|
|
92
92
|
delay: b,
|
|
93
93
|
enabled: !l
|
|
94
|
-
}), B = oe(t, { enabled: !l }), H = re(t), M = te(t, { role: "tooltip" }), { getReferenceProps:
|
|
94
|
+
}), B = oe(t, { enabled: !l }), H = re(t), M = te(t, { role: "tooltip" }), { getReferenceProps: A, getFloatingProps: q } = ae([
|
|
95
95
|
k,
|
|
96
96
|
B,
|
|
97
97
|
H,
|
|
98
98
|
M
|
|
99
99
|
]), C = pe(r) ? ce(
|
|
100
100
|
r,
|
|
101
|
-
|
|
101
|
+
A({
|
|
102
102
|
ref: p.setReference,
|
|
103
103
|
...r.props
|
|
104
104
|
})
|
|
@@ -106,12 +106,12 @@ const he = de(
|
|
|
106
106
|
"span",
|
|
107
107
|
{
|
|
108
108
|
ref: p.setReference,
|
|
109
|
-
...
|
|
109
|
+
...A(),
|
|
110
110
|
className: "inline-flex",
|
|
111
111
|
children: r
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
|
-
return !u || l ? /* @__PURE__ */ a(
|
|
114
|
+
return !u || l ? /* @__PURE__ */ a(S, { children: r }) : /* @__PURE__ */ h(S, { children: [
|
|
115
115
|
C,
|
|
116
116
|
/* @__PURE__ */ a(le, { children: v && /* @__PURE__ */ a(
|
|
117
117
|
"div",
|
|
@@ -125,13 +125,13 @@ const he = de(
|
|
|
125
125
|
children: /* @__PURE__ */ h(
|
|
126
126
|
"div",
|
|
127
127
|
{
|
|
128
|
-
className:
|
|
128
|
+
className: Oe(
|
|
129
129
|
"font-medium border whitespace-nowrap select-none bg-background shadow-md transition-all duration-150 ease-out animate-in fade-in-0 zoom-in-95",
|
|
130
130
|
G,
|
|
131
131
|
j,
|
|
132
132
|
U,
|
|
133
133
|
X,
|
|
134
|
-
|
|
134
|
+
Se(D, V),
|
|
135
135
|
e == null ? void 0 : e.className,
|
|
136
136
|
z
|
|
137
137
|
),
|