widenarrow-ui 2.4.3 → 2.4.5

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/lib/index.d.ts CHANGED
@@ -687,6 +687,30 @@ interface OptionItem {
687
687
  * `nativeHtmlComponent`.
688
688
  */
689
689
  description?: string;
690
+ /**
691
+ * Icon before the text. In a Combobox with `multiple`, also shown on the option's pill. Not shown
692
+ * in the field of a single value, nor with `nativeHtmlComponent`.
693
+ */
694
+ leftIcon?: IconTypes;
695
+ /**
696
+ * Component before the text, e.g. an avatar or a logo. Shown in the list in place of `leftIcon`,
697
+ * while pills keep showing `leftIcon`. It doesn't make the option higher, so keep it to the size of an
698
+ * icon (24px). Not shown with `nativeHtmlComponent`.
699
+ */
700
+ leftComponent?: ReactNode;
701
+ /**
702
+ * Component after the text, e.g. status icons or an avatar. It doesn't make the option higher, so keep
703
+ * it to the size of an icon (24px). Must not contain buttons or links, as a click anywhere on the option
704
+ * picks it. Not shown with `nativeHtmlComponent`.
705
+ */
706
+ rightComponent?: ReactNode;
707
+ /**
708
+ * Heading of the group the option belongs to, e.g. `'Favorites'`. Options next to each other with
709
+ * the same `group` are listed under one heading, so keep each group's options together and put
710
+ * options without a group first. Rendered as an `<optgroup>` with `nativeHtmlComponent`. Values must
711
+ * be unique across groups.
712
+ */
713
+ group?: string;
690
714
  }
