playbook_ui 17.0.0.pre.alpha.PLAY315518621 → 17.0.0.pre.alpha.mlsnoreact18445

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_card/card.rb +1 -1
  3. data/app/pb_kits/playbook/pb_card/kit.schema.json +0 -2
  4. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.jsx +1 -1
  6. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +6 -24
  7. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -32
  8. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +3 -7
  9. data/app/pb_kits/playbook/pb_dropdown/subcomponents/MultiSelectTriggerDisplay.tsx +2 -4
  10. data/app/pb_kits/playbook/pb_form/docs/_description.md +0 -23
  11. data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
  12. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_button.jsx +34 -51
  13. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_date_picker.jsx +18 -28
  14. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_default.jsx +25 -47
  15. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_full_width.jsx +40 -69
  16. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +0 -7
  17. data/app/pb_kits/playbook/pb_select/docs/_playground.json +1 -13
  18. data/app/pb_kits/playbook/pb_select/docs/_playground.overrides.json +0 -9
  19. data/app/pb_kits/playbook/tokens/_colors.scss +3 -7
  20. data/app/pb_kits/playbook/tokens/_height.scss +1 -5
  21. data/app/pb_kits/playbook/utilities/globalProps.ts +9 -17
  22. data/app/pb_kits/playbook/utilities/test/globalProps/height.test.js +7 -10
  23. data/dist/chunks/{_detail-eMZN1lvq.js → _detail-BQ0fCaZT.js} +1 -1
  24. data/dist/chunks/{_pb_line_graph-CiTPfwy6.js → _pb_line_graph-nUF-f93L.js} +1 -1
  25. data/dist/chunks/{_table-D5ErUJ1X.js → _table-BYW_yPh_.js} +1 -1
  26. data/dist/chunks/{_typeahead-kaYZtVWA.js → _typeahead-B__MDZlD.js} +1 -1
  27. data/dist/chunks/globalProps-BrVUCoIB.js +6 -0
  28. data/dist/chunks/{lib-DJySPcHy.js → lib-D0T1C_Ym.js} +1 -1
  29. data/dist/chunks/vendor.js +2 -2
  30. data/dist/playbook-rails-react-bindings.js +1 -1
  31. data/dist/playbook-rails.js +1 -1
  32. data/dist/playbook.css +1 -1
  33. data/lib/playbook/forms/builder/collection_select_field.rb +0 -3
  34. data/lib/playbook/forms/builder/date_picker_field.rb +0 -8
  35. data/lib/playbook/forms/builder/dropdown_field.rb +0 -9
  36. data/lib/playbook/forms/builder/form_field_builder.rb +0 -2
  37. data/lib/playbook/forms/builder/intl_telephone_field.rb +0 -8
  38. data/lib/playbook/forms/builder/multi_level_select_field.rb +0 -9
  39. data/lib/playbook/forms/builder/phone_number_field.rb +0 -8
  40. data/lib/playbook/forms/builder/select_field.rb +0 -3
  41. data/lib/playbook/forms/builder/star_rating_field.rb +0 -7
  42. data/lib/playbook/forms/builder/time_picker_field.rb +0 -8
  43. data/lib/playbook/forms/builder/typeahead_field.rb +0 -15
  44. data/lib/playbook/forms/builder.rb +0 -3
  45. data/lib/playbook/height.rb +2 -2
  46. data/lib/playbook/max_height.rb +2 -2
  47. data/lib/playbook/min_height.rb +2 -2
  48. data/lib/playbook/pb_forms_global_props_helper.rb +3 -3
  49. data/lib/playbook/tokens/colors.json +2 -4
  50. data/lib/playbook/version.rb +1 -1
  51. metadata +8 -11
  52. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_model_defaults.html.erb +0 -36
  53. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_model_defaults.md +0 -8
  54. data/dist/chunks/globalProps-DXDSpbRD.js +0 -6
  55. data/lib/playbook/forms/builder/attribute_defaults.rb +0 -69
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7517a9dce6795a4f2d9c108b1d36821c12c51253432d3c61458d95b6b42c50e
4
- data.tar.gz: c9b5d5daa8c4b0fb7fe37ecf5ad899db3ad1da2d4f61ff4a1ac01b84a3f503d6
3
+ metadata.gz: 052d8a5e6a4fc3b0c3fe13dd3d717c38fdadf9fcf5788bcb5f777556c738d94b
4
+ data.tar.gz: e751cb1c214723eb220f328bfef17a260129f6bbe1f0171d84fdf1dea5407258
5
5
  SHA512:
