playbook_ui_docs 12.25.0.pre.alpha.play824786 → 12.25.0.pre.alpha.railsmultilevelimprovements758

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_swift.md +1 -82
  3. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.html.erb +4 -4
  4. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.md +1 -1
  5. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_return_all_selected.html.erb +0 -1
  6. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_form.html.erb +72 -0
  7. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +1 -0
  8. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +1 -3
  9. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
  10. data/dist/app/components/playbook/pb_docs/kit_api.html.erb +1 -1
  11. data/dist/app/components/playbook/pb_docs/kit_example.html.erb +8 -14
  12. data/dist/app/components/playbook/pb_docs/kit_example.rb +2 -9
  13. data/dist/menu.yml +0 -1
  14. data/dist/pb_doc_helper.rb +1 -4
  15. data/dist/playbook-doc.js +61 -61
  16. metadata +3 -17
  17. data/app/pb_kits/playbook/pb_detail/docs/_description.md +0 -1
  18. data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.html.erb +0 -34
  19. data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.jsx +0 -49
  20. data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.md +0 -1
  21. data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.html.erb +0 -24
  22. data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.jsx +0 -38
  23. data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.md +0 -6
  24. data/app/pb_kits/playbook/pb_detail/docs/_detail_default.html.erb +0 -3
  25. data/app/pb_kits/playbook/pb_detail/docs/_detail_default.jsx +0 -13
  26. data/app/pb_kits/playbook/pb_detail/docs/_detail_styled.html.erb +0 -22
  27. data/app/pb_kits/playbook/pb_detail/docs/_detail_styled.jsx +0 -32
  28. data/app/pb_kits/playbook/pb_detail/docs/example.yml +0 -11
  29. data/app/pb_kits/playbook/pb_detail/docs/index.js +0 -4
  30. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +0 -14
  31. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +0 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55a134041f0bd091d00782a4574c401246c42c819da44aeab2ea54f3c81bbdaf
4
- data.tar.gz: b6f5c0a997ba59e6a056abcf4089e3c2e8be28a02d52267c36f3de0d3fe9cbce
3
+ metadata.gz: bcca33160c0d885863c0ed9e719532201be8e02be55dc2e446fcf8abea85bfb6
4
+ data.tar.gz: 3a27d6a9e1616040badcd6c56ea3c88e950684e6e2572b87dc34cdf599562a33
5
5
  SHA512:
