@parrot-co/parrot-ui 1.0.0-beta.2 → 1.0.0-beta.3

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/index.mjs CHANGED
@@ -464,8 +464,10 @@ function Field({
464
464
  ref: groupRef,
465
465
  className: cn(
466
466
  "prt-input-control relative inline-flex w-full items-center",
467
- space.classNames
467
+ space.classNames,
468
+ classNames?.control
468
469
  ),
470
+ style: styles?.control,
469
471
  "data-has-error": !!error,
470
472
  "data-appearance": resolvedAppearance,
471
473
  "data-disabled": isDisabled
@@ -912,6 +914,9 @@ function HiChevronRight({ size = "1em", ...props }) {
912
914
  function HiChevronUp({ size = "1em", ...props }) {
913
915
  return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z", clipRule: "evenodd" }));
914
916
  }
917
+ function HiEye({ size = "1em", ...props }) {
918
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { d: "M10 12a2 2 0 100-4 2 2 0 000 4z" }), /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z", clipRule: "evenodd" }));
919
+ }
915
920
  function HiOutlineCalendar({ size = "1em", ...props }) {
916
921
  return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }));
917
922
  }
@@ -942,6 +947,28 @@ function HiSelector({ size = "1em", ...props }) {
942
947
  function HiX({ size = "1em", ...props }) {
943
948
  return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }));
944
949
  }
950
+
951
+ // src/components/input/password-input.tsx
952
+ function PasswordInput({ wrapperRef, ...props }) {
953
+ const [showPassword, setShowPassword] = React13__default.useState(false);
954
+ return /* @__PURE__ */ React13__default.createElement(
955
+ Input,
956
+ {
957
+ wrapperRef,
958
+ ...props,
959
+ type: showPassword ? "text" : "password",
960
+ append: /* @__PURE__ */ React13__default.createElement(
961
+ IconButton,
962
+ {
963
+ onPress: () => setShowPassword((p) => !p),
964
+ size: "sm",
965
+ variant: "light"
966
+ },
967
+ /* @__PURE__ */ React13__default.createElement(HiEye, { size: 16 })
968
+ )
969
+ }
970
+ );
971
+ }
945
972
  var PATTERNS = {
946
973
  numeric: REGEXP_ONLY_DIGITS,
947
974
  alphanumeric: REGEXP_ONLY_DIGITS_AND_CHARS,
@@ -1975,14 +2002,25 @@ function Select({
1975
2002
  classNames,
1976
2003
  style,
1977
2004
  styles,
2005
+ value,
2006
+ defaultValue,
2007
+ onChange,
1978
2008
  "aria-label": ariaLabel,
1979
2009
  ...racProps
1980
2010
  }) {
1981
2011
  const theme = useTheme();
1982
2012
  const resolvedColor = color ?? theme?.color;
1983
- const resolvedSize = size ?? theme?.size ?? "sm";
2013
+ const resolvedSize = size ?? theme?.size ?? "md";
1984
2014
  const resolvedAppearance = appearance ?? theme?.inputAppearance ?? "outline";
1985
2015
  const isMultiple = racProps.selectionMode === "multiple";
2016
+ const selectionProps = {
2017
+ value,
2018
+ defaultValue,
2019
+ onChange: onChange ? (next) => {
2020
+ if (next && typeof next === "object" && "nativeEvent" in next) return;
2021
+ onChange(next);
2022
+ } : void 0
2023
+ };
1986
2024
  function labelOf(item) {
1987
2025
  if (item == null) return null;
1988
2026
  return item[labelKey];
@@ -1991,6 +2029,7 @@ function Select({
1991
2029
  Select$1,
1992
2030
  {
1993
2031
  ...racProps,
2032
+ ...selectionProps,
1994
2033
  placeholder,
1995
2034
  isInvalid: !!error,
1996
2035
  "aria-label": ariaLabel ?? (label == null ? placeholder ?? "Select" : void 0),
@@ -4791,6 +4830,6 @@ function compose(...fns) {
4791
4830
  };
4792
4831
  }
4793
4832
 
4794
- export { Avatar, AvatarGroup, Button, ButtonGroup, Calendar, Checkbox, CheckboxGroup, CheckboxItem, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatchPicker, ComboBox, DateField, DatePicker, DateRangePicker, FileUploader, HoverCard, IconButton, Input, ListBox, ListBoxItem, ListBoxSection, Loader, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, Modal, ModalProvider, NumberInput, ListBoxItem as Option, PinInput, PinInputGroup, PinInputSeparator, PinInputSlot, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioCard, RadioGroup, RadioItem, RangeCalendar, ListBoxSection as Section, Select, Separator, Slider, Space, Sticker, Switch, Tab, Table, Tabs, Tag, TagGroup, TagGroupItem, TagInput, Text, Textarea, ThemeProvider, TimeField, Timeline, ToastRegion, Toggle, ToggleButton, ToggleGroup, Tooltip, compose, email, matches, max, maxLength, min, minLength, parseColor2 as parseColor, pattern, required, toast, useForm, useModal, useModals, useTheme };
4833
+ export { Avatar, AvatarGroup, Button, ButtonGroup, Calendar, Checkbox, CheckboxGroup, CheckboxItem, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatchPicker, ComboBox, DateField, DatePicker, DateRangePicker, FileUploader, HoverCard, IconButton, Input, ListBox, ListBoxItem, ListBoxSection, Loader, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, Modal, ModalProvider, NumberInput, ListBoxItem as Option, PasswordInput, PinInput, PinInputGroup, PinInputSeparator, PinInputSlot, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioCard, RadioGroup, RadioItem, RangeCalendar, ListBoxSection as Section, Select, Separator, Slider, Space, Sticker, Switch, Tab, Table, Tabs, Tag, TagGroup, TagGroupItem, TagInput, Text, Textarea, ThemeProvider, TimeField, Timeline, ToastRegion, Toggle, ToggleButton, ToggleGroup, Tooltip, compose, email, matches, max, maxLength, min, minLength, parseColor2 as parseColor, pattern, required, toast, useForm, useModal, useModals, useTheme };
4795
4834
  //# sourceMappingURL=index.mjs.map
4796
4835
  //# sourceMappingURL=index.mjs.map