@instructure/ui-simple-select 11.7.2-snapshot-48 → 11.7.2-snapshot-49

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 (39) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/es/SimpleSelect/v2/Group/index.js +46 -0
  3. package/es/SimpleSelect/v2/Group/props.js +26 -0
  4. package/es/SimpleSelect/v2/Option/index.js +48 -0
  5. package/es/SimpleSelect/v2/Option/props.js +26 -0
  6. package/es/SimpleSelect/v2/index.js +444 -0
  7. package/es/SimpleSelect/v2/props.js +26 -0
  8. package/es/exports/b.js +26 -0
  9. package/lib/SimpleSelect/v2/Group/index.js +52 -0
  10. package/lib/SimpleSelect/v2/Group/props.js +31 -0
  11. package/lib/SimpleSelect/v2/Option/index.js +54 -0
  12. package/lib/SimpleSelect/v2/Option/props.js +31 -0
  13. package/lib/SimpleSelect/v2/index.js +454 -0
  14. package/lib/SimpleSelect/v2/props.js +31 -0
  15. package/lib/exports/b.js +26 -0
  16. package/package.json +21 -21
  17. package/src/SimpleSelect/v2/Group/index.tsx +51 -0
  18. package/src/SimpleSelect/v2/Group/props.ts +49 -0
  19. package/src/SimpleSelect/v2/Option/index.tsx +52 -0
  20. package/src/SimpleSelect/v2/Option/props.ts +83 -0
  21. package/src/SimpleSelect/v2/README.md +157 -0
  22. package/src/SimpleSelect/v2/index.tsx +559 -0
  23. package/src/SimpleSelect/v2/props.ts +300 -0
  24. package/src/exports/b.ts +31 -0
  25. package/tsconfig.build.tsbuildinfo +1 -1
  26. package/types/SimpleSelect/v2/Group/index.d.ts +20 -0
  27. package/types/SimpleSelect/v2/Group/index.d.ts.map +1 -0
  28. package/types/SimpleSelect/v2/Group/props.d.ts +19 -0
  29. package/types/SimpleSelect/v2/Group/props.d.ts.map +1 -0
  30. package/types/SimpleSelect/v2/Option/index.d.ts +26 -0
  31. package/types/SimpleSelect/v2/Option/index.d.ts.map +1 -0
  32. package/types/SimpleSelect/v2/Option/props.d.ts +45 -0
  33. package/types/SimpleSelect/v2/Option/props.d.ts.map +1 -0
  34. package/types/SimpleSelect/v2/index.d.ts +90 -0
  35. package/types/SimpleSelect/v2/index.d.ts.map +1 -0
  36. package/types/SimpleSelect/v2/props.d.ts +180 -0
  37. package/types/SimpleSelect/v2/props.d.ts.map +1 -0
  38. package/types/exports/b.d.ts +7 -0
  39. package/types/exports/b.d.ts.map +1 -0
