playbook_ui_docs 13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346 → 13.19.0.pre.alpha.PBNTR207tabledivsupport2245

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +1 -1
  7. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +11 -5
  8. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +18 -44
  9. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +8 -4
  10. data/app/pb_kits/playbook/pb_table/docs/_table_div.html.erb +26 -26
  11. data/app/pb_kits/playbook/pb_table/docs/_table_div.jsx +26 -27
  12. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -5
  13. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.jsx +0 -20
  14. data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +1 -2
  15. data/app/pb_kits/playbook/pb_user/docs/example.yml +0 -1
  16. data/dist/playbook-doc.js +4 -4
  17. metadata +2 -7
  18. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.html.erb +0 -34
  19. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.md +0 -7
  20. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.html.erb +0 -34
  21. data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.md +0 -3
  22. data/app/pb_kits/playbook/pb_user/docs/_user_presence_indicator_swift.md +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97524677912ecc6efe82e5f4509cd3895b24f428e61b1bebbf98f61e052a84be
4
- data.tar.gz: 2a7232286e772b85c8adac4fa66627202f55da71dff4cfd66b9e2386827563bd
3
+ metadata.gz: 8f46c37c2eca826cb24861f95445c890d8d4ad23323dae2bf2bc20da61550f18
4
+ data.tar.gz: a9bb15e4be05af63c48a923bc0ba6f13adbaee4dbc468bc6084f611ad31d0aae
5
5
  SHA512:
6
- metadata.gz: 4259fc37cd2bb185c310e75cd2ccd487dfcf76d232926028e642a6fbdfb47ea91a093fb2af006445cb20b63cd6afddf9103893922dddeebed1bb4dc56497e8eb
7
- data.tar.gz: 242ca3257198a06c1c04e8e6f99676f6b3e8dab0c970e4c4b942d9c675bf2ffefd232b2eae2c2ba4f948828d8fd80a376e303a28260c764bd7adbeee2d3b5c98
6
+ metadata.gz: 0a1d281da841af3a27f74d3bf004052d93cde45aec96f7556b5a5704dae4cefd362e038e3d28ced650f90531cb847a1e0d8982ab06846d497fe0dc819b9df5ee
7
+ data.tar.gz: 3c4d5adbfe9c56ff0ed82b64d715c3ff771fdb5a256c61ff7c6481d8e8f172c93171d92dc6fe57d5a8e0b63e5543e37768ed389db131345738c97047007e2232
@@ -1 +1 @@
1
- `collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of the rows when subRows are toggled open.
1
+ `collapsibleTrail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of rows when subRows are toggled open.
@@ -8,7 +8,7 @@ For a visual of the data structure needed for `tableData`, see [here](https://gi
8
8
 
9
9
  ### columnDefinitions
10
10
 
11
- `columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is an array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
11
+ `columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is a array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
12
12
 
13
13
  - `accessor`: this is the key from your data for the value you want rendered in that column
14
14
  - `label`: this is what will be rendered as the column header label
@@ -1,3 +1,3 @@
1
1
  the optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
2
2
 
3
- By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
3
+ By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
@@ -1,3 +1,3 @@
1
1
  `subRowHeaders` is an optional prop that if present will add header rows at each level of the nested data. The prop takes an array of strings, each string being the text for each header row. The array of strings must be in the order in which they need to be rendered in the UI according to depth.
2
2
 
3
- `enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all', 'header" or "none". If set to 'all', the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to 'header' button will only appear in header and NOT in subRow headers. This is set to 'header' by default.
3
+ `enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be 'all' or 'header". If set to 'all', the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to 'header' button will only appear in header and NOT in subRow headers. This is set to 'headeer' by default.
@@ -1,3 +1,3 @@
1
1
  The Tanstack table consumes the useReactTable hook to create the table. This hook takes an object that can contain any of the functions that the Tanstack table provides. The advancedTable's optional `tableOptions` can be used to pass tanstack options to the kit.
2
2
 
3
- In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and how to use them, see [here](https://tanstack.com/table/v8/docs/api/core/table#usereacttable--createsolidtable--usevuetable--createsveltetable)
3
+ In the above example, we are using the initialState option provided by tanstack that takes sort as one of it's values. Setting it to true for the first column is reversing the sort order on first render of the table. For a complete list of possible options and hoe to use them, see [here](https://tanstack.com/table/v8/docs/api/core/table#usereacttable--createsolidtable--usevuetable--createsveltetable)
@@ -2,9 +2,15 @@
2
2
  <div class="icon-wrapper">
3
3
 
4
4
  <% svg_url = "https://upload.wikimedia.org/wikipedia/commons/3/3b/Wrench_font_awesome.svg" %>
5
- <p><%= pb_rails("icon", props: { icon: svg_url } ) %></p>
6
- <p><%= pb_rails("icon", props: { rotation: 90, icon: svg_url, size: "2x" } ) %></p>
7
- <p><%= pb_rails("icon", props: { spin: true, icon: svg_url, size: "3x" } ) %></p>
8
- <p><%= pb_rails("icon", props: { size: "5x", icon: svg_url } ) %></p>
9
- <p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", icon: svg_url } ) %></p>
5
+ <p><%= pb_rails("icon", props: { custom_icon: svg_url } ) %></p>
6
+ <p><%= pb_rails("icon", props: { rotation: 90, custom_icon: svg_url, size: "2x" } ) %></p>
7
+ <p><%= pb_rails("icon", props: { spin: true, custom_icon: svg_url, size: "3x" } ) %></p>
8
+ <p><%= pb_rails("icon", props: { size: "5x", custom_icon: svg_url } ) %></p>
9
+ <p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", custom_icon: svg_url } ) %></p>
10
+
11
+ <%= pb_rails("body", props: {
12
+ text: "Custom icons are compatible with other icon props (size, rotation,
13
+ spin, flip, etc). Their SVG fill colors will be inherited from
14
+ parent element's css color properties."
15
+ } ) %>
10
16
  </div>
@@ -1,59 +1,33 @@
1
1
  import React from 'react'
2
2
  import { Icon } from '../../'
3
3
 
4
+ // import Icons as config from 'power-icons'
4
5
  const config = {
5
- icon: (
6
- <svg viewBox="0 -256 1792 1792"
6
+ moon: (
7
+ <svg
8
+ ariaHidden="true"
9
+ focusable="false"
10
+ role="img"
11
+ viewBox="0 0 512 512"
7
12
  xmlns="http://www.w3.org/2000/svg"
8
13
  >
9
- <g transform="matrix(1,0,0,-1,53.152542,1217.0847)">
10
- <path d="m 384,64 q 0,26 -19,45 -19,19 -45,19 -26,0 -45,-19 -19,-19 -19,-45 0,-26 19,-45 19,-19 45,-19 26,0 45,19 19,19 19,45 z m 644,420 -682,-682 q -37,-37 -90,-37 -52,0 -91,37 L 59,-90 Q 21,-54 21,0 21,53 59,91 L 740,772 Q 779,674 854.5,598.5 930,523 1028,484 z m 634,435 q 0,-39 -23,-106 Q 1592,679 1474.5,595.5 1357,512 1216,512 1031,512 899.5,643.5 768,775 768,960 q 0,185 131.5,316.5 131.5,131.5 316.5,131.5 58,0 121.5,-16.5 63.5,-16.5 107.5,-46.5 16,-11 16,-28 0,-17 -16,-28 L 1152,1120 V 896 l 193,-107 q 5,3 79,48.5 74,45.5 135.5,81 61.5,35.5 70.5,35.5 15,0 23.5,-10 8.5,-10 8.5,-25 z" />
11
- </g>
14
+ <path
15
+ d="M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm16 352c0 8.8-7.2 16-16 16H288l-12.8 9.6L208 428v-60H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16h384c8.8 0 16 7.2 16 16v288zM336 184h-56v-56c0-8.8-7.2-16-16-16h-16c-8.8 0-16 7.2-16 16v56h-56c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h56v56c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-56h56c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16z"
16
+ fill="currentColor"
17
+ />
12
18
  </svg>
13
19
  ),
14
20
  }
15
21
 
16
22
  const IconCustom = (props) => {
17
23
  return (
18
- <React.Fragment>
19
- <p>
20
- <Icon
21
- icon={config.icon}
22
- {...props}
23
- />
24
- </p>
25
- <p>
26
- <Icon
27
- icon={config.icon}
28
- rotation={90}
29
- size="2x"
30
- {...props}
31
- />
32
- </p>
33
- <p>
34
- <Icon
35
- icon={config.icon}
36
- size="3x"
37
- spin
38
- {...props}
39
- />
40
- </p>
41
- <p>
42
- <Icon
43
- icon={config.icon}
44
- size="5x"
45
- {...props}
46
- />
47
- </p>
48
- <p>
49
- <Icon
50
- flip="horizontal"
51
- icon={config.icon}
52
- size="5x"
53
- {...props}
54
- />
55
- </p>
56
- </React.Fragment>
24
+ <div>
25
+ <Icon
26
+ customIcon={config.moon}
27
+ size="7x"
28
+ {...props}
29
+ />
30
+ </div>
57
31
  )
58
32
  }
59
33
 
@@ -4,12 +4,16 @@ When using custom icons it is important to introduce a "clean" SVG. In order to
4
4
 
5
5
  Attributes must be React compatible e.g. <code>xmlns:xlink</code> should be <code>xmlnsXlink</code> and so on. <strong>There should be no hyphenated attributes and no semi-colons!.</strong>
6
6
 
7
- Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
7
+ Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
8
8
 
9
- Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point **when designing instead of trying to retrofit the viewbox afterwards**!
9
+ Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point __when designing instead of trying to retrofit the viewbox afterwards__!
10
10
 
11
- You must source _your own SVG into component/view_ you are working on. This can easily be done in programmatic and maintainable ways.
11
+ You must source *your own SVG into component/view* you are working on. This can easily be done in programmatic and maintainable ways.
12
+
13
+ ### React
14
+
15
+ So long as you have a valid React `<SVG>` node, you can send it as the `customIcon` prop and the kit will take care of the rest.
12
16
 
13
17
  ### Rails
14
18
 
15
- Sending the absolute path to the `icon` prop results in an `<SVG>` tag within the working view.
19
+ Some Rails applications use only webpack(er) which means using `image_url` will be successful over `image_path` in most cases especially development where Webpack Dev Server is serving assets over HTTP. Rails applications still using Asset Pipeline may use `image_path` or `image_url`. Of course, YMMV depending on any custom configurations in your Rails application.
@@ -1,34 +1,34 @@
1
1
  <%= pb_rails("table", props: { size: "sm", tag: "div" }) do %>
2
- <div class="pb_table_thead">
3
- <div class="pb_table_tr">
4
- <div class="pb_table_th">Column 1</div>
5
- <div class="pb_table_th">Column 2</div>
6
- <div class="pb_table_th">Column 3</div>
7
- <div class="pb_table_th">Column 4</div>
8
- <div class="pb_table_th">Column 5</div>
2
+ <div class="thead">
3
+ <div class="tr">
4
+ <div class="th">Column 1</div>
5
+ <div class="th">Column 2</div>
6
+ <div class="th">Column 3</div>
7
+ <div class="th">Column 4</div>
8
+ <div class="th">Column 5</div>
9
9
  </div>
10
10
  </div>
11
- <div class="pb_table_tbody">
12
- <div class="pb_table_tr">
13
- <div class="pb_table_td">Value 1</div>
14
- <div class="pb_table_td">Value 2</div>
15
- <div class="pb_table_td">Value 3</div>
16
- <div class="pb_table_td">Value 4</div>
17
- <div class="pb_table_td">Value 5</div>
11
+ <div class="tbody">
12
+ <div class="tr">
13
+ <div class="td">Value 1</div>
14
+ <div class="td">Value 2</div>
15
+ <div class="td">Value 3</div>
16
+ <div class="td">Value 4</div>
17
+ <div class="td">Value 5</div>
18
18
  </div>
19
- <div class="pb_table_tr">
20
- <div class="pb_table_td">Value 1</div>
21
- <div class="pb_table_td">Value 2</div>
22
- <div class="pb_table_td">Value 3</div>
23
- <div class="pb_table_td">Value 4</div>
24
- <div class="pb_table_td">Value 5</div>
19
+ <div class="tr">
20
+ <div class="td">Value 1</div>
21
+ <div class="td">Value 2</div>
22
+ <div class="td">Value 3</div>
23
+ <div class="td">Value 4</div>
24
+ <div class="td">Value 5</div>
25
25
  </div>
26
- <div class="pb_table_tr">
27
- <div class="pb_table_td">Value 1</div>
28
- <div class="pb_table_td">Value 2</div>
29
- <div class="pb_table_td">Value 3</div>
30
- <div class="pb_table_td">Value 4</div>
31
- <div class="pb_table_td">Value 5</div>
26
+ <div class="tr">
27
+ <div class="td">Value 1</div>
28
+ <div class="td">Value 2</div>
29
+ <div class="td">Value 3</div>
30
+ <div class="td">Value 4</div>
31
+ <div class="td">Value 5</div>
32
32
  </div>
33
33
  </div>
34
34
  <% end %>
@@ -5,39 +5,38 @@ const TableDiv = (props) => {
5
5
  return (
6
6
  <Table
7
7
  size="sm"
8
- tag="div"
9
8
  {...props}
10
9
  >
11
- <div className="pb_table_thead">
12
- <div className="pb_table_tr">
13
- <div className="pb_table_th">{'Column 1'}</div>
14
- <div className="pb_table_th">{'Column 2'}</div>
15
- <div className="pb_table_th">{'Column 3'}</div>
16
- <div className="pb_table_th">{'Column 4'}</div>
17
- <div className="pb_table_th">{'Column 5'}</div>
10
+ <div className="thead">
11
+ <div className="tr">
12
+ <div className="th">{'Column 1'}</div>
13
+ <div className="th">{'Column 2'}</div>
14
+ <div className="th">{'Column 3'}</div>
15
+ <div className="th">{'Column 4'}</div>
16
+ <div className="th">{'Column 5'}</div>
18
17
  </div>
19
18
  </div>
20
- <div className="pb_table_tbody">
21
- <div className="pb_table_tr">
22
- <div className="pb_table_td">{'Value 1'}</div>
23
- <div className="pb_table_td">{'Value 2'}</div>
24
- <div className="pb_table_td">{'Value 3'}</div>
25
- <div className="pb_table_td">{'Value 4'}</div>
26
- <div className="pb_table_td">{'Value 5'}</div>
19
+ <div className="tbody">
20
+ <div className="tr">
21
+ <div className="td">{'Value 1'}</div>
22
+ <div className="td">{'Value 2'}</div>
23
+ <div className="td">{'Value 3'}</div>
24
+ <div className="td">{'Value 4'}</div>
25
+ <div className="td">{'Value 5'}</div>
27
26
  </div>
28
- <div className="pb_table_tr">
29
- <div className="pb_table_td">{'Value 1'}</div>
30
- <div className="pb_table_td">{'Value 2'}</div>
31
- <div className="pb_table_td">{'Value 3'}</div>
32
- <div className="pb_table_td">{'Value 4'}</div>
33
- <div className="pb_table_td">{'Value 5'}</div>
27
+ <div className="tr">
28
+ <div className="td">{'Value 1'}</div>
29
+ <div className="td">{'Value 2'}</div>
30
+ <div className="td">{'Value 3'}</div>
31
+ <div className="td">{'Value 4'}</div>
32
+ <div className="td">{'Value 5'}</div>
34
33
  </div>
35
- <div className="pb_table_tr">
36
- <div className="pb_table_td">{'Value 1'}</div>
37
- <div className="pb_table_td">{'Value 2'}</div>
38
- <div className="pb_table_td">{'Value 3'}</div>
39
- <div className="pb_table_td">{'Value 4'}</div>
40
- <div className="pb_table_td">{'Value 5'}</div>
34
+ <div className="tr">
35
+ <div className="td">{'Value 1'}</div>
36
+ <div className="td">{'Value 2'}</div>
37
+ <div className="td">{'Value 3'}</div>
38
+ <div className="td">{'Value 4'}</div>
39
+ <div className="td">{'Value 5'}</div>
41
40
  </div>
42
41
  </div>
43
42
  </Table>
@@ -1,6 +1,6 @@
1
1
  examples:
2
2
  rails:
3
- # - table_div: Div
3
+ - table_div: Div
4
4
  - table_sm: Small
5
5
  - table_md: Medium
6
6
  - table_lg: Large
@@ -25,12 +25,9 @@ examples:
25
25
  - table_with_background_kit: Table With Background Kit
26
26
  - table_vertical_border: Vertical Borders
27
27
  - table_striped: Striped Table
28
- - table_with_subcomponents: Table with Sub Components (Table Elements)
29
- - table_with_subcomponents_as_divs: Table with Sub Components (Divs)
30
-
31
28
 
32
29
  react:
33
- # - table_div: Div
30
+ - table_div: Div
34
31
  - table_sm: Small
35
32
  - table_md: Medium
36
33
  - table_lg: Large
@@ -58,16 +58,6 @@ const TextInputAddOn = (props) => {
58
58
  {...props}
59
59
  />
60
60
  </div>
61
- <div>
62
- <TextInput
63
- addOn={{ icon: 'frog', alignment: 'right', border: true }}
64
- label="Right-Aligned Add On With Child Input"
65
- onChange={handleUpdateFourthInput}
66
- {...props}
67
- >
68
- <input />
69
- </TextInput>
70
- </div>
71
61
  <div>
72
62
  <TextInput
73
63
  addOn={{ icon: 'percent', alignment: 'left', border: false }}
@@ -86,16 +76,6 @@ const TextInputAddOn = (props) => {
86
76
  {...props}
87
77
  />
88
78
  </div>
89
- <div>
90
- <TextInput
91
- addOn={{ icon: 'frog', alignment: 'left', border: true }}
92
- label="Left-Aligned Add On With Child Input"
93
- onChange={handleUpdateFourthInput}
94
- {...props}
95
- >
96
- <input />
97
- </TextInput>
98
- </div>
99
79
  </>
100
80
  )
101
81
  }
@@ -7,5 +7,4 @@
7
7
  | **orientation** | `Orientation` | Changes the orientation of the User | `.horizontal` | `.horizontal` `.verticle` |
8
8
  | **size** | `UserAvatarSize` | Changes the size of the User | `.medium` | `.small` `.medium` `.large` |
9
9
  | **territory** | `String` | Adds the User's territory | | |
10
- | **title** | `String` | Adds a title | | |
11
- | **status** | `PBAvatar.PresenceStatus?` | An idicator for the current status of the user | `.none` | `.online` `.away` `.offline` |
10
+ | **title** | `String` | Adds a title | | |
@@ -23,5 +23,4 @@ examples:
23
23
  - user_vertical_size_swift: Vertical
24
24
  - user_text_only_swift: Text Only
25
25
  - user_size_swift: Horizontal Size
26
- - user_presence_indicator_swift: Presence Indicator
27
26
  - user_props_table: ""