@regardio/react 0.4.7 → 0.5.1
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/LICENSE +1 -1
- package/README.md +5 -5
- package/dist/{components/background-slideshow.js → background-slideshow/index.js} +2 -11
- package/dist/{components/blurry-gradient.js → blurry-gradient/index.js} +15 -9
- package/dist/{components/carousel.d.ts → carousel/index.d.ts} +17 -9
- package/dist/{components/carousel.js → carousel/index.js} +34 -30
- package/dist/{components/countdown.js → countdown/index.js} +2 -11
- package/dist/{components/generic-error.js → generic-error/index.js} +1 -1
- package/dist/grid/index.d.ts +1196 -0
- package/dist/grid/index.js +239 -0
- package/dist/heading/index.d.ts +24 -0
- package/dist/{components/heading.js → heading/index.js} +15 -34
- package/dist/highlight/index.d.ts +13 -0
- package/dist/{components/highlight.js → highlight/index.js} +9 -17
- package/dist/hooks/{use-current-route-data.js → use-current-route-data/index.js} +1 -1
- package/dist/hooks/{use-focus-search.js → use-focus-search/index.js} +1 -1
- package/dist/hooks/{use-matches-data.js → use-matches-data/index.js} +1 -1
- package/dist/hooks/{use-media-query.js → use-media-query/index.js} +1 -1
- package/dist/hooks/{use-mobile.js → use-mobile/index.js} +1 -1
- package/dist/hooks/use-nonce/index.d.ts +6 -0
- package/dist/hooks/use-nonce/index.js +8 -0
- package/dist/hooks/{use-orientation.d.ts → use-orientation/index.d.ts} +1 -1
- package/dist/hooks/{use-orientation.js → use-orientation/index.js} +1 -1
- package/dist/hooks/{use-user.js → use-user/index.js} +1 -1
- package/dist/{components/icon-button.js → icon-button/index.js} +1 -1
- package/dist/{components/if.js → if/index.js} +1 -1
- package/dist/{components/iframe.js → iframe/index.js} +2 -11
- package/dist/{components/link.d.ts → link/index.d.ts} +19 -13
- package/dist/{components/link.js → link/index.js} +31 -36
- package/dist/list/index.d.ts +69 -0
- package/dist/list/index.js +65 -0
- package/dist/{components/markdown-container.js → markdown-container/index.js} +3 -67
- package/dist/{components/password-input.js → password-input/index.js} +2 -11
- package/dist/{components/picture.js → picture/index.js} +2 -11
- package/dist/{components/protected-email.d.ts → protected-email/index.d.ts} +1 -1
- package/dist/{components/protected-email.js → protected-email/index.js} +1 -1
- package/dist/text/index.d.ts +20 -0
- package/dist/text/index.js +38 -0
- package/dist/utils/author/index.d.ts +3 -0
- package/dist/utils/author/index.js +33 -0
- package/dist/utils/text/index.d.ts +15 -0
- package/dist/utils/text/index.js +73 -0
- package/package.json +92 -121
- package/src/{stories/BackgroundSlideshow.stories.tsx → background-slideshow/background-slideshow.stories.tsx} +1 -1
- package/src/{components → background-slideshow}/background-slideshow.tsx +3 -1
- package/src/background-slideshow/index.ts +2 -0
- package/src/{stories/BlurryGradient.stories.tsx → blurry-gradient/blurry-gradient.stories.tsx} +1 -1
- package/src/{components → blurry-gradient}/blurry-gradient.tsx +14 -8
- package/src/blurry-gradient/index.ts +2 -0
- package/src/carousel/carousel-content.tsx +16 -0
- package/src/carousel/carousel-item.tsx +23 -0
- package/src/carousel/carousel-next.tsx +22 -0
- package/src/carousel/carousel-previous.tsx +22 -0
- package/src/{components/carousel.tsx → carousel/carousel-root.tsx} +8 -78
- package/src/carousel/carousel.stories.tsx +89 -0
- package/src/carousel/index.parts.ts +5 -0
- package/src/carousel/index.ts +4 -0
- package/src/{stories/Countdown.stories.tsx → countdown/countdown.stories.tsx} +1 -1
- package/src/{components → countdown}/countdown.tsx +3 -7
- package/src/countdown/index.ts +1 -0
- package/src/{stories/GenericError.stories.tsx → generic-error/generic-error.stories.tsx} +1 -1
- package/src/{components → generic-error}/generic-error.tsx +2 -0
- package/src/generic-error/index.ts +2 -0
- package/src/grid/grid-item.tsx +188 -0
- package/src/grid/grid-root.tsx +72 -0
- package/src/grid/grid.stories.tsx +236 -0
- package/src/grid/index.parts.ts +2 -0
- package/src/grid/index.ts +5 -0
- package/src/{stories/Heading.stories.tsx → heading/heading.stories.tsx} +1 -1
- package/src/{components → heading}/heading.tsx +17 -25
- package/src/heading/index.ts +2 -0
- package/src/{stories/Highlight.stories.tsx → highlight/highlight.stories.tsx} +1 -1
- package/src/{components → highlight}/highlight.tsx +13 -9
- package/src/highlight/index.ts +2 -0
- package/src/hooks/use-current-route-data/index.ts +1 -0
- package/src/hooks/use-focus-search/index.ts +1 -0
- package/src/hooks/use-matches-data/index.ts +1 -0
- package/src/hooks/use-media-query/index.ts +1 -0
- package/src/hooks/use-mobile/index.ts +1 -0
- package/src/hooks/use-nonce/index.ts +1 -0
- package/src/hooks/use-orientation/index.ts +1 -0
- package/src/hooks/use-user/index.ts +2 -0
- package/src/{stories/IconButton.stories.tsx → icon-button/icon-button.stories.tsx} +1 -1
- package/src/icon-button/index.ts +2 -0
- package/src/{stories/If.stories.tsx → if/if.stories.tsx} +1 -1
- package/src/if/index.ts +1 -0
- package/src/{stories/Iframe.stories.tsx → iframe/iframe.stories.tsx} +1 -1
- package/src/{components → iframe}/iframe.tsx +1 -1
- package/src/iframe/index.ts +2 -0
- package/src/link/index.ts +2 -0
- package/src/{stories/Link.stories.tsx → link/link.stories.tsx} +1 -1
- package/src/{components → link}/link.tsx +39 -28
- package/src/list/index.parts.ts +2 -0
- package/src/list/index.ts +4 -0
- package/src/list/list-item.tsx +63 -0
- package/src/list/list-root-context.ts +21 -0
- package/src/list/list-root.tsx +81 -0
- package/src/list/list.css +32 -0
- package/src/list/list.stories.tsx +119 -0
- package/src/list/list.test.tsx +168 -0
- package/src/markdown-container/index.ts +2 -0
- package/src/{stories/MarkdownContainer.stories.tsx → markdown-container/markdown-container.stories.tsx} +1 -1
- package/src/{components → markdown-container}/markdown-container.tsx +3 -1
- package/src/password-input/index.ts +2 -0
- package/src/{stories/PasswordInput.stories.tsx → password-input/password-input.stories.tsx} +1 -1
- package/src/{components → password-input}/password-input.tsx +4 -4
- package/src/picture/index.ts +2 -0
- package/src/{stories/Picture.stories.tsx → picture/picture.stories.tsx} +1 -1
- package/src/{components → picture}/picture.tsx +2 -4
- package/src/protected-email/index.ts +2 -0
- package/src/{stories/ProtectedEmail.stories.tsx → protected-email/protected-email.stories.tsx} +1 -1
- package/src/{components → protected-email}/protected-email.tsx +3 -1
- package/src/tailwind.css +10 -0
- package/src/text/index.ts +2 -0
- package/src/{stories/Text.stories.tsx → text/text.stories.tsx} +1 -1
- package/src/text/text.tsx +46 -0
- package/src/utils/author/author.tsx +36 -0
- package/src/utils/author/index.ts +1 -0
- package/src/utils/text/index.ts +1 -0
- package/src/utils/text/text.tsx +103 -0
- package/dist/components/box.d.ts +0 -20
- package/dist/components/box.js +0 -50
- package/dist/components/definition-list.d.ts +0 -43
- package/dist/components/definition-list.js +0 -89
- package/dist/components/heading.d.ts +0 -27
- package/dist/components/highlight.d.ts +0 -19
- package/dist/components/item.d.ts +0 -70
- package/dist/components/item.js +0 -512
- package/dist/components/leaflet-map.d.ts +0 -34
- package/dist/components/leaflet-map.js +0 -201
- package/dist/components/list-item.d.ts +0 -19
- package/dist/components/list-item.js +0 -37
- package/dist/components/maptiler-map.d.ts +0 -27
- package/dist/components/maptiler-map.js +0 -129
- package/dist/components/text.d.ts +0 -20
- package/dist/components/text.js +0 -45
- package/dist/components/unordered-list.d.ts +0 -19
- package/dist/components/unordered-list.js +0 -39
- package/dist/hooks/use-nonce.d.ts +0 -12
- package/dist/hooks/use-nonce.js +0 -13
- package/dist/utils/author.d.ts +0 -9
- package/dist/utils/author.js +0 -55
- package/dist/utils/cn.d.ts +0 -9
- package/dist/utils/cn.js +0 -14
- package/dist/utils/is-route-active.d.ts +0 -19
- package/dist/utils/is-route-active.js +0 -56
- package/dist/utils/text.d.ts +0 -24
- package/dist/utils/text.js +0 -127
- package/src/components/box.tsx +0 -45
- package/src/components/definition-list.tsx +0 -90
- package/src/components/item.tsx +0 -340
- package/src/components/leaflet-map.tsx +0 -294
- package/src/components/link.test.tsx +0 -387
- package/src/components/list-item.tsx +0 -30
- package/src/components/maptiler-map.tsx +0 -181
- package/src/components/text.tsx +0 -38
- package/src/components/unordered-list.tsx +0 -32
- package/src/hooks/use-nonce.test.ts +0 -35
- package/src/stories/Box.stories.tsx +0 -83
- package/src/stories/Carousel.stories.tsx +0 -95
- package/src/stories/DefinitionList.stories.tsx +0 -51
- package/src/stories/Item.stories.tsx +0 -79
- package/src/stories/ListItem.stories.tsx +0 -38
- package/src/stories/UnorderedList.stories.tsx +0 -73
- package/src/styles/tailwind.css +0 -7
- package/src/test-setup.ts +0 -1
- package/src/utils/author.test.ts +0 -54
- package/src/utils/author.tsx +0 -73
- package/src/utils/cn.test.ts +0 -48
- package/src/utils/cn.ts +0 -14
- package/src/utils/is-route-active.test.ts +0 -80
- package/src/utils/is-route-active.ts +0 -100
- package/src/utils/text.test.ts +0 -152
- package/src/utils/text.tsx +0 -209
- package/src/vite-env.d.ts +0 -1
- /package/dist/{components/background-slideshow.d.ts → background-slideshow/index.d.ts} +0 -0
- /package/dist/{components/blurry-gradient.d.ts → blurry-gradient/index.d.ts} +0 -0
- /package/dist/{components/countdown.d.ts → countdown/index.d.ts} +0 -0
- /package/dist/{components/generic-error.d.ts → generic-error/index.d.ts} +0 -0
- /package/dist/hooks/{use-current-route-data.d.ts → use-current-route-data/index.d.ts} +0 -0
- /package/dist/hooks/{use-focus-search.d.ts → use-focus-search/index.d.ts} +0 -0
- /package/dist/hooks/{use-matches-data.d.ts → use-matches-data/index.d.ts} +0 -0
- /package/dist/hooks/{use-media-query.d.ts → use-media-query/index.d.ts} +0 -0
- /package/dist/hooks/{use-mobile.d.ts → use-mobile/index.d.ts} +0 -0
- /package/dist/hooks/{use-user.d.ts → use-user/index.d.ts} +0 -0
- /package/dist/{components/icon-button.d.ts → icon-button/index.d.ts} +0 -0
- /package/dist/{components/if.d.ts → if/index.d.ts} +0 -0
- /package/dist/{components/iframe.d.ts → iframe/index.d.ts} +0 -0
- /package/dist/{components/markdown-container.d.ts → markdown-container/index.d.ts} +0 -0
- /package/dist/{components/password-input.d.ts → password-input/index.d.ts} +0 -0
- /package/dist/{components/picture.d.ts → picture/index.d.ts} +0 -0
- /package/src/hooks/{use-current-route-data.ts → use-current-route-data/use-current-route-data.ts} +0 -0
- /package/src/hooks/{use-focus-search.ts → use-focus-search/use-focus-search.ts} +0 -0
- /package/src/hooks/{use-matches-data.ts → use-matches-data/use-matches-data.ts} +0 -0
- /package/src/hooks/{use-media-query.ts → use-media-query/use-media-query.ts} +0 -0
- /package/src/hooks/{use-mobile.ts → use-mobile/use-mobile.ts} +0 -0
- /package/src/hooks/{use-nonce.ts → use-nonce/use-nonce.ts} +0 -0
- /package/src/hooks/{use-orientation.ts → use-orientation/use-orientation.ts} +0 -0
- /package/src/hooks/{use-user.tsx → use-user/use-user.tsx} +0 -0
- /package/src/{components → icon-button}/icon-button.tsx +0 -0
- /package/src/{components → if}/if.tsx +0 -0
- /package/src/{styles/storybook.css → storybook.css} +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright ©
|
|
3
|
+
Copyright © 2026 Regardio
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -41,10 +41,9 @@ This package requires:
|
|
|
41
41
|
Import components, hooks, and utilities directly from their paths for optimal tree-shaking:
|
|
42
42
|
|
|
43
43
|
```tsx
|
|
44
|
-
import { Box } from '@regardio/react/
|
|
45
|
-
import { Link } from '@regardio/react/
|
|
44
|
+
import { Box } from '@regardio/react/box';
|
|
45
|
+
import { Link } from '@regardio/react/link';
|
|
46
46
|
import { useNonce } from '@regardio/react/hooks/use-nonce';
|
|
47
|
-
import { cn } from '@regardio/react/utils/cn';
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
### TailwindCSS Integration
|
|
@@ -52,7 +51,7 @@ import { cn } from '@regardio/react/utils/cn';
|
|
|
52
51
|
Components use TailwindCSS for styling. Import the base styles in your app:
|
|
53
52
|
|
|
54
53
|
```tsx
|
|
55
|
-
import '@regardio/react/
|
|
54
|
+
import '@regardio/react/tailwind.css';
|
|
56
55
|
```
|
|
57
56
|
|
|
58
57
|
## What's Included
|
|
@@ -102,12 +101,13 @@ import '@regardio/react/styles/tailwind.css';
|
|
|
102
101
|
|
|
103
102
|
| Utility | Description |
|
|
104
103
|
|---------|-------------|
|
|
105
|
-
| `cn` | TailwindCSS class name merging (tailwind-merge + cva) |
|
|
106
104
|
| `author` | Author/contributor data formatting |
|
|
107
105
|
| `isRouteActive` | Route matching utilities |
|
|
108
106
|
| `locale` | Locale detection and formatting |
|
|
109
107
|
| `text` | Typography processing (quotes, special chars) |
|
|
110
108
|
|
|
109
|
+
> **Note:** For Tailwind utilities like `cn`, `tv`, and `twMerge`, use `@regardio/tailwind/utils` instead.
|
|
110
|
+
|
|
111
111
|
## Documentation
|
|
112
112
|
|
|
113
113
|
See the [docs](./docs) folder for detailed documentation on each component, hook, and utility.
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { useMemo, useState, useRef, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
|
|
2
|
+
import { cn } from '@regardio/tailwind/utils';
|
|
4
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
|
-
// src/
|
|
7
|
-
var { cva, compose } = defineConfig({
|
|
8
|
-
hooks: {
|
|
9
|
-
onComplete: (className) => {
|
|
10
|
-
return twMerge(className);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var cn = (...inputs) => twMerge(cx(inputs));
|
|
5
|
+
// src/background-slideshow/background-slideshow.tsx
|
|
15
6
|
var Picture = ({
|
|
16
7
|
alt,
|
|
17
8
|
baseUrl,
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
// src/
|
|
3
|
+
// src/blurry-gradient/blurry-gradient.tsx
|
|
4
4
|
var BlurryGradient = (props) => {
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
description = "Decorative blurry gradient",
|
|
7
|
+
neutralColor,
|
|
8
|
+
primaryColor,
|
|
9
|
+
secondaryColor,
|
|
10
|
+
...svgProps
|
|
11
|
+
} = props;
|
|
6
12
|
const titleId = "blurryGradientTitle";
|
|
7
13
|
return /* @__PURE__ */ jsxs(
|
|
8
14
|
"svg",
|
|
@@ -53,7 +59,7 @@ var BlurryGradient = (props) => {
|
|
|
53
59
|
/* @__PURE__ */ jsx(
|
|
54
60
|
"rect",
|
|
55
61
|
{
|
|
56
|
-
fill:
|
|
62
|
+
fill: primaryColor,
|
|
57
63
|
height: "1000",
|
|
58
64
|
width: "1000"
|
|
59
65
|
}
|
|
@@ -64,7 +70,7 @@ var BlurryGradient = (props) => {
|
|
|
64
70
|
{
|
|
65
71
|
cx: "730",
|
|
66
72
|
cy: "559",
|
|
67
|
-
fill:
|
|
73
|
+
fill: secondaryColor,
|
|
68
74
|
r: "357"
|
|
69
75
|
}
|
|
70
76
|
),
|
|
@@ -73,7 +79,7 @@ var BlurryGradient = (props) => {
|
|
|
73
79
|
{
|
|
74
80
|
cx: "316",
|
|
75
81
|
cy: "248",
|
|
76
|
-
fill:
|
|
82
|
+
fill: primaryColor,
|
|
77
83
|
r: "357"
|
|
78
84
|
}
|
|
79
85
|
),
|
|
@@ -82,7 +88,7 @@ var BlurryGradient = (props) => {
|
|
|
82
88
|
{
|
|
83
89
|
cx: "509",
|
|
84
90
|
cy: "410",
|
|
85
|
-
fill:
|
|
91
|
+
fill: neutralColor,
|
|
86
92
|
r: "357"
|
|
87
93
|
}
|
|
88
94
|
),
|
|
@@ -91,7 +97,7 @@ var BlurryGradient = (props) => {
|
|
|
91
97
|
{
|
|
92
98
|
cx: "633",
|
|
93
99
|
cy: "232",
|
|
94
|
-
fill:
|
|
100
|
+
fill: secondaryColor,
|
|
95
101
|
r: "357"
|
|
96
102
|
}
|
|
97
103
|
),
|
|
@@ -100,7 +106,7 @@ var BlurryGradient = (props) => {
|
|
|
100
106
|
{
|
|
101
107
|
cx: "156",
|
|
102
108
|
cy: "82",
|
|
103
|
-
fill:
|
|
109
|
+
fill: primaryColor,
|
|
104
110
|
r: "357"
|
|
105
111
|
}
|
|
106
112
|
),
|
|
@@ -109,7 +115,7 @@ var BlurryGradient = (props) => {
|
|
|
109
115
|
{
|
|
110
116
|
cx: "150",
|
|
111
117
|
cy: "389",
|
|
112
|
-
fill:
|
|
118
|
+
fill: neutralColor,
|
|
113
119
|
r: "357"
|
|
114
120
|
}
|
|
115
121
|
)
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { EmblaCarouselType, EmblaOptionsType } from 'embla-carousel';
|
|
4
|
+
|
|
5
|
+
interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const CarouselItem: react.ForwardRefExoticComponent<CarouselItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
4
9
|
|
|
5
10
|
type CarouselApi = EmblaCarouselType;
|
|
6
11
|
interface CarouselContextValue {
|
|
@@ -11,18 +16,21 @@ interface CarouselContextValue {
|
|
|
11
16
|
canScrollNext: boolean;
|
|
12
17
|
}
|
|
13
18
|
declare function useCarousel(): CarouselContextValue;
|
|
14
|
-
interface
|
|
19
|
+
interface CarouselRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
20
|
opts?: EmblaOptionsType;
|
|
16
21
|
setApi?: (api: CarouselApi) => void;
|
|
17
22
|
orientation?: 'horizontal' | 'vertical';
|
|
18
23
|
}
|
|
19
|
-
declare const
|
|
24
|
+
declare const CarouselRoot: react.ForwardRefExoticComponent<CarouselRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
|
|
20
26
|
declare const CarouselContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
21
|
-
|
|
22
|
-
'aria-label'?: string;
|
|
23
|
-
}
|
|
24
|
-
declare const CarouselItem: react.ForwardRefExoticComponent<CarouselItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
declare const CarouselPrevious: react.ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
|
|
26
28
|
declare const CarouselNext: react.ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
declare const CarouselPrevious: react.ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
|
|
32
|
+
declare namespace index_parts {
|
|
33
|
+
export { CarouselContent as Content, CarouselItem as Item, CarouselNext as Next, CarouselPrevious as Previous, CarouselRoot as Root };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { index_parts as Carousel, type CarouselApi, type CarouselItemProps, type CarouselRootProps, useCarousel };
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
2
2
|
import { createContext, forwardRef, useState, useCallback, useEffect, useContext } from 'react';
|
|
3
|
-
import { defineConfig, cx } from 'cva';
|
|
4
|
-
import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
|
|
5
3
|
import { jsx } from 'react/jsx-runtime';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
var cn = (...inputs) => twMerge(cx(inputs));
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
16
10
|
var CarouselContext = createContext(null);
|
|
17
11
|
function useCarousel() {
|
|
18
12
|
const context = useContext(CarouselContext);
|
|
19
13
|
if (!context) {
|
|
20
|
-
throw new Error("useCarousel must be used within a <Carousel />");
|
|
14
|
+
throw new Error("useCarousel must be used within a <Carousel.Root />");
|
|
21
15
|
}
|
|
22
16
|
return context;
|
|
23
17
|
}
|
|
24
|
-
var
|
|
18
|
+
var CarouselRoot = forwardRef(
|
|
25
19
|
({ children, className, opts, orientation = "horizontal", setApi, ...props }, ref) => {
|
|
26
20
|
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
27
21
|
...opts,
|
|
@@ -86,7 +80,7 @@ var Carousel = forwardRef(
|
|
|
86
80
|
{
|
|
87
81
|
"aria-label": "Carousel",
|
|
88
82
|
"aria-roledescription": "carousel",
|
|
89
|
-
className
|
|
83
|
+
className,
|
|
90
84
|
onKeyDownCapture: handleKeyDown,
|
|
91
85
|
ref,
|
|
92
86
|
...props,
|
|
@@ -97,13 +91,23 @@ var Carousel = forwardRef(
|
|
|
97
91
|
);
|
|
98
92
|
}
|
|
99
93
|
);
|
|
100
|
-
|
|
94
|
+
CarouselRoot.displayName = "CarouselRoot";
|
|
95
|
+
|
|
96
|
+
// src/carousel/index.parts.ts
|
|
97
|
+
var index_parts_exports = {};
|
|
98
|
+
__export(index_parts_exports, {
|
|
99
|
+
Content: () => CarouselContent,
|
|
100
|
+
Item: () => CarouselItem,
|
|
101
|
+
Next: () => CarouselNext,
|
|
102
|
+
Previous: () => CarouselPrevious,
|
|
103
|
+
Root: () => CarouselRoot
|
|
104
|
+
});
|
|
101
105
|
var CarouselContent = forwardRef(
|
|
102
106
|
({ className, ...props }, ref) => {
|
|
103
107
|
return /* @__PURE__ */ jsx(
|
|
104
108
|
"div",
|
|
105
109
|
{
|
|
106
|
-
className
|
|
110
|
+
className,
|
|
107
111
|
ref,
|
|
108
112
|
...props
|
|
109
113
|
}
|
|
@@ -119,7 +123,7 @@ var CarouselItem = forwardRef(
|
|
|
119
123
|
"div",
|
|
120
124
|
{
|
|
121
125
|
"aria-roledescription": "slide",
|
|
122
|
-
className
|
|
126
|
+
className,
|
|
123
127
|
ref,
|
|
124
128
|
role: "group",
|
|
125
129
|
...props
|
|
@@ -129,15 +133,15 @@ var CarouselItem = forwardRef(
|
|
|
129
133
|
}
|
|
130
134
|
);
|
|
131
135
|
CarouselItem.displayName = "CarouselItem";
|
|
132
|
-
var
|
|
136
|
+
var CarouselNext = forwardRef(
|
|
133
137
|
({ className, ...props }, ref) => {
|
|
134
|
-
const {
|
|
138
|
+
const { canScrollNext, scrollNext } = useCarousel();
|
|
135
139
|
return /* @__PURE__ */ jsx(
|
|
136
140
|
"button",
|
|
137
141
|
{
|
|
138
|
-
className
|
|
139
|
-
disabled: !
|
|
140
|
-
onClick:
|
|
142
|
+
className,
|
|
143
|
+
disabled: !canScrollNext,
|
|
144
|
+
onClick: scrollNext,
|
|
141
145
|
ref,
|
|
142
146
|
type: "button",
|
|
143
147
|
...props
|
|
@@ -145,16 +149,16 @@ var CarouselPrevious = forwardRef(
|
|
|
145
149
|
);
|
|
146
150
|
}
|
|
147
151
|
);
|
|
148
|
-
|
|
149
|
-
var
|
|
152
|
+
CarouselNext.displayName = "CarouselNext";
|
|
153
|
+
var CarouselPrevious = forwardRef(
|
|
150
154
|
({ className, ...props }, ref) => {
|
|
151
|
-
const {
|
|
155
|
+
const { canScrollPrev, scrollPrev } = useCarousel();
|
|
152
156
|
return /* @__PURE__ */ jsx(
|
|
153
157
|
"button",
|
|
154
158
|
{
|
|
155
|
-
className
|
|
156
|
-
disabled: !
|
|
157
|
-
onClick:
|
|
159
|
+
className,
|
|
160
|
+
disabled: !canScrollPrev,
|
|
161
|
+
onClick: scrollPrev,
|
|
158
162
|
ref,
|
|
159
163
|
type: "button",
|
|
160
164
|
...props
|
|
@@ -162,6 +166,6 @@ var CarouselNext = forwardRef(
|
|
|
162
166
|
);
|
|
163
167
|
}
|
|
164
168
|
);
|
|
165
|
-
|
|
169
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
166
170
|
|
|
167
|
-
export {
|
|
171
|
+
export { index_parts_exports as Carousel, useCarousel };
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
+
import { cn } from '@regardio/tailwind/utils';
|
|
1
2
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { defineConfig, cx } from 'cva';
|
|
3
|
-
import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
|
|
4
3
|
import { jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
|
-
// src/
|
|
7
|
-
var { cva, compose } = defineConfig({
|
|
8
|
-
hooks: {
|
|
9
|
-
onComplete: (className) => {
|
|
10
|
-
return twMerge(className);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var cn = (...inputs) => twMerge(cx(inputs));
|
|
5
|
+
// src/countdown/countdown.tsx
|
|
15
6
|
function Countdown() {
|
|
16
7
|
const [timerValue, setTimerValue] = useState(0);
|
|
17
8
|
const [isMounted, setIsMounted] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isRouteErrorResponse, useRouteError } from 'react-router';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
-
// src/
|
|
4
|
+
// src/generic-error/generic-error.tsx
|
|
5
5
|
function getErrorDescriptor(error) {
|
|
6
6
|
if (isRouteErrorResponse(error)) {
|
|
7
7
|
const status = error.status;
|