@aivenio/aquarium 1.7.0 → 1.8.1
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 +139 -132
- package/dist/atoms.mjs +138 -132
- package/dist/src/common/Card/Card.d.ts +8 -2
- package/dist/src/common/Card/Card.js +10 -7
- package/dist/src/common/Link/Link.d.ts +3 -0
- package/dist/src/common/Link/Link.js +19 -0
- package/dist/src/common/Popover/Popover.js +2 -2
- 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 -1
- package/dist/src/components/Badge/Badge.js +2 -1
- package/dist/src/components/Button/Button.js +3 -2
- package/dist/src/components/Card/Card.d.ts +1 -1
- package/dist/src/components/Card/Card.js +24 -17
- package/dist/src/components/Card/Compact.js +18 -13
- package/dist/src/components/Card/types.d.ts +5 -0
- package/dist/src/components/Checkbox/Checkbox.js +3 -1
- package/dist/src/components/CheckboxGroup/CheckboxGroup.js +2 -1
- package/dist/src/components/Chip/Chip.js +2 -1
- package/dist/src/components/Combobox/Combobox.d.ts +1 -1
- package/dist/src/components/Combobox/Combobox.js +6 -4
- package/dist/src/components/DataTable/DataTable.js +2 -2
- package/dist/src/components/DropdownMenu/DropdownMenu.js +5 -1
- package/dist/src/components/Link/Link.d.ts +5 -0
- package/dist/src/components/Link/Link.js +4 -0
- package/dist/src/components/MultiSelect/MultiSelect.js +14 -4
- package/dist/src/components/NativeSelect/NativeSelect.js +3 -1
- package/dist/src/components/ProgressBar/ProgressBar.js +4 -2
- package/dist/src/components/RadioButton/RadioButton.js +3 -1
- package/dist/src/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/dist/src/components/Select/Select.js +2 -1
- package/dist/src/components/Skeleton/Skeleton.d.ts +3 -3
- package/dist/src/components/Skeleton/Skeleton.js +1 -1
- package/dist/src/components/Stepper/Stepper.js +2 -1
- package/dist/src/components/Switch/Switch.js +3 -1
- package/dist/src/components/SwitchGroup/SwitchGroup.js +2 -1
- package/dist/src/components/Textarea/Textarea.js +3 -1
- package/dist/src/components/Timeline/Timeline.js +2 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.js +2 -1
- package/dist/src/utils/constants.d.ts +2 -0
- package/dist/src/utils/constants.js +4 -2
- package/dist/src/utils/form/HelperText/HelperText.js +2 -1
- package/dist/src/utils/table/types.d.ts +2 -0
- package/dist/src/utils/table/types.js +2 -2
- package/dist/styles.css +19 -16
- package/dist/styles_timescaledb.css +19 -16
- package/dist/system.cjs +520 -441
- package/dist/system.mjs +515 -437
- package/dist/tailwind.config.js +1 -1
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/DimensionProps.d.ts +3 -0
- package/dist/types/DimensionProps.js +2 -0
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -1587,6 +1587,7 @@ __export(components_exports, {
|
|
1587
1587
|
Input: () => Input2,
|
1588
1588
|
InputBase: () => InputBase,
|
1589
1589
|
LineClamp: () => LineClamp,
|
1590
|
+
Link: () => Link2,
|
1590
1591
|
List: () => List,
|
1591
1592
|
ListItem: () => ListItem,
|
1592
1593
|
Modal: () => Modal2,
|
@@ -1691,20 +1692,20 @@ var classNames = (...args) => {
|
|
1691
1692
|
// src/components/Icon/Icon.tsx
|
1692
1693
|
var Icon = React.forwardRef((_a, ref) => {
|
1693
1694
|
var _b = _a, { color, className } = _b, rest = __objRest(_b, ["color", "className"]);
|
1694
|
-
const
|
1695
|
+
const classes2 = classNames(className, color && `text-${color}`);
|
1695
1696
|
return /* @__PURE__ */ React.createElement(IconifyIconComponent, __spreadValues({
|
1696
1697
|
ref: ref != null ? ref : void 0,
|
1697
|
-
className:
|
1698
|
+
className: classes2 !== "" ? classes2 : void 0
|
1698
1699
|
}, rest));
|
1699
1700
|
});
|
1700
1701
|
var InlineIcon = React.forwardRef((_a, ref) => {
|
1701
1702
|
var _b = _a, { color, className } = _b, rest = __objRest(_b, ["color", "className"]);
|
1702
|
-
const
|
1703
|
+
const classes2 = classNames(color && `text-${color}`);
|
1703
1704
|
return /* @__PURE__ */ React.createElement("span", {
|
1704
1705
|
className: classNames(tw("children:inline-block inline-flex justify-center items-center"), className)
|
1705
1706
|
}, /* @__PURE__ */ React.createElement(IconifyInlineIconComponent, __spreadValues({
|
1706
1707
|
ref: ref != null ? ref : void 0,
|
1707
|
-
className:
|
1708
|
+
className: classes2 !== "" ? classes2 : void 0
|
1708
1709
|
}, rest)));
|
1709
1710
|
});
|
1710
1711
|
|
@@ -2935,6 +2936,21 @@ var Arrow = (props) => {
|
|
2935
2936
|
}, props));
|
2936
2937
|
};
|
2937
2938
|
|
2939
|
+
// src/utils/constants.ts
|
2940
|
+
var getCommonInputStyles = ({ readOnly, valid }) => tw(
|
2941
|
+
"block w-full rounded-sm disabled:cursor-not-allowed disabled:border-grey-20 disabled:bg-grey-5 typography-small text-grey-70 disabled:text-grey-40 placeholder:text-grey-40 focus:outline-none",
|
2942
|
+
{
|
2943
|
+
"px-3 py-3": !readOnly,
|
2944
|
+
"border-none resize-none cursor-default": readOnly,
|
2945
|
+
"border border-error-50": !valid && !readOnly,
|
2946
|
+
"border border-grey-20 hover:border-grey-50 focus:border-info-70": valid && !readOnly
|
2947
|
+
}
|
2948
|
+
);
|
2949
|
+
var ghostButtonStyle = tw(
|
2950
|
+
"text-primary-80 active:text-primary-70 focus-visible:text-grey-90 hover:text-primary-70 disabled:text-primary-40"
|
2951
|
+
);
|
2952
|
+
var linkStyle = classNames(ghostButtonStyle, tw("visited:text-primary-80"));
|
2953
|
+
|
2938
2954
|
// src/components/Button/Button.tsx
|
2939
2955
|
var import_chevronDown2 = __toESM(require_chevronDown());
|
2940
2956
|
var import_loading = __toESM(require_loading());
|
@@ -2947,9 +2963,7 @@ var COLOR_CLASSNAMES = {
|
|
2947
2963
|
"focus-visible:ring-2 focus-visible:ring-grey-50 focus-visible:text-grey-80",
|
2948
2964
|
"hover:ring-grey-50 hover:text-grey-80 disabled:text-grey-30 disabled:bg-grey-0 disabled:ring-grey-20"
|
2949
2965
|
),
|
2950
|
-
"ghost":
|
2951
|
-
"text-primary-80 active:text-primary-70 focus-visible:text-grey-90 hover:text-primary-70 disabled:text-primary-40"
|
2952
|
-
),
|
2966
|
+
"ghost": ghostButtonStyle,
|
2953
2967
|
"secondary-ghost": tw(
|
2954
2968
|
"text-grey-60 active:text-grey-50 focus-visible:text-grey-80 hover:text-grey-80 disabled:text-grey-30"
|
2955
2969
|
)
|
@@ -3500,6 +3514,7 @@ var AvatarSkeleton = () => /* @__PURE__ */ React15.createElement(Skeleton, {
|
|
3500
3514
|
className: tw("rounded-full")
|
3501
3515
|
});
|
3502
3516
|
Avatar.Skeleton = AvatarSkeleton;
|
3517
|
+
Avatar.Skeleton.displayName = "Avatar.Skeleton";
|
3503
3518
|
|
3504
3519
|
// src/components/Badge/Badge.tsx
|
3505
3520
|
import React16 from "react";
|
@@ -3540,6 +3555,7 @@ var createBadge = (type, displayName) => {
|
|
3540
3555
|
display: "inline-block",
|
3541
3556
|
className: tw(type === "tab" ? "rounded" : "rounded-full")
|
3542
3557
|
});
|
3558
|
+
Component.Skeleton.displayName = `${displayName}.Skeleton`;
|
3543
3559
|
return Component;
|
3544
3560
|
};
|
3545
3561
|
var Badge = createBadge("default", "Badge");
|
@@ -3741,7 +3757,8 @@ var ActiveCrumb = asCrumb("span", "ActiveCrumb", { isActive: true });
|
|
3741
3757
|
Breadcrumbs.Crumb = Crumb;
|
3742
3758
|
|
3743
3759
|
// src/components/Card/Card.tsx
|
3744
|
-
import React25 from "react";
|
3760
|
+
import React25, { useRef as useRef3 } from "react";
|
3761
|
+
import { useButton as useButton2 } from "@react-aria/button";
|
3745
3762
|
import omit5 from "lodash/omit";
|
3746
3763
|
|
3747
3764
|
// src/components/Chip/Chip.tsx
|
@@ -3834,6 +3851,7 @@ var ChipSkeleton = ({ dense = false, width = dense ? 34 : 56 }) => /* @__PURE__
|
|
3834
3851
|
height: dense ? 20 : 28
|
3835
3852
|
});
|
3836
3853
|
Chip2.Skeleton = ChipSkeleton;
|
3854
|
+
Chip2.Skeleton.displayName = "Chip.Skeleton";
|
3837
3855
|
var StatusChip = React21.forwardRef(
|
3838
3856
|
(_a, ref) => {
|
3839
3857
|
var _b = _a, { UNSAFE_icon: icon, text, dense = false, status } = _b, rest = __objRest(_b, ["UNSAFE_icon", "text", "dense", "status"]);
|
@@ -3975,32 +3993,25 @@ Typography2.SmallTextBold = (_a) => {
|
|
3975
3993
|
|
3976
3994
|
// src/common/Card/Card.tsx
|
3977
3995
|
import React23 from "react";
|
3978
|
-
|
3979
|
-
|
3980
|
-
|
3981
|
-
fullWidth,
|
3982
|
-
|
3983
|
-
|
3984
|
-
|
3985
|
-
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3989
|
-
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
3995
|
-
|
3996
|
-
|
3997
|
-
"active:bg-grey-5 cursor-pointer hover:border-grey-50 focus:border-info-70": Boolean(clickable && !disabled),
|
3998
|
-
"bg-grey-0 cursor-not-allowed focus:border-transparent": Boolean(disabled)
|
3999
|
-
}),
|
4000
|
-
className
|
4001
|
-
)
|
4002
|
-
}), children);
|
4003
|
-
};
|
3996
|
+
import isNumber3 from "lodash/isNumber";
|
3997
|
+
var Card = React23.forwardRef(
|
3998
|
+
(_a, ref) => {
|
3999
|
+
var _b = _a, { disabled, fullWidth, clickable, className, children } = _b, rest = __objRest(_b, ["disabled", "fullWidth", "clickable", "className", "children"]);
|
4000
|
+
return /* @__PURE__ */ React23.createElement("div", __spreadProps(__spreadValues({
|
4001
|
+
ref
|
4002
|
+
}, rest), {
|
4003
|
+
className: classNames(
|
4004
|
+
tw("border-grey-5 border-[1px] rounded-[2px] relative p-5 flex flex-col gap-5", {
|
4005
|
+
"w-[280px]": !fullWidth,
|
4006
|
+
"w-full min-w-[280px]": Boolean(fullWidth),
|
4007
|
+
"active:bg-grey-5 cursor-pointer hover:border-grey-50 focus:border-info-70": Boolean(clickable && !disabled),
|
4008
|
+
"bg-grey-0 cursor-not-allowed focus:border-transparent": Boolean(disabled)
|
4009
|
+
}),
|
4010
|
+
className
|
4011
|
+
)
|
4012
|
+
}), children);
|
4013
|
+
}
|
4014
|
+
);
|
4004
4015
|
var ColorHighlight = (_a) => {
|
4005
4016
|
var _b = _a, { color, className } = _b, rest = __objRest(_b, ["color", "className"]);
|
4006
4017
|
return /* @__PURE__ */ React23.createElement(Box, __spreadProps(__spreadValues({}, rest), {
|
@@ -4019,16 +4030,15 @@ var ImageContainer = (_a) => {
|
|
4019
4030
|
)
|
4020
4031
|
}));
|
4021
4032
|
};
|
4022
|
-
var
|
4023
|
-
|
4024
|
-
imageAlt,
|
4025
|
-
fullSize
|
4026
|
-
}) => /* @__PURE__ */ React23.createElement("img", {
|
4033
|
+
var classes = "w-full bg-cover object-cover";
|
4034
|
+
var Image = ({ image, imageAlt, fullSize = false, imageHeight }) => /* @__PURE__ */ React23.createElement("img", {
|
4027
4035
|
src: image,
|
4028
4036
|
alt: imageAlt,
|
4029
|
-
className: tw(
|
4030
|
-
"h-[
|
4031
|
-
|
4037
|
+
className: tw(classes, {
|
4038
|
+
"h-[174px]": !imageHeight && !fullSize,
|
4039
|
+
"h-[225px]": !imageHeight && fullSize
|
4040
|
+
}),
|
4041
|
+
style: { height: isNumber3(imageHeight) ? `${imageHeight}px` : imageHeight }
|
4032
4042
|
});
|
4033
4043
|
var Content = (_a) => {
|
4034
4044
|
var _b = _a, { className, dense } = _b, rest = __objRest(_b, ["className", "dense"]);
|
@@ -4049,7 +4059,8 @@ Card.Image = Image;
|
|
4049
4059
|
Card.ColorHiglight = ColorHighlight;
|
4050
4060
|
|
4051
4061
|
// src/components/Card/Compact.tsx
|
4052
|
-
import React24 from "react";
|
4062
|
+
import React24, { useRef as useRef2 } from "react";
|
4063
|
+
import { useButton } from "@react-aria/button";
|
4053
4064
|
import { omit as omit4 } from "lodash";
|
4054
4065
|
var CompactCard = ({
|
4055
4066
|
title,
|
@@ -4062,38 +4073,42 @@ var CompactCard = ({
|
|
4062
4073
|
disabled,
|
4063
4074
|
fullWidth,
|
4064
4075
|
children
|
4065
|
-
}) =>
|
4066
|
-
|
4067
|
-
disabled,
|
4068
|
-
|
4069
|
-
|
4070
|
-
|
4071
|
-
|
4072
|
-
|
4073
|
-
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4077
|
-
|
4078
|
-
}
|
4079
|
-
|
4080
|
-
|
4081
|
-
},
|
4082
|
-
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4095
|
-
|
4096
|
-
}, omit4(
|
4076
|
+
}) => {
|
4077
|
+
const ref = useRef2(null);
|
4078
|
+
const { buttonProps } = useButton({ elementType: "div", onPress: onClick, isDisabled: disabled }, ref);
|
4079
|
+
return /* @__PURE__ */ React24.createElement(Card, __spreadProps(__spreadValues({
|
4080
|
+
ref,
|
4081
|
+
clickable: Boolean(onClick),
|
4082
|
+
fullWidth
|
4083
|
+
}, onClick ? buttonProps : {}), {
|
4084
|
+
disabled
|
4085
|
+
}), color && /* @__PURE__ */ React24.createElement(Card.ColorHiglight, {
|
4086
|
+
color
|
4087
|
+
}), chips.length > 0 && /* @__PURE__ */ React24.createElement(ChipContainer, {
|
4088
|
+
dense: true
|
4089
|
+
}, chips.map((chip) => /* @__PURE__ */ React24.createElement(Chip2, {
|
4090
|
+
key: chip,
|
4091
|
+
text: chip
|
4092
|
+
}))), /* @__PURE__ */ React24.createElement(Box, {
|
4093
|
+
display: "flex",
|
4094
|
+
gap: "5"
|
4095
|
+
}, icon && /* @__PURE__ */ React24.createElement(Avatar, {
|
4096
|
+
image: icon
|
4097
|
+
}), /* @__PURE__ */ React24.createElement(Card.Content, {
|
4098
|
+
dense: true
|
4099
|
+
}, /* @__PURE__ */ React24.createElement(Typography2.SmallStrong, {
|
4100
|
+
color: "black"
|
4101
|
+
}, title), /* @__PURE__ */ React24.createElement(Typography2.Caption, {
|
4102
|
+
color: "grey-70"
|
4103
|
+
}, children))), (action || link) && /* @__PURE__ */ React24.createElement(Card.Actions, {
|
4104
|
+
dense: true
|
4105
|
+
}, action && /* @__PURE__ */ React24.createElement(SecondaryButton, __spreadValues({
|
4106
|
+
dense: true
|
4107
|
+
}, omit4(action, "text")), action.text), link && /* @__PURE__ */ React24.createElement(ExternalLinkButton, __spreadValues({
|
4108
|
+
dense: true,
|
4109
|
+
kind: "ghost"
|
4110
|
+
}, omit4(link, "text")), link.text)));
|
4111
|
+
};
|
4097
4112
|
var CompactSkeleton = ({
|
4098
4113
|
chips = true,
|
4099
4114
|
icon = true,
|
@@ -4137,6 +4152,7 @@ var Card2 = ({
|
|
4137
4152
|
icons = [],
|
4138
4153
|
image,
|
4139
4154
|
imageAlt,
|
4155
|
+
imageHeight,
|
4140
4156
|
color,
|
4141
4157
|
action,
|
4142
4158
|
link,
|
@@ -4144,41 +4160,50 @@ var Card2 = ({
|
|
4144
4160
|
disabled,
|
4145
4161
|
fullWidth,
|
4146
4162
|
children
|
4147
|
-
}) =>
|
4148
|
-
|
4149
|
-
disabled,
|
4150
|
-
|
4151
|
-
|
4152
|
-
|
4153
|
-
|
4154
|
-
|
4155
|
-
|
4156
|
-
|
4157
|
-
|
4158
|
-
|
4159
|
-
|
4160
|
-
}
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4164
|
-
|
4165
|
-
|
4166
|
-
|
4167
|
-
|
4168
|
-
|
4169
|
-
|
4170
|
-
|
4171
|
-
|
4172
|
-
|
4173
|
-
|
4174
|
-
|
4175
|
-
},
|
4163
|
+
}) => {
|
4164
|
+
const ref = useRef3(null);
|
4165
|
+
const { buttonProps } = useButton2({ elementType: "div", onPress: onClick, isDisabled: disabled }, ref);
|
4166
|
+
return /* @__PURE__ */ React25.createElement(Card, __spreadProps(__spreadValues({
|
4167
|
+
ref,
|
4168
|
+
clickable: Boolean(onClick),
|
4169
|
+
fullWidth
|
4170
|
+
}, onClick ? buttonProps : {}), {
|
4171
|
+
disabled
|
4172
|
+
}), color && /* @__PURE__ */ React25.createElement(Card.ColorHiglight, {
|
4173
|
+
color
|
4174
|
+
}), chips.length > 0 && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
4175
|
+
dense: true
|
4176
|
+
}, chips.map((chip) => /* @__PURE__ */ React25.createElement(Chip2, {
|
4177
|
+
key: chip,
|
4178
|
+
text: chip
|
4179
|
+
}))), icons.length > 0 && /* @__PURE__ */ React25.createElement(AvatarStack, {
|
4180
|
+
images: icons
|
4181
|
+
}), image !== void 0 && (imageHeight ? /* @__PURE__ */ React25.createElement(CardImage, {
|
4182
|
+
image,
|
4183
|
+
imageAlt,
|
4184
|
+
imageHeight
|
4185
|
+
}) : /* @__PURE__ */ React25.createElement(CardImage, {
|
4186
|
+
image,
|
4187
|
+
imageAlt,
|
4188
|
+
fullSize: chips.length === 0
|
4189
|
+
})), /* @__PURE__ */ React25.createElement(Card.Content, null, /* @__PURE__ */ React25.createElement(Typography2.DefaultStrong, {
|
4190
|
+
color: "black"
|
4191
|
+
}, title), /* @__PURE__ */ React25.createElement(Typography2.Caption, {
|
4192
|
+
color: "grey-70"
|
4193
|
+
}, children || description)), (action || link) && /* @__PURE__ */ React25.createElement(Card.Actions, null, action && /* @__PURE__ */ React25.createElement(SecondaryButton, __spreadValues({
|
4194
|
+
dense: true
|
4195
|
+
}, omit5(action, "text")), action.text), link && /* @__PURE__ */ React25.createElement(ExternalLinkButton, __spreadValues({
|
4196
|
+
dense: true,
|
4197
|
+
kind: "ghost"
|
4198
|
+
}, omit5(link, "text")), link.text)));
|
4199
|
+
};
|
4176
4200
|
var CardSkeleton = ({
|
4177
4201
|
chips = true,
|
4178
4202
|
icons = false,
|
4179
4203
|
image = !icons,
|
4180
4204
|
actions = true,
|
4181
|
-
fullWidth = false
|
4205
|
+
fullWidth = false,
|
4206
|
+
imageHeight
|
4182
4207
|
}) => /* @__PURE__ */ React25.createElement(Card, {
|
4183
4208
|
fullWidth
|
4184
4209
|
}, chips && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
@@ -4187,10 +4212,13 @@ var CardSkeleton = ({
|
|
4187
4212
|
key: idx
|
4188
4213
|
}))), icons && /* @__PURE__ */ React25.createElement(AvatarStack, {
|
4189
4214
|
images: [null]
|
4190
|
-
}), image && /* @__PURE__ */ React25.createElement(CardImage, {
|
4215
|
+
}), image && (imageHeight ? /* @__PURE__ */ React25.createElement(CardImage, {
|
4216
|
+
image: null,
|
4217
|
+
imageHeight
|
4218
|
+
}) : /* @__PURE__ */ React25.createElement(CardImage, {
|
4191
4219
|
image: null,
|
4192
4220
|
fullSize: !chips
|
4193
|
-
}), /* @__PURE__ */ React25.createElement(Card.Content, null, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4221
|
+
})), /* @__PURE__ */ React25.createElement(Card.Content, null, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4194
4222
|
width: 145,
|
4195
4223
|
height: 25
|
4196
4224
|
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
@@ -4205,23 +4233,31 @@ var CardSkeleton = ({
|
|
4205
4233
|
})));
|
4206
4234
|
Card2.Skeleton = CardSkeleton;
|
4207
4235
|
Card2.Compact = CompactCard;
|
4208
|
-
var CardImage = ({ image, imageAlt, fullSize }) => /* @__PURE__ */ React25.createElement(Card.ImageContainer, {
|
4236
|
+
var CardImage = ({ image, imageAlt, imageHeight, fullSize = false }) => /* @__PURE__ */ React25.createElement(Card.ImageContainer, {
|
4209
4237
|
fullSize
|
4210
|
-
}, image ? /* @__PURE__ */ React25.createElement(Card.Image, {
|
4238
|
+
}, image ? imageHeight ? /* @__PURE__ */ React25.createElement(Card.Image, {
|
4239
|
+
image,
|
4240
|
+
imageAlt,
|
4241
|
+
imageHeight
|
4242
|
+
}) : /* @__PURE__ */ React25.createElement(Card.Image, {
|
4211
4243
|
image,
|
4212
4244
|
imageAlt,
|
4213
4245
|
fullSize
|
4214
4246
|
}) : /* @__PURE__ */ React25.createElement(CardImage.Skeleton, {
|
4215
|
-
fullSize
|
4247
|
+
fullSize,
|
4248
|
+
imageHeight
|
4216
4249
|
}));
|
4217
|
-
var CardImageSkeleton = ({ fullSize }) => /* @__PURE__ */ React25.createElement(Skeleton, {
|
4250
|
+
var CardImageSkeleton = ({ imageHeight, fullSize }) => imageHeight ? /* @__PURE__ */ React25.createElement(Skeleton, {
|
4251
|
+
height: imageHeight,
|
4252
|
+
width: "100%"
|
4253
|
+
}) : /* @__PURE__ */ React25.createElement(Skeleton, {
|
4218
4254
|
height: fullSize ? 225 : 174,
|
4219
4255
|
width: "100%"
|
4220
4256
|
});
|
4221
4257
|
CardImage.Skeleton = CardImageSkeleton;
|
4222
4258
|
|
4223
4259
|
// src/components/Carousel/Carousel.tsx
|
4224
|
-
import React26, { useEffect as useEffect3, useLayoutEffect, useRef as
|
4260
|
+
import React26, { useEffect as useEffect3, useLayoutEffect, useRef as useRef4, useState as useState2 } from "react";
|
4225
4261
|
var import_chevronLeft = __toESM(require_chevronLeft());
|
4226
4262
|
var import_chevronRight = __toESM(require_chevronRight());
|
4227
4263
|
var Carousel = ({
|
@@ -4230,8 +4266,8 @@ var Carousel = ({
|
|
4230
4266
|
onPageChange,
|
4231
4267
|
children
|
4232
4268
|
}) => {
|
4233
|
-
const containerRef =
|
4234
|
-
const scrollbarContainerRef =
|
4269
|
+
const containerRef = useRef4(null);
|
4270
|
+
const scrollbarContainerRef = useRef4(null);
|
4235
4271
|
const items = React26.Children.toArray(children);
|
4236
4272
|
const [width, setWidth] = useState2(0);
|
4237
4273
|
const [isUpdating, setIsUpdating] = useState2(false);
|
@@ -4429,6 +4465,7 @@ var Checkbox2 = React29.forwardRef(
|
|
4429
4465
|
}))) : null;
|
4430
4466
|
}
|
4431
4467
|
);
|
4468
|
+
Checkbox2.displayName = "Checkbox";
|
4432
4469
|
var CheckboxSkeleton = () => /* @__PURE__ */ React29.createElement("div", {
|
4433
4470
|
className: tw("flex gap-3")
|
4434
4471
|
}, /* @__PURE__ */ React29.createElement(Skeleton, {
|
@@ -4439,6 +4476,7 @@ var CheckboxSkeleton = () => /* @__PURE__ */ React29.createElement("div", {
|
|
4439
4476
|
width: 150
|
4440
4477
|
}));
|
4441
4478
|
Checkbox2.Skeleton = CheckboxSkeleton;
|
4479
|
+
Checkbox2.Skeleton.displayName = "Checkbox.Skeleton";
|
4442
4480
|
|
4443
4481
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4444
4482
|
import React36, { useState as useState3 } from "react";
|
@@ -4542,7 +4580,7 @@ var FormControl = ({ className, inline, children }) => {
|
|
4542
4580
|
// src/utils/form/HelperText/HelperText.tsx
|
4543
4581
|
import React34 from "react";
|
4544
4582
|
import classNames3 from "classnames";
|
4545
|
-
import
|
4583
|
+
import isNumber4 from "lodash/isNumber";
|
4546
4584
|
|
4547
4585
|
// src/utils/form/CharCounter/CharCounter.tsx
|
4548
4586
|
import React33 from "react";
|
@@ -4566,7 +4604,7 @@ var HelperText = ({
|
|
4566
4604
|
reserveSpaceForError = true
|
4567
4605
|
}) => {
|
4568
4606
|
const hasError = error2 && helperText;
|
4569
|
-
const hasMaxLength =
|
4607
|
+
const hasMaxLength = isNumber4(maxLength) && maxLength > 0;
|
4570
4608
|
const showMessage = hasError || hasMaxLength;
|
4571
4609
|
if (!showMessage) {
|
4572
4610
|
return reserveSpaceForError ? /* @__PURE__ */ React34.createElement("p", {
|
@@ -4590,7 +4628,7 @@ var HelperText = ({
|
|
4590
4628
|
colStart: "2",
|
4591
4629
|
colEnd: "3",
|
4592
4630
|
display: "flex"
|
4593
|
-
},
|
4631
|
+
}, isNumber4(length) && hasMaxLength && /* @__PURE__ */ React34.createElement(CharCounter, {
|
4594
4632
|
length,
|
4595
4633
|
maxLength,
|
4596
4634
|
valid: !error2
|
@@ -4600,6 +4638,7 @@ var Skeleton2 = ({ className, children }) => /* @__PURE__ */ React34.createEleme
|
|
4600
4638
|
className: classNames3(className, "h-[25px]")
|
4601
4639
|
}, children);
|
4602
4640
|
HelperText.Skeleton = Skeleton2;
|
4641
|
+
HelperText.Skeleton.displayName = "HelperText.Skeleton";
|
4603
4642
|
|
4604
4643
|
// src/utils/form/Label/Label.tsx
|
4605
4644
|
var import_questionMark = __toESM(require_questionMark());
|
@@ -4785,6 +4824,7 @@ var CheckboxGroupSkeleton = ({ options = 2 }) => {
|
|
4785
4824
|
}))));
|
4786
4825
|
};
|
4787
4826
|
CheckboxGroup.Skeleton = CheckboxGroupSkeleton;
|
4827
|
+
CheckboxGroup.Skeleton.displayName = "CheckboxGroup.Skeleton";
|
4788
4828
|
|
4789
4829
|
// src/components/ChoiceChip/ChoiceChip.tsx
|
4790
4830
|
import React37, { useState as useState4 } from "react";
|
@@ -4816,7 +4856,7 @@ var ChoiceChip = (_a) => {
|
|
4816
4856
|
};
|
4817
4857
|
|
4818
4858
|
// src/components/Combobox/Combobox.tsx
|
4819
|
-
import React40, { useEffect as useEffect4, useRef as
|
4859
|
+
import React40, { useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "react";
|
4820
4860
|
import { useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
4821
4861
|
import { useCombobox } from "downshift";
|
4822
4862
|
import omit6 from "lodash/omit";
|
@@ -4838,7 +4878,7 @@ var PopoverPanel = React38.forwardRef((_a, ref) => {
|
|
4838
4878
|
className: classNames(
|
4839
4879
|
className,
|
4840
4880
|
tw(
|
4841
|
-
"rounded-sm shadow-16dp bg-white mt-1 focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20
|
4881
|
+
"rounded-sm shadow-16dp bg-white mt-1 focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20"
|
4842
4882
|
)
|
4843
4883
|
)
|
4844
4884
|
}, props), children);
|
@@ -4945,8 +4985,8 @@ var ComboboxBase = (_a) => {
|
|
4945
4985
|
"readOnly"
|
4946
4986
|
]);
|
4947
4987
|
var _a2;
|
4948
|
-
const targetRef =
|
4949
|
-
const overlayRef =
|
4988
|
+
const targetRef = useRef5(null);
|
4989
|
+
const overlayRef = useRef5(null);
|
4950
4990
|
const [inputItems, setInputItems] = useState5(options);
|
4951
4991
|
const [hasFocus, setFocus] = useState5(false);
|
4952
4992
|
const updateInputItems = (query) => {
|
@@ -5044,10 +5084,10 @@ var ComboboxBase = (_a) => {
|
|
5044
5084
|
highlighted: index === highlightedIndex
|
5045
5085
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
5046
5086
|
};
|
5047
|
-
var
|
5087
|
+
var ComboboxBaseSkeleton = () => /* @__PURE__ */ React40.createElement(Skeleton, {
|
5048
5088
|
height: 38
|
5049
5089
|
});
|
5050
|
-
ComboboxBase.Skeleton =
|
5090
|
+
ComboboxBase.Skeleton = ComboboxBaseSkeleton;
|
5051
5091
|
var Combobox = (_a) => {
|
5052
5092
|
var _b = _a, {
|
5053
5093
|
options,
|
@@ -5057,7 +5097,7 @@ var Combobox = (_a) => {
|
|
5057
5097
|
"noResults"
|
5058
5098
|
]);
|
5059
5099
|
var _a2;
|
5060
|
-
const id =
|
5100
|
+
const id = useRef5((_a2 = props.id) != null ? _a2 : `combobox-${uniqueId2()}`);
|
5061
5101
|
const errorMessageId = uniqueId2();
|
5062
5102
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
5063
5103
|
const labelControlProps = getLabelControlProps(props);
|
@@ -5074,7 +5114,9 @@ var Combobox = (_a) => {
|
|
5074
5114
|
valid: props.valid
|
5075
5115
|
})));
|
5076
5116
|
};
|
5077
|
-
|
5117
|
+
var ComboboxSkeleton = () => /* @__PURE__ */ React40.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React40.createElement(ComboboxBase.Skeleton, null));
|
5118
|
+
Combobox.Skeleton = ComboboxSkeleton;
|
5119
|
+
Combobox.Skeleton.displayName = "Combobox.Skeleton";
|
5078
5120
|
|
5079
5121
|
// src/components/Container/Container.tsx
|
5080
5122
|
import React41 from "react";
|
@@ -5351,7 +5393,7 @@ var renameProperty = (oldProp, newProp, _a) => {
|
|
5351
5393
|
// src/utils/table/types.ts
|
5352
5394
|
var toSortDirection = (direction) => direction === "ascending" ? "asc" : direction === "descending" ? "desc" : false;
|
5353
5395
|
var cellProps = (column) => ({
|
5354
|
-
key: column.headerName,
|
5396
|
+
key: column.key || column.headerName,
|
5355
5397
|
align: column.type === "number" || column.type === "action" ? "right" : "left"
|
5356
5398
|
});
|
5357
5399
|
|
@@ -5481,10 +5523,12 @@ var DataTable = (_a) => {
|
|
5481
5523
|
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React50.createElement(Table2.SortCell, __spreadValues({
|
5482
5524
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5483
5525
|
onClick: () => updateSort(column.field),
|
5484
|
-
style: { width: column.width }
|
5485
|
-
|
5486
|
-
|
5487
|
-
|
5526
|
+
style: { width: column.width },
|
5527
|
+
"aria-label": column.headerInvisible ? column.headerName : void 0
|
5528
|
+
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React50.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5529
|
+
style: { width: column.width },
|
5530
|
+
"aria-label": column.headerInvisible ? column.headerName : void 0
|
5531
|
+
}), !column.headerInvisible && column.headerName)
|
5488
5532
|
)), /* @__PURE__ */ React50.createElement(Table2.Body, null, /* @__PURE__ */ React50.createElement(List, {
|
5489
5533
|
items: sortedRows,
|
5490
5534
|
renderItem: (row, index) => /* @__PURE__ */ React50.createElement(Table2.Row, {
|
@@ -5712,7 +5756,7 @@ var Divider2 = (_a) => {
|
|
5712
5756
|
import React55 from "react";
|
5713
5757
|
|
5714
5758
|
// src/components/Popover/Popover.tsx
|
5715
|
-
import React54, { useRef as
|
5759
|
+
import React54, { useRef as useRef6 } from "react";
|
5716
5760
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
5717
5761
|
import { useOverlayPosition as useOverlayPosition3, useOverlayTrigger } from "@react-aria/overlays";
|
5718
5762
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -5741,8 +5785,8 @@ var Popover2 = (props) => {
|
|
5741
5785
|
containFocus = false,
|
5742
5786
|
targetRef
|
5743
5787
|
} = props;
|
5744
|
-
const triggerRef =
|
5745
|
-
const overlayRef =
|
5788
|
+
const triggerRef = useRef6(null);
|
5789
|
+
const overlayRef = useRef6(null);
|
5746
5790
|
const state = useOverlayTriggerState3(props);
|
5747
5791
|
const {
|
5748
5792
|
overlayProps: popoverProps,
|
@@ -5820,7 +5864,7 @@ Popover2.Button = PopoverButton;
|
|
5820
5864
|
var PopoverTriggerWrapper = (_a) => {
|
5821
5865
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5822
5866
|
var _a2;
|
5823
|
-
const ref =
|
5867
|
+
const ref = useRef6(null);
|
5824
5868
|
const trigger = React54.Children.only(children);
|
5825
5869
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
|
5826
5870
|
return React54.cloneElement(trigger, __spreadProps(__spreadValues({
|
@@ -5955,22 +5999,11 @@ import { useMenuTriggerState } from "@react-stately/menu";
|
|
5955
5999
|
import { useTreeState } from "@react-stately/tree";
|
5956
6000
|
|
5957
6001
|
// src/components/Input/Input.tsx
|
5958
|
-
import React57, { forwardRef, useImperativeHandle, useRef as
|
6002
|
+
import React57, { forwardRef, useImperativeHandle, useRef as useRef7, useState as useState6 } from "react";
|
5959
6003
|
import omit8 from "lodash/omit";
|
5960
6004
|
import toString from "lodash/toString";
|
5961
6005
|
import uniqueId3 from "lodash/uniqueId";
|
5962
6006
|
|
5963
|
-
// src/utils/constants.ts
|
5964
|
-
var getCommonInputStyles = ({ readOnly, valid }) => tw(
|
5965
|
-
"block w-full rounded-sm disabled:cursor-not-allowed disabled:border-grey-20 disabled:bg-grey-5 typography-small text-grey-70 disabled:text-grey-40 placeholder:text-grey-40 focus:outline-none",
|
5966
|
-
{
|
5967
|
-
"px-3 py-3": !readOnly,
|
5968
|
-
"border-none resize-none cursor-default": readOnly,
|
5969
|
-
"border border-error-50": !valid && !readOnly,
|
5970
|
-
"border border-grey-20 hover:border-grey-50 focus:border-info-70": valid && !readOnly
|
5971
|
-
}
|
5972
|
-
);
|
5973
|
-
|
5974
6007
|
// src/utils/form/InputAdornment/InputAdornment.tsx
|
5975
6008
|
import React56 from "react";
|
5976
6009
|
var import_cross4 = __toESM(require_cross());
|
@@ -6075,7 +6108,7 @@ var Input2 = React57.forwardRef((_a, ref) => {
|
|
6075
6108
|
var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
|
6076
6109
|
var _a2, _b2, _c;
|
6077
6110
|
const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
|
6078
|
-
const id =
|
6111
|
+
const id = useRef7((_c = props.id) != null ? _c : `input-${uniqueId3()}`);
|
6079
6112
|
const errorMessageId = uniqueId3();
|
6080
6113
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
6081
6114
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
@@ -6275,9 +6308,13 @@ var DropdownMenu3 = (_a) => {
|
|
6275
6308
|
var MenuTrigger = () => null;
|
6276
6309
|
var MenuItems = () => null;
|
6277
6310
|
DropdownMenu3.Trigger = MenuTrigger;
|
6311
|
+
DropdownMenu3.Trigger.displayName = "DropdownMenu.Trigger";
|
6278
6312
|
DropdownMenu3.Items = MenuItems;
|
6313
|
+
DropdownMenu3.Items.displayName = "DropdownMenu.Items";
|
6279
6314
|
DropdownMenu3.Item = Item4;
|
6315
|
+
DropdownMenu3.Item.displayName = "DropdownMenu.Item";
|
6280
6316
|
DropdownMenu3.Section = Section;
|
6317
|
+
DropdownMenu3.Section.displayName = "DropdownMenu.Section";
|
6281
6318
|
var TriggerWrapper = (_a) => {
|
6282
6319
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6283
6320
|
const ref = React59.useRef(null);
|
@@ -6592,24 +6629,39 @@ var LineClamp = ({ lines, children, expandLabel, collapseLabel }) => {
|
|
6592
6629
|
}, clamped ? expandLabel : collapseLabel));
|
6593
6630
|
};
|
6594
6631
|
|
6595
|
-
// src/components/
|
6632
|
+
// src/components/Link/Link.tsx
|
6633
|
+
import React65 from "react";
|
6634
|
+
|
6635
|
+
// src/common/Link/Link.tsx
|
6596
6636
|
import React64 from "react";
|
6597
|
-
var
|
6637
|
+
var Link = (_a) => {
|
6638
|
+
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
6639
|
+
return /* @__PURE__ */ React64.createElement("a", __spreadValues({
|
6640
|
+
className: classNames(className, linkStyle)
|
6641
|
+
}, props), children);
|
6642
|
+
};
|
6643
|
+
|
6644
|
+
// src/components/Link/Link.tsx
|
6645
|
+
var Link2 = (props) => /* @__PURE__ */ React65.createElement(Link, __spreadValues({}, props));
|
6646
|
+
|
6647
|
+
// src/components/List/List.tsx
|
6648
|
+
import React66 from "react";
|
6649
|
+
var List = ({ items, renderItem, container = React66.Fragment }) => {
|
6598
6650
|
const Component = container;
|
6599
|
-
return /* @__PURE__ */
|
6651
|
+
return /* @__PURE__ */ React66.createElement(Component, null, items.map(renderItem));
|
6600
6652
|
};
|
6601
6653
|
|
6602
6654
|
// src/components/ListItem/ListItem.tsx
|
6603
|
-
import
|
6655
|
+
import React67 from "react";
|
6604
6656
|
var ListItem = ({ name, icon, active = false }) => {
|
6605
|
-
return /* @__PURE__ */
|
6657
|
+
return /* @__PURE__ */ React67.createElement(Flexbox, {
|
6606
6658
|
alignItems: "center"
|
6607
|
-
}, /* @__PURE__ */
|
6659
|
+
}, /* @__PURE__ */ React67.createElement(Typography2, {
|
6608
6660
|
variant: active ? "small-strong" : "small",
|
6609
6661
|
color: "grey-70",
|
6610
6662
|
htmlTag: "span",
|
6611
6663
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6612
|
-
}, /* @__PURE__ */
|
6664
|
+
}, /* @__PURE__ */ React67.createElement("img", {
|
6613
6665
|
src: icon,
|
6614
6666
|
alt: name,
|
6615
6667
|
className: "inline mr-4",
|
@@ -6619,7 +6671,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6619
6671
|
};
|
6620
6672
|
|
6621
6673
|
// src/components/Modal/Modal.tsx
|
6622
|
-
import
|
6674
|
+
import React69 from "react";
|
6623
6675
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6624
6676
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
6625
6677
|
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
@@ -6629,18 +6681,18 @@ import castArray from "lodash/castArray";
|
|
6629
6681
|
import omit10 from "lodash/omit";
|
6630
6682
|
|
6631
6683
|
// src/components/Tabs/Tabs.tsx
|
6632
|
-
import
|
6633
|
-
import
|
6684
|
+
import React68, { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState7 } from "react";
|
6685
|
+
import isNumber5 from "lodash/isNumber";
|
6634
6686
|
import kebabCase from "lodash/kebabCase";
|
6635
6687
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6636
6688
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6637
6689
|
var import_warningSign3 = __toESM(require_warningSign());
|
6638
6690
|
var isTabComponent = (c) => {
|
6639
|
-
return
|
6691
|
+
return React68.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6640
6692
|
};
|
6641
|
-
var Tab =
|
6693
|
+
var Tab = React68.forwardRef(
|
6642
6694
|
({ className, id, title, children }, ref) => {
|
6643
|
-
return /* @__PURE__ */
|
6695
|
+
return /* @__PURE__ */ React68.createElement("div", {
|
6644
6696
|
ref,
|
6645
6697
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6646
6698
|
className,
|
@@ -6652,14 +6704,14 @@ var Tab = React66.forwardRef(
|
|
6652
6704
|
);
|
6653
6705
|
var TabContainer = (_a) => {
|
6654
6706
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6655
|
-
return /* @__PURE__ */
|
6707
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6656
6708
|
className: classNames("py-6 z-0", className)
|
6657
6709
|
}), children);
|
6658
6710
|
};
|
6659
6711
|
var ModalTab = Tab;
|
6660
6712
|
var ModalTabContainer = TabContainer;
|
6661
6713
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6662
|
-
const Tab2 =
|
6714
|
+
const Tab2 = React68.forwardRef(
|
6663
6715
|
(_a, ref) => {
|
6664
6716
|
var _b = _a, {
|
6665
6717
|
id,
|
@@ -6689,17 +6741,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6689
6741
|
const _id = id != null ? id : kebabCase(title);
|
6690
6742
|
let statusIcon = void 0;
|
6691
6743
|
if (status === "warning") {
|
6692
|
-
statusIcon = /* @__PURE__ */
|
6744
|
+
statusIcon = /* @__PURE__ */ React68.createElement(InlineIcon, {
|
6693
6745
|
icon: import_warningSign3.default,
|
6694
6746
|
color: "warning-80"
|
6695
6747
|
});
|
6696
6748
|
} else if (status === "error") {
|
6697
|
-
statusIcon = /* @__PURE__ */
|
6749
|
+
statusIcon = /* @__PURE__ */ React68.createElement(InlineIcon, {
|
6698
6750
|
icon: import_warningSign3.default,
|
6699
6751
|
color: "error-50"
|
6700
6752
|
});
|
6701
6753
|
}
|
6702
|
-
const tab = /* @__PURE__ */
|
6754
|
+
const tab = /* @__PURE__ */ React68.createElement(Component, __spreadValues({
|
6703
6755
|
ref,
|
6704
6756
|
id: `${_id}-tab`,
|
6705
6757
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6716,24 +6768,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6716
6768
|
"aria-selected": selected,
|
6717
6769
|
"aria-controls": `${_id}-panel`,
|
6718
6770
|
tabIndex: disabled ? void 0 : 0
|
6719
|
-
}, rest), /* @__PURE__ */
|
6771
|
+
}, rest), /* @__PURE__ */ React68.createElement(Typography2, {
|
6720
6772
|
htmlTag: "div",
|
6721
6773
|
variant: "small",
|
6722
6774
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6723
6775
|
className: tw("inline-flex items-center gap-3")
|
6724
|
-
}, /* @__PURE__ */
|
6776
|
+
}, /* @__PURE__ */ React68.createElement("span", {
|
6725
6777
|
className: tw("whitespace-nowrap")
|
6726
|
-
}, title),
|
6778
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React68.createElement(Typography2, {
|
6727
6779
|
htmlTag: "span",
|
6728
6780
|
variant: "small",
|
6729
6781
|
color: selected ? "primary-80" : "grey-5",
|
6730
6782
|
className: "leading-none"
|
6731
|
-
}, /* @__PURE__ */
|
6783
|
+
}, /* @__PURE__ */ React68.createElement(TabBadge, {
|
6732
6784
|
kind: "filled",
|
6733
6785
|
value: badge,
|
6734
6786
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6735
6787
|
})), statusIcon));
|
6736
|
-
return tooltip ? /* @__PURE__ */
|
6788
|
+
return tooltip ? /* @__PURE__ */ React68.createElement(Tooltip, {
|
6737
6789
|
content: tooltip
|
6738
6790
|
}, tab) : tab;
|
6739
6791
|
}
|
@@ -6747,20 +6799,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6747
6799
|
const Tabs2 = (props) => {
|
6748
6800
|
var _a, _b;
|
6749
6801
|
const { className, value, defaultValue, onChange, children } = props;
|
6750
|
-
const childArr =
|
6802
|
+
const childArr = React68.Children.toArray(children);
|
6751
6803
|
const firstTab = childArr[0];
|
6752
6804
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6753
6805
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
6754
6806
|
const [leftCaret, showLeftCaret] = useState7(false);
|
6755
6807
|
const [rightCaret, showRightCaret] = useState7(false);
|
6756
|
-
const parentRef =
|
6757
|
-
const containerRef =
|
6758
|
-
const tabsRef =
|
6808
|
+
const parentRef = useRef8(null);
|
6809
|
+
const containerRef = useRef8(null);
|
6810
|
+
const tabsRef = useRef8(null);
|
6759
6811
|
const revealSelectedTab = ({ smooth }) => {
|
6760
6812
|
var _a2, _b2;
|
6761
6813
|
const container = containerRef.current;
|
6762
6814
|
const tabs = tabsRef.current;
|
6763
|
-
const values =
|
6815
|
+
const values = React68.Children.map(
|
6764
6816
|
children,
|
6765
6817
|
(tab, i) => {
|
6766
6818
|
var _a3;
|
@@ -6801,7 +6853,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6801
6853
|
updateCarets();
|
6802
6854
|
setSelected(value);
|
6803
6855
|
revealSelectedTab({ smooth: value !== selected });
|
6804
|
-
}, [value,
|
6856
|
+
}, [value, React68.Children.count(children)]);
|
6805
6857
|
useLayoutEffect2(() => {
|
6806
6858
|
var _a2;
|
6807
6859
|
updateCarets();
|
@@ -6865,27 +6917,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6865
6917
|
const handleSelected = (key) => {
|
6866
6918
|
(onChange != null ? onChange : setSelected)(key);
|
6867
6919
|
};
|
6868
|
-
|
6920
|
+
React68.Children.forEach(children, (c) => {
|
6869
6921
|
if (c && !isTabComponent(c)) {
|
6870
6922
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6871
6923
|
}
|
6872
6924
|
});
|
6873
|
-
return /* @__PURE__ */
|
6925
|
+
return /* @__PURE__ */ React68.createElement("div", {
|
6874
6926
|
ref: parentRef,
|
6875
6927
|
className: classNames(tw("h-full"), className)
|
6876
|
-
}, /* @__PURE__ */
|
6928
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6877
6929
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6878
|
-
}, /* @__PURE__ */
|
6930
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6879
6931
|
ref: containerRef,
|
6880
6932
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6881
|
-
}, /* @__PURE__ */
|
6933
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6882
6934
|
ref: tabsRef,
|
6883
6935
|
role: "tablist",
|
6884
6936
|
"aria-label": "tabs",
|
6885
6937
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
6886
|
-
},
|
6938
|
+
}, React68.Children.map(
|
6887
6939
|
children,
|
6888
|
-
(tab, index) => tab ? /* @__PURE__ */
|
6940
|
+
(tab, index) => tab ? /* @__PURE__ */ React68.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
6889
6941
|
key: tab.props.value
|
6890
6942
|
}, tab.props), {
|
6891
6943
|
index,
|
@@ -6893,20 +6945,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6893
6945
|
onKeyDown: handleKeyDown,
|
6894
6946
|
onSelected: handleSelected
|
6895
6947
|
})) : void 0
|
6896
|
-
))), leftCaret && /* @__PURE__ */
|
6948
|
+
))), leftCaret && /* @__PURE__ */ React68.createElement("div", {
|
6897
6949
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
6898
|
-
}, /* @__PURE__ */
|
6950
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6899
6951
|
onClick: () => handleScrollToNext("left"),
|
6900
6952
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6901
|
-
}, /* @__PURE__ */
|
6953
|
+
}, /* @__PURE__ */ React68.createElement(InlineIcon, {
|
6902
6954
|
icon: import_chevronLeft2.default
|
6903
|
-
}))), rightCaret && /* @__PURE__ */
|
6955
|
+
}))), rightCaret && /* @__PURE__ */ React68.createElement("div", {
|
6904
6956
|
onClick: () => handleScrollToNext("right"),
|
6905
6957
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
6906
|
-
}, /* @__PURE__ */
|
6958
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
6907
6959
|
onClick: () => handleScrollToNext("right"),
|
6908
6960
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6909
|
-
}, /* @__PURE__ */
|
6961
|
+
}, /* @__PURE__ */ React68.createElement(InlineIcon, {
|
6910
6962
|
icon: import_chevronRight2.default
|
6911
6963
|
})))), renderChildren(children, selected, props));
|
6912
6964
|
};
|
@@ -6914,7 +6966,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6914
6966
|
Tabs2.Tab = TabComponent;
|
6915
6967
|
return Tabs2;
|
6916
6968
|
};
|
6917
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
6969
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React68.createElement(TabContainer, null, children.find(
|
6918
6970
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6919
6971
|
)));
|
6920
6972
|
|
@@ -6931,7 +6983,7 @@ var Modal2 = ({
|
|
6931
6983
|
secondaryActions,
|
6932
6984
|
size
|
6933
6985
|
}) => {
|
6934
|
-
const ref =
|
6986
|
+
const ref = React69.useRef(null);
|
6935
6987
|
const state = useOverlayTriggerState4({ isOpen: open });
|
6936
6988
|
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
6937
6989
|
const labelledBy = useId2();
|
@@ -6943,35 +6995,35 @@ var Modal2 = ({
|
|
6943
6995
|
if (!open) {
|
6944
6996
|
return null;
|
6945
6997
|
}
|
6946
|
-
return /* @__PURE__ */
|
6998
|
+
return /* @__PURE__ */ React69.createElement(Overlay2, null, /* @__PURE__ */ React69.createElement(Modal, {
|
6947
6999
|
open: state.isOpen
|
6948
|
-
}, /* @__PURE__ */
|
7000
|
+
}, /* @__PURE__ */ React69.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React69.createElement(FocusScope3, {
|
6949
7001
|
contain: true,
|
6950
7002
|
restoreFocus: true,
|
6951
7003
|
autoFocus: true
|
6952
|
-
}, /* @__PURE__ */
|
7004
|
+
}, /* @__PURE__ */ React69.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
6953
7005
|
ref,
|
6954
7006
|
size
|
6955
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
7007
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React69.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React69.createElement(IconButton, {
|
6956
7008
|
"aria-label": "Close",
|
6957
7009
|
icon: import_cross5.default,
|
6958
7010
|
onClick: onClose
|
6959
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
7011
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React69.createElement(Modal.HeaderImage, {
|
6960
7012
|
backgroundImage: headerImage
|
6961
|
-
}), /* @__PURE__ */
|
7013
|
+
}), /* @__PURE__ */ React69.createElement(Modal.Header, {
|
6962
7014
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
6963
|
-
}, /* @__PURE__ */
|
7015
|
+
}, /* @__PURE__ */ React69.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React69.createElement(Modal.Title, {
|
6964
7016
|
id: labelledBy
|
6965
|
-
}, title), subtitle && /* @__PURE__ */
|
7017
|
+
}, title), subtitle && /* @__PURE__ */ React69.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React69.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React69.createElement(Modal.Body, {
|
6966
7018
|
id: describedBy,
|
6967
7019
|
tabIndex: 0,
|
6968
7020
|
noFooter: !(secondaryActions || primaryAction)
|
6969
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7021
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React69.createElement(Modal.Footer, null, /* @__PURE__ */ React69.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
6970
7022
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
6971
|
-
return /* @__PURE__ */
|
7023
|
+
return /* @__PURE__ */ React69.createElement(SecondaryButton, __spreadValues({
|
6972
7024
|
key: text
|
6973
7025
|
}, action), text);
|
6974
|
-
}), primaryAction && /* @__PURE__ */
|
7026
|
+
}), primaryAction && /* @__PURE__ */ React69.createElement(PrimaryButton, __spreadValues({
|
6975
7027
|
key: primaryAction.text
|
6976
7028
|
}, omit10(primaryAction, "text")), primaryAction.text)))))));
|
6977
7029
|
};
|
@@ -6979,24 +7031,24 @@ var ModalTabs = createTabsComponent(
|
|
6979
7031
|
ModalTab,
|
6980
7032
|
TabItem,
|
6981
7033
|
"ModalTabs",
|
6982
|
-
(children, selected, props) => /* @__PURE__ */
|
7034
|
+
(children, selected, props) => /* @__PURE__ */ React69.createElement(Modal.Body, {
|
6983
7035
|
maxHeight: props.maxHeight
|
6984
|
-
}, /* @__PURE__ */
|
7036
|
+
}, /* @__PURE__ */ React69.createElement(ModalTabContainer, null, children.find(
|
6985
7037
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6986
7038
|
)))
|
6987
7039
|
);
|
6988
7040
|
|
6989
7041
|
// src/components/MultiInput/MultiInput.tsx
|
6990
|
-
import
|
7042
|
+
import React71, { useEffect as useEffect6, useRef as useRef9, useState as useState8 } from "react";
|
6991
7043
|
import castArray2 from "lodash/castArray";
|
6992
7044
|
import identity from "lodash/identity";
|
6993
7045
|
import omit11 from "lodash/omit";
|
6994
7046
|
import uniqueId4 from "lodash/uniqueId";
|
6995
7047
|
|
6996
7048
|
// src/components/MultiInput/InputChip.tsx
|
6997
|
-
import
|
7049
|
+
import React70 from "react";
|
6998
7050
|
var import_smallCross = __toESM(require_smallCross());
|
6999
|
-
var InputChip =
|
7051
|
+
var InputChip = React70.forwardRef(
|
7000
7052
|
(_a, ref) => {
|
7001
7053
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
7002
7054
|
const onClick = (e) => {
|
@@ -7004,7 +7056,7 @@ var InputChip = React68.forwardRef(
|
|
7004
7056
|
_onClick == null ? void 0 : _onClick(e);
|
7005
7057
|
}
|
7006
7058
|
};
|
7007
|
-
return /* @__PURE__ */
|
7059
|
+
return /* @__PURE__ */ React70.createElement("div", __spreadValues({
|
7008
7060
|
ref,
|
7009
7061
|
role: "button",
|
7010
7062
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -7014,10 +7066,10 @@ var InputChip = React68.forwardRef(
|
|
7014
7066
|
"bg-grey-5 pointer-events-none": disabled
|
7015
7067
|
}),
|
7016
7068
|
onClick
|
7017
|
-
}, props), /* @__PURE__ */
|
7069
|
+
}, props), /* @__PURE__ */ React70.createElement(Typography2, {
|
7018
7070
|
variant: "small",
|
7019
7071
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
7020
|
-
}, children), !readOnly && /* @__PURE__ */
|
7072
|
+
}, children), !readOnly && /* @__PURE__ */ React70.createElement("div", null, /* @__PURE__ */ React70.createElement(Icon, {
|
7021
7073
|
icon: import_smallCross.default,
|
7022
7074
|
className: tw("ml-2", {
|
7023
7075
|
"text-error-70": invalid,
|
@@ -7075,7 +7127,7 @@ var MultiInputBase = (_a) => {
|
|
7075
7127
|
"valid"
|
7076
7128
|
]);
|
7077
7129
|
var _a2;
|
7078
|
-
const inputRef =
|
7130
|
+
const inputRef = useRef9(null);
|
7079
7131
|
const [items, setItems] = useState8((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
7080
7132
|
const [hasFocus, setFocus] = useState8(false);
|
7081
7133
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
@@ -7158,7 +7210,7 @@ var MultiInputBase = (_a) => {
|
|
7158
7210
|
};
|
7159
7211
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
7160
7212
|
var _a3;
|
7161
|
-
return /* @__PURE__ */
|
7213
|
+
return /* @__PURE__ */ React71.createElement(InputChip, {
|
7162
7214
|
key: `${itemToString(item)}.${index}`,
|
7163
7215
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
7164
7216
|
readOnly,
|
@@ -7169,11 +7221,11 @@ var MultiInputBase = (_a) => {
|
|
7169
7221
|
}
|
7170
7222
|
}, itemToString(item));
|
7171
7223
|
});
|
7172
|
-
return /* @__PURE__ */
|
7224
|
+
return /* @__PURE__ */ React71.createElement("div", null, /* @__PURE__ */ React71.createElement(Select.InputContainer, {
|
7173
7225
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7174
|
-
}, /* @__PURE__ */
|
7226
|
+
}, /* @__PURE__ */ React71.createElement("div", {
|
7175
7227
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
7176
|
-
}, inline && renderChips(), /* @__PURE__ */
|
7228
|
+
}, inline && renderChips(), /* @__PURE__ */ React71.createElement(Select.Input, __spreadProps(__spreadValues({
|
7177
7229
|
ref: inputRef,
|
7178
7230
|
id: id != null ? id : name,
|
7179
7231
|
name,
|
@@ -7191,11 +7243,11 @@ var MultiInputBase = (_a) => {
|
|
7191
7243
|
onFocus: handleFocus,
|
7192
7244
|
onBlur: handleBlur,
|
7193
7245
|
autoComplete: "off"
|
7194
|
-
}))), endAdornment && /* @__PURE__ */
|
7246
|
+
}))), endAdornment && /* @__PURE__ */ React71.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React71.createElement("div", {
|
7195
7247
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
7196
7248
|
}, renderChips()));
|
7197
7249
|
};
|
7198
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7250
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React71.createElement(Skeleton, {
|
7199
7251
|
height: 38
|
7200
7252
|
});
|
7201
7253
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7207,19 +7259,19 @@ var MultiInput = (props) => {
|
|
7207
7259
|
var _a2;
|
7208
7260
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
7209
7261
|
}, [JSON.stringify(props.value)]);
|
7210
|
-
const id =
|
7262
|
+
const id = useRef9((_e = (_d = props.id) != null ? _d : props.name) != null ? _e : `multiinput-${uniqueId4()}`);
|
7211
7263
|
const errorMessageId = uniqueId4();
|
7212
7264
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7213
7265
|
const labelControlProps = getLabelControlProps(props);
|
7214
7266
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7215
|
-
return /* @__PURE__ */
|
7267
|
+
return /* @__PURE__ */ React71.createElement(LabelControl, __spreadProps(__spreadValues({
|
7216
7268
|
id: `${id.current}-label`,
|
7217
7269
|
htmlFor: `${id.current}-input`,
|
7218
7270
|
messageId: errorMessageId
|
7219
7271
|
}, labelControlProps), {
|
7220
7272
|
length: value.length,
|
7221
7273
|
maxLength
|
7222
|
-
}), /* @__PURE__ */
|
7274
|
+
}), /* @__PURE__ */ React71.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7223
7275
|
id: `${id.current}-input`,
|
7224
7276
|
onChange: (value2) => {
|
7225
7277
|
var _a2;
|
@@ -7231,14 +7283,15 @@ var MultiInput = (props) => {
|
|
7231
7283
|
valid: props.valid
|
7232
7284
|
})));
|
7233
7285
|
};
|
7234
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7286
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React71.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React71.createElement(MultiInputBase.Skeleton, null));
|
7235
7287
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7236
7288
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7237
7289
|
|
7238
7290
|
// src/components/MultiSelect/MultiSelect.tsx
|
7239
|
-
import
|
7291
|
+
import React72, { useRef as useRef10, useState as useState9 } from "react";
|
7240
7292
|
import { useOverlayPosition as useOverlayPosition5 } from "@react-aria/overlays";
|
7241
7293
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7294
|
+
import isEqual from "lodash/isEqual";
|
7242
7295
|
import isNil from "lodash/isNil";
|
7243
7296
|
import omit12 from "lodash/omit";
|
7244
7297
|
import omitBy from "lodash/omitBy";
|
@@ -7291,8 +7344,8 @@ var MultiSelectBase = (_a) => {
|
|
7291
7344
|
"children"
|
7292
7345
|
]);
|
7293
7346
|
var _a2;
|
7294
|
-
const targetRef =
|
7295
|
-
const overlayRef =
|
7347
|
+
const targetRef = useRef10(null);
|
7348
|
+
const overlayRef = useRef10(null);
|
7296
7349
|
const [inputValue, setInputValue] = useState9("");
|
7297
7350
|
const [hasFocus, setFocus] = useState9(false);
|
7298
7351
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = useMultipleSelection(
|
@@ -7326,14 +7379,23 @@ var MultiSelectBase = (_a) => {
|
|
7326
7379
|
selectedItem: null,
|
7327
7380
|
items: filteredOptions,
|
7328
7381
|
stateReducer: (_, actionChanges) => {
|
7382
|
+
var _a3, _b2;
|
7329
7383
|
const { changes, type } = actionChanges;
|
7330
7384
|
switch (type) {
|
7331
7385
|
case useCombobox2.stateChangeTypes.InputKeyDownEnter:
|
7332
7386
|
case useCombobox2.stateChangeTypes.ItemClick: {
|
7387
|
+
const selectedItem = (_a3 = changes.selectedItem) != null ? _a3 : changes.inputValue ? createOption == null ? void 0 : createOption(changes.inputValue) : null;
|
7333
7388
|
return __spreadProps(__spreadValues({}, changes), {
|
7389
|
+
selectedItem,
|
7334
7390
|
isOpen: !closeOnSelect
|
7335
7391
|
});
|
7336
7392
|
}
|
7393
|
+
case useCombobox2.stateChangeTypes.InputBlur: {
|
7394
|
+
const selectedItem = (_b2 = changes.selectedItem) != null ? _b2 : changes.inputValue ? createOption == null ? void 0 : createOption(changes.inputValue) : null;
|
7395
|
+
return __spreadProps(__spreadValues({}, changes), {
|
7396
|
+
selectedItem
|
7397
|
+
});
|
7398
|
+
}
|
7337
7399
|
}
|
7338
7400
|
return changes;
|
7339
7401
|
},
|
@@ -7346,8 +7408,8 @@ var MultiSelectBase = (_a) => {
|
|
7346
7408
|
case useCombobox2.stateChangeTypes.InputKeyDownEnter:
|
7347
7409
|
case useCombobox2.stateChangeTypes.ItemClick:
|
7348
7410
|
case useCombobox2.stateChangeTypes.InputBlur: {
|
7349
|
-
|
7350
|
-
|
7411
|
+
setInputValue("");
|
7412
|
+
if (selectedItem && !isOptionDisabled(selectedItem, options.indexOf(selectedItem)) && !selectedItems.some((val) => isEqual(val, selectedItem))) {
|
7351
7413
|
addSelectedItem(selectedItem);
|
7352
7414
|
}
|
7353
7415
|
break;
|
@@ -7364,7 +7426,7 @@ var MultiSelectBase = (_a) => {
|
|
7364
7426
|
});
|
7365
7427
|
const inputProps = getInputProps(getDropdownProps({ disabled: disabled || readOnly }));
|
7366
7428
|
const renderChips = () => {
|
7367
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7429
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React72.createElement(InputChip, __spreadProps(__spreadValues({
|
7368
7430
|
key: `${itemToString(selectedItem)}.chip`,
|
7369
7431
|
className: tw("mx-0"),
|
7370
7432
|
disabled,
|
@@ -7380,14 +7442,14 @@ var MultiSelectBase = (_a) => {
|
|
7380
7442
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7381
7443
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
7382
7444
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7383
|
-
return /* @__PURE__ */
|
7445
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
7384
7446
|
className: tw("relative")
|
7385
|
-
}, /* @__PURE__ */
|
7447
|
+
}, /* @__PURE__ */ React72.createElement(Select.InputContainer, {
|
7386
7448
|
ref: targetRef,
|
7387
7449
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7388
|
-
}, /* @__PURE__ */
|
7450
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
7389
7451
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7390
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7452
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React72.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7391
7453
|
id,
|
7392
7454
|
name,
|
7393
7455
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
@@ -7408,12 +7470,12 @@ var MultiSelectBase = (_a) => {
|
|
7408
7470
|
setFocus(false);
|
7409
7471
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
7410
7472
|
}
|
7411
|
-
}))), !readOnly && /* @__PURE__ */
|
7473
|
+
}))), !readOnly && /* @__PURE__ */ React72.createElement(Select.Toggle, __spreadValues({
|
7412
7474
|
hasFocus,
|
7413
7475
|
isOpen
|
7414
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7476
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React72.createElement("div", {
|
7415
7477
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7416
|
-
}, renderChips()), /* @__PURE__ */
|
7478
|
+
}, renderChips()), /* @__PURE__ */ React72.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7417
7479
|
isOpen: true,
|
7418
7480
|
isDismissable: true,
|
7419
7481
|
autoFocus: true
|
@@ -7421,15 +7483,15 @@ var MultiSelectBase = (_a) => {
|
|
7421
7483
|
style,
|
7422
7484
|
onClose: closeMenu,
|
7423
7485
|
className: tw("overflow-y-auto")
|
7424
|
-
}), /* @__PURE__ */
|
7486
|
+
}), /* @__PURE__ */ React72.createElement(Select.Menu, {
|
7425
7487
|
maxHeight
|
7426
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
7488
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React72.createElement(Select.NoResults, null, noResults), isOpen && filteredOptions.map((item, index) => /* @__PURE__ */ React72.createElement(Select.Item, __spreadValues({
|
7427
7489
|
key: itemToString(item),
|
7428
7490
|
highlighted: index === highlightedIndex,
|
7429
7491
|
selected: selectedItems.includes(item)
|
7430
7492
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7431
7493
|
};
|
7432
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7494
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React72.createElement(Skeleton, {
|
7433
7495
|
height: 38
|
7434
7496
|
});
|
7435
7497
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7442,16 +7504,16 @@ var MultiSelect = (_a) => {
|
|
7442
7504
|
"noResults"
|
7443
7505
|
]);
|
7444
7506
|
var _a2;
|
7445
|
-
const id =
|
7507
|
+
const id = useRef10((_a2 = props.id) != null ? _a2 : `multiselect-${uniqueId5()}`);
|
7446
7508
|
const errorMessageId = uniqueId5();
|
7447
7509
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7448
7510
|
const labelControlProps = getLabelControlProps(props);
|
7449
7511
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7450
|
-
return /* @__PURE__ */
|
7512
|
+
return /* @__PURE__ */ React72.createElement(LabelControl, __spreadValues({
|
7451
7513
|
id: `${id.current}-label`,
|
7452
7514
|
htmlFor: `${id.current}-input`,
|
7453
7515
|
messageId: errorMessageId
|
7454
|
-
}, labelControlProps), /* @__PURE__ */
|
7516
|
+
}, labelControlProps), /* @__PURE__ */ React72.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7455
7517
|
id: id.current,
|
7456
7518
|
options,
|
7457
7519
|
noResults,
|
@@ -7459,16 +7521,16 @@ var MultiSelect = (_a) => {
|
|
7459
7521
|
valid: props.valid
|
7460
7522
|
})));
|
7461
7523
|
};
|
7462
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7524
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React72.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React72.createElement(MultiSelectBase.Skeleton, null));
|
7463
7525
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7464
7526
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7465
7527
|
|
7466
7528
|
// src/components/NativeSelect/NativeSelect.tsx
|
7467
|
-
import
|
7529
|
+
import React73, { useRef as useRef11 } from "react";
|
7468
7530
|
import omit13 from "lodash/omit";
|
7469
7531
|
import uniqueId6 from "lodash/uniqueId";
|
7470
7532
|
var import_caretDown = __toESM(require_caretDown());
|
7471
|
-
var NativeSelectBase =
|
7533
|
+
var NativeSelectBase = React73.forwardRef(
|
7472
7534
|
(_a, ref) => {
|
7473
7535
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7474
7536
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7485,16 +7547,16 @@ var NativeSelectBase = React71.forwardRef(
|
|
7485
7547
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7486
7548
|
}
|
7487
7549
|
};
|
7488
|
-
return /* @__PURE__ */
|
7550
|
+
return /* @__PURE__ */ React73.createElement("span", {
|
7489
7551
|
className: tw("relative block")
|
7490
|
-
}, !readOnly && /* @__PURE__ */
|
7552
|
+
}, !readOnly && /* @__PURE__ */ React73.createElement("span", {
|
7491
7553
|
className: tw(
|
7492
7554
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7493
7555
|
)
|
7494
|
-
}, /* @__PURE__ */
|
7556
|
+
}, /* @__PURE__ */ React73.createElement(Icon, {
|
7495
7557
|
icon: import_caretDown.default,
|
7496
7558
|
"data-testid": "icon-dropdown"
|
7497
|
-
})), /* @__PURE__ */
|
7559
|
+
})), /* @__PURE__ */ React73.createElement("select", __spreadProps(__spreadValues({
|
7498
7560
|
ref,
|
7499
7561
|
disabled: disabled || readOnly,
|
7500
7562
|
required
|
@@ -7513,29 +7575,29 @@ var NativeSelectBase = React71.forwardRef(
|
|
7513
7575
|
),
|
7514
7576
|
props.className
|
7515
7577
|
)
|
7516
|
-
}), props.placeholder && /* @__PURE__ */
|
7578
|
+
}), props.placeholder && /* @__PURE__ */ React73.createElement("option", {
|
7517
7579
|
value: placeholderValue,
|
7518
7580
|
disabled: true
|
7519
7581
|
}, props.placeholder), children));
|
7520
7582
|
}
|
7521
7583
|
);
|
7522
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7584
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React73.createElement(Skeleton, {
|
7523
7585
|
height: 38
|
7524
7586
|
});
|
7525
|
-
var NativeSelect =
|
7587
|
+
var NativeSelect = React73.forwardRef(
|
7526
7588
|
(_a, ref) => {
|
7527
7589
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7528
7590
|
var _a2;
|
7529
|
-
const id =
|
7591
|
+
const id = useRef11((_a2 = props.id) != null ? _a2 : `nativeselect-${uniqueId6()}`);
|
7530
7592
|
const errorMessageId = uniqueId6();
|
7531
7593
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7532
7594
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7533
7595
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
7534
|
-
return /* @__PURE__ */
|
7596
|
+
return /* @__PURE__ */ React73.createElement(LabelControl, __spreadValues({
|
7535
7597
|
id: `${id.current}-label`,
|
7536
7598
|
htmlFor: id.current,
|
7537
7599
|
messageId: errorMessageId
|
7538
|
-
}, labelControlProps), /* @__PURE__ */
|
7600
|
+
}, labelControlProps), /* @__PURE__ */ React73.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7539
7601
|
ref
|
7540
7602
|
}, baseProps), errorProps), {
|
7541
7603
|
id: id.current,
|
@@ -7548,20 +7610,22 @@ var NativeSelect = React71.forwardRef(
|
|
7548
7610
|
})));
|
7549
7611
|
}
|
7550
7612
|
);
|
7551
|
-
|
7613
|
+
NativeSelect.displayName = "NativeSelect";
|
7614
|
+
var Option = React73.forwardRef((_a, ref) => {
|
7552
7615
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7553
|
-
return /* @__PURE__ */
|
7616
|
+
return /* @__PURE__ */ React73.createElement("option", __spreadValues({
|
7554
7617
|
ref
|
7555
7618
|
}, props), children);
|
7556
7619
|
});
|
7557
|
-
|
7620
|
+
Option.displayName = "Option";
|
7621
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React73.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React73.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React73.createElement("div", {
|
7558
7622
|
style: { height: "1px" }
|
7559
7623
|
}));
|
7560
7624
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7561
7625
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7562
7626
|
|
7563
7627
|
// src/components/PageHeader/PageHeader.tsx
|
7564
|
-
import
|
7628
|
+
import React74 from "react";
|
7565
7629
|
import castArray3 from "lodash/castArray";
|
7566
7630
|
import omit14 from "lodash/omit";
|
7567
7631
|
var PageHeader = ({
|
@@ -7573,48 +7637,48 @@ var PageHeader = ({
|
|
7573
7637
|
chips = [],
|
7574
7638
|
breadcrumbs
|
7575
7639
|
}) => {
|
7576
|
-
return /* @__PURE__ */
|
7640
|
+
return /* @__PURE__ */ React74.createElement(Flexbox, {
|
7577
7641
|
direction: "row",
|
7578
7642
|
gap: "4",
|
7579
7643
|
paddingBottom: "6"
|
7580
|
-
}, /* @__PURE__ */
|
7644
|
+
}, /* @__PURE__ */ React74.createElement(Flexbox, {
|
7581
7645
|
className: tw("grow"),
|
7582
7646
|
direction: "column",
|
7583
7647
|
gap: "0"
|
7584
|
-
}, breadcrumbs && /* @__PURE__ */
|
7648
|
+
}, breadcrumbs && /* @__PURE__ */ React74.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React74.createElement(Flexbox, {
|
7585
7649
|
gap: "5"
|
7586
|
-
}, image && /* @__PURE__ */
|
7650
|
+
}, image && /* @__PURE__ */ React74.createElement("img", {
|
7587
7651
|
src: image,
|
7588
7652
|
alt: imageAlt,
|
7589
7653
|
className: tw("w-[56px] h-[56px]")
|
7590
|
-
}), /* @__PURE__ */
|
7654
|
+
}), /* @__PURE__ */ React74.createElement(Flexbox, {
|
7591
7655
|
direction: "column",
|
7592
7656
|
justifyContent: "center"
|
7593
|
-
}, /* @__PURE__ */
|
7657
|
+
}, /* @__PURE__ */ React74.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React74.createElement(Flexbox, {
|
7594
7658
|
gap: "3"
|
7595
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7659
|
+
}, chips.map((chip) => /* @__PURE__ */ React74.createElement(Chip2, {
|
7596
7660
|
key: chip,
|
7597
7661
|
dense: true,
|
7598
7662
|
text: chip
|
7599
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7663
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React74.createElement(Flexbox, {
|
7600
7664
|
gap: "4",
|
7601
7665
|
className: tw("self-start")
|
7602
7666
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7603
7667
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7604
|
-
return /* @__PURE__ */
|
7668
|
+
return /* @__PURE__ */ React74.createElement(SecondaryButton, __spreadValues({
|
7605
7669
|
key: text
|
7606
7670
|
}, action), text);
|
7607
|
-
}), primaryAction && /* @__PURE__ */
|
7671
|
+
}), primaryAction && /* @__PURE__ */ React74.createElement(PrimaryButton, __spreadValues({
|
7608
7672
|
key: primaryAction.text
|
7609
7673
|
}, omit14(primaryAction, "text")), primaryAction.text)));
|
7610
7674
|
};
|
7611
7675
|
|
7612
7676
|
// src/components/Pagination/Pagination.tsx
|
7613
|
-
import
|
7677
|
+
import React76 from "react";
|
7614
7678
|
import clamp from "lodash/clamp";
|
7615
7679
|
|
7616
7680
|
// src/components/Select/Select.tsx
|
7617
|
-
import
|
7681
|
+
import React75, { useRef as useRef12, useState as useState10 } from "react";
|
7618
7682
|
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7619
7683
|
import { useSelect } from "downshift";
|
7620
7684
|
import defaults from "lodash/defaults";
|
@@ -7631,10 +7695,10 @@ var hasOptionGroups = (val) => {
|
|
7631
7695
|
};
|
7632
7696
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7633
7697
|
var _a, _b;
|
7634
|
-
return /* @__PURE__ */
|
7698
|
+
return /* @__PURE__ */ React75.createElement(Select.Item, __spreadValues({
|
7635
7699
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7636
7700
|
selected: item === selectedItem
|
7637
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7701
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React75.createElement(InlineIcon, {
|
7638
7702
|
icon: item.icon
|
7639
7703
|
}), optionToString(item));
|
7640
7704
|
};
|
@@ -7706,8 +7770,8 @@ var _SelectBase = (props) => {
|
|
7706
7770
|
"labelWrapper"
|
7707
7771
|
]);
|
7708
7772
|
const [hasFocus, setFocus] = useState10(false);
|
7709
|
-
const targetRef =
|
7710
|
-
const overlayRef =
|
7773
|
+
const targetRef = useRef12(null);
|
7774
|
+
const overlayRef = useRef12(null);
|
7711
7775
|
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
7712
7776
|
const findItemByValue = (val) => {
|
7713
7777
|
if (val === null) {
|
@@ -7751,13 +7815,13 @@ var _SelectBase = (props) => {
|
|
7751
7815
|
},
|
7752
7816
|
withDefaults
|
7753
7817
|
);
|
7754
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7818
|
+
const renderGroup = (group) => /* @__PURE__ */ React75.createElement(React75.Fragment, {
|
7755
7819
|
key: group.label
|
7756
|
-
}, /* @__PURE__ */
|
7757
|
-
const input = /* @__PURE__ */
|
7820
|
+
}, /* @__PURE__ */ React75.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7821
|
+
const input = /* @__PURE__ */ React75.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7758
7822
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7759
7823
|
tabIndex: 0
|
7760
|
-
}), /* @__PURE__ */
|
7824
|
+
}), /* @__PURE__ */ React75.createElement(Select.Input, __spreadProps(__spreadValues({
|
7761
7825
|
id,
|
7762
7826
|
name
|
7763
7827
|
}, rest), {
|
@@ -7769,16 +7833,16 @@ var _SelectBase = (props) => {
|
|
7769
7833
|
tabIndex: -1,
|
7770
7834
|
onFocus: () => setFocus(true),
|
7771
7835
|
onBlur: () => setFocus(false)
|
7772
|
-
})), !readOnly && /* @__PURE__ */
|
7836
|
+
})), !readOnly && /* @__PURE__ */ React75.createElement(Select.Toggle, {
|
7773
7837
|
disabled,
|
7774
7838
|
isOpen,
|
7775
7839
|
tabIndex: -1
|
7776
7840
|
}));
|
7777
7841
|
const width = (_b = targetRef.current) == null ? void 0 : _b.offsetWidth;
|
7778
7842
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7779
|
-
return /* @__PURE__ */
|
7843
|
+
return /* @__PURE__ */ React75.createElement("div", {
|
7780
7844
|
className: tw("relative")
|
7781
|
-
}, labelWrapper ?
|
7845
|
+
}, labelWrapper ? React75.cloneElement(labelWrapper, { children: input }) : input, /* @__PURE__ */ React75.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7782
7846
|
isOpen: true,
|
7783
7847
|
isDismissable: true,
|
7784
7848
|
autoFocus: true
|
@@ -7786,11 +7850,11 @@ var _SelectBase = (props) => {
|
|
7786
7850
|
style,
|
7787
7851
|
onClose: closeMenu,
|
7788
7852
|
className: tw("overflow-y-auto")
|
7789
|
-
}), /* @__PURE__ */
|
7853
|
+
}), /* @__PURE__ */ React75.createElement(Select.Menu, {
|
7790
7854
|
maxHeight
|
7791
|
-
}, isOpen && options.length === 0 && /* @__PURE__ */
|
7855
|
+
}, isOpen && options.length === 0 && /* @__PURE__ */ React75.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__ */ React75.createElement(React75.Fragment, null, /* @__PURE__ */ React75.createElement(Select.Divider, {
|
7792
7856
|
onMouseOver: () => setHighlightedIndex(-1)
|
7793
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7857
|
+
}), actions.map((act, index) => /* @__PURE__ */ React75.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7794
7858
|
key: `${index}`
|
7795
7859
|
}, act), {
|
7796
7860
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7800,10 +7864,10 @@ var _SelectBase = (props) => {
|
|
7800
7864
|
}
|
7801
7865
|
}), act.label))))));
|
7802
7866
|
};
|
7803
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7867
|
+
var SelectBase = (props) => /* @__PURE__ */ React75.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7804
7868
|
labelWrapper: void 0
|
7805
7869
|
}));
|
7806
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7870
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React75.createElement(Skeleton, {
|
7807
7871
|
height: 38
|
7808
7872
|
});
|
7809
7873
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7814,26 +7878,26 @@ var Select2 = (_a) => {
|
|
7814
7878
|
"options"
|
7815
7879
|
]);
|
7816
7880
|
var _a2;
|
7817
|
-
const id =
|
7881
|
+
const id = useRef12((_a2 = props.id) != null ? _a2 : `select-${uniqueId7()}`);
|
7818
7882
|
const errorMessageId = uniqueId7();
|
7819
7883
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7820
7884
|
const labelProps = getLabelControlProps(props);
|
7821
7885
|
const baseProps = omit15(props, Object.keys(labelProps));
|
7822
7886
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7823
7887
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7824
|
-
const label = /* @__PURE__ */
|
7888
|
+
const label = /* @__PURE__ */ React75.createElement(Label, __spreadValues({
|
7825
7889
|
id: `${id.current}-label`,
|
7826
7890
|
htmlFor: `${id.current}-input`,
|
7827
7891
|
variant,
|
7828
7892
|
messageId: errorMessageId
|
7829
7893
|
}, labelProps));
|
7830
|
-
return /* @__PURE__ */
|
7894
|
+
return /* @__PURE__ */ React75.createElement(FormControl, null, /* @__PURE__ */ React75.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7831
7895
|
id: `${id.current}-input`,
|
7832
7896
|
options,
|
7833
7897
|
disabled: props.disabled,
|
7834
7898
|
valid: props.valid,
|
7835
7899
|
labelWrapper: label
|
7836
|
-
})), /* @__PURE__ */
|
7900
|
+
})), /* @__PURE__ */ React75.createElement(HelperText, {
|
7837
7901
|
messageId: errorMessageId,
|
7838
7902
|
error: !labelProps.valid,
|
7839
7903
|
helperText: labelProps.helperText,
|
@@ -7842,8 +7906,9 @@ var Select2 = (_a) => {
|
|
7842
7906
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7843
7907
|
}));
|
7844
7908
|
};
|
7845
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7909
|
+
var SelectSkeleton = () => /* @__PURE__ */ React75.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React75.createElement(SelectBase.Skeleton, null));
|
7846
7910
|
Select2.Skeleton = SelectSkeleton;
|
7911
|
+
Select2.Skeleton.displayName = "Select.Skeleton";
|
7847
7912
|
|
7848
7913
|
// src/components/Pagination/Pagination.tsx
|
7849
7914
|
var import_chevronBackward = __toESM(require_chevronBackward());
|
@@ -7860,25 +7925,25 @@ var Pagination = ({
|
|
7860
7925
|
pageSizes,
|
7861
7926
|
onPageSizeChange
|
7862
7927
|
}) => {
|
7863
|
-
const [value, setValue] =
|
7864
|
-
|
7928
|
+
const [value, setValue] = React76.useState(currentPage);
|
7929
|
+
React76.useEffect(() => {
|
7865
7930
|
setValue(currentPage);
|
7866
7931
|
}, [currentPage]);
|
7867
|
-
|
7932
|
+
React76.useEffect(() => {
|
7868
7933
|
onPageChange(1);
|
7869
7934
|
setValue(1);
|
7870
7935
|
}, [pageSize]);
|
7871
|
-
return /* @__PURE__ */
|
7936
|
+
return /* @__PURE__ */ React76.createElement(Box, {
|
7872
7937
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7873
7938
|
backgroundColor: "grey-0",
|
7874
7939
|
padding: "4"
|
7875
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
7940
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React76.createElement(Box, {
|
7876
7941
|
display: "flex",
|
7877
7942
|
alignItems: "center",
|
7878
7943
|
gap: "4"
|
7879
|
-
}, /* @__PURE__ */
|
7944
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.SmallText, null, "Items per page "), /* @__PURE__ */ React76.createElement("div", {
|
7880
7945
|
className: tw("max-w-[70px]")
|
7881
|
-
}, /* @__PURE__ */
|
7946
|
+
}, /* @__PURE__ */ React76.createElement(SelectBase, {
|
7882
7947
|
options: pageSizes.map((size) => size.toString()),
|
7883
7948
|
value: pageSize.toString(),
|
7884
7949
|
onChange: (size) => {
|
@@ -7889,24 +7954,24 @@ var Pagination = ({
|
|
7889
7954
|
}
|
7890
7955
|
}
|
7891
7956
|
}
|
7892
|
-
}))) : /* @__PURE__ */
|
7957
|
+
}))) : /* @__PURE__ */ React76.createElement("div", null), /* @__PURE__ */ React76.createElement(Box, {
|
7893
7958
|
display: "flex",
|
7894
7959
|
justifyContent: "center",
|
7895
7960
|
alignItems: "center",
|
7896
7961
|
className: tw("grow")
|
7897
|
-
}, /* @__PURE__ */
|
7962
|
+
}, /* @__PURE__ */ React76.createElement(IconButton, {
|
7898
7963
|
"aria-label": "First",
|
7899
7964
|
onClick: () => onPageChange(1),
|
7900
7965
|
icon: import_chevronBackward.default,
|
7901
7966
|
disabled: !hasPreviousPage
|
7902
|
-
}), /* @__PURE__ */
|
7967
|
+
}), /* @__PURE__ */ React76.createElement(IconButton, {
|
7903
7968
|
"aria-label": "Previous",
|
7904
7969
|
onClick: () => onPageChange(currentPage - 1),
|
7905
7970
|
icon: import_chevronLeft3.default,
|
7906
7971
|
disabled: !hasPreviousPage
|
7907
|
-
}), /* @__PURE__ */
|
7972
|
+
}), /* @__PURE__ */ React76.createElement(Box, {
|
7908
7973
|
paddingX: "4"
|
7909
|
-
}, /* @__PURE__ */
|
7974
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.SmallText, null, "Page")), /* @__PURE__ */ React76.createElement(InputBase, {
|
7910
7975
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
7911
7976
|
type: "number",
|
7912
7977
|
min: 1,
|
@@ -7929,43 +7994,43 @@ var Pagination = ({
|
|
7929
7994
|
setValue(1);
|
7930
7995
|
}
|
7931
7996
|
}
|
7932
|
-
}), /* @__PURE__ */
|
7997
|
+
}), /* @__PURE__ */ React76.createElement(Box, {
|
7933
7998
|
paddingX: "4"
|
7934
|
-
}, /* @__PURE__ */
|
7999
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.SmallText, null, "of ", totalPages)), /* @__PURE__ */ React76.createElement(IconButton, {
|
7935
8000
|
"aria-label": "Next",
|
7936
8001
|
onClick: () => onPageChange(currentPage + 1),
|
7937
8002
|
icon: import_chevronRight3.default,
|
7938
8003
|
disabled: !hasNextPage
|
7939
|
-
}), /* @__PURE__ */
|
8004
|
+
}), /* @__PURE__ */ React76.createElement(IconButton, {
|
7940
8005
|
"aria-label": "Last",
|
7941
8006
|
onClick: () => onPageChange(totalPages),
|
7942
8007
|
icon: import_chevronForward.default,
|
7943
8008
|
disabled: !hasNextPage
|
7944
|
-
})), /* @__PURE__ */
|
8009
|
+
})), /* @__PURE__ */ React76.createElement("div", null));
|
7945
8010
|
};
|
7946
8011
|
|
7947
8012
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
7948
|
-
import
|
8013
|
+
import React78 from "react";
|
7949
8014
|
import omit16 from "lodash/omit";
|
7950
8015
|
|
7951
8016
|
// src/common/PopoverDialog/PopoverDialog.tsx
|
7952
|
-
import
|
8017
|
+
import React77 from "react";
|
7953
8018
|
var Header = (_a) => {
|
7954
8019
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7955
|
-
return /* @__PURE__ */
|
8020
|
+
return /* @__PURE__ */ React77.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7956
8021
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
7957
8022
|
}), children);
|
7958
8023
|
};
|
7959
8024
|
var Title = (_a) => {
|
7960
8025
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7961
|
-
return /* @__PURE__ */
|
8026
|
+
return /* @__PURE__ */ React77.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7962
8027
|
htmlTag: "h1",
|
7963
8028
|
variant: "small-strong"
|
7964
8029
|
}), children);
|
7965
8030
|
};
|
7966
8031
|
var Body = (_a) => {
|
7967
8032
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7968
|
-
return /* @__PURE__ */
|
8033
|
+
return /* @__PURE__ */ React77.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7969
8034
|
htmlTag: "div",
|
7970
8035
|
variant: "caption",
|
7971
8036
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -7973,13 +8038,13 @@ var Body = (_a) => {
|
|
7973
8038
|
};
|
7974
8039
|
var Footer = (_a) => {
|
7975
8040
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7976
|
-
return /* @__PURE__ */
|
8041
|
+
return /* @__PURE__ */ React77.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7977
8042
|
className: classNames(tw("p-5"), className)
|
7978
8043
|
}), children);
|
7979
8044
|
};
|
7980
8045
|
var Actions2 = (_a) => {
|
7981
8046
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7982
|
-
return /* @__PURE__ */
|
8047
|
+
return /* @__PURE__ */ React77.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7983
8048
|
className: classNames(tw("flex gap-4"), className)
|
7984
8049
|
}), children);
|
7985
8050
|
};
|
@@ -7995,13 +8060,13 @@ var PopoverDialog = {
|
|
7995
8060
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
7996
8061
|
const wrapPromptWithBody = (child) => {
|
7997
8062
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
7998
|
-
return /* @__PURE__ */
|
8063
|
+
return /* @__PURE__ */ React78.createElement(Popover2.Panel, {
|
7999
8064
|
className: tw("max-w-[300px]")
|
8000
|
-
}, /* @__PURE__ */
|
8065
|
+
}, /* @__PURE__ */ React78.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React78.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React78.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React78.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React78.createElement(Popover2.Button, __spreadValues({
|
8001
8066
|
kind: "secondary-ghost",
|
8002
8067
|
key: secondaryAction.text,
|
8003
8068
|
dense: true
|
8004
|
-
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
8069
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React78.createElement(Popover2.Button, __spreadValues({
|
8005
8070
|
kind: "ghost",
|
8006
8071
|
key: primaryAction.text,
|
8007
8072
|
dense: true
|
@@ -8009,7 +8074,7 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8009
8074
|
}
|
8010
8075
|
return child;
|
8011
8076
|
};
|
8012
|
-
return /* @__PURE__ */
|
8077
|
+
return /* @__PURE__ */ React78.createElement(Popover2, {
|
8013
8078
|
type: "dialog",
|
8014
8079
|
isOpen: open,
|
8015
8080
|
placement,
|
@@ -8017,10 +8082,10 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8017
8082
|
isKeyboardDismissDisabled: false,
|
8018
8083
|
autoFocus: true,
|
8019
8084
|
containFocus: true
|
8020
|
-
},
|
8085
|
+
}, React78.Children.map(children, wrapPromptWithBody));
|
8021
8086
|
};
|
8022
8087
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
8023
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
8088
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React78.createElement(PopoverDialog.Body, null, children);
|
8024
8089
|
Prompt.displayName = "PopoverDialog.Prompt";
|
8025
8090
|
PopoverDialog2.Prompt = Prompt;
|
8026
8091
|
|
@@ -8029,14 +8094,14 @@ import { createPortal } from "react-dom";
|
|
8029
8094
|
var Portal = ({ children, to }) => createPortal(children, to);
|
8030
8095
|
|
8031
8096
|
// src/components/ProgressBar/ProgressBar.tsx
|
8032
|
-
import
|
8097
|
+
import React80 from "react";
|
8033
8098
|
|
8034
8099
|
// src/common/ProgressBar/ProgressBar.tsx
|
8035
|
-
import
|
8100
|
+
import React79 from "react";
|
8036
8101
|
import clamp2 from "lodash/clamp";
|
8037
8102
|
var ProgressBar = (_a) => {
|
8038
8103
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8039
|
-
return /* @__PURE__ */
|
8104
|
+
return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8040
8105
|
className: classNames(
|
8041
8106
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
8042
8107
|
className
|
@@ -8052,7 +8117,7 @@ var STATUS_COLORS = {
|
|
8052
8117
|
ProgressBar.Indicator = (_a) => {
|
8053
8118
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
8054
8119
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
8055
|
-
return /* @__PURE__ */
|
8120
|
+
return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8056
8121
|
className: classNames(
|
8057
8122
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
8058
8123
|
STATUS_COLORS[status],
|
@@ -8068,11 +8133,11 @@ ProgressBar.Indicator = (_a) => {
|
|
8068
8133
|
};
|
8069
8134
|
ProgressBar.Labels = (_a) => {
|
8070
8135
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
8071
|
-
return /* @__PURE__ */
|
8136
|
+
return /* @__PURE__ */ React79.createElement("div", {
|
8072
8137
|
className: classNames(tw("flex flex-row"), className)
|
8073
|
-
}, /* @__PURE__ */
|
8138
|
+
}, /* @__PURE__ */ React79.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8074
8139
|
className: tw("grow text-grey-70 typography-caption")
|
8075
|
-
}), startLabel), /* @__PURE__ */
|
8140
|
+
}), startLabel), /* @__PURE__ */ React79.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8076
8141
|
className: tw("grow text-grey-70 typography-caption text-right")
|
8077
8142
|
}), endLabel));
|
8078
8143
|
};
|
@@ -8090,7 +8155,7 @@ var ProgressBar2 = (props) => {
|
|
8090
8155
|
if (min > max) {
|
8091
8156
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
8092
8157
|
}
|
8093
|
-
const progress = /* @__PURE__ */
|
8158
|
+
const progress = /* @__PURE__ */ React80.createElement(ProgressBar, null, /* @__PURE__ */ React80.createElement(ProgressBar.Indicator, {
|
8094
8159
|
status: value === max ? completedStatus : progresStatus,
|
8095
8160
|
min,
|
8096
8161
|
max,
|
@@ -8100,25 +8165,27 @@ var ProgressBar2 = (props) => {
|
|
8100
8165
|
if (props.dense) {
|
8101
8166
|
return progress;
|
8102
8167
|
}
|
8103
|
-
return /* @__PURE__ */
|
8168
|
+
return /* @__PURE__ */ React80.createElement("div", null, progress, /* @__PURE__ */ React80.createElement(ProgressBar.Labels, {
|
8104
8169
|
className: tw("py-2"),
|
8105
8170
|
startLabel: props.startLabel,
|
8106
8171
|
endLabel: props.endLabel
|
8107
8172
|
}));
|
8108
8173
|
};
|
8109
|
-
|
8174
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React80.createElement(Skeleton, {
|
8110
8175
|
height: 4,
|
8111
8176
|
display: "block"
|
8112
8177
|
});
|
8178
|
+
ProgressBar2.Skeleton = ProgressBarSkeleton;
|
8179
|
+
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
8113
8180
|
|
8114
8181
|
// src/components/RadioButton/RadioButton.tsx
|
8115
|
-
import
|
8116
|
-
var RadioButton2 =
|
8182
|
+
import React81 from "react";
|
8183
|
+
var RadioButton2 = React81.forwardRef(
|
8117
8184
|
(_a, ref) => {
|
8118
8185
|
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"]);
|
8119
8186
|
var _a2;
|
8120
8187
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8121
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8188
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React81.createElement(ControlLabel, {
|
8122
8189
|
htmlFor: id,
|
8123
8190
|
label: children,
|
8124
8191
|
"aria-label": ariaLabel,
|
@@ -8126,7 +8193,7 @@ var RadioButton2 = React79.forwardRef(
|
|
8126
8193
|
readOnly,
|
8127
8194
|
disabled,
|
8128
8195
|
style: { gap: "0 8px" }
|
8129
|
-
}, !readOnly && /* @__PURE__ */
|
8196
|
+
}, !readOnly && /* @__PURE__ */ React81.createElement(RadioButton, __spreadProps(__spreadValues({
|
8130
8197
|
id,
|
8131
8198
|
ref,
|
8132
8199
|
name
|
@@ -8136,22 +8203,24 @@ var RadioButton2 = React79.forwardRef(
|
|
8136
8203
|
}))) : null;
|
8137
8204
|
}
|
8138
8205
|
);
|
8139
|
-
|
8206
|
+
RadioButton2.displayName = "RadioButton";
|
8207
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React81.createElement("div", {
|
8140
8208
|
className: tw("flex gap-3")
|
8141
|
-
}, /* @__PURE__ */
|
8209
|
+
}, /* @__PURE__ */ React81.createElement(Skeleton, {
|
8142
8210
|
height: 20,
|
8143
8211
|
width: 20
|
8144
|
-
}), /* @__PURE__ */
|
8212
|
+
}), /* @__PURE__ */ React81.createElement(Skeleton, {
|
8145
8213
|
height: 20,
|
8146
8214
|
width: 150
|
8147
8215
|
}));
|
8148
8216
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
8217
|
+
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
8149
8218
|
|
8150
8219
|
// src/components/RadioButtonGroup/RadioButtonGroup.tsx
|
8151
|
-
import
|
8220
|
+
import React82 from "react";
|
8152
8221
|
import uniqueId8 from "lodash/uniqueId";
|
8153
8222
|
var isRadioButton = (c) => {
|
8154
|
-
return
|
8223
|
+
return React82.isValidElement(c) && c.type === RadioButton2;
|
8155
8224
|
};
|
8156
8225
|
var RadioButtonGroup = (_a) => {
|
8157
8226
|
var _b = _a, {
|
@@ -8174,7 +8243,7 @@ var RadioButtonGroup = (_a) => {
|
|
8174
8243
|
"children"
|
8175
8244
|
]);
|
8176
8245
|
var _a2;
|
8177
|
-
const [value, setValue] =
|
8246
|
+
const [value, setValue] = React82.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
8178
8247
|
const errorMessageId = uniqueId8();
|
8179
8248
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8180
8249
|
const labelControlProps = getLabelControlProps(props);
|
@@ -8185,14 +8254,14 @@ var RadioButtonGroup = (_a) => {
|
|
8185
8254
|
setValue(e.target.value);
|
8186
8255
|
onChange == null ? void 0 : onChange(e.target.value);
|
8187
8256
|
};
|
8188
|
-
const content =
|
8257
|
+
const content = React82.Children.map(children, (c) => {
|
8189
8258
|
var _a3, _b2, _c;
|
8190
8259
|
if (!isRadioButton(c)) {
|
8191
8260
|
return null;
|
8192
8261
|
}
|
8193
8262
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
8194
8263
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
8195
|
-
return
|
8264
|
+
return React82.cloneElement(c, {
|
8196
8265
|
name,
|
8197
8266
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
8198
8267
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -8201,11 +8270,11 @@ var RadioButtonGroup = (_a) => {
|
|
8201
8270
|
readOnly
|
8202
8271
|
});
|
8203
8272
|
});
|
8204
|
-
return /* @__PURE__ */
|
8273
|
+
return /* @__PURE__ */ React82.createElement(LabelControl, __spreadValues(__spreadValues({
|
8205
8274
|
fieldset: true
|
8206
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
8275
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React82.createElement(InputGroup, {
|
8207
8276
|
cols
|
8208
|
-
}, content), !cols && /* @__PURE__ */
|
8277
|
+
}, content), !cols && /* @__PURE__ */ React82.createElement(Flexbox, {
|
8209
8278
|
direction,
|
8210
8279
|
alignItems: "flex-start",
|
8211
8280
|
colGap: "8",
|
@@ -8214,80 +8283,81 @@ var RadioButtonGroup = (_a) => {
|
|
8214
8283
|
}, content));
|
8215
8284
|
};
|
8216
8285
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
8217
|
-
return /* @__PURE__ */
|
8286
|
+
return /* @__PURE__ */ React82.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React82.createElement("div", {
|
8218
8287
|
className: tw("flex flex-wrap", {
|
8219
8288
|
"flex-row gap-8": direction === "row",
|
8220
8289
|
"flex-col gap-2": direction === "column"
|
8221
8290
|
})
|
8222
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8291
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React82.createElement(RadioButton2.Skeleton, {
|
8223
8292
|
key
|
8224
8293
|
}))));
|
8225
8294
|
};
|
8226
8295
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
8296
|
+
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
8227
8297
|
|
8228
8298
|
// src/components/Section/Section.tsx
|
8229
|
-
import
|
8299
|
+
import React84 from "react";
|
8230
8300
|
import castArray4 from "lodash/castArray";
|
8231
8301
|
|
8232
8302
|
// src/common/Section/Section.tsx
|
8233
|
-
import
|
8303
|
+
import React83 from "react";
|
8234
8304
|
var Section2 = (_a) => {
|
8235
8305
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8236
|
-
return /* @__PURE__ */
|
8306
|
+
return /* @__PURE__ */ React83.createElement(Box, __spreadValues({
|
8237
8307
|
borderColor: "grey-5",
|
8238
8308
|
borderWidth: "1px"
|
8239
8309
|
}, rest), children);
|
8240
8310
|
};
|
8241
8311
|
Section2.Header = (_a) => {
|
8242
8312
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8243
|
-
return /* @__PURE__ */
|
8313
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8244
8314
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8245
8315
|
}), children);
|
8246
8316
|
};
|
8247
8317
|
Section2.TitleContainer = (_a) => {
|
8248
8318
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8249
|
-
return /* @__PURE__ */
|
8319
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8250
8320
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8251
8321
|
}), children);
|
8252
8322
|
};
|
8253
8323
|
Section2.Title = (_a) => {
|
8254
8324
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8255
|
-
return /* @__PURE__ */
|
8325
|
+
return /* @__PURE__ */ React83.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8256
8326
|
color: "black"
|
8257
8327
|
}), children);
|
8258
8328
|
};
|
8259
8329
|
Section2.Subtitle = (_a) => {
|
8260
8330
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8261
|
-
return /* @__PURE__ */
|
8331
|
+
return /* @__PURE__ */ React83.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8262
8332
|
color: "grey-70"
|
8263
8333
|
}), children);
|
8264
8334
|
};
|
8265
8335
|
Section2.Actions = (_a) => {
|
8266
8336
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8267
|
-
return /* @__PURE__ */
|
8337
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8268
8338
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8269
8339
|
}), children);
|
8270
8340
|
};
|
8271
8341
|
Section2.Body = (_a) => {
|
8272
8342
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8273
|
-
return /* @__PURE__ */
|
8343
|
+
return /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8274
8344
|
className: classNames(tw("p-6"), className)
|
8275
|
-
}), /* @__PURE__ */
|
8345
|
+
}), /* @__PURE__ */ React83.createElement(Typography, {
|
8276
8346
|
htmlTag: "div",
|
8277
8347
|
color: "grey-70"
|
8278
8348
|
}, children));
|
8279
8349
|
};
|
8280
8350
|
|
8281
8351
|
// src/components/Section/Section.tsx
|
8282
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8352
|
+
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React84.createElement(Section2, null, title && /* @__PURE__ */ React84.createElement(React84.Fragment, null, /* @__PURE__ */ React84.createElement(Section2.Header, null, /* @__PURE__ */ React84.createElement(Section2.TitleContainer, null, /* @__PURE__ */ React84.createElement(Section2.Title, null, title), subtitle && /* @__PURE__ */ React84.createElement(Section2.Subtitle, null, subtitle)), /* @__PURE__ */ React84.createElement(Section2.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
|
8283
8353
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8284
|
-
return /* @__PURE__ */
|
8354
|
+
return /* @__PURE__ */ React84.createElement(SecondaryButton, __spreadValues({
|
8285
8355
|
key: text
|
8286
8356
|
}, action), text);
|
8287
|
-
}))), /* @__PURE__ */
|
8357
|
+
}))), /* @__PURE__ */ React84.createElement(Divider2, null)), /* @__PURE__ */ React84.createElement(Section2.Body, null, children));
|
8288
8358
|
|
8289
8359
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
8290
|
-
import
|
8360
|
+
import React85 from "react";
|
8291
8361
|
var SegmentedControl = (_a) => {
|
8292
8362
|
var _b = _a, {
|
8293
8363
|
children,
|
@@ -8304,7 +8374,7 @@ var SegmentedControl = (_a) => {
|
|
8304
8374
|
"selected",
|
8305
8375
|
"className"
|
8306
8376
|
]);
|
8307
|
-
return /* @__PURE__ */
|
8377
|
+
return /* @__PURE__ */ React85.createElement("button", __spreadProps(__spreadValues({
|
8308
8378
|
type: "button"
|
8309
8379
|
}, rest), {
|
8310
8380
|
className: classNames(
|
@@ -8331,15 +8401,15 @@ var SegmentedControlGroup = (_a) => {
|
|
8331
8401
|
"children",
|
8332
8402
|
"className"
|
8333
8403
|
]);
|
8334
|
-
const
|
8404
|
+
const classes2 = tw("rounded flex", {
|
8335
8405
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8336
8406
|
"bg-grey-0": variant === "raised"
|
8337
8407
|
});
|
8338
|
-
return /* @__PURE__ */
|
8339
|
-
className: classNames(
|
8340
|
-
}),
|
8408
|
+
return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8409
|
+
className: classNames(classes2, className)
|
8410
|
+
}), React85.Children.map(
|
8341
8411
|
children,
|
8342
|
-
(child) =>
|
8412
|
+
(child) => React85.cloneElement(child, {
|
8343
8413
|
dense,
|
8344
8414
|
variant,
|
8345
8415
|
onClick: () => onChange(child.props.value),
|
@@ -8377,14 +8447,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8377
8447
|
);
|
8378
8448
|
|
8379
8449
|
// src/components/Stepper/Stepper.tsx
|
8380
|
-
import
|
8450
|
+
import React87 from "react";
|
8381
8451
|
|
8382
8452
|
// src/common/Stepper/Stepper.tsx
|
8383
|
-
import
|
8453
|
+
import React86 from "react";
|
8384
8454
|
var import_tick5 = __toESM(require_tick());
|
8385
8455
|
var Stepper = (_a) => {
|
8386
8456
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8387
|
-
return /* @__PURE__ */
|
8457
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8388
8458
|
className: classNames(className)
|
8389
8459
|
}));
|
8390
8460
|
};
|
@@ -8398,7 +8468,7 @@ var ConnectorContainer = (_a) => {
|
|
8398
8468
|
"completed",
|
8399
8469
|
"dense"
|
8400
8470
|
]);
|
8401
|
-
return /* @__PURE__ */
|
8471
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8402
8472
|
className: classNames(
|
8403
8473
|
tw("absolute w-full -left-1/2", {
|
8404
8474
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -8410,7 +8480,7 @@ var ConnectorContainer = (_a) => {
|
|
8410
8480
|
};
|
8411
8481
|
var Connector = (_a) => {
|
8412
8482
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8413
|
-
return /* @__PURE__ */
|
8483
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8414
8484
|
className: classNames(
|
8415
8485
|
tw("w-full", {
|
8416
8486
|
"bg-grey-20": !completed,
|
@@ -8424,7 +8494,7 @@ var Connector = (_a) => {
|
|
8424
8494
|
};
|
8425
8495
|
var Step = (_a) => {
|
8426
8496
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8427
|
-
return /* @__PURE__ */
|
8497
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8428
8498
|
className: classNames(
|
8429
8499
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8430
8500
|
"text-grey-20": state === "inactive"
|
@@ -8445,13 +8515,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
8445
8515
|
});
|
8446
8516
|
var Indicator = (_a) => {
|
8447
8517
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8448
|
-
return /* @__PURE__ */
|
8518
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8449
8519
|
className: classNames(
|
8450
8520
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8451
8521
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
8452
8522
|
className
|
8453
8523
|
)
|
8454
|
-
}), state === "completed" ? /* @__PURE__ */
|
8524
|
+
}), state === "completed" ? /* @__PURE__ */ React86.createElement(InlineIcon, {
|
8455
8525
|
icon: import_tick5.default
|
8456
8526
|
}) : dense ? null : children);
|
8457
8527
|
};
|
@@ -8462,25 +8532,25 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
8462
8532
|
|
8463
8533
|
// src/components/Stepper/Stepper.tsx
|
8464
8534
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8465
|
-
const steps =
|
8466
|
-
return /* @__PURE__ */
|
8535
|
+
const steps = React87.Children.count(children);
|
8536
|
+
return /* @__PURE__ */ React87.createElement(Stepper, {
|
8467
8537
|
role: "list"
|
8468
|
-
}, /* @__PURE__ */
|
8538
|
+
}, /* @__PURE__ */ React87.createElement(Template, {
|
8469
8539
|
columns: steps
|
8470
|
-
},
|
8540
|
+
}, React87.Children.map(children, (child, index) => {
|
8471
8541
|
if (!isComponentType(child, Step2)) {
|
8472
8542
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8473
8543
|
} else {
|
8474
8544
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8475
|
-
return /* @__PURE__ */
|
8545
|
+
return /* @__PURE__ */ React87.createElement(Stepper.Step, {
|
8476
8546
|
state,
|
8477
8547
|
"aria-current": state === "active" ? "step" : false,
|
8478
8548
|
role: "listitem"
|
8479
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
8549
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React87.createElement(Stepper.ConnectorContainer, {
|
8480
8550
|
dense
|
8481
|
-
}, /* @__PURE__ */
|
8551
|
+
}, /* @__PURE__ */ React87.createElement(Stepper.ConnectorContainer.Connector, {
|
8482
8552
|
completed: state === "completed" || state === "active"
|
8483
|
-
})), /* @__PURE__ */
|
8553
|
+
})), /* @__PURE__ */ React87.createElement(Stepper.Step.Indicator, {
|
8484
8554
|
state,
|
8485
8555
|
dense
|
8486
8556
|
}, index + 1), child.props.children);
|
@@ -8488,19 +8558,20 @@ var Stepper2 = ({ children, activeIndex, dense }) => {
|
|
8488
8558
|
})));
|
8489
8559
|
};
|
8490
8560
|
var Step2 = () => null;
|
8561
|
+
Step2.displayName = "Stepper.Step";
|
8491
8562
|
Stepper2.Step = Step2;
|
8492
8563
|
|
8493
8564
|
// src/components/Switch/Switch.tsx
|
8494
|
-
import
|
8565
|
+
import React89 from "react";
|
8495
8566
|
|
8496
8567
|
// src/common/Switch/Switch.tsx
|
8497
|
-
import
|
8498
|
-
var Switch =
|
8568
|
+
import React88 from "react";
|
8569
|
+
var Switch = React88.forwardRef(
|
8499
8570
|
(_a, ref) => {
|
8500
8571
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8501
|
-
return /* @__PURE__ */
|
8572
|
+
return /* @__PURE__ */ React88.createElement("span", {
|
8502
8573
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8503
|
-
}, /* @__PURE__ */
|
8574
|
+
}, /* @__PURE__ */ React88.createElement("input", __spreadProps(__spreadValues({
|
8504
8575
|
id,
|
8505
8576
|
ref,
|
8506
8577
|
type: "checkbox",
|
@@ -8519,7 +8590,7 @@ var Switch = React86.forwardRef(
|
|
8519
8590
|
),
|
8520
8591
|
readOnly,
|
8521
8592
|
disabled
|
8522
|
-
})), /* @__PURE__ */
|
8593
|
+
})), /* @__PURE__ */ React88.createElement("span", {
|
8523
8594
|
className: tw(
|
8524
8595
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8525
8596
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8532,12 +8603,12 @@ var Switch = React86.forwardRef(
|
|
8532
8603
|
);
|
8533
8604
|
|
8534
8605
|
// src/components/Switch/Switch.tsx
|
8535
|
-
var Switch2 =
|
8606
|
+
var Switch2 = React89.forwardRef(
|
8536
8607
|
(_a, ref) => {
|
8537
8608
|
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"]);
|
8538
8609
|
var _a2;
|
8539
8610
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8540
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8611
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React89.createElement(ControlLabel, {
|
8541
8612
|
htmlFor: id,
|
8542
8613
|
label: children,
|
8543
8614
|
"aria-label": ariaLabel,
|
@@ -8545,7 +8616,7 @@ var Switch2 = React87.forwardRef(
|
|
8545
8616
|
readOnly,
|
8546
8617
|
disabled,
|
8547
8618
|
style: { gap: "0 8px" }
|
8548
|
-
}, !readOnly && /* @__PURE__ */
|
8619
|
+
}, !readOnly && /* @__PURE__ */ React89.createElement(Switch, __spreadProps(__spreadValues({
|
8549
8620
|
id,
|
8550
8621
|
ref,
|
8551
8622
|
name
|
@@ -8555,19 +8626,21 @@ var Switch2 = React87.forwardRef(
|
|
8555
8626
|
}))) : null;
|
8556
8627
|
}
|
8557
8628
|
);
|
8558
|
-
|
8629
|
+
Switch2.displayName = "Switch";
|
8630
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React89.createElement("div", {
|
8559
8631
|
className: tw("flex gap-3")
|
8560
|
-
}, /* @__PURE__ */
|
8632
|
+
}, /* @__PURE__ */ React89.createElement(Skeleton, {
|
8561
8633
|
height: 20,
|
8562
8634
|
width: 35
|
8563
|
-
}), /* @__PURE__ */
|
8635
|
+
}), /* @__PURE__ */ React89.createElement(Skeleton, {
|
8564
8636
|
height: 20,
|
8565
8637
|
width: 150
|
8566
8638
|
}));
|
8567
8639
|
Switch2.Skeleton = SwitchSkeleton;
|
8640
|
+
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
8568
8641
|
|
8569
8642
|
// src/components/SwitchGroup/SwitchGroup.tsx
|
8570
|
-
import
|
8643
|
+
import React90, { useState as useState11 } from "react";
|
8571
8644
|
import uniqueId9 from "lodash/uniqueId";
|
8572
8645
|
var SwitchGroup = (_a) => {
|
8573
8646
|
var _b = _a, {
|
@@ -8599,11 +8672,11 @@ var SwitchGroup = (_a) => {
|
|
8599
8672
|
setSelectedItems(updated);
|
8600
8673
|
onChange == null ? void 0 : onChange(updated);
|
8601
8674
|
};
|
8602
|
-
return /* @__PURE__ */
|
8675
|
+
return /* @__PURE__ */ React90.createElement(LabelControl, __spreadValues(__spreadValues({
|
8603
8676
|
fieldset: true
|
8604
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8677
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React90.createElement(InputGroup, {
|
8605
8678
|
cols
|
8606
|
-
},
|
8679
|
+
}, React90.Children.map(children, (c) => {
|
8607
8680
|
var _a3, _b2, _c, _d;
|
8608
8681
|
if (!isComponentType(c, Switch2)) {
|
8609
8682
|
return null;
|
@@ -8611,7 +8684,7 @@ var SwitchGroup = (_a) => {
|
|
8611
8684
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8612
8685
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8613
8686
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8614
|
-
return
|
8687
|
+
return React90.cloneElement(c, {
|
8615
8688
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8616
8689
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8617
8690
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8621,19 +8694,20 @@ var SwitchGroup = (_a) => {
|
|
8621
8694
|
})));
|
8622
8695
|
};
|
8623
8696
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8624
|
-
return /* @__PURE__ */
|
8697
|
+
return /* @__PURE__ */ React90.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React90.createElement("div", {
|
8625
8698
|
className: tw("flex flex-wrap flex-col gap-2")
|
8626
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8699
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React90.createElement(Switch2.Skeleton, {
|
8627
8700
|
key
|
8628
8701
|
}))));
|
8629
8702
|
};
|
8630
8703
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
8704
|
+
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
8631
8705
|
|
8632
8706
|
// src/components/TagLabel/TagLabel.tsx
|
8633
|
-
import
|
8707
|
+
import React91 from "react";
|
8634
8708
|
var TagLabel = (_a) => {
|
8635
8709
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8636
|
-
return /* @__PURE__ */
|
8710
|
+
return /* @__PURE__ */ React91.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8637
8711
|
className: tw("rounded-full text-white bg-primary-70", {
|
8638
8712
|
"py-2 px-4 typography-caption": !dense,
|
8639
8713
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8642,14 +8716,14 @@ var TagLabel = (_a) => {
|
|
8642
8716
|
};
|
8643
8717
|
|
8644
8718
|
// src/components/Textarea/Textarea.tsx
|
8645
|
-
import
|
8719
|
+
import React92, { useRef as useRef13, useState as useState12 } from "react";
|
8646
8720
|
import omit17 from "lodash/omit";
|
8647
8721
|
import toString2 from "lodash/toString";
|
8648
8722
|
import uniqueId10 from "lodash/uniqueId";
|
8649
|
-
var TextareaBase =
|
8723
|
+
var TextareaBase = React92.forwardRef(
|
8650
8724
|
(_a, ref) => {
|
8651
8725
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8652
|
-
return /* @__PURE__ */
|
8726
|
+
return /* @__PURE__ */ React92.createElement("textarea", __spreadProps(__spreadValues({
|
8653
8727
|
ref
|
8654
8728
|
}, props), {
|
8655
8729
|
readOnly,
|
@@ -8657,23 +8731,23 @@ var TextareaBase = React90.forwardRef(
|
|
8657
8731
|
}));
|
8658
8732
|
}
|
8659
8733
|
);
|
8660
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8734
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React92.createElement(Skeleton, {
|
8661
8735
|
height: 58
|
8662
8736
|
});
|
8663
|
-
var Textarea =
|
8737
|
+
var Textarea = React92.forwardRef((props, ref) => {
|
8664
8738
|
var _a, _b, _c;
|
8665
8739
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8666
|
-
const id =
|
8740
|
+
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
8667
8741
|
const errorMessageId = uniqueId10();
|
8668
8742
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8669
8743
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8670
8744
|
const baseProps = omit17(props, Object.keys(labelControlProps));
|
8671
|
-
return /* @__PURE__ */
|
8745
|
+
return /* @__PURE__ */ React92.createElement(LabelControl, __spreadValues({
|
8672
8746
|
id: `${id.current}-label`,
|
8673
8747
|
htmlFor: id.current,
|
8674
8748
|
messageId: errorMessageId,
|
8675
8749
|
length: value !== void 0 ? toString2(value).length : void 0
|
8676
|
-
}, labelControlProps), /* @__PURE__ */
|
8750
|
+
}, labelControlProps), /* @__PURE__ */ React92.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8677
8751
|
ref
|
8678
8752
|
}, baseProps), errorProps), {
|
8679
8753
|
id: id.current,
|
@@ -8689,47 +8763,49 @@ var Textarea = React90.forwardRef((props, ref) => {
|
|
8689
8763
|
valid: props.valid
|
8690
8764
|
})));
|
8691
8765
|
});
|
8692
|
-
|
8766
|
+
Textarea.displayName = "Textarea";
|
8767
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React92.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React92.createElement(TextareaBase.Skeleton, null));
|
8693
8768
|
Textarea.Skeleton = TextAreaSkeleton;
|
8769
|
+
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
8694
8770
|
|
8695
8771
|
// src/components/Timeline/Timeline.tsx
|
8696
|
-
import
|
8772
|
+
import React94 from "react";
|
8697
8773
|
|
8698
8774
|
// src/common/Timeline/Timeline.tsx
|
8699
|
-
import
|
8775
|
+
import React93 from "react";
|
8700
8776
|
var Timeline = (_a) => {
|
8701
8777
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8702
|
-
return /* @__PURE__ */
|
8778
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8703
8779
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8704
8780
|
}));
|
8705
8781
|
};
|
8706
8782
|
var Content2 = (_a) => {
|
8707
8783
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8708
|
-
return /* @__PURE__ */
|
8784
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8709
8785
|
className: classNames(tw("pb-6"), className)
|
8710
8786
|
}));
|
8711
8787
|
};
|
8712
8788
|
var Separator2 = (_a) => {
|
8713
8789
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8714
|
-
return /* @__PURE__ */
|
8790
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8715
8791
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8716
8792
|
}));
|
8717
8793
|
};
|
8718
8794
|
var LineContainer = (_a) => {
|
8719
8795
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8720
|
-
return /* @__PURE__ */
|
8796
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8721
8797
|
className: classNames(tw("flex justify-center py-1"), className)
|
8722
8798
|
}));
|
8723
8799
|
};
|
8724
8800
|
var Line = (_a) => {
|
8725
8801
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8726
|
-
return /* @__PURE__ */
|
8802
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8727
8803
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8728
8804
|
}));
|
8729
8805
|
};
|
8730
8806
|
var Dot = (_a) => {
|
8731
8807
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8732
|
-
return /* @__PURE__ */
|
8808
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8733
8809
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8734
8810
|
}));
|
8735
8811
|
};
|
@@ -8744,61 +8820,62 @@ var import_error4 = __toESM(require_error());
|
|
8744
8820
|
var import_time = __toESM(require_time());
|
8745
8821
|
var import_warningSign4 = __toESM(require_warningSign());
|
8746
8822
|
var TimelineItem = () => null;
|
8747
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8823
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React94.createElement("div", null, React94.Children.map(children, (item) => {
|
8748
8824
|
if (!isComponentType(item, TimelineItem)) {
|
8749
8825
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8750
8826
|
} else {
|
8751
8827
|
const { props, key } = item;
|
8752
|
-
return /* @__PURE__ */
|
8828
|
+
return /* @__PURE__ */ React94.createElement(Timeline, {
|
8753
8829
|
key: key != null ? key : props.title
|
8754
|
-
}, /* @__PURE__ */
|
8830
|
+
}, /* @__PURE__ */ React94.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React94.createElement(Icon, {
|
8755
8831
|
icon: import_error4.default,
|
8756
8832
|
color: "error-30"
|
8757
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8833
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React94.createElement(Icon, {
|
8758
8834
|
icon: import_warningSign4.default,
|
8759
8835
|
color: "warning-30"
|
8760
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8836
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React94.createElement(Icon, {
|
8761
8837
|
icon: import_time.default,
|
8762
8838
|
color: "info-30"
|
8763
|
-
}) : /* @__PURE__ */
|
8839
|
+
}) : /* @__PURE__ */ React94.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React94.createElement(Typography2.Caption, {
|
8764
8840
|
color: "grey-50"
|
8765
|
-
}, props.title), /* @__PURE__ */
|
8841
|
+
}, props.title), /* @__PURE__ */ React94.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React94.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React94.createElement(Timeline.Content, null, /* @__PURE__ */ React94.createElement(Typography2.Small, null, props.children)));
|
8766
8842
|
}
|
8767
8843
|
}));
|
8768
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8844
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React94.createElement(Timeline, null, /* @__PURE__ */ React94.createElement(Timeline.Separator, null, /* @__PURE__ */ React94.createElement(Skeleton, {
|
8769
8845
|
width: 6,
|
8770
8846
|
height: 6,
|
8771
8847
|
rounded: true
|
8772
|
-
})), /* @__PURE__ */
|
8848
|
+
})), /* @__PURE__ */ React94.createElement(Skeleton, {
|
8773
8849
|
height: 12,
|
8774
8850
|
width: 120
|
8775
|
-
}), /* @__PURE__ */
|
8851
|
+
}), /* @__PURE__ */ React94.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React94.createElement(Skeleton, {
|
8776
8852
|
width: 2,
|
8777
8853
|
height: "100%"
|
8778
|
-
})), /* @__PURE__ */
|
8854
|
+
})), /* @__PURE__ */ React94.createElement(Timeline.Content, null, /* @__PURE__ */ React94.createElement(Box, {
|
8779
8855
|
display: "flex",
|
8780
8856
|
flexDirection: "column",
|
8781
8857
|
gap: "3"
|
8782
|
-
}, /* @__PURE__ */
|
8858
|
+
}, /* @__PURE__ */ React94.createElement(Skeleton, {
|
8783
8859
|
height: 32,
|
8784
8860
|
width: "100%"
|
8785
|
-
}), /* @__PURE__ */
|
8861
|
+
}), /* @__PURE__ */ React94.createElement(Skeleton, {
|
8786
8862
|
height: 32,
|
8787
8863
|
width: "73%"
|
8788
|
-
}), /* @__PURE__ */
|
8864
|
+
}), /* @__PURE__ */ React94.createElement(Skeleton, {
|
8789
8865
|
height: 32,
|
8790
8866
|
width: "80%"
|
8791
8867
|
}))));
|
8792
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8868
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React94.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React94.createElement(TimelineItemSkeleton, {
|
8793
8869
|
key
|
8794
8870
|
})));
|
8795
8871
|
Timeline2.Item = TimelineItem;
|
8796
8872
|
Timeline2.Skeleton = TimelineSkeleton;
|
8873
|
+
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
8797
8874
|
|
8798
8875
|
// src/utils/table/useTableSelect.ts
|
8799
|
-
import
|
8876
|
+
import React95 from "react";
|
8800
8877
|
var useTableSelect = (data, { key }) => {
|
8801
|
-
const [selected, setSelected] =
|
8878
|
+
const [selected, setSelected] = React95.useState([]);
|
8802
8879
|
const allSelected = selected.length === data.length;
|
8803
8880
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8804
8881
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -9027,6 +9104,7 @@ export {
|
|
9027
9104
|
Label,
|
9028
9105
|
LabelControl,
|
9029
9106
|
LineClamp,
|
9107
|
+
Link2 as Link,
|
9030
9108
|
List,
|
9031
9109
|
ListItem,
|
9032
9110
|
Modal2 as Modal,
|