stone-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 +30 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/ui/Button.d.ts +5 -0
- package/dist/components/Button/ui/Button.types.d.ts +28 -0
- package/dist/main.d.ts +1 -0
- package/dist/stone-kit.js +99 -0
- package/dist/style.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
13
|
+
|
|
14
|
+
- Configure the top-level `parserOptions` property like this:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
export default {
|
|
18
|
+
// other rules...
|
|
19
|
+
parserOptions: {
|
|
20
|
+
ecmaVersion: 'latest',
|
|
21
|
+
sourceType: 'module',
|
|
22
|
+
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
23
|
+
tsconfigRootDir: __dirname,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
29
|
+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
30
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComponentProps } from './Button.types';
|
|
3
|
+
|
|
4
|
+
declare const Button: ({ size, pre, children, post, variant, width, additionalClass, ...props }: React.PropsWithChildren<ComponentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default Button;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type btnWidth = 'auto' | 'full';
|
|
4
|
+
export declare const BUTTON_VARIANTS: {
|
|
5
|
+
blue: string;
|
|
6
|
+
gray: string;
|
|
7
|
+
whiteStroke: string;
|
|
8
|
+
sokolniki: string;
|
|
9
|
+
black: string;
|
|
10
|
+
whiteFilled: string;
|
|
11
|
+
};
|
|
12
|
+
export type btnVariant = keyof typeof BUTTON_VARIANTS;
|
|
13
|
+
interface ButtonProps {
|
|
14
|
+
size?: string;
|
|
15
|
+
pre?: ReactNode;
|
|
16
|
+
post?: ReactNode;
|
|
17
|
+
children?: string;
|
|
18
|
+
variant?: btnVariant;
|
|
19
|
+
width?: btnWidth;
|
|
20
|
+
additionalClass?: string;
|
|
21
|
+
as?: 'button' | 'link';
|
|
22
|
+
}
|
|
23
|
+
export type ComponentProps = ButtonProps & ((React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
24
|
+
as?: 'button';
|
|
25
|
+
}) | (React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
26
|
+
as: 'link';
|
|
27
|
+
}));
|
|
28
|
+
export {};
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './components/Button';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
function d(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
var f = { exports: {} };
|
|
6
|
+
/*!
|
|
7
|
+
Copyright (c) 2018 Jed Watson.
|
|
8
|
+
Licensed under the MIT License (MIT), see
|
|
9
|
+
http://jedwatson.github.io/classnames
|
|
10
|
+
*/
|
|
11
|
+
(function(e) {
|
|
12
|
+
(function() {
|
|
13
|
+
var s = {}.hasOwnProperty;
|
|
14
|
+
function o() {
|
|
15
|
+
for (var n = "", t = 0; t < arguments.length; t++) {
|
|
16
|
+
var r = arguments[t];
|
|
17
|
+
r && (n = i(n, c(r)));
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
function c(n) {
|
|
22
|
+
if (typeof n == "string" || typeof n == "number")
|
|
23
|
+
return n;
|
|
24
|
+
if (typeof n != "object")
|
|
25
|
+
return "";
|
|
26
|
+
if (Array.isArray(n))
|
|
27
|
+
return o.apply(null, n);
|
|
28
|
+
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
29
|
+
return n.toString();
|
|
30
|
+
var t = "";
|
|
31
|
+
for (var r in n)
|
|
32
|
+
s.call(n, r) && n[r] && (t = i(t, r));
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function i(n, t) {
|
|
36
|
+
return t ? n ? n + " " + t : n + t : n;
|
|
37
|
+
}
|
|
38
|
+
e.exports ? (o.default = o, e.exports = o) : window.classNames = o;
|
|
39
|
+
})();
|
|
40
|
+
})(f);
|
|
41
|
+
var p = f.exports;
|
|
42
|
+
const h = /* @__PURE__ */ d(p), y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
43
|
+
__proto__: null
|
|
44
|
+
}, Symbol.toStringTag, { value: "Module" })), u = h.bind(y), S = ({
|
|
45
|
+
size: e = "l",
|
|
46
|
+
pre: s = !1,
|
|
47
|
+
children: o = "",
|
|
48
|
+
post: c = !1,
|
|
49
|
+
variant: i = "blue",
|
|
50
|
+
width: n = "auto",
|
|
51
|
+
additionalClass: t,
|
|
52
|
+
...r
|
|
53
|
+
}) => {
|
|
54
|
+
if (r.as === "link") {
|
|
55
|
+
const { as: $, ...b } = r;
|
|
56
|
+
return /* @__PURE__ */ l(
|
|
57
|
+
"a",
|
|
58
|
+
{
|
|
59
|
+
className: u(
|
|
60
|
+
"btnCommon",
|
|
61
|
+
`${e}-size`,
|
|
62
|
+
`${i}`,
|
|
63
|
+
{ btnCommonInline: s || c },
|
|
64
|
+
`${n}-width`,
|
|
65
|
+
`${t ?? ""}`
|
|
66
|
+
),
|
|
67
|
+
...b,
|
|
68
|
+
children: [
|
|
69
|
+
s && /* @__PURE__ */ a("span", { children: s }),
|
|
70
|
+
o,
|
|
71
|
+
c && /* @__PURE__ */ a("span", { children: c })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
const { as: j, ...m } = r;
|
|
77
|
+
return /* @__PURE__ */ l(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
className: u(
|
|
81
|
+
"btnCommon",
|
|
82
|
+
`${e}-size`,
|
|
83
|
+
`${i}`,
|
|
84
|
+
{ btnCommonInline: s || c },
|
|
85
|
+
`${n}-width`,
|
|
86
|
+
`${t ?? ""}`
|
|
87
|
+
),
|
|
88
|
+
...m,
|
|
89
|
+
children: [
|
|
90
|
+
s && /* @__PURE__ */ a("span", { children: s }),
|
|
91
|
+
o,
|
|
92
|
+
c && /* @__PURE__ */ a("span", { children: c })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
S as Button
|
|
99
|
+
};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.btnCommon{font-family:inherit;font-weight:500;display:flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;border:1px solid transparent;border-radius:48px;cursor:pointer}.btnCommon:disabled{opacity:.2}.auto-width{width:auto}.full-width{width:100%}.l-size{font-size:16px;line-height:24px;min-height:48px;padding:11px 23px;gap:8px}.m-size{font-size:14px;line-height:20px;min-height:40px;padding:9px 15px;gap:8px}.s-size{font-size:12px;line-height:16px;min-height:32px;padding:7px 11px;gap:8px}.xs-size{font-size:10px;line-height:12px;min-height:24px;padding:5px 11px;gap:4px}.blue{background:#015ff9;border:1px solid #015ff9;color:#fff}.blue:hover,.blue:focus{background:#024ac0;border:1px solid #024ac0}.blue:active{background:#0645aa;border:1px solid #0645aa}.sokolniki{background:#60663e;border:1px solid #60663e;color:#fff}.sokolniki:hover,.sokolniki:focus{background:#494f29;border:1px solid #494f29}.sokolniki:active{background:#303519;border:1px solid #303519}.black{background:#141416;border:1px solid #141416;color:#fff}.black:hover,.black:focus{background:#23262f;border:1px solid #353945}.black:active{background:#353945;border:1px solid #777e90}.gray{background:#f4f5f6;border:1px solid #f4f5f6;color:#777e90}.gray:hover,.gray:focus{background:#f4f5f6;border:1px solid #b1b5c3}.gray:active{background:#e6e8ec;border:1px solid #b1b5c3}.whiteStroke{background:#fff;border:1px solid #e6e8ec;color:#141416}.whiteStroke:hover,.whiteStroke:focus{border:1px solid #b1b5c3}.whiteStroke:active{border:1px solid #141416}.whiteFilled{background:#fff;border:1px solid #ffffff;color:#141416}.whiteFilled:hover,.whiteFilled:focus{background:#fcfcfd;border:1px solid #f4f5f6}.whiteFilled:active{background:#f4f5f6;border:1px solid #f4f5f6}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stone-kit",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"prepublishOnly": "npm run build"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"classnames": "^2.5.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@testing-library/dom": "^10.1.0",
|
|
18
|
+
"@testing-library/react": "^15.0.7",
|
|
19
|
+
"@types/node": "^20.12.12",
|
|
20
|
+
"@types/react": "^18.2.66",
|
|
21
|
+
"@types/react-dom": "^18.2.22",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
23
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
24
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
25
|
+
"c8": "^9.1.0",
|
|
26
|
+
"eslint": "^8.57.0",
|
|
27
|
+
"eslint-plugin-react": "^7.34.1",
|
|
28
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
29
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
30
|
+
"jsdom": "^24.0.0",
|
|
31
|
+
"react-test-renderer": "^18.3.1",
|
|
32
|
+
"sass": "^1.77.2",
|
|
33
|
+
"typescript": "^5.2.2",
|
|
34
|
+
"vite": "^5.2.0",
|
|
35
|
+
"vite-plugin-dts": "^3.9.1",
|
|
36
|
+
"vitest": "^1.6.0",
|
|
37
|
+
"react": "^18.2.0",
|
|
38
|
+
"react-dom": "^18.2.0"
|
|
39
|
+
},
|
|
40
|
+
"main": "dist/main.ts",
|
|
41
|
+
"types": "dist/main.d.ts",
|
|
42
|
+
"files": [
|
|
43
|
+
"dist"
|
|
44
|
+
],
|
|
45
|
+
"description": "This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.",
|
|
46
|
+
"directories": {
|
|
47
|
+
"lib": "lib"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/Mollycodd1e/viteKit.git"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"kit",
|
|
55
|
+
"stone",
|
|
56
|
+
"ui"
|
|
57
|
+
],
|
|
58
|
+
"author": "Mollycodd1e",
|
|
59
|
+
"license": "ISC",
|
|
60
|
+
"bugs": {
|
|
61
|
+
"url": "https://github.com/Mollycodd1e/viteKit/issues"
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://github.com/Mollycodd1e/viteKit#readme"
|
|
64
|
+
}
|