@tonyarbor/components 0.2.1 → 0.6.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/Avatar.d.mts +42 -0
- package/dist/Avatar.d.ts +42 -0
- package/dist/Avatar.js +158 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Avatar.mjs +7 -0
- package/dist/Avatar.mjs.map +1 -0
- package/dist/Breadcrumbs.d.mts +51 -0
- package/dist/Breadcrumbs.d.ts +51 -0
- package/dist/Breadcrumbs.js +276 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.mjs +7 -0
- package/dist/Breadcrumbs.mjs.map +1 -0
- 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/SearchGlobal.d.mts +45 -0
- package/dist/SearchGlobal.d.ts +45 -0
- package/dist/SearchGlobal.js +209 -0
- package/dist/SearchGlobal.js.map +1 -0
- package/dist/SearchGlobal.mjs +7 -0
- package/dist/SearchGlobal.mjs.map +1 -0
- package/dist/SearchOnPage.d.mts +45 -0
- package/dist/SearchOnPage.d.ts +45 -0
- package/dist/SearchOnPage.js +171 -0
- package/dist/SearchOnPage.js.map +1 -0
- package/dist/SearchOnPage.mjs +7 -0
- package/dist/SearchOnPage.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-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-B7RX3TPX.mjs +135 -0
- package/dist/chunk-B7RX3TPX.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-ILLGBZ6R.mjs +131 -0
- package/dist/chunk-ILLGBZ6R.mjs.map +1 -0
- package/dist/chunk-JSG27ZZS.mjs +122 -0
- package/dist/chunk-JSG27ZZS.mjs.map +1 -0
- package/dist/chunk-NNYU4DPD.mjs +83 -0
- package/dist/chunk-NNYU4DPD.mjs.map +1 -0
- package/dist/chunk-ODKT7LGV.mjs +146 -0
- package/dist/chunk-ODKT7LGV.mjs.map +1 -0
- package/dist/chunk-RL4G7MR3.mjs +189 -0
- package/dist/chunk-RL4G7MR3.mjs.map +1 -0
- package/dist/chunk-RQP6ZGD7.mjs +240 -0
- package/dist/chunk-RQP6ZGD7.mjs.map +1 -0
- package/dist/chunk-UPBHDBAK.mjs +173 -0
- package/dist/chunk-UPBHDBAK.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 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +2102 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -0
- package/package.json +71 -1
|
@@ -0,0 +1,385 @@
|
|
|
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/SectionHeading/index.ts
|
|
31
|
+
var SectionHeading_exports = {};
|
|
32
|
+
__export(SectionHeading_exports, {
|
|
33
|
+
SectionHeading: () => SectionHeading
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(SectionHeading_exports);
|
|
36
|
+
|
|
37
|
+
// src/SectionHeading/SectionHeading.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/SectionHeading/SectionHeading.tsx
|
|
144
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
145
|
+
var AvatarPlaceholder = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "22", height: "33", viewBox: "0 0 22 33", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "11", cy: "7", r: "7", fill: "#d1d1d1" }),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ellipse", { cx: "11", cy: "33", rx: "11", ry: "11", fill: "#d1d1d1" })
|
|
148
|
+
] });
|
|
149
|
+
var sectionHeadingStyles = {
|
|
150
|
+
container: {
|
|
151
|
+
display: "flex",
|
|
152
|
+
alignItems: "center",
|
|
153
|
+
gap: "12px",
|
|
154
|
+
padding: "8px",
|
|
155
|
+
borderBottom: "1px solid #f8f8f8",
|
|
156
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
157
|
+
minHeight: "56px",
|
|
158
|
+
boxSizing: "border-box"
|
|
159
|
+
},
|
|
160
|
+
title: {
|
|
161
|
+
fontSize: "22px",
|
|
162
|
+
fontWeight: "600",
|
|
163
|
+
color: "#2f2f2f",
|
|
164
|
+
lineHeight: "1.25",
|
|
165
|
+
flex: 1,
|
|
166
|
+
overflow: "hidden",
|
|
167
|
+
textOverflow: "ellipsis",
|
|
168
|
+
whiteSpace: "nowrap",
|
|
169
|
+
margin: 0
|
|
170
|
+
},
|
|
171
|
+
titleWithIcon: {
|
|
172
|
+
display: "flex",
|
|
173
|
+
alignItems: "center",
|
|
174
|
+
gap: "8px",
|
|
175
|
+
flex: 1
|
|
176
|
+
},
|
|
177
|
+
iconBadge: {
|
|
178
|
+
display: "flex",
|
|
179
|
+
alignItems: "center",
|
|
180
|
+
flexShrink: 0
|
|
181
|
+
},
|
|
182
|
+
avatar: {
|
|
183
|
+
width: "48px",
|
|
184
|
+
height: "48px",
|
|
185
|
+
borderRadius: "8px",
|
|
186
|
+
border: "1px solid #efefef",
|
|
187
|
+
backgroundColor: "#f8f8f8",
|
|
188
|
+
flexShrink: 0,
|
|
189
|
+
overflow: "hidden",
|
|
190
|
+
display: "flex",
|
|
191
|
+
alignItems: "center",
|
|
192
|
+
justifyContent: "center"
|
|
193
|
+
},
|
|
194
|
+
avatarImage: {
|
|
195
|
+
width: "100%",
|
|
196
|
+
height: "100%",
|
|
197
|
+
objectFit: "cover"
|
|
198
|
+
},
|
|
199
|
+
avatarInitials: {
|
|
200
|
+
fontSize: "18px",
|
|
201
|
+
fontWeight: "600",
|
|
202
|
+
color: "#595959"
|
|
203
|
+
},
|
|
204
|
+
button: {
|
|
205
|
+
display: "inline-flex",
|
|
206
|
+
alignItems: "center",
|
|
207
|
+
justifyContent: "center",
|
|
208
|
+
gap: "8px",
|
|
209
|
+
height: "32px",
|
|
210
|
+
padding: "0 16px",
|
|
211
|
+
backgroundColor: "#0e8a0e",
|
|
212
|
+
color: "#ffffff",
|
|
213
|
+
border: "none",
|
|
214
|
+
borderRadius: "99px",
|
|
215
|
+
fontSize: "13px",
|
|
216
|
+
fontWeight: "600",
|
|
217
|
+
cursor: "pointer",
|
|
218
|
+
transition: "background-color 0.15s ease-in-out",
|
|
219
|
+
whiteSpace: "nowrap",
|
|
220
|
+
flexShrink: 0
|
|
221
|
+
},
|
|
222
|
+
buttonHover: {
|
|
223
|
+
backgroundColor: "#005700"
|
|
224
|
+
},
|
|
225
|
+
buttonGroup: {
|
|
226
|
+
container: {
|
|
227
|
+
display: "inline-flex",
|
|
228
|
+
alignItems: "center",
|
|
229
|
+
gap: "8px",
|
|
230
|
+
padding: "8px",
|
|
231
|
+
backgroundColor: "#ffffff",
|
|
232
|
+
border: "1px solid #efefef",
|
|
233
|
+
borderRadius: "99px",
|
|
234
|
+
flexShrink: 0
|
|
235
|
+
},
|
|
236
|
+
button: {
|
|
237
|
+
base: {
|
|
238
|
+
display: "inline-flex",
|
|
239
|
+
alignItems: "center",
|
|
240
|
+
justifyContent: "center",
|
|
241
|
+
gap: "8px",
|
|
242
|
+
padding: "8px 16px",
|
|
243
|
+
borderRadius: "99px",
|
|
244
|
+
border: "none",
|
|
245
|
+
cursor: "pointer",
|
|
246
|
+
fontSize: "13px",
|
|
247
|
+
fontWeight: "600",
|
|
248
|
+
lineHeight: "1.5",
|
|
249
|
+
transition: "all 0.15s ease-in-out",
|
|
250
|
+
outline: "none",
|
|
251
|
+
whiteSpace: "nowrap"
|
|
252
|
+
},
|
|
253
|
+
default: {
|
|
254
|
+
backgroundColor: "transparent",
|
|
255
|
+
color: "#595959"
|
|
256
|
+
},
|
|
257
|
+
hover: {
|
|
258
|
+
backgroundColor: "#f8f8f8",
|
|
259
|
+
color: "#2f2f2f"
|
|
260
|
+
},
|
|
261
|
+
active: {
|
|
262
|
+
backgroundColor: "#0e8a0e",
|
|
263
|
+
color: "#ffffff"
|
|
264
|
+
},
|
|
265
|
+
activeHover: {
|
|
266
|
+
backgroundColor: "#005700",
|
|
267
|
+
color: "#ffffff"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
var SectionHeading = React2.forwardRef(
|
|
273
|
+
({ title, icon, avatar, button, buttonGroup, className, style, ...props }, ref) => {
|
|
274
|
+
const [buttonHovered, setButtonHovered] = React2.useState(false);
|
|
275
|
+
const [hoveredGroupIndex, setHoveredGroupIndex] = React2.useState(null);
|
|
276
|
+
if (button && buttonGroup) {
|
|
277
|
+
console.warn("SectionHeading: button and buttonGroup are mutually exclusive. Only button will be rendered.");
|
|
278
|
+
}
|
|
279
|
+
const renderAvatar = () => {
|
|
280
|
+
if (!avatar) return null;
|
|
281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: sectionHeadingStyles.avatar, children: avatar.src ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
282
|
+
"img",
|
|
283
|
+
{
|
|
284
|
+
src: avatar.src,
|
|
285
|
+
alt: avatar.alt || "Avatar",
|
|
286
|
+
style: sectionHeadingStyles.avatarImage
|
|
287
|
+
}
|
|
288
|
+
) : avatar.initials ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: sectionHeadingStyles.avatarInitials, children: avatar.initials }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AvatarPlaceholder, {}) });
|
|
289
|
+
};
|
|
290
|
+
const renderTitle = () => {
|
|
291
|
+
if (icon) {
|
|
292
|
+
const iconVariant = typeof icon === "string" ? icon : "info";
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: sectionHeadingStyles.titleWithIcon, children: [
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { style: { ...sectionHeadingStyles.title, flex: "none" }, children: title }),
|
|
295
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: sectionHeadingStyles.iconBadge, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SectionIcon, { variant: iconVariant }) })
|
|
296
|
+
] });
|
|
297
|
+
}
|
|
298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { style: sectionHeadingStyles.title, children: title });
|
|
299
|
+
};
|
|
300
|
+
const renderButton = () => {
|
|
301
|
+
if (!button) return null;
|
|
302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
303
|
+
"button",
|
|
304
|
+
{
|
|
305
|
+
type: "button",
|
|
306
|
+
style: {
|
|
307
|
+
...sectionHeadingStyles.button,
|
|
308
|
+
...buttonHovered && sectionHeadingStyles.buttonHover
|
|
309
|
+
},
|
|
310
|
+
onClick: button.onClick,
|
|
311
|
+
onMouseEnter: () => setButtonHovered(true),
|
|
312
|
+
onMouseLeave: () => setButtonHovered(false),
|
|
313
|
+
children: [
|
|
314
|
+
button.icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { display: "flex", alignItems: "center", width: "16px", height: "16px" }, children: button.icon }),
|
|
315
|
+
button.label
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
};
|
|
320
|
+
const renderButtonGroup = () => {
|
|
321
|
+
if (!buttonGroup || button) return null;
|
|
322
|
+
const { items, activeIndex = 0, onChange } = buttonGroup;
|
|
323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: sectionHeadingStyles.buttonGroup.container, children: items.slice(0, 4).map((item, index) => {
|
|
324
|
+
const isActive = index === activeIndex;
|
|
325
|
+
const isHovered = hoveredGroupIndex === index;
|
|
326
|
+
let btnStyle = {
|
|
327
|
+
...sectionHeadingStyles.buttonGroup.button.base
|
|
328
|
+
};
|
|
329
|
+
if (isActive) {
|
|
330
|
+
btnStyle = {
|
|
331
|
+
...btnStyle,
|
|
332
|
+
...sectionHeadingStyles.buttonGroup.button.active,
|
|
333
|
+
...isHovered && sectionHeadingStyles.buttonGroup.button.activeHover
|
|
334
|
+
};
|
|
335
|
+
} else {
|
|
336
|
+
btnStyle = {
|
|
337
|
+
...btnStyle,
|
|
338
|
+
...sectionHeadingStyles.buttonGroup.button.default,
|
|
339
|
+
...isHovered && sectionHeadingStyles.buttonGroup.button.hover
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
343
|
+
"button",
|
|
344
|
+
{
|
|
345
|
+
type: "button",
|
|
346
|
+
style: btnStyle,
|
|
347
|
+
onClick: () => {
|
|
348
|
+
if (index !== activeIndex && onChange) {
|
|
349
|
+
onChange(index);
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
onMouseEnter: () => setHoveredGroupIndex(index),
|
|
353
|
+
onMouseLeave: () => setHoveredGroupIndex(null),
|
|
354
|
+
children: [
|
|
355
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { display: "flex", alignItems: "center", width: "16px", height: "16px" }, children: item.icon }),
|
|
356
|
+
item.label
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
item.value || index
|
|
360
|
+
);
|
|
361
|
+
}) });
|
|
362
|
+
};
|
|
363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
364
|
+
"div",
|
|
365
|
+
{
|
|
366
|
+
ref,
|
|
367
|
+
className: (0, import_clsx2.clsx)("arbor-section-heading", className),
|
|
368
|
+
style: { ...sectionHeadingStyles.container, ...style },
|
|
369
|
+
...props,
|
|
370
|
+
children: [
|
|
371
|
+
renderAvatar(),
|
|
372
|
+
renderTitle(),
|
|
373
|
+
renderButton(),
|
|
374
|
+
renderButtonGroup()
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
SectionHeading.displayName = "SectionHeading";
|
|
381
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
382
|
+
0 && (module.exports = {
|
|
383
|
+
SectionHeading
|
|
384
|
+
});
|
|
385
|
+
//# sourceMappingURL=SectionHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SectionHeading/index.ts","../src/SectionHeading/SectionHeading.tsx","../src/SectionIcon/SectionIcon.tsx"],"sourcesContent":["export { SectionHeading } from './SectionHeading';\nexport type {\n SectionHeadingProps,\n SectionHeadingButton,\n SectionHeadingButtonGroupItem,\n} from './SectionHeading';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\nimport { SectionIcon, SectionIconVariant } from '../SectionIcon';\n\nexport interface SectionHeadingButton {\n /**\n * The label for the button\n */\n label: string;\n /**\n * Optional icon to display before the label\n */\n icon?: React.ReactNode;\n /**\n * Click handler for the button\n */\n onClick?: () => void;\n}\n\nexport interface SectionHeadingButtonGroupItem {\n /**\n * The label for the button\n */\n label: string;\n /**\n * Optional icon to display before the label\n */\n icon?: React.ReactNode;\n /**\n * Optional value identifier\n */\n value?: string;\n}\n\nexport interface SectionHeadingProps {\n /**\n * The heading title text\n */\n title: string;\n /**\n * Show an icon badge next to the title.\n * Can be a boolean (defaults to 'info') or a specific variant.\n * Available variants: 'warning', 'danger', 'info', 'success'\n */\n icon?: boolean | SectionIconVariant;\n /**\n * Avatar configuration - can be an image URL or initials\n */\n avatar?: {\n src?: string;\n initials?: string;\n alt?: string;\n };\n /**\n * Primary button configuration (mutually exclusive with buttonGroup)\n */\n button?: SectionHeadingButton;\n /**\n * Button group configuration (mutually exclusive with button)\n */\n buttonGroup?: {\n items: SectionHeadingButtonGroupItem[];\n activeIndex?: number;\n onChange?: (index: number) => void;\n };\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Placeholder icon for avatar\nconst AvatarPlaceholder = () => (\n <svg width=\"22\" height=\"33\" viewBox=\"0 0 22 33\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"11\" cy=\"7\" r=\"7\" fill=\"#d1d1d1\" />\n <ellipse cx=\"11\" cy=\"33\" rx=\"11\" ry=\"11\" fill=\"#d1d1d1\" />\n </svg>\n);\n\n// Arbor Design System section heading styles\nconst sectionHeadingStyles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n gap: '12px',\n padding: '8px',\n borderBottom: '1px solid #f8f8f8',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n minHeight: '56px',\n boxSizing: 'border-box' as const,\n },\n title: {\n fontSize: '22px',\n fontWeight: '600',\n color: '#2f2f2f',\n lineHeight: '1.25',\n flex: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap' as const,\n margin: 0,\n },\n titleWithIcon: {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n flex: 1,\n },\n iconBadge: {\n display: 'flex',\n alignItems: 'center',\n flexShrink: 0,\n },\n avatar: {\n width: '48px',\n height: '48px',\n borderRadius: '8px',\n border: '1px solid #efefef',\n backgroundColor: '#f8f8f8',\n flexShrink: 0,\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n avatarImage: {\n width: '100%',\n height: '100%',\n objectFit: 'cover' as const,\n },\n avatarInitials: {\n fontSize: '18px',\n fontWeight: '600',\n color: '#595959',\n },\n button: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8px',\n height: '32px',\n padding: '0 16px',\n backgroundColor: '#0e8a0e',\n color: '#ffffff',\n border: 'none',\n borderRadius: '99px',\n fontSize: '13px',\n fontWeight: '600',\n cursor: 'pointer',\n transition: 'background-color 0.15s ease-in-out',\n whiteSpace: 'nowrap' as const,\n flexShrink: 0,\n },\n buttonHover: {\n backgroundColor: '#005700',\n },\n buttonGroup: {\n container: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '8px',\n padding: '8px',\n backgroundColor: '#ffffff',\n border: '1px solid #efefef',\n borderRadius: '99px',\n flexShrink: 0,\n },\n button: {\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8px',\n padding: '8px 16px',\n borderRadius: '99px',\n border: 'none',\n cursor: 'pointer',\n fontSize: '13px',\n fontWeight: '600',\n lineHeight: '1.5',\n transition: 'all 0.15s ease-in-out',\n outline: 'none',\n whiteSpace: 'nowrap' as const,\n },\n default: {\n backgroundColor: 'transparent',\n color: '#595959',\n },\n hover: {\n backgroundColor: '#f8f8f8',\n color: '#2f2f2f',\n },\n active: {\n backgroundColor: '#0e8a0e',\n color: '#ffffff',\n },\n activeHover: {\n backgroundColor: '#005700',\n color: '#ffffff',\n },\n },\n },\n};\n\n/**\n * SectionHeading component - Arbor Design System\n *\n * A flexible section heading component that can include an icon, avatar,\n * button, or button group. Button and button group are mutually exclusive.\n *\n * @example\n * ```tsx\n * // Basic heading\n * <SectionHeading title=\"Section Title\" />\n *\n * // With icon\n * <SectionHeading title=\"Section Title\" icon />\n *\n * // With avatar\n * <SectionHeading\n * title=\"User Profile\"\n * avatar={{ src: \"/avatar.jpg\", alt: \"User\" }}\n * />\n *\n * // With button\n * <SectionHeading\n * title=\"Section Title\"\n * button={{ label: \"Add Item\", onClick: () => {} }}\n * />\n *\n * // With button group\n * <SectionHeading\n * title=\"Section Title\"\n * buttonGroup={{\n * items: [{ label: \"Day\" }, { label: \"Week\" }],\n * activeIndex: 0,\n * onChange: (index) => {}\n * }}\n * />\n * ```\n */\nexport const SectionHeading = React.forwardRef<HTMLDivElement, SectionHeadingProps>(\n ({ title, icon, avatar, button, buttonGroup, className, style, ...props }, ref) => {\n const [buttonHovered, setButtonHovered] = React.useState(false);\n const [hoveredGroupIndex, setHoveredGroupIndex] = React.useState<number | null>(null);\n\n // Warn if both button and buttonGroup are provided\n if (button && buttonGroup) {\n console.warn('SectionHeading: button and buttonGroup are mutually exclusive. Only button will be rendered.');\n }\n\n const renderAvatar = () => {\n if (!avatar) return null;\n\n return (\n <div style={sectionHeadingStyles.avatar}>\n {avatar.src ? (\n <img\n src={avatar.src}\n alt={avatar.alt || 'Avatar'}\n style={sectionHeadingStyles.avatarImage}\n />\n ) : avatar.initials ? (\n <span style={sectionHeadingStyles.avatarInitials}>{avatar.initials}</span>\n ) : (\n <AvatarPlaceholder />\n )}\n </div>\n );\n };\n\n const renderTitle = () => {\n if (icon) {\n // Determine the icon variant - default to 'info' if boolean true\n const iconVariant: SectionIconVariant = typeof icon === 'string' ? icon : 'info';\n\n return (\n <div style={sectionHeadingStyles.titleWithIcon}>\n <h2 style={{ ...sectionHeadingStyles.title, flex: 'none' }}>{title}</h2>\n <div style={sectionHeadingStyles.iconBadge}>\n <SectionIcon variant={iconVariant} />\n </div>\n </div>\n );\n }\n\n return <h2 style={sectionHeadingStyles.title}>{title}</h2>;\n };\n\n const renderButton = () => {\n if (!button) return null;\n\n return (\n <button\n type=\"button\"\n style={{\n ...sectionHeadingStyles.button,\n ...(buttonHovered && sectionHeadingStyles.buttonHover),\n }}\n onClick={button.onClick}\n onMouseEnter={() => setButtonHovered(true)}\n onMouseLeave={() => setButtonHovered(false)}\n >\n {button.icon && (\n <span style={{ display: 'flex', alignItems: 'center', width: '16px', height: '16px' }}>\n {button.icon}\n </span>\n )}\n {button.label}\n </button>\n );\n };\n\n const renderButtonGroup = () => {\n if (!buttonGroup || button) return null;\n\n const { items, activeIndex = 0, onChange } = buttonGroup;\n\n return (\n <div style={sectionHeadingStyles.buttonGroup.container}>\n {items.slice(0, 4).map((item, index) => {\n const isActive = index === activeIndex;\n const isHovered = hoveredGroupIndex === index;\n\n let btnStyle: React.CSSProperties = {\n ...sectionHeadingStyles.buttonGroup.button.base,\n };\n\n if (isActive) {\n btnStyle = {\n ...btnStyle,\n ...sectionHeadingStyles.buttonGroup.button.active,\n ...(isHovered && sectionHeadingStyles.buttonGroup.button.activeHover),\n };\n } else {\n btnStyle = {\n ...btnStyle,\n ...sectionHeadingStyles.buttonGroup.button.default,\n ...(isHovered && sectionHeadingStyles.buttonGroup.button.hover),\n };\n }\n\n return (\n <button\n key={item.value || index}\n type=\"button\"\n style={btnStyle}\n onClick={() => {\n if (index !== activeIndex && onChange) {\n onChange(index);\n }\n }}\n onMouseEnter={() => setHoveredGroupIndex(index)}\n onMouseLeave={() => setHoveredGroupIndex(null)}\n >\n {item.icon && (\n <span style={{ display: 'flex', alignItems: 'center', width: '16px', height: '16px' }}>\n {item.icon}\n </span>\n )}\n {item.label}\n </button>\n );\n })}\n </div>\n );\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-section-heading', className)}\n style={{ ...sectionHeadingStyles.container, ...style }}\n {...props}\n >\n {renderAvatar()}\n {renderTitle()}\n {renderButton()}\n {renderButtonGroup()}\n </div>\n );\n }\n);\n\nSectionHeading.displayName = 'SectionHeading';\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;AAAA,MACC,GAAE;AAAA,MACF,QAAQ;AAAA,MACR,aAAY;AAAA,MACZ,eAAc;AAAA;AAAA,EAChB;AAAA,EACA,4CAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,QAAO,MAAM,OAAO;AAAA,GAC9C;AAIF,IAAM,WAAW,CAAC,EAAE,MAAM,MACxB,6CAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,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AO;AAAA,UAC3D;AAAA,QACF,OAAO;AACL,qBAAW;AAAA,YACT,GAAG;AAAA,YACH,GAAG,qBAAqB,YAAY,OAAO;AAAA,YAC3C,GAAI,aAAa,qBAAqB,YAAY,OAAO;AAAA,UAC3D;AAAA,QACF;AAEA,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,OAAO;AAAA,YACP,SAAS,MAAM;AACb,kBAAI,UAAU,eAAe,UAAU;AACrC,yBAAS,KAAK;AAAA,cAChB;AAAA,YACF;AAAA,YACA,cAAc,MAAM,qBAAqB,KAAK;AAAA,YAC9C,cAAc,MAAM,qBAAqB,IAAI;AAAA,YAE5C;AAAA,mBAAK,QACJ,6CAAC,UAAK,OAAO,EAAE,SAAS,QAAQ,YAAY,UAAU,OAAO,QAAQ,QAAQ,OAAO,GACjF,eAAK,MACR;AAAA,cAED,KAAK;AAAA;AAAA;AAAA,UAhBD,KAAK,SAAS;AAAA,QAiBrB;AAAA,MAEJ,CAAC,GACH;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,mBAAK,yBAAyB,SAAS;AAAA,QAClD,OAAO,EAAE,GAAG,qBAAqB,WAAW,GAAG,MAAM;AAAA,QACpD,GAAG;AAAA,QAEH;AAAA,uBAAa;AAAA,UACb,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,kBAAkB;AAAA;AAAA;AAAA,IACrB;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;","names":["React","import_clsx","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SectionHeadingInteractiveProps {
|
|
4
|
+
/**
|
|
5
|
+
* The heading text (required)
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* Content to display when expanded (sub-sections, list rows, etc.)
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the section is expanded (controlled mode)
|
|
14
|
+
*/
|
|
15
|
+
expanded?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Default expanded state (uncontrolled mode)
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
defaultExpanded?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback when expanded state changes
|
|
23
|
+
*/
|
|
24
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Additional CSS class name
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Additional inline styles
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* SectionHeadingInteractive component - Arbor Design System
|
|
36
|
+
*
|
|
37
|
+
* A collapsible section heading component that can contain sub-sections,
|
|
38
|
+
* list rows, and other content. Click the header to expand/collapse.
|
|
39
|
+
* Uses h2 heading style (22px) for main section level.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Basic collapsible section
|
|
44
|
+
* <SectionHeadingInteractive title="Personal Information">
|
|
45
|
+
* <SubSectionInteractive title="Contact Details">
|
|
46
|
+
* <ListRow label="Email" value="john@example.com" />
|
|
47
|
+
* </SubSectionInteractive>
|
|
48
|
+
* </SectionHeadingInteractive>
|
|
49
|
+
*
|
|
50
|
+
* // Initially collapsed
|
|
51
|
+
* <SectionHeadingInteractive title="Additional Settings" defaultExpanded={false}>
|
|
52
|
+
* <ListRow label="Theme" value="Dark" />
|
|
53
|
+
* </SectionHeadingInteractive>
|
|
54
|
+
*
|
|
55
|
+
* // Controlled mode
|
|
56
|
+
* <SectionHeadingInteractive
|
|
57
|
+
* title="Account"
|
|
58
|
+
* expanded={isExpanded}
|
|
59
|
+
* onExpandedChange={setIsExpanded}
|
|
60
|
+
* >
|
|
61
|
+
* <ListRow label="Status" value="Active" />
|
|
62
|
+
* </SectionHeadingInteractive>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const SectionHeadingInteractive: React.ForwardRefExoticComponent<SectionHeadingInteractiveProps & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
|
|
67
|
+
export { SectionHeadingInteractive, type SectionHeadingInteractiveProps };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SectionHeadingInteractiveProps {
|
|
4
|
+
/**
|
|
5
|
+
* The heading text (required)
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* Content to display when expanded (sub-sections, list rows, etc.)
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the section is expanded (controlled mode)
|
|
14
|
+
*/
|
|
15
|
+
expanded?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Default expanded state (uncontrolled mode)
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
defaultExpanded?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback when expanded state changes
|
|
23
|
+
*/
|
|
24
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Additional CSS class name
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Additional inline styles
|
|
31
|
+
*/
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* SectionHeadingInteractive component - Arbor Design System
|
|
36
|
+
*
|
|
37
|
+
* A collapsible section heading component that can contain sub-sections,
|
|
38
|
+
* list rows, and other content. Click the header to expand/collapse.
|
|
39
|
+
* Uses h2 heading style (22px) for main section level.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Basic collapsible section
|
|
44
|
+
* <SectionHeadingInteractive title="Personal Information">
|
|
45
|
+
* <SubSectionInteractive title="Contact Details">
|
|
46
|
+
* <ListRow label="Email" value="john@example.com" />
|
|
47
|
+
* </SubSectionInteractive>
|
|
48
|
+
* </SectionHeadingInteractive>
|
|
49
|
+
*
|
|
50
|
+
* // Initially collapsed
|
|
51
|
+
* <SectionHeadingInteractive title="Additional Settings" defaultExpanded={false}>
|
|
52
|
+
* <ListRow label="Theme" value="Dark" />
|
|
53
|
+
* </SectionHeadingInteractive>
|
|
54
|
+
*
|
|
55
|
+
* // Controlled mode
|
|
56
|
+
* <SectionHeadingInteractive
|
|
57
|
+
* title="Account"
|
|
58
|
+
* expanded={isExpanded}
|
|
59
|
+
* onExpandedChange={setIsExpanded}
|
|
60
|
+
* >
|
|
61
|
+
* <ListRow label="Status" value="Active" />
|
|
62
|
+
* </SectionHeadingInteractive>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const SectionHeadingInteractive: React.ForwardRefExoticComponent<SectionHeadingInteractiveProps & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
|
|
67
|
+
export { SectionHeadingInteractive, type SectionHeadingInteractiveProps };
|