playbook_ui 16.4.0.pre.alpha.PLAY2718containerfalseborderradiusresponsiveonly15164 → 16.4.0.pre.alpha.PLAY2864circleiconbuttonloadingalignrails15138

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: deb30921ab6e5e0a134bf71decaef200f0a7e9393ab5ae6a926f6267604f80b9
4
- data.tar.gz: b5ea71e20d11bffda695d920587c509123a5f31f59c7833a784a6d380a5112f7
3
+ metadata.gz: 21855ec8daced0bc073482bcbf66b959ad76a196a6ea7a974d9a7de932f1b1a9
4
+ data.tar.gz: 32376b89618eee8730e81f9c15905713a1a8e9e133c678351002a254532cc687
5
5
  SHA512:
6
- metadata.gz: 9eebe12c7de1c4073455e4bb2aea103157aa92c7a27f75bb11d75bd85914b414076700d3468c062e80dea2966cc62c68779398c44eb64ff791ff399904ab05c1
7
- data.tar.gz: c3051d4e9ef1e226b78c3d486fec6cb2c972c2a0e076d4d68a8e1a74246b36e6496e90e64d0e554e6ad1ce681c705abcb41b644ca0bf0dc6312a3511c3f8d9a8
6
+ metadata.gz: 64a631056bcb1f146451812f20a591fca787188feded58d5b78aebbd4616fe9b52c4e11750fbcdb446b5debd2d5aa391a264d0073deb499583db556f87dabeb5
7
+ data.tar.gz: 1163aebdf5a6439e03ab5fd670e8a4fdd97c05c663c96967687df221eba7ca822cc81915e2ba0351c509118f0ad105f494560fcd4f54b74baf04554f914065aa
@@ -674,18 +674,12 @@
674
674
  @each $color_name, $color_value in $border_color_options {
675
675
  &.column-group-border-#{$color_name} {
676
676
  @if $theme == "light" {
677
- &:not(.advanced-table-no-table-container) {
678
- @include advanced-table-sticky-wrapper-frame($color_value);
679
- }
680
677
  @include advanced-table-sticky-mixin(
681
678
  $color_value,
682
679
  $white,
683
680
  lighten($silver, $opacity_7)
684
681
  );
685
682
  } @else if $theme == "dark" {
686
- &:not(.advanced-table-no-table-container) {
687
- @include advanced-table-sticky-wrapper-frame($color_value);
688
- }
689
683
  @include advanced-table-sticky-mixin(
690
684
  $color_value,
691
685
  $bg_dark_card,
@@ -721,10 +715,6 @@
721
715
  width: 100%;
722
716
  @include scrollbar-styling;
723
717
 
724
- &:not(.advanced-table-no-table-container) {
725
- @include advanced-table-sticky-wrapper-frame($border_light);
726
- }
727
-
728
718
  // These are the responsive borders that should NOT inherit the custom color
729
719
  @include advanced-table-sticky-mixin(
730
720
  $border_light,
@@ -1018,11 +1008,6 @@
1018
1008
  .sticky-left {
1019
1009
  background-color: $bg_dark;
1020
1010
  }
1021
-
1022
- &:not(.advanced-table-no-table-container) {
1023
- @include advanced-table-sticky-wrapper-frame($border_dark);
1024
- }
1025
-
1026
1011
  @include advanced-table-sticky-mixin(
1027
1012
  $border_dark,
1028
1013
  $bg_dark_card,
@@ -1041,10 +1026,6 @@
1041
1026
  }
1042
1027
  }
1043
1028
 
1044
- &:not(.advanced-table-no-table-container) {
1045
- @include advanced-table-sticky-wrapper-frame($border_dark);
1046
- }
1047
-
1048
1029
  // These are the responsive borders that should NOT inherit the custom color
1049
1030
  @include advanced-table-sticky-mixin(
1050
1031
  $border_dark,
@@ -127,8 +127,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
127
127
  fullScreenControl,
128
128
  } = props;
129
129
 
130
- const noTableCardContainer = tableProps?.container === false;
131
-
132
130
  // Component refs
133
131
  const tableWrapperRef = useRef<HTMLDivElement>(null);
134
132
 
@@ -283,7 +281,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
283
281
  'hidden-action-bar': (selectableRows || columnVisibilityControl) && !isActionBarVisible,
284
282
  },
285
283
  {'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
286
- { 'advanced-table-no-table-container': noTableCardContainer },
287
284
  columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
288
285
  scrollBarNone ? 'advanced-table-hide-scrollbar' : '',
289
286
  globalProps(props),
@@ -48,16 +48,9 @@ module Playbook
48
48
  hidden_action_bar_class,
49
49
  ]
50
50
  additional_classes << "column-group-border-#{column_group_border_color}" if column_group_border_color != "none"
51
- additional_classes << "advanced-table-no-table-container" if no_table_card_container?
52
51
  generate_classname("pb_advanced_table", *additional_classes, separator: " ")
53
52
  end
54
53
 
55
- def no_table_card_container?
56
- return false unless table_props.is_a?(Hash)
57
-
58
- table_props[:container] == false || table_props["container"] == false
59
- end
60
-
61
54
  def responsive_classname
62
55
  responsive == "scroll" ? "advanced-table-responsive-scroll" : "advanced-table-responsive-none"
63
56
  end
@@ -30,34 +30,4 @@
30
30
  }
31
31
  ] %>
