@reallygoodwork/design-ui-react 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +14 -2
- package/dist/assets/icons/AlignItemsBaseline.d.ts +4 -0
- package/dist/assets/icons/AlignItemsCenter.d.ts +4 -0
- package/dist/assets/icons/AlignItemsFlexEnd.d.ts +4 -0
- package/dist/assets/icons/AlignItemsFlexStart.d.ts +4 -0
- package/dist/assets/icons/AlignItemsStretch.d.ts +4 -0
- package/dist/assets/icons/FlexDirectionColumn.d.ts +4 -0
- package/dist/assets/icons/FlexDirectionColumnReverse.d.ts +4 -0
- package/dist/assets/icons/FlexDirectionRow.d.ts +4 -0
- package/dist/assets/icons/FlexDirectionRowReverse.d.ts +4 -0
- package/dist/assets/icons/FlexWrapNoWrap.d.ts +4 -0
- package/dist/assets/icons/FlexWrapWrap.d.ts +4 -0
- package/dist/assets/icons/JustifyContentCenter.d.ts +4 -0
- package/dist/assets/icons/JustifyContentFlexEnd.d.ts +4 -0
- package/dist/assets/icons/JustifyContentFlexStart.d.ts +4 -0
- package/dist/assets/icons/JustifyContentSpaceAround.d.ts +4 -0
- package/dist/assets/icons/JustifyContentSpaceBetween.d.ts +4 -0
- package/dist/assets/icons/JustifyContentSpaceEvenly.d.ts +4 -0
- package/dist/assets/icons/index.d.ts +17 -0
- package/dist/components/AddLayerDialog.d.ts +2 -0
- package/dist/components/BreakpointFrame.d.ts +12 -0
- package/dist/components/BreakpointHeader.d.ts +10 -0
- package/dist/components/BreakpointPropertiesPanel.d.ts +5 -0
- package/dist/components/BreakpointSwitcher.d.ts +8 -0
- package/dist/components/CSSPanel.d.ts +2 -0
- package/dist/components/DesignAction.d.ts +16 -0
- package/dist/components/DesignActionPanel.d.ts +1 -0
- package/dist/components/DesignToolbarContainer.d.ts +1 -0
- package/dist/components/DesignView.d.ts +14 -0
- package/dist/components/Designer.d.ts +81 -0
- package/dist/components/DesignerCanvas.d.ts +4 -0
- package/dist/components/DesignerContent.d.ts +4 -0
- package/dist/components/DesignerFrame.d.ts +5 -0
- package/dist/components/DesignerHeader.d.ts +3 -0
- package/dist/components/DesignerPane.d.ts +14 -0
- package/dist/components/DesignerPanel.d.ts +3 -0
- package/dist/components/DesignerToolbar.d.ts +4 -0
- package/dist/components/DesignerToolbarButton.d.ts +9 -0
- package/dist/components/DesignerToolbarGroup.d.ts +4 -0
- package/dist/components/DesignerToolbarSeparator.d.ts +1 -0
- package/dist/components/EditorPreviewToggle.d.ts +5 -0
- package/dist/components/ExportMenu.d.ts +2 -0
- package/dist/components/FontLoader.d.ts +4 -0
- package/dist/components/FrameStylesPanel.d.ts +5 -0
- package/dist/components/PaneLayerTree.d.ts +9 -0
- package/dist/components/RuleNotice.d.ts +5 -0
- package/dist/components/RulesPanel.d.ts +6 -0
- package/dist/components/ZoomControl.d.ts +1 -0
- package/dist/components/ables/DimensionAble.d.ts +13 -0
- package/dist/components/ables/StructureAble.d.ts +18 -0
- package/dist/components/actions/ActionAlignItems.d.ts +1 -0
- package/dist/components/actions/ActionBackgroundColor.d.ts +1 -0
- package/dist/components/actions/ActionBorder.d.ts +1 -0
- package/dist/components/actions/ActionBorderRadius.d.ts +1 -0
- package/dist/components/actions/ActionColor.d.ts +1 -0
- package/dist/components/actions/ActionDisplay.d.ts +1 -0
- package/dist/components/actions/ActionElementType.d.ts +1 -0
- package/dist/components/actions/ActionFill.d.ts +1 -0
- package/dist/components/actions/ActionFlexDirection.d.ts +1 -0
- package/dist/components/actions/ActionFlexWrap.d.ts +1 -0
- package/dist/components/actions/ActionFontFamily.d.ts +1 -0
- package/dist/components/actions/ActionFontSize.d.ts +1 -0
- package/dist/components/actions/ActionFontWeight.d.ts +1 -0
- package/dist/components/actions/ActionFontWidth.d.ts +1 -0
- package/dist/components/actions/ActionGap.d.ts +1 -0
- package/dist/components/actions/ActionGridLayout.d.ts +1 -0
- package/dist/components/actions/ActionImage.d.ts +2 -0
- package/dist/components/actions/ActionJustifyContent.d.ts +1 -0
- package/dist/components/actions/ActionLayout/GridCanvas.d.ts +7 -0
- package/dist/components/actions/ActionLayout.d.ts +1 -0
- package/dist/components/actions/ActionLetterSpacing.d.ts +1 -0
- package/dist/components/actions/ActionLineHeight.d.ts +1 -0
- package/dist/components/actions/ActionMargin.d.ts +1 -0
- package/dist/components/actions/ActionOpacity.d.ts +1 -0
- package/dist/components/actions/ActionPadding.d.ts +1 -0
- package/dist/components/actions/ActionPopover.d.ts +21 -0
- package/dist/components/actions/ActionPosition.d.ts +1 -0
- package/dist/components/actions/ActionSize.d.ts +5 -0
- package/dist/components/actions/ActionTextAlign.d.ts +1 -0
- package/dist/components/actions/ActionTextContent.d.ts +1 -0
- package/dist/components/actions/ActionTextDecoration.d.ts +1 -0
- package/dist/components/actions/ActionTextShadow.d.ts +1 -0
- package/dist/components/actions/ActionTextStyle.d.ts +1 -0
- package/dist/components/actions/ActionTextTransform.d.ts +1 -0
- package/dist/components/actions/ActionTransition.d.ts +5 -0
- package/dist/components/actions/BoxModel.d.ts +1 -0
- package/dist/components/actions/ColorActionPopover.d.ts +10 -0
- package/dist/components/actions/LinkedValuesControl.d.ts +33 -0
- package/dist/components/actions/NumberFieldActionControl.d.ts +17 -0
- package/dist/components/actions/NumericActionControl.d.ts +20 -0
- package/dist/components/actions/RadiusPreview.d.ts +9 -0
- package/dist/components/actions/SelectActionControl.d.ts +16 -0
- package/dist/components/actions/SliderActionControl.d.ts +13 -0
- package/dist/components/actions/ToggleGroupControl.d.ts +15 -0
- package/dist/components/actions/TransitionCharts.d.ts +10 -0
- package/dist/components/activity/ActivityPane.d.ts +6 -0
- package/dist/components/activity/AnnotationLayer.d.ts +6 -0
- package/dist/components/activity/AnnotationThread.d.ts +30 -0
- package/dist/components/common/CategoryChip.d.ts +8 -0
- package/dist/components/common/ClearButton.d.ts +7 -0
- package/dist/components/common/ColorPicker.d.ts +8 -0
- package/dist/components/common/InputGroup.d.ts +23 -0
- package/dist/components/common/RowLabel.d.ts +6 -0
- package/dist/components/common/ScrubField.d.ts +31 -0
- package/dist/components/common/Select.d.ts +15 -0
- package/dist/components/common/Tabs.d.ts +13 -0
- package/dist/components/common/Tooltip.d.ts +11 -0
- package/dist/components/common/UnitField.d.ts +71 -0
- package/dist/components/design-pane.d.ts +9 -0
- package/dist/components/help/ConnectAgentDialog.d.ts +5 -0
- package/dist/components/help/HelpMenu.d.ts +4 -0
- package/dist/components/help/HelpProvider.d.ts +11 -0
- package/dist/components/help/WelcomeDialog.d.ts +6 -0
- package/dist/components/theme-provider.d.ts +13 -0
- package/dist/components/tokens/ImportCssDialog.d.ts +8 -0
- package/dist/components/tokens/NewTokenForm.d.ts +9 -0
- package/dist/components/tokens/TokenComposer.d.ts +26 -0
- package/dist/components/tokens/TokenEditor.d.ts +22 -0
- package/dist/components/tokens/TokenGraph.d.ts +3 -0
- package/dist/components/tokens/TokenIcon.d.ts +7 -0
- package/dist/components/tokens/TokenList.d.ts +27 -0
- package/dist/components/tokens/TokenPicker.d.ts +32 -0
- package/dist/components/tokens/TokenSlot.d.ts +22 -0
- package/dist/components/tokens/TokenStyles.d.ts +11 -0
- package/dist/components/tokens/TokenTable.d.ts +6 -0
- package/dist/components/tokens/TokenValueField.d.ts +24 -0
- package/dist/components/tokens/TokensPane.d.ts +10 -0
- package/dist/components/tokens/suggest.d.ts +6 -0
- package/dist/components/tokens/useDrawerSize.d.ts +23 -0
- package/dist/context/DesignerContext.d.ts +22 -0
- package/dist/hooks/useActiveBreakpoint.d.ts +12 -0
- package/dist/hooks/useAgentLink.d.ts +21 -0
- package/dist/hooks/useAllowed.d.ts +28 -0
- package/dist/hooks/useAnnotations.d.ts +51 -0
- package/dist/hooks/useBreakpointCss.d.ts +72 -0
- package/dist/hooks/useBreakpointStyles.d.ts +15 -0
- package/dist/hooks/useChangeLog.d.ts +29 -0
- package/dist/hooks/useDesigner.d.ts +41 -0
- package/dist/hooks/useDesignerAction.d.ts +6 -0
- package/dist/hooks/useDesignerApi.d.ts +14 -0
- package/dist/hooks/useDesignerContext.d.ts +9 -0
- package/dist/hooks/useDesignerSelector.d.ts +8 -0
- package/dist/hooks/useFrameRegistry.d.ts +33 -0
- package/dist/hooks/useFrameStyles.d.ts +31 -0
- package/dist/hooks/useGoogleFonts.d.ts +20 -0
- package/dist/hooks/useHistory.d.ts +6 -0
- package/dist/hooks/useKeybindings.d.ts +1 -0
- package/dist/hooks/useLayer.d.ts +7 -0
- package/dist/hooks/useLayerDimensions.d.ts +15 -0
- package/dist/hooks/useLayerTypes.d.ts +7 -0
- package/dist/hooks/useLayers.d.ts +5 -0
- package/dist/hooks/useSelectedLayers.d.ts +6 -0
- package/dist/hooks/useTokenEditing.d.ts +24 -0
- package/dist/hooks/useTokens.d.ts +60 -0
- package/dist/hooks/useZoom.d.ts +4 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.js +13791 -0
- package/dist/lib/Types.d.ts +12 -0
- package/dist/lib/canvasCentering.d.ts +29 -0
- package/dist/lib/cn.d.ts +1 -0
- package/dist/lib/cssPropertyMapping.d.ts +5 -0
- package/dist/lib/cssValueHelpers.d.ts +36 -0
- package/dist/lib/cursors.d.ts +17 -0
- package/dist/lib/fontFamily.d.ts +6 -0
- package/dist/lib/keyboardTargets.d.ts +9 -0
- package/dist/lib/layers/frame.d.ts +47 -0
- package/dist/lib/layers/image.d.ts +38 -0
- package/dist/lib/layers/input.d.ts +21 -0
- package/dist/lib/layers/text.d.ts +84 -0
- package/package.json +58 -5
- package/styles.css +4055 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActionTextAlign: () => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActionTextContent: () => import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActionTextDecoration: () => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActionTextShadow: () => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActionTextStyle: () => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActionTextTransform: () => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BoxModel: () => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface ColorActionPopoverProps {
|
|
3
|
+
cssProperty: string;
|
|
4
|
+
label: string;
|
|
5
|
+
popoverTitle: string;
|
|
6
|
+
triggerDisplayValue?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const ColorActionPopover: ({ cssProperty, label, popoverTitle, triggerDisplayValue, children, }: ColorActionPopoverProps) => import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TokenType } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export declare const ExpandToggle: ({ expanded, label, icon, onToggle, }: {
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
onToggle: () => void;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
|
+
export type LinkedField = {
|
|
10
|
+
property: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** A letter or icon shown inside the field. */
|
|
13
|
+
short: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
type LinkedValuesControlProps = {
|
|
16
|
+
label: string;
|
|
17
|
+
fields: readonly LinkedField[];
|
|
18
|
+
expandLabel: string;
|
|
19
|
+
icon: ReactNode;
|
|
20
|
+
units?: readonly string[];
|
|
21
|
+
min?: number;
|
|
22
|
+
scale?: Record<string, number>;
|
|
23
|
+
/** Shown between the first two fields and the rest when expanded. */
|
|
24
|
+
preview?: (values: (string | undefined)[]) => ReactNode;
|
|
25
|
+
/** The kind of token these values can take. */
|
|
26
|
+
tokenType?: TokenType;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* One value for a set of related properties, which expands inline to edit each.
|
|
30
|
+
* Opens expanded when the values differ.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LinkedValuesControl: (props: LinkedValuesControlProps) => import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface NumberFieldActionControlProps {
|
|
2
|
+
label: string;
|
|
3
|
+
defaultValue?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
cssProperty?: string;
|
|
9
|
+
units?: readonly string[];
|
|
10
|
+
defaultUnit?: string;
|
|
11
|
+
value?: number;
|
|
12
|
+
onValueChange?: (value: number | null) => void;
|
|
13
|
+
hasValue?: boolean;
|
|
14
|
+
onClear?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const NumberFieldActionControl: ({ label, defaultValue, min, max, step, orientation, cssProperty, units, defaultUnit, value, onValueChange, hasValue: externalHasValue, onClear: externalOnClear, }: NumberFieldActionControlProps) => import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TokenType } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
interface NumericActionControlProps {
|
|
4
|
+
cssProperty: string;
|
|
5
|
+
label: string;
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
units?: readonly string[];
|
|
8
|
+
defaultUnit?: string;
|
|
9
|
+
step?: number;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
addon?: ReactNode;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
scale?: Record<string, number>;
|
|
16
|
+
/** The kind of token this value can take. */
|
|
17
|
+
tokenType?: TokenType;
|
|
18
|
+
}
|
|
19
|
+
export declare const NumericActionControl: ({ cssProperty, label, defaultValue, units, defaultUnit, step, min, max, orientation, addon, placeholder, scale, tokenType, }: NumericActionControlProps) => import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Corner radii in the preview, in the order top left, top right, bottom left,
|
|
3
|
+
* bottom right. Shrinks them the way CSS does when neighbors would overlap.
|
|
4
|
+
*/
|
|
5
|
+
export declare const previewRadii: (values: (string | undefined)[]) => number[];
|
|
6
|
+
/** The layer's corners on a sample shape, with each radius marked. */
|
|
7
|
+
export declare const RadiusPreview: ({ values, }: {
|
|
8
|
+
values: (string | undefined)[];
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TokenType } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
interface SelectItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
interface SelectActionControlProps {
|
|
7
|
+
cssProperty: string;
|
|
8
|
+
label: string;
|
|
9
|
+
options: readonly SelectItem[];
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
/** Lets the value be a token of this type, like font weight. */
|
|
13
|
+
tokenType?: TokenType;
|
|
14
|
+
}
|
|
15
|
+
export declare const SelectActionControl: ({ cssProperty, label, options, defaultValue, orientation, tokenType, }: SelectActionControlProps) => import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface SliderActionControlProps {
|
|
3
|
+
cssProperty: string;
|
|
4
|
+
label: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
addon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const SliderActionControl: ({ cssProperty, label, defaultValue, min, max, step, orientation, addon, }: SliderActionControlProps) => import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface ToggleItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface ToggleGroupControlProps {
|
|
8
|
+
cssProperty: string;
|
|
9
|
+
label: string;
|
|
10
|
+
options: readonly ToggleItem[];
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
}
|
|
14
|
+
export declare const ToggleGroupControl: ({ cssProperty, label, options, defaultValue, orientation, }: ToggleGroupControlProps) => import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CubicBezier, type SpringParams } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
/** A cubic Bézier with two handles to drag, or to move with the arrow keys. */
|
|
3
|
+
export declare const BezierChart: ({ ease, onChange, }: {
|
|
4
|
+
ease: CubicBezier;
|
|
5
|
+
onChange: (ease: CubicBezier) => void;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
/** The spring's position over its full settling time. */
|
|
8
|
+
export declare const SpringChart: ({ params }: {
|
|
9
|
+
params: SpringParams;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything that happened to the design, newest first: changes (with who and
|
|
3
|
+
* why, undone ones struck through) and the comments, notes, decisions and
|
|
4
|
+
* tasks on it. Notes about a change sit under that change.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ActivityPane: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Over the canvas: a pin on each layer with open annotations, a thread card
|
|
3
|
+
* from each pin, and comment mode, where clicking a layer starts a comment
|
|
4
|
+
* on it. C toggles comment mode; Escape leaves it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AnnotationLayer: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Actor } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import { type Annotation, type AnnotationKind, type AnnotationTarget } from "@reallygoodwork/design-ui-core";
|
|
3
|
+
import { type Draft } from "../../hooks/useAnnotations";
|
|
4
|
+
/** "just now", "5m", "2h", then a date. */
|
|
5
|
+
export declare const timeAgo: (iso: string) => string;
|
|
6
|
+
/** Re-renders now and then so relative times stay true. */
|
|
7
|
+
export declare const useTick: (ms?: number) => void;
|
|
8
|
+
export declare const Avatar: ({ actor, size, }: {
|
|
9
|
+
actor: Actor;
|
|
10
|
+
size?: "sm" | "md";
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
12
|
+
export declare const KindBadge: ({ kind }: {
|
|
13
|
+
kind: AnnotationKind;
|
|
14
|
+
}) => import("react").JSX.Element;
|
|
15
|
+
/** What an annotation is on, as a chip that takes you there. */
|
|
16
|
+
export declare const TargetChip: ({ target }: {
|
|
17
|
+
target: AnnotationTarget;
|
|
18
|
+
}) => import("react").JSX.Element;
|
|
19
|
+
/** Write a comment, decision or task. */
|
|
20
|
+
export declare const Composer: ({ draft, onDone, autoFocus, compact, }: {
|
|
21
|
+
draft: Draft;
|
|
22
|
+
onDone: () => void;
|
|
23
|
+
autoFocus?: boolean;
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
}) => import("react").JSX.Element;
|
|
26
|
+
/** One annotation with its replies, a reply box, and resolve. */
|
|
27
|
+
export declare const AnnotationThread: ({ annotation, showTarget, }: {
|
|
28
|
+
annotation: Annotation;
|
|
29
|
+
showTarget?: boolean;
|
|
30
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type Category = "layer" | "layout" | "color" | "type" | "motion" | "image";
|
|
3
|
+
/** A small icon in its category's color. Decorative: the label sits beside it. */
|
|
4
|
+
export declare const CategoryChip: ({ category, size, children, }: {
|
|
5
|
+
category: Category;
|
|
6
|
+
size?: "sm" | "md";
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Clears a value. Revealed by hovering or focusing its row, or on touch. */
|
|
2
|
+
export declare const ClearButton: ({ hasValue, handleClear, label, className, }: {
|
|
3
|
+
hasValue: boolean;
|
|
4
|
+
handleClear: () => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A square of saturation and brightness, hue and opacity sliders, and a text
|
|
3
|
+
* field, writing hex, OKLCH or Display P3. Any CSS color can be typed.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ColorPicker: ({ value, onChange, }: {
|
|
6
|
+
value: string | undefined;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ScrubOptions } from "./ScrubField";
|
|
3
|
+
/**
|
|
4
|
+
* A single field. An addon, the input and a suffix share one surface, and each
|
|
5
|
+
* keeps its own space, so a long value can never run under its neighbors.
|
|
6
|
+
*/
|
|
7
|
+
export declare const InputGroup: ({ addon, value, onChange, type, placeholder, scrub, fullWidth, suffix, ariaLabel, inherited, onBlur, onKeyDown, }: {
|
|
8
|
+
addon?: ReactNode;
|
|
9
|
+
value: string;
|
|
10
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
type?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Turns the field into a draggable slider. */
|
|
14
|
+
scrub?: ScrubOptions;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
/** Sits inside the field at the right, such as a unit. */
|
|
17
|
+
suffix?: ReactNode;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** Shows a value carried over from a smaller breakpoint. */
|
|
20
|
+
inherited?: boolean;
|
|
21
|
+
onBlur?: () => void;
|
|
22
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
23
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The visible label of the panel row a control sits in. Fields and menus
|
|
3
|
+
* inside a row use it as their accessible name when none is passed.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RowLabelContext: import("react").Context<string | undefined>;
|
|
6
|
+
export declare const useRowLabel: () => string | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type ScrubOptions = {
|
|
3
|
+
value: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
/** Range the fill shows when a value has no hard limit. Doesn't restrict it. */
|
|
8
|
+
scaleMin?: number;
|
|
9
|
+
scaleMax?: number;
|
|
10
|
+
/** For fields too small to show a handle. */
|
|
11
|
+
hideHandle?: boolean;
|
|
12
|
+
/** For values that aren't numbers, like calc(). */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Paints the fill lighter, for an inherited value. */
|
|
15
|
+
muted?: boolean;
|
|
16
|
+
onChange: (value: number) => void;
|
|
17
|
+
};
|
|
18
|
+
/** Clamp to the range, then snap to a step counted from `min` (or zero). */
|
|
19
|
+
export declare const snapToStep: (value: number, step: number, min?: number, max?: number) => number;
|
|
20
|
+
/**
|
|
21
|
+
* Makes a number input draggable: hover shows a slider on the field, dragging
|
|
22
|
+
* changes the value, and a plain click still places focus for typing. With a
|
|
23
|
+
* range or scale the fill shows the value's place in it. Without one the handle
|
|
24
|
+
* follows the pointer.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ScrubField: ({ value, min, max, step, scaleMin, scaleMax, hideHandle, disabled, muted, onChange, className, children, flushRight, }: ScrubOptions & {
|
|
27
|
+
className?: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/** Squares the track's right side where it meets something in the field. */
|
|
30
|
+
flushRight?: boolean;
|
|
31
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface SelectItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
interface SelectProps {
|
|
6
|
+
items: readonly SelectItem[];
|
|
7
|
+
value: string;
|
|
8
|
+
onValueChange: (value: string) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
/** A bare trigger that sits inside a field, with no chevron. */
|
|
11
|
+
variant?: "default" | "suffix";
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Select: ({ items, value, onValueChange, className, variant, ariaLabel, }: SelectProps) => import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TabsRootProps } from "@base-ui/react/tabs";
|
|
2
|
+
interface TabsItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
/** A short tooltip saying what the tab holds. */
|
|
6
|
+
hint?: string;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface BaseTabsProps extends TabsRootProps {
|
|
10
|
+
items: TabsItem[];
|
|
11
|
+
}
|
|
12
|
+
export declare const Tabs: ({ items, value, defaultValue, onValueChange, orientation, className, ...props }: BaseTabsProps) => import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The one tooltip style: a small dark chip beside the trigger. Without
|
|
5
|
+
* `content`, renders the children alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Tooltip: ({ triggerProps, content, children, }: {
|
|
8
|
+
triggerProps?: React.ComponentProps<typeof BaseTooltip.Trigger>;
|
|
9
|
+
content?: ReactNode;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare const DEFAULT_UNITS: readonly ["px", "%", "vw", "vh", "rem", "em"];
|
|
3
|
+
/** Parse "16px" or "1.5", or return null for anything else (like "auto"). */
|
|
4
|
+
export declare const parseValue: (text: string | undefined) => {
|
|
5
|
+
value: number;
|
|
6
|
+
unit: string;
|
|
7
|
+
} | null;
|
|
8
|
+
/** Keep a value's size when its unit changes, where that can be known. */
|
|
9
|
+
export declare const convertUnit: (value: number, from: string, to: string) => number;
|
|
10
|
+
export type SizeKeyword = {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
export type UnitFieldProps = {
|
|
15
|
+
/** Value set at this breakpoint, like "16px". */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Value shown as a hint when `value` is empty, like an inherited one. */
|
|
18
|
+
placeholderValue?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
units?: readonly string[];
|
|
21
|
+
defaultUnit?: string;
|
|
22
|
+
/** Where dragging starts when the field is empty. */
|
|
23
|
+
defaultValue?: number;
|
|
24
|
+
step?: number;
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
/** Full-fill value per unit, for values with no `max`. Merged over defaults. */
|
|
28
|
+
scale?: Record<string, number>;
|
|
29
|
+
/** Named sizes offered beside the units, like Fill or Hug. */
|
|
30
|
+
keywords?: readonly SizeKeyword[];
|
|
31
|
+
addon?: ReactNode;
|
|
32
|
+
/** A control at the end of the field, after the unit. */
|
|
33
|
+
trailing?: ReactNode;
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
onChange: (value: string) => void;
|
|
36
|
+
onUnitChange?: (unit: string) => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The behavior behind a number field: typing, drafts, units and named sizes.
|
|
40
|
+
* `showUnitInText` puts the unit in the text, for fields too small for a picker.
|
|
41
|
+
*/
|
|
42
|
+
export declare const useUnitValue: ({ value, placeholderValue, placeholder, units, defaultUnit, defaultValue, step, min, max, scale, keywords, onChange, onUnitChange, }: UnitFieldProps, showUnitInText?: boolean) => {
|
|
43
|
+
inherited: boolean;
|
|
44
|
+
text: string;
|
|
45
|
+
placeholderText: string | undefined;
|
|
46
|
+
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
47
|
+
commit: () => void;
|
|
48
|
+
stepBy: (direction: 1 | -1) => void;
|
|
49
|
+
items: {
|
|
50
|
+
label: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}[];
|
|
53
|
+
suffixValue: string;
|
|
54
|
+
pickSuffix: (next: string) => void;
|
|
55
|
+
scrub: {
|
|
56
|
+
value: number;
|
|
57
|
+
min: number | undefined;
|
|
58
|
+
max: number | undefined;
|
|
59
|
+
step: number;
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
muted: boolean;
|
|
62
|
+
scaleMin: number;
|
|
63
|
+
scaleMax: number | undefined;
|
|
64
|
+
onChange: (next: number) => void;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A number with a unit: drag it, step it with the arrow keys, or type.
|
|
69
|
+
* Typing "2rem" switches the unit when the edit is committed.
|
|
70
|
+
*/
|
|
71
|
+
export declare const UnitField: (props: UnitFieldProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DesignPane: ({ children }: {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}) => import("react").JSX.Element;
|
|
4
|
+
export declare const DesignPaneTitle: ({ children, }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
export declare const DesignPaneContent: ({ children, }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type Help = {
|
|
3
|
+
openWelcome: () => void;
|
|
4
|
+
openConnectAgent: () => void;
|
|
5
|
+
};
|
|
6
|
+
/** Holds the welcome guide and the agent setup dialog, so any control can open them. */
|
|
7
|
+
export declare const HelpProvider: ({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
10
|
+
export declare const useHelp: () => Help;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** A short tour of the editor. Shows on the first visit and from Help. */
|
|
2
|
+
export declare const WelcomeDialog: ({ open, onOpenChange, onConnectAgent, }: {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
onConnectAgent: () => void;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Theme = "dark" | "light" | "system";
|
|
2
|
+
type ThemeProviderProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
defaultTheme?: Theme;
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
};
|
|
7
|
+
type ThemeProviderState = {
|
|
8
|
+
theme: Theme;
|
|
9
|
+
setTheme: (theme: Theme) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react").JSX.Element;
|
|
12
|
+
export declare const useTheme: () => ThemeProviderState;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paste a stylesheet; every custom property in it is listed with what
|
|
3
|
+
* importing it would do. Ticked ones become tokens.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ImportCssDialog: ({ open, onOpenChange, }: {
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TokenTier } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
/** Name, type, tier and value for a new token. */
|
|
3
|
+
export declare const NewTokenForm: ({ tier: initialTier, onDone, }: {
|
|
4
|
+
tier: TokenTier;
|
|
5
|
+
onDone: (created: {
|
|
6
|
+
path: string;
|
|
7
|
+
tier: TokenTier;
|
|
8
|
+
} | null) => void;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type TokenType } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
type Slot = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
type: TokenType;
|
|
6
|
+
initial: string;
|
|
7
|
+
};
|
|
8
|
+
type Template = {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
hint: string;
|
|
12
|
+
slots: Slot[];
|
|
13
|
+
build: (values: Record<string, string>) => string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Functions a composed token can be built from. Each slot takes a token of
|
|
17
|
+
* its type or a typed value, so a number token can set a color's alpha.
|
|
18
|
+
*/
|
|
19
|
+
export declare const TEMPLATES: Record<TokenType, Template[]>;
|
|
20
|
+
export declare const TokenComposer: ({ type, value, exclude, onApply, }: {
|
|
21
|
+
type: TokenType;
|
|
22
|
+
value: string;
|
|
23
|
+
exclude?: string;
|
|
24
|
+
onApply: (value: string) => void;
|
|
25
|
+
}) => import("react").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Token, type TokenIssue } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import type { Layer } from "../../lib/Types";
|
|
3
|
+
export declare const Field: ({ label, children, }: {
|
|
4
|
+
label: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
/** The shared Select, laid out like a text field: label on the left. */
|
|
8
|
+
export declare const selectClass = "min-w-0 flex-1 justify-between font-sans text-control";
|
|
9
|
+
/**
|
|
10
|
+
* Everything about one token, editable: name, tier, values per mode and
|
|
11
|
+
* description, plus where it's used, what's wrong, and delete.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TokenEditor: ({ token, issues, usedBy, onRenamed, onDeleted, }: {
|
|
14
|
+
token: Token;
|
|
15
|
+
issues: TokenIssue[];
|
|
16
|
+
usedBy: {
|
|
17
|
+
layer: Layer;
|
|
18
|
+
property: string;
|
|
19
|
+
}[];
|
|
20
|
+
onRenamed: (path: string) => void;
|
|
21
|
+
onDeleted: () => void;
|
|
22
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one mark for design tokens: on buttons that apply one, on values that
|
|
3
|
+
* use one, and in the lists. The chain icon stays for linking sides together.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TokenIcon: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
6
|
+
/** Stop using a token, keeping its value. */
|
|
7
|
+
export declare const DetachTokenIcon: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type TokenTier, type TokenType } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import type { Suggestion } from "./suggest";
|
|
3
|
+
/** A small picture of a token's value: a swatch, a length, or "Aa". */
|
|
4
|
+
export declare const TokenGlyph: ({ type, value, }: {
|
|
5
|
+
type: TokenType;
|
|
6
|
+
value?: string;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
export declare const TIER_ORDER: TokenTier[];
|
|
9
|
+
export declare const TIER_LABEL: Record<TokenTier, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Searchable tokens of one type, grouped by tier, with each value as it
|
|
12
|
+
* resolves right now. Hovering reports the token so callers can preview it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TokenList: ({ type, current, match, onPick, onHover, className, exclude, suggest, }: {
|
|
15
|
+
type: TokenType;
|
|
16
|
+
/** The token already applied, marked as selected. */
|
|
17
|
+
current?: string;
|
|
18
|
+
/** A token equal to the current raw value, marked as a match. */
|
|
19
|
+
match?: string;
|
|
20
|
+
onPick: (path: string) => void;
|
|
21
|
+
onHover?: (path: string | null) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
/** A token to leave out, such as the one being edited. */
|
|
24
|
+
exclude?: string;
|
|
25
|
+
/** Tokens to list first, under their own heading, like spacing for padding. */
|
|
26
|
+
suggest?: Suggestion | null;
|
|
27
|
+
}) => import("react").JSX.Element;
|