@regardio/react 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/background-slideshow/index.d.mts +1 -3
- package/dist/blurry-gradient/index.d.mts +4 -5
- package/dist/button/index.d.mts +1 -1
- package/dist/carousel/index.d.mts +42 -8
- package/dist/carousel/index.mjs +11 -16
- package/dist/checkbox/index.d.mts +7 -16
- package/dist/checkbox-group/index.d.mts +3 -4
- package/dist/countdown/index.d.mts +1 -3
- package/dist/field/index.d.mts +40 -38
- package/dist/fieldset/index.d.mts +15 -14
- package/dist/form/index.d.mts +2 -3
- package/dist/generic-error/index.d.mts +20 -23
- package/dist/grid/index.d.mts +77 -1173
- package/dist/grid/index.mjs +5 -7
- package/dist/heading/index.d.mts +7 -11
- package/dist/heading/index.mjs +2 -3
- package/dist/highlight/index.d.mts +2 -3
- package/dist/hooks/use-current-route-data.d.mts +4 -4
- package/dist/hooks/use-current-route-data.mjs +3 -1
- package/dist/hooks/use-focus-search.mjs +2 -0
- package/dist/hooks/use-matches-data.d.mts +5 -5
- package/dist/hooks/use-matches-data.mjs +2 -0
- package/dist/hooks/use-media-query.d.mts +4 -4
- package/dist/hooks/use-media-query.mjs +2 -0
- package/dist/hooks/use-mobile.mjs +2 -0
- package/dist/hooks/use-nonce.d.mts +2 -4
- package/dist/hooks/use-orientation.d.mts +6 -6
- package/dist/hooks/use-orientation.mjs +2 -0
- package/dist/hooks/use-user.d.mts +23 -25
- package/dist/icon-button/index.d.mts +4 -5
- package/dist/if/index.d.mts +2 -4
- package/dist/if/index.mjs +4 -4
- package/dist/{index-Bm-tWhsb.d.mts → index-Bj5_XfEC.d.mts} +2 -3
- package/dist/{index-YT2CkvL6.d.mts → index-C_evL5vG.d.mts} +4 -5
- package/dist/input/index.d.mts +1 -1
- package/dist/link/index.d.mts +9 -11
- package/dist/link/index.mjs +3 -3
- package/dist/list/index.d.mts +39 -38
- package/dist/list/index.mjs +7 -7
- package/dist/markdown-container/index.d.mts +1 -1
- package/dist/markdown-container/index.mjs +1 -1
- package/dist/password-input/index.d.mts +4 -5
- package/dist/picture/index.d.mts +10 -10
- package/dist/protected-email/index.d.mts +9 -11
- package/dist/radio/index.d.mts +7 -16
- package/dist/radio-group/index.d.mts +3 -4
- package/dist/slider/index.d.mts +19 -41
- package/dist/switch/index.d.mts +7 -16
- package/dist/text/index.d.mts +2 -3
- package/dist/{text-CPlUND-Z.mjs → text-EQC4zJbE.mjs} +7 -13
- package/dist/toggle/index.d.mts +4 -38
- package/dist/utils/text/index.d.mts +5 -5
- package/dist/utils/text/index.mjs +1 -1
- package/package.json +170 -10
- package/src/background-slideshow/background-slideshow.tsx +1 -2
- package/src/blurry-gradient/blurry-gradient.tsx +1 -1
- package/src/button/button.stories.tsx +1 -1
- package/src/button/button.tsx +7 -1
- package/src/carousel/carousel-content.tsx +17 -14
- package/src/carousel/carousel-item.tsx +18 -18
- package/src/carousel/carousel-next.tsx +21 -16
- package/src/carousel/carousel-previous.tsx +21 -16
- package/src/carousel/carousel-root.tsx +91 -86
- package/src/checkbox/checkbox.tsx +14 -3
- package/src/checkbox-group/checkbox-group.tsx +1 -1
- package/src/countdown/countdown.tsx +1 -1
- package/src/field/field.stories.tsx +1 -1
- package/src/field/field.tsx +27 -6
- package/src/fieldset/fieldset.stories.tsx +1 -1
- package/src/fieldset/fieldset.tsx +14 -3
- package/src/form/form.stories.tsx +1 -1
- package/src/form/form.tsx +1 -1
- package/src/generic-error/generic-error.tsx +2 -3
- package/src/grid/grid-item.tsx +77 -36
- package/src/grid/grid-root.tsx +49 -22
- package/src/heading/heading.tsx +7 -3
- package/src/highlight/highlight.tsx +1 -1
- package/src/hooks/use-current-route-data.ts +4 -2
- package/src/hooks/use-focus-search.ts +3 -1
- package/src/hooks/use-matches-data.ts +2 -0
- package/src/hooks/use-media-query.ts +2 -0
- package/src/hooks/use-mobile.ts +3 -1
- package/src/hooks/use-nonce.ts +3 -3
- package/src/hooks/use-orientation.ts +2 -0
- package/src/hooks/use-user.tsx +3 -2
- package/src/icon-button/icon-button.tsx +1 -1
- package/src/if/if.tsx +3 -1
- package/src/input/input.stories.tsx +1 -1
- package/src/input/input.tsx +1 -1
- package/src/link/link.tsx +4 -3
- package/src/list/list-item.tsx +10 -13
- package/src/list/list-root-context.ts +3 -3
- package/src/list/list-root.tsx +10 -13
- package/src/password-input/password-input.tsx +1 -1
- package/src/protected-email/protected-email.tsx +6 -1
- package/src/radio/radio.tsx +14 -3
- package/src/radio-group/radio-group.tsx +5 -1
- package/src/slider/slider.tsx +29 -7
- package/src/switch/switch.tsx +14 -3
- package/src/text/text.tsx +6 -1
- package/src/toggle/toggle.tsx +3 -3
- package/src/utils/text/text.tsx +8 -16
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
|
|
3
1
|
//#region src/background-slideshow/background-slideshow.d.ts
|
|
4
2
|
type ImageData = {
|
|
5
3
|
at: Record<string, string>;
|
|
@@ -31,6 +29,6 @@ declare function BackgroundSlideshow({
|
|
|
31
29
|
slideshowInterval,
|
|
32
30
|
transitionDuration,
|
|
33
31
|
filter
|
|
34
|
-
}: BackgroundSlideshowProps):
|
|
32
|
+
}: BackgroundSlideshowProps): React.JSX.Element;
|
|
35
33
|
//#endregion
|
|
36
34
|
export { BackgroundSlideshow, type BackgroundSlideshowProps, type ImageData };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SVGProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
2
|
|
|
4
3
|
//#region src/blurry-gradient/blurry-gradient.d.ts
|
|
5
4
|
interface BlurryGradientProps extends SVGProps<SVGSVGElement> {
|
|
@@ -7,11 +6,11 @@ interface BlurryGradientProps extends SVGProps<SVGSVGElement> {
|
|
|
7
6
|
secondaryColor: string;
|
|
8
7
|
neutralColor: string;
|
|
9
8
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* Accessible description for the gradient (for screen readers)
|
|
10
|
+
* @default 'Decorative blurry gradient'
|
|
11
|
+
*/
|
|
13
12
|
description?: string;
|
|
14
13
|
}
|
|
15
|
-
declare const BlurryGradient: (props: BlurryGradientProps) =>
|
|
14
|
+
declare const BlurryGradient: (props: BlurryGradientProps) => React.JSX.Element;
|
|
16
15
|
//#endregion
|
|
17
16
|
export { BlurryGradient, type BlurryGradientProps };
|
package/dist/button/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ButtonVariant, n as ButtonProps, r as ButtonSize, t as Button } from "../index-
|
|
1
|
+
import { i as ButtonVariant, n as ButtonProps, r as ButtonSize, t as Button } from "../index-C_evL5vG.mjs";
|
|
2
2
|
export { Button, ButtonProps, ButtonSize, ButtonVariant };
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import * as react11 from "react";
|
|
2
1
|
import { HTMLAttributes } from "react";
|
|
3
2
|
import { EmblaCarouselType, EmblaOptionsType } from "embla-carousel";
|
|
4
3
|
|
|
5
4
|
//#region src/carousel/carousel-item.d.ts
|
|
6
5
|
interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
|
|
6
|
+
"aria-label"?: string;
|
|
7
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
8
8
|
}
|
|
9
|
-
declare const CarouselItem:
|
|
9
|
+
declare const CarouselItem: ({
|
|
10
|
+
className,
|
|
11
|
+
ref,
|
|
12
|
+
...props
|
|
13
|
+
}: CarouselItemProps) => React.JSX.Element;
|
|
10
14
|
//#endregion
|
|
11
15
|
//#region src/carousel/carousel-root.d.ts
|
|
12
16
|
type CarouselApi = EmblaCarouselType;
|
|
@@ -21,18 +25,48 @@ declare function useCarousel(): CarouselContextValue;
|
|
|
21
25
|
interface CarouselRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
22
26
|
opts?: EmblaOptionsType;
|
|
23
27
|
setApi?: (api: CarouselApi) => void;
|
|
24
|
-
orientation?:
|
|
28
|
+
orientation?: "horizontal" | "vertical";
|
|
29
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
30
|
}
|
|
26
|
-
declare const CarouselRoot:
|
|
31
|
+
declare const CarouselRoot: ({
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
opts,
|
|
35
|
+
orientation,
|
|
36
|
+
setApi,
|
|
37
|
+
ref,
|
|
38
|
+
...props
|
|
39
|
+
}: CarouselRootProps) => React.JSX.Element;
|
|
27
40
|
//#endregion
|
|
28
41
|
//#region src/carousel/carousel-content.d.ts
|
|
29
|
-
|
|
42
|
+
interface CarouselContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
44
|
+
}
|
|
45
|
+
declare const CarouselContent: ({
|
|
46
|
+
className,
|
|
47
|
+
ref,
|
|
48
|
+
...props
|
|
49
|
+
}: CarouselContentProps) => React.JSX.Element;
|
|
30
50
|
//#endregion
|
|
31
51
|
//#region src/carousel/carousel-next.d.ts
|
|
32
|
-
|
|
52
|
+
interface CarouselNextProps extends HTMLAttributes<HTMLButtonElement> {
|
|
53
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
54
|
+
}
|
|
55
|
+
declare const CarouselNext: ({
|
|
56
|
+
className,
|
|
57
|
+
ref,
|
|
58
|
+
...props
|
|
59
|
+
}: CarouselNextProps) => React.JSX.Element;
|
|
33
60
|
//#endregion
|
|
34
61
|
//#region src/carousel/carousel-previous.d.ts
|
|
35
|
-
|
|
62
|
+
interface CarouselPreviousProps extends HTMLAttributes<HTMLButtonElement> {
|
|
63
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
64
|
+
}
|
|
65
|
+
declare const CarouselPrevious: ({
|
|
66
|
+
className,
|
|
67
|
+
ref,
|
|
68
|
+
...props
|
|
69
|
+
}: CarouselPreviousProps) => React.JSX.Element;
|
|
36
70
|
declare namespace index_parts_d_exports {
|
|
37
71
|
export { CarouselContent as Content, CarouselItem as Item, CarouselNext as Next, CarouselPrevious as Previous, CarouselRoot as Root };
|
|
38
72
|
}
|
package/dist/carousel/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BTpB_u-K.mjs";
|
|
2
2
|
import { t as Button } from "../button-BiSQpBbc.mjs";
|
|
3
|
-
import { createContext,
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import useEmblaCarousel from "embla-carousel-react";
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ function useCarousel() {
|
|
|
11
11
|
if (!context) throw new Error("useCarousel must be used within a <Carousel.Root />");
|
|
12
12
|
return context;
|
|
13
13
|
}
|
|
14
|
-
const CarouselRoot =
|
|
14
|
+
const CarouselRoot = function CarouselRoot({ children, className, opts, orientation = "horizontal", setApi, ref, ...props }) {
|
|
15
15
|
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
16
16
|
...opts,
|
|
17
17
|
axis: orientation === "horizontal" ? "x" : "y"
|
|
@@ -72,23 +72,21 @@ const CarouselRoot = forwardRef(({ children, className, opts, orientation = "hor
|
|
|
72
72
|
})
|
|
73
73
|
})
|
|
74
74
|
});
|
|
75
|
-
}
|
|
76
|
-
CarouselRoot.displayName = "CarouselRoot";
|
|
75
|
+
};
|
|
77
76
|
|
|
78
77
|
//#endregion
|
|
79
78
|
//#region src/carousel/carousel-content.tsx
|
|
80
|
-
const CarouselContent =
|
|
79
|
+
const CarouselContent = function CarouselContent({ className, ref, ...props }) {
|
|
81
80
|
return /* @__PURE__ */ jsx("div", {
|
|
82
81
|
className,
|
|
83
82
|
ref,
|
|
84
83
|
...props
|
|
85
84
|
});
|
|
86
|
-
}
|
|
87
|
-
CarouselContent.displayName = "CarouselContent";
|
|
85
|
+
};
|
|
88
86
|
|
|
89
87
|
//#endregion
|
|
90
88
|
//#region src/carousel/carousel-item.tsx
|
|
91
|
-
const CarouselItem =
|
|
89
|
+
const CarouselItem = function CarouselItem({ className, ref, ...props }) {
|
|
92
90
|
return /* @__PURE__ */ jsx("div", {
|
|
93
91
|
"aria-roledescription": "slide",
|
|
94
92
|
className,
|
|
@@ -96,12 +94,11 @@ const CarouselItem = forwardRef(({ className, ...props }, ref) => {
|
|
|
96
94
|
role: "group",
|
|
97
95
|
...props
|
|
98
96
|
});
|
|
99
|
-
}
|
|
100
|
-
CarouselItem.displayName = "CarouselItem";
|
|
97
|
+
};
|
|
101
98
|
|
|
102
99
|
//#endregion
|
|
103
100
|
//#region src/carousel/carousel-next.tsx
|
|
104
|
-
const CarouselNext =
|
|
101
|
+
const CarouselNext = function CarouselNext({ className, ref, ...props }) {
|
|
105
102
|
const { canScrollNext, scrollNext } = useCarousel();
|
|
106
103
|
return /* @__PURE__ */ jsx(Button, {
|
|
107
104
|
className,
|
|
@@ -110,12 +107,11 @@ const CarouselNext = forwardRef(({ className, ...props }, ref) => {
|
|
|
110
107
|
ref,
|
|
111
108
|
...props
|
|
112
109
|
});
|
|
113
|
-
}
|
|
114
|
-
CarouselNext.displayName = "CarouselNext";
|
|
110
|
+
};
|
|
115
111
|
|
|
116
112
|
//#endregion
|
|
117
113
|
//#region src/carousel/carousel-previous.tsx
|
|
118
|
-
const CarouselPrevious =
|
|
114
|
+
const CarouselPrevious = function CarouselPrevious({ className, ref, ...props }) {
|
|
119
115
|
const { canScrollPrev, scrollPrev } = useCarousel();
|
|
120
116
|
return /* @__PURE__ */ jsx(Button, {
|
|
121
117
|
className,
|
|
@@ -124,8 +120,7 @@ const CarouselPrevious = forwardRef(({ className, ...props }, ref) => {
|
|
|
124
120
|
ref,
|
|
125
121
|
...props
|
|
126
122
|
});
|
|
127
|
-
}
|
|
128
|
-
CarouselPrevious.displayName = "CarouselPrevious";
|
|
123
|
+
};
|
|
129
124
|
|
|
130
125
|
//#endregion
|
|
131
126
|
//#region src/carousel/index.parts.ts
|
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
2
|
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
4
3
|
|
|
5
4
|
//#region src/checkbox/checkbox.d.ts
|
|
6
|
-
type CheckboxSize =
|
|
7
|
-
interface CheckboxRootProps extends Omit<ComponentProps<typeof Checkbox$1.Root>,
|
|
5
|
+
type CheckboxSize = "sm" | "md" | "lg";
|
|
6
|
+
interface CheckboxRootProps extends Omit<ComponentProps<typeof Checkbox$1.Root>, "className"> {
|
|
8
7
|
className?: string;
|
|
9
8
|
size?: CheckboxSize;
|
|
10
9
|
}
|
|
11
|
-
interface CheckboxIndicatorProps extends Omit<ComponentProps<typeof Checkbox$1.Indicator>,
|
|
10
|
+
interface CheckboxIndicatorProps extends Omit<ComponentProps<typeof Checkbox$1.Indicator>, "className"> {
|
|
12
11
|
className?: string;
|
|
13
12
|
}
|
|
14
13
|
declare const CheckboxRoot: ({
|
|
15
14
|
className,
|
|
16
15
|
size,
|
|
17
16
|
...props
|
|
18
|
-
}: CheckboxRootProps) =>
|
|
17
|
+
}: CheckboxRootProps) => React.JSX.Element;
|
|
19
18
|
declare const CheckboxIndicator: ({
|
|
20
19
|
className,
|
|
21
20
|
children,
|
|
22
21
|
...props
|
|
23
|
-
}: CheckboxIndicatorProps) =>
|
|
22
|
+
}: CheckboxIndicatorProps) => React.JSX.Element;
|
|
24
23
|
declare const Checkbox: {
|
|
25
|
-
Indicator:
|
|
26
|
-
|
|
27
|
-
children,
|
|
28
|
-
...props
|
|
29
|
-
}: CheckboxIndicatorProps) => react_jsx_runtime7.JSX.Element;
|
|
30
|
-
Root: ({
|
|
31
|
-
className,
|
|
32
|
-
size,
|
|
33
|
-
...props
|
|
34
|
-
}: CheckboxRootProps) => react_jsx_runtime7.JSX.Element;
|
|
24
|
+
Indicator: typeof CheckboxIndicator;
|
|
25
|
+
Root: typeof CheckboxRoot;
|
|
35
26
|
};
|
|
36
27
|
//#endregion
|
|
37
28
|
export { Checkbox, CheckboxIndicator, type CheckboxIndicatorProps, CheckboxRoot, type CheckboxRootProps, type CheckboxSize };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime23 from "react/jsx-runtime";
|
|
3
2
|
import { CheckboxGroup as CheckboxGroup$1 } from "@base-ui/react/checkbox-group";
|
|
4
3
|
|
|
5
4
|
//#region src/checkbox-group/checkbox-group.d.ts
|
|
6
|
-
type CheckboxGroupOrientation =
|
|
7
|
-
interface CheckboxGroupProps extends Omit<ComponentProps<typeof CheckboxGroup$1>,
|
|
5
|
+
type CheckboxGroupOrientation = "horizontal" | "vertical";
|
|
6
|
+
interface CheckboxGroupProps extends Omit<ComponentProps<typeof CheckboxGroup$1>, "className"> {
|
|
8
7
|
className?: string;
|
|
9
8
|
orientation?: CheckboxGroupOrientation;
|
|
10
9
|
}
|
|
@@ -12,6 +11,6 @@ declare const CheckboxGroup: ({
|
|
|
12
11
|
className,
|
|
13
12
|
orientation,
|
|
14
13
|
...props
|
|
15
|
-
}: CheckboxGroupProps) =>
|
|
14
|
+
}: CheckboxGroupProps) => React.JSX.Element;
|
|
16
15
|
//#endregion
|
|
17
16
|
export { CheckboxGroup, type CheckboxGroupOrientation, type CheckboxGroupProps };
|
package/dist/field/index.d.mts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import * as react2 from "react";
|
|
2
1
|
import { ComponentProps, ReactNode } from "react";
|
|
3
|
-
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
4
|
-
import * as _base_ui_react_field0 from "@base-ui/react/field";
|
|
5
2
|
import { Field as Field$1 } from "@base-ui/react/field";
|
|
6
3
|
|
|
7
4
|
//#region src/field/field.d.ts
|
|
@@ -10,57 +7,62 @@ declare const fieldRootVariants: {
|
|
|
10
7
|
readonly required: readonly ["after:content-[\"*\"]", "after:ml-1", "after:text-red-500"];
|
|
11
8
|
};
|
|
12
9
|
type FieldRootVariant = keyof typeof fieldRootVariants;
|
|
13
|
-
type FieldLabelVariant =
|
|
14
|
-
type FieldDescriptionVariant =
|
|
15
|
-
type FieldItemLayout =
|
|
16
|
-
interface FieldRootProps extends Omit<ComponentProps<typeof Field$1.Root>,
|
|
10
|
+
type FieldLabelVariant = "default" | "error";
|
|
11
|
+
type FieldDescriptionVariant = "default" | "error";
|
|
12
|
+
type FieldItemLayout = "default" | "horizontal";
|
|
13
|
+
interface FieldRootProps extends Omit<ComponentProps<typeof Field$1.Root>, "className"> {
|
|
17
14
|
className?: string;
|
|
18
15
|
variant?: FieldRootVariant;
|
|
19
16
|
}
|
|
20
|
-
interface FieldLabelProps extends Omit<ComponentProps<typeof Field$1.Label>,
|
|
17
|
+
interface FieldLabelProps extends Omit<ComponentProps<typeof Field$1.Label>, "className"> {
|
|
21
18
|
className?: string;
|
|
22
19
|
variant?: FieldLabelVariant;
|
|
23
20
|
}
|
|
24
|
-
interface FieldDescriptionProps extends Omit<ComponentProps<typeof Field$1.Description>,
|
|
21
|
+
interface FieldDescriptionProps extends Omit<ComponentProps<typeof Field$1.Description>, "className"> {
|
|
25
22
|
className?: string;
|
|
26
23
|
variant?: FieldDescriptionVariant;
|
|
27
24
|
}
|
|
28
|
-
interface FieldErrorProps extends Omit<ComponentProps<typeof Field$1.Error>,
|
|
25
|
+
interface FieldErrorProps extends Omit<ComponentProps<typeof Field$1.Error>, "className"> {
|
|
29
26
|
className?: string;
|
|
30
27
|
}
|
|
31
|
-
interface FieldItemProps extends ComponentProps<
|
|
28
|
+
interface FieldItemProps extends ComponentProps<"div"> {
|
|
32
29
|
className?: string;
|
|
33
30
|
layout?: FieldItemLayout;
|
|
34
31
|
children: ReactNode;
|
|
35
32
|
}
|
|
33
|
+
declare const FieldRoot: ({
|
|
34
|
+
className,
|
|
35
|
+
variant,
|
|
36
|
+
...props
|
|
37
|
+
}: FieldRootProps) => React.JSX.Element;
|
|
38
|
+
declare const FieldLabel: ({
|
|
39
|
+
className,
|
|
40
|
+
variant,
|
|
41
|
+
...props
|
|
42
|
+
}: FieldLabelProps) => React.JSX.Element;
|
|
43
|
+
declare const FieldDescription: ({
|
|
44
|
+
className,
|
|
45
|
+
variant,
|
|
46
|
+
...props
|
|
47
|
+
}: FieldDescriptionProps) => React.JSX.Element;
|
|
48
|
+
declare const FieldError: ({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: FieldErrorProps) => React.JSX.Element;
|
|
52
|
+
declare const FieldItem: ({
|
|
53
|
+
className,
|
|
54
|
+
layout,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}: FieldItemProps) => React.JSX.Element;
|
|
36
58
|
declare const Field: {
|
|
37
|
-
Control:
|
|
38
|
-
Description:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className,
|
|
45
|
-
...props
|
|
46
|
-
}: FieldErrorProps) => react_jsx_runtime12.JSX.Element;
|
|
47
|
-
Item: ({
|
|
48
|
-
className,
|
|
49
|
-
layout,
|
|
50
|
-
children,
|
|
51
|
-
...props
|
|
52
|
-
}: FieldItemProps) => react_jsx_runtime12.JSX.Element;
|
|
53
|
-
Label: ({
|
|
54
|
-
className,
|
|
55
|
-
variant,
|
|
56
|
-
...props
|
|
57
|
-
}: FieldLabelProps) => react_jsx_runtime12.JSX.Element;
|
|
58
|
-
Root: ({
|
|
59
|
-
className,
|
|
60
|
-
variant,
|
|
61
|
-
...props
|
|
62
|
-
}: FieldRootProps) => react_jsx_runtime12.JSX.Element;
|
|
63
|
-
Validity: react2.FC<_base_ui_react_field0.FieldValidityProps>;
|
|
59
|
+
Control: typeof Field$1.Control;
|
|
60
|
+
Description: typeof FieldDescription;
|
|
61
|
+
Error: typeof FieldError;
|
|
62
|
+
Item: typeof FieldItem;
|
|
63
|
+
Label: typeof FieldLabel;
|
|
64
|
+
Root: typeof FieldRoot;
|
|
65
|
+
Validity: typeof Field$1.Validity;
|
|
64
66
|
};
|
|
65
67
|
//#endregion
|
|
66
68
|
export { Field, type FieldDescriptionProps, type FieldDescriptionVariant, type FieldErrorProps, type FieldItemLayout, type FieldItemProps, type FieldLabelProps, type FieldLabelVariant, type FieldRootProps, type FieldRootVariant };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
2
|
import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
|
|
4
3
|
|
|
5
4
|
//#region src/fieldset/fieldset.d.ts
|
|
@@ -8,26 +7,28 @@ declare const fieldsetRootVariants: {
|
|
|
8
7
|
readonly default: readonly ["space-y-4"];
|
|
9
8
|
};
|
|
10
9
|
type FieldsetRootVariant = keyof typeof fieldsetRootVariants;
|
|
11
|
-
type FieldsetLegendSize =
|
|
12
|
-
interface FieldsetRootProps extends Omit<ComponentProps<typeof Fieldset$1.Root>,
|
|
10
|
+
type FieldsetLegendSize = "default" | "small";
|
|
11
|
+
interface FieldsetRootProps extends Omit<ComponentProps<typeof Fieldset$1.Root>, "className"> {
|
|
13
12
|
className?: string;
|
|
14
13
|
variant?: FieldsetRootVariant;
|
|
15
14
|
}
|
|
16
|
-
interface FieldsetLegendProps extends Omit<ComponentProps<typeof Fieldset$1.Legend>,
|
|
15
|
+
interface FieldsetLegendProps extends Omit<ComponentProps<typeof Fieldset$1.Legend>, "className"> {
|
|
17
16
|
className?: string;
|
|
18
17
|
size?: FieldsetLegendSize;
|
|
19
18
|
}
|
|
19
|
+
declare const FieldsetRoot: ({
|
|
20
|
+
className,
|
|
21
|
+
variant,
|
|
22
|
+
...props
|
|
23
|
+
}: FieldsetRootProps) => React.JSX.Element;
|
|
24
|
+
declare const FieldsetLegend: ({
|
|
25
|
+
className,
|
|
26
|
+
size,
|
|
27
|
+
...props
|
|
28
|
+
}: FieldsetLegendProps) => React.JSX.Element;
|
|
20
29
|
declare const Fieldset: {
|
|
21
|
-
Legend:
|
|
22
|
-
|
|
23
|
-
size,
|
|
24
|
-
...props
|
|
25
|
-
}: FieldsetLegendProps) => react_jsx_runtime1.JSX.Element;
|
|
26
|
-
Root: ({
|
|
27
|
-
className,
|
|
28
|
-
variant,
|
|
29
|
-
...props
|
|
30
|
-
}: FieldsetRootProps) => react_jsx_runtime1.JSX.Element;
|
|
30
|
+
Legend: typeof FieldsetLegend;
|
|
31
|
+
Root: typeof FieldsetRoot;
|
|
31
32
|
};
|
|
32
33
|
//#endregion
|
|
33
34
|
export { Fieldset, type FieldsetLegendProps, type FieldsetLegendSize, type FieldsetRootProps, type FieldsetRootVariant };
|
package/dist/form/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime30 from "react/jsx-runtime";
|
|
3
2
|
import { Form as Form$1 } from "@base-ui/react/form";
|
|
4
3
|
|
|
5
4
|
//#region src/form/form.d.ts
|
|
@@ -9,7 +8,7 @@ declare const formVariants: {
|
|
|
9
8
|
readonly inline: readonly ["flex", "flex-wrap", "gap-4", "items-end"];
|
|
10
9
|
};
|
|
11
10
|
type FormVariant = keyof typeof formVariants;
|
|
12
|
-
interface FormProps extends Omit<ComponentProps<typeof Form$1>,
|
|
11
|
+
interface FormProps extends Omit<ComponentProps<typeof Form$1>, "className"> {
|
|
13
12
|
className?: string;
|
|
14
13
|
variant?: FormVariant;
|
|
15
14
|
}
|
|
@@ -17,6 +16,6 @@ declare const Form: ({
|
|
|
17
16
|
className,
|
|
18
17
|
variant,
|
|
19
18
|
...props
|
|
20
|
-
}: FormProps) =>
|
|
19
|
+
}: FormProps) => React.JSX.Element;
|
|
21
20
|
//#endregion
|
|
22
21
|
export { Form, type FormProps, type FormVariant };
|
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
|
|
3
1
|
//#region src/generic-error/generic-error.d.ts
|
|
4
|
-
|
|
5
2
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
* Descriptor returned from getErrorDescriptor to help apps localize messages.
|
|
4
|
+
*/
|
|
8
5
|
type ErrorDescriptor = {
|
|
9
|
-
type:
|
|
6
|
+
type: "http";
|
|
10
7
|
status: number;
|
|
11
8
|
statusText: string;
|
|
12
9
|
defaultId: string;
|
|
13
10
|
defaultMessage: string;
|
|
14
11
|
} | {
|
|
15
|
-
type:
|
|
12
|
+
type: "error";
|
|
16
13
|
defaultId: string;
|
|
17
14
|
defaultMessage: string;
|
|
18
15
|
message?: string;
|
|
19
16
|
stack?: string;
|
|
20
17
|
} | {
|
|
21
|
-
type:
|
|
18
|
+
type: "unknown";
|
|
22
19
|
defaultId: string;
|
|
23
20
|
defaultMessage: string;
|
|
24
21
|
};
|
|
25
22
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
* Compute a normalized error descriptor from a React Router error.
|
|
24
|
+
* Apps can use this to map to i18n keys.
|
|
25
|
+
*/
|
|
29
26
|
declare function getErrorDescriptor(error: unknown): ErrorDescriptor;
|
|
30
27
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
* GenericError
|
|
29
|
+
*
|
|
30
|
+
* A reusable error boundary component for React Router apps.
|
|
31
|
+
* - Displays status-based messages for route responses
|
|
32
|
+
* - Shows stack traces in development for non-response errors
|
|
33
|
+
*
|
|
34
|
+
* For localization, apps may either:
|
|
35
|
+
* - Wrap this component and use `getErrorDescriptor(useRouteError())` to map to i18n keys
|
|
36
|
+
* - Or provide a custom `renderMessage` to override the displayed details
|
|
37
|
+
*/
|
|
41
38
|
declare function GenericError({
|
|
42
39
|
renderMessage
|
|
43
40
|
}?: {
|
|
44
|
-
renderMessage?: (descriptor: ErrorDescriptor) =>
|
|
45
|
-
}):
|
|
41
|
+
renderMessage?: (descriptor: ErrorDescriptor) => React.JSX.Element;
|
|
42
|
+
}): React.JSX.Element;
|
|
46
43
|
//#endregion
|
|
47
44
|
export { type ErrorDescriptor, GenericError, getErrorDescriptor };
|