32
32
 
33
- <%= pb_rails("caption", props: { text: "Default Advanced Table Table Props Doc Example" }) %>
34
- <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
35
-
36
- <%= pb_rails("caption", props: { text: "Advanced Table with just container: false" }) %>
37
- <%= pb_rails("advanced_table", props: { id: "table_props_table_2", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false }}) %>
38
-
39
- <%= pb_rails("caption", props: { text: "Typical set up: Card and Flex around Filter, SectionSeparator, and AdvancedTable with container: false" }) %>
40
- <%= pb_rails("card", props: { padding: "none", margin_bottom: "xl" }) do %>
41
- <%= pb_rails("flex", props: { align: "stretch", orientation: "column", gap: "none" }) do %>
42
- <%= pb_rails("filter", props: {
43
- background: false,
44
- max_height: (@table_data.to_a.size < 10) ? "50vh" : "none",
45
- min_width: "xs",
46
- popover_props: { width: "350px" },
47
- id: "rails-table-props-filter-with-data",
48
- template: "single",
49
- results: @table_data.to_a.size,
50
- }) do %>
51
- <%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
52
- <%= form.number_field :new_leads_eq, props: { label: "New Leads" } %>
53
- <%= form.text_field :conversion_rate_eq, props: { label: "Conversion Rate" } %>
54
- <%= form.actions do |action| %>
55
- <%= action.submit props: { text: "Filter" } %>
56
- <%= action.button props: { type: "reset", text: "Defaults", variant: "secondary" } %>
57
- <% end %>
58
- <% end %>
59
- <% end %>
60
- <%= pb_rails("section_separator") %>
61
- <%= pb_rails("advanced_table", props: { id: "rails_template_advanced_table", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false } }) %>
62
- <% end %>
63
- <% end %>
33
+ <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
@@ -1,13 +1,6 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
- import Button from "../../pb_button/_button"
5
- import Caption from "../../pb_caption/_caption"
6
- import Card from "../../pb_card/_card"
7
- import Filter from "../../pb_filter/_filter"
8
- import Flex from "../../pb_flex/_flex"
9
- import SectionSeparator from "../../pb_section_separator/_section_separator"
10
- import TextInput from "../../pb_text_input/_text_input"
11
4
 
