playbook_ui_docs 13.10.0.pre.alpha.play1054tableheadersortconsolidation1416 → 13.10.0.pre.alpha.play10481357

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -8
  3. data/app/pb_kits/playbook/pb_card/docs/example.yml +0 -12
  4. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_disabled.jsx +33 -0
  5. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_disabled.md +3 -0
  6. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +1 -0
  7. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -1
  8. data/app/pb_kits/playbook/pb_table/docs/_table_header.html.erb +31 -47
  9. data/app/pb_kits/playbook/pb_table/docs/_table_header.md +0 -5
  10. data/dist/playbook-doc.js +3 -3
  11. metadata +4 -21
  12. data/app/pb_kits/playbook/pb_button/docs/_button_circle_swift.md +0 -28
  13. data/app/pb_kits/playbook/pb_button/docs/_button_default_swift.md +0 -23
  14. data/app/pb_kits/playbook/pb_button/docs/_button_full_width_swift.md +0 -9
  15. data/app/pb_kits/playbook/pb_button/docs/_button_icon_options_swift.md +0 -18
  16. data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +0 -11
  17. data/app/pb_kits/playbook/pb_button/docs/_button_size_swift.md +0 -20
  18. data/app/pb_kits/playbook/pb_card/docs/_card_background_swift.md +0 -29
  19. data/app/pb_kits/playbook/pb_card/docs/_card_border_none_swift.md +0 -7
  20. data/app/pb_kits/playbook/pb_card/docs/_card_border_radius_swift.md +0 -33
  21. data/app/pb_kits/playbook/pb_card/docs/_card_header_swift.md +0 -33
  22. data/app/pb_kits/playbook/pb_card/docs/_card_highlight_swift.md +0 -17
  23. data/app/pb_kits/playbook/pb_card/docs/_card_light_swift.md +0 -7
  24. data/app/pb_kits/playbook/pb_card/docs/_card_padding_swift.md +0 -33
  25. data/app/pb_kits/playbook/pb_card/docs/_card_props_swift.md +0 -10
  26. data/app/pb_kits/playbook/pb_card/docs/_card_selected_swift.md +0 -0
  27. data/app/pb_kits/playbook/pb_card/docs/_card_separator_swift.md +0 -11
  28. data/app/pb_kits/playbook/pb_card/docs/_card_shadow_swift.md +0 -21
  29. data/app/pb_kits/playbook/pb_card/docs/_card_styles_swift.md +0 -17
  30. data/app/pb_kits/playbook/pb_card/docs/_card_tag_swift.md +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5eb25edc1069011c282a4e1c558b0547baf246826e5d5228b024fcf37af0fb8
4
- data.tar.gz: 4cd65286dd086567be934643f724b2e2f4ede07d627890acd9742ef7fce28ed5
3
+ metadata.gz: 296328e3d1c7eb5cf5f0dc6696afff99f1bd1d8ce2ee64e2c35d21ab98833330
4
+ data.tar.gz: '019600190da21da1ea40428c2e6334285066ab5a8939ec4cd8c1bb71e8f7986c'
5
5
  SHA512:
6
- metadata.gz: 9b2ec76abab585650d7c79dce400c38ba46cd7aadb03bf16590d57b9f73de08b0f794376b211c1a72e6e827beb94799c725243f3027f76319547693f557ad411
7
- data.tar.gz: ea75b1a948b189d32d4293936a2be2d6a414b4c7a682ea4014f50e1e0e1992aab701ab4f24c36f0f08fe2f4d9324c5236300d30ccafba18e36f1de17c0897d9d
6
+ metadata.gz: e96d98faa465ca46cf792d25f1762160f6c83aa52eaba899748595960ece45d2d0a86315100ef917840809460c9f4d681875ce6a734231925f248bd3b0ca8219
7
+ data.tar.gz: 794c82fde93a25a935f1f3f78f179b132618e088bd18ff1a4713ee77c157acc8a6da45bee4ae9715e9d7b675d2bd80c3d48c45d97cd0b7d20d0b61b74c53711a
@@ -25,11 +25,3 @@ examples:
25
25
  - button_size: Button Size
26
26
  - button_form: Button Form Attribute
27
27
  - button_hover: Button Hover
28
-
29
- swift:
30
- - button_default_swift: Button Variants
31
- - button_full_width_swift: Button Full Width
32
- - button_icon_options_swift: Button Icon Options
33
- - button_circle_swift: Circle Button
34
- - button_size_swift: Button Size
35
- - button_props_swift: ""
@@ -25,15 +25,3 @@ examples:
25
25
  - card_separator: Separator Card
26
26
  - card_border_none: No Border
27
27
  - card_border_radius: Border Radius
