@shmidko61/lc-ui-kit 0.0.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/README.md +38 -0
- package/dist/accordion/accordion-context.d.ts +3 -0
- package/dist/accordion/accordion-item.d.ts +48 -0
- package/dist/accordion/accordion-root.d.ts +5 -0
- package/dist/accordion/accordion.d.ts +8 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +206 -0
- package/dist/arrow-CS6d64Y4.cjs +1 -0
- package/dist/arrow-DBc2opRL.js +5 -0
- package/dist/box/box.d.ts +7 -0
- package/dist/box/box.helpers.d.ts +11 -0
- package/dist/box/box.types.d.ts +62 -0
- package/dist/box.cjs +1 -0
- package/dist/box.js +342 -0
- package/dist/button/button.d.ts +22 -0
- package/dist/button/button.helpers.d.ts +119 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +438 -0
- package/dist/design-tokens/color.tokens.d.ts +6 -0
- package/dist/design-tokens/typography.tokens.d.ts +9 -0
- package/dist/drop-down-CdIuWbLC.cjs +1 -0
- package/dist/drop-down-DH2_3qXq.js +5 -0
- package/dist/eye-open-5zYaeyLp.cjs +1 -0
- package/dist/eye-open-CoTSj5cT.js +5 -0
- package/dist/flex/flex.d.ts +5 -0
- package/dist/flex/flex.helpers.d.ts +9 -0
- package/dist/flex/flex.types.d.ts +12 -0
- package/dist/flex.cjs +1 -0
- package/dist/flex.js +128 -0
- package/dist/grid/grid.d.ts +25 -0
- package/dist/grid/grid.helpers.d.ts +13 -0
- package/dist/grid/grid.types.d.ts +49 -0
- package/dist/grid.cjs +1 -0
- package/dist/grid.js +103 -0
- package/dist/icons/icons.d.ts +30 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.js +38 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +97 -0
- package/dist/input/input.d.ts +49 -0
- package/dist/input/input.helpers.d.ts +9 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +85 -0
- package/dist/media-card/components/media-card-pick-indicator.d.ts +6 -0
- package/dist/media-card/components/media-card-preview.d.ts +7 -0
- package/dist/media-card/components/media-card-upload-footer.d.ts +7 -0
- package/dist/media-card/components/media-card-upload.d.ts +5 -0
- package/dist/media-card/media-card-pick.d.ts +5 -0
- package/dist/media-card/media-card.d.ts +4 -0
- package/dist/media-card/media-card.types.d.ts +10 -0
- package/dist/media-card.cjs +1 -0
- package/dist/media-card.js +104 -0
- package/dist/media-gallery/media-gallery.d.ts +12 -0
- package/dist/media-gallery/media-gallery.helpers.d.ts +27 -0
- package/dist/media-gallery/media-gallery.types.d.ts +59 -0
- package/dist/media-gallery.cjs +1 -0
- package/dist/media-gallery.js +100 -0
- package/dist/media-picture-BN4saEVT.js +6 -0
- package/dist/media-picture-BmERSmsd.cjs +1 -0
- package/dist/modal/modal.d.ts +50 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.js +143 -0
- package/dist/pagination/pagination.d.ts +22 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.js +155 -0
- package/dist/picture/picture.d.ts +12 -0
- package/dist/picture/picture.helpers.d.ts +9 -0
- package/dist/picture/picture.types.d.ts +56 -0
- package/dist/picture.cjs +1 -0
- package/dist/picture.js +55 -0
- package/dist/responsive-style.config-B2m9jVlX.cjs +1 -0
- package/dist/responsive-style.config-DFuATrIM.js +19 -0
- package/dist/responsive-style.utils-BdyoDkKg.cjs +1 -0
- package/dist/responsive-style.utils-D10sC561.js +25 -0
- package/dist/select/select.d.ts +55 -0
- package/dist/select/select.helpers.d.ts +14 -0
- package/dist/select/select.types.d.ts +12 -0
- package/dist/select.cjs +1 -0
- package/dist/select.js +179 -0
- package/dist/shared/lib/cn.d.ts +2 -0
- package/dist/shared/responsive-style/responsive-style.config.d.ts +20 -0
- package/dist/shared/responsive-style/responsive-style.types.d.ts +52 -0
- package/dist/shared/responsive-style/responsive-style.utils.d.ts +17 -0
- package/dist/status-badge/status-badge.d.ts +11 -0
- package/dist/status-badge.cjs +1 -0
- package/dist/status-badge.js +39 -0
- package/dist/styles.css +1 -0
- package/dist/switch/switch.d.ts +34 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +127 -0
- package/dist/table/data-table.d.ts +3 -0
- package/dist/table/table-container.d.ts +8 -0
- package/dist/table/table-primitives.d.ts +40 -0
- package/dist/table/table-status.d.ts +12 -0
- package/dist/table/table.d.ts +8 -0
- package/dist/table/table.types.d.ts +48 -0
- package/dist/table-container-BsE-uIE1.js +242 -0
- package/dist/table-container-DqqqkChm.cjs +1 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +16 -0
- package/dist/telephone-DVftjRG9.cjs +1 -0
- package/dist/telephone-DvXakgBQ.js +26 -0
- package/dist/time-clock-DOwPzcx7.cjs +1 -0
- package/dist/time-clock-DjqcZ8tI.js +5 -0
- package/dist/types/flex.types.d.ts +25 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/interaction.types.d.ts +8 -0
- package/dist/types/layout.types.d.ts +52 -0
- package/dist/types/shared.types.d.ts +8 -0
- package/dist/types/spacing.types.d.ts +123 -0
- package/dist/types/typography.types.d.ts +75 -0
- package/dist/types/visual.types.d.ts +82 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +1 -0
- package/dist/typography/typography.d.ts +39 -0
- package/dist/typography/typography.helpers.d.ts +237 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +469 -0
- package/dist/ui-kit-provider/ui-kit-provider.d.ts +53 -0
- package/dist/ui-kit-provider-C6Mk5g_7.js +167 -0
- package/dist/ui-kit-provider-raEFsUm0.cjs +1 -0
- package/dist/ui-kit-provider.cjs +1 -0
- package/dist/ui-kit-provider.js +8 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/x-mark-DId-ylR6.cjs +1 -0
- package/dist/x-mark-WU1eT82T.js +5 -0
- package/package.json +219 -0
package/dist/button.js
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import { jsx as P, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
+
import { Box as q } from "./box.js";
|
|
3
|
+
import { c as at } from "./responsive-style.config-DFuATrIM.js";
|
|
4
|
+
import { cva as it } from "class-variance-authority";
|
|
5
|
+
import { n as p } from "./responsive-style.utils-D10sC561.js";
|
|
6
|
+
const lt = {
|
|
7
|
+
default: "bg-[var(--color-primary-accent)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-primary-accent)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-primary-accent)_80%,#000)]",
|
|
8
|
+
secondary: "bg-[var(--color-background-subtle)] text-[var(--color-text-primary)] hover:bg-[color-mix(in_srgb,var(--color-background-subtle)_90%,#000)] active:bg-[color-mix(in_srgb,var(--color-background-subtle)_80%,#fff)]",
|
|
9
|
+
destructive: "bg-[var(--color-secondary-accent-2)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-secondary-accent-2)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-secondary-accent-2)_80%,#000)]",
|
|
10
|
+
success: "bg-[var(--color-secondary-accent-1)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-secondary-accent-1)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-secondary-accent-1)_80%,#000)]",
|
|
11
|
+
dark: "bg-[var(--color-text-primary)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-text-primary)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-text-primary)_80%,#000)]",
|
|
12
|
+
transparent: "bg-transparent text-[var(--color-text-primary)] hover:bg-transparent active:bg-transparent"
|
|
13
|
+
}, st = {
|
|
14
|
+
sm: "text-[13px] font-medium leading-[120%] [&_svg]:size-4",
|
|
15
|
+
md: "text-[15px] font-medium leading-[140%] [&_svg]:size-5",
|
|
16
|
+
lg: "text-[18px] font-medium leading-[140%] [&_svg]:size-5"
|
|
17
|
+
}, E = {
|
|
18
|
+
sm: "6px",
|
|
19
|
+
md: "8px",
|
|
20
|
+
lg: "12px"
|
|
21
|
+
}, G = "box-border shrink-0 items-center overflow-hidden tracking-normal transition-colors duration-150 [font-family:var(--font-family)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", St = it(
|
|
22
|
+
[G, "[justify-content:var(--button-justify-content,center)]"].join(" "),
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
variant: lt,
|
|
26
|
+
size: st,
|
|
27
|
+
fullWidth: {
|
|
28
|
+
true: "w-full"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default",
|
|
33
|
+
size: "md"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
), J = {
|
|
37
|
+
sm: {
|
|
38
|
+
minWidth: 32,
|
|
39
|
+
p: { px: 12, py: 8 }
|
|
40
|
+
},
|
|
41
|
+
md: {
|
|
42
|
+
p: { px: 16, py: 10 }
|
|
43
|
+
},
|
|
44
|
+
lg: {
|
|
45
|
+
p: { px: 32, py: 16 }
|
|
46
|
+
}
|
|
47
|
+
}, ct = {
|
|
48
|
+
base: "[justify-content:var(--button-justify-content)]",
|
|
49
|
+
md: "md:[justify-content:var(--md-button-justify-content)]",
|
|
50
|
+
lg: "lg:[justify-content:var(--lg-button-justify-content)]",
|
|
51
|
+
xl: "xl:[justify-content:var(--xl-button-justify-content)]"
|
|
52
|
+
}, gt = {
|
|
53
|
+
default: {
|
|
54
|
+
activeBg: "color-mix(in srgb, var(--color-primary-accent) 80%, #000)",
|
|
55
|
+
bg: "--color-primary-accent",
|
|
56
|
+
color: "--color-background-default",
|
|
57
|
+
hoverBg: "color-mix(in srgb, var(--color-primary-accent) 80%, #fff)"
|
|
58
|
+
},
|
|
59
|
+
secondary: {
|
|
60
|
+
activeBg: "color-mix(in srgb, var(--color-background-subtle) 80%, #fff)",
|
|
61
|
+
bg: "--color-background-subtle",
|
|
62
|
+
color: "--color-text-primary",
|
|
63
|
+
hoverBg: "color-mix(in srgb, var(--color-background-subtle) 90%, #000)"
|
|
64
|
+
},
|
|
65
|
+
destructive: {
|
|
66
|
+
activeBg: "color-mix(in srgb, var(--color-secondary-accent-2) 80%, #000)",
|
|
67
|
+
bg: "--color-secondary-accent-2",
|
|
68
|
+
color: "--color-background-default",
|
|
69
|
+
hoverBg: "color-mix(in srgb, var(--color-secondary-accent-2) 80%, #fff)"
|
|
70
|
+
},
|
|
71
|
+
success: {
|
|
72
|
+
activeBg: "color-mix(in srgb, var(--color-secondary-accent-1) 80%, #000)",
|
|
73
|
+
bg: "--color-secondary-accent-1",
|
|
74
|
+
color: "--color-background-default",
|
|
75
|
+
hoverBg: "color-mix(in srgb, var(--color-secondary-accent-1) 80%, #fff)"
|
|
76
|
+
},
|
|
77
|
+
dark: {
|
|
78
|
+
activeBg: "color-mix(in srgb, var(--color-text-primary) 80%, #000)",
|
|
79
|
+
bg: "--color-text-primary",
|
|
80
|
+
color: "--color-background-default",
|
|
81
|
+
hoverBg: "color-mix(in srgb, var(--color-text-primary) 80%, #fff)"
|
|
82
|
+
},
|
|
83
|
+
transparent: {
|
|
84
|
+
activeBg: "transparent",
|
|
85
|
+
bg: "transparent",
|
|
86
|
+
color: "--color-text-primary",
|
|
87
|
+
hoverBg: "transparent"
|
|
88
|
+
}
|
|
89
|
+
}, ut = {
|
|
90
|
+
sm: "[&_svg]:size-4",
|
|
91
|
+
md: "[&_svg]:size-5",
|
|
92
|
+
lg: "[&_svg]:size-5"
|
|
93
|
+
}, bt = {
|
|
94
|
+
sm: {
|
|
95
|
+
fontSize: "13px",
|
|
96
|
+
fontWeight: 500,
|
|
97
|
+
lineHeight: "120%"
|
|
98
|
+
},
|
|
99
|
+
md: {
|
|
100
|
+
fontSize: "15px",
|
|
101
|
+
fontWeight: 500,
|
|
102
|
+
lineHeight: "140%"
|
|
103
|
+
},
|
|
104
|
+
lg: {
|
|
105
|
+
fontSize: "18px",
|
|
106
|
+
fontWeight: 500,
|
|
107
|
+
lineHeight: "140%"
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
function vt({
|
|
111
|
+
alignContent: o,
|
|
112
|
+
md: t,
|
|
113
|
+
lg: a,
|
|
114
|
+
xl: r
|
|
115
|
+
}) {
|
|
116
|
+
const e = [], n = {};
|
|
117
|
+
return f(o, e, n, "base"), f(t?.alignContent, e, n, "md", "md-"), f(a?.alignContent, e, n, "lg", "lg-"), f(r?.alignContent, e, n, "xl", "xl-"), {
|
|
118
|
+
className: e.join(" "),
|
|
119
|
+
style: Object.keys(n).length ? n : void 0
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function dt({ variant: o, md: t, lg: a, xl: r }, e = {}) {
|
|
123
|
+
const n = [], i = {};
|
|
124
|
+
return h(o, e, n, i), h(t?.variant, e.md, n, i, "md"), h(a?.variant, e.lg, n, i, "lg"), h(r?.variant, e.xl, n, i, "xl"), {
|
|
125
|
+
className: n.join(" "),
|
|
126
|
+
style: Object.keys(i).length ? i : void 0
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function ft({
|
|
130
|
+
activeBg: o,
|
|
131
|
+
bg: t,
|
|
132
|
+
color: a,
|
|
133
|
+
hoverBg: r,
|
|
134
|
+
md: e,
|
|
135
|
+
lg: n,
|
|
136
|
+
xl: i
|
|
137
|
+
}) {
|
|
138
|
+
const l = [], s = {};
|
|
139
|
+
return x({ activeBg: o, bg: t, color: a, hoverBg: r }, l, s), x(e, l, s, "md"), x(n, l, s, "lg"), x(i, l, s, "xl"), {
|
|
140
|
+
className: l.join(" "),
|
|
141
|
+
style: Object.keys(s).length ? s : void 0
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function mt({
|
|
145
|
+
fontSize: o,
|
|
146
|
+
fontWeight: t,
|
|
147
|
+
lineHeight: a,
|
|
148
|
+
md: r,
|
|
149
|
+
lg: e,
|
|
150
|
+
xl: n
|
|
151
|
+
}) {
|
|
152
|
+
const i = [], l = {};
|
|
153
|
+
return y({ fontSize: o, fontWeight: t, lineHeight: a }, i, l), y(r, i, l, "md"), y(e, i, l, "lg"), y(n, i, l, "xl"), {
|
|
154
|
+
className: i.join(" "),
|
|
155
|
+
style: Object.keys(l).length ? l : void 0
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function ht({
|
|
159
|
+
size: o = "md",
|
|
160
|
+
md: t,
|
|
161
|
+
lg: a,
|
|
162
|
+
xl: r
|
|
163
|
+
}) {
|
|
164
|
+
const e = [
|
|
165
|
+
ut[o],
|
|
166
|
+
B.fontSize,
|
|
167
|
+
B.fontWeight,
|
|
168
|
+
B.lineHeight
|
|
169
|
+
], n = {};
|
|
170
|
+
return m(o, e, n), m(t?.size, e, n, "md"), m(a?.size, e, n, "lg"), m(r?.size, e, n, "xl"), {
|
|
171
|
+
className: e.join(" "),
|
|
172
|
+
style: n
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function w(o) {
|
|
176
|
+
if (!o)
|
|
177
|
+
return;
|
|
178
|
+
const t = { ...o };
|
|
179
|
+
return (o.size || o.border) && (t.border = {
|
|
180
|
+
radius: o.size ? E[o.size] : void 0,
|
|
181
|
+
...o.border
|
|
182
|
+
}), o.size && o.p === void 0 && (t.p = J[o.size].p), delete t.activeBg, delete t.alignContent, delete t.bg, delete t.color, delete t.fontSize, delete t.fontWeight, delete t.hoverBg, delete t.lineHeight, delete t.size, delete t.variant, t;
|
|
183
|
+
}
|
|
184
|
+
function f(o, t, a, r, e = "") {
|
|
185
|
+
if (!o)
|
|
186
|
+
return;
|
|
187
|
+
const n = `${e}button-justify-content`;
|
|
188
|
+
a[`--${n}`] = yt(o), t.push(ct[r]);
|
|
189
|
+
}
|
|
190
|
+
function m(o, t, a, r) {
|
|
191
|
+
if (!o)
|
|
192
|
+
return;
|
|
193
|
+
const { fontSize: e, fontWeight: n, lineHeight: i } = bt[o];
|
|
194
|
+
if (!r) {
|
|
195
|
+
a["--button-font-size"] = e, a["--button-font-weight"] = n, a["--button-line-height"] = i;
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
a[`--${r}-button-font-size`] = e, a[`--${r}-button-font-weight`] = n, a[`--${r}-button-line-height`] = i, t.push(
|
|
199
|
+
xt[r][o],
|
|
200
|
+
z[r].fontSize,
|
|
201
|
+
z[r].fontWeight,
|
|
202
|
+
z[r].lineHeight
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
function h(o, t, a, r, e) {
|
|
206
|
+
if (!o)
|
|
207
|
+
return;
|
|
208
|
+
const n = e ? L[e] : K, i = e ? `${e}-` : "", l = gt[o];
|
|
209
|
+
t?.bg === void 0 && (r[`--${i}button-bg`] = c(l.bg), a.push(n.bg)), t?.color === void 0 && (r[`--${i}button-color`] = c(l.color), a.push(n.color)), t?.bg === void 0 && t?.hoverBg === void 0 && (r[`--${i}button-hover-bg`] = c(l.hoverBg), a.push(n.hoverBg)), t?.bg === void 0 && t?.hoverBg === void 0 && t?.activeBg === void 0 && (r[`--${i}button-active-bg`] = c(l.activeBg), a.push(n.activeBg));
|
|
210
|
+
}
|
|
211
|
+
function x(o, t, a, r) {
|
|
212
|
+
if (!o)
|
|
213
|
+
return;
|
|
214
|
+
const { activeBg: e, bg: n, color: i, hoverBg: l } = o, s = r ? L[r] : K, v = r ? `${r}-` : "";
|
|
215
|
+
n !== void 0 && (a[`--${v}button-bg`] = c(n), t.push(s.bg, s.hoverBg, s.activeBg)), l !== void 0 && (a[`--${v}button-hover-bg`] = c(l), t.push(s.hoverBg)), e !== void 0 && (a[`--${v}button-active-bg`] = c(e), t.push(s.activeBg)), i !== void 0 && (a[`--${v}button-color`] = c(i), t.push(s.color));
|
|
216
|
+
}
|
|
217
|
+
function y(o, t, a, r) {
|
|
218
|
+
if (!o)
|
|
219
|
+
return;
|
|
220
|
+
const { fontSize: e, fontWeight: n, lineHeight: i } = o, l = r ? z[r] : B, s = r ? `${r}-` : "";
|
|
221
|
+
e !== void 0 && (a[`--${s}button-font-size`] = p(e), t.push(l.fontSize)), n !== void 0 && (a[`--${s}button-font-weight`] = p(n), t.push(l.fontWeight)), i !== void 0 && (a[`--${s}button-line-height`] = p(i), t.push(l.lineHeight));
|
|
222
|
+
}
|
|
223
|
+
const K = {
|
|
224
|
+
activeBg: "active:bg-[var(--button-active-bg,var(--button-hover-bg,var(--button-bg)))]",
|
|
225
|
+
bg: "bg-[var(--button-bg)]",
|
|
226
|
+
color: "text-[var(--button-color)]",
|
|
227
|
+
hoverBg: "hover:bg-[var(--button-hover-bg,var(--button-bg))]"
|
|
228
|
+
}, B = {
|
|
229
|
+
fontSize: "text-[length:var(--button-font-size)]",
|
|
230
|
+
fontWeight: "font-[var(--button-font-weight)]",
|
|
231
|
+
lineHeight: "leading-[var(--button-line-height)]"
|
|
232
|
+
}, L = {
|
|
233
|
+
md: {
|
|
234
|
+
activeBg: "md:active:bg-[var(--md-button-active-bg,var(--md-button-hover-bg,var(--md-button-bg)))]",
|
|
235
|
+
bg: "md:bg-[var(--md-button-bg)]",
|
|
236
|
+
color: "md:text-[var(--md-button-color)]",
|
|
237
|
+
hoverBg: "md:hover:bg-[var(--md-button-hover-bg,var(--md-button-bg))]"
|
|
238
|
+
},
|
|
239
|
+
lg: {
|
|
240
|
+
activeBg: "lg:active:bg-[var(--lg-button-active-bg,var(--lg-button-hover-bg,var(--lg-button-bg)))]",
|
|
241
|
+
bg: "lg:bg-[var(--lg-button-bg)]",
|
|
242
|
+
color: "lg:text-[var(--lg-button-color)]",
|
|
243
|
+
hoverBg: "lg:hover:bg-[var(--lg-button-hover-bg,var(--lg-button-bg))]"
|
|
244
|
+
},
|
|
245
|
+
xl: {
|
|
246
|
+
activeBg: "xl:active:bg-[var(--xl-button-active-bg,var(--xl-button-hover-bg,var(--xl-button-bg)))]",
|
|
247
|
+
bg: "xl:bg-[var(--xl-button-bg)]",
|
|
248
|
+
color: "xl:text-[var(--xl-button-color)]",
|
|
249
|
+
hoverBg: "xl:hover:bg-[var(--xl-button-hover-bg,var(--xl-button-bg))]"
|
|
250
|
+
}
|
|
251
|
+
}, z = {
|
|
252
|
+
md: {
|
|
253
|
+
fontSize: "md:text-[length:var(--md-button-font-size)]",
|
|
254
|
+
fontWeight: "md:font-[var(--md-button-font-weight)]",
|
|
255
|
+
lineHeight: "md:leading-[var(--md-button-line-height)]"
|
|
256
|
+
},
|
|
257
|
+
lg: {
|
|
258
|
+
fontSize: "lg:text-[length:var(--lg-button-font-size)]",
|
|
259
|
+
fontWeight: "lg:font-[var(--lg-button-font-weight)]",
|
|
260
|
+
lineHeight: "lg:leading-[var(--lg-button-line-height)]"
|
|
261
|
+
},
|
|
262
|
+
xl: {
|
|
263
|
+
fontSize: "xl:text-[length:var(--xl-button-font-size)]",
|
|
264
|
+
fontWeight: "xl:font-[var(--xl-button-font-weight)]",
|
|
265
|
+
lineHeight: "xl:leading-[var(--xl-button-line-height)]"
|
|
266
|
+
}
|
|
267
|
+
}, xt = {
|
|
268
|
+
md: {
|
|
269
|
+
sm: "md:[&_svg]:size-4",
|
|
270
|
+
md: "md:[&_svg]:size-5",
|
|
271
|
+
lg: "md:[&_svg]:size-5"
|
|
272
|
+
},
|
|
273
|
+
lg: {
|
|
274
|
+
sm: "lg:[&_svg]:size-4",
|
|
275
|
+
md: "lg:[&_svg]:size-5",
|
|
276
|
+
lg: "lg:[&_svg]:size-5"
|
|
277
|
+
},
|
|
278
|
+
xl: {
|
|
279
|
+
sm: "xl:[&_svg]:size-4",
|
|
280
|
+
md: "xl:[&_svg]:size-5",
|
|
281
|
+
lg: "xl:[&_svg]:size-5"
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
function c(o) {
|
|
285
|
+
return String(p(o));
|
|
286
|
+
}
|
|
287
|
+
function yt(o) {
|
|
288
|
+
return {
|
|
289
|
+
center: "center",
|
|
290
|
+
end: "flex-end",
|
|
291
|
+
start: "flex-start"
|
|
292
|
+
}[o];
|
|
293
|
+
}
|
|
294
|
+
function jt({
|
|
295
|
+
alignContent: o,
|
|
296
|
+
children: t,
|
|
297
|
+
className: a,
|
|
298
|
+
disabled: r,
|
|
299
|
+
display: e,
|
|
300
|
+
border: n,
|
|
301
|
+
bg: i,
|
|
302
|
+
color: l,
|
|
303
|
+
cursor: s,
|
|
304
|
+
fullWidth: v,
|
|
305
|
+
href: _,
|
|
306
|
+
hoverBg: V,
|
|
307
|
+
activeBg: A,
|
|
308
|
+
fontSize: M,
|
|
309
|
+
fontWeight: Q,
|
|
310
|
+
isLoading: U = !1,
|
|
311
|
+
lineHeight: X,
|
|
312
|
+
minHeight: Y,
|
|
313
|
+
minWidth: Z,
|
|
314
|
+
md: g,
|
|
315
|
+
lg: u,
|
|
316
|
+
xl: b,
|
|
317
|
+
p: O,
|
|
318
|
+
position: tt,
|
|
319
|
+
size: ot,
|
|
320
|
+
style: T,
|
|
321
|
+
variant: nt,
|
|
322
|
+
width: et,
|
|
323
|
+
...C
|
|
324
|
+
}) {
|
|
325
|
+
const d = r || U, N = ot ?? "md", S = ht({
|
|
326
|
+
size: N,
|
|
327
|
+
md: g,
|
|
328
|
+
lg: u,
|
|
329
|
+
xl: b
|
|
330
|
+
}), j = vt({
|
|
331
|
+
alignContent: o,
|
|
332
|
+
md: g,
|
|
333
|
+
lg: u,
|
|
334
|
+
xl: b
|
|
335
|
+
}), $ = dt(
|
|
336
|
+
{
|
|
337
|
+
variant: nt ?? "default",
|
|
338
|
+
md: g,
|
|
339
|
+
lg: u,
|
|
340
|
+
xl: b
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
activeBg: A,
|
|
344
|
+
bg: i,
|
|
345
|
+
color: l,
|
|
346
|
+
hoverBg: V,
|
|
347
|
+
md: g,
|
|
348
|
+
lg: u,
|
|
349
|
+
xl: b
|
|
350
|
+
}
|
|
351
|
+
), W = ft({
|
|
352
|
+
activeBg: A,
|
|
353
|
+
bg: i,
|
|
354
|
+
color: l,
|
|
355
|
+
hoverBg: V,
|
|
356
|
+
md: g,
|
|
357
|
+
lg: u,
|
|
358
|
+
xl: b
|
|
359
|
+
}), H = mt({
|
|
360
|
+
fontSize: M,
|
|
361
|
+
fontWeight: Q,
|
|
362
|
+
lineHeight: X,
|
|
363
|
+
md: g,
|
|
364
|
+
lg: u,
|
|
365
|
+
xl: b
|
|
366
|
+
}), I = {
|
|
367
|
+
...C,
|
|
368
|
+
border: {
|
|
369
|
+
radius: E[N],
|
|
370
|
+
style: "none",
|
|
371
|
+
width: "0",
|
|
372
|
+
...n
|
|
373
|
+
},
|
|
374
|
+
cursor: d ? "not-allowed" : s ?? "pointer",
|
|
375
|
+
display: e ?? "inline-flex",
|
|
376
|
+
minHeight: Y,
|
|
377
|
+
minWidth: Z,
|
|
378
|
+
md: w(g),
|
|
379
|
+
lg: w(u),
|
|
380
|
+
xl: w(b),
|
|
381
|
+
p: O ?? J[N].p,
|
|
382
|
+
position: tt ?? { type: "relative" },
|
|
383
|
+
width: et ?? (v ? "100%" : void 0)
|
|
384
|
+
}, R = at(
|
|
385
|
+
G,
|
|
386
|
+
S.className,
|
|
387
|
+
_ && "no-underline",
|
|
388
|
+
j.className,
|
|
389
|
+
$.className,
|
|
390
|
+
W.className,
|
|
391
|
+
H.className,
|
|
392
|
+
a
|
|
393
|
+
), k = S.style || j.style || $.style || W.style || H.style || T ? {
|
|
394
|
+
...S.style,
|
|
395
|
+
...j.style,
|
|
396
|
+
...$.style,
|
|
397
|
+
...W.style,
|
|
398
|
+
...H.style,
|
|
399
|
+
...T
|
|
400
|
+
} : void 0, D = /* @__PURE__ */ P(rt, { children: t });
|
|
401
|
+
if (_) {
|
|
402
|
+
const F = C;
|
|
403
|
+
return /* @__PURE__ */ P(
|
|
404
|
+
q,
|
|
405
|
+
{
|
|
406
|
+
...F,
|
|
407
|
+
...I,
|
|
408
|
+
"aria-disabled": d || void 0,
|
|
409
|
+
as: "a",
|
|
410
|
+
className: R,
|
|
411
|
+
href: d ? void 0 : _,
|
|
412
|
+
style: k,
|
|
413
|
+
tabIndex: d ? -1 : F.tabIndex,
|
|
414
|
+
children: D
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
return /* @__PURE__ */ P(
|
|
419
|
+
q,
|
|
420
|
+
{
|
|
421
|
+
...C,
|
|
422
|
+
...I,
|
|
423
|
+
as: "button",
|
|
424
|
+
className: R,
|
|
425
|
+
disabled: d,
|
|
426
|
+
style: k,
|
|
427
|
+
children: D
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
export {
|
|
432
|
+
jt as Button,
|
|
433
|
+
E as buttonSizeBorderRadius,
|
|
434
|
+
J as buttonSizeBoxProps,
|
|
435
|
+
st as buttonSizeClassNames,
|
|
436
|
+
lt as buttonVariantClassNames,
|
|
437
|
+
St as buttonVariants
|
|
438
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Designer-approved color variables only.
|
|
3
|
+
* Do not add semantic aliases, derived state tokens, shadcn/Tailwind variables,
|
|
4
|
+
* or component-local variables here unless they are added to the source design tokens first.
|
|
5
|
+
*/
|
|
6
|
+
export declare const uiKitColorTokens: readonly ["--color-text-secondary", "--color-text-primary", "--color-primary-accent", "--color-background-subtle", "--color-background-default", "--color-background-inverted", "--color-background-muted", "--color-secondary-accent-1", "--color-secondary-accent-2", "--color-secondary-accent-3"];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography variables supported by responsive style props.
|
|
3
|
+
*
|
|
4
|
+
* Values can come from design tokens or from runtime/SSR props, so the token
|
|
5
|
+
* type intentionally describes CSS variable names, not a fixed value scale.
|
|
6
|
+
*/
|
|
7
|
+
export declare const uiKitTypographyTokens: readonly ["--typo-fs-h1-sm", "--typo-fw-h1-sm", "--typo-lh-h1-sm", "--typo-fs-h1-md", "--typo-fw-h1-md", "--typo-lh-h1-md", "--typo-fs-h1-lg", "--typo-fw-h1-lg", "--typo-lh-h1-lg", "--typo-fs-h2-md", "--typo-fw-h2-md", "--typo-lh-h2-md", "--typo-fs-h2-lg", "--typo-fw-h2-lg", "--typo-lh-h2-lg", "--typo-fs-h3-lg", "--typo-fw-h3-lg", "--typo-lh-h3-lg", "--typo-fs-h3-md", "--typo-fw-h3-md", "--typo-lh-h3-md", "--typo-fs-h4-lg", "--typo-fw-h4-lg", "--typo-lh-h4-lg", "--typo-fs-h4-md", "--typo-fw-h4-md", "--typo-lh-h4-md", "--typo-fs-b1-lg", "--typo-fw-b1-lg", "--typo-lh-b1-lg", "--typo-fs-b1-md", "--typo-fw-b1-md", "--typo-lh-b1-md", "--typo-fs-b2-lg", "--typo-fw-b2-lg", "--typo-lh-b2-lg", "--typo-fs-b2-md", "--typo-fw-b2-md", "--typo-lh-b2-md", "--typo-fs-b3-lg", "--typo-fw-b3-lg", "--typo-lh-b3-lg", "--typo-fs-b3-md", "--typo-fw-b3-md", "--typo-lh-b3-md", "--typo-fs-caption-lg", "--typo-fw-caption-lg", "--typo-lh-caption-lg"];
|
|
8
|
+
export type UiKitTypographyToken = (typeof uiKitTypographyTokens)[number];
|
|
9
|
+
export type UiKitTypography = Partial<Record<UiKitTypographyToken, string | number>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react");function i(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const r=i(c),s=e=>r.createElement("svg",{width:14,height:8,viewBox:"0 0 14 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M0.75 0.75L6.75 6.75L12.75 0.75",stroke:"#152237",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));exports.SvgDropDown=s;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const o = (t) => /* @__PURE__ */ e.createElement("svg", { width: 14, height: 8, viewBox: "0 0 14 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M0.75 0.75L6.75 6.75L12.75 0.75", stroke: "#152237", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3
|
+
export {
|
|
4
|
+
o as S
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react");function r(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(n,l,c.get?c:{enumerable:!0,get:()=>e[l]})}}return n.default=e,Object.freeze(n)}const t=r(i),a=e=>t.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("g",{clipPath:"url(#clip0_41_594)"},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 6.25C7.92893 6.25 6.25 7.92893 6.25 10C6.25 12.0711 7.92893 13.75 10 13.75C12.0711 13.75 13.75 12.0711 13.75 10C13.75 7.92893 12.0711 6.25 10 6.25ZM7.5 10C7.5 8.61925 8.61926 7.5 10 7.5C11.3807 7.5 12.5 8.61925 12.5 10C12.5 11.3807 11.3807 12.5 10 12.5C8.61926 12.5 7.5 11.3807 7.5 10Z",fill:"#152237"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99986 3.125C5.83467 3.125 2.24769 5.59694 0.615747 9.15292C0.36897 9.69067 0.36897 10.3093 0.615747 10.8471C2.24769 14.4031 5.83467 16.875 9.99986 16.875C14.165 16.875 17.752 14.4031 19.3839 10.8471C19.6308 10.3093 19.6308 9.69067 19.3839 9.15292C17.752 5.59694 14.165 3.125 9.99986 3.125ZM1.75182 9.67425C3.18809 6.54468 6.34232 4.375 9.99986 4.375C13.6574 4.375 16.8116 6.54468 18.2479 9.67425C18.3428 9.881 18.3428 10.119 18.2479 10.3257C16.8116 13.4553 13.6574 15.625 9.99986 15.625C6.34232 15.625 3.18809 13.4553 1.75182 10.3257C1.65695 10.119 1.65694 9.881 1.75182 9.67425Z",fill:"#152237"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_41_594"},t.createElement("rect",{width:20,height:20,fill:"white"}))));exports.SvgEyeOpen=a;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("g", { clipPath: "url(#clip0_41_594)" }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 6.25C7.92893 6.25 6.25 7.92893 6.25 10C6.25 12.0711 7.92893 13.75 10 13.75C12.0711 13.75 13.75 12.0711 13.75 10C13.75 7.92893 12.0711 6.25 10 6.25ZM7.5 10C7.5 8.61925 8.61926 7.5 10 7.5C11.3807 7.5 12.5 8.61925 12.5 10C12.5 11.3807 11.3807 12.5 10 12.5C8.61926 12.5 7.5 11.3807 7.5 10Z", fill: "#152237" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.99986 3.125C5.83467 3.125 2.24769 5.59694 0.615747 9.15292C0.36897 9.69067 0.36897 10.3093 0.615747 10.8471C2.24769 14.4031 5.83467 16.875 9.99986 16.875C14.165 16.875 17.752 14.4031 19.3839 10.8471C19.6308 10.3093 19.6308 9.69067 19.3839 9.15292C17.752 5.59694 14.165 3.125 9.99986 3.125ZM1.75182 9.67425C3.18809 6.54468 6.34232 4.375 9.99986 4.375C13.6574 4.375 16.8116 6.54468 18.2479 9.67425C18.3428 9.881 18.3428 10.119 18.2479 10.3257C16.8116 13.4553 13.6574 15.625 9.99986 15.625C6.34232 15.625 3.18809 13.4553 1.75182 10.3257C1.65695 10.119 1.65694 9.881 1.75182 9.67425Z", fill: "#152237" })), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("clipPath", { id: "clip0_41_594" }, /* @__PURE__ */ e.createElement("rect", { width: 20, height: 20, fill: "white" }))));
|
|
3
|
+
export {
|
|
4
|
+
t as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { FlexProps } from './flex.types';
|
|
3
|
+
export declare function Flex({ align, children, className, flexDirection, flexWrap, gap, grow, inline, justify, order, shrink, md, lg, xl, style, ...props }: FlexProps): JSX.Element;
|
|
4
|
+
export type { FlexBreakpointProps, FlexProps, FlexResponsiveProps } from './flex.types';
|
|
5
|
+
export type { UiKitAlign, UiKitFlexDirection, UiKitFlexParams, UiKitFlexWrap, UiKitGap, UiKitJustify, } from '../types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { FlexResponsiveProps } from './flex.types';
|
|
3
|
+
export type FlexTailwindClassNamePlan = {
|
|
4
|
+
/** Готовая строка Tailwind-классов для flex props. */
|
|
5
|
+
className: string;
|
|
6
|
+
/** CSS-переменные, которые читают Tailwind arbitrary utilities. */
|
|
7
|
+
style: CSSProperties | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare function buildFlexTailwindClassNamePlan(props: FlexResponsiveProps): FlexTailwindClassNamePlan;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxAs, BoxBreakpointProps, BoxProps } from '../box/box.types';
|
|
2
|
+
import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
|
|
3
|
+
import { UiKitFlexParams } from '../types';
|
|
4
|
+
export type FlexBreakpointProps = BoxBreakpointProps & UiKitFlexParams;
|
|
5
|
+
export type FlexProps = Omit<BoxProps<BoxAs>, keyof BoxBreakpointProps | 'display' | 'md' | 'lg' | 'xl'> & FlexBreakpointProps & {
|
|
6
|
+
/** Рендерит контейнер как `inline-flex` вместо `flex`. */
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
md?: FlexBreakpointProps;
|
|
9
|
+
lg?: FlexBreakpointProps;
|
|
10
|
+
xl?: FlexBreakpointProps;
|
|
11
|
+
};
|
|
12
|
+
export type FlexResponsiveProps = UiKitFlexParams & Partial<Record<ResponsiveStyleBreakpoint, FlexBreakpointProps>>;
|
package/dist/flex.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react/jsx-runtime"),w=require("./box.cjs"),P=require("./responsive-style.config-B2m9jVlX.cjs");function k(e){const t=[],n={},o={md:e.md,lg:e.lg,xl:e.xl};N(e,t,n);for(const i of P.responsiveBreakpoints){const r=o[i];r&&N(r,t,n,`${i}:`,`${i}-`)}return{className:t.join(" "),style:Object.keys(n).length>0?n:void 0}}function N({justify:e,align:t,gap:n,flexDirection:o,flexWrap:i,order:r,shrink:x,grow:p},d,m,b="",a=""){const c={justifyContent:e,alignItems:t,gap:n===void 0?void 0:h(n),flexDirection:o,flexWrap:i,order:r,flexShrink:x,flexGrow:p};for(const[l,s]of Object.entries(c)){if(s==null)continue;const f=`${a}${S(l)}`,g=C(l,f);g&&(m[`--${f}`]=String(s),d.push(`${b}${g}`))}}function C(e,t){const n=`var(--${t})`;return{alignItems:y("align-items",n),flexDirection:y("flex-direction",n),flexGrow:u("grow",n),flexShrink:u("shrink",n),flexWrap:y("flex-wrap",n),gap:u("gap",n),justifyContent:y("justify-content",n),order:u("order",n)}[e]}function u(e,t){return[e,"-[",t,"]"].join("")}function y(e,t){return["[",e,":",t,"]"].join("")}function S(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function h(e){return typeof e=="number"?`${e}px`:e}function B({align:e,children:t,className:n,flexDirection:o,flexWrap:i,gap:r,grow:x,inline:p=!1,justify:d,order:m,shrink:b,md:a,lg:c,xl:l,style:s,...f}){const j=k({align:e,flexDirection:o,flexWrap:i,gap:r,grow:x,justify:d,order:m,shrink:b,md:a,lg:c,xl:l}),v=j.style||s?{...j.style,...s}:void 0;return $.jsx(w.Box,{className:P.cn(j.className,n),display:p?"inline-flex":"flex",md:a,lg:c,xl:l,style:v,...f,children:t})}exports.Flex=B;
|
package/dist/flex.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
+
import { Box as w } from "./box.js";
|
|
3
|
+
import { a as k, c as v } from "./responsive-style.config-DFuATrIM.js";
|
|
4
|
+
function C(e) {
|
|
5
|
+
const t = [], n = {}, o = {
|
|
6
|
+
md: e.md,
|
|
7
|
+
lg: e.lg,
|
|
8
|
+
xl: e.xl
|
|
9
|
+
};
|
|
10
|
+
P(e, t, n);
|
|
11
|
+
for (const i of k) {
|
|
12
|
+
const r = o[i];
|
|
13
|
+
r && P(
|
|
14
|
+
r,
|
|
15
|
+
t,
|
|
16
|
+
n,
|
|
17
|
+
`${i}:`,
|
|
18
|
+
`${i}-`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
className: t.join(" "),
|
|
23
|
+
style: Object.keys(n).length > 0 ? n : void 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function P({
|
|
27
|
+
justify: e,
|
|
28
|
+
align: t,
|
|
29
|
+
gap: n,
|
|
30
|
+
flexDirection: o,
|
|
31
|
+
flexWrap: i,
|
|
32
|
+
order: r,
|
|
33
|
+
shrink: p,
|
|
34
|
+
grow: x
|
|
35
|
+
}, y, d, b = "", l = "") {
|
|
36
|
+
const c = {
|
|
37
|
+
justifyContent: e,
|
|
38
|
+
alignItems: t,
|
|
39
|
+
gap: n === void 0 ? void 0 : F(n),
|
|
40
|
+
flexDirection: o,
|
|
41
|
+
flexWrap: i,
|
|
42
|
+
order: r,
|
|
43
|
+
flexShrink: p,
|
|
44
|
+
flexGrow: x
|
|
45
|
+
};
|
|
46
|
+
for (const [a, s] of Object.entries(c)) {
|
|
47
|
+
if (s == null)
|
|
48
|
+
continue;
|
|
49
|
+
const f = `${l}${B(a)}`, g = h(a, f);
|
|
50
|
+
g && (d[`--${f}`] = String(s), y.push(`${b}${g}`));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function h(e, t) {
|
|
54
|
+
const n = `var(--${t})`;
|
|
55
|
+
return {
|
|
56
|
+
alignItems: m("align-items", n),
|
|
57
|
+
flexDirection: m("flex-direction", n),
|
|
58
|
+
flexGrow: u("grow", n),
|
|
59
|
+
flexShrink: u("shrink", n),
|
|
60
|
+
flexWrap: m("flex-wrap", n),
|
|
61
|
+
gap: u("gap", n),
|
|
62
|
+
justifyContent: m("justify-content", n),
|
|
63
|
+
order: u("order", n)
|
|
64
|
+
}[e];
|
|
65
|
+
}
|
|
66
|
+
function u(e, t) {
|
|
67
|
+
return [e, "-[", t, "]"].join("");
|
|
68
|
+
}
|
|
69
|
+
function m(e, t) {
|
|
70
|
+
return ["[", e, ":", t, "]"].join("");
|
|
71
|
+
}
|
|
72
|
+
function B(e) {
|
|
73
|
+
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
74
|
+
}
|
|
75
|
+
function F(e) {
|
|
76
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
77
|
+
}
|
|
78
|
+
function G({
|
|
79
|
+
align: e,
|
|
80
|
+
children: t,
|
|
81
|
+
className: n,
|
|
82
|
+
flexDirection: o,
|
|
83
|
+
flexWrap: i,
|
|
84
|
+
gap: r,
|
|
85
|
+
grow: p,
|
|
86
|
+
inline: x = !1,
|
|
87
|
+
justify: y,
|
|
88
|
+
order: d,
|
|
89
|
+
shrink: b,
|
|
90
|
+
md: l,
|
|
91
|
+
lg: c,
|
|
92
|
+
xl: a,
|
|
93
|
+
style: s,
|
|
94
|
+
...f
|
|
95
|
+
}) {
|
|
96
|
+
const N = C({
|
|
97
|
+
align: e,
|
|
98
|
+
flexDirection: o,
|
|
99
|
+
flexWrap: i,
|
|
100
|
+
gap: r,
|
|
101
|
+
grow: p,
|
|
102
|
+
justify: y,
|
|
103
|
+
order: d,
|
|
104
|
+
shrink: b,
|
|
105
|
+
md: l,
|
|
106
|
+
lg: c,
|
|
107
|
+
xl: a
|
|
108
|
+
}), $ = N.style || s ? {
|
|
109
|
+
...N.style,
|
|
110
|
+
...s
|
|
111
|
+
} : void 0;
|
|
112
|
+
return /* @__PURE__ */ j(
|
|
113
|
+
w,
|
|
114
|
+
{
|
|
115
|
+
className: v(N.className, n),
|
|
116
|
+
display: x ? "inline-flex" : "flex",
|
|
117
|
+
md: l,
|
|
118
|
+
lg: c,
|
|
119
|
+
xl: a,
|
|
120
|
+
style: $,
|
|
121
|
+
...f,
|
|
122
|
+
children: t
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
G as Flex
|
|
128
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
import { GridItemProps, GridProps } from './grid.types';
|
|
3
|
+
/**
|
|
4
|
+
* Базовый Grid-компонент ui-kit.
|
|
5
|
+
*
|
|
6
|
+
* Grid является специализацией Box: все layout/background/as props передаются в
|
|
7
|
+
* Box, а сам Grid добавляет классы для `grid-template-columns` и `gap` через
|
|
8
|
+
* CSS-переменные. Это позволяет использовать один layout primitive и не дублировать
|
|
9
|
+
* размерные/background props между Box и Grid.
|
|
10
|
+
*/
|
|
11
|
+
declare function GridRoot({ children, className, cols, gap, md, lg, xl, style, ...boxProps }: GridProps): ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Ячейка Grid.
|
|
14
|
+
*
|
|
15
|
+
* Пока компонент не добавляет layout-логику поверх div, но формирует стабильный
|
|
16
|
+
* API `Grid.Item` для будущих grid-specific возможностей.
|
|
17
|
+
*/
|
|
18
|
+
export declare function GridItem({ children, className, ...props }: GridItemProps): JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Compound component: `Grid` + `Grid.Item`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const Grid: typeof GridRoot & {
|
|
23
|
+
Item: typeof GridItem;
|
|
24
|
+
};
|
|
25
|
+
export type { GridBreakpointProps, GridCols, GridGap, GridItemProps, GridProps, } from './grid.types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
|
|
3
|
+
import { GridBreakpointProps } from './grid.types';
|
|
4
|
+
export type GridTailwindClassNamePlan = {
|
|
5
|
+
/** Готовая строка Tailwind-классов для grid props. */
|
|
6
|
+
className: string;
|
|
7
|
+
/** CSS-переменные, которые читают Tailwind arbitrary utilities. */
|
|
8
|
+
style: CSSProperties | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Строит className + CSS variables для grid-specific props.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildGridTailwindClassNamePlan(props: GridBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, GridBreakpointProps>>): GridTailwindClassNamePlan;
|