@mattermost/compass-ui 0.1.0-alpha.17 → 0.1.0-alpha.19
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/dist/compass-ui.css +1 -0
- package/dist/components/modal/Modal.cjs +1 -1
- package/dist/components/modal/Modal.cjs.map +1 -1
- package/dist/components/modal/Modal.css +1 -1
- package/dist/components/modal/Modal.d.ts +11 -2
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +70 -64
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.module.scss.cjs +1 -1
- package/dist/components/modal/Modal.module.scss.js +16 -12
- package/dist/components/modal/Modal.module.scss.js.map +1 -1
- package/dist/components/modal/ModalOverlay.css +1 -0
- package/dist/components/modal/ModalOverlay.module.scss.cjs +2 -0
- package/dist/components/modal/ModalOverlay.module.scss.cjs.map +1 -0
- package/dist/components/modal/ModalOverlay.module.scss.js +9 -0
- package/dist/components/modal/ModalOverlay.module.scss.js.map +1 -0
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -2
- package/dist/components/modal/index.js.map +1 -1
- package/dist/components/popover-notice/PopoverNotice.css +1 -1
- package/dist/components/popover-notice/PopoverNotice.module.scss.cjs +1 -1
- package/dist/components/popover-notice/PopoverNotice.module.scss.js +14 -14
- package/dist/components/scrollbar/Scrollbar.cjs +1 -1
- package/dist/components/scrollbar/Scrollbar.cjs.map +1 -1
- package/dist/components/scrollbar/Scrollbar.css +1 -1
- package/dist/components/scrollbar/Scrollbar.d.ts +4 -0
- package/dist/components/scrollbar/Scrollbar.d.ts.map +1 -1
- package/dist/components/scrollbar/Scrollbar.js +31 -25
- package/dist/components/scrollbar/Scrollbar.js.map +1 -1
- package/dist/components/scrollbar/Scrollbar.module.scss.cjs +1 -1
- package/dist/components/scrollbar/Scrollbar.module.scss.js +3 -2
- package/dist/components/scrollbar/Scrollbar.module.scss.js.map +1 -1
- package/dist/components/scrollbar/index.d.ts +1 -1
- package/dist/components/scrollbar/index.d.ts.map +1 -1
- package/dist/components/section-notice/SectionNotice.css +1 -1
- package/dist/components/section-notice/SectionNotice.module.scss.cjs +1 -1
- package/dist/components/section-notice/SectionNotice.module.scss.js +12 -12
- package/dist/hooks/use-modal-focus.cjs +1 -1
- package/dist/hooks/use-modal-focus.cjs.map +1 -1
- package/dist/hooks/use-modal-focus.d.ts +9 -1
- package/dist/hooks/use-modal-focus.d.ts.map +1 -1
- package/dist/hooks/use-modal-focus.js +43 -41
- package/dist/hooks/use-modal-focus.js.map +1 -1
- package/dist/illustrations/names.cjs +1 -1
- package/dist/illustrations/names.cjs.map +1 -1
- package/dist/illustrations/names.d.ts +1 -1
- package/dist/illustrations/names.d.ts.map +1 -1
- package/dist/illustrations/names.js +2 -0
- package/dist/illustrations/names.js.map +1 -1
- package/dist/illustrations/oauth.cjs +2 -0
- package/dist/illustrations/oauth.cjs.map +1 -0
- package/dist/illustrations/oauth.d.ts +4 -0
- package/dist/illustrations/oauth.js +5 -0
- package/dist/illustrations/oauth.js.map +1 -0
- package/dist/illustrations/oauth.svg.cjs +2 -0
- package/dist/illustrations/oauth.svg.cjs.map +1 -0
- package/dist/illustrations/oauth.svg.js +6 -0
- package/dist/illustrations/oauth.svg.js.map +1 -0
- package/dist/illustrations/outgoing-oauth-connections.cjs +2 -0
- package/dist/illustrations/outgoing-oauth-connections.cjs.map +1 -0
- package/dist/illustrations/outgoing-oauth-connections.d.ts +4 -0
- package/dist/illustrations/outgoing-oauth-connections.js +5 -0
- package/dist/illustrations/outgoing-oauth-connections.js.map +1 -0
- package/dist/illustrations/outgoing-oauth-connections.svg.cjs +2 -0
- package/dist/illustrations/outgoing-oauth-connections.svg.cjs.map +1 -0
- package/dist/illustrations/outgoing-oauth-connections.svg.js +6 -0
- package/dist/illustrations/outgoing-oauth-connections.svg.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +91 -89
- package/dist/index.js.map +1 -1
- package/package.json +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrollbar.cjs","sources":["../../../src/components/scrollbar/Scrollbar.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport SimpleBar from 'simplebar-react';\nimport './simplebar-vendor.scss';\nimport styles from './Scrollbar.module.scss';\n\nexport interface ScrollbarProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children' | 'color' | 'onScroll'\n> {\n /** Scrollable content. */\n children: ReactNode;\n /**\n * CSS variable name (including the leading `--`) for the thumb RGB triplet.\n * Use this to recolor the thumb in dark surfaces (e.g. `--sidebar-text-rgb`).\n * When omitted, the thumb uses `--center-channel-color-rgb`.\n */\n color?: string;\n /**\n * Disable auto-hide; the thumb is visible whenever content overflows.\n * Default: false (auto-hide).\n */\n alwaysVisible?: boolean;\n /** Class applied to the SimpleBar root. */\n className?: string;\n /** Inline style applied to the SimpleBar root. */\n style?: CSSProperties;\n /** Scroll handler attached to the inner scrollable element. */\n onScroll?: (e: Event) => void;\n}\n\n/**\n * Scrollbars let people move through content that exceeds the viewport while showing where\n * they are in the larger whole. Compass uses a single, minimal treatment — a transparent\n * track with a thin, translucent thumb — so the scrollbar reads as a position indicator\n * first and a control second.\n */\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollbarProps>(function Scrollbar(\n {\n children,\n color,\n alwaysVisible = false,\n className,\n style,\n onScroll,\n ...rest\n },\n ref,\n) {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n\n const setScrollNode = useCallback(\n (el: HTMLDivElement | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n\n if (el && onScroll) {\n el.addEventListener('scroll', onScroll);\n cleanup.current = () => el.removeEventListener('scroll', onScroll);\n }\n\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = el;\n }\n },\n [onScroll, ref],\n );\n\n const mergedStyle: CSSProperties = {\n ...style,\n ...(color\n ? ({ '--scrollbar-color': `var(${color})` } as CSSProperties)\n : null),\n };\n\n const rootClass = [styles.scrollbar
|
|
1
|
+
{"version":3,"file":"Scrollbar.cjs","sources":["../../../src/components/scrollbar/Scrollbar.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport SimpleBar from 'simplebar-react';\nimport { toKebab } from '@/utils/string';\nimport './simplebar-vendor.scss';\nimport styles from './Scrollbar.module.scss';\n\n/** Track width. `default` is 8px; `wide` is 10px (modals, large panes). */\nexport type ScrollbarSize = 'default' | 'wide';\n\nexport interface ScrollbarProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children' | 'color' | 'onScroll'\n> {\n /** Scrollable content. */\n children: ReactNode;\n /**\n * CSS variable name (including the leading `--`) for the thumb RGB triplet.\n * Use this to recolor the thumb in dark surfaces (e.g. `--sidebar-text-rgb`).\n * When omitted, the thumb uses `--center-channel-color-rgb`.\n */\n color?: string;\n /**\n * Disable auto-hide; the thumb is visible whenever content overflows.\n * Default: false (auto-hide).\n */\n alwaysVisible?: boolean;\n /** Track width. Default: `default` (8px). Use `wide` (10px) in modals. */\n size?: ScrollbarSize;\n /** Class applied to the SimpleBar root. */\n className?: string;\n /** Inline style applied to the SimpleBar root. */\n style?: CSSProperties;\n /** Scroll handler attached to the inner scrollable element. */\n onScroll?: (e: Event) => void;\n}\n\n/**\n * Scrollbars let people move through content that exceeds the viewport while showing where\n * they are in the larger whole. Compass uses a single, minimal treatment — a transparent\n * track with a thin, translucent thumb — so the scrollbar reads as a position indicator\n * first and a control second.\n */\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollbarProps>(function Scrollbar(\n {\n children,\n color,\n alwaysVisible = false,\n size = 'default',\n className,\n style,\n onScroll,\n ...rest\n },\n ref,\n) {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n\n const setScrollNode = useCallback(\n (el: HTMLDivElement | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n\n if (el && onScroll) {\n el.addEventListener('scroll', onScroll);\n cleanup.current = () => el.removeEventListener('scroll', onScroll);\n }\n\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = el;\n }\n },\n [onScroll, ref],\n );\n\n const mergedStyle: CSSProperties = {\n ...style,\n ...(color\n ? ({ '--scrollbar-color': `var(${color})` } as CSSProperties)\n : null),\n };\n\n const rootClass = [\n styles.scrollbar,\n size !== 'default' && styles[`scrollbar--size-${toKebab(size)}`],\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <SimpleBar\n {...rest}\n autoHide={!alwaysVisible}\n scrollableNodeProps={{ ref: setScrollNode }}\n className={rootClass}\n style={mergedStyle}\n tabIndex={-1}\n >\n {children}\n </SimpleBar>\n );\n});\n\nexport default Scrollbar;\n"],"names":["Scrollbar","forwardRef","children","color","alwaysVisible","size","className","style","onScroll","rest","ref","cleanup","useRef","setScrollNode","useCallback","el","_a","mergedStyle","rootClass","styles","toKebab","jsx","SimpleBar"],"mappings":"2TAiDMA,EAAYC,EAAAA,WAA2C,SAC3D,CACE,SAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,GAChB,KAAAC,EAAO,UACP,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAUC,EAAAA,OAAiC,MAAS,EAEpDC,EAAgBC,EAAAA,YACnBC,GAA8B,QAC7BC,EAAAL,EAAQ,UAAR,MAAAK,EAAA,KAAAL,GACAA,EAAQ,QAAU,OAEdI,GAAMP,IACRO,EAAG,iBAAiB,SAAUP,CAAQ,EACtCG,EAAQ,QAAU,IAAMI,EAAG,oBAAoB,SAAUP,CAAQ,GAG/D,OAAOE,GAAQ,WACjBA,EAAIK,CAAE,EACGL,IACRA,EAAsD,QAAUK,EAErE,EACA,CAACP,EAAUE,CAAG,CAAA,EAGVO,EAA6B,CACjC,GAAGV,EACH,GAAIJ,EACC,CAAE,oBAAqB,OAAOA,CAAK,KACpC,IAAA,EAGAe,EAAY,CAChBC,EAAAA,QAAO,UACPd,IAAS,WAAac,UAAO,mBAAmBC,UAAQf,CAAI,CAAC,EAAE,EAC/DC,CAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,OACEe,EAAAA,IAACC,EAAA,CACE,GAAGb,EACJ,SAAU,CAACL,EACX,oBAAqB,CAAE,IAAKS,CAAA,EAC5B,UAAWK,EACX,MAAOD,EACP,SAAU,GAET,SAAAf,CAAA,CAAA,CAGP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._scrollbar_xs0gi_2{width:100%;height:100%;min-height:0;--scrollbar-color: var(--center-channel-color-rgb)}._scrollbar_xs0gi_2 .simplebar-track.simplebar-vertical{width:8px}._scrollbar_xs0gi_2 .simplebar-track.simplebar-horizontal{height:8px}._scrollbar--size-wide_xs0gi_14 .simplebar-track.simplebar-vertical{width:10px}._scrollbar--size-wide_xs0gi_14 .simplebar-track.simplebar-horizontal{height:10px}._scrollbar_xs0gi_2 .simplebar-scrollbar:before{left:2px;right:2px;top:2px;bottom:2px;border-radius:var(--radius-pill);background-color:rgba(var(--scrollbar-color, var(--center-channel-color-rgb)),.24);transition:opacity var(--duration-quick) var(--ease-exit),background-color var(--duration-quick) var(--ease-transition)}._scrollbar_xs0gi_2 .simplebar-scrollbar.simplebar-visible:before{opacity:1}._scrollbar_xs0gi_2 .simplebar-track:hover .simplebar-scrollbar:before,._scrollbar_xs0gi_2 .simplebar-scrollbar.simplebar-hover:before{opacity:1;background-color:rgba(var(--scrollbar-color, var(--center-channel-color-rgb)),.4)}._scrollbar_xs0gi_2 .simplebar-track{pointer-events:auto}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** Track width. `default` is 8px; `wide` is 10px (modals, large panes). */
|
|
3
|
+
export type ScrollbarSize = 'default' | 'wide';
|
|
2
4
|
export interface ScrollbarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'color' | 'onScroll'> {
|
|
3
5
|
/** Scrollable content. */
|
|
4
6
|
children: ReactNode;
|
|
@@ -13,6 +15,8 @@ export interface ScrollbarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ch
|
|
|
13
15
|
* Default: false (auto-hide).
|
|
14
16
|
*/
|
|
15
17
|
alwaysVisible?: boolean;
|
|
18
|
+
/** Track width. Default: `default` (8px). Use `wide` (10px) in modals. */
|
|
19
|
+
size?: ScrollbarSize;
|
|
16
20
|
/** Class applied to the SimpleBar root. */
|
|
17
21
|
className?: string;
|
|
18
22
|
/** Inline style applied to the SimpleBar root. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrollbar.d.ts","sourceRoot":"","sources":["../../../src/components/scrollbar/Scrollbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Scrollbar.d.ts","sourceRoot":"","sources":["../../../src/components/scrollbar/Scrollbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,yBAAyB,CAAC;AAGjC,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,cAAc,CAAC,cAAc,CAAC,EAC9B,UAAU,GAAG,OAAO,GAAG,UAAU,CAClC;IACC,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CAC/B;AAED;;;;;GAKG;AACH,QAAA,MAAM,SAAS,2GA6Db,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -1,41 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useRef as x, useCallback as N } from "react";
|
|
3
|
+
import j from "simplebar-react";
|
|
4
|
+
import { toKebab as B } from "../../utils/string.js";
|
|
4
5
|
import './simplebar-vendor.css';/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
children:
|
|
6
|
+
import i from "./Scrollbar.module.scss.js";
|
|
7
|
+
const k = y(function({
|
|
8
|
+
children: c,
|
|
8
9
|
color: s,
|
|
9
|
-
alwaysVisible:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
alwaysVisible: n = !1,
|
|
11
|
+
size: l = "default",
|
|
12
|
+
className: f,
|
|
13
|
+
style: m,
|
|
12
14
|
onScroll: e,
|
|
13
|
-
...
|
|
15
|
+
...d
|
|
14
16
|
}, r) {
|
|
15
|
-
const o =
|
|
17
|
+
const o = x(void 0), u = N(
|
|
16
18
|
(t) => {
|
|
17
|
-
var
|
|
18
|
-
(
|
|
19
|
+
var a;
|
|
20
|
+
(a = o.current) == null || a.call(o), o.current = void 0, t && e && (t.addEventListener("scroll", e), o.current = () => t.removeEventListener("scroll", e)), typeof r == "function" ? r(t) : r && (r.current = t);
|
|
19
21
|
},
|
|
20
22
|
[e, r]
|
|
21
|
-
),
|
|
22
|
-
...
|
|
23
|
+
), b = {
|
|
24
|
+
...m,
|
|
23
25
|
...s ? { "--scrollbar-color": `var(${s})` } : null
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
}, p = [
|
|
27
|
+
i.scrollbar,
|
|
28
|
+
l !== "default" && i[`scrollbar--size-${B(l)}`],
|
|
29
|
+
f
|
|
30
|
+
].filter(Boolean).join(" ");
|
|
31
|
+
return /* @__PURE__ */ v(
|
|
32
|
+
j,
|
|
27
33
|
{
|
|
28
|
-
...
|
|
29
|
-
autoHide: !
|
|
30
|
-
scrollableNodeProps: { ref:
|
|
31
|
-
className:
|
|
32
|
-
style:
|
|
34
|
+
...d,
|
|
35
|
+
autoHide: !n,
|
|
36
|
+
scrollableNodeProps: { ref: u },
|
|
37
|
+
className: p,
|
|
38
|
+
style: b,
|
|
33
39
|
tabIndex: -1,
|
|
34
|
-
children:
|
|
40
|
+
children: c
|
|
35
41
|
}
|
|
36
42
|
);
|
|
37
43
|
});
|
|
38
44
|
export {
|
|
39
|
-
|
|
45
|
+
k as default
|
|
40
46
|
};
|
|
41
47
|
//# sourceMappingURL=Scrollbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrollbar.js","sources":["../../../src/components/scrollbar/Scrollbar.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport SimpleBar from 'simplebar-react';\nimport './simplebar-vendor.scss';\nimport styles from './Scrollbar.module.scss';\n\nexport interface ScrollbarProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children' | 'color' | 'onScroll'\n> {\n /** Scrollable content. */\n children: ReactNode;\n /**\n * CSS variable name (including the leading `--`) for the thumb RGB triplet.\n * Use this to recolor the thumb in dark surfaces (e.g. `--sidebar-text-rgb`).\n * When omitted, the thumb uses `--center-channel-color-rgb`.\n */\n color?: string;\n /**\n * Disable auto-hide; the thumb is visible whenever content overflows.\n * Default: false (auto-hide).\n */\n alwaysVisible?: boolean;\n /** Class applied to the SimpleBar root. */\n className?: string;\n /** Inline style applied to the SimpleBar root. */\n style?: CSSProperties;\n /** Scroll handler attached to the inner scrollable element. */\n onScroll?: (e: Event) => void;\n}\n\n/**\n * Scrollbars let people move through content that exceeds the viewport while showing where\n * they are in the larger whole. Compass uses a single, minimal treatment — a transparent\n * track with a thin, translucent thumb — so the scrollbar reads as a position indicator\n * first and a control second.\n */\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollbarProps>(function Scrollbar(\n {\n children,\n color,\n alwaysVisible = false,\n className,\n style,\n onScroll,\n ...rest\n },\n ref,\n) {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n\n const setScrollNode = useCallback(\n (el: HTMLDivElement | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n\n if (el && onScroll) {\n el.addEventListener('scroll', onScroll);\n cleanup.current = () => el.removeEventListener('scroll', onScroll);\n }\n\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = el;\n }\n },\n [onScroll, ref],\n );\n\n const mergedStyle: CSSProperties = {\n ...style,\n ...(color\n ? ({ '--scrollbar-color': `var(${color})` } as CSSProperties)\n : null),\n };\n\n const rootClass = [styles.scrollbar
|
|
1
|
+
{"version":3,"file":"Scrollbar.js","sources":["../../../src/components/scrollbar/Scrollbar.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport SimpleBar from 'simplebar-react';\nimport { toKebab } from '@/utils/string';\nimport './simplebar-vendor.scss';\nimport styles from './Scrollbar.module.scss';\n\n/** Track width. `default` is 8px; `wide` is 10px (modals, large panes). */\nexport type ScrollbarSize = 'default' | 'wide';\n\nexport interface ScrollbarProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children' | 'color' | 'onScroll'\n> {\n /** Scrollable content. */\n children: ReactNode;\n /**\n * CSS variable name (including the leading `--`) for the thumb RGB triplet.\n * Use this to recolor the thumb in dark surfaces (e.g. `--sidebar-text-rgb`).\n * When omitted, the thumb uses `--center-channel-color-rgb`.\n */\n color?: string;\n /**\n * Disable auto-hide; the thumb is visible whenever content overflows.\n * Default: false (auto-hide).\n */\n alwaysVisible?: boolean;\n /** Track width. Default: `default` (8px). Use `wide` (10px) in modals. */\n size?: ScrollbarSize;\n /** Class applied to the SimpleBar root. */\n className?: string;\n /** Inline style applied to the SimpleBar root. */\n style?: CSSProperties;\n /** Scroll handler attached to the inner scrollable element. */\n onScroll?: (e: Event) => void;\n}\n\n/**\n * Scrollbars let people move through content that exceeds the viewport while showing where\n * they are in the larger whole. Compass uses a single, minimal treatment — a transparent\n * track with a thin, translucent thumb — so the scrollbar reads as a position indicator\n * first and a control second.\n */\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollbarProps>(function Scrollbar(\n {\n children,\n color,\n alwaysVisible = false,\n size = 'default',\n className,\n style,\n onScroll,\n ...rest\n },\n ref,\n) {\n const cleanup = useRef<(() => void) | undefined>(undefined);\n\n const setScrollNode = useCallback(\n (el: HTMLDivElement | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n\n if (el && onScroll) {\n el.addEventListener('scroll', onScroll);\n cleanup.current = () => el.removeEventListener('scroll', onScroll);\n }\n\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = el;\n }\n },\n [onScroll, ref],\n );\n\n const mergedStyle: CSSProperties = {\n ...style,\n ...(color\n ? ({ '--scrollbar-color': `var(${color})` } as CSSProperties)\n : null),\n };\n\n const rootClass = [\n styles.scrollbar,\n size !== 'default' && styles[`scrollbar--size-${toKebab(size)}`],\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <SimpleBar\n {...rest}\n autoHide={!alwaysVisible}\n scrollableNodeProps={{ ref: setScrollNode }}\n className={rootClass}\n style={mergedStyle}\n tabIndex={-1}\n >\n {children}\n </SimpleBar>\n );\n});\n\nexport default Scrollbar;\n"],"names":["Scrollbar","forwardRef","children","color","alwaysVisible","size","className","style","onScroll","rest","ref","cleanup","useRef","setScrollNode","useCallback","el","_a","mergedStyle","rootClass","styles","toKebab","jsx","SimpleBar"],"mappings":";;;;;;AAiDA,MAAMA,IAAYC,EAA2C,SAC3D;AAAA,EACE,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAUC,EAAiC,MAAS,GAEpDC,IAAgBC;AAAA,IACpB,CAACC,MAA8B;;AAC7B,OAAAC,IAAAL,EAAQ,YAAR,QAAAK,EAAA,KAAAL,IACAA,EAAQ,UAAU,QAEdI,KAAMP,MACRO,EAAG,iBAAiB,UAAUP,CAAQ,GACtCG,EAAQ,UAAU,MAAMI,EAAG,oBAAoB,UAAUP,CAAQ,IAG/D,OAAOE,KAAQ,aACjBA,EAAIK,CAAE,IACGL,MACRA,EAAsD,UAAUK;AAAA,IAErE;AAAA,IACA,CAACP,GAAUE,CAAG;AAAA,EAAA,GAGVO,IAA6B;AAAA,IACjC,GAAGV;AAAA,IACH,GAAIJ,IACC,EAAE,qBAAqB,OAAOA,CAAK,QACpC;AAAA,EAAA,GAGAe,IAAY;AAAA,IAChBC,EAAO;AAAA,IACPd,MAAS,aAAac,EAAO,mBAAmBC,EAAQf,CAAI,CAAC,EAAE;AAAA,IAC/DC;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAe;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGb;AAAA,MACJ,UAAU,CAACL;AAAA,MACX,qBAAqB,EAAE,KAAKS,EAAA;AAAA,MAC5B,WAAWK;AAAA,MACX,OAAOD;AAAA,MACP,UAAU;AAAA,MAET,UAAAf;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./Scrollbar.css');const l="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./Scrollbar.css');const l="_scrollbar_xs0gi_2",e={scrollbar:l,"scrollbar--size-wide":"_scrollbar--size-wide_xs0gi_14"};exports.default=e;exports.scrollbar=l;
|
|
2
2
|
//# sourceMappingURL=Scrollbar.module.scss.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrollbar.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Scrollbar.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/scrollbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/scrollbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._section-
|
|
1
|
+
._section-notice_1x4j7_2{display:flex;flex-direction:column;align-items:flex-end;position:relative;border-radius:var(--radius-s);border:1px solid rgba(var(--color-info-rgb),.16);background-color:rgba(var(--color-info-rgb),.04)}._section-notice__content_1x4j7_11{display:flex;align-items:flex-start;gap:var(--spacing-m);padding:var(--spacing-m);width:100%}._section-notice__icon_1x4j7_18{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--color-info)}._section-notice__body_1x4j7_25{display:flex;flex:1 0 0;flex-direction:column;gap:var(--spacing-xs);min-width:0;overflow:hidden;padding-right:var(--spacing-xl)}._section-notice__title_1x4j7_34._section-notice__title_1x4j7_34{margin:0;font-weight:var(--font-weight-semibold)}._section-notice__title_1x4j7_34{padding:0;font-family:var(--font-family-body);font-size:var(--font-size-100);line-height:var(--line-height-100);letter-spacing:var(--letter-spacing-normal);text-transform:none;color:var(--center-channel-color)}._section-notice__description_1x4j7_47{font-size:var(--font-size-100);font-weight:var(--font-weight-regular);line-height:var(--line-height-100);color:var(--center-channel-color)}._section-notice__actions_1x4j7_53{display:flex;align-items:center;gap:var(--spacing-s);padding:var(--spacing-xxs) 0}._section-notice__dismiss_1x4j7_59{position:absolute;top:var(--spacing-xxs);right:var(--spacing-xxs)}._section-notice--type-warning_1x4j7_64{background-color:rgba(var(--color-warning-rgb),.04);border-color:rgba(var(--color-warning-rgb),.16)}._section-notice--type-warning_1x4j7_64 ._section-notice__icon_1x4j7_18{color:var(--color-warning)}._section-notice--type-danger_1x4j7_71{background-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.04);border-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.16)}._section-notice--type-danger_1x4j7_71 ._section-notice__icon_1x4j7_18{color:var(--error-text, var(--color-danger))}._section-notice--type-success_1x4j7_78{background-color:rgba(var(--color-success-rgb),.04);border-color:rgba(var(--color-success-rgb),.16)}._section-notice--type-success_1x4j7_78 ._section-notice__icon_1x4j7_18{color:var(--color-success)}._section-notice--type-hint_1x4j7_85{background-color:rgba(var(--center-channel-color-rgb),.04);border-color:rgba(var(--center-channel-color-rgb),.16)}._section-notice--type-hint_1x4j7_85 ._section-notice__icon_1x4j7_18{color:rgba(var(--center-channel-color-rgb),.64)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./SectionNotice.css');const e={"section-notice":"_section-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./SectionNotice.css');const e={"section-notice":"_section-notice_1x4j7_2","section-notice__content":"_section-notice__content_1x4j7_11","section-notice__icon":"_section-notice__icon_1x4j7_18","section-notice__body":"_section-notice__body_1x4j7_25","section-notice__title":"_section-notice__title_1x4j7_34","section-notice__description":"_section-notice__description_1x4j7_47","section-notice__actions":"_section-notice__actions_1x4j7_53","section-notice__dismiss":"_section-notice__dismiss_1x4j7_59","section-notice--type-warning":"_section-notice--type-warning_1x4j7_64","section-notice--type-danger":"_section-notice--type-danger_1x4j7_71","section-notice--type-success":"_section-notice--type-success_1x4j7_78","section-notice--type-hint":"_section-notice--type-hint_1x4j7_85"};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=SectionNotice.module.scss.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import './SectionNotice.css';const t = {
|
|
2
|
-
"section-notice": "_section-
|
|
3
|
-
"section-notice__content": "_section-
|
|
4
|
-
"section-notice__icon": "_section-
|
|
5
|
-
"section-notice__body": "_section-
|
|
6
|
-
"section-notice__title": "_section-
|
|
7
|
-
"section-notice__description": "_section-
|
|
8
|
-
"section-notice__actions": "_section-
|
|
9
|
-
"section-notice__dismiss": "_section-
|
|
10
|
-
"section-notice--type-warning": "_section-notice--type-
|
|
11
|
-
"section-notice--type-danger": "_section-notice--type-
|
|
12
|
-
"section-notice--type-success": "_section-notice--type-
|
|
13
|
-
"section-notice--type-hint": "_section-notice--type-
|
|
2
|
+
"section-notice": "_section-notice_1x4j7_2",
|
|
3
|
+
"section-notice__content": "_section-notice__content_1x4j7_11",
|
|
4
|
+
"section-notice__icon": "_section-notice__icon_1x4j7_18",
|
|
5
|
+
"section-notice__body": "_section-notice__body_1x4j7_25",
|
|
6
|
+
"section-notice__title": "_section-notice__title_1x4j7_34",
|
|
7
|
+
"section-notice__description": "_section-notice__description_1x4j7_47",
|
|
8
|
+
"section-notice__actions": "_section-notice__actions_1x4j7_53",
|
|
9
|
+
"section-notice__dismiss": "_section-notice__dismiss_1x4j7_59",
|
|
10
|
+
"section-notice--type-warning": "_section-notice--type-warning_1x4j7_64",
|
|
11
|
+
"section-notice--type-danger": "_section-notice--type-danger_1x4j7_71",
|
|
12
|
+
"section-notice--type-success": "_section-notice--type-success_1x4j7_78",
|
|
13
|
+
"section-notice--type-hint": "_section-notice--type-hint_1x4j7_85"
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
16
|
t as default
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),T=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]',"[tabindex]"].join(",");function F(r,s){for(let t=r;t;t=t.parentElement){if(t.hidden||t.hasAttribute("inert")||t.getAttribute("aria-hidden")==="true")return!0;const f=getComputedStyle(t);if(f.display==="none"||t===r&&f.visibility==="hidden")return!0;if(t===s)break}return!1}function L(r){return Array.from(r.querySelectorAll(T)).filter(s=>s.tabIndex>=0&&!s.matches(":disabled")&&!F(s,r))}const h=Symbol.for("@mattermost/compass-ui/modal-stack/v1"),p=globalThis,u=p[h]??(p[h]=[]);function O(r,{initialFocusRef:s,closeOnEscape:t=!0,manageFocus:f=!0,onClose:v,active:g=!0}){const R=o.useRef(f),E=o.useRef(s),b=o.useRef({closeOnEscape:t,manageFocus:f,onClose:v});o.useLayoutEffect(()=>{E.current=s,b.current={closeOnEscape:t,manageFocus:f,onClose:v}});const k=o.useRef(null),d=o.useRef(null);o.useEffect(()=>{var i;if(!R.current)return;const c=document.activeElement;function m(){const a=u[u.length-1],l=k.current;return l&&u.includes(l)?a===l:d.current?d.current.wasTop&&a===d.current.below:a===void 0}const e=r.current,n=(i=E.current)==null?void 0:i.current;return n&&(e!=null&&e.contains(n))&&n.focus(),(!n||document.activeElement!==n)&&(e==null||e.focus()),()=>{m()&&c&&c.isConnected&&typeof c.focus=="function"&&c.focus()}},[r]),o.useEffect(()=>{if(!g)return;const c={};u.push(c),k.current=c,d.current=null;function m(e){var w,x;if(e.defaultPrevented||u[u.length-1]!==c)return;const n=r.current;if(!n)return;if(e.key==="Escape"){b.current.closeOnEscape&&((x=(w=b.current).onClose)==null||x.call(w));return}if(e.key!=="Tab"||!b.current.manageFocus)return;const i=L(n);if(i.length===0){e.preventDefault(),n.focus();return}const a=i[0],l=i[i.length-1],y=document.activeElement,S=!n.contains(y);e.shiftKey?(S||y===a||y===n)&&(e.preventDefault(),l.focus()):(S||y===l)&&(e.preventDefault(),a.focus())}return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m);const e=u.indexOf(c);d.current={wasTop:e===u.length-1,below:u[e-1]},u.splice(e,1)}},[r,g])}exports.useModalFocus=O;
|
|
2
2
|
//# sourceMappingURL=use-modal-focus.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modal-focus.cjs","sources":["../../src/hooks/use-modal-focus.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'summary',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n '[tabindex]',\n].join(',');\n\nfunction isHidden(el: HTMLElement, root: HTMLElement): boolean {\n for (let node: HTMLElement | null = el; node; node = node.parentElement) {\n if (node.hidden || node.hasAttribute('inert')) return true;\n if (node.getAttribute('aria-hidden') === 'true') return true;\n const style = getComputedStyle(node);\n if (style.display === 'none') return true;\n if (node === el && style.visibility === 'hidden') return true;\n if (node === root) break;\n }\n return false;\n}\n\nfunction getFocusable(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter(\n (el) => el.tabIndex >= 0 && !el.matches(':disabled') && !isHidden(el, root),\n );\n}\n\n
|
|
1
|
+
{"version":3,"file":"use-modal-focus.cjs","sources":["../../src/hooks/use-modal-focus.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'summary',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n '[tabindex]',\n].join(',');\n\nfunction isHidden(el: HTMLElement, root: HTMLElement): boolean {\n for (let node: HTMLElement | null = el; node; node = node.parentElement) {\n if (node.hidden || node.hasAttribute('inert')) return true;\n if (node.getAttribute('aria-hidden') === 'true') return true;\n const style = getComputedStyle(node);\n if (style.display === 'none') return true;\n if (node === el && style.visibility === 'hidden') return true;\n if (node === root) break;\n }\n return false;\n}\n\nfunction getFocusable(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter(\n (el) => el.tabIndex >= 0 && !el.matches(':disabled') && !isHidden(el, root),\n );\n}\n\n/**\n * Open modals in mount order; only the last one reacts to Tab and Escape.\n * Shared through `globalThis` so compass-ui copies bundled by plugins agree on\n * which modal is topmost.\n *\n * **Frozen v1 protocol** (additive-only, like tokens): opaque `{}` tokens,\n * push while active, splice on leave, last entry is top. Do not change the\n * entry shape or those rules in place — mint `…/modal-stack/v2` instead.\n * A new key means new copies stop cooperating with old ones.\n */\nconst STACK_KEY = Symbol.for('@mattermost/compass-ui/modal-stack/v1');\nconst stackHost = globalThis as typeof globalThis & {\n [STACK_KEY]?: object[];\n};\nconst modalStack: object[] = (stackHost[STACK_KEY] ??= []);\n\nexport interface UseModalFocusOptions {\n /** Element to focus on mount. Falls back to the dialog root. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Close on Escape. Default true. */\n closeOnEscape?: boolean;\n /**\n * Initial focus, Tab trap and focus restore. Set false when the host owns\n * focus (e.g. a floating-ui focus manager). The modal still joins the stack,\n * so modals below it stay inert. Initial focus and restore use the value at\n * mount; the Tab trap follows later updates (like `closeOnEscape`). Default\n * true.\n */\n manageFocus?: boolean;\n onClose?: () => void;\n /**\n * When false (e.g. during an exit transition) Tab and Escape are no longer\n * handled and the modal leaves the stack, but focus is still restored on\n * unmount. Default true.\n */\n active?: boolean;\n}\n\n/**\n * Dialog focus and keyboard behavior for a modal panel: initial focus, Tab trap\n * (focusable elements computed at keypress), Escape (skipped when already\n * handled), and focus restore on unmount.\n *\n * Tab and Escape are handled by one document listener, so the trap still holds\n * when focus sits outside the dialog (e.g. after a backdrop click), and only\n * the topmost active modal responds. Events whose default was prevented (by an\n * inner widget or the host's `onKeyDown`) are ignored.\n */\nexport function useModalFocus(\n rootRef: RefObject<HTMLElement | null>,\n {\n initialFocusRef,\n closeOnEscape = true,\n manageFocus = true,\n onClose,\n active = true,\n }: UseModalFocusOptions,\n): void {\n // Initial focus + restore only run once; the Tab trap reads `manageFocus` live.\n const manageFocusOnMount = useRef(manageFocus);\n const initialFocusRefRef = useRef(initialFocusRef);\n const latest = useRef({ closeOnEscape, manageFocus, onClose });\n // Commit-only writes: avoid leaking options from a discarded concurrent render,\n // without the post-paint stale window of a passive effect.\n useLayoutEffect(() => {\n initialFocusRefRef.current = initialFocusRef;\n latest.current = { closeOnEscape, manageFocus, onClose };\n });\n const keyToken = useRef<object | null>(null);\n // Stack position recorded when the token leaves the stack (exit start).\n const exit = useRef<{ wasTop: boolean; below: object | undefined } | null>(\n null,\n );\n\n useEffect(() => {\n if (!manageFocusOnMount.current) return;\n const previous = document.activeElement as HTMLElement | null;\n function shouldRestoreFocus(): boolean {\n const top = modalStack[modalStack.length - 1];\n const token = keyToken.current;\n if (token && modalStack.includes(token)) return top === token;\n if (!exit.current) return top === undefined;\n return exit.current.wasTop && top === exit.current.below;\n }\n const root = rootRef.current;\n const target = initialFocusRefRef.current?.current;\n if (target && root?.contains(target)) target.focus();\n if (!target || document.activeElement !== target) root?.focus();\n return () => {\n if (\n shouldRestoreFocus() &&\n previous &&\n previous.isConnected &&\n typeof previous.focus === 'function'\n ) {\n previous.focus();\n }\n };\n }, [rootRef]);\n\n useEffect(() => {\n if (!active) return;\n const token = {};\n modalStack.push(token);\n keyToken.current = token;\n exit.current = null;\n\n function handle(e: KeyboardEvent) {\n if (e.defaultPrevented || modalStack[modalStack.length - 1] !== token)\n return;\n const dialog = rootRef.current;\n if (!dialog) return;\n if (e.key === 'Escape') {\n if (latest.current.closeOnEscape) latest.current.onClose?.();\n return;\n }\n if (e.key !== 'Tab' || !latest.current.manageFocus) return;\n const focusable = getFocusable(dialog);\n if (focusable.length === 0) {\n e.preventDefault();\n dialog.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const current = document.activeElement;\n const outside = !dialog.contains(current);\n if (e.shiftKey) {\n if (outside || current === first || current === dialog) {\n e.preventDefault();\n last.focus();\n }\n } else if (outside || current === last) {\n e.preventDefault();\n first.focus();\n }\n }\n document.addEventListener('keydown', handle);\n return () => {\n document.removeEventListener('keydown', handle);\n const index = modalStack.indexOf(token);\n exit.current = {\n wasTop: index === modalStack.length - 1,\n below: modalStack[index - 1],\n };\n modalStack.splice(index, 1);\n };\n }, [rootRef, active]);\n}\n"],"names":["FOCUSABLE_SELECTOR","isHidden","el","root","node","style","getFocusable","STACK_KEY","stackHost","modalStack","useModalFocus","rootRef","initialFocusRef","closeOnEscape","manageFocus","onClose","active","manageFocusOnMount","useRef","initialFocusRefRef","latest","useLayoutEffect","keyToken","exit","useEffect","previous","shouldRestoreFocus","top","token","target","_a","handle","dialog","_b","focusable","first","last","current","outside","index"],"mappings":"yGAGMA,EAAqB,CACzB,UACA,aACA,yBACA,6CACA,yBACA,2BACA,UACA,uBACA,2BACA,YACF,EAAE,KAAK,GAAG,EAEV,SAASC,EAASC,EAAiBC,EAA4B,CAC7D,QAASC,EAA2BF,EAAIE,EAAMA,EAAOA,EAAK,cAAe,CAEvE,GADIA,EAAK,QAAUA,EAAK,aAAa,OAAO,GACxCA,EAAK,aAAa,aAAa,IAAM,OAAQ,MAAO,GACxD,MAAMC,EAAQ,iBAAiBD,CAAI,EAEnC,GADIC,EAAM,UAAY,QAClBD,IAASF,GAAMG,EAAM,aAAe,SAAU,MAAO,GACzD,GAAID,IAASD,EAAM,KACrB,CACA,MAAO,EACT,CAEA,SAASG,EAAaH,EAAkC,CACtD,OAAO,MAAM,KACXA,EAAK,iBAA8BH,CAAkB,CAAA,EACrD,OACCE,GAAOA,EAAG,UAAY,GAAK,CAACA,EAAG,QAAQ,WAAW,GAAK,CAACD,EAASC,EAAIC,CAAI,CAAA,CAE9E,CAYA,MAAMI,EAAY,OAAO,IAAI,uCAAuC,EAC9DC,EAAY,WAGZC,EAAwBD,EAAAD,KAAAC,EAAAD,GAAyB,CAAA,GAkChD,SAASG,EACdC,EACA,CACE,gBAAAC,EACA,cAAAC,EAAgB,GAChB,YAAAC,EAAc,GACd,QAAAC,EACA,OAAAC,EAAS,EACX,EACM,CAEN,MAAMC,EAAqBC,EAAAA,OAAOJ,CAAW,EACvCK,EAAqBD,EAAAA,OAAON,CAAe,EAC3CQ,EAASF,EAAAA,OAAO,CAAE,cAAAL,EAAe,YAAAC,EAAa,QAAAC,EAAS,EAG7DM,EAAAA,gBAAgB,IAAM,CACpBF,EAAmB,QAAUP,EAC7BQ,EAAO,QAAU,CAAE,cAAAP,EAAe,YAAAC,EAAa,QAAAC,C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AW,EAAG,CAC1B,EAAE,eAAA,EACFF,EAAO,MAAA,EACP,MACF,CACA,MAAMG,EAAQD,EAAU,CAAC,EACnBE,EAAOF,EAAUA,EAAU,OAAS,CAAC,EACrCG,EAAU,SAAS,cACnBC,EAAU,CAACN,EAAO,SAASK,CAAO,EACpC,EAAE,UACAC,GAAWD,IAAYF,GAASE,IAAYL,KAC9C,EAAE,eAAA,EACFI,EAAK,MAAA,IAEEE,GAAWD,IAAYD,KAChC,EAAE,eAAA,EACFD,EAAM,MAAA,EAEV,CACA,gBAAS,iBAAiB,UAAWJ,CAAM,EACpC,IAAM,CACX,SAAS,oBAAoB,UAAWA,CAAM,EAC9C,MAAMQ,EAAQ9B,EAAW,QAAQmB,CAAK,EACtCL,EAAK,QAAU,CACb,OAAQgB,IAAU9B,EAAW,OAAS,EACtC,MAAOA,EAAW8B,EAAQ,CAAC,CAAA,EAE7B9B,EAAW,OAAO8B,EAAO,CAAC,CAC5B,CACF,EAAG,CAAC5B,EAASK,CAAM,CAAC,CACtB"}
|
|
@@ -4,6 +4,14 @@ export interface UseModalFocusOptions {
|
|
|
4
4
|
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
5
5
|
/** Close on Escape. Default true. */
|
|
6
6
|
closeOnEscape?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Initial focus, Tab trap and focus restore. Set false when the host owns
|
|
9
|
+
* focus (e.g. a floating-ui focus manager). The modal still joins the stack,
|
|
10
|
+
* so modals below it stay inert. Initial focus and restore use the value at
|
|
11
|
+
* mount; the Tab trap follows later updates (like `closeOnEscape`). Default
|
|
12
|
+
* true.
|
|
13
|
+
*/
|
|
14
|
+
manageFocus?: boolean;
|
|
7
15
|
onClose?: () => void;
|
|
8
16
|
/**
|
|
9
17
|
* When false (e.g. during an exit transition) Tab and Escape are no longer
|
|
@@ -22,5 +30,5 @@ export interface UseModalFocusOptions {
|
|
|
22
30
|
* the topmost active modal responds. Events whose default was prevented (by an
|
|
23
31
|
* inner widget or the host's `onKeyDown`) are ignored.
|
|
24
32
|
*/
|
|
25
|
-
export declare function useModalFocus(rootRef: RefObject<HTMLElement | null>, { initialFocusRef, closeOnEscape, onClose, active, }: UseModalFocusOptions): void;
|
|
33
|
+
export declare function useModalFocus(rootRef: RefObject<HTMLElement | null>, { initialFocusRef, closeOnEscape, manageFocus, onClose, active, }: UseModalFocusOptions): void;
|
|
26
34
|
//# sourceMappingURL=use-modal-focus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modal-focus.d.ts","sourceRoot":"","sources":["../../src/hooks/use-modal-focus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-modal-focus.d.ts","sourceRoot":"","sources":["../../src/hooks/use-modal-focus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAmDvC,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,qCAAqC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACtC,EACE,eAAe,EACf,aAAoB,EACpB,WAAkB,EAClB,OAAO,EACP,MAAa,GACd,EAAE,oBAAoB,GACtB,IAAI,CA2FN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
const
|
|
1
|
+
import { useRef as d, useLayoutEffect as A, useEffect as S } from "react";
|
|
2
|
+
const F = [
|
|
3
3
|
"a[href]",
|
|
4
4
|
"area[href]",
|
|
5
5
|
"button:not([disabled])",
|
|
@@ -11,81 +11,83 @@ const w = [
|
|
|
11
11
|
'[contenteditable="true"]',
|
|
12
12
|
"[tabindex]"
|
|
13
13
|
].join(",");
|
|
14
|
-
function
|
|
14
|
+
function O(r, o) {
|
|
15
15
|
for (let t = r; t; t = t.parentElement) {
|
|
16
16
|
if (t.hidden || t.hasAttribute("inert") || t.getAttribute("aria-hidden") === "true") return !0;
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
if (t ===
|
|
17
|
+
const i = getComputedStyle(t);
|
|
18
|
+
if (i.display === "none" || t === r && i.visibility === "hidden") return !0;
|
|
19
|
+
if (t === o) break;
|
|
20
20
|
}
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function C(r) {
|
|
24
24
|
return Array.from(
|
|
25
|
-
r.querySelectorAll(
|
|
25
|
+
r.querySelectorAll(F)
|
|
26
26
|
).filter(
|
|
27
|
-
(
|
|
27
|
+
(o) => o.tabIndex >= 0 && !o.matches(":disabled") && !O(o, r)
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
const u = [];
|
|
31
|
-
function
|
|
32
|
-
initialFocusRef:
|
|
30
|
+
const h = Symbol.for("@mattermost/compass-ui/modal-stack/v1"), y = globalThis, u = y[h] ?? (y[h] = []);
|
|
31
|
+
function M(r, {
|
|
32
|
+
initialFocusRef: o,
|
|
33
33
|
closeOnEscape: t = !0,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
manageFocus: i = !0,
|
|
35
|
+
onClose: v,
|
|
36
|
+
active: g = !0
|
|
36
37
|
}) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
38
|
+
const T = d(i), E = d(o), m = d({ closeOnEscape: t, manageFocus: i, onClose: v });
|
|
39
|
+
A(() => {
|
|
40
|
+
E.current = o, m.current = { closeOnEscape: t, manageFocus: i, onClose: v };
|
|
41
|
+
});
|
|
42
|
+
const k = d(null), l = d(
|
|
42
43
|
null
|
|
43
44
|
);
|
|
44
|
-
|
|
45
|
-
var
|
|
45
|
+
S(() => {
|
|
46
|
+
var s;
|
|
47
|
+
if (!T.current) return;
|
|
46
48
|
const c = document.activeElement;
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
return
|
|
49
|
+
function b() {
|
|
50
|
+
const f = u[u.length - 1], a = k.current;
|
|
51
|
+
return a && u.includes(a) ? f === a : l.current ? l.current.wasTop && f === l.current.below : f === void 0;
|
|
50
52
|
}
|
|
51
|
-
const e = r.current, n = (
|
|
53
|
+
const e = r.current, n = (s = E.current) == null ? void 0 : s.current;
|
|
52
54
|
return n && (e != null && e.contains(n)) && n.focus(), (!n || document.activeElement !== n) && (e == null || e.focus()), () => {
|
|
53
|
-
|
|
55
|
+
b() && c && c.isConnected && typeof c.focus == "function" && c.focus();
|
|
54
56
|
};
|
|
55
|
-
}, [r]),
|
|
56
|
-
if (!
|
|
57
|
+
}, [r]), S(() => {
|
|
58
|
+
if (!g) return;
|
|
57
59
|
const c = {};
|
|
58
|
-
u.push(c),
|
|
59
|
-
function
|
|
60
|
-
var
|
|
60
|
+
u.push(c), k.current = c, l.current = null;
|
|
61
|
+
function b(e) {
|
|
62
|
+
var w, L;
|
|
61
63
|
if (e.defaultPrevented || u[u.length - 1] !== c)
|
|
62
64
|
return;
|
|
63
65
|
const n = r.current;
|
|
64
66
|
if (!n) return;
|
|
65
67
|
if (e.key === "Escape") {
|
|
66
|
-
|
|
68
|
+
m.current.closeOnEscape && ((L = (w = m.current).onClose) == null || L.call(w));
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
|
-
if (e.key !== "Tab") return;
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
71
|
+
if (e.key !== "Tab" || !m.current.manageFocus) return;
|
|
72
|
+
const s = C(n);
|
|
73
|
+
if (s.length === 0) {
|
|
72
74
|
e.preventDefault(), n.focus();
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
|
-
const
|
|
76
|
-
e.shiftKey ? (
|
|
77
|
+
const f = s[0], a = s[s.length - 1], p = document.activeElement, x = !n.contains(p);
|
|
78
|
+
e.shiftKey ? (x || p === f || p === n) && (e.preventDefault(), a.focus()) : (x || p === a) && (e.preventDefault(), f.focus());
|
|
77
79
|
}
|
|
78
|
-
return document.addEventListener("keydown",
|
|
79
|
-
document.removeEventListener("keydown",
|
|
80
|
+
return document.addEventListener("keydown", b), () => {
|
|
81
|
+
document.removeEventListener("keydown", b);
|
|
80
82
|
const e = u.indexOf(c);
|
|
81
83
|
l.current = {
|
|
82
84
|
wasTop: e === u.length - 1,
|
|
83
85
|
below: u[e - 1]
|
|
84
86
|
}, u.splice(e, 1);
|
|
85
87
|
};
|
|
86
|
-
}, [r,
|
|
88
|
+
}, [r, g]);
|
|
87
89
|
}
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
M as useModalFocus
|
|
90
92
|
};
|
|
91
93
|
//# sourceMappingURL=use-modal-focus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modal-focus.js","sources":["../../src/hooks/use-modal-focus.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'summary',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n '[tabindex]',\n].join(',');\n\nfunction isHidden(el: HTMLElement, root: HTMLElement): boolean {\n for (let node: HTMLElement | null = el; node; node = node.parentElement) {\n if (node.hidden || node.hasAttribute('inert')) return true;\n if (node.getAttribute('aria-hidden') === 'true') return true;\n const style = getComputedStyle(node);\n if (style.display === 'none') return true;\n if (node === el && style.visibility === 'hidden') return true;\n if (node === root) break;\n }\n return false;\n}\n\nfunction getFocusable(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter(\n (el) => el.tabIndex >= 0 && !el.matches(':disabled') && !isHidden(el, root),\n );\n}\n\n/** Open modals in mount order; only the last one reacts to Tab and Escape. */\nconst modalStack: object[] = [];\n\nexport interface UseModalFocusOptions {\n /** Element to focus on mount. Falls back to the dialog root. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Close on Escape. Default true. */\n closeOnEscape?: boolean;\n onClose?: () => void;\n /**\n * When false (e.g. during an exit transition) Tab and Escape are no longer\n * handled and the modal leaves the stack, but focus is still restored on\n * unmount. Default true.\n */\n active?: boolean;\n}\n\n/**\n * Dialog focus and keyboard behavior for a modal panel: initial focus, Tab trap\n * (focusable elements computed at keypress), Escape (skipped when already\n * handled), and focus restore on unmount.\n *\n * Tab and Escape are handled by one document listener, so the trap still holds\n * when focus sits outside the dialog (e.g. after a backdrop click), and only\n * the topmost active modal responds. Events whose default was prevented (by an\n * inner widget or the host's `onKeyDown`) are ignored.\n */\nexport function useModalFocus(\n rootRef: RefObject<HTMLElement | null>,\n {\n initialFocusRef,\n closeOnEscape = true,\n onClose,\n active = true,\n }: UseModalFocusOptions,\n): void {\n const initialFocusRefRef = useRef(initialFocusRef);\n initialFocusRefRef.current = initialFocusRef;\n const latest = useRef({ closeOnEscape, onClose });\n latest.current = { closeOnEscape, onClose };\n const keyToken = useRef<object | null>(null);\n // Stack position recorded when the token leaves the stack (exit start).\n const exit = useRef<{ wasTop: boolean; below: object | undefined } | null>(\n null,\n );\n\n useEffect(() => {\n const previous = document.activeElement as HTMLElement | null;\n function shouldRestoreFocus(): boolean {\n const top = modalStack[modalStack.length - 1];\n const token = keyToken.current;\n if (token && modalStack.includes(token)) return top === token;\n if (!exit.current) return top === undefined;\n return exit.current.wasTop && top === exit.current.below;\n }\n const root = rootRef.current;\n const target = initialFocusRefRef.current?.current;\n if (target && root?.contains(target)) target.focus();\n if (!target || document.activeElement !== target) root?.focus();\n return () => {\n if (\n shouldRestoreFocus() &&\n previous &&\n previous.isConnected &&\n typeof previous.focus === 'function'\n ) {\n previous.focus();\n }\n };\n }, [rootRef]);\n\n useEffect(() => {\n if (!active) return;\n const token = {};\n modalStack.push(token);\n keyToken.current = token;\n exit.current = null;\n\n function handle(e: KeyboardEvent) {\n if (e.defaultPrevented || modalStack[modalStack.length - 1] !== token)\n return;\n const dialog = rootRef.current;\n if (!dialog) return;\n if (e.key === 'Escape') {\n if (latest.current.closeOnEscape) latest.current.onClose?.();\n return;\n }\n if (e.key !== 'Tab') return;\n const focusable = getFocusable(dialog);\n if (focusable.length === 0) {\n e.preventDefault();\n dialog.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const current = document.activeElement;\n const outside = !dialog.contains(current);\n if (e.shiftKey) {\n if (outside || current === first || current === dialog) {\n e.preventDefault();\n last.focus();\n }\n } else if (outside || current === last) {\n e.preventDefault();\n first.focus();\n }\n }\n document.addEventListener('keydown', handle);\n return () => {\n document.removeEventListener('keydown', handle);\n const index = modalStack.indexOf(token);\n exit.current = {\n wasTop: index === modalStack.length - 1,\n below: modalStack[index - 1],\n };\n modalStack.splice(index, 1);\n };\n }, [rootRef, active]);\n}\n"],"names":["FOCUSABLE_SELECTOR","isHidden","el","root","node","style","getFocusable","modalStack","useModalFocus","rootRef","initialFocusRef","closeOnEscape","onClose","active","initialFocusRefRef","useRef","latest","keyToken","exit","useEffect","previous","shouldRestoreFocus","top","token","target","_a","handle","dialog","_b","focusable","first","last","current","outside","index"],"mappings":";AAGA,MAAMA,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEV,SAASC,EAASC,GAAiBC,GAA4B;AAC7D,WAASC,IAA2BF,GAAIE,GAAMA,IAAOA,EAAK,eA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AAL,EAAK,UAAU;AAAA,QACb,QAAQgB,MAAU3B,EAAW,SAAS;AAAA,QACtC,OAAOA,EAAW2B,IAAQ,CAAC;AAAA,MAAA,GAE7B3B,EAAW,OAAO2B,GAAO,CAAC;AAAA,IAC5B;AAAA,EACF,GAAG,CAACzB,GAASI,CAAM,CAAC;AACtB;"}
|
|
1
|
+
{"version":3,"file":"use-modal-focus.js","sources":["../../src/hooks/use-modal-focus.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'summary',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n '[tabindex]',\n].join(',');\n\nfunction isHidden(el: HTMLElement, root: HTMLElement): boolean {\n for (let node: HTMLElement | null = el; node; node = node.parentElement) {\n if (node.hidden || node.hasAttribute('inert')) return true;\n if (node.getAttribute('aria-hidden') === 'true') return true;\n const style = getComputedStyle(node);\n if (style.display === 'none') return true;\n if (node === el && style.visibility === 'hidden') return true;\n if (node === root) break;\n }\n return false;\n}\n\nfunction getFocusable(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter(\n (el) => el.tabIndex >= 0 && !el.matches(':disabled') && !isHidden(el, root),\n );\n}\n\n/**\n * Open modals in mount order; only the last one reacts to Tab and Escape.\n * Shared through `globalThis` so compass-ui copies bundled by plugins agree on\n * which modal is topmost.\n *\n * **Frozen v1 protocol** (additive-only, like tokens): opaque `{}` tokens,\n * push while active, splice on leave, last entry is top. Do not change the\n * entry shape or those rules in place — mint `…/modal-stack/v2` instead.\n * A new key means new copies stop cooperating with old ones.\n */\nconst STACK_KEY = Symbol.for('@mattermost/compass-ui/modal-stack/v1');\nconst stackHost = globalThis as typeof globalThis & {\n [STACK_KEY]?: object[];\n};\nconst modalStack: object[] = (stackHost[STACK_KEY] ??= []);\n\nexport interface UseModalFocusOptions {\n /** Element to focus on mount. Falls back to the dialog root. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Close on Escape. Default true. */\n closeOnEscape?: boolean;\n /**\n * Initial focus, Tab trap and focus restore. Set false when the host owns\n * focus (e.g. a floating-ui focus manager). The modal still joins the stack,\n * so modals below it stay inert. Initial focus and restore use the value at\n * mount; the Tab trap follows later updates (like `closeOnEscape`). Default\n * true.\n */\n manageFocus?: boolean;\n onClose?: () => void;\n /**\n * When false (e.g. during an exit transition) Tab and Escape are no longer\n * handled and the modal leaves the stack, but focus is still restored on\n * unmount. Default true.\n */\n active?: boolean;\n}\n\n/**\n * Dialog focus and keyboard behavior for a modal panel: initial focus, Tab trap\n * (focusable elements computed at keypress), Escape (skipped when already\n * handled), and focus restore on unmount.\n *\n * Tab and Escape are handled by one document listener, so the trap still holds\n * when focus sits outside the dialog (e.g. after a backdrop click), and only\n * the topmost active modal responds. Events whose default was prevented (by an\n * inner widget or the host's `onKeyDown`) are ignored.\n */\nexport function useModalFocus(\n rootRef: RefObject<HTMLElement | null>,\n {\n initialFocusRef,\n closeOnEscape = true,\n manageFocus = true,\n onClose,\n active = true,\n }: UseModalFocusOptions,\n): void {\n // Initial focus + restore only run once; the Tab trap reads `manageFocus` live.\n const manageFocusOnMount = useRef(manageFocus);\n const initialFocusRefRef = useRef(initialFocusRef);\n const latest = useRef({ closeOnEscape, manageFocus, onClose });\n // Commit-only writes: avoid leaking options from a discarded concurrent render,\n // without the post-paint stale window of a passive effect.\n useLayoutEffect(() => {\n initialFocusRefRef.current = initialFocusRef;\n latest.current = { closeOnEscape, manageFocus, onClose };\n });\n const keyToken = useRef<object | null>(null);\n // Stack position recorded when the token leaves the stack (exit start).\n const exit = useRef<{ wasTop: boolean; below: object | undefined } | null>(\n null,\n );\n\n useEffect(() => {\n if (!manageFocusOnMount.current) return;\n const previous = document.activeElement as HTMLElement | null;\n function shouldRestoreFocus(): boolean {\n const top = modalStack[modalStack.length - 1];\n const token = keyToken.current;\n if (token && modalStack.includes(token)) return top === token;\n if (!exit.current) return top === undefined;\n return exit.current.wasTop && top === exit.current.below;\n }\n const root = rootRef.current;\n const target = initialFocusRefRef.current?.current;\n if (target && root?.contains(target)) target.focus();\n if (!target || document.activeElement !== target) root?.focus();\n return () => {\n if (\n shouldRestoreFocus() &&\n previous &&\n previous.isConnected &&\n typeof previous.focus === 'function'\n ) {\n previous.focus();\n }\n };\n }, [rootRef]);\n\n useEffect(() => {\n if (!active) return;\n const token = {};\n modalStack.push(token);\n keyToken.current = token;\n exit.current = null;\n\n function handle(e: KeyboardEvent) {\n if (e.defaultPrevented || modalStack[modalStack.length - 1] !== token)\n return;\n const dialog = rootRef.current;\n if (!dialog) return;\n if (e.key === 'Escape') {\n if (latest.current.closeOnEscape) latest.current.onClose?.();\n return;\n }\n if (e.key !== 'Tab' || !latest.current.manageFocus) return;\n const focusable = getFocusable(dialog);\n if (focusable.length === 0) {\n e.preventDefault();\n dialog.focus();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const current = document.activeElement;\n const outside = !dialog.contains(current);\n if (e.shiftKey) {\n if (outside || current === first || current === dialog) {\n e.preventDefault();\n last.focus();\n }\n } else if (outside || current === last) {\n e.preventDefault();\n first.focus();\n }\n }\n document.addEventListener('keydown', handle);\n return () => {\n document.removeEventListener('keydown', handle);\n const index = modalStack.indexOf(token);\n exit.current = {\n wasTop: index === modalStack.length - 1,\n below: modalStack[index - 1],\n };\n modalStack.splice(index, 1);\n };\n }, [rootRef, active]);\n}\n"],"names":["FOCUSABLE_SELECTOR","isHidden","el","root","node","style","getFocusable","STACK_KEY","stackHost","modalStack","useModalFocus","rootRef","initialFocusRef","closeOnEscape","manageFocus","onClose","active","manageFocusOnMount","useRef","initialFocusRefRef","latest","useLayoutEffect","keyToken","exit","useEffect","previous","shouldRestoreFocus","top","token","target","_a","handle","dial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AAY5B,EAAa0B,CAAM;AACrC,UAAIE,EAAU,WAAW,GAAG;AAC1B,UAAE,eAAA,GACFF,EAAO,MAAA;AACP;AAAA,MACF;AACA,YAAMG,IAAQD,EAAU,CAAC,GACnBE,IAAOF,EAAUA,EAAU,SAAS,CAAC,GACrCG,IAAU,SAAS,eACnBC,IAAU,CAACN,EAAO,SAASK,CAAO;AACxC,MAAI,EAAE,YACAC,KAAWD,MAAYF,KAASE,MAAYL,OAC9C,EAAE,eAAA,GACFI,EAAK,MAAA,MAEEE,KAAWD,MAAYD,OAChC,EAAE,eAAA,GACFD,EAAM,MAAA;AAAA,IAEV;AACA,oBAAS,iBAAiB,WAAWJ,CAAM,GACpC,MAAM;AACX,eAAS,oBAAoB,WAAWA,CAAM;AAC9C,YAAMQ,IAAQ9B,EAAW,QAAQmB,CAAK;AACtC,MAAAL,EAAK,UAAU;AAAA,QACb,QAAQgB,MAAU9B,EAAW,SAAS;AAAA,QACtC,OAAOA,EAAW8B,IAAQ,CAAC;AAAA,MAAA,GAE7B9B,EAAW,OAAO8B,GAAO,CAAC;AAAA,IAC5B;AAAA,EACF,GAAG,CAAC5B,GAASK,CAAM,CAAC;AACtB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["ai-copilot-intro","alert","alert-on-sidebar-bg","archived-channel","auto-translation","banners","billing-history","blank-playbook","bot-accounts","browser-or-desktop","bug-bash","calls","collaborate","compliance-exports","copilot-bot","custom-branding","custom-terms","customer-onboarding","data-retention","drafts-empty","employee-onboarding","feature-lifecycle","file-search-empty","globe","group","groups","incident-resolution","incoming-webhook","intune-mam","learn-playbooks","locked-messages","mentions-empty","message-not-viewable","message-search-empty","mfa","mfa-complete","mobile-protection","mobile-security","new-password","no-unreads-on-sidebar-bg","office","outgoing-webhook","pinned-empty","playbooks-empty","private-channel-intro","product-release","public-channel-intro","rating","rating-desktop","read-only","reset-password","saved-empty","scheduled-empty","search","server","setup-system","site-error","slash-commands","success","system-admins","threads-empty","timer","tls-certificate","tools","town-square-channel-intro","upload-license","verify-email"];exports.ILLUSTRATION_NAMES=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["ai-copilot-intro","alert","alert-on-sidebar-bg","archived-channel","auto-translation","banners","billing-history","blank-playbook","bot-accounts","browser-or-desktop","bug-bash","calls","collaborate","compliance-exports","copilot-bot","custom-branding","custom-terms","customer-onboarding","data-retention","drafts-empty","employee-onboarding","feature-lifecycle","file-search-empty","globe","group","groups","incident-resolution","incoming-webhook","intune-mam","learn-playbooks","locked-messages","mentions-empty","message-not-viewable","message-search-empty","mfa","mfa-complete","mobile-protection","mobile-security","new-password","no-unreads-on-sidebar-bg","oauth","office","outgoing-oauth-connections","outgoing-webhook","pinned-empty","playbooks-empty","private-channel-intro","product-release","public-channel-intro","rating","rating-desktop","read-only","reset-password","saved-empty","scheduled-empty","search","server","setup-system","site-error","slash-commands","success","system-admins","threads-empty","timer","tls-certificate","tools","town-square-channel-intro","upload-license","verify-email"];exports.ILLUSTRATION_NAMES=e;
|
|
2
2
|
//# sourceMappingURL=names.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.cjs","sources":["../../src/illustrations/names.ts"],"sourcesContent":["/* Generated by scripts/gen-compass-illustrations.mjs — do not edit by hand */\n\nexport const ILLUSTRATION_NAMES = [\n 'ai-copilot-intro',\n 'alert',\n 'alert-on-sidebar-bg',\n 'archived-channel',\n 'auto-translation',\n 'banners',\n 'billing-history',\n 'blank-playbook',\n 'bot-accounts',\n 'browser-or-desktop',\n 'bug-bash',\n 'calls',\n 'collaborate',\n 'compliance-exports',\n 'copilot-bot',\n 'custom-branding',\n 'custom-terms',\n 'customer-onboarding',\n 'data-retention',\n 'drafts-empty',\n 'employee-onboarding',\n 'feature-lifecycle',\n 'file-search-empty',\n 'globe',\n 'group',\n 'groups',\n 'incident-resolution',\n 'incoming-webhook',\n 'intune-mam',\n 'learn-playbooks',\n 'locked-messages',\n 'mentions-empty',\n 'message-not-viewable',\n 'message-search-empty',\n 'mfa',\n 'mfa-complete',\n 'mobile-protection',\n 'mobile-security',\n 'new-password',\n 'no-unreads-on-sidebar-bg',\n 'office',\n 'outgoing-webhook',\n 'pinned-empty',\n 'playbooks-empty',\n 'private-channel-intro',\n 'product-release',\n 'public-channel-intro',\n 'rating',\n 'rating-desktop',\n 'read-only',\n 'reset-password',\n 'saved-empty',\n 'scheduled-empty',\n 'search',\n 'server',\n 'setup-system',\n 'site-error',\n 'slash-commands',\n 'success',\n 'system-admins',\n 'threads-empty',\n 'timer',\n 'tls-certificate',\n 'tools',\n 'town-square-channel-intro',\n 'upload-license',\n 'verify-email',\n] as const;\n\nexport type IllustrationName = (typeof ILLUSTRATION_NAMES)[number];\n"],"names":["ILLUSTRATION_NAMES"],"mappings":"gFAEO,MAAMA,EAAqB,CAChC,mBACA,QACA,sBACA,mBACA,mBACA,UACA,kBACA,iBACA,eACA,qBACA,WACA,QACA,cACA,qBACA,cACA,kBACA,eACA,sBACA,iBACA,eACA,sBACA,oBACA,oBACA,QACA,QACA,SACA,sBACA,mBACA,aACA,kBACA,kBACA,iBACA,uBACA,uBACA,MACA,eACA,oBACA,kBACA,eACA,2BACA,SACA,mBACA,eACA,kBACA,wBACA,kBACA,uBACA,SACA,iBACA,YACA,iBACA,cACA,kBACA,SACA,SACA,eACA,aACA,iBACA,UACA,gBACA,gBACA,QACA,kBACA,QACA,4BACA,iBACA,cACF"}
|
|
1
|
+
{"version":3,"file":"names.cjs","sources":["../../src/illustrations/names.ts"],"sourcesContent":["/* Generated by scripts/gen-compass-illustrations.mjs — do not edit by hand */\n\nexport const ILLUSTRATION_NAMES = [\n 'ai-copilot-intro',\n 'alert',\n 'alert-on-sidebar-bg',\n 'archived-channel',\n 'auto-translation',\n 'banners',\n 'billing-history',\n 'blank-playbook',\n 'bot-accounts',\n 'browser-or-desktop',\n 'bug-bash',\n 'calls',\n 'collaborate',\n 'compliance-exports',\n 'copilot-bot',\n 'custom-branding',\n 'custom-terms',\n 'customer-onboarding',\n 'data-retention',\n 'drafts-empty',\n 'employee-onboarding',\n 'feature-lifecycle',\n 'file-search-empty',\n 'globe',\n 'group',\n 'groups',\n 'incident-resolution',\n 'incoming-webhook',\n 'intune-mam',\n 'learn-playbooks',\n 'locked-messages',\n 'mentions-empty',\n 'message-not-viewable',\n 'message-search-empty',\n 'mfa',\n 'mfa-complete',\n 'mobile-protection',\n 'mobile-security',\n 'new-password',\n 'no-unreads-on-sidebar-bg',\n 'oauth',\n 'office',\n 'outgoing-oauth-connections',\n 'outgoing-webhook',\n 'pinned-empty',\n 'playbooks-empty',\n 'private-channel-intro',\n 'product-release',\n 'public-channel-intro',\n 'rating',\n 'rating-desktop',\n 'read-only',\n 'reset-password',\n 'saved-empty',\n 'scheduled-empty',\n 'search',\n 'server',\n 'setup-system',\n 'site-error',\n 'slash-commands',\n 'success',\n 'system-admins',\n 'threads-empty',\n 'timer',\n 'tls-certificate',\n 'tools',\n 'town-square-channel-intro',\n 'upload-license',\n 'verify-email',\n] as const;\n\nexport type IllustrationName = (typeof ILLUSTRATION_NAMES)[number];\n"],"names":["ILLUSTRATION_NAMES"],"mappings":"gFAEO,MAAMA,EAAqB,CAChC,mBACA,QACA,sBACA,mBACA,mBACA,UACA,kBACA,iBACA,eACA,qBACA,WACA,QACA,cACA,qBACA,cACA,kBACA,eACA,sBACA,iBACA,eACA,sBACA,oBACA,oBACA,QACA,QACA,SACA,sBACA,mBACA,aACA,kBACA,kBACA,iBACA,uBACA,uBACA,MACA,eACA,oBACA,kBACA,eACA,2BACA,QACA,SACA,6BACA,mBACA,eACA,kBACA,wBACA,kBACA,uBACA,SACA,iBACA,YACA,iBACA,cACA,kBACA,SACA,SACA,eACA,aACA,iBACA,UACA,gBACA,gBACA,QACA,kBACA,QACA,4BACA,iBACA,cACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const ILLUSTRATION_NAMES: readonly ["ai-copilot-intro", "alert", "alert-on-sidebar-bg", "archived-channel", "auto-translation", "banners", "billing-history", "blank-playbook", "bot-accounts", "browser-or-desktop", "bug-bash", "calls", "collaborate", "compliance-exports", "copilot-bot", "custom-branding", "custom-terms", "customer-onboarding", "data-retention", "drafts-empty", "employee-onboarding", "feature-lifecycle", "file-search-empty", "globe", "group", "groups", "incident-resolution", "incoming-webhook", "intune-mam", "learn-playbooks", "locked-messages", "mentions-empty", "message-not-viewable", "message-search-empty", "mfa", "mfa-complete", "mobile-protection", "mobile-security", "new-password", "no-unreads-on-sidebar-bg", "office", "outgoing-webhook", "pinned-empty", "playbooks-empty", "private-channel-intro", "product-release", "public-channel-intro", "rating", "rating-desktop", "read-only", "reset-password", "saved-empty", "scheduled-empty", "search", "server", "setup-system", "site-error", "slash-commands", "success", "system-admins", "threads-empty", "timer", "tls-certificate", "tools", "town-square-channel-intro", "upload-license", "verify-email"];
|
|
1
|
+
export declare const ILLUSTRATION_NAMES: readonly ["ai-copilot-intro", "alert", "alert-on-sidebar-bg", "archived-channel", "auto-translation", "banners", "billing-history", "blank-playbook", "bot-accounts", "browser-or-desktop", "bug-bash", "calls", "collaborate", "compliance-exports", "copilot-bot", "custom-branding", "custom-terms", "customer-onboarding", "data-retention", "drafts-empty", "employee-onboarding", "feature-lifecycle", "file-search-empty", "globe", "group", "groups", "incident-resolution", "incoming-webhook", "intune-mam", "learn-playbooks", "locked-messages", "mentions-empty", "message-not-viewable", "message-search-empty", "mfa", "mfa-complete", "mobile-protection", "mobile-security", "new-password", "no-unreads-on-sidebar-bg", "oauth", "office", "outgoing-oauth-connections", "outgoing-webhook", "pinned-empty", "playbooks-empty", "private-channel-intro", "product-release", "public-channel-intro", "rating", "rating-desktop", "read-only", "reset-password", "saved-empty", "scheduled-empty", "search", "server", "setup-system", "site-error", "slash-commands", "success", "system-admins", "threads-empty", "timer", "tls-certificate", "tools", "town-square-channel-intro", "upload-license", "verify-email"];
|
|
2
2
|
export type IllustrationName = (typeof ILLUSTRATION_NAMES)[number];
|
|
3
3
|
//# sourceMappingURL=names.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../src/illustrations/names.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../src/illustrations/names.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,yqCAsErB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|