@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,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 {renderIcon()}\n </div>\n </div>\n );\n }\n);\n\nSectionIcon.displayName = 'SectionIcon';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAsBnB,SACE,KADF;AADF,IAAM,cAAc,CAAC,EAAE,MAAM,MAC3B,qBAAC,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,oBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,QAAO,MAAM,OAAO;AAAA,GAC9C;AAIF,IAAM,WAAW,CAAC,EAAE,MAAM,MACxB,qBAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE;AAAA,sBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,KAAI,QAAQ,OAAO,aAAY,OAAM,MAAK,QAAO;AAAA,EACzE,oBAAC,UAAK,GAAE,WAAU,QAAQ,OAAO,aA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AC/C,KAAK;AACH,iBAAO,oBAAC,eAAY,OAAO,OAAO,WAAW;AAAA,QAC/C,KAAK;AAAA,QACL;AACE,iBAAO,oBAAC,YAAS,OAAO,OAAO,WAAW;AAAA,MAC9C;AAAA,IACF;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,KAAK,sBAAsB,SAAS;AAAA,QAC/C,OAAO;AAAA,UACL,GAAG,kBAAkB;AAAA,UACrB,iBAAiB,OAAO;AAAA,UACxB,GAAG;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QAEJ,8BAAC,SAAI,OAAO,kBAAkB,aAC3B,qBAAW,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SubSectionHeading/SubSectionHeading.tsx"],"sourcesContent":["import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface SubSectionHeadingProps {\n /**\n * The heading text (required)\n */\n title: string;\n /**\n * Show an info icon next to the heading text\n * @default false\n */\n icon?: boolean;\n /**\n * Button variant to display on the right\n * - 'primary': Green button with white text\n * - 'tertiary': Gray button with dark text\n * - undefined: No button\n */\n button?: 'primary' | 'tertiary';\n /**\n * Text to display in the button (required if button is specified)\n */\n buttonText?: string;\n /**\n * Icon to display in the button (renders before button text)\n */\n buttonIcon?: React.ReactNode;\n /**\n * Click handler for the button\n */\n onButtonClick?: () => void;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Info icon (circle with i)\nconst InfoIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" stroke=\"#2f2f2f\" strokeWidth=\"1.2\" />\n <path\n d=\"M8 7V11\"\n stroke=\"#2f2f2f\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n />\n <circle cx=\"8\" cy=\"5\" r=\"0.75\" fill=\"#2f2f2f\" />\n </svg>\n);\n\n// Default plus icon for buttons\nconst PlusIcon = ({ color = '#2f2f2f' }: { color?: string }) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8 3V13M3 8H13\"\n stroke={color}\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n// Arbor Design System sub-section heading styles\nconst subSectionHeadingStyles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n borderBottom: '1px solid #efefef',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n boxSizing: 'border-box' as const,\n },\n containerNoButton: {\n padding: '12px 8px',\n gap: '0px',\n },\n containerWithButton: {\n padding: '8px',\n gap: '12px',\n justifyContent: 'space-between',\n },\n textContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n flex: 1,\n minHeight: '16px',\n },\n title: {\n fontSize: '18px',\n fontWeight: '600',\n color: '#2f2f2f',\n lineHeight: '1.25',\n margin: 0,\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 buttonBase: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8px',\n height: '32px',\n minHeight: '32px',\n padding: '0 16px',\n borderRadius: '99px',\n border: 'none',\n cursor: 'pointer',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontSize: '13px',\n fontWeight: '600',\n lineHeight: '1.5',\n whiteSpace: 'nowrap' as const,\n flexShrink: 0,\n transition: 'background-color 0.15s ease-in-out, opacity 0.15s ease-in-out',\n },\n buttonPrimary: {\n backgroundColor: '#0e8a0e',\n color: '#ffffff',\n },\n buttonPrimaryHover: {\n backgroundColor: '#0a6b0a',\n },\n buttonTertiary: {\n backgroundColor: '#efefef',\n color: '#2f2f2f',\n },\n buttonTertiaryHover: {\n backgroundColor: '#e5e5e5',\n },\n buttonIconWrapper: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n flexShrink: 0,\n },\n};\n\n/**\n * SubSectionHeading component - Arbor Design System\n *\n * A sub-section heading component for dividing content within sections.\n * Supports optional icon next to text and optional button on the right.\n *\n * @example\n * ```tsx\n * // Basic sub-section heading\n * <SubSectionHeading title=\"Details\" />\n *\n * // With info icon\n * <SubSectionHeading title=\"Details\" icon />\n *\n * // With primary button\n * <SubSectionHeading\n * title=\"Items\"\n * button=\"primary\"\n * buttonText=\"Add Item\"\n * onButtonClick={() => handleAdd()}\n * />\n *\n * // With tertiary button and icon\n * <SubSectionHeading\n * title=\"Settings\"\n * icon\n * button=\"tertiary\"\n * buttonText=\"Configure\"\n * onButtonClick={() => handleConfigure()}\n * />\n * ```\n */\nexport const SubSectionHeading = React.forwardRef<HTMLDivElement, SubSectionHeadingProps>(\n (\n {\n title,\n icon = false,\n button,\n buttonText = 'Button Text',\n buttonIcon,\n onButtonClick,\n className,\n style,\n ...props\n },\n ref\n ) => {\n const [isButtonHovered, setIsButtonHovered] = React.useState(false);\n\n const containerStyle: React.CSSProperties = {\n ...subSectionHeadingStyles.container,\n ...(button\n ? subSectionHeadingStyles.containerWithButton\n : subSectionHeadingStyles.containerNoButton),\n ...style,\n };\n\n const getButtonStyle = (): React.CSSProperties => {\n const baseStyle = { ...subSectionHeadingStyles.buttonBase };\n\n if (button === 'primary') {\n return {\n ...baseStyle,\n ...subSectionHeadingStyles.buttonPrimary,\n ...(isButtonHovered && subSectionHeadingStyles.buttonPrimaryHover),\n };\n }\n\n if (button === 'tertiary') {\n return {\n ...baseStyle,\n ...subSectionHeadingStyles.buttonTertiary,\n ...(isButtonHovered && subSectionHeadingStyles.buttonTertiaryHover),\n };\n }\n\n return baseStyle;\n };\n\n const renderButtonIcon = () => {\n if (buttonIcon) {\n return (\n <span style={subSectionHeadingStyles.buttonIconWrapper}>{buttonIcon}</span>\n );\n }\n // Default icon based on button type\n return (\n <span style={subSectionHeadingStyles.buttonIconWrapper}>\n <PlusIcon color={button === 'primary' ? '#ffffff' : '#2f2f2f'} />\n </span>\n );\n };\n\n return (\n <div\n ref={ref}\n className={clsx('arbor-sub-section-heading', className)}\n style={containerStyle}\n {...props}\n >\n <div style={subSectionHeadingStyles.textContainer}>\n <h3 style={subSectionHeadingStyles.title}>{title}</h3>\n {icon && (\n <span style={subSectionHeadingStyles.iconWrapper}>\n <InfoIcon />\n </span>\n )}\n </div>\n {button && (\n <button\n type=\"button\"\n style={getButtonStyle()}\n onClick={onButtonClick}\n onMouseEnter={() => setIsButtonHovered(true)}\n onMouseLeave={() => setIsButtonHovered(false)}\n >\n {renderButtonIcon()}\n <span>{buttonText}</span>\n </button>\n )}\n </div>\n );\n }\n);\n\nSubSectionHeading.displayName = 'SubSectionHeading';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AA2CnB,SACE,KADF;AADF,IAAM,WAAW,MACf,qBAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE;AAAA,sBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM,QAAO,WAAU,aAAY,OAAM;AAAA,EACjE;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eA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IACT;AAEA,UAAM,mBAAmB,MAAM;AAC7B,UAAI,YAAY;AACd,eACE,oBAAC,UAAK,OAAO,wBAAwB,mBAAoB,sBAAW;AAAA,MAExE;AAEA,aACE,oBAAC,UAAK,OAAO,wBAAwB,mBACnC,8BAAC,YAAS,OAAO,WAAW,YAAY,YAAY,WAAW,GACjE;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,KAAK,6BAA6B,SAAS;AAAA,QACtD,OAAO;AAAA,QACN,GAAG;AAAA,QAEJ;AAAA,+BAAC,SAAI,OAAO,wBAAwB,eAClC;AAAA,gCAAC,QAAG,OAAO,wBAAwB,OAAQ,iBAAM;AAAA,YAChD,QACC,oBAAC,UAAK,OAAO,wBAAwB,aACnC,8BAAC,YAAS,GACZ;AAAA,aAEJ;AAAA,UACC,UACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAO,eAAe;AAAA,cACtB,SAAS;AAAA,cACT,cAAc,MAAM,mBAAmB,IAAI;AAAA,cAC3C,cAAc,MAAM,mBAAmB,KAAK;AAAA,cAE3C;AAAA,iCAAiB;AAAA,gBAClB,oBAAC,UAAM,sBAAW;AAAA;AAAA;AAAA,UACpB;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;","names":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/SearchOnPage/SearchOnPage.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Search, X } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var SearchOnPage = React.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
value = "",
|
|
8
|
+
onChange,
|
|
9
|
+
onSubmit,
|
|
10
|
+
onClear,
|
|
11
|
+
placeholder = "Search Reports",
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
"data-testid": dataTestId
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
17
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
18
|
+
const inputRef = React.useRef(null);
|
|
19
|
+
React.useImperativeHandle(ref, () => inputRef.current);
|
|
20
|
+
const handleFocus = () => {
|
|
21
|
+
setIsFocused(true);
|
|
22
|
+
};
|
|
23
|
+
const handleBlur = () => {
|
|
24
|
+
setIsFocused(false);
|
|
25
|
+
};
|
|
26
|
+
const handleChange = (e) => {
|
|
27
|
+
onChange?.(e.target.value);
|
|
28
|
+
};
|
|
29
|
+
const handleKeyDown = (e) => {
|
|
30
|
+
if (e.key === "Enter") {
|
|
31
|
+
onSubmit?.(value);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const handleClear = () => {
|
|
35
|
+
onChange?.("");
|
|
36
|
+
onClear?.();
|
|
37
|
+
inputRef.current?.focus();
|
|
38
|
+
};
|
|
39
|
+
const containerStyles = {
|
|
40
|
+
position: "relative",
|
|
41
|
+
width: "200px",
|
|
42
|
+
height: "32px",
|
|
43
|
+
backgroundColor: isFocused ? "#ffffff" : isHovered ? "#efefef" : "#ffffff",
|
|
44
|
+
borderRadius: "16px",
|
|
45
|
+
padding: "8px 16px",
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
gap: "8px",
|
|
49
|
+
cursor: "text",
|
|
50
|
+
transition: "all 0.2s ease-in-out",
|
|
51
|
+
boxSizing: "border-box",
|
|
52
|
+
border: isFocused ? "1px solid #efefef" : "none",
|
|
53
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
54
|
+
...style
|
|
55
|
+
};
|
|
56
|
+
const iconContainerStyles = {
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "center",
|
|
60
|
+
flexShrink: 0,
|
|
61
|
+
padding: "2px"
|
|
62
|
+
};
|
|
63
|
+
const inputStyles = {
|
|
64
|
+
border: "none",
|
|
65
|
+
outline: "none",
|
|
66
|
+
backgroundColor: "transparent",
|
|
67
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
68
|
+
fontSize: "13px",
|
|
69
|
+
fontWeight: 400,
|
|
70
|
+
color: "#2f2f2f",
|
|
71
|
+
lineHeight: "1.5",
|
|
72
|
+
flex: 1,
|
|
73
|
+
width: "100%",
|
|
74
|
+
minWidth: 0
|
|
75
|
+
};
|
|
76
|
+
const clearButtonStyles = {
|
|
77
|
+
display: "flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
flexShrink: 0,
|
|
81
|
+
width: "16px",
|
|
82
|
+
height: "16px",
|
|
83
|
+
cursor: "pointer",
|
|
84
|
+
border: "none",
|
|
85
|
+
background: "none",
|
|
86
|
+
padding: 0
|
|
87
|
+
};
|
|
88
|
+
const showClearButton = isFocused && value.length > 0;
|
|
89
|
+
const iconColor = isFocused || isHovered ? "#2f2f2f" : "#595959";
|
|
90
|
+
return /* @__PURE__ */ jsxs(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className,
|
|
94
|
+
style: containerStyles,
|
|
95
|
+
onMouseEnter: () => setIsHovered(true),
|
|
96
|
+
onMouseLeave: () => setIsHovered(false),
|
|
97
|
+
onClick: () => inputRef.current?.focus(),
|
|
98
|
+
"data-testid": dataTestId,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ jsx("div", { style: iconContainerStyles, children: /* @__PURE__ */ jsx(Search, { size: 12, color: iconColor, strokeWidth: 2 }) }),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
"input",
|
|
103
|
+
{
|
|
104
|
+
ref: inputRef,
|
|
105
|
+
type: "text",
|
|
106
|
+
value,
|
|
107
|
+
onChange: handleChange,
|
|
108
|
+
onFocus: handleFocus,
|
|
109
|
+
onBlur: handleBlur,
|
|
110
|
+
onKeyDown: handleKeyDown,
|
|
111
|
+
placeholder: isFocused ? "" : placeholder,
|
|
112
|
+
style: inputStyles
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
showClearButton && /* @__PURE__ */ jsx(
|
|
116
|
+
"button",
|
|
117
|
+
{
|
|
118
|
+
type: "button",
|
|
119
|
+
onClick: handleClear,
|
|
120
|
+
style: clearButtonStyles,
|
|
121
|
+
"aria-label": "Clear search",
|
|
122
|
+
children: /* @__PURE__ */ jsx(X, { size: 13.333, color: "#2f2f2f", strokeWidth: 2 })
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
SearchOnPage.displayName = "SearchOnPage";
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
SearchOnPage
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=chunk-B7RX3TPX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SearchOnPage/SearchOnPage.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Search, X } from 'lucide-react';\n\nexport interface SearchOnPageProps {\n /**\n * Value of the search input\n */\n value?: string;\n /**\n * Callback when value changes\n */\n onChange?: (value: string) => void;\n /**\n * Callback when search is submitted\n */\n onSubmit?: (value: string) => void;\n /**\n * Callback when clear button is clicked\n */\n onClear?: () => void;\n /**\n * Placeholder text\n */\n placeholder?: string;\n /**\n * Custom className\n */\n className?: string;\n /**\n * Custom style\n */\n style?: React.CSSProperties;\n /**\n * Test ID for testing\n */\n 'data-testid'?: string;\n}\n\n/**\n * SearchOnPage component - Arbor Design System\n *\n * A search input with fixed 200px width for filtering content on the current page.\n * Shows green focus ring when active and X button to clear.\n */\nexport const SearchOnPage = React.forwardRef<HTMLInputElement, SearchOnPageProps>(\n (\n {\n value = '',\n onChange,\n onSubmit,\n onClear,\n placeholder = 'Search Reports',\n className,\n style,\n 'data-testid': dataTestId,\n },\n ref\n ) => {\n const [isFocused, setIsFocused] = React.useState(false);\n const [isHovered, setIsHovered] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // Merge refs\n React.useImperativeHandle(ref, () => inputRef.current as HTMLInputElement);\n\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n onSubmit?.(value);\n }\n };\n\n const handleClear = () => {\n onChange?.('');\n onClear?.();\n inputRef.current?.focus();\n };\n\n const containerStyles: React.CSSProperties = {\n position: 'relative',\n width: '200px',\n height: '32px',\n backgroundColor: isFocused ? '#ffffff' : isHovered ? '#efefef' : '#ffffff',\n borderRadius: '16px',\n padding: '8px 16px',\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n cursor: 'text',\n transition: 'all 0.2s ease-in-out',\n boxSizing: 'border-box',\n border: isFocused ? '1px solid #efefef' : 'none',\n boxShadow: isFocused ? '0px 0px 0px 3px #3cad51' : 'none',\n ...style,\n };\n\n const iconContainerStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n padding: '2px',\n };\n\n const inputStyles: React.CSSProperties = {\n border: 'none',\n outline: 'none',\n backgroundColor: 'transparent',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontSize: '13px',\n fontWeight: 400,\n color: '#2f2f2f',\n lineHeight: '1.5',\n flex: 1,\n width: '100%',\n minWidth: 0,\n };\n\n const clearButtonStyles: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n width: '16px',\n height: '16px',\n cursor: 'pointer',\n border: 'none',\n background: 'none',\n padding: 0,\n };\n\n const showClearButton = isFocused && value.length > 0;\n const iconColor = isFocused || isHovered ? '#2f2f2f' : '#595959';\n\n return (\n <div\n className={className}\n style={containerStyles}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onClick={() => inputRef.current?.focus()}\n data-testid={dataTestId}\n >\n <div style={iconContainerStyles}>\n <Search size={12} color={iconColor} strokeWidth={2} />\n </div>\n\n <input\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n placeholder={isFocused ? '' : placeholder}\n style={inputStyles}\n />\n\n {showClearButton && (\n <button\n type=\"button\"\n onClick={handleClear}\n style={clearButtonStyles}\n aria-label=\"Clear search\"\n >\n <X size={13.333} color=\"#2f2f2f\" strokeWidth={2} />\n </button>\n )}\n </div>\n );\n }\n);\n\nSearchOnPage.displayName = 'SearchOnPage';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,QAAQ,SAAS;AAiJpB,SASI,KATJ;AAtGC,IAAM,eAAqB;AAAA,EAChC,CACE;AAAA,IACE,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,eAAe;AAAA,EACjB,GACA,QACG;AACH,UAAM,CAAC,WAAW,YAAY,IAAU,eAAS,KAAK;AACtD,UAAM,CAAC,WAAW,YAAY,IAAU,eAAS,KAAK;AACtD,UAAM,WAAiB,aAAyB,IAAI;AAGpD,IAAM,0BAAoB,KAAK,MAAM,SAAS,OAA2B;AAEzE,UAAM,cAAc,MAAM;AACxB,mBAAa,IAAI;AAAA,IACnB;AAEA,UAAM,aAAa,MAAM;AACvB,mBAAa,KAAK;AAAA,IACpB;AAEA,UAAM,eAAe,CAAC,MAA2C;AAC/D,iBAAW,EAAE,OAAO,KAAK;AAAA,IAC3B;AAEA,UAAM,gBAAgB,CAAC,MAA6C;AAClE,UAAI,EAAE,QAAQ,SAAS;AACrB,mBAAW,KAAK;AAAA,MAClB;AAAA,I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MAAM,SAAS,SAAS,MAAM;AAAA,QACvC,eAAa;AAAA,QAEb;AAAA,8BAAC,SAAI,OAAO,qBACV,8BAAC,UAAO,MAAM,IAAI,OAAO,WAAW,aAAa,GAAG,GACtD;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL,MAAK;AAAA,cACL;AAAA,cACA,UAAU;AAAA,cACV,SAAS;AAAA,cACT,QAAQ;AAAA,cACR,WAAW;AAAA,cACX,aAAa,YAAY,KAAK;AAAA,cAC9B,OAAO;AAAA;AAAA,UACT;AAAA,UAEC,mBACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS;AAAA,cACT,OAAO;AAAA,cACP,cAAW;AAAA,cAEX,8BAAC,KAAE,MAAM,QAAQ,OAAM,WAAU,aAAa,GAAG;AAAA;AAAA,UACnD;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// src/ListRow/ListRow.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var CaretIcon = ({ isHovered }) => {
|
|
6
|
+
if (isHovered) {
|
|
7
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
8
|
+
"path",
|
|
9
|
+
{
|
|
10
|
+
d: "M6 4L10 8L6 12",
|
|
11
|
+
stroke: "#2f2f2f",
|
|
12
|
+
strokeWidth: "1.2",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round"
|
|
15
|
+
}
|
|
16
|
+
) });
|
|
17
|
+
}
|
|
18
|
+
return /* @__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: "M6 4L10 8L6 12",
|
|
22
|
+
stroke: "#b3b3b3",
|
|
23
|
+
strokeWidth: "1.2",
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round"
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
};
|
|
29
|
+
var listRowStyles = {
|
|
30
|
+
container: {
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
width: "100%",
|
|
34
|
+
borderBottom: "1px solid #f8f8f8",
|
|
35
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
36
|
+
boxSizing: "border-box",
|
|
37
|
+
borderRadius: "8px",
|
|
38
|
+
transition: "background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",
|
|
39
|
+
outline: "none"
|
|
40
|
+
},
|
|
41
|
+
containerHover: {
|
|
42
|
+
backgroundColor: "#f8f8f8"
|
|
43
|
+
},
|
|
44
|
+
containerFocus: {
|
|
45
|
+
outline: "3px solid #3cad51",
|
|
46
|
+
outlineOffset: "-3px"
|
|
47
|
+
},
|
|
48
|
+
containerClickable: {
|
|
49
|
+
cursor: "pointer"
|
|
50
|
+
},
|
|
51
|
+
content: {
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
justifyContent: "space-between",
|
|
55
|
+
width: "100%",
|
|
56
|
+
padding: "4px 8px",
|
|
57
|
+
minHeight: "28px"
|
|
58
|
+
},
|
|
59
|
+
label: {
|
|
60
|
+
fontSize: "13px",
|
|
61
|
+
fontWeight: "600",
|
|
62
|
+
color: "#2f2f2f",
|
|
63
|
+
lineHeight: "1.5",
|
|
64
|
+
width: "190px",
|
|
65
|
+
flexShrink: 0
|
|
66
|
+
},
|
|
67
|
+
valueContainer: {
|
|
68
|
+
flex: 1,
|
|
69
|
+
display: "flex",
|
|
70
|
+
alignItems: "center"
|
|
71
|
+
},
|
|
72
|
+
value: {
|
|
73
|
+
fontSize: "13px",
|
|
74
|
+
fontWeight: "400",
|
|
75
|
+
color: "#2f2f2f",
|
|
76
|
+
lineHeight: "1.5"
|
|
77
|
+
},
|
|
78
|
+
rightContainer: {
|
|
79
|
+
display: "flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "flex-end",
|
|
82
|
+
gap: "8px",
|
|
83
|
+
flexShrink: 0
|
|
84
|
+
},
|
|
85
|
+
note: {
|
|
86
|
+
fontSize: "13px",
|
|
87
|
+
fontWeight: "400",
|
|
88
|
+
fontStyle: "italic",
|
|
89
|
+
color: "#2f2f2f",
|
|
90
|
+
lineHeight: "1.5",
|
|
91
|
+
textAlign: "right"
|
|
92
|
+
},
|
|
93
|
+
iconWrapper: {
|
|
94
|
+
display: "flex",
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
justifyContent: "center",
|
|
97
|
+
width: "16px",
|
|
98
|
+
height: "16px",
|
|
99
|
+
flexShrink: 0
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var ListRow = React.forwardRef(
|
|
103
|
+
({ value, label, note, icon = false, onClick, className, style, ...props }, ref) => {
|
|
104
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
105
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
106
|
+
const showHoverState = icon && isHovered;
|
|
107
|
+
const isClickable = icon && onClick;
|
|
108
|
+
const containerStyle = {
|
|
109
|
+
...listRowStyles.container,
|
|
110
|
+
...showHoverState && listRowStyles.containerHover,
|
|
111
|
+
...isFocused && listRowStyles.containerFocus,
|
|
112
|
+
...isClickable && listRowStyles.containerClickable,
|
|
113
|
+
...style
|
|
114
|
+
};
|
|
115
|
+
const handleClick = () => {
|
|
116
|
+
if (isClickable && onClick) {
|
|
117
|
+
onClick();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const handleKeyDown = (event) => {
|
|
121
|
+
if (isClickable && (event.key === "Enter" || event.key === " ")) {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
onClick?.();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
ref,
|
|
130
|
+
className: clsx("arbor-list-row", className),
|
|
131
|
+
style: containerStyle,
|
|
132
|
+
onClick: handleClick,
|
|
133
|
+
onMouseEnter: () => icon && setIsHovered(true),
|
|
134
|
+
onMouseLeave: () => setIsHovered(false),
|
|
135
|
+
onFocus: () => setIsFocused(true),
|
|
136
|
+
onBlur: () => setIsFocused(false),
|
|
137
|
+
onKeyDown: handleKeyDown,
|
|
138
|
+
tabIndex: isClickable ? 0 : void 0,
|
|
139
|
+
role: isClickable ? "button" : void 0,
|
|
140
|
+
...props,
|
|
141
|
+
children: /* @__PURE__ */ jsxs("div", { style: listRowStyles.content, children: [
|
|
142
|
+
label && /* @__PURE__ */ jsx("div", { style: listRowStyles.label, children: label }),
|
|
143
|
+
/* @__PURE__ */ jsx("div", { style: listRowStyles.valueContainer, children: /* @__PURE__ */ jsx("span", { style: listRowStyles.value, children: value }) }),
|
|
144
|
+
/* @__PURE__ */ jsxs("div", { style: listRowStyles.rightContainer, children: [
|
|
145
|
+
note && /* @__PURE__ */ jsx("span", { style: listRowStyles.note, children: note }),
|
|
146
|
+
icon && /* @__PURE__ */ jsx("div", { style: listRowStyles.iconWrapper, children: /* @__PURE__ */ jsx(CaretIcon, { isHovered }) })
|
|
147
|
+
] })
|
|
148
|
+
] })
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
ListRow.displayName = "ListRow";
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
ListRow
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=chunk-F6JVEIWC.mjs.map
|