@leafygreen-ui/combobox 11.0.0 → 11.0.1

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 (84) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +191 -0
  3. package/package.json +23 -25
  4. package/src/Combobox/Combobox.tsx +0 -2
  5. package/src/ComboboxChip/ComboboxChip.stories.tsx +0 -1
  6. package/src/ComboboxGroup/ComboboxGroup.stories.tsx +0 -1
  7. package/src/ComboboxMenu/ComboboxMenu.stories.tsx +1 -1
  8. package/src/ComboboxOption/ComboboxOption.stories.tsx +0 -1
  9. package/dist/Combobox/Combobox.d.ts +0 -13
  10. package/dist/Combobox/Combobox.d.ts.map +0 -1
  11. package/dist/Combobox/Combobox.styles.d.ts +0 -52
  12. package/dist/Combobox/Combobox.styles.d.ts.map +0 -1
  13. package/dist/Combobox/Combobox.types.d.ts +0 -137
  14. package/dist/Combobox/Combobox.types.d.ts.map +0 -1
  15. package/dist/Combobox/index.d.ts +0 -3
  16. package/dist/Combobox/index.d.ts.map +0 -1
  17. package/dist/Combobox/utils/isValueCurrentSelection.d.ts +0 -7
  18. package/dist/Combobox/utils/isValueCurrentSelection.d.ts.map +0 -1
  19. package/dist/ComboboxChip/ComboboxChip.d.ts +0 -4
  20. package/dist/ComboboxChip/ComboboxChip.d.ts.map +0 -1
  21. package/dist/ComboboxChip/ComboboxChip.styles.d.ts +0 -24
  22. package/dist/ComboboxChip/ComboboxChip.styles.d.ts.map +0 -1
  23. package/dist/ComboboxChip/ComboboxChip.types.d.ts +0 -7
  24. package/dist/ComboboxChip/ComboboxChip.types.d.ts.map +0 -1
  25. package/dist/ComboboxChip/index.d.ts +0 -2
  26. package/dist/ComboboxChip/index.d.ts.map +0 -1
  27. package/dist/ComboboxContext/ComboboxContext.d.ts +0 -28
  28. package/dist/ComboboxContext/ComboboxContext.d.ts.map +0 -1
  29. package/dist/ComboboxContext/index.d.ts +0 -2
  30. package/dist/ComboboxContext/index.d.ts.map +0 -1
  31. package/dist/ComboboxGroup/ComboboxGroup.d.ts +0 -11
  32. package/dist/ComboboxGroup/ComboboxGroup.d.ts.map +0 -1
  33. package/dist/ComboboxGroup/ComboboxGroup.styles.d.ts +0 -5
  34. package/dist/ComboboxGroup/ComboboxGroup.styles.d.ts.map +0 -1
  35. package/dist/ComboboxGroup/ComboboxGroup.types.d.ts +0 -19
  36. package/dist/ComboboxGroup/ComboboxGroup.types.d.ts.map +0 -1
  37. package/dist/ComboboxGroup/index.d.ts +0 -3
  38. package/dist/ComboboxGroup/index.d.ts.map +0 -1
  39. package/dist/ComboboxMenu/ComboboxMenu.d.ts +0 -10
  40. package/dist/ComboboxMenu/ComboboxMenu.d.ts.map +0 -1
  41. package/dist/ComboboxMenu/Menu.styles.d.ts +0 -22
  42. package/dist/ComboboxMenu/Menu.styles.d.ts.map +0 -1
  43. package/dist/ComboboxMenu/index.d.ts +0 -2
  44. package/dist/ComboboxMenu/index.d.ts.map +0 -1
  45. package/dist/ComboboxOption/ComboboxOption.d.ts +0 -14
  46. package/dist/ComboboxOption/ComboboxOption.d.ts.map +0 -1
  47. package/dist/ComboboxOption/ComboboxOption.styles.d.ts +0 -18
  48. package/dist/ComboboxOption/ComboboxOption.styles.d.ts.map +0 -1
  49. package/dist/ComboboxOption/ComboboxOption.types.d.ts +0 -54
  50. package/dist/ComboboxOption/ComboboxOption.types.d.ts.map +0 -1
  51. package/dist/ComboboxOption/getGlyphs.d.ts +0 -22
  52. package/dist/ComboboxOption/getGlyphs.d.ts.map +0 -1
  53. package/dist/ComboboxOption/index.d.ts +0 -3
  54. package/dist/ComboboxOption/index.d.ts.map +0 -1
  55. package/dist/esm/index.js +0 -2
  56. package/dist/esm/index.js.map +0 -1
  57. package/dist/index.d.ts +0 -4
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/index.js +0 -2
  60. package/dist/index.js.map +0 -1
  61. package/dist/test-utils/getTestOptions.testutils.d.ts +0 -3
  62. package/dist/test-utils/getTestOptions.testutils.d.ts.map +0 -1
  63. package/dist/types/Combobox.types.d.ts +0 -78
  64. package/dist/types/Combobox.types.d.ts.map +0 -1
  65. package/dist/types/index.d.ts +0 -3
  66. package/dist/types/index.d.ts.map +0 -1
  67. package/dist/utils/ComboboxTestUtils.d.ts +0 -42
  68. package/dist/utils/ComboboxTestUtils.d.ts.map +0 -1
  69. package/dist/utils/OptionObjectUtils.d.ts +0 -23
  70. package/dist/utils/OptionObjectUtils.d.ts.map +0 -1
  71. package/dist/utils/checkScrollPosition.d.ts +0 -10
  72. package/dist/utils/checkScrollPosition.d.ts.map +0 -1
  73. package/dist/utils/doesSelectionExist.d.ts +0 -3
  74. package/dist/utils/doesSelectionExist.d.ts.map +0 -1
  75. package/dist/utils/flattenChildren.d.ts +0 -12
  76. package/dist/utils/flattenChildren.d.ts.map +0 -1
  77. package/dist/utils/getNameAndValue.d.ts +0 -15
  78. package/dist/utils/getNameAndValue.d.ts.map +0 -1
  79. package/dist/utils/index.d.ts +0 -6
  80. package/dist/utils/index.d.ts.map +0 -1
  81. package/dist/utils/wrapJSX.d.ts +0 -15
  82. package/dist/utils/wrapJSX.d.ts.map +0 -1
  83. package/stories.js +0 -1
  84. package/tsdoc.json +0 -983
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @leafygreen-ui/combobox
2
2
 
