playbook_ui 14.8.0 → 14.9.0.pre.alpha.PBNTR702stickyleftcolrails4806

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +61 -17
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb +53 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.md +5 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +50 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +1 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +57 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +5 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +5600 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +3 -1
  16. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +15 -0
  17. data/app/pb_kits/playbook/pb_background/_background.tsx +8 -2
  18. data/app/pb_kits/playbook/pb_button/_button.scss +6 -0
  19. data/app/pb_kits/playbook/pb_button/_button.tsx +1 -3
  20. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +15 -0
  21. data/app/pb_kits/playbook/pb_button/button.rb +1 -1
  22. data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +1 -0
  23. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +8 -0
  24. data/app/pb_kits/playbook/pb_button/docs/_button_default.md +1 -1
  25. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +2 -2
  26. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -4
  27. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +84 -7
  28. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +3 -1
  29. data/app/pb_kits/playbook/pb_currency/_currency.tsx +7 -3
  30. data/app/pb_kits/playbook/pb_currency/currency.html.erb +2 -2
  31. data/app/pb_kits/playbook/pb_currency/currency.rb +17 -1
  32. data/app/pb_kits/playbook/pb_currency/currency.test.js +40 -3
  33. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +4 -0
  34. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +16 -0
  35. data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -0
  36. data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
  37. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +1 -0
  38. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +159 -45
  39. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +31 -0
  40. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +6 -0
  41. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -1
  42. data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
  43. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -0
  44. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -1
  45. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -4
  46. data/app/pb_kits/playbook/pb_dropdown/utilities/subComponentHelper.tsx +13 -2
  47. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  48. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
  49. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +63 -12
  50. data/app/pb_kits/playbook/pb_image/_image.tsx +3 -1
  51. data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -3
  52. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +3 -1
  53. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
  54. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +5 -3
  55. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +3 -2
  56. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.rb +5 -0
  57. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +3 -1
  58. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +2 -1
  59. data/app/pb_kits/playbook/pb_table/_table.tsx +109 -25
  60. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +95 -0
  61. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +87 -0
  62. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +2 -0
  63. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
  64. data/app/pb_kits/playbook/pb_table/index.ts +100 -26
  65. data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -0
  66. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +4 -0
  67. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +18 -0
  68. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  69. data/app/pb_kits/playbook/pb_table/table.rb +17 -2
  70. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +47 -0
  71. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +59 -0
  72. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +3 -0
  73. data/app/pb_kits/playbook/pb_typeahead/index.ts +29 -3
  74. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -2
  75. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
  76. data/app/pb_kits/playbook/tokens/_height.scss +19 -0
  77. data/app/pb_kits/playbook/tokens/exports/_height.module.scss +37 -0
  78. data/app/pb_kits/playbook/utilities/_height.scss +33 -0
  79. data/app/pb_kits/playbook/utilities/_max_width.scss +29 -9
  80. data/app/pb_kits/playbook/utilities/_min_width.scss +6 -2
  81. data/app/pb_kits/playbook/utilities/_width.scss +45 -0
  82. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +1 -1
  83. data/app/pb_kits/playbook/utilities/globalProps.ts +37 -4
  84. data/dist/chunks/_typeahead-CCDoUmRR.js +22 -0
  85. data/dist/chunks/_weekday_stacked-CxjKLoMr.js +45 -0
  86. data/dist/chunks/{lib-BC6ESsxG.js → lib-CVPInSs5.js} +2 -2
  87. data/dist/chunks/{pb_form_validation-B_Z9rEbg.js → pb_form_validation-CDLJ5eAG.js} +1 -1
  88. data/dist/chunks/vendor.js +1 -1
  89. data/dist/menu.yml +321 -0
  90. data/dist/playbook-doc.js +1 -1
  91. data/dist/playbook-rails-react-bindings.js +1 -1
  92. data/dist/playbook-rails.js +1 -1
  93. data/dist/playbook.css +1 -1
  94. data/lib/playbook/classnames.rb +4 -0
  95. data/lib/playbook/forms/builder/typeahead_field.rb +13 -0
  96. data/lib/playbook/height.rb +29 -0
  97. data/lib/playbook/kit_base.rb +16 -1
  98. data/lib/playbook/max_height.rb +29 -0
  99. data/lib/playbook/min_height.rb +29 -0
  100. data/lib/playbook/spacing.rb +21 -0
  101. data/lib/playbook/version.rb +2 -2
  102. metadata +32 -9
  103. data/dist/chunks/_typeahead-D0PihN_3.js +0 -22
  104. data/dist/chunks/_weekday_stacked-uMIX8f-A.js +0 -45
@@ -23,6 +23,8 @@ module Playbook
23
23
  prop :text
24
24
  prop :sticky, type: Playbook::Props::Boolean,
25
25
  default: false
26
+ prop :sticky_left_column, type: Playbook::Props::Array,
27
+ default: []
26
28
  prop :vertical_border, type: Playbook::Props::Boolean,
27
29
  default: false
28
30
  prop :striped, type: Playbook::Props::Boolean,
@@ -37,8 +39,8 @@ module Playbook
37
39
  def classname
38
40
  generate_classname(
39
41
  "pb_table", "table-#{size}", single_line_class, dark_class,
40
- disable_hover_class, container_class, data_table_class, sticky_class, collapse_class,
41
- vertical_border_class, striped_class, outer_padding_class,
42
+ disable_hover_class, container_class, data_table_class, sticky_class, sticky_left_column_class,
43
+ collapse_class, vertical_border_class, striped_class, outer_padding_class,
42
44
  "table-responsive-#{responsive}", separator: " "
43
45
  )
44
46
  end
@@ -73,6 +75,19 @@ module Playbook
73
75
  sticky ? "sticky-header" : nil
74
76
  end
75
77
 
78
+ def sticky_left_column_class
79
+ if sticky_left_column.empty?
80
+ nil
81
+ else
82
+ sticky_col_classname = "sticky-left-column sticky-columns"
83
+ sticky_left_column.each do |id|
84
+ sticky_col_classname += "-#{id}"
85
+ end
86
+
87
+ sticky_col_classname
88
+ end
89
+ end
90
+
76
91
  def striped_class
77
92
  striped ? "striped" : nil
78
93
  end
@@ -41,3 +41,50 @@
41
41
  }) %>
42
42
  <% end %>
43
43
  <% end %>
