@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.
Files changed (128) hide show
  1. package/README.md +38 -0
  2. package/dist/accordion/accordion-context.d.ts +3 -0
  3. package/dist/accordion/accordion-item.d.ts +48 -0
  4. package/dist/accordion/accordion-root.d.ts +5 -0
  5. package/dist/accordion/accordion.d.ts +8 -0
  6. package/dist/accordion.cjs +1 -0
  7. package/dist/accordion.js +206 -0
  8. package/dist/arrow-CS6d64Y4.cjs +1 -0
  9. package/dist/arrow-DBc2opRL.js +5 -0
  10. package/dist/box/box.d.ts +7 -0
  11. package/dist/box/box.helpers.d.ts +11 -0
  12. package/dist/box/box.types.d.ts +62 -0
  13. package/dist/box.cjs +1 -0
  14. package/dist/box.js +342 -0
  15. package/dist/button/button.d.ts +22 -0
  16. package/dist/button/button.helpers.d.ts +119 -0
  17. package/dist/button.cjs +1 -0
  18. package/dist/button.js +438 -0
  19. package/dist/design-tokens/color.tokens.d.ts +6 -0
  20. package/dist/design-tokens/typography.tokens.d.ts +9 -0
  21. package/dist/drop-down-CdIuWbLC.cjs +1 -0
  22. package/dist/drop-down-DH2_3qXq.js +5 -0
  23. package/dist/eye-open-5zYaeyLp.cjs +1 -0
  24. package/dist/eye-open-CoTSj5cT.js +5 -0
  25. package/dist/flex/flex.d.ts +5 -0
  26. package/dist/flex/flex.helpers.d.ts +9 -0
  27. package/dist/flex/flex.types.d.ts +12 -0
  28. package/dist/flex.cjs +1 -0
  29. package/dist/flex.js +128 -0
  30. package/dist/grid/grid.d.ts +25 -0
  31. package/dist/grid/grid.helpers.d.ts +13 -0
  32. package/dist/grid/grid.types.d.ts +49 -0
  33. package/dist/grid.cjs +1 -0
  34. package/dist/grid.js +103 -0
  35. package/dist/icons/icons.d.ts +30 -0
  36. package/dist/icons.cjs +1 -0
  37. package/dist/icons.js +38 -0
  38. package/dist/index.cjs +1 -0
  39. package/dist/index.d.ts +22 -0
  40. package/dist/index.js +97 -0
  41. package/dist/input/input.d.ts +49 -0
  42. package/dist/input/input.helpers.d.ts +9 -0
  43. package/dist/input.cjs +1 -0
  44. package/dist/input.js +85 -0
  45. package/dist/media-card/components/media-card-pick-indicator.d.ts +6 -0
  46. package/dist/media-card/components/media-card-preview.d.ts +7 -0
  47. package/dist/media-card/components/media-card-upload-footer.d.ts +7 -0
  48. package/dist/media-card/components/media-card-upload.d.ts +5 -0
  49. package/dist/media-card/media-card-pick.d.ts +5 -0
  50. package/dist/media-card/media-card.d.ts +4 -0
  51. package/dist/media-card/media-card.types.d.ts +10 -0
  52. package/dist/media-card.cjs +1 -0
  53. package/dist/media-card.js +104 -0
  54. package/dist/media-gallery/media-gallery.d.ts +12 -0
  55. package/dist/media-gallery/media-gallery.helpers.d.ts +27 -0
  56. package/dist/media-gallery/media-gallery.types.d.ts +59 -0
  57. package/dist/media-gallery.cjs +1 -0
  58. package/dist/media-gallery.js +100 -0
  59. package/dist/media-picture-BN4saEVT.js +6 -0
  60. package/dist/media-picture-BmERSmsd.cjs +1 -0
  61. package/dist/modal/modal.d.ts +50 -0
  62. package/dist/modal.cjs +1 -0
  63. package/dist/modal.js +143 -0
  64. package/dist/pagination/pagination.d.ts +22 -0
  65. package/dist/pagination.cjs +1 -0
  66. package/dist/pagination.js +155 -0
  67. package/dist/picture/picture.d.ts +12 -0
  68. package/dist/picture/picture.helpers.d.ts +9 -0
  69. package/dist/picture/picture.types.d.ts +56 -0
  70. package/dist/picture.cjs +1 -0
  71. package/dist/picture.js +55 -0
  72. package/dist/responsive-style.config-B2m9jVlX.cjs +1 -0
  73. package/dist/responsive-style.config-DFuATrIM.js +19 -0
  74. package/dist/responsive-style.utils-BdyoDkKg.cjs +1 -0
  75. package/dist/responsive-style.utils-D10sC561.js +25 -0
  76. package/dist/select/select.d.ts +55 -0
  77. package/dist/select/select.helpers.d.ts +14 -0
  78. package/dist/select/select.types.d.ts +12 -0
  79. package/dist/select.cjs +1 -0
  80. package/dist/select.js +179 -0
  81. package/dist/shared/lib/cn.d.ts +2 -0
  82. package/dist/shared/responsive-style/responsive-style.config.d.ts +20 -0
  83. package/dist/shared/responsive-style/responsive-style.types.d.ts +52 -0
  84. package/dist/shared/responsive-style/responsive-style.utils.d.ts +17 -0
  85. package/dist/status-badge/status-badge.d.ts +11 -0
  86. package/dist/status-badge.cjs +1 -0
  87. package/dist/status-badge.js +39 -0
  88. package/dist/styles.css +1 -0
  89. package/dist/switch/switch.d.ts +34 -0
  90. package/dist/switch.cjs +1 -0
  91. package/dist/switch.js +127 -0
  92. package/dist/table/data-table.d.ts +3 -0
  93. package/dist/table/table-container.d.ts +8 -0
  94. package/dist/table/table-primitives.d.ts +40 -0
  95. package/dist/table/table-status.d.ts +12 -0
  96. package/dist/table/table.d.ts +8 -0
  97. package/dist/table/table.types.d.ts +48 -0
  98. package/dist/table-container-BsE-uIE1.js +242 -0
  99. package/dist/table-container-DqqqkChm.cjs +1 -0
  100. package/dist/table.cjs +1 -0
  101. package/dist/table.js +16 -0
  102. package/dist/telephone-DVftjRG9.cjs +1 -0
  103. package/dist/telephone-DvXakgBQ.js +26 -0
  104. package/dist/time-clock-DOwPzcx7.cjs +1 -0
  105. package/dist/time-clock-DjqcZ8tI.js +5 -0
  106. package/dist/types/flex.types.d.ts +25 -0
  107. package/dist/types/index.d.ts +7 -0
  108. package/dist/types/interaction.types.d.ts +8 -0
  109. package/dist/types/layout.types.d.ts +52 -0
  110. package/dist/types/shared.types.d.ts +8 -0
  111. package/dist/types/spacing.types.d.ts +123 -0
  112. package/dist/types/typography.types.d.ts +75 -0
  113. package/dist/types/visual.types.d.ts +82 -0
  114. package/dist/types.cjs +1 -0
  115. package/dist/types.js +1 -0
  116. package/dist/typography/typography.d.ts +39 -0
  117. package/dist/typography/typography.helpers.d.ts +237 -0
  118. package/dist/typography.cjs +1 -0
  119. package/dist/typography.js +469 -0
  120. package/dist/ui-kit-provider/ui-kit-provider.d.ts +53 -0
  121. package/dist/ui-kit-provider-C6Mk5g_7.js +167 -0
  122. package/dist/ui-kit-provider-raEFsUm0.cjs +1 -0
  123. package/dist/ui-kit-provider.cjs +1 -0
  124. package/dist/ui-kit-provider.js +8 -0
  125. package/dist/vite.config.d.ts +2 -0
  126. package/dist/x-mark-DId-ylR6.cjs +1 -0
  127. package/dist/x-mark-WU1eT82T.js +5 -0
  128. package/package.json +219 -0
