@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,189 @@
|
|
|
1
|
+
// src/SectionHeadingInteractive/SectionHeadingInteractive.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var ChevronIcon = ({ expanded }) => /* @__PURE__ */ jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
width: "16",
|
|
9
|
+
height: "16",
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
style: {
|
|
14
|
+
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
15
|
+
transition: "transform 0.2s ease-in-out"
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ jsx(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "M4 6L8 10L12 6",
|
|
21
|
+
stroke: "#2f2f2f",
|
|
22
|
+
strokeWidth: "1.2",
|
|
23
|
+
strokeLinecap: "round",
|
|
24
|
+
strokeLinejoin: "round"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var sectionHeadingInteractiveStyles = {
|
|
30
|
+
container: {
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
width: "100%",
|
|
34
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
35
|
+
boxSizing: "border-box"
|
|
36
|
+
},
|
|
37
|
+
header: {
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
width: "100%",
|
|
41
|
+
cursor: "pointer",
|
|
42
|
+
border: "none",
|
|
43
|
+
background: "transparent",
|
|
44
|
+
padding: 0,
|
|
45
|
+
margin: 0,
|
|
46
|
+
textAlign: "left",
|
|
47
|
+
outline: "none"
|
|
48
|
+
},
|
|
49
|
+
// When collapsed, no bottom border
|
|
50
|
+
headerContainerCollapsed: {
|
|
51
|
+
display: "flex",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
width: "100%"
|
|
54
|
+
},
|
|
55
|
+
// When expanded, has bottom border
|
|
56
|
+
headerContainerExpanded: {
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
width: "100%",
|
|
60
|
+
borderBottom: "1px solid #f8f8f8"
|
|
61
|
+
},
|
|
62
|
+
headerContent: {
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "space-between",
|
|
66
|
+
width: "100%",
|
|
67
|
+
padding: "12px 8px",
|
|
68
|
+
borderRadius: "8px",
|
|
69
|
+
transition: "background-color 0.15s ease-in-out",
|
|
70
|
+
minHeight: "16px",
|
|
71
|
+
gap: "12px"
|
|
72
|
+
},
|
|
73
|
+
headerContentHover: {
|
|
74
|
+
backgroundColor: "#f8f8f8"
|
|
75
|
+
},
|
|
76
|
+
headerContentFocus: {
|
|
77
|
+
outline: "3px solid #3cad51",
|
|
78
|
+
outlineOffset: "-3px"
|
|
79
|
+
},
|
|
80
|
+
title: {
|
|
81
|
+
fontSize: "22px",
|
|
82
|
+
fontWeight: "600",
|
|
83
|
+
color: "#2f2f2f",
|
|
84
|
+
lineHeight: "1.25",
|
|
85
|
+
margin: 0,
|
|
86
|
+
flex: 1,
|
|
87
|
+
whiteSpace: "nowrap"
|
|
88
|
+
},
|
|
89
|
+
iconWrapper: {
|
|
90
|
+
display: "flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
justifyContent: "center",
|
|
93
|
+
width: "16px",
|
|
94
|
+
height: "16px",
|
|
95
|
+
flexShrink: 0
|
|
96
|
+
},
|
|
97
|
+
content: {
|
|
98
|
+
overflow: "hidden",
|
|
99
|
+
transition: "max-height 0.3s ease-in-out, opacity 0.2s ease-in-out"
|
|
100
|
+
},
|
|
101
|
+
contentExpanded: {
|
|
102
|
+
maxHeight: "5000px",
|
|
103
|
+
opacity: 1
|
|
104
|
+
},
|
|
105
|
+
contentCollapsed: {
|
|
106
|
+
maxHeight: "0px",
|
|
107
|
+
opacity: 0
|
|
108
|
+
},
|
|
109
|
+
contentInner: {
|
|
110
|
+
// Content area styling - children go here
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
var SectionHeadingInteractive = React.forwardRef(
|
|
114
|
+
({
|
|
115
|
+
title,
|
|
116
|
+
children,
|
|
117
|
+
expanded: controlledExpanded,
|
|
118
|
+
defaultExpanded = true,
|
|
119
|
+
onExpandedChange,
|
|
120
|
+
className,
|
|
121
|
+
style,
|
|
122
|
+
...props
|
|
123
|
+
}, ref) => {
|
|
124
|
+
const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded);
|
|
125
|
+
const isControlled = controlledExpanded !== void 0;
|
|
126
|
+
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
127
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
128
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
129
|
+
const handleToggle = () => {
|
|
130
|
+
const newExpanded = !isExpanded;
|
|
131
|
+
if (!isControlled) {
|
|
132
|
+
setInternalExpanded(newExpanded);
|
|
133
|
+
}
|
|
134
|
+
onExpandedChange?.(newExpanded);
|
|
135
|
+
};
|
|
136
|
+
const handleKeyDown = (event) => {
|
|
137
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
handleToggle();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const headerContainerStyle = isExpanded ? sectionHeadingInteractiveStyles.headerContainerExpanded : sectionHeadingInteractiveStyles.headerContainerCollapsed;
|
|
143
|
+
const headerContentStyle = {
|
|
144
|
+
...sectionHeadingInteractiveStyles.headerContent,
|
|
145
|
+
...isHovered && sectionHeadingInteractiveStyles.headerContentHover,
|
|
146
|
+
...isFocused && sectionHeadingInteractiveStyles.headerContentFocus
|
|
147
|
+
};
|
|
148
|
+
const contentStyle = {
|
|
149
|
+
...sectionHeadingInteractiveStyles.content,
|
|
150
|
+
...isExpanded ? sectionHeadingInteractiveStyles.contentExpanded : sectionHeadingInteractiveStyles.contentCollapsed
|
|
151
|
+
};
|
|
152
|
+
return /* @__PURE__ */ jsxs(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
ref,
|
|
156
|
+
className: clsx("arbor-section-heading-interactive", className),
|
|
157
|
+
style: { ...sectionHeadingInteractiveStyles.container, ...style },
|
|
158
|
+
...props,
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ jsx("div", { style: headerContainerStyle, children: /* @__PURE__ */ jsx(
|
|
161
|
+
"button",
|
|
162
|
+
{
|
|
163
|
+
type: "button",
|
|
164
|
+
style: sectionHeadingInteractiveStyles.header,
|
|
165
|
+
onClick: handleToggle,
|
|
166
|
+
onMouseEnter: () => setIsHovered(true),
|
|
167
|
+
onMouseLeave: () => setIsHovered(false),
|
|
168
|
+
onFocus: () => setIsFocused(true),
|
|
169
|
+
onBlur: () => setIsFocused(false),
|
|
170
|
+
onKeyDown: handleKeyDown,
|
|
171
|
+
"aria-expanded": isExpanded,
|
|
172
|
+
children: /* @__PURE__ */ jsxs("div", { style: headerContentStyle, children: [
|
|
173
|
+
/* @__PURE__ */ jsx("h2", { style: sectionHeadingInteractiveStyles.title, children: title }),
|
|
174
|
+
/* @__PURE__ */ jsx("span", { style: sectionHeadingInteractiveStyles.iconWrapper, children: /* @__PURE__ */ jsx(ChevronIcon, { expanded: isExpanded }) })
|
|
175
|
+
] })
|
|
176
|
+
}
|
|
177
|
+
) }),
|
|
178
|
+
/* @__PURE__ */ jsx("div", { style: contentStyle, "aria-hidden": !isExpanded, children: children && /* @__PURE__ */ jsx("div", { style: sectionHeadingInteractiveStyles.contentInner, children }) })
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
SectionHeadingInteractive.displayName = "SectionHeadingInteractive";
|
|
185
|
+
|
|
186
|
+
export {
|
|
187
|
+
SectionHeadingInteractive
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=chunk-RL4G7MR3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SectionHeadingInteractive/SectionHeadingInteractive.tsx"],"sourcesContent":["import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface SectionHeadingInteractiveProps {\n /**\n * The heading text (required)\n */\n title: string;\n /**\n * Content to display when expanded (sub-sections, 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(180deg)' : 'rotate(0deg)',\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 section heading interactive styles\nconst sectionHeadingInteractiveStyles = {\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 // When collapsed, no bottom border\n headerContainerCollapsed: {\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n },\n // When expanded, has bottom border\n headerContainerExpanded: {\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n borderBottom: '1px solid #f8f8f8',\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: '22px',\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: '5000px',\n opacity: 1,\n },\n contentCollapsed: {\n maxHeight: '0px',\n opacity: 0,\n },\n contentInner: {\n // Content area styling - children go here\n },\n};\n\n/**\n * SectionHeadingInteractive component - Arbor Design System\n *\n * A collapsible section heading component that can contain sub-sections,\n * list rows, and other content. Click the header to expand/collapse.\n * Uses h2 heading style (22px) for main section level.\n *\n * @example\n * ```tsx\n * // Basic collapsible section\n * <SectionHeadingInteractive title=\"Personal Information\">\n * <SubSectionInteractive title=\"Contact Details\">\n * <ListRow label=\"Email\" value=\"john@example.com\" />\n * </SubSectionInteractive>\n * </SectionHeadingInteractive>\n *\n * // Initially collapsed\n * <SectionHeadingInteractive title=\"Additional Settings\" defaultExpanded={false}>\n * <ListRow label=\"Theme\" value=\"Dark\" />\n * </SectionHeadingInteractive>\n *\n * // Controlled mode\n * <SectionHeadingInteractive\n * title=\"Account\"\n * expanded={isExpanded}\n * onExpandedChange={setIsExpanded}\n * >\n * <ListRow label=\"Status\" value=\"Active\" />\n * </SectionHeadingInteractive>\n * ```\n */\nexport const SectionHeadingInteractive = React.forwardRef<HTMLDivElement, SectionHeadingInteractiveProps>(\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 headerContainerStyle: React.CSSProperties = isExpanded\n ? sectionHeadingInteractiveStyles.headerContainerExpanded\n : sectionHeadingInteractiveStyles.headerContainerCollapsed;\n\n const headerContentStyle: React.CSSProperties = {\n ...sectionHeadingInteractiveStyles.headerContent,\n ...(isHovered && sectionHeadingInteractiveStyles.headerContentHover),\n ...(isFocused && sectionHeadingInteractiveStyles.headerContentFocus),\n };\n\n const contentStyle: React.CSSProperties = {\n ...sectionHeadingInteractiveStyles.content,\n ...(isExpanded\n ? sectionHeadingInteractiveStyles.contentExpanded\n : sectionHeadingInteractiveStyles.contentCollapsed),\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-section-heading-interactive', className)}\n style={{ ...sectionHeadingInteractiveStyles.container, ...style }}\n {...props}\n >\n <div style={headerContainerStyle}>\n <button\n type=\"button\"\n style={sectionHeadingInteractiveStyles.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 <h2 style={sectionHeadingInteractiveStyles.title}>{title}</h2>\n <span style={sectionHeadingInteractiveStyles.iconWrapper}>\n <ChevronIcon expanded={isExpanded} />\n </span>\n </div>\n </button>\n </div>\n <div style={contentStyle} aria-hidden={!isExpanded}>\n {children && (\n <div style={sectionHeadingInteractiveStyles.contentInner}>{children}</div>\n )}\n </div>\n </div>\n );\n }\n);\n\nSectionHeadingInteractive.displayName = 'SectionHeadingInteractive';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AA+CjB,cAwMQ,YAxMR;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,mBAAmB;AAAA,MACzC,YAAY;AAAA,IACd;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,GAAE;AAAA,QACF,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA;AAAA,IACjB;AAAA;AACF;AAIF,IAAM,kCAAkC;AAAA,EACtC,WAAW;AAAA,IACT,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AAAA;AAAA,EAEA,0BAA0B;AAAA,IACxB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA;AAAA,EAEA,yBAAyB;AAAA,IACvB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,cAAc;AAAA,EAChB;AAAA,EACA,eAAe;AAAA,IACb,SAAS;AAAA,IACT,YAAY;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E;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,0BAA0B,cAAc;","names":[]}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// src/SubSectionInteractive/SubSectionInteractive.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var ChevronIcon = ({ expanded }) => /* @__PURE__ */ jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
width: "16",
|
|
9
|
+
height: "16",
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
style: {
|
|
14
|
+
transform: expanded ? "rotate(0deg)" : "rotate(180deg)",
|
|
15
|
+
transition: "transform 0.2s ease-in-out"
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ jsx(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "M4 6L8 10L12 6",
|
|
21
|
+
stroke: "#2f2f2f",
|
|
22
|
+
strokeWidth: "1.2",
|
|
23
|
+
strokeLinecap: "round",
|
|
24
|
+
strokeLinejoin: "round"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var subSectionInteractiveStyles = {
|
|
30
|
+
container: {
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
width: "100%",
|
|
34
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
35
|
+
boxSizing: "border-box"
|
|
36
|
+
},
|
|
37
|
+
header: {
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
width: "100%",
|
|
41
|
+
cursor: "pointer",
|
|
42
|
+
border: "none",
|
|
43
|
+
background: "transparent",
|
|
44
|
+
padding: 0,
|
|
45
|
+
margin: 0,
|
|
46
|
+
textAlign: "left",
|
|
47
|
+
outline: "none"
|
|
48
|
+
},
|
|
49
|
+
headerContent: {
|
|
50
|
+
display: "flex",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
justifyContent: "space-between",
|
|
53
|
+
width: "100%",
|
|
54
|
+
padding: "12px 8px",
|
|
55
|
+
borderRadius: "8px",
|
|
56
|
+
transition: "background-color 0.15s ease-in-out",
|
|
57
|
+
minHeight: "16px",
|
|
58
|
+
gap: "12px"
|
|
59
|
+
},
|
|
60
|
+
headerContentHover: {
|
|
61
|
+
backgroundColor: "#f8f8f8"
|
|
62
|
+
},
|
|
63
|
+
headerContentFocus: {
|
|
64
|
+
outline: "3px solid #3cad51",
|
|
65
|
+
outlineOffset: "-3px"
|
|
66
|
+
},
|
|
67
|
+
title: {
|
|
68
|
+
fontSize: "18px",
|
|
69
|
+
fontWeight: "600",
|
|
70
|
+
color: "#2f2f2f",
|
|
71
|
+
lineHeight: "1.25",
|
|
72
|
+
margin: 0,
|
|
73
|
+
flex: 1,
|
|
74
|
+
whiteSpace: "nowrap"
|
|
75
|
+
},
|
|
76
|
+
iconWrapper: {
|
|
77
|
+
display: "flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
width: "16px",
|
|
81
|
+
height: "16px",
|
|
82
|
+
flexShrink: 0
|
|
83
|
+
},
|
|
84
|
+
content: {
|
|
85
|
+
overflow: "hidden",
|
|
86
|
+
transition: "max-height 0.3s ease-in-out, opacity 0.2s ease-in-out"
|
|
87
|
+
},
|
|
88
|
+
contentExpanded: {
|
|
89
|
+
maxHeight: "2000px",
|
|
90
|
+
opacity: 1
|
|
91
|
+
},
|
|
92
|
+
contentCollapsed: {
|
|
93
|
+
maxHeight: "0px",
|
|
94
|
+
opacity: 0
|
|
95
|
+
},
|
|
96
|
+
contentInner: {
|
|
97
|
+
borderBottom: "1px solid #f8f8f8"
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var SubSectionInteractive = React.forwardRef(
|
|
101
|
+
({
|
|
102
|
+
title,
|
|
103
|
+
children,
|
|
104
|
+
expanded: controlledExpanded,
|
|
105
|
+
defaultExpanded = true,
|
|
106
|
+
onExpandedChange,
|
|
107
|
+
className,
|
|
108
|
+
style,
|
|
109
|
+
...props
|
|
110
|
+
}, ref) => {
|
|
111
|
+
const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded);
|
|
112
|
+
const isControlled = controlledExpanded !== void 0;
|
|
113
|
+
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
114
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
115
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
116
|
+
const handleToggle = () => {
|
|
117
|
+
const newExpanded = !isExpanded;
|
|
118
|
+
if (!isControlled) {
|
|
119
|
+
setInternalExpanded(newExpanded);
|
|
120
|
+
}
|
|
121
|
+
onExpandedChange?.(newExpanded);
|
|
122
|
+
};
|
|
123
|
+
const handleKeyDown = (event) => {
|
|
124
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
handleToggle();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const headerContentStyle = {
|
|
130
|
+
...subSectionInteractiveStyles.headerContent,
|
|
131
|
+
...isHovered && subSectionInteractiveStyles.headerContentHover,
|
|
132
|
+
...isFocused && subSectionInteractiveStyles.headerContentFocus
|
|
133
|
+
};
|
|
134
|
+
const contentStyle = {
|
|
135
|
+
...subSectionInteractiveStyles.content,
|
|
136
|
+
...isExpanded ? subSectionInteractiveStyles.contentExpanded : subSectionInteractiveStyles.contentCollapsed
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ jsxs(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
ref,
|
|
142
|
+
className: clsx("arbor-sub-section-interactive", className),
|
|
143
|
+
style: { ...subSectionInteractiveStyles.container, ...style },
|
|
144
|
+
...props,
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
"button",
|
|
148
|
+
{
|
|
149
|
+
type: "button",
|
|
150
|
+
style: subSectionInteractiveStyles.header,
|
|
151
|
+
onClick: handleToggle,
|
|
152
|
+
onMouseEnter: () => setIsHovered(true),
|
|
153
|
+
onMouseLeave: () => setIsHovered(false),
|
|
154
|
+
onFocus: () => setIsFocused(true),
|
|
155
|
+
onBlur: () => setIsFocused(false),
|
|
156
|
+
onKeyDown: handleKeyDown,
|
|
157
|
+
"aria-expanded": isExpanded,
|
|
158
|
+
children: /* @__PURE__ */ jsxs("div", { style: headerContentStyle, children: [
|
|
159
|
+
/* @__PURE__ */ jsx("h3", { style: subSectionInteractiveStyles.title, children: title }),
|
|
160
|
+
/* @__PURE__ */ jsx("span", { style: subSectionInteractiveStyles.iconWrapper, children: /* @__PURE__ */ jsx(ChevronIcon, { expanded: isExpanded }) })
|
|
161
|
+
] })
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsx("div", { style: contentStyle, "aria-hidden": !isExpanded, children: children && /* @__PURE__ */ jsx("div", { style: subSectionInteractiveStyles.contentInner, children }) })
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
SubSectionInteractive.displayName = "SubSectionInteractive";
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
SubSectionInteractive
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=chunk-X2CW5GF3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SubSectionInteractive/SubSectionInteractive.tsx"],"sourcesContent":["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,YAAY,WAAW;AACvB,SAAS,YAAY;AA+CjB,cAoLM,YApLN;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;AAAA,MAAC;AAAA;AAAA,QACC,GAAE;AAAA,QACF,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe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,MAAM,aAAa,KAAK;AAAA,cAChC,WAAW;AAAA,cACX,iBAAe;AAAA,cAEf,+BAAC,SAAI,OAAO,oBACV;AAAA,oCAAC,QAAG,OAAO,4BAA4B,OAAQ,iBAAM;AAAA,gBACrD,oBAAC,UAAK,OAAO,4BAA4B,aACvC,8BAAC,eAAY,UAAU,YAAY,GACrC;AAAA,iBACF;AAAA;AAAA,UACF;AAAA,UACA,oBAAC,SAAI,OAAO,cAAc,eAAa,CAAC,YACrC,sBACC,oBAAC,SAAI,OAAO,4BAA4B,cAAe,UAAS,GAEpE;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,sBAAsB,cAAc;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/Section/Section.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var sectionStyles = {
|
|
6
|
+
container: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
width: "100%",
|
|
10
|
+
padding: "8px",
|
|
11
|
+
borderRadius: "8px",
|
|
12
|
+
backgroundColor: "#ffffff",
|
|
13
|
+
boxSizing: "border-box",
|
|
14
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var Section = React.forwardRef(
|
|
18
|
+
({ children, className, style, ...props }, ref) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: clsx("arbor-section", className),
|
|
24
|
+
style: { ...sectionStyles.container, ...style },
|
|
25
|
+
...props,
|
|
26
|
+
children
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
Section.displayName = "Section";
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Section
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-YJ36ZZJQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Section/Section.tsx"],"sourcesContent":["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,YAAY,WAAW;AACvB,SAAS,YAAY;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,WAAW,KAAK,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/index.d.mts
CHANGED
|
@@ -21,12 +21,25 @@ export { Avatar, AvatarProps, AvatarSize } from './Avatar.mjs';
|
|
|
21
21
|
export { SearchGlobal, SearchGlobalProps } from './SearchGlobal.mjs';
|
|
22
22
|
export { SearchOnPage, SearchOnPageProps } from './SearchOnPage.mjs';
|
|
23
23
|
export { BreadcrumbItem, Breadcrumbs, BreadcrumbsProps } from './Breadcrumbs.mjs';
|
|
24
|
+
export { Logo, LogoProps } from './Logo.mjs';
|
|
25
|
+
export { ButtonSegmented, ButtonSegmentedItem, ButtonSegmentedProps } from './ButtonSegmented.mjs';
|
|
26
|
+
export { SectionHeading, SectionHeadingButton, SectionHeadingButtonGroupItem, SectionHeadingProps } from './SectionHeading.mjs';
|
|
27
|
+
export { SectionIcon, SectionIconProps, SectionIconVariant } from './SectionIcon.mjs';
|
|
28
|
+
export { ListRow, ListRowProps } from './ListRow.mjs';
|
|
29
|
+
export { ListRowMultiLine, ListRowMultiLineProps } from './ListRowMultiLine.mjs';
|
|
30
|
+
export { SubSectionHeading, SubSectionHeadingProps } from './SubSectionHeading.mjs';
|
|
31
|
+
export { SubSectionInteractive, SubSectionInteractiveProps } from './SubSectionInteractive.mjs';
|
|
32
|
+
export { SectionHeadingInteractive, SectionHeadingInteractiveProps } from './SectionHeadingInteractive.mjs';
|
|
33
|
+
export { Section, SectionProps } from './Section.mjs';
|
|
34
|
+
export { ModalHeader, ModalHeaderProps } from './ModalHeader.mjs';
|
|
35
|
+
export { ModalFooter, ModalFooterProps } from './ModalFooter.mjs';
|
|
36
|
+
export { Modal, ModalContent, ModalContentProps, ModalProps } from './Modal.mjs';
|
|
24
37
|
import 'react';
|
|
25
38
|
|
|
26
39
|
/**
|
|
27
40
|
* Shared TypeScript types for Arbor Design System components
|
|
28
41
|
*/
|
|
29
|
-
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';
|
|
42
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';
|
|
30
43
|
type ButtonSize = 'small' | 'medium';
|
|
31
44
|
type InputSize = 'small' | 'medium';
|
|
32
45
|
type ValidationState = 'default' | 'error' | 'success';
|
package/dist/index.d.ts
CHANGED
|
@@ -21,12 +21,25 @@ export { Avatar, AvatarProps, AvatarSize } from './Avatar.js';
|
|
|
21
21
|
export { SearchGlobal, SearchGlobalProps } from './SearchGlobal.js';
|
|
22
22
|
export { SearchOnPage, SearchOnPageProps } from './SearchOnPage.js';
|
|
23
23
|
export { BreadcrumbItem, Breadcrumbs, BreadcrumbsProps } from './Breadcrumbs.js';
|
|
24
|
+
export { Logo, LogoProps } from './Logo.js';
|
|
25
|
+
export { ButtonSegmented, ButtonSegmentedItem, ButtonSegmentedProps } from './ButtonSegmented.js';
|
|
26
|
+
export { SectionHeading, SectionHeadingButton, SectionHeadingButtonGroupItem, SectionHeadingProps } from './SectionHeading.js';
|
|
27
|
+
export { SectionIcon, SectionIconProps, SectionIconVariant } from './SectionIcon.js';
|
|
28
|
+
export { ListRow, ListRowProps } from './ListRow.js';
|
|
29
|
+
export { ListRowMultiLine, ListRowMultiLineProps } from './ListRowMultiLine.js';
|
|
30
|
+
export { SubSectionHeading, SubSectionHeadingProps } from './SubSectionHeading.js';
|
|
31
|
+
export { SubSectionInteractive, SubSectionInteractiveProps } from './SubSectionInteractive.js';
|
|
32
|
+
export { SectionHeadingInteractive, SectionHeadingInteractiveProps } from './SectionHeadingInteractive.js';
|
|
33
|
+
export { Section, SectionProps } from './Section.js';
|
|
34
|
+
export { ModalHeader, ModalHeaderProps } from './ModalHeader.js';
|
|
35
|
+
export { ModalFooter, ModalFooterProps } from './ModalFooter.js';
|
|
36
|
+
export { Modal, ModalContent, ModalContentProps, ModalProps } from './Modal.js';
|
|
24
37
|
import 'react';
|
|
25
38
|
|
|
26
39
|
/**
|
|
27
40
|
* Shared TypeScript types for Arbor Design System components
|
|
28
41
|
*/
|
|
29
|
-
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';
|
|
42
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';
|
|
30
43
|
type ButtonSize = 'small' | 'medium';
|
|
31
44
|
type InputSize = 'small' | 'medium';
|
|
32
45
|
type ValidationState = 'default' | 'error' | 'success';
|