mhz-ui 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.
@@ -0,0 +1 @@
1
+ ._button_1r5cq_1{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;height:48px;padding:16px 32px;overflow:hidden;font-size:.875rem;line-height:1.5;color:var(--color-white);text-decoration:none;white-space:nowrap;user-select:none;background:var(--color-primary);border:2px solid var(--color-transparent);border-radius:24px;transition:all .2s}._button_1r5cq_1:hover{color:var(--color-white);cursor:pointer;background:var(--color-primary-dark);border-color:var(--color-transparent)}._button_1r5cq_1:disabled{color:var(--color-gray-dark-extra);cursor:default;background:var(--color-gray-light-extra)}._button_1r5cq_1[data-layout=secondary]{color:var(--color-primary);background-color:var(--color-white);border-color:var(--color-primary)}._button_1r5cq_1[data-layout=secondary]:hover{color:var(--color-primary-dark);border-color:var(--color-primary-dark)}._button_1r5cq_1[data-layout=secondary]:disabled{color:var(--color-gray-dark-extra);background:var(--color-white);border-color:var(--color-gray-light-extra)}
@@ -0,0 +1,36 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ layout: {
3
+ type: import("vue").PropType<"primary" | "secondary">;
4
+ default: string;
5
+ };
6
+ type: {
7
+ type: import("vue").PropType<"submit" | "button">;
8
+ default: string;
9
+ };
10
+ isDisabled: {
11
+ type: import("vue").PropType<boolean>;
12
+ };
13
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
14
+ layout: {
15
+ type: import("vue").PropType<"primary" | "secondary">;
16
+ default: string;
17
+ };
18
+ type: {
19
+ type: import("vue").PropType<"submit" | "button">;
20
+ default: string;
21
+ };
22
+ isDisabled: {
23
+ type: import("vue").PropType<boolean>;
24
+ };
25
+ }>>, {
26
+ layout: "primary" | "secondary";
27
+ type: "submit" | "button";
28
+ }, {}>, {
29
+ default?(_: {}): any;
30
+ }>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,29 @@
1
+ import "./UiButton.css";
2
+ import { defineComponent as s, openBlock as a, createElementBlock as n, normalizeClass as l, renderSlot as u } from "vue";
3
+ import { _ as r } from "../_plugin-vue_export-helper-dad06003.js";
4
+ const c = ["data-layout", "type", "disabled"], d = /* @__PURE__ */ s({
5
+ __name: "UiButton",
6
+ props: {
7
+ layout: { default: "primary" },
8
+ type: { default: "button" },
9
+ isDisabled: { type: Boolean }
10
+ },
11
+ setup(e) {
12
+ const t = e;
13
+ return (o, y) => (a(), n("button", {
14
+ class: l(o.$style.button),
15
+ "data-layout": t.layout,
16
+ type: t.type,
17
+ disabled: t.isDisabled
18
+ }, [
19
+ u(o.$slots, "default")
20
+ ], 10, c));
21
+ }
22
+ }), p = "_button_1r5cq_1", i = {
23
+ button: p
24
+ }, _ = {
25
+ $style: i
26
+ }, f = /* @__PURE__ */ r(d, [["__cssModules", _]]);
27
+ export {
28
+ f as default
29
+ };
@@ -0,0 +1 @@
1
+ ._field_jh7jr_1{display:flex;flex-direction:column;flex-grow:1;gap:4px;width:100%}._error_jh7jr_9{color:var(--color-error-dark)}
@@ -0,0 +1,29 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ label: {
3
+ type: import("vue").PropType<string>;
4
+ };
5
+ error: {
6
+ type: import("vue").PropType<string | false>;
7
+ };
8
+ isRequired: {
9
+ type: import("vue").PropType<boolean>;
10
+ };
11
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
+ label: {
13
+ type: import("vue").PropType<string>;
14
+ };
15
+ error: {
16
+ type: import("vue").PropType<string | false>;
17
+ };
18
+ isRequired: {
19
+ type: import("vue").PropType<boolean>;
20
+ };
21
+ }>>, {}, {}>, {
22
+ default?(_: {}): any;
23
+ }>;
24
+ export default _default;
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,39 @@
1
+ import "./UiField.css";
2
+ import { defineComponent as i, openBlock as l, createElementBlock as t, normalizeClass as o, createElementVNode as s, toDisplayString as n, createCommentVNode as c, renderSlot as d, withDirectives as p, vShow as _ } from "vue";
3
+ import { _ as m } from "../_plugin-vue_export-helper-dad06003.js";
4
+ const u = /* @__PURE__ */ i({
5
+ __name: "UiField",
6
+ props: {
7
+ label: {},
8
+ error: { type: [String, Boolean] },
9
+ isRequired: { type: Boolean }
10
+ },
11
+ setup(a) {
12
+ const e = a;
13
+ return (r, j) => (l(), t("label", {
14
+ class: o(r.$style.field)
15
+ }, [
16
+ s("span", null, [
17
+ s("span", null, n(e.label), 1),
18
+ e.isRequired ? (l(), t("span", {
19
+ key: 0,
20
+ class: o(r.$style.error)
21
+ }, "*", 2)) : c("", !0)
22
+ ]),
23
+ d(r.$slots, "default"),
24
+ p(s("div", {
25
+ class: o(r.$style.error)
26
+ }, n(e.error), 3), [
27
+ [_, !!e.error]
28
+ ])
29
+ ], 2));
30
+ }
31
+ }), f = "_field_jh7jr_1", y = "_error_jh7jr_9", h = {
32
+ field: f,
33
+ error: y
34
+ }, $ = {
35
+ $style: h
36
+ }, b = /* @__PURE__ */ m(u, [["__cssModules", $]]);
37
+ export {
38
+ b as default
39
+ };
@@ -0,0 +1 @@
1
+ ._inputBlock_1dmz1_1{position:relative;width:100%}._input_1dmz1_1{width:100%;height:48px;padding:0 24px;font-size:1rem;border:1px solid var(--color-gray);border-radius:24px;outline:none}._input_1dmz1_1:hover{border:1px solid var(--color-gray-dark-extra)}._input_1dmz1_1:focus{border:1px solid var(--color-primary)}._input_1dmz1_1:disabled{color:var(--color-gray-dark-extra);background:var(--color-gray-light-extra);border-color:var(--color-transparent)}._input_1dmz1_1::placeholder{color:var(--color-gray-dark-extra)}
@@ -0,0 +1,20 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ modelValue: {
3
+ type: import("vue").PropType<string | number | null>;
4
+ required: true;
5
+ };
6
+ isDisabled: {
7
+ type: import("vue").PropType<boolean>;
8
+ };
9
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
10
+ modelValue: {
11
+ type: import("vue").PropType<string | number | null>;
12
+ required: true;
13
+ };
14
+ isDisabled: {
15
+ type: import("vue").PropType<boolean>;
16
+ };
17
+ }>> & {
18
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
19
+ }, {}, {}>;
20
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import "./UiInput.css";
2
+ import { defineComponent as p, openBlock as a, createElementBlock as i, normalizeClass as d, createElementVNode as c, mergeProps as r } from "vue";
3
+ import { _ as m } from "../_plugin-vue_export-helper-dad06003.js";
4
+ const _ = ["value", "disabled"], f = /* @__PURE__ */ p({
5
+ __name: "UiInput",
6
+ props: {
7
+ modelValue: {},
8
+ isDisabled: { type: Boolean }
9
+ },
10
+ emits: ["update:modelValue"],
11
+ setup(o, { emit: l }) {
12
+ const t = o;
13
+ function n(e) {
14
+ l("update:modelValue", e.value);
15
+ }
16
+ return (e, s) => (a(), i("div", {
17
+ class: d(e.$style.inputBlock)
18
+ }, [
19
+ c("input", r({
20
+ value: t.modelValue,
21
+ onInput: s[0] || (s[0] = (u) => n(u.target)),
22
+ disabled: t.isDisabled,
23
+ class: e.$style.input
24
+ }, e.$attrs), null, 16, _)
25
+ ], 2));
26
+ }
27
+ }), B = "_inputBlock_1dmz1_1", k = "_input_1dmz1_1", y = {
28
+ inputBlock: B,
29
+ input: k
30
+ }, V = {
31
+ $style: y
32
+ }, I = /* @__PURE__ */ m(f, [["__cssModules", V]]);
33
+ export {
34
+ I as default
35
+ };
@@ -0,0 +1,9 @@
1
+ const s = (t, r) => {
2
+ const o = t.__vccOpts || t;
3
+ for (const [c, e] of r)
4
+ o[c] = e;
5
+ return o;
6
+ };
7
+ export {
8
+ s as _
9
+ };
package/dist/base.scss ADDED
@@ -0,0 +1,52 @@
1
+ * {
2
+ box-sizing: border-box;
3
+
4
+ &::selection {
5
+ color: var(--color-white);
6
+ background-color: var(--color-primary-dark);
7
+ }
8
+ }
9
+
10
+ body {
11
+ padding: 0;
12
+ margin: 0;
13
+ font-size: 1rem;
14
+ line-height: 1.5;
15
+ }
16
+
17
+ a {
18
+ color: var(--color-primary);
19
+
20
+ &:hover {
21
+ color: var(--color-primary-dark);
22
+ }
23
+ }
24
+
25
+ h1,
26
+ h2,
27
+ h3 {
28
+ margin: 24px 0;
29
+ font-weight: 700;
30
+ line-height: 1.2;
31
+ }
32
+
33
+ section {
34
+ margin: 0;
35
+ }
36
+
37
+ section + section {
38
+ margin: 64px 0;
39
+ }
40
+
41
+ p {
42
+ margin: 0;
43
+ }
44
+
45
+ p + p {
46
+ margin: 12px 0;
47
+ }
48
+
49
+ ul {
50
+ padding-left: 20px;
51
+ margin: 0;
52
+ }
@@ -0,0 +1,3 @@
1
+ $mobile: 641px;
2
+ $tablet: 980px;
3
+ $notebook: 1220px;
@@ -0,0 +1,24 @@
1
+ :root {
2
+ --color-primary-dark: #0f67a7;
3
+ --color-primary: #2593e3;
4
+ --color-primary-light: #9fd7ff;
5
+ --color-primary-light-extra: #e3f3ff;
6
+
7
+ --color-success-dark: #01b028;
8
+ --color-success: #aeffc0;
9
+ --color-success-light: #e2ffe9;
10
+
11
+ --color-error-dark: #d40019;
12
+ --color-error: #ffc6cc;
13
+ --color-error-light: #fdeef0;
14
+
15
+ --color-black: #000;
16
+ --color-white: #fff;
17
+ --color-transparent: rgba(0, 0, 0, 0);
18
+
19
+ --color-gray-dark-extra: #a6a6a6;
20
+ --color-gray-dark: #bcbcbc;
21
+ --color-gray: #dfdfdf;
22
+ --color-gray-light: #f4f4f4;
23
+ --color-gray-light-extra: #f9f8f8;
24
+ }
@@ -0,0 +1,13 @@
1
+ @font-face {
2
+ font-family: 'base';
3
+ font-weight: 400;
4
+ src: url('/fonts/400.woff2') format('woff2');
5
+ font-display: swap;
6
+ }
7
+
8
+ @font-face {
9
+ font-family: 'base';
10
+ font-weight: 700;
11
+ src: url('/fonts/700.woff2') format('woff2');
12
+ font-display: swap;
13
+ }
@@ -0,0 +1,3 @@
1
+ export { default as UiButton } from './UiButton/UiButton';
2
+ export { default as UiField } from './UiField/UiField';
3
+ export { default as UiInput } from './UiInput/UiInput';
package/dist/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { default as UiButton } from './UiButton/UiButton.js';
2
+ export { default as UiField } from './UiField/UiField.js';
3
+ export { default as UiInput } from './UiInput/UiInput.js';
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "mhz-ui",
3
+ "version": "0.0.1",
4
+ "description": "mhz-ui",
5
+ "author": "dergunov.com",
6
+ "license": "ISC",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "files": [
12
+ "dist/*"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/dergunovs/mhz",
17
+ "directory": "packages/ui"
18
+ },
19
+ "scripts": {
20
+ "build": "vite build",
21
+ "build:storybook": "storybook build",
22
+ "dev": "storybook dev -p 6006 --no-open",
23
+ "lint": "eslint **/*.{js,ts,vue} && stylelint src/**/*.{scss,vue}",
24
+ "ts": "vue-tsc --noEmit"
25
+ },
26
+ "dependencies": {
27
+ "vue": "3.3.4"
28
+ },
29
+ "devDependencies": {
30
+ "@storybook/addon-essentials": "7.1.0",
31
+ "@storybook/addon-interactions": "7.1.0",
32
+ "@storybook/addon-links": "7.1.0",
33
+ "@storybook/blocks": "7.1.0",
34
+ "@storybook/core-events": "7.1.0",
35
+ "@storybook/preview-api": "7.1.0",
36
+ "@storybook/vue3": "7.1.0",
37
+ "@storybook/vue3-vite": "7.1.0",
38
+ "@types/node": "20.4.4",
39
+ "@typescript-eslint/eslint-plugin": "6.1.0",
40
+ "@typescript-eslint/parser": "6.1.0",
41
+ "@vitejs/plugin-vue": "4.2.3",
42
+ "eslint": "8.45.0",
43
+ "eslint-config-prettier": "8.8.0",
44
+ "eslint-import-resolver-typescript": "3.5.5",
45
+ "eslint-plugin-import": "2.27.5",
46
+ "eslint-plugin-prettier": "5.0.0",
47
+ "eslint-plugin-vue": "9.15.1",
48
+ "postcss-html": "1.5.0",
49
+ "postcss-scss": "4.0.6",
50
+ "prettier": "3.0.0",
51
+ "react": "18.2.0",
52
+ "react-dom": "18.2.0",
53
+ "sass": "1.64.1",
54
+ "storybook": "7.1.0",
55
+ "stylelint": "15.10.2",
56
+ "stylelint-config-recess-order": "4.3.0",
57
+ "stylelint-config-recommended-scss": "12.0.0",
58
+ "stylelint-config-recommended-vue": "1.5.0",
59
+ "stylelint-prettier": "4.0.0",
60
+ "typescript": "5.1.6",
61
+ "vite": "4.4.6",
62
+ "vite-plugin-dts": "3.3.1",
63
+ "vite-plugin-static-copy": "0.17.0",
64
+ "vite-svg-loader": "4.0.0",
65
+ "vue-linters-config": "0.1.6",
66
+ "vue-tsc": "1.8.6"
67
+ },
68
+ "peerDependencies": {
69
+ "vue": "3.3.4"
70
+ },
71
+ "engines": {
72
+ "node": "18"
73
+ }
74
+ }