@reallygoodwork/design-ui-react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +57 -5
- package/styles.css +4055 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CSSVars, Layer, LayerDefinition } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
3
|
+
export type { Breakpoint, CSSVars, Keybinding, Layer, LayerDefinition, LayerNode, LayerPreset, } from "@reallygoodwork/design-ui-core";
|
|
4
|
+
export type LayerWithStyles = Layer & {
|
|
5
|
+
style: CSSProperties;
|
|
6
|
+
effectiveCssVars: CSSVars;
|
|
7
|
+
};
|
|
8
|
+
/** A layer definition plus how the editor renders and shows it. */
|
|
9
|
+
export type LayerType = LayerDefinition & {
|
|
10
|
+
render: (layer: LayerWithStyles, children?: ReactNode, elementType?: string) => ReactNode;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** A rectangle in canvas units (unzoomed design pixels). */
|
|
2
|
+
export type Box = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Where to scroll so `box` sits in the middle of `view`. Both are in canvas
|
|
10
|
+
* units; the result is the canvas point for the view's top-left corner.
|
|
11
|
+
*/
|
|
12
|
+
export declare const centeredScroll: (box: Box, view: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}) => {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Whether clicking off a layer should glide the artboards back to the middle.
|
|
21
|
+
*
|
|
22
|
+
* `view` is the visible part of the canvas and `artboards` the box around
|
|
23
|
+
* every artboard, both in canvas units, so the result doesn't depend on zoom.
|
|
24
|
+
*
|
|
25
|
+
* Called on every click on empty canvas, so returning true too eagerly will
|
|
26
|
+
* yank people away from an area they panned to on purpose; too rarely and the
|
|
27
|
+
* artboards drift off and stay lost.
|
|
28
|
+
*/
|
|
29
|
+
export declare const shouldRecenter: (view: Box, artboards: Box) => boolean;
|
package/dist/lib/cn.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cn: (...classes: (string | undefined | false | null)[]) => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SupportedCssProperty } from "@reallygoodwork/design-ui-core";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
3
|
+
export { getCssPropertyName, isSupportedCssVar, type SupportedCssProperty, withoutTransitions, } from "@reallygoodwork/design-ui-core";
|
|
4
|
+
/** `applyCssVars` from core, typed for React's `style` prop. */
|
|
5
|
+
export declare const applyCssVars: (cssVars: Record<string, string> | undefined, supportedProperties?: SupportedCssProperty[]) => CSSProperties;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a CSS value string into numeric value and unit
|
|
3
|
+
* @param cssValue - CSS value string (e.g., "16px", "50%", "2rem")
|
|
4
|
+
* @param defaultUnit - Default unit to use if none is found (default: "px")
|
|
5
|
+
* @returns Object with numeric value and unit string
|
|
6
|
+
* @example
|
|
7
|
+
* parseCSSValue("16px", "px") // { value: 16, unit: "px" }
|
|
8
|
+
* parseCSSValue("50%", "px") // { value: 50, unit: "%" }
|
|
9
|
+
* parseCSSValue("", "px") // { value: 0, unit: "px" }
|
|
10
|
+
*/
|
|
11
|
+
export declare const parseCSSValue: (cssValue: string | undefined, defaultUnit?: string) => {
|
|
12
|
+
value: number;
|
|
13
|
+
unit: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Extracts just the numeric value from a CSS variable string
|
|
17
|
+
* Useful for simple numeric inputs that don't need unit handling
|
|
18
|
+
* @param cssVar - CSS variable value (e.g., "16px", "50%")
|
|
19
|
+
* @returns Numeric string or empty string if no value
|
|
20
|
+
* @example
|
|
21
|
+
* getNumericValue("16px") // "16"
|
|
22
|
+
* getNumericValue("50%") // "50"
|
|
23
|
+
* getNumericValue("") // ""
|
|
24
|
+
*/
|
|
25
|
+
export declare const getNumericValue: (cssVar: string | undefined) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Formats a numeric value with a unit into a CSS value string
|
|
28
|
+
* @param value - Numeric value or string
|
|
29
|
+
* @param unit - CSS unit (px, %, rem, etc.)
|
|
30
|
+
* @returns Formatted CSS value string or empty string
|
|
31
|
+
* @example
|
|
32
|
+
* formatCSSValue(16, "px") // "16px"
|
|
33
|
+
* formatCSSValue("50", "%") // "50%"
|
|
34
|
+
* formatCSSValue("", "px") // ""
|
|
35
|
+
*/
|
|
36
|
+
export declare const formatCSSValue: (value: number | string, unit: string) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canvas's own cursors: an arrow for empty space, and the same arrow with
|
|
3
|
+
* a small badge over anything a click would select. The badge says what kind
|
|
4
|
+
* of layer it is: selection corners for a frame, a T for text, a picture for
|
|
5
|
+
* an image, a field for an input. Each is a CSS `cursor` value with the
|
|
6
|
+
* system cursor as a fallback.
|
|
7
|
+
*
|
|
8
|
+
* Colours are literal, because a data URL can't read CSS variables: the
|
|
9
|
+
* editor's foreground (#1b1e26) with a white edge, so the arrow reads on light
|
|
10
|
+
* and dark content, and the accent (#2b7fff) for every badge.
|
|
11
|
+
*/
|
|
12
|
+
/** Empty canvas and frame background. */
|
|
13
|
+
export declare const CURSOR_ARROW: string;
|
|
14
|
+
/** Over a layer of a type with no badge of its own, such as a host's custom type. */
|
|
15
|
+
export declare const CURSOR_SELECT: string;
|
|
16
|
+
/** Over a layer of a built-in type: a click selects it, and the badge names it. */
|
|
17
|
+
export declare const CURSOR_SELECT_BY_TYPE: Record<string, string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the first family name of a CSS `font-family` value, with quotes and
|
|
3
|
+
* surrounding whitespace stripped. Returns `null` when there is none or when
|
|
4
|
+
* it is a CSS generic family or global keyword (which Google Fonts can't serve).
|
|
5
|
+
*/
|
|
6
|
+
export declare const primaryFontFamily: (value: string | undefined | null) => string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** True when typing here should stay in the field. */
|
|
2
|
+
export declare const isEditableTarget: (target: EventTarget | null) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* True when the focused element owns its keys, like a toggle or select.
|
|
5
|
+
* Tree rows are not controls, so Delete still removes the focused layer.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isControlTarget: (target: EventTarget | null) => boolean;
|
|
8
|
+
export declare const isInLayerTree: (target: EventTarget | null) => boolean;
|
|
9
|
+
export declare const isPopupOpen: () => boolean;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { LayerWithStyles } from "../Types";
|
|
2
|
+
export declare const frameLayerType: {
|
|
3
|
+
icon: import("react").JSX.Element;
|
|
4
|
+
render: (layer: LayerWithStyles, children?: React.ReactNode, elementType?: string | undefined) => import("react").JSX.Element;
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
keybinding: {
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
labelMac: string;
|
|
12
|
+
description: string;
|
|
13
|
+
group: string;
|
|
14
|
+
};
|
|
15
|
+
supportsChildren: true;
|
|
16
|
+
supportedCssProperties: string[];
|
|
17
|
+
defaultValues: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
cssVars: {
|
|
21
|
+
"--height": string;
|
|
22
|
+
"--background-color": string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
elementType: string;
|
|
26
|
+
availableElementTypes: string[];
|
|
27
|
+
presets: ({
|
|
28
|
+
id: "section" | "article" | "main" | "header" | "footer" | "nav" | "aside";
|
|
29
|
+
label: "Section" | "Header" | "Navigation" | "Main" | "Article" | "Aside" | "Footer";
|
|
30
|
+
description: "A themed part of the page, usually with a heading" | "Introductory content, such as a logo and navigation" | "A group of links to other pages or sections" | "The page's primary content. Use one per page" | "Self-contained content, such as a post or card" | "Content beside the main flow, such as a sidebar" | "Closing content, such as links and copyright";
|
|
31
|
+
group: string;
|
|
32
|
+
elementType: "section" | "article" | "main" | "header" | "footer" | "nav" | "aside";
|
|
33
|
+
values: {
|
|
34
|
+
name: "Section" | "Header" | "Navigation" | "Main" | "Article" | "Aside" | "Footer";
|
|
35
|
+
};
|
|
36
|
+
keywords: ("section" | "article" | "main" | "header" | "footer" | "nav" | "aside")[];
|
|
37
|
+
} | {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
group: string;
|
|
42
|
+
keywords: string[];
|
|
43
|
+
})[];
|
|
44
|
+
html: {
|
|
45
|
+
content: "children";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { LayerWithStyles } from "../Types";
|
|
2
|
+
export declare const imageLayerType: {
|
|
3
|
+
icon: import("react").JSX.Element;
|
|
4
|
+
render: (layer: LayerWithStyles, _children?: React.ReactNode) => import("react").JSX.Element;
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
keybinding: {
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
labelMac: string;
|
|
12
|
+
description: string;
|
|
13
|
+
group: string;
|
|
14
|
+
};
|
|
15
|
+
supportsChildren: false;
|
|
16
|
+
supportedCssProperties: string[];
|
|
17
|
+
defaultValues: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
cssVars: {
|
|
21
|
+
"--width": string;
|
|
22
|
+
"--height": string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
presets: {
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
description: string;
|
|
29
|
+
group: string;
|
|
30
|
+
keywords: string[];
|
|
31
|
+
}[];
|
|
32
|
+
html: {
|
|
33
|
+
content: "image";
|
|
34
|
+
baseStyle: {
|
|
35
|
+
display: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LayerWithStyles } from "../Types";
|
|
2
|
+
export declare const inputLayerType: {
|
|
3
|
+
icon: import("react").JSX.Element;
|
|
4
|
+
render: (layer: LayerWithStyles, _children?: React.ReactNode) => import("react").JSX.Element;
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
supportsChildren: false;
|
|
8
|
+
supportedCssProperties: string[];
|
|
9
|
+
defaultValues: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
cssVars: {
|
|
13
|
+
"--height": string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
elementType: string;
|
|
17
|
+
availableElementTypes: string[];
|
|
18
|
+
html: {
|
|
19
|
+
content: "input";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { LayerWithStyles } from "../Types";
|
|
2
|
+
export declare const textLayerType: {
|
|
3
|
+
icon: import("react").JSX.Element;
|
|
4
|
+
render: (layer: LayerWithStyles, children?: React.ReactNode, elementType?: string | undefined) => import("react").JSX.Element;
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
keybinding: {
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
labelMac: string;
|
|
12
|
+
description: string;
|
|
13
|
+
group: string;
|
|
14
|
+
};
|
|
15
|
+
supportsChildren: false;
|
|
16
|
+
supportedCssProperties: string[];
|
|
17
|
+
defaultValues: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
cssVars: {
|
|
21
|
+
"--font-size": string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
elementType: string;
|
|
25
|
+
availableElementTypes: string[];
|
|
26
|
+
presets: ({
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
description: string;
|
|
30
|
+
group: string;
|
|
31
|
+
elementType: string;
|
|
32
|
+
values: {
|
|
33
|
+
name: string;
|
|
34
|
+
value: string;
|
|
35
|
+
cssVars: {
|
|
36
|
+
"--font-size": "16px" | "40px" | "32px" | "24px" | "20px" | "18px";
|
|
37
|
+
"--line-height": "40px" | "48px" | "32px" | "24px" | "28px" | "26px";
|
|
38
|
+
"--font-weight": string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
keywords: string[];
|
|
42
|
+
} | {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
description: string;
|
|
46
|
+
group: string;
|
|
47
|
+
values: {
|
|
48
|
+
name: string;
|
|
49
|
+
value?: undefined;
|
|
50
|
+
cssVars?: undefined;
|
|
51
|
+
};
|
|
52
|
+
keywords: string[];
|
|
53
|
+
elementType?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
id: string;
|
|
56
|
+
label: string;
|
|
57
|
+
description: string;
|
|
58
|
+
group: string;
|
|
59
|
+
elementType: string;
|
|
60
|
+
values: {
|
|
61
|
+
name: string;
|
|
62
|
+
value: string;
|
|
63
|
+
cssVars: {
|
|
64
|
+
"--font-size": string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
keywords: string[];
|
|
68
|
+
} | {
|
|
69
|
+
id: string;
|
|
70
|
+
label: string;
|
|
71
|
+
description: string;
|
|
72
|
+
group: string;
|
|
73
|
+
elementType: string;
|
|
74
|
+
values: {
|
|
75
|
+
name: string;
|
|
76
|
+
value?: undefined;
|
|
77
|
+
cssVars?: undefined;
|
|
78
|
+
};
|
|
79
|
+
keywords: string[];
|
|
80
|
+
})[];
|
|
81
|
+
html: {
|
|
82
|
+
content: "text";
|
|
83
|
+
};
|
|
84
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@reallygoodwork/design-ui-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React components for an editor that works on the design format: canvas, layer tree, style controls, tokens, rules and activity.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/reallygoodwork/design-ui.git",
|
|
9
|
+
"directory": "packages/react"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/reallygoodwork/design-ui#readme",
|
|
12
|
+
"bugs": "https://github.com/reallygoodwork/design-ui/issues",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"*.css"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"@design-ui/source": "./src/index.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./styles.css": "./styles.css"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/**/*.js",
|
|
30
|
+
"dist/**/*.d.ts",
|
|
31
|
+
"styles.css",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "bun run build:js && bun run build:types && bun run build:css",
|
|
36
|
+
"build:js": "vite build",
|
|
37
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
38
|
+
"build:css": "bun scripts/build-css.ts"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
42
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@reallygoodwork/design-ui-core": "0.1.0",
|
|
46
|
+
"@base-ui/react": "^1.9.0",
|
|
47
|
+
"@tabler/icons-react": "^3.50.0",
|
|
48
|
+
"@xyflow/react": "^12.12.1",
|
|
49
|
+
"cmdk": "^1.1.1",
|
|
50
|
+
"lucide-react": "^0.562.0",
|
|
51
|
+
"react-aria-components": "^1.22.1",
|
|
52
|
+
"react-infinite-viewer": "^0.28.1",
|
|
53
|
+
"react-moveable": "^0.56.0",
|
|
54
|
+
"react-selecto": "^1.26.3",
|
|
55
|
+
"tailwind-merge": "^3.7.0",
|
|
56
|
+
"usehooks-ts": "^3.1.1"
|
|
57
|
+
}
|
|
58
|
+
}
|