@aivenio/aquarium 1.12.0 → 1.13.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_variables.scss +1 -1
- package/dist/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +13 -6
- package/dist/atoms.mjs +13 -6
- package/dist/src/atoms/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/src/atoms/Popover/Popover.d.ts +2 -0
- package/dist/src/atoms/Popover/Popover.js +6 -2
- package/dist/src/molecules/Charts/data.d.ts +1 -0
- package/dist/src/molecules/Charts/data.js +122 -0
- package/dist/src/molecules/Combobox/Combobox.js +25 -24
- package/dist/src/molecules/Dialog/Dialog.d.ts +3 -3
- package/dist/src/molecules/Dialog/Dialog.js +25 -22
- package/dist/src/molecules/Dropdown/Dropdown.js +2 -2
- package/dist/src/molecules/DropdownMenu/DropdownMenu.js +4 -13
- package/dist/src/molecules/Modal/Modal.d.ts +5 -0
- package/dist/src/molecules/Modal/Modal.js +35 -32
- package/dist/src/molecules/MultiSelect/MultiSelect.js +26 -25
- package/dist/src/molecules/Popover/Dialog.d.ts +2 -0
- package/dist/src/molecules/Popover/Dialog.js +9 -0
- package/dist/src/molecules/Popover/Popover.d.ts +8 -6
- package/dist/src/molecules/Popover/Popover.js +8 -17
- package/dist/src/molecules/Popover/PopoverOverlay.d.ts +20 -0
- package/dist/src/molecules/Popover/PopoverOverlay.js +35 -0
- package/dist/src/molecules/PopoverDialog/PopoverDialog.js +2 -2
- package/dist/src/molecules/Select/Select.js +18 -24
- package/dist/styles.css +6 -0
- package/dist/styles_timescaledb.css +6 -0
- package/dist/system.cjs +678 -665
- package/dist/system.mjs +646 -633
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +4 -4
- package/dist/src/molecules/Popover/PopoverWrapper.d.ts +0 -16
- package/dist/src/molecules/Popover/PopoverWrapper.js +0 -34
package/dist/system.mjs
CHANGED
@@ -4912,18 +4912,16 @@ var ChoiceChip = (_a) => {
|
|
4912
4912
|
};
|
4913
4913
|
|
4914
4914
|
// src/molecules/Combobox/Combobox.tsx
|
4915
|
-
import React41, { useEffect as
|
4916
|
-
import {
|
4915
|
+
import React41, { useEffect as useEffect5, useRef as useRef5, useState as useState5 } from "react";
|
4916
|
+
import { ariaHideOutside } from "@react-aria/overlays";
|
4917
4917
|
import { useCombobox } from "downshift";
|
4918
4918
|
import omit6 from "lodash/omit";
|
4919
4919
|
import uniqueId2 from "lodash/uniqueId";
|
4920
4920
|
import { matchSorter } from "match-sorter";
|
4921
4921
|
|
4922
|
-
// src/molecules/Popover/
|
4923
|
-
import React40 from "react";
|
4924
|
-
import {
|
4925
|
-
import { OverlayContainer as OverlayContainer2, useModal, useOverlay } from "@react-aria/overlays";
|
4926
|
-
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
4922
|
+
// src/molecules/Popover/PopoverOverlay.tsx
|
4923
|
+
import React40, { useEffect as useEffect4 } from "react";
|
4924
|
+
import { DismissButton, Overlay, usePopover } from "@react-aria/overlays";
|
4927
4925
|
|
4928
4926
|
// src/atoms/Popover/Popover.tsx
|
4929
4927
|
import React39 from "react";
|
@@ -4933,69 +4931,83 @@ var PopoverPanel = React39.forwardRef((_a, ref) => {
|
|
4933
4931
|
ref,
|
4934
4932
|
className: classNames(
|
4935
4933
|
className,
|
4936
|
-
tw(
|
4937
|
-
"rounded-sm shadow-16dp bg-white mt-1 overflow-y-auto flex flex-col focus-visible:outline-0 focus-visible:border-info-70 border border-grey-20"
|
4938
|
-
)
|
4934
|
+
tw("rounded-sm shadow-16dp bg-white mt-1 overflow-y-auto flex flex-col border border-grey-20 outline-none")
|
4939
4935
|
)
|
4940
4936
|
}, props), children);
|
4941
4937
|
});
|
4938
|
+
PopoverPanel.displayName = "Popover.Panel";
|
4939
|
+
var PopoverUnderlay = React39.forwardRef((props, ref) => /* @__PURE__ */ React39.createElement("div", __spreadProps(__spreadValues({
|
4940
|
+
ref
|
4941
|
+
}, props), {
|
4942
|
+
className: tw("fixed inset-0")
|
4943
|
+
})));
|
4944
|
+
PopoverUnderlay.displayName = "Popover.Underlay";
|
4942
4945
|
var Popover = {
|
4943
|
-
Panel: PopoverPanel
|
4946
|
+
Panel: PopoverPanel,
|
4947
|
+
Underlay: PopoverUnderlay
|
4944
4948
|
};
|
4945
4949
|
|
4946
|
-
// src/molecules/Popover/
|
4947
|
-
var
|
4948
|
-
|
4949
|
-
id,
|
4950
|
-
children,
|
4951
|
-
placement,
|
4952
|
-
arrowProps,
|
4953
|
-
isOpen,
|
4954
|
-
hideArrow,
|
4955
|
-
shouldCloseOnBlur,
|
4956
|
-
isKeyboardDismissDisabled,
|
4957
|
-
isNonModal = true,
|
4958
|
-
isDismissable,
|
4959
|
-
autoFocus,
|
4960
|
-
containFocus,
|
4961
|
-
className
|
4962
|
-
} = _a, otherProps = __objRest(_a, [
|
4963
|
-
"id",
|
4964
|
-
"children",
|
4965
|
-
"placement",
|
4966
|
-
"arrowProps",
|
4967
|
-
"isOpen",
|
4968
|
-
"hideArrow",
|
4969
|
-
"shouldCloseOnBlur",
|
4970
|
-
"isKeyboardDismissDisabled",
|
4971
|
-
"isNonModal",
|
4972
|
-
"isDismissable",
|
4973
|
-
"autoFocus",
|
4974
|
-
"containFocus",
|
4975
|
-
"className"
|
4976
|
-
]);
|
4977
|
-
const { overlayProps } = useOverlay(
|
4978
|
-
__spreadProps(__spreadValues({}, props), { isDismissable: isDismissable && isOpen }),
|
4950
|
+
// src/molecules/Popover/PopoverOverlay.tsx
|
4951
|
+
var PopoverOverlay = React40.forwardRef((props, ref) => {
|
4952
|
+
return /* @__PURE__ */ React40.createElement(Overlay, null, /* @__PURE__ */ React40.createElement(Wrapper, __spreadValues({
|
4979
4953
|
ref
|
4980
|
-
);
|
4981
|
-
const { modalProps } = useModal({
|
4982
|
-
isDisabled: isNonModal
|
4983
|
-
});
|
4984
|
-
if (!props.isOpen) {
|
4985
|
-
return null;
|
4986
|
-
}
|
4987
|
-
return /* @__PURE__ */ React40.createElement(OverlayContainer2, null, /* @__PURE__ */ React40.createElement(FocusScope, {
|
4988
|
-
restoreFocus: true,
|
4989
|
-
autoFocus,
|
4990
|
-
contain: containFocus
|
4991
|
-
}, /* @__PURE__ */ React40.createElement(Popover.Panel, __spreadProps(__spreadValues({
|
4992
|
-
ref,
|
4993
|
-
role: "dialog"
|
4994
|
-
}, mergeProps2(otherProps, modalProps, overlayProps)), {
|
4995
|
-
id: id != null ? id : overlayProps.id,
|
4996
|
-
className
|
4997
|
-
}), children)));
|
4954
|
+
}, props)));
|
4998
4955
|
});
|
4956
|
+
var Wrapper = React40.forwardRef(
|
4957
|
+
(_a, ref) => {
|
4958
|
+
var _b = _a, {
|
4959
|
+
id,
|
4960
|
+
state,
|
4961
|
+
className,
|
4962
|
+
style = {},
|
4963
|
+
placement = "bottom-left",
|
4964
|
+
role,
|
4965
|
+
isNonModal = false,
|
4966
|
+
autoFocus,
|
4967
|
+
containFocus,
|
4968
|
+
children,
|
4969
|
+
popoverRef: _popoverRef
|
4970
|
+
} = _b, props = __objRest(_b, [
|
4971
|
+
"id",
|
4972
|
+
"state",
|
4973
|
+
"className",
|
4974
|
+
"style",
|
4975
|
+
"placement",
|
4976
|
+
"role",
|
4977
|
+
"isNonModal",
|
4978
|
+
"autoFocus",
|
4979
|
+
"containFocus",
|
4980
|
+
"children",
|
4981
|
+
"popoverRef"
|
4982
|
+
]);
|
4983
|
+
const popoverRef = React40.useRef(null);
|
4984
|
+
React40.useImperativeHandle(ref, () => popoverRef.current);
|
4985
|
+
useEffect4(() => {
|
4986
|
+
if (autoFocus && popoverRef.current) {
|
4987
|
+
popoverRef.current.focus();
|
4988
|
+
}
|
4989
|
+
}, []);
|
4990
|
+
const { underlayProps, popoverProps } = usePopover(
|
4991
|
+
__spreadProps(__spreadValues({}, props), {
|
4992
|
+
isNonModal,
|
4993
|
+
placement: placement.replace("-", " "),
|
4994
|
+
popoverRef
|
4995
|
+
}),
|
4996
|
+
state
|
4997
|
+
);
|
4998
|
+
return /* @__PURE__ */ React40.createElement("div", null, !isNonModal && /* @__PURE__ */ React40.createElement(Popover.Underlay, __spreadValues({}, underlayProps)), /* @__PURE__ */ React40.createElement(Popover.Panel, __spreadProps(__spreadValues({
|
4999
|
+
ref: popoverRef,
|
5000
|
+
tabIndex: 0,
|
5001
|
+
role: role != null ? role : "presentation"
|
5002
|
+
}, popoverProps), {
|
5003
|
+
id: id != null ? id : popoverProps.id,
|
5004
|
+
style: __spreadValues(__spreadValues({}, popoverProps.style), style),
|
5005
|
+
className
|
5006
|
+
}), children, /* @__PURE__ */ React40.createElement(DismissButton, {
|
5007
|
+
onDismiss: state.close
|
5008
|
+
})));
|
5009
|
+
}
|
5010
|
+
);
|
4999
5011
|
|
5000
5012
|
// src/molecules/Combobox/Combobox.tsx
|
5001
5013
|
var ComboboxBase = (_a) => {
|
@@ -5039,8 +5051,10 @@ var ComboboxBase = (_a) => {
|
|
5039
5051
|
"readOnly"
|
5040
5052
|
]);
|
5041
5053
|
var _a2;
|
5054
|
+
const popoverRef = useRef5(null);
|
5042
5055
|
const targetRef = useRef5(null);
|
5043
|
-
const
|
5056
|
+
const menuRef = useRef5(null);
|
5057
|
+
const inputRef = useRef5(null);
|
5044
5058
|
const [inputItems, setInputItems] = useState5(options);
|
5045
5059
|
const [hasFocus, setFocus] = useState5(false);
|
5046
5060
|
const updateInputItems = (query) => {
|
@@ -5049,15 +5063,16 @@ var ComboboxBase = (_a) => {
|
|
5049
5063
|
};
|
5050
5064
|
const {
|
5051
5065
|
isOpen,
|
5066
|
+
openMenu,
|
5067
|
+
closeMenu,
|
5068
|
+
toggleMenu,
|
5052
5069
|
getToggleButtonProps,
|
5053
5070
|
getMenuProps,
|
5054
5071
|
getInputProps,
|
5055
5072
|
highlightedIndex,
|
5056
5073
|
inputValue,
|
5057
5074
|
getItemProps,
|
5058
|
-
selectedItem
|
5059
|
-
closeMenu,
|
5060
|
-
openMenu
|
5075
|
+
selectedItem
|
5061
5076
|
} = useCombobox({
|
5062
5077
|
id,
|
5063
5078
|
selectedItem: value,
|
@@ -5078,20 +5093,24 @@ var ComboboxBase = (_a) => {
|
|
5078
5093
|
onSelectedItemChange: (e) => onChange == null ? void 0 : onChange(e.selectedItem),
|
5079
5094
|
onInputValueChange: ({ inputValue: inputValue2 }) => updateInputItems(inputValue2)
|
5080
5095
|
});
|
5081
|
-
const
|
5082
|
-
|
5083
|
-
|
5084
|
-
|
5085
|
-
|
5086
|
-
|
5087
|
-
}
|
5088
|
-
|
5096
|
+
const state = {
|
5097
|
+
isOpen,
|
5098
|
+
close: closeMenu,
|
5099
|
+
open: openMenu,
|
5100
|
+
toggle: toggleMenu,
|
5101
|
+
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
5102
|
+
};
|
5103
|
+
useEffect5(() => {
|
5089
5104
|
updateInputItems(inputValue);
|
5090
5105
|
}, [JSON.stringify(options)]);
|
5091
|
-
|
5106
|
+
useEffect5(() => {
|
5107
|
+
if (state.isOpen && inputRef.current && popoverRef.current) {
|
5108
|
+
return ariaHideOutside([inputRef.current, popoverRef.current]);
|
5109
|
+
}
|
5110
|
+
}, [state.isOpen, inputRef, popoverRef]);
|
5111
|
+
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
5112
|
+
const inputProps = getInputProps({ ref: inputRef, disabled: disabled || readOnly });
|
5092
5113
|
const hasNoResults = options.length === 0 || inputItems.length === 0;
|
5093
|
-
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
5094
|
-
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
5095
5114
|
return /* @__PURE__ */ React41.createElement("div", {
|
5096
5115
|
className: tw("relative")
|
5097
5116
|
}, /* @__PURE__ */ React41.createElement(Select.InputContainer, {
|
@@ -5099,6 +5118,7 @@ var ComboboxBase = (_a) => {
|
|
5099
5118
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
5100
5119
|
}, /* @__PURE__ */ React41.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
5101
5120
|
id,
|
5121
|
+
ref: inputRef,
|
5102
5122
|
name,
|
5103
5123
|
placeholder: readOnly ? void 0 : placeholder
|
5104
5124
|
}, inputProps), props), {
|
@@ -5122,16 +5142,18 @@ var ComboboxBase = (_a) => {
|
|
5122
5142
|
})), !readOnly && /* @__PURE__ */ React41.createElement(Select.Toggle, __spreadValues({
|
5123
5143
|
hasFocus,
|
5124
5144
|
isOpen
|
5125
|
-
}, getToggleButtonProps({ disabled })))), /* @__PURE__ */ React41.createElement(
|
5126
|
-
|
5127
|
-
|
5128
|
-
|
5129
|
-
|
5130
|
-
|
5131
|
-
|
5132
|
-
|
5145
|
+
}, getToggleButtonProps({ disabled })))), isOpen && /* @__PURE__ */ React41.createElement(PopoverOverlay, {
|
5146
|
+
ref: popoverRef,
|
5147
|
+
triggerRef: targetRef,
|
5148
|
+
state,
|
5149
|
+
placement: "bottom-left",
|
5150
|
+
shouldFlip: true,
|
5151
|
+
isNonModal: true,
|
5152
|
+
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
5153
|
+
}, /* @__PURE__ */ React41.createElement(Select.Menu, __spreadValues({
|
5154
|
+
ref: menuRef,
|
5133
5155
|
maxHeight
|
5134
|
-
},
|
5156
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React41.createElement(Select.NoResults, null, noResults), inputItems.map((item, index) => /* @__PURE__ */ React41.createElement(Select.Item, __spreadValues({
|
5135
5157
|
key: itemToString(item),
|
5136
5158
|
selected: item === selectedItem,
|
5137
5159
|
highlighted: index === highlightedIndex
|
@@ -5600,8 +5622,7 @@ var DataTable = (_a) => {
|
|
5600
5622
|
// src/molecules/Dialog/Dialog.tsx
|
5601
5623
|
import React53 from "react";
|
5602
5624
|
import { useDialog } from "@react-aria/dialog";
|
5603
|
-
import {
|
5604
|
-
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
5625
|
+
import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
|
5605
5626
|
import { useId } from "@react-aria/utils";
|
5606
5627
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
5607
5628
|
import omit7 from "lodash/omit";
|
@@ -5728,36 +5749,37 @@ Modal.Actions = (_a) => {
|
|
5728
5749
|
};
|
5729
5750
|
|
5730
5751
|
// src/molecules/Dialog/Dialog.tsx
|
5731
|
-
var Dialog = ({
|
5752
|
+
var Dialog = (props) => {
|
5753
|
+
const ref = React53.useRef(null);
|
5754
|
+
const state = useOverlayTriggerState2({ isOpen: props.open });
|
5755
|
+
const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
|
5756
|
+
if (!state.isOpen) {
|
5757
|
+
return null;
|
5758
|
+
}
|
5759
|
+
return /* @__PURE__ */ React53.createElement(Overlay2, null, /* @__PURE__ */ React53.createElement(Modal, {
|
5760
|
+
open: true
|
5761
|
+
}, /* @__PURE__ */ React53.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React53.createElement(Modal.Dialog, __spreadValues({
|
5762
|
+
ref,
|
5763
|
+
size: "sm"
|
5764
|
+
}, modalProps), /* @__PURE__ */ React53.createElement(DialogWrapper, __spreadValues({}, props)))));
|
5765
|
+
};
|
5766
|
+
var DialogWrapper = ({
|
5732
5767
|
title,
|
5733
5768
|
type = "confirmation",
|
5734
|
-
open,
|
5735
5769
|
children,
|
5736
5770
|
primaryAction,
|
5737
5771
|
secondaryAction
|
5738
5772
|
}) => {
|
5739
5773
|
const ref = React53.useRef(null);
|
5740
|
-
const state = useOverlayTriggerState2({ isOpen: open });
|
5741
|
-
const { modalProps, underlayProps } = useModalOverlay({ isDismissable: false }, state, ref);
|
5742
5774
|
const labelledBy = useId();
|
5743
5775
|
const describedBy = useId();
|
5744
5776
|
const { dialogProps } = useDialog(
|
5745
5777
|
{ "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
5746
5778
|
ref
|
5747
5779
|
);
|
5748
|
-
|
5749
|
-
|
5750
|
-
}
|
5751
|
-
return /* @__PURE__ */ React53.createElement(Overlay, null, /* @__PURE__ */ React53.createElement(Modal, {
|
5752
|
-
open
|
5753
|
-
}, /* @__PURE__ */ React53.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React53.createElement(FocusScope2, {
|
5754
|
-
contain: true,
|
5755
|
-
restoreFocus: true,
|
5756
|
-
autoFocus: true
|
5757
|
-
}, /* @__PURE__ */ React53.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
5758
|
-
ref,
|
5759
|
-
size: "sm"
|
5760
|
-
}, modalProps), dialogProps), /* @__PURE__ */ React53.createElement(Modal.Header, null, /* @__PURE__ */ React53.createElement(Icon, {
|
5780
|
+
return /* @__PURE__ */ React53.createElement("div", __spreadValues({
|
5781
|
+
ref
|
5782
|
+
}, dialogProps), /* @__PURE__ */ React53.createElement(Modal.Header, null, /* @__PURE__ */ React53.createElement(Icon, {
|
5761
5783
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
5762
5784
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
5763
5785
|
fontSize: 20
|
@@ -5771,7 +5793,7 @@ var Dialog = ({
|
|
5771
5793
|
key: secondaryAction.text
|
5772
5794
|
}, omit7(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React53.createElement(SecondaryButton, __spreadValues({
|
5773
5795
|
key: primaryAction.text
|
5774
|
-
}, omit7(primaryAction, "text")), primaryAction.text))))
|
5796
|
+
}, omit7(primaryAction, "text")), primaryAction.text))));
|
5775
5797
|
};
|
5776
5798
|
|
5777
5799
|
// src/molecules/Divider/Divider.tsx
|
@@ -5806,15 +5828,28 @@ var Divider2 = (_a) => {
|
|
5806
5828
|
};
|
5807
5829
|
|
5808
5830
|
// src/molecules/Dropdown/Dropdown.tsx
|
5809
|
-
import
|
5831
|
+
import React57 from "react";
|
5810
5832
|
|
5811
5833
|
// src/molecules/Popover/Popover.tsx
|
5812
|
-
import
|
5834
|
+
import React56, { useRef as useRef6 } from "react";
|
5813
5835
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
5814
|
-
import {
|
5815
|
-
import { mergeProps as
|
5836
|
+
import { useOverlayTrigger } from "@react-aria/overlays";
|
5837
|
+
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
5816
5838
|
import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-stately/overlays";
|
5817
5839
|
|
5840
|
+
// src/molecules/Popover/Dialog.tsx
|
5841
|
+
import React55 from "react";
|
5842
|
+
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
5843
|
+
var Dialog2 = ({ children }) => {
|
5844
|
+
const ref = React55.useRef(null);
|
5845
|
+
const { dialogProps } = useDialog2({}, ref);
|
5846
|
+
return /* @__PURE__ */ React55.createElement("div", __spreadProps(__spreadValues({
|
5847
|
+
ref
|
5848
|
+
}, dialogProps), {
|
5849
|
+
className: tw("outline-none")
|
5850
|
+
}), children);
|
5851
|
+
};
|
5852
|
+
|
5818
5853
|
// src/molecules/Popover/PopoverContext.tsx
|
5819
5854
|
import { createContext, useContext as useContext2 } from "react";
|
5820
5855
|
var PopoverContext = createContext(null);
|
@@ -5828,65 +5863,46 @@ var usePopoverContext = () => {
|
|
5828
5863
|
|
5829
5864
|
// src/molecules/Popover/Popover.tsx
|
5830
5865
|
var Popover2 = (props) => {
|
5831
|
-
var _a;
|
5832
5866
|
const {
|
5833
5867
|
id,
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5837
|
-
|
5838
|
-
|
5839
|
-
|
5868
|
+
type,
|
5869
|
+
placement = "bottom-left",
|
5870
|
+
containFocus = true,
|
5871
|
+
isKeyboardDismissDisabled = false,
|
5872
|
+
targetRef,
|
5873
|
+
offset,
|
5874
|
+
crossOffset,
|
5875
|
+
shouldFlip
|
5840
5876
|
} = props;
|
5841
5877
|
const triggerRef = useRef6(null);
|
5842
|
-
const overlayRef = useRef6(null);
|
5843
5878
|
const state = useOverlayTriggerState3(props);
|
5844
|
-
const {
|
5845
|
-
|
5846
|
-
placement,
|
5847
|
-
arrowProps
|
5848
|
-
} = useOverlayPosition3({
|
5849
|
-
targetRef: targetRef != null ? targetRef : triggerRef,
|
5850
|
-
overlayRef,
|
5851
|
-
placement: _placement.replace("-", " "),
|
5852
|
-
offset: props.offset,
|
5853
|
-
shouldFlip: props.shouldFlip,
|
5854
|
-
isOpen: state.isOpen
|
5855
|
-
});
|
5856
|
-
const { triggerProps, overlayProps: otherOverlayProps } = useOverlayTrigger(
|
5857
|
-
{ type: (_a = props.type) != null ? _a : "dialog" },
|
5858
|
-
state,
|
5859
|
-
triggerRef
|
5860
|
-
);
|
5861
|
-
return /* @__PURE__ */ React55.createElement(PopoverContext.Provider, {
|
5879
|
+
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
5880
|
+
return /* @__PURE__ */ React56.createElement(PopoverContext.Provider, {
|
5862
5881
|
value: {
|
5863
5882
|
state
|
5864
5883
|
}
|
5865
|
-
},
|
5884
|
+
}, React56.Children.map(props.children, (child) => {
|
5866
5885
|
if (isComponentType(child, Popover2.Trigger)) {
|
5867
|
-
return /* @__PURE__ */
|
5868
|
-
ref: triggerRef
|
5869
|
-
|
5870
|
-
}, triggerProps), /* @__PURE__ */ React55.createElement(PopoverTriggerWrapper, {
|
5886
|
+
return /* @__PURE__ */ React56.createElement(PressResponder, __spreadValues({
|
5887
|
+
ref: triggerRef
|
5888
|
+
}, triggerProps), /* @__PURE__ */ React56.createElement(PopoverTriggerWrapper, {
|
5871
5889
|
"data-testid": props["data-testid"],
|
5872
5890
|
"aria-controls": id
|
5873
5891
|
}, child.props.children));
|
5874
5892
|
}
|
5875
5893
|
if (isComponentType(child, Popover2.Panel)) {
|
5876
|
-
return /* @__PURE__ */
|
5877
|
-
|
5878
|
-
|
5879
|
-
onClose: state.close,
|
5894
|
+
return state.isOpen && /* @__PURE__ */ React56.createElement(PopoverOverlay, __spreadValues({
|
5895
|
+
triggerRef: targetRef != null ? targetRef : triggerRef,
|
5896
|
+
state,
|
5880
5897
|
placement,
|
5881
|
-
|
5882
|
-
|
5898
|
+
isNonModal: !containFocus,
|
5899
|
+
autoFocus: !containFocus,
|
5883
5900
|
isKeyboardDismissDisabled,
|
5884
|
-
|
5885
|
-
|
5886
|
-
|
5887
|
-
|
5888
|
-
|
5889
|
-
}), child.props.children);
|
5901
|
+
className: child.props.className,
|
5902
|
+
offset,
|
5903
|
+
crossOffset,
|
5904
|
+
shouldFlip
|
5905
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React56.createElement(Dialog2, null, child.props.children) : child.props.children);
|
5890
5906
|
}
|
5891
5907
|
throw new Error("Invalid children element type");
|
5892
5908
|
}));
|
@@ -5905,7 +5921,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
5905
5921
|
state.close();
|
5906
5922
|
onClick == null ? void 0 : onClick(e);
|
5907
5923
|
};
|
5908
|
-
return /* @__PURE__ */
|
5924
|
+
return /* @__PURE__ */ React56.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
5909
5925
|
onClick: handleClick
|
5910
5926
|
}));
|
5911
5927
|
};
|
@@ -5918,22 +5934,21 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5918
5934
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5919
5935
|
var _a2;
|
5920
5936
|
const ref = useRef6(null);
|
5921
|
-
const trigger =
|
5937
|
+
const trigger = React56.Children.only(children);
|
5922
5938
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
|
5923
|
-
return
|
5939
|
+
return React56.cloneElement(trigger, __spreadProps(__spreadValues({
|
5924
5940
|
"ref": ref
|
5925
|
-
},
|
5941
|
+
}, mergeProps2(pressProps, trigger.props)), {
|
5926
5942
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
5927
5943
|
}));
|
5928
5944
|
};
|
5929
5945
|
|
5930
5946
|
// src/molecules/Dropdown/Dropdown.tsx
|
5931
5947
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
5932
|
-
return /* @__PURE__ */
|
5948
|
+
return /* @__PURE__ */ React57.createElement(Popover2, {
|
5933
5949
|
type: "menu",
|
5934
|
-
placement
|
5935
|
-
|
5936
|
-
}, /* @__PURE__ */ React56.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React56.createElement(Popover2.Panel, null, content));
|
5950
|
+
placement
|
5951
|
+
}, /* @__PURE__ */ React57.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React57.createElement(Popover2.Panel, null, content));
|
5937
5952
|
};
|
5938
5953
|
var DropdownMenu = ({
|
5939
5954
|
title,
|
@@ -5942,26 +5957,26 @@ var DropdownMenu = ({
|
|
5942
5957
|
triggerId,
|
5943
5958
|
setClose = () => void 0
|
5944
5959
|
}) => {
|
5945
|
-
const menuRef =
|
5946
|
-
|
5960
|
+
const menuRef = React57.useRef(null);
|
5961
|
+
React57.useEffect(() => {
|
5947
5962
|
const id = setTimeout(() => {
|
5948
5963
|
var _a, _b, _c;
|
5949
5964
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
5950
5965
|
});
|
5951
5966
|
return () => clearTimeout(id);
|
5952
5967
|
}, [menuRef.current]);
|
5953
|
-
return /* @__PURE__ */
|
5968
|
+
return /* @__PURE__ */ React57.createElement("div", {
|
5954
5969
|
style: { minWidth: "250px" },
|
5955
5970
|
className: tw("py-3 bg-white")
|
5956
|
-
}, !!title && /* @__PURE__ */
|
5971
|
+
}, !!title && /* @__PURE__ */ React57.createElement("div", {
|
5957
5972
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
5958
|
-
}, title), /* @__PURE__ */
|
5973
|
+
}, title), /* @__PURE__ */ React57.createElement("ol", {
|
5959
5974
|
role: "menu",
|
5960
5975
|
ref: menuRef,
|
5961
5976
|
id: contentId,
|
5962
5977
|
"aria-labelledby": triggerId
|
5963
|
-
},
|
5964
|
-
return
|
5978
|
+
}, React57.Children.map(children, (child) => {
|
5979
|
+
return React57.cloneElement(child, { setClose });
|
5965
5980
|
})));
|
5966
5981
|
};
|
5967
5982
|
var DropdownItem = (_a) => {
|
@@ -6016,10 +6031,10 @@ var DropdownItem = (_a) => {
|
|
6016
6031
|
handleSelect();
|
6017
6032
|
}
|
6018
6033
|
};
|
6019
|
-
const itemContent = /* @__PURE__ */
|
6034
|
+
const itemContent = /* @__PURE__ */ React57.createElement("div", {
|
6020
6035
|
className: tw("py-3 px-4")
|
6021
6036
|
}, children);
|
6022
|
-
return /* @__PURE__ */
|
6037
|
+
return /* @__PURE__ */ React57.createElement("li", __spreadProps(__spreadValues({
|
6023
6038
|
role: "menuitem",
|
6024
6039
|
tabIndex: -1,
|
6025
6040
|
onClick: handleClick,
|
@@ -6030,11 +6045,11 @@ var DropdownItem = (_a) => {
|
|
6030
6045
|
"text-grey-10 cursor-not-allowed": disabled,
|
6031
6046
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
6032
6047
|
})
|
6033
|
-
}), tooltip ? /* @__PURE__ */
|
6048
|
+
}), tooltip ? /* @__PURE__ */ React57.createElement(Tooltip, {
|
6034
6049
|
content: tooltip,
|
6035
6050
|
placement: tooltipPlacement,
|
6036
6051
|
inline: false
|
6037
|
-
}, /* @__PURE__ */
|
6052
|
+
}, /* @__PURE__ */ React57.createElement("div", {
|
6038
6053
|
tabIndex: 0,
|
6039
6054
|
className: tw("grow")
|
6040
6055
|
}, itemContent)) : itemContent);
|
@@ -6043,49 +6058,48 @@ Dropdown.Menu = DropdownMenu;
|
|
6043
6058
|
Dropdown.Item = DropdownItem;
|
6044
6059
|
|
6045
6060
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
6046
|
-
import
|
6061
|
+
import React61 from "react";
|
6047
6062
|
import { useFilter } from "@react-aria/i18n";
|
6048
6063
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
6049
6064
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
6050
|
-
import { useOverlayPosition as useOverlayPosition4 } from "@react-aria/overlays";
|
6051
6065
|
import { useSeparator } from "@react-aria/separator";
|
6052
|
-
import { mergeProps as
|
6066
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
6053
6067
|
import { Item as Item4, Section } from "@react-stately/collections";
|
6054
6068
|
import { useMenuTriggerState } from "@react-stately/menu";
|
6055
6069
|
import { useTreeState } from "@react-stately/tree";
|
6056
6070
|
|
6057
6071
|
// src/molecules/Input/Input.tsx
|
6058
|
-
import
|
6072
|
+
import React59, { forwardRef, useImperativeHandle, useRef as useRef7, useState as useState6 } from "react";
|
6059
6073
|
import omit8 from "lodash/omit";
|
6060
6074
|
import toString from "lodash/toString";
|
6061
6075
|
import uniqueId3 from "lodash/uniqueId";
|
6062
6076
|
|
6063
6077
|
// src/utils/form/InputAdornment/InputAdornment.tsx
|
6064
|
-
import
|
6078
|
+
import React58 from "react";
|
6065
6079
|
var import_cross4 = __toESM(require_cross());
|
6066
6080
|
var import_error3 = __toESM(require_error());
|
6067
6081
|
var import_search2 = __toESM(require_search());
|
6068
6082
|
var import_tick3 = __toESM(require_tick());
|
6069
6083
|
var InputAdornment = ({ placement = "right", className, dense, children }) => {
|
6070
|
-
return /* @__PURE__ */
|
6084
|
+
return /* @__PURE__ */ React58.createElement("span", {
|
6071
6085
|
className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
|
6072
6086
|
"right-0": placement === "right",
|
6073
6087
|
"left-0": placement === "left",
|
6074
6088
|
"typography-small": dense,
|
6075
6089
|
"typography-default-strong": !dense
|
6076
6090
|
})
|
6077
|
-
}, /* @__PURE__ */
|
6091
|
+
}, /* @__PURE__ */ React58.createElement(Flexbox, {
|
6078
6092
|
gap: "3",
|
6079
6093
|
wrap: "wrap"
|
6080
6094
|
}, children));
|
6081
6095
|
};
|
6082
|
-
var SearchIcon = ({ onClick }) => /* @__PURE__ */
|
6096
|
+
var SearchIcon = ({ onClick }) => /* @__PURE__ */ React58.createElement(Icon, {
|
6083
6097
|
icon: import_search2.default,
|
6084
6098
|
color: "grey-30",
|
6085
6099
|
"data-testid": "icon-search",
|
6086
6100
|
onClick
|
6087
6101
|
});
|
6088
|
-
var ResetIcon = ({ onClick }) => /* @__PURE__ */
|
6102
|
+
var ResetIcon = ({ onClick }) => /* @__PURE__ */ React58.createElement(Icon, {
|
6089
6103
|
className: "hover:cursor-pointer",
|
6090
6104
|
icon: import_cross4.default,
|
6091
6105
|
color: "grey-30",
|
@@ -6115,7 +6129,7 @@ var createInput = (displayName, opts = {}) => {
|
|
6115
6129
|
"readOnly"
|
6116
6130
|
]);
|
6117
6131
|
var _a2;
|
6118
|
-
const inputRef =
|
6132
|
+
const inputRef = React59.useRef(null);
|
6119
6133
|
useImperativeHandle(ref, () => inputRef.current);
|
6120
6134
|
const handleReset = () => {
|
6121
6135
|
var _a3;
|
@@ -6128,11 +6142,11 @@ var createInput = (displayName, opts = {}) => {
|
|
6128
6142
|
el.focus();
|
6129
6143
|
}
|
6130
6144
|
};
|
6131
|
-
return /* @__PURE__ */
|
6145
|
+
return /* @__PURE__ */ React59.createElement("span", {
|
6132
6146
|
className: tw("relative block")
|
6133
|
-
}, opts.adornment && /* @__PURE__ */
|
6147
|
+
}, opts.adornment && /* @__PURE__ */ React59.createElement(InputAdornment, {
|
6134
6148
|
placement: "left"
|
6135
|
-
}, opts.adornment), /* @__PURE__ */
|
6149
|
+
}, opts.adornment), /* @__PURE__ */ React59.createElement("input", __spreadProps(__spreadValues({
|
6136
6150
|
ref: inputRef,
|
6137
6151
|
type
|
6138
6152
|
}, props), {
|
@@ -6147,20 +6161,20 @@ var createInput = (displayName, opts = {}) => {
|
|
6147
6161
|
getCommonInputStyles({ readOnly, valid }),
|
6148
6162
|
props.className
|
6149
6163
|
)
|
6150
|
-
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */
|
6164
|
+
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React59.createElement(InputAdornment, null, /* @__PURE__ */ React59.createElement(ResetIcon, {
|
6151
6165
|
onClick: handleReset
|
6152
|
-
})), !opts.canReset && endAdornment && /* @__PURE__ */
|
6166
|
+
})), !opts.canReset && endAdornment && /* @__PURE__ */ React59.createElement(InputAdornment, null, endAdornment));
|
6153
6167
|
}
|
6154
6168
|
);
|
6155
6169
|
InputComponent.displayName = displayName;
|
6156
|
-
InputComponent.Skeleton = () => /* @__PURE__ */
|
6170
|
+
InputComponent.Skeleton = () => /* @__PURE__ */ React59.createElement(Skeleton, {
|
6157
6171
|
height: 38
|
6158
6172
|
});
|
6159
6173
|
return InputComponent;
|
6160
6174
|
};
|
6161
6175
|
var InputBase = createInput("InputBase");
|
6162
|
-
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */
|
6163
|
-
var Input2 =
|
6176
|
+
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React59.createElement(SearchIcon, null), canReset: true });
|
6177
|
+
var Input2 = React59.forwardRef((_a, ref) => {
|
6164
6178
|
var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
|
6165
6179
|
var _a2, _b2, _c;
|
6166
6180
|
const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
|
@@ -6169,12 +6183,12 @@ var Input2 = React58.forwardRef((_a, ref) => {
|
|
6169
6183
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
6170
6184
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
6171
6185
|
const baseProps = omit8(props, Object.keys(labelControlProps));
|
6172
|
-
return /* @__PURE__ */
|
6186
|
+
return /* @__PURE__ */ React59.createElement(LabelControl, __spreadValues({
|
6173
6187
|
id: `${id.current}-label`,
|
6174
6188
|
htmlFor: id.current,
|
6175
6189
|
messageId: errorMessageId,
|
6176
6190
|
length: value !== void 0 ? toString(value).length : void 0
|
6177
|
-
}, labelControlProps), /* @__PURE__ */
|
6191
|
+
}, labelControlProps), /* @__PURE__ */ React59.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
|
6178
6192
|
ref
|
6179
6193
|
}, baseProps), errorProps), {
|
6180
6194
|
id: id.current,
|
@@ -6192,41 +6206,42 @@ var Input2 = React58.forwardRef((_a, ref) => {
|
|
6192
6206
|
})));
|
6193
6207
|
});
|
6194
6208
|
Input2.displayName = "Input";
|
6195
|
-
Input2.Skeleton = () => /* @__PURE__ */
|
6209
|
+
Input2.Skeleton = () => /* @__PURE__ */ React59.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React59.createElement(InputBase.Skeleton, null));
|
6196
6210
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
6197
6211
|
|
6198
6212
|
// src/atoms/DropdownMenu/DropdownMenu.tsx
|
6199
|
-
import
|
6213
|
+
import React60 from "react";
|
6200
6214
|
var import_tick4 = __toESM(require_tick());
|
6201
|
-
var DropdownMenu2 =
|
6215
|
+
var DropdownMenu2 = React60.forwardRef(
|
6202
6216
|
(_a, ref) => {
|
6203
6217
|
var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
|
6204
|
-
return /* @__PURE__ */
|
6218
|
+
return /* @__PURE__ */ React60.createElement("div", __spreadValues({
|
6205
6219
|
ref,
|
6206
6220
|
style: { maxHeight, minWidth, maxWidth },
|
6207
6221
|
className: classNames(className, "bg-white w-full flex flex-col overflow-x-hidden typography-small text-grey-70")
|
6208
6222
|
}, props), children);
|
6209
6223
|
}
|
6210
6224
|
);
|
6211
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
6225
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React60.createElement("div", {
|
6212
6226
|
className: tw("p-3 overflow-y-auto overflow-x-hidden")
|
6213
6227
|
}, children);
|
6214
6228
|
DropdownMenu2.ContentContainer = ContentContainer;
|
6215
|
-
var List2 =
|
6229
|
+
var List2 = React60.forwardRef(
|
6216
6230
|
(_a, ref) => {
|
6217
|
-
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6218
|
-
return /* @__PURE__ */
|
6219
|
-
ref
|
6231
|
+
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
6232
|
+
return /* @__PURE__ */ React60.createElement("ul", __spreadValues({
|
6233
|
+
ref,
|
6234
|
+
className: classNames(className, "outline-none ring-0")
|
6220
6235
|
}, props), children);
|
6221
6236
|
}
|
6222
6237
|
);
|
6223
6238
|
DropdownMenu2.List = List2;
|
6224
|
-
var Group2 =
|
6239
|
+
var Group2 = React60.forwardRef(
|
6225
6240
|
(_a, ref) => {
|
6226
6241
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
6227
|
-
return /* @__PURE__ */
|
6242
|
+
return /* @__PURE__ */ React60.createElement("li", __spreadValues({
|
6228
6243
|
ref
|
6229
|
-
}, props), title && /* @__PURE__ */
|
6244
|
+
}, props), title && /* @__PURE__ */ React60.createElement("div", __spreadValues({
|
6230
6245
|
className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
|
6231
6246
|
"text-grey-20": props.disabled
|
6232
6247
|
})
|
@@ -6234,10 +6249,10 @@ var Group2 = React59.forwardRef(
|
|
6234
6249
|
}
|
6235
6250
|
);
|
6236
6251
|
DropdownMenu2.Group = Group2;
|
6237
|
-
var Item3 =
|
6252
|
+
var Item3 = React60.forwardRef(
|
6238
6253
|
(_a, ref) => {
|
6239
6254
|
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
6240
|
-
return /* @__PURE__ */
|
6255
|
+
return /* @__PURE__ */ React60.createElement("li", __spreadValues({
|
6241
6256
|
ref,
|
6242
6257
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
6243
6258
|
"cursor-pointer hover:bg-grey-0": !props.disabled,
|
@@ -6245,30 +6260,30 @@ var Item3 = React59.forwardRef(
|
|
6245
6260
|
"text-primary-80": kind === "action",
|
6246
6261
|
"text-grey-20 cursor-not-allowed": props.disabled
|
6247
6262
|
})
|
6248
|
-
}, props), icon && /* @__PURE__ */
|
6263
|
+
}, props), icon && /* @__PURE__ */ React60.createElement(InlineIcon, {
|
6249
6264
|
icon
|
6250
|
-
}), /* @__PURE__ */
|
6265
|
+
}), /* @__PURE__ */ React60.createElement("span", {
|
6251
6266
|
className: tw("grow")
|
6252
|
-
}, children), selected && /* @__PURE__ */
|
6267
|
+
}, children), selected && /* @__PURE__ */ React60.createElement(InlineIcon, {
|
6253
6268
|
icon: import_tick4.default
|
6254
6269
|
}));
|
6255
6270
|
}
|
6256
6271
|
);
|
6257
6272
|
DropdownMenu2.Item = Item3;
|
6258
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
6273
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React60.createElement(Typography2.Caption, {
|
6259
6274
|
color: disabled ? "grey-20" : "grey-40"
|
6260
6275
|
}, children);
|
6261
6276
|
DropdownMenu2.Description = Description;
|
6262
6277
|
var Separator = (_a) => {
|
6263
6278
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
6264
|
-
return /* @__PURE__ */
|
6279
|
+
return /* @__PURE__ */ React60.createElement("li", __spreadProps(__spreadValues({}, props), {
|
6265
6280
|
className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
|
6266
6281
|
}));
|
6267
6282
|
};
|
6268
6283
|
DropdownMenu2.Separator = Separator;
|
6269
6284
|
var EmptyStateContainer2 = (_a) => {
|
6270
6285
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
6271
|
-
return /* @__PURE__ */
|
6286
|
+
return /* @__PURE__ */ React60.createElement("div", __spreadValues({
|
6272
6287
|
className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
|
6273
6288
|
}, props), children);
|
6274
6289
|
};
|
@@ -6323,29 +6338,18 @@ var DropdownMenu3 = (_a) => {
|
|
6323
6338
|
"footer",
|
6324
6339
|
"children"
|
6325
6340
|
]);
|
6326
|
-
const triggerRef =
|
6327
|
-
const overlayRef = React60.useRef(null);
|
6341
|
+
const triggerRef = React61.useRef(null);
|
6328
6342
|
const [trigger, items] = extractTriggerAndItems(children);
|
6329
6343
|
const state = useMenuTriggerState(props);
|
6330
6344
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
6331
|
-
|
6332
|
-
targetRef: triggerRef,
|
6333
|
-
overlayRef,
|
6334
|
-
placement: placement.replace("-", " "),
|
6335
|
-
shouldFlip: true,
|
6336
|
-
isOpen: state.isOpen
|
6337
|
-
});
|
6338
|
-
return /* @__PURE__ */ React60.createElement("div", null, /* @__PURE__ */ React60.createElement(PressResponder2, __spreadValues({
|
6345
|
+
return /* @__PURE__ */ React61.createElement("div", null, /* @__PURE__ */ React61.createElement(PressResponder2, __spreadValues({
|
6339
6346
|
ref: triggerRef,
|
6340
6347
|
onPress: () => state.toggle()
|
6341
|
-
}, menuTriggerProps), /* @__PURE__ */
|
6342
|
-
|
6343
|
-
|
6344
|
-
|
6345
|
-
|
6346
|
-
isOpen: state.isOpen,
|
6347
|
-
onClose: state.close
|
6348
|
-
}, overlayProps), /* @__PURE__ */ React60.createElement(MenuWrapper, __spreadValues({
|
6348
|
+
}, menuTriggerProps), /* @__PURE__ */ React61.createElement(TriggerWrapper, null, trigger.props.children)), state.isOpen && /* @__PURE__ */ React61.createElement(PopoverOverlay, {
|
6349
|
+
triggerRef,
|
6350
|
+
state,
|
6351
|
+
placement
|
6352
|
+
}, /* @__PURE__ */ React61.createElement(MenuWrapper, __spreadValues({
|
6349
6353
|
onAction,
|
6350
6354
|
selectionMode,
|
6351
6355
|
selection,
|
@@ -6370,13 +6374,13 @@ DropdownMenu3.Section = Section;
|
|
6370
6374
|
DropdownMenu3.Section.displayName = "DropdownMenu.Section";
|
6371
6375
|
var TriggerWrapper = (_a) => {
|
6372
6376
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6373
|
-
const ref =
|
6377
|
+
const ref = React61.useRef(null);
|
6374
6378
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
|
6375
|
-
const trigger =
|
6376
|
-
if (!trigger || !
|
6379
|
+
const trigger = React61.Children.only(children);
|
6380
|
+
if (!trigger || !React61.isValidElement(trigger)) {
|
6377
6381
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
6378
6382
|
}
|
6379
|
-
return
|
6383
|
+
return React61.cloneElement(trigger, __spreadValues({ ref }, mergeProps3(pressProps, props)));
|
6380
6384
|
};
|
6381
6385
|
var isSectionNode = (item) => item.type === "section";
|
6382
6386
|
var isItemNode = (item) => item.type === "item";
|
@@ -6398,7 +6402,7 @@ var MenuWrapper = (_a) => {
|
|
6398
6402
|
"header",
|
6399
6403
|
"footer"
|
6400
6404
|
]);
|
6401
|
-
const ref =
|
6405
|
+
const ref = React61.useRef(null);
|
6402
6406
|
const disabledKeys = getDisabledItemKeys(props.children);
|
6403
6407
|
const state = useTreeState(__spreadValues({
|
6404
6408
|
disabledKeys,
|
@@ -6406,30 +6410,30 @@ var MenuWrapper = (_a) => {
|
|
6406
6410
|
}, props));
|
6407
6411
|
const { menuProps } = useMenu(props, state, ref);
|
6408
6412
|
const { contains } = useFilter({ sensitivity: "base" });
|
6409
|
-
const [search, setSearch] =
|
6410
|
-
const filteredCollection =
|
6413
|
+
const [search, setSearch] = React61.useState("");
|
6414
|
+
const filteredCollection = React61.useMemo(
|
6411
6415
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
6412
6416
|
[state.collection, search, contains]
|
6413
6417
|
);
|
6414
|
-
return /* @__PURE__ */
|
6418
|
+
return /* @__PURE__ */ React61.createElement(DropdownMenu2, {
|
6415
6419
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
6416
6420
|
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
|
6417
|
-
}, header, /* @__PURE__ */
|
6421
|
+
}, header, /* @__PURE__ */ React61.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React61.createElement(SearchInput, {
|
6418
6422
|
"aria-label": "search",
|
6419
6423
|
value: search,
|
6420
6424
|
onChange: (e) => setSearch(e.target.value),
|
6421
6425
|
className: tw("mb-5")
|
6422
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
6426
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React61.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React61.createElement(DropdownMenu2.List, __spreadValues({
|
6423
6427
|
ref
|
6424
6428
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
6425
6429
|
if (isSectionNode(item)) {
|
6426
|
-
return /* @__PURE__ */
|
6430
|
+
return /* @__PURE__ */ React61.createElement(SectionWrapper, {
|
6427
6431
|
key: item.key,
|
6428
6432
|
section: item,
|
6429
6433
|
state
|
6430
6434
|
});
|
6431
6435
|
} else if (isItemNode(item)) {
|
6432
|
-
return /* @__PURE__ */
|
6436
|
+
return /* @__PURE__ */ React61.createElement(ItemWrapper, {
|
6433
6437
|
key: item.key,
|
6434
6438
|
item,
|
6435
6439
|
state
|
@@ -6438,14 +6442,14 @@ var MenuWrapper = (_a) => {
|
|
6438
6442
|
}))), footer);
|
6439
6443
|
};
|
6440
6444
|
var ItemWrapper = ({ item, state }) => {
|
6441
|
-
const ref =
|
6445
|
+
const ref = React61.useRef(null);
|
6442
6446
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
6443
6447
|
{ key: item.key, closeOnSelect: item.props.closeOnSelect },
|
6444
6448
|
state,
|
6445
6449
|
ref
|
6446
6450
|
);
|
6447
6451
|
const { icon, description, kind = "default" } = item.props;
|
6448
|
-
return /* @__PURE__ */
|
6452
|
+
return /* @__PURE__ */ React61.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
|
6449
6453
|
ref
|
6450
6454
|
}, menuItemProps), {
|
6451
6455
|
kind,
|
@@ -6453,7 +6457,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
6453
6457
|
highlighted: isFocused,
|
6454
6458
|
disabled: isDisabled,
|
6455
6459
|
icon
|
6456
|
-
}), item.rendered, description && /* @__PURE__ */
|
6460
|
+
}), item.rendered, description && /* @__PURE__ */ React61.createElement(DropdownMenu2.Description, __spreadValues({
|
6457
6461
|
disabled: isDisabled
|
6458
6462
|
}, descriptionProps), description));
|
6459
6463
|
};
|
@@ -6465,24 +6469,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
6465
6469
|
const { separatorProps } = useSeparator({
|
6466
6470
|
elementType: "li"
|
6467
6471
|
});
|
6468
|
-
return /* @__PURE__ */
|
6472
|
+
return /* @__PURE__ */ React61.createElement(React61.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React61.createElement(DropdownMenu2.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React61.createElement(DropdownMenu2.Group, __spreadValues({
|
6469
6473
|
title: section.rendered,
|
6470
6474
|
titleProps: headingProps
|
6471
|
-
}, itemProps), /* @__PURE__ */
|
6475
|
+
}, itemProps), /* @__PURE__ */ React61.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React61.createElement(ItemWrapper, {
|
6472
6476
|
key: node.key,
|
6473
6477
|
item: node,
|
6474
6478
|
state
|
6475
6479
|
})))));
|
6476
6480
|
};
|
6477
6481
|
var extractTriggerAndItems = (children) => {
|
6478
|
-
const [trigger, items] =
|
6482
|
+
const [trigger, items] = React61.Children.toArray(children);
|
6479
6483
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
6480
6484
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
6481
6485
|
}
|
6482
6486
|
return [trigger, items];
|
6483
6487
|
};
|
6484
6488
|
var getDisabledItemKeys = (children) => {
|
6485
|
-
const keys =
|
6489
|
+
const keys = React61.Children.map(children, (child) => {
|
6486
6490
|
var _a, _b;
|
6487
6491
|
if (!child || typeof child === "function") {
|
6488
6492
|
return null;
|
@@ -6499,11 +6503,11 @@ var getDisabledItemKeys = (children) => {
|
|
6499
6503
|
};
|
6500
6504
|
|
6501
6505
|
// src/molecules/EmptyState/EmptyState.tsx
|
6502
|
-
import
|
6506
|
+
import React63 from "react";
|
6503
6507
|
import omit9 from "lodash/omit";
|
6504
6508
|
|
6505
6509
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
6506
|
-
import
|
6510
|
+
import React62 from "react";
|
6507
6511
|
var FlexboxItem = Tailwindify(
|
6508
6512
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6509
6513
|
const hookStyle = useStyle({
|
@@ -6515,7 +6519,7 @@ var FlexboxItem = Tailwindify(
|
|
6515
6519
|
alignSelf
|
6516
6520
|
});
|
6517
6521
|
const HtmlElement = htmlTag;
|
6518
|
-
return /* @__PURE__ */
|
6522
|
+
return /* @__PURE__ */ React62.createElement(HtmlElement, {
|
6519
6523
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6520
6524
|
className
|
6521
6525
|
}, children);
|
@@ -6573,7 +6577,7 @@ var EmptyState = ({
|
|
6573
6577
|
borderStyle = "dashed"
|
6574
6578
|
}) => {
|
6575
6579
|
const template = layoutStyle(layout);
|
6576
|
-
return /* @__PURE__ */
|
6580
|
+
return /* @__PURE__ */ React63.createElement(Box, {
|
6577
6581
|
className: classNames(
|
6578
6582
|
tw("rounded", {
|
6579
6583
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6585,38 +6589,38 @@ var EmptyState = ({
|
|
6585
6589
|
backgroundColor: "transparent",
|
6586
6590
|
borderColor: "grey-10",
|
6587
6591
|
padding: "9"
|
6588
|
-
}, /* @__PURE__ */
|
6592
|
+
}, /* @__PURE__ */ React63.createElement(Flexbox, {
|
6589
6593
|
direction: template.layout,
|
6590
6594
|
justifyContent: template.justifyContent,
|
6591
6595
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6592
6596
|
colGap: "l5",
|
6593
6597
|
rowGap: "8"
|
6594
|
-
}, image && /* @__PURE__ */
|
6598
|
+
}, image && /* @__PURE__ */ React63.createElement(FlexboxItem, null, /* @__PURE__ */ React63.createElement("img", {
|
6595
6599
|
src: image,
|
6596
6600
|
alt: imageAlt,
|
6597
6601
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6598
|
-
})), /* @__PURE__ */
|
6602
|
+
})), /* @__PURE__ */ React63.createElement(Flexbox, {
|
6599
6603
|
style: { maxWidth: "610px" },
|
6600
6604
|
direction: "column",
|
6601
6605
|
justifyContent: template.justifyContent,
|
6602
6606
|
alignItems: template.alignItems
|
6603
|
-
}, /* @__PURE__ */
|
6607
|
+
}, /* @__PURE__ */ React63.createElement(Typography2, {
|
6604
6608
|
variant: "heading",
|
6605
6609
|
htmlTag: "h2"
|
6606
|
-
}, title), (description || children) && /* @__PURE__ */
|
6610
|
+
}, title), (description || children) && /* @__PURE__ */ React63.createElement(Box, {
|
6607
6611
|
marginTop: "5"
|
6608
|
-
}, /* @__PURE__ */
|
6612
|
+
}, /* @__PURE__ */ React63.createElement(Typography2, {
|
6609
6613
|
variant: "default",
|
6610
6614
|
color: "grey-60"
|
6611
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6615
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React63.createElement(Flexbox, {
|
6612
6616
|
marginTop: "7",
|
6613
6617
|
gap: "4",
|
6614
6618
|
justifyContent: "center",
|
6615
6619
|
alignItems: "center",
|
6616
6620
|
wrap: "wrap"
|
6617
|
-
}, primaryAction && /* @__PURE__ */
|
6621
|
+
}, primaryAction && /* @__PURE__ */ React63.createElement(PrimaryButton, __spreadValues({}, omit9(primaryAction, "text")), primaryAction.text), secondaryAction && /* @__PURE__ */ React63.createElement(SecondaryButton, __spreadValues({}, omit9(secondaryAction, "text")), secondaryAction.text)), footer && /* @__PURE__ */ React63.createElement(Box, {
|
6618
6622
|
marginTop: "7"
|
6619
|
-
}, /* @__PURE__ */
|
6623
|
+
}, /* @__PURE__ */ React63.createElement(Typography2, {
|
6620
6624
|
htmlTag: "div",
|
6621
6625
|
variant: "small",
|
6622
6626
|
color: "grey-60"
|
@@ -6624,7 +6628,7 @@ var EmptyState = ({
|
|
6624
6628
|
};
|
6625
6629
|
|
6626
6630
|
// src/molecules/Grid/GridItem.tsx
|
6627
|
-
import
|
6631
|
+
import React64 from "react";
|
6628
6632
|
var GridItem = Tailwindify(
|
6629
6633
|
({
|
6630
6634
|
htmlTag = "div",
|
@@ -6655,7 +6659,7 @@ var GridItem = Tailwindify(
|
|
6655
6659
|
gridRowEnd: rowEnd
|
6656
6660
|
});
|
6657
6661
|
const HtmlElement = htmlTag;
|
6658
|
-
return /* @__PURE__ */
|
6662
|
+
return /* @__PURE__ */ React64.createElement(HtmlElement, {
|
6659
6663
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6660
6664
|
className
|
6661
6665
|
}, children);
|
@@ -6663,7 +6667,7 @@ var GridItem = Tailwindify(
|
|
6663
6667
|
);
|
6664
6668
|
|
6665
6669
|
// src/molecules/LineClamp/LineClamp.tsx
|
6666
|
-
import
|
6670
|
+
import React65 from "react";
|
6667
6671
|
var LineClamp2 = ({
|
6668
6672
|
lines,
|
6669
6673
|
children,
|
@@ -6672,10 +6676,10 @@ var LineClamp2 = ({
|
|
6672
6676
|
collapseLabel,
|
6673
6677
|
onClampedChange
|
6674
6678
|
}) => {
|
6675
|
-
const ref =
|
6676
|
-
const [clamped, setClamped] =
|
6677
|
-
const [isClampingEnabled, setClampingEnabled] =
|
6678
|
-
|
6679
|
+
const ref = React65.useRef(null);
|
6680
|
+
const [clamped, setClamped] = React65.useState(true);
|
6681
|
+
const [isClampingEnabled, setClampingEnabled] = React65.useState(false);
|
6682
|
+
React65.useEffect(() => {
|
6679
6683
|
var _a, _b;
|
6680
6684
|
const el = ref.current;
|
6681
6685
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -6684,50 +6688,50 @@ var LineClamp2 = ({
|
|
6684
6688
|
setClamped(!clamped);
|
6685
6689
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
6686
6690
|
};
|
6687
|
-
return /* @__PURE__ */
|
6691
|
+
return /* @__PURE__ */ React65.createElement("div", null, /* @__PURE__ */ React65.createElement(LineClamp, {
|
6688
6692
|
ref,
|
6689
6693
|
lines,
|
6690
6694
|
clamped,
|
6691
6695
|
wordBreak
|
6692
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
6696
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React65.createElement(GhostButton, {
|
6693
6697
|
dense: true,
|
6694
6698
|
onClick: handleClampedChange
|
6695
6699
|
}, clamped ? expandLabel : collapseLabel));
|
6696
6700
|
};
|
6697
6701
|
|
6698
6702
|
// src/molecules/Link/Link.tsx
|
6699
|
-
import
|
6703
|
+
import React67 from "react";
|
6700
6704
|
|
6701
6705
|
// src/atoms/Link/Link.tsx
|
6702
|
-
import
|
6706
|
+
import React66 from "react";
|
6703
6707
|
var Link = (_a) => {
|
6704
6708
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
6705
|
-
return /* @__PURE__ */
|
6709
|
+
return /* @__PURE__ */ React66.createElement("a", __spreadValues({
|
6706
6710
|
className: classNames(className, linkStyle)
|
6707
6711
|
}, props), children);
|
6708
6712
|
};
|
6709
6713
|
|
6710
6714
|
// src/molecules/Link/Link.tsx
|
6711
|
-
var Link2 = (props) => /* @__PURE__ */
|
6715
|
+
var Link2 = (props) => /* @__PURE__ */ React67.createElement(Link, __spreadValues({}, props));
|
6712
6716
|
|
6713
6717
|
// src/molecules/List/List.tsx
|
6714
|
-
import
|
6715
|
-
var List = ({ items, renderItem, container =
|
6718
|
+
import React68 from "react";
|
6719
|
+
var List = ({ items, renderItem, container = React68.Fragment }) => {
|
6716
6720
|
const Component = container;
|
6717
|
-
return /* @__PURE__ */
|
6721
|
+
return /* @__PURE__ */ React68.createElement(Component, null, items.map(renderItem));
|
6718
6722
|
};
|
6719
6723
|
|
6720
6724
|
// src/molecules/ListItem/ListItem.tsx
|
6721
|
-
import
|
6725
|
+
import React69 from "react";
|
6722
6726
|
var ListItem = ({ name, icon, active = false }) => {
|
6723
|
-
return /* @__PURE__ */
|
6727
|
+
return /* @__PURE__ */ React69.createElement(Flexbox, {
|
6724
6728
|
alignItems: "center"
|
6725
|
-
}, /* @__PURE__ */
|
6729
|
+
}, /* @__PURE__ */ React69.createElement(Typography2, {
|
6726
6730
|
variant: active ? "small-strong" : "small",
|
6727
6731
|
color: "grey-70",
|
6728
6732
|
htmlTag: "span",
|
6729
6733
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6730
|
-
}, /* @__PURE__ */
|
6734
|
+
}, /* @__PURE__ */ React69.createElement("img", {
|
6731
6735
|
src: icon,
|
6732
6736
|
alt: name,
|
6733
6737
|
className: "inline mr-4",
|
@@ -6737,28 +6741,27 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6737
6741
|
};
|
6738
6742
|
|
6739
6743
|
// src/molecules/Modal/Modal.tsx
|
6740
|
-
import
|
6741
|
-
import { useDialog as
|
6742
|
-
import {
|
6743
|
-
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
6744
|
+
import React71 from "react";
|
6745
|
+
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
6746
|
+
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
6744
6747
|
import { useId as useId2 } from "@react-aria/utils";
|
6745
6748
|
import { useOverlayTriggerState as useOverlayTriggerState4 } from "@react-stately/overlays";
|
6746
6749
|
import castArray from "lodash/castArray";
|
6747
6750
|
import omit10 from "lodash/omit";
|
6748
6751
|
|
6749
6752
|
// src/molecules/Tabs/Tabs.tsx
|
6750
|
-
import
|
6753
|
+
import React70, { useEffect as useEffect6, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState7 } from "react";
|
6751
6754
|
import isNumber5 from "lodash/isNumber";
|
6752
6755
|
import kebabCase from "lodash/kebabCase";
|
6753
6756
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6754
6757
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6755
6758
|
var import_warningSign3 = __toESM(require_warningSign());
|
6756
6759
|
var isTabComponent = (c) => {
|
6757
|
-
return
|
6760
|
+
return React70.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6758
6761
|
};
|
6759
|
-
var Tab =
|
6762
|
+
var Tab = React70.forwardRef(
|
6760
6763
|
({ className, id, title, children }, ref) => {
|
6761
|
-
return /* @__PURE__ */
|
6764
|
+
return /* @__PURE__ */ React70.createElement("div", {
|
6762
6765
|
ref,
|
6763
6766
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6764
6767
|
className,
|
@@ -6770,14 +6773,14 @@ var Tab = React69.forwardRef(
|
|
6770
6773
|
);
|
6771
6774
|
var TabContainer = (_a) => {
|
6772
6775
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6773
|
-
return /* @__PURE__ */
|
6776
|
+
return /* @__PURE__ */ React70.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6774
6777
|
className: classNames("py-6 z-0", className)
|
6775
6778
|
}), children);
|
6776
6779
|
};
|
6777
6780
|
var ModalTab = Tab;
|
6778
6781
|
var ModalTabContainer = TabContainer;
|
6779
6782
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6780
|
-
const Tab2 =
|
6783
|
+
const Tab2 = React70.forwardRef(
|
6781
6784
|
(_a, ref) => {
|
6782
6785
|
var _b = _a, {
|
6783
6786
|
id,
|
@@ -6807,17 +6810,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6807
6810
|
const _id = id != null ? id : kebabCase(title);
|
6808
6811
|
let statusIcon = void 0;
|
6809
6812
|
if (status === "warning") {
|
6810
|
-
statusIcon = /* @__PURE__ */
|
6813
|
+
statusIcon = /* @__PURE__ */ React70.createElement(InlineIcon, {
|
6811
6814
|
icon: import_warningSign3.default,
|
6812
6815
|
color: "warning-80"
|
6813
6816
|
});
|
6814
6817
|
} else if (status === "error") {
|
6815
|
-
statusIcon = /* @__PURE__ */
|
6818
|
+
statusIcon = /* @__PURE__ */ React70.createElement(InlineIcon, {
|
6816
6819
|
icon: import_warningSign3.default,
|
6817
6820
|
color: "error-50"
|
6818
6821
|
});
|
6819
6822
|
}
|
6820
|
-
const tab = /* @__PURE__ */
|
6823
|
+
const tab = /* @__PURE__ */ React70.createElement(Component, __spreadValues({
|
6821
6824
|
ref,
|
6822
6825
|
id: `${_id}-tab`,
|
6823
6826
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6834,24 +6837,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6834
6837
|
"aria-selected": selected,
|
6835
6838
|
"aria-controls": `${_id}-panel`,
|
6836
6839
|
tabIndex: disabled ? void 0 : 0
|
6837
|
-
}, rest), /* @__PURE__ */
|
6840
|
+
}, rest), /* @__PURE__ */ React70.createElement(Typography2, {
|
6838
6841
|
htmlTag: "div",
|
6839
6842
|
variant: "small",
|
6840
6843
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6841
6844
|
className: tw("inline-flex items-center gap-3")
|
6842
|
-
}, /* @__PURE__ */
|
6845
|
+
}, /* @__PURE__ */ React70.createElement("span", {
|
6843
6846
|
className: tw("whitespace-nowrap")
|
6844
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
6847
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React70.createElement(Typography2, {
|
6845
6848
|
htmlTag: "span",
|
6846
6849
|
variant: "small",
|
6847
6850
|
color: selected ? "primary-80" : "grey-5",
|
6848
6851
|
className: "leading-none"
|
6849
|
-
}, /* @__PURE__ */
|
6852
|
+
}, /* @__PURE__ */ React70.createElement(TabBadge, {
|
6850
6853
|
kind: "filled",
|
6851
6854
|
value: badge,
|
6852
6855
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6853
6856
|
})), statusIcon));
|
6854
|
-
return tooltip ? /* @__PURE__ */
|
6857
|
+
return tooltip ? /* @__PURE__ */ React70.createElement(Tooltip, {
|
6855
6858
|
content: tooltip
|
6856
6859
|
}, tab) : tab;
|
6857
6860
|
}
|
@@ -6865,7 +6868,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6865
6868
|
const Tabs2 = (props) => {
|
6866
6869
|
var _a, _b;
|
6867
6870
|
const { className, value, defaultValue, onChange, children } = props;
|
6868
|
-
const childArr =
|
6871
|
+
const childArr = React70.Children.toArray(children);
|
6869
6872
|
const firstTab = childArr[0];
|
6870
6873
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6871
6874
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -6878,7 +6881,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6878
6881
|
var _a2, _b2;
|
6879
6882
|
const container = containerRef.current;
|
6880
6883
|
const tabs = tabsRef.current;
|
6881
|
-
const values =
|
6884
|
+
const values = React70.Children.map(
|
6882
6885
|
children,
|
6883
6886
|
(tab, i) => {
|
6884
6887
|
var _a3;
|
@@ -6912,14 +6915,14 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6912
6915
|
showLeftCaret(hasLeftCaret);
|
6913
6916
|
showRightCaret(hasRightCaret);
|
6914
6917
|
};
|
6915
|
-
|
6918
|
+
useEffect6(() => {
|
6916
6919
|
if (value === void 0) {
|
6917
6920
|
return;
|
6918
6921
|
}
|
6919
6922
|
updateCarets();
|
6920
6923
|
setSelected(value);
|
6921
6924
|
revealSelectedTab({ smooth: value !== selected });
|
6922
|
-
}, [value,
|
6925
|
+
}, [value, React70.Children.count(children)]);
|
6923
6926
|
useLayoutEffect2(() => {
|
6924
6927
|
var _a2;
|
6925
6928
|
updateCarets();
|
@@ -6983,27 +6986,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6983
6986
|
const handleSelected = (key) => {
|
6984
6987
|
(onChange != null ? onChange : setSelected)(key);
|
6985
6988
|
};
|
6986
|
-
|
6989
|
+
React70.Children.forEach(children, (c) => {
|
6987
6990
|
if (c && !isTabComponent(c)) {
|
6988
6991
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6989
6992
|
}
|
6990
6993
|
});
|
6991
|
-
return /* @__PURE__ */
|
6994
|
+
return /* @__PURE__ */ React70.createElement("div", {
|
6992
6995
|
ref: parentRef,
|
6993
6996
|
className: classNames(tw("h-full"), className)
|
6994
|
-
}, /* @__PURE__ */
|
6997
|
+
}, /* @__PURE__ */ React70.createElement("div", {
|
6995
6998
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6996
|
-
}, /* @__PURE__ */
|
6999
|
+
}, /* @__PURE__ */ React70.createElement("div", {
|
6997
7000
|
ref: containerRef,
|
6998
7001
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6999
|
-
}, /* @__PURE__ */
|
7002
|
+
}, /* @__PURE__ */ React70.createElement("div", {
|
7000
7003
|
ref: tabsRef,
|
7001
7004
|
role: "tablist",
|
7002
7005
|
"aria-label": "tabs",
|
7003
7006
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
7004
|
-
},
|
7007
|
+
}, React70.Children.map(
|
7005
7008
|
children,
|
7006
|
-
(tab, index) => tab ? /* @__PURE__ */
|
7009
|
+
(tab, index) => tab ? /* @__PURE__ */ React70.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
7007
7010
|
key: tab.props.value
|
7008
7011
|
}, tab.props), {
|
7009
7012
|
index,
|
@@ -7011,20 +7014,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
7011
7014
|
onKeyDown: handleKeyDown,
|
7012
7015
|
onSelected: handleSelected
|
7013
7016
|
})) : void 0
|
7014
|
-
))), leftCaret && /* @__PURE__ */
|
7017
|
+
))), leftCaret && /* @__PURE__ */ React70.createElement("div", {
|
7015
7018
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
7016
|
-
}, /* @__PURE__ */
|
7019
|
+
}, /* @__PURE__ */ React70.createElement("div", {
|
7017
7020
|
onClick: () => handleScrollToNext("left"),
|
7018
7021
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
7019
|
-
}, /* @__PURE__ */
|
7022
|
+
}, /* @__PURE__ */ React70.createElement(InlineIcon, {
|
7020
7023
|
icon: import_chevronLeft2.default
|
7021
|
-
}))), rightCaret && /* @__PURE__ */
|
7024
|
+
}))), rightCaret && /* @__PURE__ */ React70.createElement("div", {
|
7022
7025
|
onClick: () => handleScrollToNext("right"),
|
7023
7026
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
7024
|
-
}, /* @__PURE__ */
|
7027
|
+
}, /* @__PURE__ */ React70.createElement("div", {
|
7025
7028
|
onClick: () => handleScrollToNext("right"),
|
7026
7029
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
7027
|
-
}, /* @__PURE__ */
|
7030
|
+
}, /* @__PURE__ */ React70.createElement(InlineIcon, {
|
7028
7031
|
icon: import_chevronRight2.default
|
7029
7032
|
})))), renderChildren(children, selected, props));
|
7030
7033
|
};
|
@@ -7032,89 +7035,92 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
7032
7035
|
Tabs2.Tab = TabComponent;
|
7033
7036
|
return Tabs2;
|
7034
7037
|
};
|
7035
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
7038
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React70.createElement(TabContainer, null, children.find(
|
7036
7039
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
7037
7040
|
)));
|
7038
7041
|
|
7039
7042
|
// src/molecules/Modal/Modal.tsx
|
7040
7043
|
var import_cross5 = __toESM(require_cross());
|
7041
|
-
var Modal2 = ({
|
7042
|
-
|
7043
|
-
|
7044
|
-
|
7045
|
-
|
7046
|
-
|
7047
|
-
|
7048
|
-
primaryAction,
|
7049
|
-
secondaryActions,
|
7050
|
-
size
|
7051
|
-
}) => {
|
7052
|
-
const ref = React70.useRef(null);
|
7053
|
-
const state = useOverlayTriggerState4({ isOpen: open });
|
7054
|
-
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
7055
|
-
const labelledBy = useId2();
|
7056
|
-
const describedBy = useId2();
|
7057
|
-
const { dialogProps } = useDialog2(
|
7058
|
-
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
7044
|
+
var Modal2 = (props) => {
|
7045
|
+
const { open, onClose, size, portalContainer } = props;
|
7046
|
+
const ref = React71.useRef(null);
|
7047
|
+
const state = useOverlayTriggerState4({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
7048
|
+
const { modalProps, underlayProps } = useModalOverlay2(
|
7049
|
+
{ isDismissable: true, isKeyboardDismissDisabled: false },
|
7050
|
+
state,
|
7059
7051
|
ref
|
7060
7052
|
);
|
7061
|
-
if (!
|
7053
|
+
if (!state.isOpen) {
|
7062
7054
|
return null;
|
7063
7055
|
}
|
7064
|
-
return /* @__PURE__ */
|
7065
|
-
|
7066
|
-
}, /* @__PURE__ */
|
7067
|
-
|
7068
|
-
|
7069
|
-
autoFocus: true
|
7070
|
-
}, /* @__PURE__ */ React70.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
7056
|
+
return /* @__PURE__ */ React71.createElement(Overlay3, {
|
7057
|
+
portalContainer
|
7058
|
+
}, /* @__PURE__ */ React71.createElement(Modal, {
|
7059
|
+
open: true
|
7060
|
+
}, /* @__PURE__ */ React71.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React71.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
7071
7061
|
ref,
|
7072
7062
|
size
|
7073
|
-
},
|
7074
|
-
"aria-label": "Close",
|
7075
|
-
icon: import_cross5.default,
|
7076
|
-
onClick: onClose
|
7077
|
-
})), headerImage !== void 0 && /* @__PURE__ */ React70.createElement(Modal.HeaderImage, {
|
7078
|
-
backgroundImage: headerImage
|
7079
|
-
}), /* @__PURE__ */ React70.createElement(Modal.Header, {
|
7080
|
-
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
7081
|
-
}, /* @__PURE__ */ React70.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React70.createElement(Modal.Title, {
|
7082
|
-
id: labelledBy
|
7083
|
-
}, title), subtitle && /* @__PURE__ */ React70.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React70.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React70.createElement(Modal.Body, {
|
7084
|
-
id: describedBy,
|
7085
|
-
tabIndex: 0,
|
7086
|
-
noFooter: !(secondaryActions || primaryAction)
|
7087
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React70.createElement(Modal.Footer, null, /* @__PURE__ */ React70.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
7088
|
-
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7089
|
-
return /* @__PURE__ */ React70.createElement(SecondaryButton, __spreadValues({
|
7090
|
-
key: text
|
7091
|
-
}, action), text);
|
7092
|
-
}), primaryAction && /* @__PURE__ */ React70.createElement(PrimaryButton, __spreadValues({
|
7093
|
-
key: primaryAction.text
|
7094
|
-
}, omit10(primaryAction, "text")), primaryAction.text)))))));
|
7063
|
+
}, props), modalProps))));
|
7095
7064
|
};
|
7065
|
+
var ModalWrapper = React71.forwardRef(
|
7066
|
+
(_a, ref) => {
|
7067
|
+
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
7068
|
+
const labelledBy = useId2();
|
7069
|
+
const describedBy = useId2();
|
7070
|
+
const { dialogProps } = useDialog3(
|
7071
|
+
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
7072
|
+
ref
|
7073
|
+
);
|
7074
|
+
return /* @__PURE__ */ React71.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
7075
|
+
ref
|
7076
|
+
}, props), dialogProps), {
|
7077
|
+
tabIndex: -1
|
7078
|
+
}), /* @__PURE__ */ React71.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React71.createElement(IconButton, {
|
7079
|
+
"aria-label": "Close",
|
7080
|
+
icon: import_cross5.default,
|
7081
|
+
onClick: onClose
|
7082
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React71.createElement(Modal.HeaderImage, {
|
7083
|
+
backgroundImage: headerImage
|
7084
|
+
}), /* @__PURE__ */ React71.createElement(Modal.Header, {
|
7085
|
+
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
7086
|
+
}, /* @__PURE__ */ React71.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React71.createElement(Modal.Title, {
|
7087
|
+
id: labelledBy
|
7088
|
+
}, title), subtitle && /* @__PURE__ */ React71.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React71.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React71.createElement(Modal.Body, {
|
7089
|
+
id: describedBy,
|
7090
|
+
tabIndex: 0,
|
7091
|
+
noFooter: !(secondaryActions || primaryAction)
|
7092
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React71.createElement(Modal.Footer, null, /* @__PURE__ */ React71.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a2) => {
|
7093
|
+
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
7094
|
+
return /* @__PURE__ */ React71.createElement(SecondaryButton, __spreadValues({
|
7095
|
+
key: text
|
7096
|
+
}, action), text);
|
7097
|
+
}), primaryAction && /* @__PURE__ */ React71.createElement(PrimaryButton, __spreadValues({
|
7098
|
+
key: primaryAction.text
|
7099
|
+
}, omit10(primaryAction, "text")), primaryAction.text))));
|
7100
|
+
}
|
7101
|
+
);
|
7096
7102
|
var ModalTabs = createTabsComponent(
|
7097
7103
|
ModalTab,
|
7098
7104
|
TabItem,
|
7099
7105
|
"ModalTabs",
|
7100
|
-
(children, selected, props) => /* @__PURE__ */
|
7106
|
+
(children, selected, props) => /* @__PURE__ */ React71.createElement(Modal.Body, {
|
7101
7107
|
maxHeight: props.maxHeight
|
7102
|
-
}, /* @__PURE__ */
|
7108
|
+
}, /* @__PURE__ */ React71.createElement(ModalTabContainer, null, children.find(
|
7103
7109
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
7104
7110
|
)))
|
7105
7111
|
);
|
7106
7112
|
|
7107
7113
|
// src/molecules/MultiInput/MultiInput.tsx
|
7108
|
-
import
|
7114
|
+
import React73, { useEffect as useEffect7, useRef as useRef9, useState as useState8 } from "react";
|
7109
7115
|
import castArray2 from "lodash/castArray";
|
7110
7116
|
import identity from "lodash/identity";
|
7111
7117
|
import omit11 from "lodash/omit";
|
7112
7118
|
import uniqueId4 from "lodash/uniqueId";
|
7113
7119
|
|
7114
7120
|
// src/molecules/MultiInput/InputChip.tsx
|
7115
|
-
import
|
7121
|
+
import React72 from "react";
|
7116
7122
|
var import_smallCross = __toESM(require_smallCross());
|
7117
|
-
var InputChip =
|
7123
|
+
var InputChip = React72.forwardRef(
|
7118
7124
|
(_a, ref) => {
|
7119
7125
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
7120
7126
|
const onClick = (e) => {
|
@@ -7122,7 +7128,7 @@ var InputChip = React71.forwardRef(
|
|
7122
7128
|
_onClick == null ? void 0 : _onClick(e);
|
7123
7129
|
}
|
7124
7130
|
};
|
7125
|
-
return /* @__PURE__ */
|
7131
|
+
return /* @__PURE__ */ React72.createElement("div", __spreadValues({
|
7126
7132
|
ref,
|
7127
7133
|
role: "button",
|
7128
7134
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -7132,10 +7138,10 @@ var InputChip = React71.forwardRef(
|
|
7132
7138
|
"bg-grey-5 pointer-events-none": disabled
|
7133
7139
|
}),
|
7134
7140
|
onClick
|
7135
|
-
}, props), /* @__PURE__ */
|
7141
|
+
}, props), /* @__PURE__ */ React72.createElement(Typography2, {
|
7136
7142
|
variant: "small",
|
7137
7143
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
7138
|
-
}, children), !readOnly && /* @__PURE__ */
|
7144
|
+
}, children), !readOnly && /* @__PURE__ */ React72.createElement("div", null, /* @__PURE__ */ React72.createElement(Icon, {
|
7139
7145
|
icon: import_smallCross.default,
|
7140
7146
|
className: tw("ml-2", {
|
7141
7147
|
"text-error-70": invalid,
|
@@ -7197,7 +7203,7 @@ var MultiInputBase = (_a) => {
|
|
7197
7203
|
const [items, setItems] = useState8((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
7198
7204
|
const [hasFocus, setFocus] = useState8(false);
|
7199
7205
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
7200
|
-
|
7206
|
+
useEffect7(() => {
|
7201
7207
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
7202
7208
|
if (requiresUpdate && JSON.stringify(value) !== JSON.stringify(items)) {
|
7203
7209
|
setItems(value != null ? value : []);
|
@@ -7276,7 +7282,7 @@ var MultiInputBase = (_a) => {
|
|
7276
7282
|
};
|
7277
7283
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
7278
7284
|
var _a3;
|
7279
|
-
return /* @__PURE__ */
|
7285
|
+
return /* @__PURE__ */ React73.createElement(InputChip, {
|
7280
7286
|
key: `${itemToString(item)}.${index}`,
|
7281
7287
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
7282
7288
|
readOnly,
|
@@ -7287,11 +7293,11 @@ var MultiInputBase = (_a) => {
|
|
7287
7293
|
}
|
7288
7294
|
}, itemToString(item));
|
7289
7295
|
});
|
7290
|
-
return /* @__PURE__ */
|
7296
|
+
return /* @__PURE__ */ React73.createElement("div", null, /* @__PURE__ */ React73.createElement(Select.InputContainer, {
|
7291
7297
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7292
|
-
}, /* @__PURE__ */
|
7298
|
+
}, /* @__PURE__ */ React73.createElement("div", {
|
7293
7299
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
7294
|
-
}, inline && renderChips(), /* @__PURE__ */
|
7300
|
+
}, inline && renderChips(), /* @__PURE__ */ React73.createElement(Select.Input, __spreadProps(__spreadValues({
|
7295
7301
|
ref: inputRef,
|
7296
7302
|
id: id != null ? id : name,
|
7297
7303
|
name,
|
@@ -7309,11 +7315,11 @@ var MultiInputBase = (_a) => {
|
|
7309
7315
|
onFocus: handleFocus,
|
7310
7316
|
onBlur: handleBlur,
|
7311
7317
|
autoComplete: "off"
|
7312
|
-
}))), endAdornment && /* @__PURE__ */
|
7318
|
+
}))), endAdornment && /* @__PURE__ */ React73.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React73.createElement("div", {
|
7313
7319
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
7314
7320
|
}, renderChips()));
|
7315
7321
|
};
|
7316
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7322
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React73.createElement(Skeleton, {
|
7317
7323
|
height: 38
|
7318
7324
|
});
|
7319
7325
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7321,7 +7327,7 @@ var MultiInput = (props) => {
|
|
7321
7327
|
var _a, _b, _c, _d, _e;
|
7322
7328
|
const maxLength = (_a = props.maxLength) != null ? _a : props.max;
|
7323
7329
|
const [value, setValue] = useState8((_c = (_b = props.value) != null ? _b : props.defaultValue) != null ? _c : []);
|
7324
|
-
|
7330
|
+
useEffect7(() => {
|
7325
7331
|
var _a2;
|
7326
7332
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
7327
7333
|
}, [JSON.stringify(props.value)]);
|
@@ -7330,14 +7336,14 @@ var MultiInput = (props) => {
|
|
7330
7336
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7331
7337
|
const labelControlProps = getLabelControlProps(props);
|
7332
7338
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7333
|
-
return /* @__PURE__ */
|
7339
|
+
return /* @__PURE__ */ React73.createElement(LabelControl, __spreadProps(__spreadValues({
|
7334
7340
|
id: `${id.current}-label`,
|
7335
7341
|
htmlFor: `${id.current}-input`,
|
7336
7342
|
messageId: errorMessageId
|
7337
7343
|
}, labelControlProps), {
|
7338
7344
|
length: value.length,
|
7339
7345
|
maxLength
|
7340
|
-
}), /* @__PURE__ */
|
7346
|
+
}), /* @__PURE__ */ React73.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7341
7347
|
id: `${id.current}-input`,
|
7342
7348
|
onChange: (value2) => {
|
7343
7349
|
var _a2;
|
@@ -7349,13 +7355,13 @@ var MultiInput = (props) => {
|
|
7349
7355
|
valid: props.valid
|
7350
7356
|
})));
|
7351
7357
|
};
|
7352
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7358
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React73.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React73.createElement(MultiInputBase.Skeleton, null));
|
7353
7359
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7354
7360
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7355
7361
|
|
7356
7362
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
7357
|
-
import
|
7358
|
-
import {
|
7363
|
+
import React74, { useEffect as useEffect8, useRef as useRef10, useState as useState9 } from "react";
|
7364
|
+
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
7359
7365
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7360
7366
|
import isEqual from "lodash/isEqual";
|
7361
7367
|
import isNil from "lodash/isNil";
|
@@ -7410,8 +7416,10 @@ var MultiSelectBase = (_a) => {
|
|
7410
7416
|
"children"
|
7411
7417
|
]);
|
7412
7418
|
var _a2;
|
7419
|
+
const popoverRef = useRef10(null);
|
7413
7420
|
const targetRef = useRef10(null);
|
7414
|
-
const
|
7421
|
+
const menuRef = useRef10(null);
|
7422
|
+
const inputRef = useRef10(null);
|
7415
7423
|
const [inputValue, setInputValue] = useState9("");
|
7416
7424
|
const [hasFocus, setFocus] = useState9(false);
|
7417
7425
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = useMultipleSelection(
|
@@ -7433,6 +7441,7 @@ var MultiSelectBase = (_a) => {
|
|
7433
7441
|
isOpen,
|
7434
7442
|
openMenu,
|
7435
7443
|
closeMenu,
|
7444
|
+
toggleMenu,
|
7436
7445
|
highlightedIndex,
|
7437
7446
|
getInputProps,
|
7438
7447
|
getMenuProps,
|
@@ -7483,16 +7492,20 @@ var MultiSelectBase = (_a) => {
|
|
7483
7492
|
}
|
7484
7493
|
}
|
7485
7494
|
});
|
7486
|
-
const
|
7487
|
-
|
7488
|
-
|
7489
|
-
|
7490
|
-
|
7491
|
-
|
7492
|
-
}
|
7493
|
-
|
7495
|
+
const state = {
|
7496
|
+
isOpen,
|
7497
|
+
close: closeMenu,
|
7498
|
+
open: openMenu,
|
7499
|
+
toggle: toggleMenu,
|
7500
|
+
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
7501
|
+
};
|
7502
|
+
useEffect8(() => {
|
7503
|
+
if (state.isOpen && inputRef.current && popoverRef.current) {
|
7504
|
+
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
7505
|
+
}
|
7506
|
+
}, [state.isOpen, inputRef, popoverRef]);
|
7494
7507
|
const renderChips = () => {
|
7495
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7508
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React74.createElement(InputChip, __spreadProps(__spreadValues({
|
7496
7509
|
key: `${itemToString(selectedItem)}.chip`,
|
7497
7510
|
className: tw("mx-0"),
|
7498
7511
|
disabled,
|
@@ -7506,17 +7519,18 @@ var MultiSelectBase = (_a) => {
|
|
7506
7519
|
}), itemToString(selectedItem)));
|
7507
7520
|
};
|
7508
7521
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7509
|
-
const
|
7510
|
-
const
|
7511
|
-
return /* @__PURE__ */
|
7522
|
+
const inputProps = getInputProps(getDropdownProps({ ref: inputRef, disabled: disabled || readOnly }));
|
7523
|
+
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
7524
|
+
return /* @__PURE__ */ React74.createElement("div", {
|
7512
7525
|
className: tw("relative")
|
7513
|
-
}, /* @__PURE__ */
|
7526
|
+
}, /* @__PURE__ */ React74.createElement(Select.InputContainer, {
|
7514
7527
|
ref: targetRef,
|
7515
7528
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7516
|
-
}, /* @__PURE__ */
|
7529
|
+
}, /* @__PURE__ */ React74.createElement("div", {
|
7517
7530
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7518
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7531
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React74.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7519
7532
|
id,
|
7533
|
+
ref: inputRef,
|
7520
7534
|
name,
|
7521
7535
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
7522
7536
|
value: inputValue != null ? inputValue : ""
|
@@ -7536,27 +7550,29 @@ var MultiSelectBase = (_a) => {
|
|
7536
7550
|
setFocus(false);
|
7537
7551
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
7538
7552
|
}
|
7539
|
-
}))), !readOnly && /* @__PURE__ */
|
7553
|
+
}))), !readOnly && /* @__PURE__ */ React74.createElement(Select.Toggle, __spreadValues({
|
7540
7554
|
hasFocus,
|
7541
7555
|
isOpen
|
7542
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7556
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React74.createElement("div", {
|
7543
7557
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7544
|
-
}, renderChips()), /* @__PURE__ */
|
7545
|
-
|
7546
|
-
|
7547
|
-
|
7548
|
-
|
7549
|
-
|
7550
|
-
|
7551
|
-
|
7558
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React74.createElement(PopoverOverlay, {
|
7559
|
+
ref: popoverRef,
|
7560
|
+
triggerRef: targetRef,
|
7561
|
+
state,
|
7562
|
+
placement: "bottom-left",
|
7563
|
+
shouldFlip: true,
|
7564
|
+
isNonModal: true,
|
7565
|
+
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
7566
|
+
}, /* @__PURE__ */ React74.createElement(Select.Menu, __spreadValues({
|
7567
|
+
ref: menuRef,
|
7552
7568
|
maxHeight
|
7553
|
-
},
|
7569
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React74.createElement(Select.NoResults, null, noResults), filteredOptions.map((item, index) => /* @__PURE__ */ React74.createElement(Select.Item, __spreadValues({
|
7554
7570
|
key: itemToString(item),
|
7555
7571
|
highlighted: index === highlightedIndex,
|
7556
7572
|
selected: selectedItems.includes(item)
|
7557
7573
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7558
7574
|
};
|
7559
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7575
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React74.createElement(Skeleton, {
|
7560
7576
|
height: 38
|
7561
7577
|
});
|
7562
7578
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7574,11 +7590,11 @@ var MultiSelect = (_a) => {
|
|
7574
7590
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7575
7591
|
const labelControlProps = getLabelControlProps(props);
|
7576
7592
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7577
|
-
return /* @__PURE__ */
|
7593
|
+
return /* @__PURE__ */ React74.createElement(LabelControl, __spreadValues({
|
7578
7594
|
id: `${id.current}-label`,
|
7579
7595
|
htmlFor: `${id.current}-input`,
|
7580
7596
|
messageId: errorMessageId
|
7581
|
-
}, labelControlProps), /* @__PURE__ */
|
7597
|
+
}, labelControlProps), /* @__PURE__ */ React74.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7582
7598
|
id: id.current,
|
7583
7599
|
options,
|
7584
7600
|
noResults,
|
@@ -7586,16 +7602,16 @@ var MultiSelect = (_a) => {
|
|
7586
7602
|
valid: props.valid
|
7587
7603
|
})));
|
7588
7604
|
};
|
7589
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7605
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React74.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React74.createElement(MultiSelectBase.Skeleton, null));
|
7590
7606
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7591
7607
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7592
7608
|
|
7593
7609
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
7594
|
-
import
|
7610
|
+
import React75, { useRef as useRef11 } from "react";
|
7595
7611
|
import omit13 from "lodash/omit";
|
7596
7612
|
import uniqueId6 from "lodash/uniqueId";
|
7597
7613
|
var import_caretDown = __toESM(require_caretDown());
|
7598
|
-
var NativeSelectBase =
|
7614
|
+
var NativeSelectBase = React75.forwardRef(
|
7599
7615
|
(_a, ref) => {
|
7600
7616
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7601
7617
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7612,16 +7628,16 @@ var NativeSelectBase = React74.forwardRef(
|
|
7612
7628
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7613
7629
|
}
|
7614
7630
|
};
|
7615
|
-
return /* @__PURE__ */
|
7631
|
+
return /* @__PURE__ */ React75.createElement("span", {
|
7616
7632
|
className: tw("relative block")
|
7617
|
-
}, !readOnly && /* @__PURE__ */
|
7633
|
+
}, !readOnly && /* @__PURE__ */ React75.createElement("span", {
|
7618
7634
|
className: tw(
|
7619
7635
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7620
7636
|
)
|
7621
|
-
}, /* @__PURE__ */
|
7637
|
+
}, /* @__PURE__ */ React75.createElement(Icon, {
|
7622
7638
|
icon: import_caretDown.default,
|
7623
7639
|
"data-testid": "icon-dropdown"
|
7624
|
-
})), /* @__PURE__ */
|
7640
|
+
})), /* @__PURE__ */ React75.createElement("select", __spreadProps(__spreadValues({
|
7625
7641
|
ref,
|
7626
7642
|
disabled: disabled || readOnly,
|
7627
7643
|
required
|
@@ -7640,16 +7656,16 @@ var NativeSelectBase = React74.forwardRef(
|
|
7640
7656
|
),
|
7641
7657
|
props.className
|
7642
7658
|
)
|
7643
|
-
}), props.placeholder && /* @__PURE__ */
|
7659
|
+
}), props.placeholder && /* @__PURE__ */ React75.createElement("option", {
|
7644
7660
|
value: placeholderValue,
|
7645
7661
|
disabled: true
|
7646
7662
|
}, props.placeholder), children));
|
7647
7663
|
}
|
7648
7664
|
);
|
7649
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7665
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React75.createElement(Skeleton, {
|
7650
7666
|
height: 38
|
7651
7667
|
});
|
7652
|
-
var NativeSelect =
|
7668
|
+
var NativeSelect = React75.forwardRef(
|
7653
7669
|
(_a, ref) => {
|
7654
7670
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7655
7671
|
var _a2;
|
@@ -7658,11 +7674,11 @@ var NativeSelect = React74.forwardRef(
|
|
7658
7674
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7659
7675
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7660
7676
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
7661
|
-
return /* @__PURE__ */
|
7677
|
+
return /* @__PURE__ */ React75.createElement(LabelControl, __spreadValues({
|
7662
7678
|
id: `${id.current}-label`,
|
7663
7679
|
htmlFor: id.current,
|
7664
7680
|
messageId: errorMessageId
|
7665
|
-
}, labelControlProps), /* @__PURE__ */
|
7681
|
+
}, labelControlProps), /* @__PURE__ */ React75.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7666
7682
|
ref
|
7667
7683
|
}, baseProps), errorProps), {
|
7668
7684
|
id: id.current,
|
@@ -7676,21 +7692,21 @@ var NativeSelect = React74.forwardRef(
|
|
7676
7692
|
}
|
7677
7693
|
);
|
7678
7694
|
NativeSelect.displayName = "NativeSelect";
|
7679
|
-
var Option =
|
7695
|
+
var Option = React75.forwardRef((_a, ref) => {
|
7680
7696
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7681
|
-
return /* @__PURE__ */
|
7697
|
+
return /* @__PURE__ */ React75.createElement("option", __spreadValues({
|
7682
7698
|
ref
|
7683
7699
|
}, props), children);
|
7684
7700
|
});
|
7685
7701
|
Option.displayName = "Option";
|
7686
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
7702
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React75.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React75.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React75.createElement("div", {
|
7687
7703
|
style: { height: "1px" }
|
7688
7704
|
}));
|
7689
7705
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7690
7706
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7691
7707
|
|
7692
7708
|
// src/molecules/PageHeader/PageHeader.tsx
|
7693
|
-
import
|
7709
|
+
import React76 from "react";
|
7694
7710
|
import castArray3 from "lodash/castArray";
|
7695
7711
|
import omit14 from "lodash/omit";
|
7696
7712
|
var PageHeader = ({
|
@@ -7702,49 +7718,48 @@ var PageHeader = ({
|
|
7702
7718
|
chips = [],
|
7703
7719
|
breadcrumbs
|
7704
7720
|
}) => {
|
7705
|
-
return /* @__PURE__ */
|
7721
|
+
return /* @__PURE__ */ React76.createElement(Flexbox, {
|
7706
7722
|
direction: "row",
|
7707
7723
|
gap: "4",
|
7708
7724
|
paddingBottom: "6"
|
7709
|
-
}, /* @__PURE__ */
|
7725
|
+
}, /* @__PURE__ */ React76.createElement(Flexbox, {
|
7710
7726
|
className: tw("grow"),
|
7711
7727
|
direction: "column",
|
7712
7728
|
gap: "0"
|
7713
|
-
}, breadcrumbs && /* @__PURE__ */
|
7729
|
+
}, breadcrumbs && /* @__PURE__ */ React76.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React76.createElement(Flexbox, {
|
7714
7730
|
gap: "5"
|
7715
|
-
}, image && /* @__PURE__ */
|
7731
|
+
}, image && /* @__PURE__ */ React76.createElement("img", {
|
7716
7732
|
src: image,
|
7717
7733
|
alt: imageAlt,
|
7718
7734
|
className: tw("w-[56px] h-[56px]")
|
7719
|
-
}), /* @__PURE__ */
|
7735
|
+
}), /* @__PURE__ */ React76.createElement(Flexbox, {
|
7720
7736
|
direction: "column",
|
7721
7737
|
justifyContent: "center"
|
7722
|
-
}, /* @__PURE__ */
|
7738
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React76.createElement(Flexbox, {
|
7723
7739
|
gap: "3"
|
7724
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7740
|
+
}, chips.map((chip) => /* @__PURE__ */ React76.createElement(Chip2, {
|
7725
7741
|
key: chip,
|
7726
7742
|
dense: true,
|
7727
7743
|
text: chip
|
7728
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7744
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React76.createElement(Flexbox, {
|
7729
7745
|
gap: "4",
|
7730
7746
|
className: tw("self-start")
|
7731
7747
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7732
7748
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7733
|
-
return /* @__PURE__ */
|
7749
|
+
return /* @__PURE__ */ React76.createElement(SecondaryButton, __spreadValues({
|
7734
7750
|
key: text
|
7735
7751
|
}, action), text);
|
7736
|
-
}), primaryAction && /* @__PURE__ */
|
7752
|
+
}), primaryAction && /* @__PURE__ */ React76.createElement(PrimaryButton, __spreadValues({
|
7737
7753
|
key: primaryAction.text
|
7738
7754
|
}, omit14(primaryAction, "text")), primaryAction.text)));
|
7739
7755
|
};
|
7740
7756
|
|
7741
7757
|
// src/molecules/Pagination/Pagination.tsx
|
7742
|
-
import
|
7758
|
+
import React78 from "react";
|
7743
7759
|
import clamp from "lodash/clamp";
|
7744
7760
|
|
7745
7761
|
// src/molecules/Select/Select.tsx
|
7746
|
-
import
|
7747
|
-
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7762
|
+
import React77, { useRef as useRef12, useState as useState10 } from "react";
|
7748
7763
|
import { useSelect } from "downshift";
|
7749
7764
|
import defaults from "lodash/defaults";
|
7750
7765
|
import isArray from "lodash/isArray";
|
@@ -7760,10 +7775,10 @@ var hasOptionGroups = (val) => {
|
|
7760
7775
|
};
|
7761
7776
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7762
7777
|
var _a, _b;
|
7763
|
-
return /* @__PURE__ */
|
7778
|
+
return /* @__PURE__ */ React77.createElement(Select.Item, __spreadValues({
|
7764
7779
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7765
7780
|
selected: item === selectedItem
|
7766
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7781
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React77.createElement(InlineIcon, {
|
7767
7782
|
icon: item.icon
|
7768
7783
|
}), optionToString(item));
|
7769
7784
|
};
|
@@ -7836,7 +7851,7 @@ var _SelectBase = (props) => {
|
|
7836
7851
|
]);
|
7837
7852
|
const [hasFocus, setFocus] = useState10(false);
|
7838
7853
|
const targetRef = useRef12(null);
|
7839
|
-
const
|
7854
|
+
const menuRef = useRef12(null);
|
7840
7855
|
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
7841
7856
|
const findItemByValue = (val) => {
|
7842
7857
|
if (val === null) {
|
@@ -7846,7 +7861,9 @@ var _SelectBase = (props) => {
|
|
7846
7861
|
};
|
7847
7862
|
const {
|
7848
7863
|
isOpen,
|
7864
|
+
openMenu,
|
7849
7865
|
closeMenu,
|
7866
|
+
toggleMenu,
|
7850
7867
|
selectItem,
|
7851
7868
|
selectedItem,
|
7852
7869
|
highlightedIndex,
|
@@ -7861,13 +7878,13 @@ var _SelectBase = (props) => {
|
|
7861
7878
|
itemToString,
|
7862
7879
|
onSelectedItemChange: (e) => onChange == null ? void 0 : onChange(e.selectedItem)
|
7863
7880
|
});
|
7864
|
-
const
|
7865
|
-
|
7866
|
-
|
7867
|
-
|
7868
|
-
|
7869
|
-
|
7870
|
-
}
|
7881
|
+
const state = {
|
7882
|
+
isOpen,
|
7883
|
+
close: closeMenu,
|
7884
|
+
open: openMenu,
|
7885
|
+
toggle: toggleMenu,
|
7886
|
+
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
7887
|
+
};
|
7871
7888
|
const renderItem = (item, index) => UNSAFE_renderOption(
|
7872
7889
|
item,
|
7873
7890
|
__spreadValues({
|
@@ -7880,13 +7897,13 @@ var _SelectBase = (props) => {
|
|
7880
7897
|
},
|
7881
7898
|
withDefaults
|
7882
7899
|
);
|
7883
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7900
|
+
const renderGroup = (group) => /* @__PURE__ */ React77.createElement(React77.Fragment, {
|
7884
7901
|
key: group.label
|
7885
|
-
}, /* @__PURE__ */
|
7886
|
-
const input = /* @__PURE__ */
|
7902
|
+
}, /* @__PURE__ */ React77.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7903
|
+
const input = /* @__PURE__ */ React77.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7887
7904
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7888
7905
|
tabIndex: 0
|
7889
|
-
}), /* @__PURE__ */
|
7906
|
+
}), /* @__PURE__ */ React77.createElement(Select.Input, __spreadProps(__spreadValues({
|
7890
7907
|
id,
|
7891
7908
|
name
|
7892
7909
|
}, rest), {
|
@@ -7898,27 +7915,26 @@ var _SelectBase = (props) => {
|
|
7898
7915
|
tabIndex: -1,
|
7899
7916
|
onFocus: () => setFocus(true),
|
7900
7917
|
onBlur: () => setFocus(false)
|
7901
|
-
})), !readOnly && /* @__PURE__ */
|
7918
|
+
})), !readOnly && /* @__PURE__ */ React77.createElement(Select.Toggle, {
|
7902
7919
|
disabled,
|
7903
7920
|
isOpen,
|
7904
7921
|
tabIndex: -1
|
7905
7922
|
}));
|
7906
|
-
const
|
7907
|
-
|
7908
|
-
return /* @__PURE__ */ React76.createElement("div", {
|
7923
|
+
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
7924
|
+
return /* @__PURE__ */ React77.createElement("div", {
|
7909
7925
|
className: tw("relative")
|
7910
|
-
}, labelWrapper ?
|
7911
|
-
|
7912
|
-
|
7913
|
-
|
7914
|
-
|
7915
|
-
style
|
7916
|
-
|
7917
|
-
|
7926
|
+
}, labelWrapper ? React77.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React77.createElement(PopoverOverlay, {
|
7927
|
+
state,
|
7928
|
+
triggerRef: targetRef,
|
7929
|
+
placement: "bottom-left",
|
7930
|
+
shouldFlip: true,
|
7931
|
+
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
7932
|
+
}, /* @__PURE__ */ React77.createElement(Select.Menu, __spreadValues({
|
7933
|
+
ref: menuRef,
|
7918
7934
|
maxHeight
|
7919
|
-
},
|
7935
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ React77.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React77.createElement(React77.Fragment, null, /* @__PURE__ */ React77.createElement(Select.Divider, {
|
7920
7936
|
onMouseOver: () => setHighlightedIndex(-1)
|
7921
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7937
|
+
}), actions.map((act, index) => /* @__PURE__ */ React77.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7922
7938
|
key: `${index}`
|
7923
7939
|
}, act), {
|
7924
7940
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7928,10 +7944,10 @@ var _SelectBase = (props) => {
|
|
7928
7944
|
}
|
7929
7945
|
}), act.label))))));
|
7930
7946
|
};
|
7931
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7947
|
+
var SelectBase = (props) => /* @__PURE__ */ React77.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7932
7948
|
labelWrapper: void 0
|
7933
7949
|
}));
|
7934
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7950
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React77.createElement(Skeleton, {
|
7935
7951
|
height: 38
|
7936
7952
|
});
|
7937
7953
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7949,19 +7965,19 @@ var Select2 = (_a) => {
|
|
7949
7965
|
const baseProps = omit15(props, Object.keys(labelProps));
|
7950
7966
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7951
7967
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7952
|
-
const label = /* @__PURE__ */
|
7968
|
+
const label = /* @__PURE__ */ React77.createElement(Label, __spreadValues({
|
7953
7969
|
id: `${id.current}-label`,
|
7954
7970
|
htmlFor: `${id.current}-input`,
|
7955
7971
|
variant,
|
7956
7972
|
messageId: errorMessageId
|
7957
7973
|
}, labelProps));
|
7958
|
-
return /* @__PURE__ */
|
7974
|
+
return /* @__PURE__ */ React77.createElement(FormControl, null, /* @__PURE__ */ React77.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7959
7975
|
id: `${id.current}-input`,
|
7960
7976
|
options,
|
7961
7977
|
disabled: props.disabled,
|
7962
7978
|
valid: props.valid,
|
7963
7979
|
labelWrapper: label
|
7964
|
-
})), /* @__PURE__ */
|
7980
|
+
})), /* @__PURE__ */ React77.createElement(HelperText, {
|
7965
7981
|
messageId: errorMessageId,
|
7966
7982
|
error: !labelProps.valid,
|
7967
7983
|
helperText: labelProps.helperText,
|
@@ -7970,7 +7986,7 @@ var Select2 = (_a) => {
|
|
7970
7986
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7971
7987
|
}));
|
7972
7988
|
};
|
7973
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7989
|
+
var SelectSkeleton = () => /* @__PURE__ */ React77.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React77.createElement(SelectBase.Skeleton, null));
|
7974
7990
|
Select2.Skeleton = SelectSkeleton;
|
7975
7991
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
7976
7992
|
|
@@ -7989,23 +8005,23 @@ var Pagination = ({
|
|
7989
8005
|
pageSizes,
|
7990
8006
|
onPageSizeChange
|
7991
8007
|
}) => {
|
7992
|
-
const [value, setValue] =
|
7993
|
-
|
8008
|
+
const [value, setValue] = React78.useState(currentPage);
|
8009
|
+
React78.useEffect(() => {
|
7994
8010
|
setValue(currentPage);
|
7995
8011
|
}, [currentPage]);
|
7996
|
-
return /* @__PURE__ */
|
8012
|
+
return /* @__PURE__ */ React78.createElement(Box, {
|
7997
8013
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7998
8014
|
backgroundColor: "grey-0",
|
7999
8015
|
padding: "4"
|
8000
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
8016
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React78.createElement(Box, {
|
8001
8017
|
display: "flex",
|
8002
8018
|
alignItems: "center",
|
8003
8019
|
gap: "4"
|
8004
|
-
}, /* @__PURE__ */
|
8020
|
+
}, /* @__PURE__ */ React78.createElement(Typography2.Small, {
|
8005
8021
|
color: "grey-50"
|
8006
|
-
}, "Items per page "), /* @__PURE__ */
|
8022
|
+
}, "Items per page "), /* @__PURE__ */ React78.createElement("div", {
|
8007
8023
|
className: tw("max-w-[70px]")
|
8008
|
-
}, /* @__PURE__ */
|
8024
|
+
}, /* @__PURE__ */ React78.createElement(SelectBase, {
|
8009
8025
|
options: pageSizes.map((size) => size.toString()),
|
8010
8026
|
value: pageSize.toString(),
|
8011
8027
|
onChange: (size) => {
|
@@ -8016,26 +8032,26 @@ var Pagination = ({
|
|
8016
8032
|
}
|
8017
8033
|
}
|
8018
8034
|
}
|
8019
|
-
}))) : /* @__PURE__ */
|
8035
|
+
}))) : /* @__PURE__ */ React78.createElement("div", null), /* @__PURE__ */ React78.createElement(Box, {
|
8020
8036
|
display: "flex",
|
8021
8037
|
justifyContent: "center",
|
8022
8038
|
alignItems: "center",
|
8023
8039
|
className: tw("grow")
|
8024
|
-
}, /* @__PURE__ */
|
8040
|
+
}, /* @__PURE__ */ React78.createElement(IconButton, {
|
8025
8041
|
"aria-label": "First",
|
8026
8042
|
onClick: () => onPageChange(1),
|
8027
8043
|
icon: import_chevronBackward.default,
|
8028
8044
|
disabled: !hasPreviousPage
|
8029
|
-
}), /* @__PURE__ */
|
8045
|
+
}), /* @__PURE__ */ React78.createElement(IconButton, {
|
8030
8046
|
"aria-label": "Previous",
|
8031
8047
|
onClick: () => onPageChange(currentPage - 1),
|
8032
8048
|
icon: import_chevronLeft3.default,
|
8033
8049
|
disabled: !hasPreviousPage
|
8034
|
-
}), /* @__PURE__ */
|
8050
|
+
}), /* @__PURE__ */ React78.createElement(Box, {
|
8035
8051
|
paddingX: "4"
|
8036
|
-
}, /* @__PURE__ */
|
8052
|
+
}, /* @__PURE__ */ React78.createElement(Typography2.Small, {
|
8037
8053
|
color: "grey-60"
|
8038
|
-
}, "Page")), /* @__PURE__ */
|
8054
|
+
}, "Page")), /* @__PURE__ */ React78.createElement(InputBase, {
|
8039
8055
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
8040
8056
|
type: "number",
|
8041
8057
|
min: 1,
|
@@ -8052,45 +8068,45 @@ var Pagination = ({
|
|
8052
8068
|
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
8053
8069
|
onPageChange(newPage);
|
8054
8070
|
}
|
8055
|
-
}), /* @__PURE__ */
|
8071
|
+
}), /* @__PURE__ */ React78.createElement(Box, {
|
8056
8072
|
paddingX: "4"
|
8057
|
-
}, /* @__PURE__ */
|
8073
|
+
}, /* @__PURE__ */ React78.createElement(Typography2.Small, {
|
8058
8074
|
color: "grey-60"
|
8059
|
-
}, "of ", totalPages)), /* @__PURE__ */
|
8075
|
+
}, "of ", totalPages)), /* @__PURE__ */ React78.createElement(IconButton, {
|
8060
8076
|
"aria-label": "Next",
|
8061
8077
|
onClick: () => onPageChange(currentPage + 1),
|
8062
8078
|
icon: import_chevronRight3.default,
|
8063
8079
|
disabled: !hasNextPage
|
8064
|
-
}), /* @__PURE__ */
|
8080
|
+
}), /* @__PURE__ */ React78.createElement(IconButton, {
|
8065
8081
|
"aria-label": "Last",
|
8066
8082
|
onClick: () => onPageChange(totalPages),
|
8067
8083
|
icon: import_chevronForward.default,
|
8068
8084
|
disabled: !hasNextPage
|
8069
|
-
})), /* @__PURE__ */
|
8085
|
+
})), /* @__PURE__ */ React78.createElement("div", null));
|
8070
8086
|
};
|
8071
8087
|
|
8072
8088
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
8073
|
-
import
|
8089
|
+
import React80 from "react";
|
8074
8090
|
import omit16 from "lodash/omit";
|
8075
8091
|
|
8076
8092
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
8077
|
-
import
|
8093
|
+
import React79 from "react";
|
8078
8094
|
var Header = (_a) => {
|
8079
8095
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8080
|
-
return /* @__PURE__ */
|
8096
|
+
return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8081
8097
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
8082
8098
|
}), children);
|
8083
8099
|
};
|
8084
8100
|
var Title = (_a) => {
|
8085
8101
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8086
|
-
return /* @__PURE__ */
|
8102
|
+
return /* @__PURE__ */ React79.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
8087
8103
|
htmlTag: "h1",
|
8088
8104
|
variant: "small-strong"
|
8089
8105
|
}), children);
|
8090
8106
|
};
|
8091
8107
|
var Body = (_a) => {
|
8092
8108
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8093
|
-
return /* @__PURE__ */
|
8109
|
+
return /* @__PURE__ */ React79.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
8094
8110
|
htmlTag: "div",
|
8095
8111
|
variant: "caption",
|
8096
8112
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -8098,13 +8114,13 @@ var Body = (_a) => {
|
|
8098
8114
|
};
|
8099
8115
|
var Footer = (_a) => {
|
8100
8116
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8101
|
-
return /* @__PURE__ */
|
8117
|
+
return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8102
8118
|
className: classNames(tw("p-5"), className)
|
8103
8119
|
}), children);
|
8104
8120
|
};
|
8105
8121
|
var Actions2 = (_a) => {
|
8106
8122
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8107
|
-
return /* @__PURE__ */
|
8123
|
+
return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8108
8124
|
className: classNames(tw("flex gap-4"), className)
|
8109
8125
|
}), children);
|
8110
8126
|
};
|
@@ -8120,13 +8136,13 @@ var PopoverDialog = {
|
|
8120
8136
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
8121
8137
|
const wrapPromptWithBody = (child) => {
|
8122
8138
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
8123
|
-
return /* @__PURE__ */
|
8139
|
+
return /* @__PURE__ */ React80.createElement(Popover2.Panel, {
|
8124
8140
|
className: tw("max-w-[300px]")
|
8125
|
-
}, /* @__PURE__ */
|
8141
|
+
}, /* @__PURE__ */ React80.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React80.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React80.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React80.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React80.createElement(Popover2.Button, __spreadValues({
|
8126
8142
|
kind: "secondary-ghost",
|
8127
8143
|
key: secondaryAction.text,
|
8128
8144
|
dense: true
|
8129
|
-
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
8145
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React80.createElement(Popover2.Button, __spreadValues({
|
8130
8146
|
kind: "ghost",
|
8131
8147
|
key: primaryAction.text,
|
8132
8148
|
dense: true
|
@@ -8134,18 +8150,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
8134
8150
|
}
|
8135
8151
|
return child;
|
8136
8152
|
};
|
8137
|
-
return /* @__PURE__ */
|
8153
|
+
return /* @__PURE__ */ React80.createElement(Popover2, {
|
8138
8154
|
type: "dialog",
|
8139
8155
|
isOpen: open,
|
8140
8156
|
placement,
|
8141
|
-
isDismissable: true,
|
8142
|
-
isKeyboardDismissDisabled: false,
|
8143
|
-
autoFocus: true,
|
8144
8157
|
containFocus: true
|
8145
|
-
},
|
8158
|
+
}, React80.Children.map(children, wrapPromptWithBody));
|
8146
8159
|
};
|
8147
8160
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
8148
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
8161
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React80.createElement(PopoverDialog.Body, null, children);
|
8149
8162
|
Prompt.displayName = "PopoverDialog.Prompt";
|
8150
8163
|
PopoverDialog2.Prompt = Prompt;
|
8151
8164
|
|
@@ -8154,14 +8167,14 @@ import { createPortal } from "react-dom";
|
|
8154
8167
|
var Portal = ({ children, to }) => createPortal(children, to);
|
8155
8168
|
|
8156
8169
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
8157
|
-
import
|
8170
|
+
import React82 from "react";
|
8158
8171
|
|
8159
8172
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
8160
|
-
import
|
8173
|
+
import React81 from "react";
|
8161
8174
|
import clamp2 from "lodash/clamp";
|
8162
8175
|
var ProgressBar = (_a) => {
|
8163
8176
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8164
|
-
return /* @__PURE__ */
|
8177
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8165
8178
|
className: classNames(
|
8166
8179
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
8167
8180
|
className
|
@@ -8177,7 +8190,7 @@ var STATUS_COLORS = {
|
|
8177
8190
|
ProgressBar.Indicator = (_a) => {
|
8178
8191
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
8179
8192
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
8180
|
-
return /* @__PURE__ */
|
8193
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8181
8194
|
className: classNames(
|
8182
8195
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
8183
8196
|
STATUS_COLORS[status],
|
@@ -8193,11 +8206,11 @@ ProgressBar.Indicator = (_a) => {
|
|
8193
8206
|
};
|
8194
8207
|
ProgressBar.Labels = (_a) => {
|
8195
8208
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
8196
|
-
return /* @__PURE__ */
|
8209
|
+
return /* @__PURE__ */ React81.createElement("div", {
|
8197
8210
|
className: classNames(tw("flex flex-row"), className)
|
8198
|
-
}, /* @__PURE__ */
|
8211
|
+
}, /* @__PURE__ */ React81.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8199
8212
|
className: tw("grow text-grey-70 typography-caption")
|
8200
|
-
}), startLabel), /* @__PURE__ */
|
8213
|
+
}), startLabel), /* @__PURE__ */ React81.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8201
8214
|
className: tw("grow text-grey-70 typography-caption text-right")
|
8202
8215
|
}), endLabel));
|
8203
8216
|
};
|
@@ -8215,7 +8228,7 @@ var ProgressBar2 = (props) => {
|
|
8215
8228
|
if (min > max) {
|
8216
8229
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
8217
8230
|
}
|
8218
|
-
const progress = /* @__PURE__ */
|
8231
|
+
const progress = /* @__PURE__ */ React82.createElement(ProgressBar, null, /* @__PURE__ */ React82.createElement(ProgressBar.Indicator, {
|
8219
8232
|
status: value === max ? completedStatus : progresStatus,
|
8220
8233
|
min,
|
8221
8234
|
max,
|
@@ -8225,13 +8238,13 @@ var ProgressBar2 = (props) => {
|
|
8225
8238
|
if (props.dense) {
|
8226
8239
|
return progress;
|
8227
8240
|
}
|
8228
|
-
return /* @__PURE__ */
|
8241
|
+
return /* @__PURE__ */ React82.createElement("div", null, progress, /* @__PURE__ */ React82.createElement(ProgressBar.Labels, {
|
8229
8242
|
className: tw("py-2"),
|
8230
8243
|
startLabel: props.startLabel,
|
8231
8244
|
endLabel: props.endLabel
|
8232
8245
|
}));
|
8233
8246
|
};
|
8234
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
8247
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React82.createElement(Skeleton, {
|
8235
8248
|
height: 4,
|
8236
8249
|
display: "block"
|
8237
8250
|
});
|
@@ -8239,13 +8252,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
8239
8252
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
8240
8253
|
|
8241
8254
|
// src/molecules/RadioButton/RadioButton.tsx
|
8242
|
-
import
|
8243
|
-
var RadioButton2 =
|
8255
|
+
import React83 from "react";
|
8256
|
+
var RadioButton2 = React83.forwardRef(
|
8244
8257
|
(_a, ref) => {
|
8245
8258
|
var _b = _a, { name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["name", "id", "readOnly", "disabled", "caption", "children", "aria-label"]);
|
8246
8259
|
var _a2;
|
8247
8260
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8248
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8261
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React83.createElement(ControlLabel, {
|
8249
8262
|
htmlFor: id,
|
8250
8263
|
label: children,
|
8251
8264
|
"aria-label": ariaLabel,
|
@@ -8253,7 +8266,7 @@ var RadioButton2 = React82.forwardRef(
|
|
8253
8266
|
readOnly,
|
8254
8267
|
disabled,
|
8255
8268
|
style: { gap: "0 8px" }
|
8256
|
-
}, !readOnly && /* @__PURE__ */
|
8269
|
+
}, !readOnly && /* @__PURE__ */ React83.createElement(RadioButton, __spreadProps(__spreadValues({
|
8257
8270
|
id,
|
8258
8271
|
ref,
|
8259
8272
|
name
|
@@ -8264,12 +8277,12 @@ var RadioButton2 = React82.forwardRef(
|
|
8264
8277
|
}
|
8265
8278
|
);
|
8266
8279
|
RadioButton2.displayName = "RadioButton";
|
8267
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
8280
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React83.createElement("div", {
|
8268
8281
|
className: tw("flex gap-3")
|
8269
|
-
}, /* @__PURE__ */
|
8282
|
+
}, /* @__PURE__ */ React83.createElement(Skeleton, {
|
8270
8283
|
height: 20,
|
8271
8284
|
width: 20
|
8272
|
-
}), /* @__PURE__ */
|
8285
|
+
}), /* @__PURE__ */ React83.createElement(Skeleton, {
|
8273
8286
|
height: 20,
|
8274
8287
|
width: 150
|
8275
8288
|
}));
|
@@ -8277,10 +8290,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
8277
8290
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
8278
8291
|
|
8279
8292
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
8280
|
-
import
|
8293
|
+
import React84 from "react";
|
8281
8294
|
import uniqueId8 from "lodash/uniqueId";
|
8282
8295
|
var isRadioButton = (c) => {
|
8283
|
-
return
|
8296
|
+
return React84.isValidElement(c) && c.type === RadioButton2;
|
8284
8297
|
};
|
8285
8298
|
var RadioButtonGroup = (_a) => {
|
8286
8299
|
var _b = _a, {
|
@@ -8303,7 +8316,7 @@ var RadioButtonGroup = (_a) => {
|
|
8303
8316
|
"children"
|
8304
8317
|
]);
|
8305
8318
|
var _a2;
|
8306
|
-
const [value, setValue] =
|
8319
|
+
const [value, setValue] = React84.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
8307
8320
|
const errorMessageId = uniqueId8();
|
8308
8321
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8309
8322
|
const labelControlProps = getLabelControlProps(props);
|
@@ -8314,14 +8327,14 @@ var RadioButtonGroup = (_a) => {
|
|
8314
8327
|
setValue(e.target.value);
|
8315
8328
|
onChange == null ? void 0 : onChange(e.target.value);
|
8316
8329
|
};
|
8317
|
-
const content =
|
8330
|
+
const content = React84.Children.map(children, (c) => {
|
8318
8331
|
var _a3, _b2, _c;
|
8319
8332
|
if (!isRadioButton(c)) {
|
8320
8333
|
return null;
|
8321
8334
|
}
|
8322
8335
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
8323
8336
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
8324
|
-
return
|
8337
|
+
return React84.cloneElement(c, {
|
8325
8338
|
name,
|
8326
8339
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
8327
8340
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -8330,11 +8343,11 @@ var RadioButtonGroup = (_a) => {
|
|
8330
8343
|
readOnly
|
8331
8344
|
});
|
8332
8345
|
});
|
8333
|
-
return /* @__PURE__ */
|
8346
|
+
return /* @__PURE__ */ React84.createElement(LabelControl, __spreadValues(__spreadValues({
|
8334
8347
|
fieldset: true
|
8335
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
8348
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React84.createElement(InputGroup, {
|
8336
8349
|
cols
|
8337
|
-
}, content), !cols && /* @__PURE__ */
|
8350
|
+
}, content), !cols && /* @__PURE__ */ React84.createElement(Flexbox, {
|
8338
8351
|
direction,
|
8339
8352
|
alignItems: "flex-start",
|
8340
8353
|
colGap: "8",
|
@@ -8343,12 +8356,12 @@ var RadioButtonGroup = (_a) => {
|
|
8343
8356
|
}, content));
|
8344
8357
|
};
|
8345
8358
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
8346
|
-
return /* @__PURE__ */
|
8359
|
+
return /* @__PURE__ */ React84.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React84.createElement("div", {
|
8347
8360
|
className: tw("flex flex-wrap", {
|
8348
8361
|
"flex-row gap-8": direction === "row",
|
8349
8362
|
"flex-col gap-2": direction === "column"
|
8350
8363
|
})
|
8351
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8364
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React84.createElement(RadioButton2.Skeleton, {
|
8352
8365
|
key
|
8353
8366
|
}))));
|
8354
8367
|
};
|
@@ -8356,68 +8369,68 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
8356
8369
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
8357
8370
|
|
8358
8371
|
// src/molecules/Section/Section.tsx
|
8359
|
-
import
|
8372
|
+
import React86 from "react";
|
8360
8373
|
import castArray4 from "lodash/castArray";
|
8361
8374
|
|
8362
8375
|
// src/atoms/Section/Section.tsx
|
8363
|
-
import
|
8376
|
+
import React85 from "react";
|
8364
8377
|
var Section2 = (_a) => {
|
8365
8378
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8366
|
-
return /* @__PURE__ */
|
8379
|
+
return /* @__PURE__ */ React85.createElement(Box, __spreadValues({
|
8367
8380
|
borderColor: "grey-5",
|
8368
8381
|
borderWidth: "1px"
|
8369
8382
|
}, rest), children);
|
8370
8383
|
};
|
8371
8384
|
Section2.Header = (_a) => {
|
8372
8385
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8373
|
-
return /* @__PURE__ */
|
8386
|
+
return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8374
8387
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8375
8388
|
}), children);
|
8376
8389
|
};
|
8377
8390
|
Section2.TitleContainer = (_a) => {
|
8378
8391
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8379
|
-
return /* @__PURE__ */
|
8392
|
+
return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8380
8393
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8381
8394
|
}), children);
|
8382
8395
|
};
|
8383
8396
|
Section2.Title = (_a) => {
|
8384
8397
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8385
|
-
return /* @__PURE__ */
|
8398
|
+
return /* @__PURE__ */ React85.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8386
8399
|
color: "black"
|
8387
8400
|
}), children);
|
8388
8401
|
};
|
8389
8402
|
Section2.Subtitle = (_a) => {
|
8390
8403
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8391
|
-
return /* @__PURE__ */
|
8404
|
+
return /* @__PURE__ */ React85.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8392
8405
|
color: "grey-70"
|
8393
8406
|
}), children);
|
8394
8407
|
};
|
8395
8408
|
Section2.Actions = (_a) => {
|
8396
8409
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8397
|
-
return /* @__PURE__ */
|
8410
|
+
return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8398
8411
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8399
8412
|
}), children);
|
8400
8413
|
};
|
8401
8414
|
Section2.Body = (_a) => {
|
8402
8415
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8403
|
-
return /* @__PURE__ */
|
8416
|
+
return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8404
8417
|
className: classNames(tw("p-6"), className)
|
8405
|
-
}), /* @__PURE__ */
|
8418
|
+
}), /* @__PURE__ */ React85.createElement(Typography, {
|
8406
8419
|
htmlTag: "div",
|
8407
8420
|
color: "grey-70"
|
8408
8421
|
}, children));
|
8409
8422
|
};
|
8410
8423
|
|
8411
8424
|
// src/molecules/Section/Section.tsx
|
8412
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8425
|
+
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React86.createElement(Section2, null, title && /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(Section2.Header, null, /* @__PURE__ */ React86.createElement(Section2.TitleContainer, null, /* @__PURE__ */ React86.createElement(Section2.Title, null, title), subtitle && /* @__PURE__ */ React86.createElement(Section2.Subtitle, null, subtitle)), /* @__PURE__ */ React86.createElement(Section2.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
|
8413
8426
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8414
|
-
return /* @__PURE__ */
|
8427
|
+
return /* @__PURE__ */ React86.createElement(SecondaryButton, __spreadValues({
|
8415
8428
|
key: text
|
8416
8429
|
}, action), text);
|
8417
|
-
}))), /* @__PURE__ */
|
8430
|
+
}))), /* @__PURE__ */ React86.createElement(Divider2, null)), /* @__PURE__ */ React86.createElement(Section2.Body, null, children));
|
8418
8431
|
|
8419
8432
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
8420
|
-
import
|
8433
|
+
import React87 from "react";
|
8421
8434
|
var SegmentedControl = (_a) => {
|
8422
8435
|
var _b = _a, {
|
8423
8436
|
children,
|
@@ -8434,7 +8447,7 @@ var SegmentedControl = (_a) => {
|
|
8434
8447
|
"selected",
|
8435
8448
|
"className"
|
8436
8449
|
]);
|
8437
|
-
return /* @__PURE__ */
|
8450
|
+
return /* @__PURE__ */ React87.createElement("button", __spreadProps(__spreadValues({
|
8438
8451
|
type: "button"
|
8439
8452
|
}, rest), {
|
8440
8453
|
className: classNames(
|
@@ -8465,11 +8478,11 @@ var SegmentedControlGroup = (_a) => {
|
|
8465
8478
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8466
8479
|
"bg-grey-0": variant === "raised"
|
8467
8480
|
});
|
8468
|
-
return /* @__PURE__ */
|
8481
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8469
8482
|
className: classNames(classes2, className)
|
8470
|
-
}),
|
8483
|
+
}), React87.Children.map(
|
8471
8484
|
children,
|
8472
|
-
(child) =>
|
8485
|
+
(child) => React87.cloneElement(child, {
|
8473
8486
|
dense,
|
8474
8487
|
variant,
|
8475
8488
|
onClick: () => onChange(child.props.value),
|
@@ -8507,10 +8520,10 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8507
8520
|
);
|
8508
8521
|
|
8509
8522
|
// src/molecules/Spacing/Spacing.tsx
|
8510
|
-
import
|
8523
|
+
import React88 from "react";
|
8511
8524
|
var Spacing = (_a) => {
|
8512
8525
|
var _b = _a, { gap, row } = _b, rest = __objRest(_b, ["gap", "row"]);
|
8513
|
-
return /* @__PURE__ */
|
8526
|
+
return /* @__PURE__ */ React88.createElement(Box, __spreadProps(__spreadValues({}, rest), {
|
8514
8527
|
display: "flex",
|
8515
8528
|
flexDirection: row ? "row" : "column",
|
8516
8529
|
gap
|
@@ -8518,14 +8531,14 @@ var Spacing = (_a) => {
|
|
8518
8531
|
};
|
8519
8532
|
|
8520
8533
|
// src/molecules/Stepper/Stepper.tsx
|
8521
|
-
import
|
8534
|
+
import React90 from "react";
|
8522
8535
|
|
8523
8536
|
// src/atoms/Stepper/Stepper.tsx
|
8524
|
-
import
|
8537
|
+
import React89 from "react";
|
8525
8538
|
var import_tick5 = __toESM(require_tick());
|
8526
8539
|
var Stepper = (_a) => {
|
8527
8540
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8528
|
-
return /* @__PURE__ */
|
8541
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8529
8542
|
className: classNames(className)
|
8530
8543
|
}));
|
8531
8544
|
};
|
@@ -8539,7 +8552,7 @@ var ConnectorContainer = (_a) => {
|
|
8539
8552
|
"completed",
|
8540
8553
|
"dense"
|
8541
8554
|
]);
|
8542
|
-
return /* @__PURE__ */
|
8555
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8543
8556
|
className: classNames(
|
8544
8557
|
tw("absolute w-full -left-1/2", {
|
8545
8558
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -8551,7 +8564,7 @@ var ConnectorContainer = (_a) => {
|
|
8551
8564
|
};
|
8552
8565
|
var Connector = (_a) => {
|
8553
8566
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8554
|
-
return /* @__PURE__ */
|
8567
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8555
8568
|
className: classNames(
|
8556
8569
|
tw("w-full", {
|
8557
8570
|
"bg-grey-20": !completed,
|
@@ -8565,7 +8578,7 @@ var Connector = (_a) => {
|
|
8565
8578
|
};
|
8566
8579
|
var Step = (_a) => {
|
8567
8580
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8568
|
-
return /* @__PURE__ */
|
8581
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8569
8582
|
className: classNames(
|
8570
8583
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8571
8584
|
"text-grey-20": state === "inactive"
|
@@ -8586,13 +8599,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
8586
8599
|
});
|
8587
8600
|
var Indicator = (_a) => {
|
8588
8601
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8589
|
-
return /* @__PURE__ */
|
8602
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8590
8603
|
className: classNames(
|
8591
8604
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8592
8605
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
8593
8606
|
className
|
8594
8607
|
)
|
8595
|
-
}), state === "completed" ? /* @__PURE__ */
|
8608
|
+
}), state === "completed" ? /* @__PURE__ */ React89.createElement(InlineIcon, {
|
8596
8609
|
icon: import_tick5.default
|
8597
8610
|
}) : dense ? null : children);
|
8598
8611
|
};
|
@@ -8603,25 +8616,25 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
8603
8616
|
|
8604
8617
|
// src/molecules/Stepper/Stepper.tsx
|
8605
8618
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8606
|
-
const steps =
|
8607
|
-
return /* @__PURE__ */
|
8619
|
+
const steps = React90.Children.count(children);
|
8620
|
+
return /* @__PURE__ */ React90.createElement(Stepper, {
|
8608
8621
|
role: "list"
|
8609
|
-
}, /* @__PURE__ */
|
8622
|
+
}, /* @__PURE__ */ React90.createElement(Template, {
|
8610
8623
|
columns: steps
|
8611
|
-
},
|
8624
|
+
}, React90.Children.map(children, (child, index) => {
|
8612
8625
|
if (!isComponentType(child, Step2)) {
|
8613
8626
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8614
8627
|
} else {
|
8615
8628
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8616
|
-
return /* @__PURE__ */
|
8629
|
+
return /* @__PURE__ */ React90.createElement(Stepper.Step, {
|
8617
8630
|
state,
|
8618
8631
|
"aria-current": state === "active" ? "step" : false,
|
8619
8632
|
role: "listitem"
|
8620
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
8633
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React90.createElement(Stepper.ConnectorContainer, {
|
8621
8634
|
dense
|
8622
|
-
}, /* @__PURE__ */
|
8635
|
+
}, /* @__PURE__ */ React90.createElement(Stepper.ConnectorContainer.Connector, {
|
8623
8636
|
completed: state === "completed" || state === "active"
|
8624
|
-
})), /* @__PURE__ */
|
8637
|
+
})), /* @__PURE__ */ React90.createElement(Stepper.Step.Indicator, {
|
8625
8638
|
state,
|
8626
8639
|
dense
|
8627
8640
|
}, index + 1), child.props.children);
|
@@ -8633,16 +8646,16 @@ Step2.displayName = "Stepper.Step";
|
|
8633
8646
|
Stepper2.Step = Step2;
|
8634
8647
|
|
8635
8648
|
// src/molecules/Switch/Switch.tsx
|
8636
|
-
import
|
8649
|
+
import React92 from "react";
|
8637
8650
|
|
8638
8651
|
// src/atoms/Switch/Switch.tsx
|
8639
|
-
import
|
8640
|
-
var Switch =
|
8652
|
+
import React91 from "react";
|
8653
|
+
var Switch = React91.forwardRef(
|
8641
8654
|
(_a, ref) => {
|
8642
8655
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8643
|
-
return /* @__PURE__ */
|
8656
|
+
return /* @__PURE__ */ React91.createElement("span", {
|
8644
8657
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8645
|
-
}, /* @__PURE__ */
|
8658
|
+
}, /* @__PURE__ */ React91.createElement("input", __spreadProps(__spreadValues({
|
8646
8659
|
id,
|
8647
8660
|
ref,
|
8648
8661
|
type: "checkbox",
|
@@ -8661,7 +8674,7 @@ var Switch = React90.forwardRef(
|
|
8661
8674
|
),
|
8662
8675
|
readOnly,
|
8663
8676
|
disabled
|
8664
|
-
})), /* @__PURE__ */
|
8677
|
+
})), /* @__PURE__ */ React91.createElement("span", {
|
8665
8678
|
className: tw(
|
8666
8679
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8667
8680
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8674,12 +8687,12 @@ var Switch = React90.forwardRef(
|
|
8674
8687
|
);
|
8675
8688
|
|
8676
8689
|
// src/molecules/Switch/Switch.tsx
|
8677
|
-
var Switch2 =
|
8690
|
+
var Switch2 = React92.forwardRef(
|
8678
8691
|
(_a, ref) => {
|
8679
8692
|
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
8680
8693
|
var _a2;
|
8681
8694
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8682
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8695
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React92.createElement(ControlLabel, {
|
8683
8696
|
htmlFor: id,
|
8684
8697
|
label: children,
|
8685
8698
|
"aria-label": ariaLabel,
|
@@ -8687,7 +8700,7 @@ var Switch2 = React91.forwardRef(
|
|
8687
8700
|
readOnly,
|
8688
8701
|
disabled,
|
8689
8702
|
style: { gap: "0 8px" }
|
8690
|
-
}, !readOnly && /* @__PURE__ */
|
8703
|
+
}, !readOnly && /* @__PURE__ */ React92.createElement(Switch, __spreadProps(__spreadValues({
|
8691
8704
|
id,
|
8692
8705
|
ref,
|
8693
8706
|
name
|
@@ -8698,12 +8711,12 @@ var Switch2 = React91.forwardRef(
|
|
8698
8711
|
}
|
8699
8712
|
);
|
8700
8713
|
Switch2.displayName = "Switch";
|
8701
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
8714
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React92.createElement("div", {
|
8702
8715
|
className: tw("flex gap-3")
|
8703
|
-
}, /* @__PURE__ */
|
8716
|
+
}, /* @__PURE__ */ React92.createElement(Skeleton, {
|
8704
8717
|
height: 20,
|
8705
8718
|
width: 35
|
8706
|
-
}), /* @__PURE__ */
|
8719
|
+
}), /* @__PURE__ */ React92.createElement(Skeleton, {
|
8707
8720
|
height: 20,
|
8708
8721
|
width: 150
|
8709
8722
|
}));
|
@@ -8711,7 +8724,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
8711
8724
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
8712
8725
|
|
8713
8726
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
8714
|
-
import
|
8727
|
+
import React93, { useState as useState11 } from "react";
|
8715
8728
|
import uniqueId9 from "lodash/uniqueId";
|
8716
8729
|
var SwitchGroup = (_a) => {
|
8717
8730
|
var _b = _a, {
|
@@ -8743,11 +8756,11 @@ var SwitchGroup = (_a) => {
|
|
8743
8756
|
setSelectedItems(updated);
|
8744
8757
|
onChange == null ? void 0 : onChange(updated);
|
8745
8758
|
};
|
8746
|
-
return /* @__PURE__ */
|
8759
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, __spreadValues(__spreadValues({
|
8747
8760
|
fieldset: true
|
8748
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8761
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React93.createElement(InputGroup, {
|
8749
8762
|
cols
|
8750
|
-
},
|
8763
|
+
}, React93.Children.map(children, (c) => {
|
8751
8764
|
var _a3, _b2, _c, _d;
|
8752
8765
|
if (!isComponentType(c, Switch2)) {
|
8753
8766
|
return null;
|
@@ -8755,7 +8768,7 @@ var SwitchGroup = (_a) => {
|
|
8755
8768
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8756
8769
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8757
8770
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8758
|
-
return
|
8771
|
+
return React93.cloneElement(c, {
|
8759
8772
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8760
8773
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8761
8774
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8765,9 +8778,9 @@ var SwitchGroup = (_a) => {
|
|
8765
8778
|
})));
|
8766
8779
|
};
|
8767
8780
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8768
|
-
return /* @__PURE__ */
|
8781
|
+
return /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement("div", {
|
8769
8782
|
className: tw("flex flex-wrap flex-col gap-2")
|
8770
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8783
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React93.createElement(Switch2.Skeleton, {
|
8771
8784
|
key
|
8772
8785
|
}))));
|
8773
8786
|
};
|
@@ -8775,10 +8788,10 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
8775
8788
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
8776
8789
|
|
8777
8790
|
// src/molecules/TagLabel/TagLabel.tsx
|
8778
|
-
import
|
8791
|
+
import React94 from "react";
|
8779
8792
|
var TagLabel = (_a) => {
|
8780
8793
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8781
|
-
return /* @__PURE__ */
|
8794
|
+
return /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8782
8795
|
className: tw("rounded-full text-white bg-primary-70", {
|
8783
8796
|
"py-2 px-4 typography-caption": !dense,
|
8784
8797
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8787,14 +8800,14 @@ var TagLabel = (_a) => {
|
|
8787
8800
|
};
|
8788
8801
|
|
8789
8802
|
// src/molecules/Textarea/Textarea.tsx
|
8790
|
-
import
|
8803
|
+
import React95, { useRef as useRef13, useState as useState12 } from "react";
|
8791
8804
|
import omit17 from "lodash/omit";
|
8792
8805
|
import toString2 from "lodash/toString";
|
8793
8806
|
import uniqueId10 from "lodash/uniqueId";
|
8794
|
-
var TextareaBase =
|
8807
|
+
var TextareaBase = React95.forwardRef(
|
8795
8808
|
(_a, ref) => {
|
8796
8809
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8797
|
-
return /* @__PURE__ */
|
8810
|
+
return /* @__PURE__ */ React95.createElement("textarea", __spreadProps(__spreadValues({
|
8798
8811
|
ref
|
8799
8812
|
}, props), {
|
8800
8813
|
readOnly,
|
@@ -8802,10 +8815,10 @@ var TextareaBase = React94.forwardRef(
|
|
8802
8815
|
}));
|
8803
8816
|
}
|
8804
8817
|
);
|
8805
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8818
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React95.createElement(Skeleton, {
|
8806
8819
|
height: 58
|
8807
8820
|
});
|
8808
|
-
var Textarea =
|
8821
|
+
var Textarea = React95.forwardRef((props, ref) => {
|
8809
8822
|
var _a, _b, _c;
|
8810
8823
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8811
8824
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
@@ -8813,12 +8826,12 @@ var Textarea = React94.forwardRef((props, ref) => {
|
|
8813
8826
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8814
8827
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8815
8828
|
const baseProps = omit17(props, Object.keys(labelControlProps));
|
8816
|
-
return /* @__PURE__ */
|
8829
|
+
return /* @__PURE__ */ React95.createElement(LabelControl, __spreadValues({
|
8817
8830
|
id: `${id.current}-label`,
|
8818
8831
|
htmlFor: id.current,
|
8819
8832
|
messageId: errorMessageId,
|
8820
8833
|
length: value !== void 0 ? toString2(value).length : void 0
|
8821
|
-
}, labelControlProps), /* @__PURE__ */
|
8834
|
+
}, labelControlProps), /* @__PURE__ */ React95.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8822
8835
|
ref
|
8823
8836
|
}, baseProps), errorProps), {
|
8824
8837
|
id: id.current,
|
@@ -8835,48 +8848,48 @@ var Textarea = React94.forwardRef((props, ref) => {
|
|
8835
8848
|
})));
|
8836
8849
|
});
|
8837
8850
|
Textarea.displayName = "Textarea";
|
8838
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
8851
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React95.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React95.createElement(TextareaBase.Skeleton, null));
|
8839
8852
|
Textarea.Skeleton = TextAreaSkeleton;
|
8840
8853
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
8841
8854
|
|
8842
8855
|
// src/molecules/Timeline/Timeline.tsx
|
8843
|
-
import
|
8856
|
+
import React97 from "react";
|
8844
8857
|
|
8845
8858
|
// src/atoms/Timeline/Timeline.tsx
|
8846
|
-
import
|
8859
|
+
import React96 from "react";
|
8847
8860
|
var Timeline = (_a) => {
|
8848
8861
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8849
|
-
return /* @__PURE__ */
|
8862
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8850
8863
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8851
8864
|
}));
|
8852
8865
|
};
|
8853
8866
|
var Content2 = (_a) => {
|
8854
8867
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8855
|
-
return /* @__PURE__ */
|
8868
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8856
8869
|
className: classNames(tw("pb-6"), className)
|
8857
8870
|
}));
|
8858
8871
|
};
|
8859
8872
|
var Separator2 = (_a) => {
|
8860
8873
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8861
|
-
return /* @__PURE__ */
|
8874
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8862
8875
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8863
8876
|
}));
|
8864
8877
|
};
|
8865
8878
|
var LineContainer = (_a) => {
|
8866
8879
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8867
|
-
return /* @__PURE__ */
|
8880
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8868
8881
|
className: classNames(tw("flex justify-center py-1"), className)
|
8869
8882
|
}));
|
8870
8883
|
};
|
8871
8884
|
var Line = (_a) => {
|
8872
8885
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8873
|
-
return /* @__PURE__ */
|
8886
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8874
8887
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8875
8888
|
}));
|
8876
8889
|
};
|
8877
8890
|
var Dot = (_a) => {
|
8878
8891
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8879
|
-
return /* @__PURE__ */
|
8892
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8880
8893
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8881
8894
|
}));
|
8882
8895
|
};
|
@@ -8891,52 +8904,52 @@ var import_error4 = __toESM(require_error());
|
|
8891
8904
|
var import_time = __toESM(require_time());
|
8892
8905
|
var import_warningSign4 = __toESM(require_warningSign());
|
8893
8906
|
var TimelineItem = () => null;
|
8894
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8907
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React97.createElement("div", null, React97.Children.map(children, (item) => {
|
8895
8908
|
if (!isComponentType(item, TimelineItem)) {
|
8896
8909
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8897
8910
|
} else {
|
8898
8911
|
const { props, key } = item;
|
8899
|
-
return /* @__PURE__ */
|
8912
|
+
return /* @__PURE__ */ React97.createElement(Timeline, {
|
8900
8913
|
key: key != null ? key : props.title
|
8901
|
-
}, /* @__PURE__ */
|
8914
|
+
}, /* @__PURE__ */ React97.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React97.createElement(Icon, {
|
8902
8915
|
icon: import_error4.default,
|
8903
8916
|
color: "error-30"
|
8904
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8917
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React97.createElement(Icon, {
|
8905
8918
|
icon: import_warningSign4.default,
|
8906
8919
|
color: "warning-30"
|
8907
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8920
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React97.createElement(Icon, {
|
8908
8921
|
icon: import_time.default,
|
8909
8922
|
color: "info-30"
|
8910
|
-
}) : /* @__PURE__ */
|
8923
|
+
}) : /* @__PURE__ */ React97.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React97.createElement(Typography2.Caption, {
|
8911
8924
|
color: "grey-50"
|
8912
|
-
}, props.title), /* @__PURE__ */
|
8925
|
+
}, props.title), /* @__PURE__ */ React97.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React97.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React97.createElement(Timeline.Content, null, /* @__PURE__ */ React97.createElement(Typography2.Small, null, props.children)));
|
8913
8926
|
}
|
8914
8927
|
}));
|
8915
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8928
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React97.createElement(Timeline, null, /* @__PURE__ */ React97.createElement(Timeline.Separator, null, /* @__PURE__ */ React97.createElement(Skeleton, {
|
8916
8929
|
width: 6,
|
8917
8930
|
height: 6,
|
8918
8931
|
rounded: true
|
8919
|
-
})), /* @__PURE__ */
|
8932
|
+
})), /* @__PURE__ */ React97.createElement(Skeleton, {
|
8920
8933
|
height: 12,
|
8921
8934
|
width: 120
|
8922
|
-
}), /* @__PURE__ */
|
8935
|
+
}), /* @__PURE__ */ React97.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React97.createElement(Skeleton, {
|
8923
8936
|
width: 2,
|
8924
8937
|
height: "100%"
|
8925
|
-
})), /* @__PURE__ */
|
8938
|
+
})), /* @__PURE__ */ React97.createElement(Timeline.Content, null, /* @__PURE__ */ React97.createElement(Box, {
|
8926
8939
|
display: "flex",
|
8927
8940
|
flexDirection: "column",
|
8928
8941
|
gap: "3"
|
8929
|
-
}, /* @__PURE__ */
|
8942
|
+
}, /* @__PURE__ */ React97.createElement(Skeleton, {
|
8930
8943
|
height: 32,
|
8931
8944
|
width: "100%"
|
8932
|
-
}), /* @__PURE__ */
|
8945
|
+
}), /* @__PURE__ */ React97.createElement(Skeleton, {
|
8933
8946
|
height: 32,
|
8934
8947
|
width: "73%"
|
8935
|
-
}), /* @__PURE__ */
|
8948
|
+
}), /* @__PURE__ */ React97.createElement(Skeleton, {
|
8936
8949
|
height: 32,
|
8937
8950
|
width: "80%"
|
8938
8951
|
}))));
|
8939
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8952
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React97.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React97.createElement(TimelineItemSkeleton, {
|
8940
8953
|
key
|
8941
8954
|
})));
|
8942
8955
|
Timeline2.Item = TimelineItem;
|
@@ -8944,9 +8957,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
8944
8957
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
8945
8958
|
|
8946
8959
|
// src/utils/table/useTableSelect.ts
|
8947
|
-
import
|
8960
|
+
import React98 from "react";
|
8948
8961
|
var useTableSelect = (data, { key }) => {
|
8949
|
-
const [selected, setSelected] =
|
8962
|
+
const [selected, setSelected] = React98.useState([]);
|
8950
8963
|
const allSelected = selected.length === data.length;
|
8951
8964
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8952
8965
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -8971,7 +8984,7 @@ var useTableSelect = (data, { key }) => {
|
|
8971
8984
|
};
|
8972
8985
|
|
8973
8986
|
// src/molecules/Pagination/usePagination.tsx
|
8974
|
-
import { useEffect as
|
8987
|
+
import { useEffect as useEffect9, useState as useState13 } from "react";
|
8975
8988
|
import clamp3 from "lodash/clamp";
|
8976
8989
|
var initialState = {
|
8977
8990
|
currentPage: 1,
|
@@ -8990,7 +9003,7 @@ var usePagination = (items, options) => {
|
|
8990
9003
|
setPageSize(pageSize2);
|
8991
9004
|
setCurrentPage(clamp3((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, newTotalPages));
|
8992
9005
|
};
|
8993
|
-
|
9006
|
+
useEffect9(() => {
|
8994
9007
|
setCurrentPage(clamp3((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, totalPages));
|
8995
9008
|
}, [items.length]);
|
8996
9009
|
return [
|