@hanzo/ui 8.0.76 → 8.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gallery.cjs +11 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.js +11 -1
- package/dist/gallery.js.map +1 -1
- package/dist/glass.cjs +60 -6
- package/dist/glass.css +98 -3
- package/dist/glass.d.ts +49 -0
- package/dist/glass.d.ts.map +1 -1
- package/dist/glass.js +58 -5
- package/dist/glass.js.map +1 -1
- package/dist/product/Palette.cjs +1 -1
- package/dist/product/Palette.d.ts.map +1 -1
- package/dist/product/Palette.js +1 -1
- package/dist/product/Palette.js.map +1 -1
- package/dist/product/Workbench.cjs +97 -0
- package/dist/product/Workbench.d.ts +65 -0
- package/dist/product/Workbench.d.ts.map +1 -0
- package/dist/product/Workbench.js +94 -0
- package/dist/product/Workbench.js.map +1 -0
- package/dist/product/index.cjs +1 -0
- package/dist/product/index.d.ts +1 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +1 -0
- package/dist/product/index.js.map +1 -1
- package/dist/styles.css +171 -3
- package/dist/theme.css +148 -3
- package/package.json +2 -2
package/dist/gallery.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Gallery = void 0;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Workbench_1 = require("./product/Workbench.cjs");
|
|
6
7
|
const gui_1 = require("./backends/gui/index.cjs");
|
|
7
8
|
/** A real <img> with real intrinsic pixels, inline so nothing hits the network.
|
|
8
9
|
* 120x40 on purpose: the wrong ratio for every box it goes in, so a frame that
|
|
@@ -31,6 +32,15 @@ const Gallery = () => ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex'
|
|
|
31
32
|
const el = document.querySelector('[data-palette-selected]');
|
|
32
33
|
if (el)
|
|
33
34
|
el.setAttribute('data-palette-selected', v);
|
|
34
|
-
}, 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.jsxs)(gui_1.CommandGroup, { heading: "Palette", children: [(0, jsx_runtime_1.jsx)(gui_1.CommandItem, { value: "alpha", children: "alpha" }), (0, jsx_runtime_1.jsx)(gui_1.CommandItem, { value: "beta", children: "beta" }), (0, jsx_runtime_1.jsx)(gui_1.CommandItem, { value: "gamma", children: "gamma" })] })] })] }), (0, jsx_runtime_1.jsx)("span", { "data-palette-selected": "" })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "overlay", children: [(0, jsx_runtime_1.jsx)(gui_1.Dialog, { open: true, children: (0, jsx_runtime_1.jsxs)(gui_1.DialogContent, { children: [(0, jsx_runtime_1.jsxs)(gui_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(gui_1.DialogTitle, { children: "Dialog title" }), (0, jsx_runtime_1.jsx)(gui_1.DialogDescription, { children: "Dialog description" })] }), (0, jsx_runtime_1.jsx)(gui_1.DialogFooter, { children: (0, jsx_runtime_1.jsx)(gui_1.Button, { size: "sm", children: "OK" }) })] }) }), (0, jsx_runtime_1.jsxs)(gui_1.DropdownMenu, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.DropdownMenuTrigger, { children: "Menu" }), (0, jsx_runtime_1.jsxs)(gui_1.DropdownMenuContent, { children: [(0, jsx_runtime_1.jsx)(gui_1.DropdownMenuLabel, { children: "Label" }), (0, jsx_runtime_1.jsx)(gui_1.DropdownMenuSeparator, {}), (0, jsx_runtime_1.jsx)(gui_1.DropdownMenuItem, { children: "Item" })] })] }), (0, jsx_runtime_1.jsxs)(gui_1.Popover, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.PopoverTrigger, { children: "Popover" }), (0, jsx_runtime_1.jsx)(gui_1.PopoverContent, { children: "Popover content" })] }), (0, jsx_runtime_1.jsxs)(gui_1.Select, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.SelectTrigger, { children: (0, jsx_runtime_1.jsx)(gui_1.SelectValue, { placeholder: "Select" }) }), (0, jsx_runtime_1.jsx)(gui_1.SelectContent, { children: (0, jsx_runtime_1.jsx)(gui_1.SelectItem, { value: "x", index: 0, children: "Option" }) })] }), (0, jsx_runtime_1.jsx)(gui_1.TooltipProvider, { delay: 0, children: (0, jsx_runtime_1.jsxs)(gui_1.Tooltip, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.TooltipTrigger, { children: "Tooltip" }), (0, jsx_runtime_1.jsx)(gui_1.TooltipContent, { children: "Tooltip content" })] }) }), (0, jsx_runtime_1.jsx)(gui_1.AlertDialog, { open: true, children: (0, jsx_runtime_1.jsxs)(gui_1.AlertDialogContent, { children: [(0, jsx_runtime_1.jsxs)(gui_1.AlertDialogHeader, { children: [(0, jsx_runtime_1.jsx)(gui_1.AlertDialogTitle, { children: "Alert title" }), (0, jsx_runtime_1.jsx)(gui_1.AlertDialogDescription, { children: "Alert description" })] }), (0, jsx_runtime_1.jsxs)(gui_1.AlertDialogFooter, { children: [(0, jsx_runtime_1.jsx)(gui_1.AlertDialogCancel, { children: "Cancel" }), (0, jsx_runtime_1.jsx)(gui_1.AlertDialogAction, { variant: "destructive", children: "Delete" })] })] }) }), (0, jsx_runtime_1.jsxs)(gui_1.HoverCard, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.HoverCardTrigger, { children: "Hover card" }), (0, jsx_runtime_1.jsx)(gui_1.HoverCardContent, { children: "Hover card content" })] }), (0, jsx_runtime_1.jsxs)(gui_1.ContextMenu, { children: [(0, jsx_runtime_1.jsx)(gui_1.ContextMenuTrigger, { children: "Context menu" }), (0, jsx_runtime_1.jsxs)(gui_1.ContextMenuContent, { children: [(0, jsx_runtime_1.jsx)(gui_1.ContextMenuLabel, { children: "Label" }), (0, jsx_runtime_1.jsx)(gui_1.ContextMenuSeparator, {}), (0, jsx_runtime_1.jsx)(gui_1.ContextMenuItem, { children: "Item" })] })] }), (0, jsx_runtime_1.jsx)(gui_1.Toaster, {})] }), (0, jsx_runtime_1.jsxs)(Section, { name: "layout", children: [(0, jsx_runtime_1.jsx)(gui_1.Grid, { min: 240, gap: "$3", style: { width: '100%' }, "data-grid": "auto", children: [0, 1, 2, 3, 4, 5, 6].map((i) => ((0, jsx_runtime_1.jsxs)(gui_1.Card, { children: [(0, jsx_runtime_1.jsx)(gui_1.CardMedia, { ratio: 16 / 10, children: (0, jsx_runtime_1.jsx)("img", { src: SWATCH, alt: "" }) }), (0, jsx_runtime_1.jsxs)(gui_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(gui_1.CardTitle, { children: ["Card ", i] }), (0, jsx_runtime_1.jsx)(gui_1.CardDescription, { children: "Sized by its content, never by a pinned height." })] })] }, i))) }), (0, jsx_runtime_1.jsx)(gui_1.Grid, { min: 160, max: 4, gap: "$3", style: { width: '100%' }, "data-grid": "capped", children: [0, 1, 2, 3, 4, 5].map((i) => ((0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsxs)(gui_1.CardContent, { children: ["cap ", i] }) }, i))) }), (0, jsx_runtime_1.jsxs)(gui_1.Grid, { min: 900, gap: "$3", style: { width: '100%' }, "data-grid": "wide", children: [(0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "wide" }) }), (0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "wide" }) })] }), (0, jsx_runtime_1.jsx)("div", { style: { width: '100%', overflow: 'hidden' }, children: (0, jsx_runtime_1.jsxs)(gui_1.Grid, { cols: 3, gap: "$3", style: { width: '100%' }, "data-grid": "fixed", children: [(0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "short" }) }), (0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: (0, jsx_runtime_1.jsx)("span", { style: { whiteSpace: 'nowrap' }, children: "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" }) }) }), (0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "short" }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { "data-grid": "growth", style: { display: 'flex', alignItems: 'flex-start', gap: 12, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(gui_1.Card, { "data-card": "lean", children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "one line" }) }), (0, jsx_runtime_1.jsxs)(gui_1.Card, { "data-card": "fat", children: [(0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "one line" }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "two line" }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "three line" }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "four line" })] })] }), (0, jsx_runtime_1.jsx)(gui_1.Card, { interactive: true, "data-card": "interactive", children: (0, jsx_runtime_1.jsx)(gui_1.CardHeader, { children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "Interactive card" }) }) }), (0, jsx_runtime_1.jsx)(gui_1.Section, { maxWidth: 600, "data-section": "demo", children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "Section" }) }), (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { fontFamily: "$mono", "data-type": "mono", children: "1234567890" }), (0, jsx_runtime_1.jsx)(gui_1.Button, { "data-button": "block-child", children: (0, jsx_runtime_1.jsx)("span", { "data-block-child": true, style: { display: 'block', height: 119, width: 119 } }) })] })
|
|
35
|
+
}, 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.jsxs)(gui_1.CommandGroup, { heading: "Palette", children: [(0, jsx_runtime_1.jsx)(gui_1.CommandItem, { value: "alpha", children: "alpha" }), (0, jsx_runtime_1.jsx)(gui_1.CommandItem, { value: "beta", children: "beta" }), (0, jsx_runtime_1.jsx)(gui_1.CommandItem, { value: "gamma", children: "gamma" })] })] })] }), (0, jsx_runtime_1.jsx)("span", { "data-palette-selected": "" })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "overlay", children: [(0, jsx_runtime_1.jsx)(gui_1.Dialog, { open: true, children: (0, jsx_runtime_1.jsxs)(gui_1.DialogContent, { children: [(0, jsx_runtime_1.jsxs)(gui_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(gui_1.DialogTitle, { children: "Dialog title" }), (0, jsx_runtime_1.jsx)(gui_1.DialogDescription, { children: "Dialog description" })] }), (0, jsx_runtime_1.jsx)(gui_1.DialogFooter, { children: (0, jsx_runtime_1.jsx)(gui_1.Button, { size: "sm", children: "OK" }) })] }) }), (0, jsx_runtime_1.jsxs)(gui_1.DropdownMenu, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.DropdownMenuTrigger, { children: "Menu" }), (0, jsx_runtime_1.jsxs)(gui_1.DropdownMenuContent, { children: [(0, jsx_runtime_1.jsx)(gui_1.DropdownMenuLabel, { children: "Label" }), (0, jsx_runtime_1.jsx)(gui_1.DropdownMenuSeparator, {}), (0, jsx_runtime_1.jsx)(gui_1.DropdownMenuItem, { children: "Item" })] })] }), (0, jsx_runtime_1.jsxs)(gui_1.Popover, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.PopoverTrigger, { children: "Popover" }), (0, jsx_runtime_1.jsx)(gui_1.PopoverContent, { children: "Popover content" })] }), (0, jsx_runtime_1.jsxs)(gui_1.Select, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.SelectTrigger, { children: (0, jsx_runtime_1.jsx)(gui_1.SelectValue, { placeholder: "Select" }) }), (0, jsx_runtime_1.jsx)(gui_1.SelectContent, { children: (0, jsx_runtime_1.jsx)(gui_1.SelectItem, { value: "x", index: 0, children: "Option" }) })] }), (0, jsx_runtime_1.jsx)(gui_1.TooltipProvider, { delay: 0, children: (0, jsx_runtime_1.jsxs)(gui_1.Tooltip, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.TooltipTrigger, { children: "Tooltip" }), (0, jsx_runtime_1.jsx)(gui_1.TooltipContent, { children: "Tooltip content" })] }) }), (0, jsx_runtime_1.jsx)(gui_1.AlertDialog, { open: true, children: (0, jsx_runtime_1.jsxs)(gui_1.AlertDialogContent, { children: [(0, jsx_runtime_1.jsxs)(gui_1.AlertDialogHeader, { children: [(0, jsx_runtime_1.jsx)(gui_1.AlertDialogTitle, { children: "Alert title" }), (0, jsx_runtime_1.jsx)(gui_1.AlertDialogDescription, { children: "Alert description" })] }), (0, jsx_runtime_1.jsxs)(gui_1.AlertDialogFooter, { children: [(0, jsx_runtime_1.jsx)(gui_1.AlertDialogCancel, { children: "Cancel" }), (0, jsx_runtime_1.jsx)(gui_1.AlertDialogAction, { variant: "destructive", children: "Delete" })] })] }) }), (0, jsx_runtime_1.jsxs)(gui_1.HoverCard, { open: true, children: [(0, jsx_runtime_1.jsx)(gui_1.HoverCardTrigger, { children: "Hover card" }), (0, jsx_runtime_1.jsx)(gui_1.HoverCardContent, { children: "Hover card content" })] }), (0, jsx_runtime_1.jsxs)(gui_1.ContextMenu, { children: [(0, jsx_runtime_1.jsx)(gui_1.ContextMenuTrigger, { children: "Context menu" }), (0, jsx_runtime_1.jsxs)(gui_1.ContextMenuContent, { children: [(0, jsx_runtime_1.jsx)(gui_1.ContextMenuLabel, { children: "Label" }), (0, jsx_runtime_1.jsx)(gui_1.ContextMenuSeparator, {}), (0, jsx_runtime_1.jsx)(gui_1.ContextMenuItem, { children: "Item" })] })] }), (0, jsx_runtime_1.jsx)(gui_1.Toaster, {})] }), (0, jsx_runtime_1.jsxs)(Section, { name: "layout", children: [(0, jsx_runtime_1.jsx)(gui_1.Grid, { min: 240, gap: "$3", style: { width: '100%' }, "data-grid": "auto", children: [0, 1, 2, 3, 4, 5, 6].map((i) => ((0, jsx_runtime_1.jsxs)(gui_1.Card, { children: [(0, jsx_runtime_1.jsx)(gui_1.CardMedia, { ratio: 16 / 10, children: (0, jsx_runtime_1.jsx)("img", { src: SWATCH, alt: "" }) }), (0, jsx_runtime_1.jsxs)(gui_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(gui_1.CardTitle, { children: ["Card ", i] }), (0, jsx_runtime_1.jsx)(gui_1.CardDescription, { children: "Sized by its content, never by a pinned height." })] })] }, i))) }), (0, jsx_runtime_1.jsx)(gui_1.Grid, { min: 160, max: 4, gap: "$3", style: { width: '100%' }, "data-grid": "capped", children: [0, 1, 2, 3, 4, 5].map((i) => ((0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsxs)(gui_1.CardContent, { children: ["cap ", i] }) }, i))) }), (0, jsx_runtime_1.jsxs)(gui_1.Grid, { min: 900, gap: "$3", style: { width: '100%' }, "data-grid": "wide", children: [(0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "wide" }) }), (0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "wide" }) })] }), (0, jsx_runtime_1.jsx)("div", { style: { width: '100%', overflow: 'hidden' }, children: (0, jsx_runtime_1.jsxs)(gui_1.Grid, { cols: 3, gap: "$3", style: { width: '100%' }, "data-grid": "fixed", children: [(0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "short" }) }), (0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: (0, jsx_runtime_1.jsx)("span", { style: { whiteSpace: 'nowrap' }, children: "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" }) }) }), (0, jsx_runtime_1.jsx)(gui_1.Card, { children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "short" }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { "data-grid": "growth", style: { display: 'flex', alignItems: 'flex-start', gap: 12, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(gui_1.Card, { "data-card": "lean", children: (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "one line" }) }), (0, jsx_runtime_1.jsxs)(gui_1.Card, { "data-card": "fat", children: [(0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "one line" }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "two line" }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "three line" }), (0, jsx_runtime_1.jsx)(gui_1.CardContent, { children: "four line" })] })] }), (0, jsx_runtime_1.jsx)(gui_1.Card, { interactive: true, "data-card": "interactive", children: (0, jsx_runtime_1.jsx)(gui_1.CardHeader, { children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "Interactive card" }) }) }), (0, jsx_runtime_1.jsx)(gui_1.Section, { maxWidth: 600, "data-section": "demo", children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "Section" }) }), (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { fontFamily: "$mono", "data-type": "mono", children: "1234567890" }), (0, jsx_runtime_1.jsx)(gui_1.Button, { "data-button": "block-child", children: (0, jsx_runtime_1.jsx)("span", { "data-block-child": true, style: { display: 'block', height: 119, width: 119 } }) })] }), (0, jsx_runtime_1.jsx)(Section, { name: "workbench", children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', height: 220, width: 880 }, children: (0, jsx_runtime_1.jsx)(Workbench_1.Workbench, { left: { tabs: [{ id: 'files', title: 'Files', content: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "left" }) }] }, right: {
|
|
36
|
+
tabs: [
|
|
37
|
+
{ id: 'chat', title: 'Side chat', content: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "chat" }) },
|
|
38
|
+
{ id: 'browser', title: 'Browser', content: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "browser" }) },
|
|
39
|
+
],
|
|
40
|
+
}, bottom: {
|
|
41
|
+
tabs: [
|
|
42
|
+
{ id: 'console', title: 'Console', closable: false, content: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "console" }) },
|
|
43
|
+
],
|
|
44
|
+
}, children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "center" }) }) }) })] }));
|
|
35
45
|
exports.Gallery = Gallery;
|
|
36
46
|
exports.default = exports.Gallery;
|
package/dist/gallery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AA6EA;;;GAGG;AACH,eAAO,MAAM,OAAO,+CA0XnB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
package/dist/gallery.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Workbench } from './product/Workbench.js';
|
|
3
4
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuTrigger, HoverCard, HoverCardContent, HoverCardTrigger, RadioGroup, RadioGroupItem, ToggleGroup, ToggleGroupItem, AspectRatio, Avatar, AvatarFallback, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Input, Label, Popover, PopoverContent, PopoverTrigger, Progress, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Grid, Section as PageSection, CardMedia, CommandDialog, } from './backends/gui/index.js';
|
|
4
5
|
/** A real <img> with real intrinsic pixels, inline so nothing hits the network.
|
|
5
6
|
* 120x40 on purpose: the wrong ratio for every box it goes in, so a frame that
|
|
@@ -28,6 +29,15 @@ export const Gallery = () => (_jsxs("div", { style: { display: 'flex', flexDirec
|
|
|
28
29
|
const el = document.querySelector('[data-palette-selected]');
|
|
29
30
|
if (el)
|
|
30
31
|
el.setAttribute('data-palette-selected', v);
|
|
31
|
-
}, children: [_jsx(CommandInput, {}), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: "No results" }), _jsxs(CommandGroup, { heading: "Palette", children: [_jsx(CommandItem, { value: "alpha", children: "alpha" }), _jsx(CommandItem, { value: "beta", children: "beta" }), _jsx(CommandItem, { value: "gamma", children: "gamma" })] })] })] }), _jsx("span", { "data-palette-selected": "" })] }), _jsxs(Section, { name: "overlay", children: [_jsx(Dialog, { open: true, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Dialog title" }), _jsx(DialogDescription, { children: "Dialog description" })] }), _jsx(DialogFooter, { children: _jsx(Button, { size: "sm", children: "OK" }) })] }) }), _jsxs(DropdownMenu, { open: true, children: [_jsx(DropdownMenuTrigger, { children: "Menu" }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuLabel, { children: "Label" }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { children: "Item" })] })] }), _jsxs(Popover, { open: true, children: [_jsx(PopoverTrigger, { children: "Popover" }), _jsx(PopoverContent, { children: "Popover content" })] }), _jsxs(Select, { open: true, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select" }) }), _jsx(SelectContent, { children: _jsx(SelectItem, { value: "x", index: 0, children: "Option" }) })] }), _jsx(TooltipProvider, { delay: 0, children: _jsxs(Tooltip, { open: true, children: [_jsx(TooltipTrigger, { children: "Tooltip" }), _jsx(TooltipContent, { children: "Tooltip content" })] }) }), _jsx(AlertDialog, { open: true, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Alert title" }), _jsx(AlertDialogDescription, { children: "Alert description" })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { variant: "destructive", children: "Delete" })] })] }) }), _jsxs(HoverCard, { open: true, children: [_jsx(HoverCardTrigger, { children: "Hover card" }), _jsx(HoverCardContent, { children: "Hover card content" })] }), _jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { children: "Context menu" }), _jsxs(ContextMenuContent, { children: [_jsx(ContextMenuLabel, { children: "Label" }), _jsx(ContextMenuSeparator, {}), _jsx(ContextMenuItem, { children: "Item" })] })] }), _jsx(Toaster, {})] }), _jsxs(Section, { name: "layout", children: [_jsx(Grid, { min: 240, gap: "$3", style: { width: '100%' }, "data-grid": "auto", children: [0, 1, 2, 3, 4, 5, 6].map((i) => (_jsxs(Card, { children: [_jsx(CardMedia, { ratio: 16 / 10, children: _jsx("img", { src: SWATCH, alt: "" }) }), _jsxs(CardHeader, { children: [_jsxs(CardTitle, { children: ["Card ", i] }), _jsx(CardDescription, { children: "Sized by its content, never by a pinned height." })] })] }, i))) }), _jsx(Grid, { min: 160, max: 4, gap: "$3", style: { width: '100%' }, "data-grid": "capped", children: [0, 1, 2, 3, 4, 5].map((i) => (_jsx(Card, { children: _jsxs(CardContent, { children: ["cap ", i] }) }, i))) }), _jsxs(Grid, { min: 900, gap: "$3", style: { width: '100%' }, "data-grid": "wide", children: [_jsx(Card, { children: _jsx(CardContent, { children: "wide" }) }), _jsx(Card, { children: _jsx(CardContent, { children: "wide" }) })] }), _jsx("div", { style: { width: '100%', overflow: 'hidden' }, children: _jsxs(Grid, { cols: 3, gap: "$3", style: { width: '100%' }, "data-grid": "fixed", children: [_jsx(Card, { children: _jsx(CardContent, { children: "short" }) }), _jsx(Card, { children: _jsx(CardContent, { children: _jsx("span", { style: { whiteSpace: 'nowrap' }, children: "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" }) }) }), _jsx(Card, { children: _jsx(CardContent, { children: "short" }) })] }) }), _jsxs("div", { "data-grid": "growth", style: { display: 'flex', alignItems: 'flex-start', gap: 12, width: '100%' }, children: [_jsx(Card, { "data-card": "lean", children: _jsx(CardContent, { children: "one line" }) }), _jsxs(Card, { "data-card": "fat", children: [_jsx(CardContent, { children: "one line" }), _jsx(CardContent, { children: "two line" }), _jsx(CardContent, { children: "three line" }), _jsx(CardContent, { children: "four line" })] })] }), _jsx(Card, { interactive: true, "data-card": "interactive", children: _jsx(CardHeader, { children: _jsx(CardTitle, { children: "Interactive card" }) }) }), _jsx(PageSection, { maxWidth: 600, "data-section": "demo", children: _jsx(CardTitle, { children: "Section" }) }), _jsx(CardTitle, { fontFamily: "$mono", "data-type": "mono", children: "1234567890" }), _jsx(Button, { "data-button": "block-child", children: _jsx("span", { "data-block-child": true, style: { display: 'block', height: 119, width: 119 } }) })] })] }
|
|
32
|
+
}, children: [_jsx(CommandInput, {}), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: "No results" }), _jsxs(CommandGroup, { heading: "Palette", children: [_jsx(CommandItem, { value: "alpha", children: "alpha" }), _jsx(CommandItem, { value: "beta", children: "beta" }), _jsx(CommandItem, { value: "gamma", children: "gamma" })] })] })] }), _jsx("span", { "data-palette-selected": "" })] }), _jsxs(Section, { name: "overlay", children: [_jsx(Dialog, { open: true, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Dialog title" }), _jsx(DialogDescription, { children: "Dialog description" })] }), _jsx(DialogFooter, { children: _jsx(Button, { size: "sm", children: "OK" }) })] }) }), _jsxs(DropdownMenu, { open: true, children: [_jsx(DropdownMenuTrigger, { children: "Menu" }), _jsxs(DropdownMenuContent, { children: [_jsx(DropdownMenuLabel, { children: "Label" }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { children: "Item" })] })] }), _jsxs(Popover, { open: true, children: [_jsx(PopoverTrigger, { children: "Popover" }), _jsx(PopoverContent, { children: "Popover content" })] }), _jsxs(Select, { open: true, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select" }) }), _jsx(SelectContent, { children: _jsx(SelectItem, { value: "x", index: 0, children: "Option" }) })] }), _jsx(TooltipProvider, { delay: 0, children: _jsxs(Tooltip, { open: true, children: [_jsx(TooltipTrigger, { children: "Tooltip" }), _jsx(TooltipContent, { children: "Tooltip content" })] }) }), _jsx(AlertDialog, { open: true, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Alert title" }), _jsx(AlertDialogDescription, { children: "Alert description" })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { variant: "destructive", children: "Delete" })] })] }) }), _jsxs(HoverCard, { open: true, children: [_jsx(HoverCardTrigger, { children: "Hover card" }), _jsx(HoverCardContent, { children: "Hover card content" })] }), _jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { children: "Context menu" }), _jsxs(ContextMenuContent, { children: [_jsx(ContextMenuLabel, { children: "Label" }), _jsx(ContextMenuSeparator, {}), _jsx(ContextMenuItem, { children: "Item" })] })] }), _jsx(Toaster, {})] }), _jsxs(Section, { name: "layout", children: [_jsx(Grid, { min: 240, gap: "$3", style: { width: '100%' }, "data-grid": "auto", children: [0, 1, 2, 3, 4, 5, 6].map((i) => (_jsxs(Card, { children: [_jsx(CardMedia, { ratio: 16 / 10, children: _jsx("img", { src: SWATCH, alt: "" }) }), _jsxs(CardHeader, { children: [_jsxs(CardTitle, { children: ["Card ", i] }), _jsx(CardDescription, { children: "Sized by its content, never by a pinned height." })] })] }, i))) }), _jsx(Grid, { min: 160, max: 4, gap: "$3", style: { width: '100%' }, "data-grid": "capped", children: [0, 1, 2, 3, 4, 5].map((i) => (_jsx(Card, { children: _jsxs(CardContent, { children: ["cap ", i] }) }, i))) }), _jsxs(Grid, { min: 900, gap: "$3", style: { width: '100%' }, "data-grid": "wide", children: [_jsx(Card, { children: _jsx(CardContent, { children: "wide" }) }), _jsx(Card, { children: _jsx(CardContent, { children: "wide" }) })] }), _jsx("div", { style: { width: '100%', overflow: 'hidden' }, children: _jsxs(Grid, { cols: 3, gap: "$3", style: { width: '100%' }, "data-grid": "fixed", children: [_jsx(Card, { children: _jsx(CardContent, { children: "short" }) }), _jsx(Card, { children: _jsx(CardContent, { children: _jsx("span", { style: { whiteSpace: 'nowrap' }, children: "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" }) }) }), _jsx(Card, { children: _jsx(CardContent, { children: "short" }) })] }) }), _jsxs("div", { "data-grid": "growth", style: { display: 'flex', alignItems: 'flex-start', gap: 12, width: '100%' }, children: [_jsx(Card, { "data-card": "lean", children: _jsx(CardContent, { children: "one line" }) }), _jsxs(Card, { "data-card": "fat", children: [_jsx(CardContent, { children: "one line" }), _jsx(CardContent, { children: "two line" }), _jsx(CardContent, { children: "three line" }), _jsx(CardContent, { children: "four line" })] })] }), _jsx(Card, { interactive: true, "data-card": "interactive", children: _jsx(CardHeader, { children: _jsx(CardTitle, { children: "Interactive card" }) }) }), _jsx(PageSection, { maxWidth: 600, "data-section": "demo", children: _jsx(CardTitle, { children: "Section" }) }), _jsx(CardTitle, { fontFamily: "$mono", "data-type": "mono", children: "1234567890" }), _jsx(Button, { "data-button": "block-child", children: _jsx("span", { "data-block-child": true, style: { display: 'block', height: 119, width: 119 } }) })] }), _jsx(Section, { name: "workbench", children: _jsx("div", { style: { display: 'flex', height: 220, width: 880 }, children: _jsx(Workbench, { left: { tabs: [{ id: 'files', title: 'Files', content: _jsx(CardTitle, { children: "left" }) }] }, right: {
|
|
33
|
+
tabs: [
|
|
34
|
+
{ id: 'chat', title: 'Side chat', content: _jsx(CardTitle, { children: "chat" }) },
|
|
35
|
+
{ id: 'browser', title: 'Browser', content: _jsx(CardTitle, { children: "browser" }) },
|
|
36
|
+
],
|
|
37
|
+
}, bottom: {
|
|
38
|
+
tabs: [
|
|
39
|
+
{ id: 'console', title: 'Console', closable: false, content: _jsx(CardTitle, { children: "console" }) },
|
|
40
|
+
],
|
|
41
|
+
}, children: _jsx(CardTitle, { children: "center" }) }) }) })] }));
|
|
32
42
|
export default Gallery;
|
|
33
43
|
//# sourceMappingURL=gallery.js.map
|
package/dist/gallery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;
|
|
1
|
+
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAwBZ,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,EACL,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAC5F,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAChF,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EACrF,gBAAgB,EAAE,oBAAoB,EA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AE,KAAK,EAAE,OAAO,EAAE,KAAC,SAAS,0BAAoB,EAAE;yBAC9F;qBACF,YAED,KAAC,SAAS,yBAAmB,GACnB,GACR,GACE,IAEN,CACP,CAAA;AAED,eAAe,OAAO,CAAA"}
|
package/dist/glass.cjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.screen = exports.accent = exports.selected = exports.row = exports.rows = exports.panel = exports.scrim = exports.glass = void 0;
|
|
3
|
+
exports.screen = exports.accent = exports.selected = exports.row = exports.rows = exports.panel = exports.scrim = exports.fold = exports.sheet = exports.glass = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* The chrome, as values — `@hanzo/ui/glass`.
|
|
6
6
|
*
|
|
7
7
|
* import { glass, panel, scrim } from '@hanzo/ui/glass'
|
|
8
8
|
* import '@hanzo/ui/glass.css' // or '@hanzo/ui/theme.css', which inlines it
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Ten recipes, because ten things were being spelled out by hand on every page
|
|
11
|
+
* and drifting apart every time: what a floating surface is made of, what a
|
|
12
|
+
* resting one is made of, how high a sheet of the workspace sits and what marks
|
|
13
|
+
* one that opens, what dims the page under a modal, how a set of rows is
|
|
14
|
+
* grouped, what one of those rows looks like, which item in a set is the
|
|
15
|
+
* current one, which control is the loud one, and what it means to fill the
|
|
15
16
|
* screen. Each is ONE value here and nowhere else.
|
|
16
17
|
*
|
|
17
18
|
* They are plain objects, spread onto any `@hanzo/gui` element:
|
|
@@ -67,6 +68,59 @@ const glass = (level = 2) => ({
|
|
|
67
68
|
borderColor: '$borderColor',
|
|
68
69
|
});
|
|
69
70
|
exports.glass = glass;
|
|
71
|
+
/**
|
|
72
|
+
* A sheet of paper, and how high off the workspace it sits.
|
|
73
|
+
*
|
|
74
|
+
* <YStack {...sheet(0)}> the workspace itself
|
|
75
|
+
* <YStack {...sheet(1)}> a tool you are using
|
|
76
|
+
* <YStack {...sheet(2)}> what it opened
|
|
77
|
+
*
|
|
78
|
+
* The rungs are `glass`'s rungs — `sheet(2)` and `glass(2)` stand at the same
|
|
79
|
+
* height, they are just cut from different material — so a screen mixing a
|
|
80
|
+
* transcript, a menu and a dialog still reads as ONE space. What differs is
|
|
81
|
+
* what the surface MEANS: glass is chrome floating over content, paper is the
|
|
82
|
+
* content's own structure, where the level says which thing you are working in.
|
|
83
|
+
*
|
|
84
|
+
* NO BORDER, deliberately, and this is the rule the recipe exists to enforce:
|
|
85
|
+
* if two surfaces need separating, RAISE one. A surface that is already a step
|
|
86
|
+
* above its neighbour and also wears a hairline is drawn twice, and a screen of
|
|
87
|
+
* those is the wireframe look — every pane in its own box, none of them saying
|
|
88
|
+
* which one you are in. Reach for `panel` when the thing genuinely is a card in
|
|
89
|
+
* the flow with a finished edge; reach for this when depth is the hierarchy.
|
|
90
|
+
*
|
|
91
|
+
* The fill is `--sheet-*` from @hanzo/design — an alpha wash, not an opaque
|
|
92
|
+
* step, so sheets STACK: one laid on another lands a shade lighter and the pile
|
|
93
|
+
* converges instead of blowing out. That is also why 0 is worth spelling: the
|
|
94
|
+
* ground is a value, not the absence of one, and a pane that means "workspace"
|
|
95
|
+
* should say so rather than inherit whatever is behind it.
|
|
96
|
+
*
|
|
97
|
+
* Rung 0 carries no `elevation-` class because nothing casts a shadow onto the
|
|
98
|
+
* thing it is lying on.
|
|
99
|
+
*/
|
|
100
|
+
const sheet = (level = 1) => ({
|
|
101
|
+
backgroundColor: SHEET_FILL[level],
|
|
102
|
+
...(level === 0 ? {} : { className: `elevation-${level}` }),
|
|
103
|
+
});
|
|
104
|
+
exports.sheet = sheet;
|
|
105
|
+
const SHEET_FILL = {
|
|
106
|
+
0: 'var(--sheet-0, #0a0a0a)',
|
|
107
|
+
1: 'var(--sheet-1, rgb(38 38 38 / .5))',
|
|
108
|
+
2: 'var(--sheet-2, rgb(38 38 38 / .75))',
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The fold — a corner turned back, and the ONE mark that says an item opens.
|
|
112
|
+
*
|
|
113
|
+
* <YStack {...sheet(1)} {...fold}>
|
|
114
|
+
*
|
|
115
|
+
* Spend it only where the thing expands. A fold on a surface that does nothing
|
|
116
|
+
* is the same lie as a chevron that does not turn: it is an affordance, and an
|
|
117
|
+
* affordance that leads nowhere costs more than no mark at all.
|
|
118
|
+
*
|
|
119
|
+
* A `background-image` on the sheet itself, so it needs no extra element and no
|
|
120
|
+
* pseudo-element from the call site, and it squares that one corner — a folded
|
|
121
|
+
* corner is not round. `--fold-face` flips with the theme underneath.
|
|
122
|
+
*/
|
|
123
|
+
exports.fold = { className: 'fold' };
|
|
70
124
|
/**
|
|
71
125
|
* The scrim under anything modal — the dim that makes a floating panel read as
|
|
72
126
|
* floating rather than as more page.
|
package/dist/glass.css
CHANGED
|
@@ -52,19 +52,66 @@
|
|
|
52
52
|
from inside it, and a menu with no background is a menu you read the page
|
|
53
53
|
through. !important beats the compiled atomic background class, which lands
|
|
54
54
|
in an inline <style> a bundler orders after this sheet, and it beats the call
|
|
55
|
-
sites that pin a fill by hand — those become no-ops instead of holes.
|
|
55
|
+
sites that pin a fill by hand — those become no-ops instead of holes.
|
|
56
|
+
|
|
57
|
+
EVERY floating slot the package emits is here. It was seven, and the three it
|
|
58
|
+
left out were not obscure: AlertDialog is a MODAL — the one surface that
|
|
59
|
+
cannot be anything but floating — and it was opaque beside a glass Dialog.
|
|
60
|
+
ContextMenu and HoverCard are anchored menus beside glass DropdownMenu and
|
|
61
|
+
glass Popover. That is precisely the drift this file exists to stop, still
|
|
62
|
+
present in the file that stops it, which is worth stating plainly: a rule
|
|
63
|
+
that attaches the material to the slot only holds if every slot is named.
|
|
64
|
+
The list is checked against what the components actually emit, so the next
|
|
65
|
+
floating slot somebody adds fails the test rather than the eye. */
|
|
56
66
|
@supports (backdrop-filter: blur(8px)) {
|
|
57
67
|
.glass,
|
|
58
68
|
[data-slot="glass"],
|
|
59
69
|
[data-slot="dialog-content"],
|
|
70
|
+
[data-slot="alert-dialog-content"],
|
|
60
71
|
[data-slot="popover-content"],
|
|
61
72
|
[data-slot="select-content"],
|
|
62
73
|
[data-slot="dropdown-menu-content"],
|
|
63
74
|
[data-slot="dropdown-menu-sub-content"],
|
|
75
|
+
[data-slot="context-menu-content"],
|
|
76
|
+
[data-slot="context-menu-sub-content"],
|
|
77
|
+
[data-slot="hover-card-content"],
|
|
64
78
|
[data-slot="tooltip-content"] {
|
|
65
79
|
background-color: color-mix(in oklab, var(--background) 72%, transparent) !important;
|
|
66
80
|
-webkit-backdrop-filter: blur(20px) saturate(1.8);
|
|
67
81
|
backdrop-filter: blur(20px) saturate(1.8);
|
|
82
|
+
/* ── The dispersion ──────────────────────────────────────────────────────
|
|
83
|
+
Glass splits light at the EDGE. That is the whole of the physics and the
|
|
84
|
+
whole of the rule: the body of a pane shows you what is behind it, and the
|
|
85
|
+
rim is where the angle is steep enough to spread the spectrum. So the fill
|
|
86
|
+
stays monochrome — the brand is monochrome and text has to sit on it — and
|
|
87
|
+
the colour lives in one pixel at the top lip.
|
|
88
|
+
|
|
89
|
+
LINEAR, ACROSS THE LIP — never conic around the box. The composer's note
|
|
90
|
+
below records what conic costs on a rectangle: the long edges take a wide
|
|
91
|
+
angular slice and the short sides almost none, so one side wears blue and
|
|
92
|
+
the opposite burnt orange, and the ring reads as off-centre. Swept along
|
|
93
|
+
one edge instead, the stops are evenly spaced at any aspect ratio, so a
|
|
94
|
+
1000px dialog and a 90px tooltip disperse alike.
|
|
95
|
+
|
|
96
|
+
Peak alpha .16, on a band two pixels tall, one pixel DOWN. Both numbers
|
|
97
|
+
were measured rather than chosen. The lit edge is an inset box-shadow, and
|
|
98
|
+
a box-shadow paints over the background — so the first version put the
|
|
99
|
+
spectrum in the same pixel the white lip occupies and the lip won: at ×6
|
|
100
|
+
the rim was a neutral hairline with no colour in it at all. Sitting the
|
|
101
|
+
band one pixel inside puts it where a real pane disperses anyway, just
|
|
102
|
+
behind the specular line, and it is legible there at half the alpha a
|
|
103
|
+
collision would have needed. Three pixels at .22 was tried too and reads
|
|
104
|
+
as a coloured stroke somebody drew, which is a different thing entirely.
|
|
105
|
+
|
|
106
|
+
That is also the difference between this and the full-wheel rainbow that
|
|
107
|
+
was tried and reverted: not a different palette, a different AREA. Colour
|
|
108
|
+
over a whole surface makes that surface the only coloured thing in the
|
|
109
|
+
product; colour along its rim reads as the material catching light, which
|
|
110
|
+
is the one thing chrome is allowed to say. */
|
|
111
|
+
background-image: var(--glass-prism) !important;
|
|
112
|
+
background-repeat: no-repeat !important;
|
|
113
|
+
background-size: 100% 2px !important;
|
|
114
|
+
background-position: 0 1px !important;
|
|
68
115
|
}
|
|
69
116
|
}
|
|
70
117
|
|
|
@@ -118,6 +165,24 @@
|
|
|
118
165
|
--glass-shadow-1: 0 1px 2px 0 rgb(0 0 0 / .40);
|
|
119
166
|
--glass-shadow-2: 0 10px 15px -3px rgb(0 0 0 / .55), 0 4px 6px -4px rgb(0 0 0 / .55);
|
|
120
167
|
--glass-shadow-3: 0 24px 60px -16px rgb(0 0 0 / .75);
|
|
168
|
+
|
|
169
|
+
/* The spectrum the lip disperses. Declared here for the same reason the drops
|
|
170
|
+
above are: a name this package owns cannot be outranked by a sheet that
|
|
171
|
+
happens to load later. Nothing else ships a --glass-prism.
|
|
172
|
+
|
|
173
|
+
Five stops, blue through violet, rose, amber, to a cool green — the order
|
|
174
|
+
light actually comes apart in, so it reads as refraction rather than as a
|
|
175
|
+
palette somebody chose. Alphas .13-.16: measured at ×6 against the white lip
|
|
176
|
+
that sits a pixel above, high enough to read there and low enough that at
|
|
177
|
+
1:1 it is a tinge. A theme that wants none of it sets this to `none` and the
|
|
178
|
+
rim goes back to being the lit edge alone. */
|
|
179
|
+
--glass-prism:
|
|
180
|
+
linear-gradient(90deg,
|
|
181
|
+
rgb(120 170 255 / .16) 0%,
|
|
182
|
+
rgb(178 142 255 / .15) 24%,
|
|
183
|
+
rgb(255 146 198 / .13) 48%,
|
|
184
|
+
rgb(255 190 124 / .15) 72%,
|
|
185
|
+
rgb(138 228 208 / .16) 100%);
|
|
121
186
|
}
|
|
122
187
|
|
|
123
188
|
.light, :root.t_light, .t_light {
|
|
@@ -137,6 +202,9 @@
|
|
|
137
202
|
[data-slot="select-content"],
|
|
138
203
|
[data-slot="dropdown-menu-content"],
|
|
139
204
|
[data-slot="dropdown-menu-sub-content"],
|
|
205
|
+
[data-slot="context-menu-content"],
|
|
206
|
+
[data-slot="context-menu-sub-content"],
|
|
207
|
+
[data-slot="hover-card-content"],
|
|
140
208
|
[data-slot="tooltip-content"] {
|
|
141
209
|
box-shadow:
|
|
142
210
|
var(--edge-highlight, inset 0 1px 0 0 rgb(255 255 255 / .10)),
|
|
@@ -144,12 +212,38 @@
|
|
|
144
212
|
}
|
|
145
213
|
|
|
146
214
|
.elevation-3,
|
|
147
|
-
[data-slot="dialog-content"]
|
|
215
|
+
[data-slot="dialog-content"],
|
|
216
|
+
[data-slot="alert-dialog-content"] {
|
|
148
217
|
box-shadow:
|
|
149
218
|
var(--edge-highlight, inset 0 1px 0 0 rgb(255 255 255 / .10)),
|
|
150
219
|
var(--glass-shadow-3) !important;
|
|
151
220
|
}
|
|
152
221
|
|
|
222
|
+
/* ── The fold — the one mark that means an item opens ────────────────────────
|
|
223
|
+
A corner turned back, painted onto the sheet itself. It is a class and not a
|
|
224
|
+
pair of style props because gui compiles those into atomic classes and a
|
|
225
|
+
background-image is not one of the properties it maps; and because a fold has
|
|
226
|
+
exactly one spelling, so the call site should not be able to invent a second
|
|
227
|
+
one. `--fold-face` is @hanzo/design's, with the dark value inline so a host
|
|
228
|
+
that took this sheet without the token layer still gets a corner rather than
|
|
229
|
+
a silently-dropped declaration.
|
|
230
|
+
|
|
231
|
+
The corner is SQUARED, not rounded: a folded corner is a straight crease, and
|
|
232
|
+
a rounded one under a triangle reads as a rendering fault. That is also why
|
|
233
|
+
this carries !important — the radius it has to beat is a compiled style prop.
|
|
234
|
+
|
|
235
|
+
Spend it only where the thing expands. A fold on a surface that opens nothing
|
|
236
|
+
is a chevron that never turns. */
|
|
237
|
+
.fold {
|
|
238
|
+
background-image: var(--fold-face,
|
|
239
|
+
linear-gradient(315deg,
|
|
240
|
+
rgb(255 255 255 / .08) 0, rgb(255 255 255 / .08) 11px,
|
|
241
|
+
rgb(255 255 255 / .16) 11px, rgb(255 255 255 / .16) 12px,
|
|
242
|
+
transparent 12px)) !important;
|
|
243
|
+
background-repeat: no-repeat !important;
|
|
244
|
+
border-bottom-right-radius: 0 !important;
|
|
245
|
+
}
|
|
246
|
+
|
|
153
247
|
/* ── The scrim ──────────────────────────────────────────────────────────────
|
|
154
248
|
The dim that makes a floating panel read as floating rather than as more
|
|
155
249
|
page. gui's overlay dims TWICE — a translucent ground under a further
|
|
@@ -169,7 +263,8 @@
|
|
|
169
263
|
palette: `rgba(0,0,0,.5)` under `opacity: .5` — a quarter black, exactly the
|
|
170
264
|
double dim these two lines exist to end. A rule written to beat a compiled
|
|
171
265
|
class has to be written with the weight to beat one. */
|
|
172
|
-
[data-slot="dialog-overlay"]
|
|
266
|
+
[data-slot="dialog-overlay"],
|
|
267
|
+
[data-slot="alert-dialog-overlay"] {
|
|
173
268
|
opacity: 1 !important;
|
|
174
269
|
background-color: var(--surface-scrim, rgb(0 0 0 / .8)) !important;
|
|
175
270
|
}
|
package/dist/glass.d.ts
CHANGED
|
@@ -42,6 +42,55 @@ export declare const glass: (level?: Lift) => {
|
|
|
42
42
|
readonly backgroundColor: "$background";
|
|
43
43
|
readonly borderColor: "$borderColor";
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* A sheet of paper, and how high off the workspace it sits.
|
|
47
|
+
*
|
|
48
|
+
* <YStack {...sheet(0)}> the workspace itself
|
|
49
|
+
* <YStack {...sheet(1)}> a tool you are using
|
|
50
|
+
* <YStack {...sheet(2)}> what it opened
|
|
51
|
+
*
|
|
52
|
+
* The rungs are `glass`'s rungs — `sheet(2)` and `glass(2)` stand at the same
|
|
53
|
+
* height, they are just cut from different material — so a screen mixing a
|
|
54
|
+
* transcript, a menu and a dialog still reads as ONE space. What differs is
|
|
55
|
+
* what the surface MEANS: glass is chrome floating over content, paper is the
|
|
56
|
+
* content's own structure, where the level says which thing you are working in.
|
|
57
|
+
*
|
|
58
|
+
* NO BORDER, deliberately, and this is the rule the recipe exists to enforce:
|
|
59
|
+
* if two surfaces need separating, RAISE one. A surface that is already a step
|
|
60
|
+
* above its neighbour and also wears a hairline is drawn twice, and a screen of
|
|
61
|
+
* those is the wireframe look — every pane in its own box, none of them saying
|
|
62
|
+
* which one you are in. Reach for `panel` when the thing genuinely is a card in
|
|
63
|
+
* the flow with a finished edge; reach for this when depth is the hierarchy.
|
|
64
|
+
*
|
|
65
|
+
* The fill is `--sheet-*` from @hanzo/design — an alpha wash, not an opaque
|
|
66
|
+
* step, so sheets STACK: one laid on another lands a shade lighter and the pile
|
|
67
|
+
* converges instead of blowing out. That is also why 0 is worth spelling: the
|
|
68
|
+
* ground is a value, not the absence of one, and a pane that means "workspace"
|
|
69
|
+
* should say so rather than inherit whatever is behind it.
|
|
70
|
+
*
|
|
71
|
+
* Rung 0 carries no `elevation-` class because nothing casts a shadow onto the
|
|
72
|
+
* thing it is lying on.
|
|
73
|
+
*/
|
|
74
|
+
export declare const sheet: (level?: 0 | 1 | 2) => {
|
|
75
|
+
readonly className?: "elevation-1" | "elevation-2" | undefined;
|
|
76
|
+
readonly backgroundColor: "var(--sheet-0, #0a0a0a)" | "var(--sheet-1, rgb(38 38 38 / .5))" | "var(--sheet-2, rgb(38 38 38 / .75))";
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The fold — a corner turned back, and the ONE mark that says an item opens.
|
|
80
|
+
*
|
|
81
|
+
* <YStack {...sheet(1)} {...fold}>
|
|
82
|
+
*
|
|
83
|
+
* Spend it only where the thing expands. A fold on a surface that does nothing
|
|
84
|
+
* is the same lie as a chevron that does not turn: it is an affordance, and an
|
|
85
|
+
* affordance that leads nowhere costs more than no mark at all.
|
|
86
|
+
*
|
|
87
|
+
* A `background-image` on the sheet itself, so it needs no extra element and no
|
|
88
|
+
* pseudo-element from the call site, and it squares that one corner — a folded
|
|
89
|
+
* corner is not round. `--fold-face` flips with the theme underneath.
|
|
90
|
+
*/
|
|
91
|
+
export declare const fold: {
|
|
92
|
+
readonly className: "fold";
|
|
93
|
+
};
|
|
45
94
|
/**
|
|
46
95
|
* The scrim under anything modal — the dim that makes a floating panel read as
|
|
47
96
|
* floating rather than as more page.
|
package/dist/glass.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glass.d.ts","sourceRoot":"","sources":["../src/glass.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glass.d.ts","sourceRoot":"","sources":["../src/glass.ts"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,KAAK,GAAI,QAAO,IAAQ;;;;CAKxB,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,KAAK,GAAI,QAAO,CAAC,GAAG,CAAC,GAAG,CAAK;;;CAI7B,CAAA;AAQb;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI;;CAAiC,CAAA;AAElD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;;CAAwE,CAAA;AAE1F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;;;;;;CAMR,CAAA;AAEV;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI;;;;;;;CAIP,CAAA;AAEV;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG;;;;;;;CAON,CAAA;AAEV;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,GAAI,IAAI,OAAO;;;;;;CAGkC,CAAA;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;IAIjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;;;;;;CAGK,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM;;;;CAIT,CAAA"}
|
package/dist/glass.js
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* import { glass, panel, scrim } from '@hanzo/ui/glass'
|
|
5
5
|
* import '@hanzo/ui/glass.css' // or '@hanzo/ui/theme.css', which inlines it
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Ten recipes, because ten things were being spelled out by hand on every page
|
|
8
|
+
* and drifting apart every time: what a floating surface is made of, what a
|
|
9
|
+
* resting one is made of, how high a sheet of the workspace sits and what marks
|
|
10
|
+
* one that opens, what dims the page under a modal, how a set of rows is
|
|
11
|
+
* grouped, what one of those rows looks like, which item in a set is the
|
|
12
|
+
* current one, which control is the loud one, and what it means to fill the
|
|
12
13
|
* screen. Each is ONE value here and nowhere else.
|
|
13
14
|
*
|
|
14
15
|
* They are plain objects, spread onto any `@hanzo/gui` element:
|
|
@@ -63,6 +64,58 @@ export const glass = (level = 2) => ({
|
|
|
63
64
|
backgroundColor: '$background',
|
|
64
65
|
borderColor: '$borderColor',
|
|
65
66
|
});
|
|
67
|
+
/**
|
|
68
|
+
* A sheet of paper, and how high off the workspace it sits.
|
|
69
|
+
*
|
|
70
|
+
* <YStack {...sheet(0)}> the workspace itself
|
|
71
|
+
* <YStack {...sheet(1)}> a tool you are using
|
|
72
|
+
* <YStack {...sheet(2)}> what it opened
|
|
73
|
+
*
|
|
74
|
+
* The rungs are `glass`'s rungs — `sheet(2)` and `glass(2)` stand at the same
|
|
75
|
+
* height, they are just cut from different material — so a screen mixing a
|
|
76
|
+
* transcript, a menu and a dialog still reads as ONE space. What differs is
|
|
77
|
+
* what the surface MEANS: glass is chrome floating over content, paper is the
|
|
78
|
+
* content's own structure, where the level says which thing you are working in.
|
|
79
|
+
*
|
|
80
|
+
* NO BORDER, deliberately, and this is the rule the recipe exists to enforce:
|
|
81
|
+
* if two surfaces need separating, RAISE one. A surface that is already a step
|
|
82
|
+
* above its neighbour and also wears a hairline is drawn twice, and a screen of
|
|
83
|
+
* those is the wireframe look — every pane in its own box, none of them saying
|
|
84
|
+
* which one you are in. Reach for `panel` when the thing genuinely is a card in
|
|
85
|
+
* the flow with a finished edge; reach for this when depth is the hierarchy.
|
|
86
|
+
*
|
|
87
|
+
* The fill is `--sheet-*` from @hanzo/design — an alpha wash, not an opaque
|
|
88
|
+
* step, so sheets STACK: one laid on another lands a shade lighter and the pile
|
|
89
|
+
* converges instead of blowing out. That is also why 0 is worth spelling: the
|
|
90
|
+
* ground is a value, not the absence of one, and a pane that means "workspace"
|
|
91
|
+
* should say so rather than inherit whatever is behind it.
|
|
92
|
+
*
|
|
93
|
+
* Rung 0 carries no `elevation-` class because nothing casts a shadow onto the
|
|
94
|
+
* thing it is lying on.
|
|
95
|
+
*/
|
|
96
|
+
export const sheet = (level = 1) => ({
|
|
97
|
+
backgroundColor: SHEET_FILL[level],
|
|
98
|
+
...(level === 0 ? {} : { className: `elevation-${level}` }),
|
|
99
|
+
});
|
|
100
|
+
const SHEET_FILL = {
|
|
101
|
+
0: 'var(--sheet-0, #0a0a0a)',
|
|
102
|
+
1: 'var(--sheet-1, rgb(38 38 38 / .5))',
|
|
103
|
+
2: 'var(--sheet-2, rgb(38 38 38 / .75))',
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The fold — a corner turned back, and the ONE mark that says an item opens.
|
|
107
|
+
*
|
|
108
|
+
* <YStack {...sheet(1)} {...fold}>
|
|
109
|
+
*
|
|
110
|
+
* Spend it only where the thing expands. A fold on a surface that does nothing
|
|
111
|
+
* is the same lie as a chevron that does not turn: it is an affordance, and an
|
|
112
|
+
* affordance that leads nowhere costs more than no mark at all.
|
|
113
|
+
*
|
|
114
|
+
* A `background-image` on the sheet itself, so it needs no extra element and no
|
|
115
|
+
* pseudo-element from the call site, and it squares that one corner — a folded
|
|
116
|
+
* corner is not round. `--fold-face` flips with the theme underneath.
|
|
117
|
+
*/
|
|
118
|
+
export const fold = { className: 'fold' };
|
|
66
119
|
/**
|
|
67
120
|
* The scrim under anything modal — the dim that makes a floating panel read as
|
|
68
121
|
* floating rather than as more page.
|
package/dist/glass.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glass.js","sourceRoot":"","sources":["../src/glass.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"glass.js","sourceRoot":"","sources":["../src/glass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAU1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAc,CAAC,EAAE,EAAE,CACvC,CAAC;IACC,SAAS,EAAE,mBAAmB,KAAK,EAAE;IACrC,eAAe,EAAE,aAAa;IAC9B,WAAW,EAAE,cAAc;CAC5B,CAAU,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAmB,CAAC,EAAE,EAAE,CAC5C,CAAC;IACC,eAAe,EAAE,UAAU,CAAC,KAAK,CAAC;IAClC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,KAAK,EAAW,EAAE,CAAC;CACrE,CAAU,CAAA;AAEb,MAAM,UAAU,GAAG;IAC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d,WAAW,EAAE,SAAS;IACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,KAAK,EAAE,UAAU;IACjB,UAAU,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;CACrD,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;CAChB,CAAA"}
|
package/dist/product/Palette.cjs
CHANGED
|
@@ -48,7 +48,7 @@ function Palette({ open, onOpenChange, ops, onRun, active, onActive, search: con
|
|
|
48
48
|
onSearch?.(s);
|
|
49
49
|
};
|
|
50
50
|
const groups = (0, react_1.useMemo)(() => (0, match_1.survivors)(ops, search, limit), [ops, search, limit]);
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)(gui_2.CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [(0, jsx_runtime_1.jsx)(gui_2.CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { minH: height, children: [(0, jsx_runtime_1.jsxs)(gui_2.CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor",
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(gui_2.CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [(0, jsx_runtime_1.jsx)(gui_2.CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { minH: height, children: [(0, jsx_runtime_1.jsxs)(gui_2.CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", pt: "$1", pb: "$4", children: [groups.length === 0 && ((0, jsx_runtime_1.jsx)(gui_2.CommandEmpty, { children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => ((0, jsx_runtime_1.jsx)(gui_2.CommandGroup, { heading: group, children: items.map((op) => ((0, jsx_runtime_1.jsxs)(gui_2.CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, (0, jsx_runtime_1.jsxs)(gui_1.XStack, { flex: 1, items: "center", gap: "$2", overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, shrink: 0, children: op.label }), op.hint ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, flex: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null] }), (0, jsx_runtime_1.jsx)(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { width: "50%", children: children }) : null] }), footer ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* The method, at the end of the row, for route commands only.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/product/Palette.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;AAWzD,OAAO,EAAmB,KAAK,EAAE,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,oEAAoE;IACpE,GAAG,EAAE,EAAE,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C,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,oEAAoE;IACpE,GAAG,EAAE,EAAE,EAAE,CAAA;IACT,0DAA0D;IAC1D,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qDAAqD;IACrD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EAAE,UAAU,EAClB,QAAQ,EACR,WAAgC,EAChC,KAA2B,EAC3B,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAY,EACZ,KAAyB,GAC1B,EAAE,YAAY,2CAuGd"}
|
package/dist/product/Palette.js
CHANGED
|
@@ -45,7 +45,7 @@ export function Palette({ open, onOpenChange, ops, onRun, active, onActive, sear
|
|
|
45
45
|
onSearch?.(s);
|
|
46
46
|
};
|
|
47
47
|
const groups = useMemo(() => survivors(ops, search, limit), [ops, search, limit]);
|
|
48
|
-
return (_jsxs(CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [_jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), _jsxs(XStack, { minH: height, children: [_jsxs(CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor",
|
|
48
|
+
return (_jsxs(CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [_jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), _jsxs(XStack, { minH: height, children: [_jsxs(CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", pt: "$1", pb: "$4", children: [groups.length === 0 && (_jsx(CommandEmpty, { children: _jsx(SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => (_jsx(CommandGroup, { heading: group, children: items.map((op) => (_jsxs(CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, _jsxs(XStack, { flex: 1, items: "center", gap: "$2", overflow: "hidden", children: [_jsx(SizableText, { numberOfLines: 1, shrink: 0, children: op.label }), op.hint ? (_jsx(SizableText, { numberOfLines: 1, flex: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null] }), _jsx(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? _jsx(YStack, { width: "50%", children: children }) : null] }), footer ? (_jsx(XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* The method, at the end of the row, for route commands only.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.js","sourceRoot":"","sources":["../../src/product/Palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAC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