@hanzo/ui 8.7.5 → 8.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/backends/gui/carousel.cjs +235 -0
  2. package/dist/backends/gui/carousel.d.ts +66 -0
  3. package/dist/backends/gui/carousel.d.ts.map +1 -0
  4. package/dist/backends/gui/carousel.js +197 -0
  5. package/dist/backends/gui/carousel.js.map +1 -0
  6. package/dist/backends/gui/form.cjs +143 -0
  7. package/dist/backends/gui/form.d.ts +68 -0
  8. package/dist/backends/gui/form.d.ts.map +1 -0
  9. package/dist/backends/gui/form.js +101 -0
  10. package/dist/backends/gui/form.js.map +1 -0
  11. package/dist/backends/gui/index.cjs +21 -1
  12. package/dist/backends/gui/index.d.ts +4 -0
  13. package/dist/backends/gui/index.d.ts.map +1 -1
  14. package/dist/backends/gui/index.js +4 -0
  15. package/dist/backends/gui/index.js.map +1 -1
  16. package/dist/backends/gui/media-stack.cjs +70 -0
  17. package/dist/backends/gui/media-stack.d.ts +32 -0
  18. package/dist/backends/gui/media-stack.d.ts.map +1 -0
  19. package/dist/backends/gui/media-stack.js +66 -0
  20. package/dist/backends/gui/media-stack.js.map +1 -0
  21. package/dist/backends/gui/skeleton.cjs +14 -0
  22. package/dist/backends/gui/skeleton.d.ts +12 -0
  23. package/dist/backends/gui/skeleton.d.ts.map +1 -0
  24. package/dist/backends/gui/skeleton.js +11 -0
  25. package/dist/backends/gui/skeleton.js.map +1 -0
  26. package/dist/box.cjs +22 -0
  27. package/dist/box.d.ts.map +1 -1
  28. package/dist/box.js +22 -0
  29. package/dist/box.js.map +1 -1
  30. package/dist/core/cn.cjs +5 -0
  31. package/dist/core/cn.d.ts +2 -0
  32. package/dist/core/cn.d.ts.map +1 -1
  33. package/dist/core/cn.js +4 -0
  34. package/dist/core/cn.js.map +1 -1
  35. package/dist/gallery.html +23 -1
  36. package/dist/index.cjs +19 -2
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -2
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.node.js +2 -2
  42. package/dist/primitives/Form.cjs +8 -0
  43. package/dist/primitives/Form.d.ts +2 -0
  44. package/dist/primitives/Form.d.ts.map +1 -0
  45. package/dist/primitives/Form.js +5 -0
  46. package/dist/primitives/Form.js.map +1 -0
  47. package/dist/primitives/FormControl.cjs +8 -0
  48. package/dist/primitives/FormControl.d.ts +2 -0
  49. package/dist/primitives/FormControl.d.ts.map +1 -0
  50. package/dist/primitives/FormControl.js +5 -0
  51. package/dist/primitives/FormControl.js.map +1 -0
  52. package/dist/primitives/FormDescription.cjs +8 -0
  53. package/dist/primitives/FormDescription.d.ts +2 -0
  54. package/dist/primitives/FormDescription.d.ts.map +1 -0
  55. package/dist/primitives/FormDescription.js +5 -0
  56. package/dist/primitives/FormDescription.js.map +1 -0
  57. package/dist/primitives/FormField.cjs +8 -0
  58. package/dist/primitives/FormField.d.ts +2 -0
  59. package/dist/primitives/FormField.d.ts.map +1 -0
  60. package/dist/primitives/FormField.js +5 -0
  61. package/dist/primitives/FormField.js.map +1 -0
  62. package/dist/primitives/FormItem.cjs +8 -0
  63. package/dist/primitives/FormItem.d.ts +2 -0
  64. package/dist/primitives/FormItem.d.ts.map +1 -0
  65. package/dist/primitives/FormItem.js +5 -0
  66. package/dist/primitives/FormItem.js.map +1 -0
  67. package/dist/primitives/FormLabel.cjs +8 -0
  68. package/dist/primitives/FormLabel.d.ts +2 -0
  69. package/dist/primitives/FormLabel.d.ts.map +1 -0
  70. package/dist/primitives/FormLabel.js +5 -0
  71. package/dist/primitives/FormLabel.js.map +1 -0
  72. package/dist/primitives/FormMessage.cjs +8 -0
  73. package/dist/primitives/FormMessage.d.ts +2 -0
  74. package/dist/primitives/FormMessage.d.ts.map +1 -0
  75. package/dist/primitives/FormMessage.js +5 -0
  76. package/dist/primitives/FormMessage.js.map +1 -0
  77. package/dist/primitives/useFormField.cjs +8 -0
  78. package/dist/primitives/useFormField.d.ts +2 -0
  79. package/dist/primitives/useFormField.d.ts.map +1 -0
  80. package/dist/primitives/useFormField.js +5 -0
  81. package/dist/primitives/useFormField.js.map +1 -0
  82. package/dist/styles.css +22 -0
  83. package/dist/theme.css +22 -0
  84. package/dist/tw.cjs +35 -2
  85. package/dist/tw.d.ts.map +1 -1
  86. package/dist/tw.js +35 -2
  87. package/dist/tw.js.map +1 -1
  88. package/dist/types.d.ts +37 -0
  89. package/dist/types.d.ts.map +1 -1
  90. package/package.json +7 -2
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Form — the five pieces that connect react-hook-form to a rendered field.
3
+ *
4
+ * <Form {...form}>
5
+ * <FormField name="email" control={form.control} render={({ field }) => (
6
+ * <FormItem>
7
+ * <FormLabel>Email</FormLabel>
8
+ * <FormControl><Input {...field} /></FormControl>
9
+ * <FormMessage />
10
+ * </FormItem>
11
+ * )} />
12
+ * </Form>
13
+ *
14
+ * What they buy is the ACCESSIBILITY wiring, which is the part hand-written
15
+ * forms get wrong: the control is described by its message, the message has an
16
+ * id to be described BY, `aria-invalid` follows the field's error state, and a
17
+ * message renders only when there is one to render. Each is one id agreeing in
18
+ * three places, and each is a place for the three to drift apart.
19
+ *
20
+ * react-hook-form is an OPTIONAL peer, like `next`. This subpath is the only
21
+ * thing here that reaches for it, so an app with no forms never installs it.
22
+ */
23
+ import * as React from 'react';
24
+ import { type ControllerProps, type FieldPath, type FieldValues } from 'react-hook-form';
25
+ import { Box } from '../../box.js';
26
+ import { Label } from './label.js';
27
+ /** The provider. Spread a `useForm()` result straight into it. */
28
+ export declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
29
+ /**
30
+ * One field's worth of state, plus the three ids the pieces below agree on.
31
+ *
32
+ * The ids are derived from ONE `useId`, so the control, its description and its
33
+ * message cannot disagree about what they are pointing at.
34
+ */
35
+ export declare function useFormField(): {
36
+ invalid: boolean;
37
+ isDirty: boolean;
38
+ isTouched: boolean;
39
+ isValidating: boolean;
40
+ error?: import("react-hook-form").FieldError | undefined;
41
+ name: string;
42
+ formItemId: string;
43
+ formDescriptionId: string;
44
+ formMessageId: string;
45
+ };
46
+ export declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
47
+ export declare const FormItem: ({ className, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element;
48
+ export declare const FormLabel: ({ className, ...props }: React.ComponentProps<typeof Label>) => import("react/jsx-runtime").JSX.Element;
49
+ /**
50
+ * Wires the control it wraps to its own ids without rendering anything.
51
+ *
52
+ * `asChild` on Slot would be the shadcn shape; this clones instead, because
53
+ * gui's Slot participates in its own styled context and a bare input is not one
54
+ * of its children.
55
+ */
56
+ export declare const FormControl: ({ children }: {
57
+ children: React.ReactElement;
58
+ }) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
59
+ export declare const FormDescription: ({ className, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element;
60
+ /**
61
+ * The field's error, or nothing.
62
+ *
63
+ * Rendering an empty element when there is no error would reserve space that
64
+ * then jumps when a message arrives, and would leave an `aria-describedby`
65
+ * pointing at a node with no text in it.
66
+ */
67
+ export declare const FormMessage: ({ className, children, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element | null;
68
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/form.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,kEAAkE;AAClE,eAAO,MAAM,IAAI,8ZAAe,CAAA;AAQhC;;;;;GAKG;AACH,wBAAgB,YAAY;;;;;;;;;;EAkB3B;AAED,eAAO,MAAM,SAAS,GACpB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,gBAG9D,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAItC,CAAA;AAED,eAAO,MAAM,QAAQ,4BAA6B,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,4CASjF,CAAA;AAED,eAAO,MAAM,SAAS,4BAGnB,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,4CAUpC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,iBAAkB;IAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAAE,2EASzE,CAAA;AAED,eAAO,MAAM,eAAe,4BAA6B,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,4CAUxF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,sCAAuC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,mDAc9F,CAAA"}
@@ -0,0 +1,101 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * Form — the five pieces that connect react-hook-form to a rendered field.
5
+ *
6
+ * <Form {...form}>
7
+ * <FormField name="email" control={form.control} render={({ field }) => (
8
+ * <FormItem>
9
+ * <FormLabel>Email</FormLabel>
10
+ * <FormControl><Input {...field} /></FormControl>
11
+ * <FormMessage />
12
+ * </FormItem>
13
+ * )} />
14
+ * </Form>
15
+ *
16
+ * What they buy is the ACCESSIBILITY wiring, which is the part hand-written
17
+ * forms get wrong: the control is described by its message, the message has an
18
+ * id to be described BY, `aria-invalid` follows the field's error state, and a
19
+ * message renders only when there is one to render. Each is one id agreeing in
20
+ * three places, and each is a place for the three to drift apart.
21
+ *
22
+ * react-hook-form is an OPTIONAL peer, like `next`. This subpath is the only
23
+ * thing here that reaches for it, so an app with no forms never installs it.
24
+ */
25
+ import * as React from 'react';
26
+ import { Controller, FormProvider, useFormContext, useFormState, } from 'react-hook-form';
27
+ import { Box } from '../../box.js';
28
+ import { cn } from '../../core/cn.js';
29
+ import { Label } from './label.js';
30
+ /** The provider. Spread a `useForm()` result straight into it. */
31
+ export const Form = FormProvider;
32
+ const Field = /* @__PURE__ */ React.createContext({});
33
+ const Item = /* @__PURE__ */ React.createContext({});
34
+ /**
35
+ * One field's worth of state, plus the three ids the pieces below agree on.
36
+ *
37
+ * The ids are derived from ONE `useId`, so the control, its description and its
38
+ * message cannot disagree about what they are pointing at.
39
+ */
40
+ export function useFormField() {
41
+ const field = React.useContext(Field);
42
+ const item = React.useContext(Item);
43
+ const { getFieldState } = useFormContext();
44
+ const formState = useFormState({ name: field.name });
45
+ const state = getFieldState(field.name, formState);
46
+ if (!field.name) {
47
+ throw new Error('useFormField must be used inside a <FormField>');
48
+ }
49
+ return {
50
+ name: field.name,
51
+ formItemId: `${item.id}-item`,
52
+ formDescriptionId: `${item.id}-description`,
53
+ formMessageId: `${item.id}-message`,
54
+ ...state,
55
+ };
56
+ }
57
+ export const FormField = ({ ...props }) => (_jsx(Field.Provider, { value: { name: props.name }, children: _jsx(Controller, { ...props }) }));
58
+ export const FormItem = ({ className, ...props }) => {
59
+ const id = React.useId();
60
+ return (_jsx(Item.Provider, { value: { id }, children: _jsx(Box, { className: cn('grid grid-cols-1 gap-2', className), ...props }) }));
61
+ };
62
+ export const FormLabel = ({ className, ...props }) => {
63
+ const { error, formItemId } = useFormField();
64
+ return (_jsx(Label, { "data-error": !!error, className: cn(error && 'text-destructive', className), htmlFor: formItemId, ...props }));
65
+ };
66
+ /**
67
+ * Wires the control it wraps to its own ids without rendering anything.
68
+ *
69
+ * `asChild` on Slot would be the shadcn shape; this clones instead, because
70
+ * gui's Slot participates in its own styled context and a bare input is not one
71
+ * of its children.
72
+ */
73
+ export const FormControl = ({ children }) => {
74
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
75
+ return React.cloneElement(children, {
76
+ id: formItemId,
77
+ 'aria-describedby': error
78
+ ? `${formDescriptionId} ${formMessageId}`
79
+ : formDescriptionId,
80
+ 'aria-invalid': !!error,
81
+ });
82
+ };
83
+ export const FormDescription = ({ className, ...props }) => {
84
+ const { formDescriptionId } = useFormField();
85
+ return (_jsx(Box, { tag: "p", id: formDescriptionId, className: cn('text-sm text-muted-foreground', className), ...props }));
86
+ };
87
+ /**
88
+ * The field's error, or nothing.
89
+ *
90
+ * Rendering an empty element when there is no error would reserve space that
91
+ * then jumps when a message arrives, and would leave an `aria-describedby`
92
+ * pointing at a node with no text in it.
93
+ */
94
+ export const FormMessage = ({ className, children, ...props }) => {
95
+ const { error, formMessageId } = useFormField();
96
+ const body = error ? String(error?.message ?? '') : children;
97
+ if (!body)
98
+ return null;
99
+ return (_jsx(Box, { tag: "p", id: formMessageId, className: cn('text-sm text-destructive', className), ...props, children: body }));
100
+ };
101
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/backends/gui/form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GAIb,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,GAAG,EAAE,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AAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC,EAAE,EAAE;IAC3F,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,CAAA;IAC5C,OAAO,CACL,KAAC,GAAG,IACF,GAAG,EAAC,GAAG,EACP,EAAE,EAAE,iBAAiB,EACrB,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoC,EAAE,EAAE;IACjG,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAAA;IAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC5D,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,OAAO,CACL,KAAC,GAAG,IACF,GAAG,EAAC,GAAG,EACP,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,YAER,IAAI,GACD,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.ContextMenuRadioItem = exports.ContextMenuCheckboxItem = exports.ContextMenuItem = exports.ContextMenuContent = exports.ContextMenuTrigger = exports.ContextMenu = exports.CommandSeparator = exports.CommandShortcut = exports.CommandItem = exports.CommandGroup = exports.CommandEmpty = exports.CommandList = exports.CommandInput = exports.CommandDialog = exports.Command = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.Checkbox = exports.CardMedia = exports.CardContent = exports.CardDescription = exports.CardAction = exports.CardTitle = exports.CardFooter = exports.CardHeader = exports.Card = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.AvatarFallback = exports.AvatarImage = exports.Avatar = exports.AspectRatio = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogOverlay = exports.AlertDialogPortal = exports.AlertDialogTrigger = exports.AlertDialog = exports.AccordionContent = exports.AccordionTrigger = exports.AccordionItem = exports.Accordion = void 0;
20
20
  exports.ResizablePanel = exports.ResizablePanelGroup = exports.RadioGroupItem = exports.RadioGroup = exports.Progress = exports.PopoverClose = exports.PopoverAnchor = exports.PopoverContent = exports.PopoverTrigger = exports.Popover = exports.Label = exports.Input = exports.HoverCardContent = exports.HoverCardTrigger = exports.HoverCard = exports.Glass = exports.DropdownMenuRadioGroup = exports.DropdownMenuSubTrigger = exports.DropdownMenuSubContent = exports.DropdownMenuSub = exports.DropdownMenuPortal = exports.DropdownMenuGroup = exports.DropdownMenuShortcut = exports.DropdownMenuSeparator = exports.DropdownMenuLabel = exports.DropdownMenuRadioItem = exports.DropdownMenuCheckboxItem = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenuTrigger = exports.DropdownMenu = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = exports.DialogHeader = exports.DialogFooter = exports.DialogDescription = exports.DialogContent = exports.DialogClose = exports.Dialog = exports.ContextMenuRadioGroup = exports.ContextMenuSubTrigger = exports.ContextMenuSubContent = exports.ContextMenuSub = exports.ContextMenuPortal = exports.ContextMenuGroup = exports.ContextMenuShortcut = exports.ContextMenuSeparator = exports.ContextMenuLabel = void 0;
21
21
  exports.ToggleGroupItem = exports.ToggleGroup = exports.toast = exports.Toaster = exports.Textarea = exports.TabsContent = exports.TabsTrigger = exports.TabsList = exports.Tabs = exports.Switch = exports.Spinner = exports.Slider = exports.Fill = exports.Screen = exports.Band = exports.SelectScrollDownButton = exports.SelectScrollUpButton = exports.SelectSeparator = exports.SelectItem = exports.SelectLabel = exports.SelectContent = exports.SelectTrigger = exports.SelectValue = exports.SelectGroup = exports.Select = exports.ScrollBar = exports.ScrollArea = exports.Text = exports.View = exports.ScrollView = exports.Spacer = exports.Separator = exports.Image = exports.Anchor = exports.Em = exports.Strong = exports.Span = exports.H6 = exports.H5 = exports.H4 = exports.H3 = exports.H2 = exports.H1 = exports.Heading = exports.Paragraph = exports.SizableText = exports.ZStack = exports.YStack = exports.XStack = exports.ResizableHandle = void 0;
22
- exports.YouTubeEmbed = exports.VideoPlayer = exports.LinkElement = exports.MDXLink = exports.useLink = exports.Link = exports.ApplyTypography = exports.TooltipProvider = exports.TooltipContent = exports.TooltipTrigger = exports.Tooltip = void 0;
22
+ exports.fit = exports.MediaStack = exports.Skeleton = exports.CarouselNext = exports.CarouselPrevious = exports.CarouselItem = exports.CarouselContent = exports.Carousel = exports.YouTubeEmbed = exports.VideoPlayer = exports.LinkElement = exports.MDXLink = exports.useLink = exports.Link = exports.ApplyTypography = exports.useFormField = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormLabel = exports.FormItem = exports.FormField = exports.Form = exports.TooltipProvider = exports.TooltipContent = exports.TooltipTrigger = exports.Tooltip = void 0;
23
23
  var accordion_1 = require("./accordion.cjs");
24
24
  Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return accordion_1.Accordion; } });
25
25
  Object.defineProperty(exports, "AccordionItem", { enumerable: true, get: function () { return accordion_1.AccordionItem; } });
@@ -218,6 +218,15 @@ Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () {
218
218
  Object.defineProperty(exports, "TooltipTrigger", { enumerable: true, get: function () { return tooltip_1.TooltipTrigger; } });
219
219
  Object.defineProperty(exports, "TooltipContent", { enumerable: true, get: function () { return tooltip_1.TooltipContent; } });
220
220
  Object.defineProperty(exports, "TooltipProvider", { enumerable: true, get: function () { return tooltip_1.TooltipProvider; } });
221
+ var form_1 = require("./form.cjs");
222
+ Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return form_1.Form; } });
223
+ Object.defineProperty(exports, "FormField", { enumerable: true, get: function () { return form_1.FormField; } });
224
+ Object.defineProperty(exports, "FormItem", { enumerable: true, get: function () { return form_1.FormItem; } });
225
+ Object.defineProperty(exports, "FormLabel", { enumerable: true, get: function () { return form_1.FormLabel; } });
226
+ Object.defineProperty(exports, "FormControl", { enumerable: true, get: function () { return form_1.FormControl; } });
227
+ Object.defineProperty(exports, "FormDescription", { enumerable: true, get: function () { return form_1.FormDescription; } });
228
+ Object.defineProperty(exports, "FormMessage", { enumerable: true, get: function () { return form_1.FormMessage; } });
229
+ Object.defineProperty(exports, "useFormField", { enumerable: true, get: function () { return form_1.useFormField; } });
221
230
  var prose_1 = require("./prose.cjs");
222
231
  Object.defineProperty(exports, "ApplyTypography", { enumerable: true, get: function () { return prose_1.ApplyTypography; } });
223
232
  var link_1 = require("./link.cjs");
@@ -228,3 +237,14 @@ Object.defineProperty(exports, "LinkElement", { enumerable: true, get: function
228
237
  var video_1 = require("./video.cjs");
229
238
  Object.defineProperty(exports, "VideoPlayer", { enumerable: true, get: function () { return video_1.VideoPlayer; } });
230
239
  Object.defineProperty(exports, "YouTubeEmbed", { enumerable: true, get: function () { return video_1.YouTubeEmbed; } });
240
+ var carousel_1 = require("./carousel.cjs");
241
+ Object.defineProperty(exports, "Carousel", { enumerable: true, get: function () { return carousel_1.Carousel; } });
242
+ Object.defineProperty(exports, "CarouselContent", { enumerable: true, get: function () { return carousel_1.CarouselContent; } });
243
+ Object.defineProperty(exports, "CarouselItem", { enumerable: true, get: function () { return carousel_1.CarouselItem; } });
244
+ Object.defineProperty(exports, "CarouselPrevious", { enumerable: true, get: function () { return carousel_1.CarouselPrevious; } });
245
+ Object.defineProperty(exports, "CarouselNext", { enumerable: true, get: function () { return carousel_1.CarouselNext; } });
246
+ var skeleton_1 = require("./skeleton.cjs");
247
+ Object.defineProperty(exports, "Skeleton", { enumerable: true, get: function () { return skeleton_1.Skeleton; } });
248
+ var media_stack_1 = require("./media-stack.cjs");
249
+ Object.defineProperty(exports, "MediaStack", { enumerable: true, get: function () { return media_stack_1.MediaStack; } });
250
+ Object.defineProperty(exports, "fit", { enumerable: true, get: function () { return media_stack_1.fit; } });
@@ -32,7 +32,11 @@ export { Textarea } from './textarea.js';
32
32
  export { Toaster, toast } from './toaster.js';
33
33
  export { ToggleGroup, ToggleGroupItem, type ToggleGroupProps, type ToggleGroupItemProps, type ToggleGroupVariant, type ToggleGroupSize, } from './toggle-group.js';
34
34
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './tooltip.js';
35
+ export { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage, useFormField, } from './form.js';
35
36
  export { ApplyTypography, type ApplyTypographyProps, type ProseTag, type TypographySize, } from './prose.js';
36
37
  export { Link, useLink, MDXLink, LinkElement, type LinkComponent, type LinkElementProps, } from './link.js';
37
38
  export { VideoPlayer, YouTubeEmbed, type VideoPlayerProps, type YouTubeEmbedProps, } from './video.js';
39
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, type CarouselApi, type CarouselOptions, type CarouselProps, } from './carousel.js';
40
+ export { Skeleton } from './skeleton.js';
41
+ export { MediaStack, fit, type MediaStackProps } from './media-stack.js';
38
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAs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AQ,EACb,KAAK,cAAc,GACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AACxG,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EAC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C,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA"}
@@ -58,7 +58,11 @@ export { Textarea } from './textarea.js';
58
58
  export { Toaster, toast } from './toaster.js';
59
59
  export { ToggleGroup, ToggleGroupItem, } from './toggle-group.js';
60
60
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './tooltip.js';
61
+ export { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage, useFormField, } from './form.js';
61
62
  export { ApplyTypography, } from './prose.js';
62
63
  export { Link, useLink, MDXLink, LinkElement, } from './link.js';
63
64
  export { VideoPlayer, YouTubeEmbed, } from './video.js';
65
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, } from './carousel.js';
66
+ export { Skeleton } from './skeleton.js';
67
+ export { MediaStack, fit } from './media-stack.js';
64
68
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/backends/gui/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,kFAAkF;AAClF,4EAA4E;AAC5E,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,+EAA+E;AAC/E,0BAA0B;AAC1B,EAAE;AACF,6DAA6D;AAC7D,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,oCAAoC;AAEpC,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GAKjB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAKlB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAAyB,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,MA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});
4
+ exports.MediaStack = exports.fit = void 0;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const gui_1 = require("@hanzo/gui");
7
+ const box_1 = require("../../box.cjs");
8
+ const cn_1 = require("../../core/cn.cjs");
9
+ const video_1 = require("./video.cjs");
10
+ /**
11
+ * The largest `dim` fits inside `to` at its own aspect ratio, times `scale`.
12
+ *
13
+ * `scale` is a fraction of the CONSTRAINT rather than a CSS transform: a scaled
14
+ * image occupies the space it draws in, so a swatch at 0.25 leaves room around
15
+ * it instead of overlapping its neighbours the way `transform: scale` would.
16
+ */
17
+ const fit = (dim, to, scale = 1) => {
18
+ if (!dim?.w || !dim?.h)
19
+ return to;
20
+ const r = Math.min(to.w / dim.w, to.h / dim.h) * scale;
21
+ return { w: Math.round(dim.w * r), h: Math.round(dim.h * r) };
22
+ };
23
+ exports.fit = fit;
24
+ const MediaStack = ({ media, constrainTo, className, ...props }) => {
25
+ const scale = media?.mediaTransform?.scale ?? 1;
26
+ const { offsetX = 0, offsetY = 0 } = media?.mediaTransform ?? {};
27
+ // Richest first. `animation` renders as its poster: a Lottie document needs a
28
+ // player, no content in this estate carries one, and a still is a better
29
+ // answer than an empty box for content that does.
30
+ const anim = media?.animation;
31
+ const video = media?.video;
32
+ const img = media?.img;
33
+ const inner = (() => {
34
+ if (video?.sources?.length) {
35
+ const d = (0, exports.fit)(video.dim?.md ?? constrainTo, constrainTo, scale);
36
+ return ((0, jsx_runtime_1.jsx)(video_1.VideoPlayer, { width: d.w, height: d.h, poster: video.poster, sources: video.sources, ...video.videoProps }));
37
+ }
38
+ const still = anim?.poster
39
+ ? { src: anim.poster, alt: '', dim: anim.dim }
40
+ : img;
41
+ if (!still?.src)
42
+ return null;
43
+ const d = (0, exports.fit)(still.dim ?? constrainTo, constrainTo, scale);
44
+ return ((0, jsx_runtime_1.jsx)(gui_1.Image
45
+ // `src`, not react-native's `source`. gui's Image renders a real <img>
46
+ // on web and forwards what it does not recognise straight to the DOM,
47
+ // so a `source` object arrives as the attribute `source="[object
48
+ // Object]"` and the element has no url at all — it renders, it measures,
49
+ // and it shows nothing.
50
+ , {
51
+ // `src`, not react-native's `source`. gui's Image renders a real <img>
52
+ // on web and forwards what it does not recognise straight to the DOM,
53
+ // so a `source` object arrives as the attribute `source="[object
54
+ // Object]"` and the element has no url at all — it renders, it measures,
55
+ // and it shows nothing.
56
+ src: still.src, width: d.w, height: d.h,
57
+ // The short filename is a far better default than nothing: a decorative
58
+ // image should say so with `alt=""`, and content that forgot the field
59
+ // at least announces WHICH image it is.
60
+ alt: still.alt ?? still.src.split('/').pop(), className: img?.rounded }));
61
+ })();
62
+ return ((0, jsx_runtime_1.jsx)(box_1.Box, { className: (0, cn_1.cn)('grid place-items-center', className), style: {
63
+ width: constrainTo.w,
64
+ height: constrainTo.h,
65
+ ...(offsetX || offsetY
66
+ ? { transform: `translate(${offsetX}px, ${offsetY}px)` }
67
+ : null),
68
+ }, ...props, children: inner }));
69
+ };
70
+ exports.MediaStack = MediaStack;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * MediaStack — one subject, in whatever media the content happens to have.
3
+ *
4
+ * A product has a photograph. Later it has a video, and later still an animated
5
+ * one, and no consumer should have to learn about that: the content grows a
6
+ * field and the stack renders the richest thing it can play. Callers say what
7
+ * BOX the media must fit in, never what size to draw it — so a grid of cards
8
+ * lines up whatever the source resolutions happen to be.
9
+ *
10
+ * Fitting is `contain`, computed here rather than left to CSS `object-fit`,
11
+ * because the element must be the fitted size for the layout around it to
12
+ * reserve the right space before the bytes arrive. `object-fit` letterboxes
13
+ * INSIDE a box that is already the wrong shape.
14
+ */
15
+ import * as React from 'react';
16
+ import { Box } from '../../box.js';
17
+ import type { Dimensions, MediaStackDef } from '../../types.js';
18
+ /**
19
+ * The largest `dim` fits inside `to` at its own aspect ratio, times `scale`.
20
+ *
21
+ * `scale` is a fraction of the CONSTRAINT rather than a CSS transform: a scaled
22
+ * image occupies the space it draws in, so a swatch at 0.25 leaves room around
23
+ * it instead of overlapping its neighbours the way `transform: scale` would.
24
+ */
25
+ export declare const fit: (dim: Dimensions, to: Dimensions, scale?: number) => Dimensions;
26
+ export type MediaStackProps = Omit<React.ComponentProps<typeof Box>, 'children'> & {
27
+ media: MediaStackDef;
28
+ /** The box the media must fit inside. */
29
+ constrainTo: Dimensions;
30
+ };
31
+ export declare const MediaStack: ({ media, constrainTo, className, ...props }: MediaStackProps) => import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=media-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-stack.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/media-stack.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG5D;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,QAAS,UAAU,MAAM,UAAU,qBAAc,UAIhE,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG;IACjF,KAAK,EAAE,aAAa,CAAA;IACpB,yCAAyC;IACzC,WAAW,EAAE,UAAU,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,UAAU,gDAAiD,eAAe,4CA+DtF,CAAA"}
@@ -0,0 +1,66 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Image } from '@hanzo/gui';
4
+ import { Box } from '../../box.js';
5
+ import { cn } from '../../core/cn.js';
6
+ import { VideoPlayer } from './video.js';
7
+ /**
8
+ * The largest `dim` fits inside `to` at its own aspect ratio, times `scale`.
9
+ *
10
+ * `scale` is a fraction of the CONSTRAINT rather than a CSS transform: a scaled
11
+ * image occupies the space it draws in, so a swatch at 0.25 leaves room around
12
+ * it instead of overlapping its neighbours the way `transform: scale` would.
13
+ */
14
+ export const fit = (dim, to, scale = 1) => {
15
+ if (!dim?.w || !dim?.h)
16
+ return to;
17
+ const r = Math.min(to.w / dim.w, to.h / dim.h) * scale;
18
+ return { w: Math.round(dim.w * r), h: Math.round(dim.h * r) };
19
+ };
20
+ export const MediaStack = ({ media, constrainTo, className, ...props }) => {
21
+ const scale = media?.mediaTransform?.scale ?? 1;
22
+ const { offsetX = 0, offsetY = 0 } = media?.mediaTransform ?? {};
23
+ // Richest first. `animation` renders as its poster: a Lottie document needs a
24
+ // player, no content in this estate carries one, and a still is a better
25
+ // answer than an empty box for content that does.
26
+ const anim = media?.animation;
27
+ const video = media?.video;
28
+ const img = media?.img;
29
+ const inner = (() => {
30
+ if (video?.sources?.length) {
31
+ const d = fit(video.dim?.md ?? constrainTo, constrainTo, scale);
32
+ return (_jsx(VideoPlayer, { width: d.w, height: d.h, poster: video.poster, sources: video.sources, ...video.videoProps }));
33
+ }
34
+ const still = anim?.poster
35
+ ? { src: anim.poster, alt: '', dim: anim.dim }
36
+ : img;
37
+ if (!still?.src)
38
+ return null;
39
+ const d = fit(still.dim ?? constrainTo, constrainTo, scale);
40
+ return (_jsx(Image
41
+ // `src`, not react-native's `source`. gui's Image renders a real <img>
42
+ // on web and forwards what it does not recognise straight to the DOM,
43
+ // so a `source` object arrives as the attribute `source="[object
44
+ // Object]"` and the element has no url at all — it renders, it measures,
45
+ // and it shows nothing.
46
+ , {
47
+ // `src`, not react-native's `source`. gui's Image renders a real <img>
48
+ // on web and forwards what it does not recognise straight to the DOM,
49
+ // so a `source` object arrives as the attribute `source="[object
50
+ // Object]"` and the element has no url at all — it renders, it measures,
51
+ // and it shows nothing.
52
+ src: still.src, width: d.w, height: d.h,
53
+ // The short filename is a far better default than nothing: a decorative
54
+ // image should say so with `alt=""`, and content that forgot the field
55
+ // at least announces WHICH image it is.
56
+ alt: still.alt ?? still.src.split('/').pop(), className: img?.rounded }));
57
+ })();
58
+ return (_jsx(Box, { className: cn('grid place-items-center', className), style: {
59
+ width: constrainTo.w,
60
+ height: constrainTo.h,
61
+ ...(offsetX || offsetY
62
+ ? { transform: `translate(${offsetX}px, ${offsetY}px)` }
63
+ : null),
64
+ }, ...props, children: inner }));
65
+ };
66
+ //# sourceMappingURL=media-stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-stack.js","sourceRoot":"","sources":["../../../src/backends/gui/media-stack.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAiBZ,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,GAAe,EAAE,EAAc,EAAE,KAAK,GAAG,CAAC,EAAc,EAAE;IAC5E,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAAE,OAAO,EAAE,CAAA;IACjC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;IACtD,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAA;AAC/D,CAAC,CAAA;AAQD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IACzF,MAAM,KAAK,GAAG,KAAK,E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wB;;YAJxB,uEAAuE;YACvE,sEAAsE;YACtE,iEAAiE;YACjE,yEAAyE;YACzE,wBAAwB;YACxB,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,KAAK,EAAE,CAAC,CAAC,CAAC,EACV,MAAM,EAAE,CAAC,CAAC,CAAC;YACX,wEAAwE;YACxE,uEAAuE;YACvE,wCAAwC;YACxC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAC5C,SAAS,EAAE,GAAG,EAAE,OAAO,GACvB,CACH,CAAA;IACH,CAAC,CAAC,EAAE,CAAA;IAEJ,OAAO,CACL,KAAC,GAAG,IACF,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,EACnD,KAAK,EAAE;YACL,KAAK,EAAE,WAAW,CAAC,CAAC;YACpB,MAAM,EAAE,WAAW,CAAC,CAAC;YACrB,GAAG,CAAC,OAAO,IAAI,OAAO;gBACpB,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,OAAO,OAAO,OAAO,KAAK,EAAE;gBACxD,CAAC,CAAC,IAAI,CAAC;SACV,KACG,KAAK,YAER,KAAK,GACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Skeleton = void 0;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const box_1 = require("../../box.cjs");
7
+ const cn_1 = require("../../core/cn.cjs");
8
+ const Skeleton = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)(box_1.Box
9
+ // Announced as busy so a screen reader says "loading" rather than reading
10
+ // out an empty box, or nothing at all. A boolean, not the string "true":
11
+ // gui types the ARIA states as booleans and React writes the attribute out
12
+ // either way.
13
+ , { "aria-busy": true, "aria-live": "polite", className: (0, cn_1.cn)('hz-pulse rounded-md bg-muted', className), ...props }));
14
+ exports.Skeleton = Skeleton;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Skeleton — the shape of content that has not arrived.
3
+ *
4
+ * It is a box with the pulse on it and nothing else, so the SIZE is the caller's
5
+ * to state and should match what will land there. A skeleton that is not the
6
+ * size of its content is worse than none: the page reflows when the real thing
7
+ * appears, which is the jump the skeleton existed to prevent.
8
+ */
9
+ import * as React from 'react';
10
+ import { Box } from '../../box.js';
11
+ export declare const Skeleton: ({ className, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/skeleton.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAG/B,eAAO,MAAM,QAAQ,4BAA6B,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,4CAWjF,CAAA"}
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Box } from '../../box.js';
4
+ import { cn } from '../../core/cn.js';
5
+ export const Skeleton = ({ className, ...props }) => (_jsx(Box
6
+ // Announced as busy so a screen reader says "loading" rather than reading
7
+ // out an empty box, or nothing at all. A boolean, not the string "true":
8
+ // gui types the ARIA states as booleans and React writes the attribute out
9
+ // either way.
10
+ , { "aria-busy": true, "aria-live": "polite", className: cn('hz-pulse rounded-md bg-muted', className), ...props }));
11
+ //# sourceMappingURL=skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../src/backends/gui/skeleton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAYZ,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAElC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC,EAAE,EAAE,CAAC,CACrF,KAAC,GAAG;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,cAAc;iBACH,IAAI,eACL,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,8BAA8B,EAAE,SAAS,CAAC,KACpD,KAAK,GACT,CACH,CAAA"}
package/dist/box.cjs CHANGED
@@ -64,6 +64,23 @@ const TEXT_PROPS = ['fontSize', 'lineHeight', 'fontWeight', 'letterSpacing',
64
64
  // column going ragged — a 25px total measuring 27px, which no test asserting
65
65
  // on text would notice.
66
66
  'fontVariantNumeric'];
67
+ /**
68
+ * Properties gui has no style prop for, which must reach the DOM as plain CSS.
69
+ *
70
+ * An unrecognised prop is not dropped — it is FORWARDED, so it lands on the
71
+ * element as an attribute: `scrollSnapType="x mandatory"` sitting in the markup
72
+ * where `scroll-snap-type` was meant. The element renders, the attribute is
73
+ * inert, and a carousel scrolls freely past its slides with nothing to say why.
74
+ * Same shape as the text properties above, different reason: those are dropped
75
+ * by the frame, these were never known to it.
76
+ *
77
+ * Exactly the properties `tw` emits that gui's tables do not name. gui DOES
78
+ * carry `backgroundClip` and `backgroundOrigin`, so those stay with it; it does
79
+ * not carry the `-webkit-` half of the pair, which is the one Safari reads for
80
+ * clipping a gradient to text.
81
+ */
82
+ const CSS_PROPS = ['scrollSnapType', 'scrollSnapAlign', 'scrollSnapStop',
83
+ 'WebkitBackgroundClip'];
67
84
  const BoxInner = (0, react_1.forwardRef)(function Box({ className, children, 'aria-hidden': hidden, tag, ...rest }, ref) {
68
85
  const { props, rest: unread } = (0, tw_1.tw)(className);
69
86
  // A View pins `min-height: 0`; a div's is `auto`, and auto is what gives a
@@ -86,6 +103,11 @@ const BoxInner = (0, react_1.forwardRef)(function Box({ className, children, 'ar
86
103
  text[k] = props[k];
87
104
  delete props[k];
88
105
  }
106
+ for (const k of CSS_PROPS)
107
+ if (k in props) {
108
+ text[k] = props[k];
109
+ delete props[k];
110
+ }
89
111
  // A div's line-height comes from the cascade; gui's Stack stamps its own, so
90
112
  // a converted box grew a few pixels per line of text. Stated only when no
91
113
  // class said otherwise, so `leading-relaxed` still wins.
package/dist/box.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAM,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AA6B1C;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,IAWtE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EACpC,aAAa,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,IAAI,GAC3E,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GACnE,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,GAC7D,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAC7D,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC,GACzC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG;IAC3F,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,GAAG,CAAC,EAAE,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,GAAG,aAAa,GAAG,WAAW,GAC7D,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC,GACzC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG;IAC3F,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B;;OAEG;IACH,GAAG,CAAC,EAAE,CAAC,CAAA;IACP;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;CAC3C,CAAA;AAwEH;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAe,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,EACjF,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,KAC1C,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;eAEf,GAAG"}
package/dist/box.js CHANGED
@@ -61,6 +61,23 @@ const TEXT_PROPS = ['fontSize', 'lineHeight', 'fontWeight', 'letterSpacing',
61
61
  // column going ragged — a 25px total measuring 27px, which no test asserting
62
62
  // on text would notice.
63
63
  'fontVariantNumeric'];
64
+ /**
65
+ * Properties gui has no style prop for, which must reach the DOM as plain CSS.
66
+ *
67
+ * An unrecognised prop is not dropped — it is FORWARDED, so it lands on the
68
+ * element as an attribute: `scrollSnapType="x mandatory"` sitting in the markup
69
+ * where `scroll-snap-type` was meant. The element renders, the attribute is
70
+ * inert, and a carousel scrolls freely past its slides with nothing to say why.
71
+ * Same shape as the text properties above, different reason: those are dropped
72
+ * by the frame, these were never known to it.
73
+ *
74
+ * Exactly the properties `tw` emits that gui's tables do not name. gui DOES
75
+ * carry `backgroundClip` and `backgroundOrigin`, so those stay with it; it does
76
+ * not carry the `-webkit-` half of the pair, which is the one Safari reads for
77
+ * clipping a gradient to text.
78
+ */
79
+ const CSS_PROPS = ['scrollSnapType', 'scrollSnapAlign', 'scrollSnapStop',
80
+ 'WebkitBackgroundClip'];
64
81
  const BoxInner = forwardRef(function Box({ className, children, 'aria-hidden': hidden, tag, ...rest }, ref) {
65
82
  const { props, rest: unread } = tw(className);
66
83
  // A View pins `min-height: 0`; a div's is `auto`, and auto is what gives a
@@ -83,6 +100,11 @@ const BoxInner = forwardRef(function Box({ className, children, 'aria-hidden': h
83
100
  text[k] = props[k];
84
101
  delete props[k];
85
102
  }
103
+ for (const k of CSS_PROPS)
104
+ if (k in props) {
105
+ text[k] = props[k];
106
+ delete props[k];
107
+ }
86
108
  // A div's line-height comes from the cascade; gui's Stack stamps its own, so
87
109
  // a converted box grew a few pixels per line of text. Stated only when no
88
110
  // class said otherwise, so `leading-relaxed` still wins.