@hanzo/ui 8.15.0 → 8.16.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.
@@ -124,12 +124,11 @@ onClick, size, variant, icon, iconAfter, className, style, children, 'aria-curre
124
124
  variant: variant ?? def.variant ?? 'link',
125
125
  size: size ?? def.size ?? 'default',
126
126
  }), className);
127
- return ((0, jsx_runtime_1.jsx)(Comp, { href: href,
127
+ const anchor = ((0, jsx_runtime_1.jsx)(Comp, { href: href,
128
128
  // The host's link component takes a `style` and forwards everything else
129
129
  // to the anchor, so notation is CONVERTED here rather than handed over:
130
130
  // `w-full` on an <a> is two characters of nothing otherwise. What tw does
131
- // not read stays a class, which is how `btn`/`btn-link` — real rules in
132
- // our stylesheet — keep working.
131
+ // not read stays a class, which is how a host's own selectors keep working.
133
132
  className: (0, tw_1.tw)(classes).rest || undefined,
134
133
  // A def with no href and no handler is a LABEL, not a link. Written as a
135
134
  // style rather than a utility class because this renders a bare `<a>` and
@@ -140,5 +139,19 @@ onClick, size, variant, icon, iconAfter, className, style, children, 'aria-curre
140
139
  ...style,
141
140
  ...(href.length > 0 || onClick ? null : { pointerEvents: 'none' }),
142
141
  }, ...(onClick ? { onClick } : {}), ...nav, children: label() }));
142
+ // A link that LOOKS like a button IS one, rendering an anchor.
143
+ //
144
+ // `buttonVariants` names a variant — `btn btn-primary` — and nothing defines
145
+ // those selectors: they are a handle for a host to hook, not a rule. So a def
146
+ // asking for `variant: 'primary'` used to come out as underlined body text,
147
+ // measured on every call-to-action across the lux sites. Appearance is decided
148
+ // in exactly one place, the Button, and `asChild` hands it this anchor.
149
+ //
150
+ // `link` and its two relatives are the exception on purpose: they mean "look
151
+ // like a link", which is what the bare anchor already is.
152
+ const look = variant ?? def.variant ?? 'link';
153
+ if (look === 'link' || look === 'linkFG' || look === 'linkMuted')
154
+ return anchor;
155
+ return ((0, jsx_runtime_1.jsx)(button_1.Button, { asChild: true, variant: look, size: size ?? def.size ?? 'default', children: anchor }));
143
156
  };
144
157
  exports.LinkElement = LinkElement;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/link.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAkB,MAAM,UAAU,CAAA;AAE9E,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAA;AAE7C;;;GAGG;AACH,eAAO,MAAM,IAAI,8BAA0D,CAAA;AAE3E,eAAO,MAAM,OAAO,QAAO,aAAuC,CAAA;AAKlE;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,gCAIjB,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,4CAc/C,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,GAAG,EAAE,OAAO,CAAA;IACZ,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,uBAAuB;IACvB,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,uBAAuB;IACvB,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB,uBAAuB;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,uBAAuB;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;CACzC,CAAC,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,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A"}
@@ -23,7 +23,7 @@ import * as React from 'react';
23
23
  import { css } from '../../css.js';
24
24
  import { tw } from '../../tw.js';
25
25
  import { cn } from '../../core/cn.js';
26
- import { buttonVariants } from './button.js';
26
+ import { Button, buttonVariants } from './button.js';
27
27
  /**
28
28
  * The component every link renders through. `<Link value={NextLink}>` at the
29
29
  * root of a routed app; left alone it is a plain anchor.
@@ -86,12 +86,11 @@ onClick, size, variant, icon, iconAfter, className, style, children, 'aria-curre
86
86
  variant: variant ?? def.variant ?? 'link',
87
87
  size: size ?? def.size ?? 'default',
88
88
  }), className);
89
- return (_jsx(Comp, { href: href,
89
+ const anchor = (_jsx(Comp, { href: href,
90
90
  // The host's link component takes a `style` and forwards everything else
91
91
  // to the anchor, so notation is CONVERTED here rather than handed over:
92
92
  // `w-full` on an <a> is two characters of nothing otherwise. What tw does
93
- // not read stays a class, which is how `btn`/`btn-link` — real rules in
94
- // our stylesheet — keep working.
93
+ // not read stays a class, which is how a host's own selectors keep working.
95
94
  className: tw(classes).rest || undefined,
96
95
  // A def with no href and no handler is a LABEL, not a link. Written as a
97
96
  // style rather than a utility class because this renders a bare `<a>` and
@@ -102,5 +101,19 @@ onClick, size, variant, icon, iconAfter, className, style, children, 'aria-curre
102
101
  ...style,
103
102
  ...(href.length > 0 || onClick ? null : { pointerEvents: 'none' }),
104
103
  }, ...(onClick ? { onClick } : {}), ...nav, children: label() }));
104
+ // A link that LOOKS like a button IS one, rendering an anchor.
105
+ //
106
+ // `buttonVariants` names a variant — `btn btn-primary` — and nothing defines
107
+ // those selectors: they are a handle for a host to hook, not a rule. So a def
108
+ // asking for `variant: 'primary'` used to come out as underlined body text,
109
+ // measured on every call-to-action across the lux sites. Appearance is decided
110
+ // in exactly one place, the Button, and `asChild` hands it this anchor.
111
+ //
112
+ // `link` and its two relatives are the exception on purpose: they mean "look
113
+ // like a link", which is what the bare anchor already is.
114
+ const look = variant ?? def.variant ?? 'link';
115
+ if (look === 'link' || look === 'linkFG' || look === 'linkMuted')
116
+ return anchor;
117
+ return (_jsx(Button, { asChild: true, variant: look, size: size ?? def.size ?? 'default', children: anchor }));
105
118
  };
106
119
  //# sourceMappingURL=link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/backends/gui/link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAElC,OAAO,EAAuC,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9E;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,aAAa,CAAgB,GAAG,CAAC,CAAA;AAE3E,MAAM,CAAC,MAAM,OAAO,GAAG,GAAkB,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AAElE,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEvE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,GAAG,IAAI,EACuC,EAAE,EAAE;IAClD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;IACtB,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,YACvB,QAAQ,GACJ,CACR,CAAA;IACH,CAAC;IACD,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC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GED
@@ -6,6 +6,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const box_1 = require("./box.cjs");
7
7
  const Workbench_1 = require("./product/Workbench.cjs");
8
8
  const Skeleton_1 = require("./product/Skeleton.cjs");
9
+ const ConnectionBadge_1 = require("./product/ConnectionBadge.cjs");
10
+ const ProjectThumb_1 = require("./product/ProjectThumb.cjs");
11
+ const Split_1 = require("./product/Split.cjs");
9
12
  const TooltipAnchor_1 = require("./product/TooltipAnchor.cjs");
10
13
  const DialogTemplate_1 = require("./product/DialogTemplate.cjs");
11
14
  const chat_1 = require("./chat/index.cjs");
@@ -71,7 +74,7 @@ const Section = ({ name, children }) => ((0, jsx_runtime_1.jsx)("section", { "da
71
74
  * Every component, once. `data-gallery` names each section so a browser test can
72
75
  * scope its assertions without depending on document order.
73
76
  */
74
- const Gallery = () => ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 28, padding: 24, maxWidth: 928 }, children: [(0, jsx_runtime_1.jsx)(Section, { name: "type", children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: '100%' }, children: [11, 10, 9, 7, 6, 4, 3, 2, 1].map((rung) => ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: `$${rung}`, lineHeight: `$${rung}`, letterSpacing: `$${rung}`, children: "Hanzo \u2014 the Open AI Cloud" }, rung))) }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "button", children: [BUTTON_VARIANTS.map((variant) => ((0, jsx_runtime_1.jsx)(gui_1.Button, { variant: variant, children: variant }, variant))), BUTTON_SIZES.map((size) => ((0, jsx_runtime_1.jsx)(gui_1.Button, { size: size, children: size }, size))), (0, jsx_runtime_1.jsx)(gui_1.Button, { disabled: true, children: "disabled" }), (0, jsx_runtime_1.jsx)(gui_1.Button, { isLoading: true, children: "loading" })] }), (0, jsx_runtime_1.jsx)(Section, { name: "badge", children: BADGE_VARIANTS.map((variant) => ((0, jsx_runtime_1.jsx)(gui_1.Badge, { variant: variant, children: variant }, variant))) }), (0, jsx_runtime_1.jsx)(Section, { name: "card", children: (0, jsx_runtime_1.jsxs)(gui_1.Card, { children: [(0, jsx_runtime_1.jsxs)(gui_1.CardHeader, { children: [(0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "Card title" }), (0, jsx_runtime_1.jsx)(gui_1.CardDescription, { children: "Card description" }), (0, jsx_runtime_1.jsx)(gui_1.CardAction, { children: (0, jsx_runtime_1.jsx)(gui_1.Button, { size: "sm", variant: "ghost", children: "action" }) })] }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "Card content" }), (0, jsx_runtime_1.jsx)(gui_1.CardFooter, { children: "Card footer" })] }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "form", children: [(0, jsx_runtime_1.jsx)(gui_1.Label, { children: "Label" }), (0, jsx_runtime_1.jsx)(gui_1.Input, { placeholder: "Input" }), (0, jsx_runtime_1.jsx)(gui_1.Input, { placeholder: "Password", type: "password" }), (0, jsx_runtime_1.jsx)(gui_1.Textarea, { placeholder: "Textarea" }), (0, jsx_runtime_1.jsx)(gui_1.Checkbox, {}), (0, jsx_runtime_1.jsx)(gui_1.Checkbox, { checked: true }), (0, jsx_runtime_1.jsx)(gui_1.Switch, {}), (0, jsx_runtime_1.jsx)(gui_1.Switch, { checked: true }), (0, jsx_runtime_1.jsx)(gui_1.Slider, { defaultValue: [40] }), (0, jsx_runtime_1.jsx)(gui_1.Progress, { value: 40 }), (0, jsx_runtime_1.jsxs)(gui_1.RadioGroup, { defaultValue: "a", children: [(0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "a" }), (0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "b" }), (0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "c", disabled: true })] }), (0, jsx_runtime_1.jsxs)(gui_1.RadioGroup, { orientation: "horizontal", defaultValue: "a", children: [(0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "a" }), (0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "b" })] })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "toggle-group", children: [['default', 'outline'].map((variant) => ['default', 'sm', 'lg'].map((size) => ((0, jsx_runtime_1.jsxs)(gui_1.ToggleGroup, { type: "single", defaultValue: "a", variant: variant, size: size, children: [(0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "a", children: "A" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "b", children: "B" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "c", disabled: true, children: "C" })] }, `${variant}-${size}`)))), (0, jsx_runtime_1.jsxs)(gui_1.ToggleGroup, { type: "multiple", defaultValue: ['a'], children: [(0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "a", children: "A" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "b", children: "B" })] }), (0, jsx_runtime_1.jsxs)(gui_1.ToggleGroup, { type: "single", orientation: "vertical", defaultValue: "a", children: [(0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "a", children: "A" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "b", children: "B" })] })] }), (0, jsx_runtime_1.jsx)(Section, { name: "accordion", children: (0, jsx_runtime_1.jsxs)(gui_1.Accordion, { type: "single", collapsible: true, defaultValue: "one", children: [(0, jsx_runtime_1.jsxs)(gui_1.AccordionItem, { value: "one", children: [(0, jsx_runtime_1.jsx)(gui_1.AccordionTrigger, { children: "Accordion trigger" }), (0, jsx_runtime_1.jsx)(gui_1.AccordionContent, { children: "Accordion content" })] }), (0, jsx_runtime_1.jsxs)(gui_1.AccordionItem, { value: "two", children: [(0, jsx_runtime_1.jsx)(gui_1.AccordionTrigger, { children: "Second trigger" }), (0, jsx_runtime_1.jsx)(gui_1.AccordionContent, { children: "Second content" })] })] }) }), (0, jsx_runtime_1.jsx)(Section, { name: "tabs", children: (0, jsx_runtime_1.jsxs)(gui_1.Tabs, { defaultValue: "one", children: [(0, jsx_runtime_1.jsxs)(gui_1.TabsList, { children: [(0, jsx_runtime_1.jsx)(gui_1.TabsTrigger, { value: "one", children: "One" }), (0, jsx_runtime_1.jsx)(gui_1.TabsTrigger, { value: "two", children: "Two" })] }), (0, jsx_runtime_1.jsx)(gui_1.TabsContent, { value: "one", children: "Panel one" })] }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "surface", children: [(0, jsx_runtime_1.jsx)(gui_1.Separator, {}), (0, jsx_runtime_1.jsx)(gui_1.AspectRatio, { ratio: 16 / 9 }), (0, jsx_runtime_1.jsx)(gui_1.Avatar, { children: (0, jsx_runtime_1.jsx)(gui_1.AvatarFallback, { children: "HZ" }) }), (0, jsx_runtime_1.jsx)(gui_1.ScrollArea, { height: 80, children: "Scroll area" }), (0, jsx_runtime_1.jsxs)(gui_1.ResizablePanelGroup, { direction: "horizontal", children: [(0, jsx_runtime_1.jsx)(gui_1.ResizablePanel, {}), (0, jsx_runtime_1.jsx)(gui_1.ResizableHandle, {}), (0, jsx_runtime_1.jsx)(gui_1.ResizablePanel, {})] })] }), (0, jsx_runtime_1.jsx)(Section, { name: "spinner", children: [12, 16, 20, 32].map((size) => ((0, jsx_runtime_1.jsx)(gui_1.Spinner, { size: size }, size))) }), (0, jsx_runtime_1.jsx)(Section, { name: "collapsible", children: (0, jsx_runtime_1.jsxs)(gui_1.Collapsible, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.CollapsibleTrigger, { children: "Collapsible trigger" }), (0, jsx_runtime_1.jsx)(gui_1.CollapsibleContent, { children: "Collapsible content" })] }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "command", children: [(0, jsx_runtime_1.jsxs)(gui_1.Command, { children: [(0, jsx_runtime_1.jsx)(gui_1.CommandInput, {}), (0, jsx_runtime_1.jsxs)(gui_1.CommandList, { children: [(0, jsx_runtime_1.jsx)(gui_1.CommandEmpty, { children: "No results" }), (0, jsx_runtime_1.jsx)(gui_1.CommandGroup, { heading: "Group", children: (0, jsx_runtime_1.jsxs)(gui_1.CommandItem, { value: "a", children: ["Item", (0, jsx_runtime_1.jsx)(gui_1.CommandShortcut, { children: "\u2318A" })] }) }), (0, jsx_runtime_1.jsx)(gui_1.CommandSeparator, {})] })] }), (0, jsx_runtime_1.jsxs)(gui_1.CommandDialog, { open: true, defaultValue: "alpha", onValueChange: (v) => {
77
+ const Gallery = () => ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 28, padding: 24, maxWidth: 928 }, children: [(0, jsx_runtime_1.jsx)(Section, { name: "type", children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: '100%' }, children: [11, 10, 9, 7, 6, 4, 3, 2, 1].map((rung) => ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: `$${rung}`, lineHeight: `$${rung}`, letterSpacing: `$${rung}`, children: "Hanzo \u2014 the Open AI Cloud" }, rung))) }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "button", children: [BUTTON_VARIANTS.map((variant) => ((0, jsx_runtime_1.jsx)(gui_1.Button, { variant: variant, children: variant }, variant))), BUTTON_SIZES.map((size) => ((0, jsx_runtime_1.jsx)(gui_1.Button, { size: size, children: size }, size))), (0, jsx_runtime_1.jsx)(gui_1.Button, { disabled: true, children: "disabled" }), (0, jsx_runtime_1.jsx)(gui_1.Button, { isLoading: true, children: "loading" })] }), (0, jsx_runtime_1.jsx)(Section, { name: "badge", children: BADGE_VARIANTS.map((variant) => ((0, jsx_runtime_1.jsx)(gui_1.Badge, { variant: variant, children: variant }, variant))) }), (0, jsx_runtime_1.jsx)(Section, { name: "card", children: (0, jsx_runtime_1.jsxs)(gui_1.Card, { children: [(0, jsx_runtime_1.jsxs)(gui_1.CardHeader, { children: [(0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "Card title" }), (0, jsx_runtime_1.jsx)(gui_1.CardDescription, { children: "Card description" }), (0, jsx_runtime_1.jsx)(gui_1.CardAction, { children: (0, jsx_runtime_1.jsx)(gui_1.Button, { size: "sm", variant: "ghost", children: "action" }) })] }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "Card content" }), (0, jsx_runtime_1.jsx)(gui_1.CardFooter, { children: "Card footer" })] }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "form", children: [(0, jsx_runtime_1.jsx)(gui_1.Label, { children: "Label" }), (0, jsx_runtime_1.jsx)(gui_1.Input, { placeholder: "Input" }), (0, jsx_runtime_1.jsx)(gui_1.Input, { placeholder: "Password", type: "password" }), (0, jsx_runtime_1.jsx)(gui_1.Textarea, { placeholder: "Textarea" }), (0, jsx_runtime_1.jsx)(gui_1.Checkbox, {}), (0, jsx_runtime_1.jsx)(gui_1.Checkbox, { checked: true }), (0, jsx_runtime_1.jsx)(gui_1.Switch, {}), (0, jsx_runtime_1.jsx)(gui_1.Switch, { checked: true }), (0, jsx_runtime_1.jsx)(gui_1.Slider, { defaultValue: [40] }), (0, jsx_runtime_1.jsx)(gui_1.Progress, { value: 40 }), (0, jsx_runtime_1.jsxs)(gui_1.RadioGroup, { defaultValue: "a", children: [(0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "a" }), (0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "b" }), (0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "c", disabled: true })] }), (0, jsx_runtime_1.jsxs)(gui_1.RadioGroup, { orientation: "horizontal", defaultValue: "a", children: [(0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "a" }), (0, jsx_runtime_1.jsx)(gui_1.RadioGroupItem, { value: "b" })] })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "toggle-group", children: [['default', 'outline'].map((variant) => ['default', 'sm', 'lg'].map((size) => ((0, jsx_runtime_1.jsxs)(gui_1.ToggleGroup, { type: "single", defaultValue: "a", variant: variant, size: size, children: [(0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "a", children: "A" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "b", children: "B" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "c", disabled: true, children: "C" })] }, `${variant}-${size}`)))), (0, jsx_runtime_1.jsxs)(gui_1.ToggleGroup, { type: "multiple", defaultValue: ['a'], children: [(0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "a", children: "A" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "b", children: "B" })] }), (0, jsx_runtime_1.jsxs)(gui_1.ToggleGroup, { type: "single", orientation: "vertical", defaultValue: "a", children: [(0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "a", children: "A" }), (0, jsx_runtime_1.jsx)(gui_1.ToggleGroupItem, { value: "b", children: "B" })] })] }), (0, jsx_runtime_1.jsx)(Section, { name: "accordion", children: (0, jsx_runtime_1.jsxs)(gui_1.Accordion, { type: "single", collapsible: true, defaultValue: "one", children: [(0, jsx_runtime_1.jsxs)(gui_1.AccordionItem, { value: "one", children: [(0, jsx_runtime_1.jsx)(gui_1.AccordionTrigger, { children: "Accordion trigger" }), (0, jsx_runtime_1.jsx)(gui_1.AccordionContent, { children: "Accordion content" })] }), (0, jsx_runtime_1.jsxs)(gui_1.AccordionItem, { value: "two", children: [(0, jsx_runtime_1.jsx)(gui_1.AccordionTrigger, { children: "Second trigger" }), (0, jsx_runtime_1.jsx)(gui_1.AccordionContent, { children: "Second content" })] })] }) }), (0, jsx_runtime_1.jsx)(Section, { name: "tabs", children: (0, jsx_runtime_1.jsxs)(gui_1.Tabs, { defaultValue: "one", children: [(0, jsx_runtime_1.jsxs)(gui_1.TabsList, { children: [(0, jsx_runtime_1.jsx)(gui_1.TabsTrigger, { value: "one", children: "One" }), (0, jsx_runtime_1.jsx)(gui_1.TabsTrigger, { value: "two", children: "Two" })] }), (0, jsx_runtime_1.jsx)(gui_1.TabsContent, { value: "one", children: "Panel one" })] }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "surface", children: [(0, jsx_runtime_1.jsx)(gui_1.Separator, {}), (0, jsx_runtime_1.jsx)(gui_1.AspectRatio, { ratio: 16 / 9 }), (0, jsx_runtime_1.jsx)(gui_1.Avatar, { children: (0, jsx_runtime_1.jsx)(gui_1.AvatarFallback, { children: "HZ" }) }), (0, jsx_runtime_1.jsx)(gui_1.ScrollArea, { height: 80, children: "Scroll area" }), (0, jsx_runtime_1.jsxs)(gui_1.ResizablePanelGroup, { direction: "horizontal", children: [(0, jsx_runtime_1.jsx)(gui_1.ResizablePanel, {}), (0, jsx_runtime_1.jsx)(gui_1.ResizableHandle, {}), (0, jsx_runtime_1.jsx)(gui_1.ResizablePanel, {})] })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "connection-badge", children: [(0, jsx_runtime_1.jsx)(ConnectionBadge_1.ConnectionBadge, { method: "OAuth", extra: "acme/site", onDisconnect: () => { } }), (0, jsx_runtime_1.jsx)(ConnectionBadge_1.ConnectionBadge, { method: "API key", onDisconnect: () => { }, disconnecting: true })] }), (0, jsx_runtime_1.jsx)(Section, { name: "project-thumb", children: (0, jsx_runtime_1.jsx)("div", { style: { width: 240 }, children: (0, jsx_runtime_1.jsx)(ProjectThumb_1.ProjectThumb, { name: "Acme" }) }) }), (0, jsx_runtime_1.jsx)(Section, { name: "split", children: (0, jsx_runtime_1.jsx)("div", { style: { width: 360, height: 120 }, children: (0, jsx_runtime_1.jsx)(Split_1.Split, { left: (0, jsx_runtime_1.jsx)(box_1.Box, { children: "left" }), right: (0, jsx_runtime_1.jsx)(box_1.Box, { children: "right" }) }) }) }), (0, jsx_runtime_1.jsx)(Section, { name: "spinner", children: [12, 16, 20, 32].map((size) => ((0, jsx_runtime_1.jsx)(gui_1.Spinner, { size: size }, size))) }), (0, jsx_runtime_1.jsx)(Section, { name: "collapsible", children: (0, jsx_runtime_1.jsxs)(gui_1.Collapsible, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.CollapsibleTrigger, { children: "Collapsible trigger" }), (0, jsx_runtime_1.jsx)(gui_1.CollapsibleContent, { children: "Collapsible content" })] }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "command", children: [(0, jsx_runtime_1.jsxs)(gui_1.Command, { children: [(0, jsx_runtime_1.jsx)(gui_1.CommandInput, {}), (0, jsx_runtime_1.jsxs)(gui_1.CommandList, { children: [(0, jsx_runtime_1.jsx)(gui_1.CommandEmpty, { children: "No results" }), (0, jsx_runtime_1.jsx)(gui_1.CommandGroup, { heading: "Group", children: (0, jsx_runtime_1.jsxs)(gui_1.CommandItem, { value: "a", children: ["Item", (0, jsx_runtime_1.jsx)(gui_1.CommandShortcut, { children: "\u2318A" })] }) }), (0, jsx_runtime_1.jsx)(gui_1.CommandSeparator, {})] })] }), (0, jsx_runtime_1.jsxs)(gui_1.CommandDialog, { open: true, defaultValue: "alpha", onValueChange: (v) => {
75
78
  const el = document.querySelector('[data-palette-selected]');
76
79
  if (el)
77
80
  el.setAttribute('data-palette-selected', v);
@@ -1 +1 @@
1
- {"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AAkJA;;;GAGG;AACH,eAAO,MAAM,OAAO,+CA2kBnB,CAAA;eAEc,OAAO"}
1
+ {"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AAqJA;;;GAGG;AACH,eAAO,MAAM,OAAO,+CA+lBnB,CAAA;eAEc,OAAO"}