@accelint/design-toolkit 9.4.0 → 9.5.0

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 (275) hide show
  1. package/catalog-info.yaml +2 -2
  2. package/dist/components/accordion/group.d.ts +2 -2
  3. package/dist/components/accordion/header.d.ts +2 -2
  4. package/dist/components/accordion/index.d.ts +2 -2
  5. package/dist/components/accordion/panel.d.ts +2 -2
  6. package/dist/components/accordion/styles.module.css +1 -1
  7. package/dist/components/accordion/trigger.d.ts +2 -2
  8. package/dist/components/action-bar/index.d.ts +2 -2
  9. package/dist/components/audio/index.d.ts +104 -0
  10. package/dist/components/audio/index.js +242 -0
  11. package/dist/components/audio/index.js.map +1 -0
  12. package/dist/components/audio/styles.module.css +77 -0
  13. package/dist/components/audio/types.d.ts +45 -0
  14. package/dist/components/audio/types.js +12 -0
  15. package/dist/components/avatar/context.d.ts +4 -4
  16. package/dist/components/avatar/index.d.ts +2 -2
  17. package/dist/components/badge/context.d.ts +4 -4
  18. package/dist/components/badge/index.d.ts +2 -2
  19. package/dist/components/breadcrumbs/index.d.ts +2 -2
  20. package/dist/components/breadcrumbs/item.d.ts +2 -2
  21. package/dist/components/breadcrumbs/styles.module.css +1 -0
  22. package/dist/components/button/__internal__/clear.js +42 -0
  23. package/dist/components/button/__internal__/clear.js.map +1 -0
  24. package/dist/components/button/__internal__/styles.module.css +23 -0
  25. package/dist/components/button/context.d.ts +8 -8
  26. package/dist/components/button/index.d.ts +2 -2
  27. package/dist/components/button/link.d.ts +2 -2
  28. package/dist/components/button/styles.module.css +1 -1
  29. package/dist/components/button/toggle.d.ts +2 -2
  30. package/dist/components/checkbox/context.d.ts +3 -3
  31. package/dist/components/checkbox/group.d.ts +2 -2
  32. package/dist/components/checkbox/index.d.ts +2 -2
  33. package/dist/components/chip/context.d.ts +4 -4
  34. package/dist/components/chip/deletable.d.ts +2 -2
  35. package/dist/components/chip/index.d.ts +2 -2
  36. package/dist/components/chip/list.d.ts +4 -4
  37. package/dist/components/chip/selectable.d.ts +2 -2
  38. package/dist/components/chip/styles.module.css +2 -2
  39. package/dist/components/classification-badge/context.d.ts +4 -4
  40. package/dist/components/classification-badge/index.d.ts +2 -2
  41. package/dist/components/classification-banner/context.d.ts +4 -4
  42. package/dist/components/classification-banner/index.d.ts +2 -2
  43. package/dist/components/clock/index.d.ts +2 -2
  44. package/dist/components/clock/index.js +1 -0
  45. package/dist/components/clock/index.js.map +1 -1
  46. package/dist/components/color-picker/index.d.ts +2 -2
  47. package/dist/components/combobox-field/context.d.ts +4 -4
  48. package/dist/components/combobox-field/index.d.ts +2 -2
  49. package/dist/components/combobox-field/index.js +42 -14
  50. package/dist/components/combobox-field/index.js.map +1 -1
  51. package/dist/components/combobox-field/styles.module.css +15 -3
  52. package/dist/components/combobox-field/types.d.ts +4 -0
  53. package/dist/components/coordinate-field/context.d.ts +6 -6
  54. package/dist/components/coordinate-field/index.d.ts +2 -2
  55. package/dist/components/coordinate-field/index.js +2 -2
  56. package/dist/components/coordinate-field/index.js.map +1 -1
  57. package/dist/components/coordinate-field/segment-configs.js +1 -1
  58. package/dist/components/coordinate-field/segment-configs.js.map +1 -1
  59. package/dist/components/coordinate-field/segment.d.ts +2 -2
  60. package/dist/components/coordinate-field/segment.js +8 -8
  61. package/dist/components/coordinate-field/segment.js.map +1 -1
  62. package/dist/components/coordinate-field/styles.module.css +7 -3
  63. package/dist/components/date-field/index.d.ts +2 -2
  64. package/dist/components/deferred-collection/index.d.ts +2 -2
  65. package/dist/components/details-list/context.d.ts +4 -4
  66. package/dist/components/details-list/index.d.ts +2 -2
  67. package/dist/components/details-list/label.d.ts +2 -2
  68. package/dist/components/details-list/value.d.ts +2 -2
  69. package/dist/components/dialog/content.d.ts +2 -2
  70. package/dist/components/dialog/context.d.ts +2 -2
  71. package/dist/components/dialog/footer.d.ts +2 -2
  72. package/dist/components/dialog/index.d.ts +2 -2
  73. package/dist/components/dialog/title.d.ts +2 -2
  74. package/dist/components/divider/context.d.ts +4 -4
  75. package/dist/components/divider/index.d.ts +2 -2
  76. package/dist/components/drawer/back.d.ts +2 -2
  77. package/dist/components/drawer/close.d.ts +2 -2
  78. package/dist/components/drawer/content.d.ts +2 -2
  79. package/dist/components/drawer/context.d.ts +2 -2
  80. package/dist/components/drawer/footer.d.ts +2 -2
  81. package/dist/components/drawer/header-title.d.ts +2 -2
  82. package/dist/components/drawer/header.d.ts +2 -2
  83. package/dist/components/drawer/header.js +1 -1
  84. package/dist/components/drawer/index.d.ts +2 -2
  85. package/dist/components/drawer/layout-main.d.ts +2 -2
  86. package/dist/components/drawer/layout.d.ts +2 -2
  87. package/dist/components/drawer/menu-item.d.ts +2 -2
  88. package/dist/components/drawer/menu.d.ts +2 -2
  89. package/dist/components/drawer/panel.d.ts +2 -2
  90. package/dist/components/drawer/trigger.d.ts +2 -2
  91. package/dist/components/drawer/view.d.ts +2 -2
  92. package/dist/components/flashcard/index.d.ts +9 -9
  93. package/dist/components/hero/context.d.ts +2 -2
  94. package/dist/components/hero/index.d.ts +2 -2
  95. package/dist/components/hero/subtitle.d.ts +2 -2
  96. package/dist/components/hero/title.d.ts +2 -2
  97. package/dist/components/hotkey/context.d.ts +4 -4
  98. package/dist/components/hotkey/index.d.ts +2 -2
  99. package/dist/components/hotkey/set.d.ts +2 -2
  100. package/dist/components/icon/context.d.ts +4 -4
  101. package/dist/components/icon/index.d.ts +2 -2
  102. package/dist/components/input/context.d.ts +2 -2
  103. package/dist/components/input/index.d.ts +2 -2
  104. package/dist/components/input/index.js +10 -14
  105. package/dist/components/input/index.js.map +1 -1
  106. package/dist/components/kanban/card-body.d.ts +2 -2
  107. package/dist/components/kanban/card-header-actions.d.ts +2 -2
  108. package/dist/components/kanban/card-header-title.d.ts +2 -2
  109. package/dist/components/kanban/card-header.d.ts +2 -2
  110. package/dist/components/kanban/card.d.ts +2 -2
  111. package/dist/components/kanban/column-actions.d.ts +2 -2
  112. package/dist/components/kanban/column-container.d.ts +2 -2
  113. package/dist/components/kanban/column-content.d.ts +2 -2
  114. package/dist/components/kanban/column-header-actions.d.ts +2 -2
  115. package/dist/components/kanban/column-header-drag-handle.d.ts +2 -2
  116. package/dist/components/kanban/column-header-title.d.ts +2 -2
  117. package/dist/components/kanban/column-header.d.ts +2 -2
  118. package/dist/components/kanban/column.d.ts +2 -2
  119. package/dist/components/kanban/context.d.ts +2 -2
  120. package/dist/components/kanban/header-actions.d.ts +2 -2
  121. package/dist/components/kanban/header-search.d.ts +2 -2
  122. package/dist/components/kanban/header-title.d.ts +2 -2
  123. package/dist/components/kanban/header.d.ts +2 -2
  124. package/dist/components/kanban/kanban.d.ts +4 -4
  125. package/dist/components/kanban/styles.module.css +1 -1
  126. package/dist/components/label/context.d.ts +4 -4
  127. package/dist/components/label/index.d.ts +2 -2
  128. package/dist/components/lines/index.d.ts +2 -2
  129. package/dist/components/link/context.d.ts +2 -2
  130. package/dist/components/link/index.d.ts +2 -2
  131. package/dist/components/list/context.d.ts +2 -2
  132. package/dist/components/list/index.d.ts +2 -2
  133. package/dist/components/list/item-content.d.ts +2 -2
  134. package/dist/components/list/item-description.d.ts +2 -2
  135. package/dist/components/list/item-title.d.ts +2 -2
  136. package/dist/components/list/item.d.ts +2 -2
  137. package/dist/components/list/styles.module.css +1 -1
  138. package/dist/components/media-controls/context.d.ts +66 -0
  139. package/dist/components/media-controls/context.js +77 -0
  140. package/dist/components/media-controls/context.js.map +1 -0
  141. package/dist/components/media-controls/index.d.ts +68 -0
  142. package/dist/components/media-controls/index.js +78 -0
  143. package/dist/components/media-controls/index.js.map +1 -0
  144. package/dist/components/media-controls/mute-button.d.ts +47 -0
  145. package/dist/components/media-controls/mute-button.js +73 -0
  146. package/dist/components/media-controls/mute-button.js.map +1 -0
  147. package/dist/components/media-controls/play-button.d.ts +47 -0
  148. package/dist/components/media-controls/play-button.js +71 -0
  149. package/dist/components/media-controls/play-button.js.map +1 -0
  150. package/dist/components/media-controls/playback-rate.d.ts +58 -0
  151. package/dist/components/media-controls/playback-rate.js +114 -0
  152. package/dist/components/media-controls/playback-rate.js.map +1 -0
  153. package/dist/components/media-controls/seek-button.d.ts +60 -0
  154. package/dist/components/media-controls/seek-button.js +116 -0
  155. package/dist/components/media-controls/seek-button.js.map +1 -0
  156. package/dist/components/media-controls/styles.module.css +145 -0
  157. package/dist/components/media-controls/time-display.d.ts +69 -0
  158. package/dist/components/media-controls/time-display.js +95 -0
  159. package/dist/components/media-controls/time-display.js.map +1 -0
  160. package/dist/components/media-controls/time-range.d.ts +46 -0
  161. package/dist/components/media-controls/time-range.js +63 -0
  162. package/dist/components/media-controls/time-range.js.map +1 -0
  163. package/dist/components/media-controls/types.d.ts +122 -0
  164. package/dist/components/media-controls/types.js +12 -0
  165. package/dist/components/media-controls/volume-slider.d.ts +54 -0
  166. package/dist/components/media-controls/volume-slider.js +70 -0
  167. package/dist/components/media-controls/volume-slider.js.map +1 -0
  168. package/dist/components/menu/context.d.ts +2 -2
  169. package/dist/components/menu/index.d.ts +2 -2
  170. package/dist/components/menu/item-description.d.ts +2 -2
  171. package/dist/components/menu/item-label.d.ts +2 -2
  172. package/dist/components/menu/item.d.ts +2 -2
  173. package/dist/components/menu/section.d.ts +2 -2
  174. package/dist/components/menu/separator.d.ts +2 -2
  175. package/dist/components/menu/styles.module.css +1 -1
  176. package/dist/components/menu/submenu.d.ts +2 -2
  177. package/dist/components/notice/index.d.ts +2 -2
  178. package/dist/components/notice/list.d.ts +2 -2
  179. package/dist/components/notice/notice-icon.d.ts +2 -2
  180. package/dist/components/options/context.d.ts +2 -2
  181. package/dist/components/options/index.d.ts +2 -2
  182. package/dist/components/options/item-content.d.ts +2 -2
  183. package/dist/components/options/item-description.d.ts +2 -2
  184. package/dist/components/options/item-label.d.ts +2 -2
  185. package/dist/components/options/item.d.ts +2 -2
  186. package/dist/components/options/section.d.ts +2 -2
  187. package/dist/components/options/styles.module.css +1 -1
  188. package/dist/components/pagination/context.d.ts +2 -2
  189. package/dist/components/pagination/index.d.ts +2 -2
  190. package/dist/components/pagination/next.d.ts +2 -2
  191. package/dist/components/pagination/pages.d.ts +2 -2
  192. package/dist/components/pagination/prev.d.ts +2 -2
  193. package/dist/components/popover/content.d.ts +2 -2
  194. package/dist/components/popover/footer.d.ts +2 -2
  195. package/dist/components/popover/index.d.ts +2 -2
  196. package/dist/components/popover/title.d.ts +2 -2
  197. package/dist/components/popover/trigger.d.ts +2 -2
  198. package/dist/components/query-builder/action-element.d.ts +2 -2
  199. package/dist/components/query-builder/actions.d.ts +4 -4
  200. package/dist/components/query-builder/combinator-selector.d.ts +2 -2
  201. package/dist/components/query-builder/combinator-selector.js +5 -4
  202. package/dist/components/query-builder/combinator-selector.js.map +1 -1
  203. package/dist/components/query-builder/index.d.ts +2 -2
  204. package/dist/components/query-builder/rule-group.d.ts +4 -4
  205. package/dist/components/query-builder/rule.d.ts +2 -2
  206. package/dist/components/query-builder/value-editor.d.ts +2 -2
  207. package/dist/components/query-builder/value-selector.d.ts +2 -2
  208. package/dist/components/radio/context.d.ts +2 -2
  209. package/dist/components/radio/group.d.ts +2 -2
  210. package/dist/components/radio/index.d.ts +2 -2
  211. package/dist/components/search-field/context.d.ts +4 -4
  212. package/dist/components/search-field/index.d.ts +2 -2
  213. package/dist/components/select-field/context.d.ts +4 -4
  214. package/dist/components/select-field/index.d.ts +2 -2
  215. package/dist/components/sidenav/avatar.d.ts +2 -2
  216. package/dist/components/sidenav/content.d.ts +2 -2
  217. package/dist/components/sidenav/context.d.ts +2 -2
  218. package/dist/components/sidenav/footer.d.ts +2 -2
  219. package/dist/components/sidenav/header.d.ts +2 -2
  220. package/dist/components/sidenav/index.d.ts +2 -2
  221. package/dist/components/sidenav/item.d.ts +2 -2
  222. package/dist/components/sidenav/link.d.ts +2 -2
  223. package/dist/components/sidenav/menu-item.d.ts +2 -2
  224. package/dist/components/sidenav/menu.d.ts +2 -2
  225. package/dist/components/sidenav/trigger.d.ts +2 -2
  226. package/dist/components/skeleton/index.d.ts +2 -2
  227. package/dist/components/slider/index.d.ts +2 -2
  228. package/dist/components/status-indicator/index.d.ts +41 -0
  229. package/dist/components/status-indicator/index.js +49 -0
  230. package/dist/components/status-indicator/index.js.map +1 -0
  231. package/dist/components/status-indicator/styles.module.css +34 -0
  232. package/dist/components/status-indicator/types.d.ts +21 -0
  233. package/dist/components/status-indicator/types.js +12 -0
  234. package/dist/components/switch/context.d.ts +2 -2
  235. package/dist/components/switch/index.d.ts +2 -2
  236. package/dist/components/table/body.d.ts +2 -2
  237. package/dist/components/table/cell.d.ts +2 -2
  238. package/dist/components/table/context.d.ts +2 -2
  239. package/dist/components/table/header-cell.d.ts +2 -2
  240. package/dist/components/table/header.d.ts +2 -2
  241. package/dist/components/table/index.d.ts +2 -2
  242. package/dist/components/table/row.d.ts +2 -2
  243. package/dist/components/tabs/context.d.ts +4 -4
  244. package/dist/components/tabs/index.d.ts +2 -2
  245. package/dist/components/tabs/list.d.ts +2 -2
  246. package/dist/components/tabs/panel.d.ts +2 -2
  247. package/dist/components/tabs/tab.d.ts +2 -2
  248. package/dist/components/text-area-field/context.d.ts +4 -4
  249. package/dist/components/text-area-field/index.d.ts +2 -2
  250. package/dist/components/text-field/context.d.ts +4 -4
  251. package/dist/components/text-field/index.d.ts +2 -2
  252. package/dist/components/time-field/index.d.ts +2 -2
  253. package/dist/components/tooltip/context.d.ts +2 -2
  254. package/dist/components/tooltip/index.d.ts +2 -2
  255. package/dist/components/tooltip/styles.module.css +1 -1
  256. package/dist/components/tooltip/trigger.d.ts +2 -2
  257. package/dist/components/tree/context.d.ts +3 -3
  258. package/dist/components/tree/index.d.ts +2 -2
  259. package/dist/components/tree/item-actions.d.ts +2 -2
  260. package/dist/components/tree/item-content.d.ts +2 -2
  261. package/dist/components/tree/item-description.d.ts +2 -2
  262. package/dist/components/tree/item-label.d.ts +2 -2
  263. package/dist/components/tree/item-prefix-icon.d.ts +2 -2
  264. package/dist/components/tree/item.d.ts +2 -2
  265. package/dist/components/tree/lines.d.ts +2 -2
  266. package/dist/components/tree/styles.module.css +1 -1
  267. package/dist/components/view-stack/context.d.ts +2 -2
  268. package/dist/components/view-stack/index.d.ts +2 -2
  269. package/dist/components/view-stack/trigger.d.ts +2 -2
  270. package/dist/components/view-stack/view.d.ts +2 -2
  271. package/dist/index.d.ts +15 -1
  272. package/dist/index.js +12 -1
  273. package/dist/providers/portal.d.ts +2 -2
  274. package/dist/providers/theme-provider.d.ts +2 -2
  275. package/package.json +20 -5
