@accelint/design-toolkit 9.4.1 → 9.6.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.
- package/catalog-info.yaml +2 -2
- package/dist/components/accordion/group.d.ts +2 -2
- package/dist/components/accordion/header.d.ts +2 -2
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/panel.d.ts +2 -2
- package/dist/components/accordion/styles.module.css +1 -1
- package/dist/components/accordion/trigger.d.ts +2 -2
- package/dist/components/action-bar/index.d.ts +2 -2
- package/dist/components/audio/index.d.ts +104 -0
- package/dist/components/audio/index.js +242 -0
- package/dist/components/audio/index.js.map +1 -0
- package/dist/components/audio/styles.module.css +77 -0
- package/dist/components/audio/types.d.ts +45 -0
- package/dist/components/audio/types.js +12 -0
- package/dist/components/avatar/context.d.ts +4 -4
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/badge/context.d.ts +4 -4
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/breadcrumbs/index.d.ts +2 -2
- package/dist/components/breadcrumbs/item.d.ts +2 -2
- package/dist/components/breadcrumbs/styles.module.css +1 -0
- package/dist/components/button/__internal__/clear.js +42 -0
- package/dist/components/button/__internal__/clear.js.map +1 -0
- package/dist/components/button/__internal__/styles.module.css +23 -0
- package/dist/components/button/context.d.ts +8 -8
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/link.d.ts +2 -2
- package/dist/components/button/styles.module.css +1 -1
- package/dist/components/button/toggle.d.ts +2 -2
- package/dist/components/checkbox/context.d.ts +3 -3
- package/dist/components/checkbox/group.d.ts +2 -2
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/chip/context.d.ts +4 -4
- package/dist/components/chip/deletable.d.ts +2 -2
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/list.d.ts +4 -4
- package/dist/components/chip/selectable.d.ts +2 -2
- package/dist/components/chip/styles.module.css +4 -4
- package/dist/components/classification-badge/context.d.ts +4 -4
- package/dist/components/classification-badge/index.d.ts +2 -2
- package/dist/components/classification-banner/context.d.ts +4 -4
- package/dist/components/classification-banner/index.d.ts +2 -2
- package/dist/components/clock/index.d.ts +2 -2
- package/dist/components/clock/index.js +1 -0
- package/dist/components/clock/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/combobox-field/context.d.ts +4 -4
- package/dist/components/combobox-field/index.d.ts +2 -2
- package/dist/components/combobox-field/index.js +42 -14
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/styles.module.css +15 -3
- package/dist/components/combobox-field/types.d.ts +4 -0
- package/dist/components/coordinate-field/context.d.ts +6 -6
- package/dist/components/coordinate-field/index.d.ts +2 -2
- package/dist/components/coordinate-field/segment.d.ts +2 -2
- package/dist/components/date-field/index.d.ts +2 -2
- package/dist/components/deferred-collection/index.d.ts +2 -2
- package/dist/components/details-list/context.d.ts +4 -4
- package/dist/components/details-list/index.d.ts +2 -2
- package/dist/components/details-list/label.d.ts +2 -2
- package/dist/components/details-list/value.d.ts +2 -2
- package/dist/components/dialog/content.d.ts +2 -2
- package/dist/components/dialog/context.d.ts +2 -2
- package/dist/components/dialog/footer.d.ts +2 -2
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/dialog/title.d.ts +2 -2
- package/dist/components/divider/context.d.ts +4 -4
- package/dist/components/divider/index.d.ts +2 -2
- package/dist/components/drawer/back.d.ts +2 -2
- package/dist/components/drawer/close.d.ts +2 -2
- package/dist/components/drawer/content.d.ts +2 -2
- package/dist/components/drawer/context.d.ts +2 -2
- package/dist/components/drawer/footer.d.ts +2 -2
- package/dist/components/drawer/header-title.d.ts +2 -2
- package/dist/components/drawer/header.d.ts +2 -2
- package/dist/components/drawer/header.js +1 -1
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/layout-main.d.ts +2 -2
- package/dist/components/drawer/layout.d.ts +2 -2
- package/dist/components/drawer/menu-item.d.ts +2 -2
- package/dist/components/drawer/menu.d.ts +2 -2
- package/dist/components/drawer/panel.d.ts +2 -2
- package/dist/components/drawer/trigger.d.ts +2 -2
- package/dist/components/drawer/view.d.ts +2 -2
- package/dist/components/flashcard/index.d.ts +9 -9
- package/dist/components/hero/context.d.ts +2 -2
- package/dist/components/hero/index.d.ts +2 -2
- package/dist/components/hero/subtitle.d.ts +2 -2
- package/dist/components/hero/title.d.ts +3 -3
- package/dist/components/hotkey/context.d.ts +2 -2
- package/dist/components/hotkey/index.d.ts +2 -2
- package/dist/components/hotkey/set.d.ts +2 -2
- package/dist/components/icon/context.d.ts +4 -4
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/input/context.d.ts +2 -2
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/index.js +10 -14
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/kanban/card-body.d.ts +2 -2
- package/dist/components/kanban/card-header-actions.d.ts +2 -2
- package/dist/components/kanban/card-header-title.d.ts +2 -2
- package/dist/components/kanban/card-header.d.ts +2 -2
- package/dist/components/kanban/card.d.ts +2 -2
- package/dist/components/kanban/column-actions.d.ts +2 -2
- package/dist/components/kanban/column-container.d.ts +2 -2
- package/dist/components/kanban/column-content.d.ts +2 -2
- package/dist/components/kanban/column-header-actions.d.ts +2 -2
- package/dist/components/kanban/column-header-drag-handle.d.ts +2 -2
- package/dist/components/kanban/column-header-title.d.ts +2 -2
- package/dist/components/kanban/column-header.d.ts +2 -2
- package/dist/components/kanban/column.d.ts +2 -2
- package/dist/components/kanban/context.d.ts +2 -2
- package/dist/components/kanban/header-actions.d.ts +2 -2
- package/dist/components/kanban/header-search.d.ts +2 -2
- package/dist/components/kanban/header-title.d.ts +2 -2
- package/dist/components/kanban/header.d.ts +2 -2
- package/dist/components/kanban/kanban.d.ts +4 -4
- package/dist/components/kanban/styles.module.css +1 -1
- package/dist/components/label/context.d.ts +4 -4
- package/dist/components/label/index.d.ts +2 -2
- package/dist/components/lines/index.d.ts +2 -2
- package/dist/components/link/context.d.ts +2 -2
- package/dist/components/link/index.d.ts +2 -2
- package/dist/components/list/context.d.ts +2 -2
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/item-content.d.ts +2 -2
- package/dist/components/list/item-description.d.ts +2 -2
- package/dist/components/list/item-title.d.ts +2 -2
- package/dist/components/list/item.d.ts +2 -2
- package/dist/components/list/styles.module.css +1 -1
- package/dist/components/media-controls/context.d.ts +66 -0
- package/dist/components/media-controls/context.js +77 -0
- package/dist/components/media-controls/context.js.map +1 -0
- package/dist/components/media-controls/fullscreen-button.d.ts +55 -0
- package/dist/components/media-controls/fullscreen-button.js +80 -0
- package/dist/components/media-controls/fullscreen-button.js.map +1 -0
- package/dist/components/media-controls/index.d.ts +68 -0
- package/dist/components/media-controls/index.js +78 -0
- package/dist/components/media-controls/index.js.map +1 -0
- package/dist/components/media-controls/mute-button.d.ts +47 -0
- package/dist/components/media-controls/mute-button.js +73 -0
- package/dist/components/media-controls/mute-button.js.map +1 -0
- package/dist/components/media-controls/play-button.d.ts +47 -0
- package/dist/components/media-controls/play-button.js +71 -0
- package/dist/components/media-controls/play-button.js.map +1 -0
- package/dist/components/media-controls/playback-rate.d.ts +58 -0
- package/dist/components/media-controls/playback-rate.js +114 -0
- package/dist/components/media-controls/playback-rate.js.map +1 -0
- package/dist/components/media-controls/seek-button.d.ts +60 -0
- package/dist/components/media-controls/seek-button.js +116 -0
- package/dist/components/media-controls/seek-button.js.map +1 -0
- package/dist/components/media-controls/styles.module.css +145 -0
- package/dist/components/media-controls/time-display.d.ts +69 -0
- package/dist/components/media-controls/time-display.js +95 -0
- package/dist/components/media-controls/time-display.js.map +1 -0
- package/dist/components/media-controls/time-range.d.ts +46 -0
- package/dist/components/media-controls/time-range.js +63 -0
- package/dist/components/media-controls/time-range.js.map +1 -0
- package/dist/components/media-controls/types.d.ts +127 -0
- package/dist/components/media-controls/types.js +12 -0
- package/dist/components/media-controls/volume-slider.d.ts +54 -0
- package/dist/components/media-controls/volume-slider.js +70 -0
- package/dist/components/media-controls/volume-slider.js.map +1 -0
- package/dist/components/menu/context.d.ts +2 -2
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/item-description.d.ts +2 -2
- package/dist/components/menu/item-label.d.ts +2 -2
- package/dist/components/menu/item.d.ts +2 -2
- package/dist/components/menu/section.d.ts +2 -2
- package/dist/components/menu/separator.d.ts +2 -2
- package/dist/components/menu/styles.module.css +1 -1
- package/dist/components/menu/submenu.d.ts +3 -3
- package/dist/components/notice/index.d.ts +2 -2
- package/dist/components/notice/list.d.ts +2 -2
- package/dist/components/notice/notice-icon.d.ts +2 -2
- package/dist/components/options/context.d.ts +2 -2
- package/dist/components/options/index.d.ts +2 -2
- package/dist/components/options/item-content.d.ts +2 -2
- package/dist/components/options/item-description.d.ts +2 -2
- package/dist/components/options/item-label.d.ts +2 -2
- package/dist/components/options/item.d.ts +2 -2
- package/dist/components/options/section.d.ts +2 -2
- package/dist/components/options/styles.module.css +1 -1
- package/dist/components/pagination/context.d.ts +2 -2
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/next.d.ts +2 -2
- package/dist/components/pagination/pages.d.ts +2 -2
- package/dist/components/pagination/prev.d.ts +2 -2
- package/dist/components/popover/content.d.ts +2 -2
- package/dist/components/popover/footer.d.ts +2 -2
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/title.d.ts +2 -2
- package/dist/components/popover/trigger.d.ts +2 -2
- package/dist/components/query-builder/action-element.d.ts +2 -2
- package/dist/components/query-builder/actions.d.ts +4 -4
- package/dist/components/query-builder/combinator-selector.d.ts +2 -2
- package/dist/components/query-builder/combinator-selector.js +5 -4
- package/dist/components/query-builder/combinator-selector.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +2 -2
- package/dist/components/query-builder/rule-group.d.ts +4 -4
- package/dist/components/query-builder/rule.d.ts +2 -2
- package/dist/components/query-builder/value-editor.d.ts +2 -2
- package/dist/components/query-builder/value-selector.d.ts +2 -2
- package/dist/components/radio/context.d.ts +2 -2
- package/dist/components/radio/group.d.ts +2 -2
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/search-field/context.d.ts +4 -4
- package/dist/components/search-field/index.d.ts +2 -2
- package/dist/components/search-field/styles.module.css +1 -1
- package/dist/components/select-field/context.d.ts +4 -4
- package/dist/components/select-field/index.d.ts +2 -2
- package/dist/components/sidenav/avatar.d.ts +2 -2
- package/dist/components/sidenav/content.d.ts +2 -2
- package/dist/components/sidenav/context.d.ts +2 -2
- package/dist/components/sidenav/footer.d.ts +2 -2
- package/dist/components/sidenav/header.d.ts +2 -2
- package/dist/components/sidenav/index.d.ts +2 -2
- package/dist/components/sidenav/item.d.ts +2 -2
- package/dist/components/sidenav/link.d.ts +2 -2
- package/dist/components/sidenav/menu-item.d.ts +2 -2
- package/dist/components/sidenav/menu.d.ts +2 -2
- package/dist/components/sidenav/trigger.d.ts +2 -2
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/status-indicator/index.d.ts +41 -0
- package/dist/components/status-indicator/index.js +49 -0
- package/dist/components/status-indicator/index.js.map +1 -0
- package/dist/components/status-indicator/styles.module.css +34 -0
- package/dist/components/status-indicator/types.d.ts +21 -0
- package/dist/components/status-indicator/types.js +12 -0
- package/dist/components/switch/context.d.ts +4 -4
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/table/body.d.ts +2 -2
- package/dist/components/table/cell.d.ts +2 -2
- package/dist/components/table/context.d.ts +2 -2
- package/dist/components/table/header-cell.d.ts +2 -2
- package/dist/components/table/header.d.ts +2 -2
- package/dist/components/table/index.d.ts +2 -2
- package/dist/components/table/row.d.ts +2 -2
- package/dist/components/table/styles.module.css +5 -1
- package/dist/components/tabs/context.d.ts +4 -4
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/list.d.ts +2 -2
- package/dist/components/tabs/panel.d.ts +2 -2
- package/dist/components/tabs/styles.module.css +1 -1
- package/dist/components/tabs/tab.d.ts +2 -2
- package/dist/components/text-area-field/context.d.ts +4 -4
- package/dist/components/text-area-field/index.d.ts +2 -2
- package/dist/components/text-field/context.d.ts +4 -4
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/time-field/index.d.ts +2 -2
- package/dist/components/tooltip/context.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/styles.module.css +1 -1
- package/dist/components/tooltip/trigger.d.ts +2 -2
- package/dist/components/tree/index.d.ts +2 -2
- package/dist/components/tree/item-actions.d.ts +2 -2
- package/dist/components/tree/item-content.d.ts +2 -2
- package/dist/components/tree/item-description.d.ts +2 -2
- package/dist/components/tree/item-label.d.ts +2 -2
- package/dist/components/tree/item-prefix-icon.d.ts +2 -2
- package/dist/components/tree/lines.d.ts +2 -2
- package/dist/components/tree/styles.module.css +1 -1
- package/dist/components/video/index.d.ts +97 -0
- package/dist/components/video/index.js +261 -0
- package/dist/components/video/index.js.map +1 -0
- package/dist/components/video/styles.module.css +99 -0
- package/dist/components/video/types.d.ts +52 -0
- package/dist/components/video/types.js +12 -0
- package/dist/components/view-stack/index.d.ts +2 -2
- package/dist/components/view-stack/trigger.d.ts +2 -2
- package/dist/components/view-stack/view.d.ts +2 -2
- package/dist/index.d.ts +18 -1
- package/dist/index.js +14 -1
- package/dist/providers/portal.d.ts +2 -2
- package/dist/providers/theme-provider.d.ts +2 -2
- package/package.json +29 -11
|
@@ -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_runtime173 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_runtime173.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"}
|
|
@@ -0,0 +1,127 @@
|
|
|
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 { AriaAttributesWithRef } from "../../lib/types.js";
|
|
14
|
+
import { ButtonProps } from "../button/types.js";
|
|
15
|
+
import { ComponentPropsWithRef } from "react";
|
|
16
|
+
|
|
17
|
+
//#region src/components/media-controls/types.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Locked-down button props for media controls.
|
|
20
|
+
*
|
|
21
|
+
* Style variants are controlled internally to ensure consistent appearance.
|
|
22
|
+
*/
|
|
23
|
+
type MediaButtonProps = Omit<ButtonProps, 'variant' | 'size' | 'color'>;
|
|
24
|
+
/**
|
|
25
|
+
* Props for the MediaControls component.
|
|
26
|
+
*/
|
|
27
|
+
type MediaControlsProps = ComponentPropsWithRef<'div'> & {
|
|
28
|
+
classNames?: {
|
|
29
|
+
container?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Disables all child controls via context. Individual control isDisabled props take precedence.
|
|
33
|
+
*/
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Props for the PlayButton component.
|
|
38
|
+
*/
|
|
39
|
+
type PlayButtonProps = MediaButtonProps;
|
|
40
|
+
/**
|
|
41
|
+
* Props for the MuteButton component.
|
|
42
|
+
*/
|
|
43
|
+
type MuteButtonProps = MediaButtonProps;
|
|
44
|
+
/**
|
|
45
|
+
* Props for the FullscreenButton component.
|
|
46
|
+
*/
|
|
47
|
+
type FullscreenButtonProps = MediaButtonProps;
|
|
48
|
+
/**
|
|
49
|
+
* Props for the SeekButton component.
|
|
50
|
+
*/
|
|
51
|
+
type SeekButtonProps = MediaButtonProps & {
|
|
52
|
+
/** Direction to seek: 'forward' advances playback, 'backward' rewinds. */
|
|
53
|
+
direction: 'forward' | 'backward';
|
|
54
|
+
/**
|
|
55
|
+
* Number of seconds to seek. Must be a positive finite number.
|
|
56
|
+
* Invalid values (NaN, Infinity, negative, zero) fall back to default (10).
|
|
57
|
+
* @default 10
|
|
58
|
+
*/
|
|
59
|
+
seekOffset?: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Props for the PlaybackRateButton component.
|
|
63
|
+
*/
|
|
64
|
+
type PlaybackRateButtonProps = MediaButtonProps & {
|
|
65
|
+
/**
|
|
66
|
+
* Array of playback rates to cycle through.
|
|
67
|
+
* @default [1, 2, 3]
|
|
68
|
+
*/
|
|
69
|
+
rates?: number[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Base props for div-based media controls.
|
|
73
|
+
*/
|
|
74
|
+
type MediaControlBaseProps = {
|
|
75
|
+
/** CSS class name for the control container. */
|
|
76
|
+
className?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Disables this specific control. When true, the control is non-interactive.
|
|
79
|
+
* Component-level isDisabled takes precedence over context-level disabled state.
|
|
80
|
+
*/
|
|
81
|
+
isDisabled?: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Props for the VolumeSlider component.
|
|
85
|
+
*/
|
|
86
|
+
type VolumeSliderProps = MediaControlBaseProps & AriaAttributesWithRef<HTMLDivElement> & {
|
|
87
|
+
/** Whether to show a "Volume" label above the slider. */
|
|
88
|
+
showLabel?: boolean;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Props for the TimeRange component.
|
|
92
|
+
*/
|
|
93
|
+
type TimeRangeProps = MediaControlBaseProps & AriaAttributesWithRef<HTMLDivElement>;
|
|
94
|
+
/**
|
|
95
|
+
* Time display mode - mutually exclusive options.
|
|
96
|
+
*
|
|
97
|
+
* - 'current': Shows current playback time
|
|
98
|
+
* - 'remaining': Shows remaining time
|
|
99
|
+
* - 'duration': Shows total duration
|
|
100
|
+
*/
|
|
101
|
+
type TimeDisplayMode = 'current' | 'remaining' | 'duration';
|
|
102
|
+
/**
|
|
103
|
+
* Props for the TimeDisplay component.
|
|
104
|
+
*/
|
|
105
|
+
type TimeDisplayProps = MediaControlBaseProps & AriaAttributesWithRef<HTMLDivElement> & {
|
|
106
|
+
/**
|
|
107
|
+
* Display mode for the time.
|
|
108
|
+
* - 'current': Shows current playback time (default)
|
|
109
|
+
* - 'remaining': Shows remaining time
|
|
110
|
+
* - 'duration': Shows total duration
|
|
111
|
+
*/
|
|
112
|
+
mode?: TimeDisplayMode;
|
|
113
|
+
/** Text shown when time value is unavailable or loading (e.g., "--:--"). */
|
|
114
|
+
placeholder?: string;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Context value for MediaControls.
|
|
118
|
+
*
|
|
119
|
+
* Provides shared state to all media control children.
|
|
120
|
+
*/
|
|
121
|
+
type MediaControlsContextValue = {
|
|
122
|
+
/** Whether controls are disabled. */
|
|
123
|
+
isDisabled: boolean;
|
|
124
|
+
};
|
|
125
|
+
//#endregion
|
|
126
|
+
export { FullscreenButtonProps, MediaControlsContextValue, MediaControlsProps, MuteButtonProps, PlayButtonProps, PlaybackRateButtonProps, SeekButtonProps, TimeDisplayMode, TimeDisplayProps, TimeRangeProps, VolumeSliderProps };
|
|
127
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { VolumeSliderProps } from "./types.js";
|
|
14
|
+
import "client-only";
|
|
15
|
+
import * as react_jsx_runtime170 from "react/jsx-runtime";
|
|
16
|
+
|
|
17
|
+
//#region src/components/media-controls/volume-slider.d.ts
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A media control slider for adjusting volume.
|
|
21
|
+
*
|
|
22
|
+
* Wraps media-chrome's MediaVolumeRange component with DTK styling.
|
|
23
|
+
* Integrates automatically with the media store for volume control.
|
|
24
|
+
*
|
|
25
|
+
* @param props - The slider props.
|
|
26
|
+
* @param props.className - CSS class name for the slider container.
|
|
27
|
+
* @param props.showLabel - Whether to show a "Volume" label.
|
|
28
|
+
* @param props.isDisabled - Whether the slider is disabled.
|
|
29
|
+
* @param props.ref - Ref to the container element.
|
|
30
|
+
* @returns The rendered volume slider.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Basic usage within MediaProvider
|
|
35
|
+
* <MediaProvider>
|
|
36
|
+
* <VolumeSlider />
|
|
37
|
+
* </MediaProvider>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // With visible label
|
|
43
|
+
* <VolumeSlider showLabel />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare function VolumeSlider({
|
|
47
|
+
className,
|
|
48
|
+
showLabel,
|
|
49
|
+
isDisabled: isDisabledProp,
|
|
50
|
+
ref
|
|
51
|
+
}: VolumeSliderProps): react_jsx_runtime170.JSX.Element;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { VolumeSlider };
|
|
54
|
+
//# sourceMappingURL=volume-slider.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
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, jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { MediaVolumeRange } from "media-chrome/react";
|
|
21
|
+
import styles from "./styles.module.css";
|
|
22
|
+
|
|
23
|
+
//#region src/components/media-controls/volume-slider.tsx
|
|
24
|
+
/**
|
|
25
|
+
* A media control slider for adjusting volume.
|
|
26
|
+
*
|
|
27
|
+
* Wraps media-chrome's MediaVolumeRange component with DTK styling.
|
|
28
|
+
* Integrates automatically with the media store for volume control.
|
|
29
|
+
*
|
|
30
|
+
* @param props - The slider props.
|
|
31
|
+
* @param props.className - CSS class name for the slider container.
|
|
32
|
+
* @param props.showLabel - Whether to show a "Volume" label.
|
|
33
|
+
* @param props.isDisabled - Whether the slider is disabled.
|
|
34
|
+
* @param props.ref - Ref to the container element.
|
|
35
|
+
* @returns The rendered volume slider.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Basic usage within MediaProvider
|
|
40
|
+
* <MediaProvider>
|
|
41
|
+
* <VolumeSlider />
|
|
42
|
+
* </MediaProvider>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* // With visible label
|
|
48
|
+
* <VolumeSlider showLabel />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
function VolumeSlider({ className, showLabel = false, isDisabled: isDisabledProp, ref }) {
|
|
52
|
+
const isDisabled = useMediaControlsDisabled(isDisabledProp);
|
|
53
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
ref,
|
|
55
|
+
className: clsx(styles.volumeSlider, className),
|
|
56
|
+
"data-disabled": isDisabled || void 0,
|
|
57
|
+
children: [showLabel && /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: styles.volumeLabel,
|
|
59
|
+
children: "Volume"
|
|
60
|
+
}), /* @__PURE__ */ jsx(MediaVolumeRange, {
|
|
61
|
+
className: styles.volumeRange,
|
|
62
|
+
"aria-label": "Volume",
|
|
63
|
+
disabled: isDisabled || void 0
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { VolumeSlider };
|
|
70
|
+
//# sourceMappingURL=volume-slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volume-slider.js","names":[],"sources":["../../../src/components/media-controls/volume-slider.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 { MediaVolumeRange } from 'media-chrome/react';\nimport { useMediaControlsDisabled } from './context';\nimport styles from './styles.module.css';\nimport type { VolumeSliderProps } from './types';\n\n/**\n * A media control slider for adjusting volume.\n *\n * Wraps media-chrome's MediaVolumeRange component with DTK styling.\n * Integrates automatically with the media store for volume control.\n *\n * @param props - The slider props.\n * @param props.className - CSS class name for the slider container.\n * @param props.showLabel - Whether to show a \"Volume\" label.\n * @param props.isDisabled - Whether the slider is disabled.\n * @param props.ref - Ref to the container element.\n * @returns The rendered volume slider.\n *\n * @example\n * ```tsx\n * // Basic usage within MediaProvider\n * <MediaProvider>\n * <VolumeSlider />\n * </MediaProvider>\n * ```\n *\n * @example\n * ```tsx\n * // With visible label\n * <VolumeSlider showLabel />\n * ```\n */\nexport function VolumeSlider({\n className,\n showLabel = false,\n isDisabled: isDisabledProp,\n ref,\n}: VolumeSliderProps) {\n const isDisabled = useMediaControlsDisabled(isDisabledProp);\n\n return (\n <div\n ref={ref}\n className={clsx(styles.volumeSlider, className)}\n data-disabled={isDisabled || undefined}\n >\n {showLabel && <span className={styles.volumeLabel}>Volume</span>}\n <MediaVolumeRange\n className={styles.volumeRange}\n aria-label='Volume'\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 </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,aAAa,EAC3B,WACA,YAAY,OACZ,YAAY,gBACZ,OACoB;CACpB,MAAM,aAAa,yBAAyB,eAAe;AAE3D,QACE,qBAAC;EACM;EACL,WAAW,KAAK,OAAO,cAAc,UAAU;EAC/C,iBAAe,cAAc;aAE5B,aAAa,oBAAC;GAAK,WAAW,OAAO;aAAa;IAAa,EAChE,oBAAC;GACC,WAAW,OAAO;GAClB,cAAW;GAGX,UAAU,cAAc;IACxB;GACE"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { MenuProps as MenuProps$1 } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react43 from "react";
|
|
16
16
|
import { ContextValue } from "react-aria-components";
|
|
17
17
|
|
|
18
18
|
//#region src/components/menu/context.d.ts
|
|
@@ -20,7 +20,7 @@ import { ContextValue } from "react-aria-components";
|
|
|
20
20
|
* Context for sharing Menu props across component tree.
|
|
21
21
|
* Used internally by Menu subcomponents for variant and state coordination.
|
|
22
22
|
*/
|
|
23
|
-
declare const MenuContext:
|
|
23
|
+
declare const MenuContext: react43.Context<ContextValue<MenuProps$1<unknown>, HTMLDivElement>>;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { MenuContext };
|
|
26
26
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { MenuProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime171 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/index.d.ts
|
|
18
18
|
|
|
@@ -126,7 +126,7 @@ import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
|
126
126
|
declare function Menu<T extends object>({
|
|
127
127
|
ref,
|
|
128
128
|
...props
|
|
129
|
-
}: MenuProps<T>):
|
|
129
|
+
}: MenuProps<T>): react_jsx_runtime171.JSX.Element;
|
|
130
130
|
//#endregion
|
|
131
131
|
export { Menu };
|
|
132
132
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import "client-only";
|
|
14
14
|
import { TextProps } from "react-aria-components";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime178 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/item-description.d.ts
|
|
18
18
|
/**
|
|
@@ -34,7 +34,7 @@ declare function MenuItemDescription({
|
|
|
34
34
|
children,
|
|
35
35
|
className,
|
|
36
36
|
...rest
|
|
37
|
-
}: TextProps):
|
|
37
|
+
}: TextProps): react_jsx_runtime178.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { MenuItemDescription };
|
|
40
40
|
//# sourceMappingURL=item-description.d.ts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import "client-only";
|
|
14
14
|
import { TextProps } from "react-aria-components";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime181 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/item-label.d.ts
|
|
18
18
|
/**
|
|
@@ -34,7 +34,7 @@ declare function MenuItemLabel({
|
|
|
34
34
|
children,
|
|
35
35
|
className,
|
|
36
36
|
...rest
|
|
37
|
-
}: TextProps):
|
|
37
|
+
}: TextProps): react_jsx_runtime181.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { MenuItemLabel };
|
|
40
40
|
//# sourceMappingURL=item-label.d.ts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { MenuItemProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime174 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/item.d.ts
|
|
18
18
|
|
|
@@ -41,7 +41,7 @@ declare function MenuItem({
|
|
|
41
41
|
classNames,
|
|
42
42
|
color,
|
|
43
43
|
...rest
|
|
44
|
-
}: MenuItemProps):
|
|
44
|
+
}: MenuItemProps): react_jsx_runtime174.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { MenuItem };
|
|
47
47
|
//# sourceMappingURL=item.d.ts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { MenuSectionProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime175 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/section.d.ts
|
|
18
18
|
|
|
@@ -42,7 +42,7 @@ declare function MenuSection<T extends object>({
|
|
|
42
42
|
items,
|
|
43
43
|
title,
|
|
44
44
|
...rest
|
|
45
|
-
}: MenuSectionProps<T>):
|
|
45
|
+
}: MenuSectionProps<T>): react_jsx_runtime175.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { MenuSection };
|
|
48
48
|
//# sourceMappingURL=section.d.ts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import "client-only";
|
|
14
14
|
import { SeparatorProps } from "react-aria-components";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime176 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/separator.d.ts
|
|
18
18
|
/**
|
|
@@ -32,7 +32,7 @@ import * as react_jsx_runtime61 from "react/jsx-runtime";
|
|
|
32
32
|
declare function MenuSeparator({
|
|
33
33
|
className,
|
|
34
34
|
...rest
|
|
35
|
-
}: SeparatorProps):
|
|
35
|
+
}: SeparatorProps): react_jsx_runtime176.JSX.Element;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { MenuSeparator };
|
|
38
38
|
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
@layer components.l1 {
|
|
16
16
|
.menu {
|
|
17
|
-
@apply rounded-medium bg-surface-overlay shadow-elevation-overlay outline-static overflow-x-clip overflow-y-auto p-px outline;
|
|
17
|
+
@apply rounded-medium bg-surface-overlay shadow-elevation-overlay outline-static overflow-x-clip overflow-y-auto p-px outline select-none;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.item {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import "client-only";
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
14
|
+
import * as react44 from "react";
|
|
15
|
+
import * as react_aria_components1 from "react-aria-components";
|
|
16
16
|
|
|
17
17
|
//#region src/components/menu/submenu.d.ts
|
|
18
18
|
/**
|
|
@@ -31,7 +31,7 @@ import * as react_aria_components0 from "react-aria-components";
|
|
|
31
31
|
* </MenuSubmenu>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
declare const MenuSubmenu: (props:
|
|
34
|
+
declare const MenuSubmenu: (props: react_aria_components1.SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => react44.ReactElement | null;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { MenuSubmenu };
|
|
37
37
|
//# sourceMappingURL=submenu.d.ts.map
|