mbt-ui-kit 0.1.5 → 0.1.7
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.
|
@@ -26,6 +26,20 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
fullWidth?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Скругление всех углов кнопки
|
|
31
|
+
*
|
|
32
|
+
* По умолчанию true - все углы скруглены.
|
|
33
|
+
* При false - диагональное скругление (только top-right и bottom-left).
|
|
34
|
+
*
|
|
35
|
+
* @default true
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <Button rounded={false}>Diagonal Corners</Button>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
rounded?: boolean;
|
|
29
43
|
}
|
|
30
44
|
/**
|
|
31
45
|
* Button — компонент кнопки с тремя состояниями (default, hover, disabled)
|
|
@@ -50,5 +64,5 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
50
64
|
* <Button onClick={() => console.log('Clicked!')}>Click Me</Button>
|
|
51
65
|
* ```
|
|
52
66
|
*/
|
|
53
|
-
export declare function Button({ children, fullWidth, disabled, className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export declare function Button({ children, fullWidth, rounded, disabled, className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
54
68
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,OAAc,EACd,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,2CAgBb"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./tokens-Buhra6sa.cjs"),t=require("react/jsx-runtime");function j({children:e,fullWidth:n,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./tokens-Buhra6sa.cjs"),t=require("react/jsx-runtime");function j({children:e,fullWidth:n,rounded:s=!0,disabled:o,className:i,...r}){const l=["mbt-button",n&&"mbt-button--full-width",!s&&"mbt-button--diagonal",o&&"mbt-button--disabled",i].filter(Boolean).join(" ");return t.jsx("button",{type:"button",className:l,disabled:o,...r,children:e})}function f({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"})]})}function h({label:e,muted:n=!1,showSearchIcon:s=!1,icon:o,fullWidth:i=!1,className:r,...l}){const c=["mbt-input",i&&"mbt-input--full-width",r].filter(Boolean).join(" "),u=["mbt-input__label",n&&"mbt-input__label--muted"].filter(Boolean).join(" "),m=["mbt-input__wrapper",n&&"mbt-input__wrapper--muted"].filter(Boolean).join(" "),d=["mbt-input__field",n&&"mbt-input__field--muted"].filter(Boolean).join(" "),x=["mbt-input__icon",n&&"mbt-input__icon--muted"].filter(Boolean).join(" "),b=o||s&&t.jsx(f,{});return t.jsx("div",{className:c,children:t.jsxs("div",{className:"mbt-input__container",children:[e&&t.jsx("label",{className:u,children:e}),t.jsxs("div",{className:m,children:[t.jsx("input",{type:"text",className:d,...l}),b&&t.jsx("div",{className:x,children:b})]})]})})}function k({level:e,children:n,className:s,...o}){const i=`h${e}`,r=[`mbt-h${e}`,s].filter(Boolean).join(" ");return t.jsx(i,{className:r,...o,children:n})}function g({children:e,strong:n=!1,small:s=!1,label:o=!1,muted:i=!1,disableFontFeatures:r=!1,as:l="p",className:c,...u}){const m=l,d=["mbt-text",n&&"mbt-text--strong",s&&"mbt-text--small",o&&"mbt-text--label",i&&"mbt-text--muted",r&&"mbt-text--no-features",c].filter(Boolean).join(" ");return t.jsx(m,{className:d,...u,children:e})}function _({children:e,large:n=!1,muted:s=!1,as:o="div",className:i,...r}){const l=o,c=["mbt-metric",n&&"mbt-metric--large",s&&"mbt-metric--muted",i].filter(Boolean).join(" ");return t.jsx(l,{className:c,...r,children:e})}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("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 N({children:e,icon:n,selected:s=!1,small:o=!1,disabled:i,className:r,...l}){const c=["mbt-menu-button",s&&"mbt-menu-button--selected",o&&"mbt-menu-button--small",r].filter(Boolean).join(" "),u=n??t.jsx(p,{});return t.jsxs("button",{type:"button",className:c,disabled:i,"aria-pressed":s,...l,children:[t.jsx("div",{className:"mbt-menu-button__icon",children:u}),t.jsx("span",{className:"mbt-menu-button__text",children:e})]})}exports.colors=a.colors;exports.fontFeatures=a.fontFeatures;exports.fontSizes=a.fontSizes;exports.fontWeights=a.fontWeights;exports.fonts=a.fonts;exports.radius=a.radius;exports.spacing=a.spacing;exports.tokens=a.tokens;exports.transitions=a.transitions;exports.zIndex=a.zIndex;exports.Button=j;exports.GraduationCapIcon=p;exports.Heading=k;exports.Input=h;exports.MenuButton=N;exports.Metric=_;exports.SearchIcon=f;exports.Text=g;
|
package/dist/index.js
CHANGED
|
@@ -3,17 +3,19 @@ import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
|
3
3
|
function k({
|
|
4
4
|
children: t,
|
|
5
5
|
fullWidth: n,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
rounded: o = !0,
|
|
7
|
+
disabled: s,
|
|
8
|
+
className: a,
|
|
9
|
+
...r
|
|
9
10
|
}) {
|
|
10
|
-
const
|
|
11
|
+
const i = [
|
|
11
12
|
"mbt-button",
|
|
12
13
|
n && "mbt-button--full-width",
|
|
13
|
-
o && "mbt-button--
|
|
14
|
-
s
|
|
14
|
+
!o && "mbt-button--diagonal",
|
|
15
|
+
s && "mbt-button--disabled",
|
|
16
|
+
a
|
|
15
17
|
].filter(Boolean).join(" ");
|
|
16
|
-
return /* @__PURE__ */ e("button", { type: "button", className:
|
|
18
|
+
return /* @__PURE__ */ e("button", { type: "button", className: i, disabled: s, ...r, children: t });
|
|
17
19
|
}
|
|
18
20
|
function p({ className: t }) {
|
|
19
21
|
return /* @__PURE__ */ c(
|
|
@@ -95,7 +97,7 @@ function N({
|
|
|
95
97
|
const a = `h${t}`, r = [`mbt-h${t}`, o].filter(Boolean).join(" ");
|
|
96
98
|
return /* @__PURE__ */ e(a, { className: r, ...s, children: n });
|
|
97
99
|
}
|
|
98
|
-
function
|
|
100
|
+
function g({
|
|
99
101
|
children: t,
|
|
100
102
|
strong: n = !1,
|
|
101
103
|
small: o = !1,
|
|
@@ -117,7 +119,7 @@ function j({
|
|
|
117
119
|
].filter(Boolean).join(" ");
|
|
118
120
|
return /* @__PURE__ */ e(m, { className: d, ...u, children: t });
|
|
119
121
|
}
|
|
120
|
-
function
|
|
122
|
+
function j({
|
|
121
123
|
children: t,
|
|
122
124
|
large: n = !1,
|
|
123
125
|
muted: o = !1,
|
|
@@ -178,7 +180,7 @@ function h({ className: t }) {
|
|
|
178
180
|
}
|
|
179
181
|
);
|
|
180
182
|
}
|
|
181
|
-
function
|
|
183
|
+
function w({
|
|
182
184
|
children: t,
|
|
183
185
|
icon: n,
|
|
184
186
|
selected: o = !1,
|
|
@@ -213,10 +215,10 @@ export {
|
|
|
213
215
|
h as GraduationCapIcon,
|
|
214
216
|
N as Heading,
|
|
215
217
|
x as Input,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
w as MenuButton,
|
|
219
|
+
j as Metric,
|
|
218
220
|
p as SearchIcon,
|
|
219
|
-
|
|
221
|
+
g as Text,
|
|
220
222
|
L as colors,
|
|
221
223
|
C as fontFeatures,
|
|
222
224
|
y as fontSizes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap";@import"https://rsms.me/inter/inter.css";.mbt-button{appearance:none;border:none;background:none;cursor:pointer;outline:none;display:inline-flex;align-items:center;justify-content:center;padding:8px 16px;border-radius:0 8px
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap";@import"https://rsms.me/inter/inter.css";.mbt-button{appearance:none;border:none;background:none;cursor:pointer;outline:none;display:inline-flex;align-items:center;justify-content:center;padding:8px 16px;border-radius:8px}.mbt-button--diagonal{border-radius:0 8px}.mbt-button{font-family:IBM Plex Sans,sans-serif;font-size:16px;font-weight:500;line-height:normal;text-transform:uppercase;text-align:center;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background-color .15s ease,color .15s ease;background-color:#f2f4fa;color:#0b0e14}.mbt-button:hover{color:#6663fd}.mbt-button:active{opacity:.9}.mbt-button:focus-visible{box-shadow:0 0 0 2px #0b0e14,0 0 0 4px #6663fd}.mbt-button:disabled,.mbt-button--disabled{background-color:#474953;color:#8b92a6;cursor:not-allowed;pointer-events:none}.mbt-button--full-width{width:100%}.mbt-input__container{display:flex;flex-direction:column;gap:10px;width:100%;max-width:296px}.mbt-input__label{font-family:Inter,sans-serif;font-size:16px;font-weight:400;line-height:1;color:#f2f4fa;margin:0;font-feature-settings:"ss01" 1,"salt" 1,"ss02" 1}.mbt-input__label--muted{color:#8b92a6}.mbt-input__wrapper{position:relative;display:flex;align-items:center;width:100%;border:1px solid #F2F4FA;border-radius:8px;padding:8px 16px;background-color:transparent;transition:border-color .15s ease}.mbt-input__wrapper--muted{border-color:#8b92a6}.mbt-input__wrapper:focus-within{border-color:#6663fd}.mbt-input__field{flex:1;appearance:none;border:none;background:none;outline:none;font-family:Inter,sans-serif;font-size:16px;font-weight:400;line-height:1;color:#f2f4fa;font-feature-settings:"ss01" 1,"salt" 1,"ss02" 1}.mbt-input__field::placeholder{color:#f2f4fa}.mbt-input__field--muted{color:#8b92a6}.mbt-input__field--muted::placeholder{color:#8b92a6}.mbt-input__icon{flex-shrink:0;width:24px;height:24px;margin-left:8px;color:#f2f4fa}.mbt-input__icon--muted{color:#8b92a6}.mbt-input--full-width .mbt-input__container{max-width:none}.mbt-h1{font-family:IBM Plex Sans,sans-serif;font-size:72px;font-weight:600;line-height:80px;color:#f2f4fa;margin:0}.mbt-h2{font-family:IBM Plex Sans,sans-serif;font-size:40px;font-weight:600;line-height:48px;color:#f2f4fa;margin:0}.mbt-h3{font-family:IBM Plex Sans,sans-serif;font-size:28px;font-weight:500;line-height:36px;color:#f2f4fa;margin:0}.mbt-h4{font-family:IBM Plex Sans,sans-serif;font-size:20px;font-weight:500;line-height:28px;color:#f2f4fa;margin:0}.mbt-h5{font-family:IBM Plex Sans,sans-serif;font-size:16px;font-weight:500;line-height:24px;color:#f2f4fa;margin:0}.mbt-text{font-family:Inter,sans-serif;font-size:16px;font-weight:400;line-height:1;color:#f2f4fa;margin:0;font-feature-settings:"salt" on,"ss01" on,"ss02" on}.mbt-text--strong{font-weight:500}.mbt-text--small{font-size:12px;line-height:18px}.mbt-text--label{font-size:12px;text-transform:uppercase}.mbt-text--muted{color:#8b92a6}.mbt-text--no-features{font-feature-settings:normal}.mbt-metric{font-family:IBM Plex Mono,monospace;font-size:16px;font-weight:400;line-height:1;color:#f2f4fa;margin:0}.mbt-metric--large{font-size:24px;font-weight:500;line-height:32px}.mbt-metric--muted{color:#8b92a6}.mbt-menu-button{appearance:none;border:none;background:none;cursor:pointer;outline:none;display:flex;align-items:center;width:248px;height:44px;padding:4px 12px;gap:8px;font-family:IBM Plex Sans,sans-serif;font-size:16px;font-weight:500;line-height:24px;color:#f2f4fa;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:8px;transition:background-color .15s ease,color .15s ease}.mbt-menu-button__icon{flex-shrink:0;width:24px;height:24px;color:#f2f4fa;transition:color .15s ease}.mbt-menu-button__text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.mbt-menu-button:hover:not(:disabled):not(.mbt-menu-button--selected){background-color:#2a3148;color:#3078ff}.mbt-menu-button:hover:not(:disabled):not(.mbt-menu-button--selected) .mbt-menu-button__icon{color:#3078ff}.mbt-menu-button--selected{background-color:#1d2335;color:#6663fd}.mbt-menu-button--selected .mbt-menu-button__icon{color:#6663fd}.mbt-menu-button--small{padding:4px 8px;height:32px;gap:8px;font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:18px}.mbt-menu-button--small .mbt-menu-button__icon{width:20px;height:20px}.mbt-menu-button:disabled{color:#8b92a6;cursor:not-allowed;pointer-events:none}.mbt-menu-button:disabled .mbt-menu-button__icon{color:#8b92a6}*,*:before,*:after{box-sizing:border-box}:root{--mbt-color-bg-0: #0b0e14;--mbt-color-bg-1: #111520;--mbt-color-surface: #171c2a;--mbt-color-surface-raised: #1d2335;--mbt-color-text-primary: #f2f4fa;--mbt-color-text-muted: #8b92a6;--mbt-color-text-inverse: #0b0e14;--mbt-color-primary: #6663fd;--mbt-color-secondary: #4fa3b3;--mbt-color-gray: #474953;--mbt-color-border: #2a3148;--mbt-color-success: #4dba8a;--mbt-color-error: #c9636a;--mbt-color-warning: #d1a64a;--mbt-color-diamond: #e6f3ff;--mbt-color-diamond-stop-0: #beacd3;--mbt-color-diamond-stop-1: #bee3f7;--mbt-color-diamond-stop-2: #efece7;--mbt-color-diamond-stop-3: #f8ddde;--mbt-color-diamond-stop-4: #cfe6f1;--mbt-font-primary: "IBM Plex Sans", sans-serif;--mbt-font-secondary: "Inter", sans-serif;--mbt-font-mono: "IBM Plex Mono", monospace;--mbt-font-size-1: 12px;--mbt-font-size-2: 14px;--mbt-font-size-3: 16px;--mbt-font-size-4: 20px;--mbt-font-size-5: 24px;--mbt-font-size-6: 28px;--mbt-font-size-7: 40px;--mbt-font-size-8: 48px;--mbt-font-size-9: 72px;--mbt-font-weight-regular: 400;--mbt-font-weight-medium: 500;--mbt-font-weight-semibold: 600;--mbt-font-feature-inter-stylistic: "salt" on, "ss01" on, "ss02" on;--mbt-space-0: 0;--mbt-space-1: 4px;--mbt-space-2: 8px;--mbt-space-3: 12px;--mbt-space-4: 16px;--mbt-space-5: 24px;--mbt-space-6: 32px;--mbt-space-7: 48px;--mbt-space-8: 64px;--mbt-space-9: 96px;--mbt-space-10: 128px;--mbt-radius-0: 0;--mbt-radius-xs: 4px;--mbt-radius-sm: 8px;--mbt-radius-md: 12px;--mbt-radius-lg: 16px;--mbt-radius-xl: 24px;--mbt-radius-full: 999px;--mbt-z-index-0: 0;--mbt-z-index-1: 100;--mbt-z-index-2: 200;--mbt-z-index-3: 300;--mbt-z-index-4: 400;--mbt-z-index-5: 500;--mbt-transition-fast: .15s ease;--mbt-transition-normal: .25s ease;--mbt-transition-slow: .4s ease}
|
package/package.json
CHANGED