@leafygreen-ui/combobox 11.0.1 → 11.0.2

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 (78) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/Combobox/Combobox.d.ts +13 -0
  3. package/dist/Combobox/Combobox.d.ts.map +1 -0
  4. package/dist/Combobox/Combobox.styles.d.ts +52 -0
  5. package/dist/Combobox/Combobox.styles.d.ts.map +1 -0
  6. package/dist/Combobox/Combobox.types.d.ts +137 -0
  7. package/dist/Combobox/Combobox.types.d.ts.map +1 -0
  8. package/dist/Combobox/index.d.ts +3 -0
  9. package/dist/Combobox/index.d.ts.map +1 -0
  10. package/dist/Combobox/utils/isValueCurrentSelection.d.ts +7 -0
  11. package/dist/Combobox/utils/isValueCurrentSelection.d.ts.map +1 -0
  12. package/dist/ComboboxChip/ComboboxChip.d.ts +4 -0
  13. package/dist/ComboboxChip/ComboboxChip.d.ts.map +1 -0
  14. package/dist/ComboboxChip/ComboboxChip.styles.d.ts +24 -0
  15. package/dist/ComboboxChip/ComboboxChip.styles.d.ts.map +1 -0
  16. package/dist/ComboboxChip/ComboboxChip.types.d.ts +7 -0
  17. package/dist/ComboboxChip/ComboboxChip.types.d.ts.map +1 -0
  18. package/dist/ComboboxChip/index.d.ts +2 -0
  19. package/dist/ComboboxChip/index.d.ts.map +1 -0
  20. package/dist/ComboboxContext/ComboboxContext.d.ts +28 -0
  21. package/dist/ComboboxContext/ComboboxContext.d.ts.map +1 -0
  22. package/dist/ComboboxContext/index.d.ts +2 -0
  23. package/dist/ComboboxContext/index.d.ts.map +1 -0
  24. package/dist/ComboboxGroup/ComboboxGroup.d.ts +11 -0
  25. package/dist/ComboboxGroup/ComboboxGroup.d.ts.map +1 -0
  26. package/dist/ComboboxGroup/ComboboxGroup.styles.d.ts +5 -0
  27. package/dist/ComboboxGroup/ComboboxGroup.styles.d.ts.map +1 -0
  28. package/dist/ComboboxGroup/ComboboxGroup.types.d.ts +19 -0
  29. package/dist/ComboboxGroup/ComboboxGroup.types.d.ts.map +1 -0
  30. package/dist/ComboboxGroup/index.d.ts +3 -0
  31. package/dist/ComboboxGroup/index.d.ts.map +1 -0
  32. package/dist/ComboboxMenu/ComboboxMenu.d.ts +10 -0
  33. package/dist/ComboboxMenu/ComboboxMenu.d.ts.map +1 -0
  34. package/dist/ComboboxMenu/Menu.styles.d.ts +22 -0
  35. package/dist/ComboboxMenu/Menu.styles.d.ts.map +1 -0
  36. package/dist/ComboboxMenu/index.d.ts +2 -0
  37. package/dist/ComboboxMenu/index.d.ts.map +1 -0
  38. package/dist/ComboboxOption/ComboboxOption.d.ts +14 -0
  39. package/dist/ComboboxOption/ComboboxOption.d.ts.map +1 -0
  40. package/dist/ComboboxOption/ComboboxOption.styles.d.ts +18 -0
  41. package/dist/ComboboxOption/ComboboxOption.styles.d.ts.map +1 -0
  42. package/dist/ComboboxOption/ComboboxOption.types.d.ts +54 -0
  43. package/dist/ComboboxOption/ComboboxOption.types.d.ts.map +1 -0
  44. package/dist/ComboboxOption/getGlyphs.d.ts +22 -0
  45. package/dist/ComboboxOption/getGlyphs.d.ts.map +1 -0
  46. package/dist/ComboboxOption/index.d.ts +3 -0
  47. package/dist/ComboboxOption/index.d.ts.map +1 -0
  48. package/dist/esm/index.js +2 -0
  49. package/dist/esm/index.js.map +1 -0
  50. package/dist/index.d.ts +4 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +2 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/test-utils/getTestOptions.testutils.d.ts +3 -0
  55. package/dist/test-utils/getTestOptions.testutils.d.ts.map +1 -0
  56. package/dist/types/Combobox.types.d.ts +78 -0
  57. package/dist/types/Combobox.types.d.ts.map +1 -0
  58. package/dist/types/index.d.ts +3 -0
  59. package/dist/types/index.d.ts.map +1 -0
  60. package/dist/utils/ComboboxTestUtils.d.ts +42 -0
  61. package/dist/utils/ComboboxTestUtils.d.ts.map +1 -0
  62. package/dist/utils/OptionObjectUtils.d.ts +23 -0
  63. package/dist/utils/OptionObjectUtils.d.ts.map +1 -0
  64. package/dist/utils/checkScrollPosition.d.ts +10 -0
  65. package/dist/utils/checkScrollPosition.d.ts.map +1 -0
  66. package/dist/utils/doesSelectionExist.d.ts +3 -0
  67. package/dist/utils/doesSelectionExist.d.ts.map +1 -0
  68. package/dist/utils/flattenChildren.d.ts +12 -0
  69. package/dist/utils/flattenChildren.d.ts.map +1 -0
  70. package/dist/utils/getNameAndValue.d.ts +15 -0
  71. package/dist/utils/getNameAndValue.d.ts.map +1 -0
  72. package/dist/utils/index.d.ts +6 -0
  73. package/dist/utils/index.d.ts.map +1 -0
  74. package/dist/utils/wrapJSX.d.ts +15 -0
  75. package/dist/utils/wrapJSX.d.ts.map +1 -0
  76. package/package.json +16 -16
  77. package/stories.js +1 -0
  78. package/tsdoc.json +983 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @leafygreen-ui/combobox
