@parrot-co/parrot-ui 0.0.82 → 0.0.83

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/module.js CHANGED
@@ -1,6 +1,6 @@
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
- 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, 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";
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
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, HiCheck as $ilZGV$HiCheck, 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";
@@ -1036,24 +1036,27 @@ function $11794b81e576e85c$export$3d7d0414f6db67e7({ children: children , render
1036
1036
  if (hasChildren) return children;
1037
1037
  if (items) // eslint-disable-next-line react/display-name
1038
1038
  return (item)=>{
1039
- const label = item?.[labelKey ?? "label"] ?? renderOption?.(item);
1039
+ const label = item?.[labelKey ?? "label"];
1040
1040
  const value = item?.[valueKey ?? "id"];
1041
1041
  const sectionChildren = item?.[sectionKey ?? "children"] ?? [];
1042
1042
  if (item?.[sectionKey]) return /*#__PURE__*/ (0, $ilZGV$jsx)((0, $0edad8c8c01688ea$export$6e2c8f0811a474ce), {
1043
1043
  items: sectionChildren,
1044
1044
  title: getSectionLabel?.(item),
1045
1045
  children: (item)=>/*#__PURE__*/ (0, $ilZGV$jsx)((0, $0edad8c8c01688ea$export$36d18380658d5d20), {
1046
+ textValue: item?.[labelKey ?? "label"],
1046
1047
  children: item?.[labelKey ?? "label"] ?? renderOption?.(item)
1047
1048
  }, item?.[valueKey ?? "id"])
1048
1049
  }, value);
1049
1050
  return /*#__PURE__*/ (0, $ilZGV$jsx)((0, $0edad8c8c01688ea$export$36d18380658d5d20), {
1050
- children: label ?? renderOption?.(item)
1051
+ textValue: label,
1052
+ children: renderOption?.(item) ?? label
1051
1053
  }, item?.[valueKey ?? "id"]);
1052
1054
  };
1053
1055
  }
1054
1056
 
1055
1057
 
1056
- function $0edad8c8c01688ea$export$41f133550aa26f48({ state: state , color: color , ...props }) {
1058
+
1059
+ function $0edad8c8c01688ea$export$41f133550aa26f48({ state: state , color: color , width: width = 300 , ...props }) {
1057
1060
  const internalState = (0, $ilZGV$useListState)({
1058
1061
  ...props,
1059
1062
  children: (0, $11794b81e576e85c$export$3d7d0414f6db67e7)(props)
@@ -1067,7 +1070,8 @@ function $0edad8c8c01688ea$export$41f133550aa26f48({ state: state , color: color
1067
1070
  return /*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
1068
1071
  "data-color": color,
1069
1072
  style: {
1070
- width: 400
1073
+ width: width,
1074
+ minWidth: 300
1071
1075
  },
1072
1076
  stack: true,
1073
1077
  gap: "md",
@@ -1127,7 +1131,9 @@ function $0edad8c8c01688ea$var$ListOption({ state: state , item: item }) {
1127
1131
  "data-pressed": isPressed,
1128
1132
  "data-selected": isSelected,
1129
1133
  ...optionProps,
1130
- ...item.props,
1134
+ ...(0, $78326c047a4ec4ce$export$30a06c8d3562193f)(item.props, [
1135
+ "textValue"
1136
+ ]),
1131
1137
  ref: optionRef,
1132
1138
  children: item.rendered
1133
1139
  });
@@ -1221,6 +1227,10 @@ const $27c8d3e417f30271$export$b4e0e71242920c6a = {
1221
1227
  pill: "full",
1222
1228
  rounded: undefined
1223
1229
  };
1230
+ function $27c8d3e417f30271$var$ps(styles) {
1231
+ // 1. iterate over the keys of the styles object
1232
+ // 2. for each key, check is is valid css property
1233
+ }
1224
1234
 
1225
1235
 
1226
1236
  function $7a4e1d1fedc396c7$export$d41d9ab3de2def3d(text) {
@@ -1279,11 +1289,10 @@ $ee32300ad59b8528$export$3288d34c523a1192.displayName = "Tag";
1279
1289
  function $b107431cb75f5c0b$export$5b6b19405a83ff9d({ state: state , children: children , ...props }) {
1280
1290
  const popoverRef = $ilZGV$useRef(null);
1281
1291
  const theme = (0, $362781724bb4213a$export$93d4e7f90805808f)();
1282
- const { popoverProps: popoverProps , underlayProps: underlayProps , placement: placement } = (0, $ilZGV$usePopover)({
1292
+ const { popoverProps: popoverProps , underlayProps: underlayProps } = (0, $ilZGV$usePopover)({
1283
1293
  ...props,
1284
1294
  popoverRef: popoverRef
1285
1295
  }, state);
1286
- console.log(popoverProps, placement);
1287
1296
  return /*#__PURE__*/ (0, $ilZGV$jsxs)((0, $ilZGV$Overlay), {
1288
1297
  children: [
1289
1298
  /*#__PURE__*/ (0, $ilZGV$jsx)("div", {
@@ -1304,7 +1313,10 @@ function $b107431cb75f5c0b$export$5b6b19405a83ff9d({ state: state , children: ch
1304
1313
 
1305
1314
 
1306
1315
 
1307
- 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" , ...props }) {
1316
+
1317
+ 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 , ...props }) {
1318
+ const space = (0, $a0b7975efdcbad3c$export$450c36e0b0e62ccd)();
1319
+ const [isFocused, setIsFocused] = $ilZGV$useState(false);
1308
1320
  const triggerState = (0, $ilZGV$useMenuTriggerState)({});
1309
1321
  const listState = (0, $ilZGV$useListState)({
1310
1322
  ...props,
@@ -1351,31 +1363,56 @@ function $0d71c1f2b7db4b85$export$ef9b1a59e592288f({ label: label , selectionMod
1351
1363
  variant: "default",
1352
1364
  color: color,
1353
1365
  className: "single-value",
1354
- children: selectedItems[0]?.rendered
1366
+ children: renderValue?.(selectedItems[0]?.value) ?? selectedItems[0]?.value[props.labelKey ?? "label"]
1355
1367
  });
1356
1368
  }
1357
1369
  return /*#__PURE__*/ (0, $ilZGV$jsxs)((0, $6cd538350b429e7f$export$e71c4d32a2263218), {
1370
+ as: "span",
1371
+ position: "relative",
1358
1372
  stretchX: true,
1359
1373
  children: [
1374
+ selectionMode === "single" && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $ilZGV$HiddenSelect), {
1375
+ triggerRef: triggerRef,
1376
+ label: label,
1377
+ name: props.name,
1378
+ state: {
1379
+ selectedItem: selectedItems[0],
1380
+ selectedKey: selectedItems[0]?.key,
1381
+ setSelectedKey: (key)=>listState.selectionManager.setSelectedKeys([
1382
+ key
1383
+ ]),
1384
+ isFocused: isFocused,
1385
+ setFocused: setIsFocused,
1386
+ ...listState,
1387
+ ...triggerState
1388
+ },
1389
+ isDisabled: props.isDisabled
1390
+ }),
1360
1391
  /*#__PURE__*/ (0, $ilZGV$jsxs)((0, $7f9359c321db931d$export$f51f4c4ede09e011), {
1361
1392
  "data-radius": getRadius(),
1362
1393
  gap: "2xs",
1363
1394
  stack: true,
1364
- className: "p-input-group",
1395
+ className: (0, $c4c58f2604e361a3$export$a274e22fb40f762e)({
1396
+ [`${space.compactItemWrapperAdjust}`]: true,
1397
+ "p-input-group": true,
1398
+ [`${className}`]: !!className
1399
+ }),
1365
1400
  "data-size": size,
1366
1401
  "data-color": color,
1367
1402
  children: [
1368
- /*#__PURE__*/ (0, $ilZGV$jsx)((0, $d0e59e72d7236fb2$export$2e2bcd8739ae039), {
1403
+ label && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $d0e59e72d7236fb2$export$2e2bcd8739ae039), {
1369
1404
  children: label
1370
1405
  }),
1371
1406
  /*#__PURE__*/ (0, $ilZGV$jsxs)("div", {
1407
+ "data-selection-mode": selectionMode,
1372
1408
  tabIndex: 0,
1373
1409
  role: "button",
1374
1410
  ref: triggerRef,
1375
1411
  color: "gray",
1376
1412
  className: (0, $c4c58f2604e361a3$export$a274e22fb40f762e)({
1377
1413
  "p-input": true,
1378
- "p-select": true
1414
+ "p-select": true,
1415
+ ...space.classNames
1379
1416
  }),
1380
1417
  "data-appearance": appearance,
1381
1418
  ...triggerProps,
@@ -1390,12 +1427,14 @@ function $0d71c1f2b7db4b85$export$ef9b1a59e592288f({ label: label , selectionMod
1390
1427
  ]
1391
1428
  }),
1392
1429
  triggerState.isOpen && /*#__PURE__*/ (0, $ilZGV$jsx)((0, $b107431cb75f5c0b$export$5b6b19405a83ff9d), {
1430
+ placement: "bottom start",
1393
1431
  offset: 4,
1394
1432
  shouldUpdatePosition: true,
1395
1433
  triggerRef: triggerRef,
1396
1434
  state: triggerState,
1397
1435
  children: /*#__PURE__*/ (0, $ilZGV$jsx)((0, $0edad8c8c01688ea$export$41f133550aa26f48), {
1398
- color: color,
1436
+ width: triggerRef.current?.getBoundingClientRect().width,
1437
+ color: listBoxColor ?? color,
1399
1438
  shouldFocusOnHover: true,
1400
1439
  state: listState,
1401
1440
  ...props
@@ -2835,5 +2874,5 @@ function $0f36a360c83514a5$export$39299b56cfd4e361({ appearance: appearance = "o
2835
2874
 
2836
2875
 
2837
2876
 
2838
- export {$6cd538350b429e7f$export$e71c4d32a2263218 as Box, $5b3bb99cde624b45$export$ef2184bd89960b14 as Grid, $5b3bb99cde624b45$export$9eb849b9b922d396 as GridItem, $7f9359c321db931d$export$f51f4c4ede09e011 as Flex, $82670c5be238db82$export$f5b8910cec6cf069 as Input, $4113140783615547$export$6bf0cd3a219bbade as NumberInput, $ad6bb3d9e1e05700$export$5f1af8db9871e1d6 as Text, $bb3cc805e0118109$export$379139ebc1c2b235 as Textarea, $c104f9e833419de4$export$353f5b6fc5456de1 as Button, $e588944490abcca5$export$c25acd513dcc8062 as IconButton, $5072ac6039cf0888$export$69b1032f2ecdf404 as ButtonGroup, $775c2fb4fd112efa$export$48513f6b9f8ce62d as Checkbox, $febe415bf449fc90$export$4aa08d5625cb8ead as CheckboxGroup, $1c477959d830be20$export$d7b12c4107be0d61 as Radio, $1c477959d830be20$export$a98f0dcb43a68a25 as RadioGroup, $965d97a4ec6bd81a$export$f8afaea2e9656b91 as RadioCard, $0d71c1f2b7db4b85$export$ef9b1a59e592288f as Select, $964af2d63cba5174$export$5109c6dd95d8fb00 as DatePicker, $5fd3904f9eb3218a$export$e1aef45b828286de as Calendar, $b48b8d81801d004e$export$e2255cf6045e8d47 as Avatar, $fed95b431ec7b960$export$1a5cb5295a7d2749 as FileUploader, $cf42d20e3b8cc34e$export$1ff3c3f08ae963c0 as Separator, $04177bfc4bfecca2$export$b25a304ec7d746bb as Progress, $601ef0275f45de5d$export$3b0d6d7590275603 as Loader, $8698d4cdcb757ebb$export$be92b6f5f03c0fe9 as Root, $8698d4cdcb757ebb$export$6d08773d2e66f8f2 as Item, $ee32300ad59b8528$export$3288d34c523a1192 as Tag, $0932ff499514e051$export$b5d5cf8927ab7262 as Switch, $d14d6b3a193e099d$export$dbada5ace43900dd as ColorTray, $1c3bc82fac1fb4c8$export$50e381fea3a45244 as IconTray, $4faec2397ebc0ec1$export$ea98c603db73aee7 as Sticker, $e0a55446ef2d8454$export$1aaa3deaa90ea306 as Tabs, $4d38d87b55811352$export$54ec01a60f47d33d as Table, $9e2f19f5522a9ed4$export$e6a97ba2cae5bb94 as Timeline, $27dfef5c84f0ece2$export$2b77a92f1a5ad772 as Modal, $a0b7975efdcbad3c$export$eef1e68107c58ef2 as Space, $0f36a360c83514a5$export$39299b56cfd4e361 as TagInput, $362781724bb4213a$export$d8964aec282183a3 as ThemeProvider, $362781724bb4213a$export$93d4e7f90805808f as useTheme};
2877
+ export {$6cd538350b429e7f$export$e71c4d32a2263218 as Box, $5b3bb99cde624b45$export$ef2184bd89960b14 as Grid, $5b3bb99cde624b45$export$9eb849b9b922d396 as GridItem, $7f9359c321db931d$export$f51f4c4ede09e011 as Flex, $82670c5be238db82$export$f5b8910cec6cf069 as Input, $4113140783615547$export$6bf0cd3a219bbade as NumberInput, $ad6bb3d9e1e05700$export$5f1af8db9871e1d6 as Text, $bb3cc805e0118109$export$379139ebc1c2b235 as Textarea, $c104f9e833419de4$export$353f5b6fc5456de1 as Button, $e588944490abcca5$export$c25acd513dcc8062 as IconButton, $5072ac6039cf0888$export$69b1032f2ecdf404 as ButtonGroup, $775c2fb4fd112efa$export$48513f6b9f8ce62d as Checkbox, $febe415bf449fc90$export$4aa08d5625cb8ead as CheckboxGroup, $1c477959d830be20$export$d7b12c4107be0d61 as Radio, $1c477959d830be20$export$a98f0dcb43a68a25 as RadioGroup, $965d97a4ec6bd81a$export$f8afaea2e9656b91 as RadioCard, $0d71c1f2b7db4b85$export$ef9b1a59e592288f as Select, $964af2d63cba5174$export$5109c6dd95d8fb00 as DatePicker, $5fd3904f9eb3218a$export$e1aef45b828286de as Calendar, $b48b8d81801d004e$export$e2255cf6045e8d47 as Avatar, $fed95b431ec7b960$export$1a5cb5295a7d2749 as FileUploader, $cf42d20e3b8cc34e$export$1ff3c3f08ae963c0 as Separator, $04177bfc4bfecca2$export$b25a304ec7d746bb as Progress, $601ef0275f45de5d$export$3b0d6d7590275603 as Loader, $8698d4cdcb757ebb$export$be92b6f5f03c0fe9 as Root, $8698d4cdcb757ebb$export$6d08773d2e66f8f2 as Item, $ee32300ad59b8528$export$3288d34c523a1192 as Tag, $0932ff499514e051$export$b5d5cf8927ab7262 as Switch, $d14d6b3a193e099d$export$dbada5ace43900dd as ColorTray, $1c3bc82fac1fb4c8$export$50e381fea3a45244 as IconTray, $4faec2397ebc0ec1$export$ea98c603db73aee7 as Sticker, $e0a55446ef2d8454$export$1aaa3deaa90ea306 as Tabs, $4d38d87b55811352$export$54ec01a60f47d33d as Table, $9e2f19f5522a9ed4$export$e6a97ba2cae5bb94 as Timeline, $27dfef5c84f0ece2$export$2b77a92f1a5ad772 as Modal, $27dfef5c84f0ece2$export$33ffd74ebf07f060 as useModal, $a0b7975efdcbad3c$export$eef1e68107c58ef2 as Space, $0f36a360c83514a5$export$39299b56cfd4e361 as TagInput, $362781724bb4213a$export$d8964aec282183a3 as ThemeProvider, $362781724bb4213a$export$93d4e7f90805808f as useTheme};
2839
2878
  //# sourceMappingURL=module.js.map