@parrot-co/parrot-ui 0.1.21 → 0.1.22

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
@@ -29,6 +29,7 @@ $parcel$export(module.exports, "IconButton", () => $3af04cd154cf4de1$export$c25a
29
29
  $parcel$export(module.exports, "ButtonGroup", () => $7f70742e736041ff$export$69b1032f2ecdf404);
30
30
  $parcel$export(module.exports, "Checkbox", () => $f88e10ca2ba68239$export$48513f6b9f8ce62d);
31
31
  $parcel$export(module.exports, "CheckboxGroup", () => $0f8ef6f4acac1766$export$4aa08d5625cb8ead);
32
+ $parcel$export(module.exports, "CheckboxItem", () => $c31ad898a2916b00$export$16ce288f89fa631c);
32
33
  $parcel$export(module.exports, "DropdownMenu", () => $3b903582a5253460$export$e44a253a59704894);
33
34
  $parcel$export(module.exports, "ComboBox", () => $d67a8dc6cbdaa7ed$export$72b9695b8216309a);
34
35
  $parcel$export(module.exports, "Radio", () => $e158c5cf7e190200$export$d7b12c4107be0d61);
@@ -494,9 +495,10 @@ $df66c26cdcece32b$export$faaf771f35016530.displayName = "GridItem";
494
495
 
495
496
 
496
497
  const $c3a954a7c0cb5109$export$21ee1313e2afe36c = (props, ref)=>{
497
- const { justify: justify, align: align, direction: direction, gap: gap = "sm", columnGap: columnGap, rowGap: rowGap, inline: inline, wrap: wrap, stack: stack, className: className, ...otherProps } = props;
498
+ const { justify: justify, align: align, direction: direction, gap: gap = "sm", columnGap: columnGap, rowGap: rowGap, inline: inline, wrap: wrap, stack: stack, className: className, as: as, ...otherProps } = props;
498
499
  const flexDirection = stack ? "column" : direction ?? "row";
499
500
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), {
501
+ as: as,
500
502
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, wrap && `flex-${wrap}`, justify && `flex-justify-${justify}`, align && `flex-align-${align}`, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", rowGap)),
501
503
  // TODO - Fix types here - seems to work just fine though
502
504
  ref: ref,
@@ -700,6 +702,7 @@ function $ec2376a5dd0d13e6$export$a455218a85c89869({ label: label, description:
700
702
  children: label
701
703
  }),
702
704
  !replaceDefaultControlWrapper && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
705
+ align: "center",
703
706
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(space.classNames, "p-input-control"),
704
707
  "data-has-error": !!error,
705
708
  "data-appearance": appearance,
@@ -813,14 +816,10 @@ $a28e128499dd0b02$export$3b0d6d7590275603.displayName = "Loader";
813
816
 
814
817
 
815
818
  function $ff6fce0e059b3a1a$export$30a06c8d3562193f(object, keys) {
819
+ const keySet = new Set(keys);
816
820
  return Object.keys(object).reduce((obj, key)=>{
817
- if (keys.includes(key)) return {
818
- ...obj
819
- };
820
- return {
821
- ...obj,
822
- [key]: object[key]
823
- };
821
+ if (!keySet.has(key)) obj[key] = object[key];
822
+ return obj;
824
823
  }, {});
825
824
  }
826
825
  function $ff6fce0e059b3a1a$export$357523c63a2253b9(object, keys) {
@@ -1309,6 +1308,43 @@ $f88e10ca2ba68239$export$48513f6b9f8ce62d.displayName = "checkbox";
1309
1308
 
1310
1309
 
1311
1310
 
1311
+ function $c31ad898a2916b00$export$16ce288f89fa631c({ className: className, classNames: classNames, styles: styles, style: style, ...props }) {
1312
+ const ctx = (0, ($parcel$interopDefault($8zHUo$react))).useContext((0, $0f8ef6f4acac1766$export$f9c6924e160136d1));
1313
+ if (!ctx) throw new Error("CheckboxItem must be used within a CheckboxGroup");
1314
+ const ref = (0, ($parcel$interopDefault($8zHUo$react))).useRef(null);
1315
+ const { inputProps: inputProps } = (0, $8zHUo$reactaria.useCheckboxGroupItem)(props, ctx.state, ref);
1316
+ const isSelected = ctx.state.isSelected(props.value);
1317
+ const isDisabled = ctx.state.isDisabled || props.isDisabled;
1318
+ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("label", {
1319
+ style: {
1320
+ ...style,
1321
+ ...styles?.wrapper
1322
+ },
1323
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-checkbox-item", classNames?.wrapper),
1324
+ "data-disabled": isDisabled,
1325
+ "data-checked": isSelected,
1326
+ children: [
1327
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $8zHUo$reactaria.VisuallyHidden), {
1328
+ children: [
1329
+ " ",
1330
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", {
1331
+ type: "checkbox",
1332
+ ref: ref,
1333
+ ...inputProps
1334
+ })
1335
+ ]
1336
+ }),
1337
+ props.children
1338
+ ]
1339
+ });
1340
+ }
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1312
1348
 