691
715
  interface SelectInputProps {
692
716
  /** Options to choose from, in display order. */
@@ -730,12 +754,6 @@ interface SelectInputProps {
730
754
  nativeHtmlComponent?: boolean;
731
755
  /** Size from the smallest breakpoint up. @default SizeTypes.MEDIUM */
732
756
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
733
- /** Size from the `$md` breakpoint up, overriding `size`. */
734
- sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
735
- /** Size from the `$lg` breakpoint up, overriding `size` and `sizeMd`. */
736
- sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
737
- /** Size from the `$xl` breakpoint up, overriding the smaller sizes. */
738
- sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
739
757
  /** Adds bottom spacing, for stacking fields in a form. @default false */
740
758
  marginBottom?: boolean;
741
759
  /** Focus the select on mount. @default false */
@@ -750,38 +768,29 @@ interface SelectInputProps {
750
768
  className?: string;
751
769
  /** Class name of the button that opens the list, or of the `<select>` with `nativeHtmlComponent`. */
752
770
  inputClassName?: string;
753
- /** @deprecated Not used by the component. */
754
- text?: string;
755
771
  }
756
772
 
757
- /** Why the text in the Combobox's input changed. */
758
- type ComboboxInputChangeReason =
759
- /** The user typed. */
760
- 'input'
761
- /** The text was set back to the selected option's label, e.g. after picking an option or leaving the field. */
762
- | 'reset'
763
- /** The clear button was used. */
764
- | 'clear';
765
773
  type ComboboxValue = string | number;
774
+ /** Accessible names of the Combobox's buttons, e.g. to translate them. */
775
+ interface ComboboxAriaLabels {
776
+ /** The button that clears the value. @default 'Clear' */
777
+ clearButton?: string;
778
+ /** The button that opens and closes the list. @default 'Show options' */
779
+ toggleButton?: string;
780
+ /** The remove button on each pill, with `multiple`. Also its tooltip. @default 'Remove' */
781
+ removePillButton?: string;
782
+ }
766
783
  interface ComboboxBaseProps {
767
- /** Options to choose from, in display order. Filtered by the typed text, unless `filterOptions` is false. */
784
+ /**
785
+ * Options to choose from, in display order. Filtered by the typed text, unless `filterOptions` is
786
+ * false. An option's `leftIcon` is also shown on its pill with `multiple`.
787
+ */
768
788
  options: Array<OptionItem>;
769
789
  /**
770
790
  * The options of the selected values, for their labels while they are not among `options`, e.g. a
771
791
  * saved value before its page of options is fetched, or a value picked from an earlier search.
772
792
  */
773
793
  selectedOptions?: Array<OptionItem>;
774
- /**
775
- * Text in the input, to control it. Without it the Combobox keeps the text itself. When controlled,
776
- * update it from `onInputChange`.
777
- */
778
- inputValue?: string;
779
- /**
780
- * Called when the text in the input changes, with the reason. To fetch options for what the user
781
- * types, use `onSearchChange` instead: the text of a `'reset'` is the selected option's label, which
782
- * isn't a search.
783
- */
784
- onInputChange?: (inputValue: string, reason: ComboboxInputChangeReason) => void;
785
794
  /**
786
795
  * Called with the text to search for: what the user types, and `''` when the search ends, which is when
787
796
  * an option is picked, the value is cleared or the field is left. Use it to fetch options per search,
@@ -835,23 +844,15 @@ interface ComboboxBaseProps {
835
844
  * all text in the input. Without it, a value can only be replaced by another. @default true
836
845
  */
837
846
  withClearButton?: boolean;
838
- /** Accessible name of the clear button. @default 'Clear' */
839
- clearButtonAriaLabel?: string;
840
- /** Accessible name of the button that opens and closes the list. @default 'Show options' */
841
- toggleButtonAriaLabel?: string;
847
+ /** Accessible names of the clear, toggle and pill remove buttons, e.g. to translate them. */
848
+ ariaLabels?: ComboboxAriaLabels;
842
849
  /**
843
850
  * Colours the input like a Button of that type, e.g. to use the Combobox as a picker in a toolbar.
844
851
  * The list is not affected. Without it, the input looks like the other form fields.
845
852
  */
846
853
  type?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
847
- /** Size from the smallest breakpoint up. @default SizeTypes.MEDIUM */
854
+ /** @default SizeTypes.MEDIUM */
848
855
  size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
849
- /** Size from the `$md` breakpoint up, overriding `size`. */
850
- sizeMd?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
851
- /** Size from the `$lg` breakpoint up, overriding `size` and `sizeMd`. */
852
- sizeLg?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
853
- /** Size from the `$xl` breakpoint up, overriding the smaller sizes. */
854
- sizeXl?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
855
856
  /** Adds bottom spacing, for stacking fields in a form. @default false */
856
857
  marginBottom?: boolean;
857
858
  /** Focus the input on mount. @default false */
@@ -899,8 +900,6 @@ interface ComboboxMultipleProps extends ComboboxBaseProps {
899
900
  onChange: (value: Array<ComboboxValue>) => void;
900
901
  /** Only with `multiple`: pills shown in the field. The rest are behind a "+ N" button that lists them, as in BadgeList. @default 5 */
901
902
  maxVisiblePills?: number;
902
- /** Only with `multiple`: accessible name and tooltip of a pill's remove button. @default 'Remove' */
903
- removePillAriaLabel?: string;
904
903
  }
905
904
  type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;
906
905
 
@@ -1111,8 +1110,8 @@ interface DropDownItemProps {
1111
1110
  */
1112
1111
  active?: boolean;
1113
1112
  /**
1114
- * Where the check mark of an `active` item goes. On the right it matches the option lists of SelectInput
1115
- * and Combobox, and the left is free for `leftIcon`.
1113
+ * Where the check mark of an `active` item goes. Keep it on the left in menus that pick one option, as
1114
+ * SelectInput does, and put it on the right in menus that pick several, as a Combobox with `multiple` does.
1116
1115
  * @default 'left'
1117
1116
  */
1118
1117
  activeIconPosition?: 'left' | 'right';
@@ -1138,10 +1137,6 @@ interface DropDownItemProps {
1138
1137
  iconClassName?: string;
1139
1138
  /** @default true */
1140
1139
  closeDropDownOnClick?: boolean;
1141
- descriptionColor?: Partial<ColorTypes>;
1142
- descriptionTextAlign?: TypographyTextAlign;
1143
- descriptionFontSize?: TypographyFontSize;
1144
- descriptionFontWeight?: TypographyFontWeight;
1145
1140
  descriptionClassName?: string;
1146
1141
  descriptionContainerClassName?: string;
1147
1142
  }
@@ -2097,7 +2092,7 @@ declare const TabGroup: {
2097
2092
  };
2098
2093
 
2099
2094
  declare const SelectInput: {
2100
- ({ label, withLabel, inputRef, nativeHtmlComponent, size, sizeMd, sizeLg, sizeXl, ariaLabel, id, onChange, defaultOption, value, error, autoFocus, helperText, options, disabled, loading, name, className, inputClassName, marginBottom }: SelectInputProps): JSX.Element;
2095
+ ({ label, withLabel, inputRef, nativeHtmlComponent, size, ariaLabel, id, onChange, defaultOption, value, error, autoFocus, helperText, options, disabled, loading, name, className, inputClassName, marginBottom }: SelectInputProps): JSX.Element;
2101
2096
  displayName: string;
2102
2097
  };
2103
2098
 
@@ -2192,4 +2187,4 @@ declare const NoDataMessage: {
2192
2187
  displayName: string;
2193
2188
  };
2194
2189
 
2195
- export { AnimatedCount, AnimatedCountProps, AppColors, AspectRatioTypes, Badge, BadgeItem, BadgeList, BadgeListProps, BadgeProps, BadgeTypes, BorderInterface, Box, Button, Card, Checkbox, ColorStyleInterface, ColorTypes, Combobox, ComboboxInputChangeReason, ComboboxMultipleProps, ComboboxProps, ComboboxSingleProps, ComboboxValue, DropDown, DropDownItem, DropDownProps, DropDownRef, FacetButton, FlexStylingInterface, FontFamilyTypes, FormSkeleton, Grid, Heading, HierarchyInterface, HierarchyTypes, Icon, IconButton, IconStyleInterface, IconTypes, Image, InlineButton, Input, Label, Link, LinkTypes, ListButton, ListButtonProps, ListItem, ListSkeleton, MarginInterface, MultiActionButton, NoDataMessage, NumberBadge, NumberBadgeProps, PaddingInterface, Pagination, Paragraph, RadioButton, SelectInput, OptionItem as SelectInputOptionItem, SelectInputProps, Separator, SizeStyleInterface, SizeTypes, SkeletonItem, SolidSpinner, SortableTable, SortableTableCellInterface, SortableTableProps, Span, SwitchButton, Tab, TabGroup, TabGroupProps, TabIndicatorProps, TabProps, TabValue, TableTypes, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };
2190
+ export { AnimatedCount, AnimatedCountProps, AppColors, AspectRatioTypes, Badge, BadgeItem, BadgeList, BadgeListProps, BadgeProps, BadgeTypes, BorderInterface, Box, Button, Card, Checkbox, ColorStyleInterface, ColorTypes, Combobox, ComboboxAriaLabels, ComboboxMultipleProps, ComboboxProps, ComboboxSingleProps, ComboboxValue, DropDown, DropDownItem, DropDownProps, DropDownRef, FacetButton, FlexStylingInterface, FontFamilyTypes, FormSkeleton, Grid, Heading, HierarchyInterface, HierarchyTypes, Icon, IconButton, IconStyleInterface, IconTypes, Image, InlineButton, Input, Label, Link, LinkTypes, ListButton, ListButtonProps, ListItem, ListSkeleton, MarginInterface, MultiActionButton, NoDataMessage, NumberBadge, NumberBadgeProps, PaddingInterface, Pagination, Paragraph, RadioButton, SelectInput, OptionItem as SelectInputOptionItem, SelectInputProps, Separator, SizeStyleInterface, SizeTypes, SkeletonItem, SolidSpinner, SortableTable, SortableTableCellInterface, SortableTableProps, Span, SwitchButton, Tab, TabGroup, TabGroupProps, TabIndicatorProps, TabProps, TabValue, TableTypes, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };