@aivenio/aquarium 1.4.1 → 1.5.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 +380 -142
- package/dist/atoms.mjs +379 -142
- package/dist/src/common/Card/Card.d.ts +35 -0
- package/dist/src/common/Card/Card.js +50 -0
- 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/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/src/components/MultiSelect/MultiSelect.js +13 -8
- 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 +908 -742
- package/dist/system.mjs +875 -709
- 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,24 +4815,24 @@ 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,
|
@@ -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,
|
@@ -4770,16 +4885,16 @@ var PopoverWrapper = React37.forwardRef((props, ref) => {
|
|
4770
4885
|
if (!props.isOpen) {
|
4771
4886
|
return null;
|
4772
4887
|
}
|
4773
|
-
return /* @__PURE__ */
|
4888
|
+
return /* @__PURE__ */ React39.createElement(OverlayContainer2, null, /* @__PURE__ */ React39.createElement(FocusScope, {
|
4774
4889
|
restoreFocus: true,
|
4775
4890
|
autoFocus,
|
4776
4891
|
contain: containFocus
|
4777
|
-
}, /* @__PURE__ */
|
4892
|
+
}, /* @__PURE__ */ React39.createElement(Popover.Panel, __spreadProps(__spreadValues({
|
4778
4893
|
ref,
|
4779
4894
|
role: "dialog"
|
4780
4895
|
}, mergeProps2(otherProps, modalProps, overlayProps)), {
|
4781
4896
|
id: id != null ? id : overlayProps.id
|
4782
|
-
}), children, /* @__PURE__ */
|
4897
|
+
}), children, /* @__PURE__ */ React39.createElement(DismissButton, {
|
4783
4898
|
onDismiss: props.onClose
|
4784
4899
|
}))));
|
4785
4900
|
});
|
@@ -4843,7 +4958,8 @@ var ComboboxBase = (_a) => {
|
|
4843
4958
|
inputValue,
|
4844
4959
|
getItemProps,
|
4845
4960
|
selectedItem,
|
4846
|
-
closeMenu
|
4961
|
+
closeMenu,
|
4962
|
+
openMenu
|
4847
4963
|
} = useCombobox({
|
4848
4964
|
id,
|
4849
4965
|
selectedItem: value,
|
@@ -4878,22 +4994,21 @@ var ComboboxBase = (_a) => {
|
|
4878
4994
|
const hasNoResults = options.length === 0 || inputItems.length === 0;
|
4879
4995
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
4880
4996
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
4881
|
-
return /* @__PURE__ */
|
4997
|
+
return /* @__PURE__ */ React40.createElement("div", {
|
4882
4998
|
className: tw("relative")
|
4883
|
-
}, /* @__PURE__ */
|
4999
|
+
}, /* @__PURE__ */ React40.createElement(Select.InputContainer, {
|
4884
5000
|
ref: targetRef,
|
4885
5001
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
4886
|
-
}, /* @__PURE__ */
|
5002
|
+
}, /* @__PURE__ */ React40.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
4887
5003
|
id,
|
4888
5004
|
name,
|
4889
5005
|
placeholder: readOnly ? void 0 : placeholder
|
4890
5006
|
}, inputProps), props), {
|
4891
5007
|
disabled,
|
4892
5008
|
readOnly,
|
4893
|
-
|
4894
|
-
|
5009
|
+
onClick: readOnly ? void 0 : openMenu,
|
5010
|
+
onFocus: () => {
|
4895
5011
|
setFocus(true);
|
4896
|
-
(_a3 = inputProps.onFocus) == null ? void 0 : _a3.call(inputProps, e);
|
4897
5012
|
},
|
4898
5013
|
onBlur: (e) => {
|
4899
5014
|
var _a3;
|
@@ -4906,25 +5021,26 @@ var ComboboxBase = (_a) => {
|
|
4906
5021
|
(_a3 = inputProps.onKeyDown) == null ? void 0 : _a3.call(inputProps, e);
|
4907
5022
|
},
|
4908
5023
|
onKeyUp: (e) => e.stopPropagation()
|
4909
|
-
})), !readOnly && /* @__PURE__ */
|
5024
|
+
})), !readOnly && /* @__PURE__ */ React40.createElement(Select.Toggle, __spreadValues({
|
4910
5025
|
hasFocus,
|
4911
5026
|
isOpen
|
4912
|
-
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */
|
5027
|
+
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */ React40.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
4913
5028
|
isOpen: true,
|
4914
5029
|
isDismissable: true,
|
4915
5030
|
autoFocus: true
|
4916
5031
|
}, getMenuProps({ ref: overlayRef })), {
|
4917
5032
|
style,
|
4918
|
-
onClose: closeMenu
|
4919
|
-
|
5033
|
+
onClose: closeMenu,
|
5034
|
+
className: tw("overflow-y-auto")
|
5035
|
+
}), /* @__PURE__ */ React40.createElement(Select.Menu, {
|
4920
5036
|
maxHeight
|
4921
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
5037
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React40.createElement(Select.NoResults, null, noResults), isOpen && inputItems.map((item, index) => /* @__PURE__ */ React40.createElement(Select.Item, __spreadValues({
|
4922
5038
|
key: itemToString(item),
|
4923
5039
|
selected: item === selectedItem,
|
4924
5040
|
highlighted: index === highlightedIndex
|
4925
5041
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
4926
5042
|
};
|
4927
|
-
var ComboboxSkeleton = () => /* @__PURE__ */
|
5043
|
+
var ComboboxSkeleton = () => /* @__PURE__ */ React40.createElement(Skeleton, {
|
4928
5044
|
height: 38
|
4929
5045
|
});
|
4930
5046
|
ComboboxBase.Skeleton = ComboboxSkeleton;
|
@@ -4941,12 +5057,12 @@ var Combobox = (_a) => {
|
|
4941
5057
|
const errorMessageId = uniqueId2();
|
4942
5058
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
4943
5059
|
const labelControlProps = getLabelControlProps(props);
|
4944
|
-
const baseProps =
|
4945
|
-
return /* @__PURE__ */
|
5060
|
+
const baseProps = omit6(props, Object.keys(labelControlProps));
|
5061
|
+
return /* @__PURE__ */ React40.createElement(LabelControl, __spreadValues({
|
4946
5062
|
id: `${id.current}-label`,
|
4947
5063
|
htmlFor: `${id.current}-input`,
|
4948
5064
|
messageId: errorMessageId
|
4949
|
-
}, labelControlProps), /* @__PURE__ */
|
5065
|
+
}, labelControlProps), /* @__PURE__ */ React40.createElement(ComboboxBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
4950
5066
|
id: id.current,
|
4951
5067
|
options,
|
4952
5068
|
noResults,
|
@@ -4954,11 +5070,11 @@ var Combobox = (_a) => {
|
|
4954
5070
|
valid: props.valid
|
4955
5071
|
})));
|
4956
5072
|
};
|
4957
|
-
Combobox.Skeleton = () => /* @__PURE__ */
|
5073
|
+
Combobox.Skeleton = () => /* @__PURE__ */ React40.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React40.createElement(ComboboxBase.Skeleton, null));
|
4958
5074
|
|
4959
5075
|
// src/components/Container/Container.tsx
|
4960
|
-
import
|
4961
|
-
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */
|
5076
|
+
import React41 from "react";
|
5077
|
+
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React41.createElement(Box, {
|
4962
5078
|
marginLeft: "auto",
|
4963
5079
|
marginRight: "auto",
|
4964
5080
|
width: "full",
|
@@ -4972,11 +5088,11 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React39.crea
|
|
4972
5088
|
}, children);
|
4973
5089
|
|
4974
5090
|
// src/components/DataList/DataList.tsx
|
4975
|
-
import
|
5091
|
+
import React47 from "react";
|
4976
5092
|
import orderBy2 from "lodash/orderBy";
|
4977
5093
|
|
4978
5094
|
// src/components/Template/Template.tsx
|
4979
|
-
import
|
5095
|
+
import React42 from "react";
|
4980
5096
|
var Template = ({
|
4981
5097
|
children,
|
4982
5098
|
columns,
|
@@ -5002,23 +5118,23 @@ var Template = ({
|
|
5002
5118
|
rowGap,
|
5003
5119
|
columnGap
|
5004
5120
|
});
|
5005
|
-
return /* @__PURE__ */
|
5121
|
+
return /* @__PURE__ */ React42.createElement("div", {
|
5006
5122
|
style: __spreadValues({}, styles)
|
5007
5123
|
}, children);
|
5008
5124
|
};
|
5009
5125
|
|
5010
5126
|
// src/common/DataList/DataList.tsx
|
5011
|
-
import
|
5127
|
+
import React45 from "react";
|
5012
5128
|
|
5013
5129
|
// src/common/Table/Table.tsx
|
5014
|
-
import
|
5130
|
+
import React44 from "react";
|
5015
5131
|
|
5016
5132
|
// src/common/RadioButton/RadioButton.tsx
|
5017
|
-
import
|
5018
|
-
var RadioButton =
|
5133
|
+
import React43 from "react";
|
5134
|
+
var RadioButton = React43.forwardRef(
|
5019
5135
|
(_a, ref) => {
|
5020
5136
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
5021
|
-
return /* @__PURE__ */
|
5137
|
+
return /* @__PURE__ */ React43.createElement("input", __spreadProps(__spreadValues({
|
5022
5138
|
id,
|
5023
5139
|
ref,
|
5024
5140
|
type: "radio",
|
@@ -5044,29 +5160,29 @@ var RadioButton = React41.forwardRef(
|
|
5044
5160
|
// src/common/Table/Table.tsx
|
5045
5161
|
var import_chevronDown3 = __toESM(require_chevronDown());
|
5046
5162
|
var import_chevronUp2 = __toESM(require_chevronUp());
|
5047
|
-
var HeadContext =
|
5163
|
+
var HeadContext = React44.createContext(null);
|
5048
5164
|
var tableClassNames = tw("w-full relative typography-default border-spacing-0");
|
5049
5165
|
var Table = (_a) => {
|
5050
5166
|
var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
|
5051
|
-
return /* @__PURE__ */
|
5167
|
+
return /* @__PURE__ */ React44.createElement("table", __spreadProps(__spreadValues({}, rest), {
|
5052
5168
|
className: classNames(tableClassNames, className),
|
5053
5169
|
"aria-label": ariaLabel
|
5054
5170
|
}), children);
|
5055
5171
|
};
|
5056
5172
|
var TableHead = (_a) => {
|
5057
5173
|
var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
|
5058
|
-
return /* @__PURE__ */
|
5174
|
+
return /* @__PURE__ */ React44.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React44.createElement("tr", null, /* @__PURE__ */ React44.createElement(HeadContext.Provider, {
|
5059
5175
|
value: { children, sticky }
|
5060
5176
|
}, children)));
|
5061
5177
|
};
|
5062
5178
|
var TableBody = (_a) => {
|
5063
5179
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5064
|
-
return /* @__PURE__ */
|
5180
|
+
return /* @__PURE__ */ React44.createElement("tbody", __spreadValues({}, rest), children);
|
5065
5181
|
};
|
5066
5182
|
var rowClassNames = tw("children:border-grey-10 children:last:border-b-0 hover:bg-grey-0");
|
5067
5183
|
var TableRow = (_a) => {
|
5068
5184
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5069
|
-
return /* @__PURE__ */
|
5185
|
+
return /* @__PURE__ */ React44.createElement("tr", __spreadProps(__spreadValues({}, rest), {
|
5070
5186
|
className: classNames(rowClassNames, className)
|
5071
5187
|
}), children);
|
5072
5188
|
};
|
@@ -5082,25 +5198,25 @@ var getHeadCellClassNames = (sticky = true) => {
|
|
5082
5198
|
};
|
5083
5199
|
var TableCell = (_a) => {
|
5084
5200
|
var _b = _a, { children, className, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "align"]);
|
5085
|
-
const headContext =
|
5086
|
-
return headContext ? /* @__PURE__ */
|
5201
|
+
const headContext = React44.useContext(HeadContext);
|
5202
|
+
return headContext ? /* @__PURE__ */ React44.createElement("th", __spreadProps(__spreadValues({}, rest), {
|
5087
5203
|
className: classNames(
|
5088
5204
|
cellClassNames,
|
5089
5205
|
getHeadCellClassNames(headContext.sticky),
|
5090
5206
|
getAlignClassNames(align),
|
5091
5207
|
className
|
5092
5208
|
)
|
5093
|
-
}), children) : /* @__PURE__ */
|
5209
|
+
}), children) : /* @__PURE__ */ React44.createElement("td", __spreadProps(__spreadValues({}, rest), {
|
5094
5210
|
className: classNames(cellClassNames, getBodyCellClassNames(), getAlignClassNames(align), className)
|
5095
5211
|
}), children);
|
5096
5212
|
};
|
5097
5213
|
var TableSelectCell = (_a) => {
|
5098
5214
|
var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
|
5099
|
-
return /* @__PURE__ */
|
5215
|
+
return /* @__PURE__ */ React44.createElement(Table.Cell, {
|
5100
5216
|
className: tw("leading-[0px]")
|
5101
|
-
}, props.type === "radio" ? /* @__PURE__ */
|
5217
|
+
}, props.type === "radio" ? /* @__PURE__ */ React44.createElement(RadioButton, __spreadValues({
|
5102
5218
|
"aria-label": ariaLabel
|
5103
|
-
}, props)) : /* @__PURE__ */
|
5219
|
+
}, props)) : /* @__PURE__ */ React44.createElement(Checkbox, __spreadValues({
|
5104
5220
|
"aria-label": ariaLabel
|
5105
5221
|
}, props)));
|
5106
5222
|
};
|
@@ -5110,39 +5226,39 @@ var getSortCellIconClassNames = (active) => {
|
|
5110
5226
|
};
|
5111
5227
|
var TableSortCell = (_a) => {
|
5112
5228
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5113
|
-
return /* @__PURE__ */
|
5229
|
+
return /* @__PURE__ */ React44.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
|
5114
5230
|
"aria-sort": direction
|
5115
|
-
}), /* @__PURE__ */
|
5231
|
+
}), /* @__PURE__ */ React44.createElement("span", {
|
5116
5232
|
className: getSortCellButtonClassNames(rest.align),
|
5117
5233
|
role: "button",
|
5118
5234
|
tabIndex: -1,
|
5119
5235
|
onClick
|
5120
|
-
}, children, /* @__PURE__ */
|
5236
|
+
}, children, /* @__PURE__ */ React44.createElement("div", {
|
5121
5237
|
"data-sort-icons": true,
|
5122
5238
|
className: tw("flex flex-col", {
|
5123
5239
|
"invisible group-hover:visible": direction === "none"
|
5124
5240
|
})
|
5125
|
-
}, /* @__PURE__ */
|
5241
|
+
}, /* @__PURE__ */ React44.createElement(InlineIcon, {
|
5126
5242
|
icon: import_chevronUp2.default,
|
5127
5243
|
className: getSortCellIconClassNames(direction === "descending")
|
5128
|
-
}), /* @__PURE__ */
|
5244
|
+
}), /* @__PURE__ */ React44.createElement(InlineIcon, {
|
5129
5245
|
icon: import_chevronDown3.default,
|
5130
5246
|
className: getSortCellIconClassNames(direction === "ascending")
|
5131
5247
|
}))));
|
5132
5248
|
};
|
5133
|
-
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */
|
5249
|
+
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React44.createElement("div", {
|
5134
5250
|
className: tw("flex gap-4 items-center")
|
5135
|
-
}, image && /* @__PURE__ */
|
5251
|
+
}, image && /* @__PURE__ */ React44.createElement("img", {
|
5136
5252
|
src: image,
|
5137
5253
|
alt: imageAlt,
|
5138
5254
|
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 =
|
5255
|
+
}), /* @__PURE__ */ React44.createElement("div", null, title, caption && /* @__PURE__ */ React44.createElement(Typography2.Caption, null, caption)));
|
5256
|
+
Table.Head = React44.memo(TableHead);
|
5257
|
+
Table.Body = React44.memo(TableBody);
|
5258
|
+
Table.Row = React44.memo(TableRow);
|
5259
|
+
Table.Cell = React44.memo(TableCell);
|
5260
|
+
Table.SortCell = React44.memo(TableSortCell);
|
5261
|
+
Table.SelectCell = React44.memo(TableSelectCell);
|
5146
5262
|
|
5147
5263
|
// src/common/DataList/DataList.tsx
|
5148
5264
|
var import_chevronDown4 = __toESM(require_chevronDown());
|
@@ -5154,7 +5270,7 @@ var getAlignClassNames2 = (align) => tw("flex items-center", {
|
|
5154
5270
|
});
|
5155
5271
|
var DataList = (_a) => {
|
5156
5272
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5157
|
-
return /* @__PURE__ */
|
5273
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadValues({}, rest));
|
5158
5274
|
};
|
5159
5275
|
var HeadCell = (_a) => {
|
5160
5276
|
var _b = _a, {
|
@@ -5166,14 +5282,14 @@ var HeadCell = (_a) => {
|
|
5166
5282
|
"sticky",
|
5167
5283
|
"align"
|
5168
5284
|
]);
|
5169
|
-
return /* @__PURE__ */
|
5285
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5170
5286
|
role: "cell",
|
5171
5287
|
className: classNames(cellClassNames, getHeadCellClassNames(sticky), getAlignClassNames2(align), className)
|
5172
5288
|
}));
|
5173
5289
|
};
|
5174
5290
|
var Cell = (_a) => {
|
5175
5291
|
var _b = _a, { className, align } = _b, rest = __objRest(_b, ["className", "align"]);
|
5176
|
-
return /* @__PURE__ */
|
5292
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5177
5293
|
role: "cell",
|
5178
5294
|
className: classNames(
|
5179
5295
|
cellClassNames,
|
@@ -5186,30 +5302,30 @@ var Cell = (_a) => {
|
|
5186
5302
|
};
|
5187
5303
|
var Row = (_a) => {
|
5188
5304
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5189
|
-
return /* @__PURE__ */
|
5305
|
+
return /* @__PURE__ */ React45.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5190
5306
|
className: classNames(tw("contents group"), className),
|
5191
5307
|
role: "row"
|
5192
5308
|
}));
|
5193
5309
|
};
|
5194
5310
|
var SortCell = (_a) => {
|
5195
5311
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5196
|
-
return /* @__PURE__ */
|
5312
|
+
return /* @__PURE__ */ React45.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
|
5197
5313
|
"aria-sort": direction,
|
5198
5314
|
role: "cell"
|
5199
|
-
}), /* @__PURE__ */
|
5315
|
+
}), /* @__PURE__ */ React45.createElement("span", {
|
5200
5316
|
className: getSortCellButtonClassNames(rest.align),
|
5201
5317
|
role: "button",
|
5202
5318
|
tabIndex: -1,
|
5203
5319
|
onClick
|
5204
|
-
}, children, /* @__PURE__ */
|
5320
|
+
}, children, /* @__PURE__ */ React45.createElement("div", {
|
5205
5321
|
"data-sort-icons": true,
|
5206
5322
|
className: tw("flex flex-col", {
|
5207
5323
|
"invisible group-hover:visible": direction === "none"
|
5208
5324
|
})
|
5209
|
-
}, /* @__PURE__ */
|
5325
|
+
}, /* @__PURE__ */ React45.createElement(InlineIcon, {
|
5210
5326
|
icon: import_chevronUp3.default,
|
5211
5327
|
className: getSortCellIconClassNames(direction === "descending")
|
5212
|
-
}), /* @__PURE__ */
|
5328
|
+
}), /* @__PURE__ */ React45.createElement(InlineIcon, {
|
5213
5329
|
icon: import_chevronDown4.default,
|
5214
5330
|
className: getSortCellIconClassNames(direction === "ascending")
|
5215
5331
|
}))));
|
@@ -5235,9 +5351,9 @@ var cellProps = (column) => ({
|
|
5235
5351
|
});
|
5236
5352
|
|
5237
5353
|
// src/utils/table/useTableSort.tsx
|
5238
|
-
import
|
5354
|
+
import React46 from "react";
|
5239
5355
|
var useTableSort = () => {
|
5240
|
-
const [sort, setSort] =
|
5356
|
+
const [sort, setSort] = React46.useState();
|
5241
5357
|
const handleSortClick = (field) => {
|
5242
5358
|
if ((sort == null ? void 0 : sort.key) === field) {
|
5243
5359
|
if (sort.direction === "ascending") {
|
@@ -5260,40 +5376,40 @@ var DataList2 = ({ columns, rows }) => {
|
|
5260
5376
|
var _a;
|
5261
5377
|
return (_a = column.width) != null ? _a : "auto";
|
5262
5378
|
});
|
5263
|
-
return /* @__PURE__ */
|
5379
|
+
return /* @__PURE__ */ React47.createElement(Template, {
|
5264
5380
|
columns: templateColumns
|
5265
5381
|
}, columns.map(
|
5266
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5382
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React47.createElement(DataList.SortCell, __spreadValues({
|
5267
5383
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5268
5384
|
onClick: () => updateSort(column.field)
|
5269
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
5270
|
-
), /* @__PURE__ */
|
5385
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React47.createElement(DataList.HeadCell, __spreadValues({}, cellProps(column)), column.headerName)
|
5386
|
+
), /* @__PURE__ */ React47.createElement(List, {
|
5271
5387
|
items: sortedRows,
|
5272
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5388
|
+
renderItem: (row, index) => /* @__PURE__ */ React47.createElement(DataList.Row, {
|
5273
5389
|
key: row.id
|
5274
|
-
}, /* @__PURE__ */
|
5390
|
+
}, /* @__PURE__ */ React47.createElement(List, {
|
5275
5391
|
items: columns,
|
5276
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5392
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React47.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React47.createElement(StatusChip, __spreadValues({
|
5277
5393
|
dense: true
|
5278
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5394
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React47.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React47.createElement(SecondaryButton, __spreadValues({
|
5279
5395
|
dense: true
|
5280
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5396
|
+
}, 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
5397
|
}))
|
5282
5398
|
}));
|
5283
5399
|
};
|
5284
5400
|
|
5285
5401
|
// src/components/DataTable/DataTable.tsx
|
5286
|
-
import
|
5402
|
+
import React50 from "react";
|
5287
5403
|
import orderBy3 from "lodash/orderBy";
|
5288
5404
|
|
5289
5405
|
// src/components/Table/Table.tsx
|
5290
|
-
import
|
5406
|
+
import React49 from "react";
|
5291
5407
|
|
5292
5408
|
// src/utils/table/useScrollTarget.ts
|
5293
|
-
import
|
5409
|
+
import React48 from "react";
|
5294
5410
|
var useScrollTarget = (callback) => {
|
5295
|
-
const targetRef =
|
5296
|
-
|
5411
|
+
const targetRef = React48.useRef(null);
|
5412
|
+
React48.useLayoutEffect(() => {
|
5297
5413
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
5298
5414
|
root: null,
|
5299
5415
|
rootMargin: `0px 0px 200px 0px`
|
@@ -5311,12 +5427,12 @@ var Table2 = (_a) => {
|
|
5311
5427
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
5312
5428
|
const bottomRef = useScrollTarget(onNext);
|
5313
5429
|
const topRef = useScrollTarget(onPrev);
|
5314
|
-
return /* @__PURE__ */
|
5430
|
+
return /* @__PURE__ */ React49.createElement("div", {
|
5315
5431
|
className: "relative w-full"
|
5316
|
-
}, /* @__PURE__ */
|
5432
|
+
}, /* @__PURE__ */ React49.createElement("div", {
|
5317
5433
|
ref: topRef,
|
5318
5434
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
5319
|
-
}), /* @__PURE__ */
|
5435
|
+
}), /* @__PURE__ */ React49.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React49.createElement("div", {
|
5320
5436
|
ref: bottomRef,
|
5321
5437
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
5322
5438
|
}));
|
@@ -5343,43 +5459,43 @@ var DataTable = (_a) => {
|
|
5343
5459
|
]);
|
5344
5460
|
const [sort, updateSort] = useTableSort();
|
5345
5461
|
const sortedRows = orderBy3(rows, [sort == null ? void 0 : sort.key], [toSortDirection(sort == null ? void 0 : sort.direction)]);
|
5346
|
-
return /* @__PURE__ */
|
5462
|
+
return /* @__PURE__ */ React50.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
5347
5463
|
className: tw({
|
5348
5464
|
"whitespace-nowrap": noWrap,
|
5349
5465
|
"table-auto": layout === "auto",
|
5350
5466
|
"table-fixed": layout === "fixed"
|
5351
5467
|
})
|
5352
|
-
}), /* @__PURE__ */
|
5353
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5468
|
+
}), /* @__PURE__ */ React50.createElement(Table2.Head, null, columns.map(
|
5469
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React50.createElement(Table2.SortCell, __spreadValues({
|
5354
5470
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5355
5471
|
onClick: () => updateSort(column.field),
|
5356
5472
|
style: { width: column.width }
|
5357
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
5473
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5358
5474
|
style: { width: column.width }
|
5359
5475
|
}), column.headerName)
|
5360
|
-
)), /* @__PURE__ */
|
5476
|
+
)), /* @__PURE__ */ React50.createElement(Table2.Body, null, /* @__PURE__ */ React50.createElement(List, {
|
5361
5477
|
items: sortedRows,
|
5362
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5478
|
+
renderItem: (row, index) => /* @__PURE__ */ React50.createElement(Table2.Row, {
|
5363
5479
|
key: row.id
|
5364
|
-
}, /* @__PURE__ */
|
5480
|
+
}, /* @__PURE__ */ React50.createElement(List, {
|
5365
5481
|
items: columns,
|
5366
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5482
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React50.createElement(StatusChip, __spreadValues({
|
5367
5483
|
dense: true
|
5368
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5484
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React50.createElement(SecondaryButton, __spreadValues({
|
5369
5485
|
dense: true
|
5370
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5486
|
+
}, 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
5487
|
}))
|
5372
5488
|
})));
|
5373
5489
|
};
|
5374
5490
|
|
5375
5491
|
// src/components/Dialog/Dialog.tsx
|
5376
|
-
import
|
5492
|
+
import React52 from "react";
|
5377
5493
|
import { useDialog } from "@react-aria/dialog";
|
5378
5494
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
5379
5495
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
5380
5496
|
import { useId } from "@react-aria/utils";
|
5381
5497
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
5382
|
-
import
|
5498
|
+
import omit7 from "lodash/omit";
|
5383
5499
|
|
5384
5500
|
// src/common/Dialog/Dialog.tsx
|
5385
5501
|
var import_confirm2 = __toESM(require_confirm());
|
@@ -5401,10 +5517,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
5401
5517
|
};
|
5402
5518
|
|
5403
5519
|
// src/common/Modal/Modal.tsx
|
5404
|
-
import
|
5520
|
+
import React51 from "react";
|
5405
5521
|
var Modal = (_a) => {
|
5406
5522
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
5407
|
-
return open ? /* @__PURE__ */
|
5523
|
+
return open ? /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5408
5524
|
className: classNames(
|
5409
5525
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
5410
5526
|
className
|
@@ -5413,14 +5529,14 @@ var Modal = (_a) => {
|
|
5413
5529
|
};
|
5414
5530
|
Modal.BackDrop = (_a) => {
|
5415
5531
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5416
|
-
return /* @__PURE__ */
|
5532
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5417
5533
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
5418
5534
|
}));
|
5419
5535
|
};
|
5420
|
-
Modal.Dialog =
|
5536
|
+
Modal.Dialog = React51.forwardRef(
|
5421
5537
|
(_a, ref) => {
|
5422
5538
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
5423
|
-
return /* @__PURE__ */
|
5539
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({
|
5424
5540
|
ref,
|
5425
5541
|
"aria-modal": "true"
|
5426
5542
|
}, rest), {
|
@@ -5438,31 +5554,31 @@ Modal.Dialog = React49.forwardRef(
|
|
5438
5554
|
);
|
5439
5555
|
Modal.Header = (_a) => {
|
5440
5556
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5441
|
-
return /* @__PURE__ */
|
5557
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5442
5558
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
5443
5559
|
}), children);
|
5444
5560
|
};
|
5445
5561
|
Modal.HeaderImage = (_a) => {
|
5446
5562
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
5447
5563
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
5448
|
-
return backgroundImage ? /* @__PURE__ */
|
5564
|
+
return backgroundImage ? /* @__PURE__ */ React51.createElement("img", __spreadProps(__spreadValues({
|
5449
5565
|
"aria-hidden": true,
|
5450
5566
|
src: backgroundImage != null ? backgroundImage : void 0
|
5451
5567
|
}, rest), {
|
5452
5568
|
className: classNames(common, tw("object-cover"), className)
|
5453
|
-
})) : /* @__PURE__ */
|
5569
|
+
})) : /* @__PURE__ */ React51.createElement("div", {
|
5454
5570
|
className: classNames(common, tw("bg-grey-5"), className)
|
5455
5571
|
});
|
5456
5572
|
};
|
5457
5573
|
Modal.CloseButtonContainer = (_a) => {
|
5458
5574
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5459
|
-
return /* @__PURE__ */
|
5575
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5460
5576
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
5461
5577
|
}));
|
5462
5578
|
};
|
5463
5579
|
Modal.Title = (_a) => {
|
5464
5580
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5465
|
-
return /* @__PURE__ */
|
5581
|
+
return /* @__PURE__ */ React51.createElement(Typography, __spreadValues({
|
5466
5582
|
htmlTag: "h2",
|
5467
5583
|
variant: "subheading",
|
5468
5584
|
color: "grey-90",
|
@@ -5471,33 +5587,33 @@ Modal.Title = (_a) => {
|
|
5471
5587
|
};
|
5472
5588
|
Modal.Subtitle = (_a) => {
|
5473
5589
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5474
|
-
return /* @__PURE__ */
|
5590
|
+
return /* @__PURE__ */ React51.createElement(Typography, __spreadValues({
|
5475
5591
|
variant: "small",
|
5476
5592
|
color: "grey-60"
|
5477
5593
|
}, rest), children);
|
5478
5594
|
};
|
5479
5595
|
Modal.TitleContainer = (_a) => {
|
5480
5596
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5481
|
-
return /* @__PURE__ */
|
5597
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5482
5598
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
5483
5599
|
}), children);
|
5484
5600
|
};
|
5485
5601
|
Modal.Body = (_a) => {
|
5486
5602
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
5487
|
-
return /* @__PURE__ */
|
5603
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5488
5604
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
5489
5605
|
style: __spreadValues({ maxHeight }, style)
|
5490
5606
|
}), children);
|
5491
5607
|
};
|
5492
5608
|
Modal.Footer = (_a) => {
|
5493
5609
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5494
|
-
return /* @__PURE__ */
|
5610
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5495
5611
|
className: classNames(tw("px-7 py-6"), className)
|
5496
5612
|
}), children);
|
5497
5613
|
};
|
5498
5614
|
Modal.Actions = (_a) => {
|
5499
5615
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5500
|
-
return /* @__PURE__ */
|
5616
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5501
5617
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
5502
5618
|
}), children);
|
5503
5619
|
};
|
@@ -5511,7 +5627,7 @@ var Dialog = ({
|
|
5511
5627
|
primaryAction,
|
5512
5628
|
secondaryAction
|
5513
5629
|
}) => {
|
5514
|
-
const ref =
|
5630
|
+
const ref = React52.useRef(null);
|
5515
5631
|
const state = useOverlayTriggerState2({ isOpen: open });
|
5516
5632
|
const { modalProps, underlayProps } = useModalOverlay({ isDismissable: false }, state, ref);
|
5517
5633
|
const labelledBy = useId();
|
@@ -5523,34 +5639,34 @@ var Dialog = ({
|
|
5523
5639
|
if (!open) {
|
5524
5640
|
return null;
|
5525
5641
|
}
|
5526
|
-
return /* @__PURE__ */
|
5642
|
+
return /* @__PURE__ */ React52.createElement(Overlay, null, /* @__PURE__ */ React52.createElement(Modal, {
|
5527
5643
|
open
|
5528
|
-
}, /* @__PURE__ */
|
5644
|
+
}, /* @__PURE__ */ React52.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React52.createElement(FocusScope2, {
|
5529
5645
|
contain: true,
|
5530
5646
|
restoreFocus: true,
|
5531
5647
|
autoFocus: true
|
5532
|
-
}, /* @__PURE__ */
|
5648
|
+
}, /* @__PURE__ */ React52.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
5533
5649
|
ref,
|
5534
5650
|
size: "sm"
|
5535
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
5651
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React52.createElement(Modal.Header, null, /* @__PURE__ */ React52.createElement(Icon, {
|
5536
5652
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
5537
5653
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
5538
5654
|
fontSize: 20
|
5539
|
-
}), /* @__PURE__ */
|
5655
|
+
}), /* @__PURE__ */ React52.createElement(Modal.Title, {
|
5540
5656
|
id: labelledBy,
|
5541
5657
|
variant: "large-strong",
|
5542
5658
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
5543
|
-
}, title)), /* @__PURE__ */
|
5659
|
+
}, title)), /* @__PURE__ */ React52.createElement(Modal.Body, {
|
5544
5660
|
id: describedBy
|
5545
|
-
}, children), /* @__PURE__ */
|
5661
|
+
}, children), /* @__PURE__ */ React52.createElement(Modal.Footer, null, /* @__PURE__ */ React52.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React52.createElement(GhostButton, __spreadValues({
|
5546
5662
|
key: secondaryAction.text
|
5547
|
-
},
|
5663
|
+
}, omit7(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React52.createElement(SecondaryButton, __spreadValues({
|
5548
5664
|
key: primaryAction.text
|
5549
|
-
},
|
5665
|
+
}, omit7(primaryAction, "text")), primaryAction.text)))))));
|
5550
5666
|
};
|
5551
5667
|
|
5552
5668
|
// src/components/Divider/Divider.tsx
|
5553
|
-
import
|
5669
|
+
import React53 from "react";
|
5554
5670
|
var sizeClasses = {
|
5555
5671
|
horizontal: {
|
5556
5672
|
1: "h-1px",
|
@@ -5572,7 +5688,7 @@ var sizeClasses = {
|
|
5572
5688
|
var Divider2 = (_a) => {
|
5573
5689
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
5574
5690
|
const sizeClass = sizeClasses[direction][size];
|
5575
|
-
return /* @__PURE__ */
|
5691
|
+
return /* @__PURE__ */ React53.createElement("div", __spreadProps(__spreadValues({}, props), {
|
5576
5692
|
className: tw(`bg-grey-5 ${sizeClass}`, {
|
5577
5693
|
"block w-full": direction === "horizontal",
|
5578
5694
|
"inline-block h-full": direction === "vertical"
|
@@ -5581,10 +5697,10 @@ var Divider2 = (_a) => {
|
|
5581
5697
|
};
|
5582
5698
|
|
5583
5699
|
// src/components/Dropdown/Dropdown.tsx
|
5584
|
-
import
|
5700
|
+
import React55 from "react";
|
5585
5701
|
|
5586
5702
|
// src/components/Popover/Popover.tsx
|
5587
|
-
import
|
5703
|
+
import React54, { useRef as useRef4 } from "react";
|
5588
5704
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
5589
5705
|
import { useOverlayPosition as useOverlayPosition3, useOverlayTrigger } from "@react-aria/overlays";
|
5590
5706
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -5633,22 +5749,22 @@ var Popover2 = (props) => {
|
|
5633
5749
|
state,
|
5634
5750
|
triggerRef
|
5635
5751
|
);
|
5636
|
-
return /* @__PURE__ */
|
5752
|
+
return /* @__PURE__ */ React54.createElement(PopoverContext.Provider, {
|
5637
5753
|
value: {
|
5638
5754
|
state
|
5639
5755
|
}
|
5640
|
-
},
|
5756
|
+
}, React54.Children.map(props.children, (child) => {
|
5641
5757
|
if (isComponentType(child, Popover2.Trigger)) {
|
5642
|
-
return /* @__PURE__ */
|
5758
|
+
return /* @__PURE__ */ React54.createElement(PressResponder, __spreadValues({
|
5643
5759
|
ref: triggerRef,
|
5644
5760
|
onPress: state.toggle
|
5645
|
-
}, triggerProps), /* @__PURE__ */
|
5761
|
+
}, triggerProps), /* @__PURE__ */ React54.createElement(PopoverTriggerWrapper, {
|
5646
5762
|
"data-testid": props["data-testid"],
|
5647
5763
|
"aria-controls": id
|
5648
5764
|
}, child.props.children));
|
5649
5765
|
}
|
5650
5766
|
if (isComponentType(child, Popover2.Panel)) {
|
5651
|
-
return /* @__PURE__ */
|
5767
|
+
return /* @__PURE__ */ React54.createElement(PopoverWrapper, __spreadProps(__spreadValues(__spreadValues({
|
5652
5768
|
ref: overlayRef,
|
5653
5769
|
isOpen: state.isOpen,
|
5654
5770
|
onClose: state.close,
|
@@ -5679,7 +5795,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
5679
5795
|
state.close();
|
5680
5796
|
onClick == null ? void 0 : onClick(e);
|
5681
5797
|
};
|
5682
|
-
return /* @__PURE__ */
|
5798
|
+
return /* @__PURE__ */ React54.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
5683
5799
|
onClick: handleClick
|
5684
5800
|
}));
|
5685
5801
|
};
|
@@ -5692,9 +5808,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5692
5808
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5693
5809
|
var _a2;
|
5694
5810
|
const ref = useRef4(null);
|
5695
|
-
const trigger =
|
5811
|
+
const trigger = React54.Children.only(children);
|
5696
5812
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
|
5697
|
-
return
|
5813
|
+
return React54.cloneElement(trigger, __spreadProps(__spreadValues({
|
5698
5814
|
"ref": ref
|
5699
5815
|
}, mergeProps3(pressProps, trigger.props)), {
|
5700
5816
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -5703,11 +5819,11 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5703
5819
|
|
5704
5820
|
// src/components/Dropdown/Dropdown.tsx
|
5705
5821
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
5706
|
-
return /* @__PURE__ */
|
5822
|
+
return /* @__PURE__ */ React55.createElement(Popover2, {
|
5707
5823
|
type: "menu",
|
5708
5824
|
placement,
|
5709
5825
|
autoFocus: true
|
5710
|
-
}, /* @__PURE__ */
|
5826
|
+
}, /* @__PURE__ */ React55.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React55.createElement(Popover2.Panel, null, content));
|
5711
5827
|
};
|
5712
5828
|
var DropdownMenu = ({
|
5713
5829
|
title,
|
@@ -5716,26 +5832,26 @@ var DropdownMenu = ({
|
|
5716
5832
|
triggerId,
|
5717
5833
|
setClose = () => void 0
|
5718
5834
|
}) => {
|
5719
|
-
const menuRef =
|
5720
|
-
|
5835
|
+
const menuRef = React55.useRef(null);
|
5836
|
+
React55.useEffect(() => {
|
5721
5837
|
const id = setTimeout(() => {
|
5722
5838
|
var _a, _b, _c;
|
5723
5839
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
5724
5840
|
});
|
5725
5841
|
return () => clearTimeout(id);
|
5726
5842
|
}, [menuRef.current]);
|
5727
|
-
return /* @__PURE__ */
|
5843
|
+
return /* @__PURE__ */ React55.createElement("div", {
|
5728
5844
|
style: { minWidth: "250px" },
|
5729
5845
|
className: tw("py-3 bg-white")
|
5730
|
-
}, !!title && /* @__PURE__ */
|
5846
|
+
}, !!title && /* @__PURE__ */ React55.createElement("div", {
|
5731
5847
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
5732
|
-
}, title), /* @__PURE__ */
|
5848
|
+
}, title), /* @__PURE__ */ React55.createElement("ol", {
|
5733
5849
|
role: "menu",
|
5734
5850
|
ref: menuRef,
|
5735
5851
|
id: contentId,
|
5736
5852
|
"aria-labelledby": triggerId
|
5737
|
-
},
|
5738
|
-
return
|
5853
|
+
}, React55.Children.map(children, (child) => {
|
5854
|
+
return React55.cloneElement(child, { setClose });
|
5739
5855
|
})));
|
5740
5856
|
};
|
5741
5857
|
var DropdownItem = (_a) => {
|
@@ -5790,10 +5906,10 @@ var DropdownItem = (_a) => {
|
|
5790
5906
|
handleSelect();
|
5791
5907
|
}
|
5792
5908
|
};
|
5793
|
-
const itemContent = /* @__PURE__ */
|
5909
|
+
const itemContent = /* @__PURE__ */ React55.createElement("div", {
|
5794
5910
|
className: tw("py-3 px-4")
|
5795
5911
|
}, children);
|
5796
|
-
return /* @__PURE__ */
|
5912
|
+
return /* @__PURE__ */ React55.createElement("li", __spreadProps(__spreadValues({
|
5797
5913
|
role: "menuitem",
|
5798
5914
|
tabIndex: -1,
|
5799
5915
|
onClick: handleClick,
|
@@ -5804,7 +5920,7 @@ var DropdownItem = (_a) => {
|
|
5804
5920
|
"text-grey-10 cursor-not-allowed": disabled,
|
5805
5921
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
5806
5922
|
})
|
5807
|
-
}), tooltip ? /* @__PURE__ */
|
5923
|
+
}), tooltip ? /* @__PURE__ */ React55.createElement(Tooltip, {
|
5808
5924
|
content: tooltip,
|
5809
5925
|
placement: tooltipPlacement,
|
5810
5926
|
inline: false
|
@@ -5814,7 +5930,7 @@ Dropdown.Menu = DropdownMenu;
|
|
5814
5930
|
Dropdown.Item = DropdownItem;
|
5815
5931
|
|
5816
5932
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
5817
|
-
import
|
5933
|
+
import React59 from "react";
|
5818
5934
|
import { useFilter } from "@react-aria/i18n";
|
5819
5935
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
5820
5936
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
@@ -5826,8 +5942,8 @@ import { useMenuTriggerState } from "@react-stately/menu";
|
|
5826
5942
|
import { useTreeState } from "@react-stately/tree";
|
5827
5943
|
|
5828
5944
|
// src/components/Input/Input.tsx
|
5829
|
-
import
|
5830
|
-
import
|
5945
|
+
import React57, { forwardRef, useImperativeHandle, useRef as useRef5, useState as useState6 } from "react";
|
5946
|
+
import omit8 from "lodash/omit";
|
5831
5947
|
import toString from "lodash/toString";
|
5832
5948
|
import uniqueId3 from "lodash/uniqueId";
|
5833
5949
|
|
@@ -5843,31 +5959,31 @@ var getCommonInputStyles = ({ readOnly, valid }) => tw(
|
|
5843
5959
|
);
|
5844
5960
|
|
5845
5961
|
// src/utils/form/InputAdornment/InputAdornment.tsx
|
5846
|
-
import
|
5962
|
+
import React56 from "react";
|
5847
5963
|
var import_cross4 = __toESM(require_cross());
|
5848
5964
|
var import_error3 = __toESM(require_error());
|
5849
5965
|
var import_search2 = __toESM(require_search());
|
5850
5966
|
var import_tick3 = __toESM(require_tick());
|
5851
5967
|
var InputAdornment = ({ placement = "right", className, dense, children }) => {
|
5852
|
-
return /* @__PURE__ */
|
5968
|
+
return /* @__PURE__ */ React56.createElement("span", {
|
5853
5969
|
className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
|
5854
5970
|
"right-0": placement === "right",
|
5855
5971
|
"left-0": placement === "left",
|
5856
5972
|
"typography-small": dense,
|
5857
5973
|
"typography-default-strong": !dense
|
5858
5974
|
})
|
5859
|
-
}, /* @__PURE__ */
|
5975
|
+
}, /* @__PURE__ */ React56.createElement(Flexbox, {
|
5860
5976
|
gap: "3",
|
5861
5977
|
wrap: "wrap"
|
5862
5978
|
}, children));
|
5863
5979
|
};
|
5864
|
-
var SearchIcon = ({ onClick }) => /* @__PURE__ */
|
5980
|
+
var SearchIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
|
5865
5981
|
icon: import_search2.default,
|
5866
5982
|
color: "grey-30",
|
5867
5983
|
"data-testid": "icon-search",
|
5868
5984
|
onClick
|
5869
5985
|
});
|
5870
|
-
var ResetIcon = ({ onClick }) => /* @__PURE__ */
|
5986
|
+
var ResetIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
|
5871
5987
|
className: "hover:cursor-pointer",
|
5872
5988
|
icon: import_cross4.default,
|
5873
5989
|
color: "grey-30",
|
@@ -5897,7 +6013,7 @@ var createInput = (displayName, opts = {}) => {
|
|
5897
6013
|
"readOnly"
|
5898
6014
|
]);
|
5899
6015
|
var _a2;
|
5900
|
-
const inputRef =
|
6016
|
+
const inputRef = React57.useRef(null);
|
5901
6017
|
useImperativeHandle(ref, () => inputRef.current);
|
5902
6018
|
const handleReset = () => {
|
5903
6019
|
var _a3;
|
@@ -5910,11 +6026,11 @@ var createInput = (displayName, opts = {}) => {
|
|
5910
6026
|
el.focus();
|
5911
6027
|
}
|
5912
6028
|
};
|
5913
|
-
return /* @__PURE__ */
|
6029
|
+
return /* @__PURE__ */ React57.createElement("span", {
|
5914
6030
|
className: tw("relative block")
|
5915
|
-
}, opts.adornment && /* @__PURE__ */
|
6031
|
+
}, opts.adornment && /* @__PURE__ */ React57.createElement(InputAdornment, {
|
5916
6032
|
placement: "left"
|
5917
|
-
}, opts.adornment), /* @__PURE__ */
|
6033
|
+
}, opts.adornment), /* @__PURE__ */ React57.createElement("input", __spreadProps(__spreadValues({
|
5918
6034
|
ref: inputRef,
|
5919
6035
|
type
|
5920
6036
|
}, props), {
|
@@ -5929,20 +6045,20 @@ var createInput = (displayName, opts = {}) => {
|
|
5929
6045
|
getCommonInputStyles({ readOnly, valid }),
|
5930
6046
|
props.className
|
5931
6047
|
)
|
5932
|
-
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */
|
6048
|
+
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React57.createElement(InputAdornment, null, /* @__PURE__ */ React57.createElement(ResetIcon, {
|
5933
6049
|
onClick: handleReset
|
5934
|
-
})), !opts.canReset && endAdornment && /* @__PURE__ */
|
6050
|
+
})), !opts.canReset && endAdornment && /* @__PURE__ */ React57.createElement(InputAdornment, null, endAdornment));
|
5935
6051
|
}
|
5936
6052
|
);
|
5937
6053
|
InputComponent.displayName = displayName;
|
5938
|
-
InputComponent.Skeleton = () => /* @__PURE__ */
|
6054
|
+
InputComponent.Skeleton = () => /* @__PURE__ */ React57.createElement(Skeleton, {
|
5939
6055
|
height: 38
|
5940
6056
|
});
|
5941
6057
|
return InputComponent;
|
5942
6058
|
};
|
5943
6059
|
var InputBase = createInput("InputBase");
|
5944
|
-
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */
|
5945
|
-
var Input2 =
|
6060
|
+
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React57.createElement(SearchIcon, null), canReset: true });
|
6061
|
+
var Input2 = React57.forwardRef((_a, ref) => {
|
5946
6062
|
var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
|
5947
6063
|
var _a2, _b2, _c;
|
5948
6064
|
const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
|
@@ -5950,13 +6066,13 @@ var Input2 = React55.forwardRef((_a, ref) => {
|
|
5950
6066
|
const errorMessageId = uniqueId3();
|
5951
6067
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
5952
6068
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
5953
|
-
const baseProps =
|
5954
|
-
return /* @__PURE__ */
|
6069
|
+
const baseProps = omit8(props, Object.keys(labelControlProps));
|
6070
|
+
return /* @__PURE__ */ React57.createElement(LabelControl, __spreadValues({
|
5955
6071
|
id: `${id.current}-label`,
|
5956
6072
|
htmlFor: id.current,
|
5957
6073
|
messageId: errorMessageId,
|
5958
6074
|
length: value !== void 0 ? toString(value).length : void 0
|
5959
|
-
}, labelControlProps), /* @__PURE__ */
|
6075
|
+
}, labelControlProps), /* @__PURE__ */ React57.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
|
5960
6076
|
ref
|
5961
6077
|
}, baseProps), errorProps), {
|
5962
6078
|
id: id.current,
|
@@ -5974,16 +6090,16 @@ var Input2 = React55.forwardRef((_a, ref) => {
|
|
5974
6090
|
})));
|
5975
6091
|
});
|
5976
6092
|
Input2.displayName = "Input";
|
5977
|
-
Input2.Skeleton = () => /* @__PURE__ */
|
6093
|
+
Input2.Skeleton = () => /* @__PURE__ */ React57.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React57.createElement(InputBase.Skeleton, null));
|
5978
6094
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
5979
6095
|
|
5980
6096
|
// src/common/DropdownMenu/DropdownMenu.tsx
|
5981
|
-
import
|
6097
|
+
import React58 from "react";
|
5982
6098
|
var import_tick4 = __toESM(require_tick());
|
5983
|
-
var DropdownMenu2 =
|
6099
|
+
var DropdownMenu2 = React58.forwardRef(
|
5984
6100
|
(_a, ref) => {
|
5985
6101
|
var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
|
5986
|
-
return /* @__PURE__ */
|
6102
|
+
return /* @__PURE__ */ React58.createElement("div", __spreadValues({
|
5987
6103
|
ref,
|
5988
6104
|
style: { maxHeight, minWidth, maxWidth },
|
5989
6105
|
className: classNames(
|
@@ -5993,25 +6109,25 @@ var DropdownMenu2 = React56.forwardRef(
|
|
5993
6109
|
}, props), children);
|
5994
6110
|
}
|
5995
6111
|
);
|
5996
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
6112
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React58.createElement("div", {
|
5997
6113
|
className: tw("p-3")
|
5998
6114
|
}, children);
|
5999
6115
|
DropdownMenu2.ContentContainer = ContentContainer;
|
6000
|
-
var List2 =
|
6116
|
+
var List2 = React58.forwardRef(
|
6001
6117
|
(_a, ref) => {
|
6002
6118
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6003
|
-
return /* @__PURE__ */
|
6119
|
+
return /* @__PURE__ */ React58.createElement("ul", __spreadValues({
|
6004
6120
|
ref
|
6005
6121
|
}, props), children);
|
6006
6122
|
}
|
6007
6123
|
);
|
6008
6124
|
DropdownMenu2.List = List2;
|
6009
|
-
var Group2 =
|
6125
|
+
var Group2 = React58.forwardRef(
|
6010
6126
|
(_a, ref) => {
|
6011
6127
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
6012
|
-
return /* @__PURE__ */
|
6128
|
+
return /* @__PURE__ */ React58.createElement("li", __spreadValues({
|
6013
6129
|
ref
|
6014
|
-
}, props), title && /* @__PURE__ */
|
6130
|
+
}, props), title && /* @__PURE__ */ React58.createElement("div", __spreadValues({
|
6015
6131
|
className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
|
6016
6132
|
"text-grey-20": props.disabled
|
6017
6133
|
})
|
@@ -6019,10 +6135,10 @@ var Group2 = React56.forwardRef(
|
|
6019
6135
|
}
|
6020
6136
|
);
|
6021
6137
|
DropdownMenu2.Group = Group2;
|
6022
|
-
var Item3 =
|
6138
|
+
var Item3 = React58.forwardRef(
|
6023
6139
|
(_a, ref) => {
|
6024
6140
|
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
6025
|
-
return /* @__PURE__ */
|
6141
|
+
return /* @__PURE__ */ React58.createElement("li", __spreadValues({
|
6026
6142
|
ref,
|
6027
6143
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
6028
6144
|
"cursor-pointer hover:bg-grey-0": !props.disabled,
|
@@ -6030,30 +6146,30 @@ var Item3 = React56.forwardRef(
|
|
6030
6146
|
"text-primary-80": kind === "action",
|
6031
6147
|
"text-grey-20 cursor-not-allowed": props.disabled
|
6032
6148
|
})
|
6033
|
-
}, props), icon && /* @__PURE__ */
|
6149
|
+
}, props), icon && /* @__PURE__ */ React58.createElement(InlineIcon, {
|
6034
6150
|
icon
|
6035
|
-
}), /* @__PURE__ */
|
6151
|
+
}), /* @__PURE__ */ React58.createElement("span", {
|
6036
6152
|
className: tw("grow")
|
6037
|
-
}, children), selected && /* @__PURE__ */
|
6153
|
+
}, children), selected && /* @__PURE__ */ React58.createElement(InlineIcon, {
|
6038
6154
|
icon: import_tick4.default
|
6039
6155
|
}));
|
6040
6156
|
}
|
6041
6157
|
);
|
6042
6158
|
DropdownMenu2.Item = Item3;
|
6043
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
6159
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React58.createElement(Typography2.Caption, {
|
6044
6160
|
color: disabled ? "grey-20" : "grey-40"
|
6045
6161
|
}, children);
|
6046
6162
|
DropdownMenu2.Description = Description;
|
6047
6163
|
var Separator = (_a) => {
|
6048
6164
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
6049
|
-
return /* @__PURE__ */
|
6165
|
+
return /* @__PURE__ */ React58.createElement("li", __spreadProps(__spreadValues({}, props), {
|
6050
6166
|
className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
|
6051
6167
|
}));
|
6052
6168
|
};
|
6053
6169
|
DropdownMenu2.Separator = Separator;
|
6054
6170
|
var EmptyStateContainer2 = (_a) => {
|
6055
6171
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
6056
|
-
return /* @__PURE__ */
|
6172
|
+
return /* @__PURE__ */ React58.createElement("div", __spreadValues({
|
6057
6173
|
className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
|
6058
6174
|
}, props), children);
|
6059
6175
|
};
|
@@ -6108,8 +6224,8 @@ var DropdownMenu3 = (_a) => {
|
|
6108
6224
|
"footer",
|
6109
6225
|
"children"
|
6110
6226
|
]);
|
6111
|
-
const triggerRef =
|
6112
|
-
const overlayRef =
|
6227
|
+
const triggerRef = React59.useRef(null);
|
6228
|
+
const overlayRef = React59.useRef(null);
|
6113
6229
|
const [trigger, items] = extractTriggerAndItems(children);
|
6114
6230
|
const state = useMenuTriggerState(props);
|
6115
6231
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
@@ -6120,17 +6236,17 @@ var DropdownMenu3 = (_a) => {
|
|
6120
6236
|
shouldFlip: true,
|
6121
6237
|
isOpen: state.isOpen
|
6122
6238
|
});
|
6123
|
-
return /* @__PURE__ */
|
6239
|
+
return /* @__PURE__ */ React59.createElement("div", null, /* @__PURE__ */ React59.createElement(PressResponder2, __spreadValues({
|
6124
6240
|
ref: triggerRef,
|
6125
6241
|
onPress: () => state.toggle()
|
6126
|
-
}, menuTriggerProps), /* @__PURE__ */
|
6242
|
+
}, menuTriggerProps), /* @__PURE__ */ React59.createElement(TriggerWrapper, null, trigger.props.children)), /* @__PURE__ */ React59.createElement(PopoverWrapper, __spreadValues({
|
6127
6243
|
ref: overlayRef,
|
6128
6244
|
isDismissable: true,
|
6129
6245
|
autoFocus: true,
|
6130
6246
|
containFocus: true,
|
6131
6247
|
isOpen: state.isOpen,
|
6132
6248
|
onClose: state.close
|
6133
|
-
}, overlayProps), /* @__PURE__ */
|
6249
|
+
}, overlayProps), /* @__PURE__ */ React59.createElement(MenuWrapper, __spreadValues({
|
6134
6250
|
onAction,
|
6135
6251
|
selectionMode,
|
6136
6252
|
selection,
|
@@ -6151,13 +6267,13 @@ DropdownMenu3.Item = Item4;
|
|
6151
6267
|
DropdownMenu3.Section = Section;
|
6152
6268
|
var TriggerWrapper = (_a) => {
|
6153
6269
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6154
|
-
const ref =
|
6270
|
+
const ref = React59.useRef(null);
|
6155
6271
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
|
6156
|
-
const trigger =
|
6157
|
-
if (!trigger || !
|
6272
|
+
const trigger = React59.Children.only(children);
|
6273
|
+
if (!trigger || !React59.isValidElement(trigger)) {
|
6158
6274
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
6159
6275
|
}
|
6160
|
-
return
|
6276
|
+
return React59.cloneElement(trigger, __spreadValues({ ref }, mergeProps4(pressProps, props)));
|
6161
6277
|
};
|
6162
6278
|
var isSectionNode = (item) => item.type === "section";
|
6163
6279
|
var isItemNode = (item) => item.type === "item";
|
@@ -6179,7 +6295,7 @@ var MenuWrapper = (_a) => {
|
|
6179
6295
|
"header",
|
6180
6296
|
"footer"
|
6181
6297
|
]);
|
6182
|
-
const ref =
|
6298
|
+
const ref = React59.useRef(null);
|
6183
6299
|
const disabledKeys = getDisabledItemKeys(props.children);
|
6184
6300
|
const state = useTreeState(__spreadValues({
|
6185
6301
|
disabledKeys,
|
@@ -6187,30 +6303,30 @@ var MenuWrapper = (_a) => {
|
|
6187
6303
|
}, props));
|
6188
6304
|
const { menuProps } = useMenu(props, state, ref);
|
6189
6305
|
const { contains } = useFilter({ sensitivity: "base" });
|
6190
|
-
const [search, setSearch] =
|
6191
|
-
const filteredCollection =
|
6306
|
+
const [search, setSearch] = React59.useState("");
|
6307
|
+
const filteredCollection = React59.useMemo(
|
6192
6308
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
6193
6309
|
[state.collection, search, contains]
|
6194
6310
|
);
|
6195
|
-
return /* @__PURE__ */
|
6311
|
+
return /* @__PURE__ */ React59.createElement(DropdownMenu2, {
|
6196
6312
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
6197
6313
|
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
|
6198
|
-
}, header, /* @__PURE__ */
|
6314
|
+
}, header, /* @__PURE__ */ React59.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React59.createElement(SearchInput, {
|
6199
6315
|
"aria-label": "search",
|
6200
6316
|
value: search,
|
6201
6317
|
onChange: (e) => setSearch(e.target.value),
|
6202
6318
|
className: tw("mb-5")
|
6203
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
6319
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React59.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React59.createElement(DropdownMenu2.List, __spreadValues({
|
6204
6320
|
ref
|
6205
6321
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
6206
6322
|
if (isSectionNode(item)) {
|
6207
|
-
return /* @__PURE__ */
|
6323
|
+
return /* @__PURE__ */ React59.createElement(SectionWrapper, {
|
6208
6324
|
key: item.key,
|
6209
6325
|
section: item,
|
6210
6326
|
state
|
6211
6327
|
});
|
6212
6328
|
} else if (isItemNode(item)) {
|
6213
|
-
return /* @__PURE__ */
|
6329
|
+
return /* @__PURE__ */ React59.createElement(ItemWrapper, {
|
6214
6330
|
key: item.key,
|
6215
6331
|
item,
|
6216
6332
|
state
|
@@ -6219,14 +6335,14 @@ var MenuWrapper = (_a) => {
|
|
6219
6335
|
}))), footer);
|
6220
6336
|
};
|
6221
6337
|
var ItemWrapper = ({ item, state }) => {
|
6222
|
-
const ref =
|
6338
|
+
const ref = React59.useRef(null);
|
6223
6339
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
6224
6340
|
{ key: item.key },
|
6225
6341
|
state,
|
6226
6342
|
ref
|
6227
6343
|
);
|
6228
6344
|
const { icon, description, kind = "default" } = item.props;
|
6229
|
-
return /* @__PURE__ */
|
6345
|
+
return /* @__PURE__ */ React59.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
|
6230
6346
|
ref
|
6231
6347
|
}, menuItemProps), {
|
6232
6348
|
kind,
|
@@ -6234,7 +6350,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
6234
6350
|
highlighted: isFocused,
|
6235
6351
|
disabled: isDisabled,
|
6236
6352
|
icon
|
6237
|
-
}), item.rendered, description && /* @__PURE__ */
|
6353
|
+
}), item.rendered, description && /* @__PURE__ */ React59.createElement(DropdownMenu2.Description, __spreadValues({
|
6238
6354
|
disabled: isDisabled
|
6239
6355
|
}, descriptionProps), description));
|
6240
6356
|
};
|
@@ -6246,24 +6362,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
6246
6362
|
const { separatorProps } = useSeparator({
|
6247
6363
|
elementType: "li"
|
6248
6364
|
});
|
6249
|
-
return /* @__PURE__ */
|
6365
|
+
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
6366
|
title: section.rendered,
|
6251
6367
|
titleProps: headingProps
|
6252
|
-
}, itemProps), /* @__PURE__ */
|
6368
|
+
}, itemProps), /* @__PURE__ */ React59.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React59.createElement(ItemWrapper, {
|
6253
6369
|
key: node.key,
|
6254
6370
|
item: node,
|
6255
6371
|
state
|
6256
6372
|
})))));
|
6257
6373
|
};
|
6258
6374
|
var extractTriggerAndItems = (children) => {
|
6259
|
-
const [trigger, items] =
|
6375
|
+
const [trigger, items] = React59.Children.toArray(children);
|
6260
6376
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
6261
6377
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
6262
6378
|
}
|
6263
6379
|
return [trigger, items];
|
6264
6380
|
};
|
6265
6381
|
var getDisabledItemKeys = (children) => {
|
6266
|
-
const keys =
|
6382
|
+
const keys = React59.Children.map(children, (child) => {
|
6267
6383
|
var _a, _b;
|
6268
6384
|
if (!child || typeof child === "function") {
|
6269
6385
|
return null;
|
@@ -6280,11 +6396,11 @@ var getDisabledItemKeys = (children) => {
|
|
6280
6396
|
};
|
6281
6397
|
|
6282
6398
|
// src/components/EmptyState/EmptyState.tsx
|
6283
|
-
import
|
6284
|
-
import
|
6399
|
+
import React61 from "react";
|
6400
|
+
import omit9 from "lodash/omit";
|
6285
6401
|
|
6286
6402
|
// src/components/Flexbox/FlexboxItem.tsx
|
6287
|
-
import
|
6403
|
+
import React60 from "react";
|
6288
6404
|
var FlexboxItem = Tailwindify(
|
6289
6405
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6290
6406
|
const hookStyle = useStyle({
|
@@ -6296,7 +6412,7 @@ var FlexboxItem = Tailwindify(
|
|
6296
6412
|
alignSelf
|
6297
6413
|
});
|
6298
6414
|
const HtmlElement = htmlTag;
|
6299
|
-
return /* @__PURE__ */
|
6415
|
+
return /* @__PURE__ */ React60.createElement(HtmlElement, {
|
6300
6416
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6301
6417
|
className
|
6302
6418
|
}, children);
|
@@ -6353,7 +6469,7 @@ var EmptyState = ({
|
|
6353
6469
|
borderStyle = "dashed"
|
6354
6470
|
}) => {
|
6355
6471
|
const template = layoutStyle(layout);
|
6356
|
-
return /* @__PURE__ */
|
6472
|
+
return /* @__PURE__ */ React61.createElement(Box, {
|
6357
6473
|
className: classNames(
|
6358
6474
|
tw("rounded", {
|
6359
6475
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6365,38 +6481,38 @@ var EmptyState = ({
|
|
6365
6481
|
backgroundColor: "transparent",
|
6366
6482
|
borderColor: "grey-10",
|
6367
6483
|
padding: "9"
|
6368
|
-
}, /* @__PURE__ */
|
6484
|
+
}, /* @__PURE__ */ React61.createElement(Flexbox, {
|
6369
6485
|
direction: template.layout,
|
6370
6486
|
justifyContent: template.justifyContent,
|
6371
6487
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6372
6488
|
colGap: "l5",
|
6373
6489
|
rowGap: "8"
|
6374
|
-
}, image && /* @__PURE__ */
|
6490
|
+
}, image && /* @__PURE__ */ React61.createElement(FlexboxItem, null, /* @__PURE__ */ React61.createElement("img", {
|
6375
6491
|
src: image,
|
6376
6492
|
alt: imageAlt,
|
6377
6493
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6378
|
-
})), /* @__PURE__ */
|
6494
|
+
})), /* @__PURE__ */ React61.createElement(Flexbox, {
|
6379
6495
|
style: { maxWidth: "610px" },
|
6380
6496
|
direction: "column",
|
6381
6497
|
justifyContent: template.justifyContent,
|
6382
6498
|
alignItems: template.alignItems
|
6383
|
-
}, /* @__PURE__ */
|
6499
|
+
}, /* @__PURE__ */ React61.createElement(Typography2, {
|
6384
6500
|
variant: "heading",
|
6385
6501
|
htmlTag: "h2"
|
6386
|
-
}, title), description && /* @__PURE__ */
|
6502
|
+
}, title), description && /* @__PURE__ */ React61.createElement(Box, {
|
6387
6503
|
marginTop: "5"
|
6388
|
-
}, /* @__PURE__ */
|
6504
|
+
}, /* @__PURE__ */ React61.createElement(Typography2, {
|
6389
6505
|
variant: "default",
|
6390
6506
|
color: "grey-60"
|
6391
|
-
}, description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6507
|
+
}, description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React61.createElement(Flexbox, {
|
6392
6508
|
marginTop: "7",
|
6393
6509
|
gap: "4",
|
6394
6510
|
justifyContent: "center",
|
6395
6511
|
alignItems: "center",
|
6396
6512
|
wrap: "wrap"
|
6397
|
-
}, primaryAction && /* @__PURE__ */
|
6513
|
+
}, 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
6514
|
marginTop: "7"
|
6399
|
-
}, /* @__PURE__ */
|
6515
|
+
}, /* @__PURE__ */ React61.createElement(Typography2, {
|
6400
6516
|
htmlTag: "div",
|
6401
6517
|
variant: "small",
|
6402
6518
|
color: "grey-60"
|
@@ -6404,7 +6520,7 @@ var EmptyState = ({
|
|
6404
6520
|
};
|
6405
6521
|
|
6406
6522
|
// src/components/Grid/GridItem.tsx
|
6407
|
-
import
|
6523
|
+
import React62 from "react";
|
6408
6524
|
var GridItem = Tailwindify(
|
6409
6525
|
({
|
6410
6526
|
htmlTag = "div",
|
@@ -6435,7 +6551,7 @@ var GridItem = Tailwindify(
|
|
6435
6551
|
gridRowEnd: rowEnd
|
6436
6552
|
});
|
6437
6553
|
const HtmlElement = htmlTag;
|
6438
|
-
return /* @__PURE__ */
|
6554
|
+
return /* @__PURE__ */ React62.createElement(HtmlElement, {
|
6439
6555
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6440
6556
|
className
|
6441
6557
|
}, children);
|
@@ -6443,23 +6559,23 @@ var GridItem = Tailwindify(
|
|
6443
6559
|
);
|
6444
6560
|
|
6445
6561
|
// src/components/List/List.tsx
|
6446
|
-
import
|
6447
|
-
var List = ({ items, renderItem, container =
|
6562
|
+
import React63 from "react";
|
6563
|
+
var List = ({ items, renderItem, container = React63.Fragment }) => {
|
6448
6564
|
const Component = container;
|
6449
|
-
return /* @__PURE__ */
|
6565
|
+
return /* @__PURE__ */ React63.createElement(Component, null, items.map(renderItem));
|
6450
6566
|
};
|
6451
6567
|
|
6452
6568
|
// src/components/ListItem/ListItem.tsx
|
6453
|
-
import
|
6569
|
+
import React64 from "react";
|
6454
6570
|
var ListItem = ({ name, icon, active = false }) => {
|
6455
|
-
return /* @__PURE__ */
|
6571
|
+
return /* @__PURE__ */ React64.createElement(Flexbox, {
|
6456
6572
|
alignItems: "center"
|
6457
|
-
}, /* @__PURE__ */
|
6573
|
+
}, /* @__PURE__ */ React64.createElement(Typography2, {
|
6458
6574
|
variant: active ? "small-strong" : "small",
|
6459
6575
|
color: "grey-70",
|
6460
6576
|
htmlTag: "span",
|
6461
6577
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6462
|
-
}, /* @__PURE__ */
|
6578
|
+
}, /* @__PURE__ */ React64.createElement("img", {
|
6463
6579
|
src: icon,
|
6464
6580
|
alt: name,
|
6465
6581
|
className: "inline mr-4",
|
@@ -6469,28 +6585,28 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6469
6585
|
};
|
6470
6586
|
|
6471
6587
|
// src/components/Modal/Modal.tsx
|
6472
|
-
import
|
6588
|
+
import React66 from "react";
|
6473
6589
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6474
6590
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
6475
6591
|
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
6476
6592
|
import { useId as useId2 } from "@react-aria/utils";
|
6477
6593
|
import { useOverlayTriggerState as useOverlayTriggerState4 } from "@react-stately/overlays";
|
6478
6594
|
import castArray from "lodash/castArray";
|
6479
|
-
import
|
6595
|
+
import omit10 from "lodash/omit";
|
6480
6596
|
|
6481
6597
|
// src/components/Tabs/Tabs.tsx
|
6482
|
-
import
|
6598
|
+
import React65, { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useState as useState7 } from "react";
|
6483
6599
|
import isNumber4 from "lodash/isNumber";
|
6484
6600
|
import kebabCase from "lodash/kebabCase";
|
6485
6601
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6486
6602
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6487
6603
|
var import_warningSign3 = __toESM(require_warningSign());
|
6488
6604
|
var isTabComponent = (c) => {
|
6489
|
-
return
|
6605
|
+
return React65.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6490
6606
|
};
|
6491
|
-
var Tab =
|
6607
|
+
var Tab = React65.forwardRef(
|
6492
6608
|
({ className, id, title, children }, ref) => {
|
6493
|
-
return /* @__PURE__ */
|
6609
|
+
return /* @__PURE__ */ React65.createElement("div", {
|
6494
6610
|
ref,
|
6495
6611
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6496
6612
|
className,
|
@@ -6502,14 +6618,14 @@ var Tab = React63.forwardRef(
|
|
6502
6618
|
);
|
6503
6619
|
var TabContainer = (_a) => {
|
6504
6620
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6505
|
-
return /* @__PURE__ */
|
6621
|
+
return /* @__PURE__ */ React65.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6506
6622
|
className: classNames("py-6 z-0", className)
|
6507
6623
|
}), children);
|
6508
6624
|
};
|
6509
6625
|
var ModalTab = Tab;
|
6510
6626
|
var ModalTabContainer = TabContainer;
|
6511
6627
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6512
|
-
const Tab2 =
|
6628
|
+
const Tab2 = React65.forwardRef(
|
6513
6629
|
(_a, ref) => {
|
6514
6630
|
var _b = _a, {
|
6515
6631
|
id,
|
@@ -6539,17 +6655,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6539
6655
|
const _id = id != null ? id : kebabCase(title);
|
6540
6656
|
let statusIcon = void 0;
|
6541
6657
|
if (status === "warning") {
|
6542
|
-
statusIcon = /* @__PURE__ */
|
6658
|
+
statusIcon = /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6543
6659
|
icon: import_warningSign3.default,
|
6544
6660
|
color: "warning-80"
|
6545
6661
|
});
|
6546
6662
|
} else if (status === "error") {
|
6547
|
-
statusIcon = /* @__PURE__ */
|
6663
|
+
statusIcon = /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6548
6664
|
icon: import_warningSign3.default,
|
6549
6665
|
color: "error-50"
|
6550
6666
|
});
|
6551
6667
|
}
|
6552
|
-
const tab = /* @__PURE__ */
|
6668
|
+
const tab = /* @__PURE__ */ React65.createElement(Component, __spreadValues({
|
6553
6669
|
ref,
|
6554
6670
|
id: `${_id}-tab`,
|
6555
6671
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6566,24 +6682,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6566
6682
|
"aria-selected": selected,
|
6567
6683
|
"aria-controls": `${_id}-panel`,
|
6568
6684
|
tabIndex: disabled ? void 0 : 0
|
6569
|
-
}, rest), /* @__PURE__ */
|
6685
|
+
}, rest), /* @__PURE__ */ React65.createElement(Typography2, {
|
6570
6686
|
htmlTag: "div",
|
6571
6687
|
variant: "small",
|
6572
6688
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6573
6689
|
className: tw("inline-flex items-center gap-3")
|
6574
|
-
}, /* @__PURE__ */
|
6690
|
+
}, /* @__PURE__ */ React65.createElement("span", {
|
6575
6691
|
className: tw("whitespace-nowrap")
|
6576
|
-
}, title), isNumber4(badge) && /* @__PURE__ */
|
6692
|
+
}, title), isNumber4(badge) && /* @__PURE__ */ React65.createElement(Typography2, {
|
6577
6693
|
htmlTag: "span",
|
6578
6694
|
variant: "small",
|
6579
6695
|
color: selected ? "primary-80" : "grey-5",
|
6580
6696
|
className: "leading-none"
|
6581
|
-
}, /* @__PURE__ */
|
6697
|
+
}, /* @__PURE__ */ React65.createElement(TabBadge, {
|
6582
6698
|
kind: "filled",
|
6583
6699
|
value: badge,
|
6584
6700
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6585
6701
|
})), statusIcon));
|
6586
|
-
return tooltip ? /* @__PURE__ */
|
6702
|
+
return tooltip ? /* @__PURE__ */ React65.createElement(Tooltip, {
|
6587
6703
|
content: tooltip
|
6588
6704
|
}, tab) : tab;
|
6589
6705
|
}
|
@@ -6592,11 +6708,12 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6592
6708
|
return Tab2;
|
6593
6709
|
};
|
6594
6710
|
var TabItem = asTabItem("button", "TabItem");
|
6711
|
+
var CARET_OFFSET = 24;
|
6595
6712
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
6596
6713
|
const Tabs2 = (props) => {
|
6597
6714
|
var _a, _b;
|
6598
6715
|
const { className, value, defaultValue, onChange, children } = props;
|
6599
|
-
const childArr =
|
6716
|
+
const childArr = React65.Children.toArray(children);
|
6600
6717
|
const firstTab = childArr[0];
|
6601
6718
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6602
6719
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -6605,25 +6722,54 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6605
6722
|
const parentRef = useRef6(null);
|
6606
6723
|
const containerRef = useRef6(null);
|
6607
6724
|
const tabsRef = useRef6(null);
|
6725
|
+
const revealSelectedTab = ({ smooth }) => {
|
6726
|
+
var _a2, _b2;
|
6727
|
+
const container = containerRef.current;
|
6728
|
+
const tabs = tabsRef.current;
|
6729
|
+
const values = React65.Children.map(
|
6730
|
+
children,
|
6731
|
+
(tab, i) => {
|
6732
|
+
var _a3;
|
6733
|
+
return (_a3 = tab == null ? void 0 : tab.props.value) != null ? _a3 : i;
|
6734
|
+
}
|
6735
|
+
);
|
6736
|
+
const idx = (_a2 = values == null ? void 0 : values.findIndex((val) => value === val)) != null ? _a2 : -1;
|
6737
|
+
const child = Array.from((_b2 = tabs == null ? void 0 : tabs.childNodes) != null ? _b2 : [])[idx];
|
6738
|
+
if (!container || !(child instanceof HTMLElement)) {
|
6739
|
+
return;
|
6740
|
+
}
|
6741
|
+
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
6742
|
+
const { x, width } = child.getBoundingClientRect();
|
6743
|
+
const isInViewPort = x >= containerX && x + width <= containerX + containerWidth;
|
6744
|
+
if (!isInViewPort) {
|
6745
|
+
container.scrollTo({
|
6746
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
6747
|
+
behavior: smooth ? "smooth" : void 0
|
6748
|
+
});
|
6749
|
+
}
|
6750
|
+
};
|
6751
|
+
const updateCarets = () => {
|
6752
|
+
const pEl = parentRef.current;
|
6753
|
+
const el = containerRef.current;
|
6754
|
+
if (!pEl || !el) {
|
6755
|
+
return;
|
6756
|
+
}
|
6757
|
+
const { width } = pEl.getBoundingClientRect();
|
6758
|
+
const hasLeftCaret = el.scrollWidth > width && el.scrollLeft !== 0;
|
6759
|
+
const hasRightCaret = el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth);
|
6760
|
+
showLeftCaret(hasLeftCaret);
|
6761
|
+
showRightCaret(hasRightCaret);
|
6762
|
+
};
|
6608
6763
|
useEffect5(() => {
|
6609
|
-
if (value
|
6610
|
-
|
6764
|
+
if (value === void 0) {
|
6765
|
+
return;
|
6611
6766
|
}
|
6612
|
-
|
6767
|
+
updateCarets();
|
6768
|
+
setSelected(value);
|
6769
|
+
revealSelectedTab({ smooth: value !== selected });
|
6770
|
+
}, [value, React65.Children.count(children)]);
|
6613
6771
|
useLayoutEffect2(() => {
|
6614
6772
|
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
6773
|
updateCarets();
|
6628
6774
|
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
6629
6775
|
window.addEventListener("resize", updateCarets);
|
@@ -6632,7 +6778,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6632
6778
|
(_a3 = containerRef.current) == null ? void 0 : _a3.removeEventListener("scroll", updateCarets);
|
6633
6779
|
window.removeEventListener("resize", updateCarets);
|
6634
6780
|
};
|
6635
|
-
}, [parentRef.current, containerRef.current]);
|
6781
|
+
}, [parentRef.current, containerRef.current, children]);
|
6636
6782
|
const handleScrollToNext = (direction) => {
|
6637
6783
|
const container = containerRef.current;
|
6638
6784
|
const tabs = tabsRef.current;
|
@@ -6651,7 +6797,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6651
6797
|
if (next instanceof HTMLElement) {
|
6652
6798
|
const { x, width } = next.getBoundingClientRect();
|
6653
6799
|
container.scrollTo({
|
6654
|
-
left: container.scrollLeft + Math.ceil(x + width - containerX - containerWidth),
|
6800
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
6655
6801
|
behavior: "smooth"
|
6656
6802
|
});
|
6657
6803
|
}
|
@@ -6662,7 +6808,10 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6662
6808
|
});
|
6663
6809
|
if (next instanceof HTMLElement) {
|
6664
6810
|
const { x } = next.getBoundingClientRect();
|
6665
|
-
container.scrollTo({
|
6811
|
+
container.scrollTo({
|
6812
|
+
left: container.scrollLeft - Math.abs(x - containerX - CARET_OFFSET),
|
6813
|
+
behavior: "smooth"
|
6814
|
+
});
|
6666
6815
|
}
|
6667
6816
|
}
|
6668
6817
|
};
|
@@ -6682,27 +6831,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6682
6831
|
const handleSelected = (key) => {
|
6683
6832
|
(onChange != null ? onChange : setSelected)(key);
|
6684
6833
|
};
|
6685
|
-
|
6834
|
+
React65.Children.forEach(children, (c) => {
|
6686
6835
|
if (c && !isTabComponent(c)) {
|
6687
6836
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6688
6837
|
}
|
6689
6838
|
});
|
6690
|
-
return /* @__PURE__ */
|
6839
|
+
return /* @__PURE__ */ React65.createElement("div", {
|
6691
6840
|
ref: parentRef,
|
6692
6841
|
className: classNames(tw("h-full"), className)
|
6693
|
-
}, /* @__PURE__ */
|
6842
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6694
6843
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6695
|
-
}, /* @__PURE__ */
|
6844
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6696
6845
|
ref: containerRef,
|
6697
6846
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6698
|
-
}, /* @__PURE__ */
|
6847
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6699
6848
|
ref: tabsRef,
|
6700
6849
|
role: "tablist",
|
6701
6850
|
"aria-label": "tabs",
|
6702
6851
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
6703
|
-
},
|
6852
|
+
}, React65.Children.map(
|
6704
6853
|
children,
|
6705
|
-
(tab, index) => tab ? /* @__PURE__ */
|
6854
|
+
(tab, index) => tab ? /* @__PURE__ */ React65.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
6706
6855
|
key: tab.props.value
|
6707
6856
|
}, tab.props), {
|
6708
6857
|
index,
|
@@ -6710,20 +6859,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6710
6859
|
onKeyDown: handleKeyDown,
|
6711
6860
|
onSelected: handleSelected
|
6712
6861
|
})) : void 0
|
6713
|
-
))), leftCaret && /* @__PURE__ */
|
6862
|
+
))), leftCaret && /* @__PURE__ */ React65.createElement("div", {
|
6714
6863
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
6715
|
-
}, /* @__PURE__ */
|
6864
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6716
6865
|
onClick: () => handleScrollToNext("left"),
|
6717
6866
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6718
|
-
}, /* @__PURE__ */
|
6867
|
+
}, /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6719
6868
|
icon: import_chevronLeft2.default
|
6720
|
-
}))), rightCaret && /* @__PURE__ */
|
6869
|
+
}))), rightCaret && /* @__PURE__ */ React65.createElement("div", {
|
6721
6870
|
onClick: () => handleScrollToNext("right"),
|
6722
6871
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
6723
|
-
}, /* @__PURE__ */
|
6872
|
+
}, /* @__PURE__ */ React65.createElement("div", {
|
6724
6873
|
onClick: () => handleScrollToNext("right"),
|
6725
6874
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6726
|
-
}, /* @__PURE__ */
|
6875
|
+
}, /* @__PURE__ */ React65.createElement(InlineIcon, {
|
6727
6876
|
icon: import_chevronRight2.default
|
6728
6877
|
})))), renderChildren(children, selected, props));
|
6729
6878
|
};
|
@@ -6731,7 +6880,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6731
6880
|
Tabs2.Tab = TabComponent;
|
6732
6881
|
return Tabs2;
|
6733
6882
|
};
|
6734
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
6883
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React65.createElement(TabContainer, null, children.find(
|
6735
6884
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6736
6885
|
)));
|
6737
6886
|
|
@@ -6748,7 +6897,7 @@ var Modal2 = ({
|
|
6748
6897
|
secondaryActions,
|
6749
6898
|
size
|
6750
6899
|
}) => {
|
6751
|
-
const ref =
|
6900
|
+
const ref = React66.useRef(null);
|
6752
6901
|
const state = useOverlayTriggerState4({ isOpen: open });
|
6753
6902
|
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
6754
6903
|
const labelledBy = useId2();
|
@@ -6760,60 +6909,60 @@ var Modal2 = ({
|
|
6760
6909
|
if (!open) {
|
6761
6910
|
return null;
|
6762
6911
|
}
|
6763
|
-
return /* @__PURE__ */
|
6912
|
+
return /* @__PURE__ */ React66.createElement(Overlay2, null, /* @__PURE__ */ React66.createElement(Modal, {
|
6764
6913
|
open: state.isOpen
|
6765
|
-
}, /* @__PURE__ */
|
6914
|
+
}, /* @__PURE__ */ React66.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React66.createElement(FocusScope3, {
|
6766
6915
|
contain: true,
|
6767
6916
|
restoreFocus: true,
|
6768
6917
|
autoFocus: true
|
6769
|
-
}, /* @__PURE__ */
|
6918
|
+
}, /* @__PURE__ */ React66.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
6770
6919
|
ref,
|
6771
6920
|
size
|
6772
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
6921
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React66.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React66.createElement(IconButton, {
|
6773
6922
|
"aria-label": "Close",
|
6774
6923
|
icon: import_cross5.default,
|
6775
6924
|
onClick: onClose
|
6776
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
6925
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React66.createElement(Modal.HeaderImage, {
|
6777
6926
|
backgroundImage: headerImage
|
6778
|
-
}), /* @__PURE__ */
|
6927
|
+
}), /* @__PURE__ */ React66.createElement(Modal.Header, {
|
6779
6928
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
6780
|
-
}, /* @__PURE__ */
|
6929
|
+
}, /* @__PURE__ */ React66.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React66.createElement(Modal.Title, {
|
6781
6930
|
id: labelledBy
|
6782
|
-
}, title), subtitle && /* @__PURE__ */
|
6931
|
+
}, 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
6932
|
id: describedBy,
|
6784
6933
|
tabIndex: 0,
|
6785
6934
|
noFooter: !(secondaryActions || primaryAction)
|
6786
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
6935
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React66.createElement(Modal.Footer, null, /* @__PURE__ */ React66.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
6787
6936
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
6788
|
-
return /* @__PURE__ */
|
6937
|
+
return /* @__PURE__ */ React66.createElement(SecondaryButton, __spreadValues({
|
6789
6938
|
key: text
|
6790
6939
|
}, action), text);
|
6791
|
-
}), primaryAction && /* @__PURE__ */
|
6940
|
+
}), primaryAction && /* @__PURE__ */ React66.createElement(PrimaryButton, __spreadValues({
|
6792
6941
|
key: primaryAction.text
|
6793
|
-
},
|
6942
|
+
}, omit10(primaryAction, "text")), primaryAction.text)))))));
|
6794
6943
|
};
|
6795
6944
|
var ModalTabs = createTabsComponent(
|
6796
6945
|
ModalTab,
|
6797
6946
|
TabItem,
|
6798
6947
|
"ModalTabs",
|
6799
|
-
(children, selected, props) => /* @__PURE__ */
|
6948
|
+
(children, selected, props) => /* @__PURE__ */ React66.createElement(Modal.Body, {
|
6800
6949
|
maxHeight: props.maxHeight
|
6801
|
-
}, /* @__PURE__ */
|
6950
|
+
}, /* @__PURE__ */ React66.createElement(ModalTabContainer, null, children.find(
|
6802
6951
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6803
6952
|
)))
|
6804
6953
|
);
|
6805
6954
|
|
6806
6955
|
// src/components/MultiInput/MultiInput.tsx
|
6807
|
-
import
|
6956
|
+
import React68, { useEffect as useEffect6, useRef as useRef7, useState as useState8 } from "react";
|
6808
6957
|
import castArray2 from "lodash/castArray";
|
6809
6958
|
import identity from "lodash/identity";
|
6810
|
-
import
|
6959
|
+
import omit11 from "lodash/omit";
|
6811
6960
|
import uniqueId4 from "lodash/uniqueId";
|
6812
6961
|
|
6813
6962
|
// src/components/MultiInput/InputChip.tsx
|
6814
|
-
import
|
6963
|
+
import React67 from "react";
|
6815
6964
|
var import_smallCross = __toESM(require_smallCross());
|
6816
|
-
var InputChip =
|
6965
|
+
var InputChip = React67.forwardRef(
|
6817
6966
|
(_a, ref) => {
|
6818
6967
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
6819
6968
|
const onClick = (e) => {
|
@@ -6821,7 +6970,7 @@ var InputChip = React65.forwardRef(
|
|
6821
6970
|
_onClick == null ? void 0 : _onClick(e);
|
6822
6971
|
}
|
6823
6972
|
};
|
6824
|
-
return /* @__PURE__ */
|
6973
|
+
return /* @__PURE__ */ React67.createElement("div", __spreadValues({
|
6825
6974
|
ref,
|
6826
6975
|
role: "button",
|
6827
6976
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -6831,10 +6980,10 @@ var InputChip = React65.forwardRef(
|
|
6831
6980
|
"bg-grey-5 pointer-events-none": disabled
|
6832
6981
|
}),
|
6833
6982
|
onClick
|
6834
|
-
}, props), /* @__PURE__ */
|
6983
|
+
}, props), /* @__PURE__ */ React67.createElement(Typography2, {
|
6835
6984
|
variant: "small",
|
6836
6985
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
6837
|
-
}, children), !readOnly && /* @__PURE__ */
|
6986
|
+
}, children), !readOnly && /* @__PURE__ */ React67.createElement("div", null, /* @__PURE__ */ React67.createElement(Icon, {
|
6838
6987
|
icon: import_smallCross.default,
|
6839
6988
|
className: tw("ml-2", {
|
6840
6989
|
"text-error-70": invalid,
|
@@ -6972,7 +7121,7 @@ var MultiInputBase = (_a) => {
|
|
6972
7121
|
};
|
6973
7122
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
6974
7123
|
var _a3;
|
6975
|
-
return /* @__PURE__ */
|
7124
|
+
return /* @__PURE__ */ React68.createElement(InputChip, {
|
6976
7125
|
key: `${itemToString(item)}.${index}`,
|
6977
7126
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
6978
7127
|
readOnly,
|
@@ -6983,11 +7132,11 @@ var MultiInputBase = (_a) => {
|
|
6983
7132
|
}
|
6984
7133
|
}, itemToString(item));
|
6985
7134
|
});
|
6986
|
-
return /* @__PURE__ */
|
7135
|
+
return /* @__PURE__ */ React68.createElement("div", null, /* @__PURE__ */ React68.createElement(Select.InputContainer, {
|
6987
7136
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
6988
|
-
}, /* @__PURE__ */
|
7137
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6989
7138
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
6990
|
-
}, inline && renderChips(), /* @__PURE__ */
|
7139
|
+
}, inline && renderChips(), /* @__PURE__ */ React68.createElement(Select.Input, __spreadProps(__spreadValues({
|
6991
7140
|
ref: inputRef,
|
6992
7141
|
id: id != null ? id : name,
|
6993
7142
|
name,
|
@@ -7005,11 +7154,11 @@ var MultiInputBase = (_a) => {
|
|
7005
7154
|
onFocus: handleFocus,
|
7006
7155
|
onBlur: handleBlur,
|
7007
7156
|
autoComplete: "off"
|
7008
|
-
}))), endAdornment && /* @__PURE__ */
|
7157
|
+
}))), endAdornment && /* @__PURE__ */ React68.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React68.createElement("div", {
|
7009
7158
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
7010
7159
|
}, renderChips()));
|
7011
7160
|
};
|
7012
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7161
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React68.createElement(Skeleton, {
|
7013
7162
|
height: 38
|
7014
7163
|
});
|
7015
7164
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7025,15 +7174,15 @@ var MultiInput = (props) => {
|
|
7025
7174
|
const errorMessageId = uniqueId4();
|
7026
7175
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7027
7176
|
const labelControlProps = getLabelControlProps(props);
|
7028
|
-
const baseProps =
|
7029
|
-
return /* @__PURE__ */
|
7177
|
+
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7178
|
+
return /* @__PURE__ */ React68.createElement(LabelControl, __spreadProps(__spreadValues({
|
7030
7179
|
id: `${id.current}-label`,
|
7031
7180
|
htmlFor: `${id.current}-input`,
|
7032
7181
|
messageId: errorMessageId
|
7033
7182
|
}, labelControlProps), {
|
7034
7183
|
length: value.length,
|
7035
7184
|
maxLength
|
7036
|
-
}), /* @__PURE__ */
|
7185
|
+
}), /* @__PURE__ */ React68.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7037
7186
|
id: `${id.current}-input`,
|
7038
7187
|
onChange: (value2) => {
|
7039
7188
|
var _a2;
|
@@ -7045,16 +7194,16 @@ var MultiInput = (props) => {
|
|
7045
7194
|
valid: props.valid
|
7046
7195
|
})));
|
7047
7196
|
};
|
7048
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7197
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React68.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React68.createElement(MultiInputBase.Skeleton, null));
|
7049
7198
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7050
7199
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7051
7200
|
|
7052
7201
|
// src/components/MultiSelect/MultiSelect.tsx
|
7053
|
-
import
|
7202
|
+
import React69, { useRef as useRef8, useState as useState9 } from "react";
|
7054
7203
|
import { useOverlayPosition as useOverlayPosition5 } from "@react-aria/overlays";
|
7055
7204
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7056
7205
|
import isNil from "lodash/isNil";
|
7057
|
-
import
|
7206
|
+
import omit12 from "lodash/omit";
|
7058
7207
|
import omitBy from "lodash/omitBy";
|
7059
7208
|
import uniqueId5 from "lodash/uniqueId";
|
7060
7209
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
@@ -7064,9 +7213,9 @@ var MultiSelectBase = (_a) => {
|
|
7064
7213
|
name,
|
7065
7214
|
placeholder,
|
7066
7215
|
maxHeight,
|
7067
|
-
closeOnSelect = true,
|
7068
7216
|
hideChips = false,
|
7069
7217
|
inline = true,
|
7218
|
+
closeOnSelect = inline ? false : true,
|
7070
7219
|
options,
|
7071
7220
|
optionKeys = ["label", "value"],
|
7072
7221
|
noResults,
|
@@ -7086,9 +7235,9 @@ var MultiSelectBase = (_a) => {
|
|
7086
7235
|
"name",
|
7087
7236
|
"placeholder",
|
7088
7237
|
"maxHeight",
|
7089
|
-
"closeOnSelect",
|
7090
7238
|
"hideChips",
|
7091
7239
|
"inline",
|
7240
|
+
"closeOnSelect",
|
7092
7241
|
"options",
|
7093
7242
|
"optionKeys",
|
7094
7243
|
"noResults",
|
@@ -7124,10 +7273,19 @@ var MultiSelectBase = (_a) => {
|
|
7124
7273
|
const filteredOptions = (inputValue ? matchSorter2(options, inputValue, { keys }) : options).filter(
|
7125
7274
|
(opt) => !selectedItemsAsStrings.includes(itemToString(opt))
|
7126
7275
|
);
|
7127
|
-
const {
|
7276
|
+
const {
|
7277
|
+
isOpen,
|
7278
|
+
openMenu,
|
7279
|
+
closeMenu,
|
7280
|
+
highlightedIndex,
|
7281
|
+
getInputProps,
|
7282
|
+
getMenuProps,
|
7283
|
+
getToggleButtonProps,
|
7284
|
+
getItemProps
|
7285
|
+
} = useCombobox2({
|
7128
7286
|
id,
|
7129
7287
|
inputValue,
|
7130
|
-
|
7288
|
+
defaultSelectedItem: defaultValue,
|
7131
7289
|
selectedItem: null,
|
7132
7290
|
items: filteredOptions,
|
7133
7291
|
stateReducer: (_, actionChanges) => {
|
@@ -7167,15 +7325,16 @@ var MultiSelectBase = (_a) => {
|
|
7167
7325
|
shouldFlip: true,
|
7168
7326
|
isOpen
|
7169
7327
|
});
|
7170
|
-
const inputProps = getInputProps(getDropdownProps({
|
7328
|
+
const inputProps = getInputProps(getDropdownProps({ disabled: disabled || readOnly }));
|
7171
7329
|
const renderChips = () => {
|
7172
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7330
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React69.createElement(InputChip, __spreadProps(__spreadValues({
|
7173
7331
|
key: `${itemToString(selectedItem)}.chip`,
|
7174
7332
|
className: tw("mx-0"),
|
7175
7333
|
disabled,
|
7176
7334
|
readOnly
|
7177
7335
|
}, getSelectedItemProps({ selectedItem, index })), {
|
7178
7336
|
onClick: (e) => {
|
7337
|
+
e.preventDefault();
|
7179
7338
|
e.stopPropagation();
|
7180
7339
|
removeSelectedItem(selectedItem);
|
7181
7340
|
}
|
@@ -7184,14 +7343,14 @@ var MultiSelectBase = (_a) => {
|
|
7184
7343
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7185
7344
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
7186
7345
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7187
|
-
return /* @__PURE__ */
|
7346
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
7188
7347
|
className: tw("relative")
|
7189
|
-
}, /* @__PURE__ */
|
7348
|
+
}, /* @__PURE__ */ React69.createElement(Select.InputContainer, {
|
7190
7349
|
ref: targetRef,
|
7191
7350
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7192
|
-
}, /* @__PURE__ */
|
7351
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
7193
7352
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7194
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7353
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React69.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7195
7354
|
id,
|
7196
7355
|
name,
|
7197
7356
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
@@ -7199,6 +7358,7 @@ var MultiSelectBase = (_a) => {
|
|
7199
7358
|
}, inputProps), props), {
|
7200
7359
|
disabled,
|
7201
7360
|
readOnly,
|
7361
|
+
onClick: readOnly ? void 0 : openMenu,
|
7202
7362
|
onKeyDown: (e) => {
|
7203
7363
|
var _a3;
|
7204
7364
|
e.stopPropagation();
|
@@ -7206,28 +7366,33 @@ var MultiSelectBase = (_a) => {
|
|
7206
7366
|
},
|
7207
7367
|
onKeyUp: (e) => e.stopPropagation(),
|
7208
7368
|
onFocus: () => setFocus(true),
|
7209
|
-
onBlur: () =>
|
7210
|
-
|
7369
|
+
onBlur: (e) => {
|
7370
|
+
var _a3;
|
7371
|
+
setFocus(false);
|
7372
|
+
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
7373
|
+
}
|
7374
|
+
}))), !readOnly && /* @__PURE__ */ React69.createElement(Select.Toggle, __spreadValues({
|
7211
7375
|
hasFocus,
|
7212
7376
|
isOpen
|
7213
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7377
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React69.createElement("div", {
|
7214
7378
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7215
|
-
}, renderChips()), /* @__PURE__ */
|
7379
|
+
}, renderChips()), /* @__PURE__ */ React69.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7216
7380
|
isOpen: true,
|
7217
7381
|
isDismissable: true,
|
7218
7382
|
autoFocus: true
|
7219
7383
|
}, getMenuProps({ ref: overlayRef })), {
|
7220
7384
|
style,
|
7221
|
-
onClose: closeMenu
|
7222
|
-
|
7385
|
+
onClose: closeMenu,
|
7386
|
+
className: tw("overflow-y-auto")
|
7387
|
+
}), /* @__PURE__ */ React69.createElement(Select.Menu, {
|
7223
7388
|
maxHeight
|
7224
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
7389
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React69.createElement(Select.NoResults, null, noResults), isOpen && filteredOptions.map((item, index) => /* @__PURE__ */ React69.createElement(Select.Item, __spreadValues({
|
7225
7390
|
key: itemToString(item),
|
7226
7391
|
highlighted: index === highlightedIndex,
|
7227
7392
|
selected: selectedItems.includes(item)
|
7228
7393
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7229
7394
|
};
|
7230
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7395
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React69.createElement(Skeleton, {
|
7231
7396
|
height: 38
|
7232
7397
|
});
|
7233
7398
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7244,12 +7409,12 @@ var MultiSelect = (_a) => {
|
|
7244
7409
|
const errorMessageId = uniqueId5();
|
7245
7410
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7246
7411
|
const labelControlProps = getLabelControlProps(props);
|
7247
|
-
const baseProps =
|
7248
|
-
return /* @__PURE__ */
|
7412
|
+
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7413
|
+
return /* @__PURE__ */ React69.createElement(LabelControl, __spreadValues({
|
7249
7414
|
id: `${id.current}-label`,
|
7250
7415
|
htmlFor: `${id.current}-input`,
|
7251
7416
|
messageId: errorMessageId
|
7252
|
-
}, labelControlProps), /* @__PURE__ */
|
7417
|
+
}, labelControlProps), /* @__PURE__ */ React69.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7253
7418
|
id: id.current,
|
7254
7419
|
options,
|
7255
7420
|
noResults,
|
@@ -7257,16 +7422,16 @@ var MultiSelect = (_a) => {
|
|
7257
7422
|
valid: props.valid
|
7258
7423
|
})));
|
7259
7424
|
};
|
7260
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7425
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React69.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React69.createElement(MultiSelectBase.Skeleton, null));
|
7261
7426
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7262
7427
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7263
7428
|
|
7264
7429
|
// src/components/NativeSelect/NativeSelect.tsx
|
7265
|
-
import
|
7266
|
-
import
|
7430
|
+
import React70, { useRef as useRef9 } from "react";
|
7431
|
+
import omit13 from "lodash/omit";
|
7267
7432
|
import uniqueId6 from "lodash/uniqueId";
|
7268
7433
|
var import_caretDown = __toESM(require_caretDown());
|
7269
|
-
var NativeSelectBase =
|
7434
|
+
var NativeSelectBase = React70.forwardRef(
|
7270
7435
|
(_a, ref) => {
|
7271
7436
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7272
7437
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7283,16 +7448,16 @@ var NativeSelectBase = React68.forwardRef(
|
|
7283
7448
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7284
7449
|
}
|
7285
7450
|
};
|
7286
|
-
return /* @__PURE__ */
|
7451
|
+
return /* @__PURE__ */ React70.createElement("span", {
|
7287
7452
|
className: tw("relative block")
|
7288
|
-
}, !readOnly && /* @__PURE__ */
|
7453
|
+
}, !readOnly && /* @__PURE__ */ React70.createElement("span", {
|
7289
7454
|
className: tw(
|
7290
7455
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7291
7456
|
)
|
7292
|
-
}, /* @__PURE__ */
|
7457
|
+
}, /* @__PURE__ */ React70.createElement(Icon, {
|
7293
7458
|
icon: import_caretDown.default,
|
7294
7459
|
"data-testid": "icon-dropdown"
|
7295
|
-
})), /* @__PURE__ */
|
7460
|
+
})), /* @__PURE__ */ React70.createElement("select", __spreadProps(__spreadValues({
|
7296
7461
|
ref,
|
7297
7462
|
disabled: disabled || readOnly,
|
7298
7463
|
required
|
@@ -7311,16 +7476,16 @@ var NativeSelectBase = React68.forwardRef(
|
|
7311
7476
|
),
|
7312
7477
|
props.className
|
7313
7478
|
)
|
7314
|
-
}), props.placeholder && /* @__PURE__ */
|
7479
|
+
}), props.placeholder && /* @__PURE__ */ React70.createElement("option", {
|
7315
7480
|
value: placeholderValue,
|
7316
7481
|
disabled: true
|
7317
7482
|
}, props.placeholder), children));
|
7318
7483
|
}
|
7319
7484
|
);
|
7320
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7485
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React70.createElement(Skeleton, {
|
7321
7486
|
height: 38
|
7322
7487
|
});
|
7323
|
-
var NativeSelect =
|
7488
|
+
var NativeSelect = React70.forwardRef(
|
7324
7489
|
(_a, ref) => {
|
7325
7490
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7326
7491
|
var _a2;
|
@@ -7328,12 +7493,12 @@ var NativeSelect = React68.forwardRef(
|
|
7328
7493
|
const errorMessageId = uniqueId6();
|
7329
7494
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7330
7495
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7331
|
-
const baseProps =
|
7332
|
-
return /* @__PURE__ */
|
7496
|
+
const baseProps = omit13(props, Object.keys(labelControlProps));
|
7497
|
+
return /* @__PURE__ */ React70.createElement(LabelControl, __spreadValues({
|
7333
7498
|
id: `${id.current}-label`,
|
7334
7499
|
htmlFor: id.current,
|
7335
7500
|
messageId: errorMessageId
|
7336
|
-
}, labelControlProps), /* @__PURE__ */
|
7501
|
+
}, labelControlProps), /* @__PURE__ */ React70.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7337
7502
|
ref
|
7338
7503
|
}, baseProps), errorProps), {
|
7339
7504
|
id: id.current,
|
@@ -7346,22 +7511,22 @@ var NativeSelect = React68.forwardRef(
|
|
7346
7511
|
})));
|
7347
7512
|
}
|
7348
7513
|
);
|
7349
|
-
var Option =
|
7514
|
+
var Option = React70.forwardRef((_a, ref) => {
|
7350
7515
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7351
|
-
return /* @__PURE__ */
|
7516
|
+
return /* @__PURE__ */ React70.createElement("option", __spreadValues({
|
7352
7517
|
ref
|
7353
7518
|
}, props), children);
|
7354
7519
|
});
|
7355
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
7520
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React70.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React70.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React70.createElement("div", {
|
7356
7521
|
style: { height: "1px" }
|
7357
7522
|
}));
|
7358
7523
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7359
7524
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7360
7525
|
|
7361
7526
|
// src/components/PageHeader/PageHeader.tsx
|
7362
|
-
import
|
7527
|
+
import React71 from "react";
|
7363
7528
|
import castArray3 from "lodash/castArray";
|
7364
|
-
import
|
7529
|
+
import omit14 from "lodash/omit";
|
7365
7530
|
var PageHeader = ({
|
7366
7531
|
title,
|
7367
7532
|
image,
|
@@ -7371,54 +7536,54 @@ var PageHeader = ({
|
|
7371
7536
|
chips = [],
|
7372
7537
|
breadcrumbs
|
7373
7538
|
}) => {
|
7374
|
-
return /* @__PURE__ */
|
7539
|
+
return /* @__PURE__ */ React71.createElement(Flexbox, {
|
7375
7540
|
direction: "row",
|
7376
7541
|
gap: "4",
|
7377
7542
|
paddingBottom: "6"
|
7378
|
-
}, /* @__PURE__ */
|
7543
|
+
}, /* @__PURE__ */ React71.createElement(Flexbox, {
|
7379
7544
|
className: tw("grow"),
|
7380
7545
|
direction: "column",
|
7381
7546
|
gap: "0"
|
7382
|
-
}, breadcrumbs && /* @__PURE__ */
|
7547
|
+
}, breadcrumbs && /* @__PURE__ */ React71.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React71.createElement(Flexbox, {
|
7383
7548
|
gap: "5"
|
7384
|
-
}, image && /* @__PURE__ */
|
7549
|
+
}, image && /* @__PURE__ */ React71.createElement("img", {
|
7385
7550
|
src: image,
|
7386
7551
|
alt: imageAlt,
|
7387
7552
|
className: tw("w-[56px] h-[56px]")
|
7388
|
-
}), /* @__PURE__ */
|
7553
|
+
}), /* @__PURE__ */ React71.createElement(Flexbox, {
|
7389
7554
|
direction: "column",
|
7390
7555
|
justifyContent: "center"
|
7391
|
-
}, /* @__PURE__ */
|
7556
|
+
}, /* @__PURE__ */ React71.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React71.createElement(Flexbox, {
|
7392
7557
|
gap: "3"
|
7393
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7558
|
+
}, chips.map((chip) => /* @__PURE__ */ React71.createElement(Chip2, {
|
7394
7559
|
key: chip,
|
7395
7560
|
dense: true,
|
7396
7561
|
text: chip
|
7397
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7562
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React71.createElement(Flexbox, {
|
7398
7563
|
gap: "4",
|
7399
7564
|
className: tw("self-start")
|
7400
7565
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7401
7566
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7402
|
-
return /* @__PURE__ */
|
7567
|
+
return /* @__PURE__ */ React71.createElement(SecondaryButton, __spreadValues({
|
7403
7568
|
key: text
|
7404
7569
|
}, action), text);
|
7405
|
-
}), primaryAction && /* @__PURE__ */
|
7570
|
+
}), primaryAction && /* @__PURE__ */ React71.createElement(PrimaryButton, __spreadValues({
|
7406
7571
|
key: primaryAction.text
|
7407
|
-
},
|
7572
|
+
}, omit14(primaryAction, "text")), primaryAction.text)));
|
7408
7573
|
};
|
7409
7574
|
|
7410
7575
|
// src/components/Pagination/Pagination.tsx
|
7411
|
-
import
|
7576
|
+
import React73 from "react";
|
7412
7577
|
import clamp from "lodash/clamp";
|
7413
7578
|
|
7414
7579
|
// src/components/Select/Select.tsx
|
7415
|
-
import
|
7580
|
+
import React72, { useRef as useRef10, useState as useState10 } from "react";
|
7416
7581
|
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7417
7582
|
import { useSelect } from "downshift";
|
7418
7583
|
import defaults from "lodash/defaults";
|
7419
7584
|
import isArray from "lodash/isArray";
|
7420
7585
|
import isNil2 from "lodash/isNil";
|
7421
|
-
import
|
7586
|
+
import omit15 from "lodash/omit";
|
7422
7587
|
import uniqueId7 from "lodash/uniqueId";
|
7423
7588
|
var hasIconProperty = (val) => {
|
7424
7589
|
var _a;
|
@@ -7429,10 +7594,10 @@ var hasOptionGroups = (val) => {
|
|
7429
7594
|
};
|
7430
7595
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7431
7596
|
var _a, _b;
|
7432
|
-
return /* @__PURE__ */
|
7597
|
+
return /* @__PURE__ */ React72.createElement(Select.Item, __spreadValues({
|
7433
7598
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7434
7599
|
selected: item === selectedItem
|
7435
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7600
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React72.createElement(InlineIcon, {
|
7436
7601
|
icon: item.icon
|
7437
7602
|
}), optionToString(item));
|
7438
7603
|
};
|
@@ -7549,13 +7714,13 @@ var _SelectBase = (props) => {
|
|
7549
7714
|
},
|
7550
7715
|
withDefaults
|
7551
7716
|
);
|
7552
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7717
|
+
const renderGroup = (group) => /* @__PURE__ */ React72.createElement(React72.Fragment, {
|
7553
7718
|
key: group.label
|
7554
|
-
}, /* @__PURE__ */
|
7555
|
-
const input = /* @__PURE__ */
|
7719
|
+
}, /* @__PURE__ */ React72.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7720
|
+
const input = /* @__PURE__ */ React72.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7556
7721
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7557
7722
|
tabIndex: 0
|
7558
|
-
}), /* @__PURE__ */
|
7723
|
+
}), /* @__PURE__ */ React72.createElement(Select.Input, __spreadProps(__spreadValues({
|
7559
7724
|
id,
|
7560
7725
|
name
|
7561
7726
|
}, rest), {
|
@@ -7567,27 +7732,28 @@ var _SelectBase = (props) => {
|
|
7567
7732
|
tabIndex: -1,
|
7568
7733
|
onFocus: () => setFocus(true),
|
7569
7734
|
onBlur: () => setFocus(false)
|
7570
|
-
})), !readOnly && /* @__PURE__ */
|
7735
|
+
})), !readOnly && /* @__PURE__ */ React72.createElement(Select.Toggle, {
|
7571
7736
|
disabled,
|
7572
7737
|
isOpen,
|
7573
7738
|
tabIndex: -1
|
7574
7739
|
}));
|
7575
7740
|
const width = (_b = targetRef.current) == null ? void 0 : _b.offsetWidth;
|
7576
7741
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7577
|
-
return /* @__PURE__ */
|
7742
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
7578
7743
|
className: tw("relative")
|
7579
|
-
}, labelWrapper ?
|
7744
|
+
}, labelWrapper ? React72.cloneElement(labelWrapper, { children: input }) : input, /* @__PURE__ */ React72.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7580
7745
|
isOpen: true,
|
7581
7746
|
isDismissable: true,
|
7582
7747
|
autoFocus: true
|
7583
7748
|
}, getMenuProps({ ref: overlayRef })), {
|
7584
7749
|
style,
|
7585
|
-
onClose: closeMenu
|
7586
|
-
|
7750
|
+
onClose: closeMenu,
|
7751
|
+
className: tw("overflow-y-auto")
|
7752
|
+
}), /* @__PURE__ */ React72.createElement(Select.Menu, {
|
7587
7753
|
maxHeight
|
7588
|
-
}, isOpen && options.length === 0 && /* @__PURE__ */
|
7754
|
+
}, 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
7755
|
onMouseOver: () => setHighlightedIndex(-1)
|
7590
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7756
|
+
}), actions.map((act, index) => /* @__PURE__ */ React72.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7591
7757
|
key: `${index}`
|
7592
7758
|
}, act), {
|
7593
7759
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7597,10 +7763,10 @@ var _SelectBase = (props) => {
|
|
7597
7763
|
}
|
7598
7764
|
}), act.label))))));
|
7599
7765
|
};
|
7600
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7766
|
+
var SelectBase = (props) => /* @__PURE__ */ React72.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7601
7767
|
labelWrapper: void 0
|
7602
7768
|
}));
|
7603
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7769
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React72.createElement(Skeleton, {
|
7604
7770
|
height: 38
|
7605
7771
|
});
|
7606
7772
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7615,22 +7781,22 @@ var Select2 = (_a) => {
|
|
7615
7781
|
const errorMessageId = uniqueId7();
|
7616
7782
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7617
7783
|
const labelProps = getLabelControlProps(props);
|
7618
|
-
const baseProps =
|
7784
|
+
const baseProps = omit15(props, Object.keys(labelProps));
|
7619
7785
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7620
7786
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7621
|
-
const label = /* @__PURE__ */
|
7787
|
+
const label = /* @__PURE__ */ React72.createElement(Label, __spreadValues({
|
7622
7788
|
id: `${id.current}-label`,
|
7623
7789
|
htmlFor: `${id.current}-input`,
|
7624
7790
|
variant,
|
7625
7791
|
messageId: errorMessageId
|
7626
7792
|
}, labelProps));
|
7627
|
-
return /* @__PURE__ */
|
7793
|
+
return /* @__PURE__ */ React72.createElement(FormControl, null, /* @__PURE__ */ React72.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7628
7794
|
id: `${id.current}-input`,
|
7629
7795
|
options,
|
7630
7796
|
disabled: props.disabled,
|
7631
7797
|
valid: props.valid,
|
7632
7798
|
labelWrapper: label
|
7633
|
-
})), /* @__PURE__ */
|
7799
|
+
})), /* @__PURE__ */ React72.createElement(HelperText, {
|
7634
7800
|
messageId: errorMessageId,
|
7635
7801
|
error: !labelProps.valid,
|
7636
7802
|
helperText: labelProps.helperText,
|
@@ -7639,7 +7805,7 @@ var Select2 = (_a) => {
|
|
7639
7805
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7640
7806
|
}));
|
7641
7807
|
};
|
7642
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7808
|
+
var SelectSkeleton = () => /* @__PURE__ */ React72.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React72.createElement(SelectBase.Skeleton, null));
|
7643
7809
|
Select2.Skeleton = SelectSkeleton;
|
7644
7810
|
|
7645
7811
|
// src/components/Pagination/Pagination.tsx
|
@@ -7657,25 +7823,25 @@ var Pagination = ({
|
|
7657
7823
|
pageSizes,
|
7658
7824
|
onPageSizeChange
|
7659
7825
|
}) => {
|
7660
|
-
const [value, setValue] =
|
7661
|
-
|
7826
|
+
const [value, setValue] = React73.useState(currentPage);
|
7827
|
+
React73.useEffect(() => {
|
7662
7828
|
setValue(currentPage);
|
7663
7829
|
}, [currentPage]);
|
7664
|
-
|
7830
|
+
React73.useEffect(() => {
|
7665
7831
|
onPageChange(1);
|
7666
7832
|
setValue(1);
|
7667
7833
|
}, [pageSize]);
|
7668
|
-
return /* @__PURE__ */
|
7834
|
+
return /* @__PURE__ */ React73.createElement(Box, {
|
7669
7835
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7670
7836
|
backgroundColor: "grey-0",
|
7671
7837
|
padding: "4"
|
7672
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
7838
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React73.createElement(Box, {
|
7673
7839
|
display: "flex",
|
7674
7840
|
alignItems: "center",
|
7675
7841
|
gap: "4"
|
7676
|
-
}, /* @__PURE__ */
|
7842
|
+
}, /* @__PURE__ */ React73.createElement(Typography2.SmallText, null, "Items per page "), /* @__PURE__ */ React73.createElement("div", {
|
7677
7843
|
className: tw("max-w-[70px]")
|
7678
|
-
}, /* @__PURE__ */
|
7844
|
+
}, /* @__PURE__ */ React73.createElement(SelectBase, {
|
7679
7845
|
options: pageSizes.map((size) => size.toString()),
|
7680
7846
|
value: pageSize.toString(),
|
7681
7847
|
onChange: (size) => {
|
@@ -7686,24 +7852,24 @@ var Pagination = ({
|
|
7686
7852
|
}
|
7687
7853
|
}
|
7688
7854
|
}
|
7689
|
-
}))) : /* @__PURE__ */
|
7855
|
+
}))) : /* @__PURE__ */ React73.createElement("div", null), /* @__PURE__ */ React73.createElement(Box, {
|
7690
7856
|
display: "flex",
|
7691
7857
|
justifyContent: "center",
|
7692
7858
|
alignItems: "center",
|
7693
7859
|
className: tw("grow")
|
7694
|
-
}, /* @__PURE__ */
|
7860
|
+
}, /* @__PURE__ */ React73.createElement(IconButton, {
|
7695
7861
|
"aria-label": "First",
|
7696
7862
|
onClick: () => onPageChange(1),
|
7697
7863
|
icon: import_chevronBackward.default,
|
7698
7864
|
disabled: !hasPreviousPage
|
7699
|
-
}), /* @__PURE__ */
|
7865
|
+
}), /* @__PURE__ */ React73.createElement(IconButton, {
|
7700
7866
|
"aria-label": "Previous",
|
7701
7867
|
onClick: () => onPageChange(currentPage - 1),
|
7702
7868
|
icon: import_chevronLeft3.default,
|
7703
7869
|
disabled: !hasPreviousPage
|
7704
|
-
}), /* @__PURE__ */
|
7870
|
+
}), /* @__PURE__ */ React73.createElement(Box, {
|
7705
7871
|
paddingX: "4"
|
7706
|
-
}, /* @__PURE__ */
|
7872
|
+
}, /* @__PURE__ */ React73.createElement(Typography2.SmallText, null, "Page")), /* @__PURE__ */ React73.createElement(InputBase, {
|
7707
7873
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
7708
7874
|
type: "number",
|
7709
7875
|
min: 1,
|
@@ -7726,43 +7892,43 @@ var Pagination = ({
|
|
7726
7892
|
setValue(1);
|
7727
7893
|
}
|
7728
7894
|
}
|
7729
|
-
}), /* @__PURE__ */
|
7895
|
+
}), /* @__PURE__ */ React73.createElement(Box, {
|
7730
7896
|
paddingX: "4"
|
7731
|
-
}, /* @__PURE__ */
|
7897
|
+
}, /* @__PURE__ */ React73.createElement(Typography2.SmallText, null, "of ", totalPages)), /* @__PURE__ */ React73.createElement(IconButton, {
|
7732
7898
|
"aria-label": "Next",
|
7733
7899
|
onClick: () => onPageChange(currentPage + 1),
|
7734
7900
|
icon: import_chevronRight3.default,
|
7735
7901
|
disabled: !hasNextPage
|
7736
|
-
}), /* @__PURE__ */
|
7902
|
+
}), /* @__PURE__ */ React73.createElement(IconButton, {
|
7737
7903
|
"aria-label": "Last",
|
7738
7904
|
onClick: () => onPageChange(totalPages),
|
7739
7905
|
icon: import_chevronForward.default,
|
7740
7906
|
disabled: !hasNextPage
|
7741
|
-
})), /* @__PURE__ */
|
7907
|
+
})), /* @__PURE__ */ React73.createElement("div", null));
|
7742
7908
|
};
|
7743
7909
|
|
7744
7910
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
7745
|
-
import
|
7746
|
-
import
|
7911
|
+
import React75 from "react";
|
7912
|
+
import omit16 from "lodash/omit";
|
7747
7913
|
|
7748
7914
|
// src/common/PopoverDialog/PopoverDialog.tsx
|
7749
|
-
import
|
7915
|
+
import React74 from "react";
|
7750
7916
|
var Header = (_a) => {
|
7751
7917
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7752
|
-
return /* @__PURE__ */
|
7918
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7753
7919
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
7754
7920
|
}), children);
|
7755
7921
|
};
|
7756
7922
|
var Title = (_a) => {
|
7757
7923
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7758
|
-
return /* @__PURE__ */
|
7924
|
+
return /* @__PURE__ */ React74.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7759
7925
|
htmlTag: "h1",
|
7760
7926
|
variant: "small-strong"
|
7761
7927
|
}), children);
|
7762
7928
|
};
|
7763
7929
|
var Body = (_a) => {
|
7764
7930
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7765
|
-
return /* @__PURE__ */
|
7931
|
+
return /* @__PURE__ */ React74.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7766
7932
|
htmlTag: "div",
|
7767
7933
|
variant: "caption",
|
7768
7934
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -7770,13 +7936,13 @@ var Body = (_a) => {
|
|
7770
7936
|
};
|
7771
7937
|
var Footer = (_a) => {
|
7772
7938
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7773
|
-
return /* @__PURE__ */
|
7939
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7774
7940
|
className: classNames(tw("p-5"), className)
|
7775
7941
|
}), children);
|
7776
7942
|
};
|
7777
|
-
var
|
7943
|
+
var Actions2 = (_a) => {
|
7778
7944
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7779
|
-
return /* @__PURE__ */
|
7945
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7780
7946
|
className: classNames(tw("flex gap-4"), className)
|
7781
7947
|
}), children);
|
7782
7948
|
};
|
@@ -7785,28 +7951,28 @@ var PopoverDialog = {
|
|
7785
7951
|
Title,
|
7786
7952
|
Body,
|
7787
7953
|
Footer,
|
7788
|
-
Actions
|
7954
|
+
Actions: Actions2
|
7789
7955
|
};
|
7790
7956
|
|
7791
7957
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
7792
7958
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
7793
7959
|
const wrapPromptWithBody = (child) => {
|
7794
7960
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
7795
|
-
return /* @__PURE__ */
|
7961
|
+
return /* @__PURE__ */ React75.createElement(Popover2.Panel, {
|
7796
7962
|
className: tw("max-w-[300px]")
|
7797
|
-
}, /* @__PURE__ */
|
7963
|
+
}, /* @__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
7964
|
kind: "secondary-ghost",
|
7799
7965
|
key: secondaryAction.text,
|
7800
7966
|
dense: true
|
7801
|
-
},
|
7967
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React75.createElement(Popover2.Button, __spreadValues({
|
7802
7968
|
kind: "ghost",
|
7803
7969
|
key: primaryAction.text,
|
7804
7970
|
dense: true
|
7805
|
-
},
|
7971
|
+
}, omit16(primaryAction, "text")), primaryAction.text))));
|
7806
7972
|
}
|
7807
7973
|
return child;
|
7808
7974
|
};
|
7809
|
-
return /* @__PURE__ */
|
7975
|
+
return /* @__PURE__ */ React75.createElement(Popover2, {
|
7810
7976
|
type: "dialog",
|
7811
7977
|
isOpen: open,
|
7812
7978
|
placement,
|
@@ -7814,10 +7980,10 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
7814
7980
|
isKeyboardDismissDisabled: false,
|
7815
7981
|
autoFocus: true,
|
7816
7982
|
containFocus: true
|
7817
|
-
},
|
7983
|
+
}, React75.Children.map(children, wrapPromptWithBody));
|
7818
7984
|
};
|
7819
7985
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
7820
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
7986
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React75.createElement(PopoverDialog.Body, null, children);
|
7821
7987
|
Prompt.displayName = "PopoverDialog.Prompt";
|
7822
7988
|
PopoverDialog2.Prompt = Prompt;
|
7823
7989
|
|
@@ -7826,14 +7992,14 @@ import { createPortal } from "react-dom";
|
|
7826
7992
|
var Portal = ({ children, to }) => createPortal(children, to);
|
7827
7993
|
|
7828
7994
|
// src/components/ProgressBar/ProgressBar.tsx
|
7829
|
-
import
|
7995
|
+
import React77 from "react";
|
7830
7996
|
|
7831
7997
|
// src/common/ProgressBar/ProgressBar.tsx
|
7832
|
-
import
|
7998
|
+
import React76 from "react";
|
7833
7999
|
import clamp2 from "lodash/clamp";
|
7834
8000
|
var ProgressBar = (_a) => {
|
7835
8001
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7836
|
-
return /* @__PURE__ */
|
8002
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7837
8003
|
className: classNames(
|
7838
8004
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
7839
8005
|
className
|
@@ -7849,7 +8015,7 @@ var STATUS_COLORS = {
|
|
7849
8015
|
ProgressBar.Indicator = (_a) => {
|
7850
8016
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
7851
8017
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
7852
|
-
return /* @__PURE__ */
|
8018
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7853
8019
|
className: classNames(
|
7854
8020
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
7855
8021
|
STATUS_COLORS[status],
|
@@ -7865,11 +8031,11 @@ ProgressBar.Indicator = (_a) => {
|
|
7865
8031
|
};
|
7866
8032
|
ProgressBar.Labels = (_a) => {
|
7867
8033
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
7868
|
-
return /* @__PURE__ */
|
8034
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
7869
8035
|
className: classNames(tw("flex flex-row"), className)
|
7870
|
-
}, /* @__PURE__ */
|
8036
|
+
}, /* @__PURE__ */ React76.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
7871
8037
|
className: tw("grow text-grey-70 typography-caption")
|
7872
|
-
}), startLabel), /* @__PURE__ */
|
8038
|
+
}), startLabel), /* @__PURE__ */ React76.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
7873
8039
|
className: tw("grow text-grey-70 typography-caption text-right")
|
7874
8040
|
}), endLabel));
|
7875
8041
|
};
|
@@ -7887,7 +8053,7 @@ var ProgressBar2 = (props) => {
|
|
7887
8053
|
if (min > max) {
|
7888
8054
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
7889
8055
|
}
|
7890
|
-
const progress = /* @__PURE__ */
|
8056
|
+
const progress = /* @__PURE__ */ React77.createElement(ProgressBar, null, /* @__PURE__ */ React77.createElement(ProgressBar.Indicator, {
|
7891
8057
|
status: value === max ? completedStatus : progresStatus,
|
7892
8058
|
min,
|
7893
8059
|
max,
|
@@ -7897,25 +8063,25 @@ var ProgressBar2 = (props) => {
|
|
7897
8063
|
if (props.dense) {
|
7898
8064
|
return progress;
|
7899
8065
|
}
|
7900
|
-
return /* @__PURE__ */
|
8066
|
+
return /* @__PURE__ */ React77.createElement("div", null, progress, /* @__PURE__ */ React77.createElement(ProgressBar.Labels, {
|
7901
8067
|
className: tw("py-2"),
|
7902
8068
|
startLabel: props.startLabel,
|
7903
8069
|
endLabel: props.endLabel
|
7904
8070
|
}));
|
7905
8071
|
};
|
7906
|
-
ProgressBar2.Skeleton = () => /* @__PURE__ */
|
8072
|
+
ProgressBar2.Skeleton = () => /* @__PURE__ */ React77.createElement(Skeleton, {
|
7907
8073
|
height: 4,
|
7908
8074
|
display: "block"
|
7909
8075
|
});
|
7910
8076
|
|
7911
8077
|
// src/components/RadioButton/RadioButton.tsx
|
7912
|
-
import
|
7913
|
-
var RadioButton2 =
|
8078
|
+
import React78 from "react";
|
8079
|
+
var RadioButton2 = React78.forwardRef(
|
7914
8080
|
(_a, ref) => {
|
7915
8081
|
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
8082
|
var _a2;
|
7917
8083
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
7918
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8084
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React78.createElement(ControlLabel, {
|
7919
8085
|
htmlFor: id,
|
7920
8086
|
label: children,
|
7921
8087
|
"aria-label": ariaLabel,
|
@@ -7923,7 +8089,7 @@ var RadioButton2 = React76.forwardRef(
|
|
7923
8089
|
readOnly,
|
7924
8090
|
disabled,
|
7925
8091
|
style: { gap: "0 8px" }
|
7926
|
-
}, !readOnly && /* @__PURE__ */
|
8092
|
+
}, !readOnly && /* @__PURE__ */ React78.createElement(RadioButton, __spreadProps(__spreadValues({
|
7927
8093
|
id,
|
7928
8094
|
ref,
|
7929
8095
|
name
|
@@ -7933,22 +8099,22 @@ var RadioButton2 = React76.forwardRef(
|
|
7933
8099
|
}))) : null;
|
7934
8100
|
}
|
7935
8101
|
);
|
7936
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
8102
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React78.createElement("div", {
|
7937
8103
|
className: tw("flex gap-3")
|
7938
|
-
}, /* @__PURE__ */
|
8104
|
+
}, /* @__PURE__ */ React78.createElement(Skeleton, {
|
7939
8105
|
height: 20,
|
7940
8106
|
width: 20
|
7941
|
-
}), /* @__PURE__ */
|
8107
|
+
}), /* @__PURE__ */ React78.createElement(Skeleton, {
|
7942
8108
|
height: 20,
|
7943
8109
|
width: 150
|
7944
8110
|
}));
|
7945
8111
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
7946
8112
|
|
7947
8113
|
// src/components/RadioButtonGroup/RadioButtonGroup.tsx
|
7948
|
-
import
|
8114
|
+
import React79 from "react";
|
7949
8115
|
import uniqueId8 from "lodash/uniqueId";
|
7950
8116
|
var isRadioButton = (c) => {
|
7951
|
-
return
|
8117
|
+
return React79.isValidElement(c) && c.type === RadioButton2;
|
7952
8118
|
};
|
7953
8119
|
var RadioButtonGroup = (_a) => {
|
7954
8120
|
var _b = _a, {
|
@@ -7971,7 +8137,7 @@ var RadioButtonGroup = (_a) => {
|
|
7971
8137
|
"children"
|
7972
8138
|
]);
|
7973
8139
|
var _a2;
|
7974
|
-
const [value, setValue] =
|
8140
|
+
const [value, setValue] = React79.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
7975
8141
|
const errorMessageId = uniqueId8();
|
7976
8142
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7977
8143
|
const labelControlProps = getLabelControlProps(props);
|
@@ -7982,14 +8148,14 @@ var RadioButtonGroup = (_a) => {
|
|
7982
8148
|
setValue(e.target.value);
|
7983
8149
|
onChange == null ? void 0 : onChange(e.target.value);
|
7984
8150
|
};
|
7985
|
-
const content =
|
8151
|
+
const content = React79.Children.map(children, (c) => {
|
7986
8152
|
var _a3, _b2, _c;
|
7987
8153
|
if (!isRadioButton(c)) {
|
7988
8154
|
return null;
|
7989
8155
|
}
|
7990
8156
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
7991
8157
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
7992
|
-
return
|
8158
|
+
return React79.cloneElement(c, {
|
7993
8159
|
name,
|
7994
8160
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
7995
8161
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -7998,11 +8164,11 @@ var RadioButtonGroup = (_a) => {
|
|
7998
8164
|
readOnly
|
7999
8165
|
});
|
8000
8166
|
});
|
8001
|
-
return /* @__PURE__ */
|
8167
|
+
return /* @__PURE__ */ React79.createElement(LabelControl, __spreadValues(__spreadValues({
|
8002
8168
|
fieldset: true
|
8003
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
8169
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React79.createElement(InputGroup, {
|
8004
8170
|
cols
|
8005
|
-
}, content), !cols && /* @__PURE__ */
|
8171
|
+
}, content), !cols && /* @__PURE__ */ React79.createElement(Flexbox, {
|
8006
8172
|
direction,
|
8007
8173
|
alignItems: "flex-start",
|
8008
8174
|
colGap: "8",
|
@@ -8011,80 +8177,80 @@ var RadioButtonGroup = (_a) => {
|
|
8011
8177
|
}, content));
|
8012
8178
|
};
|
8013
8179
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
8014
|
-
return /* @__PURE__ */
|
8180
|
+
return /* @__PURE__ */ React79.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React79.createElement("div", {
|
8015
8181
|
className: tw("flex flex-wrap", {
|
8016
8182
|
"flex-row gap-8": direction === "row",
|
8017
8183
|
"flex-col gap-2": direction === "column"
|
8018
8184
|
})
|
8019
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8185
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React79.createElement(RadioButton2.Skeleton, {
|
8020
8186
|
key
|
8021
8187
|
}))));
|
8022
8188
|
};
|
8023
8189
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
8024
8190
|
|
8025
8191
|
// src/components/Section/Section.tsx
|
8026
|
-
import
|
8192
|
+
import React81 from "react";
|
8027
8193
|
import castArray4 from "lodash/castArray";
|
8028
8194
|
|
8029
8195
|
// src/common/Section/Section.tsx
|
8030
|
-
import
|
8196
|
+
import React80 from "react";
|
8031
8197
|
var Section2 = (_a) => {
|
8032
8198
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8033
|
-
return /* @__PURE__ */
|
8199
|
+
return /* @__PURE__ */ React80.createElement(Box, __spreadValues({
|
8034
8200
|
borderColor: "grey-5",
|
8035
8201
|
borderWidth: "1px"
|
8036
8202
|
}, rest), children);
|
8037
8203
|
};
|
8038
8204
|
Section2.Header = (_a) => {
|
8039
8205
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8040
|
-
return /* @__PURE__ */
|
8206
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8041
8207
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8042
8208
|
}), children);
|
8043
8209
|
};
|
8044
8210
|
Section2.TitleContainer = (_a) => {
|
8045
8211
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8046
|
-
return /* @__PURE__ */
|
8212
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8047
8213
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8048
8214
|
}), children);
|
8049
8215
|
};
|
8050
8216
|
Section2.Title = (_a) => {
|
8051
8217
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8052
|
-
return /* @__PURE__ */
|
8218
|
+
return /* @__PURE__ */ React80.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8053
8219
|
color: "black"
|
8054
8220
|
}), children);
|
8055
8221
|
};
|
8056
8222
|
Section2.Subtitle = (_a) => {
|
8057
8223
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8058
|
-
return /* @__PURE__ */
|
8224
|
+
return /* @__PURE__ */ React80.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8059
8225
|
color: "grey-70"
|
8060
8226
|
}), children);
|
8061
8227
|
};
|
8062
8228
|
Section2.Actions = (_a) => {
|
8063
8229
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8064
|
-
return /* @__PURE__ */
|
8230
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8065
8231
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8066
8232
|
}), children);
|
8067
8233
|
};
|
8068
8234
|
Section2.Body = (_a) => {
|
8069
8235
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8070
|
-
return /* @__PURE__ */
|
8236
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8071
8237
|
className: classNames(tw("p-6"), className)
|
8072
|
-
}), /* @__PURE__ */
|
8238
|
+
}), /* @__PURE__ */ React80.createElement(Typography, {
|
8073
8239
|
htmlTag: "div",
|
8074
8240
|
color: "grey-70"
|
8075
8241
|
}, children));
|
8076
8242
|
};
|
8077
8243
|
|
8078
8244
|
// src/components/Section/Section.tsx
|
8079
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8245
|
+
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
8246
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8081
|
-
return /* @__PURE__ */
|
8247
|
+
return /* @__PURE__ */ React81.createElement(SecondaryButton, __spreadValues({
|
8082
8248
|
key: text
|
8083
8249
|
}, action), text);
|
8084
|
-
}))), /* @__PURE__ */
|
8250
|
+
}))), /* @__PURE__ */ React81.createElement(Divider2, null)), /* @__PURE__ */ React81.createElement(Section2.Body, null, children));
|
8085
8251
|
|
8086
8252
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
8087
|
-
import
|
8253
|
+
import React82 from "react";
|
8088
8254
|
var SegmentedControl = (_a) => {
|
8089
8255
|
var _b = _a, {
|
8090
8256
|
children,
|
@@ -8101,7 +8267,7 @@ var SegmentedControl = (_a) => {
|
|
8101
8267
|
"selected",
|
8102
8268
|
"className"
|
8103
8269
|
]);
|
8104
|
-
return /* @__PURE__ */
|
8270
|
+
return /* @__PURE__ */ React82.createElement("button", __spreadProps(__spreadValues({
|
8105
8271
|
type: "button"
|
8106
8272
|
}, rest), {
|
8107
8273
|
className: classNames(
|
@@ -8132,11 +8298,11 @@ var SegmentedControlGroup = (_a) => {
|
|
8132
8298
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8133
8299
|
"bg-grey-0": variant === "raised"
|
8134
8300
|
});
|
8135
|
-
return /* @__PURE__ */
|
8301
|
+
return /* @__PURE__ */ React82.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8136
8302
|
className: classNames(classes, className)
|
8137
|
-
}),
|
8303
|
+
}), React82.Children.map(
|
8138
8304
|
children,
|
8139
|
-
(child) =>
|
8305
|
+
(child) => React82.cloneElement(child, {
|
8140
8306
|
dense,
|
8141
8307
|
variant,
|
8142
8308
|
onClick: () => onChange(child.props.value),
|
@@ -8174,14 +8340,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8174
8340
|
);
|
8175
8341
|
|
8176
8342
|
// src/components/Stepper/Stepper.tsx
|
8177
|
-
import
|
8343
|
+
import React84 from "react";
|
8178
8344
|
|
8179
8345
|
// src/common/Stepper/Stepper.tsx
|
8180
|
-
import
|
8346
|
+
import React83 from "react";
|
8181
8347
|
var import_tick5 = __toESM(require_tick());
|
8182
8348
|
var Stepper = (_a) => {
|
8183
8349
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8184
|
-
return /* @__PURE__ */
|
8350
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8185
8351
|
className: classNames(className)
|
8186
8352
|
}));
|
8187
8353
|
};
|
@@ -8195,7 +8361,7 @@ var ConnectorContainer = (_a) => {
|
|
8195
8361
|
"completed",
|
8196
8362
|
"dense"
|
8197
8363
|
]);
|
8198
|
-
return /* @__PURE__ */
|
8364
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8199
8365
|
className: classNames(
|
8200
8366
|
tw("absolute w-full -left-1/2", {
|
8201
8367
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -8207,7 +8373,7 @@ var ConnectorContainer = (_a) => {
|
|
8207
8373
|
};
|
8208
8374
|
var Connector = (_a) => {
|
8209
8375
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8210
|
-
return /* @__PURE__ */
|
8376
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8211
8377
|
className: classNames(
|
8212
8378
|
tw("w-full", {
|
8213
8379
|
"bg-grey-20": !completed,
|
@@ -8221,7 +8387,7 @@ var Connector = (_a) => {
|
|
8221
8387
|
};
|
8222
8388
|
var Step = (_a) => {
|
8223
8389
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8224
|
-
return /* @__PURE__ */
|
8390
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8225
8391
|
className: classNames(
|
8226
8392
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8227
8393
|
"text-grey-20": state === "inactive"
|
@@ -8242,13 +8408,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
8242
8408
|
});
|
8243
8409
|
var Indicator = (_a) => {
|
8244
8410
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8245
|
-
return /* @__PURE__ */
|
8411
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8246
8412
|
className: classNames(
|
8247
8413
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8248
8414
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
8249
8415
|
className
|
8250
8416
|
)
|
8251
|
-
}), state === "completed" ? /* @__PURE__ */
|
8417
|
+
}), state === "completed" ? /* @__PURE__ */ React83.createElement(InlineIcon, {
|
8252
8418
|
icon: import_tick5.default
|
8253
8419
|
}) : dense ? null : children);
|
8254
8420
|
};
|
@@ -8259,25 +8425,25 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
8259
8425
|
|
8260
8426
|
// src/components/Stepper/Stepper.tsx
|
8261
8427
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8262
|
-
const steps =
|
8263
|
-
return /* @__PURE__ */
|
8428
|
+
const steps = React84.Children.count(children);
|
8429
|
+
return /* @__PURE__ */ React84.createElement(Stepper, {
|
8264
8430
|
role: "list"
|
8265
|
-
}, /* @__PURE__ */
|
8431
|
+
}, /* @__PURE__ */ React84.createElement(Template, {
|
8266
8432
|
columns: steps
|
8267
|
-
},
|
8433
|
+
}, React84.Children.map(children, (child, index) => {
|
8268
8434
|
if (!isComponentType(child, Step2)) {
|
8269
8435
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8270
8436
|
} else {
|
8271
8437
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8272
|
-
return /* @__PURE__ */
|
8438
|
+
return /* @__PURE__ */ React84.createElement(Stepper.Step, {
|
8273
8439
|
state,
|
8274
8440
|
"aria-current": state === "active" ? "step" : false,
|
8275
8441
|
role: "listitem"
|
8276
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
8442
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React84.createElement(Stepper.ConnectorContainer, {
|
8277
8443
|
dense
|
8278
|
-
}, /* @__PURE__ */
|
8444
|
+
}, /* @__PURE__ */ React84.createElement(Stepper.ConnectorContainer.Connector, {
|
8279
8445
|
completed: state === "completed" || state === "active"
|
8280
|
-
})), /* @__PURE__ */
|
8446
|
+
})), /* @__PURE__ */ React84.createElement(Stepper.Step.Indicator, {
|
8281
8447
|
state,
|
8282
8448
|
dense
|
8283
8449
|
}, index + 1), child.props.children);
|
@@ -8288,16 +8454,16 @@ var Step2 = () => null;
|
|
8288
8454
|
Stepper2.Step = Step2;
|
8289
8455
|
|
8290
8456
|
// src/components/Switch/Switch.tsx
|
8291
|
-
import
|
8457
|
+
import React86 from "react";
|
8292
8458
|
|
8293
8459
|
// src/common/Switch/Switch.tsx
|
8294
|
-
import
|
8295
|
-
var Switch =
|
8460
|
+
import React85 from "react";
|
8461
|
+
var Switch = React85.forwardRef(
|
8296
8462
|
(_a, ref) => {
|
8297
8463
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8298
|
-
return /* @__PURE__ */
|
8464
|
+
return /* @__PURE__ */ React85.createElement("span", {
|
8299
8465
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8300
|
-
}, /* @__PURE__ */
|
8466
|
+
}, /* @__PURE__ */ React85.createElement("input", __spreadProps(__spreadValues({
|
8301
8467
|
id,
|
8302
8468
|
ref,
|
8303
8469
|
type: "checkbox",
|
@@ -8316,7 +8482,7 @@ var Switch = React83.forwardRef(
|
|
8316
8482
|
),
|
8317
8483
|
readOnly,
|
8318
8484
|
disabled
|
8319
|
-
})), /* @__PURE__ */
|
8485
|
+
})), /* @__PURE__ */ React85.createElement("span", {
|
8320
8486
|
className: tw(
|
8321
8487
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8322
8488
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8329,12 +8495,12 @@ var Switch = React83.forwardRef(
|
|
8329
8495
|
);
|
8330
8496
|
|
8331
8497
|
// src/components/Switch/Switch.tsx
|
8332
|
-
var Switch2 =
|
8498
|
+
var Switch2 = React86.forwardRef(
|
8333
8499
|
(_a, ref) => {
|
8334
8500
|
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
8501
|
var _a2;
|
8336
8502
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8337
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8503
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React86.createElement(ControlLabel, {
|
8338
8504
|
htmlFor: id,
|
8339
8505
|
label: children,
|
8340
8506
|
"aria-label": ariaLabel,
|
@@ -8342,7 +8508,7 @@ var Switch2 = React84.forwardRef(
|
|
8342
8508
|
readOnly,
|
8343
8509
|
disabled,
|
8344
8510
|
style: { gap: "0 8px" }
|
8345
|
-
}, !readOnly && /* @__PURE__ */
|
8511
|
+
}, !readOnly && /* @__PURE__ */ React86.createElement(Switch, __spreadProps(__spreadValues({
|
8346
8512
|
id,
|
8347
8513
|
ref,
|
8348
8514
|
name
|
@@ -8352,19 +8518,19 @@ var Switch2 = React84.forwardRef(
|
|
8352
8518
|
}))) : null;
|
8353
8519
|
}
|
8354
8520
|
);
|
8355
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
8521
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React86.createElement("div", {
|
8356
8522
|
className: tw("flex gap-3")
|
8357
|
-
}, /* @__PURE__ */
|
8523
|
+
}, /* @__PURE__ */ React86.createElement(Skeleton, {
|
8358
8524
|
height: 20,
|
8359
8525
|
width: 35
|
8360
|
-
}), /* @__PURE__ */
|
8526
|
+
}), /* @__PURE__ */ React86.createElement(Skeleton, {
|
8361
8527
|
height: 20,
|
8362
8528
|
width: 150
|
8363
8529
|
}));
|
8364
8530
|
Switch2.Skeleton = SwitchSkeleton;
|
8365
8531
|
|
8366
8532
|
// src/components/SwitchGroup/SwitchGroup.tsx
|
8367
|
-
import
|
8533
|
+
import React87, { useState as useState11 } from "react";
|
8368
8534
|
import uniqueId9 from "lodash/uniqueId";
|
8369
8535
|
var SwitchGroup = (_a) => {
|
8370
8536
|
var _b = _a, {
|
@@ -8396,11 +8562,11 @@ var SwitchGroup = (_a) => {
|
|
8396
8562
|
setSelectedItems(updated);
|
8397
8563
|
onChange == null ? void 0 : onChange(updated);
|
8398
8564
|
};
|
8399
|
-
return /* @__PURE__ */
|
8565
|
+
return /* @__PURE__ */ React87.createElement(LabelControl, __spreadValues(__spreadValues({
|
8400
8566
|
fieldset: true
|
8401
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8567
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React87.createElement(InputGroup, {
|
8402
8568
|
cols
|
8403
|
-
},
|
8569
|
+
}, React87.Children.map(children, (c) => {
|
8404
8570
|
var _a3, _b2, _c, _d;
|
8405
8571
|
if (!isComponentType(c, Switch2)) {
|
8406
8572
|
return null;
|
@@ -8408,7 +8574,7 @@ var SwitchGroup = (_a) => {
|
|
8408
8574
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8409
8575
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8410
8576
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8411
|
-
return
|
8577
|
+
return React87.cloneElement(c, {
|
8412
8578
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8413
8579
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8414
8580
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8418,19 +8584,19 @@ var SwitchGroup = (_a) => {
|
|
8418
8584
|
})));
|
8419
8585
|
};
|
8420
8586
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8421
|
-
return /* @__PURE__ */
|
8587
|
+
return /* @__PURE__ */ React87.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React87.createElement("div", {
|
8422
8588
|
className: tw("flex flex-wrap flex-col gap-2")
|
8423
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8589
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React87.createElement(Switch2.Skeleton, {
|
8424
8590
|
key
|
8425
8591
|
}))));
|
8426
8592
|
};
|
8427
8593
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
8428
8594
|
|
8429
8595
|
// src/components/TagLabel/TagLabel.tsx
|
8430
|
-
import
|
8596
|
+
import React88 from "react";
|
8431
8597
|
var TagLabel = (_a) => {
|
8432
8598
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8433
|
-
return /* @__PURE__ */
|
8599
|
+
return /* @__PURE__ */ React88.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8434
8600
|
className: tw("rounded-full text-white bg-primary-70", {
|
8435
8601
|
"py-2 px-4 typography-caption": !dense,
|
8436
8602
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8439,14 +8605,14 @@ var TagLabel = (_a) => {
|
|
8439
8605
|
};
|
8440
8606
|
|
8441
8607
|
// src/components/Textarea/Textarea.tsx
|
8442
|
-
import
|
8443
|
-
import
|
8608
|
+
import React89, { useRef as useRef11, useState as useState12 } from "react";
|
8609
|
+
import omit17 from "lodash/omit";
|
8444
8610
|
import toString2 from "lodash/toString";
|
8445
8611
|
import uniqueId10 from "lodash/uniqueId";
|
8446
|
-
var TextareaBase =
|
8612
|
+
var TextareaBase = React89.forwardRef(
|
8447
8613
|
(_a, ref) => {
|
8448
8614
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8449
|
-
return /* @__PURE__ */
|
8615
|
+
return /* @__PURE__ */ React89.createElement("textarea", __spreadProps(__spreadValues({
|
8450
8616
|
ref
|
8451
8617
|
}, props), {
|
8452
8618
|
readOnly,
|
@@ -8454,23 +8620,23 @@ var TextareaBase = React87.forwardRef(
|
|
8454
8620
|
}));
|
8455
8621
|
}
|
8456
8622
|
);
|
8457
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8623
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React89.createElement(Skeleton, {
|
8458
8624
|
height: 58
|
8459
8625
|
});
|
8460
|
-
var Textarea =
|
8626
|
+
var Textarea = React89.forwardRef((props, ref) => {
|
8461
8627
|
var _a, _b, _c;
|
8462
8628
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8463
8629
|
const id = useRef11((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
8464
8630
|
const errorMessageId = uniqueId10();
|
8465
8631
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8466
8632
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8467
|
-
const baseProps =
|
8468
|
-
return /* @__PURE__ */
|
8633
|
+
const baseProps = omit17(props, Object.keys(labelControlProps));
|
8634
|
+
return /* @__PURE__ */ React89.createElement(LabelControl, __spreadValues({
|
8469
8635
|
id: `${id.current}-label`,
|
8470
8636
|
htmlFor: id.current,
|
8471
8637
|
messageId: errorMessageId,
|
8472
8638
|
length: value !== void 0 ? toString2(value).length : void 0
|
8473
|
-
}, labelControlProps), /* @__PURE__ */
|
8639
|
+
}, labelControlProps), /* @__PURE__ */ React89.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8474
8640
|
ref
|
8475
8641
|
}, baseProps), errorProps), {
|
8476
8642
|
id: id.current,
|
@@ -8486,47 +8652,47 @@ var Textarea = React87.forwardRef((props, ref) => {
|
|
8486
8652
|
valid: props.valid
|
8487
8653
|
})));
|
8488
8654
|
});
|
8489
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
8655
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React89.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React89.createElement(TextareaBase.Skeleton, null));
|
8490
8656
|
Textarea.Skeleton = TextAreaSkeleton;
|
8491
8657
|
|
8492
8658
|
// src/components/Timeline/Timeline.tsx
|
8493
|
-
import
|
8659
|
+
import React91 from "react";
|
8494
8660
|
|
8495
8661
|
// src/common/Timeline/Timeline.tsx
|
8496
|
-
import
|
8662
|
+
import React90 from "react";
|
8497
8663
|
var Timeline = (_a) => {
|
8498
8664
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8499
|
-
return /* @__PURE__ */
|
8665
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8500
8666
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8501
8667
|
}));
|
8502
8668
|
};
|
8503
|
-
var
|
8669
|
+
var Content2 = (_a) => {
|
8504
8670
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8505
|
-
return /* @__PURE__ */
|
8671
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8506
8672
|
className: classNames(tw("pb-6"), className)
|
8507
8673
|
}));
|
8508
8674
|
};
|
8509
8675
|
var Separator2 = (_a) => {
|
8510
8676
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8511
|
-
return /* @__PURE__ */
|
8677
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8512
8678
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8513
8679
|
}));
|
8514
8680
|
};
|
8515
8681
|
var LineContainer = (_a) => {
|
8516
8682
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8517
|
-
return /* @__PURE__ */
|
8683
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8518
8684
|
className: classNames(tw("flex justify-center py-1"), className)
|
8519
8685
|
}));
|
8520
8686
|
};
|
8521
8687
|
var Line = (_a) => {
|
8522
8688
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8523
|
-
return /* @__PURE__ */
|
8689
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8524
8690
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8525
8691
|
}));
|
8526
8692
|
};
|
8527
8693
|
var Dot = (_a) => {
|
8528
8694
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8529
|
-
return /* @__PURE__ */
|
8695
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8530
8696
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8531
8697
|
}));
|
8532
8698
|
};
|
@@ -8534,68 +8700,68 @@ Separator2.Dot = Dot;
|
|
8534
8700
|
LineContainer.Line = Line;
|
8535
8701
|
Timeline.Separator = Separator2;
|
8536
8702
|
Timeline.LineContainer = LineContainer;
|
8537
|
-
Timeline.Content =
|
8703
|
+
Timeline.Content = Content2;
|
8538
8704
|
|
8539
8705
|
// src/components/Timeline/Timeline.tsx
|
8540
8706
|
var import_error4 = __toESM(require_error());
|
8541
8707
|
var import_time = __toESM(require_time());
|
8542
8708
|
var import_warningSign4 = __toESM(require_warningSign());
|
8543
8709
|
var TimelineItem = () => null;
|
8544
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8710
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React91.createElement("div", null, React91.Children.map(children, (item) => {
|
8545
8711
|
if (!isComponentType(item, TimelineItem)) {
|
8546
8712
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8547
8713
|
} else {
|
8548
8714
|
const { props, key } = item;
|
8549
|
-
return /* @__PURE__ */
|
8715
|
+
return /* @__PURE__ */ React91.createElement(Timeline, {
|
8550
8716
|
key: key != null ? key : props.title
|
8551
|
-
}, /* @__PURE__ */
|
8717
|
+
}, /* @__PURE__ */ React91.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React91.createElement(Icon, {
|
8552
8718
|
icon: import_error4.default,
|
8553
8719
|
color: "error-30"
|
8554
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8720
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React91.createElement(Icon, {
|
8555
8721
|
icon: import_warningSign4.default,
|
8556
8722
|
color: "warning-30"
|
8557
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8723
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React91.createElement(Icon, {
|
8558
8724
|
icon: import_time.default,
|
8559
8725
|
color: "info-30"
|
8560
|
-
}) : /* @__PURE__ */
|
8726
|
+
}) : /* @__PURE__ */ React91.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React91.createElement(Typography2.Caption, {
|
8561
8727
|
color: "grey-50"
|
8562
|
-
}, props.title), /* @__PURE__ */
|
8728
|
+
}, 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
8729
|
}
|
8564
8730
|
}));
|
8565
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8731
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React91.createElement(Timeline, null, /* @__PURE__ */ React91.createElement(Timeline.Separator, null, /* @__PURE__ */ React91.createElement(Skeleton, {
|
8566
8732
|
width: 6,
|
8567
8733
|
height: 6,
|
8568
8734
|
rounded: true
|
8569
|
-
})), /* @__PURE__ */
|
8735
|
+
})), /* @__PURE__ */ React91.createElement(Skeleton, {
|
8570
8736
|
height: 12,
|
8571
8737
|
width: 120
|
8572
|
-
}), /* @__PURE__ */
|
8738
|
+
}), /* @__PURE__ */ React91.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React91.createElement(Skeleton, {
|
8573
8739
|
width: 2,
|
8574
8740
|
height: "100%"
|
8575
|
-
})), /* @__PURE__ */
|
8741
|
+
})), /* @__PURE__ */ React91.createElement(Timeline.Content, null, /* @__PURE__ */ React91.createElement(Box, {
|
8576
8742
|
display: "flex",
|
8577
8743
|
flexDirection: "column",
|
8578
8744
|
gap: "3"
|
8579
|
-
}, /* @__PURE__ */
|
8745
|
+
}, /* @__PURE__ */ React91.createElement(Skeleton, {
|
8580
8746
|
height: 32,
|
8581
8747
|
width: "100%"
|
8582
|
-
}), /* @__PURE__ */
|
8748
|
+
}), /* @__PURE__ */ React91.createElement(Skeleton, {
|
8583
8749
|
height: 32,
|
8584
8750
|
width: "73%"
|
8585
|
-
}), /* @__PURE__ */
|
8751
|
+
}), /* @__PURE__ */ React91.createElement(Skeleton, {
|
8586
8752
|
height: 32,
|
8587
8753
|
width: "80%"
|
8588
8754
|
}))));
|
8589
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8755
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React91.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React91.createElement(TimelineItemSkeleton, {
|
8590
8756
|
key
|
8591
8757
|
})));
|
8592
8758
|
Timeline2.Item = TimelineItem;
|
8593
8759
|
Timeline2.Skeleton = TimelineSkeleton;
|
8594
8760
|
|
8595
8761
|
// src/utils/table/useTableSelect.ts
|
8596
|
-
import
|
8762
|
+
import React92 from "react";
|
8597
8763
|
var useTableSelect = (data, { key }) => {
|
8598
|
-
const [selected, setSelected] =
|
8764
|
+
const [selected, setSelected] = React92.useState([]);
|
8599
8765
|
const allSelected = selected.length === data.length;
|
8600
8766
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8601
8767
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -8783,7 +8949,7 @@ export {
|
|
8783
8949
|
Box,
|
8784
8950
|
Breadcrumbs,
|
8785
8951
|
Button,
|
8786
|
-
Card,
|
8952
|
+
Card2 as Card,
|
8787
8953
|
Carousel,
|
8788
8954
|
CharCounter,
|
8789
8955
|
Checkbox2 as Checkbox,
|