playbook_ui 13.16.0.pre.alpha.PLAY11642006 → 13.16.0.pre.alpha.PLAY12002127

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +14 -12
  3. data/app/pb_kits/playbook/index.js +2 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +30 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +62 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/Components/LoadingCell.tsx +5 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +30 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +61 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +127 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/Components/ToggleIconButton.tsx +28 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +5 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/README.md +288 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +95 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +51 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/Utilities/BrowserCheck.tsx +5 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +63 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/Utilities/IconHelpers.tsx +8 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +8 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +98 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +246 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +56 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx +52 -0
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md +1 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +49 -0
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +18 -0
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx +59 -0
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md +18 -0
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx +60 -0
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +3 -0
  30. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx +52 -0
  31. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md +5 -0
  32. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx +63 -0
  33. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +3 -0
  34. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.jsx +57 -0
  35. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +3 -0
  36. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.jsx +61 -0
  37. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +3 -0
  38. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +55 -0
  39. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.md +1 -0
  40. data/app/pb_kits/playbook/pb_advanced_table/docs/_description.md +1 -0
  41. data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data.js +278 -0
  42. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +12 -0
  43. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +9 -0
  44. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_loading.scss +72 -0
  45. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_pseudo_states.scss +12 -0
  46. data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
  47. data/app/pb_kits/playbook/pb_icon/_icon.tsx +17 -29
  48. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +11 -5
  49. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +18 -44
  50. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +12 -7
  51. data/app/pb_kits/playbook/pb_icon/icon.html.erb +4 -6
  52. data/app/pb_kits/playbook/pb_icon/icon.rb +10 -10
  53. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
  54. data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -1
  55. data/app/pb_kits/playbook/pb_layout/layout.test.js +8 -4
  56. data/app/pb_kits/playbook/pb_legend/_legend.tsx +6 -6
  57. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +4 -4
  58. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.tsx +1 -1
  59. data/app/pb_kits/playbook/pb_lightbox/Carousel/index.tsx +3 -3
  60. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +30 -22
  61. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -5
  62. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +4 -4
  63. data/app/pb_kits/playbook/pb_list/_list.tsx +15 -15
  64. data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
  65. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +9 -9
  66. data/app/pb_kits/playbook/pb_map/_map.tsx +8 -8
  67. data/app/pb_kits/playbook/pb_map/_map_controls.tsx +15 -7
  68. data/app/pb_kits/playbook/pb_map/_map_custom_button.tsx +4 -2
  69. data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
  70. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +6 -6
  71. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +46 -42
  72. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +20 -20
  73. data/app/pb_kits/playbook/pb_nav/_item.tsx +56 -47
  74. data/app/pb_kits/playbook/pb_nav/_nav.tsx +15 -15
  75. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +5 -7
  76. data/app/pb_kits/playbook/pb_popover/_popover.tsx +12 -14
  77. data/app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.html.erb +30 -0
  78. data/app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx +57 -0
  79. data/app/pb_kits/playbook/pb_popover/docs/example.yml +2 -1
  80. data/app/pb_kits/playbook/pb_popover/docs/index.js +1 -0
  81. data/app/pb_kits/playbook/pb_table/_table.tsx +29 -29
  82. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +1 -1
  83. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -2
  84. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  85. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
  86. data/dist/menu.yml +4 -1
  87. data/dist/playbook-rails.js +14 -6
  88. data/lib/playbook/version.rb +1 -1
  89. metadata +46 -2
@@ -0,0 +1,57 @@
1
+ import React, { useState } from 'react'
2
+ import {
3
+ Body,
4
+ Button,
5
+ CircleIconButton,
6
+ Flex,
7
+ PbReactPopover,
8
+ } from '../..'
9
+
10
+ const PopoverActionableContent = (props) => {
11
+ const [showPopover, setShowPopover] = useState(false)
12
+
13
+ const handleTogglePopover = () => {
14
+ setShowPopover(!showPopover)
15
+ }
16
+
17
+ const handleShouldClosePopover = (shouldClose) => {
18
+ setShowPopover(!shouldClose)
19
+ }
20
+
21
+ const popoverReference = (
22
+ <CircleIconButton
23
+ icon="info"
24
+ onClick={handleTogglePopover}
25
+ variant="secondary"
26
+ />
27
+ )
28
+
29
+ return (
30
+ <Flex
31
+ orientation="row"
32
+ vertical="center"
33
+ {...props}
34
+ >
35
+ <Body text="Click info for more details" />
36
+ &nbsp;
37
+ <PbReactPopover
38
+ closeOnClick="inside"
39
+ offset
40
+ placement="top"
41
+ reference={popoverReference}
42
+ shouldClosePopover={handleShouldClosePopover}
43
+ show={showPopover}
44
+ {...props}
45
+ >
46
+ <Body textAlign="center">
47
+ <Button
48
+ onClick={() => {alert("Let's do this!")}}
49
+ text="Learn More"
50
+ />
51
+ </Body>
52
+ </PbReactPopover>
53
+ </Flex>
54
+ )
55
+ }
56
+
57
+ export default PopoverActionableContent
@@ -5,6 +5,7 @@ examples:
5
5
  - popover_close: Close Options
6
6
  - popover_z_index: Set Z-Index
7
7
  - popover_scroll_height: Scroll and Height Settings
8
+ - popover_actionable_content: With Actionable Content
8
9
 
9
10
  react:
10
11
  - popover_default: Default
@@ -12,4 +13,4 @@ examples:
12
13
  - popover_close: Close Options
13
14
  - popover_z_index: Set Z-Index
14
15
  - popover_scroll_height: Scroll and Height Settings
