@dmsi/wedgekit-react 0.0.229 → 0.0.231
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/{chunk-2RUQFWER.js → chunk-2VRZB2A4.js} +1 -1
- package/dist/{chunk-7W4I2NK3.js → chunk-5JVMULVC.js} +12 -2
- package/dist/{chunk-2WRRRPEB.js → chunk-7BBXPM5C.js} +1 -1
- package/dist/{chunk-XOUEHNCC.js → chunk-Q7ETEWBW.js} +1 -1
- package/dist/components/DataGridCell.cjs +12 -2
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +14 -3
- package/dist/components/DateInput.js +3 -2
- package/dist/components/DateRangeInput.cjs +14 -3
- package/dist/components/DateRangeInput.js +3 -2
- package/dist/components/FilterGroup.cjs +12 -2
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +12 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/Password.cjs +12 -2
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +12 -2
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +12 -2
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +12 -2
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +12 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/Upload.cjs +317 -16
- package/dist/components/Upload.js +33 -6
- package/dist/components/index.cjs +12 -2
- package/dist/components/index.js +4 -4
- package/package.json +1 -1
- package/src/components/DateInput.tsx +1 -0
- package/src/components/DateRangeInput.tsx +1 -0
- package/src/components/Input.tsx +19 -5
- package/src/components/Upload.tsx +90 -74
|
@@ -62,7 +62,7 @@ __export(Upload_exports, {
|
|
|
62
62
|
Upload: () => Upload
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(Upload_exports);
|
|
65
|
-
var
|
|
65
|
+
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
66
66
|
|
|
67
67
|
// src/classNames.ts
|
|
68
68
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -417,8 +417,288 @@ var Button = (_a) => {
|
|
|
417
417
|
};
|
|
418
418
|
Button.displayName = "Button";
|
|
419
419
|
|
|
420
|
-
// src/components/
|
|
420
|
+
// src/components/Stack.tsx
|
|
421
|
+
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
421
422
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
423
|
+
var getFlexClassNames = ({ items, justify, grow }) => (0, import_clsx5.default)(
|
|
424
|
+
"flex",
|
|
425
|
+
items === "start" && "items-start",
|
|
426
|
+
grow && "grow",
|
|
427
|
+
items === "start" && "items-start",
|
|
428
|
+
items === "center" && "items-center",
|
|
429
|
+
items === "end" && "items-end",
|
|
430
|
+
items === "start-center" && "items-start desktop:items-center",
|
|
431
|
+
justify === "start" && "justify-start",
|
|
432
|
+
justify === "center" && "justify-center",
|
|
433
|
+
justify === "end" && "justify-end",
|
|
434
|
+
justify === "end" && "justify-end",
|
|
435
|
+
justify === "between" && "justify-between",
|
|
436
|
+
justify === "around" && "justify-around"
|
|
437
|
+
);
|
|
438
|
+
var useGapClassNames = (sizing) => {
|
|
439
|
+
return (0, import_clsx5.default)(
|
|
440
|
+
sizing === "layout-group" && "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
|
|
441
|
+
sizing === "layout" && "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-compact-layout-gap",
|
|
442
|
+
sizing === "container" && "gap-mobile-container-gap desktop:gap-desktop-container-gap compact:gap-compact-container-gap",
|
|
443
|
+
sizing === "component" && "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-compact-component-gap"
|
|
444
|
+
);
|
|
445
|
+
};
|
|
446
|
+
var Stack = (_a) => {
|
|
447
|
+
var _b = _a, {
|
|
448
|
+
children,
|
|
449
|
+
items,
|
|
450
|
+
justify,
|
|
451
|
+
grow,
|
|
452
|
+
padding,
|
|
453
|
+
paddingX,
|
|
454
|
+
paddingY,
|
|
455
|
+
margin,
|
|
456
|
+
marginX,
|
|
457
|
+
marginY,
|
|
458
|
+
horizontal,
|
|
459
|
+
horizontalMobile,
|
|
460
|
+
elevation = 0,
|
|
461
|
+
rounded,
|
|
462
|
+
centered,
|
|
463
|
+
width,
|
|
464
|
+
minHeight,
|
|
465
|
+
maxWidth,
|
|
466
|
+
minWidth,
|
|
467
|
+
height,
|
|
468
|
+
maxHeight,
|
|
469
|
+
borderColor,
|
|
470
|
+
backgroundColor,
|
|
471
|
+
sizing = "none",
|
|
472
|
+
overflowY = "inherit",
|
|
473
|
+
overflowX = "inherit",
|
|
474
|
+
flexShrink,
|
|
475
|
+
flexGrow,
|
|
476
|
+
position,
|
|
477
|
+
top,
|
|
478
|
+
left,
|
|
479
|
+
id,
|
|
480
|
+
noGap,
|
|
481
|
+
marginTop,
|
|
482
|
+
marginBottom,
|
|
483
|
+
testid
|
|
484
|
+
} = _b, props = __objRest(_b, [
|
|
485
|
+
"children",
|
|
486
|
+
"items",
|
|
487
|
+
"justify",
|
|
488
|
+
"grow",
|
|
489
|
+
"padding",
|
|
490
|
+
"paddingX",
|
|
491
|
+
"paddingY",
|
|
492
|
+
"margin",
|
|
493
|
+
"marginX",
|
|
494
|
+
"marginY",
|
|
495
|
+
"horizontal",
|
|
496
|
+
"horizontalMobile",
|
|
497
|
+
"elevation",
|
|
498
|
+
"rounded",
|
|
499
|
+
"centered",
|
|
500
|
+
"width",
|
|
501
|
+
"minHeight",
|
|
502
|
+
"maxWidth",
|
|
503
|
+
"minWidth",
|
|
504
|
+
"height",
|
|
505
|
+
"maxHeight",
|
|
506
|
+
"borderColor",
|
|
507
|
+
"backgroundColor",
|
|
508
|
+
"sizing",
|
|
509
|
+
"overflowY",
|
|
510
|
+
"overflowX",
|
|
511
|
+
"flexShrink",
|
|
512
|
+
"flexGrow",
|
|
513
|
+
"position",
|
|
514
|
+
"top",
|
|
515
|
+
"left",
|
|
516
|
+
"id",
|
|
517
|
+
"noGap",
|
|
518
|
+
"marginTop",
|
|
519
|
+
"marginBottom",
|
|
520
|
+
"testid"
|
|
521
|
+
]);
|
|
522
|
+
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
523
|
+
const gapClassNames = useGapClassNames(sizing);
|
|
524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
525
|
+
"div",
|
|
526
|
+
__spreadProps(__spreadValues({
|
|
527
|
+
id,
|
|
528
|
+
"data-testid": testid
|
|
529
|
+
}, props), {
|
|
530
|
+
style: {
|
|
531
|
+
height: height === "full" ? "100%" : height !== void 0 ? `${height}px` : void 0,
|
|
532
|
+
maxHeight: maxHeight !== void 0 ? `${maxHeight}px` : void 0,
|
|
533
|
+
minHeight: minHeight !== void 0 ? `${minHeight}px` : void 0,
|
|
534
|
+
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0,
|
|
535
|
+
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
536
|
+
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
537
|
+
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
538
|
+
backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
|
|
539
|
+
flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
|
|
540
|
+
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
541
|
+
position: position !== void 0 ? position : void 0,
|
|
542
|
+
top: top !== void 0 ? `${top}px` : void 0,
|
|
543
|
+
left: left !== void 0 ? `${left}px` : void 0
|
|
544
|
+
},
|
|
545
|
+
className: (0, import_clsx5.default)(
|
|
546
|
+
"scrollbar-thin",
|
|
547
|
+
"max-w-screen",
|
|
548
|
+
width !== "fit" && "w-full",
|
|
549
|
+
width === "full" && "w-full",
|
|
550
|
+
width === "max" && "w-max",
|
|
551
|
+
centered && "mx-auto",
|
|
552
|
+
overflowY == "auto" && "overflow-y-auto",
|
|
553
|
+
overflowY == "hidden" && "overflow-y-hidden",
|
|
554
|
+
overflowY == "scroll" && "overflow-y-scroll",
|
|
555
|
+
overflowX == "auto" && "overflow-x-auto",
|
|
556
|
+
overflowX == "hidden" && "overflow-x-hidden",
|
|
557
|
+
overflowX == "scroll" && "overflow-x-scroll",
|
|
558
|
+
padding && sizing === "container" && "p-mobile-container-padding desktop:p-desktop-container-padding compact:p-desktop-compact-container-padding",
|
|
559
|
+
padding && sizing === "layout" && "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding",
|
|
560
|
+
padding && sizing === "layout-group" && "p-mobile-layout-group-padding desktop:p-desktop-layout-group-padding compact:p-desktop-compact-layout-group-padding",
|
|
561
|
+
padding && sizing === "component" && "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding",
|
|
562
|
+
paddingX && sizing === "container" && "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding",
|
|
563
|
+
paddingX && sizing === "layout" && "px-mobile-layout-padding desktop:px-desktop-layout-padding compact:px-desktop-compact-layout-padding",
|
|
564
|
+
paddingX && sizing === "layout-group" && "px-mobile-layout-group-padding desktop:px-desktop-layout-group-padding compact:px-desktop-compact-layout-group-padding",
|
|
565
|
+
paddingX && sizing === "component" && "px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding",
|
|
566
|
+
paddingY && sizing === "container" && "py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding",
|
|
567
|
+
paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
568
|
+
paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
|
|
569
|
+
paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
570
|
+
margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
|
|
571
|
+
marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
|
|
572
|
+
marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
|
|
573
|
+
marginBottom && sizing === "container" && "mb-mobile-container-padding desktop:mb-desktop-container-padding compact:mb-compact-container-padding",
|
|
574
|
+
marginY && sizing === "container" && "my-mobile-container-padding desktop:my-desktop-container-padding compact:my-compact-container-padding",
|
|
575
|
+
horizontal ? "desktop:flex-row" : "desktop:flex-col",
|
|
576
|
+
horizontalMobile ? "flex-row" : "flex-col",
|
|
577
|
+
flexClassNames,
|
|
578
|
+
!noGap && gapClassNames,
|
|
579
|
+
elevation === 0 && "shadow-none",
|
|
580
|
+
elevation === 2 && "shadow-2",
|
|
581
|
+
elevation === 4 && "shadow-4",
|
|
582
|
+
elevation === 16 && "shadow-16",
|
|
583
|
+
rounded && "rounded"
|
|
584
|
+
),
|
|
585
|
+
children
|
|
586
|
+
})
|
|
587
|
+
);
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
// src/components/Spinner.tsx
|
|
591
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
592
|
+
var Spinner = ({ size = "small", testid }) => {
|
|
593
|
+
const dimension = size === "large" ? 48 : 24;
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
595
|
+
"svg",
|
|
596
|
+
{
|
|
597
|
+
"data-testid": testid,
|
|
598
|
+
width: dimension,
|
|
599
|
+
height: dimension,
|
|
600
|
+
viewBox: "0 0 24 24",
|
|
601
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
602
|
+
fill: "#1D1E1E",
|
|
603
|
+
className: "animate-spin",
|
|
604
|
+
"aria-label": "Loading",
|
|
605
|
+
children: [
|
|
606
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
607
|
+
"animate",
|
|
608
|
+
{
|
|
609
|
+
attributeName: "opacity",
|
|
610
|
+
begin: "0s",
|
|
611
|
+
dur: "1s",
|
|
612
|
+
from: "1",
|
|
613
|
+
to: "0",
|
|
614
|
+
repeatCount: "indefinite"
|
|
615
|
+
}
|
|
616
|
+
) }),
|
|
617
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
618
|
+
"animate",
|
|
619
|
+
{
|
|
620
|
+
attributeName: "opacity",
|
|
621
|
+
begin: "-0.875s",
|
|
622
|
+
dur: "1s",
|
|
623
|
+
from: "1",
|
|
624
|
+
to: "0",
|
|
625
|
+
repeatCount: "indefinite"
|
|
626
|
+
}
|
|
627
|
+
) }),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
629
|
+
"animate",
|
|
630
|
+
{
|
|
631
|
+
attributeName: "opacity",
|
|
632
|
+
begin: "-0.75s",
|
|
633
|
+
dur: "1s",
|
|
634
|
+
from: "1",
|
|
635
|
+
to: "0",
|
|
636
|
+
repeatCount: "indefinite"
|
|
637
|
+
}
|
|
638
|
+
) }),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
640
|
+
"animate",
|
|
641
|
+
{
|
|
642
|
+
attributeName: "opacity",
|
|
643
|
+
begin: "-0.625s",
|
|
644
|
+
dur: "1s",
|
|
645
|
+
from: "1",
|
|
646
|
+
to: "0",
|
|
647
|
+
repeatCount: "indefinite"
|
|
648
|
+
}
|
|
649
|
+
) }),
|
|
650
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
651
|
+
"animate",
|
|
652
|
+
{
|
|
653
|
+
attributeName: "opacity",
|
|
654
|
+
begin: "-0.5s",
|
|
655
|
+
dur: "1s",
|
|
656
|
+
from: "1",
|
|
657
|
+
to: "0",
|
|
658
|
+
repeatCount: "indefinite"
|
|
659
|
+
}
|
|
660
|
+
) }),
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
662
|
+
"animate",
|
|
663
|
+
{
|
|
664
|
+
attributeName: "opacity",
|
|
665
|
+
begin: "-0.375s",
|
|
666
|
+
dur: "1s",
|
|
667
|
+
from: "1",
|
|
668
|
+
to: "0",
|
|
669
|
+
repeatCount: "indefinite"
|
|
670
|
+
}
|
|
671
|
+
) }),
|
|
672
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
673
|
+
"animate",
|
|
674
|
+
{
|
|
675
|
+
attributeName: "opacity",
|
|
676
|
+
begin: "-0.25s",
|
|
677
|
+
dur: "1s",
|
|
678
|
+
from: "1",
|
|
679
|
+
to: "0",
|
|
680
|
+
repeatCount: "indefinite"
|
|
681
|
+
}
|
|
682
|
+
) }),
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
684
|
+
"animate",
|
|
685
|
+
{
|
|
686
|
+
attributeName: "opacity",
|
|
687
|
+
begin: "-0.125s",
|
|
688
|
+
dur: "1s",
|
|
689
|
+
from: "1",
|
|
690
|
+
to: "0",
|
|
691
|
+
repeatCount: "indefinite"
|
|
692
|
+
}
|
|
693
|
+
) })
|
|
694
|
+
]
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
};
|
|
698
|
+
Spinner.displayName = "Spinner";
|
|
699
|
+
|
|
700
|
+
// src/components/Upload.tsx
|
|
701
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
422
702
|
function Upload(props) {
|
|
423
703
|
const _a = props, {
|
|
424
704
|
isLoading,
|
|
@@ -437,11 +717,11 @@ function Upload(props) {
|
|
|
437
717
|
"onRemove",
|
|
438
718
|
"testid"
|
|
439
719
|
]);
|
|
440
|
-
return /* @__PURE__ */ (0,
|
|
720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
441
721
|
"label",
|
|
442
722
|
{
|
|
443
723
|
style: __spreadValues({}, style),
|
|
444
|
-
className: (0,
|
|
724
|
+
className: (0, import_clsx6.default)(
|
|
445
725
|
"border border-dashed border-border-primary-normal",
|
|
446
726
|
"flex flex-col items-center justify-center",
|
|
447
727
|
"p-6",
|
|
@@ -452,7 +732,7 @@ function Upload(props) {
|
|
|
452
732
|
),
|
|
453
733
|
"data-testid": testid,
|
|
454
734
|
children: [
|
|
455
|
-
/* @__PURE__ */ (0,
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
456
736
|
"input",
|
|
457
737
|
__spreadProps(__spreadValues({}, rest), {
|
|
458
738
|
type: "file",
|
|
@@ -460,16 +740,37 @@ function Upload(props) {
|
|
|
460
740
|
"data-testid": testid ? `${testid}-file-input` : void 0
|
|
461
741
|
})
|
|
462
742
|
),
|
|
463
|
-
isLoading && /* @__PURE__ */ (0,
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
743
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
744
|
+
Stack,
|
|
745
|
+
{
|
|
746
|
+
centered: true,
|
|
747
|
+
items: "center",
|
|
748
|
+
justify: "center",
|
|
749
|
+
sizing: "container",
|
|
750
|
+
padding: true,
|
|
751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Spinner, { size: "large" })
|
|
752
|
+
}
|
|
753
|
+
),
|
|
754
|
+
!value && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
755
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
756
|
+
Icon,
|
|
757
|
+
{
|
|
758
|
+
testid: testid ? `${testid}-icon` : void 0,
|
|
759
|
+
name: "cloud_upload",
|
|
760
|
+
className: "text-icon-primary-normal"
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
764
|
+
Paragraph,
|
|
765
|
+
{
|
|
766
|
+
testid: testid ? `${testid}-text` : void 0,
|
|
767
|
+
color: errorText ? "text-primary-error" : "text-secondary-normal",
|
|
768
|
+
children: errorText ? errorText : text
|
|
769
|
+
}
|
|
770
|
+
)
|
|
470
771
|
] }),
|
|
471
|
-
value && /* @__PURE__ */ (0,
|
|
472
|
-
/* @__PURE__ */ (0,
|
|
772
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
473
774
|
"img",
|
|
474
775
|
{
|
|
475
776
|
"data-testid": testid ? `${testid}-uploaded-image` : void 0,
|
|
@@ -478,7 +779,7 @@ function Upload(props) {
|
|
|
478
779
|
className: "absolute inset-0 object-contain object-center max-h-full max-w-full self-center justify-self-center"
|
|
479
780
|
}
|
|
480
781
|
),
|
|
481
|
-
/* @__PURE__ */ (0,
|
|
782
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "absolute right-2 top-2", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
482
783
|
Button,
|
|
483
784
|
{
|
|
484
785
|
testid: testid ? `${testid}-remove-image-button` : void 0,
|
|
@@ -488,7 +789,7 @@ function Upload(props) {
|
|
|
488
789
|
onRemove == null ? void 0 : onRemove();
|
|
489
790
|
},
|
|
490
791
|
iconOnly: true,
|
|
491
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
792
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "delete" })
|
|
492
793
|
}
|
|
493
794
|
) })
|
|
494
795
|
] })
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Spinner
|
|
3
|
+
} from "../chunk-PLMGI5K5.js";
|
|
4
|
+
import {
|
|
5
|
+
Stack
|
|
6
|
+
} from "../chunk-BOWQUDUU.js";
|
|
1
7
|
import {
|
|
2
8
|
Paragraph
|
|
3
9
|
} from "../chunk-CJELWEO2.js";
|
|
@@ -60,13 +66,34 @@ function Upload(props) {
|
|
|
60
66
|
"data-testid": testid ? `${testid}-file-input` : void 0
|
|
61
67
|
})
|
|
62
68
|
),
|
|
63
|
-
isLoading && /* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
isLoading && /* @__PURE__ */ jsx(
|
|
70
|
+
Stack,
|
|
71
|
+
{
|
|
72
|
+
centered: true,
|
|
73
|
+
items: "center",
|
|
74
|
+
justify: "center",
|
|
75
|
+
sizing: "container",
|
|
76
|
+
padding: true,
|
|
77
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: "large" })
|
|
78
|
+
}
|
|
79
|
+
),
|
|
67
80
|
!value && !isLoading && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
-
/* @__PURE__ */ jsx(
|
|
69
|
-
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Icon,
|
|
83
|
+
{
|
|
84
|
+
testid: testid ? `${testid}-icon` : void 0,
|
|
85
|
+
name: "cloud_upload",
|
|
86
|
+
className: "text-icon-primary-normal"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Paragraph,
|
|
91
|
+
{
|
|
92
|
+
testid: testid ? `${testid}-text` : void 0,
|
|
93
|
+
color: errorText ? "text-primary-error" : "text-secondary-normal",
|
|
94
|
+
children: errorText ? errorText : text
|
|
95
|
+
}
|
|
96
|
+
)
|
|
70
97
|
] }),
|
|
71
98
|
value && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
99
|
/* @__PURE__ */ jsx(
|
|
@@ -1361,6 +1361,7 @@ var InputBase = (_a) => {
|
|
|
1361
1361
|
removeBorder,
|
|
1362
1362
|
wrapperClassName,
|
|
1363
1363
|
focus,
|
|
1364
|
+
secondaryIconColor,
|
|
1364
1365
|
fullWidth = true
|
|
1365
1366
|
} = _b, props = __objRest(_b, [
|
|
1366
1367
|
"id",
|
|
@@ -1380,6 +1381,7 @@ var InputBase = (_a) => {
|
|
|
1380
1381
|
"removeBorder",
|
|
1381
1382
|
"wrapperClassName",
|
|
1382
1383
|
"focus",
|
|
1384
|
+
"secondaryIconColor",
|
|
1383
1385
|
"fullWidth"
|
|
1384
1386
|
]);
|
|
1385
1387
|
const attributes = {
|
|
@@ -1445,6 +1447,7 @@ var InputBase = (_a) => {
|
|
|
1445
1447
|
Label,
|
|
1446
1448
|
{
|
|
1447
1449
|
id: id ? `${id}-label` : void 0,
|
|
1450
|
+
color: error ? "text-primary-error" : void 0,
|
|
1448
1451
|
className: (0, import_clsx7.default)(
|
|
1449
1452
|
props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
|
|
1450
1453
|
),
|
|
@@ -1496,11 +1499,18 @@ var InputBase = (_a) => {
|
|
|
1496
1499
|
)
|
|
1497
1500
|
})
|
|
1498
1501
|
),
|
|
1499
|
-
after
|
|
1502
|
+
secondaryIconColor ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "contents text-text-secondary-normal", children: after }) : after
|
|
1500
1503
|
]
|
|
1501
1504
|
}
|
|
1502
1505
|
),
|
|
1503
|
-
caption && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1506
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1507
|
+
"div",
|
|
1508
|
+
{
|
|
1509
|
+
id: id ? `${id}-caption` : void 0,
|
|
1510
|
+
"data-testid": testid ? `${testid}-caption` : void 0,
|
|
1511
|
+
children: caption
|
|
1512
|
+
}
|
|
1513
|
+
)
|
|
1504
1514
|
]
|
|
1505
1515
|
}
|
|
1506
1516
|
);
|
package/dist/components/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../chunk-3WNXMCZV.js";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-2VRZB2A4.js";
|
|
7
7
|
import {
|
|
8
8
|
Checkbox
|
|
9
9
|
} from "../chunk-E3UOI2D2.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
DataGridCell,
|
|
13
13
|
DragAlongCell,
|
|
14
14
|
DraggableCellHeader
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-Q7ETEWBW.js";
|
|
16
16
|
import {
|
|
17
17
|
Menu
|
|
18
18
|
} from "../chunk-NA3ODQCN.js";
|
|
@@ -28,10 +28,10 @@ import "../chunk-VXWSAIB5.js";
|
|
|
28
28
|
import "../chunk-T3F37S6Z.js";
|
|
29
29
|
import {
|
|
30
30
|
Search
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-7BBXPM5C.js";
|
|
32
32
|
import {
|
|
33
33
|
Input
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-5JVMULVC.js";
|
|
35
35
|
import "../chunk-5UH6QUFB.js";
|
|
36
36
|
import {
|
|
37
37
|
Label
|
package/package.json
CHANGED
package/src/components/Input.tsx
CHANGED
|
@@ -56,6 +56,7 @@ export type InputBaseProps = {
|
|
|
56
56
|
removeBorder?: boolean;
|
|
57
57
|
wrapperClassName?: string;
|
|
58
58
|
focus?: boolean;
|
|
59
|
+
secondaryIconColor?: boolean;
|
|
59
60
|
fullWidth?: boolean; // If true, input takes full width of the container
|
|
60
61
|
} & InputFormatting &
|
|
61
62
|
Omit<ComponentProps<"input">, "align" | "id">;
|
|
@@ -78,6 +79,7 @@ export const InputBase = ({
|
|
|
78
79
|
removeBorder,
|
|
79
80
|
wrapperClassName,
|
|
80
81
|
focus,
|
|
82
|
+
secondaryIconColor,
|
|
81
83
|
fullWidth = true,
|
|
82
84
|
...props
|
|
83
85
|
}: InputBaseProps) => {
|
|
@@ -151,6 +153,7 @@ export const InputBase = ({
|
|
|
151
153
|
<div className={clsx("flex items-center", componentGap)}>
|
|
152
154
|
<Label
|
|
153
155
|
id={id ? `${id}-label` : undefined}
|
|
156
|
+
color={error ? "text-primary-error" : undefined}
|
|
154
157
|
className={clsx(
|
|
155
158
|
props.disabled || props.readOnly
|
|
156
159
|
? "cursor-default"
|
|
@@ -205,10 +208,21 @@ export const InputBase = ({
|
|
|
205
208
|
)}
|
|
206
209
|
/>
|
|
207
210
|
|
|
208
|
-
{
|
|
211
|
+
{secondaryIconColor ? (
|
|
212
|
+
<span className="contents text-text-secondary-normal">{after}</span>
|
|
213
|
+
) : (
|
|
214
|
+
after
|
|
215
|
+
)}
|
|
209
216
|
</div>
|
|
210
217
|
|
|
211
|
-
{caption &&
|
|
218
|
+
{caption && (
|
|
219
|
+
<div
|
|
220
|
+
id={id ? `${id}-caption` : undefined}
|
|
221
|
+
data-testid={testid ? `${testid}-caption` : undefined}
|
|
222
|
+
>
|
|
223
|
+
{caption}
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
212
226
|
</label>
|
|
213
227
|
);
|
|
214
228
|
};
|
|
@@ -225,7 +239,7 @@ export const Input = ({
|
|
|
225
239
|
id,
|
|
226
240
|
testid,
|
|
227
241
|
...props
|
|
228
|
-
}: Omit<ComponentProps<"input">,"onChange" | "align" | "children"> &
|
|
242
|
+
}: Omit<ComponentProps<"input">, "onChange" | "align" | "children"> &
|
|
229
243
|
InputBaseProps & {
|
|
230
244
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
231
245
|
onClear?: () => void;
|
|
@@ -240,7 +254,7 @@ export const Input = ({
|
|
|
240
254
|
}, [propValue]);
|
|
241
255
|
|
|
242
256
|
useEffect(() => {
|
|
243
|
-
if (variant !==
|
|
257
|
+
if (variant !== "currency") {
|
|
244
258
|
return;
|
|
245
259
|
}
|
|
246
260
|
|
|
@@ -254,7 +268,7 @@ export const Input = ({
|
|
|
254
268
|
|
|
255
269
|
setInternalValue(formatted);
|
|
256
270
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
257
|
-
}, [])
|
|
271
|
+
}, []);
|
|
258
272
|
|
|
259
273
|
const getInputProps = () => {
|
|
260
274
|
const baseProps = {
|