@parrot-co/parrot-ui 0.0.84 → 0.0.85
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/main.js +151 -75
- package/dist/main.js.map +1 -1
- package/dist/module.js +152 -76
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +16 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {jsx as $ilZGV$jsx, jsxs as $ilZGV$jsxs} from "react/jsx-runtime";
|
|
2
2
|
import $ilZGV$react, {forwardRef as $ilZGV$forwardRef, useCallback as $ilZGV$useCallback, createContext as $ilZGV$createContext, Children as $ilZGV$Children, useMemo as $ilZGV$useMemo, isValidElement as $ilZGV$isValidElement, useContext as $ilZGV$useContext, useRef as $ilZGV$useRef, useState as $ilZGV$useState, useEffect as $ilZGV$useEffect, cloneElement as $ilZGV$cloneElement} from "react";
|
|
3
3
|
import {useTextField as $ilZGV$useTextField, useLocale as $ilZGV$useLocale, useNumberField as $ilZGV$useNumberField, useToggleButton as $ilZGV$useToggleButton, useCheckbox as $ilZGV$useCheckbox, useCheckboxGroupItem as $ilZGV$useCheckboxGroupItem, useFocusRing as $ilZGV$useFocusRing, VisuallyHidden as $ilZGV$VisuallyHidden, useCheckboxGroup as $ilZGV$useCheckboxGroup, useRadio as $ilZGV$useRadio, useRadioGroup as $ilZGV$useRadioGroup, useMenuTrigger as $ilZGV$useMenuTrigger, usePress as $ilZGV$usePress, HiddenSelect as $ilZGV$HiddenSelect, useListBox as $ilZGV$useListBox, useOption as $ilZGV$useOption, useListBoxSection as $ilZGV$useListBoxSection, usePopover as $ilZGV$usePopover, Overlay as $ilZGV$Overlay, useCalendar as $ilZGV$useCalendar, useCalendarGrid as $ilZGV$useCalendarGrid, useCalendarCell as $ilZGV$useCalendarCell, mergeProps as $ilZGV$mergeProps, useDatePicker as $ilZGV$useDatePicker, useDateField as $ilZGV$useDateField, useDateSegment as $ilZGV$useDateSegment, useDrop as $ilZGV$useDrop, useProgressBar as $ilZGV$useProgressBar, useTabList as $ilZGV$useTabList, useTab as $ilZGV$useTab, useTabPanel as $ilZGV$useTabPanel, useHover as $ilZGV$useHover, useSwitch as $ilZGV$useSwitch, useModalOverlay as $ilZGV$useModalOverlay, useDialog as $ilZGV$useDialog} from "react-aria";
|
|
4
|
-
import {HiMinus as $ilZGV$HiMinus, HiPlus as $ilZGV$HiPlus, HiX as $ilZGV$HiX, HiSelector as $ilZGV$HiSelector, HiChevronLeft as $ilZGV$HiChevronLeft, HiChevronRight as $ilZGV$HiChevronRight, HiOutlineCalendar as $ilZGV$HiOutlineCalendar, HiOutlineDocumentAdd as $ilZGV$HiOutlineDocumentAdd, HiOutlineCheckCircle as $ilZGV$HiOutlineCheckCircle, HiOutlineTrash as $ilZGV$HiOutlineTrash, HiOutlineExclamationCircle as $ilZGV$HiOutlineExclamationCircle, HiOutlineRefresh as $ilZGV$HiOutlineRefresh, HiOutlinePaperClip as $ilZGV$HiOutlinePaperClip,
|
|
4
|
+
import {HiMinus as $ilZGV$HiMinus, HiPlus as $ilZGV$HiPlus, HiX as $ilZGV$HiX, HiSelector as $ilZGV$HiSelector, HiCheck as $ilZGV$HiCheck, HiChevronLeft as $ilZGV$HiChevronLeft, HiChevronRight as $ilZGV$HiChevronRight, HiOutlineCalendar as $ilZGV$HiOutlineCalendar, HiOutlineDocumentAdd as $ilZGV$HiOutlineDocumentAdd, HiOutlineCheckCircle as $ilZGV$HiOutlineCheckCircle, HiOutlineTrash as $ilZGV$HiOutlineTrash, HiOutlineExclamationCircle as $ilZGV$HiOutlineExclamationCircle, HiOutlineRefresh as $ilZGV$HiOutlineRefresh, HiOutlinePaperClip as $ilZGV$HiOutlinePaperClip, HiOutlineGlobe as $ilZGV$HiOutlineGlobe, HiOutlineCurrencyDollar as $ilZGV$HiOutlineCurrencyDollar, HiOutlineGlobeAlt as $ilZGV$HiOutlineGlobeAlt, HiOutlineArchive as $ilZGV$HiOutlineArchive, HiOutlineAnnotation as $ilZGV$HiOutlineAnnotation, HiOutlineFire as $ilZGV$HiOutlineFire, HiOutlineBadgeCheck as $ilZGV$HiOutlineBadgeCheck, HiOutlineSparkles as $ilZGV$HiOutlineSparkles, HiOutlineSpeakerphone as $ilZGV$HiOutlineSpeakerphone, HiOutlineCreditCard as $ilZGV$HiOutlineCreditCard, HiOutlineHeart as $ilZGV$HiOutlineHeart, HiOutlineLocationMarker as $ilZGV$HiOutlineLocationMarker, HiOutlineCursorClick as $ilZGV$HiOutlineCursorClick, HiOutlineLightningBolt as $ilZGV$HiOutlineLightningBolt, HiOutlineDocumentDownload as $ilZGV$HiOutlineDocumentDownload, HiOutlineTag as $ilZGV$HiOutlineTag, HiOutlineAtSymbol as $ilZGV$HiOutlineAtSymbol, HiOutlineUserCircle as $ilZGV$HiOutlineUserCircle, HiOutlineTerminal as $ilZGV$HiOutlineTerminal, HiOutlineMoon as $ilZGV$HiOutlineMoon} from "react-icons/hi";
|
|
5
5
|
import {useNumberFieldState as $ilZGV$useNumberFieldState, useToggleState as $ilZGV$useToggleState, useCheckboxGroupState as $ilZGV$useCheckboxGroupState, useRadioGroupState as $ilZGV$useRadioGroupState, useMenuTriggerState as $ilZGV$useMenuTriggerState, useListState as $ilZGV$useListState, Item as $ilZGV$Item, Section as $ilZGV$Section, useCalendarState as $ilZGV$useCalendarState, useDatePickerState as $ilZGV$useDatePickerState, useDateFieldState as $ilZGV$useDateFieldState, useTabListState as $ilZGV$useTabListState, useOverlayTriggerState as $ilZGV$useOverlayTriggerState} from "react-stately";
|
|
6
6
|
import {createCalendar as $ilZGV$createCalendar, endOfMonth as $ilZGV$endOfMonth, getWeeksInMonth as $ilZGV$getWeeksInMonth, isSameMonth as $ilZGV$isSameMonth, CalendarDate as $ilZGV$CalendarDate} from "@internationalized/date";
|
|
7
7
|
|
|
@@ -158,15 +158,16 @@ $7f9359c321db931d$export$f51f4c4ede09e011.displayName = "Flex";
|
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
const $ad6bb3d9e1e05700$export$5f1af8db9871e1d6 = (props)=>{
|
|
161
|
-
const { size: size , weight: weight , color: color = "gray" , variant: variant = "default" , highlight: highlight , align: align , lineHeight: lineHeight , underline: underline , italic: italic , as:
|
|
162
|
-
return /*#__PURE__*/ (0, $ilZGV$jsx)(
|
|
161
|
+
const { textCase: textCase , size: size , weight: weight , color: color = "gray" , variant: variant = "default" , highlight: highlight , align: align , lineHeight: lineHeight , underline: underline , italic: italic , as: Comp = "span" , textRef: textRef , className: className , ...rest } = props;
|
|
162
|
+
return /*#__PURE__*/ (0, $ilZGV$jsx)(Comp, {
|
|
163
163
|
className: (0, $c4c58f2604e361a3$export$a274e22fb40f762e)({
|
|
164
164
|
[`text-highlight`]: !!highlight,
|
|
165
165
|
"p-text": true,
|
|
166
166
|
[`text-size-${size}`]: !!size,
|
|
167
167
|
[`text-weight-${weight}`]: !!weight,
|
|
168
|
-
[`text-
|
|
168
|
+
[`text-align-${align}`]: !!align,
|
|
169
169
|
[`text-line-height-${lineHeight}`]: !!lineHeight,
|
|
170
|
+
[`text-transform-${textCase}`]: !!textCase,
|
|
170
171
|
[`${className}`]: !!className
|
|
171
172
|
}),
|
|
172
173
|
"data-underline": underline,
|
|
@@ -561,7 +562,8 @@ const $c104f9e833419de4$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $ilZGV$react
|
|
|
561
562
|
prepend,
|
|
562
563
|
/*#__PURE__*/ (0, $ilZGV$jsx)("span", {
|
|
563
564
|
style: {
|
|
564
|
-
padding: isIconButton ? undefined : "0 6px"
|
|
565
|
+
padding: isIconButton ? undefined : "0 6px",
|
|
566
|
+
lineHeight: 0
|
|
565
567
|
},
|
|
566
568
|
children: children
|
|
567
569
|
}),
|
|
@@ -842,12 +844,12 @@ const $775c2fb4fd112efa$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $ilZGV$react
|
|
|
842
844
|
className: "fake-checkbox",
|
|
843
845
|
"data-focused": isFocusVisible,
|
|
844
846
|
"aria-hidden": "true",
|
|
845
|
-
"data-checked": isSelected,
|
|
847
|
+
"data-checked": isSelected && !props.isIndeterminate,
|
|
846
848
|
"data-indeterminate": props.isIndeterminate,
|
|
847
849
|
"data-size": resolvedSize,
|
|
848
850
|
"data-appearance": resolvedAppearance,
|
|
849
851
|
children: [
|
|
850
|
-
isSelected && /*#__PURE__*/ (0, $ilZGV$jsx)("svg", {
|
|
852
|
+
isSelected && !props.isIndeterminate && /*#__PURE__*/ (0, $ilZGV$jsx)("svg", {
|
|
851
853
|
stroke: "white",
|
|
852
854
|
width: "0.75rem",
|
|
853
855
|
height: "0.75rem",
|
|
@@ -865,7 +867,7 @@ const $775c2fb4fd112efa$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $ilZGV$react
|
|
|
865
867
|
}),
|
|
866
868
|
props.isIndeterminate && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $6cd538350b429e7f$export$e71c4d32a2263218), {
|
|
867
869
|
style: {
|
|
868
|
-
background: "
|
|
870
|
+
background: "var(--color-12)",
|
|
869
871
|
width: "70%",
|
|
870
872
|
height: 2,
|
|
871
873
|
borderRadius: 4
|
|
@@ -1056,7 +1058,26 @@ function $11794b81e576e85c$export$3d7d0414f6db67e7({ children: children , render
|
|
|
1056
1058
|
|
|
1057
1059
|
|
|
1058
1060
|
|
|
1059
|
-
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
const $33ed584ab3798ace$var$ListBoxContext = /*#__PURE__*/ $ilZGV$createContext(null);
|
|
1065
|
+
function $33ed584ab3798ace$export$1e60abce570c2b01(props) {
|
|
1066
|
+
return /*#__PURE__*/ (0, $ilZGV$jsx)($33ed584ab3798ace$var$ListBoxContext.Provider, {
|
|
1067
|
+
value: {
|
|
1068
|
+
props: props
|
|
1069
|
+
},
|
|
1070
|
+
children: props.children
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
function $33ed584ab3798ace$export$961f16f221737ce2() {
|
|
1074
|
+
const context = $ilZGV$useContext($33ed584ab3798ace$var$ListBoxContext);
|
|
1075
|
+
if (!context) throw new Error("ListBox components must be rendered within the ListBoxProvider");
|
|
1076
|
+
return context;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
function $0edad8c8c01688ea$export$41f133550aa26f48({ state: state , color: color , width: width = 300 , showSelectedMarker: showSelectedMarker = true , ...props }) {
|
|
1060
1081
|
const internalState = (0, $ilZGV$useListState)({
|
|
1061
1082
|
...props,
|
|
1062
1083
|
children: (0, $11794b81e576e85c$export$3d7d0414f6db67e7)(props)
|
|
@@ -1067,23 +1088,18 @@ function $0edad8c8c01688ea$export$41f133550aa26f48({ state: state , color: color
|
|
|
1067
1088
|
const options = [
|
|
1068
1089
|
...listState.collection
|
|
1069
1090
|
];
|
|
1070
|
-
return /*#__PURE__*/ (0, $ilZGV$
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
as: "div",
|
|
1083
|
-
...labelProps,
|
|
1084
|
-
children: props.label
|
|
1085
|
-
}),
|
|
1086
|
-
/*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
1091
|
+
return /*#__PURE__*/ (0, $ilZGV$jsx)((0, $33ed584ab3798ace$export$1e60abce570c2b01), {
|
|
1092
|
+
...props,
|
|
1093
|
+
showSelectedMarker: showSelectedMarker,
|
|
1094
|
+
children: /*#__PURE__*/ (0, $ilZGV$jsx)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
1095
|
+
"data-color": color,
|
|
1096
|
+
style: {
|
|
1097
|
+
width: width,
|
|
1098
|
+
minWidth: 300
|
|
1099
|
+
},
|
|
1100
|
+
stack: true,
|
|
1101
|
+
gap: "md",
|
|
1102
|
+
children: /*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
1087
1103
|
as: "ul",
|
|
1088
1104
|
stack: true,
|
|
1089
1105
|
gap: "none",
|
|
@@ -1115,7 +1131,7 @@ function $0edad8c8c01688ea$export$41f133550aa26f48({ state: state , color: color
|
|
|
1115
1131
|
})
|
|
1116
1132
|
]
|
|
1117
1133
|
})
|
|
1118
|
-
|
|
1134
|
+
})
|
|
1119
1135
|
});
|
|
1120
1136
|
}
|
|
1121
1137
|
function $0edad8c8c01688ea$var$ListOption({ state: state , item: item }) {
|
|
@@ -1123,7 +1139,8 @@ function $0edad8c8c01688ea$var$ListOption({ state: state , item: item }) {
|
|
|
1123
1139
|
const { optionProps: optionProps , isDisabled: isDisabled , isFocusVisible: isFocusVisible , isFocused: isFocused , isPressed: isPressed , isSelected: isSelected } = (0, $ilZGV$useOption)({
|
|
1124
1140
|
key: item.key
|
|
1125
1141
|
}, state, optionRef);
|
|
1126
|
-
|
|
1142
|
+
const listBoxContext = (0, $33ed584ab3798ace$export$961f16f221737ce2)();
|
|
1143
|
+
return /*#__PURE__*/ (0, $ilZGV$jsxs)("li", {
|
|
1127
1144
|
className: "list-option",
|
|
1128
1145
|
"data-disabled": isDisabled,
|
|
1129
1146
|
"data-focus-visible": isFocusVisible,
|
|
@@ -1135,7 +1152,12 @@ function $0edad8c8c01688ea$var$ListOption({ state: state , item: item }) {
|
|
|
1135
1152
|
"textValue"
|
|
1136
1153
|
]),
|
|
1137
1154
|
ref: optionRef,
|
|
1138
|
-
children:
|
|
1155
|
+
children: [
|
|
1156
|
+
item.rendered,
|
|
1157
|
+
isSelected && listBoxContext.props.showSelectedMarker && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $ilZGV$HiCheck), {
|
|
1158
|
+
className: "selected-marker"
|
|
1159
|
+
})
|
|
1160
|
+
]
|
|
1139
1161
|
});
|
|
1140
1162
|
}
|
|
1141
1163
|
function $0edad8c8c01688ea$var$ListSection({ state: state , section: section }) {
|
|
@@ -1143,40 +1165,50 @@ function $0edad8c8c01688ea$var$ListSection({ state: state , section: section })
|
|
|
1143
1165
|
heading: section?.rendered,
|
|
1144
1166
|
"aria-label": section["aria-label"]
|
|
1145
1167
|
});
|
|
1168
|
+
const listBoxContext = (0, $33ed584ab3798ace$export$961f16f221737ce2)();
|
|
1146
1169
|
function getChildren() {
|
|
1147
1170
|
if (state.collection.getChildren) return [
|
|
1148
1171
|
...state.collection.getChildren(section.key)
|
|
1149
1172
|
];
|
|
1150
1173
|
return [];
|
|
1151
1174
|
}
|
|
1152
|
-
return /*#__PURE__*/ (0, $ilZGV$
|
|
1175
|
+
return /*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
1153
1176
|
gap: "sm",
|
|
1154
1177
|
stack: true,
|
|
1155
1178
|
className: "list-section",
|
|
1156
|
-
children:
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
}
|
|
1179
|
+
children: [
|
|
1180
|
+
section.key !== state.collection.getFirstKey() && listBoxContext.props.showSeparator && /*#__PURE__*/ (0, $ilZGV$jsx)("li", {
|
|
1181
|
+
className: "list-separator"
|
|
1182
|
+
}),
|
|
1183
|
+
/*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
1184
|
+
gap: "none",
|
|
1185
|
+
stack: true,
|
|
1186
|
+
as: "li",
|
|
1187
|
+
...itemProps,
|
|
1188
|
+
children: [
|
|
1189
|
+
section.rendered && /*#__PURE__*/ (0, $ilZGV$jsx)("div", {
|
|
1190
|
+
className: "list-section-header",
|
|
1191
|
+
children: /*#__PURE__*/ (0, $ilZGV$jsx)((0, $ad6bb3d9e1e05700$export$5f1af8db9871e1d6), {
|
|
1192
|
+
weight: "regular",
|
|
1193
|
+
size: "xs",
|
|
1194
|
+
as: "div",
|
|
1195
|
+
variant: "light",
|
|
1196
|
+
...headingProps,
|
|
1197
|
+
children: section.rendered
|
|
1198
|
+
})
|
|
1199
|
+
}),
|
|
1200
|
+
/*#__PURE__*/ (0, $ilZGV$jsx)("ul", {
|
|
1201
|
+
...groupProps,
|
|
1202
|
+
children: getChildren().map((node)=>{
|
|
1203
|
+
return /*#__PURE__*/ (0, $ilZGV$jsx)($0edad8c8c01688ea$var$ListOption, {
|
|
1204
|
+
item: node,
|
|
1205
|
+
state: state
|
|
1206
|
+
}, node.key);
|
|
1207
|
+
})
|
|
1176
1208
|
})
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1209
|
+
]
|
|
1210
|
+
})
|
|
1211
|
+
]
|
|
1180
1212
|
});
|
|
1181
1213
|
}
|
|
1182
1214
|
const $0edad8c8c01688ea$export$36d18380658d5d20 = (0, $ilZGV$Item);
|
|
@@ -1314,16 +1346,39 @@ function $b107431cb75f5c0b$export$5b6b19405a83ff9d({ state: state , children: ch
|
|
|
1314
1346
|
|
|
1315
1347
|
|
|
1316
1348
|
|
|
1317
|
-
|
|
1349
|
+
|
|
1350
|
+
function $0d71c1f2b7db4b85$export$ef9b1a59e592288f({ label: label , selectionMode: selectionMode = "single" , appearance: appearance = "outline" , append: append , prepend: prepend , renderValue: renderValue , color: color = "gray" , error: error , description: description , size: size = "sm" , shape: shape = "rounded" , listBoxColor: listBoxColor , className: className , value: value , defaultValue: defaultValue , onChange: onChange , ...props }) {
|
|
1351
|
+
const isMultiple = selectionMode === "multiple";
|
|
1352
|
+
function getValue(value) {
|
|
1353
|
+
if (!value) return null;
|
|
1354
|
+
if (selectionMode === "single") return [
|
|
1355
|
+
value
|
|
1356
|
+
];
|
|
1357
|
+
if (isMultiple && !(0, $aff4c89355ace90b$export$43bee75e5e14138e)(value)) throw new Error("Select: value must be an array when selectionMode is multiple");
|
|
1358
|
+
return value;
|
|
1359
|
+
}
|
|
1360
|
+
function onSelectionChange(selectedKeys) {
|
|
1361
|
+
onChange?.({
|
|
1362
|
+
target: {
|
|
1363
|
+
value: isMultiple ? selectedKeys : selectedKeys[0],
|
|
1364
|
+
name: props.name
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1318
1368
|
const space = (0, $a0b7975efdcbad3c$export$450c36e0b0e62ccd)();
|
|
1319
1369
|
const [isFocused, setIsFocused] = $ilZGV$useState(false);
|
|
1320
1370
|
const triggerState = (0, $ilZGV$useMenuTriggerState)({});
|
|
1321
1371
|
const listState = (0, $ilZGV$useListState)({
|
|
1322
1372
|
...props,
|
|
1373
|
+
selectedKeys: getValue(value),
|
|
1374
|
+
defaultSelectedKeys: getValue(defaultValue),
|
|
1323
1375
|
selectionMode: selectionMode,
|
|
1324
1376
|
children: (0, $11794b81e576e85c$export$3d7d0414f6db67e7)(props),
|
|
1325
|
-
onSelectionChange () {
|
|
1326
|
-
|
|
1377
|
+
onSelectionChange (keys) {
|
|
1378
|
+
onSelectionChange([
|
|
1379
|
+
...keys
|
|
1380
|
+
]);
|
|
1381
|
+
if (!isMultiple) triggerState.close();
|
|
1327
1382
|
}
|
|
1328
1383
|
});
|
|
1329
1384
|
const triggerRef = $ilZGV$useRef(null);
|
|
@@ -1334,7 +1389,6 @@ function $0d71c1f2b7db4b85$export$ef9b1a59e592288f({ label: label , selectionMod
|
|
|
1334
1389
|
isDisabled: false
|
|
1335
1390
|
}, triggerState, triggerRef);
|
|
1336
1391
|
const { pressProps: triggerProps } = (0, $ilZGV$usePress)(menuTriggerProps);
|
|
1337
|
-
const isMultiple = selectionMode === "multiple";
|
|
1338
1392
|
const selectedItems = [
|
|
1339
1393
|
...listState.selectionManager.selectedKeys
|
|
1340
1394
|
].map((item)=>listState.collection.getItem(item));
|
|
@@ -1433,8 +1487,11 @@ function $0d71c1f2b7db4b85$export$ef9b1a59e592288f({ label: label , selectionMod
|
|
|
1433
1487
|
triggerRef: triggerRef,
|
|
1434
1488
|
state: triggerState,
|
|
1435
1489
|
children: /*#__PURE__*/ (0, $ilZGV$jsx)((0, $0edad8c8c01688ea$export$41f133550aa26f48), {
|
|
1490
|
+
label: label,
|
|
1491
|
+
showSeparator: props.showSeparator,
|
|
1492
|
+
showSelectedMarker: props.showSelectedMarker,
|
|
1436
1493
|
width: triggerRef.current?.getBoundingClientRect().width,
|
|
1437
|
-
color: listBoxColor ??
|
|
1494
|
+
color: listBoxColor ?? "gray",
|
|
1438
1495
|
shouldFocusOnHover: true,
|
|
1439
1496
|
state: listState,
|
|
1440
1497
|
...props
|
|
@@ -2600,10 +2657,14 @@ function $9e2f19f5522a9ed4$export$e6a97ba2cae5bb94({ items: items , render: rend
|
|
|
2600
2657
|
|
|
2601
2658
|
|
|
2602
2659
|
|
|
2660
|
+
|
|
2603
2661
|
function $27dfef5c84f0ece2$export$c6fdb837b070b4ff({ state: state , children: children , ...props }) {
|
|
2604
2662
|
const modalRef = $ilZGV$useRef(null);
|
|
2605
2663
|
const { modalProps: modalProps , underlayProps: underlayProps } = (0, $ilZGV$useModalOverlay)(props, state, modalRef);
|
|
2606
2664
|
if (!state.isOpen) return null;
|
|
2665
|
+
// bring back aria-overlay when you find a way for theme provider to affect
|
|
2666
|
+
// portalled elements
|
|
2667
|
+
// aria-overlay handles the focus trap
|
|
2607
2668
|
return /*#__PURE__*/ (0, $ilZGV$jsx)("div", {
|
|
2608
2669
|
className: "modal-underlay parrot-theme",
|
|
2609
2670
|
...underlayProps,
|
|
@@ -2615,10 +2676,11 @@ function $27dfef5c84f0ece2$export$c6fdb837b070b4ff({ state: state , children: ch
|
|
|
2615
2676
|
})
|
|
2616
2677
|
});
|
|
2617
2678
|
}
|
|
2618
|
-
function $27dfef5c84f0ece2$var$Dialog({ width: width = 400 , title: title , onCancel: onCancel , onConfirm: onConfirm , confirmLabel: confirmLabel = "Confirm" , cancelLabel: cancelLabel = "Cancel" , description: description , children: children , state: state , confirmButtonProps: confirmButtonProps , cancelButtonProps: cancelButtonProps , variant: variant = "modal"
|
|
2679
|
+
function $27dfef5c84f0ece2$var$Dialog({ width: width = 400 , title: title , onCancel: onCancel , onConfirm: onConfirm , confirmLabel: confirmLabel = "Confirm" , cancelLabel: cancelLabel = "Cancel" , description: description , children: children , state: state , confirmButtonProps: confirmButtonProps , cancelButtonProps: cancelButtonProps , variant: variant = "modal" , showCloseButton: showCloseButton = true , ...props }) {
|
|
2619
2680
|
const dialogRef = $ilZGV$useRef(null);
|
|
2620
2681
|
const { dialogProps: dialogProps , titleProps: titleProps } = (0, $ilZGV$useDialog)({
|
|
2621
|
-
role: "
|
|
2682
|
+
role: "dialog",
|
|
2683
|
+
...props
|
|
2622
2684
|
}, dialogRef);
|
|
2623
2685
|
return /*#__PURE__*/ (0, $ilZGV$jsxs)("div", {
|
|
2624
2686
|
className: "modal-content",
|
|
@@ -2633,24 +2695,38 @@ function $27dfef5c84f0ece2$var$Dialog({ width: width = 400 , title: title , onCa
|
|
|
2633
2695
|
stack: true,
|
|
2634
2696
|
children: [
|
|
2635
2697
|
/*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
2636
|
-
|
|
2637
|
-
gap: "
|
|
2698
|
+
justify: "space-between",
|
|
2699
|
+
gap: "2xl",
|
|
2638
2700
|
className: "modal-head",
|
|
2639
2701
|
children: [
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2702
|
+
/*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
|
|
2703
|
+
stack: true,
|
|
2704
|
+
gap: "3xs",
|
|
2705
|
+
children: [
|
|
2706
|
+
title && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $ad6bb3d9e1e05700$export$5f1af8db9871e1d6), {
|
|
2707
|
+
weight: "medium",
|
|
2708
|
+
size: "md",
|
|
2709
|
+
color: "gray",
|
|
2710
|
+
...titleProps,
|
|
2711
|
+
as: "div",
|
|
2712
|
+
children: title
|
|
2713
|
+
}),
|
|
2714
|
+
description && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $ad6bb3d9e1e05700$export$5f1af8db9871e1d6), {
|
|
2715
|
+
lineHeight: "base",
|
|
2716
|
+
size: "xs",
|
|
2717
|
+
variant: "light",
|
|
2718
|
+
as: "div",
|
|
2719
|
+
children: description
|
|
2720
|
+
})
|
|
2721
|
+
]
|
|
2647
2722
|
}),
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2723
|
+
props.isDismissable && showCloseButton && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $e588944490abcca5$export$c25acd513dcc8062), {
|
|
2724
|
+
onPress: state.close,
|
|
2725
|
+
variant: "ghost",
|
|
2726
|
+
size: "sm",
|
|
2727
|
+
children: /*#__PURE__*/ (0, $ilZGV$jsx)((0, $ilZGV$HiX), {
|
|
2728
|
+
size: 18
|
|
2729
|
+
})
|
|
2654
2730
|
})
|
|
2655
2731
|
]
|
|
2656
2732
|
}),
|
|
@@ -2667,10 +2743,10 @@ function $27dfef5c84f0ece2$var$Dialog({ width: width = 400 , title: title , onCa
|
|
|
2667
2743
|
stretchX: true,
|
|
2668
2744
|
children: [
|
|
2669
2745
|
onCancel && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $c104f9e833419de4$export$353f5b6fc5456de1), {
|
|
2670
|
-
...cancelButtonProps,
|
|
2671
2746
|
onPress: state.close,
|
|
2672
2747
|
variant: "outline",
|
|
2673
2748
|
color: "gray",
|
|
2749
|
+
...cancelButtonProps,
|
|
2674
2750
|
children: cancelLabel
|
|
2675
2751
|
}),
|
|
2676
2752
|
onConfirm && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $c104f9e833419de4$export$353f5b6fc5456de1), {
|