12
5
  const AdvancedTableTableProps = (props) => {
13
6
  const columnDefinitions = [
@@ -47,100 +40,14 @@ const AdvancedTableTableProps = (props) => {
47
40
  verticalBorder: true
48
41
  }
49
42
 
50
- const filterPopoverProps = { width: "350px" }
51
-
52
- const filterForm = (closePopover) => (
53
- <form>
54
- <TextInput
55
- label="New Leads"
56
- name="new_leads_eq"
57
- placeholder="0"
58
- type="number"
59
- {...props}
60
- />
61
- <TextInput
62
- label="Conversion Rate"
63
- name="conversion_rate_eq"
64
- placeholder="e.g. 12%"
65
- {...props}
66
- />
67
- <Flex
68
- spacing="between"
69
- {...props}
70
- >
71
- <Button
72
- onClick={closePopover}
73
- text="Filter"
74
- {...props}
75
- />
76
- <Button
77
- text="Defaults"
78
- type="reset"
79
- variant="secondary"
80
- {...props}
81
- />
82
- </Flex>
83
- </form>
84
- )
85
-
86
43
  return (
87
44
  <div>
88
- <Caption
89
- text="Default Advanced Table Table Props Doc Example"
90
- />
91
45
  <AdvancedTable
92
46
  columnDefinitions={columnDefinitions}
93
- marginBottom="md"
94
47
  tableData={MOCK_DATA}
95
48
  tableProps={tableProps}
96
49
  {...props}
97
50
  />
98
- <Caption
99
- text="Advanced Table with just container: false"
100
- />
101
- <AdvancedTable
102
- columnDefinitions={columnDefinitions}
103
- marginBottom="md"
104
- tableData={MOCK_DATA}
105
- tableProps={{container: false}}
106
- {...props}
107
- />
108
-
109
- <Caption
110
- text="Typical set up: Card and Flex around Filter, SectionSeparator, and AdvancedTable with container: false"
111
- />
112
- <Card
113
- marginBottom="xl"
114
- padding="none"
115
- {...props}
116
- >
117
- <Flex
118
- align="stretch"
119
- gap="none"
120
- orientation="column"
121
- {...props}
122
- >
123
- <Filter
124
- background={false}
125
- id="react-table-props-filter-with-data"
126
- maxHeight={MOCK_DATA.length < 10 ? "50vh" : "none"}
127
- minWidth="xs"
128
- popoverProps={filterPopoverProps}
129
- results={MOCK_DATA.length}
130
- {...props}
131
- >
132
- {({ closePopover }) => filterForm(closePopover)}
133
- </Filter>
134
- <SectionSeparator {...props} />
135
- <AdvancedTable
136
- columnDefinitions={columnDefinitions}
137
- id="react_template_advanced_table"
138
- tableData={MOCK_DATA}
139
- tableProps={{container: false}}
140
- {...props}
141
- />
142
- </Flex>
143
- </Card>
144
51
  </div>
145
52
  )
146
53
  }
@@ -1,9 +1,3 @@
1
- // Acts as outer “card frame” on the advanced-table wrapper (table-card from Table) is included from `_advanced_table.scss` only when `:not(.advanced-table-no-table-container)`/container: false is not present.
2
- @mixin advanced-table-sticky-wrapper-frame($border-color) {
3
- border-radius: 4px;
4
- box-shadow: 1px 0 0 0px $border-color, -1px 0 0 0px $border-color;
5
- }
6
-
7
1
  @mixin advanced-table-sticky-mixin(
8
2
  $border-color,
9
3
  $bg-main,
@@ -11,6 +5,8 @@
11
5
  $highlight: #E5EEFA,
12
6
  $highlight-dark: #202850,
13
7
  ) {
8
+ border-radius: 4px;
9
+ box-shadow: 1px 0 0 0px $border-color, -1px 0 0 0px $border-color;
14
10
  display: block;
15
11
  [class^="pb_table"].table-sm.table-card thead tr th:first-child,
16
12
  [class^="pb_table"].table-sm:not(.no-hover).table-card
@@ -43,6 +43,11 @@ $pb_button_styles: (
43
43
  @include pb_circle_icon_button;
44
44
  }
45
45
  }
46
+
47
+ .pb_button_kit.pb_button_loading svg.loading-icon {
48
+ position: absolute;
49
+ }
50
+
46
51
  :first-child {
47
52
  &.pb_button_kit.pb_button_link {
48
53
  @include pb_circle_icon_button_active;
@@ -27,3 +27,28 @@
27
27
  icon: "user",
28
28
  loading: true
29
29
  }) %>
30
+
31
+
32
+ <%= pb_rails("button", props: { margin_top: "md", text: "Open Dialog to confirm PLAY-2837 fix still works", data: {"open-dialog": "dialog-1"} }) %>
33
+
34
+ <%= pb_rails("dialog", props: {
35
+ id:"dialog-1",
36
+ size: "md",
37
+ title: "Header Title is the Title Prop"
38
+ }) do %>
39
+ <%= pb_rails("dialog/dialog_body") do %>
40
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg", text: "Button Primary" }) %>
41
+ <%= pb_rails("circle_icon_button", props: { loading: true, icon: "plus" }) %>
42
+ <div style="height: 800px; background-color: lightgray;"></div>
43
+ <%= pb_rails("button", props: { loading: true, text: "Loading..." }) %>
44
+ <%= pb_rails("circle_icon_button", props: { loading: true, icon: "plus" }) %>
45
+ <% end %>
46
+
47
+ <%= pb_rails("dialog/dialog_footer") do %>
48
+ <%= pb_rails("flex", props: { spacing: "between", padding_x: "md", padding_bottom: "md", padding: "sm" }) do %>
49
+ <%= pb_rails("button", props: { loading: true, text: "Send My Issue" }) %>
50
+ <%= pb_rails("circle_icon_button", props: { loading: true, icon: "plus" }) %>
51
+ <%= pb_rails("button", props: { text: "Back", variant: "link", data: {"close-dialog": "dialog-1"} }) %>
52
+ <% end %>
53
+ <% end %>
54
+ <% end %>
@@ -1,43 +1,102 @@
1
- import React from 'react'
1
+ import React, { useState } from 'react'
2
2
 
3
3
  import CircleIconButton from '../_circle_icon_button'
4
+ import Dialog from '../../pb_dialog/_dialog'
5
+ import Button from '../../pb_button/_button'
4
6
 
5
- const CircleIconButtonLoading = (props) => (
6
- <div>
7
- <CircleIconButton
8
- icon="plus"
9
- loading
10
- variant="primary"
11
- {...props}
12
- />
13
-
14
- <br />
15
-
16
- <CircleIconButton
17
- icon="pen"
18
- loading
19
- variant="secondary"
20
- {...props}
21
- />
22
-
23
- <br />
24
-
25
- <CircleIconButton
26
- disabled
27
- icon="times"
28
- loading
29
- {...props}
30
- />
31
-
32
- <br />
33
-
34
- <CircleIconButton
35
- icon="user"
36
- loading
37
- variant="link"
38
- {...props}
39
- />
40
- </div>
41
- )
7
+ const CircleIconButtonLoading = (props) => {
8
+
9
+
10
+ const [isOpen, setIsOpen] = useState(false)
11
+ const close = () => setIsOpen(false)
12
+ const open = () => setIsOpen(true)
13
+
14
+ return (
15
+ <div>
16
+ <CircleIconButton
17
+ icon="plus"
18
+ loading
19
+ variant="primary"
20
+ {...props}
21
+ />
22
+
23
+ <br />
24
+
25
+ <CircleIconButton
26
+ icon="pen"
27
+ loading
28
+ variant="secondary"
29
+ {...props}
30
+ />
31
+
32
+ <br />
33
+
34
+ <CircleIconButton
35
+ disabled
36
+ icon="times"
37
+ loading
38
+ {...props}
39
+ />
40
+
41
+ <br />
42
+
43
+ <CircleIconButton
44
+ icon="user"
45
+ loading
46
+ variant="link"
47
+ {...props}
48
+ />
49
+ <>
50
+ <Button marginTop="md"
51
+ onClick={open}
52
+ >
53
+ {'Open Dialog to confirm PLAY-2837 fix still works for circle icon buttons'}
54
+ </Button>
55
+ <Dialog
56
+ onCancel={close}
57
+ onClose={close}
58
+ onConfirm={close}
59
+ opened={isOpen}
60
+ size="md"
61
+ title="Header Title is the Title Prop"
62
+ >
63
+ <Dialog.Body>
64
+ <Button
65
+ aria={{ label: 'Loading' }}
66
+ loading
67
+ text="Button Primary"
68
+ />
69
+ <CircleIconButton
70
+ icon="plus"
71
+ loading
72
+ />
73
+ <div style={{height: '800px', backgroundColor: 'lightgray'}} />
74
+ <Button
75
+ loading
76
+ text="Loading..."
77
+ />
78
+ <CircleIconButton
79
+ icon="plus"
80
+ loading
81
+ />
82
+ </Dialog.Body>
83
+ <Dialog.Footer>
84
+ <Button
85
+ loading
86
+ text="Send My Issue"
87
+ />
88
+ <CircleIconButton
89
+ icon="plus"
90
+ loading
91
+ />
92
+ <Button variant="link">
93
+ {"Back"}
94
+ </Button>
95
+ </Dialog.Footer>
96
+ </Dialog>
97
+ </>
98
+ </div>
99
+ )
100
+ }
42
101
 
43
102
  export default CircleIconButtonLoading