playbook_ui_docs 14.18.0.pre.alpha.PLAY20787400 → 14.18.0.pre.alpha.play2034zonesandcolors7407

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 (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +4 -1
  3. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +0 -4
  4. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  5. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +1 -5
  6. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -2
  7. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -1
  8. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +43 -0
  9. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +55 -0
  10. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +1 -0
  11. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -1
  12. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -1
  13. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +8 -1
  14. data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +7 -2
  15. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +9 -1
  16. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +7 -1
  17. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +6 -2
  18. data/dist/playbook-doc.js +2 -2
  19. metadata +6 -7
  20. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +0 -34
  21. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +0 -14
  22. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +0 -20
  23. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +0 -14
  24. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors.md → _draggable_drop_zones_colors_react.md} +0 -0
  25. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones.md → _draggable_drop_zones_react.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3e7d47a9299088d750906643acac266d30471dfea3e97e02d840a8cc7707f03
4
- data.tar.gz: ebcc74afbe19ac073c894c1d73545ab932e36f9f10d850eec84431c20ec4fb24
3
+ metadata.gz: '079828368ddeaf360fde9d539c1ec196279af6fe4c9087032bb386d6155bbcac'
4
+ data.tar.gz: 8573cdff051f7161b2f88a13e14def0cfe98e8465a0bf16107c03bee62e0081c
5
5
  SHA512:
6
- metadata.gz: caaa753b1c2df935c91ed8576f78af9c52f1f30dd64095ab88cb1447b69a576d6f1984ba2a98ce7563d2b095ead8a247b0f6fdbe51795d8f12b00b6fb4a1e7a5
7
- data.tar.gz: b933dc82f82e408a2de8abe712cb3bb9b415db080126748c53cacbd31252394b8951104c77ea1e68ad2ce3c039eefa933bac40ef7ff7139558f338b7060e96d2
6
+ metadata.gz: 1fc23270977a2c886999c6ade1339f41bb900eef36480e5b6ae6ddc1f6ebcfaca6b38632fa5764eb5c2c05dec593d5d704dd6b843ae63aedc2c16b89d0bfbeaf
7
+ data.tar.gz: 81627b52875b9d50e6cc86628abfda7e6b3a09af43196ead289619706fa1481f4426e494b5f0dd80a1bc34501e7f52bd9efdee79b7328f5e77364b618e323a85
@@ -1,11 +1,14 @@
1
1
  import React from 'react'
2
2
 
3
3
  import DatePicker from '../_date_picker'
4
+ import Icon from '../../pb_icon/_icon'
4
5
 
