@kitionstage/tessera 0.0.0-stage → 0.1.1-stage.2
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/LICENSE +202 -0
- package/NOTICE +13 -0
- package/README.md +80 -2
- package/dist/icons/LICENSE-lucide +43 -0
- package/dist/icons/NOTICE +10 -0
- package/dist/icons/chunks/chunk-LVAFND6X.js +1201 -0
- package/dist/icons/chunks/chunk-LVAFND6X.js.map +1 -0
- package/dist/icons/chunks/chunk-QMLJ7L4H.js +61 -0
- package/dist/icons/chunks/chunk-QMLJ7L4H.js.map +1 -0
- package/dist/icons/icons.json +2583 -0
- package/dist/icons/index.js +1217 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/keywords.json +7781 -0
- package/dist/icons/kit/board-small.svg +1 -0
- package/dist/icons/kit/board.svg +1 -0
- package/dist/icons/kit/cad-small.svg +1 -0
- package/dist/icons/kit/cad.svg +1 -0
- package/dist/icons/kit/colors.json +99 -0
- package/dist/icons/kit/design-small.svg +1 -0
- package/dist/icons/kit/design.svg +1 -0
- package/dist/icons/kit/doc-small.svg +1 -0
- package/dist/icons/kit/doc.svg +1 -0
- package/dist/icons/kit/film-small.svg +1 -0
- package/dist/icons/kit/film.svg +1 -0
- package/dist/icons/kit/html-small.svg +1 -0
- package/dist/icons/kit/html.svg +1 -0
- package/dist/icons/kit/layout-small.svg +1 -0
- package/dist/icons/kit/layout.svg +1 -0
- package/dist/icons/kit/motion-small.svg +1 -0
- package/dist/icons/kit/motion.svg +1 -0
- package/dist/icons/kit/note-small.svg +1 -0
- package/dist/icons/kit/note.svg +1 -0
- package/dist/icons/kit/pdf-small.svg +1 -0
- package/dist/icons/kit/pdf.svg +1 -0
- package/dist/icons/kit/photo-small.svg +1 -0
- package/dist/icons/kit/photo.svg +1 -0
- package/dist/icons/kit/scene-small.svg +1 -0
- package/dist/icons/kit/scene.svg +1 -0
- package/dist/icons/kit/sheet-small.svg +1 -0
- package/dist/icons/kit/sheet.svg +1 -0
- package/dist/icons/kit/slide-small.svg +1 -0
- package/dist/icons/kit/slide.svg +1 -0
- package/dist/icons/kit/table-small.svg +1 -0
- package/dist/icons/kit/table.svg +1 -0
- package/dist/icons/kit/vector-small.svg +1 -0
- package/dist/icons/kit/vector.svg +1 -0
- package/dist/icons/react.js +1851 -0
- package/dist/icons/react.js.map +1 -0
- package/dist/icons/registry.js +1799 -0
- package/dist/icons/registry.js.map +1 -0
- package/dist/icons/types/src/createIcon.d.ts +25 -0
- package/dist/icons/types/src/generated/icons.d.ts +599 -0
- package/dist/icons/types/src/generated/react.d.ts +2392 -0
- package/dist/icons/types/src/generated/registry.d.ts +17 -0
- package/dist/icons/types/src/index.d.ts +15 -0
- package/dist/icons/types/src/react.d.ts +6 -0
- package/dist/icons/types/src/registry.d.ts +3 -0
- package/dist/icons/types/src/types.d.ts +42 -0
- package/dist/tokens/index.js +95 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/tokens/base.tokens.json +212 -0
- package/dist/tokens/tokens/skins/graphite.tokens.json +44 -0
- package/dist/tokens/tokens/skins/paper.tokens.json +4 -0
- package/dist/tokens/tokens.css +54 -0
- package/dist/tokens/types/src/generated/tokens.d.ts +23 -0
- package/dist/tokens/types/src/index.d.ts +10 -0
- package/dist/ui/BarControls.js +19 -0
- package/dist/ui/BarControls.js.map +1 -0
- package/dist/ui/ColorPicker.js +19 -0
- package/dist/ui/ColorPicker.js.map +1 -0
- package/dist/ui/ColorWheel.js +16 -0
- package/dist/ui/ColorWheel.js.map +1 -0
- package/dist/ui/Combobox.js +15 -0
- package/dist/ui/Combobox.js.map +1 -0
- package/dist/ui/CurveEditor.js +24 -0
- package/dist/ui/CurveEditor.js.map +1 -0
- package/dist/ui/DockArea.js +14 -0
- package/dist/ui/DockArea.js.map +1 -0
- package/dist/ui/DropPanel.js +8 -0
- package/dist/ui/DropPanel.js.map +1 -0
- package/dist/ui/FloatingPanels.js +19 -0
- package/dist/ui/FloatingPanels.js.map +1 -0
- package/dist/ui/GradientSlider.js +17 -0
- package/dist/ui/GradientSlider.js.map +1 -0
- package/dist/ui/Histogram.js +12 -0
- package/dist/ui/Histogram.js.map +1 -0
- package/dist/ui/KeyframeLane.js +10 -0
- package/dist/ui/KeyframeLane.js.map +1 -0
- package/dist/ui/LevelMeter.js +15 -0
- package/dist/ui/LevelMeter.js.map +1 -0
- package/dist/ui/NumberField.js +8 -0
- package/dist/ui/NumberField.js.map +1 -0
- package/dist/ui/PanelParts.js +19 -0
- package/dist/ui/PanelParts.js.map +1 -0
- package/dist/ui/PreviewDialog.js +11 -0
- package/dist/ui/PreviewDialog.js.map +1 -0
- package/dist/ui/Scrollbar.js +8 -0
- package/dist/ui/Scrollbar.js.map +1 -0
- package/dist/ui/TimecodeField.js +12 -0
- package/dist/ui/TimecodeField.js.map +1 -0
- package/dist/ui/TransportBar.js +11 -0
- package/dist/ui/TransportBar.js.map +1 -0
- package/dist/ui/WorkspaceLayout.js +12 -0
- package/dist/ui/WorkspaceLayout.js.map +1 -0
- package/dist/ui/brand.js +16 -0
- package/dist/ui/brand.js.map +1 -0
- package/dist/ui/charts.js +17 -0
- package/dist/ui/charts.js.map +1 -0
- package/dist/ui/chunks/chunk-54KOYG5C.js +10 -0
- package/dist/ui/chunks/chunk-54KOYG5C.js.map +1 -0
- package/dist/ui/chunks/chunk-54WYBJQN.js +161 -0
- package/dist/ui/chunks/chunk-54WYBJQN.js.map +1 -0
- package/dist/ui/chunks/chunk-5JFU2EYD.js +717 -0
- package/dist/ui/chunks/chunk-5JFU2EYD.js.map +1 -0
- package/dist/ui/chunks/chunk-5ZN4EPWL.js +132 -0
- package/dist/ui/chunks/chunk-5ZN4EPWL.js.map +1 -0
- package/dist/ui/chunks/chunk-7JH3X3E4.js +487 -0
- package/dist/ui/chunks/chunk-7JH3X3E4.js.map +1 -0
- package/dist/ui/chunks/chunk-AMQZWUVA.js +106 -0
- package/dist/ui/chunks/chunk-AMQZWUVA.js.map +1 -0
- package/dist/ui/chunks/chunk-AOPZODRD.js +246 -0
- package/dist/ui/chunks/chunk-AOPZODRD.js.map +1 -0
- package/dist/ui/chunks/chunk-CFTBUQLP.js +166 -0
- package/dist/ui/chunks/chunk-CFTBUQLP.js.map +1 -0
- package/dist/ui/chunks/chunk-CYPNQPSE.js +151 -0
- package/dist/ui/chunks/chunk-CYPNQPSE.js.map +1 -0
- package/dist/ui/chunks/chunk-EHE5NJAE.js +106 -0
- package/dist/ui/chunks/chunk-EHE5NJAE.js.map +1 -0
- package/dist/ui/chunks/chunk-ETJWSPQ2.js +111 -0
- package/dist/ui/chunks/chunk-ETJWSPQ2.js.map +1 -0
- package/dist/ui/chunks/chunk-F6MXY6EP.js +404 -0
- package/dist/ui/chunks/chunk-F6MXY6EP.js.map +1 -0
- package/dist/ui/chunks/chunk-FJF6DGMN.js +97 -0
- package/dist/ui/chunks/chunk-FJF6DGMN.js.map +1 -0
- package/dist/ui/chunks/chunk-GWPQ6JEE.js +267 -0
- package/dist/ui/chunks/chunk-GWPQ6JEE.js.map +1 -0
- package/dist/ui/chunks/chunk-GWQSR6X5.js +288 -0
- package/dist/ui/chunks/chunk-GWQSR6X5.js.map +1 -0
- package/dist/ui/chunks/chunk-K2B2V7CX.js +267 -0
- package/dist/ui/chunks/chunk-K2B2V7CX.js.map +1 -0
- package/dist/ui/chunks/chunk-K3WQOMH5.js +42 -0
- package/dist/ui/chunks/chunk-K3WQOMH5.js.map +1 -0
- package/dist/ui/chunks/chunk-LV6JOICO.js +336 -0
- package/dist/ui/chunks/chunk-LV6JOICO.js.map +1 -0
- package/dist/ui/chunks/chunk-NEF7LDDM.js +80 -0
- package/dist/ui/chunks/chunk-NEF7LDDM.js.map +1 -0
- package/dist/ui/chunks/chunk-O2FX5IYG.js +269 -0
- package/dist/ui/chunks/chunk-O2FX5IYG.js.map +1 -0
- package/dist/ui/chunks/chunk-O6Q5SOEB.js +84 -0
- package/dist/ui/chunks/chunk-O6Q5SOEB.js.map +1 -0
- package/dist/ui/chunks/chunk-PCYUIHWJ.js +274 -0
- package/dist/ui/chunks/chunk-PCYUIHWJ.js.map +1 -0
- package/dist/ui/chunks/chunk-Q7J46B63.js +180 -0
- package/dist/ui/chunks/chunk-Q7J46B63.js.map +1 -0
- package/dist/ui/chunks/chunk-SHZHQHSG.js +137 -0
- package/dist/ui/chunks/chunk-SHZHQHSG.js.map +1 -0
- package/dist/ui/chunks/chunk-TCVEMIMN.js +103 -0
- package/dist/ui/chunks/chunk-TCVEMIMN.js.map +1 -0
- package/dist/ui/chunks/chunk-TFH2FFLI.js +284 -0
- package/dist/ui/chunks/chunk-TFH2FFLI.js.map +1 -0
- package/dist/ui/chunks/chunk-TNE5AD5G.js +38 -0
- package/dist/ui/chunks/chunk-TNE5AD5G.js.map +1 -0
- package/dist/ui/chunks/chunk-V4OLOV2O.js +45 -0
- package/dist/ui/chunks/chunk-V4OLOV2O.js.map +1 -0
- package/dist/ui/chunks/chunk-W5WPL3NT.js +228 -0
- package/dist/ui/chunks/chunk-W5WPL3NT.js.map +1 -0
- package/dist/ui/chunks/chunk-WMXIY2VO.js +171 -0
- package/dist/ui/chunks/chunk-WMXIY2VO.js.map +1 -0
- package/dist/ui/chunks/chunk-XR6B35CE.js +307 -0
- package/dist/ui/chunks/chunk-XR6B35CE.js.map +1 -0
- package/dist/ui/chunks/chunk-XTS6BBNZ.js +219 -0
- package/dist/ui/chunks/chunk-XTS6BBNZ.js.map +1 -0
- package/dist/ui/chunks/chunk-Y2SFO73P.js +198 -0
- package/dist/ui/chunks/chunk-Y2SFO73P.js.map +1 -0
- package/dist/ui/chunks/chunk-ZYBJE6AH.js +93 -0
- package/dist/ui/chunks/chunk-ZYBJE6AH.js.map +1 -0
- package/dist/ui/colorGesture.js +19 -0
- package/dist/ui/colorGesture.js.map +1 -0
- package/dist/ui/context.js +24 -0
- package/dist/ui/context.js.map +1 -0
- package/dist/ui/data.js +37 -0
- package/dist/ui/data.js.map +1 -0
- package/dist/ui/formModel.js +29 -0
- package/dist/ui/formModel.js.map +1 -0
- package/dist/ui/forms.js +29 -0
- package/dist/ui/forms.js.map +1 -0
- package/dist/ui/hooks.js +14 -0
- package/dist/ui/hooks.js.map +1 -0
- package/dist/ui/icon.js +1 -0
- package/dist/ui/icon.js.map +1 -0
- package/dist/ui/index.js +454 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/kitStore.js +18 -0
- package/dist/ui/kitStore.js.map +1 -0
- package/dist/ui/locales/en-US.json +63 -0
- package/dist/ui/locales/zh-CN.json +63 -0
- package/dist/ui/navigation.js +15 -0
- package/dist/ui/navigation.js.map +1 -0
- package/dist/ui/overlays.js +74 -0
- package/dist/ui/overlays.js.map +1 -0
- package/dist/ui/styles.css +4050 -0
- package/dist/ui/types/src/BarControls.d.ts +57 -0
- package/dist/ui/types/src/ColorPicker.d.ts +24 -0
- package/dist/ui/types/src/ColorWheel.d.ts +34 -0
- package/dist/ui/types/src/Combobox.d.ts +50 -0
- package/dist/ui/types/src/CurveEditor.d.ts +47 -0
- package/dist/ui/types/src/DockArea.d.ts +95 -0
- package/dist/ui/types/src/DropPanel.d.ts +20 -0
- package/dist/ui/types/src/FloatingPanels.d.ts +97 -0
- package/dist/ui/types/src/GradientSlider.d.ts +31 -0
- package/dist/ui/types/src/Histogram.d.ts +28 -0
- package/dist/ui/types/src/KeyframeLane.d.ts +25 -0
- package/dist/ui/types/src/LevelMeter.d.ts +65 -0
- package/dist/ui/types/src/NumberField.d.ts +36 -0
- package/dist/ui/types/src/PanelParts.d.ts +65 -0
- package/dist/ui/types/src/PreviewDialog.d.ts +81 -0
- package/dist/ui/types/src/Scrollbar.d.ts +15 -0
- package/dist/ui/types/src/TimecodeField.d.ts +35 -0
- package/dist/ui/types/src/TransportBar.d.ts +32 -0
- package/dist/ui/types/src/WorkspaceLayout.d.ts +64 -0
- package/dist/ui/types/src/brand.d.ts +18 -0
- package/dist/ui/types/src/charts.d.ts +58 -0
- package/dist/ui/types/src/colorGesture.d.ts +60 -0
- package/dist/ui/types/src/context.d.ts +57 -0
- package/dist/ui/types/src/data.d.ts +181 -0
- package/dist/ui/types/src/formModel.d.ts +155 -0
- package/dist/ui/types/src/forms.d.ts +98 -0
- package/dist/ui/types/src/hooks.d.ts +21 -0
- package/dist/ui/types/src/icon.d.ts +2 -0
- package/dist/ui/types/src/index.d.ts +47 -0
- package/dist/ui/types/src/kitStore.d.ts +31 -0
- package/dist/ui/types/src/navigation.d.ts +85 -0
- package/dist/ui/types/src/overlays.d.ts +113 -0
- package/dist/ui/types/src/ui.d.ts +329 -0
- package/dist/ui/types/src/useWorkspaces.d.ts +53 -0
- package/dist/ui/types/src/workspaceTree.d.ts +89 -0
- package/dist/ui/ui.js +76 -0
- package/dist/ui/ui.js.map +1 -0
- package/dist/ui/useWorkspaces.js +14 -0
- package/dist/ui/useWorkspaces.js.map +1 -0
- package/dist/ui/workspaceTree.js +30 -0
- package/dist/ui/workspaceTree.js.map +1 -0
- package/package.json +92 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/**
|
|
3
|
+
* Overlays for hosts and kit editors: modal dialogs, popovers, a switch, a side sheet, a confirm
|
|
4
|
+
* dialog, and a command list. Modal, popover, and switch draw Radix's accessible primitives
|
|
5
|
+
* (focus trap, Escape, outside press, positioning) in Tessera's style; the command list draws cmdk.
|
|
6
|
+
* Styled only through the theme tokens (styles.css, "Overlays").
|
|
7
|
+
*/
|
|
8
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
9
|
+
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
10
|
+
import { Dialog as DialogPrimitive, Popover as PopoverPrimitive, Switch as SwitchPrimitive, Tooltip as TooltipPrimitive } from 'radix-ui';
|
|
11
|
+
export type ModalProps = ComponentProps<typeof DialogPrimitive.Root>;
|
|
12
|
+
/** A modal dialog. Controlled with `open` and `onOpenChange`; Escape and an outside press close it. */
|
|
13
|
+
export declare function Modal(props: ModalProps): import("react").JSX.Element;
|
|
14
|
+
export declare const ModalTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export declare const ModalClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'none';
|
|
17
|
+
export type ModalContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
|
|
18
|
+
/** Its widest: `xs` 320px to `4xl` 896px; `none` leaves the width to `className`. */
|
|
19
|
+
size?: ModalSize;
|
|
20
|
+
/** No close button in the corner (the footer has its own way out). */
|
|
21
|
+
hideClose?: boolean;
|
|
22
|
+
/** When false, an outside press does not close it (Escape still does). */
|
|
23
|
+
dismissible?: boolean;
|
|
24
|
+
/** Keeps focus where it was instead of moving it into the dialog when it opens. */
|
|
25
|
+
disableAutoFocus?: boolean;
|
|
26
|
+
/** A long dialog: the header and footer stay put with hairlines, and `ModalBody` scrolls between them. */
|
|
27
|
+
fixed?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** The dialog's panel, over a dimmed page: 12px radius, a hairline, the modal shadow. */
|
|
30
|
+
export declare function ModalContent({ size, hideClose, dismissible, disableAutoFocus, fixed, className, children, onOpenAutoFocus, onPointerDownOutside, ...props }: ModalContentProps): import("react").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* The close button in a modal's corner. ModalContent draws one; with `hideClose`, place your own,
|
|
33
|
+
* for one you can disable (`disabled` while an import runs).
|
|
34
|
+
*/
|
|
35
|
+
export declare function ModalCloseButton({ className, ...props }: ComponentProps<typeof DialogPrimitive.Close>): import("react").JSX.Element;
|
|
36
|
+
/** The content between a modal's header and footer; it scrolls in a `fixed` modal. */
|
|
37
|
+
export declare function ModalBody({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
38
|
+
/** The title and description at the top of a modal. */
|
|
39
|
+
export declare function ModalHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
40
|
+
/** The actions at the bottom of a modal, right-aligned; full width on a narrow window. */
|
|
41
|
+
export declare function ModalFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
42
|
+
export declare function ModalTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react").JSX.Element;
|
|
43
|
+
export declare function ModalDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react").JSX.Element;
|
|
44
|
+
/** Floating content anchored to a trigger: filters, pickers, small forms. */
|
|
45
|
+
export declare function Popover(props: ComponentProps<typeof PopoverPrimitive.Root>): import("react").JSX.Element;
|
|
46
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
47
|
+
export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
48
|
+
export declare const PopoverClose: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
/** The popover's panel: 12px radius, a hairline, the floating shadow; 288px wide unless `className` says otherwise. */
|
|
50
|
+
export declare function PopoverContent({ align, sideOffset, className, ...props }: ComponentProps<typeof PopoverPrimitive.Content>): import("react").JSX.Element;
|
|
51
|
+
/** Shares one hover delay among the tooltips inside it (`delayDuration`, 200 ms by default), so moving between them skips the wait. */
|
|
52
|
+
export declare function TooltipProvider({ delayDuration, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>): import("react").JSX.Element;
|
|
53
|
+
/** A short label shown on hover or keyboard focus. Works on its own; a TooltipProvider above it shares one delay among several. */
|
|
54
|
+
export declare function Tooltip(props: ComponentProps<typeof TooltipPrimitive.Root>): import("react").JSX.Element;
|
|
55
|
+
export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
56
|
+
/** The tooltip's bubble: dark, small, above the page. */
|
|
57
|
+
export declare function TooltipContent({ className, sideOffset, ...props }: ComponentProps<typeof TooltipPrimitive.Content>): import("react").JSX.Element;
|
|
58
|
+
/** A small count or status beside a label (records in a view, a beta mark). */
|
|
59
|
+
export declare function Badge({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
60
|
+
export type SwitchProps = ComponentProps<typeof SwitchPrimitive.Root>;
|
|
61
|
+
/** An on/off switch for a setting that applies at once. Controlled with `checked` and `onCheckedChange`. */
|
|
62
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
63
|
+
export type SheetProps = {
|
|
64
|
+
open: boolean;
|
|
65
|
+
onClose: () => void;
|
|
66
|
+
title: ReactNode;
|
|
67
|
+
children: ReactNode;
|
|
68
|
+
/** Actions at the bottom, right-aligned. */
|
|
69
|
+
footer?: ReactNode;
|
|
70
|
+
/** With unsaved changes, closing (Escape, the backdrop, the close button) calls `onRequestClose` instead. */
|
|
71
|
+
dirty?: boolean;
|
|
72
|
+
onRequestClose?: () => void;
|
|
73
|
+
/** Its width in pixels. */
|
|
74
|
+
width?: number;
|
|
75
|
+
/** Its accessible name, when `title` is not plain text (a logo and a name). */
|
|
76
|
+
label?: string;
|
|
77
|
+
/** The edge it slides in from: `right` (default, editing beside the work) or `left` (an app's navigation on a phone). */
|
|
78
|
+
side?: 'left' | 'right';
|
|
79
|
+
/** Test id of the sheet; its parts take `${testId}-backdrop`, `-header`, `-close`, `-footer`. */
|
|
80
|
+
testId?: string;
|
|
81
|
+
};
|
|
82
|
+
/** A panel that slides in from the right over a dimmed page, for editing one thing beside the work. */
|
|
83
|
+
export declare function Sheet({ open, onClose, title, label, children, footer, dirty, onRequestClose, width, side, testId }: SheetProps): import("react").JSX.Element | null;
|
|
84
|
+
export type ConfirmOptions = {
|
|
85
|
+
title?: string;
|
|
86
|
+
message: string;
|
|
87
|
+
confirmLabel?: string;
|
|
88
|
+
cancelLabel?: string;
|
|
89
|
+
/** `danger` draws the confirm button as destructive and puts focus on Cancel. */
|
|
90
|
+
variant?: 'default' | 'danger';
|
|
91
|
+
/** `data-testid` of the dialog, for tests that target one confirm. */
|
|
92
|
+
testId?: string;
|
|
93
|
+
};
|
|
94
|
+
/** Asks, and resolves true when the person confirms; false on Cancel, Escape, or an outside press. */
|
|
95
|
+
export type ConfirmFn = (options: ConfirmOptions | string) => Promise<boolean>;
|
|
96
|
+
/** Lets `useConfirm` ask from anywhere inside it; asks queue and show one at a time. */
|
|
97
|
+
export declare function ConfirmProvider({ children }: {
|
|
98
|
+
children?: ReactNode;
|
|
99
|
+
}): import("react").JSX.Element;
|
|
100
|
+
/** The `confirm` function of the nearest `ConfirmProvider`. */
|
|
101
|
+
export declare function useConfirm(): ConfirmFn;
|
|
102
|
+
/** A searchable list of commands or choices (cmdk): type to filter, arrows and Enter to pick. */
|
|
103
|
+
export declare function Command({ className, ...props }: ComponentProps<typeof CommandPrimitive>): import("react").JSX.Element;
|
|
104
|
+
export declare function CommandInput({ className, wrapClassName, ...props }: ComponentProps<typeof CommandPrimitive.Input> & {
|
|
105
|
+
wrapClassName?: string;
|
|
106
|
+
}): import("react").JSX.Element;
|
|
107
|
+
export declare function CommandList({ className, ...props }: ComponentProps<typeof CommandPrimitive.List>): import("react").JSX.Element;
|
|
108
|
+
export declare function CommandEmpty({ className, ...props }: ComponentProps<typeof CommandPrimitive.Empty>): import("react").JSX.Element;
|
|
109
|
+
export declare function CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>): import("react").JSX.Element;
|
|
110
|
+
export declare function CommandSeparator({ className, ...props }: ComponentProps<typeof CommandPrimitive.Separator>): import("react").JSX.Element;
|
|
111
|
+
export declare function CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>): import("react").JSX.Element;
|
|
112
|
+
/** A shortcut at the end of a command item. */
|
|
113
|
+
export declare function CommandShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/**
|
|
3
|
+
* Shared kit editor components: buttons and fields, the ribbon, menus, panels, the status bar,
|
|
4
|
+
* dialogs, and notices. Styled only through the Kit UI protocol's theme tokens (styles.css).
|
|
5
|
+
*/
|
|
6
|
+
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent, type ReactNode, type RefObject } from 'react';
|
|
7
|
+
import type { IconComponent } from './icon.js';
|
|
8
|
+
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
9
|
+
/** The stroke width of every Lucide icon Kit UI draws, at every size (ribbon, menus, rail, panels). */
|
|
10
|
+
/** The stroke every control draws its icons with (Tessera's icon style, docs/icon-style.md). */
|
|
11
|
+
export declare const ICON_STROKE = 1.5;
|
|
12
|
+
/** Control heights: `sm` 32px (toolbars, dense rows), `md` 36px (panels, settings, dialogs), `lg` 40px (forms and calls to action). */
|
|
13
|
+
export type ControlSize = 'sm' | 'md' | 'lg';
|
|
14
|
+
/**
|
|
15
|
+
* How much a button stands out: `primary` is the one main action (the theme's primary color);
|
|
16
|
+
* `secondary` is outlined; `subtle` is a quiet filled button; `ghost` has no border or fill until
|
|
17
|
+
* hovered; `danger` destroys; `danger-outline` destroys too, outlined in the danger color, for a
|
|
18
|
+
* destructive action repeated down a list (Disable on every row). Without a variant a button is
|
|
19
|
+
* outlined, like `secondary`.
|
|
20
|
+
*/
|
|
21
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'subtle' | 'ghost' | 'danger' | 'danger-outline';
|
|
22
|
+
export type TesseraButtonProps = ButtonProps & {
|
|
23
|
+
variant?: ButtonVariant;
|
|
24
|
+
/** Without `size` a button keeps the editor chrome's 30px. */
|
|
25
|
+
size?: ControlSize;
|
|
26
|
+
/** A square button holding only an icon; give it an `aria-label`. */
|
|
27
|
+
iconOnly?: boolean;
|
|
28
|
+
/** Shows a spinner before the label and marks the button busy, while its action runs. */
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** A button. Its `className` adds to Tessera's, so a host can adjust one button's layout. */
|
|
32
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & {
|
|
33
|
+
variant?: ButtonVariant;
|
|
34
|
+
/** Without `size` a button keeps the editor chrome's 30px. */
|
|
35
|
+
size?: ControlSize;
|
|
36
|
+
/** A square button holding only an icon; give it an `aria-label`. */
|
|
37
|
+
iconOnly?: boolean;
|
|
38
|
+
/** Shows a spinner before the label and marks the button busy, while its action runs. */
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
export type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
42
|
+
variant?: ButtonVariant;
|
|
43
|
+
size?: ControlSize;
|
|
44
|
+
/** Draws the link another way: a router passes its own (`(props) => <Link to="/" {...props} />`). */
|
|
45
|
+
render?: (props: AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
46
|
+
className: string;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
}) => ReactNode;
|
|
49
|
+
};
|
|
50
|
+
/** A link that looks like a button: for navigation (another page, a sign-in URL, a mail link) drawn as an action. */
|
|
51
|
+
export declare function ButtonLink({ variant, size, render, className, children, ...props }: ButtonLinkProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
52
|
+
/** A spinning circle for work in progress; `label` names it for screen readers (otherwise it is decorative). */
|
|
53
|
+
export declare function Spinner({ size, label, className }: {
|
|
54
|
+
size?: number;
|
|
55
|
+
label?: string;
|
|
56
|
+
className?: string;
|
|
57
|
+
}): import("react").JSX.Element;
|
|
58
|
+
export declare function IconButton({ icon: Icon, label, pressed, className, ...props }: ButtonProps & {
|
|
59
|
+
icon: IconComponent;
|
|
60
|
+
label: string;
|
|
61
|
+
pressed?: boolean;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
63
|
+
type RibbonOverflow = 'none' | 'start' | 'end' | 'both';
|
|
64
|
+
/** Which edges of a scrolled box have more beyond them (1 px of slack for fractional widths). */
|
|
65
|
+
export declare function overflowOf(scrollLeft: number, clientWidth: number, scrollWidth: number): RibbonOverflow;
|
|
66
|
+
/**
|
|
67
|
+
* A row that scrolls sideways when its content does not fit (the ribbon's groups, a tool's options
|
|
68
|
+
* bar): the cut edge fades, and a button there scrolls by most of a width. `className` and
|
|
69
|
+
* `panelClassName` add to the outer box and the scrolled row; `resetKey` (the shown tab, the active
|
|
70
|
+
* tool) re-measures; the buttons' test ids are `${testId}-start` and `${testId}-end`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function OverflowStrip({ className, panelClassName, role, resetKey, labels, testId, panelRef, children, }: {
|
|
73
|
+
className: string;
|
|
74
|
+
panelClassName: string;
|
|
75
|
+
role?: string;
|
|
76
|
+
resetKey?: unknown;
|
|
77
|
+
labels: {
|
|
78
|
+
start: string;
|
|
79
|
+
end: string;
|
|
80
|
+
};
|
|
81
|
+
testId: string;
|
|
82
|
+
/** The scrolled row, for a caller that measures it (the frame's step-down). */
|
|
83
|
+
panelRef?: RefObject<HTMLDivElement | null>;
|
|
84
|
+
children: ReactNode;
|
|
85
|
+
}): import("react").JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* How ribbon content draws, set by the editor frame: `full` is the Classic ribbon and any panel
|
|
88
|
+
* that shows a group whole; `line` is Single line's row, where each group shows its primary items
|
|
89
|
+
* and a chevron to the rest; `primary` is inside such a group, where only items marked `primary`
|
|
90
|
+
* draw (large ones small).
|
|
91
|
+
*/
|
|
92
|
+
export type RibbonPresentation = 'full' | 'line' | 'primary';
|
|
93
|
+
export declare const RibbonPresentationContext: import("react").Context<RibbonPresentation>;
|
|
94
|
+
/** The name of a Single line group's chevron, translated by the frame (`More: Font`). */
|
|
95
|
+
export declare const LineMoreLabelContext: import("react").Context<(group: string) => string>;
|
|
96
|
+
/**
|
|
97
|
+
* How a Classic ribbon that does not fit its width gives way, set by the editor frame, in steps as
|
|
98
|
+
* Office's ribbon does: `size` `small` draws large buttons small, `icon` draws buttons with an icon
|
|
99
|
+
* as the icon alone (the label stays their name and tooltip); `icons` names the groups (their
|
|
100
|
+
* `id`, else their `label`) drawn with icons alone while the others keep `size`, and `collapsed`
|
|
101
|
+
* the groups drawn as one button that opens the group whole in a panel. A panel that shows a group
|
|
102
|
+
* whole draws it at full size again.
|
|
103
|
+
*/
|
|
104
|
+
export type RibbonFit = {
|
|
105
|
+
size: 'full' | 'small' | 'icon';
|
|
106
|
+
icons: ReadonlySet<string>;
|
|
107
|
+
collapsed: ReadonlySet<string>;
|
|
108
|
+
};
|
|
109
|
+
export declare const FULL_RIBBON_FIT: RibbonFit;
|
|
110
|
+
export declare const RibbonFitContext: import("react").Context<RibbonFit>;
|
|
111
|
+
/** The key a ribbon group answers to in `RibbonFit.collapsed` and in its `data-ribbon-group` mark: its `id`, else its `label`. */
|
|
112
|
+
export declare function ribbonGroupKey(group: {
|
|
113
|
+
id?: string;
|
|
114
|
+
label: string;
|
|
115
|
+
}): string;
|
|
116
|
+
/**
|
|
117
|
+
* A ribbon group. With an `id` (`group:<tab>/<group>`, or an engine menu path `menu:<Menu>/<Group>`
|
|
118
|
+
* for groups built from commands) it follows the UI configuration and ends with the host's
|
|
119
|
+
* buttons for it. In Single line it shows its primary items and a popover with the rest; `icon`
|
|
120
|
+
* marks the one button a group without primary items becomes there, and the button a Classic
|
|
121
|
+
* group collapses to when the ribbon has no room for it (`RibbonFit`).
|
|
122
|
+
*/
|
|
123
|
+
export declare function RibbonGroup({ id, label, icon, children }: {
|
|
124
|
+
id?: string;
|
|
125
|
+
label: string;
|
|
126
|
+
icon?: IconComponent;
|
|
127
|
+
children: ReactNode;
|
|
128
|
+
}): import("react").JSX.Element | null;
|
|
129
|
+
/** Small buttons stacked in up to three rows; in a Single line group, its primary buttons in the row. */
|
|
130
|
+
export declare function RibbonStack({ children }: {
|
|
131
|
+
children: ReactNode;
|
|
132
|
+
}): import("react").JSX.Element;
|
|
133
|
+
export declare function RibbonRow({ children }: {
|
|
134
|
+
children: ReactNode;
|
|
135
|
+
}): import("react").JSX.Element;
|
|
136
|
+
/**
|
|
137
|
+
* Any content in a ribbon group that is not a ribbon button (a field, a gallery): `primary` shows
|
|
138
|
+
* it in Single line's row too; otherwise it waits in the group's popover there.
|
|
139
|
+
*/
|
|
140
|
+
export declare function RibbonItem({ primary, children }: {
|
|
141
|
+
primary?: boolean;
|
|
142
|
+
children: ReactNode;
|
|
143
|
+
}): import("react").JSX.Element | null;
|
|
144
|
+
export type RibbonButtonProps = ButtonProps & {
|
|
145
|
+
icon?: IconComponent;
|
|
146
|
+
label: string;
|
|
147
|
+
size?: 'large' | 'small' | 'icon';
|
|
148
|
+
pressed?: boolean;
|
|
149
|
+
/** A colored mark under the icon (font color, fill). */
|
|
150
|
+
swatch?: string;
|
|
151
|
+
/** Shown in Single line's row (small); the group's other items wait in its popover. */
|
|
152
|
+
primary?: boolean;
|
|
153
|
+
/** In Single line's row, keep the label beside the icon; a primary item with an icon otherwise shows the icon alone there (its label stays its name and tooltip). */
|
|
154
|
+
lineLabel?: boolean;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* The size an item draws at: as given, except in Single line's row, where an item with an icon is
|
|
158
|
+
* the icon alone (unless `lineLabel`) and a large one is small, and in a Classic ribbon giving way
|
|
159
|
+
* (`fit`), where a large one is small, then an item with an icon is the icon alone.
|
|
160
|
+
*/
|
|
161
|
+
export declare function lineSize(presentation: RibbonPresentation, size: 'large' | 'small' | 'icon', hasIcon: boolean, lineLabel?: boolean, fit?: RibbonFit['size']): 'large' | 'small' | 'icon';
|
|
162
|
+
export declare function RibbonButton({ icon: Icon, label, size, pressed, swatch, primary, lineLabel, ...props }: RibbonButtonProps): import("react").JSX.Element | null;
|
|
163
|
+
/**
|
|
164
|
+
* A menu's keys, on the menu element (its rows' keys bubble to it): Up and Down move through its
|
|
165
|
+
* own rows (wrapping), Home and End to the first and last, Escape closes it (`close`). A key it
|
|
166
|
+
* takes goes no further: not to a menu around it, not to the editor's shortcuts.
|
|
167
|
+
*/
|
|
168
|
+
export declare function menuKeyDown(event: ReactKeyboardEvent<HTMLElement>, close?: () => void): void;
|
|
169
|
+
/**
|
|
170
|
+
* A button that opens a menu below it; the menu takes the focus, and gives it back to the button
|
|
171
|
+
* when it closes. With `placement` `auto` (a button along a panel's bottom), the menu opens above
|
|
172
|
+
* the button when it does not fit below and there is more room above.
|
|
173
|
+
*/
|
|
174
|
+
export declare function MenuButton({ trigger, children, align, placement }: {
|
|
175
|
+
trigger: (props: {
|
|
176
|
+
open: boolean;
|
|
177
|
+
toggle: () => void;
|
|
178
|
+
}) => ReactNode;
|
|
179
|
+
children: ReactNode;
|
|
180
|
+
align?: 'start' | 'end';
|
|
181
|
+
placement?: 'below' | 'auto';
|
|
182
|
+
}): import("react").JSX.Element;
|
|
183
|
+
/**
|
|
184
|
+
* A menu row. With `checked` set (true or false) it is a toggle: a check mark shows in the icon's
|
|
185
|
+
* place while it is on (the state wins over the icon), and assistive technology hears it as a
|
|
186
|
+
* checkbox item.
|
|
187
|
+
*/
|
|
188
|
+
export declare function MenuItem({ icon: Icon, label, shortcut, onSelect, disabled, checked, testId, uiId }: {
|
|
189
|
+
icon?: IconComponent;
|
|
190
|
+
label: string;
|
|
191
|
+
shortcut?: string | null;
|
|
192
|
+
onSelect: () => void;
|
|
193
|
+
disabled?: boolean;
|
|
194
|
+
checked?: boolean;
|
|
195
|
+
testId?: string;
|
|
196
|
+
uiId?: string;
|
|
197
|
+
}): import("react").JSX.Element;
|
|
198
|
+
export declare function MenuSeparator(): import("react").JSX.Element;
|
|
199
|
+
/** Where a context menu opens: a point in the viewport (a pointer event's `clientX`/`clientY`). */
|
|
200
|
+
export type ContextMenuPoint = {
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* A menu at a point (a row's right-click menu): open while `at` is set, kept inside the window,
|
|
206
|
+
* its first row focused (Up, Down, Home, and End move through the rows; the focus goes back where
|
|
207
|
+
* it was when it closes), and closed through
|
|
208
|
+
* `onClose` by a press outside it, Escape, or a choice in it (a `MenuItem`, any button). Its rows
|
|
209
|
+
* are `MenuItem`s and `MenuSeparator`s, as in `MenuButton`.
|
|
210
|
+
*/
|
|
211
|
+
export declare function ContextMenu({ at, onClose, label, children, testId }: {
|
|
212
|
+
at: ContextMenuPoint | null;
|
|
213
|
+
onClose: () => void;
|
|
214
|
+
label?: string;
|
|
215
|
+
children: ReactNode;
|
|
216
|
+
testId?: string;
|
|
217
|
+
}): import("react").JSX.Element | null;
|
|
218
|
+
export declare function Panel({ side, width, title, children, testId }: {
|
|
219
|
+
side: 'left' | 'right';
|
|
220
|
+
width: number;
|
|
221
|
+
title?: string;
|
|
222
|
+
children: ReactNode;
|
|
223
|
+
testId?: string;
|
|
224
|
+
}): import("react").JSX.Element;
|
|
225
|
+
export declare function StatusBar({ children, onClick }: {
|
|
226
|
+
children: ReactNode;
|
|
227
|
+
onClick?: (event: ReactMouseEvent<HTMLElement>) => void;
|
|
228
|
+
}): import("react").JSX.Element;
|
|
229
|
+
export declare function StatusSpacer(): import("react").JSX.Element;
|
|
230
|
+
/** Zoom out, a slider from `min` to `max`, zoom in, the value, and fit. */
|
|
231
|
+
export declare function ZoomControl({ zoom, onZoom, onFit, min, max, labels }: {
|
|
232
|
+
zoom: number;
|
|
233
|
+
onZoom: (zoom: number) => void;
|
|
234
|
+
onFit: () => void;
|
|
235
|
+
min?: number;
|
|
236
|
+
max?: number;
|
|
237
|
+
labels: {
|
|
238
|
+
out: string;
|
|
239
|
+
in: string;
|
|
240
|
+
fit: string;
|
|
241
|
+
};
|
|
242
|
+
}): import("react").JSX.Element;
|
|
243
|
+
export declare function Dialog({ title, children, actions, onClose, onEscape, modal, uiId, testId, position, onMove, }: {
|
|
244
|
+
title: string;
|
|
245
|
+
children: ReactNode;
|
|
246
|
+
actions: ReactNode;
|
|
247
|
+
onClose: () => void;
|
|
248
|
+
/** Called for Escape in place of `onClose` (a dialog that lets a field keep its own Escape). */
|
|
249
|
+
onEscape?: (event: KeyboardEvent) => void;
|
|
250
|
+
/**
|
|
251
|
+
* Blocks the page behind a backdrop (the default), where a press outside closes it. With
|
|
252
|
+
* `false` the page stays usable: no backdrop, and the editor keeps its keys.
|
|
253
|
+
*/
|
|
254
|
+
modal?: boolean;
|
|
255
|
+
uiId?: string;
|
|
256
|
+
testId?: string;
|
|
257
|
+
/** Where the dialog's top left sits in the window (with `onMove`); null or absent: where the layout puts it. */
|
|
258
|
+
position?: {
|
|
259
|
+
x: number;
|
|
260
|
+
y: number;
|
|
261
|
+
} | null;
|
|
262
|
+
/**
|
|
263
|
+
* Makes the dialog movable by its title: a drag moves it, and its place is reported once, on
|
|
264
|
+
* release (keep it, and give it back as `position`). Absent, the title does not move it.
|
|
265
|
+
*/
|
|
266
|
+
onMove?: (position: {
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
}) => void;
|
|
270
|
+
}): import("react").JSX.Element;
|
|
271
|
+
/** A notice's kind; `loading` shows a spinner and stays until it is replaced or dismissed. */
|
|
272
|
+
export type ToastLevel = 'info' | 'success' | 'warning' | 'error' | 'loading';
|
|
273
|
+
export type ToastId = string | number;
|
|
274
|
+
export type ToastOptions = {
|
|
275
|
+
/** Replaces the notice with this id instead of stacking another (a loading notice turning into its result). */
|
|
276
|
+
id?: ToastId;
|
|
277
|
+
description?: string;
|
|
278
|
+
/** How long it shows, in ms; `Infinity` keeps it until dismissed. By default 4 s, 6 s for errors, until replaced for loading. */
|
|
279
|
+
duration?: number;
|
|
280
|
+
/** A button in the notice (Undo, Retry); pressing it closes the notice. */
|
|
281
|
+
action?: {
|
|
282
|
+
label: string;
|
|
283
|
+
onClick: () => void;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
/** Closes the notice `id`, or every notice without an id. */
|
|
287
|
+
declare function dismiss(id?: ToastId): void;
|
|
288
|
+
/**
|
|
289
|
+
* Shows a notice at the top of the window: `toast(level, title, description?)`, or
|
|
290
|
+
* `toast.success(title, options)` and its siblings. `toast.loading` stays until replaced (pass its
|
|
291
|
+
* id to the result), `toast.promise` does that for a promise, and `toast.dismiss` closes notices.
|
|
292
|
+
*/
|
|
293
|
+
export declare const toast: ((level: ToastLevel, title: string, description?: string) => ToastId) & {
|
|
294
|
+
info: (title: string, options?: ToastOptions) => ToastId;
|
|
295
|
+
success: (title: string, options?: ToastOptions) => ToastId;
|
|
296
|
+
warning: (title: string, options?: ToastOptions) => ToastId;
|
|
297
|
+
error: (title: string, options?: ToastOptions) => ToastId;
|
|
298
|
+
loading: (title: string, options?: ToastOptions) => ToastId;
|
|
299
|
+
dismiss: typeof dismiss;
|
|
300
|
+
/** A loading notice while `promise` runs, replaced by its success or error notice. */
|
|
301
|
+
promise<T>(promise: Promise<T>, messages: {
|
|
302
|
+
loading: string;
|
|
303
|
+
success: string | ((value: T) => string);
|
|
304
|
+
error: string | ((error: unknown) => string);
|
|
305
|
+
}, options?: ToastOptions): Promise<T>;
|
|
306
|
+
};
|
|
307
|
+
/** Where notices appear: centred at the top, `offset` px down (below a host's tab strip). */
|
|
308
|
+
export declare function Toaster({ offset, closeButton }: {
|
|
309
|
+
offset?: number;
|
|
310
|
+
closeButton?: boolean;
|
|
311
|
+
}): import("react").JSX.Element;
|
|
312
|
+
/** The standard colors under a color menu (Office's row). */
|
|
313
|
+
export declare const STANDARD_COLORS: string[];
|
|
314
|
+
/** A grid of tints and shades of `base` colors, as color menus show them. */
|
|
315
|
+
export declare const PALETTE_COLORS: string[];
|
|
316
|
+
/** A grid of color swatches; `onPick` gets `#RRGGBB`. */
|
|
317
|
+
export declare function ColorGrid({ colors, onPick, testId }: {
|
|
318
|
+
colors?: readonly string[];
|
|
319
|
+
onPick: (color: string) => void;
|
|
320
|
+
testId?: string;
|
|
321
|
+
}): import("react").JSX.Element;
|
|
322
|
+
/** Choosing a table's size by pointing at a grid of cells (Insert > Table). */
|
|
323
|
+
export declare function TableSizePicker({ rows, columns, onPick, label }: {
|
|
324
|
+
rows?: number;
|
|
325
|
+
columns?: number;
|
|
326
|
+
onPick: (rows: number, columns: number) => void;
|
|
327
|
+
label: (rows: number, columns: number) => string;
|
|
328
|
+
}): import("react").JSX.Element;
|
|
329
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type WorkspaceNode } from './workspaceTree.js';
|
|
2
|
+
/** A named layout, kept as raw JSON so one unreadable entry (a panel a newer version added) doesn't lose the others. */
|
|
3
|
+
export type SavedWorkspace = {
|
|
4
|
+
name: string;
|
|
5
|
+
layout: unknown;
|
|
6
|
+
};
|
|
7
|
+
/** The person's own workspaces and saved changes to the built-in ones, and the workspace in use (reopened next time). */
|
|
8
|
+
export type WorkspacePrefs = {
|
|
9
|
+
saved: SavedWorkspace[];
|
|
10
|
+
current: string;
|
|
11
|
+
};
|
|
12
|
+
/** Command keys under `window.workspace.` that are not workspace names, so no workspace may take them. */
|
|
13
|
+
export declare const WORKSPACE_ACTIONS: readonly ["reset", "saveChanges", "saveAs", "edit", "rename", "delete"];
|
|
14
|
+
/** A workspace's command-id key: `Captions and Graphics` → `captionsandgraphics`. */
|
|
15
|
+
export declare function workspaceSlug(name: string): string;
|
|
16
|
+
export type WorkspacesOptions = {
|
|
17
|
+
/** Kept per mode: the store name is `workspaces` for `edit`, `workspaces.<mode>` otherwise. */
|
|
18
|
+
mode: string;
|
|
19
|
+
/** The built-in layouts by name. Keep the object stable across renders. */
|
|
20
|
+
builtins: Readonly<Record<string, WorkspaceNode>>;
|
|
21
|
+
/** The built-in opened first, and after deleting the current user workspace. */
|
|
22
|
+
fallback: string;
|
|
23
|
+
/** The panel ids a stored layout may name (`validateTree`). Keep the set stable across renders. */
|
|
24
|
+
known: ReadonlySet<string>;
|
|
25
|
+
};
|
|
26
|
+
export type Workspaces = {
|
|
27
|
+
/** Every workspace, built-in and the person's own, sorted case-insensitively. */
|
|
28
|
+
names: string[];
|
|
29
|
+
/** The names with a saved layout: user workspaces, and built-ins with saved changes (Edit Workspaces offers Restore Original for those). */
|
|
30
|
+
saved: string[];
|
|
31
|
+
/** This page's workspace. */
|
|
32
|
+
current: string;
|
|
33
|
+
/** This page's live layout. */
|
|
34
|
+
tree: WorkspaceNode;
|
|
35
|
+
/** Changes the live layout, in memory only. */
|
|
36
|
+
setTree: (tree: WorkspaceNode) => void;
|
|
37
|
+
/** Opens the workspace called `name` (any case, spaces optional) with its saved layout; an unknown name does nothing. */
|
|
38
|
+
switchTo: (name: string) => void;
|
|
39
|
+
/** The workspace called `query` (any case, spaces optional), as listed. */
|
|
40
|
+
find: (query: string) => string | undefined;
|
|
41
|
+
/** Reset to Saved Layout: reloads the current workspace's saved layout. */
|
|
42
|
+
reset: () => void;
|
|
43
|
+
/** Save Changes to this Workspace; answers why the store could not keep it, or null. */
|
|
44
|
+
saveChanges: () => string | null;
|
|
45
|
+
/** Save as New Workspace: saves the live layout under a new name and switches to it; answers why not, or null. */
|
|
46
|
+
saveAs: (name: string) => string | null;
|
|
47
|
+
/** Renames a user workspace; answers why not, or null. */
|
|
48
|
+
rename: (from: string, to: string) => string | null;
|
|
49
|
+
/** Deletes a user workspace, or drops a built-in's saved changes (restoring its original); answers why not, or null. */
|
|
50
|
+
remove: (name: string) => string | null;
|
|
51
|
+
isBuiltin: (name: string) => boolean;
|
|
52
|
+
};
|
|
53
|
+
export declare function useWorkspaces(kit: string, options: WorkspacesOptions): Workspaces;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A workspace's frame tree, as pure functions: splits of two children and groups of tabs, the
|
|
3
|
+
* Premiere-style layout a kit's `WorkspaceLayout` draws. This ports a docking editor's tree
|
|
4
|
+
* (Film's upstream `dock.rs` `DockNode`), with panels named by string ids. Every function returns
|
|
5
|
+
* a new tree, or the same tree when nothing changes, and never mutates its input.
|
|
6
|
+
*/
|
|
7
|
+
/** How a split shares its space: a ratio for the first child, or a fixed size in px for one child. */
|
|
8
|
+
export type WorkspaceSize = {
|
|
9
|
+
ratio: number;
|
|
10
|
+
} | {
|
|
11
|
+
fixedA: number;
|
|
12
|
+
} | {
|
|
13
|
+
fixedB: number;
|
|
14
|
+
};
|
|
15
|
+
/** A split (`row` lays its children side by side, `column` stacks them) or a group of tabs. */
|
|
16
|
+
export type WorkspaceNode = {
|
|
17
|
+
split: 'row' | 'column';
|
|
18
|
+
size: WorkspaceSize;
|
|
19
|
+
a: WorkspaceNode;
|
|
20
|
+
b: WorkspaceNode;
|
|
21
|
+
} | {
|
|
22
|
+
tabs: readonly string[];
|
|
23
|
+
active: number;
|
|
24
|
+
};
|
|
25
|
+
/** A split node of a workspace tree. */
|
|
26
|
+
export type WorkspaceSplit = Extract<WorkspaceNode, {
|
|
27
|
+
split: unknown;
|
|
28
|
+
}>;
|
|
29
|
+
/** A tab group of a workspace tree. */
|
|
30
|
+
export type WorkspaceTabs = Extract<WorkspaceNode, {
|
|
31
|
+
tabs: unknown;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Size of a split's first child in `available` px: upstream `split_first`. It is the requested
|
|
35
|
+
* size, keeping each child at least 20 px when there is room, and it is never NaN and never more
|
|
36
|
+
* than `available`. No space (zero, negative, or NaN) gives 0.
|
|
37
|
+
*/
|
|
38
|
+
export declare function splitFirst(size: WorkspaceSize, available: number): number;
|
|
39
|
+
/** Every panel in the tree, in order (first child before second, tabs left to right). */
|
|
40
|
+
export declare function panelsOf(node: WorkspaceNode): string[];
|
|
41
|
+
/** Whether a group in the tree holds `panel`. */
|
|
42
|
+
export declare function contains(node: WorkspaceNode, panel: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Makes `panel` the active tab of the first group holding it (upstream `activate` stops there);
|
|
45
|
+
* the same tree when it is absent or already that group's active tab. A later group listing the
|
|
46
|
+
* same panel is left alone.
|
|
47
|
+
*/
|
|
48
|
+
export declare function activate(node: WorkspaceNode, panel: string): WorkspaceNode;
|
|
49
|
+
/** Whether `panel` is the active tab of its group, so its contents are shown (upstream `is_visible`). */
|
|
50
|
+
export declare function isVisible(node: WorkspaceNode, panel: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Removes a tab; an empty group collapses its split into the other child (upstream `close`). As
|
|
53
|
+
* upstream, the active index is only clamped to the remaining tabs.
|
|
54
|
+
*/
|
|
55
|
+
export declare function closePanel(node: WorkspaceNode, panel: string): WorkspaceNode;
|
|
56
|
+
/**
|
|
57
|
+
* Adds `panel` as the active tab of the group holding `near`, or activates it when present
|
|
58
|
+
* (upstream `open_near`). `near` may list candidates tried in order, as upstream falls back to
|
|
59
|
+
* Project and then Program; when no candidate is present the tree is unchanged.
|
|
60
|
+
*/
|
|
61
|
+
export declare function openNear(node: WorkspaceNode, panel: string, near: string | readonly string[]): WorkspaceNode;
|
|
62
|
+
/**
|
|
63
|
+
* Puts `panel` back beside a single-tab group holding `beside`, split in a row with `beside`
|
|
64
|
+
* fixed at `besideWidth` (upstream `restore_timeline`), else near `fallbackNear` as `openNear`
|
|
65
|
+
* does. The same tree when `panel` is present.
|
|
66
|
+
*/
|
|
67
|
+
export declare function restoreBeside(node: WorkspaceNode, panel: string, beside: string, besideWidth: number, fallbackNear: string | readonly string[]): WorkspaceNode;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the split at `path` (a string of 'a'/'b' steps from the root, '' for the root) to `size`.
|
|
70
|
+
* The same tree when the path does not end at a split.
|
|
71
|
+
*/
|
|
72
|
+
export declare function resizeAt(node: WorkspaceNode, path: string, size: WorkspaceSize): WorkspaceNode;
|
|
73
|
+
/**
|
|
74
|
+
* A stored tree, or undefined when it is not one; unknown panels are dropped and emptied groups
|
|
75
|
+
* collapse. A panel listed twice keeps its first place. A group keeps its active panel when that
|
|
76
|
+
* panel is known; otherwise its active index is clamped. A tree left with no panel is undefined.
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateTree(raw: unknown, known: ReadonlySet<string>): WorkspaceNode | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* The tab a group shows when only some panels are `shown` (a host hid the others, or the kit does
|
|
81
|
+
* not draw them): its active tab when shown, else its first shown tab; undefined when it shows none.
|
|
82
|
+
*/
|
|
83
|
+
export declare function shownActive(group: WorkspaceTabs, shown: (panel: string) => boolean): string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The panels the frames show, in drawn order (first child before second): each group's
|
|
86
|
+
* `shownActive` tab (upstream `visible_panels`, for Select Next and Previous Panel; a kit leaves
|
|
87
|
+
* compact panels out of `shown` to match upstream).
|
|
88
|
+
*/
|
|
89
|
+
export declare function visiblePanels(node: WorkspaceNode, shown: (panel: string) => boolean): string[];
|
package/dist/ui/ui.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
ButtonLink,
|
|
4
|
+
ColorGrid,
|
|
5
|
+
ContextMenu,
|
|
6
|
+
Dialog,
|
|
7
|
+
FULL_RIBBON_FIT,
|
|
8
|
+
ICON_STROKE,
|
|
9
|
+
IconButton,
|
|
10
|
+
LineMoreLabelContext,
|
|
11
|
+
MenuButton,
|
|
12
|
+
MenuItem,
|
|
13
|
+
MenuSeparator,
|
|
14
|
+
OverflowStrip,
|
|
15
|
+
PALETTE_COLORS,
|
|
16
|
+
Panel,
|
|
17
|
+
RibbonButton,
|
|
18
|
+
RibbonFitContext,
|
|
19
|
+
RibbonGroup,
|
|
20
|
+
RibbonItem,
|
|
21
|
+
RibbonPresentationContext,
|
|
22
|
+
RibbonRow,
|
|
23
|
+
RibbonStack,
|
|
24
|
+
STANDARD_COLORS,
|
|
25
|
+
Spinner,
|
|
26
|
+
StatusBar,
|
|
27
|
+
StatusSpacer,
|
|
28
|
+
TableSizePicker,
|
|
29
|
+
Toaster,
|
|
30
|
+
ZoomControl,
|
|
31
|
+
lineSize,
|
|
32
|
+
menuKeyDown,
|
|
33
|
+
overflowOf,
|
|
34
|
+
ribbonGroupKey,
|
|
35
|
+
toast
|
|
36
|
+
} from "./chunks/chunk-5JFU2EYD.js";
|
|
37
|
+
import "./chunks/chunk-Q7J46B63.js";
|
|
38
|
+
import "./chunks/chunk-O6Q5SOEB.js";
|
|
39
|
+
import "./chunks/chunk-54KOYG5C.js";
|
|
40
|
+
export {
|
|
41
|
+
Button,
|
|
42
|
+
ButtonLink,
|
|
43
|
+
ColorGrid,
|
|
44
|
+
ContextMenu,
|
|
45
|
+
Dialog,
|
|
46
|
+
FULL_RIBBON_FIT,
|
|
47
|
+
ICON_STROKE,
|
|
48
|
+
IconButton,
|
|
49
|
+
LineMoreLabelContext,
|
|
50
|
+
MenuButton,
|
|
51
|
+
MenuItem,
|
|
52
|
+
MenuSeparator,
|
|
53
|
+
OverflowStrip,
|
|
54
|
+
PALETTE_COLORS,
|
|
55
|
+
Panel,
|
|
56
|
+
RibbonButton,
|
|
57
|
+
RibbonFitContext,
|
|
58
|
+
RibbonGroup,
|
|
59
|
+
RibbonItem,
|
|
60
|
+
RibbonPresentationContext,
|
|
61
|
+
RibbonRow,
|
|
62
|
+
RibbonStack,
|
|
63
|
+
STANDARD_COLORS,
|
|
64
|
+
Spinner,
|
|
65
|
+
StatusBar,
|
|
66
|
+
StatusSpacer,
|
|
67
|
+
TableSizePicker,
|
|
68
|
+
Toaster,
|
|
69
|
+
ZoomControl,
|
|
70
|
+
lineSize,
|
|
71
|
+
menuKeyDown,
|
|
72
|
+
overflowOf,
|
|
73
|
+
ribbonGroupKey,
|
|
74
|
+
toast
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|