@hyphen/hyphen-components 8.0.0 → 9.0.0-beta.0
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/css/fonts.css +5 -3
- package/dist/css/fonts.css.map +1 -0
- package/dist/css/index.css +117 -111
- package/dist/css/index.css.map +1 -0
- package/dist/css/reset.css +5 -3
- package/dist/css/reset.css.map +1 -0
- package/dist/css/utilities.css +9 -7
- package/dist/css/utilities.css.map +1 -0
- package/dist/css/variables.css +11 -9
- package/dist/css/variables.css.map +1 -0
- package/dist/hyphen-components.cjs.development.js +348 -317
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +2 -2
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +352 -318
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/index.d.ts +212 -202
- package/package.json +8 -7
- package/src/components/Alert/Alert.tsx +5 -6
- package/src/components/Badge/Badge.module.scss +1 -1
- package/src/components/Badge/Badge.test.tsx +12 -0
- package/src/components/Badge/Badge.tsx +52 -20
- package/src/components/Box/Box.mdx +1 -1
- package/src/components/Box/Box.stories.tsx +1 -1
- package/src/components/Box/Box.test.tsx +24 -1
- package/src/components/Box/Box.tsx +108 -82
- package/src/components/Button/Button.module.scss +1 -1
- package/src/components/Card/Card.tsx +5 -1
- package/src/components/Card/components/CardFooter/CardFooter.tsx +0 -4
- package/src/components/Card/components/CardHeader/CardHeader.tsx +4 -1
- package/src/components/Card/components/CardSection/CardSection.tsx +4 -5
- package/src/components/CheckboxInput/CheckboxInput.test.tsx +17 -0
- package/src/components/CheckboxInput/CheckboxInput.tsx +15 -4
- package/src/components/CheckboxInput/components/Checkbox.module.scss +2 -2
- package/src/components/CheckboxInput/components/Checkbox.test.tsx +36 -0
- package/src/components/CheckboxInput/components/Checkbox.tsx +8 -2
- package/src/components/Details/Details.test.tsx +8 -0
- package/src/components/Details/Details.tsx +5 -2
- package/src/components/Details/DetailsSummary.tsx +4 -1
- package/src/components/Drawer/Drawer.module.scss +1 -1
- package/src/components/Drawer/Drawer.test.tsx +8 -0
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenu.tsx +6 -8
- package/src/components/FormLabel/FormLabel.tsx +6 -3
- package/src/components/Formik/FormikCheckboxInput/FormikCheckboxInput.test.tsx +9 -0
- package/src/components/Formik/FormikCheckboxInput/FormikCheckboxInput.tsx +1 -0
- package/src/components/Formik/FormikSelectInput/FormikSelectInput.tsx +21 -11
- package/src/components/Formik/FormikSelectInputNative/FormikSelectInputNative.tsx +1 -1
- package/src/components/Formik/FormikTimePicker/FormikTimePicker.tsx +1 -1
- package/src/components/Heading/Heading.tsx +5 -6
- package/src/components/Icon/Icon.test.tsx +8 -0
- package/src/components/Icon/Icon.tsx +6 -7
- package/src/components/Modal/Modal.module.scss +1 -1
- package/src/components/Modal/Modal.test.tsx +31 -1
- package/src/components/Modal/Modal.tsx +13 -7
- package/src/components/Popover/Popover.test.tsx +3 -4
- package/src/components/RadioGroup/RadioGroup.tsx +11 -6
- package/src/components/RadioGroup/RadioInput/RadioInput.module.scss +2 -2
- package/src/components/RadioGroup/RadioInput/RadioInputIcon.tsx +0 -4
- package/src/components/SelectInput/SelectInput.module.scss +1 -1
- package/src/components/SelectInput/SelectInput.test.tsx +18 -0
- package/src/components/SelectInput/SelectInput.tsx +47 -27
- package/src/components/SelectInputInset/SelectInputInset.module.scss +1 -1
- package/src/components/SelectInputInset/SelectInputInset.tsx +8 -9
- package/src/components/SelectInputNative/SelectInputNative.module.scss +1 -1
- package/src/components/SelectInputNative/SelectInputNative.test.tsx +24 -0
- package/src/components/SelectInputNative/SelectInputNative.tsx +79 -14
- package/src/components/Switch/Switch.module.scss +1 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Table/Table.mdx +1 -1
- package/src/components/Table/Table.stories.tsx +5 -1
- package/src/components/Table/common/TableRow/TableRow.test.tsx +16 -0
- package/src/components/Table/common/TableRow/TableRow.tsx +19 -1
- package/src/components/TextInput/TextInput.module.scss +1 -1
- package/src/components/TextInput/TextInput.tsx +10 -8
- package/src/components/TextInputInset/TextInputInset.module.scss +1 -1
- package/src/components/TextInputInset/TextInputInset.tsx +5 -6
- package/src/components/TextareaInput/TextareaInput.module.scss +1 -1
- package/src/components/TextareaInput/TextareaInput.tsx +4 -5
- package/src/components/TextareaInputInset/TextareaInputInset.module.scss +1 -1
- package/src/components/TextareaInputInset/TextareaInputInset.tsx +10 -17
- package/src/components/Toast/Toast.stories.tsx +5 -1
- package/src/components/Toggle/Toggle.module.scss +1 -1
- package/src/components/ToggleGroup/ToggleGroup.module.scss +1 -1
- package/src/styles/display.scss +1 -1
- package/src/styles/flex.scss +1 -1
- package/src/styles/overflow.scss +2 -0
- package/src/styles/position.scss +2 -0
- package/src/styles/text-align.scss +2 -0
- package/src/styles/utilities.scss +10 -9
- package/src/styles/variables/index.scss +2 -1
- package/src/styles/white-space.scss +2 -0
- package/src/types/index.ts +2 -3
|
@@ -371,18 +371,6 @@ function getDimensionCss(dimension, value) {
|
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
// src/lib/getElementType.ts
|
|
375
|
-
function getElementType(Component, props, getDefault) {
|
|
376
|
-
const { defaultProps = {} } = Component;
|
|
377
|
-
if (props.as && props.as !== defaultProps.as) return props.as;
|
|
378
|
-
if (getDefault) {
|
|
379
|
-
const computedDefault = getDefault();
|
|
380
|
-
if (computedDefault) return computedDefault;
|
|
381
|
-
}
|
|
382
|
-
if (props.href) return "a";
|
|
383
|
-
return defaultProps.as || "div";
|
|
384
|
-
}
|
|
385
|
-
|
|
386
374
|
// src/components/Box/Box.module.scss
|
|
387
375
|
var Box_module_default = { "box-transition": "box-transition__sKpxg" };
|
|
388
376
|
|
|
@@ -393,9 +381,9 @@ var AUTO_FONT_COLOR_BACKGROUNDS = [
|
|
|
393
381
|
"danger",
|
|
394
382
|
"info"
|
|
395
383
|
];
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
as
|
|
384
|
+
var BoxBaseComponent = (props, ref) => {
|
|
385
|
+
const {
|
|
386
|
+
as,
|
|
399
387
|
alignItems = void 0,
|
|
400
388
|
alignContent = void 0,
|
|
401
389
|
alignSelf = void 0,
|
|
@@ -440,256 +428,259 @@ var Box = (0, import_react.forwardRef)(
|
|
|
440
428
|
wordBreak = void 0,
|
|
441
429
|
zIndex = void 0,
|
|
442
430
|
...restProps
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
};
|
|
548
|
-
if (typeof direction === "string") {
|
|
549
|
-
childGapDirection = {
|
|
550
|
-
base: getChildGapMarginDirection(direction)
|
|
551
|
-
};
|
|
552
|
-
} else if (typeof direction === "object" && direction !== null) {
|
|
553
|
-
childGapDirection = Object.keys(direction).reduce(
|
|
554
|
-
(acc, curr) => ({
|
|
555
|
-
...acc,
|
|
556
|
-
[curr]: getChildGapMarginDirection(
|
|
557
|
-
direction[curr]
|
|
558
|
-
)
|
|
559
|
-
}),
|
|
560
|
-
{}
|
|
561
|
-
);
|
|
562
|
-
}
|
|
563
|
-
return childGapDirection;
|
|
564
|
-
};
|
|
565
|
-
const generateChildGap = () => {
|
|
566
|
-
let childGapObj = {};
|
|
567
|
-
if (typeof childGap === "string") {
|
|
568
|
-
childGapObj = { base: childGap };
|
|
569
|
-
} else if (typeof childGap === "object" && childGap !== null) {
|
|
570
|
-
childGapObj = { ...childGap };
|
|
571
|
-
}
|
|
572
|
-
return childGapObj;
|
|
431
|
+
} = props;
|
|
432
|
+
const heightCss = getDimensionCss("h", height);
|
|
433
|
+
const widthCss = getDimensionCss("w", width);
|
|
434
|
+
const maxHeightCss = getDimensionCss("mh", maxHeight);
|
|
435
|
+
const maxWidthCss = getDimensionCss("mw", maxWidth);
|
|
436
|
+
const minHeightCss = getDimensionCss("minh", minHeight);
|
|
437
|
+
const minWidthCss = getDimensionCss("minw", minWidth);
|
|
438
|
+
const finalColor = color ?? (background === "inverse" ? "inverse" : background && AUTO_FONT_COLOR_BACKGROUNDS.includes(background) ? "grey" : void 0);
|
|
439
|
+
const isFlexBox = typeof display === "string" && display.includes("flex");
|
|
440
|
+
const flexDirectionClasses = isFlexBox ? generateResponsiveClasses("flex-direction", direction) : null;
|
|
441
|
+
const cssPropertyMap = {
|
|
442
|
+
color: {
|
|
443
|
+
classPrefix: "font-color",
|
|
444
|
+
transformer: generateResponsiveClasses
|
|
445
|
+
},
|
|
446
|
+
background: {
|
|
447
|
+
classPrefix: "background-color",
|
|
448
|
+
transformer: generateResponsiveClasses
|
|
449
|
+
},
|
|
450
|
+
borderColor: {
|
|
451
|
+
classPrefix: "border-color",
|
|
452
|
+
transformer: generateResponsiveClasses
|
|
453
|
+
},
|
|
454
|
+
borderWidth: {
|
|
455
|
+
classPrefix: "border-width",
|
|
456
|
+
transformer: cssShorthandToClasses
|
|
457
|
+
},
|
|
458
|
+
shadow: { classPrefix: "shadow", transformer: generateResponsiveClasses },
|
|
459
|
+
fontSize: {
|
|
460
|
+
classPrefix: "font-size",
|
|
461
|
+
transformer: generateResponsiveClasses
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
const getStatefulClasses = (stateKey, values) => values ? Object.entries(values).map(
|
|
465
|
+
([key, value]) => cssPropertyMap[key].transformer(
|
|
466
|
+
`${stateKey}:${cssPropertyMap[key].classPrefix}`,
|
|
467
|
+
value
|
|
468
|
+
)
|
|
469
|
+
// eslint-disable-line max-len
|
|
470
|
+
) : void 0;
|
|
471
|
+
const hoverClasses = getStatefulClasses("hover", hover);
|
|
472
|
+
const focusClasses = getStatefulClasses("focus", focus);
|
|
473
|
+
const boxClasses = (0, import_classnames.default)(
|
|
474
|
+
className,
|
|
475
|
+
cssShorthandToClasses("m", margin),
|
|
476
|
+
cssShorthandToClasses("p", padding),
|
|
477
|
+
cssShorthandToClasses("br", radius),
|
|
478
|
+
cssShorthandToClasses("g", gap),
|
|
479
|
+
cssShorthandToClasses("cg", columnGap),
|
|
480
|
+
cssShorthandToClasses("rg", rowGap),
|
|
481
|
+
heightCss.classes,
|
|
482
|
+
maxHeightCss.classes,
|
|
483
|
+
minHeightCss.classes,
|
|
484
|
+
maxWidthCss.classes,
|
|
485
|
+
minWidthCss.classes,
|
|
486
|
+
widthCss.classes,
|
|
487
|
+
flexDirectionClasses,
|
|
488
|
+
generateResponsiveClasses("display", display),
|
|
489
|
+
generateResponsiveClasses("justify-content", justifyContent),
|
|
490
|
+
generateResponsiveClasses("align-items", alignItems),
|
|
491
|
+
generateResponsiveClasses("align-content", alignContent),
|
|
492
|
+
generateResponsiveClasses("align-self", alignSelf),
|
|
493
|
+
generateResponsiveClasses("font-family", fontFamily),
|
|
494
|
+
generateResponsiveClasses("font-size", fontSize),
|
|
495
|
+
generateResponsiveClasses("overflow", overflow),
|
|
496
|
+
generateResponsiveClasses("shadow", shadow),
|
|
497
|
+
generateResponsiveClasses("flex", flex),
|
|
498
|
+
cssShorthandToClasses("bw", borderWidth),
|
|
499
|
+
generateResponsiveClasses("font-weight", fontWeight),
|
|
500
|
+
generateResponsiveClasses("text-align", textAlign),
|
|
501
|
+
generateResponsiveClasses("transform", textTransform),
|
|
502
|
+
generateResponsiveClasses("text-wrap", textWrap),
|
|
503
|
+
generateResponsiveClasses("position", position),
|
|
504
|
+
generateResponsiveClasses("z-index", zIndex),
|
|
505
|
+
generateResponsiveClasses("whitespace", whiteSpace),
|
|
506
|
+
generateResponsiveClasses("break", wordBreak),
|
|
507
|
+
...hoverClasses ?? [],
|
|
508
|
+
...focusClasses ?? [],
|
|
509
|
+
{
|
|
510
|
+
"flex-wrap": isFlexBox && wrap,
|
|
511
|
+
"flex-nowrap": isFlexBox && wrap === false,
|
|
512
|
+
[`background-color-${background}`]: background,
|
|
513
|
+
[`font-color-${finalColor}`]: finalColor,
|
|
514
|
+
[`border-color-${borderColor}`]: borderColor,
|
|
515
|
+
[`cursor-${cursor}`]: cursor,
|
|
516
|
+
[Box_module_default["box-transition"]]: hover || focus
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
const boxStyles = {
|
|
520
|
+
...style,
|
|
521
|
+
...heightCss.styles,
|
|
522
|
+
...maxHeightCss.styles,
|
|
523
|
+
...maxWidthCss.styles,
|
|
524
|
+
...widthCss.styles,
|
|
525
|
+
...minHeightCss.styles,
|
|
526
|
+
...minWidthCss.styles
|
|
527
|
+
};
|
|
528
|
+
const generateChildGapDirection = () => {
|
|
529
|
+
let childGapDirection = {};
|
|
530
|
+
const getChildGapMarginDirection = (d) => {
|
|
531
|
+
let marginDirection = "";
|
|
532
|
+
if (d?.includes("row")) marginDirection = "right";
|
|
533
|
+
else if (d?.includes("column")) marginDirection = "bottom";
|
|
534
|
+
return marginDirection;
|
|
573
535
|
};
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
const childGapValues = generateChildGap();
|
|
578
|
-
const breakpoints = [
|
|
579
|
-
"hd",
|
|
580
|
-
"desktop",
|
|
581
|
-
"tablet",
|
|
582
|
-
"base"
|
|
583
|
-
];
|
|
584
|
-
const findMatchingBreakpoint = (responsiveObj, key) => {
|
|
585
|
-
const index = breakpoints.findIndex((breakpoint) => breakpoint === key);
|
|
586
|
-
let value = "";
|
|
587
|
-
value = responsiveObj[key];
|
|
588
|
-
if (!value)
|
|
589
|
-
return findMatchingBreakpoint(responsiveObj, breakpoints[index + 1]);
|
|
590
|
-
return value;
|
|
536
|
+
if (typeof direction === "string") {
|
|
537
|
+
childGapDirection = {
|
|
538
|
+
base: getChildGapMarginDirection(direction)
|
|
591
539
|
};
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
const oppositeDirection = foundDirection === "bottom" ? "right" : "bottom";
|
|
603
|
-
childGapClasses.push(
|
|
604
|
-
`m-${foundDirection}-${foundChildGap}${classSuffix}`
|
|
605
|
-
);
|
|
606
|
-
childGapClasses.push(`m-${oppositeDirection}-0${classSuffix}`);
|
|
607
|
-
});
|
|
540
|
+
} else if (typeof direction === "object" && direction !== null) {
|
|
541
|
+
childGapDirection = Object.keys(direction).reduce(
|
|
542
|
+
(acc, curr) => ({
|
|
543
|
+
...acc,
|
|
544
|
+
[curr]: getChildGapMarginDirection(
|
|
545
|
+
direction[curr]
|
|
546
|
+
)
|
|
547
|
+
}),
|
|
548
|
+
{}
|
|
549
|
+
);
|
|
608
550
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
551
|
+
return childGapDirection;
|
|
552
|
+
};
|
|
553
|
+
const generateChildGap = () => {
|
|
554
|
+
let childGapObj = {};
|
|
555
|
+
if (typeof childGap === "string") {
|
|
556
|
+
childGapObj = { base: childGap };
|
|
557
|
+
} else if (typeof childGap === "object" && childGap !== null) {
|
|
558
|
+
childGapObj = { ...childGap };
|
|
559
|
+
}
|
|
560
|
+
return childGapObj;
|
|
561
|
+
};
|
|
562
|
+
const childGapClasses = [];
|
|
563
|
+
if (childGap && direction) {
|
|
564
|
+
const childGapDirection = generateChildGapDirection();
|
|
565
|
+
const childGapValues = generateChildGap();
|
|
566
|
+
const breakpoints = [
|
|
567
|
+
"hd",
|
|
568
|
+
"desktop",
|
|
569
|
+
"tablet",
|
|
570
|
+
"base"
|
|
571
|
+
];
|
|
572
|
+
const findMatchingBreakpoint = (responsiveObj, key) => {
|
|
573
|
+
const index = breakpoints.findIndex((breakpoint) => breakpoint === key);
|
|
574
|
+
let value = "";
|
|
575
|
+
value = responsiveObj[key];
|
|
576
|
+
if (!value)
|
|
577
|
+
return findMatchingBreakpoint(responsiveObj, breakpoints[index + 1]);
|
|
578
|
+
return value;
|
|
620
579
|
};
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
decoratedChildren = decoratedChildren.map(
|
|
626
|
-
(value, index, array) => decorateChildren(
|
|
627
|
-
value,
|
|
628
|
-
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
629
|
-
index,
|
|
630
|
-
array
|
|
631
|
-
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
632
|
-
)
|
|
580
|
+
breakpoints.forEach((breakpoint) => {
|
|
581
|
+
const foundDirection = findMatchingBreakpoint(
|
|
582
|
+
childGapDirection,
|
|
583
|
+
breakpoint
|
|
633
584
|
);
|
|
585
|
+
const foundChildGap = findMatchingBreakpoint(
|
|
586
|
+
childGapValues,
|
|
587
|
+
breakpoint
|
|
588
|
+
);
|
|
589
|
+
const classSuffix = breakpoint === "base" ? "" : `-${breakpoint}`;
|
|
590
|
+
const oppositeDirection = foundDirection === "bottom" ? "right" : "bottom";
|
|
591
|
+
childGapClasses.push(
|
|
592
|
+
`m-${foundDirection}-${foundChildGap}${classSuffix}`
|
|
593
|
+
);
|
|
594
|
+
childGapClasses.push(`m-${oppositeDirection}-0${classSuffix}`);
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
const decorateChildren = (child, i, array) => {
|
|
598
|
+
if (i === array.length - 1 || !child || typeof child === "string" || typeof child === "number") {
|
|
599
|
+
return child;
|
|
634
600
|
}
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
601
|
+
const childClasses = (0, import_classnames.default)(child.props?.className, [
|
|
602
|
+
...Array.from(new Set(childGapClasses))
|
|
603
|
+
]);
|
|
604
|
+
return (0, import_react.cloneElement)(child, {
|
|
605
|
+
className: childClasses,
|
|
606
|
+
key: child.key ?? i
|
|
607
|
+
});
|
|
608
|
+
};
|
|
609
|
+
let decoratedChildren = import_react.Children.toArray(children).filter(
|
|
610
|
+
(child) => child !== null
|
|
611
|
+
);
|
|
612
|
+
if (childGapClasses && decoratedChildren.length > 1) {
|
|
613
|
+
decoratedChildren = decoratedChildren.map(
|
|
614
|
+
(value, index, array) => decorateChildren(
|
|
615
|
+
value,
|
|
616
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
617
|
+
index,
|
|
618
|
+
array
|
|
619
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
620
|
+
)
|
|
645
621
|
);
|
|
646
622
|
}
|
|
647
|
-
|
|
623
|
+
const element = as ?? "div";
|
|
624
|
+
return (0, import_react.createElement)(
|
|
625
|
+
element,
|
|
626
|
+
{
|
|
627
|
+
className: boxClasses,
|
|
628
|
+
style: boxStyles,
|
|
629
|
+
ref,
|
|
630
|
+
...restProps
|
|
631
|
+
},
|
|
632
|
+
children !== null && children !== void 0 ? decoratedChildren : null
|
|
633
|
+
);
|
|
634
|
+
};
|
|
635
|
+
var Box = (0, import_react.forwardRef)(BoxBaseComponent);
|
|
648
636
|
Box.displayName = "Box";
|
|
649
|
-
var
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
637
|
+
var boxPropsKeyMap = {
|
|
638
|
+
as: true,
|
|
639
|
+
alignItems: true,
|
|
640
|
+
alignContent: true,
|
|
641
|
+
alignSelf: true,
|
|
642
|
+
background: true,
|
|
643
|
+
borderColor: true,
|
|
644
|
+
borderWidth: true,
|
|
645
|
+
className: true,
|
|
646
|
+
childGap: true,
|
|
647
|
+
children: true,
|
|
648
|
+
color: true,
|
|
649
|
+
columnGap: true,
|
|
650
|
+
cursor: true,
|
|
651
|
+
direction: true,
|
|
652
|
+
display: true,
|
|
653
|
+
flex: true,
|
|
654
|
+
focus: true,
|
|
655
|
+
fontFamily: true,
|
|
656
|
+
fontSize: true,
|
|
657
|
+
fontWeight: true,
|
|
658
|
+
gap: true,
|
|
659
|
+
height: true,
|
|
660
|
+
hover: true,
|
|
661
|
+
justifyContent: true,
|
|
662
|
+
margin: true,
|
|
663
|
+
maxHeight: true,
|
|
664
|
+
minHeight: true,
|
|
665
|
+
maxWidth: true,
|
|
666
|
+
minWidth: true,
|
|
667
|
+
overflow: true,
|
|
668
|
+
padding: true,
|
|
669
|
+
position: true,
|
|
670
|
+
radius: true,
|
|
671
|
+
rowGap: true,
|
|
672
|
+
shadow: true,
|
|
673
|
+
style: true,
|
|
674
|
+
textAlign: true,
|
|
675
|
+
textTransform: true,
|
|
676
|
+
textWrap: true,
|
|
677
|
+
whiteSpace: true,
|
|
678
|
+
wrap: true,
|
|
679
|
+
width: true,
|
|
680
|
+
wordBreak: true,
|
|
681
|
+
zIndex: true
|
|
682
|
+
};
|
|
683
|
+
var boxPropsKeys = Object.keys(boxPropsKeyMap);
|
|
693
684
|
|
|
694
685
|
// src/components/Icon/Icon.tsx
|
|
695
686
|
var import_react2 = __toESM(require("react"));
|
|
@@ -849,8 +840,8 @@ var renderBadgeChildren = (children) => import_react5.Children.map(
|
|
|
849
840
|
children,
|
|
850
841
|
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ import_react5.default.createElement("span", { className: Badge_module_default.label }, child) : child
|
|
851
842
|
);
|
|
852
|
-
var
|
|
853
|
-
|
|
843
|
+
var BadgeBaseComponent = (props, ref) => {
|
|
844
|
+
const {
|
|
854
845
|
className = "",
|
|
855
846
|
color = "grey",
|
|
856
847
|
radius = "full",
|
|
@@ -858,33 +849,34 @@ var Badge = (0, import_react5.forwardRef)(
|
|
|
858
849
|
size = "md",
|
|
859
850
|
children,
|
|
860
851
|
...restProps
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
);
|
|
852
|
+
} = props;
|
|
853
|
+
const responsiveClasses = generateResponsiveClasses("size", size).map(
|
|
854
|
+
(c) => Badge_module_default[c]
|
|
855
|
+
);
|
|
856
|
+
const hue = BADGE_COLOR_ALIASES[color] ?? color;
|
|
857
|
+
const badgeClasses = (0, import_classnames4.default)(
|
|
858
|
+
Badge_module_default.badge,
|
|
859
|
+
className,
|
|
860
|
+
responsiveClasses,
|
|
861
|
+
Badge_module_default[variant],
|
|
862
|
+
Badge_module_default[`color-${hue}`],
|
|
863
|
+
Badge_module_default[`radius-${radius}`]
|
|
864
|
+
);
|
|
865
|
+
const boxProps = {
|
|
866
|
+
className: badgeClasses,
|
|
867
|
+
display: "inline-flex",
|
|
868
|
+
alignItems: "center",
|
|
869
|
+
direction: "row",
|
|
870
|
+
...restProps
|
|
871
|
+
};
|
|
872
|
+
const badgeChildren = renderBadgeChildren(children);
|
|
873
|
+
if (boxProps.as) {
|
|
874
|
+
const boxPropsWithAs = boxProps;
|
|
875
|
+
return /* @__PURE__ */ import_react5.default.createElement(Box, { ref, ...boxPropsWithAs }, badgeChildren);
|
|
886
876
|
}
|
|
887
|
-
);
|
|
877
|
+
return /* @__PURE__ */ import_react5.default.createElement(Box, { ref, ...boxProps }, badgeChildren);
|
|
878
|
+
};
|
|
879
|
+
var Badge = (0, import_react5.forwardRef)(BadgeBaseComponent);
|
|
888
880
|
Badge.displayName = "Badge";
|
|
889
881
|
|
|
890
882
|
// src/components/Button/Button.tsx
|
|
@@ -1254,6 +1246,18 @@ var HEADING_DEFAULT_SIZE_MAP = {
|
|
|
1254
1246
|
// src/components/Heading/Heading.tsx
|
|
1255
1247
|
var import_classnames8 = __toESM(require("classnames"));
|
|
1256
1248
|
|
|
1249
|
+
// src/lib/getElementType.ts
|
|
1250
|
+
function getElementType(Component, props, getDefault) {
|
|
1251
|
+
const { defaultProps = {} } = Component;
|
|
1252
|
+
if (props.as && props.as !== defaultProps.as) return props.as;
|
|
1253
|
+
if (getDefault) {
|
|
1254
|
+
const computedDefault = getDefault();
|
|
1255
|
+
if (computedDefault) return computedDefault;
|
|
1256
|
+
}
|
|
1257
|
+
if (props.href) return "a";
|
|
1258
|
+
return defaultProps.as || "div";
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1257
1261
|
// src/components/Heading/Heading.module.scss
|
|
1258
1262
|
var Heading_module_default = { "heading": "heading__Jti1g" };
|
|
1259
1263
|
|
|
@@ -1437,6 +1441,7 @@ var Checkbox = import_react16.default.forwardRef(
|
|
|
1437
1441
|
isChecked,
|
|
1438
1442
|
label,
|
|
1439
1443
|
labelledby,
|
|
1444
|
+
name = void 0,
|
|
1440
1445
|
onChange,
|
|
1441
1446
|
error = false,
|
|
1442
1447
|
isDisabled = false,
|
|
@@ -1470,6 +1475,7 @@ var Checkbox = import_react16.default.forwardRef(
|
|
|
1470
1475
|
"aria-labelledby": labelledby,
|
|
1471
1476
|
"aria-required": isRequired,
|
|
1472
1477
|
id,
|
|
1478
|
+
name,
|
|
1473
1479
|
checked: !!isChecked,
|
|
1474
1480
|
disabled: isDisabled,
|
|
1475
1481
|
onBlur: handleBlur,
|
|
@@ -1478,7 +1484,7 @@ var Checkbox = import_react16.default.forwardRef(
|
|
|
1478
1484
|
required: isRequired,
|
|
1479
1485
|
type: "checkbox",
|
|
1480
1486
|
ref: inputRef,
|
|
1481
|
-
...value && { value }
|
|
1487
|
+
...value !== void 0 && { value }
|
|
1482
1488
|
};
|
|
1483
1489
|
const responsiveClasses = generateResponsiveClasses("size", size);
|
|
1484
1490
|
const containerClasses = (0, import_classnames10.default)(
|
|
@@ -1656,10 +1662,12 @@ var CheckboxInput = ({
|
|
|
1656
1662
|
isDisabled = false,
|
|
1657
1663
|
isIndeterminate = false,
|
|
1658
1664
|
isRequired = false,
|
|
1665
|
+
name = void 0,
|
|
1659
1666
|
onBlur = void 0,
|
|
1660
1667
|
onFocus = void 0,
|
|
1661
1668
|
requiredIndicator = " *",
|
|
1662
1669
|
size = "md",
|
|
1670
|
+
value = void 0,
|
|
1663
1671
|
...restProps
|
|
1664
1672
|
}) => {
|
|
1665
1673
|
const handleBlur = (event) => {
|
|
@@ -1676,11 +1684,13 @@ var CheckboxInput = ({
|
|
|
1676
1684
|
isChecked: !!isChecked,
|
|
1677
1685
|
isDisabled,
|
|
1678
1686
|
isIndeterminate,
|
|
1687
|
+
name,
|
|
1679
1688
|
onBlur: handleBlur,
|
|
1680
1689
|
onChange: handleChange,
|
|
1681
1690
|
onFocus: handleFocus,
|
|
1682
1691
|
isRequired,
|
|
1683
1692
|
size,
|
|
1693
|
+
value,
|
|
1684
1694
|
label,
|
|
1685
1695
|
className: (0, import_classnames14.default)(
|
|
1686
1696
|
"hyphen-components__variables__form-control",
|
|
@@ -2097,7 +2107,7 @@ var DropdownMenuItem = import_react24.default.forwardRef(({ className, inset, ..
|
|
|
2097
2107
|
}
|
|
2098
2108
|
);
|
|
2099
2109
|
});
|
|
2100
|
-
DropdownMenuItem.displayName =
|
|
2110
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
2101
2111
|
var DropdownMenuContent = import_react24.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ import_react24.default.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ import_react24.default.createElement(
|
|
2102
2112
|
DropdownMenuPrimitive.Content,
|
|
2103
2113
|
{
|
|
@@ -2113,7 +2123,7 @@ var DropdownMenuContent = import_react24.default.forwardRef(({ className, sideOf
|
|
|
2113
2123
|
...props
|
|
2114
2124
|
}
|
|
2115
2125
|
)));
|
|
2116
|
-
DropdownMenuContent.displayName =
|
|
2126
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
2117
2127
|
var DropdownMenuLabel = import_react24.default.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ import_react24.default.createElement(
|
|
2118
2128
|
DropdownMenuPrimitive.Label,
|
|
2119
2129
|
{
|
|
@@ -2126,7 +2136,7 @@ var DropdownMenuLabel = import_react24.default.forwardRef(({ className, inset, .
|
|
|
2126
2136
|
...props
|
|
2127
2137
|
}
|
|
2128
2138
|
));
|
|
2129
|
-
DropdownMenuLabel.displayName =
|
|
2139
|
+
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
2130
2140
|
var DropdownMenuSeparator = import_react24.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react24.default.createElement(
|
|
2131
2141
|
DropdownMenuPrimitive.Separator,
|
|
2132
2142
|
{
|
|
@@ -2142,7 +2152,7 @@ var DropdownMenuSeparator = import_react24.default.forwardRef(({ className, ...p
|
|
|
2142
2152
|
...props
|
|
2143
2153
|
}
|
|
2144
2154
|
));
|
|
2145
|
-
DropdownMenuSeparator.displayName =
|
|
2155
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
2146
2156
|
var DropdownMenuShortcut = ({
|
|
2147
2157
|
className,
|
|
2148
2158
|
...props
|
|
@@ -2174,7 +2184,7 @@ var DropdownMenuSubTrigger = import_react24.default.forwardRef(({ className, ins
|
|
|
2174
2184
|
children,
|
|
2175
2185
|
/* @__PURE__ */ import_react24.default.createElement(Icon, { name: "caret-sm-right", className: "m-left-auto" })
|
|
2176
2186
|
));
|
|
2177
|
-
DropdownMenuSubTrigger.displayName =
|
|
2187
|
+
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
2178
2188
|
var DropdownMenuSubContent = import_react24.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react24.default.createElement(
|
|
2179
2189
|
DropdownMenuPrimitive.SubContent,
|
|
2180
2190
|
{
|
|
@@ -2186,7 +2196,7 @@ var DropdownMenuSubContent = import_react24.default.forwardRef(({ className, ...
|
|
|
2186
2196
|
...props
|
|
2187
2197
|
}
|
|
2188
2198
|
));
|
|
2189
|
-
DropdownMenuSubContent.displayName =
|
|
2199
|
+
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
2190
2200
|
|
|
2191
2201
|
// src/components/FormControl/FormControl.tsx
|
|
2192
2202
|
var import_react25 = __toESM(require("react"));
|
|
@@ -2233,6 +2243,7 @@ var FormikCheckboxInput = ({
|
|
|
2233
2243
|
...props,
|
|
2234
2244
|
id,
|
|
2235
2245
|
label,
|
|
2246
|
+
name,
|
|
2236
2247
|
error: (0, import_formik.getIn)(touched, name) && (0, import_formik.getIn)(errors, name),
|
|
2237
2248
|
isChecked: value,
|
|
2238
2249
|
onBlur,
|
|
@@ -2671,6 +2682,8 @@ function SelectInput(props) {
|
|
|
2671
2682
|
placeholder = void 0,
|
|
2672
2683
|
requiredIndicator = " *",
|
|
2673
2684
|
size = "md",
|
|
2685
|
+
cacheOptions,
|
|
2686
|
+
defaultOptions,
|
|
2674
2687
|
...restProps
|
|
2675
2688
|
} = props;
|
|
2676
2689
|
const handleChange = (values) => {
|
|
@@ -2709,7 +2722,11 @@ function SelectInput(props) {
|
|
|
2709
2722
|
};
|
|
2710
2723
|
const ClearIndicator = (props2) => /* @__PURE__ */ import_react32.default.createElement(import_react_select.components.ClearIndicator, { ...props2 }, /* @__PURE__ */ import_react32.default.createElement(Icon, { name: "remove" }));
|
|
2711
2724
|
const Component = isCreatable && isAsync ? import_async_creatable.default : isCreatable ? import_creatable.default : isAsync ? import_async.default : import_react_select.default;
|
|
2712
|
-
const selectOptions = isAsync ? {
|
|
2725
|
+
const selectOptions = isAsync ? {
|
|
2726
|
+
loadOptions: options,
|
|
2727
|
+
cacheOptions,
|
|
2728
|
+
defaultOptions
|
|
2729
|
+
} : { options };
|
|
2713
2730
|
return /* @__PURE__ */ import_react32.default.createElement(Box, { width: "100%", className: wrapperClasses }, label && !hideLabel && /* @__PURE__ */ import_react32.default.createElement(FormLabel, { ...labelProps }, label), /* @__PURE__ */ import_react32.default.createElement(
|
|
2714
2731
|
Component,
|
|
2715
2732
|
{
|
|
@@ -2747,11 +2764,8 @@ var FormikSelectInput = ({
|
|
|
2747
2764
|
field: { name, onBlur, onChange: formikOnChange, value },
|
|
2748
2765
|
form: { touched, errors },
|
|
2749
2766
|
onChange,
|
|
2750
|
-
id,
|
|
2751
|
-
label,
|
|
2752
|
-
options,
|
|
2753
2767
|
error: errorProp,
|
|
2754
|
-
...
|
|
2768
|
+
...selectProps
|
|
2755
2769
|
}) => {
|
|
2756
2770
|
let errorMessage;
|
|
2757
2771
|
const error = errorProp ?? ((0, import_formik3.getIn)(touched, name) && (0, import_formik3.getIn)(errors, name));
|
|
@@ -2763,15 +2777,12 @@ var FormikSelectInput = ({
|
|
|
2763
2777
|
return /* @__PURE__ */ import_react33.default.createElement(
|
|
2764
2778
|
SelectInput,
|
|
2765
2779
|
{
|
|
2766
|
-
|
|
2767
|
-
label,
|
|
2768
|
-
options,
|
|
2780
|
+
...selectProps,
|
|
2769
2781
|
name,
|
|
2770
2782
|
onBlur,
|
|
2771
2783
|
onChange: onChange ?? formikOnChange,
|
|
2772
2784
|
value,
|
|
2773
|
-
error: errorMessage
|
|
2774
|
-
...props
|
|
2785
|
+
error: errorMessage
|
|
2775
2786
|
}
|
|
2776
2787
|
);
|
|
2777
2788
|
};
|
|
@@ -2954,8 +2965,7 @@ var TextareaInputInset = (0, import_react36.forwardRef)(
|
|
|
2954
2965
|
requiredIndicator = " *",
|
|
2955
2966
|
resize = "vertical",
|
|
2956
2967
|
rows = 5,
|
|
2957
|
-
size = "md"
|
|
2958
|
-
type = "text"
|
|
2968
|
+
size = "md"
|
|
2959
2969
|
}, ref) => {
|
|
2960
2970
|
const responsiveClasses = generateResponsiveClasses("size", size);
|
|
2961
2971
|
const inputWrapperClasses = (0, import_classnames22.default)(
|
|
@@ -2988,7 +2998,6 @@ var TextareaInputInset = (0, import_react36.forwardRef)(
|
|
|
2988
2998
|
placeholder,
|
|
2989
2999
|
required: isRequired,
|
|
2990
3000
|
rows,
|
|
2991
|
-
type,
|
|
2992
3001
|
value
|
|
2993
3002
|
};
|
|
2994
3003
|
return /* @__PURE__ */ import_react36.default.createElement(Box, { width: "100", ref, className }, /* @__PURE__ */ import_react36.default.createElement(
|
|
@@ -3208,6 +3217,7 @@ var SelectInputNative = ({
|
|
|
3208
3217
|
helpText,
|
|
3209
3218
|
error,
|
|
3210
3219
|
id,
|
|
3220
|
+
inputProps = {},
|
|
3211
3221
|
isDisabled,
|
|
3212
3222
|
isRequired,
|
|
3213
3223
|
name,
|
|
@@ -3219,6 +3229,15 @@ var SelectInputNative = ({
|
|
|
3219
3229
|
size = "md",
|
|
3220
3230
|
...restProps
|
|
3221
3231
|
}) => {
|
|
3232
|
+
const isBoxProp = (key) => boxPropsKeys.includes(key);
|
|
3233
|
+
const formControlProps = Object.fromEntries(
|
|
3234
|
+
Object.entries(restProps).filter(([key]) => isBoxProp(key))
|
|
3235
|
+
);
|
|
3236
|
+
const selectProps = Object.fromEntries(
|
|
3237
|
+
Object.entries(restProps).filter(([key]) => !isBoxProp(key))
|
|
3238
|
+
);
|
|
3239
|
+
const selectIsDisabled = isDisabled || selectProps.disabled;
|
|
3240
|
+
const selectIsRequired = isRequired || selectProps.required;
|
|
3222
3241
|
const placeholderOption = {
|
|
3223
3242
|
value: "",
|
|
3224
3243
|
label: placeholder,
|
|
@@ -3234,7 +3253,7 @@ var SelectInputNative = ({
|
|
|
3234
3253
|
SelectInputNative_module_default["select-input-native-wrapper"],
|
|
3235
3254
|
...responsiveClasses.map((className) => SelectInputNative_module_default[className]),
|
|
3236
3255
|
{
|
|
3237
|
-
[SelectInputNative_module_default.disabled]:
|
|
3256
|
+
[SelectInputNative_module_default.disabled]: selectIsDisabled,
|
|
3238
3257
|
[SelectInputNative_module_default.error]: error
|
|
3239
3258
|
}
|
|
3240
3259
|
);
|
|
@@ -3246,26 +3265,28 @@ var SelectInputNative = ({
|
|
|
3246
3265
|
id,
|
|
3247
3266
|
error,
|
|
3248
3267
|
helpText,
|
|
3249
|
-
isDisabled,
|
|
3250
|
-
isRequired,
|
|
3268
|
+
isDisabled: selectIsDisabled,
|
|
3269
|
+
isRequired: selectIsRequired,
|
|
3251
3270
|
requiredIndicator,
|
|
3252
|
-
...
|
|
3271
|
+
...formControlProps
|
|
3253
3272
|
},
|
|
3254
3273
|
/* @__PURE__ */ import_react40.default.createElement(Box, { className: selectWrapperClasses }, /* @__PURE__ */ import_react40.default.createElement(
|
|
3255
3274
|
Box,
|
|
3256
3275
|
{
|
|
3257
3276
|
as: "select",
|
|
3277
|
+
...inputProps,
|
|
3278
|
+
...selectProps,
|
|
3258
3279
|
"aria-label": label,
|
|
3259
3280
|
"aria-labelledby": label && !hideLabel ? `${id}Label` : void 0,
|
|
3260
|
-
"aria-required":
|
|
3281
|
+
"aria-required": selectIsRequired,
|
|
3261
3282
|
value: value ?? "",
|
|
3262
3283
|
onChange,
|
|
3263
3284
|
color: !value ? "disabled" : "base",
|
|
3264
3285
|
autoFocus,
|
|
3265
|
-
disabled:
|
|
3286
|
+
disabled: selectIsDisabled,
|
|
3266
3287
|
name,
|
|
3267
3288
|
id,
|
|
3268
|
-
required:
|
|
3289
|
+
required: selectIsRequired
|
|
3269
3290
|
},
|
|
3270
3291
|
optionsWithPlaceholder.map((option) => /* @__PURE__ */ import_react40.default.createElement(
|
|
3271
3292
|
Box,
|
|
@@ -3719,7 +3740,7 @@ var Switch = ({
|
|
|
3719
3740
|
alignItems: helpText ? "flex-start" : "center",
|
|
3720
3741
|
isFieldRequired: isRequired,
|
|
3721
3742
|
requiredIndicator,
|
|
3722
|
-
size
|
|
3743
|
+
...typeof size === "string" && { size }
|
|
3723
3744
|
};
|
|
3724
3745
|
return /* @__PURE__ */ import_react48.default.createElement(Box, { className }, /* @__PURE__ */ import_react48.default.createElement(Box, { className: wrapperClasses }, /* @__PURE__ */ import_react48.default.createElement(FormLabel, { ...labelProps }, /* @__PURE__ */ import_react48.default.createElement("input", { ...inputProps }), /* @__PURE__ */ import_react48.default.createElement(
|
|
3725
3746
|
"span",
|
|
@@ -4053,14 +4074,14 @@ var ModalBaseComponent = (0, import_react56.forwardRef)(
|
|
|
4053
4074
|
/* @__PURE__ */ import_react56.default.createElement(import_react_remove_scroll2.RemoveScroll, { allowPinchZoom, enabled: isOpen }, /* @__PURE__ */ import_react56.default.createElement(Box, { ref }, /* @__PURE__ */ import_react56.default.createElement(
|
|
4054
4075
|
import_react_modal2.default,
|
|
4055
4076
|
{
|
|
4077
|
+
...restProps,
|
|
4056
4078
|
isOpen,
|
|
4057
4079
|
overlayClassName: overlayClassnames,
|
|
4058
4080
|
className: contentClassnames,
|
|
4059
4081
|
onRequestClose: onDismiss,
|
|
4060
4082
|
ariaHideApp: false,
|
|
4061
4083
|
parentSelector: parentElement ? () => parentElement : void 0,
|
|
4062
|
-
style: { content: { ...maxWidthCss.styles, ...style } }
|
|
4063
|
-
...restProps
|
|
4084
|
+
style: { content: { ...maxWidthCss.styles, ...style } }
|
|
4064
4085
|
},
|
|
4065
4086
|
/* @__PURE__ */ import_react56.default.createElement(
|
|
4066
4087
|
Box,
|
|
@@ -5268,12 +5289,22 @@ var TableRow = ({
|
|
|
5268
5289
|
{ [TableRow_module_default.hoverable]: isHoverable },
|
|
5269
5290
|
className
|
|
5270
5291
|
);
|
|
5292
|
+
const isRenderableCell = (value) => {
|
|
5293
|
+
if (value === null || value === void 0) return true;
|
|
5294
|
+
const valueType = typeof value;
|
|
5295
|
+
if (valueType === "string" || valueType === "number" || valueType === "boolean") {
|
|
5296
|
+
return true;
|
|
5297
|
+
}
|
|
5298
|
+
if (Array.isArray(value)) return value.every(isRenderableCell);
|
|
5299
|
+
return import_react65.default.isValidElement(value);
|
|
5300
|
+
};
|
|
5271
5301
|
const renderCellContent = (column) => {
|
|
5272
5302
|
if (column.render) {
|
|
5273
|
-
const
|
|
5274
|
-
return column.render(
|
|
5303
|
+
const cellValue2 = column.dataKey && row ? row[column.dataKey] : void 0;
|
|
5304
|
+
return column.render(cellValue2, row, rowIndex);
|
|
5275
5305
|
}
|
|
5276
|
-
|
|
5306
|
+
const cellValue = column.dataKey && row ? row[column.dataKey] : null;
|
|
5307
|
+
return isRenderableCell(cellValue) ? cellValue : null;
|
|
5277
5308
|
};
|
|
5278
5309
|
const getCellClassName = (column) => {
|
|
5279
5310
|
if (column.cellClassName) {
|