playbook_ui 10.26.0.pre.alpha.sticky1 → 10.26.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/data/menu.yml +1 -0
  4. data/app/pb_kits/playbook/index.js +2 -1
  5. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +3 -3
  6. data/app/pb_kits/playbook/pb_background/{_background.jsx → _background.tsx} +20 -13
  7. data/app/pb_kits/playbook/pb_badge/{_badge.jsx → _badge.tsx} +14 -15
  8. data/app/pb_kits/playbook/pb_badge/docs/_badge_colors.jsx +1 -1
  9. data/app/pb_kits/playbook/pb_badge/docs/_badge_default.jsx +1 -1
  10. data/app/pb_kits/playbook/pb_badge/docs/_badge_rounded.jsx +1 -1
  11. data/app/pb_kits/playbook/pb_badge/docs/index.js +3 -3
  12. data/app/pb_kits/playbook/pb_body/_body.tsx +9 -9
  13. data/app/pb_kits/playbook/pb_button/{_button.jsx → _button.tsx} +65 -46
  14. data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +1 -0
  15. data/app/pb_kits/playbook/pb_button/docs/_button_options.jsx +1 -1
  16. data/app/pb_kits/playbook/pb_caption/{_caption.jsx → _caption.tsx} +7 -8
  17. data/app/pb_kits/playbook/pb_card/{_card.jsx → _card.tsx} +20 -18
  18. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -0
  19. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +1 -1
  20. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.jsx +1 -1
  21. data/app/pb_kits/playbook/pb_card/docs/_card_border_radius.jsx +1 -1
  22. data/app/pb_kits/playbook/pb_card/docs/_card_light.jsx +1 -1
  23. data/app/pb_kits/playbook/pb_card/docs/_card_selected.jsx +1 -1
  24. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.jsx +4 -2
  25. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -1
  26. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +37 -0
  27. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +37 -0
  28. data/app/pb_kits/playbook/pb_flex/{_flex.jsx → _flex.tsx} +5 -5
  29. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
  30. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
  31. data/app/pb_kits/playbook/pb_icon/{_icon.jsx → _icon.tsx} +40 -30
  32. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  33. data/app/pb_kits/playbook/pb_pill/{_pill.jsx → _pill.tsx} +6 -8
  34. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.jsx +1 -1
  35. data/app/pb_kits/playbook/pb_pill/docs/_pill_variants.jsx +1 -1
  36. data/app/pb_kits/playbook/pb_title/{_title.jsx → _title.tsx} +10 -12
  37. data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
  38. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +79 -0
  39. data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
  40. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
  41. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
  42. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
  43. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
  44. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
  45. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
  46. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
  47. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
  48. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
  49. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
  50. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
  51. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
  52. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
  53. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
  54. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
  55. data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
  56. data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
  57. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +1 -0
  58. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +43 -0
  59. data/app/pb_kits/playbook/pb_user/{_user.jsx → _user.tsx} +20 -24
  60. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  61. data/app/pb_kits/playbook/playbook-rails-react-bindings.js +2 -0
  62. data/app/pb_kits/playbook/plugins/pb_chart.js +34 -0
  63. data/app/pb_kits/playbook/tokens/_colors.scss +2 -1
  64. data/app/pb_kits/playbook/tokens/_display.scss +13 -0
  65. data/app/pb_kits/playbook/tokens/_screen_sizes.scss +36 -0
  66. data/app/pb_kits/playbook/utilities/_align_content.scss +10 -29
  67. data/app/pb_kits/playbook/utilities/_align_items.scss +11 -35
  68. data/app/pb_kits/playbook/utilities/_align_self.scss +10 -29
  69. data/app/pb_kits/playbook/utilities/_display.scss +26 -2
  70. data/app/pb_kits/playbook/utilities/_flex.scss +19 -14
  71. data/app/pb_kits/playbook/utilities/_flex_direction.scss +7 -18
  72. data/app/pb_kits/playbook/utilities/_flex_grow.scss +5 -8
  73. data/app/pb_kits/playbook/utilities/_flex_shrink.scss +5 -8
  74. data/app/pb_kits/playbook/utilities/_flex_wrap.scss +6 -13
  75. data/app/pb_kits/playbook/utilities/_justify_content.scss +10 -23
  76. data/app/pb_kits/playbook/utilities/_justify_self.scss +9 -19
  77. data/app/pb_kits/playbook/utilities/_mixins.scss +26 -0
  78. data/app/pb_kits/playbook/utilities/_order.scss +17 -55
  79. data/app/pb_kits/playbook/utilities/globalProps.ts +150 -121
  80. data/app/pb_kits/playbook/utilities/props.ts +2 -2
  81. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +37 -0
  82. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +36 -0
  83. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +37 -0
  84. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +38 -0
  85. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +64 -0
  86. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +37 -0
  87. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +35 -0
  88. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +35 -0
  89. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +37 -0
  90. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +37 -0
  91. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +37 -0
  92. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +35 -0
  93. data/app/pb_kits/playbook/utilities/test-utils.js +2 -0
  94. data/app/pb_kits/playbook/utilities/text.ts +22 -0
  95. data/dist/reset.css +1 -60
  96. data/lib/playbook/align_content.rb +11 -3
  97. data/lib/playbook/align_items.rb +10 -2
  98. data/lib/playbook/align_self.rb +9 -1
  99. data/lib/playbook/display.rb +19 -7
  100. data/lib/playbook/flex.rb +9 -1
  101. data/lib/playbook/flex_direction.rb +10 -2
  102. data/lib/playbook/flex_grow.rb +9 -1
  103. data/lib/playbook/flex_shrink.rb +9 -1
  104. data/lib/playbook/flex_wrap.rb +10 -2
  105. data/lib/playbook/justify_content.rb +10 -2
  106. data/lib/playbook/justify_self.rb +9 -1
  107. data/lib/playbook/order.rb +10 -2
  108. data/lib/playbook/pb_kit_helper.rb +6 -1
  109. data/lib/playbook/version.rb +2 -2
  110. metadata +52 -17
  111. data/app/pb_kits/playbook/utilities/text.js +0 -15
