asheeui 0.6.7 → 0.6.9

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.
Files changed (114) hide show
  1. package/dist/components/autocomplete/Autocomplete.d.ts +34 -17
  2. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  3. package/dist/components/autocomplete/Autocomplete.js +90 -106
  4. package/dist/components/autocomplete/autocomplete-config.d.ts +2 -20
  5. package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
  6. package/dist/components/autocomplete/autocomplete-config.js +9 -13
  7. package/dist/components/button/Button.d.ts +31 -5
  8. package/dist/components/button/Button.d.ts.map +1 -1
  9. package/dist/components/button/Button.js +68 -64
  10. package/dist/components/card/Card.d.ts +58 -54
  11. package/dist/components/card/Card.d.ts.map +1 -1
  12. package/dist/components/card/Card.js +152 -158
  13. package/dist/components/card/card-config.d.ts +66 -33
  14. package/dist/components/card/card-config.d.ts.map +1 -1
  15. package/dist/components/card/card-config.js +9 -9
  16. package/dist/components/date-picker/Calendar.d.ts +57 -0
  17. package/dist/components/date-picker/Calendar.d.ts.map +1 -0
  18. package/dist/components/date-picker/Calendar.js +224 -0
  19. package/dist/components/date-picker/DatePicker.d.ts +68 -155
  20. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  21. package/dist/components/date-picker/DatePicker.js +194 -466
  22. package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
  23. package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
  24. package/dist/components/date-picker/TimeSpinner.js +84 -0
  25. package/dist/components/date-picker/date-picker-config.d.ts +21 -1
  26. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  27. package/dist/components/date-picker/date-picker-config.js +10 -14
  28. package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
  29. package/dist/components/date-picker/date-picker-styles.js +4 -11
  30. package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
  31. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
  32. package/dist/components/date-picker/date-picker.helpers.js +110 -0
  33. package/dist/components/date-picker/index.js +3 -0
  34. package/dist/components/input/Input.d.ts +13 -7
  35. package/dist/components/input/Input.d.ts.map +1 -1
  36. package/dist/components/input/Input.js +96 -91
  37. package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
  38. package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
  39. package/dist/components/keyboard/KeyboardContext.js +13 -0
  40. package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
  41. package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
  42. package/dist/components/keyboard/KeyboardProvider.js +183 -0
  43. package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
  44. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  45. package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
  46. package/dist/components/keyboard/index.d.ts +2 -1
  47. package/dist/components/keyboard/index.d.ts.map +1 -1
  48. package/dist/components/keyboard/index.js +2 -1
  49. package/dist/components/keyboard/keyboard-config.d.ts +40 -36
  50. package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
  51. package/dist/components/keyboard/keyboard-config.js +15 -10
  52. package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
  53. package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
  54. package/dist/components/keyboard/use-keyboard-field.js +12 -12
  55. package/dist/components/modal/Modal.d.ts.map +1 -1
  56. package/dist/components/modal/Modal.js +59 -65
  57. package/dist/components/multi-select/MultiSelect.d.ts +75 -40
  58. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  59. package/dist/components/multi-select/MultiSelect.js +188 -188
  60. package/dist/components/multi-select/multi-select-config.d.ts +2 -20
  61. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  62. package/dist/components/multi-select/multi-select-config.js +10 -14
  63. package/dist/components/select/Select.d.ts +60 -45
  64. package/dist/components/select/Select.d.ts.map +1 -1
  65. package/dist/components/select/Select.js +149 -161
  66. package/dist/components/select/select-config.d.ts +3 -29
  67. package/dist/components/select/select-config.d.ts.map +1 -1
  68. package/dist/components/select/select-config.js +6 -14
  69. package/dist/components/select/select-styles.js +1 -6
  70. package/dist/components/select-menu/SelectMenu.d.ts +48 -42
  71. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  72. package/dist/components/select-menu/SelectMenu.js +137 -123
  73. package/dist/components/select-menu/select-menu-config.d.ts +33 -2
  74. package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
  75. package/dist/components/select-menu/select-menu-config.js +3 -1
  76. package/dist/components/sidebar/Sidebar.js +1 -1
  77. package/dist/components/switch/Switch.d.ts +9 -33
  78. package/dist/components/switch/Switch.d.ts.map +1 -1
  79. package/dist/components/switch/Switch.js +68 -74
  80. package/dist/components/switch/switch-styles.d.ts +1 -6
  81. package/dist/components/switch/switch-styles.d.ts.map +1 -1
  82. package/dist/components/switch/switch-styles.js +6 -12
  83. package/dist/components/tabs/Tabs.js +1 -1
  84. package/dist/components/textarea/Textarea.d.ts +19 -1
  85. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  86. package/dist/components/textarea/Textarea.js +95 -90
  87. package/dist/components/toast/ToastContext.d.ts +122 -0
  88. package/dist/components/toast/ToastContext.d.ts.map +1 -0
  89. package/dist/components/toast/ToastContext.js +28 -0
  90. package/dist/components/toast/ToastProvider.d.ts +98 -0
  91. package/dist/components/toast/ToastProvider.d.ts.map +1 -0
  92. package/dist/components/toast/ToastProvider.js +188 -0
  93. package/dist/components/toast/index.d.ts +2 -1
  94. package/dist/components/toast/index.d.ts.map +1 -1
  95. package/dist/components/toast/index.js +2 -1
  96. package/dist/components/toast/toast-config.d.ts +36 -0
  97. package/dist/components/toast/toast-config.d.ts.map +1 -1
  98. package/dist/icons/ChevronUpIcon.d.ts +3 -0
  99. package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
  100. package/dist/icons/ChevronUpIcon.js +21 -0
  101. package/dist/icons/index.d.ts +2 -0
  102. package/dist/icons/index.d.ts.map +1 -1
  103. package/dist/index.css +24 -2
  104. package/dist/index.d.ts +1 -0
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +62 -59
  107. package/dist/theme/color.js +2 -2
  108. package/package.json +1 -1
  109. package/dist/components/keyboard/keyboard-context.d.ts +0 -118
  110. package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
  111. package/dist/components/keyboard/keyboard-context.js +0 -90
  112. package/dist/components/toast/toast-context.d.ts +0 -163
  113. package/dist/components/toast/toast-context.d.ts.map +0 -1
  114. 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 p } from "./theme/useTheme.js";
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 N } from "./components/drawer/Drawer.js";
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 R } from "./components/autocomplete/autocomplete-config.js";
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 Ao, defaultLinkConfig as po } from "./components/link/link-config.js";
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 No } from "./components/resizable-screen/resizable-screen-config.js";
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 Ro } from "./components/sidebar/sidebar-config.js";
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, KeyboardProvider as Ce, useKeyboard as Ae } from "./components/keyboard/keyboard-context.js";
43
- import { Link as ae } from "./components/link/Link.js";
44
- import { Marquee as xe } from "./components/marquee/Marquee.js";
45
- import { Modal as ie } from "./components/modal/Modal.js";
46
- import { MultiSelect as de } from "./components/multi-select/MultiSelect.js";
47
- import { OnScreenKeyboard as Fe } from "./components/keyboard/OnScreenKeyboard.js";
48
- import { PasswordInput as ne } from "./components/input/PasswordInput.js";
49
- import { Radio as Oe } from "./components/radio/RadioGroup.js";
50
- import { RadioContext as Be, useRadioGroupContext as Ne } from "./components/radio/radio-context.js";
51
- import { RadioGroup as Ge } from "./components/radio/Radio.js";
52
- import { ResizableScreen as Ee } from "./components/resizable-screen/ResizableScreen.js";
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 ce } from "./components/sidebar/Sidebar.js";
55
- import { Spinner as De } from "./components/spinner/spinner.js";
56
- import { Switch as Pe } from "./components/switch/Switch.js";
57
- import { Table as he } from "./components/table/Table.js";
58
- import { Tabs as we } from "./components/tabs/Tabs.js";
59
- import { TextArea as ve } from "./components/textarea/Textarea.js";
60
- import { ToastItem as qe } from "./components/toast/ToastItem.js";
61
- import { ToastProvider as We, useToast as Ye } from "./components/toast/toast-context.js";
62
- import { Tooltip as Xe } from "./components/tooltip/Tooltip.js";
63
- import { defaultInputConfig as je } from "./components/input/input-config.js";
64
- import { useKeyboardField as Ve } from "./components/keyboard/use-keyboard-field.js";
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
- N as Drawer,
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
- Ao as FALLBACK_LINK_CONFIG,
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
- Ce as KeyboardProvider,
106
- ae as Link,
107
- xe as Marquee,
108
- ie as Modal,
109
- de as MultiSelect,
110
- Fe as OnScreenKeyboard,
111
- ne as PasswordInput,
112
- Oe as Radio,
113
- Be as RadioContext,
114
- Ge as RadioGroup,
115
- Ee as ResizableScreen,
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
- ce as Sidebar,
118
- De as Spinner,
119
- Pe as Switch,
119
+ be as Sidebar,
120
+ Me as Spinner,
121
+ ye as Switch,
120
122
  f as THEME_STORAGE_KEY,
