@accelint/design-toolkit 2.6.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/components/accordion/index.d.ts +42 -0
  2. package/dist/components/accordion/index.js.map +1 -1
  3. package/dist/components/accordion/styles.js +1 -1
  4. package/dist/components/accordion/styles.js.map +1 -1
  5. package/dist/components/avatar/index.d.ts +29 -0
  6. package/dist/components/avatar/index.js.map +1 -1
  7. package/dist/components/badge/index.d.ts +24 -0
  8. package/dist/components/badge/index.js.map +1 -1
  9. package/dist/components/button/index.d.ts +104 -0
  10. package/dist/components/button/index.js +1 -1
  11. package/dist/components/button/index.js.map +1 -1
  12. package/dist/components/button/styles.d.ts +28 -106
  13. package/dist/components/button/styles.js +1 -1
  14. package/dist/components/button/styles.js.map +1 -1
  15. package/dist/components/button/types.d.ts +6 -4
  16. package/dist/components/checkbox/index.d.ts +33 -0
  17. package/dist/components/checkbox/index.js.map +1 -1
  18. package/dist/components/checkbox/styles.d.ts +3 -3
  19. package/dist/components/checkbox/styles.js +1 -1
  20. package/dist/components/checkbox/styles.js.map +1 -1
  21. package/dist/components/chip/index.d.ts +34 -0
  22. package/dist/components/chip/index.js.map +1 -1
  23. package/dist/components/chip/styles.js +1 -1
  24. package/dist/components/chip/styles.js.map +1 -1
  25. package/dist/components/classification-badge/index.d.ts +15 -0
  26. package/dist/components/classification-badge/index.js.map +1 -1
  27. package/dist/components/classification-banner/index.d.ts +11 -0
  28. package/dist/components/classification-banner/index.js.map +1 -1
  29. package/dist/components/color-picker/styles.js +1 -1
  30. package/dist/components/color-picker/styles.js.map +1 -1
  31. package/dist/components/combobox-field/index.d.ts +1 -0
  32. package/dist/components/combobox-field/styles.d.ts +3 -3
  33. package/dist/components/combobox-field/styles.js +1 -1
  34. package/dist/components/combobox-field/styles.js.map +1 -1
  35. package/dist/components/combobox-field/types.d.ts +1 -0
  36. package/dist/components/date-field/index.d.ts +44 -0
  37. package/dist/components/date-field/index.js.map +1 -1
  38. package/dist/components/date-field/styles.d.ts +3 -3
  39. package/dist/components/date-field/styles.js +1 -1
  40. package/dist/components/date-field/styles.js.map +1 -1
  41. package/dist/components/dialog/index.d.ts +26 -4
  42. package/dist/components/dialog/index.js +1 -1
  43. package/dist/components/dialog/index.js.map +1 -1
  44. package/dist/components/drawer/events.d.ts +8 -0
  45. package/dist/components/drawer/events.js +2 -0
  46. package/dist/components/drawer/events.js.map +1 -0
  47. package/dist/components/drawer/index.d.ts +89 -43
  48. package/dist/components/drawer/index.js +1 -1
  49. package/dist/components/drawer/index.js.map +1 -1
  50. package/dist/components/drawer/styles.d.ts +50 -16
  51. package/dist/components/drawer/styles.js +1 -1
  52. package/dist/components/drawer/styles.js.map +1 -1
  53. package/dist/components/drawer/types.d.ts +154 -238
  54. package/dist/components/drawer/types.js +1 -1
  55. package/dist/components/drawer/types.js.map +1 -1
  56. package/dist/components/hotkey/index.d.ts +32 -1
  57. package/dist/components/hotkey/index.js +1 -1
  58. package/dist/components/hotkey/index.js.map +1 -1
  59. package/dist/components/icon/index.d.ts +29 -0
  60. package/dist/components/icon/index.js.map +1 -1
  61. package/dist/components/input/index.d.ts +19 -0
  62. package/dist/components/input/index.js +1 -1
  63. package/dist/components/input/index.js.map +1 -1
  64. package/dist/components/input/styles.js +1 -1
  65. package/dist/components/input/styles.js.map +1 -1
  66. package/dist/components/input/types.d.ts +1 -0
  67. package/dist/components/label/index.d.ts +19 -0
  68. package/dist/components/label/index.js.map +1 -1
  69. package/dist/components/menu/index.d.ts +69 -7
  70. package/dist/components/menu/index.js +1 -1
  71. package/dist/components/menu/index.js.map +1 -1
  72. package/dist/components/menu/styles.d.ts +10 -37
  73. package/dist/components/menu/styles.js +1 -1
  74. package/dist/components/menu/styles.js.map +1 -1
  75. package/dist/components/menu/types.d.ts +11 -16
  76. package/dist/components/options/index.d.ts +41 -0
  77. package/dist/components/options/index.js.map +1 -1
  78. package/dist/components/options/styles.d.ts +3 -3
  79. package/dist/components/options/styles.js +1 -1
  80. package/dist/components/options/styles.js.map +1 -1
  81. package/dist/components/popover/index.d.ts +36 -2
  82. package/dist/components/popover/index.js +1 -1
  83. package/dist/components/popover/index.js.map +1 -1
  84. package/dist/components/query-builder/index.d.ts +24 -0
  85. package/dist/components/query-builder/index.js.map +1 -1
  86. package/dist/components/radio/index.d.ts +31 -0
  87. package/dist/components/radio/index.js.map +1 -1
  88. package/dist/components/radio/styles.d.ts +3 -3
  89. package/dist/components/radio/styles.js +1 -1
  90. package/dist/components/radio/styles.js.map +1 -1
  91. package/dist/components/search-field/styles.js +1 -1
  92. package/dist/components/search-field/styles.js.map +1 -1
  93. package/dist/components/search-field/types.d.ts +1 -0
  94. package/dist/components/select-field/index.d.ts +44 -0
  95. package/dist/components/select-field/index.js +1 -1
  96. package/dist/components/select-field/index.js.map +1 -1
  97. package/dist/components/select-field/styles.d.ts +3 -3
  98. package/dist/components/select-field/styles.js +1 -1
  99. package/dist/components/select-field/styles.js.map +1 -1
  100. package/dist/components/select-field/types.d.ts +1 -0
  101. package/dist/components/slider/index.d.ts +36 -2
  102. package/dist/components/slider/index.js +1 -1
  103. package/dist/components/slider/index.js.map +1 -1
  104. package/dist/components/switch/index.d.ts +36 -0
  105. package/dist/components/switch/index.js +1 -1
  106. package/dist/components/switch/index.js.map +1 -1
  107. package/dist/components/switch/styles.d.ts +23 -21
  108. package/dist/components/switch/styles.js +1 -1
  109. package/dist/components/switch/styles.js.map +1 -1
  110. package/dist/components/switch/types.d.ts +1 -0
  111. package/dist/components/tabs/index.d.ts +46 -0
  112. package/dist/components/tabs/index.js.map +1 -1
  113. package/dist/components/text-area-field/index.d.ts +20 -0
  114. package/dist/components/text-area-field/index.js.map +1 -1
  115. package/dist/components/text-area-field/styles.d.ts +3 -3
  116. package/dist/components/text-area-field/styles.js +1 -1
  117. package/dist/components/text-area-field/styles.js.map +1 -1
  118. package/dist/components/text-field/index.d.ts +62 -0
  119. package/dist/components/text-field/index.js.map +1 -1
  120. package/dist/components/text-field/styles.d.ts +3 -3
  121. package/dist/components/text-field/types.d.ts +1 -0
  122. package/dist/components/tooltip/index.d.ts +42 -0
  123. package/dist/components/tooltip/index.js.map +1 -1
  124. package/dist/components/view-stack/events.d.ts +9 -0
  125. package/dist/components/view-stack/events.js +2 -0
  126. package/dist/components/view-stack/events.js.map +1 -0
  127. package/dist/components/view-stack/index.d.ts +13 -10
  128. package/dist/components/view-stack/index.js +1 -1
  129. package/dist/components/view-stack/index.js.map +1 -1
  130. package/dist/components/view-stack/types.d.ts +13 -9
  131. package/dist/index.d.ts +15 -15
  132. package/dist/index.js +1 -1
  133. package/dist/lib/types.d.ts +6 -2
  134. package/dist/metafile-esm.json +1 -1
  135. package/dist/styles.css +922 -609
  136. package/dist/variants/variants.css +6 -5
  137. package/package.json +5 -5
  138. package/dist/components/box/index.d.ts +0 -19
  139. package/dist/components/box/index.js +0 -2
  140. package/dist/components/box/index.js.map +0 -1
  141. package/dist/components/drawer/context.d.ts +0 -13
  142. package/dist/components/drawer/context.js +0 -2
  143. package/dist/components/drawer/context.js.map +0 -1
  144. package/dist/components/drawer/state.d.ts +0 -26
  145. package/dist/components/drawer/state.js +0 -2
  146. package/dist/components/drawer/state.js.map +0 -1
