no-frills-ui 0.0.14-rc.2 → 0.0.14-rc.4
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 +120 -89
- package/dist/index.js.map +1 -1
- package/lib-esm/components/Accordion/AccordionStep.js +10 -9
- package/lib-esm/components/Accordion/AccordionStep.js.map +1 -1
- package/lib-esm/components/Card/Card.js +2 -2
- package/lib-esm/components/Card/Card.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 +74 -52
- 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/Groups/Group.js +3 -3
- package/lib-esm/components/Groups/Group.js.map +1 -1
- package/lib-esm/components/Notification/Notification.js +9 -5
- package/lib-esm/components/Notification/Notification.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/Toast/Toast.js +6 -4
- package/lib-esm/components/Toast/Toast.js.map +1 -1
- package/lib-esm/shared/styles.js +6 -6
- package/lib-esm/shared/styles.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -252,23 +252,23 @@ const getThemeValue = (key)=>{
|
|
|
252
252
|
};
|
|
253
253
|
|
|
254
254
|
const Ellipsis = /*#__PURE__*/ styled("span", {
|
|
255
|
-
target: "
|
|
255
|
+
target: "e10k0igo0",
|
|
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: "e10k0igo1",
|
|
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: "e10k0igo2",
|
|
264
264
|
label: "Body"
|
|
265
|
-
})("padding:0 15px;margin:20px 0;flex:1;overflow:visible;");
|
|
265
|
+
})("padding:0 15px;margin:20px 0;flex:1;overflow:visible;display:flow-root;");
|
|
266
266
|
const Footer$1 = /*#__PURE__*/ styled("div", {
|
|
267
|
-
target: "
|
|
267
|
+
target: "e10k0igo3",
|
|
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
270
|
const ErrorContainer$7 = /*#__PURE__*/ styled("div", {
|
|
271
|
-
target: "
|
|
271
|
+
target: "e10k0igo4",
|
|
272
272
|
label: "ErrorContainer"
|
|
273
273
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
|
|
274
274
|
|
|
@@ -310,9 +310,9 @@ const BadgeSpan = /*#__PURE__*/ styled("span", {
|
|
|
310
310
|
const Badge = /*#__PURE__*/ React.forwardRef(BadgeComponent);
|
|
311
311
|
|
|
312
312
|
const StyledCard = /*#__PURE__*/ styled("div", {
|
|
313
|
-
target: "
|
|
313
|
+
target: "e7s3yg90",
|
|
314
314
|
label: "StyledCard"
|
|
315
|
-
})("border-radius:10px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";", (props)=>props.elevated ? `box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};` : `box-shadow: ${getThemeValue(THEME_NAME.SHADOW)};`, " margin:5px;overflow:
|
|
315
|
+
})("border-radius:10px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";", (props)=>props.elevated ? `box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};` : `box-shadow: ${getThemeValue(THEME_NAME.SHADOW)};`, " margin:5px;overflow:visible;display:flow-root;position:relative;");
|
|
316
316
|
/**
|
|
317
317
|
* Card Component
|
|
318
318
|
* @param props - Component props
|
|
@@ -326,35 +326,35 @@ const StyledCard = /*#__PURE__*/ styled("div", {
|
|
|
326
326
|
const Card = /*#__PURE__*/ React.forwardRef(CardComponent);
|
|
327
327
|
|
|
328
328
|
const Step$1 = /*#__PURE__*/ styled(Card, {
|
|
329
|
-
target: "
|
|
329
|
+
target: "e1vu5oed0",
|
|
330
330
|
label: "Step"
|
|
331
|
-
})("transition:all 0.6s ease;overflow:visible;", (props)=>props.open && `margin: 20px 5px;`);
|
|
331
|
+
})("transition:all 0.6s ease;overflow:visible;display:flow-root;", (props)=>props.open && `margin: 20px 5px;`);
|
|
332
332
|
const StepHeader = /*#__PURE__*/ styled("button", {
|
|
333
|
-
target: "
|
|
333
|
+
target: "e1vu5oed1",
|
|
334
334
|
label: "StepHeader"
|
|
335
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)};`);
|
|
336
336
|
const HeaderContainer = /*#__PURE__*/ styled("div", {
|
|
337
|
-
target: "
|
|
337
|
+
target: "e1vu5oed2",
|
|
338
338
|
label: "HeaderContainer"
|
|
339
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;}");
|
|
340
340
|
const ExpandContainer = /*#__PURE__*/ styled("div", {
|
|
341
|
-
target: "
|
|
341
|
+
target: "e1vu5oed3",
|
|
342
342
|
label: "ExpandContainer"
|
|
343
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); }` : '');
|
|
344
344
|
const StepBody = /*#__PURE__*/ styled("div", {
|
|
345
|
-
target: "
|
|
345
|
+
target: "e1vu5oed4",
|
|
346
346
|
label: "StepBody"
|
|
347
347
|
})("transition:all 0.6s ease;overflow:hidden;height:", (props)=>props.height || 0, "px;");
|
|
348
348
|
const AccordionBadge = /*#__PURE__*/ styled(Badge, {
|
|
349
|
-
target: "
|
|
349
|
+
target: "e1vu5oed5",
|
|
350
350
|
label: "AccordionBadge"
|
|
351
351
|
})("margin-right:15px;");
|
|
352
352
|
const AccordionStepBody = /*#__PURE__*/ styled("div", {
|
|
353
|
-
target: "
|
|
353
|
+
target: "e1vu5oed6",
|
|
354
354
|
label: "AccordionStepBody"
|
|
355
355
|
})("padding:20px 15px;");
|
|
356
356
|
const AccordionStepFooter = /*#__PURE__*/ styled("div", {
|
|
357
|
-
target: "
|
|
357
|
+
target: "e1vu5oed7",
|
|
358
358
|
label: "AccordionStepFooter"
|
|
359
359
|
})("display:flex;justify-content:flex-end;padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";");
|
|
360
360
|
/**
|
|
@@ -384,6 +384,7 @@ const AccordionStepFooter = /*#__PURE__*/ styled("div", {
|
|
|
384
384
|
completed: completed,
|
|
385
385
|
children: [
|
|
386
386
|
/*#__PURE__*/ jsxRuntime.jsxs(StepHeader, {
|
|
387
|
+
type: "button",
|
|
387
388
|
open: open,
|
|
388
389
|
disabled: disabled,
|
|
389
390
|
onClick: onStepClick,
|
|
@@ -522,12 +523,12 @@ const StyledIconButton = /*#__PURE__*/ styled("button", {
|
|
|
522
523
|
}
|
|
523
524
|
const IconButton = /*#__PURE__*/ React.forwardRef(IconButtonComponent);
|
|
524
525
|
|
|
525
|
-
const Container$
|
|
526
|
-
target: "
|
|
526
|
+
const Container$b = /*#__PURE__*/ styled("span", {
|
|
527
|
+
target: "e3nd8sw0",
|
|
527
528
|
label: "Container"
|
|
528
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;");
|
|
529
530
|
const Button$1 = /*#__PURE__*/ styled("button", {
|
|
530
|
-
target: "
|
|
531
|
+
target: "e3nd8sw1",
|
|
531
532
|
label: "Button"
|
|
532
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), ";}");
|
|
533
534
|
/**
|
|
@@ -547,13 +548,14 @@ const Button$1 = /*#__PURE__*/ styled("button", {
|
|
|
547
548
|
e.stopPropagation();
|
|
548
549
|
}
|
|
549
550
|
};
|
|
550
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(Container$
|
|
551
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(Container$b, {
|
|
551
552
|
...rest,
|
|
552
553
|
ref: ref,
|
|
553
554
|
onKeyUp: keyUpHandler,
|
|
554
555
|
children: [
|
|
555
556
|
label,
|
|
556
557
|
/*#__PURE__*/ jsxRuntime.jsx(Button$1, {
|
|
558
|
+
type: "button",
|
|
557
559
|
onClick: onCloseClick,
|
|
558
560
|
onKeyDown: buttonKeyDownHandler,
|
|
559
561
|
"aria-label": closeButtonAriaLabel ?? `Remove ${label}`,
|
|
@@ -582,7 +584,7 @@ const DragContext = React.createContext(null);
|
|
|
582
584
|
target: "ertl9d71",
|
|
583
585
|
label: "DragKnob"
|
|
584
586
|
})("padding-top:8px;cursor:move;touch-action:none;color:", getThemeValue(THEME_NAME.DISABLED), ";");
|
|
585
|
-
/** Container for the children */ const Container$
|
|
587
|
+
/** Container for the children */ const Container$a = /*#__PURE__*/ styled("div", {
|
|
586
588
|
target: "ertl9d72",
|
|
587
589
|
label: "Container"
|
|
588
590
|
})("flex:1;");
|
|
@@ -824,14 +826,14 @@ const DragContext = React.createContext(null);
|
|
|
824
826
|
tabIndex: -1,
|
|
825
827
|
children: /*#__PURE__*/ jsxRuntime.jsx(CheckCircle, {})
|
|
826
828
|
}),
|
|
827
|
-
/*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
829
|
+
/*#__PURE__*/ jsxRuntime.jsx(Container$a, {
|
|
828
830
|
children: children
|
|
829
831
|
})
|
|
830
832
|
]
|
|
831
833
|
});
|
|
832
834
|
}
|
|
833
835
|
|
|
834
|
-
/** Container Component */ const Container$
|
|
836
|
+
/** Container Component */ const Container$9 = /*#__PURE__*/ styled("div", {
|
|
835
837
|
target: "e18d6tqk0",
|
|
836
838
|
label: "Container"
|
|
837
839
|
})("flex:1;display:flex;position:relative;flex-wrap:wrap;flex-direction:", (props)=>props.orientation === ORIENTATION.HORIZONTAL ? 'row' : 'column', ";");
|
|
@@ -934,7 +936,7 @@ const DragContext = React.createContext(null);
|
|
|
934
936
|
setDragOver,
|
|
935
937
|
i18n
|
|
936
938
|
},
|
|
937
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(Container$
|
|
939
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Container$9, {
|
|
938
940
|
...rest,
|
|
939
941
|
ref: ref,
|
|
940
942
|
orientation: orientation,
|
|
@@ -961,11 +963,16 @@ const DragContext = React.createContext(null);
|
|
|
961
963
|
}
|
|
962
964
|
const DragAndDrop = /*#__PURE__*/ React.forwardRef(DragAndDropComponent);
|
|
963
965
|
|
|
966
|
+
// Container for the ChipInput
|
|
967
|
+
const Container$8 = /*#__PURE__*/ styled("div", {
|
|
968
|
+
target: "e7l19410",
|
|
969
|
+
label: "Container"
|
|
970
|
+
})("margin:10px 5px;");
|
|
964
971
|
// Label component for the ChipInput
|
|
965
972
|
const Label$6 = /*#__PURE__*/ styled("label", {
|
|
966
|
-
target: "
|
|
973
|
+
target: "e7l19411",
|
|
967
974
|
label: "Label"
|
|
968
|
-
})("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 ? `
|
|
969
976
|
&:has(:invalid) {
|
|
970
977
|
border-color: ${getThemeValue(THEME_NAME.ERROR)};
|
|
971
978
|
}
|
|
@@ -993,12 +1000,12 @@ const Label$6 = /*#__PURE__*/ styled("label", {
|
|
|
993
1000
|
` : '');
|
|
994
1001
|
// Error message container
|
|
995
1002
|
const ErrorContainer$6 = /*#__PURE__*/ styled("div", {
|
|
996
|
-
target: "
|
|
1003
|
+
target: "e7l19412",
|
|
997
1004
|
label: "ErrorContainer"
|
|
998
1005
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
999
1006
|
// Visually hidden but accessible to screen readers
|
|
1000
1007
|
const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
1001
|
-
target: "
|
|
1008
|
+
target: "e7l19413",
|
|
1002
1009
|
label: "VisuallyHidden"
|
|
1003
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;}");
|
|
1004
1011
|
/**
|
|
@@ -1014,7 +1021,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1014
1021
|
* />
|
|
1015
1022
|
* ```
|
|
1016
1023
|
*/ function ChipInputComponent(props, ref) {
|
|
1017
|
-
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;
|
|
1018
1025
|
const [text, setText] = React.useState('');
|
|
1019
1026
|
const [touched, setTouched] = React.useState(false);
|
|
1020
1027
|
const [value, setValue] = React.useState(propValue || []);
|
|
@@ -1045,10 +1052,10 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1045
1052
|
]);
|
|
1046
1053
|
React.useEffect(()=>{
|
|
1047
1054
|
if (InputRef.current) {
|
|
1048
|
-
InputRef.current.setCustomValidity(
|
|
1055
|
+
InputRef.current.setCustomValidity(errorText || '');
|
|
1049
1056
|
}
|
|
1050
1057
|
}, [
|
|
1051
|
-
|
|
1058
|
+
errorText
|
|
1052
1059
|
]);
|
|
1053
1060
|
/**
|
|
1054
1061
|
* Update the chip values and notify changes.
|
|
@@ -1056,15 +1063,15 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1056
1063
|
*/ const updateValue = (newValue)=>{
|
|
1057
1064
|
const deduped = Array.from(new Set(newValue));
|
|
1058
1065
|
setValue(deduped);
|
|
1059
|
-
|
|
1066
|
+
onChangeCallback?.(deduped);
|
|
1060
1067
|
};
|
|
1061
1068
|
/**
|
|
1062
1069
|
* Marks the input as touched on focus.
|
|
1063
1070
|
* @param e React focus event
|
|
1064
1071
|
*/ const handleFocus = (e)=>{
|
|
1065
1072
|
setTouched(true);
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1073
|
+
if (inputProps.onFocus) {
|
|
1074
|
+
inputProps.onFocus(e);
|
|
1068
1075
|
}
|
|
1069
1076
|
};
|
|
1070
1077
|
/**
|
|
@@ -1076,15 +1083,28 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1076
1083
|
/**
|
|
1077
1084
|
* Adds a new chip on Enter key press.
|
|
1078
1085
|
* @param e React keyboard event
|
|
1079
|
-
*/ const
|
|
1080
|
-
if (e.key === 'Enter'
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
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
|
|
1088
1108
|
}
|
|
1089
1109
|
};
|
|
1090
1110
|
/**
|
|
@@ -1114,42 +1134,46 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
1114
1134
|
// Render the component
|
|
1115
1135
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1116
1136
|
children: [
|
|
1117
|
-
/*#__PURE__*/ jsxRuntime.jsxs(
|
|
1118
|
-
text: text,
|
|
1119
|
-
touched: touched,
|
|
1120
|
-
errorText: props.errorText,
|
|
1121
|
-
required: props.required,
|
|
1122
|
-
width: props.width,
|
|
1137
|
+
/*#__PURE__*/ jsxRuntime.jsxs(Container$8, {
|
|
1123
1138
|
children: [
|
|
1124
|
-
/*#__PURE__*/ jsxRuntime.
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
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
|
+
]
|
|
1149
1173
|
}),
|
|
1150
|
-
|
|
1174
|
+
errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$6, {
|
|
1151
1175
|
id: errorId,
|
|
1152
|
-
children:
|
|
1176
|
+
children: errorText
|
|
1153
1177
|
})
|
|
1154
1178
|
]
|
|
1155
1179
|
}),
|
|
@@ -3161,9 +3185,9 @@ Drawer.defaultProps = {
|
|
|
3161
3185
|
};
|
|
3162
3186
|
|
|
3163
3187
|
const Container$3 = /*#__PURE__*/ styled("div", {
|
|
3164
|
-
target: "
|
|
3188
|
+
target: "e1t79jfh0",
|
|
3165
3189
|
label: "Container"
|
|
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;}& > *:
|
|
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;}& > *:nth-child(1 of:not(style)),& > label:nth-child(1 of:not(style)) input,& > label:nth-child(1 of:not(style)) select,& > *:nth-child(1 of:not(style)) label,& > *:nth-child(1 of:not(style)) 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 ? `
|
|
3167
3191
|
border-color: ${getThemeValue(THEME_NAME.ERROR)};
|
|
3168
3192
|
|
|
3169
3193
|
& > button, & > label {
|
|
@@ -3171,7 +3195,7 @@ const Container$3 = /*#__PURE__*/ styled("div", {
|
|
|
3171
3195
|
}
|
|
3172
3196
|
` : '');
|
|
3173
3197
|
const ErrorContainer = /*#__PURE__*/ styled("div", {
|
|
3174
|
-
target: "
|
|
3198
|
+
target: "e1t79jfh1",
|
|
3175
3199
|
label: "ErrorContainer"
|
|
3176
3200
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
|
|
3177
3201
|
/**
|
|
@@ -3560,6 +3584,7 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3560
3584
|
]
|
|
3561
3585
|
}),
|
|
3562
3586
|
/*#__PURE__*/ jsxRuntime.jsx(CloseButton, {
|
|
3587
|
+
type: "button",
|
|
3563
3588
|
onClick: this.closeClickHandler(id),
|
|
3564
3589
|
"aria-label": closeButtonAriaLabel || 'Close notification',
|
|
3565
3590
|
tabIndex: 0,
|
|
@@ -3782,11 +3807,15 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3782
3807
|
*/ this.destroy = (position)=>{
|
|
3783
3808
|
const container = this.containers.get(position);
|
|
3784
3809
|
if (container) {
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3810
|
+
// Defer unmount to avoid trying to synchronously unmount a root
|
|
3811
|
+
// while React is already rendering which can cause a race.
|
|
3812
|
+
setTimeout(()=>{
|
|
3813
|
+
container.root.unmount();
|
|
3814
|
+
if (document.body.contains(container.div)) {
|
|
3815
|
+
document.body.removeChild(container.div);
|
|
3816
|
+
}
|
|
3817
|
+
this.containers.delete(position);
|
|
3818
|
+
}, 0);
|
|
3790
3819
|
}
|
|
3791
3820
|
};
|
|
3792
3821
|
}
|
|
@@ -4086,15 +4115,15 @@ const getBackgroundColor = (type)=>{
|
|
|
4086
4115
|
}
|
|
4087
4116
|
};
|
|
4088
4117
|
const ToastContainer = /*#__PURE__*/ styled(Card, {
|
|
4089
|
-
target: "
|
|
4118
|
+
target: "eb8x2sp0",
|
|
4090
4119
|
label: "ToastContainer"
|
|
4091
4120
|
})("box-sizing:border-box;border-radius:3px;padding:12px;background-color:", (props)=>getBackgroundColor(props.type), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";margin:20px;font-size:14px;line-height:20px;transform:translateY(100%);transition:transform 0.3s ease;width:344px;display:flex;align-items:center;position:relative;& svg{width:20px;height:20px;fill:currentColor;}@media (max-width:480px){&{margin:0;width:100vw;border-radius:0;}}.nf-layer-enter &{transform:translateY(0%);}");
|
|
4092
4121
|
const TextContainer = /*#__PURE__*/ styled("div", {
|
|
4093
|
-
target: "
|
|
4122
|
+
target: "eb8x2sp1",
|
|
4094
4123
|
label: "TextContainer"
|
|
4095
4124
|
})("flex:1;");
|
|
4096
4125
|
const CloseContainer = /*#__PURE__*/ styled("button", {
|
|
4097
|
-
target: "
|
|
4126
|
+
target: "eb8x2sp2",
|
|
4098
4127
|
label: "CloseContainer"
|
|
4099
4128
|
})("background-color:transparent;color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";padding:6px 10px;border:none;border-radius:3px;text-transform:uppercase;cursor:pointer;&:focus{background-color:rgba(255,255,255,0.1);}");
|
|
4100
4129
|
const DEFAULT_DURATION = 2000;
|
|
@@ -4156,7 +4185,9 @@ class Toast {
|
|
|
4156
4185
|
})
|
|
4157
4186
|
});
|
|
4158
4187
|
const Component = this.toast[0];
|
|
4159
|
-
|
|
4188
|
+
if (!this.root) {
|
|
4189
|
+
this.root = client.createRoot(this.element);
|
|
4190
|
+
}
|
|
4160
4191
|
this.root.render(/*#__PURE__*/ jsxRuntime.jsx(Component, {}));
|
|
4161
4192
|
this.timeout = setTimeout(()=>{
|
|
4162
4193
|
this.remove();
|