playbook_ui 14.25.0.pre.alpha.PLAY2361datepickerarrownav9708 → 14.25.0.pre.alpha.testingcss9713

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 (186) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -6
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
  5. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +60 -65
  6. data/app/pb_kits/playbook/pb_background/_background.scss +3 -3
  7. data/app/pb_kits/playbook/pb_badge/_badge.scss +30 -32
  8. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -1
  9. data/app/pb_kits/playbook/pb_button/_button.scss +13 -13
  10. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +1 -1
  11. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +19 -19
  12. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_dark.scss +15 -15
  13. data/app/pb_kits/playbook/pb_caption/_caption.scss +1 -1
  14. data/app/pb_kits/playbook/pb_card/_card.scss +79 -68
  15. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +4 -4
  16. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -1
  17. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +5 -5
  18. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +1 -1
  19. data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +3 -3
  20. data/app/pb_kits/playbook/pb_currency/_currency.scss +30 -30
  21. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.scss +1 -1
  22. data/app/pb_kits/playbook/pb_date/_date.scss +5 -5
  23. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +1 -1
  24. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +19 -0
  25. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -0
  26. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +3 -15
  27. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +2 -2
  28. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +2 -2
  29. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_time_selection_styles.scss +5 -5
  30. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +13 -13
  31. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.scss +1 -1
  32. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.scss +13 -13
  33. data/app/pb_kits/playbook/pb_date_time/_date_time.scss +6 -6
  34. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +6 -6
  35. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.scss +7 -7
  36. data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
  37. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +61 -252
  38. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.scss +3 -3
  39. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -1
  40. data/app/pb_kits/playbook/pb_filter/_filter.scss +7 -7
  41. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +2 -2
  42. data/app/pb_kits/playbook/pb_flex/_flex.scss +106 -100
  43. data/app/pb_kits/playbook/pb_flex/_flex.tsx +38 -28
  44. data/app/pb_kits/playbook/pb_flex/_flex_item.scss +146 -51
  45. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +19 -8
  46. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.html.erb +12 -1
  47. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.jsx +26 -1
  48. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_rails.md +11 -0
  49. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_react.md +11 -0
  50. data/app/pb_kits/playbook/pb_flex/flex.rb +73 -39
  51. data/app/pb_kits/playbook/pb_flex/flex_item.rb +51 -6
  52. data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +1 -1
  53. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +47 -47
  54. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +5 -5
  55. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +5 -5
  56. data/app/pb_kits/playbook/pb_hashtag/_hashtag.scss +1 -1
  57. data/app/pb_kits/playbook/pb_highlight/_highlight.scss +1 -1
  58. data/app/pb_kits/playbook/pb_icon/_icon.scss +4 -0
  59. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +2 -2
  60. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +15 -15
  61. data/app/pb_kits/playbook/pb_icon_value/_icon_value.scss +6 -6
  62. data/app/pb_kits/playbook/pb_image/_image.scss +1 -1
  63. data/app/pb_kits/playbook/pb_label_pill/_label_pill.scss +1 -1
  64. data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -2
  65. data/app/pb_kits/playbook/pb_layout/_layout.scss +330 -305
  66. data/app/pb_kits/playbook/pb_layout/_layout.tsx +14 -11
  67. data/app/pb_kits/playbook/pb_layout/body.rb +1 -1
  68. data/app/pb_kits/playbook/pb_layout/footer.rb +1 -1
  69. data/app/pb_kits/playbook/pb_layout/header.rb +1 -1
  70. data/app/pb_kits/playbook/pb_layout/item.rb +1 -7
  71. data/app/pb_kits/playbook/pb_layout/layout.rb +16 -25
  72. data/app/pb_kits/playbook/pb_layout/layout.test.js +3 -3
  73. data/app/pb_kits/playbook/pb_layout/sidebar.rb +1 -1
  74. data/app/pb_kits/playbook/pb_legend/_legend.scss +1 -1
  75. data/app/pb_kits/playbook/pb_link/_link.scss +4 -4
  76. data/app/pb_kits/playbook/pb_list/_list.scss +8 -8
  77. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.scss +4 -4
  78. data/app/pb_kits/playbook/pb_message/_message.scss +4 -4
  79. data/app/pb_kits/playbook/pb_message/_message_mixins.scss +2 -2
  80. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +2 -2
  81. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +2 -2
  82. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +9 -9
  83. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +8 -8
  84. data/app/pb_kits/playbook/pb_online_status/_online_status.scss +2 -2
  85. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +2 -2
  86. data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +1 -1
  87. data/app/pb_kits/playbook/pb_person/_person.scss +1 -1
  88. data/app/pb_kits/playbook/pb_pill/_pill.scss +3 -3
  89. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +7 -7
  90. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +10 -10
  91. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +36 -36
  92. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +4 -4
  93. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +12 -12
  94. data/app/pb_kits/playbook/pb_select/_select.scss +3 -3
  95. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
  96. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +7 -7
  97. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +2 -2
  98. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.scss +5 -5
  99. data/app/pb_kits/playbook/pb_source/_source.scss +7 -7
  100. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +1 -1
  101. data/app/pb_kits/playbook/pb_stat_value/_stat_value.scss +2 -2
  102. data/app/pb_kits/playbook/pb_table/styles/_alignment.scss +1 -1
  103. data/app/pb_kits/playbook/pb_table/styles/_content.scss +1 -1
  104. data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +1 -1
  105. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +1 -1
  106. data/app/pb_kits/playbook/pb_table/styles/_hover.scss +1 -1
  107. data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +1 -1
  108. data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +1 -1
  109. data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +1 -1
  110. data/app/pb_kits/playbook/pb_table/styles/_reset.scss +1 -1
  111. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +12 -12
  112. data/app/pb_kits/playbook/pb_table/styles/_side_highlight.scss +2 -2
  113. data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +1 -1
  114. data/app/pb_kits/playbook/pb_table/styles/_striped.scss +1 -1
  115. data/app/pb_kits/playbook/pb_table/styles/_structure.scss +1 -1
  116. data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +1 -1
  117. data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +2 -2
  118. data/app/pb_kits/playbook/pb_table/styles/_table_header.scss +4 -4
  119. data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +1 -1
  120. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +1 -1
  121. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
  122. data/app/pb_kits/playbook/pb_text_input/text_input.rb +15 -0
  123. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +3 -3
  124. data/app/pb_kits/playbook/pb_time/_time.scss +5 -5
  125. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +13 -13
  126. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.scss +3 -3
  127. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +41 -41
  128. data/app/pb_kits/playbook/pb_timestamp/_timestamp.scss +4 -4
  129. data/app/pb_kits/playbook/pb_title/_title.scss +14 -14
  130. data/app/pb_kits/playbook/pb_title_count/_title_count.scss +3 -3
  131. data/app/pb_kits/playbook/pb_title_detail/_title_detail.scss +7 -7
  132. data/app/pb_kits/playbook/pb_toggle/_toggle.scss +1 -1
  133. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +1 -1
  134. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
  135. data/app/pb_kits/playbook/pb_user/_user.scss +13 -13
  136. data/app/pb_kits/playbook/pb_user_badge/_user_badge.scss +1 -1
  137. data/app/pb_kits/playbook/utilities/_gap.scss +12 -24
  138. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +2 -0
  139. data/app/pb_kits/playbook/utilities/globalProps.ts +28 -4
  140. data/dist/chunks/{_line_graph-Ccznc59K.js → _line_graph-0Y0wuiB9.js} +1 -1
  141. data/dist/chunks/_typeahead-B2gV75O0.js +6 -0
  142. data/dist/chunks/_weekday_stacked-Dblcf2V8.js +37 -0
  143. data/dist/chunks/{lib-C43ywQsO.js → lib-CY5ZPzic.js} +1 -1
  144. data/dist/chunks/{pb_form_validation-Cqj3itLG.js → pb_form_validation-D3b0JKHH.js} +1 -1
  145. data/dist/chunks/vendor.js +1 -1
  146. data/dist/menu.yml +0 -6
  147. data/dist/playbook-doc.js +2 -2
  148. data/dist/playbook-rails-react-bindings.js +1 -1
  149. data/dist/playbook-rails.js +1 -1
  150. data/dist/playbook.css +1 -1
  151. data/lib/playbook/classnames.rb +2 -0
  152. data/lib/playbook/spacing.rb +53 -1
  153. data/lib/playbook/version.rb +1 -1
  154. metadata +8 -36
  155. data/app/pb_kits/playbook/pb_drawer/_close_icon.tsx +0 -25
  156. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +0 -381
  157. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +0 -231
  158. data/app/pb_kits/playbook/pb_drawer/_drawer_context.tsx +0 -3
  159. data/app/pb_kits/playbook/pb_drawer/context.ts +0 -11
  160. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  161. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -41
  162. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  163. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +0 -78
  164. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -3
  165. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -26
  166. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +0 -20
  167. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +0 -59
  168. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  169. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +0 -61
  170. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +0 -24
  171. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  172. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +0 -54
  173. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  174. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  175. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +0 -99
  176. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -20
  177. data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -7
  178. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +0 -20
  179. data/app/pb_kits/playbook/pb_drawer/drawer.rb +0 -56
  180. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +0 -81
  181. data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +0 -60
  182. data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +0 -21
  183. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  184. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.md +0 -9
  185. data/dist/chunks/_typeahead-QdrWudzd.js +0 -6
  186. data/dist/chunks/_weekday_stacked-DG1VCDDN.js +0 -37
