@rescui/select 0.17.0 → 0.17.1-RUI-293-Update-menu-component-6ca9d26d3.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.
Files changed (51) hide show
  1. package/README.md +4 -2
  2. package/lib/_virtual/index.css.js +12 -12
  3. package/lib/common-prop-types.d.ts +29 -29
  4. package/lib/constants.d.ts +6 -6
  5. package/lib/hooks/use-a11y.d.ts +30 -30
  6. package/lib/hooks/use-actual-size-from-css.d.ts +10 -10
  7. package/lib/hooks/use-actual-size-from-css.js +1 -1
  8. package/lib/hooks/use-focus.d.ts +10 -10
  9. package/lib/hooks/use-hover.d.ts +10 -10
  10. package/lib/hooks/use-label-focus.d.ts +9 -9
  11. package/lib/hooks/use-multi-handlers.d.ts +11 -11
  12. package/lib/hooks/use-options.d.ts +13 -14
  13. package/lib/hooks/use-options.js +5 -5
  14. package/lib/hooks/use-primary-contrast-css-var-transfer.d.ts +11 -11
  15. package/lib/hooks/use-primary-contrast-css-var-transfer.js +2 -2
  16. package/lib/hooks/use-safe-id.d.ts +6 -6
  17. package/lib/index.css +189 -189
  18. package/lib/index.d.ts +4 -4
  19. package/lib/multiselect.d.ts +3 -3
  20. package/lib/multiselect.js +1 -0
  21. package/lib/native-select.d.ts +4 -4
  22. package/lib/parts/foldable.d.ts +34 -33
  23. package/lib/parts/form-trigger-wrapper.d.ts +34 -34
  24. package/lib/parts/hidden-select.d.ts +13 -13
  25. package/lib/parts/icons.d.ts +17 -17
  26. package/lib/parts/list-box.d.ts +13 -13
  27. package/lib/parts/multi-trigger.d.ts +12 -12
  28. package/lib/parts/native-select-options-with-groups.d.ts +8 -8
  29. package/lib/parts/popup-content.d.ts +20 -20
  30. package/lib/select-basic.d.ts +3 -3
  31. package/lib/select-searchable.d.ts +3 -3
  32. package/lib/select.d.ts +28 -28
  33. package/lib/styles/common.p.module.css.js +29 -29
  34. package/lib/styles/form-trigger.p.module.css.js +12 -12
  35. package/lib/styles/list-box.p.module.css.js +13 -13
  36. package/lib/types.d.ts +202 -202
  37. package/lib/utils/calculate-max-height-by-items.d.ts +13 -13
  38. package/lib/utils/calculate-max-height-by-items.js +11 -11
  39. package/lib/utils/get-empty-message.d.ts +6 -6
  40. package/lib/utils/get-option-value.d.ts +2 -2
  41. package/lib/utils/get-real-items-cnt.d.ts +2 -2
  42. package/lib/utils/get-text-from-nodes.d.ts +2 -2
  43. package/lib/utils/is-option-a-group.d.ts +2 -2
  44. package/lib/utils/item-to-string.d.ts +2 -2
  45. package/lib/utils/merge-props.d.ts +19 -19
  46. package/lib/utils/merge-props.js +17 -17
  47. package/lib/utils/throttle.d.ts +1 -1
  48. package/llm/components/multiselect.md +237 -0
  49. package/llm/components/select.md +549 -0
  50. package/llm/index.md +3 -0
  51. package/package.json +11 -10
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
- # Select
1
+ # Select, Multiselect and NativeSelect
2
2
 