6
- metadata.gz: a39dd66ccb73cea3e138b8fd2131d179cc0d3570cf1b6b7e8a469f6b012ff991758a7b519c127010c888b2ffb661c62e4f235c2dd23272751f3b1dc623df74ba
7
- data.tar.gz: 2085a6957fef73d265cc5958925f82e6a86a7635411c6ecc7d7c5ba0f589e8851ddba7ec40b70365ea36197c9fc8e038024278a4f8aec9ccb276941f16fe9718
6
+ metadata.gz: 59f3d638bec9b1126e2c4cc2a31cc17fc9a1a4bb2a16191c2d3b6c1d6dd865ba2468cbfb48dd93782b59fbf591c8bcd244c8ac7e65d82b51a0d3c99b366f4b99
7
+ data.tar.gz: d60cae6a43f03cc1ff0af2d9b807192536d7fd715abb01babc0d9a73814cdbd9b676aa931dc2126e34120088dfa9089dcbce61738698e70f8bf3fc7e96fff66c
@@ -15,7 +15,7 @@ module Playbook
15
15
  values: %w[xs sm md lg xl none rounded],
16
16
  default: "md"
17
17
  prop :background, type: Playbook::Props::Enum,
18
- values: %w[white light dark product_1_background product_1_highlight product_2_background product_2_highlight product_3_background product_3_highlight product_4_background product_4_highlight product_5_background product_5_highlight product_6_background product_6_highlight product_7_background product_7_highlight product_8_background product_8_highlight product_9_background product_9_highlight product_10_background product_10_highlight product_11_background product_11_highlight product_12_background product_12_highlight windows siding doors solar roofing gutters insulation none success_subtle warning_subtle error_subtle info_subtle neutral_subtle],
18
+ values: %w[white light dark product_1_background product_1_highlight product_2_background product_2_highlight product_3_background product_3_highlight product_4_background product_4_highlight product_5_background product_5_highlight product_6_background product_6_highlight product_7_background product_7_highlight product_8_background product_8_highlight product_9_background product_9_highlight product_10_background product_10_highlight product_11_background product_11_highlight windows siding doors solar roofing gutters insulation none success_subtle warning_subtle error_subtle info_subtle neutral_subtle],
19
19
  default: "none"
20
20
  prop :drag_id, type: Playbook::Props::String
21
21
  prop :draggable_item, type: Playbook::Props::Boolean,
@@ -39,8 +39,6 @@
39
39
  "product_10_highlight",
40
40
  "product_11_background",
41
41
  "product_11_highlight",
42
- "product_12_background",
43
- "product_12_highlight",
44
42
  "windows",
45
43
  "siding",
46
44
  "doors",
@@ -1,5 +1,5 @@
1
1
  <%= pb_rails("date_picker", props: {
2
- picker_id: "date-picker-required-indicator",
2
+ picker_id: "date_picker_required_indicator",
3
3
  label: "Required Date Picker",
4
4
  required_indicator: true,
5
5
  }) %>
@@ -4,7 +4,7 @@ import DatePicker from "../_date_picker"
4
4
  const DatePickerRequiredIndicator = (props) => (
5
5
  <DatePicker
6
6
  label="Required Date Picker"
7
- pickerId="date-picker-required-indicator"
7
+ pickerId="date_picker_required_indicator"
8
8
  requiredIndicator
9
9
  {...props}
10
10
  />
@@ -116,12 +116,6 @@
116
116
  color: $input_text_disabled;
117
117
  }
