@instructure/ui-select 11.7.2-snapshot-47 → 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 (44) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/es/Select/v2/Group/index.js +47 -0
  3. package/es/Select/v2/Group/props.js +26 -0
  4. package/es/Select/v2/Option/index.js +51 -0
  5. package/es/Select/v2/Option/props.js +26 -0
  6. package/es/Select/v2/index.js +704 -0
  7. package/es/Select/v2/props.js +35 -0
  8. package/es/Select/v2/styles.js +41 -0
  9. package/es/exports/b.js +26 -0
  10. package/lib/Select/v2/Group/index.js +53 -0
  11. package/lib/Select/v2/Group/props.js +31 -0
  12. package/lib/Select/v2/Option/index.js +57 -0
  13. package/lib/Select/v2/Option/props.js +31 -0
  14. package/lib/Select/v2/index.js +714 -0
  15. package/lib/Select/v2/props.js +40 -0
  16. package/lib/Select/v2/styles.js +47 -0
  17. package/lib/exports/b.js +26 -0
  18. package/package.json +29 -29
  19. package/src/Select/v2/Group/index.tsx +52 -0
  20. package/src/Select/v2/Group/props.ts +48 -0
  21. package/src/Select/v2/Option/index.tsx +56 -0
  22. package/src/Select/v2/Option/props.ts +82 -0
  23. package/src/Select/v2/README.md +1342 -0
  24. package/src/Select/v2/index.tsx +897 -0
  25. package/src/Select/v2/props.ts +333 -0
  26. package/src/Select/v2/styles.ts +48 -0
  27. package/src/exports/b.ts +31 -0
  28. package/tsconfig.build.tsbuildinfo +1 -1
  29. package/types/Select/v2/Group/index.d.ts +21 -0
  30. package/types/Select/v2/Group/index.d.ts.map +1 -0
  31. package/types/Select/v2/Group/props.d.ts +19 -0
  32. package/types/Select/v2/Group/props.d.ts.map +1 -0
  33. package/types/Select/v2/Option/index.d.ts +28 -0
  34. package/types/Select/v2/Option/index.d.ts.map +1 -0
  35. package/types/Select/v2/Option/props.d.ts +43 -0
  36. package/types/Select/v2/Option/props.d.ts.map +1 -0
  37. package/types/Select/v2/index.d.ts +138 -0
  38. package/types/Select/v2/index.d.ts.map +1 -0
  39. package/types/Select/v2/props.d.ts +206 -0
  40. package/types/Select/v2/props.d.ts.map +1 -0
  41. package/types/Select/v2/styles.d.ts +12 -0
  42. package/types/Select/v2/styles.d.ts.map +1 -0
  43. package/types/exports/b.d.ts +7 -0
  44. package/types/exports/b.d.ts.map +1 -0