5
6
  const DatePickerError = (props) => (
6
7
  <div>
7
8
  <DatePicker
8
- error="Invalid date. Please pick a valid date."
9
+ error={<>
10
+ <Icon icon="warning" /> Invalid date. Please pick a valid date.
11
+ </>}
9
12
  pickerId="date-picker-error"
10
13
  {...props}
11
14
  />
@@ -1,7 +1,3 @@
1
- To use the `quickpick`:
2
- - prop `mode` must be set to `range`
3
- - prop `selection_type` must be set to `quickpick`
4
-
5
1
  This date range variant uses hidden inputs to handle start and end dates. While they are not required props, it is advisable to specify a unique `start_date_id`, `start_date_name`, `end_date_id`, and `end_date_name` for each quick pick instance you place in a form and/or on a page.
6
2
 
7
3
  Like all other date pickers, the quick pick does require a `picker_id`.
@@ -1 +1 @@
1
- Use `this_ranges_end_today`/`thisRangesEndToday` to set end date on all ranges that start with 'this' to today's date. For instance, by default 'This Year' will set end day to 12/31/(current year), but if the `this_ranges_end_today`/`thisRangesEndToday` prop is used, end date on that range will be today's date.
1
+ Because the Quick Pick variant has `allowInput` set to `true` by default, use the `onClose` handler function to access the startDate and endDate values. See the `onClose` example for details.
@@ -1,5 +1 @@
1
- To use the `quickpick`:
2
- - prop `mode` must be set to `range`
3
- - prop `selectionType` must be set to `quickpick`
4
-
5
- Use the `onClose` handler function to access the startDate and endDate values. Check the [`onClose` example](https://playbook.powerapp.cloud/kits/date_picker/react#onclose) for more information.
1
+ Use the `onChange` handler function to access the startDate and endDate values. Check the [`onChange` example](https://playbook.powerapp.cloud/kits/date_picker/react#onchange) for more information.
@@ -15,7 +15,6 @@ examples:
15
15
  - date_picker_quick_pick_custom: Custom Quick Pick Dates
16
16
  - date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
17
17
  - date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
18
- - date_picker_range_pattern_rails: Range with 2 Date Pickers and a Quick Pick
19
18
  - date_picker_format: Format
20
19
  - date_picker_disabled: Disabled Dates
21
20
  - date_picker_min_max: Min Max
@@ -48,7 +47,6 @@ examples:
48
47
  - date_picker_quick_pick_custom: Custom Quick Pick Dates
49
48
  - date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
50
49
  - date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
51
- - date_picker_range_pattern: Range with 2 Date Pickers and a Quick Pick
52
50
  - date_picker_format: Format
53
51
  - date_picker_disabled: Disabled Dates
54
52
  - date_picker_min_max: Min Max
@@ -26,4 +26,3 @@ export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
26
26
  export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
27
27
  export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'
28
28
  export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_pick_default_date'
29
- export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
@@ -0,0 +1,43 @@
1
+ <% data_shadow = [
2
+ { id: "51", text: "Task 1" },
3
+ { id: "52", text: "Task 2" },
4
+ { id: "53", text: "Task 3" }
5
+ ] %>
6
+
7
+ <% data_outline = [
8
+ { id: "61", text: "Task 1" },
9
+ { id: "62", text: "Task 2" },
10
+ { id: "63", text: "Task 3" }
11
+ ] %>
12
+
13
+ <%= pb_rails("flex", props: { justify: "around" }) do %>
14
+ <%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
15
+ <%= pb_rails("draggable", props: { drop_zone_type: "shadow", initial_items: data_shadow }) do %>
16
+ <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Shadow", text_align: "center" }) %>
17
+ <%= pb_rails("draggable/draggable_container", props: { html_options: { style: { width: "200px" } } }) do %>
18
+ <% data_shadow.each do |item| %>
19
+ <%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl" }) do %>
20
+ <%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
21
+ <%= pb_rails("body", props: { text: item[:text] }) %>
22
+ <% end %>
23
+ <% end %>
24
+ <% end %>
25
+ <% end %>
26
+ <% end %>
27
+ <% end %>
28
+
29
+ <%= pb_rails("flex/flex_item", props: { margin_right: "xl" }) do %>
30
+ <%= pb_rails("draggable", props: { drop_zone_type: "outline", initial_items: data_outline }) do %>
31
+ <%= pb_rails("caption", props: { margin_bottom: "xs", text: "Outline", text_align: "center" }) %>
32
+ <%= pb_rails("draggable/draggable_container", props: { html_options: { style: { width: "200px" } } }) do %>
33
+ <% data_outline.each do |item| %>
34
+ <%= pb_rails("card", props: { drag_id: item[:id], draggable_item: true, margin_bottom: "xs", padding: "xs", padding_right: "xl" }) do %>
35
+ <%= pb_rails("flex", props: { align_items: "stretch", flex_direction: "column" }) do %>
36
+ <%= pb_rails("body", props: { text: item[:text] }) %>
37
+ <% end %>
38
+ <% end %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
42
+ <% end %>
43
+ <% end %>
@@ -0,0 +1,55 @@
1
+ <% initial_items = [
2
+ {
3
+ id: "141",
4
+ url: "https://unsplash.it/500/400/?image=633",
5
+ },
6
+ {
7
+ id: "142",
8
+ url: "https://unsplash.it/500/400/?image=634",
9
+ },
10
+ {
11
+ id: "143",
12
+ url: "https://unsplash.it/500/400/?image=637",
13
+ },
14
+ ] %>
15
+
16
+ <% next_init_items = [
17
+ {
18
+ id: "151",
19
+ url: "https://unsplash.it/500/400/?image=633",
20
+ },
21
+ {
22
+ id: "152",
23
+ url: "https://unsplash.it/500/400/?image=634",
24
+ },
25
+ {
26
+ id: "153",
27
+ url: "https://unsplash.it/500/400/?image=637",
28
+ },
29
+ ] %>
30
+
31
+ <%= pb_rails("draggable", props: {initial_items: initial_items, drop_zone_type: "shadow", drop_zone_color: "primary"}) do %>
32
+ <%= pb_rails("draggable/draggable_container") do %>
33
+ <%= pb_rails("flex", props: { gap: "sm" }) do %>
34
+ <% initial_items.each do |item| %>
35
+ <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
36
+ <%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
37
+ <% end %>
38
+ <% end %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
42
+
43
+ <br/>
44
+
45
+ <%= pb_rails("draggable", props: {initial_items: next_init_items, drop_zone_type: "outline", drop_zone_color: "purple"}) do %>
46
+ <%= pb_rails("draggable/draggable_container") do %>
47
+ <%= pb_rails("flex", props: { gap: "sm" }) do %>
48
+ <% initial_items.each do |item| %>
49
+ <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
50
+ <%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url] }) %>
51
+ <% end %>
52
+ <% end %>
53
+ <% end %>
54
+ <% end %>
55
+ <% end %>
@@ -0,0 +1 @@
1
+ The default `color` for Draggable kit drop zones is "neutral", with "primary" or "purple" as additional options.
@@ -17,5 +17,6 @@ examples:
17
17
  - draggable_with_cards: Draggable with Cards
