@sragatiping/cuboid 0.1.0 → 0.1.4

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,11 @@
1
+ import { ThemeTokens } from './types';
2
+ /** Rebind functional surface tokens used by Box and similar primitives. */
3
+ export declare function functionalSurfaceCubeOverride(tokens: ThemeTokens): Record<string, string>;
4
+ /** Rebind stack gap/padding scale tokens. */
5
+ export declare function stackScaleCubeOverride(tokens: ThemeTokens): Record<string, string>;
6
+ /** Rebind code-block typography tokens used by CodeSurface. */
7
+ export declare function codeBlockTypographyCubeOverride(tokens: ThemeTokens): Record<string, string>;
8
+ /** Surface + syntax + typography overrides for CodeSurface local themes. */
9
+ export declare function codeSurfaceCubeOverride(tokens: ThemeTokens): Record<string, string>;
10
+ /** Rebind JSON syntax colours used by CodeSurface and JsonCodeView. */
11
+ export declare function syntaxColorsCubeOverride(tokens: ThemeTokens): Record<string, string>;
@@ -83,10 +83,14 @@ export interface SyntaxColors {
83
83
  markupChangedBg: string;
84
84
  markupChangedText: string;
85
85
  nullLiteral: string;
86
+ /** JSON / numeric literal values — not identifiers (`variable`). */
87
+ numberLiteral: string;
86
88
  /** Both true and false — purple by default. Not red/green: value has no inherent sentiment. */
87
89
  booleanLiteral: string;
88
- /** { } [ ] brackets and braces */
90
+ /** { } [ ] at nesting depth 0 */
89
91
  bracket: string;
92
+ /** { } [ ] at odd nesting depths (first level nested and below, alternating) */
93
+ bracketNested: string;
90
94
  /** String values that look like a URL */
91
95
  stringUrl: string;
92
96
  /** String values that look like an email address */
@@ -95,8 +99,18 @@ export interface SyntaxColors {
95
99
  stringUuid: string;
96
100
  /** Background tint applied to a row when the pointer hovers over it */
97
101
  rowHoverBg: string;
102
+ /** Background tint for a collapsed JSON node summary row */
103
+ collapsedRowBg: string;
104
+ /** Gutter watchlist marker dot when line is watched */
105
+ watchMark: string;
106
+ /** Gutter watchlist dot preview on row hover (before click) */
107
+ watchMarkHover: string;
108
+ /** Row background when line is on the watchlist */
109
+ watchRowBg: string;
98
110
  }
99
111
  /** Resolved palette from tokens/functional/colors/globals.json (color.* paths). */
112
+ export type { GlobalColorPath } from './globalColor';
113
+ export { resolveGlobalColor, resolveGlobalColorOrCss, GLOBAL_COLOR_PATH_EXAMPLES, } from './globalColor';
100
114
  export interface GlobalSemanticColorPair {
101
115
  default: string;
102
116
  muted: string;
@@ -294,21 +308,35 @@ export interface ActionMenuSizesTokens {
294
308
  export type PillSurface = "filled" | "bordered";
295
309
  /** Matches Figma Pill intensity property. */
296
310
  export type PillIntensity = "extralight" | "light" | "bold" | "extraBold";
311
+ export interface PillSurfaceColors {
312
+ bgColor: string;
313
+ fgColor: string;
314
+ borderColor: string;
315
+ }
297
316
  export interface PillIntensityColors {
298
- filled: ButtonVariantInteractiveColors;
299
- bordered: ButtonVariantInteractiveColors;
317
+ filled: PillSurfaceColors;
318
+ bordered: PillSurfaceColors;
300
319
  }
301
320
  /** Keys are shade names (`gray`, `yellow`, …) from token files under `components/pill/`. */
302
321
  export type PillFunctionalColors = Record<string, Record<PillIntensity, PillIntensityColors>>;
303
- export interface PillSizeStopTokens {
322
+ /** Chip geometry from `pill.json` (scales with inherited font size via em). */
323
+ export interface PillLayoutTokens {
304
324
  paddingInline: string;
305
325
  paddingBlock: string;
306
326
  borderRadius: string;
307
327
  gap: string;
308
328
  }
309
- export interface PillSizesTokens {
310
- sm: PillSizeStopTokens;
311
- md: PillSizeStopTokens;
329
+ export interface HighlightColorRecipe {
330
+ bgColor: string;
331
+ fgColor: string;
332
+ }
333
+ /** Shade keys from Figma `HighlightedText` — `none` is plain muted text without a tint. */
334
+ export type HighlightColor = "none" | "neutral" | "green" | "blue" | "yellow" | "orange" | "red";
335
+ export type HighlightFunctionalColors = Record<HighlightColor, HighlightColorRecipe>;
336
+ export interface HighlightSizesTokens {
337
+ paddingInline: string;
338
+ paddingBlock: string;
339
+ borderRadius: string;
312
340
  }
313
341
  export interface FunctionalColors {
314
342
  background: BackgroundColors;
@@ -319,6 +347,7 @@ export interface FunctionalColors {
319
347
  button: ButtonFunctionalColors;
320
348
  iconButton: IconButtonFunctionalColors;
321
349
  link: LinkFunctionalColors;
350
+ highlight: HighlightFunctionalColors;
322
351
  breadcrumb: BreadcrumbFunctionalColors;
323
352
  siteHeader: SiteHeaderFunctionalColors;
324
353
  overlay: OverlayFunctionalColors;
@@ -387,16 +416,6 @@ export interface ButtonTypography {
387
416
  medium: ButtonTypographyStop;
388
417
  large: ButtonTypographyStop;
389
418
  }
390
- /** Pill label metrics per size stop (from typography tokens). */
391
- export interface PillTypographyStop {
392
- fontSize: string;
393
- lineHeight: string;
394
- fontWeight: number;
395
- }
396
- export interface PillTypography {
397
- sm: PillTypographyStop;
398
- md: PillTypographyStop;
399
- }
400
419
  export interface Typography {
401
420
  fontFamily: FontFamilyTokens;
402
421
  fontSize: FontSizeTokens;
@@ -404,7 +423,6 @@ export interface Typography {
404
423
  lineHeight: LineHeightTokens;
405
424
  text: TextTokens;
406
425
  button: ButtonTypography;
407
- pill: PillTypography;
408
426
  }
409
427
  export interface SpaceTokens {
410
428
  1: string;
@@ -566,6 +584,29 @@ export interface SidebarSizesTokens {
566
584
  padding: string;
567
585
  footerPadding: string;
568
586
  }
587
+ export interface LayoutTokens {
588
+ pageMaxWidth: string;
589
+ contentMaxWidth: string;
590
+ sectionLabelWidth: string;
591
+ pagePaddingInline: string;
592
+ }
593
+ /** Shared panel widths for sheet, sidebar, and similar overlays (from size/container.json). */
594
+ export interface ContainerSizesTokens {
595
+ panelMinWidth: string;
596
+ sheetWidthSm: string;
597
+ sheetWidthMd: string;
598
+ sheetWidthLg: string;
599
+ sidebarWidthSm: string;
600
+ sidebarWidthMd: string;
601
+ sidebarWidthLg: string;
602
+ sidebarMinWidth: string;
603
+ sidebarMaxWidth: string;
604
+ tooltipMaxWidth: string;
605
+ tooltipMaxWidthSingleLine: string;
606
+ popoverMinWidth: string;
607
+ popoverMaxWidth: string;
608
+ }
609
+ export type LayoutWidth = "label" | "page" | "content" | "full" | "auto";
569
610
  export interface ResizeHandleSizesTokens {
570
611
  hitArea: string;
571
612
  }
@@ -573,6 +614,7 @@ export interface ShadowTokens {
573
614
  popover: string;
574
615
  popoverElevated: string;
575
616
  sheet: string;
617
+ tooltip: string;
576
618
  }
577
619
  export interface Sizes {
578
620
  space: SpaceTokens;
@@ -580,12 +622,15 @@ export interface Sizes {
580
622
  gap: StackGapTokens;
581
623
  padding: StackPaddingTokens;
582
624
  };
625
+ layout: LayoutTokens;
626
+ container: ContainerSizesTokens;
627
+ highlight: HighlightSizesTokens;
583
628
  borderRadius: BorderRadiusTokens;
584
629
  borderWidth: BorderWidthTokens;
585
630
  breakpoints: BreakpointTokens;
586
631
  control: ControlSizesTokens;
587
632
  tooltip: TooltipLayoutTokens;
588
- pill: PillSizesTokens;
633
+ pill: PillLayoutTokens;
589
634
  iconButton: IconButtonSizesTokens;
590
635
  breadcrumb: BreadcrumbSizesTokens;
591
636
  siteHeader: SiteHeaderSizesTokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sragatiping/cuboid",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "Cube — React components and design tokens for data views, tables, and themed UI.",
5
5
  "keywords": [
6
6
  "react",
@@ -20,10 +20,15 @@
20
20
  "import": "./dist/index.es.js",
21
21
  "require": "./dist/index.cjs.js",
22
22
  "types": "./dist/index.d.ts"
23
- }
23
+ },
24
+ "./style.css": "./dist/style.css",
25
+ "./theme.css": "./src/theme/output/theme.css",
26
+ "./components.css": "./src/theme/output/components.css"
24
27
  },
25
28
  "files": [
26
- "dist"
29
+ "dist",
30
+ "src/theme/output/theme.css",
31
+ "src/theme/output/components.css"
27
32
  ],
28
33
  "scripts": {
29
34
  "dev": "vite",
@@ -40,7 +45,7 @@
40
45
  "tokens:functional-typography": "node scripts/flatten-functional-typography.mjs",
41
46
  "tokens:typography-theme": "node scripts/build-typography-theme.mjs",
42
47
  "pretokens:theme": "node scripts/build-typography-theme.mjs",
43
- "tokens:theme": "node scripts/build-theme.mjs && node scripts/build-theme-css.mjs",
48
+ "tokens:theme": "node scripts/build-theme.mjs && node scripts/build-theme-css.mjs && node scripts/build-component-theme-css.mjs",
44
49
  "prebuild": "npm run tokens:theme"
45
50
  },
46
51
  "peerDependencies": {