@@ -0,0 +1,20 @@
1
+ import { Component } from 'react';
2
+ import type { SimpleSelectGroupProps } from './props';
3
+ /**
4
+ ---
5
+ parent: SimpleSelect
6
+ id: SimpleSelect.Group
7
+ ---
8
+ **/
9
+ declare class Group extends Component<SimpleSelectGroupProps> {
10
+ static readonly componentId = "SimpleSelect.Group";
11
+ static allowedProps: readonly (keyof {
12
+ renderLabel: React.ReactNode | (() => React.ReactNode);
13
+ children?: React.ReactNode;
14
+ })[];
15
+ static defaultProps: {};
16
+ render(): null;
17
+ }
18
+ export default Group;
19
+ export { Group };
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SimpleSelect/v2/Group/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAGrD;;;;;GAKG;AACH,cAAM,KAAM,SAAQ,SAAS,CAAC,sBAAsB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,wBAAuB;IAElD,MAAM,CAAC,YAAY;;;SAAe;IAClC,MAAM,CAAC,YAAY,KAAK;IAGxB,MAAM;CAKP;AAED,eAAe,KAAK,CAAA;AACpB,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { OtherHTMLAttributes } from '@instructure/shared-types';
3
+ type SimpleSelectGroupOwnProps = {
4
+ /**
5
+ * The label associated with the group options.
6
+ */
7
+ renderLabel: React.ReactNode | (() => React.ReactNode);
8
+ /**
9
+ * Children of type `<SimpleSelect.Option />` that will be considered part of the group.
10
+ */
11
+ children?: React.ReactNode;
12
+ };
13
+ type PropKeys = keyof SimpleSelectGroupOwnProps;
14
+ type AllowedPropKeys = Readonly<Array<PropKeys>>;
15
+ type SimpleSelectGroupProps = SimpleSelectGroupOwnProps & OtherHTMLAttributes<SimpleSelectGroupOwnProps>;
16
+ declare const allowedProps: AllowedPropKeys;
17
+ export type { SimpleSelectGroupProps };
18
+ export { allowedProps };
19
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/SimpleSelect/v2/Group/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,KAAK,yBAAyB,GAAG;IAC/B;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAA;IACtD;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,yBAAyB,CAAA;AAE/C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,sBAAsB,GAAG,yBAAyB,GACrD,mBAAmB,CAAC,yBAAyB,CAAC,CAAA;AAChD,QAAA,MAAM,YAAY,EAAE,eAA6C,CAAA;AAEjE,YAAY,EAAE,sBAAsB,EAAE,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,26 @@
1
+ import { Component } from 'react';
2
+ import type { SimpleSelectOptionProps } from './props';
3
+ /**
4
+ ---
5
+ parent: SimpleSelect
6
+ id: SimpleSelect.Option
7
+ ---
8
+ **/
9
+ declare class Option extends Component<SimpleSelectOptionProps> {
10
+ static readonly componentId = "SimpleSelect.Option";
11
+ static allowedProps: readonly (keyof {
12
+ id: string;
13
+ value: string | number;
14
+ isDisabled?: boolean;
15
+ children?: string;
16
+ renderBeforeLabel?: import("./props").RenderSimpleSelectOptionLabel;
17
+ renderAfterLabel?: import("./props").RenderSimpleSelectOptionLabel;
18
+ })[];
19
+ static defaultProps: {
20
+ isDisabled: boolean;
21
+ };
22
+ render(): null;
23
+ }
24
+ export default Option;
25
+ export { Option };
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SimpleSelect/v2/Option/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAGtD;;;;;GAKG;AACH,cAAM,MAAO,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IACrD,MAAM,CAAC,QAAQ,CAAC,WAAW,yBAAwB;IAEnD,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;MAElB;IAGD,MAAM;CAKP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import type { OtherHTMLAttributes } from '@instructure/shared-types';
3
+ import { Renderable } from '@instructure/shared-types';
4
+ type OptionProps = {
5
+ id: SimpleSelectOptionOwnProps['id'];
6
+ isDisabled?: SimpleSelectOptionOwnProps['isDisabled'];
7
+ isSelected?: boolean;
8
+ isHighlighted?: boolean;
9
+ children?: React.ReactNode;
10
+ };
11
+ type RenderSimpleSelectOptionLabel = Renderable<OptionProps>;
12
+ type SimpleSelectOptionOwnProps = {
13
+ /**
14
+ * The id for the option. **Must be globally unique**, it will be translated
15
+ * to an `id` prop in the DOM.
16
+ */
17
+ id: string;
18
+ /**
19
+ * The value for the option.
20
+ */
21
+ value: string | number;
22
+ /**
23
+ * Whether or not this option is disabled.
24
+ */
25
+ isDisabled?: boolean;
26
+ /**
27
+ * Content to display as the option label.
28
+ */
29
+ children?: string;
30
+ /**
31
+ * Content to display before the option label, such as an icon.
32
+ */
33
+ renderBeforeLabel?: RenderSimpleSelectOptionLabel;
34
+ /**
35
+ * Content to display after the option label, such as an icon.
36
+ */
37
+ renderAfterLabel?: RenderSimpleSelectOptionLabel;
38
+ };
39
+ type PropKeys = keyof SimpleSelectOptionOwnProps;
40
+ type AllowedPropKeys = Readonly<Array<PropKeys>>;
41
+ type SimpleSelectOptionProps = SimpleSelectOptionOwnProps & OtherHTMLAttributes<SimpleSelectOptionOwnProps>;
42
+ declare const allowedProps: AllowedPropKeys;
43
+ export type { SimpleSelectOptionProps, RenderSimpleSelectOptionLabel };
44
+ export { allowedProps };
45
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/SimpleSelect/v2/Option/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEtD,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,0BAA0B,CAAC,IAAI,CAAC,CAAA;IACpC,UAAU,CAAC,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAA;IACrD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,6BAA6B,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;AAE5D,KAAK,0BAA0B,GAAG;IAChC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAA;IACjD;;OAEG;IACH,gBAAgB,CAAC,EAAE,6BAA6B,CAAA;CACjD,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,0BAA0B,CAAA;AAEhD,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,uBAAuB,GAAG,0BAA0B,GACvD,mBAAmB,CAAC,0BAA0B,CAAC,CAAA;AACjD,QAAA,MAAM,YAAY,EAAE,eAOnB,CAAA;AAED,YAAY,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,90 @@
1
+ import { ComponentElement, Component } from 'react';
2
+ import { Select } from '@instructure/ui-select/latest';
3
+ import type { SelectProps } from '@instructure/ui-select/latest';
4
+ import { Option } from './Option';
5
+ import type { SimpleSelectOptionProps } from './Option/props';
6
+ import { Group } from './Group';
7
+ import type { SimpleSelectGroupProps } from './Group/props';
8
+ import type { SimpleSelectProps } from './props';
9
+ import { SimpleSelectState } from './props';
10
+ type OptionChild = ComponentElement<SimpleSelectOptionProps, Option>;
11
+ type GroupChild = ComponentElement<SimpleSelectGroupProps, Group>;
12
+ type GetOption = <F extends keyof SimpleSelectOptionProps>(field: F, value?: SimpleSelectOptionProps[F]) => OptionChild | undefined;
13
+ /**
14
+ ---
15
+ category: components
16
+ tags: form, field, dropdown
17
+ ---
18
+ **/
19
+ declare class SimpleSelect extends Component<SimpleSelectProps, SimpleSelectState> {
20
+ static readonly componentId = "SimpleSelect";
21
+ static Option: typeof Option;
22
+ static Group: typeof Group;
23
+ static allowedProps: readonly ("value" | "children" | "defaultValue" | "onChange" | "onShowOptions" | "onHideOptions" | "renderEmptyOption" | keyof {
24
+ renderLabel: import("@instructure/shared-types").Renderable;
25
+ id?: string;
26
+ size?: "small" | "medium" | "large";
27
+ assistiveText?: string;
28
+ placeholder?: string;
29
+ interaction?: "enabled" | "disabled" | "readonly";
30
+ isRequired?: boolean;
31
+ isInline?: boolean;
32
+ width?: string;
33
+ visibleOptionsCount?: number;
34
+ optionsMaxHeight?: string;
35
+ optionsMaxWidth?: string;
36
+ messages?: import("@instructure/ui-form-field/types/exports/a.js").FormMessage[];
37
+ placement?: import("@instructure/ui-position").PlacementPropValues;
38
+ constrain?: import("@instructure/ui-position").PositionConstraint;
39
+ mountNode?: import("@instructure/ui-position").PositionMountNode;
40
+ inputRef?: (inputElement: HTMLInputElement | null) => void;
41
+ listRef?: (listElement: HTMLUListElement | null) => void;
42
+ renderBeforeInput?: import("@instructure/shared-types").Renderable;
43
+ renderAfterInput?: import("@instructure/shared-types").Renderable;
44
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
45
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
46
+ isOptionContentAppliedToInput?: boolean;
47
+ layout?: "stacked" | "inline";
48
+ })[];
49
+ static defaultProps: {
50
+ size: string;
51
+ isRequired: boolean;
52
+ isInline: boolean;
53
+ visibleOptionsCount: number;
54
+ placement: string;
55
+ constrain: string;
56
+ renderEmptyOption: string;
57
+ isOptionContentAppliedToInput: boolean;
58
+ };
59
+ ref: Select | null;
60
+ private readonly _emptyOptionId;
61
+ constructor(props: SimpleSelectProps);
62
+ get _select(): Select | null;
63
+ focus(): void;
64
+ blur(): void;
65
+ get focused(): boolean;
66
+ get id(): string | undefined;
67
+ get isControlled(): boolean;
68
+ get interaction(): import("@instructure/ui-react-utils").InteractionType;
69
+ hasOptionsChanged(prevChildren: SimpleSelectProps['children'], currentChildren: SimpleSelectProps['children']): boolean;
70
+ componentDidUpdate(prevProps: SimpleSelectProps): void;
71
+ getInitialOption(props: SimpleSelectProps): OptionChild | undefined;
72
+ getOptionLabelById(id: string): string | undefined;
73
+ getFirstOption(): OptionChild | undefined;
74
+ getOption: GetOption;
75
+ getOptionByPosition(position: 'first' | 'last'): OptionChild | undefined;
76
+ handleRef: (node: Select) => void;
77
+ handleBlur: SelectProps['onBlur'];
78
+ handleShowOptions: SelectProps['onRequestShowOptions'];
79
+ handleHideOptions: SelectProps['onRequestHideOptions'];
80
+ handleHighlightOption: SelectProps['onRequestHighlightOption'];
81
+ handleSelectOption: SelectProps['onRequestSelectOption'];
82
+ renderChildren(): OptionChild | (OptionChild | GroupChild)[];
83
+ renderEmptyOption(): OptionChild;
84
+ renderOption(option: OptionChild): OptionChild;
85
+ renderGroup(group: GroupChild): GroupChild;
86
+ render(): import("@emotion/react/jsx-runtime").JSX.Element;
87
+ }
88
+ export { SimpleSelect };
89
+ export default SimpleSelect;
90
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SimpleSelect/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAEL,gBAAgB,EAChB,SAAS,EAGV,MAAM,OAAO,CAAA;AAWd,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEzD,KAAK,WAAW,GAAG,gBAAgB,CAAC,uBAA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Q,CAAC,CAKhC;IAED,iBAAiB,EAAE,WAAW,CAAC,sBAAsB,CAAC,CA6BrD;IAED,iBAAiB,EAAE,WAAW,CAAC,sBAAsB,CAAC,CAYrD;IAED,qBAAqB,EAAE,WAAW,CAAC,0BAA0B,CAAC,CAU7D;IAED,kBAAkB,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAqCvD;IAED,cAAc;IAsBd,iBAAiB,IASV,WAAW;IAGlB,YAAY,CAAC,MAAM,EAAE,WAAW,GA4CzB,WAAW;IAGlB,WAAW,CAAC,KAAK,EAAE,UAAU,GAYtB,UAAU;IAGjB,MAAM;CA0EP;AAED,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,eAAe,YAAY,CAAA"}
@@ -0,0 +1,180 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import type { FormMessage } from '@instructure/ui-form-field/latest';
3
+ import type { OtherHTMLAttributes, PickPropsWithExceptions } from '@instructure/shared-types';
4
+ import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
5
+ import type { SelectOwnProps } from '@instructure/ui-select/latest';
6
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils';
7
+ import { Renderable } from '@instructure/shared-types';
8
+ type SimpleSelectOwnProps = PropsPassedToSelect & {
9
+ /**
10
+ * The value corresponding to the value of the selected option. If defined,
11
+ * the component will act controlled and will not manage its own state.
12
+ */
13
+ value?: string | number;
14
+ /**
15
+ * The value of the option to select by default, when uncontrolled.
16
+ */
17
+ defaultValue?: string;
18
+ /**
19
+ * Callback fired when a new option is selected.
20
+ */
21
+ onChange?: (event: React.SyntheticEvent, data: {
22
+ value?: string | number;
23
+ id?: string;
24
+ }) => void;
25
+ /**
26
+ * Callback fired when the options list is shown.
27
+ */
28
+ onShowOptions?: (event: React.SyntheticEvent) => void;
29
+ /**
30
+ * Callback fired when the options list is hidden.
31
+ */
32
+ onHideOptions?: (event: React.SyntheticEvent) => void;
33
+ /**
34
+ * Content to display in the list when no options are available.
35
+ */
36
+ renderEmptyOption?: Renderable;
37
+ /**
38
+ * Children of type `<SimpleSelect.Option />` or `<SimpleSelect.Group />`.
39
+ */
40
+ children?: React.ReactNode;
41
+ };
42
+ type PropsPassedToSelect = {
43
+ /**
44
+ * The form field label.
45
+ */
46
+ renderLabel: Renderable;
47
+ /**
48
+ * The id of the text input. One is generated if not supplied.
49
+ */
50
+ id?: string;
51
+ /**
52
+ * The size of the text input.
53
+ */
54
+ size?: 'small' | 'medium' | 'large';
55
+ /**
56
+ * Additional helpful text to provide to screen readers about the operation
57
+ * of the component. Provided via aria-describedby.
58
+ */
59
+ assistiveText?: string;
60
+ /**
61
+ * Html placeholder text to display when the input has no value. This should
62
+ * be hint text, not a label replacement.
63
+ */
64
+ placeholder?: string;
65
+ /**
66
+ * Specifies if interaction with the input is enabled, disabled, or readonly.
67
+ * When "disabled", the input changes visibly to indicate that it cannot
68
+ * receive user interactions. When "readonly" the input still cannot receive
69
+ * user interactions but it keeps the same styles as if it were enabled.
70
+ */
71
+ interaction?: 'enabled' | 'disabled' | 'readonly';
72
+ /**
73
+ * Whether or not the text input is required.
74
+ */
75
+ isRequired?: boolean;
76
+ /**
77
+ * Whether the input is rendered inline with other elements or if it
78
+ * is rendered as a block level element.
79
+ */
80
+ isInline?: boolean;
81
+ /**
82
+ * The width of the text input.
83
+ */
84
+ width?: string;
85
+ /**
86
+ * The number of options that should be visible before having to scroll. Works best when the options are the same height.
87
+ */
88
+ visibleOptionsCount?: number;
89
+ /**
90
+ * The max height the options list can be before having to scroll. If
91
+ * set, it will __override__ the `visibleOptionsCount` prop.
92
+ */
93
+ optionsMaxHeight?: string;
94
+ /**
95
+ * The max width the options list can be before option text wraps. If not
96
+ * set, the list will only display as wide as the text input.
97
+ */
98
+ optionsMaxWidth?: string;
99
+ /**
100
+ * Displays messages and validation for the input. It should be an array of
101
+ * objects with the following shape:
102
+ * `{
103
+ * text: ReactNode,
104
+ * type: One of: ['newError', 'error', 'hint', 'success', 'screenreader-only']
105
+ * }`
106
+ */
107
+ messages?: FormMessage[];
108
+ /**
109
+ * The placement of the options list.
110
+ */
111
+ placement?: PlacementPropValues;
112
+ /**
113
+ * The parent in which to constrain the placement.
114
+ */
115
+ constrain?: PositionConstraint;
116
+ /**
117
+ * An element or a function returning an element to use mount the options
118
+ * list to in the DOM (defaults to `document.body`)
119
+ */
120
+ mountNode?: PositionMountNode;
121
+ /**
122
+ * A ref to the html `input` element.
123
+ */
124
+ inputRef?: (inputElement: HTMLInputElement | null) => void;
125
+ /**
126
+ * A ref to the html `ul` element.
127
+ */
128
+ listRef?: (listElement: HTMLUListElement | null) => void;
129
+ /**
130
+ * Content to display before the text input. This will commonly be an icon.
131
+ */
132
+ renderBeforeInput?: Renderable;
133
+ /**
134
+ * Content to display after the text input. This content will replace the
135
+ * default arrow icons.
136
+ */
137
+ renderAfterInput?: Renderable;
138
+ /**
139
+ * Callback fired when text input receives focus.
140
+ */
141
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
142
+ /**
143
+ * Callback fired when text input loses focus.
144
+ */
145
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
146
+ /**
147
+ * Whether or not the content of the selected `SimpleSelect.Option`'s `renderBeforeLabel` and `renderAfterLabel` appear in the input field.
148
+ *
149
+ * If the selected `SimpleSelect.Option` has both `renderBeforeLabel` and `renderAfterLabel` content, both will be displayed in the input field.
150
+ *
151
+ * `SimpleSelect.Option`'s `renderBeforeLabel` and `renderAfterLabel` content will not be displayed, if `SimpleSelect`'s `inputValue` is an empty value, null or undefined.
152
+ *
153
+ * If `true` and the selected `SimpleSelect.Option` has a `renderAfterLabel` value, it will replace the default arrow icon.
154
+ *
155
+ * If `true` and `SimpleSelect`'s `renderBeforeInput` or `renderAfterInput` prop is set, it will display the selected `SimpleSelect.Option`'s `renderBeforeLabel` and `renderAfterLabel` instead of `SimpleSelect`'s `renderBeforeInput` or `renderAfterInput` value.
156
+ *
157
+ * If the selected `SimpleSelect.Option`'s `renderAfterLabel` value is empty, default arrow icon will be rendered.
158
+ */
159
+ isOptionContentAppliedToInput?: boolean;
160
+ /**
161
+ * In `stacked` mode the input is below the label.
162
+ *
163
+ * In `inline` mode the input is to the right/left (depending on text direction) of the label,
164
+ * and the layout will look like `stacked` for small screens.
165
+ */
166
+ layout?: 'stacked' | 'inline';
167
+ };
168
+ type PropKeys = keyof SimpleSelectOwnProps;
169
+ type AllowedPropKeys = Readonly<Array<PropKeys>>;
170
+ type SimpleSelectProps = PickPropsWithExceptions<SelectOwnProps, keyof PropsPassedToSelect | 'children' | 'onRequestShowOptions' | 'onRequestHideOptions' | 'onRequestHighlightOption' | 'onRequestSelectOption' | 'inputValue' | 'isShowingOptions' | 'layout'> & SimpleSelectOwnProps & OtherHTMLAttributes<SimpleSelectOwnProps, InputHTMLAttributes<SimpleSelectOwnProps & Element>> & WithDeterministicIdProps;
171
+ type SimpleSelectState = {
172
+ inputValue?: string;
173
+ isShowingOptions: boolean;
174
+ highlightedOptionId?: string;
175
+ selectedOptionId?: string;
176
+ };
177
+ declare const allowedProps: AllowedPropKeys;
178
+ export type { SimpleSelectProps, SimpleSelectState };
179
+ export { allowedProps };
180
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/SimpleSelect/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AA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BAAsB,GACtB,sBAAsB,GACtB,0BAA0B,GAC1B,uBAAuB,GACvB,YAAY,GACZ,kBAAkB,GAClB,QAAQ,CACX,GACC,oBAAoB,GACpB,mBAAmB,CACjB,oBAAoB,EACpB,mBAAmB,CAAC,oBAAoB,GAAG,OAAO,CAAC,CACpD,GACD,wBAAwB,CAAA;AAE1B,KAAK,iBAAiB,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eA+BnB,CAAA;AAED,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,7 @@
1
+ export { SimpleSelect } from '../SimpleSelect/v2';
2
+ export { Group as SimpleSelectGroup } from '../SimpleSelect/v2/Group';
3
+ export { Option as SimpleSelectOption } from '../SimpleSelect/v2/Option';
4
+ export type { SimpleSelectProps } from '../SimpleSelect/v2/props';
5
+ export type { SimpleSelectGroupProps } from '../SimpleSelect/v2/Group/props';
6
+ export type { SimpleSelectOptionProps } from '../SimpleSelect/v2/Option/props';
7
+ //# sourceMappingURL=b.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../../src/exports/b.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,KAAK,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,EAAE,MAAM,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAExE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC5E,YAAY,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA"}