15
-
16
+ - popover_actionable_content: With Actionable Content
@@ -3,3 +3,4 @@ export { default as PopoverList } from './_popover_list.jsx'
3
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
+ export { default as PopoverActionableContent } from './_popover_actionable_content.jsx'
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps } from '../utilities/globalProps'
4
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
5
5
  import PbTable from '.'
6
6
 
7
7
  type TableProps = {
@@ -9,19 +9,19 @@ type TableProps = {
9
9
  children: React.ReactNode[] | React.ReactNode,
10
10
  className: string,
11
11
  collapse?: "sm" | "md" | "lg",
12
- container: boolean,
12
+ container?: boolean,
13
13
  dark?: boolean,
14
14
  data?: { [key: string]: string },
15
15
  dataTable: boolean,
16
- disableHover: boolean,
16
+ disableHover?: boolean,
17
17
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
18
  id?: string,
19
- responsive: "collapse" | "scroll" | "none",
20
- singleLine: boolean,
21
- size: "sm" | "md" | "lg",
19
+ responsive?: "collapse" | "scroll" | "none",
20
+ singleLine?: boolean,
21
+ size?: "sm" | "md" | "lg",
22
22
  sticky?: boolean,
23
23
  verticalBorder?: boolean,
24
- }
24
+ } & GlobalProps
25
25
 
26
26
  const Table = (props: TableProps) => {
27
27
  const {
@@ -56,29 +56,29 @@ const Table = (props: TableProps) => {
56
56
 
57
57
  return (
58
58
  <table
59
- {...ariaProps}
60
- {...dataProps}
61
- {...htmlProps}
62
- className={classnames(
63
- 'pb_table',
64
- `table-${size}`,
65
- `table-responsive-${responsive}`,
66
- {
67
- 'table-card': container,
68
- 'table-dark': dark,
69
- 'data_table': dataTable,
70
- 'single-line': singleLine,
71
- 'no-hover': disableHover,
72
- 'sticky-header': sticky,
73
- },
74
- globalProps(props),
75
- tableCollapseCss,
76
- verticalBorderCss,
77
- className
78
- )}
79
- id={id}
59
+ {...ariaProps}
60
+ {...dataProps}
61
+ {...htmlProps}
62
+ className={classnames(
63
+ 'pb_table',
64
+ `table-${size}`,
65
+ `table-responsive-${responsive}`,
66
+ {
67
+ 'table-card': container,
68
+ 'table-dark': dark,
69
+ 'data_table': dataTable,
70
+ 'single-line': singleLine,
71
+ 'no-hover': disableHover,
72
+ 'sticky-header': sticky,
73
+ },
74
+ globalProps(props),
75
+ tableCollapseCss,
76
+ verticalBorderCss,
77
+ className
78
+ )}
79
+ id={id}
80
80
  >
81
- {children}
81
+ {children}
82
82
  </table>
83
83
  )
84
84
  }
@@ -148,7 +148,7 @@
148
148
  .placeholder {
149
149
  position: absolute;
150
150
  margin-right: 2px;
151
- margin-left: 2px;
151
+ margin-left: 10px;
152
152
  top: 50%;
153
153
  transform: translateY(-50%);
154
154
  box-sizing: border-box;
@@ -73,8 +73,10 @@ const TypeaheadWithHighlight = (props) => {
73
73
  Option: (highlightProps: OptionProps) => (
74
74
  <components.Option {...highlightProps}/>
75
75
  ),
76
- SingleValue: ({ data }: any) => (
77
- <span>{data.name}</span>
76
+ SingleValue: ({ ...props }) => (
77
+ <components.SingleValue {...props}>
78
+ <span>{props.data.name}</span>
79
+ </components.SingleValue>
78
80
  )
79
81
  }
80
82
 
@@ -4,6 +4,7 @@ import WebpackerReact from 'webpacker-react'
4
4
 
5
5
  // KIT EXAMPLES
6
6
  import 'pb_form/pb_form_validation'
7
+ import * as AdvancedTable from 'pb_advanced_table/docs'
7
8
  import * as Avatar from 'pb_avatar/docs'
8
9
  import * as AvatarActionButton from 'pb_avatar_action_button/docs'
9
10
  import * as Background from 'pb_background/docs'
@@ -105,6 +106,7 @@ import * as Walkthrough from 'pb_walkthrough/docs'
105
106
  import * as WeekdayStacked from 'pb_weekday_stacked/docs'
106
107
 
107
108
  WebpackerReact.registerComponents({
109
+ ...AdvancedTable,
108
110
  ...Avatar,
109
111
  ...AvatarActionButton,
110
112
  ...Background,
@@ -17,7 +17,7 @@ type AlignContent = {
17
17
  }
18
18
 
19
19
  type AlignItems = {
20
- alignItems?: Alignment & ("flexStart" | "flexEnd" | "stretch" | "baseline")
20
+ alignItems?: Alignment | ("flexStart" | "flexEnd" | "stretch" | "baseline")
21
21
  }
22
22
 
23
23
  type AlignSelf = {
data/dist/menu.yml CHANGED
@@ -43,6 +43,9 @@ kits:
43
43
  - name: "table"
44
44
  platforms: *web
45
45
  description: Tables display a collection of structured data and typically have the ability to sort, filter, and paginate data.
46
+ - name: "advanced_table"
47
+ platforms: *react_only
48
+ description: The Advanced Table can be used to display complex, nested data in a way that allows for expansion and/or sorting.
46
49
  - name: "list"
47
50
  platforms: *web
48
51
  description: Lists display a vertical set of related content.
@@ -354,4 +357,4 @@ kits:
354
357
  description: Multiple users stacked is used in tight spaces, where we need to indicate that multiple users are associated to a specific action or item.
355
358
  - name: "user"
356
359
  platforms: *web
357
- description: This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
360
+ description: This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.