@spark-web/section-card 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 +11 -0
- package/CLAUDE.md +42 -0
- package/README.md +22 -0
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/section-card.d.ts +26 -0
- package/dist/spark-web-section-card.cjs.d.ts +2 -0
- package/dist/spark-web-section-card.cjs.dev.js +43 -0
- package/dist/spark-web-section-card.cjs.js +7 -0
- package/dist/spark-web-section-card.cjs.prod.js +43 -0
- package/dist/spark-web-section-card.esm.js +39 -0
- package/package.json +38 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @spark-web/section-card
|
|
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,42 @@
|
|
|
1
|
+
# @spark-web/section-card
|
|
2
|
+
|
|
3
|
+
A card container for content sections with optional header and footer slots.
|
|
4
|
+
Compose with `SectionHeader` for a complete section layout.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { SectionCard } from '@spark-web/section-card';
|
|
10
|
+
import { SectionHeader } from '@spark-web/section-header';
|
|
11
|
+
|
|
12
|
+
<SectionCard
|
|
13
|
+
header={
|
|
14
|
+
<SectionHeader
|
|
15
|
+
label="Details"
|
|
16
|
+
action={{ type: 'button', label: 'Edit', onClick: handleEdit }}
|
|
17
|
+
/>
|
|
18
|
+
}
|
|
19
|
+
footer={<Button>Save</Button>}
|
|
20
|
+
>
|
|
21
|
+
<DescriptionList items={items} />
|
|
22
|
+
</SectionCard>;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Key props
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Notes |
|
|
28
|
+
| ---------- | ----------------------------------------------------- | ---------- | ----------------------------------------------------------- |
|
|
29
|
+
| `children` | `ReactNode` | required | Main content area |
|
|
30
|
+
| `header` | `ReactNode` | — | Renders above the padded content; use `SectionHeader` |
|
|
31
|
+
| `footer` | `ReactNode` | — | Rendered below a `Divider` when provided |
|
|
32
|
+
| `padding` | `ResponsiveProp<keyof SparkTheme['spacing']>` | `'xlarge'` | Padding around the content area; supports responsive values |
|
|
33
|
+
| `gap` | `keyof Omit<SparkTheme['spacing'], 'none' \| 'full'>` | `'large'` | Gap between content children |
|
|
34
|
+
| `data` | `DataAttributeMap` | — | Test/analytics attributes |
|
|
35
|
+
|
|
36
|
+
## Constraints
|
|
37
|
+
|
|
38
|
+
- `header` renders outside the padded `Stack` — `SectionHeader` provides its own
|
|
39
|
+
internal padding
|
|
40
|
+
- `footer` is always preceded by a `Divider` — do not add one manually
|
|
41
|
+
- `padding` accepts responsive values (e.g.
|
|
42
|
+
`{ mobile: 'medium', tablet: 'xlarge' }`); `gap` does not
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @spark-web/section-card
|
|
2
|
+
|
|
3
|
+
A card container for content sections with optional header and footer. Compose
|
|
4
|
+
with SectionHeader for a complete section layout.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { SectionCard } from '@spark-web/section-card';
|
|
10
|
+
import { SectionHeader } from '@spark-web/section-header';
|
|
11
|
+
|
|
12
|
+
<SectionCard
|
|
13
|
+
header={
|
|
14
|
+
<SectionHeader
|
|
15
|
+
label="Business Details"
|
|
16
|
+
tag={{ children: 'Active', tone: 'positive' }}
|
|
17
|
+
/>
|
|
18
|
+
}
|
|
19
|
+
>
|
|
20
|
+
Content goes here.
|
|
21
|
+
</SectionCard>;
|
|
22
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ResponsiveProp, SparkTheme } from '@spark-web/theme';
|
|
2
|
+
import type { DataAttributeMap } from '@spark-web/utils/internal';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* SectionCard
|
|
6
|
+
*
|
|
7
|
+
* A card container for content sections with optional header and footer.
|
|
8
|
+
* Compose with SectionHeader for a complete section layout.
|
|
9
|
+
*
|
|
10
|
+
* @see https://spark.brighte.com.au/package/section-card
|
|
11
|
+
*/
|
|
12
|
+
export declare function SectionCard({ header, children, footer, padding, gap, data, }: SectionCardProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
13
|
+
export type SectionCardProps = {
|
|
14
|
+
/** Optional header element — compose with SectionHeader. */
|
|
15
|
+
header?: ReactNode;
|
|
16
|
+
/** The main content of the card. */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
/** Optional footer element. */
|
|
19
|
+
footer?: ReactNode;
|
|
20
|
+
/** Padding around the content area. */
|
|
21
|
+
padding?: ResponsiveProp<keyof SparkTheme['spacing']>;
|
|
22
|
+
/** Gap between content children. */
|
|
23
|
+
gap?: keyof Omit<SparkTheme['spacing'], 'none' | 'full'>;
|
|
24
|
+
/** Sets data attributes on the component. */
|
|
25
|
+
data?: DataAttributeMap;
|
|
26
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from "./declarations/src/index.js";
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bhcmstd2ViLXNlY3Rpb24tY2FyZC5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var divider = require('@spark-web/divider');
|
|
6
|
+
var stack = require('@spark-web/stack');
|
|
7
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* SectionCard
|
|
13
|
+
*
|
|
14
|
+
* A card container for content sections with optional header and footer.
|
|
15
|
+
* Compose with SectionHeader for a complete section layout.
|
|
16
|
+
*
|
|
17
|
+
* @see https://spark.brighte.com.au/package/section-card
|
|
18
|
+
*/
|
|
19
|
+
function SectionCard(_ref) {
|
|
20
|
+
var header = _ref.header,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
footer = _ref.footer,
|
|
23
|
+
_ref$padding = _ref.padding,
|
|
24
|
+
padding = _ref$padding === void 0 ? 'xlarge' : _ref$padding,
|
|
25
|
+
_ref$gap = _ref.gap,
|
|
26
|
+
gap = _ref$gap === void 0 ? 'large' : _ref$gap,
|
|
27
|
+
data = _ref.data;
|
|
28
|
+
return jsxRuntime.jsxs(stack.Stack, {
|
|
29
|
+
data: data,
|
|
30
|
+
background: "neutral",
|
|
31
|
+
children: [header, jsxRuntime.jsx(stack.Stack, {
|
|
32
|
+
padding: padding,
|
|
33
|
+
gap: gap,
|
|
34
|
+
children: children
|
|
35
|
+
}), footer && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
36
|
+
children: [jsxRuntime.jsx(divider.Divider, {}), jsxRuntime.jsx(stack.Stack, {
|
|
37
|
+
children: footer
|
|
38
|
+
})]
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.SectionCard = SectionCard;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var divider = require('@spark-web/divider');
|
|
6
|
+
var stack = require('@spark-web/stack');
|
|
7
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* SectionCard
|
|
13
|
+
*
|
|
14
|
+
* A card container for content sections with optional header and footer.
|
|
15
|
+
* Compose with SectionHeader for a complete section layout.
|
|
16
|
+
*
|
|
17
|
+
* @see https://spark.brighte.com.au/package/section-card
|
|
18
|
+
*/
|
|
19
|
+
function SectionCard(_ref) {
|
|
20
|
+
var header = _ref.header,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
footer = _ref.footer,
|
|
23
|
+
_ref$padding = _ref.padding,
|
|
24
|
+
padding = _ref$padding === void 0 ? 'xlarge' : _ref$padding,
|
|
25
|
+
_ref$gap = _ref.gap,
|
|
26
|
+
gap = _ref$gap === void 0 ? 'large' : _ref$gap,
|
|
27
|
+
data = _ref.data;
|
|
28
|
+
return jsxRuntime.jsxs(stack.Stack, {
|
|
29
|
+
data: data,
|
|
30
|
+
background: "neutral",
|
|
31
|
+
children: [header, jsxRuntime.jsx(stack.Stack, {
|
|
32
|
+
padding: padding,
|
|
33
|
+
gap: gap,
|
|
34
|
+
children: children
|
|
35
|
+
}), footer && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
36
|
+
children: [jsxRuntime.jsx(divider.Divider, {}), jsxRuntime.jsx(stack.Stack, {
|
|
37
|
+
children: footer
|
|
38
|
+
})]
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.SectionCard = SectionCard;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Divider } from '@spark-web/divider';
|
|
2
|
+
import { Stack } from '@spark-web/stack';
|
|
3
|
+
import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SectionCard
|
|
9
|
+
*
|
|
10
|
+
* A card container for content sections with optional header and footer.
|
|
11
|
+
* Compose with SectionHeader for a complete section layout.
|
|
12
|
+
*
|
|
13
|
+
* @see https://spark.brighte.com.au/package/section-card
|
|
14
|
+
*/
|
|
15
|
+
function SectionCard(_ref) {
|
|
16
|
+
var header = _ref.header,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
footer = _ref.footer,
|
|
19
|
+
_ref$padding = _ref.padding,
|
|
20
|
+
padding = _ref$padding === void 0 ? 'xlarge' : _ref$padding,
|
|
21
|
+
_ref$gap = _ref.gap,
|
|
22
|
+
gap = _ref$gap === void 0 ? 'large' : _ref$gap,
|
|
23
|
+
data = _ref.data;
|
|
24
|
+
return jsxs(Stack, {
|
|
25
|
+
data: data,
|
|
26
|
+
background: "neutral",
|
|
27
|
+
children: [header, jsx(Stack, {
|
|
28
|
+
padding: padding,
|
|
29
|
+
gap: gap,
|
|
30
|
+
children: children
|
|
31
|
+
}), footer && jsxs(Fragment, {
|
|
32
|
+
children: [jsx(Divider, {}), jsx(Stack, {
|
|
33
|
+
children: footer
|
|
34
|
+
})]
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { SectionCard };
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@spark-web/section-card",
|
|
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/section-card"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/spark-web-section-card.cjs.js",
|
|
11
|
+
"module": "dist/spark-web-section-card.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/divider": "^5.1.0",
|
|
22
|
+
"@spark-web/stack": "^5.0.0",
|
|
23
|
+
"@spark-web/theme": "^5.13.0",
|
|
24
|
+
"@spark-web/utils": "^5.1.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@spark-web/section-header": "0.0.0-snapshot-release-20260401034720",
|
|
28
|
+
"@spark-web/tag": "0.0.0-snapshot-release-20260401034720",
|
|
29
|
+
"@types/react": "^19.1.0",
|
|
30
|
+
"react": "^19.1.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=14"
|
|
37
|
+
}
|
|
38
|
+
}
|