3
- * [Usage examples](./docs/demo.md)
3
+ ## LLM
4
+
5
+ To get the docs for the LLM, check out [this index](./llm/index.md).
@@ -1,15 +1,15 @@
1
1
  var styles = {
2
- "icon": "_icon_uqfcxc_4",
3
- "sizeXS": "_sizeXS_uqfcxc_14",
4
- "sizeS": "_sizeS_uqfcxc_18",
5
- "sizeM": "_sizeM_uqfcxc_22",
6
- "sizeL": "_sizeL_uqfcxc_26",
7
- "light": "_light_uqfcxc_30",
8
- "dark": "_dark_uqfcxc_34",
9
- "allVariants": "_allVariants_uqfcxc_48",
10
- "variant16": "_variant16_uqfcxc_53",
11
- "variant20": "_variant20_uqfcxc_54",
12
- "variant24": "_variant24_uqfcxc_55",
13
- "variant28": "_variant28_uqfcxc_58"
2
+ "icon": "_icon_7dcaqk_4",
3
+ "sizeXS": "_sizeXS_7dcaqk_14",
4
+ "sizeS": "_sizeS_7dcaqk_18",
5
+ "sizeM": "_sizeM_7dcaqk_22",
6
+ "sizeL": "_sizeL_7dcaqk_26",
7
+ "light": "_light_7dcaqk_30",
8
+ "dark": "_dark_7dcaqk_34",
9
+ "allVariants": "_allVariants_7dcaqk_48",
10
+ "variant16": "_variant16_7dcaqk_53",
11
+ "variant20": "_variant20_7dcaqk_54",
12
+ "variant24": "_variant24_7dcaqk_55",
13
+ "variant28": "_variant28_7dcaqk_58"
14
14
  };
15
15
  export { styles as default };
