@apple-pie/slice 0.1.26 → 0.1.28

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 (143) hide show
  1. package/dist/cjs/chunks/{AudioBubble-Bqb2Jexf.js → AudioBubble-DisHuKIC.js} +1 -1
  2. package/dist/cjs/chunks/{Button-D3wZtdtj.js → Button-Dic9Rfkr.js} +10 -8
  3. package/dist/cjs/chunks/{ButtonBar-EH8fHFhS.js → ButtonBar-C7tJ6pDM.js} +1 -1
  4. package/dist/cjs/chunks/{Camera-BnsGhOrt.js → Camera-DfnOBHeI.js} +1 -1
  5. package/dist/cjs/chunks/{CheckBox-CEWLxffo.js → CheckBox-Cxzt7DJo.js} +1 -1
  6. package/dist/cjs/chunks/{Chip-BrQgOmJc.js → Chip-DKbhpeho.js} +1 -1
  7. package/dist/cjs/chunks/{DrggablePanel-Duv0nmOm.js → DrggablePanel-DuOxkekq.js} +14 -11
  8. package/dist/cjs/chunks/{DropDown-Bf_pm-Go.js → DropDown-BcRH7Fle.js} +10 -8
  9. package/dist/cjs/chunks/{FileList-DobAcOSH.js → FileList-S0Hf82-C.js} +1 -1
  10. package/dist/cjs/chunks/{FlexDiv-C-3ahI-j.js → FlexDiv-BPnptnPL.js} +60 -20
  11. package/dist/cjs/chunks/{Grouper-D9G8PKoM.js → Grouper-CgkPu4sa.js} +1 -1
  12. package/dist/cjs/chunks/{Icon-fRM3E0N6.js → Icon-UFrKtcYJ.js} +184 -11
  13. package/dist/cjs/chunks/{IconButton-Cf2RBUKA.js → IconButton-CaQ0SioJ.js} +14 -11
  14. package/dist/cjs/chunks/{ProgressIndicator-t-jv4OhI.js → ProgressIndicator-n9CfW6jd.js} +1 -1
  15. package/dist/cjs/chunks/{PromptInput-B1WG22xz.js → PromptInput-CI0iSYKL.js} +1 -1
  16. package/dist/cjs/chunks/{RadioButton-BAIMCshV.js → RadioButton-JBNaNihZ.js} +1 -1
  17. package/dist/cjs/chunks/{RadioButtonList-Bsg5oFaC.js → RadioButtonList-CW2pDNIq.js} +1 -1
  18. package/dist/cjs/chunks/{TabBar-BfyfjmPQ.js → TabBar-Bpngr90Q.js} +1 -1
  19. package/dist/cjs/chunks/{TextArea-CHNWsfWH.js → TextArea-BZgwajEC.js} +1 -1
  20. package/dist/cjs/chunks/{TextField-2xzSdIx3.js → TextField-x1MWESCA.js} +5 -5
  21. package/dist/cjs/chunks/{Tip-DceuNR6k.js → Tip-BZQhRyng.js} +1 -1
  22. package/dist/cjs/chunks/{Toast-C8Hc9ZKI.js → Toast-cda-RInJ.js} +1 -1
  23. package/dist/cjs/chunks/ToggleButton-CuX1nQk4.js +40 -0
  24. package/dist/cjs/chunks/{UploadArea-UFWRQ-nW.js → UploadArea-CiiKnWe7.js} +1 -1
  25. package/dist/cjs/chunks/{_types-VoADvwjb.js → _types-Cqkxw-yc.js} +10 -2
  26. package/dist/cjs/chunks/microphoneStore-CgFohRfy.js +124 -0
  27. package/dist/cjs/components/AudioBubble/index.js +7 -7
  28. package/dist/cjs/components/Button/index.js +7 -6
  29. package/dist/cjs/components/ButtonBar/index.js +7 -7
  30. package/dist/cjs/components/Camera/index.js +8 -8
  31. package/dist/cjs/components/CheckBox/index.js +7 -7
  32. package/dist/cjs/components/Chip/index.js +8 -7
  33. package/dist/cjs/components/DraggablePanel/index.js +6 -6
  34. package/dist/cjs/components/DropDown/index.js +7 -7
  35. package/dist/cjs/components/ErrorSummary/index.js +2 -2
  36. package/dist/cjs/components/FileIcon/index.js +6 -5
  37. package/dist/cjs/components/FileList/index.js +6 -6
  38. package/dist/cjs/components/FlexDiv/index.js +1 -1
  39. package/dist/cjs/components/Grouper/index.js +4 -4
  40. package/dist/cjs/components/Icon/index.js +7 -6
  41. package/dist/cjs/components/IconButton/index.js +7 -6
  42. package/dist/cjs/components/Progress/index.js +4 -4
  43. package/dist/cjs/components/PromptInput/index.js +7 -7
  44. package/dist/cjs/components/RadioButton/index.js +7 -7
  45. package/dist/cjs/components/RadioButtonList/index.js +4 -4
  46. package/dist/cjs/components/TabBar/index.js +9 -9
  47. package/dist/cjs/components/TextArea/index.js +7 -7
  48. package/dist/cjs/components/Textfield/index.js +6 -6
  49. package/dist/cjs/components/Tip/index.js +1 -1
  50. package/dist/cjs/components/Toast/index.js +4 -4
  51. package/dist/cjs/components/ToggleButton/index.js +13 -0
  52. package/dist/cjs/components/UploadArea/index.js +9 -9
  53. package/dist/cjs/hooks/useMicrophone.js +19 -13
  54. package/dist/cjs/hooks/useTheme.js +25 -16
  55. package/dist/cjs/hooks/useToolTip.js +9 -6
  56. package/dist/cjs/hooks.js +4 -4
  57. package/dist/cjs/index.js +5 -5
  58. package/dist/cjs/providers/ThemeProvider.js +36 -19
  59. package/dist/cjs/stores/microphone.js +12 -0
  60. package/dist/cjs/stores.js +9 -2
  61. package/dist/cjs/theme/colors.js +2 -2
  62. package/dist/esm/chunks/{AudioBubble-DZfzkdlq.mjs → AudioBubble-D052QyPH.mjs} +1 -1
  63. package/dist/esm/chunks/{Button-YER9dCLE.mjs → Button-BIbAGVV8.mjs} +11 -9
  64. package/dist/esm/chunks/{ButtonBar-BH4pcEpN.mjs → ButtonBar-B-1YFX9u.mjs} +1 -1
  65. package/dist/esm/chunks/{Camera-BJJpDuuA.mjs → Camera-BQBo2g52.mjs} +1 -1
  66. package/dist/esm/chunks/{CheckBox-Cf2l3-D9.mjs → CheckBox-DDwE1wkX.mjs} +1 -1
  67. package/dist/esm/chunks/{Chip-DWp7p2BF.mjs → Chip-BuHc883v.mjs} +1 -1
  68. package/dist/esm/chunks/{DrggablePanel-DA7pYWg6.mjs → DrggablePanel-Dc6lqqfO.mjs} +14 -11
  69. package/dist/esm/chunks/{DropDown-BQ2tNN3_.mjs → DropDown-CdkEVTRk.mjs} +10 -8
  70. package/dist/esm/chunks/{FileList-BQ9X5YnB.mjs → FileList-DN4Ubroe.mjs} +2 -2
  71. package/dist/esm/chunks/{FlexDiv-BFrVoFhC.mjs → FlexDiv-BWZ7f8mA.mjs} +61 -21
  72. package/dist/esm/chunks/{Grouper-CvPYEsF_.mjs → Grouper-C4A3qYot.mjs} +1 -1
  73. package/dist/esm/chunks/{Icon-DI32kOA1.mjs → Icon-DRzjkybv.mjs} +185 -12
  74. package/dist/esm/chunks/{IconButton-Dciw5CLn.mjs → IconButton-b1v9Me0P.mjs} +14 -11
  75. package/dist/esm/chunks/{ProgressIndicator-CB_oazMD.mjs → ProgressIndicator-D5e7406q.mjs} +1 -1
  76. package/dist/esm/chunks/{PromptInput-plgRiAb7.mjs → PromptInput-Dmx4sQZ3.mjs} +3 -3
  77. package/dist/esm/chunks/{RadioButton-B6ImCUYY.mjs → RadioButton-D2T-SsVw.mjs} +1 -1
  78. package/dist/esm/chunks/{RadioButtonList-Cf6gk8yp.mjs → RadioButtonList-BSPuAYoh.mjs} +1 -1
  79. package/dist/esm/chunks/{TabBar-0zpJ9GtN.mjs → TabBar-DBoZ8aoV.mjs} +2 -2
  80. package/dist/esm/chunks/{TextArea-B64bIPHm.mjs → TextArea-CSUDfcYd.mjs} +1 -1
  81. package/dist/esm/chunks/{TextField-BZeoN_ye.mjs → TextField-Z1O858hB.mjs} +7 -7
  82. package/dist/esm/chunks/{Tip-C5LB54J9.mjs → Tip-B8YrmJEt.mjs} +1 -1
  83. package/dist/esm/chunks/{Toast-Bl4s4tRo.mjs → Toast-QQ6GMr5F.mjs} +1 -1
  84. package/dist/esm/chunks/ToggleButton-B5oobnXJ.mjs +51 -0
  85. package/dist/esm/chunks/{UploadArea-D3g2g1LK.mjs → UploadArea-CJAQmqOS.mjs} +4 -4
  86. package/dist/esm/chunks/{_types-DeEhv4Y5.mjs → _types-fSW-DudT.mjs} +10 -2
  87. package/dist/esm/chunks/microphoneStore-t16oxjGB.mjs +121 -0
  88. package/dist/esm/components/AudioBubble/index.mjs +5 -5
  89. package/dist/esm/components/Button/index.mjs +5 -5
  90. package/dist/esm/components/ButtonBar/index.mjs +6 -6
  91. package/dist/esm/components/Camera/index.mjs +6 -6
  92. package/dist/esm/components/CheckBox/index.mjs +6 -6
  93. package/dist/esm/components/Chip/index.mjs +6 -6
  94. package/dist/esm/components/DraggablePanel/index.mjs +5 -5
  95. package/dist/esm/components/DropDown/index.mjs +6 -6
  96. package/dist/esm/components/ErrorSummary/index.mjs +4 -4
  97. package/dist/esm/components/FileIcon/index.mjs +4 -4
  98. package/dist/esm/components/FileList/index.mjs +7 -7
  99. package/dist/esm/components/FlexDiv/index.mjs +1 -1
  100. package/dist/esm/components/Grouper/index.mjs +6 -6
  101. package/dist/esm/components/Icon/index.mjs +6 -6
  102. package/dist/esm/components/IconButton/index.mjs +4 -4
  103. package/dist/esm/components/Progress/index.mjs +6 -6
  104. package/dist/esm/components/PromptInput/index.mjs +9 -9
  105. package/dist/esm/components/RadioButton/index.mjs +6 -6
  106. package/dist/esm/components/RadioButtonList/index.mjs +7 -7
  107. package/dist/esm/components/TabBar/index.mjs +7 -7
  108. package/dist/esm/components/TextArea/index.mjs +6 -6
  109. package/dist/esm/components/Textfield/index.mjs +9 -9
  110. package/dist/esm/components/Tip/index.mjs +1 -1
  111. package/dist/esm/components/Toast/index.mjs +6 -6
  112. package/dist/esm/components/ToggleButton/index.mjs +45 -0
  113. package/dist/esm/components/UploadArea/index.mjs +11 -11
  114. package/dist/esm/hooks/useMicrophone.mjs +19 -13
  115. package/dist/esm/hooks/useTheme.mjs +26 -15
  116. package/dist/esm/hooks/useToolTip.mjs +9 -6
  117. package/dist/esm/hooks.mjs +6 -6
  118. package/dist/esm/index.mjs +26 -24
  119. package/dist/esm/providers/ThemeProvider.mjs +37 -20
  120. package/dist/esm/stores/microphone.mjs +7 -0
  121. package/dist/esm/stores.mjs +2 -0
  122. package/dist/esm/theme/colors.mjs +2 -2
  123. package/dist/types/components/Button/Button.d.ts +2 -0
  124. package/dist/types/components/Button/_types.d.ts +1 -0
  125. package/dist/types/components/DraggablePanel/DrggablePanel.d.ts +1 -2
  126. package/dist/types/components/FlexDiv/FlexDiv.d.ts +2 -0
  127. package/dist/types/components/FlexDiv/_types.d.ts +35 -7
  128. package/dist/types/components/Icon/_types.d.ts +9 -0
  129. package/dist/types/components/IconButton/_types.d.ts +1 -0
  130. package/dist/types/components/ToggleButton/ToggleButton.d.ts +2 -0
  131. package/dist/types/components/ToggleButton/_types.d.ts +24 -0
  132. package/dist/types/components/ToggleButton/index.d.ts +2 -0
  133. package/dist/types/hooks/useMicrophone/useMicrophone.d.ts +2 -1
  134. package/dist/types/hooks/useTheme/useTheme.d.ts +5 -1
  135. package/dist/types/hooks/useWindow/useWindow.d.ts +1 -1
  136. package/dist/types/index.d.ts +2 -0
  137. package/dist/types/providers/ThemeProvider.d.ts +2 -0
  138. package/dist/types/stores/index.d.ts +1 -0
  139. package/dist/types/stores/microphone/_types.d.ts +28 -0
  140. package/dist/types/stores/microphone/index.d.ts +2 -0
  141. package/dist/types/stores/microphone/microphoneStore.d.ts +24 -0
  142. package/dist/types/stores/window/windowStore.d.ts +2 -2
  143. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- export { T as Toast, a as ToastType } from "../../chunks/Toast-Bl4s4tRo.mjs";
