playbook_ui 14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 → 14.8.0.pre.alpha.PLAY16254545

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1129b60a8057cb4a47a1cd2a7fbfe1ab4a6566d84a3ee8413f494694d17d13b
4
- data.tar.gz: 1488209f50dca59f1e932ff6b53183e1772718e0d5664e1d7b05e49c0d2994df
3
+ metadata.gz: 0b2b5ad03216b06c9f37e1792a0b208efbfd3d44b79f73696e1a3b006f89228c
4
+ data.tar.gz: 282f44cd7aee29b4bc0ca84396be2a914a3786e91c8b308c5e7f284b84d4d74c
5
5
  SHA512:
6
- metadata.gz: 1e0e520ba271f69218c9f0b812bfac695491c19105b34a4df62d3ba7cfaa209f29a8bcab3dd08900910d2aca5920d1eb72b2d44d9eefb84a60b3538554d8b378
7
- data.tar.gz: c7ebb609bf8a7f21fb85cb161e0ddd39b798193e493cdef6bfd3d8feb821f8f837a5c6caeb37167d4ca33678fabbdf211dc704d89603fdcbf1d58116bfd4c8e9
6
+ metadata.gz: 0b14587326a80d3f8a7663ab14df6c51720aae8ad3a3492370dd853a956292a7b80901b2782e6ea04fbdb37b38d7810490234b4396bc9c891158432c208578f4
7
+ data.tar.gz: a1f50ae88764cf79258478662bd9cd294b394d8c3cbd3c96580045ba2a5a67c3d924d9ee0170daf134ca9400078c4709c18dff06ea98927392f412343b5d7216
@@ -101,11 +101,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
101
101
  return decimalPart ? `${formattedWhole}.${decimalPart}` : formattedWhole;
102
102
  }
103
103
 
104
- const swapNegative = size === "sm" && symbol !== ""
105
- const handleNegative = amount.startsWith("-") && swapNegative ? "-" : ""
106
- const getAbsoluteAmount = (amountString: string) => amountString.replace(/^-/,'')
107
- const getAbbrOrFormatAmount = abbreviate ? getAbbreviatedValue('amount') : formatAmount(getMatchingDecimalAmount)
108
- const getAmount = swapNegative ? getAbsoluteAmount(getAbbrOrFormatAmount) : getAbbrOrFormatAmount
104
+ const getAmount = abbreviate ? getAbbreviatedValue('amount') : formatAmount(getMatchingDecimalAmount)
109
105
  const getAbbreviation = abbreviate ? getAbbreviatedValue('unit') : null
110
106
  const getDecimalValue = abbreviate ? '' : getMatchingDecimalValue
111
107
 
@@ -122,7 +118,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
122
118
  <div className={`pb_currency_wrapper${variantClass || emphasizedClass}`}>
123
119
  {unstyled ? (
124
120
  <>
125
- <div>{handleNegative}{symbol}</div>
121
+ <div>{symbol}</div>
126
122
  <div>{getAmount}</div>
127
123
  <div>
128
124
  {getAbbreviation}
@@ -136,7 +132,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
136
132
  color="light"
137
133
  dark={dark}
138
134
  >
139
- {handleNegative}{symbol}
135
+ {symbol}
140
136
  </Body>
141
137
 
142
138
  <Title
@@ -3,12 +3,12 @@
3
3
 
4
4
  <div class=<%= "pb_currency_wrapper#{object.variant_class || object.emphasized_class}" %>>
5
5
  <% if object.unstyled %>
6
- <div><%= object.negative_sign %><%= object.symbol %></div>
6
+ <div><%= object.symbol %></div>
7
7
  <div><%= object.title_props[:text] %></div>
8
8
  <div><%= object.body_props[:text] %></div>
9
9
  <% else %>
10
10
  <%= pb_rails("body", props: object.currency_wrapper_props) do %>
11
- <%= object.negative_sign %><%= object.symbol %>
11
+ <%= object.symbol %>
12
12
  <% end %>
13
13
  <%= pb_rails("title", props: object.title_props) %>
14
14
  <%= pb_rails("body", props: object.body_props) %>
@@ -68,20 +68,12 @@ module Playbook
68
68
  def title_props
69
69
  {
70
70
  size: size_value,
71
- text: swap_negative ? absolute_amount(abbr_or_format_amount) : abbr_or_format_amount,
71
+ text: abbreviate ? abbreviated_value : formatted_amount,
72
72
  classname: "pb_currency_value",
73
73
  dark: dark,
74
74
  }
75
75
  end
76
76
 
77
- def abbr_or_format_amount
78
- abbreviate ? abbreviated_value : formatted_amount
79
- end
80
-
81
- def negative_sign
82
- amount.starts_with?("-") && swap_negative ? "-" : ""
83
- end
84
-
85
77
  def body_props
86
78
  {
87
79
  text: units_element,
@@ -167,14 +159,6 @@ module Playbook
167
159
  whole_value
168
160
  end
169
161
  end
170
-
171
- def absolute_amount(amount_string)
172
- amount_string.sub(/^-/, "")
173
- end
174
-
175
- def swap_negative
176
- size == "sm" && symbol != ""
177
- end
178
162
  end
179
163
  end
180
164
  end
@@ -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
  }