@@ -13,7 +13,7 @@ $confirmation_toast_colors: (
13
13
  tip: transparent,
14
14
  );
15
15
 
16
- [class^=pb_fixed_confirmation_toast_kit] {
16
+ .pb_fixed_confirmation_toast_kit {
17
17
  display: inline-flex;
18
18
  justify-content: center;
19
19
  align-items: center;
@@ -82,7 +82,7 @@ $confirmation_toast_colors: (
82
82
  color: $white;
83
83
  }
84
84
 
85
- &[class*=_multi_line] .pb_fixed_confirmation_toast_text {
85
+ &._multi_line .pb_fixed_confirmation_toast_text {
86
86
  color: $white;
87
87
  overflow: hidden;
88
88
  display: -webkit-box;
@@ -14,129 +14,135 @@ $gapTypes: (
14
14
  gap: gap,
15
15
  columnGap: column-gap,
16
16
  rowGap: row-gap
17
- );
17
+ );
18
18
 
19
- [class^=pb_flex_kit] {
19
+ // Base flex kit
20
+ .pb_flex_kit {
20
21
  display: flex;
21
22
  flex-wrap: nowrap;
23
+ }
22
24
 
23
- // Inline
24
- &[class*=_inline] {
25
- display: inline-flex;
26
- }
25
+ // Inline variant
26
+ .pb_flex_kit_inline {
27
+ display: inline-flex;
28
+ }
27
29
 
28
- // Wrap
29
- &[class*=_wrap] {
30
- flex-wrap: wrap;
31
- }
30
+ // Wrap variant
31
+ .pb_flex_kit_wrap {
32
+ flex-wrap: wrap;
33
+ }
32
34
 
33
- // Orientation
34
- &[class*=_orientation_row] {
35
- flex-direction: row;
35
+ // Orientation
36
+ .pb_flex_kit_orientation_row {
37
+ flex-direction: row;
38
+ }
36
39
 
37
- &[class*=_reverse] {
38
- flex-direction: row-reverse;
39
- }
40
- }
40
+ .pb_flex_kit_orientation_column {
41
+ flex-direction: column;
42
+ }
41
43
 
42
- &[class*=_orientation_column] {
43
- flex-direction: column;
44
+ // Reverse (works with orientation)
45
+ .pb_flex_kit_orientation_row.pb_flex_kit_reverse {
46
+ flex-direction: row-reverse;
47
+ }
44
48
 
45
- &[class*=_reverse] {
46
- flex-direction: column-reverse;
47
- }
48
- }
49
+ .pb_flex_kit_orientation_column.pb_flex_kit_reverse {
50
+ flex-direction: column-reverse;
51
+ }
49
52
 
50
- // Alignment: Justify Content
51
- &[class*=justify_content_left],
52
- &[class*=justify_content_top],
53
- &[class*=justify_content_start] {
54
- justify-content: flex-start;
55
- &[class*=_reverse] {
56
- justify-content: flex-end;
57
- }
58
- }
53
+ // Justify Content
54
+ .pb_flex_kit_justify_content_left,
55
+ .pb_flex_kit_justify_content_top,
56
+ .pb_flex_kit_justify_content_start {
57
+ justify-content: flex-start;
58
+ }
59
59
 
60
- &[class*=justify_content_right],
61
- &[class*=justify_content_bottom],
62
- &[class*=justify_content_end] {
63
- justify-content: flex-end;
64
- &[class*=_reverse] {
65
- justify-content: flex-start;
66
- }
67
- }
60
+ .pb_flex_kit_justify_content_right,
61
+ .pb_flex_kit_justify_content_bottom,
62
+ .pb_flex_kit_justify_content_end {
63
+ justify-content: flex-end;
64
+ }
68
65
 
69
- &[class*=justify_content_center] {
70
- justify-content: center;
71
- }
66
+ .pb_flex_kit_justify_content_center {
67
+ justify-content: center;
68
+ }
72
69
 
70
+ // Justify Content with Reverse
71
+ .pb_flex_kit_justify_content_left.pb_flex_kit_reverse,
72
+ .pb_flex_kit_justify_content_top.pb_flex_kit_reverse,
73
+ .pb_flex_kit_justify_content_start.pb_flex_kit_reverse {
74
+ justify-content: flex-end;
75
+ }
73
76
 
74
- // Alignment: Align Items
75
- &[class*=align_items_left],
76
- &[class*=align_items_top],
77
- &[class*=align_items_start] {
78
- align-items: flex-start;
79
- }
77
+ .pb_flex_kit_justify_content_right.pb_flex_kit_reverse,
78
+ .pb_flex_kit_justify_content_bottom.pb_flex_kit_reverse,
79
+ .pb_flex_kit_justify_content_end.pb_flex_kit_reverse {
80
+ justify-content: flex-start;
81
+ }
80
82
 
81
- &[class*=align_items_right],
82
- &[class*=align_items_bottom],
83
- &[class*=align_items_end] {
84
- align-items: flex-end;
85
- }
83
+ // Align Items
84
+ .pb_flex_kit_align_items_left,
85
+ .pb_flex_kit_align_items_top,
86
+ .pb_flex_kit_align_items_start {
87
+ align-items: flex-start;
88
+ }
86
89
 
87
- &[class*=align_items_center] {
88
- align-items: center;
89
- }
90
+ .pb_flex_kit_align_items_right,
91
+ .pb_flex_kit_align_items_bottom,
92
+ .pb_flex_kit_align_items_end {
93
+ align-items: flex-end;
94
+ }
90
95
 
91
- &[class*=align_items_stretch] {
92
- align-items: stretch;
93
- }
96
+ .pb_flex_kit_align_items_center {
97
+ align-items: center;
98
+ }
94
99
 
95
- &[class*=align_items_baseline] {
96
- align-items: baseline;
97
- }
100
+ .pb_flex_kit_align_items_stretch {
101
+ align-items: stretch;
102
+ }
98
103
 
99
- // Alignment: Align Self - Rails & React
100
- &[class*=align_self_start] {
101
- align-self: flex-start;
102
- }
103
-
104
- &[class*=align_self_end] {
105
- align-self: flex-end;
106
- }
107
-
108
- &[class*=align_self_center] {
109
- align-self: center;
110
- }
111
-
112
- &[class*=align_self_stretch] {
113
- align-self: stretch;
114
- }
104
+ .pb_flex_kit_align_items_baseline {
105
+ align-items: baseline;
106
+ }
115
107
 
116
- // Spacing
117
- &[class*=spacing_around],
118
- &[class*=justify_content_around] {
119
- justify-content: space-around;
120
- }
108
+ // Align Self
109
+ .pb_flex_kit_align_self_start {
110
+ align-self: flex-start;
111
+ }
121
112
 
122
- &[class*=spacing_between],
123
- &[class*=justify_content_between] {
124
- justify-content: space-between;
125
- }
113
+ .pb_flex_kit_align_self_end {
114
+ align-self: flex-end;
115
+ }
126
116
 
127
- &[class*=spacing_evenly],
128
- &[class*=justify_content_evenly] {
129
- justify-content: space-evenly;
130
- }
117
+ .pb_flex_kit_align_self_center {
118
+ align-self: center;
119
+ }
131
120
 
132
- //Gap
133
- @each $gapType, $gapValue in $gapTypes{
134
- @each $sizeName, $sizeValue in $gapSpaces {
135
- &[class*=_#{$gapType}_#{$sizeName}]{
136
- #{$gapValue}: $sizeValue;
137
- }
138
- }
139
- }
121
+ .pb_flex_kit_align_self_stretch {
122
+ align-self: stretch;
123
+ }
140
124
 
125
+ // Spacing
126
+ .pb_flex_kit_spacing_around,
127
+ .pb_flex_kit_justify_content_around {
128
+ justify-content: space-around;
129
+ }
130
+
131
+ .pb_flex_kit_spacing_between,
132
+ .pb_flex_kit_justify_content_between {
133
+ justify-content: space-between;
134
+ }
141
135
 
136
+ .pb_flex_kit_spacing_evenly,
137
+ .pb_flex_kit_justify_content_evenly {
138
+ justify-content: space-evenly;
142
139
  }
140
+
141
+ // Gap utility classes
142
+ @each $gapType, $gapValue in $gapTypes {
143
+ @each $sizeName, $sizeValue in $gapSpaces {
144
+ .pb_flex_kit_#{$gapType}_#{$sizeName} {
145
+ #{$gapValue}: $sizeValue;
146
+ }
147
+ }
148
+ }
@@ -4,6 +4,9 @@ import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
5
5
  import { GenericObject, Sizes } from '../types'
6
6
 
7
+ type SizeType = Sizes | "none"
8
+ type SizeResponsiveType = { [key: string]: SizeType }
9
+
7
10
  type FlexProps = {
8
11
  children: React.ReactChild[] | React.ReactNode,
9
12
  className?: string,
@@ -18,9 +21,9 @@ type FlexProps = {
18
21
  reverse?: boolean,
19
22
  vertical?: "top" | "center" | "bottom" | "stretch" | "baseline" | "none",
20
23
  align?: "start" | "center" | "end" | "stretch" | "baseline" | "none",
21
- gap?: Sizes | "none",
22
- rowGap?: Sizes| "none",
23
- columnGap?: Sizes| "none",
24
+ gap?: SizeType | SizeResponsiveType,
25
+ rowGap?: SizeType | SizeResponsiveType,
26
+ columnGap?: SizeType | SizeResponsiveType,
24
27
  wrap?: boolean,
25
28
  alignSelf?: "start" | "end" | "center" | "stretch" | "none"
26
29
  } & GlobalProps
@@ -47,18 +50,24 @@ const Flex = (props: FlexProps): React.ReactElement => {
47
50
  } = props
48
51
 
49
52
  const orientationClass =
50
- orientation !== undefined ? `orientation_${orientation}` : ''
53
+ orientation !== undefined ? `pb_flex_kit_orientation_${orientation}` : ''
51
54
  const justifyClass =
52
- justify !== 'none' ? `justify_content_${justify}` : `justify_content_${horizontal}`
53
- const alignClass = align !== 'none' ? `align_items_${align}` : `align_items_${vertical}`
54
- const inlineClass = inline === true ? 'inline' : ''
55
- const spacingClass = spacing !== undefined ? `spacing_${spacing}` : ''
56
- const gapClass = gap !== 'none' ? `gap_${gap}` : ''
57
- const rowGapClass = rowGap !== 'none' ? `rowGap_${rowGap}` : ''
58
- const columnGapClass = columnGap !== 'none' ? `columnGap_${columnGap}` : ''
59
- const wrapClass = wrap === true ? 'wrap' : ''
60
- const reverseClass = reverse === true ? 'reverse' : ''
61
- const alignSelfClass = alignSelf !== 'none' ? `align_self_${alignSelf}` : ''
55
+ justify !== 'none' ? `pb_flex_kit_justify_content_${justify}` : `pb_flex_kit_justify_content_${horizontal}`
56
+ const alignClass = align !== 'none' ? `pb_flex_kit_align_items_${align}` : `pb_flex_kit_align_items_${vertical}`
57
+ const inlineClass = inline === true ? 'pb_flex_kit_inline' : ''
58
+ const spacingClass = spacing !== undefined ? `pb_flex_kit_spacing_${spacing}` : ''
59
+ const gapClass = gap !== 'none' && typeof gap === 'string' ? `pb_flex_kit_gap_${gap}` : ''
60
+ const rowGapClass = rowGap !== 'none' && typeof rowGap === 'string' ? `pb_flex_kit_rowGap_${rowGap}` : ''
61
+ const columnGapClass = columnGap !== 'none' && typeof columnGap === 'string' ? `pb_flex_kit_columnGap_${columnGap}` : ''
62
+
63
+ // Responsive gap classes
64
+ const responsiveGapClass = (gap !== 'none' && typeof gap === 'object' && gap !== null && !Array.isArray(gap)) ? 'pb_flex_kit_gap_responsive' : ''
65
+ const responsiveRowGapClass = (rowGap !== 'none' && typeof rowGap === 'object' && rowGap !== null && !Array.isArray(rowGap)) ? 'pb_flex_kit_rowGap_responsive' : ''
66
+ const responsiveColumnGapClass = (columnGap !== 'none' && typeof columnGap === 'object' && columnGap !== null && !Array.isArray(columnGap)) ? 'pb_flex_kit_columnGap_responsive' : ''
67
+
68
+ const wrapClass = wrap === true ? 'pb_flex_kit_wrap' : ''
69
+ const reverseClass = reverse === true ? 'pb_flex_kit_reverse' : ''
70
+ const alignSelfClass = alignSelf !== 'none' ? `pb_flex_kit_align_self_${alignSelf}` : ''
62
71
  const dataProps = buildDataProps(data)
63
72
  const htmlProps = buildHtmlProps(htmlOptions)
64
73
  const dynamicInlineProps = globalInlineProps(props)
@@ -67,20 +76,21 @@ const Flex = (props: FlexProps): React.ReactElement => {
67
76
  return (
68
77
  <div
69
78
  className={classnames(
70
- buildCss(
71
- 'pb_flex_kit',
72
- orientationClass,
73
- justifyClass,
74
- alignClass,
75
- inlineClass,
76
- reverseClass,
77
- wrapClass,
78
- spacingClass,
79
- gapClass,
80
- rowGapClass,
81
- columnGapClass,
82
- alignSelfClass
83
- ),
79
+ 'pb_flex_kit',
80
+ orientationClass,
81
+ justifyClass,
82
+ alignClass,
83
+ inlineClass,
84
+ reverseClass,
85
+ wrapClass,
86
+ spacingClass,
87
+ gapClass,
88
+ rowGapClass,
89
+ columnGapClass,
90
+ responsiveGapClass,
91
+ responsiveRowGapClass,
92
+ responsiveColumnGapClass,
93
+ alignSelfClass,
84
94
  globalProps(props),
85
95
  className
86
96
  )}
@@ -1,52 +1,147 @@
1
- [class^=pb_flex_item_kit] {
2
- &[class*=_fixed_size] {
3
- flex-grow: 0;
4
- flex-shrink: 0;
5
- }
6
-
7
- &[class*=_grow] {
8
- flex-grow: 1;
9
- }
10
-
11
- &[class*=_shrink] {
12
- flex-shrink: 1;
13
- }
14
-
15
- // Display Flex - Rails & React
16
- &[class*=display_flex] {
17
- display: flex;
18
- }
19
-
20
- // Alignment: Align Self - Rails & React
21
- &[class*=align_self_start] {
22
- align-self: flex-start;
23
- }
24
-
25
- &[class*=align_self_end] {
26
- align-self: flex-end;
27
- }
28
-
29
- &[class*=align_self_center] {
30
- align-self: center;
31
- }
32
-
33
- &[class*=align_self_stretch] {
34
- align-self: stretch;
35
- }
36
-
37
- //Order Items
38
- @for $i from 0 through 12 {
39
- &[class*=order_#{$i}]{
40
- order: $i;
41
- }
42
- }
43
- &[class*=order_first]{
44
- order: -1;
45
- }
46
-
47
- @for $i from 0 through 12 {
48
- &[class*=_flex_#{$i}]{
49
- flex: $i;
50
- }
51
- }
1
+ // Fixed size
2
+ .pb_flex_item_kit_fixed_size {
3
+ flex-grow: 0;
4
+ flex-shrink: 0;
52
5
  }
6
+
7
+ // Grow
8
+ .pb_flex_item_kit_grow {
9
+ flex-grow: 1;
10
+ }
11
+
12
+ // Shrink
13
+ .pb_flex_item_kit_shrink {
14
+ flex-shrink: 1;
15
+ }
16
+
17
+ // Display Flex
18
+ .pb_flex_item_kit_display_flex {
19
+ display: flex;
20
+ }
21
+
22
+ // Align Self
23
+ .pb_flex_item_kit_align_self_start {
24
+ align-self: flex-start;
25
+ }
26
+
27
+ .pb_flex_item_kit_align_self_end {
28
+ align-self: flex-end;
29
+ }
30
+
31
+ .pb_flex_item_kit_align_self_center {
32
+ align-self: center;
33
+ }
34
+
35
+ .pb_flex_item_kit_align_self_stretch {
36
+ align-self: stretch;
37
+ }
38
+
39
+ // Order classes
40
+ .pb_flex_item_kit_order_0 {
41
+ order: 0;
42
+ }
43
+
44
+ .pb_flex_item_kit_order_1 {
45
+ order: 1;
46
+ }
47
+
48
+ .pb_flex_item_kit_order_2 {
49
+ order: 2;
50
+ }
51
+
52
+ .pb_flex_item_kit_order_3 {
53
+ order: 3;
54
+ }
55
+
56
+ .pb_flex_item_kit_order_4 {
57
+ order: 4;
58
+ }
59
+
60
+ .pb_flex_item_kit_order_5 {
61
+ order: 5;
62
+ }
63
+
64
+ .pb_flex_item_kit_order_6 {
65
+ order: 6;
66
+ }
67
+
68
+ .pb_flex_item_kit_order_7 {
69
+ order: 7;
70
+ }
71
+
72
+ .pb_flex_item_kit_order_8 {
73
+ order: 8;
74
+ }
75
+
76
+ .pb_flex_item_kit_order_9 {
77
+ order: 9;
78
+ }
79
+
80
+ .pb_flex_item_kit_order_10 {
81
+ order: 10;
82
+ }
83
+
84
+ .pb_flex_item_kit_order_11 {
85
+ order: 11;
86
+ }
87
+
88
+ .pb_flex_item_kit_order_12 {
89
+ order: 12;
90
+ }
91
+
92
+ .pb_flex_item_kit_order_first {
93
+ order: -1;
94
+ }
95
+
96
+ // Flex values
97
+ .pb_flex_item_kit_flex_0 {
98
+ flex: 0;
99
+ }
100
+
101
+ .pb_flex_item_kit_flex_1 {
102
+ flex: 1;
103
+ }
104
+
105
+ .pb_flex_item_kit_flex_2 {
106
+ flex: 2;
107
+ }
108
+
109
+ .pb_flex_item_kit_flex_3 {
110
+ flex: 3;
111
+ }
112
+
113
+ .pb_flex_item_kit_flex_4 {
114
+ flex: 4;
115
+ }
116
+
117
+ .pb_flex_item_kit_flex_5 {
118
+ flex: 5;
119
+ }
120
+
121
+ .pb_flex_item_kit_flex_6 {
122
+ flex: 6;
123
+ }
124
+
125
+ .pb_flex_item_kit_flex_7 {
126
+ flex: 7;
127
+ }
128
+
129
+ .pb_flex_item_kit_flex_8 {
130
+ flex: 8;
131
+ }
132
+
133
+ .pb_flex_item_kit_flex_9 {
134
+ flex: 9;
135
+ }
136
+
137
+ .pb_flex_item_kit_flex_10 {
138
+ flex: 10;
139
+ }
140
+
141
+ .pb_flex_item_kit_flex_11 {
142
+ flex: 11;
143
+ }
144
+
145
+ .pb_flex_item_kit_flex_12 {
146
+ flex: 12;
147
+ }
@@ -9,7 +9,8 @@ type FlexItemPropTypes = {
9
9
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
10
10
  shrink?: boolean,
11
11
  className?: string,
12
- order?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'first' | 'none',
12
+ flex?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'none',
13
+ order?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'first' | 'none',
13
14
  alignSelf?: "start" | "end" | "center" | "stretch" | null,
14
15
  displayFlex?: boolean
15
16
  } & GlobalProps
@@ -27,14 +28,14 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
27
28
  alignSelf,
28
29
  displayFlex
29
30
  } = props
30
- const growClass = grow === true ? 'grow' : ''
31
- const displayFlexClass = displayFlex === true ? `display_flex_${displayFlex}` : ''
32
- const flexClass = flex !== 'none' ? `flex_${flex}` : ''
33
- const shrinkClass = shrink === true ? 'shrink' : ''
34
- const alignSelfClass = alignSelf ? `align_self_${alignSelf}` : ''
31
+ const growClass = grow === true ? 'pb_flex_item_kit_grow' : ''
32
+ const displayFlexClass = displayFlex === true ? 'pb_flex_item_kit_display_flex' : ''
33
+ const flexClass = flex !== 'none' ? `pb_flex_item_kit_flex_${flex}` : ''
34
+ const shrinkClass = shrink === true ? 'pb_flex_item_kit_shrink' : ''
35
+ const alignSelfClass = alignSelf ? `pb_flex_item_kit_align_self_${alignSelf}` : ''
35
36
  const fixedStyle =
36
37
  fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
37
- const orderClass = order !== 'none' ? `order_${order}` : null
38
+ const orderClass = order !== 'none' ? `pb_flex_item_kit_order_${order}` : ''
38
39
  const dynamicInlineProps = globalInlineProps(props)
39
40
  const combinedStyles = {
40
41
  ...fixedStyle,
@@ -47,7 +48,17 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
47
48
  return (
48
49
  <div
49
50
  {...htmlProps}
50
- className={classnames(buildCss('pb_flex_item_kit', growClass, shrinkClass, flexClass, displayFlexClass), orderClass, alignSelfClass, globalProps(props), className)}
51
+ className={classnames(
52
+ 'pb_flex_item_kit',
53
+ growClass,
54
+ shrinkClass,
55
+ flexClass,
56
+ displayFlexClass,
57
+ orderClass,
58
+ alignSelfClass,
59
+ globalProps(props),
60
+ className
61
+ )}
51
62
  style={combinedStyles}
52
63
  >
53
64
  {children}
@@ -1,4 +1,4 @@
1
- <%= pb_rails("title", props: {size: 4, text: "Row"}) %>
1
+ <%= pb_rails("title", props: {size: 4, text: "Gap"}) %>
2
2
  <br/>
3
3
  <div class="flex-doc-example">
4
4
  <%= pb_rails("flex", props:{ gap: "xxs", wrap:true}) do %>
@@ -31,3 +31,14 @@
31
31
  <%= pb_rails("flex/flex_item") do %>4<% end %>
32
32
  <% end %>
33
33
  </div>
34
+
35
+ <br/><br/>
36
+ <%= pb_rails("title", props: {size: 4, text: "Responsive"}) %>
37
+ <br/>
38
+ <div class="flex-doc-example">
39
+ <%= pb_rails("flex", props: { gap: { xs: "none", sm: "sm", md: "md", lg: "lg", xl: "xl" }, wrap: true }) do %>
40
+ <% 40.times do |i| %>
41
+ <%= pb_rails("flex/flex_item") do %> <%=i%> <% end %>
42
+ <% end %>
43
+ <% end %>
44
+ </div>
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import Flex from '../../pb_flex/_flex'
3
3
  import FlexItem from '../../pb_flex/_flex_item'
4
+ import Title from '../../pb_title/_title'
4
5
 
5
6
  const FlexGap = (props) => {
6
7
  const count = () => {
@@ -13,6 +14,8 @@ const FlexGap = (props) => {
13
14
 
14
15
  return (
15
16
  <>
17
+ <Title size={4}>Gap</Title>
18
+ <br />
16
19
  <div className="flex-doc-example">
17
20
  <Flex
18
21
  gap="xxs"
@@ -27,8 +30,10 @@ const FlexGap = (props) => {
27
30
  </Flex>
28
31
  </div>
29
32
 
30
- <br />
33
+ <br /><br />
31
34
 
35
+ <Title size={4}>Column Gap</Title>
36
+ <br />
32
37
  <div className="flex-doc-example">
33
38
  <Flex
34
39
  columnGap="lg"
@@ -48,6 +53,9 @@ const FlexGap = (props) => {
48
53
  </FlexItem>
49
54
  </Flex>
50
55
  </div>
56
+ <br /><br />
57
+
58
+ <Title size={4}>Row Gap</Title>
51
59
  <br />
52
60
  <div className="flex-doc-example">
53
61
  <Flex
@@ -69,6 +77,23 @@ const FlexGap = (props) => {
69
77
  </FlexItem>
70
78
  </Flex>
71
79
  </div>
80
+
81
+ <br /><br />
82
+ <Title size={4}>Responsive</Title>
83
+ <br />
84
+ <div className="flex-doc-example">
85
+ <Flex
86
+ gap={{ xs: "none", sm: "sm", md: "md", lg: "lg", xl: "xl" }}
87
+ wrap
88
+ {...props}
89
+ >
90
+ {count().map((v, key) => (
91
+ <FlexItem key={key}>
92
+ {v}
93
+ </FlexItem>
94
+ ))}
95
+ </Flex>
96
+ </div>
72
97
  </>
73
98
  )
74
99
  }
@@ -0,0 +1,11 @@
1
+ ##### Prop
2
+
3
+ `gap` | `row_gap` | `column_gap` | **Type**: String | Hash | **Values**: xxs | xs | sm | md | lg | xl | none
4
+
5
+ Setting the gap prop sets the `row_gap` and the `column_gap` props to the same size and creates equal space within a flex container.
6
+
7
+ Setting the `row_gap` prop creates space between rows in a flex container.
8
+
9
+ Setting the `column_gap` prop creates space between columns in a flex container.
10
+
11
+ You can also set responsive values by passing a hash with device sizes and values.