1
+ export { T as Toast, a as ToastType } from "../../chunks/Toast-QQ6GMr5F.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-C-olHjXV.mjs";
4
4
 
@@ -10,6 +10,10 @@ import "react";
10
10
 
11
11
  import "../../hooks/useTheme.mjs";
12
12
 
13
+ import "../../providers/ThemeProvider.mjs";
14
+
15
+ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
16
+
13
17
  import "../../theme/themes.mjs";
14
18
 
15
19
  import "../../theme/colors.mjs";
@@ -24,12 +28,8 @@ import "../../theme/type.mjs";
24
28
 
25
29
  import "../../hooks/useObserveTheme.mjs";
26
30
 
27
- import "../../providers/ThemeProvider.mjs";
28
-
29
- import "../../chunks/style-inject.es-D0BjEaN8.mjs";
30
-
31
31
  import "../../chunks/misc-BeEWwOaJ.mjs";
32
32
 
33
33
  import "../../hooks/useWindow.mjs";
34
34
 
35
- import "../../chunks/Icon-DI32kOA1.mjs";
35
+ import "../../chunks/Icon-DRzjkybv.mjs";
@@ -0,0 +1,45 @@
1
+ export { T as ToggleButton } from "../../chunks/ToggleButton-B5oobnXJ.mjs";
2
+
3
+ import "react/jsx-runtime";
4
+
5
+ import "react";
6
+
7
+ import "../../chunks/IconButton-b1v9Me0P.mjs";
8
+
9
+ import "../../chunks/tslib.es6-C-olHjXV.mjs";
10
+
11
+ import "motion/react";
12
+
13
+ import "../../chunks/Badge-CC0zSLMf.mjs";
14
+
15
+ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
16
+
17
+ import "../../chunks/Dot-DZE134mJ.mjs";
18
+
19
+ import "../../chunks/Icon-DRzjkybv.mjs";
20
+
21
+ import "../../hooks/useTheme.mjs";
22
+
23
+ import "../../providers/ThemeProvider.mjs";
24
+
25
+ import "../../theme/themes.mjs";
26
+
27
+ import "../../theme/colors.mjs";
28
+
29
+ import "../../theme/corners.mjs";
30
+
31
+ import "../../theme/elevations.mjs";
32
+
33
+ import "../../theme/motion.mjs";
34
+
35
+ import "../../theme/type.mjs";
36
+
37
+ import "../../hooks/useObserveTheme.mjs";
38
+
39
+ import "../../chunks/misc-BeEWwOaJ.mjs";
40
+
41
+ import "../../hooks/useWindow.mjs";
42
+
43
+ import "../../chunks/sharedTypes-tn9-uJvb.mjs";
44
+
45
+ import "../../chunks/Label-CvCDAg1y.mjs";
@@ -1,4 +1,4 @@
1
- export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "../../chunks/UploadArea-D3g2g1LK.mjs";
1
+ export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "../../chunks/UploadArea-CJAQmqOS.mjs";
2
2
 
3
3
  import "react/jsx-runtime";
4
4
 
@@ -8,12 +8,14 @@ import "../../chunks/misc-BeEWwOaJ.mjs";
8
8
 
9
9
  import "../../chunks/tslib.es6-C-olHjXV.mjs";
10
10
 
11
- import "../../chunks/FileList-BQ9X5YnB.mjs";
12
-
13
- import "../../chunks/FileIcon-Cufsp1gn.mjs";
11
+ import "../../chunks/Icon-DRzjkybv.mjs";
14
12
 
15
13
  import "../../hooks/useTheme.mjs";
16
14
 
15
+ import "../../providers/ThemeProvider.mjs";
16
+
17
+ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
18
+
17
19
  import "../../theme/themes.mjs";
18
20
 
19
21
  import "../../theme/colors.mjs";
@@ -28,14 +30,12 @@ import "../../theme/type.mjs";
28
30
 
29
31
  import "../../hooks/useObserveTheme.mjs";
30
32
 
31
- import "../../providers/ThemeProvider.mjs";
32
-
33
- import "../../chunks/style-inject.es-D0BjEaN8.mjs";
34
-
35
33
  import "../../hooks/useWindow.mjs";
36
34
 
37
- import "../../chunks/Icon-DI32kOA1.mjs";
38
-
39
- import "../../chunks/ProgressIndicator-CB_oazMD.mjs";
35
+ import "../../chunks/ProgressIndicator-D5e7406q.mjs";
40
36
 
41
37
  import "motion/react";
38
+
39
+ import "../../chunks/FileList-DN4Ubroe.mjs";
40
+
41
+ import "../../chunks/FileIcon-Cufsp1gn.mjs";
@@ -3,8 +3,8 @@ import { _ as __awaiter } from "../chunks/tslib.es6-C-olHjXV.mjs";
3
3
 
4
4
  import { useRef, useState, useCallback, useMemo, useEffect } from "react";
5
5
 