2
2
 
3
+ ## 11.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e1955dd36: Fixes broken patch build
8
+ - Updated dependencies [e1955dd36]
9
+ - @leafygreen-ui/checkbox@14.0.2
10
+ - @leafygreen-ui/chip@3.0.2
11
+ - @leafygreen-ui/emotion@4.0.9
12
+ - @leafygreen-ui/form-field@2.0.2
13
+ - @leafygreen-ui/hooks@8.3.4
14
+ - @leafygreen-ui/icon@13.1.2
15
+ - @leafygreen-ui/icon-button@16.0.2
16
+ - @leafygreen-ui/input-option@3.0.2
17
+ - @leafygreen-ui/leafygreen-provider@4.0.2
18
+ - @leafygreen-ui/lib@14.0.2
19
+ - @leafygreen-ui/palette@4.1.3
20
+ - @leafygreen-ui/popover@13.0.2
21
+ - @leafygreen-ui/tokens@2.11.3
22
+ - @leafygreen-ui/typography@20.0.2
23
+
3
24
  ## 11.0.1
4
25
 
5
26
  ### Patch Changes
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ComboboxProps } from './Combobox.types';
3
+ /**
4
+ * Combobox is a combination of a Select and TextInput,
5
+ * allowing the user to either type a value directly or select a value from the list.
6
+ * Can be configured to select a single or multiple options.
7
+ */
8
+ export declare function Combobox<M extends boolean>({ children, label, description, placeholder, 'aria-label': ariaLabel, disabled, size, darkMode: darkModeProp, state, errorMessage, successMessage, searchState, searchEmptyMessage, searchErrorMessage, searchLoadingMessage, filteredOptions, onFilter, clearable, onClear, overflow, multiselect, initialValue, inputValue: inputValueProp, onInputChange, onChange, value, chipTruncationLocation, chipCharacterLimit, className, renderMode, portalClassName, portalContainer, portalRef, scrollContainer, popoverZIndex, ...rest }: ComboboxProps<M>): React.JSX.Element;
9
+ /**
10
+ * Why'd you have to go and make things so complicated?
11
+ * - Avril; and also me to myself about this component
12
+ */
13
+ //# sourceMappingURL=Combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../src/Combobox/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAYN,MAAM,OAAO,CAAC;AAmFf,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,EAC1C,QAAQ,EACR,KAAK,EACL,WAAW,EACX,WAAsB,EACtB,YAAY,EAAE,SAAS,EACvB,QAAgB,EAChB,IAA2B,EAC3B,QAAQ,EAAE,YAAY,EACtB,KAAc,EACd,YAAqC,EACrC,cAAyC,EACzC,WAAqB,EACrB,kBAAuC,EACvC,kBAA6C,EAC7C,oBAA2C,EAC3C,eAAe,EACf,QAAQ,EACR,SAAgB,EAChB,OAAO,EACP,QAA2B,EAC3B,WAAwB,EACxB,YAAY,EACZ,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,QAAQ,EACR,KAAK,EACL,sBAAsB,EACtB,kBAAuB,EACvB,SAAS,EACT,UAAgC,EAChC,eAAe,EACf,eAAe,EACf,SAAS,EACT,eAAe,EACf,aAAa,EACb,GAAG,IAAI,EACR,EAAE,aAAa,CAAC,CAAC,CAAC,qBAkuClB;AAED;;;GAGG"}
@@ -0,0 +1,52 @@
1
+ import { Theme } from '@leafygreen-ui/lib';
2
+ import { ComboboxSize as Size, Overflow } from '../types';
3
+ /**
4
+ * The min-height of the combobox.
5
+ */
6
+ export declare const wrapperHeight: Record<Size, number>;
7
+ /**
8
+ * Size of combobox x & y padding (in px)
9
+ * (wrapperHeight - inputHeight(- (borderTop + borderBottom)) / 2
10
+ */
11
+ export declare const comboboxPadding: Record<Size, {
12
+ y: number;
13
+ xLeftWithChip: number;
14
+ xLeftWithoutChip: number;
15
+ xRight: number;
16
+ }>;
17
+ /** Width of the clear icon (in px) */
18
+ export declare const clearButtonIconSize = 28;
19
+ /** Width of the dropdown caret icon (in px) */
20
+ export declare const caretIconSize: 16;
21
+ export declare const comboboxParentStyle: (size: Size) => string;
22
+ export declare const baseComboboxStyles: string;
23
+ export declare const comboboxThemeStyles: Record<Theme, string>;
24
+ export declare const comboboxSizeStyles: (size: Size, isMultiselectWithSelections: boolean) => string;
25
+ export declare const getComboboxDisabledStyles: (theme: Theme) => string;
26
+ export declare const getComboboxStateStyles: (theme: Theme) => {
27
+ error: string;
28
+ none: string;
29
+ valid: string;
30
+ };
31
+ export declare const comboboxFocusStyle: Record<Theme, string>;
32
+ export declare const iconsWrapperBaseStyles: string;
33
+ export declare const iconsWrapperSizeStyles: Record<Size, string>;
34
+ export declare const inputWrapperStyle: ({ overflow, size, }: {
35
+ overflow: Overflow;
36
+ size: Size;
37
+ }) => string | undefined;
38
+ export declare const baseInputElementStyle: string;
39
+ export declare const inputElementThemeStyle: Record<Theme, string>;
40
+ export declare const inputElementDisabledThemeStyle: Record<Theme, string>;
41
+ export declare const inputElementSizeStyle: (size: Size) => string;
42
+ export declare const inputElementTransitionStyles: (isOpen: boolean) => string;
43
+ /** Should only be applied to a multiselect */
44
+ export declare const multiselectInputElementStyle: (size: Size, inputValue?: string) => string;
45
+ export declare const clearButtonStyle: string;
46
+ export declare const iconStyle: string;
47
+ export declare const labelDescriptionContainerStyle: string;
48
+ export declare const labelDescriptionLargeStyles: string;
49
+ export declare const comboboxOverflowShadowStyles: Record<Theme, string>;
50
+ export declare const getCaretIconFill: (theme: Theme) => "#5C6C75" | "#C1C7C6";
51
+ export declare const getCaretIconDisabledFill: (theme: Theme) => "#5C6C75" | "#889397";
52
+ //# sourceMappingURL=Combobox.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.styles.d.ts","sourceRoot":"","sources":["../../src/Combobox/Combobox.styles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAiB3C,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,QAAQ,EAAS,MAAM,UAAU,CAAC;AAcjE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAK9C,CAAC;AAUF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,IAAI,EACJ;IACE,CAAC,EAAE,MAAM,CAAC;IACV,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,CA0BF,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,+CAA+C;AAC/C,eAAO,MAAM,aAAa,IAAe,CAAC;AAE1C,eAAO,MAAM,mBAAmB,SAAU,IAAI,KAAG,MAShD,CAAC;AAEF,eAAO,MAAM,kBAAkB,QA4B9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CASrD,CAAC;AAEF,eAAO,MAAM,kBAAkB,SACvB,IAAI,+BACmB,OAAO,WAQrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAAW,KAAK,WAKrD,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,KAAK;;;;CAUjD,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAapD,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAGlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAavD,CAAC;AAEF,eAAO,MAAM,iBAAiB;cAIlB,QAAQ;UACZ,IAAI;wBAkDX,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAwBjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAWxD,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAWhE,CAAC;AAEF,eAAO,MAAM,qBAAqB,SAAU,IAAI,WAK/C,CAAC;AAEF,eAAO,MAAM,4BAA4B,WAAY,OAAO,WAM3D,CAAC;AAGF,8CAA8C;AAC9C,eAAO,MAAM,4BAA4B,SACjC,IAAI,eACG,MAAM,WAOpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAI5B,CAAC;AAEF,eAAO,MAAM,SAAS,QAGrB,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAI1C,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAGvC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAY9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,KAAK,0BACV,CAAC;AAEpC,eAAO,MAAM,wBAAwB,UAAW,KAAK,0BACjB,CAAC"}
@@ -0,0 +1,137 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { type ChipProps } from '@leafygreen-ui/chip';
3
+ import { Either, HTMLElementProps } from '@leafygreen-ui/lib';
4
+ import { PopoverProps } from '@leafygreen-ui/popover';
5
+ import { ComboboxSize, onChangeType, Overflow, SearchState, SelectValueType, State } from '../types';
6
+ /**
7
+ * Combobox Props
8
+ */
9
+ export interface ComboboxMultiselectProps<M extends boolean> {
10
+ /**
11
+ * Defines whether a user can select multiple options, or only a single option.
12
+ * When using TypeScript, `multiselect` affects the valid values of `initialValue`, `value`, and `onChange`
13
+ */
14
+ multiselect?: M;
15
+ /**
16
+ * The initial selection.
17
+ * Must be a string (or array of strings) that matches the `value` prop of a `ComboboxOption`.
18
+ * Changing the `initialValue` after initial render will not change the selection.
19
+ */
20
+ initialValue?: SelectValueType<M>;
21
+ /**
22
+ * A callback called when the selection changes.
23
+ * Callback receives a single argument that is the new selection, either string, or string array
24
+ */
25
+ onChange?: onChangeType<M>;
26
+ /**
27
+ * The controlled value of the Combobox.
28
+ * Must be a string (or array of strings) that matches the `value` prop of a `ComboboxOption`.
29
+ * Changing `value` after initial render _will_ affect the selection.
30
+ * `value` will always take precedence over `initialValue` if both are provided.
31
+ */
32
+ value?: SelectValueType<M>;
33
+ /**
34
+ * Defines the overflow behavior of a multiselect combobox.
35
+ *
36
+ * `expand-y`: Combobox has fixed width, and additional selections will cause the element to grow in the block direction.
37
+ *
38
+ * `expand-x`: Combobox has fixed height, and additional selections will cause the element to grow in the inline direction.
39
+ *
40
+ * `scroll-x`: Combobox has fixed height and width, and additional selections will cause the element to be scrollable in the x (horizontal) direction.
41
+ */
42
+ overflow?: M extends true ? Overflow : undefined;
43
+ }
44
+ type PartialChipProps = Pick<ChipProps, 'chipTruncationLocation' | 'chipCharacterLimit'>;
45
+ export type BaseComboboxProps = Omit<HTMLElementProps<'div'>, 'onChange'> & Pick<PopoverProps, 'popoverZIndex' | 'portalClassName' | 'portalContainer' | 'portalRef' | 'renderMode' | 'scrollContainer'> & PartialChipProps & {
46
+ /**
47
+ * Defines the Combobox Options by passing children. Must be `ComboboxOption` or `ComboboxGroup`
48
+ */
49
+ children?: ReactNode;
50
+ /**
51
+ * An accessible label for the input, rendered in a <label> to the DOM
52
+ */
53
+ label?: string;
54
+ /**
55
+ * An accessible label for the input, used only for screen-readers
56
+ */
57
+ 'aria-label'?: string;
58
+ /**
59
+ * A description for the input
60
+ */
61
+ description?: ReactNode;
62
+ /**
63
+ * A placeholder for the input element. Uses the native `placeholder` attribute.
64
+ */
65
+ placeholder?: string;
66
+ /**
67
+ * Disables all interaction with the component
68
+ */
69
+ disabled?: boolean;
70
+ /**
71
+ * Defines the visual size of the component
72
+ */
73
+ size?: ComboboxSize;
74
+ /**
75
+ * Toggles Dark Mode
76
+ */
77
+ darkMode?: boolean;
78
+ /**
79
+ * The error state of the component. Defines whether the error message is displayed.
80
+ */
81
+ state?: State;
82
+ /**
83
+ * The message shown below the input when state is `error`
84
+ */
85
+ errorMessage?: ReactNode;
86
+ /**
87
+ * The message shown below the input when state is `valid`
88
+ */
89
+ successMessage?: ReactNode;
90
+ /**
91
+ * The state of search results. Toggles search messages within the menu.
92
+ */
93
+ searchState?: SearchState;
94
+ /**
95
+ * A message shown within the menu when there are no options passed in as children, or `filteredOptions` is an empty array
96
+ */
97
+ searchEmptyMessage?: string;
98
+ /**
99
+ * A message shown within the menu when searchState is `error`
100
+ */
101
+ searchErrorMessage?: string;
102
+ /**
103
+ * A message shown within the menu when searchState is `loading`
104
+ */
105
+ searchLoadingMessage?: string;
106
+ /**
107
+ * A callback called when the search input changes.
108
+ * Receives a single argument that is the current input value.
109
+ * Use this callback to set `searchState` and/or `filteredOptions` appropriately
110
+ */
111
+ onFilter?: (value: string) => void;
112
+ /**
113
+ * Defines whether the Clear button appears to the right of the input.
114
+ */
115
+ clearable?: boolean;
116
+ /**
117
+ * A callback fired when the Clear button is pressed.
118
+ * Fired _after_ `onChange`, and _before_ `onFilter`
119
+ */
120
+ onClear?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
121
+ /**
122
+ * An array used to define which options are displayed.
123
+ * Do not remove options from the JSX children, as this will affect the selected options
124
+ */
125
+ filteredOptions?: Array<string>;
126
+ /**
127
+ * A callback fired when the input text changes
128
+ */
129
+ onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
130
+ /**
131
+ * Allows for a controlled text-input value
132
+ */
133
+ inputValue?: string;
134
+ };
135
+ export type ComboboxProps<M extends boolean> = Either<BaseComboboxProps & ComboboxMultiselectProps<M>, 'label' | 'aria-label'>;
136
+ export {};
137
+ //# sourceMappingURL=Combobox.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.types.d.ts","sourceRoot":"","sources":["../../src/Combobox/Combobox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,eAAe,EACf,KAAK,EACN,MAAM,UAAU,CAAC;AAElB;;GAEG;AAEH,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,OAAO;IACzD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;CAClD;AAED,KAAK,gBAAgB,GAAG,IAAI,CAC1B,SAAS,EACT,wBAAwB,GAAG,oBAAoB,CAChD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GACvE,IAAI,CACF,YAAY,EACV,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,iBAAiB,CACpB,GACD,gBAAgB,GAAG;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAEvE;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAE3D;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,OAAO,IAAI,MAAM,CACnD,iBAAiB,GAAG,wBAAwB,CAAC,CAAC,CAAC,EAC/C,OAAO,GAAG,YAAY,CACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Combobox } from './Combobox';
2
+ export { type BaseComboboxProps, type ComboboxMultiselectProps, type ComboboxProps, } from './Combobox.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { SelectValueType } from '../../types';
2
+ /**
3
+ * Returns whether a given value is included in, or equal to, the current selection
4
+ * @param value the option value to check
5
+ */
6
+ export declare const isValueCurrentSelection: (value: string, selection: SelectValueType<boolean> | null) => boolean;
7
+ //# sourceMappingURL=isValueCurrentSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isValueCurrentSelection.d.ts","sourceRoot":"","sources":["../../../src/Combobox/utils/isValueCurrentSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UAC3B,MAAM,aACF,gBAAgB,OAAO,CAAC,GAAG,IAAI,KACzC,OAIF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ComboboxChipProps } from './ComboboxChip.types';
3
+ export declare const ComboboxChip: React.ForwardRefExoticComponent<ComboboxChipProps & React.RefAttributes<HTMLSpanElement>>;
4
+ //# sourceMappingURL=ComboboxChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxChip.d.ts","sourceRoot":"","sources":["../../src/ComboboxChip/ComboboxChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,YAAY,2FA2ExB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { ComboboxSize } from '../types';
2
+ export declare const chipClassName: string;
3
+ /**
4
+ * The line-height of the combobox.
5
+ */
6
+ export declare const lineHeight: Record<ComboboxSize, number>;
7
+ /**
8
+ * The font-size of the combobox.
9
+ */
10
+ export declare const fontSize: Record<ComboboxSize, number>;
11
+ /**
12
+ * Vertical padding on a chip (in px)
13
+ */
14
+ export declare const chipWrapperPaddingY: {
15
+ readonly xsmall: 1;
16
+ readonly small: 0;
17
+ readonly default: 2;
18
+ readonly large: 4;
19
+ };
20
+ /**
21
+ * Override chip sizes
22
+ */
23
+ export declare const chipSizeStyles: Record<ComboboxSize, string>;
24
+ //# sourceMappingURL=ComboboxChip.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxChip.styles.d.ts","sourceRoot":"","sources":["../../src/ComboboxChip/ComboboxChip.styles.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,aAAa,QAAyC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAKnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAKjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAkCvD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface ComboboxChipProps {
2
+ displayName: string;
3
+ isFocused: boolean;
4
+ onRemove: () => void;
5
+ onFocus: () => void;
6
+ }
7
+ //# sourceMappingURL=ComboboxChip.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxChip.types.d.ts","sourceRoot":"","sources":["../../src/ComboboxChip/ComboboxChip.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export { ComboboxChip } from './ComboboxChip';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComboboxChip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { ComboboxSize, Overflow, SearchState, State, TruncationLocation } from '../types';
3
+ export interface ComboboxData {
4
+ multiselect: boolean;
5
+ size: ComboboxSize;
6
+ withIcons: boolean;
7
+ disabled: boolean;
8
+ isOpen: boolean;
9
+ state: State;
10
+ searchState: SearchState;
11
+ overflow: Overflow;
12
+ chipTruncationLocation?: TruncationLocation;
13
+ chipCharacterLimit?: number;
14
+ inputValue?: string;
15
+ popoverZIndex?: number;
16
+ }
17
+ export declare const defaultContext: {
18
+ multiselect: boolean;
19
+ size: "default";
20
+ withIcons: boolean;
21
+ disabled: boolean;
22
+ isOpen: boolean;
23
+ state: "none";
24
+ searchState: "unset";
25
+ overflow: "expand-y";
26
+ };
27
+ export declare const ComboboxContext: import("react").Context<ComboboxData>;
28
+ //# sourceMappingURL=ComboboxContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxContext.d.ts","sourceRoot":"","sources":["../../src/ComboboxContext/ComboboxContext.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc;;;;;;;;;CAS1B,CAAC;AAEF,eAAO,MAAM,eAAe,uCAA8C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ComboboxContext, defaultContext } from './ComboboxContext';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComboboxContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ComboboxGroupProps } from './ComboboxGroup.types';
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare function InternalComboboxGroup({ label, className, children, }: ComboboxGroupProps): JSX.Element;
7
+ export declare function ComboboxGroup(_: ComboboxGroupProps): JSX.Element;
8
+ export declare namespace ComboboxGroup {
9
+ var displayName: string;
10
+ }
11
+ //# sourceMappingURL=ComboboxGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxGroup.d.ts","sourceRoot":"","sources":["../../src/ComboboxGroup/ComboboxGroup.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAqBlC;AAID,wBAAgB,aAAa,CAAC,CAAC,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAEhE;yBAFe,aAAa"}
@@ -0,0 +1,5 @@
1
+ import { Theme } from '@leafygreen-ui/lib';
2
+ export declare const comboboxGroupStyle: Record<Theme, string>;
3
+ export declare const comboboxGroupLabel: string;
4
+ export declare const comboboxGroupLabelThemeStyle: Record<Theme, string>;
5
+ //# sourceMappingURL=ComboboxGroup.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxGroup.styles.d.ts","sourceRoot":"","sources":["../../src/ComboboxGroup/ComboboxGroup.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAW9B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAO9D,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Combobox Group Props
3
+ */
4
+ /// <reference types="react" />
5
+ export interface ComboboxGroupProps {
6
+ /**
7
+ * Label for the group of options
8
+ */
9
+ label: string;
10
+ /**
11
+ * Options in the group. Must be one or more `ComboboxOption` components
12
+ */
13
+ children: React.ReactNode;
14
+ /**
15
+ * Styling prop
16
+ */
17
+ className?: string;
18
+ }
19
+ //# sourceMappingURL=ComboboxGroup.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxGroup.types.d.ts","sourceRoot":"","sources":["../../src/ComboboxGroup/ComboboxGroup.types.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ export { ComboboxGroup, InternalComboboxGroup } from './ComboboxGroup';
2
+ export { type ComboboxGroupProps } from './ComboboxGroup.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComboboxGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ComboboxProps } from '../Combobox';
3
+ export declare const ComboboxMenu: React.ForwardRefExoticComponent<{
4
+ children?: React.ReactNode;
5
+ refEl: React.RefObject<HTMLDivElement>;
6
+ id: string;
7
+ labelId: string;
8
+ menuWidth: number;
9
+ } & Pick<ComboboxProps<any>, "searchEmptyMessage" | "searchErrorMessage" | "searchLoadingMessage"> & React.RefAttributes<HTMLDivElement>>;
10
+ //# sourceMappingURL=ComboboxMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxMenu.d.ts","sourceRoot":"","sources":["../../src/ComboboxMenu/ComboboxMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAWnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0B5C,eAAO,MAAM,YAAY;eAVZ,MAAM,SAAS;WACnB,MAAM,SAAS,CAAC,cAAc,CAAC;QAClC,MAAM;aACD,MAAM;eACJ,MAAM;yIA+HlB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Theme } from '@leafygreen-ui/lib';
2
+ import { ComboboxSize as Size } from '../types';
3
+ export declare const menuItemPadding: Record<Size, {
4
+ x: number;
5
+ y: number;
6
+ }>;
7
+ /** Util that returns the height of a menu item (in px) */
8
+ export declare const getMenuItemHeight: (size: Size) => number;
9
+ /**
10
+ * Menu styles
11
+ */
12
+ export declare const popoverStyle: (width?: number) => string;
13
+ export declare const popoverThemeStyle: Record<Theme, string>;
14
+ export declare const menuBaseStyle: string;
15
+ export declare const menuThemeStyle: Record<Theme, string>;
16
+ export declare const getMenuThemeStyles: (theme: Theme) => string;
17
+ export declare const menuList: string;
18
+ export declare const menuMessageBaseStyle: string;
19
+ export declare const menuMessageThemeStyle: Record<Theme, string>;
20
+ export declare const menuMessageSizeStyle: (size: Size) => string;
21
+ export declare const loadingIconStyle: string;
22
+ //# sourceMappingURL=Menu.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.styles.d.ts","sourceRoot":"","sources":["../../src/ComboboxMenu/Menu.styles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK3C,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAKlE,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,SAAU,IAAI,WAE3C,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,YAAY,4BAKxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CASnD,CAAC;AAEF,eAAO,MAAM,aAAa,QASzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAShD,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,KAAK,WAE9C,CAAC;AAEF,eAAO,MAAM,QAAQ,QAIpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAKhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOvD,CAAC;AAEF,eAAO,MAAM,oBAAoB,SAAU,IAAI,WAI9C,CAAC;AAWF,eAAO,MAAM,gBAAgB,QAE5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ComboboxMenu } from './ComboboxMenu';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComboboxMenu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ComboboxOptionProps, InternalComboboxOptionProps } from './ComboboxOption.types';
3
+ /**
4
+ * Internal ComboboxOption Component for use within Combobox only.
5
+ *
6
+ * Prefer using {@link ComboboxOption}
7
+ * @internal
8
+ */
9
+ export declare const InternalComboboxOption: React.ForwardRefExoticComponent<InternalComboboxOptionProps & React.RefAttributes<HTMLLIElement>>;
10
+ export declare function ComboboxOption(_: ComboboxOptionProps): JSX.Element;
11
+ export declare namespace ComboboxOption {
12
+ var displayName: string;
13
+ }
14
+ //# sourceMappingURL=ComboboxOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxOption.d.ts","sourceRoot":"","sources":["../../src/ComboboxOption/ComboboxOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAiBhE,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,wBAAwB,CAAC;AAGhC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,mGAyGlC,CAAC;AAGF,wBAAgB,cAAc,CAAC,CAAC,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAElE;yBAFe,cAAc"}
@@ -0,0 +1,18 @@
1
+ import { Theme } from '@leafygreen-ui/lib';
2
+ import { ComboboxSize } from '../types';
3
+ /**
4
+ * Styles
5
+ */
6
+ export declare const largeStyles: string;
7
+ export declare const checkMarkSizeStyle: Record<ComboboxSize, string>;
8
+ export declare const checkBoxBaseStyles: string;
9
+ export declare const disallowPointer: string;
10
+ export declare const displayNameStyle: (isSelected: boolean) => string;
11
+ export declare const iconThemeStyles: Record<Theme, string>;
12
+ export declare const iconHighlightedStyles: Record<Theme, string>;
13
+ export declare const iconDisabledStyles: Record<Theme, string>;
14
+ export declare const checkMarkThemeStyles: Record<Theme, string>;
15
+ export declare const checkMarkDisabledStyles: Record<Theme, string>;
16
+ export declare const multiselectIconPosition: string;
17
+ export declare const multiselectIconLargePosition: string;
18
+ //# sourceMappingURL=ComboboxOption.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxOption.styles.d.ts","sourceRoot":"","sources":["../../src/ComboboxOption/ComboboxOption.styles.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;GAEG;AAEH,eAAO,MAAM,WAAW,QAKvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAa3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAQ9B,CAAC;AAEF,eAAO,MAAM,eAAe,QAE3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,eAAgB,OAAO,WAEnD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOjD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOpD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOtD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOzD,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAOnC,CAAC;AACF,eAAO,MAAM,4BAA4B,QAKxC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { ComponentPropsWithoutRef, ReactElement } from 'react';
2
+ import { Either } from '@leafygreen-ui/lib';
3
+ /**
4
+ * Combobox Option Props
5
+ */
6
+ type ListItemProps = Omit<ComponentPropsWithoutRef<'li'>, 'onClick' | 'value'>;
7
+ interface SharedComboboxOptionProps {
8
+ /**
9
+ * The internal value of the option. Used as the identifier in Combobox `initialValue`, value and filteredOptions.
10
+ * When undefined, this is set to `_.kebabCase(displayName)`
11
+ */
12
+ value?: string;
13
+ /**
14
+ * The display value of the option. Used as the rendered string within the menu and chips.
15
+ * When undefined, this is set to `value`
16
+ */
17
+ displayName?: string;
18
+ /**
19
+ * The icon to display to the left of the option in the menu.
20
+ */
21
+ glyph?: ReactElement;
22
+ /**
23
+ * Defines whether the option is disabled.
24
+ * Node: disabled options are still rendered in the menu, but not selectable.
25
+ */
26
+ disabled?: boolean;
27
+ /**
28
+ * Styling Prop
29
+ */
30
+ className?: string;
31
+ /**
32
+ * Optional descriptive text under the displayName.
33
+ */
34
+ description?: string;
35
+ /**
36
+ * Callback fired when an option is clicked.
37
+ */
38
+ onClick?: (event: React.SyntheticEvent<HTMLLIElement, Event>, value: string) => void;
39
+ }
40
+ type RequiredComboboxOptionProps = Required<Pick<SharedComboboxOptionProps, 'value' | 'displayName'>>;
41
+ type BaseComboboxOptionProps = ListItemProps & SharedComboboxOptionProps;
42
+ export type ComboboxOptionProps = Either<BaseComboboxOptionProps, 'value' | 'displayName'>;
43
+ export interface OptionObject extends Pick<SharedComboboxOptionProps, 'description' | 'onClick'>, RequiredComboboxOptionProps {
44
+ isDisabled: boolean;
45
+ hasGlyph?: boolean;
46
+ }
47
+ export interface InternalComboboxOptionProps extends ListItemProps, Omit<SharedComboboxOptionProps, 'value' | 'displayName'>, RequiredComboboxOptionProps {
48
+ isSelected: boolean;
49
+ isFocused: boolean;
50
+ setSelected: () => void;
51
+ index: number;
52
+ }
53
+ export {};
54
+ //# sourceMappingURL=ComboboxOption.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxOption.types.d.ts","sourceRoot":"","sources":["../../src/ComboboxOption/ComboboxOption.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;GAEG;AAEH,KAAK,aAAa,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;AAE/E,UAAU,yBAAyB;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,EAAE,KAAK,CAAC,EACjD,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;CACX;AAED,KAAK,2BAA2B,GAAG,QAAQ,CACzC,IAAI,CAAC,yBAAyB,EAAE,OAAO,GAAG,aAAa,CAAC,CACzD,CAAC;AAEF,KAAK,uBAAuB,GAAG,aAAa,GAAG,yBAAyB,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,uBAAuB,EACvB,OAAO,GAAG,aAAa,CACxB,CAAC;AAEF,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,aAAa,GAAG,SAAS,CAAC,EAChE,2BAA2B;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,2BACf,SAAQ,aAAa,EACnB,IAAI,CAAC,yBAAyB,EAAE,OAAO,GAAG,aAAa,CAAC,EACxD,2BAA2B;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,22 @@
1
+ import React, { ReactElement } from 'react';
2
+ import { Theme } from '@leafygreen-ui/lib';
3
+ import { ComboboxSize } from '../types';
4
+ /**
5
+ * Util that returns the leftGlyph and rightGlyph.
6
+ */
7
+ export declare const getGlyphs: ({ withIcons, isSelected, glyph, optionTextId, disabled, darkMode, size, multiselect, theme, isFocused, }: {
8
+ withIcons: boolean;
9
+ isSelected: boolean;
10
+ glyph?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
11
+ optionTextId: string;
12
+ disabled: boolean;
13
+ darkMode: boolean;
14
+ size: ComboboxSize;
15
+ multiselect: boolean;
16
+ theme: Theme;
17
+ isFocused: boolean;
18
+ }) => {
19
+ leftGlyph: React.JSX.Element | null;
20
+ rightGlyph: false | React.JSX.Element;
21
+ };
22
+ //# sourceMappingURL=getGlyphs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGlyphs.d.ts","sourceRoot":"","sources":["../../src/ComboboxOption/getGlyphs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAYxC;;GAEG;AACH,eAAO,MAAM,SAAS;eAYT,OAAO;gBACN,OAAO;;kBAEL,MAAM;cACV,OAAO;cACP,OAAO;UACX,YAAY;iBACL,OAAO;WACb,KAAK;eACD,OAAO;;;;CAiEnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ComboboxOption, InternalComboboxOption } from './ComboboxOption';
2
+ export { type ComboboxOptionProps, type OptionObject, } from './ComboboxOption.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComboboxOption/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC"}