@sragatiping/cuboid 0.1.0 → 0.1.3

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.
Files changed (67) hide show
  1. package/dist/components/ApiResponseViewer/ApiResponseViewer.d.ts +24 -0
  2. package/dist/components/ApiResponseViewer/ApiResponseViewer.stories.d.ts +13 -0
  3. package/dist/components/ApiResponseViewer/index.d.ts +3 -0
  4. package/dist/components/ApiResponseViewer/status.d.ts +8 -0
  5. package/dist/components/CodeBlock/CodeBlock.d.ts +18 -0
  6. package/dist/components/CodeBlock/CodeBlock.stories.d.ts +12 -0
  7. package/dist/components/CodeBlock/CodeSurface.d.ts +48 -0
  8. package/dist/components/CodeBlock/CodeSurface.stories.d.ts +15 -0
  9. package/dist/components/CodeBlock/CodeViewingDocs.d.ts +7 -0
  10. package/dist/components/CodeBlock/JsonCodeView.d.ts +17 -0
  11. package/dist/components/CodeBlock/JsonCodeView.stories.d.ts +19 -0
  12. package/dist/components/CodeBlock/__fixtures__/dev-server-diagnostics.d.ts +145 -0
  13. package/dist/components/CodeBlock/__fixtures__/source-samples.d.ts +10 -0
  14. package/dist/components/CodeBlock/constants.d.ts +11 -0
  15. package/dist/components/CodeBlock/highlight/css.d.ts +1 -0
  16. package/dist/components/CodeBlock/highlight/html.d.ts +1 -0
  17. package/dist/components/CodeBlock/highlight/index.d.ts +5 -0
  18. package/dist/components/CodeBlock/highlight/javascript.d.ts +5 -0
  19. package/dist/components/CodeBlock/highlight/shared.d.ts +15 -0
  20. package/dist/components/CodeBlock/index.d.ts +14 -0
  21. package/dist/components/CodeBlock/syntax.d.ts +37 -0
  22. package/dist/components/{CodeSnippet → CodeBlock}/tokenizer.d.ts +0 -5
  23. package/dist/components/CodeBlock/types.d.ts +27 -0
  24. package/dist/components/CodeSnippet/CodeSnippet.d.ts +9 -50
  25. package/dist/components/JsonViewer/JsonViewer.d.ts +1 -1
  26. package/dist/components/core/Box/Box.d.ts +24 -0
  27. package/dist/components/core/Box/Box.stories.d.ts +9 -0
  28. package/dist/components/core/Box/boxTypes.d.ts +6 -0
  29. package/dist/components/core/Box/index.d.ts +2 -0
  30. package/dist/components/core/Callout/Callout.d.ts +17 -0
  31. package/dist/components/core/Callout/Callout.stories.d.ts +10 -0
  32. package/dist/components/core/Callout/index.d.ts +2 -0
  33. package/dist/components/core/Container/Container.d.ts +23 -0
  34. package/dist/components/core/Container/Container.stories.d.ts +10 -0
  35. package/dist/components/core/Container/index.d.ts +2 -0
  36. package/dist/components/core/Divider/Divider.d.ts +17 -0
  37. package/dist/components/core/Divider/Divider.stories.d.ts +9 -0
  38. package/dist/components/core/Divider/index.d.ts +2 -0
  39. package/dist/components/core/Highlight/Highlight.d.ts +16 -0
  40. package/dist/components/core/Highlight/Highlight.stories.d.ts +8 -0
  41. package/dist/components/core/Highlight/index.d.ts +2 -0
  42. package/dist/components/core/Link/Link.d.ts +10 -5
  43. package/dist/components/core/Pill/Pill.d.ts +12 -6
  44. package/dist/components/core/Pill/Pill.stories.d.ts +3 -0
  45. package/dist/components/core/Pill/index.d.ts +1 -1
  46. package/dist/components/core/Popover/Popover.d.ts +1 -1
  47. package/dist/components/core/Stack/Stack.d.ts +12 -21
  48. package/dist/components/core/Stack/index.d.ts +1 -1
  49. package/dist/components/core/Text/Text.d.ts +7 -7
  50. package/dist/components/core/index.d.ts +11 -1
  51. package/dist/index.cjs.js +7 -6
  52. package/dist/index.cjs.js.map +1 -1
  53. package/dist/index.d.ts +20 -3
  54. package/dist/index.es.js +4029 -3342
  55. package/dist/index.es.js.map +1 -1
  56. package/dist/style.css +1 -1
  57. package/dist/theme/globalColor.d.ts +25 -0
  58. package/dist/theme/output/base.json.d.ts +28 -56
  59. package/dist/theme/output/theme.json.d.ts +579 -1016
  60. package/dist/theme/themeCubeOverride.d.ts +11 -0
  61. package/dist/theme/types.d.ts +64 -19
  62. package/package.json +9 -4
  63. package/src/theme/output/components.css +1945 -0
  64. package/src/theme/output/theme.css +247 -0
  65. package/dist/components/CodeSnippet/CodeSnippet.stories.d.ts +0 -17
  66. package/dist/components/CodeSnippet/__fixtures__/device-profile-report.d.ts +0 -422
  67. package/dist/components/JsonGraph/DeviceProfileReport.stories.d.ts +0 -11
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Callout } from './Callout';
3
+ declare const meta: Meta<typeof Callout>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Callout>;
6
+ export declare const Default: Story;
7
+ export declare const InProse: Story;
8
+ export declare const Multiline: Story;
9
+ export declare const MutedSurface: Story;
10
+ export declare const Playground: Story;
@@ -0,0 +1,2 @@
1
+ export { Callout } from './Callout';
2
+ export type { CalloutProps, CalloutBackground } from './Callout';
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { CubeTheme, LayoutWidth, StackPadding } from '../../../theme/types';
3
+ export type ContainerWidth = Extract<LayoutWidth, "page" | "content" | "full">;
4
+ export interface ContainerProps {
5
+ as?: React.ElementType;
6
+ /** Max content width — `page` (site shell) or `content` (reading column). */
7
+ width?: ContainerWidth;
8
+ /** Center horizontally with `margin-inline: auto`. Default true. */
9
+ center?: boolean;
10
+ /** Inline padding — defaults to layout `pagePaddingInline` token. */
11
+ paddingInline?: StackPadding | false;
12
+ /** Minimum block size — `screen` sets `min-height: 100svh`. */
13
+ minHeight?: "screen";
14
+ theme?: CubeTheme;
15
+ className?: string;
16
+ style?: React.CSSProperties;
17
+ children?: React.ReactNode;
18
+ }
19
+ /**
20
+ * Page shell — max-width, horizontal padding, and optional vertical fill.
21
+ * Replaces ad-hoc `#root` / layout wrapper CSS in consuming apps.
22
+ */
23
+ export declare function Container({ as, width, center, paddingInline, minHeight, theme, className, style, children, }: ContainerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Container } from './Container';
3
+ declare const meta: Meta<typeof Container>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Container>;
6
+ export declare const PageWidth: Story;
7
+ export declare const ContentWidth: Story;
8
+ export declare const FullWidth: Story;
9
+ export declare const MinHeightScreen: Story;
10
+ export declare const Playground: Story;
@@ -0,0 +1,2 @@
1
+ export { Container } from './Container';
2
+ export type { ContainerProps, ContainerWidth } from './Container';
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { CubeTheme, GlobalColorPath } from '../../../theme/types';
3
+ export type DividerColor = GlobalColorPath;
4
+ export interface DividerProps {
5
+ /** Horizontal rule spanning the container width (default). */
6
+ orientation?: "horizontal";
7
+ /**
8
+ * Line color from `colors.global`, or any CSS color string.
9
+ * @default "border.gray.2"
10
+ */
11
+ color?: DividerColor;
12
+ theme?: CubeTheme;
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ }
16
+ /** Horizontal separator using global border tokens. */
17
+ export declare function Divider({ orientation, color, theme, className, style, }: DividerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Divider } from './Divider';
3
+ declare const meta: Meta<typeof Divider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Divider>;
6
+ export declare const Default: Story;
7
+ export declare const Muted: Story;
8
+ export declare const ListRows: Story;
9
+ export declare const Playground: Story;
@@ -0,0 +1,2 @@
1
+ export { Divider } from './Divider';
2
+ export type { DividerProps, DividerColor } from './Divider';
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { CubeTheme, HighlightColor } from '../../../theme/types';
3
+ export type { HighlightColor };
4
+ export interface HighlightProps {
5
+ /** Background tint — maps to Figma `HighlightedText` `color`. Default `yellow`. */
6
+ color?: HighlightColor;
7
+ theme?: CubeTheme;
8
+ className?: string;
9
+ style?: React.CSSProperties;
10
+ children?: React.ReactNode;
11
+ }
12
+ /**
13
+ * Inline marker emphasis inside body copy. Renders semantic `<mark>` and inherits
14
+ * surrounding font metrics — pair with {@link Text} `variant="bodyMedium"`.
15
+ */
16
+ export declare function Highlight({ color, theme, className, style, children, }: HighlightProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Highlight } from './Highlight';
3
+ declare const meta: Meta<typeof Highlight>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Highlight>;
6
+ export declare const Default: Story;
7
+ export declare const AllColors: Story;
8
+ export declare const InSentence: Story;
@@ -0,0 +1,2 @@
1
+ export { Highlight } from './Highlight';
2
+ export type { HighlightProps, HighlightColor } from './Highlight';
@@ -1,11 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  import { CubeTheme, LinkFunctionalColors } from '../../../theme/types';
3
- export type LinkVariant = keyof LinkFunctionalColors;
4
- export interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "children"> {
5
- href: string;
3
+ export type LinkVariant = keyof LinkFunctionalColors | "inherit";
4
+ type LinkOwnProps = {
6
5
  /**
7
6
  * `inline` — inside body copy; inherits font from parent.
8
7
  * `standalone` — nav, footer, contact rows.
8
+ * `inherit` — composition wrapper (e.g. pill links); no underline, inherits color.
9
9
  */
10
10
  variant?: LinkVariant;
11
11
  /** Opens in a new tab with `rel="noopener noreferrer"`. */
@@ -13,6 +13,11 @@ export interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorEle
13
13
  /** Show ↗ icon when `external` (default true). */
14
14
  showExternalIcon?: boolean;
15
15
  theme?: CubeTheme;
16
+ className?: string;
16
17
  children: React.ReactNode;
17
- }
18
- export declare function Link({ href, variant, external, showExternalIcon, theme, children, className, target, rel, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
18
+ };
19
+ export type LinkProps<E extends React.ElementType = "a"> = LinkOwnProps & Omit<React.ComponentPropsWithoutRef<E>, keyof LinkOwnProps | "as"> & {
20
+ as?: E;
21
+ };
22
+ export declare function Link<E extends React.ElementType = "a">({ as, href, variant, external, showExternalIcon, theme, children, className, target, rel, style, ...rest }: LinkProps<E>): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -1,10 +1,10 @@
1
1
  import { default as React } from 'react';
2
- import { CubeTheme, PillIntensity, PillSurface, ThemeTokens } from '../../../theme/types';
2
+ import { CubeTheme, PillIntensity, PillSurface, TextTokens } from '../../../theme/types';
3
3
  import { default as themeOutput } from '../../../theme/output/theme.json';
4
4
  /** Shade keys from `pillColors` in theme.json — add `yellow.json`, etc. alongside `gray.json`. */
5
5
  export type PillShade = keyof typeof themeOutput.pillColors;
6
+ export type PillTextVariant = keyof TextTokens;
6
7
  export type { PillIntensity, PillSurface };
7
- type PillElement = "span" | "a";
8
8
  export interface PillProps {
9
9
  /** Color family — maps to Figma `shade` (token file per shade). */
10
10
  shade?: PillShade;
@@ -12,14 +12,20 @@ export interface PillProps {
12
12
  intensity?: PillIntensity;
13
13
  /** When true, uses the `bordered` surface recipe (Figma `border?`). */
14
14
  border?: boolean;
15
- /** Render as static label (`span`) or link (`a` when `href` is set). */
16
- as?: PillElement;
15
+ /**
16
+ * Text size — defaults to `bodySmall` (12px). Override when the pill should match
17
+ * a different `Text` variant.
18
+ */
19
+ variant?: PillTextVariant;
20
+ /** Render as static label, anchor, or a custom component (e.g. react-router `Link`). */
21
+ as?: React.ElementType;
17
22
  href?: string;
18
- size?: keyof ThemeTokens["sizes"]["pill"];
19
23
  leadingVisual?: React.ReactNode;
20
24
  trailingVisual?: React.ReactNode;
25
+ /** Override chip geometry (`sizes.pill`) or colors for this instance. */
21
26
  theme?: CubeTheme;
22
27
  className?: string;
23
28
  children?: React.ReactNode;
24
29
  }
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;
30
+ /** Static chip / tag not a button; colors do not change on hover. */
31
+ export declare function Pill({ shade, intensity, border, variant, as, href, leadingVisual, trailingVisual, theme, className, children, style, ...rest }: PillProps & Omit<React.HTMLAttributes<HTMLElement>, "children">): import("react/jsx-runtime").JSX.Element;
@@ -4,3 +4,6 @@ declare const meta: Meta<typeof Pill>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Pill>;
6
6
  export declare const Playground: Story;
7
+ export declare const AllVariantsFilled: Story;
8
+ export declare const AllVariantsBordered: Story;
9
+ export declare const WithBodyMedium: Story;
@@ -1,3 +1,3 @@
1
1
  export { Pill } from './Pill';
2
- export type { PillProps, PillShade } from './Pill';
2
+ export type { PillProps, PillShade, PillTextVariant } from './Pill';
3
3
  export type { PillIntensity, PillSurface } from '../../../theme/types';
@@ -8,7 +8,7 @@ export interface PopoverProps {
8
8
  /** When omitted, open state is managed internally (toggle on trigger click). */
9
9
  open?: boolean;
10
10
  onOpenChange?: (open: boolean) => void;
11
- /** Anchor elementmust be a single React element that accepts event props. */
11
+ /** Anchor controlpositioned relative to Popover’s wrapper, not the child ref. */
12
12
  trigger: React.ReactElement;
13
13
  /** Panel content — menus, forms, or any interactive UI. */
14
14
  children: React.ReactNode;
@@ -1,43 +1,34 @@
1
1
  import { default as React, CSSProperties } from 'react';
2
- import { CubeTheme, StackGap, StackPadding } from '../../../theme/types';
2
+ import { CubeTheme, LayoutWidth, StackGap, StackPadding } from '../../../theme/types';
3
3
  import { Responsive } from '../../../utils/responsive';
4
4
  export type StackDirection = "horizontal" | "vertical";
5
- export type { StackGap, StackPadding };
5
+ export type { StackGap, StackPadding, LayoutWidth };
6
6
  /** @deprecated Use `StackGap` or `StackPadding`. */
7
7
  export type { StackGap as StackSpacing };
8
- export interface StackProps {
9
- /** HTML element or component to render as (default: div) */
8
+ export interface StackProps extends Omit<React.HTMLAttributes<HTMLElement>, "color"> {
10
9
  as?: React.ElementType;
11
- /** Flex direction — scalar or `{ sm, md, lg }` for responsive layout */
12
10
  direction?: Responsive<StackDirection>;
13
- /** Gap between children — `none`, `xxs` … `xxl`; responsive supported */
14
11
  gap?: Responsive<StackGap>;
15
- /** Padding on all sides — same scale as gap; overridden by `paddingBlock` / `paddingInline` */
16
12
  padding?: Responsive<StackPadding>;
17
- /** Block-axis padding (overrides `padding` on block axis) */
18
13
  paddingBlock?: Responsive<StackPadding>;
19
- /** Inline-axis padding (overrides `padding` on inline axis) */
20
14
  paddingInline?: Responsive<StackPadding>;
21
- /** align-items — responsive supported */
22
15
  align?: Responsive<CSSProperties["alignItems"]>;
23
- /** justify-content — responsive supported */
24
16
  justify?: Responsive<CSSProperties["justifyContent"]>;
25
- /** Allow children to wrap — responsive supported */
26
17
  wrap?: Responsive<boolean>;
18
+ grow?: boolean | number;
19
+ shrink?: boolean | number;
20
+ width?: LayoutWidth;
21
+ minWidth?: 0;
27
22
  theme?: CubeTheme;
28
23
  style?: CSSProperties;
29
24
  className?: string;
30
25
  children?: React.ReactNode;
31
26
  }
32
27
  /**
33
- * Flex-based layout primitive. Replaces raw <div> usage for arranging
34
- * children horizontally or vertically with consistent spacing.
28
+ * Flex-based layout primitive. Scalar layout props map to CSS module modifiers
29
+ * that read global `--cube-stack-*` tokens (same pattern as {@link Button}).
35
30
  *
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`.
31
+ * Responsive object props (`{ sm, md, lg }`) still set per-tier `--stack-*` vars
32
+ * on the element. Local `theme` overrides re-bind `--cube-stack-*` scale tokens.
42
33
  */
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;
34
+ export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
@@ -1,3 +1,3 @@
1
1
  export { Stack } from './Stack';
2
- export type { StackProps, StackDirection, StackGap, StackPadding, StackSpacing } from './Stack';
2
+ export type { StackProps, StackDirection, StackGap, StackPadding, StackSpacing, LayoutWidth, } from './Stack';
3
3
  export type { Breakpoint, Responsive } from '../../../utils/responsive';
@@ -1,19 +1,19 @@
1
1
  import { default as React, CSSProperties } from 'react';
2
- import { CubeTheme, TextTokens } from '../../../theme/types';
2
+ import { CubeTheme, GlobalColorPath, TextTokens } from '../../../theme/types';
3
3
  export type TextVariant = keyof TextTokens;
4
- /** Shorthand names for functional foreground tokens */
5
- export type TextColor = "default" | "muted" | "onEmphasis" | "disabled" | "link" | "white" | "neutral";
4
+ /** @deprecated Use global paths e.g. `text.muted` instead of `"muted"`. */
5
+ export type TextColor = GlobalColorPath;
6
6
  export interface TextProps {
7
7
  /** Override the default HTML element for this variant */
8
8
  as?: React.ElementType;
9
9
  /** Maps to a named text style from the theme */
10
10
  variant?: TextVariant;
11
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
12
+ * Color from `colors.global` (dot-path), or any raw CSS color string.
13
+ * @default "fg.neutral.muted"
14
+ * @example "text.muted" | "fg.blue.contrast" | "#ff0000"
15
15
  */
16
- color?: TextColor | string;
16
+ color?: GlobalColorPath;
17
17
  align?: CSSProperties["textAlign"];
18
18
  /** Truncate with ellipsis on a single line */
19
19
  truncate?: boolean;
@@ -1,5 +1,15 @@
1
1
  export { Stack } from './Stack';
2
- export type { StackProps, StackGap, StackPadding, StackSpacing } from './Stack';
2
+ export type { StackProps, StackGap, StackPadding, StackSpacing, LayoutWidth } from './Stack';
3
+ export { Container } from './Container';
4
+ export type { ContainerProps, ContainerWidth } from './Container';
5
+ export { Box } from './Box';
6
+ export type { BoxProps, BoxBackground, BoxBorder, BoxBorderRadius, BoxForeground, BoxOverflow, } from './Box';
7
+ export { Divider } from './Divider';
8
+ export type { DividerProps, DividerColor } from './Divider';
9
+ export { Callout } from './Callout';
10
+ export type { CalloutProps } from './Callout';
11
+ export { Highlight } from './Highlight';
12
+ export type { HighlightProps, HighlightColor } from './Highlight';
3
13
  export { Text } from './Text';
4
14
  export type { TextProps, TextVariant, TextColor } from './Text';
5
15
  export { Button } from './Button';