3
+ ## 11.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 53c67fba6: [LG-4650](https://jira.mongodb.org/browse/LG-4650): migrates from `yarn` to `pnpm`
8
+ - Updated dependencies [53c67fba6]
9
+ - @leafygreen-ui/leafygreen-provider@4.0.1
10
+ - @leafygreen-ui/input-option@3.0.1
11
+ - @leafygreen-ui/icon-button@16.0.1
12
+ - @leafygreen-ui/form-field@2.0.1
13
+ - @leafygreen-ui/typography@20.0.1
14
+ - @leafygreen-ui/checkbox@14.0.1
15
+ - @leafygreen-ui/palette@4.1.2
16
+ - @leafygreen-ui/popover@13.0.1
17
+ - @leafygreen-ui/tokens@2.11.2
18
+ - @leafygreen-ui/hooks@8.3.3
19
+ - @leafygreen-ui/chip@3.0.1
20
+ - @leafygreen-ui/icon@13.1.1
21
+ - @leafygreen-ui/lib@14.0.1
22
+
3
23
  ## 11.0.0
4
24
 
5
25
  ### Major Changes
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2022 MongoDB Inc.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafygreen-ui/combobox",
3
- "version": "11.0.0",
3
+ "version": "11.0.1",
4
4
  "description": "leafyGreen UI Kit Combobox",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -12,40 +12,33 @@
12
12
  ]
13
13
  }
14
14
  },
15
- "scripts": {
16
- "build": "lg build-package",
17
- "tsc": "lg build-ts",
18
- "docs": "lg build-tsdoc"
19
- },
20
15
  "license": "Apache-2.0",
21
16
  "publishConfig": {
22
17
  "access": "public"
23
18
  },
