@spark-web/select 1.0.12 → 2.0.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,332 @@
1
+ # @spark-web/select
2
+
3
+ ## 2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#382](https://github.com/brighte-labs/spark-web/pull/382)
8
+ [`955bf5d`](https://github.com/brighte-labs/spark-web/commit/955bf5d7698bfdf45e7f317aa3e726c81d3444c0)
9
+ Thanks [@dilipt-brighte](https://github.com/dilipt-brighte)! - Updates React
10
+ version to latest (18.2.0)
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ [[`955bf5d`](https://github.com/brighte-labs/spark-web/commit/955bf5d7698bfdf45e7f317aa3e726c81d3444c0)]:
16
+ - @spark-web/box@1.2.0
17
+ - @spark-web/field@3.1.0
18
+ - @spark-web/icon@1.3.0
19
+ - @spark-web/text-input@3.0.0
20
+ - @spark-web/theme@3.2.0
21
+
22
+ ## 1.0.13
23
+
24
+ ### Patch Changes
25
+
26
+ - [#218](https://github.com/brighte-labs/spark-web/pull/218)
27
+ [`6fc8d1b`](https://github.com/brighte-labs/spark-web/commit/6fc8d1bc37e25d0cd622bc37f68a1d92eb5961b5)
28
+ Thanks [@nderkim](https://github.com/nderkim)! - Rename files to kebab case
29
+
30
+ - [#222](https://github.com/brighte-labs/spark-web/pull/222)
31
+ [`7f93c45`](https://github.com/brighte-labs/spark-web/commit/7f93c45bbae8c765e10df9d0dd7615473797749b)
32
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update
33
+ dependencies
34
+
35
+ - [#242](https://github.com/brighte-labs/spark-web/pull/242)
36
+ [`6df05f7`](https://github.com/brighte-labs/spark-web/commit/6df05f764e4181c140d6547d6b897d0210468f6a)
37
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - - Add homepage
38
+ and repository keys to package.json
39
+ - Add CHANGELOG and README to files key in package.json
40
+ - Updated dependencies
41
+ [[`adc5e9e`](https://github.com/brighte-labs/spark-web/commit/adc5e9e6c99acd117f3261edcefdb5573132441b),
42
+ [`de99b9c`](https://github.com/brighte-labs/spark-web/commit/de99b9c7f72373bd1902cf67f5cfec9a1e1db01c),
43
+ [`6fc8d1b`](https://github.com/brighte-labs/spark-web/commit/6fc8d1bc37e25d0cd622bc37f68a1d92eb5961b5),
44
+ [`7f93c45`](https://github.com/brighte-labs/spark-web/commit/7f93c45bbae8c765e10df9d0dd7615473797749b),
45
+ [`62f7de8`](https://github.com/brighte-labs/spark-web/commit/62f7de8a2e1df5ae088c093d3acdaa868d3f61fe),
46
+ [`6df05f7`](https://github.com/brighte-labs/spark-web/commit/6df05f764e4181c140d6547d6b897d0210468f6a)]:
47
+ - @spark-web/box@1.1.0
48
+ - @spark-web/field@3.0.6
49
+ - @spark-web/icon@1.2.2
50
+ - @spark-web/text-input@2.0.4
51
+ - @spark-web/theme@3.1.0
52
+
53
+ ## 1.0.12
54
+
55
+ ### Patch Changes
56
+
57
+ - [#208](https://github.com/brighte-labs/spark-web/pull/208)
58
+ [`1ea26ef`](https://github.com/brighte-labs/spark-web/commit/1ea26ef04a3b45875ed0dd2326eeab1fbe1e4bc5)
59
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Lower required
60
+ node version
61
+
62
+ - Updated dependencies
63
+ [[`1ea26ef`](https://github.com/brighte-labs/spark-web/commit/1ea26ef04a3b45875ed0dd2326eeab1fbe1e4bc5)]:
64
+ - @spark-web/box@1.0.9
65
+ - @spark-web/field@3.0.5
66
+ - @spark-web/icon@1.2.1
67
+ - @spark-web/text-input@2.0.3
68
+ - @spark-web/theme@3.0.6
69
+
70
+ ## 1.0.11
71
+
72
+ ### Patch Changes
73
+
74
+ - [#197](https://github.com/brighte-labs/spark-web/pull/197)
75
+ [`94016d8`](https://github.com/brighte-labs/spark-web/commit/94016d84e26bbe55833bbcbab847a2cce6041538)
76
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update packages
77
+
78
+ - Updated dependencies
79
+ [[`07286b5`](https://github.com/brighte-labs/spark-web/commit/07286b52f897909b1a806d736e1040351c93078f),
80
+ [`94016d8`](https://github.com/brighte-labs/spark-web/commit/94016d84e26bbe55833bbcbab847a2cce6041538)]:
81
+ - @spark-web/icon@1.2.0
82
+ - @spark-web/box@1.0.8
83
+ - @spark-web/field@3.0.4
84
+ - @spark-web/text-input@2.0.2
85
+ - @spark-web/theme@3.0.5
86
+
87
+ ## 1.0.10
88
+
89
+ ### Patch Changes
90
+
91
+ - [#184](https://github.com/brighte-labs/spark-web/pull/184)
92
+ [`6d68601`](https://github.com/brighte-labs/spark-web/commit/6d68601d1d7ac6b7de9c388f286d523935a98ea0)
93
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Enable Select to
94
+ have a blank option selected when value is blank
95
+
96
+ - Updated dependencies
97
+ [[`7b0cfdf`](https://github.com/brighte-labs/spark-web/commit/7b0cfdf6fb4d32b86e00050d8869ac2b9787cf41)]:
98
+ - @spark-web/theme@3.0.4
99
+
100
+ ## 1.0.9
101
+
102
+ ### Patch Changes
103
+
104
+ - [#173](https://github.com/brighte-labs/spark-web/pull/173)
105
+ [`90b7e9c`](https://github.com/brighte-labs/spark-web/commit/90b7e9cf4eb7e864d765c74b22c3dedf3d262e25)
106
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update babel
107
+ dependency
108
+
109
+ * [#178](https://github.com/brighte-labs/spark-web/pull/178)
110
+ [`c3867af`](https://github.com/brighte-labs/spark-web/commit/c3867af7b77dfae3580ab63a5d5c9e8452f2da62)
111
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Switch from using
112
+ `:invalid` pseudo-class to using data-attribute for invalid styles of inputs
113
+ * Updated dependencies
114
+ [[`90b7e9c`](https://github.com/brighte-labs/spark-web/commit/90b7e9cf4eb7e864d765c74b22c3dedf3d262e25),
115
+ [`c3867af`](https://github.com/brighte-labs/spark-web/commit/c3867af7b77dfae3580ab63a5d5c9e8452f2da62)]:
116
+ - @spark-web/box@1.0.7
117
+ - @spark-web/field@3.0.3
118
+ - @spark-web/icon@1.1.5
119
+ - @spark-web/text-input@2.0.1
120
+ - @spark-web/theme@3.0.3
121
+
122
+ ## 1.0.8
123
+
124
+ ### Patch Changes
125
+
126
+ - [#158](https://github.com/brighte-labs/spark-web/pull/158)
127
+ [`550b4b0`](https://github.com/brighte-labs/spark-web/commit/550b4b0509aba1f37d20fa8205ae01b2383eec5e)
128
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Refactor to work
129
+ with updated useInputStyles
130
+
131
+ * [#148](https://github.com/brighte-labs/spark-web/pull/148)
132
+ [`ad02c82`](https://github.com/brighte-labs/spark-web/commit/ad02c8279d3813956d9372db5a69c361482b7f72)
133
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Make Field a peer
134
+ dep to avoid context bug
135
+
136
+ - [#167](https://github.com/brighte-labs/spark-web/pull/167)
137
+ [`4f79350`](https://github.com/brighte-labs/spark-web/commit/4f793508fdb43ddd452f0d59a3126101f9fa5459)
138
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update Babel
139
+
140
+ * [#158](https://github.com/brighte-labs/spark-web/pull/158)
141
+ [`550b4b0`](https://github.com/brighte-labs/spark-web/commit/550b4b0509aba1f37d20fa8205ae01b2383eec5e)
142
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Remove unused
143
+ dependencies
144
+
145
+ * Updated dependencies
146
+ [[`550b4b0`](https://github.com/brighte-labs/spark-web/commit/550b4b0509aba1f37d20fa8205ae01b2383eec5e),
147
+ [`ad02c82`](https://github.com/brighte-labs/spark-web/commit/ad02c8279d3813956d9372db5a69c361482b7f72),
148
+ [`2ba486a`](https://github.com/brighte-labs/spark-web/commit/2ba486a504bd0704935aaad2b8442907dc1899ac),
149
+ [`4f79350`](https://github.com/brighte-labs/spark-web/commit/4f793508fdb43ddd452f0d59a3126101f9fa5459),
150
+ [`60f7281`](https://github.com/brighte-labs/spark-web/commit/60f7281c4a194d934a2ce561cad47e737b0fb48e)]:
151
+ - @spark-web/text-input@2.0.0
152
+ - @spark-web/box@1.0.6
153
+ - @spark-web/field@3.0.1
154
+ - @spark-web/icon@1.1.4
155
+ - @spark-web/theme@3.0.2
156
+
157
+ ## 1.0.7
158
+
159
+ ### Patch Changes
160
+
161
+ - Updated dependencies
162
+ [[`3db131b`](https://github.com/brighte-labs/spark-web/commit/3db131bfadbc4149d05b7c74be1a3e68cdd5b18f)]:
163
+ - @spark-web/field@3.0.0
164
+ - @spark-web/text-input@1.2.1
165
+
166
+ ## 1.0.6
167
+
168
+ ### Patch Changes
169
+
170
+ - [#113](https://github.com/brighte-labs/spark-web/pull/113)
171
+ [`156236d`](https://github.com/brighte-labs/spark-web/commit/156236d2474aee66a0b8e2030635f9c08a5b78ba)
172
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update
173
+ dependencies
174
+
175
+ * [#101](https://github.com/brighte-labs/spark-web/pull/101)
176
+ [`08752c3`](https://github.com/brighte-labs/spark-web/commit/08752c350b53cde0657ec32f03f9932dec835e33)
177
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update focus and
178
+ disabled styles
179
+
180
+ - [#108](https://github.com/brighte-labs/spark-web/pull/108)
181
+ [`efa263a`](https://github.com/brighte-labs/spark-web/commit/efa263aee2c33297edb19203ae1d82abd99d298d)
182
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Refactor to work
183
+ with updated field context
184
+
185
+ - Updated dependencies
186
+ [[`08752c3`](https://github.com/brighte-labs/spark-web/commit/08752c350b53cde0657ec32f03f9932dec835e33),
187
+ [`efa263a`](https://github.com/brighte-labs/spark-web/commit/efa263aee2c33297edb19203ae1d82abd99d298d),
188
+ [`27bc235`](https://github.com/brighte-labs/spark-web/commit/27bc235168b09bf8c03710b5fcde6ea0fd70824c),
189
+ [`156236d`](https://github.com/brighte-labs/spark-web/commit/156236d2474aee66a0b8e2030635f9c08a5b78ba),
190
+ [`efa263a`](https://github.com/brighte-labs/spark-web/commit/efa263aee2c33297edb19203ae1d82abd99d298d),
191
+ [`08752c3`](https://github.com/brighte-labs/spark-web/commit/08752c350b53cde0657ec32f03f9932dec835e33)]:
192
+ - @spark-web/a11y@1.0.5
193
+ - @spark-web/field@2.0.0
194
+ - @spark-web/text-input@1.2.0
195
+ - @spark-web/box@1.0.5
196
+ - @spark-web/icon@1.1.3
197
+ - @spark-web/text@1.0.5
198
+ - @spark-web/theme@3.0.1
199
+ - @spark-web/utils@1.1.3
200
+
201
+ ## 1.0.5
202
+
203
+ ### Patch Changes
204
+
205
+ - [#98](https://github.com/brighte-labs/spark-web/pull/98)
206
+ [`4750af7`](https://github.com/brighte-labs/spark-web/commit/4750af73f0e3a82ebde940cb13659a21c7e88007)
207
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Add aria-invalid
208
+ attribute
209
+
210
+ - Updated dependencies
211
+ [[`4ad9817`](https://github.com/brighte-labs/spark-web/commit/4ad9817d1f7acdecd3c8bbb3be517f5c11fe8d4b),
212
+ [`4750af7`](https://github.com/brighte-labs/spark-web/commit/4750af73f0e3a82ebde940cb13659a21c7e88007),
213
+ [`dc53688`](https://github.com/brighte-labs/spark-web/commit/dc53688cc271316f00ef25f101e94c3891f4f75d)]:
214
+ - @spark-web/text-input@1.1.1
215
+
216
+ ## 1.0.4
217
+
218
+ ### Patch Changes
219
+
220
+ - [#65](https://github.com/brighte-labs/spark-web/pull/65)
221
+ [`182a53a`](https://github.com/brighte-labs/spark-web/commit/182a53a484892df48754e89dd714459a7f69fcff)
222
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Remove "Inter"
223
+ font, change font-weights and font-sizes.
224
+
225
+ * [#87](https://github.com/brighte-labs/spark-web/pull/87)
226
+ [`5744b68`](https://github.com/brighte-labs/spark-web/commit/5744b6820f626b93a14e11e1fbd96bcbe1b12b27)
227
+ Thanks [@ChristopherMitchell242](https://github.com/ChristopherMitchell242)! -
228
+ Data attribute added to component props to allow consumers to attach
229
+ customattributes to components
230
+
231
+ - [#52](https://github.com/brighte-labs/spark-web/pull/52)
232
+ [`82ab744`](https://github.com/brighte-labs/spark-web/commit/82ab744f198466810f3386bc459b8ab4d57c820e)
233
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Add files array
234
+ to package.json files
235
+
236
+ - Updated dependencies
237
+ [[`60372d0`](https://github.com/brighte-labs/spark-web/commit/60372d0538fe5e141c8dabc1b20c8e09d1f56c70),
238
+ [`1ef4f82`](https://github.com/brighte-labs/spark-web/commit/1ef4f82df999c487b79cd216c17ca5735e444fc5),
239
+ [`182a53a`](https://github.com/brighte-labs/spark-web/commit/182a53a484892df48754e89dd714459a7f69fcff),
240
+ [`5744b68`](https://github.com/brighte-labs/spark-web/commit/5744b6820f626b93a14e11e1fbd96bcbe1b12b27),
241
+ [`82ab744`](https://github.com/brighte-labs/spark-web/commit/82ab744f198466810f3386bc459b8ab4d57c820e),
242
+ [`df618d9`](https://github.com/brighte-labs/spark-web/commit/df618d92d534e06f06ecedc95ea6bdd51cdc906b)]:
243
+ - @spark-web/field@1.1.0
244
+ - @spark-web/text-input@1.1.0
245
+ - @spark-web/text@1.0.4
246
+ - @spark-web/theme@3.0.0
247
+ - @spark-web/a11y@1.0.4
248
+ - @spark-web/box@1.0.4
249
+ - @spark-web/icon@1.1.2
250
+ - @spark-web/utils@1.1.2
251
+
252
+ ## 1.0.3
253
+
254
+ ### Patch Changes
255
+
256
+ - [#42](https://github.com/brighte-labs/spark-web/pull/42)
257
+ [`435779a`](https://github.com/brighte-labs/spark-web/commit/435779aa42bd635bbf43e1fd41724c666402caa2)
258
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Prevent multiple
259
+ versions of React
260
+
261
+ - Updated dependencies
262
+ [[`435779a`](https://github.com/brighte-labs/spark-web/commit/435779aa42bd635bbf43e1fd41724c666402caa2)]:
263
+ - @spark-web/a11y@1.0.3
264
+ - @spark-web/box@1.0.3
265
+ - @spark-web/field@1.0.3
266
+ - @spark-web/icon@1.1.1
267
+ - @spark-web/text@1.0.3
268
+ - @spark-web/text-input@1.0.3
269
+ - @spark-web/theme@2.0.2
270
+ - @spark-web/utils@1.1.1
271
+
272
+ ## 1.0.2
273
+
274
+ ### Patch Changes
275
+
276
+ - [#40](https://github.com/brighte-labs/spark-web/pull/40)
277
+ [`062c8ab`](https://github.com/brighte-labs/spark-web/commit/062c8ab8c7b4120f8d14c269b5f7801288c678ca)
278
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Add
279
+ @babel/transform-runtime
280
+
281
+ - Updated dependencies
282
+ [[`062c8ab`](https://github.com/brighte-labs/spark-web/commit/062c8ab8c7b4120f8d14c269b5f7801288c678ca)]:
283
+ - @spark-web/a11y@1.0.2
284
+ - @spark-web/box@1.0.2
285
+ - @spark-web/field@1.0.2
286
+ - @spark-web/icon@1.0.2
287
+ - @spark-web/text@1.0.2
288
+ - @spark-web/text-input@1.0.2
289
+ - @spark-web/theme@2.0.1
290
+ - @spark-web/utils@1.0.2
291
+
292
+ ## 1.0.1
293
+
294
+ ### Patch Changes
295
+
296
+ - [#36](https://github.com/brighte-labs/spark-web/pull/36)
297
+ [`8546f8f`](https://github.com/brighte-labs/spark-web/commit/8546f8f05daaa79ea3ff954c6c4928a7a2d0622d)
298
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update Babel
299
+ config
300
+
301
+ - Updated dependencies
302
+ [[`aebff30`](https://github.com/brighte-labs/spark-web/commit/aebff30c86cb0a9db22b545c46159ce0d1c14afb),
303
+ [`8546f8f`](https://github.com/brighte-labs/spark-web/commit/8546f8f05daaa79ea3ff954c6c4928a7a2d0622d)]:
304
+ - @spark-web/theme@2.0.0
305
+ - @spark-web/a11y@1.0.1
306
+ - @spark-web/box@1.0.1
307
+ - @spark-web/field@1.0.1
308
+ - @spark-web/icon@1.0.1
309
+ - @spark-web/text@1.0.1
310
+ - @spark-web/text-input@1.0.1
311
+ - @spark-web/utils@1.0.1
312
+
313
+ ## 1.0.0
314
+
315
+ ### Major Changes
316
+
317
+ - [#27](https://github.com/brighte-labs/spark-web/pull/27)
318
+ [`4c8e398`](https://github.com/brighte-labs/spark-web/commit/4c8e3988f8a59d3dab60a6b67b1128b6ff2a5f2c)
319
+ Thanks [@JedWatson](https://github.com/JedWatson)! - Initial Version
320
+
321
+ ### Patch Changes
322
+
323
+ - Updated dependencies
324
+ [[`4c8e398`](https://github.com/brighte-labs/spark-web/commit/4c8e3988f8a59d3dab60a6b67b1128b6ff2a5f2c)]:
325
+ - @spark-web/a11y@1.0.0
326
+ - @spark-web/box@1.0.0
327
+ - @spark-web/field@1.0.0
328
+ - @spark-web/icon@1.0.0
329
+ - @spark-web/text@1.0.0
330
+ - @spark-web/text-input@1.0.0
331
+ - @spark-web/theme@1.0.0
332
+ - @spark-web/utils@1.0.0
package/README.md CHANGED
@@ -124,17 +124,7 @@ return (
124
124
 
125
125
  ## Props
126
126
 
127
- | Prop | Type | Default | Description |
128
- | ------------- | -------------------------------------------- | ------- | -------------------------------------------------------------------------------------- |
129
- | data? | [DataAttributeMap][data-attribute-map] | | Sets data attributes on the component. |
130
- | options | Readonly\<Array\<Option \| Group>> | | The values that can be selected by the input. |
131
- | placeholder? | string | | Placeholder text for when the input does not have an initial value. |
132
- | defaultValue? | string \| number \| readonly string[] | | Default value of the select. |
133
- | name? | string | | This attribute is used to specify the name of the control. |
134
- | onBlur? | React.FocusEventHandler\<HTMLSelectElement> | | Function for handling change events. |
135
- | onChange? | React.ChangeEventHandler\<HTMLSelectElement> | | Function for handling blur events. |
136
- | required? | boolean | | Boolean that indicating that an option with a non-empty string value must be selected. |
137
- | value | string \| number \| readonly string[] | | Value of the select. |
127
+ <PropsTable displayName="Select" />
138
128
 
139
129
  [data-attribute-map]:
140
130
  https://github.com/brighte-labs/spark-web/blob/e7f6f4285b4cfd876312cc89fbdd094039aa239a/packages/utils/src/internal/buildDataAttributes.ts#L1
@@ -1,2 +1,2 @@
1
- export { Select } from './Select';
2
- export type { SelectProps } from './Select';
1
+ export { Select } from './select';
2
+ export type { SelectProps } from './select';
@@ -17,7 +17,7 @@ export declare type Group = {
17
17
  export declare type OptionsOrGroups = Array<Option | Group>;
18
18
  export declare type NativeSelectProps = Pick<SelectHTMLAttributes<HTMLSelectElement>, 'defaultValue' | 'name' | 'onBlur' | 'onChange' | 'required' | 'value'>;
19
19
  export declare type SelectProps = NativeSelectProps & {
20
- /** Allows setting of data attributes on the underlying element. */
20
+ /** Sets data attributes for the element. */
21
21
  data?: DataAttributeMap;
22
22
  /** The values that can be selected by the input. */
23
23
  options: OptionsOrGroups;
@@ -25,7 +25,7 @@ export declare type SelectProps = NativeSelectProps & {
25
25
  placeholder?: string;
26
26
  };
27
27
  export declare const Select: import("react").ForwardRefExoticComponent<NativeSelectProps & {
28
- /** Allows setting of data attributes on the underlying element. */
28
+ /** Sets data attributes for the element. */
29
29
  data?: DataAttributeMap | undefined;
30
30
  /** The values that can be selected by the input. */
31
31
  options: OptionsOrGroups;
@@ -15,30 +15,27 @@ var jsxRuntime = require('react/jsx-runtime');
15
15
 
16
16
  var Select = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
17
17
  var data = _ref.data,
18
- defaultValue = _ref.defaultValue,
19
- name = _ref.name,
20
- onBlur = _ref.onBlur,
21
- onChange = _ref.onChange,
22
- optionsOrGroups = _ref.options,
23
- placeholder = _ref.placeholder,
24
- required = _ref.required,
25
- value = _ref.value;
26
-
18
+ defaultValue = _ref.defaultValue,
19
+ name = _ref.name,
20
+ onBlur = _ref.onBlur,
21
+ onChange = _ref.onChange,
22
+ optionsOrGroups = _ref.options,
23
+ placeholder = _ref.placeholder,
24
+ required = _ref.required,
25
+ value = _ref.value;
27
26
  var _useFieldContext = field.useFieldContext(),
28
- _useFieldContext2 = _slicedToArray(_useFieldContext, 2),
29
- _useFieldContext2$ = _useFieldContext2[0],
30
- disabled = _useFieldContext2$.disabled,
31
- invalid = _useFieldContext2$.invalid,
32
- a11yProps = _useFieldContext2[1];
33
-
27
+ _useFieldContext2 = _slicedToArray(_useFieldContext, 2),
28
+ _useFieldContext2$ = _useFieldContext2[0],
29
+ disabled = _useFieldContext2$.disabled,
30
+ invalid = _useFieldContext2$.invalid,
31
+ a11yProps = _useFieldContext2[1];
34
32
  var _useSelectStyles = useSelectStyles({
35
- disabled: disabled,
36
- invalid: invalid
37
- }),
38
- _useSelectStyles2 = _slicedToArray(_useSelectStyles, 2),
39
- boxProps = _useSelectStyles2[0],
40
- inputStyles = _useSelectStyles2[1];
41
-
33
+ disabled: disabled,
34
+ invalid: invalid
35
+ }),
36
+ _useSelectStyles2 = _slicedToArray(_useSelectStyles, 2),
37
+ boxProps = _useSelectStyles2[0],
38
+ inputStyles = _useSelectStyles2[1];
42
39
  var mapOptions = react.useCallback(function (opt) {
43
40
  return /*#__PURE__*/jsxRuntime.jsx("option", {
44
41
  value: opt.value,
@@ -73,14 +70,12 @@ var Select = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
73
70
  })
74
71
  }, optionOrGroup.label);
75
72
  }
76
-
77
73
  return mapOptions(optionOrGroup);
78
74
  })]
79
75
  }))]
80
76
  });
81
77
  });
82
78
  Select.displayName = 'Select';
83
-
84
79
  var Indicator = function Indicator() {
85
80
  return /*#__PURE__*/jsxRuntime.jsx(box.Box, {
86
81
  position: "absolute",
@@ -99,19 +94,17 @@ var Indicator = function Indicator() {
99
94
  })
100
95
  });
101
96
  };
102
-
103
97
  function useSelectStyles(props) {
104
98
  var _useInputStyles = textInput.useInputStyles(props),
105
- _useInputStyles2 = _slicedToArray(_useInputStyles, 2),
106
- boxProps = _useInputStyles2[0],
107
- inputStyles = _useInputStyles2[1];
108
-
99
+ _useInputStyles2 = _slicedToArray(_useInputStyles, 2),
100
+ boxProps = _useInputStyles2[0],
101
+ inputStyles = _useInputStyles2[1];
109
102
  var theme$1 = theme.useTheme();
110
103
  return [boxProps, _objectSpread(_objectSpread({}, inputStyles), {}, {
111
104
  // Prevent text going underneath the chevron icon
112
- paddingRight: theme$1.sizing.xxsmall + // size of chevron icon
105
+ paddingRight: theme$1.sizing.xxsmall +
106
+ // size of chevron icon
113
107
  theme$1.spacing.medium * 2 // paddingX value
114
-
115
108
  })];
116
109
  }
117
110
 
@@ -15,30 +15,27 @@ var jsxRuntime = require('react/jsx-runtime');
15
15
 
16
16
  var Select = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
17
17
  var data = _ref.data,
18
- defaultValue = _ref.defaultValue,
19
- name = _ref.name,
20
- onBlur = _ref.onBlur,
21
- onChange = _ref.onChange,
22
- optionsOrGroups = _ref.options,
23
- placeholder = _ref.placeholder,
24
- required = _ref.required,
25
- value = _ref.value;
26
-
18
+ defaultValue = _ref.defaultValue,
19
+ name = _ref.name,
20
+ onBlur = _ref.onBlur,
21
+ onChange = _ref.onChange,
22
+ optionsOrGroups = _ref.options,
23
+ placeholder = _ref.placeholder,
24
+ required = _ref.required,
25
+ value = _ref.value;
27
26
  var _useFieldContext = field.useFieldContext(),
28
- _useFieldContext2 = _slicedToArray(_useFieldContext, 2),
29
- _useFieldContext2$ = _useFieldContext2[0],
30
- disabled = _useFieldContext2$.disabled,
31
- invalid = _useFieldContext2$.invalid,
32
- a11yProps = _useFieldContext2[1];
33
-
27
+ _useFieldContext2 = _slicedToArray(_useFieldContext, 2),
28
+ _useFieldContext2$ = _useFieldContext2[0],
29
+ disabled = _useFieldContext2$.disabled,
30
+ invalid = _useFieldContext2$.invalid,
31
+ a11yProps = _useFieldContext2[1];
34
32
  var _useSelectStyles = useSelectStyles({
35
- disabled: disabled,
36
- invalid: invalid
37
- }),
38
- _useSelectStyles2 = _slicedToArray(_useSelectStyles, 2),
39
- boxProps = _useSelectStyles2[0],
40
- inputStyles = _useSelectStyles2[1];
41
-
33
+ disabled: disabled,
34
+ invalid: invalid
35
+ }),
36
+ _useSelectStyles2 = _slicedToArray(_useSelectStyles, 2),
37
+ boxProps = _useSelectStyles2[0],
38
+ inputStyles = _useSelectStyles2[1];
42
39
  var mapOptions = react.useCallback(function (opt) {
43
40
  return /*#__PURE__*/jsxRuntime.jsx("option", {
44
41
  value: opt.value,
@@ -73,14 +70,12 @@ var Select = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
73
70
  })
74
71
  }, optionOrGroup.label);
75
72
  }
76
-
77
73
  return mapOptions(optionOrGroup);
78
74
  })]
79
75
  }))]
80
76
  });
81
77
  });
82
78
  Select.displayName = 'Select';
83
-
84
79
  var Indicator = function Indicator() {
85
80
  return /*#__PURE__*/jsxRuntime.jsx(box.Box, {
86
81
  position: "absolute",
@@ -99,19 +94,17 @@ var Indicator = function Indicator() {
99
94
  })
100
95
  });
101
96
  };
102
-
103
97
  function useSelectStyles(props) {
104
98
  var _useInputStyles = textInput.useInputStyles(props),
105
- _useInputStyles2 = _slicedToArray(_useInputStyles, 2),
106
- boxProps = _useInputStyles2[0],
107
- inputStyles = _useInputStyles2[1];
108
-
99
+ _useInputStyles2 = _slicedToArray(_useInputStyles, 2),
100
+ boxProps = _useInputStyles2[0],
101
+ inputStyles = _useInputStyles2[1];
109
102
  var theme$1 = theme.useTheme();
110
103
  return [boxProps, _objectSpread(_objectSpread({}, inputStyles), {}, {
111
104
  // Prevent text going underneath the chevron icon
112
- paddingRight: theme$1.sizing.xxsmall + // size of chevron icon
105
+ paddingRight: theme$1.sizing.xxsmall +
106
+ // size of chevron icon
113
107
  theme$1.spacing.medium * 2 // paddingX value
114
-
115
108
  })];
116
109
  }
117
110
 
@@ -11,30 +11,27 @@ import { jsx, jsxs } from 'react/jsx-runtime';
11
11
 
12
12
  var Select = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
13
13
  var data = _ref.data,
14
- defaultValue = _ref.defaultValue,
15
- name = _ref.name,
16
- onBlur = _ref.onBlur,
17
- onChange = _ref.onChange,
18
- optionsOrGroups = _ref.options,
19
- placeholder = _ref.placeholder,
20
- required = _ref.required,
21
- value = _ref.value;
22
-
14
+ defaultValue = _ref.defaultValue,
15
+ name = _ref.name,
16
+ onBlur = _ref.onBlur,
17
+ onChange = _ref.onChange,
18
+ optionsOrGroups = _ref.options,
19
+ placeholder = _ref.placeholder,
20
+ required = _ref.required,
21
+ value = _ref.value;
23
22
  var _useFieldContext = useFieldContext(),
24
- _useFieldContext2 = _slicedToArray(_useFieldContext, 2),
25
- _useFieldContext2$ = _useFieldContext2[0],
26
- disabled = _useFieldContext2$.disabled,
27
- invalid = _useFieldContext2$.invalid,
28
- a11yProps = _useFieldContext2[1];
29
-
23
+ _useFieldContext2 = _slicedToArray(_useFieldContext, 2),
24
+ _useFieldContext2$ = _useFieldContext2[0],
25
+ disabled = _useFieldContext2$.disabled,
26
+ invalid = _useFieldContext2$.invalid,
27
+ a11yProps = _useFieldContext2[1];
30
28
  var _useSelectStyles = useSelectStyles({
31
- disabled: disabled,
32
- invalid: invalid
33
- }),
34
- _useSelectStyles2 = _slicedToArray(_useSelectStyles, 2),
35
- boxProps = _useSelectStyles2[0],
36
- inputStyles = _useSelectStyles2[1];
37
-
29
+ disabled: disabled,
30
+ invalid: invalid
31
+ }),
32
+ _useSelectStyles2 = _slicedToArray(_useSelectStyles, 2),
33
+ boxProps = _useSelectStyles2[0],
34
+ inputStyles = _useSelectStyles2[1];
38
35
  var mapOptions = useCallback(function (opt) {
39
36
  return /*#__PURE__*/jsx("option", {
40
37
  value: opt.value,
@@ -69,14 +66,12 @@ var Select = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
69
66
  })
70
67
  }, optionOrGroup.label);
71
68
  }
72
-
73
69
  return mapOptions(optionOrGroup);
74
70
  })]
75
71
  }))]
76
72
  });
77
73
  });
78
74
  Select.displayName = 'Select';
79
-
80
75
  var Indicator = function Indicator() {
81
76
  return /*#__PURE__*/jsx(Box, {
82
77
  position: "absolute",
@@ -95,19 +90,17 @@ var Indicator = function Indicator() {
95
90
  })
96
91
  });
97
92
  };
98
-
99
93
  function useSelectStyles(props) {
100
94
  var _useInputStyles = useInputStyles(props),
101
- _useInputStyles2 = _slicedToArray(_useInputStyles, 2),
102
- boxProps = _useInputStyles2[0],
103
- inputStyles = _useInputStyles2[1];
104
-
95
+ _useInputStyles2 = _slicedToArray(_useInputStyles, 2),
96
+ boxProps = _useInputStyles2[0],
97
+ inputStyles = _useInputStyles2[1];
105
98
  var theme = useTheme();
106
99
  return [boxProps, _objectSpread(_objectSpread({}, inputStyles), {}, {
107
100
  // Prevent text going underneath the chevron icon
108
- paddingRight: theme.sizing.xxsmall + // size of chevron icon
101
+ paddingRight: theme.sizing.xxsmall +
102
+ // size of chevron icon
109
103
  theme.spacing.medium * 2 // paddingX value
110
-
111
104
  })];
112
105
  }
113
106
 
package/package.json CHANGED
@@ -1,28 +1,35 @@
1
1
  {
2
2
  "name": "@spark-web/select",
3
- "version": "1.0.12",
4
- "license": "MIT",
3
+ "version": "2.0.0",
4
+ "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/brighte-labs/spark-web.git",
8
+ "directory": "packages/select"
9
+ },
5
10
  "main": "dist/spark-web-select.cjs.js",
6
11
  "module": "dist/spark-web-select.esm.js",
7
12
  "files": [
8
- "dist"
13
+ "CHANGELOG.md",
14
+ "dist",
15
+ "README.md"
9
16
  ],
10
17
  "dependencies": {
11
- "@babel/runtime": "^7.18.9",
18
+ "@babel/runtime": "^7.19.0",
12
19
  "@emotion/css": "^11.9.0",
13
- "@spark-web/box": "^1.0.9",
14
- "@spark-web/icon": "^1.2.1",
15
- "@spark-web/text-input": "^2.0.3",
16
- "@spark-web/theme": "^3.0.6"
20
+ "@spark-web/box": "^1.2.0",
21
+ "@spark-web/icon": "^1.3.0",
22
+ "@spark-web/text-input": "^3.0.0",
23
+ "@spark-web/theme": "^3.2.0"
17
24
  },
18
25
  "devDependencies": {
19
- "@spark-web/field": "^3.0.5",
20
- "@spark-web/utils": "^1.2.2",
21
- "@types/react": "^17.0.12",
22
- "react": "^17.0.2"
26
+ "@spark-web/field": "^3.1.0",
27
+ "@spark-web/utils": "^1.3.0",
28
+ "@types/react": "^18.2.0",
29
+ "react": "^18.2.0"
23
30
  },
24
31
  "peerDependencies": {
25
- "@spark-web/field": "^3.0.5",
32
+ "@spark-web/field": "^3.1.0",
26
33
  "react": ">=17.0.2"
27
34
  },
28
35
  "engines": {