@regardio/react 0.5.7 → 0.6.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 +36 -0
- package/dist/background-slideshow/index.mjs +110 -0
- package/dist/blurry-gradient/index.d.mts +17 -0
- package/dist/blurry-gradient/index.mjs +93 -0
- package/dist/button/index.d.mts +2 -0
- package/dist/button/index.mjs +3 -0
- package/dist/button-BiSQpBbc.mjs +129 -0
- package/dist/carousel/index.d.mts +40 -0
- package/dist/carousel/index.mjs +141 -0
- package/dist/checkbox/index.d.mts +37 -0
- package/dist/checkbox/index.mjs +70 -0
- package/dist/checkbox-group/index.d.mts +17 -0
- package/dist/checkbox-group/index.mjs +29 -0
- package/dist/chunk-BTpB_u-K.mjs +18 -0
- package/dist/countdown/index.d.mts +6 -0
- package/dist/countdown/index.mjs +58 -0
- package/dist/field/index.d.mts +66 -0
- package/dist/field/index.mjs +115 -0
- package/dist/fieldset/index.d.mts +33 -0
- package/dist/fieldset/index.mjs +61 -0
- package/dist/form/index.d.mts +22 -0
- package/dist/form/index.mjs +31 -0
- package/dist/generic-error/{index.d.ts → index.d.mts} +22 -18
- package/dist/generic-error/index.mjs +57 -0
- package/dist/grid/index.d.mts +1197 -0
- package/dist/grid/index.mjs +221 -0
- package/dist/heading/index.d.mts +31 -0
- package/dist/heading/index.mjs +29 -0
- package/dist/highlight/index.d.mts +18 -0
- package/dist/highlight/index.mjs +35 -0
- package/dist/hooks/{use-current-route-data.d.ts → use-current-route-data.d.mts} +3 -2
- package/dist/hooks/use-current-route-data.mjs +20 -0
- package/dist/hooks/{use-focus-search.d.ts → use-focus-search.d.mts} +4 -3
- package/dist/hooks/use-focus-search.mjs +21 -0
- package/dist/hooks/{use-matches-data.d.ts → use-matches-data.d.mts} +3 -2
- package/dist/hooks/use-matches-data.mjs +21 -0
- package/dist/hooks/{use-media-query.d.ts → use-media-query.d.mts} +3 -2
- package/dist/hooks/use-media-query.mjs +26 -0
- package/dist/hooks/use-mobile.d.mts +4 -0
- package/dist/hooks/use-mobile.mjs +20 -0
- package/dist/hooks/use-nonce.d.mts +8 -0
- package/dist/hooks/use-nonce.mjs +13 -0
- package/dist/hooks/{use-orientation.d.ts → use-orientation.d.mts} +3 -2
- package/dist/hooks/use-orientation.mjs +30 -0
- package/dist/hooks/use-user.d.mts +55 -0
- package/dist/hooks/use-user.mjs +39 -0
- package/dist/icon-button/index.d.mts +29 -0
- package/dist/icon-button/index.mjs +36 -0
- package/dist/if/index.d.mts +15 -0
- package/dist/if/index.mjs +21 -0
- package/dist/iframe/index.d.mts +11 -0
- package/dist/iframe/index.mjs +15 -0
- package/dist/index-Bm-tWhsb.d.mts +30 -0
- package/dist/index-YT2CkvL6.d.mts +36 -0
- package/dist/input/index.d.mts +2 -0
- package/dist/input/index.mjs +3 -0
- package/dist/input-CtR6aRVi.mjs +73 -0
- package/dist/link/index.d.mts +73 -0
- package/dist/link/index.mjs +129 -0
- package/dist/list/index.d.mts +71 -0
- package/dist/list/index.mjs +54 -0
- package/dist/markdown-container/index.d.mts +23 -0
- package/dist/markdown-container/index.mjs +71 -0
- package/dist/password-input/index.d.mts +24 -0
- package/dist/password-input/index.mjs +92 -0
- package/dist/picture/{index.d.ts → index.d.mts} +21 -20
- package/dist/picture/index.mjs +3 -0
- package/dist/picture-DkX3W5zl.mjs +69 -0
- package/dist/protected-email/{index.d.ts → index.d.mts} +14 -8
- package/dist/protected-email/index.mjs +37 -0
- package/dist/radio/index.d.mts +37 -0
- package/dist/radio/index.mjs +72 -0
- package/dist/radio-group/index.d.mts +17 -0
- package/dist/radio-group/index.mjs +29 -0
- package/dist/slider/index.d.mts +85 -0
- package/dist/slider/index.mjs +133 -0
- package/dist/switch/index.d.mts +38 -0
- package/dist/switch/index.mjs +87 -0
- package/dist/text/index.d.mts +26 -0
- package/dist/text/index.mjs +32 -0
- package/dist/text-CPlUND-Z.mjs +58 -0
- package/dist/toggle/index.d.mts +59 -0
- package/dist/toggle/index.mjs +82 -0
- package/dist/utils/author/index.d.mts +4 -0
- package/dist/utils/author/index.mjs +26 -0
- package/dist/utils/text/{index.d.ts → index.d.mts} +4 -3
- package/dist/utils/text/index.mjs +3 -0
- package/package.json +5 -117
- package/src/button/button.stories.tsx +161 -0
- package/src/button/button.test.tsx +73 -0
- package/src/button/button.tsx +112 -0
- package/src/button/index.ts +2 -0
- package/src/carousel/carousel-next.tsx +2 -2
- package/src/carousel/carousel-previous.tsx +2 -2
- package/src/checkbox/checkbox.stories.tsx +118 -0
- package/src/checkbox/checkbox.tsx +91 -0
- package/src/checkbox/index.ts +2 -0
- package/src/checkbox-group/checkbox-group.tsx +40 -0
- package/src/checkbox-group/index.ts +2 -0
- package/src/field/field.stories.tsx +105 -0
- package/src/field/field.test.tsx +61 -0
- package/src/field/field.tsx +165 -0
- package/src/field/index.ts +12 -0
- package/src/fieldset/fieldset.stories.tsx +204 -0
- package/src/fieldset/fieldset.test.tsx +63 -0
- package/src/fieldset/fieldset.tsx +75 -0
- package/src/fieldset/index.ts +7 -0
- package/src/form/form.stories.tsx +230 -0
- package/src/form/form.test.tsx +68 -0
- package/src/form/form.tsx +38 -0
- package/src/form/index.ts +2 -0
- package/src/icon-button/icon-button.stories.tsx +128 -7
- package/src/icon-button/icon-button.test.tsx +152 -0
- package/src/icon-button/icon-button.tsx +43 -9
- package/src/input/index.ts +2 -0
- package/src/input/input.stories.tsx +151 -0
- package/src/input/input.test.tsx +65 -0
- package/src/input/input.tsx +113 -0
- package/src/password-input/index.ts +1 -1
- package/src/password-input/password-input.tsx +104 -27
- package/src/radio/index.ts +2 -0
- package/src/radio/radio.tsx +92 -0
- package/src/radio-group/index.ts +2 -0
- package/src/radio-group/radio-group.tsx +36 -0
- package/src/slider/index.ts +18 -0
- package/src/slider/slider.tsx +179 -0
- package/src/switch/index.ts +2 -0
- package/src/switch/switch.stories.tsx +118 -0
- package/src/switch/switch.tsx +101 -0
- package/src/toggle/index.ts +2 -0
- package/src/toggle/toggle.stories.tsx +232 -0
- package/src/toggle/toggle.test.tsx +149 -0
- package/src/toggle/toggle.tsx +88 -0
- package/dist/background-slideshow/index.d.ts +0 -24
- package/dist/background-slideshow/index.js +0 -165
- package/dist/blurry-gradient/index.d.ts +0 -16
- package/dist/blurry-gradient/index.js +0 -128
- package/dist/carousel/index.d.ts +0 -36
- package/dist/carousel/index.js +0 -171
- package/dist/countdown/index.d.ts +0 -5
- package/dist/countdown/index.js +0 -73
- package/dist/generic-error/index.js +0 -47
- package/dist/grid/index.d.ts +0 -1196
- package/dist/grid/index.js +0 -239
- package/dist/heading/index.d.ts +0 -24
- package/dist/heading/index.js +0 -99
- package/dist/highlight/index.d.ts +0 -13
- package/dist/highlight/index.js +0 -59
- package/dist/hooks/use-current-route-data.js +0 -16
- package/dist/hooks/use-focus-search.js +0 -19
- package/dist/hooks/use-matches-data.js +0 -15
- package/dist/hooks/use-media-query.js +0 -20
- package/dist/hooks/use-mobile.d.ts +0 -3
- package/dist/hooks/use-mobile.js +0 -19
- package/dist/hooks/use-nonce.d.ts +0 -7
- package/dist/hooks/use-nonce.js +0 -8
- package/dist/hooks/use-orientation.js +0 -29
- package/dist/hooks/use-user.d.ts +0 -50
- package/dist/hooks/use-user.js +0 -25
- package/dist/icon-button/index.d.ts +0 -9
- package/dist/icon-button/index.js +0 -17
- package/dist/if/index.d.ts +0 -10
- package/dist/if/index.js +0 -24
- package/dist/iframe/index.d.ts +0 -10
- package/dist/iframe/index.js +0 -17
- package/dist/link/index.d.ts +0 -55
- package/dist/link/index.js +0 -195
- package/dist/list/index.d.ts +0 -69
- package/dist/list/index.js +0 -65
- package/dist/markdown-container/index.d.ts +0 -22
- package/dist/markdown-container/index.js +0 -128
- package/dist/password-input/index.d.ts +0 -11
- package/dist/password-input/index.js +0 -46
- package/dist/picture/index.js +0 -68
- package/dist/protected-email/index.js +0 -30
- package/dist/text/index.d.ts +0 -20
- package/dist/text/index.js +0 -38
- package/dist/utils/author/index.d.ts +0 -3
- package/dist/utils/author/index.js +0 -33
- package/dist/utils/text/index.js +0 -73
package/dist/grid/index.js
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { tv } from '@regardio/tailwind/utils';
|
|
2
|
-
import { forwardRef, createContext, useContext } from 'react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
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
|
-
};
|
|
10
|
-
var gridItem = tv({
|
|
11
|
-
defaultVariants: {
|
|
12
|
-
span: 12
|
|
13
|
-
},
|
|
14
|
-
slots: {
|
|
15
|
-
root: ["relative"]
|
|
16
|
-
},
|
|
17
|
-
variants: {
|
|
18
|
-
end: {
|
|
19
|
-
1: { root: "col-end-1" },
|
|
20
|
-
2: { root: "col-end-2" },
|
|
21
|
-
3: { root: "col-end-3" },
|
|
22
|
-
4: { root: "col-end-4" },
|
|
23
|
-
5: { root: "col-end-5" },
|
|
24
|
-
6: { root: "col-end-6" },
|
|
25
|
-
7: { root: "col-end-7" },
|
|
26
|
-
8: { root: "col-end-8" },
|
|
27
|
-
9: { root: "col-end-9" },
|
|
28
|
-
10: { root: "col-end-10" },
|
|
29
|
-
11: { root: "col-end-11" },
|
|
30
|
-
12: { root: "col-end-12" },
|
|
31
|
-
13: { root: "col-end-13" },
|
|
32
|
-
auto: { root: "col-end-auto" }
|
|
33
|
-
},
|
|
34
|
-
rowSpan: {
|
|
35
|
-
1: { root: "row-span-1" },
|
|
36
|
-
2: { root: "row-span-2" },
|
|
37
|
-
3: { root: "row-span-3" },
|
|
38
|
-
4: { root: "row-span-4" },
|
|
39
|
-
5: { root: "row-span-5" },
|
|
40
|
-
6: { root: "row-span-6" },
|
|
41
|
-
full: { root: "row-span-full" }
|
|
42
|
-
},
|
|
43
|
-
span: {
|
|
44
|
-
1: { root: "col-span-1" },
|
|
45
|
-
2: { root: "col-span-2" },
|
|
46
|
-
3: { root: "col-span-3" },
|
|
47
|
-
4: { root: "col-span-4" },
|
|
48
|
-
5: { root: "col-span-5" },
|
|
49
|
-
6: { root: "col-span-6" },
|
|
50
|
-
7: { root: "col-span-7" },
|
|
51
|
-
8: { root: "col-span-8" },
|
|
52
|
-
9: { root: "col-span-9" },
|
|
53
|
-
10: { root: "col-span-10" },
|
|
54
|
-
11: { root: "col-span-11" },
|
|
55
|
-
12: { root: "col-span-12" },
|
|
56
|
-
full: { root: "col-span-full" }
|
|
57
|
-
},
|
|
58
|
-
spanLg: {
|
|
59
|
-
1: { root: "@lg:col-span-1" },
|
|
60
|
-
2: { root: "@lg:col-span-2" },
|
|
61
|
-
3: { root: "@lg:col-span-3" },
|
|
62
|
-
4: { root: "@lg:col-span-4" },
|
|
63
|
-
5: { root: "@lg:col-span-5" },
|
|
64
|
-
6: { root: "@lg:col-span-6" },
|
|
65
|
-
7: { root: "@lg:col-span-7" },
|
|
66
|
-
8: { root: "@lg:col-span-8" },
|
|
67
|
-
9: { root: "@lg:col-span-9" },
|
|
68
|
-
10: { root: "@lg:col-span-10" },
|
|
69
|
-
11: { root: "@lg:col-span-11" },
|
|
70
|
-
12: { root: "@lg:col-span-12" },
|
|
71
|
-
full: { root: "@lg:col-span-full" }
|
|
72
|
-
},
|
|
73
|
-
spanMd: {
|
|
74
|
-
1: { root: "@md:col-span-1" },
|
|
75
|
-
2: { root: "@md:col-span-2" },
|
|
76
|
-
3: { root: "@md:col-span-3" },
|
|
77
|
-
4: { root: "@md:col-span-4" },
|
|
78
|
-
5: { root: "@md:col-span-5" },
|
|
79
|
-
6: { root: "@md:col-span-6" },
|
|
80
|
-
7: { root: "@md:col-span-7" },
|
|
81
|
-
8: { root: "@md:col-span-8" },
|
|
82
|
-
9: { root: "@md:col-span-9" },
|
|
83
|
-
10: { root: "@md:col-span-10" },
|
|
84
|
-
11: { root: "@md:col-span-11" },
|
|
85
|
-
12: { root: "@md:col-span-12" },
|
|
86
|
-
full: { root: "@md:col-span-full" }
|
|
87
|
-
},
|
|
88
|
-
spanSm: {
|
|
89
|
-
1: { root: "@sm:col-span-1" },
|
|
90
|
-
2: { root: "@sm:col-span-2" },
|
|
91
|
-
3: { root: "@sm:col-span-3" },
|
|
92
|
-
4: { root: "@sm:col-span-4" },
|
|
93
|
-
5: { root: "@sm:col-span-5" },
|
|
94
|
-
6: { root: "@sm:col-span-6" },
|
|
95
|
-
7: { root: "@sm:col-span-7" },
|
|
96
|
-
8: { root: "@sm:col-span-8" },
|
|
97
|
-
9: { root: "@sm:col-span-9" },
|
|
98
|
-
10: { root: "@sm:col-span-10" },
|
|
99
|
-
11: { root: "@sm:col-span-11" },
|
|
100
|
-
12: { root: "@sm:col-span-12" },
|
|
101
|
-
full: { root: "@sm:col-span-full" }
|
|
102
|
-
},
|
|
103
|
-
spanXl: {
|
|
104
|
-
1: { root: "@xl:col-span-1" },
|
|
105
|
-
2: { root: "@xl:col-span-2" },
|
|
106
|
-
3: { root: "@xl:col-span-3" },
|
|
107
|
-
4: { root: "@xl:col-span-4" },
|
|
108
|
-
5: { root: "@xl:col-span-5" },
|
|
109
|
-
6: { root: "@xl:col-span-6" },
|
|
110
|
-
7: { root: "@xl:col-span-7" },
|
|
111
|
-
8: { root: "@xl:col-span-8" },
|
|
112
|
-
9: { root: "@xl:col-span-9" },
|
|
113
|
-
10: { root: "@xl:col-span-10" },
|
|
114
|
-
11: { root: "@xl:col-span-11" },
|
|
115
|
-
12: { root: "@xl:col-span-12" },
|
|
116
|
-
full: { root: "@xl:col-span-full" }
|
|
117
|
-
},
|
|
118
|
-
spanXs: {
|
|
119
|
-
1: { root: "@xs:col-span-1" },
|
|
120
|
-
2: { root: "@xs:col-span-2" },
|
|
121
|
-
3: { root: "@xs:col-span-3" },
|
|
122
|
-
4: { root: "@xs:col-span-4" },
|
|
123
|
-
5: { root: "@xs:col-span-5" },
|
|
124
|
-
6: { root: "@xs:col-span-6" },
|
|
125
|
-
7: { root: "@xs:col-span-7" },
|
|
126
|
-
8: { root: "@xs:col-span-8" },
|
|
127
|
-
9: { root: "@xs:col-span-9" },
|
|
128
|
-
10: { root: "@xs:col-span-10" },
|
|
129
|
-
11: { root: "@xs:col-span-11" },
|
|
130
|
-
12: { root: "@xs:col-span-12" },
|
|
131
|
-
full: { root: "@xs:col-span-full" }
|
|
132
|
-
},
|
|
133
|
-
start: {
|
|
134
|
-
1: { root: "col-start-1" },
|
|
135
|
-
2: { root: "col-start-2" },
|
|
136
|
-
3: { root: "col-start-3" },
|
|
137
|
-
4: { root: "col-start-4" },
|
|
138
|
-
5: { root: "col-start-5" },
|
|
139
|
-
6: { root: "col-start-6" },
|
|
140
|
-
7: { root: "col-start-7" },
|
|
141
|
-
8: { root: "col-start-8" },
|
|
142
|
-
9: { root: "col-start-9" },
|
|
143
|
-
10: { root: "col-start-10" },
|
|
144
|
-
11: { root: "col-start-11" },
|
|
145
|
-
12: { root: "col-start-12" },
|
|
146
|
-
13: { root: "col-start-13" },
|
|
147
|
-
auto: { root: "col-start-auto" }
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
var GridItem = forwardRef(
|
|
152
|
-
({
|
|
153
|
-
children,
|
|
154
|
-
className,
|
|
155
|
-
classNames,
|
|
156
|
-
span,
|
|
157
|
-
spanXs,
|
|
158
|
-
spanSm,
|
|
159
|
-
spanMd,
|
|
160
|
-
spanLg,
|
|
161
|
-
spanXl,
|
|
162
|
-
start,
|
|
163
|
-
end,
|
|
164
|
-
rowSpan,
|
|
165
|
-
...props
|
|
166
|
-
}, ref) => {
|
|
167
|
-
const styles = gridItem({ end, rowSpan, span, spanLg, spanMd, spanSm, spanXl, spanXs, start });
|
|
168
|
-
return /* @__PURE__ */ jsx(
|
|
169
|
-
"div",
|
|
170
|
-
{
|
|
171
|
-
className: styles.root({ className: classNames?.root ?? className }),
|
|
172
|
-
ref,
|
|
173
|
-
...props,
|
|
174
|
-
children
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
GridItem.displayName = "GridItem";
|
|
180
|
-
var grid = tv({
|
|
181
|
-
defaultVariants: {
|
|
182
|
-
flow: "dense"
|
|
183
|
-
},
|
|
184
|
-
slots: {
|
|
185
|
-
root: [
|
|
186
|
-
"u-grid",
|
|
187
|
-
"grid",
|
|
188
|
-
"grid-cols-12",
|
|
189
|
-
"gap-[var(--spacing-grid-gutter)]",
|
|
190
|
-
"w-full",
|
|
191
|
-
"container-[grid]/inline-size"
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
|
-
variants: {
|
|
195
|
-
align: {
|
|
196
|
-
center: { root: "content-center" },
|
|
197
|
-
end: { root: "content-end" },
|
|
198
|
-
start: { root: "content-start" },
|
|
199
|
-
stretch: { root: "content-stretch" }
|
|
200
|
-
},
|
|
201
|
-
flow: {
|
|
202
|
-
column: { root: "grid-auto-flow-col" },
|
|
203
|
-
dense: { root: "grid-auto-flow-dense" },
|
|
204
|
-
row: { root: "grid-auto-flow-row" }
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
var GridContext = createContext(null);
|
|
209
|
-
function useGrid() {
|
|
210
|
-
const context = useContext(GridContext);
|
|
211
|
-
if (!context) {
|
|
212
|
-
throw new Error("useGrid must be used within a <Grid.Root />");
|
|
213
|
-
}
|
|
214
|
-
return context;
|
|
215
|
-
}
|
|
216
|
-
var GridRoot = forwardRef(
|
|
217
|
-
({ children, className, classNames, flow, align, ...props }, ref) => {
|
|
218
|
-
const styles = grid({ align, flow });
|
|
219
|
-
return /* @__PURE__ */ jsx(GridContext.Provider, { value: { styles }, children: /* @__PURE__ */ jsx(
|
|
220
|
-
"div",
|
|
221
|
-
{
|
|
222
|
-
className: styles.root({ className: classNames?.root ?? className }),
|
|
223
|
-
ref,
|
|
224
|
-
...props,
|
|
225
|
-
children
|
|
226
|
-
}
|
|
227
|
-
) });
|
|
228
|
-
}
|
|
229
|
-
);
|
|
230
|
-
GridRoot.displayName = "GridRoot";
|
|
231
|
-
|
|
232
|
-
// src/grid/index.parts.ts
|
|
233
|
-
var index_parts_exports = {};
|
|
234
|
-
__export(index_parts_exports, {
|
|
235
|
-
Item: () => GridItem,
|
|
236
|
-
Root: () => GridRoot
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
export { index_parts_exports as Grid, gridItem, useGrid };
|
package/dist/heading/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { HTMLAttributes, ElementType } from 'react';
|
|
3
|
-
|
|
4
|
-
declare const levelVariants: {
|
|
5
|
-
readonly 1: readonly ["text-2xl"];
|
|
6
|
-
readonly 2: readonly ["text-xl"];
|
|
7
|
-
readonly 3: readonly ["text-lg"];
|
|
8
|
-
readonly 4: readonly ["text-md"];
|
|
9
|
-
readonly 5: readonly ["text-sm"];
|
|
10
|
-
readonly 6: readonly ["text-xs"];
|
|
11
|
-
};
|
|
12
|
-
type HeadingLevel = keyof typeof levelVariants;
|
|
13
|
-
interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
14
|
-
as?: ElementType;
|
|
15
|
-
className?: string;
|
|
16
|
-
level?: HeadingLevel;
|
|
17
|
-
locale?: string;
|
|
18
|
-
}
|
|
19
|
-
declare const Heading: {
|
|
20
|
-
({ as, children, className, level, ...props }: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { Heading, type HeadingLevel, type HeadingProps };
|
package/dist/heading/index.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { tv, cn } from '@regardio/tailwind/utils';
|
|
2
|
-
import { replaceShyInString } from '@regardio/js/text';
|
|
3
|
-
import React, { isValidElement, cloneElement } from 'react';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
// src/heading/heading.tsx
|
|
7
|
-
var lowerCaseSzett = (text, _returnType) => {
|
|
8
|
-
const processString = (str) => {
|
|
9
|
-
const parts = str.split(/(ß)/g);
|
|
10
|
-
return parts.map(
|
|
11
|
-
(part, index) => part === "\xDF" ? /* @__PURE__ */ jsx(
|
|
12
|
-
"span",
|
|
13
|
-
{
|
|
14
|
-
className: "lowercase",
|
|
15
|
-
children: part
|
|
16
|
-
},
|
|
17
|
-
index.toString()
|
|
18
|
-
) : part
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
if (typeof text === "string") {
|
|
22
|
-
return processString(text);
|
|
23
|
-
}
|
|
24
|
-
if (isValidElement(text)) {
|
|
25
|
-
const element = text;
|
|
26
|
-
const { children, ...props } = element.props;
|
|
27
|
-
return cloneElement(element, {
|
|
28
|
-
...props,
|
|
29
|
-
children: lowerCaseSzett(children)
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
if (Array.isArray(text)) {
|
|
33
|
-
return text.map((child, index) => /* @__PURE__ */ jsx(React.Fragment, { children: lowerCaseSzett(child) }, index.toString()));
|
|
34
|
-
}
|
|
35
|
-
return text;
|
|
36
|
-
};
|
|
37
|
-
function replaceShyInReactNode(node) {
|
|
38
|
-
if (typeof node === "string") {
|
|
39
|
-
return node.replace(/\u00AD/g, "");
|
|
40
|
-
}
|
|
41
|
-
if (isValidElement(node)) {
|
|
42
|
-
const element = node;
|
|
43
|
-
const { children, ...props } = element.props;
|
|
44
|
-
return cloneElement(element, {
|
|
45
|
-
...props,
|
|
46
|
-
children: replaceShyInReactNode(children)
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
if (Array.isArray(node)) {
|
|
50
|
-
return node.map((child, index) => /* @__PURE__ */ jsx(React.Fragment, { children: replaceShyInReactNode(child) }, index.toString()));
|
|
51
|
-
}
|
|
52
|
-
return node;
|
|
53
|
-
}
|
|
54
|
-
function shy(input) {
|
|
55
|
-
if (input === null) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
if (typeof input === "string") {
|
|
59
|
-
return replaceShyInString(input);
|
|
60
|
-
}
|
|
61
|
-
return replaceShyInReactNode(input);
|
|
62
|
-
}
|
|
63
|
-
var levelVariants = {
|
|
64
|
-
1: ["text-2xl"],
|
|
65
|
-
2: ["text-xl"],
|
|
66
|
-
3: ["text-lg"],
|
|
67
|
-
4: ["text-md"],
|
|
68
|
-
5: ["text-sm"],
|
|
69
|
-
6: ["text-xs"]
|
|
70
|
-
};
|
|
71
|
-
var heading = tv({
|
|
72
|
-
base: [],
|
|
73
|
-
defaultVariants: {
|
|
74
|
-
level: 3
|
|
75
|
-
},
|
|
76
|
-
variants: {
|
|
77
|
-
level: levelVariants
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
var Heading = ({ as, children, className, level = 2, ...props }) => {
|
|
81
|
-
const word = lowerCaseSzett(shy(children));
|
|
82
|
-
const Component = as || `h${level}`;
|
|
83
|
-
return /* @__PURE__ */ jsx(
|
|
84
|
-
Component,
|
|
85
|
-
{
|
|
86
|
-
className: cn(
|
|
87
|
-
heading({
|
|
88
|
-
level
|
|
89
|
-
}),
|
|
90
|
-
className
|
|
91
|
-
),
|
|
92
|
-
...props,
|
|
93
|
-
children: word
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
Heading.displayName = "Heading";
|
|
98
|
-
|
|
99
|
-
export { Heading };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
|
|
4
|
-
declare const highlightVariants: {
|
|
5
|
-
readonly primary: readonly ["highlight"];
|
|
6
|
-
};
|
|
7
|
-
type HighlightVariant = keyof typeof highlightVariants;
|
|
8
|
-
interface HighlightProps extends ComponentProps<'mark'> {
|
|
9
|
-
variant?: HighlightVariant;
|
|
10
|
-
}
|
|
11
|
-
declare const Highlight: ({ children, className, variant }: HighlightProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { Highlight, type HighlightProps };
|
package/dist/highlight/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { tv } from '@regardio/tailwind/utils';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
// src/highlight/highlight.tsx
|
|
5
|
-
var highlightVariants = {
|
|
6
|
-
primary: ["highlight"]
|
|
7
|
-
};
|
|
8
|
-
var highlight = tv({
|
|
9
|
-
defaultVariants: {
|
|
10
|
-
variant: "primary"
|
|
11
|
-
},
|
|
12
|
-
variants: {
|
|
13
|
-
variant: highlightVariants
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
var Highlight = ({ children, className, variant }) => {
|
|
17
|
-
return /* @__PURE__ */ jsxs(
|
|
18
|
-
"mark",
|
|
19
|
-
{
|
|
20
|
-
className: highlight({
|
|
21
|
-
className,
|
|
22
|
-
variant
|
|
23
|
-
}),
|
|
24
|
-
children: [
|
|
25
|
-
children,
|
|
26
|
-
/* @__PURE__ */ jsx(
|
|
27
|
-
"svg",
|
|
28
|
-
{
|
|
29
|
-
"aria-label": "!",
|
|
30
|
-
role: "img",
|
|
31
|
-
children: /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("filter", { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
"feTurbulence",
|
|
34
|
-
{
|
|
35
|
-
baseFrequency: "0 0.2",
|
|
36
|
-
numOctaves: "5",
|
|
37
|
-
result: "warp",
|
|
38
|
-
type: "fractalNoise"
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
42
|
-
"feDisplacementMap",
|
|
43
|
-
{
|
|
44
|
-
in: "SourceGraphic",
|
|
45
|
-
in2: "warp",
|
|
46
|
-
scale: "30",
|
|
47
|
-
xChannelSelector: "R",
|
|
48
|
-
yChannelSelector: "G"
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
] }) })
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export { Highlight };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useLocation, useMatches } from 'react-router';
|
|
3
|
-
|
|
4
|
-
// src/hooks/use-current-route-data.ts
|
|
5
|
-
function useCurrentRouteData() {
|
|
6
|
-
const location = useLocation();
|
|
7
|
-
const matchingRoutes = useMatches();
|
|
8
|
-
const route = useMemo(() => {
|
|
9
|
-
return matchingRoutes.find((route2) => {
|
|
10
|
-
return route2.pathname === location.pathname;
|
|
11
|
-
});
|
|
12
|
-
}, [matchingRoutes, location]);
|
|
13
|
-
return route?.data || void 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { useCurrentRouteData };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-focus-search.ts
|
|
4
|
-
function useFocusSearch(ref) {
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
function handleKeyDown(event) {
|
|
7
|
-
if ((event.metaKey || event.ctrlKey) && event.key === "k") {
|
|
8
|
-
event.preventDefault();
|
|
9
|
-
ref?.current?.focus();
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
13
|
-
return () => {
|
|
14
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
15
|
-
};
|
|
16
|
-
}, [ref]);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { useFocusSearch };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useMatches } from 'react-router';
|
|
3
|
-
|
|
4
|
-
// src/hooks/use-matches-data.ts
|
|
5
|
-
function useMatchesData(id) {
|
|
6
|
-
const matchingRoutes = useMatches();
|
|
7
|
-
const route = useMemo(() => {
|
|
8
|
-
return matchingRoutes.find((route2) => {
|
|
9
|
-
return route2.id === id;
|
|
10
|
-
});
|
|
11
|
-
}, [matchingRoutes, id]);
|
|
12
|
-
return route?.data || void 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { useMatchesData };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-media-query.ts
|
|
4
|
-
function useMediaQuery(query) {
|
|
5
|
-
const [matches, setMatches] = useState(false);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
const mediaQuery = window.matchMedia(query);
|
|
8
|
-
setMatches(mediaQuery.matches);
|
|
9
|
-
const handleChange = (event) => {
|
|
10
|
-
setMatches(event.matches);
|
|
11
|
-
};
|
|
12
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
13
|
-
return () => {
|
|
14
|
-
mediaQuery.removeEventListener("change", handleChange);
|
|
15
|
-
};
|
|
16
|
-
}, [query]);
|
|
17
|
-
return matches;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { useMediaQuery };
|
package/dist/hooks/use-mobile.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-mobile.ts
|
|
4
|
-
var MOBILE_BREAKPOINT = 768;
|
|
5
|
-
function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = useState(void 0);
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
9
|
-
const onChange = () => {
|
|
10
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
11
|
-
};
|
|
12
|
-
mql.addEventListener("change", onChange);
|
|
13
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
-
return () => mql.removeEventListener("change", onChange);
|
|
15
|
-
}, []);
|
|
16
|
-
return !!isMobile;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { useIsMobile };
|
package/dist/hooks/use-nonce.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-nonce.ts
|
|
4
|
-
var NonceContext = createContext("");
|
|
5
|
-
var NonceProvider = NonceContext.Provider;
|
|
6
|
-
var useNonce = () => useContext(NonceContext);
|
|
7
|
-
|
|
8
|
-
export { NonceContext, NonceProvider, useNonce };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-orientation.ts
|
|
4
|
-
function useOrientation() {
|
|
5
|
-
const [orientation, setOrientation] = useState(() => {
|
|
6
|
-
if (typeof window !== "undefined") {
|
|
7
|
-
return window.innerHeight > window.innerWidth ? "portrait" : "landscape";
|
|
8
|
-
}
|
|
9
|
-
return "portrait";
|
|
10
|
-
});
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (typeof window === "undefined") {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const handleResize = () => {
|
|
16
|
-
setOrientation(window.innerHeight > window.innerWidth ? "portrait" : "landscape");
|
|
17
|
-
};
|
|
18
|
-
window.addEventListener("resize", handleResize);
|
|
19
|
-
window.addEventListener("orientationchange", handleResize);
|
|
20
|
-
handleResize();
|
|
21
|
-
return () => {
|
|
22
|
-
window.removeEventListener("resize", handleResize);
|
|
23
|
-
window.removeEventListener("orientationchange", handleResize);
|
|
24
|
-
};
|
|
25
|
-
}, []);
|
|
26
|
-
return orientation;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { useOrientation };
|
package/dist/hooks/use-user.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
import { User } from '@supabase/supabase-js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Context for storing and accessing the current authenticated user
|
|
8
|
-
*/
|
|
9
|
-
interface UserContextType {
|
|
10
|
-
/**
|
|
11
|
-
* The current authenticated user, or null if not authenticated
|
|
12
|
-
*/
|
|
13
|
-
user: User | null;
|
|
14
|
-
/**
|
|
15
|
-
* Whether the user data is currently loading
|
|
16
|
-
*/
|
|
17
|
-
isLoading: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Context for storing and accessing the current authenticated user
|
|
21
|
-
*/
|
|
22
|
-
declare const UserContext: react.Context<UserContextType>;
|
|
23
|
-
/**
|
|
24
|
-
* Props for the UserContextProvider component
|
|
25
|
-
*/
|
|
26
|
-
interface UserContextProviderProps {
|
|
27
|
-
/**
|
|
28
|
-
* The current authenticated user, or null if not authenticated
|
|
29
|
-
*/
|
|
30
|
-
user: User | null;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the user data is currently loading
|
|
33
|
-
*/
|
|
34
|
-
isLoading?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Child components that will have access to the user context
|
|
37
|
-
*/
|
|
38
|
-
children: ReactNode;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Provider component for the UserContext
|
|
42
|
-
*/
|
|
43
|
-
declare function UserContextProvider({ user, isLoading, children, }: UserContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
44
|
-
/**
|
|
45
|
-
* Hook to access the current authenticated user from the UserContext
|
|
46
|
-
* @returns The current user context containing the user object and loading state
|
|
47
|
-
*/
|
|
48
|
-
declare function useUser(): UserContextType;
|
|
49
|
-
|
|
50
|
-
export { UserContext, UserContextProvider, type UserContextProviderProps, type UserContextType, useUser };
|
package/dist/hooks/use-user.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
// src/hooks/use-user.tsx
|
|
5
|
-
var defaultContextValue = {
|
|
6
|
-
isLoading: false,
|
|
7
|
-
user: null
|
|
8
|
-
};
|
|
9
|
-
var UserContext = createContext(defaultContextValue);
|
|
10
|
-
function UserContextProvider({
|
|
11
|
-
user,
|
|
12
|
-
isLoading = false,
|
|
13
|
-
children
|
|
14
|
-
}) {
|
|
15
|
-
return /* @__PURE__ */ jsx(UserContext.Provider, { value: { isLoading, user }, children });
|
|
16
|
-
}
|
|
17
|
-
function useUser() {
|
|
18
|
-
const context = useContext(UserContext);
|
|
19
|
-
if (context === void 0) {
|
|
20
|
-
throw new Error("useUser must be used within a UserContextProvider");
|
|
21
|
-
}
|
|
22
|
-
return context;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { UserContext, UserContextProvider, useUser };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
interface IconButtonProps extends ComponentProps<'button'> {
|
|
5
|
-
icon: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
declare const IconButton: (props: IconButtonProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { IconButton, type IconButtonProps };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
// src/icon-button/icon-button.tsx
|
|
4
|
-
var IconButton = (props) => {
|
|
5
|
-
const { className, icon } = props;
|
|
6
|
-
const defaultClassName = "p-0";
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
"button",
|
|
9
|
-
{
|
|
10
|
-
className: className ? className : defaultClassName,
|
|
11
|
-
type: "button",
|
|
12
|
-
children: icon
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { IconButton };
|