@@ -1,29 +1,29 @@
1
- import PropTypes from 'prop-types';
2
- import type { NoOptionsMessage, NoOptionsMessageConfig } from './types';
3
- export declare const keyType: PropTypes.Requireable<string | number>;
4
- export declare const optionType: PropTypes.Requireable<PropTypes.InferProps<{
5
- label: PropTypes.Validator<PropTypes.ReactNodeLike>;
6
- value: PropTypes.Requireable<string | number>;
7
- }>>;
8
- export declare const optionsGroupType: PropTypes.Requireable<PropTypes.InferProps<{
9
- label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
10
- options: PropTypes.Requireable<PropTypes.InferProps<{
11
- label: PropTypes.Validator<PropTypes.ReactNodeLike>;
12
- value: PropTypes.Requireable<string | number>;
13
- }>[]>;
14
- }>>;
15
- export declare const nativeOptionType: PropTypes.Requireable<PropTypes.InferProps<{
16
- label: PropTypes.Validator<string>;
17
- value: PropTypes.Requireable<string | number>;
18
- disabled: PropTypes.Requireable<boolean>;
19
- }>>;
20
- export declare const nativeOptionsGroupType: PropTypes.Requireable<PropTypes.InferProps<{
21
- label: PropTypes.Requireable<string>;
22
- disabled: PropTypes.Requireable<boolean>;
23
- options: PropTypes.Requireable<PropTypes.InferProps<{
24
- label: PropTypes.Validator<PropTypes.ReactNodeLike>;
25
- value: PropTypes.Requireable<string | number>;
26
- }>[]>;
27
- }>>;
28
- export declare const noOptionsMessageConfigType: PropTypes.Validator<NoOptionsMessageConfig>;
29
- export declare const noOptionsMessageType: PropTypes.Validator<NoOptionsMessage>;
1
+ import PropTypes from 'prop-types';
2
+ import type { NoOptionsMessage, NoOptionsMessageConfig } from './types';
3
+ export declare const keyType: PropTypes.Requireable<NonNullable<string | number>>;
4
+ export declare const optionType: PropTypes.Requireable<PropTypes.InferProps<{
5
+ label: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
6
+ value: PropTypes.Requireable<NonNullable<string | number>>;
7
+ }>>;
8
+ export declare const optionsGroupType: PropTypes.Requireable<PropTypes.InferProps<{
9
+ label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
10
+ options: PropTypes.Requireable<PropTypes.InferProps<{
11
+ label: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
12
+ value: PropTypes.Requireable<NonNullable<string | number>>;
13
+ }>[]>;
14
+ }>>;
15
+ export declare const nativeOptionType: PropTypes.Requireable<PropTypes.InferProps<{
16
+ label: PropTypes.Validator<string>;
17
+ value: PropTypes.Requireable<NonNullable<string | number>>;
18
+ disabled: PropTypes.Requireable<boolean>;
19
+ }>>;
20
+ export declare const nativeOptionsGroupType: PropTypes.Requireable<PropTypes.InferProps<{
21
+ label: PropTypes.Requireable<string>;
22
+ disabled: PropTypes.Requireable<boolean>;
23
+ options: PropTypes.Requireable<PropTypes.InferProps<{
24
+ label: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
25
+ value: PropTypes.Requireable<NonNullable<string | number>>;
26
+ }>[]>;
27
+ }>>;
28
+ export declare const noOptionsMessageConfigType: PropTypes.Validator<NoOptionsMessageConfig>;
29
+ export declare const noOptionsMessageType: PropTypes.Validator<NoOptionsMessage>;
@@ -1,6 +1,6 @@
1
- export declare const NO_OPTIONS_VALUE = "\0__rs_select_no_options__";
2
- export declare const DEFAULT_NO_OPTIONS_MESSAGES: {
3
- noOptions: string;
4
- nothingFound: string;
5
- loading: string;
6
- };
1
+ export declare const NO_OPTIONS_VALUE = "\0__rs_select_no_options__";
2
+ export declare const DEFAULT_NO_OPTIONS_MESSAGES: {
3
+ noOptions: string;
4
+ nothingFound: string;
5
+ loading: string;
6
+ };
@@ -1,30 +1,30 @@
1
- import React from 'react';
2
- export declare type UseA11yArgs = {
3
- prefix?: string;
4
- baseId?: string;
5
- description?: React.ReactNode;
6
- error?: React.ReactNode;
7
- label?: React.ReactNode;
8
- fieldRef?: React.RefObject<HTMLElement>;
9
- isDisabled?: boolean;
10
- };
11
- export declare const useA11y: ({ baseId: baseIdFromProps, prefix, description, error, label, fieldRef, isDisabled }: UseA11yArgs) => {
12
- baseId: string;
13
- fieldProps: {
14
- 'aria-invalid': boolean;
15
- 'aria-describedby': string;
16
- 'aria-labelledby': string;
17
- id: string;
18
- };
19
- descriptionProps: {
20
- id: string;
21
- };
22
- errorMessageProps: {
23
- id: string;
24
- };
25
- labelProps: {
26
- id: string;
27
- htmlFor: string;
28
- onClick: () => void;
29
- };
30
- };
1
+ import React from 'react';
2
+ export type UseA11yArgs = {
3
+ prefix?: string;
4
+ baseId?: string;
5
+ description?: React.ReactNode;
6
+ error?: React.ReactNode;
7
+ label?: React.ReactNode;
8
+ fieldRef?: React.RefObject<HTMLElement>;
9
+ isDisabled?: boolean;
10
+ };
11
+ export declare const useA11y: ({ baseId: baseIdFromProps, prefix, description, error, label, fieldRef, isDisabled }: UseA11yArgs) => {
12
+ baseId: string;
13
+ fieldProps: {
14
+ 'aria-invalid': boolean;
15
+ 'aria-describedby': string;
16
+ 'aria-labelledby': string;
17
+ id: string;
18
+ };
19
+ descriptionProps: {
20
+ id: string;
21
+ };
22
+ errorMessageProps: {
23
+ id: string;
24
+ };
25
+ labelProps: {
26
+ id: string;
27
+ htmlFor: string;
28
+ onClick: () => void;
29
+ };
30
+ };
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import type { SelectSize } from '../types';
3
- export declare type UseActualSizeFromCssParams = {
4
- sizeFromProps: SelectSize;
5
- triggerRef: React.RefObject<HTMLElement>;
6
- };
7
- export declare const useActualSizeFromCss: ({ sizeFromProps, triggerRef }: UseActualSizeFromCssParams) => {
8
- observableRef: React.MutableRefObject<undefined>;
9
- size: "l" | "m" | "s";
10
- };
1
+ import React from 'react';
2
+ import type { SelectSize } from '../types';
3
+ export type UseActualSizeFromCssParams = {
4
+ sizeFromProps: SelectSize;
5
+ triggerRef: React.RefObject<HTMLElement>;
6
+ };
7
+ export declare const useActualSizeFromCss: ({ sizeFromProps, triggerRef }: UseActualSizeFromCssParams) => {
8
+ observableRef: React.RefObject<HTMLDivElement>;
9
+ size: "l" | "m" | "s";
10
+ };
@@ -8,7 +8,7 @@ const useActualSizeFromCss = _ref => {
8
8
  triggerRef
9
9
  } = _ref;
