@lostgradient/cinder 0.12.0 → 0.12.1

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 (70) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/components.json +3 -2
  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/side-navigation/side-navigation.css +2 -1
  15. package/dist/components/side-navigation/side-navigation.schema.js +9 -6
  16. package/dist/components/side-navigation/side-navigation.types.d.ts +11 -0
  17. package/dist/components/side-navigation/side-navigation.variables.js +2 -2
  18. package/dist/components/stat/stat.css +16 -8
  19. package/dist/components/stat/stat.schema.js +5 -1
  20. package/dist/components/stat/stat.types.d.ts +19 -0
  21. package/dist/components/stat/stat.variables.js +11 -2
  22. package/dist/components/stat-group/stat-group.css +7 -4
  23. package/dist/components/stat-group/stat-group.schema.js +5 -1
  24. package/dist/components/stat-group/stat-group.types.d.ts +27 -0
  25. package/dist/components/stat-group/stat-group.variables.js +6 -2
  26. package/dist/index.js +14 -11
  27. package/dist/server/components/accordion/index.js +2 -2
  28. package/dist/server/components/accordion-item/index.js +2 -2
  29. package/dist/server/index.js +3 -3
  30. package/dist/server/{index.server-cf6pxeyg.js → index.server-0rzd71e0.js} +1 -1
  31. package/dist/server/{index.server-y83kqayt.js → index.server-h3nzp8g8.js} +1 -1
  32. package/dist/server/index.server-jwvxxjvc.js +50 -0
  33. package/package.json +1 -1
  34. package/src/components/accordion/accordion.examples.json +6 -0
  35. package/src/components/accordion-item/accordion-item.css +20 -7
  36. package/src/components/accordion-item/accordion-item.schema.json +4 -0
  37. package/src/components/accordion-item/accordion-item.schema.ts +4 -0
  38. package/src/components/accordion-item/accordion-item.svelte +9 -7
  39. package/src/components/accordion-item/accordion-item.types.ts +4 -0
  40. package/src/components/accordion-item/accordion-item.variables.json +12 -1
  41. package/src/components/accordion-item/accordion-item.variables.ts +12 -1
  42. package/src/components/action-row/action-row.css +20 -9
  43. package/src/components/action-row/action-row.examples.json +6 -0
  44. package/src/components/action-row/action-row.schema.json +4 -0
  45. package/src/components/action-row/action-row.schema.ts +4 -0
  46. package/src/components/action-row/action-row.types.ts +44 -0
  47. package/src/components/action-row/action-row.variables.json +11 -1
  48. package/src/components/action-row/action-row.variables.ts +11 -1
  49. package/src/components/chat/chat.examples.json +6 -0
  50. package/src/components/side-navigation/side-navigation.css +2 -1
  51. package/src/components/side-navigation/side-navigation.examples.json +6 -0
  52. package/src/components/side-navigation/side-navigation.schema.json +8 -5
  53. package/src/components/side-navigation/side-navigation.schema.ts +8 -5
  54. package/src/components/side-navigation/side-navigation.types.ts +12 -0
  55. package/src/components/side-navigation/side-navigation.variables.json +1 -1
  56. package/src/components/side-navigation/side-navigation.variables.ts +1 -1
  57. package/src/components/stat/stat.css +16 -8
  58. package/src/components/stat/stat.schema.json +4 -0
  59. package/src/components/stat/stat.schema.ts +4 -0
  60. package/src/components/stat/stat.types.ts +20 -0
  61. package/src/components/stat/stat.variables.json +10 -1
  62. package/src/components/stat/stat.variables.ts +10 -1
  63. package/src/components/stat-group/stat-group.css +7 -4
  64. package/src/components/stat-group/stat-group.examples.json +6 -0
  65. package/src/components/stat-group/stat-group.schema.json +4 -0
  66. package/src/components/stat-group/stat-group.schema.ts +4 -0
  67. package/src/components/stat-group/stat-group.types.ts +28 -0
  68. package/src/components/stat-group/stat-group.variables.json +5 -1
  69. package/src/components/stat-group/stat-group.variables.ts +5 -1
  70. package/dist/server/index.server-hfx487zj.js +0 -42
