@lostgradient/cinder 0.12.0 → 0.13.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/components.json +9 -6
  3. package/dist/components/accordion/index.js +14 -11
  4. package/dist/components/accordion-item/accordion-item.css +20 -7
  5. package/dist/components/accordion-item/accordion-item.schema.js +5 -1
  6. package/dist/components/accordion-item/accordion-item.types.d.ts +4 -0
  7. package/dist/components/accordion-item/accordion-item.variables.js +13 -2
  8. package/dist/components/accordion-item/index.js +14 -11
  9. package/dist/components/action-row/action-row.css +20 -9
  10. package/dist/components/action-row/action-row.schema.js +5 -1
  11. package/dist/components/action-row/action-row.types.d.ts +43 -0
  12. package/dist/components/action-row/action-row.variables.js +12 -2
  13. package/dist/components/chat/chat.svelte.d.ts +1 -0
  14. package/dist/components/diff-viewer/index.js +201 -101
  15. package/dist/components/json-schema-editor/index.js +229 -129
  16. package/dist/components/markdown-editor/index.js +207 -107
  17. package/dist/components/review-editor/index.js +291 -191
  18. package/dist/components/schedule-builder/index.js +205 -105
  19. package/dist/components/segment/index.js +119 -56
  20. package/dist/components/segment/segment.schema.d.ts +2 -2
  21. package/dist/components/segment/segment.schema.js +71 -33
  22. package/dist/components/segment/segment.svelte.d.ts +2 -1
  23. package/dist/components/segment/segment.types.d.ts +67 -10
  24. package/dist/components/segmented-control/index.js +193 -93
  25. package/dist/components/segmented-control/segmented-control-state.svelte.d.ts +4 -4
  26. package/dist/components/segmented-control/segmented-control.css +26 -6
  27. package/dist/components/segmented-control/segmented-control.schema.js +3 -3
  28. package/dist/components/segmented-control/segmented-control.svelte.d.ts +2 -1
  29. package/dist/components/segmented-control/segmented-control.types.d.ts +4 -4
  30. package/dist/components/side-navigation/side-navigation.css +2 -1
  31. package/dist/components/side-navigation/side-navigation.schema.js +9 -6
  32. package/dist/components/side-navigation/side-navigation.types.d.ts +11 -0
  33. package/dist/components/side-navigation/side-navigation.variables.js +2 -2
  34. package/dist/components/sidebar/index.d.ts +1 -0
  35. package/dist/components/sidebar/index.js +9 -3
  36. package/dist/components/sidebar/sidebar.constants.d.ts +12 -0
  37. package/dist/components/stat/stat.css +16 -8
  38. package/dist/components/stat/stat.schema.js +5 -1
  39. package/dist/components/stat/stat.types.d.ts +19 -0
  40. package/dist/components/stat/stat.variables.js +11 -2
  41. package/dist/components/stat-group/stat-group.css +7 -4
  42. package/dist/components/stat-group/stat-group.schema.js +5 -1
  43. package/dist/components/stat-group/stat-group.types.d.ts +27 -0
  44. package/dist/components/stat-group/stat-group.variables.js +6 -2
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +479 -368
  47. package/dist/server/components/accordion/index.js +2 -2
  48. package/dist/server/components/accordion-item/index.js +2 -2
  49. package/dist/server/components/diff-viewer/index.js +4 -4
  50. package/dist/server/components/json-schema-editor/index.js +4 -4
  51. package/dist/server/components/markdown-editor/index.js +3 -3
  52. package/dist/server/components/review-editor/index.js +4 -4
  53. package/dist/server/components/schedule-builder/index.js +3 -3
  54. package/dist/server/components/segment/index.js +2 -2
  55. package/dist/server/components/segmented-control/index.js +3 -3
  56. package/dist/server/components/sidebar/index.js +7 -3
  57. package/dist/server/index.js +19 -13
  58. package/dist/server/{index.server-cf6pxeyg.js → index.server-0rzd71e0.js} +1 -1
  59. package/dist/server/{index.server-jgb8yh5k.js → index.server-2m1kenak.js} +1 -1
  60. package/dist/server/{index.server-jfrssta6.js → index.server-ck3fwrab.js} +1 -1
  61. package/dist/server/{index.server-sedjxt36.js → index.server-e89qfamd.js} +79 -35
  62. package/dist/server/{index.server-pag862vz.js → index.server-grgv455a.js} +2 -2
  63. package/dist/server/{index.server-y83kqayt.js → index.server-h3nzp8g8.js} +1 -1
  64. package/dist/server/{index.server-2qj6s2mh.js → index.server-j570vb03.js} +7 -3
  65. package/dist/server/index.server-jwvxxjvc.js +50 -0
  66. package/dist/server/{index.server-xeqtpv61.js → index.server-mr68brd6.js} +49 -24
  67. package/dist/server/{index.server-qbkxz7r2.js → index.server-nx9c2ep1.js} +2 -2
  68. package/dist/server/{index.server-jj76374p.js → index.server-p071e531.js} +1 -1
  69. package/dist/server/{index.server-5gzyqv78.js → index.server-v3arexq8.js} +2 -2
  70. package/dist/server/{index.server-85p4ydph.js → index.server-zzd5wpbw.js} +1 -1
  71. package/package.json +1 -1
  72. package/src/components/accordion/accordion.examples.json +6 -0
  73. package/src/components/accordion-item/accordion-item.css +20 -7
  74. package/src/components/accordion-item/accordion-item.schema.json +4 -0
  75. package/src/components/accordion-item/accordion-item.schema.ts +4 -0
  76. package/src/components/accordion-item/accordion-item.svelte +9 -7
  77. package/src/components/accordion-item/accordion-item.types.ts +4 -0
  78. package/src/components/accordion-item/accordion-item.variables.json +12 -1
  79. package/src/components/accordion-item/accordion-item.variables.ts +12 -1
  80. package/src/components/action-row/action-row.css +20 -9
  81. package/src/components/action-row/action-row.examples.json +6 -0
  82. package/src/components/action-row/action-row.schema.json +4 -0
  83. package/src/components/action-row/action-row.schema.ts +4 -0
  84. package/src/components/action-row/action-row.types.ts +44 -0
  85. package/src/components/action-row/action-row.variables.json +11 -1
  86. package/src/components/action-row/action-row.variables.ts +11 -1
  87. package/src/components/chat/chat.examples.json +6 -0
  88. package/src/components/segment/segment.schema.json +34 -7
  89. package/src/components/segment/segment.schema.ts +5 -47
  90. package/src/components/segment/segment.svelte +58 -23
  91. package/src/components/segment/segment.types.ts +81 -11
  92. package/src/components/segmented-control/segmented-control.css +26 -6
  93. package/src/components/segmented-control/segmented-control.examples.json +6 -0
  94. package/src/components/segmented-control/segmented-control.schema.json +2 -2
  95. package/src/components/segmented-control/segmented-control.schema.ts +2 -2
  96. package/src/components/segmented-control/segmented-control.svelte +50 -23
  97. package/src/components/segmented-control/segmented-control.types.ts +4 -7
  98. package/src/components/side-navigation/side-navigation.css +2 -1
  99. package/src/components/side-navigation/side-navigation.examples.json +6 -0
  100. package/src/components/side-navigation/side-navigation.schema.json +8 -5
  101. package/src/components/side-navigation/side-navigation.schema.ts +8 -5
  102. package/src/components/side-navigation/side-navigation.types.ts +12 -0
  103. package/src/components/side-navigation/side-navigation.variables.json +1 -1
  104. package/src/components/side-navigation/side-navigation.variables.ts +1 -1
  105. package/src/components/sidebar/index.ts +1 -0
  106. package/src/components/sidebar/sidebar.constants.ts +13 -0
  107. package/src/components/sidebar/sidebar.examples.json +6 -0
  108. package/src/components/sidebar/sidebar.svelte +4 -5
  109. package/src/components/stat/stat.css +16 -8
  110. package/src/components/stat/stat.schema.json +4 -0
  111. package/src/components/stat/stat.schema.ts +4 -0
  112. package/src/components/stat/stat.types.ts +20 -0
  113. package/src/components/stat/stat.variables.json +10 -1
  114. package/src/components/stat/stat.variables.ts +10 -1
  115. package/src/components/stat-group/stat-group.css +7 -4
  116. package/src/components/stat-group/stat-group.examples.json +6 -0
  117. package/src/components/stat-group/stat-group.schema.json +4 -0
  118. package/src/components/stat-group/stat-group.schema.ts +4 -0
  119. package/src/components/stat-group/stat-group.types.ts +28 -0
  120. package/src/components/stat-group/stat-group.variables.json +5 -1
  121. package/src/components/stat-group/stat-group.variables.ts +5 -1
  122. package/src/index.ts +5 -1
  123. package/src/styles/foundation.css +2 -1
  124. package/dist/server/index.server-hfx487zj.js +0 -42
