@gv-tech/ui-core 1.1.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/package.json +42 -0
- package/src/contracts/accordion.ts +23 -0
- package/src/contracts/alert-dialog.ts +48 -0
- package/src/contracts/alert.ts +17 -0
- package/src/contracts/aspect-ratio.ts +7 -0
- package/src/contracts/avatar.ts +17 -0
- package/src/contracts/badge.ts +7 -0
- package/src/contracts/breadcrumb.ts +37 -0
- package/src/contracts/button.ts +17 -0
- package/src/contracts/calendar.ts +4 -0
- package/src/contracts/card.ts +11 -0
- package/src/contracts/carousel.ts +29 -0
- package/src/contracts/chart.ts +31 -0
- package/src/contracts/checkbox.ts +11 -0
- package/src/contracts/collapsible.ts +21 -0
- package/src/contracts/command.ts +43 -0
- package/src/contracts/context-menu.ts +78 -0
- package/src/contracts/dialog.ts +29 -0
- package/src/contracts/drawer.ts +39 -0
- package/src/contracts/dropdown-menu.ts +87 -0
- package/src/contracts/form.ts +29 -0
- package/src/contracts/hover-card.ts +21 -0
- package/src/contracts/input.ts +11 -0
- package/src/contracts/label.ts +7 -0
- package/src/contracts/menubar.ts +86 -0
- package/src/contracts/navigation-menu.ts +55 -0
- package/src/contracts/pagination.ts +38 -0
- package/src/contracts/popover.ts +28 -0
- package/src/contracts/progress.ts +4 -0
- package/src/contracts/radio.ts +16 -0
- package/src/contracts/resizable.ts +36 -0
- package/src/contracts/scroll-area.ts +15 -0
- package/src/contracts/search.ts +13 -0
- package/src/contracts/select.ts +64 -0
- package/src/contracts/separator.ts +5 -0
- package/src/contracts/sheet.ts +58 -0
- package/src/contracts/skeleton.ts +6 -0
- package/src/contracts/slider.ts +15 -0
- package/src/contracts/sonner.ts +15 -0
- package/src/contracts/switch.ts +11 -0
- package/src/contracts/table.ts +41 -0
- package/src/contracts/tabs.ts +31 -0
- package/src/contracts/text.ts +12 -0
- package/src/contracts/textarea.ts +7 -0
- package/src/contracts/theme-provider.ts +14 -0
- package/src/contracts/theme-toggle.ts +15 -0
- package/src/contracts/toast.ts +15 -0
- package/src/contracts/toaster.ts +3 -0
- package/src/contracts/toggle-group.ts +23 -0
- package/src/contracts/toggle.ts +49 -0
- package/src/contracts/tooltip.ts +28 -0
- package/src/index.ts +327 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
export const toggleVariants = cva(
|
|
5
|
+
'inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: 'bg-transparent',
|
|
10
|
+
outline: 'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
default: 'h-9 px-2 min-w-9',
|
|
14
|
+
sm: 'h-8 px-1.5 min-w-8',
|
|
15
|
+
lg: 'h-10 px-2.5 min-w-10',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: 'default',
|
|
20
|
+
size: 'default',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export const toggleVariantValues = {
|
|
26
|
+
variant: {
|
|
27
|
+
default: 'default',
|
|
28
|
+
outline: 'outline',
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
default: 'default',
|
|
32
|
+
sm: 'sm',
|
|
33
|
+
lg: 'lg',
|
|
34
|
+
},
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
export type ToggleVariant = keyof typeof toggleVariantValues.variant;
|
|
38
|
+
export type ToggleSize = keyof typeof toggleVariantValues.size;
|
|
39
|
+
|
|
40
|
+
export interface ToggleBaseProps {
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
className?: string;
|
|
43
|
+
variant?: ToggleVariant;
|
|
44
|
+
size?: ToggleSize;
|
|
45
|
+
pressed?: boolean;
|
|
46
|
+
defaultPressed?: boolean;
|
|
47
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TooltipBaseProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
delayDuration?: number;
|
|
6
|
+
skipDelayDuration?: number;
|
|
7
|
+
disableHoverableContent?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TooltipContentBaseProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
sideOffset?: number;
|
|
14
|
+
avoidCollisions?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TooltipTriggerBaseProps {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface TooltipProviderBaseProps {
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
delayDuration?: number;
|
|
26
|
+
skipDelayDuration?: number;
|
|
27
|
+
disableHoverableContent?: boolean;
|
|
28
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
// @gv-tech/ui-core
|
|
2
|
+
//
|
|
3
|
+
// Shared component contracts for the GV Tech design system.
|
|
4
|
+
// Consumed by both ui-web and ui-native implementations.
|
|
5
|
+
|
|
6
|
+
// Accordion
|
|
7
|
+
export type {
|
|
8
|
+
AccordionBaseProps,
|
|
9
|
+
AccordionContentBaseProps,
|
|
10
|
+
AccordionItemBaseProps,
|
|
11
|
+
AccordionTriggerBaseProps,
|
|
12
|
+
} from './contracts/accordion';
|
|
13
|
+
|
|
14
|
+
// Alert
|
|
15
|
+
export type { AlertBaseProps, AlertDescriptionBaseProps, AlertTitleBaseProps } from './contracts/alert';
|
|
16
|
+
|
|
17
|
+
// Alert Dialog
|
|
18
|
+
export type {
|
|
19
|
+
AlertDialogActionBaseProps,
|
|
20
|
+
AlertDialogBaseProps,
|
|
21
|
+
AlertDialogCancelBaseProps,
|
|
22
|
+
AlertDialogContentBaseProps,
|
|
23
|
+
AlertDialogDescriptionBaseProps,
|
|
24
|
+
AlertDialogFooterBaseProps,
|
|
25
|
+
AlertDialogHeaderBaseProps,
|
|
26
|
+
AlertDialogTitleBaseProps,
|
|
27
|
+
AlertDialogTriggerBaseProps,
|
|
28
|
+
} from './contracts/alert-dialog';
|
|
29
|
+
|
|
30
|
+
// Aspect Ratio
|
|
31
|
+
export type { AspectRatioBaseProps } from './contracts/aspect-ratio';
|
|
32
|
+
|
|
33
|
+
// Avatar
|
|
34
|
+
export type { AvatarBaseProps, AvatarFallbackBaseProps, AvatarImageBaseProps } from './contracts/avatar';
|
|
35
|
+
|
|
36
|
+
// Badge
|
|
37
|
+
export type { BadgeBaseProps } from './contracts/badge';
|
|
38
|
+
|
|
39
|
+
// Breadcrumb
|
|
40
|
+
export type {
|
|
41
|
+
BreadcrumbBaseProps,
|
|
42
|
+
BreadcrumbEllipsisBaseProps,
|
|
43
|
+
BreadcrumbItemBaseProps,
|
|
44
|
+
BreadcrumbLinkBaseProps,
|
|
45
|
+
BreadcrumbListBaseProps,
|
|
46
|
+
BreadcrumbPageBaseProps,
|
|
47
|
+
BreadcrumbSeparatorBaseProps,
|
|
48
|
+
} from './contracts/breadcrumb';
|
|
49
|
+
|
|
50
|
+
// Button
|
|
51
|
+
export { buttonSizeValues, buttonVariantValues } from './contracts/button';
|
|
52
|
+
export type { ButtonBaseProps, ButtonSize, ButtonVariant } from './contracts/button';
|
|
53
|
+
|
|
54
|
+
// Calendar
|
|
55
|
+
export type { CalendarBaseProps } from './contracts/calendar';
|
|
56
|
+
|
|
57
|
+
// Card
|
|
58
|
+
export type { CardBaseProps, CardSubComponent } from './contracts/card';
|
|
59
|
+
|
|
60
|
+
// Carousel
|
|
61
|
+
export type {
|
|
62
|
+
CarouselBaseProps,
|
|
63
|
+
CarouselContentBaseProps,
|
|
64
|
+
CarouselItemBaseProps,
|
|
65
|
+
CarouselNextBaseProps,
|
|
66
|
+
CarouselPreviousBaseProps,
|
|
67
|
+
} from './contracts/carousel';
|
|
68
|
+
|
|
69
|
+
// Chart
|
|
70
|
+
export type {
|
|
71
|
+
ChartConfig,
|
|
72
|
+
ChartContainerBaseProps,
|
|
73
|
+
ChartLegendContentBaseProps,
|
|
74
|
+
ChartTooltipContentBaseProps,
|
|
75
|
+
} from './contracts/chart';
|
|
76
|
+
|
|
77
|
+
// Checkbox
|
|
78
|
+
export type { CheckboxBaseProps } from './contracts/checkbox';
|
|
79
|
+
|
|
80
|
+
// Collapsible
|
|
81
|
+
export type {
|
|
82
|
+
CollapsibleBaseProps,
|
|
83
|
+
CollapsibleContentBaseProps,
|
|
84
|
+
CollapsibleTriggerBaseProps,
|
|
85
|
+
} from './contracts/collapsible';
|
|
86
|
+
|
|
87
|
+
// Command
|
|
88
|
+
export type {
|
|
89
|
+
CommandBaseProps,
|
|
90
|
+
CommandEmptyBaseProps,
|
|
91
|
+
CommandGroupBaseProps,
|
|
92
|
+
CommandInputBaseProps,
|
|
93
|
+
CommandItemBaseProps,
|
|
94
|
+
CommandListBaseProps,
|
|
95
|
+
CommandSeparatorBaseProps,
|
|
96
|
+
CommandShortcutBaseProps,
|
|
97
|
+
} from './contracts/command';
|
|
98
|
+
|
|
99
|
+
// Context Menu
|
|
100
|
+
export type {
|
|
101
|
+
ContextMenuBaseProps,
|
|
102
|
+
ContextMenuCheckboxItemBaseProps,
|
|
103
|
+
ContextMenuContentBaseProps,
|
|
104
|
+
ContextMenuGroupBaseProps,
|
|
105
|
+
ContextMenuItemBaseProps,
|
|
106
|
+
ContextMenuLabelBaseProps,
|
|
107
|
+
ContextMenuRadioGroupBaseProps,
|
|
108
|
+
ContextMenuRadioItemBaseProps,
|
|
109
|
+
ContextMenuSeparatorBaseProps,
|
|
110
|
+
ContextMenuShortcutBaseProps,
|
|
111
|
+
ContextMenuSubBaseProps,
|
|
112
|
+
ContextMenuSubContentBaseProps,
|
|
113
|
+
ContextMenuSubTriggerBaseProps,
|
|
114
|
+
ContextMenuTriggerBaseProps,
|
|
115
|
+
} from './contracts/context-menu';
|
|
116
|
+
|
|
117
|
+
// Dialog
|
|
118
|
+
export type { DialogBaseProps, DialogContentBaseProps, DialogSubComponent } from './contracts/dialog';
|
|
119
|
+
|
|
120
|
+
// Drawer
|
|
121
|
+
export type {
|
|
122
|
+
DrawerBaseProps,
|
|
123
|
+
DrawerCloseBaseProps,
|
|
124
|
+
DrawerContentBaseProps,
|
|
125
|
+
DrawerDescriptionBaseProps,
|
|
126
|
+
DrawerFooterBaseProps,
|
|
127
|
+
DrawerHeaderBaseProps,
|
|
128
|
+
DrawerTitleBaseProps,
|
|
129
|
+
DrawerTriggerBaseProps,
|
|
130
|
+
} from './contracts/drawer';
|
|
131
|
+
|
|
132
|
+
// Dropdown Menu
|
|
133
|
+
export type {
|
|
134
|
+
DropdownMenuBaseProps,
|
|
135
|
+
DropdownMenuCheckboxItemBaseProps,
|
|
136
|
+
DropdownMenuContentBaseProps,
|
|
137
|
+
DropdownMenuGroupBaseProps,
|
|
138
|
+
DropdownMenuItemBaseProps,
|
|
139
|
+
DropdownMenuLabelBaseProps,
|
|
140
|
+
DropdownMenuRadioGroupBaseProps,
|
|
141
|
+
DropdownMenuRadioItemBaseProps,
|
|
142
|
+
DropdownMenuSeparatorBaseProps,
|
|
143
|
+
DropdownMenuShortcutBaseProps,
|
|
144
|
+
DropdownMenuSubBaseProps,
|
|
145
|
+
DropdownMenuSubContentBaseProps,
|
|
146
|
+
DropdownMenuSubTriggerBaseProps,
|
|
147
|
+
DropdownMenuTriggerBaseProps,
|
|
148
|
+
} from './contracts/dropdown-menu';
|
|
149
|
+
|
|
150
|
+
// Form
|
|
151
|
+
export type {
|
|
152
|
+
FormBaseProps,
|
|
153
|
+
FormControlBaseProps,
|
|
154
|
+
FormDescriptionBaseProps,
|
|
155
|
+
FormItemBaseProps,
|
|
156
|
+
FormLabelBaseProps,
|
|
157
|
+
FormMessageBaseProps,
|
|
158
|
+
} from './contracts/form';
|
|
159
|
+
|
|
160
|
+
// Hover Card
|
|
161
|
+
export type { HoverCardBaseProps, HoverCardContentBaseProps, HoverCardTriggerBaseProps } from './contracts/hover-card';
|
|
162
|
+
|
|
163
|
+
// Input
|
|
164
|
+
export type { InputBaseProps } from './contracts/input';
|
|
165
|
+
|
|
166
|
+
// Label
|
|
167
|
+
export type { LabelBaseProps } from './contracts/label';
|
|
168
|
+
|
|
169
|
+
// Menubar
|
|
170
|
+
export type {
|
|
171
|
+
MenubarBaseProps,
|
|
172
|
+
MenubarCheckboxItemBaseProps,
|
|
173
|
+
MenubarContentBaseProps,
|
|
174
|
+
MenubarItemBaseProps,
|
|
175
|
+
MenubarLabelBaseProps,
|
|
176
|
+
MenubarMenuBaseProps,
|
|
177
|
+
MenubarRadioItemBaseProps,
|
|
178
|
+
MenubarSeparatorBaseProps,
|
|
179
|
+
MenubarShortcutBaseProps,
|
|
180
|
+
MenubarSubBaseProps,
|
|
181
|
+
MenubarSubContentBaseProps,
|
|
182
|
+
MenubarSubTriggerBaseProps,
|
|
183
|
+
MenubarTriggerBaseProps,
|
|
184
|
+
} from './contracts/menubar';
|
|
185
|
+
|
|
186
|
+
// Navigation Menu
|
|
187
|
+
export type {
|
|
188
|
+
NavigationMenuBaseProps,
|
|
189
|
+
NavigationMenuContentBaseProps,
|
|
190
|
+
NavigationMenuIndicatorBaseProps,
|
|
191
|
+
NavigationMenuItemBaseProps,
|
|
192
|
+
NavigationMenuLinkBaseProps,
|
|
193
|
+
NavigationMenuListBaseProps,
|
|
194
|
+
NavigationMenuTriggerBaseProps,
|
|
195
|
+
NavigationMenuViewportBaseProps,
|
|
196
|
+
} from './contracts/navigation-menu';
|
|
197
|
+
|
|
198
|
+
// Pagination
|
|
199
|
+
export type {
|
|
200
|
+
PaginationBaseProps,
|
|
201
|
+
PaginationContentBaseProps,
|
|
202
|
+
PaginationEllipsisBaseProps,
|
|
203
|
+
PaginationItemBaseProps,
|
|
204
|
+
PaginationLinkBaseProps,
|
|
205
|
+
PaginationNextBaseProps,
|
|
206
|
+
PaginationPreviousBaseProps,
|
|
207
|
+
} from './contracts/pagination';
|
|
208
|
+
|
|
209
|
+
// Popover
|
|
210
|
+
export type {
|
|
211
|
+
PopoverAnchorBaseProps,
|
|
212
|
+
PopoverBaseProps,
|
|
213
|
+
PopoverContentBaseProps,
|
|
214
|
+
PopoverTriggerBaseProps,
|
|
215
|
+
} from './contracts/popover';
|
|
216
|
+
|
|
217
|
+
// Progress
|
|
218
|
+
export type { ProgressBaseProps } from './contracts/progress';
|
|
219
|
+
|
|
220
|
+
// Radio
|
|
221
|
+
export type { RadioGroupBaseProps, RadioGroupItemBaseProps } from './contracts/radio';
|
|
222
|
+
|
|
223
|
+
// Resizable
|
|
224
|
+
export type {
|
|
225
|
+
ResizableHandleBaseProps,
|
|
226
|
+
ResizablePanelBaseProps,
|
|
227
|
+
ResizablePanelGroupBaseProps,
|
|
228
|
+
} from './contracts/resizable';
|
|
229
|
+
|
|
230
|
+
// Scroll Area
|
|
231
|
+
export type { ScrollAreaBaseProps, ScrollBarBaseProps } from './contracts/scroll-area';
|
|
232
|
+
|
|
233
|
+
// Search
|
|
234
|
+
export type { SearchBaseProps, SearchTriggerBaseProps } from './contracts/search';
|
|
235
|
+
|
|
236
|
+
// Select
|
|
237
|
+
export type {
|
|
238
|
+
SelectBaseProps,
|
|
239
|
+
SelectContentBaseProps,
|
|
240
|
+
SelectGroupBaseProps,
|
|
241
|
+
SelectItemBaseProps,
|
|
242
|
+
SelectLabelBaseProps,
|
|
243
|
+
SelectScrollDownButtonBaseProps,
|
|
244
|
+
SelectScrollUpButtonBaseProps,
|
|
245
|
+
SelectSeparatorBaseProps,
|
|
246
|
+
SelectTriggerBaseProps,
|
|
247
|
+
SelectValueBaseProps,
|
|
248
|
+
} from './contracts/select';
|
|
249
|
+
|
|
250
|
+
// Separator
|
|
251
|
+
export type { SeparatorBaseProps } from './contracts/separator';
|
|
252
|
+
|
|
253
|
+
// Sheet
|
|
254
|
+
export type {
|
|
255
|
+
SheetBaseProps,
|
|
256
|
+
SheetCloseBaseProps,
|
|
257
|
+
SheetContentBaseProps,
|
|
258
|
+
SheetDescriptionBaseProps,
|
|
259
|
+
SheetFooterBaseProps,
|
|
260
|
+
SheetHeaderBaseProps,
|
|
261
|
+
SheetOverlayBaseProps,
|
|
262
|
+
SheetPortalBaseProps,
|
|
263
|
+
SheetTitleBaseProps,
|
|
264
|
+
SheetTriggerBaseProps,
|
|
265
|
+
} from './contracts/sheet';
|
|
266
|
+
|
|
267
|
+
// Skeleton
|
|
268
|
+
export type { SkeletonBaseProps } from './contracts/skeleton';
|
|
269
|
+
|
|
270
|
+
// Slider
|
|
271
|
+
export type { SliderBaseProps } from './contracts/slider';
|
|
272
|
+
|
|
273
|
+
// Sonner
|
|
274
|
+
export type { SonnerBaseProps } from './contracts/sonner';
|
|
275
|
+
|
|
276
|
+
// Switch
|
|
277
|
+
export type { SwitchBaseProps } from './contracts/switch';
|
|
278
|
+
|
|
279
|
+
// Table
|
|
280
|
+
export type {
|
|
281
|
+
TableBaseProps,
|
|
282
|
+
TableBodyBaseProps,
|
|
283
|
+
TableCaptionBaseProps,
|
|
284
|
+
TableCellBaseProps,
|
|
285
|
+
TableFooterBaseProps,
|
|
286
|
+
TableHeadBaseProps,
|
|
287
|
+
TableHeaderBaseProps,
|
|
288
|
+
TableRowBaseProps,
|
|
289
|
+
} from './contracts/table';
|
|
290
|
+
|
|
291
|
+
// Tabs
|
|
292
|
+
export type { TabsBaseProps, TabsContentBaseProps, TabsListBaseProps, TabsTriggerBaseProps } from './contracts/tabs';
|
|
293
|
+
|
|
294
|
+
// Text
|
|
295
|
+
export { textVariantValues } from './contracts/text';
|
|
296
|
+
export type { TextBaseProps, TextVariant } from './contracts/text';
|
|
297
|
+
|
|
298
|
+
// Textarea
|
|
299
|
+
export type { TextareaBaseProps } from './contracts/textarea';
|
|
300
|
+
|
|
301
|
+
// Toggle
|
|
302
|
+
export { toggleVariantValues, toggleVariants } from './contracts/toggle';
|
|
303
|
+
export type { ToggleBaseProps, ToggleSize, ToggleVariant } from './contracts/toggle';
|
|
304
|
+
|
|
305
|
+
// Toggle Group
|
|
306
|
+
export type { ToggleGroupBaseProps, ToggleGroupItemBaseProps } from './contracts/toggle-group';
|
|
307
|
+
|
|
308
|
+
// Tooltip
|
|
309
|
+
export type {
|
|
310
|
+
TooltipBaseProps,
|
|
311
|
+
TooltipContentBaseProps,
|
|
312
|
+
TooltipProviderBaseProps,
|
|
313
|
+
TooltipTriggerBaseProps,
|
|
314
|
+
} from './contracts/tooltip';
|
|
315
|
+
|
|
316
|
+
// Toast
|
|
317
|
+
export { toastVariantValues } from './contracts/toast';
|
|
318
|
+
export type { ToastBaseProps, ToastVariant } from './contracts/toast';
|
|
319
|
+
|
|
320
|
+
// Theme Provider
|
|
321
|
+
export type { ThemeProviderBaseProps } from './contracts/theme-provider';
|
|
322
|
+
|
|
323
|
+
// Theme Toggle
|
|
324
|
+
export type { ThemeToggleBaseProps } from './contracts/theme-toggle';
|
|
325
|
+
|
|
326
|
+
// Toaster
|
|
327
|
+
export type { ToasterBaseProps } from './contracts/toaster';
|