@@ -48,3 +48,47 @@ export type ActionRowProps = Omit<
48
48
  /** Additional classes merged with `.cinder-action-row`. */
49
49
  class?: string;
50
50
  };
51
+
52
+ /** Schema generator surface for ActionRow — excludes native button attributes except supported styling hooks. */
53
+ export interface ActionRowSchemaProps {
54
+ /**
55
+ * Density token surfaced as `data-cinder-density`.
56
+ * @default "comfortable"
57
+ */
58
+ density?: ActionRowDensity;
59
+ /**
60
+ * Whether the row is currently selected.
61
+ * @default false
62
+ */
63
+ selected?: boolean;
64
+ /**
65
+ * Accessible state mapping for selected rows.
66
+ * Use `pressed` for in-page selectable rows and `current` for navigation/current-item rows.
67
+ * @default "pressed"
68
+ */
69
+ selectedState?: ActionRowSelectedState;
70
+ /**
71
+ * `aria-current` value used when `selectedState="current"` and `selected` is true.
72
+ * @default "true"
73
+ */
74
+ currentValue?: ActionRowCurrentValue;
75
+ /**
76
+ * Native button type.
77
+ * @default "button"
78
+ */
79
+ type?: 'button' | 'submit' | 'reset';
80
+ /** Leading visual such as an icon, avatar, marker, or status dot. */
81
+ leading?: Snippet;
82
+ /** Primary row label. Required so the row has visible text and an accessible name. */
83
+ title: Snippet;
84
+ /** Secondary description below the title. */
85
+ description?: Snippet;
86
+ /** Tertiary metadata such as timestamp, status text, or a compact badge. */
87
+ meta?: Snippet;
88
+ /** Trailing region such as a timestamp, count, badge, chevron, or shortcut hint. */
89
+ trailing?: Snippet;
90
+ /** Additional classes merged with `.cinder-action-row`. */
91
+ class?: string;
92
+ /** Inline style string applied to the `.cinder-action-row` root. */
93
+ style?: string;
94
+ }
@@ -1 +1,11 @@
1
- []
1
+ [
2
+ "--cinder-action-row-body-gap",
3
+ "--cinder-action-row-description-font-size",
4
+ "--cinder-action-row-layout-column-gap",
5
+ "--cinder-action-row-layout-row-gap",
6
+ "--cinder-action-row-meta-font-size",
7
+ "--cinder-action-row-padding-block",
8
+ "--cinder-action-row-padding-inline",
9
+ "--cinder-action-row-title-font-size",
10
+ "--cinder-action-row-trailing-gap"
11
+ ]
@@ -1,3 +1,13 @@
1
- const variables: readonly string[] = [];
1
+ const variables: readonly string[] = [
2
+ '--cinder-action-row-body-gap',
3
+ '--cinder-action-row-description-font-size',
4
+ '--cinder-action-row-layout-column-gap',
5
+ '--cinder-action-row-layout-row-gap',
6
+ '--cinder-action-row-meta-font-size',
7
+ '--cinder-action-row-padding-block',
8
+ '--cinder-action-row-padding-inline',
9
+ '--cinder-action-row-title-font-size',
10
+ '--cinder-action-row-trailing-gap',
11
+ ];
2
12
 
3
13
  export default variables;
@@ -15,6 +15,12 @@
15
15
  "description": "Compare comfortable vs compact density and bubble vs flat visual variant on the same conversationalist-shaped transcript.",
