no-frills-ui 0.0.14-alpha.10 → 0.0.14-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/index.js +329 -170
- package/dist/index.js.map +1 -1
- package/lib-esm/components/Accordion/Accordion.js +3 -2
- package/lib-esm/components/Accordion/Accordion.js.map +1 -1
- package/lib-esm/components/Accordion/AccordionStep.js +13 -9
- package/lib-esm/components/Accordion/AccordionStep.js.map +1 -1
- package/lib-esm/components/Badge/Badge.js +6 -2
- package/lib-esm/components/Badge/Badge.js.map +1 -1
- package/lib-esm/components/Button/ActionButton.js +6 -2
- package/lib-esm/components/Button/ActionButton.js.map +1 -1
- package/lib-esm/components/Button/Button.js +6 -2
- package/lib-esm/components/Button/Button.js.map +1 -1
- package/lib-esm/components/Button/IconButton.js +6 -2
- package/lib-esm/components/Button/IconButton.js.map +1 -1
- package/lib-esm/components/Button/LinkButton.js +6 -2
- package/lib-esm/components/Button/LinkButton.js.map +1 -1
- package/lib-esm/components/Button/RaisedButton.js +6 -2
- package/lib-esm/components/Button/RaisedButton.js.map +1 -1
- package/lib-esm/components/Card/Card.js +6 -2
- package/lib-esm/components/Card/Card.js.map +1 -1
- package/lib-esm/components/Chip/Chip.js +7 -3
- package/lib-esm/components/Chip/Chip.js.map +1 -1
- package/lib-esm/components/ChipInput/ChipInput.d.ts +3 -3
- package/lib-esm/components/ChipInput/ChipInput.js +10 -4
- package/lib-esm/components/ChipInput/ChipInput.js.map +1 -1
- package/lib-esm/components/Dialog/Dialog.d.ts +2 -0
- package/lib-esm/components/Dialog/Dialog.js +9 -2
- package/lib-esm/components/Dialog/Dialog.js.map +1 -1
- package/lib-esm/components/Dialog/PromptDialog.js +5 -3
- package/lib-esm/components/Dialog/PromptDialog.js.map +1 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.js +6 -2
- package/lib-esm/components/DragAndDrop/DragAndDrop.js.map +1 -1
- package/lib-esm/components/Drawer/Drawer.d.ts +6 -2
- package/lib-esm/components/Drawer/Drawer.js +32 -24
- package/lib-esm/components/Drawer/Drawer.js.map +1 -1
- package/lib-esm/components/Groups/Group.d.ts +4 -3
- package/lib-esm/components/Groups/Group.js +7 -3
- package/lib-esm/components/Groups/Group.js.map +1 -1
- package/lib-esm/components/Input/Checkbox.js +8 -4
- package/lib-esm/components/Input/Checkbox.js.map +1 -1
- package/lib-esm/components/Input/Dropdown.d.ts +5 -6
- package/lib-esm/components/Input/Dropdown.js +6 -1
- package/lib-esm/components/Input/Dropdown.js.map +1 -1
- package/lib-esm/components/Input/Input.d.ts +5 -0
- package/lib-esm/components/Input/Input.js +12 -6
- package/lib-esm/components/Input/Input.js.map +1 -1
- package/lib-esm/components/Input/Radio.js +8 -4
- package/lib-esm/components/Input/Radio.js.map +1 -1
- package/lib-esm/components/Input/RadioButton.js +8 -4
- package/lib-esm/components/Input/RadioButton.js.map +1 -1
- package/lib-esm/components/Input/Select.js +13 -7
- package/lib-esm/components/Input/Select.js.map +1 -1
- package/lib-esm/components/Input/TextArea.js +12 -6
- package/lib-esm/components/Input/TextArea.js.map +1 -1
- package/lib-esm/components/Input/Toggle.js +7 -3
- package/lib-esm/components/Input/Toggle.js.map +1 -1
- package/lib-esm/components/Menu/Menu.js +6 -1
- package/lib-esm/components/Menu/Menu.js.map +1 -1
- package/lib-esm/components/Menu/MenuItem.d.ts +6 -0
- package/lib-esm/components/Menu/MenuItem.js +7 -2
- package/lib-esm/components/Menu/MenuItem.js.map +1 -1
- package/lib-esm/components/Modal/Modal.d.ts +6 -2
- package/lib-esm/components/Modal/Modal.js +31 -27
- package/lib-esm/components/Modal/Modal.js.map +1 -1
- package/lib-esm/components/Notification/Notification.d.ts +2 -0
- package/lib-esm/components/Notification/Notification.js +13 -7
- 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/Notification/index.d.ts +1 -0
- package/lib-esm/components/Popover/Popover.js +7 -3
- package/lib-esm/components/Popover/Popover.js.map +1 -1
- package/lib-esm/components/Spinner/Spinner.js +6 -2
- package/lib-esm/components/Spinner/Spinner.js.map +1 -1
- package/lib-esm/components/Stepper/Step.js +6 -2
- package/lib-esm/components/Stepper/Step.js.map +1 -1
- package/lib-esm/components/Stepper/Stepper.js +17 -10
- package/lib-esm/components/Stepper/Stepper.js.map +1 -1
- package/lib-esm/components/Tabs/Tabs.d.ts +1 -1
- package/lib-esm/components/Tabs/Tabs.js +22 -14
- package/lib-esm/components/Tabs/Tabs.js.map +1 -1
- package/lib-esm/components/Tooltip/Tooltip.js +7 -3
- package/lib-esm/components/Tooltip/Tooltip.js.map +1 -1
- package/lib-esm/index.js +43 -0
- package/lib-esm/shared/LayerManager.d.ts +2 -2
- package/lib-esm/shared/LayerManager.js +1 -1
- package/lib-esm/shared/LayerManager.js.map +1 -1
- package/package.json +28 -18
- package/lib-esm/components/index.js +0 -43
- /package/lib-esm/{components/index.js.map → index.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -24,9 +24,10 @@ function Accordion(props) {
|
|
|
24
24
|
if (!/*#__PURE__*/ React.isValidElement(child)) {
|
|
25
25
|
return child;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const reactElement = child;
|
|
28
|
+
return /*#__PURE__*/ React.cloneElement(reactElement, {
|
|
28
29
|
open: active === index,
|
|
29
|
-
onStepClick: onStepClick(index,
|
|
30
|
+
onStepClick: onStepClick(index, reactElement.props.disabled || false)
|
|
30
31
|
});
|
|
31
32
|
})
|
|
32
33
|
});
|
|
@@ -267,7 +268,7 @@ var BADGE_TYPE = /*#__PURE__*/ function(BADGE_TYPE) {
|
|
|
267
268
|
return BADGE_TYPE;
|
|
268
269
|
}({});
|
|
269
270
|
const BadgeSpan = /*#__PURE__*/ styled("span", {
|
|
270
|
-
target: "
|
|
271
|
+
target: "e1aaenck0",
|
|
271
272
|
label: "BadgeSpan"
|
|
272
273
|
})("background-color:", (props)=>{
|
|
273
274
|
switch(props.type){
|
|
@@ -283,7 +284,11 @@ const BadgeSpan = /*#__PURE__*/ styled("span", {
|
|
|
283
284
|
return getThemeValue(THEME_NAME.PRIMARY);
|
|
284
285
|
}
|
|
285
286
|
}, ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:10px;padding:", (props)=>props.children ? '3px 10px' : '4px', ";display:inline-block;min-height:4px;min-width:4px;font-size:12px;margin:", (props)=>props.inline ? '0 5px' : '0', ";", (props)=>!props.inline && 'position: absolute; top: 0; right: 0; transform: translate(50%, -50%);', ";");
|
|
286
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Badge Component
|
|
289
|
+
* @param props - Component props
|
|
290
|
+
* @param ref - Ref forwarded to the underlying HTMLSpanElement
|
|
291
|
+
*/ function BadgeComponent(props, ref) {
|
|
287
292
|
return /*#__PURE__*/ jsxRuntime.jsx(BadgeSpan, {
|
|
288
293
|
...props,
|
|
289
294
|
ref: ref
|
|
@@ -292,10 +297,14 @@ function BadgeComponent(props, ref) {
|
|
|
292
297
|
const Badge = /*#__PURE__*/ React.forwardRef(BadgeComponent);
|
|
293
298
|
|
|
294
299
|
const StyledCard = /*#__PURE__*/ styled("div", {
|
|
295
|
-
target: "
|
|
300
|
+
target: "ebufzie0",
|
|
296
301
|
label: "StyledCard"
|
|
297
302
|
})("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:auto;position:relative;");
|
|
298
|
-
|
|
303
|
+
/**
|
|
304
|
+
* Card Component
|
|
305
|
+
* @param props - Component props
|
|
306
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
307
|
+
*/ function CardComponent(props, ref) {
|
|
299
308
|
return /*#__PURE__*/ jsxRuntime.jsx(StyledCard, {
|
|
300
309
|
...props,
|
|
301
310
|
ref: ref
|
|
@@ -304,38 +313,42 @@ function CardComponent(props, ref) {
|
|
|
304
313
|
const Card = /*#__PURE__*/ React.forwardRef(CardComponent);
|
|
305
314
|
|
|
306
315
|
const Step$1 = /*#__PURE__*/ styled(Card, {
|
|
307
|
-
target: "
|
|
316
|
+
target: "e14f46gi0",
|
|
308
317
|
label: "Step"
|
|
309
318
|
})("transition:all 0.6s ease;overflow:visible;", (props)=>props.open && `margin: 20px 5px;`);
|
|
310
319
|
const StepHeader = /*#__PURE__*/ styled("button", {
|
|
311
|
-
target: "
|
|
320
|
+
target: "e14f46gi1",
|
|
312
321
|
label: "StepHeader"
|
|
313
322
|
})("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.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`);
|
|
314
323
|
const HeaderContainer = /*#__PURE__*/ styled("div", {
|
|
315
|
-
target: "
|
|
324
|
+
target: "e14f46gi2",
|
|
316
325
|
label: "HeaderContainer"
|
|
317
326
|
})("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;}");
|
|
318
327
|
const ExpandContainer = /*#__PURE__*/ styled("div", {
|
|
319
|
-
target: "
|
|
328
|
+
target: "e14f46gi3",
|
|
320
329
|
label: "ExpandContainer"
|
|
321
330
|
})("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); }` : '');
|
|
322
331
|
const StepBody = /*#__PURE__*/ styled("div", {
|
|
323
|
-
target: "
|
|
332
|
+
target: "e14f46gi4",
|
|
324
333
|
label: "StepBody"
|
|
325
334
|
})("transition:all 0.6s ease;overflow:hidden;height:", (props)=>props.height || 0, "px;");
|
|
326
335
|
const AccordionBadge = /*#__PURE__*/ styled(Badge, {
|
|
327
|
-
target: "
|
|
336
|
+
target: "e14f46gi5",
|
|
328
337
|
label: "AccordionBadge"
|
|
329
338
|
})("margin-right:15px;");
|
|
330
339
|
const AccordionStepBody = /*#__PURE__*/ styled("div", {
|
|
331
|
-
target: "
|
|
340
|
+
target: "e14f46gi6",
|
|
332
341
|
label: "AccordionStepBody"
|
|
333
342
|
})("padding:20px 15px;");
|
|
334
343
|
const AccordionStepFooter = /*#__PURE__*/ styled("div", {
|
|
335
|
-
target: "
|
|
344
|
+
target: "e14f46gi7",
|
|
336
345
|
label: "AccordionStepFooter"
|
|
337
346
|
})("display:flex;justify-content:flex-end;padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";");
|
|
338
|
-
|
|
347
|
+
/**
|
|
348
|
+
* AccordionStep Component
|
|
349
|
+
* @param props - Component props
|
|
350
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
351
|
+
*/ function AccordionStepComponent(props, ref) {
|
|
339
352
|
const [height, setHeight] = React.useState(0);
|
|
340
353
|
const { open, disabled = false, header, errorText, completed = false, onStepClick, children, ...restProps } = props;
|
|
341
354
|
// Generate unique IDs for ARIA relationships
|
|
@@ -407,10 +420,14 @@ function AccordionStepComponent(props, ref) {
|
|
|
407
420
|
const AccordionStep = /*#__PURE__*/ React.forwardRef(AccordionStepComponent);
|
|
408
421
|
|
|
409
422
|
const StyledButton = /*#__PURE__*/ styled("button", {
|
|
410
|
-
target: "
|
|
423
|
+
target: "e123477w0",
|
|
411
424
|
label: "StyledButton"
|
|
412
425
|
})("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;margin-left:-6px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
413
|
-
|
|
426
|
+
/**
|
|
427
|
+
* Button Component
|
|
428
|
+
* @param props - Component props
|
|
429
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
430
|
+
*/ function ButtonComponent(props, ref) {
|
|
414
431
|
const { type = 'button', ...rest } = props;
|
|
415
432
|
return /*#__PURE__*/ jsxRuntime.jsx(StyledButton, {
|
|
416
433
|
ref: ref,
|
|
@@ -421,10 +438,14 @@ function ButtonComponent(props, ref) {
|
|
|
421
438
|
const Button$2 = /*#__PURE__*/ React.forwardRef(ButtonComponent);
|
|
422
439
|
|
|
423
440
|
const StyledLinkButton = /*#__PURE__*/ styled("button", {
|
|
424
|
-
target: "
|
|
441
|
+
target: "e1d039580",
|
|
425
442
|
label: "StyledLinkButton"
|
|
426
443
|
})("min-width:100px;font-size:14px;text-align:center;height:32px;cursor:pointer;background-color:transparent;border:none;color:", getThemeValue(THEME_NAME.PRIMARY), ";padding:0 12px;margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;margin-left:-6px;}&:enabled:hover,&:focus{text-decoration:underline;}&:disabled{border-color:", getThemeValue(THEME_NAME.BORDER_COLOR), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
427
|
-
|
|
444
|
+
/**
|
|
445
|
+
* LinkButton Component
|
|
446
|
+
* @param props - Component props
|
|
447
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
448
|
+
*/ const LinkButtonComponent = (props, ref)=>{
|
|
428
449
|
const { type = 'button', ...rest } = props;
|
|
429
450
|
return /*#__PURE__*/ jsxRuntime.jsx(StyledLinkButton, {
|
|
430
451
|
ref: ref,
|
|
@@ -435,10 +456,14 @@ const LinkButtonComponent = (props, ref)=>{
|
|
|
435
456
|
const LinkButton = /*#__PURE__*/ React.forwardRef(LinkButtonComponent);
|
|
436
457
|
|
|
437
458
|
const StyledRaisedButton = /*#__PURE__*/ styled("button", {
|
|
438
|
-
target: "
|
|
459
|
+
target: "e1p6mbrx0",
|
|
439
460
|
label: "StyledRaisedButton"
|
|
440
461
|
})("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";color:inherit;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transform:translateY(-2px);box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;margin-left:-6px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}&:active{transform:translateY(0);box-shadow:", getThemeValue(THEME_NAME.SHADOW), ";}");
|
|
441
|
-
|
|
462
|
+
/**
|
|
463
|
+
* RaisedButton Component
|
|
464
|
+
* @param props - Component props
|
|
465
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
466
|
+
*/ const RaisedButtonComponent = (props, ref)=>{
|
|
442
467
|
const { type = 'button', ...rest } = props;
|
|
443
468
|
return /*#__PURE__*/ jsxRuntime.jsx(StyledRaisedButton, {
|
|
444
469
|
ref: ref,
|
|
@@ -449,10 +474,14 @@ const RaisedButtonComponent = (props, ref)=>{
|
|
|
449
474
|
const RaisedButton = /*#__PURE__*/ React.forwardRef(RaisedButtonComponent);
|
|
450
475
|
|
|
451
476
|
const StyledActionButton = /*#__PURE__*/ styled("button", {
|
|
452
|
-
target: "
|
|
477
|
+
target: "ec49rx60",
|
|
453
478
|
label: "StyledActionButton"
|
|
454
479
|
})("border:1px solid ", getThemeValue(THEME_NAME.PRIMARY), ";background-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:pointer;margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;margin-left:-6px;}&:enabled:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}&:focus{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{border:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
455
|
-
|
|
480
|
+
/**
|
|
481
|
+
* ActionButton Component
|
|
482
|
+
* @param props - Component props
|
|
483
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
484
|
+
*/ function ActionButtonComponent(props, ref) {
|
|
456
485
|
const { type = 'button', ...rest } = props;
|
|
457
486
|
return /*#__PURE__*/ jsxRuntime.jsx(StyledActionButton, {
|
|
458
487
|
ref: ref,
|
|
@@ -463,10 +492,14 @@ function ActionButtonComponent(props, ref) {
|
|
|
463
492
|
const ActionButton = /*#__PURE__*/ React.forwardRef(ActionButtonComponent);
|
|
464
493
|
|
|
465
494
|
const StyledIconButton = /*#__PURE__*/ styled("button", {
|
|
466
|
-
target: "
|
|
495
|
+
target: "efmjh6j0",
|
|
467
496
|
label: "StyledIconButton"
|
|
468
497
|
})("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;font-size:14px;text-align:center;padding:0 3px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}&:disabled > svg{fill:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
469
|
-
|
|
498
|
+
/**
|
|
499
|
+
* IconButton Component
|
|
500
|
+
* @param props - Component props
|
|
501
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
502
|
+
*/ function IconButtonComponent(props, ref) {
|
|
470
503
|
const { type = 'button', ...rest } = props;
|
|
471
504
|
return /*#__PURE__*/ jsxRuntime.jsx(StyledIconButton, {
|
|
472
505
|
ref: ref,
|
|
@@ -477,14 +510,18 @@ function IconButtonComponent(props, ref) {
|
|
|
477
510
|
const IconButton = /*#__PURE__*/ React.forwardRef(IconButtonComponent);
|
|
478
511
|
|
|
479
512
|
const Container$8 = /*#__PURE__*/ styled("span", {
|
|
480
|
-
target: "
|
|
513
|
+
target: "eg8hsap0",
|
|
481
514
|
label: "Container"
|
|
482
515
|
})("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;");
|
|
483
516
|
const Button$1 = /*#__PURE__*/ styled("button", {
|
|
484
|
-
target: "
|
|
517
|
+
target: "eg8hsap1",
|
|
485
518
|
label: "Button"
|
|
486
519
|
})("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), ";}");
|
|
487
|
-
|
|
520
|
+
/**
|
|
521
|
+
* Chip Component
|
|
522
|
+
* @param props - Component props
|
|
523
|
+
* @param ref - Ref forwarded to the underlying HTMLSpanElement
|
|
524
|
+
*/ function ChipComponent(props, ref) {
|
|
488
525
|
const { label, onCloseClick, closeButtonAriaLabel, ...rest } = props;
|
|
489
526
|
const keyUpHandler = (e)=>{
|
|
490
527
|
if (e.key === 'Backspace' || e.key === 'Delete') {
|
|
@@ -782,11 +819,11 @@ const DragContext = React.createContext(null);
|
|
|
782
819
|
}
|
|
783
820
|
|
|
784
821
|
/** Container Component */ const Container$6 = /*#__PURE__*/ styled("div", {
|
|
785
|
-
target: "
|
|
822
|
+
target: "e18d6tqk0",
|
|
786
823
|
label: "Container"
|
|
787
824
|
})("flex:1;display:flex;position:relative;flex-wrap:wrap;flex-direction:", (props)=>props.orientation === ORIENTATION.HORIZONTAL ? 'row' : 'column', ";");
|
|
788
825
|
/** Visually hidden but accessible to screen readers */ const VisuallyHidden$2 = /*#__PURE__*/ styled("div", {
|
|
789
|
-
target: "
|
|
826
|
+
target: "e18d6tqk1",
|
|
790
827
|
label: "VisuallyHidden"
|
|
791
828
|
})("position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;");
|
|
792
829
|
/**
|
|
@@ -813,6 +850,10 @@ const DragContext = React.createContext(null);
|
|
|
813
850
|
* @param props.children - Child elements to be rendered as draggable items
|
|
814
851
|
*
|
|
815
852
|
* @returns A draggable container with reorderable items
|
|
853
|
+
*/ /**
|
|
854
|
+
* DragAndDrop Component
|
|
855
|
+
* @param props - Component props
|
|
856
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
816
857
|
*/ function DragAndDropComponent(props, ref) {
|
|
817
858
|
const { orientation = ORIENTATION.VERTICAL, children, onDrop, showIndicator = false, itemAriaLabelTemplate = 'Item {:position}. Press {:grabKey} to grab, {:moveKeys} to move, {:dropKey} or {:altDropKey} to drop', dragHandleAriaLabel = 'Drag to reorder', grabbedAnnouncementTemplate = 'Item {:position} grabbed. Use {:moveKeys} to move, {:dropKey} or {:altDropKey} to drop, {:cancelKey} to cancel', movedAnnouncementTemplate = 'Item moved to position {:position}', droppedAnnouncementTemplate = 'Item dropped at position {:position}', cancelledAnnouncementTemplate = 'Drag cancelled, item restored to original position', ...rest } = props;
|
|
818
859
|
const [startIndex, setStartIndex] = React.useState(null);
|
|
@@ -909,7 +950,7 @@ const DragAndDrop = /*#__PURE__*/ React.forwardRef(DragAndDropComponent);
|
|
|
909
950
|
|
|
910
951
|
// Label component for the ChipInput
|
|
911
952
|
const Label$6 = /*#__PURE__*/ styled("label", {
|
|
912
|
-
target: "
|
|
953
|
+
target: "e12jan4z0",
|
|
913
954
|
label: "Label"
|
|
914
955
|
})("display:inline-flex;flex-direction:column;flex:1;position:relative;margin:10px 5px;color:inherit;padding:0 8px;width:250px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";&: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 ? `
|
|
915
956
|
&:has(:invalid) {
|
|
@@ -939,12 +980,12 @@ const Label$6 = /*#__PURE__*/ styled("label", {
|
|
|
939
980
|
` : '');
|
|
940
981
|
// Error message container
|
|
941
982
|
const ErrorContainer$4 = /*#__PURE__*/ styled("div", {
|
|
942
|
-
target: "
|
|
983
|
+
target: "e12jan4z1",
|
|
943
984
|
label: "ErrorContainer"
|
|
944
985
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
945
986
|
// Visually hidden but accessible to screen readers
|
|
946
987
|
const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
947
|
-
target: "
|
|
988
|
+
target: "e12jan4z2",
|
|
948
989
|
label: "VisuallyHidden"
|
|
949
990
|
})("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;}");
|
|
950
991
|
/**
|
|
@@ -975,10 +1016,16 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
|
|
|
975
1016
|
if (!template) return undefined;
|
|
976
1017
|
return template.replace(/\{:label\}/g, label);
|
|
977
1018
|
};
|
|
1019
|
+
const prevPropValueRef = React.useRef(undefined);
|
|
978
1020
|
// Sync internal value with props.value
|
|
979
1021
|
React.useEffect(()=>{
|
|
980
1022
|
if (Array.isArray(propValue)) {
|
|
981
|
-
|
|
1023
|
+
const prevValue = prevPropValueRef.current;
|
|
1024
|
+
const isEqual = prevValue && propValue.length === prevValue.length && propValue.every((val, index)=>val === prevValue[index]);
|
|
1025
|
+
if (!isEqual) {
|
|
1026
|
+
setValue(propValue);
|
|
1027
|
+
prevPropValueRef.current = propValue;
|
|
1028
|
+
}
|
|
982
1029
|
}
|
|
983
1030
|
}, [
|
|
984
1031
|
propValue
|
|
@@ -1124,7 +1171,7 @@ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
|
|
|
1124
1171
|
[6]: 'top: 0; left: 0; justify-content: center; align-items: center;'
|
|
1125
1172
|
};
|
|
1126
1173
|
/** Layer container component. */ const Container$5 = /*#__PURE__*/ styled("div", {
|
|
1127
|
-
target: "
|
|
1174
|
+
target: "e6b1pc60",
|
|
1128
1175
|
label: "Container"
|
|
1129
1176
|
})("position:fixed;display:flex;opacity:0;transition:opacity 0.3s ease;", (props)=>POSITION_STYLE[props.position], " ", (props)=>props.overlay && `
|
|
1130
1177
|
width: 100%;
|
|
@@ -1388,7 +1435,7 @@ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
|
|
|
1388
1435
|
var LayerManager$1 = new LayerManager();
|
|
1389
1436
|
|
|
1390
1437
|
const DialogContainer = /*#__PURE__*/ styled(Card, {
|
|
1391
|
-
target: "
|
|
1438
|
+
target: "e1sxvvof0",
|
|
1392
1439
|
label: "DialogContainer"
|
|
1393
1440
|
})("max-width:768px;max-height:80vh;transform:scale(0);opacity:0;transition:all 0.3s ease;.nf-layer-enter &{opacity:1;transform:scale(1);}.nf-layer-exit &{opacity:0;transform:scale(0);}");
|
|
1394
1441
|
class Dialog extends React.Component {
|
|
@@ -1462,6 +1509,13 @@ class Dialog extends React.Component {
|
|
|
1462
1509
|
if (node) {
|
|
1463
1510
|
this.setInitialFocus(node);
|
|
1464
1511
|
}
|
|
1512
|
+
if (this.props.forwardRef) {
|
|
1513
|
+
if (typeof this.props.forwardRef === 'function') {
|
|
1514
|
+
this.props.forwardRef(node);
|
|
1515
|
+
} else {
|
|
1516
|
+
this.props.forwardRef.current = node;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1465
1519
|
}, /**
|
|
1466
1520
|
* Sets initial focus within the dialog.
|
|
1467
1521
|
* Tries to focus the header first, then the first interactive element, or falls back to the container.
|
|
@@ -1492,9 +1546,9 @@ class Dialog extends React.Component {
|
|
|
1492
1546
|
closeOnOverlayClick,
|
|
1493
1547
|
position: LAYER_POSITION.DIALOG,
|
|
1494
1548
|
component: /*#__PURE__*/ jsxRuntime.jsx(DialogContainer, {
|
|
1549
|
+
role: "dialog",
|
|
1495
1550
|
...rest,
|
|
1496
1551
|
ref: this.setDialogRef,
|
|
1497
|
-
role: "dialog",
|
|
1498
1552
|
"aria-modal": "true",
|
|
1499
1553
|
tabIndex: -1,
|
|
1500
1554
|
onKeyDown: this.handleKeyDown,
|
|
@@ -1621,11 +1675,11 @@ ConfirmDialog.defaultProps = {
|
|
|
1621
1675
|
};
|
|
1622
1676
|
|
|
1623
1677
|
const Label$5 = /*#__PURE__*/ styled("label", {
|
|
1624
|
-
target: "
|
|
1678
|
+
target: "el9i5v60",
|
|
1625
1679
|
label: "Label"
|
|
1626
1680
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
|
|
1627
1681
|
const TextField$1 = /*#__PURE__*/ styled("input", {
|
|
1628
|
-
target: "
|
|
1682
|
+
target: "el9i5v61",
|
|
1629
1683
|
label: "TextField"
|
|
1630
1684
|
})("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 ? `
|
|
1631
1685
|
&:invalid {
|
|
@@ -1650,16 +1704,22 @@ const TextField$1 = /*#__PURE__*/ styled("input", {
|
|
|
1650
1704
|
}
|
|
1651
1705
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1652
1706
|
const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
|
|
1653
|
-
target: "
|
|
1707
|
+
target: "el9i5v62",
|
|
1654
1708
|
label: "ErrorContainer"
|
|
1655
1709
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1656
|
-
|
|
1710
|
+
/**
|
|
1711
|
+
* Input Component
|
|
1712
|
+
* @param props - Component props
|
|
1713
|
+
* @param ref - Ref forwarded to the underlying HTMLInputElement
|
|
1714
|
+
*/ const Input$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
1657
1715
|
const [touched, setTouched] = React.useState(false);
|
|
1658
1716
|
const [value, setValue] = React.useState(props.value || '');
|
|
1659
1717
|
const errorId = React.useId();
|
|
1718
|
+
const prevValueRef = React.useRef(undefined);
|
|
1660
1719
|
React.useEffect(()=>{
|
|
1661
|
-
if (props.value !== undefined) {
|
|
1720
|
+
if (props.value !== undefined && props.value !== prevValueRef.current) {
|
|
1662
1721
|
setValue(props.value);
|
|
1722
|
+
prevValueRef.current = props.value;
|
|
1663
1723
|
}
|
|
1664
1724
|
}, [
|
|
1665
1725
|
props.value
|
|
@@ -1704,11 +1764,11 @@ const Input$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
|
1704
1764
|
Input$2.displayName = 'Input';
|
|
1705
1765
|
|
|
1706
1766
|
const Label$4 = /*#__PURE__*/ styled("label", {
|
|
1707
|
-
target: "
|
|
1767
|
+
target: "e1j32tnv0",
|
|
1708
1768
|
label: "Label"
|
|
1709
1769
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
|
|
1710
1770
|
const TextField = /*#__PURE__*/ styled("textarea", {
|
|
1711
|
-
target: "
|
|
1771
|
+
target: "e1j32tnv1",
|
|
1712
1772
|
label: "TextField"
|
|
1713
1773
|
})("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 ? `
|
|
1714
1774
|
&:invalid {
|
|
@@ -1733,17 +1793,23 @@ const TextField = /*#__PURE__*/ styled("textarea", {
|
|
|
1733
1793
|
}
|
|
1734
1794
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1735
1795
|
const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
|
|
1736
|
-
target: "
|
|
1796
|
+
target: "e1j32tnv2",
|
|
1737
1797
|
label: "ErrorContainer"
|
|
1738
1798
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1739
|
-
|
|
1799
|
+
/**
|
|
1800
|
+
* TextArea Component
|
|
1801
|
+
* @param props - Component props
|
|
1802
|
+
* @param ref - Ref forwarded to the underlying HTMLTextAreaElement
|
|
1803
|
+
*/ function TextAreaComponent(props, ref) {
|
|
1740
1804
|
const { label, errorText, value: propsValue, required, ...rest } = props;
|
|
1741
1805
|
const [touched, setTouched] = React.useState(false);
|
|
1742
1806
|
const [value, setValue] = React.useState(propsValue || '');
|
|
1743
1807
|
const errorId = React.useId();
|
|
1808
|
+
const prevValueRef = React.useRef(undefined);
|
|
1744
1809
|
React.useEffect(()=>{
|
|
1745
|
-
if (propsValue !== undefined) {
|
|
1810
|
+
if (propsValue !== undefined && propsValue !== prevValueRef.current) {
|
|
1746
1811
|
setValue(propsValue);
|
|
1812
|
+
prevValueRef.current = propsValue;
|
|
1747
1813
|
}
|
|
1748
1814
|
}, [
|
|
1749
1815
|
propsValue
|
|
@@ -1789,11 +1855,11 @@ function TextAreaComponent(props, ref) {
|
|
|
1789
1855
|
const TextArea = /*#__PURE__*/ React.forwardRef(TextAreaComponent);
|
|
1790
1856
|
|
|
1791
1857
|
const Label$3 = /*#__PURE__*/ styled("label", {
|
|
1792
|
-
target: "
|
|
1858
|
+
target: "e13b7jm0",
|
|
1793
1859
|
label: "Label"
|
|
1794
1860
|
})("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;pointer-events:none;max-width:268px;& svg{fill:currentColor;}");
|
|
1795
1861
|
const SelectField = /*#__PURE__*/ styled("select", {
|
|
1796
|
-
target: "
|
|
1862
|
+
target: "e13b7jm1",
|
|
1797
1863
|
label: "SelectField"
|
|
1798
1864
|
})("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 ? `
|
|
1799
1865
|
&:invalid {
|
|
@@ -1818,20 +1884,26 @@ const SelectField = /*#__PURE__*/ styled("select", {
|
|
|
1818
1884
|
}
|
|
1819
1885
|
` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
|
|
1820
1886
|
const ErrorContainer$1 = /*#__PURE__*/ styled("div", {
|
|
1821
|
-
target: "
|
|
1887
|
+
target: "e13b7jm2",
|
|
1822
1888
|
label: "ErrorContainer"
|
|
1823
1889
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
|
|
1824
1890
|
const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
|
|
1825
|
-
target: "
|
|
1891
|
+
target: "e13b7jm3",
|
|
1826
1892
|
label: "ArrowContainer"
|
|
1827
1893
|
})("position:absolute;right:8px;top:8px;");
|
|
1828
|
-
|
|
1894
|
+
/**
|
|
1895
|
+
* Select Component
|
|
1896
|
+
* @param props - Component props
|
|
1897
|
+
* @param ref - Ref forwarded to the underlying HTMLSelectElement
|
|
1898
|
+
*/ function SelectComponent(props, ref) {
|
|
1829
1899
|
const [touched, setTouched] = React.useState(false);
|
|
1830
1900
|
const [value, setValue] = React.useState(props.value || '');
|
|
1831
1901
|
const errorId = React.useId();
|
|
1902
|
+
const prevValueRef = React.useRef(undefined);
|
|
1832
1903
|
React.useEffect(()=>{
|
|
1833
|
-
if (props.value !== undefined) {
|
|
1904
|
+
if (props.value !== undefined && props.value !== prevValueRef.current) {
|
|
1834
1905
|
setValue(props.value);
|
|
1906
|
+
prevValueRef.current = props.value;
|
|
1835
1907
|
}
|
|
1836
1908
|
}, [
|
|
1837
1909
|
props.value
|
|
@@ -1885,18 +1957,22 @@ function SelectComponent(props, ref) {
|
|
|
1885
1957
|
const Select = /*#__PURE__*/ React.forwardRef(SelectComponent);
|
|
1886
1958
|
|
|
1887
1959
|
const Label$2 = /*#__PURE__*/ styled("label", {
|
|
1888
|
-
target: "
|
|
1960
|
+
target: "e10ud8wb0",
|
|
1889
1961
|
label: "Label"
|
|
1890
1962
|
})("margin:5px 0;position:relative;display:inline-flex;align-items:center;cursor:pointer;");
|
|
1891
1963
|
const StyledCheckmark = /*#__PURE__*/ styled("span", {
|
|
1892
|
-
target: "
|
|
1964
|
+
target: "e10ud8wb1",
|
|
1893
1965
|
label: "StyledCheckmark"
|
|
1894
1966
|
})("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;}");
|
|
1895
1967
|
const HiddenInput$1 = /*#__PURE__*/ styled("input", {
|
|
1896
|
-
target: "
|
|
1968
|
+
target: "e10ud8wb2",
|
|
1897
1969
|
label: "HiddenInput"
|
|
1898
1970
|
})("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), ";}");
|
|
1899
|
-
|
|
1971
|
+
/**
|
|
1972
|
+
* Checkbox Component
|
|
1973
|
+
* @param props - Component props
|
|
1974
|
+
* @param fwdRef - Ref forwarded to the underlying HTMLInputElement
|
|
1975
|
+
*/ function CheckboxComponent(props, fwdRef) {
|
|
1900
1976
|
const { label = '', indeterminate = false, checked, ...rest } = props;
|
|
1901
1977
|
const ref = React.useCallback((node)=>{
|
|
1902
1978
|
// Ensure the DOM `indeterminate` flag always matches the prop
|
|
@@ -1932,14 +2008,18 @@ function CheckboxComponent(props, fwdRef) {
|
|
|
1932
2008
|
const Checkbox = /*#__PURE__*/ React.forwardRef(CheckboxComponent);
|
|
1933
2009
|
|
|
1934
2010
|
const Switch = /*#__PURE__*/ styled("label", {
|
|
1935
|
-
target: "
|
|
2011
|
+
target: "e185uavx0",
|
|
1936
2012
|
label: "Switch"
|
|
1937
2013
|
})("position:relative;display:inline-flex;margin:5px 0;");
|
|
1938
2014
|
const Input$1 = /*#__PURE__*/ styled("input", {
|
|
1939
|
-
target: "
|
|
2015
|
+
target: "e185uavx1",
|
|
1940
2016
|
label: "Input"
|
|
1941
2017
|
})("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), ";}");
|
|
1942
|
-
|
|
2018
|
+
/**
|
|
2019
|
+
* Toggle Component
|
|
2020
|
+
* @param props - Component props
|
|
2021
|
+
* @param ref - Ref forwarded to the underlying HTMLInputElement
|
|
2022
|
+
*/ function ToggleComponent(props, ref) {
|
|
1943
2023
|
return /*#__PURE__*/ jsxRuntime.jsxs(Switch, {
|
|
1944
2024
|
children: [
|
|
1945
2025
|
/*#__PURE__*/ jsxRuntime.jsx(Input$1, {
|
|
@@ -1959,18 +2039,22 @@ function ToggleComponent(props, ref) {
|
|
|
1959
2039
|
const Toggle = /*#__PURE__*/ React.forwardRef(ToggleComponent);
|
|
1960
2040
|
|
|
1961
2041
|
const Label$1 = /*#__PURE__*/ styled("label", {
|
|
1962
|
-
target: "
|
|
2042
|
+
target: "e12cx2u30",
|
|
1963
2043
|
label: "Label"
|
|
1964
2044
|
})("display:inline-flex;align-items:center;margin:5px 0;cursor:pointer;position:relative;");
|
|
1965
2045
|
const StyledRadio = /*#__PURE__*/ styled("span", {
|
|
1966
|
-
target: "
|
|
2046
|
+
target: "e12cx2u31",
|
|
1967
2047
|
label: "StyledRadio"
|
|
1968
2048
|
})("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;}");
|
|
1969
2049
|
const HiddenInput = /*#__PURE__*/ styled("input", {
|
|
1970
|
-
target: "
|
|
2050
|
+
target: "e12cx2u32",
|
|
1971
2051
|
label: "HiddenInput"
|
|
1972
2052
|
})("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;}");
|
|
1973
|
-
|
|
2053
|
+
/**
|
|
2054
|
+
* Radio Component
|
|
2055
|
+
* @param props - Component props
|
|
2056
|
+
* @param ref - Ref forwarded to the underlying HTMLInputElement
|
|
2057
|
+
*/ function RadioComponent(props, ref) {
|
|
1974
2058
|
const { label, ...rest } = props;
|
|
1975
2059
|
return /*#__PURE__*/ jsxRuntime.jsxs(Label$1, {
|
|
1976
2060
|
children: [
|
|
@@ -1989,18 +2073,22 @@ function RadioComponent(props, ref) {
|
|
|
1989
2073
|
const Radio = /*#__PURE__*/ React.forwardRef(RadioComponent);
|
|
1990
2074
|
|
|
1991
2075
|
const Input = /*#__PURE__*/ styled("input", {
|
|
1992
|
-
target: "
|
|
2076
|
+
target: "e1yp0s5y0",
|
|
1993
2077
|
label: "Input"
|
|
1994
2078
|
})("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), ";}");
|
|
1995
2079
|
const Label = /*#__PURE__*/ styled("label", {
|
|
1996
|
-
target: "
|
|
2080
|
+
target: "e1yp0s5y1",
|
|
1997
2081
|
label: "Label"
|
|
1998
2082
|
})("display:inline-flex;&:focus-within{z-index:1;}");
|
|
1999
2083
|
const RadioGroup = /*#__PURE__*/ styled("div", {
|
|
2000
|
-
target: "
|
|
2084
|
+
target: "e1yp0s5y2",
|
|
2001
2085
|
label: "RadioGroup"
|
|
2002
2086
|
})("display:inline-flex;align-items:center;border-radius:3px;margin:5px 0;& ", Label, ":first-child > span{border-radius:3px 0 0 3px;}& ", Label, ":last-child > span{border-radius:0 3px 3px 0;}");
|
|
2003
|
-
|
|
2087
|
+
/**
|
|
2088
|
+
* RadioButton Component
|
|
2089
|
+
* @param props - Component props
|
|
2090
|
+
* @param ref - Ref forwarded to the underlying HTMLInputElement
|
|
2091
|
+
*/ function RadioButtonComponent(props, ref) {
|
|
2004
2092
|
const { label, ...rest } = props;
|
|
2005
2093
|
return /*#__PURE__*/ jsxRuntime.jsxs(Label, {
|
|
2006
2094
|
children: [
|
|
@@ -2021,7 +2109,7 @@ const RadioButton = /*#__PURE__*/ React.forwardRef(RadioButtonComponent);
|
|
|
2021
2109
|
var MenuContext = React.createContext(undefined);
|
|
2022
2110
|
|
|
2023
2111
|
const MenuContainer = /*#__PURE__*/ styled("div", {
|
|
2024
|
-
target: "
|
|
2112
|
+
target: "e1qc23xy0",
|
|
2025
2113
|
label: "MenuContainer"
|
|
2026
2114
|
})("flex:1;display:flex;flex-direction:column;& div:last-child{border-bottom:none;}&:focus-within{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}");
|
|
2027
2115
|
/**
|
|
@@ -2031,6 +2119,11 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
|
|
|
2031
2119
|
* @template T - The type of value(s) in the menu.
|
|
2032
2120
|
* @param props - The menu properties.
|
|
2033
2121
|
* @param ref - The ref forwarded to the menu container.
|
|
2122
|
+
*/ /**
|
|
2123
|
+
* Menu Component
|
|
2124
|
+
* @template T - The type of value(s) in the menu.
|
|
2125
|
+
* @param props - Component props
|
|
2126
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
2034
2127
|
*/ function MenuInner(props, ref) {
|
|
2035
2128
|
const { multiSelect = false, onChange, value: propValue, children, ...rest } = props;
|
|
2036
2129
|
// State holds either a single T or an array of T when multiSelect
|
|
@@ -2143,10 +2236,15 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
|
|
|
2143
2236
|
const Menu = /*#__PURE__*/ React.forwardRef(MenuInner);
|
|
2144
2237
|
|
|
2145
2238
|
const Container$4 = /*#__PURE__*/ styled("button", {
|
|
2146
|
-
target: "
|
|
2239
|
+
target: "ebwocs30",
|
|
2147
2240
|
label: "Container"
|
|
2148
2241
|
})("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;}");
|
|
2149
|
-
|
|
2242
|
+
/**
|
|
2243
|
+
* MenuItem Component
|
|
2244
|
+
* @template T - The type of value in the menu item.
|
|
2245
|
+
* @param props - Component props
|
|
2246
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
2247
|
+
*/ const MenuItemInner = (props, ref)=>{
|
|
2150
2248
|
const context = React.useContext(MenuContext);
|
|
2151
2249
|
if (!context) {
|
|
2152
2250
|
throw new Error('`MenuItem` must be used within a `Menu` provider');
|
|
@@ -2211,17 +2309,21 @@ const positionMap$2 = {
|
|
|
2211
2309
|
`
|
|
2212
2310
|
};
|
|
2213
2311
|
const PopoverDiv = /*#__PURE__*/ styled("div", {
|
|
2214
|
-
target: "
|
|
2312
|
+
target: "ejcb1ps0",
|
|
2215
2313
|
label: "PopoverDiv"
|
|
2216
2314
|
})("position:relative;display:inline-flex;");
|
|
2217
2315
|
const Popper = /*#__PURE__*/ styled(Card, {
|
|
2218
|
-
target: "
|
|
2316
|
+
target: "ejcb1ps1",
|
|
2219
2317
|
label: "Popper"
|
|
2220
2318
|
})("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;}}");
|
|
2221
2319
|
const KEY_CODES = {
|
|
2222
2320
|
ESC: 27
|
|
2223
2321
|
};
|
|
2224
|
-
|
|
2322
|
+
/**
|
|
2323
|
+
* Popover Component
|
|
2324
|
+
* @param props - Component props
|
|
2325
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
2326
|
+
*/ function PopoverComponent(props, ref) {
|
|
2225
2327
|
const { open: propsOpen, element, position = "BOTTOM_LEFT", closeOnEsc = true, onClose, children, ...rest } = props;
|
|
2226
2328
|
const [open, setOpen] = React.useState(propsOpen);
|
|
2227
2329
|
const [closing, setClosing] = React.useState(false);
|
|
@@ -2420,7 +2522,7 @@ function PopoverComponent(props, ref) {
|
|
|
2420
2522
|
const Popover = /*#__PURE__*/ React.forwardRef(PopoverComponent);
|
|
2421
2523
|
|
|
2422
2524
|
const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
2423
|
-
target: "
|
|
2525
|
+
target: "e1d5dyoc0",
|
|
2424
2526
|
label: "ArrowContainer"
|
|
2425
2527
|
})("position:absolute;right:12px;top:16px;pointer-events:none;");
|
|
2426
2528
|
/**
|
|
@@ -2430,6 +2532,11 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2430
2532
|
* @template T - The type of the value(s) in the dropdown.
|
|
2431
2533
|
* @param props - The properties for the Dropdown component.
|
|
2432
2534
|
* @returns The rendered Dropdown component.
|
|
2535
|
+
*/ /**
|
|
2536
|
+
* Dropdown Component
|
|
2537
|
+
* @template T - The type of value(s) in the dropdown.
|
|
2538
|
+
* @param props - Component props
|
|
2539
|
+
* @param outerRef - Ref forwarded to the underlying HTMLInputElement
|
|
2433
2540
|
*/ function DropdownComponent(props, outerRef) {
|
|
2434
2541
|
const { multiSelect = false, onChange, children, value: propValue, label, errorText, required, disabled, ...rest } = props;
|
|
2435
2542
|
const [open, setOpen] = React.useState(false);
|
|
@@ -2557,15 +2664,15 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
|
|
|
2557
2664
|
const Dropdown = /*#__PURE__*/ React.forwardRef(DropdownComponent);
|
|
2558
2665
|
|
|
2559
2666
|
const BodyText = /*#__PURE__*/ styled("p", {
|
|
2560
|
-
target: "
|
|
2667
|
+
target: "e18k0mlw0",
|
|
2561
2668
|
label: "BodyText"
|
|
2562
2669
|
})("margin-top:0;");
|
|
2563
2670
|
const InputContainer = /*#__PURE__*/ styled("div", {
|
|
2564
|
-
target: "
|
|
2671
|
+
target: "e18k0mlw1",
|
|
2565
2672
|
label: "InputContainer"
|
|
2566
2673
|
})("display:flex;flex:1;margin-top:10px;& > label{flex:1;width:100%;padding:0;& > input{width:100%;padding:0 8px;box-sizing:border-box;}}");
|
|
2567
2674
|
const StyledInput = /*#__PURE__*/ styled(Input$2, {
|
|
2568
|
-
target: "
|
|
2675
|
+
target: "e18k0mlw2",
|
|
2569
2676
|
label: "StyledInput"
|
|
2570
2677
|
})("flex:1;padding:0;");
|
|
2571
2678
|
class PromptDialog extends React.Component {
|
|
@@ -2604,6 +2711,7 @@ class PromptDialog extends React.Component {
|
|
|
2604
2711
|
children: cancelText
|
|
2605
2712
|
}),
|
|
2606
2713
|
/*#__PURE__*/ jsxRuntime.jsx(ActionButton, {
|
|
2714
|
+
onClick: this.submit,
|
|
2607
2715
|
children: submitText
|
|
2608
2716
|
})
|
|
2609
2717
|
]
|
|
@@ -2619,6 +2727,7 @@ class PromptDialog extends React.Component {
|
|
|
2619
2727
|
});
|
|
2620
2728
|
}, this.cancel = ()=>this.dialog.current?.close(), this.submit = (e)=>{
|
|
2621
2729
|
e.preventDefault();
|
|
2730
|
+
if (!this.state.value) return;
|
|
2622
2731
|
this.dialog.current?.close(this.state.value);
|
|
2623
2732
|
}, this.show = ()=>{
|
|
2624
2733
|
return new Promise((resolve, reject)=>{
|
|
@@ -2674,7 +2783,7 @@ const positionStyle$1 = (size)=>({
|
|
|
2674
2783
|
}
|
|
2675
2784
|
});
|
|
2676
2785
|
const DrawerDiv = /*#__PURE__*/ styled("div", {
|
|
2677
|
-
target: "
|
|
2786
|
+
target: "e1topccf0",
|
|
2678
2787
|
label: "DrawerDiv"
|
|
2679
2788
|
})("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, "}");
|
|
2680
2789
|
const positionMap$1 = {
|
|
@@ -2698,6 +2807,8 @@ class Drawer extends React.Component {
|
|
|
2698
2807
|
*/ componentDidMount() {
|
|
2699
2808
|
if (this.props.open) {
|
|
2700
2809
|
this.lastFocusedElement = document.activeElement;
|
|
2810
|
+
// Handle initial open state
|
|
2811
|
+
this.handleOpen();
|
|
2701
2812
|
}
|
|
2702
2813
|
}
|
|
2703
2814
|
/**
|
|
@@ -2711,7 +2822,7 @@ class Drawer extends React.Component {
|
|
|
2711
2822
|
* Lifecycle method to handle Drawer updates.
|
|
2712
2823
|
* Manages opening/closing logic via LayerManager and focus preservation.
|
|
2713
2824
|
*/ getSnapshotBeforeUpdate(prevProps) {
|
|
2714
|
-
const { open
|
|
2825
|
+
const { open } = this.props;
|
|
2715
2826
|
if (prevProps.open && !open) {
|
|
2716
2827
|
this.closeCallback?.();
|
|
2717
2828
|
this.restoreFocus();
|
|
@@ -2719,29 +2830,9 @@ class Drawer extends React.Component {
|
|
|
2719
2830
|
if (!prevProps.open && open) {
|
|
2720
2831
|
// Save current focus
|
|
2721
2832
|
this.lastFocusedElement = document.activeElement;
|
|
2722
|
-
this.
|
|
2723
|
-
overlay,
|
|
2724
|
-
exitDelay: 300,
|
|
2725
|
-
position: positionMap$1[position],
|
|
2726
|
-
closeCallback: this.onClose,
|
|
2727
|
-
closeOnEsc,
|
|
2728
|
-
closeOnOverlayClick,
|
|
2729
|
-
component: /*#__PURE__*/ jsxRuntime.jsx(DrawerDiv, {
|
|
2730
|
-
...rest,
|
|
2731
|
-
ref: this.setDrawerRef,
|
|
2732
|
-
role: "dialog",
|
|
2733
|
-
"aria-modal": "true",
|
|
2734
|
-
tabIndex: -1,
|
|
2735
|
-
onKeyDown: this.handleKeyDown,
|
|
2736
|
-
position: position,
|
|
2737
|
-
size: size,
|
|
2738
|
-
onClick: (e)=>e.stopPropagation(),
|
|
2739
|
-
children: children
|
|
2740
|
-
})
|
|
2741
|
-
});
|
|
2742
|
-
this.closeCallback = this.layer[1];
|
|
2743
|
-
this.forceUpdate();
|
|
2833
|
+
this.handleOpen();
|
|
2744
2834
|
}
|
|
2835
|
+
return null;
|
|
2745
2836
|
}
|
|
2746
2837
|
/**
|
|
2747
2838
|
* Renders the Drawer component via the LayerManager portal.
|
|
@@ -2795,6 +2886,32 @@ class Drawer extends React.Component {
|
|
|
2795
2886
|
}
|
|
2796
2887
|
}
|
|
2797
2888
|
}, /**
|
|
2889
|
+
* Handles opening the drawer by creating the layer.
|
|
2890
|
+
*/ this.handleOpen = ()=>{
|
|
2891
|
+
const { closeOnEsc, closeOnOverlayClick, position, size, overlay, children, ...rest } = this.props;
|
|
2892
|
+
this.layer = LayerManager$1.renderLayer({
|
|
2893
|
+
overlay,
|
|
2894
|
+
exitDelay: 300,
|
|
2895
|
+
position: positionMap$1[position],
|
|
2896
|
+
closeCallback: this.onClose,
|
|
2897
|
+
closeOnEsc,
|
|
2898
|
+
closeOnOverlayClick,
|
|
2899
|
+
component: /*#__PURE__*/ jsxRuntime.jsx(DrawerDiv, {
|
|
2900
|
+
...rest,
|
|
2901
|
+
ref: this.setDrawerRef,
|
|
2902
|
+
role: "dialog",
|
|
2903
|
+
"aria-modal": "true",
|
|
2904
|
+
tabIndex: -1,
|
|
2905
|
+
onKeyDown: this.handleKeyDown,
|
|
2906
|
+
position: position,
|
|
2907
|
+
size: size,
|
|
2908
|
+
onClick: (e)=>e.stopPropagation(),
|
|
2909
|
+
children: children
|
|
2910
|
+
})
|
|
2911
|
+
});
|
|
2912
|
+
this.closeCallback = this.layer[1];
|
|
2913
|
+
this.forceUpdate();
|
|
2914
|
+
}, /**
|
|
2798
2915
|
* Restores focus to the element that was focused before the drawer opened.
|
|
2799
2916
|
*/ this.restoreFocus = ()=>{
|
|
2800
2917
|
if (this.lastFocusedElement) {
|
|
@@ -2859,7 +2976,7 @@ Drawer.defaultProps = {
|
|
|
2859
2976
|
};
|
|
2860
2977
|
|
|
2861
2978
|
const Container$3 = /*#__PURE__*/ styled("div", {
|
|
2862
|
-
target: "
|
|
2979
|
+
target: "eahc3qe0",
|
|
2863
2980
|
label: "Container"
|
|
2864
2981
|
})("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-child,& > label:first-child input,& > label:first-child select,& > *:first-child label,& > *:first-child 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 ? `
|
|
2865
2982
|
border-color: ${getThemeValue(THEME_NAME.ERROR)};
|
|
@@ -2869,10 +2986,14 @@ const Container$3 = /*#__PURE__*/ styled("div", {
|
|
|
2869
2986
|
}
|
|
2870
2987
|
` : '');
|
|
2871
2988
|
const ErrorContainer = /*#__PURE__*/ styled("div", {
|
|
2872
|
-
target: "
|
|
2989
|
+
target: "eahc3qe1",
|
|
2873
2990
|
label: "ErrorContainer"
|
|
2874
2991
|
})("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
|
|
2875
|
-
|
|
2992
|
+
/**
|
|
2993
|
+
* Group Component
|
|
2994
|
+
* @param props - Component props
|
|
2995
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
2996
|
+
*/ function GroupComponent(props, ref) {
|
|
2876
2997
|
const errorId = React.useId();
|
|
2877
2998
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2878
2999
|
children: [
|
|
@@ -2912,6 +3033,8 @@ class Modal extends React.Component {
|
|
|
2912
3033
|
*/ componentDidMount() {
|
|
2913
3034
|
if (this.props.open) {
|
|
2914
3035
|
this.lastFocusedElement = document.activeElement;
|
|
3036
|
+
// Handle initial open state
|
|
3037
|
+
this.handleOpen();
|
|
2915
3038
|
}
|
|
2916
3039
|
}
|
|
2917
3040
|
/**
|
|
@@ -2931,7 +3054,7 @@ class Modal extends React.Component {
|
|
|
2931
3054
|
* Lifecycle method to handle Modal updates.
|
|
2932
3055
|
* Manages opening/closing logic via LayerManager and focus preservation.
|
|
2933
3056
|
*/ getSnapshotBeforeUpdate(prevProps) {
|
|
2934
|
-
const { open
|
|
3057
|
+
const { open } = this.props;
|
|
2935
3058
|
if (prevProps.open && !open) {
|
|
2936
3059
|
this.closeCallback?.();
|
|
2937
3060
|
this.restoreFocus();
|
|
@@ -2939,28 +3062,9 @@ class Modal extends React.Component {
|
|
|
2939
3062
|
if (!prevProps.open && open) {
|
|
2940
3063
|
// Save current focus
|
|
2941
3064
|
this.lastFocusedElement = document.activeElement;
|
|
2942
|
-
this.
|
|
2943
|
-
overlay: true,
|
|
2944
|
-
exitDelay: 300,
|
|
2945
|
-
position: LAYER_POSITION.DIALOG,
|
|
2946
|
-
closeCallback: this.onClose,
|
|
2947
|
-
closeOnEsc: closeOnEsc,
|
|
2948
|
-
closeOnOverlayClick: closeOnOverlayClick,
|
|
2949
|
-
component: /*#__PURE__*/ jsxRuntime.jsx(DialogContainer, {
|
|
2950
|
-
...rest,
|
|
2951
|
-
ref: this.setModalRef,
|
|
2952
|
-
role: "dialog",
|
|
2953
|
-
"aria-modal": "true",
|
|
2954
|
-
tabIndex: -1,
|
|
2955
|
-
onKeyDown: this.handleKeyDown,
|
|
2956
|
-
onClick: (e)=>e.stopPropagation(),
|
|
2957
|
-
elevated: true,
|
|
2958
|
-
children: children
|
|
2959
|
-
})
|
|
2960
|
-
});
|
|
2961
|
-
this.closeCallback = this.layer[1];
|
|
2962
|
-
this.forceUpdate();
|
|
3065
|
+
this.handleOpen();
|
|
2963
3066
|
}
|
|
3067
|
+
return null;
|
|
2964
3068
|
}
|
|
2965
3069
|
/**
|
|
2966
3070
|
* Renders the Modal component via the LayerManager portal.
|
|
@@ -3012,6 +3116,31 @@ class Modal extends React.Component {
|
|
|
3012
3116
|
}
|
|
3013
3117
|
}
|
|
3014
3118
|
}, /**
|
|
3119
|
+
* Handles opening the modal by creating the layer.
|
|
3120
|
+
*/ this.handleOpen = ()=>{
|
|
3121
|
+
const { closeOnEsc, closeOnOverlayClick, children, ...rest } = this.props;
|
|
3122
|
+
this.layer = LayerManager$1.renderLayer({
|
|
3123
|
+
overlay: true,
|
|
3124
|
+
exitDelay: 300,
|
|
3125
|
+
position: LAYER_POSITION.DIALOG,
|
|
3126
|
+
closeCallback: this.onClose,
|
|
3127
|
+
closeOnEsc: closeOnEsc,
|
|
3128
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
|
3129
|
+
component: /*#__PURE__*/ jsxRuntime.jsx(DialogContainer, {
|
|
3130
|
+
...rest,
|
|
3131
|
+
ref: this.setModalRef,
|
|
3132
|
+
role: "dialog",
|
|
3133
|
+
"aria-modal": "true",
|
|
3134
|
+
tabIndex: -1,
|
|
3135
|
+
onKeyDown: this.handleKeyDown,
|
|
3136
|
+
onClick: (e)=>e.stopPropagation(),
|
|
3137
|
+
elevated: true,
|
|
3138
|
+
children: children
|
|
3139
|
+
})
|
|
3140
|
+
});
|
|
3141
|
+
this.closeCallback = this.layer[1];
|
|
3142
|
+
this.forceUpdate();
|
|
3143
|
+
}, /**
|
|
3015
3144
|
* Restores focus to the element that was focused before the modal opened.
|
|
3016
3145
|
*/ this.restoreFocus = ()=>{
|
|
3017
3146
|
if (this.lastFocusedElement) {
|
|
@@ -3035,11 +3164,7 @@ class Modal extends React.Component {
|
|
|
3035
3164
|
this.setInitialFocus(node);
|
|
3036
3165
|
}
|
|
3037
3166
|
if (this.props.forwardRef) {
|
|
3038
|
-
|
|
3039
|
-
this.props.forwardRef.current = node;
|
|
3040
|
-
} catch (e) {
|
|
3041
|
-
console.warn(e);
|
|
3042
|
-
}
|
|
3167
|
+
this.props.forwardRef.current = node;
|
|
3043
3168
|
}
|
|
3044
3169
|
}, /**
|
|
3045
3170
|
* Sets initial focus within the modal.
|
|
@@ -3368,6 +3493,7 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3368
3493
|
*/ this.pause = (id)=>()=>{
|
|
3369
3494
|
if (id && this.timeouts[id]) {
|
|
3370
3495
|
clearTimeout(this.timeouts[id]);
|
|
3496
|
+
delete this.timeouts[id];
|
|
3371
3497
|
}
|
|
3372
3498
|
}, /**
|
|
3373
3499
|
* Restart the removal of notification.
|
|
@@ -3391,6 +3517,7 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3391
3517
|
/** Notification class */ class Notification {
|
|
3392
3518
|
constructor(){
|
|
3393
3519
|
/** Helps in maintaining single instance for different positions. */ this.containers = new Map();
|
|
3520
|
+
/** Pending add requests waiting for manager to mount */ this.pending = new Map();
|
|
3394
3521
|
/**
|
|
3395
3522
|
* Adds a notification
|
|
3396
3523
|
*
|
|
@@ -3405,6 +3532,12 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3405
3532
|
if (container) {
|
|
3406
3533
|
container.manager = instance;
|
|
3407
3534
|
}
|
|
3535
|
+
// Process pending requests
|
|
3536
|
+
const queue = this.pending.get(position);
|
|
3537
|
+
if (queue) {
|
|
3538
|
+
queue.forEach((cb)=>cb(instance));
|
|
3539
|
+
this.pending.delete(position);
|
|
3540
|
+
}
|
|
3408
3541
|
}
|
|
3409
3542
|
};
|
|
3410
3543
|
const [Component] = LayerManager$1.renderLayer({
|
|
@@ -3437,14 +3570,13 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3437
3570
|
if (container && container.manager) {
|
|
3438
3571
|
return container.manager.add(options);
|
|
3439
3572
|
}
|
|
3440
|
-
// If manager is not ready yet,
|
|
3573
|
+
// If manager is not ready yet, add to pending queue
|
|
3441
3574
|
return new Promise((resolve)=>{
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
}, 10);
|
|
3575
|
+
const queue = this.pending.get(position) || [];
|
|
3576
|
+
queue.push((manager)=>{
|
|
3577
|
+
resolve(manager.add(options));
|
|
3578
|
+
});
|
|
3579
|
+
this.pending.set(position, queue);
|
|
3448
3580
|
});
|
|
3449
3581
|
};
|
|
3450
3582
|
/**
|
|
@@ -3478,10 +3610,14 @@ const DEFAULT_DURATION$1 = 5000;
|
|
|
3478
3610
|
/** Export a singleton instance */ var Notification_default = new Notification();
|
|
3479
3611
|
|
|
3480
3612
|
const SpinnerDiv = /*#__PURE__*/ styled("div", {
|
|
3481
|
-
target: "
|
|
3613
|
+
target: "e14pfj3w0",
|
|
3482
3614
|
label: "SpinnerDiv"
|
|
3483
3615
|
})("border:4px solid ", getThemeValue(THEME_NAME.PRIMARY), ";border-top:4px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-radius:50%;width:", (props)=>props.size, "px;height:", (props)=>props.size, "px;margin:0 auto;animation:spin 1s linear infinite;@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}");
|
|
3484
|
-
|
|
3616
|
+
/**
|
|
3617
|
+
* Spinner Component
|
|
3618
|
+
* @param props - Component props
|
|
3619
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
3620
|
+
*/ function SpinnerComponent(props, ref) {
|
|
3485
3621
|
const { label = 'Loading', size = 30, ...rest } = props;
|
|
3486
3622
|
return /*#__PURE__*/ jsxRuntime.jsx(SpinnerDiv, {
|
|
3487
3623
|
...rest,
|
|
@@ -3496,22 +3632,26 @@ function SpinnerComponent(props, ref) {
|
|
|
3496
3632
|
const Spinner = /*#__PURE__*/ React.forwardRef(SpinnerComponent);
|
|
3497
3633
|
|
|
3498
3634
|
const Container$1 = /*#__PURE__*/ styled("div", {
|
|
3499
|
-
target: "
|
|
3635
|
+
target: "e14em2c80",
|
|
3500
3636
|
label: "Container"
|
|
3501
3637
|
})("flex:1;display:flex;flex-direction:column;min-height:400px;");
|
|
3502
3638
|
const Header = /*#__PURE__*/ styled("div", {
|
|
3503
|
-
target: "
|
|
3639
|
+
target: "e14em2c81",
|
|
3504
3640
|
label: "Header"
|
|
3505
3641
|
})("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;}");
|
|
3506
3642
|
const HeaderButton = /*#__PURE__*/ styled("button", {
|
|
3507
|
-
target: "
|
|
3643
|
+
target: "e14em2c82",
|
|
3508
3644
|
label: "HeaderButton"
|
|
3509
3645
|
})("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;}}");
|
|
3510
3646
|
const MobileHeader = /*#__PURE__*/ styled("div", {
|
|
3511
|
-
target: "
|
|
3647
|
+
target: "e14em2c83",
|
|
3512
3648
|
label: "MobileHeader"
|
|
3513
3649
|
})("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;}}");
|
|
3514
|
-
|
|
3650
|
+
/**
|
|
3651
|
+
* Stepper Component
|
|
3652
|
+
* @param props - Component props
|
|
3653
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
3654
|
+
*/ function StepperComponent(props, ref) {
|
|
3515
3655
|
const { active: propsActive = 0, onStepClick, children, ...rest } = props;
|
|
3516
3656
|
const [active, setActive] = React.useState(propsActive);
|
|
3517
3657
|
const childrenArray = React.Children.toArray(children);
|
|
@@ -3554,24 +3694,27 @@ function StepperComponent(props, ref) {
|
|
|
3554
3694
|
children: [
|
|
3555
3695
|
React.Children.map(children, (child, index)=>{
|
|
3556
3696
|
if (!/*#__PURE__*/ React.isValidElement(child)) return null;
|
|
3697
|
+
const reactElement = child;
|
|
3557
3698
|
return /*#__PURE__*/ jsxRuntime.jsxs(HeaderButton, {
|
|
3558
|
-
ref: (el)=>
|
|
3699
|
+
ref: (el)=>{
|
|
3700
|
+
stepRefs[index] = el;
|
|
3701
|
+
},
|
|
3559
3702
|
active: index === active,
|
|
3560
3703
|
type: "button",
|
|
3561
3704
|
role: "tab",
|
|
3562
3705
|
"aria-selected": index === active,
|
|
3563
|
-
"aria-disabled": !!
|
|
3706
|
+
"aria-disabled": !!reactElement.props.disabled,
|
|
3564
3707
|
tabIndex: index === active ? 0 : -1,
|
|
3565
|
-
disabled:
|
|
3708
|
+
disabled: reactElement.props.disabled,
|
|
3566
3709
|
onClick: stepClickHandler(index),
|
|
3567
3710
|
onKeyDown: onStepKeyDown(index),
|
|
3568
3711
|
children: [
|
|
3569
3712
|
/*#__PURE__*/ jsxRuntime.jsx(Badge, {
|
|
3570
3713
|
inline: true,
|
|
3571
|
-
type: getBadgeType(index,
|
|
3714
|
+
type: getBadgeType(index, reactElement.props.completed || false, reactElement.props.disabled || false)
|
|
3572
3715
|
}),
|
|
3573
3716
|
/*#__PURE__*/ jsxRuntime.jsx(Ellipsis, {
|
|
3574
|
-
children:
|
|
3717
|
+
children: reactElement.props.name
|
|
3575
3718
|
})
|
|
3576
3719
|
]
|
|
3577
3720
|
});
|
|
@@ -3601,10 +3744,14 @@ function StepperComponent(props, ref) {
|
|
|
3601
3744
|
const Stepper = /*#__PURE__*/ React.forwardRef(StepperComponent);
|
|
3602
3745
|
|
|
3603
3746
|
const Container = /*#__PURE__*/ styled("div", {
|
|
3604
|
-
target: "
|
|
3747
|
+
target: "e1v23xop0",
|
|
3605
3748
|
label: "Container"
|
|
3606
3749
|
})("flex:1;display:flex;flex-direction:column;");
|
|
3607
|
-
|
|
3750
|
+
/**
|
|
3751
|
+
* Step Component
|
|
3752
|
+
* @param props - Component props
|
|
3753
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
3754
|
+
*/ function StepComponent(props, ref) {
|
|
3608
3755
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3609
3756
|
const { name, disabled, completed, ...rest } = props;
|
|
3610
3757
|
return /*#__PURE__*/ jsxRuntime.jsx(Container, {
|
|
@@ -3615,21 +3762,24 @@ function StepComponent(props, ref) {
|
|
|
3615
3762
|
const Step = /*#__PURE__*/ React.forwardRef(StepComponent);
|
|
3616
3763
|
|
|
3617
3764
|
const Button = /*#__PURE__*/ styled("button", {
|
|
3618
|
-
target: "
|
|
3765
|
+
target: "ewz2woa0",
|
|
3619
3766
|
label: "Button"
|
|
3620
3767
|
})("background-color:transparent;border:none;padding:8px 12px;font-size:14px;border-radius:3px 3px 0 0;border-bottom:", (props)=>props.active ? `3px solid ${getThemeValue(THEME_NAME.PRIMARY)}` : 'none', ";color:", (props)=>props.active ? getThemeValue(THEME_NAME.PRIMARY) : getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";cursor:pointer;&:hover,&:focus{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHTER), ";border-bottom:", (props)=>props.active ? `3px solid ${getThemeValue(THEME_NAME.PRIMARY)}` : `3px solid ${getThemeValue(THEME_NAME.PRIMARY)}`, ";}&[disabled]{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";color:", getThemeValue(THEME_NAME.DISABLED), ";border-bottom:3px solid ", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}");
|
|
3621
3768
|
const ButtonContainer = /*#__PURE__*/ styled("div", {
|
|
3622
|
-
target: "
|
|
3769
|
+
target: "ewz2woa1",
|
|
3623
3770
|
label: "ButtonContainer"
|
|
3624
3771
|
})("border-bottom:1px solid ", getThemeValue(THEME_NAME.DISABLED_BORDER), ";margin-bottom:5px;position:relative;");
|
|
3625
3772
|
const TabBody = /*#__PURE__*/ styled("div", {
|
|
3626
|
-
target: "
|
|
3773
|
+
target: "ewz2woa2",
|
|
3627
3774
|
label: "TabBody"
|
|
3628
3775
|
})("min-height:150px;");
|
|
3629
|
-
|
|
3630
|
-
|
|
3776
|
+
/**
|
|
3777
|
+
* Tabs Component
|
|
3778
|
+
* @param props - Component props
|
|
3779
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
3780
|
+
*/ function TabsComponent(props, ref) {
|
|
3781
|
+
const { active: propsActive = 0, onChange, bodyProps, children, ...rest } = props;
|
|
3631
3782
|
const [active, setActive] = React.useState(propsActive);
|
|
3632
|
-
const { children } = props;
|
|
3633
3783
|
const tabRefs = [];
|
|
3634
3784
|
const childrenArray = React.Children.toArray(children);
|
|
3635
3785
|
const switchTab = (index)=>()=>{
|
|
@@ -3662,11 +3812,11 @@ function TabsComponent(props, ref) {
|
|
|
3662
3812
|
const sanitize = (str)=>str.replace(/[^a-zA-Z0-9_-]/g, '').toLowerCase();
|
|
3663
3813
|
const tabIds = childrenArray.map((child, i)=>{
|
|
3664
3814
|
const name = /*#__PURE__*/ React.isValidElement(child) && child.props.name ? child.props.name : `tab${i}`;
|
|
3665
|
-
return `nfui-tab-${sanitize(name)}-${i}`;
|
|
3815
|
+
return `nfui-tab-${sanitize(name || '')}-${i}`;
|
|
3666
3816
|
});
|
|
3667
3817
|
const panelIds = childrenArray.map((child, i)=>{
|
|
3668
3818
|
const name = /*#__PURE__*/ React.isValidElement(child) && child.props.name ? child.props.name : `tab${i}`;
|
|
3669
|
-
return `nfui-tabpanel-${sanitize(name)}-${i}`;
|
|
3819
|
+
return `nfui-tabpanel-${sanitize(name || '')}-${i}`;
|
|
3670
3820
|
});
|
|
3671
3821
|
// Sanity check for active index
|
|
3672
3822
|
if (active === undefined || active < 0 || active >= childrenArray.length) {
|
|
@@ -3679,8 +3829,12 @@ function TabsComponent(props, ref) {
|
|
|
3679
3829
|
"aria-label": "Tabs",
|
|
3680
3830
|
ref: ref,
|
|
3681
3831
|
...rest,
|
|
3682
|
-
children: childrenArray.map((child, index)
|
|
3683
|
-
|
|
3832
|
+
children: childrenArray.map((child, index)=>{
|
|
3833
|
+
const reactElement = child;
|
|
3834
|
+
return /*#__PURE__*/ jsxRuntime.jsx(Button, {
|
|
3835
|
+
ref: (el)=>{
|
|
3836
|
+
tabRefs[index] = el;
|
|
3837
|
+
},
|
|
3684
3838
|
id: tabIds[index],
|
|
3685
3839
|
type: "button",
|
|
3686
3840
|
role: "tab",
|
|
@@ -3690,10 +3844,11 @@ function TabsComponent(props, ref) {
|
|
|
3690
3844
|
active: active === index,
|
|
3691
3845
|
onClick: switchTab(index),
|
|
3692
3846
|
onKeyDown: onTabKeyDown(index),
|
|
3693
|
-
disabled: /*#__PURE__*/ React.isValidElement(child) ?
|
|
3694
|
-
"aria-disabled": /*#__PURE__*/ React.isValidElement(child) ?
|
|
3695
|
-
children: /*#__PURE__*/ React.isValidElement(child) ?
|
|
3696
|
-
}, tabIds[index])
|
|
3847
|
+
disabled: /*#__PURE__*/ React.isValidElement(child) ? reactElement.props.disabled : false,
|
|
3848
|
+
"aria-disabled": /*#__PURE__*/ React.isValidElement(child) ? reactElement.props.disabled : false,
|
|
3849
|
+
children: /*#__PURE__*/ React.isValidElement(child) ? reactElement.props.name : ''
|
|
3850
|
+
}, tabIds[index]);
|
|
3851
|
+
})
|
|
3697
3852
|
}),
|
|
3698
3853
|
/*#__PURE__*/ jsxRuntime.jsx(TabBody, {
|
|
3699
3854
|
...bodyProps,
|
|
@@ -3970,14 +4125,18 @@ const positionHoverStyle = {
|
|
|
3970
4125
|
`
|
|
3971
4126
|
};
|
|
3972
4127
|
const TooltipDiv = /*#__PURE__*/ styled("div", {
|
|
3973
|
-
target: "
|
|
4128
|
+
target: "e1dfj1r70",
|
|
3974
4129
|
label: "TooltipDiv"
|
|
3975
4130
|
})("position:absolute;background-color:", getThemeValue(THEME_NAME.TOOLTIP_COLOR), ";padding:5px;color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:3px;transition:transform 0.3s ease;font-size:12px;z-index:1;", (props)=>positionStyle[props.position]);
|
|
3976
4131
|
const TooltipContainer = /*#__PURE__*/ styled("div", {
|
|
3977
|
-
target: "
|
|
4132
|
+
target: "e1dfj1r71",
|
|
3978
4133
|
label: "TooltipContainer"
|
|
3979
4134
|
})("position:relative;display:inline-flex;justify-content:center;align-items:center;&:hover ", TooltipDiv, ",&:focus-within ", TooltipDiv, "{", (props)=>positionHoverStyle[props.position], "}");
|
|
3980
|
-
|
|
4135
|
+
/**
|
|
4136
|
+
* Tooltip Component
|
|
4137
|
+
* @param props - Component props
|
|
4138
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
4139
|
+
*/ function TooltipComponent(props, ref) {
|
|
3981
4140
|
const { children, position = "BOTTOM", ...rest } = props;
|
|
3982
4141
|
const tooltipId = React.useId();
|
|
3983
4142
|
// Clone the child to inject aria-describedby and tabIndex if possible
|