@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,211 @@
|
|
|
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/SubSectionInteractive/index.ts
|
|
31
|
+
var SubSectionInteractive_exports = {};
|
|
32
|
+
__export(SubSectionInteractive_exports, {
|
|
33
|
+
SubSectionInteractive: () => SubSectionInteractive
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(SubSectionInteractive_exports);
|
|
36
|
+
|
|
37
|
+
// src/SubSectionInteractive/SubSectionInteractive.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var ChevronIcon = ({ expanded }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
width: "16",
|
|
45
|
+
height: "16",
|
|
46
|
+
viewBox: "0 0 16 16",
|
|
47
|
+
fill: "none",
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
style: {
|
|
50
|
+
transform: expanded ? "rotate(0deg)" : "rotate(180deg)",
|
|
51
|
+
transition: "transform 0.2s ease-in-out"
|
|
52
|
+
},
|
|
53
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
"path",
|
|
55
|
+
{
|
|
56
|
+
d: "M4 6L8 10L12 6",
|
|
57
|
+
stroke: "#2f2f2f",
|
|
58
|
+
strokeWidth: "1.2",
|
|
59
|
+
strokeLinecap: "round",
|
|
60
|
+
strokeLinejoin: "round"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
var subSectionInteractiveStyles = {
|
|
66
|
+
container: {
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "column",
|
|
69
|
+
width: "100%",
|
|
70
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
71
|
+
boxSizing: "border-box"
|
|
72
|
+
},
|
|
73
|
+
header: {
|
|
74
|
+
display: "flex",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
width: "100%",
|
|
77
|
+
cursor: "pointer",
|
|
78
|
+
border: "none",
|
|
79
|
+
background: "transparent",
|
|
80
|
+
padding: 0,
|
|
81
|
+
margin: 0,
|
|
82
|
+
textAlign: "left",
|
|
83
|
+
outline: "none"
|
|
84
|
+
},
|
|
85
|
+
headerContent: {
|
|
86
|
+
display: "flex",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
justifyContent: "space-between",
|
|
89
|
+
width: "100%",
|
|
90
|
+
padding: "12px 8px",
|
|
91
|
+
borderRadius: "8px",
|
|
92
|
+
transition: "background-color 0.15s ease-in-out",
|
|
93
|
+
minHeight: "16px",
|
|
94
|
+
gap: "12px"
|
|
95
|
+
},
|
|
96
|
+
headerContentHover: {
|
|
97
|
+
backgroundColor: "#f8f8f8"
|
|
98
|
+
},
|
|
99
|
+
headerContentFocus: {
|
|
100
|
+
outline: "3px solid #3cad51",
|
|
101
|
+
outlineOffset: "-3px"
|
|
102
|
+
},
|
|
103
|
+
title: {
|
|
104
|
+
fontSize: "18px",
|
|
105
|
+
fontWeight: "600",
|
|
106
|
+
color: "#2f2f2f",
|
|
107
|
+
lineHeight: "1.25",
|
|
108
|
+
margin: 0,
|
|
109
|
+
flex: 1,
|
|
110
|
+
whiteSpace: "nowrap"
|
|
111
|
+
},
|
|
112
|
+
iconWrapper: {
|
|
113
|
+
display: "flex",
|
|
114
|
+
alignItems: "center",
|
|
115
|
+
justifyContent: "center",
|
|
116
|
+
width: "16px",
|
|
117
|
+
height: "16px",
|
|
118
|
+
flexShrink: 0
|
|
119
|
+
},
|
|
120
|
+
content: {
|
|
121
|
+
overflow: "hidden",
|
|
122
|
+
transition: "max-height 0.3s ease-in-out, opacity 0.2s ease-in-out"
|
|
123
|
+
},
|
|
124
|
+
contentExpanded: {
|
|
125
|
+
maxHeight: "2000px",
|
|
126
|
+
opacity: 1
|
|
127
|
+
},
|
|
128
|
+
contentCollapsed: {
|
|
129
|
+
maxHeight: "0px",
|
|
130
|
+
opacity: 0
|
|
131
|
+
},
|
|
132
|
+
contentInner: {
|
|
133
|
+
borderBottom: "1px solid #f8f8f8"
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
var SubSectionInteractive = React.forwardRef(
|
|
137
|
+
({
|
|
138
|
+
title,
|
|
139
|
+
children,
|
|
140
|
+
expanded: controlledExpanded,
|
|
141
|
+
defaultExpanded = true,
|
|
142
|
+
onExpandedChange,
|
|
143
|
+
className,
|
|
144
|
+
style,
|
|
145
|
+
...props
|
|
146
|
+
}, ref) => {
|
|
147
|
+
const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded);
|
|
148
|
+
const isControlled = controlledExpanded !== void 0;
|
|
149
|
+
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
150
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
151
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
152
|
+
const handleToggle = () => {
|
|
153
|
+
const newExpanded = !isExpanded;
|
|
154
|
+
if (!isControlled) {
|
|
155
|
+
setInternalExpanded(newExpanded);
|
|
156
|
+
}
|
|
157
|
+
onExpandedChange?.(newExpanded);
|
|
158
|
+
};
|
|
159
|
+
const handleKeyDown = (event) => {
|
|
160
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
handleToggle();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const headerContentStyle = {
|
|
166
|
+
...subSectionInteractiveStyles.headerContent,
|
|
167
|
+
...isHovered && subSectionInteractiveStyles.headerContentHover,
|
|
168
|
+
...isFocused && subSectionInteractiveStyles.headerContentFocus
|
|
169
|
+
};
|
|
170
|
+
const contentStyle = {
|
|
171
|
+
...subSectionInteractiveStyles.content,
|
|
172
|
+
...isExpanded ? subSectionInteractiveStyles.contentExpanded : subSectionInteractiveStyles.contentCollapsed
|
|
173
|
+
};
|
|
174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
ref,
|
|
178
|
+
className: (0, import_clsx.clsx)("arbor-sub-section-interactive", className),
|
|
179
|
+
style: { ...subSectionInteractiveStyles.container, ...style },
|
|
180
|
+
...props,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
type: "button",
|
|
186
|
+
style: subSectionInteractiveStyles.header,
|
|
187
|
+
onClick: handleToggle,
|
|
188
|
+
onMouseEnter: () => setIsHovered(true),
|
|
189
|
+
onMouseLeave: () => setIsHovered(false),
|
|
190
|
+
onFocus: () => setIsFocused(true),
|
|
191
|
+
onBlur: () => setIsFocused(false),
|
|
192
|
+
onKeyDown: handleKeyDown,
|
|
193
|
+
"aria-expanded": isExpanded,
|
|
194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: headerContentStyle, children: [
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { style: subSectionInteractiveStyles.title, children: title }),
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: subSectionInteractiveStyles.iconWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronIcon, { expanded: isExpanded }) })
|
|
197
|
+
] })
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: contentStyle, "aria-hidden": !isExpanded, children: children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: subSectionInteractiveStyles.contentInner, children }) })
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
SubSectionInteractive.displayName = "SubSectionInteractive";
|
|
207
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
208
|
+
0 && (module.exports = {
|
|
209
|
+
SubSectionInteractive
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=SubSectionInteractive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SubSectionInteractive/index.ts","../src/SubSectionInteractive/SubSectionInteractive.tsx"],"sourcesContent":["export { SubSectionInteractive } from './SubSectionInteractive';\nexport type { SubSectionInteractiveProps } from './SubSectionInteractive';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface SubSectionInteractiveProps {\n /**\n * The heading text (required)\n */\n title: string;\n /**\n * Content to display when expanded (list rows, etc.)\n */\n children?: React.ReactNode;\n /**\n * Whether the section is expanded (controlled mode)\n */\n expanded?: boolean;\n /**\n * Default expanded state (uncontrolled mode)\n * @default true\n */\n defaultExpanded?: boolean;\n /**\n * Callback when expanded state changes\n */\n onExpandedChange?: (expanded: boolean) => void;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Chevron icon - rotates based on expanded state\nconst ChevronIcon = ({ expanded }: { expanded: boolean }) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{\n transform: expanded ? 'rotate(0deg)' : 'rotate(180deg)',\n transition: 'transform 0.2s ease-in-out',\n }}\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"#2f2f2f\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n// Arbor Design System sub-section interactive styles\nconst subSectionInteractiveStyles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n width: '100%',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n boxSizing: 'border-box' as const,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n cursor: 'pointer',\n border: 'none',\n background: 'transparent',\n padding: 0,\n margin: 0,\n textAlign: 'left' as const,\n outline: 'none',\n },\n headerContent: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%',\n padding: '12px 8px',\n borderRadius: '8px',\n transition: 'background-color 0.15s ease-in-out',\n minHeight: '16px',\n gap: '12px',\n },\n headerContentHover: {\n backgroundColor: '#f8f8f8',\n },\n headerContentFocus: {\n outline: '3px solid #3cad51',\n outlineOffset: '-3px',\n },\n title: {\n fontSize: '18px',\n fontWeight: '600',\n color: '#2f2f2f',\n lineHeight: '1.25',\n margin: 0,\n flex: 1,\n whiteSpace: 'nowrap' as const,\n },\n iconWrapper: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n flexShrink: 0,\n },\n content: {\n overflow: 'hidden',\n transition: 'max-height 0.3s ease-in-out, opacity 0.2s ease-in-out',\n },\n contentExpanded: {\n maxHeight: '2000px',\n opacity: 1,\n },\n contentCollapsed: {\n maxHeight: '0px',\n opacity: 0,\n },\n contentInner: {\n borderBottom: '1px solid #f8f8f8',\n },\n};\n\n/**\n * SubSectionInteractive component - Arbor Design System\n *\n * A collapsible sub-section component that can contain list rows and other content.\n * Click the header to expand/collapse the content area.\n *\n * @example\n * ```tsx\n * // Basic collapsible section\n * <SubSectionInteractive title=\"Personal Details\">\n * <ListRow label=\"Name\" value=\"John Smith\" />\n * <ListRow label=\"Email\" value=\"john@example.com\" />\n * </SubSectionInteractive>\n *\n * // Initially collapsed\n * <SubSectionInteractive title=\"Additional Info\" defaultExpanded={false}>\n * <ListRow label=\"Notes\" value=\"Some notes here\" />\n * </SubSectionInteractive>\n *\n * // Controlled mode\n * <SubSectionInteractive\n * title=\"Settings\"\n * expanded={isExpanded}\n * onExpandedChange={setIsExpanded}\n * >\n * <ListRow label=\"Theme\" value=\"Dark\" />\n * </SubSectionInteractive>\n * ```\n */\nexport const SubSectionInteractive = React.forwardRef<HTMLDivElement, SubSectionInteractiveProps>(\n (\n {\n title,\n children,\n expanded: controlledExpanded,\n defaultExpanded = true,\n onExpandedChange,\n className,\n style,\n ...props\n },\n ref\n ) => {\n // Support both controlled and uncontrolled modes\n const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded);\n const isControlled = controlledExpanded !== undefined;\n const isExpanded = isControlled ? controlledExpanded : internalExpanded;\n\n const [isHovered, setIsHovered] = React.useState(false);\n const [isFocused, setIsFocused] = React.useState(false);\n\n const handleToggle = () => {\n const newExpanded = !isExpanded;\n if (!isControlled) {\n setInternalExpanded(newExpanded);\n }\n onExpandedChange?.(newExpanded);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleToggle();\n }\n };\n\n const headerContentStyle: React.CSSProperties = {\n ...subSectionInteractiveStyles.headerContent,\n ...(isHovered && subSectionInteractiveStyles.headerContentHover),\n ...(isFocused && subSectionInteractiveStyles.headerContentFocus),\n };\n\n const contentStyle: React.CSSProperties = {\n ...subSectionInteractiveStyles.content,\n ...(isExpanded\n ? subSectionInteractiveStyles.contentExpanded\n : subSectionInteractiveStyles.contentCollapsed),\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-sub-section-interactive', className)}\n style={{ ...subSectionInteractiveStyles.container, ...style }}\n {...props}\n >\n <button\n type=\"button\"\n style={subSectionInteractiveStyles.header}\n onClick={handleToggle}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n onKeyDown={handleKeyDown}\n aria-expanded={isExpanded}\n >\n <div style={headerContentStyle}>\n <h3 style={subSectionInteractiveStyles.title}>{title}</h3>\n <span style={subSectionInteractiveStyles.iconWrapper}>\n <ChevronIcon expanded={isExpanded} />\n </span>\n </div>\n </button>\n <div style={contentStyle} aria-hidden={!isExpanded}>\n {children && (\n <div style={subSectionInteractiveStyles.contentInner}>{children}</div>\n )}\n </div>\n </div>\n );\n }\n);\n\nSubSectionInteractive.displayName = 'SubSectionInteractive';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AA+CjB;AAZJ,IAAM,cAAc,CAAC,EAAE,SAAS,MAC9B;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACN,OAAO;AAAA,MACL,WAAW,WAAW,iBAAiB;AAAA,MACvC,YAAY;AAAA,IACd;AAAA,IAEA;AAA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AAa,IAAI;AAAA,cACrC,cAAc,MAAM,aAAa,KAAK;AAAA,cACtC,SAAS,MAAM,aAAa,IAAI;AAAA,cAChC,QAAQ,MAAM,aAAa,KAAK;AAAA,cAChC,WAAW;AAAA,cACX,iBAAe;AAAA,cAEf,uDAAC,SAAI,OAAO,oBACV;AAAA,4DAAC,QAAG,OAAO,4BAA4B,OAAQ,iBAAM;AAAA,gBACrD,4CAAC,UAAK,OAAO,4BAA4B,aACvC,sDAAC,eAAY,UAAU,YAAY,GACrC;AAAA,iBACF;AAAA;AAAA,UACF;AAAA,UACA,4CAAC,SAAI,OAAO,cAAc,eAAa,CAAC,YACrC,sBACC,4CAAC,SAAI,OAAO,4BAA4B,cAAe,UAAS,GAEpE;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,sBAAsB,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// src/Modal/Modal.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var modalStyles = {
|
|
6
|
+
container: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
alignItems: "flex-start",
|
|
10
|
+
backgroundColor: "#f8f8f8",
|
|
11
|
+
// grey-050
|
|
12
|
+
borderRadius: "8px",
|
|
13
|
+
boxShadow: "0px 8px 24px 0px rgba(32, 32, 32, 0.12)",
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
boxSizing: "border-box",
|
|
16
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
17
|
+
},
|
|
18
|
+
content: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
width: "100%",
|
|
23
|
+
padding: "32px 16px",
|
|
24
|
+
backgroundColor: "#f8f8f8",
|
|
25
|
+
// grey-050
|
|
26
|
+
boxSizing: "border-box"
|
|
27
|
+
},
|
|
28
|
+
contentText: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
fontSize: "13px",
|
|
31
|
+
fontWeight: "400",
|
|
32
|
+
color: "#2f2f2f",
|
|
33
|
+
lineHeight: "1.5"
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var Modal = React.forwardRef(
|
|
37
|
+
({ children, width = 584, className, style, ...props }, ref) => {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
className: clsx("arbor-modal", className),
|
|
43
|
+
style: {
|
|
44
|
+
...modalStyles.container,
|
|
45
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
46
|
+
...style
|
|
47
|
+
},
|
|
48
|
+
role: "dialog",
|
|
49
|
+
"aria-modal": "true",
|
|
50
|
+
...props,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
Modal.displayName = "Modal";
|
|
57
|
+
var ModalContent = React.forwardRef(
|
|
58
|
+
({ children, className, style, ...props }, ref) => {
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
className: clsx("arbor-modal-content", className),
|
|
64
|
+
style: { ...modalStyles.content, ...style },
|
|
65
|
+
...props,
|
|
66
|
+
children: /* @__PURE__ */ jsx("div", { style: modalStyles.contentText, children })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
ModalContent.displayName = "ModalContent";
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
Modal,
|
|
75
|
+
ModalContent
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=chunk-7JWINM2N.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Modal/Modal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface ModalProps {\n /**\n * The content of the modal (typically ModalHeader, content, and ModalFooter)\n */\n children: React.ReactNode;\n /**\n * Width of the modal\n * @default 584\n */\n width?: number | string;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\nexport interface ModalContentProps {\n /**\n * The content to display in the modal body\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 modal styles\nconst modalStyles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'flex-start',\n backgroundColor: '#f8f8f8', // grey-050\n borderRadius: '8px',\n boxShadow: '0px 8px 24px 0px rgba(32, 32, 32, 0.12)',\n overflow: 'hidden',\n boxSizing: 'border-box' as const,\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n },\n content: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n padding: '32px 16px',\n backgroundColor: '#f8f8f8', // grey-050\n boxSizing: 'border-box' as const,\n },\n contentText: {\n flex: 1,\n fontSize: '13px',\n fontWeight: '400',\n color: '#2f2f2f',\n lineHeight: '1.5',\n },\n};\n\n/**\n * Modal component - Arbor Design System\n *\n * A modal dialog container that wraps ModalHeader, content, and ModalFooter.\n *\n * @example\n * ```tsx\n * <Modal width={584}>\n * <ModalHeader\n * title=\"Delete postal address?\"\n * onClose={() => setIsOpen(false)}\n * />\n * <ModalContent>\n * <p>This will delete the postal address. Are you sure?</p>\n * </ModalContent>\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"destructive-secondary\">Confirm</Button>\n * </ModalFooter>\n * </Modal>\n * ```\n */\nexport const Modal = React.forwardRef<HTMLDivElement, ModalProps>(\n ({ children, width = 584, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal', className)}\n style={{\n ...modalStyles.container,\n width: typeof width === 'number' ? `${width}px` : width,\n ...style,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nModal.displayName = 'Modal';\n\n/**\n * ModalContent component - Arbor Design System\n *\n * The content/body area of a modal dialog.\n *\n * @example\n * ```tsx\n * <ModalContent>\n * <p>Your content here</p>\n * </ModalContent>\n * ```\n */\nexport const ModalContent = React.forwardRef<HTMLDivElement, ModalContentProps>(\n ({ children, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal-content', className)}\n style={{ ...modalStyles.content, ...style }}\n {...props}\n >\n <div style={modalStyles.contentText}>{children}</div>\n </div>\n );\n }\n);\n\nModalContent.displayName = 'ModalContent';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AA6Ff;AAvDN,IAAM,cAAc;AAAA,EAClB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,iBAAiB;AAAA;AAAA,IACjB,cAAc;AAAA,IACd,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,iBAAiB;AAAA;AAAA,IACjB,WAAW;AAAA,EACb;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,EACd;AACF;AAwBO,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,UAAU,QAAQ,KAAK,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC9D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,KAAK,eAAe,SAAS;AAAA,QACxC,OAAO;AAAA,UACL,GAAG,YAAY;AAAA,UACf,OAAO,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAAA,UAClD,GAAG;AAAA,QACL;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACV,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,MAAM,cAAc;AAcb,IAAM,eAAqB;AAAA,EAChC,CAAC,EAAE,UAAU,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,KAAK,uBAAuB,SAAS;AAAA,QAChD,OAAO,EAAE,GAAG,YAAY,SAAS,GAAG,MAAM;AAAA,QACzC,GAAG;AAAA,QAEJ,8BAAC,SAAI,OAAO,YAAY,aAAc,UAAS;AAAA;AAAA,IACjD;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/SectionIcon/SectionIcon.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var WarningIcon = ({ color }) => /* @__PURE__ */ jsxs("svg", { width: "14", height: "12", viewBox: "0 0 14 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
6
|
+
/* @__PURE__ */ jsx(
|
|
7
|
+
"path",
|
|
8
|
+
{
|
|
9
|
+
d: "M7 0.5L13.5 11.5H0.5L7 0.5Z",
|
|
10
|
+
stroke: color,
|
|
11
|
+
strokeWidth: "1.2",
|
|
12
|
+
strokeLinejoin: "round",
|
|
13
|
+
fill: "none"
|
|
14
|
+
}
|
|
15
|
+
),
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
d: "M7 4.5V7",
|
|
20
|
+
stroke: color,
|
|
21
|
+
strokeWidth: "1.2",
|
|
22
|
+
strokeLinecap: "round"
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "9", r: "0.75", fill: color })
|
|
26
|
+
] });
|
|
27
|
+
var InfoIcon = ({ color }) => /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "6", stroke: color, strokeWidth: "1.2", fill: "none" }),
|
|
29
|
+
/* @__PURE__ */ jsx("path", { d: "M7 6V10", stroke: color, strokeWidth: "1.2", strokeLinecap: "round" }),
|
|
30
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "4", r: "0.75", fill: color })
|
|
31
|
+
] });
|
|
32
|
+
var SuccessIcon = ({ color }) => /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "6", stroke: color, strokeWidth: "1.2", fill: "none" }),
|
|
34
|
+
/* @__PURE__ */ jsx("path", { d: "M4 7L6 9L10 5", stroke: color, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
35
|
+
] });
|
|
36
|
+
var variantConfig = {
|
|
37
|
+
warning: {
|
|
38
|
+
backgroundColor: "#fffaf5",
|
|
39
|
+
iconColor: "#e4720d"
|
|
40
|
+
},
|
|
41
|
+
danger: {
|
|
42
|
+
backgroundColor: "#fff5f5",
|
|
43
|
+
iconColor: "#c93232"
|
|
44
|
+
},
|
|
45
|
+
info: {
|
|
46
|
+
backgroundColor: "#f5fbff",
|
|
47
|
+
iconColor: "#2c8bca"
|
|
48
|
+
},
|
|
49
|
+
success: {
|
|
50
|
+
backgroundColor: "#f5fff8",
|
|
51
|
+
iconColor: "#16a33d"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var sectionIconStyles = {
|
|
55
|
+
container: {
|
|
56
|
+
display: "inline-flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
padding: "4px",
|
|
60
|
+
borderRadius: "99px"
|
|
61
|
+
},
|
|
62
|
+
iconWrapper: {
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
width: "16px",
|
|
67
|
+
height: "16px"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var SectionIcon = React.forwardRef(
|
|
71
|
+
({ variant = "info", className, style, ...props }, ref) => {
|
|
72
|
+
const config = variantConfig[variant];
|
|
73
|
+
const renderIcon = () => {
|
|
74
|
+
switch (variant) {
|
|
75
|
+
case "warning":
|
|
76
|
+
case "danger":
|
|
77
|
+
return /* @__PURE__ */ jsx(WarningIcon, { color: config.iconColor });
|
|
78
|
+
case "success":
|
|
79
|
+
return /* @__PURE__ */ jsx(SuccessIcon, { color: config.iconColor });
|
|
80
|
+
case "info":
|
|
81
|
+
default:
|
|
82
|
+
return /* @__PURE__ */ jsx(InfoIcon, { color: config.iconColor });
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
className: clsx("arbor-section-icon", className),
|
|
90
|
+
style: {
|
|
91
|
+
...sectionIconStyles.container,
|
|
92
|
+
backgroundColor: config.backgroundColor,
|
|
93
|
+
...style
|
|
94
|
+
},
|
|
95
|
+
...props,
|
|
96
|
+
children: /* @__PURE__ */ jsx("div", { style: sectionIconStyles.iconWrapper, children: renderIcon() })
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
SectionIcon.displayName = "SectionIcon";
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
SectionIcon
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=chunk-7NYBJKJS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SectionIcon/SectionIcon.tsx"],"sourcesContent":["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 {renderI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AAW,GACd;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// src/SubSectionHeading/SubSectionHeading.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var InfoIcon = () => /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
6
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.5", stroke: "#2f2f2f", strokeWidth: "1.2" }),
|
|
7
|
+
/* @__PURE__ */ jsx(
|
|
8
|
+
"path",
|
|
9
|
+
{
|
|
10
|
+
d: "M8 7V11",
|
|
11
|
+
stroke: "#2f2f2f",
|
|
12
|
+
strokeWidth: "1.2",
|
|
13
|
+
strokeLinecap: "round"
|
|
14
|
+
}
|
|
15
|
+
),
|
|
16
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "5", r: "0.75", fill: "#2f2f2f" })
|
|
17
|
+
] });
|
|
18
|
+
var PlusIcon = ({ color = "#2f2f2f" }) => /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
d: "M8 3V13M3 8H13",
|
|
22
|
+
stroke: color,
|
|
23
|
+
strokeWidth: "1.2",
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round"
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
var subSectionHeadingStyles = {
|
|
29
|
+
container: {
|
|
30
|
+
display: "flex",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
width: "100%",
|
|
33
|
+
borderBottom: "1px solid #efefef",
|
|
34
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
35
|
+
boxSizing: "border-box"
|
|
36
|
+
},
|
|
37
|
+
containerNoButton: {
|
|
38
|
+
padding: "12px 8px",
|
|
39
|
+
gap: "0px"
|
|
40
|
+
},
|
|
41
|
+
containerWithButton: {
|
|
42
|
+
padding: "8px",
|
|
43
|
+
gap: "12px",
|
|
44
|
+
justifyContent: "space-between"
|
|
45
|
+
},
|
|
46
|
+
textContainer: {
|
|
47
|
+
display: "flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
gap: "8px",
|
|
50
|
+
flex: 1,
|
|
51
|
+
minHeight: "16px"
|
|
52
|
+
},
|
|
53
|
+
title: {
|
|
54
|
+
fontSize: "18px",
|
|
55
|
+
fontWeight: "600",
|
|
56
|
+
color: "#2f2f2f",
|
|
57
|
+
lineHeight: "1.25",
|
|
58
|
+
margin: 0,
|
|
59
|
+
whiteSpace: "nowrap"
|
|
60
|
+
},
|
|
61
|
+
iconWrapper: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "center",
|
|
65
|
+
width: "16px",
|
|
66
|
+
height: "16px",
|
|
67
|
+
flexShrink: 0
|
|
68
|
+
},
|
|
69
|
+
buttonBase: {
|
|
70
|
+
display: "flex",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
justifyContent: "center",
|
|
73
|
+
gap: "8px",
|
|
74
|
+
height: "32px",
|
|
75
|
+
minHeight: "32px",
|
|
76
|
+
padding: "0 16px",
|
|
77
|
+
borderRadius: "99px",
|
|
78
|
+
border: "none",
|
|
79
|
+
cursor: "pointer",
|
|
80
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
81
|
+
fontSize: "13px",
|
|
82
|
+
fontWeight: "600",
|
|
83
|
+
lineHeight: "1.5",
|
|
84
|
+
whiteSpace: "nowrap",
|
|
85
|
+
flexShrink: 0,
|
|
86
|
+
transition: "background-color 0.15s ease-in-out, opacity 0.15s ease-in-out"
|
|
87
|
+
},
|
|
88
|
+
buttonPrimary: {
|
|
89
|
+
backgroundColor: "#0e8a0e",
|
|
90
|
+
color: "#ffffff"
|
|
91
|
+
},
|
|
92
|
+
buttonPrimaryHover: {
|
|
93
|
+
backgroundColor: "#0a6b0a"
|
|
94
|
+
},
|
|
95
|
+
buttonTertiary: {
|
|
96
|
+
backgroundColor: "#efefef",
|
|
97
|
+
color: "#2f2f2f"
|
|
98
|
+
},
|
|
99
|
+
buttonTertiaryHover: {
|
|
100
|
+
backgroundColor: "#e5e5e5"
|
|
101
|
+
},
|
|
102
|
+
buttonIconWrapper: {
|
|
103
|
+
display: "flex",
|
|
104
|
+
alignItems: "center",
|
|
105
|
+
justifyContent: "center",
|
|
106
|
+
width: "16px",
|
|
107
|
+
height: "16px",
|
|
108
|
+
flexShrink: 0
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
var SubSectionHeading = React.forwardRef(
|
|
112
|
+
({
|
|
113
|
+
title,
|
|
114
|
+
icon = false,
|
|
115
|
+
button,
|
|
116
|
+
buttonText = "Button Text",
|
|
117
|
+
buttonIcon,
|
|
118
|
+
onButtonClick,
|
|
119
|
+
className,
|
|
120
|
+
style,
|
|
121
|
+
...props
|
|
122
|
+
}, ref) => {
|
|
123
|
+
const [isButtonHovered, setIsButtonHovered] = React.useState(false);
|
|
124
|
+
const containerStyle = {
|
|
125
|
+
...subSectionHeadingStyles.container,
|
|
126
|
+
...button ? subSectionHeadingStyles.containerWithButton : subSectionHeadingStyles.containerNoButton,
|
|
127
|
+
...style
|
|
128
|
+
};
|
|
129
|
+
const getButtonStyle = () => {
|
|
130
|
+
const baseStyle = { ...subSectionHeadingStyles.buttonBase };
|
|
131
|
+
if (button === "primary") {
|
|
132
|
+
return {
|
|
133
|
+
...baseStyle,
|
|
134
|
+
...subSectionHeadingStyles.buttonPrimary,
|
|
135
|
+
...isButtonHovered && subSectionHeadingStyles.buttonPrimaryHover
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (button === "tertiary") {
|
|
139
|
+
return {
|
|
140
|
+
...baseStyle,
|
|
141
|
+
...subSectionHeadingStyles.buttonTertiary,
|
|
142
|
+
...isButtonHovered && subSectionHeadingStyles.buttonTertiaryHover
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return baseStyle;
|
|
146
|
+
};
|
|
147
|
+
const renderButtonIcon = () => {
|
|
148
|
+
if (buttonIcon) {
|
|
149
|
+
return /* @__PURE__ */ jsx("span", { style: subSectionHeadingStyles.buttonIconWrapper, children: buttonIcon });
|
|
150
|
+
}
|
|
151
|
+
return /* @__PURE__ */ jsx("span", { style: subSectionHeadingStyles.buttonIconWrapper, children: /* @__PURE__ */ jsx(PlusIcon, { color: button === "primary" ? "#ffffff" : "#2f2f2f" }) });
|
|
152
|
+
};
|
|
153
|
+
return /* @__PURE__ */ jsxs(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
className: clsx("arbor-sub-section-heading", className),
|
|
158
|
+
style: containerStyle,
|
|
159
|
+
...props,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { style: subSectionHeadingStyles.textContainer, children: [
|
|
162
|
+
/* @__PURE__ */ jsx("h3", { style: subSectionHeadingStyles.title, children: title }),
|
|
163
|
+
icon && /* @__PURE__ */ jsx("span", { style: subSectionHeadingStyles.iconWrapper, children: /* @__PURE__ */ jsx(InfoIcon, {}) })
|
|
164
|
+
] }),
|
|
165
|
+
button && /* @__PURE__ */ jsxs(
|
|
166
|
+
"button",
|
|
167
|
+
{
|
|
168
|
+
type: "button",
|
|
169
|
+
style: getButtonStyle(),
|
|
170
|
+
onClick: onButtonClick,
|
|
171
|
+
onMouseEnter: () => setIsButtonHovered(true),
|
|
172
|
+
onMouseLeave: () => setIsButtonHovered(false),
|
|
173
|
+
children: [
|
|
174
|
+
renderButtonIcon(),
|
|
175
|
+
/* @__PURE__ */ jsx("span", { children: buttonText })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
SubSectionHeading.displayName = "SubSectionHeading";
|
|
185
|
+
|
|
186
|
+
export {
|
|
187
|
+
SubSectionHeading
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=chunk-ALLCJATI.mjs.map
|