24
19
  "dependencies": {
25
- "@leafygreen-ui/checkbox": "^14.0.0",
26
- "@leafygreen-ui/chip": "^3.0.0",
27
- "@leafygreen-ui/emotion": "^4.0.8",
28
- "@leafygreen-ui/form-field": "^2.0.0",
29
- "@leafygreen-ui/hooks": "^8.3.2",
30
- "@leafygreen-ui/icon": "^13.0.0",
31
- "@leafygreen-ui/icon-button": "^16.0.0",
32
- "@leafygreen-ui/input-option": "^3.0.0",
33
- "@leafygreen-ui/lib": "^14.0.0",
34
- "@leafygreen-ui/palette": "^4.0.9",
35
- "@leafygreen-ui/popover": "^13.0.0",
36
- "@leafygreen-ui/tokens": "^2.11.1",
37
- "@leafygreen-ui/typography": "^20.0.0",
38
20
  "chalk": "^4.1.2",
39
21
  "lodash": "^4.17.21",
40
- "polished": "^4.2.2"
22
+ "polished": "^4.2.2",
23
+ "@leafygreen-ui/checkbox": "^14.0.1",
24
+ "@leafygreen-ui/emotion": "^4.0.8",
25
+ "@leafygreen-ui/chip": "^3.0.1",
26
+ "@leafygreen-ui/hooks": "^8.3.3",
27
+ "@leafygreen-ui/form-field": "^2.0.1",
28
+ "@leafygreen-ui/icon": "^13.1.1",
29
+ "@leafygreen-ui/icon-button": "^16.0.1",
30
+ "@leafygreen-ui/input-option": "^3.0.1",
31
+ "@leafygreen-ui/lib": "^14.0.1",
32
+ "@leafygreen-ui/popover": "^13.0.1",
33
+ "@leafygreen-ui/palette": "^4.1.2",
34
+ "@leafygreen-ui/tokens": "^2.11.2",
35
+ "@leafygreen-ui/typography": "^20.0.1"
41
36
  },
42
37
  "peerDependencies": {
43
- "@leafygreen-ui/leafygreen-provider": "^4.0.0"
38
+ "@leafygreen-ui/leafygreen-provider": "^4.0.1"
44
39
  },
45
40
  "devDependencies": {
46
- "@leafygreen-ui/button": "^22.0.0",
47
- "@leafygreen-ui/testing-lib": "^0.7.0",
48
- "@lg-tools/storybook-utils": "^0.1.1"
41
+ "@leafygreen-ui/button": "^22.0.1"
49
42
  },
50
43
  "homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/combobox",
51
44
  "repository": {
@@ -54,5 +47,10 @@
54
47
  },
55
48
  "bugs": {
56
49
  "url": "https://jira.mongodb.org/projects/PD/summary"
50
+ },
51
+ "scripts": {
52
+ "build": "lg build-package",
53
+ "tsc": "lg build-ts",
54
+ "docs": "lg build-tsdoc"
57
55
  }
58
- }
56
+ }
@@ -1224,8 +1224,6 @@ export function Combobox<M extends boolean>({
1224
1224
  </div>
1225
1225
  )}
1226
1226
 
1227
- {/* Disable eslint: onClick sets focus. Key events would already have focus */}
1228
- {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
1229
1227
  <div
1230
1228
  ref={comboboxRef}
1231
1229
  role="combobox"
@@ -1,4 +1,3 @@
1
- /* eslint-disable react/display-name */
2
1
  import React from 'react';
3
2
  import { StoryMetaType } from '@lg-tools/storybook-utils';
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable react/display-name */
2
1
  import React from 'react';
3
2
  import { StoryMetaType } from '@lg-tools/storybook-utils';
4
3
 
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
- /* eslint-disable react/display-name, react/jsx-key */
2
+
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils';
5
5
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable react/display-name, react/jsx-key */
2
1
  import React from 'react';
3
2
  import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils';
4
3
 
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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,qBAouClB;AAED;;;GAGG"}
@@ -1,52 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,137 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- export { Combobox } from './Combobox';
2
- export { type BaseComboboxProps, type ComboboxMultiselectProps, type ComboboxProps, } from './Combobox.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,4 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,24 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
1
- export interface ComboboxChipProps {
2
- displayName: string;
3
- isFocused: boolean;
4
- onRemove: () => void;
5
- onFocus: () => void;
6
- }
7
- //# sourceMappingURL=ComboboxChip.types.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export { ComboboxChip } from './ComboboxChip';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ComboboxChip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}