Skip to content

Commit 70877a2

Browse files
authored
Merge pull request #214 from x0k/shadcn-update
Shadcn update
2 parents 93d99c3 + 5688f56 commit 70877a2

File tree

63 files changed

+14470
-7436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+14470
-7436
lines changed

.changeset/cruel-beans-hear.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@sjsf/shadcn4-theme": major
3+
---
4+
5+
- Use `Field`, `FieldLabel`, `FieldSet`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldTitle`, `FieldLegend` components
6+
- Use `data-invalid` and `aria-invalid` attributes

.changeset/every-cats-start.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sjsf/form": minor
3+
---
4+
5+
Add `aria` helpers functions

.changeset/mean-cobras-happen.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@sjsf/shadcn4-theme": major
3+
---
4+
5+
- Use `ButtonGroup` component for `array-item-controls` layout
6+
- Use `outline` variant for non-submit buttons

.changeset/smooth-onions-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sjsf/daisyui5-theme": major
3+
---
4+
5+
Respect `layout` attributes for `field` layout type

apps/docs2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@webcontainer/api": "^1.6.1",
6565
"astro": "^5.13.10",
6666
"astro-vtbot": "^2.1.8",
67-
"bits-ui": "^2.11.1",
67+
"bits-ui": "^2.11.5",
6868
"css-tree": "^3.1.0",
6969
"json-schema-to-ts": "^3.1.1",
7070
"sharp": "^0.34.4",

apps/docs2/src/content/docs/misc/migration-from-v2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export const load = async () => {
316316
- `daisyui@^5.1.0` (`@sjsf/daisyui5-theme`)
317317
- `flowbite-svelte-icons@^3.0.0` (`@sjsf/flowbite-icons`)
318318
- `flowbite-svelte@^1.13.0` (`@sjsf/flowbite3-theme`)
319-
- `bits-ui@^2.10.0` (`@sjsf/shadcn4-theme`)
319+
- `bits-ui@^2.11.0` (`@sjsf/shadcn4-theme`)
320320
- New peer dependency `@jis3r/icons@^1.1.0` (`@sjsf/moving-icons`)
321321
- `zod@^4.1.0`, drop `zod` v3 support (`@sjsf/zod4-validator`)
322322

apps/docs2/src/content/docs/themes/shadcn4/ui-options.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ComponentProps } from "svelte";
22
import type {
33
HTMLAttributes,
4+
HTMLFieldsetAttributes,
45
HTMLFormAttributes,
56
HTMLInputAttributes,
67
HTMLInputTypeAttribute,
@@ -28,6 +29,7 @@ import type {
2829
} from "bits-ui";
2930
import type { ButtonType, LayoutType } from "@sjsf/form/fields/components";
3031
import type { Button } from "@sjsf/shadcn4-theme/new-york";
32+
import type { ButtonGroupProps, FieldProps } from '@sjsf/shadcn4-theme/components/layout.svelte'
3133

3234
type InputType = Exclude<HTMLInputTypeAttribute, "file">;
3335

@@ -80,6 +82,9 @@ export interface UiOptions {
8082
layouts?: {
8183
[L in LayoutType]?: HTMLAttributes<HTMLDivElement>;
8284
};
85+
shadcn4ButtonGroup?: ButtonGroupProps;
86+
shadcn4Field?: FieldProps;
87+
shadcn4FieldSet?: HTMLFieldsetAttributes;
8388
shadcn4SubmitButton?: ComponentProps<typeof Button>;
8489
/**
8590
* Overrides the attributes of the field title

packages/basic-theme/tests/__snapshots__/array-field.svelte.test.ts.snap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ exports[`array fields > array icons 1`] = `
155155
<!---->
156156
<input
157157
aria-describedby="root@0::description root@0::help root@0::errors"
158+
aria-invalid="false"
158159
id="root@0"
159160
name="root@0"
160161
required=""
@@ -320,6 +321,7 @@ exports[`array fields > array icons 1`] = `
320321
<!---->
321322
<input
322323
aria-describedby="root@1::description root@1::help root@1::errors"
324+
aria-invalid="false"
323325
id="root@1"
324326
name="root@1"
325327
required=""
@@ -564,6 +566,7 @@ exports[`array fields > empty errors array 1`] = `
564566
<!---->
565567
<input
566568
aria-describedby="root.name::description root.name::help root.name::errors"
569+
aria-invalid="false"
567570
id="root.name"
568571
name="root.name"
569572
style="flex-grow: 1;"
@@ -702,6 +705,7 @@ exports[`array fields > fixed array 1`] = `
702705
<!---->
703706
<input
704707
aria-describedby="root@0::description root@0::help root@0::errors"
708+
aria-invalid="false"
705709
id="root@0"
706710
name="root@0"
707711
required=""
@@ -780,6 +784,7 @@ exports[`array fields > fixed array 1`] = `
780784
<!---->
781785
<input
782786
aria-describedby="root@1::description root@1::help root@1::errors"
787+
aria-invalid="false"
783788
id="root@1"
784789
name="root@1"
785790
required=""
@@ -1065,6 +1070,7 @@ exports[`with title and description > array icons 1`] = `
10651070
<!---->
10661071
<input
10671072
aria-describedby="root@0::description root@0::help root@0::errors"
1073+
aria-invalid="false"
10681074
id="root@0"
10691075
name="root@0"
10701076
required=""
@@ -1238,6 +1244,7 @@ exports[`with title and description > array icons 1`] = `
12381244
<!---->
12391245
<input
12401246
aria-describedby="root@1::description root@1::help root@1::errors"
1247+
aria-invalid="false"
12411248
id="root@1"
12421249
name="root@1"
12431250
required=""
@@ -1522,6 +1529,7 @@ exports[`with title and description > fixed array 1`] = `
15221529
<!---->
15231530
<input
15241531
aria-describedby="root@0::description root@0::help root@0::errors"
1532+
aria-invalid="false"
15251533
id="root@0"
15261534
name="root@0"
15271535
required=""
@@ -1635,6 +1643,7 @@ exports[`with title and description > fixed array 1`] = `
16351643
<!---->
16361644
<input
16371645
aria-describedby="root@1::description root@1::help root@1::errors"
1646+
aria-invalid="false"
16381647
id="root@1"
16391648
name="root@1"
16401649
required=""
@@ -1920,6 +1929,7 @@ exports[`with title and description from both > array icons 1`] = `
19201929
<!---->
19211930
<input
19221931
aria-describedby="root@0::description root@0::help root@0::errors"
1932+
aria-invalid="false"
19231933
id="root@0"
19241934
name="root@0"
19251935
required=""
@@ -2093,6 +2103,7 @@ exports[`with title and description from both > array icons 1`] = `
20932103
<!---->
20942104
<input
20952105
aria-describedby="root@1::description root@1::help root@1::errors"
2106+
aria-invalid="false"
20962107
id="root@1"
20972108
name="root@1"
20982109
required=""
@@ -2377,6 +2388,7 @@ exports[`with title and description from both > fixed array 1`] = `
23772388
<!---->
23782389
<input
23792390
aria-describedby="root@0::description root@0::help root@0::errors"
2391+
aria-invalid="false"
23802392
id="root@0"
23812393
name="root@0"
23822394
required=""
@@ -2490,6 +2502,7 @@ exports[`with title and description from both > fixed array 1`] = `
24902502
<!---->
24912503
<input
24922504
aria-describedby="root@1::description root@1::help root@1::errors"
2505+
aria-invalid="false"
24932506
id="root@1"
24942507
name="root@1"
24952508
required=""
@@ -2775,6 +2788,7 @@ exports[`with title and description from uiSchema > array icons 1`] = `
27752788
<!---->
27762789
<input
27772790
aria-describedby="root@0::description root@0::help root@0::errors"
2791+
aria-invalid="false"
27782792
id="root@0"
27792793
name="root@0"
27802794
required=""
@@ -2948,6 +2962,7 @@ exports[`with title and description from uiSchema > array icons 1`] = `
29482962
<!---->
29492963
<input
29502964
aria-describedby="root@1::description root@1::help root@1::errors"
2965+
aria-invalid="false"
29512966
id="root@1"
29522967
name="root@1"
29532968
required=""
@@ -3232,6 +3247,7 @@ exports[`with title and description from uiSchema > fixed array 1`] = `
32323247
<!---->
32333248
<input
32343249
aria-describedby="root@0::description root@0::help root@0::errors"
3250+
aria-invalid="false"
32353251
id="root@0"
32363252
name="root@0"
32373253
required=""
@@ -3345,6 +3361,7 @@ exports[`with title and description from uiSchema > fixed array 1`] = `
33453361
<!---->
33463362
<input
33473363
aria-describedby="root@1::description root@1::help root@1::errors"
3364+
aria-invalid="false"
33483365
id="root@1"
33493366
name="root@1"
33503367
required=""
@@ -3533,6 +3550,7 @@ exports[`with title and description with global label off > array icons 1`] = `
35333550
<!---->
35343551
<input
35353552
aria-describedby="root@0::description root@0::help root@0::errors"
3553+
aria-invalid="false"
35363554
id="root@0"
35373555
name="root@0"
35383556
required=""
@@ -3671,6 +3689,7 @@ exports[`with title and description with global label off > array icons 1`] = `
36713689
<!---->
36723690
<input
36733691
aria-describedby="root@1::description root@1::help root@1::errors"
3692+
aria-invalid="false"
36743693
id="root@1"
36753694
name="root@1"
36763695
required=""
@@ -3889,6 +3908,7 @@ exports[`with title and description with global label off > fixed array 1`] = `
38893908
<!---->
38903909
<input
38913910
aria-describedby="root@0::description root@0::help root@0::errors"
3911+
aria-invalid="false"
38923912
id="root@0"
38933913
name="root@0"
38943914
required=""
@@ -3967,6 +3987,7 @@ exports[`with title and description with global label off > fixed array 1`] = `
39673987
<!---->
39683988
<input
39693989
aria-describedby="root@1::description root@1::help root@1::errors"
3990+
aria-invalid="false"
39703991
id="root@1"
39713992
name="root@1"
39723993
required=""

0 commit comments

Comments
 (0)