no-frills-ui 0.0.14-rc.1 → 0.0.14-rc.3
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/index.js +446 -225
- package/dist/index.js.map +1 -1
- package/lib-esm/components/Accordion/AccordionStep.js +9 -8
- package/lib-esm/components/Accordion/AccordionStep.js.map +1 -1
- package/lib-esm/components/Chip/Chip.js +5 -4
- package/lib-esm/components/Chip/Chip.js.map +1 -1
- package/lib-esm/components/ChipInput/ChipInput.js +80 -51
- package/lib-esm/components/ChipInput/ChipInput.js.map +1 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.js +2 -2
- package/lib-esm/components/DragAndDrop/DragItem.js +2 -2
- package/lib-esm/components/Drawer/Drawer.d.ts +1 -1
- package/lib-esm/components/Drawer/Drawer.js +2 -3
- package/lib-esm/components/Drawer/Drawer.js.map +1 -1
- package/lib-esm/components/Groups/Group.js +3 -3
- package/lib-esm/components/Groups/Group.js.map +1 -1
- package/lib-esm/components/Input/Checkbox.d.ts +2 -0
- package/lib-esm/components/Input/Checkbox.js +54 -23
- package/lib-esm/components/Input/Checkbox.js.map +1 -1
- package/lib-esm/components/Input/Dropdown.d.ts +2 -0
- package/lib-esm/components/Input/Dropdown.js +123 -59
- package/lib-esm/components/Input/Dropdown.js.map +1 -1
- package/lib-esm/components/Input/Input.js +17 -8
- package/lib-esm/components/Input/Input.js.map +1 -1
- package/lib-esm/components/Input/Radio.d.ts +2 -0
- package/lib-esm/components/Input/Radio.js +22 -10
- package/lib-esm/components/Input/Radio.js.map +1 -1
- package/lib-esm/components/Input/RadioButton.d.ts +2 -0
- package/lib-esm/components/Input/RadioButton.js +21 -9
- package/lib-esm/components/Input/RadioButton.js.map +1 -1
- package/lib-esm/components/Input/Select.js +21 -11
- package/lib-esm/components/Input/Select.js.map +1 -1
- package/lib-esm/components/Input/TextArea.js +17 -8
- package/lib-esm/components/Input/TextArea.js.map +1 -1
- package/lib-esm/components/Input/Toggle.d.ts +2 -0
- package/lib-esm/components/Input/Toggle.js +45 -15
- package/lib-esm/components/Input/Toggle.js.map +1 -1
- package/lib-esm/components/Input/index.d.ts +1 -0
- package/lib-esm/components/Menu/MenuItem.d.ts +1 -1
- package/lib-esm/components/Menu/MenuItem.js +1 -1
- package/lib-esm/components/Menu/MenuItem.js.map +1 -1
- package/lib-esm/components/Modal/Modal.d.ts +1 -1
- package/lib-esm/components/Modal/Modal.js +1 -2
- package/lib-esm/components/Modal/Modal.js.map +1 -1
- package/lib-esm/components/Notification/NotificationManager.js +1 -0
- package/lib-esm/components/Notification/NotificationManager.js.map +1 -1
- package/lib-esm/components/Popover/Popover.d.ts +1 -1
- package/lib-esm/components/Popover/Popover.js +3 -3
- package/lib-esm/components/Popover/Popover.js.map +1 -1
- package/lib-esm/components/Stepper/Stepper.js +14 -5
- package/lib-esm/components/Stepper/Stepper.js.map +1 -1
- package/lib-esm/index.js +1 -1
- package/lib-esm/shared/LayerManager.js +2 -2
- package/lib-esm/shared/styles.d.ts +4 -0
- package/lib-esm/shared/styles.js +10 -6
- package/lib-esm/shared/styles.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -252,21 +252,25 @@ const getThemeValue = (key)=>{
|
|
|
252
252
|
};
|
|
253
253
|
|
|
254
254
|
const Ellipsis = /*#__PURE__*/ styled("span", {
|
|
255
|
-
target: "
|
|
255
|
+
target: "eot8j4m0",
|
|
256
256
|
label: "Ellipsis"
|
|
257
257
|
})("white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:1;");
|
|
258
258
|
const Header$1 = /*#__PURE__*/ styled("div", {
|
|
259
|
-
target: "
|
|
259
|
+
target: "eot8j4m1",
|
|
260
260
|
label: "Header"
|
|
261
261
|
})("padding:10px 15px;line-height:26px;border-bottom:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";font-size:16px;font-weight:bold;");
|
|
262
262
|
const Body$1 = /*#__PURE__*/ styled("div", {
|
|
263
|
-
target: "
|
|
263
|
+
target: "eot8j4m2",
|
|
264
264
|
label: "Body"
|
|
265
|
-
})("padding:0 15px;margin:20px 0;flex:1;overflow:
|
|
265
|
+
})("padding:0 15px;margin:20px 0;flex:1;overflow:visible;");
|
|
266
266
|
const Footer$1 = /*#__PURE__*/ styled("div", {
|
|
267
|
-
target: "
|
|
267
|
+
target: "eot8j4m3",
|
|
268
268
|
label: "Footer"
|
|
269
269
|
})("padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";display:flex;justify-content:flex-end;");
|
|
270
|
+
const ErrorContainer$7 = /*#__PURE__*/ styled("div", {
|
|
271
|
+
target: "eot8j4m4",
|
|
272
|
+
label: "ErrorContainer"
|
|
273
|
+
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
|
|
270
274
|
|
|
271
275
|
var BADGE_TYPE = /*#__PURE__*/ function(BADGE_TYPE) {
|
|
272
276
|
BADGE_TYPE["PRIMARY"] = "primary";
|
|
@@ -322,35 +326,35 @@ const StyledCard = /*#__PURE__*/ styled("div", {
|
|
|
322
326
|
const Card = /*#__PURE__*/ React.forwardRef(CardComponent);
|
|
323
327
|
|
|
324
328
|
const Step$1 = /*#__PURE__*/ styled(Card, {
|
|
325
|
-
target: "
|
|
329
|
+
target: "ex87x7i0",
|
|
326
330
|
label: "Step"
|
|
327
331
|
})("transition:all 0.6s ease;overflow:visible;", (props)=>props.open && `margin: 20px 5px;`);
|
|
328
332
|
const StepHeader = /*#__PURE__*/ styled("button", {
|
|
329
|
-
target: "
|
|
333
|
+
target: "ex87x7i1",
|
|
330
334
|
label: "StepHeader"
|
|
331
335
|
})("padding:20px 15px;display:flex;justify-content:space-between;background:none;border:none;border-radius:10px;width:100%;font-size:inherit;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}& input{appearance:none;margin:0;}", (props)=>props.open && `border-bottom: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};`, " ", (props)=>props.open && `border-radius: 10px 10px 0 0;`, " ", (props)=>props.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`);
|
|
332
336
|
const HeaderContainer = /*#__PURE__*/ styled("div", {
|
|
333
|
-
target: "
|
|
337
|
+
target: "ex87x7i2",
|
|
334
338
|
label: "HeaderContainer"
|
|
335
339
|
})("display:flex;align-items:center;min-width:40px;& svg{vertical-align:top;margin-right:10px;fill:", (props)=>props.open ? getThemeValue(THEME_NAME.PRIMARY) : props.completed ? getThemeValue(THEME_NAME.SUCCESS) : getThemeValue(THEME_NAME.LIGHT_GREY), ";transform:", (props)=>props.open ? 'scale(0.8)' : 'scale(0.6)', ";transition:all 0.3s ease;min-width:24px;}");
|
|
336
340
|
const ExpandContainer = /*#__PURE__*/ styled("div", {
|
|
337
|
-
target: "
|
|
341
|
+
target: "ex87x7i3",
|
|
338
342
|
label: "ExpandContainer"
|
|
339
343
|
})("display:flex;align-items:center;& svg{vertical-align:top;margin-right:10px;transition:all 0.6s ease;fill:currentColor;}", (props)=>props.open ? `& svg { transform: rotate(180deg); }` : '');
|
|
340
344
|
const StepBody = /*#__PURE__*/ styled("div", {
|
|
341
|
-
target: "
|
|
345
|
+
target: "ex87x7i4",
|
|
342
346
|
label: "StepBody"
|
|
343
347
|
})("transition:all 0.6s ease;overflow:hidden;height:", (props)=>props.height || 0, "px;");
|
|
344
348
|
const AccordionBadge = /*#__PURE__*/ styled(Badge, {
|
|
345
|
-
target: "
|
|
349
|
+
target: "ex87x7i5",
|
|
346
350
|
label: "AccordionBadge"
|
|
347
351
|
})("margin-right:15px;");
|
|
348
352
|
const AccordionStepBody = /*#__PURE__*/ styled("div", {
|
|
349
|
-
target: "
|
|
353
|
+
target: "ex87x7i6",
|
|
350
354
|
label: "AccordionStepBody"
|
|
351
355
|
})("padding:20px 15px;");
|
|
352
356
|
const AccordionStepFooter = /*#__PURE__*/ styled("div", {
|
|
353
|
-
target: "
|
|
357
|
+
target: "ex87x7i7",
|
|
354
358
|
label: "AccordionStepFooter"
|
|
355
359
|
})("display:flex;justify-content:flex-end;padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";");
|
|
356
360
|
/**
|
|
@@ -380,6 +384,7 @@ const AccordionStepFooter = /*#__PURE__*/ styled("div", {
|
|
|
380
384
|
completed: completed,
|
|
381
385
|
children: [
|
|
382
386
|
/*#__PURE__*/ jsxRuntime.jsxs(StepHeader, {
|
|
387
|
+
type: "button",
|
|
383
388
|
open: open,
|
|
384
389
|
disabled: disabled,
|
|
385
390
|
onClick: onStepClick,
|
|
@@ -518,12 +523,12 @@ const StyledIconButton = /*#__PURE__*/ styled("button", {
|
|
|
518
523
|
}
|
|
519
524
|
const IconButton = /*#__PURE__*/ React.forwardRef(IconButtonComponent);
|
|
520
525
|
|
|
521
|
-
const Container$
|
|
522
|
-
target: "
|
|
526
|
+
const Container$b = /*#__PURE__*/ styled("span", {
|
|
527
|
+
target: "e3nd8sw0",
|
|
523
528
|
label: "Container"
|
|
524
529
|
})("padding:5px;padding-left:15px;border-radius:16px;background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";display:inline-flex;margin:5px;line-height:20px;align-items:center;");
|
|
525
530
|
const Button$1 = /*#__PURE__*/ styled("button", {
|
|
526
|
-
target: "
|
|
531
|
+
target: "e3nd8sw1",
|
|
527
532
|
label: "Button"
|
|
528
533
|
})("color:", getThemeValue(THEME_NAME.BACKGROUND), ";background-color:", getThemeValue(THEME_NAME.DISABLED), ";border-radius:50%;border:none;padding:4px;display:inline-flex;margin-left:5px;&:focus-within{outline:4px solid ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}");
|
|
529
534
|
/**
|
|
@@ -543,13 +548,14 @@ const Button$1 = /*#__PURE__*/ styled("button", {
|
|
|
543
548
|
e.stopPropagation();
|
|
544
549
|
}
|
|
545
550
|
};
|
|
546
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(Container$
|
|
551
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$b, {
|
|
547
552
|
...rest,
|
|
548
553
|
ref: ref,
|
|
549
554
|
onKeyUp: keyUpHandler,
|
|
550
555
|
children: [
|
|
551
556
|
label,
|
|
552
557
|
/*#__PURE__*/ jsxRuntime.jsx(Button$1, {
|
|
558
|
+
type: "button",
|
|
553
559
|
onClick: onCloseClick,
|
|
554
560
|
onKeyDown: buttonKeyDownHandler,
|
|
555
561
|
"aria-label": closeButtonAriaLabel ?? `Remove ${label}`,
|
|
@@ -578,7 +584,7 @@ const DragContext = React.createContext(null);
|
|
|
578
584
|
target: "ertl9d71",
|
|
579
585
|
label: "DragKnob"
|
|
580
586
|
})("padding-top:8px;cursor:move;touch-action:none;color:", getThemeValue(THEME_NAME.DISABLED), ";");
|
|
581
|
-
/** Container for the children */ const Container$
|
|
587
|
+
/** Container for the children */ const Container$a = /*#__PURE__*/ styled("div", {
|
|
582
588
|
target: "ertl9d72",
|
|
583
589
|
label: "Container"
|
|
584
590
|
})("flex:1;");
|
|
@@ -820,14 +826,14 @@ const DragContext = React.createContext(null);
|
|
|
820
826
|
tabIndex: -1,
|
|
821
827
|
children: /*#__PURE__*/ jsxRuntime.jsx(CheckCircle, {})
|
|
822
828
|
}),
|
|
823
|
-
/*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
829
|
+
/*#__PURE__*/ jsxRuntime.jsx(Container$a, {
|
|
824
830
|
children: children
|
|
825
831
|
})
|
|
826
832
|
]
|
|
827
833
|
});
|
|
828
834
|
}
|
|
829
835
|
|
|
830
|
-
/** Container Component */ const Container$
|
|
836
|
+
/** Container Component */ const Container$9 = /*#__PURE__*/ styled("div", {
|
|
831
837
|
target: "e18d6tqk0",
|
|
832
838
|
label: "Container"
|
|
833
839
|
})("flex:1;display:flex;position:relative;flex-wrap:wrap;flex-direction:", (props)=>props.orientation === ORIENTATION.HORIZONTAL ? 'row' : 'column', ";");
|
|
@@ -930,7 +936,7 @@ const DragContext = React.createContext(null);
|
|
|
930
936
|
setDragOver,
|
|
931
937
|
i18n
|
|
932
938
|
},
|
|
933
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
939
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Container$9, {
|
|
934
940
|
...rest,
|
|
935
941
|
ref: ref,
|
|
936
942
|
orientation: orientation,
|
|
@@ -957,11 +963,16 @@ const DragContext = React.createContext(null);
|
|
|
957
963
|
}
|
|
958
964
|
const DragAndDrop = /*#__PURE__*/ React.forwardRef(DragAndDropComponent);
|
|
959
965
|
|
|
966
|
+
// Container for the ChipInput
|
|
967
|
+
const Container$8 = /*#__PURE__*/ styled("div", {
|
|
968
|
+
target: "e7l19410",
|
|
969
|
+
label: "Container"
|
|
970
|
+
})("margin:10px 5px;");
|
|
960
971
|
// Label component for the ChipInput
|
|
961
972
|
const Label$6 = /*#__PURE__*/ styled("label", {
|
|
962
|
-
target: "
|
|
973
|
+
target: "e7l19411",
|
|
963
974
|
label: "Label"
|
|
964
|
-
})("display:inline-flex;flex-direction:column;flex:1;position:relative;
|
|
975
|
+
})("display:inline-flex;flex-direction:column;flex:1;position:relative;color:inherit;padding:0 8px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";width:", (props)=>typeof props.width === 'number' ? `${props.width}px` : props.width || '250px', ";max-width:100%;&:has(:focus),&:has(:active){border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:has(:focus) > span,&:has(:active) > span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:has(:disabled){border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:has(:disabled) > span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:has(:focus:invalid){border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
|
|
965
976
|
&:has(:invalid) {
|
|
966
977
|
border-color: ${getThemeValue(THEME_NAME.ERROR)};
|
|
967
978
|
}
|
|
@@ -988,13 +999,13 @@ const Label$6 = /*#__PURE__*/ styled("label", {
|
|
|
988
999
|
}
|
|
989
1000
|
` : '');
|
|
990
1001
|
// Error message container
|
|
991
|
-
const ErrorContainer$
|
|
992
|
-
target: "
|
|
1002
|
+
const ErrorContainer$6 = /*#__PURE__*/ styled("div", {
|
|
1003
|
+
target: "e7l19412",
|
|
993
1004
|
label: "ErrorContainer"
|
|
994
1005
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
995
1006
|
// Visually hidden but accessible to screen readers
|
|
996
1007
|
const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
997
|
-
target: "
|
|
1008
|
+
target: "e7l19413",
|
|
998
1009
|
label: "VisuallyHidden"
|
|
999
1010
|
})("position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;& li{list-style:none;}");
|
|
1000
1011
|
/**
|
|
@@ -1010,7 +1021,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1010
1021
|
* />
|
|
1011
1022
|
* ```
|
|
1012
1023
|
*/ function ChipInputComponent(props, ref) {
|
|
1013
|
-
const { value: propValue = [], closeButtonAriaLabel = `Remove {:label}`, addedAnnouncementTemplate = '{:label} was added', removedAnnouncementTemplate = '{:label} was removed' } = props;
|
|
1024
|
+
const { value: propValue = [], onChange: onChangeCallback, label, errorText, closeButtonAriaLabel = `Remove {:label}`, addedAnnouncementTemplate = '{:label} was added', removedAnnouncementTemplate = '{:label} was removed', width, ...inputProps } = props;
|
|
1014
1025
|
const [text, setText] = React.useState('');
|
|
1015
1026
|
const [touched, setTouched] = React.useState(false);
|
|
1016
1027
|
const [value, setValue] = React.useState(propValue || []);
|
|
@@ -1039,21 +1050,28 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1039
1050
|
}, [
|
|
1040
1051
|
propValue
|
|
1041
1052
|
]);
|
|
1053
|
+
React.useEffect(()=>{
|
|
1054
|
+
if (InputRef.current) {
|
|
1055
|
+
InputRef.current.setCustomValidity(errorText || '');
|
|
1056
|
+
}
|
|
1057
|
+
}, [
|
|
1058
|
+
errorText
|
|
1059
|
+
]);
|
|
1042
1060
|
/**
|
|
1043
1061
|
* Update the chip values and notify changes.
|
|
1044
1062
|
* @param newValue The new array of chip values
|
|
1045
1063
|
*/ const updateValue = (newValue)=>{
|
|
1046
1064
|
const deduped = Array.from(new Set(newValue));
|
|
1047
1065
|
setValue(deduped);
|
|
1048
|
-
|
|
1066
|
+
onChangeCallback?.(deduped);
|
|
1049
1067
|
};
|
|
1050
1068
|
/**
|
|
1051
1069
|
* Marks the input as touched on focus.
|
|
1052
1070
|
* @param e React focus event
|
|
1053
1071
|
*/ const handleFocus = (e)=>{
|
|
1054
1072
|
setTouched(true);
|
|
1055
|
-
if (
|
|
1056
|
-
|
|
1073
|
+
if (inputProps.onFocus) {
|
|
1074
|
+
inputProps.onFocus(e);
|
|
1057
1075
|
}
|
|
1058
1076
|
};
|
|
1059
1077
|
/**
|
|
@@ -1065,15 +1083,28 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1065
1083
|
/**
|
|
1066
1084
|
* Adds a new chip on Enter key press.
|
|
1067
1085
|
* @param e React keyboard event
|
|
1068
|
-
*/ const
|
|
1069
|
-
if (e.key === 'Enter'
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1086
|
+
*/ const handleKeyDown = (e)=>{
|
|
1087
|
+
if (e.key === 'Enter') {
|
|
1088
|
+
// Check validity against HTML5 constraints only (ignore custom validity from errorText)
|
|
1089
|
+
let isValid;
|
|
1090
|
+
if (InputRef.current) {
|
|
1091
|
+
InputRef.current.setCustomValidity('');
|
|
1092
|
+
isValid = InputRef.current.checkValidity();
|
|
1093
|
+
InputRef.current.setCustomValidity(errorText || '');
|
|
1094
|
+
}
|
|
1095
|
+
// Only prevent form submission if we have valid text to add as a chip
|
|
1096
|
+
if (text.trim() !== '' && isValid) {
|
|
1097
|
+
e.preventDefault();
|
|
1098
|
+
e.stopPropagation();
|
|
1099
|
+
const newValue = [
|
|
1100
|
+
...value,
|
|
1101
|
+
text.trim()
|
|
1102
|
+
];
|
|
1103
|
+
updateValue(newValue);
|
|
1104
|
+
setText('');
|
|
1105
|
+
setAnnouncement(replacePlaceholder(addedAnnouncementTemplate, text.trim()));
|
|
1106
|
+
}
|
|
1107
|
+
// Otherwise, allow form submission to proceed
|
|
1077
1108
|
}
|
|
1078
1109
|
};
|
|
1079
1110
|
/**
|
|
@@ -1103,42 +1134,46 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1103
1134
|
// Render the component
|
|
1104
1135
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1105
1136
|
children: [
|
|
1106
|
-
/*#__PURE__*/ jsxRuntime.jsxs(
|
|
1107
|
-
text: text,
|
|
1108
|
-
touched: touched,
|
|
1109
|
-
errorText: props.errorText,
|
|
1110
|
-
required: props.required,
|
|
1111
|
-
width: props.width,
|
|
1137
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Container$8, {
|
|
1112
1138
|
children: [
|
|
1113
|
-
/*#__PURE__*/ jsxRuntime.
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1139
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Label$6, {
|
|
1140
|
+
text: text,
|
|
1141
|
+
touched: touched,
|
|
1142
|
+
errorText: errorText,
|
|
1143
|
+
required: inputProps.required,
|
|
1144
|
+
width: width,
|
|
1145
|
+
children: [
|
|
1146
|
+
/*#__PURE__*/ jsxRuntime.jsx("input", {
|
|
1147
|
+
...inputProps,
|
|
1148
|
+
ref: InputRef,
|
|
1149
|
+
value: text,
|
|
1150
|
+
onChange: handleChange,
|
|
1151
|
+
onFocus: handleFocus,
|
|
1152
|
+
onKeyDown: handleKeyDown,
|
|
1153
|
+
required: inputProps.required && value.length === 0,
|
|
1154
|
+
"aria-required": inputProps.required,
|
|
1155
|
+
"aria-invalid": !!errorText,
|
|
1156
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
1157
|
+
}),
|
|
1158
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
1159
|
+
children: value?.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(DragAndDrop, {
|
|
1160
|
+
orientation: ORIENTATION.HORIZONTAL,
|
|
1161
|
+
onDrop: onDrop,
|
|
1162
|
+
children: value.map((chip)=>/*#__PURE__*/ jsxRuntime.jsx(Chip, {
|
|
1163
|
+
label: chip,
|
|
1164
|
+
onCloseClick: ()=>removeChip(chip),
|
|
1165
|
+
closeButtonAriaLabel: replacePlaceholder(closeButtonAriaLabel, chip)
|
|
1166
|
+
}, chip))
|
|
1167
|
+
})
|
|
1168
|
+
}),
|
|
1169
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
1170
|
+
children: label
|
|
1171
|
+
})
|
|
1172
|
+
]
|
|
1138
1173
|
}),
|
|
1139
|
-
|
|
1174
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$6, {
|
|
1140
1175
|
id: errorId,
|
|
1141
|
-
children:
|
|
1176
|
+
children: errorText
|
|
1142
1177
|
})
|
|
1143
1178
|
]
|
|
1144
1179
|
}),
|
|
@@ -1180,7 +1215,7 @@ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
|
|
|
1180
1215
|
[5]: 'bottom: 0; right: 0; justify-content: flex-end;',
|
|
1181
1216
|
[6]: 'top: 0; left: 0; justify-content: center; align-items: center;'
|
|
1182
1217
|
};
|
|
1183
|
-
/** Layer container component. */ const Container$
|
|
1218
|
+
/** Layer container component. */ const Container$7 = /*#__PURE__*/ styled("div", {
|
|
1184
1219
|
target: "e1at2bda0",
|
|
1185
1220
|
label: "Container"
|
|
1186
1221
|
})("position:fixed;display:flex;opacity:0;transition:opacity 0.3s ease;", (props)=>POSITION_STYLE[props.position], " ", (props)=>props.overlay && `
|
|
@@ -1400,7 +1435,7 @@ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
|
|
|
1400
1435
|
if (!divElement) {
|
|
1401
1436
|
return null;
|
|
1402
1437
|
}
|
|
1403
|
-
return /*#__PURE__*/ reactDom.createPortal(/*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
1438
|
+
return /*#__PURE__*/ reactDom.createPortal(/*#__PURE__*/ jsxRuntime.jsx(Container$7, {
|
|
1404
1439
|
...props,
|
|
1405
1440
|
ref: ref,
|
|
1406
1441
|
onClick: overlayClickHandler,
|
|
@@ -1673,11 +1708,11 @@ ConfirmDialog.defaultProps = {
|
|
|
1673
1708
|
};
|
|
1674
1709
|
|
|
1675
1710
|
const Label$5 = /*#__PURE__*/ styled("label", {
|
|
1676
|
-
target: "
|
|
1711
|
+
target: "e1g8e2pu0",
|
|
1677
1712
|
label: "Label"
|
|
1678
1713
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
|
|
1679
1714
|
const TextField$1 = /*#__PURE__*/ styled("input", {
|
|
1680
|
-
target: "
|
|
1715
|
+
target: "e1g8e2pu1",
|
|
1681
1716
|
label: "TextField"
|
|
1682
1717
|
})("outline:none;color:inherit;padding:0 8px;line-height:30px;min-height:30px;width:250px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";&:focus,&:active{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus + span,&:active + span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";padding:0 8px;}&:disabled + span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:focus:invalid{border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
|
|
1683
1718
|
&:invalid {
|
|
@@ -1701,19 +1736,21 @@ const TextField$1 = /*#__PURE__*/ styled("input", {
|
|
|
1701
1736
|
line-height: 14px;
|
|
1702
1737
|
}
|
|
1703
1738
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1704
|
-
const ErrorContainer$
|
|
1705
|
-
target: "
|
|
1739
|
+
const ErrorContainer$5 = /*#__PURE__*/ styled("div", {
|
|
1740
|
+
target: "e1g8e2pu2",
|
|
1706
1741
|
label: "ErrorContainer"
|
|
1707
1742
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1708
1743
|
/**
|
|
1709
1744
|
* Input Component
|
|
1710
1745
|
* @param props - Component props
|
|
1711
1746
|
* @param ref - Ref forwarded to the underlying HTMLInputElement
|
|
1712
|
-
*/ const Input$2 = /*#__PURE__*/ React.forwardRef((props,
|
|
1747
|
+
*/ const Input$2 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1713
1748
|
const [touched, setTouched] = React.useState(false);
|
|
1714
1749
|
const [value, setValue] = React.useState(props.value || '');
|
|
1715
1750
|
const errorId = React.useId();
|
|
1716
1751
|
const prevValueRef = React.useRef(undefined);
|
|
1752
|
+
const internalRef = React.useRef(null);
|
|
1753
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
1717
1754
|
React.useEffect(()=>{
|
|
1718
1755
|
if (props.value !== undefined && props.value !== prevValueRef.current) {
|
|
1719
1756
|
setValue(props.value);
|
|
@@ -1722,6 +1759,13 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1722
1759
|
}, [
|
|
1723
1760
|
props.value
|
|
1724
1761
|
]);
|
|
1762
|
+
React.useEffect(()=>{
|
|
1763
|
+
if (internalRef.current) {
|
|
1764
|
+
internalRef.current.setCustomValidity(props.errorText || '');
|
|
1765
|
+
}
|
|
1766
|
+
}, [
|
|
1767
|
+
props.errorText
|
|
1768
|
+
]);
|
|
1725
1769
|
const handleFocus = (e)=>{
|
|
1726
1770
|
setTouched(true);
|
|
1727
1771
|
if (props.onFocus) {
|
|
@@ -1740,7 +1784,7 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1740
1784
|
children: [
|
|
1741
1785
|
/*#__PURE__*/ jsxRuntime.jsx(TextField$1, {
|
|
1742
1786
|
...props,
|
|
1743
|
-
ref:
|
|
1787
|
+
ref: internalRef,
|
|
1744
1788
|
value: value,
|
|
1745
1789
|
onChange: onChangeHandler,
|
|
1746
1790
|
onFocus: handleFocus,
|
|
@@ -1752,7 +1796,7 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1752
1796
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
1753
1797
|
children: props.label
|
|
1754
1798
|
}),
|
|
1755
|
-
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
1799
|
+
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$5, {
|
|
1756
1800
|
id: errorId,
|
|
1757
1801
|
children: props.errorText
|
|
1758
1802
|
})
|
|
@@ -1762,11 +1806,11 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1762
1806
|
Input$2.displayName = 'Input';
|
|
1763
1807
|
|
|
1764
1808
|
const Label$4 = /*#__PURE__*/ styled("label", {
|
|
1765
|
-
target: "
|
|
1809
|
+
target: "e1towgf50",
|
|
1766
1810
|
label: "Label"
|
|
1767
1811
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
|
|
1768
1812
|
const TextField = /*#__PURE__*/ styled("textarea", {
|
|
1769
|
-
target: "
|
|
1813
|
+
target: "e1towgf51",
|
|
1770
1814
|
label: "TextField"
|
|
1771
1815
|
})("border:none;color:inherit;padding:8px;min-height:150px;min-width:250px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";&:focus,&:active{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus + span,&:active + span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:disabled + span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:focus:invalid{border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
|
|
1772
1816
|
&:invalid {
|
|
@@ -1790,20 +1834,22 @@ const TextField = /*#__PURE__*/ styled("textarea", {
|
|
|
1790
1834
|
line-height: 14px;
|
|
1791
1835
|
}
|
|
1792
1836
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1793
|
-
const ErrorContainer$
|
|
1794
|
-
target: "
|
|
1837
|
+
const ErrorContainer$4 = /*#__PURE__*/ styled("div", {
|
|
1838
|
+
target: "e1towgf52",
|
|
1795
1839
|
label: "ErrorContainer"
|
|
1796
1840
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1797
1841
|
/**
|
|
1798
1842
|
* TextArea Component
|
|
1799
1843
|
* @param props - Component props
|
|
1800
1844
|
* @param ref - Ref forwarded to the underlying HTMLTextAreaElement
|
|
1801
|
-
*/ function TextAreaComponent(props,
|
|
1845
|
+
*/ function TextAreaComponent(props, forwardedRef) {
|
|
1802
1846
|
const { label, errorText, value: propsValue, required, ...rest } = props;
|
|
1803
1847
|
const [touched, setTouched] = React.useState(false);
|
|
1804
1848
|
const [value, setValue] = React.useState(propsValue || '');
|
|
1805
1849
|
const errorId = React.useId();
|
|
1806
1850
|
const prevValueRef = React.useRef(undefined);
|
|
1851
|
+
const internalRef = React.useRef(null);
|
|
1852
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
1807
1853
|
React.useEffect(()=>{
|
|
1808
1854
|
if (propsValue !== undefined && propsValue !== prevValueRef.current) {
|
|
1809
1855
|
setValue(propsValue);
|
|
@@ -1812,6 +1858,13 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1812
1858
|
}, [
|
|
1813
1859
|
propsValue
|
|
1814
1860
|
]);
|
|
1861
|
+
React.useEffect(()=>{
|
|
1862
|
+
if (internalRef.current) {
|
|
1863
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
1864
|
+
}
|
|
1865
|
+
}, [
|
|
1866
|
+
errorText
|
|
1867
|
+
]);
|
|
1815
1868
|
const handleFocus = (e)=>{
|
|
1816
1869
|
setTouched(true);
|
|
1817
1870
|
if (props.onFocus) {
|
|
@@ -1830,7 +1883,7 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1830
1883
|
children: [
|
|
1831
1884
|
/*#__PURE__*/ jsxRuntime.jsx(TextField, {
|
|
1832
1885
|
...rest,
|
|
1833
|
-
ref:
|
|
1886
|
+
ref: internalRef,
|
|
1834
1887
|
value: value,
|
|
1835
1888
|
onChange: onChangeHandler,
|
|
1836
1889
|
onFocus: handleFocus,
|
|
@@ -1843,7 +1896,7 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1843
1896
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
1844
1897
|
children: label
|
|
1845
1898
|
}),
|
|
1846
|
-
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
1899
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$4, {
|
|
1847
1900
|
id: errorId,
|
|
1848
1901
|
children: errorText
|
|
1849
1902
|
})
|
|
@@ -1853,11 +1906,11 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1853
1906
|
const TextArea = /*#__PURE__*/ React.forwardRef(TextAreaComponent);
|
|
1854
1907
|
|
|
1855
1908
|
const Label$3 = /*#__PURE__*/ styled("label", {
|
|
1856
|
-
target: "
|
|
1909
|
+
target: "e1trg58l0",
|
|
1857
1910
|
label: "Label"
|
|
1858
1911
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;pointer-events:none;max-width:268px;& svg{fill:currentColor;}");
|
|
1859
1912
|
const SelectField = /*#__PURE__*/ styled("select", {
|
|
1860
|
-
target: "
|
|
1913
|
+
target: "e1trg58l1",
|
|
1861
1914
|
label: "SelectField"
|
|
1862
1915
|
})("border:none;color:inherit;padding:0 8px;line-height:30px;min-height:32px;width:268px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";pointer-events:auto;appearance:none;&:focus,&:active{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus ~ span,&:active ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:focus:invalid{border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
|
|
1863
1916
|
&:invalid {
|
|
@@ -1881,31 +1934,41 @@ const SelectField = /*#__PURE__*/ styled("select", {
|
|
|
1881
1934
|
line-height: 14px;
|
|
1882
1935
|
}
|
|
1883
1936
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1884
|
-
const ErrorContainer$
|
|
1885
|
-
target: "
|
|
1937
|
+
const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
1938
|
+
target: "e1trg58l2",
|
|
1886
1939
|
label: "ErrorContainer"
|
|
1887
1940
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1888
1941
|
const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
1889
|
-
target: "
|
|
1942
|
+
target: "e1trg58l3",
|
|
1890
1943
|
label: "ArrowContainer"
|
|
1891
1944
|
})("position:absolute;right:8px;top:8px;");
|
|
1892
1945
|
/**
|
|
1893
1946
|
* Select Component
|
|
1894
1947
|
* @param props - Component props
|
|
1895
1948
|
* @param ref - Ref forwarded to the underlying HTMLSelectElement
|
|
1896
|
-
*/ function SelectComponent(props,
|
|
1949
|
+
*/ function SelectComponent(props, forwardedRef) {
|
|
1897
1950
|
const [touched, setTouched] = React.useState(false);
|
|
1898
1951
|
const [value, setValue] = React.useState(props.value || '');
|
|
1899
1952
|
const errorId = React.useId();
|
|
1900
1953
|
const prevValueRef = React.useRef(undefined);
|
|
1954
|
+
const internalRef = React.useRef(null);
|
|
1955
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
1956
|
+
// Sync prop value with state
|
|
1901
1957
|
React.useEffect(()=>{
|
|
1902
|
-
if (props.value !==
|
|
1903
|
-
setValue(props.value);
|
|
1958
|
+
if (props.value !== prevValueRef.current) {
|
|
1959
|
+
setValue(props.value || '');
|
|
1904
1960
|
prevValueRef.current = props.value;
|
|
1905
1961
|
}
|
|
1906
1962
|
}, [
|
|
1907
1963
|
props.value
|
|
1908
1964
|
]);
|
|
1965
|
+
React.useEffect(()=>{
|
|
1966
|
+
if (internalRef.current) {
|
|
1967
|
+
internalRef.current.setCustomValidity(props.errorText || '');
|
|
1968
|
+
}
|
|
1969
|
+
}, [
|
|
1970
|
+
props.errorText
|
|
1971
|
+
]);
|
|
1909
1972
|
const handleFocus = (e)=>{
|
|
1910
1973
|
setTouched(true);
|
|
1911
1974
|
if (props.onFocus) {
|
|
@@ -1924,7 +1987,7 @@ const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
|
1924
1987
|
children: [
|
|
1925
1988
|
/*#__PURE__*/ jsxRuntime.jsxs(SelectField, {
|
|
1926
1989
|
...props,
|
|
1927
|
-
ref:
|
|
1990
|
+
ref: internalRef,
|
|
1928
1991
|
multiple: false,
|
|
1929
1992
|
value: value,
|
|
1930
1993
|
onChange: onChangeHandler,
|
|
@@ -1945,7 +2008,7 @@ const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
|
1945
2008
|
"aria-hidden": "true",
|
|
1946
2009
|
children: /*#__PURE__*/ jsxRuntime.jsx(ExpandMore, {})
|
|
1947
2010
|
}),
|
|
1948
|
-
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
2011
|
+
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$3, {
|
|
1949
2012
|
id: errorId,
|
|
1950
2013
|
children: props.errorText
|
|
1951
2014
|
})
|
|
@@ -1955,50 +2018,81 @@ const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
|
1955
2018
|
const Select = /*#__PURE__*/ React.forwardRef(SelectComponent);
|
|
1956
2019
|
|
|
1957
2020
|
const Label$2 = /*#__PURE__*/ styled("label", {
|
|
1958
|
-
target: "
|
|
2021
|
+
target: "e74kvzt0",
|
|
1959
2022
|
label: "Label"
|
|
1960
2023
|
})("margin:5px 0;position:relative;display:inline-flex;align-items:center;cursor:pointer;");
|
|
1961
2024
|
const StyledCheckmark = /*#__PURE__*/ styled("span", {
|
|
1962
|
-
target: "
|
|
2025
|
+
target: "e74kvzt1",
|
|
1963
2026
|
label: "StyledCheckmark"
|
|
1964
2027
|
})("width:16px;height:16px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;border-radius:3px;margin-right:5px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:all 0.3s ease;position:relative;flex-shrink:0;&::after{content:'';width:3px;height:10px;border-right:2px solid ", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-bottom:2px solid ", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";position:absolute;top:1px;left:6px;opacity:0;transform:rotate(45deg) scale(0);transition:all 0.2s ease;}");
|
|
1965
2028
|
const HiddenInput$1 = /*#__PURE__*/ styled("input", {
|
|
1966
|
-
target: "
|
|
2029
|
+
target: "e74kvzt2",
|
|
1967
2030
|
label: "HiddenInput"
|
|
1968
2031
|
})("opacity:0;width:0;height:0;position:absolute;margin:0;&:checked + ", StyledCheckmark, "{background-color:", getThemeValue(THEME_NAME.PRIMARY), ";border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:checked + ", StyledCheckmark, "::after{opacity:1;transform:rotate(45deg) scale(1);}&:indeterminate + ", StyledCheckmark, "{background-color:", getThemeValue(THEME_NAME.PRIMARY), ";border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:indeterminate + ", StyledCheckmark, "::after{opacity:1;height:0;width:8px;border-right:none;border-bottom:2px solid ", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";transform:rotate(0deg) scale(1);top:7px;left:4px;}&:enabled:active + ", StyledCheckmark, ",&:focus + ", StyledCheckmark, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:active ~ span,&:focus ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover + ", StyledCheckmark, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled + ", StyledCheckmark, "{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";cursor:not-allowed;}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED), ";cursor:not-allowed;}&:checked:disabled + ", StyledCheckmark, ",&:indeterminate:disabled + ", StyledCheckmark, "{background-color:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
2032
|
+
const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
2033
|
+
target: "e74kvzt3",
|
|
2034
|
+
label: "ErrorContainer"
|
|
2035
|
+
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
|
|
2036
|
+
const Container$6 = /*#__PURE__*/ styled("div", {
|
|
2037
|
+
target: "e74kvzt4",
|
|
2038
|
+
label: "Container"
|
|
2039
|
+
})("display:inline-flex;flex-direction:column;");
|
|
1969
2040
|
/**
|
|
1970
2041
|
* Checkbox Component
|
|
1971
2042
|
* @param props - Component props
|
|
1972
2043
|
* @param fwdRef - Ref forwarded to the underlying HTMLInputElement
|
|
1973
2044
|
*/ function CheckboxComponent(props, fwdRef) {
|
|
1974
|
-
const { label = '', indeterminate = false, checked, ...rest } = props;
|
|
2045
|
+
const { label = '', indeterminate = false, checked, errorText, ...rest } = props;
|
|
2046
|
+
const internalRef = React.useRef(null);
|
|
2047
|
+
const errorId = React.useId();
|
|
2048
|
+
React.useImperativeHandle(fwdRef, ()=>internalRef.current);
|
|
2049
|
+
React.useEffect(()=>{
|
|
2050
|
+
if (internalRef.current) {
|
|
2051
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2052
|
+
}
|
|
2053
|
+
}, [
|
|
2054
|
+
errorText
|
|
2055
|
+
]);
|
|
1975
2056
|
const ref = React.useCallback((node)=>{
|
|
2057
|
+
internalRef.current = node;
|
|
1976
2058
|
// Ensure the DOM `indeterminate` flag always matches the prop
|
|
1977
2059
|
if (node) {
|
|
1978
2060
|
node.indeterminate = !!indeterminate;
|
|
1979
2061
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2062
|
+
// Forward the node (or null) to the parent ref (supports function or ref object)
|
|
2063
|
+
// Note: Since we use useImperativeHandle now, we don't technically need to manually forward here
|
|
2064
|
+
// if we weren't doing the ref callback pattern for indeterminate.
|
|
2065
|
+
// However, useImperativeHandle handles the forwarding.
|
|
2066
|
+
// BUT, our local ref callback `ref` is passed to the input `ref={ref}`.
|
|
2067
|
+
// React will call this callback with the node.
|
|
2068
|
+
// Inside this callback, we set internalRef.current.
|
|
2069
|
+
// useImperativeHandle exposes internalRef.current to fwdRef.
|
|
2070
|
+
// So we don't need manual forwarding logic here anymore!
|
|
1986
2071
|
}, [
|
|
1987
|
-
indeterminate
|
|
1988
|
-
fwdRef
|
|
2072
|
+
indeterminate
|
|
1989
2073
|
]);
|
|
1990
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(
|
|
2074
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$6, {
|
|
1991
2075
|
children: [
|
|
1992
|
-
/*#__PURE__*/ jsxRuntime.
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2076
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Label$2, {
|
|
2077
|
+
children: [
|
|
2078
|
+
/*#__PURE__*/ jsxRuntime.jsx(HiddenInput$1, {
|
|
2079
|
+
...rest,
|
|
2080
|
+
ref: ref,
|
|
2081
|
+
type: "checkbox",
|
|
2082
|
+
checked: checked,
|
|
2083
|
+
"aria-checked": indeterminate ? 'mixed' : checked,
|
|
2084
|
+
"aria-invalid": !!errorText,
|
|
2085
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2086
|
+
}),
|
|
2087
|
+
/*#__PURE__*/ jsxRuntime.jsx(StyledCheckmark, {}),
|
|
2088
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2089
|
+
children: label
|
|
2090
|
+
})
|
|
2091
|
+
]
|
|
1998
2092
|
}),
|
|
1999
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
2000
|
-
|
|
2001
|
-
children:
|
|
2093
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$2, {
|
|
2094
|
+
id: errorId,
|
|
2095
|
+
children: errorText
|
|
2002
2096
|
})
|
|
2003
2097
|
]
|
|
2004
2098
|
});
|
|
@@ -2006,30 +2100,60 @@ const HiddenInput$1 = /*#__PURE__*/ styled("input", {
|
|
|
2006
2100
|
const Checkbox = /*#__PURE__*/ React.forwardRef(CheckboxComponent);
|
|
2007
2101
|
|
|
2008
2102
|
const Switch = /*#__PURE__*/ styled("label", {
|
|
2009
|
-
target: "
|
|
2103
|
+
target: "ecxpw850",
|
|
2010
2104
|
label: "Switch"
|
|
2011
2105
|
})("position:relative;display:inline-flex;margin:5px 0;");
|
|
2012
2106
|
const Input$1 = /*#__PURE__*/ styled("input", {
|
|
2013
|
-
target: "
|
|
2107
|
+
target: "ecxpw851",
|
|
2014
2108
|
label: "Input"
|
|
2015
2109
|
})("position:absolute;width:0;height:0;appearance:none;margin:0;& + span{position:relative;cursor:pointer;width:30px;height:18px;background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";transition:0.4s;border-radius:10px;padding:0 3px;margin:0 10px 0 5px;}& + span:before{position:absolute;content:'';height:14px;width:14px;left:1px;top:1px;border:1px solid ", getThemeValue(THEME_NAME.DISABLED_BORDER), ";border-radius:50%;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:0.4s;}&:checked + span{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:checked + span:before{transform:translateX(18px);border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:focus + span:before{box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover ~ span{cursor:pointer;color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}&:disabled + span{background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";cursor:not-allowed;}&:disabled + span:before{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}");
|
|
2110
|
+
const ErrorContainer$1 = /*#__PURE__*/ styled("div", {
|
|
2111
|
+
target: "ecxpw852",
|
|
2112
|
+
label: "ErrorContainer"
|
|
2113
|
+
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
|
|
2114
|
+
const Container$5 = /*#__PURE__*/ styled("div", {
|
|
2115
|
+
target: "ecxpw853",
|
|
2116
|
+
label: "Container"
|
|
2117
|
+
})("display:inline-flex;flex-direction:column;");
|
|
2016
2118
|
/**
|
|
2017
2119
|
* Toggle Component
|
|
2018
2120
|
* @param props - Component props
|
|
2019
|
-
* @param
|
|
2020
|
-
*/ function ToggleComponent(props,
|
|
2021
|
-
|
|
2121
|
+
* @param forwardedRef - Ref forwarded to the underlying HTMLInputElement
|
|
2122
|
+
*/ function ToggleComponent(props, forwardedRef) {
|
|
2123
|
+
const { label, errorText, ...rest } = props;
|
|
2124
|
+
const internalRef = React.useRef(null);
|
|
2125
|
+
const errorId = React.useId();
|
|
2126
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
2127
|
+
React.useEffect(()=>{
|
|
2128
|
+
if (internalRef.current) {
|
|
2129
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2130
|
+
}
|
|
2131
|
+
}, [
|
|
2132
|
+
errorText
|
|
2133
|
+
]);
|
|
2134
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$5, {
|
|
2022
2135
|
children: [
|
|
2023
|
-
/*#__PURE__*/ jsxRuntime.
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2136
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Switch, {
|
|
2137
|
+
children: [
|
|
2138
|
+
/*#__PURE__*/ jsxRuntime.jsx(Input$1, {
|
|
2139
|
+
...rest,
|
|
2140
|
+
ref: internalRef,
|
|
2141
|
+
type: "checkbox",
|
|
2142
|
+
role: "switch",
|
|
2143
|
+
"aria-checked": props.checked,
|
|
2144
|
+
"aria-invalid": !!errorText,
|
|
2145
|
+
"aria-label": label,
|
|
2146
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2147
|
+
}),
|
|
2148
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {}),
|
|
2149
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2150
|
+
children: label
|
|
2151
|
+
})
|
|
2152
|
+
]
|
|
2029
2153
|
}),
|
|
2030
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
2031
|
-
|
|
2032
|
-
children:
|
|
2154
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$1, {
|
|
2155
|
+
id: errorId,
|
|
2156
|
+
children: errorText
|
|
2033
2157
|
})
|
|
2034
2158
|
]
|
|
2035
2159
|
});
|
|
@@ -2037,29 +2161,41 @@ const Input$1 = /*#__PURE__*/ styled("input", {
|
|
|
2037
2161
|
const Toggle = /*#__PURE__*/ React.forwardRef(ToggleComponent);
|
|
2038
2162
|
|
|
2039
2163
|
const Label$1 = /*#__PURE__*/ styled("label", {
|
|
2040
|
-
target: "
|
|
2164
|
+
target: "edovkv60",
|
|
2041
2165
|
label: "Label"
|
|
2042
|
-
})("display:inline-flex;align-items:center;margin:5px 0;cursor:pointer;position:relative;");
|
|
2166
|
+
})("display:inline-flex;align-items:center;margin:5px 10px 5px 0;cursor:pointer;position:relative;");
|
|
2043
2167
|
const StyledRadio = /*#__PURE__*/ styled("span", {
|
|
2044
|
-
target: "
|
|
2168
|
+
target: "edovkv61",
|
|
2045
2169
|
label: "StyledRadio"
|
|
2046
2170
|
})("width:16px;height:16px;margin-right:5px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:50%;display:block;transition:background-color 0.3s ease;position:relative;flex-shrink:0;&::after{content:'';width:100%;height:100%;border-radius:50%;position:absolute;top:0;left:0;box-shadow:inset 0 0 0 3px ", getThemeValue(THEME_NAME.BACKGROUND), ";opacity:0;transition:opacity 0.2s ease;}");
|
|
2047
2171
|
const HiddenInput = /*#__PURE__*/ styled("input", {
|
|
2048
|
-
target: "
|
|
2172
|
+
target: "edovkv62",
|
|
2049
2173
|
label: "HiddenInput"
|
|
2050
2174
|
})("opacity:0;width:0;height:0;position:absolute;margin:0;&:checked + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";background-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:checked + ", StyledRadio, "::after{opacity:1;}&:enabled:focus + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:checked:focus + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:hover + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";cursor:not-allowed;}&:disabled:checked + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";cursor:not-allowed;}");
|
|
2051
2175
|
/**
|
|
2052
2176
|
* Radio Component
|
|
2053
2177
|
* @param props - Component props
|
|
2054
|
-
* @param
|
|
2055
|
-
*/ function RadioComponent(props,
|
|
2056
|
-
const { label, ...rest } = props;
|
|
2178
|
+
* @param forwardedRef - Ref forwarded to the underlying HTMLInputElement
|
|
2179
|
+
*/ function RadioComponent(props, forwardedRef) {
|
|
2180
|
+
const { label, errorText, ...rest } = props;
|
|
2181
|
+
const internalRef = React.useRef(null);
|
|
2182
|
+
const errorId = React.useId();
|
|
2183
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
2184
|
+
React.useEffect(()=>{
|
|
2185
|
+
if (internalRef.current) {
|
|
2186
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2187
|
+
}
|
|
2188
|
+
}, [
|
|
2189
|
+
errorText
|
|
2190
|
+
]);
|
|
2057
2191
|
return /*#__PURE__*/ jsxRuntime.jsxs(Label$1, {
|
|
2058
2192
|
children: [
|
|
2059
2193
|
/*#__PURE__*/ jsxRuntime.jsx(HiddenInput, {
|
|
2060
2194
|
...rest,
|
|
2061
|
-
ref:
|
|
2062
|
-
type: "radio"
|
|
2195
|
+
ref: internalRef,
|
|
2196
|
+
type: "radio",
|
|
2197
|
+
"aria-invalid": !!errorText,
|
|
2198
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2063
2199
|
}),
|
|
2064
2200
|
/*#__PURE__*/ jsxRuntime.jsx(StyledRadio, {}),
|
|
2065
2201
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
@@ -2071,29 +2207,41 @@ const HiddenInput = /*#__PURE__*/ styled("input", {
|
|
|
2071
2207
|
const Radio = /*#__PURE__*/ React.forwardRef(RadioComponent);
|
|
2072
2208
|
|
|
2073
2209
|
const Input = /*#__PURE__*/ styled("input", {
|
|
2074
|
-
target: "
|
|
2210
|
+
target: "e76n0060",
|
|
2075
2211
|
label: "Input"
|
|
2076
2212
|
})("appearance:none;margin:0;width:0;& + span{color:", getThemeValue(THEME_NAME.PRIMARY), ";padding:6px 12px;border:none;border:1px solid ", getThemeValue(THEME_NAME.PRIMARY), ";cursor:pointer;margin-right:-1px;line-height:18px;}&:enabled:focus + span{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:hover + span{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";}&:enabled:checked + span{background-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";}&:disabled + span{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}&:disabled:checked + span{background-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";}");
|
|
2077
2213
|
const Label = /*#__PURE__*/ styled("label", {
|
|
2078
|
-
target: "
|
|
2214
|
+
target: "e76n0061",
|
|
2079
2215
|
label: "Label"
|
|
2080
2216
|
})("display:inline-flex;&:focus-within{z-index:1;}");
|
|
2081
2217
|
const RadioGroup = /*#__PURE__*/ styled("div", {
|
|
2082
|
-
target: "
|
|
2218
|
+
target: "e76n0062",
|
|
2083
2219
|
label: "RadioGroup"
|
|
2084
|
-
})("display:inline-flex;align-items:center;border-radius:3px;margin:5px 0;& ", Label, ":first-
|
|
2220
|
+
})("display:inline-flex;align-items:center;border-radius:3px;margin:5px 0;& > ", Label, ":first-of-type > span{border-radius:3px 0 0 3px;}& > ", Label, ":last-of-type > span{border-radius:0 3px 3px 0;}");
|
|
2085
2221
|
/**
|
|
2086
2222
|
* RadioButton Component
|
|
2087
2223
|
* @param props - Component props
|
|
2088
|
-
* @param
|
|
2089
|
-
*/ function RadioButtonComponent(props,
|
|
2090
|
-
const { label, ...rest } = props;
|
|
2224
|
+
* @param forwardedRef - Ref forwarded to the underlying HTMLInputElement
|
|
2225
|
+
*/ function RadioButtonComponent(props, forwardedRef) {
|
|
2226
|
+
const { label, errorText, ...rest } = props;
|
|
2227
|
+
const internalRef = React.useRef(null);
|
|
2228
|
+
const errorId = React.useId();
|
|
2229
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
2230
|
+
React.useEffect(()=>{
|
|
2231
|
+
if (internalRef.current) {
|
|
2232
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2233
|
+
}
|
|
2234
|
+
}, [
|
|
2235
|
+
errorText
|
|
2236
|
+
]);
|
|
2091
2237
|
return /*#__PURE__*/ jsxRuntime.jsxs(Label, {
|
|
2092
2238
|
children: [
|
|
2093
2239
|
/*#__PURE__*/ jsxRuntime.jsx(Input, {
|
|
2094
2240
|
...rest,
|
|
2095
2241
|
type: "radio",
|
|
2096
|
-
ref:
|
|
2242
|
+
ref: internalRef,
|
|
2243
|
+
"aria-invalid": !!errorText,
|
|
2244
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2097
2245
|
}),
|
|
2098
2246
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2099
2247
|
children: label
|
|
@@ -2234,7 +2382,7 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
|
|
|
2234
2382
|
const Menu = /*#__PURE__*/ React.forwardRef(MenuInner);
|
|
2235
2383
|
|
|
2236
2384
|
const Container$4 = /*#__PURE__*/ styled("button", {
|
|
2237
|
-
target: "
|
|
2385
|
+
target: "e1u7wt750",
|
|
2238
2386
|
label: "Container"
|
|
2239
2387
|
})("font-weight:", (props)=>props.selected ? 'bold' : 'normal', ";padding:8px;border:none;border-left:4px solid\n ", (props)=>props.selected && !props.multiselect ? getThemeValue(THEME_NAME.TEXT_COLOR_DARK) : 'transparent', ";background-color:transparent;font-size:16px;border-bottom:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";min-height:41px;display:flex;align-items:center;cursor:pointer;position:relative;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:hover,&:focus,&:focus-within{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";}& > label{margin:0 4px 0 0;}");
|
|
2240
2388
|
/**
|
|
@@ -2307,11 +2455,11 @@ const positionMap$2 = {
|
|
|
2307
2455
|
`
|
|
2308
2456
|
};
|
|
2309
2457
|
const PopoverDiv = /*#__PURE__*/ styled("div", {
|
|
2310
|
-
target: "
|
|
2458
|
+
target: "e13swao70",
|
|
2311
2459
|
label: "PopoverDiv"
|
|
2312
2460
|
})("position:relative;display:inline-flex;");
|
|
2313
2461
|
const Popper = /*#__PURE__*/ styled(Card, {
|
|
2314
|
-
target: "
|
|
2462
|
+
target: "e13swao71",
|
|
2315
2463
|
label: "Popper"
|
|
2316
2464
|
})("position:absolute;width:100%;min-width:200px;overflow:auto;animation:enter 0.3s linear;border-radius:3px;z-index:1;transform:translate(", (props)=>props.translateX, "px,", (props)=>props.translateY, "px);", (props)=>positionMap$2[props.position], " &.closing{animation:exit 0.3s linear;}@keyframes enter{from{max-height:0px;opacity:1;overflow:hidden;}to{max-height:300px;opacity:1;overflow:hidden;}}@keyframes exit{to{max-height:0px;opacity:1;overflow:hidden;}from{max-height:300px;opacity:1;overflow:hidden;}}");
|
|
2317
2465
|
const KEY_CODES = {
|
|
@@ -2490,7 +2638,7 @@ const KEY_CODES = {
|
|
|
2490
2638
|
ref: forwardRef,
|
|
2491
2639
|
...rest,
|
|
2492
2640
|
children: [
|
|
2493
|
-
/*#__PURE__*/ React.
|
|
2641
|
+
/*#__PURE__*/ React.cloneElement(element, {
|
|
2494
2642
|
ref: triggerRef,
|
|
2495
2643
|
id: triggerId,
|
|
2496
2644
|
'aria-expanded': open,
|
|
@@ -2520,9 +2668,63 @@ const KEY_CODES = {
|
|
|
2520
2668
|
const Popover = /*#__PURE__*/ React.forwardRef(PopoverComponent);
|
|
2521
2669
|
|
|
2522
2670
|
const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
2523
|
-
target: "
|
|
2671
|
+
target: "eph6dat0",
|
|
2524
2672
|
label: "ArrowContainer"
|
|
2525
2673
|
})("position:absolute;right:12px;top:16px;pointer-events:none;");
|
|
2674
|
+
/**
|
|
2675
|
+
* DropdownTrigger Component
|
|
2676
|
+
*/ const DropdownTrigger = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
2677
|
+
const { displayValue, label, errorText, open, menuId, toggleOpen, onKeyDown, forwardedRef, ...rest } = props;
|
|
2678
|
+
const triggerRef = React.useRef(null);
|
|
2679
|
+
// Helper to assign both internal triggerRef and external forwarded ref
|
|
2680
|
+
const assignRefs = React.useCallback((node)=>{
|
|
2681
|
+
triggerRef.current = node;
|
|
2682
|
+
if (!forwardedRef) return;
|
|
2683
|
+
if (typeof forwardedRef === 'function') {
|
|
2684
|
+
forwardedRef(node);
|
|
2685
|
+
} else {
|
|
2686
|
+
forwardedRef.current = node;
|
|
2687
|
+
}
|
|
2688
|
+
}, [
|
|
2689
|
+
forwardedRef
|
|
2690
|
+
]);
|
|
2691
|
+
// Combine the ref passed by parent with our assignRefs so both are updated
|
|
2692
|
+
const combinedRef = React.useCallback((node)=>{
|
|
2693
|
+
assignRefs(node);
|
|
2694
|
+
if (typeof ref === 'function') {
|
|
2695
|
+
ref(node);
|
|
2696
|
+
} else if (ref) {
|
|
2697
|
+
ref.current = node;
|
|
2698
|
+
}
|
|
2699
|
+
}, [
|
|
2700
|
+
assignRefs,
|
|
2701
|
+
ref
|
|
2702
|
+
]);
|
|
2703
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2704
|
+
children: [
|
|
2705
|
+
/*#__PURE__*/ jsxRuntime.jsx(Input$2, {
|
|
2706
|
+
...rest,
|
|
2707
|
+
ref: combinedRef,
|
|
2708
|
+
type: "text",
|
|
2709
|
+
value: displayValue,
|
|
2710
|
+
label: label,
|
|
2711
|
+
errorText: errorText,
|
|
2712
|
+
onClick: toggleOpen,
|
|
2713
|
+
onKeyDown: onKeyDown,
|
|
2714
|
+
inputMode: "none",
|
|
2715
|
+
role: "combobox",
|
|
2716
|
+
"aria-haspopup": "listbox",
|
|
2717
|
+
"aria-expanded": open,
|
|
2718
|
+
"aria-controls": menuId
|
|
2719
|
+
}),
|
|
2720
|
+
/*#__PURE__*/ jsxRuntime.jsx(ArrowContainer, {
|
|
2721
|
+
"aria-hidden": "true",
|
|
2722
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ExpandMore, {})
|
|
2723
|
+
})
|
|
2724
|
+
]
|
|
2725
|
+
});
|
|
2726
|
+
});
|
|
2727
|
+
DropdownTrigger.displayName = 'DropdownTrigger';
|
|
2526
2728
|
/**
|
|
2527
2729
|
* Dropdown component that allows selection from a list of options.
|
|
2528
2730
|
* Supports single and multi-select modes.
|
|
@@ -2530,11 +2732,6 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2530
2732
|
* @template T - The type of the value(s) in the dropdown.
|
|
2531
2733
|
* @param props - The properties for the Dropdown component.
|
|
2532
2734
|
* @returns The rendered Dropdown component.
|
|
2533
|
-
*/ /**
|
|
2534
|
-
* Dropdown Component
|
|
2535
|
-
* @template T - The type of value(s) in the dropdown.
|
|
2536
|
-
* @param props - Component props
|
|
2537
|
-
* @param outerRef - Ref forwarded to the underlying HTMLInputElement
|
|
2538
2735
|
*/ function DropdownComponent(props, outerRef) {
|
|
2539
2736
|
const { multiSelect = false, onChange, children, value: propValue, label, errorText, required, disabled, ...rest } = props;
|
|
2540
2737
|
const [open, setOpen] = React.useState(false);
|
|
@@ -2543,6 +2740,42 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2543
2740
|
const menuId = `${id}-menu`;
|
|
2544
2741
|
const menuRef = React.useRef(null);
|
|
2545
2742
|
const triggerRef = React.useRef(null);
|
|
2743
|
+
/**
|
|
2744
|
+
* Gets the display value for the dropdown based on the current value and children.
|
|
2745
|
+
*
|
|
2746
|
+
* @param currentValue - The current value of the dropdown.
|
|
2747
|
+
* @param currentChildren - The children of the dropdown.
|
|
2748
|
+
* @returns The display value.
|
|
2749
|
+
*/ const getDisplayValue = (currentValue, currentChildren)=>{
|
|
2750
|
+
if (currentValue === undefined || currentValue === null) return '';
|
|
2751
|
+
const findLabel = (val)=>{
|
|
2752
|
+
let label = '';
|
|
2753
|
+
React.Children.forEach(currentChildren, (child)=>{
|
|
2754
|
+
if (/*#__PURE__*/ React.isValidElement(child)) {
|
|
2755
|
+
const props = child.props;
|
|
2756
|
+
if ('value' in props && props.value === val) {
|
|
2757
|
+
label = String(props.children);
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
});
|
|
2761
|
+
return label;
|
|
2762
|
+
};
|
|
2763
|
+
if (Array.isArray(currentValue)) {
|
|
2764
|
+
return currentValue.map(findLabel).filter(Boolean).join(', ');
|
|
2765
|
+
}
|
|
2766
|
+
return findLabel(currentValue);
|
|
2767
|
+
};
|
|
2768
|
+
const displayValue = getDisplayValue(value, children) || (value ? String(value) : '');
|
|
2769
|
+
// Sync prop value with state
|
|
2770
|
+
const prevValueRef = React.useRef(undefined);
|
|
2771
|
+
React.useEffect(()=>{
|
|
2772
|
+
if (propValue !== prevValueRef.current) {
|
|
2773
|
+
setValue(propValue);
|
|
2774
|
+
prevValueRef.current = propValue;
|
|
2775
|
+
}
|
|
2776
|
+
}, [
|
|
2777
|
+
propValue
|
|
2778
|
+
]);
|
|
2546
2779
|
// Focus menu when opened
|
|
2547
2780
|
React.useEffect(()=>{
|
|
2548
2781
|
if (open) {
|
|
@@ -2564,7 +2797,7 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2564
2797
|
* Opens the menu on 'Enter', 'Space', 'ArrowDown', or 'ArrowUp'.
|
|
2565
2798
|
*
|
|
2566
2799
|
* @param {React.KeyboardEvent<HTMLInputElement>} e - The keyboard event.
|
|
2567
|
-
*/ const onKeyDown = (e)=>{
|
|
2800
|
+
*/ const onKeyDown = React.useCallback((e)=>{
|
|
2568
2801
|
if ([
|
|
2569
2802
|
'ArrowDown',
|
|
2570
2803
|
'ArrowUp',
|
|
@@ -2573,8 +2806,11 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2573
2806
|
].includes(e.key)) {
|
|
2574
2807
|
e.preventDefault();
|
|
2575
2808
|
setOpen(true);
|
|
2809
|
+
} else if (e.key !== 'Tab') {
|
|
2810
|
+
// Prevent typing to mimic readOnly behavior while allowing native validation
|
|
2811
|
+
e.preventDefault();
|
|
2576
2812
|
}
|
|
2577
|
-
};
|
|
2813
|
+
}, []);
|
|
2578
2814
|
/**
|
|
2579
2815
|
* Handles changes to the dropdown value.
|
|
2580
2816
|
* Updates local state and calls the external onChange handler.
|
|
@@ -2592,59 +2828,35 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2592
2828
|
};
|
|
2593
2829
|
/**
|
|
2594
2830
|
* Toggles the dropdown open state on click.
|
|
2595
|
-
*/ const clickHandler = ()=>setOpen(true);
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
const combinedRef = (node)=>{
|
|
2609
|
-
assignRefs(node);
|
|
2610
|
-
if (typeof ref === 'function') {
|
|
2611
|
-
ref(node);
|
|
2612
|
-
} else if (ref) {
|
|
2613
|
-
ref.current = node;
|
|
2614
|
-
}
|
|
2615
|
-
};
|
|
2616
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2617
|
-
children: [
|
|
2618
|
-
/*#__PURE__*/ jsxRuntime.jsx(Input$2, {
|
|
2619
|
-
...rest,
|
|
2620
|
-
...passedProps,
|
|
2621
|
-
ref: combinedRef,
|
|
2622
|
-
type: "text",
|
|
2623
|
-
value: value && String(value),
|
|
2624
|
-
label: label,
|
|
2625
|
-
errorText: errorText,
|
|
2626
|
-
onClick: clickHandler,
|
|
2627
|
-
onKeyDown: onKeyDown,
|
|
2628
|
-
required: required,
|
|
2629
|
-
disabled: disabled,
|
|
2630
|
-
readOnly: true,
|
|
2631
|
-
role: "combobox",
|
|
2632
|
-
"aria-haspopup": "listbox",
|
|
2633
|
-
"aria-expanded": open,
|
|
2634
|
-
"aria-controls": menuId
|
|
2635
|
-
}),
|
|
2636
|
-
/*#__PURE__*/ jsxRuntime.jsx(ArrowContainer, {
|
|
2637
|
-
"aria-hidden": "true",
|
|
2638
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ExpandMore, {})
|
|
2639
|
-
})
|
|
2640
|
-
]
|
|
2641
|
-
});
|
|
2642
|
-
});
|
|
2643
|
-
TriggerElement.displayName = 'DropdownTrigger';
|
|
2831
|
+
*/ const clickHandler = React.useCallback(()=>setOpen(true), []);
|
|
2832
|
+
/**
|
|
2833
|
+
* Forwarded ref handler for the trigger input.
|
|
2834
|
+
*/ const handleForwardedRef = React.useCallback((node)=>{
|
|
2835
|
+
triggerRef.current = node;
|
|
2836
|
+
if (typeof outerRef === 'function') {
|
|
2837
|
+
outerRef(node);
|
|
2838
|
+
} else if (outerRef) {
|
|
2839
|
+
outerRef.current = node;
|
|
2840
|
+
}
|
|
2841
|
+
}, [
|
|
2842
|
+
outerRef
|
|
2843
|
+
]);
|
|
2644
2844
|
return /*#__PURE__*/ jsxRuntime.jsx(Popover, {
|
|
2645
2845
|
position: POPOVER_POSITION.BOTTOM_LEFT,
|
|
2646
2846
|
open: open,
|
|
2647
|
-
element:
|
|
2847
|
+
element: /*#__PURE__*/ jsxRuntime.jsx(DropdownTrigger, {
|
|
2848
|
+
...rest,
|
|
2849
|
+
displayValue: displayValue,
|
|
2850
|
+
label: label,
|
|
2851
|
+
errorText: errorText,
|
|
2852
|
+
open: open,
|
|
2853
|
+
menuId: menuId,
|
|
2854
|
+
toggleOpen: clickHandler,
|
|
2855
|
+
onKeyDown: onKeyDown,
|
|
2856
|
+
required: required,
|
|
2857
|
+
disabled: disabled,
|
|
2858
|
+
forwardedRef: handleForwardedRef
|
|
2859
|
+
}),
|
|
2648
2860
|
onClose: ()=>{
|
|
2649
2861
|
setOpen(false);
|
|
2650
2862
|
triggerRef.current?.focus();
|
|
@@ -2781,7 +2993,7 @@ const positionStyle$1 = (size)=>({
|
|
|
2781
2993
|
}
|
|
2782
2994
|
});
|
|
2783
2995
|
const DrawerDiv = /*#__PURE__*/ styled("div", {
|
|
2784
|
-
target: "
|
|
2996
|
+
target: "e1qyfyr80",
|
|
2785
2997
|
label: "DrawerDiv"
|
|
2786
2998
|
})("display:flex;flex-direction:column;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:transform 0.3s ease;box-shadow:", getThemeValue(THEME_NAME.MODAL_SHADOW), ";", (props)=>positionStyle$1(props.size)[props.position].before, " .nf-layer-enter &{transform:translateX(0%);", (props)=>positionStyle$1(props.size)[props.position].after, "}");
|
|
2787
2999
|
const positionMap$1 = {
|
|
@@ -2819,7 +3031,7 @@ class Drawer extends React.Component {
|
|
|
2819
3031
|
/**
|
|
2820
3032
|
* Lifecycle method to handle Drawer updates.
|
|
2821
3033
|
* Manages opening/closing logic via LayerManager and focus preservation.
|
|
2822
|
-
*/
|
|
3034
|
+
*/ componentDidUpdate(prevProps) {
|
|
2823
3035
|
const { open } = this.props;
|
|
2824
3036
|
if (prevProps.open && !open) {
|
|
2825
3037
|
this.closeCallback?.();
|
|
@@ -2830,7 +3042,6 @@ class Drawer extends React.Component {
|
|
|
2830
3042
|
this.lastFocusedElement = document.activeElement;
|
|
2831
3043
|
this.handleOpen();
|
|
2832
3044
|
}
|
|
2833
|
-
return null;
|
|
2834
3045
|
}
|
|
2835
3046
|
/**
|
|
2836
3047
|
* Renders the Drawer component via the LayerManager portal.
|
|
@@ -2974,9 +3185,9 @@ Drawer.defaultProps = {
|
|
|
2974
3185
|
};
|
|
2975
3186
|
|
|
2976
3187
|
const Container$3 = /*#__PURE__*/ styled("div", {
|
|
2977
|
-
target: "
|
|
3188
|
+
target: "e1m58trk0",
|
|
2978
3189
|
label: "Container"
|
|
2979
|
-
})("display:inline-flex;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:3px;margin:5px;& button,& label{margin:0;border:none;border-radius:0;border-left:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";box-shadow:none;height:32px;}& > div button{border-left:none;}& input,& select{border:none;height:32px;}& input,& select{border-radius:0;}& input:active,& select:active{box-shadow:none;}& > div > span{top:8px;}& > *:first-
|
|
3190
|
+
})("display:inline-flex;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:3px;margin:5px;& button,& label{margin:0;border:none;border-radius:0;border-left:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";box-shadow:none;height:32px;}& > div button{border-left:none;}& input,& select{border:none;height:32px;}& input,& select{border-radius:0;}& input:active,& select:active{box-shadow:none;}& > div > span{top:8px;}& > *:first-of-type,& > label:first-of-type input,& > label:first-of-type select,& > *:first-of-type label,& > *:first-of-type input{border-left:none;border-radius:2px 0 0 2px;}& > *:last-child,& > label:last-child input,& > label:last-child select,& > *:last-child label,& > *:last-child input{border-radius:0 2px 2px 0;}& *:focus,& *:focus + span{z-index:1;}&:focus-within,&:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}", (props)=>props.errorText ? `
|
|
2980
3191
|
border-color: ${getThemeValue(THEME_NAME.ERROR)};
|
|
2981
3192
|
|
|
2982
3193
|
& > button, & > label {
|
|
@@ -2984,7 +3195,7 @@ const Container$3 = /*#__PURE__*/ styled("div", {
|
|
|
2984
3195
|
}
|
|
2985
3196
|
` : '');
|
|
2986
3197
|
const ErrorContainer = /*#__PURE__*/ styled("div", {
|
|
2987
|
-
target: "
|
|
3198
|
+
target: "e1m58trk1",
|
|
2988
3199
|
label: "ErrorContainer"
|
|
2989
3200
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
|
|
2990
3201
|
/**
|
|
@@ -3051,7 +3262,7 @@ class Modal extends React.Component {
|
|
|
3051
3262
|
/**
|
|
3052
3263
|
* Lifecycle method to handle Modal updates.
|
|
3053
3264
|
* Manages opening/closing logic via LayerManager and focus preservation.
|
|
3054
|
-
*/
|
|
3265
|
+
*/ componentDidUpdate(prevProps) {
|
|
3055
3266
|
const { open } = this.props;
|
|
3056
3267
|
if (prevProps.open && !open) {
|
|
3057
3268
|
this.closeCallback?.();
|
|
@@ -3062,7 +3273,6 @@ class Modal extends React.Component {
|
|
|
3062
3273
|
this.lastFocusedElement = document.activeElement;
|
|
3063
3274
|
this.handleOpen();
|
|
3064
3275
|
}
|
|
3065
|
-
return null;
|
|
3066
3276
|
}
|
|
3067
3277
|
/**
|
|
3068
3278
|
* Renders the Modal component via the LayerManager portal.
|
|
@@ -3374,6 +3584,7 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3374
3584
|
]
|
|
3375
3585
|
}),
|
|
3376
3586
|
/*#__PURE__*/ jsxRuntime.jsx(CloseButton, {
|
|
3587
|
+
type: "button",
|
|
3377
3588
|
onClick: this.closeClickHandler(id),
|
|
3378
3589
|
"aria-label": closeButtonAriaLabel || 'Close notification',
|
|
3379
3590
|
tabIndex: 0,
|
|
@@ -3630,19 +3841,19 @@ const SpinnerDiv = /*#__PURE__*/ styled("div", {
|
|
|
3630
3841
|
const Spinner = /*#__PURE__*/ React.forwardRef(SpinnerComponent);
|
|
3631
3842
|
|
|
3632
3843
|
const Container$1 = /*#__PURE__*/ styled("div", {
|
|
3633
|
-
target: "
|
|
3844
|
+
target: "er9cpfq0",
|
|
3634
3845
|
label: "Container"
|
|
3635
3846
|
})("flex:1;display:flex;flex-direction:column;min-height:400px;");
|
|
3636
3847
|
const Header = /*#__PURE__*/ styled("div", {
|
|
3637
|
-
target: "
|
|
3848
|
+
target: "er9cpfq1",
|
|
3638
3849
|
label: "Header"
|
|
3639
3850
|
})("display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";@media (min-width:601px){&::before{position:absolute;top:25px;left:0;right:0;height:2px;background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";content:' ';z-index:0;}}& > *{z-index:1;}");
|
|
3640
3851
|
const HeaderButton = /*#__PURE__*/ styled("button", {
|
|
3641
|
-
target: "
|
|
3852
|
+
target: "er9cpfq2",
|
|
3642
3853
|
label: "HeaderButton"
|
|
3643
3854
|
})("border:none;padding:16px 24px 16px 16px;font-size:16px;cursor:pointer;background-color:", (props)=>props.active ? getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR) : getThemeValue(THEME_NAME.BACKGROUND), ";font-weight:", (props)=>props.active ? 'bold' : 'normal', ";overflow:hidden;display:flex;align-items:center;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:disabled{cursor:not-allowed;background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:enabled:hover,&:focus{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHTER), ";}@media (max-width:600px){&{display:none;}}");
|
|
3644
3855
|
const MobileHeader = /*#__PURE__*/ styled("div", {
|
|
3645
|
-
target: "
|
|
3856
|
+
target: "er9cpfq3",
|
|
3646
3857
|
label: "MobileHeader"
|
|
3647
3858
|
})("padding:16px;font-size:16px;line-height:18px;align-items:center;font-weight:bold;flex:1;display:flex;flex-direction:row;justify-content:space-between;@media (min-width:601px){&{display:none;}}");
|
|
3648
3859
|
/**
|
|
@@ -3654,6 +3865,15 @@ const MobileHeader = /*#__PURE__*/ styled("div", {
|
|
|
3654
3865
|
const [active, setActive] = React.useState(propsActive);
|
|
3655
3866
|
const childrenArray = React.Children.toArray(children);
|
|
3656
3867
|
const stepRefs = [];
|
|
3868
|
+
const prevActiveRef = React.useRef(null);
|
|
3869
|
+
React.useEffect(()=>{
|
|
3870
|
+
if (prevActiveRef.current !== propsActive) {
|
|
3871
|
+
setActive(propsActive);
|
|
3872
|
+
}
|
|
3873
|
+
prevActiveRef.current = propsActive;
|
|
3874
|
+
}, [
|
|
3875
|
+
propsActive
|
|
3876
|
+
]);
|
|
3657
3877
|
const stepClickHandler = (index)=>()=>{
|
|
3658
3878
|
setActive(index);
|
|
3659
3879
|
onStepClick?.(index);
|
|
@@ -4188,6 +4408,7 @@ exports.DrawerBody = Body$1;
|
|
|
4188
4408
|
exports.DrawerFooter = Footer$1;
|
|
4189
4409
|
exports.DrawerHeader = Header$1;
|
|
4190
4410
|
exports.Dropdown = Dropdown;
|
|
4411
|
+
exports.ErrorContainer = ErrorContainer$7;
|
|
4191
4412
|
exports.Group = Group;
|
|
4192
4413
|
exports.GroupLabel = GroupLabel;
|
|
4193
4414
|
exports.IconButton = IconButton;
|