@parrot-co/parrot-ui 0.1.25 → 0.1.26

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 CHANGED
@@ -1642,10 +1642,10 @@ const $86685406b084d356$export$5b7f4051a57920d0 = (0, $8zHUo$reactstately.Item);
1642
1642
  const $86685406b084d356$export$ef146090a6472d9e = (0, $8zHUo$reactstately.Section);
1643
1643
 
1644
1644
 
1645
- function $fc43ab93aaa777d9$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items }) {
1645
+ function $fc43ab93aaa777d9$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items, defaultItems: defaultItems }) {
1646
1646
  const hasChildren = $8zHUo$react.Children.count(children) > 0;
1647
1647
  if (hasChildren || typeof children === "function") return children;
1648
- if (items) // eslint-disable-next-line react/display-name
1648
+ if (items || defaultItems) // eslint-disable-next-line react/display-name
1649
1649
  return (item)=>{
1650
1650
  const label = item?.[labelKey ?? "label"];
1651
1651
  const value = item?.[valueKey ?? "id" ?? "key" ?? "value"];
@@ -1668,12 +1668,7 @@ function $fc43ab93aaa777d9$export$3d7d0414f6db67e7({ children: children, renderO
1668
1668
  };
1669
1669
  }
1670
1670
  function $fc43ab93aaa777d9$export$4c687b6f1150e71b(props) {
1671
- const children = $8zHUo$react.useMemo(()=>{
1672
- return $fc43ab93aaa777d9$export$3d7d0414f6db67e7(props);
1673
- }, [
1674
- props.children
1675
- ]);
1676
- return children;
1671
+ return $fc43ab93aaa777d9$export$3d7d0414f6db67e7(props);
1677
1672
  }
1678
1673
 
1679
1674
 
@@ -1860,16 +1855,20 @@ function $dcfc4542aa84c062$var$ListSection({ state: state, section: section }) {
1860
1855
  function $d67a8dc6cbdaa7ed$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, $8zHUo$reactjsxruntime.jsx)((0, $a28e128499dd0b02$export$3b0d6d7590275603), {
1861
1856
  size: "xs"
1862
1857
  }), ...props }) {
1863
- let list = null;
1864
- if (loadData) list = (0, $8zHUo$reactstately.useAsyncList)({
1858
+ const list = (0, $8zHUo$reactstately.useAsyncList)({
1865
1859
  async load ({ filterText: filterText, signal: signal }) {
1866
- const res = await loadData(filterText, signal);
1860
+ if (loadData) {
1861
+ const res = await loadData(filterText, signal);
1862
+ return {
1863
+ items: res
1864
+ };
1865
+ }
1867
1866
  return {
1868
- items: res
1867
+ items: []
1869
1868
  };
1870
1869
  }
1871
1870
  });
1872
- if (list) {
1871
+ if (loadData) {
1873
1872
  props.items = list.items;
1874
1873
  props.inputValue = list.filterText;
1875
1874
  props.onInputChange = list.setFilterText;
@@ -1890,11 +1889,11 @@ function $d67a8dc6cbdaa7ed$export$72b9695b8216309a({ description: description, d
1890
1889
  const popoverRef = $8zHUo$react.useRef(null);
1891
1890
  const wrapperRef = $8zHUo$react.useRef(null);
1892
1891
  const { inputProps: inputProps, buttonProps: buttonProps, listBoxProps: listBoxProps, labelProps: AriaLabelProps } = (0, $8zHUo$reactaria.useComboBox)({
1892
+ ...props,
1893
1893
  buttonRef: buttonRef,
1894
1894
  inputRef: inputRef,
1895
1895
  listBoxRef: listBoxRef,
1896
- popoverRef: popoverRef,
1897
- ...props
1896
+ popoverRef: popoverRef
1898
1897
  }, state);
1899
1898
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $8zHUo$reactjsxruntime.Fragment), {
1900
1899
  children: [
@@ -1914,7 +1913,6 @@ function $d67a8dc6cbdaa7ed$export$72b9695b8216309a({ description: description, d
1914
1913
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", {
1915
1914
  className: "p-text-input-el",
1916
1915
  ref: inputRef,
1917
- type: "text",
1918
1916
  ...inputProps
1919
1917
  }),
1920
1918
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), {
@@ -1933,10 +1931,10 @@ function $d67a8dc6cbdaa7ed$export$72b9695b8216309a({ description: description, d
1933
1931
  popoverRef: popoverRef,
1934
1932
  isNonModal: true,
1935
1933
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $dcfc4542aa84c062$export$41f133550aa26f48), {
1936
- width: wrapperRef.current?.getBoundingClientRect().width,
1937
- ...listBoxProps,
1934
+ width: wrapperRef.current?.getBoundingClientRect()?.width,
1938
1935
  listBoxRef: listBoxRef,
1939
- state: state
1936
+ state: state,
1937
+ ...listBoxProps
1940
1938
  })
1941
1939
  })
1942
1940
  ]