no-frills-ui 0.0.14-rc.1 → 0.0.14-rc.2
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 +365 -169
- package/dist/index.js.map +1 -1
- package/lib-esm/components/Chip/Chip.js +2 -2
- package/lib-esm/components/ChipInput/ChipInput.js +12 -5
- 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/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";
|
|
@@ -518,7 +522,7 @@ const StyledIconButton = /*#__PURE__*/ styled("button", {
|
|
|
518
522
|
}
|
|
519
523
|
const IconButton = /*#__PURE__*/ React.forwardRef(IconButtonComponent);
|
|
520
524
|
|
|
521
|
-
const Container$
|
|
525
|
+
const Container$a = /*#__PURE__*/ styled("span", {
|
|
522
526
|
target: "eg8hsap0",
|
|
523
527
|
label: "Container"
|
|
524
528
|
})("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;");
|
|
@@ -543,7 +547,7 @@ const Button$1 = /*#__PURE__*/ styled("button", {
|
|
|
543
547
|
e.stopPropagation();
|
|
544
548
|
}
|
|
545
549
|
};
|
|
546
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(Container$
|
|
550
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$a, {
|
|
547
551
|
...rest,
|
|
548
552
|
ref: ref,
|
|
549
553
|
onKeyUp: keyUpHandler,
|
|
@@ -578,7 +582,7 @@ const DragContext = React.createContext(null);
|
|
|
578
582
|
target: "ertl9d71",
|
|
579
583
|
label: "DragKnob"
|
|
580
584
|
})("padding-top:8px;cursor:move;touch-action:none;color:", getThemeValue(THEME_NAME.DISABLED), ";");
|
|
581
|
-
/** Container for the children */ const Container$
|
|
585
|
+
/** Container for the children */ const Container$9 = /*#__PURE__*/ styled("div", {
|
|
582
586
|
target: "ertl9d72",
|
|
583
587
|
label: "Container"
|
|
584
588
|
})("flex:1;");
|
|
@@ -820,14 +824,14 @@ const DragContext = React.createContext(null);
|
|
|
820
824
|
tabIndex: -1,
|
|
821
825
|
children: /*#__PURE__*/ jsxRuntime.jsx(CheckCircle, {})
|
|
822
826
|
}),
|
|
823
|
-
/*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
827
|
+
/*#__PURE__*/ jsxRuntime.jsx(Container$9, {
|
|
824
828
|
children: children
|
|
825
829
|
})
|
|
826
830
|
]
|
|
827
831
|
});
|
|
828
832
|
}
|
|
829
833
|
|
|
830
|
-
/** Container Component */ const Container$
|
|
834
|
+
/** Container Component */ const Container$8 = /*#__PURE__*/ styled("div", {
|
|
831
835
|
target: "e18d6tqk0",
|
|
832
836
|
label: "Container"
|
|
833
837
|
})("flex:1;display:flex;position:relative;flex-wrap:wrap;flex-direction:", (props)=>props.orientation === ORIENTATION.HORIZONTAL ? 'row' : 'column', ";");
|
|
@@ -930,7 +934,7 @@ const DragContext = React.createContext(null);
|
|
|
930
934
|
setDragOver,
|
|
931
935
|
i18n
|
|
932
936
|
},
|
|
933
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
937
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Container$8, {
|
|
934
938
|
...rest,
|
|
935
939
|
ref: ref,
|
|
936
940
|
orientation: orientation,
|
|
@@ -959,7 +963,7 @@ const DragAndDrop = /*#__PURE__*/ React.forwardRef(DragAndDropComponent);
|
|
|
959
963
|
|
|
960
964
|
// Label component for the ChipInput
|
|
961
965
|
const Label$6 = /*#__PURE__*/ styled("label", {
|
|
962
|
-
target: "
|
|
966
|
+
target: "e1pr4bi70",
|
|
963
967
|
label: "Label"
|
|
964
968
|
})("display:inline-flex;flex-direction:column;flex:1;position:relative;margin:10px 5px;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
969
|
&:has(:invalid) {
|
|
@@ -988,13 +992,13 @@ const Label$6 = /*#__PURE__*/ styled("label", {
|
|
|
988
992
|
}
|
|
989
993
|
` : '');
|
|
990
994
|
// Error message container
|
|
991
|
-
const ErrorContainer$
|
|
992
|
-
target: "
|
|
995
|
+
const ErrorContainer$6 = /*#__PURE__*/ styled("div", {
|
|
996
|
+
target: "e1pr4bi71",
|
|
993
997
|
label: "ErrorContainer"
|
|
994
998
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
995
999
|
// Visually hidden but accessible to screen readers
|
|
996
1000
|
const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
997
|
-
target: "
|
|
1001
|
+
target: "e1pr4bi72",
|
|
998
1002
|
label: "VisuallyHidden"
|
|
999
1003
|
})("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
1004
|
/**
|
|
@@ -1039,6 +1043,13 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1039
1043
|
}, [
|
|
1040
1044
|
propValue
|
|
1041
1045
|
]);
|
|
1046
|
+
React.useEffect(()=>{
|
|
1047
|
+
if (InputRef.current) {
|
|
1048
|
+
InputRef.current.setCustomValidity(props.errorText || '');
|
|
1049
|
+
}
|
|
1050
|
+
}, [
|
|
1051
|
+
props.errorText
|
|
1052
|
+
]);
|
|
1042
1053
|
/**
|
|
1043
1054
|
* Update the chip values and notify changes.
|
|
1044
1055
|
* @param newValue The new array of chip values
|
|
@@ -1136,7 +1147,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1136
1147
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
1137
1148
|
children: props.label
|
|
1138
1149
|
}),
|
|
1139
|
-
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
1150
|
+
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$6, {
|
|
1140
1151
|
id: errorId,
|
|
1141
1152
|
children: props.errorText
|
|
1142
1153
|
})
|
|
@@ -1180,7 +1191,7 @@ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
|
|
|
1180
1191
|
[5]: 'bottom: 0; right: 0; justify-content: flex-end;',
|
|
1181
1192
|
[6]: 'top: 0; left: 0; justify-content: center; align-items: center;'
|
|
1182
1193
|
};
|
|
1183
|
-
/** Layer container component. */ const Container$
|
|
1194
|
+
/** Layer container component. */ const Container$7 = /*#__PURE__*/ styled("div", {
|
|
1184
1195
|
target: "e1at2bda0",
|
|
1185
1196
|
label: "Container"
|
|
1186
1197
|
})("position:fixed;display:flex;opacity:0;transition:opacity 0.3s ease;", (props)=>POSITION_STYLE[props.position], " ", (props)=>props.overlay && `
|
|
@@ -1400,7 +1411,7 @@ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
|
|
|
1400
1411
|
if (!divElement) {
|
|
1401
1412
|
return null;
|
|
1402
1413
|
}
|
|
1403
|
-
return /*#__PURE__*/ reactDom.createPortal(/*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
1414
|
+
return /*#__PURE__*/ reactDom.createPortal(/*#__PURE__*/ jsxRuntime.jsx(Container$7, {
|
|
1404
1415
|
...props,
|
|
1405
1416
|
ref: ref,
|
|
1406
1417
|
onClick: overlayClickHandler,
|
|
@@ -1673,11 +1684,11 @@ ConfirmDialog.defaultProps = {
|
|
|
1673
1684
|
};
|
|
1674
1685
|
|
|
1675
1686
|
const Label$5 = /*#__PURE__*/ styled("label", {
|
|
1676
|
-
target: "
|
|
1687
|
+
target: "e1g8e2pu0",
|
|
1677
1688
|
label: "Label"
|
|
1678
1689
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
|
|
1679
1690
|
const TextField$1 = /*#__PURE__*/ styled("input", {
|
|
1680
|
-
target: "
|
|
1691
|
+
target: "e1g8e2pu1",
|
|
1681
1692
|
label: "TextField"
|
|
1682
1693
|
})("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
1694
|
&:invalid {
|
|
@@ -1701,19 +1712,21 @@ const TextField$1 = /*#__PURE__*/ styled("input", {
|
|
|
1701
1712
|
line-height: 14px;
|
|
1702
1713
|
}
|
|
1703
1714
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1704
|
-
const ErrorContainer$
|
|
1705
|
-
target: "
|
|
1715
|
+
const ErrorContainer$5 = /*#__PURE__*/ styled("div", {
|
|
1716
|
+
target: "e1g8e2pu2",
|
|
1706
1717
|
label: "ErrorContainer"
|
|
1707
1718
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1708
1719
|
/**
|
|
1709
1720
|
* Input Component
|
|
1710
1721
|
* @param props - Component props
|
|
1711
1722
|
* @param ref - Ref forwarded to the underlying HTMLInputElement
|
|
1712
|
-
*/ const Input$2 = /*#__PURE__*/ React.forwardRef((props,
|
|
1723
|
+
*/ const Input$2 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1713
1724
|
const [touched, setTouched] = React.useState(false);
|
|
1714
1725
|
const [value, setValue] = React.useState(props.value || '');
|
|
1715
1726
|
const errorId = React.useId();
|
|
1716
1727
|
const prevValueRef = React.useRef(undefined);
|
|
1728
|
+
const internalRef = React.useRef(null);
|
|
1729
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
1717
1730
|
React.useEffect(()=>{
|
|
1718
1731
|
if (props.value !== undefined && props.value !== prevValueRef.current) {
|
|
1719
1732
|
setValue(props.value);
|
|
@@ -1722,6 +1735,13 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1722
1735
|
}, [
|
|
1723
1736
|
props.value
|
|
1724
1737
|
]);
|
|
1738
|
+
React.useEffect(()=>{
|
|
1739
|
+
if (internalRef.current) {
|
|
1740
|
+
internalRef.current.setCustomValidity(props.errorText || '');
|
|
1741
|
+
}
|
|
1742
|
+
}, [
|
|
1743
|
+
props.errorText
|
|
1744
|
+
]);
|
|
1725
1745
|
const handleFocus = (e)=>{
|
|
1726
1746
|
setTouched(true);
|
|
1727
1747
|
if (props.onFocus) {
|
|
@@ -1740,7 +1760,7 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1740
1760
|
children: [
|
|
1741
1761
|
/*#__PURE__*/ jsxRuntime.jsx(TextField$1, {
|
|
1742
1762
|
...props,
|
|
1743
|
-
ref:
|
|
1763
|
+
ref: internalRef,
|
|
1744
1764
|
value: value,
|
|
1745
1765
|
onChange: onChangeHandler,
|
|
1746
1766
|
onFocus: handleFocus,
|
|
@@ -1752,7 +1772,7 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1752
1772
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
1753
1773
|
children: props.label
|
|
1754
1774
|
}),
|
|
1755
|
-
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
1775
|
+
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$5, {
|
|
1756
1776
|
id: errorId,
|
|
1757
1777
|
children: props.errorText
|
|
1758
1778
|
})
|
|
@@ -1762,11 +1782,11 @@ const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
|
1762
1782
|
Input$2.displayName = 'Input';
|
|
1763
1783
|
|
|
1764
1784
|
const Label$4 = /*#__PURE__*/ styled("label", {
|
|
1765
|
-
target: "
|
|
1785
|
+
target: "e1towgf50",
|
|
1766
1786
|
label: "Label"
|
|
1767
1787
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
|
|
1768
1788
|
const TextField = /*#__PURE__*/ styled("textarea", {
|
|
1769
|
-
target: "
|
|
1789
|
+
target: "e1towgf51",
|
|
1770
1790
|
label: "TextField"
|
|
1771
1791
|
})("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
1792
|
&:invalid {
|
|
@@ -1790,20 +1810,22 @@ const TextField = /*#__PURE__*/ styled("textarea", {
|
|
|
1790
1810
|
line-height: 14px;
|
|
1791
1811
|
}
|
|
1792
1812
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1793
|
-
const ErrorContainer$
|
|
1794
|
-
target: "
|
|
1813
|
+
const ErrorContainer$4 = /*#__PURE__*/ styled("div", {
|
|
1814
|
+
target: "e1towgf52",
|
|
1795
1815
|
label: "ErrorContainer"
|
|
1796
1816
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1797
1817
|
/**
|
|
1798
1818
|
* TextArea Component
|
|
1799
1819
|
* @param props - Component props
|
|
1800
1820
|
* @param ref - Ref forwarded to the underlying HTMLTextAreaElement
|
|
1801
|
-
*/ function TextAreaComponent(props,
|
|
1821
|
+
*/ function TextAreaComponent(props, forwardedRef) {
|
|
1802
1822
|
const { label, errorText, value: propsValue, required, ...rest } = props;
|
|
1803
1823
|
const [touched, setTouched] = React.useState(false);
|
|
1804
1824
|
const [value, setValue] = React.useState(propsValue || '');
|
|
1805
1825
|
const errorId = React.useId();
|
|
1806
1826
|
const prevValueRef = React.useRef(undefined);
|
|
1827
|
+
const internalRef = React.useRef(null);
|
|
1828
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
1807
1829
|
React.useEffect(()=>{
|
|
1808
1830
|
if (propsValue !== undefined && propsValue !== prevValueRef.current) {
|
|
1809
1831
|
setValue(propsValue);
|
|
@@ -1812,6 +1834,13 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1812
1834
|
}, [
|
|
1813
1835
|
propsValue
|
|
1814
1836
|
]);
|
|
1837
|
+
React.useEffect(()=>{
|
|
1838
|
+
if (internalRef.current) {
|
|
1839
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
1840
|
+
}
|
|
1841
|
+
}, [
|
|
1842
|
+
errorText
|
|
1843
|
+
]);
|
|
1815
1844
|
const handleFocus = (e)=>{
|
|
1816
1845
|
setTouched(true);
|
|
1817
1846
|
if (props.onFocus) {
|
|
@@ -1830,7 +1859,7 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1830
1859
|
children: [
|
|
1831
1860
|
/*#__PURE__*/ jsxRuntime.jsx(TextField, {
|
|
1832
1861
|
...rest,
|
|
1833
|
-
ref:
|
|
1862
|
+
ref: internalRef,
|
|
1834
1863
|
value: value,
|
|
1835
1864
|
onChange: onChangeHandler,
|
|
1836
1865
|
onFocus: handleFocus,
|
|
@@ -1843,7 +1872,7 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1843
1872
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
1844
1873
|
children: label
|
|
1845
1874
|
}),
|
|
1846
|
-
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
1875
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$4, {
|
|
1847
1876
|
id: errorId,
|
|
1848
1877
|
children: errorText
|
|
1849
1878
|
})
|
|
@@ -1853,11 +1882,11 @@ const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
|
1853
1882
|
const TextArea = /*#__PURE__*/ React.forwardRef(TextAreaComponent);
|
|
1854
1883
|
|
|
1855
1884
|
const Label$3 = /*#__PURE__*/ styled("label", {
|
|
1856
|
-
target: "
|
|
1885
|
+
target: "e1trg58l0",
|
|
1857
1886
|
label: "Label"
|
|
1858
1887
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;pointer-events:none;max-width:268px;& svg{fill:currentColor;}");
|
|
1859
1888
|
const SelectField = /*#__PURE__*/ styled("select", {
|
|
1860
|
-
target: "
|
|
1889
|
+
target: "e1trg58l1",
|
|
1861
1890
|
label: "SelectField"
|
|
1862
1891
|
})("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
1892
|
&:invalid {
|
|
@@ -1881,31 +1910,41 @@ const SelectField = /*#__PURE__*/ styled("select", {
|
|
|
1881
1910
|
line-height: 14px;
|
|
1882
1911
|
}
|
|
1883
1912
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1884
|
-
const ErrorContainer$
|
|
1885
|
-
target: "
|
|
1913
|
+
const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
1914
|
+
target: "e1trg58l2",
|
|
1886
1915
|
label: "ErrorContainer"
|
|
1887
1916
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1888
1917
|
const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
1889
|
-
target: "
|
|
1918
|
+
target: "e1trg58l3",
|
|
1890
1919
|
label: "ArrowContainer"
|
|
1891
1920
|
})("position:absolute;right:8px;top:8px;");
|
|
1892
1921
|
/**
|
|
1893
1922
|
* Select Component
|
|
1894
1923
|
* @param props - Component props
|
|
1895
1924
|
* @param ref - Ref forwarded to the underlying HTMLSelectElement
|
|
1896
|
-
*/ function SelectComponent(props,
|
|
1925
|
+
*/ function SelectComponent(props, forwardedRef) {
|
|
1897
1926
|
const [touched, setTouched] = React.useState(false);
|
|
1898
1927
|
const [value, setValue] = React.useState(props.value || '');
|
|
1899
1928
|
const errorId = React.useId();
|
|
1900
1929
|
const prevValueRef = React.useRef(undefined);
|
|
1930
|
+
const internalRef = React.useRef(null);
|
|
1931
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
1932
|
+
// Sync prop value with state
|
|
1901
1933
|
React.useEffect(()=>{
|
|
1902
|
-
if (props.value !==
|
|
1903
|
-
setValue(props.value);
|
|
1934
|
+
if (props.value !== prevValueRef.current) {
|
|
1935
|
+
setValue(props.value || '');
|
|
1904
1936
|
prevValueRef.current = props.value;
|
|
1905
1937
|
}
|
|
1906
1938
|
}, [
|
|
1907
1939
|
props.value
|
|
1908
1940
|
]);
|
|
1941
|
+
React.useEffect(()=>{
|
|
1942
|
+
if (internalRef.current) {
|
|
1943
|
+
internalRef.current.setCustomValidity(props.errorText || '');
|
|
1944
|
+
}
|
|
1945
|
+
}, [
|
|
1946
|
+
props.errorText
|
|
1947
|
+
]);
|
|
1909
1948
|
const handleFocus = (e)=>{
|
|
1910
1949
|
setTouched(true);
|
|
1911
1950
|
if (props.onFocus) {
|
|
@@ -1924,7 +1963,7 @@ const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
|
1924
1963
|
children: [
|
|
1925
1964
|
/*#__PURE__*/ jsxRuntime.jsxs(SelectField, {
|
|
1926
1965
|
...props,
|
|
1927
|
-
ref:
|
|
1966
|
+
ref: internalRef,
|
|
1928
1967
|
multiple: false,
|
|
1929
1968
|
value: value,
|
|
1930
1969
|
onChange: onChangeHandler,
|
|
@@ -1945,7 +1984,7 @@ const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
|
1945
1984
|
"aria-hidden": "true",
|
|
1946
1985
|
children: /*#__PURE__*/ jsxRuntime.jsx(ExpandMore, {})
|
|
1947
1986
|
}),
|
|
1948
|
-
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$
|
|
1987
|
+
props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$3, {
|
|
1949
1988
|
id: errorId,
|
|
1950
1989
|
children: props.errorText
|
|
1951
1990
|
})
|
|
@@ -1955,50 +1994,81 @@ const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
|
1955
1994
|
const Select = /*#__PURE__*/ React.forwardRef(SelectComponent);
|
|
1956
1995
|
|
|
1957
1996
|
const Label$2 = /*#__PURE__*/ styled("label", {
|
|
1958
|
-
target: "
|
|
1997
|
+
target: "e74kvzt0",
|
|
1959
1998
|
label: "Label"
|
|
1960
1999
|
})("margin:5px 0;position:relative;display:inline-flex;align-items:center;cursor:pointer;");
|
|
1961
2000
|
const StyledCheckmark = /*#__PURE__*/ styled("span", {
|
|
1962
|
-
target: "
|
|
2001
|
+
target: "e74kvzt1",
|
|
1963
2002
|
label: "StyledCheckmark"
|
|
1964
2003
|
})("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
2004
|
const HiddenInput$1 = /*#__PURE__*/ styled("input", {
|
|
1966
|
-
target: "
|
|
2005
|
+
target: "e74kvzt2",
|
|
1967
2006
|
label: "HiddenInput"
|
|
1968
2007
|
})("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), ";}");
|
|
2008
|
+
const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
2009
|
+
target: "e74kvzt3",
|
|
2010
|
+
label: "ErrorContainer"
|
|
2011
|
+
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
|
|
2012
|
+
const Container$6 = /*#__PURE__*/ styled("div", {
|
|
2013
|
+
target: "e74kvzt4",
|
|
2014
|
+
label: "Container"
|
|
2015
|
+
})("display:inline-flex;flex-direction:column;");
|
|
1969
2016
|
/**
|
|
1970
2017
|
* Checkbox Component
|
|
1971
2018
|
* @param props - Component props
|
|
1972
2019
|
* @param fwdRef - Ref forwarded to the underlying HTMLInputElement
|
|
1973
2020
|
*/ function CheckboxComponent(props, fwdRef) {
|
|
1974
|
-
const { label = '', indeterminate = false, checked, ...rest } = props;
|
|
2021
|
+
const { label = '', indeterminate = false, checked, errorText, ...rest } = props;
|
|
2022
|
+
const internalRef = React.useRef(null);
|
|
2023
|
+
const errorId = React.useId();
|
|
2024
|
+
React.useImperativeHandle(fwdRef, ()=>internalRef.current);
|
|
2025
|
+
React.useEffect(()=>{
|
|
2026
|
+
if (internalRef.current) {
|
|
2027
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2028
|
+
}
|
|
2029
|
+
}, [
|
|
2030
|
+
errorText
|
|
2031
|
+
]);
|
|
1975
2032
|
const ref = React.useCallback((node)=>{
|
|
2033
|
+
internalRef.current = node;
|
|
1976
2034
|
// Ensure the DOM `indeterminate` flag always matches the prop
|
|
1977
2035
|
if (node) {
|
|
1978
2036
|
node.indeterminate = !!indeterminate;
|
|
1979
2037
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2038
|
+
// Forward the node (or null) to the parent ref (supports function or ref object)
|
|
2039
|
+
// Note: Since we use useImperativeHandle now, we don't technically need to manually forward here
|
|
2040
|
+
// if we weren't doing the ref callback pattern for indeterminate.
|
|
2041
|
+
// However, useImperativeHandle handles the forwarding.
|
|
2042
|
+
// BUT, our local ref callback `ref` is passed to the input `ref={ref}`.
|
|
2043
|
+
// React will call this callback with the node.
|
|
2044
|
+
// Inside this callback, we set internalRef.current.
|
|
2045
|
+
// useImperativeHandle exposes internalRef.current to fwdRef.
|
|
2046
|
+
// So we don't need manual forwarding logic here anymore!
|
|
1986
2047
|
}, [
|
|
1987
|
-
indeterminate
|
|
1988
|
-
fwdRef
|
|
2048
|
+
indeterminate
|
|
1989
2049
|
]);
|
|
1990
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(
|
|
2050
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$6, {
|
|
1991
2051
|
children: [
|
|
1992
|
-
/*#__PURE__*/ jsxRuntime.
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2052
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Label$2, {
|
|
2053
|
+
children: [
|
|
2054
|
+
/*#__PURE__*/ jsxRuntime.jsx(HiddenInput$1, {
|
|
2055
|
+
...rest,
|
|
2056
|
+
ref: ref,
|
|
2057
|
+
type: "checkbox",
|
|
2058
|
+
checked: checked,
|
|
2059
|
+
"aria-checked": indeterminate ? 'mixed' : checked,
|
|
2060
|
+
"aria-invalid": !!errorText,
|
|
2061
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2062
|
+
}),
|
|
2063
|
+
/*#__PURE__*/ jsxRuntime.jsx(StyledCheckmark, {}),
|
|
2064
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2065
|
+
children: label
|
|
2066
|
+
})
|
|
2067
|
+
]
|
|
1998
2068
|
}),
|
|
1999
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
2000
|
-
|
|
2001
|
-
children:
|
|
2069
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$2, {
|
|
2070
|
+
id: errorId,
|
|
2071
|
+
children: errorText
|
|
2002
2072
|
})
|
|
2003
2073
|
]
|
|
2004
2074
|
});
|
|
@@ -2006,30 +2076,60 @@ const HiddenInput$1 = /*#__PURE__*/ styled("input", {
|
|
|
2006
2076
|
const Checkbox = /*#__PURE__*/ React.forwardRef(CheckboxComponent);
|
|
2007
2077
|
|
|
2008
2078
|
const Switch = /*#__PURE__*/ styled("label", {
|
|
2009
|
-
target: "
|
|
2079
|
+
target: "ecxpw850",
|
|
2010
2080
|
label: "Switch"
|
|
2011
2081
|
})("position:relative;display:inline-flex;margin:5px 0;");
|
|
2012
2082
|
const Input$1 = /*#__PURE__*/ styled("input", {
|
|
2013
|
-
target: "
|
|
2083
|
+
target: "ecxpw851",
|
|
2014
2084
|
label: "Input"
|
|
2015
2085
|
})("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), ";}");
|
|
2086
|
+
const ErrorContainer$1 = /*#__PURE__*/ styled("div", {
|
|
2087
|
+
target: "ecxpw852",
|
|
2088
|
+
label: "ErrorContainer"
|
|
2089
|
+
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
|
|
2090
|
+
const Container$5 = /*#__PURE__*/ styled("div", {
|
|
2091
|
+
target: "ecxpw853",
|
|
2092
|
+
label: "Container"
|
|
2093
|
+
})("display:inline-flex;flex-direction:column;");
|
|
2016
2094
|
/**
|
|
2017
2095
|
* Toggle Component
|
|
2018
2096
|
* @param props - Component props
|
|
2019
|
-
* @param
|
|
2020
|
-
*/ function ToggleComponent(props,
|
|
2021
|
-
|
|
2097
|
+
* @param forwardedRef - Ref forwarded to the underlying HTMLInputElement
|
|
2098
|
+
*/ function ToggleComponent(props, forwardedRef) {
|
|
2099
|
+
const { label, errorText, ...rest } = props;
|
|
2100
|
+
const internalRef = React.useRef(null);
|
|
2101
|
+
const errorId = React.useId();
|
|
2102
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
2103
|
+
React.useEffect(()=>{
|
|
2104
|
+
if (internalRef.current) {
|
|
2105
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2106
|
+
}
|
|
2107
|
+
}, [
|
|
2108
|
+
errorText
|
|
2109
|
+
]);
|
|
2110
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$5, {
|
|
2022
2111
|
children: [
|
|
2023
|
-
/*#__PURE__*/ jsxRuntime.
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2112
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Switch, {
|
|
2113
|
+
children: [
|
|
2114
|
+
/*#__PURE__*/ jsxRuntime.jsx(Input$1, {
|
|
2115
|
+
...rest,
|
|
2116
|
+
ref: internalRef,
|
|
2117
|
+
type: "checkbox",
|
|
2118
|
+
role: "switch",
|
|
2119
|
+
"aria-checked": props.checked,
|
|
2120
|
+
"aria-invalid": !!errorText,
|
|
2121
|
+
"aria-label": label,
|
|
2122
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2123
|
+
}),
|
|
2124
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {}),
|
|
2125
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2126
|
+
children: label
|
|
2127
|
+
})
|
|
2128
|
+
]
|
|
2029
2129
|
}),
|
|
2030
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
2031
|
-
|
|
2032
|
-
children:
|
|
2130
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$1, {
|
|
2131
|
+
id: errorId,
|
|
2132
|
+
children: errorText
|
|
2033
2133
|
})
|
|
2034
2134
|
]
|
|
2035
2135
|
});
|
|
@@ -2037,29 +2137,41 @@ const Input$1 = /*#__PURE__*/ styled("input", {
|
|
|
2037
2137
|
const Toggle = /*#__PURE__*/ React.forwardRef(ToggleComponent);
|
|
2038
2138
|
|
|
2039
2139
|
const Label$1 = /*#__PURE__*/ styled("label", {
|
|
2040
|
-
target: "
|
|
2140
|
+
target: "edovkv60",
|
|
2041
2141
|
label: "Label"
|
|
2042
|
-
})("display:inline-flex;align-items:center;margin:5px 0;cursor:pointer;position:relative;");
|
|
2142
|
+
})("display:inline-flex;align-items:center;margin:5px 10px 5px 0;cursor:pointer;position:relative;");
|
|
2043
2143
|
const StyledRadio = /*#__PURE__*/ styled("span", {
|
|
2044
|
-
target: "
|
|
2144
|
+
target: "edovkv61",
|
|
2045
2145
|
label: "StyledRadio"
|
|
2046
2146
|
})("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
2147
|
const HiddenInput = /*#__PURE__*/ styled("input", {
|
|
2048
|
-
target: "
|
|
2148
|
+
target: "edovkv62",
|
|
2049
2149
|
label: "HiddenInput"
|
|
2050
2150
|
})("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
2151
|
/**
|
|
2052
2152
|
* Radio Component
|
|
2053
2153
|
* @param props - Component props
|
|
2054
|
-
* @param
|
|
2055
|
-
*/ function RadioComponent(props,
|
|
2056
|
-
const { label, ...rest } = props;
|
|
2154
|
+
* @param forwardedRef - Ref forwarded to the underlying HTMLInputElement
|
|
2155
|
+
*/ function RadioComponent(props, forwardedRef) {
|
|
2156
|
+
const { label, errorText, ...rest } = props;
|
|
2157
|
+
const internalRef = React.useRef(null);
|
|
2158
|
+
const errorId = React.useId();
|
|
2159
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
2160
|
+
React.useEffect(()=>{
|
|
2161
|
+
if (internalRef.current) {
|
|
2162
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2163
|
+
}
|
|
2164
|
+
}, [
|
|
2165
|
+
errorText
|
|
2166
|
+
]);
|
|
2057
2167
|
return /*#__PURE__*/ jsxRuntime.jsxs(Label$1, {
|
|
2058
2168
|
children: [
|
|
2059
2169
|
/*#__PURE__*/ jsxRuntime.jsx(HiddenInput, {
|
|
2060
2170
|
...rest,
|
|
2061
|
-
ref:
|
|
2062
|
-
type: "radio"
|
|
2171
|
+
ref: internalRef,
|
|
2172
|
+
type: "radio",
|
|
2173
|
+
"aria-invalid": !!errorText,
|
|
2174
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2063
2175
|
}),
|
|
2064
2176
|
/*#__PURE__*/ jsxRuntime.jsx(StyledRadio, {}),
|
|
2065
2177
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
@@ -2071,29 +2183,41 @@ const HiddenInput = /*#__PURE__*/ styled("input", {
|
|
|
2071
2183
|
const Radio = /*#__PURE__*/ React.forwardRef(RadioComponent);
|
|
2072
2184
|
|
|
2073
2185
|
const Input = /*#__PURE__*/ styled("input", {
|
|
2074
|
-
target: "
|
|
2186
|
+
target: "e76n0060",
|
|
2075
2187
|
label: "Input"
|
|
2076
2188
|
})("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
2189
|
const Label = /*#__PURE__*/ styled("label", {
|
|
2078
|
-
target: "
|
|
2190
|
+
target: "e76n0061",
|
|
2079
2191
|
label: "Label"
|
|
2080
2192
|
})("display:inline-flex;&:focus-within{z-index:1;}");
|
|
2081
2193
|
const RadioGroup = /*#__PURE__*/ styled("div", {
|
|
2082
|
-
target: "
|
|
2194
|
+
target: "e76n0062",
|
|
2083
2195
|
label: "RadioGroup"
|
|
2084
|
-
})("display:inline-flex;align-items:center;border-radius:3px;margin:5px 0;& ", Label, ":first-
|
|
2196
|
+
})("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
2197
|
/**
|
|
2086
2198
|
* RadioButton Component
|
|
2087
2199
|
* @param props - Component props
|
|
2088
|
-
* @param
|
|
2089
|
-
*/ function RadioButtonComponent(props,
|
|
2090
|
-
const { label, ...rest } = props;
|
|
2200
|
+
* @param forwardedRef - Ref forwarded to the underlying HTMLInputElement
|
|
2201
|
+
*/ function RadioButtonComponent(props, forwardedRef) {
|
|
2202
|
+
const { label, errorText, ...rest } = props;
|
|
2203
|
+
const internalRef = React.useRef(null);
|
|
2204
|
+
const errorId = React.useId();
|
|
2205
|
+
React.useImperativeHandle(forwardedRef, ()=>internalRef.current);
|
|
2206
|
+
React.useEffect(()=>{
|
|
2207
|
+
if (internalRef.current) {
|
|
2208
|
+
internalRef.current.setCustomValidity(errorText || '');
|
|
2209
|
+
}
|
|
2210
|
+
}, [
|
|
2211
|
+
errorText
|
|
2212
|
+
]);
|
|
2091
2213
|
return /*#__PURE__*/ jsxRuntime.jsxs(Label, {
|
|
2092
2214
|
children: [
|
|
2093
2215
|
/*#__PURE__*/ jsxRuntime.jsx(Input, {
|
|
2094
2216
|
...rest,
|
|
2095
2217
|
type: "radio",
|
|
2096
|
-
ref:
|
|
2218
|
+
ref: internalRef,
|
|
2219
|
+
"aria-invalid": !!errorText,
|
|
2220
|
+
"aria-describedby": errorText ? errorId : undefined
|
|
2097
2221
|
}),
|
|
2098
2222
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2099
2223
|
children: label
|
|
@@ -2234,7 +2358,7 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
|
|
|
2234
2358
|
const Menu = /*#__PURE__*/ React.forwardRef(MenuInner);
|
|
2235
2359
|
|
|
2236
2360
|
const Container$4 = /*#__PURE__*/ styled("button", {
|
|
2237
|
-
target: "
|
|
2361
|
+
target: "e1u7wt750",
|
|
2238
2362
|
label: "Container"
|
|
2239
2363
|
})("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
2364
|
/**
|
|
@@ -2307,11 +2431,11 @@ const positionMap$2 = {
|
|
|
2307
2431
|
`
|
|
2308
2432
|
};
|
|
2309
2433
|
const PopoverDiv = /*#__PURE__*/ styled("div", {
|
|
2310
|
-
target: "
|
|
2434
|
+
target: "e13swao70",
|
|
2311
2435
|
label: "PopoverDiv"
|
|
2312
2436
|
})("position:relative;display:inline-flex;");
|
|
2313
2437
|
const Popper = /*#__PURE__*/ styled(Card, {
|
|
2314
|
-
target: "
|
|
2438
|
+
target: "e13swao71",
|
|
2315
2439
|
label: "Popper"
|
|
2316
2440
|
})("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
2441
|
const KEY_CODES = {
|
|
@@ -2490,7 +2614,7 @@ const KEY_CODES = {
|
|
|
2490
2614
|
ref: forwardRef,
|
|
2491
2615
|
...rest,
|
|
2492
2616
|
children: [
|
|
2493
|
-
/*#__PURE__*/ React.
|
|
2617
|
+
/*#__PURE__*/ React.cloneElement(element, {
|
|
2494
2618
|
ref: triggerRef,
|
|
2495
2619
|
id: triggerId,
|
|
2496
2620
|
'aria-expanded': open,
|
|
@@ -2520,9 +2644,63 @@ const KEY_CODES = {
|
|
|
2520
2644
|
const Popover = /*#__PURE__*/ React.forwardRef(PopoverComponent);
|
|
2521
2645
|
|
|
2522
2646
|
const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
2523
|
-
target: "
|
|
2647
|
+
target: "eph6dat0",
|
|
2524
2648
|
label: "ArrowContainer"
|
|
2525
2649
|
})("position:absolute;right:12px;top:16px;pointer-events:none;");
|
|
2650
|
+
/**
|
|
2651
|
+
* DropdownTrigger Component
|
|
2652
|
+
*/ const DropdownTrigger = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
2653
|
+
const { displayValue, label, errorText, open, menuId, toggleOpen, onKeyDown, forwardedRef, ...rest } = props;
|
|
2654
|
+
const triggerRef = React.useRef(null);
|
|
2655
|
+
// Helper to assign both internal triggerRef and external forwarded ref
|
|
2656
|
+
const assignRefs = React.useCallback((node)=>{
|
|
2657
|
+
triggerRef.current = node;
|
|
2658
|
+
if (!forwardedRef) return;
|
|
2659
|
+
if (typeof forwardedRef === 'function') {
|
|
2660
|
+
forwardedRef(node);
|
|
2661
|
+
} else {
|
|
2662
|
+
forwardedRef.current = node;
|
|
2663
|
+
}
|
|
2664
|
+
}, [
|
|
2665
|
+
forwardedRef
|
|
2666
|
+
]);
|
|
2667
|
+
// Combine the ref passed by parent with our assignRefs so both are updated
|
|
2668
|
+
const combinedRef = React.useCallback((node)=>{
|
|
2669
|
+
assignRefs(node);
|
|
2670
|
+
if (typeof ref === 'function') {
|
|
2671
|
+
ref(node);
|
|
2672
|
+
} else if (ref) {
|
|
2673
|
+
ref.current = node;
|
|
2674
|
+
}
|
|
2675
|
+
}, [
|
|
2676
|
+
assignRefs,
|
|
2677
|
+
ref
|
|
2678
|
+
]);
|
|
2679
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2680
|
+
children: [
|
|
2681
|
+
/*#__PURE__*/ jsxRuntime.jsx(Input$2, {
|
|
2682
|
+
...rest,
|
|
2683
|
+
ref: combinedRef,
|
|
2684
|
+
type: "text",
|
|
2685
|
+
value: displayValue,
|
|
2686
|
+
label: label,
|
|
2687
|
+
errorText: errorText,
|
|
2688
|
+
onClick: toggleOpen,
|
|
2689
|
+
onKeyDown: onKeyDown,
|
|
2690
|
+
inputMode: "none",
|
|
2691
|
+
role: "combobox",
|
|
2692
|
+
"aria-haspopup": "listbox",
|
|
2693
|
+
"aria-expanded": open,
|
|
2694
|
+
"aria-controls": menuId
|
|
2695
|
+
}),
|
|
2696
|
+
/*#__PURE__*/ jsxRuntime.jsx(ArrowContainer, {
|
|
2697
|
+
"aria-hidden": "true",
|
|
2698
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ExpandMore, {})
|
|
2699
|
+
})
|
|
2700
|
+
]
|
|
2701
|
+
});
|
|
2702
|
+
});
|
|
2703
|
+
DropdownTrigger.displayName = 'DropdownTrigger';
|
|
2526
2704
|
/**
|
|
2527
2705
|
* Dropdown component that allows selection from a list of options.
|
|
2528
2706
|
* Supports single and multi-select modes.
|
|
@@ -2530,11 +2708,6 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2530
2708
|
* @template T - The type of the value(s) in the dropdown.
|
|
2531
2709
|
* @param props - The properties for the Dropdown component.
|
|
2532
2710
|
* @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
2711
|
*/ function DropdownComponent(props, outerRef) {
|
|
2539
2712
|
const { multiSelect = false, onChange, children, value: propValue, label, errorText, required, disabled, ...rest } = props;
|
|
2540
2713
|
const [open, setOpen] = React.useState(false);
|
|
@@ -2543,6 +2716,42 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2543
2716
|
const menuId = `${id}-menu`;
|
|
2544
2717
|
const menuRef = React.useRef(null);
|
|
2545
2718
|
const triggerRef = React.useRef(null);
|
|
2719
|
+
/**
|
|
2720
|
+
* Gets the display value for the dropdown based on the current value and children.
|
|
2721
|
+
*
|
|
2722
|
+
* @param currentValue - The current value of the dropdown.
|
|
2723
|
+
* @param currentChildren - The children of the dropdown.
|
|
2724
|
+
* @returns The display value.
|
|
2725
|
+
*/ const getDisplayValue = (currentValue, currentChildren)=>{
|
|
2726
|
+
if (currentValue === undefined || currentValue === null) return '';
|
|
2727
|
+
const findLabel = (val)=>{
|
|
2728
|
+
let label = '';
|
|
2729
|
+
React.Children.forEach(currentChildren, (child)=>{
|
|
2730
|
+
if (/*#__PURE__*/ React.isValidElement(child)) {
|
|
2731
|
+
const props = child.props;
|
|
2732
|
+
if ('value' in props && props.value === val) {
|
|
2733
|
+
label = String(props.children);
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
});
|
|
2737
|
+
return label;
|
|
2738
|
+
};
|
|
2739
|
+
if (Array.isArray(currentValue)) {
|
|
2740
|
+
return currentValue.map(findLabel).filter(Boolean).join(', ');
|
|
2741
|
+
}
|
|
2742
|
+
return findLabel(currentValue);
|
|
2743
|
+
};
|
|
2744
|
+
const displayValue = getDisplayValue(value, children) || (value ? String(value) : '');
|
|
2745
|
+
// Sync prop value with state
|
|
2746
|
+
const prevValueRef = React.useRef(undefined);
|
|
2747
|
+
React.useEffect(()=>{
|
|
2748
|
+
if (propValue !== prevValueRef.current) {
|
|
2749
|
+
setValue(propValue);
|
|
2750
|
+
prevValueRef.current = propValue;
|
|
2751
|
+
}
|
|
2752
|
+
}, [
|
|
2753
|
+
propValue
|
|
2754
|
+
]);
|
|
2546
2755
|
// Focus menu when opened
|
|
2547
2756
|
React.useEffect(()=>{
|
|
2548
2757
|
if (open) {
|
|
@@ -2564,7 +2773,7 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2564
2773
|
* Opens the menu on 'Enter', 'Space', 'ArrowDown', or 'ArrowUp'.
|
|
2565
2774
|
*
|
|
2566
2775
|
* @param {React.KeyboardEvent<HTMLInputElement>} e - The keyboard event.
|
|
2567
|
-
*/ const onKeyDown = (e)=>{
|
|
2776
|
+
*/ const onKeyDown = React.useCallback((e)=>{
|
|
2568
2777
|
if ([
|
|
2569
2778
|
'ArrowDown',
|
|
2570
2779
|
'ArrowUp',
|
|
@@ -2573,8 +2782,11 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2573
2782
|
].includes(e.key)) {
|
|
2574
2783
|
e.preventDefault();
|
|
2575
2784
|
setOpen(true);
|
|
2785
|
+
} else if (e.key !== 'Tab') {
|
|
2786
|
+
// Prevent typing to mimic readOnly behavior while allowing native validation
|
|
2787
|
+
e.preventDefault();
|
|
2576
2788
|
}
|
|
2577
|
-
};
|
|
2789
|
+
}, []);
|
|
2578
2790
|
/**
|
|
2579
2791
|
* Handles changes to the dropdown value.
|
|
2580
2792
|
* Updates local state and calls the external onChange handler.
|
|
@@ -2592,59 +2804,35 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2592
2804
|
};
|
|
2593
2805
|
/**
|
|
2594
2806
|
* 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';
|
|
2807
|
+
*/ const clickHandler = React.useCallback(()=>setOpen(true), []);
|
|
2808
|
+
/**
|
|
2809
|
+
* Forwarded ref handler for the trigger input.
|
|
2810
|
+
*/ const handleForwardedRef = React.useCallback((node)=>{
|
|
2811
|
+
triggerRef.current = node;
|
|
2812
|
+
if (typeof outerRef === 'function') {
|
|
2813
|
+
outerRef(node);
|
|
2814
|
+
} else if (outerRef) {
|
|
2815
|
+
outerRef.current = node;
|
|
2816
|
+
}
|
|
2817
|
+
}, [
|
|
2818
|
+
outerRef
|
|
2819
|
+
]);
|
|
2644
2820
|
return /*#__PURE__*/ jsxRuntime.jsx(Popover, {
|
|
2645
2821
|
position: POPOVER_POSITION.BOTTOM_LEFT,
|
|
2646
2822
|
open: open,
|
|
2647
|
-
element:
|
|
2823
|
+
element: /*#__PURE__*/ jsxRuntime.jsx(DropdownTrigger, {
|
|
2824
|
+
...rest,
|
|
2825
|
+
displayValue: displayValue,
|
|
2826
|
+
label: label,
|
|
2827
|
+
errorText: errorText,
|
|
2828
|
+
open: open,
|
|
2829
|
+
menuId: menuId,
|
|
2830
|
+
toggleOpen: clickHandler,
|
|
2831
|
+
onKeyDown: onKeyDown,
|
|
2832
|
+
required: required,
|
|
2833
|
+
disabled: disabled,
|
|
2834
|
+
forwardedRef: handleForwardedRef
|
|
2835
|
+
}),
|
|
2648
2836
|
onClose: ()=>{
|
|
2649
2837
|
setOpen(false);
|
|
2650
2838
|
triggerRef.current?.focus();
|
|
@@ -2781,7 +2969,7 @@ const positionStyle$1 = (size)=>({
|
|
|
2781
2969
|
}
|
|
2782
2970
|
});
|
|
2783
2971
|
const DrawerDiv = /*#__PURE__*/ styled("div", {
|
|
2784
|
-
target: "
|
|
2972
|
+
target: "e1qyfyr80",
|
|
2785
2973
|
label: "DrawerDiv"
|
|
2786
2974
|
})("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
2975
|
const positionMap$1 = {
|
|
@@ -2819,7 +3007,7 @@ class Drawer extends React.Component {
|
|
|
2819
3007
|
/**
|
|
2820
3008
|
* Lifecycle method to handle Drawer updates.
|
|
2821
3009
|
* Manages opening/closing logic via LayerManager and focus preservation.
|
|
2822
|
-
*/
|
|
3010
|
+
*/ componentDidUpdate(prevProps) {
|
|
2823
3011
|
const { open } = this.props;
|
|
2824
3012
|
if (prevProps.open && !open) {
|
|
2825
3013
|
this.closeCallback?.();
|
|
@@ -2830,7 +3018,6 @@ class Drawer extends React.Component {
|
|
|
2830
3018
|
this.lastFocusedElement = document.activeElement;
|
|
2831
3019
|
this.handleOpen();
|
|
2832
3020
|
}
|
|
2833
|
-
return null;
|
|
2834
3021
|
}
|
|
2835
3022
|
/**
|
|
2836
3023
|
* Renders the Drawer component via the LayerManager portal.
|
|
@@ -2974,9 +3161,9 @@ Drawer.defaultProps = {
|
|
|
2974
3161
|
};
|
|
2975
3162
|
|
|
2976
3163
|
const Container$3 = /*#__PURE__*/ styled("div", {
|
|
2977
|
-
target: "
|
|
3164
|
+
target: "e1m58trk0",
|
|
2978
3165
|
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-
|
|
3166
|
+
})("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
3167
|
border-color: ${getThemeValue(THEME_NAME.ERROR)};
|
|
2981
3168
|
|
|
2982
3169
|
& > button, & > label {
|
|
@@ -2984,7 +3171,7 @@ const Container$3 = /*#__PURE__*/ styled("div", {
|
|
|
2984
3171
|
}
|
|
2985
3172
|
` : '');
|
|
2986
3173
|
const ErrorContainer = /*#__PURE__*/ styled("div", {
|
|
2987
|
-
target: "
|
|
3174
|
+
target: "e1m58trk1",
|
|
2988
3175
|
label: "ErrorContainer"
|
|
2989
3176
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
|
|
2990
3177
|
/**
|
|
@@ -3051,7 +3238,7 @@ class Modal extends React.Component {
|
|
|
3051
3238
|
/**
|
|
3052
3239
|
* Lifecycle method to handle Modal updates.
|
|
3053
3240
|
* Manages opening/closing logic via LayerManager and focus preservation.
|
|
3054
|
-
*/
|
|
3241
|
+
*/ componentDidUpdate(prevProps) {
|
|
3055
3242
|
const { open } = this.props;
|
|
3056
3243
|
if (prevProps.open && !open) {
|
|
3057
3244
|
this.closeCallback?.();
|
|
@@ -3062,7 +3249,6 @@ class Modal extends React.Component {
|
|
|
3062
3249
|
this.lastFocusedElement = document.activeElement;
|
|
3063
3250
|
this.handleOpen();
|
|
3064
3251
|
}
|
|
3065
|
-
return null;
|
|
3066
3252
|
}
|
|
3067
3253
|
/**
|
|
3068
3254
|
* Renders the Modal component via the LayerManager portal.
|
|
@@ -3630,19 +3816,19 @@ const SpinnerDiv = /*#__PURE__*/ styled("div", {
|
|
|
3630
3816
|
const Spinner = /*#__PURE__*/ React.forwardRef(SpinnerComponent);
|
|
3631
3817
|
|
|
3632
3818
|
const Container$1 = /*#__PURE__*/ styled("div", {
|
|
3633
|
-
target: "
|
|
3819
|
+
target: "er9cpfq0",
|
|
3634
3820
|
label: "Container"
|
|
3635
3821
|
})("flex:1;display:flex;flex-direction:column;min-height:400px;");
|
|
3636
3822
|
const Header = /*#__PURE__*/ styled("div", {
|
|
3637
|
-
target: "
|
|
3823
|
+
target: "er9cpfq1",
|
|
3638
3824
|
label: "Header"
|
|
3639
3825
|
})("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
3826
|
const HeaderButton = /*#__PURE__*/ styled("button", {
|
|
3641
|
-
target: "
|
|
3827
|
+
target: "er9cpfq2",
|
|
3642
3828
|
label: "HeaderButton"
|
|
3643
3829
|
})("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
3830
|
const MobileHeader = /*#__PURE__*/ styled("div", {
|
|
3645
|
-
target: "
|
|
3831
|
+
target: "er9cpfq3",
|
|
3646
3832
|
label: "MobileHeader"
|
|
3647
3833
|
})("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
3834
|
/**
|
|
@@ -3654,6 +3840,15 @@ const MobileHeader = /*#__PURE__*/ styled("div", {
|
|
|
3654
3840
|
const [active, setActive] = React.useState(propsActive);
|
|
3655
3841
|
const childrenArray = React.Children.toArray(children);
|
|
3656
3842
|
const stepRefs = [];
|
|
3843
|
+
const prevActiveRef = React.useRef(null);
|
|
3844
|
+
React.useEffect(()=>{
|
|
3845
|
+
if (prevActiveRef.current !== propsActive) {
|
|
3846
|
+
setActive(propsActive);
|
|
3847
|
+
}
|
|
3848
|
+
prevActiveRef.current = propsActive;
|
|
3849
|
+
}, [
|
|
3850
|
+
propsActive
|
|
3851
|
+
]);
|
|
3657
3852
|
const stepClickHandler = (index)=>()=>{
|
|
3658
3853
|
setActive(index);
|
|
3659
3854
|
onStepClick?.(index);
|
|
@@ -4188,6 +4383,7 @@ exports.DrawerBody = Body$1;
|
|
|
4188
4383
|
exports.DrawerFooter = Footer$1;
|
|
4189
4384
|
exports.DrawerHeader = Header$1;
|
|
4190
4385
|
exports.Dropdown = Dropdown;
|
|
4386
|
+
exports.ErrorContainer = ErrorContainer$7;
|
|
4191
4387
|
exports.Group = Group;
|
|
4192
4388
|
exports.GroupLabel = GroupLabel;
|
|
4193
4389
|
exports.IconButton = IconButton;
|