@glasshome/ui 1.9.0 → 1.10.1
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/README.md +2 -13
- package/SPEC.md +4 -4
- package/dist/lib/badge-tone.d.ts +0 -2
- package/dist/solid/badge.d.ts +1 -1
- package/dist/solid/card.d.ts +4 -2
- package/dist/solid/icon.d.ts +14 -0
- package/dist/solid/index.js +1645 -1632
- package/dist/solid/spinner.d.ts +1 -1
- package/package.json +9 -12
- package/scripts/check-pack.ts +32 -0
- package/src/index.ts +111 -0
- package/src/lib/badge-tone.ts +0 -4
- package/src/lib/carousel-classes.ts +2 -3
- package/src/solid/accordion.tsx +60 -0
- package/src/solid/alert-dialog.tsx +148 -0
- package/src/solid/alert.tsx +118 -0
- package/src/solid/area-picker.tsx +225 -0
- package/src/solid/aspect-ratio.tsx +21 -0
- package/src/solid/avatar.tsx +41 -0
- package/src/solid/badge.tsx +74 -0
- package/src/solid/bottom-sheet/arbitration.ts +40 -0
- package/src/solid/bottom-sheet/bottom-sheet.tsx +457 -0
- package/src/solid/bottom-sheet/constants.ts +8 -0
- package/src/solid/bottom-sheet/drag-controller.ts +221 -0
- package/src/solid/bottom-sheet/focus-trap.ts +56 -0
- package/src/solid/bottom-sheet/index.ts +14 -0
- package/src/solid/bottom-sheet/keyboard.ts +35 -0
- package/src/solid/bottom-sheet/scroll-lock.ts +64 -0
- package/src/solid/bottom-sheet/state-machine.ts +40 -0
- package/src/solid/bottom-sheet/velocity.ts +42 -0
- package/src/solid/breadcrumb.tsx +105 -0
- package/src/solid/button-group.tsx +66 -0
- package/src/solid/button.tsx +20 -0
- package/src/solid/card.tsx +101 -0
- package/src/solid/carousel.tsx +302 -0
- package/src/solid/charts.tsx +338 -0
- package/src/solid/checkbox.tsx +70 -0
- package/src/solid/collapsible.tsx +38 -0
- package/src/solid/color-slider.tsx +98 -0
- package/src/solid/color-wheel.tsx +77 -0
- package/src/solid/context-menu.tsx +109 -0
- package/src/solid/copy-button.tsx +46 -0
- package/src/solid/count-pill.tsx +24 -0
- package/src/solid/data-table.tsx +248 -0
- package/src/solid/dialog-parts.tsx +242 -0
- package/src/solid/dialog.tsx +121 -0
- package/src/solid/dock.tsx +186 -0
- package/src/solid/dropdown-menu.tsx +130 -0
- package/src/solid/empty.tsx +99 -0
- package/src/solid/entity-data.ts +78 -0
- package/src/solid/entity-selector.tsx +697 -0
- package/src/solid/field.tsx +253 -0
- package/src/solid/form.tsx +231 -0
- package/src/solid/hero-action.tsx +117 -0
- package/src/solid/hover-card.tsx +26 -0
- package/src/solid/icon-picker.tsx +432 -0
- package/src/solid/icon.tsx +20 -0
- package/src/solid/image-picker.tsx +380 -0
- package/src/solid/index.ts +417 -0
- package/src/solid/input-group.tsx +170 -0
- package/src/solid/input-otp.tsx +175 -0
- package/src/solid/input.tsx +12 -0
- package/src/solid/item.tsx +179 -0
- package/src/solid/kbd.tsx +30 -0
- package/src/solid/label.tsx +19 -0
- package/src/solid/list-reorder.ts +148 -0
- package/src/solid/logo.tsx +79 -0
- package/src/solid/media-copy.ts +37 -0
- package/src/solid/media-store.ts +110 -0
- package/src/solid/media-tile.tsx +100 -0
- package/src/solid/menu-parts.tsx +248 -0
- package/src/solid/number-field.tsx +72 -0
- package/src/solid/option-card.tsx +218 -0
- package/src/solid/ornament.tsx +53 -0
- package/src/solid/overlay.tsx +16 -0
- package/src/solid/page-header.tsx +102 -0
- package/src/solid/pagination.tsx +111 -0
- package/src/solid/password-input.tsx +69 -0
- package/src/solid/picker-row.tsx +102 -0
- package/src/solid/picker-search.tsx +78 -0
- package/src/solid/popover.tsx +103 -0
- package/src/solid/progress.tsx +31 -0
- package/src/solid/radio-group.tsx +60 -0
- package/src/solid/resizable.tsx +149 -0
- package/src/solid/responsive-dialog.tsx +180 -0
- package/src/solid/schema-form.tsx +830 -0
- package/src/solid/scope-indicator.tsx +13 -0
- package/src/solid/scroll-area.tsx +27 -0
- package/src/solid/section-card.tsx +358 -0
- package/src/solid/select.tsx +139 -0
- package/src/solid/separator.tsx +35 -0
- package/src/solid/settings-row.tsx +159 -0
- package/src/solid/sheet.tsx +157 -0
- package/src/solid/skeleton.tsx +15 -0
- package/src/solid/slider.tsx +148 -0
- package/src/solid/sliding-indicator.tsx +294 -0
- package/src/solid/sonner.tsx +219 -0
- package/src/solid/spinner.tsx +20 -0
- package/src/solid/step-indicator.tsx +30 -0
- package/src/solid/switch.tsx +62 -0
- package/src/solid/table.tsx +98 -0
- package/src/solid/tabs.tsx +86 -0
- package/src/solid/textarea.tsx +16 -0
- package/src/solid/toggle-group.tsx +102 -0
- package/src/solid/toggle.tsx +57 -0
- package/src/solid/tooltip.tsx +38 -0
- package/src/solid/widget-card.tsx +117 -0
- package/src/solid/widget-identity.tsx +135 -0
- package/src/solid/widget-trust-badge.tsx +37 -0
- package/src/tokens/hex.ts +50 -0
- package/src/tokens/index.ts +8 -0
- package/src/tokens/presets.ts +192 -0
- package/src/tokens/theme-colors.ts +147 -0
- package/dist/lib/carousel-init.d.ts +0 -9
- package/src/astro/Alert.astro +0 -63
- package/src/astro/Badge.astro +0 -18
- package/src/astro/Button.astro +0 -47
- package/src/astro/Card.astro +0 -48
- package/src/astro/Carousel.astro +0 -82
- package/src/astro/Logo.astro +0 -73
- package/src/astro/TierBadge.astro +0 -33
- package/src/lib/carousel-init.ts +0 -87
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
// Original components
|
|
2
|
+
|
|
3
|
+
// Deliberately NOT re-exported here: `Icon` from ./icon.tsx. A barrel
|
|
4
|
+
// re-export makes every ui import eagerly evaluate iconify-icon, which then
|
|
5
|
+
// claims the <iconify-icon> element before the host registers its bundled icon
|
|
6
|
+
// data — every icon silently falls back to a network fetch (see apps/dash
|
|
7
|
+
// main.tsx import-order comment). One door for icons has to wait for the ui
|
|
8
|
+
// import to stop carrying an iconify copy at all.
|
|
9
|
+
// Color helpers for ColorWheel/ColorSlider consumers, re-exported so they
|
|
10
|
+
// don't need a direct @kobalte/core dependency.
|
|
11
|
+
export { type Color, parseColor } from "@kobalte/core/colors";
|
|
12
|
+
// Floating glass panel + its shared surface token.
|
|
13
|
+
export { SECTION_ROW_SURFACE } from "../lib/card-classes.js";
|
|
14
|
+
export { OVERLAY_SURFACE } from "../lib/overlay-classes.js";
|
|
15
|
+
// Section tokens re-exported from the Solid entry for convenience.
|
|
16
|
+
export {
|
|
17
|
+
SECTION_INNER_RADIUS,
|
|
18
|
+
SECTION_OUTER_RADIUS,
|
|
19
|
+
SECTION_PADDING,
|
|
20
|
+
SECTION_ROW_CLASS,
|
|
21
|
+
} from "../lib/section-tokens.js";
|
|
22
|
+
// Wave 2: Simple Kobalte Components
|
|
23
|
+
export {
|
|
24
|
+
Accordion,
|
|
25
|
+
AccordionContent,
|
|
26
|
+
AccordionItem,
|
|
27
|
+
AccordionTrigger,
|
|
28
|
+
} from "./accordion.js";
|
|
29
|
+
// Wave 1: Pure HTML+CSS Components
|
|
30
|
+
export { Alert, AlertDescription, AlertTitle, type AlertTone } from "./alert.js";
|
|
31
|
+
export {
|
|
32
|
+
AlertDialog,
|
|
33
|
+
AlertDialogAction,
|
|
34
|
+
AlertDialogBody,
|
|
35
|
+
AlertDialogCancel,
|
|
36
|
+
AlertDialogContent,
|
|
37
|
+
AlertDialogDescription,
|
|
38
|
+
AlertDialogFooter,
|
|
39
|
+
AlertDialogHeader,
|
|
40
|
+
AlertDialogTitle,
|
|
41
|
+
AlertDialogTrigger,
|
|
42
|
+
} from "./alert-dialog.js";
|
|
43
|
+
export { AreaPicker } from "./area-picker.js";
|
|
44
|
+
export { AspectRatio } from "./aspect-ratio.js";
|
|
45
|
+
export { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
46
|
+
export { Badge, TierBadge } from "./badge.js";
|
|
47
|
+
export {
|
|
48
|
+
BottomSheet,
|
|
49
|
+
BottomSheetBody,
|
|
50
|
+
BottomSheetClose,
|
|
51
|
+
BottomSheetContent,
|
|
52
|
+
BottomSheetDescription,
|
|
53
|
+
BottomSheetFooter,
|
|
54
|
+
BottomSheetHandle,
|
|
55
|
+
BottomSheetHeader,
|
|
56
|
+
BottomSheetOverlay,
|
|
57
|
+
BottomSheetPortal,
|
|
58
|
+
BottomSheetTitle,
|
|
59
|
+
BottomSheetTrigger,
|
|
60
|
+
} from "./bottom-sheet/index.js";
|
|
61
|
+
export {
|
|
62
|
+
Breadcrumb,
|
|
63
|
+
BreadcrumbEllipsis,
|
|
64
|
+
BreadcrumbItem,
|
|
65
|
+
BreadcrumbLink,
|
|
66
|
+
BreadcrumbList,
|
|
67
|
+
BreadcrumbPage,
|
|
68
|
+
BreadcrumbSeparator,
|
|
69
|
+
} from "./breadcrumb.js";
|
|
70
|
+
export { Button, buttonVariants } from "./button.js";
|
|
71
|
+
export {
|
|
72
|
+
ButtonGroup,
|
|
73
|
+
ButtonGroupSeparator,
|
|
74
|
+
ButtonGroupText,
|
|
75
|
+
buttonGroupVariants,
|
|
76
|
+
} from "./button-group.js";
|
|
77
|
+
export {
|
|
78
|
+
Card,
|
|
79
|
+
CardAction,
|
|
80
|
+
CardContent,
|
|
81
|
+
CardDescription,
|
|
82
|
+
CardFooter,
|
|
83
|
+
CardHeader,
|
|
84
|
+
CardTitle,
|
|
85
|
+
} from "./card.js";
|
|
86
|
+
export type { CarouselApi, CarouselTransition } from "./carousel.js";
|
|
87
|
+
// Wave 5: React-Library Alternatives - Complex
|
|
88
|
+
export {
|
|
89
|
+
Carousel,
|
|
90
|
+
CarouselContent,
|
|
91
|
+
CarouselDots,
|
|
92
|
+
CarouselItem,
|
|
93
|
+
CarouselNext,
|
|
94
|
+
CarouselPrevious,
|
|
95
|
+
} from "./carousel.js";
|
|
96
|
+
export {
|
|
97
|
+
AreaChart,
|
|
98
|
+
BarList,
|
|
99
|
+
formatBytes,
|
|
100
|
+
formatCompact,
|
|
101
|
+
RangeToggle,
|
|
102
|
+
StackedBar,
|
|
103
|
+
} from "./charts.js";
|
|
104
|
+
export { Checkbox } from "./checkbox.js";
|
|
105
|
+
export {
|
|
106
|
+
Collapsible,
|
|
107
|
+
CollapsibleContent,
|
|
108
|
+
CollapsibleTrigger,
|
|
109
|
+
} from "./collapsible.js";
|
|
110
|
+
export { ColorSlider } from "./color-slider.js";
|
|
111
|
+
export { ColorWheel } from "./color-wheel.js";
|
|
112
|
+
export {
|
|
113
|
+
ContextMenu,
|
|
114
|
+
ContextMenuCheckboxItem,
|
|
115
|
+
ContextMenuContent,
|
|
116
|
+
ContextMenuGroup,
|
|
117
|
+
ContextMenuItem,
|
|
118
|
+
ContextMenuLabel,
|
|
119
|
+
ContextMenuRadioGroup,
|
|
120
|
+
ContextMenuRadioItem,
|
|
121
|
+
ContextMenuSeparator,
|
|
122
|
+
ContextMenuShortcut,
|
|
123
|
+
ContextMenuSub,
|
|
124
|
+
ContextMenuSubContent,
|
|
125
|
+
ContextMenuSubTrigger,
|
|
126
|
+
ContextMenuTrigger,
|
|
127
|
+
} from "./context-menu.js";
|
|
128
|
+
export { CopyButton } from "./copy-button.js";
|
|
129
|
+
export { CountPill } from "./count-pill.js";
|
|
130
|
+
export {
|
|
131
|
+
type SortDirection,
|
|
132
|
+
TABLE_BLEED,
|
|
133
|
+
TABLE_CELL_X,
|
|
134
|
+
TABLE_HEAD_CELL_CLASS,
|
|
135
|
+
TABLE_HEAD_CLASS,
|
|
136
|
+
TABLE_HEAD_LABEL_CLASS,
|
|
137
|
+
TABLE_NUM_CELL_CLASS,
|
|
138
|
+
TABLE_ROW_CLASS,
|
|
139
|
+
TABLE_SCROLL_CLASS,
|
|
140
|
+
TableBulkBar,
|
|
141
|
+
TableEmpty,
|
|
142
|
+
TableError,
|
|
143
|
+
TableFilterSelect,
|
|
144
|
+
TableSearchInput,
|
|
145
|
+
TableSkeleton,
|
|
146
|
+
TableSortHeader,
|
|
147
|
+
} from "./data-table.js";
|
|
148
|
+
export {
|
|
149
|
+
Dialog,
|
|
150
|
+
DialogBody,
|
|
151
|
+
DialogClose,
|
|
152
|
+
DialogContent,
|
|
153
|
+
DialogDescription,
|
|
154
|
+
DialogFooter,
|
|
155
|
+
DialogHeader,
|
|
156
|
+
DialogTitle,
|
|
157
|
+
DialogTrigger,
|
|
158
|
+
} from "./dialog.js";
|
|
159
|
+
export type { ModalSize } from "./dialog-parts.js";
|
|
160
|
+
export type { DockIconButtonProps, DockItem, DockProps } from "./dock.js";
|
|
161
|
+
export { Dock } from "./dock.js";
|
|
162
|
+
export {
|
|
163
|
+
DropdownMenu,
|
|
164
|
+
DropdownMenuCheckboxItem,
|
|
165
|
+
DropdownMenuContent,
|
|
166
|
+
DropdownMenuGroup,
|
|
167
|
+
DropdownMenuItem,
|
|
168
|
+
DropdownMenuLabel,
|
|
169
|
+
DropdownMenuRadioGroup,
|
|
170
|
+
DropdownMenuRadioItem,
|
|
171
|
+
DropdownMenuSeparator,
|
|
172
|
+
DropdownMenuShortcut,
|
|
173
|
+
DropdownMenuSub,
|
|
174
|
+
DropdownMenuSubContent,
|
|
175
|
+
DropdownMenuSubTrigger,
|
|
176
|
+
DropdownMenuTrigger,
|
|
177
|
+
} from "./dropdown-menu.js";
|
|
178
|
+
export {
|
|
179
|
+
Empty,
|
|
180
|
+
EmptyContent,
|
|
181
|
+
EmptyDescription,
|
|
182
|
+
EmptyHeader,
|
|
183
|
+
EmptyMedia,
|
|
184
|
+
EmptyTitle,
|
|
185
|
+
} from "./empty.js";
|
|
186
|
+
// Host-provided data source for the smart-home pickers (AreaPicker,
|
|
187
|
+
// EntitySelector): ui owns only these structural types; the host app wires a
|
|
188
|
+
// live adapter (dash: sync-layer) into EntityDataContext.
|
|
189
|
+
export {
|
|
190
|
+
type AreaViewLike,
|
|
191
|
+
type EntityDataAdapter,
|
|
192
|
+
EntityDataContext,
|
|
193
|
+
type EntityViewLike,
|
|
194
|
+
provideEntityData,
|
|
195
|
+
useEntityData,
|
|
196
|
+
} from "./entity-data.js";
|
|
197
|
+
export { EntitySelector } from "./entity-selector.js";
|
|
198
|
+
export {
|
|
199
|
+
Field,
|
|
200
|
+
FieldContent,
|
|
201
|
+
FieldDescription,
|
|
202
|
+
FieldError,
|
|
203
|
+
FieldGroup,
|
|
204
|
+
FieldLabel,
|
|
205
|
+
FieldLegend,
|
|
206
|
+
FieldSeparator,
|
|
207
|
+
FieldSet,
|
|
208
|
+
FieldSubGroup,
|
|
209
|
+
FieldTitle,
|
|
210
|
+
} from "./field.js";
|
|
211
|
+
export {
|
|
212
|
+
Form,
|
|
213
|
+
FormControl,
|
|
214
|
+
FormDescription,
|
|
215
|
+
FormField,
|
|
216
|
+
FormItem,
|
|
217
|
+
FormLabel,
|
|
218
|
+
FormMessage,
|
|
219
|
+
useFormField,
|
|
220
|
+
} from "./form.js";
|
|
221
|
+
export { HeroAction } from "./hero-action.js";
|
|
222
|
+
export {
|
|
223
|
+
HoverCard,
|
|
224
|
+
HoverCardContent,
|
|
225
|
+
HoverCardTrigger,
|
|
226
|
+
} from "./hover-card.js";
|
|
227
|
+
export { IconPicker, type IconPickerProps } from "./icon-picker.js";
|
|
228
|
+
export { ImagePicker, type ImagePickerProps } from "./image-picker.js";
|
|
229
|
+
export { Input } from "./input.js";
|
|
230
|
+
export {
|
|
231
|
+
InputGroup,
|
|
232
|
+
InputGroupAddon,
|
|
233
|
+
InputGroupButton,
|
|
234
|
+
InputGroupInput,
|
|
235
|
+
InputGroupText,
|
|
236
|
+
InputGroupTextarea,
|
|
237
|
+
} from "./input-group.js";
|
|
238
|
+
export {
|
|
239
|
+
InputOTP,
|
|
240
|
+
InputOTPGroup,
|
|
241
|
+
InputOTPSeparator,
|
|
242
|
+
InputOTPSlot,
|
|
243
|
+
} from "./input-otp.js";
|
|
244
|
+
export {
|
|
245
|
+
Item,
|
|
246
|
+
ItemActions,
|
|
247
|
+
ItemContent,
|
|
248
|
+
ItemDescription,
|
|
249
|
+
ItemFooter,
|
|
250
|
+
ItemGroup,
|
|
251
|
+
ItemHeader,
|
|
252
|
+
ItemMedia,
|
|
253
|
+
ItemSeparator,
|
|
254
|
+
ItemTitle,
|
|
255
|
+
} from "./item.js";
|
|
256
|
+
export { Kbd, KbdGroup } from "./kbd.js";
|
|
257
|
+
export { Label } from "./label.js";
|
|
258
|
+
export {
|
|
259
|
+
createListReorder,
|
|
260
|
+
dragTargetIndex,
|
|
261
|
+
type ListReorder,
|
|
262
|
+
type ListReorderOptions,
|
|
263
|
+
} from "./list-reorder.js";
|
|
264
|
+
export { Logo } from "./logo.js";
|
|
265
|
+
export {
|
|
266
|
+
mediaIndexErrorCopy,
|
|
267
|
+
mediaStoreErrorCopy,
|
|
268
|
+
toMediaStoreError,
|
|
269
|
+
} from "./media-copy.js";
|
|
270
|
+
export {
|
|
271
|
+
type BrokenMedia,
|
|
272
|
+
createBrokenMedia,
|
|
273
|
+
imageUrl,
|
|
274
|
+
isMediaImage,
|
|
275
|
+
MEDIA_PAGE_SIZE,
|
|
276
|
+
type MediaIndex,
|
|
277
|
+
type MediaQuotaUsage,
|
|
278
|
+
type MediaStore,
|
|
279
|
+
MediaStoreContext,
|
|
280
|
+
MediaStoreError,
|
|
281
|
+
type MediaStoreErrorKind,
|
|
282
|
+
type MediaVariant,
|
|
283
|
+
mediaUrl,
|
|
284
|
+
provideMediaStore,
|
|
285
|
+
type StoredMedia,
|
|
286
|
+
sortMediaForClearing,
|
|
287
|
+
useMediaStore,
|
|
288
|
+
} from "./media-store.js";
|
|
289
|
+
export { MediaTile, type MediaTileProps } from "./media-tile.js";
|
|
290
|
+
export { NumberField } from "./number-field.js";
|
|
291
|
+
export { HeroOption, OptionCard, OptionCardGroup, OptionChoice } from "./option-card.js";
|
|
292
|
+
export { Overlay } from "./overlay.js";
|
|
293
|
+
export { PageHeader } from "./page-header.js";
|
|
294
|
+
export {
|
|
295
|
+
Pagination,
|
|
296
|
+
PaginationContent,
|
|
297
|
+
PaginationEllipsis,
|
|
298
|
+
PaginationItem,
|
|
299
|
+
PaginationLink,
|
|
300
|
+
PaginationNext,
|
|
301
|
+
PaginationPrevious,
|
|
302
|
+
} from "./pagination.js";
|
|
303
|
+
export { PasswordInput } from "./password-input.js";
|
|
304
|
+
export { PICKER_ROW_HEIGHT, PickerRow } from "./picker-row.js";
|
|
305
|
+
export { PickerSearch, type PickerSearchProps } from "./picker-search.js";
|
|
306
|
+
export {
|
|
307
|
+
Popover,
|
|
308
|
+
PopoverAnchor,
|
|
309
|
+
PopoverContent,
|
|
310
|
+
PopoverTrigger,
|
|
311
|
+
} from "./popover.js";
|
|
312
|
+
export { Progress } from "./progress.js";
|
|
313
|
+
export { RadioGroup, RadioGroupItem } from "./radio-group.js";
|
|
314
|
+
export {
|
|
315
|
+
ResizableHandle,
|
|
316
|
+
ResizablePanel,
|
|
317
|
+
ResizablePanelGroup,
|
|
318
|
+
} from "./resizable.js";
|
|
319
|
+
// Wave 6: Compound Components
|
|
320
|
+
export {
|
|
321
|
+
ResponsiveDialog,
|
|
322
|
+
ResponsiveDialogBody,
|
|
323
|
+
ResponsiveDialogClose,
|
|
324
|
+
ResponsiveDialogContent,
|
|
325
|
+
ResponsiveDialogDescription,
|
|
326
|
+
ResponsiveDialogFooter,
|
|
327
|
+
ResponsiveDialogHeader,
|
|
328
|
+
ResponsiveDialogTitle,
|
|
329
|
+
ResponsiveDialogTrigger,
|
|
330
|
+
} from "./responsive-dialog.js";
|
|
331
|
+
export {
|
|
332
|
+
type ExtendedJSONSchema,
|
|
333
|
+
SCHEMA_FORM_FORM_TYPES,
|
|
334
|
+
SchemaForm,
|
|
335
|
+
} from "./schema-form.js";
|
|
336
|
+
export { ScopeIndicator } from "./scope-indicator.js";
|
|
337
|
+
export { ScrollArea, ScrollBar } from "./scroll-area.js";
|
|
338
|
+
export {
|
|
339
|
+
type GlassSurface,
|
|
340
|
+
ListRow,
|
|
341
|
+
NOOP_GLASS,
|
|
342
|
+
SectionCard,
|
|
343
|
+
SectionGroup,
|
|
344
|
+
SectionIcon,
|
|
345
|
+
SectionLabel,
|
|
346
|
+
SectionMeta,
|
|
347
|
+
SectionRow,
|
|
348
|
+
SectionRowSkeleton,
|
|
349
|
+
SectionRowSkeletons,
|
|
350
|
+
SectionSubtitle,
|
|
351
|
+
SectionTitle,
|
|
352
|
+
} from "./section-card.js";
|
|
353
|
+
// Wave 3: Complex Kobalte Components
|
|
354
|
+
export {
|
|
355
|
+
Select,
|
|
356
|
+
SelectContent,
|
|
357
|
+
SelectGroup,
|
|
358
|
+
SelectItem,
|
|
359
|
+
SelectLabel,
|
|
360
|
+
SelectSeparator,
|
|
361
|
+
SelectTrigger,
|
|
362
|
+
SelectValue,
|
|
363
|
+
} from "./select.js";
|
|
364
|
+
export { Separator } from "./separator.js";
|
|
365
|
+
export {
|
|
366
|
+
LabeledField,
|
|
367
|
+
LabeledIconPicker,
|
|
368
|
+
LabeledInput,
|
|
369
|
+
RowActions,
|
|
370
|
+
SectionAddButton,
|
|
371
|
+
SectionEmpty,
|
|
372
|
+
SwitchRow,
|
|
373
|
+
} from "./settings-row.js";
|
|
374
|
+
export {
|
|
375
|
+
Sheet,
|
|
376
|
+
SheetBody,
|
|
377
|
+
SheetClose,
|
|
378
|
+
SheetContent,
|
|
379
|
+
SheetDescription,
|
|
380
|
+
SheetFooter,
|
|
381
|
+
SheetHeader,
|
|
382
|
+
SheetTitle,
|
|
383
|
+
SheetTrigger,
|
|
384
|
+
} from "./sheet.js";
|
|
385
|
+
export { Skeleton } from "./skeleton.js";
|
|
386
|
+
export { Slider } from "./slider.js";
|
|
387
|
+
export { SlidingIndicator } from "./sliding-indicator.js";
|
|
388
|
+
// Wave 4: React-Library Alternatives - Simpler
|
|
389
|
+
export { GlassToast, Toaster, toast } from "./sonner.js";
|
|
390
|
+
export { Spinner } from "./spinner.js";
|
|
391
|
+
export { StepIndicator } from "./step-indicator.js";
|
|
392
|
+
export { Switch } from "./switch.js";
|
|
393
|
+
export {
|
|
394
|
+
TABLE_CELL_INSET,
|
|
395
|
+
Table,
|
|
396
|
+
TableBody,
|
|
397
|
+
TableCaption,
|
|
398
|
+
TableCell,
|
|
399
|
+
TableFooter,
|
|
400
|
+
TableHead,
|
|
401
|
+
TableHeader,
|
|
402
|
+
TableRow,
|
|
403
|
+
} from "./table.js";
|
|
404
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
405
|
+
export { Textarea } from "./textarea.js";
|
|
406
|
+
export { Toggle, toggleVariants } from "./toggle.js";
|
|
407
|
+
export { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
|
|
408
|
+
export { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
409
|
+
export { WidgetCard } from "./widget-card.js";
|
|
410
|
+
export {
|
|
411
|
+
formatWidgetCount,
|
|
412
|
+
WidgetIdentity,
|
|
413
|
+
WidgetMeta,
|
|
414
|
+
type WidgetSummary,
|
|
415
|
+
widgetHref,
|
|
416
|
+
} from "./widget-identity.js";
|
|
417
|
+
export { WidgetTrustBadge } from "./widget-trust-badge.js";
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "cva";
|
|
2
|
+
import { type Component, type ComponentProps, splitProps } from "solid-js";
|
|
3
|
+
import { CONTROL_H, FIELD_TEXT, INPUT_SURFACE } from "../lib/input-classes.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
|
|
7
|
+
const InputGroup: Component<ComponentProps<"div">> = (props) => {
|
|
8
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
9
|
+
return (
|
|
10
|
+
// biome-ignore lint/a11y/useSemanticElements: fieldset would carry default browser styling and break the input layout; role=group conveys the same semantics.
|
|
11
|
+
<div
|
|
12
|
+
data-slot="input-group"
|
|
13
|
+
role="group"
|
|
14
|
+
class={cn(
|
|
15
|
+
`group/input-group relative flex w-full items-center rounded-md ${INPUT_SURFACE} outline-none transition-[color,box-shadow]`,
|
|
16
|
+
`${CONTROL_H.default} min-w-0 has-[>textarea]:h-auto`,
|
|
17
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col",
|
|
18
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col",
|
|
19
|
+
// The shell wears the focus and invalid state for the control inside
|
|
20
|
+
// it; on glass the edge moves through the knob, never through border-*.
|
|
21
|
+
"has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:[--glass-edge:var(--ring)]",
|
|
22
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[[data-slot][aria-invalid=true]]:[--glass-edge:var(--destructive)]",
|
|
23
|
+
local.class,
|
|
24
|
+
)}
|
|
25
|
+
{...rest}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/* An addon owns the distance to the panel edge, and only that: the control
|
|
31
|
+
* keeps its own px-3, so nothing reaches into a sibling to trim it. A button
|
|
32
|
+
* or kbd inside already carries its own padding, so the addon sits closer. */
|
|
33
|
+
const inputGroupAddonVariants = cva({
|
|
34
|
+
base: "flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 font-medium text-muted-foreground text-sm group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-sm [&>svg:not([class*='size-'])]:size-4",
|
|
35
|
+
variants: {
|
|
36
|
+
align: {
|
|
37
|
+
"inline-start": "order-first pl-3 has-[>button]:pl-1.5 has-[>kbd]:pl-2",
|
|
38
|
+
"inline-end": "order-last pr-3 has-[>button]:pr-1.5 has-[>kbd]:pr-2",
|
|
39
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3",
|
|
40
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
align: "inline-start",
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const InputGroupAddon: Component<
|
|
49
|
+
ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>
|
|
50
|
+
> = (props) => {
|
|
51
|
+
const [local, rest] = splitProps(props, ["class", "align"] as const);
|
|
52
|
+
const align = () => local.align ?? "inline-start";
|
|
53
|
+
return (
|
|
54
|
+
// Addon click forwards focus to the sibling input (cursor-text affordance); buttons inside keep their own behavior.
|
|
55
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: see above
|
|
56
|
+
// biome-ignore lint/a11y/useSemanticElements: see above
|
|
57
|
+
<div
|
|
58
|
+
role="group"
|
|
59
|
+
data-slot="input-group-addon"
|
|
60
|
+
data-align={align()}
|
|
61
|
+
class={cn(inputGroupAddonVariants({ align: align() }), local.class)}
|
|
62
|
+
onClick={(e) => {
|
|
63
|
+
if ((e.target as HTMLElement).closest("button")) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
(e.currentTarget as HTMLElement).parentElement
|
|
67
|
+
?.querySelector<HTMLInputElement>("input")
|
|
68
|
+
?.focus();
|
|
69
|
+
}}
|
|
70
|
+
{...rest}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/* Both button sizes come from the shared control heights: sm fits inside the
|
|
76
|
+
* h-9 shell, default fills a block addon's own row. */
|
|
77
|
+
const GROUP_BUTTON_SM = `${CONTROL_H.sm} gap-1.5 px-2.5 has-[>svg]:px-2.5`;
|
|
78
|
+
const GROUP_BUTTON_ICON_SM = "size-8 p-0 has-[>svg]:p-0";
|
|
79
|
+
|
|
80
|
+
const inputGroupButtonVariants = cva({
|
|
81
|
+
base: "flex items-center gap-2 rounded-sm text-sm shadow-none",
|
|
82
|
+
variants: {
|
|
83
|
+
size: {
|
|
84
|
+
/** @deprecated Use "sm". */
|
|
85
|
+
xs: GROUP_BUTTON_SM,
|
|
86
|
+
sm: GROUP_BUTTON_SM,
|
|
87
|
+
default: `${CONTROL_H.default} px-3 has-[>svg]:px-3`,
|
|
88
|
+
/** @deprecated Use "icon-sm". */
|
|
89
|
+
"icon-xs": GROUP_BUTTON_ICON_SM,
|
|
90
|
+
"icon-sm": GROUP_BUTTON_ICON_SM,
|
|
91
|
+
"icon-default": "size-9 p-0 has-[>svg]:p-0",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
defaultVariants: {
|
|
95
|
+
size: "sm",
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const InputGroupButton: Component<
|
|
100
|
+
Omit<ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>
|
|
101
|
+
> = (props) => {
|
|
102
|
+
const [local, rest] = splitProps(props, ["class", "type", "variant", "size"] as const);
|
|
103
|
+
const size = () => local.size ?? "sm";
|
|
104
|
+
return (
|
|
105
|
+
<Button
|
|
106
|
+
type={local.type ?? "button"}
|
|
107
|
+
data-slot="input-group-button"
|
|
108
|
+
data-size={size()}
|
|
109
|
+
variant={local.variant ?? "ghost"}
|
|
110
|
+
class={cn(inputGroupButtonVariants({ size: size() }), local.class)}
|
|
111
|
+
{...rest}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const InputGroupText: Component<ComponentProps<"span">> = (props) => {
|
|
117
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
118
|
+
return (
|
|
119
|
+
<span
|
|
120
|
+
data-slot="input-group-text"
|
|
121
|
+
class={cn(
|
|
122
|
+
"flex items-center gap-2 text-muted-foreground text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
123
|
+
local.class,
|
|
124
|
+
)}
|
|
125
|
+
{...rest}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// The control inside a group is SURFACELESS — the <InputGroup> owns the border,
|
|
131
|
+
// background, height and focus state. So these are bare <input>/<textarea>, not
|
|
132
|
+
// the glass <Input>/<Textarea>: routing through those paints the `.glass`
|
|
133
|
+
// gradient inside the group (a `bg-transparent` can't clear the `background`
|
|
134
|
+
// shorthand's image layers) and stacks a second concave surface.
|
|
135
|
+
const InputGroupInput: Component<ComponentProps<"input">> = (props) => {
|
|
136
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
137
|
+
return (
|
|
138
|
+
<input
|
|
139
|
+
data-slot="input-group-control"
|
|
140
|
+
class={cn(
|
|
141
|
+
`${CONTROL_H.default} w-full flex-1 rounded-none border-0 bg-transparent px-3 py-1 ${FIELD_TEXT} shadow-none outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,
|
|
142
|
+
local.class,
|
|
143
|
+
)}
|
|
144
|
+
{...rest}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const InputGroupTextarea: Component<ComponentProps<"textarea">> = (props) => {
|
|
150
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
151
|
+
return (
|
|
152
|
+
<textarea
|
|
153
|
+
data-slot="input-group-control"
|
|
154
|
+
class={cn(
|
|
155
|
+
`field-sizing-content min-h-16 w-full flex-1 resize-none rounded-none border-0 bg-transparent px-3 py-2 ${FIELD_TEXT} shadow-none outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,
|
|
156
|
+
local.class,
|
|
157
|
+
)}
|
|
158
|
+
{...rest}
|
|
159
|
+
/>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
InputGroup,
|
|
165
|
+
InputGroupAddon,
|
|
166
|
+
InputGroupButton,
|
|
167
|
+
InputGroupInput,
|
|
168
|
+
InputGroupText,
|
|
169
|
+
InputGroupTextarea,
|
|
170
|
+
};
|