@spark-web/description-list 0.0.0-snapshot-release-20260401034720

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 ADDED
@@ -0,0 +1,11 @@
1
+ # @spark-web/description-list
2
+
3
+ ## 0.0.0-snapshot-release-20260401034720
4
+
5
+ ### Minor Changes
6
+
7
+ - [#782](https://github.com/brighte-labs/spark-web/pull/782)
8
+ [`b2d2761`](https://github.com/brighte-labs/spark-web/commit/b2d276158c169b9d6913707f231851b0ee16f3e3)
9
+ Thanks [@jacobporci-brighte](https://github.com/jacobporci-brighte)! - **tag,
10
+ overflow-menu, highlight-card, description-list, section-header,
11
+ section-card:** add new accreditation component packages
package/CLAUDE.md ADDED
@@ -0,0 +1,49 @@
1
+ # @spark-web/description-list
2
+
3
+ A key-value display component for labeled data rows. Renders semantic
4
+ `<dl>`/`<dt>`/`<dd>` HTML. Each row has a label and value, with an optional icon
5
+ before the value.
6
+
7
+ ## Usage
8
+
9
+ ```tsx
10
+ import { DescriptionList } from '@spark-web/description-list';
11
+
12
+ <DescriptionList
13
+ items={[
14
+ { label: 'Status', value: 'Active' },
15
+ { label: 'Amount', value: '$1,200', icon: <DollarIcon /> },
16
+ { label: 'Note', value: <Text tone="critical">Overdue</Text> },
17
+ ]}
18
+ />;
19
+ ```
20
+
21
+ ## Key props
22
+
23
+ | Prop | Type | Default | Notes |
24
+ | ------------- | ----------------------- | ---------- | ----------------------------------- |
25
+ | `items` | `DescriptionListItem[]` | required | |
26
+ | `showDivider` | `boolean` | `true` | Renders a bottom border on each row |
27
+ | `labelSize` | `TextSize` | `'small'` | |
28
+ | `labelTone` | `ForegroundTone` | `'muted'` | |
29
+ | `valueSize` | `TextSize` | `'small'` | Only applies to string values |
30
+ | `padding` | `SpacingScale` | `'xlarge'` | Outer padding of the list |
31
+ | `paddingTop` | `SpacingScale` | `'large'` | Overrides top padding |
32
+ | `data` | `DataAttributeMap` | — | Test/analytics attributes |
33
+
34
+ ## DescriptionListItem shape
35
+
36
+ ```ts
37
+ {
38
+ label: string;
39
+ value: ReactNode; // string auto-wrapped in <Text>
40
+ icon?: ReactNode; // displayed before the value
41
+ layout?: 'fixed' | 'auto'; // 'fixed' = 40/60 split; 'auto' = space-between
42
+ }
43
+ ```
44
+
45
+ ## Constraints
46
+
47
+ - `layout` is per-row — rows in the same list can mix layouts
48
+ - Divider borders are Emotion styles; do not assert via
49
+ `getAttribute('border-bottom')` in tests — use `toHaveStyle` or a test id
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # @spark-web/description-list
2
+
3
+ A key-value display component for showing labeled data in rows.
4
+
5
+ ## Usage
6
+
7
+ ```tsx
8
+ import { DescriptionList } from '@spark-web/description-list';
9
+
10
+ <DescriptionList
11
+ items={[
12
+ { label: 'Name', value: 'John Smith' },
13
+ { label: 'Email', value: 'john@example.com' },
14
+ ]}
15
+ />;
16
+ ```
@@ -0,0 +1,45 @@
1
+ import type { BoxProps } from '@spark-web/box';
2
+ import type { ForegroundTone } from '@spark-web/text';
3
+ import type { SparkTheme } from '@spark-web/theme';
4
+ import type { DataAttributeMap } from '@spark-web/utils/internal';
5
+ import type { ReactNode } from 'react';
6
+ type TextSize = keyof SparkTheme['typography']['text'];
7
+ type SpacingScale = NonNullable<BoxProps['padding']>;
8
+ /**
9
+ * DescriptionList
10
+ *
11
+ * A key-value display component for showing labeled data in rows.
12
+ * Each row has a label and a value, with an optional icon.
13
+ *
14
+ * @see https://spark.brighte.com.au/package/description-list
15
+ */
16
+ export declare function DescriptionList({ items, labelSize, labelTone, padding, paddingTop, showDivider, valueSize, data, }: DescriptionListProps): import("@emotion/react/jsx-runtime").JSX.Element;
17
+ export type DescriptionListProps = {
18
+ /** The list of items to display. */
19
+ items: DescriptionListItem[];
20
+ /** The size of the label text. Defaults to 'small'. */
21
+ labelSize?: TextSize;
22
+ /** The tone of the label text. Defaults to 'muted'. */
23
+ labelTone?: ForegroundTone;
24
+ /** Padding around the list. */
25
+ padding?: SpacingScale;
26
+ /** Top padding for the list. */
27
+ paddingTop?: SpacingScale;
28
+ /** Whether to show a bottom border/divider on each row. Defaults to true. */
29
+ showDivider?: boolean;
30
+ /** The size of string values. Defaults to 'small'. */
31
+ valueSize?: TextSize;
32
+ /** Sets data attributes on the component. */
33
+ data?: DataAttributeMap;
34
+ };
35
+ export type DescriptionListItem = {
36
+ /** The label/title for the row. */
37
+ label: string;
38
+ /** The value to display — can be a string or custom ReactNode. */
39
+ value: ReactNode;
40
+ /** An optional icon to display before the value. */
41
+ icon?: ReactNode;
42
+ /** Layout mode: 'fixed' uses 40/60 column split, 'auto' uses space-between. */
43
+ layout?: 'fixed' | 'auto';
44
+ };
45
+ export {};
@@ -0,0 +1,2 @@
1
+ export { DescriptionList } from "./description-list.js";
2
+ export type { DescriptionListItem, DescriptionListProps, } from "./description-list.js";
@@ -0,0 +1,2 @@
1
+ export * from "./declarations/src/index.js";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bhcmstd2ViLWRlc2NyaXB0aW9uLWxpc3QuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
6
+ var react = require('@emotion/react');
7
+ var box = require('@spark-web/box');
8
+ var inline = require('@spark-web/inline');
9
+ var text = require('@spark-web/text');
10
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
11
+
12
+ /**
13
+ * DescriptionList
14
+ *
15
+ * A key-value display component for showing labeled data in rows.
16
+ * Each row has a label and a value, with an optional icon.
17
+ *
18
+ * @see https://spark.brighte.com.au/package/description-list
19
+ */
20
+ function DescriptionList(_ref) {
21
+ var items = _ref.items,
22
+ _ref$labelSize = _ref.labelSize,
23
+ labelSize = _ref$labelSize === void 0 ? 'small' : _ref$labelSize,
24
+ _ref$labelTone = _ref.labelTone,
25
+ labelTone = _ref$labelTone === void 0 ? 'muted' : _ref$labelTone,
26
+ _ref$padding = _ref.padding,
27
+ padding = _ref$padding === void 0 ? 'xlarge' : _ref$padding,
28
+ _ref$paddingTop = _ref.paddingTop,
29
+ paddingTop = _ref$paddingTop === void 0 ? 'large' : _ref$paddingTop,
30
+ _ref$showDivider = _ref.showDivider,
31
+ showDivider = _ref$showDivider === void 0 ? true : _ref$showDivider,
32
+ _ref$valueSize = _ref.valueSize,
33
+ valueSize = _ref$valueSize === void 0 ? 'small' : _ref$valueSize,
34
+ data = _ref.data;
35
+ return jsxRuntime.jsx(box.Box, {
36
+ as: "dl",
37
+ data: data,
38
+ padding: padding,
39
+ paddingTop: paddingTop,
40
+ children: items.map(function (item) {
41
+ return jsxRuntime.jsx(DescriptionListRow, _objectSpread({
42
+ labelSize: labelSize,
43
+ labelTone: labelTone,
44
+ showDivider: showDivider,
45
+ valueSize: valueSize
46
+ }, item), item.label);
47
+ })
48
+ });
49
+ }
50
+ function DescriptionListRow(_ref2) {
51
+ var label = _ref2.label,
52
+ labelSize = _ref2.labelSize,
53
+ labelTone = _ref2.labelTone,
54
+ value = _ref2.value,
55
+ icon = _ref2.icon,
56
+ _ref2$layout = _ref2.layout,
57
+ layout = _ref2$layout === void 0 ? 'fixed' : _ref2$layout,
58
+ showDivider = _ref2.showDivider,
59
+ valueSize = _ref2.valueSize;
60
+ var isFixed = layout === 'fixed';
61
+ var labelStyles = react.css(isFixed ? {
62
+ flex: 0.4
63
+ } : {});
64
+ var valueStyles = react.css(_objectSpread(_objectSpread({}, isFixed ? {
65
+ flex: 0.6
66
+ } : {}), {}, {
67
+ textAlign: isFixed ? 'inherit' : 'end'
68
+ }));
69
+ return jsxRuntime.jsxs(box.Box, _objectSpread(_objectSpread(_objectSpread({
70
+ display: "flex",
71
+ paddingY: "small",
72
+ alignItems: "center",
73
+ gap: "large",
74
+ css: react.css({
75
+ minHeight: '34px'
76
+ })
77
+ }, showDivider && {
78
+ borderBottom: 'neutral'
79
+ }), !isFixed && {
80
+ justifyContent: 'spaceBetween'
81
+ }), {}, {
82
+ children: [jsxRuntime.jsx(box.Box, {
83
+ as: "dt",
84
+ css: labelStyles,
85
+ children: jsxRuntime.jsx(text.Text, {
86
+ size: labelSize,
87
+ tone: labelTone,
88
+ children: label
89
+ })
90
+ }), jsxRuntime.jsx(box.Box, {
91
+ as: "dd",
92
+ css: valueStyles,
93
+ children: jsxRuntime.jsxs(inline.Inline, {
94
+ gap: "xsmall",
95
+ alignY: "center",
96
+ children: [icon, typeof value === 'string' ? jsxRuntime.jsx(text.Text, {
97
+ size: valueSize,
98
+ children: value
99
+ }) : value]
100
+ })
101
+ })]
102
+ }));
103
+ }
104
+
105
+ exports.DescriptionList = DescriptionList;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./spark-web-description-list.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./spark-web-description-list.cjs.dev.js");
7
+ }
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
6
+ var react = require('@emotion/react');
7
+ var box = require('@spark-web/box');
8
+ var inline = require('@spark-web/inline');
9
+ var text = require('@spark-web/text');
10
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
11
+
12
+ /**
13
+ * DescriptionList
14
+ *
15
+ * A key-value display component for showing labeled data in rows.
16
+ * Each row has a label and a value, with an optional icon.
17
+ *
18
+ * @see https://spark.brighte.com.au/package/description-list
19
+ */
20
+ function DescriptionList(_ref) {
21
+ var items = _ref.items,
22
+ _ref$labelSize = _ref.labelSize,
23
+ labelSize = _ref$labelSize === void 0 ? 'small' : _ref$labelSize,
24
+ _ref$labelTone = _ref.labelTone,
25
+ labelTone = _ref$labelTone === void 0 ? 'muted' : _ref$labelTone,
26
+ _ref$padding = _ref.padding,
27
+ padding = _ref$padding === void 0 ? 'xlarge' : _ref$padding,
28
+ _ref$paddingTop = _ref.paddingTop,
29
+ paddingTop = _ref$paddingTop === void 0 ? 'large' : _ref$paddingTop,
30
+ _ref$showDivider = _ref.showDivider,
31
+ showDivider = _ref$showDivider === void 0 ? true : _ref$showDivider,
32
+ _ref$valueSize = _ref.valueSize,
33
+ valueSize = _ref$valueSize === void 0 ? 'small' : _ref$valueSize,
34
+ data = _ref.data;
35
+ return jsxRuntime.jsx(box.Box, {
36
+ as: "dl",
37
+ data: data,
38
+ padding: padding,
39
+ paddingTop: paddingTop,
40
+ children: items.map(function (item) {
41
+ return jsxRuntime.jsx(DescriptionListRow, _objectSpread({
42
+ labelSize: labelSize,
43
+ labelTone: labelTone,
44
+ showDivider: showDivider,
45
+ valueSize: valueSize
46
+ }, item), item.label);
47
+ })
48
+ });
49
+ }
50
+ function DescriptionListRow(_ref2) {
51
+ var label = _ref2.label,
52
+ labelSize = _ref2.labelSize,
53
+ labelTone = _ref2.labelTone,
54
+ value = _ref2.value,
55
+ icon = _ref2.icon,
56
+ _ref2$layout = _ref2.layout,
57
+ layout = _ref2$layout === void 0 ? 'fixed' : _ref2$layout,
58
+ showDivider = _ref2.showDivider,
59
+ valueSize = _ref2.valueSize;
60
+ var isFixed = layout === 'fixed';
61
+ var labelStyles = react.css(isFixed ? {
62
+ flex: 0.4
63
+ } : {});
64
+ var valueStyles = react.css(_objectSpread(_objectSpread({}, isFixed ? {
65
+ flex: 0.6
66
+ } : {}), {}, {
67
+ textAlign: isFixed ? 'inherit' : 'end'
68
+ }));
69
+ return jsxRuntime.jsxs(box.Box, _objectSpread(_objectSpread(_objectSpread({
70
+ display: "flex",
71
+ paddingY: "small",
72
+ alignItems: "center",
73
+ gap: "large",
74
+ css: react.css({
75
+ minHeight: '34px'
76
+ })
77
+ }, showDivider && {
78
+ borderBottom: 'neutral'
79
+ }), !isFixed && {
80
+ justifyContent: 'spaceBetween'
81
+ }), {}, {
82
+ children: [jsxRuntime.jsx(box.Box, {
83
+ as: "dt",
84
+ css: labelStyles,
85
+ children: jsxRuntime.jsx(text.Text, {
86
+ size: labelSize,
87
+ tone: labelTone,
88
+ children: label
89
+ })
90
+ }), jsxRuntime.jsx(box.Box, {
91
+ as: "dd",
92
+ css: valueStyles,
93
+ children: jsxRuntime.jsxs(inline.Inline, {
94
+ gap: "xsmall",
95
+ alignY: "center",
96
+ children: [icon, typeof value === 'string' ? jsxRuntime.jsx(text.Text, {
97
+ size: valueSize,
98
+ children: value
99
+ }) : value]
100
+ })
101
+ })]
102
+ }));
103
+ }
104
+
105
+ exports.DescriptionList = DescriptionList;
@@ -0,0 +1,101 @@
1
+ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
2
+ import { css } from '@emotion/react';
3
+ import { Box } from '@spark-web/box';
4
+ import { Inline } from '@spark-web/inline';
5
+ import { Text } from '@spark-web/text';
6
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
7
+
8
+ /**
9
+ * DescriptionList
10
+ *
11
+ * A key-value display component for showing labeled data in rows.
12
+ * Each row has a label and a value, with an optional icon.
13
+ *
14
+ * @see https://spark.brighte.com.au/package/description-list
15
+ */
16
+ function DescriptionList(_ref) {
17
+ var items = _ref.items,
18
+ _ref$labelSize = _ref.labelSize,
19
+ labelSize = _ref$labelSize === void 0 ? 'small' : _ref$labelSize,
20
+ _ref$labelTone = _ref.labelTone,
21
+ labelTone = _ref$labelTone === void 0 ? 'muted' : _ref$labelTone,
22
+ _ref$padding = _ref.padding,
23
+ padding = _ref$padding === void 0 ? 'xlarge' : _ref$padding,
24
+ _ref$paddingTop = _ref.paddingTop,
25
+ paddingTop = _ref$paddingTop === void 0 ? 'large' : _ref$paddingTop,
26
+ _ref$showDivider = _ref.showDivider,
27
+ showDivider = _ref$showDivider === void 0 ? true : _ref$showDivider,
28
+ _ref$valueSize = _ref.valueSize,
29
+ valueSize = _ref$valueSize === void 0 ? 'small' : _ref$valueSize,
30
+ data = _ref.data;
31
+ return jsx(Box, {
32
+ as: "dl",
33
+ data: data,
34
+ padding: padding,
35
+ paddingTop: paddingTop,
36
+ children: items.map(function (item) {
37
+ return jsx(DescriptionListRow, _objectSpread({
38
+ labelSize: labelSize,
39
+ labelTone: labelTone,
40
+ showDivider: showDivider,
41
+ valueSize: valueSize
42
+ }, item), item.label);
43
+ })
44
+ });
45
+ }
46
+ function DescriptionListRow(_ref2) {
47
+ var label = _ref2.label,
48
+ labelSize = _ref2.labelSize,
49
+ labelTone = _ref2.labelTone,
50
+ value = _ref2.value,
51
+ icon = _ref2.icon,
52
+ _ref2$layout = _ref2.layout,
53
+ layout = _ref2$layout === void 0 ? 'fixed' : _ref2$layout,
54
+ showDivider = _ref2.showDivider,
55
+ valueSize = _ref2.valueSize;
56
+ var isFixed = layout === 'fixed';
57
+ var labelStyles = css(isFixed ? {
58
+ flex: 0.4
59
+ } : {});
60
+ var valueStyles = css(_objectSpread(_objectSpread({}, isFixed ? {
61
+ flex: 0.6
62
+ } : {}), {}, {
63
+ textAlign: isFixed ? 'inherit' : 'end'
64
+ }));
65
+ return jsxs(Box, _objectSpread(_objectSpread(_objectSpread({
66
+ display: "flex",
67
+ paddingY: "small",
68
+ alignItems: "center",
69
+ gap: "large",
70
+ css: css({
71
+ minHeight: '34px'
72
+ })
73
+ }, showDivider && {
74
+ borderBottom: 'neutral'
75
+ }), !isFixed && {
76
+ justifyContent: 'spaceBetween'
77
+ }), {}, {
78
+ children: [jsx(Box, {
79
+ as: "dt",
80
+ css: labelStyles,
81
+ children: jsx(Text, {
82
+ size: labelSize,
83
+ tone: labelTone,
84
+ children: label
85
+ })
86
+ }), jsx(Box, {
87
+ as: "dd",
88
+ css: valueStyles,
89
+ children: jsxs(Inline, {
90
+ gap: "xsmall",
91
+ alignY: "center",
92
+ children: [icon, typeof value === 'string' ? jsx(Text, {
93
+ size: valueSize,
94
+ children: value
95
+ }) : value]
96
+ })
97
+ })]
98
+ }));
99
+ }
100
+
101
+ export { DescriptionList };
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@spark-web/description-list",
3
+ "version": "0.0.0-snapshot-release-20260401034720",
4
+ "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/brighte-labs/spark-web.git",
8
+ "directory": "packages/description-list"
9
+ },
10
+ "main": "dist/spark-web-description-list.cjs.js",
11
+ "module": "dist/spark-web-description-list.esm.js",
12
+ "files": [
13
+ "CHANGELOG.md",
14
+ "CLAUDE.md",
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "dependencies": {
19
+ "@babel/runtime": "^7.25.0",
20
+ "@emotion/react": "^11.14.0",
21
+ "@spark-web/box": "^6.0.0",
22
+ "@spark-web/inline": "^5.1.0",
23
+ "@spark-web/text": "^5.3.0",
24
+ "@spark-web/theme": "^5.13.0",
25
+ "@spark-web/utils": "^5.1.0"
26
+ },
27
+ "devDependencies": {
28
+ "@types/react": "^19.1.0",
29
+ "react": "^19.1.0"
30
+ },
31
+ "peerDependencies": {
32
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
33
+ },
34
+ "engines": {
35
+ "node": ">=14"
36
+ }
37
+ }