@activecollab/components 2.0.555 → 2.0.557

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 (58) hide show
  1. package/dist/cjs/components/Autocomplete/Autocomplete.js +9 -3
  2. package/dist/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  3. package/dist/cjs/components/Input/InputPhone.js +3 -1
  4. package/dist/cjs/components/Input/InputPhone.js.map +1 -1
  5. package/dist/cjs/components/ModalRoot/ModalRoot.js +129 -28
  6. package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
  7. package/dist/cjs/components/ModalRoot/Styles.js +2 -1
  8. package/dist/cjs/components/ModalRoot/Styles.js.map +1 -1
  9. package/dist/cjs/components/ModalRoot/modalRootStack.js +92 -23
  10. package/dist/cjs/components/ModalRoot/modalRootStack.js.map +1 -1
  11. package/dist/cjs/components/ModalRoot/useModalStackHost.js +8 -2
  12. package/dist/cjs/components/ModalRoot/useModalStackHost.js.map +1 -1
  13. package/dist/cjs/components/RadioButton/Styles.js +2 -2
  14. package/dist/cjs/components/RadioButton/Styles.js.map +1 -1
  15. package/dist/cjs/components/Select/Option/Styles.js +1 -1
  16. package/dist/cjs/components/Select/Option/Styles.js.map +1 -1
  17. package/dist/cjs/utils/layers.js +8 -3
  18. package/dist/cjs/utils/layers.js.map +1 -1
  19. package/dist/cjs/utils/layers.test.js +15 -0
  20. package/dist/cjs/utils/layers.test.js.map +1 -1
  21. package/dist/esm/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  22. package/dist/esm/components/Autocomplete/Autocomplete.js +9 -3
  23. package/dist/esm/components/Autocomplete/Autocomplete.js.map +1 -1
  24. package/dist/esm/components/Input/InputPhone.d.ts.map +1 -1
  25. package/dist/esm/components/Input/InputPhone.js +3 -1
  26. package/dist/esm/components/Input/InputPhone.js.map +1 -1
  27. package/dist/esm/components/ModalRoot/ModalRoot.d.ts +2 -1
  28. package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
  29. package/dist/esm/components/ModalRoot/ModalRoot.js +130 -29
  30. package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
  31. package/dist/esm/components/ModalRoot/Styles.d.ts.map +1 -1
  32. package/dist/esm/components/ModalRoot/Styles.js +2 -1
  33. package/dist/esm/components/ModalRoot/Styles.js.map +1 -1
  34. package/dist/esm/components/ModalRoot/modalRootStack.d.ts +12 -0
  35. package/dist/esm/components/ModalRoot/modalRootStack.d.ts.map +1 -1
  36. package/dist/esm/components/ModalRoot/modalRootStack.js +66 -17
  37. package/dist/esm/components/ModalRoot/modalRootStack.js.map +1 -1
  38. package/dist/esm/components/ModalRoot/useModalStackHost.d.ts +3 -1
  39. package/dist/esm/components/ModalRoot/useModalStackHost.d.ts.map +1 -1
  40. package/dist/esm/components/ModalRoot/useModalStackHost.js +8 -2
  41. package/dist/esm/components/ModalRoot/useModalStackHost.js.map +1 -1
  42. package/dist/esm/components/RadioButton/Styles.d.ts.map +1 -1
  43. package/dist/esm/components/RadioButton/Styles.js +2 -2
  44. package/dist/esm/components/RadioButton/Styles.js.map +1 -1
  45. package/dist/esm/components/Select/Option/Styles.d.ts.map +1 -1
  46. package/dist/esm/components/Select/Option/Styles.js +1 -1
  47. package/dist/esm/components/Select/Option/Styles.js.map +1 -1
  48. package/dist/esm/utils/layers.d.ts +4 -1
  49. package/dist/esm/utils/layers.d.ts.map +1 -1
  50. package/dist/esm/utils/layers.js +6 -3
  51. package/dist/esm/utils/layers.js.map +1 -1
  52. package/dist/esm/utils/layers.test.js +15 -0
  53. package/dist/esm/utils/layers.test.js.map +1 -1
  54. package/dist/index.js +315 -132
  55. package/dist/index.js.map +1 -1
  56. package/dist/index.min.js +1 -1
  57. package/dist/index.min.js.map +1 -1
  58. package/package.json +1 -1
@@ -3,7 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.suspendModalRoots = exports.subscribeToModalRoots = exports.pushModalRoot = exports.popModalRoot = exports.isTopModalRoot = exports.getTopModalRootIdBelowOpenSheets = exports.getTopModalRootId = exports.getTopModalOverlayRoot = exports.getModalOverlayRootUpTo = exports.areModalRootsSuspended = void 0;
6
+ exports.suspendModalRoots = exports.subscribeToModalRoots = exports.reopenModalRoot = exports.releaseModalRoot = exports.pushModalRoot = exports.popModalRoot = exports.isTopModalRoot = exports.isHeldByClosingModalRoot = exports.getTopModalRootIdBelowOpenSheets = exports.getTopModalRootId = exports.getTopModalOverlayRoot = exports.getModalOverlayRootUpTo = exports.areModalRootsSuspended = void 0;
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
12
  var listeners = new Set();
8
13
  var stack = [];
9
14
  var lastId = 0;
@@ -13,6 +18,14 @@ var notify = function notify() {
13
18
  return listener();
14
19
  });
15
20
  };
21
+ var getOpenEntries = function getOpenEntries() {
22
+ return stack.filter(function (entry) {
23
+ return !entry.closing;
24
+ });
25
+ };
26
+ var isInside = function isInside(entry, outside) {
27
+ return !!outside && !!entry.overlayRoot && outside.contains(entry.overlayRoot);
28
+ };
16
29
  var pushModalRoot = exports.pushModalRoot = function pushModalRoot(overlayRoot, suspension) {
17
30
  var belowOpenSheets = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
18
31
  lastId += 1;
@@ -41,12 +54,68 @@ var popModalRoot = exports.popModalRoot = function popModalRoot(id) {
41
54
  });
42
55
  notify();
43
56
  };
