@pglevy/sailwind 0.1.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/README.md +219 -0
- package/dist/components/Button/ButtonArrayLayout.d.ts +37 -0
- package/dist/components/Button/ButtonArrayLayout.d.ts.map +1 -0
- package/dist/components/Button/ButtonArrayLayout.js +42 -0
- package/dist/components/Button/ButtonWidget.d.ts +75 -0
- package/dist/components/Button/ButtonWidget.d.ts.map +1 -0
- package/dist/components/Button/ButtonWidget.js +101 -0
- package/dist/components/Button/index.d.ts +5 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Card/CardLayout.d.ts +55 -0
- package/dist/components/Card/CardLayout.d.ts.map +1 -0
- package/dist/components/Card/CardLayout.js +139 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Checkbox/CheckboxField.d.ts +65 -0
- package/dist/components/Checkbox/CheckboxField.d.ts.map +1 -0
- package/dist/components/Checkbox/CheckboxField.js +136 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Dialog/DialogField.d.ts +51 -0
- package/dist/components/Dialog/DialogField.d.ts.map +1 -0
- package/dist/components/Dialog/DialogField.js +113 -0
- package/dist/components/Dialog/index.d.ts +3 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownField.d.ts +87 -0
- package/dist/components/Dropdown/DropdownField.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownField.js +7 -0
- package/dist/components/Dropdown/DropdownFieldBase.d.ts +54 -0
- package/dist/components/Dropdown/DropdownFieldBase.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownFieldBase.js +183 -0
- package/dist/components/Dropdown/MultipleDropdownField.d.ts +85 -0
- package/dist/components/Dropdown/MultipleDropdownField.d.ts.map +1 -0
- package/dist/components/Dropdown/MultipleDropdownField.js +7 -0
- package/dist/components/Dropdown/index.d.ts +5 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -0
- package/dist/components/Heading/HeadingField.d.ts +48 -0
- package/dist/components/Heading/HeadingField.d.ts.map +1 -0
- package/dist/components/Heading/HeadingField.js +103 -0
- package/dist/components/Heading/index.d.ts +3 -0
- package/dist/components/Heading/index.d.ts.map +1 -0
- package/dist/components/Image/DocumentImage.d.ts +20 -0
- package/dist/components/Image/DocumentImage.d.ts.map +1 -0
- package/dist/components/Image/ImageField.d.ts +42 -0
- package/dist/components/Image/ImageField.d.ts.map +1 -0
- package/dist/components/Image/ImageField.js +159 -0
- package/dist/components/Image/UserImage.d.ts +49 -0
- package/dist/components/Image/UserImage.d.ts.map +1 -0
- package/dist/components/Image/index.d.ts +5 -0
- package/dist/components/Image/index.d.ts.map +1 -0
- package/dist/components/MessageBanner/MessageBanner.d.ts +33 -0
- package/dist/components/MessageBanner/MessageBanner.d.ts.map +1 -0
- package/dist/components/MessageBanner/MessageBanner.js +97 -0
- package/dist/components/MessageBanner/index.d.ts +2 -0
- package/dist/components/MessageBanner/index.d.ts.map +1 -0
- package/dist/components/Milestone/MilestoneField.d.ts +50 -0
- package/dist/components/Milestone/MilestoneField.d.ts.map +1 -0
- package/dist/components/Milestone/MilestoneField.js +206 -0
- package/dist/components/Milestone/index.d.ts +3 -0
- package/dist/components/Milestone/index.d.ts.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +32 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.js +117 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/RadioButton/RadioButtonField.d.ts +63 -0
- package/dist/components/RadioButton/RadioButtonField.d.ts.map +1 -0
- package/dist/components/RadioButton/RadioButtonField.js +128 -0
- package/dist/components/RadioButton/index.d.ts +3 -0
- package/dist/components/RadioButton/index.d.ts.map +1 -0
- package/dist/components/RichText/Icon.d.ts +28 -0
- package/dist/components/RichText/Icon.d.ts.map +1 -0
- package/dist/components/RichText/Icon.js +94 -0
- package/dist/components/RichText/RichTextDisplayField.d.ts +36 -0
- package/dist/components/RichText/RichTextDisplayField.d.ts.map +1 -0
- package/dist/components/RichText/RichTextDisplayField.js +79 -0
- package/dist/components/RichText/TextItem.d.ts +27 -0
- package/dist/components/RichText/TextItem.d.ts.map +1 -0
- package/dist/components/RichText/TextItem.js +58 -0
- package/dist/components/RichText/index.d.ts +7 -0
- package/dist/components/RichText/index.d.ts.map +1 -0
- package/dist/components/Slider/SliderField.d.ts +63 -0
- package/dist/components/Slider/SliderField.d.ts.map +1 -0
- package/dist/components/Slider/SliderField.js +164 -0
- package/dist/components/Slider/index.d.ts +3 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Stamp/StampField.d.ts +48 -0
- package/dist/components/Stamp/StampField.d.ts.map +1 -0
- package/dist/components/Stamp/StampField.js +173 -0
- package/dist/components/Stamp/index.d.ts +3 -0
- package/dist/components/Stamp/index.d.ts.map +1 -0
- package/dist/components/Switch/SwitchField.d.ts +49 -0
- package/dist/components/Switch/SwitchField.d.ts.map +1 -0
- package/dist/components/Switch/SwitchField.js +106 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/TableOfContents.d.ts +2 -0
- package/dist/components/TableOfContents.d.ts.map +1 -0
- package/dist/components/TableOfContents.js +142 -0
- package/dist/components/Tabs/TabsField.d.ts +50 -0
- package/dist/components/Tabs/TabsField.d.ts.map +1 -0
- package/dist/components/Tabs/TabsField.js +96 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tag/TagField.d.ts +52 -0
- package/dist/components/Tag/TagField.d.ts.map +1 -0
- package/dist/components/Tag/TagField.js +125 -0
- package/dist/components/Tag/TagItem.d.ts +26 -0
- package/dist/components/Tag/TagItem.d.ts.map +1 -0
- package/dist/components/Tag/TagItem.js +4 -0
- package/dist/components/Tag/index.d.ts +5 -0
- package/dist/components/Tag/index.d.ts.map +1 -0
- package/dist/components/TextField/TextField.d.ts +88 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -0
- package/dist/components/TextField/TextField.js +113 -0
- package/dist/components/TextField/index.d.ts +3 -0
- package/dist/components/TextField/index.d.ts.map +1 -0
- package/dist/components/Toggle/ToggleField.d.ts +62 -0
- package/dist/components/Toggle/ToggleField.d.ts.map +1 -0
- package/dist/components/Toggle/ToggleField.js +126 -0
- package/dist/components/Toggle/index.d.ts +3 -0
- package/dist/components/Toggle/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/shared/CollapsibleSection.d.ts +9 -0
- package/dist/components/shared/CollapsibleSection.d.ts.map +1 -0
- package/dist/components/shared/CollapsibleSection.js +39 -0
- package/dist/components/shared/FieldLabel.d.ts +27 -0
- package/dist/components/shared/FieldLabel.d.ts.map +1 -0
- package/dist/components/shared/FieldLabel.js +40 -0
- package/dist/components/shared/FieldWrapper.d.ts +35 -0
- package/dist/components/shared/FieldWrapper.d.ts.map +1 -0
- package/dist/components/shared/FieldWrapper.js +71 -0
- package/dist/components/shared/index.d.ts +6 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/esg_world_logo_no_year.png +0 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/types/sail.d.ts +37 -0
- package/dist/types/sail.d.ts.map +1 -0
- package/dist/uifaces-human-avatar.jpg +0 -0
- package/dist/utils/classNames.d.ts +21 -0
- package/dist/utils/classNames.d.ts.map +1 -0
- package/dist/utils/classNames.js +16 -0
- package/dist/vite.svg +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SAILLabelPosition, SAILMarginSize } from '../../types/sail';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type SearchDisplay = "AUTO" | "ON" | "OFF";
|
|
4
|
+
interface DropdownFieldBaseProps {
|
|
5
|
+
/** Whether to allow multiple selections */
|
|
6
|
+
multiple: boolean;
|
|
7
|
+
/** Text to display as the field label */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Determines where the label appears */
|
|
10
|
+
labelPosition?: SAILLabelPosition;
|
|
11
|
+
/** Supplemental text about this field */
|
|
12
|
+
instructions?: string;
|
|
13
|
+
/** Determines if a value is required to submit the form */
|
|
14
|
+
required?: boolean;
|
|
15
|
+
/** Determines if the field should display as grayed out */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Text to display when nothing is selected */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Array of options for the user to select */
|
|
20
|
+
choiceLabels: any[];
|
|
21
|
+
/** Array of values associated with the corresponding choices */
|
|
22
|
+
choiceValues: any[];
|
|
23
|
+
/** Current selected value(s) */
|
|
24
|
+
value?: any;
|
|
25
|
+
/** Validation errors to display below the field */
|
|
26
|
+
validations?: string[];
|
|
27
|
+
/** Callback when selection changes */
|
|
28
|
+
saveInto?: (value: any) => void;
|
|
29
|
+
/** Callback when selection changes (React-style alias for saveInto) */
|
|
30
|
+
onChange?: (value: any) => void;
|
|
31
|
+
/** Validation group name (no spaces) */
|
|
32
|
+
validationGroup?: string;
|
|
33
|
+
/** Custom message when field is required and not provided */
|
|
34
|
+
requiredMessage?: string;
|
|
35
|
+
/** Displays a help icon with tooltip text */
|
|
36
|
+
helpTooltip?: string;
|
|
37
|
+
/** Additional text for screen readers */
|
|
38
|
+
accessibilityText?: string;
|
|
39
|
+
/** Determines whether component is displayed */
|
|
40
|
+
showWhen?: boolean;
|
|
41
|
+
/** Determines when search box displays */
|
|
42
|
+
searchDisplay?: SearchDisplay;
|
|
43
|
+
/** Data source (record type) - not implemented in prototype */
|
|
44
|
+
data?: any;
|
|
45
|
+
/** Sort configurations - not implemented in prototype */
|
|
46
|
+
sort?: any[];
|
|
47
|
+
/** Space added above component */
|
|
48
|
+
marginAbove?: SAILMarginSize;
|
|
49
|
+
/** Space added below component */
|
|
50
|
+
marginBelow?: SAILMarginSize;
|
|
51
|
+
}
|
|
52
|
+
export declare const DropdownFieldBase: React.FC<DropdownFieldBaseProps>;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=DropdownFieldBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownFieldBase.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownFieldBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGzE,KAAK,aAAa,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;AAE1C,UAAU,sBAAsB;IAC9B,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAA;IACjB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,YAAY,EAAE,GAAG,EAAE,CAAA;IACnB,gEAAgE;IAChE,YAAY,EAAE,GAAG,EAAE,CAAA;IACnB,gCAAgC;IAChC,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,wCAAwC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,yDAAyD;IACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACZ,kCAAkC;IAClC,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,kCAAkC;IAClC,WAAW,CAAC,EAAE,cAAc,CAAA;CAC7B;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA+Q9D,CAAA"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useRef as T, useEffect as B } from "react";
|
|
3
|
+
import { FieldWrapper as L } from "../shared/FieldWrapper.js";
|
|
4
|
+
import { X as Q, ChevronDown as Y, Search as Z } from "lucide-react";
|
|
5
|
+
const se = ({
|
|
6
|
+
multiple: c,
|
|
7
|
+
label: R,
|
|
8
|
+
labelPosition: D = "ABOVE",
|
|
9
|
+
instructions: y,
|
|
10
|
+
required: w = !1,
|
|
11
|
+
disabled: l = !1,
|
|
12
|
+
placeholder: F,
|
|
13
|
+
choiceLabels: i,
|
|
14
|
+
choiceValues: u,
|
|
15
|
+
value: n,
|
|
16
|
+
validations: N = [],
|
|
17
|
+
saveInto: v,
|
|
18
|
+
onChange: S,
|
|
19
|
+
validationGroup: q,
|
|
20
|
+
requiredMessage: O,
|
|
21
|
+
helpTooltip: _,
|
|
22
|
+
accessibilityText: $,
|
|
23
|
+
showWhen: G = !0,
|
|
24
|
+
searchDisplay: C = "AUTO",
|
|
25
|
+
data: V,
|
|
26
|
+
sort: ee,
|
|
27
|
+
marginAbove: I = "NONE",
|
|
28
|
+
marginBelow: U = "STANDARD"
|
|
29
|
+
}) => {
|
|
30
|
+
if (!G) return null;
|
|
31
|
+
const f = `dropdown-${Math.random().toString(36).substr(2, 9)}`, [o, m] = E(!1), [p, A] = E(""), h = T(null), g = T(null), b = C === "ON" || C === "AUTO" && i.length > 11, j = p ? i.map((e, r) => ({ label: e, value: u[r], index: r })).filter(
|
|
32
|
+
(e) => String(e.label).toLowerCase().includes(p.toLowerCase())
|
|
33
|
+
) : i.map((e, r) => ({ label: e, value: u[r], index: r })), d = c ? Array.isArray(n) ? n : n ? [n] : [] : n != null ? [n] : [], z = () => {
|
|
34
|
+
if (d.length === 0)
|
|
35
|
+
return F || "Select...";
|
|
36
|
+
if (c)
|
|
37
|
+
return d.map((e) => {
|
|
38
|
+
const r = u.indexOf(e);
|
|
39
|
+
return r >= 0 ? i[r] : e;
|
|
40
|
+
}).join(", ");
|
|
41
|
+
{
|
|
42
|
+
const e = u.indexOf(n);
|
|
43
|
+
return e >= 0 ? i[e] : n;
|
|
44
|
+
}
|
|
45
|
+
}, M = (e) => {
|
|
46
|
+
const r = S || v;
|
|
47
|
+
if (!(!r || l))
|
|
48
|
+
if (c) {
|
|
49
|
+
const s = Array.isArray(n) ? n : [], k = s.includes(e) ? s.filter((J) => J !== e) : [...s, e];
|
|
50
|
+
r(k.length > 0 ? k : null);
|
|
51
|
+
} else
|
|
52
|
+
r(e), m(!1);
|
|
53
|
+
}, P = (e) => {
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
const r = S || v;
|
|
56
|
+
r && !l && r(null);
|
|
57
|
+
};
|
|
58
|
+
B(() => {
|
|
59
|
+
const e = (r) => {
|
|
60
|
+
h.current && !h.current.contains(r.target) && (m(!1), A(""));
|
|
61
|
+
};
|
|
62
|
+
if (o)
|
|
63
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
64
|
+
}, [o]), B(() => {
|
|
65
|
+
o && b && g.current && g.current.focus();
|
|
66
|
+
}, [o, b]);
|
|
67
|
+
const x = N.length > 0, W = w && d.length === 0 && O, X = /* @__PURE__ */ a("div", { ref: h, className: "relative", children: [
|
|
68
|
+
/* @__PURE__ */ a(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
type: "button",
|
|
72
|
+
id: f,
|
|
73
|
+
onClick: () => !l && m(!o),
|
|
74
|
+
disabled: l,
|
|
75
|
+
className: [
|
|
76
|
+
"w-full",
|
|
77
|
+
"flex items-center justify-between",
|
|
78
|
+
"px-3 py-2",
|
|
79
|
+
"border border-gray-200 rounded-sm",
|
|
80
|
+
"bg-white",
|
|
81
|
+
"text-base text-left",
|
|
82
|
+
l ? "opacity-50 cursor-not-allowed bg-gray-50" : "cursor-pointer hover:border-gray-500",
|
|
83
|
+
x && "border-red-700",
|
|
84
|
+
"focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
85
|
+
].filter(Boolean).join(" "),
|
|
86
|
+
"aria-expanded": o,
|
|
87
|
+
"aria-haspopup": "listbox",
|
|
88
|
+
"aria-invalid": x,
|
|
89
|
+
"aria-describedby": y ? `${f}-instructions` : void 0,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ t("span", { className: d.length === 0 ? "text-gray-500" : "text-gray-900", children: z() }),
|
|
92
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
93
|
+
d.length > 0 && !l && /* @__PURE__ */ t(
|
|
94
|
+
Q,
|
|
95
|
+
{
|
|
96
|
+
className: "h-4 w-4 text-gray-500 hover:text-gray-700",
|
|
97
|
+
onClick: P
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ t(
|
|
101
|
+
Y,
|
|
102
|
+
{
|
|
103
|
+
className: [
|
|
104
|
+
"h-4 w-4 text-gray-500 transition-transform",
|
|
105
|
+
o && "transform rotate-180"
|
|
106
|
+
].filter(Boolean).join(" ")
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
o && /* @__PURE__ */ a("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-sm shadow-lg max-h-60 overflow-hidden", children: [
|
|
114
|
+
b && /* @__PURE__ */ t("div", { className: "p-2 border-b border-gray-200", children: /* @__PURE__ */ a("div", { className: "relative", children: [
|
|
115
|
+
/* @__PURE__ */ t(Z, { className: "absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-500" }),
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
"input",
|
|
118
|
+
{
|
|
119
|
+
ref: g,
|
|
120
|
+
type: "text",
|
|
121
|
+
value: p,
|
|
122
|
+
onChange: (e) => A(e.target.value),
|
|
123
|
+
placeholder: "Search...",
|
|
124
|
+
className: "w-full pl-8 pr-3 py-1.5 border border-gray-200 rounded-sm text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }) }),
|
|
128
|
+
/* @__PURE__ */ t("div", { className: "overflow-y-auto max-h-48", role: "listbox", children: j.length === 0 ? /* @__PURE__ */ t("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found" }) : j.map(({ label: e, value: r }) => {
|
|
129
|
+
const s = d.includes(r);
|
|
130
|
+
return /* @__PURE__ */ a(
|
|
131
|
+
"button",
|
|
132
|
+
{
|
|
133
|
+
type: "button",
|
|
134
|
+
onClick: () => M(r),
|
|
135
|
+
role: "option",
|
|
136
|
+
"aria-selected": s,
|
|
137
|
+
className: [
|
|
138
|
+
"w-full px-3 py-2 text-left text-base",
|
|
139
|
+
"hover:bg-gray-100",
|
|
140
|
+
s && "bg-blue-50 text-blue-700 font-medium",
|
|
141
|
+
"focus:outline-none focus:bg-gray-100"
|
|
142
|
+
].filter(Boolean).join(" "),
|
|
143
|
+
children: [
|
|
144
|
+
c && /* @__PURE__ */ t(
|
|
145
|
+
"input",
|
|
146
|
+
{
|
|
147
|
+
type: "checkbox",
|
|
148
|
+
checked: s,
|
|
149
|
+
readOnly: !0,
|
|
150
|
+
className: "mr-2 h-4 w-4 rounded border-gray-200 text-blue-500"
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
e
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
r
|
|
157
|
+
);
|
|
158
|
+
}) })
|
|
159
|
+
] })
|
|
160
|
+
] }), H = /* @__PURE__ */ a(K, { children: [
|
|
161
|
+
x && /* @__PURE__ */ t("div", { id: `${f}-error`, className: "mt-2", role: "alert", children: N.map((e, r) => /* @__PURE__ */ t("p", { className: "text-sm text-red-700", children: e }, r)) }),
|
|
162
|
+
W && /* @__PURE__ */ t("p", { className: "text-sm text-red-700 mt-2", role: "alert", children: O })
|
|
163
|
+
] });
|
|
164
|
+
return /* @__PURE__ */ t(
|
|
165
|
+
L,
|
|
166
|
+
{
|
|
167
|
+
label: R,
|
|
168
|
+
labelPosition: D,
|
|
169
|
+
required: w,
|
|
170
|
+
instructions: y,
|
|
171
|
+
helpTooltip: _,
|
|
172
|
+
accessibilityText: $,
|
|
173
|
+
inputId: f,
|
|
174
|
+
marginAbove: I,
|
|
175
|
+
marginBelow: U,
|
|
176
|
+
footer: H,
|
|
177
|
+
children: X
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
export {
|
|
182
|
+
se as DropdownFieldBase
|
|
183
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { SAILLabelPosition, SAILMarginSize } from '../../types/sail';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type SearchDisplay = "AUTO" | "ON" | "OFF";
|
|
4
|
+
/**
|
|
5
|
+
* Displays a list of choices for the user to select multiple items
|
|
6
|
+
* Maps to SAIL a!multipleDropdownField()
|
|
7
|
+
*/
|
|
8
|
+
export interface MultipleDropdownFieldProps {
|
|
9
|
+
/** Text to display as the field label */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Supplemental text about this field */
|
|
12
|
+
instructions?: string;
|
|
13
|
+
/** Determines if a value is required to submit the form */
|
|
14
|
+
required?: boolean;
|
|
15
|
+
/** Determines if the field should display as grayed out */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Text to display in the field when it is empty */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Array of options for the user to select */
|
|
20
|
+
choiceLabels: any[];
|
|
21
|
+
/** Array of values associated with the corresponding choices */
|
|
22
|
+
choiceValues: any[];
|
|
23
|
+
/** Values of choices to display as selected */
|
|
24
|
+
value?: any[];
|
|
25
|
+
/** Validation errors to display below the field */
|
|
26
|
+
validations?: string[];
|
|
27
|
+
/** Callback when the user changes the selections */
|
|
28
|
+
saveInto?: (value: any[] | null) => void;
|
|
29
|
+
/** Callback when the user changes the selections (React-style alias for saveInto) */
|
|
30
|
+
onChange?: (value: any[] | null) => void;
|
|
31
|
+
/** Validation group name (no spaces) */
|
|
32
|
+
validationGroup?: string;
|
|
33
|
+
/** Custom message when field is required and not provided */
|
|
34
|
+
requiredMessage?: string;
|
|
35
|
+
/** Determines where the label appears */
|
|
36
|
+
labelPosition?: SAILLabelPosition;
|
|
37
|
+
/** Displays a help icon with tooltip text */
|
|
38
|
+
helpTooltip?: string;
|
|
39
|
+
/** Additional text for screen readers */
|
|
40
|
+
accessibilityText?: string;
|
|
41
|
+
/** Determines whether component is displayed */
|
|
42
|
+
showWhen?: boolean;
|
|
43
|
+
/** Determines when a search box displays above options */
|
|
44
|
+
searchDisplay?: SearchDisplay;
|
|
45
|
+
/** Data source (record type) - not implemented in prototype */
|
|
46
|
+
data?: any;
|
|
47
|
+
/** Sort configurations - not implemented in prototype */
|
|
48
|
+
sort?: any[];
|
|
49
|
+
/** Space added above component */
|
|
50
|
+
marginAbove?: SAILMarginSize;
|
|
51
|
+
/** Space added below component */
|
|
52
|
+
marginBelow?: SAILMarginSize;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Multi-select dropdown field component
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <MultipleDropdownField
|
|
60
|
+
* label="Language"
|
|
61
|
+
* instructions="Which language(s) are you proficient in?"
|
|
62
|
+
* choiceLabels={["English", "Spanish", "French", "German"]}
|
|
63
|
+
* choiceValues={["en_US", "es_ES", "fr_FR", "de_DE"]}
|
|
64
|
+
* value={selectedLanguages}
|
|
65
|
+
* saveInto={(value) => setSelectedLanguages(value)}
|
|
66
|
+
* searchDisplay="AUTO"
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* SAIL Translation:
|
|
71
|
+
* ```sail
|
|
72
|
+
* a!multipleDropdownField(
|
|
73
|
+
* label: "Language",
|
|
74
|
+
* instructions: "Which language(s) are you proficient in?",
|
|
75
|
+
* choiceLabels: {"English", "Spanish", "French", "German"},
|
|
76
|
+
* choiceValues: {"en_US", "es_ES", "fr_FR", "de_DE"},
|
|
77
|
+
* value: local!language,
|
|
78
|
+
* saveInto: local!language,
|
|
79
|
+
* searchDisplay: "AUTO"
|
|
80
|
+
* )
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const MultipleDropdownField: React.FC<MultipleDropdownFieldProps>;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=MultipleDropdownField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipleDropdownField.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/MultipleDropdownField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,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GAAG,CAAA;IACV,yDAAyD;IACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACZ,kCAAkC;IAClC,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,kCAAkC;IAClC,WAAW,CAAC,EAAE,cAAc,CAAA;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAEtE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DropdownField } from './DropdownField';
|
|
2
|
+
export type { DropdownFieldProps } from './DropdownField';
|
|
3
|
+
export { MultipleDropdownField } from './MultipleDropdownField';
|
|
4
|
+
export type { MultipleDropdownFieldProps } from './MultipleDropdownField';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SAILAlign, SAILMarginSize, SAILSemanticColor } from '../../types/sail';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Heading size values matching SAIL's size parameter
|
|
5
|
+
*/
|
|
6
|
+
type HeadingSize = "EXTRA_SMALL" | "SMALL" | "MEDIUM" | "MEDIUM_PLUS" | "LARGE" | "LARGE_PLUS";
|
|
7
|
+
/**
|
|
8
|
+
* Heading tag values for accessibility
|
|
9
|
+
*/
|
|
10
|
+
type HeadingTag = "H1" | "H2" | "H3" | "H4" | "H5" | "H6";
|
|
11
|
+
/**
|
|
12
|
+
* Font weight values matching SAIL's fontWeight parameter
|
|
13
|
+
*/
|
|
14
|
+
type FontWeight = "LIGHT" | "REGULAR" | "SEMI_BOLD" | "BOLD";
|
|
15
|
+
/**
|
|
16
|
+
* Props for the HeadingField component
|
|
17
|
+
*/
|
|
18
|
+
export interface HeadingFieldProps {
|
|
19
|
+
/** Text to display in the header */
|
|
20
|
+
text: string;
|
|
21
|
+
/** Determines the text size */
|
|
22
|
+
size?: HeadingSize;
|
|
23
|
+
/** Determines the heading tag for screen readers */
|
|
24
|
+
headingTag?: HeadingTag;
|
|
25
|
+
/** Determines the label color - hex color or semantic color */
|
|
26
|
+
color?: string | SAILSemanticColor;
|
|
27
|
+
/** Determines the thickness of the text */
|
|
28
|
+
fontWeight?: FontWeight;
|
|
29
|
+
/** Link to apply to the text (simplified - accepts onClick handler) */
|
|
30
|
+
link?: () => void;
|
|
31
|
+
/** Determines whether the component is displayed */
|
|
32
|
+
showWhen?: boolean;
|
|
33
|
+
/** Determines alignment of the text */
|
|
34
|
+
align?: SAILAlign;
|
|
35
|
+
/** Determines space added above the layout */
|
|
36
|
+
marginAbove?: SAILMarginSize;
|
|
37
|
+
/** Determines space added below the layout */
|
|
38
|
+
marginBelow?: SAILMarginSize;
|
|
39
|
+
/** Prevents wrapping to multiple lines when true */
|
|
40
|
+
preventWrapping?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Displays a heading with configurations for color, size, and font weight.
|
|
44
|
+
* Supports heading accessibility tags for screen readers.
|
|
45
|
+
*/
|
|
46
|
+
export declare const HeadingField: React.FC<HeadingFieldProps>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=HeadingField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadingField.d.ts","sourceRoot":"","sources":["../../../src/components/Heading/HeadingField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CA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
|
5
|
+
size: o = "MEDIUM_PLUS",
|
|
6
|
+
headingTag: i,
|
|
7
|
+
color: t = "STANDARD",
|
|
8
|
+
fontWeight: c = "REGULAR",
|
|
9
|
+
link: E,
|
|
10
|
+
showWhen: S = !0,
|
|
11
|
+
align: A = "START",
|
|
12
|
+
marginAbove: m = "NONE",
|
|
13
|
+
marginBelow: u = "MORE",
|
|
14
|
+
preventWrapping: L = !1
|
|
15
|
+
}) => {
|
|
16
|
+
if (!S) return null;
|
|
17
|
+
const N = {
|
|
18
|
+
EXTRA_SMALL: "text-xs",
|
|
19
|
+
// 12px
|
|
20
|
+
SMALL: "text-sm",
|
|
21
|
+
// 14px
|
|
22
|
+
MEDIUM: "text-lg",
|
|
23
|
+
// 18px
|
|
24
|
+
MEDIUM_PLUS: "text-xl",
|
|
25
|
+
// 20px
|
|
26
|
+
LARGE: "text-2xl",
|
|
27
|
+
// 24px
|
|
28
|
+
LARGE_PLUS: "text-3xl"
|
|
29
|
+
// 28px (custom override)
|
|
30
|
+
}, M = {
|
|
31
|
+
LIGHT: "font-light",
|
|
32
|
+
// 300
|
|
33
|
+
REGULAR: "font-normal",
|
|
34
|
+
// 400
|
|
35
|
+
SEMI_BOLD: "font-semibold",
|
|
36
|
+
// 600
|
|
37
|
+
BOLD: "font-bold"
|
|
38
|
+
// 700
|
|
39
|
+
}, R = {
|
|
40
|
+
START: "text-left",
|
|
41
|
+
CENTER: "text-center",
|
|
42
|
+
END: "text-right"
|
|
43
|
+
}, g = {
|
|
44
|
+
NONE: "mt-0",
|
|
45
|
+
EVEN_LESS: "mt-1",
|
|
46
|
+
LESS: "mt-2",
|
|
47
|
+
STANDARD: "mt-4",
|
|
48
|
+
MORE: "mt-6",
|
|
49
|
+
EVEN_MORE: "mt-8"
|
|
50
|
+
}, D = {
|
|
51
|
+
NONE: "mb-0",
|
|
52
|
+
EVEN_LESS: "mb-1",
|
|
53
|
+
LESS: "mb-2",
|
|
54
|
+
STANDARD: "mb-4",
|
|
55
|
+
MORE: "mb-6",
|
|
56
|
+
EVEN_MORE: "mb-8"
|
|
57
|
+
}, T = {
|
|
58
|
+
ACCENT: "text-blue-500",
|
|
59
|
+
POSITIVE: "text-green-700",
|
|
60
|
+
NEGATIVE: "text-red-700",
|
|
61
|
+
SECONDARY: "text-gray-700",
|
|
62
|
+
STANDARD: "text-gray-900"
|
|
63
|
+
}, e = ((n) => ["ACCENT", "POSITIVE", "NEGATIVE", "SECONDARY", "STANDARD"].includes(n))(t) ? { className: T[t] } : { style: { color: t } }, f = i || ((n) => {
|
|
64
|
+
switch (n) {
|
|
65
|
+
case "LARGE_PLUS":
|
|
66
|
+
return "H1";
|
|
67
|
+
case "LARGE":
|
|
68
|
+
return "H1";
|
|
69
|
+
case "MEDIUM_PLUS":
|
|
70
|
+
return "H2";
|
|
71
|
+
case "MEDIUM":
|
|
72
|
+
return "H3";
|
|
73
|
+
case "SMALL":
|
|
74
|
+
return "H4";
|
|
75
|
+
case "EXTRA_SMALL":
|
|
76
|
+
return "H5";
|
|
77
|
+
default:
|
|
78
|
+
return "H2";
|
|
79
|
+
}
|
|
80
|
+
})(o), x = [
|
|
81
|
+
N[o],
|
|
82
|
+
M[c],
|
|
83
|
+
R[A],
|
|
84
|
+
g[m],
|
|
85
|
+
D[u],
|
|
86
|
+
L && "truncate",
|
|
87
|
+
e.className
|
|
88
|
+
].filter(Boolean).join(" "), a = f.toLowerCase(), l = {
|
|
89
|
+
className: x,
|
|
90
|
+
...e.style && { style: e.style }
|
|
91
|
+
};
|
|
92
|
+
return E ? /* @__PURE__ */ r(a, { ...l, children: /* @__PURE__ */ r(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
onClick: E,
|
|
96
|
+
className: "text-inherit underline hover:no-underline focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",
|
|
97
|
+
children: s
|
|
98
|
+
}
|
|
99
|
+
) }) : /* @__PURE__ */ r(a, { ...l, children: s });
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
b as HeadingField
|
|
103
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Heading/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DocumentImageProps {
|
|
2
|
+
/** The image file path (relative to public directory) */
|
|
3
|
+
document: string;
|
|
4
|
+
/** Alternate text for accessibility and screen readers */
|
|
5
|
+
altText?: string;
|
|
6
|
+
/** Optional caption text for mouseover and slideshow mode */
|
|
7
|
+
caption?: string;
|
|
8
|
+
/** Link behavior when image is clicked */
|
|
9
|
+
link?: () => void;
|
|
10
|
+
/** Controls visibility of the image */
|
|
11
|
+
showWhen?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Document image interface for use within ImageField
|
|
15
|
+
* Maps to SAIL's a!documentImage() function
|
|
16
|
+
*
|
|
17
|
+
* This is not a React component - it's a data structure
|
|
18
|
+
* that gets processed by ImageField for rendering
|
|
19
|
+
*/
|
|
20
|
+
//# sourceMappingURL=DocumentImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentImage.d.ts","sourceRoot":"","sources":["../../../src/components/Image/DocumentImage.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAA;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;GAMG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SAILLabelPosition, SAILMarginSize, SAILAlign } from '../../types/sail';
|
|
2
|
+
import { DocumentImageProps } from './DocumentImage';
|
|
3
|
+
import { UserImageProps } from './UserImage';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
type ImageFieldImage = DocumentImageProps | UserImageProps;
|
|
6
|
+
type ImageSize = "ICON" | "ICON_PLUS" | "TINY" | "EXTRA_SMALL" | "SMALL" | "SMALL_PLUS" | "MEDIUM" | "MEDIUM_PLUS" | "LARGE" | "LARGE_PLUS" | "EXTRA_LARGE" | "FIT" | "GALLERY";
|
|
7
|
+
type ImageStyle = "STANDARD" | "AVATAR";
|
|
8
|
+
export interface ImageFieldProps {
|
|
9
|
+
/** Text to display as the field label */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Determines where the label appears */
|
|
12
|
+
labelPosition?: SAILLabelPosition;
|
|
13
|
+
/** Supplemental text about this field */
|
|
14
|
+
instructions?: string;
|
|
15
|
+
/** Help tooltip text (max 500 characters) */
|
|
16
|
+
helpTooltip?: string;
|
|
17
|
+
/** Array of images to display (supports both document and user images) */
|
|
18
|
+
images: ImageFieldImage[];
|
|
19
|
+
/** Controls visibility of the component */
|
|
20
|
+
showWhen?: boolean;
|
|
21
|
+
/** Determines how the images are sized */
|
|
22
|
+
size?: ImageSize;
|
|
23
|
+
/** Determines whether images can be viewed larger when clicked */
|
|
24
|
+
isThumbnail?: boolean;
|
|
25
|
+
/** Determines how the images are rendered */
|
|
26
|
+
style?: ImageStyle;
|
|
27
|
+
/** Determines alignment of the images */
|
|
28
|
+
align?: SAILAlign;
|
|
29
|
+
/** Additional text for screen readers */
|
|
30
|
+
accessibilityText?: string;
|
|
31
|
+
/** Margin above the component */
|
|
32
|
+
marginAbove?: SAILMarginSize;
|
|
33
|
+
/** Margin below the component */
|
|
34
|
+
marginBelow?: SAILMarginSize;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Displays an array of images from document management or web
|
|
38
|
+
* Maps to SAIL's a!imageField() function
|
|
39
|
+
*/
|
|
40
|
+
export declare const ImageField: React.FC<ImageFieldProps>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=ImageField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageField.d.ts","sourceRoot":"","sources":["../../../src/components/Image/ImageField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD,KAAK,eAAe,GAAG,kBAAkB,GAAG,cAAc,CAAA;AAO1D,KAAK,SAAS,GACV,MAAM,GACN,WAAW,GACX,MAAM,GACN,aAAa,GACb,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,aAAa,GACb,OAAO,GACP,YAAY,GACZ,aAAa,GACb,KAAK,GACL,SAAS,CAAA;AAEb,KAAK,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAA;AAEvC,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0EAA0E;IAC1E,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,6CAA6C;I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