6
- function useMicrophone(startMuted = !0, microphoneDeviceId) {
7
- const micStream = useRef(null), micTrack = useRef(null), mutedRef = useRef(startMuted), mountedRef = useRef(!0), initializedRef = useRef(!1), [microphones, setMicrophones] = useState([]), [micOptions, setMicOptions] = useState([]), [muted, setMuted] = useState(startMuted), [isRequesting, setIsRequesting] = useState(!1), [error, setError] = useState(null), waitForPaint = useCallback(() => __awaiter(this, void 0, void 0, function*() {
6
+ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
7
+ const micStream = useRef(null), micTrack = useRef(null), mutedRef = useRef(startMuted), mountedRef = useRef(!0), initializedRef = useRef(!1), [microphones, setMicrophones] = useState([]), [micOptions, setMicOptions] = useState([]), [isActive, setIsActive] = useState(!1), [muted, setMuted] = useState(startMuted), [isRequesting, setIsRequesting] = useState(!1), [error, setError] = useState(null), waitForPaint = useCallback(() => __awaiter(this, void 0, void 0, function*() {
8
8
  yield new Promise(resolve => {
9
9
  requestAnimationFrame(() => resolve());
10
10
  });
@@ -21,7 +21,7 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
21
21
  var _a;
22
22
  const tracks = null === (_a = micStream.current) || void 0 === _a ? void 0 : _a.getTracks();
23
23
  for (const track of null != tracks ? tracks : []) track.stop();
24
- micStream.current = null, micTrack.current = null;
24
+ micStream.current = null, micTrack.current = null, setIsActive(!1);
25
25
  }, []), hasMediaSupport = useMemo(() => {
26
26
  var _a;
27
27
  return "undefined" != typeof navigator && Boolean(null === (_a = navigator.mediaDevices) || void 0 === _a ? void 0 : _a.getUserMedia);
@@ -30,8 +30,8 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
30
30
  const audioTrack = micStream.current.getAudioTracks()[0];
31
31
  if (!audioTrack) throw new Error("No audio track found");
32
32
  return audioTrack;
33
- }, []), muteMic = useCallback(() => (getMicTrack().enabled = !1, mutedRef.current = !0,
34
- setMuted(!0), !0), [ getMicTrack ]), unmuteMic = useCallback(() => (getMicTrack().enabled = !0,
33
+ }, []), hasActiveStream = useCallback(() => !(!micStream.current || !micTrack.current) && "live" === micTrack.current.readyState, []), muteMic = useCallback(() => (getMicTrack().enabled = !1,
34
+ mutedRef.current = !0, setMuted(!0), !0), [ getMicTrack ]), unmuteMic = useCallback(() => (getMicTrack().enabled = !0,
35
35
  mutedRef.current = !1, setMuted(!1), !0), [ getMicTrack ]), constraints = useCallback((deviceId, usePreferredDevice = !0) => {
36
36
  var _a;
37
37
  const id = usePreferredDevice ? null !== (_a = null != deviceId ? deviceId : microphoneDeviceId) && void 0 !== _a ? _a : void 0 : deviceId;
@@ -45,11 +45,14 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
45
45
  }, [ microphoneDeviceId ]), requestStream = useCallback((deviceId_1, ...args_1) => __awaiter(this, [ deviceId_1, ...args_1 ], void 0, function*(deviceId, usePreferredDevice = !0) {
46
46
  return micStream.current = yield navigator.mediaDevices.getUserMedia(constraints(deviceId, usePreferredDevice)),
47
47
  micTrack.current = getMicTrack(), micTrack.current.enabled = !mutedRef.current,
48
- mutedRef.current || (yield waitForTrackToBecomeActive(micTrack.current)), micStream.current;
48
+ mutedRef.current || (yield waitForTrackToBecomeActive(micTrack.current)), setIsActive(Boolean("live" === micTrack.current.readyState)),
49
+ micStream.current;
49
50
  }), [ constraints, getMicTrack, waitForTrackToBecomeActive ]), requestMicrophone = useCallback(() => __awaiter(this, void 0, void 0, function*() {
51
+ if (hasActiveStream()) return setIsActive(!0), setError(null), micStream.current;
50
52
  if (setIsRequesting(!0), yield waitForPaint(), !hasMediaSupport) {
51
53
  const nextError = new Error("Microphone access is not supported");
52
- return setError(nextError), mountedRef.current && setIsRequesting(!1), null;
54
+ return setError(nextError), setIsActive(!1), mountedRef.current && setIsRequesting(!1),
55
+ null;
53
56
  }
54
57
  setError(null), stopMicStream();
55
58
  try {
@@ -57,13 +60,13 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
57
60
  } catch (error) {
58
61
  if (!(error instanceof DOMException && "OverconstrainedError" === error.name || error instanceof DOMException && "NotFoundError" === error.name)) {
59
62
  const nextError = error instanceof Error ? error : new Error("Failed to access microphone");
60
- throw setError(nextError), nextError;
63
+ throw setError(nextError), setIsActive(!1), nextError;
61
64
  }
62
65
  return yield requestStream(void 0, !1);
63
66
  } finally {
64
67
  setIsRequesting(!1);
65
68
  }
66
- }), [ hasMediaSupport, requestStream, stopMicStream, waitForPaint ]), refreshMicrophones = useCallback(() => __awaiter(this, void 0, void 0, function*() {
69
+ }), [ hasActiveStream, hasMediaSupport, requestStream, stopMicStream, waitForPaint ]), refreshMicrophones = useCallback(() => __awaiter(this, void 0, void 0, function*() {
67
70
  if (!hasMediaSupport) return [];
68
71
  try {
69
72
  const devices = yield navigator.mediaDevices.enumerateDevices(), mics = devices.filter(device => "audioinput" === device.kind), options = mics.map(mic => ({
@@ -84,7 +87,7 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
84
87
  try {
85
88
  setError(null), stopMicStream(), yield requestStream(id, !1);
86
89
  } catch (err) {
87
- setError(err instanceof Error ? err : new Error("Error switching microphone")),
90
+ setIsActive(!1), setError(err instanceof Error ? err : new Error("Error switching microphone")),
88
91
  console.warn("Error switching microphone:", err);
89
92
  } finally {
90
93
  setIsRequesting(!1);
@@ -98,14 +101,16 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
98
101
  }, [ muted, unmuteMic, muteMic ]);
99
102
  return useEffect(() => {
100
103
  if (mountedRef.current = !0, hasMediaSupport && !initializedRef.current) return initializedRef.current = !0,
101
- requestMicrophone().then(() => {
104
+ autoRequest ? (requestMicrophone().then(() => {
102
105
  startMuted && muteMic();
103
106
  }).catch(err => {
104
107
  console.error("Error accessing microphone:", err);
105
108
  }), () => {
106
109
  mountedRef.current = !1, stopMicStream();
107
- };
108
- }, [ hasMediaSupport, requestMicrophone, startMuted, muteMic, stopMicStream ]),
110
+ }) : (refreshMicrophones(), () => {
111
+ mountedRef.current = !1, stopMicStream();
112
+ });
113
+ }, [ autoRequest, hasMediaSupport, refreshMicrophones, requestMicrophone, startMuted, muteMic, stopMicStream ]),
109
114
  useEffect(() => {
110
115
  var _a;
111
116
  if (!hasMediaSupport || !(null === (_a = navigator.mediaDevices) || void 0 === _a ? void 0 : _a.addEventListener)) return;
@@ -126,6 +131,7 @@ function useMicrophone(startMuted = !0, microphoneDeviceId) {
126
131
  {
127
132
  micStream: micStream,
128
133
  micTrack: micTrack,
134
+ isActive: isActive,
129
135
  muted: muted,
130
136
  isSupported: hasMediaSupport,
131
137
  isRequesting: isRequesting,
@@ -1,6 +1,8 @@
1
1
  'use client';
2
2
  import { useCallback, useMemo } from "react";
3
3
 
4
+ import { useThemeContext } from "../providers/ThemeProvider.mjs";
5
+
4
6
  import { darkTheme, lightTheme } from "../theme/themes.mjs";
5
7
 
6
8
  import { colorClass, colorCssVars } from "../theme/colors.mjs";
@@ -9,28 +11,36 @@ import { typeStyles, typeCssClasses } from "../theme/type.mjs";
9
11
 
10
12
  import { useObserveTheme } from "./useObserveTheme.mjs";
11
13
 
14
+ import "react/jsx-runtime";
15
+
16
+ import "../chunks/style-inject.es-D0BjEaN8.mjs";
17
+
12
18
  import "../theme/corners.mjs";
13
19
 
14
20
  import "../theme/elevations.mjs";
15
21
 
16
22
  import "../theme/motion.mjs";
17
23
 
18
- import "../providers/ThemeProvider.mjs";
19
-
20
- import "react/jsx-runtime";
21
-
22
- import "../chunks/style-inject.es-D0BjEaN8.mjs";
24
+ function setDocumentTheme(name, system) {
25
+ "undefined" != typeof document && (document.documentElement.dataset.sliceTheme = name,
26
+ document.cookie = `slice-theme=${encodeURIComponent(name)}; path=/; max-age=31536000; samesite=lax`,
27
+ document.cookie = `slice-system-theme=${encodeURIComponent(system)}; path=/; max-age=31536000; samesite=lax`);
28
+ }
23
29
 
24
30
  /**
25
31
  * Hook to manage Slice theming
26
32
  */ function useTheme() {
27
- const current = useObserveTheme(), set = useCallback(newTheme => {
28
- let theme;
33
+ const current = useObserveTheme(), {systemTheme: systemTheme, setSystemTheme: setSystemTheme} = useThemeContext(), set = useCallback(newTheme => {
34
+ let theme, system = !1;
29
35
  if ("string" == typeof newTheme) if ("system" === newTheme) {
36
+ system = !0;
30
37
  theme = globalThis.matchMedia("(prefers-color-scheme: dark)").matches ? darkTheme : lightTheme;
31
38
  } else theme = newTheme === darkTheme.name ? darkTheme : lightTheme; else theme = newTheme;
32
- document.documentElement.dataset.sliceTheme = theme.name;
33
- }, []), isDark = useMemo(() => current.name === darkTheme.name, [ current ]);
39
+ setSystemTheme(system), setDocumentTheme(theme.name, system);
40
+ }, [ setSystemTheme ]), toggle = useCallback(() => {
41
+ const newTheme = current.name === lightTheme.name ? darkTheme : lightTheme;
42
+ setSystemTheme(!1), setDocumentTheme(newTheme.name, !1);
43
+ }, [ current.name, setSystemTheme ]), isDark = useMemo(() => current.name === darkTheme.name, [ current ]);
34
44
  return {
35
45
  /**
36
46
  * Slice's default dark theme
@@ -66,16 +76,17 @@ import "../chunks/style-inject.es-D0BjEaN8.mjs";
66
76
  */
67
77
  set: set,
68
78
  /**
69
- * Toggle between light and dark themes
79
+ * Togglebetween light and dark themes
70
80
  */
71
- toggle: () => {
72
- const newTheme = current.name === lightTheme.name ? darkTheme : lightTheme;
73
- document.documentElement.dataset.sliceTheme = newTheme.name;
74
- },
81
+ toggle: toggle,
75
82
  /**
76
83
  * If the currently active theme is the Slice's default dark theme'
77
84
  */
78
- isDark: isDark
85
+ isDark: isDark,
86
+ /**
87
+ * True when the current theme is still being derived from the OS preference
88
+ */
89
+ systemTheme: systemTheme
79
90
  };
80
91
  }
81
92
 
@@ -8,16 +8,19 @@ const hiddenCoords = {
8
8
 
9
9
  function useToolTip(toolTip, tipElement) {
10
10
  const [coords, setCoords] = useState(hiddenCoords), adjustX = useCallback(x => {
11
+ var _a;
11
12
  if (x < 10) return 10;
12
- const maxWidth = globalThis.innerWidth - 10;
13
- if (x > maxWidth) {
14
- return x - (x - maxWidth);
13
+ if (!tipElement.current) return x;
14
+ const maxWidth = globalThis.innerWidth - 10, tipWdithStyle = null !== (_a = globalThis.getComputedStyle(tipElement.current).width) && void 0 !== _a ? _a : 0, endX = x + Number.parseInt(tipWdithStyle.replace("px", ""));
15
+ if (endX > maxWidth) {
16
+ return x - (endX - maxWidth);
15
17
  }
16
18
  return x;
17
- }, []), adjustY = useCallback((y, parentY) => {
18
- var _a, _b;
19
+ }, [ tipElement ]), adjustY = useCallback((y, parentY) => {
20
+ var _a;
19
21
  if (y < 10) return 10;
20
- const tipHeight = null !== (_b = null === (_a = tipElement.current) || void 0 === _a ? void 0 : _a.offsetHeight) && void 0 !== _b ? _b : 0;
22
+ if (!tipElement.current) return y;
23
+ const tipHeightStyle = null !== (_a = globalThis.getComputedStyle(tipElement.current).height) && void 0 !== _a ? _a : 0, tipHeight = Number.parseInt(tipHeightStyle.replace("px", ""));
21
24
  return y + tipHeight > globalThis.innerHeight - 10 ? parentY - tipHeight - 10 : y;
22
25
  }, [ tipElement ]);
23
26
  return useLayoutEffect(() => {
@@ -24,6 +24,12 @@ export { useObserveResize } from "./hooks/useObserveResize.mjs";
24
24
 
25
25
  import "react";
26
26
 
27
+ import "./providers/ThemeProvider.mjs";
28
+
29
+ import "react/jsx-runtime";
30
+
31
+ import "./chunks/style-inject.es-D0BjEaN8.mjs";
32
+
27
33
  import "./theme/themes.mjs";
28
34
 
29
35
  import "./theme/colors.mjs";
@@ -36,12 +42,6 @@ import "./theme/motion.mjs";
36
42
 
37
43
  import "./theme/type.mjs";
38
44
 
39
- import "./providers/ThemeProvider.mjs";
40
-
41
- import "react/jsx-runtime";
42
-
43
- import "./chunks/style-inject.es-D0BjEaN8.mjs";
44
-
45
45
  import "./chunks/tslib.es6-C-olHjXV.mjs";
46
46
 
47
47
  import "./chunks/MdStreamBuffer-DNXE4XbN.mjs";
@@ -32,7 +32,7 @@ export { useWindow } from "./hooks/useWindow.mjs";
32
32
 
33
33
  export { useObserveResize } from "./hooks/useObserveResize.mjs";
34
34
 
35
- export { A as AudioBubble } from "./chunks/AudioBubble-DZfzkdlq.mjs";
35
+ export { A as AudioBubble } from "./chunks/AudioBubble-D052QyPH.mjs";
36
36
 
37
37
  export { A as Avatar } from "./chunks/Avatar-m5-zleDk.mjs";
38
38
 
@@ -40,37 +40,37 @@ export { A as AvatarGroup } from "./chunks/AvatarGroup-DlgP4lTS.mjs";
40
40
 
41
41
  export { B as Badge } from "./chunks/Badge-CC0zSLMf.mjs";
42
42
 
43
- export { I as IconButton } from "./chunks/IconButton-Dciw5CLn.mjs";
43
+ export { I as IconButton } from "./chunks/IconButton-b1v9Me0P.mjs";
44
44
 
45
- export { C as Camera } from "./chunks/Camera-BJJpDuuA.mjs";
45
+ export { C as Camera } from "./chunks/Camera-BQBo2g52.mjs";
46
46
 
47
- export { C as CheckBox } from "./chunks/CheckBox-Cf2l3-D9.mjs";
47
+ export { C as CheckBox } from "./chunks/CheckBox-DDwE1wkX.mjs";
48
48
 
49
49
  export { D as DivInput } from "./chunks/DivInput-WJltaCra.mjs";
50
50
 
51
51
  export { D as Dot } from "./chunks/Dot-DZE134mJ.mjs";
52
52
 
53
- export { D as DraggablePanel } from "./chunks/DrggablePanel-DA7pYWg6.mjs";
53
+ export { D as DraggablePanel } from "./chunks/DrggablePanel-Dc6lqqfO.mjs";
54
54
 
55
- export { D as DropDown } from "./chunks/DropDown-BQ2tNN3_.mjs";
55
+ export { D as DropDown } from "./chunks/DropDown-CdkEVTRk.mjs";
56
56
 
57
57
  export { E as ErrorSummary } from "./chunks/ErrorSummary-EzCqVifm.mjs";
58
58
 
59
- export { G as Grouper } from "./chunks/Grouper-CvPYEsF_.mjs";
59
+ export { G as Grouper } from "./chunks/Grouper-C4A3qYot.mjs";
60
60
 
61
61
  export { O as Overlay } from "./chunks/Overlay-DiSvgIQP.mjs";
62
62
 
63
- export { F as FlexDiv, P as Preset, S as Size } from "./chunks/FlexDiv-BFrVoFhC.mjs";
63
+ export { F as FlexDiv, P as Preset, S as Size } from "./chunks/FlexDiv-BWZ7f8mA.mjs";
64
64
 
65
65
  export { P as Pager } from "./chunks/Pager-BoDLaKFh.mjs";
66
66
 
67
- export { P as PromptInput } from "./chunks/PromptInput-plgRiAb7.mjs";
67
+ export { P as PromptInput } from "./chunks/PromptInput-Dmx4sQZ3.mjs";
68
68
 
69
- export { D as DoneCheck, P as ProgressIndicator } from "./chunks/ProgressIndicator-CB_oazMD.mjs";
69
+ export { D as DoneCheck, P as ProgressIndicator } from "./chunks/ProgressIndicator-D5e7406q.mjs";
70
70
 
71
- export { R as RadioButton } from "./chunks/RadioButton-B6ImCUYY.mjs";
71
+ export { R as RadioButton } from "./chunks/RadioButton-D2T-SsVw.mjs";
72
72
 
73
- export { R as RadioButtonList } from "./chunks/RadioButtonList-Cf6gk8yp.mjs";
73
+ export { R as RadioButtonList } from "./chunks/RadioButtonList-BSPuAYoh.mjs";
74
74
 
75
75
  export { S as Slider } from "./chunks/Slider-Cav86rU6.mjs";
76
76
 
@@ -78,33 +78,35 @@ export { S as Spacer } from "./chunks/Spacer-C5651N0N.mjs";
78
78
 
79
79
  export { S as Switch } from "./chunks/Switch-RfA431T4.mjs";
80
80
 
81
- export { T as TabBar } from "./chunks/TabBar-0zpJ9GtN.mjs";
81
+ export { T as ToggleButton } from "./chunks/ToggleButton-B5oobnXJ.mjs";
82
82
 
83
- export { T as TextArea } from "./chunks/TextArea-B64bIPHm.mjs";
83
+ export { T as TabBar } from "./chunks/TabBar-DBoZ8aoV.mjs";
84
84
 
85
- export { T as TextField } from "./chunks/TextField-BZeoN_ye.mjs";
85
+ export { T as TextArea } from "./chunks/TextArea-CSUDfcYd.mjs";
86
+
87
+ export { T as TextField } from "./chunks/TextField-Z1O858hB.mjs";
86
88
 
87
89
  export { ThemeProvider } from "./providers/ThemeProvider.mjs";
88
90
 
89
- export { T as Tip } from "./chunks/Tip-C5LB54J9.mjs";
91
+ export { T as Tip } from "./chunks/Tip-B8YrmJEt.mjs";
90
92
 
91
- export { T as Toast, a as ToastType } from "./chunks/Toast-Bl4s4tRo.mjs";
93
+ export { T as Toast, a as ToastType } from "./chunks/Toast-QQ6GMr5F.mjs";
92
94
 
93
- export { B as Button } from "./chunks/Button-YER9dCLE.mjs";
95
+ export { B as Button } from "./chunks/Button-BIbAGVV8.mjs";
94
96
 
95
- export { C as Chip } from "./chunks/Chip-DWp7p2BF.mjs";
97
+ export { C as Chip } from "./chunks/Chip-BuHc883v.mjs";
96
98
 
97
99
  export { F as FileIcon, a as FileIconNames } from "./chunks/FileIcon-Cufsp1gn.mjs";
98
100
 
99
- export { I as Icon } from "./chunks/Icon-DI32kOA1.mjs";
101
+ export { I as Icon } from "./chunks/Icon-DRzjkybv.mjs";
100
102
 
101
- export { S as SliceIcons } from "./chunks/_types-DeEhv4Y5.mjs";
103
+ export { S as SliceIcons } from "./chunks/_types-fSW-DudT.mjs";
102
104
 
103
- export { B as ButtonBar } from "./chunks/ButtonBar-BH4pcEpN.mjs";
105
+ export { B as ButtonBar } from "./chunks/ButtonBar-B-1YFX9u.mjs";
104
106
 
105
107
  export { L as Label, a as LabelBackground } from "./chunks/Label-CvCDAg1y.mjs";
106
108
 
107
- export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "./chunks/UploadArea-D3g2g1LK.mjs";
109
+ export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "./chunks/UploadArea-CJAQmqOS.mjs";
108
110
 
109
111
  import "./theme/corners.mjs";
110
112
 
@@ -128,6 +130,6 @@ import "./chunks/misc-BeEWwOaJ.mjs";
128
130
 
129
131
  import "motion/react";
130
132
 
131
- import "./chunks/FileList-BQ9X5YnB.mjs";
133
+ import "./chunks/FileList-DN4Ubroe.mjs";
132
134
 
133
135
  import "./chunks/debounce-Bst1jxMS.mjs";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
- import { createContext, useContext, useMemo, useEffect } from "react";
4
+ import { createContext, useContext, useState, useEffect, useMemo } from "react";
5
5
 
6
6
  import { s as styleInject } from "../chunks/style-inject.es-D0BjEaN8.mjs";
7
7
 
@@ -17,7 +17,7 @@ import "../theme/motion.mjs";
17
17
 
18
18
  import "../theme/type.mjs";
19
19
 
20
- styleInject('/* Core brand colors (un-themed) */\n[data-slice-theme-scope] {\n\t--brand-grey-50: #f4f7fa;\n\t--brand-grey-100: #e5ecf3;\n\t--brand-grey-200: #d5e0ea;\n\t--brand-grey-300: #98acbf;\n\t--brand-grey-400: #7f96a9;\n\t--brand-grey-500: #657d91;\n\t--brand-grey-600: #4c6273;\n\t--brand-grey-700: #405261;\n\t--brand-grey-800: #37434e;\n\t--brand-grey-900: #2d353d;\n\t--brand-grey-950: #1f262d;\n\t--brand-sea-50: #e8f1ff;\n\t--brand-sea-100: #c7defe;\n\t--brand-sea-200: #a5c9ff;\n\t--brand-sea-300: #7ab3ff;\n\t--brand-sea-400: #4084ff;\n\t--brand-sea-500: #2f45ff;\n\t--brand-sea-600: #2d2fff;\n\t--brand-sea-700: #0000ff;\n\t--brand-sea-800: #0609cd;\n\t--brand-sea-900: #001699;\n\t--brand-sea-950: #0a0b5c;\n\t--brand-sky-50: #eafffe;\n\t--brand-sky-100: #cdfffb;\n\t--brand-sky-200: #a3f8ff;\n\t--brand-sky-300: #6af5ff;\n\t--brand-sky-400: #00edff;\n\t--brand-sky-500: #00c8e0;\n\t--brand-sky-600: #00a6c0;\n\t--brand-sky-700: #03839b;\n\t--brand-sky-800: #0d697d;\n\t--brand-sky-900: #105669;\n\t--brand-sky-950: #033949;\n\t--brand-land-50: #f4ffe5;\n\t--brand-land-100: #e0ffb7;\n\t--brand-land-200: #caff95;\n\t--brand-land-300: #b7fe59;\n\t--brand-land-400: #9cf820;\n\t--brand-land-500: #71e618;\n\t--brand-land-600: #56c900;\n\t--brand-land-700: #2d8c00;\n\t--brand-land-800: #31690b;\n\t--brand-land-900: #2a580f;\n\t--brand-land-950: #123201;\n\t--brand-orange-50: #fff8ec;\n\t--brand-orange-100: #ffebd7;\n\t--brand-orange-200: #ffe3c6;\n\t--brand-orange-300: #ffc182;\n\t--brand-orange-400: #ff972e;\n\t--brand-orange-500: #ff800a;\n\t--brand-orange-600: #ff6700;\n\t--brand-orange-700: #ff3700;\n\t--brand-orange-800: #a02b0b;\n\t--brand-orange-900: #80250b;\n\t--brand-orange-950: #461604;\n\t--brand-yellow-50: #ffffea;\n\t--brand-yellow-100: #fffdca;\n\t--brand-yellow-200: #fff2a0;\n\t--brand-yellow-300: #ffeb72;\n\t--brand-yellow-400: #ffd333;\n\t--brand-yellow-500: #ffc200;\n\t--brand-yellow-600: #ffad00;\n\t--brand-yellow-700: #c68601;\n\t--brand-yellow-800: #8f6307;\n\t--brand-yellow-900: #5f430a;\n\t--brand-yellow-950: #442e00;\n\t--brand-purple-50: #faf0ff;\n\t--brand-purple-100: #f4ddff;\n\t--brand-purple-200: #e5cdff;\n\t--brand-purple-300: #ccafff;\n\t--brand-purple-400: #b891ff;\n\t--brand-purple-500: #7d48ff;\n\t--brand-purple-600: #6a14ff;\n\t--brand-purple-700: #5600f1;\n\t--brand-purple-800: #4d01d6;\n\t--brand-purple-900: #4003af;\n\t--brand-purple-950: #1e007c;\n\t--brand-magenta-50: #fef1fc;\n\t--brand-magenta-100: #ffdcef;\n\t--brand-magenta-200: #ffcae6;\n\t--brand-magenta-300: #ff90cb;\n\t--brand-magenta-400: #ff61ca;\n\t--brand-magenta-500: #ff3ac2;\n\t--brand-magenta-600: #f012aa;\n\t--brand-magenta-700: #df059b;\n\t--brand-magenta-800: #9b0069;\n\t--brand-magenta-900: #790a55;\n\t--brand-magenta-950: #58003a;\n\t--brand-white-0: #ffffff;\n\t--product-red-400: #ff474a;\n\t--product-red-500: #df0529;\n\n\t/* Non-brand semantic aliases */\n\t--core-drop-shadow-light: #0339491a;\n\t--core-drop-shadow-dark: #0000007a;\n\t--core-surface-coverup-translucent-light: #1f262d52;\n\t--core-surface-coverup-translucent-dark: #0000007a;\n\t--core-surface-overlay-translucent-light: #ffffffcc;\n\t--core-surface-overlay-translucent-dark: #1f262dcc;\n\t--scroll-bar-light: #e3e8ef;\n\t--scroll-bar-dark: rgba(255, 255, 255, 0.1);\n\t--scroll-bar-hover-light: #cdd5df;\n\t--scroll-bar-hover-dark: rgba(255, 255, 255, 0.15);\n\t--surface-shadow-soft-light: 0px 4px 24px #0339491a;\n\t--surface-shadow-soft-dark: 0px 4px 24px #0000007a;\n\t--surface-shadow-strong-light: 0px 4px 64px #0339491a;\n\t--surface-shadow-strong-dark: 0px 4px 64px #0000007a;\n}\n\n/* Root-level token needed for global viewport backgrounds */\n:root[data-slice-theme="lightMode"] {\n\t--core-surface-primary: #ffffff;\n}\n\n/* Light theme tokens */\n:root[data-slice-theme="lightMode"] [data-slice-theme-scope] {\n\t--array-land: var(--brand-land-100);\n\t--array-land-label: var(--brand-land-600);\n\t--array-magenta: var(--brand-magenta-100);\n\t--array-magenta-label: var(--brand-magenta-600);\n\t--array-orange: var(--brand-orange-100);\n\t--array-orange-label: var(--brand-orange-600);\n\t--array-purple: var(--brand-purple-100);\n\t--array-purple-label: var(--brand-purple-600);\n\t--array-sea: var(--brand-sea-100);\n\t--array-sea-label: var(--brand-sea-600);\n\t--array-sky: var(--brand-sky-100);\n\t--array-sky-label: var(--brand-sky-600);\n\t--array-yellow: var(--brand-yellow-100);\n\t--array-yellow-label: var(--brand-yellow-600);\n\t--core-badge-primary: var(--brand-sea-500);\n\t--core-badge-secondary: var(--brand-grey-100);\n\t--core-button-disabled: var(--brand-grey-50);\n\t--core-button-primary: var(--brand-sea-500);\n\t--core-drop-shadow: var(--core-drop-shadow-light);\n\t--core-gp-logo-primary: var(--brand-sea-700);\n\t--core-gp-logo-secondary: var(--brand-grey-950);\n\t--core-icon-dark: var(--brand-grey-950);\n\t--core-icon-disabled: var(--brand-grey-300);\n\t--core-icon-error: var(--product-red-500);\n\t--core-icon-light: var(--brand-white-0);\n\t--core-icon-primary: var(--brand-grey-950);\n\t--core-icon-secondary: var(--brand-grey-700);\n\t--core-icon-tertiary: var(--brand-sea-500);\n\t--core-outline-secondary: var(--brand-grey-700);\n\t--core-outline-primary: var(--brand-grey-100);\n\t--core-outline-special: var(--brand-sea-100);\n\t--core-outline-tertiary: var(--brand-sea-500);\n\t--core-surface-coverup-translucent: var(\n\t\t--core-surface-coverup-translucent-light\n\t);\n\t--core-surface-overlay-translucent: var(\n\t\t--core-surface-overlay-translucent-light\n\t);\n\t--core-surface-primary: var(--brand-white-0);\n\t--core-surface-secondary: var(--brand-grey-50);\n\t--core-surface-special: var(--brand-sea-50);\n\t--core-text-dark: var(--brand-grey-950);\n\t--core-text-disabled: var(--brand-grey-300);\n\t--core-text-error: var(--product-red-500);\n\t--core-text-light: var(--brand-white-0);\n\t--core-text-primary: var(--brand-grey-950);\n\t--core-text-secondary: var(--brand-grey-700);\n\t--core-text-tertiary: var(--brand-grey-600);\n\t--core-text-special: var(--brand-sea-500);\n\t--core-link-primary: var(--brand-sea-700);\n\t--eor-tag-employee: var(--brand-sky-700);\n\t--eor-tag-overdue: var(--product-red-500);\n\t--eor-tag-paid: var(--brand-land-700);\n\t--eor-tag-pending: var(--brand-orange-500);\n\t--eor-tag-professional: var(--brand-sea-500);\n\t--feedback-attention: var(--brand-yellow-500);\n\t--feedback-informative: var(--brand-sky-700);\n\t--feedback-positive: var(--brand-land-700);\n\t--feedback-urgency: var(--brand-orange-500);\n\t--feedback-warning: var(--product-red-500);\n\t--gia-tag-risk-high: var(--product-red-500);\n\t--gia-tag-risk-low: var(--brand-sky-700);\n\t--gia-tag-risk-moderate: var(--brand-orange-500);\n\t--gia-text-excerpt-highlight: var(--brand-orange-100);\n\t--gia-text-selection: var(--brand-sea-100);\n\t--scroll-bar: var(--scroll-bar-light);\n\t--scroll-bar-hover: var(--scroll-bar-hover-light);\n\t--surface-shadow-soft: var(--surface-shadow-soft-light);\n\t--surface-shadow-strong: var(--surface-shadow-strong-light);\n}\n\n/* Root-level token needed for global viewport backgrounds */\n:root[data-slice-theme="darkMode"] {\n\t--core-surface-primary: #1f262d;\n}\n\n/* Dark theme tokens */\n:root[data-slice-theme="darkMode"] [data-slice-theme-scope] {\n\t--array-land: var(--brand-land-100);\n\t--array-land-label: var(--brand-land-600);\n\t--array-magenta: var(--brand-magenta-100);\n\t--array-magenta-label: var(--brand-magenta-600);\n\t--array-orange: var(--brand-orange-100);\n\t--array-orange-label: var(--brand-orange-600);\n\t--array-purple: var(--brand-purple-100);\n\t--array-purple-label: var(--brand-purple-600);\n\t--array-sea: var(--brand-sea-100);\n\t--array-sea-label: var(--brand-sea-600);\n\t--array-sky: var(--brand-sky-100);\n\t--array-sky-label: var(--brand-sky-600);\n\t--array-yellow: var(--brand-yellow-100);\n\t--array-yellow-label: var(--brand-yellow-600);\n\t--core-badge-primary: var(--brand-sea-500);\n\t--core-badge-secondary: var(--brand-grey-700);\n\t--core-button-disabled: var(--brand-grey-900);\n\t--core-button-primary: var(--brand-sea-500);\n\t--core-drop-shadow: var(--core-drop-shadow-dark);\n\t--core-gp-logo-primary: var(--brand-sea-500);\n\t--core-gp-logo-secondary: var(--brand-white-0);\n\t--core-icon-dark: var(--brand-grey-950);\n\t--core-icon-disabled: var(--brand-grey-500);\n\t--core-icon-error: var(--product-red-400);\n\t--core-icon-light: var(--brand-white-0);\n\t--core-icon-primary: var(--brand-white-0);\n\t--core-icon-secondary: var(--brand-grey-200);\n\t--core-icon-tertiary: var(--brand-sky-300);\n\t--core-outline-secondary: var(--brand-grey-100);\n\t--core-outline-primary: var(--brand-grey-700);\n\t--core-outline-special: var(--brand-sky-300);\n\t--core-outline-tertiary: var(--brand-sky-300);\n\t--core-surface-coverup-translucent: var(\n\t\t--core-surface-coverup-translucent-dark\n\t);\n\t--core-surface-overlay-translucent: var(\n\t\t--core-surface-overlay-translucent-dark\n\t);\n\t--core-surface-primary: var(--brand-grey-950);\n\t--core-surface-secondary: var(--brand-grey-900);\n\t--core-surface-special: var(--brand-sky-950);\n\t--core-text-dark: var(--brand-grey-950);\n\t--core-text-disabled: var(--brand-grey-500);\n\t--core-text-error: var(--product-red-400);\n\t--core-text-light: var(--brand-white-0);\n\t--core-text-primary: var(--brand-white-0);\n\t--core-text-secondary: var(--brand-grey-200);\n\t--core-text-tertiary: var(--brand-grey-400);\n\t--core-text-special: var(--brand-sky-300);\n\t--core-link-primary: var(--brand-sky-300);\n\t--eor-tag-employee: var(--brand-sky-700);\n\t--eor-tag-overdue: var(--product-red-400);\n\t--eor-tag-paid: var(--brand-land-700);\n\t--eor-tag-pending: var(--brand-orange-500);\n\t--eor-tag-professional: var(--brand-sea-500);\n\t--feedback-attention: var(--brand-yellow-400);\n\t--feedback-informative: var(--brand-sky-600);\n\t--feedback-positive: var(--brand-land-700);\n\t--feedback-urgency: var(--brand-orange-500);\n\t--feedback-warning: var(--product-red-400);\n\t--gia-tag-risk-high: var(--product-red-400);\n\t--gia-tag-risk-low: var(--brand-sky-600);\n\t--gia-tag-risk-moderate: var(--brand-orange-500);\n\t--gia-text-excerpt-highlight: var(--brand-orange-100);\n\t--gia-text-selection: var(--brand-sea-900);\n\t--scroll-bar: var(--scroll-bar-dark);\n\t--scroll-bar-hover: var(--scroll-bar-hover-dark);\n\t--surface-shadow-soft: var(--surface-shadow-soft-dark);\n\t--surface-shadow-strong: var(--surface-shadow-strong-dark);\n}\n\n/* Theme token text-color utility classes */\n[data-slice-theme-scope] .array-land {\n\tbackground: var(--array-land);\n}\n[data-slice-theme-scope] .array-land-label {\n\tcolor: var(--array-land-label);\n}\n[data-slice-theme-scope] .array-magenta {\n\tbackground: var(--array-magenta);\n}\n[data-slice-theme-scope] .array-magenta-label {\n\tcolor: var(--array-magenta-label);\n}\n[data-slice-theme-scope] .array-orange {\n\tbackground: var(--array-orange);\n}\n[data-slice-theme-scope] .array-orange-label {\n\tcolor: var(--array-orange-label);\n}\n[data-slice-theme-scope] .array-purple {\n\tbackground: var(--array-purple);\n}\n[data-slice-theme-scope] .array-purple-label {\n\tcolor: var(--array-purple-label);\n}\n[data-slice-theme-scope] .array-sea {\n\tbackground: var(--array-sea);\n}\n[data-slice-theme-scope] .array-sea-label {\n\tcolor: var(--array-sea-label);\n}\n[data-slice-theme-scope] .array-sky {\n\tbackground: var(--array-sky);\n}\n[data-slice-theme-scope] .array-sky-label {\n\tcolor: var(--array-sky-label);\n}\n[data-slice-theme-scope] .array-yellow {\n\tbackground: var(--array-yellow);\n}\n[data-slice-theme-scope] .array-yellow-label {\n\tcolor: var(--array-yellow-label);\n}\n[data-slice-theme-scope] .core-badge-primary {\n\tbackground: var(--core-badge-primary);\n}\n[data-slice-theme-scope] .core-badge-secondary {\n\tbackground: var(--core-badge-secondary);\n}\n[data-slice-theme-scope] .core-button-disabled {\n\tbackground: var(--core-button-disabled);\n}\n[data-slice-theme-scope] .core-button-primary {\n\tbackground: var(--core-button-primary);\n}\n[data-slice-theme-scope] .core-drop-shadow {\n\tbox-shadow: var(--core-drop-shadow);\n}\n[data-slice-theme-scope] .core-gp-logo-primary {\n\tcolor: var(--core-gp-logo-primary);\n}\n[data-slice-theme-scope] .core-gp-logo-secondary {\n\tcolor: var(--core-gp-logo-secondary);\n}\n[data-slice-theme-scope] .core-icon-dark {\n\tcolor: var(--core-icon-dark);\n}\n[data-slice-theme-scope] .core-icon-disabled {\n\tcolor: var(--core-icon-disabled);\n}\n[data-slice-theme-scope] .core-icon-error {\n\tcolor: var(--core-icon-error);\n}\n[data-slice-theme-scope] .core-icon-light {\n\tcolor: var(--core-icon-light);\n}\n[data-slice-theme-scope] .core-icon-primary {\n\tcolor: var(--core-icon-primary);\n}\n[data-slice-theme-scope] .core-icon-secondary {\n\tcolor: var(--core-icon-secondary);\n}\n[data-slice-theme-scope] .core-icon-tertiary {\n\tcolor: var(--core-icon-tertiary);\n}\n[data-slice-theme-scope] .core-link-primary {\n\tcolor: var(--core-link-primary);\n}\n[data-slice-theme-scope] .core-outline-primary {\n\tborder-color: var(--core-outline-primary);\n}\n[data-slice-theme-scope] .core-outline-secondary {\n\tborder-color: var(--core-outline-secondary);\n}\n[data-slice-theme-scope] .core-outline-special {\n\tborder-color: var(--core-outline-special);\n}\n[data-slice-theme-scope] .core-outline-tertiary {\n\tborder-color: var(--core-outline-tertiary);\n}\n[data-slice-theme-scope] .core-surface-coverup-translucent {\n\tbackground: var(--core-surface-coverup-translucent);\n}\n[data-slice-theme-scope] .core-surface-overlay-translucent {\n\tbackground: var(--core-surface-overlay-translucent);\n}\n[data-slice-theme-scope] .core-surface-primary {\n\tbackground: var(--core-surface-primary);\n}\n[data-slice-theme-scope] .core-surface-secondary {\n\tbackground: var(--core-surface-secondary);\n}\n[data-slice-theme-scope] .core-surface-special {\n\tbackground: var(--core-surface-special);\n}\n[data-slice-theme-scope] .core-text-dark {\n\tcolor: var(--core-text-dark);\n}\n[data-slice-theme-scope] .core-text-disabled {\n\tcolor: var(--core-text-disabled);\n}\n[data-slice-theme-scope] .core-text-error {\n\tcolor: var(--core-text-error);\n}\n[data-slice-theme-scope] .core-text-light {\n\tcolor: var(--core-text-light);\n}\n[data-slice-theme-scope] .core-text-primary {\n\tcolor: var(--core-text-primary);\n}\n[data-slice-theme-scope] .core-text-secondary {\n\tcolor: var(--core-text-secondary);\n}\n[data-slice-theme-scope] .core-text-special {\n\tcolor: var(--core-text-special);\n}\n[data-slice-theme-scope] .core-text-tertiary {\n\tcolor: var(--core-text-tertiary);\n}\n[data-slice-theme-scope] .eor-tag-employee {\n\tcolor: var(--eor-tag-employee);\n}\n[data-slice-theme-scope] .eor-tag-overdue {\n\tcolor: var(--eor-tag-overdue);\n}\n[data-slice-theme-scope] .eor-tag-paid {\n\tcolor: var(--eor-tag-paid);\n}\n[data-slice-theme-scope] .eor-tag-pending {\n\tcolor: var(--eor-tag-pending);\n}\n[data-slice-theme-scope] .eor-tag-professional {\n\tcolor: var(--eor-tag-professional);\n}\n[data-slice-theme-scope] .feedback-attention {\n\tcolor: var(--feedback-attention);\n}\n[data-slice-theme-scope] .feedback-informative {\n\tcolor: var(--feedback-informative);\n}\n[data-slice-theme-scope] .feedback-positive {\n\tcolor: var(--feedback-positive);\n}\n[data-slice-theme-scope] .feedback-urgency {\n\tcolor: var(--feedback-urgency);\n}\n[data-slice-theme-scope] .feedback-warning {\n\tcolor: var(--feedback-warning);\n}\n[data-slice-theme-scope] .gia-tag-risk-high {\n\tcolor: var(--gia-tag-risk-high);\n}\n[data-slice-theme-scope] .gia-tag-risk-low {\n\tcolor: var(--gia-tag-risk-low);\n}\n[data-slice-theme-scope] .gia-tag-risk-moderate {\n\tcolor: var(--gia-tag-risk-moderate);\n}\n[data-slice-theme-scope] .gia-text-excerpt-highlight {\n\tcolor: var(--gia-text-excerpt-highlight);\n}\n[data-slice-theme-scope] .gia-text-selection {\n\tcolor: var(--gia-text-selection);\n}\n[data-slice-theme-scope] .scroll-bar {\n\tcolor: var(--scroll-bar);\n}\n[data-slice-theme-scope] .scroll-bar-hover {\n\tcolor: var(--scroll-bar-hover);\n}\n[data-slice-theme-scope] .surface-shadow-soft {\n\tcolor: var(--surface-shadow-soft);\n}\n[data-slice-theme-scope] .surface-shadow-strong {\n\tcolor: var(--surface-shadow-strong);\n}\n\n[data-slice-theme-scope] {\n\tbackground: var(--core-surface-primary);\n}\n\n[data-slice-theme-scope] a {\n\tcolor: var(--core-text-special);\n\ttext-decoration: underline;\n}\n\n[data-slice-theme-scope] a:visited {\n\tcolor: var(--core-text-special);\n\ttext-decoration: underline;\n}\n\n[data-slice-theme-scope] a:hover {\n\ttext-decoration: none;\n}\n\n[data-slice-theme-scope] code {\n\tborder: 1px solid var(--core-outline-primary);\n\tbackground: var(--core-surface-secondary);\n\tcolor: var(--core-text-primary);\n}\n');
20
+ styleInject('/* Core brand colors (un-themed) */\n[data-slice-theme-scope] {\n\t--brand-grey-50: #f4f7fa;\n\t--brand-grey-100: #e5ecf3;\n\t--brand-grey-200: #d5e0ea;\n\t--brand-grey-300: #98acbf;\n\t--brand-grey-400: #7f96a9;\n\t--brand-grey-500: #657d91;\n\t--brand-grey-600: #4c6273;\n\t--brand-grey-700: #405261;\n\t--brand-grey-800: #37434e;\n\t--brand-grey-900: #2d353d;\n\t--brand-grey-950: #1f262d;\n\t--brand-sea-50: #e8f1ff;\n\t--brand-sea-100: #c7defe;\n\t--brand-sea-200: #a5c9ff;\n\t--brand-sea-300: #7ab3ff;\n\t--brand-sea-400: #4084ff;\n\t--brand-sea-500: #2f45ff;\n\t--brand-sea-600: #2d2fff;\n\t--brand-sea-700: #0000ff;\n\t--brand-sea-800: #0609cd;\n\t--brand-sea-900: #001699;\n\t--brand-sea-950: #0a0b5c;\n\t--brand-sky-50: #eafffe;\n\t--brand-sky-100: #cdfffb;\n\t--brand-sky-200: #a3f8ff;\n\t--brand-sky-300: #6af5ff;\n\t--brand-sky-400: #00edff;\n\t--brand-sky-500: #00c8e0;\n\t--brand-sky-600: #00a6c0;\n\t--brand-sky-700: #03839b;\n\t--brand-sky-800: #0d697d;\n\t--brand-sky-900: #105669;\n\t--brand-sky-950: #033949;\n\t--brand-land-50: #f4ffe5;\n\t--brand-land-100: #e0ffb7;\n\t--brand-land-200: #caff95;\n\t--brand-land-300: #b7fe59;\n\t--brand-land-400: #9cf820;\n\t--brand-land-500: #71e618;\n\t--brand-land-600: #56c900;\n\t--brand-land-700: #2d8c00;\n\t--brand-land-800: #31690b;\n\t--brand-land-900: #2a580f;\n\t--brand-land-950: #123201;\n\t--brand-orange-50: #fff8ec;\n\t--brand-orange-100: #ffebd7;\n\t--brand-orange-200: #ffe3c6;\n\t--brand-orange-300: #ffc182;\n\t--brand-orange-400: #ff972e;\n\t--brand-orange-500: #ff800a;\n\t--brand-orange-600: #ff6700;\n\t--brand-orange-700: #ff3700;\n\t--brand-orange-800: #a02b0b;\n\t--brand-orange-900: #80250b;\n\t--brand-orange-950: #461604;\n\t--brand-yellow-50: #ffffea;\n\t--brand-yellow-100: #fffdca;\n\t--brand-yellow-200: #fff2a0;\n\t--brand-yellow-300: #ffeb72;\n\t--brand-yellow-400: #ffd333;\n\t--brand-yellow-500: #ffc200;\n\t--brand-yellow-600: #ffad00;\n\t--brand-yellow-700: #c68601;\n\t--brand-yellow-800: #8f6307;\n\t--brand-yellow-900: #5f430a;\n\t--brand-yellow-950: #442e00;\n\t--brand-purple-50: #faf0ff;\n\t--brand-purple-100: #f4ddff;\n\t--brand-purple-200: #e5cdff;\n\t--brand-purple-300: #ccafff;\n\t--brand-purple-400: #b891ff;\n\t--brand-purple-500: #7d48ff;\n\t--brand-purple-600: #6a14ff;\n\t--brand-purple-700: #5600f1;\n\t--brand-purple-800: #4d01d6;\n\t--brand-purple-900: #4003af;\n\t--brand-purple-950: #1e007c;\n\t--brand-magenta-50: #fef1fc;\n\t--brand-magenta-100: #ffdcef;\n\t--brand-magenta-200: #ffcae6;\n\t--brand-magenta-300: #ff90cb;\n\t--brand-magenta-400: #ff61ca;\n\t--brand-magenta-500: #ff3ac2;\n\t--brand-magenta-600: #f012aa;\n\t--brand-magenta-700: #df059b;\n\t--brand-magenta-800: #9b0069;\n\t--brand-magenta-900: #790a55;\n\t--brand-magenta-950: #58003a;\n\t--brand-white-0: #ffffff;\n\t--product-red-400: #ff474a;\n\t--product-red-500: #df0529;\n\n\t/* Non-brand semantic aliases */\n\t--core-drop-shadow-light: #0339491a;\n\t--core-drop-shadow-dark: #0000007a;\n\t--core-surface-coverup-translucent-light: #1f262d52;\n\t--core-surface-coverup-translucent-dark: #0000007a;\n\t--core-surface-overlay-translucent-light: #ffffffcc;\n\t--core-surface-overlay-translucent-dark: #1f262dcc;\n\t--scroll-bar-light: #e3e8ef;\n\t--scroll-bar-dark: rgba(255, 255, 255, 0.1);\n\t--scroll-bar-hover-light: #cdd5df;\n\t--scroll-bar-hover-dark: rgba(255, 255, 255, 0.15);\n\t--surface-shadow-soft-light: 0px 4px 24px #0339491a;\n\t--surface-shadow-soft-dark: 0px 4px 24px #0000007a;\n\t--surface-shadow-strong-light: 0px 4px 64px #0339491a;\n\t--surface-shadow-strong-dark: 0px 4px 64px #0000007a;\n}\n\n/* Root-level token needed for global viewport backgrounds */\n:root[data-slice-theme="lightMode"] {\n\t--core-surface-primary: #ffffff;\n}\n\n/* Light theme tokens */\n:root[data-slice-theme="lightMode"] [data-slice-theme-scope] {\n\t--array-land: var(--brand-land-100);\n\t--array-land-label: var(--brand-land-600);\n\t--array-magenta: var(--brand-magenta-100);\n\t--array-magenta-label: var(--brand-magenta-600);\n\t--array-orange: var(--brand-orange-100);\n\t--array-orange-label: var(--brand-orange-600);\n\t--array-purple: var(--brand-purple-100);\n\t--array-purple-label: var(--brand-purple-600);\n\t--array-sea: var(--brand-sea-100);\n\t--array-sea-label: var(--brand-sea-600);\n\t--array-sky: var(--brand-sky-100);\n\t--array-sky-label: var(--brand-sky-600);\n\t--array-yellow: var(--brand-yellow-100);\n\t--array-yellow-label: var(--brand-yellow-600);\n\t--core-badge-primary: var(--brand-sea-500);\n\t--core-badge-secondary: var(--brand-grey-100);\n\t--core-button-disabled: var(--brand-grey-50);\n\t--core-button-primary: var(--brand-sea-500);\n\t--core-drop-shadow: var(--core-drop-shadow-light);\n\t--core-gp-logo-primary: var(--brand-sea-700);\n\t--core-gp-logo-secondary: var(--brand-grey-950);\n\t--core-icon-dark: var(--brand-grey-950);\n\t--core-icon-disabled: var(--brand-grey-300);\n\t--core-icon-error: var(--product-red-500);\n\t--core-icon-light: var(--brand-white-0);\n\t--core-icon-primary: var(--brand-grey-950);\n\t--core-icon-secondary: var(--brand-grey-700);\n\t--core-icon-tertiary: var(--brand-sea-500);\n\t--core-outline-secondary: var(--brand-grey-100);\n\t--core-outline-primary: var(--brand-grey-100);\n\t--core-outline-special: var(--brand-sea-100);\n\t--core-outline-tertiary: var(--brand-sea-500);\n\t--core-surface-coverup-translucent: var(\n\t\t--core-surface-coverup-translucent-light\n\t);\n\t--core-surface-overlay-translucent: var(\n\t\t--core-surface-overlay-translucent-light\n\t);\n\t--core-surface-primary: var(--brand-white-0);\n\t--core-surface-secondary: var(--brand-grey-50);\n\t--core-surface-special: var(--brand-sea-50);\n\t--core-text-dark: var(--brand-grey-950);\n\t--core-text-disabled: var(--brand-grey-300);\n\t--core-text-error: var(--product-red-500);\n\t--core-text-light: var(--brand-white-0);\n\t--core-text-primary: var(--brand-grey-950);\n\t--core-text-secondary: var(--brand-grey-700);\n\t--core-text-tertiary: var(--brand-grey-600);\n\t--core-text-special: var(--brand-sea-500);\n\t--core-link-primary: var(--brand-sea-700);\n\t--eor-tag-employee: var(--brand-sky-700);\n\t--eor-tag-overdue: var(--product-red-500);\n\t--eor-tag-paid: var(--brand-land-700);\n\t--eor-tag-pending: var(--brand-orange-500);\n\t--eor-tag-professional: var(--brand-sea-500);\n\t--feedback-attention: var(--brand-yellow-500);\n\t--feedback-informative: var(--brand-sky-700);\n\t--feedback-positive: var(--brand-land-700);\n\t--feedback-urgency: var(--brand-orange-500);\n\t--feedback-warning: var(--product-red-500);\n\t--gia-tag-risk-high: var(--product-red-500);\n\t--gia-tag-risk-low: var(--brand-sky-700);\n\t--gia-tag-risk-moderate: var(--brand-orange-500);\n\t--gia-text-excerpt-highlight: var(--brand-orange-100);\n\t--gia-text-selection: var(--brand-sea-100);\n\t--scroll-bar: var(--scroll-bar-light);\n\t--scroll-bar-hover: var(--scroll-bar-hover-light);\n\t--surface-shadow-soft: var(--surface-shadow-soft-light);\n\t--surface-shadow-strong: var(--surface-shadow-strong-light);\n}\n\n/* Root-level token needed for global viewport backgrounds */\n:root[data-slice-theme="darkMode"] {\n\t--core-surface-primary: #1f262d;\n}\n\n/* Dark theme tokens */\n:root[data-slice-theme="darkMode"] [data-slice-theme-scope] {\n\t--array-land: var(--brand-land-100);\n\t--array-land-label: var(--brand-land-600);\n\t--array-magenta: var(--brand-magenta-100);\n\t--array-magenta-label: var(--brand-magenta-600);\n\t--array-orange: var(--brand-orange-100);\n\t--array-orange-label: var(--brand-orange-600);\n\t--array-purple: var(--brand-purple-100);\n\t--array-purple-label: var(--brand-purple-600);\n\t--array-sea: var(--brand-sea-100);\n\t--array-sea-label: var(--brand-sea-600);\n\t--array-sky: var(--brand-sky-100);\n\t--array-sky-label: var(--brand-sky-600);\n\t--array-yellow: var(--brand-yellow-100);\n\t--array-yellow-label: var(--brand-yellow-600);\n\t--core-badge-primary: var(--brand-sea-500);\n\t--core-badge-secondary: var(--brand-grey-700);\n\t--core-button-disabled: var(--brand-grey-900);\n\t--core-button-primary: var(--brand-sea-500);\n\t--core-drop-shadow: var(--core-drop-shadow-dark);\n\t--core-gp-logo-primary: var(--brand-sea-500);\n\t--core-gp-logo-secondary: var(--brand-white-0);\n\t--core-icon-dark: var(--brand-grey-950);\n\t--core-icon-disabled: var(--brand-grey-500);\n\t--core-icon-error: var(--product-red-400);\n\t--core-icon-light: var(--brand-white-0);\n\t--core-icon-primary: var(--brand-white-0);\n\t--core-icon-secondary: var(--brand-grey-200);\n\t--core-icon-tertiary: var(--brand-sky-300);\n\t--core-outline-secondary: var(--brand-grey-900);\n\t--core-outline-primary: var(--brand-grey-700);\n\t--core-outline-special: var(--brand-sky-300);\n\t--core-outline-tertiary: var(--brand-sky-300);\n\t--core-surface-coverup-translucent: var(\n\t\t--core-surface-coverup-translucent-dark\n\t);\n\t--core-surface-overlay-translucent: var(\n\t\t--core-surface-overlay-translucent-dark\n\t);\n\t--core-surface-primary: var(--brand-grey-950);\n\t--core-surface-secondary: var(--brand-grey-900);\n\t--core-surface-special: var(--brand-sky-950);\n\t--core-text-dark: var(--brand-grey-950);\n\t--core-text-disabled: var(--brand-grey-500);\n\t--core-text-error: var(--product-red-400);\n\t--core-text-light: var(--brand-white-0);\n\t--core-text-primary: var(--brand-white-0);\n\t--core-text-secondary: var(--brand-grey-200);\n\t--core-text-tertiary: var(--brand-grey-400);\n\t--core-text-special: var(--brand-sky-300);\n\t--core-link-primary: var(--brand-sky-300);\n\t--eor-tag-employee: var(--brand-sky-700);\n\t--eor-tag-overdue: var(--product-red-400);\n\t--eor-tag-paid: var(--brand-land-700);\n\t--eor-tag-pending: var(--brand-orange-500);\n\t--eor-tag-professional: var(--brand-sea-500);\n\t--feedback-attention: var(--brand-yellow-400);\n\t--feedback-informative: var(--brand-sky-600);\n\t--feedback-positive: var(--brand-land-700);\n\t--feedback-urgency: var(--brand-orange-500);\n\t--feedback-warning: var(--product-red-400);\n\t--gia-tag-risk-high: var(--product-red-400);\n\t--gia-tag-risk-low: var(--brand-sky-600);\n\t--gia-tag-risk-moderate: var(--brand-orange-500);\n\t--gia-text-excerpt-highlight: var(--brand-orange-100);\n\t--gia-text-selection: var(--brand-sea-900);\n\t--scroll-bar: var(--scroll-bar-dark);\n\t--scroll-bar-hover: var(--scroll-bar-hover-dark);\n\t--surface-shadow-soft: var(--surface-shadow-soft-dark);\n\t--surface-shadow-strong: var(--surface-shadow-strong-dark);\n}\n\n/* Theme token text-color utility classes */\n[data-slice-theme-scope] .array-land {\n\tbackground: var(--array-land);\n}\n[data-slice-theme-scope] .array-land-label {\n\tcolor: var(--array-land-label);\n}\n[data-slice-theme-scope] .array-magenta {\n\tbackground: var(--array-magenta);\n}\n[data-slice-theme-scope] .array-magenta-label {\n\tcolor: var(--array-magenta-label);\n}\n[data-slice-theme-scope] .array-orange {\n\tbackground: var(--array-orange);\n}\n[data-slice-theme-scope] .array-orange-label {\n\tcolor: var(--array-orange-label);\n}\n[data-slice-theme-scope] .array-purple {\n\tbackground: var(--array-purple);\n}\n[data-slice-theme-scope] .array-purple-label {\n\tcolor: var(--array-purple-label);\n}\n[data-slice-theme-scope] .array-sea {\n\tbackground: var(--array-sea);\n}\n[data-slice-theme-scope] .array-sea-label {\n\tcolor: var(--array-sea-label);\n}\n[data-slice-theme-scope] .array-sky {\n\tbackground: var(--array-sky);\n}\n[data-slice-theme-scope] .array-sky-label {\n\tcolor: var(--array-sky-label);\n}\n[data-slice-theme-scope] .array-yellow {\n\tbackground: var(--array-yellow);\n}\n[data-slice-theme-scope] .array-yellow-label {\n\tcolor: var(--array-yellow-label);\n}\n[data-slice-theme-scope] .core-badge-primary {\n\tbackground: var(--core-badge-primary);\n}\n[data-slice-theme-scope] .core-badge-secondary {\n\tbackground: var(--core-badge-secondary);\n}\n[data-slice-theme-scope] .core-button-disabled {\n\tbackground: var(--core-button-disabled);\n}\n[data-slice-theme-scope] .core-button-primary {\n\tbackground: var(--core-button-primary);\n}\n[data-slice-theme-scope] .core-drop-shadow {\n\tbox-shadow: var(--core-drop-shadow);\n}\n[data-slice-theme-scope] .core-gp-logo-primary {\n\tcolor: var(--core-gp-logo-primary);\n}\n[data-slice-theme-scope] .core-gp-logo-secondary {\n\tcolor: var(--core-gp-logo-secondary);\n}\n[data-slice-theme-scope] .core-icon-dark {\n\tcolor: var(--core-icon-dark);\n}\n[data-slice-theme-scope] .core-icon-disabled {\n\tcolor: var(--core-icon-disabled);\n}\n[data-slice-theme-scope] .core-icon-error {\n\tcolor: var(--core-icon-error);\n}\n[data-slice-theme-scope] .core-icon-light {\n\tcolor: var(--core-icon-light);\n}\n[data-slice-theme-scope] .core-icon-primary {\n\tcolor: var(--core-icon-primary);\n}\n[data-slice-theme-scope] .core-icon-secondary {\n\tcolor: var(--core-icon-secondary);\n}\n[data-slice-theme-scope] .core-icon-tertiary {\n\tcolor: var(--core-icon-tertiary);\n}\n[data-slice-theme-scope] .core-link-primary {\n\tcolor: var(--core-link-primary);\n}\n[data-slice-theme-scope] .core-outline-primary {\n\tborder-color: var(--core-outline-primary);\n}\n[data-slice-theme-scope] .core-outline-secondary {\n\tborder-color: var(--core-outline-secondary);\n}\n[data-slice-theme-scope] .core-outline-special {\n\tborder-color: var(--core-outline-special);\n}\n[data-slice-theme-scope] .core-outline-tertiary {\n\tborder-color: var(--core-outline-tertiary);\n}\n[data-slice-theme-scope] .core-surface-coverup-translucent {\n\tbackground: var(--core-surface-coverup-translucent);\n}\n[data-slice-theme-scope] .core-surface-overlay-translucent {\n\tbackground: var(--core-surface-overlay-translucent);\n}\n[data-slice-theme-scope] .core-surface-primary {\n\tbackground: var(--core-surface-primary);\n}\n[data-slice-theme-scope] .core-surface-secondary {\n\tbackground: var(--core-surface-secondary);\n}\n[data-slice-theme-scope] .core-surface-special {\n\tbackground: var(--core-surface-special);\n}\n[data-slice-theme-scope] .core-text-dark {\n\tcolor: var(--core-text-dark);\n}\n[data-slice-theme-scope] .core-text-disabled {\n\tcolor: var(--core-text-disabled);\n}\n[data-slice-theme-scope] .core-text-error {\n\tcolor: var(--core-text-error);\n}\n[data-slice-theme-scope] .core-text-light {\n\tcolor: var(--core-text-light);\n}\n[data-slice-theme-scope] .core-text-primary {\n\tcolor: var(--core-text-primary);\n}\n[data-slice-theme-scope] .core-text-secondary {\n\tcolor: var(--core-text-secondary);\n}\n[data-slice-theme-scope] .core-text-special {\n\tcolor: var(--core-text-special);\n}\n[data-slice-theme-scope] .core-text-tertiary {\n\tcolor: var(--core-text-tertiary);\n}\n[data-slice-theme-scope] .eor-tag-employee {\n\tcolor: var(--eor-tag-employee);\n}\n[data-slice-theme-scope] .eor-tag-overdue {\n\tcolor: var(--eor-tag-overdue);\n}\n[data-slice-theme-scope] .eor-tag-paid {\n\tcolor: var(--eor-tag-paid);\n}\n[data-slice-theme-scope] .eor-tag-pending {\n\tcolor: var(--eor-tag-pending);\n}\n[data-slice-theme-scope] .eor-tag-professional {\n\tcolor: var(--eor-tag-professional);\n}\n[data-slice-theme-scope] .feedback-attention {\n\tcolor: var(--feedback-attention);\n}\n[data-slice-theme-scope] .feedback-informative {\n\tcolor: var(--feedback-informative);\n}\n[data-slice-theme-scope] .feedback-positive {\n\tcolor: var(--feedback-positive);\n}\n[data-slice-theme-scope] .feedback-urgency {\n\tcolor: var(--feedback-urgency);\n}\n[data-slice-theme-scope] .feedback-warning {\n\tcolor: var(--feedback-warning);\n}\n[data-slice-theme-scope] .gia-tag-risk-high {\n\tcolor: var(--gia-tag-risk-high);\n}\n[data-slice-theme-scope] .gia-tag-risk-low {\n\tcolor: var(--gia-tag-risk-low);\n}\n[data-slice-theme-scope] .gia-tag-risk-moderate {\n\tcolor: var(--gia-tag-risk-moderate);\n}\n[data-slice-theme-scope] .gia-text-excerpt-highlight {\n\tcolor: var(--gia-text-excerpt-highlight);\n}\n[data-slice-theme-scope] .gia-text-selection {\n\tcolor: var(--gia-text-selection);\n}\n[data-slice-theme-scope] .scroll-bar {\n\tcolor: var(--scroll-bar);\n}\n[data-slice-theme-scope] .scroll-bar-hover {\n\tcolor: var(--scroll-bar-hover);\n}\n[data-slice-theme-scope] .surface-shadow-soft {\n\tcolor: var(--surface-shadow-soft);\n}\n[data-slice-theme-scope] .surface-shadow-strong {\n\tcolor: var(--surface-shadow-strong);\n}\n\n[data-slice-theme-scope] {\n\tbackground: var(--core-surface-primary);\n}\n\n[data-slice-theme-scope] a {\n\tcolor: var(--core-text-special);\n\ttext-decoration: underline;\n}\n\n[data-slice-theme-scope] a:visited {\n\tcolor: var(--core-text-special);\n\ttext-decoration: underline;\n}\n\n[data-slice-theme-scope] a:hover {\n\ttext-decoration: none;\n}\n\n[data-slice-theme-scope] code {\n\tborder: 1px solid var(--core-outline-primary);\n\tbackground: var(--core-surface-secondary);\n\tcolor: var(--core-text-primary);\n}\n');
21
21
 
22
22
  styleInject("[data-slice-theme-scope] {\n\t--elevation-below-surface: -100;\n\t--elevation-surface: 0;\n\t--elevation-float: 100;\n\t--elevation-describe: 200;\n\t--elevation-status: 300;\n\t--elevation-notify: 400;\n\t--elevation-overlay: 500;\n\t--elevation-confirm: 600;\n}\n");
23
23
 
@@ -30,46 +30,63 @@ styleInject("[data-slice-theme-scope] {\n\t--motion-magnet: cubic-bezier(0.352,
30
30
  styleInject('.slice-global-body {\n\t/* apply themed background color */\n\tbackground-color: var(--core-surface-primary);\n\t/* remove gaps */\n\tmargin: 0;\n\tpadding: 0;\n\t/* base medium body font style with pref. for theme google font */\n\tfont-family: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",\n\t\tRoboto, Helvetica, Arial, sans-serif;\n\tfont-weight: 360;\n\tfont-size: 15px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n\t-webkit-font-smoothing: antialiased;\n}\n');
31
31
 
32
32
  const ThemeContext = createContext({
33
- initialTheme: lightTheme.name
33
+ initialTheme: lightTheme.name,
34
+ systemTheme: !0,
35
+ setSystemTheme: () => {}
34
36
  });
35
37
 
36
38
  function useThemeContext() {
37
39
  return useContext(ThemeContext);
38
40
  }
39
41
 
40
- function setDocumentTheme(name) {
42
+ function resolveTheme(theme, system) {
43
+ if (theme) return theme.includes("dark") ? darkTheme : lightTheme;
44
+ }
45
+
46
+ function setDocumentTheme(name, system) {
41
47
  "undefined" != typeof document && (document.documentElement.dataset.sliceTheme = name,
42
- document.cookie = `slice-theme=${encodeURIComponent(name)}; path=/; max-age=31536000; samesite=lax`);
48
+ document.cookie = `slice-theme=${encodeURIComponent(name)}; path=/; max-age=31536000; samesite=lax`,
49
+ document.cookie = `slice-system-theme=${encodeURIComponent(system)}; path=/; max-age=31536000; samesite=lax`);
43
50
  }
44
51
 
45
52
  function ThemeProvider(props) {
46
- const {children: children, theme: theme, system: system, global: global, initialTheme: initialTheme} = props, contextValue = useMemo(() => ({
47
- initialTheme: null != initialTheme ? initialTheme : lightTheme.name
48
- }), [ initialTheme ]);
53
+ const {children: children, theme: theme, system: system, global: global, initialTheme: initialTheme} = props, [systemTheme, setSystemTheme] = useState(null == system || system);
54
+ useEffect(() => {
55
+ setSystemTheme(null == system || system);
56
+ }, [ system ]);
57
+ const contextValue = useMemo(() => ({
58
+ initialTheme: null != initialTheme ? initialTheme : lightTheme.name,
59
+ systemTheme: systemTheme,
60
+ setSystemTheme: setSystemTheme
61
+ }), [ initialTheme, systemTheme ]);
49
62
  return useEffect(() => {
50
- if (theme || initialTheme) {
51
- const newTheme = function(theme) {
52
- if (theme) return theme.includes("dark") ? darkTheme : lightTheme;
53
- }(null != theme ? theme : initialTheme);
63
+ if (theme) {
64
+ setSystemTheme(!1);
65
+ const newTheme = resolveTheme(theme);
66
+ if (!newTheme) return;
67
+ return void setDocumentTheme(newTheme.name, !1);
68
+ }
69
+ if (initialTheme && !systemTheme && "undefined" != typeof document && !document.documentElement.dataset.sliceTheme) {
70
+ const newTheme = resolveTheme(initialTheme);
54
71
  if (!newTheme) return;
55
- setDocumentTheme(newTheme.name);
72
+ setDocumentTheme(newTheme.name, !1);
56
73
  }
57
- }, [ theme, initialTheme ]), useEffect(() => {
58
- if (!system) return;
74
+ }, [ theme, initialTheme, systemTheme ]), useEffect(() => {
75
+ if (!systemTheme) return;
59
76
  const darkModeMediaQuery = "undefined" == typeof globalThis || "function" != typeof globalThis.matchMedia ? null : globalThis.matchMedia("(prefers-color-scheme: dark)");
60
77
  if (!darkModeMediaQuery) return;
61
78
  const handleSystemThemeChange = e => {
62
- if (system) {
63
- setDocumentTheme((e.matches ? darkTheme : lightTheme).name);
79
+ if (systemTheme) {
80
+ setDocumentTheme((e.matches ? darkTheme : lightTheme).name, !0);
64
81
  }
65
82
  };
66
- if (system) {
67
- setDocumentTheme((darkModeMediaQuery.matches ? darkTheme : lightTheme).name);
83
+ if (systemTheme) {
84
+ setDocumentTheme((darkModeMediaQuery.matches ? darkTheme : lightTheme).name, !0);
68
85
  }
69
86
  return darkModeMediaQuery.addEventListener("change", handleSystemThemeChange), () => {
70
87
  darkModeMediaQuery.removeEventListener("change", handleSystemThemeChange);
71
88
  };
72
- }, [ system ]), useEffect(() => {
89
+ }, [ systemTheme ]), useEffect(() => {
73
90
  if (global) {
74
91
  if ("undefined" != typeof document) return document.body.classList.add("slice-global-body"),
75
92
  () => {