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":"tabs-styles.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tabs-styles.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIrD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIhD,CAAC"}
|
|
@@ -1,21 +1,115 @@
|
|
|
1
1
|
import { default as React, TextareaHTMLAttributes } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { TextAreaConfig } from './textarea-config';
|
|
3
|
+
type BaseTextAreaProps = TextAreaConfig & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "color" | "children">;
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the TextArea component.
|
|
6
|
+
*/
|
|
7
|
+
export interface TextAreaProps extends BaseTextAreaProps {
|
|
8
|
+
/**
|
|
9
|
+
* Label text for the textarea.
|
|
10
|
+
* Displayed above the input field.
|
|
11
|
+
*/
|
|
11
12
|
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the textarea is in a loading state.
|
|
15
|
+
* Shows a loading spinner next to the label.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
12
19
|
isLoading?: boolean;
|
|
13
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Description text shown below the label.
|
|
22
|
+
* Provides additional context about the textarea.
|
|
23
|
+
*/
|
|
14
24
|
description?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Validation message shown below the textarea.
|
|
27
|
+
* Color is determined by the status prop.
|
|
28
|
+
*/
|
|
15
29
|
message?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the field is required.
|
|
32
|
+
* Adds a required indicator (*) to the label.
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
16
36
|
required?: boolean;
|
|
17
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Whether the virtual keyboard should be enabled for mobile devices.
|
|
39
|
+
* Controls the inputmode attribute.
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
18
43
|
enableVirtualKeyboard?: boolean;
|
|
19
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* A multi-line text input with label, description, validation message,
|
|
47
|
+
* and virtual keyboard support.
|
|
48
|
+
*
|
|
49
|
+
* TextArea renders a textarea with consistent styling and field layout.
|
|
50
|
+
* It supports validation states, loading state, configurable rows, and
|
|
51
|
+
* the standard AsheeUI cascade for visual tokens. The component integrates
|
|
52
|
+
* with FieldShell for label, description, and message handling.
|
|
53
|
+
*
|
|
54
|
+
* The component automatically handles accessibility attributes including
|
|
55
|
+
* aria-invalid, aria-describedby, and proper focus management. It also
|
|
56
|
+
* supports mobile virtual keyboard control via the enableVirtualKeyboard prop.
|
|
57
|
+
*
|
|
58
|
+
* @param props - TextArea configuration options and native textarea props.
|
|
59
|
+
* @param props.label - Label text for the textarea.
|
|
60
|
+
* @param props.isLoading - Loading state. Defaults to false.
|
|
61
|
+
* @param props.description - Description text.
|
|
62
|
+
* @param props.message - Validation message.
|
|
63
|
+
* @param props.required - Whether the field is required. Defaults to false.
|
|
64
|
+
* @param props.enableVirtualKeyboard - Enable mobile virtual keyboard. Defaults to true.
|
|
65
|
+
* @param props.rows - Number of visible text rows. Defaults to 4.
|
|
66
|
+
* @param props.size - Size of the textarea. Defaults to "md".
|
|
67
|
+
* @param props.radius - Corner rounding. Defaults to "md".
|
|
68
|
+
* @param props.variant - Visual style variant. Defaults to "bordered".
|
|
69
|
+
* @param props.color - Theme accent color. Defaults to "primary".
|
|
70
|
+
* @param props.status - Validation status.
|
|
71
|
+
* @param props.labelAlign - Alignment of the label. Defaults to "left".
|
|
72
|
+
* @param props.disabled - Whether the textarea is disabled.
|
|
73
|
+
* @param props.className - Extra CSS classes for the textarea.
|
|
74
|
+
* @param props.id - Optional ID for the field.
|
|
75
|
+
* @param props.style - Inline styles for the textarea.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* import { TextArea } from "asheeui";
|
|
80
|
+
* import { useState } from "react";
|
|
81
|
+
*
|
|
82
|
+
* export function Example() {
|
|
83
|
+
* const [value, setValue] = useState("");
|
|
84
|
+
*
|
|
85
|
+
* return (
|
|
86
|
+
* <TextArea
|
|
87
|
+
* label="Message"
|
|
88
|
+
* description="Write your message here"
|
|
89
|
+
* placeholder="Type your message..."
|
|
90
|
+
* value={value}
|
|
91
|
+
* onChange={(e) => setValue(e.target.value)}
|
|
92
|
+
* rows={6}
|
|
93
|
+
* />
|
|
94
|
+
* );
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* // With validation state
|
|
101
|
+
* <TextArea
|
|
102
|
+
* label="Feedback"
|
|
103
|
+
* status="error"
|
|
104
|
+
* message="Feedback must be at least 10 characters"
|
|
105
|
+
* required
|
|
106
|
+
* />
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @see TextAreaConfig - The configuration type for component defaults.
|
|
110
|
+
* @see FieldShell - The wrapper component for label and validation.
|
|
111
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
112
|
+
*/
|
|
20
113
|
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
114
|
+
export {};
|
|
21
115
|
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/Textarea.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/Textarea.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAEZ,KAAK,sBAAsB,EAK5B,MAAM,OAAO,CAAC;AAkBf,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAQ3B,KAAK,iBAAiB,GAAG,cAAc,GACrC,IAAI,CACF,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,UAAU,CAC9B,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,eAAO,MAAM,QAAQ,2FA4KpB,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as W, useRef as Y, useImperativeHandle as g, useId as q, useCallback as
|
|
3
|
+
import { forwardRef as W, useRef as Y, useImperativeHandle as g, useId as q, useCallback as K } from "react";
|
|
4
4
|
import { useAsheeConfig as ee } from "../../libs/context.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { resolveCascade as o, resolveRadiusKey as ae, resolveClassKey as oe } from "../../utils/resolve-token.js";
|
|
8
|
-
import { FieldShell as le } from "../field/FieldShell.js";
|
|
5
|
+
import { resolveCascade as o, resolveRadiusKey as re, resolveClassKey as se } from "../../utils/resolve-token.js";
|
|
6
|
+
import { FieldShell as ae } from "../field/FieldShell.js";
|
|
9
7
|
import { FALLBACK_TEXTAREA_CONFIG as r } from "./textarea-config.js";
|
|
10
|
-
import { TEXTAREA_STATUS_BORDER_CLASS as
|
|
11
|
-
import { useKeyboardField as
|
|
8
|
+
import { TEXTAREA_STATUS_BORDER_CLASS as oe, TEXTAREA_SIZE_CLASS as le } from "./textarea-styles.js";
|
|
9
|
+
import { useKeyboardField as te } from "../keyboard/use-keyboard-field.js";
|
|
10
|
+
import { resolveVariantClass as de } from "../../shared/variant.js";
|
|
11
|
+
import { RADIUS_CLASS as ie } from "../../shared/radius.js";
|
|
12
12
|
import { cn as ne } from "../../utils/cn.js";
|
|
13
13
|
const ue = W(
|
|
14
14
|
({
|
|
15
|
-
size:
|
|
16
|
-
radius:
|
|
17
|
-
variant:
|
|
18
|
-
color:
|
|
15
|
+
size: T,
|
|
16
|
+
radius: I,
|
|
17
|
+
variant: x,
|
|
18
|
+
color: E,
|
|
19
19
|
status: _,
|
|
20
20
|
label: w,
|
|
21
21
|
labelAlign: L,
|
|
@@ -36,34 +36,34 @@ const ue = W(
|
|
|
36
36
|
var S;
|
|
37
37
|
const d = ee(), e = (S = d.components) == null ? void 0 : S.textarea, n = Y(null);
|
|
38
38
|
g(k, () => n.current);
|
|
39
|
-
const D = q(), a = C ?? D, f = u ? `${a}-description` : void 0, A = c ? `${a}-message` : void 0, O = [f, A].filter(Boolean).join(" ") || void 0, { handleFocus: p, handleBlur: b } =
|
|
39
|
+
const D = q(), a = C ?? D, f = u ? `${a}-description` : void 0, A = c ? `${a}-message` : void 0, O = [f, A].filter(Boolean).join(" ") || void 0, { handleFocus: p, handleBlur: b } = te(a, n, X), U = K(
|
|
40
40
|
(s) => {
|
|
41
41
|
p(s), l == null || l(s);
|
|
42
42
|
},
|
|
43
43
|
[p, l]
|
|
44
|
-
), V =
|
|
44
|
+
), V = K(
|
|
45
45
|
(s) => {
|
|
46
46
|
b(), t == null || t(s);
|
|
47
47
|
},
|
|
48
48
|
[b, t]
|
|
49
49
|
), $ = o(
|
|
50
|
-
|
|
50
|
+
T,
|
|
51
51
|
e == null ? void 0 : e.size,
|
|
52
52
|
void 0,
|
|
53
53
|
r.size
|
|
54
|
-
),
|
|
55
|
-
|
|
54
|
+
), y = o(
|
|
55
|
+
x,
|
|
56
56
|
e == null ? void 0 : e.variant,
|
|
57
57
|
d.defaultVariant,
|
|
58
58
|
r.variant
|
|
59
59
|
), G = o(
|
|
60
|
-
|
|
60
|
+
E,
|
|
61
61
|
e == null ? void 0 : e.color,
|
|
62
62
|
d.defaultColor,
|
|
63
63
|
r.color
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
), R = (s) => s === "full" ? "xl" : s, H = re(
|
|
65
|
+
R(I),
|
|
66
|
+
R(e == null ? void 0 : e.radius),
|
|
67
67
|
d.defaultRadius,
|
|
68
68
|
r.radius
|
|
69
69
|
), i = _ ?? r.status, Z = o(
|
|
@@ -76,13 +76,16 @@ const ue = W(
|
|
|
76
76
|
e == null ? void 0 : e.rows,
|
|
77
77
|
void 0,
|
|
78
78
|
r.rows
|
|
79
|
-
), M =
|
|
79
|
+
), M = de(
|
|
80
|
+
y,
|
|
81
|
+
G
|
|
82
|
+
), P = i !== "default" ? oe[i] : "", Q = y === "underlined" ? "rounded-none" : se(
|
|
80
83
|
H,
|
|
81
|
-
|
|
84
|
+
ie,
|
|
82
85
|
r.radius
|
|
83
86
|
);
|
|
84
87
|
return /* @__PURE__ */ h(
|
|
85
|
-
|
|
88
|
+
ae,
|
|
86
89
|
{
|
|
87
90
|
id: a,
|
|
88
91
|
label: w,
|
|
@@ -111,7 +114,7 @@ const ue = W(
|
|
|
111
114
|
"resize-y w-full text-foreground outline-none transition-colors shrink-0",
|
|
112
115
|
"focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
113
116
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
114
|
-
|
|
117
|
+
le[$],
|
|
115
118
|
M,
|
|
116
119
|
P,
|
|
117
120
|
Q,
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { FieldConfig } from '../field/field-config';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the TextArea component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.textarea` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level fallback tier of the theme cascade.
|
|
7
|
+
*/
|
|
2
8
|
export interface TextAreaConfig extends FieldConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Default number of visible text rows.
|
|
11
|
+
* Controls the initial height of the textarea.
|
|
12
|
+
*
|
|
13
|
+
* @default 4
|
|
14
|
+
*/
|
|
3
15
|
rows?: number;
|
|
4
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Default config values registered for the TextArea component.
|
|
19
|
+
* Inherits field defaults and sets default rows to 4.
|
|
20
|
+
*/
|
|
5
21
|
export declare const defaultTextAreaConfig: TextAreaConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Hard fallback values used when no config tier provides a value.
|
|
24
|
+
* These values are used when instance props, component config,
|
|
25
|
+
* and global defaults are all undefined.
|
|
26
|
+
*/
|
|
6
27
|
export declare const FALLBACK_TEXTAREA_CONFIG: Required<TextAreaConfig>;
|
|
7
28
|
declare module "../../libs/registry" {
|
|
8
29
|
interface ComponentTypeConfigRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-config.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textarea-config.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;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"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
labelAlign: "left",
|
|
7
|
-
variant: "bordered",
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as t, defaultFieldConfig as o } from "../field/field-config.js";
|
|
4
|
+
const r = {
|
|
5
|
+
...o,
|
|
8
6
|
rows: 4
|
|
9
|
-
},
|
|
10
|
-
...
|
|
11
|
-
size: "md",
|
|
12
|
-
radius: "md",
|
|
13
|
-
variant: "bordered",
|
|
14
|
-
color: "primary",
|
|
15
|
-
status: "default",
|
|
16
|
-
labelAlign: "left",
|
|
7
|
+
}, n = {
|
|
8
|
+
...t,
|
|
17
9
|
rows: 4
|
|
18
10
|
};
|
|
19
|
-
e("textarea",
|
|
11
|
+
e("textarea", r);
|
|
20
12
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
n as FALLBACK_TEXTAREA_CONFIG,
|
|
14
|
+
r as defaultTextAreaConfig
|
|
23
15
|
};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { FieldSizeKey, FieldStatus } from '../field/field-config';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for textarea padding and font size.
|
|
4
|
+
* Maps size keys to Tailwind padding and text size classes.
|
|
5
|
+
*/
|
|
2
6
|
export declare const TEXTAREA_SIZE_CLASS: Record<FieldSizeKey, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for textarea status border styles.
|
|
9
|
+
* Maps status values to Tailwind classes for border and
|
|
10
|
+
* focus ring colors. Re-exports FIELD_STATUS_BORDER_CLASS.
|
|
11
|
+
*/
|
|
3
12
|
export declare const TEXTAREA_STATUS_BORDER_CLASS: Record<FieldStatus, string>;
|
|
4
13
|
//# sourceMappingURL=textarea-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-styles.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"textarea-styles.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGvE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAI5D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAC1C,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { FIELD_STATUS_BORDER_CLASS as t } from "../field/field-styles.js";
|
|
3
|
+
const A = {
|
|
3
4
|
sm: "p-2 text-xs",
|
|
4
5
|
md: "p-3 text-sm",
|
|
5
6
|
lg: "p-4 text-base"
|
|
6
|
-
},
|
|
7
|
-
default: "",
|
|
8
|
-
error: "border-danger focus-visible:border-danger focus-visible:ring-danger/20",
|
|
9
|
-
warning: "border-warning focus-visible:border-warning focus-visible:ring-warning/20",
|
|
10
|
-
success: "border-success focus-visible:border-success focus-visible:ring-success/20"
|
|
11
|
-
};
|
|
7
|
+
}, E = t;
|
|
12
8
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
A as TEXTAREA_SIZE_CLASS,
|
|
10
|
+
E as TEXTAREA_STATUS_BORDER_CLASS
|
|
15
11
|
};
|
|
@@ -1,15 +1,69 @@
|
|
|
1
|
-
import { Radius } from '../../shared
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Color, Radius, Size, Variant } from '../../shared';
|
|
2
|
+
import { ToastItemData, ToastPlacement } from './toast-config';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the ToastItem component.
|
|
5
|
+
* Extends ToastItemData with additional configuration and callbacks.
|
|
6
|
+
*/
|
|
4
7
|
export interface ToastItemProps extends ToastItemData {
|
|
8
|
+
/**
|
|
9
|
+
* Callback fired when the toast should be dismissed.
|
|
10
|
+
*/
|
|
5
11
|
onDismiss: (id: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Placement of the toast container.
|
|
14
|
+
* Determines the animation direction.
|
|
15
|
+
*/
|
|
6
16
|
placement: ToastPlacement;
|
|
7
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Size scale of the toast.
|
|
19
|
+
*/
|
|
20
|
+
size: Size;
|
|
21
|
+
/**
|
|
22
|
+
* Visual style variant of the toast.
|
|
23
|
+
*/
|
|
8
24
|
variant: Variant;
|
|
25
|
+
/**
|
|
26
|
+
* Theme color of the toast.
|
|
27
|
+
* Overrides the auto-detected color from the type.
|
|
28
|
+
*/
|
|
9
29
|
color?: Color;
|
|
30
|
+
/**
|
|
31
|
+
* Corner rounding of the toast.
|
|
32
|
+
*/
|
|
10
33
|
radius: Radius;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the toast has animations.
|
|
36
|
+
*/
|
|
11
37
|
animated?: boolean;
|
|
12
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* A single toast notification item.
|
|
41
|
+
*
|
|
42
|
+
* ToastItem renders a toast notification with icon, title, message,
|
|
43
|
+
* optional action, and dismiss button. It supports pause on hover,
|
|
44
|
+
* enter/exit animations, and configurable styling. The component uses
|
|
45
|
+
* the usePausableTimeout hook to pause auto-dismissal during hover.
|
|
46
|
+
*
|
|
47
|
+
* @param props - ToastItem configuration options.
|
|
48
|
+
* @param props.id - Unique identifier for the toast.
|
|
49
|
+
* @param props.title - Optional title text.
|
|
50
|
+
* @param props.message - The main message content.
|
|
51
|
+
* @param props.type - Type of toast. Defaults to "info".
|
|
52
|
+
* @param props.timeout - Duration before auto-dismissal. Defaults to 3500.
|
|
53
|
+
* @param props.icon - Custom icon element.
|
|
54
|
+
* @param props.action - Action element rendered below the message.
|
|
55
|
+
* @param props.dismissible - Whether the toast can be dismissed. Defaults to true.
|
|
56
|
+
* @param props.onDismiss - Callback fired when the toast is dismissed.
|
|
57
|
+
* @param props.placement - Placement of the toast container.
|
|
58
|
+
* @param props.size - Size scale of the toast.
|
|
59
|
+
* @param props.variant - Visual style variant.
|
|
60
|
+
* @param props.color - Theme color override.
|
|
61
|
+
* @param props.radius - Corner rounding.
|
|
62
|
+
* @param props.animated - Whether the toast has animations.
|
|
63
|
+
*
|
|
64
|
+
* @see ToastItemData - The data structure for toast notifications.
|
|
65
|
+
* @see usePausableTimeout - Hook for pausing auto-dismissal.
|
|
66
|
+
*/
|
|
13
67
|
export declare function ToastItem({ id, title, message, type, timeout, icon, action, dismissible, onDismiss, placement, size, variant, color, radius, animated, }: ToastItemProps): import("react").JSX.Element;
|
|
14
68
|
export declare namespace ToastItem {
|
|
15
69
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastItem.d.ts","sourceRoot":"","sources":["../../../src/components/toast/ToastItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToastItem.d.ts","sourceRoot":"","sources":["../../../src/components/toast/ToastItem.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,MAAM,EAEX,KAAK,IAAI,EACT,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,cAAc,EAEpB,MAAM,gBAAgB,CAAC;AA0DxB;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC;;;OAGG;IACH,SAAS,EAAE,cAAc,CAAC;IAE1B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,KAAK,EACL,OAAO,EACP,IAAa,EACb,OAAc,EACd,IAAI,EACJ,MAAM,EACN,WAAkB,EAClB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,cAAc,+BAyHhB;yBAzIe,SAAS"}
|
|
@@ -7,13 +7,13 @@ import { ErrorIcon as z } from "../../icons/ErrorIcon.js";
|
|
|
7
7
|
import { InfoIcon as B } from "../../icons/InfoIcon.js";
|
|
8
8
|
import { WarningIcon as H } from "../../icons/WarningIcon.js";
|
|
9
9
|
import { useAsheeConfig as R } from "../../libs/context.js";
|
|
10
|
-
import {
|
|
11
|
-
import { resolveVariantClass as V } from "../../shared/variant.js";
|
|
12
|
-
import { resolveCascade as q, resolveClassKey as a } from "../../utils/resolve-token.js";
|
|
10
|
+
import { resolveCascade as U, resolveClassKey as a } from "../../utils/resolve-token.js";
|
|
13
11
|
import { FALLBACK_TOAST_CONFIG as n } from "./toast-config.js";
|
|
14
|
-
import { TOAST_WIDTH_CLASS as
|
|
15
|
-
import { usePausableTimeout as
|
|
12
|
+
import { TOAST_WIDTH_CLASS as V, TOAST_PADDING_CLASS as q, TOAST_FONT_CLASS as J, TOAST_TITLE_FONT_CLASS as Q, TOAST_ANIMATION_STATE as X } from "./toast-styles.js";
|
|
13
|
+
import { usePausableTimeout as Y } from "./use-pausable-timeout.js";
|
|
14
|
+
import { RADIUS_CLASS as Z } from "../../shared/radius.js";
|
|
16
15
|
import { cn as s } from "../../utils/cn.js";
|
|
16
|
+
import { resolveVariantClass as $ } from "../../shared/variant.js";
|
|
17
17
|
function ee(r = "info") {
|
|
18
18
|
switch (r) {
|
|
19
19
|
case "success":
|
|
@@ -53,14 +53,14 @@ function te({
|
|
|
53
53
|
onDismiss: c,
|
|
54
54
|
placement: x,
|
|
55
55
|
size: i,
|
|
56
|
-
variant:
|
|
56
|
+
variant: p,
|
|
57
57
|
color: I,
|
|
58
58
|
radius: S,
|
|
59
|
-
animated:
|
|
59
|
+
animated: d
|
|
60
60
|
}) {
|
|
61
61
|
var h;
|
|
62
|
-
const l = (h = R().components) == null ? void 0 : h.toast, [m, b] = G(!1), g =
|
|
63
|
-
|
|
62
|
+
const l = (h = R().components) == null ? void 0 : h.toast, [m, b] = G(!1), g = U(
|
|
63
|
+
d,
|
|
64
64
|
l == null ? void 0 : l.animated,
|
|
65
65
|
void 0,
|
|
66
66
|
n.animated
|
|
@@ -68,40 +68,40 @@ function te({
|
|
|
68
68
|
g && !m ? (b(!0), setTimeout(() => {
|
|
69
69
|
c(r);
|
|
70
70
|
}, 150)) : c(r);
|
|
71
|
-
}, [g, m, c, r]), { pause: _, resume: k } =
|
|
71
|
+
}, [g, m, c, r]), { pause: _, resume: k } = Y(w, v), O = I ?? ee(u), y = p === "solid", L = a(
|
|
72
72
|
i,
|
|
73
|
-
|
|
73
|
+
V,
|
|
74
74
|
n.size
|
|
75
75
|
), E = a(
|
|
76
76
|
i,
|
|
77
|
-
|
|
77
|
+
q,
|
|
78
78
|
n.size
|
|
79
79
|
), F = a(
|
|
80
80
|
i,
|
|
81
|
-
|
|
81
|
+
J,
|
|
82
82
|
n.size
|
|
83
83
|
), D = a(
|
|
84
84
|
i,
|
|
85
|
-
|
|
85
|
+
Q,
|
|
86
86
|
n.size
|
|
87
87
|
), M = a(
|
|
88
88
|
S,
|
|
89
|
-
|
|
89
|
+
Z,
|
|
90
90
|
n.radius
|
|
91
|
-
), T =
|
|
91
|
+
), T = X[x], j = d ? m ? T.exit : T.enter : "";
|
|
92
92
|
return /* @__PURE__ */ C(
|
|
93
93
|
"div",
|
|
94
94
|
{
|
|
95
95
|
onMouseEnter: _,
|
|
96
96
|
onMouseLeave: k,
|
|
97
97
|
className: s(
|
|
98
|
-
"pointer-events-auto relative flex gap-3 items-start shadow-lg border backdrop-blur-md select-none overflow-
|
|
98
|
+
"pointer-events-auto relative flex gap-3 items-start shadow-lg border backdrop-blur-md select-none overflow-clip transition-all duration-200 active:scale-[0.99]",
|
|
99
99
|
"bg-background",
|
|
100
100
|
L,
|
|
101
101
|
E,
|
|
102
102
|
M,
|
|
103
103
|
j,
|
|
104
|
-
|
|
104
|
+
$(p, O)
|
|
105
105
|
),
|
|
106
106
|
children: [
|
|
107
107
|
/* @__PURE__ */ e("div", { className: "shrink-0 pt-0.5 ps-1", children: A ?? re(u, y) }),
|
|
@@ -1,32 +1,130 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Radius } from '../../shared
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Radius, Size, Variant } from '../../shared';
|
|
3
|
+
/**
|
|
4
|
+
* Type of toast notification.
|
|
5
|
+
* Determines the icon and color styling.
|
|
6
|
+
*/
|
|
5
7
|
export type ToastType = "success" | "error" | "info" | "warning" | "default";
|
|
8
|
+
/**
|
|
9
|
+
* Placement of the toast container on the screen.
|
|
10
|
+
* Controls where toasts appear and animate from.
|
|
11
|
+
*/
|
|
6
12
|
export type ToastPlacement = "top-right" | "top-left" | "bottom-right" | "bottom-left" | "top-center" | "bottom-center";
|
|
7
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Data structure for a single toast notification.
|
|
15
|
+
*/
|
|
8
16
|
export interface ToastItemData {
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier for the toast.
|
|
19
|
+
*/
|
|
9
20
|
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional title text.
|
|
23
|
+
* Displayed above the message in bold.
|
|
24
|
+
*/
|
|
10
25
|
title?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The main message content.
|
|
28
|
+
*/
|
|
11
29
|
message: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Type of toast.
|
|
32
|
+
* Controls icon and color styling.
|
|
33
|
+
*
|
|
34
|
+
* @default "info"
|
|
35
|
+
*/
|
|
12
36
|
type?: ToastType;
|
|
37
|
+
/**
|
|
38
|
+
* Duration in milliseconds before auto-dismissal.
|
|
39
|
+
* Set to 0 or negative to disable auto-dismiss.
|
|
40
|
+
*
|
|
41
|
+
* @default 3500
|
|
42
|
+
*/
|
|
13
43
|
timeout?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Custom icon element.
|
|
46
|
+
* Overrides the default icon for the toast type.
|
|
47
|
+
*/
|
|
14
48
|
icon?: ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Action element rendered below the message.
|
|
51
|
+
* Typically a button for user interaction.
|
|
52
|
+
*/
|
|
15
53
|
action?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the toast can be dismissed by the user.
|
|
56
|
+
* When true, shows a close button.
|
|
57
|
+
*
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
16
60
|
dismissible?: boolean;
|
|
17
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Theme configuration options for the Toast system.
|
|
64
|
+
*
|
|
65
|
+
* Set under `components.toast` in the AsheeUI config. Values feed the
|
|
66
|
+
* component-level fallback tier of the theme cascade.
|
|
67
|
+
*/
|
|
18
68
|
export interface ToastConfig {
|
|
19
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Size scale of toast notifications.
|
|
71
|
+
* Controls the width and padding of toasts.
|
|
72
|
+
*
|
|
73
|
+
* @default "md"
|
|
74
|
+
*/
|
|
75
|
+
size?: Size;
|
|
76
|
+
/**
|
|
77
|
+
* Placement of the toast container.
|
|
78
|
+
* Controls where toasts appear on screen.
|
|
79
|
+
*
|
|
80
|
+
* @default "top-right"
|
|
81
|
+
*/
|
|
20
82
|
placement?: ToastPlacement;
|
|
83
|
+
/**
|
|
84
|
+
* Visual style variant of toasts.
|
|
85
|
+
* Controls the background and border treatment.
|
|
86
|
+
*
|
|
87
|
+
* @default "bordered"
|
|
88
|
+
*/
|
|
21
89
|
variant?: Variant;
|
|
90
|
+
/**
|
|
91
|
+
* Corner rounding of toast notifications.
|
|
92
|
+
*
|
|
93
|
+
* @default "md"
|
|
94
|
+
*/
|
|
22
95
|
radius?: Radius;
|
|
96
|
+
/**
|
|
97
|
+
* Whether toasts have enter and exit animations.
|
|
98
|
+
*
|
|
99
|
+
* @default true
|
|
100
|
+
*/
|
|
23
101
|
animated?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Default timeout duration in milliseconds.
|
|
104
|
+
* Used when a toast does not specify its own timeout.
|
|
105
|
+
*
|
|
106
|
+
* @default 3500
|
|
107
|
+
*/
|
|
24
108
|
defaultTimeout?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Maximum number of toasts to display at once.
|
|
111
|
+
* Older toasts are removed when this limit is exceeded.
|
|
112
|
+
*
|
|
113
|
+
* @default 5
|
|
114
|
+
*/
|
|
25
115
|
maxToasts?: number;
|
|
26
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Default config values registered for the Toast component.
|
|
119
|
+
*/
|
|
27
120
|
export declare const defaultToastConfig: ToastConfig;
|
|
121
|
+
/**
|
|
122
|
+
* Hard fallback values used when no config tier provides a value.
|
|
123
|
+
* These values are used when instance props, component config,
|
|
124
|
+
* and global defaults are all undefined.
|
|
125
|
+
*/
|
|
28
126
|
export declare const FALLBACK_TOAST_CONFIG: {
|
|
29
|
-
readonly size:
|
|
127
|
+
readonly size: Size;
|
|
30
128
|
readonly placement: ToastPlacement;
|
|
31
129
|
readonly variant: Variant;
|
|
32
130
|
readonly radius: Radius;
|