playbook_ui 14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4316 → 14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4247

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -2
  3. data/app/pb_kits/playbook/pb_currency/_currency.tsx +6 -16
  4. data/app/pb_kits/playbook/pb_currency/currency.rb +11 -38
  5. data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -35
  6. data/app/pb_kits/playbook/pb_currency/docs/example.yml +1 -3
  7. data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
  8. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +7 -8
  9. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
  10. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
  11. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +2 -2
  12. data/app/pb_kits/playbook/tokens/_typography.scss +0 -35
  13. data/dist/chunks/_weekday_stacked-Cyqgh5-q.js +45 -0
  14. data/dist/chunks/vendor.js +1 -1
  15. data/dist/menu.yml +0 -3
  16. data/dist/playbook-doc.js +1 -1
  17. data/dist/playbook.css +1 -1
  18. data/lib/playbook/version.rb +1 -1
  19. metadata +3 -23
  20. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb +0 -7
  21. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx +0 -18
  22. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md +0 -3
  23. data/app/pb_kits/playbook/pb_link/_link.scss +0 -66
  24. data/app/pb_kits/playbook/pb_link/_link.tsx +0 -107
  25. data/app/pb_kits/playbook/pb_link/docs/_link_color.html.erb +0 -30
  26. data/app/pb_kits/playbook/pb_link/docs/_link_color.jsx +0 -40
  27. data/app/pb_kits/playbook/pb_link/docs/_link_disabled.html.erb +0 -5
  28. data/app/pb_kits/playbook/pb_link/docs/_link_disabled.jsx +0 -15
  29. data/app/pb_kits/playbook/pb_link/docs/_link_icon.html.erb +0 -15
  30. data/app/pb_kits/playbook/pb_link/docs/_link_icon.jsx +0 -25
  31. data/app/pb_kits/playbook/pb_link/docs/_link_tag.html.erb +0 -35
  32. data/app/pb_kits/playbook/pb_link/docs/_link_tag.jsx +0 -45
  33. data/app/pb_kits/playbook/pb_link/docs/_link_underline.html.erb +0 -5
  34. data/app/pb_kits/playbook/pb_link/docs/_link_underline.jsx +0 -15
  35. data/app/pb_kits/playbook/pb_link/docs/example.yml +0 -16
  36. data/app/pb_kits/playbook/pb_link/docs/index.js +0 -5
  37. data/app/pb_kits/playbook/pb_link/link.html.erb +0 -21
  38. data/app/pb_kits/playbook/pb_link/link.rb +0 -44
  39. data/app/pb_kits/playbook/pb_link/link.test.jsx +0 -92
  40. data/dist/chunks/_weekday_stacked-DCgkKIQf.js +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 845eb3cdd33a7fef9c5af145bcf680907b6c74d5126bba69805acf33f3ff6a48
4
- data.tar.gz: 18d01e30a45050069d838577a03df29a892c7ebe042ca8a252ed68b665fd7c56
3
+ metadata.gz: '0896cae36211162e8819470663f9dedb1716254cd40cb3a59c20caafd4d23b2d'
4
+ data.tar.gz: 713356bd680806bce64921cdcdd51e74e562b79b9cee92bff6b7d2ef4602e436
5
5
  SHA512:
6
- metadata.gz: 06afa342868f031819a728684e905aaeb09445e855ac28938e3b746deb93e37bc0b0ff22f6d133d9b80f005c420cb3e500b3081f12e688844238658ba8ded457
7
- data.tar.gz: '08f62a0749684bc633d09aed01b768aae32d2569fa0ee13224647bce0152ccce9016931104990822e12218c46e955cee0b81baafec0897c710407a979b7007b1'
6
+ metadata.gz: 41b0df84cd4c1c54944f10026c6fb846bf9cff9016a376750c904321c40b0f7f16a4bf7372078f5d8a8d1f2048766c0726aabf89da3c0db5e79a2f41ecdb62b9
7
+ data.tar.gz: 92d6d3a078efc32f7de1cff32648381ac14d1bf74ff33ea749ca9fd50d61f5991a2a5a4a9661fb2c50688c6df4880ee34f78dd631882e973abec6b43d805d7a4
@@ -30,7 +30,6 @@
30
30
  @import 'pb_dialog/dialog';
31
31
  @import 'pb_distribution_bar/distribution_bar';
32
32
  @import 'pb_draggable/draggable';
33
- @import 'pb_drawer/drawer';
34
33
  @import 'pb_dropdown/dropdown';
35
34
  @import 'pb_file_upload/file_upload';