10
10
  // We use invisible and "untouchable" dummy element to observe `size` changes from css to fetch the actual size
11
- const observableRef = useRef();
11
+ const observableRef = useRef(null);
12
12
  const [size, setSize] = useState(sizeFromProps);
13
13
  useResizeObserver(observableRef, () => {
14
14
  var _context;
@@ -1,10 +1,10 @@
1
- export declare type UseFocusParams = {
2
- isDisabled?: boolean;
3
- };
4
- export declare const useFocus: ({ isDisabled }: UseFocusParams) => {
5
- isFocused: boolean;
6
- focusProps: {
7
- onFocus: () => void;
8
- onBlur: () => void;
9
- };
10
- };
1
+ export type UseFocusParams = {
2
+ isDisabled?: boolean;
3
+ };
4
+ export declare const useFocus: ({ isDisabled }: UseFocusParams) => {
5
+ isFocused: boolean;
6
+ focusProps: {
7
+ onFocus: () => void;
8
+ onBlur: () => void;
9
+ };
10
+ };
@@ -1,10 +1,10 @@
1
- export declare type UseHoverParams = {
2
- isDisabled?: boolean;
3
- };
4
- export declare const useHover: ({ isDisabled }: UseHoverParams) => {
5
- isHovered: boolean;
6
- hoverProps: {
7
- onMouseEnter: () => void;
8
- onMouseLeave: () => void;
9
- };
10
- };
1
+ export type UseHoverParams = {
2
+ isDisabled?: boolean;
3
+ };
4
+ export declare const useHover: ({ isDisabled }: UseHoverParams) => {
5
+ isHovered: boolean;
6
+ hoverProps: {
7
+ onMouseEnter: () => void;
8
+ onMouseLeave: () => void;
9
+ };
10
+ };
@@ -1,9 +1,9 @@
1
- export declare const useLabelFocus: () => {
2
- isFocusedByLabel: boolean;
3
- triggerFocusProps: {
4
- onBlur: () => void;
5
- };
6
- labelClickProps: {
7
- onClick: () => void;
8
- };
9
- };
1
+ export declare const useLabelFocus: () => {
2
+ isFocusedByLabel: boolean;
3
+ triggerFocusProps: {
4
+ onBlur: () => void;
5
+ };
6
+ labelClickProps: {
7
+ onClick: () => void;
8
+ };
9
+ };
@@ -1,11 +1,11 @@
1
- import type { SelectOption } from '../types';
2
- export declare type UseMultiHandlersArgs = {
3
- selectedItems: SelectOption[];
4
- onChange: (value: SelectOption[]) => void;
5
- };
6
- export declare const useMultiHandlers: ({ selectedItems, onChange }: UseMultiHandlersArgs) => {
7
- selectedMap: Map<import("../types").Key, SelectOption>;
8
- addItem: (item: SelectOption) => void;
9
- removeItem: (item: SelectOption) => void;
10
- removeAllItems: () => void;
11
- };
1
+ import type { SelectOption } from '../types';
2
+ export type UseMultiHandlersArgs = {
3
+ selectedItems: SelectOption[];
4
+ onChange: (value: SelectOption[]) => void;
5
+ };
6
+ export declare const useMultiHandlers: ({ selectedItems, onChange }: UseMultiHandlersArgs) => {
7
+ selectedMap: Map<import("../types").Key, SelectOption>;
8
+ addItem: (item: SelectOption) => void;
9
+ removeItem: (item: SelectOption) => void;
10
+ removeAllItems: () => void;
11
+ };
@@ -1,14 +1,13 @@
1
- /// <reference types="react" />
2
- import type { SelectOptionOrGroup, SelectOption, ListBoxItem } from '../types';
3
- /**
4
- * Convert an array of options with possible groups to the flat array of options, stripping them of the groups.
5
- * Also creating a list for ListBox component with indexes and keys.
6
- * Supports filtering by returning the setFilterString function.
7
- * @param options
8
- */
9
- export declare const useOptions: (options: SelectOptionOrGroup[]) => {
10
- setFilterString: import("react").Dispatch<import("react").SetStateAction<string>>;
11
- filterString: string;
12
- flattenedOptions: SelectOption[];
13
- listBoxItems: ListBoxItem[];
14
- };
1
+ import type { SelectOptionOrGroup, SelectOption, ListBoxItem } from '../types';
2
+ /**
3
+ * Convert an array of options with possible groups to the flat array of options, stripping them of the groups.
4
+ * Also creating a list for ListBox component with indexes and keys.
5
+ * Supports filtering by returning the setFilterString function.
6
+ * @param options
7
+ */
8
+ export declare const useOptions: (options: SelectOptionOrGroup[]) => {
9
+ setFilterString: import("react").Dispatch<import("react").SetStateAction<string>>;
10
+ filterString: string;
11
+ flattenedOptions: SelectOption[];
12
+ listBoxItems: ListBoxItem[];
13
+ };
@@ -16,11 +16,11 @@ const createFilter = substring => {
16
16
  return _includesInstanceProperty(_context = string.toLowerCase()).call(_context, lowerSubstring);
17
17
  };
18
18
  };
19
- /**
20
- * Convert an array of options with possible groups to the flat array of options, stripping them of the groups.
21
- * Also creating a list for ListBox component with indexes and keys.
22
- * Supports filtering by returning the setFilterString function.
23
- * @param options
19
+ /**
20
+ * Convert an array of options with possible groups to the flat array of options, stripping them of the groups.
21
+ * Also creating a list for ListBox component with indexes and keys.
22
+ * Supports filtering by returning the setFilterString function.
23
+ * @param options
24
24
  */
25
25
 
26
26
 
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
- export declare type UsePrimaryContrastCssVarTransferParams = {
3
- triggerRef: React.RefObject<HTMLElement>;
4
- isOpen: boolean;
5
- };
6
- /**
7
- * Transfer primary contrast css var to the dropdown, but only when the dropdown opens
8
- */
9
- export declare const usePrimaryContrastCssVarTransfer: ({ triggerRef, isOpen }: UsePrimaryContrastCssVarTransferParams) => {
10
- isPrimaryContrast: boolean;
11
- };
1
+ import React from 'react';
2
+ export type UsePrimaryContrastCssVarTransferParams = {
3
+ triggerRef: React.RefObject<HTMLElement>;
4
+ isOpen: boolean;
5
+ };
6
+ /**
7
+ * Transfer primary contrast css var to the dropdown, but only when the dropdown opens
8
+ */
9
+ export declare const usePrimaryContrastCssVarTransfer: ({ triggerRef, isOpen }: UsePrimaryContrastCssVarTransferParams) => {
10
+ isPrimaryContrast: boolean;
11
+ };
@@ -1,6 +1,6 @@
1
1
  import { useRef } from 'react';
2
- /**
3
- * Transfer primary contrast css var to the dropdown, but only when the dropdown opens
2
+ /**
3
+ * Transfer primary contrast css var to the dropdown, but only when the dropdown opens
4
4
  */
5
5
 
6
6
  const usePrimaryContrastCssVarTransfer = _ref => {
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
- export declare const useFallbackId: {
3
- (): string;
4
- counter: number;
5
- };
6
- export declare const useSafeId: typeof React.useId;
1
+ import React from 'react';
2
+ export declare const useFallbackId: {
3
+ (): string;
4
+ counter: number;
5
+ };
6
+ export declare const useSafeId: typeof React.useId;