mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
refactor: upgrade base-ui
This commit is contained in:
committed by
Carlos Valente
parent
24a3823d3b
commit
d06b5af538
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@base-ui-components/react": "1.0.0-beta.0",
|
"@base-ui-components/react": "1.0.0-beta.1",
|
||||||
"@chakra-ui/react": "^2.7.0",
|
"@chakra-ui/react": "^2.7.0",
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ interface SelectProps<T extends string | null = string> {
|
|||||||
label: string;
|
label: string;
|
||||||
disabled?: boolean; // exposed to allow creating a non-selectable option
|
disabled?: boolean; // exposed to allow creating a non-selectable option
|
||||||
}[];
|
}[];
|
||||||
placeholder?: string;
|
|
||||||
value?: T;
|
value?: T;
|
||||||
onChange?: (value: NonNullable<T>) => void;
|
onChange?: (value: NonNullable<T>) => void;
|
||||||
}
|
}
|
||||||
@@ -19,14 +18,13 @@ interface SelectProps<T extends string | null = string> {
|
|||||||
export default function Select<T extends string | null = string>({
|
export default function Select<T extends string | null = string>({
|
||||||
defaultValue,
|
defaultValue,
|
||||||
options,
|
options,
|
||||||
placeholder,
|
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
}: SelectProps<T>) {
|
}: SelectProps<T>) {
|
||||||
return (
|
return (
|
||||||
<BaseSelect.Root defaultValue={defaultValue} onValueChange={onChange} value={value}>
|
<BaseSelect.Root items={options} defaultValue={defaultValue} onValueChange={onChange} value={value}>
|
||||||
<BaseSelect.Trigger className={styles.select}>
|
<BaseSelect.Trigger className={styles.select}>
|
||||||
<BaseSelect.Value placeholder={placeholder} />
|
<BaseSelect.Value />
|
||||||
<BaseSelect.Icon className={styles.selectIcon}>
|
<BaseSelect.Icon className={styles.selectIcon}>
|
||||||
<LuChevronsUpDown />
|
<LuChevronsUpDown />
|
||||||
</BaseSelect.Icon>
|
</BaseSelect.Icon>
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ function SecondarySourceControl() {
|
|||||||
<>
|
<>
|
||||||
<Select
|
<Select
|
||||||
value={value}
|
value={value}
|
||||||
placeholder='Secondary source'
|
|
||||||
options={[
|
options={[
|
||||||
{ value: 'aux1', label: 'Aux 1' },
|
{ value: 'aux1', label: 'Aux 1' },
|
||||||
{ value: 'aux2', label: 'Aux 2' },
|
{ value: 'aux2', label: 'Aux 2' },
|
||||||
|
|||||||
@@ -70,14 +70,12 @@ function EventTriggerForm({ eventId, triggers }: EventTriggerFormProps) {
|
|||||||
<div className={style.triggerForm}>
|
<div className={style.triggerForm}>
|
||||||
<Select
|
<Select
|
||||||
value={cycleValue}
|
value={cycleValue}
|
||||||
placeholder='Choose a trigger'
|
|
||||||
onChange={(value) => setCycleValue(value)}
|
onChange={(value) => setCycleValue(value)}
|
||||||
options={eventTriggerOptions.map((cycle) => ({ value: cycle, label: cycle }))}
|
options={eventTriggerOptions.map((cycle) => ({ value: cycle, label: cycle }))}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
value={automationId}
|
value={automationId}
|
||||||
placeholder='Choose an automation'
|
|
||||||
onChange={(value) => setAutomationId(value)}
|
onChange={(value) => setAutomationId(value)}
|
||||||
options={Object.values(automationSettings.automations).map(({ id, title }) => ({ value: id, label: title }))}
|
options={Object.values(automationSettings.automations).map(({ id, title }) => ({ value: id, label: title }))}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Generated
+2025
-2553
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user