playbook_ui 14.0.0.pre.alpha.PLAY1475bumpaxecoredependency3483 → 14.0.0.pre.alpha.PLAY14113475
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/pb_badge/_badge.scss +6 -0
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +4 -2
- data/app/pb_kits/playbook/pb_badge/badge.rb +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.test.js +17 -11
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.html.erb +13 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.jsx +31 -12
- data/dist/chunks/{_typeahead-D6PRvP-1.js → _typeahead-eBLGedV-.js} +1 -1
- data/dist/chunks/{_weekday_stacked-Dzgi_IL5.js → _weekday_stacked-Bw_5qEUW.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- 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/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256935cc0094e0047461f73eb8aa9a359414951eade45a2a3c82507ba9430d19
|
4
|
+
data.tar.gz: 7d173634a0c2134da2756f3c16435c48662570980fa226a0bbe8bb256950620e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6861772c1549b55563f7d3c79026f56cb930297ef756e02a5b9adc7df3300b31dc8286df6188b800023c23870eb90a62e4b7fc14f0fcfecdc1aa3769deb77a2f
|
7
|
+
data.tar.gz: 5b80990b1a26b4aa82392837d1c1a8c54304f3371e527beb8e7786ce54bb1620dab12804798855b9d43e4958f7586c10fd5e338d8f2b2adbccb26fe1d691c376
|
@@ -25,7 +25,7 @@ type BadgeProps = {
|
|
25
25
|
removeOnClick?: React.MouseEventHandler<HTMLSpanElement>,
|
26
26
|
rounded?: boolean,
|
27
27
|
text?: string,
|
28
|
-
variant?: "error" | "info" | "neutral" | "notification" | "primary" | "success" | "warning",
|
28
|
+
variant?: "error" | "info" | "neutral" | "notification" | "notificationError" | "primary" | "success" | "warning",
|
29
29
|
} & GlobalProps
|
30
30
|
const Badge = (props: BadgeProps): React.ReactElement => {
|
31
31
|
const {
|
@@ -45,7 +45,9 @@ const Badge = (props: BadgeProps): React.ReactElement => {
|
|
45
45
|
const dataProps = buildDataProps(data)
|
46
46
|
const htmlProps = buildHtmlProps(htmlOptions)
|
47
47
|
const css = classnames(
|
48
|
-
buildCss('pb_badge_kit',
|
48
|
+
buildCss('pb_badge_kit',
|
49
|
+
variant === "success" ? "success_sm" : variant === "notificationError" ? "notification_error" : variant,
|
50
|
+
rounded ? 'rounded' : ''),
|
49
51
|
globalProps(props),
|
50
52
|
className
|
51
53
|
)
|
@@ -6,7 +6,7 @@ module Playbook
|
|
6
6
|
prop :rounded, type: Playbook::Props::Boolean, default: false
|
7
7
|
prop :text
|
8
8
|
prop :variant, type: Playbook::Props::Enum,
|
9
|
-
values: %w[success warning error info neutral notification primary],
|
9
|
+
values: %w[success warning error info neutral notification notification_error primary],
|
10
10
|
default: "neutral"
|
11
11
|
|
12
12
|
def classname
|
@@ -94,15 +94,21 @@ test('displays success variant', () => {
|
|
94
94
|
|
95
95
|
})
|
96
96
|
|
97
|
-
test('displays notification
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
97
|
+
test('displays notification variants', () => {
|
98
|
+
[
|
99
|
+
"notification",
|
100
|
+
"notificationError"
|
101
|
+
].forEach((colorVariant) => {
|
102
|
+
render(
|
103
|
+
<Badge
|
104
|
+
data={{ testid: testId }}
|
105
|
+
text={colorVariant}
|
106
|
+
variant={colorVariant}
|
107
|
+
/>
|
108
|
+
)
|
109
|
+
const kit = screen.getByTestId(testId)
|
110
|
+
expect(kit).toHaveClass(`pb_badge_kit_${colorVariant === "notificationError" ? "notification_error" : "notification"}`)
|
111
|
+
|
112
|
+
cleanup()
|
113
|
+
})
|
108
114
|
})
|
@@ -10,3 +10,16 @@
|
|
10
10
|
variant: "notification"
|
11
11
|
}) %>
|
12
12
|
</div>
|
13
|
+
|
14
|
+
<div>
|
15
|
+
<%= pb_rails("badge", props: {
|
16
|
+
text: "1",
|
17
|
+
variant: "notification_error",
|
18
|
+
rounded: true
|
19
|
+
}) %>
|
20
|
+
|
21
|
+
<%= pb_rails("badge", props: {
|
22
|
+
text: "4",
|
23
|
+
variant: "notification_error"
|
24
|
+
}) %>
|
25
|
+
</div>
|
@@ -4,20 +4,39 @@ import Badge from '../_badge'
|
|
4
4
|
const BadgeNotification = (props) => {
|
5
5
|
return (
|
6
6
|
<>
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
<div>
|
8
|
+
<Badge
|
9
|
+
rounded
|
10
|
+
text="1"
|
11
|
+
variant="notification"
|
12
|
+
{...props}
|
13
|
+
/>
|
13
14
|
|
14
|
-
|
15
|
+
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<Badge
|
18
|
+
text="4"
|
19
|
+
variant="notification"
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div>
|
25
|
+
<Badge
|
26
|
+
rounded
|
27
|
+
text="1"
|
28
|
+
variant="notificationError"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
<Badge
|
35
|
+
text="4"
|
36
|
+
variant="notificationError"
|
37
|
+
{...props}
|
38
|
+
/>
|
39
|
+
</div>
|
21
40
|
</>
|
22
41
|
)
|
23
42
|
}
|