16
16
  "code": "<script lang=\"ts\">\n import {\n Chat,\n appendAssistantMessage,\n appendUserMessage,\n createConversation,\n } from '@lostgradient/cinder/chat';\n import { Select } from '@lostgradient/cinder/select';\n\n // Build a shared Conversationalist transcript.\n const baseConversation = appendAssistantMessage(\n appendUserMessage(\n appendAssistantMessage(\n appendUserMessage(\n createConversation({ id: 'density-variant-chat' }),\n 'What are the density and variant props for?',\n ),\n 'The `density` prop controls spacing — `comfortable` uses standard padding and gap, `compact` tightens them for data-dense contexts like embedded side panels.\\n\\nThe `variant` prop controls visual treatment — `bubble` uses colored backgrounds to differentiate roles; `flat` removes backgrounds and relies on alignment and the role label instead.',\n ),\n 'Does compact affect the action buttons?',\n ),\n 'No — action buttons keep `min-height: var(--cinder-touch-target-min)` regardless of density. Only padding and gap change.',\n );\n\n type Density = 'comfortable' | 'compact';\n type Variant = 'bubble' | 'flat';\n\n const densityOptions = [\n { value: 'comfortable', label: 'comfortable' },\n { value: 'compact', label: 'compact' },\n ] satisfies { value: Density; label: string }[];\n\n const variantOptions = [\n { value: 'bubble', label: 'bubble' },\n { value: 'flat', label: 'flat' },\n ] satisfies { value: Variant; label: string }[];\n\n let density = $state<Density>('comfortable');\n let variant = $state<Variant>('bubble');\n</script>\n\n<div style=\"display: grid; gap: 1rem;\">\n <div style=\"display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap;\">\n <Select id=\"density-select\" bind:value={density} options={densityOptions} label=\"Density\" />\n <Select id=\"variant-select\" bind:value={variant} options={variantOptions} label=\"Variant\" />\n </div>\n\n <div style=\"height: 28rem;\">\n <Chat\n id=\"density-variant\"\n conversation={baseConversation}\n {density}\n {variant}\n capabilities={{ attachments: false }}\n />\n </div>\n</div>\n"
17
17
  },
18
+ {
19
+ "id": "full-height-layout",
20
+ "title": "Full-height layout",
21
+ "description": "Place Chat in a definite-height flex or grid cell with min-height: 0 so the transcript owns the scroll region.",
22
+ "code": "<script lang=\"ts\">\n import {\n Chat,\n appendAssistantMessage,\n appendUserMessage,\n createConversation,\n } from '@lostgradient/cinder/chat';\n\n const conversation = appendAssistantMessage(\n appendUserMessage(\n createConversation({ id: 'full-height-layout-chat' }),\n 'Why does the wrapper need min-height: 0?',\n ),\n 'Chat fills its parent. In a flex or grid app shell, the cell that contains Chat needs a definite height and min-height: 0 so the transcript can scroll internally instead of forcing the page taller.',\n );\n</script>\n\n<div\n style=\"display: flex; flex-direction: column; height: 100dvh; max-height: 36rem; border: 1px solid var(--cinder-border-muted);\"\n>\n <header style=\"padding: 0.75rem; border-block-end: 1px solid var(--cinder-border-muted);\">\n Support thread\n </header>\n <div style=\"flex: 1; min-height: 0;\">\n <Chat\n id=\"playground-full-height-layout-chat\"\n {conversation}\n capabilities={{ attachments: false }}\n />\n </div>\n</div>\n"
23
+ },
18
24
  {
19
25
  "id": "interactive-harness",
20
26
  "title": "Interactive harness",
@@ -13,6 +13,7 @@
13
13
  * ======================================== */
14
14
 
15
15
  .cinder-side-navigation {
16
+ --cinder-side-navigation-list-gap: var(--cinder-space-1);
16
17
  display: block;
17
18
  }
18
19
 
@@ -22,7 +23,7 @@
22
23
  padding: 0;
23
24
  display: flex;
24
25
  flex-direction: column;
25
- gap: var(--cinder-space-1);
26
+ gap: var(--cinder-side-navigation-list-gap, var(--cinder-space-1));
26
27
  }
27
28
 
