@tonyarbor/components 0.4.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.d.mts +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +56 -0
- package/dist/Button.js.map +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/ButtonSegmented.d.mts +61 -0
- package/dist/ButtonSegmented.d.ts +61 -0
- package/dist/ButtonSegmented.js +167 -0
- package/dist/ButtonSegmented.js.map +1 -0
- package/dist/ButtonSegmented.mjs +7 -0
- package/dist/ButtonSegmented.mjs.map +1 -0
- package/dist/ListRow.d.mts +72 -0
- package/dist/ListRow.d.ts +72 -0
- package/dist/ListRow.js +194 -0
- package/dist/ListRow.js.map +1 -0
- package/dist/ListRow.mjs +7 -0
- package/dist/ListRow.mjs.map +1 -0
- package/dist/ListRowMultiLine.d.mts +56 -0
- package/dist/ListRowMultiLine.d.ts +56 -0
- package/dist/ListRowMultiLine.js +182 -0
- package/dist/ListRowMultiLine.js.map +1 -0
- package/dist/ListRowMultiLine.mjs +7 -0
- package/dist/ListRowMultiLine.mjs.map +1 -0
- package/dist/Logo.d.mts +39 -0
- package/dist/Logo.d.ts +39 -0
- package/dist/Logo.js +119 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Logo.mjs +7 -0
- package/dist/Logo.mjs.map +1 -0
- package/dist/Modal.d.mts +73 -0
- package/dist/Modal.d.ts +73 -0
- package/dist/Modal.js +114 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.mjs +9 -0
- package/dist/Modal.mjs.map +1 -0
- package/dist/ModalFooter.d.mts +40 -0
- package/dist/ModalFooter.d.ts +40 -0
- package/dist/ModalFooter.js +73 -0
- package/dist/ModalFooter.js.map +1 -0
- package/dist/ModalFooter.mjs +7 -0
- package/dist/ModalFooter.mjs.map +1 -0
- package/dist/ModalHeader.d.mts +65 -0
- package/dist/ModalHeader.d.ts +65 -0
- package/dist/ModalHeader.js +257 -0
- package/dist/ModalHeader.js.map +1 -0
- package/dist/ModalHeader.mjs +8 -0
- package/dist/ModalHeader.mjs.map +1 -0
- package/dist/Section.d.mts +57 -0
- package/dist/Section.d.ts +57 -0
- package/dist/Section.js +72 -0
- package/dist/Section.js.map +1 -0
- package/dist/Section.mjs +7 -0
- package/dist/Section.mjs.map +1 -0
- package/dist/SectionHeading.d.mts +111 -0
- package/dist/SectionHeading.d.ts +111 -0
- package/dist/SectionHeading.js +385 -0
- package/dist/SectionHeading.js.map +1 -0
- package/dist/SectionHeading.mjs +8 -0
- package/dist/SectionHeading.mjs.map +1 -0
- package/dist/SectionHeadingInteractive.d.mts +67 -0
- package/dist/SectionHeadingInteractive.d.ts +67 -0
- package/dist/SectionHeadingInteractive.js +225 -0
- package/dist/SectionHeadingInteractive.js.map +1 -0
- package/dist/SectionHeadingInteractive.mjs +7 -0
- package/dist/SectionHeadingInteractive.mjs.map +1 -0
- package/dist/SectionIcon.d.mts +35 -0
- package/dist/SectionIcon.d.ts +35 -0
- package/dist/SectionIcon.js +142 -0
- package/dist/SectionIcon.js.map +1 -0
- package/dist/SectionIcon.mjs +7 -0
- package/dist/SectionIcon.mjs.map +1 -0
- package/dist/SubSectionHeading.d.mts +75 -0
- package/dist/SubSectionHeading.d.ts +75 -0
- package/dist/SubSectionHeading.js +225 -0
- package/dist/SubSectionHeading.js.map +1 -0
- package/dist/SubSectionHeading.mjs +7 -0
- package/dist/SubSectionHeading.mjs.map +1 -0
- package/dist/SubSectionInteractive.d.mts +65 -0
- package/dist/SubSectionInteractive.d.ts +65 -0
- package/dist/SubSectionInteractive.js +211 -0
- package/dist/SubSectionInteractive.js.map +1 -0
- package/dist/SubSectionInteractive.mjs +7 -0
- package/dist/SubSectionInteractive.mjs.map +1 -0
- package/dist/chunk-7JWINM2N.mjs +77 -0
- package/dist/chunk-7JWINM2N.mjs.map +1 -0
- package/dist/chunk-7NYBJKJS.mjs +106 -0
- package/dist/chunk-7NYBJKJS.mjs.map +1 -0
- package/dist/chunk-ALLCJATI.mjs +189 -0
- package/dist/chunk-ALLCJATI.mjs.map +1 -0
- package/dist/chunk-F6JVEIWC.mjs +158 -0
- package/dist/chunk-F6JVEIWC.mjs.map +1 -0
- package/dist/chunk-GHATS25Y.mjs +249 -0
- package/dist/chunk-GHATS25Y.mjs.map +1 -0
- package/dist/chunk-GIQDPHZQ.mjs +121 -0
- package/dist/chunk-GIQDPHZQ.mjs.map +1 -0
- package/dist/chunk-ILLGBZ6R.mjs +131 -0
- package/dist/chunk-ILLGBZ6R.mjs.map +1 -0
- package/dist/chunk-NNYU4DPD.mjs +83 -0
- package/dist/chunk-NNYU4DPD.mjs.map +1 -0
- package/dist/{chunk-ALEJXAZY.mjs → chunk-NOUFR6W2.mjs} +57 -1
- package/dist/chunk-NOUFR6W2.mjs.map +1 -0
- package/dist/chunk-ODKT7LGV.mjs +146 -0
- package/dist/chunk-ODKT7LGV.mjs.map +1 -0
- package/dist/chunk-P7RKUESQ.mjs +37 -0
- package/dist/chunk-P7RKUESQ.mjs.map +1 -0
- package/dist/chunk-RL4G7MR3.mjs +189 -0
- package/dist/chunk-RL4G7MR3.mjs.map +1 -0
- package/dist/chunk-X2CW5GF3.mjs +175 -0
- package/dist/chunk-X2CW5GF3.mjs.map +1 -0
- package/dist/chunk-YJ36ZZJQ.mjs +36 -0
- package/dist/chunk-YJ36ZZJQ.mjs.map +1 -0
- package/dist/index.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +1722 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -1
- package/package.json +66 -1
- package/dist/chunk-ALEJXAZY.mjs.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SectionIconVariant } from './SectionIcon.mjs';
|
|
3
|
+
|
|
4
|
+
interface ModalHeaderProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title text for the modal header
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional icon variant to display before the title
|
|
11
|
+
* Uses the SectionIcon component variants: 'warning', 'danger', 'info', 'success'
|
|
12
|
+
*/
|
|
13
|
+
icon?: SectionIconVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when close button is clicked
|
|
16
|
+
* If not provided, close button will not be shown
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional inline styles
|
|
25
|
+
*/
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ModalHeader component - Arbor Design System
|
|
30
|
+
*
|
|
31
|
+
* The header part of a modal dialog with title, optional icon, and close button.
|
|
32
|
+
* The icon uses SectionIcon variants (warning, danger, info, success).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Basic modal header with close button
|
|
37
|
+
* <ModalHeader
|
|
38
|
+
* title="What would you like to do?"
|
|
39
|
+
* onClose={() => setIsOpen(false)}
|
|
40
|
+
* />
|
|
41
|
+
*
|
|
42
|
+
* // Modal header with warning icon
|
|
43
|
+
* <ModalHeader
|
|
44
|
+
* title="Are you sure?"
|
|
45
|
+
* icon="warning"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* // Modal header with danger icon (error state)
|
|
50
|
+
* <ModalHeader
|
|
51
|
+
* title="Sorry, we can't find this page"
|
|
52
|
+
* icon="danger"
|
|
53
|
+
* onClose={() => setIsOpen(false)}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // Modal header without close button
|
|
57
|
+
* <ModalHeader
|
|
58
|
+
* title="Processing..."
|
|
59
|
+
* icon="info"
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
|
|
65
|
+
export { ModalHeader, type ModalHeaderProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SectionIconVariant } from './SectionIcon.js';
|
|
3
|
+
|
|
4
|
+
interface ModalHeaderProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title text for the modal header
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional icon variant to display before the title
|
|
11
|
+
* Uses the SectionIcon component variants: 'warning', 'danger', 'info', 'success'
|
|
12
|
+
*/
|
|
13
|
+
icon?: SectionIconVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when close button is clicked
|
|
16
|
+
* If not provided, close button will not be shown
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional inline styles
|
|
25
|
+
*/
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ModalHeader component - Arbor Design System
|
|
30
|
+
*
|
|
31
|
+
* The header part of a modal dialog with title, optional icon, and close button.
|
|
32
|
+
* The icon uses SectionIcon variants (warning, danger, info, success).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Basic modal header with close button
|
|
37
|
+
* <ModalHeader
|
|
38
|
+
* title="What would you like to do?"
|
|
39
|
+
* onClose={() => setIsOpen(false)}
|
|
40
|
+
* />
|
|
41
|
+
*
|
|
42
|
+
* // Modal header with warning icon
|
|
43
|
+
* <ModalHeader
|
|
44
|
+
* title="Are you sure?"
|
|
45
|
+
* icon="warning"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* // Modal header with danger icon (error state)
|
|
50
|
+
* <ModalHeader
|
|
51
|
+
* title="Sorry, we can't find this page"
|
|
52
|
+
* icon="danger"
|
|
53
|
+
* onClose={() => setIsOpen(false)}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // Modal header without close button
|
|
57
|
+
* <ModalHeader
|
|
58
|
+
* title="Processing..."
|
|
59
|
+
* icon="info"
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
|
|
65
|
+
export { ModalHeader, type ModalHeaderProps };
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/ModalHeader/index.ts
|
|
31
|
+
var ModalHeader_exports = {};
|
|
32
|
+
__export(ModalHeader_exports, {
|
|
33
|
+
ModalHeader: () => ModalHeader
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(ModalHeader_exports);
|
|
36
|
+
|
|
37
|
+
// src/ModalHeader/ModalHeader.tsx
|
|
38
|
+
var React2 = __toESM(require("react"));
|
|
39
|
+
var import_clsx2 = require("clsx");
|
|
40
|
+
|
|
41
|
+
// src/SectionIcon/SectionIcon.tsx
|
|
42
|
+
var React = __toESM(require("react"));
|
|
43
|
+
var import_clsx = require("clsx");
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var WarningIcon = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "14", height: "12", viewBox: "0 0 14 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
"path",
|
|
48
|
+
{
|
|
49
|
+
d: "M7 0.5L13.5 11.5H0.5L7 0.5Z",
|
|
50
|
+
stroke: color,
|
|
51
|
+
strokeWidth: "1.2",
|
|
52
|
+
strokeLinejoin: "round",
|
|
53
|
+
fill: "none"
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
d: "M7 4.5V7",
|
|
60
|
+
stroke: color,
|
|
61
|
+
strokeWidth: "1.2",
|
|
62
|
+
strokeLinecap: "round"
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "7", cy: "9", r: "0.75", fill: color })
|
|
66
|
+
] });
|
|
67
|
+
var InfoIcon = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "7", cy: "7", r: "6", stroke: color, strokeWidth: "1.2", fill: "none" }),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M7 6V10", stroke: color, strokeWidth: "1.2", strokeLinecap: "round" }),
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "7", cy: "4", r: "0.75", fill: color })
|
|
71
|
+
] });
|
|
72
|
+
var SuccessIcon = ({ color }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "7", cy: "7", r: "6", stroke: color, strokeWidth: "1.2", fill: "none" }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 7L6 9L10 5", stroke: color, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
75
|
+
] });
|
|
76
|
+
var variantConfig = {
|
|
77
|
+
warning: {
|
|
78
|
+
backgroundColor: "#fffaf5",
|
|
79
|
+
iconColor: "#e4720d"
|
|
80
|
+
},
|
|
81
|
+
danger: {
|
|
82
|
+
backgroundColor: "#fff5f5",
|
|
83
|
+
iconColor: "#c93232"
|
|
84
|
+
},
|
|
85
|
+
info: {
|
|
86
|
+
backgroundColor: "#f5fbff",
|
|
87
|
+
iconColor: "#2c8bca"
|
|
88
|
+
},
|
|
89
|
+
success: {
|
|
90
|
+
backgroundColor: "#f5fff8",
|
|
91
|
+
iconColor: "#16a33d"
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var sectionIconStyles = {
|
|
95
|
+
container: {
|
|
96
|
+
display: "inline-flex",
|
|
97
|
+
alignItems: "center",
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
padding: "4px",
|
|
100
|
+
borderRadius: "99px"
|
|
101
|
+
},
|
|
102
|
+
iconWrapper: {
|
|
103
|
+
display: "flex",
|
|
104
|
+
alignItems: "center",
|
|
105
|
+
justifyContent: "center",
|
|
106
|
+
width: "16px",
|
|
107
|
+
height: "16px"
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var SectionIcon = React.forwardRef(
|
|
111
|
+
({ variant = "info", className, style, ...props }, ref) => {
|
|
112
|
+
const config = variantConfig[variant];
|
|
113
|
+
const renderIcon = () => {
|
|
114
|
+
switch (variant) {
|
|
115
|
+
case "warning":
|
|
116
|
+
case "danger":
|
|
117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WarningIcon, { color: config.iconColor });
|
|
118
|
+
case "success":
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SuccessIcon, { color: config.iconColor });
|
|
120
|
+
case "info":
|
|
121
|
+
default:
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoIcon, { color: config.iconColor });
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
className: (0, import_clsx.clsx)("arbor-section-icon", className),
|
|
130
|
+
style: {
|
|
131
|
+
...sectionIconStyles.container,
|
|
132
|
+
backgroundColor: config.backgroundColor,
|
|
133
|
+
...style
|
|
134
|
+
},
|
|
135
|
+
...props,
|
|
136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: sectionIconStyles.iconWrapper, children: renderIcon() })
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
SectionIcon.displayName = "SectionIcon";
|
|
142
|
+
|
|
143
|
+
// src/ModalHeader/ModalHeader.tsx
|
|
144
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
145
|
+
var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
146
|
+
"svg",
|
|
147
|
+
{
|
|
148
|
+
width: "10",
|
|
149
|
+
height: "10",
|
|
150
|
+
viewBox: "0 0 10 10",
|
|
151
|
+
fill: "none",
|
|
152
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
153
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
154
|
+
"path",
|
|
155
|
+
{
|
|
156
|
+
d: "M1 1L9 9M9 1L1 9",
|
|
157
|
+
stroke: "#2f2f2f",
|
|
158
|
+
strokeWidth: "1.5",
|
|
159
|
+
strokeLinecap: "round",
|
|
160
|
+
strokeLinejoin: "round"
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
var modalHeaderStyles = {
|
|
166
|
+
container: {
|
|
167
|
+
display: "flex",
|
|
168
|
+
alignItems: "center",
|
|
169
|
+
justifyContent: "space-between",
|
|
170
|
+
width: "100%",
|
|
171
|
+
padding: "16px",
|
|
172
|
+
backgroundColor: "#ffffff",
|
|
173
|
+
boxSizing: "border-box",
|
|
174
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
175
|
+
minHeight: "56px"
|
|
176
|
+
},
|
|
177
|
+
leftContent: {
|
|
178
|
+
display: "flex",
|
|
179
|
+
alignItems: "center",
|
|
180
|
+
gap: "16px",
|
|
181
|
+
flex: 1
|
|
182
|
+
},
|
|
183
|
+
title: {
|
|
184
|
+
fontSize: "22px",
|
|
185
|
+
fontWeight: "600",
|
|
186
|
+
color: "#2f2f2f",
|
|
187
|
+
lineHeight: "1.25",
|
|
188
|
+
margin: 0
|
|
189
|
+
},
|
|
190
|
+
closeButton: {
|
|
191
|
+
display: "flex",
|
|
192
|
+
alignItems: "center",
|
|
193
|
+
justifyContent: "center",
|
|
194
|
+
width: "32px",
|
|
195
|
+
height: "32px",
|
|
196
|
+
borderRadius: "16px",
|
|
197
|
+
backgroundColor: "#ffffff",
|
|
198
|
+
border: "none",
|
|
199
|
+
cursor: "pointer",
|
|
200
|
+
padding: 0,
|
|
201
|
+
flexShrink: 0,
|
|
202
|
+
transition: "background-color 0.15s ease-in-out"
|
|
203
|
+
},
|
|
204
|
+
closeButtonHover: {
|
|
205
|
+
backgroundColor: "#f8f8f8"
|
|
206
|
+
},
|
|
207
|
+
closeButtonFocus: {
|
|
208
|
+
outline: "3px solid #3cad51",
|
|
209
|
+
outlineOffset: "-3px"
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
var ModalHeader = React2.forwardRef(
|
|
213
|
+
({ title, icon, onClose, className, style, ...props }, ref) => {
|
|
214
|
+
const [isHovered, setIsHovered] = React2.useState(false);
|
|
215
|
+
const [isFocused, setIsFocused] = React2.useState(false);
|
|
216
|
+
const closeButtonStyle = {
|
|
217
|
+
...modalHeaderStyles.closeButton,
|
|
218
|
+
...isHovered && modalHeaderStyles.closeButtonHover,
|
|
219
|
+
...isFocused && modalHeaderStyles.closeButtonFocus
|
|
220
|
+
};
|
|
221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
ref,
|
|
225
|
+
className: (0, import_clsx2.clsx)("arbor-modal-header", className),
|
|
226
|
+
style: { ...modalHeaderStyles.container, ...style },
|
|
227
|
+
...props,
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: modalHeaderStyles.leftContent, children: [
|
|
230
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SectionIcon, { variant: icon }),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { style: modalHeaderStyles.title, children: title })
|
|
232
|
+
] }),
|
|
233
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
type: "button",
|
|
237
|
+
onClick: onClose,
|
|
238
|
+
onMouseEnter: () => setIsHovered(true),
|
|
239
|
+
onMouseLeave: () => setIsHovered(false),
|
|
240
|
+
onFocus: () => setIsFocused(true),
|
|
241
|
+
onBlur: () => setIsFocused(false),
|
|
242
|
+
style: closeButtonStyle,
|
|
243
|
+
"aria-label": "Close modal",
|
|
244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {})
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
ModalHeader.displayName = "ModalHeader";
|
|
253
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
254
|
+
0 && (module.exports = {
|
|
255
|
+
ModalHeader
|
|
256
|
+
});
|
|
257
|
+
//# sourceMappingURL=ModalHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ModalHeader/index.ts","../src/ModalHeader/ModalHeader.tsx","../src/SectionIcon/SectionIcon.tsx"],"sourcesContent":["export { ModalHeader } from './ModalHeader';\nexport type { ModalHeaderProps } from './ModalHeader';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\nimport { SectionIcon, SectionIconVariant } from '../SectionIcon';\n\nexport interface ModalHeaderProps {\n /**\n * The title text for the modal header\n */\n title: string;\n /**\n * Optional icon variant to display before the title\n * Uses the SectionIcon component variants: 'warning', 'danger', 'info', 'success'\n */\n icon?: SectionIconVariant;\n /**\n * Callback when close button is clicked\n * If not provided, close button will not be shown\n */\n onClose?: () => void;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Close X icon\nconst CloseIcon = () => (\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 1L9 9M9 1L1 9\"\n stroke=\"#2f2f2f\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n// Arbor Design System modal header styles\nconst modalHeaderStyles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%',\n padding: '16px',\n backgroundColor: '#ffffff',\n boxSizing: 'border-box' as const,\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n minHeight: '56px',\n },\n leftContent: {\n display: 'flex',\n alignItems: 'center',\n gap: '16px',\n flex: 1,\n },\n title: {\n fontSize: '22px',\n fontWeight: '600',\n color: '#2f2f2f',\n lineHeight: '1.25',\n margin: 0,\n },\n closeButton: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '32px',\n height: '32px',\n borderRadius: '16px',\n backgroundColor: '#ffffff',\n border: 'none',\n cursor: 'pointer',\n padding: 0,\n flexShrink: 0,\n transition: 'background-color 0.15s ease-in-out',\n },\n closeButtonHover: {\n backgroundColor: '#f8f8f8',\n },\n closeButtonFocus: {\n outline: '3px solid #3cad51',\n outlineOffset: '-3px',\n },\n};\n\n/**\n * ModalHeader component - Arbor Design System\n *\n * The header part of a modal dialog with title, optional icon, and close button.\n * The icon uses SectionIcon variants (warning, danger, info, success).\n *\n * @example\n * ```tsx\n * // Basic modal header with close button\n * <ModalHeader\n * title=\"What would you like to do?\"\n * onClose={() => setIsOpen(false)}\n * />\n *\n * // Modal header with warning icon\n * <ModalHeader\n * title=\"Are you sure?\"\n * icon=\"warning\"\n * onClose={() => setIsOpen(false)}\n * />\n *\n * // Modal header with danger icon (error state)\n * <ModalHeader\n * title=\"Sorry, we can't find this page\"\n * icon=\"danger\"\n * onClose={() => setIsOpen(false)}\n * />\n *\n * // Modal header without close button\n * <ModalHeader\n * title=\"Processing...\"\n * icon=\"info\"\n * />\n * ```\n */\nexport const ModalHeader = React.forwardRef<HTMLDivElement, ModalHeaderProps>(\n ({ title, icon, onClose, className, style, ...props }, ref) => {\n const [isHovered, setIsHovered] = React.useState(false);\n const [isFocused, setIsFocused] = React.useState(false);\n\n const closeButtonStyle: React.CSSProperties = {\n ...modalHeaderStyles.closeButton,\n ...(isHovered && modalHeaderStyles.closeButtonHover),\n ...(isFocused && modalHeaderStyles.closeButtonFocus),\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal-header', className)}\n style={{ ...modalHeaderStyles.container, ...style }}\n {...props}\n >\n <div style={modalHeaderStyles.leftContent}>\n {icon && <SectionIcon variant={icon} />}\n <h2 style={modalHeaderStyles.title}>{title}</h2>\n </div>\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n style={closeButtonStyle}\n aria-label=\"Close modal\"\n >\n <CloseIcon />\n </button>\n )}\n </div>\n );\n }\n);\n\nModalHeader.displayName = 'ModalHeader';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport type SectionIconVariant = 'warning' | 'danger' | 'info' | 'success';\n\nexport interface SectionIconProps {\n /**\n * The variant/style of the section icon\n * @default 'info'\n */\n variant?: SectionIconVariant;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Warning triangle icon\nconst WarningIcon = ({ color }: { color: string }) => (\n <svg width=\"14\" height=\"12\" viewBox=\"0 0 14 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M7 0.5L13.5 11.5H0.5L7 0.5Z\"\n stroke={color}\n strokeWidth=\"1.2\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n <path\n d=\"M7 4.5V7\"\n stroke={color}\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n />\n <circle cx=\"7\" cy=\"9\" r=\"0.75\" fill={color} />\n </svg>\n);\n\n// Info circle icon\nconst InfoIcon = ({ color }: { color: string }) => (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"7\" cy=\"7\" r=\"6\" stroke={color} strokeWidth=\"1.2\" fill=\"none\" />\n <path d=\"M7 6V10\" stroke={color} strokeWidth=\"1.2\" strokeLinecap=\"round\" />\n <circle cx=\"7\" cy=\"4\" r=\"0.75\" fill={color} />\n </svg>\n);\n\n// Success checkmark icon\nconst SuccessIcon = ({ color }: { color: string }) => (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"7\" cy=\"7\" r=\"6\" stroke={color} strokeWidth=\"1.2\" fill=\"none\" />\n <path d=\"M4 7L6 9L10 5\" stroke={color} strokeWidth=\"1.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\n// Variant configurations\nconst variantConfig: Record<SectionIconVariant, { backgroundColor: string; iconColor: string }> = {\n warning: {\n backgroundColor: '#fffaf5',\n iconColor: '#e4720d',\n },\n danger: {\n backgroundColor: '#fff5f5',\n iconColor: '#c93232',\n },\n info: {\n backgroundColor: '#f5fbff',\n iconColor: '#2c8bca',\n },\n success: {\n backgroundColor: '#f5fff8',\n iconColor: '#16a33d',\n },\n};\n\n// Arbor Design System section icon styles\nconst sectionIconStyles = {\n container: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '4px',\n borderRadius: '99px',\n },\n iconWrapper: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n },\n};\n\n/**\n * SectionIcon component - Arbor Design System\n *\n * A small badge-like icon used in section headings to indicate status or alerts.\n * Available in 4 variants: warning (orange), danger (red), info (blue), success (green).\n *\n * @example\n * ```tsx\n * <SectionIcon variant=\"warning\" />\n * <SectionIcon variant=\"danger\" />\n * <SectionIcon variant=\"info\" />\n * <SectionIcon variant=\"success\" />\n * ```\n */\nexport const SectionIcon = React.forwardRef<HTMLDivElement, SectionIconProps>(\n ({ variant = 'info', className, style, ...props }, ref) => {\n const config = variantConfig[variant];\n\n const renderIcon = () => {\n switch (variant) {\n case 'warning':\n case 'danger':\n return <WarningIcon color={config.iconColor} />;\n case 'success':\n return <SuccessIcon color={config.iconColor} />;\n case 'info':\n default:\n return <InfoIcon color={config.iconColor} />;\n }\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-section-icon', className)}\n style={{\n ...sectionIconStyles.container,\n backgroundColor: config.backgroundColor,\n ...style,\n }}\n {...props}\n >\n <div style={sectionIconStyles.iconWrapper}>\n {renderIcon()}\n </div>\n </div>\n );\n }\n);\n\nSectionIcon.displayName = 'SectionIcon';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,IAAAC,eAAqB;;;ACDrB,YAAuB;AACvB,kBAAqB;AAsBnB;AADF,IAAM,cAAc,CAAC,EAAE,MAAM,MAC3B,6CAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE;AAAA;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,QAAQ;AAAA,MACR,aAAY;AAAA,MACZ,gBAAe;AAAA,MACf,MAAK;AAAA;AAAA,EACP;AAAA,EACA;AAAA,IAAC;AAAA;A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AAAA,QAEJ;AAAA,wDAAC,SAAI,OAAO,kBAAkB,aAC3B;AAAA,oBAAQ,6CAAC,eAAY,SAAS,MAAM;AAAA,YACrC,6CAAC,QAAG,OAAO,kBAAkB,OAAQ,iBAAM;AAAA,aAC7C;AAAA,UACC,WACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS;AAAA,cACT,cAAc,MAAM,aAAa,IAAI;AAAA,cACrC,cAAc,MAAM,aAAa,KAAK;AAAA,cACtC,SAAS,MAAM,aAAa,IAAI;AAAA,cAChC,QAAQ,MAAM,aAAa,KAAK;AAAA,cAChC,OAAO;AAAA,cACP,cAAW;AAAA,cAEX,uDAAC,aAAU;AAAA;AAAA,UACb;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["React","import_clsx","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SectionProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content to display inside the section
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional inline styles
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Section component - Arbor Design System
|
|
19
|
+
*
|
|
20
|
+
* A container component that provides consistent styling for content sections.
|
|
21
|
+
* Has 8px padding, 8px border radius, and white background.
|
|
22
|
+
* Used to wrap SectionHeadings, SubSectionHeadings, ListRows, and other content.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Basic section with heading and list rows
|
|
27
|
+
* <Section>
|
|
28
|
+
* <SectionHeading title="Contact Information" />
|
|
29
|
+
* <ListRow label="Email" value="john@example.com" />
|
|
30
|
+
* <ListRow label="Phone" value="+44 123 456 7890" />
|
|
31
|
+
* </Section>
|
|
32
|
+
*
|
|
33
|
+
* // Section with interactive heading
|
|
34
|
+
* <Section>
|
|
35
|
+
* <SectionHeadingInteractive title="Personal Details">
|
|
36
|
+
* <SubSectionInteractive title="Profile">
|
|
37
|
+
* <ListRow label="Name" value="John Smith" />
|
|
38
|
+
* </SubSectionInteractive>
|
|
39
|
+
* </SectionHeadingInteractive>
|
|
40
|
+
* </Section>
|
|
41
|
+
*
|
|
42
|
+
* // Multiple sections on a page
|
|
43
|
+
* <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
44
|
+
* <Section>
|
|
45
|
+
* <SectionHeading title="Section 1" />
|
|
46
|
+
* <ListRow label="Field" value="Value" />
|
|
47
|
+
* </Section>
|
|
48
|
+
* <Section>
|
|
49
|
+
* <SectionHeading title="Section 2" />
|
|
50
|
+
* <ListRow label="Field" value="Value" />
|
|
51
|
+
* </Section>
|
|
52
|
+
* </div>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare const Section: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
+
|
|
57
|
+
export { Section, type SectionProps };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SectionProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content to display inside the section
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional inline styles
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Section component - Arbor Design System
|
|
19
|
+
*
|
|
20
|
+
* A container component that provides consistent styling for content sections.
|
|
21
|
+
* Has 8px padding, 8px border radius, and white background.
|
|
22
|
+
* Used to wrap SectionHeadings, SubSectionHeadings, ListRows, and other content.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Basic section with heading and list rows
|
|
27
|
+
* <Section>
|
|
28
|
+
* <SectionHeading title="Contact Information" />
|
|
29
|
+
* <ListRow label="Email" value="john@example.com" />
|
|
30
|
+
* <ListRow label="Phone" value="+44 123 456 7890" />
|
|
31
|
+
* </Section>
|
|
32
|
+
*
|
|
33
|
+
* // Section with interactive heading
|
|
34
|
+
* <Section>
|
|
35
|
+
* <SectionHeadingInteractive title="Personal Details">
|
|
36
|
+
* <SubSectionInteractive title="Profile">
|
|
37
|
+
* <ListRow label="Name" value="John Smith" />
|
|
38
|
+
* </SubSectionInteractive>
|
|
39
|
+
* </SectionHeadingInteractive>
|
|
40
|
+
* </Section>
|
|
41
|
+
*
|
|
42
|
+
* // Multiple sections on a page
|
|
43
|
+
* <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
44
|
+
* <Section>
|
|
45
|
+
* <SectionHeading title="Section 1" />
|
|
46
|
+
* <ListRow label="Field" value="Value" />
|
|
47
|
+
* </Section>
|
|
48
|
+
* <Section>
|
|
49
|
+
* <SectionHeading title="Section 2" />
|
|
50
|
+
* <ListRow label="Field" value="Value" />
|
|
51
|
+
* </Section>
|
|
52
|
+
* </div>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare const Section: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
+
|
|
57
|
+
export { Section, type SectionProps };
|
package/dist/Section.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/Section/index.ts
|
|
31
|
+
var Section_exports = {};
|
|
32
|
+
__export(Section_exports, {
|
|
33
|
+
Section: () => Section
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Section_exports);
|
|
36
|
+
|
|
37
|
+
// src/Section/Section.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var sectionStyles = {
|
|
42
|
+
container: {
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
width: "100%",
|
|
46
|
+
padding: "8px",
|
|
47
|
+
borderRadius: "8px",
|
|
48
|
+
backgroundColor: "#ffffff",
|
|
49
|
+
boxSizing: "border-box",
|
|
50
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var Section = React.forwardRef(
|
|
54
|
+
({ children, className, style, ...props }, ref) => {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
className: (0, import_clsx.clsx)("arbor-section", className),
|
|
60
|
+
style: { ...sectionStyles.container, ...style },
|
|
61
|
+
...props,
|
|
62
|
+
children
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
Section.displayName = "Section";
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
Section
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Section/index.ts","../src/Section/Section.tsx"],"sourcesContent":["export { Section } from './Section';\nexport type { SectionProps } from './Section';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface SectionProps {\n /**\n * Content to display inside the section\n */\n children?: React.ReactNode;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Arbor Design System section container styles\nconst sectionStyles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n width: '100%',\n padding: '8px',\n borderRadius: '8px',\n backgroundColor: '#ffffff',\n boxSizing: 'border-box' as const,\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n },\n};\n\n/**\n * Section component - Arbor Design System\n *\n * A container component that provides consistent styling for content sections.\n * Has 8px padding, 8px border radius, and white background.\n * Used to wrap SectionHeadings, SubSectionHeadings, ListRows, and other content.\n *\n * @example\n * ```tsx\n * // Basic section with heading and list rows\n * <Section>\n * <SectionHeading title=\"Contact Information\" />\n * <ListRow label=\"Email\" value=\"john@example.com\" />\n * <ListRow label=\"Phone\" value=\"+44 123 456 7890\" />\n * </Section>\n *\n * // Section with interactive heading\n * <Section>\n * <SectionHeadingInteractive title=\"Personal Details\">\n * <SubSectionInteractive title=\"Profile\">\n * <ListRow label=\"Name\" value=\"John Smith\" />\n * </SubSectionInteractive>\n * </SectionHeadingInteractive>\n * </Section>\n *\n * // Multiple sections on a page\n * <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n * <Section>\n * <SectionHeading title=\"Section 1\" />\n * <ListRow label=\"Field\" value=\"Value\" />\n * </Section>\n * <Section>\n * <SectionHeading title=\"Section 2\" />\n * <ListRow label=\"Field\" value=\"Value\" />\n * </Section>\n * </div>\n * ```\n */\nexport const Section = React.forwardRef<HTMLDivElement, SectionProps>(\n ({ children, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-section', className)}\n style={{ ...sectionStyles.container, ...style }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nSection.displayName = 'Section';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AAwEf;AAtDN,IAAM,gBAAgB;AAAA,EACpB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,IACP,SAAS;AAAA,IACT,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AACF;AAwCO,IAAM,UAAgB;AAAA,EAC3B,CAAC,EAAE,UAAU,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,iBAAiB,SAAS;AAAA,QAC1C,OAAO,EAAE,GAAG,cAAc,WAAW,GAAG,MAAM;AAAA,QAC7C,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":[]}
|
package/dist/Section.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|