@aivenio/aquarium 6.1.1 → 6.3.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 +2 -1
- package/dist/atoms.cjs +200 -134
- package/dist/atoms.mjs +112 -46
- package/dist/charts.cjs +4 -3
- package/dist/charts.mjs +4 -3
- package/dist/src/atoms/ChoiceChip/ChoiceChip.js +3 -3
- package/dist/src/atoms/CommandPalette/CommandPalette.d.ts +16 -0
- package/dist/src/atoms/CommandPalette/CommandPalette.js +3 -1
- package/dist/src/atoms/DataList/DataList.js +1 -1
- package/dist/src/atoms/Modal/Modal.d.ts +73 -3
- package/dist/src/atoms/Modal/Modal.js +48 -41
- package/dist/src/atoms/Timeline/Timeline.d.ts +3 -2
- package/dist/src/atoms/Timeline/Timeline.js +2 -2
- package/dist/src/molecules/CommandPalette/CommandPalette.d.ts +12 -4
- package/dist/src/molecules/CommandPalette/CommandPalette.js +17 -5
- package/dist/src/molecules/CommandPalette/CommandPaletteProvider.js +86 -22
- package/dist/src/molecules/CommandPalette/findSubCommands.d.ts +13 -0
- package/dist/src/molecules/CommandPalette/findSubCommands.js +65 -0
- package/dist/src/molecules/CommandPalette/types.d.ts +31 -1
- package/dist/src/molecules/CommandPalette/types.js +10 -1
- package/dist/src/molecules/Modal/Modal.js +2 -2
- package/dist/src/molecules/Popover/Popover.d.ts +3 -0
- package/dist/src/molecules/Popover/Popover.js +1 -1
- package/dist/src/molecules/Section/Section.d.ts +9 -0
- package/dist/src/molecules/Section/Section.js +13 -6
- package/dist/src/molecules/SegmentedControl/SegmentedControl.js +3 -3
- package/dist/src/molecules/Table/Table.d.ts +3 -0
- package/dist/src/molecules/Table/Table.js +4 -1
- package/dist/src/molecules/TagLabel/TagLabel.d.ts +1 -1
- package/dist/src/molecules/TagLabel/TagLabel.js +1 -1
- package/dist/src/molecules/Timeline/Timeline.d.ts +3 -2
- package/dist/src/molecules/Timeline/Timeline.js +16 -4
- package/dist/src/molecules/Typography/Typography.d.ts +3 -0
- package/dist/src/molecules/Typography/Typography.js +1 -1
- package/dist/src/tokens/tokens.json +4 -3
- package/dist/src/utils/useScrollFade.d.ts +17 -0
- package/dist/src/utils/useScrollFade.js +44 -0
- package/dist/styles.css +59 -34
- package/dist/system.cjs +950 -730
- package/dist/system.mjs +906 -684
- package/dist/tokens.json +4 -3
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
|
@@ -1652,8 +1652,8 @@ var tokens_default = {
|
|
|
1652
1652
|
medium: "rgba(235,235,235,1)",
|
|
1653
1653
|
intense: "rgba(181,181,183,1)",
|
|
1654
1654
|
primary: {
|
|
1655
|
-
muted: "rgba(
|
|
1656
|
-
default: "rgba(
|
|
1655
|
+
muted: "rgba(217,249,248,1)",
|
|
1656
|
+
default: "rgba(217,249,248,1)",
|
|
1657
1657
|
graphic: "rgba(46,208,205,1)",
|
|
1658
1658
|
intense: "rgba(0,128,124,1)",
|
|
1659
1659
|
inverse: "rgba(0,128,124,1)",
|
|
@@ -1697,7 +1697,7 @@ var tokens_default = {
|
|
|
1697
1697
|
inverse: "rgba(198,42,42,1)"
|
|
1698
1698
|
},
|
|
1699
1699
|
status: {
|
|
1700
|
-
announcement: "rgba(
|
|
1700
|
+
announcement: "rgba(217,249,248,1)",
|
|
1701
1701
|
info: "rgba(233,249,253,1)",
|
|
1702
1702
|
warning: "rgba(255,249,230,1)",
|
|
1703
1703
|
danger: "rgba(255,241,241,1)",
|
|
@@ -1815,6 +1815,7 @@ var tokens_default = {
|
|
|
1815
1815
|
code: {
|
|
1816
1816
|
background: "rgba(250,250,250,1)",
|
|
1817
1817
|
text: "rgba(45,46,48,1)",
|
|
1818
|
+
variable: "rgba(123,45,139,1)",
|
|
1818
1819
|
keyword: "rgba(202, 33, 101, 1)",
|
|
1819
1820
|
string: "rgba(0, 127, 115, 1)",
|
|
1820
1821
|
function: "rgba(9, 128, 193, 1)",
|
|
@@ -5279,7 +5280,7 @@ var choiceChipClasses = tv13({
|
|
|
5279
5280
|
label: "Aquarium-ChoiceChip inline-flex cursor-pointer",
|
|
5280
5281
|
input: "peer appearance-none",
|
|
5281
5282
|
chip: [
|
|
5282
|
-
"inline-flex items-center border rounded-full transition whitespace-nowrap hover:bg-primary-
|
|
5283
|
+
"inline-flex items-center border rounded-full transition whitespace-nowrap hover:bg-primary-active",
|
|
5283
5284
|
"peer-focus-visible:ring-2 peer-focus-visible:ring-info-default peer-focus-visible:ring-offset-1",
|
|
5284
5285
|
"peer-disabled:cursor-not-allowed peer-disabled:text-inactive peer-disabled:bg-muted peer-disabled:hover:bg-muted"
|
|
5285
5286
|
]
|
|
@@ -5291,7 +5292,7 @@ var choiceChipClasses = tv13({
|
|
|
5291
5292
|
},
|
|
5292
5293
|
dense: {
|
|
5293
5294
|
true: { chip: "typography-small py-2 px-3 gap-x-2" },
|
|
5294
|
-
false: { chip: "typography-
|
|
5295
|
+
false: { chip: "typography-default py-3 px-5 gap-x-3" }
|
|
5295
5296
|
}
|
|
5296
5297
|
},
|
|
5297
5298
|
defaultVariants: {
|
|
@@ -5690,13 +5691,13 @@ Combobox.Skeleton = ComboboxSkeleton;
|
|
|
5690
5691
|
Combobox.Skeleton.displayName = "Combobox.Skeleton";
|
|
5691
5692
|
|
|
5692
5693
|
// src/molecules/CommandPalette/CommandPalette.tsx
|
|
5693
|
-
import
|
|
5694
|
+
import React64, { useEffect as useEffect8 } from "react";
|
|
5694
5695
|
import {
|
|
5695
5696
|
Collection as AriaCollection2,
|
|
5696
5697
|
composeRenderProps as composeRenderProps3,
|
|
5697
5698
|
Header as AriaHeader2,
|
|
5698
|
-
MenuItem as
|
|
5699
|
-
MenuSection as
|
|
5699
|
+
MenuItem as AriaMenuItem3,
|
|
5700
|
+
MenuSection as AriaMenuSection3
|
|
5700
5701
|
} from "react-aria-components";
|
|
5701
5702
|
import { useId as useId6 } from "@react-aria/utils";
|
|
5702
5703
|
|
|
@@ -5710,7 +5711,9 @@ var commandPaletteStyles = tv15({
|
|
|
5710
5711
|
searchContainer: "flex items-center gap-x-3 p-5 border-b border-muted",
|
|
5711
5712
|
searchInput: "outline-none grow bg-transparent [&::-webkit-search-cancel-button]:hidden",
|
|
5712
5713
|
itemIcon: "text-muted group-data-[focused]:text-default",
|
|
5713
|
-
emptyState: "p-6 text-center text-muted typography-default"
|
|
5714
|
+
emptyState: "p-6 text-center text-muted typography-default",
|
|
5715
|
+
breadcrumbHeader: "typography-small font-semibold",
|
|
5716
|
+
breadcrumbBackButton: "text-muted"
|
|
5714
5717
|
}
|
|
5715
5718
|
});
|
|
5716
5719
|
var EmptyState = ({ className, children, ...rest }) => {
|
|
@@ -5807,20 +5810,22 @@ var EmptyStateContainer2 = ({ className, children, ...props }) => /* @__PURE__ *
|
|
|
5807
5810
|
DropdownMenu.EmptyStateContainer = EmptyStateContainer2;
|
|
5808
5811
|
|
|
5809
5812
|
// src/molecules/CommandPalette/CommandPaletteProvider.tsx
|
|
5810
|
-
import
|
|
5813
|
+
import React63, {
|
|
5811
5814
|
createContext as createContext3,
|
|
5812
|
-
useCallback,
|
|
5815
|
+
useCallback as useCallback2,
|
|
5813
5816
|
useContext as useContext6,
|
|
5814
|
-
useEffect as
|
|
5817
|
+
useEffect as useEffect7,
|
|
5818
|
+
useMemo as useMemo3,
|
|
5815
5819
|
useReducer as useReducer2,
|
|
5816
|
-
useRef as
|
|
5817
|
-
useState as useState6
|
|
5820
|
+
useRef as useRef8
|
|
5818
5821
|
} from "react";
|
|
5819
5822
|
import {
|
|
5820
5823
|
Autocomplete as AriaAutocomplete,
|
|
5821
5824
|
Dialog as AriaDialog,
|
|
5822
5825
|
Input as AriaInput,
|
|
5823
5826
|
Menu as AriaMenu2,
|
|
5827
|
+
MenuItem as AriaMenuItem2,
|
|
5828
|
+
MenuSection as AriaMenuSection2,
|
|
5824
5829
|
Modal as AriaModal,
|
|
5825
5830
|
ModalOverlay as AriaModalOverlay,
|
|
5826
5831
|
SearchField as AriaSearchField
|
|
@@ -5830,38 +5835,46 @@ import { isCtrlKeyPressed } from "@react-aria/utils";
|
|
|
5830
5835
|
// src/atoms/Modal/Modal.tsx
|
|
5831
5836
|
import React59 from "react";
|
|
5832
5837
|
import { tv as tv17 } from "tailwind-variants";
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
"before:to-transparent",
|
|
5847
|
-
"before:z-10"
|
|
5848
|
-
],
|
|
5849
|
-
after: [
|
|
5850
|
-
'after:content-[""]',
|
|
5851
|
-
"after:pointer-events-none",
|
|
5852
|
-
"after:sticky",
|
|
5853
|
-
"after:bottom-3",
|
|
5854
|
-
"after:left-0",
|
|
5855
|
-
"after:h-5",
|
|
5856
|
-
"after:flex-shrink-0",
|
|
5857
|
-
"after:bg-gradient-to-t",
|
|
5858
|
-
"after:from-overlay",
|
|
5859
|
-
"after:to-transparent",
|
|
5860
|
-
"after:z-10"
|
|
5861
|
-
]
|
|
5838
|
+
|
|
5839
|
+
// src/utils/useScrollFade.ts
|
|
5840
|
+
import { useCallback, useEffect as useEffect6, useRef as useRef7, useState as useState6 } from "react";
|
|
5841
|
+
var useScrollFade = () => {
|
|
5842
|
+
const topSentinelRef = useRef7(null);
|
|
5843
|
+
const bottomSentinelRef = useRef7(null);
|
|
5844
|
+
const observerRef = useRef7(null);
|
|
5845
|
+
const [showTopFade, setShowTopFade] = useState6(false);
|
|
5846
|
+
const [showBottomFade, setShowBottomFade] = useState6(false);
|
|
5847
|
+
const containerRef = useCallback((container2) => {
|
|
5848
|
+
observerRef.current?.disconnect();
|
|
5849
|
+
if (!container2) {
|
|
5850
|
+
return;
|
|
5862
5851
|
}
|
|
5863
|
-
|
|
5864
|
-
|
|
5852
|
+
observerRef.current = new IntersectionObserver(
|
|
5853
|
+
(entries) => {
|
|
5854
|
+
entries.forEach((entry) => {
|
|
5855
|
+
if (entry.target === topSentinelRef.current) {
|
|
5856
|
+
setShowTopFade(!entry.isIntersecting);
|
|
5857
|
+
} else if (entry.target === bottomSentinelRef.current) {
|
|
5858
|
+
setShowBottomFade(!entry.isIntersecting);
|
|
5859
|
+
}
|
|
5860
|
+
});
|
|
5861
|
+
},
|
|
5862
|
+
{ root: container2, threshold: 0 }
|
|
5863
|
+
);
|
|
5864
|
+
if (topSentinelRef.current) {
|
|
5865
|
+
observerRef.current.observe(topSentinelRef.current);
|
|
5866
|
+
}
|
|
5867
|
+
if (bottomSentinelRef.current) {
|
|
5868
|
+
observerRef.current.observe(bottomSentinelRef.current);
|
|
5869
|
+
}
|
|
5870
|
+
}, []);
|
|
5871
|
+
useEffect6(() => {
|
|
5872
|
+
return () => observerRef.current?.disconnect();
|
|
5873
|
+
}, []);
|
|
5874
|
+
return { containerRef, topSentinelRef, bottomSentinelRef, showTopFade, showBottomFade };
|
|
5875
|
+
};
|
|
5876
|
+
|
|
5877
|
+
// src/atoms/Modal/Modal.tsx
|
|
5865
5878
|
var modalStyles = tv17({
|
|
5866
5879
|
slots: {
|
|
5867
5880
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
|
@@ -5873,11 +5886,7 @@ var modalStyles = tv17({
|
|
|
5873
5886
|
title: "",
|
|
5874
5887
|
subtitle: "max-w-[700px]",
|
|
5875
5888
|
closeButtonContainer: "absolute top-[24px] right-[28px]",
|
|
5876
|
-
body:
|
|
5877
|
-
"grow overflow-y-auto text-default flex flex-col outline-none",
|
|
5878
|
-
bodyMaskClasses({ position: "before" }),
|
|
5879
|
-
bodyMaskClasses({ position: "after" })
|
|
5880
|
-
],
|
|
5889
|
+
body: "grow overflow-y-auto text-default flex flex-col outline-none",
|
|
5881
5890
|
bodyContent: "px-7 grow",
|
|
5882
5891
|
footer: "px-7 pt-4 pb-6",
|
|
5883
5892
|
actions: "flex gap-3 justify-end"
|
|
@@ -5921,10 +5930,48 @@ var modalStyles = tv17({
|
|
|
5921
5930
|
false: {
|
|
5922
5931
|
headerImage: "bg-medium"
|
|
5923
5932
|
}
|
|
5933
|
+
},
|
|
5934
|
+
showTopFade: {
|
|
5935
|
+
true: {
|
|
5936
|
+
body: [
|
|
5937
|
+
'before:content-[""]',
|
|
5938
|
+
"before:pointer-events-none",
|
|
5939
|
+
"before:sticky",
|
|
5940
|
+
"before:top-0",
|
|
5941
|
+
"before:left-0",
|
|
5942
|
+
"before:h-5",
|
|
5943
|
+
"before:-mb-5",
|
|
5944
|
+
"before:flex-shrink-0",
|
|
5945
|
+
"before:bg-gradient-to-b",
|
|
5946
|
+
"before:from-overlay",
|
|
5947
|
+
"before:to-transparent",
|
|
5948
|
+
"before:z-10"
|
|
5949
|
+
]
|
|
5950
|
+
}
|
|
5951
|
+
},
|
|
5952
|
+
showBottomFade: {
|
|
5953
|
+
true: {
|
|
5954
|
+
body: [
|
|
5955
|
+
'after:content-[""]',
|
|
5956
|
+
"after:pointer-events-none",
|
|
5957
|
+
"after:sticky",
|
|
5958
|
+
"after:bottom-0",
|
|
5959
|
+
"after:left-0",
|
|
5960
|
+
"after:h-[60px]",
|
|
5961
|
+
"after:-mt-[60px]",
|
|
5962
|
+
"after:flex-shrink-0",
|
|
5963
|
+
"after:bg-gradient-to-t",
|
|
5964
|
+
"after:from-overlay",
|
|
5965
|
+
"after:to-transparent",
|
|
5966
|
+
"after:z-10"
|
|
5967
|
+
]
|
|
5968
|
+
}
|
|
5924
5969
|
}
|
|
5925
5970
|
},
|
|
5926
5971
|
defaultVariants: {
|
|
5927
|
-
isResponsive: true
|
|
5972
|
+
isResponsive: true,
|
|
5973
|
+
showTopFade: false,
|
|
5974
|
+
showBottomFade: false
|
|
5928
5975
|
},
|
|
5929
5976
|
compoundVariants: [
|
|
5930
5977
|
{
|
|
@@ -6034,10 +6081,31 @@ Modal.TitleContainer = ({ children, className, ...rest }) => {
|
|
|
6034
6081
|
const { titleContainer: titleContainer2 } = modalStyles();
|
|
6035
6082
|
return /* @__PURE__ */ React59.createElement("div", { ...rest, className: titleContainer2({ className }) }, children);
|
|
6036
6083
|
};
|
|
6037
|
-
|
|
6084
|
+
var ModalBody = ({
|
|
6085
|
+
children,
|
|
6086
|
+
className,
|
|
6087
|
+
noFooter = false,
|
|
6088
|
+
maxHeight,
|
|
6089
|
+
style,
|
|
6090
|
+
size,
|
|
6091
|
+
...rest
|
|
6092
|
+
}) => {
|
|
6038
6093
|
const { body, bodyContent } = modalStyles({ size });
|
|
6039
|
-
|
|
6094
|
+
const { containerRef, topSentinelRef, bottomSentinelRef, showTopFade, showBottomFade } = useScrollFade();
|
|
6095
|
+
return /* @__PURE__ */ React59.createElement(
|
|
6096
|
+
"div",
|
|
6097
|
+
{
|
|
6098
|
+
...rest,
|
|
6099
|
+
ref: containerRef,
|
|
6100
|
+
className: body({ className, showTopFade, showBottomFade }),
|
|
6101
|
+
style: { maxHeight, ...style }
|
|
6102
|
+
},
|
|
6103
|
+
/* @__PURE__ */ React59.createElement("div", { ref: topSentinelRef, "aria-hidden": "true", className: "h-1px" }),
|
|
6104
|
+
/* @__PURE__ */ React59.createElement("div", { className: bodyContent({ noFooter }) }, children),
|
|
6105
|
+
/* @__PURE__ */ React59.createElement("div", { ref: bottomSentinelRef, "aria-hidden": "true", className: "h-1px -mt-1px" })
|
|
6106
|
+
);
|
|
6040
6107
|
};
|
|
6108
|
+
Modal.Body = ModalBody;
|
|
6041
6109
|
Modal.Footer = ({ children, className, ...rest }) => {
|
|
6042
6110
|
const { footer } = modalStyles();
|
|
6043
6111
|
return /* @__PURE__ */ React59.createElement("div", { ...rest, className: footer({ className }) }, children);
|
|
@@ -6073,18 +6141,74 @@ var SearchIcon = ({ onClick }) => /* @__PURE__ */ React60.createElement(Icon, {
|
|
|
6073
6141
|
var UploadIcon = ({ onClick }) => /* @__PURE__ */ React60.createElement(Icon, { icon: upload_default, color: "primary-intense", "data-testid": "icon-upload", onClick });
|
|
6074
6142
|
var ResetIcon = ({ onClick }) => /* @__PURE__ */ React60.createElement(Icon, { className: "hover:cursor-pointer", icon: cross_default, color: "inactive", "data-testid": "icon-reset", onClick });
|
|
6075
6143
|
|
|
6076
|
-
// src/molecules/CommandPalette/
|
|
6144
|
+
// src/molecules/CommandPalette/findSubCommands.ts
|
|
6077
6145
|
import React61 from "react";
|
|
6146
|
+
var isCommand = (el) => typeof el.type !== "string" && el.type.displayName === "CommandPalette.Command";
|
|
6147
|
+
var findCommandById = (node, id) => {
|
|
6148
|
+
for (const child of React61.Children.toArray(node)) {
|
|
6149
|
+
if (!React61.isValidElement(child)) {
|
|
6150
|
+
continue;
|
|
6151
|
+
}
|
|
6152
|
+
if (isCommand(child) && child.props.id === id) {
|
|
6153
|
+
return child;
|
|
6154
|
+
}
|
|
6155
|
+
const nested = findCommandById(child.props.children, id);
|
|
6156
|
+
if (nested !== null) {
|
|
6157
|
+
return nested;
|
|
6158
|
+
}
|
|
6159
|
+
}
|
|
6160
|
+
return null;
|
|
6161
|
+
};
|
|
6162
|
+
var findSubCommands = (registrations, parentId) => {
|
|
6163
|
+
const match = findCommandInRegistrations(registrations, parentId);
|
|
6164
|
+
if (match === null) {
|
|
6165
|
+
return null;
|
|
6166
|
+
}
|
|
6167
|
+
return match.props.children ?? null;
|
|
6168
|
+
};
|
|
6169
|
+
var findCommandInRegistrations = (registrations, id) => {
|
|
6170
|
+
for (const reg of registrations) {
|
|
6171
|
+
const match = findCommandById(reg.children, id);
|
|
6172
|
+
if (match !== null) {
|
|
6173
|
+
return match;
|
|
6174
|
+
}
|
|
6175
|
+
}
|
|
6176
|
+
return null;
|
|
6177
|
+
};
|
|
6178
|
+
var containsCommand = (children) => findFirstCommand(children) !== null;
|
|
6179
|
+
var findFirstCommand = (node) => {
|
|
6180
|
+
for (const child of React61.Children.toArray(node)) {
|
|
6181
|
+
if (!React61.isValidElement(child)) {
|
|
6182
|
+
continue;
|
|
6183
|
+
}
|
|
6184
|
+
if (isCommand(child)) {
|
|
6185
|
+
return child;
|
|
6186
|
+
}
|
|
6187
|
+
const nested = findFirstCommand(child.props.children);
|
|
6188
|
+
if (nested !== null) {
|
|
6189
|
+
return nested;
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
return null;
|
|
6193
|
+
};
|
|
6194
|
+
|
|
6195
|
+
// src/molecules/CommandPalette/rankCommands.ts
|
|
6196
|
+
import React62 from "react";
|
|
6078
6197
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
|
6079
6198
|
|
|
6080
6199
|
// src/molecules/CommandPalette/types.ts
|
|
6081
6200
|
var STATIC_ITEM_MARKER = "\u200B";
|
|
6082
6201
|
var FIELD_SEPARATOR = "";
|
|
6202
|
+
var ROOT_LEVEL = {
|
|
6203
|
+
parentId: null,
|
|
6204
|
+
parentLabel: null,
|
|
6205
|
+
query: ""
|
|
6206
|
+
};
|
|
6083
6207
|
|
|
6084
6208
|
// src/molecules/CommandPalette/rankCommands.ts
|
|
6085
|
-
var isCommandElement = (node, CommandType) =>
|
|
6209
|
+
var isCommandElement = (node, CommandType) => React62.isValidElement(node) && node.type === CommandType;
|
|
6086
6210
|
var rankChildren = (children, query, CommandType) => {
|
|
6087
|
-
const flat =
|
|
6211
|
+
const flat = React62.Children.toArray(children);
|
|
6088
6212
|
if (!query) {
|
|
6089
6213
|
return flat;
|
|
6090
6214
|
}
|
|
@@ -6138,7 +6262,34 @@ var reducer2 = (state, action) => {
|
|
|
6138
6262
|
case 3 /* Open */:
|
|
6139
6263
|
return { ...state, isOpen: true };
|
|
6140
6264
|
case 4 /* Close */:
|
|
6141
|
-
return { ...state, isOpen: false };
|
|
6265
|
+
return { ...state, isOpen: false, levelStack: [ROOT_LEVEL] };
|
|
6266
|
+
case 5 /* PushLevel */:
|
|
6267
|
+
return {
|
|
6268
|
+
...state,
|
|
6269
|
+
levelStack: [
|
|
6270
|
+
...state.levelStack,
|
|
6271
|
+
{
|
|
6272
|
+
parentId: action.parentId,
|
|
6273
|
+
parentLabel: action.parentLabel,
|
|
6274
|
+
placeholder: action.placeholder,
|
|
6275
|
+
query: ""
|
|
6276
|
+
}
|
|
6277
|
+
]
|
|
6278
|
+
};
|
|
6279
|
+
case 6 /* PopLevel */:
|
|
6280
|
+
return state.levelStack.length > 1 ? { ...state, levelStack: state.levelStack.slice(0, -1) } : state;
|
|
6281
|
+
case 7 /* PopToIndex */:
|
|
6282
|
+
if (action.index < 0 || action.index >= state.levelStack.length - 1) {
|
|
6283
|
+
return state;
|
|
6284
|
+
}
|
|
6285
|
+
return { ...state, levelStack: state.levelStack.slice(0, action.index + 1) };
|
|
6286
|
+
case 8 /* SetQuery */: {
|
|
6287
|
+
const top = state.levelStack.length - 1;
|
|
6288
|
+
return {
|
|
6289
|
+
...state,
|
|
6290
|
+
levelStack: state.levelStack.map((lvl, i) => i === top ? { ...lvl, query: action.query } : lvl)
|
|
6291
|
+
};
|
|
6292
|
+
}
|
|
6142
6293
|
default:
|
|
6143
6294
|
throw new Error("Unsupported action type.");
|
|
6144
6295
|
}
|
|
@@ -6153,9 +6304,9 @@ var useCommandPaletteRootContext = () => {
|
|
|
6153
6304
|
};
|
|
6154
6305
|
var useCommandPalette = () => {
|
|
6155
6306
|
const [state, dispatch] = useCommandPaletteRootContext();
|
|
6156
|
-
const open =
|
|
6157
|
-
const close =
|
|
6158
|
-
const toggle =
|
|
6307
|
+
const open = useCallback2(() => dispatch({ type: 3 /* Open */ }), [dispatch]);
|
|
6308
|
+
const close = useCallback2(() => dispatch({ type: 4 /* Close */ }), [dispatch]);
|
|
6309
|
+
const toggle = useCallback2(
|
|
6159
6310
|
() => dispatch(state.isOpen ? { type: 4 /* Close */ } : { type: 3 /* Open */ }),
|
|
6160
6311
|
[dispatch, state.isOpen]
|
|
6161
6312
|
);
|
|
@@ -6174,8 +6325,8 @@ var CommandPaletteProvider = ({
|
|
|
6174
6325
|
onOpenChange,
|
|
6175
6326
|
onInputChange
|
|
6176
6327
|
}) => {
|
|
6177
|
-
const [state, dispatch] = useReducer2(reducer2, { registrations: [], isOpen: false });
|
|
6178
|
-
const guardedDispatch =
|
|
6328
|
+
const [state, dispatch] = useReducer2(reducer2, { registrations: [], isOpen: false, levelStack: [ROOT_LEVEL] });
|
|
6329
|
+
const guardedDispatch = useCallback2(
|
|
6179
6330
|
(action) => {
|
|
6180
6331
|
if (isDisabled && action.type === 3 /* Open */) {
|
|
6181
6332
|
return;
|
|
@@ -6184,12 +6335,12 @@ var CommandPaletteProvider = ({
|
|
|
6184
6335
|
},
|
|
6185
6336
|
[isDisabled]
|
|
6186
6337
|
);
|
|
6187
|
-
|
|
6338
|
+
useEffect7(() => {
|
|
6188
6339
|
if (isDisabled && state.isOpen) {
|
|
6189
6340
|
dispatch({ type: 4 /* Close */ });
|
|
6190
6341
|
}
|
|
6191
6342
|
}, [isDisabled, state.isOpen]);
|
|
6192
|
-
|
|
6343
|
+
useEffect7(() => {
|
|
6193
6344
|
if (shortcut === null || isDisabled) {
|
|
6194
6345
|
return;
|
|
6195
6346
|
}
|
|
@@ -6202,15 +6353,15 @@ var CommandPaletteProvider = ({
|
|
|
6202
6353
|
document.addEventListener("keydown", handleKeyDown);
|
|
6203
6354
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
6204
6355
|
}, [shortcut, state.isOpen, isDisabled]);
|
|
6205
|
-
const isInitialMount =
|
|
6206
|
-
|
|
6356
|
+
const isInitialMount = useRef8(true);
|
|
6357
|
+
useEffect7(() => {
|
|
6207
6358
|
if (isInitialMount.current) {
|
|
6208
6359
|
isInitialMount.current = false;
|
|
6209
6360
|
return;
|
|
6210
6361
|
}
|
|
6211
6362
|
onOpenChange?.(state.isOpen);
|
|
6212
6363
|
}, [state.isOpen]);
|
|
6213
|
-
return /* @__PURE__ */
|
|
6364
|
+
return /* @__PURE__ */ React63.createElement(CommandPaletteContext.Provider, { value: [state, guardedDispatch] }, children, !isDisabled && /* @__PURE__ */ React63.createElement(
|
|
6214
6365
|
CommandPaletteOverlay,
|
|
6215
6366
|
{
|
|
6216
6367
|
marginTop,
|
|
@@ -6220,6 +6371,23 @@ var CommandPaletteProvider = ({
|
|
|
6220
6371
|
}
|
|
6221
6372
|
));
|
|
6222
6373
|
};
|
|
6374
|
+
var BackMenuItem = ({ label, onBack }) => {
|
|
6375
|
+
const styles = commandPaletteStyles();
|
|
6376
|
+
return /* @__PURE__ */ React63.createElement(
|
|
6377
|
+
AriaMenuItem2,
|
|
6378
|
+
{
|
|
6379
|
+
id: "__command-palette-back",
|
|
6380
|
+
textValue: `${STATIC_ITEM_MARKER}Back`,
|
|
6381
|
+
className: (values) => dropdownMenuItemStyles({
|
|
6382
|
+
...values,
|
|
6383
|
+
className: styles.breadcrumbHeader()
|
|
6384
|
+
}),
|
|
6385
|
+
onAction: onBack
|
|
6386
|
+
},
|
|
6387
|
+
/* @__PURE__ */ React63.createElement(InlineIcon, { icon: chevronLeft_default, className: styles.breadcrumbBackButton() }),
|
|
6388
|
+
/* @__PURE__ */ React63.createElement("span", null, label)
|
|
6389
|
+
);
|
|
6390
|
+
};
|
|
6223
6391
|
var CommandPaletteOverlay = ({
|
|
6224
6392
|
marginTop,
|
|
6225
6393
|
placeholder,
|
|
@@ -6227,28 +6395,49 @@ var CommandPaletteOverlay = ({
|
|
|
6227
6395
|
onInputChange
|
|
6228
6396
|
}) => {
|
|
6229
6397
|
const [state, dispatch] = useCommandPaletteRootContext();
|
|
6230
|
-
const [query, setQuery] = useState6("");
|
|
6231
6398
|
const styles = commandPaletteStyles();
|
|
6232
6399
|
const { overlay, dialog } = modalStyles({ kind: "dialog" });
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6400
|
+
const depth = state.levelStack.length - 1;
|
|
6401
|
+
const currentLevel = state.levelStack[depth];
|
|
6402
|
+
const levelPlaceholder = currentLevel.placeholder ?? placeholder;
|
|
6403
|
+
const menuChildren = useMemo3(() => {
|
|
6404
|
+
if (currentLevel.parentId === null) {
|
|
6405
|
+
return state.registrations.map((registration) => /* @__PURE__ */ React63.createElement(React63.Fragment, { key: registration.id }, registration.children));
|
|
6406
|
+
}
|
|
6407
|
+
return findSubCommands(state.registrations, currentLevel.parentId);
|
|
6408
|
+
}, [state.registrations, currentLevel.parentId]);
|
|
6238
6409
|
const handleOpenChange = (isOpen) => {
|
|
6410
|
+
if (!isOpen && depth > 0) {
|
|
6411
|
+
dispatch({ type: 6 /* PopLevel */ });
|
|
6412
|
+
return;
|
|
6413
|
+
}
|
|
6239
6414
|
dispatch(isOpen ? { type: 3 /* Open */ } : { type: 4 /* Close */ });
|
|
6240
6415
|
};
|
|
6241
|
-
const
|
|
6416
|
+
const handleMenuAction = (key) => {
|
|
6417
|
+
if (key === "__command-palette-back") {
|
|
6418
|
+
return;
|
|
6419
|
+
}
|
|
6420
|
+
const element = findCommandInRegistrations(state.registrations, String(key));
|
|
6421
|
+
if (element !== null && containsCommand(element.props.children)) {
|
|
6422
|
+
const props = element.props;
|
|
6423
|
+
dispatch({
|
|
6424
|
+
type: 5 /* PushLevel */,
|
|
6425
|
+
parentId: String(key),
|
|
6426
|
+
parentLabel: props.label,
|
|
6427
|
+
placeholder: props.subPlaceholder
|
|
6428
|
+
});
|
|
6429
|
+
return;
|
|
6430
|
+
}
|
|
6242
6431
|
dispatch({ type: 4 /* Close */ });
|
|
6243
6432
|
};
|
|
6244
6433
|
const handleSearchChange = (value) => {
|
|
6245
|
-
|
|
6434
|
+
dispatch({ type: 8 /* SetQuery */, query: value });
|
|
6246
6435
|
onInputChange?.(value);
|
|
6247
6436
|
};
|
|
6248
6437
|
if (!state.isOpen) {
|
|
6249
6438
|
return null;
|
|
6250
6439
|
}
|
|
6251
|
-
return /* @__PURE__ */
|
|
6440
|
+
return /* @__PURE__ */ React63.createElement(CommandPaletteQueryContext.Provider, { value: currentLevel.query }, /* @__PURE__ */ React63.createElement(
|
|
6252
6441
|
AriaModalOverlay,
|
|
6253
6442
|
{
|
|
6254
6443
|
isOpen: state.isOpen,
|
|
@@ -6256,28 +6445,35 @@ var CommandPaletteOverlay = ({
|
|
|
6256
6445
|
isDismissable: true,
|
|
6257
6446
|
className: overlay({ className: "Aquarium-CommandPalette items-start" })
|
|
6258
6447
|
},
|
|
6259
|
-
/* @__PURE__ */
|
|
6260
|
-
/* @__PURE__ */
|
|
6261
|
-
|
|
6262
|
-
{
|
|
6263
|
-
autoFocus: true,
|
|
6264
|
-
"aria-label": "Search commands",
|
|
6265
|
-
className: styles.searchContainer(),
|
|
6266
|
-
onChange: handleSearchChange
|
|
6267
|
-
},
|
|
6268
|
-
/* @__PURE__ */ React62.createElement(SearchIcon, { "aria-hidden": true }),
|
|
6269
|
-
/* @__PURE__ */ React62.createElement(AriaInput, { placeholder, className: styles.searchInput() })
|
|
6270
|
-
), /* @__PURE__ */ React62.createElement(
|
|
6271
|
-
AriaMenu2,
|
|
6448
|
+
/* @__PURE__ */ React63.createElement(Modal.BackDrop, null),
|
|
6449
|
+
/* @__PURE__ */ React63.createElement(AriaModal, { className: styles.modal(), style: marginTop ? { marginTop } : void 0 }, /* @__PURE__ */ React63.createElement(AriaDialog, { "aria-label": "Command palette", className: dialog({ className: styles.dialog() }) }, /* @__PURE__ */ React63.createElement(
|
|
6450
|
+
AriaAutocomplete,
|
|
6272
6451
|
{
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
renderEmptyState: () => /* @__PURE__ */ React62.createElement(CommandPalette.EmptyState, null, emptyState)
|
|
6452
|
+
key: depth,
|
|
6453
|
+
filter: autocompleteFilter,
|
|
6454
|
+
defaultInputValue: currentLevel.query,
|
|
6455
|
+
onInputChange: handleSearchChange
|
|
6278
6456
|
},
|
|
6279
|
-
|
|
6280
|
-
|
|
6457
|
+
/* @__PURE__ */ React63.createElement(AriaSearchField, { autoFocus: true, "aria-label": "Search commands", className: styles.searchContainer() }, /* @__PURE__ */ React63.createElement(SearchIcon, { "aria-hidden": true }), /* @__PURE__ */ React63.createElement(AriaInput, { placeholder: levelPlaceholder, className: styles.searchInput() })),
|
|
6458
|
+
/* @__PURE__ */ React63.createElement(
|
|
6459
|
+
AriaMenu2,
|
|
6460
|
+
{
|
|
6461
|
+
onAction: handleMenuAction,
|
|
6462
|
+
className: dropdownMenuStyles({
|
|
6463
|
+
className: "Aquarium-CommandPalette.List flex-1 min-h-0 p-3 overflow-y-auto"
|
|
6464
|
+
}),
|
|
6465
|
+
renderEmptyState: () => /* @__PURE__ */ React63.createElement(CommandPalette.EmptyState, null, emptyState)
|
|
6466
|
+
},
|
|
6467
|
+
depth > 0 && currentLevel.parentLabel && /* @__PURE__ */ React63.createElement(AriaMenuSection2, null, /* @__PURE__ */ React63.createElement(
|
|
6468
|
+
BackMenuItem,
|
|
6469
|
+
{
|
|
6470
|
+
label: currentLevel.parentLabel,
|
|
6471
|
+
onBack: () => dispatch({ type: 6 /* PopLevel */ })
|
|
6472
|
+
}
|
|
6473
|
+
)),
|
|
6474
|
+
menuChildren
|
|
6475
|
+
)
|
|
6476
|
+
)))
|
|
6281
6477
|
));
|
|
6282
6478
|
};
|
|
6283
6479
|
|
|
@@ -6285,13 +6481,13 @@ var CommandPaletteOverlay = ({
|
|
|
6285
6481
|
var Commands = ({ children }) => {
|
|
6286
6482
|
const id = useId6();
|
|
6287
6483
|
const [, dispatch] = useCommandPaletteRootContext();
|
|
6288
|
-
|
|
6484
|
+
useEffect8(() => {
|
|
6289
6485
|
dispatch({ type: 0 /* Register */, registration: { id, children } });
|
|
6290
6486
|
return () => {
|
|
6291
6487
|
dispatch({ type: 1 /* Unregister */, id });
|
|
6292
6488
|
};
|
|
6293
6489
|
}, []);
|
|
6294
|
-
|
|
6490
|
+
useEffect8(() => {
|
|
6295
6491
|
dispatch({ type: 2 /* Update */, registration: { id, children } });
|
|
6296
6492
|
}, [dispatch, id, children]);
|
|
6297
6493
|
return null;
|
|
@@ -6300,35 +6496,47 @@ Commands.displayName = "CommandPalette.Commands";
|
|
|
6300
6496
|
var Section = ({ title, items, children, ...props }) => {
|
|
6301
6497
|
const groupStyles = dropdownMenuGroupStyles();
|
|
6302
6498
|
const query = useCommandPaletteQuery();
|
|
6303
|
-
const renderShell = (content) => /* @__PURE__ */
|
|
6499
|
+
const renderShell = (content) => /* @__PURE__ */ React64.createElement(AriaMenuSection3, { className: groupStyles.base({ className: "Aquarium-CommandPalette.Section" }), ...props }, title && /* @__PURE__ */ React64.createElement(AriaHeader2, { className: groupStyles.title() }, title), content);
|
|
6304
6500
|
if (items || typeof children === "function") {
|
|
6305
6501
|
return renderShell(
|
|
6306
|
-
items ? /* @__PURE__ */
|
|
6502
|
+
items ? /* @__PURE__ */ React64.createElement(AriaCollection2, { items }, children) : /* @__PURE__ */ React64.createElement(AriaCollection2, null, children)
|
|
6307
6503
|
);
|
|
6308
6504
|
}
|
|
6309
6505
|
if (!query) {
|
|
6310
|
-
return renderShell(/* @__PURE__ */
|
|
6506
|
+
return renderShell(/* @__PURE__ */ React64.createElement(AriaCollection2, null, children));
|
|
6311
6507
|
}
|
|
6312
6508
|
const ranked = rankChildren(children, query, Command);
|
|
6313
6509
|
if (ranked.length === 0) {
|
|
6314
6510
|
return null;
|
|
6315
6511
|
}
|
|
6316
|
-
return renderShell(/* @__PURE__ */
|
|
6512
|
+
return renderShell(/* @__PURE__ */ React64.createElement(AriaCollection2, null, ranked));
|
|
6317
6513
|
};
|
|
6318
6514
|
Section.displayName = "CommandPalette.Section";
|
|
6319
|
-
var Command = ({
|
|
6515
|
+
var Command = ({
|
|
6516
|
+
className,
|
|
6517
|
+
icon,
|
|
6518
|
+
label,
|
|
6519
|
+
keywords,
|
|
6520
|
+
disabled,
|
|
6521
|
+
static: isStatic,
|
|
6522
|
+
subPlaceholder: _subPlaceholder,
|
|
6523
|
+
...props
|
|
6524
|
+
}) => {
|
|
6320
6525
|
const styles = commandPaletteStyles();
|
|
6321
|
-
const
|
|
6526
|
+
const isParent = typeof props.children !== "function" && containsCommand(props.children);
|
|
6527
|
+
const textValue = props.textValue || label;
|
|
6322
6528
|
const resolvedTextValue = [textValue, ...keywords ?? []].filter(Boolean).join(FIELD_SEPARATOR);
|
|
6323
|
-
|
|
6324
|
-
|
|
6529
|
+
const { children: _children, onAction: consumerOnAction, ...restProps } = props;
|
|
6530
|
+
const ariaProps = isParent ? restProps : { ...restProps, onAction: consumerOnAction };
|
|
6531
|
+
return /* @__PURE__ */ React64.createElement(
|
|
6532
|
+
AriaMenuItem3,
|
|
6325
6533
|
{
|
|
6326
6534
|
className: (values) => dropdownMenuItemStyles({ ...values, className: ["Aquarium-CommandPalette.Item", className] }),
|
|
6327
6535
|
textValue: isStatic ? `${STATIC_ITEM_MARKER}${resolvedTextValue}` : resolvedTextValue,
|
|
6328
6536
|
isDisabled: disabled,
|
|
6329
|
-
...
|
|
6537
|
+
...ariaProps
|
|
6330
6538
|
},
|
|
6331
|
-
composeRenderProps3(props.children, (children) => /* @__PURE__ */
|
|
6539
|
+
composeRenderProps3(isParent ? void 0 : props.children, (children) => /* @__PURE__ */ React64.createElement(React64.Fragment, null, icon && /* @__PURE__ */ React64.createElement(InlineIcon, { icon, className: styles.itemIcon() }), /* @__PURE__ */ React64.createElement("span", { className: "grow" }, label || children), isParent && /* @__PURE__ */ React64.createElement(InlineIcon, { icon: chevronRight_default, className: styles.itemIcon() })))
|
|
6332
6540
|
);
|
|
6333
6541
|
};
|
|
6334
6542
|
Command.displayName = "CommandPalette.Command";
|
|
@@ -6340,9 +6548,9 @@ var CommandPalette2 = {
|
|
|
6340
6548
|
};
|
|
6341
6549
|
|
|
6342
6550
|
// src/molecules/Container/Container.tsx
|
|
6343
|
-
import
|
|
6551
|
+
import React65 from "react";
|
|
6344
6552
|
import { clsx as clsx20 } from "clsx";
|
|
6345
|
-
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */
|
|
6553
|
+
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React65.createElement(
|
|
6346
6554
|
Box,
|
|
6347
6555
|
{
|
|
6348
6556
|
marginLeft: "auto",
|
|
@@ -6361,23 +6569,23 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React64.crea
|
|
|
6361
6569
|
);
|
|
6362
6570
|
|
|
6363
6571
|
// src/molecules/DataList/DataList.tsx
|
|
6364
|
-
import
|
|
6572
|
+
import React83, { useRef as useRef11 } from "react";
|
|
6365
6573
|
import { useControlledState as useControlledState3 } from "@react-stately/utils";
|
|
6366
6574
|
import { clsx as clsx26 } from "clsx";
|
|
6367
6575
|
import { castArray as castArray3, compact, groupBy as groupBy2, isArray as isArray2, isFunction as isFunction3, noop as noop2 } from "lodash-es";
|
|
6368
6576
|
|
|
6369
6577
|
// src/molecules/List/List.tsx
|
|
6370
|
-
import
|
|
6578
|
+
import React70 from "react";
|
|
6371
6579
|
import { clsx as clsx23 } from "clsx";
|
|
6372
6580
|
import { isObject, isString as isString2 } from "lodash-es";
|
|
6373
6581
|
|
|
6374
6582
|
// src/molecules/Pagination/Pagination.tsx
|
|
6375
|
-
import
|
|
6583
|
+
import React68 from "react";
|
|
6376
6584
|
import { clsx as clsx22 } from "clsx";
|
|
6377
6585
|
import { clamp } from "lodash-es";
|
|
6378
6586
|
|
|
6379
6587
|
// src/molecules/Input/Input.tsx
|
|
6380
|
-
import
|
|
6588
|
+
import React66, { forwardRef, useCallback as useCallback3, useImperativeHandle, useState as useState7 } from "react";
|
|
6381
6589
|
import { useId as useId7 } from "@react-aria/utils";
|
|
6382
6590
|
import { clsx as clsx21 } from "clsx";
|
|
6383
6591
|
import { omit as omit5, toString } from "lodash-es";
|
|
@@ -6394,7 +6602,7 @@ var createInput = (displayName, opts = {}) => {
|
|
|
6394
6602
|
...props
|
|
6395
6603
|
}, ref) => {
|
|
6396
6604
|
const inputType = opts.isSearch ? "search" : opts.isFile ? "file" : type;
|
|
6397
|
-
const inputRef =
|
|
6605
|
+
const inputRef = React66.useRef(null);
|
|
6398
6606
|
useImperativeHandle(ref, () => inputRef.current);
|
|
6399
6607
|
const handleReset = (e) => {
|
|
6400
6608
|
if (opts.isFile) {
|
|
@@ -6409,7 +6617,7 @@ var createInput = (displayName, opts = {}) => {
|
|
|
6409
6617
|
el.focus();
|
|
6410
6618
|
}
|
|
6411
6619
|
};
|
|
6412
|
-
return /* @__PURE__ */
|
|
6620
|
+
return /* @__PURE__ */ React66.createElement("span", { className: "Aquarium-InputBase relative block" }, opts.adornment && /* @__PURE__ */ React66.createElement(InputAdornment, { placement: "left", className: opts.isFile ? "icon-stroke-2" : void 0 }, opts.adornment), /* @__PURE__ */ React66.createElement(
|
|
6413
6621
|
"input",
|
|
6414
6622
|
{
|
|
6415
6623
|
ref: inputRef,
|
|
@@ -6430,32 +6638,32 @@ var createInput = (displayName, opts = {}) => {
|
|
|
6430
6638
|
})
|
|
6431
6639
|
})
|
|
6432
6640
|
}
|
|
6433
|
-
), opts.canReset && (props.value ?? inputRef.current?.value) && /* @__PURE__ */
|
|
6641
|
+
), opts.canReset && (props.value ?? inputRef.current?.value) && /* @__PURE__ */ React66.createElement(InputAdornment, null, /* @__PURE__ */ React66.createElement("button", { "aria-label": "reset search", onClick: handleReset }, /* @__PURE__ */ React66.createElement(ResetIcon, null))), !opts.canReset && endAdornment && /* @__PURE__ */ React66.createElement(InputAdornment, null, endAdornment));
|
|
6434
6642
|
}
|
|
6435
6643
|
);
|
|
6436
6644
|
InputComponent.displayName = displayName;
|
|
6437
|
-
InputComponent.Skeleton = () => /* @__PURE__ */
|
|
6645
|
+
InputComponent.Skeleton = () => /* @__PURE__ */ React66.createElement(Skeleton, { height: 38 });
|
|
6438
6646
|
return InputComponent;
|
|
6439
6647
|
};
|
|
6440
6648
|
var InputBase = createInput("InputBase");
|
|
6441
6649
|
var FileInputBase = createInput("FileInputBase", {
|
|
6442
|
-
adornment: /* @__PURE__ */
|
|
6650
|
+
adornment: /* @__PURE__ */ React66.createElement(UploadIcon, null),
|
|
6443
6651
|
canReset: true,
|
|
6444
6652
|
isFile: true
|
|
6445
6653
|
});
|
|
6446
6654
|
var SearchInput = createInput("SearchInput", {
|
|
6447
|
-
adornment: /* @__PURE__ */
|
|
6655
|
+
adornment: /* @__PURE__ */ React66.createElement(SearchIcon, null),
|
|
6448
6656
|
canReset: true,
|
|
6449
6657
|
isSearch: true
|
|
6450
6658
|
});
|
|
6451
6659
|
var createInputComponent = (displayName, options = {}) => {
|
|
6452
6660
|
const InputComponentBase = options.input ?? InputBase;
|
|
6453
|
-
const InputComponent =
|
|
6661
|
+
const InputComponent = React66.forwardRef((inputProps, ref) => {
|
|
6454
6662
|
const { readOnly = false, value: valueProp, onChange: onChangeProp, ...props } = inputProps;
|
|
6455
6663
|
const isControlled = typeof valueProp !== "undefined";
|
|
6456
6664
|
const [valueState, setValueState] = useState7(props.defaultValue ?? "");
|
|
6457
6665
|
const value = isControlled ? valueProp : valueState;
|
|
6458
|
-
const handleChange =
|
|
6666
|
+
const handleChange = useCallback3(
|
|
6459
6667
|
(e) => {
|
|
6460
6668
|
const next = e.target.value;
|
|
6461
6669
|
if (!isControlled) {
|
|
@@ -6474,7 +6682,7 @@ var createInputComponent = (displayName, options = {}) => {
|
|
|
6474
6682
|
inputProps,
|
|
6475
6683
|
Object.keys(labelControlProps).concat(isControlled ? ["defaultValue"] : ["value"])
|
|
6476
6684
|
);
|
|
6477
|
-
return /* @__PURE__ */
|
|
6685
|
+
return /* @__PURE__ */ React66.createElement(
|
|
6478
6686
|
LabelControl,
|
|
6479
6687
|
{
|
|
6480
6688
|
id: `${id}-label`,
|
|
@@ -6484,7 +6692,7 @@ var createInputComponent = (displayName, options = {}) => {
|
|
|
6484
6692
|
...labelControlProps,
|
|
6485
6693
|
className: "Aquarium-Input"
|
|
6486
6694
|
},
|
|
6487
|
-
/* @__PURE__ */
|
|
6695
|
+
/* @__PURE__ */ React66.createElement(
|
|
6488
6696
|
InputComponentBase,
|
|
6489
6697
|
{
|
|
6490
6698
|
ref,
|
|
@@ -6507,11 +6715,11 @@ var createInputComponent = (displayName, options = {}) => {
|
|
|
6507
6715
|
};
|
|
6508
6716
|
var FileInput = createInputComponent("FileInput", { input: FileInputBase });
|
|
6509
6717
|
var Input2 = createInputComponent("Input", { input: InputBase });
|
|
6510
|
-
Input2.Skeleton = () => /* @__PURE__ */
|
|
6718
|
+
Input2.Skeleton = () => /* @__PURE__ */ React66.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React66.createElement(InputBase.Skeleton, null));
|
|
6511
6719
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
|
6512
6720
|
|
|
6513
6721
|
// src/molecules/Select/Select.tsx
|
|
6514
|
-
import
|
|
6722
|
+
import React67, { useEffect as useEffect9, useRef as useRef9, useState as useState8 } from "react";
|
|
6515
6723
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
|
6516
6724
|
import { useId as useId8 } from "@react-aria/utils";
|
|
6517
6725
|
import { useSelect } from "downshift";
|
|
@@ -6519,14 +6727,14 @@ import { defaults, isNil as isNil2, omit as omit6, without } from "lodash-es";
|
|
|
6519
6727
|
var hasIconProperty = (val) => {
|
|
6520
6728
|
return typeof val === "string" || val?.icon?.body !== void 0;
|
|
6521
6729
|
};
|
|
6522
|
-
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => /* @__PURE__ */
|
|
6730
|
+
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => /* @__PURE__ */ React67.createElement(
|
|
6523
6731
|
Select.Item,
|
|
6524
6732
|
{
|
|
6525
6733
|
key: getOptionKey?.(item) ?? getValue?.(item) ?? optionToString(item),
|
|
6526
6734
|
selected: item === selectedItem,
|
|
6527
6735
|
...props
|
|
6528
6736
|
},
|
|
6529
|
-
hasIconProperty(item) && /* @__PURE__ */
|
|
6737
|
+
hasIconProperty(item) && /* @__PURE__ */ React67.createElement(InlineIcon, { icon: item.icon }),
|
|
6530
6738
|
optionToString(item)
|
|
6531
6739
|
);
|
|
6532
6740
|
var _SelectBase = (props) => {
|
|
@@ -6564,10 +6772,10 @@ var _SelectBase = (props) => {
|
|
|
6564
6772
|
...rest
|
|
6565
6773
|
} = withDefaults;
|
|
6566
6774
|
const [hasFocus, setFocus] = useState8(false);
|
|
6567
|
-
const inputRef =
|
|
6568
|
-
const popoverRef =
|
|
6569
|
-
const targetRef =
|
|
6570
|
-
const menuRef =
|
|
6775
|
+
const inputRef = useRef9(null);
|
|
6776
|
+
const popoverRef = useRef9(null);
|
|
6777
|
+
const targetRef = useRef9(null);
|
|
6778
|
+
const menuRef = useRef9(null);
|
|
6571
6779
|
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
|
6572
6780
|
const findItemByValue = (val) => {
|
|
6573
6781
|
if (val === null) {
|
|
@@ -6598,7 +6806,7 @@ var _SelectBase = (props) => {
|
|
|
6598
6806
|
*/
|
|
6599
6807
|
scrollIntoView: (node, _menuNode) => node.scrollIntoView({ block: "nearest" })
|
|
6600
6808
|
});
|
|
6601
|
-
|
|
6809
|
+
useEffect9(() => {
|
|
6602
6810
|
if (isOpen && inputRef.current && popoverRef.current) {
|
|
6603
6811
|
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
|
6604
6812
|
}
|
|
@@ -6616,15 +6824,15 @@ var _SelectBase = (props) => {
|
|
|
6616
6824
|
},
|
|
6617
6825
|
withDefaults
|
|
6618
6826
|
);
|
|
6619
|
-
const renderGroup = (group) => /* @__PURE__ */
|
|
6620
|
-
const input = /* @__PURE__ */
|
|
6827
|
+
const renderGroup = (group) => /* @__PURE__ */ React67.createElement(React67.Fragment, { key: group.label }, /* @__PURE__ */ React67.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
|
6828
|
+
const input = /* @__PURE__ */ React67.createElement(
|
|
6621
6829
|
Select.InputContainer,
|
|
6622
6830
|
{
|
|
6623
6831
|
...getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef }),
|
|
6624
6832
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
|
6625
6833
|
tabIndex: 0
|
|
6626
6834
|
},
|
|
6627
|
-
/* @__PURE__ */
|
|
6835
|
+
/* @__PURE__ */ React67.createElement(
|
|
6628
6836
|
Select.Input,
|
|
6629
6837
|
{
|
|
6630
6838
|
id,
|
|
@@ -6641,10 +6849,10 @@ var _SelectBase = (props) => {
|
|
|
6641
6849
|
onBlur: () => setFocus(false)
|
|
6642
6850
|
}
|
|
6643
6851
|
),
|
|
6644
|
-
!readOnly && /* @__PURE__ */
|
|
6852
|
+
!readOnly && /* @__PURE__ */ React67.createElement(Select.Toggle, { disabled, isOpen, tabIndex: -1 })
|
|
6645
6853
|
);
|
|
6646
6854
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
|
6647
|
-
return /* @__PURE__ */
|
|
6855
|
+
return /* @__PURE__ */ React67.createElement("div", { className: "Aquarium-SelectBase relative" }, input, /* @__PURE__ */ React67.createElement(
|
|
6648
6856
|
Popover,
|
|
6649
6857
|
{
|
|
6650
6858
|
ref: popoverRef,
|
|
@@ -6655,7 +6863,7 @@ var _SelectBase = (props) => {
|
|
|
6655
6863
|
isNonModal: true,
|
|
6656
6864
|
style: { width: targetRef.current?.offsetWidth }
|
|
6657
6865
|
},
|
|
6658
|
-
/* @__PURE__ */
|
|
6866
|
+
/* @__PURE__ */ React67.createElement(Select.Menu, { maxHeight, ...menuProps }, options.length === 0 && /* @__PURE__ */ React67.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions2.length > 0 && /* @__PURE__ */ React67.createElement(React67.Fragment, null, /* @__PURE__ */ React67.createElement(Select.Divider, { onMouseOver: () => setHighlightedIndex(-1) }), actions2.map((act, index) => /* @__PURE__ */ React67.createElement(
|
|
6659
6867
|
Select.ActionItem,
|
|
6660
6868
|
{
|
|
6661
6869
|
key: `${index}`,
|
|
@@ -6670,8 +6878,8 @@ var _SelectBase = (props) => {
|
|
|
6670
6878
|
))))
|
|
6671
6879
|
));
|
|
6672
6880
|
};
|
|
6673
|
-
var SelectBase = (props) => /* @__PURE__ */
|
|
6674
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
|
6881
|
+
var SelectBase = (props) => /* @__PURE__ */ React67.createElement(_SelectBase, { ...props });
|
|
6882
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React67.createElement(Skeleton, { height: 38 });
|
|
6675
6883
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
|
6676
6884
|
var Select2 = ({
|
|
6677
6885
|
options,
|
|
@@ -6683,7 +6891,7 @@ var Select2 = ({
|
|
|
6683
6891
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
6684
6892
|
const labelProps = getLabelControlProps(props);
|
|
6685
6893
|
const baseProps = omit6(props, without(Object.keys(labelProps), "required"));
|
|
6686
|
-
return /* @__PURE__ */
|
|
6894
|
+
return /* @__PURE__ */ React67.createElement(
|
|
6687
6895
|
LabelControl,
|
|
6688
6896
|
{
|
|
6689
6897
|
id: `${id}-label`,
|
|
@@ -6692,7 +6900,7 @@ var Select2 = ({
|
|
|
6692
6900
|
...labelProps,
|
|
6693
6901
|
className: "Aquarium-Select"
|
|
6694
6902
|
},
|
|
6695
|
-
/* @__PURE__ */
|
|
6903
|
+
/* @__PURE__ */ React67.createElement(
|
|
6696
6904
|
_SelectBase,
|
|
6697
6905
|
{
|
|
6698
6906
|
...baseProps,
|
|
@@ -6705,7 +6913,7 @@ var Select2 = ({
|
|
|
6705
6913
|
)
|
|
6706
6914
|
);
|
|
6707
6915
|
};
|
|
6708
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
|
6916
|
+
var SelectSkeleton = () => /* @__PURE__ */ React67.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React67.createElement(SelectBase.Skeleton, null));
|
|
6709
6917
|
Select2.Skeleton = SelectSkeleton;
|
|
6710
6918
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
|
6711
6919
|
|
|
@@ -6720,11 +6928,11 @@ var Pagination = ({
|
|
|
6720
6928
|
pageSizes,
|
|
6721
6929
|
onPageSizeChange
|
|
6722
6930
|
}) => {
|
|
6723
|
-
const [value, setValue] =
|
|
6724
|
-
|
|
6931
|
+
const [value, setValue] = React68.useState(currentPage);
|
|
6932
|
+
React68.useEffect(() => {
|
|
6725
6933
|
setValue(currentPage);
|
|
6726
6934
|
}, [currentPage]);
|
|
6727
|
-
return /* @__PURE__ */
|
|
6935
|
+
return /* @__PURE__ */ React68.createElement(
|
|
6728
6936
|
Box,
|
|
6729
6937
|
{
|
|
6730
6938
|
className: clsx22("Aquarium-Pagination", {
|
|
@@ -6734,7 +6942,7 @@ var Pagination = ({
|
|
|
6734
6942
|
backgroundColor: "muted",
|
|
6735
6943
|
padding: "4"
|
|
6736
6944
|
},
|
|
6737
|
-
pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
|
6945
|
+
pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React68.createElement(Box, { display: "flex", alignItems: "center", gap: "4" }, /* @__PURE__ */ React68.createElement(Typography2.Default, { color: "muted" }, "Items per page "), /* @__PURE__ */ React68.createElement("div", { className: "max-w-[70px]" }, /* @__PURE__ */ React68.createElement(
|
|
6738
6946
|
SelectBase,
|
|
6739
6947
|
{
|
|
6740
6948
|
"aria-label": "Items per page",
|
|
@@ -6749,8 +6957,8 @@ var Pagination = ({
|
|
|
6749
6957
|
}
|
|
6750
6958
|
}
|
|
6751
6959
|
}
|
|
6752
|
-
))) : /* @__PURE__ */
|
|
6753
|
-
/* @__PURE__ */
|
|
6960
|
+
))) : /* @__PURE__ */ React68.createElement("div", null),
|
|
6961
|
+
/* @__PURE__ */ React68.createElement(Box, { display: "flex", justifyContent: "center", alignItems: "center", className: "grow" }, /* @__PURE__ */ React68.createElement(
|
|
6754
6962
|
Button2.Icon,
|
|
6755
6963
|
{
|
|
6756
6964
|
"aria-label": "First",
|
|
@@ -6758,7 +6966,7 @@ var Pagination = ({
|
|
|
6758
6966
|
icon: chevronBackward_default,
|
|
6759
6967
|
disabled: !hasPreviousPage
|
|
6760
6968
|
}
|
|
6761
|
-
), /* @__PURE__ */
|
|
6969
|
+
), /* @__PURE__ */ React68.createElement(
|
|
6762
6970
|
Button2.Icon,
|
|
6763
6971
|
{
|
|
6764
6972
|
"aria-label": "Previous",
|
|
@@ -6766,7 +6974,7 @@ var Pagination = ({
|
|
|
6766
6974
|
icon: chevronLeft_default,
|
|
6767
6975
|
disabled: !hasPreviousPage
|
|
6768
6976
|
}
|
|
6769
|
-
), /* @__PURE__ */
|
|
6977
|
+
), /* @__PURE__ */ React68.createElement(Box, { paddingX: "4" }, /* @__PURE__ */ React68.createElement(Typography2.Default, { color: "default" }, "Page")), /* @__PURE__ */ React68.createElement(
|
|
6770
6978
|
InputBase,
|
|
6771
6979
|
{
|
|
6772
6980
|
"aria-label": "Page",
|
|
@@ -6787,7 +6995,7 @@ var Pagination = ({
|
|
|
6787
6995
|
onPageChange(newPage);
|
|
6788
6996
|
}
|
|
6789
6997
|
}
|
|
6790
|
-
), /* @__PURE__ */
|
|
6998
|
+
), /* @__PURE__ */ React68.createElement(Box, { paddingX: "4" }, /* @__PURE__ */ React68.createElement(Typography2.Default, { color: "default" }, "of ", totalPages)), /* @__PURE__ */ React68.createElement(
|
|
6791
6999
|
Button2.Icon,
|
|
6792
7000
|
{
|
|
6793
7001
|
"aria-label": "Next",
|
|
@@ -6795,7 +7003,7 @@ var Pagination = ({
|
|
|
6795
7003
|
icon: chevronRight_default,
|
|
6796
7004
|
disabled: !hasNextPage
|
|
6797
7005
|
}
|
|
6798
|
-
), /* @__PURE__ */
|
|
7006
|
+
), /* @__PURE__ */ React68.createElement(
|
|
6799
7007
|
Button2.Icon,
|
|
6800
7008
|
{
|
|
6801
7009
|
"aria-label": "Last",
|
|
@@ -6804,12 +7012,12 @@ var Pagination = ({
|
|
|
6804
7012
|
disabled: !hasNextPage
|
|
6805
7013
|
}
|
|
6806
7014
|
)),
|
|
6807
|
-
pageSizes && /* @__PURE__ */
|
|
7015
|
+
pageSizes && /* @__PURE__ */ React68.createElement("div", null)
|
|
6808
7016
|
);
|
|
6809
7017
|
};
|
|
6810
7018
|
|
|
6811
7019
|
// src/molecules/Pagination/usePagination.tsx
|
|
6812
|
-
import { useEffect as
|
|
7020
|
+
import { useEffect as useEffect10, useState as useState9 } from "react";
|
|
6813
7021
|
import { clamp as clamp2 } from "lodash-es";
|
|
6814
7022
|
var initialState = {
|
|
6815
7023
|
currentPage: 1,
|
|
@@ -6828,7 +7036,7 @@ var usePagination = (items, options) => {
|
|
|
6828
7036
|
setPageSize(pageSize2);
|
|
6829
7037
|
setCurrentPage(clamp2(options?.initialPage ?? initialState.currentPage, 1, newTotalPages));
|
|
6830
7038
|
};
|
|
6831
|
-
|
|
7039
|
+
useEffect10(() => {
|
|
6832
7040
|
setCurrentPage(clamp2(options?.initialPage ?? initialState.currentPage, 1, totalPages));
|
|
6833
7041
|
}, [items.length]);
|
|
6834
7042
|
return [
|
|
@@ -6846,7 +7054,7 @@ var usePagination = (items, options) => {
|
|
|
6846
7054
|
};
|
|
6847
7055
|
|
|
6848
7056
|
// src/utils/useInView.ts
|
|
6849
|
-
import
|
|
7057
|
+
import React69 from "react";
|
|
6850
7058
|
var useInView = ({
|
|
6851
7059
|
onChange,
|
|
6852
7060
|
skip,
|
|
@@ -6854,12 +7062,12 @@ var useInView = ({
|
|
|
6854
7062
|
rootMargin,
|
|
6855
7063
|
threshold = 0
|
|
6856
7064
|
}) => {
|
|
6857
|
-
const ref =
|
|
6858
|
-
const [state, setState] =
|
|
7065
|
+
const ref = React69.useRef(null);
|
|
7066
|
+
const [state, setState] = React69.useState({
|
|
6859
7067
|
inView: false,
|
|
6860
7068
|
entry: void 0
|
|
6861
7069
|
});
|
|
6862
|
-
|
|
7070
|
+
React69.useEffect(() => {
|
|
6863
7071
|
const target = ref.current;
|
|
6864
7072
|
if (skip || !target) {
|
|
6865
7073
|
return;
|
|
@@ -6891,8 +7099,8 @@ var useInView = ({
|
|
|
6891
7099
|
var List = ({
|
|
6892
7100
|
items,
|
|
6893
7101
|
renderItem,
|
|
6894
|
-
container: container2 =
|
|
6895
|
-
paginationContainer =
|
|
7102
|
+
container: container2 = React70.Fragment,
|
|
7103
|
+
paginationContainer = React70.Fragment,
|
|
6896
7104
|
pagination,
|
|
6897
7105
|
loadingIndicator = "Loading more items",
|
|
6898
7106
|
hasMore,
|
|
@@ -6903,7 +7111,7 @@ var List = ({
|
|
|
6903
7111
|
const Component = container2;
|
|
6904
7112
|
const PaginationComponent = paginationContainer;
|
|
6905
7113
|
const paginationProps = isObject(pagination) ? pagination : void 0;
|
|
6906
|
-
const onChange =
|
|
7114
|
+
const onChange = React70.useCallback(
|
|
6907
7115
|
(inView) => {
|
|
6908
7116
|
if (inView && hasMore && !isLoading) {
|
|
6909
7117
|
next();
|
|
@@ -6922,7 +7130,7 @@ var List = ({
|
|
|
6922
7130
|
const listItems = pagination ? paginatedItems : items;
|
|
6923
7131
|
const showLoader = isInfinite && hasMore;
|
|
6924
7132
|
const showPagination = pagination || showLoader;
|
|
6925
|
-
return /* @__PURE__ */
|
|
7133
|
+
return /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(Component, null, listItems.map(renderItem)), showPagination && /* @__PURE__ */ React70.createElement(PaginationComponent, null, showLoader && /* @__PURE__ */ React70.createElement(
|
|
6926
7134
|
"div",
|
|
6927
7135
|
{
|
|
6928
7136
|
ref,
|
|
@@ -6934,21 +7142,21 @@ var List = ({
|
|
|
6934
7142
|
isLoading ? "opacity-100" : "opacity-0"
|
|
6935
7143
|
)
|
|
6936
7144
|
},
|
|
6937
|
-
/* @__PURE__ */
|
|
6938
|
-
/* @__PURE__ */
|
|
6939
|
-
), pagination && /* @__PURE__ */
|
|
7145
|
+
/* @__PURE__ */ React70.createElement(Icon, { width: 22, icon: loading_default, className: "text-muted" }),
|
|
7146
|
+
/* @__PURE__ */ React70.createElement(Typography2.Default, { color: "default" }, loadingIndicator)
|
|
7147
|
+
), pagination && /* @__PURE__ */ React70.createElement(Pagination, { ...paginationState, ...paginationProps })));
|
|
6940
7148
|
};
|
|
6941
7149
|
|
|
6942
7150
|
// src/atoms/DataList/DataList.tsx
|
|
6943
|
-
import
|
|
7151
|
+
import React72 from "react";
|
|
6944
7152
|
import { clsx as clsx25 } from "clsx";
|
|
6945
7153
|
import { tv as tv19 } from "tailwind-variants";
|
|
6946
7154
|
|
|
6947
7155
|
// src/atoms/Table/Table.tsx
|
|
6948
|
-
import
|
|
7156
|
+
import React71 from "react";
|
|
6949
7157
|
import { clsx as clsx24 } from "clsx";
|
|
6950
7158
|
import { tv as tv18 } from "tailwind-variants";
|
|
6951
|
-
var HeadContext =
|
|
7159
|
+
var HeadContext = React71.createContext(null);
|
|
6952
7160
|
var tableClasses = tv18({
|
|
6953
7161
|
base: "w-full relative typography-default border-spacing-0 border-separate"
|
|
6954
7162
|
});
|
|
@@ -7059,11 +7267,11 @@ var sortCellIconsContainerClasses = tv18({
|
|
|
7059
7267
|
}
|
|
7060
7268
|
});
|
|
7061
7269
|
var Table = ({ children, ariaLabel, className, ...rest }) => {
|
|
7062
|
-
return /* @__PURE__ */
|
|
7270
|
+
return /* @__PURE__ */ React71.createElement("table", { ...rest, className: tableClasses({ className }), "aria-label": ariaLabel }, children);
|
|
7063
7271
|
};
|
|
7064
|
-
var TableHead = ({ children, sticky, ...rest }) => /* @__PURE__ */
|
|
7065
|
-
var TableBody = ({ children, ...rest }) => /* @__PURE__ */
|
|
7066
|
-
var TableRow = ({ children, className, disabled = false, ...rest }) => /* @__PURE__ */
|
|
7272
|
+
var TableHead = ({ children, sticky, ...rest }) => /* @__PURE__ */ React71.createElement("thead", { ...rest }, /* @__PURE__ */ React71.createElement("tr", null, /* @__PURE__ */ React71.createElement(HeadContext.Provider, { value: { children, sticky } }, children)));
|
|
7273
|
+
var TableBody = ({ children, ...rest }) => /* @__PURE__ */ React71.createElement("tbody", { ...rest }, children);
|
|
7274
|
+
var TableRow = ({ children, className, disabled = false, ...rest }) => /* @__PURE__ */ React71.createElement(
|
|
7067
7275
|
"tr",
|
|
7068
7276
|
{
|
|
7069
7277
|
...rest,
|
|
@@ -7075,10 +7283,10 @@ var TableRow = ({ children, className, disabled = false, ...rest }) => /* @__PUR
|
|
|
7075
7283
|
var getBodyCellClassNames = (table = true, stickyColumn) => bodyCellClasses({ table, stickyColumn });
|
|
7076
7284
|
var getAlignClassNames = (align) => alignClasses({ align });
|
|
7077
7285
|
var getHeadCellClassNames = (sticky = true, stickyColumn) => headCellClasses({ sticky, stickyColumn });
|
|
7078
|
-
var TableCell =
|
|
7286
|
+
var TableCell = React71.forwardRef(
|
|
7079
7287
|
({ children, className, stickyColumn, align = "left", ...rest }, ref) => {
|
|
7080
|
-
const headContext =
|
|
7081
|
-
return headContext ? /* @__PURE__ */
|
|
7288
|
+
const headContext = React71.useContext(HeadContext);
|
|
7289
|
+
return headContext ? /* @__PURE__ */ React71.createElement(
|
|
7082
7290
|
"th",
|
|
7083
7291
|
{
|
|
7084
7292
|
...rest,
|
|
@@ -7091,7 +7299,7 @@ var TableCell = React70.forwardRef(
|
|
|
7091
7299
|
)
|
|
7092
7300
|
},
|
|
7093
7301
|
children
|
|
7094
|
-
) : /* @__PURE__ */
|
|
7302
|
+
) : /* @__PURE__ */ React71.createElement(
|
|
7095
7303
|
"td",
|
|
7096
7304
|
{
|
|
7097
7305
|
...rest,
|
|
@@ -7108,21 +7316,21 @@ var TableCell = React70.forwardRef(
|
|
|
7108
7316
|
}
|
|
7109
7317
|
);
|
|
7110
7318
|
var TableSelectCell = ({ ariaLabel, ...props }) => {
|
|
7111
|
-
return /* @__PURE__ */
|
|
7319
|
+
return /* @__PURE__ */ React71.createElement(Table.Cell, { className: "leading-[0px]" }, props.type === "radio" ? /* @__PURE__ */ React71.createElement(RadioButton, { "aria-label": ariaLabel, ...props }) : /* @__PURE__ */ React71.createElement(Checkbox, { "aria-label": ariaLabel, ...props }));
|
|
7112
7320
|
};
|
|
7113
7321
|
var getSortCellButtonClassNames = (align) => sortCellButtonClasses({ align });
|
|
7114
7322
|
var getSortCellIconClassNames = (active) => sortCellIconClasses({ active });
|
|
7115
|
-
var TableSortCell =
|
|
7116
|
-
({ children, direction = "none", onClick, ...rest }, ref) => /* @__PURE__ */
|
|
7323
|
+
var TableSortCell = React71.forwardRef(
|
|
7324
|
+
({ children, direction = "none", onClick, ...rest }, ref) => /* @__PURE__ */ React71.createElement(Table.Cell, { ...rest, "aria-sort": direction, ref }, /* @__PURE__ */ React71.createElement("span", { className: getSortCellButtonClassNames(rest.align), role: "button", tabIndex: -1, onClick }, children, /* @__PURE__ */ React71.createElement("div", { "data-sort-icons": true, className: sortCellIconsContainerClasses({ direction }) }, /* @__PURE__ */ React71.createElement(InlineIcon, { icon: chevronUp_default, className: getSortCellIconClassNames(direction === "ascending") }), /* @__PURE__ */ React71.createElement(InlineIcon, { icon: chevronDown_default, className: getSortCellIconClassNames(direction === "descending") }))))
|
|
7117
7325
|
);
|
|
7118
|
-
var Caption = ({ children }) => /* @__PURE__ */
|
|
7119
|
-
var Item3 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */
|
|
7120
|
-
Table.Head =
|
|
7121
|
-
Table.Body =
|
|
7122
|
-
Table.Row =
|
|
7123
|
-
Table.Cell =
|
|
7124
|
-
Table.SortCell =
|
|
7125
|
-
Table.SelectCell =
|
|
7326
|
+
var Caption = ({ children }) => /* @__PURE__ */ React71.createElement(Typography2.Small, { htmlTag: "caption" }, children);
|
|
7327
|
+
var Item3 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React71.createElement("div", { className: "flex gap-4 items-center" }, image && /* @__PURE__ */ React71.createElement("img", { src: image, alt: imageAlt ?? "", style: { width: imageSize, height: imageSize } }), /* @__PURE__ */ React71.createElement("div", null, title, caption && /* @__PURE__ */ React71.createElement(Typography2.Small, null, caption)));
|
|
7328
|
+
Table.Head = React71.memo(TableHead);
|
|
7329
|
+
Table.Body = React71.memo(TableBody);
|
|
7330
|
+
Table.Row = React71.memo(TableRow);
|
|
7331
|
+
Table.Cell = React71.memo(TableCell);
|
|
7332
|
+
Table.SortCell = React71.memo(TableSortCell);
|
|
7333
|
+
Table.SelectCell = React71.memo(TableSelectCell);
|
|
7126
7334
|
Table.Caption = Caption;
|
|
7127
7335
|
|
|
7128
7336
|
// src/atoms/DataList/DataList.tsx
|
|
@@ -7205,7 +7413,7 @@ var toolbarContainerClasses = tv19({
|
|
|
7205
7413
|
base: "col-span-full flex items-stretch py-4 px-l2 border-b border-muted",
|
|
7206
7414
|
variants: {
|
|
7207
7415
|
sticky: {
|
|
7208
|
-
true: "sticky top-[
|
|
7416
|
+
true: "sticky top-[43px] bg-layer z-10",
|
|
7209
7417
|
false: ""
|
|
7210
7418
|
}
|
|
7211
7419
|
}
|
|
@@ -7222,15 +7430,15 @@ var toolbarSelectionCountClasses = tv19({
|
|
|
7222
7430
|
var emptyGroupClasses = tv19({
|
|
7223
7431
|
base: "flex gap-3 items-center"
|
|
7224
7432
|
});
|
|
7225
|
-
var DataList = ({ className, ...rest }) => /* @__PURE__ */
|
|
7226
|
-
var TreeLine = ({ className, style, isLast = false, ...rest }) => /* @__PURE__ */
|
|
7433
|
+
var DataList = ({ className, ...rest }) => /* @__PURE__ */ React72.createElement("div", { ...rest });
|
|
7434
|
+
var TreeLine = ({ className, style, isLast = false, ...rest }) => /* @__PURE__ */ React72.createElement("div", { ...rest, className: clsx25(treeLineClasses(), className) }, /* @__PURE__ */ React72.createElement("div", { className: treeLineInnerClasses({ isLast }) }), /* @__PURE__ */ React72.createElement("div", { className: "border-t border-default border-dashed self-center w-[18px]" }));
|
|
7227
7435
|
var HeadCell = ({
|
|
7228
7436
|
className,
|
|
7229
7437
|
sticky,
|
|
7230
7438
|
align,
|
|
7231
7439
|
stickyColumn,
|
|
7232
7440
|
...rest
|
|
7233
|
-
}) => /* @__PURE__ */
|
|
7441
|
+
}) => /* @__PURE__ */ React72.createElement(
|
|
7234
7442
|
"div",
|
|
7235
7443
|
{
|
|
7236
7444
|
role: "columnheader",
|
|
@@ -7243,7 +7451,7 @@ var Cell = ({
|
|
|
7243
7451
|
align,
|
|
7244
7452
|
stickyColumn,
|
|
7245
7453
|
...rest
|
|
7246
|
-
}) => /* @__PURE__ */
|
|
7454
|
+
}) => /* @__PURE__ */ React72.createElement(
|
|
7247
7455
|
"div",
|
|
7248
7456
|
{
|
|
7249
7457
|
...rest,
|
|
@@ -7266,7 +7474,7 @@ var Row = ({
|
|
|
7266
7474
|
noDivider = false,
|
|
7267
7475
|
...rest
|
|
7268
7476
|
}) => {
|
|
7269
|
-
return /* @__PURE__ */
|
|
7477
|
+
return /* @__PURE__ */ React72.createElement(
|
|
7270
7478
|
"div",
|
|
7271
7479
|
{
|
|
7272
7480
|
...rest,
|
|
@@ -7284,9 +7492,9 @@ var Row = ({
|
|
|
7284
7492
|
}
|
|
7285
7493
|
);
|
|
7286
7494
|
};
|
|
7287
|
-
var SubGroupSpacing = ({ className, divider = false, ...rest }) => /* @__PURE__ */
|
|
7288
|
-
var SortCell = ({ children, direction = "none", onClick, sticky, ...rest }) => /* @__PURE__ */
|
|
7289
|
-
var EmptyGroup = ({ icon, children }) => /* @__PURE__ */
|
|
7495
|
+
var SubGroupSpacing = ({ className, divider = false, ...rest }) => /* @__PURE__ */ React72.createElement("span", { ...rest, "aria-hidden": true, className: clsx25(subGroupSpacingClasses({ divider }), className) });
|
|
7496
|
+
var SortCell = ({ children, direction = "none", onClick, sticky, ...rest }) => /* @__PURE__ */ React72.createElement(HeadCell, { ...rest, "aria-sort": direction, role: "columnheader", sticky }, /* @__PURE__ */ React72.createElement("span", { className: getSortCellButtonClassNames(rest.align), role: "button", tabIndex: -1, onClick }, children, /* @__PURE__ */ React72.createElement("div", { "data-sort-icons": true, className: sortCellIconsClasses({ direction }) }, /* @__PURE__ */ React72.createElement(InlineIcon, { icon: chevronUp_default, className: getSortCellIconClassNames(direction === "ascending") }), /* @__PURE__ */ React72.createElement(InlineIcon, { icon: chevronDown_default, className: getSortCellIconClassNames(direction === "descending") }))));
|
|
7497
|
+
var EmptyGroup = ({ icon, children }) => /* @__PURE__ */ React72.createElement("div", { className: emptyGroupClasses() }, icon && /* @__PURE__ */ React72.createElement(Icon, { icon, width: 18 }), children);
|
|
7290
7498
|
DataList.EmptyGroup = EmptyGroup;
|
|
7291
7499
|
DataList.EmptyGroup.displayName = "DataList.EmptyGroup";
|
|
7292
7500
|
DataList.HeadCell = HeadCell;
|
|
@@ -7301,12 +7509,12 @@ DataList.Row = Row;
|
|
|
7301
7509
|
DataList.Row.displayName = "DataList.Row";
|
|
7302
7510
|
DataList.TreeLine = TreeLine;
|
|
7303
7511
|
DataList.TreeLine.displayName = "DataList.TreeLine";
|
|
7304
|
-
var ToolbarContainer = ({ className, sticky = true, ...rest }) => /* @__PURE__ */
|
|
7512
|
+
var ToolbarContainer = ({ className, sticky = true, ...rest }) => /* @__PURE__ */ React72.createElement("div", { ...rest, role: "row", className: clsx25(toolbarContainerClasses({ sticky }), className) });
|
|
7305
7513
|
ToolbarContainer.displayName = "DataList.Toolbar.Container";
|
|
7306
|
-
var ToolbarGroup = ({ className, ...rest }) => /* @__PURE__ */
|
|
7514
|
+
var ToolbarGroup = ({ className, ...rest }) => /* @__PURE__ */ React72.createElement("div", { role: "cell", ...rest, className: clsx25(toolbarGroupClasses(), className) });
|
|
7307
7515
|
ToolbarGroup.displayName = "DataList.Toolbar.Group";
|
|
7308
|
-
var ToolbarSelectionCount = ({ className, ...rest }) => /* @__PURE__ */
|
|
7309
|
-
var ToolbarActions = ({ className, ...rest }) => /* @__PURE__ */
|
|
7516
|
+
var ToolbarSelectionCount = ({ className, ...rest }) => /* @__PURE__ */ React72.createElement(Typography, { variant: "default", color: "muted", className: clsx25(toolbarSelectionCountClasses(), className), ...rest });
|
|
7517
|
+
var ToolbarActions = ({ className, ...rest }) => /* @__PURE__ */ React72.createElement("div", { ...rest, className: clsx25(toolbarActionsClasses(), className) });
|
|
7310
7518
|
ToolbarActions.displayName = "DataList.Toolbar.Actions";
|
|
7311
7519
|
DataList.Toolbar = {
|
|
7312
7520
|
Container: ToolbarContainer,
|
|
@@ -7316,11 +7524,11 @@ DataList.Toolbar = {
|
|
|
7316
7524
|
};
|
|
7317
7525
|
|
|
7318
7526
|
// src/utils/stickyStyles.tsx
|
|
7319
|
-
import
|
|
7527
|
+
import React73, { useCallback as useCallback4, useLayoutEffect as useLayoutEffect2, useMemo as useMemo4, useRef as useRef10, useState as useState10 } from "react";
|
|
7320
7528
|
import { animated as animated4, useSpring as useSpring3 } from "@react-spring/web";
|
|
7321
7529
|
import { throttle } from "lodash-es";
|
|
7322
7530
|
function useStickyStyles(scrollProgress, axis, { borderColor, boxShadowColor }) {
|
|
7323
|
-
const { startValue, endValue } =
|
|
7531
|
+
const { startValue, endValue } = useMemo4(() => {
|
|
7324
7532
|
if (scrollProgress === null) {
|
|
7325
7533
|
return { startValue: 0, endValue: 0 };
|
|
7326
7534
|
}
|
|
@@ -7368,8 +7576,8 @@ function useScrollProgress({
|
|
|
7368
7576
|
throttleMs = 50
|
|
7369
7577
|
}) {
|
|
7370
7578
|
const [scrollState, setScrollState] = useState10(null);
|
|
7371
|
-
const currentStateRef =
|
|
7372
|
-
const throttledSetScrollState =
|
|
7579
|
+
const currentStateRef = useRef10(null);
|
|
7580
|
+
const throttledSetScrollState = useMemo4(
|
|
7373
7581
|
() => throttle((value) => {
|
|
7374
7582
|
const currentState = currentStateRef.current;
|
|
7375
7583
|
if (currentState?.scrollX === value.scrollX && currentState.scrollXProgress === value.scrollXProgress) {
|
|
@@ -7380,7 +7588,7 @@ function useScrollProgress({
|
|
|
7380
7588
|
}, throttleMs),
|
|
7381
7589
|
[throttleMs]
|
|
7382
7590
|
);
|
|
7383
|
-
const handleScroll =
|
|
7591
|
+
const handleScroll = useCallback4(() => {
|
|
7384
7592
|
const element = containerRef.current;
|
|
7385
7593
|
if (!element) {
|
|
7386
7594
|
return;
|
|
@@ -7423,7 +7631,7 @@ function createAnimatedCell({
|
|
|
7423
7631
|
return cellElement;
|
|
7424
7632
|
}
|
|
7425
7633
|
const AnimatedCell = animated4(cellElement.type);
|
|
7426
|
-
return /* @__PURE__ */
|
|
7634
|
+
return /* @__PURE__ */ React73.createElement(
|
|
7427
7635
|
AnimatedCell,
|
|
7428
7636
|
{
|
|
7429
7637
|
...cellElement.props,
|
|
@@ -7481,10 +7689,10 @@ function isOnSortChangedDirection(value) {
|
|
|
7481
7689
|
}
|
|
7482
7690
|
|
|
7483
7691
|
// src/utils/table/useTableSort.tsx
|
|
7484
|
-
import
|
|
7692
|
+
import React74 from "react";
|
|
7485
7693
|
var useTableSort = ({ column, direction, onSortChanged } = {}) => {
|
|
7486
7694
|
const defaultSort = column ? { column, direction } : void 0;
|
|
7487
|
-
const [sort, setSort] =
|
|
7695
|
+
const [sort, setSort] = React74.useState(defaultSort);
|
|
7488
7696
|
const setSortAndEmitOnSortChangedEvent = (sort2) => {
|
|
7489
7697
|
setSort(sort2);
|
|
7490
7698
|
if (onSortChanged) {
|
|
@@ -7525,11 +7733,11 @@ var sortRowsBy = (rows, sort) => {
|
|
|
7525
7733
|
};
|
|
7526
7734
|
|
|
7527
7735
|
// src/molecules/DataList/DataListComponents.tsx
|
|
7528
|
-
import
|
|
7736
|
+
import React79 from "react";
|
|
7529
7737
|
import { isFunction } from "lodash-es";
|
|
7530
7738
|
|
|
7531
7739
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
|
7532
|
-
import
|
|
7740
|
+
import React78, { createContext as createContext4, useContext as useContext7 } from "react";
|
|
7533
7741
|
import {
|
|
7534
7742
|
Autocomplete as AriaAutocomplete2,
|
|
7535
7743
|
MenuTrigger as AriaMenuTrigger,
|
|
@@ -7537,14 +7745,14 @@ import {
|
|
|
7537
7745
|
} from "react-aria-components";
|
|
7538
7746
|
|
|
7539
7747
|
// src/atoms/Pressable/Pressable.tsx
|
|
7540
|
-
import
|
|
7748
|
+
import React75 from "react";
|
|
7541
7749
|
import { usePress } from "@react-aria/interactions";
|
|
7542
7750
|
import { mergeProps as mergeProps2, useObjectRef } from "@react-aria/utils";
|
|
7543
|
-
var Pressable =
|
|
7751
|
+
var Pressable = React75.forwardRef(({ children, ...props }, ref) => {
|
|
7544
7752
|
ref = useObjectRef(ref);
|
|
7545
7753
|
const { pressProps } = usePress({ ...props, ref });
|
|
7546
|
-
const child =
|
|
7547
|
-
return
|
|
7754
|
+
const child = React75.Children.only(children);
|
|
7755
|
+
return React75.cloneElement(
|
|
7548
7756
|
child,
|
|
7549
7757
|
// @ts-expect-error: Not sure if it's possible to type ref correctly in this case.
|
|
7550
7758
|
{ ref, ...mergeProps2(child.props, pressProps) }
|
|
@@ -7552,7 +7760,7 @@ var Pressable = React74.forwardRef(({ children, ...props }, ref) => {
|
|
|
7552
7760
|
});
|
|
7553
7761
|
|
|
7554
7762
|
// src/molecules/DropdownMenu/SearchField.tsx
|
|
7555
|
-
import
|
|
7763
|
+
import React77 from "react";
|
|
7556
7764
|
import {
|
|
7557
7765
|
Button as AriaButton,
|
|
7558
7766
|
Input as AriaInput2,
|
|
@@ -7560,7 +7768,7 @@ import {
|
|
|
7560
7768
|
} from "react-aria-components";
|
|
7561
7769
|
|
|
7562
7770
|
// src/atoms/Field/Field.tsx
|
|
7563
|
-
import
|
|
7771
|
+
import React76 from "react";
|
|
7564
7772
|
import { Group as Group3 } from "react-aria-components";
|
|
7565
7773
|
|
|
7566
7774
|
// src/atoms/utils/index.ts
|
|
@@ -7598,23 +7806,23 @@ var fieldGroup = tv20({
|
|
|
7598
7806
|
|
|
7599
7807
|
// src/atoms/Field/Field.tsx
|
|
7600
7808
|
var FieldGroup = (props) => {
|
|
7601
|
-
return /* @__PURE__ */
|
|
7809
|
+
return /* @__PURE__ */ React76.createElement(Group3, { ...props, className: (renderProps) => fieldGroup(renderProps) });
|
|
7602
7810
|
};
|
|
7603
7811
|
|
|
7604
7812
|
// src/molecules/DropdownMenu/SearchField.tsx
|
|
7605
7813
|
var SearchField = (props) => {
|
|
7606
|
-
return /* @__PURE__ */
|
|
7814
|
+
return /* @__PURE__ */ React77.createElement(AriaSearchField2, { ...props }, /* @__PURE__ */ React77.createElement(FieldGroup, null, /* @__PURE__ */ React77.createElement(SearchIcon, { "aria-hidden": true }), /* @__PURE__ */ React77.createElement(AriaInput2, { className: "outline-none grow bg-transparent [&::-webkit-search-cancel-button]:hidden" }), /* @__PURE__ */ React77.createElement(AriaButton, { "aria-label": "Clear", className: "group-empty:invisible" }, /* @__PURE__ */ React77.createElement(ResetIcon, { "aria-hidden": true }))));
|
|
7607
7815
|
};
|
|
7608
7816
|
|
|
7609
7817
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
|
7610
7818
|
var MenuPropsContext = createContext4({});
|
|
7611
7819
|
var DropdownMenu2 = (props) => {
|
|
7612
|
-
return /* @__PURE__ */
|
|
7820
|
+
return /* @__PURE__ */ React78.createElement(MenuPropsContext.Provider, { value: props }, /* @__PURE__ */ React78.createElement(AriaMenuTrigger, { defaultOpen: props.defaultOpen, isOpen: props.isOpen, onOpenChange: props.onOpenChange }, props.children));
|
|
7613
7821
|
};
|
|
7614
7822
|
DropdownMenu2.displayName = "DropdownMenu";
|
|
7615
7823
|
var MenuTrigger = ({ children }) => {
|
|
7616
7824
|
const props = useContext7(MenuPropsContext);
|
|
7617
|
-
return /* @__PURE__ */
|
|
7825
|
+
return /* @__PURE__ */ React78.createElement(Pressable, { "aria-haspopup": "true", isDisabled: props.disabled }, children);
|
|
7618
7826
|
};
|
|
7619
7827
|
DropdownMenu2.Trigger = MenuTrigger;
|
|
7620
7828
|
DropdownMenu2.Trigger.displayName = "DropdownMenu.Trigger";
|
|
@@ -7622,18 +7830,18 @@ var MenuItems = ({ children }) => {
|
|
|
7622
7830
|
const props = useContext7(MenuPropsContext);
|
|
7623
7831
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
7624
7832
|
const childrenWithIds = mapKeyToId(children);
|
|
7625
|
-
const baseContent = /* @__PURE__ */
|
|
7833
|
+
const baseContent = /* @__PURE__ */ React78.createElement(
|
|
7626
7834
|
DropdownMenu,
|
|
7627
7835
|
{
|
|
7628
7836
|
onAction: props.onAction,
|
|
7629
7837
|
onSelectionChange: props.onSelectionChange,
|
|
7630
7838
|
selectedKeys: props.selection,
|
|
7631
7839
|
selectionMode: props.selectionMode,
|
|
7632
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
7840
|
+
renderEmptyState: () => /* @__PURE__ */ React78.createElement(DropdownMenu.EmptyStateContainer, null, props.emptyState)
|
|
7633
7841
|
},
|
|
7634
7842
|
childrenWithIds
|
|
7635
7843
|
);
|
|
7636
|
-
return /* @__PURE__ */
|
|
7844
|
+
return /* @__PURE__ */ React78.createElement(Popover, { placement: props.placement }, /* @__PURE__ */ React78.createElement(
|
|
7637
7845
|
DropdownMenu.MenuContainer,
|
|
7638
7846
|
{
|
|
7639
7847
|
minHeight: props.minHeight,
|
|
@@ -7642,7 +7850,7 @@ var MenuItems = ({ children }) => {
|
|
|
7642
7850
|
maxWidth: props.maxWidth
|
|
7643
7851
|
},
|
|
7644
7852
|
props.header,
|
|
7645
|
-
/* @__PURE__ */
|
|
7853
|
+
/* @__PURE__ */ React78.createElement(DropdownMenu.ScrollableContentContainer, null, props.searchable && /* @__PURE__ */ React78.createElement(AriaAutocomplete2, { filter: contains }, /* @__PURE__ */ React78.createElement(SearchField, { "aria-label": "Search menu items", className: "mb-5" }), baseContent), !props.searchable && baseContent),
|
|
7646
7854
|
props.footer
|
|
7647
7855
|
));
|
|
7648
7856
|
};
|
|
@@ -7650,26 +7858,26 @@ DropdownMenu2.Items = MenuItems;
|
|
|
7650
7858
|
DropdownMenu2.Items.displayName = "DropdownMenu.Items";
|
|
7651
7859
|
var MenuItem = (props) => {
|
|
7652
7860
|
const textValue = props.textValue || (typeof props.children === "string" ? props.children : void 0);
|
|
7653
|
-
return /* @__PURE__ */
|
|
7861
|
+
return /* @__PURE__ */ React78.createElement(DropdownMenu.Item, { textValue, ...props });
|
|
7654
7862
|
};
|
|
7655
7863
|
DropdownMenu2.Item = MenuItem;
|
|
7656
7864
|
DropdownMenu2.Item.displayName = "DropdownMenu.Item";
|
|
7657
7865
|
var MenuSection = ({ children, ...props }) => {
|
|
7658
7866
|
const childrenWithIds = mapKeyToId(children);
|
|
7659
|
-
return /* @__PURE__ */
|
|
7867
|
+
return /* @__PURE__ */ React78.createElement(DropdownMenu.Group, { ...props }, childrenWithIds);
|
|
7660
7868
|
};
|
|
7661
7869
|
DropdownMenu2.Section = MenuSection;
|
|
7662
7870
|
DropdownMenu2.Section.displayName = "DropdownMenu.Section";
|
|
7663
7871
|
var mapKeyToId = (children) => {
|
|
7664
|
-
return
|
|
7872
|
+
return React78.Children.map(children, (child) => {
|
|
7665
7873
|
if (typeof child === "boolean" || child === null || child === void 0) {
|
|
7666
7874
|
return child;
|
|
7667
7875
|
}
|
|
7668
|
-
if (
|
|
7876
|
+
if (React78.isValidElement(child) && child.type === React78.Fragment) {
|
|
7669
7877
|
return mapKeyToId(child.props.children);
|
|
7670
7878
|
}
|
|
7671
7879
|
if (isComponentType(child, MenuItem)) {
|
|
7672
|
-
return
|
|
7880
|
+
return React78.cloneElement(child, { id: child.props.id ?? child.key ?? void 0 });
|
|
7673
7881
|
}
|
|
7674
7882
|
return child;
|
|
7675
7883
|
});
|
|
@@ -7698,14 +7906,14 @@ var DataListRowMenu = ({
|
|
|
7698
7906
|
return null;
|
|
7699
7907
|
}
|
|
7700
7908
|
const menuContent = isFunction(menu) ? menu(row, index) : menu;
|
|
7701
|
-
return /* @__PURE__ */
|
|
7909
|
+
return /* @__PURE__ */ React79.createElement(DataList.Cell, { align: "right" }, menuContent && /* @__PURE__ */ React79.createElement(
|
|
7702
7910
|
DropdownMenu2,
|
|
7703
7911
|
{
|
|
7704
7912
|
placement: defaultContextualMenuPlacement,
|
|
7705
7913
|
onAction: (action) => onAction?.(action, row, index),
|
|
7706
7914
|
onOpenChange: onMenuOpenChange
|
|
7707
7915
|
},
|
|
7708
|
-
/* @__PURE__ */
|
|
7916
|
+
/* @__PURE__ */ React79.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React79.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: more_default, disabled })),
|
|
7709
7917
|
menuContent
|
|
7710
7918
|
));
|
|
7711
7919
|
};
|
|
@@ -7734,7 +7942,7 @@ var DataListRow = ({
|
|
|
7734
7942
|
...resolvedAdditionalRowProps.style ?? {},
|
|
7735
7943
|
cursor: isRowClickable ? "pointer" : void 0
|
|
7736
7944
|
};
|
|
7737
|
-
return /* @__PURE__ */
|
|
7945
|
+
return /* @__PURE__ */ React79.createElement(
|
|
7738
7946
|
DataList.Row,
|
|
7739
7947
|
{
|
|
7740
7948
|
key: row.id,
|
|
@@ -7746,12 +7954,12 @@ var DataListRow = ({
|
|
|
7746
7954
|
onClick: isRowClickable ? onClick : void 0
|
|
7747
7955
|
},
|
|
7748
7956
|
renderFirstColumn?.(row, index, rows),
|
|
7749
|
-
/* @__PURE__ */
|
|
7957
|
+
/* @__PURE__ */ React79.createElement(
|
|
7750
7958
|
List,
|
|
7751
7959
|
{
|
|
7752
7960
|
items: columns,
|
|
7753
7961
|
renderItem: (column, columnIndex) => {
|
|
7754
|
-
const cell2 = /* @__PURE__ */
|
|
7962
|
+
const cell2 = /* @__PURE__ */ React79.createElement(
|
|
7755
7963
|
DataList.Cell,
|
|
7756
7964
|
{
|
|
7757
7965
|
key: column.key ?? column.headerName,
|
|
@@ -7759,7 +7967,7 @@ var DataListRow = ({
|
|
|
7759
7967
|
...additionalColumnProps(column, columnIndex, columns, row),
|
|
7760
7968
|
className: rowClassName?.(row, index, rows)
|
|
7761
7969
|
},
|
|
7762
|
-
/* @__PURE__ */
|
|
7970
|
+
/* @__PURE__ */ React79.createElement(DataListCell, { column, row, index, rows, disabled: isRowDisabled })
|
|
7763
7971
|
);
|
|
7764
7972
|
return createAnimatedCell({
|
|
7765
7973
|
cellElement: cell2,
|
|
@@ -7786,7 +7994,7 @@ var DataListCell = ({
|
|
|
7786
7994
|
case "status": {
|
|
7787
7995
|
const status = column.status(row, index, rows);
|
|
7788
7996
|
if (status) {
|
|
7789
|
-
cellContent = /* @__PURE__ */
|
|
7997
|
+
cellContent = /* @__PURE__ */ React79.createElement(StatusChip, { dense: true, ...status });
|
|
7790
7998
|
}
|
|
7791
7999
|
break;
|
|
7792
8000
|
}
|
|
@@ -7794,7 +8002,7 @@ var DataListCell = ({
|
|
|
7794
8002
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
|
7795
8003
|
if (action) {
|
|
7796
8004
|
const isActionDisabled = disabled || action.disabled;
|
|
7797
|
-
cellContent = /* @__PURE__ */
|
|
8005
|
+
cellContent = /* @__PURE__ */ React79.createElement(
|
|
7798
8006
|
Button2.Secondary,
|
|
7799
8007
|
{
|
|
7800
8008
|
dense: true,
|
|
@@ -7818,7 +8026,7 @@ var DataListCell = ({
|
|
|
7818
8026
|
case "item": {
|
|
7819
8027
|
const item = column.item(row, index, rows);
|
|
7820
8028
|
if (item) {
|
|
7821
|
-
cellContent = /* @__PURE__ */
|
|
8029
|
+
cellContent = /* @__PURE__ */ React79.createElement(Item3, { ...item });
|
|
7822
8030
|
}
|
|
7823
8031
|
break;
|
|
7824
8032
|
}
|
|
@@ -7827,13 +8035,13 @@ var DataListCell = ({
|
|
|
7827
8035
|
if (!menuContent) {
|
|
7828
8036
|
cellContent = null;
|
|
7829
8037
|
} else {
|
|
7830
|
-
cellContent = /* @__PURE__ */
|
|
8038
|
+
cellContent = /* @__PURE__ */ React79.createElement(
|
|
7831
8039
|
DropdownMenu2,
|
|
7832
8040
|
{
|
|
7833
8041
|
placement: defaultContextualMenuPlacement,
|
|
7834
8042
|
onAction: (action) => column.onAction(action, row, index)
|
|
7835
8043
|
},
|
|
7836
|
-
/* @__PURE__ */
|
|
8044
|
+
/* @__PURE__ */ React79.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React79.createElement(Button2.Icon, { "aria-label": "action", icon: more_default })),
|
|
7837
8045
|
menuContent
|
|
7838
8046
|
);
|
|
7839
8047
|
}
|
|
@@ -7847,7 +8055,7 @@ var DataListCell = ({
|
|
|
7847
8055
|
}
|
|
7848
8056
|
break;
|
|
7849
8057
|
}
|
|
7850
|
-
return column.tooltip ? /* @__PURE__ */
|
|
8058
|
+
return column.tooltip ? /* @__PURE__ */ React79.createElement(Tooltip, { ...column.tooltip(row, index, rows) }, cellContent) : /* @__PURE__ */ React79.createElement(React79.Fragment, null, cellContent);
|
|
7851
8059
|
};
|
|
7852
8060
|
|
|
7853
8061
|
// src/molecules/DataList/DataListContext.tsx
|
|
@@ -7866,7 +8074,7 @@ var useDataListContext = () => {
|
|
|
7866
8074
|
};
|
|
7867
8075
|
|
|
7868
8076
|
// src/molecules/DataList/DataListGroup.tsx
|
|
7869
|
-
import
|
|
8077
|
+
import React80 from "react";
|
|
7870
8078
|
import { isFunction as isFunction2, noop } from "lodash-es";
|
|
7871
8079
|
|
|
7872
8080
|
// src/molecules/DataList/utils.ts
|
|
@@ -7878,8 +8086,8 @@ var INDENTATION = 28;
|
|
|
7878
8086
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
|
7879
8087
|
var getDefaultRowSelectionLabel = () => "Select row";
|
|
7880
8088
|
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
|
7881
|
-
var renderDefaultGroupName = (key) => /* @__PURE__ */
|
|
7882
|
-
var renderDefaultEmptyGroup = () => /* @__PURE__ */
|
|
8089
|
+
var renderDefaultGroupName = (key) => /* @__PURE__ */ React80.createElement(React80.Fragment, null, "Group: ", /* @__PURE__ */ React80.createElement("b", null, key));
|
|
8090
|
+
var renderDefaultEmptyGroup = () => /* @__PURE__ */ React80.createElement(DataList.EmptyGroup, { icon: infoSign_default }, "This group is empty");
|
|
7883
8091
|
var DataListGroup = ({
|
|
7884
8092
|
groups,
|
|
7885
8093
|
groupKey,
|
|
@@ -7917,15 +8125,15 @@ var DataListGroup = ({
|
|
|
7917
8125
|
if (!emptyGroupContent) {
|
|
7918
8126
|
return null;
|
|
7919
8127
|
}
|
|
7920
|
-
return /* @__PURE__ */
|
|
8128
|
+
return /* @__PURE__ */ React80.createElement(DataList.Row, { noDivider: isLastGroup }, selectable && /* @__PURE__ */ React80.createElement(DataList.Cell, null), /* @__PURE__ */ React80.createElement(
|
|
7921
8129
|
DataList.Cell,
|
|
7922
8130
|
{
|
|
7923
8131
|
style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
|
7924
8132
|
},
|
|
7925
|
-
/* @__PURE__ */
|
|
8133
|
+
/* @__PURE__ */ React80.createElement(Typography, { variant: "default", color: "muted" }, emptyGroupContent)
|
|
7926
8134
|
));
|
|
7927
8135
|
}
|
|
7928
|
-
return /* @__PURE__ */
|
|
8136
|
+
return /* @__PURE__ */ React80.createElement(
|
|
7929
8137
|
List,
|
|
7930
8138
|
{
|
|
7931
8139
|
items: groups,
|
|
@@ -7934,7 +8142,7 @@ var DataListGroup = ({
|
|
|
7934
8142
|
const isDisabled = disabled?.(row, index, rows);
|
|
7935
8143
|
const isSelectionDisabled = selectionDisabled(row, index, rows);
|
|
7936
8144
|
const isLastRow = isLastGroup && index === groups.length - 1;
|
|
7937
|
-
return /* @__PURE__ */
|
|
8145
|
+
return /* @__PURE__ */ React80.createElement(
|
|
7938
8146
|
DataListRow,
|
|
7939
8147
|
{
|
|
7940
8148
|
key: row.id,
|
|
@@ -7944,7 +8152,7 @@ var DataListGroup = ({
|
|
|
7944
8152
|
isLast: isLastRow,
|
|
7945
8153
|
rows,
|
|
7946
8154
|
active: selectable && isSelected,
|
|
7947
|
-
menu: /* @__PURE__ */
|
|
8155
|
+
menu: /* @__PURE__ */ React80.createElement(
|
|
7948
8156
|
DataListRowMenu,
|
|
7949
8157
|
{
|
|
7950
8158
|
row,
|
|
@@ -7967,7 +8175,7 @@ var DataListGroup = ({
|
|
|
7967
8175
|
}
|
|
7968
8176
|
} : {},
|
|
7969
8177
|
renderFirstColumn: (row2, index2) => {
|
|
7970
|
-
return /* @__PURE__ */
|
|
8178
|
+
return /* @__PURE__ */ React80.createElement(React80.Fragment, null, selectable && /* @__PURE__ */ React80.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React80.createElement(
|
|
7971
8179
|
RadioButton,
|
|
7972
8180
|
{
|
|
7973
8181
|
value: row2.id.toString(),
|
|
@@ -7976,7 +8184,7 @@ var DataListGroup = ({
|
|
|
7976
8184
|
checked: isSelected,
|
|
7977
8185
|
disabled: isDisabled || isSelectionDisabled
|
|
7978
8186
|
}
|
|
7979
|
-
), isMultiSelectionMode && /* @__PURE__ */
|
|
8187
|
+
), isMultiSelectionMode && /* @__PURE__ */ React80.createElement(
|
|
7980
8188
|
Checkbox,
|
|
7981
8189
|
{
|
|
7982
8190
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
|
@@ -7996,14 +8204,14 @@ var DataListGroup = ({
|
|
|
7996
8204
|
if (!groupKeys) {
|
|
7997
8205
|
return null;
|
|
7998
8206
|
}
|
|
7999
|
-
return /* @__PURE__ */
|
|
8207
|
+
return /* @__PURE__ */ React80.createElement(
|
|
8000
8208
|
List,
|
|
8001
8209
|
{
|
|
8002
8210
|
items: sortGroupKeys(groupKeys),
|
|
8003
8211
|
renderItem: (key, index) => {
|
|
8004
8212
|
const group = groups[key];
|
|
8005
8213
|
if (key === "undefined" || key === void 0) {
|
|
8006
|
-
return /* @__PURE__ */
|
|
8214
|
+
return /* @__PURE__ */ React80.createElement(
|
|
8007
8215
|
DataListGroup,
|
|
8008
8216
|
{
|
|
8009
8217
|
key: "undefined",
|
|
@@ -8022,7 +8230,7 @@ var DataListGroup = ({
|
|
|
8022
8230
|
const isChecked = nestedSelectedIds.length > 0;
|
|
8023
8231
|
const isActiveRow = !!openPanelId || selectable && isChecked;
|
|
8024
8232
|
const isLastRow = isLastGroup && index === groupKeys.length - 1 && !openPanelId;
|
|
8025
|
-
return /* @__PURE__ */
|
|
8233
|
+
return /* @__PURE__ */ React80.createElement(Accordion, { key, openPanelId }, hasCustomRowForGroup && /* @__PURE__ */ React80.createElement(DataList.Row, { active: isActiveRow, noDivider: isLastRow }, selectable && /* @__PURE__ */ React80.createElement(DataList.Cell, null, isMultiSelectionMode && /* @__PURE__ */ React80.createElement(
|
|
8026
8234
|
Checkbox,
|
|
8027
8235
|
{
|
|
8028
8236
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
|
@@ -8031,11 +8239,11 @@ var DataListGroup = ({
|
|
|
8031
8239
|
disabled: group.length === 0,
|
|
8032
8240
|
onChange: getOnSelectionChangeForId(nestedRowIds)
|
|
8033
8241
|
}
|
|
8034
|
-
)), /* @__PURE__ */
|
|
8242
|
+
)), /* @__PURE__ */ React80.createElement(
|
|
8035
8243
|
List,
|
|
8036
8244
|
{
|
|
8037
8245
|
items: columns,
|
|
8038
|
-
renderItem: (column, idx) => /* @__PURE__ */
|
|
8246
|
+
renderItem: (column, idx) => /* @__PURE__ */ React80.createElement(
|
|
8039
8247
|
DataList.Cell,
|
|
8040
8248
|
{
|
|
8041
8249
|
key: column.key ?? column.headerName,
|
|
@@ -8043,11 +8251,11 @@ var DataListGroup = ({
|
|
|
8043
8251
|
className: "gap-3",
|
|
8044
8252
|
style: idx === 0 ? { paddingLeft: `${GAP + level * INDENTATION}px` } : void 0
|
|
8045
8253
|
},
|
|
8046
|
-
idx === 0 && /* @__PURE__ */
|
|
8047
|
-
/* @__PURE__ */
|
|
8254
|
+
idx === 0 && /* @__PURE__ */ React80.createElement(Accordion.Toggle, { panelId: key, onChange: onGroupToggled }),
|
|
8255
|
+
/* @__PURE__ */ React80.createElement(DataListCell, { column, row: getGroupRow(key, group), index: -1, rows: [] })
|
|
8048
8256
|
)
|
|
8049
8257
|
}
|
|
8050
|
-
), /* @__PURE__ */
|
|
8258
|
+
), /* @__PURE__ */ React80.createElement(
|
|
8051
8259
|
DataListRowMenu,
|
|
8052
8260
|
{
|
|
8053
8261
|
row: getGroupRow(key, group),
|
|
@@ -8057,7 +8265,7 @@ var DataListGroup = ({
|
|
|
8057
8265
|
onMenuOpenChange,
|
|
8058
8266
|
menuAriaLabel
|
|
8059
8267
|
}
|
|
8060
|
-
)), !hasCustomRowForGroup && /* @__PURE__ */
|
|
8268
|
+
)), !hasCustomRowForGroup && /* @__PURE__ */ React80.createElement(DataList.Row, { active: isActiveRow, noDivider: isLastRow }, isMultiSelectionMode && /* @__PURE__ */ React80.createElement(DataList.Cell, null, /* @__PURE__ */ React80.createElement(
|
|
8061
8269
|
Checkbox,
|
|
8062
8270
|
{
|
|
8063
8271
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
|
@@ -8066,15 +8274,15 @@ var DataListGroup = ({
|
|
|
8066
8274
|
disabled: group.length === 0,
|
|
8067
8275
|
onChange: getOnSelectionChangeForId(nestedRowIds)
|
|
8068
8276
|
}
|
|
8069
|
-
)), /* @__PURE__ */
|
|
8277
|
+
)), /* @__PURE__ */ React80.createElement(
|
|
8070
8278
|
DataList.Cell,
|
|
8071
8279
|
{
|
|
8072
8280
|
className: "gap-2",
|
|
8073
8281
|
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
|
8074
8282
|
},
|
|
8075
|
-
/* @__PURE__ */
|
|
8283
|
+
/* @__PURE__ */ React80.createElement(Accordion.Toggle, { panelId: key, onChange: onGroupToggled }),
|
|
8076
8284
|
renderGroupName(key, group)
|
|
8077
|
-
)), /* @__PURE__ */
|
|
8285
|
+
)), /* @__PURE__ */ React80.createElement(Accordion.UnanimatedPanel, { panelId: key }, /* @__PURE__ */ React80.createElement(DataList.Row, { isGroup: true }, /* @__PURE__ */ React80.createElement(
|
|
8078
8286
|
DataListGroup,
|
|
8079
8287
|
{
|
|
8080
8288
|
key,
|
|
@@ -8091,18 +8299,18 @@ var DataListGroup = ({
|
|
|
8091
8299
|
};
|
|
8092
8300
|
|
|
8093
8301
|
// src/molecules/DataList/DataListSkeleton.tsx
|
|
8094
|
-
import
|
|
8302
|
+
import React81 from "react";
|
|
8095
8303
|
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
8096
8304
|
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
|
8097
|
-
return /* @__PURE__ */
|
|
8305
|
+
return /* @__PURE__ */ React81.createElement(Template, { role: "table", columns }, /* @__PURE__ */ React81.createElement(DataList.Row, null, columnsAmount.map((_, index) => /* @__PURE__ */ React81.createElement(DataList.HeadCell, { key: index }, /* @__PURE__ */ React81.createElement(Skeleton, { width: "100%", height: 17.5 })))), /* @__PURE__ */ React81.createElement(
|
|
8098
8306
|
List,
|
|
8099
8307
|
{
|
|
8100
8308
|
items: [...Array(rows).keys()],
|
|
8101
|
-
renderItem: (item, index) => /* @__PURE__ */
|
|
8309
|
+
renderItem: (item, index) => /* @__PURE__ */ React81.createElement(DataList.Row, { key: item, noDivider: index === rows - 1 }, /* @__PURE__ */ React81.createElement(
|
|
8102
8310
|
List,
|
|
8103
8311
|
{
|
|
8104
8312
|
items: columnsAmount,
|
|
8105
|
-
renderItem: (key) => /* @__PURE__ */
|
|
8313
|
+
renderItem: (key) => /* @__PURE__ */ React81.createElement(DataList.Cell, { key }, /* @__PURE__ */ React81.createElement(Skeleton, { width: "100%", height: 17.5 }))
|
|
8106
8314
|
}
|
|
8107
8315
|
))
|
|
8108
8316
|
}
|
|
@@ -8110,7 +8318,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
|
8110
8318
|
};
|
|
8111
8319
|
|
|
8112
8320
|
// src/molecules/DataList/DataListToolbar.tsx
|
|
8113
|
-
import
|
|
8321
|
+
import React82 from "react";
|
|
8114
8322
|
import { castArray as castArray2 } from "lodash-es";
|
|
8115
8323
|
var DataListToolbar = ({
|
|
8116
8324
|
actions: _actions,
|
|
@@ -8124,7 +8332,7 @@ var DataListToolbar = ({
|
|
|
8124
8332
|
const actions2 = castArray2(_actions).filter(Boolean);
|
|
8125
8333
|
const noRowsSelected = (selectedRows?.length ?? 0) === 0;
|
|
8126
8334
|
const disableToolbarActions = selectable && noRowsSelected;
|
|
8127
|
-
return /* @__PURE__ */
|
|
8335
|
+
return /* @__PURE__ */ React82.createElement(DataList.Toolbar.Container, { sticky }, /* @__PURE__ */ React82.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React82.createElement(DataList.Toolbar.SelectionCount, null, selectedRows?.length ?? 0, " selected")), actions2.length > 0 && /* @__PURE__ */ React82.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React82.createElement(DataList.Toolbar.Actions, null, actions2.map(
|
|
8128
8336
|
(action) => renderAction({
|
|
8129
8337
|
kind: "ghost",
|
|
8130
8338
|
dense: true,
|
|
@@ -8134,14 +8342,14 @@ var DataListToolbar = ({
|
|
|
8134
8342
|
onClick: () => action.onClick(selectedRows ?? [])
|
|
8135
8343
|
}
|
|
8136
8344
|
})
|
|
8137
|
-
))), menu && /* @__PURE__ */
|
|
8345
|
+
))), menu && /* @__PURE__ */ React82.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React82.createElement(
|
|
8138
8346
|
DropdownMenu2,
|
|
8139
8347
|
{
|
|
8140
8348
|
placement: defaultContextualMenuPlacement,
|
|
8141
8349
|
onAction: (key) => onAction(key, selectedRows ?? []),
|
|
8142
8350
|
onOpenChange: onMenuOpenChange
|
|
8143
8351
|
},
|
|
8144
|
-
/* @__PURE__ */
|
|
8352
|
+
/* @__PURE__ */ React82.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React82.createElement(Button2.Dropdown, { kind: "ghost", dense: true, disabled: disableToolbarActions }, menuLabel)),
|
|
8145
8353
|
menu
|
|
8146
8354
|
)));
|
|
8147
8355
|
};
|
|
@@ -8180,7 +8388,7 @@ var DataList2 = ({
|
|
|
8180
8388
|
["aria-label"]: ariaLabel,
|
|
8181
8389
|
...rest
|
|
8182
8390
|
}) => {
|
|
8183
|
-
const containerRef =
|
|
8391
|
+
const containerRef = useRef11(null);
|
|
8184
8392
|
const hasStickyColumns = columns.some((column) => column.sticky);
|
|
8185
8393
|
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
|
8186
8394
|
const [selected, setSelected] = useControlledState3(
|
|
@@ -8209,8 +8417,8 @@ var DataList2 = ({
|
|
|
8209
8417
|
...columns.map((column) => column.width ?? "auto"),
|
|
8210
8418
|
menu ? "fit-content(28px)" : void 0
|
|
8211
8419
|
]);
|
|
8212
|
-
const PaginationFooter =
|
|
8213
|
-
({ children }) => /* @__PURE__ */
|
|
8420
|
+
const PaginationFooter = React83.useCallback(
|
|
8421
|
+
({ children }) => /* @__PURE__ */ React83.createElement("div", { style: { gridColumn: "1 / -1" }, role: "row" }, /* @__PURE__ */ React83.createElement("div", { role: "cell" }, children)),
|
|
8214
8422
|
[]
|
|
8215
8423
|
);
|
|
8216
8424
|
const getOnSelectionChangeForId = (id) => (e) => {
|
|
@@ -8232,7 +8440,7 @@ var DataList2 = ({
|
|
|
8232
8440
|
)
|
|
8233
8441
|
);
|
|
8234
8442
|
const allRowsSelected = totalSelected >= allEnabledRowIds.length;
|
|
8235
|
-
const componentContent = /* @__PURE__ */
|
|
8443
|
+
const componentContent = /* @__PURE__ */ React83.createElement(Template, { className: "Aquarium-DataList", columns: templateColumns, role: "table", "aria-label": ariaLabel }, !hideHeader && /* @__PURE__ */ React83.createElement(React83.Fragment, null, /* @__PURE__ */ React83.createElement(DataList.Row, { header: true }, selectable && /* @__PURE__ */ React83.createElement(DataList.HeadCell, { align: "left", sticky }, selectable === "multiple" && /* @__PURE__ */ React83.createElement(
|
|
8236
8444
|
Checkbox,
|
|
8237
8445
|
{
|
|
8238
8446
|
"aria-label": "Select all rows",
|
|
@@ -8246,10 +8454,10 @@ var DataList2 = ({
|
|
|
8246
8454
|
}
|
|
8247
8455
|
}
|
|
8248
8456
|
}
|
|
8249
|
-
)), isCollapsible && /* @__PURE__ */
|
|
8250
|
-
const content = column.headerTooltip ? /* @__PURE__ */
|
|
8251
|
-
const headerContentAndIcon = column.icon ? /* @__PURE__ */
|
|
8252
|
-
const cell2 = columnHasSort(column) ? /* @__PURE__ */
|
|
8457
|
+
)), isCollapsible && /* @__PURE__ */ React83.createElement(DataList.HeadCell, { align: "left", sticky }), columns.map((column) => {
|
|
8458
|
+
const content = column.headerTooltip ? /* @__PURE__ */ React83.createElement(Tooltip, { placement: column.headerTooltip.placement, content: column.headerTooltip.content }, column.headerName) : column.headerName;
|
|
8459
|
+
const headerContentAndIcon = column.icon ? /* @__PURE__ */ React83.createElement(Box.Flex, { flexDirection: "row", gap: "2", alignItems: "center" }, /* @__PURE__ */ React83.createElement(InlineIcon, { icon: column.icon, width: 18, height: 18, color: "muted", "aria-hidden": true }), content) : content;
|
|
8460
|
+
const cell2 = columnHasSort(column) ? /* @__PURE__ */ React83.createElement(
|
|
8253
8461
|
DataList.SortCell,
|
|
8254
8462
|
{
|
|
8255
8463
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
|
@@ -8259,13 +8467,13 @@ var DataList2 = ({
|
|
|
8259
8467
|
...cellProps(column)
|
|
8260
8468
|
},
|
|
8261
8469
|
headerContentAndIcon
|
|
8262
|
-
) : /* @__PURE__ */
|
|
8470
|
+
) : /* @__PURE__ */ React83.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, headerContentAndIcon);
|
|
8263
8471
|
return createAnimatedCell({
|
|
8264
8472
|
cellElement: cell2,
|
|
8265
8473
|
stickyStyles,
|
|
8266
8474
|
stickyColumn: cellProps(column).stickyColumn
|
|
8267
8475
|
});
|
|
8268
|
-
}), menu && /* @__PURE__ */
|
|
8476
|
+
}), menu && /* @__PURE__ */ React83.createElement(DataList.HeadCell, { align: "right", "aria-label": menuAriaLabel, sticky }, menuHeaderName)), toolbar), groups && /* @__PURE__ */ React83.createElement(
|
|
8269
8477
|
DataListGroup,
|
|
8270
8478
|
{
|
|
8271
8479
|
columns,
|
|
@@ -8292,7 +8500,7 @@ var DataList2 = ({
|
|
|
8292
8500
|
level: 0,
|
|
8293
8501
|
isLastGroup: true
|
|
8294
8502
|
}
|
|
8295
|
-
), !groups && /* @__PURE__ */
|
|
8503
|
+
), !groups && /* @__PURE__ */ React83.createElement(
|
|
8296
8504
|
List,
|
|
8297
8505
|
{
|
|
8298
8506
|
...rest,
|
|
@@ -8305,7 +8513,7 @@ var DataList2 = ({
|
|
|
8305
8513
|
const isDisabled = disabled?.(row, index, sortedRows);
|
|
8306
8514
|
const openPanelId = expandedGroupIds.find((id) => id === row.id.toString()) || null;
|
|
8307
8515
|
const isLastRow = index === sortedRows.length - 1;
|
|
8308
|
-
const content = /* @__PURE__ */
|
|
8516
|
+
const content = /* @__PURE__ */ React83.createElement(
|
|
8309
8517
|
DataListRow,
|
|
8310
8518
|
{
|
|
8311
8519
|
key: row.id,
|
|
@@ -8316,7 +8524,7 @@ var DataList2 = ({
|
|
|
8316
8524
|
active: !!openPanelId || selectable && isSelected,
|
|
8317
8525
|
isLast: isLastRow && !openPanelId,
|
|
8318
8526
|
stickyStyles,
|
|
8319
|
-
menu: /* @__PURE__ */
|
|
8527
|
+
menu: /* @__PURE__ */ React83.createElement(
|
|
8320
8528
|
DataListRowMenu,
|
|
8321
8529
|
{
|
|
8322
8530
|
row,
|
|
@@ -8335,7 +8543,7 @@ var DataList2 = ({
|
|
|
8335
8543
|
"aria-selected": selected?.includes(row2.id) ?? false
|
|
8336
8544
|
} : {},
|
|
8337
8545
|
renderFirstColumn: (row2, index2) => {
|
|
8338
|
-
return /* @__PURE__ */
|
|
8546
|
+
return /* @__PURE__ */ React83.createElement(React83.Fragment, null, selectable && /* @__PURE__ */ React83.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React83.createElement(
|
|
8339
8547
|
RadioButton,
|
|
8340
8548
|
{
|
|
8341
8549
|
value: row2.id.toString(),
|
|
@@ -8344,7 +8552,7 @@ var DataList2 = ({
|
|
|
8344
8552
|
checked: isSelected,
|
|
8345
8553
|
disabled: isDisabled || isSelectionDisabled
|
|
8346
8554
|
}
|
|
8347
|
-
), isMultiSelectionMode && /* @__PURE__ */
|
|
8555
|
+
), isMultiSelectionMode && /* @__PURE__ */ React83.createElement(
|
|
8348
8556
|
Checkbox,
|
|
8349
8557
|
{
|
|
8350
8558
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
|
@@ -8352,7 +8560,7 @@ var DataList2 = ({
|
|
|
8352
8560
|
checked: isSelected,
|
|
8353
8561
|
disabled: isDisabled || isSelectionDisabled
|
|
8354
8562
|
}
|
|
8355
|
-
)), rowDetails !== void 0 && /* @__PURE__ */
|
|
8563
|
+
)), rowDetails !== void 0 && /* @__PURE__ */ React83.createElement(DataList.Cell, null, details && /* @__PURE__ */ React83.createElement(Accordion.Toggle, { panelId: row2.id.toString(), onChange: onGroupToggled })));
|
|
8356
8564
|
},
|
|
8357
8565
|
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
|
8358
8566
|
}
|
|
@@ -8360,7 +8568,7 @@ var DataList2 = ({
|
|
|
8360
8568
|
if (!details) {
|
|
8361
8569
|
return content;
|
|
8362
8570
|
}
|
|
8363
|
-
return /* @__PURE__ */
|
|
8571
|
+
return /* @__PURE__ */ React83.createElement(Accordion, { key: row.id, openPanelId }, content, /* @__PURE__ */ React83.createElement(
|
|
8364
8572
|
Accordion.Panel,
|
|
8365
8573
|
{
|
|
8366
8574
|
role: "row",
|
|
@@ -8371,13 +8579,13 @@ var DataList2 = ({
|
|
|
8371
8579
|
}),
|
|
8372
8580
|
"aria-label": `row ${row.id.toString()} details`
|
|
8373
8581
|
},
|
|
8374
|
-
/* @__PURE__ */
|
|
8582
|
+
/* @__PURE__ */ React83.createElement("div", { role: "cell" }, details)
|
|
8375
8583
|
));
|
|
8376
8584
|
}
|
|
8377
8585
|
}
|
|
8378
8586
|
));
|
|
8379
|
-
const wrappedContent = hasStickyColumns ? /* @__PURE__ */
|
|
8380
|
-
return /* @__PURE__ */
|
|
8587
|
+
const wrappedContent = hasStickyColumns ? /* @__PURE__ */ React83.createElement("div", { className: "relative w-full h-full overflow-auto", ref: containerRef }, componentContent) : componentContent;
|
|
8588
|
+
return /* @__PURE__ */ React83.createElement(
|
|
8381
8589
|
DataListContext.Provider,
|
|
8382
8590
|
{
|
|
8383
8591
|
value: {
|
|
@@ -8393,18 +8601,18 @@ DataList2.Skeleton = DataListSkeleton;
|
|
|
8393
8601
|
DataList2.Toolbar = DataListToolbar;
|
|
8394
8602
|
|
|
8395
8603
|
// src/molecules/DataTable/DataTable.tsx
|
|
8396
|
-
import
|
|
8604
|
+
import React86, { useRef as useRef12 } from "react";
|
|
8397
8605
|
import { clsx as clsx27 } from "clsx";
|
|
8398
8606
|
import { compact as compact2, isFunction as isFunction4 } from "lodash-es";
|
|
8399
8607
|
|
|
8400
8608
|
// src/molecules/Table/Table.tsx
|
|
8401
|
-
import
|
|
8609
|
+
import React85 from "react";
|
|
8402
8610
|
|
|
8403
8611
|
// src/utils/table/useScrollTarget.ts
|
|
8404
|
-
import
|
|
8612
|
+
import React84 from "react";
|
|
8405
8613
|
var useScrollTarget = (callback) => {
|
|
8406
|
-
const targetRef =
|
|
8407
|
-
|
|
8614
|
+
const targetRef = React84.useRef(null);
|
|
8615
|
+
React84.useLayoutEffect(() => {
|
|
8408
8616
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
|
8409
8617
|
root: null,
|
|
8410
8618
|
rootMargin: `0px 0px 200px 0px`
|
|
@@ -8421,7 +8629,7 @@ var useScrollTarget = (callback) => {
|
|
|
8421
8629
|
var Table2 = ({ children, onPrev, onNext, ...rest }) => {
|
|
8422
8630
|
const bottomRef = useScrollTarget(onNext);
|
|
8423
8631
|
const topRef = useScrollTarget(onPrev);
|
|
8424
|
-
return /* @__PURE__ */
|
|
8632
|
+
return /* @__PURE__ */ React85.createElement("div", { className: "Aquarium-Table relative w-full" }, /* @__PURE__ */ React85.createElement("div", { ref: topRef, className: "absolute top-0 h-1 w-full left-0 bg-transparent" }), /* @__PURE__ */ React85.createElement(Table, { ...rest }, children), /* @__PURE__ */ React85.createElement("div", { ref: bottomRef, className: "absolute bottom-0 h-1 w-full left-0 bg-transparent" }));
|
|
8425
8633
|
};
|
|
8426
8634
|
Table2.Head = Table.Head;
|
|
8427
8635
|
Table2.Body = Table.Body;
|
|
@@ -8452,7 +8660,7 @@ var DataTable = ({
|
|
|
8452
8660
|
onPrev,
|
|
8453
8661
|
...rest
|
|
8454
8662
|
}) => {
|
|
8455
|
-
const containerRef =
|
|
8663
|
+
const containerRef = useRef12(null);
|
|
8456
8664
|
const hasStickyColumns = columns.some((column) => column.sticky);
|
|
8457
8665
|
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
|
8458
8666
|
const defaultSortedColumn = columns.find((c) => c.headerName === defaultSort?.headerName);
|
|
@@ -8460,11 +8668,11 @@ var DataTable = ({
|
|
|
8460
8668
|
const [sort, updateSort] = useTableSort({ ...initialSortState, onSortChanged });
|
|
8461
8669
|
const sortedRows = sortRowsBy(rows, sort);
|
|
8462
8670
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
|
8463
|
-
const PaginationFooter =
|
|
8464
|
-
({ children }) => /* @__PURE__ */
|
|
8671
|
+
const PaginationFooter = React86.useCallback(
|
|
8672
|
+
({ children }) => /* @__PURE__ */ React86.createElement("tfoot", null, /* @__PURE__ */ React86.createElement("tr", null, /* @__PURE__ */ React86.createElement("td", { colSpan: amountOfColumns }, children))),
|
|
8465
8673
|
[amountOfColumns]
|
|
8466
8674
|
);
|
|
8467
|
-
const compponentContent = /* @__PURE__ */
|
|
8675
|
+
const compponentContent = /* @__PURE__ */ React86.createElement(
|
|
8468
8676
|
Table2,
|
|
8469
8677
|
{
|
|
8470
8678
|
ariaLabel,
|
|
@@ -8476,11 +8684,11 @@ var DataTable = ({
|
|
|
8476
8684
|
"table-fixed": layout === "fixed"
|
|
8477
8685
|
})
|
|
8478
8686
|
},
|
|
8479
|
-
/* @__PURE__ */
|
|
8687
|
+
/* @__PURE__ */ React86.createElement(Table2.Head, { sticky }, compact2([
|
|
8480
8688
|
...columns.map((column) => {
|
|
8481
|
-
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */
|
|
8482
|
-
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */
|
|
8483
|
-
const cell2 = columnHasSort(column) ? /* @__PURE__ */
|
|
8689
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ React86.createElement(Tooltip, { placement: column.headerTooltip.placement, content: column.headerTooltip.content }, column.headerName) : !column.headerInvisible && column.headerName;
|
|
8690
|
+
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */ React86.createElement(Box.Flex, { flexDirection: "row", gap: "3", alignItems: "center" }, /* @__PURE__ */ React86.createElement(InlineIcon, { icon: column.icon, height: "22", color: "default", "aria-hidden": true }), content) : content;
|
|
8691
|
+
const cell2 = columnHasSort(column) ? /* @__PURE__ */ React86.createElement(
|
|
8484
8692
|
Table2.SortCell,
|
|
8485
8693
|
{
|
|
8486
8694
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
|
@@ -8491,7 +8699,7 @@ var DataTable = ({
|
|
|
8491
8699
|
...cellProps(column)
|
|
8492
8700
|
},
|
|
8493
8701
|
headerContentAndIcon
|
|
8494
|
-
) : /* @__PURE__ */
|
|
8702
|
+
) : /* @__PURE__ */ React86.createElement(
|
|
8495
8703
|
Table2.Cell,
|
|
8496
8704
|
{
|
|
8497
8705
|
key: column.key ?? column.headerName,
|
|
@@ -8507,9 +8715,9 @@ var DataTable = ({
|
|
|
8507
8715
|
stickyColumn: cellProps(column).stickyColumn
|
|
8508
8716
|
});
|
|
8509
8717
|
}),
|
|
8510
|
-
menu ? /* @__PURE__ */
|
|
8718
|
+
menu ? /* @__PURE__ */ React86.createElement(Table2.Cell, { key: "__contextMenu", align: "right", "aria-label": menuAriaLabel }, menuHeaderName) : null
|
|
8511
8719
|
])),
|
|
8512
|
-
/* @__PURE__ */
|
|
8720
|
+
/* @__PURE__ */ React86.createElement(
|
|
8513
8721
|
List,
|
|
8514
8722
|
{
|
|
8515
8723
|
container: Table2.Body,
|
|
@@ -8518,13 +8726,13 @@ var DataTable = ({
|
|
|
8518
8726
|
items: sortedRows,
|
|
8519
8727
|
renderItem: (row, index) => {
|
|
8520
8728
|
const isRowDisabled = disabled?.(row, index, sortedRows) ?? false;
|
|
8521
|
-
return /* @__PURE__ */
|
|
8729
|
+
return /* @__PURE__ */ React86.createElement(Table2.Row, { key: row.id, disabled: isRowDisabled }, /* @__PURE__ */ React86.createElement(
|
|
8522
8730
|
List,
|
|
8523
8731
|
{
|
|
8524
8732
|
items: columns,
|
|
8525
8733
|
renderItem: (column) => {
|
|
8526
8734
|
return createAnimatedCell({
|
|
8527
|
-
cellElement: /* @__PURE__ */
|
|
8735
|
+
cellElement: /* @__PURE__ */ React86.createElement(
|
|
8528
8736
|
Table2.Cell,
|
|
8529
8737
|
{
|
|
8530
8738
|
key: column.key ?? column.headerName,
|
|
@@ -8543,7 +8751,7 @@ var DataTable = ({
|
|
|
8543
8751
|
}
|
|
8544
8752
|
)
|
|
8545
8753
|
);
|
|
8546
|
-
return hasStickyColumns ? /* @__PURE__ */
|
|
8754
|
+
return hasStickyColumns ? /* @__PURE__ */ React86.createElement("div", { className: "relative w-full overflow-x-auto", ref: containerRef }, compponentContent) : compponentContent;
|
|
8547
8755
|
};
|
|
8548
8756
|
var renderRowMenu = (row, index, {
|
|
8549
8757
|
menu,
|
|
@@ -8553,14 +8761,14 @@ var renderRowMenu = (row, index, {
|
|
|
8553
8761
|
}) => {
|
|
8554
8762
|
if (menu) {
|
|
8555
8763
|
const menuContent = isFunction4(menu) ? menu(row, index) : menu;
|
|
8556
|
-
return /* @__PURE__ */
|
|
8764
|
+
return /* @__PURE__ */ React86.createElement(Table2.Cell, { align: "right" }, menuContent && /* @__PURE__ */ React86.createElement(
|
|
8557
8765
|
DropdownMenu2,
|
|
8558
8766
|
{
|
|
8559
8767
|
placement: defaultContextualMenuPlacement,
|
|
8560
8768
|
onAction: (action) => onAction?.(action, row, index),
|
|
8561
8769
|
onOpenChange: onMenuOpenChange
|
|
8562
8770
|
},
|
|
8563
|
-
/* @__PURE__ */
|
|
8771
|
+
/* @__PURE__ */ React86.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React86.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: more_default })),
|
|
8564
8772
|
menuContent
|
|
8565
8773
|
));
|
|
8566
8774
|
}
|
|
@@ -8572,31 +8780,31 @@ var renderCell = (column, row, index, rows) => {
|
|
|
8572
8780
|
if (column.type === "status") {
|
|
8573
8781
|
const status = column.status(row, index, rows);
|
|
8574
8782
|
if (status) {
|
|
8575
|
-
cellContent = /* @__PURE__ */
|
|
8783
|
+
cellContent = /* @__PURE__ */ React86.createElement(StatusChip, { dense: true, ...status });
|
|
8576
8784
|
}
|
|
8577
8785
|
} else if (column.type === "action") {
|
|
8578
8786
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
|
8579
8787
|
if (action) {
|
|
8580
|
-
cellContent = /* @__PURE__ */
|
|
8788
|
+
cellContent = /* @__PURE__ */ React86.createElement(Button2.Secondary, { dense: true, ...action });
|
|
8581
8789
|
}
|
|
8582
8790
|
} else if (column.type === "custom") {
|
|
8583
8791
|
cellContent = column.UNSAFE_render(row, index, rows);
|
|
8584
8792
|
} else if (column.type === "item") {
|
|
8585
8793
|
const item = column.item(row, index, rows);
|
|
8586
8794
|
if (item) {
|
|
8587
|
-
cellContent = /* @__PURE__ */
|
|
8795
|
+
cellContent = /* @__PURE__ */ React86.createElement(Item3, { ...item });
|
|
8588
8796
|
}
|
|
8589
8797
|
} else if (column.formatter) {
|
|
8590
8798
|
cellContent = column.formatter(row[column.field], row, index, rows);
|
|
8591
8799
|
} else {
|
|
8592
8800
|
cellContent = row[column.field];
|
|
8593
8801
|
}
|
|
8594
|
-
return column.tooltip ? /* @__PURE__ */
|
|
8802
|
+
return column.tooltip ? /* @__PURE__ */ React86.createElement(Tooltip, { ...column.tooltip(row, index, rows) }, cellContent) : /* @__PURE__ */ React86.createElement(React86.Fragment, null, cellContent);
|
|
8595
8803
|
};
|
|
8596
8804
|
DataTable.Skeleton = DataListSkeleton;
|
|
8597
8805
|
|
|
8598
8806
|
// src/molecules/DatePicker/DatePicker.tsx
|
|
8599
|
-
import
|
|
8807
|
+
import React93 from "react";
|
|
8600
8808
|
import {
|
|
8601
8809
|
DatePickerStateContext,
|
|
8602
8810
|
Text
|
|
@@ -8606,13 +8814,13 @@ import { mergeProps as mergeProps3, useId as useId10 } from "@react-aria/utils";
|
|
|
8606
8814
|
import { omit as omit8 } from "lodash-es";
|
|
8607
8815
|
|
|
8608
8816
|
// src/molecules/TimeField/TimeField.tsx
|
|
8609
|
-
import
|
|
8817
|
+
import React88 from "react";
|
|
8610
8818
|
import { useLabel } from "@react-aria/label";
|
|
8611
8819
|
import { useId as useId9 } from "@react-aria/utils";
|
|
8612
8820
|
import { omit as omit7 } from "lodash-es";
|
|
8613
8821
|
|
|
8614
8822
|
// src/atoms/DateField/DateField.tsx
|
|
8615
|
-
import
|
|
8823
|
+
import React87 from "react";
|
|
8616
8824
|
import {
|
|
8617
8825
|
DateField as AriaDateField,
|
|
8618
8826
|
DateInput as AriaDateInput,
|
|
@@ -8635,10 +8843,10 @@ var segmentStyles = tv21({
|
|
|
8635
8843
|
}
|
|
8636
8844
|
});
|
|
8637
8845
|
var DateInput = (props) => {
|
|
8638
|
-
return /* @__PURE__ */
|
|
8846
|
+
return /* @__PURE__ */ React87.createElement(AriaDateInput, { className: (renderProps) => fieldGroup({ ...renderProps, class: "block" }), ...props }, (segment) => /* @__PURE__ */ React87.createElement(AriaDateSegment, { segment, className: segmentStyles }));
|
|
8639
8847
|
};
|
|
8640
8848
|
var TimeField = ({ disabled, valid, ...props }) => {
|
|
8641
|
-
return /* @__PURE__ */
|
|
8849
|
+
return /* @__PURE__ */ React87.createElement(AriaTimeField, { ...props, isInvalid: valid === false, isDisabled: disabled }, /* @__PURE__ */ React87.createElement(DateInput, null));
|
|
8642
8850
|
};
|
|
8643
8851
|
|
|
8644
8852
|
// src/molecules/TimeField/TimeField.tsx
|
|
@@ -8648,11 +8856,11 @@ function TimeField2(props) {
|
|
|
8648
8856
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
8649
8857
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
|
8650
8858
|
const baseProps = omit7(props, Object.keys(labelControlProps));
|
|
8651
|
-
return /* @__PURE__ */
|
|
8859
|
+
return /* @__PURE__ */ React88.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-TimeField" }, /* @__PURE__ */ React88.createElement(TimeField, { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid }));
|
|
8652
8860
|
}
|
|
8653
8861
|
|
|
8654
8862
|
// src/atoms/DatePicker/Calendar.tsx
|
|
8655
|
-
import
|
|
8863
|
+
import React90 from "react";
|
|
8656
8864
|
import {
|
|
8657
8865
|
Calendar as AriaCalendar,
|
|
8658
8866
|
CalendarCell,
|
|
@@ -8665,7 +8873,7 @@ import {
|
|
|
8665
8873
|
import { tv as tv23 } from "tailwind-variants";
|
|
8666
8874
|
|
|
8667
8875
|
// src/atoms/DatePicker/DatePickerButton.tsx
|
|
8668
|
-
import
|
|
8876
|
+
import React89 from "react";
|
|
8669
8877
|
import { Button as AriaButton2, composeRenderProps as composeRenderProps4 } from "react-aria-components";
|
|
8670
8878
|
import { tv as tv22 } from "tailwind-variants";
|
|
8671
8879
|
var datePickerButton = tv22({
|
|
@@ -8681,7 +8889,7 @@ var DatePickerButton = ({
|
|
|
8681
8889
|
hideWhenParentIsNotHoveredOrFocused = false,
|
|
8682
8890
|
...props
|
|
8683
8891
|
}) => {
|
|
8684
|
-
return /* @__PURE__ */
|
|
8892
|
+
return /* @__PURE__ */ React89.createElement(
|
|
8685
8893
|
AriaButton2,
|
|
8686
8894
|
{
|
|
8687
8895
|
...props,
|
|
@@ -8698,10 +8906,10 @@ var DatePickerButton = ({
|
|
|
8698
8906
|
);
|
|
8699
8907
|
};
|
|
8700
8908
|
var ClearInputButton = (props) => {
|
|
8701
|
-
return /* @__PURE__ */
|
|
8909
|
+
return /* @__PURE__ */ React89.createElement(DatePickerButton, { ...props, "aria-label": "Clear", slot: null, hideWhenParentIsNotHoveredOrFocused: true }, /* @__PURE__ */ React89.createElement(Icon2, { icon: smallCross_default, dense: true }));
|
|
8702
8910
|
};
|
|
8703
8911
|
var CalendarButton = (props) => {
|
|
8704
|
-
return /* @__PURE__ */
|
|
8912
|
+
return /* @__PURE__ */ React89.createElement(DatePickerButton, { ...props, "aria-label": "Calendar" }, /* @__PURE__ */ React89.createElement(Icon2, { icon: calendar_default, dense: true }));
|
|
8705
8913
|
};
|
|
8706
8914
|
|
|
8707
8915
|
// src/atoms/DatePicker/Calendar.tsx
|
|
@@ -8722,17 +8930,17 @@ var cellStyles = tv23({
|
|
|
8722
8930
|
}
|
|
8723
8931
|
});
|
|
8724
8932
|
var Calendar = (props) => {
|
|
8725
|
-
return /* @__PURE__ */
|
|
8933
|
+
return /* @__PURE__ */ React90.createElement(AriaCalendar, { ...props }, /* @__PURE__ */ React90.createElement(CalendarHeader, null), /* @__PURE__ */ React90.createElement(CalendarGrid, null, /* @__PURE__ */ React90.createElement(CalendarGridHeader, null), /* @__PURE__ */ React90.createElement(CalendarGridBody, null, (date) => /* @__PURE__ */ React90.createElement(CalendarCell, { date, className: cellStyles }))));
|
|
8726
8934
|
};
|
|
8727
8935
|
var CalendarHeader = () => {
|
|
8728
|
-
return /* @__PURE__ */
|
|
8936
|
+
return /* @__PURE__ */ React90.createElement("header", { className: "flex items-center gap-1 pb-5 w-full" }, /* @__PURE__ */ React90.createElement(DatePickerButton, { slot: "previous", className: "p-3" }, /* @__PURE__ */ React90.createElement(Icon, { icon: chevronLeft_default })), /* @__PURE__ */ React90.createElement(Heading, { className: "flex-1 typography-default-strong text-center" }), /* @__PURE__ */ React90.createElement(DatePickerButton, { slot: "next", className: "p-3" }, /* @__PURE__ */ React90.createElement(Icon, { icon: chevronRight_default })));
|
|
8729
8937
|
};
|
|
8730
8938
|
var CalendarGridHeader = () => {
|
|
8731
|
-
return /* @__PURE__ */
|
|
8939
|
+
return /* @__PURE__ */ React90.createElement(AriaCalendarGridHeader, null, (day) => /* @__PURE__ */ React90.createElement(CalendarHeaderCell, { className: "text-xs text-inactive typography-small" }, day));
|
|
8732
8940
|
};
|
|
8733
8941
|
|
|
8734
8942
|
// src/atoms/DatePicker/DatePicker.tsx
|
|
8735
|
-
import
|
|
8943
|
+
import React91 from "react";
|
|
8736
8944
|
import {
|
|
8737
8945
|
Button as AriaButton3,
|
|
8738
8946
|
DatePicker as AriaDatePicker,
|
|
@@ -8762,7 +8970,7 @@ var datePickerCalendarStyles = tv24({
|
|
|
8762
8970
|
});
|
|
8763
8971
|
var DatePicker = ({ variant, ...props }) => {
|
|
8764
8972
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
|
8765
|
-
return /* @__PURE__ */
|
|
8973
|
+
return /* @__PURE__ */ React91.createElement(
|
|
8766
8974
|
AriaDatePicker,
|
|
8767
8975
|
{
|
|
8768
8976
|
...props,
|
|
@@ -8773,7 +8981,7 @@ var DatePicker = ({ variant, ...props }) => {
|
|
|
8773
8981
|
};
|
|
8774
8982
|
var DateRangePicker = ({ variant, ...props }) => {
|
|
8775
8983
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
|
8776
|
-
return /* @__PURE__ */
|
|
8984
|
+
return /* @__PURE__ */ React91.createElement(
|
|
8777
8985
|
AriaDateRangePicker,
|
|
8778
8986
|
{
|
|
8779
8987
|
...props,
|
|
@@ -8784,31 +8992,31 @@ var DateRangePicker = ({ variant, ...props }) => {
|
|
|
8784
8992
|
};
|
|
8785
8993
|
var Presets = ({ children }) => {
|
|
8786
8994
|
const { presets } = datePickerCalendarStyles();
|
|
8787
|
-
return /* @__PURE__ */
|
|
8995
|
+
return /* @__PURE__ */ React91.createElement("div", { className: presets() }, children);
|
|
8788
8996
|
};
|
|
8789
8997
|
var Preset = ({ value, label }) => {
|
|
8790
8998
|
const { preset } = datePickerCalendarStyles();
|
|
8791
|
-
const context2 =
|
|
8999
|
+
const context2 = React91.useContext(AriaDatePickerStateContext);
|
|
8792
9000
|
const handlePress = () => {
|
|
8793
9001
|
context2?.setValue(value);
|
|
8794
9002
|
context2?.close();
|
|
8795
9003
|
};
|
|
8796
9004
|
const isActive = context2?.value !== void 0 && context2.value?.toString() === value.toString();
|
|
8797
|
-
return /* @__PURE__ */
|
|
9005
|
+
return /* @__PURE__ */ React91.createElement(AriaButton3, { onPress: handlePress, className: preset({ isPresetActive: isActive }) }, label);
|
|
8798
9006
|
};
|
|
8799
9007
|
var RangePreset = ({ value, label }) => {
|
|
8800
9008
|
const { preset } = datePickerCalendarStyles();
|
|
8801
|
-
const context2 =
|
|
9009
|
+
const context2 = React91.useContext(AriaDateRangePickerStateContext);
|
|
8802
9010
|
const handlePress = () => {
|
|
8803
9011
|
context2?.setValue(value);
|
|
8804
9012
|
context2?.close();
|
|
8805
9013
|
};
|
|
8806
9014
|
const isActive = context2?.value !== void 0 && context2.value.start?.toString() === value.start.toString() && context2.value.end?.toString() === value.end.toString();
|
|
8807
|
-
return /* @__PURE__ */
|
|
9015
|
+
return /* @__PURE__ */ React91.createElement(AriaButton3, { onPress: handlePress, className: preset({ isPresetActive: isActive }) }, label);
|
|
8808
9016
|
};
|
|
8809
9017
|
|
|
8810
9018
|
// src/atoms/Dialog/Dialog.tsx
|
|
8811
|
-
import
|
|
9019
|
+
import React92 from "react";
|
|
8812
9020
|
import { Dialog as AriaDialog2 } from "react-aria-components";
|
|
8813
9021
|
|
|
8814
9022
|
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
@@ -11287,7 +11495,7 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
|
11287
11495
|
}
|
|
11288
11496
|
};
|
|
11289
11497
|
var Dialog = (props) => {
|
|
11290
|
-
return /* @__PURE__ */
|
|
11498
|
+
return /* @__PURE__ */ React92.createElement(
|
|
11291
11499
|
AriaDialog2,
|
|
11292
11500
|
{
|
|
11293
11501
|
...props,
|
|
@@ -11298,14 +11506,14 @@ var Dialog = (props) => {
|
|
|
11298
11506
|
|
|
11299
11507
|
// src/molecules/DatePicker/DatePicker.tsx
|
|
11300
11508
|
var DatePickerClearButton = () => {
|
|
11301
|
-
const state =
|
|
11509
|
+
const state = React93.useContext(DatePickerStateContext);
|
|
11302
11510
|
if (!state) {
|
|
11303
11511
|
throw new Error("DatePickerStateContext is missing a provider");
|
|
11304
11512
|
}
|
|
11305
11513
|
if (!state.value) {
|
|
11306
11514
|
return null;
|
|
11307
11515
|
}
|
|
11308
|
-
return /* @__PURE__ */
|
|
11516
|
+
return /* @__PURE__ */ React93.createElement(
|
|
11309
11517
|
ClearInputButton,
|
|
11310
11518
|
{
|
|
11311
11519
|
onPress: () => {
|
|
@@ -11316,8 +11524,8 @@ var DatePickerClearButton = () => {
|
|
|
11316
11524
|
};
|
|
11317
11525
|
DatePickerClearButton.displayName = "DatePicker.ClearButton";
|
|
11318
11526
|
var CalendarTimeField = ({ granularity, labelText = "Time", ...props }) => {
|
|
11319
|
-
const ctx =
|
|
11320
|
-
return /* @__PURE__ */
|
|
11527
|
+
const ctx = React93.useContext(DatePickerStateContext);
|
|
11528
|
+
return /* @__PURE__ */ React93.createElement(
|
|
11321
11529
|
TimeField2,
|
|
11322
11530
|
{
|
|
11323
11531
|
...props,
|
|
@@ -11329,16 +11537,16 @@ var CalendarTimeField = ({ granularity, labelText = "Time", ...props }) => {
|
|
|
11329
11537
|
}
|
|
11330
11538
|
);
|
|
11331
11539
|
};
|
|
11332
|
-
var DatePickerCalendarPropsContext =
|
|
11540
|
+
var DatePickerCalendarPropsContext = React93.createContext(null);
|
|
11333
11541
|
var DatePickerCalendar = (props) => {
|
|
11334
|
-
const ctx =
|
|
11542
|
+
const ctx = React93.useContext(DatePickerCalendarPropsContext);
|
|
11335
11543
|
const { variant, granularity, errorMessage, presets = [] } = mergeProps3(ctx, props);
|
|
11336
11544
|
const { dialog, calendar, errorMessage: errorMessageStyle } = datePickerCalendarStyles();
|
|
11337
|
-
return /* @__PURE__ */
|
|
11545
|
+
return /* @__PURE__ */ React93.createElement(Popover, { offset: 0 }, /* @__PURE__ */ React93.createElement(Dialog, { className: dialog() }, presets.length > 0 && /* @__PURE__ */ React93.createElement(Presets, null, presets.map((props2) => /* @__PURE__ */ React93.createElement(Preset, { key: props2.value.toString(), ...props2 }))), /* @__PURE__ */ React93.createElement(Spacing, { gap: "3", className: "p-5" }, /* @__PURE__ */ React93.createElement(Calendar, { className: calendar() }), variant === "datetime" && /* @__PURE__ */ React93.createElement(CalendarTimeField, { granularity }), errorMessage && /* @__PURE__ */ React93.createElement(Text, { slot: "errorMessage", className: errorMessageStyle() }, errorMessage))));
|
|
11338
11546
|
};
|
|
11339
11547
|
DatePickerCalendar.displayName = "DatePicker.Calendar";
|
|
11340
11548
|
var DatePickerField = ({ clearSelectionEnabled = true, disabled = false }) => {
|
|
11341
|
-
return /* @__PURE__ */
|
|
11549
|
+
return /* @__PURE__ */ React93.createElement(FieldGroup, { className: "min-w-[210px] w-auto" }, /* @__PURE__ */ React93.createElement(DateInput, { className: "flex-1" }), /* @__PURE__ */ React93.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React93.createElement(DatePickerClearButton, null), /* @__PURE__ */ React93.createElement(CalendarButton, null)));
|
|
11342
11550
|
};
|
|
11343
11551
|
DatePickerField.displayName = "DatePicker.Field";
|
|
11344
11552
|
var createDatePickerBase = (variant) => {
|
|
@@ -11352,13 +11560,13 @@ var createDatePickerBase = (variant) => {
|
|
|
11352
11560
|
children,
|
|
11353
11561
|
...props
|
|
11354
11562
|
}) => {
|
|
11355
|
-
const content = children ?? /* @__PURE__ */
|
|
11356
|
-
return /* @__PURE__ */
|
|
11563
|
+
const content = children ?? /* @__PURE__ */ React93.createElement(React93.Fragment, null, /* @__PURE__ */ React93.createElement(DatePickerField, { clearSelectionEnabled, disabled }), /* @__PURE__ */ React93.createElement(DatePickerCalendar, null));
|
|
11564
|
+
return /* @__PURE__ */ React93.createElement(
|
|
11357
11565
|
DatePickerCalendarPropsContext.Provider,
|
|
11358
11566
|
{
|
|
11359
11567
|
value: { variant, granularity: props.granularity, errorMessage, presets }
|
|
11360
11568
|
},
|
|
11361
|
-
/* @__PURE__ */
|
|
11569
|
+
/* @__PURE__ */ React93.createElement(DatePicker, { ...props, variant, isDisabled: disabled, isInvalid: valid === false }, content)
|
|
11362
11570
|
);
|
|
11363
11571
|
};
|
|
11364
11572
|
datePicker.Calendar = DatePickerCalendar;
|
|
@@ -11376,7 +11584,7 @@ var createDatePicker = (variant) => {
|
|
|
11376
11584
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
|
11377
11585
|
const baseProps = omit8(props, Object.keys(labelControlProps));
|
|
11378
11586
|
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
|
11379
|
-
return /* @__PURE__ */
|
|
11587
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React93.createElement(DatePickerBase, { ...allProps }) : /* @__PURE__ */ React93.createElement(DateTimePickerBase, { ...allProps }));
|
|
11380
11588
|
};
|
|
11381
11589
|
datePicker.Calendar = DatePickerCalendar;
|
|
11382
11590
|
datePicker.Field = DatePickerField;
|
|
@@ -11387,7 +11595,7 @@ var DatePicker2 = createDatePicker("date");
|
|
|
11387
11595
|
var DateTimePicker = createDatePicker("datetime");
|
|
11388
11596
|
|
|
11389
11597
|
// src/molecules/DatePicker/DateRangePicker.tsx
|
|
11390
|
-
import
|
|
11598
|
+
import React95 from "react";
|
|
11391
11599
|
import {
|
|
11392
11600
|
DateRangePickerStateContext,
|
|
11393
11601
|
Text as Text2
|
|
@@ -11397,7 +11605,7 @@ import { mergeProps as mergeProps4, useId as useId11 } from "@react-aria/utils";
|
|
|
11397
11605
|
import { omit as omit9 } from "lodash-es";
|
|
11398
11606
|
|
|
11399
11607
|
// src/atoms/DatePicker/RangeCalendar.tsx
|
|
11400
|
-
import
|
|
11608
|
+
import React94 from "react";
|
|
11401
11609
|
import {
|
|
11402
11610
|
CalendarCell as CalendarCell2,
|
|
11403
11611
|
CalendarGrid as CalendarGrid2,
|
|
@@ -11437,7 +11645,7 @@ var cell = tv25({
|
|
|
11437
11645
|
}
|
|
11438
11646
|
});
|
|
11439
11647
|
function RangeCalendar(props) {
|
|
11440
|
-
return /* @__PURE__ */
|
|
11648
|
+
return /* @__PURE__ */ React94.createElement(AriaRangeCalendar, { ...props }, /* @__PURE__ */ React94.createElement(CalendarHeader, null), /* @__PURE__ */ React94.createElement(CalendarGrid2, { className: "[&_td]:px-0" }, /* @__PURE__ */ React94.createElement(CalendarGridHeader, null), /* @__PURE__ */ React94.createElement(CalendarGridBody2, null, (date) => /* @__PURE__ */ React94.createElement(CalendarCell2, { date, className: cellContainer() }, ({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React94.createElement(
|
|
11441
11649
|
"span",
|
|
11442
11650
|
{
|
|
11443
11651
|
className: cell({
|
|
@@ -11451,14 +11659,14 @@ function RangeCalendar(props) {
|
|
|
11451
11659
|
|
|
11452
11660
|
// src/molecules/DatePicker/DateRangePicker.tsx
|
|
11453
11661
|
function DateRangePickerClearButton() {
|
|
11454
|
-
const state =
|
|
11662
|
+
const state = React95.useContext(DateRangePickerStateContext);
|
|
11455
11663
|
if (!state) {
|
|
11456
11664
|
throw new Error("DateRangePickerStateContext is missing a provider");
|
|
11457
11665
|
}
|
|
11458
11666
|
if (!state.value.start && !state.value.end) {
|
|
11459
11667
|
return null;
|
|
11460
11668
|
}
|
|
11461
|
-
return /* @__PURE__ */
|
|
11669
|
+
return /* @__PURE__ */ React95.createElement(
|
|
11462
11670
|
ClearInputButton,
|
|
11463
11671
|
{
|
|
11464
11672
|
onPress: () => {
|
|
@@ -11468,9 +11676,9 @@ function DateRangePickerClearButton() {
|
|
|
11468
11676
|
);
|
|
11469
11677
|
}
|
|
11470
11678
|
var RangeCalendarTimeField = ({ granularity, part, ...props }) => {
|
|
11471
|
-
const ctx =
|
|
11679
|
+
const ctx = React95.useContext(DateRangePickerStateContext);
|
|
11472
11680
|
const labelText = props.labelText ?? (part === "start" ? "Start time" : "End time");
|
|
11473
|
-
return /* @__PURE__ */
|
|
11681
|
+
return /* @__PURE__ */ React95.createElement(
|
|
11474
11682
|
TimeField2,
|
|
11475
11683
|
{
|
|
11476
11684
|
...props,
|
|
@@ -11482,16 +11690,16 @@ var RangeCalendarTimeField = ({ granularity, part, ...props }) => {
|
|
|
11482
11690
|
}
|
|
11483
11691
|
);
|
|
11484
11692
|
};
|
|
11485
|
-
var DateRangePickerCalendarPropsContext =
|
|
11693
|
+
var DateRangePickerCalendarPropsContext = React95.createContext(null);
|
|
11486
11694
|
var DateRangePickerCalendar = (props) => {
|
|
11487
|
-
const ctx =
|
|
11695
|
+
const ctx = React95.useContext(DateRangePickerCalendarPropsContext);
|
|
11488
11696
|
const { variant, granularity, errorMessage, presets = [] } = mergeProps4(ctx, props);
|
|
11489
11697
|
const { dialog, calendar, errorMessage: errorMessageStyle } = datePickerCalendarStyles();
|
|
11490
|
-
return /* @__PURE__ */
|
|
11698
|
+
return /* @__PURE__ */ React95.createElement(Popover, { offset: 0 }, /* @__PURE__ */ React95.createElement(Dialog, { className: dialog() }, presets.length > 0 && /* @__PURE__ */ React95.createElement(Presets, null, presets.map((props2) => /* @__PURE__ */ React95.createElement(RangePreset, { key: `${props2.value.start.toString()}-${props2.value.end.toString()}`, ...props2 }))), /* @__PURE__ */ React95.createElement(Spacing, { gap: "3", className: "p-5" }, /* @__PURE__ */ React95.createElement(RangeCalendar, { className: calendar() }), variant === "datetime" && /* @__PURE__ */ React95.createElement(Box.Flex, { gap: "6" }, /* @__PURE__ */ React95.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React95.createElement(RangeCalendarTimeField, { granularity, part: "start" })), /* @__PURE__ */ React95.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React95.createElement(RangeCalendarTimeField, { granularity, part: "end" }))), errorMessage && /* @__PURE__ */ React95.createElement(Text2, { slot: "errorMessage", className: errorMessageStyle() }, errorMessage))));
|
|
11491
11699
|
};
|
|
11492
11700
|
DateRangePickerCalendar.displayName = "DateRangePicker.Calendar";
|
|
11493
11701
|
var DateRangePickerField = ({ clearSelectionEnabled = true, disabled = false }) => {
|
|
11494
|
-
return /* @__PURE__ */
|
|
11702
|
+
return /* @__PURE__ */ React95.createElement(FieldGroup, { className: "min-w-[200px] w-auto gap-2" }, /* @__PURE__ */ React95.createElement(DateInput, { slot: "start", className: "px-2 py-1" }), /* @__PURE__ */ React95.createElement("span", { "aria-hidden": true, className: "text-muted" }, "-"), /* @__PURE__ */ React95.createElement(DateInput, { slot: "end", className: "flex-1 px-2 py-1" }), /* @__PURE__ */ React95.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React95.createElement(DateRangePickerClearButton, null), /* @__PURE__ */ React95.createElement(CalendarButton, null)));
|
|
11495
11703
|
};
|
|
11496
11704
|
DateRangePickerField.displayName = "DateRangePicker.Field";
|
|
11497
11705
|
var createDateRangePickerBase = (variant) => {
|
|
@@ -11505,13 +11713,13 @@ var createDateRangePickerBase = (variant) => {
|
|
|
11505
11713
|
children,
|
|
11506
11714
|
...props
|
|
11507
11715
|
}) => {
|
|
11508
|
-
const content = children ?? /* @__PURE__ */
|
|
11509
|
-
return /* @__PURE__ */
|
|
11716
|
+
const content = children ?? /* @__PURE__ */ React95.createElement(React95.Fragment, null, /* @__PURE__ */ React95.createElement(DateRangePickerField, { clearSelectionEnabled, disabled }), /* @__PURE__ */ React95.createElement(DateRangePickerCalendar, { variant, granularity: props.granularity, errorMessage }));
|
|
11717
|
+
return /* @__PURE__ */ React95.createElement(
|
|
11510
11718
|
DateRangePickerCalendarPropsContext.Provider,
|
|
11511
11719
|
{
|
|
11512
11720
|
value: { variant, granularity: props.granularity, errorMessage, presets }
|
|
11513
11721
|
},
|
|
11514
|
-
/* @__PURE__ */
|
|
11722
|
+
/* @__PURE__ */ React95.createElement(DateRangePicker, { ...props, variant, isDisabled: disabled, isInvalid: valid === false }, content)
|
|
11515
11723
|
);
|
|
11516
11724
|
};
|
|
11517
11725
|
dateRangePicker.Calendar = DateRangePickerCalendar;
|
|
@@ -11529,7 +11737,7 @@ var createDateRangePicker = (variant) => {
|
|
|
11529
11737
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
|
11530
11738
|
const baseProps = omit9(props, Object.keys(labelControlProps));
|
|
11531
11739
|
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
|
11532
|
-
return /* @__PURE__ */
|
|
11740
|
+
return /* @__PURE__ */ React95.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React95.createElement(DateRangePickerBase, { ...allProps }) : /* @__PURE__ */ React95.createElement(DateTimeRangePickerBase, { ...allProps }));
|
|
11533
11741
|
};
|
|
11534
11742
|
dateRangePicker.Calendar = DateRangePickerCalendar;
|
|
11535
11743
|
dateRangePicker.Field = DateRangePickerField;
|
|
@@ -11540,14 +11748,14 @@ var DateRangePicker2 = createDateRangePicker("date");
|
|
|
11540
11748
|
var DateTimeRangePicker = createDateRangePicker("datetime");
|
|
11541
11749
|
|
|
11542
11750
|
// src/molecules/Dialog/Dialog.tsx
|
|
11543
|
-
import
|
|
11751
|
+
import React96 from "react";
|
|
11544
11752
|
import { useDialog } from "@react-aria/dialog";
|
|
11545
11753
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
|
11546
11754
|
import { useId as useId12 } from "@react-aria/utils";
|
|
11547
11755
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
11548
11756
|
import { omit as omit10 } from "lodash-es";
|
|
11549
11757
|
var Dialog2 = (props) => {
|
|
11550
|
-
const ref =
|
|
11758
|
+
const ref = React96.useRef(null);
|
|
11551
11759
|
const { open, onClose } = props;
|
|
11552
11760
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose?.() });
|
|
11553
11761
|
const { modalProps, underlayProps } = useModalOverlay(
|
|
@@ -11558,7 +11766,7 @@ var Dialog2 = (props) => {
|
|
|
11558
11766
|
if (!state.isOpen) {
|
|
11559
11767
|
return null;
|
|
11560
11768
|
}
|
|
11561
|
-
return /* @__PURE__ */
|
|
11769
|
+
return /* @__PURE__ */ React96.createElement(Overlay, null, /* @__PURE__ */ React96.createElement(Modal, { className: "Aquarium-Dialog", open: true }, /* @__PURE__ */ React96.createElement(Modal.BackDrop, { ...underlayProps }), /* @__PURE__ */ React96.createElement(Modal.Dialog, { ref, size: "sm", isResponsive: false, ...modalProps }, /* @__PURE__ */ React96.createElement(DialogWrapper, { ...props }))));
|
|
11562
11770
|
};
|
|
11563
11771
|
var DialogWrapper = ({
|
|
11564
11772
|
title,
|
|
@@ -11567,7 +11775,7 @@ var DialogWrapper = ({
|
|
|
11567
11775
|
primaryAction,
|
|
11568
11776
|
secondaryAction
|
|
11569
11777
|
}) => {
|
|
11570
|
-
const ref =
|
|
11778
|
+
const ref = React96.useRef(null);
|
|
11571
11779
|
const labelledBy = useId12();
|
|
11572
11780
|
const describedBy = useId12();
|
|
11573
11781
|
const { dialogProps } = useDialog(
|
|
@@ -11578,34 +11786,34 @@ var DialogWrapper = ({
|
|
|
11578
11786
|
},
|
|
11579
11787
|
ref
|
|
11580
11788
|
);
|
|
11581
|
-
return /* @__PURE__ */
|
|
11789
|
+
return /* @__PURE__ */ React96.createElement("div", { ref, ...dialogProps, className: "outline-none" }, /* @__PURE__ */ React96.createElement(Modal.Header, { className: "icon-stroke-2" }, /* @__PURE__ */ React96.createElement(Icon, { icon: DIALOG_ICONS_AND_COLORS[type].icon, color: DIALOG_ICONS_AND_COLORS[type].color, fontSize: 20 }), /* @__PURE__ */ React96.createElement(Modal.Title, { id: labelledBy, variant: "large", color: DIALOG_ICONS_AND_COLORS[type].color }, title)), /* @__PURE__ */ React96.createElement(Modal.Body, { id: describedBy }, /* @__PURE__ */ React96.createElement(Typography2.Default, null, children)), /* @__PURE__ */ React96.createElement(Modal.Footer, null, /* @__PURE__ */ React96.createElement(Modal.Actions, { className: "gap-4" }, secondaryAction && /* @__PURE__ */ React96.createElement(Button2.Ghost, { key: secondaryAction.text, ...omit10(secondaryAction, "text") }, secondaryAction.text), /* @__PURE__ */ React96.createElement(Button2.Secondary, { key: primaryAction.text, ...omit10(primaryAction, "text") }, primaryAction.text))));
|
|
11582
11790
|
};
|
|
11583
11791
|
|
|
11584
11792
|
// src/molecules/Drawer/Drawer.tsx
|
|
11585
|
-
import
|
|
11793
|
+
import React99 from "react";
|
|
11586
11794
|
import { Dialog as AriaDialog3, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
|
11587
11795
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
|
11588
11796
|
import { clsx as clsx29 } from "clsx";
|
|
11589
11797
|
import { castArray as castArray4, omit as omit11 } from "lodash-es";
|
|
11590
11798
|
|
|
11591
11799
|
// src/molecules/Modal/ModalTitle.tsx
|
|
11592
|
-
import
|
|
11800
|
+
import React97 from "react";
|
|
11593
11801
|
import { HeadingContext, useContextProps } from "react-aria-components";
|
|
11594
11802
|
var ModalTitle = ({ children, ...props }) => {
|
|
11595
11803
|
const [ctxProps] = useContextProps({ ...props, slot: "title" }, null, HeadingContext);
|
|
11596
|
-
return /* @__PURE__ */
|
|
11804
|
+
return /* @__PURE__ */ React97.createElement(Modal.Title, { id: ctxProps.id, ...props }, children);
|
|
11597
11805
|
};
|
|
11598
11806
|
|
|
11599
11807
|
// src/molecules/Tabs/Tabs.tsx
|
|
11600
|
-
import
|
|
11808
|
+
import React98, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect3, useRef as useRef13, useState as useState11 } from "react";
|
|
11601
11809
|
import { clsx as clsx28 } from "clsx";
|
|
11602
11810
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
|
11603
11811
|
var isTabComponent = (c) => {
|
|
11604
|
-
return
|
|
11812
|
+
return React98.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
|
11605
11813
|
};
|
|
11606
|
-
var Tab =
|
|
11814
|
+
var Tab = React98.forwardRef(
|
|
11607
11815
|
({ className, id, title, children }, ref) => {
|
|
11608
|
-
return /* @__PURE__ */
|
|
11816
|
+
return /* @__PURE__ */ React98.createElement(
|
|
11609
11817
|
"div",
|
|
11610
11818
|
{
|
|
11611
11819
|
ref,
|
|
@@ -11619,10 +11827,10 @@ var Tab = React97.forwardRef(
|
|
|
11619
11827
|
);
|
|
11620
11828
|
}
|
|
11621
11829
|
);
|
|
11622
|
-
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */
|
|
11830
|
+
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */ React98.createElement("div", { ...rest, className: clsx28("py-6 z-0", className) }, children);
|
|
11623
11831
|
var ModalTab = Tab;
|
|
11624
11832
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11625
|
-
const Tab2 =
|
|
11833
|
+
const Tab2 = React98.forwardRef(
|
|
11626
11834
|
({
|
|
11627
11835
|
id,
|
|
11628
11836
|
value,
|
|
@@ -11641,11 +11849,11 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
|
11641
11849
|
const _id = id ?? kebabCase(title);
|
|
11642
11850
|
let statusIcon = void 0;
|
|
11643
11851
|
if (status === "warning") {
|
|
11644
|
-
statusIcon = /* @__PURE__ */
|
|
11852
|
+
statusIcon = /* @__PURE__ */ React98.createElement(InlineIcon, { icon: warningSign_default, color: "warning-graphic" });
|
|
11645
11853
|
} else if (status === "error") {
|
|
11646
|
-
statusIcon = /* @__PURE__ */
|
|
11854
|
+
statusIcon = /* @__PURE__ */ React98.createElement(InlineIcon, { icon: warningSign_default, color: "danger-graphic" });
|
|
11647
11855
|
}
|
|
11648
|
-
const tab = /* @__PURE__ */
|
|
11856
|
+
const tab = /* @__PURE__ */ React98.createElement(
|
|
11649
11857
|
Component,
|
|
11650
11858
|
{
|
|
11651
11859
|
ref,
|
|
@@ -11667,7 +11875,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
|
11667
11875
|
tabIndex: disabled ? void 0 : 0,
|
|
11668
11876
|
...rest
|
|
11669
11877
|
},
|
|
11670
|
-
/* @__PURE__ */
|
|
11878
|
+
/* @__PURE__ */ React98.createElement(
|
|
11671
11879
|
Typography2,
|
|
11672
11880
|
{
|
|
11673
11881
|
htmlTag: "div",
|
|
@@ -11678,20 +11886,20 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
|
11678
11886
|
!selected && !disabled && "group-hover:text-intense group-focus-visible:text-intense"
|
|
11679
11887
|
)
|
|
11680
11888
|
},
|
|
11681
|
-
showNotification ? /* @__PURE__ */
|
|
11889
|
+
showNotification ? /* @__PURE__ */ React98.createElement(
|
|
11682
11890
|
Badge.Notification,
|
|
11683
11891
|
{
|
|
11684
11892
|
right: "-4px",
|
|
11685
11893
|
top: "3px",
|
|
11686
11894
|
className: selected && !disabled ? void 0 : "[color:inherit]"
|
|
11687
11895
|
},
|
|
11688
|
-
/* @__PURE__ */
|
|
11689
|
-
) : /* @__PURE__ */
|
|
11690
|
-
isNumber6(badge) && /* @__PURE__ */
|
|
11896
|
+
/* @__PURE__ */ React98.createElement("span", { className: "whitespace-nowrap" }, title)
|
|
11897
|
+
) : /* @__PURE__ */ React98.createElement("span", { className: "whitespace-nowrap" }, title),
|
|
11898
|
+
isNumber6(badge) && /* @__PURE__ */ React98.createElement(Typography2, { htmlTag: "span", variant: "default", color: "intense", className: "leading-none" }, /* @__PURE__ */ React98.createElement(Badge, { kind: !selected ? "outlined" : "filled", value: badge })),
|
|
11691
11899
|
statusIcon
|
|
11692
11900
|
)
|
|
11693
11901
|
);
|
|
11694
|
-
return tooltip ? /* @__PURE__ */
|
|
11902
|
+
return tooltip ? /* @__PURE__ */ React98.createElement(Tooltip, { content: tooltip }, tab) : tab;
|
|
11695
11903
|
}
|
|
11696
11904
|
);
|
|
11697
11905
|
Tab2.displayName = displayName;
|
|
@@ -11702,19 +11910,19 @@ var CARET_OFFSET = 24;
|
|
|
11702
11910
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
|
11703
11911
|
const Tabs2 = (props) => {
|
|
11704
11912
|
const { className, value, defaultValue, onChange, ["aria-label"]: ariaLabel, children } = props;
|
|
11705
|
-
const childArr =
|
|
11913
|
+
const childArr = React98.Children.toArray(children);
|
|
11706
11914
|
const firstTab = childArr[0];
|
|
11707
11915
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
|
11708
11916
|
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
|
11709
11917
|
const [leftCaret, showLeftCaret] = useState11(false);
|
|
11710
11918
|
const [rightCaret, showRightCaret] = useState11(false);
|
|
11711
|
-
const parentRef =
|
|
11712
|
-
const containerRef =
|
|
11713
|
-
const tabsRef =
|
|
11919
|
+
const parentRef = useRef13(null);
|
|
11920
|
+
const containerRef = useRef13(null);
|
|
11921
|
+
const tabsRef = useRef13(null);
|
|
11714
11922
|
const revealSelectedTab = ({ smooth }) => {
|
|
11715
11923
|
const container2 = containerRef.current;
|
|
11716
11924
|
const tabs = tabsRef.current;
|
|
11717
|
-
const values =
|
|
11925
|
+
const values = React98.Children.map(
|
|
11718
11926
|
children,
|
|
11719
11927
|
(tab, i) => tab?.props.value ?? i
|
|
11720
11928
|
);
|
|
@@ -11745,14 +11953,14 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11745
11953
|
showLeftCaret(hasLeftCaret);
|
|
11746
11954
|
showRightCaret(hasRightCaret);
|
|
11747
11955
|
};
|
|
11748
|
-
|
|
11956
|
+
useEffect11(() => {
|
|
11749
11957
|
if (value === void 0) {
|
|
11750
11958
|
return;
|
|
11751
11959
|
}
|
|
11752
11960
|
updateCarets();
|
|
11753
11961
|
setSelected(value);
|
|
11754
11962
|
revealSelectedTab({ smooth: value !== selected });
|
|
11755
|
-
}, [value,
|
|
11963
|
+
}, [value, React98.Children.count(children)]);
|
|
11756
11964
|
useLayoutEffect3(() => {
|
|
11757
11965
|
updateCarets();
|
|
11758
11966
|
containerRef.current?.addEventListener("scroll", updateCarets);
|
|
@@ -11814,12 +12022,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11814
12022
|
const handleSelected = (key) => {
|
|
11815
12023
|
(onChange ?? setSelected)(key);
|
|
11816
12024
|
};
|
|
11817
|
-
|
|
12025
|
+
React98.Children.forEach(children, (c) => {
|
|
11818
12026
|
if (c && !isTabComponent(c)) {
|
|
11819
12027
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
|
11820
12028
|
}
|
|
11821
12029
|
});
|
|
11822
|
-
return /* @__PURE__ */
|
|
12030
|
+
return /* @__PURE__ */ React98.createElement("div", { ref: parentRef, className: clsx28("Aquarium-Tabs h-full", className) }, /* @__PURE__ */ React98.createElement("div", { className: "relative flex items-center border-b border-muted" }, /* @__PURE__ */ React98.createElement("div", { ref: containerRef, className: "overflow-y-auto scrollbar-hide mb-[-1px] h-auto" }, /* @__PURE__ */ React98.createElement(
|
|
11823
12031
|
"div",
|
|
11824
12032
|
{
|
|
11825
12033
|
ref: tabsRef,
|
|
@@ -11827,9 +12035,9 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11827
12035
|
"aria-label": ariaLabel ? ariaLabel : "tabs",
|
|
11828
12036
|
className: "inline-flex items-center cursor-pointer font-normal h-full"
|
|
11829
12037
|
},
|
|
11830
|
-
|
|
12038
|
+
React98.Children.map(
|
|
11831
12039
|
children,
|
|
11832
|
-
(tab, index) => tab ? /* @__PURE__ */
|
|
12040
|
+
(tab, index) => tab ? /* @__PURE__ */ React98.createElement(
|
|
11833
12041
|
TabItemComponent,
|
|
11834
12042
|
{
|
|
11835
12043
|
key: tab.props.value,
|
|
@@ -11841,26 +12049,26 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11841
12049
|
}
|
|
11842
12050
|
) : void 0
|
|
11843
12051
|
)
|
|
11844
|
-
)), leftCaret && /* @__PURE__ */
|
|
12052
|
+
)), leftCaret && /* @__PURE__ */ React98.createElement("div", { className: "absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4" }, /* @__PURE__ */ React98.createElement(
|
|
11845
12053
|
"div",
|
|
11846
12054
|
{
|
|
11847
12055
|
onClick: () => handleScrollToNext("left"),
|
|
11848
12056
|
className: "hover:bg-muted p-2 leading-none cursor-pointer"
|
|
11849
12057
|
},
|
|
11850
|
-
/* @__PURE__ */
|
|
11851
|
-
)), rightCaret && /* @__PURE__ */
|
|
12058
|
+
/* @__PURE__ */ React98.createElement(InlineIcon, { icon: chevronLeft_default })
|
|
12059
|
+
)), rightCaret && /* @__PURE__ */ React98.createElement(
|
|
11852
12060
|
"div",
|
|
11853
12061
|
{
|
|
11854
12062
|
onClick: () => handleScrollToNext("right"),
|
|
11855
12063
|
className: "absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4"
|
|
11856
12064
|
},
|
|
11857
|
-
/* @__PURE__ */
|
|
12065
|
+
/* @__PURE__ */ React98.createElement(
|
|
11858
12066
|
"div",
|
|
11859
12067
|
{
|
|
11860
12068
|
onClick: () => handleScrollToNext("right"),
|
|
11861
12069
|
className: "hover:bg-muted p-2 leading-none cursor-pointer"
|
|
11862
12070
|
},
|
|
11863
|
-
/* @__PURE__ */
|
|
12071
|
+
/* @__PURE__ */ React98.createElement(InlineIcon, { icon: chevronRight_default })
|
|
11864
12072
|
)
|
|
11865
12073
|
)), renderChildren(children, selected, props));
|
|
11866
12074
|
};
|
|
@@ -11868,7 +12076,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
|
11868
12076
|
Tabs2.Tab = TabComponent;
|
|
11869
12077
|
return Tabs2;
|
|
11870
12078
|
};
|
|
11871
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
|
12079
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React98.createElement(TabContainer, null, children.find(
|
|
11872
12080
|
(node, index) => node?.props.value === selected || index === selected
|
|
11873
12081
|
)));
|
|
11874
12082
|
|
|
@@ -11894,7 +12102,7 @@ var Drawer = ({
|
|
|
11894
12102
|
secondaryActions,
|
|
11895
12103
|
closeOnEsc = true
|
|
11896
12104
|
}) => {
|
|
11897
|
-
const [hidden, setHidden] =
|
|
12105
|
+
const [hidden, setHidden] = React99.useState(!open);
|
|
11898
12106
|
if (open && hidden) {
|
|
11899
12107
|
setHidden(!open);
|
|
11900
12108
|
}
|
|
@@ -11917,10 +12125,10 @@ var Drawer = ({
|
|
|
11917
12125
|
}
|
|
11918
12126
|
const dialogSize = size === "lg" ? "full" : size;
|
|
11919
12127
|
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
|
11920
|
-
const childElements =
|
|
12128
|
+
const childElements = React99.Children.toArray(children).filter(React99.isValidElement);
|
|
11921
12129
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
|
11922
12130
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
|
11923
|
-
return /* @__PURE__ */
|
|
12131
|
+
return /* @__PURE__ */ React99.createElement(
|
|
11924
12132
|
AriaModalOverlay2,
|
|
11925
12133
|
{
|
|
11926
12134
|
isOpen: !hidden,
|
|
@@ -11929,27 +12137,27 @@ var Drawer = ({
|
|
|
11929
12137
|
isKeyboardDismissDisabled: !closeOnEsc,
|
|
11930
12138
|
className: styles.overlay({ className: "Aquarium-Drawer" })
|
|
11931
12139
|
},
|
|
11932
|
-
/* @__PURE__ */
|
|
11933
|
-
/* @__PURE__ */
|
|
12140
|
+
/* @__PURE__ */ React99.createElement(AnimatedBackDrop, { style: { opacity } }),
|
|
12141
|
+
/* @__PURE__ */ React99.createElement(AriaModal2, null, /* @__PURE__ */ React99.createElement(AnimatedDialog, { kind: "drawer", "aria-modal": "true", size: dialogSize, style: { position: "fixed", right } }, /* @__PURE__ */ React99.createElement(AriaDialog3, { className: "flex flex-col grow overflow-y-auto" }, ({ close }) => /* @__PURE__ */ React99.createElement(React99.Fragment, null, /* @__PURE__ */ React99.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React99.createElement(Button2.Icon, { "aria-label": "Close", icon: cross_default, onClick: close })), /* @__PURE__ */ React99.createElement(Modal.Header, { className: clsx29({ "pb-3": hasTabs }) }, /* @__PURE__ */ React99.createElement(ModalTitle, { kind: "drawer" }, title)), hasTabs ? /* @__PURE__ */ React99.createElement(
|
|
11934
12142
|
DrawerTabs,
|
|
11935
12143
|
{
|
|
11936
12144
|
...onlyChild.props,
|
|
11937
12145
|
className: "[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto"
|
|
11938
12146
|
}
|
|
11939
|
-
) : /* @__PURE__ */
|
|
12147
|
+
) : /* @__PURE__ */ React99.createElement(Modal.Body, { tabIndex: 0, noFooter: !(secondaryActions ?? primaryAction) }, children), (secondaryActions ?? primaryAction) && /* @__PURE__ */ React99.createElement(Modal.Footer, null, /* @__PURE__ */ React99.createElement(Modal.Actions, { className: size === "sm" ? "flex-col" : void 0 }, size !== "sm" && menu && /* @__PURE__ */ React99.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React99.createElement(DropdownMenu2, { onAction: (action) => onAction(action), onOpenChange: onMenuOpenChange }, /* @__PURE__ */ React99.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React99.createElement(Button2.Icon, { "aria-label": menuAriaLabel ?? "Context menu", icon: more_default })), menu)), secondaryActions && castArray4(secondaryActions).filter(Boolean).map(({ text, ...action }) => /* @__PURE__ */ React99.createElement(Button2.Secondary, { key: text, ...action }, text)), primaryAction && /* @__PURE__ */ React99.createElement(Button2.Primary, { key: primaryAction.text, ...omit11(primaryAction, "text") }, primaryAction.text)))))))
|
|
11940
12148
|
);
|
|
11941
12149
|
};
|
|
11942
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
|
12150
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ React99.createElement(Modal.Body, { className: "h-full" }, /* @__PURE__ */ React99.createElement(TabContainer, { className: "!py-4" }, children.find(
|
|
11943
12151
|
(node, index) => node?.props.value === selected || index === selected
|
|
11944
12152
|
))));
|
|
11945
12153
|
|
|
11946
12154
|
// src/molecules/Dropdown/Dropdown.tsx
|
|
11947
|
-
import
|
|
12155
|
+
import React101 from "react";
|
|
11948
12156
|
import { OverlayTriggerStateContext as OverlayTriggerStateContext2 } from "react-aria-components";
|
|
11949
12157
|
import { clsx as clsx30 } from "clsx";
|
|
11950
12158
|
|
|
11951
12159
|
// src/molecules/Popover/Popover.tsx
|
|
11952
|
-
import
|
|
12160
|
+
import React100, { createContext as createContext6 } from "react";
|
|
11953
12161
|
import { DialogTrigger, OverlayTriggerStateContext } from "react-aria-components";
|
|
11954
12162
|
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
|
11955
12163
|
var PopoverPropsContext = createContext6({});
|
|
@@ -11958,32 +12166,32 @@ var Popover2 = ({ children, onOpenChange: _onOpenChange, onClose, onOpen, ...pro
|
|
|
11958
12166
|
_onOpenChange?.(isOpen);
|
|
11959
12167
|
isOpen ? onOpen?.() : onClose?.();
|
|
11960
12168
|
};
|
|
11961
|
-
return /* @__PURE__ */
|
|
12169
|
+
return /* @__PURE__ */ React100.createElement(PopoverPropsContext.Provider, { value: props }, /* @__PURE__ */ React100.createElement(DialogTrigger, { ...props, onOpenChange }, children));
|
|
11962
12170
|
};
|
|
11963
12171
|
Popover2.displayName = "Popover";
|
|
11964
12172
|
var Trigger = ({ children }) => {
|
|
11965
|
-
return /* @__PURE__ */
|
|
12173
|
+
return /* @__PURE__ */ React100.createElement(Pressable, { "aria-haspopup": "true" }, children);
|
|
11966
12174
|
};
|
|
11967
12175
|
Trigger.displayName = "Popover.Trigger";
|
|
11968
12176
|
Popover2.Trigger = Trigger;
|
|
11969
12177
|
var Panel = ({ className, children }) => {
|
|
11970
|
-
const { offset = 0, onOpenChange, ...props } =
|
|
11971
|
-
return /* @__PURE__ */
|
|
12178
|
+
const { offset = 0, onOpenChange, ...props } = React100.useContext(PopoverPropsContext);
|
|
12179
|
+
return /* @__PURE__ */ React100.createElement(Popover, { ...props, className, offset }, /* @__PURE__ */ React100.createElement(Dialog, null, children));
|
|
11972
12180
|
};
|
|
11973
12181
|
Panel.displayName = "Popover.Panel";
|
|
11974
12182
|
Popover2.Panel = Panel;
|
|
11975
12183
|
var CloseToggle = ({ children }) => {
|
|
11976
|
-
const ctx =
|
|
12184
|
+
const ctx = React100.useContext(OverlayTriggerStateContext);
|
|
11977
12185
|
const onClick = ctx?.close;
|
|
11978
|
-
const child =
|
|
11979
|
-
return
|
|
12186
|
+
const child = React100.Children.only(children);
|
|
12187
|
+
return React100.cloneElement(child, { ...mergeProps5(child.props, { onClick }) });
|
|
11980
12188
|
};
|
|
11981
12189
|
CloseToggle.displayName = "Popover.CloseToggle";
|
|
11982
12190
|
Popover2.CloseToggle = CloseToggle;
|
|
11983
12191
|
|
|
11984
12192
|
// src/molecules/Dropdown/Dropdown.tsx
|
|
11985
12193
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
|
11986
|
-
return /* @__PURE__ */
|
|
12194
|
+
return /* @__PURE__ */ React101.createElement(Popover2, { placement }, /* @__PURE__ */ React101.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React101.createElement(Popover2.Panel, { className: "Aquarium-Dropdown" }, content));
|
|
11987
12195
|
};
|
|
11988
12196
|
var DropdownMenu3 = ({
|
|
11989
12197
|
title,
|
|
@@ -11992,13 +12200,13 @@ var DropdownMenu3 = ({
|
|
|
11992
12200
|
triggerId,
|
|
11993
12201
|
setClose = () => void 0
|
|
11994
12202
|
}) => {
|
|
11995
|
-
const menuRef =
|
|
11996
|
-
|
|
12203
|
+
const menuRef = React101.useRef(null);
|
|
12204
|
+
React101.useEffect(() => {
|
|
11997
12205
|
const id = setTimeout(() => (menuRef.current?.children[0]).focus());
|
|
11998
12206
|
return () => clearTimeout(id);
|
|
11999
12207
|
}, [menuRef.current]);
|
|
12000
|
-
return /* @__PURE__ */
|
|
12001
|
-
return
|
|
12208
|
+
return /* @__PURE__ */ React101.createElement("div", { style: { minWidth: "250px" }, className: "py-3 bg-overlay" }, !!title && /* @__PURE__ */ React101.createElement("div", { className: "px-4 py-4 text-left text-intense typography-default-strong" }, title), /* @__PURE__ */ React101.createElement("ol", { role: "menu", ref: menuRef, id: contentId, "aria-labelledby": triggerId }, React101.Children.map(children, (child) => {
|
|
12209
|
+
return React101.cloneElement(child, { setClose });
|
|
12002
12210
|
})));
|
|
12003
12211
|
};
|
|
12004
12212
|
var DropdownItem = ({
|
|
@@ -12011,7 +12219,7 @@ var DropdownItem = ({
|
|
|
12011
12219
|
setClose = () => void 0,
|
|
12012
12220
|
...props
|
|
12013
12221
|
}) => {
|
|
12014
|
-
const ctx =
|
|
12222
|
+
const ctx = React101.useContext(OverlayTriggerStateContext2);
|
|
12015
12223
|
const handleSelect = () => {
|
|
12016
12224
|
onSelect?.();
|
|
12017
12225
|
ctx?.close();
|
|
@@ -12045,8 +12253,8 @@ var DropdownItem = ({
|
|
|
12045
12253
|
handleSelect();
|
|
12046
12254
|
}
|
|
12047
12255
|
};
|
|
12048
|
-
const itemContent = /* @__PURE__ */
|
|
12049
|
-
return /* @__PURE__ */
|
|
12256
|
+
const itemContent = /* @__PURE__ */ React101.createElement("div", { className: "py-3 px-4" }, children);
|
|
12257
|
+
return /* @__PURE__ */ React101.createElement(
|
|
12050
12258
|
"li",
|
|
12051
12259
|
{
|
|
12052
12260
|
role: "menuitem",
|
|
@@ -12060,14 +12268,14 @@ var DropdownItem = ({
|
|
|
12060
12268
|
"text-danger-default": color === "danger" && !disabled
|
|
12061
12269
|
})
|
|
12062
12270
|
},
|
|
12063
|
-
tooltip ? /* @__PURE__ */
|
|
12271
|
+
tooltip ? /* @__PURE__ */ React101.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement, display: "block" }, /* @__PURE__ */ React101.createElement("div", { tabIndex: 0, className: "grow" }, itemContent)) : itemContent
|
|
12064
12272
|
);
|
|
12065
12273
|
};
|
|
12066
12274
|
Dropdown.Menu = DropdownMenu3;
|
|
12067
12275
|
Dropdown.Item = DropdownItem;
|
|
12068
12276
|
|
|
12069
12277
|
// src/molecules/EmptyState/EmptyState.tsx
|
|
12070
|
-
import
|
|
12278
|
+
import React102 from "react";
|
|
12071
12279
|
import { tv as tv26 } from "tailwind-variants";
|
|
12072
12280
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
|
12073
12281
|
EmptyStateLayout2["Vertical"] = "vertical";
|
|
@@ -12121,7 +12329,7 @@ var EmptyState2 = ({
|
|
|
12121
12329
|
borderStyle = "dashed",
|
|
12122
12330
|
fullHeight = isVerticalLayout(layout) ? true : false
|
|
12123
12331
|
}) => {
|
|
12124
|
-
return /* @__PURE__ */
|
|
12332
|
+
return /* @__PURE__ */ React102.createElement(
|
|
12125
12333
|
Box.Flex,
|
|
12126
12334
|
{
|
|
12127
12335
|
className: emptyStateClasses({
|
|
@@ -12130,30 +12338,30 @@ var EmptyState2 = ({
|
|
|
12130
12338
|
fullHeight
|
|
12131
12339
|
})
|
|
12132
12340
|
},
|
|
12133
|
-
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */
|
|
12341
|
+
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */ React102.createElement(
|
|
12134
12342
|
"img",
|
|
12135
12343
|
{
|
|
12136
12344
|
src: Image2,
|
|
12137
12345
|
alt: imageAlt,
|
|
12138
12346
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
|
12139
12347
|
}
|
|
12140
|
-
) : /* @__PURE__ */
|
|
12141
|
-
/* @__PURE__ */
|
|
12348
|
+
) : /* @__PURE__ */ React102.createElement("div", { className: "animate-draw" }, /* @__PURE__ */ React102.createElement(Image2, null))),
|
|
12349
|
+
/* @__PURE__ */ React102.createElement(
|
|
12142
12350
|
Box.Flex,
|
|
12143
12351
|
{
|
|
12144
12352
|
className: emptyStateContentClasses({
|
|
12145
12353
|
layout: isVerticalLayout(layout) ? "vertical" : "horizontal"
|
|
12146
12354
|
})
|
|
12147
12355
|
},
|
|
12148
|
-
/* @__PURE__ */
|
|
12149
|
-
(secondaryAction ?? primaryAction) && /* @__PURE__ */
|
|
12150
|
-
footer && /* @__PURE__ */
|
|
12356
|
+
/* @__PURE__ */ React102.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React102.createElement(Typography2.Subheading, { htmlTag: "h2" }, title), children && /* @__PURE__ */ React102.createElement(Box, { width: isVerticalLayout(layout) ? "3/4" : "full", marginX: "auto" }, /* @__PURE__ */ React102.createElement(Typography2.Default, null, children))),
|
|
12357
|
+
(secondaryAction ?? primaryAction) && /* @__PURE__ */ React102.createElement(Box.Flex, { gap: "4", justifyContent: "center", alignItems: "center", flexWrap: "wrap" }, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })),
|
|
12358
|
+
footer && /* @__PURE__ */ React102.createElement(Box, null, /* @__PURE__ */ React102.createElement(Typography2.Small, { color: "default" }, footer))
|
|
12151
12359
|
)
|
|
12152
12360
|
);
|
|
12153
12361
|
};
|
|
12154
12362
|
|
|
12155
12363
|
// src/atoms/Filter/Filter.tsx
|
|
12156
|
-
import
|
|
12364
|
+
import React103 from "react";
|
|
12157
12365
|
import {
|
|
12158
12366
|
Button as AriaButton4,
|
|
12159
12367
|
DatePickerStateContext as AriaDatePickerStateContext2,
|
|
@@ -12194,8 +12402,8 @@ var FilterTrigger = ({
|
|
|
12194
12402
|
clearSelectionEnabled = true,
|
|
12195
12403
|
...props
|
|
12196
12404
|
}) => {
|
|
12197
|
-
const ariaDatePickerState =
|
|
12198
|
-
const ariaDateRangePickerState =
|
|
12405
|
+
const ariaDatePickerState = React103.useContext(AriaDatePickerStateContext2);
|
|
12406
|
+
const ariaDateRangePickerState = React103.useContext(AriaDateRangePickerStateContext2);
|
|
12199
12407
|
const isUsedInsideDatePicker = !!ariaDatePickerState?.value;
|
|
12200
12408
|
const isUsedInsideDateRangePicker = !!ariaDateRangePickerState?.value.start && !!ariaDateRangePickerState.value.end;
|
|
12201
12409
|
const onClearDatePickerRelated = () => {
|
|
@@ -12207,14 +12415,14 @@ var FilterTrigger = ({
|
|
|
12207
12415
|
};
|
|
12208
12416
|
const hasValue = !!value || isUsedInsideDatePicker || isUsedInsideDateRangePicker;
|
|
12209
12417
|
const showClearButton = clearSelectionEnabled && (!!onClear && !!value || isUsedInsideDatePicker || isUsedInsideDateRangePicker);
|
|
12210
|
-
return /* @__PURE__ */
|
|
12418
|
+
return /* @__PURE__ */ React103.createElement(
|
|
12211
12419
|
AriaGroup,
|
|
12212
12420
|
{
|
|
12213
12421
|
...props,
|
|
12214
12422
|
isInvalid: error,
|
|
12215
12423
|
className: (renderProps) => filterWrapper({ ...renderProps, hasValue: hasValue || !!badge })
|
|
12216
12424
|
},
|
|
12217
|
-
/* @__PURE__ */
|
|
12425
|
+
/* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement(
|
|
12218
12426
|
AriaButton4,
|
|
12219
12427
|
{
|
|
12220
12428
|
onPress: () => {
|
|
@@ -12226,7 +12434,7 @@ var FilterTrigger = ({
|
|
|
12226
12434
|
"px-4": !showClearButton
|
|
12227
12435
|
})
|
|
12228
12436
|
},
|
|
12229
|
-
/* @__PURE__ */
|
|
12437
|
+
/* @__PURE__ */ React103.createElement("div", { className: "flex items-center gap-3 divide-x divide-grey-20" }, /* @__PURE__ */ React103.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React103.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React103.createElement(InlineIcon, { icon }), /* @__PURE__ */ React103.createElement(Typography2.Default, null, labelText)), badge && /* @__PURE__ */ React103.createElement(Typography2, { color: "primary-default", className: "flex items-center" }, /* @__PURE__ */ React103.createElement(Badge, { dense: true, value: badge }))), hasValue && /* @__PURE__ */ React103.createElement("div", { className: "pl-3" }, /* @__PURE__ */ React103.createElement(
|
|
12230
12438
|
Typography2.Default,
|
|
12231
12439
|
{
|
|
12232
12440
|
className: clsx31("truncate", {
|
|
@@ -12237,10 +12445,10 @@ var FilterTrigger = ({
|
|
|
12237
12445
|
color: error ? "danger-default" : "primary-default"
|
|
12238
12446
|
},
|
|
12239
12447
|
value,
|
|
12240
|
-
isUsedInsideDatePicker && /* @__PURE__ */
|
|
12241
|
-
isUsedInsideDateRangePicker && /* @__PURE__ */
|
|
12448
|
+
isUsedInsideDatePicker && /* @__PURE__ */ React103.createElement(DateDisplay, { state: ariaDatePickerState }),
|
|
12449
|
+
isUsedInsideDateRangePicker && /* @__PURE__ */ React103.createElement(DateDisplay, { state: ariaDateRangePickerState })
|
|
12242
12450
|
)))
|
|
12243
|
-
), showClearButton && /* @__PURE__ */
|
|
12451
|
+
), showClearButton && /* @__PURE__ */ React103.createElement(
|
|
12244
12452
|
FilterClearButton,
|
|
12245
12453
|
{
|
|
12246
12454
|
onClear: () => {
|
|
@@ -12257,11 +12465,11 @@ var isDateRangePickerState = (state) => {
|
|
|
12257
12465
|
var DateDisplay = ({ state }) => {
|
|
12258
12466
|
const primary = isDateRangePickerState(state) ? state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options)?.start : state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options);
|
|
12259
12467
|
const secondary = isDateRangePickerState(state) ? state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options)?.end : void 0;
|
|
12260
|
-
return /* @__PURE__ */
|
|
12468
|
+
return /* @__PURE__ */ React103.createElement(Box.Flex, { gap: "2" }, /* @__PURE__ */ React103.createElement("span", null, primary), secondary && /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement("span", { "aria-hidden": true, className: "text-muted" }, "-"), /* @__PURE__ */ React103.createElement("span", null, secondary)));
|
|
12261
12469
|
};
|
|
12262
12470
|
var FilterClearButton = ({ onClear }) => (
|
|
12263
12471
|
// using a native HTML <button> here instead of <Button slot={null} /> from react-aria because react-aria <DialogTrigger> doesn't support it as a child. If we used <Button slot={null}>, the popover would open simultaneously with the clear callback, which is unintended behavior. Interestingly, this issue doesn't occur in react-aria's <DatePicker>, but for consistency and to avoid conflicts here, we're sticking with a plain button.
|
|
12264
|
-
/* @__PURE__ */
|
|
12472
|
+
/* @__PURE__ */ React103.createElement(
|
|
12265
12473
|
"button",
|
|
12266
12474
|
{
|
|
12267
12475
|
"aria-label": "Clear filter",
|
|
@@ -12276,7 +12484,7 @@ var FilterClearButton = ({ onClear }) => (
|
|
|
12276
12484
|
},
|
|
12277
12485
|
className: "py-[10px] pl-[6px] pr-4 inline-flex items-center hover:bg-medium focus:bg-medium outline-0 outline-none rounded-r-full"
|
|
12278
12486
|
},
|
|
12279
|
-
/* @__PURE__ */
|
|
12487
|
+
/* @__PURE__ */ React103.createElement(InlineIcon, { icon: cross_default })
|
|
12280
12488
|
)
|
|
12281
12489
|
);
|
|
12282
12490
|
var Filter = () => null;
|
|
@@ -12284,7 +12492,7 @@ FilterTrigger.displayName = "Filter.Trigger";
|
|
|
12284
12492
|
Filter.Trigger = FilterTrigger;
|
|
12285
12493
|
|
|
12286
12494
|
// src/molecules/LineClamp/LineClamp.tsx
|
|
12287
|
-
import
|
|
12495
|
+
import React104 from "react";
|
|
12288
12496
|
var LineClamp2 = ({
|
|
12289
12497
|
lines,
|
|
12290
12498
|
children,
|
|
@@ -12293,10 +12501,10 @@ var LineClamp2 = ({
|
|
|
12293
12501
|
collapseLabel,
|
|
12294
12502
|
onClampedChange
|
|
12295
12503
|
}) => {
|
|
12296
|
-
const ref =
|
|
12297
|
-
const [clamped, setClamped] =
|
|
12298
|
-
const [isClampingEnabled, setClampingEnabled] =
|
|
12299
|
-
|
|
12504
|
+
const ref = React104.useRef(null);
|
|
12505
|
+
const [clamped, setClamped] = React104.useState(true);
|
|
12506
|
+
const [isClampingEnabled, setClampingEnabled] = React104.useState(false);
|
|
12507
|
+
React104.useEffect(() => {
|
|
12300
12508
|
const el = ref.current;
|
|
12301
12509
|
setClampingEnabled((el?.scrollHeight ?? 0) > (el?.clientHeight ?? 0));
|
|
12302
12510
|
}, [ref.current]);
|
|
@@ -12304,25 +12512,25 @@ var LineClamp2 = ({
|
|
|
12304
12512
|
setClamped(!clamped);
|
|
12305
12513
|
onClampedChange?.(!clamped);
|
|
12306
12514
|
};
|
|
12307
|
-
return /* @__PURE__ */
|
|
12515
|
+
return /* @__PURE__ */ React104.createElement("div", { className: "Aquarium-LineClamp" }, /* @__PURE__ */ React104.createElement(LineClamp, { ref, lines, clamped, wordBreak }, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React104.createElement(Button2.Ghost, { dense: true, onClick: handleClampedChange }, clamped ? expandLabel : collapseLabel));
|
|
12308
12516
|
};
|
|
12309
12517
|
|
|
12310
12518
|
// src/molecules/List/useStaticInfiniteList.ts
|
|
12311
|
-
import
|
|
12519
|
+
import React105 from "react";
|
|
12312
12520
|
var useStaticInfiniteList = ({
|
|
12313
12521
|
items,
|
|
12314
12522
|
pageSize,
|
|
12315
12523
|
autoReset = true
|
|
12316
12524
|
}) => {
|
|
12317
|
-
const [currentPage, setCurrentPage] =
|
|
12525
|
+
const [currentPage, setCurrentPage] = React105.useState(1);
|
|
12318
12526
|
const numberOfVisible = currentPage * pageSize;
|
|
12319
|
-
const next =
|
|
12527
|
+
const next = React105.useCallback(() => {
|
|
12320
12528
|
setCurrentPage((page) => page + 1);
|
|
12321
12529
|
}, [setCurrentPage]);
|
|
12322
|
-
const reset =
|
|
12530
|
+
const reset = React105.useCallback(() => {
|
|
12323
12531
|
setCurrentPage(1);
|
|
12324
12532
|
}, [setCurrentPage]);
|
|
12325
|
-
|
|
12533
|
+
React105.useEffect(() => {
|
|
12326
12534
|
if (autoReset) {
|
|
12327
12535
|
setCurrentPage(1);
|
|
12328
12536
|
}
|
|
@@ -12337,9 +12545,9 @@ var useStaticInfiniteList = ({
|
|
|
12337
12545
|
};
|
|
12338
12546
|
|
|
12339
12547
|
// src/molecules/ListItem/ListItem.tsx
|
|
12340
|
-
import
|
|
12548
|
+
import React106 from "react";
|
|
12341
12549
|
var ListItem = ({ name, icon, active = false }) => {
|
|
12342
|
-
return /* @__PURE__ */
|
|
12550
|
+
return /* @__PURE__ */ React106.createElement(Box.Flex, { className: "Aquarium-ListItem", alignItems: "center" }, /* @__PURE__ */ React106.createElement(
|
|
12343
12551
|
Typography2,
|
|
12344
12552
|
{
|
|
12345
12553
|
variant: active ? "default-strong" : "default",
|
|
@@ -12347,13 +12555,13 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
|
12347
12555
|
htmlTag: "span",
|
|
12348
12556
|
className: `px-4 py-2 rounded-full ${active ? "bg-medium" : "hover:bg-muted"}`
|
|
12349
12557
|
},
|
|
12350
|
-
/* @__PURE__ */
|
|
12558
|
+
/* @__PURE__ */ React106.createElement("img", { src: icon, alt: "", className: "inline mr-4", height: 28, width: 28 }),
|
|
12351
12559
|
name
|
|
12352
12560
|
));
|
|
12353
12561
|
};
|
|
12354
12562
|
|
|
12355
12563
|
// src/molecules/Modal/Modal.tsx
|
|
12356
|
-
import
|
|
12564
|
+
import React107 from "react";
|
|
12357
12565
|
import { Dialog as AriaDialog4, Modal as AriaModal3, ModalOverlay as AriaModalOverlay3 } from "react-aria-components";
|
|
12358
12566
|
import { clsx as clsx32 } from "clsx";
|
|
12359
12567
|
import { castArray as castArray5, isEmpty as isEmpty2, omit as omit12 } from "lodash-es";
|
|
@@ -12375,7 +12583,7 @@ var Modal2 = ({
|
|
|
12375
12583
|
const styles = modalStyles({ kind: "dialog", size });
|
|
12376
12584
|
const hasTabs = isComponentType(children, ModalTabs);
|
|
12377
12585
|
const hasActions = secondaryActions && !isEmpty2(secondaryActions) || primaryAction;
|
|
12378
|
-
return /* @__PURE__ */
|
|
12586
|
+
return /* @__PURE__ */ React107.createElement(
|
|
12379
12587
|
AriaModalOverlay3,
|
|
12380
12588
|
{
|
|
12381
12589
|
isOpen: open,
|
|
@@ -12384,43 +12592,43 @@ var Modal2 = ({
|
|
|
12384
12592
|
isKeyboardDismissDisabled: !closeOnEsc,
|
|
12385
12593
|
className: styles.overlay({ className: "Aquarium-Modal" })
|
|
12386
12594
|
},
|
|
12387
|
-
size !== "screen" && /* @__PURE__ */
|
|
12388
|
-
/* @__PURE__ */
|
|
12595
|
+
size !== "screen" && /* @__PURE__ */ React107.createElement(Modal.BackDrop, { className: styles.backdrop() }),
|
|
12596
|
+
/* @__PURE__ */ React107.createElement(AriaModal3, { className: styles.dialog() }, /* @__PURE__ */ React107.createElement(AriaDialog4, { className: "flex flex-col grow overflow-y-auto outline-none" }, ({ close }) => /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React107.createElement(Button2.Icon, { "aria-label": "Close", icon: cross_default, onClick: close })), headerImage !== void 0 && /* @__PURE__ */ React107.createElement(Modal.HeaderImage, { backgroundImage: headerImage }), /* @__PURE__ */ React107.createElement(
|
|
12389
12597
|
Modal.Header,
|
|
12390
12598
|
{
|
|
12391
12599
|
kind: "dialog",
|
|
12392
12600
|
size,
|
|
12393
12601
|
className: clsx32({ "pb-3": isComponentType(children, ModalTabs) })
|
|
12394
12602
|
},
|
|
12395
|
-
/* @__PURE__ */
|
|
12396
|
-
), hasTabs ?
|
|
12603
|
+
/* @__PURE__ */ React107.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React107.createElement(ModalTitle, { kind: "dialog" }, title), subtitle && /* @__PURE__ */ React107.createElement(Modal.Subtitle, null, subtitle))
|
|
12604
|
+
), hasTabs ? React107.cloneElement(children, { className: "[&>div:first-child]:px-5 grow" }) : /* @__PURE__ */ React107.createElement(Modal.Body, { tabIndex: 0, noFooter: !hasActions, size }, children), hasActions && /* @__PURE__ */ React107.createElement(Modal.Footer, null, /* @__PURE__ */ React107.createElement(Modal.Actions, null, secondaryActions && castArray5(secondaryActions).filter(Boolean).map(({ text, ...action }) => /* @__PURE__ */ React107.createElement(Button2.Secondary, { key: text, ...action }, text)), primaryAction && /* @__PURE__ */ React107.createElement(Button2.Primary, { key: primaryAction.text, ...omit12(primaryAction, "text") }, primaryAction.text))))))
|
|
12397
12605
|
);
|
|
12398
12606
|
};
|
|
12399
12607
|
var ModalTabs = createTabsComponent(
|
|
12400
12608
|
ModalTab,
|
|
12401
12609
|
TabItem,
|
|
12402
12610
|
"ModalTabs",
|
|
12403
|
-
(children, selected, props) => /* @__PURE__ */
|
|
12611
|
+
(children, selected, props) => /* @__PURE__ */ React107.createElement(Modal.Body, { maxHeight: props.maxHeight }, /* @__PURE__ */ React107.createElement(TabContainer, null, children.find(
|
|
12404
12612
|
(node, index) => node?.props.value === selected || index === selected
|
|
12405
12613
|
)))
|
|
12406
12614
|
);
|
|
12407
12615
|
|
|
12408
12616
|
// src/molecules/MultiInput/MultiInput.tsx
|
|
12409
|
-
import
|
|
12617
|
+
import React109, { useEffect as useEffect12, useRef as useRef14, useState as useState12 } from "react";
|
|
12410
12618
|
import { useId as useId13 } from "@react-aria/utils";
|
|
12411
12619
|
import { castArray as castArray6, identity, omit as omit13 } from "lodash-es";
|
|
12412
12620
|
|
|
12413
12621
|
// src/molecules/MultiInput/InputChip.tsx
|
|
12414
|
-
import
|
|
12622
|
+
import React108 from "react";
|
|
12415
12623
|
import { clsx as clsx33 } from "clsx";
|
|
12416
|
-
var InputChip =
|
|
12624
|
+
var InputChip = React108.forwardRef(
|
|
12417
12625
|
({ invalid = false, disabled, readOnly, className, onClick: _onClick, children, ...props }, ref) => {
|
|
12418
12626
|
const onClick = (e) => {
|
|
12419
12627
|
if (!disabled && !readOnly) {
|
|
12420
12628
|
_onClick?.(e);
|
|
12421
12629
|
}
|
|
12422
12630
|
};
|
|
12423
|
-
return /* @__PURE__ */
|
|
12631
|
+
return /* @__PURE__ */ React108.createElement(
|
|
12424
12632
|
"div",
|
|
12425
12633
|
{
|
|
12426
12634
|
className: clsx33(
|
|
@@ -12433,8 +12641,8 @@ var InputChip = React107.forwardRef(
|
|
|
12433
12641
|
}
|
|
12434
12642
|
)
|
|
12435
12643
|
},
|
|
12436
|
-
/* @__PURE__ */
|
|
12437
|
-
!readOnly && /* @__PURE__ */
|
|
12644
|
+
/* @__PURE__ */ React108.createElement("div", { className: "px-2 py-1" }, /* @__PURE__ */ React108.createElement(Typography2, { variant: "default", color: invalid ? "danger-default" : disabled ? "inactive" : "default" }, children)),
|
|
12645
|
+
!readOnly && /* @__PURE__ */ React108.createElement(
|
|
12438
12646
|
"div",
|
|
12439
12647
|
{
|
|
12440
12648
|
ref,
|
|
@@ -12448,7 +12656,7 @@ var InputChip = React107.forwardRef(
|
|
|
12448
12656
|
role: "button",
|
|
12449
12657
|
"aria-label": `Remove ${String(children)}`
|
|
12450
12658
|
},
|
|
12451
|
-
!disabled && /* @__PURE__ */
|
|
12659
|
+
!disabled && /* @__PURE__ */ React108.createElement(
|
|
12452
12660
|
Icon,
|
|
12453
12661
|
{
|
|
12454
12662
|
icon: smallCross_default,
|
|
@@ -12487,11 +12695,11 @@ var MultiInputBase = ({
|
|
|
12487
12695
|
valid = true,
|
|
12488
12696
|
...props
|
|
12489
12697
|
}) => {
|
|
12490
|
-
const inputRef =
|
|
12698
|
+
const inputRef = useRef14(null);
|
|
12491
12699
|
const [items, setItems] = useState12(value ?? defaultValue ?? []);
|
|
12492
12700
|
const [hasFocus, setFocus] = useState12(false);
|
|
12493
12701
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
|
12494
|
-
|
|
12702
|
+
useEffect12(() => {
|
|
12495
12703
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
|
12496
12704
|
if (requiresUpdate && JSON.stringify(value) !== JSON.stringify(items)) {
|
|
12497
12705
|
setItems(value ?? []);
|
|
@@ -12566,7 +12774,7 @@ var MultiInputBase = ({
|
|
|
12566
12774
|
}
|
|
12567
12775
|
onBlur?.();
|
|
12568
12776
|
};
|
|
12569
|
-
const renderChips = () => items.map((item, index) => /* @__PURE__ */
|
|
12777
|
+
const renderChips = () => items.map((item, index) => /* @__PURE__ */ React109.createElement(
|
|
12570
12778
|
InputChip,
|
|
12571
12779
|
{
|
|
12572
12780
|
key: `${itemToString(item)}.${index}`,
|
|
@@ -12580,12 +12788,12 @@ var MultiInputBase = ({
|
|
|
12580
12788
|
},
|
|
12581
12789
|
itemToString(item)
|
|
12582
12790
|
));
|
|
12583
|
-
return /* @__PURE__ */
|
|
12791
|
+
return /* @__PURE__ */ React109.createElement("div", { className: "Aquarium-MultiInputBase" }, /* @__PURE__ */ React109.createElement(
|
|
12584
12792
|
Select.InputContainer,
|
|
12585
12793
|
{
|
|
12586
12794
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
|
12587
12795
|
},
|
|
12588
|
-
/* @__PURE__ */
|
|
12796
|
+
/* @__PURE__ */ React109.createElement("div", { className: "grow inline-flex flex-row flex-wrap gap-y-2" }, inline && renderChips(), /* @__PURE__ */ React109.createElement(
|
|
12589
12797
|
Select.Input,
|
|
12590
12798
|
{
|
|
12591
12799
|
ref: inputRef,
|
|
@@ -12607,14 +12815,14 @@ var MultiInputBase = ({
|
|
|
12607
12815
|
autoComplete: "off"
|
|
12608
12816
|
}
|
|
12609
12817
|
)),
|
|
12610
|
-
endAdornment && /* @__PURE__ */
|
|
12611
|
-
), !inline && /* @__PURE__ */
|
|
12818
|
+
endAdornment && /* @__PURE__ */ React109.createElement(InputAdornment, null, endAdornment)
|
|
12819
|
+
), !inline && /* @__PURE__ */ React109.createElement("div", { className: "flex flex-row flex-wrap gap-y-2 mt-2" }, renderChips()));
|
|
12612
12820
|
};
|
|
12613
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
|
12821
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React109.createElement(Skeleton, { height: 38 });
|
|
12614
12822
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
|
12615
12823
|
var MultiInput = (props) => {
|
|
12616
12824
|
const [value, setValue] = useState12(props.value ?? props.defaultValue ?? []);
|
|
12617
|
-
|
|
12825
|
+
useEffect12(() => {
|
|
12618
12826
|
setValue(props.value ?? []);
|
|
12619
12827
|
}, [JSON.stringify(props.value)]);
|
|
12620
12828
|
const defaultId = useId13();
|
|
@@ -12623,7 +12831,7 @@ var MultiInput = (props) => {
|
|
|
12623
12831
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
12624
12832
|
const labelControlProps = getLabelControlProps(props);
|
|
12625
12833
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
|
12626
|
-
return /* @__PURE__ */
|
|
12834
|
+
return /* @__PURE__ */ React109.createElement(
|
|
12627
12835
|
LabelControl,
|
|
12628
12836
|
{
|
|
12629
12837
|
id: `${id}-label`,
|
|
@@ -12634,7 +12842,7 @@ var MultiInput = (props) => {
|
|
|
12634
12842
|
maxLength: props.maxLength,
|
|
12635
12843
|
className: "Aquarium-MultiInput"
|
|
12636
12844
|
},
|
|
12637
|
-
/* @__PURE__ */
|
|
12845
|
+
/* @__PURE__ */ React109.createElement(
|
|
12638
12846
|
MultiInputBase,
|
|
12639
12847
|
{
|
|
12640
12848
|
...baseProps,
|
|
@@ -12651,12 +12859,12 @@ var MultiInput = (props) => {
|
|
|
12651
12859
|
)
|
|
12652
12860
|
);
|
|
12653
12861
|
};
|
|
12654
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
|
12862
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React109.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React109.createElement(MultiInputBase.Skeleton, null));
|
|
12655
12863
|
MultiInput.Skeleton = MultiInputSkeleton;
|
|
12656
12864
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
|
12657
12865
|
|
|
12658
12866
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
|
12659
|
-
import
|
|
12867
|
+
import React110, { useEffect as useEffect13, useRef as useRef15, useState as useState13 } from "react";
|
|
12660
12868
|
import { ariaHideOutside as ariaHideOutside3 } from "@react-aria/overlays";
|
|
12661
12869
|
import { useId as useId14 } from "@react-aria/utils";
|
|
12662
12870
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
|
@@ -12686,10 +12894,10 @@ var MultiSelectBase = ({
|
|
|
12686
12894
|
children,
|
|
12687
12895
|
...props
|
|
12688
12896
|
}) => {
|
|
12689
|
-
const popoverRef =
|
|
12690
|
-
const targetRef =
|
|
12691
|
-
const menuRef =
|
|
12692
|
-
const inputRef =
|
|
12897
|
+
const popoverRef = useRef15(null);
|
|
12898
|
+
const targetRef = useRef15(null);
|
|
12899
|
+
const menuRef = useRef15(null);
|
|
12900
|
+
const inputRef = useRef15(null);
|
|
12693
12901
|
const [inputValue, setInputValue] = useState13("");
|
|
12694
12902
|
const [hasFocus, setFocus] = useState13(false);
|
|
12695
12903
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = useMultipleSelection(
|
|
@@ -12769,12 +12977,12 @@ var MultiSelectBase = ({
|
|
|
12769
12977
|
*/
|
|
12770
12978
|
scrollIntoView: (node, _menuNode) => node.scrollIntoView({ block: "nearest" })
|
|
12771
12979
|
});
|
|
12772
|
-
|
|
12980
|
+
useEffect13(() => {
|
|
12773
12981
|
if (isOpen && inputRef.current && popoverRef.current) {
|
|
12774
12982
|
return ariaHideOutside3([inputRef.current, popoverRef.current]);
|
|
12775
12983
|
}
|
|
12776
12984
|
}, [isOpen, inputRef, popoverRef]);
|
|
12777
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
|
12985
|
+
const renderItem = (item, index) => /* @__PURE__ */ React110.createElement(
|
|
12778
12986
|
Select.Item,
|
|
12779
12987
|
{
|
|
12780
12988
|
key: itemToString(item),
|
|
@@ -12784,9 +12992,9 @@ var MultiSelectBase = ({
|
|
|
12784
12992
|
},
|
|
12785
12993
|
renderOption(item)
|
|
12786
12994
|
);
|
|
12787
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
|
12995
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ React110.createElement(React110.Fragment, { key: group.label }, /* @__PURE__ */ React110.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
|
12788
12996
|
const renderChips = () => {
|
|
12789
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
|
12997
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React110.createElement(
|
|
12790
12998
|
InputChip,
|
|
12791
12999
|
{
|
|
12792
13000
|
key: `${itemToString(selectedItem)}.chip`,
|
|
@@ -12808,13 +13016,13 @@ var MultiSelectBase = ({
|
|
|
12808
13016
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
|
12809
13017
|
);
|
|
12810
13018
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
|
12811
|
-
return /* @__PURE__ */
|
|
13019
|
+
return /* @__PURE__ */ React110.createElement("div", { className: "Aquarium-MultiSelectBase relative" }, /* @__PURE__ */ React110.createElement(
|
|
12812
13020
|
Select.InputContainer,
|
|
12813
13021
|
{
|
|
12814
13022
|
ref: targetRef,
|
|
12815
13023
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
|
12816
13024
|
},
|
|
12817
|
-
/* @__PURE__ */
|
|
13025
|
+
/* @__PURE__ */ React110.createElement("div", { className: "grow inline-flex flex-row flex-wrap gap-2" }, !hideChips && inline && renderChips(), /* @__PURE__ */ React110.createElement(
|
|
12818
13026
|
Select.Input,
|
|
12819
13027
|
{
|
|
12820
13028
|
name,
|
|
@@ -12836,8 +13044,8 @@ var MultiSelectBase = ({
|
|
|
12836
13044
|
}
|
|
12837
13045
|
}
|
|
12838
13046
|
)),
|
|
12839
|
-
!readOnly && /* @__PURE__ */
|
|
12840
|
-
), !hideChips && !inline && /* @__PURE__ */
|
|
13047
|
+
!readOnly && /* @__PURE__ */ React110.createElement(Select.Toggle, { hasFocus, isOpen, ...getToggleButtonProps({ disabled }) })
|
|
13048
|
+
), !hideChips && !inline && /* @__PURE__ */ React110.createElement("div", { className: "flex flex-row flex-wrap gap-2 mt-2" }, renderChips()), /* @__PURE__ */ React110.createElement(
|
|
12841
13049
|
Popover,
|
|
12842
13050
|
{
|
|
12843
13051
|
ref: popoverRef,
|
|
@@ -12847,12 +13055,12 @@ var MultiSelectBase = ({
|
|
|
12847
13055
|
isNonModal: true,
|
|
12848
13056
|
style: { width: targetRef.current?.offsetWidth }
|
|
12849
13057
|
},
|
|
12850
|
-
/* @__PURE__ */
|
|
13058
|
+
/* @__PURE__ */ React110.createElement(Select.Menu, { maxHeight, ...menuProps }, hasNoResults && /* @__PURE__ */ React110.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
|
12851
13059
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
|
12852
13060
|
))
|
|
12853
13061
|
));
|
|
12854
13062
|
};
|
|
12855
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
|
13063
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React110.createElement(Skeleton, { height: 38 });
|
|
12856
13064
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
|
12857
13065
|
var MultiSelect = ({
|
|
12858
13066
|
options,
|
|
@@ -12865,7 +13073,7 @@ var MultiSelect = ({
|
|
|
12865
13073
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
12866
13074
|
const labelControlProps = getLabelControlProps(props);
|
|
12867
13075
|
const baseProps = omit14(props, Object.keys(labelControlProps));
|
|
12868
|
-
return /* @__PURE__ */
|
|
13076
|
+
return /* @__PURE__ */ React110.createElement(
|
|
12869
13077
|
LabelControl,
|
|
12870
13078
|
{
|
|
12871
13079
|
id: `${id}-label`,
|
|
@@ -12874,7 +13082,7 @@ var MultiSelect = ({
|
|
|
12874
13082
|
...labelControlProps,
|
|
12875
13083
|
className: "Aquarium-MultiSelect"
|
|
12876
13084
|
},
|
|
12877
|
-
/* @__PURE__ */
|
|
13085
|
+
/* @__PURE__ */ React110.createElement(
|
|
12878
13086
|
MultiSelectBase,
|
|
12879
13087
|
{
|
|
12880
13088
|
...baseProps,
|
|
@@ -12888,16 +13096,16 @@ var MultiSelect = ({
|
|
|
12888
13096
|
)
|
|
12889
13097
|
);
|
|
12890
13098
|
};
|
|
12891
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
|
13099
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React110.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React110.createElement(MultiSelectBase.Skeleton, null));
|
|
12892
13100
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
|
12893
13101
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
|
12894
13102
|
|
|
12895
13103
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
|
12896
|
-
import
|
|
13104
|
+
import React111 from "react";
|
|
12897
13105
|
import { useId as useId15 } from "@react-aria/utils";
|
|
12898
13106
|
import { clsx as clsx34 } from "clsx";
|
|
12899
13107
|
import { omit as omit15, uniqueId } from "lodash-es";
|
|
12900
|
-
var NativeSelectBase =
|
|
13108
|
+
var NativeSelectBase = React111.forwardRef(
|
|
12901
13109
|
({ children, disabled = false, required = false, valid = true, readOnly = false, ...props }, ref) => {
|
|
12902
13110
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
|
12903
13111
|
const defaultValue = props.defaultValue ? props.defaultValue : props.placeholder ? placeholderValue : void 0;
|
|
@@ -12914,7 +13122,7 @@ var NativeSelectBase = React110.forwardRef(
|
|
|
12914
13122
|
props.onBlur?.(event);
|
|
12915
13123
|
}
|
|
12916
13124
|
};
|
|
12917
|
-
return /* @__PURE__ */
|
|
13125
|
+
return /* @__PURE__ */ React111.createElement("span", { className: "Aquarium-NativeSelectBase relative block" }, !readOnly && /* @__PURE__ */ React111.createElement("span", { className: "absolute right-0 inset-y-0 mr-4 text-inactive flex ml-3 pointer-events-none typography-default-strong mt-4" }, /* @__PURE__ */ React111.createElement(Icon, { icon: caretDown_default, "data-testid": "icon-dropdown" })), /* @__PURE__ */ React111.createElement(
|
|
12918
13126
|
"select",
|
|
12919
13127
|
{
|
|
12920
13128
|
ref,
|
|
@@ -12934,13 +13142,13 @@ var NativeSelectBase = React110.forwardRef(
|
|
|
12934
13142
|
props.className
|
|
12935
13143
|
)
|
|
12936
13144
|
},
|
|
12937
|
-
props.placeholder && /* @__PURE__ */
|
|
13145
|
+
props.placeholder && /* @__PURE__ */ React111.createElement("option", { value: placeholderValue, disabled: true }, props.placeholder),
|
|
12938
13146
|
children
|
|
12939
13147
|
));
|
|
12940
13148
|
}
|
|
12941
13149
|
);
|
|
12942
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
|
12943
|
-
var NativeSelect =
|
|
13150
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React111.createElement(Skeleton, { height: 38 });
|
|
13151
|
+
var NativeSelect = React111.forwardRef(
|
|
12944
13152
|
({ readOnly, ...props }, ref) => {
|
|
12945
13153
|
const defaultId = useId15();
|
|
12946
13154
|
const id = props.id ?? defaultId;
|
|
@@ -12948,7 +13156,7 @@ var NativeSelect = React110.forwardRef(
|
|
|
12948
13156
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
12949
13157
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
|
12950
13158
|
const baseProps = omit15(props, Object.keys(labelControlProps));
|
|
12951
|
-
return /* @__PURE__ */
|
|
13159
|
+
return /* @__PURE__ */ React111.createElement(
|
|
12952
13160
|
LabelControl,
|
|
12953
13161
|
{
|
|
12954
13162
|
id: `${id}-label`,
|
|
@@ -12957,7 +13165,7 @@ var NativeSelect = React110.forwardRef(
|
|
|
12957
13165
|
...labelControlProps,
|
|
12958
13166
|
className: "Aquarium-NativeSelect"
|
|
12959
13167
|
},
|
|
12960
|
-
/* @__PURE__ */
|
|
13168
|
+
/* @__PURE__ */ React111.createElement(
|
|
12961
13169
|
NativeSelectBase,
|
|
12962
13170
|
{
|
|
12963
13171
|
ref,
|
|
@@ -12976,21 +13184,21 @@ var NativeSelect = React110.forwardRef(
|
|
|
12976
13184
|
}
|
|
12977
13185
|
);
|
|
12978
13186
|
NativeSelect.displayName = "NativeSelect";
|
|
12979
|
-
var Option =
|
|
12980
|
-
return /* @__PURE__ */
|
|
13187
|
+
var Option = React111.forwardRef(({ children, ...props }, ref) => {
|
|
13188
|
+
return /* @__PURE__ */ React111.createElement("option", { ref, ...props }, children);
|
|
12981
13189
|
});
|
|
12982
13190
|
Option.displayName = "Option";
|
|
12983
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
|
13191
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React111.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React111.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React111.createElement("div", { style: { height: "1px" } }));
|
|
12984
13192
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
|
12985
13193
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
|
12986
13194
|
|
|
12987
13195
|
// src/molecules/Navigation/Navigation.tsx
|
|
12988
|
-
import
|
|
13196
|
+
import React113 from "react";
|
|
12989
13197
|
import { clsx as clsx35 } from "clsx";
|
|
12990
13198
|
import { uniqueId as uniqueId2 } from "lodash-es";
|
|
12991
13199
|
|
|
12992
13200
|
// src/atoms/Navigation/Navigation.tsx
|
|
12993
|
-
import
|
|
13201
|
+
import React112 from "react";
|
|
12994
13202
|
import { tv as tv28 } from "tailwind-variants";
|
|
12995
13203
|
var navigationClasses = tv28({
|
|
12996
13204
|
slots: {
|
|
@@ -13029,35 +13237,35 @@ var Navigation = ({
|
|
|
13029
13237
|
...rest
|
|
13030
13238
|
}) => {
|
|
13031
13239
|
const { nav, list } = navigationClasses();
|
|
13032
|
-
return /* @__PURE__ */
|
|
13240
|
+
return /* @__PURE__ */ React112.createElement("nav", { className: nav(), "aria-label": ariaLabel }, /* @__PURE__ */ React112.createElement("ul", { ...rest, className: list({ className }), role: "menubar" }, children));
|
|
13033
13241
|
};
|
|
13034
13242
|
var Header = ({ className, ...rest }) => {
|
|
13035
13243
|
const { header } = navigationClasses();
|
|
13036
|
-
return /* @__PURE__ */
|
|
13244
|
+
return /* @__PURE__ */ React112.createElement("li", { ...rest, role: "presentation", className: header({ className }) });
|
|
13037
13245
|
};
|
|
13038
13246
|
var Title2 = ({ className, ...props }) => {
|
|
13039
13247
|
const { headerTitle } = navigationClasses();
|
|
13040
|
-
return /* @__PURE__ */
|
|
13248
|
+
return /* @__PURE__ */ React112.createElement(Typography, { variant: "small", className: headerTitle({ className }), ...props });
|
|
13041
13249
|
};
|
|
13042
13250
|
var Subtitle = ({ className, ...props }) => {
|
|
13043
13251
|
const { headerSubtitle } = navigationClasses();
|
|
13044
|
-
return /* @__PURE__ */
|
|
13252
|
+
return /* @__PURE__ */ React112.createElement(Typography, { variant: "default-strong", className: headerSubtitle({ className }), ...props });
|
|
13045
13253
|
};
|
|
13046
13254
|
var Footer = ({ className, ...rest }) => {
|
|
13047
13255
|
const { footer } = navigationClasses();
|
|
13048
|
-
return /* @__PURE__ */
|
|
13256
|
+
return /* @__PURE__ */ React112.createElement("li", { ...rest, role: "presentation", className: footer({ className }) });
|
|
13049
13257
|
};
|
|
13050
13258
|
var Section2 = ({ title, className, ...rest }) => {
|
|
13051
13259
|
const { sectionContainer, sectionTitle, sectionList } = navigationClasses();
|
|
13052
|
-
return /* @__PURE__ */
|
|
13260
|
+
return /* @__PURE__ */ React112.createElement("li", { role: "presentation", className: sectionContainer() }, title && /* @__PURE__ */ React112.createElement("div", { className: sectionTitle({ className }) }, title), /* @__PURE__ */ React112.createElement("ul", { ...rest, role: "group", className: sectionList({ className }) }));
|
|
13053
13261
|
};
|
|
13054
13262
|
var Divider3 = ({ className, ...rest }) => {
|
|
13055
13263
|
const { divider } = navigationClasses();
|
|
13056
|
-
return /* @__PURE__ */
|
|
13264
|
+
return /* @__PURE__ */ React112.createElement("li", { "aria-hidden": true, ...rest, className: divider({ className }) });
|
|
13057
13265
|
};
|
|
13058
13266
|
var Item4 = ({ className, active = false, ...rest }) => {
|
|
13059
13267
|
const { itemContainer, itemAnchor } = navigationClasses({ active });
|
|
13060
|
-
return /* @__PURE__ */
|
|
13268
|
+
return /* @__PURE__ */ React112.createElement("li", { role: "presentation", className: itemContainer() }, /* @__PURE__ */ React112.createElement("a", { ...rest, role: "menuitem", className: itemAnchor({ className }) }));
|
|
13061
13269
|
};
|
|
13062
13270
|
var Submenu = ({
|
|
13063
13271
|
children,
|
|
@@ -13067,11 +13275,11 @@ var Submenu = ({
|
|
|
13067
13275
|
...rest
|
|
13068
13276
|
}) => {
|
|
13069
13277
|
const { submenuContainer, submenuAnchor, submenuList } = navigationClasses();
|
|
13070
|
-
return /* @__PURE__ */
|
|
13278
|
+
return /* @__PURE__ */ React112.createElement("li", { role: "presentation", className: submenuContainer() }, /* @__PURE__ */ React112.createElement("a", { role: "menuitem", "aria-haspopup": "true", href: "#", id, className: submenuAnchor({ className }), ...rest }, title), /* @__PURE__ */ React112.createElement("ul", { role: "menu", className: submenuList(), "aria-labelledby": id }, children));
|
|
13071
13279
|
};
|
|
13072
13280
|
var SubmenuItem = ({ className, active, ...rest }) => {
|
|
13073
13281
|
const { submenuItem } = navigationClasses();
|
|
13074
|
-
return /* @__PURE__ */
|
|
13282
|
+
return /* @__PURE__ */ React112.createElement(Navigation.Item, { ...rest, active, className: submenuItem({ className }) });
|
|
13075
13283
|
};
|
|
13076
13284
|
Header.Title = Title2;
|
|
13077
13285
|
Header.Subtitle = Subtitle;
|
|
@@ -13084,20 +13292,20 @@ Navigation.Submenu = Submenu;
|
|
|
13084
13292
|
Navigation.Divider = Divider3;
|
|
13085
13293
|
|
|
13086
13294
|
// src/molecules/Navigation/Navigation.tsx
|
|
13087
|
-
var Navigation2 = ({ className, ...props }) => /* @__PURE__ */
|
|
13295
|
+
var Navigation2 = ({ className, ...props }) => /* @__PURE__ */ React113.createElement(Navigation, { className: clsx35("Aquarium-Navigation", className), ...props });
|
|
13088
13296
|
var Item5 = ({
|
|
13089
13297
|
children,
|
|
13090
13298
|
icon,
|
|
13091
13299
|
showNotification = false,
|
|
13092
13300
|
...rest
|
|
13093
|
-
}) => /* @__PURE__ */
|
|
13301
|
+
}) => /* @__PURE__ */ React113.createElement(Navigation.Item, { ...rest }, icon && showNotification && /* @__PURE__ */ React113.createElement(Badge.Notification, null, /* @__PURE__ */ React113.createElement(InlineIcon, { icon, width: "20px", height: "20px" })), icon && !showNotification && /* @__PURE__ */ React113.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), children);
|
|
13094
13302
|
var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
|
|
13095
|
-
const [open, setOpen] =
|
|
13303
|
+
const [open, setOpen] = React113.useState(defaultOpen);
|
|
13096
13304
|
const id = uniqueId2();
|
|
13097
|
-
return /* @__PURE__ */
|
|
13305
|
+
return /* @__PURE__ */ React113.createElement(
|
|
13098
13306
|
Navigation.Submenu,
|
|
13099
13307
|
{
|
|
13100
|
-
title: /* @__PURE__ */
|
|
13308
|
+
title: /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(InlineIcon, { icon: open ? caretUpFilled_default : caretDownFilled_default, width: "12px", height: "12px", className: "mr-1" }), /* @__PURE__ */ React113.createElement(Box.Flex, { paddingX: "1", gap: "4" }, icon && /* @__PURE__ */ React113.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), title)),
|
|
13101
13309
|
"aria-expanded": open,
|
|
13102
13310
|
id,
|
|
13103
13311
|
onClick: (e) => {
|
|
@@ -13105,7 +13313,7 @@ var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
|
|
|
13105
13313
|
setOpen(!open);
|
|
13106
13314
|
}
|
|
13107
13315
|
},
|
|
13108
|
-
open && /* @__PURE__ */
|
|
13316
|
+
open && /* @__PURE__ */ React113.createElement("ul", { role: "menu", className: "flex flex-col", "aria-labelledby": id }, children)
|
|
13109
13317
|
);
|
|
13110
13318
|
};
|
|
13111
13319
|
Submenu2.Item = Navigation.Submenu.Item;
|
|
@@ -13117,11 +13325,11 @@ Navigation2.Section = Navigation.Section;
|
|
|
13117
13325
|
Navigation2.Submenu = Submenu2;
|
|
13118
13326
|
|
|
13119
13327
|
// src/molecules/PageHeader/PageHeader.tsx
|
|
13120
|
-
import
|
|
13328
|
+
import React115 from "react";
|
|
13121
13329
|
import { castArray as castArray7 } from "lodash-es";
|
|
13122
13330
|
|
|
13123
13331
|
// src/atoms/PageHeader/PageHeader.tsx
|
|
13124
|
-
import
|
|
13332
|
+
import React114 from "react";
|
|
13125
13333
|
import { tv as tv29 } from "tailwind-variants";
|
|
13126
13334
|
var pageHeaderStyles = tv29({
|
|
13127
13335
|
slots: {
|
|
@@ -13133,10 +13341,10 @@ var pageHeaderStyles = tv29({
|
|
|
13133
13341
|
}
|
|
13134
13342
|
});
|
|
13135
13343
|
var { base, container, titleContainer, chips, actions } = pageHeaderStyles();
|
|
13136
|
-
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13137
|
-
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13138
|
-
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13139
|
-
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */
|
|
13344
|
+
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */ React114.createElement("div", { className: base({ className }), ...rest }, children);
|
|
13345
|
+
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */ React114.createElement("div", { className: container({ className }), ...rest }, children);
|
|
13346
|
+
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */ React114.createElement("div", { className: titleContainer({ className }), ...rest }, children);
|
|
13347
|
+
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */ React114.createElement(
|
|
13140
13348
|
Typography2,
|
|
13141
13349
|
{
|
|
13142
13350
|
...rest,
|
|
@@ -13146,9 +13354,9 @@ PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__
|
|
|
13146
13354
|
},
|
|
13147
13355
|
children
|
|
13148
13356
|
);
|
|
13149
|
-
PageHeader.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
|
13150
|
-
PageHeader.Chips = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13151
|
-
PageHeader.Actions = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13357
|
+
PageHeader.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React114.createElement(Typography2.Default, { ...rest, color: "default" }, children);
|
|
13358
|
+
PageHeader.Chips = ({ children, className, ...rest }) => /* @__PURE__ */ React114.createElement("div", { className: chips({ className }), ...rest }, children);
|
|
13359
|
+
PageHeader.Actions = ({ children, className, ...rest }) => /* @__PURE__ */ React114.createElement("div", { className: actions({ className }), ...rest }, children);
|
|
13152
13360
|
|
|
13153
13361
|
// src/molecules/PageHeader/PageHeader.tsx
|
|
13154
13362
|
var CommonPageHeader = ({
|
|
@@ -13173,20 +13381,20 @@ var CommonPageHeader = ({
|
|
|
13173
13381
|
"Limit the combined `primaryAction` and `secondaryActions` to 2 actions. Use the `menu` prop for additional actions."
|
|
13174
13382
|
);
|
|
13175
13383
|
}
|
|
13176
|
-
return /* @__PURE__ */
|
|
13384
|
+
return /* @__PURE__ */ React115.createElement(PageHeader, { className: "Aquarium-PageHeader" }, /* @__PURE__ */ React115.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React115.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React115.createElement(Spacing, { row: true, gap: "4" }, image && /* @__PURE__ */ React115.createElement("img", { src: image, alt: imageAlt ?? "", className: "size-[48px]" }), /* @__PURE__ */ React115.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React115.createElement(PageHeader.Title, { isSubHeader }, title), chips2.length > 0 && /* @__PURE__ */ React115.createElement(PageHeader.Chips, null, chips2.map((chip) => /* @__PURE__ */ React115.createElement(Chip2, { key: chip, dense: true, text: chip }))), subtitle && /* @__PURE__ */ React115.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions ?? primaryAction ?? secondaryAction ?? menu) && /* @__PURE__ */ React115.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React115.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React115.createElement(
|
|
13177
13385
|
DropdownMenu2,
|
|
13178
13386
|
{
|
|
13179
13387
|
placement: defaultContextualMenuPlacement,
|
|
13180
13388
|
onAction: (action) => onAction(action),
|
|
13181
13389
|
onOpenChange: onMenuOpenChange
|
|
13182
13390
|
},
|
|
13183
|
-
/* @__PURE__ */
|
|
13391
|
+
/* @__PURE__ */ React115.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React115.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: more_default })),
|
|
13184
13392
|
menu
|
|
13185
13393
|
)), secondaryActions && castArray7(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
|
13186
13394
|
};
|
|
13187
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
|
13395
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React115.createElement(CommonPageHeader, { ...props });
|
|
13188
13396
|
PageHeader2.displayName = "PageHeader";
|
|
13189
|
-
var SubHeader = (props) => /* @__PURE__ */
|
|
13397
|
+
var SubHeader = (props) => /* @__PURE__ */ React115.createElement(CommonPageHeader, { ...props, isSubHeader: true });
|
|
13190
13398
|
PageHeader2.SubHeader = SubHeader;
|
|
13191
13399
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
|
13192
13400
|
|
|
@@ -13202,17 +13410,17 @@ var usePopoverContext = () => {
|
|
|
13202
13410
|
};
|
|
13203
13411
|
|
|
13204
13412
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
|
13205
|
-
import
|
|
13413
|
+
import React117, { createContext as createContext8 } from "react";
|
|
13206
13414
|
import { noop as noop3, omit as omit16 } from "lodash-es";
|
|
13207
13415
|
|
|
13208
13416
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
|
13209
|
-
import
|
|
13417
|
+
import React116 from "react";
|
|
13210
13418
|
import { clsx as clsx36 } from "clsx";
|
|
13211
|
-
var Header2 = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13212
|
-
var Title3 = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13213
|
-
var Body = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13214
|
-
var Footer2 = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13215
|
-
var Actions3 = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13419
|
+
var Header2 = ({ children, className, ...rest }) => /* @__PURE__ */ React116.createElement("div", { ...rest, className: clsx36("p-5 gap-3 flex items-center", className) }, children);
|
|
13420
|
+
var Title3 = ({ children, className, ...rest }) => /* @__PURE__ */ React116.createElement(Typography, { ...rest, htmlTag: "h1", variant: "default-strong" }, children);
|
|
13421
|
+
var Body = ({ children, className, ...rest }) => /* @__PURE__ */ React116.createElement(Typography, { ...rest, htmlTag: "div", variant: "small", className: clsx36("px-5 overflow-y-auto", className) }, children);
|
|
13422
|
+
var Footer2 = ({ children, className, ...rest }) => /* @__PURE__ */ React116.createElement("div", { ...rest, className: clsx36("p-5", className) }, children);
|
|
13423
|
+
var Actions3 = ({ children, className, ...rest }) => /* @__PURE__ */ React116.createElement("div", { ...rest, className: clsx36("flex gap-4", className) }, children);
|
|
13216
13424
|
var PopoverDialog = {
|
|
13217
13425
|
Header: Header2,
|
|
13218
13426
|
Title: Title3,
|
|
@@ -13227,12 +13435,12 @@ var PopoverDialogPropsContext = createContext8({
|
|
|
13227
13435
|
primaryAction: { text: "", onClick: noop3 }
|
|
13228
13436
|
});
|
|
13229
13437
|
var PopoverDialog2 = ({ placement, open, children, ...props }) => {
|
|
13230
|
-
return /* @__PURE__ */
|
|
13438
|
+
return /* @__PURE__ */ React117.createElement(Popover2, { placement }, /* @__PURE__ */ React117.createElement(PopoverDialogPropsContext.Provider, { value: props }, children));
|
|
13231
13439
|
};
|
|
13232
13440
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
|
13233
13441
|
var Prompt = ({ children }) => {
|
|
13234
|
-
const { title, primaryAction, secondaryAction } =
|
|
13235
|
-
return /* @__PURE__ */
|
|
13442
|
+
const { title, primaryAction, secondaryAction } = React117.useContext(PopoverDialogPropsContext);
|
|
13443
|
+
return /* @__PURE__ */ React117.createElement(Popover2.Panel, { className: "Aquarium-PopoverDialog max-w-[300px]" }, /* @__PURE__ */ React117.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React117.createElement(PopoverDialog.Title, null, title)), /* @__PURE__ */ React117.createElement(PopoverDialog.Body, null, children), /* @__PURE__ */ React117.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React117.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React117.createElement(Popover2.CloseToggle, null, /* @__PURE__ */ React117.createElement(Button2, { key: secondaryAction.text, kind: "secondary", dense: true, ...omit16(secondaryAction, "text") }, secondaryAction.text)), /* @__PURE__ */ React117.createElement(Popover2.CloseToggle, null, /* @__PURE__ */ React117.createElement(Button2, { key: primaryAction.text, kind: "ghost", dense: true, ...omit16(primaryAction, "text") }, primaryAction.text)))));
|
|
13236
13444
|
};
|
|
13237
13445
|
Prompt.displayName = "PopoverDialog.Prompt";
|
|
13238
13446
|
PopoverDialog2.Prompt = Prompt;
|
|
@@ -13242,10 +13450,10 @@ import { createPortal } from "react-dom";
|
|
|
13242
13450
|
var Portal = ({ children, to }) => createPortal(children, to);
|
|
13243
13451
|
|
|
13244
13452
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
|
13245
|
-
import
|
|
13453
|
+
import React119 from "react";
|
|
13246
13454
|
|
|
13247
13455
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
|
13248
|
-
import
|
|
13456
|
+
import React118 from "react";
|
|
13249
13457
|
import { clamp as clamp3 } from "lodash-es";
|
|
13250
13458
|
import { tv as tv30 } from "tailwind-variants";
|
|
13251
13459
|
var progressBarClasses = tv30({
|
|
@@ -13265,10 +13473,10 @@ var progressBarIndicatorClasses = tv30({
|
|
|
13265
13473
|
var progressBarLabelsClasses = tv30({
|
|
13266
13474
|
base: "flex flex-row"
|
|
13267
13475
|
});
|
|
13268
|
-
var ProgressBar = ({ children, className, ...rest }) => /* @__PURE__ */
|
|
13476
|
+
var ProgressBar = ({ children, className, ...rest }) => /* @__PURE__ */ React118.createElement("div", { ...rest, className: progressBarClasses({ className }) }, children);
|
|
13269
13477
|
ProgressBar.Indicator = ({ min, max, value, "aria-label": ariaLabel, status, className, ...rest }) => {
|
|
13270
13478
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
|
13271
|
-
return /* @__PURE__ */
|
|
13479
|
+
return /* @__PURE__ */ React118.createElement(
|
|
13272
13480
|
"div",
|
|
13273
13481
|
{
|
|
13274
13482
|
...rest,
|
|
@@ -13282,7 +13490,7 @@ ProgressBar.Indicator = ({ min, max, value, "aria-label": ariaLabel, status, cla
|
|
|
13282
13490
|
}
|
|
13283
13491
|
);
|
|
13284
13492
|
};
|
|
13285
|
-
ProgressBar.Labels = ({ children, startLabel, endLabel, className, ...rest }) => /* @__PURE__ */
|
|
13493
|
+
ProgressBar.Labels = ({ children, startLabel, endLabel, className, ...rest }) => /* @__PURE__ */ React118.createElement("div", { className: progressBarLabelsClasses({ className }) }, /* @__PURE__ */ React118.createElement("span", { ...rest, className: "grow text-default typography-small" }, startLabel), /* @__PURE__ */ React118.createElement("span", { ...rest, className: "grow text-default typography-small text-right" }, endLabel));
|
|
13286
13494
|
|
|
13287
13495
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
|
13288
13496
|
var ProgressBar2 = (props) => {
|
|
@@ -13297,7 +13505,7 @@ var ProgressBar2 = (props) => {
|
|
|
13297
13505
|
if (min > max) {
|
|
13298
13506
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
|
13299
13507
|
}
|
|
13300
|
-
const progress = /* @__PURE__ */
|
|
13508
|
+
const progress = /* @__PURE__ */ React119.createElement(ProgressBar, null, /* @__PURE__ */ React119.createElement(
|
|
13301
13509
|
ProgressBar.Indicator,
|
|
13302
13510
|
{
|
|
13303
13511
|
status: value === max ? completedStatus : progresStatus,
|
|
@@ -13310,18 +13518,18 @@ var ProgressBar2 = (props) => {
|
|
|
13310
13518
|
if (props.dense) {
|
|
13311
13519
|
return progress;
|
|
13312
13520
|
}
|
|
13313
|
-
return /* @__PURE__ */
|
|
13521
|
+
return /* @__PURE__ */ React119.createElement("div", { className: "Aquarium-ProgressBar" }, progress, /* @__PURE__ */ React119.createElement(ProgressBar.Labels, { className: "py-2", startLabel: props.startLabel, endLabel: props.endLabel }));
|
|
13314
13522
|
};
|
|
13315
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
|
13523
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React119.createElement(Skeleton, { height: 4, display: "block" });
|
|
13316
13524
|
ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
13317
13525
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
|
13318
13526
|
|
|
13319
13527
|
// src/molecules/RadioButton/RadioButton.tsx
|
|
13320
|
-
import
|
|
13321
|
-
var RadioButton2 =
|
|
13528
|
+
import React120 from "react";
|
|
13529
|
+
var RadioButton2 = React120.forwardRef(
|
|
13322
13530
|
({ name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel, ...props }, ref) => {
|
|
13323
13531
|
const isChecked = props.checked ?? props.defaultChecked;
|
|
13324
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
|
13532
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React120.createElement(
|
|
13325
13533
|
ControlLabel,
|
|
13326
13534
|
{
|
|
13327
13535
|
htmlFor: id,
|
|
@@ -13333,21 +13541,21 @@ var RadioButton2 = React119.forwardRef(
|
|
|
13333
13541
|
style: { gap: "0 8px" },
|
|
13334
13542
|
className: "Aquarium-RadioButton"
|
|
13335
13543
|
},
|
|
13336
|
-
!readOnly && /* @__PURE__ */
|
|
13544
|
+
!readOnly && /* @__PURE__ */ React120.createElement(RadioButton, { id, ref, name, ...props, readOnly, disabled })
|
|
13337
13545
|
) : null;
|
|
13338
13546
|
}
|
|
13339
13547
|
);
|
|
13340
13548
|
RadioButton2.displayName = "RadioButton";
|
|
13341
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
|
13549
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React120.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React120.createElement(Skeleton, { height: 20, width: 20 }), /* @__PURE__ */ React120.createElement(Skeleton, { height: 20, width: 150 }));
|
|
13342
13550
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
13343
13551
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
|
13344
13552
|
|
|
13345
13553
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
|
13346
|
-
import
|
|
13554
|
+
import React121 from "react";
|
|
13347
13555
|
import { useId as useId16 } from "@react-aria/utils";
|
|
13348
13556
|
import { clsx as clsx37 } from "clsx";
|
|
13349
13557
|
var isRadioButton = (c) => {
|
|
13350
|
-
return
|
|
13558
|
+
return React121.isValidElement(c) && c.type === RadioButton2;
|
|
13351
13559
|
};
|
|
13352
13560
|
var RadioButtonGroup = ({
|
|
13353
13561
|
name,
|
|
@@ -13359,7 +13567,7 @@ var RadioButtonGroup = ({
|
|
|
13359
13567
|
children,
|
|
13360
13568
|
...props
|
|
13361
13569
|
}) => {
|
|
13362
|
-
const [value, setValue] =
|
|
13570
|
+
const [value, setValue] = React121.useState(_value ?? defaultValue ?? "");
|
|
13363
13571
|
const errorMessageId = useId16();
|
|
13364
13572
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
13365
13573
|
const labelControlProps = getLabelControlProps(props);
|
|
@@ -13370,13 +13578,13 @@ var RadioButtonGroup = ({
|
|
|
13370
13578
|
setValue(e.target.value);
|
|
13371
13579
|
onChange?.(e.target.value);
|
|
13372
13580
|
};
|
|
13373
|
-
const content =
|
|
13581
|
+
const content = React121.Children.map(children, (c) => {
|
|
13374
13582
|
if (!isRadioButton(c)) {
|
|
13375
13583
|
return null;
|
|
13376
13584
|
}
|
|
13377
13585
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
|
13378
13586
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
|
13379
|
-
return
|
|
13587
|
+
return React121.cloneElement(c, {
|
|
13380
13588
|
name,
|
|
13381
13589
|
defaultChecked: c.props.defaultChecked ?? defaultChecked,
|
|
13382
13590
|
checked: c.props.checked ?? checked,
|
|
@@ -13385,11 +13593,11 @@ var RadioButtonGroup = ({
|
|
|
13385
13593
|
readOnly
|
|
13386
13594
|
});
|
|
13387
13595
|
});
|
|
13388
|
-
return /* @__PURE__ */
|
|
13596
|
+
return /* @__PURE__ */ React121.createElement(LabelControl, { fieldset: true, ...labelControlProps, ...errorProps, className: "Aquarium-RadioButtonGroup" }, cols && /* @__PURE__ */ React121.createElement(InputGroup, { cols }, content), !cols && /* @__PURE__ */ React121.createElement(Box.Flex, { flexDirection: "row", alignItems: "flex-start", colGap: "8", rowGap: "3", flexWrap: "wrap" }, content));
|
|
13389
13597
|
};
|
|
13390
13598
|
var RadioButtonGroupSkeleton = ({ cols, options = 2 }) => {
|
|
13391
13599
|
const isRow = !cols || parseInt(cols, 10) > 1;
|
|
13392
|
-
return /* @__PURE__ */
|
|
13600
|
+
return /* @__PURE__ */ React121.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React121.createElement(
|
|
13393
13601
|
"div",
|
|
13394
13602
|
{
|
|
13395
13603
|
className: clsx37("flex flex-wrap", {
|
|
@@ -13397,14 +13605,14 @@ var RadioButtonGroupSkeleton = ({ cols, options = 2 }) => {
|
|
|
13397
13605
|
"flex-col gap-2": !isRow
|
|
13398
13606
|
})
|
|
13399
13607
|
},
|
|
13400
|
-
Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
|
13608
|
+
Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React121.createElement(RadioButton2.Skeleton, { key }))
|
|
13401
13609
|
));
|
|
13402
13610
|
};
|
|
13403
13611
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
13404
13612
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
|
13405
13613
|
|
|
13406
13614
|
// src/molecules/Section/Section.tsx
|
|
13407
|
-
import
|
|
13615
|
+
import React126, { useRef as useRef16 } from "react";
|
|
13408
13616
|
import { useButton as useButton4 } from "@react-aria/button";
|
|
13409
13617
|
import { useId as useId17 } from "@react-aria/utils";
|
|
13410
13618
|
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
|
@@ -13412,10 +13620,10 @@ import { clsx as clsx38 } from "clsx";
|
|
|
13412
13620
|
import { castArray as castArray8, isUndefined as isUndefined8 } from "lodash-es";
|
|
13413
13621
|
|
|
13414
13622
|
// src/molecules/Switch/Switch.tsx
|
|
13415
|
-
import
|
|
13623
|
+
import React123 from "react";
|
|
13416
13624
|
|
|
13417
13625
|
// src/atoms/Switch/Switch.tsx
|
|
13418
|
-
import
|
|
13626
|
+
import React122 from "react";
|
|
13419
13627
|
import { tv as tv31 } from "tailwind-variants";
|
|
13420
13628
|
var switchStyles = tv31({
|
|
13421
13629
|
slots: {
|
|
@@ -13436,10 +13644,10 @@ var switchStyles = tv31({
|
|
|
13436
13644
|
}
|
|
13437
13645
|
}
|
|
13438
13646
|
});
|
|
13439
|
-
var Switch =
|
|
13647
|
+
var Switch = React122.forwardRef(
|
|
13440
13648
|
({ id, children, name, disabled = false, readOnly = false, ...props }, ref) => {
|
|
13441
13649
|
const { wrapper, input, thumb } = switchStyles({ disabled });
|
|
13442
|
-
return /* @__PURE__ */
|
|
13650
|
+
return /* @__PURE__ */ React122.createElement("span", { className: wrapper() }, /* @__PURE__ */ React122.createElement(
|
|
13443
13651
|
"input",
|
|
13444
13652
|
{
|
|
13445
13653
|
id,
|
|
@@ -13451,12 +13659,12 @@ var Switch = React121.forwardRef(
|
|
|
13451
13659
|
readOnly,
|
|
13452
13660
|
disabled
|
|
13453
13661
|
}
|
|
13454
|
-
), /* @__PURE__ */
|
|
13662
|
+
), /* @__PURE__ */ React122.createElement("span", { className: thumb() }, disabled && /* @__PURE__ */ React122.createElement(Icon, { icon: ban_default, width: "10px", height: "10px" })));
|
|
13455
13663
|
}
|
|
13456
13664
|
);
|
|
13457
13665
|
|
|
13458
13666
|
// src/molecules/Switch/Switch.tsx
|
|
13459
|
-
var Switch2 =
|
|
13667
|
+
var Switch2 = React123.forwardRef(
|
|
13460
13668
|
({
|
|
13461
13669
|
id,
|
|
13462
13670
|
name,
|
|
@@ -13469,7 +13677,7 @@ var Switch2 = React122.forwardRef(
|
|
|
13469
13677
|
...props
|
|
13470
13678
|
}, ref) => {
|
|
13471
13679
|
const isChecked = props.checked ?? props.defaultChecked;
|
|
13472
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
|
13680
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React123.createElement(
|
|
13473
13681
|
ControlLabel,
|
|
13474
13682
|
{
|
|
13475
13683
|
htmlFor: id,
|
|
@@ -13482,21 +13690,21 @@ var Switch2 = React122.forwardRef(
|
|
|
13482
13690
|
labelPlacement,
|
|
13483
13691
|
className: "Aquarium-Switch"
|
|
13484
13692
|
},
|
|
13485
|
-
!readOnly && /* @__PURE__ */
|
|
13693
|
+
!readOnly && /* @__PURE__ */ React123.createElement(Switch, { id, ref, name, ...props, readOnly, disabled })
|
|
13486
13694
|
) : null;
|
|
13487
13695
|
}
|
|
13488
13696
|
);
|
|
13489
13697
|
Switch2.displayName = "Switch";
|
|
13490
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
|
13698
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React123.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React123.createElement(Skeleton, { height: 20, width: 35 }), /* @__PURE__ */ React123.createElement(Skeleton, { height: 20, width: 150 }));
|
|
13491
13699
|
Switch2.Skeleton = SwitchSkeleton;
|
|
13492
13700
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
|
13493
13701
|
|
|
13494
13702
|
// src/molecules/TagLabel/TagLabel.tsx
|
|
13495
|
-
import
|
|
13496
|
-
var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */
|
|
13703
|
+
import React124 from "react";
|
|
13704
|
+
var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */ React124.createElement(InverseChip, { text: title, dense, status: variant || "primary", ...rest });
|
|
13497
13705
|
|
|
13498
13706
|
// src/atoms/Section/Section.tsx
|
|
13499
|
-
import
|
|
13707
|
+
import React125 from "react";
|
|
13500
13708
|
import { tv as tv32 } from "tailwind-variants";
|
|
13501
13709
|
var sectionStyles = tv32({
|
|
13502
13710
|
slots: {
|
|
@@ -13522,19 +13730,19 @@ var Section3 = ({
|
|
|
13522
13730
|
...rest
|
|
13523
13731
|
}) => {
|
|
13524
13732
|
const { base: base2 } = sectionStyles();
|
|
13525
|
-
return /* @__PURE__ */
|
|
13733
|
+
return /* @__PURE__ */ React125.createElement(Box, { component: "section", ...rest, className: base2({ className }) }, children);
|
|
13526
13734
|
};
|
|
13527
13735
|
Section3.Header = ({ children, className, expanded, collapsible, ...rest }) => {
|
|
13528
13736
|
const { header } = sectionStyles({ expanded, collapsible });
|
|
13529
|
-
return /* @__PURE__ */
|
|
13737
|
+
return /* @__PURE__ */ React125.createElement("div", { ...rest, className: header({ className }) }, children);
|
|
13530
13738
|
};
|
|
13531
|
-
Section3.TitleContainer =
|
|
13739
|
+
Section3.TitleContainer = React125.forwardRef(
|
|
13532
13740
|
({ children, className, collapsible, ...rest }, ref) => {
|
|
13533
13741
|
const { titleContainer: titleContainer2 } = sectionStyles({ collapsible });
|
|
13534
|
-
return /* @__PURE__ */
|
|
13742
|
+
return /* @__PURE__ */ React125.createElement("div", { ...rest, ref, className: titleContainer2({ className }) }, children);
|
|
13535
13743
|
}
|
|
13536
13744
|
);
|
|
13537
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
|
13745
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React125.createElement(
|
|
13538
13746
|
Icon,
|
|
13539
13747
|
{
|
|
13540
13748
|
...props,
|
|
@@ -13547,15 +13755,15 @@ Section3.Toggle = (props) => /* @__PURE__ */ React124.createElement(
|
|
|
13547
13755
|
})
|
|
13548
13756
|
}
|
|
13549
13757
|
);
|
|
13550
|
-
Section3.Title = ({ children, ...rest }) => /* @__PURE__ */
|
|
13551
|
-
Section3.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
|
13758
|
+
Section3.Title = ({ children, ...rest }) => /* @__PURE__ */ React125.createElement(Typography2.Large, { ...rest, htmlTag: "h2", color: "intense", className: "flex gap-3 items-center" }, children);
|
|
13759
|
+
Section3.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React125.createElement(Typography2.Small, { ...rest, color: "muted" }, children);
|
|
13552
13760
|
Section3.Actions = ({ children, className, ...rest }) => {
|
|
13553
13761
|
const { actions: actions2 } = sectionStyles();
|
|
13554
|
-
return /* @__PURE__ */
|
|
13762
|
+
return /* @__PURE__ */ React125.createElement("div", { ...rest, className: actions2({ className }) }, children);
|
|
13555
13763
|
};
|
|
13556
13764
|
Section3.Body = ({ children, className, ...rest }) => {
|
|
13557
13765
|
const { body } = sectionStyles();
|
|
13558
|
-
return /* @__PURE__ */
|
|
13766
|
+
return /* @__PURE__ */ React125.createElement("div", { ...rest, className: body({ className }) }, /* @__PURE__ */ React125.createElement(Typography, { htmlTag: "div", color: "default" }, children));
|
|
13559
13767
|
};
|
|
13560
13768
|
|
|
13561
13769
|
// src/molecules/Section/Section.tsx
|
|
@@ -13564,12 +13772,12 @@ var Section4 = (props) => {
|
|
|
13564
13772
|
const _collapsible = title ? props.collapsible ?? false : false;
|
|
13565
13773
|
const _collapsed = title ? props.collapsed : void 0;
|
|
13566
13774
|
const _defaultCollapsed = title ? props.defaultCollapsed ?? false : false;
|
|
13567
|
-
const [isCollapsed, setCollapsed] =
|
|
13568
|
-
const [isResting, setResting] =
|
|
13775
|
+
const [isCollapsed, setCollapsed] = React126.useState(_collapsed ?? _defaultCollapsed);
|
|
13776
|
+
const [isResting, setResting] = React126.useState(true);
|
|
13569
13777
|
const [ref, { height }] = useMeasure();
|
|
13570
|
-
const toggleAreaRef =
|
|
13571
|
-
const isMounted =
|
|
13572
|
-
|
|
13778
|
+
const toggleAreaRef = useRef16(null);
|
|
13779
|
+
const isMounted = useRef16(true);
|
|
13780
|
+
React126.useEffect(
|
|
13573
13781
|
() => () => {
|
|
13574
13782
|
isMounted.current = false;
|
|
13575
13783
|
},
|
|
@@ -13613,7 +13821,10 @@ var Section4 = (props) => {
|
|
|
13613
13821
|
{ "elementType": "div", "onPress": handleTitleClick, "aria-expanded": !isCollapsed, "aria-controls": regionId },
|
|
13614
13822
|
toggleAreaRef
|
|
13615
13823
|
);
|
|
13616
|
-
|
|
13824
|
+
if ((props.tag || props.chip) && props.chips) {
|
|
13825
|
+
throw new Error("When chips prop is defined, tag and chip prop must be undefined.");
|
|
13826
|
+
}
|
|
13827
|
+
return /* @__PURE__ */ React126.createElement(
|
|
13617
13828
|
Section3,
|
|
13618
13829
|
{
|
|
13619
13830
|
"aria-label": title,
|
|
@@ -13622,7 +13833,7 @@ var Section4 = (props) => {
|
|
|
13622
13833
|
"Aquarium-Section": !_collapsible
|
|
13623
13834
|
})
|
|
13624
13835
|
},
|
|
13625
|
-
title && /* @__PURE__ */
|
|
13836
|
+
title && /* @__PURE__ */ React126.createElement(Section3.Header, { expanded: _collapsible && !isCollapsed, collapsible: _collapsible }, /* @__PURE__ */ React126.createElement(
|
|
13626
13837
|
Section3.TitleContainer,
|
|
13627
13838
|
{
|
|
13628
13839
|
..._collapsible ? {
|
|
@@ -13636,20 +13847,24 @@ var Section4 = (props) => {
|
|
|
13636
13847
|
id: toggleId,
|
|
13637
13848
|
collapsible: _collapsible
|
|
13638
13849
|
},
|
|
13639
|
-
_collapsible && /* @__PURE__ */
|
|
13640
|
-
/* @__PURE__ */
|
|
13641
|
-
|
|
13642
|
-
|
|
13850
|
+
_collapsible && /* @__PURE__ */ React126.createElement(animated6.div, { style: { transform } }, /* @__PURE__ */ React126.createElement(Section3.Toggle, null)),
|
|
13851
|
+
/* @__PURE__ */ React126.createElement(Section3.Title, { id: titleId }, /* @__PURE__ */ React126.createElement(LineClamp2, { lines: 1 }, title), props.tag && /* @__PURE__ */ React126.createElement(TagLabel, { ...props.tag }), props.badge && /* @__PURE__ */ React126.createElement(Chip2, { text: props.badge }), props.chip && /* @__PURE__ */ React126.createElement(StatusChip, { ...props.chip }), props.chips?.map(({ type: chipType, status, text }, index) => {
|
|
13852
|
+
const Component = chipType === "inverse" ? InverseChip : StatusChip;
|
|
13853
|
+
const key = `${status}-${text}-${index}`;
|
|
13854
|
+
return /* @__PURE__ */ React126.createElement(Component, { key, text, status });
|
|
13855
|
+
}) ?? null),
|
|
13856
|
+
subtitle && /* @__PURE__ */ React126.createElement(Section3.Subtitle, { className: clsx38("row-start-2", { "col-start-2": _collapsible }) }, /* @__PURE__ */ React126.createElement(LineClamp2, { lines: 1 }, subtitle))
|
|
13857
|
+
), !isCollapsed && /* @__PURE__ */ React126.createElement(Section3.Actions, null, props.switch && /* @__PURE__ */ React126.createElement(Switch2, { ...props.switch }), menu && /* @__PURE__ */ React126.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React126.createElement(
|
|
13643
13858
|
DropdownMenu2,
|
|
13644
13859
|
{
|
|
13645
13860
|
onAction: (action) => onAction?.(action),
|
|
13646
13861
|
onOpenChange: onMenuOpenChange,
|
|
13647
13862
|
placement: defaultContextualMenuPlacement
|
|
13648
13863
|
},
|
|
13649
|
-
/* @__PURE__ */
|
|
13864
|
+
/* @__PURE__ */ React126.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React126.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: more_default })),
|
|
13650
13865
|
menu
|
|
13651
|
-
)), props.actions && castArray8(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.select && /* @__PURE__ */
|
|
13652
|
-
/* @__PURE__ */
|
|
13866
|
+
)), props.actions && castArray8(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.select && /* @__PURE__ */ React126.createElement(SelectBase, { "aria-labelledby": titleId, ...props.select }))),
|
|
13867
|
+
/* @__PURE__ */ React126.createElement(
|
|
13653
13868
|
animated6.div,
|
|
13654
13869
|
{
|
|
13655
13870
|
id: regionId,
|
|
@@ -13657,7 +13872,7 @@ var Section4 = (props) => {
|
|
|
13657
13872
|
style: spring,
|
|
13658
13873
|
className: clsx38({ "overflow-hidden": _collapsible && (isCollapsed || !isResting) })
|
|
13659
13874
|
},
|
|
13660
|
-
/* @__PURE__ */
|
|
13875
|
+
/* @__PURE__ */ React126.createElement("div", { ref }, hasTabs ? /* @__PURE__ */ React126.createElement(
|
|
13661
13876
|
SectionTabs,
|
|
13662
13877
|
{
|
|
13663
13878
|
...children.props,
|
|
@@ -13665,22 +13880,22 @@ var Section4 = (props) => {
|
|
|
13665
13880
|
"mt-4": _collapsible
|
|
13666
13881
|
})
|
|
13667
13882
|
}
|
|
13668
|
-
) : /* @__PURE__ */
|
|
13883
|
+
) : /* @__PURE__ */ React126.createElement(Section3.Body, null, children))
|
|
13669
13884
|
)
|
|
13670
13885
|
);
|
|
13671
13886
|
};
|
|
13672
|
-
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */
|
|
13887
|
+
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */ React126.createElement(Section3.Body, null, children.find(
|
|
13673
13888
|
(node, index) => node?.props.value === selected || index === selected
|
|
13674
13889
|
)));
|
|
13675
13890
|
|
|
13676
13891
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
|
13677
|
-
import
|
|
13892
|
+
import React127 from "react";
|
|
13678
13893
|
import { tv as tv33 } from "tailwind-variants";
|
|
13679
13894
|
var segmentedControlStyles = tv33({
|
|
13680
13895
|
slots: {
|
|
13681
13896
|
wrapper: [
|
|
13682
|
-
"transition border-l border-
|
|
13683
|
-
"first:border-l-0 first:rounded-l last:rounded-r",
|
|
13897
|
+
"transition border-l border-muted overflow-hidden hover:bg-primary-hover",
|
|
13898
|
+
"first:border-l-0 first:rounded-l-[var(--aquarium-segmented-control-inner-radius)] last:rounded-r-[var(--aquarium-segmented-control-inner-radius)]",
|
|
13684
13899
|
"focus-within:border-l-transparent focus-within:relative focus-within:z-50 focus-within:ring-1 focus-within:ring-offset-0 focus-within:ring-primary-default"
|
|
13685
13900
|
],
|
|
13686
13901
|
button: [
|
|
@@ -13710,7 +13925,7 @@ var SegmentedControl = ({
|
|
|
13710
13925
|
...rest
|
|
13711
13926
|
}) => {
|
|
13712
13927
|
const { wrapper, button } = segmentedControlStyles({ selected });
|
|
13713
|
-
return /* @__PURE__ */
|
|
13928
|
+
return /* @__PURE__ */ React127.createElement("li", { className: wrapper() }, /* @__PURE__ */ React127.createElement("button", { type: "button", ...rest, className: button({ className }), "aria-pressed": selected }, children));
|
|
13714
13929
|
};
|
|
13715
13930
|
var segmentedControlGroupStyles = tv33({
|
|
13716
13931
|
base: "Aquarium-SegmentedControl flex border border-default rounded"
|
|
@@ -13723,9 +13938,9 @@ var SegmentedControlGroup = ({
|
|
|
13723
13938
|
ariaLabel,
|
|
13724
13939
|
...rest
|
|
13725
13940
|
}) => {
|
|
13726
|
-
return /* @__PURE__ */
|
|
13941
|
+
return /* @__PURE__ */ React127.createElement("ul", { ...rest, "aria-label": ariaLabel, className: segmentedControlGroupStyles({ className }) }, React127.Children.map(
|
|
13727
13942
|
children,
|
|
13728
|
-
(child) =>
|
|
13943
|
+
(child) => React127.cloneElement(child, {
|
|
13729
13944
|
onClick: () => onChange(child.props.value),
|
|
13730
13945
|
selected: child.props.value === value
|
|
13731
13946
|
})
|
|
@@ -13733,10 +13948,10 @@ var SegmentedControlGroup = ({
|
|
|
13733
13948
|
};
|
|
13734
13949
|
|
|
13735
13950
|
// src/molecules/Stepper/Stepper.tsx
|
|
13736
|
-
import
|
|
13951
|
+
import React129 from "react";
|
|
13737
13952
|
|
|
13738
13953
|
// src/atoms/Stepper/Stepper.tsx
|
|
13739
|
-
import
|
|
13954
|
+
import React128 from "react";
|
|
13740
13955
|
import { tv as tv34 } from "tailwind-variants";
|
|
13741
13956
|
var connectorStyles = tv34({
|
|
13742
13957
|
slots: {
|
|
@@ -13817,26 +14032,26 @@ var stepStyles = tv34({
|
|
|
13817
14032
|
}
|
|
13818
14033
|
]
|
|
13819
14034
|
});
|
|
13820
|
-
var Stepper = ({ className, ...rest }) => /* @__PURE__ */
|
|
14035
|
+
var Stepper = ({ className, ...rest }) => /* @__PURE__ */ React128.createElement("div", { ...rest, className });
|
|
13821
14036
|
var ConnectorContainer = ({
|
|
13822
14037
|
className,
|
|
13823
14038
|
dense = false,
|
|
13824
14039
|
...rest
|
|
13825
14040
|
}) => {
|
|
13826
14041
|
const { container: container2 } = connectorStyles({ dense });
|
|
13827
|
-
return /* @__PURE__ */
|
|
14042
|
+
return /* @__PURE__ */ React128.createElement("div", { ...rest, className: container2({ className }) });
|
|
13828
14043
|
};
|
|
13829
14044
|
var Connector = ({ children, className, completed = false, dense = false, ...rest }) => {
|
|
13830
14045
|
const { connector } = connectorStyles({ completed, dense });
|
|
13831
|
-
return /* @__PURE__ */
|
|
14046
|
+
return /* @__PURE__ */ React128.createElement("div", { ...rest, className: connector({ className }) });
|
|
13832
14047
|
};
|
|
13833
14048
|
var Step = ({ className, state, ...rest }) => {
|
|
13834
14049
|
const { step } = stepStyles({ state });
|
|
13835
|
-
return /* @__PURE__ */
|
|
14050
|
+
return /* @__PURE__ */ React128.createElement("div", { ...rest, className: step({ className }) });
|
|
13836
14051
|
};
|
|
13837
14052
|
var Indicator = ({ children, className, state, dense = false, ...rest }) => {
|
|
13838
14053
|
const { indicator } = stepStyles({ state, dense });
|
|
13839
|
-
return /* @__PURE__ */
|
|
14054
|
+
return /* @__PURE__ */ React128.createElement("div", { ...rest, className: indicator({ className }) }, state === "completed" ? /* @__PURE__ */ React128.createElement(InlineIcon, { icon: tick_default }) : dense ? null : children);
|
|
13840
14055
|
};
|
|
13841
14056
|
Step.Indicator = Indicator;
|
|
13842
14057
|
Stepper.Step = Step;
|
|
@@ -13845,13 +14060,13 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
|
13845
14060
|
|
|
13846
14061
|
// src/molecules/Stepper/Stepper.tsx
|
|
13847
14062
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
|
13848
|
-
const steps =
|
|
13849
|
-
return /* @__PURE__ */
|
|
14063
|
+
const steps = React129.Children.count(children);
|
|
14064
|
+
return /* @__PURE__ */ React129.createElement(Stepper, { role: "list", className: "Aquarium-Stepper" }, /* @__PURE__ */ React129.createElement(Template, { columns: steps }, React129.Children.map(children, (child, index) => {
|
|
13850
14065
|
if (!isComponentType(child, Step2)) {
|
|
13851
14066
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
|
13852
14067
|
} else {
|
|
13853
14068
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
|
13854
|
-
return /* @__PURE__ */
|
|
14069
|
+
return /* @__PURE__ */ React129.createElement(Stepper.Step, { state, "aria-current": state === "active" ? "step" : false, role: "listitem" }, index > 0 && index <= steps && /* @__PURE__ */ React129.createElement(Stepper.ConnectorContainer, { dense }, /* @__PURE__ */ React129.createElement(Stepper.ConnectorContainer.Connector, { completed: state === "completed" || state === "active" })), /* @__PURE__ */ React129.createElement(Stepper.Step.Indicator, { state, dense }, index + 1), child.props.children);
|
|
13855
14070
|
}
|
|
13856
14071
|
})));
|
|
13857
14072
|
};
|
|
@@ -13861,7 +14076,7 @@ Step2.displayName = "Stepper.Step";
|
|
|
13861
14076
|
Stepper2.Step = Step2;
|
|
13862
14077
|
|
|
13863
14078
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
|
13864
|
-
import
|
|
14079
|
+
import React130, { useState as useState14 } from "react";
|
|
13865
14080
|
import { useId as useId18 } from "@react-aria/utils";
|
|
13866
14081
|
var SwitchGroup = ({
|
|
13867
14082
|
value,
|
|
@@ -13885,14 +14100,14 @@ var SwitchGroup = ({
|
|
|
13885
14100
|
setSelectedItems(updated);
|
|
13886
14101
|
onChange?.(updated);
|
|
13887
14102
|
};
|
|
13888
|
-
return /* @__PURE__ */
|
|
14103
|
+
return /* @__PURE__ */ React130.createElement(LabelControl, { fieldset: true, ...labelControlProps, ...errorProps, className: "Aquarium-SwitchGroup" }, /* @__PURE__ */ React130.createElement(InputGroup, { cols }, React130.Children.map(children, (c) => {
|
|
13889
14104
|
if (!isComponentType(c, Switch2)) {
|
|
13890
14105
|
return null;
|
|
13891
14106
|
}
|
|
13892
14107
|
const str = c.props.value?.toString();
|
|
13893
14108
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
|
13894
14109
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
|
13895
|
-
return
|
|
14110
|
+
return React130.cloneElement(c, {
|
|
13896
14111
|
defaultChecked: c.props.defaultChecked ?? defaultChecked,
|
|
13897
14112
|
checked: c.props.checked ?? checked,
|
|
13898
14113
|
onChange: c.props.onChange ?? handleChange,
|
|
@@ -13902,18 +14117,18 @@ var SwitchGroup = ({
|
|
|
13902
14117
|
})));
|
|
13903
14118
|
};
|
|
13904
14119
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
|
13905
|
-
return /* @__PURE__ */
|
|
14120
|
+
return /* @__PURE__ */ React130.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React130.createElement("div", { className: "flex flex-wrap flex-col gap-2" }, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React130.createElement(Switch2.Skeleton, { key }))));
|
|
13906
14121
|
};
|
|
13907
14122
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
13908
14123
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
|
13909
14124
|
|
|
13910
14125
|
// src/molecules/Textarea/Textarea.tsx
|
|
13911
|
-
import
|
|
14126
|
+
import React131, { useState as useState15 } from "react";
|
|
13912
14127
|
import { useId as useId19 } from "@react-aria/utils";
|
|
13913
14128
|
import { clsx as clsx39 } from "clsx";
|
|
13914
14129
|
import { omit as omit17, toString as toString2 } from "lodash-es";
|
|
13915
|
-
var TextareaBase =
|
|
13916
|
-
({ readOnly = false, valid = true, ...props }, ref) => /* @__PURE__ */
|
|
14130
|
+
var TextareaBase = React131.forwardRef(
|
|
14131
|
+
({ readOnly = false, valid = true, ...props }, ref) => /* @__PURE__ */ React131.createElement(
|
|
13917
14132
|
"textarea",
|
|
13918
14133
|
{
|
|
13919
14134
|
ref,
|
|
@@ -13923,8 +14138,8 @@ var TextareaBase = React130.forwardRef(
|
|
|
13923
14138
|
}
|
|
13924
14139
|
)
|
|
13925
14140
|
);
|
|
13926
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
|
13927
|
-
var Textarea =
|
|
14141
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React131.createElement(Skeleton, { height: 58 });
|
|
14142
|
+
var Textarea = React131.forwardRef((props, ref) => {
|
|
13928
14143
|
const [value, setValue] = useState15(props.value ?? props.defaultValue ?? "");
|
|
13929
14144
|
const defaultId = useId19();
|
|
13930
14145
|
const id = props.id ?? defaultId;
|
|
@@ -13932,7 +14147,7 @@ var Textarea = React130.forwardRef((props, ref) => {
|
|
|
13932
14147
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
|
13933
14148
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
|
13934
14149
|
const baseProps = omit17(props, Object.keys(labelControlProps));
|
|
13935
|
-
return /* @__PURE__ */
|
|
14150
|
+
return /* @__PURE__ */ React131.createElement(
|
|
13936
14151
|
LabelControl,
|
|
13937
14152
|
{
|
|
13938
14153
|
id: `${id}-label`,
|
|
@@ -13942,7 +14157,7 @@ var Textarea = React130.forwardRef((props, ref) => {
|
|
|
13942
14157
|
...labelControlProps,
|
|
13943
14158
|
className: "Aquarium-Textarea"
|
|
13944
14159
|
},
|
|
13945
|
-
/* @__PURE__ */
|
|
14160
|
+
/* @__PURE__ */ React131.createElement(
|
|
13946
14161
|
TextareaBase,
|
|
13947
14162
|
{
|
|
13948
14163
|
ref,
|
|
@@ -13963,47 +14178,54 @@ var Textarea = React130.forwardRef((props, ref) => {
|
|
|
13963
14178
|
);
|
|
13964
14179
|
});
|
|
13965
14180
|
Textarea.displayName = "Textarea";
|
|
13966
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
|
14181
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React131.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React131.createElement(TextareaBase.Skeleton, null));
|
|
13967
14182
|
Textarea.Skeleton = TextAreaSkeleton;
|
|
13968
14183
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
|
13969
14184
|
|
|
13970
14185
|
// src/molecules/Timeline/Timeline.tsx
|
|
13971
|
-
import
|
|
14186
|
+
import React134 from "react";
|
|
13972
14187
|
|
|
13973
14188
|
// src/atoms/Timeline/Timeline.tsx
|
|
13974
|
-
import
|
|
14189
|
+
import React132 from "react";
|
|
13975
14190
|
import { clsx as clsx40 } from "clsx";
|
|
13976
|
-
var Timeline = ({ className, ...rest }) => /* @__PURE__ */
|
|
13977
|
-
var Content2 = ({ className, ...rest }) => /* @__PURE__ */
|
|
13978
|
-
var Separator = ({ className, ...rest }) => /* @__PURE__ */
|
|
13979
|
-
var LineContainer = ({ className, ...rest }) => /* @__PURE__ */
|
|
13980
|
-
var Line = ({ className, ...rest }) => /* @__PURE__ */
|
|
13981
|
-
var Dot = ({ className, ...rest }) => /* @__PURE__ */
|
|
14191
|
+
var Timeline = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("li", { ...rest, className: clsx40("grid grid-cols-[16px_1fr] gap-x-4", className) });
|
|
14192
|
+
var Content2 = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("pb-6", className) });
|
|
14193
|
+
var Separator = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("flex items-center justify-center h-5 w-5", className) });
|
|
14194
|
+
var LineContainer = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("flex justify-center py-1", className) });
|
|
14195
|
+
var Line = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("w-1 bg-medium h-full justify-self-center", className) });
|
|
14196
|
+
var Dot = ({ className, ...rest }) => /* @__PURE__ */ React132.createElement("div", { ...rest, className: clsx40("bg-intense h-[6px] w-[6px] rounded", className) });
|
|
13982
14197
|
Separator.Dot = Dot;
|
|
13983
14198
|
LineContainer.Line = Line;
|
|
13984
14199
|
Timeline.Separator = Separator;
|
|
13985
14200
|
Timeline.LineContainer = LineContainer;
|
|
13986
14201
|
Timeline.Content = Content2;
|
|
13987
14202
|
|
|
14203
|
+
// src/atoms/VisuallyHidden/VisuallyHidden.tsx
|
|
14204
|
+
import React133 from "react";
|
|
14205
|
+
import { VisuallyHidden as AriaVisuallyHidden } from "@react-aria/visually-hidden";
|
|
14206
|
+
var VisuallyHidden = (props) => {
|
|
14207
|
+
return /* @__PURE__ */ React133.createElement(AriaVisuallyHidden, { ...props });
|
|
14208
|
+
};
|
|
14209
|
+
|
|
13988
14210
|
// src/molecules/Timeline/Timeline.tsx
|
|
13989
14211
|
var TimelineItem = () => null;
|
|
13990
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
|
14212
|
+
var Timeline2 = ({ children, "aria-label": ariaLabel }) => /* @__PURE__ */ React134.createElement("ol", { className: "Aquarium-Timeline", "aria-label": ariaLabel }, React134.Children.map(children, (item) => {
|
|
13991
14213
|
if (!isComponentType(item, TimelineItem)) {
|
|
13992
14214
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
|
13993
14215
|
} else {
|
|
13994
14216
|
const { props, key } = item;
|
|
13995
|
-
return /* @__PURE__ */
|
|
14217
|
+
return /* @__PURE__ */ React134.createElement(Timeline, { key: key ?? props.title }, /* @__PURE__ */ React134.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Error: "), /* @__PURE__ */ React134.createElement(Icon, { icon: error_default, color: "danger-default" })) : props.variant === "warning" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Warning: "), /* @__PURE__ */ React134.createElement(Icon, { icon: warningSign_default, color: "warning-default" })) : props.variant === "info" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Info: "), /* @__PURE__ */ React134.createElement(Icon, { icon: time_default, color: "info-default" })) : props.variant === "success" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Success: "), /* @__PURE__ */ React134.createElement(Icon, { icon: tickCircle_default, color: "success-default" })) : props.variant === "loading" ? /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement(VisuallyHidden, null, "Loading: "), /* @__PURE__ */ React134.createElement(Icon, { icon: loading_default, color: "default" })) : /* @__PURE__ */ React134.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React134.createElement(Typography2.Small, { color: "muted" }, props.title), /* @__PURE__ */ React134.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React134.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React134.createElement(Timeline.Content, null, /* @__PURE__ */ React134.createElement(Typography2.Default, null, props.children)));
|
|
13996
14218
|
}
|
|
13997
14219
|
}));
|
|
13998
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
|
13999
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
|
14220
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React134.createElement(Timeline, null, /* @__PURE__ */ React134.createElement(Timeline.Separator, null, /* @__PURE__ */ React134.createElement(Skeleton, { width: 6, height: 6, rounded: true })), /* @__PURE__ */ React134.createElement(Skeleton, { height: 12, width: 120 }), /* @__PURE__ */ React134.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React134.createElement(Skeleton, { width: 2, height: "100%" })), /* @__PURE__ */ React134.createElement(Timeline.Content, null, /* @__PURE__ */ React134.createElement(Box, { display: "flex", flexDirection: "column", gap: "3" }, /* @__PURE__ */ React134.createElement(Skeleton, { height: 32, width: "100%" }), /* @__PURE__ */ React134.createElement(Skeleton, { height: 32, width: "73%" }), /* @__PURE__ */ React134.createElement(Skeleton, { height: 32, width: "80%" }))));
|
|
14221
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React134.createElement("ol", { className: "Aquarium-Timeline", "aria-busy": "true", "aria-label": "Loading timeline" }, /* @__PURE__ */ React134.createElement("div", { "aria-hidden": true }, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React134.createElement(TimelineItemSkeleton, { key }))));
|
|
14000
14222
|
Timeline2.Item = TimelineItem;
|
|
14001
14223
|
Timeline2.Skeleton = TimelineSkeleton;
|
|
14002
14224
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
|
14003
14225
|
|
|
14004
14226
|
// src/molecules/TimePicker/TimePicker.tsx
|
|
14005
|
-
import
|
|
14006
|
-
var TimePicker = (props) => /* @__PURE__ */
|
|
14227
|
+
import React135 from "react";
|
|
14228
|
+
var TimePicker = (props) => /* @__PURE__ */ React135.createElement(TimeField2, { ...props });
|
|
14007
14229
|
|
|
14008
14230
|
// src/utils/table/sortByColumn.ts
|
|
14009
14231
|
var sortByColumn = (items, column, sortState) => {
|
|
@@ -14025,13 +14247,13 @@ var sortByColumn = (items, column, sortState) => {
|
|
|
14025
14247
|
};
|
|
14026
14248
|
|
|
14027
14249
|
// src/utils/table/useSortState.ts
|
|
14028
|
-
import
|
|
14029
|
-
var useSortState = (initialSortState) =>
|
|
14250
|
+
import React136 from "react";
|
|
14251
|
+
var useSortState = (initialSortState) => React136.useState(initialSortState);
|
|
14030
14252
|
|
|
14031
14253
|
// src/utils/table/useTableSelect.ts
|
|
14032
|
-
import
|
|
14254
|
+
import React137 from "react";
|
|
14033
14255
|
var useTableSelect = (data31, { key }) => {
|
|
14034
|
-
const [selected, setSelected] =
|
|
14256
|
+
const [selected, setSelected] = React137.useState([]);
|
|
14035
14257
|
const allSelected = selected.length === data31.length;
|
|
14036
14258
|
const isSelected = (dot) => selected.includes(dot[key]);
|
|
14037
14259
|
const selectAll = () => setSelected(data31.map((dot) => dot[key]));
|
|
@@ -14056,7 +14278,7 @@ var useTableSelect = (data31, { key }) => {
|
|
|
14056
14278
|
};
|
|
14057
14279
|
|
|
14058
14280
|
// src/molecules/ItemList/ItemList.tsx
|
|
14059
|
-
import
|
|
14281
|
+
import React138 from "react";
|
|
14060
14282
|
var ItemList = ({
|
|
14061
14283
|
columns,
|
|
14062
14284
|
items,
|
|
@@ -14068,9 +14290,9 @@ var ItemList = ({
|
|
|
14068
14290
|
const templateColumns = columns.map((column) => column.width ?? "auto");
|
|
14069
14291
|
const [sortState, setSortState] = useSortState(defaultSort);
|
|
14070
14292
|
const sortedItems = onSortChanged ? items : sortByColumn(items, columns, sortState);
|
|
14071
|
-
return /* @__PURE__ */
|
|
14293
|
+
return /* @__PURE__ */ React138.createElement(Template, { className: "Aquarium-ItemList", columns: templateColumns, role: "table" }, /* @__PURE__ */ React138.createElement(DataList.Row, { header: true }, columns.map((column) => {
|
|
14072
14294
|
if (columnHasSort(column)) {
|
|
14073
|
-
return /* @__PURE__ */
|
|
14295
|
+
return /* @__PURE__ */ React138.createElement(
|
|
14074
14296
|
DataList.SortCell,
|
|
14075
14297
|
{
|
|
14076
14298
|
sticky,
|
|
@@ -14098,11 +14320,11 @@ var ItemList = ({
|
|
|
14098
14320
|
column.headerName
|
|
14099
14321
|
);
|
|
14100
14322
|
}
|
|
14101
|
-
return /* @__PURE__ */
|
|
14102
|
-
})), /* @__PURE__ */
|
|
14323
|
+
return /* @__PURE__ */ React138.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, column.headerName);
|
|
14324
|
+
})), /* @__PURE__ */ React138.createElement(Rows, { columns, items: sortedItems, level: 0, ...infiniteProps }));
|
|
14103
14325
|
};
|
|
14104
14326
|
var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
14105
|
-
return /* @__PURE__ */
|
|
14327
|
+
return /* @__PURE__ */ React138.createElement(
|
|
14106
14328
|
List,
|
|
14107
14329
|
{
|
|
14108
14330
|
...level === 0 ? infiniteProps : {},
|
|
@@ -14111,22 +14333,22 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
|
14111
14333
|
const hasSubItems = item.items && item.items.length > 0;
|
|
14112
14334
|
const isLastItem = itemIndex === items.length - 1;
|
|
14113
14335
|
const noDivider = level === 0 && isLastItem || level > 0 && (isLastGroup || !isLastItem) || hasSubItems;
|
|
14114
|
-
return /* @__PURE__ */
|
|
14336
|
+
return /* @__PURE__ */ React138.createElement(React138.Fragment, { key: item.id }, /* @__PURE__ */ React138.createElement(DataList.Row, { noDivider }, /* @__PURE__ */ React138.createElement(
|
|
14115
14337
|
List,
|
|
14116
14338
|
{
|
|
14117
14339
|
items: columns,
|
|
14118
|
-
renderItem: (column, columnIndex) => /* @__PURE__ */
|
|
14340
|
+
renderItem: (column, columnIndex) => /* @__PURE__ */ React138.createElement(
|
|
14119
14341
|
DataList.Cell,
|
|
14120
14342
|
{
|
|
14121
14343
|
key: column.key ?? column.headerName,
|
|
14122
14344
|
...cellProps(column),
|
|
14123
14345
|
style: level > 1 && columnIndex === 0 ? { paddingLeft: (level - 1) * 60 } : void 0
|
|
14124
14346
|
},
|
|
14125
|
-
level > 0 && columnIndex === 0 && /* @__PURE__ */
|
|
14126
|
-
/* @__PURE__ */
|
|
14347
|
+
level > 0 && columnIndex === 0 && /* @__PURE__ */ React138.createElement(DataList.TreeLine, { isLast: itemIndex === items.length - 1 }),
|
|
14348
|
+
/* @__PURE__ */ React138.createElement(DataListCell, { column, row: item, index: columnIndex, rows: items })
|
|
14127
14349
|
)
|
|
14128
14350
|
}
|
|
14129
|
-
)), item.items && /* @__PURE__ */
|
|
14351
|
+
)), item.items && /* @__PURE__ */ React138.createElement(WithGroup, { level }, /* @__PURE__ */ React138.createElement(
|
|
14130
14352
|
Rows,
|
|
14131
14353
|
{
|
|
14132
14354
|
columns,
|
|
@@ -14139,7 +14361,7 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
|
14139
14361
|
}
|
|
14140
14362
|
);
|
|
14141
14363
|
};
|
|
14142
|
-
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */
|
|
14364
|
+
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */ React138.createElement(DataList.Row, { isGroup: true }, children) : /* @__PURE__ */ React138.createElement(React138.Fragment, null, children);
|
|
14143
14365
|
|
|
14144
14366
|
// src/molecules/index.ts
|
|
14145
14367
|
var SelectItem = Select.Item;
|