@exsto/ds 0.0.1-rc.15 → 0.0.1-rc.16

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.
Files changed (38) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/source-hash.txt +1 -1
  3. package/dist/styles.css +63 -0
  4. package/dist/ui/src/components/edyn/date-picker/date-picker.d.ts +1 -0
  5. package/dist/ui/src/components/edyn/date-picker/date-picker.js +23 -3
  6. package/dist/ui/src/components/edyn/date-picker/date-picker.js.map +1 -1
  7. package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.js +13 -2
  8. package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.js.map +1 -1
  9. package/dist/ui/src/components/edyn/multi-select/multi-select.js +8 -2
  10. package/dist/ui/src/components/edyn/multi-select/multi-select.js.map +1 -1
  11. package/dist/ui/src/components/edyn/presence/index.d.ts +1 -0
  12. package/dist/ui/src/components/edyn/presence/presence.d.ts +15 -0
  13. package/dist/ui/src/components/edyn/presence/presence.js +54 -0
  14. package/dist/ui/src/components/edyn/presence/presence.js.map +1 -0
  15. package/dist/ui/src/components/edyn/presence/presence.test.d.ts +8 -0
  16. package/dist/ui/src/components/ui/alert-dialog/alert-dialog.js +2 -0
  17. package/dist/ui/src/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  18. package/dist/ui/src/components/ui/context-menu/context-menu.js +2 -0
  19. package/dist/ui/src/components/ui/context-menu/context-menu.js.map +1 -1
  20. package/dist/ui/src/components/ui/dialog/dialog.js +2 -0
  21. package/dist/ui/src/components/ui/dialog/dialog.js.map +1 -1
  22. package/dist/ui/src/components/ui/drawer/drawer.js +2 -0
  23. package/dist/ui/src/components/ui/drawer/drawer.js.map +1 -1
  24. package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js +2 -0
  25. package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  26. package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js +2 -0
  27. package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  28. package/dist/ui/src/components/ui/popover/popover.js +2 -0
  29. package/dist/ui/src/components/ui/popover/popover.js.map +1 -1
  30. package/dist/ui/src/components/ui/select/select.js +2 -0
  31. package/dist/ui/src/components/ui/select/select.js.map +1 -1
  32. package/dist/ui/src/components/ui/sheet/sheet.js +2 -0
  33. package/dist/ui/src/components/ui/sheet/sheet.js.map +1 -1
  34. package/dist/ui/src/index.d.ts +1 -0
  35. package/dist/ui/src/lib/focus-guards.d.ts +2 -0
  36. package/dist/ui/src/lib/focus-guards.js +52 -0
  37. package/dist/ui/src/lib/focus-guards.js.map +1 -0
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","names":[],"sources":["../../../../../../../ui/src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconX } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { Button } from '../button';\n\nexport const Sheet = ({ ...props }: SheetPrimitive.Root.Props) => {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n};\n\nexport const SheetTrigger = ({ ...props }: SheetPrimitive.Trigger.Props) => {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n};\n\nexport const SheetClose = ({ ...props }: SheetPrimitive.Close.Props) => {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n};\n\nconst SheetPortal = ({ ...props }: SheetPrimitive.Portal.Props) => {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n};\n\nconst SheetOverlay = ({ className, ...props }: SheetPrimitive.Backdrop.Props) => {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-overlay transition-opacity duration-150 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const SheetContent = ({\n className,\n children,\n side = 'right',\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n showCloseButton?: boolean;\n}) => {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n 'fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 motion-reduce:transition-none ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" render={<Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\" />}>\n <IconX />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n );\n};\n\nexport const SheetHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-col gap-0.5 p-4', className)} {...props} />;\n};\n\nexport const SheetFooter = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n};\n\nexport const SheetTitle = ({ className, ...props }: SheetPrimitive.Title.Props) => {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-heading text-base font-medium text-foreground', className)} {...props} />;\n};\n\nexport const SheetDescription = ({ className, ...props }: SheetPrimitive.Description.Props) => {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-muted-foreground', className)} {...props} />;\n};\n"],"mappings":";;;;;;AAMA,IAAa,SAAS,EAAE,GAAG,YAAuC;CAChE,OAAO,oBAAC,OAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,IAAa,gBAAgB,EAAE,GAAG,YAA0C;CAC1E,OAAO,oBAAC,OAAe,SAAhB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,IAAa,cAAc,EAAE,GAAG,YAAwC;CACtE,OAAO,oBAAC,OAAe,OAAhB;EAAsB,aAAU;EAAc,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAM,eAAe,EAAE,GAAG,YAAyC;CACjE,OAAO,oBAAC,OAAe,QAAhB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,IAAM,gBAAgB,EAAE,WAAW,GAAG,YAA2C;CAC/E,OACE,oBAAC,OAAe,UAAhB;EACE,aAAU;EACV,WAAW,GACT,mMACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,gBAAgB,EAC3B,WACA,UACA,OAAO,SACP,kBAAkB,MAClB,GAAG,YAIC;CACJ,OACE,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,qBAAC,OAAe,OAAhB;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT,2rCACA,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACA,mBACC,qBAAC,OAAe,OAAhB;GAAsB,aAAU;GAAc,QAAQ,oBAAC,QAAD;IAAQ,SAAQ;IAAQ,WAAU;IAAyB,MAAK;GAAW,CAAA;GAAjI,UAAA,CACE,oBAAC,OAAD,CAAQ,CAAA,GACR,oBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAW,CAAA,CACjB;EAEJ,CAAA,CAAA;CACX,CAAA,CAAA,EAAA,CAAA;AAEjB;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC1G;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,mCAAmC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAwC;CACjF,OAAO,oBAAC,OAAe,OAAhB;EAAsB,aAAU;EAAc,WAAW,GAAG,sDAAsD,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnJ;AAEA,IAAa,oBAAoB,EAAE,WAAW,GAAG,YAA8C;CAC7F,OAAO,oBAAC,OAAe,aAAhB;EAA4B,aAAU;EAAoB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC1I"}
1
+ {"version":3,"file":"sheet.js","names":[],"sources":["../../../../../../../ui/src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { useExposedFocusGuards } from '@edyn/ui/lib/focus-guards';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconX } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { Button } from '../button';\n\nexport const Sheet = ({ ...props }: SheetPrimitive.Root.Props) => {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n};\n\nexport const SheetTrigger = ({ ...props }: SheetPrimitive.Trigger.Props) => {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n};\n\nexport const SheetClose = ({ ...props }: SheetPrimitive.Close.Props) => {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n};\n\nconst SheetPortal = ({ ...props }: SheetPrimitive.Portal.Props) => {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n};\n\nconst SheetOverlay = ({ className, ...props }: SheetPrimitive.Backdrop.Props) => {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-overlay transition-opacity duration-150 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const SheetContent = ({\n className,\n children,\n side = 'right',\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n showCloseButton?: boolean;\n}) => {\n useExposedFocusGuards();\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n 'fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 motion-reduce:transition-none ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" render={<Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\" />}>\n <IconX />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n );\n};\n\nexport const SheetHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-col gap-0.5 p-4', className)} {...props} />;\n};\n\nexport const SheetFooter = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n};\n\nexport const SheetTitle = ({ className, ...props }: SheetPrimitive.Title.Props) => {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-heading text-base font-medium text-foreground', className)} {...props} />;\n};\n\nexport const SheetDescription = ({ className, ...props }: SheetPrimitive.Description.Props) => {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-muted-foreground', className)} {...props} />;\n};\n"],"mappings":";;;;;;;AAOA,IAAa,SAAS,EAAE,GAAG,YAAuC;CAChE,OAAO,oBAAC,OAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,IAAa,gBAAgB,EAAE,GAAG,YAA0C;CAC1E,OAAO,oBAAC,OAAe,SAAhB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,IAAa,cAAc,EAAE,GAAG,YAAwC;CACtE,OAAO,oBAAC,OAAe,OAAhB;EAAsB,aAAU;EAAc,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAM,eAAe,EAAE,GAAG,YAAyC;CACjE,OAAO,oBAAC,OAAe,QAAhB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,IAAM,gBAAgB,EAAE,WAAW,GAAG,YAA2C;CAC/E,OACE,oBAAC,OAAe,UAAhB;EACE,aAAU;EACV,WAAW,GACT,mMACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,gBAAgB,EAC3B,WACA,UACA,OAAO,SACP,kBAAkB,MAClB,GAAG,YAIC;CACJ,sBAAsB;CACtB,OACE,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,qBAAC,OAAe,OAAhB;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT,2rCACA,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACA,mBACC,qBAAC,OAAe,OAAhB;GAAsB,aAAU;GAAc,QAAQ,oBAAC,QAAD;IAAQ,SAAQ;IAAQ,WAAU;IAAyB,MAAK;GAAW,CAAA;GAAjI,UAAA,CACE,oBAAC,OAAD,CAAQ,CAAA,GACR,oBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAW,CAAA,CACjB;EAEJ,CAAA,CAAA;CACX,CAAA,CAAA,EAAA,CAAA;AAEjB;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC1G;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,mCAAmC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAwC;CACjF,OAAO,oBAAC,OAAe,OAAhB;EAAsB,aAAU;EAAc,WAAW,GAAG,sDAAsD,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnJ;AAEA,IAAa,oBAAoB,EAAE,WAAW,GAAG,YAA8C;CAC7F,OAAO,oBAAC,OAAe,aAAhB;EAA4B,aAAU;EAAoB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC1I"}
@@ -3,6 +3,7 @@ export * from './components/edyn/audio-player';
3
3
  export * from './components/edyn/date-range-picker';
4
4
  export * from './components/edyn/initials-avatar';
5
5
  export * from './components/edyn/multi-select';
6
+ export * from './components/edyn/presence';
6
7
  export * from './components/edyn/progress-line';
7
8
  export * from './components/edyn/rich-text-content';
8
9
  export * from './components/edyn/video-player';
@@ -0,0 +1,2 @@
1
+ /** Call from a popup's content component: while it is mounted, the focus guards around popups are not aria-hidden. */
2
+ export declare const useExposedFocusGuards: () => void;
@@ -0,0 +1,52 @@
1
+ import { useEffect } from "react";
2
+ //#region ../ui/src/lib/focus-guards.ts
3
+ /**
4
+ * Base UI wraps an open popup in focus-trap sentinels: empty spans with `tabindex="0"`, because tabbing onto one is how focus is
5
+ * handed back into the popup, and with `aria-hidden="true"`, so a screen reader skips them. A control that is hidden from
6
+ * assistive technology and can still be focused is a trap, and axe's aria-hidden-focus rule (WCAG 4.1.2) reports exactly that
7
+ * pair; whether as a violation or as "needs review" depends on the page, so an application's audit fails on every open menu
8
+ * while a test page does not. Base UI 1.8 and 1.9 render them this way and give a wrapper no way to change it.
9
+ *
10
+ * `useExposedFocusGuards` takes the `aria-hidden` off them while the popup is open. They stay focusable, so focus is handed
11
+ * back as before, and they stay empty, so there is nothing for a screen reader to read. It is called by the design system's
12
+ * popup content components, which exist only while their popup is open: one observer serves every popup open at once and
13
+ * goes away with the last of them. React does not write an attribute whose prop has not changed, so the removal holds.
14
+ */
15
+ var HIDDEN_GUARD = "[data-base-ui-focus-guard][aria-hidden]";
16
+ /** Takes `aria-hidden` off the guards in a subtree, or off the node itself when it is one. */
17
+ var expose = (root) => {
18
+ if (root instanceof Element && root.matches(HIDDEN_GUARD)) root.removeAttribute("aria-hidden");
19
+ for (const guard of root.querySelectorAll(HIDDEN_GUARD)) guard.removeAttribute("aria-hidden");
20
+ };
21
+ var users = 0;
22
+ var observer;
23
+ var start = () => {
24
+ users += 1;
25
+ expose(document);
26
+ if (observer !== void 0) return;
27
+ observer = new MutationObserver((records) => {
28
+ for (const record of records) for (const added of record.addedNodes) if (added instanceof Element) expose(added);
29
+ });
30
+ observer.observe(document.body, {
31
+ childList: true,
32
+ subtree: true
33
+ });
34
+ };
35
+ var stop = () => {
36
+ users -= 1;
37
+ if (users === 0) {
38
+ observer?.disconnect();
39
+ observer = void 0;
40
+ }
41
+ };
42
+ /** Call from a popup's content component: while it is mounted, the focus guards around popups are not aria-hidden. */
43
+ var useExposedFocusGuards = () => {
44
+ useEffect(() => {
45
+ start();
46
+ return stop;
47
+ }, []);
48
+ };
49
+ //#endregion
50
+ export { useExposedFocusGuards };
51
+
52
+ //# sourceMappingURL=focus-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-guards.js","names":[],"sources":["../../../../../ui/src/lib/focus-guards.ts"],"sourcesContent":["import { useEffect } from 'react';\n\n/**\n * Base UI wraps an open popup in focus-trap sentinels: empty spans with `tabindex=\"0\"`, because tabbing onto one is how focus is\n * handed back into the popup, and with `aria-hidden=\"true\"`, so a screen reader skips them. A control that is hidden from\n * assistive technology and can still be focused is a trap, and axe's aria-hidden-focus rule (WCAG 4.1.2) reports exactly that\n * pair; whether as a violation or as \"needs review\" depends on the page, so an application's audit fails on every open menu\n * while a test page does not. Base UI 1.8 and 1.9 render them this way and give a wrapper no way to change it.\n *\n * `useExposedFocusGuards` takes the `aria-hidden` off them while the popup is open. They stay focusable, so focus is handed\n * back as before, and they stay empty, so there is nothing for a screen reader to read. It is called by the design system's\n * popup content components, which exist only while their popup is open: one observer serves every popup open at once and\n * goes away with the last of them. React does not write an attribute whose prop has not changed, so the removal holds.\n */\n\nconst HIDDEN_GUARD = '[data-base-ui-focus-guard][aria-hidden]';\n\n/** Takes `aria-hidden` off the guards in a subtree, or off the node itself when it is one. */\nconst expose = (root: ParentNode | Element): void => {\n if (root instanceof Element && root.matches(HIDDEN_GUARD)) {\n root.removeAttribute('aria-hidden');\n }\n for (const guard of root.querySelectorAll(HIDDEN_GUARD)) {\n guard.removeAttribute('aria-hidden');\n }\n};\n\nlet users = 0;\nlet observer: MutationObserver | undefined;\n\nconst start = (): void => {\n users += 1;\n expose(document);\n if (observer !== undefined) {\n return;\n }\n observer = new MutationObserver((records) => {\n for (const record of records) {\n for (const added of record.addedNodes) {\n if (added instanceof Element) {\n expose(added);\n }\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n};\n\nconst stop = (): void => {\n users -= 1;\n if (users === 0) {\n observer?.disconnect();\n observer = undefined;\n }\n};\n\n/** Call from a popup's content component: while it is mounted, the focus guards around popups are not aria-hidden. */\nexport const useExposedFocusGuards = (): void => {\n useEffect(() => {\n start();\n return stop;\n }, []);\n};\n"],"mappings":";;;;;;;;;;;;;;AAeA,IAAM,eAAe;;AAGrB,IAAM,UAAU,SAAqC;CACnD,IAAI,gBAAgB,WAAW,KAAK,QAAQ,YAAY,GACtD,KAAK,gBAAgB,aAAa;CAEpC,KAAK,MAAM,SAAS,KAAK,iBAAiB,YAAY,GACpD,MAAM,gBAAgB,aAAa;AAEvC;AAEA,IAAI,QAAQ;AACZ,IAAI;AAEJ,IAAM,cAAoB;CACxB,SAAS;CACT,OAAO,QAAQ;CACf,IAAI,aAAa,KAAA,GACf;CAEF,WAAW,IAAI,kBAAkB,YAAY;EAC3C,KAAK,MAAM,UAAU,SACnB,KAAK,MAAM,SAAS,OAAO,YACzB,IAAI,iBAAiB,SACnB,OAAO,KAAK;CAIpB,CAAC;CACD,SAAS,QAAQ,SAAS,MAAM;EAAE,WAAW;EAAM,SAAS;CAAK,CAAC;AACpE;AAEA,IAAM,aAAmB;CACvB,SAAS;CACT,IAAI,UAAU,GAAG;EACf,UAAU,WAAW;EACrB,WAAW,KAAA;CACb;AACF;;AAGA,IAAa,8BAAoC;CAC/C,gBAAgB;EACd,MAAM;EACN,OAAO;CACT,GAAG,CAAC,CAAC;AACP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exsto/ds",
3
- "version": "0.0.1-rc.15",
3
+ "version": "0.0.1-rc.16",
4
4
  "description": "The eDynamix design system: React components and design tokens.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [