playbook_ui 14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 → 14.8.0.pre.alpha.play1648heightglobalprops4559
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -7
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +2 -2
- data/app/pb_kits/playbook/pb_currency/currency.rb +1 -17
- data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +2 -1
- data/app/pb_kits/playbook/tokens/_height.scss +19 -0
- data/app/pb_kits/playbook/tokens/exports/_height.module.scss +37 -0
- data/app/pb_kits/playbook/utilities/_height.scss +29 -0
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +15 -0
- data/dist/chunks/{_typeahead-D0PihN_3.js → _typeahead-ZkBp8QRa.js} +1 -1
- data/dist/chunks/_weekday_stacked-BmqMRu1B.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +321 -0
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/classnames.rb +3 -0
- data/lib/playbook/height.rb +29 -0
- data/lib/playbook/kit_base.rb +6 -0
- data/lib/playbook/max_height.rb +29 -0
- data/lib/playbook/min_height.rb +29 -0
- data/lib/playbook/version.rb +1 -1
- metadata +10 -4
- data/dist/chunks/_weekday_stacked-CVx1CzK-.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba9b61505396d83dda5a66f647455f7300ffc61aa1568378549a848cf0a3e52d
|
4
|
+
data.tar.gz: 9c7a4c59e621094cf9f5c8115529bfcd202615811b3f08e2757b20204951a514
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e0bad5bbfc8b77967a3c379768451e525e1472e6bd64039070493bd045e1fe836f778f04d3b5a5b18b1af6b871c4182bbe3a3d9f3e1d493972a7394747a038
|
7
|
+
data.tar.gz: f6814ca019c793c26280102244bf5c65a4c9cd44c08f50ca55c8e6b57330714d66972766a6cbdbf29c7ed514e67ee9461158b53be9ab1c41d9e618765e772227
|
@@ -101,11 +101,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
101
101
|
return decimalPart ? `${formattedWhole}.${decimalPart}` : formattedWhole;
|
102
102
|
}
|
103
103
|
|
104
|
-
const
|
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>{
|
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
|
-
{
|
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.
|
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.
|
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:
|
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
|
@@ -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,29 @@
|
|
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);
|
@@ -361,6 +361,21 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
361
361
|
css += maxWidth ? `max_width_${filterClassName(maxWidth)} ` : ''
|
362
362
|
return css.trimEnd()
|
363
363
|
},
|
364
|
+
minHeightProps: ({ minHeight }: MinHeight) => {
|
365
|
+
let css = ''
|
366
|
+
css += minHeight ? `min_height_${filterClassName(minHeight)} ` : ''
|
367
|
+
return css.trimEnd()
|
368
|
+
},
|
369
|
+
maxHeightProps: ({ maxHeight }: MaxHeight) => {
|
370
|
+
let css = ''
|
371
|
+
css += maxHeight ? `max_height_${filterClassName(maxHeight)} ` : ''
|
372
|
+
return css.trimEnd()
|
373
|
+
},
|
374
|
+
heightProps: ({ height }: Height) => {
|
375
|
+
let css = ''
|
376
|
+
css += height ? `height_${filterClassName(height)} ` : ''
|
377
|
+
return css.trimEnd()
|
378
|
+
},
|
364
379
|
zIndexProps: (zIndex: ZIndex) => {
|
365
380
|
let css = ''
|
366
381
|
Object.entries(zIndex).forEach((zIndexEntry) => {
|