playbook_ui 14.9.0.pre.alpha.play17004992 → 14.9.0.pre.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +17 -61
  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/example.yml +0 -3
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -2
  8. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +3 -5
  9. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -3
  10. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -15
  11. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -0
  12. data/app/pb_kits/playbook/pb_background/_background.tsx +2 -8
  13. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +49 -53
  14. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +36 -29
  15. data/app/pb_kits/playbook/pb_body/_body.scss +13 -14
  16. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +16 -22
  17. data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +0 -6
  18. data/app/pb_kits/playbook/pb_button/_button.scss +0 -6
  19. data/app/pb_kits/playbook/pb_button/_button.tsx +3 -1
  20. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +0 -15
  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 +0 -1
  23. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +0 -8
  24. data/app/pb_kits/playbook/pb_button/docs/_button_default.md +1 -1
  25. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -2
  26. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
  27. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +2 -2
  28. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +4 -0
  29. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +7 -84
  30. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +4 -11
  31. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
  32. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
  33. data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -7
  34. data/app/pb_kits/playbook/pb_currency/currency.html.erb +2 -2
  35. data/app/pb_kits/playbook/pb_currency/currency.rb +1 -17
  36. data/app/pb_kits/playbook/pb_currency/currency.test.js +3 -40
  37. data/app/pb_kits/playbook/pb_currency/docs/example.yml +0 -2
  38. data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
  39. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +0 -1
  40. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +45 -159
  41. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -1
  42. data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -1
  43. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -1
  44. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +1 -0
  45. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +4 -0
  46. data/app/pb_kits/playbook/pb_dropdown/utilities/subComponentHelper.tsx +2 -13
  47. data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +0 -5
  48. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +2 -7
  49. data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +2 -8
  50. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  51. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
  52. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +12 -63
  53. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -3
  54. data/app/pb_kits/playbook/pb_layout/_layout.tsx +3 -6
  55. data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
  56. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +1 -11
  57. data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +2 -16
  58. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
  59. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -3
  60. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
  61. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +3 -5
  62. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +2 -3
  63. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.rb +0 -5
  64. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +1 -4
  65. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -3
  66. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
  67. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +1 -2
  68. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
  69. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +36 -44
  70. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
  71. data/app/pb_kits/playbook/pb_table/_table.tsx +25 -109
  72. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -5
  73. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -6
  74. data/app/pb_kits/playbook/pb_table/index.ts +26 -100
  75. data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -3
  76. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -106
  77. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  78. data/app/pb_kits/playbook/pb_table/table.rb +2 -17
  79. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +3 -35
  80. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -1
  81. data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
  82. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +2 -139
  83. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +0 -47
  84. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +0 -59
  85. data/app/pb_kits/playbook/pb_title/_title.scss +5 -6
  86. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -13
  87. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -3
  88. data/app/pb_kits/playbook/pb_typeahead/index.ts +3 -29
  89. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
  90. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -4
  91. data/app/pb_kits/playbook/tokens/_titles.scss +8 -0
  92. data/app/pb_kits/playbook/utilities/_hover.scss +2 -11
  93. data/app/pb_kits/playbook/utilities/_max_width.scss +9 -29
  94. data/app/pb_kits/playbook/utilities/_min_width.scss +2 -6
  95. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +1 -1
  96. data/app/pb_kits/playbook/utilities/globalProps.ts +4 -39
  97. data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +0 -15
  98. data/dist/chunks/_typeahead-D0PihN_3.js +22 -0
  99. data/dist/chunks/_weekday_stacked-uMIX8f-A.js +45 -0
  100. data/dist/chunks/{lib-CuCy3_xO.js → lib-BC6ESsxG.js} +3 -3
  101. data/dist/chunks/{pb_form_validation-D37k10a0.js → pb_form_validation-B_Z9rEbg.js} +1 -1
  102. data/dist/chunks/vendor.js +1 -1
  103. data/dist/menu.yml +1 -322
  104. data/dist/playbook-doc.js +1 -1
  105. data/dist/playbook-rails-react-bindings.js +1 -1
  106. data/dist/playbook-rails.js +1 -1
  107. data/dist/playbook.css +1 -1
  108. data/lib/playbook/classnames.rb +0 -4
  109. data/lib/playbook/forms/builder/typeahead_field.rb +0 -13
  110. data/lib/playbook/hover.rb +1 -7
  111. data/lib/playbook/kit_base.rb +1 -16
  112. data/lib/playbook/spacing.rb +0 -21
  113. data/lib/playbook/version.rb +2 -2
  114. metadata +6 -42
  115. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb +0 -53
  116. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.md +0 -5
  117. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -50
  118. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +0 -1
  119. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -57
  120. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +0 -5
  121. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +0 -5600
  122. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +0 -4
  123. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +0 -16
  124. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +0 -31
  125. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +0 -6
  126. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +0 -95
  127. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +0 -87
  128. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +0 -2
  129. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +0 -75
  130. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +0 -1
  131. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +0 -108
  132. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +0 -2
  133. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +0 -94
  134. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
  135. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +0 -83
  136. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +0 -3
  137. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +0 -120
  138. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +0 -1
  139. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -35
  140. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +0 -4
  141. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +0 -18
  142. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +0 -88
  143. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +0 -64
  144. data/app/pb_kits/playbook/tokens/_height.scss +0 -19
  145. data/app/pb_kits/playbook/tokens/exports/_height.module.scss +0 -37
  146. data/app/pb_kits/playbook/utilities/_height.scss +0 -33
  147. data/app/pb_kits/playbook/utilities/_width.scss +0 -45
  148. data/dist/chunks/_typeahead-l1kq1p9m.js +0 -22
  149. data/dist/chunks/_weekday_stacked-B28kYXl9.js +0 -45
  150. data/lib/playbook/height.rb +0 -29
  151. data/lib/playbook/max_height.rb +0 -29
  152. data/lib/playbook/min_height.rb +0 -29
