@sragatiping/cuboid 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/dist/components/CodeSnippet/CodeSnippet.d.ts +50 -0
- package/dist/components/CodeSnippet/CodeSnippet.stories.d.ts +17 -0
- package/dist/components/CodeSnippet/__fixtures__/device-profile-report.d.ts +422 -0
- package/dist/components/CodeSnippet/index.d.ts +2 -0
- package/dist/components/CodeSnippet/tokenizer.d.ts +49 -0
- package/dist/components/DataGrid/DataGrid.d.ts +11 -0
- package/dist/components/DataGrid/index.d.ts +2 -0
- package/dist/components/Graph/GraphCanvas.d.ts +15 -0
- package/dist/components/Graph/GraphCanvas.stories.d.ts +20 -0
- package/dist/components/Graph/GraphCard.d.ts +31 -0
- package/dist/components/Graph/GraphEdge.d.ts +27 -0
- package/dist/components/Graph/GraphHandle.d.ts +16 -0
- package/dist/components/Graph/GraphRow.d.ts +14 -0
- package/dist/components/Graph/context.d.ts +36 -0
- package/dist/components/Graph/index.d.ts +10 -0
- package/dist/components/JsonGraph/DeviceProfileReport.stories.d.ts +11 -0
- package/dist/components/JsonGraph/JsonCardTitle.d.ts +12 -0
- package/dist/components/JsonGraph/JsonFieldRow.d.ts +15 -0
- package/dist/components/JsonGraph/JsonGraph.stories.d.ts +19 -0
- package/dist/components/JsonGraph/JsonInputHandle.d.ts +30 -0
- package/dist/components/JsonGraph/JsonObjectRow.d.ts +22 -0
- package/dist/components/JsonGraph/index.d.ts +8 -0
- package/dist/components/JsonGraph/treeLayout.d.ts +114 -0
- package/dist/components/JsonViewer/JsonViewer.d.ts +15 -0
- package/dist/components/JsonViewer/index.d.ts +2 -0
- package/dist/components/core/ActionMenu/ActionMenu.d.ts +28 -0
- package/dist/components/core/ActionMenu/ActionMenu.stories.d.ts +10 -0
- package/dist/components/core/ActionMenu/ActionMenuItem.d.ts +22 -0
- package/dist/components/core/ActionMenu/ActionMenuList.d.ts +32 -0
- package/dist/components/core/ActionMenu/actionMenuCssVars.d.ts +2 -0
- package/dist/components/core/ActionMenu/actionMenuKeyboard.d.ts +4 -0
- package/dist/components/core/ActionMenu/index.d.ts +6 -0
- package/dist/components/core/Breadcrumb/BreadcrumbLink.d.ts +12 -0
- package/dist/components/core/Breadcrumb/Breadcrumbs.d.ts +13 -0
- package/dist/components/core/Breadcrumb/Breadcrumbs.stories.d.ts +6 -0
- package/dist/components/core/Breadcrumb/index.d.ts +4 -0
- package/dist/components/core/Button/Button.d.ts +22 -0
- package/dist/components/core/Button/Button.stories.d.ts +6 -0
- package/dist/components/core/Button/index.d.ts +2 -0
- package/dist/components/core/Icon/Icon.d.ts +13 -0
- package/dist/components/core/Icon/Icon.stories.d.ts +6 -0
- package/dist/components/core/Icon/index.d.ts +2 -0
- package/dist/components/core/IconButton/IconButton.d.ts +28 -0
- package/dist/components/core/IconButton/IconButton.stories.d.ts +6 -0
- package/dist/components/core/IconButton/index.d.ts +3 -0
- package/dist/components/core/Link/Link.d.ts +18 -0
- package/dist/components/core/Link/Link.stories.d.ts +6 -0
- package/dist/components/core/Link/index.d.ts +2 -0
- package/dist/components/core/Overlay/Overlay.d.ts +21 -0
- package/dist/components/core/Overlay/Overlay.stories.d.ts +10 -0
- package/dist/components/core/Overlay/index.d.ts +2 -0
- package/dist/components/core/Pill/Pill.d.ts +25 -0
- package/dist/components/core/Pill/Pill.stories.d.ts +6 -0
- package/dist/components/core/Pill/index.d.ts +3 -0
- package/dist/components/core/Popover/Popover.d.ts +39 -0
- package/dist/components/core/Popover/Popover.stories.d.ts +10 -0
- package/dist/components/core/Popover/index.d.ts +2 -0
- package/dist/components/core/ResizeHandle/ResizeHandle.d.ts +21 -0
- package/dist/components/core/ResizeHandle/index.d.ts +2 -0
- package/dist/components/core/Sheet/Sheet.d.ts +55 -0
- package/dist/components/core/Sheet/Sheet.stories.d.ts +14 -0
- package/dist/components/core/Sheet/index.d.ts +4 -0
- package/dist/components/core/Sidebar/Sidebar.d.ts +68 -0
- package/dist/components/core/Sidebar/Sidebar.stories.d.ts +11 -0
- package/dist/components/core/Sidebar/index.d.ts +2 -0
- package/dist/components/core/Sidebar/sidebarCssVars.d.ts +2 -0
- package/dist/components/core/SiteHeader/SiteHeader.d.ts +17 -0
- package/dist/components/core/SiteHeader/SiteHeader.stories.d.ts +6 -0
- package/dist/components/core/SiteHeader/index.d.ts +2 -0
- package/dist/components/core/SplitLayout/SplitLayout.d.ts +24 -0
- package/dist/components/core/SplitLayout/SplitLayout.stories.d.ts +6 -0
- package/dist/components/core/SplitLayout/index.d.ts +2 -0
- package/dist/components/core/Stack/Stack.d.ts +43 -0
- package/dist/components/core/Stack/Stack.stories.d.ts +15 -0
- package/dist/components/core/Stack/index.d.ts +3 -0
- package/dist/components/core/Text/Text.d.ts +29 -0
- package/dist/components/core/Text/Text.stories.d.ts +8 -0
- package/dist/components/core/Text/index.d.ts +2 -0
- package/dist/components/core/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/core/Tooltip/Tooltip.stories.d.ts +10 -0
- package/dist/components/core/Tooltip/index.d.ts +2 -0
- package/dist/components/core/index.d.ts +34 -0
- package/dist/icons/Icons.stories.d.ts +6 -0
- package/dist/icons/index.d.ts +13 -0
- package/dist/icons/manifest.json.d.ts +2489 -0
- package/dist/icons/material/config.d.ts +4 -0
- package/dist/icons/material/createMaterialIcon.d.ts +7 -0
- package/dist/icons/material/index.d.ts +231 -0
- package/dist/icons/material/source.d.ts +220 -0
- package/dist/index.cjs.js +10 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.es.js +8135 -0
- package/dist/index.es.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/theme/ThemeContext.d.ts +20 -0
- package/dist/theme/defaultTheme.d.ts +2 -0
- package/dist/theme/figma/buildFigmaTheme.d.ts +7 -0
- package/dist/theme/output/base.json.d.ts +208 -0
- package/dist/theme/output/theme.json.d.ts +1898 -0
- package/dist/theme/types.d.ts +610 -0
- package/dist/theme/utils.d.ts +6 -0
- package/dist/utils/flattenJson.d.ts +18 -0
- package/dist/utils/parseLengthPx.d.ts +2 -0
- package/dist/utils/responsive.d.ts +8 -0
- package/package.json +71 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { CubeTheme } from '../../../theme/types';
|
|
3
|
+
export type OverlayVariant = "modal" | "sheet" | "none";
|
|
4
|
+
export interface OverlayProps {
|
|
5
|
+
/** When false, nothing is rendered. */
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/** Scrim strength — `modal` blocks strongly, `sheet` is lighter, `none` is transparent and non-blocking. */
|
|
8
|
+
variant?: OverlayVariant;
|
|
9
|
+
/** Called when the scrim is clicked or Escape is pressed. Omit for a non-dismissible backdrop. */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
theme?: CubeTheme;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Full-viewport scrim layer — portaled to `document.body`.
|
|
17
|
+
*
|
|
18
|
+
* Use beneath Dialog (modal variant) or Sheet (sheet variant). Does not trap
|
|
19
|
+
* focus or lock scroll; those belong on Dialog / Sheet.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Overlay({ open, variant, onDismiss, theme, className, style, }: OverlayProps): React.ReactPortal | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Overlay } from './Overlay';
|
|
3
|
+
declare const meta: Meta<typeof Overlay>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Overlay>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Modal: Story;
|
|
8
|
+
export declare const Sheet: Story;
|
|
9
|
+
export declare const None: Story;
|
|
10
|
+
export declare const NonDismissible: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeTheme, PillIntensity, PillSurface, ThemeTokens } from '../../../theme/types';
|
|
3
|
+
import { default as themeOutput } from '../../../theme/output/theme.json';
|
|
4
|
+
/** Shade keys from `pillColors` in theme.json — add `yellow.json`, etc. alongside `gray.json`. */
|
|
5
|
+
export type PillShade = keyof typeof themeOutput.pillColors;
|
|
6
|
+
export type { PillIntensity, PillSurface };
|
|
7
|
+
type PillElement = "span" | "a";
|
|
8
|
+
export interface PillProps {
|
|
9
|
+
/** Color family — maps to Figma `shade` (token file per shade). */
|
|
10
|
+
shade?: PillShade;
|
|
11
|
+
/** Emphasis step — maps to Figma `intensity`. */
|
|
12
|
+
intensity?: PillIntensity;
|
|
13
|
+
/** When true, uses the `bordered` surface recipe (Figma `border?`). */
|
|
14
|
+
border?: boolean;
|
|
15
|
+
/** Render as static label (`span`) or link (`a` when `href` is set). */
|
|
16
|
+
as?: PillElement;
|
|
17
|
+
href?: string;
|
|
18
|
+
size?: keyof ThemeTokens["sizes"]["pill"];
|
|
19
|
+
leadingVisual?: React.ReactNode;
|
|
20
|
+
trailingVisual?: React.ReactNode;
|
|
21
|
+
theme?: CubeTheme;
|
|
22
|
+
className?: string;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function Pill({ shade, intensity, border, as, href, size, leadingVisual, trailingVisual, theme, className, children, style, ...rest }: PillProps & Omit<React.HTMLAttributes<HTMLElement>, "children">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeTheme } from '../../../theme/types';
|
|
3
|
+
export type PopoverPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "right";
|
|
4
|
+
/** Figma `ActionMenu.Overlay` elevation variants — `3x` is the default dropdown shell. */
|
|
5
|
+
export type PopoverElevation = "3x" | "4x";
|
|
6
|
+
export type PopoverPanelRole = "dialog" | false;
|
|
7
|
+
export interface PopoverProps {
|
|
8
|
+
/** When omitted, open state is managed internally (toggle on trigger click). */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Anchor element — must be a single React element that accepts event props. */
|
|
12
|
+
trigger: React.ReactElement;
|
|
13
|
+
/** Panel content — menus, forms, or any interactive UI. */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
placement?: PopoverPlacement;
|
|
16
|
+
elevation?: PopoverElevation;
|
|
17
|
+
/** Close on outside pointer down and Escape. Default true. */
|
|
18
|
+
dismissible?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Panel ARIA role. Use `false` for positioning shells whose semantics live on
|
|
21
|
+
* children (e.g. `ActionMenuList` with `role="menu"`).
|
|
22
|
+
* @default "dialog"
|
|
23
|
+
*/
|
|
24
|
+
panelRole?: PopoverPanelRole;
|
|
25
|
+
/** @default "dialog" */
|
|
26
|
+
triggerHasPopup?: "dialog" | "menu" | "listbox" | "grid" | "tree" | boolean;
|
|
27
|
+
panelRef?: React.Ref<HTMLDivElement>;
|
|
28
|
+
onPanelKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
29
|
+
/** Return focus to the trigger after the panel closes. */
|
|
30
|
+
returnFocusOnClose?: boolean;
|
|
31
|
+
/** Accessible name for the panel when content has no visible title. */
|
|
32
|
+
"aria-label"?: string;
|
|
33
|
+
/** id of an element that labels the panel. */
|
|
34
|
+
"aria-labelledby"?: string;
|
|
35
|
+
theme?: CubeTheme;
|
|
36
|
+
className?: string;
|
|
37
|
+
contentClassName?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare function Popover({ open: openProp, onOpenChange, trigger, children, placement, elevation, dismissible, panelRole, triggerHasPopup, panelRef: panelRefProp, onPanelKeyDown, returnFocusOnClose, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, theme, className, contentClassName, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Popover } from './Popover';
|
|
3
|
+
declare const meta: Meta<typeof Popover>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Popover>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Controlled: Story;
|
|
8
|
+
export declare const Placements: Story;
|
|
9
|
+
export declare const Elevation: Story;
|
|
10
|
+
export declare const NotClippedByOverflow: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CubeTheme } from '../../../theme/types';
|
|
2
|
+
export type ResizeHandleOrientation = "vertical" | "horizontal";
|
|
3
|
+
export type ResizeHandleEdge = "start" | "end" | "top" | "bottom";
|
|
4
|
+
export interface ResizeHandleProps {
|
|
5
|
+
/** `vertical` = width; `horizontal` = height */
|
|
6
|
+
orientation?: ResizeHandleOrientation;
|
|
7
|
+
/** Which edge of the parent panel the handle sits on */
|
|
8
|
+
edge: ResizeHandleEdge;
|
|
9
|
+
/** Pointer delta in px — positive = toward end/bottom edge of screen axis */
|
|
10
|
+
onResizeDelta: (deltaPx: number) => void;
|
|
11
|
+
onResizeStart?: () => void;
|
|
12
|
+
onResizeEnd?: () => void;
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
theme?: CubeTheme;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Shared drag affordance for resizable panels — used by Sheet, Sidebar, etc.
|
|
19
|
+
* Parent must be `position: relative` (or fixed) with room for the handle.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ResizeHandle({ orientation, edge, onResizeDelta, onResizeStart, onResizeEnd, "aria-label": ariaLabel, theme, className, }: ResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { CubeTheme, SheetWidthStopTokens } from '../../../theme/types';
|
|
3
|
+
export type SheetEdge = "left" | "right" | "bottom";
|
|
4
|
+
export type SheetWidthStop = keyof SheetWidthStopTokens;
|
|
5
|
+
/** Named stop (`sm` / `md` / `lg`) or any CSS length (e.g. `28rem`). Ignored for `edge="bottom"`. */
|
|
6
|
+
export type SheetWidth = SheetWidthStop | (string & {});
|
|
7
|
+
export interface SheetProps {
|
|
8
|
+
/** When false, nothing is rendered. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/** Which viewport edge the panel slides from. */
|
|
11
|
+
edge?: SheetEdge;
|
|
12
|
+
/** Panel width for left/right sheets — token stop or CSS length. @default "md" */
|
|
13
|
+
width?: SheetWidth;
|
|
14
|
+
/** Drag the inner edge to resize (left/right only). */
|
|
15
|
+
resizable?: boolean;
|
|
16
|
+
/** Fired while resizing with the current width in px. */
|
|
17
|
+
onWidthChange?: (widthPx: number) => void;
|
|
18
|
+
/** When true (default), renders a sheet-variant Overlay scrim behind the panel. */
|
|
19
|
+
modal?: boolean;
|
|
20
|
+
/** Called when Escape is pressed or the scrim is clicked (when modal). */
|
|
21
|
+
onDismiss?: () => void;
|
|
22
|
+
/** Accessible name when the sheet has no visible title. */
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
/** ID of the visible title element, when present. */
|
|
25
|
+
"aria-labelledby"?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Rounds the top corners when `edge="bottom"`. Ignored for left/right sheets.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
roundedTop?: boolean;
|
|
31
|
+
theme?: CubeTheme;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export interface SheetRegionProps {
|
|
37
|
+
theme?: CubeTheme;
|
|
38
|
+
className?: string;
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare function SheetHeader({ theme, className, style, children }: SheetRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function SheetBody({ theme, className, style, children }: SheetRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Portaled slide-in panel — the content layer above {@link Overlay}.
|
|
46
|
+
*
|
|
47
|
+
* Shell has no padding — use {@link Sheet.Header} and {@link Sheet.Body}.
|
|
48
|
+
* {@link ResizeHandle} is shared with Sidebar and other resizable panels.
|
|
49
|
+
*/
|
|
50
|
+
export declare function Sheet({ open, edge, width, resizable, onWidthChange, modal, roundedTop, onDismiss, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, theme, className, style, children, }: SheetProps): React.ReactPortal | null;
|
|
51
|
+
export declare namespace Sheet {
|
|
52
|
+
var Header: typeof SheetHeader;
|
|
53
|
+
var Body: typeof SheetBody;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Sheet } from './Sheet';
|
|
3
|
+
declare const meta: Meta<typeof Sheet>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Sheet>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const StickyHeader: Story;
|
|
8
|
+
export declare const WidthLarge: Story;
|
|
9
|
+
export declare const Resizable: Story;
|
|
10
|
+
export declare const Right: Story;
|
|
11
|
+
export declare const Left: Story;
|
|
12
|
+
export declare const Bottom: Story;
|
|
13
|
+
export declare const BottomFlat: Story;
|
|
14
|
+
export declare const NonModal: Story;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Sheet } from './Sheet';
|
|
2
|
+
export type { SheetProps, SheetEdge, SheetRegionProps, SheetWidth, SheetWidthStop, } from './Sheet';
|
|
3
|
+
export { ResizeHandle } from '../ResizeHandle';
|
|
4
|
+
export type { ResizeHandleProps, ResizeHandleOrientation, ResizeHandleEdge, } from '../ResizeHandle';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { CubeTheme, SheetWidthStopTokens } from '../../../theme/types';
|
|
3
|
+
export type SidebarEdge = "left" | "right";
|
|
4
|
+
export type SidebarWidthStop = keyof SheetWidthStopTokens;
|
|
5
|
+
/** Named stop (`sm` / `md` / `lg`) or any CSS length (e.g. `17rem`). */
|
|
6
|
+
export type SidebarWidth = SidebarWidthStop | (string & {});
|
|
7
|
+
export interface SidebarProps {
|
|
8
|
+
/** When true, the sidebar collapses to the minimized rail width. */
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
defaultCollapsed?: boolean;
|
|
11
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
12
|
+
/** Which document edge the sidebar sits on. @default "left" */
|
|
13
|
+
edge?: SidebarEdge;
|
|
14
|
+
/** Expanded width — token stop or CSS length. @default "md" */
|
|
15
|
+
width?: SidebarWidth;
|
|
16
|
+
/** Drag the inner edge to resize (disabled while collapsed). */
|
|
17
|
+
resizable?: boolean;
|
|
18
|
+
/** Fired while resizing with the current width in px. */
|
|
19
|
+
onWidthChange?: (widthPx: number) => void;
|
|
20
|
+
/** Accessible name when the sidebar has no visible title. */
|
|
21
|
+
"aria-label"?: string;
|
|
22
|
+
/** ID of the visible title element, when present. */
|
|
23
|
+
"aria-labelledby"?: string;
|
|
24
|
+
theme?: CubeTheme;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export interface SidebarRegionProps {
|
|
30
|
+
theme?: CubeTheme;
|
|
31
|
+
className?: string;
|
|
32
|
+
style?: CSSProperties;
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export interface SidebarToggleProps {
|
|
36
|
+
/** Pin the toggle to the top inner corner of the sidebar shell. */
|
|
37
|
+
floating?: boolean;
|
|
38
|
+
/** Override the default expand/collapse label. */
|
|
39
|
+
"aria-label"?: string;
|
|
40
|
+
theme?: CubeTheme;
|
|
41
|
+
className?: string;
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
interface SidebarContextValue {
|
|
45
|
+
collapsed: boolean;
|
|
46
|
+
edge: SidebarEdge;
|
|
47
|
+
toggleCollapsed: () => void;
|
|
48
|
+
}
|
|
49
|
+
/** Read collapse state and toggle from anywhere inside {@link Sidebar}. */
|
|
50
|
+
export declare function useSidebar(): SidebarContextValue;
|
|
51
|
+
declare function SidebarHeader({ theme, className, style, children }: SidebarRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare function SidebarBody({ theme, className, style, children }: SidebarRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
declare function SidebarFooter({ theme, className, style, children }: SidebarRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare function SidebarToggle({ floating, "aria-label": ariaLabel, theme, className, style, }: SidebarToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* In-flow navigation shell — not portaled like {@link Sheet}.
|
|
57
|
+
*
|
|
58
|
+
* Use {@link Sidebar.Header}, {@link Sidebar.Body}, and {@link Sidebar.Footer} for regions.
|
|
59
|
+
* {@link Sidebar.Toggle} calls into the sidebar collapse state (controlled or uncontrolled).
|
|
60
|
+
*/
|
|
61
|
+
export declare function Sidebar({ collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, edge, width, resizable, onWidthChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, theme, className, style, children, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare namespace Sidebar {
|
|
63
|
+
var Header: typeof SidebarHeader;
|
|
64
|
+
var Body: typeof SidebarBody;
|
|
65
|
+
var Footer: typeof SidebarFooter;
|
|
66
|
+
var Toggle: typeof SidebarToggle;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Sidebar } from './Sidebar';
|
|
3
|
+
declare const meta: Meta<typeof Sidebar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Sidebar>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CollapsedRail: Story;
|
|
8
|
+
export declare const Resizable: Story;
|
|
9
|
+
export declare const ExternalToggle: Story;
|
|
10
|
+
export declare const FloatingToggle: Story;
|
|
11
|
+
export declare const RightEdge: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeTheme } from '../../../theme/types';
|
|
3
|
+
export interface SiteHeaderProps {
|
|
4
|
+
/** Primary navigation region (menu, breadcrumbs, back affordances). */
|
|
5
|
+
leading?: React.ReactNode;
|
|
6
|
+
/** Actions region (search, notifications, primary buttons). */
|
|
7
|
+
trailing?: React.ReactNode;
|
|
8
|
+
theme?: CubeTheme;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function SiteHeader({ leading, trailing, theme, className }: SiteHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export interface SiteHeaderDividerProps {
|
|
13
|
+
theme?: CubeTheme;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Vertical rule between leading controls (e.g. back button and breadcrumbs). */
|
|
17
|
+
export declare function SiteHeaderDivider({ theme, className }: SiteHeaderDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeTheme } from '../../../theme/types';
|
|
3
|
+
export interface SplitLayoutProps {
|
|
4
|
+
theme?: CubeTheme;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface SplitLayoutMainProps {
|
|
10
|
+
theme?: CubeTheme;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare function SplitLayoutMain({ className, style, children }: SplitLayoutMainProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Horizontal app shell — sidebar (or other leading panel) plus scrollable main.
|
|
18
|
+
* In-flow only; pair with {@link Sidebar} rather than portaled {@link Sheet}.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SplitLayout({ className, style, children }: SplitLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace SplitLayout {
|
|
22
|
+
var Main: typeof SplitLayoutMain;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { CubeTheme, StackGap, StackPadding } from '../../../theme/types';
|
|
3
|
+
import { Responsive } from '../../../utils/responsive';
|
|
4
|
+
export type StackDirection = "horizontal" | "vertical";
|
|
5
|
+
export type { StackGap, StackPadding };
|
|
6
|
+
/** @deprecated Use `StackGap` or `StackPadding`. */
|
|
7
|
+
export type { StackGap as StackSpacing };
|
|
8
|
+
export interface StackProps {
|
|
9
|
+
/** HTML element or component to render as (default: div) */
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
/** Flex direction — scalar or `{ sm, md, lg }` for responsive layout */
|
|
12
|
+
direction?: Responsive<StackDirection>;
|
|
13
|
+
/** Gap between children — `none`, `xxs` … `xxl`; responsive supported */
|
|
14
|
+
gap?: Responsive<StackGap>;
|
|
15
|
+
/** Padding on all sides — same scale as gap; overridden by `paddingBlock` / `paddingInline` */
|
|
16
|
+
padding?: Responsive<StackPadding>;
|
|
17
|
+
/** Block-axis padding (overrides `padding` on block axis) */
|
|
18
|
+
paddingBlock?: Responsive<StackPadding>;
|
|
19
|
+
/** Inline-axis padding (overrides `padding` on inline axis) */
|
|
20
|
+
paddingInline?: Responsive<StackPadding>;
|
|
21
|
+
/** align-items — responsive supported */
|
|
22
|
+
align?: Responsive<CSSProperties["alignItems"]>;
|
|
23
|
+
/** justify-content — responsive supported */
|
|
24
|
+
justify?: Responsive<CSSProperties["justifyContent"]>;
|
|
25
|
+
/** Allow children to wrap — responsive supported */
|
|
26
|
+
wrap?: Responsive<boolean>;
|
|
27
|
+
theme?: CubeTheme;
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
className?: string;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Flex-based layout primitive. Replaces raw <div> usage for arranging
|
|
34
|
+
* children horizontally or vertically with consistent spacing.
|
|
35
|
+
*
|
|
36
|
+
* `gap` uses `none`, `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `xxl`.
|
|
37
|
+
* `padding`, `paddingBlock`, and `paddingInline` use the same stop names.
|
|
38
|
+
* Directional padding props override the matching axis from `padding`.
|
|
39
|
+
*
|
|
40
|
+
* Responsive: pass `{ sm, md, lg }` on layout props (mobile-first).
|
|
41
|
+
* `sm` = default; `md` / `lg` override at `--cube-breakpoint-md` / `--cube-breakpoint-lg`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function Stack({ as: As, direction, gap, padding, paddingBlock, paddingInline, align, justify, wrap, theme, style, className, children, }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Stack } from './Stack';
|
|
3
|
+
declare const meta: Meta<typeof Stack>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Stack>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const GapScale: Story;
|
|
8
|
+
export declare const PaddingScale: Story;
|
|
9
|
+
export declare const DirectionalPadding: Story;
|
|
10
|
+
export declare const Responsive: Story;
|
|
11
|
+
export declare const Vertical: Story;
|
|
12
|
+
export declare const Horizontal: Story;
|
|
13
|
+
export declare const SpaceBetween: Story;
|
|
14
|
+
export declare const WithPadding: Story;
|
|
15
|
+
export declare const Wrap: Story;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { CubeTheme, TextTokens } from '../../../theme/types';
|
|
3
|
+
export type TextVariant = keyof TextTokens;
|
|
4
|
+
/** Shorthand names for functional foreground tokens */
|
|
5
|
+
export type TextColor = "default" | "muted" | "onEmphasis" | "disabled" | "link" | "white" | "neutral";
|
|
6
|
+
export interface TextProps {
|
|
7
|
+
/** Override the default HTML element for this variant */
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
/** Maps to a named text style from the theme */
|
|
10
|
+
variant?: TextVariant;
|
|
11
|
+
/**
|
|
12
|
+
* Functional foreground color name, or any raw CSS color string.
|
|
13
|
+
* @example "muted" → theme.colors.functional.foreground.muted
|
|
14
|
+
* @example "#ff0000" → used as-is
|
|
15
|
+
*/
|
|
16
|
+
color?: TextColor | string;
|
|
17
|
+
align?: CSSProperties["textAlign"];
|
|
18
|
+
/** Truncate with ellipsis on a single line */
|
|
19
|
+
truncate?: boolean;
|
|
20
|
+
/** Override any theme tokens */
|
|
21
|
+
theme?: CubeTheme;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
className?: string;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Typography primitive. Styles come from generated theme CSS variables (`--cube-typography-text-*`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function Text({ as, variant, color, align, truncate, theme, style, className, children, }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Text } from './Text';
|
|
3
|
+
declare const meta: Meta<typeof Text>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Text>;
|
|
6
|
+
export declare const AllVariants: Story;
|
|
7
|
+
export declare const Colors: Story;
|
|
8
|
+
export declare const Truncate: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeTheme } from '../../../theme/types';
|
|
3
|
+
export type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
4
|
+
export interface TooltipProps {
|
|
5
|
+
/** Tooltip content (non-interactive label) */
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
/** Anchor element(s); must be a single React element that accepts event props */
|
|
8
|
+
children: React.ReactElement;
|
|
9
|
+
placement?: TooltipPlacement;
|
|
10
|
+
/** Single line + ellipsis + narrow max-width (Figma truncated variant) */
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
/** Milliseconds before showing after hover/focus */
|
|
13
|
+
showDelay?: number;
|
|
14
|
+
theme?: CubeTheme;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Tooltip({ content, children, placement, compact, showDelay, theme, className, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Tooltip } from './Tooltip';
|
|
3
|
+
declare const meta: Meta<typeof Tooltip>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Tooltip>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const LongText: Story;
|
|
8
|
+
export declare const WithIconButton: Story;
|
|
9
|
+
export declare const Placements: Story;
|
|
10
|
+
export declare const NotClippedByOverflow: Story;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { Stack } from './Stack';
|
|
2
|
+
export type { StackProps, StackGap, StackPadding, StackSpacing } from './Stack';
|
|
3
|
+
export { Text } from './Text';
|
|
4
|
+
export type { TextProps, TextVariant, TextColor } from './Text';
|
|
5
|
+
export { Button } from './Button';
|
|
6
|
+
export type { ButtonProps, ButtonShape, ButtonSize, ButtonVariant } from './Button';
|
|
7
|
+
export { IconButton } from './IconButton';
|
|
8
|
+
export type { IconButtonProps, IconButtonSize, IconButtonVariant } from './IconButton';
|
|
9
|
+
export { Tooltip } from './Tooltip';
|
|
10
|
+
export type { TooltipProps, TooltipPlacement } from './Tooltip';
|
|
11
|
+
export { Icon } from './Icon';
|
|
12
|
+
export type { IconProps, IconSize } from './Icon';
|
|
13
|
+
export { Link } from './Link';
|
|
14
|
+
export type { LinkProps, LinkVariant } from './Link';
|
|
15
|
+
export { Pill } from './Pill';
|
|
16
|
+
export type { PillProps, PillShade, PillIntensity, PillSurface } from './Pill';
|
|
17
|
+
export { BreadcrumbLink, Breadcrumbs } from './Breadcrumb';
|
|
18
|
+
export type { BreadcrumbLinkProps, BreadcrumbLinkState, BreadcrumbsProps, BreadcrumbItem, } from './Breadcrumb';
|
|
19
|
+
export { SiteHeader, SiteHeaderDivider } from './SiteHeader';
|
|
20
|
+
export type { SiteHeaderProps, SiteHeaderDividerProps } from './SiteHeader';
|
|
21
|
+
export { Overlay } from './Overlay';
|
|
22
|
+
export type { OverlayProps, OverlayVariant } from './Overlay';
|
|
23
|
+
export { Sheet } from './Sheet';
|
|
24
|
+
export type { SheetProps, SheetEdge, SheetRegionProps, SheetWidth, SheetWidthStop, } from './Sheet';
|
|
25
|
+
export { ResizeHandle } from './ResizeHandle';
|
|
26
|
+
export type { ResizeHandleProps, ResizeHandleOrientation, ResizeHandleEdge, } from './ResizeHandle';
|
|
27
|
+
export { Popover } from './Popover';
|
|
28
|
+
export type { PopoverProps, PopoverPlacement, PopoverElevation } from './Popover';
|
|
29
|
+
export { ActionMenu, ActionMenuItem, ActionMenuList } from './ActionMenu';
|
|
30
|
+
export type { ActionMenuProps, ActionMenuItemProps, ActionMenuListProps, ActionMenuListRegionProps, ActionMenuListSectionProps, } from './ActionMenu';
|
|
31
|
+
export { Sidebar, useSidebar } from './Sidebar';
|
|
32
|
+
export type { SidebarProps, SidebarEdge, SidebarRegionProps, SidebarToggleProps, SidebarWidth, SidebarWidthStop, } from './Sidebar';
|
|
33
|
+
export { SplitLayout } from './SplitLayout';
|
|
34
|
+
export type { SplitLayoutProps, SplitLayoutMainProps } from './SplitLayout';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as manifest } from './manifest.json';
|
|
2
|
+
export * from './material';
|
|
3
|
+
export { MATERIAL_ICON_STYLE, MATERIAL_ICON_WEIGHT } from './material/config';
|
|
4
|
+
export { manifest as iconManifest };
|
|
5
|
+
export type IconName = keyof typeof manifest;
|
|
6
|
+
export type IconManifestEntry = {
|
|
7
|
+
source: "material-rounded" | "custom";
|
|
8
|
+
export: string;
|
|
9
|
+
category: string;
|
|
10
|
+
style?: "rounded";
|
|
11
|
+
weight?: number;
|
|
12
|
+
path?: string;
|
|
13
|
+
};
|