Skip to content

Commit

Permalink
docs(next): Fix input-otp usage example + update migration docs with …
Browse files Browse the repository at this point in the history
…sidebar colors (#1611)
  • Loading branch information
ieedan authored Jan 11, 2025
1 parent 8deb4d0 commit aa0a647
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 3 additions & 2 deletions sites/docs/src/content/components/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ For this example, we'll be passing the `form` returned from the load function as
} from "sveltekit-superforms";
import { zodClient } from "sveltekit-superforms/adapters";
let { data }: { data: { form: SuperValidated<Infer<FormSchema>> } } = $props();
let { data }: { data: { form: SuperValidated<Infer<FormSchema>> } } =
$props();
const form = superForm(data.form, {
validators: zodClient(formSchema),
Expand All @@ -143,6 +144,7 @@ For this example, we'll be passing the `form` returned from the load function as
<Form.Button>Submit</Form.Button>
</form>
```

The `name`, `id`, and all accessibility attributes are applied to the input by spreading the `attrs` object from the `Form.Control` component. The `Form.Label` will automatically be associated with the input using the `for` attribute, so you don't have to worry about that.

### Create a page component that uses the form
Expand Down Expand Up @@ -212,4 +214,3 @@ See the following links for more examples on how to use the other `Form` compone
- [Select](/docs/components/select#form)
- [Switch](/docs/components/switch#form)
- [Textarea](/docs/components/textarea#form)

2 changes: 1 addition & 1 deletion sites/docs/src/content/components/input-otp.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Install `bits-ui`:
</InputOTP.Group>
<InputOTP.Separator />
<InputOTP.Group>
{#each cells.slice(0, 3) as cell}
{#each cells.slice(3, 6) as cell}
<InputOTP.Slot {cell} />
{/each}
</InputOTP.Group>
Expand Down
14 changes: 12 additions & 2 deletions sites/docs/src/content/migration/svelte-5/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ Add `tailwindcss-animate`.

<PMInstall command="tailwindcss-animate"/>

Add `tailwindcss-animate` plugin and animations config.
Add `tailwindcss-animate` plugin, sidebar colors, and animations config.

```json {2} {22-43}
```json {2} {15-24} {32-50} {53}
import type { Config } from 'tailwindcss';
import tailwindcssAnimate from 'tailwindcss-animate';

Expand All @@ -74,6 +74,16 @@ const config: Config = {
extend: {
colors: {
// unchanged ...
sidebar: {
DEFAULT: "hsl(var(--sidebar-background))",
foreground: "hsl(var(--sidebar-foreground))",
primary: "hsl(var(--sidebar-primary))",
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
accent: "hsl(var(--sidebar-accent))",
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
border: "hsl(var(--sidebar-border))",
ring: "hsl(var(--sidebar-ring))",
},
},
borderRadius: {
// unchanged ...
Expand Down

0 comments on commit aa0a647

Please sign in to comment.