@@ -19,16 +19,6 @@
19
19
  font-weight: $bolder;
20
20
  }
21
21
  }
22
- }
23
- }
24
-
25
- .dark & {
26
- [class*=pb_nav_list_kit_item][class*=pb_nav_list_item] {
27
- &[class*=_link] {
28
- &[class*=_active] {
29
- box-shadow: 0 2px 10px 0 $shadow_dark;
30
- }
31
- }
32
- }
22
+ }
33
23
  }
34
24
  }
@@ -223,7 +223,6 @@
223
223
  }
224
224
  }
225
225
  [class*="pb_collapsible_nav_item"][class*="pb_nav_list_item_link_collapsible"][class*="pb_nav_list_kit_item"] {
226
- box-shadow: unset !important;
227
226
  .pb_nav_list_item_text_collapsible {
228
227
  color: $white !important;
229
228
  }
@@ -241,17 +240,11 @@
241
240
 
242
241
  .pb_collapsible_main_kit:hover {
243
242
  background-color: mix($white, $card_dark, 20%);
244
- .pb_nav_list_item_text_collapsible {
245
- color: $white !important;
246
- }
247
- }
248
-
249
- .pb_collapsible_main_kit {
243
+ .pb_nav_list_item_text_collapsible,
250
244
  svg {
251
- color: $text_dk_default !important;
245
+ color: $white !important;
252
246
  }
253
247
  }
254
-
255
248
  .icon_wrapper:hover {
256
249
  background-color: mix($white, $card_dark, 40%);
257
250
  }
@@ -263,13 +256,6 @@
263
256
  }
264
257
  }
265
258
  }
266
-
267
- &[class*="_active"] {
268
- > .pb_collapsible_main_kit {
269
- background-color: $primary;
270
- box-shadow: 0 2px 10px 0 $shadow_dark;
271
- }
272
- }
273
259
  }
274
260
  }
275
261
  }
@@ -115,7 +115,7 @@ $selector: ".pb_nav_list";
115
115
  }
116
116
  [class*="_item_text"],
117
117
  [class*="_item_icon"] {
118
- color: $text_dk_light !important;
118
+ color: $text_dk_lighter !important;
119
119
  }