@@ -17,6 +17,26 @@ $breakpoints: (
17
17
  xl: $screen-xl-min
18
18
  );
19
19
 
20
+ $breakpoints_grid: (
21
+ xs: (
22
+ max: $screen-xs-min
23
+ ),
24
+ sm: (
25
+ min: $screen-sm-min,
26
+ max: $screen-md-max
27
+ ),
28
+ md: (
29
+ min: $screen-md-min,
30
+ max: $screen-lg-max
31
+ ),
32
+ lg: (
33
+ min: $screen-lg-min,
34
+ max: $screen-xl-max
35
+ ),
36
+ xl: (
37
+ min: $screen-xl-min,
38
+ )
39
+ );
20
40
 
21
41
  @function breakpoint($breakpoint_name) {
22
42
  @return map-get($breakpoints, $breakpoint_name);
@@ -28,3 +48,19 @@ $breakpoints: (
28
48
  @content;
29
49
  }
30
50
  }
51
+
52
+ @mixin break_on($min: null, $max: null) {
53
+ @if not $max {
54
+ @media screen and (min-width: $min) {
55
+ @content;
56
+ }
57
+ } @else if not $min {
58
+ @media screen and (max-width: $max) {
59
+ @content;
60
+ }
61
+ } @else {
62
+ @media screen and (min-width: $min) and (max-width: $max) {
63
+ @content;
64
+ }
65
+ }
66
+ }
@@ -1,29 +1,10 @@
1
- .align_content_start {
2
- display: flex;
3
- align-content: start !important;
4
- }
5
-
6
- .align_content_end {
7
- display: flex;
8
- align-content: end !important;
9
- }
10
-
11
- .align_content_center {
12
- display: flex;
13
- align-content: center !important;
14
- }
15
-
16
- .align_content_space_between {
17
- display: flex;
18
- align-content: space-between !important;
19
- }
20
-
21
- .align_content_space_around {
22
- display: flex;
23
- align-content: space-around !important;
24
- }
25
-
26
- .align_content_space_evenly {
27
- display: flex;
28
- align-content: space-evenly !important;
29
- }
1
+ $align_content_values: (
2
+ start: start,
3
+ end: end,
4
+ center: center,
5
+ space_between: space-between,
6
+ space_around: space-around,
7
+ space_evenly: space-evenly
8
+ );
9
+
10
+ @include global_props_responsive_css($align_content_values, 'align_content', 'align-content');
@@ -1,35 +1,11 @@
1
- .align_items_flex_start {
2
- display: flex;
3
- align-items: flex-start !important;
4
- }
5
-
6
- .align_items_flex_end {
7
- display: flex;
8
- align-items: flex-end !important;
9
- }
10
-
11
- .align_items_start {
12
- display: flex;
13
- align-items: start !important;
14
- }
15
-
16
- .align_items_end {
17
- display: flex;
18
- align-items: end !important;
19
- }
20
-
21
-
22
- .align_items_center {
23
- display: flex;
24
- align-items: center !important;
25
- }
26
-
27
- .align_items_baseline {
28
- display: flex;
29
- align-items: baseline !important;
30
- }
31
-
32
- .align_items_stretch {
33
- display: flex;
34
- align-items: stretch !important;
35
- }
1
+ $align_items_values: (
2
+ flex_start: flex-start,
3
+ flex_end: flex-end,
4
+ start: start,
5
+ center: center,
6
+ end: end,
7
+ baseline: baseline,
8
+ stretch: stretch,
9
+ );
10
+
11
+ @include global_props_responsive_css($align_items_values, 'align_items', 'align-items');
@@ -1,29 +1,10 @@
1
- .align_self_start {
2
- display: flex;
3
- align-self: start !important;
4
- }
5
-
6
- .align_self_end {
7
- display: flex;
8
- align-self: end !important;
9
- }
10
-
11
- .align_self_auto {
12
- display: flex;
13
- align-self: auto !important;
14
- }
15
-
16
- .align_self_center {
17
- display: flex;
18
- align-self: center !important;
19
- }
20
-
21
- .align_self_stretch {
22
- display: flex;
23
- align-self: stretch !important;
24
- }
25
-
26
- .align_self_baseline {
27
- display: flex;
28
- align-self: baseline !important;
29
- }
1
+ $align_self_values: (
2
+ auto: auto,
3
+ start: start,
4
+ center: center,
5
+ end: end,
6
+ baseline: baseline,
7
+ stretch: stretch,
8
+ );
9
+
10
+ @include global_props_responsive_css($align_self_values, 'align_self', 'align-self');
@@ -1,3 +1,5 @@
1
+ @import "../tokens/display";
2
+
1
3
  .display_block {
2
4
  display: block;
3
5
  }