28
29
  /* ----------------------------------------
@@ -9,6 +9,12 @@
9
9
  "description": "A grouped sidebar nav. Uses the SideNavigation namespace API: SideNavigation.Group wraps a collapsible section and SideNavigation.Item renders each link.",
10
10
  "code": "<script lang=\"ts\">\n import { SideNavigation } from '@lostgradient/cinder/side-navigation';\n</script>\n\n<SideNavigation ariaLabel=\"Workspace\">\n <SideNavigation.Item href=\"/dashboard\">Dashboard</SideNavigation.Item>\n <SideNavigation.Group label=\"Projects\">\n <SideNavigation.Item href=\"/projects/phoenix\" active>Phoenix</SideNavigation.Item>\n <SideNavigation.Item href=\"/projects/atlas\">Atlas</SideNavigation.Item>\n <SideNavigation.Item href=\"/projects/beacon\">Beacon</SideNavigation.Item>\n </SideNavigation.Group>\n <SideNavigation.Group label=\"Settings\">\n <SideNavigation.Item href=\"/settings/team\">Team</SideNavigation.Item>\n <SideNavigation.Item href=\"/settings/billing\">Billing</SideNavigation.Item>\n </SideNavigation.Group>\n</SideNavigation>\n"
11
11
  },
12
+ {
13
+ "id": "compact-sidebar",
14
+ "title": "Compact sidebar spacing",
15
+ "description": "Dense sidebars can tune the SideNavigation list gap through a public CSS variable.",
16
+ "code": "<script lang=\"ts\">\n import { SideNavigation } from '@lostgradient/cinder/side-navigation';\n</script>\n\n<div style=\"max-inline-size: 18rem;\">\n <SideNavigation ariaLabel=\"Inspector sections\" style=\"--cinder-side-navigation-list-gap: 0;\">\n <SideNavigation.Item href=\"#overview\" active>Overview</SideNavigation.Item>\n <SideNavigation.Item href=\"#timeline\">Timeline</SideNavigation.Item>\n <SideNavigation.Item href=\"#payload\">Payload</SideNavigation.Item>\n <SideNavigation.Group label=\"Artifacts\">\n <SideNavigation.Item href=\"#source\">Source</SideNavigation.Item>\n <SideNavigation.Item href=\"#snapshot\">Snapshot</SideNavigation.Item>\n </SideNavigation.Group>\n </SideNavigation>\n</div>\n"
17
+ },
12
18
  {
13
19
  "id": "docs-sidebar",
14
20
  "title": "Docs sidebar",
@@ -5,6 +5,14 @@
5
5
  "ariaLabel": {
6
6
  "type": "string",
7
7
  "description": "Accessible name for the <nav> landmark. Required, non-empty, distinct from other navs on the page."
8
+ },
9
+ "class": {
10
+ "type": "string",
11
+ "description": "Additional CSS class merged with `.cinder-side-navigation`."
12
+ },
13
+ "style": {
14
+ "type": "string",
15
+ "description": "Inline style string applied to the `.cinder-side-navigation` root."
8
16
  }
9
17
  },
10
18
  "additionalProperties": false,
@@ -16,11 +24,6 @@
16
24
  "reason": "function-or-snippet",
17
25
  "required": true,
18
26
  "description": "Must be <li> elements containing NavigationItem and/or SideNavigationGroup."
19
- },
20
- {
21
- "name": "class",
22
- "reason": "unknown-shape",
23
- "description": "Additional CSS class merged with `.cinder-side-navigation`."
24
27
  }
25
28
  ]
26
29
  }
@@ -9,6 +9,14 @@ const schema = {
9
9
  description:
10
10
  'Accessible name for the <nav> landmark. Required, non-empty, distinct from other navs on the page.',
11
11
  },
12
+ class: {
13
+ type: 'string',
14
+ description: 'Additional CSS class merged with `.cinder-side-navigation`.',
15
+ },
16
+ style: {
17
+ type: 'string',
18
+ description: 'Inline style string applied to the `.cinder-side-navigation` root.',
19
+ },
12
20
  },
13
21
  additionalProperties: false,
14
22
  required: ['ariaLabel'],
@@ -20,11 +28,6 @@ const schema = {
20
28
  required: true,
21
29
  description: 'Must be <li> elements containing NavigationItem and/or SideNavigationGroup.',
22
30
  },
23
- {
24
- name: 'class',
25
- reason: 'unknown-shape',
26
- description: 'Additional CSS class merged with `.cinder-side-navigation`.',
27
- },
28
31
  ],
29
32
  },
30
33
  } satisfies ComponentSchema;
@@ -12,3 +12,15 @@ export type SideNavigationProps = Omit<
12
12
  /** Must be <li> elements containing NavigationItem and/or SideNavigationGroup. */
13
13
  children: Snippet;
14
14
  };
