@windstream/react-shared-components 0.2.56 → 0.2.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -114,6 +114,26 @@ describe("Collapse", () => {
114
114
  const wrapper = container.firstChild as HTMLElement;
115
115
  expect(wrapper).toHaveAttribute("aria-hidden", "true");
116
116
  });
117
+
118
+ it("marks the subtree inert when closed", () => {
119
+ const { container } = render(
120
+ <Collapse open={false}>
121
+ <p>Content</p>
122
+ </Collapse>
123
+ );
124
+ const wrapper = container.firstChild as HTMLElement;
125
+ expect(wrapper).toHaveAttribute("inert");
126
+ });
127
+
128
+ it("does not mark the subtree inert when open", () => {
129
+ const { container } = render(
130
+ <Collapse open={true}>
131
+ <p>Content</p>
132
+ </Collapse>
133
+ );
134
+ const wrapper = container.firstChild as HTMLElement;
135
+ expect(wrapper).not.toHaveAttribute("inert");
136
+ });
117
137
  });
118
138
 
119
139
  describe("transition classes", () => {
@@ -31,11 +31,15 @@ export const Collapse = (props: CollapsibleProps) => {
31
31
  };
32
32
  }, [open, children]);
33
33
 
34
+ // When closed, add `inert` so links/buttons inside can't be tabbed to or read by screen readers.
35
+ const inertProps = open ? {} : ({ inert: "" } as Record<string, string>);
36
+
34
37
  return (
35
38
  <div
36
39
  className="overflow-hidden transition-all duration-300 ease-in-out"
37
40
  style={{ maxHeight: maxHeight, opacity: open ? 1 : 0 }}
38
41
  aria-hidden={!open}
42
+ {...inertProps}
39
43
  >
40
44
  <div ref={contentRef}>{children}</div>
41
45
  </div>
@@ -536,6 +536,7 @@ export const FiberForm: React.FC<FiberFormProps> = ({
536
536
  <Button
537
537
  type="submit"
538
538
  disabled={isSubmitting}
539
+ aria-busy={isSubmitting}
539
540
  className={cx(
540
541
  "flex h-16 w-[198px] max-w-full cursor-pointer items-center justify-center overflow-hidden rounded-button border border-brand bg-bg-fill-brand px-[60px] py-4 text-center font-black leading-7 text-text-brand-on-bg-fill no-underline transition-colors duration-300 ease-in-out enabled:hover:border-[var(--color-bg-fill-brand-hover)] enabled:hover:bg-bg-fill-brand-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-brand disabled:cursor-not-allowed",
541
542
  isSubmitting && "opacity-75",