@moq/ui-core 0.1.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/README.md ADDED
@@ -0,0 +1,38 @@
1
+ <p align="center">
2
+ <img height="128px" src="https://github.com/moq-dev/moq/blob/main/.github/logo.svg" alt="Media over QUIC">
3
+ </p>
4
+
5
+ # @moq/ui-core
6
+
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-ready-blue.svg)](https://www.typescriptlang.org/)
8
+
9
+ Shared UI components for [Media over QUIC](https://moq.dev/) (MoQ) packages.
10
+
11
+ `@moq/ui-core` provides reusable, accessible UI primitives used by `@moq/watch/ui` and `@moq/publish/ui`, built with [SolidJS](https://www.solidjs.com/).
12
+
13
+ ## Components
14
+
15
+ ### Button
16
+ A styled, accessible button component with hover/active states and disabled support.
17
+
18
+ ### Icon
19
+ SVG icon library including media controls (play, pause, volume, fullscreen, etc.), device indicators (camera, microphone, screen), and stats icons (network, video, audio, buffer).
20
+
21
+ ### Stats
22
+ Real-time statistics panel for monitoring media streaming performance. Displays network, video, audio, and buffer metrics via a provider pattern.
23
+
24
+ ## CSS
25
+
26
+ Shared stylesheets are available as CSS imports:
27
+
28
+ - `@moq/ui-core/variables.css` — Theme variables (colors, spacing, border-radius)
29
+ - `@moq/ui-core/flex.css` — Flexbox utility classes
30
+ - `@moq/ui-core/button/button.css` — Button component styles
31
+ - `@moq/ui-core/stats/styles/index.css` — Stats panel styles
32
+
33
+ ## License
34
+
35
+ Licensed under either:
36
+
37
+ - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
38
+ - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
@@ -0,0 +1,37 @@
1
+ import type { JSX } from "solid-js/jsx-runtime";
2
+ /**
3
+ * Props for the shared Button component.
4
+ *
5
+ * @property {('button' | 'submit' | 'reset')} [type] - Button type attribute. Defaults to 'button'.
6
+ * @property {string} [title] - Tooltip/title attribute for the button. Defaults to 'Simple button'.
7
+ * @property {() => void} [onClick] - Click handler function.
8
+ * @property {string} [class] - Additional CSS classes for custom styling.
9
+ * @property {JSX.Element | string} children - Button content (JSX or string). Required.
10
+ * @property {string} [ariaLabel] - Accessible label for screen readers. Falls back to title or children if not provided.
11
+ * @property {boolean} [ariaDisabled] - Accessibility disabled state (for ARIA only).
12
+ * @property {boolean} [disabled] - Disabled state (native HTML attribute).
13
+ * @property {number} [tabIndex] - Tab index for keyboard navigation. Uses browser default (typically 0) if not set.
14
+ */
15
+ export type ButtonProps = {
16
+ type?: "button" | "submit" | "reset";
17
+ title?: string;
18
+ onClick?: () => void;
19
+ class?: string;
20
+ children: JSX.Element | string;
21
+ ariaLabel?: string;
22
+ ariaDisabled?: boolean;
23
+ disabled?: boolean;
24
+ tabIndex?: number;
25
+ };
26
+ /**
27
+ * Shared, accessible, and stylable Button component for SolidJS.
28
+ *
29
+ * - Injects a Constructable Stylesheet for style encapsulation (Shadow DOM-friendly).
30
+ * - Supports accessibility attributes and keyboard navigation.
31
+ * - Accepts custom content, classes, and state modifiers (e.g., active, disabled).
32
+ *
33
+ * @param {ButtonProps} props - Button configuration and content.
34
+ * @returns {JSX.Element} A styled, accessible button element.
35
+ */
36
+ export default function Button(props: ButtonProps): JSX.Element;
37
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,eAiBhD"}
package/icon/icon.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import type { JSX } from "solid-js";
2
+ /**
3
+ * Given the SVG source of an icon, return a JSX.Element
4
+ *
5
+ * @returns JSX.Element
6
+ */
7
+ export declare function Element(src: string): JSX.Element;
8
+ export declare const ArrowDown: () => JSX.Element;
9
+ export declare const ArrowUp: () => JSX.Element;
10
+ export declare const Audio: () => JSX.Element;
11
+ export declare const Ban: () => JSX.Element;
12
+ export declare const Buffer: () => JSX.Element;
13
+ export declare const Camera: () => JSX.Element;
14
+ export declare const File: () => JSX.Element;
15
+ export declare const FullscreenEnter: () => JSX.Element;
16
+ export declare const FullscreenExit: () => JSX.Element;
17
+ export declare const Microphone: () => JSX.Element;
18
+ export declare const Mute: () => JSX.Element;
19
+ export declare const Network: () => JSX.Element;
20
+ export declare const Pause: () => JSX.Element;
21
+ export declare const Play: () => JSX.Element;
22
+ export declare const Screen: () => JSX.Element;
23
+ export declare const Stats: () => JSX.Element;
24
+ export declare const Video: () => JSX.Element;
25
+ export declare const VolumeHigh: () => JSX.Element;
26
+ export declare const VolumeLow: () => JSX.Element;
27
+ export declare const VolumeMedium: () => JSX.Element;
28
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAuBpC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAEhD;AAKD,eAAO,MAAM,SAAS,mBAAkB,CAAC;AACzC,eAAO,MAAM,OAAO,mBAAgB,CAAC;AACrC,eAAO,MAAM,KAAK,mBAAc,CAAC;AACjC,eAAO,MAAM,GAAG,mBAAY,CAAC;AAC7B,eAAO,MAAM,MAAM,mBAAe,CAAC;AACnC,eAAO,MAAM,MAAM,mBAAe,CAAC;AACnC,eAAO,MAAM,IAAI,mBAAa,CAAC;AAC/B,eAAO,MAAM,eAAe,mBAAwB,CAAC;AACrD,eAAO,MAAM,cAAc,mBAAuB,CAAC;AACnD,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,IAAI,mBAAa,CAAC;AAC/B,eAAO,MAAM,OAAO,mBAAgB,CAAC;AACrC,eAAO,MAAM,KAAK,mBAAc,CAAC;AACjC,eAAO,MAAM,IAAI,mBAAa,CAAC;AAC/B,eAAO,MAAM,MAAM,mBAAe,CAAC;AACnC,eAAO,MAAM,KAAK,mBAAc,CAAC;AACjC,eAAO,MAAM,KAAK,mBAAc,CAAC;AACjC,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,SAAS,mBAAkB,CAAC;AACzC,eAAO,MAAM,YAAY,mBAAqB,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export { type ButtonProps, default as Button } from "./button/button";
2
+ export * as Icon from "./icon/icon";
3
+ export { Stats } from "./stats";
4
+ export type { KnownStatsProviders, ProviderContext, ProviderProps } from "./stats/types";
5
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}