15
+
16
+ /** Schema generator surface for SideNavigation — excludes native attributes except supported styling hooks. */
17
+ export interface SideNavigationSchemaProps {
18
+ /** Accessible name for the <nav> landmark. Required, non-empty, distinct from other navs on the page. */
19
+ ariaLabel: string;
20
+ /** Additional CSS class merged with `.cinder-side-navigation`. */
21
+ class?: string;
22
+ /** Inline style string applied to the `.cinder-side-navigation` root. */
23
+ style?: string;
24
+ /** Must be <li> elements containing NavigationItem and/or SideNavigationGroup. */
25
+ children: Snippet;
26
+ }
@@ -1 +1 @@
1
- []
1
+ ["--cinder-side-navigation-list-gap"]
@@ -1,3 +1,3 @@
1
- const variables: readonly string[] = [];
1
+ const variables: readonly string[] = ['--cinder-side-navigation-list-gap'];
2
2
 
3
3
  export default variables;
@@ -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 {
@@ -24,6 +24,10 @@
24
24
  "class": {
25
25
  "type": "string",
26
26
  "description": "Additional class names merged with `.cinder-stat`."
27
+ },
28
+ "style": {
29
+ "type": "string",
30
+ "description": "Inline style string applied to the `.cinder-stat` root."
27
31
  }
28
32
  },
29
33
  "additionalProperties": false,
@@ -28,6 +28,10 @@ const schema = {
28
28
  type: 'string',
29
29
  description: 'Additional class names merged with `.cinder-stat`.',
30
30
  },
31
+ style: {
32
+ type: 'string',
33
+ description: 'Inline style string applied to the `.cinder-stat` root.',
34
+ },
31
35
  },
32
36
  additionalProperties: false,
33
37
  required: ['label', 'value'],
@@ -33,3 +33,23 @@ export type StatProps = Omit<HTMLAttributes<HTMLDivElement>, 'class'> & {
33
33
  /** Additional class names merged with `.cinder-stat`. */
34
34
  class?: string;
35
35
  };
36
+
37
+ /** Schema generator surface for Stat — excludes native attributes except supported styling hooks. */
38
+ export interface StatSchemaProps {
39
+ /** Short label describing the metric, e.g. "Monthly Revenue". */
40
+ label: string;
41
+ /** The statistic. Strings rendered verbatim; numbers formatted via formatNumber. */
42
+ value: string | number;
43
+ /** Optional change indicator with direction and accessible wording. */
44
+ change?: StatChange;
45
+ /** Optional leading icon snippet (decorative — wrapper is aria-hidden). */
46
+ icon?: Snippet;
47
+ /** Intl.NumberFormat options applied only when `value` is a number. */
48
+ valueFormatOptions?: Intl.NumberFormatOptions;
49
+ /** Locale forwarded to formatNumber. Defaults to the nearest LocaleProvider locale, then en-US. */
50
+ valueLocale?: string;
51
+ /** Additional class names merged with `.cinder-stat`. */
52
+ class?: string;
53
+ /** Inline style string applied to the `.cinder-stat` root. */
54
+ style?: string;
55
+ }
@@ -1 +1,10 @@
1
- []
1
+ [
2
+ "--cinder-stat-change-font-size",
3
+ "--cinder-stat-change-gap",
4
+ "--cinder-stat-column-gap",
5
+ "--cinder-stat-label-font-size",
6
+ "--cinder-stat-row-gap",
7
+ "--cinder-stat-value-font-size",
8
+ "--cinder-stat-value-font-weight",
9
+ "--cinder-stat-value-line-height"
10
+ ]
@@ -1,3 +1,12 @@
1
- const variables: readonly string[] = [];
1
+ const variables: readonly string[] = [
2
+ '--cinder-stat-change-font-size',
3
+ '--cinder-stat-change-gap',
4
+ '--cinder-stat-column-gap',
5
+ '--cinder-stat-label-font-size',
6
+ '--cinder-stat-row-gap',
7
+ '--cinder-stat-value-font-size',
8
+ '--cinder-stat-value-font-weight',
9
+ '--cinder-stat-value-line-height',
10
+ ];
2
11
 
3
12
  export default variables;
@@ -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
  }