1313
1349
 
1314
1350
 
@@ -1593,13 +1629,6 @@ const $3b903582a5253460$export$e44a253a59704894 = {
1593
1629
 
1594
1630
 
1595
1631
 
1596
-
1597
-
1598
-
1599
-
1600
-
1601
-
1602
-
1603
1632
 
1604
1633
 
1605
1634
 
@@ -1817,107 +1846,75 @@ function $dcfc4542aa84c062$var$ListSection({ state: state, section: section }) {
1817
1846
 
1818
1847
 
1819
1848
 
1820
- const $d67a8dc6cbdaa7ed$export$acd2d351457d1d82 = ({ label: label, error: error, showDropdownButton: showDropdownButton = true, dropdownArrow: dropdownArrow = /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reacticonshi.HiSelector), {
1821
- size: 18
1822
- }), className: className, style: style, color: color = "gray", radius: radius, size: size = "md", appearance: appearance = "outline", listBoxColor: listBoxColor, append: append, prepend: prepend, isLoading: isLoading, ...props }, ref)=>{
1823
- const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)();
1849
+
1850
+ 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, ...props }) {
1824
1851
  const { contains: contains } = (0, $8zHUo$reactaria.useFilter)({
1825
1852
  sensitivity: "base"
1826
1853
  });
1854
+ const children = (0, $fc43ab93aaa777d9$export$4c687b6f1150e71b)(props);
1827
1855
  const state = (0, $8zHUo$reactstately.useComboBoxState)({
1828
1856
  ...props,
1829
- children: (0, $fc43ab93aaa777d9$export$3d7d0414f6db67e7)(props),
1857
+ children: children,
1830
1858
  defaultFilter: contains
1831
1859
  });
1832
- const inputRef = $8zHUo$react.useRef(null);
1833
1860
  const buttonRef = $8zHUo$react.useRef(null);
1861
+ const inputRef = $8zHUo$react.useRef(null);
1834
1862
  const listBoxRef = $8zHUo$react.useRef(null);
1835
1863
  const popoverRef = $8zHUo$react.useRef(null);
1836
1864
  const wrapperRef = $8zHUo$react.useRef(null);
1837
- const { inputProps: inputProps, buttonProps: buttonProps, listBoxProps: listBoxProps } = (0, $8zHUo$reactaria.useComboBox)({
1838
- inputRef: inputRef,
1865
+ const { inputProps: inputProps, buttonProps: buttonProps, listBoxProps: listBoxProps, labelProps: AriaLabelProps } = (0, $8zHUo$reactaria.useComboBox)({
1839
1866
  buttonRef: buttonRef,
1867
+ inputRef: inputRef,
1840
1868
  listBoxRef: listBoxRef,
1841
1869
  popoverRef: popoverRef,
1842
1870
  ...props
1843
1871
  }, state);
1844
- function resolvedDropdownArrow() {
1845
- if (typeof dropdownArrow === "function") return dropdownArrow({
1846
- color: "gray",
1847
- size: "md"
1848
- });
1849
- return dropdownArrow;
1850
- }
1851
- return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
1852
- "data-color": color ?? theme?.color ?? "gray",
1853
- "data-size": size,
1854
- "data-radius": radius ?? theme?.radius ?? "lg",
1855
- style: style,
1856
- className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-combo-box p-input-group", className),
1857
- ref: ref,
1858
- stack: true,
1859
- gap: "3xs",
1860
- stretchX: true,
1872
+ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $8zHUo$reactjsxruntime.Fragment), {
1861
1873
  children: [
1862
- label && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $5a5b41d120374960$export$2e2bcd8739ae039), {
1863
- children: label
1864
- }),
1865
- /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
1866
- position: "relative",
1867
- gap: "3xs",
1868
- ref: wrapperRef,
1869
- align: "center",
1870
- "data-appearance": appearance,
1871
- className: "p-input-control p-combo-box-control",
1874
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $ec2376a5dd0d13e6$export$a455218a85c89869), {
1875
+ styles: styles,
1876
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-combo-box-field"),
1877
+ classNames: classNames,
1878
+ style: style,
1879
+ wrapperRef: wrapperRef,
1880
+ label: label,
1881
+ labelProps: (0, $8zHUo$reactaria.mergeProps)(labelProps, AriaLabelProps),
1882
+ description: description,
1883
+ descriptionProps: descriptionProps,
1884
+ error: error,
1885
+ errorMessageProps: errorMessageProps,
1872
1886
  children: [
1873
- prepend,
1874
1887
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", {
1875
- className: "p-combo-box-input p-text-input-el",
1876
- onChange: (e)=>inputProps.onChange?.(e),
1888
+ className: "p-text-input-el",
1877
1889
  ref: inputRef,
1878
- "data-has-prepend": !!prepend,
1879
- "data-size": "md",
1880
- ...(0, $ff6fce0e059b3a1a$export$30a06c8d3562193f)(inputProps, [
1881
- "size",
1882
- "onChange"
1883
- ])
1884
- }),
1885
- append,
1886
- isLoading && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $a28e128499dd0b02$export$3b0d6d7590275603), {
1887
- size: "xs"
1890
+ type: "text",
1891
+ ...inputProps
1888
1892
  }),