44
+
45
+ <br /><br /><br />
46
+
47
+ <%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %>
48
+ <%= pb_rails("timeline/item") do |item| %>
49
+
50
+ <% item.label do %>
51
+ <%= pb_rails("timeline/label") do %>
52
+ <%= pb_rails("title", props: { text: "Any Kit", size: 4 }) %>
53
+ <% end %>
54
+ <% end %>
55
+
56
+ <% item.step do %>
57
+ <%= pb_rails("timeline/step", props: { icon: 'user', icon_color: 'royal' }) %>
58
+ <% end %>
59
+
60
+ <% item.detail do %>
61
+ <%= pb_rails("title_detail", props: {
62
+ title: "Jackson Heights",
63
+ detail: "37-27 74th Street"
64
+ }) %>
65
+ <% end %>
66
+ <% end %>
67
+
68
+ <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1, line_style: "dotted" }) do |item| %>
69
+ <%= pb_rails("title_detail", props: {
70
+ title: "Society Hill",
71
+ detail: "72 E St Astoria"
72
+ }) %>
73
+ <% end %>
74
+
75
+ <%= pb_rails("timeline/item") do |item| %>
76
+
77
+ <% item.step do %>
78
+ <%= pb_rails("timeline/step") do %>
79
+ <%= pb_rails("pill", props: { text: "3" , variant: "success" }) %>
80
+ <% end %>
81
+ <% end %>
82
+
83
+ <% item.detail do %>
84
+ <%= pb_rails("title_detail", props: {
85
+ title: "Greenpoint",
86
+ detail: "81 Gate St Brooklyn"
87
+ }) %>
88
+ <% end %>
89
+ <% end %>
90
+ <% end %>
@@ -62,6 +62,65 @@ const TimelineWithChildren = (props) => (
62
62
  </Timeline.Detail>
63
63
  </Timeline.Item>
64
64
  </Timeline>
65
+
66
+ <br />
67
+ <br />
68
+ <br />
69
+
70
+ <Timeline orientation="vertical"
71
+ showDate
72
+ {...props}
73
+ >
74
+ <Timeline.Item lineStyle="solid"
75
+ {...props}
76
+ >
77
+ <Timeline.Label>
78
+ <Title size={4}
79
+ text='Any Kit'
80
+ />
81
+ </Timeline.Label>
82
+ <Timeline.Step icon="user"
83
+ iconColor="royal"
84
+ />
85
+ <Timeline.Detail>
86
+ <TitleDetail detail="37-27 74th Street"
87
+ title="Jackson Heights"
88
+ {...props}
89
+ />
90
+ </Timeline.Detail>
91
+ </Timeline.Item>
92
+
93
+ <Timeline.Item lineStyle="dotted"
94
+ {...props}
95
+ >
96
+ <Timeline.Label date={new Date(new Date().setDate(new Date().getDate() + 1))} />
97
+ <Timeline.Step icon="map-marker-alt"
98
+ iconColor="purple"
99
+ />
100
+ <Timeline.Detail>
101
+ <TitleDetail detail="72 E St Astoria"
102
+ title="Society Hill"
103
+ {...props}
104
+ />
105
+ </Timeline.Detail>
106
+ </Timeline.Item>
107
+
108
+ <Timeline.Item lineStyle="solid"
109
+ {...props}
110
+ >
111
+ <Timeline.Step>
112
+ <Pill text="3"
113
+ variant="success"
114
+ />
115
+ </Timeline.Step>
116
+ <Timeline.Detail>
117
+ <TitleDetail detail="81 Gate St Brooklyn"
118
+ title="Greenpoint"
119
+ {...props}
120
+ />
121
+ </Timeline.Detail>
122
+ </Timeline.Item>
123
+ </Timeline>
65
124
  </div>
66
125
  )
67
126
 
@@ -2,6 +2,7 @@
2
2
  @import "../tokens/border_radius";
3
3
  @import "../tokens/spacing";
4
4
  @import "../tokens/shadows";
5
+ @import "../tokens/positioning";
5
6
 
