playbook_ui_docs 14.6.2.pre.alpha.PBNTR667railstypeaheadformintegration4424 → 14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4247

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +2 -13
  3. data/app/pb_kits/playbook/pb_currency/docs/example.yml +1 -3
  4. data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
  5. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  6. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
  7. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +12 -63
  8. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +1 -24
  9. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +2 -25
  10. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +1 -0
  11. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +1 -2
  12. data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
  13. data/dist/playbook-doc.js +1 -1
  14. metadata +3 -22
  15. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb +0 -7
  16. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx +0 -18
  17. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md +0 -3
  18. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md +0 -3
  19. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md +0 -1
  20. data/app/pb_kits/playbook/pb_link/docs/_link_color.html.erb +0 -30
  21. data/app/pb_kits/playbook/pb_link/docs/_link_color.jsx +0 -40
  22. data/app/pb_kits/playbook/pb_link/docs/_link_disabled.html.erb +0 -5
  23. data/app/pb_kits/playbook/pb_link/docs/_link_disabled.jsx +0 -15
  24. data/app/pb_kits/playbook/pb_link/docs/_link_icon.html.erb +0 -15
  25. data/app/pb_kits/playbook/pb_link/docs/_link_icon.jsx +0 -25
  26. data/app/pb_kits/playbook/pb_link/docs/_link_tag.html.erb +0 -35
  27. data/app/pb_kits/playbook/pb_link/docs/_link_tag.jsx +0 -45
  28. data/app/pb_kits/playbook/pb_link/docs/_link_underline.html.erb +0 -5
  29. data/app/pb_kits/playbook/pb_link/docs/_link_underline.jsx +0 -15
  30. data/app/pb_kits/playbook/pb_link/docs/example.yml +0 -16
  31. data/app/pb_kits/playbook/pb_link/docs/index.js +0 -5
  32. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +0 -43
  33. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +0 -68
  34. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.md +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3143ea26fa0fd9a51d329b3b9ac5ca71c5d7445049b93a828e9178c280c86ec
4
- data.tar.gz: 9c1e43caeef68e8ae7f7b468f787e91733445803d8761380c7f32a43bf408f66
3
+ metadata.gz: ee6817fedc5e4676e518cab3c377eda42cce02e439e266726752d01ed818d008
4
+ data.tar.gz: c31135242c88491ee5d18bfc4efc88e327c5c3202f855569f8ff9ead9805cd87
5
5
  SHA512:
6
- metadata.gz: 7e925e98fdb110b4907254627d2a0a0341181d3707e41512903c8c335706315f57596708b0e5e33411c5a767bc22f890995c1375f739db3ee2ed0590eb215006
7
- data.tar.gz: c94ec6ba495e502b02b54efb66ff783765474677cb947c81ea3ee749c160043f256a206ea30c4b02ef72920bd9ea351877b9fca30aee3686407d1cfc4aab82ab
6
+ metadata.gz: 6698407c3ab15309c275d0719b57d3724acecbabc8768dba96f360d54b350bad18429ffc0110933805fd3f46410bf55340390ebdb6c50892a91dd9ae564d03ff
7
+ data.tar.gz: f5fa7e0f22fd1a8ab6393ccc22be1ad1efa5242bee87d8abb1dff10e96ffa6e3429d9aad405fa21dd07b35d6a3234cb70eb77f24fdeb99aed0eb754c87285242
@@ -1,5 +1,5 @@
1
1
  import React from "react"
2
- import { AdvancedTable, Pill, Body, Flex, Detail, Caption, Badge, Title } from "playbook-ui"
2
+ import { AdvancedTable, Pill, Body, Flex, Detail, Caption } from "playbook-ui"
3
3
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
4
 
