playbook_ui_docs 15.3.0.pre.alpha.PLAY2012currencyallownonstring11972 → 15.3.0.pre.alpha.PLAY2322popoverconditionalrender11766

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -4
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +2 -3
  4. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +1 -1
  6. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.md +1 -1
  7. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +14 -7
  8. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +15 -6
  9. data/app/pb_kits/playbook/pb_popover/docs/_popover_close.jsx +7 -0
  10. data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
  11. data/app/pb_kits/playbook/pb_popover/docs/hook/useSmallScreenIndicator.tsx +27 -0
  12. data/app/pb_kits/playbook/pb_popover/docs/index.js +0 -1
  13. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
  14. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
  15. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +1 -67
  16. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +6 -68
  17. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  18. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
  19. data/dist/playbook-doc.js +2 -2
  20. metadata +4 -13
  21. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.md +0 -1
  22. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +0 -68
  23. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to_react.md +0 -1
  24. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.html.erb +0 -63
  25. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.jsx +0 -89
  26. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_rails.md +0 -4
  27. data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_react.md +0 -3
  28. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.html.erb +0 -64
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.jsx +0 -70
  30. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.md +0 -1
  31. /data/app/pb_kits/playbook/pb_popover/docs/{_popover_append_to_rails.md → _popover_append_to.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5f17d9a703364229c0cec67ae52283d7318d0047cdb236f3da53ba7666e5df1
4
- data.tar.gz: 739766839281ffc52a7e4e202e981d1476df384c287c86e24d1281427820ed91
3
+ metadata.gz: 8f69b595011a67bdc4a54da690b25f73910ccae26494449230dc2170c77ffbb5
4
+ data.tar.gz: f0cb1355313f88d5d5e74da486969f7431d5ae195b4124f1933d740019b17226
5
5
  SHA512:
6
- metadata.gz: 486664418b2b59dc010bfd35358367218afeb1337e1bcedba5dbaf5f765a8f357cd14665b457636d5c051085f94f9afe77a2e34c539b19a9d11c2e9225c52d6b
7
- data.tar.gz: 7a65f4f1cf79e7e84ae2587893d34e21563730c8b8bf7cc59f5af50e83146fc171dc4966abd2038891b6a21f15a6f90bf63f3f44682a697052dafad0afb17237
6
+ metadata.gz: da166f737db34d9400944b2a784278df2ebcbe22ac1d23856b4dbd58203d4397bbfdeeefe98a9354725315a5b9d3d3960527d1dae3c11664f5e1c229d50be176
7
+ data.tar.gz: 98caa1c5b0e20b6a40273dc20c04f38774058777fb4155c5a8b2c0391dc2100a3403c1d7e7d65027fa8b4d93d558c0a368627d54146b5aeb19d94f33df7a6f22
@@ -38,10 +38,7 @@ const AdvancedTablePaginationWithProps = (props) => {
38
38
  const paginationProps = {
39
39
  pageIndex: 1,
40
40
  pageSize: 10,
41
- range: 2,
42
- onPageChange: (pageIndex) => {
43
- console.log('Current page index:', pageIndex);
44
- }
41
+ range: 2
45
42
  }
46
43
 
47
44
  return (
@@ -1,6 +1,5 @@
1
- `paginationProps` is an optional prop that can be used to further customize pagination for the AdvancedTable. This prop is an object with the following optional items:
1
+ `paginationProps` is an optional prop that can be used to further customize pagination for the AdvancedTable. This prop is an object with 2 optional items:
2
2
 
3
3
  - `pageIndex`: An optional prop to set which page is set to open on initial load. Default is '0'
4
4
  - `pageSize`: An optional prop to set total number of rows for each page before the Table paginates. Default is '20'
5
- - `range`: The range prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the range prop. See [here for more details](https://playbook.powerapp.cloud/kits/pagination/react#default). Default is set to '5'
6
- - `onPageChange`: A callback function that gives to access to the current page index.
5
+ - `range`: The range prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the range prop. See [here for more details](https://playbook.powerapp.cloud/kits/pagination/react#default). Default is set to '5'
@@ -7,7 +7,7 @@
7
7
  }) %>
8
8
 
9
9
  <%= pb_rails("currency", props: {
10
- amount: 342,
10
+ amount: "342",
11
11
  label: "Light",
12
12
  margin_bottom: "md",
13
13
  size: "sm",
@@ -14,7 +14,7 @@ const CurrencyVariants = (props) => {
14
14
  {...props}
15
15
  />
16
16
  <Currency
17
- amount={342}
17
+ amount="342"
18
18
  label="Light"
19
19
  marginBottom="md"
20
20
  size="sm"
@@ -1 +1 @@
1
- Customize your icon circle by passing one of our seven base colors to the `variant` prop: `royal` `orange` `purple` `teal` `red` `yellow` `green`
1
+ Customize your icon circle by passing one of our seven base colors to the `variant` prop: `royal` `blue` `orange` `purple` `teal` `red` `yellow` `green`
@@ -3,41 +3,48 @@
3
3
  text: "Mercury",
4
4
  unit: "AU",
5
5
  value: 0.39,
6
- variant:"royal"
6
+ variant:"blue"
7
7
  }) %>
8
8
  <br>
9
9
  <%= pb_rails("icon_stat_value", props: { icon: "planet-ringed",
10
10
  text: "Venus",
11
11
  unit: "AU",
12
12
  value: 0.723,
13
- variant:"purple"
13
+ variant:"royal"
14
14
  }) %>
15
15
  <br>
16
16
  <%= pb_rails("icon_stat_value", props: { icon: "planet-moon",
17
17
  text: "Earth",
18
18
  unit: "AU",
19
19
  value: 1.0,
20
- variant:"teal"
20
+ variant:"purple"
21
21
  }) %>
22
22
  <br>
23
23
  <%= pb_rails("icon_stat_value", props: { icon: "solar-system",
24
24
  text: "Mars",
25
25
  unit: "AU",
26
26
  value: 1.524,
27
- variant:"red"
27
+ variant:"teal"
28
28
  }) %>
29
29
  <br>
30
30
  <%= pb_rails("icon_stat_value", props: { icon: "globe-americas",
31
- text: "Jupiter",
31
+ text: "Jupitar",
32
32
  unit: "AU",
33
33
  value: 5.203,
34
- variant:"yellow"
34
+ variant:"red"
35
35
  }) %>
36
36
  <br>
37
37
  <%= pb_rails("icon_stat_value", props: { icon: "globe-africa",
38
38
  text: "Saturn",
39
39
  unit: "AU",
40
40
  value: 9.539,
41
+ variant:"yellow"
42
+ }) %>
43
+ <br>
44
+ <%= pb_rails("icon_stat_value", props: { icon: "globe",
45
+ text: "Uranus",
46
+ unit: "AU",
47
+ value: 19.18,
41
48
  variant:"green"
42
49
  }) %>
43
50
  <br>
@@ -46,4 +53,4 @@
46
53
  unit: "AU",
47
54
  value: 19.18,
48
55
  variant:"orange"
49
- }) %>
56
+ }) %>
@@ -9,7 +9,7 @@ const IconStatValueColor = (props) => {
9
9
  text="Mercury"
10
10
  unit="AU"
11
11
  value={0.39}
12
- variant="royal"
12
+ variant="blue"
13
13
  {...props}
14
14
  />
15
15
  <br />
@@ -18,7 +18,7 @@ const IconStatValueColor = (props) => {
18
18
  text="Venus"
19
19
  unit="AU"
20
20
  value={0.723}
21
- variant="purple"
21
+ variant="royal"
22
22
  {...props}
23
23
  />
24
24
  <br />
@@ -27,7 +27,7 @@ const IconStatValueColor = (props) => {
27
27
  text="Earth"
28
28
  unit="AU"
29
29
  value={1.0}
30
- variant="teal"
30
+ variant="purple"
31
31
  {...props}
32
32
  />
33
33
  <br />
@@ -36,16 +36,16 @@ const IconStatValueColor = (props) => {
36
36
  text="Mars"
37
37
  unit="AU"
38
38
  value={1.524}
39
- variant="red"
39
+ variant="teal"
40
40
  {...props}
41
41
  />
42
42
  <br />
43
43
  <IconStatValue
44
44
  icon="globe-americas"
45
- text="Jupiter"
45
+ text="Jupitar"
46
46
  unit="AU"
47
47
  value={5.203}
48
- variant="yellow"
48
+ variant="red"
49
49
  {...props}
50
50
  />
51
51
  <br />
@@ -54,6 +54,15 @@ const IconStatValueColor = (props) => {
54
54
  text="Saturn"
55
55
  unit="AU"
56
56
  value={9.539}
57
+ variant="yellow"
58
+ {...props}
59
+ />
60
+ <br />
61
+ <IconStatValue
62
+ icon="globe"
63
+ text="Uranus"
64
+ unit="AU"
65
+ value={19.18}
57
66
  variant="green"
58
67
  {...props}
59
68
  />
@@ -3,11 +3,14 @@ import React, { useState } from 'react'
3
3
  import Button from '../../pb_button/_button'
4
4
  import Flex from '../../pb_flex/_flex'
5
5
  import PbReactPopover from '../../pb_popover/_popover'
6
+ // Temporary code to replicate bug - DO NOT MERGE (Revert example when done)
7
+ import useSmallScreenIndicator from './hook/useSmallScreenIndicator'
6
8
 
7
9
  const PopoverClose = (props) => {
8
10
  const [showInsidePopover, setInsideShowPopover] = useState(false)
9
11
  const [showOutsidePopover, setOutsideShowPopover] = useState(false)
10
12
  const [showAnyPopover, setAnyShowPopover] = useState(false)
13
+ const isPwa = useSmallScreenIndicator()
11
14
 
12
15
  const handleInsideShouldClosePopover = (shouldClosePopover) => {
13
16
  setInsideShowPopover(!shouldClosePopover)
@@ -59,6 +62,10 @@ const PopoverClose = (props) => {
59
62
  />
60
63
  )
61
64
 
65
+ if (isPwa) {
66
+ return null
67
+ }
68
+
62
69
  return (
63
70
  <Flex spacing="between">
64
71
  <PbReactPopover
@@ -15,4 +15,3 @@ examples:
15
15
  - popover_z_index: Set Z-Index
16
16
  - popover_scroll_height: Scroll and Height Settings
17
17
  - popover_actionable_content: With Actionable Content
18
- - popover_append_to: Append To
@@ -0,0 +1,27 @@
1
+ // Temporary code to replicate bug - DO NOT MERGE
2
+ import { useEffect, useState } from "react";
3
+
4
+ const useSmallScreenIndicator = (): boolean => {
5
+ const [isPwa, setIsPwa] = useState(false);
6
+
7
+ useEffect(() => {
8
+ const update = () => {
9
+ const value = getComputedStyle(document.documentElement)
10
+ .getPropertyValue("--is-pwa")
11
+ .trim();
12
+ setIsPwa(value === "1");
13
+ };
14
+
15
+ update();
16
+
17
+ // Observes changes using ResizeObserver
18
+ const observer = new ResizeObserver(update);
19
+ observer.observe(document.documentElement);
20
+
21
+ return () => observer.disconnect();
22
+ }, []);
23
+
24
+ return isPwa;
25
+ };
26
+
27
+ export default useSmallScreenIndicator;
@@ -4,4 +4,3 @@ export { default as PopoverClose } from './_popover_close.jsx'
4
4
  export { default as PopoverZIndex } from './_popover_z_index.jsx'
5
5
  export { default as PopoverScrollHeight } from './_popover_scroll_height.jsx'
6
6
  export { default as PopoverActionableContent } from './_popover_actionable_content.jsx'
7
- export { default as PopoverAppendTo } from './_popover_append_to.jsx'
@@ -31,7 +31,6 @@ examples:
31
31
  - table_with_subcomponents_as_divs: Table with Sub Components (Divs)
32
32
  - table_outer_padding: Outer Padding
33
33
  - table_with_collapsible: Table with Collapsible
34
- - table_with_dynamic_collapsible: Table with Dynamic Collapsible
35
34
  - table_with_collapsible_with_custom_click: Table with Collapsible with Custom Click
36
35
  - table_with_collapsible_with_custom_content_rails: Table with Collapsible with Custom Content
37
36
  - table_with_collapsible_with_nested_rows_rails: Table with Collapsible with Nested Rows
@@ -72,7 +71,6 @@ examples:
72
71
  - table_with_subcomponents_as_divs: Table with Sub Components (Divs)
73
72
  - table_outer_padding: Outer Padding
74
73
  - table_with_collapsible: Table with Collapsible
75
- - table_with_dynamic_collapsible: Table with Dynamic Collapsible
76
74
  - table_with_collapsible_with_custom_click: Table with Collapsible with Custom Click
77
75
  - table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
78
76
  - table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
@@ -29,7 +29,6 @@ export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.
29
29
  export { default as TableStickyRightColumns } from './_table_sticky_right_columns.jsx'
30
30
  export { default as TableStickyColumns } from './_table_sticky_columns.jsx'
31
31
  export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
32
- export { default as TableWithDynamicCollapsible } from './_table_with_dynamic_collapsible.jsx'
33
32
  export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
34
33
  export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
35
34
  export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
@@ -25,77 +25,11 @@
25
25
  ]
26
26
  %>
27
27
 
28
- <%
29
- grouped_options = [
30
- {
31
- label: "Warm Colors",
32
- options: [
33
- { label: "Red", value: "#FF0000" },
34
- { label: "Orange", value: "#FFA500" },
35
- { label: "Yellow", value: "#FFFF00" },
36
- { label: "Coral", value: "#FF7F50" },
37
- { label: "Gold", value: "#FFD700" }
38
- ]
39
- },
40
- {
41
- label: "Cool Colors",
42
- options: [
43
- { label: "Blue", value: "#0000FF" },
44
- { label: "Teal", value: "#008080" },
45
- { label: "Cyan", value: "#00FFFF" },
46
- { label: "Navy", value: "#000080" },
47
- { label: "Turquoise", value: "#40E0D0" }
48
- ]
49
- },
50
- {
51
- label: "Neutrals",
52
- options: [
53
- { label: "White", value: "#FFFFFF" },
54
- { label: "Black", value: "#000000" },
55
- { label: "Gray", value: "#808080" },
56
- { label: "Beige", value: "#F5F5DC" },
57
- { label: "Silver", value: "#C0C0C0" }
58
- ]
59
- },
60
- {
61
- label: "Earth Tones",
62
- options: [
63
- { label: "Brown", value: "#A52A2A" },
64
- { label: "Olive", value: "#808000" },
65
- { label: "Forest Green", value: "#228B22" },
66
- { label: "Tan", value: "#D2B48C" },
67
- { label: "Maroon", value: "#800000" }
68
- ]
69
- },
70
- {
71
- label: "Fun Shades",
72
- options: [
73
- { label: "Pink", value: "#FFC0CB" },
74
- { label: "Magenta", value: "#FF00FF" },
75
- { label: "Lime", value: "#00FF00" },
76
- { label: "Purple", value: "#800080" },
77
- { label: "Indigo", value: "#4B0082" }
78
- ]
79
- }
80
- ]
81
- %>
82
-
83
-
84
28
  <%= pb_rails("typeahead", props: {
85
29
  default_options: [{ label: 'Gray', value: '#808080' }],
86
30
  id: "typeahead-default-value",
87
31
  options: options,
88
- label: "Default Value with basic options",
89
- name: :foo,
90
- is_multi: false
91
- })
92
- %>
93
-
94
- <%= pb_rails("typeahead", props: {
95
- default_options:[{ label: "Pink", value: "#FFC0CB" }],
96
- id: "typeahead-default-value-grouped-options",
97
- options: grouped_options,
98
- label: "Default Value with grouped options",
32
+ label: "Colors",
99
33
  name: :foo,
100
34
  is_multi: false
101
35
  })
@@ -27,76 +27,14 @@ const options = [
27
27
  { label: 'Coral', value: '#FF7F50' }
28
28
  ]
29
29
 
30
- const groupedOptions = [
31
- {
32
- label: "Warm Colors",
33
- options: [
34
- { label: "Red", value: "#FF0000" },
35
- { label: "Orange", value: "#FFA500" },
36
- { label: "Yellow", value: "#FFFF00" },
37
- { label: "Coral", value: "#FF7F50" },
38
- { label: "Gold", value: "#FFD700" }
39
- ]
40
- },
41
- {
42
- label: "Cool Colors",
43
- options: [
44
- { label: "Blue", value: "#0000FF" },
45
- { label: "Teal", value: "#008080" },
46
- { label: "Cyan", value: "#00FFFF" },
47
- { label: "Navy", value: "#000080" },
48
- { label: "Turquoise", value: "#40E0D0" }
49
- ]
50
- },
51
- {
52
- label: "Neutrals",
53
- options: [
54
- { label: "White", value: "#FFFFFF" },
55
- { label: "Black", value: "#000000" },
56
- { label: "Gray", value: "#808080" },
57
- { label: "Beige", value: "#F5F5DC" },
58
- { label: "Silver", value: "#C0C0C0" }
59
- ]
60
- },
61
- {
62
- label: "Earth Tones",
63
- options: [
64
- { label: "Brown", value: "#A52A2A" },
65
- { label: "Olive", value: "#808000" },
66
- { label: "Forest Green", value: "#228B22" },
67
- { label: "Tan", value: "#D2B48C" },
68
- { label: "Maroon", value: "#800000" }
69
- ]
70
- },
71
- {
72
- label: "Fun Shades",
73
- options: [
74
- { label: "Pink", value: "#FFC0CB" },
75
- { label: "Magenta", value: "#FF00FF" },
76
- { label: "Lime", value: "#00FF00" },
77
- { label: "Purple", value: "#800080" },
78
- { label: "Indigo", value: "#4B0082" }
79
- ]
80
- }
81
- ]
82
-
83
30
  const TypeaheadDefaultValue = (props) => {
84
31
  return (
85
- <>
86
- <Typeahead
87
- defaultValue={options[10]}
88
- label="Default Value with basic options"
89
- options={options}
90
- {...props}
91
- />
92
- <br />
93
- <Typeahead
94
- defaultValue={{ label: "Pink", value: "#FFC0CB" }}
95
- label="Default Value with grouped options"
96
- options={groupedOptions}
97
- {...props}
98
- />
99
- </>
32
+ <Typeahead
33
+ defaultValue={options[10]}
34
+ label="Colors"
35
+ options={options}
36
+ {...props}
37
+ />
100
38
  )
101
39
  }
102
40
 
@@ -1,7 +1,6 @@
1
1
  examples:
2
2
  rails:
3
3
  - typeahead_default: Default
4
- - typeahead_custom_options: With Grouped Options
5
4
  - typeahead_default_options: With Default Options
6
5
  - typeahead_with_context: With Context
7
6
  - typeahead_with_pills: With Pills
@@ -21,7 +20,6 @@ examples:
21
20
 
22
21
  react:
23
22
  - typeahead_default: Default
24
- - typeahead_custom_options: With Grouped Options
25
23
  - typeahead_default_value: With Default Value
26
24
  - typeahead_react_hook: React Hook
27
25
  - typeahead_with_highlight: With Highlight
@@ -16,5 +16,4 @@ export { default as TypeaheadTruncatedText } from './_typeahead_truncated_text.j
16
16
  export { default as TypeaheadReactHook } from './_typeahead_react_hook.jsx'
17
17
  export { default as TypeaheadDisabled } from './_typeahead_disabled.jsx'
18
18
  export { default as TypeaheadPreserveInput } from './_typeahead_preserve_input.jsx'
19
- export { default as TypeaheadDefaultValue } from './_typeahead_default_value.jsx'
20
- export { default as TypeaheadCustomOptions } from './_typeahead_custom_options.jsx'
19
+ export { default as TypeaheadDefaultValue } from './_typeahead_default_value.jsx'