@accelint/design-toolkit 2.4.2 → 2.5.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.
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +1 -5
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/accordion/types.d.ts +9 -10
- package/dist/components/avatar/index.d.ts +4 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.d.ts +16 -15
- package/dist/components/avatar/styles.js +1 -1
- package/dist/components/avatar/styles.js.map +1 -1
- package/dist/components/avatar/types.d.ts +7 -7
- package/dist/components/badge/index.d.ts +3 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/styles.js +1 -1
- package/dist/components/badge/styles.js.map +1 -1
- package/dist/components/badge/types.d.ts +3 -4
- package/dist/components/box/index.js +1 -1
- package/dist/components/box/index.js.map +1 -1
- package/dist/components/button/index.d.ts +6 -4
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +25 -24
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +3 -5
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +19 -18
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +4 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.d.ts +70 -69
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/chip/types.d.ts +5 -5
- package/dist/components/classification-badge/index.d.ts +3 -2
- package/dist/components/classification-badge/index.js +1 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.js +1 -1
- package/dist/components/classification-badge/styles.js.map +1 -1
- package/dist/components/classification-badge/types.d.ts +3 -4
- package/dist/components/classification-banner/index.d.ts +3 -2
- package/dist/components/classification-banner/index.js +1 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.js +1 -1
- package/dist/components/classification-banner/styles.js.map +1 -1
- package/dist/components/classification-banner/types.d.ts +3 -4
- package/dist/components/color-picker/index.d.ts +45 -15
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/styles.d.ts +42 -0
- package/dist/components/color-picker/styles.js +2 -0
- package/dist/components/color-picker/styles.js.map +1 -0
- package/dist/components/color-picker/types.d.ts +13 -0
- package/dist/components/color-picker/types.js +2 -0
- package/dist/components/color-picker/types.js.map +1 -0
- package/dist/components/combobox/index.d.ts +9 -14
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +8 -24
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +69 -0
- package/dist/components/date-field/styles.js +2 -0
- package/dist/components/date-field/styles.js.map +1 -0
- package/dist/components/date-field/types.d.ts +29 -0
- package/dist/components/date-field/types.js +2 -0
- package/dist/components/date-field/types.js.map +1 -0
- package/dist/components/details-list/index.d.ts +59 -0
- package/dist/components/details-list/index.js +2 -0
- package/dist/components/details-list/index.js.map +1 -0
- package/dist/components/details-list/styles.d.ts +65 -0
- package/dist/components/details-list/styles.js +2 -0
- package/dist/components/details-list/styles.js.map +1 -0
- package/dist/components/details-list/types.d.ts +16 -0
- package/dist/components/details-list/types.js +2 -0
- package/dist/components/details-list/types.js.map +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/context.d.ts +13 -0
- package/dist/components/drawer/context.js +2 -0
- package/dist/components/drawer/context.js.map +1 -0
- package/dist/components/drawer/index.d.ts +48 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/drawer/state.d.ts +26 -0
- package/dist/components/drawer/state.js +2 -0
- package/dist/components/drawer/state.js.map +1 -0
- package/dist/components/drawer/styles.d.ts +118 -0
- package/dist/components/drawer/styles.js +2 -0
- package/dist/components/drawer/styles.js.map +1 -0
- package/dist/components/drawer/types.d.ts +279 -0
- package/dist/components/drawer/types.js +2 -0
- package/dist/components/drawer/types.js.map +1 -0
- package/dist/components/hero/index.d.ts +45 -0
- package/dist/components/hero/index.js +2 -0
- package/dist/components/hero/index.js.map +1 -0
- package/dist/components/hero/styles.d.ts +48 -0
- package/dist/components/hero/styles.js +2 -0
- package/dist/components/hero/styles.js.map +1 -0
- package/dist/components/hero/types.d.ts +13 -0
- package/dist/components/hero/types.js +2 -0
- package/dist/components/hero/types.js.map +1 -0
- package/dist/components/icon/index.d.ts +3 -2
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.js +1 -1
- package/dist/components/icon/styles.js.map +1 -1
- package/dist/components/icon/types.d.ts +4 -5
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/input/types.d.ts +1 -0
- package/dist/components/label/index.d.ts +3 -2
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.js +1 -1
- package/dist/components/label/styles.js.map +1 -1
- package/dist/components/label/types.d.ts +2 -3
- package/dist/components/menu/index.d.ts +16 -21
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/navigation-stack/index.d.ts +20 -0
- package/dist/components/navigation-stack/index.js +2 -0
- package/dist/components/navigation-stack/index.js.map +1 -0
- package/dist/components/navigation-stack/types.d.ts +31 -0
- package/dist/components/navigation-stack/types.js +2 -0
- package/dist/components/navigation-stack/types.js.map +1 -0
- package/dist/components/options/index.d.ts +28 -22
- package/dist/components/options/index.js +1 -1
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +72 -0
- package/dist/components/options/styles.js +2 -0
- package/dist/components/options/styles.js.map +1 -0
- package/dist/components/options/types.d.ts +29 -0
- package/dist/components/options/types.js +2 -0
- package/dist/components/options/types.js.map +1 -0
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +16 -15
- package/dist/components/popover/styles.js +1 -1
- package/dist/components/popover/styles.js.map +1 -1
- package/dist/components/query-builder/action-element.js +1 -1
- package/dist/components/query-builder/action-element.js.map +1 -1
- package/dist/components/query-builder/constants.js +1 -1
- package/dist/components/query-builder/constants.js.map +1 -1
- package/dist/components/query-builder/group.js +1 -1
- package/dist/components/query-builder/group.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +5 -20
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule.js +1 -1
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/types.d.ts +22 -0
- package/dist/components/query-builder/types.js +2 -0
- package/dist/components/query-builder/types.js.map +1 -0
- package/dist/components/query-builder/utils.js +1 -1
- package/dist/components/query-builder/utils.js.map +1 -1
- package/dist/components/query-builder/value-editor.js +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +19 -18
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/radio/types.d.ts +2 -3
- package/dist/components/search-field/index.d.ts +56 -15
- package/dist/components/search-field/index.js +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/styles.d.ts +53 -0
- package/dist/components/search-field/styles.js +2 -0
- package/dist/components/search-field/styles.js.map +1 -0
- package/dist/components/search-field/types.d.ts +25 -0
- package/dist/components/search-field/types.js +2 -0
- package/dist/components/search-field/types.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +42 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/styles.d.ts +23 -0
- package/dist/components/skeleton/styles.js +2 -0
- package/dist/components/skeleton/styles.js.map +1 -0
- package/dist/components/skeleton/types.d.ts +8 -0
- package/dist/components/skeleton/types.js +2 -0
- package/dist/components/skeleton/types.js.map +1 -0
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +3 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +13 -12
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +2 -3
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +4 -3
- package/dist/components/text-area-field/index.js +1 -1
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +19 -18
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-area-field/types.d.ts +2 -3
- package/dist/components/text-field/index.d.ts +4 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +19 -18
- package/dist/components/text-field/styles.js +1 -1
- package/dist/components/text-field/styles.js.map +1 -1
- package/dist/components/text-field/types.d.ts +4 -4
- package/dist/components/tooltip/index.d.ts +14 -28
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +5 -0
- package/dist/components/tooltip/styles.js +2 -0
- package/dist/components/tooltip/styles.js.map +1 -0
- package/dist/components/tooltip/types.d.ts +8 -0
- package/dist/components/tooltip/types.js +2 -0
- package/dist/components/tooltip/types.js.map +1 -0
- package/dist/icons/catalog.js +1 -1
- package/dist/index.d.ts +54 -28
- package/dist/index.js +1 -1
- package/dist/lib/react.d.ts +13 -12
- package/dist/lib/react.js +4 -4
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +1341 -278
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/variants/variants.css +6 -0
- package/package.json +81 -58
- package/dist/components/options-item/index.d.ts +0 -30
- package/dist/components/options-item/index.js +0 -2
- package/dist/components/options-item/index.js.map +0 -1
- package/dist/components/query-builder/example-configuration.d.ts +0 -30
- package/dist/components/query-builder/example-configuration.js +0 -2
- package/dist/components/query-builder/example-configuration.js.map +0 -1
@@ -0,0 +1,279 @@
|
|
1
|
+
import { Key, FocusableElement } from '@react-types/shared';
|
2
|
+
import { PropsWithChildren, ReactElement, DOMAttributes } from 'react';
|
3
|
+
|
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 {
|
44
|
+
/**
|
45
|
+
* Which drawers should extend to full container dimensions.
|
46
|
+
* Determines the overall layout structure and drawer relationships in regard to space.
|
47
|
+
*
|
48
|
+
* @default 'left right'
|
49
|
+
*/
|
50
|
+
extend?: DrawerLayouts;
|
51
|
+
/**
|
52
|
+
* Determines how drawer interact with the main content area and overall layout:
|
53
|
+
*
|
54
|
+
* - `'push'`: Drawer pushes the main content aside, reducing its available width.
|
55
|
+
* Content area shrinks to accommodate the panel space.
|
56
|
+
* 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
|
+
* Content remains at full width, panel appears as an overlay.
|
58
|
+
*/
|
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;
|
69
|
+
/**
|
70
|
+
* The placement of the drawer.
|
71
|
+
* @default 'left'
|
72
|
+
*/
|
73
|
+
placement: DrawerPlacement;
|
74
|
+
/**
|
75
|
+
* The size of the drawer.
|
76
|
+
* @default 'medium'
|
77
|
+
*/
|
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 {
|
109
|
+
/**
|
110
|
+
* 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.
|
139
|
+
*/
|
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>;
|
149
|
+
};
|
150
|
+
/**
|
151
|
+
* Props for the 'Drawer.Panel' component.
|
152
|
+
*/
|
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>;
|
167
|
+
/**
|
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
|
184
|
+
*/
|
185
|
+
closeDrawer: (drawerId: Key) => void;
|
186
|
+
/**
|
187
|
+
* A function to get the state of a drawer.
|
188
|
+
* @param drawerId
|
189
|
+
* @returns
|
190
|
+
*/
|
191
|
+
getDrawerState: (drawerId: Key) => DrawerState;
|
192
|
+
/**
|
193
|
+
* A function to register a drawer.
|
194
|
+
* @param initialState
|
195
|
+
* @param callbacks
|
196
|
+
* @returns
|
197
|
+
*/
|
198
|
+
registerDrawer: (initialState: DrawerState, callbacks?: {
|
199
|
+
onOpenChange?: OnOpenChangeCallback;
|
200
|
+
onStateChange?: (state: DrawerState) => void;
|
201
|
+
}) => void;
|
202
|
+
/**
|
203
|
+
* A function to check if a menu item is selected.
|
204
|
+
* @param selectedMenuItemId
|
205
|
+
* @param menuItemId
|
206
|
+
* @returns
|
207
|
+
*/
|
208
|
+
isSelectedMenuItem: (selectedMenuItemId?: Key, menuItemId?: Key) => boolean;
|
209
|
+
};
|
210
|
+
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;
|
277
|
+
};
|
278
|
+
|
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 };
|
@@ -0,0 +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"]}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import * as react_aria_components from 'react-aria-components';
|
2
|
+
import { ContextValue } from 'react-aria-components';
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
|
+
import * as react from 'react';
|
5
|
+
import { HeroProps } from './types.js';
|
6
|
+
|
7
|
+
declare const HeroContext: react.Context<ContextValue<HeroProps, HTMLElement>>;
|
8
|
+
/**
|
9
|
+
* A versatile hero component that displays an icon alongside primary and secondary content.
|
10
|
+
* Automatically organizes child components by type and supports both stacked and grid layouts.
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```tsx
|
14
|
+
* // Basic hero with icon and content
|
15
|
+
* <Hero>
|
16
|
+
* <Icon><Placeholder /></Icon>
|
17
|
+
* <Hero.Title>Primary Title</Hero.Title>
|
18
|
+
* <Hero.Subtitle>Secondary information</Hero.Subtitle>
|
19
|
+
* </Hero>
|
20
|
+
*
|
21
|
+
* // Grid layout for compact display
|
22
|
+
* <Hero compact>
|
23
|
+
* <Icon><Settings /></Icon>
|
24
|
+
* <Hero.Title>Settings</Hero.Title>
|
25
|
+
* <Hero.Subtitle>Configure your preferences</Hero.Subtitle>
|
26
|
+
* </Hero>
|
27
|
+
* ```
|
28
|
+
*
|
29
|
+
* ## Child Component Behavior
|
30
|
+
* - **Icon**: Only one allowed
|
31
|
+
* - **Hero.Title**: Only one allowed
|
32
|
+
* - **Hero.Subtitle**: Any number allowed as secondary content
|
33
|
+
*
|
34
|
+
* ## Layout Modes
|
35
|
+
* - **Stack** (default): Vertical layout with larger icon and stacked content
|
36
|
+
* - **Grid** (compact=true): Horizontal layout with smaller icon beside content
|
37
|
+
*/
|
38
|
+
declare function Hero({ ref, ...props }: HeroProps): react_jsx_runtime.JSX.Element;
|
39
|
+
declare namespace Hero {
|
40
|
+
var displayName: string;
|
41
|
+
var Title: react.ForwardRefExoticComponent<react_aria_components.HeadingProps & react.RefAttributes<HTMLHeadingElement>>;
|
42
|
+
var Subtitle: react.ForwardRefExoticComponent<react_aria_components.TextProps & react.RefAttributes<HTMLElement>>;
|
43
|
+
}
|
44
|
+
|
45
|
+
export { Hero, HeroContext };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {containsExactChildren}from'./../../lib/react.js';import {createContext}from'react';import {Text,useContextProps,Provider,HeadingContext,TextContext,Header,Heading}from'react-aria-components';import {Icon,IconContext}from'../icon/index.js';import {HeroStyles}from'./styles.js';const {hero:b,icon:f,title:P,subtitle:S}=HeroStyles(),g=createContext(null);function e({ref:o,...a}){[a,o]=useContextProps(a,o??null,g);const{children:l,classNames:t,compact:i,...s}=a;return containsExactChildren({children:l,componentName:e.displayName,restrictions:[[Icon,{min:1,max:1}],[e.Title,{min:1,max:1}],[e.Subtitle,{min:0}]]}),jsx(Provider,{values:[[IconContext,{className:f({className:t?.icon}),size:"large"}],[HeadingContext,{className:P({className:t?.title}),level:2}],[TextContext,{className:S({className:t?.subtitle})}]],children:jsx(Header,{...s,ref:o,className:b({className:t?.hero}),"data-layout":i?"grid":"stack",children:l})})}e.displayName="Hero",e.Title=Heading,e.Title.displayName="Hero.Title",e.Subtitle=Text,e.Subtitle.displayName="Hero.Subtitle";export{e as Hero,g as HeroContext};//# sourceMappingURL=index.js.map
|
2
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/hero/index.tsx"],"names":["subtitle","HeroStyles","HeroContext","Hero","ref","props","N","children","compact","m","jsx","Provider","icon","C","classNames","HeadingContext","title","u","H","rest","r","hero","p","Text","x"],"mappings":"oVA8B2B,MAAA,CAAA,IAAA,CAAA,CAAA,CAAAA,IAAaC,CAAW,CAAA,CAEtCC,KACyC,CAAA,CAAA,CAAI,WAgC1CC,CAAAA,UAAK,KAAEC,aAAAA,CAAK,IAAS,EAAc,SAClBC,CAAAA,CAAOD,CAAAA,GAAO,CAAA,CAAA,CAAA,GAAiB,CAE9D,CAAA,CAAA,CAAA,CAAA,CAAM,CAAE,CAAA,CAAA,CAAAE,eAAA,CAAA,CAAA,CAAA,CAAA,EAAAC,IAAU,CAAA,CAAA,CAAA,CAAA,MAAY,QAAAC,CAAAA,CAAS,CAAA,oBAGrC,CAAA,CAAA,CAAA,GAAAD,CAAAA,CACA,CAAA,CAAA,CAAA,OAAAE,qBAAA,CAAA,CAAA,wBACA,CAAA,CAAA,CAAA,YACmB,oBACJ,CAAE,GAAA,CAAK,EAAG,GAAA,CAAK,CAAE,CAAC,CAAA,CAC/B,CAACN,CAAAA,CAAK,KAAA,CAAA,CAAA,GAAY,CAAA,CAAA,CAAA,GAAQ,CAC5B,CACF,CAAC,CAAA,CAGCO,CAAAA,CAACC,SACC,CAAQ,CACN,GAEE,CAAE,mBAAWC,CAAAA,CAAK,MAAE,CAAA,CAAA,CAAAC,WAAA,CAAWC,CAAAA,SAAqB,CAAA,CAAA,CAAA,CAAA,SACtD,CAAA,CACA,EACEC,IACE,CAAA,CAAA,CAAA,IAAA,CAAWC,OAAQ,CAAA,CAAA,CAAA,CAAAC,cAAA,CAAWH,CAAAA,SAAmB,CAAG,CAAA,CAAA,CAAA,UAItD,CAAE,EAAA,KAAA,CAAA,CAAA,CAAWd,KAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAkB,WAAA,CAAWJ,UAAY,CAAS,CAAC,CAAE,CAC7D,aAGFJ,QACMS,CACJ,CAAA,CAAA,CAAA,CAAKf,SACL,CAAAgB,GAAA,CAAWC,MAAAA,CAAK,CAAE,GAAA,CAAA,CAAA,GAAA,CAAA,CAAWP,CAAAA,SAC7B,CAAA,CAAA,CAAA,CAAA,SAAA,CAAaN,CAAAA,EAAU,IAAA,CAAA,CAAS,CAAA,aAE/B,CAAA,CAAA,CAAAD,MAKTJ,CAAAA,OAAK,CAAA,QAAc,CAAA,CAAA,CAAA,CACnBA,EAAK,CAAA,CAAA,CAAA,WACA,CAAA,MAAM,CAAA,CAAA,CAAA,KAAc,CAAAmB,OAAA,CAAA,CAAA,CAAA,KAAA,CAAA,WACpB,CAAWC,YACX,CAAS,CAAA,CAAA,QAAA,CAAAC,IAAc,CAAA,CAAA,CAAA,QAAA,CAAA,WAAA,CAAA,eAAA","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'use client';\n\nimport 'client-only';\nimport { containsExactChildren } from '@/lib/react';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n Header,\n Heading,\n HeadingContext,\n Provider,\n Text,\n TextContext,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon, IconContext } from '../icon';\nimport { HeroStyles } from './styles';\nimport type { HeroProps } from './types';\n\nconst { hero, icon, title, subtitle } = HeroStyles();\n\nexport const HeroContext =\n createContext<ContextValue<HeroProps, HTMLElement>>(null);\n\n/**\n * A versatile hero component that displays an icon alongside primary and secondary content.\n * Automatically organizes child components by type and supports both stacked and grid layouts.\n *\n * @example\n * ```tsx\n * // Basic hero with icon and content\n * <Hero>\n * <Icon><Placeholder /></Icon>\n * <Hero.Title>Primary Title</Hero.Title>\n * <Hero.Subtitle>Secondary information</Hero.Subtitle>\n * </Hero>\n *\n * // Grid layout for compact display\n * <Hero compact>\n * <Icon><Settings /></Icon>\n * <Hero.Title>Settings</Hero.Title>\n * <Hero.Subtitle>Configure your preferences</Hero.Subtitle>\n * </Hero>\n * ```\n *\n * ## Child Component Behavior\n * - **Icon**: Only one allowed\n * - **Hero.Title**: Only one allowed\n * - **Hero.Subtitle**: Any number allowed as secondary content\n *\n * ## Layout Modes\n * - **Stack** (default): Vertical layout with larger icon and stacked content\n * - **Grid** (compact=true): Horizontal layout with smaller icon beside content\n */\nexport function Hero({ ref, ...props }: HeroProps) {\n [props, ref] = useContextProps(props, ref ?? null, HeroContext);\n\n const { children, classNames, compact, ...rest } = props;\n\n containsExactChildren({\n children,\n componentName: Hero.displayName,\n restrictions: [\n [Icon, { min: 1, max: 1 }],\n [Hero.Title, { min: 1, max: 1 }],\n [Hero.Subtitle, { min: 0 }],\n ],\n });\n\n return (\n <Provider\n values={[\n [\n IconContext,\n { className: icon({ className: classNames?.icon }), size: 'large' },\n ],\n [\n HeadingContext,\n { className: title({ className: classNames?.title }), level: 2 },\n ],\n [\n TextContext,\n { className: subtitle({ className: classNames?.subtitle }) },\n ],\n ]}\n >\n <Header\n {...rest}\n ref={ref}\n className={hero({ className: classNames?.hero })}\n data-layout={compact ? 'grid' : 'stack'}\n >\n {children}\n </Header>\n </Provider>\n );\n}\nHero.displayName = 'Hero';\nHero.Title = Heading;\nHero.Title.displayName = 'Hero.Title';\nHero.Subtitle = Text;\nHero.Subtitle.displayName = 'Hero.Subtitle';\n"]}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
2
|
+
import * as tailwind_merge from 'tailwind-merge';
|
3
|
+
|
4
|
+
declare const HeroStyles: tailwind_variants.TVReturnType<{
|
5
|
+
[key: string]: {
|
6
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
7
|
+
icon?: tailwind_merge.ClassNameValue;
|
8
|
+
title?: tailwind_merge.ClassNameValue;
|
9
|
+
hero?: tailwind_merge.ClassNameValue;
|
10
|
+
subtitle?: tailwind_merge.ClassNameValue;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
} | {
|
14
|
+
[x: string]: {
|
15
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
16
|
+
icon?: tailwind_merge.ClassNameValue;
|
17
|
+
title?: tailwind_merge.ClassNameValue;
|
18
|
+
hero?: tailwind_merge.ClassNameValue;
|
19
|
+
subtitle?: tailwind_merge.ClassNameValue;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
} | {}, {
|
23
|
+
hero: string;
|
24
|
+
icon: string;
|
25
|
+
title: string;
|
26
|
+
subtitle: string;
|
27
|
+
}, undefined, {
|
28
|
+
[key: string]: {
|
29
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
30
|
+
icon?: tailwind_merge.ClassNameValue;
|
31
|
+
title?: tailwind_merge.ClassNameValue;
|
32
|
+
hero?: tailwind_merge.ClassNameValue;
|
33
|
+
subtitle?: tailwind_merge.ClassNameValue;
|
34
|
+
};
|
35
|
+
};
|
36
|
+
} | {}, {
|
37
|
+
hero: string;
|
38
|
+
icon: string;
|
39
|
+
title: string;
|
40
|
+
subtitle: string;
|
41
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
42
|
+
hero: string;
|
43
|
+
icon: string;
|
44
|
+
title: string;
|
45
|
+
subtitle: string;
|
46
|
+
}, undefined, unknown, unknown, undefined>>;
|
47
|
+
|
48
|
+
export { HeroStyles };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const l=tv({slots:{hero:"group/hero relative flex flex-col layout-stack:rounded-large layout-stack:bg-transparent-light layout-stack:px-l layout-stack:py-xl layout-grid:pl-xxl",icon:"fg-default-dark -order-3 group-layout-grid/hero:absolute group-layout-grid/hero:top-xxs group-layout-grid/hero:left-xs group-layout-stack/hero:mb-l group-layout-stack/hero:size-[48px]",title:"fg-default-light -order-2 mb-xs font-display text-header-l",subtitle:"fg-default-dark -order-1 block font-display text-body-s"}});export{l as HeroStyles};//# sourceMappingURL=styles.js.map
|
2
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/hero/styles.ts"],"names":["t"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAM,CAAA,CAAA,IAAA,CAAA,wJACA,CAAA,IAAA,CAAA,4PAEI,CAAA,QAAA,CAAA,yDAEb,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const HeroStyles = tv({\n slots: {\n hero: 'group/hero relative flex flex-col layout-stack:rounded-large layout-stack:bg-transparent-light layout-stack:px-l layout-stack:py-xl layout-grid:pl-xxl',\n icon: 'fg-default-dark -order-3 group-layout-grid/hero:absolute group-layout-grid/hero:top-xxs group-layout-grid/hero:left-xs group-layout-stack/hero:mb-l group-layout-stack/hero:size-[48px]',\n title: 'fg-default-light -order-2 mb-xs font-display text-header-l',\n subtitle: 'fg-default-dark -order-1 block font-display text-body-s',\n },\n});\n"]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
2
|
+
|
3
|
+
type HeroProps = Omit<ComponentPropsWithRef<'header'>, 'className'> & {
|
4
|
+
classNames?: {
|
5
|
+
hero?: string;
|
6
|
+
icon?: string;
|
7
|
+
title?: string;
|
8
|
+
subtitle?: string;
|
9
|
+
};
|
10
|
+
compact?: boolean;
|
11
|
+
};
|
12
|
+
|
13
|
+
export type { HeroProps };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as react from 'react';
|
3
|
+
import { ProviderProps } from '../../lib/types.js';
|
3
4
|
import { ContextValue } from 'react-aria-components';
|
4
|
-
import { IconProps
|
5
|
+
import { IconProps } from './types.js';
|
5
6
|
|
6
7
|
declare const IconContext: react.Context<ContextValue<IconProps, HTMLSpanElement>>;
|
7
|
-
declare function IconProvider({ children, ...props }:
|
8
|
+
declare function IconProvider({ children, ...props }: ProviderProps<IconProps>): react_jsx_runtime.JSX.Element;
|
8
9
|
declare namespace IconProvider {
|
9
10
|
var displayName: string;
|
10
11
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {createContext}from'react';import {useContextProps}from'react-aria-components';import {IconStyles}from'./styles.js';
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps}from'react-aria-components';import {IconStyles}from'./styles.js';const r=createContext(null);function t({children:o,...e}){return jsx(r.Provider,{value:e,children:o})}t.displayName="Icon.Provider";function n({ref:o,...e}){[e,o]=useContextProps(e,o??null,r);const{children:p,className:s,size:c="medium",...m}=e;return jsx("span",{...m,ref:o,className:IconStyles({className:s}),"data-size":c,children:p})}n.displayName="Icon",n.Provider=t;export{n as Icon,r as IconContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["
|
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,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
1
|
+
import {tv}from'./../../lib/utils.js';const e=tv({base:["block h-[var(--icon-size,var(--icon-size-m))] w-[var(--icon-size,var(--icon-size-m))] flex-none [color:var(--icon-color,currentColor)]","size-large:[--icon-size:var(--icon-size-l)]","size-medium:[--icon-size:var(--icon-size-m)]","size-small:[--icon-size:var(--icon-size-s)]","size-xsmall:[--icon-size:var(--icon-size-xs)]"]});export{e as IconStyles};//# sourceMappingURL=styles.js.map
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/icon/styles.ts"],"names":[
|
1
|
+
{"version":3,"sources":["../../../src/components/icon/styles.ts"],"names":[],"mappings":"sCAeE,MAAM,CACJ,mJACA,CAAA,6CACA,CAAA,8CACA,CAAA,6CACA,CAAA,+CAEH,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const IconStyles = tv({\n base: [\n 'block h-[var(--icon-size,var(--icon-size-m))] w-[var(--icon-size,var(--icon-size-m))] flex-none [color:var(--icon-color,currentColor)]',\n 'size-large:[--icon-size:var(--icon-size-l)]',\n 'size-medium:[--icon-size:var(--icon-size-m)]',\n 'size-small:[--icon-size:var(--icon-size-s)]',\n 'size-xsmall:[--icon-size:var(--icon-size-xs)]',\n ],\n});\n"]}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
2
2
|
|
3
|
-
type IconProps =
|
3
|
+
type IconProps = ComponentPropsWithRef<'span'> & {
|
4
4
|
size?: 'large' | 'medium' | 'small' | 'xsmall';
|
5
|
-
}
|
6
|
-
type IconProviderProps = PropsWithChildren<IconProps>;
|
5
|
+
};
|
7
6
|
|
8
|
-
export type { IconProps
|
7
|
+
export type { IconProps };
|
@@ -5,6 +5,7 @@ import { InputProps } from './types.js';
|
|
5
5
|
import 'tailwind-variants';
|
6
6
|
import '../button/types.js';
|
7
7
|
import '../button/styles.js';
|
8
|
+
import 'tailwind-merge';
|
8
9
|
import './styles.js';
|
9
10
|
|
10
11
|
declare const InputContext: react.Context<ContextValue<InputProps, HTMLInputElement>>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
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';
|
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:r,autoSize:s,defaultValue:h="",disabled:p,placeholder:d,readOnly:m,required:I,size:f,type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[i,b]=useControlledState(g,h),z=(`${i??""}`.length||d?.length)??0,o=i==null||i==="";function c(e){E?.(e),e.defaultPrevented||b(e.target.value);}return jsxs("div",{className:w({className:r?.container,autoSize:s,type:l,isClearable:n,isEmpty:o}),"data-disabled":p||null,"data-invalid":x||null,"data-length":z,"data-placeholder":!!d&&o||null,"data-readonly":m||null,"data-required":I||null,"data-size":f,children:[jsx("div",{className:A({className:r?.sizer,autoSize:s,type:l,isClearable:n,isEmpty:o}),children:jsx(Input,{...N,ref:t,className:composeRenderProps(r?.input,e=>B({className:e,autoSize:s,type:l,isClearable:n,isEmpty:o})),disabled:p,placeholder:d,readOnly:m,required:I,type:l,value:i,onChange:c,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&c(v);}})}),n&&jsx(Button,{className:composeRenderProps(r?.clear,e=>F({className:e,autoSize:s,type:l,isClearable:n,isEmpty:o})),excludeFromTabOrder:true,size:"small",variant:"icon",isDisabled:p,onPress:()=>{c(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
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/input/index.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/input/index.tsx"],"names":["clear","clearInputEvent","M","InputContext","createContext","Input","ref","props","useContextProps","C","q","autoSize","defaultValue","placeholder","readOnly","required","type","valueProp","isInvalid","onChange","onKeyDown","value","setValue","length","isEmpty","handleChange","event","jsxs","R","classNames","jsx","u","AriaInput","composeRenderProps","className","input","y","disabled","isClearable","D"],"mappings":"8ZA8B0B,MAAA,CAAA,SAAO,CAAAA,CAAM,CAAA,KAGjCC,CAAAA,CAAkB,CACtB,OAAQ,CAAE,KAAA,CAAO,EAAG,CACtBC,WAAA,EAEaC,CACXC,CAAAA,CAA0D,OAErD,CAAA,CAAA,KAAA,CAASC,EAAM,CAAE,CAAA,CAAA,CAAA,CAAAC,cAAK,IAAS,EAAe,SASpBC,CAAAA,CAAOD,CAAAA,SAA6B,CACnE,CAACC,CAAAA,CAAOD,CAAG,CAAA,CAAIE,CAAAA,CAAgB,CAAEC,eAAA,CAAA,CAAGF,CAAM,GAAGD,IAAO,CAAAI,YAAA,CAAMP,CAAY,CAAA,CAEtE,mBAAM,CACJ,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,EAAA,IACA,CAAA,CAAA,CAAA,CAAA,KAAAQ,CACA,aAAAC,QACA,CAAA,CAAA,CAAA,iBACAC,CAAAA,QACA,CAAA,CAAAC,YACAC,CACA,UACA,CAAA,CAAAC,CAAAA,QACA,CAAA,CAAA,CAAA,IAAOC,CACP,iCACA,CAAA,KAAA,CAAA,CAAA,CAAAC,WACAC,CAAAA,CACA,CAAA,SAAAC,CAAAA,CACA,SAGKC,CAAAA,CAAOC,CAAQ,SAChBC,CAAAA,CAAAA,CAAU,GAAGF,GAAS,CAAA,CAAE,CAAA,CAAA,CAAG,yBAAUR,CAAAA,CAAAA,CAAa,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,EAAW,CAC7DW,CAAAA,CAAUH,MAAS,EAAA,CAAQA,EAAAA,MAEjC,GAAA,CAAA,CAAA,CAAA,CAAA,CAASI,EAAaC,IACpBP,EAAAA,CAAWO,GAENA,EAAM,mBACTJ,CAASI,CAAAA,CAAM,kBAInB,EAAA,CACEC,CAAAA,CAAC,CAAA,MACC,CAAA,KAAA,EAAA,CAAA,OACEC,IAAA,CAAA,KAAA,CAAWC,UAAY,CAAA,CAAA,CACvB,CAAA,UACA,CAAA,EAAA,SACA,CAAA,QACA,QAAAL,CACF,CAAC,WACD,CAAA,CAAA,CAAA,OAA2B,KAC3B,eAAcN,CAAAA,CAAAA,EAAa,IAC3B,CAAA,eACA,CAAA,EAAA,IAAA,CAAA,aAAqBL,CAAAA,CAAAA,CAAeW,kBACpC,CAAA,CAAA,CAAA,CAAA,EAAeV,CAAAA,EAAY,IAAA,CAC3B,eAAA,CAAeC,GAAY,IAAA,CAC3B,eAEA,CAAA,CAAA,EAAA,IAAA,CAAAe,WACE,CAAA,CAAA,CAAA,QACE,CAAA,CAAAC,GAAA,CAAA,KAAA,CAAWF,UACX,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAAb,EACA,cACA,CAAA,CAAA,CAAA,IAAA,CAAAQ,CACF,CAAC,WAEDM,CAAAA,CAACE,QAEC,CAAA,CAAA,CAAA,CAAK1B,CAAAA,QACL,CAAAyB,GAAA,CAAWE,KAAAA,CAAmBJ,IAAY,CAAA,CAAA,GAAQK,CAAAA,CAAAA,CAChDC,SAAQ,CAAAC,kBAAA,CAAA,CAAAF,EAAW,KAAA,CAAA,CAAA,EAAAvB,CAAAA,CAAU,UAAM,CAAA,CAAA,CAAA,QAAa,CAAA,CAAA,CAAA,IAAA,CAAAa,CAAQ,CAAC,YAEjDa,CAAAA,CACV,OAAA,CAAA,CAAA,CAAA,CAAA,CAAaxB,CAAAA,QACb,CAAA,CAAUC,YACAC,CACV,UACA,CAAA,CAAA,CAAOM,QACP,CAAA,CAAA,CAAUI,IACV,CAAA,CAAA,CAAA,KAAYC,CAAAA,CAAAA,CAAU,QAIlBY,CAAAA,CAAAA,CACA,SAAO,CAAA,CAAA,EAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CACPZ,CAAAA,EAAM,CAAA,CAAA,CAAA,gBAIV,EACF,CAAA,CACF,MAEEI,QACE,EAAA,CAAA,CAAA,CAAA,EAAWG,EAAmBJ,CAAAA,CAAAA,CAAY,CAAA,CAAA,EAAAE,GAAA,CAAQG,QAChDlC,8BAAQkC,EAAW,KAAA,CAAA,CAAA,EAAAvB,CAAAA,CAAU,CAAA,SAAM,CAAA,CAAA,CAAA,QAAa,QAAAa,CAAQ,CAAC,WAE3D,CAAA,CAAA,CAAA,OAAA,CAAA,CAAmB,CAAA,CAAA,CACnB,CAAA,mBACA,CAAQ,IAAA,CAAA,IACR,gBACA,CAAA,iBAGO,CAAA,CAAA,CAAA,OAAS,CAAA,IAAM,CACtB,CAAA,CAEA,CAAA,CAAA,CAAA,CAAA,EAAA,OAAC,WACCM,CAAAA,QACF,CACFC,QAEJ,CAEJ,CACA1B,QAAM,CAAA0B,GAAA,CAAAQ,UAAA,CAAA,EAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,OAAA","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 { CancelFill } from '@accelint/icons';\nimport { useControlledState } from '@react-stately/utils';\nimport { type ChangeEvent, createContext } from 'react';\nimport {\n Input as AriaInput,\n InputContext as AriaInputContext,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { InputStyles, InputStylesDefaults } from './styles';\nimport type { InputProps } from './types';\n\nconst { container, sizer, input, clear } = InputStyles();\n\n// TODO: Improve this implementation so it is more of a realistic event\nconst clearInputEvent = {\n target: { value: '' },\n} as ChangeEvent<HTMLInputElement>;\n\nexport const InputContext =\n createContext<ContextValue<InputProps, HTMLInputElement>>(null);\n\nexport function Input({ ref, ...props }: InputProps) {\n /**\n * It is necessary to pull in the AriaInputContext to capture defaultValue,\n * value & onChange props that may be supplied by a Field component\n *\n * These are necessary due to the implementation of useControlledState for\n * the purposes of supporting the clear button and to capture the length\n * of the current value for the autoSize feature\n */\n [props, ref] = useContextProps(props, ref ?? null, AriaInputContext);\n [props, ref] = useContextProps({ ...props }, ref ?? null, InputContext);\n\n const {\n classNames,\n autoSize,\n defaultValue = '',\n disabled,\n placeholder,\n readOnly,\n required,\n size,\n type = InputStylesDefaults.type,\n value: valueProp,\n isClearable,\n isInvalid,\n onChange,\n onKeyDown,\n ...rest\n } = props;\n\n const [value, setValue] = useControlledState(valueProp, defaultValue);\n const length = (`${value ?? ''}`.length || placeholder?.length) ?? 0;\n const isEmpty = value == null || value === '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.target.value);\n }\n }\n\n return (\n <div\n className={container({\n className: classNames?.container,\n autoSize,\n type,\n isClearable,\n isEmpty,\n })}\n data-disabled={disabled || null}\n data-invalid={isInvalid || null}\n data-length={length}\n data-placeholder={(!!placeholder && isEmpty) || null}\n data-readonly={readOnly || null}\n data-required={required || null}\n data-size={size}\n >\n <div\n className={sizer({\n className: classNames?.sizer,\n autoSize,\n type,\n isClearable,\n isEmpty,\n })}\n >\n <AriaInput\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className, autoSize, type, isClearable, isEmpty }),\n )}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n type={type}\n value={value}\n onChange={handleChange}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n\n if (\n isClearable &&\n !event.defaultPrevented &&\n event.key === 'Escape'\n ) {\n handleChange(clearInputEvent);\n }\n }}\n />\n </div>\n {isClearable && (\n <Button\n className={composeRenderProps(classNames?.clear, (className) =>\n clear({ className, autoSize, type, isClearable, isEmpty }),\n )}\n excludeFromTabOrder\n size='small'\n variant='icon'\n isDisabled={disabled}\n onPress={() => {\n handleChange(clearInputEvent);\n\n ref?.current?.focus();\n }}\n >\n <Icon>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </div>\n );\n}\nInput.displayName = 'Input';\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
1
|
+
import {tv}from'./../../lib/utils.js';const t={type:"text"},i=tv({slots:{container:"group/input grid items-center [--length:attr(data-length_type(<number>),0)] [grid-template-columns:minmax(0,1fr)_min-content]",sizer:["[grid-column:1/-1] [grid-row:1]","font-display group-size-medium/input:text-body-s group-size-small/input:text-body-xs"],input:["block w-full rounded-medium py-xs pr-[calc(var(--room)+var(--spacing-s))] pl-s font-display text-default-light outline outline-interactive","enabled:group-focus/input:outline-highlight","enabled:group-hover/input:outline-interactive-hover","enabled:group-invalid/input:outline-serious","disabled:cursor-not-allowed disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled"],clear:["[grid-column:2/-1] [grid-row:1]","group-size-medium/input:mr-xs group-size-small/input:mr-xxs","enabled:fg-interactive enabled:bg-transparent","enabled:focus:fg-interactive-hover enabled:focus:bg-transparent","enabled:hover:fg-interactive-hover enabled:hover:bg-transparent"]},variants:{autoSize:{false:"",true:""},type:{button:"",checkbox:"",color:"",date:"","datetime-local":"",email:"",file:"",hidden:"",image:"",month:"",number:{input:"[appearance:textfield] placeholder:text-default-dark [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"},password:"",radio:"",range:"",reset:"",search:"",submit:"",tel:"",text:"",time:"",url:"",week:""},isClearable:{false:{container:"[--room:0px]"},true:{container:"[--room:20px]"}},isEmpty:{false:{clear:"group-not-focus-within/input:hidden"},true:{clear:"hidden"}}},compoundVariants:[{type:["color","date","datetime-local","email","number","password","search","tel","text","time","url"],className:{sizer:["group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]","group-size-medium/input:min-w-[80px] group-size-small/input:max-w-[200px]"]}},{autoSize:true,type:["number","text"],className:{sizer:["group-size-medium/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-s-spacing))+(var(--spacing-s)*2)+var(--room))]","group-size-small/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))] group-size-small/input:min-w-[calc(2ch+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))]"]}}],defaultVariants:t});export{i as InputStyles,t as InputStylesDefaults};//# sourceMappingURL=styles.js.map
|
2
2
|
//# sourceMappingURL=styles.js.map
|