@@ -18,6 +20,28 @@
18
20
  display: inline-flex;
19
21
  }
20
22
 
21
- .display_hidden {
23
+ .display_none {
22
24
  display: none;
23
- }
25
+ }
26
+
27
+ $display_values: (
28
+ none: $display_none,
29
+ flex: $display_flex,
30
+ inline: $display_inline,
31
+ inline_block: $display_inline_block,
32
+ inline_flex: $display_inline_flex,
33
+ block: $display_block
34
+ );
35
+
36
+ // using a grid here
37
+ @each $size, $size_value in $breakpoints_grid {
38
+ @each $display, $display_value in $display_values {
39
+ $min_size: map-get($size_value, "min");
40
+ $max_size: map-get($size_value, "max");
41
+ .display_#{$size}_#{$display} {
42
+ @include break_on($min_size, $max_size) {
43
+ display: #{$display_value} !important;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -1,15 +1,20 @@
1
- .flex_auto {
2
- flex: auto !important;
3
- }
1
+ $flex_values: (
2
+ auto: auto,
3
+ initial: initial,
4
+ none: none,
5
+ 0: 0,
6
+ 1: 1,
7
+ 2: 2,
8
+ 3: 3,
9
+ 4: 4,
10
+ 5: 5,
11
+ 6: 6,
12
+ 7: 7,
13
+ 8: 8,
14
+ 9: 9,
15
+ 10: 10,
16
+ 11: 11,
17
+ 12: 12,
18
+ );
4
19
 
5
- .flex_initial {
6
- flex: initial !important;
7
- }
8
-
9
- .flex_none {
10
- flex: none !important;
11
- }
12
-
13
- .flex_1 {
14
- flex: 1 !important;
15
- }
20
+ @include global_props_responsive_css($flex_values, 'flex', 'flex');
@@ -1,19 +1,8 @@
1
- .flex_direction_row {
2
- display: flex;
3
- flex-direction: row !important;
4
- }
1
+ $flex_direction_values: (
2
+ row: row,
3
+ column: column,
4
+ row_reverse: row-reverse,
5
+ column_reverse: column-reverse
6
+ );
5
7
 
6
- .flex_direction_column {
7
- display: flex;
8
- flex-direction: column !important;
9
- }
10
-
11
- .flex_direction_row_reverse {
12
- display: flex;
13
- flex-direction: row-reverse !important;
14
- }
15
-
16
- .flex_direction_column_reverse {
17
- display: flex;
18
- flex-direction: column-reverse !important;
19
- }
8
+ @include global_props_responsive_css($flex_direction_values, 'flex_direction', 'flex-direction');
@@ -1,9 +1,6 @@
1
- .flex_grow_1 {
2
- display: flex;
3
- flex-grow: 1 !important;
4
- }
1
+ $flex_grow_values: (
2
+ 0: 0,
3
+ 1: 1,
4
+ );
5
5
 
6
- .flex_grow_0 {
7
- display: flex;
8
- flex-grow: 0 !important;
9
- }
6
+ @include global_props_responsive_css($flex_grow_values, 'flex_grow', 'flex-grow');
@@ -1,9 +1,6 @@
1
- .flex_shrink_1 {
2
- display: flex;
3
- flex-shrink: 1 !important;
4
- }
1
+ $flex_shrink_values: (
2
+ 0: 0,
3
+ 1: 1,
4
+ );
5
5
 
6
- .flex_shrink_0 {
7
- display: flex;
8
- flex-shrink: 0 !important;
9
- }
6
+ @include global_props_responsive_css($flex_shrink_values, 'flex_shrink', 'flex-shrink');
@@ -1,14 +1,7 @@
1
- .flex_wrap_wrap {
2
- display: flex;
3
- flex-wrap: wrap !important;
4
- }
1
+ $flex_wrap_values: (
2
+ wrap: wrap,
3
+ nowrap: nowrap,
4
+ wrap_reverse: wrap-reverse,
5
+ );
5
6
 
6
- .flex_wrap_nowrap {
7
- display: flex;
8
- flex-wrap: nowrap !important;
9
- }
10
-
11
- .flex_wrap_wrap_reverse {
12
- display: flex;
13
- flex-wrap: wrap-reverse !important;
14
- }
7
+ @include global_props_responsive_css($flex_wrap_values, 'flex_wrap', 'flex-wrap');
@@ -1,23 +1,10 @@
1
- .justify_content_start {
2
- justify-content: start !important;
3
- }
4
-
5
- .justify_content_end {
6
- justify-content: end !important;
7
- }
8
-
9
- .justify_content_center {
10
- justify-content: center !important;
11
- }
12
-
13
- .justify_content_space_between {
14
- justify-content: space-between !important;
15
- }
16
-
17
- .justify_content_space_around {
18
- justify-content: space-around !important;
19
- }
20
-
21
- .justify_content_space_evenly {
22
- justify-content: space-evenly !important;
23
- }
1
+ $justify_content_values: (
2
+ start: start,
3
+ center: center,
4
+ end: end,
5
+ space_around: space-around,
6
+ space_between: space-between,
7
+ space_evenly: space-evenly,
8
+ );
9
+
10
+ @include global_props_responsive_css($justify_content_values, 'justify_content', 'justify-content');
@@ -1,19 +1,9 @@
1
- .justify_self_auto {
2
- justify-self: auto !important;
3
- }
4
-
5
- .justify_self_start {
6
- justify-self: start !important;
7
- }
8
-
9
- .justify_self_end {
10
- justify-self: end !important;
11
- }
12
-
13
- .justify_self_center {
14
- justify-self: center !important;
15
- }
16
-
17
- .justify_self_stretch {
18
- justify-self: stretch !important;
19
- }
1
+ $justify_self_values: (
2
+ auto: auto,
3
+ start: start,
4
+ center: center,
5
+ end: end,
6
+ stretch: stretch,
7
+ );
8
+
9
+ @include global_props_responsive_css($justify_self_values, 'justify_self', 'justify-self');
@@ -0,0 +1,26 @@
1
+ @mixin global_props_css($props, $class_prefix, $css_attribute, $responsive) {
2
+ @each $propkey, $propvalue in $props {
3
+ .#{$class_prefix}_#{$propkey} {
4
+ #{$css_attribute}: #{$propvalue} !important;
5
+ @content;
6
+ }
7
+ }
8
+
9
+ @if $responsive {
10
+ @each $size, $size_value in $breakpoints_grid {
11
+ @each $prop_key, $prop_value in $props {
12
+ $min_size: map-get($size_value, "min");
13
+ $max_size: map-get($size_value, "max");
14
+ .#{$class_prefix}_#{$size}_#{$prop_key} {
15
+ @include break_on($min_size, $max_size) {
16
+ #{$css_attribute}: #{$prop_value} !important;
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ @mixin global_props_responsive_css($props, $class_prefix, $css_attribute) {
25
+ @include global_props_css($props, $class_prefix, $css_attribute, 1)
26
+ }
@@ -1,55 +1,17 @@
1
- .order_1 {
2
- order: 1 !important;
3
- }
4
-
5
- .order_2 {
6
- order: 2 !important;
7
- }
8
-
9
- .order_3 {
10
- order: 3 !important;
11
- }
12
-
13
- .order_4 {
14
- order: 4 !important;
15
- }
16
-
17
- .order_5 {
18
- order: 5 !important;
19
- }
20
-
21
- .order_6 {
22
- order: 6 !important;
23
- }
24
-
25
- .order_7 {
26
- order: 7 !important;
27
- }
28
-
29
- .order_8 {
30
- order: 8 !important;
31
- }
32
-
33
- .order_9 {
34
- order: 9 !important;
35
- }
36
-
37
- .order_10 {
38
- order: 10 !important;
39
- }
40
-
41
- .order_11 {
42
- order: 11 !important;
43
- }
44
-
45
- .order_12 {
46
- order: 12 !important;
47
- }
48
-
49
- .order_none {
50
- order: none !important;
51
- }
52
-
53
- .order_first {
54
- order: -1 !important;
55
- }
1
+ $order_values: (
2
+ 0: 0,
3
+ 1: 1,
4
+ 2: 2,
5
+ 3: 3,
6
+ 4: 4,
7
+ 5: 5,
8
+ 6: 6,
9
+ 7: 7,
10
+ 8: 8,
11
+ 9: 9,
12
+ 10: 10,
13
+ 11: 11,
14
+ 12: 12,
15
+ );
16
+
17
+ @include global_props_responsive_css($order_values, 'flex_order', 'order');