121
- he as Table,
122
- we as Tabs,
123
- ve as TextArea,
124
- qe as ToastItem,
125
- We as ToastProvider,
126
- Xe as Tooltip,
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
- R as defaultAutocompleteConfig,
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
- je as defaultInputConfig,
140
+ $e as defaultInputConfig,
138
141
  ro as defaultKeyDisplay,
139
142
  to as defaultKeyboardConfig,
140
143
  fo as defaultKeyboardLayouts,
141
- po as defaultLinkConfig,
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
- No as defaultResizableScreenConfig,
149
+ To as defaultResizableScreenConfig,
147
150
  go as defaultSelectConfig,
148
- Ro as defaultSidebarConfig,
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
- Ae as useKeyboard,
158
- Ve as useKeyboardField,
160
+ Ce as useKeyboard,
161
+ er as useKeyboardField,
159
162
  Ne as useRadioGroupContext,
160
- p as useTheme,
161
- Ye as useToast
163
+ A as useTheme,
164
+ We as useToast
162
165
  };
@@ -4,7 +4,7 @@ const r = {
4
4
  background: "#ffffff",
5
5
  foreground: "#000000",
6
6
  primary: "#2563eb",
7
- secondary: "#ffffff",
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: "#1a1a1a",
19
+ secondary: "#262626",
20
20
  border: "#2a2a2a",
21
21
  danger: "#ef4444",
22
22
  warning: "#f59e0b",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asheeui",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -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,K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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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