@regardio/react 0.7.0 → 0.7.4
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.mjs +1 -1
- package/dist/blurry-gradient/index.d.mts +3 -3
- package/dist/button/index.d.mts +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/carousel/index.mjs +2 -2
- package/dist/generic-error/index.d.mts +5 -2
- package/dist/generic-error/index.mjs +5 -4
- package/dist/grid/index.mjs +1 -1
- package/dist/heading/index.mjs +1 -1
- package/dist/hooks/use-user.d.mts +10 -10
- package/dist/icon-button/index.d.mts +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/input/index.d.mts +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/link/index.mjs +1 -1
- package/dist/list/index.d.mts +24 -24
- package/dist/list/index.mjs +1 -1
- package/dist/markdown-container/index.mjs +1 -1
- package/dist/password-input/index.d.mts +1 -1
- package/dist/password-input/index.mjs +2 -2
- package/dist/picture/index.mjs +1 -1
- package/dist/utils/text/index.mjs +1 -1
- package/package.json +28 -29
- package/src/generic-error/generic-error.stories.tsx +3 -16
- package/src/generic-error/generic-error.tsx +6 -6
- /package/dist/{button-BiSQpBbc.mjs → button-C2xZwsR7.mjs} +0 -0
- /package/dist/{chunk-BTpB_u-K.mjs → chunk-Bo1DHCg-.mjs} +0 -0
- /package/dist/{index-C_evL5vG.d.mts → index-D5qbAnHh.d.mts} +0 -0
- /package/dist/{index-Bj5_XfEC.d.mts → index-cdadznqR.d.mts} +0 -0
- /package/dist/{input-CtR6aRVi.mjs → input-BjvjCsws.mjs} +0 -0
- /package/dist/{picture-DkX3W5zl.mjs → picture-Cd1Znyh0.mjs} +0 -0
- /package/dist/{text-EQC4zJbE.mjs → text-AWrHS6tk.mjs} +0 -0
|
@@ -6,9 +6,9 @@ interface BlurryGradientProps extends SVGProps<SVGSVGElement> {
|
|
|
6
6
|
secondaryColor: string;
|
|
7
7
|
neutralColor: string;
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
* Accessible description for the gradient (for screen readers)
|
|
10
|
+
* @default 'Decorative blurry gradient'
|
|
11
|
+
*/
|
|
12
12
|
description?: string;
|
|
13
13
|
}
|
|
14
14
|
declare const BlurryGradient: (props: BlurryGradientProps) => React.JSX.Element;
|
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-D5qbAnHh.mjs";
|
|
2
2
|
export { Button, ButtonProps, ButtonSize, ButtonVariant };
|
package/dist/button/index.mjs
CHANGED
package/dist/carousel/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "../chunk-
|
|
2
|
-
import { t as Button } from "../button-
|
|
1
|
+
import { t as __exportAll } from "../chunk-Bo1DHCg-.mjs";
|
|
2
|
+
import { t as Button } from "../button-C2xZwsR7.mjs";
|
|
3
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";
|
|
@@ -30,14 +30,17 @@ declare function getErrorDescriptor(error: unknown): ErrorDescriptor;
|
|
|
30
30
|
* A reusable error boundary component for React Router apps.
|
|
31
31
|
* - Displays status-based messages for route responses
|
|
32
32
|
* - Shows stack traces in development for non-response errors
|
|
33
|
+
* - SSR-safe: accepts optional error prop for server-side rendering
|
|
33
34
|
*
|
|
34
35
|
* For localization, apps may either:
|
|
35
|
-
* - Wrap this component and use `getErrorDescriptor(
|
|
36
|
+
* - Wrap this component and use `getErrorDescriptor(error)` to map to i18n keys
|
|
36
37
|
* - Or provide a custom `renderMessage` to override the displayed details
|
|
37
38
|
*/
|
|
38
39
|
declare function GenericError({
|
|
40
|
+
error,
|
|
39
41
|
renderMessage
|
|
40
|
-
}
|
|
42
|
+
}: {
|
|
43
|
+
error: unknown;
|
|
41
44
|
renderMessage?: (descriptor: ErrorDescriptor) => React.JSX.Element;
|
|
42
45
|
}): React.JSX.Element;
|
|
43
46
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isRouteErrorResponse
|
|
2
|
+
import { isRouteErrorResponse } from "react-router";
|
|
3
3
|
|
|
4
4
|
//#region src/generic-error/generic-error.tsx
|
|
5
5
|
/**
|
|
@@ -37,13 +37,14 @@ function getErrorDescriptor(error) {
|
|
|
37
37
|
* A reusable error boundary component for React Router apps.
|
|
38
38
|
* - Displays status-based messages for route responses
|
|
39
39
|
* - Shows stack traces in development for non-response errors
|
|
40
|
+
* - SSR-safe: accepts optional error prop for server-side rendering
|
|
40
41
|
*
|
|
41
42
|
* For localization, apps may either:
|
|
42
|
-
* - Wrap this component and use `getErrorDescriptor(
|
|
43
|
+
* - Wrap this component and use `getErrorDescriptor(error)` to map to i18n keys
|
|
43
44
|
* - Or provide a custom `renderMessage` to override the displayed details
|
|
44
45
|
*/
|
|
45
|
-
function GenericError({ renderMessage }
|
|
46
|
-
const descriptor = getErrorDescriptor(
|
|
46
|
+
function GenericError({ error, renderMessage }) {
|
|
47
|
+
const descriptor = getErrorDescriptor(error);
|
|
47
48
|
return /* @__PURE__ */ jsxs("main", {
|
|
48
49
|
className: "pt-2xl p-sm container mx-auto",
|
|
49
50
|
children: [/* @__PURE__ */ jsx("h1", { children: descriptor.type === "http" ? `Error ${descriptor.status}` : "Error" }), renderMessage ? renderMessage(descriptor) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", { children: descriptor.type === "http" ? descriptor.defaultMessage : descriptor.type === "error" ? descriptor.message || descriptor.defaultMessage : descriptor.defaultMessage }), import.meta.env.DEV && descriptor.type === "error" && descriptor.stack && /* @__PURE__ */ jsx("pre", {
|
package/dist/grid/index.mjs
CHANGED
package/dist/heading/index.mjs
CHANGED
|
@@ -7,12 +7,12 @@ import { User } from "@supabase/supabase-js";
|
|
|
7
7
|
*/
|
|
8
8
|
interface UserContextType {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* The current authenticated user, or null if not authenticated
|
|
11
|
+
*/
|
|
12
12
|
user: User | null;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* Whether the user data is currently loading
|
|
15
|
+
*/
|
|
16
16
|
isLoading: boolean;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -24,16 +24,16 @@ declare const UserContext: React.Context<UserContextType>;
|
|
|
24
24
|
*/
|
|
25
25
|
interface UserContextProviderProps {
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
* The current authenticated user, or null if not authenticated
|
|
28
|
+
*/
|
|
29
29
|
user: User | null;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
* Whether the user data is currently loading
|
|
32
|
+
*/
|
|
33
33
|
isLoading?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
* Child components that will have access to the user context
|
|
36
|
+
*/
|
|
37
37
|
children: ReactNode;
|
|
38
38
|
}
|
|
39
39
|
/**
|
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-cdadznqR.mjs";
|
|
2
2
|
export { Input, InputProps, InputSize, InputVariant };
|
package/dist/input/index.mjs
CHANGED
package/dist/link/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as lowerCaseSzett } from "../text-
|
|
1
|
+
import { t as lowerCaseSzett } from "../text-AWrHS6tk.mjs";
|
|
2
2
|
import { createContext, useCallback, useContext } from "react";
|
|
3
3
|
import { tv } from "@regardio/tailwind/utils";
|
|
4
4
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
package/dist/list/index.d.mts
CHANGED
|
@@ -4,17 +4,17 @@ import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
|
4
4
|
type ListItemElement = "li" | "dd" | "dt" | "div" | "span";
|
|
5
5
|
type ListItemProps<T extends ListItemElement = "li"> = Omit<ComponentPropsWithoutRef<T>, "children"> & {
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
* The element type to render.
|
|
8
|
+
* Falls back to the defaultItemElement from ListRoot context, or 'li'.
|
|
9
|
+
*/
|
|
10
10
|
render?: T;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* The content of the list item.
|
|
13
|
+
*/
|
|
14
14
|
children?: ReactNode;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
* Ref to the root element.
|
|
17
|
+
*/
|
|
18
18
|
ref?: React.Ref<HTMLElement>;
|
|
19
19
|
};
|
|
20
20
|
declare const ListItem: <T extends ListItemElement = "li">(props: ListItemProps<T>) => React.JSX.Element;
|
|
@@ -25,13 +25,13 @@ declare namespace ListItem {
|
|
|
25
25
|
//#region src/list/list-root-context.d.ts
|
|
26
26
|
interface ListRootContextValue {
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
* Default element type for list items.
|
|
29
|
+
* @default 'li'
|
|
30
|
+
*/
|
|
31
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
|
|
@@ -39,26 +39,26 @@ interface ListRootContextValue {
|
|
|
39
39
|
type ListRootElement = "ul" | "ol" | "dl" | "div" | "menu" | "nav";
|
|
40
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
|
-
|
|
51
|
+
* Default element type for list items.
|
|
52
|
+
* When render is 'dl', defaults to 'dd'. Otherwise defaults to 'li'.
|
|
53
|
+
*/
|
|
54
54
|
defaultItemElement?: ListRootContextValue["defaultItemElement"];
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
* Default className to apply to all list items.
|
|
57
|
+
*/
|
|
58
58
|
defaultItemClassName?: string;
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
* Ref to the root element.
|
|
61
|
+
*/
|
|
62
62
|
ref?: React.Ref<HTMLElement>;
|
|
63
63
|
};
|
|
64
64
|
declare const ListRoot: <T extends ListRootElement = "ul">(props: ListRootProps<T>) => React.JSX.Element;
|
package/dist/list/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Button } from "../button-
|
|
2
|
-
import { t as Input } from "../input-
|
|
1
|
+
import { t as Button } from "../button-C2xZwsR7.mjs";
|
|
2
|
+
import { t as Input } from "../input-BjvjCsws.mjs";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { tv } from "@regardio/tailwind/utils";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/picture/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as wrapSentences, n as replaceSpecialChars, r as shy, t as lowerCaseSzett } from "../../text-
|
|
1
|
+
import { i as wrapSentences, n as replaceSpecialChars, r as shy, t as lowerCaseSzett } from "../../text-AWrHS6tk.mjs";
|
|
2
2
|
|
|
3
3
|
export { lowerCaseSzett, replaceSpecialChars, shy, wrapSentences };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "@regardio/react",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Regardio React UI components",
|
|
7
7
|
"keywords": [
|
|
@@ -215,57 +215,56 @@
|
|
|
215
215
|
"version": "flow-changeset version"
|
|
216
216
|
},
|
|
217
217
|
"dependencies": {
|
|
218
|
-
"@base-ui/react": "1.
|
|
219
|
-
"@maptiler/
|
|
220
|
-
"@maptiler/sdk": "3.10.0",
|
|
218
|
+
"@base-ui/react": "1.1.0",
|
|
219
|
+
"@maptiler/sdk": "3.10.2",
|
|
221
220
|
"@mdx-js/react": "3.1.1",
|
|
222
|
-
"@regardio/js": "0.7.
|
|
223
|
-
"@regardio/tailwind": "0.3.
|
|
224
|
-
"@supabase/supabase-js": "2.
|
|
221
|
+
"@regardio/js": "0.7.1",
|
|
222
|
+
"@regardio/tailwind": "0.3.1",
|
|
223
|
+
"@supabase/supabase-js": "2.93.1",
|
|
225
224
|
"cmdk": "1.1.1",
|
|
226
225
|
"embla-carousel": "8.6.0",
|
|
227
226
|
"embla-carousel-react": "8.6.0",
|
|
228
227
|
"input-otp": "1.4.2",
|
|
229
228
|
"intl-parse-accept-language": "1.0.0",
|
|
230
229
|
"leaflet": "alpha",
|
|
231
|
-
"lucide-react": "0.
|
|
232
|
-
"markdown-to-jsx": "9.
|
|
233
|
-
"react": "19.2.
|
|
230
|
+
"lucide-react": "0.563.0",
|
|
231
|
+
"markdown-to-jsx": "9.6.1",
|
|
232
|
+
"react": "19.2.4",
|
|
234
233
|
"react-day-picker": "9.13.0",
|
|
235
|
-
"react-dom": "19.2.
|
|
234
|
+
"react-dom": "19.2.4",
|
|
236
235
|
"react-hook-form": "7.71.1",
|
|
237
|
-
"react-resizable-panels": "4.
|
|
238
|
-
"react-router": "7.
|
|
236
|
+
"react-resizable-panels": "4.5.2",
|
|
237
|
+
"react-router": "7.13.0",
|
|
239
238
|
"tailwind-variants": "3.2.2",
|
|
240
239
|
"vaul": "1.1.2",
|
|
241
|
-
"zod": "4.3.
|
|
240
|
+
"zod": "4.3.6"
|
|
242
241
|
},
|
|
243
242
|
"devDependencies": {
|
|
244
|
-
"@regardio/dev": "1.
|
|
245
|
-
"@storybook/addon-a11y": "10.
|
|
246
|
-
"@storybook/addon-docs": "10.
|
|
247
|
-
"@storybook/addon-vitest": "10.
|
|
248
|
-
"@storybook/react-vite": "10.
|
|
243
|
+
"@regardio/dev": "1.13.1",
|
|
244
|
+
"@storybook/addon-a11y": "10.2.0",
|
|
245
|
+
"@storybook/addon-docs": "10.2.0",
|
|
246
|
+
"@storybook/addon-vitest": "10.2.0",
|
|
247
|
+
"@storybook/react-vite": "10.2.0",
|
|
249
248
|
"@tailwindcss/vite": "4.1.18",
|
|
250
249
|
"@testing-library/jest-dom": "6.9.1",
|
|
251
|
-
"@testing-library/react": "16.3.
|
|
250
|
+
"@testing-library/react": "16.3.2",
|
|
252
251
|
"@total-typescript/ts-reset": "0.6.1",
|
|
253
252
|
"@types/leaflet": "1.9.21",
|
|
254
|
-
"@types/node": "25.0.
|
|
255
|
-
"@types/react": "19.2.
|
|
253
|
+
"@types/node": "25.0.10",
|
|
254
|
+
"@types/react": "19.2.9",
|
|
256
255
|
"@types/react-dom": "19.2.3",
|
|
257
256
|
"@vitejs/plugin-react": "5.1.2",
|
|
258
|
-
"@vitest/browser-playwright": "4.0.
|
|
259
|
-
"@vitest/coverage-v8": "4.0.
|
|
260
|
-
"@vitest/ui": "4.0.
|
|
257
|
+
"@vitest/browser-playwright": "4.0.18",
|
|
258
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
259
|
+
"@vitest/ui": "4.0.18",
|
|
261
260
|
"jsdom": "27.4.0",
|
|
262
|
-
"playwright": "1.
|
|
263
|
-
"storybook": "10.
|
|
261
|
+
"playwright": "1.58.0",
|
|
262
|
+
"storybook": "10.2.0",
|
|
264
263
|
"tailwindcss": "4.1.18",
|
|
265
|
-
"tsdown": "0.20.
|
|
264
|
+
"tsdown": "0.20.1",
|
|
266
265
|
"typescript": "5.9.3",
|
|
267
266
|
"vite": "7.3.1",
|
|
268
|
-
"vitest": "4.0.
|
|
267
|
+
"vitest": "4.0.18"
|
|
269
268
|
},
|
|
270
269
|
"engines": {
|
|
271
270
|
"node": ">=18"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { createMemoryRouter, RouterProvider } from 'react-router';
|
|
3
2
|
import { GenericError, getErrorDescriptor } from './generic-error';
|
|
4
3
|
|
|
5
4
|
const meta: Meta<typeof GenericError> = {
|
|
@@ -15,21 +14,9 @@ export default meta;
|
|
|
15
14
|
type Story = StoryObj<typeof GenericError>;
|
|
16
15
|
|
|
17
16
|
const ErrorWrapper = ({ status }: { status: number }) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
element: <GenericError />,
|
|
22
|
-
errorElement: <GenericError />,
|
|
23
|
-
loader: () => {
|
|
24
|
-
throw new Response('Not Found', { status, statusText: 'Not Found' });
|
|
25
|
-
},
|
|
26
|
-
path: '/',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
{ initialEntries: ['/'] },
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
return <RouterProvider router={router} />;
|
|
17
|
+
const error = new Response('Not Found', { status, statusText: 'Not Found' });
|
|
18
|
+
|
|
19
|
+
return <GenericError error={error} />;
|
|
33
20
|
};
|
|
34
21
|
|
|
35
22
|
export const Error404: Story = {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { isRouteErrorResponse, useRouteError } from 'react-router';
|
|
1
|
+
import { isRouteErrorResponse } from 'react-router';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Descriptor returned from getErrorDescriptor to help apps localize messages.
|
|
@@ -64,17 +62,19 @@ export function getErrorDescriptor(error: unknown): ErrorDescriptor {
|
|
|
64
62
|
* A reusable error boundary component for React Router apps.
|
|
65
63
|
* - Displays status-based messages for route responses
|
|
66
64
|
* - Shows stack traces in development for non-response errors
|
|
65
|
+
* - SSR-safe: accepts optional error prop for server-side rendering
|
|
67
66
|
*
|
|
68
67
|
* For localization, apps may either:
|
|
69
|
-
* - Wrap this component and use `getErrorDescriptor(
|
|
68
|
+
* - Wrap this component and use `getErrorDescriptor(error)` to map to i18n keys
|
|
70
69
|
* - Or provide a custom `renderMessage` to override the displayed details
|
|
71
70
|
*/
|
|
72
71
|
export function GenericError({
|
|
72
|
+
error,
|
|
73
73
|
renderMessage,
|
|
74
74
|
}: {
|
|
75
|
+
error: unknown;
|
|
75
76
|
renderMessage?: (descriptor: ErrorDescriptor) => React.JSX.Element;
|
|
76
|
-
}
|
|
77
|
-
const error = useRouteError();
|
|
77
|
+
}): React.JSX.Element {
|
|
78
78
|
const descriptor = getErrorDescriptor(error);
|
|
79
79
|
|
|
80
80
|
const title = descriptor.type === 'http' ? `Error ${descriptor.status}` : 'Error';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|