@dragunio/fe-libs 0.1.5 → 0.1.6
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 +28 -3
- package/dist/{chunk-3TCR34LS.mjs → chunk-NDMLXSI5.mjs} +13 -0
- package/dist/icons.d.mts +2 -1
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +14 -0
- package/dist/icons.mjs +3 -1
- package/dist/index.d.mts +98 -5
- package/dist/index.d.ts +98 -5
- package/dist/index.js +410 -99
- package/dist/index.mjs +414 -103
- package/dist/styles.css +238 -30
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChevronDownIcon,
|
|
3
|
+
ChevronUpIcon,
|
|
3
4
|
CloseIcon,
|
|
4
5
|
PlusIcon,
|
|
5
6
|
SearchIcon,
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
search,
|
|
21
22
|
trash,
|
|
22
23
|
x_close
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NDMLXSI5.mjs";
|
|
24
25
|
|
|
25
26
|
// packages/button/src/index.tsx
|
|
26
27
|
import { forwardRef } from "react";
|
|
@@ -339,18 +340,39 @@ function TableCaption(props) {
|
|
|
339
340
|
}
|
|
340
341
|
|
|
341
342
|
// packages/toggle/src/index.tsx
|
|
342
|
-
import {
|
|
343
|
+
import {
|
|
344
|
+
forwardRef as forwardRef2
|
|
345
|
+
} from "react";
|
|
343
346
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
344
|
-
var Toggle = forwardRef2(function Toggle2({
|
|
345
|
-
|
|
347
|
+
var Toggle = forwardRef2(function Toggle2({
|
|
348
|
+
color = "#16a34a",
|
|
349
|
+
label,
|
|
350
|
+
labelPosition = "right",
|
|
351
|
+
className,
|
|
352
|
+
style,
|
|
353
|
+
id,
|
|
354
|
+
...props
|
|
355
|
+
}, ref) {
|
|
356
|
+
const classes = ["fe-toggle", `fe-toggle--label-${labelPosition}`, className].filter(Boolean).join(" ");
|
|
346
357
|
const toggleStyle = {
|
|
347
358
|
"--fe-toggle-color": color,
|
|
348
359
|
...style
|
|
349
360
|
};
|
|
350
361
|
return /* @__PURE__ */ jsxs4("label", { className: classes, style: toggleStyle, children: [
|
|
351
|
-
/* @__PURE__ */ jsx4("
|
|
362
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsx4("span", { className: "fe-toggle__label", children: label }),
|
|
363
|
+
/* @__PURE__ */ jsx4(
|
|
364
|
+
"input",
|
|
365
|
+
{
|
|
366
|
+
ref,
|
|
367
|
+
id,
|
|
368
|
+
className: "fe-toggle__input",
|
|
369
|
+
type: "checkbox",
|
|
370
|
+
role: "switch",
|
|
371
|
+
...props
|
|
372
|
+
}
|
|
373
|
+
),
|
|
352
374
|
/* @__PURE__ */ jsx4("span", { className: "fe-toggle__control", "aria-hidden": "true" }),
|
|
353
|
-
label && /* @__PURE__ */ jsx4("span", { className: "fe-toggle__label", children: label })
|
|
375
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx4("span", { className: "fe-toggle__label", children: label })
|
|
354
376
|
] });
|
|
355
377
|
});
|
|
356
378
|
Toggle.displayName = "Toggle";
|
|
@@ -602,7 +624,14 @@ var TextInput = forwardRef3(
|
|
|
602
624
|
TextInput.displayName = "TextInput";
|
|
603
625
|
|
|
604
626
|
// packages/form-controls/src/controls/TextArea/text-area.tsx
|
|
605
|
-
import {
|
|
627
|
+
import {
|
|
628
|
+
forwardRef as forwardRef4,
|
|
629
|
+
useId as useId3,
|
|
630
|
+
useImperativeHandle,
|
|
631
|
+
useLayoutEffect,
|
|
632
|
+
useRef as useRef2,
|
|
633
|
+
useState as useState5
|
|
634
|
+
} from "react";
|
|
606
635
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
607
636
|
var TextArea = forwardRef4(
|
|
608
637
|
function TextArea2({
|
|
@@ -616,6 +645,7 @@ var TextArea = forwardRef4(
|
|
|
616
645
|
helperText,
|
|
617
646
|
error,
|
|
618
647
|
errorMessage,
|
|
648
|
+
autosize = false,
|
|
619
649
|
clearable = false,
|
|
620
650
|
onClear,
|
|
621
651
|
clearLabel = "Clear text area",
|
|
@@ -636,6 +666,7 @@ var TextArea = forwardRef4(
|
|
|
636
666
|
const messageId2 = generatedId + "-message";
|
|
637
667
|
const controlled = value !== void 0;
|
|
638
668
|
const [internalValue, setInternalValue] = useState5(defaultValue);
|
|
669
|
+
const textareaRef = useRef2(null);
|
|
639
670
|
const currentValue = controlled ? value : internalValue;
|
|
640
671
|
const fieldError = getFieldError(error, errorMessage);
|
|
641
672
|
const hasError = fieldError !== void 0 && fieldError !== false && fieldError !== null;
|
|
@@ -649,6 +680,16 @@ var TextArea = forwardRef4(
|
|
|
649
680
|
ariaLabelledBy,
|
|
650
681
|
label ? labelId : void 0
|
|
651
682
|
);
|
|
683
|
+
const resizeToContent = (textarea) => {
|
|
684
|
+
textarea.style.height = "auto";
|
|
685
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
686
|
+
};
|
|
687
|
+
useImperativeHandle(ref, () => textareaRef.current, []);
|
|
688
|
+
useLayoutEffect(() => {
|
|
689
|
+
if (autosize && textareaRef.current) {
|
|
690
|
+
resizeToContent(textareaRef.current);
|
|
691
|
+
}
|
|
692
|
+
}, [autosize, currentValue]);
|
|
652
693
|
const clear = () => {
|
|
653
694
|
if (!controlled) setInternalValue("");
|
|
654
695
|
onValueChange?.("");
|
|
@@ -660,6 +701,7 @@ var TextArea = forwardRef4(
|
|
|
660
701
|
className: [
|
|
661
702
|
"fe-text-area",
|
|
662
703
|
hasError && "fe-text-area--error",
|
|
704
|
+
autosize && "fe-text-area--autosize",
|
|
663
705
|
className
|
|
664
706
|
].filter(Boolean).join(" "),
|
|
665
707
|
children: [
|
|
@@ -677,7 +719,7 @@ var TextArea = forwardRef4(
|
|
|
677
719
|
/* @__PURE__ */ jsx9(
|
|
678
720
|
"textarea",
|
|
679
721
|
{
|
|
680
|
-
ref,
|
|
722
|
+
ref: textareaRef,
|
|
681
723
|
id: inputId,
|
|
682
724
|
value: currentValue,
|
|
683
725
|
placeholder,
|
|
@@ -690,6 +732,7 @@ var TextArea = forwardRef4(
|
|
|
690
732
|
"aria-describedby": describedBy,
|
|
691
733
|
onChange: (event) => {
|
|
692
734
|
if (!controlled) setInternalValue(event.target.value);
|
|
735
|
+
if (autosize) resizeToContent(event.currentTarget);
|
|
693
736
|
onValueChange?.(event.target.value);
|
|
694
737
|
onChange?.(event);
|
|
695
738
|
},
|
|
@@ -734,8 +777,8 @@ import {
|
|
|
734
777
|
forwardRef as forwardRef5,
|
|
735
778
|
useEffect as useEffect3,
|
|
736
779
|
useId as useId4,
|
|
737
|
-
useLayoutEffect,
|
|
738
|
-
useRef as
|
|
780
|
+
useLayoutEffect as useLayoutEffect2,
|
|
781
|
+
useRef as useRef3,
|
|
739
782
|
useState as useState6
|
|
740
783
|
} from "react";
|
|
741
784
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -798,8 +841,8 @@ var Selection = forwardRef5(
|
|
|
798
841
|
const [open, setOpen] = useState6(false);
|
|
799
842
|
const [query, setQuery] = useState6("");
|
|
800
843
|
const [activeIndex, setActiveIndex] = useState6(0);
|
|
801
|
-
const rootRef =
|
|
802
|
-
const menuRef =
|
|
844
|
+
const rootRef = useRef3(null);
|
|
845
|
+
const menuRef = useRef3(null);
|
|
803
846
|
const [menuPosition, setMenuPosition] = useState6(null);
|
|
804
847
|
useEffect3(() => {
|
|
805
848
|
const close = (event) => {
|
|
@@ -810,7 +853,7 @@ var Selection = forwardRef5(
|
|
|
810
853
|
document.addEventListener("mousedown", close);
|
|
811
854
|
return () => document.removeEventListener("mousedown", close);
|
|
812
855
|
}, []);
|
|
813
|
-
|
|
856
|
+
useLayoutEffect2(() => {
|
|
814
857
|
if (!open) return;
|
|
815
858
|
const updateMenuPosition = () => {
|
|
816
859
|
const rect = rootRef.current?.getBoundingClientRect();
|
|
@@ -1067,7 +1110,13 @@ var Selection = forwardRef5(
|
|
|
1067
1110
|
Selection.displayName = "Selection";
|
|
1068
1111
|
|
|
1069
1112
|
// packages/form-controls/src/controls/NumberInput/number-input.tsx
|
|
1070
|
-
import {
|
|
1113
|
+
import {
|
|
1114
|
+
forwardRef as forwardRef6,
|
|
1115
|
+
useEffect as useEffect4,
|
|
1116
|
+
useId as useId5,
|
|
1117
|
+
useRef as useRef4,
|
|
1118
|
+
useState as useState7
|
|
1119
|
+
} from "react";
|
|
1071
1120
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1072
1121
|
function formatNumber(value, decimals = 2, thousandSeparator = ",", decimalSeparator = ".") {
|
|
1073
1122
|
return new Intl.NumberFormat("en-US", {
|
|
@@ -1082,6 +1131,11 @@ function escapeRegExp(value) {
|
|
|
1082
1131
|
function groupInteger(value, separator) {
|
|
1083
1132
|
return value.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
1084
1133
|
}
|
|
1134
|
+
function roundToDecimals(value, decimals) {
|
|
1135
|
+
const precision = Math.min(Math.max(0, decimals), 15);
|
|
1136
|
+
const multiplier = 10 ** precision;
|
|
1137
|
+
return Math.round((value + Number.EPSILON) * multiplier) / multiplier;
|
|
1138
|
+
}
|
|
1085
1139
|
function normalizeNumberInput(raw, options) {
|
|
1086
1140
|
const { allowDecimal, decimalSeparator, thousandSeparator, min, max } = options;
|
|
1087
1141
|
const decimals = Math.max(0, options.decimals);
|
|
@@ -1144,10 +1198,20 @@ var NumberInput = forwardRef6(
|
|
|
1144
1198
|
placeholder,
|
|
1145
1199
|
required,
|
|
1146
1200
|
endAdornment,
|
|
1201
|
+
prefix,
|
|
1202
|
+
suffix,
|
|
1203
|
+
Prefix,
|
|
1204
|
+
Suffix,
|
|
1205
|
+
step = 1,
|
|
1206
|
+
showStepper = true,
|
|
1207
|
+
incrementLabel = "Increase value",
|
|
1208
|
+
decrementLabel = "Decrease value",
|
|
1147
1209
|
"aria-describedby": ariaDescribedBy,
|
|
1148
1210
|
"aria-labelledby": ariaLabelledBy,
|
|
1211
|
+
onKeyDown,
|
|
1149
1212
|
...props
|
|
1150
1213
|
}, ref) {
|
|
1214
|
+
const inputRef = useRef4(null);
|
|
1151
1215
|
const generatedId = useId5();
|
|
1152
1216
|
const messageId2 = generatedId + "-message";
|
|
1153
1217
|
const isControlled = value !== void 0;
|
|
@@ -1175,6 +1239,8 @@ var NumberInput = forwardRef6(
|
|
|
1175
1239
|
ariaLabelledBy,
|
|
1176
1240
|
label ? labelId : void 0
|
|
1177
1241
|
);
|
|
1242
|
+
const resolvedPrefix = prefix ?? Prefix;
|
|
1243
|
+
const resolvedSuffix = suffix ?? Suffix;
|
|
1178
1244
|
useEffect4(() => {
|
|
1179
1245
|
if (!focused)
|
|
1180
1246
|
setText(
|
|
@@ -1199,8 +1265,38 @@ var NumberInput = forwardRef6(
|
|
|
1199
1265
|
if (!isControlled) setInternalValue(next.value);
|
|
1200
1266
|
onValueChange?.(next.value);
|
|
1201
1267
|
};
|
|
1268
|
+
const setValue = (nextValue) => {
|
|
1269
|
+
const clamped = Math.min(
|
|
1270
|
+
max ?? Number.POSITIVE_INFINITY,
|
|
1271
|
+
Math.max(min ?? Number.NEGATIVE_INFINITY, nextValue)
|
|
1272
|
+
);
|
|
1273
|
+
const normalized = roundToDecimals(
|
|
1274
|
+
clamped,
|
|
1275
|
+
allowDecimal ? decimals : 0
|
|
1276
|
+
);
|
|
1277
|
+
setText(
|
|
1278
|
+
formatNumber(
|
|
1279
|
+
normalized,
|
|
1280
|
+
decimals,
|
|
1281
|
+
thousandSeparator,
|
|
1282
|
+
decimalSeparator
|
|
1283
|
+
)
|
|
1284
|
+
);
|
|
1285
|
+
if (!isControlled) setInternalValue(normalized);
|
|
1286
|
+
onValueChange?.(normalized);
|
|
1287
|
+
};
|
|
1288
|
+
const adjustValue = (direction) => {
|
|
1289
|
+
if (props.disabled || props.readOnly || !Number.isFinite(step) || step <= 0)
|
|
1290
|
+
return;
|
|
1291
|
+
const baseValue = actualValue ?? min ?? 0;
|
|
1292
|
+
setValue(baseValue + direction * step);
|
|
1293
|
+
inputRef.current?.focus();
|
|
1294
|
+
};
|
|
1295
|
+
const stepIsUsable = Number.isFinite(step) && step > 0;
|
|
1296
|
+
const disableIncrement = Boolean(props.disabled || props.readOnly) || !stepIsUsable || max !== void 0 && actualValue !== null && actualValue >= max;
|
|
1297
|
+
const disableDecrement = Boolean(props.disabled || props.readOnly) || !stepIsUsable || min !== void 0 && actualValue !== null && actualValue <= min;
|
|
1202
1298
|
return /* @__PURE__ */ jsxs11(
|
|
1203
|
-
"
|
|
1299
|
+
"div",
|
|
1204
1300
|
{
|
|
1205
1301
|
className: [
|
|
1206
1302
|
"fe-number-input",
|
|
@@ -1219,35 +1315,86 @@ var NumberInput = forwardRef6(
|
|
|
1219
1315
|
}
|
|
1220
1316
|
),
|
|
1221
1317
|
/* @__PURE__ */ jsxs11("span", { className: "fe-number-input__control", children: [
|
|
1222
|
-
/* @__PURE__ */ jsx11(
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1318
|
+
resolvedPrefix && /* @__PURE__ */ jsx11("span", { className: "fe-number-input__prefix", children: resolvedPrefix }),
|
|
1319
|
+
/* @__PURE__ */ jsxs11("span", { className: "fe-number-input__input-wrap", children: [
|
|
1320
|
+
/* @__PURE__ */ jsx11(
|
|
1321
|
+
"input",
|
|
1322
|
+
{
|
|
1323
|
+
ref: (node) => {
|
|
1324
|
+
inputRef.current = node;
|
|
1325
|
+
if (typeof ref === "function") ref(node);
|
|
1326
|
+
else if (ref) ref.current = node;
|
|
1327
|
+
},
|
|
1328
|
+
inputMode: allowDecimal ? "decimal" : "numeric",
|
|
1329
|
+
value: text,
|
|
1330
|
+
placeholder,
|
|
1331
|
+
required: isRequired || required,
|
|
1332
|
+
onFocus: (event) => {
|
|
1333
|
+
setFocused(true);
|
|
1334
|
+
onFocus?.(event);
|
|
1335
|
+
},
|
|
1336
|
+
onChange: (event) => updateValue(event.target.value),
|
|
1337
|
+
onBlur: (event) => {
|
|
1338
|
+
setFocused(false);
|
|
1339
|
+
onBlur?.(event);
|
|
1340
|
+
},
|
|
1341
|
+
onKeyDown: (event) => {
|
|
1342
|
+
onKeyDown?.(event);
|
|
1343
|
+
if (event.defaultPrevented) return;
|
|
1344
|
+
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
1345
|
+
event.preventDefault();
|
|
1346
|
+
adjustValue(event.key === "ArrowUp" ? 1 : -1);
|
|
1347
|
+
}
|
|
1348
|
+
},
|
|
1349
|
+
...props,
|
|
1350
|
+
"aria-invalid": hasError || void 0,
|
|
1351
|
+
"aria-required": isRequired || void 0,
|
|
1352
|
+
"aria-labelledby": labelledBy,
|
|
1353
|
+
"aria-describedby": describedBy
|
|
1354
|
+
}
|
|
1355
|
+
),
|
|
1356
|
+
isRequired && placeholder && !text && /* @__PURE__ */ jsxs11(
|
|
1357
|
+
"span",
|
|
1358
|
+
{
|
|
1359
|
+
className: "fe-number-input__placeholder",
|
|
1360
|
+
"aria-hidden": "true",
|
|
1361
|
+
children: [
|
|
1362
|
+
/* @__PURE__ */ jsx11("span", { children: placeholder }),
|
|
1363
|
+
/* @__PURE__ */ jsx11("span", { className: "fe-field__required", children: "*" })
|
|
1364
|
+
]
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1249
1367
|
] }),
|
|
1250
|
-
|
|
1368
|
+
resolvedSuffix && /* @__PURE__ */ jsx11("span", { className: "fe-number-input__suffix", children: resolvedSuffix }),
|
|
1369
|
+
endAdornment,
|
|
1370
|
+
showStepper && /* @__PURE__ */ jsxs11("span", { className: "fe-number-input__stepper", children: [
|
|
1371
|
+
/* @__PURE__ */ jsx11(
|
|
1372
|
+
Button,
|
|
1373
|
+
{
|
|
1374
|
+
hierarchy: "tertiary-gray",
|
|
1375
|
+
size: "24",
|
|
1376
|
+
iconOnly: true,
|
|
1377
|
+
icon: /* @__PURE__ */ jsx11(ChevronUpIcon, { size: 12 }),
|
|
1378
|
+
"aria-label": incrementLabel,
|
|
1379
|
+
disabled: disableIncrement,
|
|
1380
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1381
|
+
onClick: () => adjustValue(1)
|
|
1382
|
+
}
|
|
1383
|
+
),
|
|
1384
|
+
/* @__PURE__ */ jsx11(
|
|
1385
|
+
Button,
|
|
1386
|
+
{
|
|
1387
|
+
hierarchy: "tertiary-gray",
|
|
1388
|
+
size: "24",
|
|
1389
|
+
iconOnly: true,
|
|
1390
|
+
icon: /* @__PURE__ */ jsx11(ChevronDownIcon, { size: 12 }),
|
|
1391
|
+
"aria-label": decrementLabel,
|
|
1392
|
+
disabled: disableDecrement,
|
|
1393
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1394
|
+
onClick: () => adjustValue(-1)
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
] })
|
|
1251
1398
|
] }),
|
|
1252
1399
|
/* @__PURE__ */ jsx11(
|
|
1253
1400
|
FieldMessage,
|
|
@@ -1316,7 +1463,7 @@ function CurrencyInput({
|
|
|
1316
1463
|
}
|
|
1317
1464
|
|
|
1318
1465
|
// packages/form-controls/src/controls/DateTimePicker/date-time-picker.tsx
|
|
1319
|
-
import { useEffect as useEffect5, useId as useId6, useRef as
|
|
1466
|
+
import { useEffect as useEffect5, useId as useId6, useRef as useRef5, useState as useState9 } from "react";
|
|
1320
1467
|
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1321
1468
|
var pad = (value) => String(value).padStart(2, "0");
|
|
1322
1469
|
function formatDate(date, format) {
|
|
@@ -1384,7 +1531,7 @@ function DateTimePicker(props) {
|
|
|
1384
1531
|
() => new Date((isRange ? rangeValue[0] : singleValue) ?? /* @__PURE__ */ new Date())
|
|
1385
1532
|
);
|
|
1386
1533
|
const [editingEnd, setEditingEnd] = useState9(false);
|
|
1387
|
-
const rootRef =
|
|
1534
|
+
const rootRef = useRef5(null);
|
|
1388
1535
|
useEffect5(() => {
|
|
1389
1536
|
const onPointerDown = (event) => {
|
|
1390
1537
|
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -1600,30 +1747,190 @@ function DateTimePicker(props) {
|
|
|
1600
1747
|
);
|
|
1601
1748
|
}
|
|
1602
1749
|
|
|
1603
|
-
// packages/
|
|
1604
|
-
import {
|
|
1750
|
+
// packages/form-controls/src/controls/Checkbox/checkbox.tsx
|
|
1751
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
1605
1752
|
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1753
|
+
var Checkbox = forwardRef7(
|
|
1754
|
+
function Checkbox2({
|
|
1755
|
+
label,
|
|
1756
|
+
labelPosition = "right",
|
|
1757
|
+
className,
|
|
1758
|
+
style,
|
|
1759
|
+
id,
|
|
1760
|
+
disabled,
|
|
1761
|
+
...props
|
|
1762
|
+
}, ref) {
|
|
1763
|
+
const classes = [
|
|
1764
|
+
"fe-checkbox",
|
|
1765
|
+
`fe-checkbox--label-${labelPosition}`,
|
|
1766
|
+
disabled && "fe-checkbox--disabled",
|
|
1767
|
+
className
|
|
1768
|
+
].filter(Boolean).join(" ");
|
|
1769
|
+
return /* @__PURE__ */ jsxs13("label", { className: classes, style, children: [
|
|
1770
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsx14("span", { className: "fe-checkbox__label", children: label }),
|
|
1771
|
+
/* @__PURE__ */ jsxs13("span", { className: "fe-checkbox__content", children: [
|
|
1772
|
+
/* @__PURE__ */ jsx14(
|
|
1773
|
+
"input",
|
|
1774
|
+
{
|
|
1775
|
+
ref,
|
|
1776
|
+
id,
|
|
1777
|
+
className: "fe-checkbox__input",
|
|
1778
|
+
type: "checkbox",
|
|
1779
|
+
disabled,
|
|
1780
|
+
...props
|
|
1781
|
+
}
|
|
1782
|
+
),
|
|
1783
|
+
/* @__PURE__ */ jsx14("span", { className: "fe-checkbox__control", "aria-hidden": "true" }),
|
|
1784
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx14("span", { className: "fe-checkbox__label", children: label })
|
|
1785
|
+
] })
|
|
1786
|
+
] });
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
Checkbox.displayName = "Checkbox";
|
|
1790
|
+
|
|
1791
|
+
// packages/form-controls/src/controls/RadioButton/radio-button.tsx
|
|
1792
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
1793
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1794
|
+
var RadioButton = forwardRef8(
|
|
1795
|
+
function RadioButton2({
|
|
1796
|
+
label,
|
|
1797
|
+
labelPosition = "right",
|
|
1798
|
+
className,
|
|
1799
|
+
style,
|
|
1800
|
+
id,
|
|
1801
|
+
disabled,
|
|
1802
|
+
...props
|
|
1803
|
+
}, ref) {
|
|
1804
|
+
const classes = [
|
|
1805
|
+
"fe-radio-button",
|
|
1806
|
+
`fe-radio-button--label-${labelPosition}`,
|
|
1807
|
+
disabled && "fe-radio-button--disabled",
|
|
1808
|
+
className
|
|
1809
|
+
].filter(Boolean).join(" ");
|
|
1810
|
+
return /* @__PURE__ */ jsxs14("label", { className: classes, style, children: [
|
|
1811
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsx15("span", { className: "fe-radio-button__label", children: label }),
|
|
1812
|
+
/* @__PURE__ */ jsxs14("span", { className: "fe-radio-button__content", children: [
|
|
1813
|
+
/* @__PURE__ */ jsx15(
|
|
1814
|
+
"input",
|
|
1815
|
+
{
|
|
1816
|
+
ref,
|
|
1817
|
+
id,
|
|
1818
|
+
className: "fe-radio-button__input",
|
|
1819
|
+
type: "radio",
|
|
1820
|
+
disabled,
|
|
1821
|
+
...props
|
|
1822
|
+
}
|
|
1823
|
+
),
|
|
1824
|
+
/* @__PURE__ */ jsx15("span", { className: "fe-radio-button__control", "aria-hidden": "true" }),
|
|
1825
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx15("span", { className: "fe-radio-button__label", children: label })
|
|
1826
|
+
] })
|
|
1827
|
+
] });
|
|
1828
|
+
}
|
|
1829
|
+
);
|
|
1830
|
+
RadioButton.displayName = "RadioButton";
|
|
1831
|
+
|
|
1832
|
+
// packages/form-controls/src/controls/RadioGroup/radio-group.tsx
|
|
1833
|
+
import { forwardRef as forwardRef9, useId as useId7 } from "react";
|
|
1834
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1835
|
+
var RadioGroup = forwardRef9(
|
|
1836
|
+
function RadioGroup2({
|
|
1837
|
+
label,
|
|
1838
|
+
labelPosition = "top",
|
|
1839
|
+
options,
|
|
1840
|
+
name,
|
|
1841
|
+
value,
|
|
1842
|
+
defaultValue,
|
|
1843
|
+
onChange,
|
|
1844
|
+
disabled = false,
|
|
1845
|
+
direction = "vertical",
|
|
1846
|
+
isRequired = false,
|
|
1847
|
+
className,
|
|
1848
|
+
id,
|
|
1849
|
+
"aria-label": ariaLabel,
|
|
1850
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1851
|
+
...props
|
|
1852
|
+
}, ref) {
|
|
1853
|
+
const generatedId = useId7();
|
|
1854
|
+
const groupName = name ?? `fe-radio-group-${generatedId}`;
|
|
1855
|
+
const labelId = `${id ?? generatedId}-label`;
|
|
1856
|
+
const isControlled = value !== void 0;
|
|
1857
|
+
const classes = [
|
|
1858
|
+
"fe-radio-group",
|
|
1859
|
+
`fe-radio-group--label-${labelPosition}`,
|
|
1860
|
+
`fe-radio-group--${direction}`,
|
|
1861
|
+
disabled && "fe-radio-group--disabled",
|
|
1862
|
+
className
|
|
1863
|
+
].filter(Boolean).join(" ");
|
|
1864
|
+
const handleChange = (option, event) => {
|
|
1865
|
+
if (event.target.checked) onChange?.(option.value, option, event);
|
|
1866
|
+
};
|
|
1867
|
+
return /* @__PURE__ */ jsxs15("div", { ref, className: classes, ...props, children: [
|
|
1868
|
+
label && labelPosition === "top" && /* @__PURE__ */ jsxs15("span", { id: labelId, className: "fe-radio-group__label", children: [
|
|
1869
|
+
label,
|
|
1870
|
+
isRequired && /* @__PURE__ */ jsx16("span", { className: "fe-radio-group__required", "aria-hidden": "true", children: "*" })
|
|
1871
|
+
] }),
|
|
1872
|
+
/* @__PURE__ */ jsx16(
|
|
1873
|
+
"div",
|
|
1874
|
+
{
|
|
1875
|
+
id,
|
|
1876
|
+
className: "fe-radio-group__options",
|
|
1877
|
+
role: "radiogroup",
|
|
1878
|
+
"aria-label": label ? void 0 : ariaLabel,
|
|
1879
|
+
"aria-labelledby": label ? labelId : ariaLabelledBy,
|
|
1880
|
+
"aria-required": isRequired || void 0,
|
|
1881
|
+
children: options.map((option) => {
|
|
1882
|
+
const optionDisabled = disabled || option.disabled;
|
|
1883
|
+
const optionValue = String(option.value);
|
|
1884
|
+
return /* @__PURE__ */ jsx16(
|
|
1885
|
+
RadioButton,
|
|
1886
|
+
{
|
|
1887
|
+
name: groupName,
|
|
1888
|
+
value: optionValue,
|
|
1889
|
+
label: option.label,
|
|
1890
|
+
disabled: optionDisabled,
|
|
1891
|
+
required: isRequired,
|
|
1892
|
+
checked: isControlled ? option.value === value : void 0,
|
|
1893
|
+
defaultChecked: !isControlled ? option.value === defaultValue : void 0,
|
|
1894
|
+
onChange: (event) => handleChange(option, event)
|
|
1895
|
+
},
|
|
1896
|
+
optionValue
|
|
1897
|
+
);
|
|
1898
|
+
})
|
|
1899
|
+
}
|
|
1900
|
+
),
|
|
1901
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsxs15("span", { id: labelId, className: "fe-radio-group__label", children: [
|
|
1902
|
+
label,
|
|
1903
|
+
isRequired && /* @__PURE__ */ jsx16("span", { className: "fe-radio-group__required", "aria-hidden": "true", children: "*" })
|
|
1904
|
+
] })
|
|
1905
|
+
] });
|
|
1906
|
+
}
|
|
1907
|
+
);
|
|
1908
|
+
RadioGroup.displayName = "RadioGroup";
|
|
1909
|
+
|
|
1910
|
+
// packages/expandable-section/src/index.tsx
|
|
1911
|
+
import { useId as useId8, useState as useState10 } from "react";
|
|
1912
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1606
1913
|
function ExpandableSection({ title, children, expanded, defaultExpanded = false, onExpandedChange, disabled, className, ...props }) {
|
|
1607
1914
|
const [internalExpanded, setInternalExpanded] = useState10(defaultExpanded);
|
|
1608
1915
|
const isExpanded = expanded ?? internalExpanded;
|
|
1609
|
-
const id =
|
|
1916
|
+
const id = useId8();
|
|
1610
1917
|
const toggle = () => {
|
|
1611
1918
|
if (disabled) return;
|
|
1612
1919
|
const next = !isExpanded;
|
|
1613
1920
|
if (expanded === void 0) setInternalExpanded(next);
|
|
1614
1921
|
onExpandedChange?.(next);
|
|
1615
1922
|
};
|
|
1616
|
-
return /* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
/* @__PURE__ */
|
|
1923
|
+
return /* @__PURE__ */ jsxs16("section", { className: ["fe-expandable-section", isExpanded && "fe-expandable-section--expanded", disabled && "fe-expandable-section--disabled", className].filter(Boolean).join(" "), ...props, children: [
|
|
1924
|
+
/* @__PURE__ */ jsxs16("button", { className: "fe-expandable-section__trigger", type: "button", "aria-expanded": isExpanded, "aria-controls": id, disabled, onClick: toggle, children: [
|
|
1925
|
+
/* @__PURE__ */ jsx17("span", { children: title }),
|
|
1926
|
+
/* @__PURE__ */ jsx17("span", { className: "fe-expandable-section__chevron", "aria-hidden": "true" })
|
|
1620
1927
|
] }),
|
|
1621
|
-
/* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ jsx17("div", { id, className: "fe-expandable-section__content", "aria-hidden": !isExpanded, children: /* @__PURE__ */ jsx17("div", { className: "fe-expandable-section__content-inner", children }) })
|
|
1622
1929
|
] });
|
|
1623
1930
|
}
|
|
1624
1931
|
|
|
1625
1932
|
// packages/loading/src/index.tsx
|
|
1626
|
-
import { jsx as
|
|
1933
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1627
1934
|
var sizes = {
|
|
1628
1935
|
small: "16px",
|
|
1629
1936
|
medium: "24px",
|
|
@@ -1636,15 +1943,15 @@ function Loading({ size = "medium", color = "#2878f0", label, className, style,
|
|
|
1636
1943
|
"--fe-loading-color": color,
|
|
1637
1944
|
...style
|
|
1638
1945
|
};
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
label && /* @__PURE__ */
|
|
1642
|
-
!label && /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsxs17("span", { className: ["fe-loading", className].filter(Boolean).join(" "), style: loadingStyle, role: "status", ...props, children: [
|
|
1947
|
+
/* @__PURE__ */ jsx18("span", { className: "fe-loading__spinner", "aria-hidden": "true" }),
|
|
1948
|
+
label && /* @__PURE__ */ jsx18("span", { className: "fe-loading__label", children: label }),
|
|
1949
|
+
!label && /* @__PURE__ */ jsx18("span", { className: "fe-loading__sr-only", children: "Loading" })
|
|
1643
1950
|
] });
|
|
1644
1951
|
}
|
|
1645
1952
|
|
|
1646
1953
|
// packages/skeleton/src/index.tsx
|
|
1647
|
-
import { Fragment as Fragment3, jsx as
|
|
1954
|
+
import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
|
|
1648
1955
|
var pixels = (value) => typeof value === "number" ? `${value}px` : value;
|
|
1649
1956
|
function SkeletonBase({ variant = "box", shape, width, height, count = 1, animated = true, className, style, ...props }) {
|
|
1650
1957
|
const resolvedVariant = shape ?? variant;
|
|
@@ -1655,7 +1962,7 @@ function SkeletonBase({ variant = "box", shape, width, height, count = 1, animat
|
|
|
1655
1962
|
"--fe-skeleton-height": resolvedHeight,
|
|
1656
1963
|
...style
|
|
1657
1964
|
};
|
|
1658
|
-
return /* @__PURE__ */
|
|
1965
|
+
return /* @__PURE__ */ jsx19(Fragment3, { children: Array.from({ length: Math.max(1, count) }, (_, index) => /* @__PURE__ */ jsx19(
|
|
1659
1966
|
"div",
|
|
1660
1967
|
{
|
|
1661
1968
|
className: ["fe-skeleton", `fe-skeleton--${resolvedVariant}`, animated && "fe-skeleton--animated", className].filter(Boolean).join(" "),
|
|
@@ -1667,16 +1974,16 @@ function SkeletonBase({ variant = "box", shape, width, height, count = 1, animat
|
|
|
1667
1974
|
)) });
|
|
1668
1975
|
}
|
|
1669
1976
|
function SkeletonCircle({ size = 40, ...props }) {
|
|
1670
|
-
return /* @__PURE__ */
|
|
1977
|
+
return /* @__PURE__ */ jsx19(SkeletonBase, { variant: "circle", width: size, height: size, ...props });
|
|
1671
1978
|
}
|
|
1672
1979
|
function SkeletonSquare({ size = 80, ...props }) {
|
|
1673
|
-
return /* @__PURE__ */
|
|
1980
|
+
return /* @__PURE__ */ jsx19(SkeletonBase, { variant: "box", width: size, height: size, ...props });
|
|
1674
1981
|
}
|
|
1675
1982
|
function SkeletonBox({ width = "100%", height = 80, ...props }) {
|
|
1676
|
-
return /* @__PURE__ */
|
|
1983
|
+
return /* @__PURE__ */ jsx19(SkeletonBase, { variant: "box", width, height, ...props });
|
|
1677
1984
|
}
|
|
1678
1985
|
function SkeletonLine({ width = "100%", height = 12, ...props }) {
|
|
1679
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ jsx19(SkeletonBase, { variant: "line", width, height, ...props });
|
|
1680
1987
|
}
|
|
1681
1988
|
var Skeleton = Object.assign(SkeletonBase, {
|
|
1682
1989
|
Circle: SkeletonCircle,
|
|
@@ -1686,9 +1993,9 @@ var Skeleton = Object.assign(SkeletonBase, {
|
|
|
1686
1993
|
});
|
|
1687
1994
|
|
|
1688
1995
|
// packages/modal/src/index.tsx
|
|
1689
|
-
import { useEffect as useEffect6, useId as
|
|
1996
|
+
import { useEffect as useEffect6, useId as useId9, useRef as useRef6 } from "react";
|
|
1690
1997
|
import { createPortal as createPortal3 } from "react-dom";
|
|
1691
|
-
import { jsx as
|
|
1998
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1692
1999
|
function Modal({
|
|
1693
2000
|
open,
|
|
1694
2001
|
onClose,
|
|
@@ -1704,8 +2011,8 @@ function Modal({
|
|
|
1704
2011
|
className,
|
|
1705
2012
|
...props
|
|
1706
2013
|
}) {
|
|
1707
|
-
const titleId =
|
|
1708
|
-
const panelRef =
|
|
2014
|
+
const titleId = useId9();
|
|
2015
|
+
const panelRef = useRef6(null);
|
|
1709
2016
|
useEffect6(() => {
|
|
1710
2017
|
if (!open) return;
|
|
1711
2018
|
const onKeyDown = (event) => {
|
|
@@ -1718,9 +2025,9 @@ function Modal({
|
|
|
1718
2025
|
if (!open || typeof document === "undefined") return null;
|
|
1719
2026
|
const hasFooter = footer || actions.length > 0;
|
|
1720
2027
|
return createPortal3(
|
|
1721
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ jsx20("div", { className: "fe-modal-backdrop", role: "presentation", onMouseDown: (event) => {
|
|
1722
2029
|
if (event.target === event.currentTarget && closeOnBackdropClick) onClose();
|
|
1723
|
-
}, children: /* @__PURE__ */
|
|
2030
|
+
}, children: /* @__PURE__ */ jsxs18(
|
|
1724
2031
|
"div",
|
|
1725
2032
|
{
|
|
1726
2033
|
ref: panelRef,
|
|
@@ -1732,17 +2039,17 @@ function Modal({
|
|
|
1732
2039
|
tabIndex: -1,
|
|
1733
2040
|
...props,
|
|
1734
2041
|
children: [
|
|
1735
|
-
(title || description || closeButton) && /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
title && /* @__PURE__ */
|
|
1738
|
-
description && /* @__PURE__ */
|
|
2042
|
+
(title || description || closeButton) && /* @__PURE__ */ jsxs18("header", { className: "fe-modal__header", children: [
|
|
2043
|
+
/* @__PURE__ */ jsxs18("div", { className: "fe-modal__heading", children: [
|
|
2044
|
+
title && /* @__PURE__ */ jsx20("h2", { id: titleId, children: title }),
|
|
2045
|
+
description && /* @__PURE__ */ jsx20("p", { children: description })
|
|
1739
2046
|
] }),
|
|
1740
|
-
closeButton && /* @__PURE__ */
|
|
2047
|
+
closeButton && /* @__PURE__ */ jsx20(Button, { hierarchy: "tertiary-gray", size: "32", iconOnly: true, icon: /* @__PURE__ */ jsx20(CloseIcon, {}), "aria-label": closeLabel, onClick: onClose })
|
|
1741
2048
|
] }),
|
|
1742
|
-
/* @__PURE__ */
|
|
1743
|
-
hasFooter && /* @__PURE__ */
|
|
1744
|
-
footer && /* @__PURE__ */
|
|
1745
|
-
actions.length > 0 && /* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsx20("div", { className: "fe-modal__body", children }),
|
|
2050
|
+
hasFooter && /* @__PURE__ */ jsxs18("footer", { className: "fe-modal__footer", children: [
|
|
2051
|
+
footer && /* @__PURE__ */ jsx20("div", { className: "fe-modal__footer-content", children: footer }),
|
|
2052
|
+
actions.length > 0 && /* @__PURE__ */ jsx20("div", { className: "fe-modal__actions", children: actions.map(({ label, ...action }, index) => /* @__PURE__ */ jsx20(Button, { ...action, children: label }, index)) })
|
|
1746
2053
|
] })
|
|
1747
2054
|
]
|
|
1748
2055
|
}
|
|
@@ -1752,7 +2059,7 @@ function Modal({
|
|
|
1752
2059
|
}
|
|
1753
2060
|
|
|
1754
2061
|
// packages/progress/src/index.tsx
|
|
1755
|
-
import { jsx as
|
|
2062
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1756
2063
|
function ProgressBar({ value, max = 100, label, showValue = true, size = "medium", color = "#2878f0", className, style, "aria-label": ariaLabel, ...props }) {
|
|
1757
2064
|
const indeterminate = value === null || value === void 0;
|
|
1758
2065
|
const percentage = indeterminate ? 0 : Math.min(100, Math.max(0, Number(value) / Math.max(1, max) * 100));
|
|
@@ -1762,17 +2069,17 @@ function ProgressBar({ value, max = 100, label, showValue = true, size = "medium
|
|
|
1762
2069
|
...style
|
|
1763
2070
|
};
|
|
1764
2071
|
const visibleValue = `${Math.round(percentage)}%`;
|
|
1765
|
-
return /* @__PURE__ */
|
|
1766
|
-
(label || !indeterminate && showValue) && /* @__PURE__ */
|
|
1767
|
-
label && /* @__PURE__ */
|
|
1768
|
-
!indeterminate && showValue && /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsxs19("div", { className: ["fe-progress", `fe-progress--${size}`, indeterminate && "fe-progress--indeterminate", className].filter(Boolean).join(" "), style: progressStyle, ...props, children: [
|
|
2073
|
+
(label || !indeterminate && showValue) && /* @__PURE__ */ jsxs19("div", { className: "fe-progress__meta", children: [
|
|
2074
|
+
label && /* @__PURE__ */ jsx21("span", { className: "fe-progress__label", children: label }),
|
|
2075
|
+
!indeterminate && showValue && /* @__PURE__ */ jsx21("output", { className: "fe-progress__value", children: visibleValue })
|
|
1769
2076
|
] }),
|
|
1770
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsx21("div", { className: "fe-progress__track", role: "progressbar", "aria-label": ariaLabel ?? (typeof label === "string" ? label : "Progress"), "aria-valuemin": indeterminate ? void 0 : 0, "aria-valuemax": indeterminate ? void 0 : max, "aria-valuenow": indeterminate ? void 0 : Number(value), "aria-valuetext": indeterminate ? "Loading" : visibleValue, children: /* @__PURE__ */ jsx21("span", { className: "fe-progress__indicator" }) })
|
|
1771
2078
|
] });
|
|
1772
2079
|
}
|
|
1773
2080
|
|
|
1774
2081
|
// packages/chip/src/index.tsx
|
|
1775
|
-
import { jsx as
|
|
2082
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1776
2083
|
var statuses = ["default", "info", "success", "warning", "error", "neutral", "pending", "processing"];
|
|
1777
2084
|
function Chip({ children, status = "default", color, variant = "subtle", dot = false, onRemove, removeLabel = "Remove", className, style, ...props }) {
|
|
1778
2085
|
const usesCustomColor = Boolean(color);
|
|
@@ -1781,16 +2088,16 @@ function Chip({ children, status = "default", color, variant = "subtle", dot = f
|
|
|
1781
2088
|
...style
|
|
1782
2089
|
};
|
|
1783
2090
|
const resolvedStatus = statuses.includes(status) ? status : "default";
|
|
1784
|
-
return /* @__PURE__ */
|
|
1785
|
-
dot && /* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
onRemove && /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ jsxs20("span", { className: ["fe-chip", `fe-chip--${variant}`, `fe-chip--${usesCustomColor ? "custom" : resolvedStatus}`, className].filter(Boolean).join(" "), style: chipStyle, ...props, children: [
|
|
2092
|
+
dot && /* @__PURE__ */ jsx22("span", { className: "fe-chip__dot", "aria-hidden": "true" }),
|
|
2093
|
+
/* @__PURE__ */ jsx22("span", { className: "fe-chip__content", children }),
|
|
2094
|
+
onRemove && /* @__PURE__ */ jsx22(Button, { hierarchy: "tertiary-gray", size: "24", iconOnly: true, icon: /* @__PURE__ */ jsx22(CloseIcon, { size: 14 }), "aria-label": removeLabel, onClick: onRemove, className: "fe-chip__remove" })
|
|
1788
2095
|
] });
|
|
1789
2096
|
}
|
|
1790
2097
|
|
|
1791
2098
|
// packages/message/src/index.tsx
|
|
1792
2099
|
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
1793
|
-
import { jsx as
|
|
2100
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1794
2101
|
var messageId = 0;
|
|
1795
2102
|
var entries = [];
|
|
1796
2103
|
var listeners = /* @__PURE__ */ new Set();
|
|
@@ -1831,14 +2138,14 @@ function Message({ maxCount = 4, closeLabel = "Close notification", className, .
|
|
|
1831
2138
|
listeners.delete(listener);
|
|
1832
2139
|
};
|
|
1833
2140
|
}, []);
|
|
1834
|
-
return /* @__PURE__ */
|
|
1835
|
-
/* @__PURE__ */
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
entry.title && /* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */
|
|
2141
|
+
return /* @__PURE__ */ jsx23("div", { className: ["fe-message-viewport", className].filter(Boolean).join(" "), "aria-live": "polite", ...props, children: visibleEntries.slice(-Math.max(1, maxCount)).map((entry) => /* @__PURE__ */ jsxs21("div", { className: `fe-message fe-message--${entry.severity ?? "info"}`, role: entry.severity === "error" ? "alert" : "status", children: [
|
|
2142
|
+
/* @__PURE__ */ jsx23("span", { className: "fe-message__icon", "aria-hidden": "true", children: icons[entry.severity ?? "info"] }),
|
|
2143
|
+
/* @__PURE__ */ jsxs21("div", { className: "fe-message__body", children: [
|
|
2144
|
+
entry.title && /* @__PURE__ */ jsx23("strong", { className: "fe-message__title", children: entry.title }),
|
|
2145
|
+
/* @__PURE__ */ jsx23("div", { className: "fe-message__content", children: entry.content })
|
|
1839
2146
|
] }),
|
|
1840
|
-
entry.action && /* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
2147
|
+
entry.action && /* @__PURE__ */ jsx23("span", { className: "fe-message__action", children: entry.action }),
|
|
2148
|
+
/* @__PURE__ */ jsx23(Button, { className: "fe-message__close", hierarchy: "tertiary-gray", size: "24", iconOnly: true, icon: "\xD7", "aria-label": closeLabel, onClick: () => dismiss(entry.id) })
|
|
1842
2149
|
] }, entry.id)) });
|
|
1843
2150
|
}
|
|
1844
2151
|
((Message2) => {
|
|
@@ -1853,7 +2160,7 @@ function Message({ maxCount = 4, closeLabel = "Close notification", className, .
|
|
|
1853
2160
|
|
|
1854
2161
|
// packages/snackbar/src/index.tsx
|
|
1855
2162
|
import { useEffect as useEffect8 } from "react";
|
|
1856
|
-
import { jsx as
|
|
2163
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1857
2164
|
function Snackbar({
|
|
1858
2165
|
open,
|
|
1859
2166
|
message: message2,
|
|
@@ -1881,15 +2188,17 @@ function Snackbar({
|
|
|
1881
2188
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
1882
2189
|
}, [open, onClose]);
|
|
1883
2190
|
if (!open) return null;
|
|
1884
|
-
return /* @__PURE__ */
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
-
action && /* @__PURE__ */
|
|
1887
|
-
onClose && /* @__PURE__ */
|
|
2191
|
+
return /* @__PURE__ */ jsx24("div", { className: ["fe-snackbar", `fe-snackbar--${vertical}`, `fe-snackbar--${horizontal}`, className].filter(Boolean).join(" "), ...props, children: /* @__PURE__ */ jsxs22("div", { className: "fe-snackbar__content", role: "status", "aria-live": "polite", children: [
|
|
2192
|
+
/* @__PURE__ */ jsx24("span", { className: "fe-snackbar__message", children: message2 }),
|
|
2193
|
+
action && /* @__PURE__ */ jsx24("span", { className: "fe-snackbar__action", children: action }),
|
|
2194
|
+
onClose && /* @__PURE__ */ jsx24(Button, { className: "fe-snackbar__close", hierarchy: "tertiary-gray", size: "24", iconOnly: true, icon: "\xD7", "aria-label": closeLabel, onClick: () => onClose("closeButton") })
|
|
1888
2195
|
] }) });
|
|
1889
2196
|
}
|
|
1890
2197
|
export {
|
|
1891
2198
|
Button,
|
|
2199
|
+
Checkbox,
|
|
1892
2200
|
ChevronDownIcon,
|
|
2201
|
+
ChevronUpIcon,
|
|
1893
2202
|
Chip,
|
|
1894
2203
|
CloseIcon,
|
|
1895
2204
|
CurrencyInput,
|
|
@@ -1903,6 +2212,8 @@ export {
|
|
|
1903
2212
|
Pagination,
|
|
1904
2213
|
PlusIcon,
|
|
1905
2214
|
ProgressBar,
|
|
2215
|
+
RadioButton,
|
|
2216
|
+
RadioGroup,
|
|
1906
2217
|
SearchIcon,
|
|
1907
2218
|
Selection,
|
|
1908
2219
|
Skeleton,
|