mbt-ui-kit 0.1.12 → 0.1.13
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Input component props
|
|
4
4
|
*
|
|
@@ -96,5 +96,5 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
96
96
|
* />
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
|
-
export declare
|
|
99
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
100
100
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,CACP;IACC;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,KAAK,yGA4DjB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./tokens-Bcuwagjb.cjs"),t=require("react/jsx-runtime");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./tokens-Bcuwagjb.cjs"),t=require("react/jsx-runtime"),_=require("react");function f({size:e="md",className:s,...n}){const o=["mbt-loader",`mbt-loader--${e}`,s].filter(Boolean).join(" ");return t.jsxs("span",{className:o,...n,children:[t.jsx("span",{className:"mbt-loader__dot"}),t.jsx("span",{className:"mbt-loader__dot"}),t.jsx("span",{className:"mbt-loader__dot"})]})}function N({children:e,fullWidth:s,disabled:n,loading:o,variant:a="primary",className:r,...l}){const c=n||o,u=["mbt-button",a&&`mbt-button--${a}`,s&&"mbt-button--full-width",n&&"mbt-button--disabled",o&&"mbt-button--loading",r].filter(Boolean).join(" ");return t.jsxs("button",{type:"button",className:u,disabled:c,...l,children:[t.jsx("span",{className:"mbt-button__content",children:e}),o&&t.jsx(f,{size:"md",className:"mbt-button__loader"})]})}function p({className:e}){return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[t.jsx("circle",{cx:"11",cy:"11",r:"8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"m21 21-4.34-4.34",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}const k=_.forwardRef(({label:e,muted:s=!1,showSearchIcon:n=!1,icon:o,fullWidth:a=!1,className:r,...l},c)=>{const u=["mbt-input",a&&"mbt-input--full-width",r].filter(Boolean).join(" "),m=["mbt-input__label",s&&"mbt-input__label--muted"].filter(Boolean).join(" "),d=["mbt-input__wrapper",s&&"mbt-input__wrapper--muted"].filter(Boolean).join(" "),x=["mbt-input__field",s&&"mbt-input__field--muted"].filter(Boolean).join(" "),h=["mbt-input__icon",s&&"mbt-input__icon--muted"].filter(Boolean).join(" "),b=o||n&&t.jsx(p,{});return t.jsx("div",{className:u,children:t.jsxs("div",{className:"mbt-input__container",children:[e&&t.jsx("label",{className:m,children:e}),t.jsxs("div",{className:d,children:[t.jsx("input",{ref:c,type:"text",className:x,...l}),b&&t.jsx("div",{className:h,children:b})]})]})})});function g({level:e,children:s,className:n,...o}){const a=`h${e}`,r=[`mbt-h${e}`,n].filter(Boolean).join(" ");return t.jsx(a,{className:r,...o,children:s})}function w({children:e,strong:s=!1,small:n=!1,label:o=!1,muted:a=!1,disableFontFeatures:r=!1,as:l="p",className:c,...u}){const m=l,d=["mbt-text",s&&"mbt-text--strong",n&&"mbt-text--small",o&&"mbt-text--label",a&&"mbt-text--muted",r&&"mbt-text--no-features",c].filter(Boolean).join(" ");return t.jsx(m,{className:d,...u,children:e})}function B({children:e,large:s=!1,muted:n=!1,as:o="div",className:a,...r}){const l=o,c=["mbt-metric",s&&"mbt-metric--large",n&&"mbt-metric--muted",a].filter(Boolean).join(" ");return t.jsx(l,{className:c,...r,children:e})}function j({className:e}){return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[t.jsx("path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M22 10v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function L({children:e,icon:s,selected:n=!1,small:o=!1,disabled:a,className:r,...l}){const c=["mbt-menu-button",n&&"mbt-menu-button--selected",o&&"mbt-menu-button--small",r].filter(Boolean).join(" "),u=s??t.jsx(j,{});return t.jsxs("button",{type:"button",className:c,disabled:a,"aria-pressed":n,...l,children:[t.jsx("div",{className:"mbt-menu-button__icon",children:u}),t.jsx("span",{className:"mbt-menu-button__text",children:e})]})}exports.colors=i.colors;exports.fontFeatures=i.fontFeatures;exports.fontSizes=i.fontSizes;exports.fontWeights=i.fontWeights;exports.fonts=i.fonts;exports.radius=i.radius;exports.spacing=i.spacing;exports.tokens=i.tokens;exports.transitions=i.transitions;exports.zIndex=i.zIndex;exports.Button=N;exports.GraduationCapIcon=j;exports.Heading=g;exports.Input=k;exports.Loader=f;exports.MenuButton=L;exports.Metric=B;exports.SearchIcon=p;exports.Text=w;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as W, f as z, a as M, b as T, d as $, r as S, s as D, t as F, e as G, z as H } from "./tokens-Bxhg1IBs.js";
|
|
2
2
|
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
import { forwardRef as h } from "react";
|
|
4
|
+
function _({ size: e = "md", className: n, ...s }) {
|
|
4
5
|
const o = [
|
|
5
6
|
"mbt-loader",
|
|
6
7
|
`mbt-loader--${e}`,
|
|
@@ -12,7 +13,7 @@ function f({ size: e = "md", className: n, ...s }) {
|
|
|
12
13
|
/* @__PURE__ */ t("span", { className: "mbt-loader__dot" })
|
|
13
14
|
] });
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function w({
|
|
16
17
|
children: e,
|
|
17
18
|
fullWidth: n,
|
|
18
19
|
disabled: s,
|
|
@@ -38,12 +39,12 @@ function k({
|
|
|
38
39
|
...i,
|
|
39
40
|
children: [
|
|
40
41
|
/* @__PURE__ */ t("span", { className: "mbt-button__content", children: e }),
|
|
41
|
-
o && /* @__PURE__ */ t(
|
|
42
|
+
o && /* @__PURE__ */ t(_, { size: "md", className: "mbt-button__loader" })
|
|
42
43
|
]
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function N({ className: e }) {
|
|
47
48
|
return /* @__PURE__ */ c(
|
|
48
49
|
"svg",
|
|
49
50
|
{
|
|
@@ -80,41 +81,40 @@ function h({ className: e }) {
|
|
|
80
81
|
}
|
|
81
82
|
);
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"mbt-input__icon",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
function j({
|
|
84
|
+
const g = h(
|
|
85
|
+
({
|
|
86
|
+
label: e,
|
|
87
|
+
muted: n = !1,
|
|
88
|
+
showSearchIcon: s = !1,
|
|
89
|
+
icon: o,
|
|
90
|
+
fullWidth: a = !1,
|
|
91
|
+
className: r,
|
|
92
|
+
...i
|
|
93
|
+
}, l) => {
|
|
94
|
+
const m = [
|
|
95
|
+
"mbt-input",
|
|
96
|
+
a && "mbt-input--full-width",
|
|
97
|
+
r
|
|
98
|
+
].filter(Boolean).join(" "), u = [
|
|
99
|
+
"mbt-input__label",
|
|
100
|
+
n && "mbt-input__label--muted"
|
|
101
|
+
].filter(Boolean).join(" "), d = [
|
|
102
|
+
"mbt-input__wrapper",
|
|
103
|
+
n && "mbt-input__wrapper--muted"
|
|
104
|
+
].filter(Boolean).join(" "), p = [
|
|
105
|
+
"mbt-input__field",
|
|
106
|
+
n && "mbt-input__field--muted"
|
|
107
|
+
].filter(Boolean).join(" "), f = ["mbt-input__icon", n && "mbt-input__icon--muted"].filter(Boolean).join(" "), b = o || s && /* @__PURE__ */ t(N, {});
|
|
108
|
+
return /* @__PURE__ */ t("div", { className: m, children: /* @__PURE__ */ c("div", { className: "mbt-input__container", children: [
|
|
109
|
+
e && /* @__PURE__ */ t("label", { className: u, children: e }),
|
|
110
|
+
/* @__PURE__ */ c("div", { className: d, children: [
|
|
111
|
+
/* @__PURE__ */ t("input", { ref: l, type: "text", className: p, ...i }),
|
|
112
|
+
b && /* @__PURE__ */ t("div", { className: f, children: b })
|
|
113
|
+
] })
|
|
114
|
+
] }) });
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
function B({
|
|
118
118
|
level: e,
|
|
119
119
|
children: n,
|
|
120
120
|
className: s,
|
|
@@ -123,7 +123,7 @@ function j({
|
|
|
123
123
|
const a = `h${e}`, r = [`mbt-h${e}`, s].filter(Boolean).join(" ");
|
|
124
124
|
return /* @__PURE__ */ t(a, { className: r, ...o, children: n });
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function L({
|
|
127
127
|
children: e,
|
|
128
128
|
strong: n = !1,
|
|
129
129
|
small: s = !1,
|
|
@@ -145,7 +145,7 @@ function w({
|
|
|
145
145
|
].filter(Boolean).join(" ");
|
|
146
146
|
return /* @__PURE__ */ t(u, { className: d, ...m, children: e });
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function v({
|
|
149
149
|
children: e,
|
|
150
150
|
large: n = !1,
|
|
151
151
|
muted: s = !1,
|
|
@@ -161,7 +161,7 @@ function g({
|
|
|
161
161
|
].filter(Boolean).join(" ");
|
|
162
162
|
return /* @__PURE__ */ t(i, { className: l, ...r, children: e });
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function k({ className: e }) {
|
|
165
165
|
return /* @__PURE__ */ c(
|
|
166
166
|
"svg",
|
|
167
167
|
{
|
|
@@ -206,7 +206,7 @@ function _({ className: e }) {
|
|
|
206
206
|
}
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function C({
|
|
210
210
|
children: e,
|
|
211
211
|
icon: n,
|
|
212
212
|
selected: s = !1,
|
|
@@ -230,30 +230,30 @@ function B({
|
|
|
230
230
|
"aria-pressed": s,
|
|
231
231
|
...i,
|
|
232
232
|
children: [
|
|
233
|
-
/* @__PURE__ */ t("div", { className: "mbt-menu-button__icon", children: n ?? /* @__PURE__ */ t(
|
|
233
|
+
/* @__PURE__ */ t("div", { className: "mbt-menu-button__icon", children: n ?? /* @__PURE__ */ t(k, {}) }),
|
|
234
234
|
/* @__PURE__ */ t("span", { className: "mbt-menu-button__text", children: e })
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
239
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
240
|
+
w as Button,
|
|
241
|
+
k as GraduationCapIcon,
|
|
242
|
+
B as Heading,
|
|
243
|
+
g as Input,
|
|
244
|
+
_ as Loader,
|
|
245
|
+
C as MenuButton,
|
|
246
|
+
v as Metric,
|
|
247
|
+
N as SearchIcon,
|
|
248
|
+
L as Text,
|
|
249
|
+
W as colors,
|
|
250
|
+
z as fontFeatures,
|
|
251
|
+
M as fontSizes,
|
|
252
|
+
T as fontWeights,
|
|
253
|
+
$ as fonts,
|
|
254
|
+
S as radius,
|
|
255
|
+
D as spacing,
|
|
256
|
+
F as tokens,
|
|
257
|
+
G as transitions,
|
|
258
|
+
H as zIndex
|
|
259
259
|
};
|