6
- metadata.gz: 42c74c97bc51212b2f2a509dd60776f783abedfa775f5b5026e7f3445fa74366d07d5b5a3d272454d6afb3ad3c494aa5122ee9c93dbac5dda3be39874e84fc3c
7
- data.tar.gz: 671afc3e799488d9b4965607f20f7442efd7c203265ad41d403db96738a89af685a97730a82dba91fb73864b7828b1e7ddc1a9b0d8cafdb1872d24b912ed7588
6
+ metadata.gz: 577ba7cf091e2c15a0db1f358676b65c2b112e56dbc8a926f9cec949b327f23affb9d41eb1f16e5b80c33f0c011cc7b9124d4565624550699f9da368c77f9d67
7
+ data.tar.gz: d15e3d3f816b8ac3f15f8b745377a79e17a3f5e518bee47bf2af74977007d507d055a1881332bfec6d88b653ada032f2a54ab56af03650903b8a09e3d0b55676
@@ -1,82 +1 @@
1
- In the world of design, consistency is key. Whether you're designing a website, app, or product, having a consistent visual language can make all the difference. That's where design systems come in.
2
-
3
- A design system is a collection of reusable components, guidelines, and assets that help ensure consistency across all of your design work. It's a way to standardize your design language, making it easier for your team to work together and for your users to navigate your products.
4
-
5
- In this article, we'll explore the various elements of a design system and how they can be used to create a cohesive and effective design language.
6
-
7
- ### Headings
8
- Headings are an essential component of any design system. They help organize content, provide visual hierarchy, and make it easier for users to scan and find what they're looking for. A good design system will have headings of various sizes, ranging from H1 (the largest) to H6 (the smallest). Here's an example:
9
-
10
- # H1: Main Title Headings
11
- ## H2: Headings
12
- ### H3: Subheadings
13
- #### H4: Sub-Subheadings
14
-
15
- ![image for avatar](https://images.unsplash.com/photo-1684237276530-a562fa8338b1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=580&q=80)
16
-
17
- ### Lists
18
- Lists are another important component of a design system. They help organize content into easily digestible chunks, making it easier for users to read and understand. There are two types of lists: ordered and unordered.
19
-
20
- Ordered lists are numbered, and each item is listed in a specific order. For example:
21
-
22
- 1. Headings
23
- 2. Lists
24
- 3. Blockquotes
25
- 4. Links
26
- 5. Bold
27
- 6. Underline
28
- 7. Code Blocks
29
- 8. Inline Code
30
- 9. Example Tables
31
- 10. Horizontal Rules
32
-
33
- Unordered lists, on the other hand, use bullet points to separate each item. For example:
34
-
35
- * Headings
36
- * Lists
37
- * Blockquotes
38
- * Links
39
- * Bold
40
- * Underline
41
- * Code Blocks
42
- * Inline Code
43
- * Example Tables
44
- * Horizontal Rules
45
-
46
- ### Blockquotes
47
- Blockquotes are used to highlight a particular section of text or quote. They’re often used to emphasize an important point or to provide context. Here’s an example:
48
-
49
- > “Design systems are a collection of reusable components, guidelines, and assets that help ensure consistency across all of your design work.” - ChatGPT
50
-
51
-
52
- ### Links
53
- Links are an important part of any design system. They allow users to navigate between different pages and sections of your product. When using links in your design system, it’s important to make sure they’re consistent in color, size, and style. Here’s an example:
54
- Click here to learn more about design systems.
55
-
56
- ### Bold, Underline, & Italics
57
- **Bold** and _underline_ are used to *highlight specific words* or phrases within ~~a block of~~ text. They help draw the user’s attention to important information. Here’s an example: *Design systems are* a collection of **reusable components**, **guidelines**, and **assets** that help ensure _consistency across all of your design work_.
58
-
59
- ### Code Blocks and Inline Code
60
- Code blocks and `inline code` are used to display and highlight code within a block of text. This is especially useful for developers who need to reference code snippets in their work.
61
-
62
- Here’s an example:
63
-
64
- ```js
65
- function greet() {
66
- console.log(“Hello, world!”);
67
- }
68
- ```
69
-
70
- ### Example Tables
71
- Example tables are used to display data in a clear and organized way. They help users compare and analyze information quickly. Here’s an example:
72
-
73
- | Tables | Are | Cool |
74
- |----------|:-------------:|------:|
75
- | col 1 is | left-aligned | $1600 |
76
- | col 2 is | centered | $12 |
77
- | col 3 is | right-aligned | $1 |
78
-
79
- ---
80
-
81
- ### Horizontal Rules
82
- Horizontal rules are used to separate sections of content visually. They help break up long blocks of text and make it easier for users
1
+ ![image for avatar](https://images.unsplash.com/photo-1684237276530-a562fa8338b1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=580&q=80)
@@ -64,9 +64,9 @@
64
64
  }] %>
65
65
 
66
66
 
67
- <%= pb_rails("multi_level_select", props: {
68
- id: "default-multi-level-select",
69
- tree_data:treeData
70
- }) %>
67
+ <%= pb_rails("multi_level_select", props: {
68
+ id: "default-multi-level-select",
69
+ tree_data:treeData
70
+ }) %>
71
71
 
72
72
 
@@ -2,4 +2,4 @@ The MultiLevelSelect kit renders a multi leveled select dropdown based on data f
2
2
 
3
3
  For the React version of the kit, the `onSelect` prop returns an array of all checked items, irrespective of whether it is a parent, child or grandchild. Open the console on this example and check and uncheck checkboxes to see this is action!
4
4
 
