forked from bai/curriculum-project-hub
refactor(admin-web): polish Chinese UI and bits-ui controls
Map roles to Chinese labels, remove ADR/spec wording from the surface, and replace native selects/checkboxes/modals with bits-ui Select, Checkbox, Switch, Dialog, Label, and Collapsible.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<script lang="ts">
|
||||
import { Checkbox } from 'bits-ui';
|
||||
import Icon from './Icon.svelte';
|
||||
|
||||
let {
|
||||
checked = $bindable(false),
|
||||
disabled = false,
|
||||
class: className = '',
|
||||
onchange
|
||||
}: {
|
||||
checked?: boolean;
|
||||
disabled?: boolean;
|
||||
class?: string;
|
||||
onchange?: (checked: boolean) => void;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<Checkbox.Root
|
||||
class="saas-checkbox {className}"
|
||||
{disabled}
|
||||
{checked}
|
||||
onCheckedChange={(next) => {
|
||||
checked = next;
|
||||
onchange?.(next);
|
||||
}}
|
||||
>
|
||||
{#snippet children({ checked: isChecked })}
|
||||
{#if isChecked}
|
||||
<Icon name="check" class="h-3.5 w-3.5" />
|
||||
{/if}
|
||||
{/snippet}
|
||||
</Checkbox.Root>
|
||||
Reference in New Issue
Block a user