@aivenio/aquarium 1.4.1 → 1.6.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/_variables.scss +1 -1
- package/dist/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +381 -143
- package/dist/atoms.mjs +380 -143
- package/dist/src/common/Card/Card.d.ts +35 -0
- package/dist/src/common/Card/Card.js +50 -0
- package/dist/src/common/DataList/DataList.d.ts +1 -0
- package/dist/src/common/DataList/DataList.js +3 -3
- package/dist/src/common/Popover/Popover.js +2 -2
- package/dist/src/common/Select/Select.js +4 -4
- package/dist/src/common/index.d.ts +1 -0
- package/dist/src/common/index.js +2 -1
- package/dist/src/components/Avatar/Avatar.js +2 -2
- package/dist/src/components/Banner/Banner.js +2 -2
- package/dist/src/components/Card/Card.d.ts +8 -47
- package/dist/src/components/Card/Card.js +15 -27
- package/dist/src/components/Card/Compact.d.ts +36 -0
- package/dist/src/components/Card/Compact.js +33 -0
- package/dist/src/components/Card/types.d.ts +44 -0
- package/dist/src/components/Card/types.js +2 -0
- package/dist/src/components/Carousel/Carousel.js +4 -2
- package/dist/src/components/Chip/Chip.d.ts +1 -1
- package/dist/src/components/Chip/Chip.js +2 -2
- package/dist/src/components/Combobox/Combobox.js +4 -6
- package/dist/src/components/DataList/DataList.d.ts +7 -1
- package/dist/src/components/DataList/DataList.js +3 -3
- package/dist/src/components/DataTable/DataTable.d.ts +7 -1
- package/dist/src/components/DataTable/DataTable.js +3 -3
- package/dist/src/components/EmptyState/EmptyState.d.ts +2 -1
- package/dist/src/components/EmptyState/EmptyState.js +4 -4
- package/dist/src/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/src/components/MultiSelect/MultiSelect.js +13 -8
- package/dist/src/components/Popover/Popover.js +2 -2
- package/dist/src/components/Popover/PopoverWrapper.d.ts +1 -0
- package/dist/src/components/Popover/PopoverWrapper.js +3 -3
- package/dist/src/components/Select/Select.js +2 -2
- package/dist/src/components/Tabs/Tabs.js +54 -18
- package/dist/src/components/Timeline/Timeline.js +2 -2
- package/dist/styles.css +39 -23
- package/dist/styles_timescaledb.css +39 -23
- package/dist/system.cjs +932 -753
- package/dist/system.mjs +899 -720
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -1551,7 +1551,7 @@ __export(components_exports, {
|
|
1551
1551
|
Box: () => Box,
|
1552
1552
|
Breadcrumbs: () => Breadcrumbs,
|
1553
1553
|
Button: () => Button,
|
1554
|
-
Card: () =>
|
1554
|
+
Card: () => Card2,
|
1555
1555
|
Carousel: () => Carousel,
|
1556
1556
|
Checkbox: () => Checkbox2,
|
1557
1557
|
CheckboxGroup: () => CheckboxGroup,
|
@@ -1769,7 +1769,7 @@ var Menu = React2.forwardRef(
|
|
1769
1769
|
return /* @__PURE__ */ React2.createElement("ul", __spreadValues({
|
1770
1770
|
ref,
|
1771
1771
|
style: { maxHeight },
|
1772
|
-
className
|
1772
|
+
className
|
1773
1773
|
}, props), children);
|
1774
1774
|
}
|
1775
1775
|
);
|
@@ -1811,7 +1811,7 @@ var Item = React2.forwardRef(
|
|
1811
1811
|
var _b = _a, { highlighted, selected, className, children } = _b, props = __objRest(_b, ["highlighted", "selected", "className", "children"]);
|
1812
1812
|
return /* @__PURE__ */ React2.createElement("li", __spreadValues({
|
1813
1813
|
ref,
|
1814
|
-
className: classNames(className, "flex items-center gap-x-3 p-3", {
|
1814
|
+
className: classNames(className, "flex items-center gap-x-3 p-3 typography-small", {
|
1815
1815
|
"cursor-pointer": !props.disabled,
|
1816
1816
|
"bg-grey-0": highlighted,
|
1817
1817
|
"text-grey-20": props.disabled,
|
@@ -1831,7 +1831,7 @@ var ActionItem = React2.forwardRef(
|
|
1831
1831
|
ref,
|
1832
1832
|
role: "button",
|
1833
1833
|
onClick: () => !props.disabled && (onClick == null ? void 0 : onClick()),
|
1834
|
-
className: classNames(className, "flex items-center gap-x-3 text-primary-80", {
|
1834
|
+
className: classNames(className, "flex items-center gap-x-3 typography-small text-primary-80", {
|
1835
1835
|
"p-3": !dense,
|
1836
1836
|
"px-3 py-2": dense,
|
1837
1837
|
"cursor-pointer": !props.disabled,
|
@@ -3481,12 +3481,14 @@ var Skeleton = ({
|
|
3481
3481
|
var AvatarStack = ({ images }) => /* @__PURE__ */ React15.createElement(Box, {
|
3482
3482
|
display: "flex",
|
3483
3483
|
className: tw("[&>*:not(:first-child)]:-ml-3")
|
3484
|
-
}, images.map(
|
3485
|
-
|
3486
|
-
|
3487
|
-
|
3488
|
-
|
3489
|
-
|
3484
|
+
}, images.map(
|
3485
|
+
(image, index) => image ? /* @__PURE__ */ React15.createElement(Avatar, {
|
3486
|
+
key: image != null ? image : index,
|
3487
|
+
image
|
3488
|
+
}) : /* @__PURE__ */ React15.createElement(Avatar.Skeleton, {
|
3489
|
+
key: image != null ? image : index
|
3490
|
+
})
|
3491
|
+
));
|
3490
3492
|
var Avatar = ({ image }) => /* @__PURE__ */ React15.createElement("img", {
|
3491
3493
|
src: image,
|
3492
3494
|
className: classNames(tw("w-[32px] h-[32px]"))
|
@@ -3662,7 +3664,7 @@ var createBanner = (displayName, opts = {}) => {
|
|
3662
3664
|
}, omit3(action, "text")), action.text))), (props.layout === "vertical" || props.layout === void 0) && props.image !== void 0 && /* @__PURE__ */ React18.createElement(Banner.ImageContainer, null, props.image ? /* @__PURE__ */ React18.createElement("img", {
|
3663
3665
|
src: props.image,
|
3664
3666
|
alt: props.imageAlt,
|
3665
|
-
className: tw("
|
3667
|
+
className: tw("bg-cover object-cover", { "w-full": !props.imageWidth }),
|
3666
3668
|
style: { width: props.imageWidth, height: props.imageHeight }
|
3667
3669
|
}) : /* @__PURE__ */ React18.createElement(BannerImageSkeleton, null)), isDismissable && /* @__PURE__ */ React18.createElement(Banner.DismissContainer, {
|
3668
3670
|
layout
|
@@ -3738,8 +3740,8 @@ var ActiveCrumb = asCrumb("span", "ActiveCrumb", { isActive: true });
|
|
3738
3740
|
Breadcrumbs.Crumb = Crumb;
|
3739
3741
|
|
3740
3742
|
// src/components/Card/Card.tsx
|
3741
|
-
import
|
3742
|
-
import
|
3743
|
+
import React25 from "react";
|
3744
|
+
import omit5 from "lodash/omit";
|
3743
3745
|
|
3744
3746
|
// src/components/Chip/Chip.tsx
|
3745
3747
|
import React21 from "react";
|
@@ -3851,7 +3853,7 @@ var ChipContainer = ({ dense, children }) => /* @__PURE__ */ React21.createEleme
|
|
3851
3853
|
})
|
3852
3854
|
}, React21.Children.map(
|
3853
3855
|
children,
|
3854
|
-
(child) => isComponentType(child, Chip2) || isComponentType(child, StatusChip) ? React21.cloneElement(child, { dense }) : void 0
|
3856
|
+
(child) => isComponentType(child, Chip2) || isComponentType(child, StatusChip) || isComponentType(child, ChipSkeleton) ? React21.cloneElement(child, { dense }) : void 0
|
3855
3857
|
));
|
3856
3858
|
|
3857
3859
|
// src/components/Typography/Typography.tsx
|
@@ -3970,8 +3972,164 @@ Typography2.SmallTextBold = (_a) => {
|
|
3970
3972
|
}));
|
3971
3973
|
};
|
3972
3974
|
|
3975
|
+
// src/common/Card/Card.tsx
|
3976
|
+
import React23 from "react";
|
3977
|
+
var Card = (_a) => {
|
3978
|
+
var _b = _a, {
|
3979
|
+
disabled,
|
3980
|
+
fullWidth,
|
3981
|
+
clickable,
|
3982
|
+
className,
|
3983
|
+
children
|
3984
|
+
} = _b, rest = __objRest(_b, [
|
3985
|
+
"disabled",
|
3986
|
+
"fullWidth",
|
3987
|
+
"clickable",
|
3988
|
+
"className",
|
3989
|
+
"children"
|
3990
|
+
]);
|
3991
|
+
return /* @__PURE__ */ React23.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
3992
|
+
className: classNames(
|
3993
|
+
tw("border-grey-5 border-[1px] rounded-[2px] relative p-5 flex flex-col gap-5", {
|
3994
|
+
"w-[280px]": !fullWidth,
|
3995
|
+
"w-full min-w-[280px]": Boolean(fullWidth),
|
3996
|
+
"active:bg-grey-5 cursor-pointer hover:border-grey-50 focus:border-info-70": Boolean(clickable && !disabled),
|
3997
|
+
"bg-grey-0 cursor-not-allowed focus:border-transparent": Boolean(disabled)
|
3998
|
+
}),
|
3999
|
+
className
|
4000
|
+
)
|
4001
|
+
}), children);
|
4002
|
+
};
|
4003
|
+
var ColorHighlight = (_a) => {
|
4004
|
+
var _b = _a, { color, className } = _b, rest = __objRest(_b, ["color", "className"]);
|
4005
|
+
return /* @__PURE__ */ React23.createElement(Box, __spreadProps(__spreadValues({}, rest), {
|
4006
|
+
backgroundColor: color,
|
4007
|
+
className: classNames(tw("h-1 w-full absolute top-0 left-0 right-0"), className)
|
4008
|
+
}));
|
4009
|
+
};
|
4010
|
+
var ImageContainer = (_a) => {
|
4011
|
+
var _b = _a, { className, fullSize } = _b, rest = __objRest(_b, ["className", "fullSize"]);
|
4012
|
+
return /* @__PURE__ */ React23.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
4013
|
+
className: classNames(
|
4014
|
+
tw("-mx-4", {
|
4015
|
+
"-mt-4": Boolean(fullSize)
|
4016
|
+
}),
|
4017
|
+
className
|
4018
|
+
)
|
4019
|
+
}));
|
4020
|
+
};
|
4021
|
+
var Image = ({
|
4022
|
+
image,
|
4023
|
+
imageAlt,
|
4024
|
+
fullSize
|
4025
|
+
}) => /* @__PURE__ */ React23.createElement("img", {
|
4026
|
+
src: image,
|
4027
|
+
alt: imageAlt,
|
4028
|
+
className: tw("w-full bg-cover object-cover h-[174px]", {
|
4029
|
+
"h-[225px]": Boolean(fullSize)
|
4030
|
+
})
|
4031
|
+
});
|
4032
|
+
var Content = (_a) => {
|
4033
|
+
var _b = _a, { className, dense } = _b, rest = __objRest(_b, ["className", "dense"]);
|
4034
|
+
return /* @__PURE__ */ React23.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
4035
|
+
className: classNames(tw("flex flex-col", { "gap-4": !dense }), className)
|
4036
|
+
}));
|
4037
|
+
};
|
4038
|
+
var Actions = (_a) => {
|
4039
|
+
var _b = _a, { className, dense } = _b, rest = __objRest(_b, ["className", "dense"]);
|
4040
|
+
return /* @__PURE__ */ React23.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
4041
|
+
className: classNames(tw("flex gap-3 items-center", { "pt-3 ": !dense }), className)
|
4042
|
+
}));
|
4043
|
+
};
|
4044
|
+
Card.Content = Content;
|
4045
|
+
Card.Actions = Actions;
|
4046
|
+
Card.ImageContainer = ImageContainer;
|
4047
|
+
Card.Image = Image;
|
4048
|
+
Card.ColorHiglight = ColorHighlight;
|
4049
|
+
|
4050
|
+
// src/components/Card/Compact.tsx
|
4051
|
+
import React24 from "react";
|
4052
|
+
import { omit as omit4 } from "lodash";
|
4053
|
+
var CompactCard = ({
|
4054
|
+
title,
|
4055
|
+
chips = [],
|
4056
|
+
icon,
|
4057
|
+
color,
|
4058
|
+
action,
|
4059
|
+
link,
|
4060
|
+
onClick,
|
4061
|
+
disabled,
|
4062
|
+
fullWidth,
|
4063
|
+
children
|
4064
|
+
}) => /* @__PURE__ */ React24.createElement(Card, {
|
4065
|
+
onClick: disabled ? void 0 : onClick,
|
4066
|
+
disabled,
|
4067
|
+
fullWidth,
|
4068
|
+
clickable: Boolean(onClick),
|
4069
|
+
tabIndex: onClick ? 0 : -1
|
4070
|
+
}, color && /* @__PURE__ */ React24.createElement(Card.ColorHiglight, {
|
4071
|
+
color
|
4072
|
+
}), chips.length > 0 && /* @__PURE__ */ React24.createElement(ChipContainer, {
|
4073
|
+
dense: true
|
4074
|
+
}, chips.map((chip) => /* @__PURE__ */ React24.createElement(Chip2, {
|
4075
|
+
key: chip,
|
4076
|
+
text: chip
|
4077
|
+
}))), /* @__PURE__ */ React24.createElement(Box, {
|
4078
|
+
display: "flex",
|
4079
|
+
gap: "5"
|
4080
|
+
}, icon && /* @__PURE__ */ React24.createElement(Avatar, {
|
4081
|
+
image: icon
|
4082
|
+
}), /* @__PURE__ */ React24.createElement(Card.Content, {
|
4083
|
+
dense: true
|
4084
|
+
}, /* @__PURE__ */ React24.createElement(Typography2.SmallStrong, {
|
4085
|
+
color: "black"
|
4086
|
+
}, title), /* @__PURE__ */ React24.createElement(Typography2.Caption, {
|
4087
|
+
color: "grey-70"
|
4088
|
+
}, children))), (action || link) && /* @__PURE__ */ React24.createElement(Card.Actions, {
|
4089
|
+
dense: true
|
4090
|
+
}, action && /* @__PURE__ */ React24.createElement(SecondaryButton, __spreadValues({
|
4091
|
+
dense: true
|
4092
|
+
}, omit4(action, "text")), action.text), link && /* @__PURE__ */ React24.createElement(ExternalLinkButton, __spreadValues({
|
4093
|
+
dense: true,
|
4094
|
+
kind: "ghost"
|
4095
|
+
}, omit4(link, "text")), link.text)));
|
4096
|
+
var CompactSkeleton = ({
|
4097
|
+
chips = true,
|
4098
|
+
icon = true,
|
4099
|
+
actions = true,
|
4100
|
+
fullWidth = false
|
4101
|
+
}) => /* @__PURE__ */ React24.createElement(Card, {
|
4102
|
+
fullWidth
|
4103
|
+
}, chips && /* @__PURE__ */ React24.createElement(ChipContainer, {
|
4104
|
+
dense: true
|
4105
|
+
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ React24.createElement(Chip2.Skeleton, {
|
4106
|
+
key: idx
|
4107
|
+
}))), /* @__PURE__ */ React24.createElement(Box, {
|
4108
|
+
display: "flex",
|
4109
|
+
gap: "5"
|
4110
|
+
}, icon && /* @__PURE__ */ React24.createElement(Avatar.Skeleton, null), /* @__PURE__ */ React24.createElement(Card.Content, {
|
4111
|
+
dense: true
|
4112
|
+
}, /* @__PURE__ */ React24.createElement(Skeleton, {
|
4113
|
+
width: 80,
|
4114
|
+
height: 20
|
4115
|
+
}), /* @__PURE__ */ React24.createElement(Box, {
|
4116
|
+
height: "1"
|
4117
|
+
}), /* @__PURE__ */ React24.createElement(Skeleton, {
|
4118
|
+
width: 145,
|
4119
|
+
height: 16
|
4120
|
+
}))), actions && /* @__PURE__ */ React24.createElement(Card.Actions, {
|
4121
|
+
dense: true
|
4122
|
+
}, /* @__PURE__ */ React24.createElement(Skeleton, {
|
4123
|
+
width: 115,
|
4124
|
+
height: 25
|
4125
|
+
}), /* @__PURE__ */ React24.createElement(Skeleton, {
|
4126
|
+
width: 60,
|
4127
|
+
height: 25
|
4128
|
+
})));
|
4129
|
+
CompactCard.Skeleton = CompactSkeleton;
|
4130
|
+
|
3973
4131
|
// src/components/Card/Card.tsx
|
3974
|
-
var
|
4132
|
+
var Card2 = ({
|
3975
4133
|
title,
|
3976
4134
|
description,
|
3977
4135
|
chips = [],
|
@@ -3985,127 +4143,84 @@ var Card = ({
|
|
3985
4143
|
disabled,
|
3986
4144
|
fullWidth,
|
3987
4145
|
children
|
3988
|
-
}) => /* @__PURE__ */
|
3989
|
-
onClick,
|
3990
|
-
color,
|
4146
|
+
}) => /* @__PURE__ */ React25.createElement(Card, {
|
4147
|
+
onClick: disabled ? void 0 : onClick,
|
3991
4148
|
disabled,
|
3992
|
-
fullWidth
|
3993
|
-
|
4149
|
+
fullWidth,
|
4150
|
+
clickable: Boolean(onClick),
|
4151
|
+
tabIndex: onClick ? 0 : -1
|
4152
|
+
}, color && /* @__PURE__ */ React25.createElement(Card.ColorHiglight, {
|
4153
|
+
color
|
4154
|
+
}), chips.length > 0 && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
3994
4155
|
dense: true
|
3995
|
-
}, chips.map((chip) => /* @__PURE__ */
|
4156
|
+
}, chips.map((chip) => /* @__PURE__ */ React25.createElement(Chip2, {
|
3996
4157
|
key: chip,
|
3997
4158
|
text: chip
|
3998
|
-
}))), icons.length > 0 && /* @__PURE__ */
|
4159
|
+
}))), icons.length > 0 && /* @__PURE__ */ React25.createElement(AvatarStack, {
|
3999
4160
|
images: icons
|
4000
|
-
}), image !== void 0 && /* @__PURE__ */
|
4161
|
+
}), image !== void 0 && /* @__PURE__ */ React25.createElement(CardImage, {
|
4001
4162
|
image,
|
4002
4163
|
imageAlt,
|
4003
4164
|
fullSize: chips.length === 0
|
4004
|
-
}), /* @__PURE__ */
|
4165
|
+
}), /* @__PURE__ */ React25.createElement(Card.Content, null, /* @__PURE__ */ React25.createElement(Typography2.DefaultStrong, {
|
4166
|
+
color: "black"
|
4167
|
+
}, title), /* @__PURE__ */ React25.createElement(Typography2.Caption, {
|
4168
|
+
color: "grey-70"
|
4169
|
+
}, children || description)), (action || link) && /* @__PURE__ */ React25.createElement(Card.Actions, null, action && /* @__PURE__ */ React25.createElement(SecondaryButton, __spreadValues({
|
4005
4170
|
dense: true
|
4006
|
-
},
|
4171
|
+
}, omit5(action, "text")), action.text), link && /* @__PURE__ */ React25.createElement(ExternalLinkButton, __spreadValues({
|
4007
4172
|
dense: true,
|
4008
4173
|
kind: "ghost"
|
4009
|
-
},
|
4174
|
+
}, omit5(link, "text")), link.text)));
|
4010
4175
|
var CardSkeleton = ({
|
4011
4176
|
chips = true,
|
4012
4177
|
icons = false,
|
4013
4178
|
image = !icons,
|
4014
4179
|
actions = true,
|
4015
4180
|
fullWidth = false
|
4016
|
-
}) => /* @__PURE__ */
|
4181
|
+
}) => /* @__PURE__ */ React25.createElement(Card, {
|
4017
4182
|
fullWidth
|
4018
|
-
}, chips && /* @__PURE__ */
|
4183
|
+
}, chips && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
4019
4184
|
dense: true
|
4020
|
-
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */
|
4185
|
+
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ React25.createElement(Chip2.Skeleton, {
|
4021
4186
|
key: idx
|
4022
|
-
}))), icons && /* @__PURE__ */
|
4187
|
+
}))), icons && /* @__PURE__ */ React25.createElement(AvatarStack, {
|
4023
4188
|
images: [null]
|
4024
|
-
}), image && /* @__PURE__ */
|
4189
|
+
}), image && /* @__PURE__ */ React25.createElement(CardImage, {
|
4025
4190
|
image: null,
|
4026
4191
|
fullSize: !chips
|
4027
|
-
}), /* @__PURE__ */
|
4192
|
+
}), /* @__PURE__ */ React25.createElement(Card.Content, null, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4028
4193
|
width: 145,
|
4029
4194
|
height: 25
|
4030
|
-
}), /* @__PURE__ */
|
4195
|
+
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
4031
4196
|
width: 145,
|
4032
4197
|
height: 16
|
4033
|
-
})), actions && /* @__PURE__ */
|
4198
|
+
})), actions && /* @__PURE__ */ React25.createElement(Card.Actions, null, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4034
4199
|
width: 115,
|
4035
4200
|
height: 25
|
4036
|
-
}), /* @__PURE__ */
|
4201
|
+
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
4037
4202
|
width: 60,
|
4038
4203
|
height: 25
|
4039
4204
|
})));
|
4040
|
-
|
4041
|
-
|
4042
|
-
|
4043
|
-
|
4044
|
-
|
4045
|
-
|
4046
|
-
|
4047
|
-
|
4048
|
-
|
4049
|
-
borderRadius: 2,
|
4050
|
-
className: classNames(
|
4051
|
-
tw("border-grey-5", {
|
4052
|
-
"w-[280px]": !fullWidth,
|
4053
|
-
"w-full min-w-[280px]": fullWidth,
|
4054
|
-
"active:bg-grey-5 cursor-pointer hover:border-grey-50 focus:border-info-70": Boolean(onClick && !disabled),
|
4055
|
-
"bg-grey-0 cursor-not-allowed focus:border-transparent": Boolean(disabled)
|
4056
|
-
})
|
4057
|
-
),
|
4058
|
-
onClick: disabled ? void 0 : onClick,
|
4059
|
-
tabIndex: onClick ? 0 : -1,
|
4060
|
-
disabled
|
4061
|
-
}, color && /* @__PURE__ */ React23.createElement(Box, {
|
4062
|
-
backgroundColor: color,
|
4063
|
-
height: "1",
|
4064
|
-
width: "full"
|
4065
|
-
}), /* @__PURE__ */ React23.createElement(Box, {
|
4066
|
-
padding: "5",
|
4067
|
-
display: "flex",
|
4068
|
-
flexDirection: "column",
|
4069
|
-
gap: "5"
|
4070
|
-
}, children));
|
4071
|
-
var CardImage = ({ image, imageAlt, fullSize }) => /* @__PURE__ */ React23.createElement(Box, {
|
4072
|
-
marginX: "-4",
|
4073
|
-
marginTop: fullSize ? "-4" : void 0
|
4074
|
-
}, image ? /* @__PURE__ */ React23.createElement("img", {
|
4075
|
-
src: image,
|
4076
|
-
alt: imageAlt,
|
4077
|
-
className: tw("w-full bg-cover object-cover h-[174px]", {
|
4078
|
-
"h-[225px]": fullSize
|
4079
|
-
})
|
4080
|
-
}) : /* @__PURE__ */ React23.createElement(CardImage.Skeleton, {
|
4205
|
+
Card2.Skeleton = CardSkeleton;
|
4206
|
+
Card2.Compact = CompactCard;
|
4207
|
+
var CardImage = ({ image, imageAlt, fullSize }) => /* @__PURE__ */ React25.createElement(Card.ImageContainer, {
|
4208
|
+
fullSize
|
4209
|
+
}, image ? /* @__PURE__ */ React25.createElement(Card.Image, {
|
4210
|
+
image,
|
4211
|
+
imageAlt,
|
4212
|
+
fullSize
|
4213
|
+
}) : /* @__PURE__ */ React25.createElement(CardImage.Skeleton, {
|
4081
4214
|
fullSize
|
4082
4215
|
}));
|
4083
|
-
var CardImageSkeleton = ({ fullSize }) => /* @__PURE__ */
|
4216
|
+
var CardImageSkeleton = ({ fullSize }) => /* @__PURE__ */ React25.createElement(Skeleton, {
|
4084
4217
|
height: fullSize ? 225 : 174,
|
4085
|
-
|
4218
|
+
width: "100%"
|
4086
4219
|
});
|
4087
4220
|
CardImage.Skeleton = CardImageSkeleton;
|
4088
|
-
var CardContent = ({ children }) => /* @__PURE__ */ React23.createElement(Box, {
|
4089
|
-
display: "flex",
|
4090
|
-
flexDirection: "column",
|
4091
|
-
gap: "4"
|
4092
|
-
}, children);
|
4093
|
-
var CardBody = ({ children }) => /* @__PURE__ */ React23.createElement(Typography2, {
|
4094
|
-
variant: "caption",
|
4095
|
-
color: "grey-70"
|
4096
|
-
}, children);
|
4097
|
-
var CardTitle = ({ children }) => /* @__PURE__ */ React23.createElement(Typography2, {
|
4098
|
-
variant: "default-strong"
|
4099
|
-
}, children);
|
4100
|
-
var CardActions = ({ children }) => /* @__PURE__ */ React23.createElement(Box, {
|
4101
|
-
paddingTop: "3",
|
4102
|
-
display: "flex",
|
4103
|
-
gap: "3",
|
4104
|
-
alignItems: "center"
|
4105
|
-
}, children);
|
4106
4221
|
|
4107
4222
|
// src/components/Carousel/Carousel.tsx
|
4108
|
-
import
|
4223
|
+
import React26, { useEffect as useEffect3, useLayoutEffect, useRef as useRef2, useState as useState2 } from "react";
|
4109
4224
|
var import_chevronLeft = __toESM(require_chevronLeft());
|
4110
4225
|
var import_chevronRight = __toESM(require_chevronRight());
|
4111
4226
|
var Carousel = ({
|
@@ -4116,7 +4231,7 @@ var Carousel = ({
|
|
4116
4231
|
}) => {
|
4117
4232
|
const containerRef = useRef2(null);
|
4118
4233
|
const scrollbarContainerRef = useRef2(null);
|
4119
|
-
const items =
|
4234
|
+
const items = React26.Children.toArray(children);
|
4120
4235
|
const [width, setWidth] = useState2(0);
|
4121
4236
|
const [isUpdating, setIsUpdating] = useState2(false);
|
4122
4237
|
const [currentPage, setCurrentPage] = useState2(currentPageProp != null ? currentPageProp : defaultPage);
|
@@ -4125,7 +4240,7 @@ var Carousel = ({
|
|
4125
4240
|
var _a;
|
4126
4241
|
const containerWidth = (_a = containerRef.current) == null ? void 0 : _a.getBoundingClientRect().width;
|
4127
4242
|
if (containerWidth !== void 0 && width !== containerWidth) {
|
4128
|
-
setWidth(containerWidth);
|
4243
|
+
setWidth(Math.round(containerWidth));
|
4129
4244
|
}
|
4130
4245
|
};
|
4131
4246
|
updateContainerWidth();
|
@@ -4166,30 +4281,30 @@ var Carousel = ({
|
|
4166
4281
|
onPageChange && onPageChange(newPage);
|
4167
4282
|
}
|
4168
4283
|
};
|
4169
|
-
return items.length > 0 ? /* @__PURE__ */
|
4284
|
+
return items.length > 0 ? /* @__PURE__ */ React26.createElement("div", {
|
4170
4285
|
className: tw("w-full flex flex-col"),
|
4171
4286
|
ref: containerRef
|
4172
|
-
}, containerRef !== null && /* @__PURE__ */
|
4287
|
+
}, containerRef !== null && /* @__PURE__ */ React26.createElement("ul", {
|
4173
4288
|
ref: scrollbarContainerRef,
|
4174
4289
|
tabIndex: 0,
|
4175
4290
|
onScroll: handleScroll,
|
4176
4291
|
className: tw(
|
4177
4292
|
"grid items-stretch grid-flow-col overflow-x-scroll scroll-smooth snap-x snap-mandatory scrollbar-hide focus-visible:outline-0 focus-visible:ring-1 focus-visible:ring-info-70"
|
4178
4293
|
)
|
4179
|
-
}, width !== 0 &&
|
4294
|
+
}, width !== 0 && React26.Children.map(children, (child, index) => /* @__PURE__ */ React26.createElement(CarouselItem, {
|
4180
4295
|
key: index,
|
4181
4296
|
width,
|
4182
4297
|
ariaHidden: index + 1 === currentPage ? void 0 : true
|
4183
|
-
}, child))), /* @__PURE__ */
|
4298
|
+
}, child))), /* @__PURE__ */ React26.createElement(Flexbox, {
|
4184
4299
|
direction: "row",
|
4185
4300
|
justifyContent: "flex-end",
|
4186
4301
|
alignItems: "center"
|
4187
|
-
}, /* @__PURE__ */
|
4302
|
+
}, /* @__PURE__ */ React26.createElement(IconButton, {
|
4188
4303
|
"aria-label": "Previous",
|
4189
4304
|
onClick: () => handleNavigationClick("left"),
|
4190
4305
|
icon: import_chevronLeft.default,
|
4191
4306
|
disabled: currentPage === 1
|
4192
|
-
}), /* @__PURE__ */
|
4307
|
+
}), /* @__PURE__ */ React26.createElement(Typography2.Caption, null, `${currentPage}/${React26.Children.count(children)}`), /* @__PURE__ */ React26.createElement(IconButton, {
|
4193
4308
|
"aria-label": "Next",
|
4194
4309
|
onClick: () => handleNavigationClick("right"),
|
4195
4310
|
icon: import_chevronRight.default,
|
@@ -4197,7 +4312,7 @@ var Carousel = ({
|
|
4197
4312
|
}))) : null;
|
4198
4313
|
};
|
4199
4314
|
var CarouselItem = ({ width, children, ariaHidden }) => {
|
4200
|
-
return /* @__PURE__ */
|
4315
|
+
return /* @__PURE__ */ React26.createElement("li", {
|
4201
4316
|
style: { width },
|
4202
4317
|
"aria-hidden": ariaHidden,
|
4203
4318
|
className: tw("flex justify-center snap-start")
|
@@ -4205,10 +4320,10 @@ var CarouselItem = ({ width, children, ariaHidden }) => {
|
|
4205
4320
|
};
|
4206
4321
|
|
4207
4322
|
// src/components/Checkbox/Checkbox.tsx
|
4208
|
-
import
|
4323
|
+
import React29 from "react";
|
4209
4324
|
|
4210
4325
|
// src/components/ControlLabel/ControlLabel.tsx
|
4211
|
-
import
|
4326
|
+
import React27 from "react";
|
4212
4327
|
var ControlLabel = (_a) => {
|
4213
4328
|
var _b = _a, {
|
4214
4329
|
label,
|
@@ -4226,7 +4341,7 @@ var ControlLabel = (_a) => {
|
|
4226
4341
|
"style"
|
4227
4342
|
]);
|
4228
4343
|
const textClass = disabled ? "text-grey-40" : "text-grey-100";
|
4229
|
-
return /* @__PURE__ */
|
4344
|
+
return /* @__PURE__ */ React27.createElement("label", __spreadValues({
|
4230
4345
|
className: tw(
|
4231
4346
|
"inline-grid grid-cols-[auto_1fr]",
|
4232
4347
|
{
|
@@ -4236,9 +4351,9 @@ var ControlLabel = (_a) => {
|
|
4236
4351
|
textClass
|
4237
4352
|
),
|
4238
4353
|
style: __spreadValues({}, style)
|
4239
|
-
}, rest), children, label && /* @__PURE__ */
|
4354
|
+
}, rest), children, label && /* @__PURE__ */ React27.createElement("span", {
|
4240
4355
|
className: tw("typography-small self-center")
|
4241
|
-
}, label), caption && /* @__PURE__ */
|
4356
|
+
}, label), caption && /* @__PURE__ */ React27.createElement(Typography2, {
|
4242
4357
|
className: tw("col-start-2"),
|
4243
4358
|
variant: "caption",
|
4244
4359
|
color: disabled ? "grey-40" : "grey-50"
|
@@ -4246,18 +4361,18 @@ var ControlLabel = (_a) => {
|
|
4246
4361
|
};
|
4247
4362
|
|
4248
4363
|
// src/common/Checkbox/Checkbox.tsx
|
4249
|
-
import
|
4364
|
+
import React28 from "react";
|
4250
4365
|
var import_minus = __toESM(require_minus());
|
4251
4366
|
var import_tick2 = __toESM(require_tick());
|
4252
|
-
var Checkbox =
|
4367
|
+
var Checkbox = React28.forwardRef(
|
4253
4368
|
(_a, ref) => {
|
4254
4369
|
var _b = _a, { id, children, name, disabled = false, readOnly = false, indeterminate = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly", "indeterminate"]);
|
4255
|
-
return /* @__PURE__ */
|
4370
|
+
return /* @__PURE__ */ React28.createElement("span", {
|
4256
4371
|
className: classNames(tw("inline-flex justify-center items-center self-center relative"), {
|
4257
4372
|
"hover:border-grey-50 peer-checked:border-navyBlue-100": !disabled,
|
4258
4373
|
"border-grey-5": disabled
|
4259
4374
|
})
|
4260
|
-
}, /* @__PURE__ */
|
4375
|
+
}, /* @__PURE__ */ React28.createElement("input", __spreadProps(__spreadValues({
|
4261
4376
|
id,
|
4262
4377
|
ref,
|
4263
4378
|
type: "checkbox",
|
@@ -4271,7 +4386,7 @@ var Checkbox = React26.forwardRef(
|
|
4271
4386
|
),
|
4272
4387
|
readOnly,
|
4273
4388
|
disabled
|
4274
|
-
})), /* @__PURE__ */
|
4389
|
+
})), /* @__PURE__ */ React28.createElement(Icon, {
|
4275
4390
|
icon: indeterminate ? import_minus.default : import_tick2.default,
|
4276
4391
|
className: classNames(
|
4277
4392
|
tw(
|
@@ -4290,12 +4405,12 @@ var Checkbox = React26.forwardRef(
|
|
4290
4405
|
);
|
4291
4406
|
|
4292
4407
|
// src/components/Checkbox/Checkbox.tsx
|
4293
|
-
var Checkbox2 =
|
4408
|
+
var Checkbox2 = React29.forwardRef(
|
4294
4409
|
(_a, ref) => {
|
4295
4410
|
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
4296
4411
|
var _a2;
|
4297
4412
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
4298
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
4413
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React29.createElement(ControlLabel, {
|
4299
4414
|
htmlFor: id,
|
4300
4415
|
label: children,
|
4301
4416
|
"aria-label": ariaLabel,
|
@@ -4303,7 +4418,7 @@ var Checkbox2 = React27.forwardRef(
|
|
4303
4418
|
readOnly,
|
4304
4419
|
disabled,
|
4305
4420
|
style: { gap: "0 8px" }
|
4306
|
-
}, !readOnly && /* @__PURE__ */
|
4421
|
+
}, !readOnly && /* @__PURE__ */ React29.createElement(Checkbox, __spreadProps(__spreadValues({
|
4307
4422
|
id,
|
4308
4423
|
ref,
|
4309
4424
|
name
|
@@ -4313,26 +4428,26 @@ var Checkbox2 = React27.forwardRef(
|
|
4313
4428
|
}))) : null;
|
4314
4429
|
}
|
4315
4430
|
);
|
4316
|
-
var CheckboxSkeleton = () => /* @__PURE__ */
|
4431
|
+
var CheckboxSkeleton = () => /* @__PURE__ */ React29.createElement("div", {
|
4317
4432
|
className: tw("flex gap-3")
|
4318
|
-
}, /* @__PURE__ */
|
4433
|
+
}, /* @__PURE__ */ React29.createElement(Skeleton, {
|
4319
4434
|
height: 20,
|
4320
4435
|
width: 20
|
4321
|
-
}), /* @__PURE__ */
|
4436
|
+
}), /* @__PURE__ */ React29.createElement(Skeleton, {
|
4322
4437
|
height: 20,
|
4323
4438
|
width: 150
|
4324
4439
|
}));
|
4325
4440
|
Checkbox2.Skeleton = CheckboxSkeleton;
|
4326
4441
|
|
4327
4442
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4328
|
-
import
|
4443
|
+
import React36, { useState as useState3 } from "react";
|
4329
4444
|
import uniqueId from "lodash/uniqueId";
|
4330
4445
|
|
4331
4446
|
// src/common/InputGroup/InputGroup.tsx
|
4332
|
-
import
|
4447
|
+
import React31 from "react";
|
4333
4448
|
|
4334
4449
|
// src/components/Grid/Grid.tsx
|
4335
|
-
import
|
4450
|
+
import React30 from "react";
|
4336
4451
|
var Grid = Tailwindify(
|
4337
4452
|
({
|
4338
4453
|
htmlTag = "div",
|
@@ -4385,7 +4500,7 @@ var Grid = Tailwindify(
|
|
4385
4500
|
gridRowEnd: rowEnd
|
4386
4501
|
});
|
4387
4502
|
const HtmlElement = htmlTag;
|
4388
|
-
return /* @__PURE__ */
|
4503
|
+
return /* @__PURE__ */ React30.createElement(HtmlElement, {
|
4389
4504
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
4390
4505
|
className
|
4391
4506
|
}, children);
|
@@ -4401,7 +4516,7 @@ var gridColumnStyles = {
|
|
4401
4516
|
};
|
4402
4517
|
var InputGroup = (_a) => {
|
4403
4518
|
var _b = _a, { cols = "1", children } = _b, rest = __objRest(_b, ["cols", "children"]);
|
4404
|
-
return /* @__PURE__ */
|
4519
|
+
return /* @__PURE__ */ React31.createElement(Grid, __spreadProps(__spreadValues({}, rest), {
|
4405
4520
|
display: "inline-grid",
|
4406
4521
|
colGap: "l4",
|
4407
4522
|
rowGap: "3",
|
@@ -4411,12 +4526,12 @@ var InputGroup = (_a) => {
|
|
4411
4526
|
};
|
4412
4527
|
|
4413
4528
|
// src/utils/form/Label/Label.tsx
|
4414
|
-
import
|
4529
|
+
import React35 from "react";
|
4415
4530
|
|
4416
4531
|
// src/utils/form/FormControl/FormControl.tsx
|
4417
|
-
import
|
4532
|
+
import React32 from "react";
|
4418
4533
|
var FormControl = ({ className, inline, children }) => {
|
4419
|
-
return /* @__PURE__ */
|
4534
|
+
return /* @__PURE__ */ React32.createElement(Flexbox, {
|
4420
4535
|
direction: "column",
|
4421
4536
|
display: inline ? "inline-flex" : "flex",
|
4422
4537
|
className
|
@@ -4424,14 +4539,14 @@ var FormControl = ({ className, inline, children }) => {
|
|
4424
4539
|
};
|
4425
4540
|
|
4426
4541
|
// src/utils/form/HelperText/HelperText.tsx
|
4427
|
-
import
|
4542
|
+
import React34 from "react";
|
4428
4543
|
import classNames3 from "classnames";
|
4429
4544
|
import isNumber3 from "lodash/isNumber";
|
4430
4545
|
|
4431
4546
|
// src/utils/form/CharCounter/CharCounter.tsx
|
4432
|
-
import
|
4547
|
+
import React33 from "react";
|
4433
4548
|
var CharCounter = ({ dense = true, length, maxLength, valid = true }) => {
|
4434
|
-
return /* @__PURE__ */
|
4549
|
+
return /* @__PURE__ */ React33.createElement("span", {
|
4435
4550
|
className: tw(
|
4436
4551
|
`whitespace-nowrap`,
|
4437
4552
|
valid ? "text-grey-50" : "text-error-70",
|
@@ -4453,34 +4568,34 @@ var HelperText = ({
|
|
4453
4568
|
const hasMaxLength = isNumber3(maxLength) && maxLength > 0;
|
4454
4569
|
const showMessage = hasError || hasMaxLength;
|
4455
4570
|
if (!showMessage) {
|
4456
|
-
return reserveSpaceForError ? /* @__PURE__ */
|
4571
|
+
return reserveSpaceForError ? /* @__PURE__ */ React34.createElement("p", {
|
4457
4572
|
className: tw("block mt-1 mb-3 typography-caption")
|
4458
4573
|
}, "\xA0") : null;
|
4459
4574
|
}
|
4460
|
-
return /* @__PURE__ */
|
4575
|
+
return /* @__PURE__ */ React34.createElement(Grid, {
|
4461
4576
|
cols: "1",
|
4462
4577
|
rows: "1",
|
4463
4578
|
colGap: "3",
|
4464
4579
|
alignItems: "start",
|
4465
4580
|
autoCols: "min",
|
4466
4581
|
className: tw("mt-1 mb-3")
|
4467
|
-
}, /* @__PURE__ */
|
4582
|
+
}, /* @__PURE__ */ React34.createElement(GridItem, {
|
4468
4583
|
colStart: "1",
|
4469
4584
|
colEnd: "2"
|
4470
|
-
}, hasError && /* @__PURE__ */
|
4585
|
+
}, hasError && /* @__PURE__ */ React34.createElement("p", {
|
4471
4586
|
id: messageId,
|
4472
4587
|
className: tw("text-error-50 block typography-caption")
|
4473
|
-
}, helperText)), /* @__PURE__ */
|
4588
|
+
}, helperText)), /* @__PURE__ */ React34.createElement(GridItem, {
|
4474
4589
|
colStart: "2",
|
4475
4590
|
colEnd: "3",
|
4476
4591
|
display: "flex"
|
4477
|
-
}, isNumber3(length) && hasMaxLength && /* @__PURE__ */
|
4592
|
+
}, isNumber3(length) && hasMaxLength && /* @__PURE__ */ React34.createElement(CharCounter, {
|
4478
4593
|
length,
|
4479
4594
|
maxLength,
|
4480
4595
|
valid: !error2
|
4481
4596
|
})));
|
4482
4597
|
};
|
4483
|
-
var Skeleton2 = ({ className, children }) => /* @__PURE__ */
|
4598
|
+
var Skeleton2 = ({ className, children }) => /* @__PURE__ */ React34.createElement("div", {
|
4484
4599
|
className: classNames3(className, "h-[25px]")
|
4485
4600
|
}, children);
|
4486
4601
|
HelperText.Skeleton = Skeleton2;
|
@@ -4494,35 +4609,35 @@ var LabelText = ({
|
|
4494
4609
|
helpTooltip,
|
4495
4610
|
helpTooltipPlacement
|
4496
4611
|
}) => {
|
4497
|
-
return /* @__PURE__ */
|
4612
|
+
return /* @__PURE__ */ React35.createElement("span", {
|
4498
4613
|
className: tw("inline-block mb-2 typography-small-strong", {
|
4499
4614
|
"text-grey-60": variant === "default",
|
4500
4615
|
"text-error-50": variant === "error",
|
4501
4616
|
"text-grey-40": variant === "disabled"
|
4502
4617
|
})
|
4503
|
-
}, labelText, required && /* @__PURE__ */
|
4618
|
+
}, labelText, required && /* @__PURE__ */ React35.createElement("span", {
|
4504
4619
|
className: tw("text-error-50")
|
4505
|
-
}, "*"), helpTooltip && /* @__PURE__ */
|
4620
|
+
}, "*"), helpTooltip && /* @__PURE__ */ React35.createElement(Tooltip, {
|
4506
4621
|
content: helpTooltip,
|
4507
4622
|
placement: helpTooltipPlacement
|
4508
|
-
}, /* @__PURE__ */
|
4623
|
+
}, /* @__PURE__ */ React35.createElement("span", {
|
4509
4624
|
className: tw("text-grey-30 flex items-center cursor-pointer ml-2")
|
4510
|
-
}, /* @__PURE__ */
|
4625
|
+
}, /* @__PURE__ */ React35.createElement(InlineIcon, {
|
4511
4626
|
icon: import_questionMark.default,
|
4512
4627
|
"data-testid": "icon-info"
|
4513
4628
|
}))));
|
4514
4629
|
};
|
4515
4630
|
var Label = (props) => {
|
4516
4631
|
const _a = props, { id, htmlFor, labelText, labelProps: _b = {} } = _a, labelProps = __objRest(_b, []), { "data-testid": dataTestid, children } = _a;
|
4517
|
-
return /* @__PURE__ */
|
4632
|
+
return /* @__PURE__ */ React35.createElement("label", __spreadValues({
|
4518
4633
|
id,
|
4519
4634
|
className: tw("w-full"),
|
4520
4635
|
"data-testid": dataTestid,
|
4521
4636
|
htmlFor
|
4522
|
-
}, labelProps), labelText && /* @__PURE__ */
|
4637
|
+
}, labelProps), labelText && /* @__PURE__ */ React35.createElement(LabelText, __spreadValues({}, props)), children);
|
4523
4638
|
};
|
4524
4639
|
var LabelSkeleton = () => {
|
4525
|
-
return /* @__PURE__ */
|
4640
|
+
return /* @__PURE__ */ React35.createElement(Skeleton, {
|
4526
4641
|
height: 20,
|
4527
4642
|
width: 100,
|
4528
4643
|
className: tw("mb-[7px]")
|
@@ -4555,15 +4670,15 @@ var LabelControl = (_a) => {
|
|
4555
4670
|
]);
|
4556
4671
|
const legacyError = error2 !== void 0 && valid === false;
|
4557
4672
|
const variant = !valid || legacyError ? "error" : disabled ? "disabled" : "default";
|
4558
|
-
return /* @__PURE__ */
|
4673
|
+
return /* @__PURE__ */ React35.createElement(FormControl, null, !fieldset && /* @__PURE__ */ React35.createElement(Label, __spreadProps(__spreadValues({}, rest), {
|
4559
4674
|
variant
|
4560
|
-
}), children), fieldset && /* @__PURE__ */
|
4675
|
+
}), children), fieldset && /* @__PURE__ */ React35.createElement("fieldset", {
|
4561
4676
|
id: rest.id
|
4562
|
-
}, /* @__PURE__ */
|
4677
|
+
}, /* @__PURE__ */ React35.createElement("legend", {
|
4563
4678
|
className: tw("w-full mb-2")
|
4564
|
-
}, /* @__PURE__ */
|
4679
|
+
}, /* @__PURE__ */ React35.createElement(LabelText, __spreadProps(__spreadValues({}, rest), {
|
4565
4680
|
variant
|
4566
|
-
}))), children), /* @__PURE__ */
|
4681
|
+
}))), children), /* @__PURE__ */ React35.createElement(HelperText, {
|
4567
4682
|
messageId,
|
4568
4683
|
error: !valid,
|
4569
4684
|
helperText,
|
@@ -4572,7 +4687,7 @@ var LabelControl = (_a) => {
|
|
4572
4687
|
reserveSpaceForError
|
4573
4688
|
}));
|
4574
4689
|
};
|
4575
|
-
var LabelControlSkeleton = ({ children }) => /* @__PURE__ */
|
4690
|
+
var LabelControlSkeleton = ({ children }) => /* @__PURE__ */ React35.createElement("div", null, /* @__PURE__ */ React35.createElement(Label.Skeleton, null), children, /* @__PURE__ */ React35.createElement(HelperText.Skeleton, null));
|
4576
4691
|
LabelControl.Skeleton = LabelControlSkeleton;
|
4577
4692
|
var getLabelControlProps = (_a) => {
|
4578
4693
|
var _b = _a, {
|
@@ -4608,7 +4723,7 @@ var getLabelControlProps = (_a) => {
|
|
4608
4723
|
|
4609
4724
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4610
4725
|
var isCheckbox = (c) => {
|
4611
|
-
return
|
4726
|
+
return React36.isValidElement(c) && c.type === Checkbox2;
|
4612
4727
|
};
|
4613
4728
|
var CheckboxGroup = (_a) => {
|
4614
4729
|
var _b = _a, {
|
@@ -4640,11 +4755,11 @@ var CheckboxGroup = (_a) => {
|
|
4640
4755
|
setSelectedItems(updated);
|
4641
4756
|
onChange == null ? void 0 : onChange(updated);
|
4642
4757
|
};
|
4643
|
-
return /* @__PURE__ */
|
4758
|
+
return /* @__PURE__ */ React36.createElement(LabelControl, __spreadValues(__spreadValues({
|
4644
4759
|
fieldset: true
|
4645
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
4760
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React36.createElement(InputGroup, {
|
4646
4761
|
cols
|
4647
|
-
},
|
4762
|
+
}, React36.Children.map(children, (c) => {
|
4648
4763
|
var _a3, _b2;
|
4649
4764
|
if (!isCheckbox(c)) {
|
4650
4765
|
return null;
|
@@ -4652,7 +4767,7 @@ var CheckboxGroup = (_a) => {
|
|
4652
4767
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
4653
4768
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
4654
4769
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
4655
|
-
return
|
4770
|
+
return React36.cloneElement(c, {
|
4656
4771
|
defaultChecked,
|
4657
4772
|
checked,
|
4658
4773
|
onChange: (_b2 = c.props.onChange) != null ? _b2 : handleChange,
|
@@ -4662,16 +4777,16 @@ var CheckboxGroup = (_a) => {
|
|
4662
4777
|
})));
|
4663
4778
|
};
|
4664
4779
|
var CheckboxGroupSkeleton = ({ options = 2 }) => {
|
4665
|
-
return /* @__PURE__ */
|
4780
|
+
return /* @__PURE__ */ React36.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React36.createElement("div", {
|
4666
4781
|
className: tw("flex flex-wrap flex-col gap-2")
|
4667
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
4782
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React36.createElement(Checkbox2.Skeleton, {
|
4668
4783
|
key
|
4669
4784
|
}))));
|
4670
4785
|
};
|
4671
4786
|
CheckboxGroup.Skeleton = CheckboxGroupSkeleton;
|
4672
4787
|
|
4673
4788
|
// src/components/ChoiceChip/ChoiceChip.tsx
|
4674
|
-
import
|
4789
|
+
import React37, { useState as useState4 } from "react";
|
4675
4790
|
var ChoiceChip = (_a) => {
|
4676
4791
|
var _b = _a, { text, dense, defaultValue, value, onChange } = _b, rest = __objRest(_b, ["text", "dense", "defaultValue", "value", "onChange"]);
|
4677
4792
|
var _a2;
|
@@ -4685,7 +4800,7 @@ var ChoiceChip = (_a) => {
|
|
4685
4800
|
setSelected(!selected);
|
4686
4801
|
onChange == null ? void 0 : onChange(!selected);
|
4687
4802
|
};
|
4688
|
-
return /* @__PURE__ */
|
4803
|
+
return /* @__PURE__ */ React37.createElement("span", __spreadProps(__spreadValues({
|
4689
4804
|
role: "button",
|
4690
4805
|
"aria-pressed": selected
|
4691
4806
|
}, rest), {
|
@@ -4700,29 +4815,29 @@ var ChoiceChip = (_a) => {
|
|
4700
4815
|
};
|
4701
4816
|
|
4702
4817
|
// src/components/Combobox/Combobox.tsx
|
4703
|
-
import
|
4818
|
+
import React40, { useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
|
4704
4819
|
import { useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
4705
4820
|
import { useCombobox } from "downshift";
|
4706
|
-
import
|
4821
|
+
import omit6 from "lodash/omit";
|
4707
4822
|
import uniqueId2 from "lodash/uniqueId";
|
4708
4823
|
import { matchSorter } from "match-sorter";
|
4709
4824
|
|
4710
4825
|
// src/components/Popover/PopoverWrapper.tsx
|
4711
|
-
import
|
4826
|
+
import React39 from "react";
|
4712
4827
|
import { FocusScope } from "@react-aria/focus";
|
4713
4828
|
import { DismissButton, OverlayContainer as OverlayContainer2, useModal, useOverlay } from "@react-aria/overlays";
|
4714
4829
|
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
4715
4830
|
|
4716
4831
|
// src/common/Popover/Popover.tsx
|
4717
|
-
import
|
4718
|
-
var PopoverPanel =
|
4832
|
+
import React38 from "react";
|
4833
|
+
var PopoverPanel = React38.forwardRef((_a, ref) => {
|
4719
4834
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
4720
|
-
return /* @__PURE__ */
|
4835
|
+
return /* @__PURE__ */ React38.createElement("div", __spreadValues({
|
4721
4836
|
ref,
|
4722
4837
|
className: classNames(
|
4723
4838
|
className,
|
4724
4839
|
tw(
|
4725
|
-
"rounded-sm shadow-16dp bg-white mt-1 focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20"
|
4840
|
+
"rounded-sm shadow-16dp bg-white mt-1 focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20 overflow-y-auto"
|
4726
4841
|
)
|
4727
4842
|
)
|
4728
4843
|
}, props), children);
|
@@ -4732,7 +4847,7 @@ var Popover = {
|
|
4732
4847
|
};
|
4733
4848
|
|
4734
4849
|
// src/components/Popover/PopoverWrapper.tsx
|
4735
|
-
var PopoverWrapper =
|
4850
|
+
var PopoverWrapper = React39.forwardRef((props, ref) => {
|
4736
4851
|
const _a = props, {
|
4737
4852
|
id,
|
4738
4853
|
children,
|
@@ -4745,7 +4860,8 @@ var PopoverWrapper = React37.forwardRef((props, ref) => {
|
|
4745
4860
|
isNonModal = true,
|
4746
4861
|
isDismissable,
|
4747
4862
|
autoFocus,
|
4748
|
-
containFocus
|
4863
|
+
containFocus,
|
4864
|
+
className
|
4749
4865
|
} = _a, otherProps = __objRest(_a, [
|
4750
4866
|
"id",
|
4751
4867
|
"children",
|
@@ -4758,7 +4874,8 @@ var PopoverWrapper = React37.forwardRef((props, ref) => {
|
|
4758
4874
|
"isNonModal",
|
4759
4875
|
"isDismissable",
|
4760
4876
|
"autoFocus",
|
4761
|
-
"containFocus"
|
4877
|
+
"containFocus",
|
4878
|
+
"className"
|
4762
4879
|
]);
|
4763
4880
|
const { overlayProps } = useOverlay(
|
4764
4881
|
__spreadProps(__spreadValues({}, props), { isDismissable: isDismissable && isOpen }),
|
@@ -4770,16 +4887,17 @@ var PopoverWrapper = React37.forwardRef((props, ref) => {
|
|
4770
4887
|
if (!props.isOpen) {
|
4771
4888
|
return null;
|
4772
4889
|
}
|
4773
|
-
return /* @__PURE__ */
|
4890
|
+
return /* @__PURE__ */ React39.createElement(OverlayContainer2, null, /* @__PURE__ */ React39.createElement(FocusScope, {
|
4774
4891
|
restoreFocus: true,
|
4775
4892
|
autoFocus,
|
4776
4893
|
contain: containFocus
|
4777
|
-
}, /* @__PURE__ */
|
4894
|
+
}, /* @__PURE__ */ React39.createElement(Popover.Panel, __spreadProps(__spreadValues({
|
4778
4895
|
ref,
|
4779
4896
|
role: "dialog"
|
4780
4897
|
}, mergeProps2(otherProps, modalProps, overlayProps)), {
|
4781
|
-
id: id != null ? id : overlayProps.id
|
4782
|
-
|
4898
|
+
id: id != null ? id : overlayProps.id,
|
4899
|
+
className
|
4900
|
+
}), children, /* @__PURE__ */ React39.createElement(DismissButton, {
|
4783
4901
|
onDismiss: props.onClose
|
4784
4902
|
}))));
|
4785
4903
|
});
|
@@ -4843,7 +4961,8 @@ var ComboboxBase = (_a) => {
|
|
4843
4961
|
inputValue,
|
4844
4962
|
getItemProps,
|
4845
4963
|
selectedItem,
|
4846
|
-
closeMenu
|
4964
|
+
closeMenu,
|
4965
|
+
openMenu
|
4847
4966
|
} = useCombobox({
|
4848
4967
|
id,
|
4849
4968
|
selectedItem: value,
|
@@ -4878,22 +4997,21 @@ var ComboboxBase = (_a) => {
|
|
4878
4997
|
const hasNoResults = options.length === 0 || inputItems.length === 0;
|
4879
4998
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
4880
4999
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
4881
|
-
return /* @__PURE__ */
|
5000
|
+
return /* @__PURE__ */ React40.createElement("div", {
|
4882
5001
|
className: tw("relative")
|
4883
|
-
}, /* @__PURE__ */
|
5002
|
+
}, /* @__PURE__ */ React40.createElement(Select.InputContainer, {
|
4884
5003
|
ref: targetRef,
|
4885
5004
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
4886
|
-
}, /* @__PURE__ */
|
5005
|
+
}, /* @__PURE__ */ React40.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
4887
5006
|
id,
|
4888
5007
|
name,
|
4889
5008
|
placeholder: readOnly ? void 0 : placeholder
|
4890
5009
|
}, inputProps), props), {
|
4891
5010
|
disabled,
|
4892
5011
|
readOnly,
|
4893
|
-
|
4894
|
-
|
5012
|
+
onClick: readOnly ? void 0 : openMenu,
|
5013
|
+
onFocus: () => {
|
4895
5014
|
setFocus(true);
|
4896
|
-
(_a3 = inputProps.onFocus) == null ? void 0 : _a3.call(inputProps, e);
|
4897
5015
|
},
|
4898
5016
|
onBlur: (e) => {
|
4899
5017
|
var _a3;
|
@@ -4906,25 +5024,26 @@ var ComboboxBase = (_a) => {
|
|
4906
5024
|
(_a3 = inputProps.onKeyDown) == null ? void 0 : _a3.call(inputProps, e);
|
4907
5025
|
},
|
4908
5026
|
onKeyUp: (e) => e.stopPropagation()
|
4909
|
-
})), !readOnly && /* @__PURE__ */
|
5027
|
+
})), !readOnly && /* @__PURE__ */ React40.createElement(Select.Toggle, __spreadValues({
|
4910
5028
|
hasFocus,
|
4911
5029
|
isOpen
|
4912
|
-
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */
|
5030
|
+
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */ React40.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
4913
5031
|
isOpen: true,
|
4914
5032
|
isDismissable: true,
|
4915
5033
|
autoFocus: true
|
4916
5034
|
}, getMenuProps({ ref: overlayRef })), {
|
4917
5035
|
style,
|
4918
|
-
onClose: closeMenu
|
4919
|
-
|
5036
|
+
onClose: closeMenu,
|
5037
|
+
className: tw("overflow-y-auto")
|
5038
|
+
}), /* @__PURE__ */ React40.createElement(Select.Menu, {
|
4920
5039
|
maxHeight
|
4921
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
5040
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React40.createElement(Select.NoResults, null, noResults), isOpen && inputItems.map((item, index) => /* @__PURE__ */ React40.createElement(Select.Item, __spreadValues({
|
4922
5041
|
key: itemToString(item),
|
4923
5042
|
selected: item === selectedItem,
|
4924
5043
|
highlighted: index === highlightedIndex
|
4925
5044
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
4926
5045
|
};
|
4927
|
-
var ComboboxSkeleton = () => /* @__PURE__ */
|
5046
|
+
var ComboboxSkeleton = () => /* @__PURE__ */ React40.createElement(Skeleton, {
|
4928
5047
|
height: 38
|
4929
5048
|
});
|
4930
5049
|
ComboboxBase.Skeleton = ComboboxSkeleton;
|
@@ -4941,12 +5060,12 @@ var Combobox = (_a) => {
|
|
4941
5060
|
const errorMessageId = uniqueId2();
|
4942
5061
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
4943
5062
|
const labelControlProps = getLabelControlProps(props);
|
4944
|
-
const baseProps =
|
4945
|
-
return /* @__PURE__ */
|
5063
|
+
const baseProps = omit6(props, Object.keys(labelControlProps));
|
5064
|
+
return /* @__PURE__ */ React40.createElement(LabelControl, __spreadValues({
|
4946
5065
|
id: `${id.current}-label`,
|
4947
5066
|
htmlFor: `${id.current}-input`,
|
4948
5067
|
messageId: errorMessageId
|
4949
|
-
}, labelControlProps), /* @__PURE__ */
|
5068
|
+
}, labelControlProps), /* @__PURE__ */ React40.createElement(ComboboxBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
4950
5069
|
id: id.current,
|
4951
5070
|
options,
|
4952
5071
|
noResults,
|
@@ -4954,11 +5073,11 @@ var Combobox = (_a) => {
|
|
4954
5073
|
valid: props.valid
|
4955
5074
|
})));
|
4956
5075
|
};
|
4957
|
-
Combobox.Skeleton = () => /* @__PURE__ */
|
5076
|
+
Combobox.Skeleton = () => /* @__PURE__ */ React40.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React40.createElement(ComboboxBase.Skeleton, null));
|
4958
5077
|
|
4959
5078
|
// src/components/Container/Container.tsx
|
4960
|
-
import
|
4961
|
-
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */
|
5079
|
+
import React41 from "react";
|
5080
|
+
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React41.createElement(Box, {
|
4962
5081
|
marginLeft: "auto",
|
4963
5082
|
marginRight: "auto",
|
4964
5083
|
width: "full",
|
@@ -4972,11 +5091,11 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React39.crea
|
|
4972
5091
|
}, children);
|
4973
5092
|
|
4974
5093
|
// src/components/DataList/DataList.tsx
|
4975
|
-
import
|
5094
|
+
import React47 from "react";
|
4976
5095
|
import orderBy2 from "lodash/orderBy";
|
4977
5096
|
|
4978
5097
|
// src/components/Template/Template.tsx
|
4979
|
-
import
|
5098
|
+
import React42 from "react";
|
4980
5099
|
var Template = ({
|
4981
5100
|
children,
|
4982
5101
|
columns,
|
@@ -5002,23 +5121,23 @@ var Template = ({
|
|
5002
5121
|
rowGap,
|
5003
5122
|
columnGap
|
5004
5123
|
});
|
5005
|
-
return /* @__PURE__ */
|
5124
|
+
return /* @__PURE__ */ React42.createElement("div", {
|
5006
5125
|
style: __spreadValues({}, styles)
|
5007
5126
|
}, children);
|
5008
5127
|
};
|
5009
5128
|
|
5010
5129
|
// src/common/DataList/DataList.tsx
|
5011
|
-
import
|
5130
|
+
import React45 from "react";
|
5012
5131
|
|
5013
5132
|
// src/common/Table/Table.tsx
|
5014
|
-
import
|
5133
|
+
import React44 from "react";
|
5015
5134
|
|
5016
5135
|
// src/common/RadioButton/RadioButton.tsx
|
5017
|
-
import
|
5018
|
-
var RadioButton =
|
5136
|
+
import React43 from "react";
|
5137
|
+
var RadioButton = React43.forwardRef(
|
5019
5138
|
(_a, ref) => {
|
5020
5139
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
5021
|
-
return /* @__PURE__ */
|
5140
|
+
return /* @__PURE__ */ React43.createElement("input", __spreadProps(__spreadValues({
|
5022
5141
|
id,
|
5023
5142
|
ref,
|
5024
5143
|
type: "radio",
|
@@ -5044,29 +5163,29 @@ var RadioButton = React41.forwardRef(
|
|
5044
5163
|
// src/common/Table/Table.tsx
|
5045
5164
|
var import_chevronDown3 = __toESM(require_chevronDown());
|
5046
5165
|
var import_chevronUp2 = __toESM(require_chevronUp());
|
5047
|
-
var HeadContext =
|
5166
|
+
var HeadContext = React44.createContext(null);
|
5048
5167
|
var tableClassNames = tw("w-full relative typography-default border-spacing-0");
|
5049
5168
|
var Table = (_a) => {
|
5050
5169
|
var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
|
5051
|
-
return /* @__PURE__ */
|
5170
|
+
return /* @__PURE__ */ React44.createElement("table", __spreadProps(__spreadValues({}, rest), {
|
5052
5171
|
className: classNames(tableClassNames, className),
|
5053
5172
|
"aria-label": ariaLabel
|
5054
5173
|
}), children);
|
5055
5174
|
};
|
5056
5175
|
var TableHead = (_a) => {
|
5057
5176
|
var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
|
5058
|
-
return /* @__PURE__ */
|
5177
|
+
return /* @__PURE__ */ React44.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React44.createElement("tr", null, /* @__PURE__ */ React44.createElement(HeadContext.Provider, {
|
5059
5178
|
value: { children, sticky }
|
5060
5179
|
}, children)));
|
5061
5180
|
};
|
5062
5181
|
var TableBody = (_a) => {
|
5063
5182
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5064
|
-
return /* @__PURE__ */
|
5183
|
+
return /* @__PURE__ */ React44.createElement("tbody", __spreadValues({}, rest), children);
|
5065
5184
|
};
|
5066
5185
|
var rowClassNames = tw("children:border-grey-10 children:last:border-b-0 hover:bg-grey-0");
|
5067
5186
|
var TableRow = (_a) => {
|
5068
5187
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5069
|
-
return /* @__PURE__ */
|
5188
|
+
return /* @__PURE__ */ React44.createElement("tr", __spreadProps(__spreadValues({}, rest), {
|
5070
5189
|
className: classNames(rowClassNames, className)
|
5071
5190
|
}), children);
|
5072
5191
|
};
|
@@ -5082,25 +5201,25 @@ var getHeadCellClassNames = (sticky = true) => {
|
|
5082
5201
|
};
|
5083
5202
|
var TableCell = (_a) => {
|
5084
5203
|
var _b = _a, { children, className, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "align"]);
|
5085
|
-
const headContext =
|
5086
|
-
return headContext ? /* @__PURE__ */
|
5204
|
+
const headContext = React44.useContext(HeadContext);
|
5205
|
+
return headContext ? /* @__PURE__ */ React44.createElement("th", __spreadProps(__spreadValues({}, rest), {
|
5087
5206
|
className: classNames(
|
5088
5207
|
cellClassNames,
|
5089
5208
|
getHeadCellClassNames(headContext.sticky),
|
5090
5209
|
getAlignClassNames(align),
|
5091
5210
|
className
|
5092
5211
|
)
|
5093
|
-
}), children) : /* @__PURE__ */
|
5212
|
+
}), children) : /* @__PURE__ */ React44.createElement("td", __spreadProps(__spreadValues({}, rest), {
|
5094
5213
|
className: classNames(cellClassNames, getBodyCellClassNames(), getAlignClassNames(align), className)
|
5095
5214
|
}), children);
|
5096
5215
|
};
|
5097
5216
|
var TableSelectCell = (_a) => {
|
5098
5217
|
var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
|
5099
|
-
return /* @__PURE__ */
|
5218
|
+
return /* @__PURE__ */ React44.createElement(Table.Cell, {
|
5100
5219
|
className: tw("leading-[0px]")
|
5101
|
-
}, props.type === "radio" ? /* @__PURE__ */
|
5220
|
+
}, props.type === "radio" ? /* @__PURE__ */ React44.createElement(RadioButton, __spreadValues({
|
5102
5221
|
"aria-label": ariaLabel
|
5103
|
-
}, props)) : /* @__PURE__ */
|
5222
|
+
}, props)) : /* @__PURE__ */ React44.createElement(Checkbox, __spreadValues({
|
5104
5223
|
"aria-label": ariaLabel
|
5105
5224
|
}, props)));
|
5106
5225
|
};
|
@@ -5110,39 +5229,39 @@ var getSortCellIconClassNames = (active) => {
|
|
5110
5229
|
};
|
5111
5230
|
var TableSortCell = (_a) => {
|
5112
5231
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5113
|
-
return /* @__PURE__ */
|
5232
|
+
return /* @__PURE__ */ React44.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
|
5114
5233
|
"aria-sort": direction
|
5115
|
-
}), /* @__PURE__ */
|
5234
|
+
}), /* @__PURE__ */ React44.createElement("span", {
|
5116
5235
|
className: getSortCellButtonClassNames(rest.align),
|
5117
5236
|
role: "button",
|
5118
5237
|
tabIndex: -1,
|
5119
5238
|
onClick
|
5120
|
-
}, children, /* @__PURE__ */
|
5239
|
+
}, children, /* @__PURE__ */ React44.createElement("div", {
|
5121
5240
|
"data-sort-icons": true,
|
5122
5241
|
className: tw("flex flex-col", {
|
5123
5242
|
"invisible group-hover:visible": direction === "none"
|
5124
5243
|
})
|
5125
|
-
}, /* @__PURE__ */
|
5244
|
+
}, /* @__PURE__ */ React44.createElement(InlineIcon, {
|
5126
5245
|
icon: import_chevronUp2.default,
|
5127
5246
|
className: getSortCellIconClassNames(direction === "descending")
|
5128
|
-
}), /* @__PURE__ */
|
5247
|
+
}), /* @__PURE__ */ React44.createElement(InlineIcon, {
|
5129
5248
|
icon: import_chevronDown3.default,
|
5130
5249
|
className: getSortCellIconClassNames(direction === "ascending")
|
5131
5250
|
}))));
|
5132
5251
|
};
|
5133
|
-
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */
|
5252
|
+
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React44.createElement("div", {
|
5134
5253
|
className: tw("flex gap-4 items-center")
|
5135
|
-
}, image && /* @__PURE__ */
|
5254
|
+
}, image && /* @__PURE__ */ React44.createElement("img", {
|
5136
5255
|
src: image,
|
5137
5256
|
alt: imageAlt,
|
5138
5257
|
style: { width: imageSize, height: imageSize }
|
5139
|
-
}), /* @__PURE__ */
|
5140
|
-
Table.Head =
|
5141
|
-
Table.Body =
|
5142
|
-
Table.Row =
|
5143
|
-
Table.Cell =
|
5144
|
-
Table.SortCell =
|
5145
|
-
Table.SelectCell =
|
5258
|
+
}), /* @__PURE__ */ React44.createElement("div", null, title, caption && /* @__PURE__ */ React44.createElement(Typography2.Caption, null, caption)));
|
5259
|
+
Table.Head = React44.memo(TableHead);
|
5260
|
+
Table.Body = React44.memo(TableBody);
|
5261
|
+
Table.Row = React44.memo(TableRow);
|
5262
|
+
Table.Cell = React44.memo(TableCell);
|
5263
|
+
Table.SortCell = React44.memo(TableSortCell);
|
5264
|
+
Table.SelectCell = React44.memo(TableSelectCell);
|
5146
5265
|
|
5147
5266
|
// src/common/DataList/DataList.tsx
|
5148
5267
|
var import_chevronDown4 = __toESM(require_chevronDown());
|
@@ -5154,7 +5273,7 @@ var getAlignClassNames2 = (align) => tw("flex items-center", {
|
|
5154
5273
|
});
|
5155
5274
|
var DataList = (_a) => {
|
5156
5275
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5157
|
-
return /* @__PURE__ */
|
5276
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadValues({}, rest));
|
5158
5277
|
};
|
5159
5278
|
var HeadCell = (_a) => {
|
5160
5279
|
var _b = _a, {
|
@@ -5166,14 +5285,14 @@ var HeadCell = (_a) => {
|
|
5166
5285
|
"sticky",
|
5167
5286
|
"align"
|
5168
5287
|
]);
|
5169
|
-
return /* @__PURE__ */
|
5288
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5170
5289
|
role: "cell",
|
5171
5290
|
className: classNames(cellClassNames, getHeadCellClassNames(sticky), getAlignClassNames2(align), className)
|
5172
5291
|
}));
|
5173
5292
|
};
|
5174
5293
|
var Cell = (_a) => {
|
5175
5294
|
var _b = _a, { className, align } = _b, rest = __objRest(_b, ["className", "align"]);
|
5176
|
-
return /* @__PURE__ */
|
5295
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5177
5296
|
role: "cell",
|
5178
5297
|
className: classNames(
|
5179
5298
|
cellClassNames,
|
@@ -5186,30 +5305,31 @@ var Cell = (_a) => {
|
|
5186
5305
|
};
|
5187
5306
|
var Row = (_a) => {
|
5188
5307
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5189
|
-
return /* @__PURE__ */
|
5308
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5190
5309
|
className: classNames(tw("contents group"), className),
|
5191
5310
|
role: "row"
|
5192
5311
|
}));
|
5193
5312
|
};
|
5194
5313
|
var SortCell = (_a) => {
|
5195
|
-
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5196
|
-
return /* @__PURE__ */
|
5314
|
+
var _b = _a, { children, direction = "none", onClick, sticky } = _b, rest = __objRest(_b, ["children", "direction", "onClick", "sticky"]);
|
5315
|
+
return /* @__PURE__ */ React45.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
|
5197
5316
|
"aria-sort": direction,
|
5198
|
-
role: "cell"
|
5199
|
-
|
5317
|
+
role: "cell",
|
5318
|
+
sticky
|
5319
|
+
}), /* @__PURE__ */ React45.createElement("span", {
|
5200
5320
|
className: getSortCellButtonClassNames(rest.align),
|
5201
5321
|
role: "button",
|
5202
5322
|
tabIndex: -1,
|
5203
5323
|
onClick
|
5204
|
-
}, children, /* @__PURE__ */
|
5324
|
+
}, children, /* @__PURE__ */ React45.createElement("div", {
|
5205
5325
|
"data-sort-icons": true,
|
5206
5326
|
className: tw("flex flex-col", {
|
5207
5327
|
"invisible group-hover:visible": direction === "none"
|
5208
5328
|
})
|
5209
|
-
}, /* @__PURE__ */
|
5329
|
+
}, /* @__PURE__ */ React45.createElement(InlineIcon, {
|
5210
5330
|
icon: import_chevronUp3.default,
|
5211
5331
|
className: getSortCellIconClassNames(direction === "descending")
|
5212
|
-
}), /* @__PURE__ */
|
5332
|
+
}), /* @__PURE__ */ React45.createElement(InlineIcon, {
|
5213
5333
|
icon: import_chevronDown4.default,
|
5214
5334
|
className: getSortCellIconClassNames(direction === "ascending")
|
5215
5335
|
}))));
|
@@ -5235,9 +5355,9 @@ var cellProps = (column) => ({
|
|
5235
5355
|
});
|
5236
5356
|
|
5237
5357
|
// src/utils/table/useTableSort.tsx
|
5238
|
-
import
|
5358
|
+
import React46 from "react";
|
5239
5359
|
var useTableSort = () => {
|
5240
|
-
const [sort, setSort] =
|
5360
|
+
const [sort, setSort] = React46.useState();
|
5241
5361
|
const handleSortClick = (field) => {
|
5242
5362
|
if ((sort == null ? void 0 : sort.key) === field) {
|
5243
5363
|
if (sort.direction === "ascending") {
|
@@ -5253,47 +5373,50 @@ var useTableSort = () => {
|
|
5253
5373
|
};
|
5254
5374
|
|
5255
5375
|
// src/components/DataList/DataList.tsx
|
5256
|
-
var DataList2 = ({ columns, rows }) => {
|
5376
|
+
var DataList2 = ({ columns, rows, sticky }) => {
|
5257
5377
|
const [sort, updateSort] = useTableSort();
|
5258
5378
|
const sortedRows = orderBy2(rows, [sort == null ? void 0 : sort.key], [toSortDirection(sort == null ? void 0 : sort.direction)]);
|
5259
5379
|
const templateColumns = columns.map((column) => {
|
5260
5380
|
var _a;
|
5261
5381
|
return (_a = column.width) != null ? _a : "auto";
|
5262
5382
|
});
|
5263
|
-
return /* @__PURE__ */
|
5383
|
+
return /* @__PURE__ */ React47.createElement(Template, {
|
5264
5384
|
columns: templateColumns
|
5265
5385
|
}, columns.map(
|
5266
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5386
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React47.createElement(DataList.SortCell, __spreadValues({
|
5267
5387
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5268
|
-
onClick: () => updateSort(column.field)
|
5269
|
-
|
5270
|
-
|
5388
|
+
onClick: () => updateSort(column.field),
|
5389
|
+
sticky
|
5390
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React47.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5391
|
+
sticky
|
5392
|
+
}), column.headerName)
|
5393
|
+
), /* @__PURE__ */ React47.createElement(List, {
|
5271
5394
|
items: sortedRows,
|
5272
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5395
|
+
renderItem: (row, index) => /* @__PURE__ */ React47.createElement(DataList.Row, {
|
5273
5396
|
key: row.id
|
5274
|
-
}, /* @__PURE__ */
|
5397
|
+
}, /* @__PURE__ */ React47.createElement(List, {
|
5275
5398
|
items: columns,
|
5276
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5399
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React47.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React47.createElement(StatusChip, __spreadValues({
|
5277
5400
|
dense: true
|
5278
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5401
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React47.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React47.createElement(SecondaryButton, __spreadValues({
|
5279
5402
|
dense: true
|
5280
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5403
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React47.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React47.createElement(DataList.Cell, null, /* @__PURE__ */ React47.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React47.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
5281
5404
|
}))
|
5282
5405
|
}));
|
5283
5406
|
};
|
5284
5407
|
|
5285
5408
|
// src/components/DataTable/DataTable.tsx
|
5286
|
-
import
|
5409
|
+
import React50 from "react";
|
5287
5410
|
import orderBy3 from "lodash/orderBy";
|
5288
5411
|
|
5289
5412
|
// src/components/Table/Table.tsx
|
5290
|
-
import
|
5413
|
+
import React49 from "react";
|
5291
5414
|
|
5292
5415
|
// src/utils/table/useScrollTarget.ts
|
5293
|
-
import
|
5416
|
+
import React48 from "react";
|
5294
5417
|
var useScrollTarget = (callback) => {
|
5295
|
-
const targetRef =
|
5296
|
-
|
5418
|
+
const targetRef = React48.useRef(null);
|
5419
|
+
React48.useLayoutEffect(() => {
|
5297
5420
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
5298
5421
|
root: null,
|
5299
5422
|
rootMargin: `0px 0px 200px 0px`
|
@@ -5311,12 +5434,12 @@ var Table2 = (_a) => {
|
|
5311
5434
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
5312
5435
|
const bottomRef = useScrollTarget(onNext);
|
5313
5436
|
const topRef = useScrollTarget(onPrev);
|
5314
|
-
return /* @__PURE__ */
|
5437
|
+
return /* @__PURE__ */ React49.createElement("div", {
|
5315
5438
|
className: "relative w-full"
|
5316
|
-
}, /* @__PURE__ */
|
5439
|
+
}, /* @__PURE__ */ React49.createElement("div", {
|
5317
5440
|
ref: topRef,
|
5318
5441
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
5319
|
-
}), /* @__PURE__ */
|
5442
|
+
}), /* @__PURE__ */ React49.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React49.createElement("div", {
|
5320
5443
|
ref: bottomRef,
|
5321
5444
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
5322
5445
|
}));
|
@@ -5334,52 +5457,56 @@ var DataTable = (_a) => {
|
|
5334
5457
|
columns,
|
5335
5458
|
rows,
|
5336
5459
|
noWrap = false,
|
5337
|
-
layout = "auto"
|
5460
|
+
layout = "auto",
|
5461
|
+
sticky
|
5338
5462
|
} = _b, rest = __objRest(_b, [
|
5339
5463
|
"columns",
|
5340
5464
|
"rows",
|
5341
5465
|
"noWrap",
|
5342
|
-
"layout"
|
5466
|
+
"layout",
|
5467
|
+
"sticky"
|
5343
5468
|
]);
|
5344
5469
|
const [sort, updateSort] = useTableSort();
|
5345
5470
|
const sortedRows = orderBy3(rows, [sort == null ? void 0 : sort.key], [toSortDirection(sort == null ? void 0 : sort.direction)]);
|
5346
|
-
return /* @__PURE__ */
|
5471
|
+
return /* @__PURE__ */ React50.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
5347
5472
|
className: tw({
|
5348
5473
|
"whitespace-nowrap": noWrap,
|
5349
5474
|
"table-auto": layout === "auto",
|
5350
5475
|
"table-fixed": layout === "fixed"
|
5351
5476
|
})
|
5352
|
-
}), /* @__PURE__ */
|
5353
|
-
|
5477
|
+
}), /* @__PURE__ */ React50.createElement(Table2.Head, {
|
5478
|
+
sticky
|
5479
|
+
}, columns.map(
|
5480
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React50.createElement(Table2.SortCell, __spreadValues({
|
5354
5481
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5355
5482
|
onClick: () => updateSort(column.field),
|
5356
5483
|
style: { width: column.width }
|
5357
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
5484
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5358
5485
|
style: { width: column.width }
|
5359
5486
|
}), column.headerName)
|
5360
|
-
)), /* @__PURE__ */
|
5487
|
+
)), /* @__PURE__ */ React50.createElement(Table2.Body, null, /* @__PURE__ */ React50.createElement(List, {
|
5361
5488
|
items: sortedRows,
|
5362
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5489
|
+
renderItem: (row, index) => /* @__PURE__ */ React50.createElement(Table2.Row, {
|
5363
5490
|
key: row.id
|
5364
|
-
}, /* @__PURE__ */
|
5491
|
+
}, /* @__PURE__ */ React50.createElement(List, {
|
5365
5492
|
items: columns,
|
5366
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5493
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React50.createElement(StatusChip, __spreadValues({
|
5367
5494
|
dense: true
|
5368
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5495
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React50.createElement(SecondaryButton, __spreadValues({
|
5369
5496
|
dense: true
|
5370
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5497
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React50.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
5371
5498
|
}))
|
5372
5499
|
})));
|
5373
5500
|
};
|
5374
5501
|
|
5375
5502
|
// src/components/Dialog/Dialog.tsx
|
5376
|
-
import
|
5503
|
+
import React52 from "react";
|
5377
5504
|
import { useDialog } from "@react-aria/dialog";
|
5378
5505
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
5379
5506
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
5380
5507
|
import { useId } from "@react-aria/utils";
|
5381
5508
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
5382
|
-
import
|
5509
|
+
import omit7 from "lodash/omit";
|
5383
5510
|
|
5384
5511
|
// src/common/Dialog/Dialog.tsx
|
5385
5512
|
var import_confirm2 = __toESM(require_confirm());
|
@@ -5401,10 +5528,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
5401
5528
|
};
|
5402
5529
|
|
5403
5530
|
// src/common/Modal/Modal.tsx
|
5404
|
-
import
|
5531
|
+
import React51 from "react";
|
5405
5532
|
var Modal = (_a) => {
|
5406
5533
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
5407
|
-
return open ? /* @__PURE__ */
|
5534
|
+
return open ? /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5408
5535
|
className: classNames(
|
5409
5536
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
5410
5537
|
className
|
@@ -5413,14 +5540,14 @@ var Modal = (_a) => {
|
|
5413
5540
|
};
|
5414
5541
|
Modal.BackDrop = (_a) => {
|
5415
5542
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5416
|
-
return /* @__PURE__ */
|
5543
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5417
5544
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
5418
5545
|
}));
|
5419
5546
|
};
|
5420
|
-
Modal.Dialog =
|
5547
|
+
Modal.Dialog = React51.forwardRef(
|
5421
5548
|
(_a, ref) => {
|
5422
5549
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
5423
|
-
return /* @__PURE__ */
|
5550
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({
|
5424
5551
|
ref,
|
5425
5552
|
"aria-modal": "true"
|
5426
5553
|
}, rest), {
|
@@ -5438,31 +5565,31 @@ Modal.Dialog = React49.forwardRef(
|
|
5438
5565
|
);
|
5439
5566
|
Modal.Header = (_a) => {
|
5440
5567
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5441
|
-
return /* @__PURE__ */
|
5568
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5442
5569
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
5443
5570
|
}), children);
|
5444
5571
|
};
|
5445
5572
|
Modal.HeaderImage = (_a) => {
|
5446
5573
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
5447
5574
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
5448
|
-
return backgroundImage ? /* @__PURE__ */
|
5575
|
+
return backgroundImage ? /* @__PURE__ */ React51.createElement("img", __spreadProps(__spreadValues({
|
5449
5576
|
"aria-hidden": true,
|
5450
5577
|
src: backgroundImage != null ? backgroundImage : void 0
|
5451
5578
|
}, rest), {
|
5452
5579
|
className: classNames(common, tw("object-cover"), className)
|
5453
|
-
})) : /* @__PURE__ */
|
5580
|
+
})) : /* @__PURE__ */ React51.createElement("div", {
|
5454
5581
|
className: classNames(common, tw("bg-grey-5"), className)
|
5455
5582
|
});
|
5456
5583
|
};
|
5457
5584
|
Modal.CloseButtonContainer = (_a) => {
|
5458
5585
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5459
|
-
return /* @__PURE__ */
|
5586
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5460
5587
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
5461
5588
|
}));
|
5462
5589
|
};
|
5463
5590
|
Modal.Title = (_a) => {
|
5464
5591
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5465
|
-
return /* @__PURE__ */
|
5592
|
+
return /* @__PURE__ */ React51.createElement(Typography, __spreadValues({
|
5466
5593
|
htmlTag: "h2",
|
5467
5594
|
variant: "subheading",
|
5468
5595
|
color: "grey-90",
|
@@ -5471,33 +5598,33 @@ Modal.Title = (_a) => {
|
|
5471
5598
|
};
|
5472
5599
|
Modal.Subtitle = (_a) => {
|
5473
5600
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5474
|
-
return /* @__PURE__ */
|
5601
|
+
return /* @__PURE__ */ React51.createElement(Typography, __spreadValues({
|
5475
5602
|
variant: "small",
|
5476
5603
|
color: "grey-60"
|
5477
5604
|
}, rest), children);
|
5478
5605
|
};
|
5479
5606
|
Modal.TitleContainer = (_a) => {
|
5480
5607
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5481
|
-
return /* @__PURE__ */
|
5608
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5482
5609
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
5483
5610
|
}), children);
|
5484
5611
|
};
|
5485
5612
|
Modal.Body = (_a) => {
|
5486
5613
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
5487
|
-
return /* @__PURE__ */
|
5614
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5488
5615
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
5489
5616
|
style: __spreadValues({ maxHeight }, style)
|
5490
5617
|
}), children);
|
5491
5618
|
};
|
5492
5619
|
Modal.Footer = (_a) => {
|
5493
5620
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5494
|
-
return /* @__PURE__ */
|
5621
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5495
5622
|
className: classNames(tw("px-7 py-6"), className)
|
5496
5623
|
}), children);
|
5497
5624
|
};
|
5498
5625
|
Modal.Actions = (_a) => {
|
5499
5626
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5500
|
-
return /* @__PURE__ */
|
5627
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5501
5628
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
5502
5629
|
}), children);
|
5503
5630
|
};
|
@@ -5511,7 +5638,7 @@ var Dialog = ({
|
|
5511
5638
|
primaryAction,
|
5512
5639
|
secondaryAction
|
5513
5640
|
}) => {
|
5514
|
-
const ref =
|
5641
|
+
const ref = React52.useRef(null);
|
5515
5642
|
const state = useOverlayTriggerState2({ isOpen: open });
|
5516
5643
|
const { modalProps, underlayProps } = useModalOverlay({ isDismissable: false }, state, ref);
|
5517
5644
|
const labelledBy = useId();
|
@@ -5523,34 +5650,34 @@ var Dialog = ({
|
|
5523
5650
|
if (!open) {
|
5524
5651
|
return null;
|
5525
5652
|
}
|
5526
|
-
return /* @__PURE__ */
|
5653
|
+
return /* @__PURE__ */ React52.createElement(Overlay, null, /* @__PURE__ */ React52.createElement(Modal, {
|
5527
5654
|
open
|
5528
|
-
}, /* @__PURE__ */
|
5655
|
+
}, /* @__PURE__ */ React52.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React52.createElement(FocusScope2, {
|
5529
5656
|
contain: true,
|
5530
5657
|
restoreFocus: true,
|
5531
5658
|
autoFocus: true
|
5532
|
-
}, /* @__PURE__ */
|
5659
|
+
}, /* @__PURE__ */ React52.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
5533
5660
|
ref,
|
5534
5661
|
size: "sm"
|
5535
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
5662
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React52.createElement(Modal.Header, null, /* @__PURE__ */ React52.createElement(Icon, {
|
5536
5663
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
5537
5664
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
5538
5665
|
fontSize: 20
|
5539
|
-
}), /* @__PURE__ */
|
5666
|
+
}), /* @__PURE__ */ React52.createElement(Modal.Title, {
|
5540
5667
|
id: labelledBy,
|
5541
5668
|
variant: "large-strong",
|
5542
5669
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
5543
|
-
}, title)), /* @__PURE__ */
|
5670
|
+
}, title)), /* @__PURE__ */ React52.createElement(Modal.Body, {
|
5544
5671
|
id: describedBy
|
5545
|
-
}, children), /* @__PURE__ */
|
5672
|
+
}, children), /* @__PURE__ */ React52.createElement(Modal.Footer, null, /* @__PURE__ */ React52.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React52.createElement(GhostButton, __spreadValues({
|
5546
5673
|
key: secondaryAction.text
|
5547
|
-
},
|
5674
|
+
}, omit7(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React52.createElement(SecondaryButton, __spreadValues({
|
5548
5675
|
key: primaryAction.text
|
5549
|
-
},
|
5676
|
+
}, omit7(primaryAction, "text")), primaryAction.text)))))));
|
5550
5677
|
};
|
5551
5678
|
|
5552
5679
|
// src/components/Divider/Divider.tsx
|
5553
|
-
import
|
5680
|
+
import React53 from "react";
|
5554
5681
|
var sizeClasses = {
|
5555
5682
|
horizontal: {
|
5556
5683
|
1: "h-1px",
|
@@ -5572,7 +5699,7 @@ var sizeClasses = {
|
|
5572
5699
|
var Divider2 = (_a) => {
|
5573
5700
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
5574
5701
|
const sizeClass = sizeClasses[direction][size];
|
5575
|
-
return /* @__PURE__ */
|
5702
|
+
return /* @__PURE__ */ React53.createElement("div", __spreadProps(__spreadValues({}, props), {
|
5576
5703
|
className: tw(`bg-grey-5 ${sizeClass}`, {
|
5577
5704
|
"block w-full": direction === "horizontal",
|
5578
5705
|
"inline-block h-full": direction === "vertical"
|
@@ -5581,10 +5708,10 @@ var Divider2 = (_a) => {
|
|
5581
5708
|
};
|
5582
5709
|
|
5583
5710
|
// src/components/Dropdown/Dropdown.tsx
|
5584
|
-
import
|
5711
|
+
import React55 from "react";
|
5585
5712
|
|
5586
5713
|
// src/components/Popover/Popover.tsx
|
5587
|
-
import
|
5714
|
+
import React54, { useRef as useRef4 } from "react";
|
5588
5715
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
5589
5716
|
import { useOverlayPosition as useOverlayPosition3, useOverlayTrigger } from "@react-aria/overlays";
|
5590
5717
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -5633,22 +5760,22 @@ var Popover2 = (props) => {
|
|
5633
5760
|
state,
|
5634
5761
|
triggerRef
|
5635
5762
|
);
|
5636
|
-
return /* @__PURE__ */
|
5763
|
+
return /* @__PURE__ */ React54.createElement(PopoverContext.Provider, {
|
5637
5764
|
value: {
|
5638
5765
|
state
|
5639
5766
|
}
|
5640
|
-
},
|
5767
|
+
}, React54.Children.map(props.children, (child) => {
|
5641
5768
|
if (isComponentType(child, Popover2.Trigger)) {
|
5642
|
-
return /* @__PURE__ */
|
5769
|
+
return /* @__PURE__ */ React54.createElement(PressResponder, __spreadValues({
|
5643
5770
|
ref: triggerRef,
|
5644
5771
|
onPress: state.toggle
|
5645
|
-
}, triggerProps), /* @__PURE__ */
|
5772
|
+
}, triggerProps), /* @__PURE__ */ React54.createElement(PopoverTriggerWrapper, {
|
5646
5773
|
"data-testid": props["data-testid"],
|
5647
5774
|
"aria-controls": id
|
5648
5775
|
}, child.props.children));
|
5649
5776
|
}
|
5650
5777
|
if (isComponentType(child, Popover2.Panel)) {
|
5651
|
-
return /* @__PURE__ */
|
5778
|
+
return /* @__PURE__ */ React54.createElement(PopoverWrapper, __spreadProps(__spreadValues(__spreadValues({
|
5652
5779
|
ref: overlayRef,
|
5653
5780
|
isOpen: state.isOpen,
|
5654
5781
|
onClose: state.close,
|
@@ -5659,7 +5786,8 @@ var Popover2 = (props) => {
|
|
5659
5786
|
autoFocus,
|
5660
5787
|
containFocus
|
5661
5788
|
}, popoverProps), otherOverlayProps), {
|
5662
|
-
id
|
5789
|
+
id,
|
5790
|
+
className: child.props.className
|
5663
5791
|
}), child.props.children);
|
5664
5792
|
}
|
5665
5793
|
throw new Error("Invalid children element type");
|
@@ -5679,7 +5807,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
5679
5807
|
state.close();
|
5680
5808
|
onClick == null ? void 0 : onClick(e);
|
5681
5809
|
};
|
5682
|
-
return /* @__PURE__ */
|
5810
|
+
return /* @__PURE__ */ React54.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
5683
5811
|
onClick: handleClick
|
5684
5812
|
}));
|
5685
5813
|
};
|
@@ -5692,9 +5820,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5692
5820
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5693
5821
|
var _a2;
|
5694
5822
|
const ref = useRef4(null);
|
5695
|
-
const trigger =
|
5823
|
+
const trigger = React54.Children.only(children);
|
5696
5824
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
|
5697
|
-
return
|
5825
|
+
return React54.cloneElement(trigger, __spreadProps(__spreadValues({
|
5698
5826
|
"ref": ref
|
5699
5827
|
}, mergeProps3(pressProps, trigger.props)), {
|
5700
5828
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -5703,11 +5831,11 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5703
5831
|
|
5704
5832
|
// src/components/Dropdown/Dropdown.tsx
|
5705
5833
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
5706
|
-
return /* @__PURE__ */
|
5834
|
+
return /* @__PURE__ */ React55.createElement(Popover2, {
|
5707
5835
|
type: "menu",
|
5708
5836
|
placement,
|
5709
5837
|
autoFocus: true
|
5710
|
-
}, /* @__PURE__ */
|
5838
|
+
}, /* @__PURE__ */ React55.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React55.createElement(Popover2.Panel, null, content));
|
5711
5839
|
};
|
5712
5840
|
var DropdownMenu = ({
|
5713
5841
|
title,
|
@@ -5716,26 +5844,26 @@ var DropdownMenu = ({
|
|
5716
5844
|
triggerId,
|
5717
5845
|
setClose = () => void 0
|
5718
5846
|
}) => {
|
5719
|
-
const menuRef =
|
5720
|
-
|
5847
|
+
const menuRef = React55.useRef(null);
|
5848
|
+
React55.useEffect(() => {
|
5721
5849
|
const id = setTimeout(() => {
|
5722
5850
|
var _a, _b, _c;
|
5723
5851
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
5724
5852
|
});
|
5725
5853
|
return () => clearTimeout(id);
|
5726
5854
|
}, [menuRef.current]);
|
5727
|
-
return /* @__PURE__ */
|
5855
|
+
return /* @__PURE__ */ React55.createElement("div", {
|
5728
5856
|
style: { minWidth: "250px" },
|
5729
5857
|
className: tw("py-3 bg-white")
|
5730
|
-
}, !!title && /* @__PURE__ */
|
5858
|
+
}, !!title && /* @__PURE__ */ React55.createElement("div", {
|
5731
5859
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
5732
|
-
}, title), /* @__PURE__ */
|
5860
|
+
}, title), /* @__PURE__ */ React55.createElement("ol", {
|
5733
5861
|
role: "menu",
|
5734
5862
|
ref: menuRef,
|
5735
5863
|
id: contentId,
|
5736
5864
|
"aria-labelledby": triggerId
|
5737
|
-
},
|
5738
|
-
return
|
5865
|
+
}, React55.Children.map(children, (child) => {
|
5866
|
+
return React55.cloneElement(child, { setClose });
|
5739
5867
|
})));
|
5740
5868
|
};
|
5741
5869
|
var DropdownItem = (_a) => {
|
@@ -5790,10 +5918,10 @@ var DropdownItem = (_a) => {
|
|
5790
5918
|
handleSelect();
|
5791
5919
|
}
|
5792
5920
|
};
|
5793
|
-
const itemContent = /* @__PURE__ */
|
5921
|
+
const itemContent = /* @__PURE__ */ React55.createElement("div", {
|
5794
5922
|
className: tw("py-3 px-4")
|
5795
5923
|
}, children);
|
5796
|
-
return /* @__PURE__ */
|
5924
|
+
return /* @__PURE__ */ React55.createElement("li", __spreadProps(__spreadValues({
|
5797
5925
|
role: "menuitem",
|
5798
5926
|
tabIndex: -1,
|
5799
5927
|
onClick: handleClick,
|
@@ -5804,7 +5932,7 @@ var DropdownItem = (_a) => {
|
|
5804
5932
|
"text-grey-10 cursor-not-allowed": disabled,
|
5805
5933
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
5806
5934
|
})
|
5807
|
-
}), tooltip ? /* @__PURE__ */
|
5935
|
+
}), tooltip ? /* @__PURE__ */ React55.createElement(Tooltip, {
|
5808
5936
|
content: tooltip,
|
5809
5937
|
placement: tooltipPlacement,
|
5810
5938
|
inline: false
|
@@ -5814,7 +5942,7 @@ Dropdown.Menu = DropdownMenu;
|
|
5814
5942
|
Dropdown.Item = DropdownItem;
|
5815
5943
|
|
5816
5944
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
5817
|
-
import
|
5945
|
+
import React59 from "react";
|
5818
5946
|
import { useFilter } from "@react-aria/i18n";
|
5819
5947
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
5820
5948
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
@@ -5826,8 +5954,8 @@ import { useMenuTriggerState } from "@react-stately/menu";
|
|
5826
5954
|
import { useTreeState } from "@react-stately/tree";
|
5827
5955
|
|
5828
5956
|
// src/components/Input/Input.tsx
|
5829
|
-
import
|
5830
|
-
import
|
5957
|
+
import React57, { forwardRef, useImperativeHandle, useRef as useRef5, useState as useState6 } from "react";
|
5958
|
+
import omit8 from "lodash/omit";
|
5831
5959
|
import toString from "lodash/toString";
|
5832
5960
|
import uniqueId3 from "lodash/uniqueId";
|
5833
5961
|
|
@@ -5843,31 +5971,31 @@ var getCommonInputStyles = ({ readOnly, valid }) => tw(
|
|
5843
5971
|
);
|
5844
5972
|
|
5845
5973
|
// src/utils/form/InputAdornment/InputAdornment.tsx
|
5846
|
-
import
|
5974
|
+
import React56 from "react";
|
5847
5975
|
var import_cross4 = __toESM(require_cross());
|
5848
5976
|
var import_error3 = __toESM(require_error());
|
5849
5977
|
var import_search2 = __toESM(require_search());
|
5850
5978
|
var import_tick3 = __toESM(require_tick());
|
5851
5979
|
var InputAdornment = ({ placement = "right", className, dense, children }) => {
|
5852
|
-
return /* @__PURE__ */
|
5980
|
+
return /* @__PURE__ */ React56.createElement("span", {
|
5853
5981
|
className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
|
5854
5982
|
"right-0": placement === "right",
|
5855
5983
|
"left-0": placement === "left",
|
5856
5984
|
"typography-small": dense,
|
5857
5985
|
"typography-default-strong": !dense
|
5858
5986
|
})
|
5859
|
-
}, /* @__PURE__ */
|
5987
|
+
}, /* @__PURE__ */ React56.createElement(Flexbox, {
|
5860
5988
|
gap: "3",
|
5861
5989
|
wrap: "wrap"
|
5862
5990
|
}, children));
|
5863
5991
|
};
|
5864
|
-
var SearchIcon = ({ onClick }) => /* @__PURE__ */
|
5992
|
+
var SearchIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
|
5865
5993
|
icon: import_search2.default,
|
5866
5994
|
color: "grey-30",
|
5867
5995
|
"data-testid": "icon-search",
|
5868
5996
|
onClick
|
5869
5997
|
});
|
5870
|
-
var ResetIcon = ({ onClick }) => /* @__PURE__ */
|
5998
|
+
var ResetIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
|
5871
5999
|
className: "hover:cursor-pointer",
|
5872
6000
|
icon: import_cross4.default,
|
5873
6001
|
color: "grey-30",
|
@@ -5897,7 +6025,7 @@ var createInput = (displayName, opts = {}) => {
|
|
5897
6025
|
"readOnly"
|
5898
6026
|
]);
|
5899
6027
|
var _a2;
|
5900
|
-
const inputRef =
|
6028
|
+
const inputRef = React57.useRef(null);
|
5901
6029
|
useImperativeHandle(ref, () => inputRef.current);
|
5902
6030
|
const handleReset = () => {
|
5903
6031
|
var _a3;
|
@@ -5910,11 +6038,11 @@ var createInput = (displayName, opts = {}) => {
|
|
5910
6038
|
el.focus();
|
5911
6039
|
}
|
5912
6040
|
};
|
5913
|
-
return /* @__PURE__ */
|
6041
|
+
return /* @__PURE__ */ React57.createElement("span", {
|
5914
6042
|
className: tw("relative block")
|
5915
|
-
}, opts.adornment && /* @__PURE__ */
|
6043
|
+
}, opts.adornment && /* @__PURE__ */ React57.createElement(InputAdornment, {
|
5916
6044
|
placement: "left"
|
5917
|
-
}, opts.adornment), /* @__PURE__ */
|
6045
|
+
}, opts.adornment), /* @__PURE__ */ React57.createElement("input", __spreadProps(__spreadValues({
|
5918
6046
|
ref: inputRef,
|
5919
6047
|
type
|
5920
6048
|
}, props), {
|
@@ -5929,20 +6057,20 @@ var createInput = (displayName, opts = {}) => {
|
|
5929
6057
|
getCommonInputStyles({ readOnly, valid }),
|
5930
6058
|
props.className
|
5931
6059
|
)
|
5932
|
-
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */
|
6060
|
+
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React57.createElement(InputAdornment, null, /* @__PURE__ */ React57.createElement(ResetIcon, {
|
5933
6061
|
onClick: handleReset
|
5934
|
-
})), !opts.canReset && endAdornment && /* @__PURE__ */
|
6062
|
+
})), !opts.canReset && endAdornment && /* @__PURE__ */ React57.createElement(InputAdornment, null, endAdornment));
|
5935
6063
|
}
|
5936
6064
|
);
|
5937
6065
|
InputComponent.displayName = displayName;
|
5938
|
-
InputComponent.Skeleton = () => /* @__PURE__ */
|
6066
|
+
InputComponent.Skeleton = () => /* @__PURE__ */ React57.createElement(Skeleton, {
|
5939
6067
|
height: 38
|
5940
6068
|
});
|
5941
6069
|
return InputComponent;
|
5942
6070
|
};
|
5943
6071
|
var InputBase = createInput("InputBase");
|
5944
|
-
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */
|
5945
|
-
var Input2 =
|
6072
|
+
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React57.createElement(SearchIcon, null), canReset: true });
|
6073
|
+
var Input2 = React57.forwardRef((_a, ref) => {
|
5946
6074
|
var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
|
5947
6075
|
var _a2, _b2, _c;
|
5948
6076
|
const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
|
@@ -5950,13 +6078,13 @@ var Input2 = React55.forwardRef((_a, ref) => {
|
|
5950
6078
|
const errorMessageId = uniqueId3();
|
5951
6079
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
5952
6080
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
5953
|
-
const baseProps =
|
5954
|
-
return /* @__PURE__ */
|
6081
|
+
const baseProps = omit8(props, Object.keys(labelControlProps));
|
6082
|
+
return /* @__PURE__ */ React57.createElement(LabelControl, __spreadValues({
|
5955
6083
|
id: `${id.current}-label`,
|
5956
6084
|
htmlFor: id.current,
|
5957
6085
|
messageId: errorMessageId,
|
5958
6086
|
length: value !== void 0 ? toString(value).length : void 0
|
5959
|
-
}, labelControlProps), /* @__PURE__ */
|
6087
|
+
}, labelControlProps), /* @__PURE__ */ React57.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
|
5960
6088
|
ref
|
5961
6089
|
}, baseProps), errorProps), {
|
5962
6090
|
id: id.current,
|
@@ -5974,16 +6102,16 @@ var Input2 = React55.forwardRef((_a, ref) => {
|
|
5974
6102
|
})));
|
5975
6103
|
});
|
5976
6104
|
Input2.displayName = "Input";
|
5977
|
-
Input2.Skeleton = () => /* @__PURE__ */
|
6105
|
+
Input2.Skeleton = () => /* @__PURE__ */ React57.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React57.createElement(InputBase.Skeleton, null));
|
5978
6106
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
5979
6107
|
|
5980
6108
|
// src/common/DropdownMenu/DropdownMenu.tsx
|
5981
|
-
import
|
6109
|
+
import React58 from "react";
|
5982
6110
|
var import_tick4 = __toESM(require_tick());
|
5983
|
-
var DropdownMenu2 =
|
6111
|
+
var DropdownMenu2 = React58.forwardRef(
|
5984
6112
|
(_a, ref) => {
|
5985
6113
|
var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
|
5986
|
-
return /* @__PURE__ */
|
6114
|
+
return /* @__PURE__ */ React58.createElement("div", __spreadValues({
|
5987
6115
|
ref,
|
5988
6116
|
style: { maxHeight, minWidth, maxWidth },
|
5989
6117
|
className: classNames(
|
@@ -5993,25 +6121,25 @@ var DropdownMenu2 = React56.forwardRef(
|
|
5993
6121
|
}, props), children);
|
5994
6122
|
}
|
5995
6123
|
);
|
5996
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
6124
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React58.createElement("div", {
|
5997
6125
|
className: tw("p-3")
|
5998
6126
|
}, children);
|
5999
6127
|
DropdownMenu2.ContentContainer = ContentContainer;
|
6000
|
-
var List2 =
|
6128
|
+
var List2 = React58.forwardRef(
|
6001
6129
|
(_a, ref) => {
|
6002
6130
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6003
|
-
return /* @__PURE__ */
|
6131
|
+
return /* @__PURE__ */ React58.createElement("ul", __spreadValues({
|
6004
6132
|
ref
|
6005
6133
|
}, props), children);
|
6006
6134
|
}
|
6007
6135
|
);
|
6008
6136
|
DropdownMenu2.List = List2;
|
6009
|
-
var Group2 =
|
6137
|
+
var Group2 = React58.forwardRef(
|
6010
6138
|
(_a, ref) => {
|
6011
6139
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
6012
|
-
return /* @__PURE__ */
|
6140
|
+
return /* @__PURE__ */ React58.createElement("li", __spreadValues({
|
6013
6141
|
ref
|
6014
|
-
}, props), title && /* @__PURE__ */
|
6142
|
+
}, props), title && /* @__PURE__ */ React58.createElement("div", __spreadValues({
|
6015
6143
|
className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
|
6016
6144
|
"text-grey-20": props.disabled
|
6017
6145
|
})
|
@@ -6019,10 +6147,10 @@ var Group2 = React56.forwardRef(
|
|
6019
6147
|
}
|
6020
6148
|
);
|
6021
6149
|
DropdownMenu2.Group = Group2;
|
6022
|
-
var Item3 =
|
6150
|
+
var Item3 = React58.forwardRef(
|
6023
6151
|
(_a, ref) => {
|
6024
6152
|
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
6025
|
-
return /* @__PURE__ */
|
6153
|
+
return /* @__PURE__ */ React58.createElement("li", __spreadValues({
|
6026
6154
|
ref,
|
6027
6155
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
6028
6156
|
"cursor-pointer hover:bg-grey-0": !props.disabled,
|
@@ -6030,30 +6158,30 @@ var Item3 = React56.forwardRef(
|
|
6030
6158
|
"text-primary-80": kind === "action",
|
6031
6159
|
"text-grey-20 cursor-not-allowed": props.disabled
|
6032
6160
|
})
|
6033
|
-
}, props), icon && /* @__PURE__ */
|
6161
|
+
}, props), icon && /* @__PURE__ */ React58.createElement(InlineIcon, {
|
6034
6162
|
icon
|
6035
|
-
}), /* @__PURE__ */
|
6163
|
+
}), /* @__PURE__ */ React58.createElement("span", {
|
6036
6164
|
className: tw("grow")
|
6037
|
-
}, children), selected && /* @__PURE__ */
|
6165
|
+
}, children), selected && /* @__PURE__ */ React58.createElement(InlineIcon, {
|
6038
6166
|
icon: import_tick4.default
|
6039
6167
|
}));
|
6040
6168
|
}
|
6041
6169
|
);
|
6042
6170
|
DropdownMenu2.Item = Item3;
|
6043
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
6171
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React58.createElement(Typography2.Caption, {
|
6044
6172
|
color: disabled ? "grey-20" : "grey-40"
|
6045
6173
|
}, children);
|
6046
6174
|
DropdownMenu2.Description = Description;
|
6047
6175
|
var Separator = (_a) => {
|
6048
6176
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
6049
|
-
return /* @__PURE__ */
|
6177
|
+
return /* @__PURE__ */ React58.createElement("li", __spreadProps(__spreadValues({}, props), {
|
6050
6178
|
className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
|
6051
6179
|
}));
|
6052
6180
|
};
|
6053
6181
|
DropdownMenu2.Separator = Separator;
|
6054
6182
|
var EmptyStateContainer2 = (_a) => {
|
6055
6183
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
6056
|
-
return /* @__PURE__ */
|
6184
|
+
return /* @__PURE__ */ React58.createElement("div", __spreadValues({
|
6057
6185
|
className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
|
6058
6186
|
}, props), children);
|
6059
6187
|
};
|
@@ -6108,8 +6236,8 @@ var DropdownMenu3 = (_a) => {
|
|
6108
6236
|
"footer",
|
6109
6237
|
"children"
|
6110
6238
|
]);
|
6111
|
-
const triggerRef =
|
6112
|
-
const overlayRef =
|
6239
|
+
const triggerRef = React59.useRef(null);
|
6240
|
+
const overlayRef = React59.useRef(null);
|
6113
6241
|
const [trigger, items] = extractTriggerAndItems(children);
|
6114
6242
|
const state = useMenuTriggerState(props);
|
6115
6243
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
@@ -6120,17 +6248,17 @@ var DropdownMenu3 = (_a) => {
|
|
6120
6248
|
shouldFlip: true,
|
6121
6249
|
isOpen: state.isOpen
|
6122
6250
|
});
|
6123
|
-
return /* @__PURE__ */
|
6251
|
+
return /* @__PURE__ */ React59.createElement("div", null, /* @__PURE__ */ React59.createElement(PressResponder2, __spreadValues({
|
6124
6252
|
ref: triggerRef,
|
6125
6253
|
onPress: () => state.toggle()
|
6126
|
-
}, menuTriggerProps), /* @__PURE__ */
|
6254
|
+
}, menuTriggerProps), /* @__PURE__ */ React59.createElement(TriggerWrapper, null, trigger.props.children)), /* @__PURE__ */ React59.createElement(PopoverWrapper, __spreadValues({
|
6127
6255
|
ref: overlayRef,
|
6128
6256
|
isDismissable: true,
|
6129
6257
|
autoFocus: true,
|
6130
6258
|
containFocus: true,
|
6131
6259
|
isOpen: state.isOpen,
|
6132
6260
|
onClose: state.close
|
6133
|
-
}, overlayProps), /* @__PURE__ */
|
6261
|
+
}, overlayProps), /* @__PURE__ */ React59.createElement(MenuWrapper, __spreadValues({
|
6134
6262
|
onAction,
|
6135
6263
|
selectionMode,
|
6136
6264
|
selection,
|
@@ -6151,13 +6279,13 @@ DropdownMenu3.Item = Item4;
|
|
6151
6279
|
DropdownMenu3.Section = Section;
|
6152
6280
|
var TriggerWrapper = (_a) => {
|
6153
6281
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6154
|
-
const ref =
|
6282
|
+
const ref = React59.useRef(null);
|
6155
6283
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
|
6156
|
-
const trigger =
|
6157
|
-
if (!trigger || !
|
6284
|
+
const trigger = React59.Children.only(children);
|
6285
|
+
if (!trigger || !React59.isValidElement(trigger)) {
|
6158
6286
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
6159
6287
|
}
|
6160
|
-
return
|
6288
|
+
return React59.cloneElement(trigger, __spreadValues({ ref }, mergeProps4(pressProps, props)));
|
6161
6289
|
};
|
6162
6290
|
var isSectionNode = (item) => item.type === "section";
|
6163
6291
|
var isItemNode = (item) => item.type === "item";
|
@@ -6179,7 +6307,7 @@ var MenuWrapper = (_a) => {
|
|
6179
6307
|
"header",
|
6180
6308
|
"footer"
|
6181
6309
|
]);
|
6182
|
-
const ref =
|
6310
|
+
const ref = React59.useRef(null);
|
6183
6311
|
const disabledKeys = getDisabledItemKeys(props.children);
|
6184
6312
|
const state = useTreeState(__spreadValues({
|
6185
6313
|
disabledKeys,
|
@@ -6187,30 +6315,30 @@ var MenuWrapper = (_a) => {
|
|
6187
6315
|
}, props));
|
6188
6316
|
const { menuProps } = useMenu(props, state, ref);
|
6189
6317
|
const { contains } = useFilter({ sensitivity: "base" });
|
6190
|
-
const [search, setSearch] =
|
6191
|
-
const filteredCollection =
|
6318
|
+
const [search, setSearch] = React59.useState("");
|
6319
|
+
const filteredCollection = React59.useMemo(
|
6192
6320
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
6193
6321
|
[state.collection, search, contains]
|
6194
6322
|
);
|
6195
|
-
return /* @__PURE__ */
|
6323
|
+
return /* @__PURE__ */ React59.createElement(DropdownMenu2, {
|
6196
6324
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
6197
6325
|
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
|
6198
|
-
}, header, /* @__PURE__ */
|
6326
|
+
}, header, /* @__PURE__ */ React59.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React59.createElement(SearchInput, {
|
6199
6327
|
"aria-label": "search",
|
6200
6328
|
value: search,
|
6201
6329
|
onChange: (e) => setSearch(e.target.value),
|
6202
6330
|
className: tw("mb-5")
|
6203
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
6331
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React59.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React59.createElement(DropdownMenu2.List, __spreadValues({
|
6204
6332
|
ref
|
6205
6333
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
6206
6334
|
if (isSectionNode(item)) {
|
6207
|
-
return /* @__PURE__ */
|
6335
|
+
return /* @__PURE__ */ React59.createElement(SectionWrapper, {
|
6208
6336
|
key: item.key,
|
6209
6337
|
section: item,
|
6210
6338
|
state
|
6211
6339
|
});
|
6212
6340
|
} else if (isItemNode(item)) {
|
6213
|
-
return /* @__PURE__ */
|
6341
|
+
return /* @__PURE__ */ React59.createElement(ItemWrapper, {
|
6214
6342
|
key: item.key,
|
6215
6343
|
item,
|
6216
6344
|
state
|
@@ -6219,14 +6347,14 @@ var MenuWrapper = (_a) => {
|
|
6219
6347
|
}))), footer);
|
6220
6348
|
};
|
6221
6349
|
var ItemWrapper = ({ item, state }) => {
|
6222
|
-
const ref =
|
6350
|
+
const ref = React59.useRef(null);
|
6223
6351
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
6224
6352
|
{ key: item.key },
|
6225
6353
|
state,
|
6226
6354
|
ref
|
6227
6355
|
);
|
6228
6356
|
const { icon, description, kind = "default" } = item.props;
|
6229
|
-
return /* @__PURE__ */
|
6357
|
+
return /* @__PURE__ */ React59.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
|
6230
6358
|
ref
|
6231
6359
|
}, menuItemProps), {
|
6232
6360
|
kind,
|
@@ -6234,7 +6362,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
6234
6362
|
highlighted: isFocused,
|
6235
6363
|
disabled: isDisabled,
|
6236
6364
|
icon
|
6237
|
-
}), item.rendered, description && /* @__PURE__ */
|
6365
|
+
}), item.rendered, description && /* @__PURE__ */ React59.createElement(DropdownMenu2.Description, __spreadValues({
|
6238
6366
|
disabled: isDisabled
|
6239
6367
|
}, descriptionProps), description));
|
6240
6368
|
};
|
@@ -6246,24 +6374,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
6246
6374
|
const { separatorProps } = useSeparator({
|
6247
6375
|
elementType: "li"
|
6248
6376
|
});
|
6249
|
-
return /* @__PURE__ */
|
6377
|
+
return /* @__PURE__ */ React59.createElement(React59.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React59.createElement(DropdownMenu2.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React59.createElement(DropdownMenu2.Group, __spreadValues({
|
6250
6378
|
title: section.rendered,
|
6251
6379
|
titleProps: headingProps
|
6252
|
-
}, itemProps), /* @__PURE__ */
|
6380
|
+
}, itemProps), /* @__PURE__ */ React59.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React59.createElement(ItemWrapper, {
|
6253
6381
|
key: node.key,
|
6254
6382
|
item: node,
|
6255
6383
|
state
|
6256
6384
|
})))));
|
6257
6385
|
};
|
6258
6386
|
var extractTriggerAndItems = (children) => {
|
6259
|
-
const [trigger, items] =
|
6387
|
+
const [trigger, items] = React59.Children.toArray(children);
|
6260
6388
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
6261
6389
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
6262
6390
|
}
|
6263
6391
|
return [trigger, items];
|
6264
6392
|
};
|
6265
6393
|
var getDisabledItemKeys = (children) => {
|
6266
|
-
const keys =
|
6394
|
+
const keys = React59.Children.map(children, (child) => {
|
6267
6395
|
var _a, _b;
|
6268
6396
|
if (!child || typeof child === "function") {
|
6269
6397
|
return null;
|
@@ -6280,11 +6408,11 @@ var getDisabledItemKeys = (children) => {
|
|
6280
6408
|
};
|
6281
6409
|
|
6282
6410
|
// src/components/EmptyState/EmptyState.tsx
|
6283
|
-
import
|
6284
|
-
import
|
6411
|
+
import React61 from "react";
|
6412
|
+
import omit9 from "lodash/omit";
|
6285
6413
|
|
6286
6414
|
// src/components/Flexbox/FlexboxItem.tsx
|
6287
|
-
import
|
6415
|
+
import React60 from "react";
|
6288
6416
|
var FlexboxItem = Tailwindify(
|
6289
6417
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6290
6418
|
const hookStyle = useStyle({
|
@@ -6296,7 +6424,7 @@ var FlexboxItem = Tailwindify(
|
|
6296
6424
|
alignSelf
|
6297
6425
|
});
|
6298
6426
|
const HtmlElement = htmlTag;
|
6299
|
-
return /* @__PURE__ */
|
6427
|
+
return /* @__PURE__ */ React60.createElement(HtmlElement, {
|
6300
6428
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6301
6429
|
className
|
6302
6430
|
}, children);
|
@@ -6346,6 +6474,7 @@ var EmptyState = ({
|
|
6346
6474
|
imageAlt = "",
|
6347
6475
|
imageWidth,
|
6348
6476
|
description,
|
6477
|
+
children,
|
6349
6478
|
primaryAction,
|
6350
6479
|
secondaryAction,
|
6351
6480
|
footer,
|
@@ -6353,7 +6482,7 @@ var EmptyState = ({
|
|
6353
6482
|
borderStyle = "dashed"
|
6354
6483
|
}) => {
|
6355
6484
|
const template = layoutStyle(layout);
|
6356
|
-
return /* @__PURE__ */
|
6485
|
+
return /* @__PURE__ */ React61.createElement(Box, {
|
6357
6486
|
className: classNames(
|
6358
6487
|
tw("rounded", {
|
6359
6488
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6365,38 +6494,38 @@ var EmptyState = ({
|
|
6365
6494
|
backgroundColor: "transparent",
|
6366
6495
|
borderColor: "grey-10",
|
6367
6496
|
padding: "9"
|
6368
|
-
}, /* @__PURE__ */
|
6497
|
+
}, /* @__PURE__ */ React61.createElement(Flexbox, {
|
6369
6498
|
direction: template.layout,
|
6370
6499
|
justifyContent: template.justifyContent,
|
6371
6500
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6372
6501
|
colGap: "l5",
|
6373
6502
|
rowGap: "8"
|
6374
|
-
}, image && /* @__PURE__ */
|
6503
|
+
}, image && /* @__PURE__ */ React61.createElement(FlexboxItem, null, /* @__PURE__ */ React61.createElement("img", {
|
6375
6504
|
src: image,
|
6376
6505
|
alt: imageAlt,
|
6377
6506
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6378
|
-
})), /* @__PURE__ */
|
6507
|
+
})), /* @__PURE__ */ React61.createElement(Flexbox, {
|
6379
6508
|
style: { maxWidth: "610px" },
|
6380
6509
|
direction: "column",
|
6381
6510
|
justifyContent: template.justifyContent,
|
6382
6511
|
alignItems: template.alignItems
|
6383
|
-
}, /* @__PURE__ */
|
6512
|
+
}, /* @__PURE__ */ React61.createElement(Typography2, {
|
6384
6513
|
variant: "heading",
|
6385
6514
|
htmlTag: "h2"
|
6386
|
-
}, title), description && /* @__PURE__ */
|
6515
|
+
}, title), (description || children) && /* @__PURE__ */ React61.createElement(Box, {
|
6387
6516
|
marginTop: "5"
|
6388
|
-
}, /* @__PURE__ */
|
6517
|
+
}, /* @__PURE__ */ React61.createElement(Typography2, {
|
6389
6518
|
variant: "default",
|
6390
6519
|
color: "grey-60"
|
6391
|
-
}, description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6520
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React61.createElement(Flexbox, {
|
6392
6521
|
marginTop: "7",
|
6393
6522
|
gap: "4",
|
6394
6523
|
justifyContent: "center",
|
6395
6524
|
alignItems: "center",
|
6396
6525
|
wrap: "wrap"
|
6397
|
-
}, primaryAction && /* @__PURE__ */
|
6526
|
+
}, primaryAction && /* @__PURE__ */ React61.createElement(PrimaryButton, __spreadValues({}, omit9(primaryAction, "text")), primaryAction.text), secondaryAction && /* @__PURE__ */ React61.createElement(SecondaryButton, __spreadValues({}, omit9(secondaryAction, "text")), secondaryAction.text)), footer && /* @__PURE__ */ React61.createElement(Box, {
|
6398
6527
|
marginTop: "7"
|
6399
|
-
}, /* @__PURE__ */
|
6528
|
+
}, /* @__PURE__ */ React61.createElement(Typography2, {
|
6400
6529
|
htmlTag: "div",
|
6401
6530
|
variant: "small",
|
6402
6531
|
color: "grey-60"
|
@@ -6404,7 +6533,7 @@ var EmptyState = ({
|
|
6404
6533
|
};
|
6405
6534
|
|
6406
6535
|
// src/components/Grid/GridItem.tsx
|
6407
|
-
import
|
6536
|
+
import React62 from "react";
|
6408
6537
|
var GridItem = Tailwindify(
|
6409
6538
|
({
|
6410
6539
|
htmlTag = "div",
|
@@ -6435,7 +6564,7 @@ var GridItem = Tailwindify(
|
|
6435
6564
|
gridRowEnd: rowEnd
|
6436
6565
|
});
|
6437
6566
|
const HtmlElement = htmlTag;
|
6438
|
-
return /* @__PURE__ */
|
6567
|
+
return /* @__PURE__ */ React62.createElement(HtmlElement, {
|
6439
6568
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6440
6569
|
className
|
6441
6570
|
}, children);
|
@@ -6443,23 +6572,23 @@ var GridItem = Tailwindify(
|
|
6443
6572
|
);
|
6444
6573
|
|
6445
6574
|
// src/components/List/List.tsx
|
6446
|
-
import
|
6447
|
-
var List = ({ items, renderItem, container =
|
6575
|
+
import React63 from "react";
|
6576
|
+
var List = ({ items, renderItem, container = React63.Fragment }) => {
|
6448
6577
|
const Component = container;
|
6449
|
-
return /* @__PURE__ */
|
6578
|
+
return /* @__PURE__ */ React63.createElement(Component, null, items.map(renderItem));
|
6450
6579
|
};
|
6451
6580
|
|
6452
6581
|
// src/components/ListItem/ListItem.tsx
|
6453
|
-
import
|
6582
|
+
import React64 from "react";
|
6454
6583
|
var ListItem = ({ name, icon, active = false }) => {
|
6455
|
-
return /* @__PURE__ */
|
6584
|
+
return /* @__PURE__ */ React64.createElement(Flexbox, {
|
6456
6585
|
alignItems: "center"
|
6457
|
-
}, /* @__PURE__ */
|
6586
|
+
}, /* @__PURE__ */ React64.createElement(Typography2, {
|
6458
6587
|
variant: active ? "small-strong" : "small",
|
6459
6588
|
color: "grey-70",
|
6460
6589
|
htmlTag: "span",
|
6461
6590
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6462
|
-
}, /* @__PURE__ */
|
6591
|
+
}, /* @__PURE__ */ React64.createElement("img", {
|
6463
6592
|
src: icon,
|
6464
6593
|
alt: name,
|
6465
6594
|
className: "inline mr-4",
|
@@ -6469,28 +6598,28 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6469
6598
|
};
|
6470
6599
|
|
6471
6600
|
// src/components/Modal/Modal.tsx
|
6472
|
-
import
|
6601
|
+
import React66 from "react";
|
6473
6602
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6474
6603
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
6475
6604
|
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
6476
6605
|
import { useId as useId2 } from "@react-aria/utils";
|
6477
6606
|
import { useOverlayTriggerState as useOverlayTriggerState4 } from "@react-stately/overlays";
|
6478
6607
|
import castArray from "lodash/castArray";
|
6479
|
-
import
|
6608
|
+
import omit10 from "lodash/omit";
|
6480
6609
|
|
6481
6610
|
// src/components/Tabs/Tabs.tsx
|
6482
|
-
import
|
6611
|
+
import React65, { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useState as useState7 } from "react";
|
6483
6612
|
import isNumber4 from "lodash/isNumber";
|
6484
6613
|
import kebabCase from "lodash/kebabCase";
|
6485
6614
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6486
6615
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6487
6616
|
var import_warningSign3 = __toESM(require_warningSign());
|
6488
6617
|
var isTabComponent = (c) => {
|
6489
|
-
return
|
6618
|
+
return React65.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6490
6619
|
};
|
6491
|
-
var Tab =
|
6620
|
+
var Tab = React65.forwardRef(
|
6492
6621
|
({ className, id, title, children }, ref) => {
|
6493
|
-
return /* @__PURE__ */
|
6622
|
+
return /* @__PURE__ */ React65.createElement("div", {
|
6494
6623
|
ref,
|
6495
6624
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6496
6625
|
className,
|
@@ -6502,14 +6631,14 @@ var Tab = React63.forwardRef(
|
|
6502
6631
|
);
|
6503
6632
|
var TabContainer = (_a) => {
|
6504
6633
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6505
|
-
return /* @__PURE__ */
|
6634
|
+
return /* @__PURE__ */ React65.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6506
6635
|
className: classNames("py-6 z-0", className)
|
6507
6636
|
}), children);
|
6508
6637
|
};
|
6509
6638
|
var ModalTab = Tab;
|
6510
6639
|
var ModalTabContainer = TabContainer;
|
6511
6640
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6512
|
-
const Tab2 =
|
6641
|
+
const Tab2 = React65.forwardRef(
|
6513
6642
|
(_a, ref) => {
|
6514
6643
|
var _b = _a, {
|
6515
6644
|
id,
|
@@ -6539,17 +6668,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6539
6668
|
const _id = id != null ? id : kebabCase(title);
|
6540
6669
|
let statusIcon = void 0;
|
6541
6670
|
if (status === "warning") {
|
6542
|
-
statusIcon = /* @__PURE__ */
|
6671
|
+
statusIcon = /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6543
6672
|
icon: import_warningSign3.default,
|
6544
6673
|
color: "warning-80"
|
6545
6674
|
});
|
6546
6675
|
} else if (status === "error") {
|
6547
|
-
statusIcon = /* @__PURE__ */
|
6676
|
+
statusIcon = /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6548
6677
|
icon: import_warningSign3.default,
|
6549
6678
|
color: "error-50"
|
6550
6679
|
});
|
6551
6680
|
}
|
6552
|
-
const tab = /* @__PURE__ */
|
6681
|
+
const tab = /* @__PURE__ */ React65.createElement(Component, __spreadValues({
|
6553
6682
|
ref,
|
6554
6683
|
id: `${_id}-tab`,
|
6555
6684
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6566,24 +6695,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6566
6695
|
"aria-selected": selected,
|
6567
6696
|
"aria-controls": `${_id}-panel`,
|
6568
6697
|
tabIndex: disabled ? void 0 : 0
|
6569
|
-
}, rest), /* @__PURE__ */
|
6698
|
+
}, rest), /* @__PURE__ */ React65.createElement(Typography2, {
|
6570
6699
|
htmlTag: "div",
|
6571
6700
|
variant: "small",
|
6572
6701
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6573
6702
|
className: tw("inline-flex items-center gap-3")
|
6574
|
-
}, /* @__PURE__ */
|
6703
|
+
}, /* @__PURE__ */ React65.createElement("span", {
|
6575
6704
|
className: tw("whitespace-nowrap")
|
6576
|
-
}, title), isNumber4(badge) && /* @__PURE__ */
|
6705
|
+
}, title), isNumber4(badge) && /* @__PURE__ */ React65.createElement(Typography2, {
|
6577
6706
|
htmlTag: "span",
|
6578
6707
|
variant: "small",
|
6579
6708
|
color: selected ? "primary-80" : "grey-5",
|
6580
6709
|
className: "leading-none"
|
6581
|
-
}, /* @__PURE__ */
|
6710
|
+
}, /* @__PURE__ */ React65.createElement(TabBadge, {
|
6582
6711
|
kind: "filled",
|
6583
6712
|
value: badge,
|
6584
6713
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6585
6714
|
})), statusIcon));
|
6586
|
-
return tooltip ? /* @__PURE__ */
|
6715
|
+
return tooltip ? /* @__PURE__ */ React65.createElement(Tooltip, {
|
6587
6716
|
content: tooltip
|
6588
6717
|
}, tab) : tab;
|
6589
6718
|
}
|
@@ -6592,11 +6721,12 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6592
6721
|
return Tab2;
|
6593
6722
|
};
|
6594
6723
|
var TabItem = asTabItem("button", "TabItem");
|
6724
|
+
var CARET_OFFSET = 24;
|
6595
6725
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
6596
6726
|
const Tabs2 = (props) => {
|
6597
6727
|
var _a, _b;
|
6598
6728
|
const { className, value, defaultValue, onChange, children } = props;
|
6599
|
-
const childArr =
|
6729
|
+
const childArr = React65.Children.toArray(children);
|
6600
6730
|
const firstTab = childArr[0];
|
6601
6731
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6602
6732
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -6605,25 +6735,54 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6605
6735
|
const parentRef = useRef6(null);
|
6606
6736
|
const containerRef = useRef6(null);
|
6607
6737
|
const tabsRef = useRef6(null);
|
6738
|
+
const revealSelectedTab = ({ smooth }) => {
|
6739
|
+
var _a2, _b2;
|
6740
|
+
const container = containerRef.current;
|
6741
|
+
const tabs = tabsRef.current;
|
6742
|
+
const values = React65.Children.map(
|
6743
|
+
children,
|
6744
|
+
(tab, i) => {
|
6745
|
+
var _a3;
|
6746
|
+
return (_a3 = tab == null ? void 0 : tab.props.value) != null ? _a3 : i;
|
6747
|
+
}
|
6748
|
+
);
|
6749
|
+
const idx = (_a2 = values == null ? void 0 : values.findIndex((val) => value === val)) != null ? _a2 : -1;
|
6750
|
+
const child = Array.from((_b2 = tabs == null ? void 0 : tabs.childNodes) != null ? _b2 : [])[idx];
|
6751
|
+
if (!container || !(child instanceof HTMLElement)) {
|
6752
|
+
return;
|
6753
|
+
}
|
6754
|
+
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
6755
|
+
const { x, width } = child.getBoundingClientRect();
|
6756
|
+
const isInViewPort = x >= containerX && x + width <= containerX + containerWidth;
|
6757
|
+
if (!isInViewPort) {
|
6758
|
+
container.scrollTo({
|
6759
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
6760
|
+
behavior: smooth ? "smooth" : void 0
|
6761
|
+
});
|
6762
|
+
}
|
6763
|
+
};
|
6764
|
+
const updateCarets = () => {
|
6765
|
+
const pEl = parentRef.current;
|
6766
|
+
const el = containerRef.current;
|
6767
|
+
if (!pEl || !el) {
|
6768
|
+
return;
|
6769
|
+
}
|
6770
|
+
const { width } = pEl.getBoundingClientRect();
|
6771
|
+
const hasLeftCaret = el.scrollWidth > width && el.scrollLeft !== 0;
|
6772
|
+
const hasRightCaret = el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth);
|
6773
|
+
showLeftCaret(hasLeftCaret);
|
6774
|
+
showRightCaret(hasRightCaret);
|
6775
|
+
};
|
6608
6776
|
useEffect5(() => {
|
6609
|
-
if (value
|
6610
|
-
|
6777
|
+
if (value === void 0) {
|
6778
|
+
return;
|
6611
6779
|
}
|
6612
|
-
|
6780
|
+
updateCarets();
|
6781
|
+
setSelected(value);
|
6782
|
+
revealSelectedTab({ smooth: value !== selected });
|
6783
|
+
}, [value, React65.Children.count(children)]);
|
6613
6784
|
useLayoutEffect2(() => {
|
6614
6785
|
var _a2;
|
6615
|
-
const updateCarets = () => {
|
6616
|
-
const pEl = parentRef.current;
|
6617
|
-
const el = containerRef.current;
|
6618
|
-
if (!pEl || !el) {
|
6619
|
-
return;
|
6620
|
-
}
|
6621
|
-
const { width } = pEl.getBoundingClientRect();
|
6622
|
-
showLeftCaret(el.scrollWidth > width && el.scrollLeft !== 0);
|
6623
|
-
showRightCaret(
|
6624
|
-
el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth)
|
6625
|
-
);
|
6626
|
-
};
|
6627
6786
|
updateCarets();
|
6628
6787
|
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
6629
6788
|
window.addEventListener("resize", updateCarets);
|
@@ -6632,7 +6791,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6632
6791
|
(_a3 = containerRef.current) == null ? void 0 : _a3.removeEventListener("scroll", updateCarets);
|
6633
6792
|
window.removeEventListener("resize", updateCarets);
|
6634
6793
|
};
|
6635
|
-
}, [parentRef.current, containerRef.current]);
|
6794
|
+
}, [parentRef.current, containerRef.current, children]);
|
6636
6795
|
const handleScrollToNext = (direction) => {
|
6637
6796
|
const container = containerRef.current;
|
6638
6797
|
const tabs = tabsRef.current;
|
@@ -6651,7 +6810,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6651
6810
|
if (next instanceof HTMLElement) {
|
6652
6811
|
const { x, width } = next.getBoundingClientRect();
|
6653
6812
|
container.scrollTo({
|
6654
|
-
left: container.scrollLeft + Math.ceil(x + width - containerX - containerWidth),
|
6813
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
6655
6814
|
behavior: "smooth"
|
6656
6815
|
});
|
6657
6816
|
}
|
@@ -6662,7 +6821,10 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6662
6821
|
});
|
6663
6822
|
if (next instanceof HTMLElement) {
|
6664
6823
|
const { x } = next.getBoundingClientRect();
|
6665
|
-
container.scrollTo({
|
6824
|
+
container.scrollTo({
|
6825
|
+
left: container.scrollLeft - Math.abs(x - containerX - CARET_OFFSET),
|
6826
|
+
behavior: "smooth"
|
6827
|
+
});
|
6666
6828
|
}
|
6667
6829
|
}
|
6668
6830
|
};
|
@@ -6682,27 +6844,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6682
6844
|
const handleSelected = (key) => {
|
6683
6845
|
(onChange != null ? onChange : setSelected)(key);
|
6684
6846
|
};
|
6685
|
-
|
6847
|
+
React65.Children.forEach(children, (c) => {
|
6686
6848
|
if (c && !isTabComponent(c)) {
|
6687
6849
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6688
6850
|
}
|
6689
6851
|
});
|
6690
|
-
return /* @__PURE__ */
|
6852
|
+
return /* @__PURE__ */ React65.createElement("div", {
|
6691
6853
|
ref: parentRef,
|
6692
6854
|
className: classNames(tw("h-full"), className)
|
6693
|
-
}, /* @__PURE__ */
|
6855
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6694
6856
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6695
|
-
}, /* @__PURE__ */
|
6857
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6696
6858
|
ref: containerRef,
|
6697
6859
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6698
|
-
}, /* @__PURE__ */
|
6860
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6699
6861
|
ref: tabsRef,
|
6700
6862
|
role: "tablist",
|
6701
6863
|
"aria-label": "tabs",
|
6702
6864
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
6703
|
-
},
|
6865
|
+
}, React65.Children.map(
|
6704
6866
|
children,
|
6705
|
-
(tab, index) => tab ? /* @__PURE__ */
|
6867
|
+
(tab, index) => tab ? /* @__PURE__ */ React65.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
6706
6868
|
key: tab.props.value
|
6707
6869
|
}, tab.props), {
|
6708
6870
|
index,
|
@@ -6710,20 +6872,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6710
6872
|
onKeyDown: handleKeyDown,
|
6711
6873
|
onSelected: handleSelected
|
6712
6874
|
})) : void 0
|
6713
|
-
))), leftCaret && /* @__PURE__ */
|
6875
|
+
))), leftCaret && /* @__PURE__ */ React65.createElement("div", {
|
6714
6876
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
6715
|
-
}, /* @__PURE__ */
|
6877
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6716
6878
|
onClick: () => handleScrollToNext("left"),
|
6717
6879
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6718
|
-
}, /* @__PURE__ */
|
6880
|
+
}, /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6719
6881
|
icon: import_chevronLeft2.default
|
6720
|
-
}))), rightCaret && /* @__PURE__ */
|
6882
|
+
}))), rightCaret && /* @__PURE__ */ React65.createElement("div", {
|
6721
6883
|
onClick: () => handleScrollToNext("right"),
|
6722
6884
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
6723
|
-
}, /* @__PURE__ */
|
6885
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6724
6886
|
onClick: () => handleScrollToNext("right"),
|
6725
6887
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6726
|
-
}, /* @__PURE__ */
|
6888
|
+
}, /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6727
6889
|
icon: import_chevronRight2.default
|
6728
6890
|
})))), renderChildren(children, selected, props));
|
6729
6891
|
};
|
@@ -6731,7 +6893,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6731
6893
|
Tabs2.Tab = TabComponent;
|
6732
6894
|
return Tabs2;
|
6733
6895
|
};
|
6734
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
6896
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React65.createElement(TabContainer, null, children.find(
|
6735
6897
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6736
6898
|
)));
|
6737
6899
|
|
@@ -6748,7 +6910,7 @@ var Modal2 = ({
|
|
6748
6910
|
secondaryActions,
|
6749
6911
|
size
|
6750
6912
|
}) => {
|
6751
|
-
const ref =
|
6913
|
+
const ref = React66.useRef(null);
|
6752
6914
|
const state = useOverlayTriggerState4({ isOpen: open });
|
6753
6915
|
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
6754
6916
|
const labelledBy = useId2();
|
@@ -6760,60 +6922,60 @@ var Modal2 = ({
|
|
6760
6922
|
if (!open) {
|
6761
6923
|
return null;
|
6762
6924
|
}
|
6763
|
-
return /* @__PURE__ */
|
6925
|
+
return /* @__PURE__ */ React66.createElement(Overlay2, null, /* @__PURE__ */ React66.createElement(Modal, {
|
6764
6926
|
open: state.isOpen
|
6765
|
-
}, /* @__PURE__ */
|
6927
|
+
}, /* @__PURE__ */ React66.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React66.createElement(FocusScope3, {
|
6766
6928
|
contain: true,
|
6767
6929
|
restoreFocus: true,
|
6768
6930
|
autoFocus: true
|
6769
|
-
}, /* @__PURE__ */
|
6931
|
+
}, /* @__PURE__ */ React66.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
6770
6932
|
ref,
|
6771
6933
|
size
|
6772
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
6934
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React66.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React66.createElement(IconButton, {
|
6773
6935
|
"aria-label": "Close",
|
6774
6936
|
icon: import_cross5.default,
|
6775
6937
|
onClick: onClose
|
6776
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
6938
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React66.createElement(Modal.HeaderImage, {
|
6777
6939
|
backgroundImage: headerImage
|
6778
|
-
}), /* @__PURE__ */
|
6940
|
+
}), /* @__PURE__ */ React66.createElement(Modal.Header, {
|
6779
6941
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
6780
|
-
}, /* @__PURE__ */
|
6942
|
+
}, /* @__PURE__ */ React66.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React66.createElement(Modal.Title, {
|
6781
6943
|
id: labelledBy
|
6782
|
-
}, title), subtitle && /* @__PURE__ */
|
6944
|
+
}, title), subtitle && /* @__PURE__ */ React66.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React66.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React66.createElement(Modal.Body, {
|
6783
6945
|
id: describedBy,
|
6784
6946
|
tabIndex: 0,
|
6785
6947
|
noFooter: !(secondaryActions || primaryAction)
|
6786
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
6948
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React66.createElement(Modal.Footer, null, /* @__PURE__ */ React66.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
6787
6949
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
6788
|
-
return /* @__PURE__ */
|
6950
|
+
return /* @__PURE__ */ React66.createElement(SecondaryButton, __spreadValues({
|
6789
6951
|
key: text
|
6790
6952
|
}, action), text);
|
6791
|
-
}), primaryAction && /* @__PURE__ */
|
6953
|
+
}), primaryAction && /* @__PURE__ */ React66.createElement(PrimaryButton, __spreadValues({
|
6792
6954
|
key: primaryAction.text
|
6793
|
-
},
|
6955
|
+
}, omit10(primaryAction, "text")), primaryAction.text)))))));
|
6794
6956
|
};
|
6795
6957
|
var ModalTabs = createTabsComponent(
|
6796
6958
|
ModalTab,
|
6797
6959
|
TabItem,
|
6798
6960
|
"ModalTabs",
|
6799
|
-
(children, selected, props) => /* @__PURE__ */
|
6961
|
+
(children, selected, props) => /* @__PURE__ */ React66.createElement(Modal.Body, {
|
6800
6962
|
maxHeight: props.maxHeight
|
6801
|
-
}, /* @__PURE__ */
|
6963
|
+
}, /* @__PURE__ */ React66.createElement(ModalTabContainer, null, children.find(
|
6802
6964
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6803
6965
|
)))
|
6804
6966
|
);
|
6805
6967
|
|
6806
6968
|
// src/components/MultiInput/MultiInput.tsx
|
6807
|
-
import
|
6969
|
+
import React68, { useEffect as useEffect6, useRef as useRef7, useState as useState8 } from "react";
|
6808
6970
|
import castArray2 from "lodash/castArray";
|
6809
6971
|
import identity from "lodash/identity";
|
6810
|
-
import
|
6972
|
+
import omit11 from "lodash/omit";
|
6811
6973
|
import uniqueId4 from "lodash/uniqueId";
|
6812
6974
|
|
6813
6975
|
// src/components/MultiInput/InputChip.tsx
|
6814
|
-
import
|
6976
|
+
import React67 from "react";
|
6815
6977
|
var import_smallCross = __toESM(require_smallCross());
|
6816
|
-
var InputChip =
|
6978
|
+
var InputChip = React67.forwardRef(
|
6817
6979
|
(_a, ref) => {
|
6818
6980
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
6819
6981
|
const onClick = (e) => {
|
@@ -6821,7 +6983,7 @@ var InputChip = React65.forwardRef(
|
|
6821
6983
|
_onClick == null ? void 0 : _onClick(e);
|
6822
6984
|
}
|
6823
6985
|
};
|
6824
|
-
return /* @__PURE__ */
|
6986
|
+
return /* @__PURE__ */ React67.createElement("div", __spreadValues({
|
6825
6987
|
ref,
|
6826
6988
|
role: "button",
|
6827
6989
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -6831,10 +6993,10 @@ var InputChip = React65.forwardRef(
|
|
6831
6993
|
"bg-grey-5 pointer-events-none": disabled
|
6832
6994
|
}),
|
6833
6995
|
onClick
|
6834
|
-
}, props), /* @__PURE__ */
|
6996
|
+
}, props), /* @__PURE__ */ React67.createElement(Typography2, {
|
6835
6997
|
variant: "small",
|
6836
6998
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
6837
|
-
}, children), !readOnly && /* @__PURE__ */
|
6999
|
+
}, children), !readOnly && /* @__PURE__ */ React67.createElement("div", null, /* @__PURE__ */ React67.createElement(Icon, {
|
6838
7000
|
icon: import_smallCross.default,
|
6839
7001
|
className: tw("ml-2", {
|
6840
7002
|
"text-error-70": invalid,
|
@@ -6972,7 +7134,7 @@ var MultiInputBase = (_a) => {
|
|
6972
7134
|
};
|
6973
7135
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
6974
7136
|
var _a3;
|
6975
|
-
return /* @__PURE__ */
|
7137
|
+
return /* @__PURE__ */ React68.createElement(InputChip, {
|
6976
7138
|
key: `${itemToString(item)}.${index}`,
|
6977
7139
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
6978
7140
|
readOnly,
|
@@ -6983,11 +7145,11 @@ var MultiInputBase = (_a) => {
|
|
6983
7145
|
}
|
6984
7146
|
}, itemToString(item));
|
6985
7147
|
});
|
6986
|
-
return /* @__PURE__ */
|
7148
|
+
return /* @__PURE__ */ React68.createElement("div", null, /* @__PURE__ */ React68.createElement(Select.InputContainer, {
|
6987
7149
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
6988
|
-
}, /* @__PURE__ */
|
7150
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6989
7151
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
6990
|
-
}, inline && renderChips(), /* @__PURE__ */
|
7152
|
+
}, inline && renderChips(), /* @__PURE__ */ React68.createElement(Select.Input, __spreadProps(__spreadValues({
|
6991
7153
|
ref: inputRef,
|
6992
7154
|
id: id != null ? id : name,
|
6993
7155
|
name,
|
@@ -7005,11 +7167,11 @@ var MultiInputBase = (_a) => {
|
|
7005
7167
|
onFocus: handleFocus,
|
7006
7168
|
onBlur: handleBlur,
|
7007
7169
|
autoComplete: "off"
|
7008
|
-
}))), endAdornment && /* @__PURE__ */
|
7170
|
+
}))), endAdornment && /* @__PURE__ */ React68.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React68.createElement("div", {
|
7009
7171
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
7010
7172
|
}, renderChips()));
|
7011
7173
|
};
|
7012
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7174
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React68.createElement(Skeleton, {
|
7013
7175
|
height: 38
|
7014
7176
|
});
|
7015
7177
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7025,15 +7187,15 @@ var MultiInput = (props) => {
|
|
7025
7187
|
const errorMessageId = uniqueId4();
|
7026
7188
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7027
7189
|
const labelControlProps = getLabelControlProps(props);
|
7028
|
-
const baseProps =
|
7029
|
-
return /* @__PURE__ */
|
7190
|
+
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7191
|
+
return /* @__PURE__ */ React68.createElement(LabelControl, __spreadProps(__spreadValues({
|
7030
7192
|
id: `${id.current}-label`,
|
7031
7193
|
htmlFor: `${id.current}-input`,
|
7032
7194
|
messageId: errorMessageId
|
7033
7195
|
}, labelControlProps), {
|
7034
7196
|
length: value.length,
|
7035
7197
|
maxLength
|
7036
|
-
}), /* @__PURE__ */
|
7198
|
+
}), /* @__PURE__ */ React68.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7037
7199
|
id: `${id.current}-input`,
|
7038
7200
|
onChange: (value2) => {
|
7039
7201
|
var _a2;
|
@@ -7045,16 +7207,16 @@ var MultiInput = (props) => {
|
|
7045
7207
|
valid: props.valid
|
7046
7208
|
})));
|
7047
7209
|
};
|
7048
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7210
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React68.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React68.createElement(MultiInputBase.Skeleton, null));
|
7049
7211
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7050
7212
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7051
7213
|
|
7052
7214
|
// src/components/MultiSelect/MultiSelect.tsx
|
7053
|
-
import
|
7215
|
+
import React69, { useRef as useRef8, useState as useState9 } from "react";
|
7054
7216
|
import { useOverlayPosition as useOverlayPosition5 } from "@react-aria/overlays";
|
7055
7217
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7056
7218
|
import isNil from "lodash/isNil";
|
7057
|
-
import
|
7219
|
+
import omit12 from "lodash/omit";
|
7058
7220
|
import omitBy from "lodash/omitBy";
|
7059
7221
|
import uniqueId5 from "lodash/uniqueId";
|
7060
7222
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
@@ -7064,9 +7226,9 @@ var MultiSelectBase = (_a) => {
|
|
7064
7226
|
name,
|
7065
7227
|
placeholder,
|
7066
7228
|
maxHeight,
|
7067
|
-
closeOnSelect = true,
|
7068
7229
|
hideChips = false,
|
7069
7230
|
inline = true,
|
7231
|
+
closeOnSelect = inline ? false : true,
|
7070
7232
|
options,
|
7071
7233
|
optionKeys = ["label", "value"],
|
7072
7234
|
noResults,
|
@@ -7086,9 +7248,9 @@ var MultiSelectBase = (_a) => {
|
|
7086
7248
|
"name",
|
7087
7249
|
"placeholder",
|
7088
7250
|
"maxHeight",
|
7089
|
-
"closeOnSelect",
|
7090
7251
|
"hideChips",
|
7091
7252
|
"inline",
|
7253
|
+
"closeOnSelect",
|
7092
7254
|
"options",
|
7093
7255
|
"optionKeys",
|
7094
7256
|
"noResults",
|
@@ -7124,10 +7286,19 @@ var MultiSelectBase = (_a) => {
|
|
7124
7286
|
const filteredOptions = (inputValue ? matchSorter2(options, inputValue, { keys }) : options).filter(
|
7125
7287
|
(opt) => !selectedItemsAsStrings.includes(itemToString(opt))
|
7126
7288
|
);
|
7127
|
-
const {
|
7289
|
+
const {
|
7290
|
+
isOpen,
|
7291
|
+
openMenu,
|
7292
|
+
closeMenu,
|
7293
|
+
highlightedIndex,
|
7294
|
+
getInputProps,
|
7295
|
+
getMenuProps,
|
7296
|
+
getToggleButtonProps,
|
7297
|
+
getItemProps
|
7298
|
+
} = useCombobox2({
|
7128
7299
|
id,
|
7129
7300
|
inputValue,
|
7130
|
-
|
7301
|
+
defaultSelectedItem: defaultValue,
|
7131
7302
|
selectedItem: null,
|
7132
7303
|
items: filteredOptions,
|
7133
7304
|
stateReducer: (_, actionChanges) => {
|
@@ -7167,15 +7338,16 @@ var MultiSelectBase = (_a) => {
|
|
7167
7338
|
shouldFlip: true,
|
7168
7339
|
isOpen
|
7169
7340
|
});
|
7170
|
-
const inputProps = getInputProps(getDropdownProps({
|
7341
|
+
const inputProps = getInputProps(getDropdownProps({ disabled: disabled || readOnly }));
|
7171
7342
|
const renderChips = () => {
|
7172
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7343
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React69.createElement(InputChip, __spreadProps(__spreadValues({
|
7173
7344
|
key: `${itemToString(selectedItem)}.chip`,
|
7174
7345
|
className: tw("mx-0"),
|
7175
7346
|
disabled,
|
7176
7347
|
readOnly
|
7177
7348
|
}, getSelectedItemProps({ selectedItem, index })), {
|
7178
7349
|
onClick: (e) => {
|
7350
|
+
e.preventDefault();
|
7179
7351
|
e.stopPropagation();
|
7180
7352
|
removeSelectedItem(selectedItem);
|
7181
7353
|
}
|
@@ -7184,14 +7356,14 @@ var MultiSelectBase = (_a) => {
|
|
7184
7356
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7185
7357
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
7186
7358
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7187
|
-
return /* @__PURE__ */
|
7359
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
7188
7360
|
className: tw("relative")
|
7189
|
-
}, /* @__PURE__ */
|
7361
|
+
}, /* @__PURE__ */ React69.createElement(Select.InputContainer, {
|
7190
7362
|
ref: targetRef,
|
7191
7363
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7192
|
-
}, /* @__PURE__ */
|
7364
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
7193
7365
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7194
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7366
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React69.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7195
7367
|
id,
|
7196
7368
|
name,
|
7197
7369
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
@@ -7199,6 +7371,7 @@ var MultiSelectBase = (_a) => {
|
|
7199
7371
|
}, inputProps), props), {
|
7200
7372
|
disabled,
|
7201
7373
|
readOnly,
|
7374
|
+
onClick: readOnly ? void 0 : openMenu,
|
7202
7375
|
onKeyDown: (e) => {
|
7203
7376
|
var _a3;
|
7204
7377
|
e.stopPropagation();
|
@@ -7206,28 +7379,33 @@ var MultiSelectBase = (_a) => {
|
|
7206
7379
|
},
|
7207
7380
|
onKeyUp: (e) => e.stopPropagation(),
|
7208
7381
|
onFocus: () => setFocus(true),
|
7209
|
-
onBlur: () =>
|
7210
|
-
|
7382
|
+
onBlur: (e) => {
|
7383
|
+
var _a3;
|
7384
|
+
setFocus(false);
|
7385
|
+
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
7386
|
+
}
|
7387
|
+
}))), !readOnly && /* @__PURE__ */ React69.createElement(Select.Toggle, __spreadValues({
|
7211
7388
|
hasFocus,
|
7212
7389
|
isOpen
|
7213
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7390
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React69.createElement("div", {
|
7214
7391
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7215
|
-
}, renderChips()), /* @__PURE__ */
|
7392
|
+
}, renderChips()), /* @__PURE__ */ React69.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7216
7393
|
isOpen: true,
|
7217
7394
|
isDismissable: true,
|
7218
7395
|
autoFocus: true
|
7219
7396
|
}, getMenuProps({ ref: overlayRef })), {
|
7220
7397
|
style,
|
7221
|
-
onClose: closeMenu
|
7222
|
-
|
7398
|
+
onClose: closeMenu,
|
7399
|
+
className: tw("overflow-y-auto")
|
7400
|
+
}), /* @__PURE__ */ React69.createElement(Select.Menu, {
|
7223
7401
|
maxHeight
|
7224
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
7402
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React69.createElement(Select.NoResults, null, noResults), isOpen && filteredOptions.map((item, index) => /* @__PURE__ */ React69.createElement(Select.Item, __spreadValues({
|
7225
7403
|
key: itemToString(item),
|
7226
7404
|
highlighted: index === highlightedIndex,
|
7227
7405
|
selected: selectedItems.includes(item)
|
7228
7406
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7229
7407
|
};
|
7230
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7408
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React69.createElement(Skeleton, {
|
7231
7409
|
height: 38
|
7232
7410
|
});
|
7233
7411
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7244,12 +7422,12 @@ var MultiSelect = (_a) => {
|
|
7244
7422
|
const errorMessageId = uniqueId5();
|
7245
7423
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7246
7424
|
const labelControlProps = getLabelControlProps(props);
|
7247
|
-
const baseProps =
|
7248
|
-
return /* @__PURE__ */
|
7425
|
+
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7426
|
+
return /* @__PURE__ */ React69.createElement(LabelControl, __spreadValues({
|
7249
7427
|
id: `${id.current}-label`,
|
7250
7428
|
htmlFor: `${id.current}-input`,
|
7251
7429
|
messageId: errorMessageId
|
7252
|
-
}, labelControlProps), /* @__PURE__ */
|
7430
|
+
}, labelControlProps), /* @__PURE__ */ React69.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7253
7431
|
id: id.current,
|
7254
7432
|
options,
|
7255
7433
|
noResults,
|
@@ -7257,16 +7435,16 @@ var MultiSelect = (_a) => {
|
|
7257
7435
|
valid: props.valid
|
7258
7436
|
})));
|
7259
7437
|
};
|
7260
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7438
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React69.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React69.createElement(MultiSelectBase.Skeleton, null));
|
7261
7439
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7262
7440
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7263
7441
|
|
7264
7442
|
// src/components/NativeSelect/NativeSelect.tsx
|
7265
|
-
import
|
7266
|
-
import
|
7443
|
+
import React70, { useRef as useRef9 } from "react";
|
7444
|
+
import omit13 from "lodash/omit";
|
7267
7445
|
import uniqueId6 from "lodash/uniqueId";
|
7268
7446
|
var import_caretDown = __toESM(require_caretDown());
|
7269
|
-
var NativeSelectBase =
|
7447
|
+
var NativeSelectBase = React70.forwardRef(
|
7270
7448
|
(_a, ref) => {
|
7271
7449
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7272
7450
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7283,16 +7461,16 @@ var NativeSelectBase = React68.forwardRef(
|
|
7283
7461
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7284
7462
|
}
|
7285
7463
|
};
|
7286
|
-
return /* @__PURE__ */
|
7464
|
+
return /* @__PURE__ */ React70.createElement("span", {
|
7287
7465
|
className: tw("relative block")
|
7288
|
-
}, !readOnly && /* @__PURE__ */
|
7466
|
+
}, !readOnly && /* @__PURE__ */ React70.createElement("span", {
|
7289
7467
|
className: tw(
|
7290
7468
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7291
7469
|
)
|
7292
|
-
}, /* @__PURE__ */
|
7470
|
+
}, /* @__PURE__ */ React70.createElement(Icon, {
|
7293
7471
|
icon: import_caretDown.default,
|
7294
7472
|
"data-testid": "icon-dropdown"
|
7295
|
-
})), /* @__PURE__ */
|
7473
|
+
})), /* @__PURE__ */ React70.createElement("select", __spreadProps(__spreadValues({
|
7296
7474
|
ref,
|
7297
7475
|
disabled: disabled || readOnly,
|
7298
7476
|
required
|
@@ -7311,16 +7489,16 @@ var NativeSelectBase = React68.forwardRef(
|
|
7311
7489
|
),
|
7312
7490
|
props.className
|
7313
7491
|
)
|
7314
|
-
}), props.placeholder && /* @__PURE__ */
|
7492
|
+
}), props.placeholder && /* @__PURE__ */ React70.createElement("option", {
|
7315
7493
|
value: placeholderValue,
|
7316
7494
|
disabled: true
|
7317
7495
|
}, props.placeholder), children));
|
7318
7496
|
}
|
7319
7497
|
);
|
7320
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7498
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React70.createElement(Skeleton, {
|
7321
7499
|
height: 38
|
7322
7500
|
});
|
7323
|
-
var NativeSelect =
|
7501
|
+
var NativeSelect = React70.forwardRef(
|
7324
7502
|
(_a, ref) => {
|
7325
7503
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7326
7504
|
var _a2;
|
@@ -7328,12 +7506,12 @@ var NativeSelect = React68.forwardRef(
|
|
7328
7506
|
const errorMessageId = uniqueId6();
|
7329
7507
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7330
7508
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7331
|
-
const baseProps =
|
7332
|
-
return /* @__PURE__ */
|
7509
|
+
const baseProps = omit13(props, Object.keys(labelControlProps));
|
7510
|
+
return /* @__PURE__ */ React70.createElement(LabelControl, __spreadValues({
|
7333
7511
|
id: `${id.current}-label`,
|
7334
7512
|
htmlFor: id.current,
|
7335
7513
|
messageId: errorMessageId
|
7336
|
-
}, labelControlProps), /* @__PURE__ */
|
7514
|
+
}, labelControlProps), /* @__PURE__ */ React70.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7337
7515
|
ref
|
7338
7516
|
}, baseProps), errorProps), {
|
7339
7517
|
id: id.current,
|
@@ -7346,22 +7524,22 @@ var NativeSelect = React68.forwardRef(
|
|
7346
7524
|
})));
|
7347
7525
|
}
|
7348
7526
|
);
|
7349
|
-
var Option =
|
7527
|
+
var Option = React70.forwardRef((_a, ref) => {
|
7350
7528
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7351
|
-
return /* @__PURE__ */
|
7529
|
+
return /* @__PURE__ */ React70.createElement("option", __spreadValues({
|
7352
7530
|
ref
|
7353
7531
|
}, props), children);
|
7354
7532
|
});
|
7355
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
7533
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React70.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React70.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React70.createElement("div", {
|
7356
7534
|
style: { height: "1px" }
|
7357
7535
|
}));
|
7358
7536
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7359
7537
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7360
7538
|
|
7361
7539
|
// src/components/PageHeader/PageHeader.tsx
|
7362
|
-
import
|
7540
|
+
import React71 from "react";
|
7363
7541
|
import castArray3 from "lodash/castArray";
|
7364
|
-
import
|
7542
|
+
import omit14 from "lodash/omit";
|
7365
7543
|
var PageHeader = ({
|
7366
7544
|
title,
|
7367
7545
|
image,
|
@@ -7371,54 +7549,54 @@ var PageHeader = ({
|
|
7371
7549
|
chips = [],
|
7372
7550
|
breadcrumbs
|
7373
7551
|
}) => {
|
7374
|
-
return /* @__PURE__ */
|
7552
|
+
return /* @__PURE__ */ React71.createElement(Flexbox, {
|
7375
7553
|
direction: "row",
|
7376
7554
|
gap: "4",
|
7377
7555
|
paddingBottom: "6"
|
7378
|
-
}, /* @__PURE__ */
|
7556
|
+
}, /* @__PURE__ */ React71.createElement(Flexbox, {
|
7379
7557
|
className: tw("grow"),
|
7380
7558
|
direction: "column",
|
7381
7559
|
gap: "0"
|
7382
|
-
}, breadcrumbs && /* @__PURE__ */
|
7560
|
+
}, breadcrumbs && /* @__PURE__ */ React71.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React71.createElement(Flexbox, {
|
7383
7561
|
gap: "5"
|
7384
|
-
}, image && /* @__PURE__ */
|
7562
|
+
}, image && /* @__PURE__ */ React71.createElement("img", {
|
7385
7563
|
src: image,
|
7386
7564
|
alt: imageAlt,
|
7387
7565
|
className: tw("w-[56px] h-[56px]")
|
7388
|
-
}), /* @__PURE__ */
|
7566
|
+
}), /* @__PURE__ */ React71.createElement(Flexbox, {
|
7389
7567
|
direction: "column",
|
7390
7568
|
justifyContent: "center"
|
7391
|
-
}, /* @__PURE__ */
|
7569
|
+
}, /* @__PURE__ */ React71.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React71.createElement(Flexbox, {
|
7392
7570
|
gap: "3"
|
7393
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7571
|
+
}, chips.map((chip) => /* @__PURE__ */ React71.createElement(Chip2, {
|
7394
7572
|
key: chip,
|
7395
7573
|
dense: true,
|
7396
7574
|
text: chip
|
7397
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7575
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React71.createElement(Flexbox, {
|
7398
7576
|
gap: "4",
|
7399
7577
|
className: tw("self-start")
|
7400
7578
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7401
7579
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7402
|
-
return /* @__PURE__ */
|
7580
|
+
return /* @__PURE__ */ React71.createElement(SecondaryButton, __spreadValues({
|
7403
7581
|
key: text
|
7404
7582
|
}, action), text);
|
7405
|
-
}), primaryAction && /* @__PURE__ */
|
7583
|
+
}), primaryAction && /* @__PURE__ */ React71.createElement(PrimaryButton, __spreadValues({
|
7406
7584
|
key: primaryAction.text
|
7407
|
-
},
|
7585
|
+
}, omit14(primaryAction, "text")), primaryAction.text)));
|
7408
7586
|
};
|
7409
7587
|
|
7410
7588
|
// src/components/Pagination/Pagination.tsx
|
7411
|
-
import
|
7589
|
+
import React73 from "react";
|
7412
7590
|
import clamp from "lodash/clamp";
|
7413
7591
|
|
7414
7592
|
// src/components/Select/Select.tsx
|
7415
|
-
import
|
7593
|
+
import React72, { useRef as useRef10, useState as useState10 } from "react";
|
7416
7594
|
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7417
7595
|
import { useSelect } from "downshift";
|
7418
7596
|
import defaults from "lodash/defaults";
|
7419
7597
|
import isArray from "lodash/isArray";
|
7420
7598
|
import isNil2 from "lodash/isNil";
|
7421
|
-
import
|
7599
|
+
import omit15 from "lodash/omit";
|
7422
7600
|
import uniqueId7 from "lodash/uniqueId";
|
7423
7601
|
var hasIconProperty = (val) => {
|
7424
7602
|
var _a;
|
@@ -7429,10 +7607,10 @@ var hasOptionGroups = (val) => {
|
|
7429
7607
|
};
|
7430
7608
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7431
7609
|
var _a, _b;
|
7432
|
-
return /* @__PURE__ */
|
7610
|
+
return /* @__PURE__ */ React72.createElement(Select.Item, __spreadValues({
|
7433
7611
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7434
7612
|
selected: item === selectedItem
|
7435
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7613
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React72.createElement(InlineIcon, {
|
7436
7614
|
icon: item.icon
|
7437
7615
|
}), optionToString(item));
|
7438
7616
|
};
|
@@ -7549,13 +7727,13 @@ var _SelectBase = (props) => {
|
|
7549
7727
|
},
|
7550
7728
|
withDefaults
|
7551
7729
|
);
|
7552
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7730
|
+
const renderGroup = (group) => /* @__PURE__ */ React72.createElement(React72.Fragment, {
|
7553
7731
|
key: group.label
|
7554
|
-
}, /* @__PURE__ */
|
7555
|
-
const input = /* @__PURE__ */
|
7732
|
+
}, /* @__PURE__ */ React72.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7733
|
+
const input = /* @__PURE__ */ React72.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7556
7734
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7557
7735
|
tabIndex: 0
|
7558
|
-
}), /* @__PURE__ */
|
7736
|
+
}), /* @__PURE__ */ React72.createElement(Select.Input, __spreadProps(__spreadValues({
|
7559
7737
|
id,
|
7560
7738
|
name
|
7561
7739
|
}, rest), {
|
@@ -7567,27 +7745,28 @@ var _SelectBase = (props) => {
|
|
7567
7745
|
tabIndex: -1,
|
7568
7746
|
onFocus: () => setFocus(true),
|
7569
7747
|
onBlur: () => setFocus(false)
|
7570
|
-
})), !readOnly && /* @__PURE__ */
|
7748
|
+
})), !readOnly && /* @__PURE__ */ React72.createElement(Select.Toggle, {
|
7571
7749
|
disabled,
|
7572
7750
|
isOpen,
|
7573
7751
|
tabIndex: -1
|
7574
7752
|
}));
|
7575
7753
|
const width = (_b = targetRef.current) == null ? void 0 : _b.offsetWidth;
|
7576
7754
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7577
|
-
return /* @__PURE__ */
|
7755
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
7578
7756
|
className: tw("relative")
|
7579
|
-
}, labelWrapper ?
|
7757
|
+
}, labelWrapper ? React72.cloneElement(labelWrapper, { children: input }) : input, /* @__PURE__ */ React72.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7580
7758
|
isOpen: true,
|
7581
7759
|
isDismissable: true,
|
7582
7760
|
autoFocus: true
|
7583
7761
|
}, getMenuProps({ ref: overlayRef })), {
|
7584
7762
|
style,
|
7585
|
-
onClose: closeMenu
|
7586
|
-
|
7763
|
+
onClose: closeMenu,
|
7764
|
+
className: tw("overflow-y-auto")
|
7765
|
+
}), /* @__PURE__ */ React72.createElement(Select.Menu, {
|
7587
7766
|
maxHeight
|
7588
|
-
}, isOpen && options.length === 0 && /* @__PURE__ */
|
7767
|
+
}, isOpen && options.length === 0 && /* @__PURE__ */ React72.createElement(Select.EmptyStateContainer, null, emptyState), isOpen && options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), isOpen && options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), isOpen && actions.length > 0 && /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(Select.Divider, {
|
7589
7768
|
onMouseOver: () => setHighlightedIndex(-1)
|
7590
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7769
|
+
}), actions.map((act, index) => /* @__PURE__ */ React72.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7591
7770
|
key: `${index}`
|
7592
7771
|
}, act), {
|
7593
7772
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7597,10 +7776,10 @@ var _SelectBase = (props) => {
|
|
7597
7776
|
}
|
7598
7777
|
}), act.label))))));
|
7599
7778
|
};
|
7600
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7779
|
+
var SelectBase = (props) => /* @__PURE__ */ React72.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7601
7780
|
labelWrapper: void 0
|
7602
7781
|
}));
|
7603
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7782
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React72.createElement(Skeleton, {
|
7604
7783
|
height: 38
|
7605
7784
|
});
|
7606
7785
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7615,22 +7794,22 @@ var Select2 = (_a) => {
|
|
7615
7794
|
const errorMessageId = uniqueId7();
|
7616
7795
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7617
7796
|
const labelProps = getLabelControlProps(props);
|
7618
|
-
const baseProps =
|
7797
|
+
const baseProps = omit15(props, Object.keys(labelProps));
|
7619
7798
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7620
7799
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7621
|
-
const label = /* @__PURE__ */
|
7800
|
+
const label = /* @__PURE__ */ React72.createElement(Label, __spreadValues({
|
7622
7801
|
id: `${id.current}-label`,
|
7623
7802
|
htmlFor: `${id.current}-input`,
|
7624
7803
|
variant,
|
7625
7804
|
messageId: errorMessageId
|
7626
7805
|
}, labelProps));
|
7627
|
-
return /* @__PURE__ */
|
7806
|
+
return /* @__PURE__ */ React72.createElement(FormControl, null, /* @__PURE__ */ React72.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7628
7807
|
id: `${id.current}-input`,
|
7629
7808
|
options,
|
7630
7809
|
disabled: props.disabled,
|
7631
7810
|
valid: props.valid,
|
7632
7811
|
labelWrapper: label
|
7633
|
-
})), /* @__PURE__ */
|
7812
|
+
})), /* @__PURE__ */ React72.createElement(HelperText, {
|
7634
7813
|
messageId: errorMessageId,
|
7635
7814
|
error: !labelProps.valid,
|
7636
7815
|
helperText: labelProps.helperText,
|
@@ -7639,7 +7818,7 @@ var Select2 = (_a) => {
|
|
7639
7818
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7640
7819
|
}));
|
7641
7820
|
};
|
7642
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7821
|
+
var SelectSkeleton = () => /* @__PURE__ */ React72.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React72.createElement(SelectBase.Skeleton, null));
|
7643
7822
|
Select2.Skeleton = SelectSkeleton;
|
7644
7823
|
|
7645
7824
|
// src/components/Pagination/Pagination.tsx
|
@@ -7657,25 +7836,25 @@ var Pagination = ({
|
|
7657
7836
|
pageSizes,
|
7658
7837
|
onPageSizeChange
|
7659
7838
|
}) => {
|
7660
|
-
const [value, setValue] =
|
7661
|
-
|
7839
|
+
const [value, setValue] = React73.useState(currentPage);
|
7840
|
+
React73.useEffect(() => {
|
7662
7841
|
setValue(currentPage);
|
7663
7842
|
}, [currentPage]);
|
7664
|
-
|
7843
|
+
React73.useEffect(() => {
|
7665
7844
|
onPageChange(1);
|
7666
7845
|
setValue(1);
|
7667
7846
|
}, [pageSize]);
|
7668
|
-
return /* @__PURE__ */
|
7847
|
+
return /* @__PURE__ */ React73.createElement(Box, {
|
7669
7848
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7670
7849
|
backgroundColor: "grey-0",
|
7671
7850
|
padding: "4"
|
7672
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
7851
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React73.createElement(Box, {
|
7673
7852
|
display: "flex",
|
7674
7853
|
alignItems: "center",
|
7675
7854
|
gap: "4"
|
7676
|
-
}, /* @__PURE__ */
|
7855
|
+
}, /* @__PURE__ */ React73.createElement(Typography2.SmallText, null, "Items per page "), /* @__PURE__ */ React73.createElement("div", {
|
7677
7856
|
className: tw("max-w-[70px]")
|
7678
|
-
}, /* @__PURE__ */
|
7857
|
+
}, /* @__PURE__ */ React73.createElement(SelectBase, {
|
7679
7858
|
options: pageSizes.map((size) => size.toString()),
|
7680
7859
|
value: pageSize.toString(),
|
7681
7860
|
onChange: (size) => {
|
@@ -7686,24 +7865,24 @@ var Pagination = ({
|
|
7686
7865
|
}
|
7687
7866
|
}
|
7688
7867
|
}
|
7689
|
-
}))) : /* @__PURE__ */
|
7868
|
+
}))) : /* @__PURE__ */ React73.createElement("div", null), /* @__PURE__ */ React73.createElement(Box, {
|
7690
7869
|
display: "flex",
|
7691
7870
|
justifyContent: "center",
|
7692
7871
|
alignItems: "center",
|
7693
7872
|
className: tw("grow")
|
7694
|
-
}, /* @__PURE__ */
|
7873
|
+
}, /* @__PURE__ */ React73.createElement(IconButton, {
|
7695
7874
|
"aria-label": "First",
|
7696
7875
|
onClick: () => onPageChange(1),
|
7697
7876
|
icon: import_chevronBackward.default,
|
7698
7877
|
disabled: !hasPreviousPage
|
7699
|
-
}), /* @__PURE__ */
|
7878
|
+
}), /* @__PURE__ */ React73.createElement(IconButton, {
|
7700
7879
|
"aria-label": "Previous",
|
7701
7880
|
onClick: () => onPageChange(currentPage - 1),
|
7702
7881
|
icon: import_chevronLeft3.default,
|
7703
7882
|
disabled: !hasPreviousPage
|
7704
|
-
}), /* @__PURE__ */
|
7883
|
+
}), /* @__PURE__ */ React73.createElement(Box, {
|
7705
7884
|
paddingX: "4"
|
7706
|
-
}, /* @__PURE__ */
|
7885
|
+
}, /* @__PURE__ */ React73.createElement(Typography2.SmallText, null, "Page")), /* @__PURE__ */ React73.createElement(InputBase, {
|
7707
7886
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
7708
7887
|
type: "number",
|
7709
7888
|
min: 1,
|
@@ -7726,43 +7905,43 @@ var Pagination = ({
|
|
7726
7905
|
setValue(1);
|
7727
7906
|
}
|
7728
7907
|
}
|
7729
|
-
}), /* @__PURE__ */
|
7908
|
+
}), /* @__PURE__ */ React73.createElement(Box, {
|
7730
7909
|
paddingX: "4"
|
7731
|
-
}, /* @__PURE__ */
|
7910
|
+
}, /* @__PURE__ */ React73.createElement(Typography2.SmallText, null, "of ", totalPages)), /* @__PURE__ */ React73.createElement(IconButton, {
|
7732
7911
|
"aria-label": "Next",
|
7733
7912
|
onClick: () => onPageChange(currentPage + 1),
|
7734
7913
|
icon: import_chevronRight3.default,
|
7735
7914
|
disabled: !hasNextPage
|
7736
|
-
}), /* @__PURE__ */
|
7915
|
+
}), /* @__PURE__ */ React73.createElement(IconButton, {
|
7737
7916
|
"aria-label": "Last",
|
7738
7917
|
onClick: () => onPageChange(totalPages),
|
7739
7918
|
icon: import_chevronForward.default,
|
7740
7919
|
disabled: !hasNextPage
|
7741
|
-
})), /* @__PURE__ */
|
7920
|
+
})), /* @__PURE__ */ React73.createElement("div", null));
|
7742
7921
|
};
|
7743
7922
|
|
7744
7923
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
7745
|
-
import
|
7746
|
-
import
|
7924
|
+
import React75 from "react";
|
7925
|
+
import omit16 from "lodash/omit";
|
7747
7926
|
|
7748
7927
|
// src/common/PopoverDialog/PopoverDialog.tsx
|
7749
|
-
import
|
7928
|
+
import React74 from "react";
|
7750
7929
|
var Header = (_a) => {
|
7751
7930
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7752
|
-
return /* @__PURE__ */
|
7931
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7753
7932
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
7754
7933
|
}), children);
|
7755
7934
|
};
|
7756
7935
|
var Title = (_a) => {
|
7757
7936
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7758
|
-
return /* @__PURE__ */
|
7937
|
+
return /* @__PURE__ */ React74.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7759
7938
|
htmlTag: "h1",
|
7760
7939
|
variant: "small-strong"
|
7761
7940
|
}), children);
|
7762
7941
|
};
|
7763
7942
|
var Body = (_a) => {
|
7764
7943
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7765
|
-
return /* @__PURE__ */
|
7944
|
+
return /* @__PURE__ */ React74.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7766
7945
|
htmlTag: "div",
|
7767
7946
|
variant: "caption",
|
7768
7947
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -7770,13 +7949,13 @@ var Body = (_a) => {
|
|
7770
7949
|
};
|
7771
7950
|
var Footer = (_a) => {
|
7772
7951
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7773
|
-
return /* @__PURE__ */
|
7952
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7774
7953
|
className: classNames(tw("p-5"), className)
|
7775
7954
|
}), children);
|
7776
7955
|
};
|
7777
|
-
var
|
7956
|
+
var Actions2 = (_a) => {
|
7778
7957
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7779
|
-
return /* @__PURE__ */
|
7958
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7780
7959
|
className: classNames(tw("flex gap-4"), className)
|
7781
7960
|
}), children);
|
7782
7961
|
};
|
@@ -7785,28 +7964,28 @@ var PopoverDialog = {
|
|
7785
7964
|
Title,
|
7786
7965
|
Body,
|
7787
7966
|
Footer,
|
7788
|
-
Actions
|
7967
|
+
Actions: Actions2
|
7789
7968
|
};
|
7790
7969
|
|
7791
7970
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
7792
7971
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
7793
7972
|
const wrapPromptWithBody = (child) => {
|
7794
7973
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
7795
|
-
return /* @__PURE__ */
|
7974
|
+
return /* @__PURE__ */ React75.createElement(Popover2.Panel, {
|
7796
7975
|
className: tw("max-w-[300px]")
|
7797
|
-
}, /* @__PURE__ */
|
7976
|
+
}, /* @__PURE__ */ React75.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React75.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React75.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React75.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React75.createElement(Popover2.Button, __spreadValues({
|
7798
7977
|
kind: "secondary-ghost",
|
7799
7978
|
key: secondaryAction.text,
|
7800
7979
|
dense: true
|
7801
|
-
},
|
7980
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React75.createElement(Popover2.Button, __spreadValues({
|
7802
7981
|
kind: "ghost",
|
7803
7982
|
key: primaryAction.text,
|
7804
7983
|
dense: true
|
7805
|
-
},
|
7984
|
+
}, omit16(primaryAction, "text")), primaryAction.text))));
|
7806
7985
|
}
|
7807
7986
|
return child;
|
7808
7987
|
};
|
7809
|
-
return /* @__PURE__ */
|
7988
|
+
return /* @__PURE__ */ React75.createElement(Popover2, {
|
7810
7989
|
type: "dialog",
|
7811
7990
|
isOpen: open,
|
7812
7991
|
placement,
|
@@ -7814,10 +7993,10 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
7814
7993
|
isKeyboardDismissDisabled: false,
|
7815
7994
|
autoFocus: true,
|
7816
7995
|
containFocus: true
|
7817
|
-
},
|
7996
|
+
}, React75.Children.map(children, wrapPromptWithBody));
|
7818
7997
|
};
|
7819
7998
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
7820
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
7999
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React75.createElement(PopoverDialog.Body, null, children);
|
7821
8000
|
Prompt.displayName = "PopoverDialog.Prompt";
|
7822
8001
|
PopoverDialog2.Prompt = Prompt;
|
7823
8002
|
|
@@ -7826,14 +8005,14 @@ import { createPortal } from "react-dom";
|
|
7826
8005
|
var Portal = ({ children, to }) => createPortal(children, to);
|
7827
8006
|
|
7828
8007
|
// src/components/ProgressBar/ProgressBar.tsx
|
7829
|
-
import
|
8008
|
+
import React77 from "react";
|
7830
8009
|
|
7831
8010
|
// src/common/ProgressBar/ProgressBar.tsx
|
7832
|
-
import
|
8011
|
+
import React76 from "react";
|
7833
8012
|
import clamp2 from "lodash/clamp";
|
7834
8013
|
var ProgressBar = (_a) => {
|
7835
8014
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7836
|
-
return /* @__PURE__ */
|
8015
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7837
8016
|
className: classNames(
|
7838
8017
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
7839
8018
|
className
|
@@ -7849,7 +8028,7 @@ var STATUS_COLORS = {
|
|
7849
8028
|
ProgressBar.Indicator = (_a) => {
|
7850
8029
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
7851
8030
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
7852
|
-
return /* @__PURE__ */
|
8031
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7853
8032
|
className: classNames(
|
7854
8033
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
7855
8034
|
STATUS_COLORS[status],
|
@@ -7865,11 +8044,11 @@ ProgressBar.Indicator = (_a) => {
|
|
7865
8044
|
};
|
7866
8045
|
ProgressBar.Labels = (_a) => {
|
7867
8046
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
7868
|
-
return /* @__PURE__ */
|
8047
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
7869
8048
|
className: classNames(tw("flex flex-row"), className)
|
7870
|
-
}, /* @__PURE__ */
|
8049
|
+
}, /* @__PURE__ */ React76.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
7871
8050
|
className: tw("grow text-grey-70 typography-caption")
|
7872
|
-
}), startLabel), /* @__PURE__ */
|
8051
|
+
}), startLabel), /* @__PURE__ */ React76.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
7873
8052
|
className: tw("grow text-grey-70 typography-caption text-right")
|
7874
8053
|
}), endLabel));
|
7875
8054
|
};
|
@@ -7887,7 +8066,7 @@ var ProgressBar2 = (props) => {
|
|
7887
8066
|
if (min > max) {
|
7888
8067
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
7889
8068
|
}
|
7890
|
-
const progress = /* @__PURE__ */
|
8069
|
+
const progress = /* @__PURE__ */ React77.createElement(ProgressBar, null, /* @__PURE__ */ React77.createElement(ProgressBar.Indicator, {
|
7891
8070
|
status: value === max ? completedStatus : progresStatus,
|
7892
8071
|
min,
|
7893
8072
|
max,
|
@@ -7897,25 +8076,25 @@ var ProgressBar2 = (props) => {
|
|
7897
8076
|
if (props.dense) {
|
7898
8077
|
return progress;
|
7899
8078
|
}
|
7900
|
-
return /* @__PURE__ */
|
8079
|
+
return /* @__PURE__ */ React77.createElement("div", null, progress, /* @__PURE__ */ React77.createElement(ProgressBar.Labels, {
|
7901
8080
|
className: tw("py-2"),
|
7902
8081
|
startLabel: props.startLabel,
|
7903
8082
|
endLabel: props.endLabel
|
7904
8083
|
}));
|
7905
8084
|
};
|
7906
|
-
ProgressBar2.Skeleton = () => /* @__PURE__ */
|
8085
|
+
ProgressBar2.Skeleton = () => /* @__PURE__ */ React77.createElement(Skeleton, {
|
7907
8086
|
height: 4,
|
7908
8087
|
display: "block"
|
7909
8088
|
});
|
7910
8089
|
|
7911
8090
|
// src/components/RadioButton/RadioButton.tsx
|
7912
|
-
import
|
7913
|
-
var RadioButton2 =
|
8091
|
+
import React78 from "react";
|
8092
|
+
var RadioButton2 = React78.forwardRef(
|
7914
8093
|
(_a, ref) => {
|
7915
8094
|
var _b = _a, { name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["name", "id", "readOnly", "disabled", "caption", "children", "aria-label"]);
|
7916
8095
|
var _a2;
|
7917
8096
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
7918
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8097
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React78.createElement(ControlLabel, {
|
7919
8098
|
htmlFor: id,
|
7920
8099
|
label: children,
|
7921
8100
|
"aria-label": ariaLabel,
|
@@ -7923,7 +8102,7 @@ var RadioButton2 = React76.forwardRef(
|
|
7923
8102
|
readOnly,
|
7924
8103
|
disabled,
|
7925
8104
|
style: { gap: "0 8px" }
|
7926
|
-
}, !readOnly && /* @__PURE__ */
|
8105
|
+
}, !readOnly && /* @__PURE__ */ React78.createElement(RadioButton, __spreadProps(__spreadValues({
|
7927
8106
|
id,
|
7928
8107
|
ref,
|
7929
8108
|
name
|
@@ -7933,22 +8112,22 @@ var RadioButton2 = React76.forwardRef(
|
|
7933
8112
|
}))) : null;
|
7934
8113
|
}
|
7935
8114
|
);
|
7936
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
8115
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React78.createElement("div", {
|
7937
8116
|
className: tw("flex gap-3")
|
7938
|
-
}, /* @__PURE__ */
|
8117
|
+
}, /* @__PURE__ */ React78.createElement(Skeleton, {
|
7939
8118
|
height: 20,
|
7940
8119
|
width: 20
|
7941
|
-
}), /* @__PURE__ */
|
8120
|
+
}), /* @__PURE__ */ React78.createElement(Skeleton, {
|
7942
8121
|
height: 20,
|
7943
8122
|
width: 150
|
7944
8123
|
}));
|
7945
8124
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
7946
8125
|
|
7947
8126
|
// src/components/RadioButtonGroup/RadioButtonGroup.tsx
|
7948
|
-
import
|
8127
|
+
import React79 from "react";
|
7949
8128
|
import uniqueId8 from "lodash/uniqueId";
|
7950
8129
|
var isRadioButton = (c) => {
|
7951
|
-
return
|
8130
|
+
return React79.isValidElement(c) && c.type === RadioButton2;
|
7952
8131
|
};
|
7953
8132
|
var RadioButtonGroup = (_a) => {
|
7954
8133
|
var _b = _a, {
|
@@ -7971,7 +8150,7 @@ var RadioButtonGroup = (_a) => {
|
|
7971
8150
|
"children"
|
7972
8151
|
]);
|
7973
8152
|
var _a2;
|
7974
|
-
const [value, setValue] =
|
8153
|
+
const [value, setValue] = React79.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
7975
8154
|
const errorMessageId = uniqueId8();
|
7976
8155
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7977
8156
|
const labelControlProps = getLabelControlProps(props);
|
@@ -7982,14 +8161,14 @@ var RadioButtonGroup = (_a) => {
|
|
7982
8161
|
setValue(e.target.value);
|
7983
8162
|
onChange == null ? void 0 : onChange(e.target.value);
|
7984
8163
|
};
|
7985
|
-
const content =
|
8164
|
+
const content = React79.Children.map(children, (c) => {
|
7986
8165
|
var _a3, _b2, _c;
|
7987
8166
|
if (!isRadioButton(c)) {
|
7988
8167
|
return null;
|
7989
8168
|
}
|
7990
8169
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
7991
8170
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
7992
|
-
return
|
8171
|
+
return React79.cloneElement(c, {
|
7993
8172
|
name,
|
7994
8173
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
7995
8174
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -7998,11 +8177,11 @@ var RadioButtonGroup = (_a) => {
|
|
7998
8177
|
readOnly
|
7999
8178
|
});
|
8000
8179
|
});
|
8001
|
-
return /* @__PURE__ */
|
8180
|
+
return /* @__PURE__ */ React79.createElement(LabelControl, __spreadValues(__spreadValues({
|
8002
8181
|
fieldset: true
|
8003
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
8182
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React79.createElement(InputGroup, {
|
8004
8183
|
cols
|
8005
|
-
}, content), !cols && /* @__PURE__ */
|
8184
|
+
}, content), !cols && /* @__PURE__ */ React79.createElement(Flexbox, {
|
8006
8185
|
direction,
|
8007
8186
|
alignItems: "flex-start",
|
8008
8187
|
colGap: "8",
|
@@ -8011,80 +8190,80 @@ var RadioButtonGroup = (_a) => {
|
|
8011
8190
|
}, content));
|
8012
8191
|
};
|
8013
8192
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
8014
|
-
return /* @__PURE__ */
|
8193
|
+
return /* @__PURE__ */ React79.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React79.createElement("div", {
|
8015
8194
|
className: tw("flex flex-wrap", {
|
8016
8195
|
"flex-row gap-8": direction === "row",
|
8017
8196
|
"flex-col gap-2": direction === "column"
|
8018
8197
|
})
|
8019
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8198
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React79.createElement(RadioButton2.Skeleton, {
|
8020
8199
|
key
|
8021
8200
|
}))));
|
8022
8201
|
};
|
8023
8202
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
8024
8203
|
|
8025
8204
|
// src/components/Section/Section.tsx
|
8026
|
-
import
|
8205
|
+
import React81 from "react";
|
8027
8206
|
import castArray4 from "lodash/castArray";
|
8028
8207
|
|
8029
8208
|
// src/common/Section/Section.tsx
|
8030
|
-
import
|
8209
|
+
import React80 from "react";
|
8031
8210
|
var Section2 = (_a) => {
|
8032
8211
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8033
|
-
return /* @__PURE__ */
|
8212
|
+
return /* @__PURE__ */ React80.createElement(Box, __spreadValues({
|
8034
8213
|
borderColor: "grey-5",
|
8035
8214
|
borderWidth: "1px"
|
8036
8215
|
}, rest), children);
|
8037
8216
|
};
|
8038
8217
|
Section2.Header = (_a) => {
|
8039
8218
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8040
|
-
return /* @__PURE__ */
|
8219
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8041
8220
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8042
8221
|
}), children);
|
8043
8222
|
};
|
8044
8223
|
Section2.TitleContainer = (_a) => {
|
8045
8224
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8046
|
-
return /* @__PURE__ */
|
8225
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8047
8226
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8048
8227
|
}), children);
|
8049
8228
|
};
|
8050
8229
|
Section2.Title = (_a) => {
|
8051
8230
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8052
|
-
return /* @__PURE__ */
|
8231
|
+
return /* @__PURE__ */ React80.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8053
8232
|
color: "black"
|
8054
8233
|
}), children);
|
8055
8234
|
};
|
8056
8235
|
Section2.Subtitle = (_a) => {
|
8057
8236
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8058
|
-
return /* @__PURE__ */
|
8237
|
+
return /* @__PURE__ */ React80.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8059
8238
|
color: "grey-70"
|
8060
8239
|
}), children);
|
8061
8240
|
};
|
8062
8241
|
Section2.Actions = (_a) => {
|
8063
8242
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8064
|
-
return /* @__PURE__ */
|
8243
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8065
8244
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8066
8245
|
}), children);
|
8067
8246
|
};
|
8068
8247
|
Section2.Body = (_a) => {
|
8069
8248
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8070
|
-
return /* @__PURE__ */
|
8249
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8071
8250
|
className: classNames(tw("p-6"), className)
|
8072
|
-
}), /* @__PURE__ */
|
8251
|
+
}), /* @__PURE__ */ React80.createElement(Typography, {
|
8073
8252
|
htmlTag: "div",
|
8074
8253
|
color: "grey-70"
|
8075
8254
|
}, children));
|
8076
8255
|
};
|
8077
8256
|
|
8078
8257
|
// src/components/Section/Section.tsx
|
8079
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8258
|
+
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React81.createElement(Section2, null, title && /* @__PURE__ */ React81.createElement(React81.Fragment, null, /* @__PURE__ */ React81.createElement(Section2.Header, null, /* @__PURE__ */ React81.createElement(Section2.TitleContainer, null, /* @__PURE__ */ React81.createElement(Section2.Title, null, title), subtitle && /* @__PURE__ */ React81.createElement(Section2.Subtitle, null, subtitle)), /* @__PURE__ */ React81.createElement(Section2.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
|
8080
8259
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8081
|
-
return /* @__PURE__ */
|
8260
|
+
return /* @__PURE__ */ React81.createElement(SecondaryButton, __spreadValues({
|
8082
8261
|
key: text
|
8083
8262
|
}, action), text);
|
8084
|
-
}))), /* @__PURE__ */
|
8263
|
+
}))), /* @__PURE__ */ React81.createElement(Divider2, null)), /* @__PURE__ */ React81.createElement(Section2.Body, null, children));
|
8085
8264
|
|
8086
8265
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
8087
|
-
import
|
8266
|
+
import React82 from "react";
|
8088
8267
|
var SegmentedControl = (_a) => {
|
8089
8268
|
var _b = _a, {
|
8090
8269
|
children,
|
@@ -8101,7 +8280,7 @@ var SegmentedControl = (_a) => {
|
|
8101
8280
|
"selected",
|
8102
8281
|
"className"
|
8103
8282
|
]);
|
8104
|
-
return /* @__PURE__ */
|
8283
|
+
return /* @__PURE__ */ React82.createElement("button", __spreadProps(__spreadValues({
|
8105
8284
|
type: "button"
|
8106
8285
|
}, rest), {
|
8107
8286
|
className: classNames(
|
@@ -8132,11 +8311,11 @@ var SegmentedControlGroup = (_a) => {
|
|
8132
8311
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8133
8312
|
"bg-grey-0": variant === "raised"
|
8134
8313
|
});
|
8135
|
-
return /* @__PURE__ */
|
8314
|
+
return /* @__PURE__ */ React82.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8136
8315
|
className: classNames(classes, className)
|
8137
|
-
}),
|
8316
|
+
}), React82.Children.map(
|
8138
8317
|
children,
|
8139
|
-
(child) =>
|
8318
|
+
(child) => React82.cloneElement(child, {
|
8140
8319
|
dense,
|
8141
8320
|
variant,
|
8142
8321
|
onClick: () => onChange(child.props.value),
|
@@ -8174,14 +8353,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8174
8353
|
);
|
8175
8354
|
|
8176
8355
|
// src/components/Stepper/Stepper.tsx
|
8177
|
-
import
|
8356
|
+
import React84 from "react";
|
8178
8357
|
|
8179
8358
|
// src/common/Stepper/Stepper.tsx
|
8180
|
-
import
|
8359
|
+
import React83 from "react";
|
8181
8360
|
var import_tick5 = __toESM(require_tick());
|
8182
8361
|
var Stepper = (_a) => {
|
8183
8362
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8184
|
-
return /* @__PURE__ */
|
8363
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8185
8364
|
className: classNames(className)
|
8186
8365
|
}));
|
8187
8366
|
};
|
@@ -8195,7 +8374,7 @@ var ConnectorContainer = (_a) => {
|
|
8195
8374
|
"completed",
|
8196
8375
|
"dense"
|
8197
8376
|
]);
|
8198
|
-
return /* @__PURE__ */
|
8377
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8199
8378
|
className: classNames(
|
8200
8379
|
tw("absolute w-full -left-1/2", {
|
8201
8380
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -8207,7 +8386,7 @@ var ConnectorContainer = (_a) => {
|
|
8207
8386
|
};
|
8208
8387
|
var Connector = (_a) => {
|
8209
8388
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8210
|
-
return /* @__PURE__ */
|
8389
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8211
8390
|
className: classNames(
|
8212
8391
|
tw("w-full", {
|
8213
8392
|
"bg-grey-20": !completed,
|
@@ -8221,7 +8400,7 @@ var Connector = (_a) => {
|
|
8221
8400
|
};
|
8222
8401
|
var Step = (_a) => {
|
8223
8402
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8224
|
-
return /* @__PURE__ */
|
8403
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8225
8404
|
className: classNames(
|
8226
8405
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8227
8406
|
"text-grey-20": state === "inactive"
|
@@ -8242,13 +8421,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
8242
8421
|
});
|
8243
8422
|
var Indicator = (_a) => {
|
8244
8423
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8245
|
-
return /* @__PURE__ */
|
8424
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8246
8425
|
className: classNames(
|
8247
8426
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8248
8427
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
8249
8428
|
className
|
8250
8429
|
)
|
8251
|
-
}), state === "completed" ? /* @__PURE__ */
|
8430
|
+
}), state === "completed" ? /* @__PURE__ */ React83.createElement(InlineIcon, {
|
8252
8431
|
icon: import_tick5.default
|
8253
8432
|
}) : dense ? null : children);
|
8254
8433
|
};
|
@@ -8259,25 +8438,25 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
8259
8438
|
|
8260
8439
|
// src/components/Stepper/Stepper.tsx
|
8261
8440
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8262
|
-
const steps =
|
8263
|
-
return /* @__PURE__ */
|
8441
|
+
const steps = React84.Children.count(children);
|
8442
|
+
return /* @__PURE__ */ React84.createElement(Stepper, {
|
8264
8443
|
role: "list"
|
8265
|
-
}, /* @__PURE__ */
|
8444
|
+
}, /* @__PURE__ */ React84.createElement(Template, {
|
8266
8445
|
columns: steps
|
8267
|
-
},
|
8446
|
+
}, React84.Children.map(children, (child, index) => {
|
8268
8447
|
if (!isComponentType(child, Step2)) {
|
8269
8448
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8270
8449
|
} else {
|
8271
8450
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8272
|
-
return /* @__PURE__ */
|
8451
|
+
return /* @__PURE__ */ React84.createElement(Stepper.Step, {
|
8273
8452
|
state,
|
8274
8453
|
"aria-current": state === "active" ? "step" : false,
|
8275
8454
|
role: "listitem"
|
8276
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
8455
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React84.createElement(Stepper.ConnectorContainer, {
|
8277
8456
|
dense
|
8278
|
-
}, /* @__PURE__ */
|
8457
|
+
}, /* @__PURE__ */ React84.createElement(Stepper.ConnectorContainer.Connector, {
|
8279
8458
|
completed: state === "completed" || state === "active"
|
8280
|
-
})), /* @__PURE__ */
|
8459
|
+
})), /* @__PURE__ */ React84.createElement(Stepper.Step.Indicator, {
|
8281
8460
|
state,
|
8282
8461
|
dense
|
8283
8462
|
}, index + 1), child.props.children);
|
@@ -8288,16 +8467,16 @@ var Step2 = () => null;
|
|
8288
8467
|
Stepper2.Step = Step2;
|
8289
8468
|
|
8290
8469
|
// src/components/Switch/Switch.tsx
|
8291
|
-
import
|
8470
|
+
import React86 from "react";
|
8292
8471
|
|
8293
8472
|
// src/common/Switch/Switch.tsx
|
8294
|
-
import
|
8295
|
-
var Switch =
|
8473
|
+
import React85 from "react";
|
8474
|
+
var Switch = React85.forwardRef(
|
8296
8475
|
(_a, ref) => {
|
8297
8476
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8298
|
-
return /* @__PURE__ */
|
8477
|
+
return /* @__PURE__ */ React85.createElement("span", {
|
8299
8478
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8300
|
-
}, /* @__PURE__ */
|
8479
|
+
}, /* @__PURE__ */ React85.createElement("input", __spreadProps(__spreadValues({
|
8301
8480
|
id,
|
8302
8481
|
ref,
|
8303
8482
|
type: "checkbox",
|
@@ -8316,7 +8495,7 @@ var Switch = React83.forwardRef(
|
|
8316
8495
|
),
|
8317
8496
|
readOnly,
|
8318
8497
|
disabled
|
8319
|
-
})), /* @__PURE__ */
|
8498
|
+
})), /* @__PURE__ */ React85.createElement("span", {
|
8320
8499
|
className: tw(
|
8321
8500
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8322
8501
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8329,12 +8508,12 @@ var Switch = React83.forwardRef(
|
|
8329
8508
|
);
|
8330
8509
|
|
8331
8510
|
// src/components/Switch/Switch.tsx
|
8332
|
-
var Switch2 =
|
8511
|
+
var Switch2 = React86.forwardRef(
|
8333
8512
|
(_a, ref) => {
|
8334
8513
|
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
8335
8514
|
var _a2;
|
8336
8515
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8337
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8516
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React86.createElement(ControlLabel, {
|
8338
8517
|
htmlFor: id,
|
8339
8518
|
label: children,
|
8340
8519
|
"aria-label": ariaLabel,
|
@@ -8342,7 +8521,7 @@ var Switch2 = React84.forwardRef(
|
|
8342
8521
|
readOnly,
|
8343
8522
|
disabled,
|
8344
8523
|
style: { gap: "0 8px" }
|
8345
|
-
}, !readOnly && /* @__PURE__ */
|
8524
|
+
}, !readOnly && /* @__PURE__ */ React86.createElement(Switch, __spreadProps(__spreadValues({
|
8346
8525
|
id,
|
8347
8526
|
ref,
|
8348
8527
|
name
|
@@ -8352,19 +8531,19 @@ var Switch2 = React84.forwardRef(
|
|
8352
8531
|
}))) : null;
|
8353
8532
|
}
|
8354
8533
|
);
|
8355
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
8534
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React86.createElement("div", {
|
8356
8535
|
className: tw("flex gap-3")
|
8357
|
-
}, /* @__PURE__ */
|
8536
|
+
}, /* @__PURE__ */ React86.createElement(Skeleton, {
|
8358
8537
|
height: 20,
|
8359
8538
|
width: 35
|
8360
|
-
}), /* @__PURE__ */
|
8539
|
+
}), /* @__PURE__ */ React86.createElement(Skeleton, {
|
8361
8540
|
height: 20,
|
8362
8541
|
width: 150
|
8363
8542
|
}));
|
8364
8543
|
Switch2.Skeleton = SwitchSkeleton;
|
8365
8544
|
|
8366
8545
|
// src/components/SwitchGroup/SwitchGroup.tsx
|
8367
|
-
import
|
8546
|
+
import React87, { useState as useState11 } from "react";
|
8368
8547
|
import uniqueId9 from "lodash/uniqueId";
|
8369
8548
|
var SwitchGroup = (_a) => {
|
8370
8549
|
var _b = _a, {
|
@@ -8396,11 +8575,11 @@ var SwitchGroup = (_a) => {
|
|
8396
8575
|
setSelectedItems(updated);
|
8397
8576
|
onChange == null ? void 0 : onChange(updated);
|
8398
8577
|
};
|
8399
|
-
return /* @__PURE__ */
|
8578
|
+
return /* @__PURE__ */ React87.createElement(LabelControl, __spreadValues(__spreadValues({
|
8400
8579
|
fieldset: true
|
8401
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8580
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React87.createElement(InputGroup, {
|
8402
8581
|
cols
|
8403
|
-
},
|
8582
|
+
}, React87.Children.map(children, (c) => {
|
8404
8583
|
var _a3, _b2, _c, _d;
|
8405
8584
|
if (!isComponentType(c, Switch2)) {
|
8406
8585
|
return null;
|
@@ -8408,7 +8587,7 @@ var SwitchGroup = (_a) => {
|
|
8408
8587
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8409
8588
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8410
8589
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8411
|
-
return
|
8590
|
+
return React87.cloneElement(c, {
|
8412
8591
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8413
8592
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8414
8593
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8418,19 +8597,19 @@ var SwitchGroup = (_a) => {
|
|
8418
8597
|
})));
|
8419
8598
|
};
|
8420
8599
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8421
|
-
return /* @__PURE__ */
|
8600
|
+
return /* @__PURE__ */ React87.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React87.createElement("div", {
|
8422
8601
|
className: tw("flex flex-wrap flex-col gap-2")
|
8423
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8602
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React87.createElement(Switch2.Skeleton, {
|
8424
8603
|
key
|
8425
8604
|
}))));
|
8426
8605
|
};
|
8427
8606
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
8428
8607
|
|
8429
8608
|
// src/components/TagLabel/TagLabel.tsx
|
8430
|
-
import
|
8609
|
+
import React88 from "react";
|
8431
8610
|
var TagLabel = (_a) => {
|
8432
8611
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8433
|
-
return /* @__PURE__ */
|
8612
|
+
return /* @__PURE__ */ React88.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8434
8613
|
className: tw("rounded-full text-white bg-primary-70", {
|
8435
8614
|
"py-2 px-4 typography-caption": !dense,
|
8436
8615
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8439,14 +8618,14 @@ var TagLabel = (_a) => {
|
|
8439
8618
|
};
|
8440
8619
|
|
8441
8620
|
// src/components/Textarea/Textarea.tsx
|
8442
|
-
import
|
8443
|
-
import
|
8621
|
+
import React89, { useRef as useRef11, useState as useState12 } from "react";
|
8622
|
+
import omit17 from "lodash/omit";
|
8444
8623
|
import toString2 from "lodash/toString";
|
8445
8624
|
import uniqueId10 from "lodash/uniqueId";
|
8446
|
-
var TextareaBase =
|
8625
|
+
var TextareaBase = React89.forwardRef(
|
8447
8626
|
(_a, ref) => {
|
8448
8627
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8449
|
-
return /* @__PURE__ */
|
8628
|
+
return /* @__PURE__ */ React89.createElement("textarea", __spreadProps(__spreadValues({
|
8450
8629
|
ref
|
8451
8630
|
}, props), {
|
8452
8631
|
readOnly,
|
@@ -8454,23 +8633,23 @@ var TextareaBase = React87.forwardRef(
|
|
8454
8633
|
}));
|
8455
8634
|
}
|
8456
8635
|
);
|
8457
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8636
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React89.createElement(Skeleton, {
|
8458
8637
|
height: 58
|
8459
8638
|
});
|
8460
|
-
var Textarea =
|
8639
|
+
var Textarea = React89.forwardRef((props, ref) => {
|
8461
8640
|
var _a, _b, _c;
|
8462
8641
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8463
8642
|
const id = useRef11((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
8464
8643
|
const errorMessageId = uniqueId10();
|
8465
8644
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8466
8645
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8467
|
-
const baseProps =
|
8468
|
-
return /* @__PURE__ */
|
8646
|
+
const baseProps = omit17(props, Object.keys(labelControlProps));
|
8647
|
+
return /* @__PURE__ */ React89.createElement(LabelControl, __spreadValues({
|
8469
8648
|
id: `${id.current}-label`,
|
8470
8649
|
htmlFor: id.current,
|
8471
8650
|
messageId: errorMessageId,
|
8472
8651
|
length: value !== void 0 ? toString2(value).length : void 0
|
8473
|
-
}, labelControlProps), /* @__PURE__ */
|
8652
|
+
}, labelControlProps), /* @__PURE__ */ React89.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8474
8653
|
ref
|
8475
8654
|
}, baseProps), errorProps), {
|
8476
8655
|
id: id.current,
|
@@ -8486,47 +8665,47 @@ var Textarea = React87.forwardRef((props, ref) => {
|
|
8486
8665
|
valid: props.valid
|
8487
8666
|
})));
|
8488
8667
|
});
|
8489
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
8668
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React89.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React89.createElement(TextareaBase.Skeleton, null));
|
8490
8669
|
Textarea.Skeleton = TextAreaSkeleton;
|
8491
8670
|
|
8492
8671
|
// src/components/Timeline/Timeline.tsx
|
8493
|
-
import
|
8672
|
+
import React91 from "react";
|
8494
8673
|
|
8495
8674
|
// src/common/Timeline/Timeline.tsx
|
8496
|
-
import
|
8675
|
+
import React90 from "react";
|
8497
8676
|
var Timeline = (_a) => {
|
8498
8677
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8499
|
-
return /* @__PURE__ */
|
8678
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8500
8679
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8501
8680
|
}));
|
8502
8681
|
};
|
8503
|
-
var
|
8682
|
+
var Content2 = (_a) => {
|
8504
8683
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8505
|
-
return /* @__PURE__ */
|
8684
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8506
8685
|
className: classNames(tw("pb-6"), className)
|
8507
8686
|
}));
|
8508
8687
|
};
|
8509
8688
|
var Separator2 = (_a) => {
|
8510
8689
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8511
|
-
return /* @__PURE__ */
|
8690
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8512
8691
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8513
8692
|
}));
|
8514
8693
|
};
|
8515
8694
|
var LineContainer = (_a) => {
|
8516
8695
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8517
|
-
return /* @__PURE__ */
|
8696
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8518
8697
|
className: classNames(tw("flex justify-center py-1"), className)
|
8519
8698
|
}));
|
8520
8699
|
};
|
8521
8700
|
var Line = (_a) => {
|
8522
8701
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8523
|
-
return /* @__PURE__ */
|
8702
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8524
8703
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8525
8704
|
}));
|
8526
8705
|
};
|
8527
8706
|
var Dot = (_a) => {
|
8528
8707
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8529
|
-
return /* @__PURE__ */
|
8708
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8530
8709
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8531
8710
|
}));
|
8532
8711
|
};
|
@@ -8534,68 +8713,68 @@ Separator2.Dot = Dot;
|
|
8534
8713
|
LineContainer.Line = Line;
|
8535
8714
|
Timeline.Separator = Separator2;
|
8536
8715
|
Timeline.LineContainer = LineContainer;
|
8537
|
-
Timeline.Content =
|
8716
|
+
Timeline.Content = Content2;
|
8538
8717
|
|
8539
8718
|
// src/components/Timeline/Timeline.tsx
|
8540
8719
|
var import_error4 = __toESM(require_error());
|
8541
8720
|
var import_time = __toESM(require_time());
|
8542
8721
|
var import_warningSign4 = __toESM(require_warningSign());
|
8543
8722
|
var TimelineItem = () => null;
|
8544
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8723
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React91.createElement("div", null, React91.Children.map(children, (item) => {
|
8545
8724
|
if (!isComponentType(item, TimelineItem)) {
|
8546
8725
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8547
8726
|
} else {
|
8548
8727
|
const { props, key } = item;
|
8549
|
-
return /* @__PURE__ */
|
8728
|
+
return /* @__PURE__ */ React91.createElement(Timeline, {
|
8550
8729
|
key: key != null ? key : props.title
|
8551
|
-
}, /* @__PURE__ */
|
8730
|
+
}, /* @__PURE__ */ React91.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React91.createElement(Icon, {
|
8552
8731
|
icon: import_error4.default,
|
8553
8732
|
color: "error-30"
|
8554
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8733
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React91.createElement(Icon, {
|
8555
8734
|
icon: import_warningSign4.default,
|
8556
8735
|
color: "warning-30"
|
8557
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8736
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React91.createElement(Icon, {
|
8558
8737
|
icon: import_time.default,
|
8559
8738
|
color: "info-30"
|
8560
|
-
}) : /* @__PURE__ */
|
8739
|
+
}) : /* @__PURE__ */ React91.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React91.createElement(Typography2.Caption, {
|
8561
8740
|
color: "grey-50"
|
8562
|
-
}, props.title), /* @__PURE__ */
|
8741
|
+
}, props.title), /* @__PURE__ */ React91.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React91.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React91.createElement(Timeline.Content, null, /* @__PURE__ */ React91.createElement(Typography2.Small, null, props.children)));
|
8563
8742
|
}
|
8564
8743
|
}));
|
8565
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8744
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React91.createElement(Timeline, null, /* @__PURE__ */ React91.createElement(Timeline.Separator, null, /* @__PURE__ */ React91.createElement(Skeleton, {
|
8566
8745
|
width: 6,
|
8567
8746
|
height: 6,
|
8568
8747
|
rounded: true
|
8569
|
-
})), /* @__PURE__ */
|
8748
|
+
})), /* @__PURE__ */ React91.createElement(Skeleton, {
|
8570
8749
|
height: 12,
|
8571
8750
|
width: 120
|
8572
|
-
}), /* @__PURE__ */
|
8751
|
+
}), /* @__PURE__ */ React91.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React91.createElement(Skeleton, {
|
8573
8752
|
width: 2,
|
8574
8753
|
height: "100%"
|
8575
|
-
})), /* @__PURE__ */
|
8754
|
+
})), /* @__PURE__ */ React91.createElement(Timeline.Content, null, /* @__PURE__ */ React91.createElement(Box, {
|
8576
8755
|
display: "flex",
|
8577
8756
|
flexDirection: "column",
|
8578
8757
|
gap: "3"
|
8579
|
-
}, /* @__PURE__ */
|
8758
|
+
}, /* @__PURE__ */ React91.createElement(Skeleton, {
|
8580
8759
|
height: 32,
|
8581
8760
|
width: "100%"
|
8582
|
-
}), /* @__PURE__ */
|
8761
|
+
}), /* @__PURE__ */ React91.createElement(Skeleton, {
|
8583
8762
|
height: 32,
|
8584
8763
|
width: "73%"
|
8585
|
-
}), /* @__PURE__ */
|
8764
|
+
}), /* @__PURE__ */ React91.createElement(Skeleton, {
|
8586
8765
|
height: 32,
|
8587
8766
|
width: "80%"
|
8588
8767
|
}))));
|
8589
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8768
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React91.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React91.createElement(TimelineItemSkeleton, {
|
8590
8769
|
key
|
8591
8770
|
})));
|
8592
8771
|
Timeline2.Item = TimelineItem;
|
8593
8772
|
Timeline2.Skeleton = TimelineSkeleton;
|
8594
8773
|
|
8595
8774
|
// src/utils/table/useTableSelect.ts
|
8596
|
-
import
|
8775
|
+
import React92 from "react";
|
8597
8776
|
var useTableSelect = (data, { key }) => {
|
8598
|
-
const [selected, setSelected] =
|
8777
|
+
const [selected, setSelected] = React92.useState([]);
|
8599
8778
|
const allSelected = selected.length === data.length;
|
8600
8779
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8601
8780
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -8783,7 +8962,7 @@ export {
|
|
8783
8962
|
Box,
|
8784
8963
|
Breadcrumbs,
|
8785
8964
|
Button,
|
8786
|
-
Card,
|
8965
|
+
Card2 as Card,
|
8787
8966
|
Carousel,
|
8788
8967
|
CharCounter,
|
8789
8968
|
Checkbox2 as Checkbox,
|