@@ -21,6 +21,12 @@
21
21
  "description": "The `cards` variant renders each metric as a discrete bordered card, separating the tiles instead of laying them out edge-to-edge in a shared grid.",
22
22
  "code": "<script lang=\"ts\">\n import { StatGroup } from '@lostgradient/cinder/stat-group';\n</script>\n\n<StatGroup label=\"This quarter\" columns={3} variant=\"cards\">\n <StatGroup.Stat label=\"Projects\" value={42} />\n <StatGroup.Stat label=\"Members\" value={18} />\n <StatGroup.Stat label=\"Storage\" value=\"64 GB\" />\n</StatGroup>\n"
23
23
  },
24
+ {
25
+ "id": "compact-summary",
26
+ "title": "Compact summary strip",
27
+ "description": "Dense summaries can tune StatGroup spacing and Stat typography through public CSS variables.",
28
+ "code": "<script lang=\"ts\">\n import { StatGroup } from '@lostgradient/cinder/stat-group';\n</script>\n\n<StatGroup\n label=\"Workflow summary\"\n columns={4}\n variant=\"shared-borders\"\n style=\"--cinder-stat-group-gap: 1px; --cinder-stat-group-shared-cell-padding: var(--cinder-space-2);\"\n>\n <StatGroup.Stat\n label=\"Events\"\n value={128}\n style=\"--cinder-stat-row-gap: 0; --cinder-stat-label-font-size: var(--cinder-text-xs); --cinder-stat-value-font-size: var(--cinder-text-lg); --cinder-stat-change-font-size: var(--cinder-text-xs);\"\n />\n <StatGroup.Stat\n label=\"Matched\"\n value={42}\n style=\"--cinder-stat-row-gap: 0; --cinder-stat-label-font-size: var(--cinder-text-xs); --cinder-stat-value-font-size: var(--cinder-text-lg); --cinder-stat-change-font-size: var(--cinder-text-xs);\"\n />\n <StatGroup.Stat\n label=\"Retries\"\n value={3}\n style=\"--cinder-stat-row-gap: 0; --cinder-stat-label-font-size: var(--cinder-text-xs); --cinder-stat-value-font-size: var(--cinder-text-lg); --cinder-stat-change-font-size: var(--cinder-text-xs);\"\n />\n <StatGroup.Stat\n label=\"Latency\"\n value=\"184 ms\"\n style=\"--cinder-stat-row-gap: 0; --cinder-stat-label-font-size: var(--cinder-text-xs); --cinder-stat-value-font-size: var(--cinder-text-lg); --cinder-stat-change-font-size: var(--cinder-text-xs);\"\n />\n</StatGroup>\n"
29
+ },
24
30
  {
25
31
  "id": "shared-borders-variant",
26
32
  "title": "Shared-borders variant",
@@ -19,6 +19,10 @@
19
19
  "class": {
20
20
  "type": "string",
21
21
  "description": "Additional class names merged with `.cinder-stat-group`."
22
+ },
23
+ "style": {
24
+ "type": "string",
25
+ "description": "Inline style string applied to the `.cinder-stat-group` root."
22
26
  }
23
27
  },
24
28
  "additionalProperties": false,
@@ -24,6 +24,10 @@ const schema = {
24
24
  type: 'string',
25
25
  description: 'Additional class names merged with `.cinder-stat-group`.',
26
26
  },
27
+ style: {
28
+ type: 'string',
29
+ description: 'Inline style string applied to the `.cinder-stat-group` root.',
30
+ },
27
31
  },
28
32
  additionalProperties: false,