120
120
  &[class*="_link"] {
121
121
  &:hover {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps, globalInlineProps } from '../utilities/globalProps'
4
+ import { globalProps } from '../utilities/globalProps'
5
5
  import OverlayPercentage from './subcomponents/_overlay_percentage'
6
6
  import OverlayToken from './subcomponents/_overlay_token'
7
7
 
@@ -39,7 +39,6 @@ const Overlay = (props: OverlayProps) => {
39
39
  const dataProps = buildDataProps(data)
40
40
  const classes = classnames(buildCss('pb_overlay'), globalProps(props), className)
41
41
  const htmlProps = buildHtmlProps(htmlOptions)
42
- const dynamicInlineProps = globalInlineProps(props)
43
42
 
44
43
  const getPosition = () => {
45
44
  return Object.keys(layout)[0]
@@ -58,7 +57,6 @@ const Overlay = (props: OverlayProps) => {
58
57
  {...htmlProps}
59
58
  className={classes}
60
59
  id={id}
61
- style={dynamicInlineProps}
62
60
  >
63
61
  {isSizePercentage ?
64
62
  OverlayPercentage({
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import classnames from 'classnames'
3
- import { GlobalProps, globalProps } from '../utilities/globalProps'
3
+ import { globalProps } from '../utilities/globalProps'
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import Icon from '../pb_icon/_icon';
6
6
 
@@ -14,7 +14,7 @@ type PaginationProps = {
14
14
  onChange?: (pageNumber: number) => void;
15
15
  range?: number;
16
16
  total?: number;
17
- } & GlobalProps;
17
+ };
18
18
 
19
19
  const Pagination = ( props: PaginationProps) => {
20
20
  const {
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps, GlobalProps } from '../utilities/globalProps'
5
-
6
- type ModifiedGlobalProps = Omit<GlobalProps, 'width'>
4
+ import { globalProps } from '../utilities/globalProps'
7
5
 
8
6
  type ProgressSimpleProps = {
9
7
  align?: "left" | "center" | "right",
@@ -18,7 +16,7 @@ type ProgressSimpleProps = {
18
16
  value: number,
19
17
  variant?: "default" | "positive" | "negative" | "warning",
20
18
  width: string,
21
- } & ModifiedGlobalProps
19
+ }
22
20
 
23
21
  const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
24
22
  const {
@@ -58,7 +56,7 @@ const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
58
56
  )
59
57
 
60
58
  return (
61
- <div
59
+ <div
62
60
  {...dataProps}
63
61
  {...htmlProps}
64
62
  className={wrapperClass}
@@ -1,10 +1,9 @@
1
- <%= content_tag(:div,
2
- class: object.wrapper_classname,
3
- style: object.style) do %>
1
+ <%= content_tag(:div, class: object.wrapper_classname) do %>
4
2
  <%= content_tag(:div,
5
3
  id: object.id,
6
4
  data: object.data_values,
7
5
  class: object.classname,
6
+ style: object.style,
8
7
  **combined_html_options) do %>
9
8
  <%= content_tag(:div, "",
10
9
  class: "progress_simple_value",
@@ -21,11 +21,6 @@ module Playbook
21
21
  values: %w[default positive negative warning],
22
22
  default: "default"
23
23
 
24
- # Explicitly defining the width prop here so the local prop takes precedence over global width prop
25
- def width
26
- prop(:width)
27
- end
28
-
29
24
  def number_value
30
25
  validate_required_progress_props
31
26
 
@@ -19,11 +19,8 @@ $section_colors_dark: (
19
19
  align-items: center;
20
20
  position: relative;
21
21
  span {
22
- padding: 0;
22
+ padding: 0 $space_xs;
23
23
  display: flex;
24
- [class*="pb_caption_kit"] {
25
- padding: 0 $space_xs;
26
- }
27
24
  }
28
25
  &::before {
29
26
  content: "";
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
- import { globalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Caption from '../pb_caption/_caption'
8
8
 
@@ -38,7 +38,6 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
38
38
  const dataProps = buildDataProps(data)
39
39
  const htmlProps = buildHtmlProps(htmlOptions)
40
40
  const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : ""), globalProps(props), className)
41
- const dynamicInlineProps = globalInlineProps(props)
42
41
 
43
42
  return (
44
43
 
@@ -48,7 +47,6 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
48
47
  {...htmlProps}
49
48
  className={classes}
50
49
  id={id}
51
- style={dynamicInlineProps}
52
50
  >
53
51
  {
54
52
  children && children ||
@@ -151,7 +151,7 @@ $pb_selectable_paddings: (
151
151
  input[type="radio"] {
152
152
  &:checked ~ label {
153
153
  border-width: $pb_card_border_width;
154
- outline: 1px solid $primary_action_dark;
154
+ outline: 1px solid $primary;
155
155
  }
156
156
  }
157
157
  }
@@ -161,11 +161,11 @@ $pb_selectable_paddings: (
161
161
  color: $white;
162
162
  > label {
163
163
  @include pb_card_dark;
164
- background: $bg_dark_card;
164
+ background: transparent;
165
165
 
166
166
  .pb_selectable_card_circle {
167
167
  border-color: $bg_dark;
168
- background: $primary_action_dark;
168
+ background: $primary-action;
169
169
  }
170
170
  }
171
171
 
@@ -173,7 +173,7 @@ $pb_selectable_paddings: (
173
173
  input[type="radio"] {
174
174
  &:checked ~ label {
175
175
  @include pb_card_selected_dark;
176
- background: $bg_dark_card;
176
+ background: transparent;
177
177
  }
178
178
  }
179
179
 
@@ -6,7 +6,6 @@
6
6
  value: "selected_with_icon",
7
7
  checked: true,
8
8
  icon: true,
9
-
10
9
  }) do %>
11
10
  Selected, with icon
12
11
  <% end %>
@@ -37,4 +36,4 @@
37
36
  Disabled
38
37
  <% end %>
39
38
 
40
- </div>
39
+ </div>
@@ -35,7 +35,7 @@
35
35
  <% end %>
36
36
  <% else %>
37
37
  <% if content.nil? %>
38
- <%= pb_rails("body", props: { text: object.text, dark: object.dark }) %>
38
+ <%= pb_rails("body", props: { text: object.text }) %>
39
39
  <% else %>
40
40
  <%= content %>
41
41
  <% end %>
@@ -1,46 +1,40 @@
1
- import React from "react"
2
- import classnames from "classnames"
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
3
 
4
- import { buildCss, buildHtmlProps } from "../utilities/props"
5
- import { globalProps } from "../utilities/globalProps"
4
+ import { buildCss, buildHtmlProps } from '../utilities/props'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
- import Body from "../pb_body/_body"
8
- import Icon from "../pb_icon/_icon"
7
+ import Body from '../pb_body/_body'
8
+ import Icon from '../pb_icon/_icon'
9
9
 
10
- const statusMap: {
11
- neutral: "neutral"
12
- decrease: "negative"
13
- increase: "positive"
14
- } = {
15
- increase: "positive",
16
- decrease: "negative",
17
- neutral: "neutral",
10
+ const statusMap: {neutral: 'neutral', decrease: 'negative' ,increase: 'positive'} = {
11
+ increase: 'positive',
12
+ decrease: 'negative',
13
+ neutral: 'neutral',
18
14
  }
19
15
 
20
16
  const iconMap = {
21
- increase: "arrow-up",
22
- decrease: "arrow-down",
17
+ increase: 'arrow-up',
18
+ decrease: 'arrow-down',
23
19
  }
24
20
 
25
21
  type StatChangeProps = {
26
- change?: "increase" | "decrease" | "neutral"
27
- className?: string
28
- dark?: boolean
29
- icon?: string
30
- id?: string
31
- htmlOptions?: { [key: string]: string | number | boolean | (() => void) }
32
- value?: string | number
22
+ change?: 'increase' | 'decrease' | 'neutral',
23
+ className?: string,
24
+ icon?: string,
25
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
26
+ id?: string,
27
+ value?: string | number,
33
28
  }
34
29
 
35
30
  const StatChange = (props: StatChangeProps): React.ReactElement => {
36
- const {
37
- change = "neutral",
38
- className,
39
- dark = false,
31
+ const {
32
+ change = 'neutral',
33
+ className,
40
34
  htmlOptions = {},
41
- icon,
42
- id,
43
- value,
35
+ icon,
36
+ id,
37
+ value
44
38
  } = props
45
39
 
46
40
  const status = statusMap[change as keyof typeof statusMap]
@@ -53,32 +47,30 @@ const StatChange = (props: StatChangeProps): React.ReactElement => {
53
47
 
54
48
  return (
55
49
  <>
56
- {value && (
50
+ {value &&
57
51
  <div
58
52
  className={classnames(
59
- buildCss("pb_stat_change_kit", status),
60
- globalProps(props),
61
- className
62
- )}
53
+ buildCss('pb_stat_change_kit', status),
54
+ globalProps(props),
55
+ className
56
+ )}
63
57
  id={id}
64
58
  {...htmlProps}
65
59
  >
66
- <Body dark={dark}
67
- status={status}
68
- >
69
- {" "}
70
- {returnedIcon && (
60
+ <Body status={status}>
61
+ {returnedIcon &&
71
62
  <>
72
- <Icon dark={dark}
63
+ <Icon
73
64
  fixed_width
74
65
  icon={returnedIcon}
75
- />{" "}
66
+ />
67
+ {' '}
76
68
  </>
77
- )}
69
+ }
78
70
  {`${value}%`}
79
71
  </Body>
80
72
  </div>
81
- )}
73
+ }
82
74
  </>
83
75
  )
84
76
  }
@@ -1,6 +1,6 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("body", props: { status: object.status, dark: object.dark }) do %>
3
- <%= pb_rails("icon", props: { fixed_width: true, icon: object.returned_icon, dark: object.dark }) if object.returned_icon %>
4
- <%= "#{object.value}%" if object.value %>
5
- <% end %>
2
+ <%= pb_rails("body", props: { status: object.status }) do %>
3
+ <%= pb_rails("icon", props: { fixed_width: true, icon: object.returned_icon }) if object.returned_icon %>
4
+ <%= "#{object.value}%" if object.value %>
5
+ <% end %>
6
6
  <% end %>
@@ -1,14 +1,14 @@
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, GlobalProps, globalInlineProps } from '../utilities/globalProps'
4
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
5
5
  import PbTable from '.'
6
6
  import {
7
- TableHead,
8
- TableHeader,
9
- TableBody,
10
- TableRow,
11
- TableCell,
7
+ TableHead,
8
+ TableHeader,
9
+ TableBody,
10
+ TableRow,
11
+ TableCell,
12
12
  } from "./subcomponents";
13
13
 
14
14
  type TableProps = {
@@ -28,7 +28,6 @@ type TableProps = {
28
28
  singleLine?: boolean,
29
29
  size?: "sm" | "md" | "lg",
30
30
  sticky?: boolean,
31
- stickyLeftcolumn?: string[],
32
31
  striped?: boolean,
33
32
  tag?: "table" | "div",
34
33
  verticalBorder?: boolean,
@@ -52,7 +51,6 @@ const Table = (props: TableProps): React.ReactElement => {
52
51
  singleLine = false,
53
52
  size = 'sm',
54
53
  sticky = false,
55
- stickyLeftcolumn = [],
56
54
  striped = false,
57
55
  tag = 'table',
58
56
  verticalBorder = false,
@@ -66,7 +64,6 @@ const Table = (props: TableProps): React.ReactElement => {
66
64
  const spaceCssName = outerPadding !== 'none' ? 'space_' : ''
67
65
  const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
68
66
  const isTableTag = tag === 'table'
69
- const dynamicInlineProps = globalInlineProps(props)
70
67
 
71
68
  const classNames = classnames(
72
69
  'pb_table',
@@ -79,7 +76,6 @@ const Table = (props: TableProps): React.ReactElement => {
79
76
  'single-line': singleLine,
80
77
  'no-hover': disableHover,
81
78
  'sticky-header': sticky,
82
- 'sticky-left-column': stickyLeftcolumn,
83
79
  'striped': striped,
84
80
  [outerPaddingCss]: outerPadding !== '',
85
81
  },
@@ -89,56 +85,6 @@ const Table = (props: TableProps): React.ReactElement => {
89
85
  className
90
86
  )
91
87
 
92
- useEffect(() => {
93
- const handleStickyColumns = () => {
94
- let accumulatedWidth = 0;
95
-
96
- stickyLeftcolumn.forEach((colId, index) => {
97
- const isLastColumn = index === stickyLeftcolumn.length - 1;
98
- const header = document.querySelector(`th[id="${colId}"]`);
99
- const cells = document.querySelectorAll(`td[id="${colId}"]`);
100
-
101
- if (header) {
102
- header.classList.add('sticky');
103
- (header as HTMLElement).style.left = `${accumulatedWidth}px`;
104
-
105
- if (!isLastColumn) {
106
- header.classList.add('with-border');
107
- header.classList.remove('sticky-shadow');
108
- } else {
109
- header.classList.remove('with-border');
110
- header.classList.add('sticky-shadow');
111
- }
112
-
113
- accumulatedWidth += (header as HTMLElement).offsetWidth;
114
- }
115
-
116
- cells.forEach((cell) => {
117
- cell.classList.add('sticky');
118
- (cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
119
-
120
- if (!isLastColumn) {
121
- cell.classList.add('with-border');
122
- cell.classList.remove('sticky-shadow');
123
- } else {
124
- cell.classList.remove('with-border');
125
- cell.classList.add('sticky-shadow');
126
- }
127
- });
128
- });
129
- };
130
-
131
- setTimeout(() => {
132
- handleStickyColumns();
133
- }, 10);
134
-
135
- window.addEventListener('resize', handleStickyColumns);
136
-
137
- return () => {
138
- window.removeEventListener('resize', handleStickyColumns);
139
- };
140
- }, [stickyLeftcolumn]);
141
-
142
88
  useEffect(() => {
143
89
  const instance = new PbTable()
144
90
  instance.connect()
@@ -146,56 +92,26 @@ const Table = (props: TableProps): React.ReactElement => {
146
92
 
147
93
  return (
148
94
  <>
149
- {responsive === 'scroll' ? (
150
- <div className='table-responsive-scroll'>
151
- {isTableTag ? (
152
- <table
153
- {...ariaProps}
154
- {...dataProps}
155
- {...htmlProps}
156
- className={classNames}
157
- id={id}
158
- style={dynamicInlineProps}
159
- >
160
- {children}
161
- </table>
162
- ) : (
163
- <div
164
- {...ariaProps}
165
- {...dataProps}
166
- {...htmlProps}
167
- className={classNames}
168
- id={id}
169
- style={dynamicInlineProps}
170
- >
171
- {children}
172
- </div>
173
- )}
174
- </div>
95
+ {isTableTag ? (
96
+ <table
97
+ {...ariaProps}
98
+ {...dataProps}
99
+ {...htmlProps}
100
+ className={classNames}
101
+ id={id}
102
+ >
103
+ {children}
104
+ </table>
175
105
  ) : (
176
- isTableTag ? (
177
- <table
178
- {...ariaProps}
179
- {...dataProps}
180
- {...htmlProps}
181
- className={classNames}
182
- id={id}
183
- style={dynamicInlineProps}
184
- >
185
- {children}
186
- </table>
187
- ) : (
188
- <div
189
- {...ariaProps}
190
- {...dataProps}
191
- {...htmlProps}
192
- className={classNames}
193
- id={id}
194
- style={dynamicInlineProps}
195
- >
196
- {children}
197
- </div>
198
- )
106
+ <div
107
+ {...ariaProps}
108
+ {...dataProps}
109
+ {...htmlProps}
110
+ className={classNames}
111
+ id={id}
112
+ >
113
+ {children}
114
+ </div>
199
115
  )}
200
116
  </>
201
117
  )
@@ -55,8 +55,3 @@ examples:
55
55
  - table_with_subcomponents: Table with Sub Components (Table Elements)
56
56
  - table_with_subcomponents_as_divs: Table with Sub Components (Divs)
57
57
  - table_outer_padding: Outer Padding
58
- - table_with_collapsible: Table with Collapsible
59
- - table_with_collapsible_with_custom_click: Table with Collapsible with Custom Click
60
- - table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
61
- - table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
62
- - table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
@@ -25,9 +25,3 @@ export { default as TableDiv } from './_table_div.jsx'
25
25
  export { default as TableWithSubcomponents } from './_table_with_subcomponents.jsx'
26
26
  export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
27
27
  export { default as TableOuterPadding } from './_table_outer_padding.jsx'
28
- export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.jsx'
29
- export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
30
- export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
31
- export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
32
- export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
33
- export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'