5
5
  const AdvancedTableCustomCell = (props) => {
@@ -8,18 +8,7 @@ const AdvancedTableCustomCell = (props) => {
8
8
  accessor: "year",
9
9
  label: "Year",
10
10
  cellAccessors: ["quarter", "month", "day"],
11
- customRenderer: (row, value) => (
12
- <Flex>
13
- <Title size={4}
14
- text={value}
15
- />
16
- <Badge dark
17
- marginLeft="xxs"
18
- text={row.original.newEnrollments > 20 ? "High" : "Low"}
19
- variant="neutral"
20
- />
21
- </Flex>
22
- ),
11
+
23
12
  },
24
13
  {
25
14
  accessor: "newEnrollments",
@@ -8,8 +8,7 @@ examples:
8
8
  - currency_abbreviated: Abbreviate Larger Amounts
9
9
  - currency_matching_decimals: Matching Decimals
10
10
  - currency_unstyled: Unstyled
11
- - currency_comma_separator: Comma Separator
12
-
11
+
13
12
  react:
14
13
  - currency_variants: Variants
15
14
  - currency_size: Size
@@ -18,7 +17,6 @@ examples:
18
17
  - currency_abbreviated: Abbreviate Larger Amounts
19
18
  - currency_matching_decimals: Matching Decimals
20
19
  - currency_unstyled: Unstyled
21
- - currency_comma_separator: Comma Separator
22
20
 
23
21
  swift:
24
22
  - currency_size_swift: Size
@@ -5,4 +5,3 @@ export { default as CurrencyNoSymbol } from './_currency_no_symbol.jsx'
5
5
  export { default as CurrencyAbbreviated } from './_currency_abbreviated.jsx'
6
6
  export { default as CurrencyMatchingDecimals } from './_currency_matching_decimals.jsx'
7
7
  export { default as CurrencyUnstyled } from './_currency_unstyled.jsx'
8
- export { default as CurrencyCommaSeparator } from './_currency_comma_separator.jsx'
@@ -23,7 +23,7 @@
23
23
  %>
24
24
 
25
25
  <%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
26
- <%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
26
+ <%= form.typeahead :example_user, props: { data: { typeahead_example1: true, user: {} }, placeholder: "Search for a user" } %>
27
27
  <%= form.text_field :example_text_field, props: { label: true } %>
28
28
  <%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
29
29
  <%= form.email_field :example_email_field, props: { label: true } %>
@@ -92,7 +92,7 @@
92
92
  const selectedUserData = JSON.parse(selectedUserJSON)
93
93
 
94
94
  // set the input field's value
95
- event.target.querySelector('input[name=example_typeahead]').value = selectedUserData.login
95
+ event.target.querySelector('input[name=example_user]').value = selectedUserData.login
96
96
 
97
97
  // log the selected option's dataset
98
98
  console.log('The selected user data:')
@@ -1,5 +1,5 @@
1
1
  <%= pb_form_with(scope: :example, url: "", method: :get, loading: true) do |form| %>
2
- <%= form.text_field :example_text_field_loading, props: { label: true } %>
2
+ <%= form.text_field :example_text_field, props: { label: true } %>
3
3
 
4
4
  <%= form.actions do |action| %>
5
5
  <%= action.submit %>
@@ -22,74 +22,23 @@
22
22
  %>
23
23
 
24
24
  <%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
25
- <%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true } %>
26
- <%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
27
- <%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field" } %>
28
- <%= form.email_field :example_email_field_validation, props: { label: true, required: true } %>
29
- <%= form.number_field :example_number_field_validation, props: { label: true, required: true } %>
30
- <%= form.search_field :example_project_number_validation, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
31
- <%= form.password_field :example_password_field_validation, props: { label: true, required: true } %>
32
- <%= form.url_field :example_url_field_validation, props: { label: true, required: true } %>
33
- <%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
34
- <%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
35
- <%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
36
- <%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
25
+ <%= form.text_field :example_text_field, props: { label: true, required: true } %>
26
+ <%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
27
+ <%= form.email_field :example_email_field, props: { label: true, required: true } %>
28
+ <%= form.number_field :example_number_field, props: { label: true, required: true } %>
29
+ <%= form.search_field :example_project_number, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
30
+ <%= form.password_field :example_password_field, props: { label: true, required: true } %>
31
+ <%= form.url_field :example_url_field, props: { label: true, required: true } %>
32
+ <%= form.text_area :example_text_area, props: { label: true, required: true } %>
33
+ <%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options, required: true } %>
34
+ <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
35
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
37
36
  <%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
38
37
  <%= form.date_picker :example_date_picker_2, props: { label: true, required: true } %>
39
- <%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
38
+ <%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true, required: true } %>
40
39
 
41
40
  <%= form.actions do |action| %>
42
41
  <%= action.submit %>
43
42
  <%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
44
43
  <% end %>
45
44
  <% end %>