29
33
  metadata: {
@@ -28,3 +28,31 @@ export type StatGroupProps = Omit<HTMLAttributes<HTMLDivElement>, 'class'> & {
28
28
  /** Additional class names merged with `.cinder-stat-group`. */
29
29
  class?: string;
30
30
  };
31
+
32
+ /** Schema generator surface for StatGroup — excludes native attributes except supported styling hooks. */
33
+ export interface StatGroupSchemaProps {
34
+ /**
35
+ * Optional accessible label for the whole stat set. When provided, the
36
+ * container becomes `role="group"` and uses this value as its accessible name.
37
+ */
38
+ label?: string;
39
+ /**
40
+ * Grid column count. `'auto'` uses auto-fit with minmax for responsive layout.
41
+ * @default 'auto'
42
+ */
43
+ columns?: StatGroupColumns;
44
+ /**
45
+ * Visual variant; surfaced as `data-cinder-variant` for CSS styling.
46
+ * - `'default'` — plain grid, no borders or backgrounds.
47
+ * - `'cards'` — each stat gets a card-style border and shadow.
48
+ * - `'shared-borders'` — single outer border with 1px gap dividers between stats.
49
+ * @default 'default'
50
+ */
51
+ variant?: StatGroupVariant;
52
+ /** Stat children, typically one or more `<Stat>` components. */
53
+ children: Snippet;
54
+ /** Additional class names merged with `.cinder-stat-group`. */
55
+ class?: string;
56
+ /** Inline style string applied to the `.cinder-stat-group` root. */
57
+ style?: string;
58
+ }
@@ -1 +1,5 @@
1
- []
1
+ [
2
+ "--cinder-stat-group-card-padding",
3
+ "--cinder-stat-group-gap",
4
+ "--cinder-stat-group-shared-cell-padding"
5
+ ]
@@ -1,3 +1,7 @@
1
- const variables: readonly string[] = [];
1
+ const variables: readonly string[] = [
2
+ '--cinder-stat-group-card-padding',
3
+ '--cinder-stat-group-gap',
4
+ '--cinder-stat-group-shared-cell-padding',
5
+ ];
2
6
 
3
7
  export default variables;
@@ -1,42 +0,0 @@
1
- import {
2
- strictStableContext
3
- } from "./index.server-bn02606y.js";
4
- import {
5
- classNames
6
- } from "./index.server-z7nvkz8v.js";
7
-
8
- // src/components/accordion-item/accordion-item.svelte
9
- import * as $ from "svelte/internal/server";
10
-
11
- // src/components/accordion/accordion.context.ts
12
- var [getAccordionContext, setAccordionContext] = strictStableContext("@lostgradient/cinder/accordion/context", "AccordionItem must be rendered inside an Accordion");
13
-
14
- // src/components/accordion-item/accordion-item.svelte
15
- function Accordion_item($$renderer, $$props) {
16
- $$renderer.component(($$renderer2) => {
17
- let { id, title, disabled = false, class: className, children } = $$props;
18
- const context = getAccordionContext();
19
- const isExpanded = $.derived(() => context.expandedIds.includes(id));
20
- const headerId = $.derived(() => `${id}-header`);
21
- const panelId = $.derived(() => `${id}-panel`);
22
- function handleClick() {
23
- if (disabled)
24
- return;
25
- context.toggle(id);
26
- }
27
- $$renderer2.push(`<div${$.attr_class($.clsx(classNames("cinder-accordion-item", className)))}${$.attr("data-cinder-expanded", isExpanded() ? "" : undefined)}${$.attr("data-cinder-disabled", disabled ? "" : undefined)}><h3 class="cinder-accordion-item__heading"><button type="button"${$.attr("id", headerId())} class="cinder-accordion-item__trigger"${$.attr("aria-expanded", isExpanded())}${$.attr("aria-controls", panelId())}${$.attr("disabled", disabled, true)}><span class="cinder-accordion-item__title">${$.escape(title)}</span> <svg class="cinder-accordion-item__chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" focusable="false"><path fill-rule="evenodd" d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06z" clip-rule="evenodd"></path></svg></button></h3> `);
28
- if (isExpanded()) {
29
- $$renderer2.push("<!--[0-->");
30
- $$renderer2.push(`<div${$.attr("id", panelId())} class="cinder-accordion-item__panel"><div class="cinder-accordion-item__panel-inner">`);
31
- children($$renderer2);
32
- $$renderer2.push(`<!----></div></div>`);
33
- } else {
34
- $$renderer2.push("<!--[-1-->");
35
- }
36
- $$renderer2.push(`<!--]--></div>`);
37
- }, Accordion_item);
38
- }
39
-
40
- export { setAccordionContext, Accordion_item };
41
-
42
- //# debugId=A611BC101408464764756E2164756E21