1889
- showDropdownButton && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), {
1890
- ...buttonProps,
1893
+ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), {
1891
1894
  variant: "ghost",
1892
1895
  color: "gray",
1893
- radius: "lg",
1894
- className: "p-combo-box-button",
1895
- ref: buttonRef,
1896
- children: resolvedDropdownArrow()
1896
+ size: selectorSize,
1897
+ ...buttonProps,
1898
+ children: selectorIcon
1897
1899
  })
1898
1900
  ]
1899
1901
  }),
1900
- error && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4b54f76a59afa8a5$export$2e2bcd8739ae039), {
1901
- children: error
1902
- }),
1903
1902
  state.isOpen && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $9a1eb1c261c8b852$export$91527519cfe8e396), {
1904
- popoverRef: popoverRef,
1905
- offset: 8,
1906
- state: state,
1903
+ offset: 6,
1907
1904
  triggerRef: wrapperRef,
1905
+ state: state,
1906
+ popoverRef: popoverRef,
1907
+ isNonModal: true,
1908
1908
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $dcfc4542aa84c062$export$41f133550aa26f48), {
1909
- color: listBoxColor ?? theme?.color ?? "gray",
1910
1909
  width: wrapperRef.current?.getBoundingClientRect().width,
1910
+ ...listBoxProps,
1911
1911
  listBoxRef: listBoxRef,
1912
- state: state,
1913
- ...listBoxProps
1912
+ state: state
1914
1913
  })
1915
1914
  })
1916
1915
  ]
1917
1916
  });
1918
- };
1919
- $d67a8dc6cbdaa7ed$export$acd2d351457d1d82.displayName = "ComboBox";
1920
- const $d67a8dc6cbdaa7ed$export$72b9695b8216309a = /*#__PURE__*/ $8zHUo$react.forwardRef($d67a8dc6cbdaa7ed$export$acd2d351457d1d82);
1917
+ }
1921
1918
 
1922
1919
 
1923
1920