18
18
  - draggable_with_table: Draggable with Table
19
19
  - draggable_multiple_containers: Dragging Across Multiple Containers
20
+ - draggable_drop_zones: Draggable Drop Zones
21
+ - draggable_drop_zones_colors: Draggable Drop Zones Colors
20
22
  - draggable_event_listeners: Draggable Event Listeners
21
-
@@ -1,9 +1,12 @@
1
1
  import React, { useState } from 'react'
2
2
  import Dropdown from '../../pb_dropdown/_dropdown'
3
+ import Icon from '../../pb_icon/_icon'
3
4
 
4
5
  const DropdownError = (props) => {
5
6
  const [selectedOption, setSelectedOption] = useState()
6
- const error = selectedOption?.value ? null : "Please make a valid selection"
7
+ const error = selectedOption?.value ? null : (<>
8
+ <Icon icon="warning" /> Please make a valid selection
9
+ </>)
7
10
  const options = [
8
11
  {
9
12
  label: "United States",
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react";
3
3
  import Button from '../../pb_button/_button'
4
4
  import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
5
5
  import PhoneNumberInput from '../../pb_phone_number_input/_phone_number_input'
6
+ import Icon from '../../pb_icon/_icon'
6
7
 
7
8
  const PhoneNumberInputValidation = (props) => {
8
9
  const [formErrors, setFormErrors] = useState("");
@@ -29,6 +30,12 @@ const PhoneNumberInputValidation = (props) => {
29
30
  setShowFormErrors(formErrors.length > 0);
30
31
  }, [formErrors]);
31
32
 
33
+ const error = (
34
+ <>
35
+ <Icon icon="warning" /> Missing phone number.
36
+ </>
37
+ )
38
+
32
39
  return (
33
40
  <form
34
41
  action=""
@@ -43,7 +50,7 @@ const PhoneNumberInputValidation = (props) => {
43
50
  />
44
51
  )}
45
52
  <PhoneNumberInput
46
- error="Missing phone number."
53
+ error={error}
47
54
  id="validation"
48
55
  initialCountry={countryCode}
49
56
  onChange={handleOnChange}
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import Body from '../../pb_body/_body'
3
3
  import Select from '../../pb_select/_select'
4
+ import Icon from '../../pb_icon/_icon'
4
5
 
5
6
  const SelectError = (props) => {
6
7
  const options = [
@@ -18,10 +19,14 @@ const SelectError = (props) => {
18
19
  },
19
20
  ]
20
21
 
22
+ const error = (<>
23
+ <Icon icon="warning" /> Please make a valid selection
24
+ </>)
25
+
21
26
  return (
22
27
  <div>
23
28
  <Select
24
- error="Please make a valid selection"
29
+ error={error}
25
30
  label="Favorite Food"
26
31
  name="food"
27
32
  options={options}
@@ -29,7 +34,7 @@ const SelectError = (props) => {
29
34
  {...props}
30
35
  />
31
36
  <Body
32
- error="Please make a valid selection"
37
+ error={error}
33
38
  status="negative"
34
39
  {...props}
35
40
  />
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react'
2
2
 
3
3
  import TextInput from '../_text_input'
4
+ import Icon from '../../pb_icon/_icon'
4
5
 
5
6
  const TextInputError = (props) => {
6
7
  const [email, setEmail] = useState('')
@@ -8,11 +9,18 @@ const TextInputError = (props) => {
8
9
  const handleUpdateEmail = ({ target }) => {
9
10
  setEmail(target.value)
10
11
  }
12
+
13
+ const error = (
14
+ <>
15
+ <Icon icon="warning" /> Please enter a valid email address
16
+ </>
17
+ )
18
+
11
19
  return (
12
20
  <div>
13
21
  <TextInput
14
22
  addOn={{ icon: 'user', alignment: 'left', border: true }}
15
- error="Please enter a valid email address"
23
+ error={error}
16
24
  label="Email Address"
17
25
  onChange={handleUpdateEmail}
18
26
  placeholder="Enter email address"
@@ -1,15 +1,21 @@
1
1
  import React, {useState} from 'react'
2
2
  import Textarea from '../../pb_textarea/_textarea'
3
+ import Icon from '../../pb_icon/_icon'
3
4
 
4
5
  const TextareaError = (props) => {
5
6
  const [value, setValue] = useState('default value text')
6
7
  const handleChange = (event) => {
7
8
  setValue(event.target.value)
8
9
  }
10
+ const error = (
11
+ <>
12
+ <Icon icon="warning" /> This field has an error!
13
+ </>
14
+ )
9
15
  return (
10
16
  <div>
11
17
  <Textarea
12
- error="This field has an error!"
18
+ error={error}
13
19
  label="Label"
14
20
  name="comment"
15
21
  onChange={(e)=> handleChange(e)}
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
 
3
3
  import Typeahead from '../_typeahead'
4
+ import Icon from '../../pb_icon/_icon'
4
5
 
5
6
  const options = [
6
7
  { label: 'Orange', value: '#FFA500' },
@@ -10,7 +11,10 @@ const options = [
10
11
  ]
11
12
 
12
13
  const TypeaheadErrorState = (props) => {
13
- const [errorState, setErrorState] = useState("Please make a valid selection");
14
+ const error = (<>
15
+ <Icon icon="warning" /> Please make a valid selection
16
+ </>)
17
+ const [errorState, setErrorState] = useState(error);
14
18
  const [searchValue, setSearchValue] = useState(null);
15
19
 
16
20
  const handleOnChange = (value) => setSearchValue(value)
@@ -19,7 +23,7 @@ const TypeaheadErrorState = (props) => {
19
23
  if(searchValue) {
20
24
  setErrorState("")
21
25
  } else {
22
- setErrorState("Please make a valid selection")
26
+ setErrorState(error)
23
27
  }
24
28
  }, [searchValue])
25
29