@@ -1,53 +1,93 @@
1
- import { Key, FocusableElement } from '@react-types/shared';
2
- import { PropsWithChildren, ReactElement, DOMAttributes } from 'react';
1
+ import { AriaAttributesWithRef } from '../../lib/types.js';
2
+ import { Payload } from '@accelint/bus';
3
+ import { UniqueId } from '@accelint/core';
4
+ import { FocusableElement } from '@react-types/shared';
5
+ import { ComponentPropsWithRef, ReactElement, DOMAttributes } from 'react';
6
+ import { HeadingProps } from 'react-aria-components';
7
+ import { VariantProps } from 'tailwind-variants';
8
+ import { ToggleButtonProps } from '../button/types.js';
9
+ import { ViewStackEvent } from '../view-stack/types.js';
10
+ import { DrawerEventTypes } from './events.js';
11
+ import { DrawerTitleStyles } from './styles.js';
12
+ import '../button/styles.js';
13
+ import 'tailwind-merge';
14
+ import '../view-stack/events.js';
3
15
 
4
- /**
5
- * Defines the possible sizes for a drawer.
6
- */
7
- type DrawerSize = 'small' | 'medium' | 'large';
8
- /**
9
- * Defines the possible placements for a drawer.
10
- */
11
- type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
12
- type DrawerLayoutPush = DrawerPlacement | `${DrawerPlacement} ${DrawerPlacement}` | `${DrawerPlacement} ${DrawerPlacement} ${DrawerPlacement}` | `${DrawerPlacement} ${DrawerPlacement} ${DrawerPlacement} ${DrawerPlacement}`;
13
- /**
14
- * Represents the state of a single drawer.
15
- */
16
- type DrawerState = {
17
- id: Key;
18
- isOpen: boolean;
19
- selectedMenuItemId?: Key;
20
- };
21
- /**
22
- * Base props for drawer container components.
23
- */
24
- interface DrawerContainerProps extends PropsWithChildren<{
25
- className?: string;
26
- }> {
27
- }
28
- /**
29
- * Props for the `Drawer.Provider` component.
30
- */
31
- interface DrawerProviderProps extends PropsWithChildren {
32
- /**
33
- * A callback function that is called when the state of any drawer changes.
34
- * @param drawerId
35
- * @param state
36
- * @returns
37
- */
38
- onStateChange?: (drawerId: Key, state: DrawerState) => void;
39
- }
40
- /**
41
- * Props for the `Drawer.Layout` component.
42
- */
43
- interface DrawerLayoutProps extends DrawerContainerProps {
16
+ type Top = 'top';
17
+ type Bottom = 'bottom';
18
+ type YAxisUnion = Top | Bottom;
19
+ type YAxisIntersection = `${Top} ${Bottom}` | `${Bottom} ${Top}`;
20
+ type Right = 'right';
21
+ type Left = 'left';
22
+ type XAxisUnion = Right | Left;
23
+ type XAxisIntersection = `${Right} ${Left}` | `${Left} ${Right}`;
24
+ type DrawerLayoutProps = ComponentPropsWithRef<'div'> & {
44
25
  /**
45
26
  * Which drawers should extend to full container dimensions.
46
27
  * Determines the overall layout structure and drawer relationships in regard to space.
47
28
  *
48
29
  * @default 'left right'
30
+ *
31
+ * Extended Drawer Layout Configurations
32
+ *
33
+ * The layout system supports four different drawer extension modes that determine
34
+ * how drawers are arranged and which drawers extend to the full container dimensions.
35
+ *
36
+ * extend: "left right"
37
+ * ┌──────┬──────────┬───────┐
38
+ * │ │ top │ │
39
+ * │ ├──────────┤ │
40
+ * │ left │ main │ right │
41
+ * │ ├──────────┤ │
42
+ * │ │ bottom │ │
43
+ * └──────┴──────────┴───────┘
44
+ *
45
+ * extend: "top bottom"
46
+ * ┌─────────────────────────┐
47
+ * │ top │
48
+ * ├──────┬──────────┬───────┤
49
+ * │ left │ main │ right │
50
+ * ├──────┴──────────┴───────┤
51
+ * │ bottom │
52
+ * └─────────────────────────┘
53
+ *
54
+ * extend: "top"
55
+ * ┌─────────────────────────┐
56
+ * │ top │
57
+ * ├──────┬──────────┬───────┤
58
+ * │ │ main │ │
59
+ * │ left ├──────────┤ right │
60
+ * │ │ bottom │ │
61
+ * └──────┴──────────┴───────┘
62
+ *
63
+ * extend: "bottom"
64
+ * ┌──────┬──────────┬───────┐
65
+ * │ │ top │ │
66
+ * │ left ├──────────┤ right │
67
+ * │ │ main │ │
68
+ * ├──────┴──────────┴───────┤
69
+ * │ bottom │
70
+ * └─────────────────────────┘
71
+ *
72
+ * extend: "left"
73
+ * ┌──────┬──────────────────┐
74
+ * │ │ top │
75
+ * │ ├──────────┬───────│
76
+ * │ left │ main │ right │
77
+ * │ ├──────────┴───────┤
78
+ * │ │ bottom │
79
+ * └──────┴──────────────────┘
80
+ *
81
+ * extend: "right"
82
+ * ┌─────────────────┬───────┐
83
+ * │ top │ │
84
+ * ├──────┬──────────┤ │
85
+ * │ left │ main │ right │
86
+ * ├──────┴──────────┤ │
87
+ * │ bottom │ │
88
+ * └─────────────────┴───────┘
49
89
  */
50
- extend?: DrawerLayouts;
90
+ extend?: XAxisUnion | XAxisIntersection | YAxisUnion | YAxisIntersection;
51
91
  /**
52
92
  * Determines how drawer interact with the main content area and overall layout:
53
93
  *
@@ -56,224 +96,100 @@ interface DrawerLayoutProps extends DrawerContainerProps {
56
96
  * If no placements are defined for push, the default behavior for a drawer is to float over the main content without affecting its layout or dimensions.
57
97
  * Content remains at full width, panel appears as an overlay.
58
98
  */
59
- push?: DrawerLayoutPush;
60
- }
61
- /**
62
- * Props for the `Drawer` component.
63
- */
64
- interface DrawerProps extends DrawerContainerProps {
65
- /**
66
- * The unique identifier for the drawer.
67
- */
68
- id: Key;
99
+ push?: XAxisUnion | YAxisUnion | XAxisIntersection | YAxisIntersection | `${XAxisUnion} ${YAxisUnion}` | `${YAxisUnion} ${XAxisUnion}` | `${XAxisUnion} ${YAxisIntersection}` | `${YAxisIntersection} ${XAxisUnion}` | `${YAxisUnion} ${XAxisIntersection}` | `${XAxisIntersection} ${YAxisUnion}` | `${XAxisIntersection} ${YAxisIntersection}` | `${YAxisIntersection} ${XAxisIntersection}`;
100
+ };
101
+ type DrawerProps = Omit<ComponentPropsWithRef<'div'>, 'onChange'> & {
102
+ id: UniqueId;
103
+ defaultView?: UniqueId;
69
104
  /**
70
105
  * The placement of the drawer.
71
106
  * @default 'left'
72
107
  */
73
- placement: DrawerPlacement;
108
+ placement?: XAxisUnion | YAxisUnion;
74
109
  /**
75
110
  * The size of the drawer.
76
111
  * @default 'medium'
77
112
  */
78
- size?: DrawerSize;
79
- /**
80
- * Whether the drawer is open or not.
81
- * @default false
82
- */
83
- isOpen?: boolean;
84
- /**
85
- * The id of the menu item that should be selected by default.
86
- */
87
- defaultSelectedMenuItemId?: Key;
88
- /**
89
- * A callback function that is called when the drawer is opened or closed.
90
- * @param boolean
91
- */
92
- onOpenChange?: OnOpenChangeCallback;
93
- /**
94
- * A callback function that is called when the state of the drawer changes.
95
- * @param state
96
- * @returns
97
- */
98
- onStateChange?: (state: DrawerState) => void;
99
- }
100
- /**
101
- * A callback function that is called when the drawer is opened or closed.
102
- * @param boolean
103
- */
104
- type OnOpenChangeCallback = ((isOpen: boolean) => void) | undefined;
105
- /**
106
- * Props for the 'Drawer.Menu' component.
107
- */
108
- interface DrawerMenuProps extends DrawerContainerProps {
113
+ size?: 'small' | 'medium' | 'large';
114
+ onChange?: (view: UniqueId | null) => void;
115
+ };
116
+ type DrawerMenuProps = ComponentPropsWithRef<'nav'> & {
109
117
  /**
110
118
  * The position of the menu.
111
- * @default 'middle'
112
- */
113
- position?: 'start' | 'middle' | 'end';
114
- }
115
- /**
116
- * Props for the 'Drawer.Trigger' component.
117
- */
118
- interface DrawerTriggerProps extends DrawerContainerProps {
119
- /**
120
- * The id of the drawer to control.
121
- */
122
- for: Key;
123
- /**
124
- * The behavior of the trigger.
125
- * @default 'toggle'
126
- */
127
- behavior?: 'open' | 'close' | 'toggle';
128
- /**
129
- * The children of the component.
130
- */
131
- children: ReactElement<DOMAttributes<FocusableElement>, string>;
132
- }
133
- /**
134
- * Props for the 'Drawer.Menu.Item' component.
135
- */
136
- type DrawerMenuItemProps = {
137
- /**
138
- * The unique identifier for the menu item.
119
+ * @default 'center'
139
120
  */
140
- id?: Key;
141
- /**
142
- * The class name for the menu item.
143
- */
144
- className?: string;
145
- /**
146
- * The children of the component.
147
- */
148
- children: ReactElement<DOMAttributes<FocusableElement>, string>;
121
+ position?: 'start' | 'center' | 'end';
149
122
  };
150
123
  /**
151
- * Props for the 'Drawer.Panel' component.
124
+ * Drawer.Menu.Item implements Drawer.Trigger with the default behavior of
125
+ * the trigger's `open` event type, which resets the stack before pushing the new view
152
126
  */
153
- interface DrawerPanelProps extends DrawerContainerProps {
154
- /**
155
- * The unique identifier for the panel.
156
- */
157
- id?: Key;
158
- }
159
- /**
160
- * The value provided by the 'DrawersContext'.
161
- */
162
- type DrawersContextValue = {
163
- /**
164
- * A record of all the drawer's state.
165
- */
166
- drawerStates: Record<Key, DrawerState>;
127
+ type DrawerMenuItemProps = Omit<ToggleButtonProps, 'id'> & {
167
128
  /**
168
- * A function to toggle the drawer.
169
- * @param drawerId
170
- * @returns
171
- */
172
- toggleDrawer: (drawerId: Key) => void;
173
- /**
174
- * A function to open a drawer.
175
- * @param drawerId
176
- * @param menuItemId
177
- * @returns
178
- */
179
- openDrawer: (drawerId: Key, menuItemId?: Key) => void;
180
- /**
181
- * A function to close a drawer.
182
- * @param drawerId
183
- * @returns
129
+ * The unique identifier of the view that this menu item controls.
130
+ *
131
+ * Links the menu item to a specific view, enabling it to open or toggle the associated view when activated.
132
+ *
133
+ * The value should match the `id` of the target view component. This prop is required for correct association and interaction.
134
+ *
135
+ * If the menu item is intended to control multiple views, use the `views` prop for additional associations; do not include the `for` id in the `views` array.
184
136
  */
185
- closeDrawer: (drawerId: Key) => void;
137
+ for: UniqueId;
186
138
  /**
187
- * A function to get the state of a drawer.
188
- * @param drawerId
189
- * @returns
139
+ * An optional array of additional view identifiers. If provided, the menu item will display as active when any of these views are active.
140
+ *
141
+ * You do not need to include the `id` already passed in the `for` prop.
190
142
  */
191
- getDrawerState: (drawerId: Key) => DrawerState;
143
+ views?: UniqueId[];
192
144
  /**
193
- * A function to register a drawer.
194
- * @param initialState
195
- * @param callbacks
196
- * @returns
145
+ * If set to `true`, the menu item will toggle the visibility of the associated view each time it is activated.
146
+ *
147
+ * By default, the menu item only opens the view. Use this prop to enable toggling between open and closed states.
197
148
  */
198
- registerDrawer: (initialState: DrawerState, callbacks?: {
199
- onOpenChange?: OnOpenChangeCallback;
200
- onStateChange?: (state: DrawerState) => void;
201
- }) => void;
149
+ toggle?: boolean;
150
+ };
151
+ type DrawerTitleProps = Omit<HeadingProps, 'level'> & AriaAttributesWithRef<HTMLHeadingElement> & VariantProps<typeof DrawerTitleStyles>;
152
+ type DrawerOpenEvent = Payload<typeof DrawerEventTypes.open, {
153
+ view: UniqueId;
154
+ }>;
155
+ type DrawerToggleEvent = Payload<typeof DrawerEventTypes.toggle, {
156
+ view: UniqueId;
157
+ }>;
158
+ type DrawerEvent = DrawerOpenEvent | DrawerToggleEvent | ViewStackEvent;
159
+ type SimpleEvents = 'back' | 'clear' | 'close' | 'reset' | UniqueId;
160
+ type TargetedEvents = `back:${UniqueId}` | `clear:${UniqueId}` | `close:${UniqueId}` | `open:${UniqueId}` | `toggle:${UniqueId}` | `reset:${UniqueId}`;
161
+ type ChainedEvents = (SimpleEvents | TargetedEvents)[];
162
+ type DrawerTriggerProps = {
163
+ children: ReactElement<DOMAttributes<FocusableElement>, string>;
202
164
  /**
203
- * A function to check if a menu item is selected.
204
- * @param selectedMenuItemId
205
- * @param menuItemId
206
- * @returns
165
+ * __SimpleEvents__ allow the easiest implementation of events, but come with some restrictions:
166
+ * - The literal commands `back | clear | close | reset` will only work inside of the context of a Drawer
167
+ * - When passing a view's UniqueId the behavior is always to push that id onto it's parent's stack
168
+ *
169
+ * __TargetedEvents__ allow for external control of a Drawer, the UniqueId of a Drawer is passed to know which drawer to affect
170
+ *
171
+ * __ChainedEvents__ allow a list of events from a single control to enable multiple behaviors
172
+ *
173
+ * _NOTE_: Open differs from Push (just a UniqueId), Open clears the stack before pushing the new view
174
+ *
175
+ * @example
176
+ * // Reset a drawer stack and then push a view on:
177
+ * ['reset', myViewId]
178
+ *
179
+ * // Open multiple drawers:
180
+ * [`open:${tabOneId}`, `open:${tabCId}`]
181
+ *
182
+ * // Push multiple views to multiple drawers:
183
+ * [viewOneId, viewTwoId, viewThreeId]
184
+ *
185
+ * // Close the current drawer from inside its context:
186
+ * 'close'
207
187
  */
208
- isSelectedMenuItem: (selectedMenuItemId?: Key, menuItemId?: Key) => boolean;
188
+ for: SimpleEvents | TargetedEvents | ChainedEvents;
209
189
  };
210
190
  type DrawerContextValue = {
211
- state: DrawerState;
212
- };
213
- /**
214
- * Extended Drawer Layout Configurations
215
- *
216
- * The layout system supports four different drawer extension modes that determine
217
- * how drawers are arranged and which drawers extend to the full container dimensions.
218
- *
219
- * extend: "left right"
220
- * ┌──────┬──────────┬───────┐
221
- * │ │ top │ │
222
- * │ ├──────────┤ │
223
- * │ left │ main │ right │
224
- * │ ├──────────┤ │
225
- * │ │ bottom │ │
226
- * └──────┴──────────┴───────┘
227
- *
228
- * extend: "top bottom"
229
- * ┌─────────────────────────┐
230
- * │ top │
231
- * ├──────┬──────────┬───────┤
232
- * │ left │ main │ right │
233
- * ├──────┴──────────┴───────┤
234
- * │ bottom │
235
- * └─────────────────────────┘
236
- *
237
- * extend: "top"
238
- * ┌─────────────────────────┐
239
- * │ top │
240
- * ├──────┬──────────┬───────┤
241
- * │ │ main │ │
242
- * │ left ├──────────┤ right │
243
- * │ │ bottom │ │
244
- * └──────┴──────────┴───────┘
245
- *
246
- * extend: "bottom"
247
- * ┌──────┬──────────┬───────┐
248
- * │ │ top │ │
249
- * │ left ├──────────┤ right │
250
- * │ │ main │ │
251
- * ├──────┴──────────┴───────┤
252
- * │ bottom │
253
- * └─────────────────────────┘
254
- *
255
- * extend: "left"
256
- * ┌──────┬──────────────────┐
257
- * │ │ top │
258
- * │ ├──────────┬───────│
259
- * │ left │ main │ right │
260
- * │ ├──────────┴───────┤
261
- * │ │ bottom │
262
- * └──────┴──────────────────┘
263
- *
264
- * extend: "right"
265
- * ┌─────────────────┬───────┐
266
- * │ top │ │
267
- * ├──────┬──────────┤ │
268
- * │ left │ main │ right │
269
- * ├──────┴──────────┤ │
270
- * │ bottom │ │
271
- * └─────────────────┴───────┘
272
- */
273
- type DrawerLayouts = 'left right' | 'top bottom' | 'top' | 'bottom' | 'left' | 'right';
274
- declare const DrawerDefaults: {
275
- readonly selectedMenuItemId: undefined;
276
- readonly isOpen: false;
191
+ register: (view: UniqueId) => void;
192
+ unregister: (view: UniqueId) => void;
277
193
  };
278
194
 
279
- export { type DrawerContainerProps, type DrawerContextValue, DrawerDefaults, type DrawerLayoutProps, type DrawerLayoutPush, type DrawerLayouts, type DrawerMenuItemProps, type DrawerMenuProps, type DrawerPanelProps, type DrawerPlacement, type DrawerProps, type DrawerProviderProps, type DrawerSize, type DrawerState, type DrawerTriggerProps, type DrawersContextValue, type OnOpenChangeCallback };
195
+ export type { DrawerContextValue, DrawerEvent, DrawerLayoutProps, DrawerMenuItemProps, DrawerMenuProps, DrawerOpenEvent, DrawerProps, DrawerTitleProps, DrawerToggleEvent, DrawerTriggerProps };
@@ -1,2 +1,2 @@
1
- const e={selectedMenuItemId:void 0,isOpen:false};export{e as DrawerDefaults};//# sourceMappingURL=types.js.map
1
+ //# sourceMappingURL=types.js.map
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/drawer/types.ts"],"names":["DrawerDefaults"],"mappings":"AAwTO,MAAMA,CAAAA,CAAiB,CAC5B,kBAAA,CAAoB,MAAA,CACpB,OAAQ,KACV","file":"types.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type { FocusableElement, Key } from '@react-types/shared';\nimport type { DOMAttributes, PropsWithChildren, ReactElement } from 'react';\n\n/**\n * Defines the possible sizes for a drawer.\n */\nexport type DrawerSize = 'small' | 'medium' | 'large';\n\n/**\n * Defines the possible placements for a drawer.\n */\nexport type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';\n\nexport type DrawerLayoutPush =\n | DrawerPlacement\n | `${DrawerPlacement} ${DrawerPlacement}`\n | `${DrawerPlacement} ${DrawerPlacement} ${DrawerPlacement}`\n | `${DrawerPlacement} ${DrawerPlacement} ${DrawerPlacement} ${DrawerPlacement}`;\n\n/**\n * Represents the state of a single drawer.\n */\nexport type DrawerState = {\n id: Key;\n isOpen: boolean;\n selectedMenuItemId?: Key;\n};\n\n/**\n * Base props for drawer container components.\n */\nexport interface DrawerContainerProps\n extends PropsWithChildren<{ className?: string }> {}\n\n/**\n * Props for the `Drawer.Provider` component.\n */\nexport interface DrawerProviderProps extends PropsWithChildren {\n /**\n * A callback function that is called when the state of any drawer changes.\n * @param drawerId\n * @param state\n * @returns\n */\n onStateChange?: (drawerId: Key, state: DrawerState) => void;\n}\n\n/**\n * Props for the `Drawer.Layout` component.\n */\nexport interface DrawerLayoutProps extends DrawerContainerProps {\n /**\n * Which drawers should extend to full container dimensions.\n * Determines the overall layout structure and drawer relationships in regard to space.\n *\n * @default 'left right'\n */\n extend?: DrawerLayouts;\n /**\n * Determines how drawer interact with the main content area and overall layout:\n *\n * - `'push'`: Drawer pushes the main content aside, reducing its available width.\n * Content area shrinks to accommodate the panel space.\n * If no placements are defined for push, the default behavior for a drawer is to float over the main content without affecting its layout or dimensions.\n * Content remains at full width, panel appears as an overlay.\n */\n push?: DrawerLayoutPush;\n}\n\n/**\n * Props for the `Drawer` component.\n */\nexport interface DrawerProps extends DrawerContainerProps {\n /**\n * The unique identifier for the drawer.\n */\n id: Key;\n /**\n * The placement of the drawer.\n * @default 'left'\n */\n placement: DrawerPlacement;\n /**\n * The size of the drawer.\n * @default 'medium'\n */\n size?: DrawerSize;\n /**\n * Whether the drawer is open or not.\n * @default false\n */\n isOpen?: boolean;\n /**\n * The id of the menu item that should be selected by default.\n */\n defaultSelectedMenuItemId?: Key;\n /**\n * A callback function that is called when the drawer is opened or closed.\n * @param boolean\n */\n onOpenChange?: OnOpenChangeCallback;\n /**\n * A callback function that is called when the state of the drawer changes.\n * @param state\n * @returns\n */\n onStateChange?: (state: DrawerState) => void;\n}\n\n/**\n * A callback function that is called when the drawer is opened or closed.\n * @param boolean\n */\nexport type OnOpenChangeCallback = ((isOpen: boolean) => void) | undefined;\n\n/**\n * Props for the 'Drawer.Menu' component.\n */\nexport interface DrawerMenuProps extends DrawerContainerProps {\n /**\n * The position of the menu.\n * @default 'middle'\n */\n position?: 'start' | 'middle' | 'end';\n}\n\n/**\n * Props for the 'Drawer.Trigger' component.\n */\nexport interface DrawerTriggerProps extends DrawerContainerProps {\n /**\n * The id of the drawer to control.\n */\n for: Key;\n /**\n * The behavior of the trigger.\n * @default 'toggle'\n */\n behavior?: 'open' | 'close' | 'toggle';\n /**\n * The children of the component.\n */\n children: ReactElement<DOMAttributes<FocusableElement>, string>;\n}\n\n/**\n * Props for the 'Drawer.Menu.Item' component.\n */\nexport type DrawerMenuItemProps = {\n /**\n * The unique identifier for the menu item.\n */\n id?: Key;\n /**\n * The class name for the menu item.\n */\n className?: string;\n /**\n * The children of the component.\n */\n children: ReactElement<DOMAttributes<FocusableElement>, string>;\n};\n\n/**\n * Props for the 'Drawer.Panel' component.\n */\nexport interface DrawerPanelProps extends DrawerContainerProps {\n /**\n * The unique identifier for the panel.\n */\n id?: Key;\n}\n\n/**\n * The value provided by the 'DrawersContext'.\n */\nexport type DrawersContextValue = {\n /**\n * A record of all the drawer's state.\n */\n drawerStates: Record<Key, DrawerState>;\n /**\n * A function to toggle the drawer.\n * @param drawerId\n * @returns\n */\n toggleDrawer: (drawerId: Key) => void;\n /**\n * A function to open a drawer.\n * @param drawerId\n * @param menuItemId\n * @returns\n */\n openDrawer: (drawerId: Key, menuItemId?: Key) => void;\n /**\n * A function to close a drawer.\n * @param drawerId\n * @returns\n */\n closeDrawer: (drawerId: Key) => void;\n /**\n * A function to get the state of a drawer.\n * @param drawerId\n * @returns\n */\n getDrawerState: (drawerId: Key) => DrawerState;\n /**\n * A function to register a drawer.\n * @param initialState\n * @param callbacks\n * @returns\n */\n registerDrawer: (\n initialState: DrawerState,\n callbacks?: {\n onOpenChange?: OnOpenChangeCallback;\n onStateChange?: (state: DrawerState) => void;\n },\n ) => void;\n\n /**\n * A function to check if a menu item is selected.\n * @param selectedMenuItemId\n * @param menuItemId\n * @returns\n */\n isSelectedMenuItem: (selectedMenuItemId?: Key, menuItemId?: Key) => boolean;\n};\n\nexport type DrawerContextValue = {\n state: DrawerState;\n};\n\n/**\n * Extended Drawer Layout Configurations\n *\n * The layout system supports four different drawer extension modes that determine\n * how drawers are arranged and which drawers extend to the full container dimensions.\n *\n * extend: \"left right\"\n * ┌──────┬──────────┬───────┐\n * │ │ top │ │\n * │ ├──────────┤ │\n * │ left │ main │ right │\n * │ ├──────────┤ │\n * │ │ bottom │ │\n * └──────┴──────────┴───────┘\n *\n * extend: \"top bottom\"\n * ┌─────────────────────────┐\n * │ top │\n * ├──────┬──────────┬───────┤\n * │ left │ main │ right │\n * ├──────┴──────────┴───────┤\n * │ bottom │\n * └─────────────────────────┘\n *\n * extend: \"top\"\n * ┌─────────────────────────┐\n * │ top │\n * ├──────┬──────────┬───────┤\n * │ │ main │ │\n * │ left ├──────────┤ right │\n * │ │ bottom │ │\n * └──────┴──────────┴───────┘\n *\n * extend: \"bottom\"\n * ┌──────┬──────────┬───────┐\n * │ │ top │ │\n * │ left ├──────────┤ right │\n * │ │ main │ │\n * ├──────┴──────────┴───────┤\n * │ bottom │\n * └─────────────────────────┘\n *\n * extend: \"left\"\n * ┌──────┬──────────────────┐\n * │ │ top │\n * │ ├──────────┬───────│\n * │ left │ main │ right │\n * │ ├──────────┴───────┤\n * │ │ bottom │\n * └──────┴──────────────────┘\n *\n * extend: \"right\"\n * ┌─────────────────┬───────┐\n * │ top │ │\n * ├──────┬──────────┤ │\n * │ left │ main │ right │\n * ├──────┴──────────┤ │\n * │ bottom │ │\n * └─────────────────┴───────┘\n */\nexport type DrawerLayouts =\n | 'left right'\n | 'top bottom'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right';\n\nexport const DrawerDefaults = {\n selectedMenuItemId: undefined,\n isOpen: false,\n} as const;\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -11,6 +11,37 @@ declare function HotkeyProvider({ children, ...props }: ProviderProps<HotkeyProp
11
11
  declare namespace HotkeyProvider {
12
12
  var displayName: string;
13
13
  }
14
+ /**
15
+ * Hotkey - A visual representation of keyboard shortcuts and key combinations
16
+ *
17
+ * Displays keyboard keys and shortcuts in a consistent, accessible format.
18
+ * Perfect for documentation, help systems, or UI elements that need to show
19
+ * keyboard shortcuts. Supports multiple visual styles including outlined keys,
20
+ * flat presentation, and icon-specific formatting.
21
+ *
22
+ * @example
23
+ * // Basic hotkey display
24
+ * <Hotkey>Ctrl</Hotkey>
25
+ *
26
+ * @example
27
+ * // Hotkey combination with different variants
28
+ * <Hotkey.Set>
29
+ * <Hotkey variant="outline">Cmd</Hotkey>
30
+ * <span>+</span>
31
+ * <Hotkey variant="outline">K</Hotkey>
32
+ * </Hotkey.Set>
33
+ *
34
+ * @example
35
+ * // Flat style for inline text
36
+ * <p>Press <Hotkey variant="flat">Enter</Hotkey> to submit</p>
37
+ *
38
+ * @example
39
+ * // Icon variant for special keys
40
+ * <Hotkey.Set>
41
+ * <Hotkey variant="icon">⌘</Hotkey>
42
+ * <Hotkey>Space</Hotkey>
43
+ * </Hotkey.Set>
44
+ */
14
45
  declare function Hotkey({ ref, children, ...props }: HotkeyProps): react_jsx_runtime.JSX.Element;
15
46
  declare namespace Hotkey {
16
47
  var displayName: string;
@@ -22,4 +53,4 @@ declare namespace HotkeySet {
22
53
  var displayName: string;
23
54
  }
24
55
 
25
- export { Hotkey, HotkeyContext, HotkeySet };
56
+ export { Hotkey, HotkeyContext };
@@ -1,2 +1,2 @@
1
- import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Keyboard}from'react-aria-components';import {Icon}from'../icon/index.js';import {HotkeyStyles,HotkeyStylesDefaults}from'./styles.js';const {key:c,set:v}=HotkeyStyles(),y=createContext(null);function i({children:e,...o}){return jsx(y.Provider,{value:o,children:e})}i.displayName="Hotkey.Provider";function s({ref:e,children:o,...t}){[t,e]=useContextProps(t,e??null,y);const{className:a,variant:l=HotkeyStylesDefaults.variant}=t;return jsx(Keyboard,{ref:e,...t,className:c({className:a,variant:l}),children:o})}s.displayName="Hotkey";function n({children:e,...o}){const{className:t}=o;return jsx("div",{className:v({className:t}),children:jsx(Icon.Provider,{size:"large",children:e})})}n.displayName="Hotkey.Set",s.Set=n,s.Provider=i;export{s as Hotkey,y as HotkeyContext,n as HotkeySet};//# sourceMappingURL=index.js.map
1
+ import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Keyboard}from'react-aria-components';import {Icon}from'../icon/index.js';import {HotkeyStyles,HotkeyStylesDefaults}from'./styles.js';const {key:c,set:v}=HotkeyStyles(),y=createContext(null);function i({children:e,...o}){return jsx(y.Provider,{value:o,children:e})}i.displayName="Hotkey.Provider";function s({ref:e,children:o,...t}){[t,e]=useContextProps(t,e??null,y);const{className:a,variant:l=HotkeyStylesDefaults.variant}=t;return jsx(Keyboard,{ref:e,...t,className:c({className:a,variant:l}),children:o})}s.displayName="Hotkey";function n({children:e,...o}){const{className:t}=o;return jsx("div",{className:v({className:t}),children:jsx(Icon.Provider,{size:"large",children:e})})}n.displayName="Hotkey.Set",s.Set=n,s.Provider=i;export{s as Hotkey,y as HotkeyContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/hotkey/index.tsx"],"names":["HotkeyStyles","HotkeyContext","createContext","H","p","props","jsx","r","HotkeyProvider","useContextProps","ref","P","HotkeyStylesDefaults","Keyboard","m","className","children","Hotkey","Icon","k"],"mappings":"6PA0BqBA,CAAAA,GAERC,CAAAA,CACXC,CAAAA,KAA0D,CAAA,CAE5DC,YAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IAA0B,WAAU,CAAA,CAAA,CAAGC,QACrC,CAAA,CAAA,CACEC,GAACL,CAAc,CAAA,CAAA,CAAA,OAASM,GAAA,CAAA,CAAA,CAAA,QAAe,CAAA,CAAA,KAAS,CAEpD,CACAC,CAAAA,QAAe,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,iBAEJ,CAAA,eAAe,CAAA,CAAA,CAAGH,QAC9B,CAAA,CAAII,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMT,CAAa,CAAAU,eAChE,MAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAW,CAAA,SAAUC,CAAqB,CAAA,CAAA,OAAYP,CAAAA,CAE9D,6BACGQ,CAAA,CAAS,CAAA,CAAA,OAAcR,GAAAA,CAAOS,QAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,GAAe,CAAE,CAAA,SAAAC,CAAAA,CAAW,CAAA,CAAA,SAAS,CACjE,CAAA,CAAA,OAAAC,CAAAA,CACH,CAEJ,CACAC,CAAAA,QAAO,CAAA,CAAA,CAAA,CAAA,CAAc,aAEd,CAAA,QAAqB,CAAA,SAAU,CAAA,CAAA,CAAGZ,QACvC,CAAM,CAAE,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,KAAcA,CAAAA,SAGpBC,CAAC,YAAIC,GAAA,CAAA,KAAe,CAAE,CAAA,SAAAQ,CAAU,CAAC,CAAA,CAC/B,SAAAT,CAAAA,CAACY,EAAK,CAAA,QAAL,CAAcX,GAAA,CAAAY,IAAA,CAAA,QAAK,CAAS,aAC/B,CAEJ,QACU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAExBF,aACO,CAAA,CAAA,CAAA,GAAWT,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n Keyboard,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { HotkeyStyles, HotkeyStylesDefaults } from './styles';\nimport type { HotkeyProps, HotkeySetProps } from './types';\n\nconst { key, set } = HotkeyStyles();\n\nexport const HotkeyContext =\n createContext<ContextValue<HotkeyProps, HTMLElement>>(null);\n\nfunction HotkeyProvider({ children, ...props }: ProviderProps<HotkeyProps>) {\n return (\n <HotkeyContext.Provider value={props}>{children}</HotkeyContext.Provider>\n );\n}\nHotkeyProvider.displayName = 'Hotkey.Provider';\n\nexport function Hotkey({ ref, children, ...props }: HotkeyProps) {\n [props, ref] = useContextProps(props, ref ?? null, HotkeyContext);\n const { className, variant = HotkeyStylesDefaults.variant } = props;\n\n return (\n <Keyboard ref={ref} {...props} className={key({ className, variant })}>\n {children}\n </Keyboard>\n );\n}\nHotkey.displayName = 'Hotkey';\n\nexport function HotkeySet({ children, ...props }: HotkeySetProps) {\n const { className } = props;\n\n return (\n <div className={set({ className })}>\n <Icon.Provider size='large'>{children}</Icon.Provider>\n </div>\n );\n}\nHotkeySet.displayName = 'Hotkey.Set';\n\nHotkey.Set = HotkeySet;\nHotkey.Provider = HotkeyProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/hotkey/index.tsx"],"names":["HotkeyStyles","HotkeyContext","createContext","H","m","props","jsx","r","HotkeyProvider","useContextProps","ref","P","HotkeyStylesDefaults","Keyboard","p","className","children","Hotkey","Icon","k"],"mappings":"6PA0BqBA,CAAAA,GAERC,CAAAA,CACXC,CAAAA,KAA0D,CAAA,CAE5DC,YAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IAA0B,WAAU,CAAA,CAAA,CAAGC,QACrC,CAAA,CAAA,CACEC,GAACL,CAAc,CAAA,CAAA,CAAA,OAASM,GAAA,CAAA,CAAA,CAAA,QAAe,CAAA,CAAA,KAAS,CAEpD,CACAC,CAAAA,QAAe,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,iBAiCJ,CAAA,eAAe,CAAA,CAAA,CAAGH,QAC9B,CAAA,CAAII,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMT,CAAa,CAAAU,eAChE,MAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAW,CAAA,SAAUC,CAAqB,CAAA,CAAA,OAAYP,CAAAA,CAE9D,6BACGQ,CAAA,CAAS,CAAA,CAAA,OAAcR,GAAAA,CAAOS,QAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,GAAe,CAAE,CAAA,SAAAC,CAAAA,CAAW,CAAA,CAAA,SAAS,CACjE,CAAA,CAAA,OAAAC,CAAAA,CACH,CAEJ,CACAC,CAAAA,QAAO,CAAA,CAAA,CAAA,CAAA,CAAc,aAErB,CAAA,QAAqB,CAAA,SAAU,CAAA,CAAA,CAAGZ,QAChC,CAAM,CAAE,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,KAAcA,CAAAA,SAGpBC,CAAC,YAAIC,GAAA,CAAA,KAAe,CAAE,CAAA,SAAAQ,CAAU,CAAC,CAAA,CAC/B,SAAAT,CAAAA,CAACY,EAAK,CAAA,QAAL,CAAcX,GAAA,CAAAY,IAAA,CAAA,QAAK,CAAS,aAC/B,CAEJ,QACU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAExBF,aACO,CAAA,CAAA,CAAA,GAAWT,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n Keyboard,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { HotkeyStyles, HotkeyStylesDefaults } from './styles';\nimport type { HotkeyProps, HotkeySetProps } from './types';\n\nconst { key, set } = HotkeyStyles();\n\nexport const HotkeyContext =\n createContext<ContextValue<HotkeyProps, HTMLElement>>(null);\n\nfunction HotkeyProvider({ children, ...props }: ProviderProps<HotkeyProps>) {\n return (\n <HotkeyContext.Provider value={props}>{children}</HotkeyContext.Provider>\n );\n}\nHotkeyProvider.displayName = 'Hotkey.Provider';\n\n/**\n * Hotkey - A visual representation of keyboard shortcuts and key combinations\n *\n * Displays keyboard keys and shortcuts in a consistent, accessible format.\n * Perfect for documentation, help systems, or UI elements that need to show\n * keyboard shortcuts. Supports multiple visual styles including outlined keys,\n * flat presentation, and icon-specific formatting.\n *\n * @example\n * // Basic hotkey display\n * <Hotkey>Ctrl</Hotkey>\n *\n * @example\n * // Hotkey combination with different variants\n * <Hotkey.Set>\n * <Hotkey variant=\"outline\">Cmd</Hotkey>\n * <span>+</span>\n * <Hotkey variant=\"outline\">K</Hotkey>\n * </Hotkey.Set>\n *\n * @example\n * // Flat style for inline text\n * <p>Press <Hotkey variant=\"flat\">Enter</Hotkey> to submit</p>\n *\n * @example\n * // Icon variant for special keys\n * <Hotkey.Set>\n * <Hotkey variant=\"icon\">⌘</Hotkey>\n * <Hotkey>Space</Hotkey>\n * </Hotkey.Set>\n */\nexport function Hotkey({ ref, children, ...props }: HotkeyProps) {\n [props, ref] = useContextProps(props, ref ?? null, HotkeyContext);\n const { className, variant = HotkeyStylesDefaults.variant } = props;\n\n return (\n <Keyboard ref={ref} {...props} className={key({ className, variant })}>\n {children}\n </Keyboard>\n );\n}\nHotkey.displayName = 'Hotkey';\n\nfunction HotkeySet({ children, ...props }: HotkeySetProps) {\n const { className } = props;\n\n return (\n <div className={set({ className })}>\n <Icon.Provider size='large'>{children}</Icon.Provider>\n </div>\n );\n}\nHotkeySet.displayName = 'Hotkey.Set';\n\nHotkey.Set = HotkeySet;\nHotkey.Provider = HotkeyProvider;\n"]}
@@ -9,6 +9,35 @@ declare function IconProvider({ children, ...props }: ProviderProps<IconProps>):
9
9
  declare namespace IconProvider {
10
10
  var displayName: string;
11
11
  }
12
+ /**
13
+ * Icon - A wrapper component for displaying SVG icons with consistent sizing
14
+ *
15
+ * Provides a standardized container for SVG icons with built-in size variants and
16
+ * proper accessibility support. Works seamlessly with the Accelint icon library
17
+ * and supports custom SVG elements with consistent styling and alignment.
18
+ *
19
+ * @example
20
+ * // Basic icon usage
21
+ * <Icon>
22
+ * <Settings />
23
+ * </Icon>
24
+ *
25
+ * @example
26
+ * // Icon with different sizes
27
+ * <Icon size="small">
28
+ * <User />
29
+ * </Icon>
30
+ * <Icon size="large">
31
+ * <Dashboard />
32
+ * </Icon>
33
+ *
34
+ * @example
35
+ * // Icon in button context (automatically inherits sizing)
36
+ * <Button>
37
+ * <Icon><Plus /></Icon>
38
+ * Add Item
39
+ * </Button>
40
+ */
12
41
  declare function Icon({ ref, ...props }: IconProps): react_jsx_runtime.JSX.Element;
13
42
  declare namespace Icon {
14
43
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["createContext","a","props","i","IconProvider","ref","useContextProps","rest","P","Icon"],"mappings":"mLAoBEA,MAAwD,CAAA,CAAAC,aAAA,CAAI,IAE9D,EAAA,oBAAkC,CAAA,CAAGC,CAAM,GACzC,WAAoBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,gBAC/B,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,2BAEN,CAAA,SAAgB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,CAAAA,CAAOG,CAAG,EAAIC,CAAAA,CAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,SAAQ,CAAA,QAAU,CAAA,CAAA,CAAA,gBAAkB,CAAA,CAAA,CAAA,QAAaE,CAAK,GAAIL,CAE1D,WACGC,GAAA,CAAA,OACKI,CAAAA,GACJ,CAAA,CAAKF,GACL,CAAA,CAAA,CAAA,SAAwB,CAAAG,UAAA,CAAA,CAAA,UACxB,CAAA,CAAA,CAAA,CAAA,sBAKN,CACAC,CAAAA,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWL,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { IconStyles } from './styles';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLSpanElement>>(null);\n\nfunction IconProvider({ children, ...props }: ProviderProps<IconProps>) {\n return <IconContext.Provider value={props}>{children}</IconContext.Provider>;\n}\nIconProvider.displayName = 'Icon.Provider';\n\nexport function Icon({ ref, ...props }: IconProps) {\n [props, ref] = useContextProps(props, ref ?? null, IconContext);\n\n const { children, className, size = 'medium', ...rest } = props;\n\n return (\n <span\n {...rest}\n ref={ref}\n className={IconStyles({ className })}\n data-size={size}\n >\n {children}\n </span>\n );\n}\nIcon.displayName = 'Icon';\nIcon.Provider = IconProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["createContext","a","props","i","IconProvider","ref","useContextProps","rest","P","Icon"],"mappings":"mLAoBEA,MAAwD,CAAA,CAAAC,aAAA,CAAI,IAE9D,EAAA,oBAAkC,CAAA,CAAGC,CAAM,GACzC,WAAoBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,gBAC/B,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,2BA+BN,CAAA,SAAgB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,CAAAA,CAAOG,CAAG,EAAIC,CAAAA,CAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,SAAQ,CAAA,QAAU,CAAA,CAAA,CAAA,gBAAkB,CAAA,CAAA,CAAA,QAAaE,CAAK,GAAIL,CAE1D,WACGC,GAAA,CAAA,OACKI,CAAAA,GACJ,CAAA,CAAKF,GACL,CAAA,CAAA,CAAA,SAAwB,CAAAG,UAAA,CAAA,CAAA,UACxB,CAAA,CAAA,CAAA,CAAA,sBAKN,CACAC,CAAAA,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWL,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { IconStyles } from './styles';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLSpanElement>>(null);\n\nfunction IconProvider({ children, ...props }: ProviderProps<IconProps>) {\n return <IconContext.Provider value={props}>{children}</IconContext.Provider>;\n}\nIconProvider.displayName = 'Icon.Provider';\n\n/**\n * Icon - A wrapper component for displaying SVG icons with consistent sizing\n *\n * Provides a standardized container for SVG icons with built-in size variants and\n * proper accessibility support. Works seamlessly with the Accelint icon library\n * and supports custom SVG elements with consistent styling and alignment.\n *\n * @example\n * // Basic icon usage\n * <Icon>\n * <Settings />\n * </Icon>\n *\n * @example\n * // Icon with different sizes\n * <Icon size=\"small\">\n * <User />\n * </Icon>\n * <Icon size=\"large\">\n * <Dashboard />\n * </Icon>\n *\n * @example\n * // Icon in button context (automatically inherits sizing)\n * <Button>\n * <Icon><Plus /></Icon>\n * Add Item\n * </Button>\n */\nexport function Icon({ ref, ...props }: IconProps) {\n [props, ref] = useContextProps(props, ref ?? null, IconContext);\n\n const { children, className, size = 'medium', ...rest } = props;\n\n return (\n <span\n {...rest}\n ref={ref}\n className={IconStyles({ className })}\n data-size={size}\n >\n {children}\n </span>\n );\n}\nIcon.displayName = 'Icon';\nIcon.Provider = IconProvider;\n"]}
@@ -4,11 +4,30 @@ import { ContextValue } from 'react-aria-components';
4
4
  import { InputProps } from './types.js';
5
5
  import 'tailwind-variants';
6
6
  import '../button/types.js';
7
+ import '../../lib/types.js';
7
8
  import '../button/styles.js';
8
9
  import 'tailwind-merge';
9
10
  import './styles.js';
10
11
 
11
12
  declare const InputContext: react.Context<ContextValue<InputProps, HTMLInputElement>>;
13
+ /**
14
+ * Input - A flexible text input component with enhanced features
15
+ *
16
+ * Provides a customizable text input with automatic sizing, clear functionality,
17
+ * and integrated validation states. Supports various styling options and integrates
18
+ * seamlessly with form field components for comprehensive form experiences.
19
+ *
20
+ * @example
21
+ * // Basic input
22
+ * <Input placeholder="Enter text..." />
23
+ *
24
+ * @example
25
+ * // Input with clear button
26
+ * <Input
27
+ * defaultValue="Clearable text"
28
+ * classNames={{ clear: "hover:bg-gray-100" }}
29
+ * />
30
+ */
12
31
  declare function Input({ ref, ...props }: InputProps): react_jsx_runtime.JSX.Element;
13
32
  declare namespace Input {
14
33
  var displayName: string;
@@ -1,2 +1,2 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {CancelFill}from'@accelint/icons';import {useControlledState}from'@react-stately/utils';import {createContext}from'react';import {useContextProps,InputContext,Input,composeRenderProps}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {InputStyles,InputStylesDefaults}from'./styles.js';const {container:w,sizer:A,input:B,clear:F}=InputStyles(),v={target:{value:""}},K=createContext(null);function k({ref:t,...a}){[a,t]=useContextProps(a,t??null,InputContext),[a,t]=useContextProps({...a},t??null,K);const{classNames:u,autoSize:r,defaultValue:h="",disabled:i,placeholder:p,readOnly:c,required:m,size:f,type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[s,b]=useControlledState(g,h),z=(`${s??""}`.length||p?.length)??0,I=s==null||s==="";function d(e){E?.(e),e.defaultPrevented||b(e.target.value);}return jsxs("div",{className:w({className:u?.container,autoSize:r,type:l,isClearable:n}),"data-disabled":i||null,"data-empty":I||null,"data-invalid":x||null,"data-length":z,"data-placeholder":!!p&&I||null,"data-readonly":c||null,"data-required":m||null,"data-size":f,children:[jsx("div",{className:A({className:u?.sizer,autoSize:r,type:l,isClearable:n}),children:jsx(Input,{...N,ref:t,className:composeRenderProps(u?.input,e=>B({className:e,autoSize:r,type:l,isClearable:n})),disabled:i,placeholder:p,readOnly:c,required:m,type:l,value:s,onChange:d,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&d(v);}})}),n&&jsx(Button,{className:composeRenderProps(u?.clear,e=>F({className:e,autoSize:r,type:l,isClearable:n})),excludeFromTabOrder:true,size:"small",variant:"icon",isDisabled:i,onPress:()=>{d(v),t?.current?.focus();},children:jsx(Icon,{children:jsx(CancelFill,{})})})]})}k.displayName="Input";export{k as Input,K as InputContext};//# sourceMappingURL=index.js.map
1
+ import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {CancelFill}from'@accelint/icons';import {useControlledState}from'@react-stately/utils';import {createContext}from'react';import {useContextProps,InputContext,Input,composeRenderProps}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {InputStyles,InputStylesDefaults}from'./styles.js';const {container:w,sizer:A,input:B,clear:F}=InputStyles(),v={target:{value:""}},K=createContext(null);function k({ref:t,...a}){[a,t]=useContextProps(a,t??null,InputContext),[a,t]=useContextProps({...a},t??null,K);const{classNames:u,autoSize:r,defaultValue:h="",disabled:i,placeholder:d,readOnly:c,required:m,size:f="medium",type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[s,b]=useControlledState(g,h),z=(`${s??""}`.length||d?.length)??0,I=s==null||s==="";function p(e){E?.(e),e.defaultPrevented||b(e.target.value);}return jsxs("div",{className:w({className:u?.container,autoSize:r,type:l,isClearable:n}),"data-disabled":i||null,"data-empty":I||null,"data-invalid":x||null,"data-length":z,"data-placeholder":!!d&&I||null,"data-readonly":c||null,"data-required":m||null,"data-size":f,children:[jsx("div",{className:A({className:u?.sizer,autoSize:r,type:l,isClearable:n}),children:jsx(Input,{...N,ref:t,className:composeRenderProps(u?.input,e=>B({className:e,autoSize:r,type:l,isClearable:n})),disabled:i,placeholder:d,readOnly:c,required:m,type:l,value:s,onChange:p,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&p(v);}})}),n&&jsx(Button,{className:composeRenderProps(u?.clear,e=>F({className:e,autoSize:r,type:l,isClearable:n})),excludeFromTabOrder:true,size:"small",variant:"icon",isDisabled:i,onPress:()=>{p(v),t?.current?.focus();},children:jsx(Icon,{children:jsx(CancelFill,{})})})]})}k.displayName="Input";export{k as Input,K as InputContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map