@aivenio/aquarium 1.8.1 → 1.9.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 +3 -2
- package/dist/atoms.mjs +3 -2
- package/dist/src/common/Card/Card.d.ts +1 -0
- package/dist/src/common/Card/Card.js +4 -3
- package/dist/src/common/LineClamp/LineClamp.d.ts +9 -0
- package/dist/src/common/LineClamp/LineClamp.js +18 -0
- 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/LineClamp/LineClamp.d.ts +2 -1
- package/dist/src/components/LineClamp/LineClamp.js +4 -4
- package/dist/src/components/Pagination/Pagination.js +6 -17
- package/dist/src/components/Pagination/usePagination.js +5 -3
- package/dist/src/components/Skeleton/Skeleton.js +3 -2
- package/dist/styles.css +18 -0
- package/dist/styles_timescaledb.css +18 -0
- package/dist/system.cjs +727 -704
- package/dist/system.mjs +667 -644
- 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,
|
@@ -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,25 @@ 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 } = _b, props = __objRest(_b, ["lines", "clamped", "children", "className"]);
|
4068
|
+
return /* @__PURE__ */ React24.createElement("div", __spreadValues({
|
4069
|
+
ref,
|
4070
|
+
className: classNames(className, "break-all", { [`line-clamp-${lines}`]: clamped })
|
4071
|
+
}, props), children);
|
4072
|
+
}
|
4073
|
+
);
|
4074
|
+
|
4061
4075
|
// src/components/Card/Compact.tsx
|
4062
|
-
import
|
4076
|
+
import React25, { useRef as useRef2 } from "react";
|
4063
4077
|
import { useButton } from "@react-aria/button";
|
4064
4078
|
import { omit as omit4 } from "lodash";
|
4065
4079
|
var CompactCard = ({
|
4066
4080
|
title,
|
4081
|
+
clampTitle,
|
4067
4082
|
chips = [],
|
4068
4083
|
icon,
|
4069
4084
|
color,
|
@@ -4076,35 +4091,39 @@ var CompactCard = ({
|
|
4076
4091
|
}) => {
|
4077
4092
|
const ref = useRef2(null);
|
4078
4093
|
const { buttonProps } = useButton({ elementType: "div", onPress: onClick, isDisabled: disabled }, ref);
|
4079
|
-
|
4094
|
+
const titleContent = /* @__PURE__ */ React25.createElement(Typography2.SmallStrong, {
|
4095
|
+
color: "black"
|
4096
|
+
}, title);
|
4097
|
+
return /* @__PURE__ */ React25.createElement(Card, __spreadProps(__spreadValues({
|
4080
4098
|
ref,
|
4081
4099
|
clickable: Boolean(onClick),
|
4082
|
-
fullWidth
|
4100
|
+
fullWidth,
|
4101
|
+
enableMinWidth: Boolean(action || link || chips.length)
|
4083
4102
|
}, onClick ? buttonProps : {}), {
|
4084
4103
|
disabled
|
4085
|
-
}), color && /* @__PURE__ */
|
4104
|
+
}), color && /* @__PURE__ */ React25.createElement(Card.ColorHiglight, {
|
4086
4105
|
color
|
4087
|
-
}), chips.length > 0 && /* @__PURE__ */
|
4106
|
+
}), chips.length > 0 && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
4088
4107
|
dense: true
|
4089
|
-
}, chips.map((chip) => /* @__PURE__ */
|
4108
|
+
}, chips.map((chip) => /* @__PURE__ */ React25.createElement(Chip2, {
|
4090
4109
|
key: chip,
|
4091
4110
|
text: chip
|
4092
|
-
}))), /* @__PURE__ */
|
4111
|
+
}))), /* @__PURE__ */ React25.createElement(Box, {
|
4093
4112
|
display: "flex",
|
4094
4113
|
gap: "5"
|
4095
|
-
}, icon && /* @__PURE__ */
|
4114
|
+
}, icon && /* @__PURE__ */ React25.createElement(Avatar, {
|
4096
4115
|
image: icon
|
4097
|
-
}), /* @__PURE__ */
|
4116
|
+
}), /* @__PURE__ */ React25.createElement(Card.Content, {
|
4098
4117
|
dense: true
|
4099
|
-
}, /* @__PURE__ */
|
4100
|
-
|
4101
|
-
},
|
4118
|
+
}, clampTitle ? /* @__PURE__ */ React25.createElement(LineClamp, {
|
4119
|
+
lines: clampTitle
|
4120
|
+
}, titleContent) : titleContent, /* @__PURE__ */ React25.createElement(Typography2.Caption, {
|
4102
4121
|
color: "grey-70"
|
4103
|
-
}, children))), (action || link) && /* @__PURE__ */
|
4122
|
+
}, children))), (action || link) && /* @__PURE__ */ React25.createElement(Card.Actions, {
|
4104
4123
|
dense: true
|
4105
|
-
}, action && /* @__PURE__ */
|
4124
|
+
}, action && /* @__PURE__ */ React25.createElement(SecondaryButton, __spreadValues({
|
4106
4125
|
dense: true
|
4107
|
-
}, omit4(action, "text")), action.text), link && /* @__PURE__ */
|
4126
|
+
}, omit4(action, "text")), action.text), link && /* @__PURE__ */ React25.createElement(ExternalLinkButton, __spreadValues({
|
4108
4127
|
dense: true,
|
4109
4128
|
kind: "ghost"
|
4110
4129
|
}, omit4(link, "text")), link.text)));
|
@@ -4114,31 +4133,31 @@ var CompactSkeleton = ({
|
|
4114
4133
|
icon = true,
|
4115
4134
|
actions = true,
|
4116
4135
|
fullWidth = false
|
4117
|
-
}) => /* @__PURE__ */
|
4136
|
+
}) => /* @__PURE__ */ React25.createElement(Card, {
|
4118
4137
|
fullWidth
|
4119
|
-
}, chips && /* @__PURE__ */
|
4138
|
+
}, chips && /* @__PURE__ */ React25.createElement(ChipContainer, {
|
4120
4139
|
dense: true
|
4121
|
-
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */
|
4140
|
+
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ React25.createElement(Chip2.Skeleton, {
|
4122
4141
|
key: idx
|
4123
|
-
}))), /* @__PURE__ */
|
4142
|
+
}))), /* @__PURE__ */ React25.createElement(Box, {
|
4124
4143
|
display: "flex",
|
4125
4144
|
gap: "5"
|
4126
|
-
}, icon && /* @__PURE__ */
|
4145
|
+
}, icon && /* @__PURE__ */ React25.createElement(Avatar.Skeleton, null), /* @__PURE__ */ React25.createElement(Card.Content, {
|
4127
4146
|
dense: true
|
4128
|
-
}, /* @__PURE__ */
|
4147
|
+
}, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4129
4148
|
width: 80,
|
4130
4149
|
height: 20
|
4131
|
-
}), /* @__PURE__ */
|
4150
|
+
}), /* @__PURE__ */ React25.createElement(Box, {
|
4132
4151
|
height: "1"
|
4133
|
-
}), /* @__PURE__ */
|
4152
|
+
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
4134
4153
|
width: 145,
|
4135
4154
|
height: 16
|
4136
|
-
}))), actions && /* @__PURE__ */
|
4155
|
+
}))), actions && /* @__PURE__ */ React25.createElement(Card.Actions, {
|
4137
4156
|
dense: true
|
4138
|
-
}, /* @__PURE__ */
|
4157
|
+
}, /* @__PURE__ */ React25.createElement(Skeleton, {
|
4139
4158
|
width: 115,
|
4140
4159
|
height: 25
|
4141
|
-
}), /* @__PURE__ */
|
4160
|
+
}), /* @__PURE__ */ React25.createElement(Skeleton, {
|
4142
4161
|
width: 60,
|
4143
4162
|
height: 25
|
4144
4163
|
})));
|
@@ -4147,6 +4166,7 @@ CompactCard.Skeleton = CompactSkeleton;
|
|
4147
4166
|
// src/components/Card/Card.tsx
|
4148
4167
|
var Card2 = ({
|
4149
4168
|
title,
|
4169
|
+
clampTitle,
|
4150
4170
|
description,
|
4151
4171
|
chips = [],
|
4152
4172
|
icons = [],
|
@@ -4163,36 +4183,40 @@ var Card2 = ({
|
|
4163
4183
|
}) => {
|
4164
4184
|
const ref = useRef3(null);
|
4165
4185
|
const { buttonProps } = useButton2({ elementType: "div", onPress: onClick, isDisabled: disabled }, ref);
|
4166
|
-
|
4186
|
+
const titleContent = /* @__PURE__ */ React26.createElement(Typography2.DefaultStrong, {
|
4187
|
+
color: "black"
|
4188
|
+
}, title);
|
4189
|
+
return /* @__PURE__ */ React26.createElement(Card, __spreadProps(__spreadValues({
|
4167
4190
|
ref,
|
4168
4191
|
clickable: Boolean(onClick),
|
4169
|
-
fullWidth
|
4192
|
+
fullWidth,
|
4193
|
+
enableMinWidth: Boolean(image || action || link || chips.length || icons.length)
|
4170
4194
|
}, onClick ? buttonProps : {}), {
|
4171
4195
|
disabled
|
4172
|
-
}), color && /* @__PURE__ */
|
4196
|
+
}), color && /* @__PURE__ */ React26.createElement(Card.ColorHiglight, {
|
4173
4197
|
color
|
4174
|
-
}), chips.length > 0 && /* @__PURE__ */
|
4198
|
+
}), chips.length > 0 && /* @__PURE__ */ React26.createElement(ChipContainer, {
|
4175
4199
|
dense: true
|
4176
|
-
}, chips.map((chip) => /* @__PURE__ */
|
4200
|
+
}, chips.map((chip) => /* @__PURE__ */ React26.createElement(Chip2, {
|
4177
4201
|
key: chip,
|
4178
4202
|
text: chip
|
4179
|
-
}))), icons.length > 0 && /* @__PURE__ */
|
4203
|
+
}))), icons.length > 0 && /* @__PURE__ */ React26.createElement(AvatarStack, {
|
4180
4204
|
images: icons
|
4181
|
-
}), image !== void 0 && (imageHeight ? /* @__PURE__ */
|
4205
|
+
}), image !== void 0 && (imageHeight ? /* @__PURE__ */ React26.createElement(CardImage, {
|
4182
4206
|
image,
|
4183
4207
|
imageAlt,
|
4184
4208
|
imageHeight
|
4185
|
-
}) : /* @__PURE__ */
|
4209
|
+
}) : /* @__PURE__ */ React26.createElement(CardImage, {
|
4186
4210
|
image,
|
4187
4211
|
imageAlt,
|
4188
4212
|
fullSize: chips.length === 0
|
4189
|
-
})), /* @__PURE__ */
|
4190
|
-
|
4191
|
-
},
|
4213
|
+
})), /* @__PURE__ */ React26.createElement(Card.Content, null, clampTitle ? /* @__PURE__ */ React26.createElement(LineClamp, {
|
4214
|
+
lines: clampTitle
|
4215
|
+
}, titleContent) : titleContent, /* @__PURE__ */ React26.createElement(Typography2.Caption, {
|
4192
4216
|
color: "grey-70"
|
4193
|
-
}, children || description)), (action || link) && /* @__PURE__ */
|
4217
|
+
}, children || description)), (action || link) && /* @__PURE__ */ React26.createElement(Card.Actions, null, action && /* @__PURE__ */ React26.createElement(SecondaryButton, __spreadValues({
|
4194
4218
|
dense: true
|
4195
|
-
}, omit5(action, "text")), action.text), link && /* @__PURE__ */
|
4219
|
+
}, omit5(action, "text")), action.text), link && /* @__PURE__ */ React26.createElement(ExternalLinkButton, __spreadValues({
|
4196
4220
|
dense: true,
|
4197
4221
|
kind: "ghost"
|
4198
4222
|
}, omit5(link, "text")), link.text)));
|
@@ -4204,60 +4228,60 @@ var CardSkeleton = ({
|
|
4204
4228
|
actions = true,
|
4205
4229
|
fullWidth = false,
|
4206
4230
|
imageHeight
|
4207
|
-
}) => /* @__PURE__ */
|
4231
|
+
}) => /* @__PURE__ */ React26.createElement(Card, {
|
4208
4232
|
fullWidth
|
4209
|
-
}, chips && /* @__PURE__ */
|
4233
|
+
}, chips && /* @__PURE__ */ React26.createElement(ChipContainer, {
|
4210
4234
|
dense: true
|
4211
|
-
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */
|
4235
|
+
}, Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ React26.createElement(Chip2.Skeleton, {
|
4212
4236
|
key: idx
|
4213
|
-
}))), icons && /* @__PURE__ */
|
4237
|
+
}))), icons && /* @__PURE__ */ React26.createElement(AvatarStack, {
|
4214
4238
|
images: [null]
|
4215
|
-
}), image && (imageHeight ? /* @__PURE__ */
|
4239
|
+
}), image && (imageHeight ? /* @__PURE__ */ React26.createElement(CardImage, {
|
4216
4240
|
image: null,
|
4217
4241
|
imageHeight
|
4218
|
-
}) : /* @__PURE__ */
|
4242
|
+
}) : /* @__PURE__ */ React26.createElement(CardImage, {
|
4219
4243
|
image: null,
|
4220
4244
|
fullSize: !chips
|
4221
|
-
})), /* @__PURE__ */
|
4245
|
+
})), /* @__PURE__ */ React26.createElement(Card.Content, null, /* @__PURE__ */ React26.createElement(Skeleton, {
|
4222
4246
|
width: 145,
|
4223
4247
|
height: 25
|
4224
|
-
}), /* @__PURE__ */
|
4248
|
+
}), /* @__PURE__ */ React26.createElement(Skeleton, {
|
4225
4249
|
width: 145,
|
4226
4250
|
height: 16
|
4227
|
-
})), actions && /* @__PURE__ */
|
4251
|
+
})), actions && /* @__PURE__ */ React26.createElement(Card.Actions, null, /* @__PURE__ */ React26.createElement(Skeleton, {
|
4228
4252
|
width: 115,
|
4229
4253
|
height: 25
|
4230
|
-
}), /* @__PURE__ */
|
4254
|
+
}), /* @__PURE__ */ React26.createElement(Skeleton, {
|
4231
4255
|
width: 60,
|
4232
4256
|
height: 25
|
4233
4257
|
})));
|
4234
4258
|
Card2.Skeleton = CardSkeleton;
|
4235
4259
|
Card2.Compact = CompactCard;
|
4236
|
-
var CardImage = ({ image, imageAlt, imageHeight, fullSize = false }) => /* @__PURE__ */
|
4260
|
+
var CardImage = ({ image, imageAlt, imageHeight, fullSize = false }) => /* @__PURE__ */ React26.createElement(Card.ImageContainer, {
|
4237
4261
|
fullSize
|
4238
|
-
}, image ? imageHeight ? /* @__PURE__ */
|
4262
|
+
}, image ? imageHeight ? /* @__PURE__ */ React26.createElement(Card.Image, {
|
4239
4263
|
image,
|
4240
4264
|
imageAlt,
|
4241
4265
|
imageHeight
|
4242
|
-
}) : /* @__PURE__ */
|
4266
|
+
}) : /* @__PURE__ */ React26.createElement(Card.Image, {
|
4243
4267
|
image,
|
4244
4268
|
imageAlt,
|
4245
4269
|
fullSize
|
4246
|
-
}) : /* @__PURE__ */
|
4270
|
+
}) : /* @__PURE__ */ React26.createElement(CardImage.Skeleton, {
|
4247
4271
|
fullSize,
|
4248
4272
|
imageHeight
|
4249
4273
|
}));
|
4250
|
-
var CardImageSkeleton = ({ imageHeight, fullSize }) => imageHeight ? /* @__PURE__ */
|
4274
|
+
var CardImageSkeleton = ({ imageHeight, fullSize }) => imageHeight ? /* @__PURE__ */ React26.createElement(Skeleton, {
|
4251
4275
|
height: imageHeight,
|
4252
4276
|
width: "100%"
|
4253
|
-
}) : /* @__PURE__ */
|
4277
|
+
}) : /* @__PURE__ */ React26.createElement(Skeleton, {
|
4254
4278
|
height: fullSize ? 225 : 174,
|
4255
4279
|
width: "100%"
|
4256
4280
|
});
|
4257
4281
|
CardImage.Skeleton = CardImageSkeleton;
|
4258
4282
|
|
4259
4283
|
// src/components/Carousel/Carousel.tsx
|
4260
|
-
import
|
4284
|
+
import React27, { useEffect as useEffect3, useLayoutEffect, useRef as useRef4, useState as useState2 } from "react";
|
4261
4285
|
var import_chevronLeft = __toESM(require_chevronLeft());
|
4262
4286
|
var import_chevronRight = __toESM(require_chevronRight());
|
4263
4287
|
var Carousel = ({
|
@@ -4268,7 +4292,7 @@ var Carousel = ({
|
|
4268
4292
|
}) => {
|
4269
4293
|
const containerRef = useRef4(null);
|
4270
4294
|
const scrollbarContainerRef = useRef4(null);
|
4271
|
-
const items =
|
4295
|
+
const items = React27.Children.toArray(children);
|
4272
4296
|
const [width, setWidth] = useState2(0);
|
4273
4297
|
const [isUpdating, setIsUpdating] = useState2(false);
|
4274
4298
|
const [currentPage, setCurrentPage] = useState2(currentPageProp != null ? currentPageProp : defaultPage);
|
@@ -4318,30 +4342,30 @@ var Carousel = ({
|
|
4318
4342
|
onPageChange && onPageChange(newPage);
|
4319
4343
|
}
|
4320
4344
|
};
|
4321
|
-
return items.length > 0 ? /* @__PURE__ */
|
4345
|
+
return items.length > 0 ? /* @__PURE__ */ React27.createElement("div", {
|
4322
4346
|
className: tw("w-full flex flex-col"),
|
4323
4347
|
ref: containerRef
|
4324
|
-
}, containerRef !== null && /* @__PURE__ */
|
4348
|
+
}, containerRef !== null && /* @__PURE__ */ React27.createElement("ul", {
|
4325
4349
|
ref: scrollbarContainerRef,
|
4326
4350
|
tabIndex: 0,
|
4327
4351
|
onScroll: handleScroll,
|
4328
4352
|
className: tw(
|
4329
4353
|
"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
4354
|
)
|
4331
|
-
}, width !== 0 &&
|
4355
|
+
}, width !== 0 && React27.Children.map(children, (child, index) => /* @__PURE__ */ React27.createElement(CarouselItem, {
|
4332
4356
|
key: index,
|
4333
4357
|
width,
|
4334
4358
|
ariaHidden: index + 1 === currentPage ? void 0 : true
|
4335
|
-
}, child))), /* @__PURE__ */
|
4359
|
+
}, child))), /* @__PURE__ */ React27.createElement(Flexbox, {
|
4336
4360
|
direction: "row",
|
4337
4361
|
justifyContent: "flex-end",
|
4338
4362
|
alignItems: "center"
|
4339
|
-
}, /* @__PURE__ */
|
4363
|
+
}, /* @__PURE__ */ React27.createElement(IconButton, {
|
4340
4364
|
"aria-label": "Previous",
|
4341
4365
|
onClick: () => handleNavigationClick("left"),
|
4342
4366
|
icon: import_chevronLeft.default,
|
4343
4367
|
disabled: currentPage === 1
|
4344
|
-
}), /* @__PURE__ */
|
4368
|
+
}), /* @__PURE__ */ React27.createElement(Typography2.Caption, null, `${currentPage}/${React27.Children.count(children)}`), /* @__PURE__ */ React27.createElement(IconButton, {
|
4345
4369
|
"aria-label": "Next",
|
4346
4370
|
onClick: () => handleNavigationClick("right"),
|
4347
4371
|
icon: import_chevronRight.default,
|
@@ -4349,7 +4373,7 @@ var Carousel = ({
|
|
4349
4373
|
}))) : null;
|
4350
4374
|
};
|
4351
4375
|
var CarouselItem = ({ width, children, ariaHidden }) => {
|
4352
|
-
return /* @__PURE__ */
|
4376
|
+
return /* @__PURE__ */ React27.createElement("li", {
|
4353
4377
|
style: { width },
|
4354
4378
|
"aria-hidden": ariaHidden,
|
4355
4379
|
className: tw("flex justify-center snap-start")
|
@@ -4357,10 +4381,10 @@ var CarouselItem = ({ width, children, ariaHidden }) => {
|
|
4357
4381
|
};
|
4358
4382
|
|
4359
4383
|
// src/components/Checkbox/Checkbox.tsx
|
4360
|
-
import
|
4384
|
+
import React30 from "react";
|
4361
4385
|
|
4362
4386
|
// src/components/ControlLabel/ControlLabel.tsx
|
4363
|
-
import
|
4387
|
+
import React28 from "react";
|
4364
4388
|
var ControlLabel = (_a) => {
|
4365
4389
|
var _b = _a, {
|
4366
4390
|
label,
|
@@ -4378,7 +4402,7 @@ var ControlLabel = (_a) => {
|
|
4378
4402
|
"style"
|
4379
4403
|
]);
|
4380
4404
|
const textClass = disabled ? "text-grey-40" : "text-grey-100";
|
4381
|
-
return /* @__PURE__ */
|
4405
|
+
return /* @__PURE__ */ React28.createElement("label", __spreadValues({
|
4382
4406
|
className: tw(
|
4383
4407
|
"inline-grid grid-cols-[auto_1fr]",
|
4384
4408
|
{
|
@@ -4388,9 +4412,9 @@ var ControlLabel = (_a) => {
|
|
4388
4412
|
textClass
|
4389
4413
|
),
|
4390
4414
|
style: __spreadValues({}, style)
|
4391
|
-
}, rest), children, label && /* @__PURE__ */
|
4415
|
+
}, rest), children, label && /* @__PURE__ */ React28.createElement("span", {
|
4392
4416
|
className: tw("typography-small self-center")
|
4393
|
-
}, label), caption && /* @__PURE__ */
|
4417
|
+
}, label), caption && /* @__PURE__ */ React28.createElement(Typography2, {
|
4394
4418
|
className: tw("col-start-2"),
|
4395
4419
|
variant: "caption",
|
4396
4420
|
color: disabled ? "grey-40" : "grey-50"
|
@@ -4398,18 +4422,18 @@ var ControlLabel = (_a) => {
|
|
4398
4422
|
};
|
4399
4423
|
|
4400
4424
|
// src/common/Checkbox/Checkbox.tsx
|
4401
|
-
import
|
4425
|
+
import React29 from "react";
|
4402
4426
|
var import_minus = __toESM(require_minus());
|
4403
4427
|
var import_tick2 = __toESM(require_tick());
|
4404
|
-
var Checkbox =
|
4428
|
+
var Checkbox = React29.forwardRef(
|
4405
4429
|
(_a, ref) => {
|
4406
4430
|
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__ */
|
4431
|
+
return /* @__PURE__ */ React29.createElement("span", {
|
4408
4432
|
className: classNames(tw("inline-flex justify-center items-center self-center relative"), {
|
4409
4433
|
"hover:border-grey-50 peer-checked:border-navyBlue-100": !disabled,
|
4410
4434
|
"border-grey-5": disabled
|
4411
4435
|
})
|
4412
|
-
}, /* @__PURE__ */
|
4436
|
+
}, /* @__PURE__ */ React29.createElement("input", __spreadProps(__spreadValues({
|
4413
4437
|
id,
|
4414
4438
|
ref,
|
4415
4439
|
type: "checkbox",
|
@@ -4423,7 +4447,7 @@ var Checkbox = React28.forwardRef(
|
|
4423
4447
|
),
|
4424
4448
|
readOnly,
|
4425
4449
|
disabled
|
4426
|
-
})), /* @__PURE__ */
|
4450
|
+
})), /* @__PURE__ */ React29.createElement(Icon, {
|
4427
4451
|
icon: indeterminate ? import_minus.default : import_tick2.default,
|
4428
4452
|
className: classNames(
|
4429
4453
|
tw(
|
@@ -4442,12 +4466,12 @@ var Checkbox = React28.forwardRef(
|
|
4442
4466
|
);
|
4443
4467
|
|
4444
4468
|
// src/components/Checkbox/Checkbox.tsx
|
4445
|
-
var Checkbox2 =
|
4469
|
+
var Checkbox2 = React30.forwardRef(
|
4446
4470
|
(_a, ref) => {
|
4447
4471
|
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
4472
|
var _a2;
|
4449
4473
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
4450
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
4474
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React30.createElement(ControlLabel, {
|
4451
4475
|
htmlFor: id,
|
4452
4476
|
label: children,
|
4453
4477
|
"aria-label": ariaLabel,
|
@@ -4455,7 +4479,7 @@ var Checkbox2 = React29.forwardRef(
|
|
4455
4479
|
readOnly,
|
4456
4480
|
disabled,
|
4457
4481
|
style: { gap: "0 8px" }
|
4458
|
-
}, !readOnly && /* @__PURE__ */
|
4482
|
+
}, !readOnly && /* @__PURE__ */ React30.createElement(Checkbox, __spreadProps(__spreadValues({
|
4459
4483
|
id,
|
4460
4484
|
ref,
|
4461
4485
|
name
|
@@ -4466,12 +4490,12 @@ var Checkbox2 = React29.forwardRef(
|
|
4466
4490
|
}
|
4467
4491
|
);
|
4468
4492
|
Checkbox2.displayName = "Checkbox";
|
4469
|
-
var CheckboxSkeleton = () => /* @__PURE__ */
|
4493
|
+
var CheckboxSkeleton = () => /* @__PURE__ */ React30.createElement("div", {
|
4470
4494
|
className: tw("flex gap-3")
|
4471
|
-
}, /* @__PURE__ */
|
4495
|
+
}, /* @__PURE__ */ React30.createElement(Skeleton, {
|
4472
4496
|
height: 20,
|
4473
4497
|
width: 20
|
4474
|
-
}), /* @__PURE__ */
|
4498
|
+
}), /* @__PURE__ */ React30.createElement(Skeleton, {
|
4475
4499
|
height: 20,
|
4476
4500
|
width: 150
|
4477
4501
|
}));
|
@@ -4479,14 +4503,14 @@ Checkbox2.Skeleton = CheckboxSkeleton;
|
|
4479
4503
|
Checkbox2.Skeleton.displayName = "Checkbox.Skeleton";
|
4480
4504
|
|
4481
4505
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4482
|
-
import
|
4506
|
+
import React37, { useState as useState3 } from "react";
|
4483
4507
|
import uniqueId from "lodash/uniqueId";
|
4484
4508
|
|
4485
4509
|
// src/common/InputGroup/InputGroup.tsx
|
4486
|
-
import
|
4510
|
+
import React32 from "react";
|
4487
4511
|
|
4488
4512
|
// src/components/Grid/Grid.tsx
|
4489
|
-
import
|
4513
|
+
import React31 from "react";
|
4490
4514
|
var Grid = Tailwindify(
|
4491
4515
|
({
|
4492
4516
|
htmlTag = "div",
|
@@ -4539,7 +4563,7 @@ var Grid = Tailwindify(
|
|
4539
4563
|
gridRowEnd: rowEnd
|
4540
4564
|
});
|
4541
4565
|
const HtmlElement = htmlTag;
|
4542
|
-
return /* @__PURE__ */
|
4566
|
+
return /* @__PURE__ */ React31.createElement(HtmlElement, {
|
4543
4567
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
4544
4568
|
className
|
4545
4569
|
}, children);
|
@@ -4555,7 +4579,7 @@ var gridColumnStyles = {
|
|
4555
4579
|
};
|
4556
4580
|
var InputGroup = (_a) => {
|
4557
4581
|
var _b = _a, { cols = "1", children } = _b, rest = __objRest(_b, ["cols", "children"]);
|
4558
|
-
return /* @__PURE__ */
|
4582
|
+
return /* @__PURE__ */ React32.createElement(Grid, __spreadProps(__spreadValues({}, rest), {
|
4559
4583
|
display: "inline-grid",
|
4560
4584
|
colGap: "l4",
|
4561
4585
|
rowGap: "3",
|
@@ -4565,12 +4589,12 @@ var InputGroup = (_a) => {
|
|
4565
4589
|
};
|
4566
4590
|
|
4567
4591
|
// src/utils/form/Label/Label.tsx
|
4568
|
-
import
|
4592
|
+
import React36 from "react";
|
4569
4593
|
|
4570
4594
|
// src/utils/form/FormControl/FormControl.tsx
|
4571
|
-
import
|
4595
|
+
import React33 from "react";
|
4572
4596
|
var FormControl = ({ className, inline, children }) => {
|
4573
|
-
return /* @__PURE__ */
|
4597
|
+
return /* @__PURE__ */ React33.createElement(Flexbox, {
|
4574
4598
|
direction: "column",
|
4575
4599
|
display: inline ? "inline-flex" : "flex",
|
4576
4600
|
className
|
@@ -4578,14 +4602,14 @@ var FormControl = ({ className, inline, children }) => {
|
|
4578
4602
|
};
|
4579
4603
|
|
4580
4604
|
// src/utils/form/HelperText/HelperText.tsx
|
4581
|
-
import
|
4605
|
+
import React35 from "react";
|
4582
4606
|
import classNames3 from "classnames";
|
4583
4607
|
import isNumber4 from "lodash/isNumber";
|
4584
4608
|
|
4585
4609
|
// src/utils/form/CharCounter/CharCounter.tsx
|
4586
|
-
import
|
4610
|
+
import React34 from "react";
|
4587
4611
|
var CharCounter = ({ dense = true, length, maxLength, valid = true }) => {
|
4588
|
-
return /* @__PURE__ */
|
4612
|
+
return /* @__PURE__ */ React34.createElement("span", {
|
4589
4613
|
className: tw(
|
4590
4614
|
`whitespace-nowrap`,
|
4591
4615
|
valid ? "text-grey-50" : "text-error-70",
|
@@ -4607,34 +4631,34 @@ var HelperText = ({
|
|
4607
4631
|
const hasMaxLength = isNumber4(maxLength) && maxLength > 0;
|
4608
4632
|
const showMessage = hasError || hasMaxLength;
|
4609
4633
|
if (!showMessage) {
|
4610
|
-
return reserveSpaceForError ? /* @__PURE__ */
|
4634
|
+
return reserveSpaceForError ? /* @__PURE__ */ React35.createElement("p", {
|
4611
4635
|
className: tw("block mt-1 mb-3 typography-caption")
|
4612
4636
|
}, "\xA0") : null;
|
4613
4637
|
}
|
4614
|
-
return /* @__PURE__ */
|
4638
|
+
return /* @__PURE__ */ React35.createElement(Grid, {
|
4615
4639
|
cols: "1",
|
4616
4640
|
rows: "1",
|
4617
4641
|
colGap: "3",
|
4618
4642
|
alignItems: "start",
|
4619
4643
|
autoCols: "min",
|
4620
4644
|
className: tw("mt-1 mb-3")
|
4621
|
-
}, /* @__PURE__ */
|
4645
|
+
}, /* @__PURE__ */ React35.createElement(GridItem, {
|
4622
4646
|
colStart: "1",
|
4623
4647
|
colEnd: "2"
|
4624
|
-
}, hasError && /* @__PURE__ */
|
4648
|
+
}, hasError && /* @__PURE__ */ React35.createElement("p", {
|
4625
4649
|
id: messageId,
|
4626
4650
|
className: tw("text-error-50 block typography-caption")
|
4627
|
-
}, helperText)), /* @__PURE__ */
|
4651
|
+
}, helperText)), /* @__PURE__ */ React35.createElement(GridItem, {
|
4628
4652
|
colStart: "2",
|
4629
4653
|
colEnd: "3",
|
4630
4654
|
display: "flex"
|
4631
|
-
}, isNumber4(length) && hasMaxLength && /* @__PURE__ */
|
4655
|
+
}, isNumber4(length) && hasMaxLength && /* @__PURE__ */ React35.createElement(CharCounter, {
|
4632
4656
|
length,
|
4633
4657
|
maxLength,
|
4634
4658
|
valid: !error2
|
4635
4659
|
})));
|
4636
4660
|
};
|
4637
|
-
var Skeleton2 = ({ className, children }) => /* @__PURE__ */
|
4661
|
+
var Skeleton2 = ({ className, children }) => /* @__PURE__ */ React35.createElement("div", {
|
4638
4662
|
className: classNames3(className, "h-[25px]")
|
4639
4663
|
}, children);
|
4640
4664
|
HelperText.Skeleton = Skeleton2;
|
@@ -4649,35 +4673,35 @@ var LabelText = ({
|
|
4649
4673
|
helpTooltip,
|
4650
4674
|
helpTooltipPlacement
|
4651
4675
|
}) => {
|
4652
|
-
return /* @__PURE__ */
|
4676
|
+
return /* @__PURE__ */ React36.createElement("span", {
|
4653
4677
|
className: tw("inline-block mb-2 typography-small-strong", {
|
4654
4678
|
"text-grey-60": variant === "default",
|
4655
4679
|
"text-error-50": variant === "error",
|
4656
4680
|
"text-grey-40": variant === "disabled"
|
4657
4681
|
})
|
4658
|
-
}, labelText, required && /* @__PURE__ */
|
4682
|
+
}, labelText, required && /* @__PURE__ */ React36.createElement("span", {
|
4659
4683
|
className: tw("text-error-50")
|
4660
|
-
}, "*"), helpTooltip && /* @__PURE__ */
|
4684
|
+
}, "*"), helpTooltip && /* @__PURE__ */ React36.createElement(Tooltip, {
|
4661
4685
|
content: helpTooltip,
|
4662
4686
|
placement: helpTooltipPlacement
|
4663
|
-
}, /* @__PURE__ */
|
4687
|
+
}, /* @__PURE__ */ React36.createElement("span", {
|
4664
4688
|
className: tw("text-grey-30 flex items-center cursor-pointer ml-2")
|
4665
|
-
}, /* @__PURE__ */
|
4689
|
+
}, /* @__PURE__ */ React36.createElement(InlineIcon, {
|
4666
4690
|
icon: import_questionMark.default,
|
4667
4691
|
"data-testid": "icon-info"
|
4668
4692
|
}))));
|
4669
4693
|
};
|
4670
4694
|
var Label = (props) => {
|
4671
4695
|
const _a = props, { id, htmlFor, labelText, labelProps: _b = {} } = _a, labelProps = __objRest(_b, []), { "data-testid": dataTestid, children } = _a;
|
4672
|
-
return /* @__PURE__ */
|
4696
|
+
return /* @__PURE__ */ React36.createElement("label", __spreadValues({
|
4673
4697
|
id,
|
4674
4698
|
className: tw("w-full"),
|
4675
4699
|
"data-testid": dataTestid,
|
4676
4700
|
htmlFor
|
4677
|
-
}, labelProps), labelText && /* @__PURE__ */
|
4701
|
+
}, labelProps), labelText && /* @__PURE__ */ React36.createElement(LabelText, __spreadValues({}, props)), children);
|
4678
4702
|
};
|
4679
4703
|
var LabelSkeleton = () => {
|
4680
|
-
return /* @__PURE__ */
|
4704
|
+
return /* @__PURE__ */ React36.createElement(Skeleton, {
|
4681
4705
|
height: 20,
|
4682
4706
|
width: 100,
|
4683
4707
|
className: tw("mb-[7px]")
|
@@ -4710,15 +4734,15 @@ var LabelControl = (_a) => {
|
|
4710
4734
|
]);
|
4711
4735
|
const legacyError = error2 !== void 0 && valid === false;
|
4712
4736
|
const variant = !valid || legacyError ? "error" : disabled ? "disabled" : "default";
|
4713
|
-
return /* @__PURE__ */
|
4737
|
+
return /* @__PURE__ */ React36.createElement(FormControl, null, !fieldset && /* @__PURE__ */ React36.createElement(Label, __spreadProps(__spreadValues({}, rest), {
|
4714
4738
|
variant
|
4715
|
-
}), children), fieldset && /* @__PURE__ */
|
4739
|
+
}), children), fieldset && /* @__PURE__ */ React36.createElement("fieldset", {
|
4716
4740
|
id: rest.id
|
4717
|
-
}, /* @__PURE__ */
|
4741
|
+
}, /* @__PURE__ */ React36.createElement("legend", {
|
4718
4742
|
className: tw("w-full mb-2")
|
4719
|
-
}, /* @__PURE__ */
|
4743
|
+
}, /* @__PURE__ */ React36.createElement(LabelText, __spreadProps(__spreadValues({}, rest), {
|
4720
4744
|
variant
|
4721
|
-
}))), children), /* @__PURE__ */
|
4745
|
+
}))), children), /* @__PURE__ */ React36.createElement(HelperText, {
|
4722
4746
|
messageId,
|
4723
4747
|
error: !valid,
|
4724
4748
|
helperText,
|
@@ -4727,7 +4751,7 @@ var LabelControl = (_a) => {
|
|
4727
4751
|
reserveSpaceForError
|
4728
4752
|
}));
|
4729
4753
|
};
|
4730
|
-
var LabelControlSkeleton = ({ children }) => /* @__PURE__ */
|
4754
|
+
var LabelControlSkeleton = ({ children }) => /* @__PURE__ */ React36.createElement("div", null, /* @__PURE__ */ React36.createElement(Label.Skeleton, null), children, /* @__PURE__ */ React36.createElement(HelperText.Skeleton, null));
|
4731
4755
|
LabelControl.Skeleton = LabelControlSkeleton;
|
4732
4756
|
var getLabelControlProps = (_a) => {
|
4733
4757
|
var _b = _a, {
|
@@ -4763,7 +4787,7 @@ var getLabelControlProps = (_a) => {
|
|
4763
4787
|
|
4764
4788
|
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
4765
4789
|
var isCheckbox = (c) => {
|
4766
|
-
return
|
4790
|
+
return React37.isValidElement(c) && c.type === Checkbox2;
|
4767
4791
|
};
|
4768
4792
|
var CheckboxGroup = (_a) => {
|
4769
4793
|
var _b = _a, {
|
@@ -4795,11 +4819,11 @@ var CheckboxGroup = (_a) => {
|
|
4795
4819
|
setSelectedItems(updated);
|
4796
4820
|
onChange == null ? void 0 : onChange(updated);
|
4797
4821
|
};
|
4798
|
-
return /* @__PURE__ */
|
4822
|
+
return /* @__PURE__ */ React37.createElement(LabelControl, __spreadValues(__spreadValues({
|
4799
4823
|
fieldset: true
|
4800
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
4824
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React37.createElement(InputGroup, {
|
4801
4825
|
cols
|
4802
|
-
},
|
4826
|
+
}, React37.Children.map(children, (c) => {
|
4803
4827
|
var _a3, _b2;
|
4804
4828
|
if (!isCheckbox(c)) {
|
4805
4829
|
return null;
|
@@ -4807,7 +4831,7 @@ var CheckboxGroup = (_a) => {
|
|
4807
4831
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
4808
4832
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
4809
4833
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
4810
|
-
return
|
4834
|
+
return React37.cloneElement(c, {
|
4811
4835
|
defaultChecked,
|
4812
4836
|
checked,
|
4813
4837
|
onChange: (_b2 = c.props.onChange) != null ? _b2 : handleChange,
|
@@ -4817,9 +4841,9 @@ var CheckboxGroup = (_a) => {
|
|
4817
4841
|
})));
|
4818
4842
|
};
|
4819
4843
|
var CheckboxGroupSkeleton = ({ options = 2 }) => {
|
4820
|
-
return /* @__PURE__ */
|
4844
|
+
return /* @__PURE__ */ React37.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React37.createElement("div", {
|
4821
4845
|
className: tw("flex flex-wrap flex-col gap-2")
|
4822
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
4846
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React37.createElement(Checkbox2.Skeleton, {
|
4823
4847
|
key
|
4824
4848
|
}))));
|
4825
4849
|
};
|
@@ -4827,7 +4851,7 @@ CheckboxGroup.Skeleton = CheckboxGroupSkeleton;
|
|
4827
4851
|
CheckboxGroup.Skeleton.displayName = "CheckboxGroup.Skeleton";
|
4828
4852
|
|
4829
4853
|
// src/components/ChoiceChip/ChoiceChip.tsx
|
4830
|
-
import
|
4854
|
+
import React38, { useState as useState4 } from "react";
|
4831
4855
|
var ChoiceChip = (_a) => {
|
4832
4856
|
var _b = _a, { text, dense, defaultValue, value, onChange } = _b, rest = __objRest(_b, ["text", "dense", "defaultValue", "value", "onChange"]);
|
4833
4857
|
var _a2;
|
@@ -4841,7 +4865,7 @@ var ChoiceChip = (_a) => {
|
|
4841
4865
|
setSelected(!selected);
|
4842
4866
|
onChange == null ? void 0 : onChange(!selected);
|
4843
4867
|
};
|
4844
|
-
return /* @__PURE__ */
|
4868
|
+
return /* @__PURE__ */ React38.createElement("span", __spreadProps(__spreadValues({
|
4845
4869
|
role: "button",
|
4846
4870
|
"aria-pressed": selected
|
4847
4871
|
}, rest), {
|
@@ -4856,7 +4880,7 @@ var ChoiceChip = (_a) => {
|
|
4856
4880
|
};
|
4857
4881
|
|
4858
4882
|
// src/components/Combobox/Combobox.tsx
|
4859
|
-
import
|
4883
|
+
import React41, { useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "react";
|
4860
4884
|
import { useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
4861
4885
|
import { useCombobox } from "downshift";
|
4862
4886
|
import omit6 from "lodash/omit";
|
@@ -4864,16 +4888,16 @@ import uniqueId2 from "lodash/uniqueId";
|
|
4864
4888
|
import { matchSorter } from "match-sorter";
|
4865
4889
|
|
4866
4890
|
// src/components/Popover/PopoverWrapper.tsx
|
4867
|
-
import
|
4891
|
+
import React40 from "react";
|
4868
4892
|
import { FocusScope } from "@react-aria/focus";
|
4869
4893
|
import { DismissButton, OverlayContainer as OverlayContainer2, useModal, useOverlay } from "@react-aria/overlays";
|
4870
4894
|
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
4871
4895
|
|
4872
4896
|
// src/common/Popover/Popover.tsx
|
4873
|
-
import
|
4874
|
-
var PopoverPanel =
|
4897
|
+
import React39 from "react";
|
4898
|
+
var PopoverPanel = React39.forwardRef((_a, ref) => {
|
4875
4899
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
4876
|
-
return /* @__PURE__ */
|
4900
|
+
return /* @__PURE__ */ React39.createElement("div", __spreadValues({
|
4877
4901
|
ref,
|
4878
4902
|
className: classNames(
|
4879
4903
|
className,
|
@@ -4888,7 +4912,7 @@ var Popover = {
|
|
4888
4912
|
};
|
4889
4913
|
|
4890
4914
|
// src/components/Popover/PopoverWrapper.tsx
|
4891
|
-
var PopoverWrapper =
|
4915
|
+
var PopoverWrapper = React40.forwardRef((props, ref) => {
|
4892
4916
|
const _a = props, {
|
4893
4917
|
id,
|
4894
4918
|
children,
|
@@ -4928,17 +4952,17 @@ var PopoverWrapper = React39.forwardRef((props, ref) => {
|
|
4928
4952
|
if (!props.isOpen) {
|
4929
4953
|
return null;
|
4930
4954
|
}
|
4931
|
-
return /* @__PURE__ */
|
4955
|
+
return /* @__PURE__ */ React40.createElement(OverlayContainer2, null, /* @__PURE__ */ React40.createElement(FocusScope, {
|
4932
4956
|
restoreFocus: true,
|
4933
4957
|
autoFocus,
|
4934
4958
|
contain: containFocus
|
4935
|
-
}, /* @__PURE__ */
|
4959
|
+
}, /* @__PURE__ */ React40.createElement(Popover.Panel, __spreadProps(__spreadValues({
|
4936
4960
|
ref,
|
4937
4961
|
role: "dialog"
|
4938
4962
|
}, mergeProps2(otherProps, modalProps, overlayProps)), {
|
4939
4963
|
id: id != null ? id : overlayProps.id,
|
4940
4964
|
className
|
4941
|
-
}), children, /* @__PURE__ */
|
4965
|
+
}), children, /* @__PURE__ */ React40.createElement(DismissButton, {
|
4942
4966
|
onDismiss: props.onClose
|
4943
4967
|
}))));
|
4944
4968
|
});
|
@@ -5038,12 +5062,12 @@ var ComboboxBase = (_a) => {
|
|
5038
5062
|
const hasNoResults = options.length === 0 || inputItems.length === 0;
|
5039
5063
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
5040
5064
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
5041
|
-
return /* @__PURE__ */
|
5065
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
5042
5066
|
className: tw("relative")
|
5043
|
-
}, /* @__PURE__ */
|
5067
|
+
}, /* @__PURE__ */ React41.createElement(Select.InputContainer, {
|
5044
5068
|
ref: targetRef,
|
5045
5069
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
5046
|
-
}, /* @__PURE__ */
|
5070
|
+
}, /* @__PURE__ */ React41.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
5047
5071
|
id,
|
5048
5072
|
name,
|
5049
5073
|
placeholder: readOnly ? void 0 : placeholder
|
@@ -5065,10 +5089,10 @@ var ComboboxBase = (_a) => {
|
|
5065
5089
|
(_a3 = inputProps.onKeyDown) == null ? void 0 : _a3.call(inputProps, e);
|
5066
5090
|
},
|
5067
5091
|
onKeyUp: (e) => e.stopPropagation()
|
5068
|
-
})), !readOnly && /* @__PURE__ */
|
5092
|
+
})), !readOnly && /* @__PURE__ */ React41.createElement(Select.Toggle, __spreadValues({
|
5069
5093
|
hasFocus,
|
5070
5094
|
isOpen
|
5071
|
-
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */
|
5095
|
+
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */ React41.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
5072
5096
|
isOpen: true,
|
5073
5097
|
isDismissable: true,
|
5074
5098
|
autoFocus: true
|
@@ -5076,15 +5100,15 @@ var ComboboxBase = (_a) => {
|
|
5076
5100
|
style,
|
5077
5101
|
onClose: closeMenu,
|
5078
5102
|
className: tw("overflow-y-auto")
|
5079
|
-
}), /* @__PURE__ */
|
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,16 +6160,16 @@ 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
6175
|
className: classNames(
|
@@ -6155,25 +6179,25 @@ var DropdownMenu2 = React58.forwardRef(
|
|
6155
6179
|
}, props), children);
|
6156
6180
|
}
|
6157
6181
|
);
|
6158
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
6182
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React59.createElement("div", {
|
6159
6183
|
className: tw("p-3")
|
6160
6184
|
}, children);
|
6161
6185
|
DropdownMenu2.ContentContainer = ContentContainer;
|
6162
|
-
var List2 =
|
6186
|
+
var List2 = React59.forwardRef(
|
6163
6187
|
(_a, ref) => {
|
6164
6188
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6165
|
-
return /* @__PURE__ */
|
6189
|
+
return /* @__PURE__ */ React59.createElement("ul", __spreadValues({
|
6166
6190
|
ref
|
6167
6191
|
}, props), children);
|
6168
6192
|
}
|
6169
6193
|
);
|
6170
6194
|
DropdownMenu2.List = List2;
|
6171
|
-
var Group2 =
|
6195
|
+
var Group2 = React59.forwardRef(
|
6172
6196
|
(_a, ref) => {
|
6173
6197
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
6174
|
-
return /* @__PURE__ */
|
6198
|
+
return /* @__PURE__ */ React59.createElement("li", __spreadValues({
|
6175
6199
|
ref
|
6176
|
-
}, props), title && /* @__PURE__ */
|
6200
|
+
}, props), title && /* @__PURE__ */ React59.createElement("div", __spreadValues({
|
6177
6201
|
className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
|
6178
6202
|
"text-grey-20": props.disabled
|
6179
6203
|
})
|
@@ -6181,10 +6205,10 @@ var Group2 = React58.forwardRef(
|
|
6181
6205
|
}
|
6182
6206
|
);
|
6183
6207
|
DropdownMenu2.Group = Group2;
|
6184
|
-
var Item3 =
|
6208
|
+
var Item3 = React59.forwardRef(
|
6185
6209
|
(_a, ref) => {
|
6186
6210
|
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
6187
|
-
return /* @__PURE__ */
|
6211
|
+
return /* @__PURE__ */ React59.createElement("li", __spreadValues({
|
6188
6212
|
ref,
|
6189
6213
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
6190
6214
|
"cursor-pointer hover:bg-grey-0": !props.disabled,
|
@@ -6192,30 +6216,30 @@ var Item3 = React58.forwardRef(
|
|
6192
6216
|
"text-primary-80": kind === "action",
|
6193
6217
|
"text-grey-20 cursor-not-allowed": props.disabled
|
6194
6218
|
})
|
6195
|
-
}, props), icon && /* @__PURE__ */
|
6219
|
+
}, props), icon && /* @__PURE__ */ React59.createElement(InlineIcon, {
|
6196
6220
|
icon
|
6197
|
-
}), /* @__PURE__ */
|
6221
|
+
}), /* @__PURE__ */ React59.createElement("span", {
|
6198
6222
|
className: tw("grow")
|
6199
|
-
}, children), selected && /* @__PURE__ */
|
6223
|
+
}, children), selected && /* @__PURE__ */ React59.createElement(InlineIcon, {
|
6200
6224
|
icon: import_tick4.default
|
6201
6225
|
}));
|
6202
6226
|
}
|
6203
6227
|
);
|
6204
6228
|
DropdownMenu2.Item = Item3;
|
6205
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
6229
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React59.createElement(Typography2.Caption, {
|
6206
6230
|
color: disabled ? "grey-20" : "grey-40"
|
6207
6231
|
}, children);
|
6208
6232
|
DropdownMenu2.Description = Description;
|
6209
6233
|
var Separator = (_a) => {
|
6210
6234
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
6211
|
-
return /* @__PURE__ */
|
6235
|
+
return /* @__PURE__ */ React59.createElement("li", __spreadProps(__spreadValues({}, props), {
|
6212
6236
|
className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
|
6213
6237
|
}));
|
6214
6238
|
};
|
6215
6239
|
DropdownMenu2.Separator = Separator;
|
6216
6240
|
var EmptyStateContainer2 = (_a) => {
|
6217
6241
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
6218
|
-
return /* @__PURE__ */
|
6242
|
+
return /* @__PURE__ */ React59.createElement("div", __spreadValues({
|
6219
6243
|
className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
|
6220
6244
|
}, props), children);
|
6221
6245
|
};
|
@@ -6270,8 +6294,8 @@ var DropdownMenu3 = (_a) => {
|
|
6270
6294
|
"footer",
|
6271
6295
|
"children"
|
6272
6296
|
]);
|
6273
|
-
const triggerRef =
|
6274
|
-
const overlayRef =
|
6297
|
+
const triggerRef = React60.useRef(null);
|
6298
|
+
const overlayRef = React60.useRef(null);
|
6275
6299
|
const [trigger, items] = extractTriggerAndItems(children);
|
6276
6300
|
const state = useMenuTriggerState(props);
|
6277
6301
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
@@ -6282,17 +6306,17 @@ var DropdownMenu3 = (_a) => {
|
|
6282
6306
|
shouldFlip: true,
|
6283
6307
|
isOpen: state.isOpen
|
6284
6308
|
});
|
6285
|
-
return /* @__PURE__ */
|
6309
|
+
return /* @__PURE__ */ React60.createElement("div", null, /* @__PURE__ */ React60.createElement(PressResponder2, __spreadValues({
|
6286
6310
|
ref: triggerRef,
|
6287
6311
|
onPress: () => state.toggle()
|
6288
|
-
}, menuTriggerProps), /* @__PURE__ */
|
6312
|
+
}, menuTriggerProps), /* @__PURE__ */ React60.createElement(TriggerWrapper, null, trigger.props.children)), /* @__PURE__ */ React60.createElement(PopoverWrapper, __spreadValues({
|
6289
6313
|
ref: overlayRef,
|
6290
6314
|
isDismissable: true,
|
6291
6315
|
autoFocus: true,
|
6292
6316
|
containFocus: true,
|
6293
6317
|
isOpen: state.isOpen,
|
6294
6318
|
onClose: state.close
|
6295
|
-
}, overlayProps), /* @__PURE__ */
|
6319
|
+
}, overlayProps), /* @__PURE__ */ React60.createElement(MenuWrapper, __spreadValues({
|
6296
6320
|
onAction,
|
6297
6321
|
selectionMode,
|
6298
6322
|
selection,
|
@@ -6317,13 +6341,13 @@ DropdownMenu3.Section = Section;
|
|
6317
6341
|
DropdownMenu3.Section.displayName = "DropdownMenu.Section";
|
6318
6342
|
var TriggerWrapper = (_a) => {
|
6319
6343
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6320
|
-
const ref =
|
6344
|
+
const ref = React60.useRef(null);
|
6321
6345
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
|
6322
|
-
const trigger =
|
6323
|
-
if (!trigger || !
|
6346
|
+
const trigger = React60.Children.only(children);
|
6347
|
+
if (!trigger || !React60.isValidElement(trigger)) {
|
6324
6348
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
6325
6349
|
}
|
6326
|
-
return
|
6350
|
+
return React60.cloneElement(trigger, __spreadValues({ ref }, mergeProps4(pressProps, props)));
|
6327
6351
|
};
|
6328
6352
|
var isSectionNode = (item) => item.type === "section";
|
6329
6353
|
var isItemNode = (item) => item.type === "item";
|
@@ -6345,7 +6369,7 @@ var MenuWrapper = (_a) => {
|
|
6345
6369
|
"header",
|
6346
6370
|
"footer"
|
6347
6371
|
]);
|
6348
|
-
const ref =
|
6372
|
+
const ref = React60.useRef(null);
|
6349
6373
|
const disabledKeys = getDisabledItemKeys(props.children);
|
6350
6374
|
const state = useTreeState(__spreadValues({
|
6351
6375
|
disabledKeys,
|
@@ -6353,30 +6377,30 @@ var MenuWrapper = (_a) => {
|
|
6353
6377
|
}, props));
|
6354
6378
|
const { menuProps } = useMenu(props, state, ref);
|
6355
6379
|
const { contains } = useFilter({ sensitivity: "base" });
|
6356
|
-
const [search, setSearch] =
|
6357
|
-
const filteredCollection =
|
6380
|
+
const [search, setSearch] = React60.useState("");
|
6381
|
+
const filteredCollection = React60.useMemo(
|
6358
6382
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
6359
6383
|
[state.collection, search, contains]
|
6360
6384
|
);
|
6361
|
-
return /* @__PURE__ */
|
6385
|
+
return /* @__PURE__ */ React60.createElement(DropdownMenu2, {
|
6362
6386
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
6363
6387
|
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
|
6364
|
-
}, header, /* @__PURE__ */
|
6388
|
+
}, header, /* @__PURE__ */ React60.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React60.createElement(SearchInput, {
|
6365
6389
|
"aria-label": "search",
|
6366
6390
|
value: search,
|
6367
6391
|
onChange: (e) => setSearch(e.target.value),
|
6368
6392
|
className: tw("mb-5")
|
6369
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
6393
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React60.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React60.createElement(DropdownMenu2.List, __spreadValues({
|
6370
6394
|
ref
|
6371
6395
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
6372
6396
|
if (isSectionNode(item)) {
|
6373
|
-
return /* @__PURE__ */
|
6397
|
+
return /* @__PURE__ */ React60.createElement(SectionWrapper, {
|
6374
6398
|
key: item.key,
|
6375
6399
|
section: item,
|
6376
6400
|
state
|
6377
6401
|
});
|
6378
6402
|
} else if (isItemNode(item)) {
|
6379
|
-
return /* @__PURE__ */
|
6403
|
+
return /* @__PURE__ */ React60.createElement(ItemWrapper, {
|
6380
6404
|
key: item.key,
|
6381
6405
|
item,
|
6382
6406
|
state
|
@@ -6385,14 +6409,14 @@ var MenuWrapper = (_a) => {
|
|
6385
6409
|
}))), footer);
|
6386
6410
|
};
|
6387
6411
|
var ItemWrapper = ({ item, state }) => {
|
6388
|
-
const ref =
|
6412
|
+
const ref = React60.useRef(null);
|
6389
6413
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
6390
6414
|
{ key: item.key, closeOnSelect: item.props.closeOnSelect },
|
6391
6415
|
state,
|
6392
6416
|
ref
|
6393
6417
|
);
|
6394
6418
|
const { icon, description, kind = "default" } = item.props;
|
6395
|
-
return /* @__PURE__ */
|
6419
|
+
return /* @__PURE__ */ React60.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
|
6396
6420
|
ref
|
6397
6421
|
}, menuItemProps), {
|
6398
6422
|
kind,
|
@@ -6400,7 +6424,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
6400
6424
|
highlighted: isFocused,
|
6401
6425
|
disabled: isDisabled,
|
6402
6426
|
icon
|
6403
|
-
}), item.rendered, description && /* @__PURE__ */
|
6427
|
+
}), item.rendered, description && /* @__PURE__ */ React60.createElement(DropdownMenu2.Description, __spreadValues({
|
6404
6428
|
disabled: isDisabled
|
6405
6429
|
}, descriptionProps), description));
|
6406
6430
|
};
|
@@ -6412,24 +6436,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
6412
6436
|
const { separatorProps } = useSeparator({
|
6413
6437
|
elementType: "li"
|
6414
6438
|
});
|
6415
|
-
return /* @__PURE__ */
|
6439
|
+
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
6440
|
title: section.rendered,
|
6417
6441
|
titleProps: headingProps
|
6418
|
-
}, itemProps), /* @__PURE__ */
|
6442
|
+
}, itemProps), /* @__PURE__ */ React60.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React60.createElement(ItemWrapper, {
|
6419
6443
|
key: node.key,
|
6420
6444
|
item: node,
|
6421
6445
|
state
|
6422
6446
|
})))));
|
6423
6447
|
};
|
6424
6448
|
var extractTriggerAndItems = (children) => {
|
6425
|
-
const [trigger, items] =
|
6449
|
+
const [trigger, items] = React60.Children.toArray(children);
|
6426
6450
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
6427
6451
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
6428
6452
|
}
|
6429
6453
|
return [trigger, items];
|
6430
6454
|
};
|
6431
6455
|
var getDisabledItemKeys = (children) => {
|
6432
|
-
const keys =
|
6456
|
+
const keys = React60.Children.map(children, (child) => {
|
6433
6457
|
var _a, _b;
|
6434
6458
|
if (!child || typeof child === "function") {
|
6435
6459
|
return null;
|
@@ -6446,11 +6470,11 @@ var getDisabledItemKeys = (children) => {
|
|
6446
6470
|
};
|
6447
6471
|
|
6448
6472
|
// src/components/EmptyState/EmptyState.tsx
|
6449
|
-
import
|
6473
|
+
import React62 from "react";
|
6450
6474
|
import omit9 from "lodash/omit";
|
6451
6475
|
|
6452
6476
|
// src/components/Flexbox/FlexboxItem.tsx
|
6453
|
-
import
|
6477
|
+
import React61 from "react";
|
6454
6478
|
var FlexboxItem = Tailwindify(
|
6455
6479
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6456
6480
|
const hookStyle = useStyle({
|
@@ -6462,7 +6486,7 @@ var FlexboxItem = Tailwindify(
|
|
6462
6486
|
alignSelf
|
6463
6487
|
});
|
6464
6488
|
const HtmlElement = htmlTag;
|
6465
|
-
return /* @__PURE__ */
|
6489
|
+
return /* @__PURE__ */ React61.createElement(HtmlElement, {
|
6466
6490
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6467
6491
|
className
|
6468
6492
|
}, children);
|
@@ -6520,7 +6544,7 @@ var EmptyState = ({
|
|
6520
6544
|
borderStyle = "dashed"
|
6521
6545
|
}) => {
|
6522
6546
|
const template = layoutStyle(layout);
|
6523
|
-
return /* @__PURE__ */
|
6547
|
+
return /* @__PURE__ */ React62.createElement(Box, {
|
6524
6548
|
className: classNames(
|
6525
6549
|
tw("rounded", {
|
6526
6550
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6532,38 +6556,38 @@ var EmptyState = ({
|
|
6532
6556
|
backgroundColor: "transparent",
|
6533
6557
|
borderColor: "grey-10",
|
6534
6558
|
padding: "9"
|
6535
|
-
}, /* @__PURE__ */
|
6559
|
+
}, /* @__PURE__ */ React62.createElement(Flexbox, {
|
6536
6560
|
direction: template.layout,
|
6537
6561
|
justifyContent: template.justifyContent,
|
6538
6562
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6539
6563
|
colGap: "l5",
|
6540
6564
|
rowGap: "8"
|
6541
|
-
}, image && /* @__PURE__ */
|
6565
|
+
}, image && /* @__PURE__ */ React62.createElement(FlexboxItem, null, /* @__PURE__ */ React62.createElement("img", {
|
6542
6566
|
src: image,
|
6543
6567
|
alt: imageAlt,
|
6544
6568
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6545
|
-
})), /* @__PURE__ */
|
6569
|
+
})), /* @__PURE__ */ React62.createElement(Flexbox, {
|
6546
6570
|
style: { maxWidth: "610px" },
|
6547
6571
|
direction: "column",
|
6548
6572
|
justifyContent: template.justifyContent,
|
6549
6573
|
alignItems: template.alignItems
|
6550
|
-
}, /* @__PURE__ */
|
6574
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6551
6575
|
variant: "heading",
|
6552
6576
|
htmlTag: "h2"
|
6553
|
-
}, title), (description || children) && /* @__PURE__ */
|
6577
|
+
}, title), (description || children) && /* @__PURE__ */ React62.createElement(Box, {
|
6554
6578
|
marginTop: "5"
|
6555
|
-
}, /* @__PURE__ */
|
6579
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6556
6580
|
variant: "default",
|
6557
6581
|
color: "grey-60"
|
6558
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6582
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React62.createElement(Flexbox, {
|
6559
6583
|
marginTop: "7",
|
6560
6584
|
gap: "4",
|
6561
6585
|
justifyContent: "center",
|
6562
6586
|
alignItems: "center",
|
6563
6587
|
wrap: "wrap"
|
6564
|
-
}, primaryAction && /* @__PURE__ */
|
6588
|
+
}, 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
6589
|
marginTop: "7"
|
6566
|
-
}, /* @__PURE__ */
|
6590
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6567
6591
|
htmlTag: "div",
|
6568
6592
|
variant: "small",
|
6569
6593
|
color: "grey-60"
|
@@ -6571,7 +6595,7 @@ var EmptyState = ({
|
|
6571
6595
|
};
|
6572
6596
|
|
6573
6597
|
// src/components/Grid/GridItem.tsx
|
6574
|
-
import
|
6598
|
+
import React63 from "react";
|
6575
6599
|
var GridItem = Tailwindify(
|
6576
6600
|
({
|
6577
6601
|
htmlTag = "div",
|
@@ -6602,7 +6626,7 @@ var GridItem = Tailwindify(
|
|
6602
6626
|
gridRowEnd: rowEnd
|
6603
6627
|
});
|
6604
6628
|
const HtmlElement = htmlTag;
|
6605
|
-
return /* @__PURE__ */
|
6629
|
+
return /* @__PURE__ */ React63.createElement(HtmlElement, {
|
6606
6630
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6607
6631
|
className
|
6608
6632
|
}, children);
|
@@ -6610,58 +6634,59 @@ var GridItem = Tailwindify(
|
|
6610
6634
|
);
|
6611
6635
|
|
6612
6636
|
// src/components/LineClamp/LineClamp.tsx
|
6613
|
-
import
|
6614
|
-
var
|
6615
|
-
const ref =
|
6616
|
-
const [clamped, setClamped] =
|
6617
|
-
const [isClampingEnabled, setClampingEnabled] =
|
6618
|
-
|
6637
|
+
import React64 from "react";
|
6638
|
+
var LineClamp2 = ({ lines, children, expandLabel, collapseLabel }) => {
|
6639
|
+
const ref = React64.useRef(null);
|
6640
|
+
const [clamped, setClamped] = React64.useState(true);
|
6641
|
+
const [isClampingEnabled, setClampingEnabled] = React64.useState(false);
|
6642
|
+
React64.useEffect(() => {
|
6619
6643
|
var _a, _b;
|
6620
6644
|
const el = ref.current;
|
6621
6645
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
6622
6646
|
}, [ref.current]);
|
6623
|
-
return /* @__PURE__ */
|
6647
|
+
return /* @__PURE__ */ React64.createElement("div", null, /* @__PURE__ */ React64.createElement(LineClamp, {
|
6624
6648
|
ref,
|
6625
|
-
|
6626
|
-
|
6649
|
+
lines,
|
6650
|
+
clamped
|
6651
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React64.createElement(GhostButton, {
|
6627
6652
|
dense: true,
|
6628
6653
|
onClick: () => setClamped(!clamped)
|
6629
6654
|
}, clamped ? expandLabel : collapseLabel));
|
6630
6655
|
};
|
6631
6656
|
|
6632
6657
|
// src/components/Link/Link.tsx
|
6633
|
-
import
|
6658
|
+
import React66 from "react";
|
6634
6659
|
|
6635
6660
|
// src/common/Link/Link.tsx
|
6636
|
-
import
|
6661
|
+
import React65 from "react";
|
6637
6662
|
var Link = (_a) => {
|
6638
6663
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
6639
|
-
return /* @__PURE__ */
|
6664
|
+
return /* @__PURE__ */ React65.createElement("a", __spreadValues({
|
6640
6665
|
className: classNames(className, linkStyle)
|
6641
6666
|
}, props), children);
|
6642
6667
|
};
|
6643
6668
|
|
6644
6669
|
// src/components/Link/Link.tsx
|
6645
|
-
var Link2 = (props) => /* @__PURE__ */
|
6670
|
+
var Link2 = (props) => /* @__PURE__ */ React66.createElement(Link, __spreadValues({}, props));
|
6646
6671
|
|
6647
6672
|
// src/components/List/List.tsx
|
6648
|
-
import
|
6649
|
-
var List = ({ items, renderItem, container =
|
6673
|
+
import React67 from "react";
|
6674
|
+
var List = ({ items, renderItem, container = React67.Fragment }) => {
|
6650
6675
|
const Component = container;
|
6651
|
-
return /* @__PURE__ */
|
6676
|
+
return /* @__PURE__ */ React67.createElement(Component, null, items.map(renderItem));
|
6652
6677
|
};
|
6653
6678
|
|
6654
6679
|
// src/components/ListItem/ListItem.tsx
|
6655
|
-
import
|
6680
|
+
import React68 from "react";
|
6656
6681
|
var ListItem = ({ name, icon, active = false }) => {
|
6657
|
-
return /* @__PURE__ */
|
6682
|
+
return /* @__PURE__ */ React68.createElement(Flexbox, {
|
6658
6683
|
alignItems: "center"
|
6659
|
-
}, /* @__PURE__ */
|
6684
|
+
}, /* @__PURE__ */ React68.createElement(Typography2, {
|
6660
6685
|
variant: active ? "small-strong" : "small",
|
6661
6686
|
color: "grey-70",
|
6662
6687
|
htmlTag: "span",
|
6663
6688
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6664
|
-
}, /* @__PURE__ */
|
6689
|
+
}, /* @__PURE__ */ React68.createElement("img", {
|
6665
6690
|
src: icon,
|
6666
6691
|
alt: name,
|
6667
6692
|
className: "inline mr-4",
|
@@ -6671,7 +6696,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6671
6696
|
};
|
6672
6697
|
|
6673
6698
|
// src/components/Modal/Modal.tsx
|
6674
|
-
import
|
6699
|
+
import React70 from "react";
|
6675
6700
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6676
6701
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
6677
6702
|
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
@@ -6681,18 +6706,18 @@ import castArray from "lodash/castArray";
|
|
6681
6706
|
import omit10 from "lodash/omit";
|
6682
6707
|
|
6683
6708
|
// src/components/Tabs/Tabs.tsx
|
6684
|
-
import
|
6709
|
+
import React69, { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState7 } from "react";
|
6685
6710
|
import isNumber5 from "lodash/isNumber";
|
6686
6711
|
import kebabCase from "lodash/kebabCase";
|
6687
6712
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6688
6713
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6689
6714
|
var import_warningSign3 = __toESM(require_warningSign());
|
6690
6715
|
var isTabComponent = (c) => {
|
6691
|
-
return
|
6716
|
+
return React69.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6692
6717
|
};
|
6693
|
-
var Tab =
|
6718
|
+
var Tab = React69.forwardRef(
|
6694
6719
|
({ className, id, title, children }, ref) => {
|
6695
|
-
return /* @__PURE__ */
|
6720
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
6696
6721
|
ref,
|
6697
6722
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6698
6723
|
className,
|
@@ -6704,14 +6729,14 @@ var Tab = React68.forwardRef(
|
|
6704
6729
|
);
|
6705
6730
|
var TabContainer = (_a) => {
|
6706
6731
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6707
|
-
return /* @__PURE__ */
|
6732
|
+
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6708
6733
|
className: classNames("py-6 z-0", className)
|
6709
6734
|
}), children);
|
6710
6735
|
};
|
6711
6736
|
var ModalTab = Tab;
|
6712
6737
|
var ModalTabContainer = TabContainer;
|
6713
6738
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6714
|
-
const Tab2 =
|
6739
|
+
const Tab2 = React69.forwardRef(
|
6715
6740
|
(_a, ref) => {
|
6716
6741
|
var _b = _a, {
|
6717
6742
|
id,
|
@@ -6741,17 +6766,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6741
6766
|
const _id = id != null ? id : kebabCase(title);
|
6742
6767
|
let statusIcon = void 0;
|
6743
6768
|
if (status === "warning") {
|
6744
|
-
statusIcon = /* @__PURE__ */
|
6769
|
+
statusIcon = /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6745
6770
|
icon: import_warningSign3.default,
|
6746
6771
|
color: "warning-80"
|
6747
6772
|
});
|
6748
6773
|
} else if (status === "error") {
|
6749
|
-
statusIcon = /* @__PURE__ */
|
6774
|
+
statusIcon = /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6750
6775
|
icon: import_warningSign3.default,
|
6751
6776
|
color: "error-50"
|
6752
6777
|
});
|
6753
6778
|
}
|
6754
|
-
const tab = /* @__PURE__ */
|
6779
|
+
const tab = /* @__PURE__ */ React69.createElement(Component, __spreadValues({
|
6755
6780
|
ref,
|
6756
6781
|
id: `${_id}-tab`,
|
6757
6782
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6768,24 +6793,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6768
6793
|
"aria-selected": selected,
|
6769
6794
|
"aria-controls": `${_id}-panel`,
|
6770
6795
|
tabIndex: disabled ? void 0 : 0
|
6771
|
-
}, rest), /* @__PURE__ */
|
6796
|
+
}, rest), /* @__PURE__ */ React69.createElement(Typography2, {
|
6772
6797
|
htmlTag: "div",
|
6773
6798
|
variant: "small",
|
6774
6799
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6775
6800
|
className: tw("inline-flex items-center gap-3")
|
6776
|
-
}, /* @__PURE__ */
|
6801
|
+
}, /* @__PURE__ */ React69.createElement("span", {
|
6777
6802
|
className: tw("whitespace-nowrap")
|
6778
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
6803
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React69.createElement(Typography2, {
|
6779
6804
|
htmlTag: "span",
|
6780
6805
|
variant: "small",
|
6781
6806
|
color: selected ? "primary-80" : "grey-5",
|
6782
6807
|
className: "leading-none"
|
6783
|
-
}, /* @__PURE__ */
|
6808
|
+
}, /* @__PURE__ */ React69.createElement(TabBadge, {
|
6784
6809
|
kind: "filled",
|
6785
6810
|
value: badge,
|
6786
6811
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6787
6812
|
})), statusIcon));
|
6788
|
-
return tooltip ? /* @__PURE__ */
|
6813
|
+
return tooltip ? /* @__PURE__ */ React69.createElement(Tooltip, {
|
6789
6814
|
content: tooltip
|
6790
6815
|
}, tab) : tab;
|
6791
6816
|
}
|
@@ -6799,7 +6824,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6799
6824
|
const Tabs2 = (props) => {
|
6800
6825
|
var _a, _b;
|
6801
6826
|
const { className, value, defaultValue, onChange, children } = props;
|
6802
|
-
const childArr =
|
6827
|
+
const childArr = React69.Children.toArray(children);
|
6803
6828
|
const firstTab = childArr[0];
|
6804
6829
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6805
6830
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -6812,7 +6837,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6812
6837
|
var _a2, _b2;
|
6813
6838
|
const container = containerRef.current;
|
6814
6839
|
const tabs = tabsRef.current;
|
6815
|
-
const values =
|
6840
|
+
const values = React69.Children.map(
|
6816
6841
|
children,
|
6817
6842
|
(tab, i) => {
|
6818
6843
|
var _a3;
|
@@ -6853,7 +6878,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6853
6878
|
updateCarets();
|
6854
6879
|
setSelected(value);
|
6855
6880
|
revealSelectedTab({ smooth: value !== selected });
|
6856
|
-
}, [value,
|
6881
|
+
}, [value, React69.Children.count(children)]);
|
6857
6882
|
useLayoutEffect2(() => {
|
6858
6883
|
var _a2;
|
6859
6884
|
updateCarets();
|
@@ -6917,27 +6942,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6917
6942
|
const handleSelected = (key) => {
|
6918
6943
|
(onChange != null ? onChange : setSelected)(key);
|
6919
6944
|
};
|
6920
|
-
|
6945
|
+
React69.Children.forEach(children, (c) => {
|
6921
6946
|
if (c && !isTabComponent(c)) {
|
6922
6947
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6923
6948
|
}
|
6924
6949
|
});
|
6925
|
-
return /* @__PURE__ */
|
6950
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
6926
6951
|
ref: parentRef,
|
6927
6952
|
className: classNames(tw("h-full"), className)
|
6928
|
-
}, /* @__PURE__ */
|
6953
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6929
6954
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6930
|
-
}, /* @__PURE__ */
|
6955
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6931
6956
|
ref: containerRef,
|
6932
6957
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6933
|
-
}, /* @__PURE__ */
|
6958
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6934
6959
|
ref: tabsRef,
|
6935
6960
|
role: "tablist",
|
6936
6961
|
"aria-label": "tabs",
|
6937
6962
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
6938
|
-
},
|
6963
|
+
}, React69.Children.map(
|
6939
6964
|
children,
|
6940
|
-
(tab, index) => tab ? /* @__PURE__ */
|
6965
|
+
(tab, index) => tab ? /* @__PURE__ */ React69.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
6941
6966
|
key: tab.props.value
|
6942
6967
|
}, tab.props), {
|
6943
6968
|
index,
|
@@ -6945,20 +6970,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6945
6970
|
onKeyDown: handleKeyDown,
|
6946
6971
|
onSelected: handleSelected
|
6947
6972
|
})) : void 0
|
6948
|
-
))), leftCaret && /* @__PURE__ */
|
6973
|
+
))), leftCaret && /* @__PURE__ */ React69.createElement("div", {
|
6949
6974
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
6950
|
-
}, /* @__PURE__ */
|
6975
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6951
6976
|
onClick: () => handleScrollToNext("left"),
|
6952
6977
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6953
|
-
}, /* @__PURE__ */
|
6978
|
+
}, /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6954
6979
|
icon: import_chevronLeft2.default
|
6955
|
-
}))), rightCaret && /* @__PURE__ */
|
6980
|
+
}))), rightCaret && /* @__PURE__ */ React69.createElement("div", {
|
6956
6981
|
onClick: () => handleScrollToNext("right"),
|
6957
6982
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
6958
|
-
}, /* @__PURE__ */
|
6983
|
+
}, /* @__PURE__ */ React69.createElement("div", {
|
6959
6984
|
onClick: () => handleScrollToNext("right"),
|
6960
6985
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6961
|
-
}, /* @__PURE__ */
|
6986
|
+
}, /* @__PURE__ */ React69.createElement(InlineIcon, {
|
6962
6987
|
icon: import_chevronRight2.default
|
6963
6988
|
})))), renderChildren(children, selected, props));
|
6964
6989
|
};
|
@@ -6966,7 +6991,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6966
6991
|
Tabs2.Tab = TabComponent;
|
6967
6992
|
return Tabs2;
|
6968
6993
|
};
|
6969
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
6994
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React69.createElement(TabContainer, null, children.find(
|
6970
6995
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6971
6996
|
)));
|
6972
6997
|
|
@@ -6983,7 +7008,7 @@ var Modal2 = ({
|
|
6983
7008
|
secondaryActions,
|
6984
7009
|
size
|
6985
7010
|
}) => {
|
6986
|
-
const ref =
|
7011
|
+
const ref = React70.useRef(null);
|
6987
7012
|
const state = useOverlayTriggerState4({ isOpen: open });
|
6988
7013
|
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
6989
7014
|
const labelledBy = useId2();
|
@@ -6995,35 +7020,35 @@ var Modal2 = ({
|
|
6995
7020
|
if (!open) {
|
6996
7021
|
return null;
|
6997
7022
|
}
|
6998
|
-
return /* @__PURE__ */
|
7023
|
+
return /* @__PURE__ */ React70.createElement(Overlay2, null, /* @__PURE__ */ React70.createElement(Modal, {
|
6999
7024
|
open: state.isOpen
|
7000
|
-
}, /* @__PURE__ */
|
7025
|
+
}, /* @__PURE__ */ React70.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React70.createElement(FocusScope3, {
|
7001
7026
|
contain: true,
|
7002
7027
|
restoreFocus: true,
|
7003
7028
|
autoFocus: true
|
7004
|
-
}, /* @__PURE__ */
|
7029
|
+
}, /* @__PURE__ */ React70.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
7005
7030
|
ref,
|
7006
7031
|
size
|
7007
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
7032
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React70.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React70.createElement(IconButton, {
|
7008
7033
|
"aria-label": "Close",
|
7009
7034
|
icon: import_cross5.default,
|
7010
7035
|
onClick: onClose
|
7011
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
7036
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React70.createElement(Modal.HeaderImage, {
|
7012
7037
|
backgroundImage: headerImage
|
7013
|
-
}), /* @__PURE__ */
|
7038
|
+
}), /* @__PURE__ */ React70.createElement(Modal.Header, {
|
7014
7039
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
7015
|
-
}, /* @__PURE__ */
|
7040
|
+
}, /* @__PURE__ */ React70.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React70.createElement(Modal.Title, {
|
7016
7041
|
id: labelledBy
|
7017
|
-
}, title), subtitle && /* @__PURE__ */
|
7042
|
+
}, 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
7043
|
id: describedBy,
|
7019
7044
|
tabIndex: 0,
|
7020
7045
|
noFooter: !(secondaryActions || primaryAction)
|
7021
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7046
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React70.createElement(Modal.Footer, null, /* @__PURE__ */ React70.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
7022
7047
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7023
|
-
return /* @__PURE__ */
|
7048
|
+
return /* @__PURE__ */ React70.createElement(SecondaryButton, __spreadValues({
|
7024
7049
|
key: text
|
7025
7050
|
}, action), text);
|
7026
|
-
}), primaryAction && /* @__PURE__ */
|
7051
|
+
}), primaryAction && /* @__PURE__ */ React70.createElement(PrimaryButton, __spreadValues({
|
7027
7052
|
key: primaryAction.text
|
7028
7053
|
}, omit10(primaryAction, "text")), primaryAction.text)))))));
|
7029
7054
|
};
|
@@ -7031,24 +7056,24 @@ var ModalTabs = createTabsComponent(
|
|
7031
7056
|
ModalTab,
|
7032
7057
|
TabItem,
|
7033
7058
|
"ModalTabs",
|
7034
|
-
(children, selected, props) => /* @__PURE__ */
|
7059
|
+
(children, selected, props) => /* @__PURE__ */ React70.createElement(Modal.Body, {
|
7035
7060
|
maxHeight: props.maxHeight
|
7036
|
-
}, /* @__PURE__ */
|
7061
|
+
}, /* @__PURE__ */ React70.createElement(ModalTabContainer, null, children.find(
|
7037
7062
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
7038
7063
|
)))
|
7039
7064
|
);
|
7040
7065
|
|
7041
7066
|
// src/components/MultiInput/MultiInput.tsx
|
7042
|
-
import
|
7067
|
+
import React72, { useEffect as useEffect6, useRef as useRef9, useState as useState8 } from "react";
|
7043
7068
|
import castArray2 from "lodash/castArray";
|
7044
7069
|
import identity from "lodash/identity";
|
7045
7070
|
import omit11 from "lodash/omit";
|
7046
7071
|
import uniqueId4 from "lodash/uniqueId";
|
7047
7072
|
|
7048
7073
|
// src/components/MultiInput/InputChip.tsx
|
7049
|
-
import
|
7074
|
+
import React71 from "react";
|
7050
7075
|
var import_smallCross = __toESM(require_smallCross());
|
7051
|
-
var InputChip =
|
7076
|
+
var InputChip = React71.forwardRef(
|
7052
7077
|
(_a, ref) => {
|
7053
7078
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
7054
7079
|
const onClick = (e) => {
|
@@ -7056,7 +7081,7 @@ var InputChip = React70.forwardRef(
|
|
7056
7081
|
_onClick == null ? void 0 : _onClick(e);
|
7057
7082
|
}
|
7058
7083
|
};
|
7059
|
-
return /* @__PURE__ */
|
7084
|
+
return /* @__PURE__ */ React71.createElement("div", __spreadValues({
|
7060
7085
|
ref,
|
7061
7086
|
role: "button",
|
7062
7087
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -7066,10 +7091,10 @@ var InputChip = React70.forwardRef(
|
|
7066
7091
|
"bg-grey-5 pointer-events-none": disabled
|
7067
7092
|
}),
|
7068
7093
|
onClick
|
7069
|
-
}, props), /* @__PURE__ */
|
7094
|
+
}, props), /* @__PURE__ */ React71.createElement(Typography2, {
|
7070
7095
|
variant: "small",
|
7071
7096
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
7072
|
-
}, children), !readOnly && /* @__PURE__ */
|
7097
|
+
}, children), !readOnly && /* @__PURE__ */ React71.createElement("div", null, /* @__PURE__ */ React71.createElement(Icon, {
|
7073
7098
|
icon: import_smallCross.default,
|
7074
7099
|
className: tw("ml-2", {
|
7075
7100
|
"text-error-70": invalid,
|
@@ -7210,7 +7235,7 @@ var MultiInputBase = (_a) => {
|
|
7210
7235
|
};
|
7211
7236
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
7212
7237
|
var _a3;
|
7213
|
-
return /* @__PURE__ */
|
7238
|
+
return /* @__PURE__ */ React72.createElement(InputChip, {
|
7214
7239
|
key: `${itemToString(item)}.${index}`,
|
7215
7240
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
7216
7241
|
readOnly,
|
@@ -7221,11 +7246,11 @@ var MultiInputBase = (_a) => {
|
|
7221
7246
|
}
|
7222
7247
|
}, itemToString(item));
|
7223
7248
|
});
|
7224
|
-
return /* @__PURE__ */
|
7249
|
+
return /* @__PURE__ */ React72.createElement("div", null, /* @__PURE__ */ React72.createElement(Select.InputContainer, {
|
7225
7250
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7226
|
-
}, /* @__PURE__ */
|
7251
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
7227
7252
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
7228
|
-
}, inline && renderChips(), /* @__PURE__ */
|
7253
|
+
}, inline && renderChips(), /* @__PURE__ */ React72.createElement(Select.Input, __spreadProps(__spreadValues({
|
7229
7254
|
ref: inputRef,
|
7230
7255
|
id: id != null ? id : name,
|
7231
7256
|
name,
|
@@ -7243,11 +7268,11 @@ var MultiInputBase = (_a) => {
|
|
7243
7268
|
onFocus: handleFocus,
|
7244
7269
|
onBlur: handleBlur,
|
7245
7270
|
autoComplete: "off"
|
7246
|
-
}))), endAdornment && /* @__PURE__ */
|
7271
|
+
}))), endAdornment && /* @__PURE__ */ React72.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React72.createElement("div", {
|
7247
7272
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
7248
7273
|
}, renderChips()));
|
7249
7274
|
};
|
7250
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7275
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React72.createElement(Skeleton, {
|
7251
7276
|
height: 38
|
7252
7277
|
});
|
7253
7278
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7264,14 +7289,14 @@ var MultiInput = (props) => {
|
|
7264
7289
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7265
7290
|
const labelControlProps = getLabelControlProps(props);
|
7266
7291
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7267
|
-
return /* @__PURE__ */
|
7292
|
+
return /* @__PURE__ */ React72.createElement(LabelControl, __spreadProps(__spreadValues({
|
7268
7293
|
id: `${id.current}-label`,
|
7269
7294
|
htmlFor: `${id.current}-input`,
|
7270
7295
|
messageId: errorMessageId
|
7271
7296
|
}, labelControlProps), {
|
7272
7297
|
length: value.length,
|
7273
7298
|
maxLength
|
7274
|
-
}), /* @__PURE__ */
|
7299
|
+
}), /* @__PURE__ */ React72.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7275
7300
|
id: `${id.current}-input`,
|
7276
7301
|
onChange: (value2) => {
|
7277
7302
|
var _a2;
|
@@ -7283,12 +7308,12 @@ var MultiInput = (props) => {
|
|
7283
7308
|
valid: props.valid
|
7284
7309
|
})));
|
7285
7310
|
};
|
7286
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7311
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React72.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React72.createElement(MultiInputBase.Skeleton, null));
|
7287
7312
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7288
7313
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7289
7314
|
|
7290
7315
|
// src/components/MultiSelect/MultiSelect.tsx
|
7291
|
-
import
|
7316
|
+
import React73, { useRef as useRef10, useState as useState9 } from "react";
|
7292
7317
|
import { useOverlayPosition as useOverlayPosition5 } from "@react-aria/overlays";
|
7293
7318
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7294
7319
|
import isEqual from "lodash/isEqual";
|
@@ -7426,7 +7451,7 @@ var MultiSelectBase = (_a) => {
|
|
7426
7451
|
});
|
7427
7452
|
const inputProps = getInputProps(getDropdownProps({ disabled: disabled || readOnly }));
|
7428
7453
|
const renderChips = () => {
|
7429
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7454
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React73.createElement(InputChip, __spreadProps(__spreadValues({
|
7430
7455
|
key: `${itemToString(selectedItem)}.chip`,
|
7431
7456
|
className: tw("mx-0"),
|
7432
7457
|
disabled,
|
@@ -7442,14 +7467,14 @@ var MultiSelectBase = (_a) => {
|
|
7442
7467
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7443
7468
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
7444
7469
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7445
|
-
return /* @__PURE__ */
|
7470
|
+
return /* @__PURE__ */ React73.createElement("div", {
|
7446
7471
|
className: tw("relative")
|
7447
|
-
}, /* @__PURE__ */
|
7472
|
+
}, /* @__PURE__ */ React73.createElement(Select.InputContainer, {
|
7448
7473
|
ref: targetRef,
|
7449
7474
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7450
|
-
}, /* @__PURE__ */
|
7475
|
+
}, /* @__PURE__ */ React73.createElement("div", {
|
7451
7476
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7452
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7477
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React73.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7453
7478
|
id,
|
7454
7479
|
name,
|
7455
7480
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
@@ -7470,12 +7495,12 @@ var MultiSelectBase = (_a) => {
|
|
7470
7495
|
setFocus(false);
|
7471
7496
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
7472
7497
|
}
|
7473
|
-
}))), !readOnly && /* @__PURE__ */
|
7498
|
+
}))), !readOnly && /* @__PURE__ */ React73.createElement(Select.Toggle, __spreadValues({
|
7474
7499
|
hasFocus,
|
7475
7500
|
isOpen
|
7476
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7501
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React73.createElement("div", {
|
7477
7502
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7478
|
-
}, renderChips()), /* @__PURE__ */
|
7503
|
+
}, renderChips()), /* @__PURE__ */ React73.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7479
7504
|
isOpen: true,
|
7480
7505
|
isDismissable: true,
|
7481
7506
|
autoFocus: true
|
@@ -7483,15 +7508,15 @@ var MultiSelectBase = (_a) => {
|
|
7483
7508
|
style,
|
7484
7509
|
onClose: closeMenu,
|
7485
7510
|
className: tw("overflow-y-auto")
|
7486
|
-
}), /* @__PURE__ */
|
7511
|
+
}), /* @__PURE__ */ React73.createElement(Select.Menu, {
|
7487
7512
|
maxHeight
|
7488
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
7513
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React73.createElement(Select.NoResults, null, noResults), isOpen && filteredOptions.map((item, index) => /* @__PURE__ */ React73.createElement(Select.Item, __spreadValues({
|
7489
7514
|
key: itemToString(item),
|
7490
7515
|
highlighted: index === highlightedIndex,
|
7491
7516
|
selected: selectedItems.includes(item)
|
7492
7517
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7493
7518
|
};
|
7494
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7519
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React73.createElement(Skeleton, {
|
7495
7520
|
height: 38
|
7496
7521
|
});
|
7497
7522
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7509,11 +7534,11 @@ var MultiSelect = (_a) => {
|
|
7509
7534
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7510
7535
|
const labelControlProps = getLabelControlProps(props);
|
7511
7536
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7512
|
-
return /* @__PURE__ */
|
7537
|
+
return /* @__PURE__ */ React73.createElement(LabelControl, __spreadValues({
|
7513
7538
|
id: `${id.current}-label`,
|
7514
7539
|
htmlFor: `${id.current}-input`,
|
7515
7540
|
messageId: errorMessageId
|
7516
|
-
}, labelControlProps), /* @__PURE__ */
|
7541
|
+
}, labelControlProps), /* @__PURE__ */ React73.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7517
7542
|
id: id.current,
|
7518
7543
|
options,
|
7519
7544
|
noResults,
|
@@ -7521,16 +7546,16 @@ var MultiSelect = (_a) => {
|
|
7521
7546
|
valid: props.valid
|
7522
7547
|
})));
|
7523
7548
|
};
|
7524
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7549
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React73.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React73.createElement(MultiSelectBase.Skeleton, null));
|
7525
7550
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7526
7551
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7527
7552
|
|
7528
7553
|
// src/components/NativeSelect/NativeSelect.tsx
|
7529
|
-
import
|
7554
|
+
import React74, { useRef as useRef11 } from "react";
|
7530
7555
|
import omit13 from "lodash/omit";
|
7531
7556
|
import uniqueId6 from "lodash/uniqueId";
|
7532
7557
|
var import_caretDown = __toESM(require_caretDown());
|
7533
|
-
var NativeSelectBase =
|
7558
|
+
var NativeSelectBase = React74.forwardRef(
|
7534
7559
|
(_a, ref) => {
|
7535
7560
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7536
7561
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7547,16 +7572,16 @@ var NativeSelectBase = React73.forwardRef(
|
|
7547
7572
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7548
7573
|
}
|
7549
7574
|
};
|
7550
|
-
return /* @__PURE__ */
|
7575
|
+
return /* @__PURE__ */ React74.createElement("span", {
|
7551
7576
|
className: tw("relative block")
|
7552
|
-
}, !readOnly && /* @__PURE__ */
|
7577
|
+
}, !readOnly && /* @__PURE__ */ React74.createElement("span", {
|
7553
7578
|
className: tw(
|
7554
7579
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7555
7580
|
)
|
7556
|
-
}, /* @__PURE__ */
|
7581
|
+
}, /* @__PURE__ */ React74.createElement(Icon, {
|
7557
7582
|
icon: import_caretDown.default,
|
7558
7583
|
"data-testid": "icon-dropdown"
|
7559
|
-
})), /* @__PURE__ */
|
7584
|
+
})), /* @__PURE__ */ React74.createElement("select", __spreadProps(__spreadValues({
|
7560
7585
|
ref,
|
7561
7586
|
disabled: disabled || readOnly,
|
7562
7587
|
required
|
@@ -7575,16 +7600,16 @@ var NativeSelectBase = React73.forwardRef(
|
|
7575
7600
|
),
|
7576
7601
|
props.className
|
7577
7602
|
)
|
7578
|
-
}), props.placeholder && /* @__PURE__ */
|
7603
|
+
}), props.placeholder && /* @__PURE__ */ React74.createElement("option", {
|
7579
7604
|
value: placeholderValue,
|
7580
7605
|
disabled: true
|
7581
7606
|
}, props.placeholder), children));
|
7582
7607
|
}
|
7583
7608
|
);
|
7584
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7609
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React74.createElement(Skeleton, {
|
7585
7610
|
height: 38
|
7586
7611
|
});
|
7587
|
-
var NativeSelect =
|
7612
|
+
var NativeSelect = React74.forwardRef(
|
7588
7613
|
(_a, ref) => {
|
7589
7614
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7590
7615
|
var _a2;
|
@@ -7593,11 +7618,11 @@ var NativeSelect = React73.forwardRef(
|
|
7593
7618
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7594
7619
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7595
7620
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
7596
|
-
return /* @__PURE__ */
|
7621
|
+
return /* @__PURE__ */ React74.createElement(LabelControl, __spreadValues({
|
7597
7622
|
id: `${id.current}-label`,
|
7598
7623
|
htmlFor: id.current,
|
7599
7624
|
messageId: errorMessageId
|
7600
|
-
}, labelControlProps), /* @__PURE__ */
|
7625
|
+
}, labelControlProps), /* @__PURE__ */ React74.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7601
7626
|
ref
|
7602
7627
|
}, baseProps), errorProps), {
|
7603
7628
|
id: id.current,
|
@@ -7611,21 +7636,21 @@ var NativeSelect = React73.forwardRef(
|
|
7611
7636
|
}
|
7612
7637
|
);
|
7613
7638
|
NativeSelect.displayName = "NativeSelect";
|
7614
|
-
var Option =
|
7639
|
+
var Option = React74.forwardRef((_a, ref) => {
|
7615
7640
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7616
|
-
return /* @__PURE__ */
|
7641
|
+
return /* @__PURE__ */ React74.createElement("option", __spreadValues({
|
7617
7642
|
ref
|
7618
7643
|
}, props), children);
|
7619
7644
|
});
|
7620
7645
|
Option.displayName = "Option";
|
7621
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
7646
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React74.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React74.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React74.createElement("div", {
|
7622
7647
|
style: { height: "1px" }
|
7623
7648
|
}));
|
7624
7649
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7625
7650
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7626
7651
|
|
7627
7652
|
// src/components/PageHeader/PageHeader.tsx
|
7628
|
-
import
|
7653
|
+
import React75 from "react";
|
7629
7654
|
import castArray3 from "lodash/castArray";
|
7630
7655
|
import omit14 from "lodash/omit";
|
7631
7656
|
var PageHeader = ({
|
@@ -7637,48 +7662,48 @@ var PageHeader = ({
|
|
7637
7662
|
chips = [],
|
7638
7663
|
breadcrumbs
|
7639
7664
|
}) => {
|
7640
|
-
return /* @__PURE__ */
|
7665
|
+
return /* @__PURE__ */ React75.createElement(Flexbox, {
|
7641
7666
|
direction: "row",
|
7642
7667
|
gap: "4",
|
7643
7668
|
paddingBottom: "6"
|
7644
|
-
}, /* @__PURE__ */
|
7669
|
+
}, /* @__PURE__ */ React75.createElement(Flexbox, {
|
7645
7670
|
className: tw("grow"),
|
7646
7671
|
direction: "column",
|
7647
7672
|
gap: "0"
|
7648
|
-
}, breadcrumbs && /* @__PURE__ */
|
7673
|
+
}, breadcrumbs && /* @__PURE__ */ React75.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React75.createElement(Flexbox, {
|
7649
7674
|
gap: "5"
|
7650
|
-
}, image && /* @__PURE__ */
|
7675
|
+
}, image && /* @__PURE__ */ React75.createElement("img", {
|
7651
7676
|
src: image,
|
7652
7677
|
alt: imageAlt,
|
7653
7678
|
className: tw("w-[56px] h-[56px]")
|
7654
|
-
}), /* @__PURE__ */
|
7679
|
+
}), /* @__PURE__ */ React75.createElement(Flexbox, {
|
7655
7680
|
direction: "column",
|
7656
7681
|
justifyContent: "center"
|
7657
|
-
}, /* @__PURE__ */
|
7682
|
+
}, /* @__PURE__ */ React75.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React75.createElement(Flexbox, {
|
7658
7683
|
gap: "3"
|
7659
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7684
|
+
}, chips.map((chip) => /* @__PURE__ */ React75.createElement(Chip2, {
|
7660
7685
|
key: chip,
|
7661
7686
|
dense: true,
|
7662
7687
|
text: chip
|
7663
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7688
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React75.createElement(Flexbox, {
|
7664
7689
|
gap: "4",
|
7665
7690
|
className: tw("self-start")
|
7666
7691
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7667
7692
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7668
|
-
return /* @__PURE__ */
|
7693
|
+
return /* @__PURE__ */ React75.createElement(SecondaryButton, __spreadValues({
|
7669
7694
|
key: text
|
7670
7695
|
}, action), text);
|
7671
|
-
}), primaryAction && /* @__PURE__ */
|
7696
|
+
}), primaryAction && /* @__PURE__ */ React75.createElement(PrimaryButton, __spreadValues({
|
7672
7697
|
key: primaryAction.text
|
7673
7698
|
}, omit14(primaryAction, "text")), primaryAction.text)));
|
7674
7699
|
};
|
7675
7700
|
|
7676
7701
|
// src/components/Pagination/Pagination.tsx
|
7677
|
-
import
|
7702
|
+
import React77 from "react";
|
7678
7703
|
import clamp from "lodash/clamp";
|
7679
7704
|
|
7680
7705
|
// src/components/Select/Select.tsx
|
7681
|
-
import
|
7706
|
+
import React76, { useRef as useRef12, useState as useState10 } from "react";
|
7682
7707
|
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7683
7708
|
import { useSelect } from "downshift";
|
7684
7709
|
import defaults from "lodash/defaults";
|
@@ -7695,10 +7720,10 @@ var hasOptionGroups = (val) => {
|
|
7695
7720
|
};
|
7696
7721
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7697
7722
|
var _a, _b;
|
7698
|
-
return /* @__PURE__ */
|
7723
|
+
return /* @__PURE__ */ React76.createElement(Select.Item, __spreadValues({
|
7699
7724
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7700
7725
|
selected: item === selectedItem
|
7701
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7726
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React76.createElement(InlineIcon, {
|
7702
7727
|
icon: item.icon
|
7703
7728
|
}), optionToString(item));
|
7704
7729
|
};
|
@@ -7815,13 +7840,13 @@ var _SelectBase = (props) => {
|
|
7815
7840
|
},
|
7816
7841
|
withDefaults
|
7817
7842
|
);
|
7818
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7843
|
+
const renderGroup = (group) => /* @__PURE__ */ React76.createElement(React76.Fragment, {
|
7819
7844
|
key: group.label
|
7820
|
-
}, /* @__PURE__ */
|
7821
|
-
const input = /* @__PURE__ */
|
7845
|
+
}, /* @__PURE__ */ React76.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7846
|
+
const input = /* @__PURE__ */ React76.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7822
7847
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7823
7848
|
tabIndex: 0
|
7824
|
-
}), /* @__PURE__ */
|
7849
|
+
}), /* @__PURE__ */ React76.createElement(Select.Input, __spreadProps(__spreadValues({
|
7825
7850
|
id,
|
7826
7851
|
name
|
7827
7852
|
}, rest), {
|
@@ -7833,16 +7858,16 @@ var _SelectBase = (props) => {
|
|
7833
7858
|
tabIndex: -1,
|
7834
7859
|
onFocus: () => setFocus(true),
|
7835
7860
|
onBlur: () => setFocus(false)
|
7836
|
-
})), !readOnly && /* @__PURE__ */
|
7861
|
+
})), !readOnly && /* @__PURE__ */ React76.createElement(Select.Toggle, {
|
7837
7862
|
disabled,
|
7838
7863
|
isOpen,
|
7839
7864
|
tabIndex: -1
|
7840
7865
|
}));
|
7841
7866
|
const width = (_b = targetRef.current) == null ? void 0 : _b.offsetWidth;
|
7842
7867
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7843
|
-
return /* @__PURE__ */
|
7868
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
7844
7869
|
className: tw("relative")
|
7845
|
-
}, labelWrapper ?
|
7870
|
+
}, labelWrapper ? React76.cloneElement(labelWrapper, { children: input }) : input, /* @__PURE__ */ React76.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7846
7871
|
isOpen: true,
|
7847
7872
|
isDismissable: true,
|
7848
7873
|
autoFocus: true
|
@@ -7850,11 +7875,11 @@ var _SelectBase = (props) => {
|
|
7850
7875
|
style,
|
7851
7876
|
onClose: closeMenu,
|
7852
7877
|
className: tw("overflow-y-auto")
|
7853
|
-
}), /* @__PURE__ */
|
7878
|
+
}), /* @__PURE__ */ React76.createElement(Select.Menu, {
|
7854
7879
|
maxHeight
|
7855
|
-
}, isOpen && options.length === 0 && /* @__PURE__ */
|
7880
|
+
}, 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
7881
|
onMouseOver: () => setHighlightedIndex(-1)
|
7857
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7882
|
+
}), actions.map((act, index) => /* @__PURE__ */ React76.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7858
7883
|
key: `${index}`
|
7859
7884
|
}, act), {
|
7860
7885
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7864,10 +7889,10 @@ var _SelectBase = (props) => {
|
|
7864
7889
|
}
|
7865
7890
|
}), act.label))))));
|
7866
7891
|
};
|
7867
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7892
|
+
var SelectBase = (props) => /* @__PURE__ */ React76.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7868
7893
|
labelWrapper: void 0
|
7869
7894
|
}));
|
7870
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7895
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React76.createElement(Skeleton, {
|
7871
7896
|
height: 38
|
7872
7897
|
});
|
7873
7898
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7885,19 +7910,19 @@ var Select2 = (_a) => {
|
|
7885
7910
|
const baseProps = omit15(props, Object.keys(labelProps));
|
7886
7911
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7887
7912
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7888
|
-
const label = /* @__PURE__ */
|
7913
|
+
const label = /* @__PURE__ */ React76.createElement(Label, __spreadValues({
|
7889
7914
|
id: `${id.current}-label`,
|
7890
7915
|
htmlFor: `${id.current}-input`,
|
7891
7916
|
variant,
|
7892
7917
|
messageId: errorMessageId
|
7893
7918
|
}, labelProps));
|
7894
|
-
return /* @__PURE__ */
|
7919
|
+
return /* @__PURE__ */ React76.createElement(FormControl, null, /* @__PURE__ */ React76.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7895
7920
|
id: `${id.current}-input`,
|
7896
7921
|
options,
|
7897
7922
|
disabled: props.disabled,
|
7898
7923
|
valid: props.valid,
|
7899
7924
|
labelWrapper: label
|
7900
|
-
})), /* @__PURE__ */
|
7925
|
+
})), /* @__PURE__ */ React76.createElement(HelperText, {
|
7901
7926
|
messageId: errorMessageId,
|
7902
7927
|
error: !labelProps.valid,
|
7903
7928
|
helperText: labelProps.helperText,
|
@@ -7906,7 +7931,7 @@ var Select2 = (_a) => {
|
|
7906
7931
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7907
7932
|
}));
|
7908
7933
|
};
|
7909
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7934
|
+
var SelectSkeleton = () => /* @__PURE__ */ React76.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React76.createElement(SelectBase.Skeleton, null));
|
7910
7935
|
Select2.Skeleton = SelectSkeleton;
|
7911
7936
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
7912
7937
|
|
@@ -7925,25 +7950,23 @@ var Pagination = ({
|
|
7925
7950
|
pageSizes,
|
7926
7951
|
onPageSizeChange
|
7927
7952
|
}) => {
|
7928
|
-
const [value, setValue] =
|
7929
|
-
|
7953
|
+
const [value, setValue] = React77.useState(currentPage);
|
7954
|
+
React77.useEffect(() => {
|
7930
7955
|
setValue(currentPage);
|
7931
7956
|
}, [currentPage]);
|
7932
|
-
|
7933
|
-
onPageChange(1);
|
7934
|
-
setValue(1);
|
7935
|
-
}, [pageSize]);
|
7936
|
-
return /* @__PURE__ */ React76.createElement(Box, {
|
7957
|
+
return /* @__PURE__ */ React77.createElement(Box, {
|
7937
7958
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7938
7959
|
backgroundColor: "grey-0",
|
7939
7960
|
padding: "4"
|
7940
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
7961
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React77.createElement(Box, {
|
7941
7962
|
display: "flex",
|
7942
7963
|
alignItems: "center",
|
7943
7964
|
gap: "4"
|
7944
|
-
}, /* @__PURE__ */
|
7965
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Small, {
|
7966
|
+
color: "grey-50"
|
7967
|
+
}, "Items per page "), /* @__PURE__ */ React77.createElement("div", {
|
7945
7968
|
className: tw("max-w-[70px]")
|
7946
|
-
}, /* @__PURE__ */
|
7969
|
+
}, /* @__PURE__ */ React77.createElement(SelectBase, {
|
7947
7970
|
options: pageSizes.map((size) => size.toString()),
|
7948
7971
|
value: pageSize.toString(),
|
7949
7972
|
onChange: (size) => {
|
@@ -7954,24 +7977,26 @@ var Pagination = ({
|
|
7954
7977
|
}
|
7955
7978
|
}
|
7956
7979
|
}
|
7957
|
-
}))) : /* @__PURE__ */
|
7980
|
+
}))) : /* @__PURE__ */ React77.createElement("div", null), /* @__PURE__ */ React77.createElement(Box, {
|
7958
7981
|
display: "flex",
|
7959
7982
|
justifyContent: "center",
|
7960
7983
|
alignItems: "center",
|
7961
7984
|
className: tw("grow")
|
7962
|
-
}, /* @__PURE__ */
|
7985
|
+
}, /* @__PURE__ */ React77.createElement(IconButton, {
|
7963
7986
|
"aria-label": "First",
|
7964
7987
|
onClick: () => onPageChange(1),
|
7965
7988
|
icon: import_chevronBackward.default,
|
7966
7989
|
disabled: !hasPreviousPage
|
7967
|
-
}), /* @__PURE__ */
|
7990
|
+
}), /* @__PURE__ */ React77.createElement(IconButton, {
|
7968
7991
|
"aria-label": "Previous",
|
7969
7992
|
onClick: () => onPageChange(currentPage - 1),
|
7970
7993
|
icon: import_chevronLeft3.default,
|
7971
7994
|
disabled: !hasPreviousPage
|
7972
|
-
}), /* @__PURE__ */
|
7995
|
+
}), /* @__PURE__ */ React77.createElement(Box, {
|
7973
7996
|
paddingX: "4"
|
7974
|
-
}, /* @__PURE__ */
|
7997
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Small, {
|
7998
|
+
color: "grey-60"
|
7999
|
+
}, "Page")), /* @__PURE__ */ React77.createElement(InputBase, {
|
7975
8000
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
7976
8001
|
type: "number",
|
7977
8002
|
min: 1,
|
@@ -7985,52 +8010,48 @@ var Pagination = ({
|
|
7985
8010
|
},
|
7986
8011
|
onBlur: ({ target: { value: value2 } }) => {
|
7987
8012
|
const numberValue = parseInt(value2);
|
7988
|
-
|
7989
|
-
|
7990
|
-
onPageChange(newPage);
|
7991
|
-
setValue(newPage);
|
7992
|
-
} else {
|
7993
|
-
onPageChange(1);
|
7994
|
-
setValue(1);
|
7995
|
-
}
|
8013
|
+
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
8014
|
+
onPageChange(newPage);
|
7996
8015
|
}
|
7997
|
-
}), /* @__PURE__ */
|
8016
|
+
}), /* @__PURE__ */ React77.createElement(Box, {
|
7998
8017
|
paddingX: "4"
|
7999
|
-
}, /* @__PURE__ */
|
8018
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Small, {
|
8019
|
+
color: "grey-60"
|
8020
|
+
}, "of ", totalPages)), /* @__PURE__ */ React77.createElement(IconButton, {
|
8000
8021
|
"aria-label": "Next",
|
8001
8022
|
onClick: () => onPageChange(currentPage + 1),
|
8002
8023
|
icon: import_chevronRight3.default,
|
8003
8024
|
disabled: !hasNextPage
|
8004
|
-
}), /* @__PURE__ */
|
8025
|
+
}), /* @__PURE__ */ React77.createElement(IconButton, {
|
8005
8026
|
"aria-label": "Last",
|
8006
8027
|
onClick: () => onPageChange(totalPages),
|
8007
8028
|
icon: import_chevronForward.default,
|
8008
8029
|
disabled: !hasNextPage
|
8009
|
-
})), /* @__PURE__ */
|
8030
|
+
})), /* @__PURE__ */ React77.createElement("div", null));
|
8010
8031
|
};
|
8011
8032
|
|
8012
8033
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
8013
|
-
import
|
8034
|
+
import React79 from "react";
|
8014
8035
|
import omit16 from "lodash/omit";
|
8015
8036
|
|
8016
8037
|
// src/common/PopoverDialog/PopoverDialog.tsx
|
8017
|
-
import
|
8038
|
+
import React78 from "react";
|
8018
8039
|
var Header = (_a) => {
|
8019
8040
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8020
|
-
return /* @__PURE__ */
|
8041
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8021
8042
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
8022
8043
|
}), children);
|
8023
8044
|
};
|
8024
8045
|
var Title = (_a) => {
|
8025
8046
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8026
|
-
return /* @__PURE__ */
|
8047
|
+
return /* @__PURE__ */ React78.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
8027
8048
|
htmlTag: "h1",
|
8028
8049
|
variant: "small-strong"
|
8029
8050
|
}), children);
|
8030
8051
|
};
|
8031
8052
|
var Body = (_a) => {
|
8032
8053
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8033
|
-
return /* @__PURE__ */
|
8054
|
+
return /* @__PURE__ */ React78.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
8034
8055
|
htmlTag: "div",
|
8035
8056
|
variant: "caption",
|
8036
8057
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -8038,13 +8059,13 @@ var Body = (_a) => {
|
|
8038
8059
|
};
|
8039
8060
|
var Footer = (_a) => {
|
8040
8061
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8041
|
-
return /* @__PURE__ */
|
8062
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8042
8063
|
className: classNames(tw("p-5"), className)
|
8043
8064
|
}), children);
|
8044
8065
|
};
|
8045
8066
|
var Actions2 = (_a) => {
|
8046
8067
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8047
|
-
return /* @__PURE__ */
|
8068
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8048
8069
|
className: classNames(tw("flex gap-4"), className)
|
8049
8070
|
}), children);
|
8050
8071
|
};
|
@@ -8060,13 +8081,13 @@ var PopoverDialog = {
|
|
8060
8081
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
8061
8082
|
const wrapPromptWithBody = (child) => {
|
8062
8083
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
8063
|
-
return /* @__PURE__ */
|
8084
|
+
return /* @__PURE__ */ React79.createElement(Popover2.Panel, {
|
8064
8085
|
className: tw("max-w-[300px]")
|
8065
|
-
}, /* @__PURE__ */
|
8086
|
+
}, /* @__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
8087
|
kind: "secondary-ghost",
|
8067
8088
|
key: secondaryAction.text,
|
8068
8089
|
dense: true
|
8069
|
-
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
8090
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React79.createElement(Popover2.Button, __spreadValues({
|
8070
8091
|
kind: "ghost",
|
8071
8092
|
key: primaryAction.text,
|
8072
8093
|
dense: true
|
@@ -8074,7 +8095,7 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8074
8095
|
}
|
8075
8096
|
return child;
|
8076
8097
|
};
|
8077
|
-
return /* @__PURE__ */
|
8098
|
+
return /* @__PURE__ */ React79.createElement(Popover2, {
|
8078
8099
|
type: "dialog",
|
8079
8100
|
isOpen: open,
|
8080
8101
|
placement,
|
@@ -8082,10 +8103,10 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8082
8103
|
isKeyboardDismissDisabled: false,
|
8083
8104
|
autoFocus: true,
|
8084
8105
|
containFocus: true
|
8085
|
-
},
|
8106
|
+
}, React79.Children.map(children, wrapPromptWithBody));
|
8086
8107
|
};
|
8087
8108
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
8088
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
8109
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React79.createElement(PopoverDialog.Body, null, children);
|
8089
8110
|
Prompt.displayName = "PopoverDialog.Prompt";
|
8090
8111
|
PopoverDialog2.Prompt = Prompt;
|
8091
8112
|
|
@@ -8094,14 +8115,14 @@ import { createPortal } from "react-dom";
|
|
8094
8115
|
var Portal = ({ children, to }) => createPortal(children, to);
|
8095
8116
|
|
8096
8117
|
// src/components/ProgressBar/ProgressBar.tsx
|
8097
|
-
import
|
8118
|
+
import React81 from "react";
|
8098
8119
|
|
8099
8120
|
// src/common/ProgressBar/ProgressBar.tsx
|
8100
|
-
import
|
8121
|
+
import React80 from "react";
|
8101
8122
|
import clamp2 from "lodash/clamp";
|
8102
8123
|
var ProgressBar = (_a) => {
|
8103
8124
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8104
|
-
return /* @__PURE__ */
|
8125
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8105
8126
|
className: classNames(
|
8106
8127
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
8107
8128
|
className
|
@@ -8117,7 +8138,7 @@ var STATUS_COLORS = {
|
|
8117
8138
|
ProgressBar.Indicator = (_a) => {
|
8118
8139
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
8119
8140
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
8120
|
-
return /* @__PURE__ */
|
8141
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8121
8142
|
className: classNames(
|
8122
8143
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
8123
8144
|
STATUS_COLORS[status],
|
@@ -8133,11 +8154,11 @@ ProgressBar.Indicator = (_a) => {
|
|
8133
8154
|
};
|
8134
8155
|
ProgressBar.Labels = (_a) => {
|
8135
8156
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
8136
|
-
return /* @__PURE__ */
|
8157
|
+
return /* @__PURE__ */ React80.createElement("div", {
|
8137
8158
|
className: classNames(tw("flex flex-row"), className)
|
8138
|
-
}, /* @__PURE__ */
|
8159
|
+
}, /* @__PURE__ */ React80.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8139
8160
|
className: tw("grow text-grey-70 typography-caption")
|
8140
|
-
}), startLabel), /* @__PURE__ */
|
8161
|
+
}), startLabel), /* @__PURE__ */ React80.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8141
8162
|
className: tw("grow text-grey-70 typography-caption text-right")
|
8142
8163
|
}), endLabel));
|
8143
8164
|
};
|
@@ -8155,7 +8176,7 @@ var ProgressBar2 = (props) => {
|
|
8155
8176
|
if (min > max) {
|
8156
8177
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
8157
8178
|
}
|
8158
|
-
const progress = /* @__PURE__ */
|
8179
|
+
const progress = /* @__PURE__ */ React81.createElement(ProgressBar, null, /* @__PURE__ */ React81.createElement(ProgressBar.Indicator, {
|
8159
8180
|
status: value === max ? completedStatus : progresStatus,
|
8160
8181
|
min,
|
8161
8182
|
max,
|
@@ -8165,13 +8186,13 @@ var ProgressBar2 = (props) => {
|
|
8165
8186
|
if (props.dense) {
|
8166
8187
|
return progress;
|
8167
8188
|
}
|
8168
|
-
return /* @__PURE__ */
|
8189
|
+
return /* @__PURE__ */ React81.createElement("div", null, progress, /* @__PURE__ */ React81.createElement(ProgressBar.Labels, {
|
8169
8190
|
className: tw("py-2"),
|
8170
8191
|
startLabel: props.startLabel,
|
8171
8192
|
endLabel: props.endLabel
|
8172
8193
|
}));
|
8173
8194
|
};
|
8174
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
8195
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React81.createElement(Skeleton, {
|
8175
8196
|
height: 4,
|
8176
8197
|
display: "block"
|
8177
8198
|
});
|
@@ -8179,13 +8200,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
8179
8200
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
8180
8201
|
|
8181
8202
|
// src/components/RadioButton/RadioButton.tsx
|
8182
|
-
import
|
8183
|
-
var RadioButton2 =
|
8203
|
+
import React82 from "react";
|
8204
|
+
var RadioButton2 = React82.forwardRef(
|
8184
8205
|
(_a, ref) => {
|
8185
8206
|
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
8207
|
var _a2;
|
8187
8208
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8188
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8209
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React82.createElement(ControlLabel, {
|
8189
8210
|
htmlFor: id,
|
8190
8211
|
label: children,
|
8191
8212
|
"aria-label": ariaLabel,
|
@@ -8193,7 +8214,7 @@ var RadioButton2 = React81.forwardRef(
|
|
8193
8214
|
readOnly,
|
8194
8215
|
disabled,
|
8195
8216
|
style: { gap: "0 8px" }
|
8196
|
-
}, !readOnly && /* @__PURE__ */
|
8217
|
+
}, !readOnly && /* @__PURE__ */ React82.createElement(RadioButton, __spreadProps(__spreadValues({
|
8197
8218
|
id,
|
8198
8219
|
ref,
|
8199
8220
|
name
|
@@ -8204,12 +8225,12 @@ var RadioButton2 = React81.forwardRef(
|
|
8204
8225
|
}
|
8205
8226
|
);
|
8206
8227
|
RadioButton2.displayName = "RadioButton";
|
8207
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
8228
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React82.createElement("div", {
|
8208
8229
|
className: tw("flex gap-3")
|
8209
|
-
}, /* @__PURE__ */
|
8230
|
+
}, /* @__PURE__ */ React82.createElement(Skeleton, {
|
8210
8231
|
height: 20,
|
8211
8232
|
width: 20
|
8212
|
-
}), /* @__PURE__ */
|
8233
|
+
}), /* @__PURE__ */ React82.createElement(Skeleton, {
|
8213
8234
|
height: 20,
|
8214
8235
|
width: 150
|
8215
8236
|
}));
|
@@ -8217,10 +8238,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
8217
8238
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
8218
8239
|
|
8219
8240
|
// src/components/RadioButtonGroup/RadioButtonGroup.tsx
|
8220
|
-
import
|
8241
|
+
import React83 from "react";
|
8221
8242
|
import uniqueId8 from "lodash/uniqueId";
|
8222
8243
|
var isRadioButton = (c) => {
|
8223
|
-
return
|
8244
|
+
return React83.isValidElement(c) && c.type === RadioButton2;
|
8224
8245
|
};
|
8225
8246
|
var RadioButtonGroup = (_a) => {
|
8226
8247
|
var _b = _a, {
|
@@ -8243,7 +8264,7 @@ var RadioButtonGroup = (_a) => {
|
|
8243
8264
|
"children"
|
8244
8265
|
]);
|
8245
8266
|
var _a2;
|
8246
|
-
const [value, setValue] =
|
8267
|
+
const [value, setValue] = React83.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
8247
8268
|
const errorMessageId = uniqueId8();
|
8248
8269
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8249
8270
|
const labelControlProps = getLabelControlProps(props);
|
@@ -8254,14 +8275,14 @@ var RadioButtonGroup = (_a) => {
|
|
8254
8275
|
setValue(e.target.value);
|
8255
8276
|
onChange == null ? void 0 : onChange(e.target.value);
|
8256
8277
|
};
|
8257
|
-
const content =
|
8278
|
+
const content = React83.Children.map(children, (c) => {
|
8258
8279
|
var _a3, _b2, _c;
|
8259
8280
|
if (!isRadioButton(c)) {
|
8260
8281
|
return null;
|
8261
8282
|
}
|
8262
8283
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
8263
8284
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
8264
|
-
return
|
8285
|
+
return React83.cloneElement(c, {
|
8265
8286
|
name,
|
8266
8287
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
8267
8288
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -8270,11 +8291,11 @@ var RadioButtonGroup = (_a) => {
|
|
8270
8291
|
readOnly
|
8271
8292
|
});
|
8272
8293
|
});
|
8273
|
-
return /* @__PURE__ */
|
8294
|
+
return /* @__PURE__ */ React83.createElement(LabelControl, __spreadValues(__spreadValues({
|
8274
8295
|
fieldset: true
|
8275
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
8296
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React83.createElement(InputGroup, {
|
8276
8297
|
cols
|
8277
|
-
}, content), !cols && /* @__PURE__ */
|
8298
|
+
}, content), !cols && /* @__PURE__ */ React83.createElement(Flexbox, {
|
8278
8299
|
direction,
|
8279
8300
|
alignItems: "flex-start",
|
8280
8301
|
colGap: "8",
|
@@ -8283,12 +8304,12 @@ var RadioButtonGroup = (_a) => {
|
|
8283
8304
|
}, content));
|
8284
8305
|
};
|
8285
8306
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
8286
|
-
return /* @__PURE__ */
|
8307
|
+
return /* @__PURE__ */ React83.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React83.createElement("div", {
|
8287
8308
|
className: tw("flex flex-wrap", {
|
8288
8309
|
"flex-row gap-8": direction === "row",
|
8289
8310
|
"flex-col gap-2": direction === "column"
|
8290
8311
|
})
|
8291
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8312
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React83.createElement(RadioButton2.Skeleton, {
|
8292
8313
|
key
|
8293
8314
|
}))));
|
8294
8315
|
};
|
@@ -8296,68 +8317,68 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
8296
8317
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
8297
8318
|
|
8298
8319
|
// src/components/Section/Section.tsx
|
8299
|
-
import
|
8320
|
+
import React85 from "react";
|
8300
8321
|
import castArray4 from "lodash/castArray";
|
8301
8322
|
|
8302
8323
|
// src/common/Section/Section.tsx
|
8303
|
-
import
|
8324
|
+
import React84 from "react";
|
8304
8325
|
var Section2 = (_a) => {
|
8305
8326
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8306
|
-
return /* @__PURE__ */
|
8327
|
+
return /* @__PURE__ */ React84.createElement(Box, __spreadValues({
|
8307
8328
|
borderColor: "grey-5",
|
8308
8329
|
borderWidth: "1px"
|
8309
8330
|
}, rest), children);
|
8310
8331
|
};
|
8311
8332
|
Section2.Header = (_a) => {
|
8312
8333
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8313
|
-
return /* @__PURE__ */
|
8334
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8314
8335
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8315
8336
|
}), children);
|
8316
8337
|
};
|
8317
8338
|
Section2.TitleContainer = (_a) => {
|
8318
8339
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8319
|
-
return /* @__PURE__ */
|
8340
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8320
8341
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8321
8342
|
}), children);
|
8322
8343
|
};
|
8323
8344
|
Section2.Title = (_a) => {
|
8324
8345
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8325
|
-
return /* @__PURE__ */
|
8346
|
+
return /* @__PURE__ */ React84.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8326
8347
|
color: "black"
|
8327
8348
|
}), children);
|
8328
8349
|
};
|
8329
8350
|
Section2.Subtitle = (_a) => {
|
8330
8351
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8331
|
-
return /* @__PURE__ */
|
8352
|
+
return /* @__PURE__ */ React84.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8332
8353
|
color: "grey-70"
|
8333
8354
|
}), children);
|
8334
8355
|
};
|
8335
8356
|
Section2.Actions = (_a) => {
|
8336
8357
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8337
|
-
return /* @__PURE__ */
|
8358
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8338
8359
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8339
8360
|
}), children);
|
8340
8361
|
};
|
8341
8362
|
Section2.Body = (_a) => {
|
8342
8363
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8343
|
-
return /* @__PURE__ */
|
8364
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8344
8365
|
className: classNames(tw("p-6"), className)
|
8345
|
-
}), /* @__PURE__ */
|
8366
|
+
}), /* @__PURE__ */ React84.createElement(Typography, {
|
8346
8367
|
htmlTag: "div",
|
8347
8368
|
color: "grey-70"
|
8348
8369
|
}, children));
|
8349
8370
|
};
|
8350
8371
|
|
8351
8372
|
// src/components/Section/Section.tsx
|
8352
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8373
|
+
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
8374
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8354
|
-
return /* @__PURE__ */
|
8375
|
+
return /* @__PURE__ */ React85.createElement(SecondaryButton, __spreadValues({
|
8355
8376
|
key: text
|
8356
8377
|
}, action), text);
|
8357
|
-
}))), /* @__PURE__ */
|
8378
|
+
}))), /* @__PURE__ */ React85.createElement(Divider2, null)), /* @__PURE__ */ React85.createElement(Section2.Body, null, children));
|
8358
8379
|
|
8359
8380
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
8360
|
-
import
|
8381
|
+
import React86 from "react";
|
8361
8382
|
var SegmentedControl = (_a) => {
|
8362
8383
|
var _b = _a, {
|
8363
8384
|
children,
|
@@ -8374,7 +8395,7 @@ var SegmentedControl = (_a) => {
|
|
8374
8395
|
"selected",
|
8375
8396
|
"className"
|
8376
8397
|
]);
|
8377
|
-
return /* @__PURE__ */
|
8398
|
+
return /* @__PURE__ */ React86.createElement("button", __spreadProps(__spreadValues({
|
8378
8399
|
type: "button"
|
8379
8400
|
}, rest), {
|
8380
8401
|
className: classNames(
|
@@ -8405,11 +8426,11 @@ var SegmentedControlGroup = (_a) => {
|
|
8405
8426
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8406
8427
|
"bg-grey-0": variant === "raised"
|
8407
8428
|
});
|
8408
|
-
return /* @__PURE__ */
|
8429
|
+
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8409
8430
|
className: classNames(classes2, className)
|
8410
|
-
}),
|
8431
|
+
}), React86.Children.map(
|
8411
8432
|
children,
|
8412
|
-
(child) =>
|
8433
|
+
(child) => React86.cloneElement(child, {
|
8413
8434
|
dense,
|
8414
8435
|
variant,
|
8415
8436
|
onClick: () => onChange(child.props.value),
|
@@ -8447,14 +8468,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8447
8468
|
);
|
8448
8469
|
|
8449
8470
|
// src/components/Stepper/Stepper.tsx
|
8450
|
-
import
|
8471
|
+
import React88 from "react";
|
8451
8472
|
|
8452
8473
|
// src/common/Stepper/Stepper.tsx
|
8453
|
-
import
|
8474
|
+
import React87 from "react";
|
8454
8475
|
var import_tick5 = __toESM(require_tick());
|
8455
8476
|
var Stepper = (_a) => {
|
8456
8477
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8457
|
-
return /* @__PURE__ */
|
8478
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8458
8479
|
className: classNames(className)
|
8459
8480
|
}));
|
8460
8481
|
};
|
@@ -8468,7 +8489,7 @@ var ConnectorContainer = (_a) => {
|
|
8468
8489
|
"completed",
|
8469
8490
|
"dense"
|
8470
8491
|
]);
|
8471
|
-
return /* @__PURE__ */
|
8492
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8472
8493
|
className: classNames(
|
8473
8494
|
tw("absolute w-full -left-1/2", {
|
8474
8495
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -8480,7 +8501,7 @@ var ConnectorContainer = (_a) => {
|
|
8480
8501
|
};
|
8481
8502
|
var Connector = (_a) => {
|
8482
8503
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8483
|
-
return /* @__PURE__ */
|
8504
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8484
8505
|
className: classNames(
|
8485
8506
|
tw("w-full", {
|
8486
8507
|
"bg-grey-20": !completed,
|
@@ -8494,7 +8515,7 @@ var Connector = (_a) => {
|
|
8494
8515
|
};
|
8495
8516
|
var Step = (_a) => {
|
8496
8517
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8497
|
-
return /* @__PURE__ */
|
8518
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8498
8519
|
className: classNames(
|
8499
8520
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8500
8521
|
"text-grey-20": state === "inactive"
|
@@ -8515,13 +8536,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
8515
8536
|
});
|
8516
8537
|
var Indicator = (_a) => {
|
8517
8538
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8518
|
-
return /* @__PURE__ */
|
8539
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8519
8540
|
className: classNames(
|
8520
8541
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8521
8542
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
8522
8543
|
className
|
8523
8544
|
)
|
8524
|
-
}), state === "completed" ? /* @__PURE__ */
|
8545
|
+
}), state === "completed" ? /* @__PURE__ */ React87.createElement(InlineIcon, {
|
8525
8546
|
icon: import_tick5.default
|
8526
8547
|
}) : dense ? null : children);
|
8527
8548
|
};
|
@@ -8532,25 +8553,25 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
8532
8553
|
|
8533
8554
|
// src/components/Stepper/Stepper.tsx
|
8534
8555
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8535
|
-
const steps =
|
8536
|
-
return /* @__PURE__ */
|
8556
|
+
const steps = React88.Children.count(children);
|
8557
|
+
return /* @__PURE__ */ React88.createElement(Stepper, {
|
8537
8558
|
role: "list"
|
8538
|
-
}, /* @__PURE__ */
|
8559
|
+
}, /* @__PURE__ */ React88.createElement(Template, {
|
8539
8560
|
columns: steps
|
8540
|
-
},
|
8561
|
+
}, React88.Children.map(children, (child, index) => {
|
8541
8562
|
if (!isComponentType(child, Step2)) {
|
8542
8563
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8543
8564
|
} else {
|
8544
8565
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8545
|
-
return /* @__PURE__ */
|
8566
|
+
return /* @__PURE__ */ React88.createElement(Stepper.Step, {
|
8546
8567
|
state,
|
8547
8568
|
"aria-current": state === "active" ? "step" : false,
|
8548
8569
|
role: "listitem"
|
8549
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
8570
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React88.createElement(Stepper.ConnectorContainer, {
|
8550
8571
|
dense
|
8551
|
-
}, /* @__PURE__ */
|
8572
|
+
}, /* @__PURE__ */ React88.createElement(Stepper.ConnectorContainer.Connector, {
|
8552
8573
|
completed: state === "completed" || state === "active"
|
8553
|
-
})), /* @__PURE__ */
|
8574
|
+
})), /* @__PURE__ */ React88.createElement(Stepper.Step.Indicator, {
|
8554
8575
|
state,
|
8555
8576
|
dense
|
8556
8577
|
}, index + 1), child.props.children);
|
@@ -8562,16 +8583,16 @@ Step2.displayName = "Stepper.Step";
|
|
8562
8583
|
Stepper2.Step = Step2;
|
8563
8584
|
|
8564
8585
|
// src/components/Switch/Switch.tsx
|
8565
|
-
import
|
8586
|
+
import React90 from "react";
|
8566
8587
|
|
8567
8588
|
// src/common/Switch/Switch.tsx
|
8568
|
-
import
|
8569
|
-
var Switch =
|
8589
|
+
import React89 from "react";
|
8590
|
+
var Switch = React89.forwardRef(
|
8570
8591
|
(_a, ref) => {
|
8571
8592
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8572
|
-
return /* @__PURE__ */
|
8593
|
+
return /* @__PURE__ */ React89.createElement("span", {
|
8573
8594
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8574
|
-
}, /* @__PURE__ */
|
8595
|
+
}, /* @__PURE__ */ React89.createElement("input", __spreadProps(__spreadValues({
|
8575
8596
|
id,
|
8576
8597
|
ref,
|
8577
8598
|
type: "checkbox",
|
@@ -8590,7 +8611,7 @@ var Switch = React88.forwardRef(
|
|
8590
8611
|
),
|
8591
8612
|
readOnly,
|
8592
8613
|
disabled
|
8593
|
-
})), /* @__PURE__ */
|
8614
|
+
})), /* @__PURE__ */ React89.createElement("span", {
|
8594
8615
|
className: tw(
|
8595
8616
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8596
8617
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8603,12 +8624,12 @@ var Switch = React88.forwardRef(
|
|
8603
8624
|
);
|
8604
8625
|
|
8605
8626
|
// src/components/Switch/Switch.tsx
|
8606
|
-
var Switch2 =
|
8627
|
+
var Switch2 = React90.forwardRef(
|
8607
8628
|
(_a, ref) => {
|
8608
8629
|
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
8630
|
var _a2;
|
8610
8631
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8611
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8632
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React90.createElement(ControlLabel, {
|
8612
8633
|
htmlFor: id,
|
8613
8634
|
label: children,
|
8614
8635
|
"aria-label": ariaLabel,
|
@@ -8616,7 +8637,7 @@ var Switch2 = React89.forwardRef(
|
|
8616
8637
|
readOnly,
|
8617
8638
|
disabled,
|
8618
8639
|
style: { gap: "0 8px" }
|
8619
|
-
}, !readOnly && /* @__PURE__ */
|
8640
|
+
}, !readOnly && /* @__PURE__ */ React90.createElement(Switch, __spreadProps(__spreadValues({
|
8620
8641
|
id,
|
8621
8642
|
ref,
|
8622
8643
|
name
|
@@ -8627,12 +8648,12 @@ var Switch2 = React89.forwardRef(
|
|
8627
8648
|
}
|
8628
8649
|
);
|
8629
8650
|
Switch2.displayName = "Switch";
|
8630
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
8651
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React90.createElement("div", {
|
8631
8652
|
className: tw("flex gap-3")
|
8632
|
-
}, /* @__PURE__ */
|
8653
|
+
}, /* @__PURE__ */ React90.createElement(Skeleton, {
|
8633
8654
|
height: 20,
|
8634
8655
|
width: 35
|
8635
|
-
}), /* @__PURE__ */
|
8656
|
+
}), /* @__PURE__ */ React90.createElement(Skeleton, {
|
8636
8657
|
height: 20,
|
8637
8658
|
width: 150
|
8638
8659
|
}));
|
@@ -8640,7 +8661,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
8640
8661
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
8641
8662
|
|
8642
8663
|
// src/components/SwitchGroup/SwitchGroup.tsx
|
8643
|
-
import
|
8664
|
+
import React91, { useState as useState11 } from "react";
|
8644
8665
|
import uniqueId9 from "lodash/uniqueId";
|
8645
8666
|
var SwitchGroup = (_a) => {
|
8646
8667
|
var _b = _a, {
|
@@ -8672,11 +8693,11 @@ var SwitchGroup = (_a) => {
|
|
8672
8693
|
setSelectedItems(updated);
|
8673
8694
|
onChange == null ? void 0 : onChange(updated);
|
8674
8695
|
};
|
8675
|
-
return /* @__PURE__ */
|
8696
|
+
return /* @__PURE__ */ React91.createElement(LabelControl, __spreadValues(__spreadValues({
|
8676
8697
|
fieldset: true
|
8677
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8698
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React91.createElement(InputGroup, {
|
8678
8699
|
cols
|
8679
|
-
},
|
8700
|
+
}, React91.Children.map(children, (c) => {
|
8680
8701
|
var _a3, _b2, _c, _d;
|
8681
8702
|
if (!isComponentType(c, Switch2)) {
|
8682
8703
|
return null;
|
@@ -8684,7 +8705,7 @@ var SwitchGroup = (_a) => {
|
|
8684
8705
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8685
8706
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8686
8707
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8687
|
-
return
|
8708
|
+
return React91.cloneElement(c, {
|
8688
8709
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8689
8710
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8690
8711
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8694,9 +8715,9 @@ var SwitchGroup = (_a) => {
|
|
8694
8715
|
})));
|
8695
8716
|
};
|
8696
8717
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8697
|
-
return /* @__PURE__ */
|
8718
|
+
return /* @__PURE__ */ React91.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React91.createElement("div", {
|
8698
8719
|
className: tw("flex flex-wrap flex-col gap-2")
|
8699
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8720
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React91.createElement(Switch2.Skeleton, {
|
8700
8721
|
key
|
8701
8722
|
}))));
|
8702
8723
|
};
|
@@ -8704,10 +8725,10 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
8704
8725
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
8705
8726
|
|
8706
8727
|
// src/components/TagLabel/TagLabel.tsx
|
8707
|
-
import
|
8728
|
+
import React92 from "react";
|
8708
8729
|
var TagLabel = (_a) => {
|
8709
8730
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8710
|
-
return /* @__PURE__ */
|
8731
|
+
return /* @__PURE__ */ React92.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8711
8732
|
className: tw("rounded-full text-white bg-primary-70", {
|
8712
8733
|
"py-2 px-4 typography-caption": !dense,
|
8713
8734
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8716,14 +8737,14 @@ var TagLabel = (_a) => {
|
|
8716
8737
|
};
|
8717
8738
|
|
8718
8739
|
// src/components/Textarea/Textarea.tsx
|
8719
|
-
import
|
8740
|
+
import React93, { useRef as useRef13, useState as useState12 } from "react";
|
8720
8741
|
import omit17 from "lodash/omit";
|
8721
8742
|
import toString2 from "lodash/toString";
|
8722
8743
|
import uniqueId10 from "lodash/uniqueId";
|
8723
|
-
var TextareaBase =
|
8744
|
+
var TextareaBase = React93.forwardRef(
|
8724
8745
|
(_a, ref) => {
|
8725
8746
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8726
|
-
return /* @__PURE__ */
|
8747
|
+
return /* @__PURE__ */ React93.createElement("textarea", __spreadProps(__spreadValues({
|
8727
8748
|
ref
|
8728
8749
|
}, props), {
|
8729
8750
|
readOnly,
|
@@ -8731,10 +8752,10 @@ var TextareaBase = React92.forwardRef(
|
|
8731
8752
|
}));
|
8732
8753
|
}
|
8733
8754
|
);
|
8734
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8755
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React93.createElement(Skeleton, {
|
8735
8756
|
height: 58
|
8736
8757
|
});
|
8737
|
-
var Textarea =
|
8758
|
+
var Textarea = React93.forwardRef((props, ref) => {
|
8738
8759
|
var _a, _b, _c;
|
8739
8760
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8740
8761
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
@@ -8742,12 +8763,12 @@ var Textarea = React92.forwardRef((props, ref) => {
|
|
8742
8763
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8743
8764
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8744
8765
|
const baseProps = omit17(props, Object.keys(labelControlProps));
|
8745
|
-
return /* @__PURE__ */
|
8766
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, __spreadValues({
|
8746
8767
|
id: `${id.current}-label`,
|
8747
8768
|
htmlFor: id.current,
|
8748
8769
|
messageId: errorMessageId,
|
8749
8770
|
length: value !== void 0 ? toString2(value).length : void 0
|
8750
|
-
}, labelControlProps), /* @__PURE__ */
|
8771
|
+
}, labelControlProps), /* @__PURE__ */ React93.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8751
8772
|
ref
|
8752
8773
|
}, baseProps), errorProps), {
|
8753
8774
|
id: id.current,
|
@@ -8764,48 +8785,48 @@ var Textarea = React92.forwardRef((props, ref) => {
|
|
8764
8785
|
})));
|
8765
8786
|
});
|
8766
8787
|
Textarea.displayName = "Textarea";
|
8767
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
8788
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement(TextareaBase.Skeleton, null));
|
8768
8789
|
Textarea.Skeleton = TextAreaSkeleton;
|
8769
8790
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
8770
8791
|
|
8771
8792
|
// src/components/Timeline/Timeline.tsx
|
8772
|
-
import
|
8793
|
+
import React95 from "react";
|
8773
8794
|
|
8774
8795
|
// src/common/Timeline/Timeline.tsx
|
8775
|
-
import
|
8796
|
+
import React94 from "react";
|
8776
8797
|
var Timeline = (_a) => {
|
8777
8798
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8778
|
-
return /* @__PURE__ */
|
8799
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8779
8800
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8780
8801
|
}));
|
8781
8802
|
};
|
8782
8803
|
var Content2 = (_a) => {
|
8783
8804
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8784
|
-
return /* @__PURE__ */
|
8805
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8785
8806
|
className: classNames(tw("pb-6"), className)
|
8786
8807
|
}));
|
8787
8808
|
};
|
8788
8809
|
var Separator2 = (_a) => {
|
8789
8810
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8790
|
-
return /* @__PURE__ */
|
8811
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8791
8812
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8792
8813
|
}));
|
8793
8814
|
};
|
8794
8815
|
var LineContainer = (_a) => {
|
8795
8816
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8796
|
-
return /* @__PURE__ */
|
8817
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8797
8818
|
className: classNames(tw("flex justify-center py-1"), className)
|
8798
8819
|
}));
|
8799
8820
|
};
|
8800
8821
|
var Line = (_a) => {
|
8801
8822
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8802
|
-
return /* @__PURE__ */
|
8823
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8803
8824
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8804
8825
|
}));
|
8805
8826
|
};
|
8806
8827
|
var Dot = (_a) => {
|
8807
8828
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8808
|
-
return /* @__PURE__ */
|
8829
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8809
8830
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8810
8831
|
}));
|
8811
8832
|
};
|
@@ -8820,52 +8841,52 @@ var import_error4 = __toESM(require_error());
|
|
8820
8841
|
var import_time = __toESM(require_time());
|
8821
8842
|
var import_warningSign4 = __toESM(require_warningSign());
|
8822
8843
|
var TimelineItem = () => null;
|
8823
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8844
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React95.createElement("div", null, React95.Children.map(children, (item) => {
|
8824
8845
|
if (!isComponentType(item, TimelineItem)) {
|
8825
8846
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8826
8847
|
} else {
|
8827
8848
|
const { props, key } = item;
|
8828
|
-
return /* @__PURE__ */
|
8849
|
+
return /* @__PURE__ */ React95.createElement(Timeline, {
|
8829
8850
|
key: key != null ? key : props.title
|
8830
|
-
}, /* @__PURE__ */
|
8851
|
+
}, /* @__PURE__ */ React95.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React95.createElement(Icon, {
|
8831
8852
|
icon: import_error4.default,
|
8832
8853
|
color: "error-30"
|
8833
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8854
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React95.createElement(Icon, {
|
8834
8855
|
icon: import_warningSign4.default,
|
8835
8856
|
color: "warning-30"
|
8836
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8857
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React95.createElement(Icon, {
|
8837
8858
|
icon: import_time.default,
|
8838
8859
|
color: "info-30"
|
8839
|
-
}) : /* @__PURE__ */
|
8860
|
+
}) : /* @__PURE__ */ React95.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React95.createElement(Typography2.Caption, {
|
8840
8861
|
color: "grey-50"
|
8841
|
-
}, props.title), /* @__PURE__ */
|
8862
|
+
}, 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
8863
|
}
|
8843
8864
|
}));
|
8844
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8865
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React95.createElement(Timeline, null, /* @__PURE__ */ React95.createElement(Timeline.Separator, null, /* @__PURE__ */ React95.createElement(Skeleton, {
|
8845
8866
|
width: 6,
|
8846
8867
|
height: 6,
|
8847
8868
|
rounded: true
|
8848
|
-
})), /* @__PURE__ */
|
8869
|
+
})), /* @__PURE__ */ React95.createElement(Skeleton, {
|
8849
8870
|
height: 12,
|
8850
8871
|
width: 120
|
8851
|
-
}), /* @__PURE__ */
|
8872
|
+
}), /* @__PURE__ */ React95.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React95.createElement(Skeleton, {
|
8852
8873
|
width: 2,
|
8853
8874
|
height: "100%"
|
8854
|
-
})), /* @__PURE__ */
|
8875
|
+
})), /* @__PURE__ */ React95.createElement(Timeline.Content, null, /* @__PURE__ */ React95.createElement(Box, {
|
8855
8876
|
display: "flex",
|
8856
8877
|
flexDirection: "column",
|
8857
8878
|
gap: "3"
|
8858
|
-
}, /* @__PURE__ */
|
8879
|
+
}, /* @__PURE__ */ React95.createElement(Skeleton, {
|
8859
8880
|
height: 32,
|
8860
8881
|
width: "100%"
|
8861
|
-
}), /* @__PURE__ */
|
8882
|
+
}), /* @__PURE__ */ React95.createElement(Skeleton, {
|
8862
8883
|
height: 32,
|
8863
8884
|
width: "73%"
|
8864
|
-
}), /* @__PURE__ */
|
8885
|
+
}), /* @__PURE__ */ React95.createElement(Skeleton, {
|
8865
8886
|
height: 32,
|
8866
8887
|
width: "80%"
|
8867
8888
|
}))));
|
8868
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8889
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React95.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React95.createElement(TimelineItemSkeleton, {
|
8869
8890
|
key
|
8870
8891
|
})));
|
8871
8892
|
Timeline2.Item = TimelineItem;
|
@@ -8873,9 +8894,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
8873
8894
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
8874
8895
|
|
8875
8896
|
// src/utils/table/useTableSelect.ts
|
8876
|
-
import
|
8897
|
+
import React96 from "react";
|
8877
8898
|
var useTableSelect = (data, { key }) => {
|
8878
|
-
const [selected, setSelected] =
|
8899
|
+
const [selected, setSelected] = React96.useState([]);
|
8879
8900
|
const allSelected = selected.length === data.length;
|
8880
8901
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8881
8902
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -8901,6 +8922,7 @@ var useTableSelect = (data, { key }) => {
|
|
8901
8922
|
|
8902
8923
|
// src/components/Pagination/usePagination.tsx
|
8903
8924
|
import { useEffect as useEffect7, useState as useState13 } from "react";
|
8925
|
+
import clamp3 from "lodash/clamp";
|
8904
8926
|
var initialState = {
|
8905
8927
|
currentPage: 1,
|
8906
8928
|
pageSize: 10
|
@@ -8914,11 +8936,12 @@ var usePagination = (items, options) => {
|
|
8914
8936
|
const hasNextPage = currentPage < totalPages;
|
8915
8937
|
const pageIndex = getPageIndex(currentPage, pageSize);
|
8916
8938
|
const onPageSizeChange = (pageSize2) => {
|
8939
|
+
const newTotalPages = items.length > 0 ? Math.ceil(items.length / pageSize2) : 1;
|
8917
8940
|
setPageSize(pageSize2);
|
8918
|
-
setCurrentPage((options == null ? void 0 : options.initialPage) || initialState.currentPage);
|
8941
|
+
setCurrentPage(clamp3((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, newTotalPages));
|
8919
8942
|
};
|
8920
8943
|
useEffect7(() => {
|
8921
|
-
setCurrentPage((options == null ? void 0 : options.initialPage) || initialState.currentPage);
|
8944
|
+
setCurrentPage(clamp3((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, totalPages));
|
8922
8945
|
}, [items.length]);
|
8923
8946
|
return [
|
8924
8947
|
items.slice(pageIndex, Math.min(pageIndex + pageSize, items.length)),
|
@@ -8938,7 +8961,7 @@ var usePagination = (items, options) => {
|
|
8938
8961
|
var SelectItem = Select.Item;
|
8939
8962
|
|
8940
8963
|
// src/utils/positioner.ts
|
8941
|
-
import
|
8964
|
+
import clamp4 from "lodash/clamp";
|
8942
8965
|
var PositionerPlacement = /* @__PURE__ */ ((PositionerPlacement2) => {
|
8943
8966
|
PositionerPlacement2["top"] = "top";
|
8944
8967
|
PositionerPlacement2["left"] = "left";
|
@@ -9041,7 +9064,7 @@ function calcBestPosition(triggerRect, contentRect, placement, padding) {
|
|
9041
9064
|
return _calcBestPosition(triggerRect2, contentRect2, nextPlacementAttempt, padding2);
|
9042
9065
|
} else {
|
9043
9066
|
return {
|
9044
|
-
x:
|
9067
|
+
x: clamp4(position.x + window.scrollX, 0, window.innerWidth),
|
9045
9068
|
y: position.y + window.scrollY
|
9046
9069
|
};
|
9047
9070
|
}
|
@@ -9103,7 +9126,7 @@ export {
|
|
9103
9126
|
InputBase,
|
9104
9127
|
Label,
|
9105
9128
|
LabelControl,
|
9106
|
-
LineClamp,
|
9129
|
+
LineClamp2 as LineClamp,
|
9107
9130
|
Link2 as Link,
|
9108
9131
|
List,
|
9109
9132
|
ListItem,
|