6
7
  [class^=pb_typeahead_kit] {
7
8
  .typeahead-kit-select__option {
@@ -99,6 +100,7 @@
99
100
  .typeahead-kit-select__menu {
100
101
  background-color: $bg_dark;
101
102
  color: $white;
103
+ z-index: $z_1;
102
104
  }
103
105
  .typeahead-kit-select__option:hover {
104
106
  background-color: $active_dark;
@@ -182,6 +184,7 @@
182
184
  }
183
185
 
184
186
  .typeahead-kit-select__menu {
187
+ z-index: $z_1;
185
188
  .typeahead-kit-select__menu-list {
186
189
  padding: 0;
187
190
  }
@@ -4,11 +4,12 @@ import { debounce } from 'lodash'
4
4
  export default class PbTypeahead extends PbEnhancedElement {
5
5
  _searchInput: HTMLInputElement
6
6
  _resultsElement: HTMLElement
7
- _debouncedSearch: Function
7
+ _debouncedSearch: () => void
8
8
  _resultsLoadingIndicator: HTMLElement
9
9
  _resultOptionTemplate: HTMLElement
10
10
  _resultsOptionCache: Map<string, Array<DocumentFragment>>
11
11
  _searchContext: string
12
+ _validSelection: boolean
12
13
 
13
14
  static get selector() {
14
15
  return '[data-pb-typeahead-kit]'
@@ -86,6 +87,9 @@ export default class PbTypeahead extends PbEnhancedElement {
86
87
  const resultOption = (event.target as Element).closest('[data-result-option-item]')
87
88
  if (!resultOption) return
88
89
 
90
+ this._validSelection = true
91
+ this.removeValidationError()
92
+
89
93
  this.resultsCacheClear()
90
94
  this.searchInputClear()
91
95
  this.clearResults()
@@ -93,6 +97,28 @@ export default class PbTypeahead extends PbEnhancedElement {
93
97
  this.element.dispatchEvent(new CustomEvent('pb-typeahead-kit-result-option-selected', { bubbles: true, detail: { selected: resultOption, typeahead: this } }))
94
98
  }
95
99
 
100
+ removeValidationError() {
101
+ const inputWrapper = this.searchInput.closest('.text_input_wrapper')
102
+ if (inputWrapper) {
103
+ const errorMessage = inputWrapper.querySelector('.pb_body_kit_negative') as HTMLElement
104
+ if (errorMessage) {
105
+ errorMessage.style.display = 'none'
106
+ }
107
+ this.searchInput.classList.remove('error')
108
+ }
109
+ }
110
+
111
+ showValidationError() {
112
+ const inputWrapper = this.searchInput.closest('.text_input_wrapper')
113
+ if (inputWrapper) {
114
+ const errorMessage = inputWrapper.querySelector('.pb_body_kit_negative') as HTMLElement
115
+ if (errorMessage) {
116
+ errorMessage.style.display = 'block'
117
+ }
118
+ this.searchInput.classList.add('error')
119
+ }
120
+ }
121
+
96
122
  clearResults() {
97
123
  this.resultsElement.innerHTML = ''
98
124
  }
@@ -201,8 +227,8 @@ export default class PbTypeahead extends PbEnhancedElement {
201
227
  }
202
228
 
203
229
  toggleResultsLoadingIndicator(visible: boolean) {
204
- var visibilityProperty = '0'
230
+ let visibilityProperty = '0'
205
231
  if (visible) visibilityProperty = '1'
206
232
  this.resultsLoadingIndicator.style.opacity = visibilityProperty
207
233
  }
208
- }
234
+ }
@@ -17,11 +17,14 @@
17
17
  <%= pb_rails("text_input", props: {
18
18
  type: "search",
19
19
  input_options: object.input_options,
20
- label: object.label,
21
20
  name: object.name,
22
21
  value: object.value,
23
22
  placeholder: object.placeholder,
24
23
  margin_bottom: "none",
24
+ required: object.required,
25
+ validation: object.validation,
26
+ label: object.label,
27
+ id: object.input_options[:id],
25
28
  }) %>
26
29
  <%= pb_rails("list", props: { ordered: false, borderless: false, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
27
30
  <% end %>
@@ -33,4 +36,4 @@
33
36
  <% end %>
34
37
  </template>
35
38
  <% end %>
36
- <% end %>
39
+ <% end %>
@@ -40,6 +40,10 @@ module Playbook
40
40
  prop :pill_color, type: Playbook::Props::Enum,
41
41
  values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
42
42
  default: "primary"
43
+ prop :required, type: Playbook::Props::Boolean,
44
+ default: false
45
+ prop :validation, type: Playbook::Props::HashProp,
46
+ default: {}
43
47
 
44
48
  def classname
45
49
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
@@ -0,0 +1,19 @@
1
+
2
+ $height_auto: auto !default;
3
+ $height_xs: 320px !default;
4
+ $height_sm: 480px !default;
5
+ $height_md: 768px !default;
6
+ $height_lg: 1024px !default;
7
+ $height_xl: 1280px !default;
8
+ $height_2xl: 1440px !default;
9
+ $height_3xl: 1920px !default;
10
+ $heights: (
11
+ height_auto: $height_auto,
12
+ height_xs: $height_xs,
13
+ height_sm: $height_sm,
14
+ height_md: $height_md,
15
+ height_lg: $height_lg,
16
+ height_xl: $height_xl,
17
+ height_xxl: $height_2xl,
18
+ height_xxxl: $height_3xl
19
+ );
@@ -0,0 +1,37 @@
1
+ @import "../height";
2
+
3
+ :export {
4
+ @mixin export_height($height_list) {
5
+ @each $name, $value in $height_list {
6
+ .#{$name} {
7
+ height: $value;
8
+ }
9
+ }
10
+ }
11
+
12
+ @include export_height($heights);
13
+ }
14
+
15
+ :export {
16
+ @mixin export_max_height($height_list) {
17
+ @each $name, $value in $height_list {
18
+ .max_#{$name} {
19
+ max-height: $value;
20
+ }
21
+ }
22
+ }
23
+
24
+ @include export_max_height($heights);
25
+ }
26
+
27
+ :export {
28
+ @mixin export_min_height($height_list) {
29
+ @each $name, $value in $height_list {
30
+ .min_#{$name} {
31
+ min-height: $value;
32
+ }
33
+ }
34
+ }
35
+
36
+ @include export_min_height($heights);
37
+ }
@@ -0,0 +1,33 @@
1
+ @import "../tokens/exports/height.module";
2
+
3
+ @mixin export_height($height_list) {
4
+ @each $name, $value in $height_list {
5
+ .#{$name} {
6
+ height: $value;
7
+ }
8
+ }
9
+ }
10
+
11
+ @mixin export_max_height($height_list) {
12
+ @each $name, $value in $height_list {
13
+ .max_#{$name} {
14
+ max-height: $value;
15
+ }
16
+ }
17
+ }
18
+
19
+ @mixin export_min_height($height_list) {
20
+ @each $name, $value in $height_list {
21
+ .min_#{$name} {
22
+ min-height: $value;
23
+ }
24
+ }
25
+ }
26
+
27
+ @include export_height($heights);
28
+ @include export_max_height($heights);
29
+ @include export_min_height($heights);
30
+
31
+ .height-resize {
32
+ resize: vertical;
33
+ }
@@ -1,29 +1,49 @@
1
- .max_width_xs {
2
- max-width: 360px;
3
- }
1
+ @import "../tokens/container";
2
+
4
3
  .max_width_0 {
5
- max-width: 0;
4
+ max-width: map-get($containers, 'none');
6
5
  }