@@ -973,6 +973,10 @@ function Drawer($$anchor, $$props) {
973
973
  }
974
974
  $5.delegate(["click"]);
975
975
 
976
+ // src/components/sidebar/sidebar.constants.ts
977
+ var SIDEBAR_MOBILE_BREAKPOINT = "47.99rem";
978
+ var SIDEBAR_MOBILE_MEDIA_QUERY = `(max-width: ${SIDEBAR_MOBILE_BREAKPOINT})`;
979
+
976
980
  // src/components/sidebar/sidebar.svelte
977
981
  var rest_excludes3 = new Set([
978
982
  "$$slots",
@@ -1055,7 +1059,7 @@ function Sidebar($$anchor, $$props) {
1055
1059
  const navigationLabel = $6.derived(() => `${$6.get(validatedLabel)} navigation`);
1056
1060
  const hasMatchMedia = typeof window !== "undefined" && typeof window.matchMedia === "function";
1057
1061
  const usesSsrResponsiveFallback = !hasMatchMedia;
1058
- const mobile = hasMatchMedia ? new MediaQuery2("(max-width: 47.99rem)", false) : { current: false };
1062
+ const mobile = hasMatchMedia ? new MediaQuery2(SIDEBAR_MOBILE_MEDIA_QUERY, false) : { current: false };
1059
1063
  const context = {
1060
1064
  get collapsed() {
1061
1065
  return collapsed();
@@ -1130,7 +1134,9 @@ function Sidebar($$anchor, $$props) {
1130
1134
  var sidebar_default = Sidebar;
1131
1135
  export {
1132
1136
  sidebar_default as default,
1133
- Sidebar
1137
+ Sidebar,
1138
+ SIDEBAR_MOBILE_MEDIA_QUERY,
1139
+ SIDEBAR_MOBILE_BREAKPOINT
1134
1140
  };
1135
1141
 
1136
- //# debugId=13D61E15EB9EC3BE64756E2164756E21
1142
+ //# debugId=F22F69D3515A029C64756E2164756E21
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Viewport width below which Sidebar uses its mobile drawer behavior.
3
+ *
4
+ * Consumers with app chrome outside the Sidebar can import this value instead
5
+ * of duplicating the component's internal breakpoint.
6
+ */
7
+ export declare const SIDEBAR_MOBILE_BREAKPOINT = "47.99rem";
8
+ /**
9
+ * Fully parenthesized media query used by Sidebar to switch from the inline
10
+ * aside to the mobile drawer.
11
+ */
12
+ export declare const SIDEBAR_MOBILE_MEDIA_QUERY = "(max-width: 47.99rem)";
@@ -1,17 +1,25 @@
1
1
  @layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
2
2
  @layer cinder.components {
3
3
  .cinder-stat {
4
+ --cinder-stat-row-gap: var(--cinder-space-1, 0.25rem);
5
+ --cinder-stat-column-gap: var(--cinder-space-3, 0.75rem);
6
+ --cinder-stat-label-font-size: var(--cinder-text-sm);
7
+ --cinder-stat-value-font-size: var(--cinder-text-4xl);
8
+ --cinder-stat-value-font-weight: var(--cinder-font-semibold);
9
+ --cinder-stat-value-line-height: 1.1;
10
+ --cinder-stat-change-gap: var(--cinder-space-1, 0.25rem);
11
+ --cinder-stat-change-font-size: var(--cinder-text-sm);
4
12
  display: grid;
5
13
  grid-template-columns: 1fr;
6
14
  grid-template-rows: auto auto auto;
7
- row-gap: var(--cinder-space-1, 0.25rem);
15
+ row-gap: var(--cinder-stat-row-gap, var(--cinder-space-1, 0.25rem));
8
16
  align-items: start;
9
17
  color: var(--cinder-text);
10
18
  }
11
19
 
12
20
  .cinder-stat[data-cinder-has-icon] {
13
21
  grid-template-columns: auto 1fr;
14
- column-gap: var(--cinder-space-3, 0.75rem);
22
+ column-gap: var(--cinder-stat-column-gap, var(--cinder-space-3, 0.75rem));
15
23
  }
16
24
 
17
25
  .cinder-stat__icon {
@@ -25,7 +33,7 @@
25
33
  }
26
34
 
27
35
  .cinder-stat__label {
28
- font-size: var(--cinder-text-sm);
36
+ font-size: var(--cinder-stat-label-font-size, var(--cinder-text-sm));
29
37
  color: var(--cinder-text-muted);
30
38
  }
31
39
 
@@ -34,10 +42,10 @@
34
42
  }
35
43
 
36
44
  .cinder-stat__value {
37
- font-size: var(--cinder-text-4xl);
38
- font-weight: var(--cinder-font-semibold);
45
+ font-size: var(--cinder-stat-value-font-size, var(--cinder-text-4xl));
46
+ font-weight: var(--cinder-stat-value-font-weight, var(--cinder-font-semibold));
39
47
  font-variant-numeric: tabular-nums;
40
- line-height: 1.1;
48
+ line-height: var(--cinder-stat-value-line-height, 1.1);
41
49
  }
42
50
 
43
51
  .cinder-stat[data-cinder-has-icon] .cinder-stat__value {
@@ -47,8 +55,8 @@
47
55
  .cinder-stat__change {
48
56
  display: inline-flex;
49
57
  align-items: center;
50
- gap: var(--cinder-space-1, 0.25rem);
51
- font-size: var(--cinder-text-sm);
58
+ gap: var(--cinder-stat-change-gap, var(--cinder-space-1, 0.25rem));
59
+ font-size: var(--cinder-stat-change-font-size, var(--cinder-text-sm));
52
60
  }
53
61
 
54
62
  .cinder-stat[data-cinder-has-icon] .cinder-stat__change {
@@ -78,6 +78,10 @@ var schema = {
78
78
  class: {
79
79
  type: "string",
80
80
  description: "Additional class names merged with `.cinder-stat`."
81
+ },
82
+ style: {
83
+ type: "string",
84
+ description: "Inline style string applied to the `.cinder-stat` root."
81
85
  }
82
86
  },
83
87
  additionalProperties: false,
@@ -107,4 +111,4 @@ export {
107
111
  stat_schema_default as default
108
112
  };
109
113
 
110
- //# debugId=C0F5E1E3C641FA3864756E2164756E21
114
+ //# debugId=429D4BA8E0F6656864756E2164756E21
@@ -33,3 +33,22 @@ export type StatProps = Omit<HTMLAttributes<HTMLDivElement>, 'class'> & {
33
33
  /** Additional class names merged with `.cinder-stat`. */
34
34
  class?: string;
35
35
  };
36
+ /** Schema generator surface for Stat — excludes native attributes except supported styling hooks. */
37
+ export interface StatSchemaProps {
38
+ /** Short label describing the metric, e.g. "Monthly Revenue". */
39
+ label: string;
40
+ /** The statistic. Strings rendered verbatim; numbers formatted via formatNumber. */
41
+ value: string | number;
42
+ /** Optional change indicator with direction and accessible wording. */
43
+ change?: StatChange;
44
+ /** Optional leading icon snippet (decorative — wrapper is aria-hidden). */
45
+ icon?: Snippet;
46
+ /** Intl.NumberFormat options applied only when `value` is a number. */
47
+ valueFormatOptions?: Intl.NumberFormatOptions;
48
+ /** Locale forwarded to formatNumber. Defaults to the nearest LocaleProvider locale, then en-US. */
49
+ valueLocale?: string;
50
+ /** Additional class names merged with `.cinder-stat`. */
51
+ class?: string;
52
+ /** Inline style string applied to the `.cinder-stat` root. */
53
+ style?: string;
54
+ }
@@ -52,10 +52,19 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
52
52
  });
53
53
 
54
54
  // src/components/stat/stat.variables.ts
55
- var variables = [];
55
+ var variables = [
56
+ "--cinder-stat-change-font-size",
57
+ "--cinder-stat-change-gap",
58
+ "--cinder-stat-column-gap",
59
+ "--cinder-stat-label-font-size",
60
+ "--cinder-stat-row-gap",
61
+ "--cinder-stat-value-font-size",
62
+ "--cinder-stat-value-font-weight",
63
+ "--cinder-stat-value-line-height"
64
+ ];
56
65
  var stat_variables_default = variables;
57
66
  export {
58
67
  stat_variables_default as default
59
68
  };
60
69
 
61
- //# debugId=D0CE6D1B1C484C6664756E2164756E21
70
+ //# debugId=7108937A7CEA419964756E2164756E21
@@ -1,8 +1,11 @@
1
1
  @layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
2
2
  @layer cinder.components {
3
3
  .cinder-stat-group {
4
+ --cinder-stat-group-gap: var(--cinder-space-4, 1rem);
5
+ --cinder-stat-group-card-padding: var(--cinder-space-4, 1rem);
6
+ --cinder-stat-group-shared-cell-padding: var(--cinder-space-4, 1rem);
4
7
  display: grid;
5
- gap: var(--cinder-space-4, 1rem);
8
+ gap: var(--cinder-stat-group-gap, var(--cinder-space-4, 1rem));
6
9
  /* Query the group's own inline size so fixed column counts can collapse when
7
10
  the group is narrow — even inside a wide viewport (RESPONSIVE-POLICY.md). */
8
11
  container-type: inline-size;
@@ -50,7 +53,7 @@
50
53
 
51
54
  /* variant: cards — each stat gets a card-style border, background, and shadow */
52
55
  .cinder-stat-group[data-cinder-variant='cards'] > .cinder-stat {
53
- padding: var(--cinder-space-4, 1rem);
56
+ padding: var(--cinder-stat-group-card-padding, var(--cinder-space-4, 1rem));
54
57
  background: var(--cinder-surface-raised);
55
58
  border: 1px solid var(--cinder-border);
56
59
  border-radius: var(--cinder-radius-md, 0.5rem);
@@ -63,15 +66,15 @@
63
66
  * gap with the surface color, avoiding nth-child math for any column count.
64
67
  */
65
68
  .cinder-stat-group[data-cinder-variant='shared-borders'] {
69
+ --cinder-stat-group-gap: 1px;
66
70
  border: 1px solid var(--cinder-border);
67
71
  border-radius: var(--cinder-radius-md, 0.5rem);
68
72
  overflow: hidden;
69
73
  background: var(--cinder-border);
70
- gap: 1px;
71
74
  }
72
75
 
73
76
  .cinder-stat-group[data-cinder-variant='shared-borders'] > .cinder-stat {
74
- padding: var(--cinder-space-4, 1rem);
77
+ padding: var(--cinder-stat-group-shared-cell-padding, var(--cinder-space-4, 1rem));
75
78
  background: var(--cinder-surface-raised);
76
79
  }
77
80
  }
@@ -73,6 +73,10 @@ var schema = {
73
73
  class: {
74
74
  type: "string",
75
75
  description: "Additional class names merged with `.cinder-stat-group`."
76
+ },
77
+ style: {
78
+ type: "string",
79
+ description: "Inline style string applied to the `.cinder-stat-group` root."
76
80
  }
77
81
  },
78
82
  additionalProperties: false,
@@ -92,4 +96,4 @@ export {
92
96
  stat_group_schema_default as default
93
97
  };
94
98
 
95
- //# debugId=A2F52548CE94E2A964756E2164756E21
99
+ //# debugId=0D9871ECB97A1A0D64756E2164756E21
@@ -28,3 +28,30 @@ export type StatGroupProps = Omit<HTMLAttributes<HTMLDivElement>, 'class'> & {
28
28
  /** Additional class names merged with `.cinder-stat-group`. */
29
29
  class?: string;
30
30
  };
31
+ /** Schema generator surface for StatGroup — excludes native attributes except supported styling hooks. */
32
+ export interface StatGroupSchemaProps {
33
+ /**
34
+ * Optional accessible label for the whole stat set. When provided, the
35
+ * container becomes `role="group"` and uses this value as its accessible name.
36
+ */
37
+ label?: string;
38
+ /**
39
+ * Grid column count. `'auto'` uses auto-fit with minmax for responsive layout.
40
+ * @default 'auto'
41
+ */
42
+ columns?: StatGroupColumns;
43
+ /**
44
+ * Visual variant; surfaced as `data-cinder-variant` for CSS styling.
45
+ * - `'default'` — plain grid, no borders or backgrounds.
46
+ * - `'cards'` — each stat gets a card-style border and shadow.
47
+ * - `'shared-borders'` — single outer border with 1px gap dividers between stats.
48
+ * @default 'default'
49
+ */
50
+ variant?: StatGroupVariant;
51
+ /** Stat children, typically one or more `<Stat>` components. */
52
+ children: Snippet;
53
+ /** Additional class names merged with `.cinder-stat-group`. */
54
+ class?: string;
55
+ /** Inline style string applied to the `.cinder-stat-group` root. */
56
+ style?: string;
57
+ }
@@ -52,10 +52,14 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
52
52
  });
53
53
 
54
54
  // src/components/stat-group/stat-group.variables.ts
55
- var variables = [];
55
+ var variables = [
56
+ "--cinder-stat-group-card-padding",
57
+ "--cinder-stat-group-gap",
58
+ "--cinder-stat-group-shared-cell-padding"
59
+ ];
56
60
  var stat_group_variables_default = variables;
57
61
  export {
58
62
  stat_group_variables_default as default
59
63
  };
60
64
 
61
- //# debugId=D3FFE80178FC6D7064756E2164756E21
65
+ //# debugId=1CF303317D7DF3EA64756E2164756E21
package/dist/index.d.ts CHANGED
@@ -302,7 +302,7 @@ export { default as SideNavigationGroup } from './components/side-navigation-gro
302
302
  export type { SideNavigationGroupProps } from './components/side-navigation-group/index.ts';
303
303
  export { default as SideNavigationItem } from './components/side-navigation-item/index.ts';
304
304
  export type { SideNavigationItemProps } from './components/side-navigation-item/index.ts';
305
- export { default as Sidebar } from './components/sidebar/index.ts';
305
+ export { SIDEBAR_MOBILE_BREAKPOINT, SIDEBAR_MOBILE_MEDIA_QUERY, default as Sidebar, } from './components/sidebar/index.ts';
306
306
  export type { SidebarProps } from './components/sidebar/index.ts';
307
307
  export { default as SortableList } from './components/sortable-list/index.ts';
308
308
  export type { SortableListProps } from './components/sortable-list/index.ts';