118
118
 
119
- // Rails select-only / multi-select Body placeholders (autocomplete uses ::placeholder above)
120
- .pb_body_kit[data-dropdown-trigger-display],
121
- .pb_body_kit[data-dropdown-trigger-display-multi-select] {
122
- color: $input_text_default;
123
- }
124
-
125
119
  &:focus {
126
120
  box-shadow: 0px 0px 0 1px $status_border_primary !important;
127
121
  outline: unset;
@@ -133,20 +127,16 @@
133
127
  transition: box-shadow 0.15s ease-in-out;
134
128
  }
135
129
 
130
+ &.dropdown_trigger_wrapper_select_only {
131
+ box-shadow: inset 0 -11px 20px rgba($status_border_primary, 0.05);
132
+ }
133
+
136
134
  &.dropdown_trigger_wrapper_focus {
137
135
  box-shadow: 0px 0px 0 1px $status_border_primary !important;
138
136
  transition: box-shadow 0.1s ease-in-out;
139
137
  }
140
138
  }
141
139
 
142
- // Selected value: restore default text color (Rails reuses the placeholder Body node)
143
- &:has([data-dropdown-clear-icon]:not([style*="display: none"])),
144
- &:has(.pb_dropdown_option_selected) {
145
- .pb_body_kit[data-dropdown-trigger-display] {
146
- color: $text_default_color;
147
- }
148
- }
149
-
150
140
  .pb_dropdown_container {
151
141
  position: absolute;
152
142
  background-color: $white;
@@ -411,9 +401,8 @@
411
401
  [class^="pb_body"] {
412
402
  color: $text_default_dark;
413
403
  }
414
- .pb_body_kit[data-dropdown-trigger-display],
415
- .pb_body_kit[data-dropdown-trigger-display-multi-select] {
416
- color: $input_text_default_dark;
404
+ &.dropdown_trigger_wrapper_select_only {
405
+ box-shadow: inset 0 -11px 20px rgba($status_border_primary_dark, 0.05);
417
406
  }
418
407
  .dropdown_input {
419
408
  background-color: unset;
@@ -424,13 +413,6 @@
424
413
  }
425
414
  }
426
415
 
427
- &:has([data-dropdown-clear-icon]:not([style*="display: none"])),
428
- &:has(.pb_dropdown_option_selected) {
429
- .pb_body_kit[data-dropdown-trigger-display] {
430
- color: $text_default_dark;
431
- }
432
- }
433
-
434
416
  &.error {
435
417
  .dropdown_trigger_wrapper,
436
418
  .dropdown_trigger_wrapper_focus,
@@ -197,38 +197,6 @@ test('placeholder shows default "Select..." when not provided', () => {
197
197
  expect(trigger).toHaveTextContent('Select...')
198
198
  })
199
199
 
200
- test('placeholder Body uses lighter color', () => {
201
- render(
202
- <Dropdown
203
- data={{ testid: testId }}
204
- options={options}
205
- placeholder="Choose a country"
206
- />
207
- )
208
-
209
- const kit = screen.getByTestId(testId)
210
- const placeholderBody = kit.querySelector('.dropdown_trigger_wrapper_select_only .pb_body_kit_lighter')
211
- expect(placeholderBody).toBeInTheDocument()
212
- expect(placeholderBody).toHaveTextContent('Choose a country')
213
- })
214
-
215
- test('selected value Body does not use lighter color', () => {
216
- render(
217
- <Dropdown
218
- data={{ testid: testId }}
219
- defaultValue={options[0]}
220
- options={options}
221
- placeholder="Choose a country"
222
- />
223
- )
224
-
225
- const kit = screen.getByTestId(testId)
226
- const triggerBodies = kit.querySelectorAll('.dropdown_trigger_wrapper_select_only [class^="pb_body_kit"]')
227
- const selectedBody = Array.from(triggerBodies).find((el) => el.textContent === options[0].label)
228
- expect(selectedBody).toBeTruthy()
229
- expect(selectedBody).not.toHaveClass('pb_body_kit_lighter')
230
- })
231
-
232
200
  test('generated label prop', () => {
233
201
  render (
234
202
  <Dropdown
@@ -170,9 +170,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
170
170
  {customDisplay ? (
171
171
  <Flex align="center">
172
172
  {customDisplay}
173
- <Body
174
- color={customDisplayPlaceholder ? "lighter" : undefined}
175
- dark={dark}
173
+ <Body dark={dark}
176
174
  paddingLeft={`${joinedLabels ? "xs" : "none"}`}
177
175
  >
178
176
  {customDisplayPlaceholder}
@@ -215,10 +213,8 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
215
213
  )}
216
214
  </>
217
215
  ) : (
218
- <Body
219
- color={!joinedLabels && !autocomplete ? "lighter" : undefined}
220
- dark={dark}
221
- text={defaultDisplayPlaceholder}
216
+ <Body dark={dark}
217
+ text={defaultDisplayPlaceholder}
222
218
  />
223
219
  )
224
220
  )}
@@ -24,10 +24,8 @@ const MultiSelectTriggerDisplay = ({
24
24
  if (selected.length === 0) {
25
25
  if (autocomplete) return null;
26
26
  return (
27
- <Body
28
- color="lighter"
29
- dark={dark}
30
- text={placeholder ? placeholder : "Select..."}
27
+ <Body dark={dark}
28
+ text={placeholder ? placeholder : "Select..."}
31
29
  />
32
30
  )
33
31
  }
@@ -4,26 +4,3 @@ The `form` kit provides consumers with a convenient, consistently styled `<form>
4
4
 
5
5
  This kit uses rails `form_with` with our custom builder to render forms using other kits such as text_input, select, and typeahead to name a few. Doing so provides UI consistency within forms and makes adding a form to your page easier.
6
6
 
7
- ### Model values and errors (edit forms)
8
-
9
- When the form is bound to a model (`model:` / `options: { model: ... }`), builder fields read the attribute and its validation errors automatically — similar to Rails `text_field`. You usually do not need to pass `default_date`, `value`, `default_value`, or `error` yourself:
10
-
11
- ```erb
12
- <%= form.date_picker :starts_at, props: { label: true } %>
13
- ```
14
-
15
- On edit, `starts_at` is pre-populated and any `errors.full_messages_for(:starts_at)` message is shown. Explicit props still win when you pass them.
16
-
17
- | Field | Auto value | Auto error |
18
- | --- | --- | --- |
19
- | `date_picker` | `default_date` (UTC ISO8601) | yes |
20
- | `time_picker` | `default_time` (HH:MM) | yes |
21
- | `dropdown_field` | `default_value` (matched via `options`) | yes |
22
- | `star_rating_field` | `default_value` | n/a |
23
- | `multi_level_select` | `selected_ids` | yes |
24
- | `phone_number_field` / `intl_telephone` | `value` | yes |
25
- | `typeahead` | `default_options` only if already option-shaped | yes |
26
- | text / textarea / select / `collection_select` | via Rails | yes |
27
-
28
- **Caveats:** dropdown needs `options` to resolve a stored id/value to an option. Typeahead with a bare database id still needs an explicit `default_options`.
29
-
@@ -4,6 +4,5 @@ examples:
4
4
  - form_form_with: Default
5
5
  - form_form_with_validate: Default + Validation
6
6
  - form_form_with_validation_msg: Validation + Custom Validation Message
7
- - form_form_with_model_defaults: Model Values + Errors
8
7
  - form_form_with_loading: Default + Loading
9
8
  - form_with_required_indicator: With Optional Required Indicator
@@ -1,60 +1,43 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  import Button from '../../pb_button/_button'
4
4
  import FormGroup from '../../pb_form_group/_form_group'
5
5
  import TextInput from '../../pb_text_input/_text_input'
6
6
 
7
- const FormGroupButton = (props) => {
8
- const [searchWithLabel, setSearchWithLabel] = useState('')
9
- const [search, setSearch] = useState('')
10
-
11
- const handleUpdateSearchWithLabel = ({ target }) => {
12
- setSearchWithLabel(target.value)
13
- }
14
-
15
- const handleUpdateSearch = ({ target }) => {
16
- setSearch(target.value)
17
- }
18
-
19
- return (
7
+ const FormGroupButton = (props) => (
8
+ <div>
9
+ <div>
10
+ <FormGroup>
11
+ <TextInput
12
+ id="search-with-label"
13
+ label="With Label"
14
+ placeholder="Search"
15
+ {...props}
16
+ />
17
+ <Button
18
+ onClick={() => alert('Button Clicked!')}
19
+ text="Submit"
20
+ variant="secondary"
21
+ {...props}
22
+ />
23
+ </FormGroup>
24
+ </div>
25
+ <br />
20
26
  <div>
21
- <div>
22
- <FormGroup>
23
- <TextInput
24
- id="search-with-label"
25
- label="With Label"
26
- onChange={handleUpdateSearchWithLabel}
27
- placeholder="Search"
28
- value={searchWithLabel}
29
- {...props}
30
- />
31
- <Button
32
- onClick={() => alert('Button Clicked!')}
33
- text="Submit"
34
- variant="secondary"
35
- {...props}
36
- />
37
- </FormGroup>
38
- </div>
39
- <br />
40
- <div>
41
- <FormGroup>
42
- <TextInput
43
- onChange={handleUpdateSearch}
44
- placeholder="Search"
45
- value={search}
46
- {...props}
47
- />
48
- <Button
49
- onClick={() => alert('Button Clicked!')}
50
- text="Submit"
51
- variant="secondary"
52
- {...props}
53
- />
54
- </FormGroup>
55
- </div>
27
+ <FormGroup>
28
+ <TextInput
29
+ placeholder="Search"
30
+ {...props}
31
+ />
32
+ <Button
33
+ onClick={() => alert('Button Clicked!')}
34
+ text="Submit"
35
+ variant="secondary"
36
+ {...props}
37
+ />
38
+ </FormGroup>
56
39
  </div>
57
- )
58
- }
40
+ </div>
41
+ )
59
42
 
60
43
  export default FormGroupButton
@@ -1,36 +1,26 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  import FormGroup from '../_form_group'
4
4
 
5
5
  import DatePicker from '../../pb_date_picker/_date_picker'
6
6
  import TextInput from '../../pb_text_input/_text_input'
7
7
 
8
- const FormGroupDatePicker = (props) => {
9
- const [eventName, setEventName] = useState('')
10
-
11
- const handleUpdateEventName = ({ target }) => {
12
- setEventName(target.value)
13
- }
14
-
15
- return (
16
- <div>
17
- <FormGroup>
18
- <TextInput
19
- id="event-name"
20
- label="Event"
21
- onChange={handleUpdateEventName}
22
- placeholder="Event Name"
23
- value={eventName}
24
- {...props}
25
- />
26
- <DatePicker
27
- label="event date"
28
- pickerId="date-picker-default"
29
- {...props}
30
- />
31
- </FormGroup>
32
- </div>
33
- )
34
- }
8
+ const FormGroupDatePicker = (props) => (
9
+ <div>
10
+ <FormGroup>
11
+ <TextInput
12
+ id="event-name"
13
+ label="Event"
14
+ placeholder="Event Name"
15
+ {...props}
16
+ />
17
+ <DatePicker
18
+ label="event date"
19
+ pickerId="date-picker-default"
20
+ {...props}
21
+ />
22
+ </FormGroup>
23
+ </div>
24
+ )
35
25
 
36
26
  export default FormGroupDatePicker
@@ -1,53 +1,31 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  import FormGroup from '../_form_group'
4
4
  import TextInput from '../../pb_text_input/_text_input'
5
5
 
6
- const FormGroupDefault = (props) => {
7
- const [formFields, setFormFields] = useState({
8
- firstName: '',
9
- middleInitial: '',
10
- lastName: '',
11
- })
12
-
13
- const handleOnChange = ({ target }) => {
14
- const { name, value } = target
15
- setFormFields({ ...formFields, [name]: value })
16
- }
17
-
18
- return (
19
- <div>
20
- <FormGroup>
21
- <TextInput
22
- id="first-name"
23
- label="First Name"
24
- name="firstName"
25
- onChange={handleOnChange}
26
- placeholder="Enter First Name"
27
- value={formFields.firstName}
28
- {...props}
29
- />
30
- <TextInput
31
- id="middle-initial"
32
- label="Middle Initial"
33
- name="middleInitial"
34
- onChange={handleOnChange}
35
- placeholder="Enter Middle Initial"
36
- value={formFields.middleInitial}
37
- {...props}
38
- />
39
- <TextInput
40
- id="last-name"
41
- label="Last Name"
42
- name="lastName"
43
- onChange={handleOnChange}
44
- placeholder="Enter Last Name"
45
- value={formFields.lastName}
46
- {...props}
47
- />
48
- </FormGroup>
49
- </div>
50
- )
51
- }
6
+ const FormGroupDefault = (props) => (
7
+ <div>
8
+ <FormGroup>
9
+ <TextInput
10
+ id="first-name"
11
+ label="First Name"
12
+ placeholder="Enter First Name"
13
+ {...props}
14
+ />
15
+ <TextInput
16
+ id="middle-initial"
17
+ label="Middle Initial"
18
+ placeholder="Enter Middle Initial"
19
+ {...props}
20
+ />
21
+ <TextInput
22
+ id="last-name"
23
+ label="Last Name"
24
+ placeholder="Enter Last Name"
25
+ {...props}
26
+ />
27
+ </FormGroup>
28
+ </div>
29
+ )
52
30
 
53
31
  export default FormGroupDefault
@@ -1,78 +1,49 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  import FormGroup from '../_form_group'
4
4
  import TextInput from '../../pb_text_input/_text_input'
5
5
  import Button from '../../pb_button/_button'
6
6
 
7
- const FormGroupFullWidth = (props) => {
8
- const [formFields, setFormFields] = useState({
9
- firstName: '',
10
- middleInitial: '',
11
- lastName: '',
12
- })
13
- const [search, setSearch] = useState('')
14
-
15
- const handleOnChange = ({ target }) => {
16
- const { name, value } = target
17
- setFormFields({ ...formFields, [name]: value })
18
- }
19
-
20
- const handleUpdateSearch = ({ target }) => {
21
- setSearch(target.value)
22
- }
23
-
24
- return (
7
+ const FormGroupFullWidth = (props) => (
8
+ <div>
9
+ <div>
10
+ <FormGroup fullWidth>
11
+ <TextInput
12
+ id="first-name-full-width"
13
+ label="First Name"
14
+ placeholder="Enter First Name"
15
+ {...props}
16
+ />
17
+ <TextInput
18
+ id="middle-initial-full-width"
19
+ label="Middle Initial"
20
+ placeholder="Enter Middle Initial"
21
+ {...props}
22
+ />
23
+ <TextInput
24
+ id="last-name-full-width"
25
+ label="Last Name"
26
+ placeholder="Enter Last Name"
27
+ {...props}
28
+ />
29
+ </FormGroup>
30
+ </div>
31
+ <br />
25
32
  <div>
26
- <div>
27
- <FormGroup fullWidth>
28
- <TextInput
29
- id="first-name-full-width"
30
- label="First Name"
31
- name="firstName"
32
- onChange={handleOnChange}
33
- placeholder="Enter First Name"
34
- value={formFields.firstName}
35
- {...props}
36
- />
37
- <TextInput
38
- id="middle-initial-full-width"
39
- label="Middle Initial"
40
- name="middleInitial"
41
- onChange={handleOnChange}
42
- placeholder="Enter Middle Initial"
43
- value={formFields.middleInitial}
44
- {...props}
45
- />
46
- <TextInput
47
- id="last-name-full-width"
48
- label="Last Name"
49
- name="lastName"
50
- onChange={handleOnChange}
51
- placeholder="Enter Last Name"
52
- value={formFields.lastName}
53
- {...props}
54
- />
55
- </FormGroup>
56
- </div>
57
- <br />
58
- <div>
59
- <FormGroup fullWidth>
60
- <TextInput
61
- onChange={handleUpdateSearch}
62
- placeholder="Search"
63
- value={search}
64
- {...props}
65
- />
66
- <Button
67
- onClick={() => alert('Button Clicked!')}
68
- text="Submit"
69
- variant="secondary"
70
- {...props}
71
- />
72
- </FormGroup>
73
- </div>
33
+ <FormGroup fullWidth>
34
+ <TextInput
35
+ placeholder="Search"
36
+ {...props}
37
+ />
38
+ <Button
39
+ onClick={() => alert('Button Clicked!')}
40
+ text="Submit"
41
+ variant="secondary"
42
+ {...props}
43
+ />
44
+ </FormGroup>
74
45
  </div>
75
- )
76
- }
46
+ </div>
47
+ )
77
48
 
78
49
  export default FormGroupFullWidth
@@ -8,14 +8,9 @@ import Flex from '../../pb_flex/_flex'
8
8
  import Passphrase from '../../pb_passphrase/_passphrase'
9
9
 
10
10
  const FormGroupSelect = (props) => {
11
- const [artistName, setArtistName] = useState('')
12
11
  const [input, setInput] = useState("");
13
12
  const handleChange = (e) => setInput(e.target.value);
14
13
 
15
- const handleUpdateArtistName = ({ target }) => {
16
- setArtistName(target.value)
17
- }
18
-
19
14
  const options = [
20
15
  { value: 'Country' },
21
16
  { value: 'Pop' },
@@ -41,9 +36,7 @@ const FormGroupSelect = (props) => {
41
36
  >
42
37
  <FormGroup>
43
38
  <TextInput
44
- onChange={handleUpdateArtistName}
45
39
  placeholder="Enter Artist Name"
46
- value={artistName}
47
40
  {...props}
48
41
  />
49
42
  <Select
@@ -1,5 +1,5 @@
1
1
  {
2
- "template": "<Select{{props}} onChange={handleSelectChange} value={selectValue} />",
2
+ "template": "<Select{{props}} />",
3
3
  "propTargets": {},
4
4
  "defaults": {
5
5
  "compact": false,
@@ -120,7 +120,6 @@
120
120
  "label": "Teams",
121
121
  "name": "teams",
122
122
  "multiple": true,
123
- "value": [],
124
123
  "options": [
125
124
  {
126
125
  "value": "eng",
@@ -168,10 +167,6 @@
168
167
  }
169
168
  },
170
169
  "hints": {
171
- "controlled_state": {
172
- "message": "Select is controlled when value is set, so the snippet uses useState and onChange to keep the selection changeable.",
173
- "type": "info"
174
- },
175
170
  "default": {
176
171
  "presetName": "Default",
177
172
  "message": "Default shows a labeled select with a selected value and a simple options array.",
@@ -193,13 +188,6 @@
193
188
  "type": "info"
194
189
  }
195
190
  },
196
- "wrapper": "const SelectPlayground = () => {\n const [selectValue, setSelectValue] = useState(value)\n\n const handleSelectChange = (event) => {\n const { multiple, selectedOptions } = event.target\n\n setSelectValue(multiple ? Array.from(selectedOptions, (option) => option.value) : event.target.value)\n }\n\n return {{component}}\n}\n\n<SelectPlayground />",
197
- "statefulProps": [
198
- "value"
199
- ],
200
- "externalImports": [
201
- "import React, { useState } from 'react'"
202
- ],
203
191
  "hiddenProps": [
204
192
  "inputOptions",
205
193
  "includeBlank"