package/dist/box.js ADDED
@@ -0,0 +1,342 @@
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import { forwardRef as F } from "react";
3
+ import { a as J, c as Q } from "./responsive-style.config-DFuATrIM.js";
4
+ function U({
5
+ background: t,
6
+ backgroundColor: o,
7
+ bg: i,
8
+ bgSize: d,
9
+ bgRepeat: a,
10
+ bgPosition: u,
11
+ border: h,
12
+ cursor: f,
13
+ p: s,
14
+ m,
15
+ outlineColor: b,
16
+ outlineWidth: c,
17
+ outlineOffset: l,
18
+ outlineStyle: v,
19
+ listStyle: p,
20
+ display: y,
21
+ position: r,
22
+ width: R,
23
+ maxWidth: k,
24
+ minWidth: x,
25
+ height: S,
26
+ maxHeight: z,
27
+ minHeight: W
28
+ }) {
29
+ const e = {};
30
+ return i !== void 0 ? lo(e, i) : t !== void 0 && (e.background = T(t)), o !== void 0 && (e.backgroundColor = T(o)), d !== void 0 && (e.backgroundSize = co(d)), a !== void 0 && (e.backgroundRepeat = so(a)), u !== void 0 && (e.backgroundPosition = bo(u)), eo(e, h), f !== void 0 && (e.cursor = f), to(e, s), io(e, m), b !== void 0 && (e.outlineColor = N(b)), c !== void 0 && (e.outlineWidth = c), l !== void 0 && (e.outlineOffset = l), v !== void 0 && (e.outlineStyle = v), p?.position !== void 0 && (e.listStylePosition = p.position), p?.type !== void 0 && (e.listStyleType = p.type), y !== void 0 && (e.display = uo(y)), r?.type !== void 0 && (e.position = r.type), r?.top !== void 0 && (e.top = C(r.top)), r?.left !== void 0 && (e.left = C(r.left)), r?.right !== void 0 && (e.right = C(r.right)), r?.bottom !== void 0 && (e.bottom = C(r.bottom)), r?.zIndex !== void 0 && (e.zIndex = r.zIndex), R !== void 0 && (e.width = g(R)), k !== void 0 && (e.maxWidth = g(k)), x !== void 0 && (e.minWidth = g(x)), S !== void 0 && (e.height = g(S)), z !== void 0 && (e.maxHeight = g(z)), W !== void 0 && (e.minHeight = g(W)), Object.keys(e).length > 0 ? e : void 0;
31
+ }
32
+ function X(t) {
33
+ const o = [], i = {}, d = t.groupParent === !0;
34
+ P(t, o, i, "", "", d);
35
+ for (const a of J) {
36
+ const u = t[a];
37
+ u && P(
38
+ u,
39
+ o,
40
+ i,
41
+ `${a}:`,
42
+ `${a}-`,
43
+ d
44
+ );
45
+ }
46
+ return {
47
+ className: o.join(" "),
48
+ style: Object.keys(i).length > 0 ? i : void 0
49
+ };
50
+ }
51
+ function P(t, o, i, d = "", a = "", u = !1) {
52
+ const h = U(t);
53
+ for (const [f, s] of Object.entries(h ?? {})) {
54
+ if (s == null)
55
+ continue;
56
+ const m = String(s), b = Y(f, m);
57
+ if (b) {
58
+ o.push(`${d}${b}`);
59
+ continue;
60
+ }
61
+ const c = `${a}${oo(f)}`, l = _(f, c);
62
+ l && (i[`--${c}`] = m, o.push(`${d}${l}`));
63
+ }
64
+ if (t.bgGroup !== void 0) {
65
+ const f = `${a}group-background`;
66
+ i[`--${f}`] = T(t.bgGroup), o.push(`${d}group-hover:[background:var(--${f})]`), u && o.push(`${d}hover:[background:var(--${f})]`);
67
+ }
68
+ }
69
+ function Y(t, o) {
70
+ if (t === "display")
71
+ return o === "none" ? "hidden" : o;
72
+ if (t === "position")
73
+ return o === "inherit" ? "[position:inherit]" : o;
74
+ if (t === "cursor")
75
+ return `cursor-${o}`;
76
+ if (t === "backgroundRepeat")
77
+ return {
78
+ "no-repeat": "bg-no-repeat",
79
+ repeat: "bg-repeat",
80
+ round: "bg-repeat-round",
81
+ space: "bg-repeat-space",
82
+ "repeat-x": "bg-repeat-x",
83
+ "repeat-y": "bg-repeat-y"
84
+ }[o];
85
+ if (t === "backgroundSize")
86
+ return {
87
+ auto: "bg-auto",
88
+ contain: "bg-contain",
89
+ cover: "bg-cover"
90
+ }[o];
91
+ if (t === "backgroundPosition")
92
+ return {
93
+ bottom: "bg-bottom",
94
+ center: "bg-center",
95
+ left: "bg-left",
96
+ "left bottom": "bg-left-bottom",
97
+ "left top": "bg-left-top",
98
+ right: "bg-right",
99
+ "right bottom": "bg-right-bottom",
100
+ "right top": "bg-right-top",
101
+ top: "bg-top"
102
+ }[o];
103
+ if (t === "borderStyle")
104
+ return o === "none" ? "border-none" : `border-${o}`;
105
+ if (t === "outlineStyle")
106
+ return o === "none" ? "outline-none" : `outline-${o}`;
107
+ if (t === "listStylePosition")
108
+ return `list-${o}`;
109
+ if (t === "listStyleType")
110
+ return `list-${o}`;
111
+ }
112
+ function _(t, o) {
113
+ const i = `var(--${o})`;
114
+ return {
115
+ background: `[background:${i}]`,
116
+ backgroundColor: `bg-[${i}]`,
117
+ backgroundPosition: `bg-[position:${i}]`,
118
+ backgroundSize: `bg-[length:${i}]`,
119
+ borderBottomLeftRadius: `rounded-bl-[${i}]`,
120
+ borderBottomRightRadius: `rounded-br-[${i}]`,
121
+ borderBottomWidth: `border-b-[length:${i}]`,
122
+ borderColor: `border-[color:${i}]`,
123
+ borderLeftWidth: `border-l-[length:${i}]`,
124
+ borderRadius: `rounded-[${i}]`,
125
+ borderRightWidth: `border-r-[length:${i}]`,
126
+ borderTopLeftRadius: `rounded-tl-[${i}]`,
127
+ borderTopRightRadius: `rounded-tr-[${i}]`,
128
+ borderTopWidth: `border-t-[length:${i}]`,
129
+ borderWidth: `border-[length:${i}]`,
130
+ bottom: `bottom-[${i}]`,
131
+ height: `h-[${i}]`,
132
+ left: `left-[${i}]`,
133
+ margin: `m-[${i}]`,
134
+ marginBottom: `mb-[${i}]`,
135
+ marginLeft: `ml-[${i}]`,
136
+ marginRight: `mr-[${i}]`,
137
+ marginTop: `mt-[${i}]`,
138
+ maxHeight: `max-h-[${i}]`,
139
+ maxWidth: `max-w-[${i}]`,
140
+ minHeight: `min-h-[${i}]`,
141
+ minWidth: `min-w-[${i}]`,
142
+ outlineColor: `outline-[color:${i}]`,
143
+ outlineOffset: `outline-offset-[${i}]`,
144
+ outlineWidth: `outline-[length:${i}]`,
145
+ padding: `p-[${i}]`,
146
+ paddingBottom: `pb-[${i}]`,
147
+ paddingLeft: `pl-[${i}]`,
148
+ paddingRight: `pr-[${i}]`,
149
+ paddingTop: `pt-[${i}]`,
150
+ right: `right-[${i}]`,
151
+ top: `top-[${i}]`,
152
+ width: `w-[${i}]`,
153
+ zIndex: `z-[${i}]`
154
+ }[t];
155
+ }
156
+ function oo(t) {
157
+ return t.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`);
158
+ }
159
+ function to(t, o) {
160
+ if (o !== void 0) {
161
+ if (Array.isArray(o)) {
162
+ t.padding = o.map(n).join(" ");
163
+ return;
164
+ }
165
+ if (typeof o != "object") {
166
+ t.padding = n(o);
167
+ return;
168
+ }
169
+ "px" in o && o.px !== void 0 && (t.paddingLeft = n(o.px), t.paddingRight = n(o.px)), "py" in o && o.py !== void 0 && (t.paddingTop = n(o.py), t.paddingBottom = n(o.py)), "pt" in o && o.pt !== void 0 && (t.paddingTop = n(o.pt)), "pb" in o && o.pb !== void 0 && (t.paddingBottom = n(o.pb)), "pl" in o && o.pl !== void 0 && (t.paddingLeft = n(o.pl)), "pr" in o && o.pr !== void 0 && (t.paddingRight = n(o.pr));
170
+ }
171
+ }
172
+ function io(t, o) {
173
+ if (o !== void 0) {
174
+ if (Array.isArray(o)) {
175
+ t.margin = o.map(n).join(" ");
176
+ return;
177
+ }
178
+ if (typeof o != "object") {
179
+ t.margin = n(o);
180
+ return;
181
+ }
182
+ "mx" in o && o.mx !== void 0 && (t.marginLeft = n(o.mx), t.marginRight = n(o.mx)), "my" in o && o.my !== void 0 && (t.marginTop = n(o.my), t.marginBottom = n(o.my)), "mt" in o && o.mt !== void 0 && (t.marginTop = n(o.mt)), "mb" in o && o.mb !== void 0 && (t.marginBottom = n(o.mb)), "ml" in o && o.ml !== void 0 && (t.marginLeft = n(o.ml)), "mr" in o && o.mr !== void 0 && (t.marginRight = n(o.mr));
183
+ }
184
+ }
185
+ function eo(t, o) {
186
+ o && (o.radius !== void 0 && no(t, o.radius), o.color !== void 0 && (t.borderColor = N(o.color)), o.width !== void 0 && ro(t, o.width), o.style !== void 0 && (t.borderStyle = o.style));
187
+ }
188
+ function no(t, o) {
189
+ if (fo(o)) {
190
+ o.topLeft !== void 0 && (t.borderTopLeftRadius = $(o.topLeft)), o.topRight !== void 0 && (t.borderTopRightRadius = $(o.topRight)), o.bottomLeft !== void 0 && (t.borderBottomLeftRadius = $(o.bottomLeft)), o.bottomRight !== void 0 && (t.borderBottomRightRadius = $(o.bottomRight));
191
+ return;
192
+ }
193
+ t.borderRadius = $(o);
194
+ }
195
+ function ro(t, o) {
196
+ if (ao(o)) {
197
+ o.top !== void 0 && (t.borderTopWidth = B(o.top)), o.bottom !== void 0 && (t.borderBottomWidth = B(o.bottom)), o.left !== void 0 && (t.borderLeftWidth = B(o.left)), o.right !== void 0 && (t.borderRightWidth = B(o.right));
198
+ return;
199
+ }
200
+ t.borderWidth = B(o);
201
+ }
202
+ function fo(t) {
203
+ return typeof t == "object";
204
+ }
205
+ function ao(t) {
206
+ return typeof t == "object";
207
+ }
208
+ function $(t) {
209
+ return t.startsWith("--") ? `var(${t})` : t;
210
+ }
211
+ function B(t) {
212
+ return t.startsWith("--") ? `var(${t})` : t;
213
+ }
214
+ function uo(t) {
215
+ return t === "hidden" ? "none" : t;
216
+ }
217
+ function C(t) {
218
+ return typeof t == "number" ? `${t}px` : t;
219
+ }
220
+ function n(t) {
221
+ return typeof t == "number" ? `${t}px` : t;
222
+ }
223
+ function g(t) {
224
+ return typeof t == "number" ? `${t}px` : t;
225
+ }
226
+ function co(t) {
227
+ return typeof t == "number" ? `${t}px` : t;
228
+ }
229
+ function so(t) {
230
+ return {
231
+ "no-repeat": "no-repeat",
232
+ repeat: "repeat",
233
+ "repeat-round": "round",
234
+ "repeat-space": "space",
235
+ "repeat-x": "repeat-x",
236
+ "repeat-y": "repeat-y"
237
+ }[t];
238
+ }
239
+ function bo(t) {
240
+ return t.replace("-", " ");
241
+ }
242
+ function T(t) {
243
+ return N(t);
244
+ }
245
+ function lo(t, o) {
246
+ const i = T(o);
247
+ if (mo(o)) {
248
+ t.background = i;
249
+ return;
250
+ }
251
+ t.backgroundColor = i;
252
+ }
253
+ function mo(t) {
254
+ const o = t.trim().toLowerCase();
255
+ return o.includes("url(") || o.includes("gradient(") || o.includes("image-set(") || o.includes("cross-fade(") || o.includes("element(") || o.includes("paint(");
256
+ }
257
+ function N(t) {
258
+ return t.startsWith("--") ? `var(${t})` : t;
259
+ }
260
+ function po(t, o) {
261
+ const {
262
+ as: i,
263
+ children: d,
264
+ className: a,
265
+ background: u,
266
+ backgroundColor: h,
267
+ bg: f,
268
+ bgSize: s,
269
+ bgRepeat: m,
270
+ bgGroup: b,
271
+ groupParent: c,
272
+ bgPosition: l,
273
+ border: v,
274
+ cursor: p,
275
+ p: y,
276
+ m: r,
277
+ outlineColor: R,
278
+ outlineWidth: k,
279
+ outlineOffset: x,
280
+ outlineStyle: S,
281
+ listStyle: z,
282
+ display: W,
283
+ position: e,
284
+ width: I,
285
+ maxWidth: j,
286
+ minWidth: w,
287
+ height: A,
288
+ maxHeight: O,
289
+ minHeight: G,
290
+ md: H,
291
+ lg: D,
292
+ xl: K,
293
+ style: V,
294
+ ...M
295
+ } = t, Z = i ?? "div", L = X({
296
+ background: u,
297
+ backgroundColor: h,
298
+ bg: f,
299
+ bgSize: s,
300
+ bgRepeat: m,
301
+ bgGroup: b,
302
+ groupParent: c,
303
+ bgPosition: l,
304
+ border: v,
305
+ cursor: p,
306
+ p: y,
307
+ m: r,
308
+ outlineColor: R,
309
+ outlineWidth: k,
310
+ outlineOffset: x,
311
+ outlineStyle: S,
312
+ listStyle: z,
313
+ display: W,
314
+ position: e,
315
+ width: I,
316
+ maxWidth: j,
317
+ minWidth: w,
318
+ height: A,
319
+ maxHeight: O,
320
+ minHeight: G,
321
+ md: H,
322
+ lg: D,
323
+ xl: K
324
+ }), q = L.style || V ? {
325
+ ...L.style,
326
+ ...V
327
+ } : void 0;
328
+ return /* @__PURE__ */ E(
329
+ Z,
330
+ {
331
+ className: Q(L.className, c && "group", a),
332
+ ref: o,
333
+ style: q,
334
+ ...M,
335
+ children: d
336
+ }
337
+ );
338
+ }
339
+ const vo = F(po);
340
+ export {
341
+ vo as Box
342
+ };
@@ -0,0 +1,22 @@
1
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
2
+ import { ButtonAlignContent, ButtonBoxStyleProps, ButtonSize, ButtonVariant } from './button.helpers';
3
+ export interface ButtonVariantProps {
4
+ /** Горизонтальное выравнивание контента внутри кнопки. */
5
+ alignContent?: ButtonAlignContent;
6
+ fullWidth?: boolean;
7
+ size?: ButtonSize;
8
+ variant?: ButtonVariant;
9
+ }
10
+ type ButtonBaseProps = ButtonVariantProps & ButtonBoxStyleProps & {
11
+ isLoading?: boolean;
12
+ };
13
+ type NativeButtonProps = ButtonBaseProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonBaseProps | 'href'> & {
14
+ href?: undefined;
15
+ };
16
+ type AnchorButtonProps = ButtonBaseProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonBaseProps | 'href'> & {
17
+ href: string;
18
+ disabled?: boolean;
19
+ };
20
+ export type ButtonProps = NativeButtonProps | AnchorButtonProps;
21
+ export declare function Button({ alignContent, children, className, disabled, display, border, bg, color, cursor, fullWidth, href, hoverBg, activeBg, fontSize, fontWeight, isLoading, lineHeight, minHeight, minWidth, md, lg, xl, p, position, size, style, variant, width, ...props }: ButtonProps): ReactNode;
22
+ export { buttonSizeBoxProps, buttonSizeBorderRadius, buttonSizeClassNames, buttonVariantClassNames, buttonVariants, } from './button.helpers';
@@ -0,0 +1,119 @@
1
+ import { CSSProperties } from 'react';
2
+ import { BoxBreakpointProps } from '../box/box';
3
+ import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
4
+ import { TypographyFontSizeValue, TypographyFontWeightValue, TypographyLineHeightValue, UiKitBackgroundValue } from '../types';
5
+ export type ButtonAlignContent = 'start' | 'center' | 'end';
6
+ export type ButtonAlignContentBreakpointProps = {
7
+ alignContent?: ButtonAlignContent;
8
+ };
9
+ export type ButtonColorValue = UiKitBackgroundValue;
10
+ export type ButtonColorBreakpointProps = {
11
+ /** Background кнопки поверх цвета из variant. */
12
+ bg?: ButtonColorValue;
13
+ /** Цвет текста и иконок кнопки поверх цвета из variant. */
14
+ color?: ButtonColorValue;
15
+ /** Background кнопки при hover. Если не передан, при `bg` используется тот же цвет. */
16
+ hoverBg?: ButtonColorValue;
17
+ /** Background кнопки при active. Если не передан, при `bg` используется hover/base цвет. */
18
+ activeBg?: ButtonColorValue;
19
+ };
20
+ export type ButtonTypographyBreakpointProps = {
21
+ /** Font-size кнопки поверх типографики из size. */
22
+ fontSize?: TypographyFontSizeValue;
23
+ /** Font-weight кнопки поверх типографики из size. */
24
+ fontWeight?: TypographyFontWeightValue;
25
+ /** Line-height кнопки поверх типографики из size. */
26
+ lineHeight?: TypographyLineHeightValue;
27
+ };
28
+ export type ButtonVariant = keyof typeof buttonVariantClassNames;
29
+ export type ButtonSize = keyof typeof buttonSizeClassNames;
30
+ export type ButtonVariantBreakpointProps = {
31
+ /** Визуальный variant кнопки для конкретного breakpoint-а. */
32
+ variant?: ButtonVariant;
33
+ };
34
+ export type ButtonSizeBreakpointProps = {
35
+ /** Размер кнопки для конкретного breakpoint-а. */
36
+ size?: ButtonSize;
37
+ };
38
+ export type ButtonBreakpointProps = Omit<BoxBreakpointProps, 'bg'> & ButtonAlignContentBreakpointProps & ButtonColorBreakpointProps & ButtonTypographyBreakpointProps & ButtonVariantBreakpointProps & ButtonSizeBreakpointProps;
39
+ export type ButtonBoxStyleProps = Omit<BoxBreakpointProps, 'bg'> & ButtonColorBreakpointProps & ButtonTypographyBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, ButtonBreakpointProps>>;
40
+ type ButtonAlignContentResponsiveProps = ButtonAlignContentBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, ButtonAlignContentBreakpointProps>>;
41
+ type ButtonSizeResponsiveProps = ButtonSizeBreakpointProps & {
42
+ p?: BoxBreakpointProps['p'];
43
+ } & Partial<Record<ResponsiveStyleBreakpoint, Pick<ButtonBreakpointProps, 'p' | 'size'>>>;
44
+ type ButtonVariantResponsiveProps = ButtonVariantBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, ButtonVariantBreakpointProps>>;
45
+ type ButtonColorResponsiveProps = ButtonColorBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, ButtonColorBreakpointProps>>;
46
+ type ButtonTypographyResponsiveProps = ButtonTypographyBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, ButtonTypographyBreakpointProps>>;
47
+ type ButtonTypographyStyle = CSSProperties & Record<`--${string}`, string | number>;
48
+ export declare const buttonVariantClassNames: {
49
+ readonly 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)]";
50
+ readonly 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)]";
51
+ readonly 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)]";
52
+ readonly 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)]";
53
+ readonly 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)]";
54
+ readonly transparent: "bg-transparent text-[var(--color-text-primary)] hover:bg-transparent active:bg-transparent";
55
+ };
56
+ export declare const buttonSizeClassNames: {
57
+ readonly sm: "text-[13px] font-medium leading-[120%] [&_svg]:size-4";
58
+ readonly md: "text-[15px] font-medium leading-[140%] [&_svg]:size-5";
59
+ readonly lg: "text-[18px] font-medium leading-[140%] [&_svg]:size-5";
60
+ };
61
+ export declare const buttonSizePaddingClassNames: {
62
+ readonly sm: "px-[12px] py-[6px]";
63
+ readonly md: "px-[16px] py-[10px]";
64
+ readonly lg: "px-[20px] py-[10px]";
65
+ };
66
+ export declare const buttonSizeBorderRadius: {
67
+ readonly sm: "6px";
68
+ readonly md: "8px";
69
+ readonly lg: "12px";
70
+ };
71
+ export declare const buttonBaseClassName = "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";
72
+ export declare const buttonVariants: (props?: ({
73
+ variant?: "default" | "transparent" | "dark" | "secondary" | "destructive" | "success" | null | undefined;
74
+ size?: "md" | "lg" | "sm" | null | undefined;
75
+ fullWidth?: boolean | null | undefined;
76
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
77
+ export declare const buttonSizeBoxProps: {
78
+ readonly sm: {
79
+ readonly minWidth: 32;
80
+ readonly p: {
81
+ readonly px: 12;
82
+ readonly py: 8;
83
+ };
84
+ };
85
+ readonly md: {
86
+ readonly p: {
87
+ readonly px: 16;
88
+ readonly py: 10;
89
+ };
90
+ };
91
+ readonly lg: {
92
+ readonly p: {
93
+ readonly px: 32;
94
+ readonly py: 16;
95
+ };
96
+ };
97
+ };
98
+ export declare function buildButtonAlignContentClassNamePlan({ alignContent, md, lg, xl, }: ButtonAlignContentResponsiveProps): {
99
+ className: string;
100
+ style: CSSProperties | undefined;
101
+ };
102
+ export declare function buildButtonVariantClassNamePlan({ variant, md, lg, xl }: ButtonVariantResponsiveProps, colorOverrides?: ButtonColorResponsiveProps): {
103
+ className: string;
104
+ style: CSSProperties | undefined;
105
+ };
106
+ export declare function buildButtonColorClassNamePlan({ activeBg, bg, color, hoverBg, md, lg, xl, }: ButtonColorResponsiveProps): {
107
+ className: string;
108
+ style: CSSProperties | undefined;
109
+ };
110
+ export declare function buildButtonTypographyClassNamePlan({ fontSize, fontWeight, lineHeight, md, lg, xl, }: ButtonTypographyResponsiveProps): {
111
+ className: string;
112
+ style: CSSProperties | undefined;
113
+ };
114
+ export declare function buildButtonSizeClassNamePlan({ size, md, lg, xl, }: ButtonSizeResponsiveProps): {
115
+ className: string;
116
+ style: ButtonTypographyStyle;
117
+ };
118
+ export declare function getButtonBoxBreakpointProps(breakpointProps: ButtonBreakpointProps | undefined): BoxBreakpointProps | undefined;
119
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),E=require("./box.cjs"),st=require("./responsive-style.config-B2m9jVlX.cjs"),lt=require("class-variance-authority"),B=require("./responsive-style.utils-BdyoDkKg.cjs"),G={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)]",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)]",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)]",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)]",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)]",transparent:"bg-transparent text-[var(--color-text-primary)] hover:bg-transparent active:bg-transparent"},J={sm:"text-[13px] font-medium leading-[120%] [&_svg]:size-4",md:"text-[15px] font-medium leading-[140%] [&_svg]:size-5",lg:"text-[18px] font-medium leading-[140%] [&_svg]:size-5"},w={sm:"6px",md:"8px",lg:"12px"},K="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",ct=lt.cva([K,"[justify-content:var(--button-justify-content,center)]"].join(" "),{variants:{variant:G,size:J,fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",size:"md"}}),T={sm:{minWidth:32,p:{px:12,py:8}},md:{p:{px:16,py:10}},lg:{p:{px:32,py:16}}},gt={base:"[justify-content:var(--button-justify-content)]",md:"md:[justify-content:var(--md-button-justify-content)]",lg:"lg:[justify-content:var(--lg-button-justify-content)]",xl:"xl:[justify-content:var(--xl-button-justify-content)]"},ut={default:{activeBg:"color-mix(in srgb, var(--color-primary-accent) 80%, #000)",bg:"--color-primary-accent",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-primary-accent) 80%, #fff)"},secondary:{activeBg:"color-mix(in srgb, var(--color-background-subtle) 80%, #fff)",bg:"--color-background-subtle",color:"--color-text-primary",hoverBg:"color-mix(in srgb, var(--color-background-subtle) 90%, #000)"},destructive:{activeBg:"color-mix(in srgb, var(--color-secondary-accent-2) 80%, #000)",bg:"--color-secondary-accent-2",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-secondary-accent-2) 80%, #fff)"},success:{activeBg:"color-mix(in srgb, var(--color-secondary-accent-1) 80%, #000)",bg:"--color-secondary-accent-1",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-secondary-accent-1) 80%, #fff)"},dark:{activeBg:"color-mix(in srgb, var(--color-text-primary) 80%, #000)",bg:"--color-text-primary",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-text-primary) 80%, #fff)"},transparent:{activeBg:"transparent",bg:"transparent",color:"--color-text-primary",hoverBg:"transparent"}},bt={sm:"[&_svg]:size-4",md:"[&_svg]:size-5",lg:"[&_svg]:size-5"},vt={sm:{fontSize:"13px",fontWeight:500,lineHeight:"120%"},md:{fontSize:"15px",fontWeight:500,lineHeight:"140%"},lg:{fontSize:"18px",fontWeight:500,lineHeight:"140%"}};function dt({alignContent:o,md:t,lg:r,xl:a}){const e=[],n={};return m(o,e,n,"base"),m(t?.alignContent,e,n,"md","md-"),m(r?.alignContent,e,n,"lg","lg-"),m(a?.alignContent,e,n,"xl","xl-"),{className:e.join(" "),style:Object.keys(n).length?n:void 0}}function ft({variant:o,md:t,lg:r,xl:a},e={}){const n=[],i={};return x(o,e,n,i),x(t?.variant,e.md,n,i,"md"),x(r?.variant,e.lg,n,i,"lg"),x(a?.variant,e.xl,n,i,"xl"),{className:n.join(" "),style:Object.keys(i).length?i:void 0}}function mt({activeBg:o,bg:t,color:r,hoverBg:a,md:e,lg:n,xl:i}){const s=[],l={};return y({activeBg:o,bg:t,color:r,hoverBg:a},s,l),y(e,s,l,"md"),y(n,s,l,"lg"),y(i,s,l,"xl"),{className:s.join(" "),style:Object.keys(l).length?l:void 0}}function ht({fontSize:o,fontWeight:t,lineHeight:r,md:a,lg:e,xl:n}){const i=[],s={};return z({fontSize:o,fontWeight:t,lineHeight:r},i,s),z(a,i,s,"md"),z(e,i,s,"lg"),z(n,i,s,"xl"),{className:i.join(" "),style:Object.keys(s).length?s:void 0}}function xt({size:o="md",md:t,lg:r,xl:a}){const e=[bt[o],p.fontSize,p.fontWeight,p.lineHeight],n={};return h(o,e,n),h(t?.size,e,n,"md"),h(r?.size,e,n,"lg"),h(a?.size,e,n,"xl"),{className:e.join(" "),style:n}}function H(o){if(!o)return;const t={...o};return(o.size||o.border)&&(t.border={radius:o.size?w[o.size]:void 0,...o.border}),o.size&&o.p===void 0&&(t.p=T[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}function m(o,t,r,a,e=""){if(!o)return;const n=`${e}button-justify-content`;r[`--${n}`]=zt(o),t.push(gt[a])}function h(o,t,r,a){if(!o)return;const{fontSize:e,fontWeight:n,lineHeight:i}=vt[o];if(!a){r["--button-font-size"]=e,r["--button-font-weight"]=n,r["--button-line-height"]=i;return}r[`--${a}-button-font-size`]=e,r[`--${a}-button-font-weight`]=n,r[`--${a}-button-line-height`]=i,t.push(yt[a][o],_[a].fontSize,_[a].fontWeight,_[a].lineHeight)}function x(o,t,r,a,e){if(!o)return;const n=e?Q[e]:L,i=e?`${e}-`:"",s=ut[o];t?.bg===void 0&&(a[`--${i}button-bg`]=c(s.bg),r.push(n.bg)),t?.color===void 0&&(a[`--${i}button-color`]=c(s.color),r.push(n.color)),t?.bg===void 0&&t?.hoverBg===void 0&&(a[`--${i}button-hover-bg`]=c(s.hoverBg),r.push(n.hoverBg)),t?.bg===void 0&&t?.hoverBg===void 0&&t?.activeBg===void 0&&(a[`--${i}button-active-bg`]=c(s.activeBg),r.push(n.activeBg))}function y(o,t,r,a){if(!o)return;const{activeBg:e,bg:n,color:i,hoverBg:s}=o,l=a?Q[a]:L,v=a?`${a}-`:"";n!==void 0&&(r[`--${v}button-bg`]=c(n),t.push(l.bg,l.hoverBg,l.activeBg)),s!==void 0&&(r[`--${v}button-hover-bg`]=c(s),t.push(l.hoverBg)),e!==void 0&&(r[`--${v}button-active-bg`]=c(e),t.push(l.activeBg)),i!==void 0&&(r[`--${v}button-color`]=c(i),t.push(l.color))}function z(o,t,r,a){if(!o)return;const{fontSize:e,fontWeight:n,lineHeight:i}=o,s=a?_[a]:p,l=a?`${a}-`:"";e!==void 0&&(r[`--${l}button-font-size`]=B.normalizeCssTokenValue(e),t.push(s.fontSize)),n!==void 0&&(r[`--${l}button-font-weight`]=B.normalizeCssTokenValue(n),t.push(s.fontWeight)),i!==void 0&&(r[`--${l}button-line-height`]=B.normalizeCssTokenValue(i),t.push(s.lineHeight))}const L={activeBg:"active:bg-[var(--button-active-bg,var(--button-hover-bg,var(--button-bg)))]",bg:"bg-[var(--button-bg)]",color:"text-[var(--button-color)]",hoverBg:"hover:bg-[var(--button-hover-bg,var(--button-bg))]"},p={fontSize:"text-[length:var(--button-font-size)]",fontWeight:"font-[var(--button-font-weight)]",lineHeight:"leading-[var(--button-line-height)]"},Q={md:{activeBg:"md:active:bg-[var(--md-button-active-bg,var(--md-button-hover-bg,var(--md-button-bg)))]",bg:"md:bg-[var(--md-button-bg)]",color:"md:text-[var(--md-button-color)]",hoverBg:"md:hover:bg-[var(--md-button-hover-bg,var(--md-button-bg))]"},lg:{activeBg:"lg:active:bg-[var(--lg-button-active-bg,var(--lg-button-hover-bg,var(--lg-button-bg)))]",bg:"lg:bg-[var(--lg-button-bg)]",color:"lg:text-[var(--lg-button-color)]",hoverBg:"lg:hover:bg-[var(--lg-button-hover-bg,var(--lg-button-bg))]"},xl:{activeBg:"xl:active:bg-[var(--xl-button-active-bg,var(--xl-button-hover-bg,var(--xl-button-bg)))]",bg:"xl:bg-[var(--xl-button-bg)]",color:"xl:text-[var(--xl-button-color)]",hoverBg:"xl:hover:bg-[var(--xl-button-hover-bg,var(--xl-button-bg))]"}},_={md:{fontSize:"md:text-[length:var(--md-button-font-size)]",fontWeight:"md:font-[var(--md-button-font-weight)]",lineHeight:"md:leading-[var(--md-button-line-height)]"},lg:{fontSize:"lg:text-[length:var(--lg-button-font-size)]",fontWeight:"lg:font-[var(--lg-button-font-weight)]",lineHeight:"lg:leading-[var(--lg-button-line-height)]"},xl:{fontSize:"xl:text-[length:var(--xl-button-font-size)]",fontWeight:"xl:font-[var(--xl-button-font-weight)]",lineHeight:"xl:leading-[var(--xl-button-line-height)]"}},yt={md:{sm:"md:[&_svg]:size-4",md:"md:[&_svg]:size-5",lg:"md:[&_svg]:size-5"},lg:{sm:"lg:[&_svg]:size-4",md:"lg:[&_svg]:size-5",lg:"lg:[&_svg]:size-5"},xl:{sm:"xl:[&_svg]:size-4",md:"xl:[&_svg]:size-5",lg:"xl:[&_svg]:size-5"}};function c(o){return String(B.normalizeCssTokenValue(o))}function zt(o){return{center:"center",end:"flex-end",start:"flex-start"}[o]}function Bt({alignContent:o,children:t,className:r,disabled:a,display:e,border:n,bg:i,color:s,cursor:l,fullWidth:v,href:C,hoverBg:A,activeBg:R,fontSize:U,fontWeight:X,isLoading:Y=!1,lineHeight:Z,minHeight:O,minWidth:tt,md:g,lg:u,xl:b,p:ot,position:nt,size:et,style:q,variant:at,width:rt,...S}){const d=a||Y,N=et??"md",j=xt({size:N,md:g,lg:u,xl:b}),$=dt({alignContent:o,md:g,lg:u,xl:b}),V=ft({variant:at??"default",md:g,lg:u,xl:b},{activeBg:R,bg:i,color:s,hoverBg:A,md:g,lg:u,xl:b}),W=mt({activeBg:R,bg:i,color:s,hoverBg:A,md:g,lg:u,xl:b}),P=ht({fontSize:U,fontWeight:X,lineHeight:Z,md:g,lg:u,xl:b}),k={...S,border:{radius:w[N],style:"none",width:"0",...n},cursor:d?"not-allowed":l??"pointer",display:e??"inline-flex",minHeight:O,minWidth:tt,md:H(g),lg:H(u),xl:H(b),p:ot??T[N].p,position:nt??{type:"relative"},width:rt??(v?"100%":void 0)},I=st.cn(K,j.className,C&&"no-underline",$.className,V.className,W.className,P.className,r),D=j.style||$.style||V.style||W.style||P.style||q?{...j.style,...$.style,...V.style,...W.style,...P.style,...q}:void 0,F=f.jsx(f.Fragment,{children:t});if(C){const M=S;return f.jsx(E.Box,{...M,...k,"aria-disabled":d||void 0,as:"a",className:I,href:d?void 0:C,style:D,tabIndex:d?-1:M.tabIndex,children:F})}const it=S;return f.jsx(E.Box,{...it,...k,as:"button",className:I,disabled:d,style:D,children:F})}exports.Button=Bt;exports.buttonSizeBorderRadius=w;exports.buttonSizeBoxProps=T;exports.buttonSizeClassNames=J;exports.buttonVariantClassNames=G;exports.buttonVariants=ct;