@nuvra-ui/react 0.0.9 → 0.0.11
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/index.d.ts +4 -0
- package/dist/index.js +139 -123
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,8 @@ export declare function Button({ className, children, ...props }: React.ButtonHT
|
|
|
6
6
|
|
|
7
7
|
export declare function Link({ className, children, ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
8
8
|
|
|
9
|
+
export declare function Switch({ className, ...props }: React.InputHTMLAttributes<HTMLInputElement>): JSX.Element;
|
|
10
|
+
|
|
11
|
+
export declare function Textarea({ className, ...props }: React.TextareaHTMLAttributes<HTMLTextAreaElement>): JSX.Element;
|
|
12
|
+
|
|
9
13
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
function r(
|
|
3
|
-
var
|
|
4
|
-
if (typeof
|
|
5
|
-
else if (typeof
|
|
6
|
-
var u =
|
|
7
|
-
for (
|
|
8
|
-
} else for (c in
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function r(t) {
|
|
3
|
+
var o, c, l = "";
|
|
4
|
+
if (typeof t == "string" || typeof t == "number") l += t;
|
|
5
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
+
var u = t.length;
|
|
7
|
+
for (o = 0; o < u; o++) t[o] && (c = r(t[o])) && (l && (l += " "), l += c);
|
|
8
|
+
} else for (c in t) t[c] && (l && (l += " "), l += c);
|
|
9
9
|
return l;
|
|
10
10
|
}
|
|
11
11
|
function clsx() {
|
|
12
|
-
for (var
|
|
12
|
+
for (var t, o, c = 0, l = "", u = arguments.length; c < u; c++) (t = arguments[c]) && (o = r(t)) && (l && (l += " "), l += o);
|
|
13
13
|
return l;
|
|
14
14
|
}
|
|
15
|
-
var concatArrays = (
|
|
16
|
-
let s = Array(
|
|
17
|
-
for (let o = 0; o <
|
|
18
|
-
for (let c = 0; c < o.length; c++) s[
|
|
15
|
+
var concatArrays = (t, o) => {
|
|
16
|
+
let s = Array(t.length + o.length);
|
|
17
|
+
for (let o = 0; o < t.length; o++) s[o] = t[o];
|
|
18
|
+
for (let c = 0; c < o.length; c++) s[t.length + c] = o[c];
|
|
19
19
|
return s;
|
|
20
|
-
}, createClassValidatorObject = (
|
|
21
|
-
classGroupId:
|
|
20
|
+
}, createClassValidatorObject = (t, o) => ({
|
|
21
|
+
classGroupId: t,
|
|
22
22
|
validator: o
|
|
23
|
-
}), createClassPartObject = (
|
|
24
|
-
nextPart:
|
|
23
|
+
}), createClassPartObject = (t = /* @__PURE__ */ new Map(), o = null, s) => ({
|
|
24
|
+
nextPart: t,
|
|
25
25
|
validators: o,
|
|
26
26
|
classGroupId: s
|
|
27
|
-
}), CLASS_PART_SEPARATOR = "-", EMPTY_CONFLICTS = [], ARBITRARY_PROPERTY_PREFIX = "arbitrary..", createClassGroupUtils = (
|
|
28
|
-
let o = createClassMap(
|
|
27
|
+
}), CLASS_PART_SEPARATOR = "-", EMPTY_CONFLICTS = [], ARBITRARY_PROPERTY_PREFIX = "arbitrary..", createClassGroupUtils = (t) => {
|
|
28
|
+
let o = createClassMap(t), { conflictingClassGroups: s, conflictingClassGroupModifiers: c } = t;
|
|
29
29
|
return {
|
|
30
|
-
getClassGroupId: (
|
|
31
|
-
if (
|
|
32
|
-
let s =
|
|
30
|
+
getClassGroupId: (t) => {
|
|
31
|
+
if (t.startsWith("[") && t.endsWith("]")) return getGroupIdForArbitraryProperty(t);
|
|
32
|
+
let s = t.split(CLASS_PART_SEPARATOR);
|
|
33
33
|
return getGroupRecursive(s, s[0] === "" && s.length > 1 ? 1 : 0, o);
|
|
34
34
|
},
|
|
35
|
-
getConflictingClassGroupIds: (
|
|
35
|
+
getConflictingClassGroupIds: (t, o) => {
|
|
36
36
|
if (o) {
|
|
37
|
-
let o =
|
|
37
|
+
let o = c[t], u = s[t];
|
|
38
38
|
return o ? u ? concatArrays(u, o) : o : u || EMPTY_CONFLICTS;
|
|
39
39
|
}
|
|
40
|
-
return s[
|
|
40
|
+
return s[t] || EMPTY_CONFLICTS;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
}, getGroupRecursive = (
|
|
44
|
-
if (
|
|
45
|
-
let c =
|
|
43
|
+
}, getGroupRecursive = (t, o, s) => {
|
|
44
|
+
if (t.length - o === 0) return s.classGroupId;
|
|
45
|
+
let c = t[o], l = s.nextPart.get(c);
|
|
46
46
|
if (l) {
|
|
47
|
-
let s = getGroupRecursive(
|
|
47
|
+
let s = getGroupRecursive(t, o + 1, l);
|
|
48
48
|
if (s) return s;
|
|
49
49
|
}
|
|
50
50
|
let u = s.validators;
|
|
51
51
|
if (u === null) return;
|
|
52
|
-
let
|
|
53
|
-
for (let
|
|
54
|
-
let o = u[
|
|
55
|
-
if (o.validator(
|
|
52
|
+
let d = o === 0 ? t.join(CLASS_PART_SEPARATOR) : t.slice(o).join(CLASS_PART_SEPARATOR), p = u.length;
|
|
53
|
+
for (let t = 0; t < p; t++) {
|
|
54
|
+
let o = u[t];
|
|
55
|
+
if (o.validator(d)) return o.classGroupId;
|
|
56
56
|
}
|
|
57
|
-
}, getGroupIdForArbitraryProperty = (
|
|
58
|
-
let o =
|
|
57
|
+
}, getGroupIdForArbitraryProperty = (t) => t.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
58
|
+
let o = t.slice(1, -1), s = o.indexOf(":"), c = o.slice(0, s);
|
|
59
59
|
return c ? ARBITRARY_PROPERTY_PREFIX + c : void 0;
|
|
60
|
-
})(), createClassMap = (
|
|
61
|
-
let { theme: o, classGroups: s } =
|
|
60
|
+
})(), createClassMap = (t) => {
|
|
61
|
+
let { theme: o, classGroups: s } = t;
|
|
62
62
|
return processClassGroups(s, o);
|
|
63
|
-
}, processClassGroups = (
|
|
63
|
+
}, processClassGroups = (t, o) => {
|
|
64
64
|
let s = createClassPartObject();
|
|
65
|
-
for (let c in
|
|
66
|
-
let l =
|
|
65
|
+
for (let c in t) {
|
|
66
|
+
let l = t[c];
|
|
67
67
|
processClassesRecursively(l, s, c, o);
|
|
68
68
|
}
|
|
69
69
|
return s;
|
|
70
|
-
}, processClassesRecursively = (
|
|
71
|
-
let l =
|
|
70
|
+
}, processClassesRecursively = (t, o, s, c) => {
|
|
71
|
+
let l = t.length;
|
|
72
72
|
for (let u = 0; u < l; u++) {
|
|
73
|
-
let l =
|
|
73
|
+
let l = t[u];
|
|
74
74
|
processClassDefinition(l, o, s, c);
|
|
75
75
|
}
|
|
76
|
-
}, processClassDefinition = (
|
|
77
|
-
if (typeof
|
|
78
|
-
processStringDefinition(
|
|
76
|
+
}, processClassDefinition = (t, o, s, c) => {
|
|
77
|
+
if (typeof t == "string") {
|
|
78
|
+
processStringDefinition(t, o, s);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
if (typeof
|
|
82
|
-
processFunctionDefinition(
|
|
81
|
+
if (typeof t == "function") {
|
|
82
|
+
processFunctionDefinition(t, o, s, c);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
processObjectDefinition(
|
|
86
|
-
}, processStringDefinition = (
|
|
87
|
-
let c =
|
|
85
|
+
processObjectDefinition(t, o, s, c);
|
|
86
|
+
}, processStringDefinition = (t, o, s) => {
|
|
87
|
+
let c = t === "" ? o : getPart(o, t);
|
|
88
88
|
c.classGroupId = s;
|
|
89
|
-
}, processFunctionDefinition = (
|
|
90
|
-
if (isThemeGetter(
|
|
91
|
-
processClassesRecursively(
|
|
89
|
+
}, processFunctionDefinition = (t, o, s, c) => {
|
|
90
|
+
if (isThemeGetter(t)) {
|
|
91
|
+
processClassesRecursively(t(c), o, s, c);
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
o.validators === null && (o.validators = []), o.validators.push(createClassValidatorObject(s,
|
|
95
|
-
}, processObjectDefinition = (
|
|
96
|
-
let l = Object.entries(
|
|
97
|
-
for (let
|
|
98
|
-
let [u, d] = l[
|
|
94
|
+
o.validators === null && (o.validators = []), o.validators.push(createClassValidatorObject(s, t));
|
|
95
|
+
}, processObjectDefinition = (t, o, s, c) => {
|
|
96
|
+
let l = Object.entries(t), u = l.length;
|
|
97
|
+
for (let t = 0; t < u; t++) {
|
|
98
|
+
let [u, d] = l[t];
|
|
99
99
|
processClassesRecursively(d, getPart(o, u), s, c);
|
|
100
100
|
}
|
|
101
|
-
}, getPart = (
|
|
102
|
-
let s =
|
|
103
|
-
for (let
|
|
104
|
-
let o = c[
|
|
101
|
+
}, getPart = (t, o) => {
|
|
102
|
+
let s = t, c = o.split(CLASS_PART_SEPARATOR), l = c.length;
|
|
103
|
+
for (let t = 0; t < l; t++) {
|
|
104
|
+
let o = c[t], l = s.nextPart.get(o);
|
|
105
105
|
l || (l = createClassPartObject(), s.nextPart.set(o, l)), s = l;
|
|
106
106
|
}
|
|
107
107
|
return s;
|
|
108
|
-
}, isThemeGetter = (
|
|
109
|
-
if (
|
|
108
|
+
}, isThemeGetter = (t) => "isThemeGetter" in t && t.isThemeGetter === !0, createLruCache = (t) => {
|
|
109
|
+
if (t < 1) return {
|
|
110
110
|
get: () => void 0,
|
|
111
111
|
set: () => {}
|
|
112
112
|
};
|
|
113
113
|
let o = 0, s = Object.create(null), c = Object.create(null), l = (l, u) => {
|
|
114
|
-
s[l] = u, o++, o >
|
|
114
|
+
s[l] = u, o++, o > t && (o = 0, c = s, s = Object.create(null));
|
|
115
115
|
};
|
|
116
116
|
return {
|
|
117
|
-
get(
|
|
118
|
-
let o = s[
|
|
117
|
+
get(t) {
|
|
118
|
+
let o = s[t];
|
|
119
119
|
if (o !== void 0) return o;
|
|
120
|
-
if ((o = c[
|
|
120
|
+
if ((o = c[t]) !== void 0) return l(t, o), o;
|
|
121
121
|
},
|
|
122
|
-
set(
|
|
123
|
-
|
|
122
|
+
set(t, o) {
|
|
123
|
+
t in s ? s[t] = o : l(t, o);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
}, IMPORTANT_MODIFIER = "!", MODIFIER_SEPARATOR = ":", EMPTY_MODIFIERS = [], createResultObject = (
|
|
127
|
-
modifiers:
|
|
126
|
+
}, IMPORTANT_MODIFIER = "!", MODIFIER_SEPARATOR = ":", EMPTY_MODIFIERS = [], createResultObject = (t, o, s, c, l) => ({
|
|
127
|
+
modifiers: t,
|
|
128
128
|
hasImportantModifier: o,
|
|
129
129
|
baseClassName: s,
|
|
130
130
|
maybePostfixModifierPosition: c,
|
|
131
131
|
isExternal: l
|
|
132
|
-
}), createParseClassName = (
|
|
133
|
-
let { prefix: o, experimentalParseClassName: s } =
|
|
134
|
-
let o = [], s = 0, c = 0, l = 0, u, d =
|
|
132
|
+
}), createParseClassName = (t) => {
|
|
133
|
+
let { prefix: o, experimentalParseClassName: s } = t, c = (t) => {
|
|
134
|
+
let o = [], s = 0, c = 0, l = 0, u, d = t.length;
|
|
135
135
|
for (let f = 0; f < d; f++) {
|
|
136
|
-
let d =
|
|
136
|
+
let d = t[f];
|
|
137
137
|
if (s === 0 && c === 0) {
|
|
138
138
|
if (d === MODIFIER_SEPARATOR) {
|
|
139
|
-
o.push(
|
|
139
|
+
o.push(t.slice(l, f)), l = f + 1;
|
|
140
140
|
continue;
|
|
141
141
|
}
|
|
142
142
|
if (d === "/") {
|
|
@@ -146,44 +146,44 @@ var concatArrays = (e, o) => {
|
|
|
146
146
|
}
|
|
147
147
|
d === "[" ? s++ : d === "]" ? s-- : d === "(" ? c++ : d === ")" && c--;
|
|
148
148
|
}
|
|
149
|
-
let f = o.length === 0 ?
|
|
149
|
+
let f = o.length === 0 ? t : t.slice(l), p = f, m = !1;
|
|
150
150
|
f.endsWith(IMPORTANT_MODIFIER) ? (p = f.slice(0, -1), m = !0) : f.startsWith(IMPORTANT_MODIFIER) && (p = f.slice(1), m = !0);
|
|
151
151
|
let h = u && u > l ? u - l : void 0;
|
|
152
152
|
return createResultObject(o, m, p, h);
|
|
153
153
|
};
|
|
154
154
|
if (o) {
|
|
155
|
-
let
|
|
156
|
-
c = (o) => o.startsWith(
|
|
155
|
+
let t = o + MODIFIER_SEPARATOR, s = c;
|
|
156
|
+
c = (o) => o.startsWith(t) ? s(o.slice(t.length)) : createResultObject(EMPTY_MODIFIERS, !1, o, void 0, !0);
|
|
157
157
|
}
|
|
158
158
|
if (s) {
|
|
159
|
-
let
|
|
159
|
+
let t = c;
|
|
160
160
|
c = (o) => s({
|
|
161
161
|
className: o,
|
|
162
|
-
parseClassName:
|
|
162
|
+
parseClassName: t
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
return c;
|
|
166
|
-
}, createSortModifiers = (
|
|
166
|
+
}, createSortModifiers = (t) => {
|
|
167
167
|
let o = /* @__PURE__ */ new Map();
|
|
168
|
-
return
|
|
169
|
-
o.set(
|
|
170
|
-
}), (
|
|
168
|
+
return t.orderSensitiveModifiers.forEach((t, s) => {
|
|
169
|
+
o.set(t, 1e6 + s);
|
|
170
|
+
}), (t) => {
|
|
171
171
|
let s = [], c = [];
|
|
172
|
-
for (let l = 0; l <
|
|
173
|
-
let u =
|
|
172
|
+
for (let l = 0; l < t.length; l++) {
|
|
173
|
+
let u = t[l], d = u[0] === "[", f = o.has(u);
|
|
174
174
|
d || f ? (c.length > 0 && (c.sort(), s.push(...c), c = []), s.push(u)) : c.push(u);
|
|
175
175
|
}
|
|
176
176
|
return c.length > 0 && (c.sort(), s.push(...c)), s;
|
|
177
177
|
};
|
|
178
|
-
}, createConfigUtils = (
|
|
179
|
-
cache: createLruCache(
|
|
180
|
-
parseClassName: createParseClassName(
|
|
181
|
-
sortModifiers: createSortModifiers(
|
|
182
|
-
...createClassGroupUtils(
|
|
183
|
-
}), SPLIT_CLASSES_REGEX = /\s+/, mergeClassList = (
|
|
184
|
-
let { parseClassName: s, getClassGroupId: c, getConflictingClassGroupIds: l, sortModifiers: u } = o, d = [], f =
|
|
185
|
-
for (let
|
|
186
|
-
let o = f[
|
|
178
|
+
}, createConfigUtils = (t) => ({
|
|
179
|
+
cache: createLruCache(t.cacheSize),
|
|
180
|
+
parseClassName: createParseClassName(t),
|
|
181
|
+
sortModifiers: createSortModifiers(t),
|
|
182
|
+
...createClassGroupUtils(t)
|
|
183
|
+
}), SPLIT_CLASSES_REGEX = /\s+/, mergeClassList = (t, o) => {
|
|
184
|
+
let { parseClassName: s, getClassGroupId: c, getConflictingClassGroupIds: l, sortModifiers: u } = o, d = [], f = t.trim().split(SPLIT_CLASSES_REGEX), p = "";
|
|
185
|
+
for (let t = f.length - 1; t >= 0; --t) {
|
|
186
|
+
let o = f[t], { isExternal: m, modifiers: h, hasImportantModifier: g, baseClassName: _, maybePostfixModifierPosition: v } = s(o);
|
|
187
187
|
if (m) {
|
|
188
188
|
p = o + (p.length > 0 ? " " + p : p);
|
|
189
189
|
continue;
|
|
@@ -204,41 +204,41 @@ var concatArrays = (e, o) => {
|
|
|
204
204
|
if (d.indexOf(C) > -1) continue;
|
|
205
205
|
d.push(C);
|
|
206
206
|
let w = l(b, y);
|
|
207
|
-
for (let
|
|
208
|
-
let o = w[
|
|
207
|
+
for (let t = 0; t < w.length; ++t) {
|
|
208
|
+
let o = w[t];
|
|
209
209
|
d.push(S + o);
|
|
210
210
|
}
|
|
211
211
|
p = o + (p.length > 0 ? " " + p : p);
|
|
212
212
|
}
|
|
213
213
|
return p;
|
|
214
|
-
}, twJoin = (...
|
|
214
|
+
}, twJoin = (...t) => {
|
|
215
215
|
let o = 0, s, c, l = "";
|
|
216
|
-
for (; o <
|
|
216
|
+
for (; o < t.length;) (s = t[o++]) && (c = toValue(s)) && (l && (l += " "), l += c);
|
|
217
217
|
return l;
|
|
218
|
-
}, toValue = (
|
|
219
|
-
if (typeof
|
|
218
|
+
}, toValue = (t) => {
|
|
219
|
+
if (typeof t == "string") return t;
|
|
220
220
|
let o, s = "";
|
|
221
|
-
for (let c = 0; c <
|
|
221
|
+
for (let c = 0; c < t.length; c++) t[c] && (o = toValue(t[c])) && (s && (s += " "), s += o);
|
|
222
222
|
return s;
|
|
223
|
-
}, createTailwindMerge = (
|
|
224
|
-
let s, c, l, u, d = (d) => (s = createConfigUtils(o.reduce((
|
|
225
|
-
let o = c(
|
|
223
|
+
}, createTailwindMerge = (t, ...o) => {
|
|
224
|
+
let s, c, l, u, d = (d) => (s = createConfigUtils(o.reduce((t, o) => o(t), t())), c = s.cache.get, l = s.cache.set, u = f, f(d)), f = (t) => {
|
|
225
|
+
let o = c(t);
|
|
226
226
|
if (o) return o;
|
|
227
|
-
let u = mergeClassList(
|
|
228
|
-
return l(
|
|
227
|
+
let u = mergeClassList(t, s);
|
|
228
|
+
return l(t, u), u;
|
|
229
229
|
};
|
|
230
|
-
return u = d, (...
|
|
231
|
-
}, fallbackThemeArr = [], fromTheme = (
|
|
232
|
-
let o = (o) => o[
|
|
230
|
+
return u = d, (...t) => u(twJoin(...t));
|
|
231
|
+
}, fallbackThemeArr = [], fromTheme = (t) => {
|
|
232
|
+
let o = (o) => o[t] || fallbackThemeArr;
|
|
233
233
|
return o.isThemeGetter = !0, o;
|
|
234
|
-
}, arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i, fractionRegex = /^\d+\/\d+$/, tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, isFraction = (
|
|
235
|
-
let c = arbitraryValueRegex.exec(
|
|
234
|
+
}, arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i, fractionRegex = /^\d+\/\d+$/, tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, isFraction = (t) => fractionRegex.test(t), isNumber = (t) => !!t && !Number.isNaN(Number(t)), isInteger = (t) => !!t && Number.isInteger(Number(t)), isPercent = (t) => t.endsWith("%") && isNumber(t.slice(0, -1)), isTshirtSize = (t) => tshirtUnitRegex.test(t), isAny = () => !0, isLengthOnly = (t) => lengthUnitRegex.test(t) && !colorFunctionRegex.test(t), isNever = () => !1, isShadow = (t) => shadowRegex.test(t), isImage = (t) => imageRegex.test(t), isAnyNonArbitrary = (t) => !isArbitraryValue(t) && !isArbitraryVariable(t), isArbitrarySize = (t) => getIsArbitraryValue(t, isLabelSize, isNever), isArbitraryValue = (t) => arbitraryValueRegex.test(t), isArbitraryLength = (t) => getIsArbitraryValue(t, isLabelLength, isLengthOnly), isArbitraryNumber = (t) => getIsArbitraryValue(t, isLabelNumber, isNumber), isArbitraryPosition = (t) => getIsArbitraryValue(t, isLabelPosition, isNever), isArbitraryImage = (t) => getIsArbitraryValue(t, isLabelImage, isImage), isArbitraryShadow = (t) => getIsArbitraryValue(t, isLabelShadow, isShadow), isArbitraryVariable = (t) => arbitraryVariableRegex.test(t), isArbitraryVariableLength = (t) => getIsArbitraryVariable(t, isLabelLength), isArbitraryVariableFamilyName = (t) => getIsArbitraryVariable(t, isLabelFamilyName), isArbitraryVariablePosition = (t) => getIsArbitraryVariable(t, isLabelPosition), isArbitraryVariableSize = (t) => getIsArbitraryVariable(t, isLabelSize), isArbitraryVariableImage = (t) => getIsArbitraryVariable(t, isLabelImage), isArbitraryVariableShadow = (t) => getIsArbitraryVariable(t, isLabelShadow, !0), getIsArbitraryValue = (t, o, s) => {
|
|
235
|
+
let c = arbitraryValueRegex.exec(t);
|
|
236
236
|
return c ? c[1] ? o(c[1]) : s(c[2]) : !1;
|
|
237
|
-
}, getIsArbitraryVariable = (
|
|
238
|
-
let c = arbitraryVariableRegex.exec(
|
|
237
|
+
}, getIsArbitraryVariable = (t, o, s = !1) => {
|
|
238
|
+
let c = arbitraryVariableRegex.exec(t);
|
|
239
239
|
return c ? c[1] ? o(c[1]) : s : !1;
|
|
240
|
-
}, isLabelPosition = (
|
|
241
|
-
let
|
|
240
|
+
}, isLabelPosition = (t) => t === "position" || t === "percentage", isLabelImage = (t) => t === "image" || t === "url", isLabelSize = (t) => t === "length" || t === "size" || t === "bg-size", isLabelLength = (t) => t === "length", isLabelNumber = (t) => t === "number", isLabelFamilyName = (t) => t === "family-name", isLabelShadow = (t) => t === "shadow", twMerge = /* @__PURE__ */ createTailwindMerge(() => {
|
|
241
|
+
let t = fromTheme("color"), o = fromTheme("font"), s = fromTheme("text"), c = fromTheme("font-weight"), l = fromTheme("tracking"), u = fromTheme("leading"), d = fromTheme("breakpoint"), f = fromTheme("container"), p = fromTheme("spacing"), m = fromTheme("radius"), h = fromTheme("shadow"), g = fromTheme("inset-shadow"), _ = fromTheme("text-shadow"), v = fromTheme("drop-shadow"), y = fromTheme("blur"), b = fromTheme("perspective"), x = fromTheme("aspect"), S = fromTheme("ease"), C = fromTheme("animate"), w = () => [
|
|
242
242
|
"auto",
|
|
243
243
|
"avoid",
|
|
244
244
|
"all",
|
|
@@ -346,7 +346,7 @@ var concatArrays = (e, o) => {
|
|
|
346
346
|
"fit",
|
|
347
347
|
...k()
|
|
348
348
|
], z = () => [
|
|
349
|
-
|
|
349
|
+
t,
|
|
350
350
|
isArbitraryVariable,
|
|
351
351
|
isArbitraryValue
|
|
352
352
|
], B = () => [
|
|
@@ -1617,8 +1617,8 @@ var concatArrays = (e, o) => {
|
|
|
1617
1617
|
]
|
|
1618
1618
|
};
|
|
1619
1619
|
});
|
|
1620
|
-
function cn(...
|
|
1621
|
-
return twMerge(clsx(
|
|
1620
|
+
function cn(...t) {
|
|
1621
|
+
return twMerge(clsx(t));
|
|
1622
1622
|
}
|
|
1623
1623
|
function Badge({ className: o, children: s, ...c }) {
|
|
1624
1624
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -1641,4 +1641,20 @@ function Link({ className: o, children: s, ...c }) {
|
|
|
1641
1641
|
children: s
|
|
1642
1642
|
});
|
|
1643
1643
|
}
|
|
1644
|
-
|
|
1644
|
+
function Switch({ className: s, ...c }) {
|
|
1645
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
1646
|
+
className: "inline-flex cursor-pointer",
|
|
1647
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
1648
|
+
type: "checkbox",
|
|
1649
|
+
className: "appearance-none peer",
|
|
1650
|
+
...c
|
|
1651
|
+
}), /* @__PURE__ */ jsx("div", { className: cn("relative w-9 h-5 bg-gray-500 rounded-full flex peer-checked:bg-success peer-checked:after:translate-x-full after:transition-all after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4", s) })]
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
function Textarea({ className: o, ...s }) {
|
|
1655
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
1656
|
+
className: cn("text-sm block rounded-md border border-primary/40 bg-secondary focus:outline-none p-1 focus:ring-2 focus:ring-primary/40 focus:border-none", o),
|
|
1657
|
+
...s
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
export { Badge, Button, Link, Switch, Textarea };
|