playbook_ui_docs 13.11.1 → 13.12.0.pre.alpha.PLAY1051removinghighchartsdependency1551

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_external_controls.html.erb +22 -0
  3. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_external_controls.md +3 -0
  4. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_external_controls_multiple.html.erb +40 -0
  5. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_external_controls_multiple.md +1 -0
  6. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +2 -0
  7. data/app/pb_kits/playbook/pb_icon/docs/_icon_border_swift.md +7 -0
  8. data/app/pb_kits/playbook/pb_icon/docs/_icon_default_swift.md +7 -0
  9. data/app/pb_kits/playbook/pb_icon/docs/_icon_flip_swift.md +11 -0
  10. data/app/pb_kits/playbook/pb_icon/docs/_icon_props_swift.md +8 -0
  11. data/app/pb_kits/playbook/pb_icon/docs/_icon_rotate_swift.md +11 -0
  12. data/app/pb_kits/playbook/pb_icon/docs/_icon_sizes_swift.md +46 -0
  13. data/app/pb_kits/playbook/pb_icon/docs/example.yml +8 -0
  14. data/app/pb_kits/playbook/pb_image/docs/_image_props_swift.md +7 -0
  15. data/app/pb_kits/playbook/pb_image/docs/_rounded_image_swift.md +47 -0
  16. data/app/pb_kits/playbook/pb_image/docs/_size_image_swift.md +47 -0
  17. data/app/pb_kits/playbook/pb_image/docs/_size_none_image_swift.md +15 -0
  18. data/app/pb_kits/playbook/pb_image/docs/example.yml +5 -0
  19. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default_swift.md +11 -0
  20. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_details_examples_swift.md +72 -0
  21. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_details_swift.md +41 -0
  22. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_props_swift.md +11 -0
  23. data/app/pb_kits/playbook/pb_label_value/docs/example.yml +6 -0
  24. data/app/pb_kits/playbook/pb_message/docs/_message_default_swift.md +57 -0
  25. data/app/pb_kits/playbook/pb_message/docs/_message_props_swift.md +12 -0
  26. data/app/pb_kits/playbook/pb_message/docs/example.yml +4 -0
  27. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children_swift.md +14 -0
  28. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed_swift.md +7 -0
  29. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line_swift.md +8 -0
  30. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_props_swift.md +8 -0
  31. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_swift.md +7 -0
  32. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical_swift.md +18 -0
  33. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +8 -0
  34. data/app/pb_kits/playbook/pb_table/docs/_table_header.html.erb +4 -4
  35. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md +27 -0
  36. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error_swift.md +11 -0
  37. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_props_swift.md +9 -0
  38. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +5 -0
  39. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
  40. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default_react.jsx +0 -2
  41. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay.jsx +0 -1
  42. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.jsx +0 -1
  43. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_margin.jsx +0 -1
  44. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_selectors.html.erb +1 -1
  45. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_show_tooltip.html.erb +39 -0
  46. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_show_tooltip.md +5 -0
  47. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_show_tooltip_react.jsx +45 -0
  48. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_show_tooltip_react.md +3 -0
  49. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +3 -0
  50. data/app/pb_kits/playbook/pb_tooltip/docs/index.js +1 -0
  51. data/dist/playbook-doc.js +8 -8
  52. metadata +40 -7
@@ -39,10 +39,10 @@
39
39
  text: "Full Name",
40
40
  colspan: 2,
41
41
  sort_menu: [
42
- { item: "First Name Descending", link: "?sort=firstname_desc#table-header", active: params["sort"] == "firstname_desc", direction: "desc" },
43
- { item: "First Name Ascending", link: "?sort=firstname_asc#table-header", active: params["sort"] == "firstname_asc", direction: "asc" },
44
- { item: "Last Name Descending", link: "?sort=lastname_desc#table-header", active: params["sort"] == "lastname_desc", direction: "desc" },
45
- { item: "Last Name Ascending", link: "?sort=lastname_asc#table-header", active: params["sort"] == "lastname_asc", direction: "asc" }
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" }
46
46
  ],
47
47
  }) %>