36
35
  @import 'pb_filter/filter';
@@ -55,7 +54,6 @@
55
54
  @import 'pb_legend/legend';
56
55
  @import 'pb_lightbox/lightbox';
57
56
  @import 'pb_line_graph/line_graph';
58
- @import 'pb_link/link';
59
57
  @import 'pb_list/list';
60
58
  @import 'pb_loading_inline/loading_inline';
61
59
  @import 'pb_map/map';
@@ -108,6 +106,7 @@
108
106
  @import 'pb_user_badge/user_badge';
109
107
  @import 'pb_walkthrough/walkthrough';
110
108
  @import 'pb_weekday_stacked/weekday_stacked';
109
+ @import 'pb_drawer/drawer';
111
110
  @import 'utilities/mixins';
112
111
  @import 'utilities/spacing';
113
112
  @import 'utilities/cursor';
@@ -26,7 +26,6 @@ type CurrencyProps = {
26
26
  variant?: 'default' | 'light' | 'bold',
27
27
  unit?: string,
28
28
  unstyled?: boolean,
29
- commaSeparator?: boolean,
30
29
  }
31
30
 
32
31
  const sizes: {lg: 1, md: 3, sm: 4} = {
@@ -54,7 +53,6 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
54
53
  variant = 'default',
55
54
  dark = false,
56
55
  unstyled = false,
57
- commaSeparator = false,
58
56
  } = props
59
57
 
60
58
  const emphasizedClass = emphasized ? '' : '_deemphasized'
@@ -76,7 +74,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
76
74
  className
77
75
  )
78
76
 
