@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
package/dist/grid/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BTpB_u-K.mjs";
|
|
2
|
-
import { createContext,
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
3
|
import { tv } from "@regardio/tailwind/utils";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -141,7 +141,7 @@ const gridItem = tv({
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
|
-
const GridItem =
|
|
144
|
+
const GridItem = function GridItem({ children, className, classNames, span, spanXs, spanSm, spanMd, spanLg, spanXl, start, end, rowSpan, ref, ...props }) {
|
|
145
145
|
return /* @__PURE__ */ jsx("div", {
|
|
146
146
|
className: gridItem({
|
|
147
147
|
end,
|
|
@@ -158,8 +158,7 @@ const GridItem = forwardRef(({ children, className, classNames, span, spanXs, sp
|
|
|
158
158
|
...props,
|
|
159
159
|
children
|
|
160
160
|
});
|
|
161
|
-
}
|
|
162
|
-
GridItem.displayName = "GridItem";
|
|
161
|
+
};
|
|
163
162
|
|
|
164
163
|
//#endregion
|
|
165
164
|
//#region src/grid/grid-root.tsx
|
|
@@ -193,7 +192,7 @@ function useGrid() {
|
|
|
193
192
|
if (!context) throw new Error("useGrid must be used within a <Grid.Root />");
|
|
194
193
|
return context;
|
|
195
194
|
}
|
|
196
|
-
const GridRoot =
|
|
195
|
+
const GridRoot = function GridRoot({ children, className, classNames, flow, align, ref, ...props }) {
|
|
197
196
|
const styles = grid({
|
|
198
197
|
align,
|
|
199
198
|
flow
|
|
@@ -207,8 +206,7 @@ const GridRoot = forwardRef(({ children, className, classNames, flow, align, ...
|
|
|
207
206
|
children
|
|
208
207
|
})
|
|
209
208
|
});
|
|
210
|
-
}
|
|
211
|
-
GridRoot.displayName = "GridRoot";
|
|
209
|
+
};
|
|
212
210
|
|
|
213
211
|
//#endregion
|
|
214
212
|
//#region src/grid/index.parts.ts
|
package/dist/heading/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes } from "react";
|
|
2
|
-
import * as react_jsx_runtime52 from "react/jsx-runtime";
|
|
3
2
|
|
|
4
3
|
//#region src/heading/heading.d.ts
|
|
5
4
|
declare const levelVariants: {
|
|
@@ -17,15 +16,12 @@ interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
|
17
16
|
level?: HeadingLevel;
|
|
18
17
|
locale?: string;
|
|
19
18
|
}
|
|
20
|
-
declare const Heading: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}: HeadingProps): react_jsx_runtime52.JSX.Element;
|
|
28
|
-
displayName: string;
|
|
29
|
-
};
|
|
19
|
+
declare const Heading: ({
|
|
20
|
+
as,
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
level,
|
|
24
|
+
...props
|
|
25
|
+
}: HeadingProps) => React.JSX.Element;
|
|
30
26
|
//#endregion
|
|
31
27
|
export { Heading, type HeadingLevel, type HeadingProps };
|
package/dist/heading/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as shy, t as lowerCaseSzett } from "../text-
|
|
1
|
+
import { r as shy, t as lowerCaseSzett } from "../text-EQC4zJbE.mjs";
|
|
2
2
|
import { cn, tv } from "@regardio/tailwind/utils";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ const heading = tv({
|
|
|
15
15
|
6: ["text-xs"]
|
|
16
16
|
} }
|
|
17
17
|
});
|
|
18
|
-
const Heading = ({ as, children, className, level = 2, ...props })
|
|
18
|
+
const Heading = function Heading({ as, children, className, level = 2, ...props }) {
|
|
19
19
|
const word = lowerCaseSzett(shy(children));
|
|
20
20
|
return /* @__PURE__ */ jsx(as || `h${level}`, {
|
|
21
21
|
className: cn(heading({ level }), className),
|
|
@@ -23,7 +23,6 @@ const Heading = ({ as, children, className, level = 2, ...props }) => {
|
|
|
23
23
|
children: word
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
Heading.displayName = "Heading";
|
|
27
26
|
|
|
28
27
|
//#endregion
|
|
29
28
|
export { Heading };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime49 from "react/jsx-runtime";
|
|
3
2
|
|
|
4
3
|
//#region src/highlight/highlight.d.ts
|
|
5
4
|
declare const highlightVariants: {
|
|
6
5
|
readonly primary: readonly ["highlight"];
|
|
7
6
|
};
|
|
8
7
|
type HighlightVariant = keyof typeof highlightVariants;
|
|
9
|
-
interface HighlightProps extends ComponentProps<
|
|
8
|
+
interface HighlightProps extends ComponentProps<"mark"> {
|
|
10
9
|
variant?: HighlightVariant;
|
|
11
10
|
}
|
|
12
11
|
declare const Highlight: ({
|
|
13
12
|
children,
|
|
14
13
|
className,
|
|
15
14
|
variant
|
|
16
|
-
}: HighlightProps) =>
|
|
15
|
+
}: HighlightProps) => React.JSX.Element;
|
|
17
16
|
//#endregion
|
|
18
17
|
export { Highlight, type HighlightProps };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/hooks/use-current-route-data.d.ts
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function useCurrentRouteData<HeaderData>():
|
|
3
|
+
* This base hook is used to access data related to the current route
|
|
4
|
+
* @returns {JSON|undefined} The router data or undefined if not found
|
|
5
|
+
*/
|
|
6
|
+
declare function useCurrentRouteData<HeaderData>(): HeaderData | undefined;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { useCurrentRouteData };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { useMemo } from "react";
|
|
2
4
|
import { useLocation, useMatches } from "react-router";
|
|
3
5
|
|
|
@@ -13,7 +15,7 @@ function useCurrentRouteData() {
|
|
|
13
15
|
return matchingRoutes.find((route) => {
|
|
14
16
|
return route.pathname === location.pathname;
|
|
15
17
|
});
|
|
16
|
-
}, [matchingRoutes, location])?.
|
|
18
|
+
}, [matchingRoutes, location])?.loaderData || void 0;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/hooks/use-matches-data.d.ts
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
* This base hook is used in other hooks to quickly search for specific data
|
|
4
|
+
* across all loader data using useMatches.
|
|
5
|
+
* @param {string} id The route id
|
|
6
|
+
* @returns {JSON|undefined} The router data or undefined if not found
|
|
7
|
+
*/
|
|
8
8
|
declare function useMatchesData<T>(id: string): T | undefined;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { useMatchesData };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/hooks/use-media-query.d.ts
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
* A hook that returns a boolean indicating whether the current viewport matches the provided media query
|
|
4
|
+
* @param query The media query to check against (e.g. '(min-width: 768px)')
|
|
5
|
+
* @returns A boolean indicating whether the media query matches
|
|
6
|
+
*/
|
|
7
7
|
declare function useMediaQuery(query: string): boolean;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { useMediaQuery };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as react0 from "react";
|
|
2
|
-
|
|
3
1
|
//#region src/hooks/use-nonce.d.ts
|
|
4
|
-
declare const NonceContext:
|
|
5
|
-
declare const NonceProvider:
|
|
2
|
+
declare const NonceContext: React.Context<string>;
|
|
3
|
+
declare const NonceProvider: React.Provider<string>;
|
|
6
4
|
declare const useNonce: () => string;
|
|
7
5
|
//#endregion
|
|
8
6
|
export { NonceContext, NonceProvider, useNonce };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/hooks/use-orientation.d.ts
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Orientation =
|
|
3
|
+
* Orientation type representing device orientation
|
|
4
|
+
*/
|
|
5
|
+
type Orientation = "portrait" | "landscape";
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
* Hook that tracks the current device orientation
|
|
8
|
+
* @returns The current orientation ('portrait' or 'landscape')
|
|
9
|
+
*/
|
|
10
10
|
declare function useOrientation(): Orientation;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Orientation, useOrientation };
|
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
import * as react1 from "react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
2
|
import { User } from "@supabase/supabase-js";
|
|
5
3
|
|
|
6
4
|
//#region src/hooks/use-user.d.ts
|
|
7
5
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
* Context for storing and accessing the current authenticated user
|
|
7
|
+
*/
|
|
10
8
|
interface UserContextType {
|
|
11
9
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
* The current authenticated user, or null if not authenticated
|
|
11
|
+
*/
|
|
14
12
|
user: User | null;
|
|
15
13
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* Whether the user data is currently loading
|
|
15
|
+
*/
|
|
18
16
|
isLoading: boolean;
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
declare const UserContext:
|
|
19
|
+
* Context for storing and accessing the current authenticated user
|
|
20
|
+
*/
|
|
21
|
+
declare const UserContext: React.Context<UserContextType>;
|
|
24
22
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
* Props for the UserContextProvider component
|
|
24
|
+
*/
|
|
27
25
|
interface UserContextProviderProps {
|
|
28
26
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
* The current authenticated user, or null if not authenticated
|
|
28
|
+
*/
|
|
31
29
|
user: User | null;
|
|
32
30
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
* Whether the user data is currently loading
|
|
32
|
+
*/
|
|
35
33
|
isLoading?: boolean;
|
|
36
34
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
* Child components that will have access to the user context
|
|
36
|
+
*/
|
|
39
37
|
children: ReactNode;
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
* Provider component for the UserContext
|
|
41
|
+
*/
|
|
44
42
|
declare function UserContextProvider({
|
|
45
43
|
user,
|
|
46
44
|
isLoading,
|
|
47
45
|
children
|
|
48
|
-
}: UserContextProviderProps):
|
|
46
|
+
}: UserContextProviderProps): React.JSX.Element;
|
|
49
47
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
* Hook to access the current authenticated user from the UserContext
|
|
49
|
+
* @returns The current user context containing the user object and loading state
|
|
50
|
+
*/
|
|
53
51
|
declare function useUser(): UserContextType;
|
|
54
52
|
//#endregion
|
|
55
53
|
export { UserContext, UserContextProvider, UserContextProviderProps, UserContextType, useUser };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as Button } from "../index-
|
|
1
|
+
import { t as Button } from "../index-C_evL5vG.mjs";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
|
-
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
4
3
|
|
|
5
4
|
//#region src/icon-button/icon-button.d.ts
|
|
6
5
|
declare const iconButtonVariants: {
|
|
@@ -10,11 +9,11 @@ declare const iconButtonVariants: {
|
|
|
10
9
|
readonly sm: readonly ["p-1"];
|
|
11
10
|
};
|
|
12
11
|
type IconButtonSize = keyof typeof iconButtonVariants;
|
|
13
|
-
interface IconButtonProps extends Omit<ComponentProps<typeof Button>,
|
|
12
|
+
interface IconButtonProps extends Omit<ComponentProps<typeof Button>, "size"> {
|
|
14
13
|
icon: ReactNode;
|
|
15
14
|
size?: IconButtonSize;
|
|
16
15
|
title?: string;
|
|
17
|
-
|
|
16
|
+
"aria-label"?: string;
|
|
18
17
|
children?: never;
|
|
19
18
|
}
|
|
20
19
|
declare const IconButton: ({
|
|
@@ -24,6 +23,6 @@ declare const IconButton: ({
|
|
|
24
23
|
"aria-label": ariaLabel,
|
|
25
24
|
className,
|
|
26
25
|
...props
|
|
27
|
-
}: IconButtonProps) =>
|
|
26
|
+
}: IconButtonProps) => React.JSX.Element;
|
|
28
27
|
//#endregion
|
|
29
28
|
export { IconButton, type IconButtonProps };
|
package/dist/if/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
1
|
//#region src/if/if.d.ts
|
|
4
|
-
type Condition<Value = unknown> = Value | false | null | undefined | 0 |
|
|
2
|
+
type Condition<Value = unknown> = Value | false | null | undefined | 0 | "";
|
|
5
3
|
declare function If<Value = unknown>({
|
|
6
4
|
condition,
|
|
7
5
|
children,
|
|
@@ -10,6 +8,6 @@ declare function If<Value = unknown>({
|
|
|
10
8
|
condition: Condition<Value>;
|
|
11
9
|
children: React.ReactNode | ((value: Value) => React.ReactNode);
|
|
12
10
|
fallback?: React.ReactNode;
|
|
13
|
-
}>):
|
|
11
|
+
}>): React.JSX.Element | null;
|
|
14
12
|
//#endregion
|
|
15
13
|
export { If };
|
package/dist/if/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/if/if.tsx
|
|
5
5
|
function If({ condition, children, fallback }) {
|
|
6
6
|
return useMemo(() => {
|
|
7
7
|
if (condition) {
|
|
8
|
-
if (typeof children === "function") return /* @__PURE__ */ jsx(Fragment, { children: children(condition) });
|
|
9
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
8
|
+
if (typeof children === "function") return /* @__PURE__ */ jsx(Fragment$1, { children: children(condition) });
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
10
10
|
}
|
|
11
|
-
if (fallback) return /* @__PURE__ */ jsx(Fragment, { children: fallback });
|
|
11
|
+
if (fallback) return /* @__PURE__ */ jsx(Fragment$1, { children: fallback });
|
|
12
12
|
return null;
|
|
13
13
|
}, [
|
|
14
14
|
condition,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
2
|
import { Input } from "@base-ui/react/input";
|
|
4
3
|
|
|
5
4
|
//#region src/input/input.d.ts
|
|
@@ -15,7 +14,7 @@ declare const inputSizes: {
|
|
|
15
14
|
};
|
|
16
15
|
type InputVariant = keyof typeof inputVariants;
|
|
17
16
|
type InputSize = keyof typeof inputSizes;
|
|
18
|
-
interface InputProps extends Omit<ComponentProps<typeof Input>,
|
|
17
|
+
interface InputProps extends Omit<ComponentProps<typeof Input>, "className" | "size"> {
|
|
19
18
|
className?: string;
|
|
20
19
|
variant?: InputVariant;
|
|
21
20
|
size?: InputSize;
|
|
@@ -25,6 +24,6 @@ declare const Input$1: ({
|
|
|
25
24
|
variant,
|
|
26
25
|
size,
|
|
27
26
|
...props
|
|
28
|
-
}: InputProps) =>
|
|
27
|
+
}: InputProps) => React.JSX.Element;
|
|
29
28
|
//#endregion
|
|
30
29
|
export { InputVariant as i, InputProps as n, InputSize as r, Input$1 as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
import * as react_jsx_runtime46 from "react/jsx-runtime";
|
|
3
2
|
import { Button } from "@base-ui/react/button";
|
|
4
3
|
|
|
5
4
|
//#region src/button/button.d.ts
|
|
@@ -11,7 +10,7 @@ declare const buttonVariants: {
|
|
|
11
10
|
readonly secondary: readonly ["bg-gray-100", "text-gray-900", "border-gray-300", "hover:bg-gray-200", "hover:border-gray-400", "focus-visible:ring-2", "focus-visible:ring-gray-500", "focus-visible:ring-offset-2"];
|
|
12
11
|
};
|
|
13
12
|
declare const buttonSizes: {
|
|
14
|
-
readonly
|
|
13
|
+
readonly "2xl": readonly ["px-10", "py-5", "text-2xl", "font-medium", "rounded-lg"];
|
|
15
14
|
readonly lg: readonly ["px-6", "py-3", "text-lg", "font-medium", "rounded-lg"];
|
|
16
15
|
readonly md: readonly ["px-4", "py-2", "text-base", "font-medium", "rounded-md"];
|
|
17
16
|
readonly sm: readonly ["px-3", "py-1.5", "text-sm", "font-medium", "rounded-md"];
|
|
@@ -19,11 +18,11 @@ declare const buttonSizes: {
|
|
|
19
18
|
};
|
|
20
19
|
type ButtonVariant = keyof typeof buttonVariants;
|
|
21
20
|
type ButtonSize = keyof typeof buttonSizes;
|
|
22
|
-
interface ButtonProps extends Omit<ComponentProps<typeof Button>,
|
|
21
|
+
interface ButtonProps extends Omit<ComponentProps<typeof Button>, "className"> {
|
|
23
22
|
variant?: ButtonVariant;
|
|
24
23
|
size?: ButtonSize;
|
|
25
24
|
className?: string;
|
|
26
|
-
type?:
|
|
25
|
+
type?: "button" | "submit" | "reset";
|
|
27
26
|
}
|
|
28
27
|
declare const Button$1: ({
|
|
29
28
|
children,
|
|
@@ -31,6 +30,6 @@ declare const Button$1: ({
|
|
|
31
30
|
variant,
|
|
32
31
|
size,
|
|
33
32
|
...props
|
|
34
|
-
}: ButtonProps) =>
|
|
33
|
+
}: ButtonProps) => React.JSX.Element;
|
|
35
34
|
//#endregion
|
|
36
35
|
export { ButtonVariant as i, ButtonProps as n, ButtonSize as r, Button$1 as t };
|
package/dist/input/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as InputVariant, n as InputProps, r as InputSize, t as Input } from "../index-
|
|
1
|
+
import { i as InputVariant, n as InputProps, r as InputSize, t as Input } from "../index-Bj5_XfEC.mjs";
|
|
2
2
|
export { Input, InputProps, InputSize, InputVariant };
|
package/dist/link/index.d.mts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import * as react10 from "react";
|
|
2
|
-
import * as react_jsx_runtime43 from "react/jsx-runtime";
|
|
3
1
|
import { NavLinkProps } from "react-router";
|
|
4
2
|
|
|
5
3
|
//#region src/link/link.d.ts
|
|
6
4
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
* Context for providing a path resolver function.
|
|
6
|
+
* This allows projects to inject their own localization logic.
|
|
7
|
+
*/
|
|
10
8
|
type PathResolver = (routeKey: string) => string;
|
|
11
|
-
declare const PathResolverProvider:
|
|
9
|
+
declare const PathResolverProvider: React.Provider<PathResolver | null>;
|
|
12
10
|
declare function usePathResolver(): PathResolver | null;
|
|
13
|
-
interface LinkBaseProps extends Omit<NavLinkProps,
|
|
11
|
+
interface LinkBaseProps extends Omit<NavLinkProps, "to"> {
|
|
14
12
|
to?: string | Partial<{
|
|
15
13
|
pathname?: string;
|
|
16
14
|
search?: string;
|
|
@@ -27,7 +25,7 @@ declare const LinkBase: ({
|
|
|
27
25
|
onClick,
|
|
28
26
|
viewTransition,
|
|
29
27
|
...props
|
|
30
|
-
}: LinkBaseProps) =>
|
|
28
|
+
}: LinkBaseProps) => React.JSX.Element;
|
|
31
29
|
declare const arrowVariants: {
|
|
32
30
|
readonly darr: "darr";
|
|
33
31
|
readonly larr: "larr";
|
|
@@ -44,7 +42,7 @@ declare const linkVariants: {
|
|
|
44
42
|
};
|
|
45
43
|
type LinkArrow = keyof typeof arrowVariants;
|
|
46
44
|
type LinkVariant = keyof typeof linkVariants;
|
|
47
|
-
interface LinkProps extends Omit<NavLinkProps,
|
|
45
|
+
interface LinkProps extends Omit<NavLinkProps, "to"> {
|
|
48
46
|
arrow?: LinkArrow;
|
|
49
47
|
to?: string | Partial<{
|
|
50
48
|
pathname?: string;
|
|
@@ -64,8 +62,8 @@ declare const Link: ({
|
|
|
64
62
|
variant,
|
|
65
63
|
viewTransition,
|
|
66
64
|
...props
|
|
67
|
-
}: LinkProps) =>
|
|
68
|
-
interface MarkdownLinkProps extends Omit<LinkProps,
|
|
65
|
+
}: LinkProps) => React.JSX.Element;
|
|
66
|
+
interface MarkdownLinkProps extends Omit<LinkProps, "to"> {
|
|
69
67
|
href?: string;
|
|
70
68
|
}
|
|
71
69
|
declare const MarkdownLink: React.FC<MarkdownLinkProps>;
|
package/dist/link/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as lowerCaseSzett } from "../text-
|
|
1
|
+
import { t as lowerCaseSzett } from "../text-EQC4zJbE.mjs";
|
|
2
2
|
import { createContext, useCallback, useContext } from "react";
|
|
3
3
|
import { tv } from "@regardio/tailwind/utils";
|
|
4
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { NavLink } from "react-router";
|
|
6
6
|
|
|
7
7
|
//#region src/link/link.tsx
|
|
@@ -37,7 +37,7 @@ const LinkBase = ({ className, to, routeKey, children, onClick, viewTransition =
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
}, [onClick, path]);
|
|
40
|
-
if (!path) return /* @__PURE__ */ jsx(Fragment, { children: typeof children === "function" ? null : children });
|
|
40
|
+
if (!path) return /* @__PURE__ */ jsx(Fragment$1, { children: typeof children === "function" ? null : children });
|
|
41
41
|
if (isExternal) {
|
|
42
42
|
const externalState = {
|
|
43
43
|
isActive: false,
|
package/dist/list/index.d.mts
CHANGED
|
@@ -1,68 +1,69 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef,
|
|
2
|
-
import * as react_jsx_runtime45 from "react/jsx-runtime";
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/list/list-item.d.ts
|
|
5
|
-
type ListItemElement =
|
|
6
|
-
type ListItemProps<T extends ListItemElement =
|
|
4
|
+
type ListItemElement = "li" | "dd" | "dt" | "div" | "span";
|
|
5
|
+
type ListItemProps<T extends ListItemElement = "li"> = Omit<ComponentPropsWithoutRef<T>, "children"> & {
|
|
7
6
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
* The element type to render.
|
|
8
|
+
* Falls back to the defaultItemElement from ListRoot context, or 'li'.
|
|
9
|
+
*/
|
|
11
10
|
render?: T;
|
|
12
11
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* The content of the list item.
|
|
13
|
+
*/
|
|
15
14
|
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Ref to the root element.
|
|
17
|
+
*/
|
|
18
|
+
ref?: React.Ref<HTMLElement>;
|
|
16
19
|
};
|
|
17
|
-
declare
|
|
18
|
-
declare const ListItem: <T extends ListItemElement = "li">(props: ListItemProps<T> & {
|
|
19
|
-
ref?: ForwardedRef<HTMLElement>;
|
|
20
|
-
}) => ReturnType<typeof ListItemImpl>;
|
|
20
|
+
declare const ListItem: <T extends ListItemElement = "li">(props: ListItemProps<T>) => React.JSX.Element;
|
|
21
21
|
declare namespace ListItem {
|
|
22
|
-
type Props<T extends ListItemElement =
|
|
22
|
+
type Props<T extends ListItemElement = "li"> = ListItemProps<T>;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/list/list-root-context.d.ts
|
|
26
26
|
interface ListRootContextValue {
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
defaultItemElement:
|
|
28
|
+
* Default element type for list items.
|
|
29
|
+
* @default 'li'
|
|
30
|
+
*/
|
|
31
|
+
defaultItemElement: "li" | "dd" | "dt" | "div" | "span";
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
* Default className to apply to all list items.
|
|
34
|
+
*/
|
|
35
35
|
defaultItemClassName?: string;
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/list/list-root.d.ts
|
|
39
|
-
type ListRootElement =
|
|
40
|
-
type ListRootProps<T extends ListRootElement =
|
|
39
|
+
type ListRootElement = "ul" | "ol" | "dl" | "div" | "menu" | "nav";
|
|
40
|
+
type ListRootProps<T extends ListRootElement = "ul"> = Omit<ComponentPropsWithoutRef<T>, "children"> & {
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
* The element type to render.
|
|
43
|
+
* @default 'ul'
|
|
44
|
+
*/
|
|
45
45
|
render?: T;
|
|
46
46
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
* The content of the list.
|
|
48
|
+
*/
|
|
49
49
|
children?: ReactNode;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
defaultItemElement?: ListRootContextValue[
|
|
51
|
+
* Default element type for list items.
|
|
52
|
+
* When render is 'dl', defaults to 'dd'. Otherwise defaults to 'li'.
|
|
53
|
+
*/
|
|
54
|
+
defaultItemElement?: ListRootContextValue["defaultItemElement"];
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
* Default className to apply to all list items.
|
|
57
|
+
*/
|
|
58
58
|
defaultItemClassName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Ref to the root element.
|
|
61
|
+
*/
|
|
62
|
+
ref?: React.Ref<HTMLElement>;
|
|
59
63
|
};
|
|
60
|
-
declare
|
|
61
|
-
declare const ListRoot: <T extends ListRootElement = "ul">(props: ListRootProps<T> & {
|
|
62
|
-
ref?: ForwardedRef<HTMLElement>;
|
|
63
|
-
}) => ReturnType<typeof ListRootImpl>;
|
|
64
|
+
declare const ListRoot: <T extends ListRootElement = "ul">(props: ListRootProps<T>) => React.JSX.Element;
|
|
64
65
|
declare namespace ListRoot {
|
|
65
|
-
type Props<T extends ListRootElement =
|
|
66
|
+
type Props<T extends ListRootElement = "ul"> = ListRootProps<T>;
|
|
66
67
|
}
|
|
67
68
|
declare namespace index_parts_d_exports {
|
|
68
69
|
export { ListItem as Item, ListRoot as Root };
|