48
48
  <%= pb_rails("table/table_header", props: {
@@ -0,0 +1,27 @@
1
+ ![textarea-default](https://github.com/powerhome/playbook/assets/92755007/40eec958-63d7-4840-bf5c-f8d1e34c911a)
2
+
3
+ ```swift
4
+
5
+ @State var defaultText = ""
6
+ @State var placeholderText = ""
7
+ @State var customText = "Default value text"
8
+
9
+ VStack(alignment: .leading, spacing: Spacing.small) {
10
+ PBTextArea(
11
+ "Label",
12
+ text: $defaultText
13
+ )
14
+
15
+ PBTextArea(
16
+ "Label",
17
+ text: $placeholderText,
18
+ placeholder: "Placeholder with text"
19
+ )
20
+
21
+ PBTextArea(
22
+ "Label",
23
+ text: $customText
24
+ )
25
+ }
26
+
27
+ ```
@@ -0,0 +1,11 @@
1
+ ![textarea-error](https://github.com/powerhome/playbook/assets/92755007/6d47a914-ea0b-4fbc-9f2a-6237935a3b4c)
2
+
3
+ ```swift
4
+
5
+ PBTextArea(
6
+ "Label",
7
+ text: $errorText,
8
+ error: "This field has an error!"
9
+ )
10
+
11
+ ```
@@ -0,0 +1,9 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **characterCount** | `CharacterCount` | Adds a character counter to the Textarea | `.noCount` | `.noCount` `.count` `.maxCharacterCount` `.maxCharacterCountBlock` `.maxCharacterCountError` |
5
+ | **inline** | `Bool` | Changes the style of the Textarea | `false` | `true` `false` |
6
+ | **label** | `String` | Adds a label | `nil` | |
7
+ | **placeholder** | `String` | Adds placeholder text | `nil` | |
8
+ | **text** | `String` | Sets the Textarea's text value | `Binding<String>` | |
9
+ | **error** | `String` | Changes the style of the Textarea | `nil` | |
@@ -15,3 +15,8 @@ examples:
15
15
  - textarea_error: Textarea w/ Error
16
16
  - textarea_character_counter: Character Counter
17
17
  - textarea_inline: Inline
18
+
19
+ swift:
20
+ - textarea_default_swift: Default
21
+ - textarea_error_swift: Textarea w/ Error
22
+ - textarea_props_swift: ""
@@ -1,4 +1,4 @@
1
- <%= pb_rails("flex", props: { gap: "md", justify: "center", wrap: true }) do %>
1
+ <%= pb_rails("flex", props: { gap: "md", wrap: true }) do %>
2
2
  <%= pb_rails("flex/flex_item") do %>
3
3
  <span id='regular-tooltip-1'>Hover here (Top)</span>
4
4
 
@@ -9,12 +9,10 @@ const TooltipDefaultReact = (props) => {
9
9
  <Flex
10
10
  flexDirection='row'
11
11
  gap='md'
12
- justifyContent='center'
13
12
  wrap
14
13
  >
15
14
  <FlexItem>
16
15
  <Tooltip
17
- className={"customClassNameHere"}
18
16
  placement='top'
19
17
  text="Whoa. I'm a Tooltip"
20
18
  zIndex={10}
@@ -9,7 +9,6 @@ const TooltipDelay = (props) => {
9
9
  <Flex
10
10
  flexDirection='row'
11
11
  gap='md'
12
- justifyContent='center'
13
12
  wrap
14
13
  >
15
14
  <FlexItem>
@@ -9,7 +9,6 @@ const TooltipInteraction = (props) => {
9
9
  <Flex
10
10
  flexDirection='row'
11
11
  gap='md'
12
- justifyContent='center'
13
12
  wrap
14
13
  >
15
14
  <FlexItem>
@@ -7,7 +7,6 @@ const TooltipMargin = (props) => {
7
7
  return (
8
8
  <Flex
9
9
  flexDirection='row'
10
- justifyContent='center'
11
10
  wrap
12
11
  >
13
12
  <Tooltip
@@ -1,4 +1,4 @@
1
- <%= pb_rails("flex", props: { horizontal: "center", orientation: "column" }) do %>
1
+ <%= pb_rails("flex", props: { orientation: "column" }) do %>
2
2
  <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
3
3
  <%= pb_rails("button", props: {classname: "tooltip-example-trigger", text: "Example 1"}) %>
4
4
  <% end %>
@@ -0,0 +1,39 @@
1
+
2
+ <%= pb_rails("flex", props: { orientation: "column", gap: "md" }) do %>
3
+ <%= pb_rails("button", props: {text: "Toggle state", id: "toggle-tooltip-button"}) %>
4
+ <%= pb_rails("body") do %>
5
+ Tooltip is: <code id="show-tooltip-state">enabled</code>
6
+ <% end %>
7
+ <%= pb_rails("flex/flex_item") do %>
8
+ <span id="truncated-tooltip-1">Hover me</span>
9
+ <%= pb_rails("tooltip", props: {
10
+ trigger_element_selector: "#truncated-tooltip-1",
11
+ tooltip_id: "truncated-1",
12
+ position: "right",
13
+ }) do %>
14
+ Tooltip is enabled
15
+ <% end %>
16
+ <% end %>
17
+ <% end %>
18
+
19
+
20
+ <script>
21
+ const toggleTooltipButton = document.getElementById("toggle-tooltip-button");
22
+ const showTooltipStateText = document.getElementById("show-tooltip-state");
23
+
24
+ function hideTooltipIfNotTruncated(tooltipId) {
25
+ const tooltipElement = document.querySelector(
26
+ `[data-pb-tooltip-tooltip-id="${tooltipId}"]`
27
+ );
28
+
29
+ tooltipElement.dataset.pbTooltipShowTooltip =
30
+ tooltipElement.dataset.pbTooltipShowTooltip == "false" ? "true" : "false";
31
+
32
+ showTooltipStateText.innerText =
33
+ tooltipElement.dataset.pbTooltipShowTooltip == "false" ? "disabled" : "enabled";
34
+ }
35
+
36
+ toggleTooltipButton.addEventListener("click", () => {
37
+ hideTooltipIfNotTruncated("truncated-1");
38
+ });
39
+ </script>
@@ -0,0 +1,5 @@
1
+ You can build your own logic to control whether to show or hide the tooltip.
2
+
3
+ Click on the `Toggle state` button to change the state of the component and hover over the 'hover me' text to see it in action.
4
+
5
+ Each Tooltip has a `dataset` with the `pbTooltipShowTooltip` property set to true by default. To update it, access the `pbTooltipShowTooltip` in the dataset of your tooltip element: `yourTooltip.dataset.pbTooltipShowTooltip = 'false'`
@@ -0,0 +1,45 @@
1
+ // @flow
2
+
3
+ import React, { useState } from 'react'
4
+ import { Button, Body, Flex, FlexItem, Tooltip } from '../..'
5
+
6
+ const TooltipShowTooltipReact = (props) => {
7
+ const [showTooltip, setShowTooltip] = useState(true);
8
+
9
+ return (
10
+ <Flex
11
+ flexDirection='column'
12
+ gap='md'
13
+ wrap
14
+ >
15
+ <FlexItem>
16
+ <Button
17
+ onClick={()=> setShowTooltip(!showTooltip)}
18
+ text="Toggle state"
19
+ />
20
+ </FlexItem>
21
+ <FlexItem>
22
+ <Body >
23
+ <p>
24
+ {'Tooltip is: '}
25
+ <code>{showTooltip ? "enabled" : "disabled"}</code>
26
+ </p>
27
+ </Body>
28
+ </FlexItem>
29
+ <FlexItem>
30
+ <Tooltip
31
+ placement='right'
32
+ showTooltip={showTooltip}
33
+ text='Tooltip is enabled'
34
+ zIndex={10}
35
+ {...props}
36
+ >
37
+ {'Hover me.'}
38
+ </Tooltip>
39
+ </FlexItem>
40
+
41
+ </Flex>
42
+ )
43
+ }
44
+
45
+ export default TooltipShowTooltipReact
@@ -0,0 +1,3 @@
1
+ You can build your own logic to control whether to show the tooltip using the `showTooltip` prop. Its default value is `true`.
2
+
3
+ Click on the `Toggle state` button to change the state of the component and hover over the 'hover me' text to see it in action.
@@ -4,6 +4,7 @@ examples:
4
4
  - tooltip_default: Default
5
5
  - tooltip_selectors: Using Common Selectors
6
6
  - tooltip_with_icon_circle: Icon Circle Tooltip
7
+ - tooltip_show_tooltip: Show Tooltip
7
8
 
8
9
  react:
9
10
  - tooltip_default_react: Default
@@ -11,3 +12,5 @@ examples:
11
12
  - tooltip_margin: Margin
12
13
  - tooltip_icon: Tooltip with Icon
13
14
  - tooltip_delay: Delay
15
+ - tooltip_show_tooltip_react: Show Tooltip
16
+
@@ -3,3 +3,4 @@ export { default as TooltipInteraction } from './_tooltip_interaction'
3
3
  export { default as TooltipMargin } from './_tooltip_margin'
4
4
  export { default as TooltipIcon } from './_tooltip_icon'
5
5
  export { default as TooltipDelay } from './_tooltip_delay'
6
+ export { default as TooltipShowTooltipReact } from './_tooltip_show_tooltip_react'