79
- const getFormattedNumber = (input: number | any) => new Intl.NumberFormat('en-US', {
77
+ const getFormattedNumber = (input: number | any ) => new Intl.NumberFormat('en-US', {
80
78
  notation: 'compact',
81
79
  maximumFractionDigits: 1,
82
80
  }).format(input)
@@ -90,20 +88,12 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
90
88
  return isAmount ? num.slice(0, -1) : isUnit ? num.slice(-1) : ''
91
89
  }
92
90
 
93
- const getMatchingDecimalAmount = decimals === "matching" ? amount : whole
94
- const getMatchingDecimalValue = decimals === "matching" ? '' : `.${decimal}`
91
+ const getMatchingDecimalAmount = decimals === "matching" ? amount : whole,
92
+ getMatchingDecimalValue = decimals === "matching" ? '' : `.${decimal}`
95
93
 
96
- const formatAmount = (amount: string) => {
97
- if (!commaSeparator) return amount;
98
-
99
- const [wholePart, decimalPart] = amount.split('.');
100
- const formattedWhole = new Intl.NumberFormat('en-US').format(parseInt(wholePart));
101
- return decimalPart ? `${formattedWhole}.${decimalPart}` : formattedWhole;
102
- }
103
-
104
- const getAmount = abbreviate ? getAbbreviatedValue('amount') : formatAmount(getMatchingDecimalAmount)
105
- const getAbbreviation = abbreviate ? getAbbreviatedValue('unit') : null
106
- const getDecimalValue = abbreviate ? '' : getMatchingDecimalValue
94
+ const getAmount = abbreviate ? getAbbreviatedValue('amount') : getMatchingDecimalAmount,
95
+ getAbbreviation = abbreviate ? getAbbreviatedValue('unit') : null,
96
+ getDecimalValue = abbreviate ? '' : getMatchingDecimalValue
107
97
 
108
98
  return (
109
99
  <div
@@ -43,9 +43,6 @@ module Playbook
43
43
  prop :unstyled, type: Playbook::Props::Boolean,
44
44
  default: false
45
45
 
46
- prop :comma_separator, type: Playbook::Props::Boolean,
47
- default: false
48
-
49
46
  def classname
50
47
  generate_classname("pb_currency_kit", align, size, dark_class)
51
48
  end
@@ -68,7 +65,7 @@ module Playbook
68
65
  def title_props
69
66
  {
70
67
  size: size_value,
71
- text: abbreviate ? abbreviated_value : formatted_amount,
68
+ text: abbreviate ? abbreviated_value : whole_value,
72
69
  classname: "pb_currency_value",
73
70
  dark: dark,
74
71
  }
@@ -99,38 +96,28 @@ module Playbook
99
96
  private
100
97
 
101
98
  def whole_value
102
- value = amount.split(".").first
103
- if comma_separator
104
- number_with_delimiter(value.gsub(",", ""))
105
- else
106
- value
107
- end
99
+ return amount if decimals == "matching"
100
+
101
+ amount.split(".").first.to_s
108
102
  end
109
103
 
110
- def decimal_value
111
- amount.split(".")[1] || "00"
104
+ def abbreviated_value(index = 0..-2)
105
+ value = amount.split(".").first.split(",").join("")
106
+ abbreviated_num = number_to_human(value, units: { thousand: "K", million: "M", billion: "B", trillion: "T" }).gsub(/\s+/, "").to_s
107
+ abbreviated_num[index]
112
108
  end
113
109
 
114
110
  def units_element
115
111
  return "" if decimals == "matching" && !abbreviate && !unit
116
112
 
117
- if unit.nil? && !abbreviate
118
- if decimals == "matching"
119
- ""
120
- else
121
- ".#{decimal_value}"
122
- end
113
+ _, decimal_part = amount.split(".")
114
+ if unit.nil? && abbreviate == false
115
+ decimal_part.nil? ? ".00" : ".#{decimal_part}"
123
116
  else
124
117
  abbreviate ? "#{abbreviated_value(-1)}#{unit}" : unit
125
118
  end
126
119
  end
127
120
 
128
- def abbreviated_value(index = 0..-2)
129
- value = amount.split(".").first.gsub(",", "").to_i
130
- abbreviated_num = number_to_human(value, units: { thousand: "K", million: "M", billion: "B", trillion: "T" }).gsub(/\s+/, "")
131
- abbreviated_num[index]
132
- end
133
-
134
121
  def size_value
135
122
  case size
136
123
  when "lg"
@@ -145,20 +132,6 @@ module Playbook
145
132
  def dark_class
146
133
  dark ? "dark" : nil
147
134
  end
148
-
149
- def formatted_amount
150
- return abbreviated_value if abbreviate
151
-
152
- if decimals == "matching"
153
- if comma_separator
154
- number_with_delimiter(amount.gsub(",", ""))
155
- else
156
- amount
157
- end
158
- else
159
- whole_value
160
- end
161
- end
162
135
  end
163
136
  end
164
137
  end
@@ -61,38 +61,3 @@ test('decimals default prop returns decimals as body text', () => {
61
61
  expect(currencyKit.querySelector('.pb_currency_value')).toHaveTextContent('320')
62
62
  expect(currencyKit.querySelector('.unit')).toHaveTextContent('.20')
63
63
  })
64
-
65
-
66
- test('commaSeparator prop returns comma separated amount', () => {
67
- render(
68
- <Currency
69
- amount="1234567890"
70
- commaSeparator
71
- data={{ testid: 'comma-test' }}
72
- />
73
- )
74
- expect(screen.getByTestId('comma-test')).toHaveTextContent('1,234,567,890')
75
- })
76
-
77
- test('commaSeparator prop returns comma separated amount with decimals', () => {
78
- render(
79
- <Currency
80
- amount="1234567890.12"
81
- commaSeparator
82
- data={{ testid: 'comma-test-decimals' }}
83
- />
84
- )
85
- expect(screen.getByTestId('comma-test-decimals')).toHaveTextContent('1,234,567,890.12')
86
- })
87
-
88
- test('commaSeparator prop returns comma separated amount with decimals="matching"', () => {
89
- render(
90
- <Currency
91
- amount="1234567890.12"
92
- commaSeparator
93
- data={{ testid: 'comma-test-decimals-matching' }}
94
- decimals="matching"
95
- />
96
- )
97
- expect(screen.getByTestId('comma-test-decimals-matching')).toHaveTextContent('1,234,567,890.12')
98
- })
@@ -8,8 +8,7 @@ examples:
8
8
  - currency_abbreviated: Abbreviate Larger Amounts
9
9
  - currency_matching_decimals: Matching Decimals
10
10
  - currency_unstyled: Unstyled
11
- - currency_comma_separator: Comma Separator
12
-
11
+
13
12
  react:
14
13
  - currency_variants: Variants
15
14
  - currency_size: Size
@@ -18,7 +17,6 @@ examples:
18
17
  - currency_abbreviated: Abbreviate Larger Amounts
19
18
  - currency_matching_decimals: Matching Decimals
20
19
  - currency_unstyled: Unstyled
21
- - currency_comma_separator: Comma Separator
22
20
 
23
21
  swift:
24
22
  - currency_size_swift: Size
@@ -5,4 +5,3 @@ export { default as CurrencyNoSymbol } from './_currency_no_symbol.jsx'
5
5
  export { default as CurrencyAbbreviated } from './_currency_abbreviated.jsx'
6
6
  export { default as CurrencyMatchingDecimals } from './_currency_matching_decimals.jsx'
7
7
  export { default as CurrencyUnstyled } from './_currency_unstyled.jsx'
8
- export { default as CurrencyCommaSeparator } from './_currency_comma_separator.jsx'
@@ -47,7 +47,7 @@ interface DropdownComponent
47
47
  Container: typeof DropdownContainer;
48
48
  }
49
49
 
50
- let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
50
+ const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
51
51
  const {
52
52
  aria = {},
53
53
  autocomplete = false,
@@ -260,7 +260,7 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
260
260
  <DropdownContainer>
261
261
  {optionsWithBlankSelection &&
262
262
  optionsWithBlankSelection?.map((option: GenericObject) => (
263
- <DropdownOption key={option.id}
263
+ <Dropdown.Option key={option.id}
264
264
  option={option}
265
265
  />
266
266
  ))}
@@ -278,12 +278,11 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
278
278
  </DropdownContext.Provider>
279
279
  </div>
280
280
  )
281
- }
281
+ }) as DropdownComponent
282
282
 
