@regardio/react 0.7.3 → 0.7.6
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 +27 -27
- 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.6",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Regardio React UI components",
|
|
7
7
|
"keywords": [
|
|
@@ -215,56 +215,56 @@
|
|
|
215
215
|
"version": "flow-changeset version"
|
|
216
216
|
},
|
|
217
217
|
"dependencies": {
|
|
218
|
-
"@base-ui/react": "1.
|
|
219
|
-
"@maptiler/sdk": "3.10.
|
|
218
|
+
"@base-ui/react": "1.1.0",
|
|
219
|
+
"@maptiler/sdk": "3.10.2",
|
|
220
220
|
"@mdx-js/react": "3.1.1",
|
|
221
|
-
"@regardio/js": "0.7.
|
|
221
|
+
"@regardio/js": "0.7.2",
|
|
222
222
|
"@regardio/tailwind": "0.3.1",
|
|
223
|
-
"@supabase/supabase-js": "2.
|
|
223
|
+
"@supabase/supabase-js": "2.93.3",
|
|
224
224
|
"cmdk": "1.1.1",
|
|
225
225
|
"embla-carousel": "8.6.0",
|
|
226
226
|
"embla-carousel-react": "8.6.0",
|
|
227
227
|
"input-otp": "1.4.2",
|
|
228
228
|
"intl-parse-accept-language": "1.0.0",
|
|
229
229
|
"leaflet": "alpha",
|
|
230
|
-
"lucide-react": "0.
|
|
231
|
-
"markdown-to-jsx": "9.
|
|
232
|
-
"react": "19.2.
|
|
230
|
+
"lucide-react": "0.563.0",
|
|
231
|
+
"markdown-to-jsx": "9.6.1",
|
|
232
|
+
"react": "19.2.4",
|
|
233
233
|
"react-day-picker": "9.13.0",
|
|
234
|
-
"react-dom": "19.2.
|
|
234
|
+
"react-dom": "19.2.4",
|
|
235
235
|
"react-hook-form": "7.71.1",
|
|
236
|
-
"react-resizable-panels": "4.4
|
|
237
|
-
"react-router": "7.
|
|
236
|
+
"react-resizable-panels": "4.5.4",
|
|
237
|
+
"react-router": "7.13.0",
|
|
238
238
|
"tailwind-variants": "3.2.2",
|
|
239
239
|
"vaul": "1.1.2",
|
|
240
|
-
"zod": "4.3.
|
|
240
|
+
"zod": "4.3.6"
|
|
241
241
|
},
|
|
242
242
|
"devDependencies": {
|
|
243
|
-
"@regardio/dev": "1.
|
|
244
|
-
"@storybook/addon-a11y": "10.1
|
|
245
|
-
"@storybook/addon-docs": "10.1
|
|
246
|
-
"@storybook/addon-vitest": "10.1
|
|
247
|
-
"@storybook/react-vite": "10.1
|
|
243
|
+
"@regardio/dev": "1.13.2",
|
|
244
|
+
"@storybook/addon-a11y": "10.2.1",
|
|
245
|
+
"@storybook/addon-docs": "10.2.1",
|
|
246
|
+
"@storybook/addon-vitest": "10.2.1",
|
|
247
|
+
"@storybook/react-vite": "10.2.1",
|
|
248
248
|
"@tailwindcss/vite": "4.1.18",
|
|
249
249
|
"@testing-library/jest-dom": "6.9.1",
|
|
250
|
-
"@testing-library/react": "16.3.
|
|
250
|
+
"@testing-library/react": "16.3.2",
|
|
251
251
|
"@total-typescript/ts-reset": "0.6.1",
|
|
252
252
|
"@types/leaflet": "1.9.21",
|
|
253
|
-
"@types/node": "25.0
|
|
254
|
-
"@types/react": "19.2.
|
|
253
|
+
"@types/node": "25.1.0",
|
|
254
|
+
"@types/react": "19.2.10",
|
|
255
255
|
"@types/react-dom": "19.2.3",
|
|
256
256
|
"@vitejs/plugin-react": "5.1.2",
|
|
257
|
-
"@vitest/browser-playwright": "4.0.
|
|
258
|
-
"@vitest/coverage-v8": "4.0.
|
|
259
|
-
"@vitest/ui": "4.0.
|
|
257
|
+
"@vitest/browser-playwright": "4.0.18",
|
|
258
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
259
|
+
"@vitest/ui": "4.0.18",
|
|
260
260
|
"jsdom": "27.4.0",
|
|
261
|
-
"playwright": "1.
|
|
262
|
-
"storybook": "10.1
|
|
261
|
+
"playwright": "1.58.0",
|
|
262
|
+
"storybook": "10.2.1",
|
|
263
263
|
"tailwindcss": "4.1.18",
|
|
264
|
-
"tsdown": "0.20.
|
|
264
|
+
"tsdown": "0.20.1",
|
|
265
265
|
"typescript": "5.9.3",
|
|
266
266
|
"vite": "7.3.1",
|
|
267
|
-
"vitest": "4.0.
|
|
267
|
+
"vitest": "4.0.18"
|
|
268
268
|
},
|
|
269
269
|
"engines": {
|
|
270
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
|