44
- var isTopModalRoot = exports.isTopModalRoot = function isTopModalRoot(id) {
45
- var _stack;
46
- return ((_stack = stack[stack.length - 1]) === null || _stack === void 0 ? void 0 : _stack.id) === id;
57
+
58
+ /**
59
+ * A modal root that plays its exit transition is no longer open: it leaves every query of the stack, and only keeps
60
+ * the hosts already in its overlay root until popModalRoot.
61
+ */
62
+ var releaseModalRoot = exports.releaseModalRoot = function releaseModalRoot(id) {
63
+ var entry = stack.find(function (candidate) {
64
+ return candidate.id === id;
65
+ });
66
+ if (!entry || entry.closing) {
67
+ return;
68
+ }
69
+ stack = stack.map(function (candidate) {
70
+ return candidate === entry ? _objectSpread(_objectSpread({}, candidate), {}, {
71
+ closing: true
72
+ }) : candidate;
73
+ });
74
+ notify();
47
75
  };
48
- var isInside = function isInside(entry, outside) {
49
- return !!outside && !!entry.overlayRoot && outside.contains(entry.overlayRoot);
76
+
77
+ /** Reopened during its exit, a modal root keeps its id unless a newer one is in the stack; false then. */
78
+ var reopenModalRoot = exports.reopenModalRoot = function reopenModalRoot(id) {
79
+ var entry = stack[stack.length - 1];
80
+ if ((entry === null || entry === void 0 ? void 0 : entry.id) !== id) {
81
+ return false;
82
+ }
83
+ stack = stack.map(function (candidate) {
84
+ return candidate === entry ? _objectSpread(_objectSpread({}, candidate), {}, {
85
+ closing: false
86
+ }) : candidate;
87
+ });
88
+ if (suspensions > 0) {
89
+ var _entry$suspension;
90
+ (_entry$suspension = entry.suspension) === null || _entry$suspension === void 0 || _entry$suspension.suspend();
91
+ }
92
+ notify();
93
+ return true;
94
+ };
95
+
96
+ /**
97
+ * The top open modal root makes a closing one inert unless it contains it, also when it opened during the exit. One
98
+ * opened from content the closing one holds sits inside it and is skipped.
99
+ */
100
+ var isLeftActive = function isLeftActive(entry) {
101
+ var top = getOpenEntries().filter(function (open) {
102
+ return !isInside(open, entry.overlayRoot);
103
+ }).pop();
104
+ return !top || !!top.overlayRoot && !!entry.overlayRoot && top.overlayRoot.contains(entry.overlayRoot);
105
+ };
106
+
107
+ /**
108
+ * True when the host sits in the overlay root of a modal root that plays its exit transition and stays active. An
109
+ * open modal root beside it would leave the host inert, so the host moves into that one at once.
110
+ */
111
+ var isHeldByClosingModalRoot = exports.isHeldByClosingModalRoot = function isHeldByClosingModalRoot(host) {
112
+ return stack.some(function (entry) {
113
+ return entry.closing && !!entry.overlayRoot && entry.overlayRoot === host.parentElement && isLeftActive(entry);
114
+ });
115
+ };
116
+ var isTopModalRoot = exports.isTopModalRoot = function isTopModalRoot(id) {
117
+ var _getOpenEntries$pop;
118
+ return ((_getOpenEntries$pop = getOpenEntries().pop()) === null || _getOpenEntries$pop === void 0 ? void 0 : _getOpenEntries$pop.id) === id;
50
119
  };
51
120
 
52
121
  /**
@@ -55,16 +124,16 @@ var isInside = function isInside(entry, outside) {
55
124
  * itself.
56
125
  */
57
126
  var getTopModalOverlayRoot = exports.getTopModalOverlayRoot = function getTopModalOverlayRoot(outside) {
58
- var _stack$filter$pop$ove, _stack$filter$pop;
59
- return (_stack$filter$pop$ove = (_stack$filter$pop = stack.filter(function (entry) {
127
+ var _getOpenEntries$filte, _getOpenEntries$filte2;
128
+ return (_getOpenEntries$filte = (_getOpenEntries$filte2 = getOpenEntries().filter(function (entry) {
60
129
  return !isInside(entry, outside);
61
- }).pop()) === null || _stack$filter$pop === void 0 ? void 0 : _stack$filter$pop.overlayRoot) !== null && _stack$filter$pop$ove !== void 0 ? _stack$filter$pop$ove : null;
130
+ }).pop()) === null || _getOpenEntries$filte2 === void 0 ? void 0 : _getOpenEntries$filte2.overlayRoot) !== null && _getOpenEntries$filte !== void 0 ? _getOpenEntries$filte : null;
62
131
  };
63
132
 
64
133
  /** The id of the top open modal root, or undefined when none is open. */
65
134
  var getTopModalRootId = exports.getTopModalRootId = function getTopModalRootId() {
66
- var _stack2;
67
- return (_stack2 = stack[stack.length - 1]) === null || _stack2 === void 0 ? void 0 : _stack2.id;
135
+ var _getOpenEntries$pop2;
136
+ return (_getOpenEntries$pop2 = getOpenEntries().pop()) === null || _getOpenEntries$pop2 === void 0 ? void 0 : _getOpenEntries$pop2.id;
68
137
  };
69
138
 
70
139
  /**
@@ -73,18 +142,18 @@ var getTopModalRootId = exports.getTopModalRootId = function getTopModalRootId()
73
142
  * when another modal opened in between from outside the sheet.
74
143
  */
75
144
  var getModalOverlayRootUpTo = exports.getModalOverlayRootUpTo = function getModalOverlayRootUpTo(id, outside) {
76
- var _stack$filter$pop$ove2, _stack$filter$pop2;
77
- return (_stack$filter$pop$ove2 = (_stack$filter$pop2 = stack.filter(function (entry) {
145
+ var _getOpenEntries$filte3, _getOpenEntries$filte4;
146
+ return (_getOpenEntries$filte3 = (_getOpenEntries$filte4 = getOpenEntries().filter(function (entry) {
78
147
  return (entry.id <= id || entry.belowOpenSheets) && !isInside(entry, outside);
79
- }).pop()) === null || _stack$filter$pop2 === void 0 ? void 0 : _stack$filter$pop2.overlayRoot) !== null && _stack$filter$pop$ove2 !== void 0 ? _stack$filter$pop$ove2 : null;
148
+ }).pop()) === null || _getOpenEntries$filte4 === void 0 ? void 0 : _getOpenEntries$filte4.overlayRoot) !== null && _getOpenEntries$filte3 !== void 0 ? _getOpenEntries$filte3 : null;
80
149
  };
81
150
 
82
151
  /** The id of the top modal root that opened below open sheets, or undefined when none is open. */
83
152
  var getTopModalRootIdBelowOpenSheets = exports.getTopModalRootIdBelowOpenSheets = function getTopModalRootIdBelowOpenSheets() {
84
- var _stack$filter$pop3;
85
- return (_stack$filter$pop3 = stack.filter(function (entry) {
153
+ var _getOpenEntries$filte5;
154
+ return (_getOpenEntries$filte5 = getOpenEntries().filter(function (entry) {
86
155
  return entry.belowOpenSheets;
87
- }).pop()) === null || _stack$filter$pop3 === void 0 ? void 0 : _stack$filter$pop3.id;
156
+ }).pop()) === null || _getOpenEntries$filte5 === void 0 ? void 0 : _getOpenEntries$filte5.id;
88
157
  };
89
158
  var subscribeToModalRoots = exports.subscribeToModalRoots = function subscribeToModalRoots(listener) {
90
159
  listeners.add(listener);
@@ -108,9 +177,9 @@ var areModalRootsSuspended = exports.areModalRootsSuspended = function areModalR
108
177
  var suspendModalRoots = exports.suspendModalRoots = function suspendModalRoots() {
109
178
  suspensions += 1;
110
179
  if (suspensions === 1) {
111
- [...stack].reverse().forEach(function (entry) {
112
- var _entry$suspension;
113
- return (_entry$suspension = entry.suspension) === null || _entry$suspension === void 0 ? void 0 : _entry$suspension.suspend();
180
+ getOpenEntries().reverse().forEach(function (entry) {
181
+ var _entry$suspension2;
182
+ return (_entry$suspension2 = entry.suspension) === null || _entry$suspension2 === void 0 ? void 0 : _entry$suspension2.suspend();
114
183
  });
115
184
  }
116
185
  var released = false;
@@ -121,9 +190,9 @@ var suspendModalRoots = exports.suspendModalRoots = function suspendModalRoots()
121
190
  released = true;
122
191
  suspensions -= 1;
123
192
  if (suspensions === 0) {
124
- stack.forEach(function (entry) {
125
- var _entry$suspension2;
126
- return (_entry$suspension2 = entry.suspension) === null || _entry$suspension2 === void 0 ? void 0 : _entry$suspension2.resume();
193
+ getOpenEntries().forEach(function (entry) {
194
+ var _entry$suspension3;
195
+ return (_entry$suspension3 = entry.suspension) === null || _entry$suspension3 === void 0 ? void 0 : _entry$suspension3.resume();
127
196
  });
128
197
  }
129
198
  };
@@ -1 +1 @@
1
- {"version":3,"file":"modalRootStack.js","names":["listeners","Set","stack","lastId","suspensions","notify","forEach","listener","pushModalRoot","exports","overlayRoot","suspension","belowOpenSheets","arguments","length","undefined","id","suspend","popModalRoot","some","entry","filter","isTopModalRoot","_stack","isInside","outside","contains","getTopModalOverlayRoot","_stack$filter$pop$ove","_stack$filter$pop","pop","getTopModalRootId","_stack2","getModalOverlayRootUpTo","_stack$filter$pop$ove2","_stack$filter$pop2","getTopModalRootIdBelowOpenSheets","_stack$filter$pop3","subscribeToModalRoots","add","delete","areModalRootsSuspended","suspendModalRoots","reverse","_entry$suspension","released","_entry$suspension2","resume"],"sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"sourcesContent":["type Listener = () => void;\n\nexport interface ModalRootSuspension {\n suspend: () => void;\n resume: () => void;\n}\n\ninterface Entry {\n id: number;\n overlayRoot: HTMLElement | null;\n suspension?: ModalRootSuspension;\n belowOpenSheets: boolean;\n}\n\nconst listeners = new Set<Listener>();\n\nlet stack: Entry[] = [];\nlet lastId = 0;\nlet suspensions = 0;\n\nconst notify = (): void => listeners.forEach((listener) => listener());\n\nexport const pushModalRoot = (\n overlayRoot: HTMLElement | null,\n suspension?: ModalRootSuspension,\n belowOpenSheets = false\n): number => {\n lastId += 1;\n stack = [...stack, { id: lastId, overlayRoot, suspension, belowOpenSheets }];\n\n // A modal root that opens while the others are suspended joins them, or it would leave the overlay inert.\n if (suspensions > 0) {\n suspension?.suspend();\n }\n\n notify();\n\n return lastId;\n};\n\nexport const popModalRoot = (id: number): void => {\n if (!stack.some((entry) => entry.id === id)) {\n return;\n }\n\n stack = stack.filter((entry) => entry.id !== id);\n notify();\n};\n\nexport const isTopModalRoot = (id: number): boolean =>\n stack[stack.length - 1]?.id === id;\n\nconst isInside = (entry: Entry, outside?: Node) =>\n !!outside && !!entry.overlayRoot && outside.contains(entry.overlayRoot);\n\n/**\n * The overlay root of the top open modal root, where content that must stay above every modal goes. A modal root\n * whose overlay root sits inside outside, one opened from that content, is skipped, since content cannot move into\n * itself.\n */\nexport const getTopModalOverlayRoot = (outside?: Node): HTMLElement | null =>\n stack.filter((entry) => !isInside(entry, outside)).pop()?.overlayRoot ?? null;\n\n/** The id of the top open modal root, or undefined when none is open. */\nexport const getTopModalRootId = (): number | undefined =>\n stack[stack.length - 1]?.id;\n\n/**\n * The overlay root of the top modal root among those opened no later than the given one, or opened below open\n * sheets, skipping as above. A modal opened below open sheets counts whatever its id, so a sheet moves into it also\n * when another modal opened in between from outside the sheet.\n */\nexport const getModalOverlayRootUpTo = (\n id: number,\n outside?: Node\n): HTMLElement | null =>\n stack\n .filter(\n (entry) =>\n (entry.id <= id || entry.belowOpenSheets) && !isInside(entry, outside)\n )\n .pop()?.overlayRoot ?? null;\n\n/** The id of the top modal root that opened below open sheets, or undefined when none is open. */\nexport const getTopModalRootIdBelowOpenSheets = (): number | undefined =>\n stack.filter((entry) => entry.belowOpenSheets).pop()?.id;\n\nexport const subscribeToModalRoots = (listener: Listener): (() => void) => {\n listeners.add(listener);\n\n return (): void => {\n listeners.delete(listener);\n };\n};\n\n/** True while suspendModalRoots holds the open modal roots non-modal. */\nexport const areModalRootsSuspended = (): boolean => suspensions > 0;\n\n/**\n * Turns every open modal root into a non-modal dialog until the returned release is called, so an overlay that a\n * third party renders into document.body, such as the Google Drive picker, can be used above them. The dialogs keep\n * their place, look, content and order, and do not close. Calls nest: the modal roots come back, from the bottom up,\n * with the last release. A suspended dialog sits at layers.cloud - 1, so the overlay must be at layers.cloud or above;\n * the frontend raises the Google Drive picker there in its own CSS.\n */\nexport const suspendModalRoots = (): (() => void) => {\n suspensions += 1;\n\n if (suspensions === 1) {\n [...stack].reverse().forEach((entry) => entry.suspension?.suspend());\n }\n\n let released = false;\n\n return () => {\n if (released) {\n return;\n }\n\n released = true;\n suspensions -= 1;\n\n if (suspensions === 0) {\n stack.forEach((entry) => entry.suspension?.resume());\n }\n };\n};\n"],"mappings":";;;;;;AAcA,IAAMA,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;AAErC,IAAIC,KAAc,GAAG,EAAE;AACvB,IAAIC,MAAM,GAAG,CAAC;AACd,IAAIC,WAAW,GA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AkB3B,OAAO,CAAC,CAAC;IAAA,EAAC;EACtE;EAEA,IAAI4B,QAAQ,GAAG,KAAK;EAEpB,OAAO,YAAM;IACX,IAAIA,QAAQ,EAAE;MACZ;IACF;IAEAA,QAAQ,GAAG,IAAI;IACfzC,WAAW,IAAI,CAAC;IAEhB,IAAIA,WAAW,KAAK,CAAC,EAAE;MACrBF,KAAK,CAACI,OAAO,CAAC,UAACc,KAAK;QAAA,IAAA0B,kBAAA;QAAA,QAAAA,kBAAA,GAAK1B,KAAK,CAACT,UAAU,cAAAmC,kBAAA,uBAAhBA,kBAAA,CAAkBC,MAAM,CAAC,CAAC;MAAA,EAAC;IACtD;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modalRootStack.js","names":["listeners","Set","stack","lastId","suspensions","notify","forEach","listener","getOpenEntries","filter","entry","closing","isInside","outside","overlayRoot","contains","pushModalRoot","exports","suspension","belowOpenSheets","arguments","length","undefined","id","suspend","popModalRoot","some","releaseModalRoot","find","candidate","map","_objectSpread","reopenModalRoot","_entry$suspension","isLeftActive","top","open","pop","isHeldByClosingModalRoot","host","parentElement","isTopModalRoot","_getOpenEntries$pop","getTopModalOverlayRoot","_getOpenEntries$filte","_getOpenEntries$filte2","getTopModalRootId","_getOpenEntries$pop2","getModalOverlayRootUpTo","_getOpenEntries$filte3","_getOpenEntries$filte4","getTopModalRootIdBelowOpenSheets","_getOpenEntries$filte5","subscribeToModalRoots","add","delete","areModalRootsSuspended","suspendModalRoots","reverse","_entry$suspension2","released","_entry$suspension3","resume"],"sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"sourcesContent":["type Listener = () => void;\n\nexport interface ModalRootSuspension {\n suspend: () => void;\n resume: () => void;\n}\n\ninterface Entry {\n id: number;\n overlayRoot: HTMLElement | null;\n suspension?: ModalRootSuspension;\n belowOpenSheets: boolean;\n closing?: boolean;\n}\n\nconst listeners = new Set<Listener>();\n\nlet stack: Entry[] = [];\nlet lastId = 0;\nlet suspensions = 0;\n\nconst notify = (): void => listeners.forEach((listener) => listener());\n\nconst getOpenEntries = () => stack.filter((entry) => !entry.closing);\n\nconst isInside = (entry: Entry, outside?: Node | null) =>\n !!outside && !!entry.overlayRoot && outside.contains(entry.overlayRoot);\n\nexport const pushModalRoot = (\n overlayRoot: HTMLElement | null,\n suspension?: ModalRootSuspension,\n belowOpenSheets = false\n): number => {\n lastId += 1;\n stack = [...stack, { id: lastId, overlayRoot, suspension, belowOpenSheets }];\n\n // A modal root that opens while the others are suspended joins them, or it would leave the overlay inert.\n if (suspensions > 0) {\n suspension?.suspend();\n }\n\n notify();\n\n return lastId;\n};\n\nexport const popModalRoot = (id: number): void => {\n if (!stack.some((entry) => entry.id === id)) {\n return;\n }\n\n stack = stack.filter((entry) => entry.id !== id);\n notify();\n};\n\n/**\n * A modal root that plays its exit transition is no longer open: it leaves every query of the stack, and only keeps\n * the hosts already in its overlay root until popModalRoot.\n */\nexport const releaseModalRoot = (id: number): void => {\n const entry = stack.find((candidate) => candidate.id === id);\n\n if (!entry || entry.closing) {\n return;\n }\n\n stack = stack.map((candidate) =>\n candidate === entry ? { ...candidate, closing: true } : candidate\n );\n notify();\n};\n\n/** Reopened during its exit, a modal root keeps its id unless a newer one is in the stack; false then. */\nexport const reopenModalRoot = (id: number): boolean => {\n const entry = stack[stack.length - 1];\n\n if (entry?.id !== id) {\n return false;\n }\n\n stack = stack.map((candidate) =>\n candidate === entry ? { ...candidate, closing: false } : candidate\n );\n\n if (suspensions > 0) {\n entry.suspension?.suspend();\n }\n\n notify();\n\n return true;\n};\n\n/**\n * The top open modal root makes a closing one inert unless it contains it, also when it opened during the exit. One\n * opened from content the closing one holds sits inside it and is skipped.\n */\nconst isLeftActive = (entry: Entry): boolean => {\n const top = getOpenEntries()\n .filter((open) => !isInside(open, entry.overlayRoot))\n .pop();\n\n return (\n !top ||\n (!!top.overlayRoot &&\n !!entry.overlayRoot &&\n top.overlayRoot.contains(entry.overlayRoot))\n );\n};\n\n/**\n * True when the host sits in the overlay root of a modal root that plays its exit transition and stays active. An\n * open modal root beside it would leave the host inert, so the host moves into that one at once.\n */\nexport const isHeldByClosingModalRoot = (host: HTMLElement): boolean =>\n stack.some(\n (entry) =>\n entry.closing &&\n !!entry.overlayRoot &&\n entry.overlayRoot === host.parentElement &&\n isLeftActive(entry)\n );\n\nexport const isTopModalRoot = (id: number): boolean =>\n getOpenEntries().pop()?.id === id;\n\n/**\n * The overlay root of the top open modal root, where content that must stay above every modal goes. A modal root\n * whose overlay root sits inside outside, one opened from that content, is skipped, since content cannot move into\n * itself.\n */\nexport const getTopModalOverlayRoot = (outside?: Node): HTMLElement | null =>\n getOpenEntries()\n .filter((entry) => !isInside(entry, outside))\n .pop()?.overlayRoot ?? null;\n\n/** The id of the top open modal root, or undefined when none is open. */\nexport const getTopModalRootId = (): number | undefined =>\n getOpenEntries().pop()?.id;\n\n/**\n * The overlay root of the top modal root among those opened no later than the given one, or opened below open\n * sheets, skipping as above. A modal opened below open sheets counts whatever its id, so a sheet moves into it also\n * when another modal opened in between from outside the sheet.\n */\nexport const getModalOverlayRootUpTo = (\n id: number,\n outside?: Node\n): HTMLElement | null =>\n getOpenEntries()\n .filter(\n (entry) =>\n (entry.id <= id || entry.belowOpenSheets) && !isInside(entry, outside)\n )\n .pop()?.overlayRoot ?? null;\n\n/** The id of the top modal root that opened below open sheets, or undefined when none is open. */\nexport const getTopModalRootIdBelowOpenSheets = (): number | undefined =>\n getOpenEntries()\n .filter((entry) => entry.belowOpenSheets)\n .pop()?.id;\n\nexport const subscribeToModalRoots = (listener: Listener): (() => void) => {\n listeners.add(listener);\n\n return (): void => {\n listeners.delete(listener);\n };\n};\n\n/** True while suspendModalRoots holds the open modal roots non-modal. */\nexport const areModalRootsSuspended = (): boolean => suspensions > 0;\n\n/**\n * Turns every open modal root into a non-modal dialog until the returned release is called, so an overlay that a\n * third party renders into document.body, such as the Google Drive picker, can be used above them. The dialogs keep\n * their place, look, content and order, and do not close. Calls nest: the modal roots come back, from the bottom up,\n * with the last release. A suspended dialog sits at layers.cloud - 1, so the overlay must be at layers.cloud or above;\n * the frontend raises the Google Drive picker there in its own CSS.\n */\nexport const suspendModalRoots = (): (() => void) => {\n suspensions += 1;\n\n if (suspensions === 1) {\n getOpenEntries()\n .reverse()\n .forEach((entry) => entry.suspension?.suspend());\n }\n\n let released = false;\n\n return () => {\n if (released) {\n return;\n }\n\n released = true;\n suspensions -= 1;\n\n if (suspensions === 0) {\n getOpenEntries().forEach((entry) => entry.suspension?.resume());\n }\n };\n};\n"],"mappings":";;;;;;;;;;;AAeA,IAAMA,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;AAErC,IAAIC,KAAc,GAAG,EAAE;AACvB,IAAIC,MAAM,GAAG,CAAC;AACd,IAAIC,WAAW,GAAG,CAAC;AAEnB,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAeL,SAAS,CAACM,OAAO,CAAC,UAACC,QAAQ;IAAA,OAAKA,QAAQ,CAAC,CAAC;EAAA,EAAC;AAAA;AAEtE,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAA;EAAA,OAASN,KAAK,CAACO,MAAM,CAAC,UAACC,KAAK;IAAA,OAAK,CAACA,KAAK,CAACC,OAAO;EAAA,EAAC;AAAA;AAEpE,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAIF,KAAY,EAAEG,OAAqB;EAAA,OACnD,CAAC,CAACA,OAAO,IAAI,CAAC,CAACH,KAAK,CAACI,WAAW,IAAID,OAAO,CAACE,QAAQ,CAACL,KAAK,CAACI,WAAW,CAAC;AAAA;AAElE,IAAME,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAAhBA,aAAaA,CACxBF,WAA+B,EAC/BI,UAAgC,EAErB;EAAA,IADXC,eAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEvBjB,MAAM,IAAI,CAAC;EACXD,KAAK,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;EAEhB,IAAIA,WAAW,KAAK,CAAC,EAAE;IACrBI,cAAc,CAAC,CAAC,CACbkD,OAAO,CAAC,CAAC,CACTpD,OAAO,CAAC,UAACI,KAAK;MAAA,IAAAiD,kBAAA;MAAA,QAAAA,kBAAA,GAAKjD,KAAK,CAACQ,UAAU,cAAAyC,kBAAA,uBAAhBA,kBAAA,CAAkBnC,OAAO,CAAC,CAAC;IAAA,EAAC;EACpD;EAEA,IAAIoC,QAAQ,GAAG,KAAK;EAEpB,OAAO,YAAM;IACX,IAAIA,QAAQ,EAAE;MACZ;IACF;IAEAA,QAAQ,GAAG,IAAI;IACfxD,WAAW,IAAI,CAAC;IAEhB,IAAIA,WAAW,KAAK,CAAC,EAAE;MACrBI,cAAc,CAAC,CAAC,CAACF,OAAO,CAAC,UAACI,KAAK;QAAA,IAAAmD,kBAAA;QAAA,QAAAA,kBAAA,GAAKnD,KAAK,CAACQ,UAAU,cAAA2C,kBAAA,uBAAhBA,kBAAA,CAAkBC,MAAM,CAAC,CAAC;MAAA,EAAC;IACjE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useModalStackHost = void 0;
6
+ exports.useModalStackHost = exports.MODAL_STACK_HOST_ATTRIBUTE = void 0;
7
7
  var _react = require("react");
8
8
  var _modalRootStack = require("./modalRootStack");
9
9
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
@@ -12,6 +12,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
12
12
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
13
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
14
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
+ var MODAL_STACK_HOST_ATTRIBUTE = exports.MODAL_STACK_HOST_ATTRIBUTE = "data-modal-stack-host";
15
16
  var getScrollPositions = function getScrollPositions(host) {
16
17
  return Array.from(host.querySelectorAll("*")).filter(function (element) {
17
18
  return element.scrollTop || element.scrollLeft;
@@ -51,7 +52,8 @@ var moveHost = function moveHost(host, target) {
51
52
  /**
52
53
  * Keeps a host node in the overlay root of the top open modal, or of the top one opened no later than
53
54
  * upToModalRootId, and in document.body while there is none. A modal opened from the content of the host is not
54
- * counted, since its overlay root is inside the host. The node moves as modals open and close, so content
55
+ * counted, since its overlay root is inside the host. A modal that plays its exit transition keeps the node until
56
+ * it is done. The node moves as modals open and close, so content
55
57
  * portalled into it never remounts and keeps its scroll positions and focus, and it leaves the page on unmount or
56
58
  * when the host changes. Returns whether the
57
59
  * host is in the page, which it is from a layout effect after the first render with it.
@@ -67,11 +69,15 @@ var useModalStackHost = exports.useModalStackHost = function useModalStackHost(h
67
69
  }
68
70
  var place = function place() {
69
71
  var _ref2;
72
+ if ((0, _modalRootStack.isHeldByClosingModalRoot)(host)) {
73
+ return;
74
+ }
70
75
  var target = (_ref2 = upToModalRootId === undefined ? (0, _modalRootStack.getTopModalOverlayRoot)(host) : (0, _modalRootStack.getModalOverlayRootUpTo)(upToModalRootId, host)) !== null && _ref2 !== void 0 ? _ref2 : document.body;
71
76
  if (host.parentElement !== target) {
72
77
  moveHost(host, target);
73
78
  }
74
79
  };
80
+ host.setAttribute(MODAL_STACK_HOST_ATTRIBUTE, "");
75
81
  place();
76
82
  setPlacedHost(host);
77
83
  var unsubscribe = (0, _modalRootStack.subscribeToModalRoots)(place);
@@ -1 +1 @@
1
- {"version":3,"file":"useModalStackHost.js","names":["_react","require","_modalRootStack","_slicedToArray","r","e","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","return","isArray","getScrollPositions","host","querySelectorAll","filter","element","scrollTop","scrollLeft","map","top","left","moveHost","target","isConnected","moveBefore","scrollPositions","focused","contains","document","activeElement","appendChild","forEach","_ref","focus","preventScroll","useModalStackHost","exports","upToModalRootId","_useState","useState","_useState2","placedHost","setPlacedHost","useLayoutEffect","undefined","place","_ref2","getTopModalOverlayRoot","getModalOverlayRootUpTo","body","parentElement","unsubscribe","subscribeToModalRoots","remove"],"sources":["../../../../src/components/ModalRoot/useModalStackHost.ts"],"sourcesContent":["import { useLayoutEffect, useState } from \"react\";\n\nimport {\n getModalOverlayRootUpTo,\n getTopModalOverlayRoot,\n subscribeToModalRoots,\n} from \"./modalRootStack\";\n\ntype MovableParent = HTMLElement & {\n moveBefore?: (node: Node, child: Node | null) => void;\n};\n\nconst getScrollPositions = (host: HTMLElement) =>\n Array.from(host.querySelectorAll<HTMLElement>(\"*\"))\n .filter((element) => element.scrollTop || element.scrollLeft)\n .map((element) => ({\n element,\n top: element.scrollTop,\n left: element.scrollLeft,\n }));\n\n/**\n * moveBefore keeps the state of the moved content. appendChild resets the scroll positions inside the host and drops\n * the focus, so without moveBefore they are put back after the move.\n */\nconst moveHost = (host: HTMLElement, target: MovableParent) => {\n if (host.isConnected && target.moveBefore) {\n target.moveBefore(host, null);\n\n return;\n }\n\n const scrollPositions = host.isConnected ? getScrollPositions(host) : [];\n const focused = host.contains(document.activeElement)\n ? (document.activeElement as HTMLElement)\n : null;\n\n target.appendChild(host);\n\n scrollPositions.forEach(({ element, top, left }) => {\n element.scrollTop = top;\n element.scrollLeft = left;\n });\n focused?.focus({ preventScroll: true });\n};\n\n/**\n * Keeps a host node in the overlay root of the top open modal, or of the top one opened no later than\n * upToModalRootId, and in document.body while there is none. A modal opened from the content of the host is not\n * counted, since its overlay root is inside the host. The node moves as modals open and close, so content\n * portalled into it never remounts and keeps its scroll positions and focus, and it leaves the page on unmount or\n * when the host changes. Returns whether the\n * host is in the page, which it is from a layout effect after the first render with it.\n */\nexport const useModalStackHost = (\n host: HTMLElement | null,\n upToModalRootId?: number\n): boolean => {\n const [placedHost, setPlacedHost] = useState<HTMLElement | null>(null);\n\n useLayoutEffect(() => {\n if (!host) {\n return undefined;\n }\n\n const place = () => {\n const target =\n (upToModalRootId === undefined\n ? getTopModalOverlayRoot(host)\n : getModalOverlayRootUpTo(upToModalRootId, host)) ?? document.body;\n\n if (host.parentElement !== target) {\n moveHost(host, target);\n }\n };\n\n place();\n setPlacedHost(host);\n\n const unsubscribe = subscribeToModalRoots(place);\n\n return () => {\n unsubscribe();\n host.remove();\n };\n }, [host, upToModalRootId]);\n\n return host !== null && placedHost === host;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAI0B,SAAAE,eAAAC,CAAA,EAAAC,CAAA,WAAAC,eAAA,CAAAF,CAAA,KAAAG,qBAAA,CAAAH,CAAA,EAAAC,CAAA,KAAAG,2BAAA,CAAAJ,CAAA,EAAAC,CAAA,KAAAI,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAJ,CAAA,EAAAO,CAAA,QAAAP,CAAA,2BAAAA,CAAA,SAAAQ,iBAAA,CAAAR,CAAA,EAAAO,CAAA,OAAAE,CAAA,MAAAC,QAAA,CAAAC,IAAA,CAAAX,CAAA,EAAAY,KAAA,6BAAAH,CAAA,IAAAT,CAAA,CAAAa,WAAA,KAAAJ,CAAA,GAAAT,CAAA,CAAAa,WAAA,CAAAC,IAAA,aAAAL,CAAA,cAA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E3B,OAAOzB,IAAI,KAAK,IAAI,IAAI6B,UAAU,KAAK7B,IAAI;AAC7C,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useModalStackHost.js","names":["_react","require","_modalRootStack","_slicedToArray","r","e","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","return","isArray","MODAL_STACK_HOST_ATTRIBUTE","exports","getScrollPositions","host","querySelectorAll","filter","element","scrollTop","scrollLeft","map","top","left","moveHost","target","isConnected","moveBefore","scrollPositions","focused","contains","document","activeElement","appendChild","forEach","_ref","focus","preventScroll","useModalStackHost","upToModalRootId","_useState","useState","_useState2","placedHost","setPlacedHost","useLayoutEffect","undefined","place","_ref2","isHeldByClosingModalRoot","getTopModalOverlayRoot","getModalOverlayRootUpTo","body","parentElement","setAttribute","unsubscribe","subscribeToModalRoots","remove"],"sources":["../../../../src/components/ModalRoot/useModalStackHost.ts"],"sourcesContent":["import { useLayoutEffect, useState } from \"react\";\n\nimport {\n getModalOverlayRootUpTo,\n getTopModalOverlayRoot,\n isHeldByClosingModalRoot,\n subscribeToModalRoots,\n} from \"./modalRootStack\";\n\nexport const MODAL_STACK_HOST_ATTRIBUTE = \"data-modal-stack-host\";\n\ntype MovableParent = HTMLElement & {\n moveBefore?: (node: Node, child: Node | null) => void;\n};\n\nconst getScrollPositions = (host: HTMLElement) =>\n Array.from(host.querySelectorAll<HTMLElement>(\"*\"))\n .filter((element) => element.scrollTop || element.scrollLeft)\n .map((element) => ({\n element,\n top: element.scrollTop,\n left: element.scrollLeft,\n }));\n\n/**\n * moveBefore keeps the state of the moved content. appendChild resets the scroll positions inside the host and drops\n * the focus, so without moveBefore they are put back after the move.\n */\nconst moveHost = (host: HTMLElement, target: MovableParent) => {\n if (host.isConnected && target.moveBefore) {\n target.moveBefore(host, null);\n\n return;\n }\n\n const scrollPositions = host.isConnected ? getScrollPositions(host) : [];\n const focused = host.contains(document.activeElement)\n ? (document.activeElement as HTMLElement)\n : null;\n\n target.appendChild(host);\n\n scrollPositions.forEach(({ element, top, left }) => {\n element.scrollTop = top;\n element.scrollLeft = left;\n });\n focused?.focus({ preventScroll: true });\n};\n\n/**\n * Keeps a host node in the overlay root of the top open modal, or of the top one opened no later than\n * upToModalRootId, and in document.body while there is none. A modal opened from the content of the host is not\n * counted, since its overlay root is inside the host. A modal that plays its exit transition keeps the node until\n * it is done. The node moves as modals open and close, so content\n * portalled into it never remounts and keeps its scroll positions and focus, and it leaves the page on unmount or\n * when the host changes. Returns whether the\n * host is in the page, which it is from a layout effect after the first render with it.\n */\nexport const useModalStackHost = (\n host: HTMLElement | null,\n upToModalRootId?: number\n): boolean => {\n const [placedHost, setPlacedHost] = useState<HTMLElement | null>(null);\n\n useLayoutEffect(() => {\n if (!host) {\n return undefined;\n }\n\n const place = () => {\n if (isHeldByClosingModalRoot(host)) {\n return;\n }\n\n const target =\n (upToModalRootId === undefined\n ? getTopModalOverlayRoot(host)\n : getModalOverlayRootUpTo(upToModalRootId, host)) ?? document.body;\n\n if (host.parentElement !== target) {\n moveHost(host, target);\n }\n };\n\n host.setAttribute(MODAL_STACK_HOST_ATTRIBUTE, \"\");\n place();\n setPlacedHost(host);\n\n const unsubscribe = subscribeToModalRoots(place);\n\n return () => {\n unsubscribe();\n host.remove();\n };\n }, [host, upToModalRootId]);\n\n return host !== null && placedHost === host;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAK0B,SAAAE,eAAAC,CAAA,EAAAC,CAAA,WAAAC,eAAA,CAAAF,CAAA,KAAAG,qBAAA,CAAAH,CAAA,EAAAC,CAAA,KAAAG,2BAAA,CAAAJ,CAAA,EAAAC,CAAA,KAAAI,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAJ,CAAA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,IAAI;MAEtE,IAAIrC,IAAI,CAACsC,aAAa,KAAK5B,MAAM,EAAE;QACjCD,QAAQ,CAACT,IAAI,EAAEU,MAAM,CAAC;MACxB;IACF,CAAC;IAEDV,IAAI,CAACuC,YAAY,CAAC1C,0BAA0B,EAAE,EAAE,CAAC;IACjDmC,KAAK,CAAC,CAAC;IACPH,aAAa,CAAC7B,IAAI,CAAC;IAEnB,IAAMwC,WAAW,GAAG,IAAAC,qCAAqB,EAACT,KAAK,CAAC;IAEhD,OAAO,YAAM;MACXQ,WAAW,CAAC,CAAC;MACbxC,IAAI,CAAC0C,MAAM,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,CAAC1C,IAAI,EAAEwB,eAAe,CAAC,CAAC;EAE3B,OAAOxB,IAAI,KAAK,IAAI,IAAI4B,UAAU,KAAK5B,IAAI;AAC7C,CAAC","ignoreList":[]}
@@ -10,7 +10,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
10
10
  var StyledRadioInput = exports.StyledRadioInput = _styledComponents.default.input.withConfig({
11
11
  displayName: "Styles__StyledRadioInput",
12
12
  componentId: "sc-1xh9uc2-0"
13
- })(["display:none;"]);
13
+ })(["border:0px;clip:rect(0px,0px,0px,0px);cursor:pointer;height:1px;margin:-1px;opacity:0;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:1px;"]);
14
14
  StyledRadioInput.displayName = "StyledRadioInput";
15
15
  var StyledRadioLabel = exports.StyledRadioLabel = _styledComponents.default.label.withConfig({
16
16
  displayName: "Styles__StyledRadioLabel",
@@ -23,7 +23,7 @@ StyledRadioLabel.displayName = "StyledRadioLabel";
23
23
  var StyledRadioButton = exports.StyledRadioButton = _styledComponents.default.div.withConfig({
24
24
  displayName: "Styles__StyledRadioButton",
25
25
  componentId: "sc-1xh9uc2-2"
26
- })(["", " ", " height:16px;width:16px;position:relative;svg{cursor:pointer;fill:transparent;}circle:first-child{transition-duration:0.2s;stroke:var(--color-theme-500);}circle:last-child{transition-duration:0.2s;transform-origin:center;transform:scale(0);fill:var(--color-secondary-500);}input:focus ~ ", "{circle:first-child{stroke:var(--color-secondary);}}input:disabled ~ ", "{pointer-events:none;opacity:0.5;}", " ", " input:checked ~ ", "{circle:first-child{stroke:var(--color-secondary);}circle:last-child{transform:scale(1);fill:var(--color-secondary);}}"], _BoxSizingStyle.BoxSizingStyle, {
26
+ })(["", " ", " height:16px;width:16px;position:relative;svg{cursor:pointer;fill:transparent;}circle:first-child{transition-duration:0.2s;stroke:var(--color-theme-500);}circle:last-child{transition-duration:0.2s;transform-origin:center;transform:scale(0);fill:var(--color-secondary-500);}input:focus-visible ~ ", "{border-radius:50%;outline:2px solid var(--color-secondary);outline-offset:2px;circle:first-child{stroke:var(--color-secondary);}}input:disabled ~ ", "{pointer-events:none;opacity:0.5;}", " ", " input:checked ~ ", "{circle:first-child{stroke:var(--color-secondary);}circle:last-child{transform:scale(1);fill:var(--color-secondary);}}"], _BoxSizingStyle.BoxSizingStyle, {
27
27
  "display": "inline-flex",
28
28
  "alignItems": "center"
29
29
  }, StyledRadioLabel, StyledRadioLabel, function (props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledRadioInput","exports","styled","input","withConfig","displayName","componentId","StyledRadioLabel","label","StyledRadioButton","div","BoxSizingStyle","props","$isControlled","css","$isHovered"],"sources":["../../../../src/components/RadioButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\nexport const StyledRadioInput = styled.input`\n display: none;\n`;\n\nStyledRadioInput.displayName = \"StyledRadioInput\";\n\nexport const StyledRadioLabel = styled.label`\n ${tw`tw-inline-flex tw-items-center`}\n`;\n\nStyledRadioLabel.displayName = \"StyledRadioLabel\";\n\nexport interface IStyledRadioButton {\n $isHovered?: boolean;\n $isControlled?: boolean;\n}\n\nexport const StyledRadioButton = styled.div<IStyledRadioButton>`\n ${BoxSizingStyle}\n ${tw`tw-inline-flex tw-items-center`}\n\n height: 16px;\n width: 16px;\n position: relative;\n\n svg {\n cursor: pointer;\n fill: transparent;\n }\n\n circle:first-child {\n transition-duration: 0.2s;\n stroke: var(--color-theme-500);\n }\n\n circle:last-child {\n transition-duration: 0.2s;\n transform-origin: center;\n transform: scale(0);\n fill: var(--color-secondary-500);\n }\n\n input:focus ~ ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n }\n\n input:disabled ~ ${StyledRadioLabel} {\n pointer-events: none;\n opacity: 0.5;\n }\n\n ${(props) =>\n props.$isControlled !== true &&\n css`\n input:hover ~ ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n circle:last-child {\n transform: scale(1);\n }\n }\n `}\n\n ${(props) =>\n props.$isHovered &&\n css`\n ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n circle:last-child {\n transform: scale(1);\n }\n }\n `}\n\n input:checked ~ ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n circle:last-child {\n transform: scale(1);\n fill: var(--color-secondary);\n }\n }\n`;\n\nStyledRadioButton.displayName = \"StyledRadioButton\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AAAmD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,wBAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,K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AC,EAuBpBJ,gBAAgB,EAMbA,gBAAgB,EAKjC,UAACK,KAAK;EAAA,OACNA,KAAK,CAACC,aAAa,KAAK,IAAI,QAC5BC,qBAAG,oHACeP,gBAAgB,CAQjC;AAAA,GAED,UAACK,KAAK;EAAA,OACNA,KAAK,CAACG,UAAU,QAChBD,qBAAG,sGACCP,gBAAgB,CAQnB;AAAA,GAEeA,gBAAgB,CASnC;AAEDE,iBAAiB,CAACJ,WAAW,GAAG,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledRadioInput","exports","styled","input","withConfig","displayName","componentId","StyledRadioLabel","label","StyledRadioButton","div","BoxSizingStyle","props","$isControlled","css","$isHovered"],"sources":["../../../../src/components/RadioButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\nexport const StyledRadioInput = styled.input`\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n cursor: pointer;\n height: 1px;\n margin: -1px;\n opacity: 0;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n\nStyledRadioInput.displayName = \"StyledRadioInput\";\n\nexport const StyledRadioLabel = styled.label`\n ${tw`tw-inline-flex tw-items-center`}\n`;\n\nStyledRadioLabel.displayName = \"StyledRadioLabel\";\n\nexport interface IStyledRadioButton {\n $isHovered?: boolean;\n $isControlled?: boolean;\n}\n\nexport const StyledRadioButton = styled.div<IStyledRadioButton>`\n ${BoxSizingStyle}\n ${tw`tw-inline-flex tw-items-center`}\n\n height: 16px;\n width: 16px;\n position: relative;\n\n svg {\n cursor: pointer;\n fill: transparent;\n }\n\n circle:first-child {\n transition-duration: 0.2s;\n stroke: var(--color-theme-500);\n }\n\n circle:last-child {\n transition-duration: 0.2s;\n transform-origin: center;\n transform: scale(0);\n fill: var(--color-secondary-500);\n }\n\n input:focus-visible ~ ${StyledRadioLabel} {\n border-radius: 50%;\n outline: 2px solid var(--color-secondary);\n outline-offset: 2px;\n\n circle:first-child {\n stroke: var(--color-secondary);\n }\n }\n\n input:disabled ~ ${StyledRadioLabel} {\n pointer-events: none;\n opacity: 0.5;\n }\n\n ${(props) =>\n props.$isControlled !== true &&\n css`\n input:hover ~ ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n circle:last-child {\n transform: scale(1);\n }\n }\n `}\n\n ${(props) =>\n props.$isHovered &&\n css`\n ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n circle:last-child {\n transform: scale(1);\n }\n }\n `}\n\n input:checked ~ ${StyledRadioLabel} {\n circle:first-child {\n stroke: var(--color-secondary);\n }\n circle:last-child {\n transform: scale(1);\n fill: var(--color-secondary);\n }\n }\n`;\n\nStyledRadioButton.displayName = \"StyledRadioButton\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AAAmD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,wBAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,G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P,gBAAgB,CAQnB;AAAA,GAEeA,gBAAgB,CASnC;AAEDE,iBAAiB,CAACJ,WAAW,GAAG,mBAAmB","ignoreList":[]}
@@ -13,7 +13,7 @@ var OPTION_MARGIN = exports.OPTION_MARGIN = 4;
13
13
  var StyledOption = exports.StyledOption = _styledComponents.default.li.withConfig({
14
14
  displayName: "Styles__StyledOption",
15
15
  componentId: "sc-1232l97-0"
16
- })(["", " font-size:calc(14px * var(--text-scale,1));display:flex;justify-content:space-between;height:", "px;padding-left:16px;padding-right:16px;margin-top:", "px;margin-bottom:", "px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;transition-duration:0.1s;color:var(--color-theme-900);", " ", " ", ""], {
16
+ })(["", " font-size:calc(14px * var(--text-scale,1));display:flex;justify-content:space-between;height:", "px;padding-left:16px;padding-right:16px;margin-top:", "px;margin-bottom:", "px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;transition-duration:0.1s;color:var(--color-theme-900);", " ", " .c-radio-btn{pointer-events:none;}", ""], {
17
17
  "userSelect": "none",
18
18
  "fontWeight": "400"
19
19
  }, OPTION_HEIGHT, OPTION_MARGIN, OPTION_MARGIN, _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, function (props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OPTION_HEIGHT","exports","OPTION_MARGIN","StyledOption","styled","li","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","props","hover","css","StyledOptionContent","span"],"sources":["../../../../../src/components/Select/Option/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../../BoxSizingStyle\";\nimport { FontStyle } from \"../../FontStyle\";\n\nexport const OPTION_HEIGHT = 28;\nexport const OPTION_MARGIN = 4;\n\nexport const StyledOption = styled.li<{ hover?: boolean }>`\n ${tw`tw-select-none tw-font-normal`}\n font-size: calc(14px * var(--text-scale, 1));\n display: flex;\n justify-content: space-between;\n height: ${OPTION_HEIGHT}px;\n padding-left: 16px;\n padding-right: 16px;\n margin-top: ${OPTION_MARGIN}px;\n margin-bottom: ${OPTION_MARGIN}px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n transition-duration: 0.1s;\n color: var(--color-theme-900);\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${(props) =>\n props.hover &&\n css`\n background-color: var(--color-theme-200);\n `}\n`;\n\nStyledOption.displayName = \"StyledOption\";\n\nexport const StyledOptionContent = styled.span`\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: space-between;\n`;\n\nStyledOptionContent.displayName = \"StyledOptionContent\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAA4C,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,IAAAC,CAAA,CAAAM,EAAA,IAAAd,CAAA,CAAAc,EAAA,WAAAN,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAErC,IAAMmB,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,EAAE;AACxB,IAAME,aAAa,GAAAD,OAAA,CAAAC,aAAA,GAAG,CAAC;AAEvB,IAAMC,YAAY,GAAAF,OAAA,CAAAE,YAAA,GAAGC,yBAAM,CAACC,EAAE,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+UAC/B;EAAA;EAAA;AAA8B,CAAC,EAIzBR,aAAa,EAGTE,aAAa,EACVA,aAAa,EAQ5BO,oBAAS,EACTC,8BAAc,EAEd,UAACC,KAAK;EAAA,OACNA,KAAK,CAACC,KAAK,QACXC,qBAAG,+CAEF;AAAA,EACJ;AAEDV,YAAY,CAACI,WAAW,GAAG,cAAc;AAElC,IAAMO,mBAAmB,GAAAb,OAAA,CAAAa,mBAAA,GAAGV,yBAAM,CAACW,IAAI,CAAAT,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,iFAK7C;AAEDM,mBAAmB,CAACP,WAAW,GAAG,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OPTION_HEIGHT","exports","OPTION_MARGIN","StyledOption","styled","li","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","props","hover","css","StyledOptionContent","span"],"sources":["../../../../../src/components/Select/Option/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../../BoxSizingStyle\";\nimport { FontStyle } from \"../../FontStyle\";\n\nexport const OPTION_HEIGHT = 28;\nexport const OPTION_MARGIN = 4;\n\nexport const StyledOption = styled.li<{ hover?: boolean }>`\n ${tw`tw-select-none tw-font-normal`}\n font-size: calc(14px * var(--text-scale, 1));\n display: flex;\n justify-content: space-between;\n height: ${OPTION_HEIGHT}px;\n padding-left: 16px;\n padding-right: 16px;\n margin-top: ${OPTION_MARGIN}px;\n margin-bottom: ${OPTION_MARGIN}px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n transition-duration: 0.1s;\n color: var(--color-theme-900);\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n // The option takes the click: a click on the label of its radio would move the focus off the search input.\n .c-radio-btn {\n pointer-events: none;\n }\n\n ${(props) =>\n props.hover &&\n css`\n background-color: var(--color-theme-200);\n `}\n`;\n\nStyledOption.displayName = \"StyledOption\";\n\nexport const StyledOptionContent = styled.span`\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: space-between;\n`;\n\nStyledOptionContent.displayName = \"StyledOptionContent\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAA4C,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC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,WAAA;EAAAC,WAAA;AAAA,iFAK7C;AAEDM,mBAAmB,CAACP,WAAW,GAAG,qBAAqB","ignoreList":[]}
@@ -20,9 +20,14 @@ var getLayerOf = exports.getLayerOf = function getLayerOf(element) {
20
20
  return (_element$closest = element === null || element === void 0 || (_element$closest2 = element.closest) === null || _element$closest2 === void 0 ? void 0 : _element$closest2.call(element, LAYER_SELECTOR)) !== null && _element$closest !== void 0 ? _element$closest : null;
21
21
  };
22
22
 
23
- /** The layer in front: the last open window or dialog, or null when the page itself is in front. */
23
+ /**
24
+ * The layer in front: the last open window or dialog that takes input, or null when the page itself is in front. A
25
+ * window in a dialog that plays its exit transition is inert and does not count.
26
+ */
24
27
  var getTopLayer = exports.getTopLayer = function getTopLayer() {
25
- var windows = document.querySelectorAll(LAYER_SELECTOR);
28
+ var windows = Array.from(document.querySelectorAll(LAYER_SELECTOR)).filter(function (layer) {
29
+ return !layer.closest("[inert]");
30
+ });
26
31
  return windows.length ? windows[windows.length - 1] : null;
27
32
  };
28
33
 
@@ -31,6 +36,6 @@ var getTopLayer = exports.getTopLayer = function getTopLayer() {
31
36
  * goes to the layer the user works in and never to a page or a window under it.
32
37
  */
33
38
  var isInTopLayer = exports.isInTopLayer = function isInTopLayer(element) {
34
- return element ? getLayerOf(element) === getTopLayer() : false;
39
+ return element && !element.closest("[inert]") ? getLayerOf(element) === getTopLayer() : false;
35
40
  };
36
41
  //# sourceMappingURL=layers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layers.js","names":["layers","exports","cloud","skyscraper","tower","house","LAYER_SELECTOR","getLayerOf","element","_element$closest","_element$closest2","closest","call","getTopLayer","windows","document","querySelectorAll","length","isInTopLayer"],"sources":["../../../src/utils/layers.ts"],"sourcesContent":["export const layers = {\n cloud: 100000,\n skyscraper: 1300,\n tower: 1200,\n house: 1000,\n};\n\n// A DS window, or a native modal dialog. A window opened inside a dialog comes after it in the document.\nconst LAYER_SELECTOR = \".c-window, dialog[open]\";\n\n/** The layer an element sits in, or null when it sits on the page. */\nexport const getLayerOf = (element: Element | null | undefined) =>\n element?.closest?.(LAYER_SELECTOR) ?? null;\n\n/** The layer in front: the last open window or dialog, or null when the page itself is in front. */\nexport const getTopLayer = (): HTMLElement | null => {\n const windows = document.querySelectorAll<HTMLElement>(LAYER_SELECTOR);\n\n return windows.length ? windows[windows.length - 1] : null;\n};\n\n/**\n * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut\n * goes to the layer the user works in and never to a page or a window under it.\n */\nexport const isInTopLayer = (element: Element | null | undefined) =>\n element ? getLayerOf(element) === getTopLayer() : false;\n"],"mappings":";;;;;;AAAO,IAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,KAAK,EAAE;AACT,CAAC;;AAED;AACA,IAAMC,cAAc,GAAG,yBAAyB;;AAEhD;AACO,IAAMC,UAAU,GAAAN,OAAA,CAAAM,UAAA,GAAG,SAAbA,UAAUA,CAAIC,OAAmC;EAAA,IAAAC,gBAAA,EAAAC,iBAAA;EAAA,QAAAD,gBAAA,GAC5DD,OAAO,aAAPA,OAAO,gBAAAE,iBAAA,GAAPF,OAAO,CAAEG,OAAO,cAAAD,iBAAA,uBAAhBA,iBAAA,CAAAE,IAAA,CAAAJ,OAAO,EAAYF,cAAc,CAAC,cAAAG,gBAAA,cAAAA,gBAAA,GAAI,IAAI;AAAA;;AAE5C;AACO,IAAMI,WAAW,GAAAZ,OAAA,CAAAY,WAAA,GAAG,SAAdA,WAAWA,CAAA,EAA6B;EACnD,IAAMC,OAAO,GAAGC,QAAQ,CAACC,gBAAgB,CAAcV,cAAc,CAAC;EAEtE,OAAOQ,OAAO,CAACG,MAAM,GAAGH,OAAO,CAACA,OAAO,CAACG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI;AAC5D,CAAC;;AAED;AACA;AACA;AACA;AACO,IAAMC,YAAY,GAAAjB,OAAA,CAAAiB,YAAA,GAAG,SAAfA,YAAYA,CAAIV,OAAmC;EAAA,OAC9DA,OAAO,GAAGD,UAAU,CAACC,OAAO,CAAC,KAAKK,WAAW,CAAC,CAAC,GAAG,KAAK;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"layers.js","names":["layers","exports","cloud","skyscraper","tower","house","LAYER_SELECTOR","getLayerOf","element","_element$closest","_element$closest2","closest","call","getTopLayer","windows","Array","from","document","querySelectorAll","filter","layer","length","isInTopLayer"],"sources":["../../../src/utils/layers.ts"],"sourcesContent":["export const layers = {\n cloud: 100000,\n skyscraper: 1300,\n tower: 1200,\n house: 1000,\n};\n\n// A DS window, or a native modal dialog. A window opened inside a dialog comes after it in the document.\nconst LAYER_SELECTOR = \".c-window, dialog[open]\";\n\n/** The layer an element sits in, or null when it sits on the page. */\nexport const getLayerOf = (element: Element | null | undefined) =>\n element?.closest?.(LAYER_SELECTOR) ?? null;\n\n/**\n * The layer in front: the last open window or dialog that takes input, or null when the page itself is in front. A\n * window in a dialog that plays its exit transition is inert and does not count.\n */\nexport const getTopLayer = (): HTMLElement | null => {\n const windows = Array.from(\n document.querySelectorAll<HTMLElement>(LAYER_SELECTOR)\n ).filter((layer) => !layer.closest(\"[inert]\"));\n\n return windows.length ? windows[windows.length - 1] : null;\n};\n\n/**\n * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut\n * goes to the layer the user works in and never to a page or a window under it.\n */\nexport const isInTopLayer = (element: Element | null | undefined) =>\n element && !element.closest(\"[inert]\")\n ? getLayerOf(element) === getTopLayer()\n : false;\n"],"mappings":";;;;;;AAAO,IAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,KAAK,EAAE;AACT,CAAC;;AAED;AACA,IAAMC,cAAc,GAAG,yBAAyB;;AAEhD;AACO,IAAMC,UAAU,GAAAN,OAAA,CAAAM,UAAA,GAAG,SAAbA,UAAUA,CAAIC,OAAmC;EAAA,IAAAC,gBAAA,EAAAC,iBAAA;EAAA,QAAAD,gBAAA,GAC5DD,OAAO,aAAPA,OAAO,gBAAAE,iBAAA,GAAPF,OAAO,CAAEG,OAAO,cAAAD,iBAAA,uBAAhBA,iBAAA,CAAAE,IAAA,CAAAJ,OAAO,EAAYF,cAAc,CAAC,cAAAG,gBAAA,cAAAA,gBAAA,GAAI,IAAI;AAAA;;AAE5C;AACA;AACA;AACA;AACO,IAAMI,WAAW,GAAAZ,OAAA,CAAAY,WAAA,GAAG,SAAdA,WAAWA,CAAA,EAA6B;EACnD,IAAMC,OAAO,GAAGC,KAAK,CAACC,IAAI,CACxBC,QAAQ,CAACC,gBAAgB,CAAcZ,cAAc,CACvD,CAAC,CAACa,MAAM,CAAC,UAACC,KAAK;IAAA,OAAK,CAACA,KAAK,CAACT,OAAO,CAAC,SAAS,CAAC;EAAA,EAAC;EAE9C,OAAOG,OAAO,CAACO,MAAM,GAAGP,OAAO,CAACA,OAAO,CAACO,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI;AAC5D,CAAC;;AAED;AACA;AACA;AACA;AACO,IAAMC,YAAY,GAAArB,OAAA,CAAAqB,YAAA,GAAG,SAAfA,YAAYA,CAAId,OAAmC;EAAA,OAC9DA,OAAO,IAAI,CAACA,OAAO,CAACG,OAAO,CAAC,SAAS,CAAC,GAClCJ,UAAU,CAACC,OAAO,CAAC,KAAKK,WAAW,CAAC,CAAC,GACrC,KAAK;AAAA","ignoreList":[]}
@@ -57,6 +57,21 @@ describe("layers", function () {
57
57
  expect((0, _layers.getTopLayer)()).toBeNull();
58
58
  expect((0, _layers.isInTopLayer)(onPage)).toBe(true);
59
59
  });
60
+ it("does not count an inert window, as a menu in a dialog that plays its exit transition, nor anything in it", function () {
61
+ var onPage = document.body.appendChild(document.createElement("input"));
62
+ var under = addWindow();
63
+ var popups = document.body.appendChild(document.createElement("div"));
64
+ popups.setAttribute("inert", "");
65
+ var menu = popups.appendChild(document.createElement("div"));
66
+ menu.className = "c-window";
67
+ var inMenu = menu.appendChild(document.createElement("input"));
68
+ expect((0, _layers.getTopLayer)()).toBe(under);
69
+ expect((0, _layers.isInTopLayer)(inMenu)).toBe(false);
70
+ under.remove();
71
+ expect((0, _layers.getTopLayer)()).toBeNull();
72
+ expect((0, _layers.isInTopLayer)(onPage)).toBe(true);
73
+ expect((0, _layers.isInTopLayer)(popups)).toBe(false);
74
+ });
60
75
  it("is false for no element", function () {
61
76
  expect((0, _layers.isInTopLayer)(null)).toBe(false);
62
77
  });
@@ -1 +1 @@
1
- {"version":3,"file":"layers.test.js","names":["_layers","require","addWindow","node","document","createElement","className","body","appendChild","describe","afterEach","innerHTML","it","onPage","expect","getTopLayer","toBeNull","isInTopLayer","toBe","under","inUnder","front","inFront","dialog","setAttribute","inDialog","menu","inMenu"],"sources":["../../../src/utils/layers.test.ts"],"sourcesContent":["import { getTopLayer, isInTopLayer } from \"./layers\";\n\nconst addWindow = () => {\n const node = document.createElement(\"div\");\n node.className = \"c-window\";\n document.body.appendChild(node);\n\n return node;\n};\n\ndescribe(\"layers\", () => {\n afterEach(() => {\n document.body.innerHTML = \"\";\n });\n\n it(\"has the page in front when no window is open\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"has the last open window in front, and not the page or a window under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const front = addWindow();\n const inFront = front.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(front);\n expect(isInTopLayer(inFront)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"has an open native dialog in front of the page and of the windows under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const dialog = document.body.appendChild(document.createElement(\"dialog\"));\n dialog.setAttribute(\"open\", \"\");\n const inDialog = dialog.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(dialog);\n expect(isInTopLayer(inDialog)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"has a window opened inside a native dialog in front of the dialog\", () => {\n const dialog = document.body.appendChild(document.createElement(\"dialog\"));\n dialog.setAttribute(\"open\", \"\");\n const inDialog = dialog.appendChild(document.createElement(\"input\"));\n const menu = document.createElement(\"div\");\n menu.className = \"c-window\";\n dialog.appendChild(menu);\n const inMenu = menu.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(menu);\n expect(isInTopLayer(inMenu)).toBe(true);\n expect(isInTopLayer(inDialog)).toBe(false);\n });\n\n it(\"does not count a closed dialog as a layer\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n document.body.appendChild(document.createElement(\"dialog\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"is false for no element\", () => {\n expect(isInTopLayer(null)).toBe(false);\n });\n});\n"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;EACtB,IAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAC1CF,IAAI,CAACG,SAAS,GAAG,UAAU;EAC3BF,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACL,IAAI,CAAC;EAE/B,OAAOA,IAAI;AACb,CAAC;AAEDM,QAAQ,CAAC,QAAQ,EAAE,YAAM;EACvBC,SAAS,CAAC,YAAM;IACdN,QAAQ,CAACG,IAAI,CAACI,SAAS,GAAG,EAAE;EAC9B,CAAC,CAAC;EAEFC,EAAE,CAAC,8CAA8C,EAAE,YAAM;I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ACkB,IAAI,CAAC;IACxB,IAAMC,MAAM,GAAGD,IAAI,CAAClB,WAAW,CAACJ,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC,CAAC;IAEhES,MAAM,CAAC,IAAAC,mBAAW,EAAC,CAAC,CAAC,CAACG,IAAI,CAACQ,IAAI,CAAC;IAChCZ,MAAM,CAAC,IAAAG,oBAAY,EAACU,MAAM,CAAC,CAAC,CAACT,IAAI,CAAC,IAAI,CAAC;IACvCJ,MAAM,CAAC,IAAAG,oBAAY,EAACQ,QAAQ,CAAC,CAAC,CAACP,IAAI,CAAC,KAAK,CAAC;EAC5C,CAAC,CAAC;EAEFN,EAAE,CAAC,2CAA2C,EAAE,YAAM;IACpD,IAAMC,MAAM,GAAGT,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACJ,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC,CAAC;IACzED,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACJ,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAE3DS,MAAM,CAAC,IAAAC,mBAAW,EAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IAChCF,MAAM,CAAC,IAAAG,oBAAY,EAACJ,MAAM,CAAC,CAAC,CAACK,IAAI,CAAC,IAAI,CAAC;EACzC,CAAC,CAAC;EAEFN,EAAE,CAAC,yBAAyB,EAAE,YAAM;IAClCE,MAAM,CAAC,IAAAG,oBAAY,EAAC,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACxC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"layers.test.js","names":["_layers","require","addWindow","node","document","createElement","className","body","appendChild","describe","afterEach","innerHTML","it","onPage","expect","getTopLayer","toBeNull","isInTopLayer","toBe","under","inUnder","front","inFront","dialog","setAttribute","inDialog","menu","inMenu","popups","remove"],"sources":["../../../src/utils/layers.test.ts"],"sourcesContent":["import { getTopLayer, isInTopLayer } from \"./layers\";\n\nconst addWindow = () => {\n const node = document.createElement(\"div\");\n node.className = \"c-window\";\n document.body.appendChild(node);\n\n return node;\n};\n\ndescribe(\"layers\", () => {\n afterEach(() => {\n document.body.innerHTML = \"\";\n });\n\n it(\"has the page in front when no window is open\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"has the last open window in front, and not the page or a window under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const front = addWindow();\n const inFront = front.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(front);\n expect(isInTopLayer(inFront)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"has an open native dialog in front of the page and of the windows under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const dialog = document.body.appendChild(document.createElement(\"dialog\"));\n dialog.setAttribute(\"open\", \"\");\n const inDialog = dialog.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(dialog);\n expect(isInTopLayer(inDialog)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"has a window opened inside a native dialog in front of the dialog\", () => {\n const dialog = document.body.appendChild(document.createElement(\"dialog\"));\n dialog.setAttribute(\"open\", \"\");\n const inDialog = dialog.appendChild(document.createElement(\"input\"));\n const menu = document.createElement(\"div\");\n menu.className = \"c-window\";\n dialog.appendChild(menu);\n const inMenu = menu.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(menu);\n expect(isInTopLayer(inMenu)).toBe(true);\n expect(isInTopLayer(inDialog)).toBe(false);\n });\n\n it(\"does not count a closed dialog as a layer\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n document.body.appendChild(document.createElement(\"dialog\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"does not count an inert window, as a menu in a dialog that plays its exit transition, nor anything in it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const popups = document.body.appendChild(document.createElement(\"div\"));\n popups.setAttribute(\"inert\", \"\");\n const menu = popups.appendChild(document.createElement(\"div\"));\n menu.className = \"c-window\";\n const inMenu = menu.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(under);\n expect(isInTopLayer(inMenu)).toBe(false);\n\n under.remove();\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n expect(isInTopLayer(popups)).toBe(false);\n });\n\n it(\"is false for no element\", () => {\n expect(isInTopLayer(null)).toBe(false);\n });\n});\n"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;EACtB,IAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAC1CF,IAAI,CAACG,SAAS,GAAG,UAAU;EAC3BF,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACL,IAAI,CAAC;EAE/B,OAAOA,IAAI;AACb,CAAC;AAEDM,QAAQ,CAAC,QAAQ,EAAE,YAAM;EACvBC,SAAS,CAAC,YAAM;IACdN,QAAQ,CAACG,IAAI,CAACI,SAAS,GAAG,EAAE;EAC9B,CAAC,CAAC;EAEFC,EAAE,CAAC,8CAA8C,EAAE,YAAM;IACvD,IAAMC,MAAM,GAAGT,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACJ,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC,CAAC;IAEzES,MAAM,CAAC,IAAAC,mBAAW,EAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IAChCF,MAAM,CAAC,IAAAG,oBAAY,EAACJ,M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C,CAAC,CAACG,IAAI,CAACC,KAAK,CAAC;IACjCL,MAAM,CAAC,IAAAG,oBAAY,EAACU,MAAM,CAAC,CAAC,CAACT,IAAI,CAAC,KAAK,CAAC;IAExCC,KAAK,CAACU,MAAM,CAAC,CAAC;IAEdf,MAAM,CAAC,IAAAC,mBAAW,EAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;IAChCF,MAAM,CAAC,IAAAG,oBAAY,EAACJ,MAAM,CAAC,CAAC,CAACK,IAAI,CAAC,IAAI,CAAC;IACvCJ,MAAM,CAAC,IAAAG,oBAAY,EAACW,MAAM,CAAC,CAAC,CAACV,IAAI,CAAC,KAAK,CAAC;EAC1C,CAAC,CAAC;EAEFN,EAAE,CAAC,yBAAyB,EAAE,YAAM;IAClCE,MAAM,CAAC,IAAAG,oBAAY,EAAC,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACxC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,KAAK,EAAE,EAMP,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAE,KAAK,gBAAgB,EAAU,MAAM,kBAAkB,CAAC;AAMjE,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,uBAAuB,CAAC;AAO5E,uGAAuG;AACvG,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,CAAC;AAE1B,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,kBAAkB,GAAG,SAAS,GACnC,IAAI,IAAI,qBAA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M,KAAK,IAAI,CAAC;IACjD,8BAA8B;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yCAAyC;IACzC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,uCAAuC;IACvC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,+DAA+D;IAC/D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACvE,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAgDD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,kBAAkB,CAsyB/C,CAAC"}
@@ -493,7 +493,9 @@ export const Autocomplete = _ref => {
493
493
  id: "option_" + item.id,
494
494
  checked: selectedOptions && selectedOptions.includes(item.id),
495
495
  hover: hover.item === item.id,
496
- onChange: () => null
496
+ onChange: () => null,
497
+ tabIndex: -1,
498
+ "aria-hidden": true
497
499
  })
498
500
  });
499
501
  }, [handleClick, handleMouseEnter, hover.item, optionClassName, renderOption, filter, selectedOptions, handleHoverCallback, type, handleChange, mixedOptions]);
@@ -573,7 +575,9 @@ export const Autocomplete = _ref => {
573
575
  }, {
574
576
  checked: isDefaultOptionSelected(),
575
577
  hover: hover.item === null,
576
- onChange: () => null
578
+ onChange: () => null,
579
+ tabIndex: -1,
580
+ "aria-hidden": true
577
581
  })
578
582
  });
579
583
  case "group":
@@ -613,7 +617,9 @@ export const Autocomplete = _ref => {
613
617
  id: "option_" + virtualItem.id,
614
618
  checked: selectedOptions && selectedOptions.includes(virtualItem.id),
615
619
  hover: hover.item === virtualItem.id,
616
- onChange: () => null
620
+ onChange: () => null,
621
+ tabIndex: -1,
622
+ "aria-hidden": true
617
623
  })
618
624
  });
619
625
  case "separator":