283
- Dropdown = forwardRef(Dropdown) as unknown as DropdownComponent;
284
- (Dropdown as DropdownComponent).displayName = "Dropdown";
285
- (Dropdown as DropdownComponent).Option = DropdownOption;
286
- (Dropdown as DropdownComponent).Trigger = DropdownTrigger;
287
- (Dropdown as DropdownComponent).Container = DropdownContainer;
283
+ Dropdown.displayName = "Dropdown";
284
+ Dropdown.Option = DropdownOption;
285
+ Dropdown.Trigger = DropdownTrigger;
286
+ Dropdown.Container = DropdownContainer;
288
287
 
289
288
  export default Dropdown;
@@ -129,7 +129,7 @@ $pb_selectable_paddings: (
129
129
  }
130
130
  }
131
131
 
132
- &.display_input {
132
+ &[class*=_display_input] {
133
133
  input[type="checkbox"],
134
134
  input[type="radio"] {
135
135
  &:checked {
@@ -66,8 +66,8 @@ const SelectableCard = (props: SelectableCardProps) => {
66
66
  'checked': checked,
67
67
  'disabled': disabled,
68
68
  'enabled': !disabled,
69
+ 'display_input': variant === 'displayInput',
69
70
  }),
70
- variant === 'displayInput' ? 'display_input' : '',
71
71
  { error },
72
72
  dark ? 'dark' : '',
73
73
  className
@@ -25,7 +25,7 @@ module Playbook
25
25
 
26
26
  def classname
27
27
  [
28
- generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class) + display_input_class,
28
+ generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class, display_input_class),
29
29
  error_class,
30
30
  dark_props,
31
31
  ].compact.join(" ")
@@ -81,7 +81,7 @@ module Playbook
81
81
  end
82
82
 
83
83
  def display_input_class
84
- variant == "display_input" ? " display_input" : ""
84
+ variant == "display_input" ? "display_input" : nil
85
85
  end
86
86
  end
87
87
  end
@@ -1,5 +1,3 @@
1
- @import "../tokens/colors";
2
-
3
1
  $font_family_base: "Power Centra", "Helvetica Neue", Helvetica, Arial, sans_serif !default;
4
2
 
5
3
  /* CLEAN UP AND REMOVE */
@@ -53,36 +51,3 @@ $boldest: 700 !default;
53
51
  $bolder: 700 !default;
54
52
  $light: 300 !default;
55
53
  $lighter: 300 !default;
56
-
57
- /* Link Colors */
58
- $pb_link_colors: (
59
- default: $primary_action,
60
- body: $text_lt_default,
61
- muted: $text_lt_light,
62
- destructive: $error,
63
- );
64
-
65
- $pb_link_hover_colors: (
66
- default: $text_lt_default,
67
- body: $primary_action,
68
- muted: $text_lt_default,
69
- destructive: $text_lt_default,
70
- );
71
-
72
- $pb_dark_link_colors: (
73
- default: $active_dark,
74
- body: $text_dk_default,
75
- muted: $text_dk_light,
76
- destructive: $error_dark,
77
- );
78
-
79
- $pb_dark_link_hover_colors: (
80
- default: $text_dk_default,
81
- body: $active_dark,
82
- muted: $text_dk_default,
83
- destructive: $text_dk_default,
84
- );
85
-
86
- @mixin pb_link($color: $primary_action) {
87
- color: $color;
88
- }