@aivenio/aquarium 1.8.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_variables.scss +1 -1
- package/dist/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +8 -10
- package/dist/atoms.mjs +8 -10
- package/dist/src/common/Card/Card.d.ts +1 -0
- package/dist/src/common/Card/Card.js +4 -3
- package/dist/src/common/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/src/common/LineClamp/LineClamp.d.ts +11 -0
- package/dist/src/common/LineClamp/LineClamp.js +20 -0
- package/dist/src/common/Popover/Popover.js +2 -2
- package/dist/src/components/Button/Button.js +3 -3
- package/dist/src/components/Card/Card.d.ts +3 -0
- package/dist/src/components/Card/Card.js +9 -4
- package/dist/src/components/Card/Compact.d.ts +3 -0
- package/dist/src/components/Card/Compact.js +9 -4
- package/dist/src/components/Combobox/Combobox.js +2 -2
- package/dist/src/components/LineClamp/LineClamp.d.ts +10 -1
- package/dist/src/components/LineClamp/LineClamp.js +10 -6
- package/dist/src/components/MultiSelect/MultiSelect.js +2 -2
- package/dist/src/components/Pagination/Pagination.js +6 -17
- package/dist/src/components/Pagination/usePagination.js +5 -3
- package/dist/src/components/Popover/PopoverWrapper.js +3 -5
- package/dist/src/components/Select/Select.js +2 -2
- package/dist/src/components/Skeleton/Skeleton.js +3 -2
- package/dist/styles.css +21 -0
- package/dist/styles_timescaledb.css +21 -0
- package/dist/system.cjs +751 -721
- package/dist/system.mjs +692 -662
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -1586,7 +1586,7 @@ __export(components_exports, {
|
|
1586
1586
|
InlineIcon: () => InlineIcon,
|
1587
1587
|
Input: () => Input2,
|
1588
1588
|
InputBase: () => InputBase,
|
1589
|
-
LineClamp: () =>
|
1589
|
+
LineClamp: () => LineClamp2,
|
1590
1590
|
Link: () => Link2,
|
1591
1591
|
List: () => List,
|
1592
1592
|
ListItem: () => ListItem,
|
@@ -3063,8 +3063,8 @@ var asButton = (Component, isDropdownButton) => {
|
|
3063
3063
|
!isIconOnlyButton && COLOR_CLASSNAMES[kind],
|
3064
3064
|
tw("inline-block border-0 rounded-sm transition whitespace-nowrap focus:outline-none relative", {
|
3065
3065
|
"text-grey-70 p-2 active:text-grey-70 active:bg-transparent hover:text-grey-90 hover:bg-grey-0 focus-visible:text-grey-90 focus-visible:bg-grey-0 disabled:text-grey-20 disabled:bg-transparent": isIconOnlyButton,
|
3066
|
-
"typography-default": !dense && !isIconOnlyButton,
|
3067
|
-
"typography-small": dense && !isIconOnlyButton,
|
3066
|
+
"typography-default-strong": !dense && !isIconOnlyButton,
|
3067
|
+
"typography-small-strong": dense && !isIconOnlyButton,
|
3068
3068
|
"py-3 px-4": !dense && isButton,
|
3069
3069
|
"py-2 px-3": dense && isButton,
|
3070
3070
|
"py-3": !dense && isGhost,
|
@@ -3476,12 +3476,13 @@ var Skeleton = ({
|
|
3476
3476
|
}) => {
|
3477
3477
|
const styles = {
|
3478
3478
|
width: isNumber(width) ? `${width}px` : width,
|
3479
|
-
height:
|
3479
|
+
height: isNumber(height) ? `${height}px` : height
|
3480
3480
|
};
|
3481
3481
|
return /* @__PURE__ */ React14.createElement("div", {
|
3482
3482
|
style: styles,
|
3483
3483
|
className: classNames(
|
3484
3484
|
tw("bg-grey-5", {
|
3485
|
+
"h-auto before:content-['_'] whitespace-pre origin-[0%_45%] scale-[0.55]": isUndefined7(height),
|
3485
3486
|
"rounded-full": rounded,
|
3486
3487
|
"block": display === "block",
|
3487
3488
|
"inline-block": display === "inline-block",
|
@@ -3757,7 +3758,7 @@ var ActiveCrumb = asCrumb("span", "ActiveCrumb", { isActive: true });
|
|
3757
3758
|
Breadcrumbs.Crumb = Crumb;
|
3758
3759
|
|
3759
3760
|
// src/components/Card/Card.tsx
|
3760
|
-
import
|
3761
|
+
import React26, { useRef as useRef3 } from "react";
|
3761
3762
|
import { useButton as useButton2 } from "@react-aria/button";
|
3762
3763
|
import omit5 from "lodash/omit";
|
3763
3764
|
|
@@ -3996,14 +3997,15 @@ import React23 from "react";
|
|
3996
3997
|
import isNumber3 from "lodash/isNumber";
|
3997
3998
|
var Card = React23.forwardRef(
|
3998
3999
|
(_a, ref) => {
|
3999
|
-
var _b = _a, { disabled, fullWidth, clickable, className, children } = _b, rest = __objRest(_b, ["disabled", "fullWidth", "clickable", "className", "children"]);
|
4000
|
+
var _b = _a, { disabled, fullWidth, enableMinWidth = true, clickable, className, children } = _b, rest = __objRest(_b, ["disabled", "fullWidth", "enableMinWidth", "clickable", "className", "children"]);
|
4000
4001
|
return /* @__PURE__ */ React23.createElement("div", __spreadProps(__spreadValues({
|
4001
4002
|
ref
|
4002
4003
|
}, rest), {
|
4003
4004
|
className: classNames(
|
4004
4005
|
tw("border-grey-5 border-[1px] rounded-[2px] relative p-5 flex flex-col gap-5", {
|
4005
4006
|
"w-[280px]": !fullWidth,
|
4006
|
-
"w-full
|
4007
|
+
"w-full": Boolean(fullWidth),
|
4008
|
+
"min-w-[280px]": Boolean(fullWidth) && Boolean(enableMinWidth),
|
4007
4009
|
"active:bg-grey-5 cursor-pointer hover:border-grey-50 focus:border-info-70": Boolean(clickable && !disabled),
|
4008
4010
|
"bg-grey-0 cursor-not-allowed focus:border-transparent": Boolean(disabled)
|
4009
4011
|
}),
|
@@ -4058,12 +4060,27 @@ Card.ImageContainer = ImageContainer;
|
|
4058
4060
|
Card.Image = Image;
|
4059
4061
|
Card.ColorHiglight = ColorHighlight;
|
4060
4062
|
|
4063
|
+
// src/common/LineClamp/LineClamp.tsx
|
4064
|
+
import React24 from "react";
|
4065
|
+
var LineClamp = React24.forwardRef(
|
4066
|
+
(_a, ref) => {
|
4067
|
+
var _b = _a, { lines = 1, clamped = true, children, className, wordBreak = "break-words" } = _b, props = __objRest(_b, ["lines", "clamped", "children", "className", "wordBreak"]);
|
4068
|
+
return /* @__PURE__ */ React24.createElement("div", __spreadValues({
|
4069
|
+
ref,
|
4070
|
+
className: classNames(className, wordBreak === "break-words" ? "break-words" : "break-all", {
|
4071
|
+
[`line-clamp-${lines}`]: clamped
|
4072
|
+
})
|
4073
|
+
}, props), children);
|
4074
|
+
}
|
4075
|
+
);
|
4076
|
+
|
4061
4077
|
// src/components/Card/Compact.tsx
|
4062
|
-
import
|
4078
|
+
import React25, { useRef as useRef2 } from "react";
|
4063
4079
|
import { useButton } from "@react-aria/button";
|
4064
4080
|
import { omit as omit4 } from "lodash";
|
4065
4081
|
var CompactCard = ({
|
4066
4082
|
title,
|
4083
|
+
clampTitle,
|
4067
4084
|
chips = [],
|
4068
4085
|
icon,
|
4069
4086
|
color,
|
@@ -4076,35 +4093,39 @@ var CompactCard = ({
|
|
4076
4093
|
}) => {
|
4077
4094
|
const ref = useRef2(null);
|
4078
4095
|
const { buttonProps } = useButton({ elementType: "div", onPress: onClick, isDisabled: disabled }, ref);
|
4079
|
-
|
4096
|
+
const titleContent = /* @__PURE__ */ React25.createElement(Typography2.SmallStrong, {
|
4097
|
+
color: "black"
|
4098
|
+
}, title);
|
4099
|
+
return /* @__PURE__ */ React25.createElement(Card, __spreadProps(__spreadValues({
|
4080
4100
|
ref,
|
4081
4101
|
clickable: Boolean(onClick),
|
4082
|
-
fullWidth
|
4102
|
+
fullWidth,
|
4103
|
+
enableMinWidth: Boolean(action || link || chips.length)
|
4083
4104
|
}, onClick ? buttonProps : {}), {
|
4084
4105
|
disabled
|
4085
|
-
}), color && /* @__PURE__ */
|
4106
|
+
}), color && /* @__PURE__ */ React25.createElement(Card.ColorHiglight, {
|
4086
4107
|
color
|
4087
|
-
}), chips.length > 0 && /* @__PURE__ */
|
4108
|
+
}), chips.length > 0 && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
4088
4109
|
dense: true
|
4089
|
-
}, chips.map((chip) => /* @__PURE__ */
|
4110
|
+
}, chips.map((chip) => /* @__PURE__ */ React25.createElement(Chip2, {
|
4090
4111
|
key: chip,
|
4091
4112
|
text: chip
|
4092
|
-
}))), /* @__PURE__ */
|
4113
|
+
}))), /* @__PURE__ */ React25.createElement(Box, {
|
4093
4114
|
display: "flex",
|
4094
4115
|
gap: "5"
|
4095
|
-
}, icon && /* @__PURE__ */
|
4116
|
+
}, icon && /* @__PURE__ */ React25.createElement(Avatar, {
|
4096
4117
|
image: icon
|
4097
|
-
}), /* @__PURE__ */
|
4118
|
+
}), /* @__PURE__ */ React25.createElement(Card.Content, {
|
4098
4119
|
dense: true
|
4099
|
-
}, /* @__PURE__ */
|
4100
|
-
|
4101
|
-
},
|
4120
|
+
}, clampTitle ? /* @__PURE__ */ React25.createElement(LineClamp, {
|
4121
|
+
lines: clampTitle
|
4122
|
+
}, titleContent) : titleContent, /* @__PURE__ */ React25.createElement(Typography2.Caption, {
|
4102
4123
|
color: "grey-70"
|
4103
|
-
}, children))), (action || link) && /* @__PURE__ */
|
4124
|
+
}, children))), (action || link) && /* @__PURE__ */ React25.createElement(Card.Actions, {
|
4104
4125
|
dense: true
|
4105
|
-
}, action && /* @__PURE__ */
|
4126
|
+
}, action && /* @__PURE__ */ React25.createElement(SecondaryButton, __spreadValues({
|
4106
4127
|
dense: true
|
4107
|
-
}, omit4(action, "text")), action.text), link && /* @__PURE__ */
|
4128
|
+
}, omit4(action, "text")), action.text), link && /* @__PURE__ */ React25.createElement(ExternalLinkButton, __spreadValues({
|
4108
4129
|
dense: true,
|
4109
4130
|
kind: "ghost"
|
4110
4131
|
}, omit4(link, "text")), link.text)));
|
@@ -4114,31 +4135,31 @@ var CompactSkeleton = ({
|
|
4114
4135
|
icon = true,
|
4115
4136
|
actions = true,
|
4116
4137
|
fullWidth = false
|
4117
|
-
}) => /* @__PURE__ */
|
4138
|
+
}) => /* @__PURE__ */ React25.createElement(Card, {
|
4118
4139
|
fullWidth
|
4119
|
-
}, chips && /* @__PURE__ */
|
4140
|
+
}, chips && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
4120
4141
|
dense: true
|
4121
|
-
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */
|
4142
|
+
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ React25.createElement(Chip2.Skeleton, {
|
4122
4143
|
key: idx
|
4123
|
-
}))), /* @__PURE__ */
|
4144
|
+
}))), /* @__PURE__ */ React25.createElement(Box, {
|
4124
4145
|
display: "flex",
|
4125
4146
|
gap: "5"
|
4126
|
-
}, icon && /* @__PURE__ */
|
4147
|
+
}, icon && /* @__PURE__ */ React25.createElement(Avatar.Skeleton, null), /* @__PURE__ */ React25.createElement(Card.Content, {
|
4127
4148
|
dense: true
|
4128
|
-
}, /* @__PURE__ */
|
4149
|
+
}, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4129
4150
|
width: 80,
|
4130
4151
|
height: 20
|
4131
|
-
}), /* @__PURE__ */
|
4152
|
+
}), /* @__PURE__ */ React25.createElement(Box, {
|
4132
4153
|
height: "1"
|
4133
|
-
}), /* @__PURE__ */
|
4154
|
+
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
4134
4155
|
width: 145,
|
4135
4156
|
height: 16
|
4136
|
-
}))), actions && /* @__PURE__ */
|
4157
|
+
}))), actions && /* @__PURE__ */ React25.createElement(Card.Actions, {
|
4137
4158
|
dense: true
|
4138
|
-
}, /* @__PURE__ */
|
4159
|
+
}, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4139
4160
|
width: 115,
|
4140
4161
|
height: 25
|
4141
|
-
}), /* @__PURE__ */
|
4162
|
+
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
4142
4163
|
width: 60,
|
4143
4164
|
height: 25
|
4144
4165
|
})));
|
@@ -4147,6 +4168,7 @@ CompactCard.Skeleton = CompactSkeleton;
|
|
4147
4168
|
// src/components/Card/Card.tsx
|
4148
4169
|
var Card2 = ({
|
4149
4170
|
title,
|
4171
|
+
clampTitle,
|
4150
4172
|
description,
|
4151
4173
|
chips = [],
|
4152
4174
|
icons = [],
|
@@ -4163,36 +4185,41 @@ var Card2 = ({
|
|
4163
4185
|
}) => {
|
4164
4186
|
const ref = useRef3(null);
|
4165
4187
|
const { buttonProps } = useButton2({ elementType: "div", onPress: onClick, isDisabled: disabled }, ref);
|
4166
|
-
|
4188
|
+
const titleContent = /* @__PURE__ */ React26.createElement(Typography2.DefaultStrong, {
|
4189
|
+
color: "black"
|
4190
|
+
}, title);
|
4191
|
+
return /* @__PURE__ */ React26.createElement(Card, __spreadProps(__spreadValues({
|
4167
4192
|
ref,
|
4168
4193
|
clickable: Boolean(onClick),
|
4169
|
-
fullWidth
|
4194
|
+
fullWidth,
|
4195
|
+
enableMinWidth: Boolean(image || action || link || chips.length || icons.length)
|
4170
4196
|
}, onClick ? buttonProps : {}), {
|
4171
4197
|
disabled
|
4172
|
-
}), color && /* @__PURE__ */
|
4198
|
+
}), color && /* @__PURE__ */ React26.createElement(Card.ColorHiglight, {
|
4173
4199
|
color
|
4174
|
-
}), chips.length > 0 && /* @__PURE__ */
|
4200
|
+
}), chips.length > 0 && /* @__PURE__ */ React26.createElement(ChipContainer, {
|
4175
4201
|
dense: true
|
4176
|
-
}, chips.map((chip) => /* @__PURE__ */
|
4202
|
+
}, chips.map((chip) => /* @__PURE__ */ React26.createElement(Chip2, {
|
4177
4203
|
key: chip,
|
4178
4204
|
text: chip
|
4179
|
-
}))), icons.length > 0 && /* @__PURE__ */
|
4205
|
+
}))), icons.length > 0 && /* @__PURE__ */ React26.createElement(AvatarStack, {
|
4180
4206
|
images: icons
|
4181
|
-
}), image !== void 0 && (imageHeight ? /* @__PURE__ */
|
4207
|
+
}), image !== void 0 && (imageHeight ? /* @__PURE__ */ React26.createElement(CardImage, {
|
4182
4208
|
image,
|
4183
4209
|
imageAlt,
|
4184
4210
|
imageHeight
|
4185
|
-
}) : /* @__PURE__ */
|
4211
|
+
}) : /* @__PURE__ */ React26.createElement(CardImage, {
|
4186
4212
|
image,
|
4187
4213
|
imageAlt,
|
4188
4214
|
fullSize: chips.length === 0
|
4189
|
-
})), /* @__PURE__ */
|
4190
|
-
|
4191
|
-
|
4215
|
+
})), /* @__PURE__ */ React26.createElement(Card.Content, null, clampTitle ? /* @__PURE__ */ React26.createElement(LineClamp, {
|
4216
|
+
lines: clampTitle,
|
4217
|
+
wordBreak: "break-all"
|
4218
|
+
}, titleContent) : titleContent, /* @__PURE__ */ React26.createElement(Typography2.Caption, {
|
4192
4219
|
color: "grey-70"
|
4193
|
-
}, children || description)), (action || link) && /* @__PURE__ */
|
4220
|
+
}, children || description)), (action || link) && /* @__PURE__ */ React26.createElement(Card.Actions, null, action && /* @__PURE__ */ React26.createElement(SecondaryButton, __spreadValues({
|
4194
4221
|
dense: true
|
4195
|
-
}, omit5(action, "text")), action.text), link && /* @__PURE__ */
|
4222
|
+
}, omit5(action, "text")), action.text), link && /* @__PURE__ */ React26.createElement(ExternalLinkButton, __spreadValues({
|
4196
4223
|
dense: true,
|
4197
4224
|
kind: "ghost"
|
4198
4225
|
}, omit5(link, "text")), link.text)));
|
@@ -4204,60 +4231,60 @@ var CardSkeleton = ({
|
|
4204
4231
|
actions = true,
|
4205
4232
|
fullWidth = false,
|
4206
4233
|
imageHeight
|
4207
|
-
}) => /* @__PURE__ */
|
4234
|
+
}) => /* @__PURE__ */ React26.createElement(Card, {
|
4208
4235
|
fullWidth
|
4209
|
-
}, chips && /* @__PURE__ */
|
4236
|
+
}, chips && /* @__PURE__ */ React26.createElement(ChipContainer, {
|
4210
4237
|
dense: true
|
4211
|
-
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */
|
4238
|
+
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ React26.createElement(Chip2.Skeleton, {
|
4212
4239
|
key: idx
|
4213
|
-
}))), icons && /* @__PURE__ */
|
4240
|
+
}))), icons && /* @__PURE__ */ React26.createElement(AvatarStack, {
|
4214
4241
|
images: [null]
|
4215
|
-
}), image && (imageHeight ? /* @__PURE__ */
|
4242
|
+
}), image && (imageHeight ? /* @__PURE__ */ React26.createElement(CardImage, {
|
4216
4243
|
image: null,
|
4217
4244
|
imageHeight
|
4218
|
-
}) : /* @__PURE__ */
|
4245
|
+
}) : /* @__PURE__ */ React26.createElement(CardImage, {
|
4219
4246
|
image: null,
|
4220
4247
|
fullSize: !chips
|
4221
|
-
})), /* @__PURE__ */
|
4248
|
+
})), /* @__PURE__ */ React26.createElement(Card.Content, null, /* @__PURE__ */ React26.createElement(Skeleton, {
|
4222
4249
|
width: 145,
|
4223
4250
|
height: 25
|
4224
|
-
}), /* @__PURE__ */
|
4251
|
+
}), /* @__PURE__ */ React26.createElement(Skeleton, {
|
4225
4252
|
width: 145,
|
4226
4253
|
height: 16
|
4227
|
-
})), actions && /* @__PURE__ */
|
4254
|
+
})), actions && /* @__PURE__ */ React26.createElement(Card.Actions, null, /* @__PURE__ */ React26.createElement(Skeleton, {
|
4228
4255
|
width: 115,
|
4229
4256
|
height: 25
|
4230
|
-
}), /* @__PURE__ */
|
4257
|
+
}), /* @__PURE__ */ React26.createElement(Skeleton, {
|
4231
4258
|
width: 60,
|
4232
4259
|
height: 25
|
4233
4260
|
})));
|
4234
4261
|
Card2.Skeleton = CardSkeleton;
|
4235
4262
|
Card2.Compact = CompactCard;
|
4236
|
-
var CardImage = ({ image, imageAlt, imageHeight, fullSize = false }) => /* @__PURE__ */
|
4263
|
+
var CardImage = ({ image, imageAlt, imageHeight, fullSize = false }) => /* @__PURE__ */ React26.createElement(Card.ImageContainer, {
|
4237
4264
|
fullSize
|
4238
|
-
}, image ? imageHeight ? /* @__PURE__ */
|
4265
|
+
}, image ? imageHeight ? /* @__PURE__ */ React26.createElement(Card.Image, {
|
4239
4266
|
image,
|
4240
4267
|
imageAlt,
|
4241
4268
|
imageHeight
|
4242
|
-
}) : /* @__PURE__ */
|
4269
|
+
}) : /* @__PURE__ */ React26.createElement(Card.Image, {
|
4243
4270
|
image,
|
4244
4271
|
imageAlt,
|
4245
4272
|
fullSize
|
4246
|
-
}) : /* @__PURE__ */
|
4273
|
+
}) : /* @__PURE__ */ React26.createElement(CardImage.Skeleton, {
|
4247
4274
|
fullSize,
|
4248
4275
|
imageHeight
|
4249
4276
|
}));
|
4250
|
-
var CardImageSkeleton = ({ imageHeight, fullSize }) => imageHeight ? /* @__PURE__ */
|
4277
|
+
var CardImageSkeleton = ({ imageHeight, fullSize }) => imageHeight ? /* @__PURE__ */ React26.createElement(Skeleton, {
|
4251
4278
|
height: imageHeight,
|
4252
4279
|
width: "100%"
|
4253
|
-
}) : /* @__PURE__ */
|
4280
|
+
}) : /* @__PURE__ */ React26.createElement(Skeleton, {
|
4254
4281
|
height: fullSize ? 225 : 174,
|
4255
4282
|
width: "100%"
|
4256
4283
|
});
|
4257
4284
|
CardImage.Skeleton = CardImageSkeleton;
|
4258
4285
|
|
4259
4286
|
// src/components/Carousel/Carousel.tsx
|
4260
|
-
import
|
4287
|
+
import React27, { useEffect as useEffect3, useLayoutEffect, useRef as useRef4, useState as useState2 } from "react";
|
4261
4288
|
var import_chevronLeft = __toESM(require_chevronLeft());
|
4262
4289
|
var import_chevronRight = __toESM(require_chevronRight());
|
4263
4290
|
var Carousel = ({
|
@@ -4268,7 +4295,7 @@ var Carousel = ({
|
|
4268
4295
|
}) => {
|
4269
4296
|
const containerRef = useRef4(null);
|
4270
4297
|
const scrollbarContainerRef = useRef4(null);
|
4271
|
-
const items =
|
4298
|
+
const items = React27.Children.toArray(children);
|
4272
4299
|
const [width, setWidth] = useState2(0);
|
4273
4300
|
const [isUpdating, setIsUpdating] = useState2(false);
|
4274
4301
|
const [currentPage, setCurrentPage] = useState2(currentPageProp != null ? currentPageProp : defaultPage);
|
@@ -4318,30 +4345,30 @@ var Carousel = ({
|
|
4318
4345
|
onPageChange && onPageChange(newPage);
|
4319
4346
|
}
|
4320
4347
|
};
|
4321
|
-
return items.length > 0 ? /* @__PURE__ */
|
4348
|
+
return items.length > 0 ? /* @__PURE__ */ React27.createElement("div", {
|
4322
4349
|
className: tw("w-full flex flex-col"),
|
4323
4350
|
ref: containerRef
|
4324
|
-
}, containerRef !== null && /* @__PURE__ */
|
4351
|
+
}, containerRef !== null && /* @__PURE__ */ React27.createElement("ul", {
|
4325
4352
|
ref: scrollbarContainerRef,
|
4326
4353
|
tabIndex: 0,
|
4327
4354
|
onScroll: handleScroll,
|
4328
4355
|
className: tw(
|
4329
4356
|
"grid items-stretch grid-flow-col overflow-x-scroll scroll-smooth snap-x snap-mandatory scrollbar-hide focus-visible:outline-0 focus-visible:ring-1 focus-visible:ring-info-70"
|
4330
4357
|
)
|
4331
|
-
}, width !== 0 &&
|
4358
|
+
}, width !== 0 && React27.Children.map(children, (child, index) => /* @__PURE__ */ React27.createElement(CarouselItem, {
|
4332
4359
|
key: index,
|
4333
4360
|
width,
|
4334
4361
|
ariaHidden: index + 1 === currentPage ? void 0 : true
|
4335
|
-
}, child))), /* @__PURE__ */
|
4362
|
+
}, child))), /* @__PURE__ */ React27.createElement(Flexbox, {
|
4336
4363
|
direction: "row",
|
4337
4364
|
justifyContent: "flex-end",
|
4338
4365
|
alignItems: "center"
|
4339
|
-
}, /* @__PURE__ */
|
4366
|
+
}, /* @__PURE__ */ React27.createElement(IconButton, {
|
4340
4367
|
"aria-label": "Previous",
|
4341
4368
|
onClick: () => handleNavigationClick("left"),
|
4342
4369
|
icon: import_chevronLeft.default,
|
4343
4370
|
disabled: currentPage === 1
|
4344
|
-
}), /* @__PURE__ */
|
4371
|
+
}), /* @__PURE__ */ React27.createElement(Typography2.Caption, null, `${currentPage}/${React27.Children.count(children)}`), /* @__PURE__ */ React27.createElement(IconButton, {
|
4345
4372
|
"aria-label": "Next",
|
4346
4373
|
onClick: () => handleNavigationClick("right"),
|
4347
4374
|
icon: import_chevronRight.default,
|
@@ -4349,7 +4376,7 @@ var Carousel = ({
|
|
4349
4376
|
}))) : null;
|
4350
4377
|
};
|
4351
4378
|
var CarouselItem = ({ width, children, ariaHidden }) => {
|
4352
|
-
return /* @__PURE__ */
|
4379
|
+
return /* @__PURE__ */ React27.createElement("li", {
|
4353
4380
|
style: { width },
|
4354
4381
|
"aria-hidden": ariaHidden,
|
4355
4382
|
className: tw("flex justify-center snap-start")
|
@@ -4357,10 +4384,10 @@ var CarouselItem = ({ width, children, ariaHidden }) => {
|
|
4357
4384
|
};
|
4358
4385
|
|
4359
4386
|
// src/components/Checkbox/Checkbox.tsx
|
4360
|
-
import
|
4387
|
+
import React30 from "react";
|
4361
4388
|
|
4362
4389
|
// src/components/ControlLabel/ControlLabel.tsx
|
4363
|
-
import
|
4390
|
+
import React28 from "react";
|
4364
4391
|
var ControlLabel = (_a) => {
|
4365
4392
|
var _b = _a, {
|
4366
4393
|
label,
|
@@ -4378,7 +4405,7 @@ var ControlLabel = (_a) => {
|
|
4378
4405
|
"style"
|
4379
4406
|
]);
|
4380
4407
|
const textClass = disabled ? "text-grey-40" : "text-grey-100";
|
4381
|
-
return /* @__PURE__ */
|
4408
|
+
return /* @__PURE__ */ React28.createElement("label", __spreadValues({
|
4382
4409
|
className: tw(
|
4383
4410
|
"inline-grid grid-cols-[auto_1fr]",
|
4384
4411
|
{
|
@@ -4388,9 +4415,9 @@ var ControlLabel = (_a) => {
|
|
4388
4415
|
textClass
|
4389
4416
|
),
|
4390
4417
|
style: __spreadValues({}, style)
|
4391
|
-
}, rest), children, label && /* @__PURE__ */
|
4418
|
+
}, rest), children, label && /* @__PURE__ */ React28.createElement("span", {
|
4392
4419
|
className: tw("typography-small self-center")
|
4393
|
-
}, label), caption && /* @__PURE__ */
|
4420
|
+
}, label), caption && /* @__PURE__ */ React28.createElement(Typography2, {
|
4394
4421
|
className: tw("col-start-2"),
|
4395
4422
|
variant: "caption",
|
4396
4423
|
color: disabled ? "grey-40" : "grey-50"
|
@@ -4398,18 +4425,18 @@ var ControlLabel = (_a) => {
|
|
4398
4425
|
};
|
4399
4426
|
|
4400
4427
|
// src/common/Checkbox/Checkbox.tsx
|
4401
|
-
import
|
4428
|
+
import React29 from "react";
|
4402
4429
|
var import_minus = __toESM(require_minus());
|
4403
4430
|
var import_tick2 = __toESM(require_tick());
|
4404
|
-
var Checkbox =
|
4431
|
+
var Checkbox = React29.forwardRef(
|
4405
4432
|
(_a, ref) => {
|
4406
4433
|
var _b = _a, { id, children, name, disabled = false, readOnly = false, indeterminate = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly", "indeterminate"]);
|
4407
|
-
return /* @__PURE__ */
|
4434
|
+
return /* @__PURE__ */ React29.createElement("span", {
|
4408
4435
|
className: classNames(tw("inline-flex justify-center items-center self-center relative"), {
|
4409
4436
|
"hover:border-grey-50 peer-checked:border-navyBlue-100": !disabled,
|
4410
4437
|
"border-grey-5": disabled
|
4411
4438
|
})
|
4412
|
-
}, /* @__PURE__ */
|
4439
|
+
}, /* @__PURE__ */ React29.createElement("input", __spreadProps(__spreadValues({
|
4413
4440
|
id,
|
4414
4441
|
ref,
|
4415
4442
|
type: "checkbox",
|
@@ -4423,7 +4450,7 @@ var Checkbox = React28.forwardRef(
|
|
4423
4450
|
),
|
4424
4451
|
readOnly,
|
4425
4452
|
disabled
|
4426
|
-
})), /* @__PURE__ */
|
4453
|
+
})), /* @__PURE__ */ React29.createElement(Icon, {
|
4427
4454
|
icon: indeterminate ? import_minus.default : import_tick2.default,
|
4428
4455
|
className: classNames(
|
4429
4456
|
tw(
|
@@ -4442,12 +4469,12 @@ var Checkbox = React28.forwardRef(
|
|
4442
4469
|
);
|
4443
4470
|
|
4444
4471
|
// src/components/Checkbox/Checkbox.tsx
|
4445
|
-
var Checkbox2 =
|
4472
|
+
var Checkbox2 = React30.forwardRef(
|
4446
4473
|
(_a, ref) => {
|
4447
4474
|
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"]);
|
4448
4475
|
var _a2;
|
4449
4476
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
4450
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
4477
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React30.createElement(ControlLabel, {
|
4451
4478
|
htmlFor: id,
|
4452
4479
|
label: children,
|
4453
4480
|
"aria-label": ariaLabel,
|
@@ -4455,7 +4482,7 @@ var Checkbox2 = React29.forwardRef(
|
|
4455
4482
|
readOnly,
|
4456
4483
|
disabled,
|
4457
4484
|
style: { gap: "0 8px" }
|
4458
|
-
}, !readOnly && /* @__PURE__ */
|
4485
|
+
}, !readOnly && /* @__PURE__ */ React30.createElement(Checkbox, __spreadProps(__spreadValues({
|
4459
4486
|
id,
|
4460
4487
|
ref,
|
4461
4488
|
name
|
@@ -4466,12 +4493,12 @@ var Checkbox2 = React29.forwardRef(
|
|
4466
4493
|
}
|
4467
4494
|
);
|
4468
4495
|
Checkbox2.displayName = "Checkbox";
|
4469
|
-
var CheckboxSkeleton = () => /* @__PURE__ */
|
4496
|
+
var CheckboxSkeleton = () => /* @__PURE__ */ React30.createElement("div", {
|
4470
4497
|
className: tw("flex gap-3")
|
4471
|
-
}, /* @__PURE__ */
|
4498
|
+
}, /* @__PURE__ */ React30.createElement(Skeleton, {
|
4472
4499
|
height: 20,
|
4473
4500
|
width: 20
|
4474
|
-
}), /* @__PURE__ */
|
4501
|
+
}), /* @__PURE__ */ React30.createElement(Skeleton, {
|
4475
4502
|
height: 20,
|
4476
4503
|
width: 150
|
4477
4504
|
}));
|
@@ -4479,14 +4506,14 @@ Checkbox2.Skeleton = CheckboxSkeleton;
|
|
4479
4506
|
Checkbox2.Skeleton.displayName = "Checkbox.Skeleton";
|
4480
4507
|
|
4481
4508
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4482
|
-
import
|
4509
|
+
import React37, { useState as useState3 } from "react";
|
4483
4510
|
import uniqueId from "lodash/uniqueId";
|
4484
4511
|
|
4485
4512
|
// src/common/InputGroup/InputGroup.tsx
|
4486
|
-
import
|
4513
|
+
import React32 from "react";
|
4487
4514
|
|
4488
4515
|
// src/components/Grid/Grid.tsx
|
4489
|
-
import
|
4516
|
+
import React31 from "react";
|
4490
4517
|
var Grid = Tailwindify(
|
4491
4518
|
({
|
4492
4519
|
htmlTag = "div",
|
@@ -4539,7 +4566,7 @@ var Grid = Tailwindify(
|
|
4539
4566
|
gridRowEnd: rowEnd
|
4540
4567
|
});
|
4541
4568
|
const HtmlElement = htmlTag;
|
4542
|
-
return /* @__PURE__ */
|
4569
|
+
return /* @__PURE__ */ React31.createElement(HtmlElement, {
|
4543
4570
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
4544
4571
|
className
|
4545
4572
|
}, children);
|
@@ -4555,7 +4582,7 @@ var gridColumnStyles = {
|
|
4555
4582
|
};
|
4556
4583
|
var InputGroup = (_a) => {
|
4557
4584
|
var _b = _a, { cols = "1", children } = _b, rest = __objRest(_b, ["cols", "children"]);
|
4558
|
-
return /* @__PURE__ */
|
4585
|
+
return /* @__PURE__ */ React32.createElement(Grid, __spreadProps(__spreadValues({}, rest), {
|
4559
4586
|
display: "inline-grid",
|
4560
4587
|
colGap: "l4",
|
4561
4588
|
rowGap: "3",
|
@@ -4565,12 +4592,12 @@ var InputGroup = (_a) => {
|
|
4565
4592
|
};
|
4566
4593
|
|
4567
4594
|
// src/utils/form/Label/Label.tsx
|
4568
|
-
import
|
4595
|
+
import React36 from "react";
|
4569
4596
|
|
4570
4597
|
// src/utils/form/FormControl/FormControl.tsx
|
4571
|
-
import
|
4598
|
+
import React33 from "react";
|
4572
4599
|
var FormControl = ({ className, inline, children }) => {
|
4573
|
-
return /* @__PURE__ */
|
4600
|
+
return /* @__PURE__ */ React33.createElement(Flexbox, {
|
4574
4601
|
direction: "column",
|
4575
4602
|
display: inline ? "inline-flex" : "flex",
|
4576
4603
|
className
|
@@ -4578,14 +4605,14 @@ var FormControl = ({ className, inline, children }) => {
|
|
4578
4605
|
};
|
4579
4606
|
|
4580
4607
|
// src/utils/form/HelperText/HelperText.tsx
|
4581
|
-
import
|
4608
|
+
import React35 from "react";
|
4582
4609
|
import classNames3 from "classnames";
|
4583
4610
|
import isNumber4 from "lodash/isNumber";
|
4584
4611
|
|
4585
4612
|
// src/utils/form/CharCounter/CharCounter.tsx
|
4586
|
-
import
|
4613
|
+
import React34 from "react";
|
4587
4614
|
var CharCounter = ({ dense = true, length, maxLength, valid = true }) => {
|
4588
|
-
return /* @__PURE__ */
|
4615
|
+
return /* @__PURE__ */ React34.createElement("span", {
|
4589
4616
|
className: tw(
|
4590
4617
|
`whitespace-nowrap`,
|
4591
4618
|
valid ? "text-grey-50" : "text-error-70",
|
@@ -4607,34 +4634,34 @@ var HelperText = ({
|
|
4607
4634
|
const hasMaxLength = isNumber4(maxLength) && maxLength > 0;
|
4608
4635
|
const showMessage = hasError || hasMaxLength;
|
4609
4636
|
if (!showMessage) {
|
4610
|
-
return reserveSpaceForError ? /* @__PURE__ */
|
4637
|
+
return reserveSpaceForError ? /* @__PURE__ */ React35.createElement("p", {
|
4611
4638
|
className: tw("block mt-1 mb-3 typography-caption")
|
4612
4639
|
}, "\xA0") : null;
|
4613
4640
|
}
|
4614
|
-
return /* @__PURE__ */
|
4641
|
+
return /* @__PURE__ */ React35.createElement(Grid, {
|
4615
4642
|
cols: "1",
|
4616
4643
|
rows: "1",
|
4617
4644
|
colGap: "3",
|
4618
4645
|
alignItems: "start",
|
4619
4646
|
autoCols: "min",
|
4620
4647
|
className: tw("mt-1 mb-3")
|
4621
|
-
}, /* @__PURE__ */
|
4648
|
+
}, /* @__PURE__ */ React35.createElement(GridItem, {
|
4622
4649
|
colStart: "1",
|
4623
4650
|
colEnd: "2"
|
4624
|
-
}, hasError && /* @__PURE__ */
|
4651
|
+
}, hasError && /* @__PURE__ */ React35.createElement("p", {
|
4625
4652
|
id: messageId,
|
4626
4653
|
className: tw("text-error-50 block typography-caption")
|
4627
|
-
}, helperText)), /* @__PURE__ */
|
4654
|
+
}, helperText)), /* @__PURE__ */ React35.createElement(GridItem, {
|
4628
4655
|
colStart: "2",
|
4629
4656
|
colEnd: "3",
|
4630
4657
|
display: "flex"
|
4631
|
-
}, isNumber4(length) && hasMaxLength && /* @__PURE__ */
|
4658
|
+
}, isNumber4(length) && hasMaxLength && /* @__PURE__ */ React35.createElement(CharCounter, {
|
4632
4659
|
length,
|
4633
4660
|
maxLength,
|
4634
4661
|
valid: !error2
|
4635
4662
|
})));
|
4636
4663
|
};
|
4637
|
-
var Skeleton2 = ({ className, children }) => /* @__PURE__ */
|
4664
|
+
var Skeleton2 = ({ className, children }) => /* @__PURE__ */ React35.createElement("div", {
|
4638
4665
|
className: classNames3(className, "h-[25px]")
|
4639
4666
|
}, children);
|
4640
4667
|
HelperText.Skeleton = Skeleton2;
|
@@ -4649,35 +4676,35 @@ var LabelText = ({
|
|
4649
4676
|
helpTooltip,
|
4650
4677
|
helpTooltipPlacement
|
4651
4678
|
}) => {
|
4652
|
-
return /* @__PURE__ */
|
4679
|
+
return /* @__PURE__ */ React36.createElement("span", {
|
4653
4680
|
className: tw("inline-block mb-2 typography-small-strong", {
|
4654
4681
|
"text-grey-60": variant === "default",
|
4655
4682
|
"text-error-50": variant === "error",
|
4656
4683
|
"text-grey-40": variant === "disabled"
|
4657
4684
|
})
|
4658
|
-
}, labelText, required && /* @__PURE__ */
|
4685
|
+
}, labelText, required && /* @__PURE__ */ React36.createElement("span", {
|
4659
4686
|
className: tw("text-error-50")
|
4660
|
-
}, "*"), helpTooltip && /* @__PURE__ */
|
4687
|
+
}, "*"), helpTooltip && /* @__PURE__ */ React36.createElement(Tooltip, {
|
4661
4688
|
content: helpTooltip,
|
4662
4689
|
placement: helpTooltipPlacement
|
4663
|
-
}, /* @__PURE__ */
|
4690
|
+
}, /* @__PURE__ */ React36.createElement("span", {
|
4664
4691
|
className: tw("text-grey-30 flex items-center cursor-pointer ml-2")
|
4665
|
-
}, /* @__PURE__ */
|
4692
|
+
}, /* @__PURE__ */ React36.createElement(InlineIcon, {
|
4666
4693
|
icon: import_questionMark.default,
|
4667
4694
|
"data-testid": "icon-info"
|
4668
4695
|
}))));
|
4669
4696
|
};
|
4670
4697
|
var Label = (props) => {
|
4671
4698
|
const _a = props, { id, htmlFor, labelText, labelProps: _b = {} } = _a, labelProps = __objRest(_b, []), { "data-testid": dataTestid, children } = _a;
|
4672
|
-
return /* @__PURE__ */
|
4699
|
+
return /* @__PURE__ */ React36.createElement("label", __spreadValues({
|
4673
4700
|
id,
|
4674
4701
|
className: tw("w-full"),
|
4675
4702
|
"data-testid": dataTestid,
|
4676
4703
|
htmlFor
|
4677
|
-
}, labelProps), labelText && /* @__PURE__ */
|
4704
|
+
}, labelProps), labelText && /* @__PURE__ */ React36.createElement(LabelText, __spreadValues({}, props)), children);
|
4678
4705
|
};
|
4679
4706
|
var LabelSkeleton = () => {
|
4680
|
-
return /* @__PURE__ */
|
4707
|
+
return /* @__PURE__ */ React36.createElement(Skeleton, {
|
4681
4708
|
height: 20,
|
4682
4709
|
width: 100,
|
4683
4710
|
className: tw("mb-[7px]")
|
@@ -4710,15 +4737,15 @@ var LabelControl = (_a) => {
|
|
4710
4737
|
]);
|
4711
4738
|
const legacyError = error2 !== void 0 && valid === false;
|
4712
4739
|
const variant = !valid || legacyError ? "error" : disabled ? "disabled" : "default";
|
4713
|
-
return /* @__PURE__ */
|
4740
|
+
return /* @__PURE__ */ React36.createElement(FormControl, null, !fieldset && /* @__PURE__ */ React36.createElement(Label, __spreadProps(__spreadValues({}, rest), {
|
4714
4741
|
variant
|
4715
|
-
}), children), fieldset && /* @__PURE__ */
|
4742
|
+
}), children), fieldset && /* @__PURE__ */ React36.createElement("fieldset", {
|
4716
4743
|
id: rest.id
|
4717
|
-
}, /* @__PURE__ */
|
4744
|
+
}, /* @__PURE__ */ React36.createElement("legend", {
|
4718
4745
|
className: tw("w-full mb-2")
|
4719
|
-
}, /* @__PURE__ */
|
4746
|
+
}, /* @__PURE__ */ React36.createElement(LabelText, __spreadProps(__spreadValues({}, rest), {
|
4720
4747
|
variant
|
4721
|
-
}))), children), /* @__PURE__ */
|
4748
|
+
}))), children), /* @__PURE__ */ React36.createElement(HelperText, {
|
4722
4749
|
messageId,
|
4723
4750
|
error: !valid,
|
4724
4751
|
helperText,
|
@@ -4727,7 +4754,7 @@ var LabelControl = (_a) => {
|
|
4727
4754
|
reserveSpaceForError
|
4728
4755
|
}));
|
4729
4756
|
};
|
4730
|
-
var LabelControlSkeleton = ({ children }) => /* @__PURE__ */
|
4757
|
+
var LabelControlSkeleton = ({ children }) => /* @__PURE__ */ React36.createElement("div", null, /* @__PURE__ */ React36.createElement(Label.Skeleton, null), children, /* @__PURE__ */ React36.createElement(HelperText.Skeleton, null));
|
4731
4758
|
LabelControl.Skeleton = LabelControlSkeleton;
|
4732
4759
|
var getLabelControlProps = (_a) => {
|
4733
4760
|
var _b = _a, {
|
@@ -4763,7 +4790,7 @@ var getLabelControlProps = (_a) => {
|
|
4763
4790
|
|
4764
4791
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4765
4792
|
var isCheckbox = (c) => {
|
4766
|
-
return
|
4793
|
+
return React37.isValidElement(c) && c.type === Checkbox2;
|
4767
4794
|
};
|
4768
4795
|
var CheckboxGroup = (_a) => {
|
4769
4796
|
var _b = _a, {
|
@@ -4795,11 +4822,11 @@ var CheckboxGroup = (_a) => {
|
|
4795
4822
|
setSelectedItems(updated);
|
4796
4823
|
onChange == null ? void 0 : onChange(updated);
|
4797
4824
|
};
|
4798
|
-
return /* @__PURE__ */
|
4825
|
+
return /* @__PURE__ */ React37.createElement(LabelControl, __spreadValues(__spreadValues({
|
4799
4826
|
fieldset: true
|
4800
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
4827
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React37.createElement(InputGroup, {
|
4801
4828
|
cols
|
4802
|
-
},
|
4829
|
+
}, React37.Children.map(children, (c) => {
|
4803
4830
|
var _a3, _b2;
|
4804
4831
|
if (!isCheckbox(c)) {
|
4805
4832
|
return null;
|
@@ -4807,7 +4834,7 @@ var CheckboxGroup = (_a) => {
|
|
4807
4834
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
4808
4835
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
4809
4836
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
4810
|
-
return
|
4837
|
+
return React37.cloneElement(c, {
|
4811
4838
|
defaultChecked,
|
4812
4839
|
checked,
|
4813
4840
|
onChange: (_b2 = c.props.onChange) != null ? _b2 : handleChange,
|
@@ -4817,9 +4844,9 @@ var CheckboxGroup = (_a) => {
|
|
4817
4844
|
})));
|
4818
4845
|
};
|
4819
4846
|
var CheckboxGroupSkeleton = ({ options = 2 }) => {
|
4820
|
-
return /* @__PURE__ */
|
4847
|
+
return /* @__PURE__ */ React37.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React37.createElement("div", {
|
4821
4848
|
className: tw("flex flex-wrap flex-col gap-2")
|
4822
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
4849
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React37.createElement(Checkbox2.Skeleton, {
|
4823
4850
|
key
|
4824
4851
|
}))));
|
4825
4852
|
};
|
@@ -4827,7 +4854,7 @@ CheckboxGroup.Skeleton = CheckboxGroupSkeleton;
|
|
4827
4854
|
CheckboxGroup.Skeleton.displayName = "CheckboxGroup.Skeleton";
|
4828
4855
|
|
4829
4856
|
// src/components/ChoiceChip/ChoiceChip.tsx
|
4830
|
-
import
|
4857
|
+
import React38, { useState as useState4 } from "react";
|
4831
4858
|
var ChoiceChip = (_a) => {
|
4832
4859
|
var _b = _a, { text, dense, defaultValue, value, onChange } = _b, rest = __objRest(_b, ["text", "dense", "defaultValue", "value", "onChange"]);
|
4833
4860
|
var _a2;
|
@@ -4841,7 +4868,7 @@ var ChoiceChip = (_a) => {
|
|
4841
4868
|
setSelected(!selected);
|
4842
4869
|
onChange == null ? void 0 : onChange(!selected);
|
4843
4870
|
};
|
4844
|
-
return /* @__PURE__ */
|
4871
|
+
return /* @__PURE__ */ React38.createElement("span", __spreadProps(__spreadValues({
|
4845
4872
|
role: "button",
|
4846
4873
|
"aria-pressed": selected
|
4847
4874
|
}, rest), {
|
@@ -4856,7 +4883,7 @@ var ChoiceChip = (_a) => {
|
|
4856
4883
|
};
|
4857
4884
|
|
4858
4885
|
// src/components/Combobox/Combobox.tsx
|
4859
|
-
import
|
4886
|
+
import React41, { useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "react";
|
4860
4887
|
import { useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
4861
4888
|
import { useCombobox } from "downshift";
|
4862
4889
|
import omit6 from "lodash/omit";
|
@@ -4864,21 +4891,21 @@ import uniqueId2 from "lodash/uniqueId";
|
|
4864
4891
|
import { matchSorter } from "match-sorter";
|
4865
4892
|
|
4866
4893
|
// src/components/Popover/PopoverWrapper.tsx
|
4867
|
-
import
|
4894
|
+
import React40 from "react";
|
4868
4895
|
import { FocusScope } from "@react-aria/focus";
|
4869
|
-
import {
|
4896
|
+
import { OverlayContainer as OverlayContainer2, useModal, useOverlay } from "@react-aria/overlays";
|
4870
4897
|
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
4871
4898
|
|
4872
4899
|
// src/common/Popover/Popover.tsx
|
4873
|
-
import
|
4874
|
-
var PopoverPanel =
|
4900
|
+
import React39 from "react";
|
4901
|
+
var PopoverPanel = React39.forwardRef((_a, ref) => {
|
4875
4902
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
4876
|
-
return /* @__PURE__ */
|
4903
|
+
return /* @__PURE__ */ React39.createElement("div", __spreadValues({
|
4877
4904
|
ref,
|
4878
4905
|
className: classNames(
|
4879
4906
|
className,
|
4880
4907
|
tw(
|
4881
|
-
"rounded-sm shadow-16dp bg-white mt-1 focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20"
|
4908
|
+
"rounded-sm shadow-16dp bg-white mt-1 overflow-y-auto flex flex-col focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20"
|
4882
4909
|
)
|
4883
4910
|
)
|
4884
4911
|
}, props), children);
|
@@ -4888,7 +4915,7 @@ var Popover = {
|
|
4888
4915
|
};
|
4889
4916
|
|
4890
4917
|
// src/components/Popover/PopoverWrapper.tsx
|
4891
|
-
var PopoverWrapper =
|
4918
|
+
var PopoverWrapper = React40.forwardRef((props, ref) => {
|
4892
4919
|
const _a = props, {
|
4893
4920
|
id,
|
4894
4921
|
children,
|
@@ -4928,19 +4955,17 @@ var PopoverWrapper = React39.forwardRef((props, ref) => {
|
|
4928
4955
|
if (!props.isOpen) {
|
4929
4956
|
return null;
|
4930
4957
|
}
|
4931
|
-
return /* @__PURE__ */
|
4958
|
+
return /* @__PURE__ */ React40.createElement(OverlayContainer2, null, /* @__PURE__ */ React40.createElement(FocusScope, {
|
4932
4959
|
restoreFocus: true,
|
4933
4960
|
autoFocus,
|
4934
4961
|
contain: containFocus
|
4935
|
-
}, /* @__PURE__ */
|
4962
|
+
}, /* @__PURE__ */ React40.createElement(Popover.Panel, __spreadProps(__spreadValues({
|
4936
4963
|
ref,
|
4937
4964
|
role: "dialog"
|
4938
4965
|
}, mergeProps2(otherProps, modalProps, overlayProps)), {
|
4939
4966
|
id: id != null ? id : overlayProps.id,
|
4940
4967
|
className
|
4941
|
-
}), children
|
4942
|
-
onDismiss: props.onClose
|
4943
|
-
}))));
|
4968
|
+
}), children)));
|
4944
4969
|
});
|
4945
4970
|
|
4946
4971
|
// src/components/Combobox/Combobox.tsx
|
@@ -5038,12 +5063,12 @@ var ComboboxBase = (_a) => {
|
|
5038
5063
|
const hasNoResults = options.length === 0 || inputItems.length === 0;
|
5039
5064
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
5040
5065
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
5041
|
-
return /* @__PURE__ */
|
5066
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
5042
5067
|
className: tw("relative")
|
5043
|
-
}, /* @__PURE__ */
|
5068
|
+
}, /* @__PURE__ */ React41.createElement(Select.InputContainer, {
|
5044
5069
|
ref: targetRef,
|
5045
5070
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
5046
|
-
}, /* @__PURE__ */
|
5071
|
+
}, /* @__PURE__ */ React41.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
5047
5072
|
id,
|
5048
5073
|
name,
|
5049
5074
|
placeholder: readOnly ? void 0 : placeholder
|
@@ -5065,26 +5090,25 @@ var ComboboxBase = (_a) => {
|
|
5065
5090
|
(_a3 = inputProps.onKeyDown) == null ? void 0 : _a3.call(inputProps, e);
|
5066
5091
|
},
|
5067
5092
|
onKeyUp: (e) => e.stopPropagation()
|
5068
|
-
})), !readOnly && /* @__PURE__ */
|
5093
|
+
})), !readOnly && /* @__PURE__ */ React41.createElement(Select.Toggle, __spreadValues({
|
5069
5094
|
hasFocus,
|
5070
5095
|
isOpen
|
5071
|
-
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */
|
5096
|
+
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */ React41.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
5072
5097
|
isOpen: true,
|
5073
5098
|
isDismissable: true,
|
5074
5099
|
autoFocus: true
|
5075
5100
|
}, getMenuProps({ ref: overlayRef })), {
|
5076
5101
|
style,
|
5077
|
-
onClose: closeMenu
|
5078
|
-
|
5079
|
-
}), /* @__PURE__ */ React40.createElement(Select.Menu, {
|
5102
|
+
onClose: closeMenu
|
5103
|
+
}), /* @__PURE__ */ React41.createElement(Select.Menu, {
|
5080
5104
|
maxHeight
|
5081
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
5105
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React41.createElement(Select.NoResults, null, noResults), isOpen && inputItems.map((item, index) => /* @__PURE__ */ React41.createElement(Select.Item, __spreadValues({
|
5082
5106
|
key: itemToString(item),
|
5083
5107
|
selected: item === selectedItem,
|
5084
5108
|
highlighted: index === highlightedIndex
|
5085
5109
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
5086
5110
|
};
|
5087
|
-
var ComboboxBaseSkeleton = () => /* @__PURE__ */
|
5111
|
+
var ComboboxBaseSkeleton = () => /* @__PURE__ */ React41.createElement(Skeleton, {
|
5088
5112
|
height: 38
|
5089
5113
|
});
|
5090
5114
|
ComboboxBase.Skeleton = ComboboxBaseSkeleton;
|
@@ -5102,11 +5126,11 @@ var Combobox = (_a) => {
|
|
5102
5126
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
5103
5127
|
const labelControlProps = getLabelControlProps(props);
|
5104
5128
|
const baseProps = omit6(props, Object.keys(labelControlProps));
|
5105
|
-
return /* @__PURE__ */
|
5129
|
+
return /* @__PURE__ */ React41.createElement(LabelControl, __spreadValues({
|
5106
5130
|
id: `${id.current}-label`,
|
5107
5131
|
htmlFor: `${id.current}-input`,
|
5108
5132
|
messageId: errorMessageId
|
5109
|
-
}, labelControlProps), /* @__PURE__ */
|
5133
|
+
}, labelControlProps), /* @__PURE__ */ React41.createElement(ComboboxBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
5110
5134
|
id: id.current,
|
5111
5135
|
options,
|
5112
5136
|
noResults,
|
@@ -5114,13 +5138,13 @@ var Combobox = (_a) => {
|
|
5114
5138
|
valid: props.valid
|
5115
5139
|
})));
|
5116
5140
|
};
|
5117
|
-
var ComboboxSkeleton = () => /* @__PURE__ */
|
5141
|
+
var ComboboxSkeleton = () => /* @__PURE__ */ React41.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React41.createElement(ComboboxBase.Skeleton, null));
|
5118
5142
|
Combobox.Skeleton = ComboboxSkeleton;
|
5119
5143
|
Combobox.Skeleton.displayName = "Combobox.Skeleton";
|
5120
5144
|
|
5121
5145
|
// src/components/Container/Container.tsx
|
5122
|
-
import
|
5123
|
-
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */
|
5146
|
+
import React42 from "react";
|
5147
|
+
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React42.createElement(Box, {
|
5124
5148
|
marginLeft: "auto",
|
5125
5149
|
marginRight: "auto",
|
5126
5150
|
width: "full",
|
@@ -5134,11 +5158,11 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React41.crea
|
|
5134
5158
|
}, children);
|
5135
5159
|
|
5136
5160
|
// src/components/DataList/DataList.tsx
|
5137
|
-
import
|
5161
|
+
import React48 from "react";
|
5138
5162
|
import orderBy2 from "lodash/orderBy";
|
5139
5163
|
|
5140
5164
|
// src/components/Template/Template.tsx
|
5141
|
-
import
|
5165
|
+
import React43 from "react";
|
5142
5166
|
var Template = ({
|
5143
5167
|
children,
|
5144
5168
|
columns,
|
@@ -5164,23 +5188,23 @@ var Template = ({
|
|
5164
5188
|
rowGap,
|
5165
5189
|
columnGap
|
5166
5190
|
});
|
5167
|
-
return /* @__PURE__ */
|
5191
|
+
return /* @__PURE__ */ React43.createElement("div", {
|
5168
5192
|
style: __spreadValues({}, styles)
|
5169
5193
|
}, children);
|
5170
5194
|
};
|
5171
5195
|
|
5172
5196
|
// src/common/DataList/DataList.tsx
|
5173
|
-
import
|
5197
|
+
import React46 from "react";
|
5174
5198
|
|
5175
5199
|
// src/common/Table/Table.tsx
|
5176
|
-
import
|
5200
|
+
import React45 from "react";
|
5177
5201
|
|
5178
5202
|
// src/common/RadioButton/RadioButton.tsx
|
5179
|
-
import
|
5180
|
-
var RadioButton =
|
5203
|
+
import React44 from "react";
|
5204
|
+
var RadioButton = React44.forwardRef(
|
5181
5205
|
(_a, ref) => {
|
5182
5206
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
5183
|
-
return /* @__PURE__ */
|
5207
|
+
return /* @__PURE__ */ React44.createElement("input", __spreadProps(__spreadValues({
|
5184
5208
|
id,
|
5185
5209
|
ref,
|
5186
5210
|
type: "radio",
|
@@ -5206,29 +5230,29 @@ var RadioButton = React43.forwardRef(
|
|
5206
5230
|
// src/common/Table/Table.tsx
|
5207
5231
|
var import_chevronDown3 = __toESM(require_chevronDown());
|
5208
5232
|
var import_chevronUp2 = __toESM(require_chevronUp());
|
5209
|
-
var HeadContext =
|
5233
|
+
var HeadContext = React45.createContext(null);
|
5210
5234
|
var tableClassNames = tw("w-full relative typography-default border-spacing-0");
|
5211
5235
|
var Table = (_a) => {
|
5212
5236
|
var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
|
5213
|
-
return /* @__PURE__ */
|
5237
|
+
return /* @__PURE__ */ React45.createElement("table", __spreadProps(__spreadValues({}, rest), {
|
5214
5238
|
className: classNames(tableClassNames, className),
|
5215
5239
|
"aria-label": ariaLabel
|
5216
5240
|
}), children);
|
5217
5241
|
};
|
5218
5242
|
var TableHead = (_a) => {
|
5219
5243
|
var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
|
5220
|
-
return /* @__PURE__ */
|
5244
|
+
return /* @__PURE__ */ React45.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React45.createElement("tr", null, /* @__PURE__ */ React45.createElement(HeadContext.Provider, {
|
5221
5245
|
value: { children, sticky }
|
5222
5246
|
}, children)));
|
5223
5247
|
};
|
5224
5248
|
var TableBody = (_a) => {
|
5225
5249
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5226
|
-
return /* @__PURE__ */
|
5250
|
+
return /* @__PURE__ */ React45.createElement("tbody", __spreadValues({}, rest), children);
|
5227
5251
|
};
|
5228
5252
|
var rowClassNames = tw("children:border-grey-10 children:last:border-b-0 hover:bg-grey-0");
|
5229
5253
|
var TableRow = (_a) => {
|
5230
5254
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5231
|
-
return /* @__PURE__ */
|
5255
|
+
return /* @__PURE__ */ React45.createElement("tr", __spreadProps(__spreadValues({}, rest), {
|
5232
5256
|
className: classNames(rowClassNames, className)
|
5233
5257
|
}), children);
|
5234
5258
|
};
|
@@ -5244,25 +5268,25 @@ var getHeadCellClassNames = (sticky = true) => {
|
|
5244
5268
|
};
|
5245
5269
|
var TableCell = (_a) => {
|
5246
5270
|
var _b = _a, { children, className, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "align"]);
|
5247
|
-
const headContext =
|
5248
|
-
return headContext ? /* @__PURE__ */
|
5271
|
+
const headContext = React45.useContext(HeadContext);
|
5272
|
+
return headContext ? /* @__PURE__ */ React45.createElement("th", __spreadProps(__spreadValues({}, rest), {
|
5249
5273
|
className: classNames(
|
5250
5274
|
cellClassNames,
|
5251
5275
|
getHeadCellClassNames(headContext.sticky),
|
5252
5276
|
getAlignClassNames(align),
|
5253
5277
|
className
|
5254
5278
|
)
|
5255
|
-
}), children) : /* @__PURE__ */
|
5279
|
+
}), children) : /* @__PURE__ */ React45.createElement("td", __spreadProps(__spreadValues({}, rest), {
|
5256
5280
|
className: classNames(cellClassNames, getBodyCellClassNames(), getAlignClassNames(align), className)
|
5257
5281
|
}), children);
|
5258
5282
|
};
|
5259
5283
|
var TableSelectCell = (_a) => {
|
5260
5284
|
var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
|
5261
|
-
return /* @__PURE__ */
|
5285
|
+
return /* @__PURE__ */ React45.createElement(Table.Cell, {
|
5262
5286
|
className: tw("leading-[0px]")
|
5263
|
-
}, props.type === "radio" ? /* @__PURE__ */
|
5287
|
+
}, props.type === "radio" ? /* @__PURE__ */ React45.createElement(RadioButton, __spreadValues({
|
5264
5288
|
"aria-label": ariaLabel
|
5265
|
-
}, props)) : /* @__PURE__ */
|
5289
|
+
}, props)) : /* @__PURE__ */ React45.createElement(Checkbox, __spreadValues({
|
5266
5290
|
"aria-label": ariaLabel
|
5267
5291
|
}, props)));
|
5268
5292
|
};
|
@@ -5272,39 +5296,39 @@ var getSortCellIconClassNames = (active) => {
|
|
5272
5296
|
};
|
5273
5297
|
var TableSortCell = (_a) => {
|
5274
5298
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5275
|
-
return /* @__PURE__ */
|
5299
|
+
return /* @__PURE__ */ React45.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
|
5276
5300
|
"aria-sort": direction
|
5277
|
-
}), /* @__PURE__ */
|
5301
|
+
}), /* @__PURE__ */ React45.createElement("span", {
|
5278
5302
|
className: getSortCellButtonClassNames(rest.align),
|
5279
5303
|
role: "button",
|
5280
5304
|
tabIndex: -1,
|
5281
5305
|
onClick
|
5282
|
-
}, children, /* @__PURE__ */
|
5306
|
+
}, children, /* @__PURE__ */ React45.createElement("div", {
|
5283
5307
|
"data-sort-icons": true,
|
5284
5308
|
className: tw("flex flex-col", {
|
5285
5309
|
"invisible group-hover:visible": direction === "none"
|
5286
5310
|
})
|
5287
|
-
}, /* @__PURE__ */
|
5311
|
+
}, /* @__PURE__ */ React45.createElement(InlineIcon, {
|
5288
5312
|
icon: import_chevronUp2.default,
|
5289
5313
|
className: getSortCellIconClassNames(direction === "descending")
|
5290
|
-
}), /* @__PURE__ */
|
5314
|
+
}), /* @__PURE__ */ React45.createElement(InlineIcon, {
|
5291
5315
|
icon: import_chevronDown3.default,
|
5292
5316
|
className: getSortCellIconClassNames(direction === "ascending")
|
5293
5317
|
}))));
|
5294
5318
|
};
|
5295
|
-
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */
|
5319
|
+
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React45.createElement("div", {
|
5296
5320
|
className: tw("flex gap-4 items-center")
|
5297
|
-
}, image && /* @__PURE__ */
|
5321
|
+
}, image && /* @__PURE__ */ React45.createElement("img", {
|
5298
5322
|
src: image,
|
5299
5323
|
alt: imageAlt,
|
5300
5324
|
style: { width: imageSize, height: imageSize }
|
5301
|
-
}), /* @__PURE__ */
|
5302
|
-
Table.Head =
|
5303
|
-
Table.Body =
|
5304
|
-
Table.Row =
|
5305
|
-
Table.Cell =
|
5306
|
-
Table.SortCell =
|
5307
|
-
Table.SelectCell =
|
5325
|
+
}), /* @__PURE__ */ React45.createElement("div", null, title, caption && /* @__PURE__ */ React45.createElement(Typography2.Caption, null, caption)));
|
5326
|
+
Table.Head = React45.memo(TableHead);
|
5327
|
+
Table.Body = React45.memo(TableBody);
|
5328
|
+
Table.Row = React45.memo(TableRow);
|
5329
|
+
Table.Cell = React45.memo(TableCell);
|
5330
|
+
Table.SortCell = React45.memo(TableSortCell);
|
5331
|
+
Table.SelectCell = React45.memo(TableSelectCell);
|
5308
5332
|
|
5309
5333
|
// src/common/DataList/DataList.tsx
|
5310
5334
|
var import_chevronDown4 = __toESM(require_chevronDown());
|
@@ -5316,7 +5340,7 @@ var getAlignClassNames2 = (align) => tw("flex items-center", {
|
|
5316
5340
|
});
|
5317
5341
|
var DataList = (_a) => {
|
5318
5342
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5319
|
-
return /* @__PURE__ */
|
5343
|
+
return /* @__PURE__ */ React46.createElement("div", __spreadValues({}, rest));
|
5320
5344
|
};
|
5321
5345
|
var HeadCell = (_a) => {
|
5322
5346
|
var _b = _a, {
|
@@ -5328,14 +5352,14 @@ var HeadCell = (_a) => {
|
|
5328
5352
|
"sticky",
|
5329
5353
|
"align"
|
5330
5354
|
]);
|
5331
|
-
return /* @__PURE__ */
|
5355
|
+
return /* @__PURE__ */ React46.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5332
5356
|
role: "cell",
|
5333
5357
|
className: classNames(cellClassNames, getHeadCellClassNames(sticky), getAlignClassNames2(align), className)
|
5334
5358
|
}));
|
5335
5359
|
};
|
5336
5360
|
var Cell = (_a) => {
|
5337
5361
|
var _b = _a, { className, align } = _b, rest = __objRest(_b, ["className", "align"]);
|
5338
|
-
return /* @__PURE__ */
|
5362
|
+
return /* @__PURE__ */ React46.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5339
5363
|
role: "cell",
|
5340
5364
|
className: classNames(
|
5341
5365
|
cellClassNames,
|
@@ -5348,31 +5372,31 @@ var Cell = (_a) => {
|
|
5348
5372
|
};
|
5349
5373
|
var Row = (_a) => {
|
5350
5374
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5351
|
-
return /* @__PURE__ */
|
5375
|
+
return /* @__PURE__ */ React46.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5352
5376
|
className: classNames(tw("contents group"), className),
|
5353
5377
|
role: "row"
|
5354
5378
|
}));
|
5355
5379
|
};
|
5356
5380
|
var SortCell = (_a) => {
|
5357
5381
|
var _b = _a, { children, direction = "none", onClick, sticky } = _b, rest = __objRest(_b, ["children", "direction", "onClick", "sticky"]);
|
5358
|
-
return /* @__PURE__ */
|
5382
|
+
return /* @__PURE__ */ React46.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
|
5359
5383
|
"aria-sort": direction,
|
5360
5384
|
role: "cell",
|
5361
5385
|
sticky
|
5362
|
-
}), /* @__PURE__ */
|
5386
|
+
}), /* @__PURE__ */ React46.createElement("span", {
|
5363
5387
|
className: getSortCellButtonClassNames(rest.align),
|
5364
5388
|
role: "button",
|
5365
5389
|
tabIndex: -1,
|
5366
5390
|
onClick
|
5367
|
-
}, children, /* @__PURE__ */
|
5391
|
+
}, children, /* @__PURE__ */ React46.createElement("div", {
|
5368
5392
|
"data-sort-icons": true,
|
5369
5393
|
className: tw("flex flex-col", {
|
5370
5394
|
"invisible group-hover:visible": direction === "none"
|
5371
5395
|
})
|
5372
|
-
}, /* @__PURE__ */
|
5396
|
+
}, /* @__PURE__ */ React46.createElement(InlineIcon, {
|
5373
5397
|
icon: import_chevronUp3.default,
|
5374
5398
|
className: getSortCellIconClassNames(direction === "descending")
|
5375
|
-
}), /* @__PURE__ */
|
5399
|
+
}), /* @__PURE__ */ React46.createElement(InlineIcon, {
|
5376
5400
|
icon: import_chevronDown4.default,
|
5377
5401
|
className: getSortCellIconClassNames(direction === "ascending")
|
5378
5402
|
}))));
|
@@ -5398,9 +5422,9 @@ var cellProps = (column) => ({
|
|
5398
5422
|
});
|
5399
5423
|
|
5400
5424
|
// src/utils/table/useTableSort.tsx
|
5401
|
-
import
|
5425
|
+
import React47 from "react";
|
5402
5426
|
var useTableSort = () => {
|
5403
|
-
const [sort, setSort] =
|
5427
|
+
const [sort, setSort] = React47.useState();
|
5404
5428
|
const handleSortClick = (field) => {
|
5405
5429
|
if ((sort == null ? void 0 : sort.key) === field) {
|
5406
5430
|
if (sort.direction === "ascending") {
|
@@ -5423,43 +5447,43 @@ var DataList2 = ({ columns, rows, sticky }) => {
|
|
5423
5447
|
var _a;
|
5424
5448
|
return (_a = column.width) != null ? _a : "auto";
|
5425
5449
|
});
|
5426
|
-
return /* @__PURE__ */
|
5450
|
+
return /* @__PURE__ */ React48.createElement(Template, {
|
5427
5451
|
columns: templateColumns
|
5428
5452
|
}, columns.map(
|
5429
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5453
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React48.createElement(DataList.SortCell, __spreadValues({
|
5430
5454
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5431
5455
|
onClick: () => updateSort(column.field),
|
5432
5456
|
sticky
|
5433
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
5457
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React48.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5434
5458
|
sticky
|
5435
5459
|
}), column.headerName)
|
5436
|
-
), /* @__PURE__ */
|
5460
|
+
), /* @__PURE__ */ React48.createElement(List, {
|
5437
5461
|
items: sortedRows,
|
5438
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5462
|
+
renderItem: (row, index) => /* @__PURE__ */ React48.createElement(DataList.Row, {
|
5439
5463
|
key: row.id
|
5440
|
-
}, /* @__PURE__ */
|
5464
|
+
}, /* @__PURE__ */ React48.createElement(List, {
|
5441
5465
|
items: columns,
|
5442
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5466
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(StatusChip, __spreadValues({
|
5443
5467
|
dense: true
|
5444
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5468
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(SecondaryButton, __spreadValues({
|
5445
5469
|
dense: true
|
5446
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5470
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React48.createElement(DataList.Cell, null, /* @__PURE__ */ React48.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
5447
5471
|
}))
|
5448
5472
|
}));
|
5449
5473
|
};
|
5450
5474
|
|
5451
5475
|
// src/components/DataTable/DataTable.tsx
|
5452
|
-
import
|
5476
|
+
import React51 from "react";
|
5453
5477
|
import orderBy3 from "lodash/orderBy";
|
5454
5478
|
|
5455
5479
|
// src/components/Table/Table.tsx
|
5456
|
-
import
|
5480
|
+
import React50 from "react";
|
5457
5481
|
|
5458
5482
|
// src/utils/table/useScrollTarget.ts
|
5459
|
-
import
|
5483
|
+
import React49 from "react";
|
5460
5484
|
var useScrollTarget = (callback) => {
|
5461
|
-
const targetRef =
|
5462
|
-
|
5485
|
+
const targetRef = React49.useRef(null);
|
5486
|
+
React49.useLayoutEffect(() => {
|
5463
5487
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
5464
5488
|
root: null,
|
5465
5489
|
rootMargin: `0px 0px 200px 0px`
|
@@ -5477,12 +5501,12 @@ var Table2 = (_a) => {
|
|
5477
5501
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
5478
5502
|
const bottomRef = useScrollTarget(onNext);
|
5479
5503
|
const topRef = useScrollTarget(onPrev);
|
5480
|
-
return /* @__PURE__ */
|
5504
|
+
return /* @__PURE__ */ React50.createElement("div", {
|
5481
5505
|
className: "relative w-full"
|
5482
|
-
}, /* @__PURE__ */
|
5506
|
+
}, /* @__PURE__ */ React50.createElement("div", {
|
5483
5507
|
ref: topRef,
|
5484
5508
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
5485
|
-
}), /* @__PURE__ */
|
5509
|
+
}), /* @__PURE__ */ React50.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React50.createElement("div", {
|
5486
5510
|
ref: bottomRef,
|
5487
5511
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
5488
5512
|
}));
|
@@ -5511,41 +5535,41 @@ var DataTable = (_a) => {
|
|
5511
5535
|
]);
|
5512
5536
|
const [sort, updateSort] = useTableSort();
|
5513
5537
|
const sortedRows = orderBy3(rows, [sort == null ? void 0 : sort.key], [toSortDirection(sort == null ? void 0 : sort.direction)]);
|
5514
|
-
return /* @__PURE__ */
|
5538
|
+
return /* @__PURE__ */ React51.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
5515
5539
|
className: tw({
|
5516
5540
|
"whitespace-nowrap": noWrap,
|
5517
5541
|
"table-auto": layout === "auto",
|
5518
5542
|
"table-fixed": layout === "fixed"
|
5519
5543
|
})
|
5520
|
-
}), /* @__PURE__ */
|
5544
|
+
}), /* @__PURE__ */ React51.createElement(Table2.Head, {
|
5521
5545
|
sticky
|
5522
5546
|
}, columns.map(
|
5523
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5547
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React51.createElement(Table2.SortCell, __spreadValues({
|
5524
5548
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5525
5549
|
onClick: () => updateSort(column.field),
|
5526
5550
|
style: { width: column.width },
|
5527
5551
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
5528
|
-
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */
|
5552
|
+
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5529
5553
|
style: { width: column.width },
|
5530
5554
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
5531
5555
|
}), !column.headerInvisible && column.headerName)
|
5532
|
-
)), /* @__PURE__ */
|
5556
|
+
)), /* @__PURE__ */ React51.createElement(Table2.Body, null, /* @__PURE__ */ React51.createElement(List, {
|
5533
5557
|
items: sortedRows,
|
5534
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5558
|
+
renderItem: (row, index) => /* @__PURE__ */ React51.createElement(Table2.Row, {
|
5535
5559
|
key: row.id
|
5536
|
-
}, /* @__PURE__ */
|
5560
|
+
}, /* @__PURE__ */ React51.createElement(List, {
|
5537
5561
|
items: columns,
|
5538
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5562
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React51.createElement(StatusChip, __spreadValues({
|
5539
5563
|
dense: true
|
5540
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5564
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React51.createElement(SecondaryButton, __spreadValues({
|
5541
5565
|
dense: true
|
5542
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5566
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React51.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
5543
5567
|
}))
|
5544
5568
|
})));
|
5545
5569
|
};
|
5546
5570
|
|
5547
5571
|
// src/components/Dialog/Dialog.tsx
|
5548
|
-
import
|
5572
|
+
import React53 from "react";
|
5549
5573
|
import { useDialog } from "@react-aria/dialog";
|
5550
5574
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
5551
5575
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
@@ -5573,10 +5597,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
5573
5597
|
};
|
5574
5598
|
|
5575
5599
|
// src/common/Modal/Modal.tsx
|
5576
|
-
import
|
5600
|
+
import React52 from "react";
|
5577
5601
|
var Modal = (_a) => {
|
5578
5602
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
5579
|
-
return open ? /* @__PURE__ */
|
5603
|
+
return open ? /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5580
5604
|
className: classNames(
|
5581
5605
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
5582
5606
|
className
|
@@ -5585,14 +5609,14 @@ var Modal = (_a) => {
|
|
5585
5609
|
};
|
5586
5610
|
Modal.BackDrop = (_a) => {
|
5587
5611
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5588
|
-
return /* @__PURE__ */
|
5612
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5589
5613
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
5590
5614
|
}));
|
5591
5615
|
};
|
5592
|
-
Modal.Dialog =
|
5616
|
+
Modal.Dialog = React52.forwardRef(
|
5593
5617
|
(_a, ref) => {
|
5594
5618
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
5595
|
-
return /* @__PURE__ */
|
5619
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({
|
5596
5620
|
ref,
|
5597
5621
|
"aria-modal": "true"
|
5598
5622
|
}, rest), {
|
@@ -5610,31 +5634,31 @@ Modal.Dialog = React51.forwardRef(
|
|
5610
5634
|
);
|
5611
5635
|
Modal.Header = (_a) => {
|
5612
5636
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5613
|
-
return /* @__PURE__ */
|
5637
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5614
5638
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
5615
5639
|
}), children);
|
5616
5640
|
};
|
5617
5641
|
Modal.HeaderImage = (_a) => {
|
5618
5642
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
5619
5643
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
5620
|
-
return backgroundImage ? /* @__PURE__ */
|
5644
|
+
return backgroundImage ? /* @__PURE__ */ React52.createElement("img", __spreadProps(__spreadValues({
|
5621
5645
|
"aria-hidden": true,
|
5622
5646
|
src: backgroundImage != null ? backgroundImage : void 0
|
5623
5647
|
}, rest), {
|
5624
5648
|
className: classNames(common, tw("object-cover"), className)
|
5625
|
-
})) : /* @__PURE__ */
|
5649
|
+
})) : /* @__PURE__ */ React52.createElement("div", {
|
5626
5650
|
className: classNames(common, tw("bg-grey-5"), className)
|
5627
5651
|
});
|
5628
5652
|
};
|
5629
5653
|
Modal.CloseButtonContainer = (_a) => {
|
5630
5654
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5631
|
-
return /* @__PURE__ */
|
5655
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5632
5656
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
5633
5657
|
}));
|
5634
5658
|
};
|
5635
5659
|
Modal.Title = (_a) => {
|
5636
5660
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5637
|
-
return /* @__PURE__ */
|
5661
|
+
return /* @__PURE__ */ React52.createElement(Typography, __spreadValues({
|
5638
5662
|
htmlTag: "h2",
|
5639
5663
|
variant: "subheading",
|
5640
5664
|
color: "grey-90",
|
@@ -5643,33 +5667,33 @@ Modal.Title = (_a) => {
|
|
5643
5667
|
};
|
5644
5668
|
Modal.Subtitle = (_a) => {
|
5645
5669
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5646
|
-
return /* @__PURE__ */
|
5670
|
+
return /* @__PURE__ */ React52.createElement(Typography, __spreadValues({
|
5647
5671
|
variant: "small",
|
5648
5672
|
color: "grey-60"
|
5649
5673
|
}, rest), children);
|
5650
5674
|
};
|
5651
5675
|
Modal.TitleContainer = (_a) => {
|
5652
5676
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5653
|
-
return /* @__PURE__ */
|
5677
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5654
5678
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
5655
5679
|
}), children);
|
5656
5680
|
};
|
5657
5681
|
Modal.Body = (_a) => {
|
5658
5682
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
5659
|
-
return /* @__PURE__ */
|
5683
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5660
5684
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
5661
5685
|
style: __spreadValues({ maxHeight }, style)
|
5662
5686
|
}), children);
|
5663
5687
|
};
|
5664
5688
|
Modal.Footer = (_a) => {
|
5665
5689
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5666
|
-
return /* @__PURE__ */
|
5690
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5667
5691
|
className: classNames(tw("px-7 py-6"), className)
|
5668
5692
|
}), children);
|
5669
5693
|
};
|
5670
5694
|
Modal.Actions = (_a) => {
|
5671
5695
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5672
|
-
return /* @__PURE__ */
|
5696
|
+
return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5673
5697
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
5674
5698
|
}), children);
|
5675
5699
|
};
|
@@ -5683,7 +5707,7 @@ var Dialog = ({
|
|
5683
5707
|
primaryAction,
|
5684
5708
|
secondaryAction
|
5685
5709
|
}) => {
|
5686
|
-
const ref =
|
5710
|
+
const ref = React53.useRef(null);
|
5687
5711
|
const state = useOverlayTriggerState2({ isOpen: open });
|
5688
5712
|
const { modalProps, underlayProps } = useModalOverlay({ isDismissable: false }, state, ref);
|
5689
5713
|
const labelledBy = useId();
|
@@ -5695,34 +5719,34 @@ var Dialog = ({
|
|
5695
5719
|
if (!open) {
|
5696
5720
|
return null;
|
5697
5721
|
}
|
5698
|
-
return /* @__PURE__ */
|
5722
|
+
return /* @__PURE__ */ React53.createElement(Overlay, null, /* @__PURE__ */ React53.createElement(Modal, {
|
5699
5723
|
open
|
5700
|
-
}, /* @__PURE__ */
|
5724
|
+
}, /* @__PURE__ */ React53.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React53.createElement(FocusScope2, {
|
5701
5725
|
contain: true,
|
5702
5726
|
restoreFocus: true,
|
5703
5727
|
autoFocus: true
|
5704
|
-
}, /* @__PURE__ */
|
5728
|
+
}, /* @__PURE__ */ React53.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
5705
5729
|
ref,
|
5706
5730
|
size: "sm"
|
5707
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
5731
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React53.createElement(Modal.Header, null, /* @__PURE__ */ React53.createElement(Icon, {
|
5708
5732
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
5709
5733
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
5710
5734
|
fontSize: 20
|
5711
|
-
}), /* @__PURE__ */
|
5735
|
+
}), /* @__PURE__ */ React53.createElement(Modal.Title, {
|
5712
5736
|
id: labelledBy,
|
5713
5737
|
variant: "large-strong",
|
5714
5738
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
5715
|
-
}, title)), /* @__PURE__ */
|
5739
|
+
}, title)), /* @__PURE__ */ React53.createElement(Modal.Body, {
|
5716
5740
|
id: describedBy
|
5717
|
-
}, children), /* @__PURE__ */
|
5741
|
+
}, children), /* @__PURE__ */ React53.createElement(Modal.Footer, null, /* @__PURE__ */ React53.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React53.createElement(GhostButton, __spreadValues({
|
5718
5742
|
key: secondaryAction.text
|
5719
|
-
}, omit7(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
5743
|
+
}, omit7(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React53.createElement(SecondaryButton, __spreadValues({
|
5720
5744
|
key: primaryAction.text
|
5721
5745
|
}, omit7(primaryAction, "text")), primaryAction.text)))))));
|
5722
5746
|
};
|
5723
5747
|
|
5724
5748
|
// src/components/Divider/Divider.tsx
|
5725
|
-
import
|
5749
|
+
import React54 from "react";
|
5726
5750
|
var sizeClasses = {
|
5727
5751
|
horizontal: {
|
5728
5752
|
1: "h-1px",
|
@@ -5744,7 +5768,7 @@ var sizeClasses = {
|
|
5744
5768
|
var Divider2 = (_a) => {
|
5745
5769
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
5746
5770
|
const sizeClass = sizeClasses[direction][size];
|
5747
|
-
return /* @__PURE__ */
|
5771
|
+
return /* @__PURE__ */ React54.createElement("div", __spreadProps(__spreadValues({}, props), {
|
5748
5772
|
className: tw(`bg-grey-5 ${sizeClass}`, {
|
5749
5773
|
"block w-full": direction === "horizontal",
|
5750
5774
|
"inline-block h-full": direction === "vertical"
|
@@ -5753,10 +5777,10 @@ var Divider2 = (_a) => {
|
|
5753
5777
|
};
|
5754
5778
|
|
5755
5779
|
// src/components/Dropdown/Dropdown.tsx
|
5756
|
-
import
|
5780
|
+
import React56 from "react";
|
5757
5781
|
|
5758
5782
|
// src/components/Popover/Popover.tsx
|
5759
|
-
import
|
5783
|
+
import React55, { useRef as useRef6 } from "react";
|
5760
5784
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
5761
5785
|
import { useOverlayPosition as useOverlayPosition3, useOverlayTrigger } from "@react-aria/overlays";
|
5762
5786
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -5805,22 +5829,22 @@ var Popover2 = (props) => {
|
|
5805
5829
|
state,
|
5806
5830
|
triggerRef
|
5807
5831
|
);
|
5808
|
-
return /* @__PURE__ */
|
5832
|
+
return /* @__PURE__ */ React55.createElement(PopoverContext.Provider, {
|
5809
5833
|
value: {
|
5810
5834
|
state
|
5811
5835
|
}
|
5812
|
-
},
|
5836
|
+
}, React55.Children.map(props.children, (child) => {
|
5813
5837
|
if (isComponentType(child, Popover2.Trigger)) {
|
5814
|
-
return /* @__PURE__ */
|
5838
|
+
return /* @__PURE__ */ React55.createElement(PressResponder, __spreadValues({
|
5815
5839
|
ref: triggerRef,
|
5816
5840
|
onPress: state.toggle
|
5817
|
-
}, triggerProps), /* @__PURE__ */
|
5841
|
+
}, triggerProps), /* @__PURE__ */ React55.createElement(PopoverTriggerWrapper, {
|
5818
5842
|
"data-testid": props["data-testid"],
|
5819
5843
|
"aria-controls": id
|
5820
5844
|
}, child.props.children));
|
5821
5845
|
}
|
5822
5846
|
if (isComponentType(child, Popover2.Panel)) {
|
5823
|
-
return /* @__PURE__ */
|
5847
|
+
return /* @__PURE__ */ React55.createElement(PopoverWrapper, __spreadProps(__spreadValues(__spreadValues({
|
5824
5848
|
ref: overlayRef,
|
5825
5849
|
isOpen: state.isOpen,
|
5826
5850
|
onClose: state.close,
|
@@ -5852,7 +5876,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
5852
5876
|
state.close();
|
5853
5877
|
onClick == null ? void 0 : onClick(e);
|
5854
5878
|
};
|
5855
|
-
return /* @__PURE__ */
|
5879
|
+
return /* @__PURE__ */ React55.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
5856
5880
|
onClick: handleClick
|
5857
5881
|
}));
|
5858
5882
|
};
|
@@ -5865,9 +5889,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5865
5889
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5866
5890
|
var _a2;
|
5867
5891
|
const ref = useRef6(null);
|
5868
|
-
const trigger =
|
5892
|
+
const trigger = React55.Children.only(children);
|
5869
5893
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
|
5870
|
-
return
|
5894
|
+
return React55.cloneElement(trigger, __spreadProps(__spreadValues({
|
5871
5895
|
"ref": ref
|
5872
5896
|
}, mergeProps3(pressProps, trigger.props)), {
|
5873
5897
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -5876,11 +5900,11 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5876
5900
|
|
5877
5901
|
// src/components/Dropdown/Dropdown.tsx
|
5878
5902
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
5879
|
-
return /* @__PURE__ */
|
5903
|
+
return /* @__PURE__ */ React56.createElement(Popover2, {
|
5880
5904
|
type: "menu",
|
5881
5905
|
placement,
|
5882
5906
|
autoFocus: true
|
5883
|
-
}, /* @__PURE__ */
|
5907
|
+
}, /* @__PURE__ */ React56.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React56.createElement(Popover2.Panel, null, content));
|
5884
5908
|
};
|
5885
5909
|
var DropdownMenu = ({
|
5886
5910
|
title,
|
@@ -5889,26 +5913,26 @@ var DropdownMenu = ({
|
|
5889
5913
|
triggerId,
|
5890
5914
|
setClose = () => void 0
|
5891
5915
|
}) => {
|
5892
|
-
const menuRef =
|
5893
|
-
|
5916
|
+
const menuRef = React56.useRef(null);
|
5917
|
+
React56.useEffect(() => {
|
5894
5918
|
const id = setTimeout(() => {
|
5895
5919
|
var _a, _b, _c;
|
5896
5920
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
5897
5921
|
});
|
5898
5922
|
return () => clearTimeout(id);
|
5899
5923
|
}, [menuRef.current]);
|
5900
|
-
return /* @__PURE__ */
|
5924
|
+
return /* @__PURE__ */ React56.createElement("div", {
|
5901
5925
|
style: { minWidth: "250px" },
|
5902
5926
|
className: tw("py-3 bg-white")
|
5903
|
-
}, !!title && /* @__PURE__ */
|
5927
|
+
}, !!title && /* @__PURE__ */ React56.createElement("div", {
|
5904
5928
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
5905
|
-
}, title), /* @__PURE__ */
|
5929
|
+
}, title), /* @__PURE__ */ React56.createElement("ol", {
|
5906
5930
|
role: "menu",
|
5907
5931
|
ref: menuRef,
|
5908
5932
|
id: contentId,
|
5909
5933
|
"aria-labelledby": triggerId
|
5910
|
-
},
|
5911
|
-
return
|
5934
|
+
}, React56.Children.map(children, (child) => {
|
5935
|
+
return React56.cloneElement(child, { setClose });
|
5912
5936
|
})));
|
5913
5937
|
};
|
5914
5938
|
var DropdownItem = (_a) => {
|
@@ -5963,10 +5987,10 @@ var DropdownItem = (_a) => {
|
|
5963
5987
|
handleSelect();
|
5964
5988
|
}
|
5965
5989
|
};
|
5966
|
-
const itemContent = /* @__PURE__ */
|
5990
|
+
const itemContent = /* @__PURE__ */ React56.createElement("div", {
|
5967
5991
|
className: tw("py-3 px-4")
|
5968
5992
|
}, children);
|
5969
|
-
return /* @__PURE__ */
|
5993
|
+
return /* @__PURE__ */ React56.createElement("li", __spreadProps(__spreadValues({
|
5970
5994
|
role: "menuitem",
|
5971
5995
|
tabIndex: -1,
|
5972
5996
|
onClick: handleClick,
|
@@ -5977,7 +6001,7 @@ var DropdownItem = (_a) => {
|
|
5977
6001
|
"text-grey-10 cursor-not-allowed": disabled,
|
5978
6002
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
5979
6003
|
})
|
5980
|
-
}), tooltip ? /* @__PURE__ */
|
6004
|
+
}), tooltip ? /* @__PURE__ */ React56.createElement(Tooltip, {
|
5981
6005
|
content: tooltip,
|
5982
6006
|
placement: tooltipPlacement,
|
5983
6007
|
inline: false
|
@@ -5987,7 +6011,7 @@ Dropdown.Menu = DropdownMenu;
|
|
5987
6011
|
Dropdown.Item = DropdownItem;
|
5988
6012
|
|
5989
6013
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
5990
|
-
import
|
6014
|
+
import React60 from "react";
|
5991
6015
|
import { useFilter } from "@react-aria/i18n";
|
5992
6016
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
5993
6017
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
@@ -5999,37 +6023,37 @@ import { useMenuTriggerState } from "@react-stately/menu";
|
|
5999
6023
|
import { useTreeState } from "@react-stately/tree";
|
6000
6024
|
|
6001
6025
|
// src/components/Input/Input.tsx
|
6002
|
-
import
|
6026
|
+
import React58, { forwardRef, useImperativeHandle, useRef as useRef7, useState as useState6 } from "react";
|
6003
6027
|
import omit8 from "lodash/omit";
|
6004
6028
|
import toString from "lodash/toString";
|
6005
6029
|
import uniqueId3 from "lodash/uniqueId";
|
6006
6030
|
|
6007
6031
|
// src/utils/form/InputAdornment/InputAdornment.tsx
|
6008
|
-
import
|
6032
|
+
import React57 from "react";
|
6009
6033
|
var import_cross4 = __toESM(require_cross());
|
6010
6034
|
var import_error3 = __toESM(require_error());
|
6011
6035
|
var import_search2 = __toESM(require_search());
|
6012
6036
|
var import_tick3 = __toESM(require_tick());
|
6013
6037
|
var InputAdornment = ({ placement = "right", className, dense, children }) => {
|
6014
|
-
return /* @__PURE__ */
|
6038
|
+
return /* @__PURE__ */ React57.createElement("span", {
|
6015
6039
|
className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
|
6016
6040
|
"right-0": placement === "right",
|
6017
6041
|
"left-0": placement === "left",
|
6018
6042
|
"typography-small": dense,
|
6019
6043
|
"typography-default-strong": !dense
|
6020
6044
|
})
|
6021
|
-
}, /* @__PURE__ */
|
6045
|
+
}, /* @__PURE__ */ React57.createElement(Flexbox, {
|
6022
6046
|
gap: "3",
|
6023
6047
|
wrap: "wrap"
|
6024
6048
|
}, children));
|
6025
6049
|
};
|
6026
|
-
var SearchIcon = ({ onClick }) => /* @__PURE__ */
|
6050
|
+
var SearchIcon = ({ onClick }) => /* @__PURE__ */ React57.createElement(Icon, {
|
6027
6051
|
icon: import_search2.default,
|
6028
6052
|
color: "grey-30",
|
6029
6053
|
"data-testid": "icon-search",
|
6030
6054
|
onClick
|
6031
6055
|
});
|
6032
|
-
var ResetIcon = ({ onClick }) => /* @__PURE__ */
|
6056
|
+
var ResetIcon = ({ onClick }) => /* @__PURE__ */ React57.createElement(Icon, {
|
6033
6057
|
className: "hover:cursor-pointer",
|
6034
6058
|
icon: import_cross4.default,
|
6035
6059
|
color: "grey-30",
|
@@ -6059,7 +6083,7 @@ var createInput = (displayName, opts = {}) => {
|
|
6059
6083
|
"readOnly"
|
6060
6084
|
]);
|
6061
6085
|
var _a2;
|
6062
|
-
const inputRef =
|
6086
|
+
const inputRef = React58.useRef(null);
|
6063
6087
|
useImperativeHandle(ref, () => inputRef.current);
|
6064
6088
|
const handleReset = () => {
|
6065
6089
|
var _a3;
|
@@ -6072,11 +6096,11 @@ var createInput = (displayName, opts = {}) => {
|
|
6072
6096
|
el.focus();
|
6073
6097
|
}
|
6074
6098
|
};
|
6075
|
-
return /* @__PURE__ */
|
6099
|
+
return /* @__PURE__ */ React58.createElement("span", {
|
6076
6100
|
className: tw("relative block")
|
6077
|
-
}, opts.adornment && /* @__PURE__ */
|
6101
|
+
}, opts.adornment && /* @__PURE__ */ React58.createElement(InputAdornment, {
|
6078
6102
|
placement: "left"
|
6079
|
-
}, opts.adornment), /* @__PURE__ */
|
6103
|
+
}, opts.adornment), /* @__PURE__ */ React58.createElement("input", __spreadProps(__spreadValues({
|
6080
6104
|
ref: inputRef,
|
6081
6105
|
type
|
6082
6106
|
}, props), {
|
@@ -6091,20 +6115,20 @@ var createInput = (displayName, opts = {}) => {
|
|
6091
6115
|
getCommonInputStyles({ readOnly, valid }),
|
6092
6116
|
props.className
|
6093
6117
|
)
|
6094
|
-
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */
|
6118
|
+
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React58.createElement(InputAdornment, null, /* @__PURE__ */ React58.createElement(ResetIcon, {
|
6095
6119
|
onClick: handleReset
|
6096
|
-
})), !opts.canReset && endAdornment && /* @__PURE__ */
|
6120
|
+
})), !opts.canReset && endAdornment && /* @__PURE__ */ React58.createElement(InputAdornment, null, endAdornment));
|
6097
6121
|
}
|
6098
6122
|
);
|
6099
6123
|
InputComponent.displayName = displayName;
|
6100
|
-
InputComponent.Skeleton = () => /* @__PURE__ */
|
6124
|
+
InputComponent.Skeleton = () => /* @__PURE__ */ React58.createElement(Skeleton, {
|
6101
6125
|
height: 38
|
6102
6126
|
});
|
6103
6127
|
return InputComponent;
|
6104
6128
|
};
|
6105
6129
|
var InputBase = createInput("InputBase");
|
6106
|
-
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */
|
6107
|
-
var Input2 =
|
6130
|
+
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React58.createElement(SearchIcon, null), canReset: true });
|
6131
|
+
var Input2 = React58.forwardRef((_a, ref) => {
|
6108
6132
|
var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
|
6109
6133
|
var _a2, _b2, _c;
|
6110
6134
|
const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
|
@@ -6113,12 +6137,12 @@ var Input2 = React57.forwardRef((_a, ref) => {
|
|
6113
6137
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
6114
6138
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
6115
6139
|
const baseProps = omit8(props, Object.keys(labelControlProps));
|
6116
|
-
return /* @__PURE__ */
|
6140
|
+
return /* @__PURE__ */ React58.createElement(LabelControl, __spreadValues({
|
6117
6141
|
id: `${id.current}-label`,
|
6118
6142
|
htmlFor: id.current,
|
6119
6143
|
messageId: errorMessageId,
|
6120
6144
|
length: value !== void 0 ? toString(value).length : void 0
|
6121
|
-
}, labelControlProps), /* @__PURE__ */
|
6145
|
+
}, labelControlProps), /* @__PURE__ */ React58.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
|
6122
6146
|
ref
|
6123
6147
|
}, baseProps), errorProps), {
|
6124
6148
|
id: id.current,
|
@@ -6136,44 +6160,41 @@ var Input2 = React57.forwardRef((_a, ref) => {
|
|
6136
6160
|
})));
|
6137
6161
|
});
|
6138
6162
|
Input2.displayName = "Input";
|
6139
|
-
Input2.Skeleton = () => /* @__PURE__ */
|
6163
|
+
Input2.Skeleton = () => /* @__PURE__ */ React58.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React58.createElement(InputBase.Skeleton, null));
|
6140
6164
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
6141
6165
|
|
6142
6166
|
// src/common/DropdownMenu/DropdownMenu.tsx
|
6143
|
-
import
|
6167
|
+
import React59 from "react";
|
6144
6168
|
var import_tick4 = __toESM(require_tick());
|
6145
|
-
var DropdownMenu2 =
|
6169
|
+
var DropdownMenu2 = React59.forwardRef(
|
6146
6170
|
(_a, ref) => {
|
6147
6171
|
var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
|
6148
|
-
return /* @__PURE__ */
|
6172
|
+
return /* @__PURE__ */ React59.createElement("div", __spreadValues({
|
6149
6173
|
ref,
|
6150
6174
|
style: { maxHeight, minWidth, maxWidth },
|
6151
|
-
className: classNames(
|
6152
|
-
className,
|
6153
|
-
"bg-white w-full overflow-y-auto overflow-x-hidden typography-small text-grey-70"
|
6154
|
-
)
|
6175
|
+
className: classNames(className, "bg-white w-full flex flex-col overflow-x-hidden typography-small text-grey-70")
|
6155
6176
|
}, props), children);
|
6156
6177
|
}
|
6157
6178
|
);
|
6158
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
6159
|
-
className: tw("p-3")
|
6179
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React59.createElement("div", {
|
6180
|
+
className: tw("p-3 overflow-y-auto overflow-x-hidden")
|
6160
6181
|
}, children);
|
6161
6182
|
DropdownMenu2.ContentContainer = ContentContainer;
|
6162
|
-
var List2 =
|
6183
|
+
var List2 = React59.forwardRef(
|
6163
6184
|
(_a, ref) => {
|
6164
6185
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6165
|
-
return /* @__PURE__ */
|
6186
|
+
return /* @__PURE__ */ React59.createElement("ul", __spreadValues({
|
6166
6187
|
ref
|
6167
6188
|
}, props), children);
|
6168
6189
|
}
|
6169
6190
|
);
|
6170
6191
|
DropdownMenu2.List = List2;
|
6171
|
-
var Group2 =
|
6192
|
+
var Group2 = React59.forwardRef(
|
6172
6193
|
(_a, ref) => {
|
6173
6194
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
6174
|
-
return /* @__PURE__ */
|
6195
|
+
return /* @__PURE__ */ React59.createElement("li", __spreadValues({
|
6175
6196
|
ref
|
6176
|
-
}, props), title && /* @__PURE__ */
|
6197
|
+
}, props), title && /* @__PURE__ */ React59.createElement("div", __spreadValues({
|
6177
6198
|
className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
|
6178
6199
|
"text-grey-20": props.disabled
|
6179
6200
|
})
|
@@ -6181,10 +6202,10 @@ var Group2 = React58.forwardRef(
|
|
6181
6202
|
}
|
6182
6203
|
);
|
6183
6204
|
DropdownMenu2.Group = Group2;
|
6184
|
-
var Item3 =
|
6205
|
+
var Item3 = React59.forwardRef(
|
6185
6206
|
(_a, ref) => {
|
6186
6207
|
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
6187
|
-
return /* @__PURE__ */
|
6208
|
+
return /* @__PURE__ */ React59.createElement("li", __spreadValues({
|
6188
6209
|
ref,
|
6189
6210
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
6190
6211
|
"cursor-pointer hover:bg-grey-0": !props.disabled,
|
@@ -6192,30 +6213,30 @@ var Item3 = React58.forwardRef(
|
|
6192
6213
|
"text-primary-80": kind === "action",
|
6193
6214
|
"text-grey-20 cursor-not-allowed": props.disabled
|
6194
6215
|
})
|
6195
|
-
}, props), icon && /* @__PURE__ */
|
6216
|
+
}, props), icon && /* @__PURE__ */ React59.createElement(InlineIcon, {
|
6196
6217
|
icon
|
6197
|
-
}), /* @__PURE__ */
|
6218
|
+
}), /* @__PURE__ */ React59.createElement("span", {
|
6198
6219
|
className: tw("grow")
|
6199
|
-
}, children), selected && /* @__PURE__ */
|
6220
|
+
}, children), selected && /* @__PURE__ */ React59.createElement(InlineIcon, {
|
6200
6221
|
icon: import_tick4.default
|
6201
6222
|
}));
|
6202
6223
|
}
|
6203
6224
|
);
|
6204
6225
|
DropdownMenu2.Item = Item3;
|
6205
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
6226
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React59.createElement(Typography2.Caption, {
|
6206
6227
|
color: disabled ? "grey-20" : "grey-40"
|
6207
6228
|
}, children);
|
6208
6229
|
DropdownMenu2.Description = Description;
|
6209
6230
|
var Separator = (_a) => {
|
6210
6231
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
6211
|
-
return /* @__PURE__ */
|
6232
|
+
return /* @__PURE__ */ React59.createElement("li", __spreadProps(__spreadValues({}, props), {
|
6212
6233
|
className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
|
6213
6234
|
}));
|
6214
6235
|
};
|
6215
6236
|
DropdownMenu2.Separator = Separator;
|
6216
6237
|
var EmptyStateContainer2 = (_a) => {
|
6217
6238
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
6218
|
-
return /* @__PURE__ */
|
6239
|
+
return /* @__PURE__ */ React59.createElement("div", __spreadValues({
|
6219
6240
|
className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
|
6220
6241
|
}, props), children);
|
6221
6242
|
};
|
@@ -6270,8 +6291,8 @@ var DropdownMenu3 = (_a) => {
|
|
6270
6291
|
"footer",
|
6271
6292
|
"children"
|
6272
6293
|
]);
|
6273
|
-
const triggerRef =
|
6274
|
-
const overlayRef =
|
6294
|
+
const triggerRef = React60.useRef(null);
|
6295
|
+
const overlayRef = React60.useRef(null);
|
6275
6296
|
const [trigger, items] = extractTriggerAndItems(children);
|
6276
6297
|
const state = useMenuTriggerState(props);
|
6277
6298
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
@@ -6282,17 +6303,17 @@ var DropdownMenu3 = (_a) => {
|
|
6282
6303
|
shouldFlip: true,
|
6283
6304
|
isOpen: state.isOpen
|
6284
6305
|
});
|
6285
|
-
return /* @__PURE__ */
|
6306
|
+
return /* @__PURE__ */ React60.createElement("div", null, /* @__PURE__ */ React60.createElement(PressResponder2, __spreadValues({
|
6286
6307
|
ref: triggerRef,
|
6287
6308
|
onPress: () => state.toggle()
|
6288
|
-
}, menuTriggerProps), /* @__PURE__ */
|
6309
|
+
}, menuTriggerProps), /* @__PURE__ */ React60.createElement(TriggerWrapper, null, trigger.props.children)), /* @__PURE__ */ React60.createElement(PopoverWrapper, __spreadValues({
|
6289
6310
|
ref: overlayRef,
|
6290
6311
|
isDismissable: true,
|
6291
6312
|
autoFocus: true,
|
6292
6313
|
containFocus: true,
|
6293
6314
|
isOpen: state.isOpen,
|
6294
6315
|
onClose: state.close
|
6295
|
-
}, overlayProps), /* @__PURE__ */
|
6316
|
+
}, overlayProps), /* @__PURE__ */ React60.createElement(MenuWrapper, __spreadValues({
|
6296
6317
|
onAction,
|
6297
6318
|
selectionMode,
|
6298
6319
|
selection,
|
@@ -6317,13 +6338,13 @@ DropdownMenu3.Section = Section;
|
|
6317
6338
|
DropdownMenu3.Section.displayName = "DropdownMenu.Section";
|
6318
6339
|
var TriggerWrapper = (_a) => {
|
6319
6340
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6320
|
-
const ref =
|
6341
|
+
const ref = React60.useRef(null);
|
6321
6342
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
|
6322
|
-
const trigger =
|
6323
|
-
if (!trigger || !
|
6343
|
+
const trigger = React60.Children.only(children);
|
6344
|
+
if (!trigger || !React60.isValidElement(trigger)) {
|
6324
6345
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
6325
6346
|
}
|
6326
|
-
return
|
6347
|
+
return React60.cloneElement(trigger, __spreadValues({ ref }, mergeProps4(pressProps, props)));
|
6327
6348
|
};
|
6328
6349
|
var isSectionNode = (item) => item.type === "section";
|
6329
6350
|
var isItemNode = (item) => item.type === "item";
|
@@ -6345,7 +6366,7 @@ var MenuWrapper = (_a) => {
|
|
6345
6366
|
"header",
|
6346
6367
|
"footer"
|
6347
6368
|
]);
|
6348
|
-
const ref =
|
6369
|
+
const ref = React60.useRef(null);
|
6349
6370
|
const disabledKeys = getDisabledItemKeys(props.children);
|
6350
6371
|
const state = useTreeState(__spreadValues({
|
6351
6372
|
disabledKeys,
|
@@ -6353,30 +6374,30 @@ var MenuWrapper = (_a) => {
|
|
6353
6374
|
}, props));
|
6354
6375
|
const { menuProps } = useMenu(props, state, ref);
|
6355
6376
|
const { contains } = useFilter({ sensitivity: "base" });
|
6356
|
-
const [search, setSearch] =
|
6357
|
-
const filteredCollection =
|
6377
|
+
const [search, setSearch] = React60.useState("");
|
6378
|
+
const filteredCollection = React60.useMemo(
|
6358
6379
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
6359
6380
|
[state.collection, search, contains]
|
6360
6381
|
);
|
6361
|
-
return /* @__PURE__ */
|
6382
|
+
return /* @__PURE__ */ React60.createElement(DropdownMenu2, {
|
6362
6383
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
6363
6384
|
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
|
6364
|
-
}, header, /* @__PURE__ */
|
6385
|
+
}, header, /* @__PURE__ */ React60.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React60.createElement(SearchInput, {
|
6365
6386
|
"aria-label": "search",
|
6366
6387
|
value: search,
|
6367
6388
|
onChange: (e) => setSearch(e.target.value),
|
6368
6389
|
className: tw("mb-5")
|
6369
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
6390
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React60.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React60.createElement(DropdownMenu2.List, __spreadValues({
|
6370
6391
|
ref
|
6371
6392
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
6372
6393
|
if (isSectionNode(item)) {
|
6373
|
-
return /* @__PURE__ */
|
6394
|
+
return /* @__PURE__ */ React60.createElement(SectionWrapper, {
|
6374
6395
|
key: item.key,
|
6375
6396
|
section: item,
|
6376
6397
|
state
|
6377
6398
|
});
|
6378
6399
|
} else if (isItemNode(item)) {
|
6379
|
-
return /* @__PURE__ */
|
6400
|
+
return /* @__PURE__ */ React60.createElement(ItemWrapper, {
|
6380
6401
|
key: item.key,
|
6381
6402
|
item,
|
6382
6403
|
state
|
@@ -6385,14 +6406,14 @@ var MenuWrapper = (_a) => {
|
|
6385
6406
|
}))), footer);
|
6386
6407
|
};
|
6387
6408
|
var ItemWrapper = ({ item, state }) => {
|
6388
|
-
const ref =
|
6409
|
+
const ref = React60.useRef(null);
|
6389
6410
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
6390
6411
|
{ key: item.key, closeOnSelect: item.props.closeOnSelect },
|
6391
6412
|
state,
|
6392
6413
|
ref
|
6393
6414
|
);
|
6394
6415
|
const { icon, description, kind = "default" } = item.props;
|
6395
|
-
return /* @__PURE__ */
|
6416
|
+
return /* @__PURE__ */ React60.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
|
6396
6417
|
ref
|
6397
6418
|
}, menuItemProps), {
|
6398
6419
|
kind,
|
@@ -6400,7 +6421,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
6400
6421
|
highlighted: isFocused,
|
6401
6422
|
disabled: isDisabled,
|
6402
6423
|
icon
|
6403
|
-
}), item.rendered, description && /* @__PURE__ */
|
6424
|
+
}), item.rendered, description && /* @__PURE__ */ React60.createElement(DropdownMenu2.Description, __spreadValues({
|
6404
6425
|
disabled: isDisabled
|
6405
6426
|
}, descriptionProps), description));
|
6406
6427
|
};
|
@@ -6412,24 +6433,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
6412
6433
|
const { separatorProps } = useSeparator({
|
6413
6434
|
elementType: "li"
|
6414
6435
|
});
|
6415
|
-
return /* @__PURE__ */
|
6436
|
+
return /* @__PURE__ */ React60.createElement(React60.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React60.createElement(DropdownMenu2.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React60.createElement(DropdownMenu2.Group, __spreadValues({
|
6416
6437
|
title: section.rendered,
|
6417
6438
|
titleProps: headingProps
|
6418
|
-
}, itemProps), /* @__PURE__ */
|
6439
|
+
}, itemProps), /* @__PURE__ */ React60.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React60.createElement(ItemWrapper, {
|
6419
6440
|
key: node.key,
|
6420
6441
|
item: node,
|
6421
6442
|
state
|
6422
6443
|
})))));
|
6423
6444
|
};
|
6424
6445
|
var extractTriggerAndItems = (children) => {
|
6425
|
-
const [trigger, items] =
|
6446
|
+
const [trigger, items] = React60.Children.toArray(children);
|
6426
6447
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
6427
6448
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
6428
6449
|
}
|
6429
6450
|
return [trigger, items];
|
6430
6451
|
};
|
6431
6452
|
var getDisabledItemKeys = (children) => {
|
6432
|
-
const keys =
|
6453
|
+
const keys = React60.Children.map(children, (child) => {
|
6433
6454
|
var _a, _b;
|
6434
6455
|
if (!child || typeof child === "function") {
|
6435
6456
|
return null;
|
@@ -6446,11 +6467,11 @@ var getDisabledItemKeys = (children) => {
|
|
6446
6467
|
};
|
6447
6468
|
|
6448
6469
|
// src/components/EmptyState/EmptyState.tsx
|
6449
|
-
import
|
6470
|
+
import React62 from "react";
|
6450
6471
|
import omit9 from "lodash/omit";
|
6451
6472
|
|
6452
6473
|
// src/components/Flexbox/FlexboxItem.tsx
|
6453
|
-
import
|
6474
|
+
import React61 from "react";
|
6454
6475
|
var FlexboxItem = Tailwindify(
|
6455
6476
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6456
6477
|
const hookStyle = useStyle({
|
@@ -6462,7 +6483,7 @@ var FlexboxItem = Tailwindify(
|
|
6462
6483
|
alignSelf
|
6463
6484
|
});
|
6464
6485
|
const HtmlElement = htmlTag;
|
6465
|
-
return /* @__PURE__ */
|
6486
|
+
return /* @__PURE__ */ React61.createElement(HtmlElement, {
|
6466
6487
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6467
6488
|
className
|
6468
6489
|
}, children);
|
@@ -6520,7 +6541,7 @@ var EmptyState = ({
|
|
6520
6541
|
borderStyle = "dashed"
|
6521
6542
|
}) => {
|
6522
6543
|
const template = layoutStyle(layout);
|
6523
|
-
return /* @__PURE__ */
|
6544
|
+
return /* @__PURE__ */ React62.createElement(Box, {
|
6524
6545
|
className: classNames(
|
6525
6546
|
tw("rounded", {
|
6526
6547
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6532,38 +6553,38 @@ var EmptyState = ({
|
|
6532
6553
|
backgroundColor: "transparent",
|
6533
6554
|
borderColor: "grey-10",
|
6534
6555
|
padding: "9"
|
6535
|
-
}, /* @__PURE__ */
|
6556
|
+
}, /* @__PURE__ */ React62.createElement(Flexbox, {
|
6536
6557
|
direction: template.layout,
|
6537
6558
|
justifyContent: template.justifyContent,
|
6538
6559
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6539
6560
|
colGap: "l5",
|
6540
6561
|
rowGap: "8"
|
6541
|
-
}, image && /* @__PURE__ */
|
6562
|
+
}, image && /* @__PURE__ */ React62.createElement(FlexboxItem, null, /* @__PURE__ */ React62.createElement("img", {
|
6542
6563
|
src: image,
|
6543
6564
|
alt: imageAlt,
|
6544
6565
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6545
|
-
})), /* @__PURE__ */
|
6566
|
+
})), /* @__PURE__ */ React62.createElement(Flexbox, {
|
6546
6567
|
style: { maxWidth: "610px" },
|
6547
6568
|
direction: "column",
|
6548
6569
|
justifyContent: template.justifyContent,
|
6549
6570
|
alignItems: template.alignItems
|
6550
|
-
}, /* @__PURE__ */
|
6571
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6551
6572
|
variant: "heading",
|
6552
6573
|
htmlTag: "h2"
|
6553
|
-
}, title), (description || children) && /* @__PURE__ */
|
6574
|
+
}, title), (description || children) && /* @__PURE__ */ React62.createElement(Box, {
|
6554
6575
|
marginTop: "5"
|
6555
|
-
}, /* @__PURE__ */
|
6576
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6556
6577
|
variant: "default",
|
6557
6578
|
color: "grey-60"
|
6558
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6579
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React62.createElement(Flexbox, {
|
6559
6580
|
marginTop: "7",
|
6560
6581
|
gap: "4",
|
6561
6582
|
justifyContent: "center",
|
6562
6583
|
alignItems: "center",
|
6563
6584
|
wrap: "wrap"
|
6564
|
-
}, primaryAction && /* @__PURE__ */
|
6585
|
+
}, primaryAction && /* @__PURE__ */ React62.createElement(PrimaryButton, __spreadValues({}, omit9(primaryAction, "text")), primaryAction.text), secondaryAction && /* @__PURE__ */ React62.createElement(SecondaryButton, __spreadValues({}, omit9(secondaryAction, "text")), secondaryAction.text)), footer && /* @__PURE__ */ React62.createElement(Box, {
|
6565
6586
|
marginTop: "7"
|
6566
|
-
}, /* @__PURE__ */
|
6587
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6567
6588
|
htmlTag: "div",
|
6568
6589
|
variant: "small",
|
6569
6590
|
color: "grey-60"
|
@@ -6571,7 +6592,7 @@ var EmptyState = ({
|
|
6571
6592
|
};
|
6572
6593
|
|
6573
6594
|
// src/components/Grid/GridItem.tsx
|
6574
|
-
import
|
6595
|
+
import React63 from "react";
|
6575
6596
|
var GridItem = Tailwindify(
|
6576
6597
|
({
|
6577
6598
|
htmlTag = "div",
|
@@ -6602,7 +6623,7 @@ var GridItem = Tailwindify(
|
|
6602
6623
|
gridRowEnd: rowEnd
|
6603
6624
|
});
|
6604
6625
|
const HtmlElement = htmlTag;
|
6605
|
-
return /* @__PURE__ */
|
6626
|
+
return /* @__PURE__ */ React63.createElement(HtmlElement, {
|
6606
6627
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6607
6628
|
className
|
6608
6629
|
}, children);
|
@@ -6610,58 +6631,71 @@ var GridItem = Tailwindify(
|
|
6610
6631
|
);
|
6611
6632
|
|
6612
6633
|
// src/components/LineClamp/LineClamp.tsx
|
6613
|
-
import
|
6614
|
-
var
|
6615
|
-
|
6616
|
-
|
6617
|
-
|
6618
|
-
|
6634
|
+
import React64 from "react";
|
6635
|
+
var LineClamp2 = ({
|
6636
|
+
lines,
|
6637
|
+
children,
|
6638
|
+
wordBreak,
|
6639
|
+
expandLabel,
|
6640
|
+
collapseLabel,
|
6641
|
+
onClampedChange
|
6642
|
+
}) => {
|
6643
|
+
const ref = React64.useRef(null);
|
6644
|
+
const [clamped, setClamped] = React64.useState(true);
|
6645
|
+
const [isClampingEnabled, setClampingEnabled] = React64.useState(false);
|
6646
|
+
React64.useEffect(() => {
|
6619
6647
|
var _a, _b;
|
6620
6648
|
const el = ref.current;
|
6621
6649
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
6622
6650
|
}, [ref.current]);
|
6623
|
-
|
6651
|
+
const handleClampedChange = () => {
|
6652
|
+
setClamped(!clamped);
|
6653
|
+
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
6654
|
+
};
|
6655
|
+
return /* @__PURE__ */ React64.createElement("div", null, /* @__PURE__ */ React64.createElement(LineClamp, {
|
6624
6656
|
ref,
|
6625
|
-
|
6626
|
-
|
6657
|
+
lines,
|
6658
|
+
clamped,
|
6659
|
+
wordBreak
|
6660
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React64.createElement(GhostButton, {
|
6627
6661
|
dense: true,
|
6628
|
-
onClick:
|
6662
|
+
onClick: handleClampedChange
|
6629
6663
|
}, clamped ? expandLabel : collapseLabel));
|
6630
6664
|
};
|
6631
6665
|
|
6632
6666
|
// src/components/Link/Link.tsx
|
6633
|
-
import
|
6667
|
+
import React66 from "react";
|
6634
6668
|
|
6635
6669
|
// src/common/Link/Link.tsx
|
6636
|
-
import
|
6670
|
+
import React65 from "react";
|
6637
6671
|
var Link = (_a) => {
|
6638
6672
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
6639
|
-
return /* @__PURE__ */
|
6673
|
+
return /* @__PURE__ */ React65.createElement("a", __spreadValues({
|
6640
6674
|
className: classNames(className, linkStyle)
|
6641
6675
|
}, props), children);
|
6642
6676
|
};
|
6643
6677
|
|
6644
6678
|
// src/components/Link/Link.tsx
|
6645
|
-
var Link2 = (props) => /* @__PURE__ */
|
6679
|
+
var Link2 = (props) => /* @__PURE__ */ React66.createElement(Link, __spreadValues({}, props));
|
6646
6680
|
|
6647
6681
|
// src/components/List/List.tsx
|
6648
|
-
import
|
6649
|
-
var List = ({ items, renderItem, container =
|
6682
|
+
import React67 from "react";
|
6683
|
+
var List = ({ items, renderItem, container = React67.Fragment }) => {
|
6650
6684
|
const Component = container;
|
6651
|
-
return /* @__PURE__ */
|
6685
|
+
return /* @__PURE__ */ React67.createElement(Component, null, items.map(renderItem));
|
6652
6686
|
};
|
6653
6687
|
|
6654
6688
|
// src/components/ListItem/ListItem.tsx
|
6655
|
-
import
|
6689
|
+
import React68 from "react";
|
6656
6690
|
var ListItem = ({ name, icon, active = false }) => {
|
6657
|
-
return /* @__PURE__ */
|
6691
|
+
return /* @__PURE__ */ React68.createElement(Flexbox, {
|
6658
6692
|
alignItems: "center"
|
6659
|
-
}, /* @__PURE__ */
|
6693
|
+
}, /* @__PURE__ */ React68.createElement(Typography2, {
|
6660
6694
|
variant: active ? "small-strong" : "small",
|
6661
6695
|
color: "grey-70",
|
6662
6696
|
htmlTag: "span",
|
6663
6697
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6664
|
-
}, /* @__PURE__ */
|
6698
|
+
}, /* @__PURE__ */ React68.createElement("img", {
|
6665
6699
|
src: icon,
|
6666
6700
|
alt: name,
|
6667
6701
|
className: "inline mr-4",
|
@@ -6671,7 +6705,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6671
6705
|
};
|
6672
6706
|
|
6673
6707
|
// src/components/Modal/Modal.tsx
|
6674
|
-
import
|
6708
|
+
import React70 from "react";
|
6675
6709
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6676
6710
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
6677
6711
|
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
@@ -6681,18 +6715,18 @@ import castArray from "lodash/castArray";
|
|
6681
6715
|
import omit10 from "lodash/omit";
|
6682
6716
|
|
6683
6717
|
// src/components/Tabs/Tabs.tsx
|
6684
|
-
import
|
6718
|
+
import React69, { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState7 } from "react";
|
6685
6719
|
import isNumber5 from "lodash/isNumber";
|
6686
6720
|
import kebabCase from "lodash/kebabCase";
|
6687
6721
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6688
6722
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6689
6723
|
var import_warningSign3 = __toESM(require_warningSign());
|
6690
6724
|
var isTabComponent = (c) => {
|
6691
|
-
return
|
6725
|
+
return React69.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6692
6726
|
};
|
6693
|
-
var Tab =
|
6727
|
+
var Tab = React69.forwardRef(
|
6694
6728
|
({ className, id, title, children }, ref) => {
|
6695
|
-
return /* @__PURE__ */
|
6729
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
6696
6730
|
ref,
|
6697
6731
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6698
6732
|
className,
|
@@ -6704,14 +6738,14 @@ var Tab = React68.forwardRef(
|
|
6704
6738
|
);
|
6705
6739
|
var TabContainer = (_a) => {
|
6706
6740
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6707
|
-
return /* @__PURE__ */
|
6741
|
+
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6708
6742
|
className: classNames("py-6 z-0", className)
|
6709
6743
|
}), children);
|
6710
6744
|
};
|
6711
6745
|
var ModalTab = Tab;
|
6712
6746
|
var ModalTabContainer = TabContainer;
|
6713
6747
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6714
|
-
const Tab2 =
|
6748
|
+
const Tab2 = React69.forwardRef(
|
6715
6749
|
(_a, ref) => {
|
6716
6750
|
var _b = _a, {
|
6717
6751
|
id,
|
@@ -6741,17 +6775,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6741
6775
|
const _id = id != null ? id : kebabCase(title);
|
6742
6776
|
let statusIcon = void 0;
|
6743
6777
|
if (status === "warning") {
|
6744
|
-
statusIcon = /* @__PURE__ */
|
6778
|
+
statusIcon = /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6745
6779
|
icon: import_warningSign3.default,
|
6746
6780
|
color: "warning-80"
|
6747
6781
|
});
|
6748
6782
|
} else if (status === "error") {
|
6749
|
-
statusIcon = /* @__PURE__ */
|
6783
|
+
statusIcon = /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6750
6784
|
icon: import_warningSign3.default,
|
6751
6785
|
color: "error-50"
|
6752
6786
|
});
|
6753
6787
|
}
|
6754
|
-
const tab = /* @__PURE__ */
|
6788
|
+
const tab = /* @__PURE__ */ React69.createElement(Component, __spreadValues({
|
6755
6789
|
ref,
|
6756
6790
|
id: `${_id}-tab`,
|
6757
6791
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6768,24 +6802,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6768
6802
|
"aria-selected": selected,
|
6769
6803
|
"aria-controls": `${_id}-panel`,
|
6770
6804
|
tabIndex: disabled ? void 0 : 0
|
6771
|
-
}, rest), /* @__PURE__ */
|
6805
|
+
}, rest), /* @__PURE__ */ React69.createElement(Typography2, {
|
6772
6806
|
htmlTag: "div",
|
6773
6807
|
variant: "small",
|
6774
6808
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6775
6809
|
className: tw("inline-flex items-center gap-3")
|
6776
|
-
}, /* @__PURE__ */
|
6810
|
+
}, /* @__PURE__ */ React69.createElement("span", {
|
6777
6811
|
className: tw("whitespace-nowrap")
|
6778
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
6812
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React69.createElement(Typography2, {
|
6779
6813
|
htmlTag: "span",
|
6780
6814
|
variant: "small",
|
6781
6815
|
color: selected ? "primary-80" : "grey-5",
|
6782
6816
|
className: "leading-none"
|
6783
|
-
}, /* @__PURE__ */
|
6817
|
+
}, /* @__PURE__ */ React69.createElement(TabBadge, {
|
6784
6818
|
kind: "filled",
|
6785
6819
|
value: badge,
|
6786
6820
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6787
6821
|
})), statusIcon));
|
6788
|
-
return tooltip ? /* @__PURE__ */
|
6822
|
+
return tooltip ? /* @__PURE__ */ React69.createElement(Tooltip, {
|
6789
6823
|
content: tooltip
|
6790
6824
|
}, tab) : tab;
|
6791
6825
|
}
|
@@ -6799,7 +6833,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6799
6833
|
const Tabs2 = (props) => {
|
6800
6834
|
var _a, _b;
|
6801
6835
|
const { className, value, defaultValue, onChange, children } = props;
|
6802
|
-
const childArr =
|
6836
|
+
const childArr = React69.Children.toArray(children);
|
6803
6837
|
const firstTab = childArr[0];
|
6804
6838
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6805
6839
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -6812,7 +6846,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6812
6846
|
var _a2, _b2;
|
6813
6847
|
const container = containerRef.current;
|
6814
6848
|
const tabs = tabsRef.current;
|
6815
|
-
const values =
|
6849
|
+
const values = React69.Children.map(
|
6816
6850
|
children,
|
6817
6851
|
(tab, i) => {
|
6818
6852
|
var _a3;
|
@@ -6853,7 +6887,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6853
6887
|
updateCarets();
|
6854
6888
|
setSelected(value);
|
6855
6889
|
revealSelectedTab({ smooth: value !== selected });
|
6856
|
-
}, [value,
|
6890
|
+
}, [value, React69.Children.count(children)]);
|
6857
6891
|
useLayoutEffect2(() => {
|
6858
6892
|
var _a2;
|
6859
6893
|
updateCarets();
|
@@ -6917,27 +6951,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6917
6951
|
const handleSelected = (key) => {
|
6918
6952
|
(onChange != null ? onChange : setSelected)(key);
|
6919
6953
|
};
|
6920
|
-
|
6954
|
+
React69.Children.forEach(children, (c) => {
|
6921
6955
|
if (c && !isTabComponent(c)) {
|
6922
6956
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6923
6957
|
}
|
6924
6958
|
});
|
6925
|
-
return /* @__PURE__ */
|
6959
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
6926
6960
|
ref: parentRef,
|
6927
6961
|
className: classNames(tw("h-full"), className)
|
6928
|
-
}, /* @__PURE__ */
|
6962
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6929
6963
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6930
|
-
}, /* @__PURE__ */
|
6964
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6931
6965
|
ref: containerRef,
|
6932
6966
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6933
|
-
}, /* @__PURE__ */
|
6967
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6934
6968
|
ref: tabsRef,
|
6935
6969
|
role: "tablist",
|
6936
6970
|
"aria-label": "tabs",
|
6937
6971
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
6938
|
-
},
|
6972
|
+
}, React69.Children.map(
|
6939
6973
|
children,
|
6940
|
-
(tab, index) => tab ? /* @__PURE__ */
|
6974
|
+
(tab, index) => tab ? /* @__PURE__ */ React69.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
6941
6975
|
key: tab.props.value
|
6942
6976
|
}, tab.props), {
|
6943
6977
|
index,
|
@@ -6945,20 +6979,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6945
6979
|
onKeyDown: handleKeyDown,
|
6946
6980
|
onSelected: handleSelected
|
6947
6981
|
})) : void 0
|
6948
|
-
))), leftCaret && /* @__PURE__ */
|
6982
|
+
))), leftCaret && /* @__PURE__ */ React69.createElement("div", {
|
6949
6983
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
6950
|
-
}, /* @__PURE__ */
|
6984
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6951
6985
|
onClick: () => handleScrollToNext("left"),
|
6952
6986
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6953
|
-
}, /* @__PURE__ */
|
6987
|
+
}, /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6954
6988
|
icon: import_chevronLeft2.default
|
6955
|
-
}))), rightCaret && /* @__PURE__ */
|
6989
|
+
}))), rightCaret && /* @__PURE__ */ React69.createElement("div", {
|
6956
6990
|
onClick: () => handleScrollToNext("right"),
|
6957
6991
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
6958
|
-
}, /* @__PURE__ */
|
6992
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6959
6993
|
onClick: () => handleScrollToNext("right"),
|
6960
6994
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6961
|
-
}, /* @__PURE__ */
|
6995
|
+
}, /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6962
6996
|
icon: import_chevronRight2.default
|
6963
6997
|
})))), renderChildren(children, selected, props));
|
6964
6998
|
};
|
@@ -6966,7 +7000,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6966
7000
|
Tabs2.Tab = TabComponent;
|
6967
7001
|
return Tabs2;
|
6968
7002
|
};
|
6969
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
7003
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React69.createElement(TabContainer, null, children.find(
|
6970
7004
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6971
7005
|
)));
|
6972
7006
|
|
@@ -6983,7 +7017,7 @@ var Modal2 = ({
|
|
6983
7017
|
secondaryActions,
|
6984
7018
|
size
|
6985
7019
|
}) => {
|
6986
|
-
const ref =
|
7020
|
+
const ref = React70.useRef(null);
|
6987
7021
|
const state = useOverlayTriggerState4({ isOpen: open });
|
6988
7022
|
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
6989
7023
|
const labelledBy = useId2();
|
@@ -6995,35 +7029,35 @@ var Modal2 = ({
|
|
6995
7029
|
if (!open) {
|
6996
7030
|
return null;
|
6997
7031
|
}
|
6998
|
-
return /* @__PURE__ */
|
7032
|
+
return /* @__PURE__ */ React70.createElement(Overlay2, null, /* @__PURE__ */ React70.createElement(Modal, {
|
6999
7033
|
open: state.isOpen
|
7000
|
-
}, /* @__PURE__ */
|
7034
|
+
}, /* @__PURE__ */ React70.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React70.createElement(FocusScope3, {
|
7001
7035
|
contain: true,
|
7002
7036
|
restoreFocus: true,
|
7003
7037
|
autoFocus: true
|
7004
|
-
}, /* @__PURE__ */
|
7038
|
+
}, /* @__PURE__ */ React70.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
7005
7039
|
ref,
|
7006
7040
|
size
|
7007
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
7041
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React70.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React70.createElement(IconButton, {
|
7008
7042
|
"aria-label": "Close",
|
7009
7043
|
icon: import_cross5.default,
|
7010
7044
|
onClick: onClose
|
7011
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
7045
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React70.createElement(Modal.HeaderImage, {
|
7012
7046
|
backgroundImage: headerImage
|
7013
|
-
}), /* @__PURE__ */
|
7047
|
+
}), /* @__PURE__ */ React70.createElement(Modal.Header, {
|
7014
7048
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
7015
|
-
}, /* @__PURE__ */
|
7049
|
+
}, /* @__PURE__ */ React70.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React70.createElement(Modal.Title, {
|
7016
7050
|
id: labelledBy
|
7017
|
-
}, title), subtitle && /* @__PURE__ */
|
7051
|
+
}, title), subtitle && /* @__PURE__ */ React70.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React70.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React70.createElement(Modal.Body, {
|
7018
7052
|
id: describedBy,
|
7019
7053
|
tabIndex: 0,
|
7020
7054
|
noFooter: !(secondaryActions || primaryAction)
|
7021
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7055
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React70.createElement(Modal.Footer, null, /* @__PURE__ */ React70.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
7022
7056
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7023
|
-
return /* @__PURE__ */
|
7057
|
+
return /* @__PURE__ */ React70.createElement(SecondaryButton, __spreadValues({
|
7024
7058
|
key: text
|
7025
7059
|
}, action), text);
|
7026
|
-
}), primaryAction && /* @__PURE__ */
|
7060
|
+
}), primaryAction && /* @__PURE__ */ React70.createElement(PrimaryButton, __spreadValues({
|
7027
7061
|
key: primaryAction.text
|
7028
7062
|
}, omit10(primaryAction, "text")), primaryAction.text)))))));
|
7029
7063
|
};
|
@@ -7031,24 +7065,24 @@ var ModalTabs = createTabsComponent(
|
|
7031
7065
|
ModalTab,
|
7032
7066
|
TabItem,
|
7033
7067
|
"ModalTabs",
|
7034
|
-
(children, selected, props) => /* @__PURE__ */
|
7068
|
+
(children, selected, props) => /* @__PURE__ */ React70.createElement(Modal.Body, {
|
7035
7069
|
maxHeight: props.maxHeight
|
7036
|
-
}, /* @__PURE__ */
|
7070
|
+
}, /* @__PURE__ */ React70.createElement(ModalTabContainer, null, children.find(
|
7037
7071
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
7038
7072
|
)))
|
7039
7073
|
);
|
7040
7074
|
|
7041
7075
|
// src/components/MultiInput/MultiInput.tsx
|
7042
|
-
import
|
7076
|
+
import React72, { useEffect as useEffect6, useRef as useRef9, useState as useState8 } from "react";
|
7043
7077
|
import castArray2 from "lodash/castArray";
|
7044
7078
|
import identity from "lodash/identity";
|
7045
7079
|
import omit11 from "lodash/omit";
|
7046
7080
|
import uniqueId4 from "lodash/uniqueId";
|
7047
7081
|
|
7048
7082
|
// src/components/MultiInput/InputChip.tsx
|
7049
|
-
import
|
7083
|
+
import React71 from "react";
|
7050
7084
|
var import_smallCross = __toESM(require_smallCross());
|
7051
|
-
var InputChip =
|
7085
|
+
var InputChip = React71.forwardRef(
|
7052
7086
|
(_a, ref) => {
|
7053
7087
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
7054
7088
|
const onClick = (e) => {
|
@@ -7056,7 +7090,7 @@ var InputChip = React70.forwardRef(
|
|
7056
7090
|
_onClick == null ? void 0 : _onClick(e);
|
7057
7091
|
}
|
7058
7092
|
};
|
7059
|
-
return /* @__PURE__ */
|
7093
|
+
return /* @__PURE__ */ React71.createElement("div", __spreadValues({
|
7060
7094
|
ref,
|
7061
7095
|
role: "button",
|
7062
7096
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -7066,10 +7100,10 @@ var InputChip = React70.forwardRef(
|
|
7066
7100
|
"bg-grey-5 pointer-events-none": disabled
|
7067
7101
|
}),
|
7068
7102
|
onClick
|
7069
|
-
}, props), /* @__PURE__ */
|
7103
|
+
}, props), /* @__PURE__ */ React71.createElement(Typography2, {
|
7070
7104
|
variant: "small",
|
7071
7105
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
7072
|
-
}, children), !readOnly && /* @__PURE__ */
|
7106
|
+
}, children), !readOnly && /* @__PURE__ */ React71.createElement("div", null, /* @__PURE__ */ React71.createElement(Icon, {
|
7073
7107
|
icon: import_smallCross.default,
|
7074
7108
|
className: tw("ml-2", {
|
7075
7109
|
"text-error-70": invalid,
|
@@ -7210,7 +7244,7 @@ var MultiInputBase = (_a) => {
|
|
7210
7244
|
};
|
7211
7245
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
7212
7246
|
var _a3;
|
7213
|
-
return /* @__PURE__ */
|
7247
|
+
return /* @__PURE__ */ React72.createElement(InputChip, {
|
7214
7248
|
key: `${itemToString(item)}.${index}`,
|
7215
7249
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
7216
7250
|
readOnly,
|
@@ -7221,11 +7255,11 @@ var MultiInputBase = (_a) => {
|
|
7221
7255
|
}
|
7222
7256
|
}, itemToString(item));
|
7223
7257
|
});
|
7224
|
-
return /* @__PURE__ */
|
7258
|
+
return /* @__PURE__ */ React72.createElement("div", null, /* @__PURE__ */ React72.createElement(Select.InputContainer, {
|
7225
7259
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7226
|
-
}, /* @__PURE__ */
|
7260
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
7227
7261
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
7228
|
-
}, inline && renderChips(), /* @__PURE__ */
|
7262
|
+
}, inline && renderChips(), /* @__PURE__ */ React72.createElement(Select.Input, __spreadProps(__spreadValues({
|
7229
7263
|
ref: inputRef,
|
7230
7264
|
id: id != null ? id : name,
|
7231
7265
|
name,
|
@@ -7243,11 +7277,11 @@ var MultiInputBase = (_a) => {
|
|
7243
7277
|
onFocus: handleFocus,
|
7244
7278
|
onBlur: handleBlur,
|
7245
7279
|
autoComplete: "off"
|
7246
|
-
}))), endAdornment && /* @__PURE__ */
|
7280
|
+
}))), endAdornment && /* @__PURE__ */ React72.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React72.createElement("div", {
|
7247
7281
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
7248
7282
|
}, renderChips()));
|
7249
7283
|
};
|
7250
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7284
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React72.createElement(Skeleton, {
|
7251
7285
|
height: 38
|
7252
7286
|
});
|
7253
7287
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7264,14 +7298,14 @@ var MultiInput = (props) => {
|
|
7264
7298
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7265
7299
|
const labelControlProps = getLabelControlProps(props);
|
7266
7300
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7267
|
-
return /* @__PURE__ */
|
7301
|
+
return /* @__PURE__ */ React72.createElement(LabelControl, __spreadProps(__spreadValues({
|
7268
7302
|
id: `${id.current}-label`,
|
7269
7303
|
htmlFor: `${id.current}-input`,
|
7270
7304
|
messageId: errorMessageId
|
7271
7305
|
}, labelControlProps), {
|
7272
7306
|
length: value.length,
|
7273
7307
|
maxLength
|
7274
|
-
}), /* @__PURE__ */
|
7308
|
+
}), /* @__PURE__ */ React72.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7275
7309
|
id: `${id.current}-input`,
|
7276
7310
|
onChange: (value2) => {
|
7277
7311
|
var _a2;
|
@@ -7283,12 +7317,12 @@ var MultiInput = (props) => {
|
|
7283
7317
|
valid: props.valid
|
7284
7318
|
})));
|
7285
7319
|
};
|
7286
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7320
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React72.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React72.createElement(MultiInputBase.Skeleton, null));
|
7287
7321
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7288
7322
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7289
7323
|
|
7290
7324
|
// src/components/MultiSelect/MultiSelect.tsx
|
7291
|
-
import
|
7325
|
+
import React73, { useRef as useRef10, useState as useState9 } from "react";
|
7292
7326
|
import { useOverlayPosition as useOverlayPosition5 } from "@react-aria/overlays";
|
7293
7327
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7294
7328
|
import isEqual from "lodash/isEqual";
|
@@ -7426,7 +7460,7 @@ var MultiSelectBase = (_a) => {
|
|
7426
7460
|
});
|
7427
7461
|
const inputProps = getInputProps(getDropdownProps({ disabled: disabled || readOnly }));
|
7428
7462
|
const renderChips = () => {
|
7429
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7463
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React73.createElement(InputChip, __spreadProps(__spreadValues({
|
7430
7464
|
key: `${itemToString(selectedItem)}.chip`,
|
7431
7465
|
className: tw("mx-0"),
|
7432
7466
|
disabled,
|
@@ -7442,14 +7476,14 @@ var MultiSelectBase = (_a) => {
|
|
7442
7476
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7443
7477
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
7444
7478
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7445
|
-
return /* @__PURE__ */
|
7479
|
+
return /* @__PURE__ */ React73.createElement("div", {
|
7446
7480
|
className: tw("relative")
|
7447
|
-
}, /* @__PURE__ */
|
7481
|
+
}, /* @__PURE__ */ React73.createElement(Select.InputContainer, {
|
7448
7482
|
ref: targetRef,
|
7449
7483
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7450
|
-
}, /* @__PURE__ */
|
7484
|
+
}, /* @__PURE__ */ React73.createElement("div", {
|
7451
7485
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7452
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7486
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React73.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7453
7487
|
id,
|
7454
7488
|
name,
|
7455
7489
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
@@ -7470,28 +7504,27 @@ var MultiSelectBase = (_a) => {
|
|
7470
7504
|
setFocus(false);
|
7471
7505
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
7472
7506
|
}
|
7473
|
-
}))), !readOnly && /* @__PURE__ */
|
7507
|
+
}))), !readOnly && /* @__PURE__ */ React73.createElement(Select.Toggle, __spreadValues({
|
7474
7508
|
hasFocus,
|
7475
7509
|
isOpen
|
7476
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7510
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React73.createElement("div", {
|
7477
7511
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7478
|
-
}, renderChips()), /* @__PURE__ */
|
7512
|
+
}, renderChips()), /* @__PURE__ */ React73.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7479
7513
|
isOpen: true,
|
7480
7514
|
isDismissable: true,
|
7481
7515
|
autoFocus: true
|
7482
7516
|
}, getMenuProps({ ref: overlayRef })), {
|
7483
7517
|
style,
|
7484
|
-
onClose: closeMenu
|
7485
|
-
|
7486
|
-
}), /* @__PURE__ */ React72.createElement(Select.Menu, {
|
7518
|
+
onClose: closeMenu
|
7519
|
+
}), /* @__PURE__ */ React73.createElement(Select.Menu, {
|
7487
7520
|
maxHeight
|
7488
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
7521
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React73.createElement(Select.NoResults, null, noResults), isOpen && filteredOptions.map((item, index) => /* @__PURE__ */ React73.createElement(Select.Item, __spreadValues({
|
7489
7522
|
key: itemToString(item),
|
7490
7523
|
highlighted: index === highlightedIndex,
|
7491
7524
|
selected: selectedItems.includes(item)
|
7492
7525
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7493
7526
|
};
|
7494
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7527
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React73.createElement(Skeleton, {
|
7495
7528
|
height: 38
|
7496
7529
|
});
|
7497
7530
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7509,11 +7542,11 @@ var MultiSelect = (_a) => {
|
|
7509
7542
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7510
7543
|
const labelControlProps = getLabelControlProps(props);
|
7511
7544
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7512
|
-
return /* @__PURE__ */
|
7545
|
+
return /* @__PURE__ */ React73.createElement(LabelControl, __spreadValues({
|
7513
7546
|
id: `${id.current}-label`,
|
7514
7547
|
htmlFor: `${id.current}-input`,
|
7515
7548
|
messageId: errorMessageId
|
7516
|
-
}, labelControlProps), /* @__PURE__ */
|
7549
|
+
}, labelControlProps), /* @__PURE__ */ React73.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7517
7550
|
id: id.current,
|
7518
7551
|
options,
|
7519
7552
|
noResults,
|
@@ -7521,16 +7554,16 @@ var MultiSelect = (_a) => {
|
|
7521
7554
|
valid: props.valid
|
7522
7555
|
})));
|
7523
7556
|
};
|
7524
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7557
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React73.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React73.createElement(MultiSelectBase.Skeleton, null));
|
7525
7558
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7526
7559
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7527
7560
|
|
7528
7561
|
// src/components/NativeSelect/NativeSelect.tsx
|
7529
|
-
import
|
7562
|
+
import React74, { useRef as useRef11 } from "react";
|
7530
7563
|
import omit13 from "lodash/omit";
|
7531
7564
|
import uniqueId6 from "lodash/uniqueId";
|
7532
7565
|
var import_caretDown = __toESM(require_caretDown());
|
7533
|
-
var NativeSelectBase =
|
7566
|
+
var NativeSelectBase = React74.forwardRef(
|
7534
7567
|
(_a, ref) => {
|
7535
7568
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7536
7569
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7547,16 +7580,16 @@ var NativeSelectBase = React73.forwardRef(
|
|
7547
7580
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7548
7581
|
}
|
7549
7582
|
};
|
7550
|
-
return /* @__PURE__ */
|
7583
|
+
return /* @__PURE__ */ React74.createElement("span", {
|
7551
7584
|
className: tw("relative block")
|
7552
|
-
}, !readOnly && /* @__PURE__ */
|
7585
|
+
}, !readOnly && /* @__PURE__ */ React74.createElement("span", {
|
7553
7586
|
className: tw(
|
7554
7587
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7555
7588
|
)
|
7556
|
-
}, /* @__PURE__ */
|
7589
|
+
}, /* @__PURE__ */ React74.createElement(Icon, {
|
7557
7590
|
icon: import_caretDown.default,
|
7558
7591
|
"data-testid": "icon-dropdown"
|
7559
|
-
})), /* @__PURE__ */
|
7592
|
+
})), /* @__PURE__ */ React74.createElement("select", __spreadProps(__spreadValues({
|
7560
7593
|
ref,
|
7561
7594
|
disabled: disabled || readOnly,
|
7562
7595
|
required
|
@@ -7575,16 +7608,16 @@ var NativeSelectBase = React73.forwardRef(
|
|
7575
7608
|
),
|
7576
7609
|
props.className
|
7577
7610
|
)
|
7578
|
-
}), props.placeholder && /* @__PURE__ */
|
7611
|
+
}), props.placeholder && /* @__PURE__ */ React74.createElement("option", {
|
7579
7612
|
value: placeholderValue,
|
7580
7613
|
disabled: true
|
7581
7614
|
}, props.placeholder), children));
|
7582
7615
|
}
|
7583
7616
|
);
|
7584
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7617
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React74.createElement(Skeleton, {
|
7585
7618
|
height: 38
|
7586
7619
|
});
|
7587
|
-
var NativeSelect =
|
7620
|
+
var NativeSelect = React74.forwardRef(
|
7588
7621
|
(_a, ref) => {
|
7589
7622
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7590
7623
|
var _a2;
|
@@ -7593,11 +7626,11 @@ var NativeSelect = React73.forwardRef(
|
|
7593
7626
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7594
7627
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7595
7628
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
7596
|
-
return /* @__PURE__ */
|
7629
|
+
return /* @__PURE__ */ React74.createElement(LabelControl, __spreadValues({
|
7597
7630
|
id: `${id.current}-label`,
|
7598
7631
|
htmlFor: id.current,
|
7599
7632
|
messageId: errorMessageId
|
7600
|
-
}, labelControlProps), /* @__PURE__ */
|
7633
|
+
}, labelControlProps), /* @__PURE__ */ React74.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7601
7634
|
ref
|
7602
7635
|
}, baseProps), errorProps), {
|
7603
7636
|
id: id.current,
|
@@ -7611,21 +7644,21 @@ var NativeSelect = React73.forwardRef(
|
|
7611
7644
|
}
|
7612
7645
|
);
|
7613
7646
|
NativeSelect.displayName = "NativeSelect";
|
7614
|
-
var Option =
|
7647
|
+
var Option = React74.forwardRef((_a, ref) => {
|
7615
7648
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7616
|
-
return /* @__PURE__ */
|
7649
|
+
return /* @__PURE__ */ React74.createElement("option", __spreadValues({
|
7617
7650
|
ref
|
7618
7651
|
}, props), children);
|
7619
7652
|
});
|
7620
7653
|
Option.displayName = "Option";
|
7621
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
7654
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React74.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React74.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React74.createElement("div", {
|
7622
7655
|
style: { height: "1px" }
|
7623
7656
|
}));
|
7624
7657
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7625
7658
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7626
7659
|
|
7627
7660
|
// src/components/PageHeader/PageHeader.tsx
|
7628
|
-
import
|
7661
|
+
import React75 from "react";
|
7629
7662
|
import castArray3 from "lodash/castArray";
|
7630
7663
|
import omit14 from "lodash/omit";
|
7631
7664
|
var PageHeader = ({
|
@@ -7637,48 +7670,48 @@ var PageHeader = ({
|
|
7637
7670
|
chips = [],
|
7638
7671
|
breadcrumbs
|
7639
7672
|
}) => {
|
7640
|
-
return /* @__PURE__ */
|
7673
|
+
return /* @__PURE__ */ React75.createElement(Flexbox, {
|
7641
7674
|
direction: "row",
|
7642
7675
|
gap: "4",
|
7643
7676
|
paddingBottom: "6"
|
7644
|
-
}, /* @__PURE__ */
|
7677
|
+
}, /* @__PURE__ */ React75.createElement(Flexbox, {
|
7645
7678
|
className: tw("grow"),
|
7646
7679
|
direction: "column",
|
7647
7680
|
gap: "0"
|
7648
|
-
}, breadcrumbs && /* @__PURE__ */
|
7681
|
+
}, breadcrumbs && /* @__PURE__ */ React75.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React75.createElement(Flexbox, {
|
7649
7682
|
gap: "5"
|
7650
|
-
}, image && /* @__PURE__ */
|
7683
|
+
}, image && /* @__PURE__ */ React75.createElement("img", {
|
7651
7684
|
src: image,
|
7652
7685
|
alt: imageAlt,
|
7653
7686
|
className: tw("w-[56px] h-[56px]")
|
7654
|
-
}), /* @__PURE__ */
|
7687
|
+
}), /* @__PURE__ */ React75.createElement(Flexbox, {
|
7655
7688
|
direction: "column",
|
7656
7689
|
justifyContent: "center"
|
7657
|
-
}, /* @__PURE__ */
|
7690
|
+
}, /* @__PURE__ */ React75.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React75.createElement(Flexbox, {
|
7658
7691
|
gap: "3"
|
7659
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7692
|
+
}, chips.map((chip) => /* @__PURE__ */ React75.createElement(Chip2, {
|
7660
7693
|
key: chip,
|
7661
7694
|
dense: true,
|
7662
7695
|
text: chip
|
7663
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7696
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React75.createElement(Flexbox, {
|
7664
7697
|
gap: "4",
|
7665
7698
|
className: tw("self-start")
|
7666
7699
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7667
7700
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7668
|
-
return /* @__PURE__ */
|
7701
|
+
return /* @__PURE__ */ React75.createElement(SecondaryButton, __spreadValues({
|
7669
7702
|
key: text
|
7670
7703
|
}, action), text);
|
7671
|
-
}), primaryAction && /* @__PURE__ */
|
7704
|
+
}), primaryAction && /* @__PURE__ */ React75.createElement(PrimaryButton, __spreadValues({
|
7672
7705
|
key: primaryAction.text
|
7673
7706
|
}, omit14(primaryAction, "text")), primaryAction.text)));
|
7674
7707
|
};
|
7675
7708
|
|
7676
7709
|
// src/components/Pagination/Pagination.tsx
|
7677
|
-
import
|
7710
|
+
import React77 from "react";
|
7678
7711
|
import clamp from "lodash/clamp";
|
7679
7712
|
|
7680
7713
|
// src/components/Select/Select.tsx
|
7681
|
-
import
|
7714
|
+
import React76, { useRef as useRef12, useState as useState10 } from "react";
|
7682
7715
|
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7683
7716
|
import { useSelect } from "downshift";
|
7684
7717
|
import defaults from "lodash/defaults";
|
@@ -7695,10 +7728,10 @@ var hasOptionGroups = (val) => {
|
|
7695
7728
|
};
|
7696
7729
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7697
7730
|
var _a, _b;
|
7698
|
-
return /* @__PURE__ */
|
7731
|
+
return /* @__PURE__ */ React76.createElement(Select.Item, __spreadValues({
|
7699
7732
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7700
7733
|
selected: item === selectedItem
|
7701
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7734
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React76.createElement(InlineIcon, {
|
7702
7735
|
icon: item.icon
|
7703
7736
|
}), optionToString(item));
|
7704
7737
|
};
|
@@ -7815,13 +7848,13 @@ var _SelectBase = (props) => {
|
|
7815
7848
|
},
|
7816
7849
|
withDefaults
|
7817
7850
|
);
|
7818
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7851
|
+
const renderGroup = (group) => /* @__PURE__ */ React76.createElement(React76.Fragment, {
|
7819
7852
|
key: group.label
|
7820
|
-
}, /* @__PURE__ */
|
7821
|
-
const input = /* @__PURE__ */
|
7853
|
+
}, /* @__PURE__ */ React76.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7854
|
+
const input = /* @__PURE__ */ React76.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7822
7855
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7823
7856
|
tabIndex: 0
|
7824
|
-
}), /* @__PURE__ */
|
7857
|
+
}), /* @__PURE__ */ React76.createElement(Select.Input, __spreadProps(__spreadValues({
|
7825
7858
|
id,
|
7826
7859
|
name
|
7827
7860
|
}, rest), {
|
@@ -7833,28 +7866,27 @@ var _SelectBase = (props) => {
|
|
7833
7866
|
tabIndex: -1,
|
7834
7867
|
onFocus: () => setFocus(true),
|
7835
7868
|
onBlur: () => setFocus(false)
|
7836
|
-
})), !readOnly && /* @__PURE__ */
|
7869
|
+
})), !readOnly && /* @__PURE__ */ React76.createElement(Select.Toggle, {
|
7837
7870
|
disabled,
|
7838
7871
|
isOpen,
|
7839
7872
|
tabIndex: -1
|
7840
7873
|
}));
|
7841
7874
|
const width = (_b = targetRef.current) == null ? void 0 : _b.offsetWidth;
|
7842
7875
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7843
|
-
return /* @__PURE__ */
|
7876
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
7844
7877
|
className: tw("relative")
|
7845
|
-
}, labelWrapper ?
|
7878
|
+
}, labelWrapper ? React76.cloneElement(labelWrapper, { children: input }) : input, /* @__PURE__ */ React76.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7846
7879
|
isOpen: true,
|
7847
7880
|
isDismissable: true,
|
7848
7881
|
autoFocus: true
|
7849
7882
|
}, getMenuProps({ ref: overlayRef })), {
|
7850
7883
|
style,
|
7851
|
-
onClose: closeMenu
|
7852
|
-
|
7853
|
-
}), /* @__PURE__ */ React75.createElement(Select.Menu, {
|
7884
|
+
onClose: closeMenu
|
7885
|
+
}), /* @__PURE__ */ React76.createElement(Select.Menu, {
|
7854
7886
|
maxHeight
|
7855
|
-
}, isOpen && options.length === 0 && /* @__PURE__ */
|
7887
|
+
}, isOpen && options.length === 0 && /* @__PURE__ */ React76.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__ */ React76.createElement(React76.Fragment, null, /* @__PURE__ */ React76.createElement(Select.Divider, {
|
7856
7888
|
onMouseOver: () => setHighlightedIndex(-1)
|
7857
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7889
|
+
}), actions.map((act, index) => /* @__PURE__ */ React76.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7858
7890
|
key: `${index}`
|
7859
7891
|
}, act), {
|
7860
7892
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7864,10 +7896,10 @@ var _SelectBase = (props) => {
|
|
7864
7896
|
}
|
7865
7897
|
}), act.label))))));
|
7866
7898
|
};
|
7867
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7899
|
+
var SelectBase = (props) => /* @__PURE__ */ React76.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7868
7900
|
labelWrapper: void 0
|
7869
7901
|
}));
|
7870
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7902
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React76.createElement(Skeleton, {
|
7871
7903
|
height: 38
|
7872
7904
|
});
|
7873
7905
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7885,19 +7917,19 @@ var Select2 = (_a) => {
|
|
7885
7917
|
const baseProps = omit15(props, Object.keys(labelProps));
|
7886
7918
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7887
7919
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7888
|
-
const label = /* @__PURE__ */
|
7920
|
+
const label = /* @__PURE__ */ React76.createElement(Label, __spreadValues({
|
7889
7921
|
id: `${id.current}-label`,
|
7890
7922
|
htmlFor: `${id.current}-input`,
|
7891
7923
|
variant,
|
7892
7924
|
messageId: errorMessageId
|
7893
7925
|
}, labelProps));
|
7894
|
-
return /* @__PURE__ */
|
7926
|
+
return /* @__PURE__ */ React76.createElement(FormControl, null, /* @__PURE__ */ React76.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7895
7927
|
id: `${id.current}-input`,
|
7896
7928
|
options,
|
7897
7929
|
disabled: props.disabled,
|
7898
7930
|
valid: props.valid,
|
7899
7931
|
labelWrapper: label
|
7900
|
-
})), /* @__PURE__ */
|
7932
|
+
})), /* @__PURE__ */ React76.createElement(HelperText, {
|
7901
7933
|
messageId: errorMessageId,
|
7902
7934
|
error: !labelProps.valid,
|
7903
7935
|
helperText: labelProps.helperText,
|
@@ -7906,7 +7938,7 @@ var Select2 = (_a) => {
|
|
7906
7938
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7907
7939
|
}));
|
7908
7940
|
};
|
7909
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7941
|
+
var SelectSkeleton = () => /* @__PURE__ */ React76.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React76.createElement(SelectBase.Skeleton, null));
|
7910
7942
|
Select2.Skeleton = SelectSkeleton;
|
7911
7943
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
7912
7944
|
|
@@ -7925,25 +7957,23 @@ var Pagination = ({
|
|
7925
7957
|
pageSizes,
|
7926
7958
|
onPageSizeChange
|
7927
7959
|
}) => {
|
7928
|
-
const [value, setValue] =
|
7929
|
-
|
7960
|
+
const [value, setValue] = React77.useState(currentPage);
|
7961
|
+
React77.useEffect(() => {
|
7930
7962
|
setValue(currentPage);
|
7931
7963
|
}, [currentPage]);
|
7932
|
-
|
7933
|
-
onPageChange(1);
|
7934
|
-
setValue(1);
|
7935
|
-
}, [pageSize]);
|
7936
|
-
return /* @__PURE__ */ React76.createElement(Box, {
|
7964
|
+
return /* @__PURE__ */ React77.createElement(Box, {
|
7937
7965
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7938
7966
|
backgroundColor: "grey-0",
|
7939
7967
|
padding: "4"
|
7940
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
7968
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React77.createElement(Box, {
|
7941
7969
|
display: "flex",
|
7942
7970
|
alignItems: "center",
|
7943
7971
|
gap: "4"
|
7944
|
-
}, /* @__PURE__ */
|
7972
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Small, {
|
7973
|
+
color: "grey-50"
|
7974
|
+
}, "Items per page "), /* @__PURE__ */ React77.createElement("div", {
|
7945
7975
|
className: tw("max-w-[70px]")
|
7946
|
-
}, /* @__PURE__ */
|
7976
|
+
}, /* @__PURE__ */ React77.createElement(SelectBase, {
|
7947
7977
|
options: pageSizes.map((size) => size.toString()),
|
7948
7978
|
value: pageSize.toString(),
|
7949
7979
|
onChange: (size) => {
|
@@ -7954,24 +7984,26 @@ var Pagination = ({
|
|
7954
7984
|
}
|
7955
7985
|
}
|
7956
7986
|
}
|
7957
|
-
}))) : /* @__PURE__ */
|
7987
|
+
}))) : /* @__PURE__ */ React77.createElement("div", null), /* @__PURE__ */ React77.createElement(Box, {
|
7958
7988
|
display: "flex",
|
7959
7989
|
justifyContent: "center",
|
7960
7990
|
alignItems: "center",
|
7961
7991
|
className: tw("grow")
|
7962
|
-
}, /* @__PURE__ */
|
7992
|
+
}, /* @__PURE__ */ React77.createElement(IconButton, {
|
7963
7993
|
"aria-label": "First",
|
7964
7994
|
onClick: () => onPageChange(1),
|
7965
7995
|
icon: import_chevronBackward.default,
|
7966
7996
|
disabled: !hasPreviousPage
|
7967
|
-
}), /* @__PURE__ */
|
7997
|
+
}), /* @__PURE__ */ React77.createElement(IconButton, {
|
7968
7998
|
"aria-label": "Previous",
|
7969
7999
|
onClick: () => onPageChange(currentPage - 1),
|
7970
8000
|
icon: import_chevronLeft3.default,
|
7971
8001
|
disabled: !hasPreviousPage
|
7972
|
-
}), /* @__PURE__ */
|
8002
|
+
}), /* @__PURE__ */ React77.createElement(Box, {
|
7973
8003
|
paddingX: "4"
|
7974
|
-
}, /* @__PURE__ */
|
8004
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Small, {
|
8005
|
+
color: "grey-60"
|
8006
|
+
}, "Page")), /* @__PURE__ */ React77.createElement(InputBase, {
|
7975
8007
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
7976
8008
|
type: "number",
|
7977
8009
|
min: 1,
|
@@ -7985,52 +8017,48 @@ var Pagination = ({
|
|
7985
8017
|
},
|
7986
8018
|
onBlur: ({ target: { value: value2 } }) => {
|
7987
8019
|
const numberValue = parseInt(value2);
|
7988
|
-
|
7989
|
-
|
7990
|
-
onPageChange(newPage);
|
7991
|
-
setValue(newPage);
|
7992
|
-
} else {
|
7993
|
-
onPageChange(1);
|
7994
|
-
setValue(1);
|
7995
|
-
}
|
8020
|
+
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
8021
|
+
onPageChange(newPage);
|
7996
8022
|
}
|
7997
|
-
}), /* @__PURE__ */
|
8023
|
+
}), /* @__PURE__ */ React77.createElement(Box, {
|
7998
8024
|
paddingX: "4"
|
7999
|
-
}, /* @__PURE__ */
|
8025
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Small, {
|
8026
|
+
color: "grey-60"
|
8027
|
+
}, "of ", totalPages)), /* @__PURE__ */ React77.createElement(IconButton, {
|
8000
8028
|
"aria-label": "Next",
|
8001
8029
|
onClick: () => onPageChange(currentPage + 1),
|
8002
8030
|
icon: import_chevronRight3.default,
|
8003
8031
|
disabled: !hasNextPage
|
8004
|
-
}), /* @__PURE__ */
|
8032
|
+
}), /* @__PURE__ */ React77.createElement(IconButton, {
|
8005
8033
|
"aria-label": "Last",
|
8006
8034
|
onClick: () => onPageChange(totalPages),
|
8007
8035
|
icon: import_chevronForward.default,
|
8008
8036
|
disabled: !hasNextPage
|
8009
|
-
})), /* @__PURE__ */
|
8037
|
+
})), /* @__PURE__ */ React77.createElement("div", null));
|
8010
8038
|
};
|
8011
8039
|
|
8012
8040
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
8013
|
-
import
|
8041
|
+
import React79 from "react";
|
8014
8042
|
import omit16 from "lodash/omit";
|
8015
8043
|
|
8016
8044
|
// src/common/PopoverDialog/PopoverDialog.tsx
|
8017
|
-
import
|
8045
|
+
import React78 from "react";
|
8018
8046
|
var Header = (_a) => {
|
8019
8047
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8020
|
-
return /* @__PURE__ */
|
8048
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8021
8049
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
8022
8050
|
}), children);
|
8023
8051
|
};
|
8024
8052
|
var Title = (_a) => {
|
8025
8053
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8026
|
-
return /* @__PURE__ */
|
8054
|
+
return /* @__PURE__ */ React78.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
8027
8055
|
htmlTag: "h1",
|
8028
8056
|
variant: "small-strong"
|
8029
8057
|
}), children);
|
8030
8058
|
};
|
8031
8059
|
var Body = (_a) => {
|
8032
8060
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8033
|
-
return /* @__PURE__ */
|
8061
|
+
return /* @__PURE__ */ React78.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
8034
8062
|
htmlTag: "div",
|
8035
8063
|
variant: "caption",
|
8036
8064
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -8038,13 +8066,13 @@ var Body = (_a) => {
|
|
8038
8066
|
};
|
8039
8067
|
var Footer = (_a) => {
|
8040
8068
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8041
|
-
return /* @__PURE__ */
|
8069
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8042
8070
|
className: classNames(tw("p-5"), className)
|
8043
8071
|
}), children);
|
8044
8072
|
};
|
8045
8073
|
var Actions2 = (_a) => {
|
8046
8074
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8047
|
-
return /* @__PURE__ */
|
8075
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8048
8076
|
className: classNames(tw("flex gap-4"), className)
|
8049
8077
|
}), children);
|
8050
8078
|
};
|
@@ -8060,13 +8088,13 @@ var PopoverDialog = {
|
|
8060
8088
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
8061
8089
|
const wrapPromptWithBody = (child) => {
|
8062
8090
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
8063
|
-
return /* @__PURE__ */
|
8091
|
+
return /* @__PURE__ */ React79.createElement(Popover2.Panel, {
|
8064
8092
|
className: tw("max-w-[300px]")
|
8065
|
-
}, /* @__PURE__ */
|
8093
|
+
}, /* @__PURE__ */ React79.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React79.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React79.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React79.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React79.createElement(Popover2.Button, __spreadValues({
|
8066
8094
|
kind: "secondary-ghost",
|
8067
8095
|
key: secondaryAction.text,
|
8068
8096
|
dense: true
|
8069
|
-
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
8097
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React79.createElement(Popover2.Button, __spreadValues({
|
8070
8098
|
kind: "ghost",
|
8071
8099
|
key: primaryAction.text,
|
8072
8100
|
dense: true
|
@@ -8074,7 +8102,7 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8074
8102
|
}
|
8075
8103
|
return child;
|
8076
8104
|
};
|
8077
|
-
return /* @__PURE__ */
|
8105
|
+
return /* @__PURE__ */ React79.createElement(Popover2, {
|
8078
8106
|
type: "dialog",
|
8079
8107
|
isOpen: open,
|
8080
8108
|
placement,
|
@@ -8082,10 +8110,10 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8082
8110
|
isKeyboardDismissDisabled: false,
|
8083
8111
|
autoFocus: true,
|
8084
8112
|
containFocus: true
|
8085
|
-
},
|
8113
|
+
}, React79.Children.map(children, wrapPromptWithBody));
|
8086
8114
|
};
|
8087
8115
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
8088
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
8116
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React79.createElement(PopoverDialog.Body, null, children);
|
8089
8117
|
Prompt.displayName = "PopoverDialog.Prompt";
|
8090
8118
|
PopoverDialog2.Prompt = Prompt;
|
8091
8119
|
|
@@ -8094,14 +8122,14 @@ import { createPortal } from "react-dom";
|
|
8094
8122
|
var Portal = ({ children, to }) => createPortal(children, to);
|
8095
8123
|
|
8096
8124
|
// src/components/ProgressBar/ProgressBar.tsx
|
8097
|
-
import
|
8125
|
+
import React81 from "react";
|
8098
8126
|
|
8099
8127
|
// src/common/ProgressBar/ProgressBar.tsx
|
8100
|
-
import
|
8128
|
+
import React80 from "react";
|
8101
8129
|
import clamp2 from "lodash/clamp";
|
8102
8130
|
var ProgressBar = (_a) => {
|
8103
8131
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8104
|
-
return /* @__PURE__ */
|
8132
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8105
8133
|
className: classNames(
|
8106
8134
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
8107
8135
|
className
|
@@ -8117,7 +8145,7 @@ var STATUS_COLORS = {
|
|
8117
8145
|
ProgressBar.Indicator = (_a) => {
|
8118
8146
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
8119
8147
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
8120
|
-
return /* @__PURE__ */
|
8148
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8121
8149
|
className: classNames(
|
8122
8150
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
8123
8151
|
STATUS_COLORS[status],
|
@@ -8133,11 +8161,11 @@ ProgressBar.Indicator = (_a) => {
|
|
8133
8161
|
};
|
8134
8162
|
ProgressBar.Labels = (_a) => {
|
8135
8163
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
8136
|
-
return /* @__PURE__ */
|
8164
|
+
return /* @__PURE__ */ React80.createElement("div", {
|
8137
8165
|
className: classNames(tw("flex flex-row"), className)
|
8138
|
-
}, /* @__PURE__ */
|
8166
|
+
}, /* @__PURE__ */ React80.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8139
8167
|
className: tw("grow text-grey-70 typography-caption")
|
8140
|
-
}), startLabel), /* @__PURE__ */
|
8168
|
+
}), startLabel), /* @__PURE__ */ React80.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8141
8169
|
className: tw("grow text-grey-70 typography-caption text-right")
|
8142
8170
|
}), endLabel));
|
8143
8171
|
};
|
@@ -8155,7 +8183,7 @@ var ProgressBar2 = (props) => {
|
|
8155
8183
|
if (min > max) {
|
8156
8184
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
8157
8185
|
}
|
8158
|
-
const progress = /* @__PURE__ */
|
8186
|
+
const progress = /* @__PURE__ */ React81.createElement(ProgressBar, null, /* @__PURE__ */ React81.createElement(ProgressBar.Indicator, {
|
8159
8187
|
status: value === max ? completedStatus : progresStatus,
|
8160
8188
|
min,
|
8161
8189
|
max,
|
@@ -8165,13 +8193,13 @@ var ProgressBar2 = (props) => {
|
|
8165
8193
|
if (props.dense) {
|
8166
8194
|
return progress;
|
8167
8195
|
}
|
8168
|
-
return /* @__PURE__ */
|
8196
|
+
return /* @__PURE__ */ React81.createElement("div", null, progress, /* @__PURE__ */ React81.createElement(ProgressBar.Labels, {
|
8169
8197
|
className: tw("py-2"),
|
8170
8198
|
startLabel: props.startLabel,
|
8171
8199
|
endLabel: props.endLabel
|
8172
8200
|
}));
|
8173
8201
|
};
|
8174
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
8202
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React81.createElement(Skeleton, {
|
8175
8203
|
height: 4,
|
8176
8204
|
display: "block"
|
8177
8205
|
});
|
@@ -8179,13 +8207,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
8179
8207
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
8180
8208
|
|
8181
8209
|
// src/components/RadioButton/RadioButton.tsx
|
8182
|
-
import
|
8183
|
-
var RadioButton2 =
|
8210
|
+
import React82 from "react";
|
8211
|
+
var RadioButton2 = React82.forwardRef(
|
8184
8212
|
(_a, ref) => {
|
8185
8213
|
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"]);
|
8186
8214
|
var _a2;
|
8187
8215
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8188
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8216
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React82.createElement(ControlLabel, {
|
8189
8217
|
htmlFor: id,
|
8190
8218
|
label: children,
|
8191
8219
|
"aria-label": ariaLabel,
|
@@ -8193,7 +8221,7 @@ var RadioButton2 = React81.forwardRef(
|
|
8193
8221
|
readOnly,
|
8194
8222
|
disabled,
|
8195
8223
|
style: { gap: "0 8px" }
|
8196
|
-
}, !readOnly && /* @__PURE__ */
|
8224
|
+
}, !readOnly && /* @__PURE__ */ React82.createElement(RadioButton, __spreadProps(__spreadValues({
|
8197
8225
|
id,
|
8198
8226
|
ref,
|
8199
8227
|
name
|
@@ -8204,12 +8232,12 @@ var RadioButton2 = React81.forwardRef(
|
|
8204
8232
|
}
|
8205
8233
|
);
|
8206
8234
|
RadioButton2.displayName = "RadioButton";
|
8207
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
8235
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React82.createElement("div", {
|
8208
8236
|
className: tw("flex gap-3")
|
8209
|
-
}, /* @__PURE__ */
|
8237
|
+
}, /* @__PURE__ */ React82.createElement(Skeleton, {
|
8210
8238
|
height: 20,
|
8211
8239
|
width: 20
|
8212
|
-
}), /* @__PURE__ */
|
8240
|
+
}), /* @__PURE__ */ React82.createElement(Skeleton, {
|
8213
8241
|
height: 20,
|
8214
8242
|
width: 150
|
8215
8243
|
}));
|
@@ -8217,10 +8245,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
8217
8245
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
8218
8246
|
|
8219
8247
|
// src/components/RadioButtonGroup/RadioButtonGroup.tsx
|
8220
|
-
import
|
8248
|
+
import React83 from "react";
|
8221
8249
|
import uniqueId8 from "lodash/uniqueId";
|
8222
8250
|
var isRadioButton = (c) => {
|
8223
|
-
return
|
8251
|
+
return React83.isValidElement(c) && c.type === RadioButton2;
|
8224
8252
|
};
|
8225
8253
|
var RadioButtonGroup = (_a) => {
|
8226
8254
|
var _b = _a, {
|
@@ -8243,7 +8271,7 @@ var RadioButtonGroup = (_a) => {
|
|
8243
8271
|
"children"
|
8244
8272
|
]);
|
8245
8273
|
var _a2;
|
8246
|
-
const [value, setValue] =
|
8274
|
+
const [value, setValue] = React83.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
8247
8275
|
const errorMessageId = uniqueId8();
|
8248
8276
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8249
8277
|
const labelControlProps = getLabelControlProps(props);
|
@@ -8254,14 +8282,14 @@ var RadioButtonGroup = (_a) => {
|
|
8254
8282
|
setValue(e.target.value);
|
8255
8283
|
onChange == null ? void 0 : onChange(e.target.value);
|
8256
8284
|
};
|
8257
|
-
const content =
|
8285
|
+
const content = React83.Children.map(children, (c) => {
|
8258
8286
|
var _a3, _b2, _c;
|
8259
8287
|
if (!isRadioButton(c)) {
|
8260
8288
|
return null;
|
8261
8289
|
}
|
8262
8290
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
8263
8291
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
8264
|
-
return
|
8292
|
+
return React83.cloneElement(c, {
|
8265
8293
|
name,
|
8266
8294
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
8267
8295
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -8270,11 +8298,11 @@ var RadioButtonGroup = (_a) => {
|
|
8270
8298
|
readOnly
|
8271
8299
|
});
|
8272
8300
|
});
|
8273
|
-
return /* @__PURE__ */
|
8301
|
+
return /* @__PURE__ */ React83.createElement(LabelControl, __spreadValues(__spreadValues({
|
8274
8302
|
fieldset: true
|
8275
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
8303
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React83.createElement(InputGroup, {
|
8276
8304
|
cols
|
8277
|
-
}, content), !cols && /* @__PURE__ */
|
8305
|
+
}, content), !cols && /* @__PURE__ */ React83.createElement(Flexbox, {
|
8278
8306
|
direction,
|
8279
8307
|
alignItems: "flex-start",
|
8280
8308
|
colGap: "8",
|
@@ -8283,12 +8311,12 @@ var RadioButtonGroup = (_a) => {
|
|
8283
8311
|
}, content));
|
8284
8312
|
};
|
8285
8313
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
8286
|
-
return /* @__PURE__ */
|
8314
|
+
return /* @__PURE__ */ React83.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React83.createElement("div", {
|
8287
8315
|
className: tw("flex flex-wrap", {
|
8288
8316
|
"flex-row gap-8": direction === "row",
|
8289
8317
|
"flex-col gap-2": direction === "column"
|
8290
8318
|
})
|
8291
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8319
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React83.createElement(RadioButton2.Skeleton, {
|
8292
8320
|
key
|
8293
8321
|
}))));
|
8294
8322
|
};
|
@@ -8296,68 +8324,68 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
8296
8324
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
8297
8325
|
|
8298
8326
|
// src/components/Section/Section.tsx
|
8299
|
-
import
|
8327
|
+
import React85 from "react";
|
8300
8328
|
import castArray4 from "lodash/castArray";
|
8301
8329
|
|
8302
8330
|
// src/common/Section/Section.tsx
|
8303
|
-
import
|
8331
|
+
import React84 from "react";
|
8304
8332
|
var Section2 = (_a) => {
|
8305
8333
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8306
|
-
return /* @__PURE__ */
|
8334
|
+
return /* @__PURE__ */ React84.createElement(Box, __spreadValues({
|
8307
8335
|
borderColor: "grey-5",
|
8308
8336
|
borderWidth: "1px"
|
8309
8337
|
}, rest), children);
|
8310
8338
|
};
|
8311
8339
|
Section2.Header = (_a) => {
|
8312
8340
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8313
|
-
return /* @__PURE__ */
|
8341
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8314
8342
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8315
8343
|
}), children);
|
8316
8344
|
};
|
8317
8345
|
Section2.TitleContainer = (_a) => {
|
8318
8346
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8319
|
-
return /* @__PURE__ */
|
8347
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8320
8348
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8321
8349
|
}), children);
|
8322
8350
|
};
|
8323
8351
|
Section2.Title = (_a) => {
|
8324
8352
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8325
|
-
return /* @__PURE__ */
|
8353
|
+
return /* @__PURE__ */ React84.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8326
8354
|
color: "black"
|
8327
8355
|
}), children);
|
8328
8356
|
};
|
8329
8357
|
Section2.Subtitle = (_a) => {
|
8330
8358
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8331
|
-
return /* @__PURE__ */
|
8359
|
+
return /* @__PURE__ */ React84.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8332
8360
|
color: "grey-70"
|
8333
8361
|
}), children);
|
8334
8362
|
};
|
8335
8363
|
Section2.Actions = (_a) => {
|
8336
8364
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8337
|
-
return /* @__PURE__ */
|
8365
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8338
8366
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8339
8367
|
}), children);
|
8340
8368
|
};
|
8341
8369
|
Section2.Body = (_a) => {
|
8342
8370
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8343
|
-
return /* @__PURE__ */
|
8371
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8344
8372
|
className: classNames(tw("p-6"), className)
|
8345
|
-
}), /* @__PURE__ */
|
8373
|
+
}), /* @__PURE__ */ React84.createElement(Typography, {
|
8346
8374
|
htmlTag: "div",
|
8347
8375
|
color: "grey-70"
|
8348
8376
|
}, children));
|
8349
8377
|
};
|
8350
8378
|
|
8351
8379
|
// src/components/Section/Section.tsx
|
8352
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8380
|
+
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React85.createElement(Section2, null, title && /* @__PURE__ */ React85.createElement(React85.Fragment, null, /* @__PURE__ */ React85.createElement(Section2.Header, null, /* @__PURE__ */ React85.createElement(Section2.TitleContainer, null, /* @__PURE__ */ React85.createElement(Section2.Title, null, title), subtitle && /* @__PURE__ */ React85.createElement(Section2.Subtitle, null, subtitle)), /* @__PURE__ */ React85.createElement(Section2.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
|
8353
8381
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8354
|
-
return /* @__PURE__ */
|
8382
|
+
return /* @__PURE__ */ React85.createElement(SecondaryButton, __spreadValues({
|
8355
8383
|
key: text
|
8356
8384
|
}, action), text);
|
8357
|
-
}))), /* @__PURE__ */
|
8385
|
+
}))), /* @__PURE__ */ React85.createElement(Divider2, null)), /* @__PURE__ */ React85.createElement(Section2.Body, null, children));
|
8358
8386
|
|
8359
8387
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
8360
|
-
import
|
8388
|
+
import React86 from "react";
|
8361
8389
|
var SegmentedControl = (_a) => {
|
8362
8390
|
var _b = _a, {
|
8363
8391
|
children,
|
@@ -8374,7 +8402,7 @@ var SegmentedControl = (_a) => {
|
|
8374
8402
|
"selected",
|
8375
8403
|
"className"
|
8376
8404
|
]);
|
8377
|
-
return /* @__PURE__ */
|
8405
|
+
return /* @__PURE__ */ React86.createElement("button", __spreadProps(__spreadValues({
|
8378
8406
|
type: "button"
|
8379
8407
|
}, rest), {
|
8380
8408
|
className: classNames(
|
@@ -8405,11 +8433,11 @@ var SegmentedControlGroup = (_a) => {
|
|
8405
8433
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8406
8434
|
"bg-grey-0": variant === "raised"
|
8407
8435
|
});
|
8408
|
-
return /* @__PURE__ */
|
8436
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8409
8437
|
className: classNames(classes2, className)
|
8410
|
-
}),
|
8438
|
+
}), React86.Children.map(
|
8411
8439
|
children,
|
8412
|
-
(child) =>
|
8440
|
+
(child) => React86.cloneElement(child, {
|
8413
8441
|
dense,
|
8414
8442
|
variant,
|
8415
8443
|
onClick: () => onChange(child.props.value),
|
@@ -8447,14 +8475,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8447
8475
|
);
|
8448
8476
|
|
8449
8477
|
// src/components/Stepper/Stepper.tsx
|
8450
|
-
import
|
8478
|
+
import React88 from "react";
|
8451
8479
|
|
8452
8480
|
// src/common/Stepper/Stepper.tsx
|
8453
|
-
import
|
8481
|
+
import React87 from "react";
|
8454
8482
|
var import_tick5 = __toESM(require_tick());
|
8455
8483
|
var Stepper = (_a) => {
|
8456
8484
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8457
|
-
return /* @__PURE__ */
|
8485
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8458
8486
|
className: classNames(className)
|
8459
8487
|
}));
|
8460
8488
|
};
|
@@ -8468,7 +8496,7 @@ var ConnectorContainer = (_a) => {
|
|
8468
8496
|
"completed",
|
8469
8497
|
"dense"
|
8470
8498
|
]);
|
8471
|
-
return /* @__PURE__ */
|
8499
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8472
8500
|
className: classNames(
|
8473
8501
|
tw("absolute w-full -left-1/2", {
|
8474
8502
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -8480,7 +8508,7 @@ var ConnectorContainer = (_a) => {
|
|
8480
8508
|
};
|
8481
8509
|
var Connector = (_a) => {
|
8482
8510
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8483
|
-
return /* @__PURE__ */
|
8511
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8484
8512
|
className: classNames(
|
8485
8513
|
tw("w-full", {
|
8486
8514
|
"bg-grey-20": !completed,
|
@@ -8494,7 +8522,7 @@ var Connector = (_a) => {
|
|
8494
8522
|
};
|
8495
8523
|
var Step = (_a) => {
|
8496
8524
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8497
|
-
return /* @__PURE__ */
|
8525
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8498
8526
|
className: classNames(
|
8499
8527
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8500
8528
|
"text-grey-20": state === "inactive"
|
@@ -8515,13 +8543,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
8515
8543
|
});
|
8516
8544
|
var Indicator = (_a) => {
|
8517
8545
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8518
|
-
return /* @__PURE__ */
|
8546
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8519
8547
|
className: classNames(
|
8520
8548
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8521
8549
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
8522
8550
|
className
|
8523
8551
|
)
|
8524
|
-
}), state === "completed" ? /* @__PURE__ */
|
8552
|
+
}), state === "completed" ? /* @__PURE__ */ React87.createElement(InlineIcon, {
|
8525
8553
|
icon: import_tick5.default
|
8526
8554
|
}) : dense ? null : children);
|
8527
8555
|
};
|
@@ -8532,25 +8560,25 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
8532
8560
|
|
8533
8561
|
// src/components/Stepper/Stepper.tsx
|
8534
8562
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8535
|
-
const steps =
|
8536
|
-
return /* @__PURE__ */
|
8563
|
+
const steps = React88.Children.count(children);
|
8564
|
+
return /* @__PURE__ */ React88.createElement(Stepper, {
|
8537
8565
|
role: "list"
|
8538
|
-
}, /* @__PURE__ */
|
8566
|
+
}, /* @__PURE__ */ React88.createElement(Template, {
|
8539
8567
|
columns: steps
|
8540
|
-
},
|
8568
|
+
}, React88.Children.map(children, (child, index) => {
|
8541
8569
|
if (!isComponentType(child, Step2)) {
|
8542
8570
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8543
8571
|
} else {
|
8544
8572
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8545
|
-
return /* @__PURE__ */
|
8573
|
+
return /* @__PURE__ */ React88.createElement(Stepper.Step, {
|
8546
8574
|
state,
|
8547
8575
|
"aria-current": state === "active" ? "step" : false,
|
8548
8576
|
role: "listitem"
|
8549
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
8577
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React88.createElement(Stepper.ConnectorContainer, {
|
8550
8578
|
dense
|
8551
|
-
}, /* @__PURE__ */
|
8579
|
+
}, /* @__PURE__ */ React88.createElement(Stepper.ConnectorContainer.Connector, {
|
8552
8580
|
completed: state === "completed" || state === "active"
|
8553
|
-
})), /* @__PURE__ */
|
8581
|
+
})), /* @__PURE__ */ React88.createElement(Stepper.Step.Indicator, {
|
8554
8582
|
state,
|
8555
8583
|
dense
|
8556
8584
|
}, index + 1), child.props.children);
|
@@ -8562,16 +8590,16 @@ Step2.displayName = "Stepper.Step";
|
|
8562
8590
|
Stepper2.Step = Step2;
|
8563
8591
|
|
8564
8592
|
// src/components/Switch/Switch.tsx
|
8565
|
-
import
|
8593
|
+
import React90 from "react";
|
8566
8594
|
|
8567
8595
|
// src/common/Switch/Switch.tsx
|
8568
|
-
import
|
8569
|
-
var Switch =
|
8596
|
+
import React89 from "react";
|
8597
|
+
var Switch = React89.forwardRef(
|
8570
8598
|
(_a, ref) => {
|
8571
8599
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8572
|
-
return /* @__PURE__ */
|
8600
|
+
return /* @__PURE__ */ React89.createElement("span", {
|
8573
8601
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8574
|
-
}, /* @__PURE__ */
|
8602
|
+
}, /* @__PURE__ */ React89.createElement("input", __spreadProps(__spreadValues({
|
8575
8603
|
id,
|
8576
8604
|
ref,
|
8577
8605
|
type: "checkbox",
|
@@ -8590,7 +8618,7 @@ var Switch = React88.forwardRef(
|
|
8590
8618
|
),
|
8591
8619
|
readOnly,
|
8592
8620
|
disabled
|
8593
|
-
})), /* @__PURE__ */
|
8621
|
+
})), /* @__PURE__ */ React89.createElement("span", {
|
8594
8622
|
className: tw(
|
8595
8623
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8596
8624
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8603,12 +8631,12 @@ var Switch = React88.forwardRef(
|
|
8603
8631
|
);
|
8604
8632
|
|
8605
8633
|
// src/components/Switch/Switch.tsx
|
8606
|
-
var Switch2 =
|
8634
|
+
var Switch2 = React90.forwardRef(
|
8607
8635
|
(_a, ref) => {
|
8608
8636
|
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"]);
|
8609
8637
|
var _a2;
|
8610
8638
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8611
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8639
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React90.createElement(ControlLabel, {
|
8612
8640
|
htmlFor: id,
|
8613
8641
|
label: children,
|
8614
8642
|
"aria-label": ariaLabel,
|
@@ -8616,7 +8644,7 @@ var Switch2 = React89.forwardRef(
|
|
8616
8644
|
readOnly,
|
8617
8645
|
disabled,
|
8618
8646
|
style: { gap: "0 8px" }
|
8619
|
-
}, !readOnly && /* @__PURE__ */
|
8647
|
+
}, !readOnly && /* @__PURE__ */ React90.createElement(Switch, __spreadProps(__spreadValues({
|
8620
8648
|
id,
|
8621
8649
|
ref,
|
8622
8650
|
name
|
@@ -8627,12 +8655,12 @@ var Switch2 = React89.forwardRef(
|
|
8627
8655
|
}
|
8628
8656
|
);
|
8629
8657
|
Switch2.displayName = "Switch";
|
8630
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
8658
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React90.createElement("div", {
|
8631
8659
|
className: tw("flex gap-3")
|
8632
|
-
}, /* @__PURE__ */
|
8660
|
+
}, /* @__PURE__ */ React90.createElement(Skeleton, {
|
8633
8661
|
height: 20,
|
8634
8662
|
width: 35
|
8635
|
-
}), /* @__PURE__ */
|
8663
|
+
}), /* @__PURE__ */ React90.createElement(Skeleton, {
|
8636
8664
|
height: 20,
|
8637
8665
|
width: 150
|
8638
8666
|
}));
|
@@ -8640,7 +8668,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
8640
8668
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
8641
8669
|
|
8642
8670
|
// src/components/SwitchGroup/SwitchGroup.tsx
|
8643
|
-
import
|
8671
|
+
import React91, { useState as useState11 } from "react";
|
8644
8672
|
import uniqueId9 from "lodash/uniqueId";
|
8645
8673
|
var SwitchGroup = (_a) => {
|
8646
8674
|
var _b = _a, {
|
@@ -8672,11 +8700,11 @@ var SwitchGroup = (_a) => {
|
|
8672
8700
|
setSelectedItems(updated);
|
8673
8701
|
onChange == null ? void 0 : onChange(updated);
|
8674
8702
|
};
|
8675
|
-
return /* @__PURE__ */
|
8703
|
+
return /* @__PURE__ */ React91.createElement(LabelControl, __spreadValues(__spreadValues({
|
8676
8704
|
fieldset: true
|
8677
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8705
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React91.createElement(InputGroup, {
|
8678
8706
|
cols
|
8679
|
-
},
|
8707
|
+
}, React91.Children.map(children, (c) => {
|
8680
8708
|
var _a3, _b2, _c, _d;
|
8681
8709
|
if (!isComponentType(c, Switch2)) {
|
8682
8710
|
return null;
|
@@ -8684,7 +8712,7 @@ var SwitchGroup = (_a) => {
|
|
8684
8712
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8685
8713
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8686
8714
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8687
|
-
return
|
8715
|
+
return React91.cloneElement(c, {
|
8688
8716
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8689
8717
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8690
8718
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8694,9 +8722,9 @@ var SwitchGroup = (_a) => {
|
|
8694
8722
|
})));
|
8695
8723
|
};
|
8696
8724
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8697
|
-
return /* @__PURE__ */
|
8725
|
+
return /* @__PURE__ */ React91.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React91.createElement("div", {
|
8698
8726
|
className: tw("flex flex-wrap flex-col gap-2")
|
8699
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8727
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React91.createElement(Switch2.Skeleton, {
|
8700
8728
|
key
|
8701
8729
|
}))));
|
8702
8730
|
};
|
@@ -8704,10 +8732,10 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
8704
8732
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
8705
8733
|
|
8706
8734
|
// src/components/TagLabel/TagLabel.tsx
|
8707
|
-
import
|
8735
|
+
import React92 from "react";
|
8708
8736
|
var TagLabel = (_a) => {
|
8709
8737
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8710
|
-
return /* @__PURE__ */
|
8738
|
+
return /* @__PURE__ */ React92.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8711
8739
|
className: tw("rounded-full text-white bg-primary-70", {
|
8712
8740
|
"py-2 px-4 typography-caption": !dense,
|
8713
8741
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8716,14 +8744,14 @@ var TagLabel = (_a) => {
|
|
8716
8744
|
};
|
8717
8745
|
|
8718
8746
|
// src/components/Textarea/Textarea.tsx
|
8719
|
-
import
|
8747
|
+
import React93, { useRef as useRef13, useState as useState12 } from "react";
|
8720
8748
|
import omit17 from "lodash/omit";
|
8721
8749
|
import toString2 from "lodash/toString";
|
8722
8750
|
import uniqueId10 from "lodash/uniqueId";
|
8723
|
-
var TextareaBase =
|
8751
|
+
var TextareaBase = React93.forwardRef(
|
8724
8752
|
(_a, ref) => {
|
8725
8753
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8726
|
-
return /* @__PURE__ */
|
8754
|
+
return /* @__PURE__ */ React93.createElement("textarea", __spreadProps(__spreadValues({
|
8727
8755
|
ref
|
8728
8756
|
}, props), {
|
8729
8757
|
readOnly,
|
@@ -8731,10 +8759,10 @@ var TextareaBase = React92.forwardRef(
|
|
8731
8759
|
}));
|
8732
8760
|
}
|
8733
8761
|
);
|
8734
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8762
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React93.createElement(Skeleton, {
|
8735
8763
|
height: 58
|
8736
8764
|
});
|
8737
|
-
var Textarea =
|
8765
|
+
var Textarea = React93.forwardRef((props, ref) => {
|
8738
8766
|
var _a, _b, _c;
|
8739
8767
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8740
8768
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
@@ -8742,12 +8770,12 @@ var Textarea = React92.forwardRef((props, ref) => {
|
|
8742
8770
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8743
8771
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8744
8772
|
const baseProps = omit17(props, Object.keys(labelControlProps));
|
8745
|
-
return /* @__PURE__ */
|
8773
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, __spreadValues({
|
8746
8774
|
id: `${id.current}-label`,
|
8747
8775
|
htmlFor: id.current,
|
8748
8776
|
messageId: errorMessageId,
|
8749
8777
|
length: value !== void 0 ? toString2(value).length : void 0
|
8750
|
-
}, labelControlProps), /* @__PURE__ */
|
8778
|
+
}, labelControlProps), /* @__PURE__ */ React93.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8751
8779
|
ref
|
8752
8780
|
}, baseProps), errorProps), {
|
8753
8781
|
id: id.current,
|
@@ -8764,48 +8792,48 @@ var Textarea = React92.forwardRef((props, ref) => {
|
|
8764
8792
|
})));
|
8765
8793
|
});
|
8766
8794
|
Textarea.displayName = "Textarea";
|
8767
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
8795
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement(TextareaBase.Skeleton, null));
|
8768
8796
|
Textarea.Skeleton = TextAreaSkeleton;
|
8769
8797
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
8770
8798
|
|
8771
8799
|
// src/components/Timeline/Timeline.tsx
|
8772
|
-
import
|
8800
|
+
import React95 from "react";
|
8773
8801
|
|
8774
8802
|
// src/common/Timeline/Timeline.tsx
|
8775
|
-
import
|
8803
|
+
import React94 from "react";
|
8776
8804
|
var Timeline = (_a) => {
|
8777
8805
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8778
|
-
return /* @__PURE__ */
|
8806
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8779
8807
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8780
8808
|
}));
|
8781
8809
|
};
|
8782
8810
|
var Content2 = (_a) => {
|
8783
8811
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8784
|
-
return /* @__PURE__ */
|
8812
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8785
8813
|
className: classNames(tw("pb-6"), className)
|
8786
8814
|
}));
|
8787
8815
|
};
|
8788
8816
|
var Separator2 = (_a) => {
|
8789
8817
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8790
|
-
return /* @__PURE__ */
|
8818
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8791
8819
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8792
8820
|
}));
|
8793
8821
|
};
|
8794
8822
|
var LineContainer = (_a) => {
|
8795
8823
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8796
|
-
return /* @__PURE__ */
|
8824
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8797
8825
|
className: classNames(tw("flex justify-center py-1"), className)
|
8798
8826
|
}));
|
8799
8827
|
};
|
8800
8828
|
var Line = (_a) => {
|
8801
8829
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8802
|
-
return /* @__PURE__ */
|
8830
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8803
8831
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8804
8832
|
}));
|
8805
8833
|
};
|
8806
8834
|
var Dot = (_a) => {
|
8807
8835
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8808
|
-
return /* @__PURE__ */
|
8836
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8809
8837
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8810
8838
|
}));
|
8811
8839
|
};
|
@@ -8820,52 +8848,52 @@ var import_error4 = __toESM(require_error());
|
|
8820
8848
|
var import_time = __toESM(require_time());
|
8821
8849
|
var import_warningSign4 = __toESM(require_warningSign());
|
8822
8850
|
var TimelineItem = () => null;
|
8823
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8851
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React95.createElement("div", null, React95.Children.map(children, (item) => {
|
8824
8852
|
if (!isComponentType(item, TimelineItem)) {
|
8825
8853
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8826
8854
|
} else {
|
8827
8855
|
const { props, key } = item;
|
8828
|
-
return /* @__PURE__ */
|
8856
|
+
return /* @__PURE__ */ React95.createElement(Timeline, {
|
8829
8857
|
key: key != null ? key : props.title
|
8830
|
-
}, /* @__PURE__ */
|
8858
|
+
}, /* @__PURE__ */ React95.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React95.createElement(Icon, {
|
8831
8859
|
icon: import_error4.default,
|
8832
8860
|
color: "error-30"
|
8833
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8861
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React95.createElement(Icon, {
|
8834
8862
|
icon: import_warningSign4.default,
|
8835
8863
|
color: "warning-30"
|
8836
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8864
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React95.createElement(Icon, {
|
8837
8865
|
icon: import_time.default,
|
8838
8866
|
color: "info-30"
|
8839
|
-
}) : /* @__PURE__ */
|
8867
|
+
}) : /* @__PURE__ */ React95.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React95.createElement(Typography2.Caption, {
|
8840
8868
|
color: "grey-50"
|
8841
|
-
}, props.title), /* @__PURE__ */
|
8869
|
+
}, props.title), /* @__PURE__ */ React95.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React95.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React95.createElement(Timeline.Content, null, /* @__PURE__ */ React95.createElement(Typography2.Small, null, props.children)));
|
8842
8870
|
}
|
8843
8871
|
}));
|
8844
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8872
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React95.createElement(Timeline, null, /* @__PURE__ */ React95.createElement(Timeline.Separator, null, /* @__PURE__ */ React95.createElement(Skeleton, {
|
8845
8873
|
width: 6,
|
8846
8874
|
height: 6,
|
8847
8875
|
rounded: true
|
8848
|
-
})), /* @__PURE__ */
|
8876
|
+
})), /* @__PURE__ */ React95.createElement(Skeleton, {
|
8849
8877
|
height: 12,
|
8850
8878
|
width: 120
|
8851
|
-
}), /* @__PURE__ */
|
8879
|
+
}), /* @__PURE__ */ React95.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React95.createElement(Skeleton, {
|
8852
8880
|
width: 2,
|
8853
8881
|
height: "100%"
|
8854
|
-
})), /* @__PURE__ */
|
8882
|
+
})), /* @__PURE__ */ React95.createElement(Timeline.Content, null, /* @__PURE__ */ React95.createElement(Box, {
|
8855
8883
|
display: "flex",
|
8856
8884
|
flexDirection: "column",
|
8857
8885
|
gap: "3"
|
8858
|
-
}, /* @__PURE__ */
|
8886
|
+
}, /* @__PURE__ */ React95.createElement(Skeleton, {
|
8859
8887
|
height: 32,
|
8860
8888
|
width: "100%"
|
8861
|
-
}), /* @__PURE__ */
|
8889
|
+
}), /* @__PURE__ */ React95.createElement(Skeleton, {
|
8862
8890
|
height: 32,
|
8863
8891
|
width: "73%"
|
8864
|
-
}), /* @__PURE__ */
|
8892
|
+
}), /* @__PURE__ */ React95.createElement(Skeleton, {
|
8865
8893
|
height: 32,
|
8866
8894
|
width: "80%"
|
8867
8895
|
}))));
|
8868
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8896
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React95.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React95.createElement(TimelineItemSkeleton, {
|
8869
8897
|
key
|
8870
8898
|
})));
|
8871
8899
|
Timeline2.Item = TimelineItem;
|
@@ -8873,9 +8901,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
8873
8901
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
8874
8902
|
|
8875
8903
|
// src/utils/table/useTableSelect.ts
|
8876
|
-
import
|
8904
|
+
import React96 from "react";
|
8877
8905
|
var useTableSelect = (data, { key }) => {
|
8878
|
-
const [selected, setSelected] =
|
8906
|
+
const [selected, setSelected] = React96.useState([]);
|
8879
8907
|
const allSelected = selected.length === data.length;
|
8880
8908
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8881
8909
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -8901,6 +8929,7 @@ var useTableSelect = (data, { key }) => {
|
|
8901
8929
|
|
8902
8930
|
// src/components/Pagination/usePagination.tsx
|
8903
8931
|
import { useEffect as useEffect7, useState as useState13 } from "react";
|
8932
|
+
import clamp3 from "lodash/clamp";
|
8904
8933
|
var initialState = {
|
8905
8934
|
currentPage: 1,
|
8906
8935
|
pageSize: 10
|
@@ -8914,11 +8943,12 @@ var usePagination = (items, options) => {
|
|
8914
8943
|
const hasNextPage = currentPage < totalPages;
|
8915
8944
|
const pageIndex = getPageIndex(currentPage, pageSize);
|
8916
8945
|
const onPageSizeChange = (pageSize2) => {
|
8946
|
+
const newTotalPages = items.length > 0 ? Math.ceil(items.length / pageSize2) : 1;
|
8917
8947
|
setPageSize(pageSize2);
|
8918
|
-
setCurrentPage((options == null ? void 0 : options.initialPage) || initialState.currentPage);
|
8948
|
+
setCurrentPage(clamp3((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, newTotalPages));
|
8919
8949
|
};
|
8920
8950
|
useEffect7(() => {
|
8921
|
-
setCurrentPage((options == null ? void 0 : options.initialPage) || initialState.currentPage);
|
8951
|
+
setCurrentPage(clamp3((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, totalPages));
|
8922
8952
|
}, [items.length]);
|
8923
8953
|
return [
|
8924
8954
|
items.slice(pageIndex, Math.min(pageIndex + pageSize, items.length)),
|
@@ -8938,7 +8968,7 @@ var usePagination = (items, options) => {
|
|
8938
8968
|
var SelectItem = Select.Item;
|
8939
8969
|
|
8940
8970
|
// src/utils/positioner.ts
|
8941
|
-
import
|
8971
|
+
import clamp4 from "lodash/clamp";
|
8942
8972
|
var PositionerPlacement = /* @__PURE__ */ ((PositionerPlacement2) => {
|
8943
8973
|
PositionerPlacement2["top"] = "top";
|
8944
8974
|
PositionerPlacement2["left"] = "left";
|
@@ -9041,7 +9071,7 @@ function calcBestPosition(triggerRect, contentRect, placement, padding) {
|
|
9041
9071
|
return _calcBestPosition(triggerRect2, contentRect2, nextPlacementAttempt, padding2);
|
9042
9072
|
} else {
|
9043
9073
|
return {
|
9044
|
-
x:
|
9074
|
+
x: clamp4(position.x + window.scrollX, 0, window.innerWidth),
|
9045
9075
|
y: position.y + window.scrollY
|
9046
9076
|
};
|
9047
9077
|
}
|
@@ -9103,7 +9133,7 @@ export {
|
|
9103
9133
|
InputBase,
|
9104
9134
|
Label,
|
9105
9135
|
LabelControl,
|
9106
|
-
LineClamp,
|
9136
|
+
LineClamp2 as LineClamp,
|
9107
9137
|
Link2 as Link,
|
9108
9138
|
List,
|
9109
9139
|
ListItem,
|