46
-
47
- <!-- form.typeahead user results example template -->
48
- <template data-typeahead-example-result-option>
49
- <%= pb_rails("user", props: {
50
- name: tag(:slot, name: "name"),
51
- orientation: "horizontal",
52
- align: "left",
53
- avatar_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
54
- avatar: true
55
- }) %>
56
- </template>
57
-
58
- <!-- form.typeahead JS example implementation -->
59
- <%= javascript_tag defer: "defer" do %>
60
- document.addEventListener("pb-typeahead-kit-search", function(event) {
61
- if (!event.target.dataset || !event.target.dataset.typeaheadExample2) return;
62
-
63
- fetch(`https://api.github.com/search/users?q=${encodeURIComponent(event.detail.searchingFor)}`)
64
- .then(response => response.json())
65
- .then((result) => {
66
- const resultOptionTemplate = document.querySelector("[data-typeahead-example-result-option]")
67
-
68
- event.detail.setResults((result.items || []).map((user) => {
69
- const wrapper = resultOptionTemplate.content.cloneNode(true)
70
- wrapper.children[0].dataset.user = JSON.stringify(user)
71
- wrapper.querySelector('slot[name="name"]').replaceWith(user.login)
72
- wrapper.querySelector('img').dataset.src = user.avatar_url
73
- return wrapper
74
- }))
75
- })
76
- })
77
-
78
-
79
- document.addEventListener("pb-typeahead-kit-result-option-selected", function(event) {
80
- if (!event.target.dataset.typeaheadExample2) return;
81
-
82
- const selectedUserJSON = event.detail.selected.firstElementChild.dataset.user
83
- const selectedUserData = JSON.parse(selectedUserJSON)
84
-
85
- // set the input field's value
86
- event.target.querySelector('input[name=example_typeahead_validation]').value = selectedUserData.login
87
-
88
- // log the selected option's dataset
89
- console.log('The selected user data:')
90
- console.dir(selectedUserData)
91
-
92
- // do even more with the data later - TBD
93
- event.target.dataset.user = selectedUserJSON
94
- })
95
- <% end %>
@@ -13,30 +13,7 @@
13
13
  id: "typeahead-form-pill",
14
14
  is_multi: true,
15
15
  options: names,
16
- label: "Truncation Within Typeahead",
16
+ label: "Names",
17
17
  pills: true,
18
18
  truncate: 1,
19
19
  }) %>
20
-
21
- <%= pb_rails("caption", props: { text: "Form Pill Truncation" }) %>
22
- <%= pb_rails("card", props: { max_width: "xs" }) do %>
23
- <%= pb_rails("form_pill", props: {
24
- name: "Princess Amelia Mignonette Grimaldi Thermopolis Renaldo",
25
- avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
26
- tabindex: 0,
27
- truncate: 1,
28
- id: "truncation-1"
29
- }) %>
30
- <%= pb_rails("form_pill", props: {
31
- icon: "badge-check",
32
- text: "icon and a very long tag to show truncation",
33
- tabindex: 0,
34
- truncate: 1,
35
- id: "truncation-2"
36
- }) %>
37
- <%= pb_rails("form_pill", props: {
38
- text: "form pill long tag no tooltip show truncation",
39
- tabindex: 0,
40
- truncate: 1,
41
- }) %>
42
- <% end %>
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Card, Caption, FormPill, Typeahead } from 'playbook-ui'
2
+ import Typeahead from '../../pb_typeahead/_typeahead'
3
3
 
4
4
  const names = [
5
5
  { label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
@@ -15,34 +15,11 @@ const FormPillTruncatedText = (props) => {
15
15
  <Typeahead
16
16
  htmlOptions={{ style: { maxWidth: "240px" }}}
17
17
  isMulti
18
- label="Truncation Within Typeahead"
18
+ label="Names"
19
19
  options={names}
20
20
  truncate={1}
21
21
  {...props}
22
22
  />
23
- <Caption text="Form Pill Truncation"/>
24
- <Card maxWidth="xs">
25
- <FormPill
26
- avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
27
- name="Princess Amelia Mignonette Grimaldi Thermopolis Renaldo"
28
- onClick={() => alert('Click!')}
29
- tabIndex={0}
30
- truncate={1}
31
- />
32
- <FormPill
33
- icon="badge-check"
34
- onClick={() => {alert('Click!')}}
35
- tabIndex={0}
36
- text="icon and a very long tag to show truncation"
37
- truncate={1}
38
- />
39
- <FormPill
40
- onClick={() => {alert('Click!')}}
41
- tabIndex={0}
42
- text="form pill with a very long tag to show truncation"
43
- truncate={1}
44
- />
45
- </Card>
46
23
  </>
47
24
  )
48
25
  }
@@ -0,0 +1 @@
1
+ For pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
@@ -4,11 +4,10 @@ examples:
4
4
  - timeline_default: Default
5
5
  - timeline_vertical: Vertical
6
6
  - timeline_with_date: With Date
7
- - timeline_with_children: With Children
8
7
 
9
8
 
10
9
  react:
11
10
  - timeline_default: Default
12
11
  - timeline_vertical: Vertical
13
12
  - timeline_with_date: With Date
14
- - timeline_with_children: With Children
13
+
@@ -1,4 +1,3 @@
1
1
  export { default as TimelineDefault } from './_timeline_default.jsx'
2
2
  export { default as TimelineVertical } from './_timeline_vertical.jsx'
3
3
  export { default as TimelineWithDate } from './_timeline_with_date.jsx'
4
- export { default as TimelineWithChildren } from './_timeline_with_children.jsx'