6
+
7
7
  .max_width_none {
8
8
  max-width: none;
9
9
  }
10
10
 
11
+ .max_width_0_percent {
12
+ max-width: $container_0;
13
+ }
14
+
15
+ .max_width_xxs {
16
+ max-width: $container_xxs;
17
+ }
18
+
19
+ .max_width_xs {
20
+ max-width: $container_xs;
21
+ }
22
+
11
23
  .max_width_sm {
12
- max-width: 540px;
24
+ max-width: $container_sm;
13
25
  }
14
26
 
15
27
  .max_width_md {
16
- max-width: 720px;
28
+ max-width: $container_md;
17
29
  }
18
30
 
19
31
  .max_width_lg {
20
- max-width: 960px;
32
+ max-width: $container_lg;
21
33
  }
22
34
 
23
35
  .max_width_xl {
24
- max-width: 1140px;
36
+ max-width: $container_xl;
25
37
  }
26
38
 
27
39
  .max_width_xxl {
28
- max-width: 1320px;
40
+ max-width: $container_xxl;
41
+ }
42
+
43
+ .max_width_100_percent {
44
+ max-width: $container_100;
45
+ }
46
+
47
+ .width-resize {
48
+ resize: horizontal;
29
49
  }
@@ -4,7 +4,11 @@
4
4
  min-width: map-get($containers, 'none');
5
5
  }
6
6
 
7
- .min_with_0_percent {
7
+ .min_width_none {
8
+ min-width: none;
9
+ }
10
+
11
+ .min_width_0_percent {
8
12
  min-width: $container_0;
9
13
  }
10
14
 
@@ -40,6 +44,6 @@
40
44
  min-width: $container_100;
41
45
  }
42
46
 
