playbook_ui 14.25.0.pre.alpha.PLAY2413togglefocusstate9789 → 14.25.0.pre.alpha.PLAY2422fixedconftoastaccessibility9840
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_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +15 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +2 -20
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +0 -3
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.html.erb +2 -4
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx +1 -2
- data/dist/chunks/{_weekday_stacked-2gKd1RZJ.js → _weekday_stacked-CIrRrYKI.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +2 -2
- 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: 1dc9dcfd7fc8bed8ccd07cbec3b1ec442d15dbb66207cff99291683c3fcb5bf4
|
4
|
+
data.tar.gz: 1b0852b24cf432723f49cd373243f671041cdb5e2570ef971007b8efa293a62b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1c5fc5ee7cc4377f5541a5ffbfedf0d054364004bad811e7d16d7500188c867e84b36d91a97119c7118cc1a301ba0b5ad37267d29332de54ad9ff2d67a6ba1c
|
7
|
+
data.tar.gz: e3e5cdf76e498f93d7bb97f653cf61288b05d8c3b6df6055f4e3de5e4dfdb9048448269775873ce8787417ae0fc15842e4266317858c1b68def2f5fc1812867d
|
@@ -35,6 +35,8 @@ type FixedConfirmationToastProps = {
|
|
35
35
|
|
36
36
|
const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.ReactElement => {
|
37
37
|
const [showToast, toggleToast] = useState(true);
|
38
|
+
const [hydrated, setHydrated] = useState(false);
|
39
|
+
|
38
40
|
const {
|
39
41
|
autoClose = 0,
|
40
42
|
children,
|
@@ -84,12 +86,24 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
84
86
|
onClose();
|
85
87
|
};
|
86
88
|
|
89
|
+
// prevents Screen Reader from announcing all examples on page load, just dynamic on open
|
90
|
+
useEffect(() => {
|
91
|
+
setHydrated(true);
|
92
|
+
}, []);
|
93
|
+
|
87
94
|
return (
|
88
95
|
<>
|
89
96
|
{showToast && (
|
90
97
|
<div
|
98
|
+
aria-atomic={hydrated && open ? "true" : undefined}
|
99
|
+
aria-live={hydrated && open ? "polite" : undefined}
|
91
100
|
className={css}
|
92
101
|
onClick={handleClick}
|
102
|
+
onKeyDown={(e) => {
|
103
|
+
if (e.key === "Enter" || e.key === " ") handleClick();
|
104
|
+
}}
|
105
|
+
role="status"
|
106
|
+
tabIndex={0}
|
93
107
|
{...htmlProps}
|
94
108
|
>
|
95
109
|
{returnedIcon && icon !== "none" && (
|
@@ -112,6 +126,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
112
126
|
|
113
127
|
{closeable && (
|
114
128
|
<Icon
|
129
|
+
aria={{ "label": "Close Toast" }}
|
115
130
|
className="pb_icon"
|
116
131
|
cursor="pointer"
|
117
132
|
fixedWidth={false}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<%= pb_content_tag do %>
|
1
|
+
<%= pb_content_tag(:div, "aria-atomic": "true", "aria-live": "polite", role: "status", tabindex: 0) do %>
|
2
2
|
<% if object.icon_value && object.icon_value != "none" %>
|
3
|
-
<%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
|
3
|
+
<%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true, aria: { "aria-label": "#{object.icon_value} icon" } }) %>
|
4
4
|
<% end %>
|
5
5
|
<% if content %>
|
6
6
|
<%= content %>
|
@@ -8,5 +8,5 @@
|
|
8
8
|
<%= pb_rails("title", props: { text: object.text, size: 4, flex: "1", classname: "pb_fixed_confirmation_toast_text" }) %>
|
9
9
|
<% end %>
|
10
10
|
|
11
|
-
<%= pb_rails("icon", props: { icon: "times", classname: "pb_icon", cursor: "pointer", fixed_width: true }) if object.closeable %>
|
11
|
+
<%= pb_rails("icon", props: { icon: "times", classname: "pb_icon", cursor: "pointer", fixed_width: true, aria: { "aria-label": "Close Toast" } }) if object.closeable %>
|
12
12
|
<% end %>
|
@@ -46,16 +46,7 @@ $transition: .2s ease-in-out;
|
|
46
46
|
}
|
47
47
|
|
48
48
|
input {
|
49
|
-
|
50
|
-
opacity: 0;
|
51
|
-
width: 1px;
|
52
|
-
height: 1px;
|
53
|
-
overflow: hidden;
|
54
|
-
|
55
|
-
&:focus + .pb_toggle_control {
|
56
|
-
box-shadow: 0px 0px 0px 2px $white, 0px 0px 0px 4px $primary;
|
57
|
-
outline: none;
|
58
|
-
}
|
49
|
+
display: none;
|
59
50
|
|
60
51
|
&:disabled + .pb_toggle_control {
|
61
52
|
cursor: not-allowed;
|
@@ -70,11 +61,7 @@ $transition: .2s ease-in-out;
|
|
70
61
|
}
|
71
62
|
|
72
63
|
input:checked {
|
73
|
-
|
74
|
-
opacity: 0;
|
75
|
-
width: 1px;
|
76
|
-
height: 1px;
|
77
|
-
overflow: hidden;
|
64
|
+
display: none;
|
78
65
|
|
79
66
|
&:checked + .pb_toggle_control {
|
80
67
|
border: $border_success;
|
@@ -86,11 +73,6 @@ $transition: .2s ease-in-out;
|
|
86
73
|
}
|
87
74
|
}
|
88
75
|
|
89
|
-
&:checked:focus + .pb_toggle_control {
|
90
|
-
box-shadow: 0px 0px 0px 2px $white, 0px 0px 0px 4px $primary;
|
91
|
-
outline: none;
|
92
|
-
}
|
93
|
-
|
94
76
|
&:disabled + .pb_toggle_control {
|
95
77
|
cursor: not-allowed;
|
96
78
|
opacity: 0.5;
|
@@ -23,7 +23,6 @@ type Props = {
|
|
23
23
|
name?: string,
|
24
24
|
onChange?: InputCallback<HTMLInputElement>,
|
25
25
|
size?: "sm" | "md",
|
26
|
-
tabIndex?: number,
|
27
26
|
value?: string,
|
28
27
|
} & GlobalProps
|
29
28
|
|
@@ -41,7 +40,6 @@ const Toggle = ({
|
|
41
40
|
// Function body here
|
42
41
|
},
|
43
42
|
size = 'sm',
|
44
|
-
tabIndex,
|
45
43
|
value,
|
46
44
|
...props
|
47
45
|
}: Props): React.ReactElement => {
|
@@ -75,7 +73,6 @@ const Toggle = ({
|
|
75
73
|
disabled={disabled}
|
76
74
|
name={name}
|
77
75
|
onChange={onChange}
|
78
|
-
tabIndex={tabIndex}
|
79
76
|
type="checkbox"
|
80
77
|
value={value}
|
81
78
|
/>
|