@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.
- package/CHANGELOG.md +6 -0
- package/components.json +3 -2
- package/dist/components/accordion/index.js +14 -11
- package/dist/components/accordion-item/accordion-item.css +20 -7
- package/dist/components/accordion-item/accordion-item.schema.js +5 -1
- package/dist/components/accordion-item/accordion-item.types.d.ts +4 -0
- package/dist/components/accordion-item/accordion-item.variables.js +13 -2
- package/dist/components/accordion-item/index.js +14 -11
- package/dist/components/action-row/action-row.css +20 -9
- package/dist/components/action-row/action-row.schema.js +5 -1
- package/dist/components/action-row/action-row.types.d.ts +43 -0
- package/dist/components/action-row/action-row.variables.js +12 -2
- package/dist/components/chat/chat.svelte.d.ts +1 -0
- package/dist/components/side-navigation/side-navigation.css +2 -1
- package/dist/components/side-navigation/side-navigation.schema.js +9 -6
- package/dist/components/side-navigation/side-navigation.types.d.ts +11 -0
- package/dist/components/side-navigation/side-navigation.variables.js +2 -2
- package/dist/components/stat/stat.css +16 -8
- package/dist/components/stat/stat.schema.js +5 -1
- package/dist/components/stat/stat.types.d.ts +19 -0
- package/dist/components/stat/stat.variables.js +11 -2
- package/dist/components/stat-group/stat-group.css +7 -4
- package/dist/components/stat-group/stat-group.schema.js +5 -1
- package/dist/components/stat-group/stat-group.types.d.ts +27 -0
- package/dist/components/stat-group/stat-group.variables.js +6 -2
- package/dist/index.js +14 -11
- package/dist/server/components/accordion/index.js +2 -2
- package/dist/server/components/accordion-item/index.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/{index.server-cf6pxeyg.js → index.server-0rzd71e0.js} +1 -1
- package/dist/server/{index.server-y83kqayt.js → index.server-h3nzp8g8.js} +1 -1
- package/dist/server/index.server-jwvxxjvc.js +50 -0
- package/package.json +1 -1
- package/src/components/accordion/accordion.examples.json +6 -0
- package/src/components/accordion-item/accordion-item.css +20 -7
- package/src/components/accordion-item/accordion-item.schema.json +4 -0
- package/src/components/accordion-item/accordion-item.schema.ts +4 -0
- package/src/components/accordion-item/accordion-item.svelte +9 -7
- package/src/components/accordion-item/accordion-item.types.ts +4 -0
- package/src/components/accordion-item/accordion-item.variables.json +12 -1
- package/src/components/accordion-item/accordion-item.variables.ts +12 -1
- package/src/components/action-row/action-row.css +20 -9
- package/src/components/action-row/action-row.examples.json +6 -0
- package/src/components/action-row/action-row.schema.json +4 -0
- package/src/components/action-row/action-row.schema.ts +4 -0
- package/src/components/action-row/action-row.types.ts +44 -0
- package/src/components/action-row/action-row.variables.json +11 -1
- package/src/components/action-row/action-row.variables.ts +11 -1
- package/src/components/chat/chat.examples.json +6 -0
- package/src/components/side-navigation/side-navigation.css +2 -1
- package/src/components/side-navigation/side-navigation.examples.json +6 -0
- package/src/components/side-navigation/side-navigation.schema.json +8 -5
- package/src/components/side-navigation/side-navigation.schema.ts +8 -5
- package/src/components/side-navigation/side-navigation.types.ts +12 -0
- package/src/components/side-navigation/side-navigation.variables.json +1 -1
- package/src/components/side-navigation/side-navigation.variables.ts +1 -1
- package/src/components/stat/stat.css +16 -8
- package/src/components/stat/stat.schema.json +4 -0
- package/src/components/stat/stat.schema.ts +4 -0
- package/src/components/stat/stat.types.ts +20 -0
- package/src/components/stat/stat.variables.json +10 -1
- package/src/components/stat/stat.variables.ts +10 -1
- package/src/components/stat-group/stat-group.css +7 -4
- package/src/components/stat-group/stat-group.examples.json +6 -0
- package/src/components/stat-group/stat-group.schema.json +4 -0
- package/src/components/stat-group/stat-group.schema.ts +4 -0
- package/src/components/stat-group/stat-group.types.ts +28 -0
- package/src/components/stat-group/stat-group.variables.json +5 -1
- package/src/components/stat-group/stat-group.variables.ts +5 -1
- package/dist/server/index.server-hfx487zj.js +0 -42
|
@@ -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=
|
|
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=
|
|
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=
|
|
65
|
+
//# debugId=1CF303317D7DF3EA64756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -5938,15 +5938,16 @@ function strictStableContext(key, missingMessage) {
|
|
|
5938
5938
|
var [getAccordionContext, setAccordionContext] = strictStableContext("@lostgradient/cinder/accordion/context", "AccordionItem must be rendered inside an Accordion");
|
|
5939
5939
|
|
|
5940
5940
|
// src/components/accordion-item/accordion-item.svelte
|
|
5941
|
-
var root4 = $53.from_html(`<div class="cinder-accordion-item__panel
|
|
5942
|
-
var root_12 = $53.from_html(`<div><h3 class="cinder-accordion-item__heading"><button type="button" class="cinder-accordion-item__trigger"><span class="cinder-accordion-item__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>
|
|
5941
|
+
var root4 = $53.from_html(`<div class="cinder-accordion-item__panel-inner"><!></div>`);
|
|
5942
|
+
var root_12 = $53.from_html(`<div><h3 class="cinder-accordion-item__heading"><button type="button" class="cinder-accordion-item__trigger"><span class="cinder-accordion-item__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> <div class="cinder-accordion-item__panel"><!></div></div>`);
|
|
5943
5943
|
function Accordion_item($$anchor, $$props) {
|
|
5944
|
+
const instanceId = $53.props_id();
|
|
5944
5945
|
$53.push($$props, true);
|
|
5945
5946
|
let disabled = $53.prop($$props, "disabled", 3, false);
|
|
5946
5947
|
const context = getAccordionContext();
|
|
5947
5948
|
const isExpanded = $53.derived(() => context.expandedIds.includes($$props.id));
|
|
5948
|
-
const headerId = $53.derived(() => `${
|
|
5949
|
-
const panelId = $53.derived(() => `${
|
|
5949
|
+
const headerId = $53.derived(() => `${instanceId}-header`);
|
|
5950
|
+
const panelId = $53.derived(() => `${instanceId}-panel`);
|
|
5950
5951
|
function handleClick() {
|
|
5951
5952
|
if (disabled())
|
|
5952
5953
|
return;
|
|
@@ -5961,26 +5962,26 @@ function Accordion_item($$anchor, $$props) {
|
|
|
5961
5962
|
$53.next(2);
|
|
5962
5963
|
$53.reset(button);
|
|
5963
5964
|
$53.reset(h3);
|
|
5964
|
-
var
|
|
5965
|
+
var div_1 = $53.sibling(h3, 2);
|
|
5966
|
+
var node = $53.child(div_1);
|
|
5965
5967
|
{
|
|
5966
5968
|
var consequent = ($$anchor2) => {
|
|
5967
|
-
var
|
|
5968
|
-
var div_2 = $53.child(div_1);
|
|
5969
|
+
var div_2 = root4();
|
|
5969
5970
|
var node_1 = $53.child(div_2);
|
|
5970
5971
|
$53.snippet(node_1, () => $$props.children);
|
|
5971
5972
|
$53.reset(div_2);
|
|
5972
|
-
$53.
|
|
5973
|
-
$53.template_effect(() => $53.set_attribute(div_1, "id", $53.get(panelId)));
|
|
5974
|
-
$53.append($$anchor2, div_1);
|
|
5973
|
+
$53.append($$anchor2, div_2);
|
|
5975
5974
|
};
|
|
5976
5975
|
$53.if(node, ($$render) => {
|
|
5977
5976
|
if ($53.get(isExpanded))
|
|
5978
5977
|
$$render(consequent);
|
|
5979
5978
|
});
|
|
5980
5979
|
}
|
|
5980
|
+
$53.reset(div_1);
|
|
5981
5981
|
$53.reset(div);
|
|
5982
5982
|
$53.template_effect(($0) => {
|
|
5983
5983
|
$53.set_class(div, 1, $0);
|
|
5984
|
+
$53.set_style(div, $$props.style);
|
|
5984
5985
|
$53.set_attribute(div, "data-cinder-expanded", $53.get(isExpanded) ? "" : undefined);
|
|
5985
5986
|
$53.set_attribute(div, "data-cinder-disabled", disabled() ? "" : undefined);
|
|
5986
5987
|
$53.set_attribute(button, "id", $53.get(headerId));
|
|
@@ -5988,6 +5989,8 @@ function Accordion_item($$anchor, $$props) {
|
|
|
5988
5989
|
$53.set_attribute(button, "aria-controls", $53.get(panelId));
|
|
5989
5990
|
button.disabled = disabled();
|
|
5990
5991
|
$53.set_text(text, $$props.title);
|
|
5992
|
+
$53.set_attribute(div_1, "id", $53.get(panelId));
|
|
5993
|
+
$53.set_attribute(div_1, "hidden", !$53.get(isExpanded));
|
|
5991
5994
|
}, [
|
|
5992
5995
|
() => $53.clsx(classNames("cinder-accordion-item", $$props.class))
|
|
5993
5996
|
]);
|
|
@@ -73030,4 +73033,4 @@ export {
|
|
|
73030
73033
|
AccessGateExport as AccessGate
|
|
73031
73034
|
};
|
|
73032
73035
|
|
|
73033
|
-
//# debugId=
|
|
73036
|
+
//# debugId=85F50876735F032E64756E2164756E21
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Accordion,
|
|
3
3
|
accordion_default
|
|
4
|
-
} from "../../index.server-
|
|
4
|
+
} from "../../index.server-h3nzp8g8.js";
|
|
5
5
|
import"../../index.server-p3aw22qv.js";
|
|
6
|
-
import"../../index.server-
|
|
6
|
+
import"../../index.server-jwvxxjvc.js";
|
|
7
7
|
import"../../index.server-bn02606y.js";
|
|
8
8
|
import"../../index.server-z7nvkz8v.js";
|
|
9
9
|
import"../../index.server-0v6na3yp.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
accordion_item_default
|
|
3
|
-
} from "../../index.server-
|
|
3
|
+
} from "../../index.server-0rzd71e0.js";
|
|
4
4
|
import {
|
|
5
5
|
Accordion_item
|
|
6
|
-
} from "../../index.server-
|
|
6
|
+
} from "../../index.server-jwvxxjvc.js";
|
|
7
7
|
import"../../index.server-bn02606y.js";
|
|
8
8
|
import"../../index.server-z7nvkz8v.js";
|
|
9
9
|
import"../../index.server-0v6na3yp.js";
|
package/dist/server/index.js
CHANGED
|
@@ -707,12 +707,12 @@ import"./index.server-rqe5bqgm.js";
|
|
|
707
707
|
import"./index.server-yq9evnp4.js";
|
|
708
708
|
import {
|
|
709
709
|
accordion_default
|
|
710
|
-
} from "./index.server-
|
|
710
|
+
} from "./index.server-h3nzp8g8.js";
|
|
711
711
|
import"./index.server-p3aw22qv.js";
|
|
712
712
|
import {
|
|
713
713
|
accordion_item_default
|
|
714
|
-
} from "./index.server-
|
|
715
|
-
import"./index.server-
|
|
714
|
+
} from "./index.server-0rzd71e0.js";
|
|
715
|
+
import"./index.server-jwvxxjvc.js";
|
|
716
716
|
import"./index.server-bn02606y.js";
|
|
717
717
|
import {
|
|
718
718
|
action_row_default
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
const instanceId = $.props_id($$renderer2);
|
|
18
|
+
let {
|
|
19
|
+
id,
|
|
20
|
+
title,
|
|
21
|
+
disabled = false,
|
|
22
|
+
class: className,
|
|
23
|
+
style,
|
|
24
|
+
children
|
|
25
|
+
} = $$props;
|
|
26
|
+
const context = getAccordionContext();
|
|
27
|
+
const isExpanded = $.derived(() => context.expandedIds.includes(id));
|
|
28
|
+
const headerId = $.derived(() => `${instanceId}-header`);
|
|
29
|
+
const panelId = $.derived(() => `${instanceId}-panel`);
|
|
30
|
+
function handleClick() {
|
|
31
|
+
if (disabled)
|
|
32
|
+
return;
|
|
33
|
+
context.toggle(id);
|
|
34
|
+
}
|
|
35
|
+
$$renderer2.push(`<div${$.attr_class($.clsx(classNames("cinder-accordion-item", className)))}${$.attr_style(style)}${$.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> <div${$.attr("id", panelId())} class="cinder-accordion-item__panel"${$.attr("hidden", !isExpanded())}>`);
|
|
36
|
+
if (isExpanded()) {
|
|
37
|
+
$$renderer2.push("<!--[0-->");
|
|
38
|
+
$$renderer2.push(`<div class="cinder-accordion-item__panel-inner">`);
|
|
39
|
+
children($$renderer2);
|
|
40
|
+
$$renderer2.push(`<!----></div>`);
|
|
41
|
+
} else {
|
|
42
|
+
$$renderer2.push("<!--[-1-->");
|
|
43
|
+
}
|
|
44
|
+
$$renderer2.push(`<!--]--></div></div>`);
|
|
45
|
+
}, Accordion_item);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { setAccordionContext, Accordion_item };
|
|
49
|
+
|
|
50
|
+
//# debugId=D9BC38A69C5EE29564756E2164756E21
|
package/package.json
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"featured": true,
|
|
11
11
|
"code": "<script lang=\"ts\">\n import { Accordion } from '@lostgradient/cinder/accordion';\n\n let expandedIds = $state<string[]>([]);\n</script>\n\n<Accordion bind:expandedIds>\n <Accordion.Item id=\"item-1\" title=\"What is Cinder?\">\n Cinder is a Svelte 5 design system built for composability and accessibility.\n </Accordion.Item>\n <Accordion.Item id=\"item-2\" title=\"How do I install it?\">\n Run <code>bun add @lostgradient/cinder</code> and import components from\n <code>@lostgradient/cinder</code> or via subpath imports.\n </Accordion.Item>\n <Accordion.Item id=\"item-3\" title=\"Does it support SSR?\">\n Yes — every component is SSR-safe and renders meaningful HTML before hydration.\n </Accordion.Item>\n</Accordion>\n"
|
|
12
12
|
},
|
|
13
|
+
{
|
|
14
|
+
"id": "dense-inspector",
|
|
15
|
+
"title": "Dense inspector accordion",
|
|
16
|
+
"description": "Inspector panels can compact trigger and panel spacing with public Accordion.Item CSS variables.",
|
|
17
|
+
"code": "<script lang=\"ts\">\n import { Accordion } from '@lostgradient/cinder/accordion';\n\n let expandedIds = $state<string[]>(['selection', 'metadata']);\n</script>\n\n<div style=\"max-inline-size: 32rem;\">\n <Accordion multiple bind:expandedIds>\n <Accordion.Item\n id=\"selection\"\n title=\"Selection\"\n style=\"--cinder-accordion-item-trigger-padding-block: var(--cinder-space-2); --cinder-accordion-item-trigger-padding-inline: var(--cinder-space-3); --cinder-accordion-item-trigger-gap: var(--cinder-space-2); --cinder-accordion-item-trigger-font-size: var(--cinder-text-sm); --cinder-accordion-item-panel-inner-padding-block-start: var(--cinder-space-2); --cinder-accordion-item-panel-inner-padding-block-end: var(--cinder-space-3); --cinder-accordion-item-panel-inner-padding-inline: var(--cinder-space-3); --cinder-accordion-item-panel-font-size: var(--cinder-text-sm);\"\n >\n Current workflow edge, matched transition, and queued activity identifiers.\n </Accordion.Item>\n <Accordion.Item\n id=\"metadata\"\n title=\"Metadata\"\n style=\"--cinder-accordion-item-trigger-padding-block: var(--cinder-space-2); --cinder-accordion-item-trigger-padding-inline: var(--cinder-space-3); --cinder-accordion-item-trigger-gap: var(--cinder-space-2); --cinder-accordion-item-trigger-font-size: var(--cinder-text-sm); --cinder-accordion-item-panel-inner-padding-block-start: var(--cinder-space-2); --cinder-accordion-item-panel-inner-padding-block-end: var(--cinder-space-3); --cinder-accordion-item-panel-inner-padding-inline: var(--cinder-space-3); --cinder-accordion-item-panel-font-size: var(--cinder-text-sm);\"\n >\n Retry policy, namespace, task queue, and worker lease timing.\n </Accordion.Item>\n <Accordion.Item\n id=\"payload\"\n title=\"Payload\"\n style=\"--cinder-accordion-item-trigger-padding-block: var(--cinder-space-2); --cinder-accordion-item-trigger-padding-inline: var(--cinder-space-3); --cinder-accordion-item-trigger-gap: var(--cinder-space-2); --cinder-accordion-item-trigger-font-size: var(--cinder-text-sm); --cinder-accordion-item-panel-inner-padding-block-start: var(--cinder-space-2); --cinder-accordion-item-panel-inner-padding-block-end: var(--cinder-space-3); --cinder-accordion-item-panel-inner-padding-inline: var(--cinder-space-3); --cinder-accordion-item-panel-font-size: var(--cinder-text-sm);\"\n >\n Normalized event fields and source artifact references.\n </Accordion.Item>\n </Accordion>\n</div>\n"
|
|
18
|
+
},
|
|
13
19
|
{
|
|
14
20
|
"id": "disabled",
|
|
15
21
|
"title": "Disabled item",
|
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
* ======================================== */
|
|
6
6
|
|
|
7
7
|
.cinder-accordion-item {
|
|
8
|
+
--cinder-accordion-item-trigger-gap: var(--cinder-space-4);
|
|
9
|
+
--cinder-accordion-item-trigger-padding-block: var(--cinder-space-4);
|
|
10
|
+
--cinder-accordion-item-trigger-padding-inline: var(--cinder-space-5);
|
|
11
|
+
--cinder-accordion-item-trigger-font-size: var(--cinder-text-base);
|
|
12
|
+
--cinder-accordion-item-trigger-font-weight: var(--cinder-font-medium);
|
|
13
|
+
--cinder-accordion-item-panel-inner-padding-block-start: var(--cinder-space-4);
|
|
14
|
+
--cinder-accordion-item-panel-inner-padding-block-end: var(--cinder-space-5);
|
|
15
|
+
--cinder-accordion-item-panel-inner-padding-inline: var(--cinder-space-5);
|
|
16
|
+
--cinder-accordion-item-panel-font-size: var(--cinder-text-base);
|
|
17
|
+
--cinder-accordion-item-panel-line-height: var(--cinder-leading-normal);
|
|
8
18
|
border-block-end: 1px solid var(--cinder-border);
|
|
9
19
|
}
|
|
10
20
|
|
|
@@ -31,12 +41,13 @@
|
|
|
31
41
|
display: flex;
|
|
32
42
|
align-items: center;
|
|
33
43
|
justify-content: space-between;
|
|
34
|
-
gap: var(--cinder-space-4);
|
|
44
|
+
gap: var(--cinder-accordion-item-trigger-gap, var(--cinder-space-4));
|
|
35
45
|
width: 100%;
|
|
36
|
-
padding: var(--cinder-
|
|
46
|
+
padding: var(--cinder-accordion-item-trigger-padding-block, var(--cinder-space-4))
|
|
47
|
+
var(--cinder-accordion-item-trigger-padding-inline, var(--cinder-space-5));
|
|
37
48
|
|
|
38
|
-
font-size: var(--cinder-text-base);
|
|
39
|
-
font-weight: var(--cinder-font-medium);
|
|
49
|
+
font-size: var(--cinder-accordion-item-trigger-font-size, var(--cinder-text-base));
|
|
50
|
+
font-weight: var(--cinder-accordion-item-trigger-font-weight, var(--cinder-font-medium));
|
|
40
51
|
line-height: var(--cinder-leading-snug);
|
|
41
52
|
color: var(--cinder-text);
|
|
42
53
|
text-align: start;
|
|
@@ -146,9 +157,11 @@
|
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
.cinder-accordion-item__panel-inner {
|
|
149
|
-
padding: var(--cinder-
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
padding: var(--cinder-accordion-item-panel-inner-padding-block-start, var(--cinder-space-4))
|
|
161
|
+
var(--cinder-accordion-item-panel-inner-padding-inline, var(--cinder-space-5))
|
|
162
|
+
var(--cinder-accordion-item-panel-inner-padding-block-end, var(--cinder-space-5));
|
|
163
|
+
font-size: var(--cinder-accordion-item-panel-font-size, var(--cinder-text-base));
|
|
164
|
+
line-height: var(--cinder-accordion-item-panel-line-height, var(--cinder-leading-normal));
|
|
152
165
|
color: var(--cinder-text-muted);
|
|
153
166
|
}
|
|
154
167
|
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"class": {
|
|
19
19
|
"type": "string",
|
|
20
20
|
"description": "Additional CSS class merged with `.cinder-accordion-item`."
|
|
21
|
+
},
|
|
22
|
+
"style": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Inline style string applied to the `.cinder-accordion-item` root."
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"additionalProperties": false,
|
|
@@ -21,6 +21,10 @@ const schema = {
|
|
|
21
21
|
type: 'string',
|
|
22
22
|
description: 'Additional CSS class merged with `.cinder-accordion-item`.',
|
|
23
23
|
},
|
|
24
|
+
style: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Inline style string applied to the `.cinder-accordion-item` root.',
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
additionalProperties: false,
|
|
26
30
|
required: ['id', 'title'],
|
|
@@ -5,11 +5,12 @@ export {};
|
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { getAccordionContext } from '../accordion/accordion.context.ts';
|
|
7
7
|
import { classNames } from '../../utilities/class-names.ts';
|
|
8
|
-
let { id, title, disabled = false, class: className, children } = $props();
|
|
8
|
+
let { id, title, disabled = false, class: className, style, children, } = $props();
|
|
9
9
|
const context = getAccordionContext();
|
|
10
|
+
const instanceId = $props.id();
|
|
10
11
|
const isExpanded = $derived(context.expandedIds.includes(id));
|
|
11
|
-
const headerId = $derived(`${
|
|
12
|
-
const panelId = $derived(`${
|
|
12
|
+
const headerId = $derived(`${instanceId}-header`);
|
|
13
|
+
const panelId = $derived(`${instanceId}-panel`);
|
|
13
14
|
function handleClick() {
|
|
14
15
|
if (disabled)
|
|
15
16
|
return;
|
|
@@ -19,6 +20,7 @@ function handleClick() {
|
|
|
19
20
|
|
|
20
21
|
<div
|
|
21
22
|
class={classNames('cinder-accordion-item', className)}
|
|
23
|
+
{style}
|
|
22
24
|
data-cinder-expanded={isExpanded ? '' : undefined}
|
|
23
25
|
data-cinder-disabled={disabled ? '' : undefined}
|
|
24
26
|
>
|
|
@@ -50,11 +52,11 @@ function handleClick() {
|
|
|
50
52
|
</button>
|
|
51
53
|
</h3>
|
|
52
54
|
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
+
<div id={panelId} class="cinder-accordion-item__panel" hidden={!isExpanded}>
|
|
56
|
+
{#if isExpanded}
|
|
55
57
|
<div class="cinder-accordion-item__panel-inner">
|
|
56
58
|
{@render children()}
|
|
57
59
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
60
62
|
</div>
|
|
@@ -13,6 +13,8 @@ export type AccordionItemProps = {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
/** Additional CSS class merged with `.cinder-accordion-item`. */
|
|
15
15
|
class?: string;
|
|
16
|
+
/** Inline style string applied to the `.cinder-accordion-item` root. */
|
|
17
|
+
style?: string;
|
|
16
18
|
/** Panel content rendered when the item is expanded. */
|
|
17
19
|
children: Snippet;
|
|
18
20
|
};
|
|
@@ -30,4 +32,6 @@ export interface AccordionItemSchemaProps {
|
|
|
30
32
|
disabled?: boolean;
|
|
31
33
|
/** Additional CSS class merged with `.cinder-accordion-item`. */
|
|
32
34
|
class?: string;
|
|
35
|
+
/** Inline style string applied to the `.cinder-accordion-item` root. */
|
|
36
|
+
style?: string;
|
|
33
37
|
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
[
|
|
1
|
+
[
|
|
2
|
+
"--cinder-accordion-item-panel-font-size",
|
|
3
|
+
"--cinder-accordion-item-panel-inner-padding-block-end",
|
|
4
|
+
"--cinder-accordion-item-panel-inner-padding-block-start",
|
|
5
|
+
"--cinder-accordion-item-panel-inner-padding-inline",
|
|
6
|
+
"--cinder-accordion-item-panel-line-height",
|
|
7
|
+
"--cinder-accordion-item-trigger-font-size",
|
|
8
|
+
"--cinder-accordion-item-trigger-font-weight",
|
|
9
|
+
"--cinder-accordion-item-trigger-gap",
|
|
10
|
+
"--cinder-accordion-item-trigger-padding-block",
|
|
11
|
+
"--cinder-accordion-item-trigger-padding-inline"
|
|
12
|
+
]
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
const variables: readonly string[] = [
|
|
1
|
+
const variables: readonly string[] = [
|
|
2
|
+
'--cinder-accordion-item-panel-font-size',
|
|
3
|
+
'--cinder-accordion-item-panel-inner-padding-block-end',
|
|
4
|
+
'--cinder-accordion-item-panel-inner-padding-block-start',
|
|
5
|
+
'--cinder-accordion-item-panel-inner-padding-inline',
|
|
6
|
+
'--cinder-accordion-item-panel-line-height',
|
|
7
|
+
'--cinder-accordion-item-trigger-font-size',
|
|
8
|
+
'--cinder-accordion-item-trigger-font-weight',
|
|
9
|
+
'--cinder-accordion-item-trigger-gap',
|
|
10
|
+
'--cinder-accordion-item-trigger-padding-block',
|
|
11
|
+
'--cinder-accordion-item-trigger-padding-inline',
|
|
12
|
+
];
|
|
2
13
|
|
|
3
14
|
export default variables;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
2
|
@layer cinder.components {
|
|
3
3
|
.cinder-action-row {
|
|
4
|
+
--cinder-action-row-padding-block: var(--cinder-space-3);
|
|
5
|
+
--cinder-action-row-padding-inline: var(--cinder-space-4);
|
|
6
|
+
--cinder-action-row-layout-column-gap: var(--cinder-space-3);
|
|
7
|
+
--cinder-action-row-layout-row-gap: var(--cinder-space-2);
|
|
8
|
+
--cinder-action-row-body-gap: var(--cinder-space-1);
|
|
9
|
+
--cinder-action-row-title-font-size: var(--cinder-text-sm);
|
|
10
|
+
--cinder-action-row-description-font-size: var(--cinder-text-sm);
|
|
11
|
+
--cinder-action-row-meta-font-size: var(--cinder-text-xs);
|
|
12
|
+
--cinder-action-row-trailing-gap: var(--cinder-space-2);
|
|
4
13
|
display: block;
|
|
5
14
|
inline-size: 100%;
|
|
6
|
-
padding: var(--cinder-
|
|
15
|
+
padding: var(--cinder-action-row-padding-block, var(--cinder-space-3))
|
|
16
|
+
var(--cinder-action-row-padding-inline, var(--cinder-space-4));
|
|
7
17
|
border: 0;
|
|
8
18
|
border-radius: var(--cinder-radius-md);
|
|
9
19
|
background: transparent;
|
|
@@ -14,7 +24,8 @@
|
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
.cinder-action-row[data-cinder-density='condensed'] {
|
|
17
|
-
|
|
27
|
+
--cinder-action-row-padding-block: var(--cinder-space-2);
|
|
28
|
+
--cinder-action-row-padding-inline: var(--cinder-space-3);
|
|
18
29
|
}
|
|
19
30
|
|
|
20
31
|
@media (hover: hover) {
|
|
@@ -67,8 +78,8 @@
|
|
|
67
78
|
.cinder-action-row__layout {
|
|
68
79
|
display: grid;
|
|
69
80
|
align-items: center;
|
|
70
|
-
column-gap: var(--cinder-space-3);
|
|
71
|
-
row-gap: var(--cinder-space-2);
|
|
81
|
+
column-gap: var(--cinder-action-row-layout-column-gap, var(--cinder-space-3));
|
|
82
|
+
row-gap: var(--cinder-action-row-layout-row-gap, var(--cinder-space-2));
|
|
72
83
|
grid-template-columns: 1fr;
|
|
73
84
|
grid-template-areas: 'body';
|
|
74
85
|
}
|
|
@@ -99,34 +110,34 @@
|
|
|
99
110
|
display: flex;
|
|
100
111
|
min-inline-size: 0;
|
|
101
112
|
flex-direction: column;
|
|
102
|
-
gap: var(--cinder-space-1);
|
|
113
|
+
gap: var(--cinder-action-row-body-gap, var(--cinder-space-1));
|
|
103
114
|
}
|
|
104
115
|
|
|
105
116
|
.cinder-action-row__trailing {
|
|
106
117
|
grid-area: trailing;
|
|
107
118
|
display: inline-flex;
|
|
108
119
|
align-items: center;
|
|
109
|
-
gap: var(--cinder-space-2);
|
|
120
|
+
gap: var(--cinder-action-row-trailing-gap, var(--cinder-space-2));
|
|
110
121
|
color: var(--cinder-text-muted);
|
|
111
122
|
}
|
|
112
123
|
|
|
113
124
|
.cinder-action-row__title {
|
|
114
125
|
color: inherit;
|
|
115
|
-
font-size: var(--cinder-text-sm);
|
|
126
|
+
font-size: var(--cinder-action-row-title-font-size, var(--cinder-text-sm));
|
|
116
127
|
line-height: var(--cinder-leading-snug);
|
|
117
128
|
overflow-wrap: anywhere;
|
|
118
129
|
}
|
|
119
130
|
|
|
120
131
|
.cinder-action-row__description {
|
|
121
132
|
color: var(--cinder-text-muted);
|
|
122
|
-
font-size: var(--cinder-text-sm);
|
|
133
|
+
font-size: var(--cinder-action-row-description-font-size, var(--cinder-text-sm));
|
|
123
134
|
line-height: var(--cinder-leading-snug);
|
|
124
135
|
overflow-wrap: anywhere;
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
.cinder-action-row__meta {
|
|
128
139
|
color: var(--cinder-text-muted);
|
|
129
|
-
font-size: var(--cinder-text-xs);
|
|
140
|
+
font-size: var(--cinder-action-row-meta-font-size, var(--cinder-text-xs));
|
|
130
141
|
line-height: var(--cinder-leading-snug);
|
|
131
142
|
overflow-wrap: anywhere;
|
|
132
143
|
}
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"description": "Rows with button semantics for master-detail lists and timeline selections.",
|
|
10
10
|
"code": "<script lang=\"ts\">\n import ActionRow from '@lostgradient/cinder/action-row';\n\n let selectedRun = $state('run-2');\n\n const runs = [\n { id: 'run-1', title: 'Morning sync', status: 'Queued', time: '09:00' },\n { id: 'run-2', title: 'Webhook replay', status: 'Running', time: '09:12' },\n { id: 'run-3', title: 'Cleanup sweep', status: 'Finished', time: '09:18' },\n ];\n</script>\n\n<div style=\"display: grid; gap: var(--cinder-space-1); max-inline-size: 28rem;\">\n {#each runs as run (run.id)}\n <ActionRow\n selected={selectedRun === run.id}\n onclick={() => {\n selectedRun = run.id;\n }}\n >\n {#snippet title()}{run.title}{/snippet}\n {#snippet description()}{run.status}{/snippet}\n {#snippet meta()}Run {run.id}{/snippet}\n {#snippet trailing()}{run.time}{/snippet}\n </ActionRow>\n {/each}\n</div>\n"
|
|
11
11
|
},
|
|
12
|
+
{
|
|
13
|
+
"id": "dense-timeline",
|
|
14
|
+
"title": "Dense timeline rows",
|
|
15
|
+
"description": "Timeline rows can tune row padding, layout gap, and description/meta type through public CSS variables.",
|
|
16
|
+
"code": "<script lang=\"ts\">\n import ActionRow from '@lostgradient/cinder/action-row';\n\n let selectedEvent = $state('event-2');\n\n const events = [\n {\n id: 'event-1',\n title: 'Webhook received',\n description: 'Payload validated against the trigger schema',\n meta: 'Queued',\n time: '09:14:02',\n },\n {\n id: 'event-2',\n title: 'Workflow matched',\n description: 'Selected branch accepted the event filters',\n meta: 'Current',\n time: '09:14:04',\n },\n {\n id: 'event-3',\n title: 'Activity scheduled',\n description: 'Worker lease created for the next attempt',\n meta: 'Pending',\n time: '09:14:05',\n },\n ];\n</script>\n\n<div style=\"display: grid; gap: var(--cinder-space-1); max-inline-size: 32rem;\">\n {#each events as event (event.id)}\n <ActionRow\n density=\"condensed\"\n style=\"--cinder-action-row-padding-block: var(--cinder-space-1); --cinder-action-row-padding-inline: var(--cinder-space-2); --cinder-action-row-layout-column-gap: var(--cinder-space-2); --cinder-action-row-body-gap: 0; --cinder-action-row-description-font-size: var(--cinder-text-xs); --cinder-action-row-meta-font-size: var(--cinder-text-xs);\"\n selected={selectedEvent === event.id}\n selectedState=\"current\"\n currentValue=\"step\"\n onclick={() => {\n selectedEvent = event.id;\n }}\n >\n {#snippet title()}{event.title}{/snippet}\n {#snippet description()}{event.description}{/snippet}\n {#snippet meta()}{event.meta}{/snippet}\n {#snippet trailing()}{event.time}{/snippet}\n </ActionRow>\n {/each}\n</div>\n"
|
|
17
|
+
},
|
|
12
18
|
{
|
|
13
19
|
"id": "timeline-edge",
|
|
14
20
|
"title": "Timeline edge rows",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"class": {
|
|
31
31
|
"type": "string",
|
|
32
32
|
"description": "Additional classes merged with `.cinder-action-row`."
|
|
33
|
+
},
|
|
34
|
+
"style": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Inline style string applied to the `.cinder-action-row` root."
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"additionalProperties": false,
|
|
@@ -35,6 +35,10 @@ const schema = {
|
|
|
35
35
|
type: 'string',
|
|
36
36
|
description: 'Additional classes merged with `.cinder-action-row`.',
|
|
37
37
|
},
|
|
38
|
+
style: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Inline style string applied to the `.cinder-action-row` root.',
|
|
41
|
+
},
|
|
38
42
|
},
|
|
39
43
|
additionalProperties: false,
|
|
40
44
|
metadata: {
|