@@ -0,0 +1,21 @@
1
+ import { Component } from 'react';
2
+ import type { SelectGroupProps } from './props';
3
+ /**
4
+ ---
5
+ parent: Select
6
+ id: Select.Group
7
+ ---
8
+ @module Group
9
+ **/
10
+ declare class Group extends Component<SelectGroupProps> {
11
+ static readonly componentId = "Select.Group";
12
+ static allowedProps: readonly (keyof {
13
+ renderLabel: import("@instructure/shared-types").Renderable;
14
+ children?: React.ReactNode;
15
+ })[];
16
+ static defaultProps: {};
17
+ render(): null;
18
+ }
19
+ export default Group;
20
+ export { Group };
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Select/v2/Group/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C;;;;;;GAMG;AACH,cAAM,KAAM,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAC7C,MAAM,CAAC,QAAQ,CAAC,WAAW,kBAAiB;IAE5C,MAAM,CAAC,YAAY;;;SAAe;IAElC,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, Renderable } from '@instructure/shared-types';
3
+ type SelectGroupOwnProps = {
4
+ /**
5
+ * The label associated with the group options.
6
+ */
7
+ renderLabel: Renderable;
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 SelectGroupOwnProps;
14
+ type AllowedPropKeys = Readonly<Array<PropKeys>>;
15
+ type SelectGroupProps = SelectGroupOwnProps & OtherHTMLAttributes<SelectGroupOwnProps>;
16
+ declare const allowedProps: AllowedPropKeys;
17
+ export type { SelectGroupProps };
18
+ export { allowedProps };
19
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/Select/v2/Group/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEhF,KAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,WAAW,EAAE,UAAU,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,mBAAmB,CAAA;AAEzC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,gBAAgB,GAAG,mBAAmB,GACzC,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;AAC1C,QAAA,MAAM,YAAY,EAAE,eAA6C,CAAA;AAEjE,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { Component } from 'react';
2
+ import type { SelectOptionProps } from './props';
3
+ /**
4
+ ---
5
+ parent: Select
6
+ id: Select.Option
7
+ ---
8
+ @module Option
9
+ **/
10
+ declare class Option extends Component<SelectOptionProps> {
11
+ static readonly componentId = "Select.Option";
12
+ static allowedProps: readonly ("renderBeforeLabel" | "renderAfterLabel" | keyof {
13
+ id: string;
14
+ isHighlighted?: boolean;
15
+ isSelected?: boolean;
16
+ isDisabled?: boolean;
17
+ children?: React.ReactNode;
18
+ })[];
19
+ static defaultProps: {
20
+ isHighlighted: boolean;
21
+ isSelected: boolean;
22
+ isDisabled: boolean;
23
+ };
24
+ render(): null;
25
+ }
26
+ export default Option;
27
+ export { Option };
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Select/v2/Option/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGhD;;;;;;GAMG;AACH,cAAM,MAAO,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,mBAAkB;IAE7C,MAAM,CAAC,YAAY;;;;;;SAAe;IAElC,MAAM,CAAC,YAAY;;;;MAIlB;IAGD,MAAM;CAKP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import type { OtherHTMLAttributes, Renderable } from '@instructure/shared-types';
3
+ type OptionProps = {
4
+ /**
5
+ * The id for the option. **Must be globally unique**, it will be translated
6
+ * to an `id` prop in the DOM.
7
+ */
8
+ id: string;
9
+ /**
10
+ * Whether or not this option is highlighted.
11
+ */
12
+ isHighlighted?: boolean;
13
+ /**
14
+ * Whether or not this option is selected.
15
+ */
16
+ isSelected?: boolean;
17
+ /**
18
+ * Whether or not this option is disabled.
19
+ */
20
+ isDisabled?: boolean;
21
+ /**
22
+ * Content to display as the option label.
23
+ */
24
+ children?: React.ReactNode;
25
+ };
26
+ type RenderSelectOptionLabel = Renderable<OptionProps>;
27
+ type SelectOptionOwnProps = OptionProps & {
28
+ /**
29
+ * Content to display before the option label, such as an icon.
30
+ */
31
+ renderBeforeLabel?: RenderSelectOptionLabel;
32
+ /**
33
+ * Content to display after the option label, such as an icon.
34
+ */
35
+ renderAfterLabel?: RenderSelectOptionLabel;
36
+ };
37
+ type PropKeys = keyof SelectOptionOwnProps;
38
+ type AllowedPropKeys = Readonly<Array<PropKeys>>;
39
+ type SelectOptionProps = SelectOptionOwnProps & OtherHTMLAttributes<SelectOptionOwnProps>;
40
+ declare const allowedProps: AllowedPropKeys;
41
+ export type { SelectOptionProps, RenderSelectOptionLabel };
42
+ export { allowedProps };
43
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/Select/v2/Option/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEhF,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,uBAAuB,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;AAEtD,KAAK,oBAAoB,GAAG,WAAW,GAAG;IACxC;;OAEG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;IAC3C;;OAEG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAA;CAC3C,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,oBAAoB,CAAA;AAE1C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,iBAAiB,GAAG,oBAAoB,GAC3C,mBAAmB,CAAC,oBAAoB,CAAC,CAAA;AAC3C,QAAA,MAAM,YAAY,EAAE,eAQnB,CAAA;AAED,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,138 @@
1
+ import { ComponentElement, Component, ReactNode } from 'react';
2
+ import type { OptionsItemProps, OptionsSeparatorProps } from '@instructure/ui-options/latest';
3
+ import type { SelectableProps, SelectableRender } from '@instructure/ui-selectable';
4
+ import { Group } from './Group';
5
+ import type { SelectGroupProps } from './Group/props';
6
+ import { Option } from './Option';
7
+ import type { SelectOptionProps } from './Option/props';
8
+ import type { SelectProps } from './props';
9
+ import { Renderable } from '@instructure/shared-types';
10
+ type GroupChild = ComponentElement<SelectGroupProps, Group>;
11
+ type OptionChild = ComponentElement<SelectOptionProps, Option>;
12
+ type SelectChildren = (GroupChild | OptionChild)[];
13
+ /**
14
+ ---
15
+ category: components
16
+ tags: autocomplete, typeahead, combobox, dropdown, search, form
17
+ ---
18
+ **/
19
+ declare class Select extends Component<SelectProps> {
20
+ static readonly componentId = "Select";
21
+ private readonly SCROLL_TOLERANCE;
22
+ static allowedProps: readonly ("id" | "assistiveText" | "interaction" | "isInline" | "visibleOptionsCount" | "isOptionContentAppliedToInput" | "optionsMaxHeight" | "optionsMaxWidth" | "inputValue" | "onInputChange" | "listRef" | "scrollToHighlightedOption" | "children" | keyof {
23
+ isShowingOptions?: boolean;
24
+ onRequestShowOptions?: (event: React.KeyboardEvent | React.MouseEvent) => void;
25
+ onRequestHideOptions?: (event: React.KeyboardEvent | React.MouseEvent | React.FocusEvent) => void;
26
+ onRequestHighlightOption?: (event: React.KeyboardEvent | React.MouseEvent, data: {
27
+ id?: string;
28
+ direction?: 1 | -1;
29
+ }) => void;
30
+ onRequestSelectOption?: (event: React.KeyboardEvent | React.MouseEvent, data: {
31
+ id?: string;
32
+ }) => void;
33
+ } | keyof {
34
+ renderLabel: Renderable;
35
+ size?: "small" | "medium" | "large";
36
+ placeholder?: string;
37
+ isRequired?: boolean;
38
+ width?: string;
39
+ htmlSize?: number;
40
+ messages?: import("@instructure/ui-form-field/types/exports/a.js").FormMessage[];
41
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
42
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
43
+ inputRef?: (inputElement: HTMLInputElement | null) => void;
44
+ renderBeforeInput?: Renderable;
45
+ renderAfterInput?: Renderable;
46
+ shouldNotWrap?: boolean;
47
+ layout?: "stacked" | "inline";
48
+ } | keyof {
49
+ placement?: import("@instructure/ui-position").PlacementPropValues;
50
+ constrain?: import("@instructure/ui-position").PositionConstraint;
51
+ mountNode?: import("@instructure/ui-position").PositionMountNode;
52
+ })[];
53
+ static defaultProps: {
54
+ inputValue: string;
55
+ isShowingOptions: boolean;
56
+ size: string;
57
+ interaction: undefined;
58
+ isRequired: boolean;
59
+ isInline: boolean;
60
+ visibleOptionsCount: number;
61
+ placement: string;
62
+ constrain: string;
63
+ shouldNotWrap: boolean;
64
+ scrollToHighlightedOption: boolean;
65
+ isOptionContentAppliedToInput: boolean;
66
+ };
67
+ static Option: typeof Option;
68
+ static Group: typeof Group;
69
+ componentDidMount(): void;
70
+ componentDidUpdate(): void;
71
+ state: {
72
+ hasInputRef: boolean;
73
+ };
74
+ ref: HTMLSpanElement | null;
75
+ _input: HTMLInputElement | null;
76
+ private _defaultId;
77
+ private _inputContainer;
78
+ private _listView;
79
+ private _optionIds;
80
+ private _optionHeight;
81
+ focus(): void;
82
+ blur(): void;
83
+ get childrenArray(): SelectChildren;
84
+ getGroupChildrenArray(group: GroupChild): OptionChild[];
85
+ get focused(): boolean;
86
+ get id(): string;
87
+ get width(): number | undefined;
88
+ get interaction(): import("@instructure/ui-react-utils").InteractionType;
89
+ get highlightedOptionId(): string | undefined;
90
+ get selectedOptionId(): string | string[] | undefined;
91
+ handleInputRef: (node: HTMLInputElement | null) => void;
92
+ handleListRef: (node: HTMLUListElement | null) => void;
93
+ handleInputContainerRef: (node: HTMLSpanElement | null) => void;
94
+ scrollToOption(id?: string): void;
95
+ highlightOption(event: React.KeyboardEvent | React.MouseEvent, id: string): void;
96
+ getEventHandlers(): Partial<SelectableProps>;
97
+ renderOption(option: OptionChild, data: Pick<SelectableRender, 'getOptionProps' | 'getDisabledOptionProps'>): import("@emotion/react/jsx-runtime").JSX.Element;
98
+ renderGroup(group: GroupChild, data: Pick<SelectableRender, 'getOptionProps' | 'getDisabledOptionProps'> & {
99
+ isFirstChild: boolean;
100
+ isLastChild: boolean;
101
+ afterGroup: boolean;
102
+ }): (import("react").ReactElement<OptionsItemProps, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<OptionsSeparatorProps, string | import("react").JSXElementConstructor<any>>)[];
103
+ renderList(data: Pick<SelectableRender, 'getListProps' | 'getOptionProps' | 'getDisabledOptionProps'>): import("@emotion/react/jsx-runtime").JSX.Element;
104
+ renderIcon(): import("@emotion/react/jsx-runtime").JSX.Element;
105
+ renderContentBeforeOrAfterInput(position: string): string | number | boolean | void | Element | Iterable<ReactNode> | import("react").ComponentClass<{}, any> | import("@emotion/react/jsx-runtime").JSX.Element | import("react").ClassType<{
106
+ id: string;
107
+ isHighlighted?: boolean;
108
+ isSelected?: boolean;
109
+ isDisabled?: boolean;
110
+ children?: React.ReactNode;
111
+ }, import("react").ClassicComponent<{
112
+ id: string;
113
+ isHighlighted?: boolean;
114
+ isSelected?: boolean;
115
+ isDisabled?: boolean;
116
+ children?: React.ReactNode;
117
+ }, any>, import("react").ClassicComponentClass<{
118
+ id: string;
119
+ isHighlighted?: boolean;
120
+ isSelected?: boolean;
121
+ isDisabled?: boolean;
122
+ children?: React.ReactNode;
123
+ }>> | ((data: {
124
+ id: string;
125
+ isHighlighted?: boolean;
126
+ isSelected?: boolean;
127
+ isDisabled?: boolean;
128
+ children?: React.ReactNode;
129
+ }) => ReactNode | Element) | null;
130
+ handleInputContentRender(renderLabelInput: Renderable, inputValue: string | undefined, isOptionContentAppliedToInput: boolean, position: 'before' | 'after', defaultReturn: Renderable): Renderable;
131
+ handleRenderBeforeInput(): Renderable;
132
+ handleRenderAfterInput(): Renderable;
133
+ renderInput(data: Pick<SelectableRender, 'getInputProps' | 'getTriggerProps'>): import("@emotion/react/jsx-runtime").JSX.Element;
134
+ render(): import("@emotion/react/jsx-runtime").JSX.Element;
135
+ }
136
+ export default Select;
137
+ export { Select };
138
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Select/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,gBAAgB,EAAY,SAAS,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAA;AA4B9E,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,gBAAgB,CAAA;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAWtD,KAAK,UAAU,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;AAC3D,KAAK,WAAW,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;AAC9D,KAAK,cAAc,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC,EAAE,CAAA;AA+ClD;;;;;GAKG;AACH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IACtC,OAAO,C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BAAgB,EAAE,gBAAgB,GAAG,wBAAwB,CAAC;IA2E3E,WAAW,CACT,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,IAAI,CACR,gBAAgB,EAChB,gBAAgB,GAAG,wBAAwB,CAC5C,GAAG;QACF,YAAY,EAAE,OAAO,CAAA;QACrB,WAAW,EAAE,OAAO,CAAA;QACpB,UAAU,EAAE,OAAO,CAAA;KACpB;IA4CH,UAAU,CACR,IAAI,EAAE,IAAI,CACR,gBAAgB,EAChB,cAAc,GAAG,gBAAgB,GAAG,wBAAwB,CAC7D;IAkEH,UAAU;IAsBV,+BAA+B,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;IAkChD,wBAAwB,CACtB,gBAAgB,EAAE,UAAU,EAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,6BAA6B,EAAE,OAAO,EACtC,QAAQ,EAAE,QAAQ,GAAG,OAAO,EAC5B,aAAa,EAAE,UAAU,GACxB,UAAU;IAoBb,uBAAuB;IAYvB,sBAAsB;IAYtB,WAAW,CACT,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,iBAAiB,CAAC;IA0HnE,MAAM;CAwEP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,206 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import type { OtherHTMLAttributes } from '@instructure/shared-types';
3
+ import type { FormMessage } from '@instructure/ui-form-field/latest';
4
+ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
5
+ import type { NewComponentTypes } from '@instructure/ui-themes';
6
+ import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
7
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils';
8
+ import { Renderable } from '@instructure/shared-types';
9
+ type SelectOwnProps = {
10
+ /**
11
+ * The id of the text input. One is generated if not supplied.
12
+ */
13
+ id?: string;
14
+ /**
15
+ * Additional helpful text to provide to screen readers about the operation
16
+ * of the component.
17
+ */
18
+ assistiveText?: string;
19
+ /**
20
+ * Specifies if interaction with the input is enabled, disabled, or readonly.
21
+ * When "disabled", the input changes visibly to indicate that it cannot
22
+ * receive user interactions. When "readonly" the input still cannot receive
23
+ * user interactions but it keeps the same styles as if it were enabled.
24
+ */
25
+ interaction?: 'enabled' | 'disabled' | 'readonly';
26
+ /**
27
+ * Whether the input is rendered inline with other elements or if it
28
+ * is rendered as a block level element.
29
+ */
30
+ isInline?: boolean;
31
+ /**
32
+ * The number of options that should be visible before having to scroll. Works best when the options are the same height.
33
+ */
34
+ visibleOptionsCount?: number;
35
+ /**
36
+ * Whether or not the content of the selected `Select.Option`'s `renderBeforeLabel` and `renderAfterLabel` appear in the input field.
37
+ *
38
+ * If the selected `Select.Option` has both `renderBeforeLabel` and `renderAfterLabel` content, both will be displayed in the input field.
39
+ *
40
+ * One of the `Select.Option`'s `isSelected` prop should be `true` in order to display the content in the input field.
41
+ *
42
+ * `Select.Option`'s `renderBeforeLabel` and `renderAfterLabel` content will not be displayed, if `Select`'s `inputValue` is an empty value, null or undefined.
43
+ *
44
+ * If `true` and the selected `Select.Option` has a `renderAfterLabel` value, it will replace the default arrow icon.
45
+ *
46
+ * If `true` and `Select`'s `renderBeforeInput` or `renderAfterInput` prop is set, it will display the selected `Select.Option`'s `renderBeforeLabel` and `renderAfterLabel` instead of `Select`'s `renderBeforeInput` or `renderAfterInput` value.
47
+ *
48
+ * If the selected `Select.Option`'s `renderAfterLabel` value is empty, default arrow icon will be rendered.
49
+ */
50
+ isOptionContentAppliedToInput?: boolean;
51
+ /**
52
+ * The max height the options list can be before having to scroll. If
53
+ * set, it will __override__ the `visibleOptionsCount` prop.
54
+ */
55
+ optionsMaxHeight?: string;
56
+ /**
57
+ * The max width the options list can be before option text wraps. If not
58
+ * set, the list will only display as wide as the text input.
59
+ */
60
+ optionsMaxWidth?: string;
61
+ /**
62
+ * The value to display in the text input.
63
+ */
64
+ inputValue?: string;
65
+ /**
66
+ * Callback fired when text input value changes.
67
+ */
68
+ onInputChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
69
+ /**
70
+ * A ref to the html `ul` element.
71
+ */
72
+ listRef?: (listElement: HTMLUListElement | null) => void;
73
+ /**
74
+ * Enable/disable auto scroll to the highlighted option on every re-render
75
+ */
76
+ scrollToHighlightedOption?: boolean;
77
+ /**
78
+ * Children of type `<Select.Option />` or `<Select.Group />`.
79
+ */
80
+ children?: React.ReactNode;
81
+ } & PropsFromSelectable & PropsFromTextInput & PropsFromPopover;
82
+ type PropsFromSelectable = {
83
+ /**
84
+ * Whether or not to show the options list.
85
+ */
86
+ isShowingOptions?: boolean;
87
+ /**
88
+ * Callback fired requesting that the options list be shown.
89
+ */
90
+ onRequestShowOptions?: (event: React.KeyboardEvent | React.MouseEvent) => void;
91
+ /**
92
+ * Callback fired requesting that the options list be hidden.
93
+ */
94
+ onRequestHideOptions?: (event: React.KeyboardEvent | React.MouseEvent | React.FocusEvent) => void;
95
+ /**
96
+ * Callback fired requesting a particular option be highlighted.
97
+ */
98
+ onRequestHighlightOption?: (event: React.KeyboardEvent | React.MouseEvent, data: {
99
+ id?: string;
100
+ direction?: 1 | -1;
101
+ }) => void;
102
+ /**
103
+ * Callback fired requesting a particular option be selected.
104
+ */
105
+ onRequestSelectOption?: (event: React.KeyboardEvent | React.MouseEvent, data: {
106
+ id?: string;
107
+ }) => void;
108
+ };
109
+ type PropsFromTextInput = {
110
+ /**
111
+ * The form field label.
112
+ */
113
+ renderLabel: Renderable;
114
+ /**
115
+ * The size of the text input.
116
+ */
117
+ size?: 'small' | 'medium' | 'large';
118
+ /**
119
+ * Html placeholder text to display when the input has no value. This should
120
+ * be hint text, not a label replacement.
121
+ */
122
+ placeholder?: string;
123
+ /**
124
+ * Whether or not the text input is required.
125
+ */
126
+ isRequired?: boolean;
127
+ /**
128
+ * The width of the text input.
129
+ */
130
+ width?: string;
131
+ /**
132
+ * The width of the input (integer value 0 or higher), if a width is not explicitly
133
+ * provided via the `width` prop.
134
+ *
135
+ * Only applicable if `isInline={true}`.
136
+ *
137
+ * For more see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size
138
+ */
139
+ htmlSize?: number;
140
+ /**
141
+ * Displays messages and validation for the input. It should be an object
142
+ * with the following shape:
143
+ * `{
144
+ * text: React.ReactNode,
145
+ * type: One of: ['newError', 'error', 'hint', 'success', 'screenreader-only']
146
+ * }`
147
+ */
148
+ messages?: FormMessage[];
149
+ /**
150
+ * Callback fired when text input receives focus.
151
+ */
152
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
153
+ /**
154
+ * Callback fired when text input loses focus.
155
+ */
156
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
157
+ /**
158
+ * A ref to the html `input` element.
159
+ */
160
+ inputRef?: (inputElement: HTMLInputElement | null) => void;
161
+ /**
162
+ * Content to display before the text input. This will commonly be an icon or
163
+ * tags to show multiple selections.
164
+ */
165
+ renderBeforeInput?: Renderable;
166
+ /**
167
+ * Content to display after the text input. This content will replace the
168
+ * default arrow icons.
169
+ */
170
+ renderAfterInput?: Renderable;
171
+ /**
172
+ * Prevents the default behavior of wrapping the input and rendered content
173
+ * when available space is exceeded.
174
+ */
175
+ shouldNotWrap?: boolean;
176
+ /**
177
+ * In `stacked` mode the input is below the label.
178
+ *
179
+ * In `inline` mode the input is to the right/left (depending on text direction) of the label,
180
+ * and the layout will look like `stacked` for small screens.
181
+ */
182
+ layout?: 'stacked' | 'inline';
183
+ };
184
+ type PropsFromPopover = {
185
+ /**
186
+ * The placement of the options list.
187
+ */
188
+ placement?: PlacementPropValues;
189
+ /**
190
+ * The parent in which to constrain the placement.
191
+ */
192
+ constrain?: PositionConstraint;
193
+ /**
194
+ * An element or a function returning an element to use mount the options
195
+ * list to in the DOM (defaults to `document.body`)
196
+ */
197
+ mountNode?: PositionMountNode;
198
+ };
199
+ type PropKeys = keyof SelectOwnProps;
200
+ type AllowedPropKeys = Readonly<Array<PropKeys>>;
201
+ type SelectProps = SelectOwnProps & WithStyleProps<NewComponentTypes['Select'], SelectStyle> & OtherHTMLAttributes<SelectOwnProps, InputHTMLAttributes<SelectOwnProps & Element>> & WithDeterministicIdProps;
202
+ type SelectStyle = ComponentStyle<'assistiveText' | 'popoverBorderWidth'>;
203
+ declare const allowedProps: AllowedPropKeys;
204
+ export type { SelectProps, SelectOwnProps, SelectStyle };
205
+ export { allowedProps };
206
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Select/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEtD,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IAEjD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;;;;;;;;;;;;OAcG;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C,EAAE,iBAAiB,CAAA;CAC9B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,WAAW,GAAG,cAAc,GAC/B,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,GACxD,mBAAmB,CACjB,cAAc,EACd,mBAAmB,CAAC,cAAc,GAAG,OAAO,CAAC,CAC9C,GACD,wBAAwB,CAAA;AAE1B,KAAK,WAAW,GAAG,cAAc,CAAC,eAAe,GAAG,oBAAoB,CAAC,CAAA;AAEzE,QAAA,MAAM,YAAY,EAAE,eAoCnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { NewComponentTypes } from '@instructure/ui-themes';
2
+ import type { SelectProps, SelectStyle } from './props';
3
+ /**
4
+ * Generates the style object from the theme and provided additional information
5
+ * @param {Object} componentTheme The theme variable object.
6
+ * @param {Object} props the props of the component, the style is applied to
7
+ * @param {Object} state the state of the component, the style is applied to
8
+ * @return {Object} The final style object, which will be used in the component
9
+ */
10
+ declare const generateStyle: (componentTheme: NewComponentTypes["Select"], _props: SelectProps) => SelectStyle;
11
+ export default generateStyle;
12
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Select/v2/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAC3C,QAAQ,WAAW,KAClB,WAQF,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,7 @@
1
+ export { Select } from '../Select/v2';
2
+ export { Group as SelectGroup } from '../Select/v2/Group';
3
+ export { Option as SelectOption } from '../Select/v2/Option';
4
+ export type { SelectProps, SelectOwnProps } from '../Select/v2/props';
5
+ export type { SelectGroupProps } from '../Select/v2/Group/props';
6
+ export type { SelectOptionProps } from '../Select/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,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE5D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACrE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA"}