@twintag/twintag-form 0.5.0 → 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/.eslintrc.cjs +1 -1
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +11 -0
- package/dist/components/Category/__styles.d.ts +11 -1
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/Input/__styles.d.ts +236 -21
- package/dist/index.d.ts +1 -1
- package/dist/styles.d.ts +247 -22
- package/dist/twintag-form.react.js +3757 -3689
- package/dist/twintag-form.webcomponent.js +119 -119
- package/lib/__stories__/Form.stories.tsx +3 -3
- package/lib/components/Form/index.tsx +1 -1
- package/lib/components/Input/__styles.ts +16 -16
- package/lib/components/Input/checkbox.tsx +1 -1
- package/lib/components/Input/file.tsx +1 -1
- package/lib/components/Input/simple.tsx +1 -1
- package/lib/components/Input/textarea.tsx +1 -1
- package/lib/components/Input/toggle.tsx +1 -1
- package/lib/components/Label/index.tsx +1 -1
- package/lib/index.tsx +4 -4
- package/lib/styles.ts +18 -18
- package/lib/webcomponent.ts +3 -3
- package/package.json +7 -7
- package/tsconfig.json +12 -4
- package/twind.config.ts +7 -7
- package/vite.config.ts +1 -1
|
@@ -174,7 +174,7 @@ function Be({ n: e, i: t, v: r = [] }, o, n, i) {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
let at = /* @__PURE__ */ new Map();
|
|
177
|
-
function
|
|
177
|
+
function Re(e) {
|
|
178
178
|
if (e.d) {
|
|
179
179
|
let t = [], r = be(
|
|
180
180
|
// merge all conditions into a selector string
|
|
@@ -273,8 +273,8 @@ function ct(e, t, r, o, n = []) {
|
|
|
273
273
|
continue;
|
|
274
274
|
}
|
|
275
275
|
if (x[1] == "l") {
|
|
276
|
-
for (let
|
|
277
|
-
h.push(...i(
|
|
276
|
+
for (let F of S(C))
|
|
277
|
+
h.push(...i(F, {
|
|
278
278
|
n: s,
|
|
279
279
|
p: (k = T[x[7]], // Set layer (first reset, than set)
|
|
280
280
|
a & ~T.o | k),
|
|
@@ -284,12 +284,12 @@ function ct(e, t, r, o, n = []) {
|
|
|
284
284
|
continue;
|
|
285
285
|
}
|
|
286
286
|
if (x[1] == "i") {
|
|
287
|
-
h.push(...S(C).map((
|
|
287
|
+
h.push(...S(C).map((F) => ({
|
|
288
288
|
// before all layers
|
|
289
289
|
p: -1,
|
|
290
290
|
o: 0,
|
|
291
291
|
r: [],
|
|
292
|
-
d: x + " " +
|
|
292
|
+
d: x + " " + F
|
|
293
293
|
})));
|
|
294
294
|
continue;
|
|
295
295
|
}
|
|
@@ -302,20 +302,20 @@ function ct(e, t, r, o, n = []) {
|
|
|
302
302
|
],
|
|
303
303
|
d: i(C, {
|
|
304
304
|
p: T.d
|
|
305
|
-
}, f).map(
|
|
305
|
+
}, f).map(Re).join("")
|
|
306
306
|
});
|
|
307
307
|
continue;
|
|
308
308
|
}
|
|
309
309
|
if (x[1] == "f") {
|
|
310
|
-
h.push(...S(C).map((
|
|
310
|
+
h.push(...S(C).map((F) => ({
|
|
311
311
|
p: T.d,
|
|
312
312
|
o: 0,
|
|
313
313
|
r: [
|
|
314
314
|
x
|
|
315
315
|
],
|
|
316
|
-
d: i(
|
|
316
|
+
d: i(F, {
|
|
317
317
|
p: T.d
|
|
318
|
-
}, f).map(
|
|
318
|
+
}, f).map(Re).join("")
|
|
319
319
|
})));
|
|
320
320
|
continue;
|
|
321
321
|
}
|
|
@@ -325,25 +325,25 @@ function ct(e, t, r, o, n = []) {
|
|
|
325
325
|
a,
|
|
326
326
|
u,
|
|
327
327
|
l
|
|
328
|
-
])) : (C || C === 0) && (x = x.replace(/[A-Z]/g, (
|
|
328
|
+
])) : (C || C === 0) && (x = x.replace(/[A-Z]/g, (F) => "-" + F.toLowerCase()), y += 1, w = Math.max(w, (D = x)[0] == "-" ? 0 : it(D) + (/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(D) ? +!!RegExp.$1 || /* +1 */
|
|
329
329
|
-!!RegExp.$2 : (
|
|
330
330
|
/* -1 */
|
|
331
331
|
0
|
|
332
|
-
)) + 1), b += (b ? ";" : "") + S(C).map((
|
|
332
|
+
)) + 1), b += (b ? ";" : "") + S(C).map((F) => f.s(
|
|
333
333
|
x,
|
|
334
334
|
// support theme(...) function in values
|
|
335
335
|
// calc(100vh - theme('spacing.12'))
|
|
336
|
-
Me("" +
|
|
336
|
+
Me("" + F, f.theme) + (u ? " !important" : "")
|
|
337
337
|
)).join(";"));
|
|
338
338
|
else if (x[0] == "@" || x.includes("&")) {
|
|
339
|
-
let
|
|
340
|
-
x[0] == "@" && (x = x.replace(/\bscreen\(([^)]+)\)/g, (he,
|
|
341
|
-
let V = f.theme("screens",
|
|
342
|
-
return V ? (
|
|
339
|
+
let F = a;
|
|
340
|
+
x[0] == "@" && (x = x.replace(/\bscreen\(([^)]+)\)/g, (he, J) => {
|
|
341
|
+
let V = f.theme("screens", J);
|
|
342
|
+
return V ? (F |= 67108864, /* Shifts.screens */
|
|
343
343
|
De(V, "")) : he;
|
|
344
|
-
}),
|
|
344
|
+
}), F |= ze(x)), h.push(...i(C, {
|
|
345
345
|
n: s,
|
|
346
|
-
p:
|
|
346
|
+
p: F,
|
|
347
347
|
r: [
|
|
348
348
|
...c,
|
|
349
349
|
x
|
|
@@ -548,23 +548,23 @@ function ue(e) {
|
|
|
548
548
|
function d(e, t, r) {
|
|
549
549
|
return [
|
|
550
550
|
e,
|
|
551
|
-
|
|
551
|
+
Ae(t, r)
|
|
552
552
|
];
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Ae(e, t) {
|
|
555
555
|
return typeof e == "function" ? e : typeof e == "string" && /^[\w-]+$/.test(e) ? (
|
|
556
556
|
// a CSS property alias
|
|
557
557
|
(r, o) => ({
|
|
558
|
-
[e]: t ? t(r, o) :
|
|
558
|
+
[e]: t ? t(r, o) : Fe(r, 1)
|
|
559
559
|
})
|
|
560
560
|
) : (r) => (
|
|
561
561
|
// CSSObject, shortcut or apply
|
|
562
562
|
e || {
|
|
563
|
-
[r[1]]:
|
|
563
|
+
[r[1]]: Fe(r, 2)
|
|
564
564
|
}
|
|
565
565
|
);
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Fe(e, t, r = e.slice(t).find(Boolean) || e.$$ || e.input) {
|
|
568
568
|
return e.input[0] == "-" ? `calc(${r} * -1)` : r;
|
|
569
569
|
}
|
|
570
570
|
function p(e, t, r, o) {
|
|
@@ -582,7 +582,7 @@ function Tt(e, t, r) {
|
|
|
582
582
|
return (n, i) => {
|
|
583
583
|
let l = pt(e || n[1]), s = i.theme(l, n.$$) ?? P(n.$$, l, i);
|
|
584
584
|
if (s != null)
|
|
585
|
-
return n._ =
|
|
585
|
+
return n._ = Fe(n, 0, s), o(n, i, l);
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
588
|
function $(e, t = {}, r) {
|
|
@@ -749,15 +749,15 @@ function Ne(e, t, r, o, n, i) {
|
|
|
749
749
|
return a;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Rt(e) {
|
|
753
753
|
var t;
|
|
754
|
-
return
|
|
754
|
+
return Ee(e[0], typeof (t = e[1]) == "function" ? t : () => t);
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function At(e) {
|
|
757
757
|
var t, r;
|
|
758
|
-
return Array.isArray(e) ?
|
|
758
|
+
return Array.isArray(e) ? Ee(e[0], Ae(e[1], e[2])) : Ee(e, Ae(t, r));
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Ee(e, t) {
|
|
761
761
|
return ut(e, (r, o, n, i) => {
|
|
762
762
|
let l = o.exec(r);
|
|
763
763
|
if (l)
|
|
@@ -768,7 +768,7 @@ function Fe(e, t) {
|
|
|
768
768
|
});
|
|
769
769
|
}
|
|
770
770
|
function ut(e, t) {
|
|
771
|
-
let r = S(e).map(
|
|
771
|
+
let r = S(e).map(Ft);
|
|
772
772
|
return (o, n, i) => {
|
|
773
773
|
for (let l of r) {
|
|
774
774
|
let s = t(o, l, n, i);
|
|
@@ -777,12 +777,12 @@ function ut(e, t) {
|
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Ft(e) {
|
|
781
781
|
return typeof e == "string" ? RegExp("^" + e + (e.includes("$") || e.slice(-1) == "-" ? "" : "$")) : e;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function Et(e, t) {
|
|
784
784
|
let r = ft(e), o = function({ theme: a, darkMode: c, darkColor: u = Le, variants: f, rules: h, hash: b, stringify: w, ignorelist: y, finalize: k }) {
|
|
785
|
-
let D = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(),
|
|
785
|
+
let D = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), he = ut(y, (v, A) => A.test(v));
|
|
786
786
|
f.push([
|
|
787
787
|
"dark",
|
|
788
788
|
Array.isArray(c) || c == "class" ? `${S(c)[1] || ".dark"} &` : typeof c == "string" && c != "media" ? c : (
|
|
@@ -790,17 +790,17 @@ function Ft(e, t) {
|
|
|
790
790
|
"@media (prefers-color-scheme:dark)"
|
|
791
791
|
)
|
|
792
792
|
]);
|
|
793
|
-
let
|
|
794
|
-
|
|
795
|
-
var
|
|
793
|
+
let J = typeof b == "function" ? (v) => b(v, pe) : b ? pe : qe;
|
|
794
|
+
J !== qe && k.push((v) => {
|
|
795
|
+
var A;
|
|
796
796
|
return {
|
|
797
797
|
...v,
|
|
798
|
-
n: v.n &&
|
|
799
|
-
d: (
|
|
798
|
+
n: v.n && J(v.n),
|
|
799
|
+
d: (A = v.d) == null ? void 0 : A.replace(/--(tw(?:-[\w-]+)?)\b/g, (L, me) => "--" + J(me).replace("#", ""))
|
|
800
800
|
};
|
|
801
801
|
});
|
|
802
802
|
let V = {
|
|
803
|
-
theme: function({ extend: v = {}, ...
|
|
803
|
+
theme: function({ extend: v = {}, ...A }) {
|
|
804
804
|
let L = {}, me = {
|
|
805
805
|
get colors() {
|
|
806
806
|
return Z("colors");
|
|
@@ -810,49 +810,49 @@ function Ft(e, t) {
|
|
|
810
810
|
negative() {
|
|
811
811
|
return {};
|
|
812
812
|
},
|
|
813
|
-
breakpoints(
|
|
814
|
-
let
|
|
815
|
-
for (let W in
|
|
816
|
-
typeof
|
|
817
|
-
return
|
|
813
|
+
breakpoints(R) {
|
|
814
|
+
let E = {};
|
|
815
|
+
for (let W in R)
|
|
816
|
+
typeof R[W] == "string" && (E["screen-" + W] = R[W]);
|
|
817
|
+
return E;
|
|
818
818
|
}
|
|
819
819
|
};
|
|
820
820
|
return Z;
|
|
821
|
-
function Z(
|
|
822
|
-
if (
|
|
823
|
-
if ({ 1:
|
|
824
|
-
/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(
|
|
821
|
+
function Z(R, E, W, Q) {
|
|
822
|
+
if (R) {
|
|
823
|
+
if ({ 1: R, 2: Q } = // eslint-disable-next-line no-sparse-arrays
|
|
824
|
+
/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(R) || [
|
|
825
825
|
,
|
|
826
|
-
|
|
827
|
-
], /[.[]/.test(
|
|
826
|
+
R
|
|
827
|
+
], /[.[]/.test(R)) {
|
|
828
828
|
let B = [];
|
|
829
|
-
|
|
829
|
+
R.replace(/\[([^\]]+)\]|([^.[]+)/g, (N, ee, wt = ee) => B.push(wt)), R = B.shift(), W = E, E = B.join("-");
|
|
830
830
|
}
|
|
831
|
-
let U = L[
|
|
831
|
+
let U = L[R] || // two-step deref to allow extend section to reference base section
|
|
832
832
|
Object.assign(Object.assign(
|
|
833
833
|
// Make sure to not get into recursive calls
|
|
834
|
-
L[
|
|
835
|
-
Ue(
|
|
836
|
-
), Ue(v,
|
|
837
|
-
if (
|
|
834
|
+
L[R] = {},
|
|
835
|
+
Ue(A, R)
|
|
836
|
+
), Ue(v, R));
|
|
837
|
+
if (E == null)
|
|
838
838
|
return U;
|
|
839
|
-
|
|
840
|
-
let _ = U[
|
|
839
|
+
E || (E = "DEFAULT");
|
|
840
|
+
let _ = U[E] ?? E.split("-").reduce((B, N) => B == null ? void 0 : B[N], U) ?? W;
|
|
841
841
|
return Q ? z(_, {
|
|
842
842
|
opacityValue: Me(Q, Z)
|
|
843
843
|
}) : _;
|
|
844
844
|
}
|
|
845
845
|
let K = {};
|
|
846
846
|
for (let U of [
|
|
847
|
-
...Object.keys(
|
|
847
|
+
...Object.keys(A),
|
|
848
848
|
...Object.keys(v)
|
|
849
849
|
])
|
|
850
850
|
K[U] = Z(U);
|
|
851
851
|
return K;
|
|
852
852
|
}
|
|
853
|
-
function Ue(
|
|
854
|
-
let W =
|
|
855
|
-
return typeof W == "function" && (W = W(me)), W && /color|fill|stroke/i.test(
|
|
853
|
+
function Ue(R, E) {
|
|
854
|
+
let W = R[E];
|
|
855
|
+
return typeof W == "function" && (W = W(me)), W && /color|fill|stroke/i.test(E) ? function Q(K, U = []) {
|
|
856
856
|
let _ = {};
|
|
857
857
|
for (let B in K) {
|
|
858
858
|
let N = K[B], ee = [
|
|
@@ -866,25 +866,25 @@ function Ft(e, t) {
|
|
|
866
866
|
}
|
|
867
867
|
}(a),
|
|
868
868
|
e: nt,
|
|
869
|
-
h:
|
|
870
|
-
s(v,
|
|
871
|
-
return w(v,
|
|
869
|
+
h: J,
|
|
870
|
+
s(v, A) {
|
|
871
|
+
return w(v, A, V);
|
|
872
872
|
},
|
|
873
|
-
d(v,
|
|
874
|
-
return u(v,
|
|
873
|
+
d(v, A, L) {
|
|
874
|
+
return u(v, A, V, L);
|
|
875
875
|
},
|
|
876
876
|
v(v) {
|
|
877
|
-
return D.has(v) || D.set(v, Ne(v, f, x,
|
|
877
|
+
return D.has(v) || D.set(v, Ne(v, f, x, Rt, V) || "&:" + v), D.get(v);
|
|
878
878
|
},
|
|
879
|
-
r(v,
|
|
879
|
+
r(v, A) {
|
|
880
880
|
let L = JSON.stringify([
|
|
881
881
|
v,
|
|
882
|
-
|
|
882
|
+
A
|
|
883
883
|
]);
|
|
884
|
-
return C.has(L) || C.set(L, !he(v, V) && Ne(v, h,
|
|
884
|
+
return C.has(L) || C.set(L, !he(v, V) && Ne(v, h, F, At, V, A)), C.get(L);
|
|
885
885
|
},
|
|
886
886
|
f(v) {
|
|
887
|
-
return k.reduce((
|
|
887
|
+
return k.reduce((A, L) => L(A, V), v);
|
|
888
888
|
}
|
|
889
889
|
};
|
|
890
890
|
return V;
|
|
@@ -893,7 +893,7 @@ function Ft(e, t) {
|
|
|
893
893
|
t.insert(a, i.length, c), i.push(c), l.add(a);
|
|
894
894
|
});
|
|
895
895
|
function s(a) {
|
|
896
|
-
let c = o.f(a), u =
|
|
896
|
+
let c = o.f(a), u = Re(c);
|
|
897
897
|
if (u && !l.has(u)) {
|
|
898
898
|
l.add(u);
|
|
899
899
|
let f = lt(i, a);
|
|
@@ -1064,7 +1064,7 @@ function Dt(e, t = !0) {
|
|
|
1064
1064
|
c >= 0 && l.splice(c, 1);
|
|
1065
1065
|
}
|
|
1066
1066
|
};
|
|
1067
|
-
}(), o =
|
|
1067
|
+
}(), o = Et({
|
|
1068
1068
|
...e,
|
|
1069
1069
|
// in production use short hashed class names
|
|
1070
1070
|
hash: e.hash ?? t
|
|
@@ -1091,7 +1091,21 @@ function ke(e) {
|
|
|
1091
1091
|
mode: "open"
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
|
-
var
|
|
1094
|
+
var We, ie = yt;
|
|
1095
|
+
if (process.env.NODE_ENV === "production")
|
|
1096
|
+
We = ie.createRoot, ie.hydrateRoot;
|
|
1097
|
+
else {
|
|
1098
|
+
var Ge = ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1099
|
+
We = function(e, t) {
|
|
1100
|
+
Ge.usingClientEntryPoint = !0;
|
|
1101
|
+
try {
|
|
1102
|
+
return ie.createRoot(e, t);
|
|
1103
|
+
} finally {
|
|
1104
|
+
Ge.usingClientEntryPoint = !1;
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
var Bt = Object.defineProperty, Mt = (e, t, r) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ae = (e, t, r) => (Mt(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
1095
1109
|
const Vt = {
|
|
1096
1110
|
stringify: (e) => e,
|
|
1097
1111
|
parse: (e) => e
|
|
@@ -1121,7 +1135,7 @@ const Vt = {
|
|
|
1121
1135
|
boolean: qt,
|
|
1122
1136
|
function: Ht,
|
|
1123
1137
|
json: It
|
|
1124
|
-
}, Ce = Symbol.for("r2wc.render"),
|
|
1138
|
+
}, Ce = Symbol.for("r2wc.render"), le = Symbol.for("r2wc.connected"), G = Symbol.for("r2wc.context"), H = Symbol.for("r2wc.props");
|
|
1125
1139
|
function Pt(e, t, r) {
|
|
1126
1140
|
var o, n, i;
|
|
1127
1141
|
t.props || (t.props = e.propTypes ? Object.keys(e.propTypes) : []);
|
|
@@ -1133,7 +1147,7 @@ function Pt(e, t, r) {
|
|
|
1133
1147
|
}
|
|
1134
1148
|
class u extends HTMLElement {
|
|
1135
1149
|
constructor() {
|
|
1136
|
-
super(),
|
|
1150
|
+
super(), ae(this, o, !0), ae(this, n), ae(this, i, {}), ae(this, "container"), t.shadow ? this.container = this.attachShadow({
|
|
1137
1151
|
mode: t.shadow
|
|
1138
1152
|
}) : this.container = this, this[H].container = this.container;
|
|
1139
1153
|
for (const h of l) {
|
|
@@ -1145,17 +1159,17 @@ function Pt(e, t, r) {
|
|
|
1145
1159
|
return Object.keys(c);
|
|
1146
1160
|
}
|
|
1147
1161
|
connectedCallback() {
|
|
1148
|
-
this[
|
|
1162
|
+
this[le] = !0, this[Ce]();
|
|
1149
1163
|
}
|
|
1150
1164
|
disconnectedCallback() {
|
|
1151
|
-
this[
|
|
1165
|
+
this[le] = !1, this[G] && r.unmount(this[G]), delete this[G];
|
|
1152
1166
|
}
|
|
1153
1167
|
attributeChangedCallback(h, b, w) {
|
|
1154
1168
|
const y = c[h], k = s[y], D = Se[k];
|
|
1155
1169
|
y in s && D != null && D.parse && (this[H][y] = D.parse(w, this), this[Ce]());
|
|
1156
1170
|
}
|
|
1157
|
-
[(o =
|
|
1158
|
-
this[
|
|
1171
|
+
[(o = le, n = G, i = H, Ce)]() {
|
|
1172
|
+
this[le] && (this[G] ? r.update(this[G], this[H]) : this[G] = r.mount(
|
|
1159
1173
|
this.container,
|
|
1160
1174
|
e,
|
|
1161
1175
|
this[H]
|
|
@@ -1185,20 +1199,6 @@ function Pt(e, t, r) {
|
|
|
1185
1199
|
function _t(e = "") {
|
|
1186
1200
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1187
1201
|
}
|
|
1188
|
-
var We, le = yt;
|
|
1189
|
-
if (process.env.NODE_ENV === "production")
|
|
1190
|
-
We = le.createRoot, le.hydrateRoot;
|
|
1191
|
-
else {
|
|
1192
|
-
var Ge = le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1193
|
-
We = function(e, t) {
|
|
1194
|
-
Ge.usingClientEntryPoint = !0;
|
|
1195
|
-
try {
|
|
1196
|
-
return le.createRoot(e, t);
|
|
1197
|
-
} finally {
|
|
1198
|
-
Ge.usingClientEntryPoint = !1;
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1201
|
-
}
|
|
1202
1202
|
function Nt(e, t, r) {
|
|
1203
1203
|
const o = We(e), n = ot.createElement(t, r);
|
|
1204
1204
|
return o.render(n), {
|
|
@@ -2717,7 +2717,7 @@ let rr = {
|
|
|
2717
2717
|
opacitySection: "opacity"
|
|
2718
2718
|
}),
|
|
2719
2719
|
// Gradient Color Stops
|
|
2720
|
-
d("bg-gradient-to-([trbl]|[tb][rl])", "backgroundImage", ({ 1: e }) => `linear-gradient(to ${
|
|
2720
|
+
d("bg-gradient-to-([trbl]|[tb][rl])", "backgroundImage", ({ 1: e }) => `linear-gradient(to ${Y(e, " ")},var(--tw-gradient-stops))`),
|
|
2721
2721
|
$("from-", {
|
|
2722
2722
|
section: "gradientColorStops",
|
|
2723
2723
|
opacityVariable: !1,
|
|
@@ -2800,8 +2800,8 @@ let rr = {
|
|
|
2800
2800
|
e
|
|
2801
2801
|
];
|
|
2802
2802
|
return {
|
|
2803
|
-
[`border-${
|
|
2804
|
-
[`border-${
|
|
2803
|
+
[`border-${Y(r[0])}-radius`]: t,
|
|
2804
|
+
[`border-${Y(r[1])}-radius`]: t
|
|
2805
2805
|
};
|
|
2806
2806
|
}),
|
|
2807
2807
|
// Border Collapse
|
|
@@ -2854,8 +2854,8 @@ let rr = {
|
|
|
2854
2854
|
return {
|
|
2855
2855
|
"&>:not([hidden])~:not([hidden])": {
|
|
2856
2856
|
[`--tw-divide-${e}-reverse`]: "0",
|
|
2857
|
-
[`border-${
|
|
2858
|
-
[`border-${
|
|
2857
|
+
[`border-${Y(r[0])}Width`]: `calc(${t} * calc(1 - var(--tw-divide-${e}-reverse)))`,
|
|
2858
|
+
[`border-${Y(r[1])}Width`]: `calc(${t} * var(--tw-divide-${e}-reverse))`
|
|
2859
2859
|
}
|
|
2860
2860
|
};
|
|
2861
2861
|
}),
|
|
@@ -3113,7 +3113,7 @@ function se(e) {
|
|
|
3113
3113
|
function Ye(e) {
|
|
3114
3114
|
return (typeof e == "string" ? e : e[1]).replace("col", "column");
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3116
|
+
function Y(e, t = "-") {
|
|
3117
3117
|
let r = [];
|
|
3118
3118
|
for (let o of e)
|
|
3119
3119
|
r.push({
|
|
@@ -3162,8 +3162,8 @@ function X(e, t = "") {
|
|
|
3162
3162
|
y: "tb"
|
|
3163
3163
|
}[r] || r + r;
|
|
3164
3164
|
return n ? {
|
|
3165
|
-
...de(e + "-" +
|
|
3166
|
-
...de(e + "-" +
|
|
3165
|
+
...de(e + "-" + Y(n[0]) + t, o),
|
|
3166
|
+
...de(e + "-" + Y(n[1]) + t, o)
|
|
3167
3167
|
} : de(e + t, o);
|
|
3168
3168
|
};
|
|
3169
3169
|
}
|
|
@@ -4200,8 +4200,8 @@ function g(e, t) {
|
|
|
4200
4200
|
let bt = {
|
|
4201
4201
|
...ge,
|
|
4202
4202
|
colors: ht
|
|
4203
|
-
}, [
|
|
4204
|
-
function
|
|
4203
|
+
}, [Rr, Ar] = bt.fontSize.base, { spacing: q, borderWidth: tt, borderRadius: rt } = bt;
|
|
4204
|
+
function Fr({ strategy: e } = {}) {
|
|
4205
4205
|
let t = {};
|
|
4206
4206
|
return e !== "base" && (t.rules = [
|
|
4207
4207
|
[
|
|
@@ -4259,8 +4259,8 @@ let $e = [
|
|
|
4259
4259
|
"padding-right": q[3],
|
|
4260
4260
|
"padding-bottom": q[2],
|
|
4261
4261
|
"padding-left": q[3],
|
|
4262
|
-
"font-size":
|
|
4263
|
-
"line-height":
|
|
4262
|
+
"font-size": Rr,
|
|
4263
|
+
"line-height": Ar,
|
|
4264
4264
|
"--tw-shadow": "0 0 #0000",
|
|
4265
4265
|
"&:focus": {
|
|
4266
4266
|
outline: "2px solid transparent",
|
|
@@ -4452,7 +4452,7 @@ let $e = [
|
|
|
4452
4452
|
}
|
|
4453
4453
|
}
|
|
4454
4454
|
];
|
|
4455
|
-
function
|
|
4455
|
+
function Er(e) {
|
|
4456
4456
|
switch (e) {
|
|
4457
4457
|
case "%20":
|
|
4458
4458
|
return " ";
|
|
@@ -4467,21 +4467,21 @@ function Fr(e) {
|
|
|
4467
4467
|
}
|
|
4468
4468
|
}
|
|
4469
4469
|
function ce(e) {
|
|
4470
|
-
return "data:image/svg+xml," + encodeURIComponent(e.trim().replace(/\s+/g, " ").replace(/"/g, "'")).replace(/%[\dA-F]{2}/g,
|
|
4470
|
+
return "data:image/svg+xml," + encodeURIComponent(e.trim().replace(/\s+/g, " ").replace(/"/g, "'")).replace(/%[\dA-F]{2}/g, Er);
|
|
4471
4471
|
}
|
|
4472
4472
|
const Wr = ft({
|
|
4473
4473
|
theme: {
|
|
4474
4474
|
extend: {
|
|
4475
4475
|
colors: {
|
|
4476
|
-
primary: "var(--clr-primary,black)",
|
|
4477
|
-
accent: "var(--clr-accent,blue)",
|
|
4478
|
-
label: "var(--clr-label,black)",
|
|
4479
|
-
input: "var(--clr-input,black)",
|
|
4480
|
-
placeholder: "var(--clr-placeholder,#94a3b8)",
|
|
4481
|
-
"category-label": "var(--clr-category-label,black)"
|
|
4476
|
+
primary: "var(--tt-clr-primary,black)",
|
|
4477
|
+
accent: "var(--tt-clr-accent,blue)",
|
|
4478
|
+
label: "var(--tt-clr-label,black)",
|
|
4479
|
+
input: "var(--tt-clr-input,black)",
|
|
4480
|
+
placeholder: "var(--tt-clr-placeholder,#94a3b8)",
|
|
4481
|
+
"category-label": "var(--tt-clr-category-label,black)"
|
|
4482
4482
|
},
|
|
4483
4483
|
fontFamily: {
|
|
4484
|
-
"ff-text": ["var(--ff-text)", "Helvetica", "Arial", "sans-serif"]
|
|
4484
|
+
"ff-text": ["var(--tt-ff-text)", "Helvetica", "Arial", "sans-serif"]
|
|
4485
4485
|
}
|
|
4486
4486
|
}
|
|
4487
4487
|
},
|
|
@@ -4489,13 +4489,13 @@ const Wr = ft({
|
|
|
4489
4489
|
tr(),
|
|
4490
4490
|
$r(),
|
|
4491
4491
|
zr(),
|
|
4492
|
-
|
|
4492
|
+
Fr()
|
|
4493
4493
|
]
|
|
4494
4494
|
}), Or = Dt(Wr), jr = Jt(xt, {
|
|
4495
|
-
props: {
|
|
4495
|
+
props: /* @__PURE__ */ Object.create({
|
|
4496
4496
|
config: "json",
|
|
4497
4497
|
options: "json"
|
|
4498
|
-
},
|
|
4498
|
+
}),
|
|
4499
4499
|
shadow: "open"
|
|
4500
4500
|
});
|
|
4501
4501
|
class Dr extends Or(jr) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TwintagForm } from '@twintag-form/index';
|
|
1
|
+
import { TwintagForm } from '@twintag/twintag-form/index';
|
|
2
2
|
|
|
3
3
|
// Replace your-framework with the name of your framework
|
|
4
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import type { Meta, StoryObj, Decorator } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
import { withActions } from '@storybook/addon-actions/decorator';
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ const meta: Meta<typeof TwintagForm> = {
|
|
|
17
17
|
handles: ['twintag-form-valid', 'twintag-form-invalid'],
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
decorators: [withActions as
|
|
20
|
+
decorators: [withActions as unknown as Decorator],
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export default meta;
|
|
@@ -11,10 +11,10 @@ export const containerStyle = tv({
|
|
|
11
11
|
export const checkboxStyle = tv({
|
|
12
12
|
slots: {
|
|
13
13
|
container: containerStyle({
|
|
14
|
-
className: 'flex
|
|
14
|
+
className: 'flex w-full items-center gap-4',
|
|
15
15
|
}),
|
|
16
16
|
checkbox:
|
|
17
|
-
'flex appearance-none items-center justify-center bg-white outline-none ring-0
|
|
17
|
+
'border-primary focus:border-accent flex appearance-none items-center justify-center border-2 bg-white outline-none ring-0 focus:ring-0',
|
|
18
18
|
},
|
|
19
19
|
variants: {
|
|
20
20
|
variant: {
|
|
@@ -34,23 +34,23 @@ export const checkboxStyle = tv({
|
|
|
34
34
|
export const fileStyle = tv({
|
|
35
35
|
slots: {
|
|
36
36
|
container: containerStyle({
|
|
37
|
-
className: 'w-full
|
|
37
|
+
className: 'block w-full',
|
|
38
38
|
}),
|
|
39
39
|
span: '',
|
|
40
40
|
input:
|
|
41
|
-
'w-full cursor-pointer ring-0 focus:ring-0
|
|
41
|
+
'w-full cursor-pointer border-2 border-transparent ring-0 focus:ring-0',
|
|
42
42
|
},
|
|
43
43
|
variants: {
|
|
44
44
|
variant: {
|
|
45
45
|
alpha: {
|
|
46
46
|
container: 'grid gap-1.5',
|
|
47
47
|
input:
|
|
48
|
-
'flex items-center justify-between gap-4 rounded-md
|
|
48
|
+
'peer-focus:border-accent flex items-center justify-between gap-4 rounded-md border-slate-700/10 px-3 py-2',
|
|
49
49
|
},
|
|
50
50
|
beta: {
|
|
51
51
|
container: 'grid gap-0',
|
|
52
52
|
input:
|
|
53
|
-
'flex items-center justify-between gap-4
|
|
53
|
+
'peer-focus:border-b-accent flex items-center justify-between gap-4 border-b-slate-700/10 py-2',
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
},
|
|
@@ -66,18 +66,18 @@ export const simpleStyle = tv({
|
|
|
66
66
|
}),
|
|
67
67
|
span: '',
|
|
68
68
|
input:
|
|
69
|
-
'
|
|
69
|
+
'placeholder:text-placeholder text-input w-full border-2 border-transparent ring-0 focus:ring-0',
|
|
70
70
|
},
|
|
71
71
|
variants: {
|
|
72
72
|
variant: {
|
|
73
73
|
alpha: {
|
|
74
74
|
container: 'grid gap-1.5',
|
|
75
|
-
input: 'rounded-md border-slate-700/10
|
|
75
|
+
input: 'focus:border-accent rounded-md border-slate-700/10',
|
|
76
76
|
},
|
|
77
77
|
beta: {
|
|
78
78
|
container: 'grid gap-0',
|
|
79
79
|
input:
|
|
80
|
-
'
|
|
80
|
+
'focus:border-b-accent border-b-slate-700/10 px-0 focus:border-transparent',
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
},
|
|
@@ -100,16 +100,16 @@ export const toggleStyle = tv({
|
|
|
100
100
|
alpha: {
|
|
101
101
|
container: 'flex justify-between',
|
|
102
102
|
input:
|
|
103
|
-
'h-6 w-9 rounded-full
|
|
103
|
+
'bg-primary focus:ring-accent h-6 w-9 rounded-full border border-black ring-2 focus:border-transparent data-[state=checked]:bg-white',
|
|
104
104
|
thumb:
|
|
105
|
-
'h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4
|
|
105
|
+
'data-[state=checked]:bg-primary h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4',
|
|
106
106
|
},
|
|
107
107
|
beta: {
|
|
108
108
|
container: 'flex justify-between',
|
|
109
109
|
input:
|
|
110
|
-
'h-6 w-9 rounded-full
|
|
110
|
+
'bg-primary focus:ring-accent h-6 w-9 rounded-full border border-black ring-2 focus:border-transparent data-[state=checked]:bg-white',
|
|
111
111
|
thumb:
|
|
112
|
-
'h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4
|
|
112
|
+
'data-[state=checked]:bg-primary h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4',
|
|
113
113
|
},
|
|
114
114
|
},
|
|
115
115
|
},
|
|
@@ -119,11 +119,11 @@ export const toggleStyle = tv({
|
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
export const submitStyle = tv({
|
|
122
|
-
base: 'w-max max-w-full
|
|
122
|
+
base: 'mt-2 w-max max-w-full',
|
|
123
123
|
variants: {
|
|
124
124
|
variant: {
|
|
125
|
-
alpha: 'bg-primary
|
|
126
|
-
beta: 'bg-primary
|
|
125
|
+
alpha: 'bg-primary rounded-md px-4 py-2 text-white',
|
|
126
|
+
beta: 'bg-primary px-4 py-2 text-white',
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
defaultVariants: {
|
|
@@ -5,7 +5,7 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
5
5
|
import { CheckIcon } from '@heroicons/react/24/outline';
|
|
6
6
|
import * as RdxCheckbox from '@radix-ui/react-checkbox';
|
|
7
7
|
|
|
8
|
-
import { Label } from '@twintag-form/components';
|
|
8
|
+
import { Label } from '@twintag/twintag-form/components';
|
|
9
9
|
import { type CommonProps } from './__props';
|
|
10
10
|
import { checkboxStyle } from './__styles';
|
|
11
11
|
|