@accelint/design-toolkit 2.6.0 → 4.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.
- package/dist/components/accordion/index.d.ts +42 -0
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +1 -1
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/avatar/index.d.ts +29 -0
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.d.ts +1 -1
- package/dist/components/badge/index.d.ts +24 -0
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/styles.d.ts +1 -1
- package/dist/components/button/index.d.ts +104 -0
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +31 -109
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +6 -4
- package/dist/components/checkbox/index.d.ts +33 -0
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +4 -4
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +34 -0
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.d.ts +4 -4
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/classification-badge/index.d.ts +15 -0
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-banner/index.d.ts +11 -0
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/color-picker/styles.d.ts +1 -1
- package/dist/components/color-picker/styles.js +1 -1
- package/dist/components/color-picker/styles.js.map +1 -1
- package/dist/components/combobox-field/index.d.ts +1 -0
- package/dist/components/combobox-field/styles.d.ts +6 -6
- package/dist/components/combobox-field/styles.js +1 -1
- package/dist/components/combobox-field/styles.js.map +1 -1
- package/dist/components/combobox-field/types.d.ts +1 -0
- package/dist/components/date-field/index.d.ts +45 -3
- 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 +41 -51
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/date-field/types.d.ts +12 -15
- package/dist/components/details-list/styles.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +48 -36
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/styles.d.ts +60 -0
- package/dist/components/dialog/styles.js +2 -0
- package/dist/components/dialog/styles.js.map +1 -0
- package/dist/components/dialog/types.d.ts +14 -0
- package/dist/components/dialog/types.js +2 -0
- package/dist/components/dialog/types.js.map +1 -0
- package/dist/components/drawer/events.d.ts +8 -0
- package/dist/components/drawer/events.js +2 -0
- package/dist/components/drawer/events.js.map +1 -0
- package/dist/components/drawer/index.d.ts +89 -43
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/styles.d.ts +50 -16
- package/dist/components/drawer/styles.js +1 -1
- package/dist/components/drawer/styles.js.map +1 -1
- package/dist/components/drawer/types.d.ts +154 -238
- package/dist/components/drawer/types.js +1 -1
- package/dist/components/drawer/types.js.map +1 -1
- package/dist/components/hero/styles.d.ts +1 -1
- package/dist/components/hotkey/index.d.ts +32 -1
- package/dist/components/hotkey/index.js +1 -1
- package/dist/components/hotkey/index.js.map +1 -1
- package/dist/components/hotkey/styles.d.ts +1 -1
- package/dist/components/icon/index.d.ts +29 -0
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.d.ts +1 -1
- package/dist/components/input/index.d.ts +19 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.d.ts +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 +19 -0
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.d.ts +1 -1
- package/dist/components/menu/index.d.ts +69 -7
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.d.ts +11 -38
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/menu/types.d.ts +11 -16
- package/dist/components/options/index.d.ts +41 -0
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +6 -6
- package/dist/components/options/styles.js +1 -1
- package/dist/components/options/styles.js.map +1 -1
- package/dist/components/options/types.d.ts +1 -1
- package/dist/components/popover/index.d.ts +36 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +1 -1
- package/dist/components/query-builder/index.d.ts +24 -0
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/radio/index.d.ts +31 -0
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +4 -4
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/search-field/styles.d.ts +1 -1
- package/dist/components/search-field/styles.js +1 -1
- package/dist/components/search-field/styles.js.map +1 -1
- package/dist/components/search-field/types.d.ts +1 -0
- package/dist/components/select-field/index.d.ts +44 -0
- package/dist/components/select-field/index.js +1 -1
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.d.ts +7 -7
- package/dist/components/select-field/styles.js +1 -1
- package/dist/components/select-field/styles.js.map +1 -1
- package/dist/components/select-field/types.d.ts +1 -0
- package/dist/components/skeleton/styles.d.ts +1 -1
- package/dist/components/slider/index.d.ts +15 -20
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/styles.d.ts +84 -0
- package/dist/components/slider/styles.js +2 -0
- package/dist/components/slider/styles.js.map +1 -0
- package/dist/components/slider/types.d.ts +22 -0
- package/dist/components/slider/types.js +2 -0
- package/dist/components/slider/types.js.map +1 -0
- package/dist/components/switch/index.d.ts +36 -0
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +24 -22
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +1 -0
- package/dist/components/tabs/index.d.ts +46 -0
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +20 -0
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +7 -7
- 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-field/index.d.ts +62 -0
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +7 -7
- package/dist/components/text-field/types.d.ts +1 -0
- package/dist/components/tooltip/index.d.ts +42 -0
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +1 -1
- package/dist/components/view-stack/events.d.ts +9 -0
- package/dist/components/view-stack/events.js +2 -0
- package/dist/components/view-stack/events.js.map +1 -0
- package/dist/components/view-stack/index.d.ts +13 -10
- package/dist/components/view-stack/index.js +1 -1
- package/dist/components/view-stack/index.js.map +1 -1
- package/dist/components/view-stack/types.d.ts +13 -9
- package/dist/index.css +3 -3
- package/dist/index.d.ts +23 -19
- package/dist/index.js +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/lib/utils.d.ts +15 -5
- 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 +1449 -774
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/themes.css +12 -0
- package/dist/tokens/tokens.css +12 -0
- package/dist/variants/variants.css +19 -5
- package/package.json +16 -9
- package/dist/components/box/index.d.ts +0 -19
- package/dist/components/box/index.js +0 -2
- package/dist/components/box/index.js.map +0 -1
- package/dist/components/drawer/context.d.ts +0 -13
- package/dist/components/drawer/context.js +0 -2
- package/dist/components/drawer/context.js.map +0 -1
- package/dist/components/drawer/state.d.ts +0 -26
- package/dist/components/drawer/state.js +0 -2
- package/dist/components/drawer/state.js.map +0 -1
|
@@ -1,53 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type
|
|
12
|
-
type
|
|
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?:
|
|
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?:
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
108
|
+
placement?: XAxisUnion | YAxisUnion;
|
|
74
109
|
/**
|
|
75
110
|
* The size of the drawer.
|
|
76
111
|
* @default 'medium'
|
|
77
112
|
*/
|
|
78
|
-
size?:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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 '
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
*
|
|
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
|
-
|
|
137
|
+
for: UniqueId;
|
|
186
138
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
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
|
-
|
|
143
|
+
views?: UniqueId[];
|
|
192
144
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
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
|
-
|
|
188
|
+
for: SimpleEvents | TargetedEvents | ChainedEvents;
|
|
209
189
|
};
|
|
210
190
|
type DrawerContextValue = {
|
|
211
|
-
|
|
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
|
|
195
|
+
export type { DrawerContextValue, DrawerEvent, DrawerLayoutProps, DrawerMenuItemProps, DrawerMenuProps, DrawerOpenEvent, DrawerProps, DrawerTitleProps, DrawerToggleEvent, DrawerTriggerProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
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
|
|
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
|
|
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","
|
|
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,
|
|
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"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
|
|
3
|
-
declare const IconStyles: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], unknown, unknown
|
|
3
|
+
declare const IconStyles: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], unknown, unknown>>;
|
|
4
4
|
|
|
5
5
|
export { IconStyles };
|
|
@@ -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;
|