@@ -0,0 +1,116 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ 'use client';
15
+
16
+ import { Icon } from "../icon/index.js";
17
+ import { Button } from "../button/index.js";
18
+ import { useMediaControlsDisabled } from "./context.js";
19
+ import "client-only";
20
+ import { useCallback } from "react";
21
+ import { jsx } from "react/jsx-runtime";
22
+ import { getLogger } from "@accelint/logger/default";
23
+ import { MediaActionTypes, useMediaDispatch, useMediaSelector } from "media-chrome/react/media-store";
24
+ import { FastForward, FastRewind } from "@accelint/icons";
25
+
26
+ //#region src/components/media-controls/seek-button.tsx
27
+ const logger = getLogger({
28
+ enabled: process.env.NODE_ENV === "development",
29
+ level: "warn",
30
+ prefix: "[SeekButton]",
31
+ pretty: true
32
+ });
33
+ /** Default seek distance in seconds. */
34
+ const DEFAULT_SEEK_OFFSET = 10;
35
+ /**
36
+ * Validates that value is a positive finite number.
37
+ *
38
+ * @param value - The number to validate.
39
+ * @returns True if the value is positive and finite.
40
+ */
41
+ function isPositiveFinite(value) {
42
+ return Number.isFinite(value) && value > 0;
43
+ }
44
+ /**
45
+ * A media control button for seeking forward or backward.
46
+ *
47
+ * Integrates with media-chrome's media store to seek the media playback position.
48
+ * Can be configured to seek forward or backward with a customizable time offset.
49
+ * Invalid seekOffset values (negative, zero, NaN, Infinity) automatically fall back
50
+ * to the default of 10 seconds.
51
+ *
52
+ * @param props - The button props.
53
+ * @param props.className - CSS class name for the button.
54
+ * @param props.direction - Direction to seek ('forward' or 'backward').
55
+ * @param props.seekOffset - Number of seconds to seek (default: 10). Must be a positive finite number.
56
+ * @param props.isDisabled - Whether the button is disabled.
57
+ * @param props.ref - Ref to the button element.
58
+ * @returns The rendered seek button.
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * // Basic usage within MediaProvider
63
+ * <MediaProvider>
64
+ * <SeekButton direction="backward" />
65
+ * <SeekButton direction="forward" />
66
+ * </MediaProvider>
67
+ * ```
68
+ *
69
+ * @example
70
+ * ```tsx
71
+ * // With custom seek offset (30 seconds)
72
+ * <SeekButton direction="forward" seekOffset={30} />
73
+ * ```
74
+ */
75
+ function SeekButton({ className, direction, seekOffset: seekOffsetProp = DEFAULT_SEEK_OFFSET, isDisabled: isDisabledProp, ref, ...rest }) {
76
+ const dispatch = useMediaDispatch();
77
+ const mediaCurrentTime = useMediaSelector((state) => state.mediaCurrentTime);
78
+ const mediaDuration = useMediaSelector((state) => state.mediaDuration);
79
+ const isDisabledFromContext = useMediaControlsDisabled(isDisabledProp);
80
+ const seekOffset = isPositiveFinite(seekOffsetProp) ? seekOffsetProp : DEFAULT_SEEK_OFFSET;
81
+ if (seekOffset !== seekOffsetProp) logger.warn(`Invalid seekOffset "${seekOffsetProp}", using default (${DEFAULT_SEEK_OFFSET}).`);
82
+ const isDisabled = isDisabledFromContext || !(mediaDuration != null && mediaDuration > 0 && mediaCurrentTime != null);
83
+ const handleClick = useCallback(() => {
84
+ if (mediaCurrentTime == null || mediaDuration == null) return;
85
+ const delta = direction === "forward" ? seekOffset : -seekOffset;
86
+ const targetTime = Math.max(0, Math.min(mediaDuration, mediaCurrentTime + delta));
87
+ dispatch({
88
+ type: MediaActionTypes.MEDIA_SEEK_REQUEST,
89
+ detail: targetTime
90
+ });
91
+ }, [
92
+ mediaCurrentTime,
93
+ mediaDuration,
94
+ direction,
95
+ seekOffset,
96
+ dispatch
97
+ ]);
98
+ return /* @__PURE__ */ jsx(Button, {
99
+ ...rest,
100
+ ref,
101
+ className,
102
+ variant: "icon",
103
+ size: "medium",
104
+ isDisabled,
105
+ onPress: handleClick,
106
+ "aria-label": `Seek ${direction} ${seekOffset} seconds`,
107
+ children: /* @__PURE__ */ jsx(Icon, {
108
+ size: "medium",
109
+ children: direction === "forward" ? /* @__PURE__ */ jsx(FastForward, {}) : /* @__PURE__ */ jsx(FastRewind, {})
110
+ })
111
+ });
112
+ }
113
+
114
+ //#endregion
115
+ export { SeekButton };
116
+ //# sourceMappingURL=seek-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seek-button.js","names":[],"sources":["../../../src/components/media-controls/seek-button.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useCallback } from 'react';\nimport { FastForward, FastRewind } from '@accelint/icons';\nimport { getLogger } from '@accelint/logger/default';\nimport {\n MediaActionTypes,\n useMediaDispatch,\n useMediaSelector,\n} from 'media-chrome/react/media-store';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { useMediaControlsDisabled } from './context';\nimport type { SeekButtonProps } from './types';\n\nconst logger = getLogger({\n enabled: process.env.NODE_ENV === 'development',\n level: 'warn',\n prefix: '[SeekButton]',\n pretty: true,\n});\n\n/** Default seek distance in seconds. */\nconst DEFAULT_SEEK_OFFSET = 10;\n\n/**\n * Validates that value is a positive finite number.\n *\n * @param value - The number to validate.\n * @returns True if the value is positive and finite.\n */\nfunction isPositiveFinite(value: number): boolean {\n return Number.isFinite(value) && value > 0;\n}\n\n/**\n * A media control button for seeking forward or backward.\n *\n * Integrates with media-chrome's media store to seek the media playback position.\n * Can be configured to seek forward or backward with a customizable time offset.\n * Invalid seekOffset values (negative, zero, NaN, Infinity) automatically fall back\n * to the default of 10 seconds.\n *\n * @param props - The button props.\n * @param props.className - CSS class name for the button.\n * @param props.direction - Direction to seek ('forward' or 'backward').\n * @param props.seekOffset - Number of seconds to seek (default: 10). Must be a positive finite number.\n * @param props.isDisabled - Whether the button is disabled.\n * @param props.ref - Ref to the button element.\n * @returns The rendered seek button.\n *\n * @example\n * ```tsx\n * // Basic usage within MediaProvider\n * <MediaProvider>\n * <SeekButton direction=\"backward\" />\n * <SeekButton direction=\"forward\" />\n * </MediaProvider>\n * ```\n *\n * @example\n * ```tsx\n * // With custom seek offset (30 seconds)\n * <SeekButton direction=\"forward\" seekOffset={30} />\n * ```\n */\nexport function SeekButton({\n className,\n direction,\n seekOffset: seekOffsetProp = DEFAULT_SEEK_OFFSET,\n isDisabled: isDisabledProp,\n ref,\n ...rest\n}: SeekButtonProps) {\n const dispatch = useMediaDispatch();\n const mediaCurrentTime = useMediaSelector((state) => state.mediaCurrentTime);\n const mediaDuration = useMediaSelector((state) => state.mediaDuration);\n const isDisabledFromContext = useMediaControlsDisabled(isDisabledProp);\n\n // Validate and resolve seekOffset\n const seekOffset = isPositiveFinite(seekOffsetProp)\n ? seekOffsetProp\n : DEFAULT_SEEK_OFFSET;\n\n if (seekOffset !== seekOffsetProp) {\n logger.warn(\n `Invalid seekOffset \"${seekOffsetProp}\", using default (${DEFAULT_SEEK_OFFSET}).`,\n );\n }\n\n // Disable when media not loaded (duration unavailable)\n const isMediaLoaded =\n mediaDuration != null && mediaDuration > 0 && mediaCurrentTime != null;\n const isDisabled = isDisabledFromContext || !isMediaLoaded;\n\n const handleClick = useCallback(() => {\n if (mediaCurrentTime == null || mediaDuration == null) {\n return;\n }\n\n const delta = direction === 'forward' ? seekOffset : -seekOffset;\n const targetTime = Math.max(\n 0,\n Math.min(mediaDuration, mediaCurrentTime + delta),\n );\n dispatch({ type: MediaActionTypes.MEDIA_SEEK_REQUEST, detail: targetTime });\n }, [mediaCurrentTime, mediaDuration, direction, seekOffset, dispatch]);\n\n return (\n <Button\n {...rest}\n ref={ref}\n className={className}\n variant='icon'\n size='medium'\n isDisabled={isDisabled}\n onPress={handleClick}\n aria-label={`Seek ${direction} ${seekOffset} seconds`}\n >\n <Icon size='medium'>\n {direction === 'forward' ? <FastForward /> : <FastRewind />}\n </Icon>\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,SAAS,UAAU;CACvB,SAAS,QAAQ,IAAI,aAAa;CAClC,OAAO;CACP,QAAQ;CACR,QAAQ;CACT,CAAC;;AAGF,MAAM,sBAAsB;;;;;;;AAQ5B,SAAS,iBAAiB,OAAwB;AAChD,QAAO,OAAO,SAAS,MAAM,IAAI,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkC3C,SAAgB,WAAW,EACzB,WACA,WACA,YAAY,iBAAiB,qBAC7B,YAAY,gBACZ,KACA,GAAG,QACe;CAClB,MAAM,WAAW,kBAAkB;CACnC,MAAM,mBAAmB,kBAAkB,UAAU,MAAM,iBAAiB;CAC5E,MAAM,gBAAgB,kBAAkB,UAAU,MAAM,cAAc;CACtE,MAAM,wBAAwB,yBAAyB,eAAe;CAGtE,MAAM,aAAa,iBAAiB,eAAe,GAC/C,iBACA;AAEJ,KAAI,eAAe,eACjB,QAAO,KACL,uBAAuB,eAAe,oBAAoB,oBAAoB,IAC/E;CAMH,MAAM,aAAa,yBAAyB,EAD1C,iBAAiB,QAAQ,gBAAgB,KAAK,oBAAoB;CAGpE,MAAM,cAAc,kBAAkB;AACpC,MAAI,oBAAoB,QAAQ,iBAAiB,KAC/C;EAGF,MAAM,QAAQ,cAAc,YAAY,aAAa,CAAC;EACtD,MAAM,aAAa,KAAK,IACtB,GACA,KAAK,IAAI,eAAe,mBAAmB,MAAM,CAClD;AACD,WAAS;GAAE,MAAM,iBAAiB;GAAoB,QAAQ;GAAY,CAAC;IAC1E;EAAC;EAAkB;EAAe;EAAW;EAAY;EAAS,CAAC;AAEtE,QACE,oBAAC;EACC,GAAI;EACC;EACM;EACX,SAAQ;EACR,MAAK;EACO;EACZ,SAAS;EACT,cAAY,QAAQ,UAAU,GAAG,WAAW;YAE5C,oBAAC;GAAK,MAAK;aACR,cAAc,YAAY,oBAAC,gBAAc,GAAG,oBAAC,eAAa;IACtD;GACA"}
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ @reference '@accelint/design-foundation/styles';
14
+
15
+ @layer components.l1 {
16
+ .mediaControls {
17
+ @apply p-s flex items-center;
18
+
19
+ @variant disabled {
20
+ @apply opacity-50;
21
+ }
22
+ }
23
+
24
+ .volumeSlider {
25
+ @apply gap-s flex items-center;
26
+
27
+ @variant disabled {
28
+ @apply cursor-not-allowed opacity-50;
29
+ }
30
+ }
31
+
32
+ .volumeLabel {
33
+ @apply fg-primary-muted text-body-s;
34
+ }
35
+
36
+ .volumeRange {
37
+ @apply h-xxs w-full;
38
+ --media-range-track-height: 2px;
39
+ --media-range-track-border-radius: 2px;
40
+ --media-range-padding: 0;
41
+
42
+ /* Filled track (accent color) */
43
+ --media-range-bar-color: var(--bg-accent-primary-bold);
44
+
45
+ /* Thumb styling */
46
+ --media-range-thumb-height: 12px;
47
+ --media-range-thumb-width: 12px;
48
+ --media-range-thumb-border-radius: var(--radius-round);
49
+ --media-range-thumb-background: var(--fg-accent-primary-bold);
50
+
51
+ &::part(thumb) {
52
+ transition: transform 150ms ease;
53
+
54
+ &:hover {
55
+ transform: scale(1.2);
56
+ }
57
+ }
58
+
59
+ @variant disabled {
60
+ --media-range-bar-color: var(--bg-disabled-bold);
61
+ --media-range-thumb-background: var(--fg-disabled-secondary);
62
+ }
63
+ }
64
+
65
+ .timeRange {
66
+ @apply flex w-full grow items-center;
67
+ }
68
+
69
+ .timeRangeInput {
70
+ @apply w-full;
71
+
72
+ /* Track */
73
+ --media-control-background: var(--bg-surface-raised);
74
+ --media-control-hover-background: var(--bg-surface-raised);
75
+ --media-range-track-height: 4px;
76
+ --media-range-track-border-radius: 2px;
77
+ --media-range-bar-color: var(--bg-accent-primary-bold);
78
+ --media-range-padding: 0;
79
+
80
+ /* Thumb (playhead) */
81
+ --media-range-thumb-height: 16px;
82
+ --media-range-thumb-width: 4px;
83
+ --media-range-thumb-border-radius: var(--radius-round);
84
+ --media-range-thumb-background: var(--fg-accent-primary-bold);
85
+
86
+ /* Hide built-in preview tooltip */
87
+ --media-preview-box-display: none;
88
+ --media-box-arrow-display: none;
89
+ --media-text-color: var(--fg-primary-bold);
90
+ --media-primary-color: var(--fg-primary-bold);
91
+
92
+ &::part(thumb) {
93
+ &:hover {
94
+ background-color: var(--fg-accent-primary-hover);
95
+ }
96
+
97
+ &:focus-visible {
98
+ background-color: var(--fg-accent-primary-hover);
99
+ outline: 2px solid var(--outline-interactive-hover);
100
+ outline-offset: 2px;
101
+ }
102
+
103
+ &:active {
104
+ background-color: var(--fg-accent-primary-pressed);
105
+ }
106
+ }
107
+
108
+ &[disabled]::part(thumb) {
109
+ background-color: var(--fg-disabled);
110
+ cursor: not-allowed;
111
+ }
112
+ }
113
+
114
+ .timeDisplay {
115
+ --media-text-background: var(--bg-surface-raised);
116
+ @apply flex items-center;
117
+
118
+ @variant disabled {
119
+ @apply opacity-50;
120
+ }
121
+ }
122
+
123
+ .timeDisplayText {
124
+ @apply fg-primary-bold text-body-s tabular-nums;
125
+ }
126
+
127
+ .playbackRate {
128
+ @apply flex items-center;
129
+ }
130
+
131
+ .playbackRateText {
132
+ @apply fg-primary-muted text-body-s tabular-nums;
133
+ }
134
+
135
+ .currentTimeDisplay {
136
+ @apply text-body-xs fg-primary-bold tabular-nums opacity-0 transition-opacity duration-150;
137
+ --media-time-display-background: var(--bg-surface-raised);
138
+ --media-time-display-padding: var(--spacing-xs) var(--spacing-s);
139
+ --media-time-display-border-radius: var(--radius-s);
140
+
141
+ .timeRangeInput:hover & {
142
+ @apply opacity-100;
143
+ }
144
+ }
145
+ }
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { TimeDisplayProps } from "./types.js";
14
+ import "client-only";
15
+ import * as react_jsx_runtime69 from "react/jsx-runtime";
16
+
17
+ //#region src/components/media-controls/time-display.d.ts
18
+
19
+ /**
20
+ * A media control component for displaying time information.
21
+ *
22
+ * Wraps media-chrome's time display components with DTK styling.
23
+ * Can show current time, remaining time, or total duration.
24
+ * Shows placeholder text until media metadata is loaded.
25
+ *
26
+ * @param props - The display props.
27
+ * @param props.className - CSS class name for the container.
28
+ * @param props.placeholder - Placeholder text before media loads (default: 'hh:mm:ss').
29
+ * @param props.isDisabled - Whether the display is disabled.
30
+ * @param props.mode - Display mode ('current', 'remaining', or 'duration').
31
+ * @param props.ref - Ref to the container element.
32
+ * @returns The rendered time display.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * // Basic usage - shows current time
37
+ * <MediaProvider>
38
+ * <TimeDisplay />
39
+ * </MediaProvider>
40
+ * ```
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * // Show total duration
45
+ * <TimeDisplay mode="duration" />
46
+ * ```
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * // Show remaining time
51
+ * <TimeDisplay mode="remaining" />
52
+ * ```
53
+ *
54
+ * @example
55
+ * ```tsx
56
+ * // Custom placeholder
57
+ * <TimeDisplay placeholder="--:--" />
58
+ * ```
59
+ */
60
+ declare function TimeDisplay({
61
+ className,
62
+ placeholder,
63
+ isDisabled: isDisabledProp,
64
+ mode,
65
+ ref
66
+ }: TimeDisplayProps): react_jsx_runtime69.JSX.Element;
67
+ //#endregion
68
+ export { TimeDisplay };
69
+ //# sourceMappingURL=time-display.d.ts.map
@@ -0,0 +1,95 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ 'use client';
15
+
16
+ import { useMediaControlsDisabled } from "./context.js";
17
+ import "client-only";
18
+ import { clsx } from "@accelint/design-foundation/lib/utils";
19
+ import { jsx } from "react/jsx-runtime";
20
+ import { MediaDurationDisplay, MediaTimeDisplay } from "media-chrome/react";
21
+ import { useMediaSelector } from "media-chrome/react/media-store";
22
+ import styles from "./styles.module.css";
23
+
24
+ //#region src/components/media-controls/time-display.tsx
25
+ /**
26
+ * A media control component for displaying time information.
27
+ *
28
+ * Wraps media-chrome's time display components with DTK styling.
29
+ * Can show current time, remaining time, or total duration.
30
+ * Shows placeholder text until media metadata is loaded.
31
+ *
32
+ * @param props - The display props.
33
+ * @param props.className - CSS class name for the container.
34
+ * @param props.placeholder - Placeholder text before media loads (default: 'hh:mm:ss').
35
+ * @param props.isDisabled - Whether the display is disabled.
36
+ * @param props.mode - Display mode ('current', 'remaining', or 'duration').
37
+ * @param props.ref - Ref to the container element.
38
+ * @returns The rendered time display.
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * // Basic usage - shows current time
43
+ * <MediaProvider>
44
+ * <TimeDisplay />
45
+ * </MediaProvider>
46
+ * ```
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * // Show total duration
51
+ * <TimeDisplay mode="duration" />
52
+ * ```
53
+ *
54
+ * @example
55
+ * ```tsx
56
+ * // Show remaining time
57
+ * <TimeDisplay mode="remaining" />
58
+ * ```
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * // Custom placeholder
63
+ * <TimeDisplay placeholder="--:--" />
64
+ * ```
65
+ */
66
+ function TimeDisplay({ className, placeholder = "hh:mm:ss", isDisabled: isDisabledProp, mode = "current", ref }) {
67
+ const mediaDuration = useMediaSelector((state) => state.mediaDuration);
68
+ const isDisabled = useMediaControlsDisabled(isDisabledProp);
69
+ const isLoaded = mediaDuration != null && mediaDuration > 0;
70
+ /**
71
+ * Renders time display content based on load state and mode.
72
+ * Shows placeholder before media loads, then delegates to media-chrome components.
73
+ */
74
+ const renderContent = () => {
75
+ if (!isLoaded) return /* @__PURE__ */ jsx("span", {
76
+ className: styles.timeDisplayText,
77
+ children: placeholder
78
+ });
79
+ if (mode === "duration") return /* @__PURE__ */ jsx(MediaDurationDisplay, { className: styles.timeDisplayText });
80
+ return /* @__PURE__ */ jsx(MediaTimeDisplay, {
81
+ className: styles.timeDisplayText,
82
+ remaining: mode === "remaining" || void 0
83
+ });
84
+ };
85
+ return /* @__PURE__ */ jsx("div", {
86
+ ref,
87
+ className: clsx(styles.timeDisplay, className),
88
+ "data-disabled": isDisabled || void 0,
89
+ children: renderContent()
90
+ });
91
+ }
92
+
93
+ //#endregion
94
+ export { TimeDisplay };
95
+ //# sourceMappingURL=time-display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-display.js","names":[],"sources":["../../../src/components/media-controls/time-display.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { MediaDurationDisplay, MediaTimeDisplay } from 'media-chrome/react';\nimport { useMediaSelector } from 'media-chrome/react/media-store';\nimport { useMediaControlsDisabled } from './context';\nimport styles from './styles.module.css';\nimport type { TimeDisplayProps } from './types';\n\n/**\n * A media control component for displaying time information.\n *\n * Wraps media-chrome's time display components with DTK styling.\n * Can show current time, remaining time, or total duration.\n * Shows placeholder text until media metadata is loaded.\n *\n * @param props - The display props.\n * @param props.className - CSS class name for the container.\n * @param props.placeholder - Placeholder text before media loads (default: 'hh:mm:ss').\n * @param props.isDisabled - Whether the display is disabled.\n * @param props.mode - Display mode ('current', 'remaining', or 'duration').\n * @param props.ref - Ref to the container element.\n * @returns The rendered time display.\n *\n * @example\n * ```tsx\n * // Basic usage - shows current time\n * <MediaProvider>\n * <TimeDisplay />\n * </MediaProvider>\n * ```\n *\n * @example\n * ```tsx\n * // Show total duration\n * <TimeDisplay mode=\"duration\" />\n * ```\n *\n * @example\n * ```tsx\n * // Show remaining time\n * <TimeDisplay mode=\"remaining\" />\n * ```\n *\n * @example\n * ```tsx\n * // Custom placeholder\n * <TimeDisplay placeholder=\"--:--\" />\n * ```\n */\nexport function TimeDisplay({\n className,\n placeholder = 'hh:mm:ss',\n isDisabled: isDisabledProp,\n mode = 'current',\n ref,\n}: TimeDisplayProps) {\n const mediaDuration = useMediaSelector((state) => state.mediaDuration);\n const isDisabled = useMediaControlsDisabled(isDisabledProp);\n const isLoaded = mediaDuration != null && mediaDuration > 0;\n\n /**\n * Renders time display content based on load state and mode.\n * Shows placeholder before media loads, then delegates to media-chrome components.\n */\n const renderContent = () => {\n if (!isLoaded) {\n return <span className={styles.timeDisplayText}>{placeholder}</span>;\n }\n if (mode === 'duration') {\n return <MediaDurationDisplay className={styles.timeDisplayText} />;\n }\n // media-chrome: empty string enables remaining time, undefined shows current\n return (\n <MediaTimeDisplay\n className={styles.timeDisplayText}\n remaining={mode === 'remaining' || undefined}\n />\n );\n };\n\n return (\n <div\n ref={ref}\n className={clsx(styles.timeDisplay, className)}\n data-disabled={isDisabled || undefined}\n >\n {renderContent()}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,YAAY,EAC1B,WACA,cAAc,YACd,YAAY,gBACZ,OAAO,WACP,OACmB;CACnB,MAAM,gBAAgB,kBAAkB,UAAU,MAAM,cAAc;CACtE,MAAM,aAAa,yBAAyB,eAAe;CAC3D,MAAM,WAAW,iBAAiB,QAAQ,gBAAgB;;;;;CAM1D,MAAM,sBAAsB;AAC1B,MAAI,CAAC,SACH,QAAO,oBAAC;GAAK,WAAW,OAAO;aAAkB;IAAmB;AAEtE,MAAI,SAAS,WACX,QAAO,oBAAC,wBAAqB,WAAW,OAAO,kBAAmB;AAGpE,SACE,oBAAC;GACC,WAAW,OAAO;GAClB,WAAW,SAAS,eAAe;IACnC;;AAIN,QACE,oBAAC;EACM;EACL,WAAW,KAAK,OAAO,aAAa,UAAU;EAC9C,iBAAe,cAAc;YAE5B,eAAe;GACZ"}
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { TimeRangeProps } from "./types.js";
14
+ import "client-only";
15
+ import * as react_jsx_runtime71 from "react/jsx-runtime";
16
+
17
+ //#region src/components/media-controls/time-range.d.ts
18
+
19
+ /**
20
+ * A media control slider for seeking through media.
21
+ *
22
+ * Wraps media-chrome's MediaTimeRange component with DTK styling.
23
+ * Shows the current playback position and allows seeking.
24
+ *
25
+ * @param props - The slider props.
26
+ * @param props.className - CSS class name for the container.
27
+ * @param props.isDisabled - Whether the slider is disabled.
28
+ * @param props.ref - Ref to the container element.
29
+ * @returns The rendered time range slider.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * // Basic usage within MediaProvider
34
+ * <MediaProvider>
35
+ * <TimeRange />
36
+ * </MediaProvider>
37
+ * ```
38
+ */
39
+ declare function TimeRange({
40
+ className,
41
+ isDisabled: isDisabledProp,
42
+ ref
43
+ }: TimeRangeProps): react_jsx_runtime71.JSX.Element;
44
+ //#endregion
45
+ export { TimeRange };
46
+ //# sourceMappingURL=time-range.d.ts.map
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ 'use client';
15
+
16
+ import { useMediaControlsDisabled } from "./context.js";
17
+ import "client-only";
18
+ import { clsx } from "@accelint/design-foundation/lib/utils";
19
+ import { jsx } from "react/jsx-runtime";
20
+ import { MediaTimeDisplay, MediaTimeRange } from "media-chrome/react";
21
+ import styles from "./styles.module.css";
22
+
23
+ //#region src/components/media-controls/time-range.tsx
24
+ /**
25
+ * A media control slider for seeking through media.
26
+ *
27
+ * Wraps media-chrome's MediaTimeRange component with DTK styling.
28
+ * Shows the current playback position and allows seeking.
29
+ *
30
+ * @param props - The slider props.
31
+ * @param props.className - CSS class name for the container.
32
+ * @param props.isDisabled - Whether the slider is disabled.
33
+ * @param props.ref - Ref to the container element.
34
+ * @returns The rendered time range slider.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * // Basic usage within MediaProvider
39
+ * <MediaProvider>
40
+ * <TimeRange />
41
+ * </MediaProvider>
42
+ * ```
43
+ */
44
+ function TimeRange({ className, isDisabled: isDisabledProp, ref }) {
45
+ const isDisabled = useMediaControlsDisabled(isDisabledProp);
46
+ return /* @__PURE__ */ jsx("div", {
47
+ ref,
48
+ className: clsx(styles.timeRange, className),
49
+ children: /* @__PURE__ */ jsx(MediaTimeRange, {
50
+ className: styles.timeRangeInput,
51
+ "aria-label": "Seek",
52
+ disabled: isDisabled || void 0,
53
+ children: /* @__PURE__ */ jsx(MediaTimeDisplay, {
54
+ slot: "current",
55
+ className: styles.currentTimeDisplay
56
+ })
57
+ })
58
+ });
59
+ }
60
+
61
+ //#endregion
62
+ export { TimeRange };
63
+ //# sourceMappingURL=time-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-range.js","names":[],"sources":["../../../src/components/media-controls/time-range.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { MediaTimeDisplay, MediaTimeRange } from 'media-chrome/react';\nimport { useMediaControlsDisabled } from './context';\nimport styles from './styles.module.css';\nimport type { TimeRangeProps } from './types';\n\n/**\n * A media control slider for seeking through media.\n *\n * Wraps media-chrome's MediaTimeRange component with DTK styling.\n * Shows the current playback position and allows seeking.\n *\n * @param props - The slider props.\n * @param props.className - CSS class name for the container.\n * @param props.isDisabled - Whether the slider is disabled.\n * @param props.ref - Ref to the container element.\n * @returns The rendered time range slider.\n *\n * @example\n * ```tsx\n * // Basic usage within MediaProvider\n * <MediaProvider>\n * <TimeRange />\n * </MediaProvider>\n * ```\n */\nexport function TimeRange({\n className,\n isDisabled: isDisabledProp,\n ref,\n}: TimeRangeProps) {\n const isDisabled = useMediaControlsDisabled(isDisabledProp);\n\n return (\n <div ref={ref} className={clsx(styles.timeRange, className)}>\n <MediaTimeRange\n className={styles.timeRangeInput}\n aria-label='Seek'\n // @ts-expect-error - disabled prop is supported by the underlying web component but not in media-chrome's TypeScript types\n\n disabled={isDisabled || undefined}\n >\n <MediaTimeDisplay\n slot='current'\n className={styles.currentTimeDisplay}\n />\n </MediaTimeRange>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,UAAU,EACxB,WACA,YAAY,gBACZ,OACiB;CACjB,MAAM,aAAa,yBAAyB,eAAe;AAE3D,QACE,oBAAC;EAAS;EAAK,WAAW,KAAK,OAAO,WAAW,UAAU;YACzD,oBAAC;GACC,WAAW,OAAO;GAClB,cAAW;GAGX,UAAU,cAAc;aAExB,oBAAC;IACC,MAAK;IACL,WAAW,OAAO;KAClB;IACa;GACb"}