5
- For the Rails version, the array of checked items is attached to the DOM in a data attribute titled `data-tree` on the wrapping div around the MultiLevelSelect.
5
+ For the Rails version, the array of checked items is attached to the DOM in a data attribute titled `data-tree` on the wrapping div around the MultiLevelSelect.
@@ -3,7 +3,6 @@
3
3
  value: "Power Home Remodeling",
4
4
  id: "powerhome1",
5
5
  expanded: true,
6
-
7
6
  children: [
8
7
  {
9
8
  label: "People",
@@ -0,0 +1,72 @@
1
+ <%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
2
+
3
+ <% treeData = [{
4
+ label: "Power Home Remodeling",
5
+ value: "Power Home Remodeling",
6
+ id: "powerhome1",
7
+ expanded: true,
8
+ children: [
9
+ {
10
+ label: "People",
11
+ value: "People",
12
+ id: "people1",
13
+ children: [
14
+ {
15
+ label: "Talent Acquisition",
16
+ value: "Talent Acquisition",
17
+ id: "talent1",
18
+ },
19
+ {
20
+ label: "Business Affairs",
21
+ value: "Business Affairs",
22
+ id: "business1",
23
+ children: [
24
+ {
25
+ label: "Initiatives",
26
+ value: "Initiatives",
27
+ id: "initiative1",
28
+ },
29
+ {
30
+ label: "Learning & Development",
31
+ value: "Learning & Development",
32
+ id: "development1",
33
+ },
34
+ ],
35
+ },
36
+ {
37
+ label: "People Experience",
38
+ value: "People Experience",
39
+ id: "experience1",
40
+ },
41
+ ],
42
+ },
43
+ {
44
+ label: "Contact Center",
45
+ value: "Contact Center",
46
+ id: "contact1",
47
+ children: [
48
+ {
49
+ label: "Appointment Management",
50
+ value: "Appointment Management",
51
+ id: "appointment1",
52
+ },
53
+ {
54
+ label: "Customer Service",
55
+ value: "Customer Service",
56
+ id: "customer1",
57
+ },
58
+ {
59
+ label: "Energy",
60
+ value: "Energy",
61
+ id: "energy1",
62
+ },
63
+ ],
64
+ },
65
+ ],
66
+ }] %>
67
+
68
+ <%= form.multi_level_select :example, props: {id: "with-form-multi-level-select", tree_data: treeData, return_all_selected: true } %>
69
+ <%= form.actions do |action| %>
70
+ <%= action.button props: { type: "submit", text: "Submit", variant: "primary", margin_top: "lg" } %>
71
+ <% end %>
72
+ <% end %>
@@ -2,6 +2,7 @@ examples:
2
2
  rails:
3
3
  - multi_level_select_default: Default
4
4
  - multi_level_select_return_all_selected: Return All Selected
5
+ - multi_level_select_with_form: With Form
5
6
 
6
7
  react:
7
8
  - multi_level_select_default: Default
@@ -5,11 +5,9 @@ examples:
5
5
  - phone_number_input_preferred_countries: Preferred Countries
6
6
  - phone_number_input_initial_country: Initial Country
7
7
  - phone_number_input_only_countries: Limited Countries
8
- - phone_number_input_validation: Form Validation
9
8
 
10
9
  rails:
11
10
  - phone_number_input_default: Default
12
11
  - phone_number_input_preferred_countries: Preferred Countries
13
12
  - phone_number_input_initial_country: Initial Country
14
- - phone_number_input_only_countries: Limited Countries
15
- - phone_number_input_validation: Form Validation
13
+ - phone_number_input_only_countries: Limited Countries
@@ -2,4 +2,3 @@ export { default as PhoneNumberInputDefault } from './_phone_number_input_defaul
2
2
  export { default as PhoneNumberInputPreferredCountries } from './_phone_number_input_preferred_countries'
3
3
  export { default as PhoneNumberInputInitialCountry } from './_phone_number_input_initial_country'
4
4
  export { default as PhoneNumberInputOnlyCountries } from './_phone_number_input_only_countries'
5
- export { default as PhoneNumberInputValidation } from './_phone_number_input_validation'
@@ -7,7 +7,7 @@
7
7
  <%= pb_rails("nav/item", props: { text: "Global Props", link: "#", active: true, dark: dark }) %>
8
8
  <% end %>
9
9
  <% end %>
10
- <%= pb_rails("section_separator", props:{ dark: dark }) %>
10
+ <%= pb_rails("section_separator", dark: dark) %>
11
11
  <%= pb_rails("card/card_body", props: {}) do %>
12
12
  <%= pb_rails("table", props: {container: false, disable_hover: true, dark: dark }) do %>
13
13
  <thead>
@@ -1,21 +1,15 @@
1
1
  <% example_html = ERB.new(example).result %>
2
2
 
3
3
  <%= pb_rails("card", props: { classname: "pb--doc", padding: "none", dark: dark }) do %>
4
- <% unless (action_name == "kit_show_swift") %>
5
- <div class="pb--kit-example">
6
- <%= pb_rails("caption", props: { text: example_title, dark: dark }) %>
7
- <br />
8
- <%= example %>
9
- <br>
10
- </div>
11
- <% else %>
12
- <div class="pb--kit-example-markdown pt_none markdown <%= dark ? "dark" : "" %>">
13
- <%= pb_rails("caption", props: { text: example_title, dark: dark, margin_top: "md" }) %>
14
- <%= render_markdown(description) %>
15
- </div>
16
- <% end %>
4
+ <div class="pb--kit-example">
5
+ <%= pb_rails("caption", props: { text: example_title, dark: dark }) %>
6
+ <br />
7
+ <%= example %>
8
+ <br>
9
+ </div>
10
+
17
11
  <% if show_code %>
18
- <div class="markdown pb--kit-example-markdown markdown <%= dark ? "dark" : "" %>">
12
+ <div class="markdown pb--kit-example-markdown <%= dark ? "dark" : "" %>">
19
13
  <%= render_markdown(description) %>
20
14
  </div>
21
15
  <div id="code-wrapper">
@@ -8,7 +8,7 @@ module Playbook
8
8
  prop :example_title, type: Playbook::Props::String, required: true
9
9
  prop :example_key, type: Playbook::Props::String, required: true
10
10
  prop :show_code, type: Playbook::Props::Boolean, default: true
11
- prop :type, type: Playbook::Props::Enum, values: %w[rails react swift], default: "rails"
11
+ prop :type, type: Playbook::Props::Enum, values: %w[rails react], default: "rails"
12
12
  prop :dark, type: Playbook::Props::Boolean, default: false
13
13
 
14
14
  include PlaybookWebsite::Markdown::Helper
@@ -18,9 +18,6 @@ module Playbook
18
18
  render inline: source
19
19
  elsif type == "react"
20
20
  react_component example_key.camelize, { dark: dark }
21
- elsif type == "swift"
22
- ## render the markdown file
23
- render inline: source
24
21
  end
25
22
  end
26
23
 
@@ -34,11 +31,7 @@ module Playbook
34
31
 
35
32
  def source
36
33
  @source ||= begin
37
- extension = if type == "rails"
38
- "html.erb"
39
- else
40
- type == "swift" ? "swift" : "jsx"
41
- end
34
+ extension = type == "react" ? "jsx" : "html.erb"
42
35
  stringified_code = read_kit_file("docs", "_#{example_key}.#{extension}")
43
36
  sanitize_code(stringified_code)
44
37
  end
data/dist/menu.yml CHANGED
@@ -90,7 +90,6 @@ kits:
90
90
  - typography:
91
91
  - body
92
92
  - caption
93
- - detail
94
93
  - title
95
94
  - typography_patterns:
96
95
  - contact
@@ -84,11 +84,8 @@ module PlaybookWebsite
84
84
  def pb_doc_render_clickable_title(kit, type)
85
85
  url = "#"
86
86
  begin
87
- url = case type
88
- when "react"
87
+ url = if type == "react"
89
88
  kit_show_reacts_path(kit)
90
- when "swift"
91
- kit_show_swift_path(kit)
92
89
  else
93
90
  kit_show_path(kit)
94
91
  end