28
- swift:
29
- - card_light_swift: Default
30
- - card_background_swift: Card Backgrounds
31
- - card_highlight_swift: Highlight Cards
32
- - card_header_swift: Header Cards
33
- - card_padding_swift: Padding Size
34
- - card_shadow_swift: Shadow Size
35
- - card_separator_swift: Separator Card
36
- - card_border_none_swift: No Border
37
- - card_border_radius_swift: Border Radius
38
- - card_styles_swift: Styles
39
- - card_props_swift: ""
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { useEditor, EditorContent } from "@tiptap/react";
3
+
4
+ import { RichTextEditor } from "../..";
5
+
6
+ import Document from "@tiptap/extension-document";
7
+ import Paragraph from "@tiptap/extension-paragraph";
8
+ import Text from "@tiptap/extension-text";
9
+
10
+ const RichTextEditorToolbarDisabled = (props) => {
11
+ const editor = useEditor({
12
+ extensions: [Document, Paragraph, Text],
13
+ content:
14
+ "Add your text here. You can format your text, add links, quotes, and bullets.",
15
+ });
16
+ if (!editor) {
17
+ return null;
18
+ }
19
+
20
+ return (
21
+ <div>
22
+ <RichTextEditor
23
+ advancedEditor={editor}
24
+ advancedEditorToolbar={false}
25
+ {...props}
26
+ >
27
+ <EditorContent editor={editor} />
28
+ </RichTextEditor>
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default RichTextEditorToolbarDisabled;
@@ -0,0 +1,3 @@
1
+ This variant allows you to optionally include the default toolbar.
2
+
3
+ The default toolbar relies on [Tiptap's StarterKit](https://tiptap.dev/api/extensions/starter-kit) which might add that are not necessary for your application. Setting the `advancedEditorToobar` to false enables you to instantiate an editor with the minimum requirements.
@@ -15,6 +15,7 @@ examples:
15
15
  - rich_text_editor_default: Default
16
16
  - rich_text_editor_advanced_default: Advanced Default
17
17
  - rich_text_editor_more_extensions: Advanced (Extra Extensions)
18
+ - rich_text_editor_toolbar_disabled: Advanced (Toolbar disabled)
18
19
  - rich_text_editor_simple: Simple
19
20
  - rich_text_editor_attributes: Attributes
20
21
  - rich_text_editor_focus: Focus
@@ -8,4 +8,5 @@ export { default as RichTextEditorToolbarBottom } from './_rich_text_editor_tool
8
8
  export { default as RichTextEditorInline } from './_rich_text_editor_inline.jsx'
9
9
  export { default as RichTextEditorPreview } from './_rich_text_editor_preview.jsx'
10
10
  export { default as RichTextEditorAdvancedDefault } from './_rich_text_editor_advanced_default.jsx'
11
- export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
11
+ export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
12
+ export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
@@ -1,37 +1,12 @@
1
- <%# Example data for demonstration purposes %>
2
- <% data_rows = [
3
- { 'territory' => 'North', 'firstname' => 'John', 'lastname' => 'Doe', 'age' => 30, 'job' => 'Engineer' },
4
- { 'territory' => 'South', 'firstname' => 'Alice', 'lastname' => 'Smith', 'age' => 28, 'job' => 'Designer' },
5
- { 'territory' => 'East', 'firstname' => 'Mike', 'lastname' => 'Johnson', 'age' => 35, 'job' => 'Manager' },
6
- { 'territory' => 'West', 'firstname' => 'Sarah', 'lastname' => 'Brown', 'age' => 29, 'job' => 'Developer' },
7
- { 'territory' => 'Central', 'firstname' => 'David', 'lastname' => 'Wilson', 'age' => 32, 'job' => 'Analyst' }
8
- ]
9
- %>
10
-
11
- <%# Example sort method for demonstration purposes %>
12
- <% if params["sort"] %>
13
- <% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
14
- <% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
15
- <% data_rows.sort! do |a, b|
16
- value_a = a[sort_param]
17
- value_b = b[sort_param]
18
-
19
- value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
20
- value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
21
-
22
- sort_direction * (value_a <=> value_b)
23
- end %>
24
- <% end %>
25
-
26
- <%= pb_rails("table", props: { data_table: true, vertical_border: true, id: "table-header" } ) do %>
1
+ <%= pb_rails("table", props: { size: "lg"} ) do %>
27
2
  <thead>
28
3
  <tr>
29
4
  <%= pb_rails("table/table_header", props: {
30
5
  text: "Territory",
31
6
  id: "territory",
32
7
  sort_menu: [
33
- { item: "Territory", link: "?sort=territory_asc#table-header", active: params["sort"] == "territory_asc", direction: "asc" },
34
- { item: "Territory", link: "?sort=territory_desc#table-header", active: params["sort"] == "territory_desc", direction: "desc" }
8
+ { item: "Territory", link: "?sort=territory_desc", active: params["sort"] == "territory_desc", direction: "desc" },
9
+ { item: "Territory", link: "?sort=territory_asc", active: params["sort"] == "territory_asc", direction: "asc" }
35
10
  ],
36
11
  }) %>
37
12
  <%= pb_rails("table/table_header", props: {
@@ -39,36 +14,45 @@
39
14
  text: "Full Name",
40
15
  colspan: 2,
41
16
  sort_menu: [
42
- { item: "First Name", link: "?sort=firstname_desc#table-header", active: params["sort"] == "firstname_desc", direction: "desc" },
43
- { item: "First Name", link: "?sort=firstname_asc#table-header", active: params["sort"] == "firstname_asc", direction: "asc" },
44
- { item: "Last Name", link: "?sort=lastname_desc#table-header", active: params["sort"] == "lastname_desc", direction: "desc" },
45
- { item: "Last Name", link: "?sort=lastname_asc#table-header", active: params["sort"] == "lastname_asc", direction: "asc" }
17
+ { item: "First Name Descending", link: "?sort=firstname_desc", active: params["sort"] == "firstname_desc", direction: "desc" },
18
+ { item: "First Name Ascending", link: "?sort=firstname_asc", active: params["sort"] == "firstname_asc", direction: "asc" },
19
+ { item: "Last Name Descending", link: "?sort=lastname_desc", active: params["sort"] == "lastname_desc", direction: "desc" },
20
+ { item: "Last Name Ascending", link: "?sort=lastname_asc", active: params["sort"] == "lastname_asc", direction: "asc" }
46
21
  ],
47
22
  }) %>
48
23
  <%= pb_rails("table/table_header", props: {
49
24
  text: "Age",
50
25
  id: "age",
26
+ sort_dropdown: true,
51
27
  sort_menu: [
52
- { item: "Age Descending", link: "?sort=age_desc#table-header", active: params["sort"] == "age_desc", direction: "desc" },
53
- { item: "Age Ascending", link: "?sort=age_asc#table-header", active: params["sort"] == "age_asc", direction: "asc" }
28
+ { item: "Age Descending", link: "?sort=age_desc", active: params["sort"] == "age_desc", direction: "desc" },
29
+ { item: "Age Ascending", link: "?sort=age_asc", active: params["sort"] == "age_asc", direction: "asc" }
54
30
  ],
55
31
  }) %>
56
32
  <%= pb_rails("table/table_header", props: { text: "Job Title" }) %>
57
33
  </tr>
58
34
  </thead>
59
35
  <tbody>
60
- <% data_rows.each do |row| %>
61
- <tr>
62
- <% row.each do |key, value| %>
63
- <%= pb_rails("background", props: {
64
- background_color: (params["sort"] && params["sort"].start_with?(key) ? "info_subtle" : "card_light"),
65
- text_align: (value.is_a?(Integer) ? "right" : ""),
66
- tag: "td"
67
- }) do %>
68
- <%= value %>
69
- <% end %>
70
- <% end %>
71
- </tr>
72
- <% end %>
36
+ <tr>
37
+ <td>Ter 1</td>
38
+ <td>First Name 1</td>
39
+ <td>Last Name 1</td>
40
+ <td>Age 1</td>
41
+ <td>Job 1</td>
42
+ </tr>
43
+ <tr>
44
+ <td>Ter 2</td>
45
+ <td>First Name 2</td>
46
+ <td>Last Name 2</td>
47
+ <td>Age 2</td>
48
+ <td>Job 2</td>
49
+ </tr>
50
+ <tr>
51
+ <td>Ter 3</td>
52
+ <td>First Name 3</td>
53
+ <td>Last Name 3</td>
54
+ <td>Age 3</td>
55
+ <td>Job 3</td>
56
+ </tr>
73
57
  </tbody>
74
58
  <% end %>
@@ -6,8 +6,3 @@ presence of `sort_menu` enables the sort link within the header
6
6
  * `sort_dropdown` (boolean) optionally declares that (true) clicking a header's sort link opens a dropdown of sort options, or (false) each sort link click cycles through available sort_menu items in the order they are passed
7
7
  * passing a valid `colspan` will render sort options within a dropdown by default, without requiring `sort_dropdown` explicitly. Alternatively, the default sort dropdown can be prevented on headers with `colspan` by setting `sort_dropdown: false`, which reverts the column to sorting to multi-click default (each click of the sort link cycles through the available sort_menu items in the order they are passed)
8
8
  * `id` (string) is required for headers that have a dropdown (for popover reference); otherwise they are optional
9
-
10
- </br>
11
- <div class="pb_pill_kit_warning"><div class="pb_title_kit_size_4 pb_pill_text">Disclaimer</div></div>
12
-
13
- This example uses a custom sort method that may need to be modified or replaced within your project.