43
- .minwidth-resize {
47
+ .width-resize {
44
48
  resize: horizontal;
45
49
  }
@@ -0,0 +1,45 @@
1
+ @import "../tokens/container";
2
+
3
+ .width_none {
4
+ width: none;
5
+ }
6
+
7
+ .width_0 {
8
+ width: map-get($containers, 'none');
9
+ }
10
+
11
+ .width_0_percent {
12
+ width: map-get($containers, 'none');
13
+ }
14
+
15
+ .width_xxs {
16
+ width: $container_xxs;
17
+ }
18
+
19
+ .width_xs {
20
+ width: $container_xs;
21
+ }
22
+
23
+ .width_sm {
24
+ width: $container_sm;
25
+ }
26
+
27
+ .width_md {
28
+ width: $container_md;
29
+ }
30
+
31
+ .width_lg {
32
+ width: $container_lg;
33
+ }
34
+
35
+ .width_xl {
36
+ width: $container_xl;
37
+ }
38
+
39
+ .width_xxl {
40
+ width: $container_xxl;
41
+ }
42
+
43
+ .width_100_percent {
44
+ width: $container_100;
45
+ }
@@ -7,7 +7,6 @@ export default [
7
7
  "right",
8
8
  "top",
9
9
  "hover",
10
- "groupHover",
11
10
  "zIndex",
12
11
  "verticalAlign",
13
12
  "truncate",
@@ -30,6 +29,7 @@ export default [
30
29
  "numberSpacing",
31
30
  "maxWidth",
32
31
  "minWidth",
32
+ "width",
33
33
  "marginRight",
34
34
  "marginLeft",
35
35
  "marginTop",
@@ -95,12 +95,16 @@ type Margin = {
95
95
  default?: string
96
96
  }
97
97
 
98
+ type Width = {
99
+ width?: string
100
+ }
101
+
98
102
  type MaxWidth = {
99
- maxWidth?: Sizes,
103
+ maxWidth?: string,
100
104
  }
101
105
 
102
106
  type MinWidth = {
103
- minWidth?: Sizes,
107
+ minWidth?: string,
104
108
  }
105
109
 
106
110
  type NumberSpacing = {
@@ -176,7 +180,7 @@ type ZIndex = {
176
180
  } | ZIndexResponsiveType
177
181
 
178
182
  type Height = {
179
- height?: string
183
+ height?: string
180
184
  }
181
185
 
182
186
  type MaxHeight = {
@@ -191,7 +195,7 @@ type MinHeight = {
191
195
  export type GlobalProps = AlignContent & AlignItems & AlignSelf &
192
196
  BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
193
197
  FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
194
- LineHeight & Margin & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
198
+ LineHeight & Margin & Width & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
195
199
  Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
196
200
 
197
201
  const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
@@ -351,6 +355,11 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
351
355
  css += numberSpacing ? `ns_${numberSpacing} ` : ''
352
356
  return css
353
357
  },
358
+ widthProps: ({ width }: Width) => {
359
+ let css = ''
360
+ css += width ? `width_${filterClassName(width)} ` : ''
361
+ return css.trimEnd()
362
+ },
354
363
  minWidthProps: ({ minWidth }: MinWidth) => {
355
364
  let css = ''
356
365
  css += minWidth ? `min_width_${filterClassName(minWidth)} ` : ''
@@ -361,6 +370,30 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
361
370
  css += maxWidth ? `max_width_${filterClassName(maxWidth)} ` : ''
362
371
  return css.trimEnd()
363
372
  },
373
+ minHeightProps: ({ minHeight }: MinHeight) => {
374
+ const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
375
+ if (heightValues.includes(minHeight)) {
376
+ let css = ''
377
+ css += minHeight ? `min_height_${filterClassName(minHeight)} ` : ''
378
+ return css.trimEnd()
379
+ }
380
+ },
381
+ maxHeightProps: ({ maxHeight }: MaxHeight) => {
382
+ const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
383
+ if (heightValues.includes(maxHeight)) {
384
+ let css = ''
385
+ css += maxHeight ? `max_height_${filterClassName(maxHeight)} ` : ''
386
+ return css.trimEnd()
387
+ }
388
+ },
389
+ heightProps: ({ height }: Height) => {
390
+ const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
391
+ if (heightValues.includes(height)) {
392
+ let css = ''
393
+ css += height ? `height_${filterClassName(height)} ` : ''
394
+ return css.trimEnd()
395
+ }
396
+ },
364
397
  zIndexProps: (zIndex: ZIndex) => {
365
398
  let css = ''
366
399
  Object.entries(zIndex).forEach((zIndexEntry) => {