diff --git a/ui/package.json b/ui/package.json index 7158955..945e713 100644 --- a/ui/package.json +++ b/ui/package.json @@ -13,6 +13,7 @@ "@solid-primitives/i18n": "^2.2.1", "@solidjs/router": "^0.15.3", "clsx": "^2.1.1", + "hls.js": "^1.6.15", "install": "^0.13.0", "solid-js": "^1.9.9" }, diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 2edf978..e32387d 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: clsx: specifier: ^2.1.1 version: 2.1.1 + hls.js: + specifier: ^1.6.15 + version: 1.6.15 install: specifier: ^0.13.0 version: 0.13.0 @@ -1303,6 +1306,9 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hls.js@1.6.15: + resolution: {integrity: sha512-E3a5VwgXimGHwpRGV+WxRTKeSp2DW5DI5MWv34ulL3t5UNmyJWCQ1KmLEHbYzcfThfXG8amBL+fCYPneGHC4VA==} + html-entities@2.3.3: resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==} @@ -3367,6 +3373,8 @@ snapshots: dependencies: function-bind: 1.1.2 + hls.js@1.6.15: {} + html-entities@2.3.3: {} html-tags@3.3.1: {} diff --git a/ui/src/classes.ts b/ui/src/classes.ts new file mode 100644 index 0000000..47ef377 --- /dev/null +++ b/ui/src/classes.ts @@ -0,0 +1,12 @@ +import { DaisyUIColor } from './types' + +export const rangeColorMap: Record = { + primary: 'range-primary', + secondary: 'range-secondary', + neutral: 'range-neutral', + accent: 'range-accent', + info: 'range-info', + success: 'range-success', + warning: 'range-warning', + error: 'range-error', +} diff --git a/ui/src/components/Button.tsx b/ui/src/components/Button.tsx index 0012a20..bffba49 100644 --- a/ui/src/components/Button.tsx +++ b/ui/src/components/Button.tsx @@ -1,25 +1,15 @@ import clsx from 'clsx' import { JSXElement, Show } from 'solid-js' +import { DaisyUISize, DaisyUIColor } from '../types' -type DaisyUIButtonColor = - | 'neutral' - | 'primary' - | 'secondary' - | 'accent' - | 'info' - | 'success' - | 'warning' - | 'error' - -type DaisyUIButtonStyle = +type DaisyUIButtonVariant = | 'outline' | 'dash' | 'soft' | 'ghost' | 'link' | 'outline' - -type DaisyUIButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' + | 'circle' /** * Renders a button component with an optional loading state. @@ -33,9 +23,9 @@ export function Button(props: { isLoading?: boolean disabled?: boolean type?: 'submit' | 'button' | 'reset' - color?: DaisyUIButtonColor - size?: DaisyUIButtonSize - style?: DaisyUIButtonStyle + color?: DaisyUIColor + size?: DaisyUISize + variant?: DaisyUIButtonVariant class?: string }): JSXElement { return ( @@ -43,7 +33,7 @@ export function Button(props: { class={clsx( 'btn', props.color ? `btn-${props.color}` : undefined, - props.style ? `btn-${props.style}` : undefined, + props.variant ? `btn-${props.variant}` : undefined, props.size ? `btn-${props.size}` : undefined, (props.isLoading || props.disabled) && 'btn-disabled', props.class @@ -74,16 +64,16 @@ export function IconButton(props: { onClick?: () => void isLoading?: boolean disabled?: boolean - color?: DaisyUIButtonColor - size?: DaisyUIButtonSize - style?: DaisyUIButtonStyle + color?: DaisyUIColor + size?: DaisyUISize + variant?: DaisyUIButtonVariant class?: string }): JSXElement { return (