asheeui 0.6.8 → 0.6.10
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/components/autocomplete/Autocomplete.d.ts +34 -17
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +86 -102
- package/dist/components/autocomplete/autocomplete-config.d.ts +4 -22
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +8 -11
- package/dist/components/button/Button.d.ts +31 -5
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +68 -64
- package/dist/components/card/Card.d.ts +58 -54
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +152 -158
- package/dist/components/card/card-config.d.ts +66 -33
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +9 -9
- package/dist/components/date-picker/Calendar.d.ts +57 -0
- package/dist/components/date-picker/Calendar.d.ts.map +1 -0
- package/dist/components/date-picker/Calendar.js +224 -0
- package/dist/components/date-picker/DatePicker.d.ts +68 -155
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +194 -466
- package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
- package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
- package/dist/components/date-picker/TimeSpinner.js +84 -0
- package/dist/components/date-picker/date-picker-config.d.ts +24 -3
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +9 -12
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +4 -11
- package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.helpers.js +110 -0
- package/dist/components/date-picker/index.js +3 -0
- package/dist/components/input/Input.d.ts +13 -7
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +96 -91
- package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
- package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardContext.js +13 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardProvider.js +183 -0
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
- package/dist/components/keyboard/index.d.ts +2 -1
- package/dist/components/keyboard/index.d.ts.map +1 -1
- package/dist/components/keyboard/index.js +2 -1
- package/dist/components/keyboard/keyboard-config.d.ts +40 -36
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +15 -10
- package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/keyboard/use-keyboard-field.js +12 -12
- package/dist/components/multi-select/MultiSelect.d.ts +75 -40
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +188 -187
- package/dist/components/multi-select/multi-select-config.d.ts +4 -22
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +11 -14
- package/dist/components/radio/radio-config.d.ts +3 -2
- package/dist/components/radio/radio-config.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +9 -8
- package/dist/components/select/Select.d.ts +60 -45
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +147 -159
- package/dist/components/select/select-config.d.ts +5 -33
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +6 -13
- package/dist/components/select/select-styles.js +1 -6
- package/dist/components/select-menu/SelectMenu.d.ts +45 -30
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +125 -124
- package/dist/components/select-menu/select-menu-config.d.ts +25 -2
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
- package/dist/components/select-menu/select-menu-config.js +4 -3
- package/dist/components/switch/Switch.d.ts +9 -33
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +68 -74
- package/dist/components/switch/switch-config.d.ts +3 -2
- package/dist/components/switch/switch-config.d.ts.map +1 -1
- package/dist/components/switch/switch-config.js +6 -5
- package/dist/components/switch/switch-styles.d.ts +1 -6
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/switch/switch-styles.js +6 -12
- package/dist/components/textarea/Textarea.d.ts +19 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +95 -90
- package/dist/components/toast/ToastContext.d.ts +122 -0
- package/dist/components/toast/ToastContext.d.ts.map +1 -0
- package/dist/components/toast/ToastContext.js +28 -0
- package/dist/components/toast/ToastProvider.d.ts +98 -0
- package/dist/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/toast/ToastProvider.js +192 -0
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/index.js +2 -1
- package/dist/components/toast/toast-config.d.ts +36 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-styles.d.ts +8 -0
- package/dist/components/toast/toast-styles.d.ts.map +1 -1
- package/dist/components/toast/toast-styles.js +11 -3
- package/dist/icons/ChevronUpIcon.d.ts +3 -0
- package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/icons/ChevronUpIcon.js +21 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/index.js +62 -59
- package/dist/theme/color.js +2 -2
- package/package.json +1 -1
- package/dist/components/keyboard/keyboard-context.d.ts +0 -118
- package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
- package/dist/components/keyboard/keyboard-context.js +0 -90
- package/dist/components/toast/toast-context.d.ts +0 -163
- package/dist/components/toast/toast-context.d.ts.map +0 -1
- package/dist/components/toast/toast-context.js +0 -177
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { AsheeUIProvider as r } from "./AsheeUIProvider.js";
|
|
3
3
|
import { THEME_STORAGE_KEY as f, themeController as C } from "./theme/controller.js";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as A } from "./theme/useTheme.js";
|
|
5
5
|
import { Accordion as m } from "./components/accordion/Accordion.js";
|
|
6
6
|
import { Autocomplete as L } from "./components/autocomplete/Autocomplete.js";
|
|
7
7
|
import { Button as _ } from "./components/button/Button.js";
|
|
@@ -9,9 +9,9 @@ import { Card as l } from "./components/card/Card.js";
|
|
|
9
9
|
import { Carousel as u } from "./components/carousel/Carousel.js";
|
|
10
10
|
import { Chip as I } from "./components/chip/Chip.js";
|
|
11
11
|
import { DatePicker as K } from "./components/date-picker/DatePicker.js";
|
|
12
|
-
import { Drawer as
|
|
12
|
+
import { Drawer as T } from "./components/drawer/Drawer.js";
|
|
13
13
|
import { FALLBACK_ACCORDION_CONFIG as G, defaultAccordionConfig as g } from "./components/accordion/accordion-config.js";
|
|
14
|
-
import { FALLBACK_AUTOCOMPLETE_CONFIG as S, defaultAutocompleteConfig as
|
|
14
|
+
import { FALLBACK_AUTOCOMPLETE_CONFIG as S, defaultAutocompleteConfig as s } from "./components/autocomplete/autocomplete-config.js";
|
|
15
15
|
import { FALLBACK_BUTTON_CONFIG as c, defaultButtonConfig as b } from "./components/button/button-config.js";
|
|
16
16
|
import { FALLBACK_CARD_CONFIG as M, defaultCardConfig as P } from "./components/card/card-config.js";
|
|
17
17
|
import { FALLBACK_CAROUSEL_CONFIG as h, defaultCarouselConfig as U } from "./components/carousel/carousel-config.js";
|
|
@@ -21,14 +21,14 @@ import { FALLBACK_DRAWER_CONFIG as Y, defaultDrawerConfig as Q } from "./compone
|
|
|
21
21
|
import { FALLBACK_FIELD_CONFIG as Z, defaultFieldConfig as j } from "./components/field/field-config.js";
|
|
22
22
|
import { FALLBACK_IMAGE_CONFIG as V, defaultImageConfig as $ } from "./components/image/image-config.js";
|
|
23
23
|
import { FALLBACK_KEYBOARD_CONFIG as eo, defaultKeyDisplay as ro, defaultKeyboardConfig as to, defaultKeyboardLayouts as fo } from "./components/keyboard/keyboard-config.js";
|
|
24
|
-
import { FALLBACK_LINK_CONFIG as
|
|
24
|
+
import { FALLBACK_LINK_CONFIG as po, defaultLinkConfig as Ao } from "./components/link/link-config.js";
|
|
25
25
|
import { FALLBACK_MARQUEE_CONFIG as mo, defaultMarqueeConfig as xo } from "./components/marquee/marquee-config.js";
|
|
26
26
|
import { FALLBACK_MODAL_CONFIG as io, defaultModalConfig as _o } from "./components/modal/modal-config.js";
|
|
27
27
|
import { FALLBACK_MULTI_SELECT_CONFIG as Fo, defaultMultiSelectConfig as uo } from "./components/multi-select/multi-select-config.js";
|
|
28
28
|
import { FALLBACK_RADIO_CONFIG as Io, defaultRadioConfig as Oo } from "./components/radio/radio-config.js";
|
|
29
|
-
import { FALLBACK_RESIZABLE_SCREEN_CONFIG as Bo, defaultResizableScreenConfig as
|
|
29
|
+
import { FALLBACK_RESIZABLE_SCREEN_CONFIG as Bo, defaultResizableScreenConfig as To } from "./components/resizable-screen/resizable-screen-config.js";
|
|
30
30
|
import { FALLBACK_SELECT_CONFIG as Go, defaultSelectConfig as go } from "./components/select/select-config.js";
|
|
31
|
-
import { FALLBACK_SIDEBAR_CONFIG as So, defaultSidebarConfig as
|
|
31
|
+
import { FALLBACK_SIDEBAR_CONFIG as So, defaultSidebarConfig as so } from "./components/sidebar/sidebar-config.js";
|
|
32
32
|
import { FALLBACK_SPINNER_CONFIG as co, defaultSpinnerConfig as bo } from "./components/spinner/spinner-config.js";
|
|
33
33
|
import { FALLBACK_SWITCH_CONFIG as Mo, defaultSwitchConfig as Po } from "./components/switch/switch-config.js";
|
|
34
34
|
import { FALLBACK_TABLE_CONFIG as ho, defaultTableConfig as Uo } from "./components/table/table-config.js";
|
|
@@ -39,29 +39,31 @@ import { FALLBACK_TOOLTIP_CONFIG as Zo, defaultTooltipConfig as jo } from "./com
|
|
|
39
39
|
import { FieldShell as Vo } from "./components/field/FieldShell.js";
|
|
40
40
|
import { Image as oe } from "./components/image/Image.js";
|
|
41
41
|
import { Input as re } from "./components/input/Input.js";
|
|
42
|
-
import { KeyboardContext as fe,
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
42
|
+
import { KeyboardContext as fe, useKeyboard as Ce } from "./components/keyboard/KeyboardContext.js";
|
|
43
|
+
import { KeyboardProvider as Ae } from "./components/keyboard/KeyboardProvider.js";
|
|
44
|
+
import { Link as me } from "./components/link/Link.js";
|
|
45
|
+
import { Marquee as Le } from "./components/marquee/Marquee.js";
|
|
46
|
+
import { Modal as _e } from "./components/modal/Modal.js";
|
|
47
|
+
import { MultiSelect as le } from "./components/multi-select/MultiSelect.js";
|
|
48
|
+
import { OnScreenKeyboard as ue } from "./components/keyboard/OnScreenKeyboard.js";
|
|
49
|
+
import { PasswordInput as Ie } from "./components/input/PasswordInput.js";
|
|
50
|
+
import { Radio as Ke } from "./components/radio/RadioGroup.js";
|
|
51
|
+
import { RadioContext as Te, useRadioGroupContext as Ne } from "./components/radio/radio-context.js";
|
|
52
|
+
import { RadioGroup as ge } from "./components/radio/Radio.js";
|
|
53
|
+
import { ResizableScreen as Se } from "./components/resizable-screen/ResizableScreen.js";
|
|
53
54
|
import { Select as Re } from "./components/select/Select.js";
|
|
54
|
-
import { Sidebar as
|
|
55
|
-
import { Spinner as
|
|
56
|
-
import { Switch as
|
|
57
|
-
import { Table as
|
|
58
|
-
import { Tabs as
|
|
59
|
-
import { TextArea as
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
55
|
+
import { Sidebar as be } from "./components/sidebar/Sidebar.js";
|
|
56
|
+
import { Spinner as Me } from "./components/spinner/spinner.js";
|
|
57
|
+
import { Switch as ye } from "./components/switch/Switch.js";
|
|
58
|
+
import { Table as Ue } from "./components/table/Table.js";
|
|
59
|
+
import { Tabs as ke } from "./components/tabs/Tabs.js";
|
|
60
|
+
import { TextArea as He } from "./components/textarea/Textarea.js";
|
|
61
|
+
import { ToastContext as ze, useToast as We } from "./components/toast/ToastContext.js";
|
|
62
|
+
import { ToastItem as Qe } from "./components/toast/ToastItem.js";
|
|
63
|
+
import { ToastProvider as Ze } from "./components/toast/ToastProvider.js";
|
|
64
|
+
import { Tooltip as Je } from "./components/tooltip/Tooltip.js";
|
|
65
|
+
import { defaultInputConfig as $e } from "./components/input/input-config.js";
|
|
66
|
+
import { useKeyboardField as er } from "./components/keyboard/use-keyboard-field.js";
|
|
65
67
|
export {
|
|
66
68
|
m as Accordion,
|
|
67
69
|
r as AsheeUIProvider,
|
|
@@ -71,7 +73,7 @@ export {
|
|
|
71
73
|
u as Carousel,
|
|
72
74
|
I as Chip,
|
|
73
75
|
K as DatePicker,
|
|
74
|
-
|
|
76
|
+
T as Drawer,
|
|
75
77
|
G as FALLBACK_ACCORDION_CONFIG,
|
|
76
78
|
S as FALLBACK_AUTOCOMPLETE_CONFIG,
|
|
77
79
|
c as FALLBACK_BUTTON_CONFIG,
|
|
@@ -83,7 +85,7 @@ export {
|
|
|
83
85
|
Z as FALLBACK_FIELD_CONFIG,
|
|
84
86
|
V as FALLBACK_IMAGE_CONFIG,
|
|
85
87
|
eo as FALLBACK_KEYBOARD_CONFIG,
|
|
86
|
-
|
|
88
|
+
po as FALLBACK_LINK_CONFIG,
|
|
87
89
|
mo as FALLBACK_MARQUEE_CONFIG,
|
|
88
90
|
io as FALLBACK_MODAL_CONFIG,
|
|
89
91
|
Fo as FALLBACK_MULTI_SELECT_CONFIG,
|
|
@@ -102,30 +104,31 @@ export {
|
|
|
102
104
|
oe as Image,
|
|
103
105
|
re as Input,
|
|
104
106
|
fe as KeyboardContext,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
Ae as KeyboardProvider,
|
|
108
|
+
me as Link,
|
|
109
|
+
Le as Marquee,
|
|
110
|
+
_e as Modal,
|
|
111
|
+
le as MultiSelect,
|
|
112
|
+
ue as OnScreenKeyboard,
|
|
113
|
+
Ie as PasswordInput,
|
|
114
|
+
Ke as Radio,
|
|
115
|
+
Te as RadioContext,
|
|
116
|
+
ge as RadioGroup,
|
|
117
|
+
Se as ResizableScreen,
|
|
116
118
|
Re as Select,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
be as Sidebar,
|
|
120
|
+
Me as Spinner,
|
|
121
|
+
ye as Switch,
|
|
120
122
|
f as THEME_STORAGE_KEY,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
Ue as Table,
|
|
124
|
+
ke as Tabs,
|
|
125
|
+
He as TextArea,
|
|
126
|
+
ze as ToastContext,
|
|
127
|
+
Qe as ToastItem,
|
|
128
|
+
Ze as ToastProvider,
|
|
129
|
+
Je as Tooltip,
|
|
127
130
|
g as defaultAccordionConfig,
|
|
128
|
-
|
|
131
|
+
s as defaultAutocompleteConfig,
|
|
129
132
|
b as defaultButtonConfig,
|
|
130
133
|
P as defaultCardConfig,
|
|
131
134
|
U as defaultCarouselConfig,
|
|
@@ -134,18 +137,18 @@ export {
|
|
|
134
137
|
Q as defaultDrawerConfig,
|
|
135
138
|
j as defaultFieldConfig,
|
|
136
139
|
$ as defaultImageConfig,
|
|
137
|
-
|
|
140
|
+
$e as defaultInputConfig,
|
|
138
141
|
ro as defaultKeyDisplay,
|
|
139
142
|
to as defaultKeyboardConfig,
|
|
140
143
|
fo as defaultKeyboardLayouts,
|
|
141
|
-
|
|
144
|
+
Ao as defaultLinkConfig,
|
|
142
145
|
xo as defaultMarqueeConfig,
|
|
143
146
|
_o as defaultModalConfig,
|
|
144
147
|
uo as defaultMultiSelectConfig,
|
|
145
148
|
Oo as defaultRadioConfig,
|
|
146
|
-
|
|
149
|
+
To as defaultResizableScreenConfig,
|
|
147
150
|
go as defaultSelectConfig,
|
|
148
|
-
|
|
151
|
+
so as defaultSidebarConfig,
|
|
149
152
|
bo as defaultSpinnerConfig,
|
|
150
153
|
Po as defaultSwitchConfig,
|
|
151
154
|
Uo as defaultTableConfig,
|
|
@@ -154,9 +157,9 @@ export {
|
|
|
154
157
|
Qo as defaultToastConfig,
|
|
155
158
|
jo as defaultTooltipConfig,
|
|
156
159
|
C as themeController,
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
Ce as useKeyboard,
|
|
161
|
+
er as useKeyboardField,
|
|
159
162
|
Ne as useRadioGroupContext,
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
A as useTheme,
|
|
164
|
+
We as useToast
|
|
162
165
|
};
|
package/dist/theme/color.js
CHANGED
|
@@ -4,7 +4,7 @@ const r = {
|
|
|
4
4
|
background: "#ffffff",
|
|
5
5
|
foreground: "#000000",
|
|
6
6
|
primary: "#2563eb",
|
|
7
|
-
secondary: "#
|
|
7
|
+
secondary: "#f3f4f6",
|
|
8
8
|
border: "#d5d5d5",
|
|
9
9
|
danger: "#dc2626",
|
|
10
10
|
warning: "#d97706",
|
|
@@ -16,7 +16,7 @@ const r = {
|
|
|
16
16
|
background: "#111111",
|
|
17
17
|
foreground: "#ffffff",
|
|
18
18
|
primary: "#005bc4",
|
|
19
|
-
secondary: "#
|
|
19
|
+
secondary: "#262626",
|
|
20
20
|
border: "#2a2a2a",
|
|
21
21
|
danger: "#ef4444",
|
|
22
22
|
warning: "#f59e0b",
|
package/package.json
CHANGED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { KeyboardConfig, LayoutName } from './keyboard-config';
|
|
3
|
-
/**
|
|
4
|
-
* Type for keyboard input elements.
|
|
5
|
-
* The keyboard can attach to input and textarea elements.
|
|
6
|
-
*/
|
|
7
|
-
export type KeyboardElement = HTMLInputElement | HTMLTextAreaElement;
|
|
8
|
-
/**
|
|
9
|
-
* Context type for the keyboard state and controls.
|
|
10
|
-
*/
|
|
11
|
-
export interface KeyboardContextType {
|
|
12
|
-
/**
|
|
13
|
-
* Whether the keyboard is currently open.
|
|
14
|
-
*/
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* ID of the currently active input element.
|
|
18
|
-
*/
|
|
19
|
-
activeInputId: string | null;
|
|
20
|
-
/**
|
|
21
|
-
* The currently active input element reference.
|
|
22
|
-
*/
|
|
23
|
-
activeElement: KeyboardElement | null;
|
|
24
|
-
/**
|
|
25
|
-
* The merged keyboard configuration.
|
|
26
|
-
*/
|
|
27
|
-
config: KeyboardConfig;
|
|
28
|
-
/**
|
|
29
|
-
* Opens the keyboard for a specific input element.
|
|
30
|
-
* @param id - The ID of the input element.
|
|
31
|
-
* @param el - The input element reference.
|
|
32
|
-
*/
|
|
33
|
-
openKeyboard: (id: string, el: KeyboardElement) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Requests to close the keyboard for a specific input.
|
|
36
|
-
* Uses a delay to prevent accidental closing on focus transitions.
|
|
37
|
-
* @param id - The ID of the input element.
|
|
38
|
-
*/
|
|
39
|
-
requestClose: (id: string) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Immediately closes the keyboard regardless of state.
|
|
42
|
-
*/
|
|
43
|
-
forceClose: () => void;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* React context for the keyboard state.
|
|
47
|
-
*/
|
|
48
|
-
export declare const KeyboardContext: import('react').Context<KeyboardContextType | null>;
|
|
49
|
-
/**
|
|
50
|
-
* Props for the KeyboardProvider component.
|
|
51
|
-
*/
|
|
52
|
-
export interface KeyboardProviderProps extends KeyboardConfig {
|
|
53
|
-
/**
|
|
54
|
-
* Child components that will have access to the keyboard context.
|
|
55
|
-
*/
|
|
56
|
-
children: ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* Default layout to show when the keyboard opens.
|
|
59
|
-
* @default "default"
|
|
60
|
-
*/
|
|
61
|
-
defaultLayout?: LayoutName;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Provider component for the virtual keyboard.
|
|
65
|
-
*
|
|
66
|
-
* KeyboardProvider wraps your application or a section of it to provide
|
|
67
|
-
* keyboard context. It manages the open/close state, active input tracking,
|
|
68
|
-
* and configuration merging. Input components using useKeyboardField or
|
|
69
|
-
* the KeyboardContext will automatically trigger the keyboard on focus.
|
|
70
|
-
*
|
|
71
|
-
* @param props - KeyboardProvider configuration options.
|
|
72
|
-
* @param props.children - Child components.
|
|
73
|
-
* @param props.layouts - Available keyboard layouts.
|
|
74
|
-
* @param props.display - Display mappings for special keys.
|
|
75
|
-
* @param props.defaultLayout - Default layout name. Defaults to "default".
|
|
76
|
-
* @param props.size - Size scale for keyboard keys. Defaults to "md".
|
|
77
|
-
* @param props.autoShiftBack - Auto switch back from shift. Defaults to true.
|
|
78
|
-
* @param props.closeDelay - Close delay in milliseconds. Defaults to 120.
|
|
79
|
-
* @param props.variant - Visual variant for keys.
|
|
80
|
-
* @param props.color - Theme color for keys.
|
|
81
|
-
* @param props.radius - Corner rounding for keys.
|
|
82
|
-
* @param props.portal - Whether to render the keyboard in a portal. Defaults to true.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```tsx
|
|
86
|
-
* import { KeyboardProvider, OnScreenKeyboard, Input } from "asheeui";
|
|
87
|
-
*
|
|
88
|
-
* export function App() {
|
|
89
|
-
* return (
|
|
90
|
-
* <KeyboardProvider size="lg">
|
|
91
|
-
* <Input
|
|
92
|
-
* label="Search"
|
|
93
|
-
* enableVirtualKeyboard
|
|
94
|
-
* />
|
|
95
|
-
* <OnScreenKeyboard />
|
|
96
|
-
* </KeyboardProvider>
|
|
97
|
-
* );
|
|
98
|
-
* }
|
|
99
|
-
* ```
|
|
100
|
-
*
|
|
101
|
-
* @see useKeyboard - Hook for accessing the keyboard context.
|
|
102
|
-
* @see OnScreenKeyboard - The keyboard UI component.
|
|
103
|
-
*/
|
|
104
|
-
export declare function KeyboardProvider({ children, layouts, display, defaultLayout, size, autoShiftBack, closeDelay, variant, color, radius, portal: portalProp, }: KeyboardProviderProps): import("react").JSX.Element;
|
|
105
|
-
/**
|
|
106
|
-
* Hook for accessing the keyboard context.
|
|
107
|
-
* Must be used within a KeyboardProvider.
|
|
108
|
-
*
|
|
109
|
-
* @returns The keyboard context value.
|
|
110
|
-
* @throws {Error} When used outside of a KeyboardProvider.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```tsx
|
|
114
|
-
* const { isOpen, openKeyboard, forceClose } = useKeyboard();
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
export declare function useKeyboard(): KeyboardContextType;
|
|
118
|
-
//# sourceMappingURL=keyboard-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-context.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard/keyboard-context.tsx"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IAEvB;;;;OAIG;IACH,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,KAAK,IAAI,CAAC;IAExD;;;;OAIG;IACH,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,qDAAkD,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,OAAO,EACP,OAAO,EACP,aAAa,EACb,IAAI,EACJ,aAAa,EACb,UAAgB,EAChB,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EAAE,UAAU,GACnB,EAAE,qBAAqB,+BAwHvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,wBAM1B"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as F } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as G, useMemo as j, useState as i, useRef as H, useCallback as p, useContext as J } from "react";
|
|
4
|
-
import { useAsheeConfig as N } from "../../libs/context.js";
|
|
5
|
-
import { defaultKeyboardConfig as r } from "./keyboard-config.js";
|
|
6
|
-
const q = G(null);
|
|
7
|
-
function X({
|
|
8
|
-
children: s,
|
|
9
|
-
layouts: v,
|
|
10
|
-
display: f,
|
|
11
|
-
defaultLayout: x,
|
|
12
|
-
size: I,
|
|
13
|
-
autoShiftBack: T,
|
|
14
|
-
closeDelay: d = 120,
|
|
15
|
-
variant: k,
|
|
16
|
-
color: w,
|
|
17
|
-
radius: A,
|
|
18
|
-
portal: E
|
|
19
|
-
}) {
|
|
20
|
-
var R;
|
|
21
|
-
const n = N(), t = (R = n == null ? void 0 : n.components) == null ? void 0 : R.keyboard, S = j(
|
|
22
|
-
() => ({
|
|
23
|
-
layouts: v ?? (t == null ? void 0 : t.layouts) ?? r.layouts,
|
|
24
|
-
display: f ?? (t == null ? void 0 : t.display) ?? r.display,
|
|
25
|
-
defaultLayout: x ?? (t == null ? void 0 : t.defaultLayout) ?? r.defaultLayout,
|
|
26
|
-
size: I ?? (t == null ? void 0 : t.size) ?? r.size,
|
|
27
|
-
autoShiftBack: T ?? (t == null ? void 0 : t.autoShiftBack) ?? r.autoShiftBack,
|
|
28
|
-
variant: k ?? (t == null ? void 0 : t.variant),
|
|
29
|
-
color: w ?? (t == null ? void 0 : t.color),
|
|
30
|
-
radius: A ?? (t == null ? void 0 : t.radius),
|
|
31
|
-
portal: E ?? (t == null ? void 0 : t.portal) ?? r.portal
|
|
32
|
-
}),
|
|
33
|
-
[
|
|
34
|
-
v,
|
|
35
|
-
t,
|
|
36
|
-
f,
|
|
37
|
-
x,
|
|
38
|
-
I,
|
|
39
|
-
T,
|
|
40
|
-
k,
|
|
41
|
-
w,
|
|
42
|
-
A,
|
|
43
|
-
E
|
|
44
|
-
]
|
|
45
|
-
), [m, c] = i(!1), [z, e] = i(null), [B, o] = i(
|
|
46
|
-
null
|
|
47
|
-
), u = H(null), L = p((a, l) => {
|
|
48
|
-
u.current && (clearTimeout(u.current), u.current = null), e(a), o(l), c(!0);
|
|
49
|
-
}, []), O = p(
|
|
50
|
-
(a) => {
|
|
51
|
-
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
52
|
-
e((l) => (l === a && (c(!1), o(null)), l)), u.current = null;
|
|
53
|
-
}, d);
|
|
54
|
-
},
|
|
55
|
-
[d]
|
|
56
|
-
), P = p(() => {
|
|
57
|
-
u.current && (clearTimeout(u.current), u.current = null), c(!1), o(null), e(null);
|
|
58
|
-
}, []), M = j(
|
|
59
|
-
() => ({
|
|
60
|
-
isOpen: m,
|
|
61
|
-
activeInputId: z,
|
|
62
|
-
activeElement: B,
|
|
63
|
-
config: S,
|
|
64
|
-
openKeyboard: L,
|
|
65
|
-
requestClose: O,
|
|
66
|
-
forceClose: P
|
|
67
|
-
}),
|
|
68
|
-
[
|
|
69
|
-
m,
|
|
70
|
-
z,
|
|
71
|
-
B,
|
|
72
|
-
S,
|
|
73
|
-
L,
|
|
74
|
-
O,
|
|
75
|
-
P
|
|
76
|
-
]
|
|
77
|
-
);
|
|
78
|
-
return /* @__PURE__ */ F(q.Provider, { value: M, children: s });
|
|
79
|
-
}
|
|
80
|
-
function Y() {
|
|
81
|
-
const s = J(q);
|
|
82
|
-
if (!s)
|
|
83
|
-
throw new Error("useKeyboard must be used within a <KeyboardProvider>");
|
|
84
|
-
return s;
|
|
85
|
-
}
|
|
86
|
-
export {
|
|
87
|
-
q as KeyboardContext,
|
|
88
|
-
X as KeyboardProvider,
|
|
89
|
-
Y as useKeyboard
|
|
90
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ToastConfig, ToastItemData } from './toast-config';
|
|
3
|
-
/**
|
|
4
|
-
* Options for showing a toast notification.
|
|
5
|
-
* Extends ToastItemData but makes id optional.
|
|
6
|
-
*/
|
|
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
|
-
*/
|
|
12
|
-
id?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Context type for the toast system.
|
|
16
|
-
* Provides methods for showing and managing toast notifications.
|
|
17
|
-
*/
|
|
18
|
-
export interface ToastContextType {
|
|
19
|
-
/**
|
|
20
|
-
* Array of currently active toast items.
|
|
21
|
-
*/
|
|
22
|
-
toasts: ToastItemData[];
|
|
23
|
-
/**
|
|
24
|
-
* Show a toast with the given options.
|
|
25
|
-
* Returns the toast ID.
|
|
26
|
-
*/
|
|
27
|
-
toast: (options: ToastShowOptions | string) => string;
|
|
28
|
-
/**
|
|
29
|
-
* Show a success toast.
|
|
30
|
-
* Returns the toast ID.
|
|
31
|
-
*/
|
|
32
|
-
success: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
33
|
-
/**
|
|
34
|
-
* Show an error toast.
|
|
35
|
-
* Returns the toast ID.
|
|
36
|
-
*/
|
|
37
|
-
error: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
38
|
-
/**
|
|
39
|
-
* Show an info toast.
|
|
40
|
-
* Returns the toast ID.
|
|
41
|
-
*/
|
|
42
|
-
info: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
43
|
-
/**
|
|
44
|
-
* Show a warning toast.
|
|
45
|
-
* Returns the toast ID.
|
|
46
|
-
*/
|
|
47
|
-
warning: (message: ReactNode, options?: Partial<ToastShowOptions>) => string;
|
|
48
|
-
/**
|
|
49
|
-
* Remove a toast by ID.
|
|
50
|
-
*/
|
|
51
|
-
removeToast: (id: string) => void;
|
|
52
|
-
/**
|
|
53
|
-
* Clear all active toasts.
|
|
54
|
-
*/
|
|
55
|
-
clearToasts: () => void;
|
|
56
|
-
/**
|
|
57
|
-
* The portal target element for toast rendering.
|
|
58
|
-
* When portal is enabled, toasts are rendered into this element.
|
|
59
|
-
* Defaults to document.body.
|
|
60
|
-
*/
|
|
61
|
-
portalTarget?: HTMLElement | null;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Props for the ToastProvider component.
|
|
65
|
-
* Extends ToastConfig with children and className.
|
|
66
|
-
*/
|
|
67
|
-
export interface ToastProviderProps extends ToastConfig {
|
|
68
|
-
/**
|
|
69
|
-
* Child components to render.
|
|
70
|
-
*/
|
|
71
|
-
children: ReactNode;
|
|
72
|
-
/**
|
|
73
|
-
* Extra classes for the toast container.
|
|
74
|
-
*/
|
|
75
|
-
className?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Custom portal target element.
|
|
78
|
-
* When portal is enabled, toasts are rendered into this element.
|
|
79
|
-
* Defaults to document.body.
|
|
80
|
-
*/
|
|
81
|
-
portalTarget?: HTMLElement | null;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Provider component for the toast notification system.
|
|
85
|
-
*
|
|
86
|
-
* ToastProvider wraps your application and provides toast notification
|
|
87
|
-
* functionality through the useToast hook. It manages the toast queue,
|
|
88
|
-
* rendering, and dismissal logic, and automatically positions toasts
|
|
89
|
-
* based on the configured placement.
|
|
90
|
-
*
|
|
91
|
-
* The provider uses React's createPortal to render toasts at the document
|
|
92
|
-
* body level by default. This ensures toasts escape CSS containment,
|
|
93
|
-
* stacking context, and overflow issues. Portaling can be disabled via
|
|
94
|
-
* the `portal` config option if the toasts need to stay within a specific
|
|
95
|
-
* parent container.
|
|
96
|
-
*
|
|
97
|
-
* @param props - ToastProvider configuration options.
|
|
98
|
-
* @param props.children - Child components.
|
|
99
|
-
* @param props.size - Size scale of toasts. Defaults to "md".
|
|
100
|
-
* @param props.placement - Placement of toasts. Defaults to "top-right".
|
|
101
|
-
* @param props.variant - Visual style variant. Defaults to "bordered".
|
|
102
|
-
* @param props.radius - Corner rounding. Defaults to "md".
|
|
103
|
-
* @param props.defaultTimeout - Default timeout in ms. Defaults to 3500.
|
|
104
|
-
* @param props.maxToasts - Maximum number of toasts. Defaults to 5.
|
|
105
|
-
* @param props.animated - Whether toasts have animations. Defaults to true.
|
|
106
|
-
* @param props.portal - Whether to render toasts in a portal. Defaults to true.
|
|
107
|
-
* @param props.portalTarget - Custom portal target element. Defaults to document.body.
|
|
108
|
-
* @param props.className - Extra classes for the toast container.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```tsx
|
|
112
|
-
* import { ToastProvider, useToast } from "asheeui";
|
|
113
|
-
*
|
|
114
|
-
* function App() {
|
|
115
|
-
* return (
|
|
116
|
-
* <ToastProvider>
|
|
117
|
-
* <MyComponent />
|
|
118
|
-
* </ToastProvider>
|
|
119
|
-
* );
|
|
120
|
-
* }
|
|
121
|
-
*
|
|
122
|
-
* function MyComponent() {
|
|
123
|
-
* const toast = useToast();
|
|
124
|
-
*
|
|
125
|
-
* return (
|
|
126
|
-
* <button onClick={() => toast.success("Operation successful!")}>
|
|
127
|
-
* Show Toast
|
|
128
|
-
* </button>
|
|
129
|
-
* );
|
|
130
|
-
* }
|
|
131
|
-
* ```
|
|
132
|
-
*
|
|
133
|
-
* @see useToast - Hook for showing toast notifications.
|
|
134
|
-
* @see ToastConfig - The configuration type for the toast system.
|
|
135
|
-
*/
|
|
136
|
-
export declare function ToastProvider({ children, size, placement, variant, radius, defaultTimeout, maxToasts, animated, portal: portalProp, portalTarget: portalTargetProp, className, }: ToastProviderProps): import("react").JSX.Element;
|
|
137
|
-
/**
|
|
138
|
-
* Hook for accessing the toast system.
|
|
139
|
-
*
|
|
140
|
-
* useToast returns methods for showing toast notifications with
|
|
141
|
-
* different types (success, error, info, warning). It must be used
|
|
142
|
-
* within a ToastProvider component.
|
|
143
|
-
*
|
|
144
|
-
* @returns The toast context with methods for showing and managing toasts.
|
|
145
|
-
* If used outside a ToastProvider, returns safe fallback methods.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```tsx
|
|
149
|
-
* function MyComponent() {
|
|
150
|
-
* const toast = useToast();
|
|
151
|
-
*
|
|
152
|
-
* const handleClick = () => {
|
|
153
|
-
* toast.success("Saved successfully!");
|
|
154
|
-
* };
|
|
155
|
-
*
|
|
156
|
-
* return <button onClick={handleClick}>Save</button>;
|
|
157
|
-
* }
|
|
158
|
-
* ```
|
|
159
|
-
*
|
|
160
|
-
* @see ToastProvider - The provider component that enables the toast system.
|
|
161
|
-
*/
|
|
162
|
-
export declare function useToast(): ToastContextType;
|
|
163
|
-
//# sourceMappingURL=toast-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAOf,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;IAExB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAMD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAS,EACT,QAAQ,EACR,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,gBAAgB,EAC9B,SAAS,GACV,EAAE,kBAAkB,+BAyMpB;AAID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,qBAgBvB"}
|