@parrot-co/parrot-ui 0.1.25 → 0.1.27

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
@@ -1572,10 +1572,10 @@ const $c35269c9504bc94d$export$5b7f4051a57920d0 = (0, $hgUW1$Item);
1572
1572
  const $c35269c9504bc94d$export$ef146090a6472d9e = (0, $hgUW1$Section);
1573
1573
 
1574
1574
 
1575
- function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items }) {
1575
+ function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items, defaultItems: defaultItems }) {
1576
1576
  const hasChildren = $hgUW1$Children.count(children) > 0;
1577
1577
  if (hasChildren || typeof children === "function") return children;
1578
- if (items) // eslint-disable-next-line react/display-name
1578
+ if (items || defaultItems) // eslint-disable-next-line react/display-name
1579
1579
  return (item)=>{
1580
1580
  const label = item?.[labelKey ?? "label"];
1581
1581
  const value = item?.[valueKey ?? "id" ?? "key" ?? "value"];
@@ -1598,12 +1598,7 @@ function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderO
1598
1598
  };
1599
1599
  }
1600
1600
  function $b71fd84ba612e4b0$export$4c687b6f1150e71b(props) {
1601
- const children = $hgUW1$useMemo(()=>{
1602
- return $b71fd84ba612e4b0$export$3d7d0414f6db67e7(props);
1603
- }, [
1604
- props.children
1605
- ]);
1606
- return children;
1601
+ return $b71fd84ba612e4b0$export$3d7d0414f6db67e7(props);
1607
1602
  }
1608
1603
 
1609
1604
 
@@ -1790,16 +1785,20 @@ function $6ae005878b435ce8$var$ListSection({ state: state, section: section }) {
1790
1785
  function $618e53c42107439d$export$72b9695b8216309a({ description: description, descriptionProps: descriptionProps, error: error, errorMessageProps: errorMessageProps, label: label, labelProps: labelProps, selectorIcon: selectorIcon, selectorSize: selectorSize = "sm", style: style, styles: styles, className: className, classNames: classNames, isLoading: isLoading, loadData: loadData, loadingIndicator: loadingIndicator = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e1148cdb3a130657$export$3b0d6d7590275603), {
1791
1786
  size: "xs"
1792
1787
  }), ...props }) {
1793
- let list = null;
1794
- if (loadData) list = (0, $hgUW1$useAsyncList)({
1788
+ const list = (0, $hgUW1$useAsyncList)({
1795
1789
  async load ({ filterText: filterText, signal: signal }) {
1796
- const res = await loadData(filterText, signal);
1790
+ if (loadData) {
1791
+ const res = await loadData(filterText, signal);
1792
+ return {
1793
+ items: res
1794
+ };
1795
+ }
1797
1796
  return {
1798
- items: res
1797
+ items: []
1799
1798
  };
1800
1799
  }
1801
1800
  });
1802
- if (list) {
1801
+ if (loadData) {
1803
1802
  props.items = list.items;
1804
1803
  props.inputValue = list.filterText;
1805
1804
  props.onInputChange = list.setFilterText;
@@ -1820,11 +1819,11 @@ function $618e53c42107439d$export$72b9695b8216309a({ description: description, d
1820
1819
  const popoverRef = $hgUW1$useRef(null);
1821
1820
  const wrapperRef = $hgUW1$useRef(null);
1822
1821
  const { inputProps: inputProps, buttonProps: buttonProps, listBoxProps: listBoxProps, labelProps: AriaLabelProps } = (0, $hgUW1$useComboBox)({
1822
+ ...props,
1823
1823
  buttonRef: buttonRef,
1824
1824
  inputRef: inputRef,
1825
1825
  listBoxRef: listBoxRef,
1826
- popoverRef: popoverRef,
1827
- ...props
1826
+ popoverRef: popoverRef
1828
1827
  }, state);
1829
1828
  return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
1830
1829
  children: [
@@ -1844,7 +1843,6 @@ function $618e53c42107439d$export$72b9695b8216309a({ description: description, d
1844
1843
  /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
1845
1844
  className: "p-text-input-el",
1846
1845
  ref: inputRef,
1847
- type: "text",
1848
1846
  ...inputProps
1849
1847
  }),
1850
1848
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
@@ -1863,10 +1861,10 @@ function $618e53c42107439d$export$72b9695b8216309a({ description: description, d
1863
1861
  popoverRef: popoverRef,
1864
1862
  isNonModal: true,
1865
1863
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6ae005878b435ce8$export$41f133550aa26f48), {
1866
- width: wrapperRef.current?.getBoundingClientRect().width,
1867
- ...listBoxProps,
1864
+ width: wrapperRef.current?.getBoundingClientRect()?.width,
1868
1865
  listBoxRef: listBoxRef,
1869
- state: state
1866
+ state: state,
1867
+ ...listBoxProps
1870
1868
  })
1871
1869
  })
1872
1870
  ]
@@ -3416,7 +3414,7 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
3416
3414
  })
3417
3415
  ]
3418
3416
  }),
3419
- props.isDismissable && showCloseButton && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3417
+ showCloseButton && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3420
3418
  color: "gray",
3421
3419
  onClick: handleClose,
3422
3420
  "data-variant": "ghost",