@minimalstuff/ui 0.0.0

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,24 @@
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ import { DetailedHTMLProps } from 'react';
3
+ import { ElementType } from 'react';
4
+ import { JSX as JSX_2 } from 'react';
5
+ import { StyledComponent } from '@emotion/styled';
6
+ import { Theme } from '@emotion/react';
7
+
8
+ export declare const Button: StyledComponent< {
9
+ theme?: Theme | undefined;
10
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
11
+ } & ButtonProps, DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
12
+
13
+ declare type ButtonProps = {
14
+ danger?: boolean;
15
+ };
16
+
17
+ export { }
18
+
19
+
20
+ declare module 'vitest' {
21
+ interface Assertion<T = any> extends jest.Matchers<void, T>, TestingLibraryMatchers<T, void> {
22
+ }
23
+ }
24
+
@@ -0,0 +1,31 @@
1
+ import i from "@emotion/styled";
2
+ const s = i.button(
3
+ ({ theme: o, danger: r = !1 }) => {
4
+ const t = r ? o.colors.lightRed : o.colors.primary, d = r ? o.colors.lightRed : o.colors.darkBlue;
5
+ return {
6
+ cursor: "pointer",
7
+ width: "100%",
8
+ textTransform: "uppercase",
9
+ fontSize: "14px",
10
+ color: o.colors.white,
11
+ background: t,
12
+ padding: "0.75em",
13
+ border: `1px solid ${t}`,
14
+ borderRadius: o.border.radius,
15
+ transition: o.transition.delay,
16
+ "&:disabled": {
17
+ cursor: "not-allowed",
18
+ opacity: "0.5"
19
+ },
20
+ "&:not(:disabled):hover": {
21
+ boxShadow: `${d} 0 0 3px 1px`,
22
+ background: d,
23
+ color: o.colors.white
24
+ }
25
+ };
26
+ }
27
+ );
28
+ export {
29
+ s as Button
30
+ };
31
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../src/components/button/button.tsx"],"sourcesContent":["import emotionStyled from '@emotion/styled';\n\nexport type ButtonProps = { danger?: boolean };\n\nconst Button = emotionStyled.button<ButtonProps>(\n ({ theme, danger = false }) => {\n const btnColor = !danger ? theme.colors.primary : theme.colors.lightRed;\n const btnDarkColor = !danger\n ? theme.colors.darkBlue\n : theme.colors.lightRed;\n return {\n cursor: 'pointer',\n width: '100%',\n textTransform: 'uppercase',\n fontSize: '14px',\n color: theme.colors.white,\n background: btnColor,\n padding: '0.75em',\n border: `1px solid ${btnColor}`,\n borderRadius: theme.border.radius,\n transition: theme.transition.delay,\n\n '&:disabled': {\n cursor: 'not-allowed',\n opacity: '0.5',\n },\n\n '&:not(:disabled):hover': {\n boxShadow: `${btnDarkColor} 0 0 3px 1px`,\n background: btnDarkColor,\n color: theme.colors.white,\n },\n };\n }\n);\n\nexport default Button;\n"],"names":["Button","emotionStyled","theme","danger","btnColor","btnDarkColor"],"mappings":";AAIA,MAAMA,IAASC,EAAc;AAAA,EAC3B,CAAC,EAAE,OAAAC,GAAO,QAAAC,IAAS,SAAY;AAC7B,UAAMC,IAAYD,IAAgCD,EAAM,OAAO,WAApCA,EAAM,OAAO,SAClCG,IAAgBF,IAElBD,EAAM,OAAO,WADbA,EAAM,OAAO;AAEV,WAAA;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,eAAe;AAAA,MACf,UAAU;AAAA,MACV,OAAOA,EAAM,OAAO;AAAA,MACpB,YAAYE;AAAA,MACZ,SAAS;AAAA,MACT,QAAQ,aAAaA,CAAQ;AAAA,MAC7B,cAAcF,EAAM,OAAO;AAAA,MAC3B,YAAYA,EAAM,WAAW;AAAA,MAE7B,cAAc;AAAA,QACZ,QAAQ;AAAA,QACR,SAAS;AAAA,MACX;AAAA,MAEA,0BAA0B;AAAA,QACxB,WAAW,GAAGG,CAAY;AAAA,QAC1B,YAAYA;AAAA,QACZ,OAAOH,EAAM,OAAO;AAAA,MACtB;AAAA,IAAA;AAAA,EAEJ;AACF;"}
@@ -0,0 +1,2 @@
1
+ (function(t,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@emotion/styled")):typeof define=="function"&&define.amd?define(["exports","@emotion/styled"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t["@minimalstuff/ui"]={},t.emotionStyled))})(this,function(t,r){"use strict";const d=r.button(({theme:o,danger:e=!1})=>{const i=e?o.colors.lightRed:o.colors.primary,n=e?o.colors.lightRed:o.colors.darkBlue;return{cursor:"pointer",width:"100%",textTransform:"uppercase",fontSize:"14px",color:o.colors.white,background:i,padding:"0.75em",border:`1px solid ${i}`,borderRadius:o.border.radius,transition:o.transition.delay,"&:disabled":{cursor:"not-allowed",opacity:"0.5"},"&:not(:disabled):hover":{boxShadow:`${n} 0 0 3px 1px`,background:n,color:o.colors.white}}});t.Button=d,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
2
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../src/components/button/button.tsx"],"sourcesContent":["import emotionStyled from '@emotion/styled';\n\nexport type ButtonProps = { danger?: boolean };\n\nconst Button = emotionStyled.button<ButtonProps>(\n ({ theme, danger = false }) => {\n const btnColor = !danger ? theme.colors.primary : theme.colors.lightRed;\n const btnDarkColor = !danger\n ? theme.colors.darkBlue\n : theme.colors.lightRed;\n return {\n cursor: 'pointer',\n width: '100%',\n textTransform: 'uppercase',\n fontSize: '14px',\n color: theme.colors.white,\n background: btnColor,\n padding: '0.75em',\n border: `1px solid ${btnColor}`,\n borderRadius: theme.border.radius,\n transition: theme.transition.delay,\n\n '&:disabled': {\n cursor: 'not-allowed',\n opacity: '0.5',\n },\n\n '&:not(:disabled):hover': {\n boxShadow: `${btnDarkColor} 0 0 3px 1px`,\n background: btnDarkColor,\n color: theme.colors.white,\n },\n };\n }\n);\n\nexport default Button;\n"],"names":["Button","emotionStyled","theme","danger","btnColor","btnDarkColor"],"mappings":"0SAIA,MAAMA,EAASC,EAAc,OAC3B,CAAC,CAAE,MAAAC,EAAO,OAAAC,EAAS,MAAY,CAC7B,MAAMC,EAAYD,EAAgCD,EAAM,OAAO,SAApCA,EAAM,OAAO,QAClCG,EAAgBF,EAElBD,EAAM,OAAO,SADbA,EAAM,OAAO,SAEV,MAAA,CACL,OAAQ,UACR,MAAO,OACP,cAAe,YACf,SAAU,OACV,MAAOA,EAAM,OAAO,MACpB,WAAYE,EACZ,QAAS,SACT,OAAQ,aAAaA,CAAQ,GAC7B,aAAcF,EAAM,OAAO,OAC3B,WAAYA,EAAM,WAAW,MAE7B,aAAc,CACZ,OAAQ,cACR,QAAS,KACX,EAEA,yBAA0B,CACxB,UAAW,GAAGG,CAAY,eAC1B,WAAYA,EACZ,MAAOH,EAAM,OAAO,KACtB,CAAA,CAEJ,CACF"}
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@minimalstuff/ui",
3
+ "version": "0.0.0",
4
+ "description": "Minimal UI lib for React built on top of Emotion",
5
+ "type": "module",
6
+ "main": "./dist/index.umd.js",
7
+ "module": "./dist/index.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.es.js",
15
+ "require": "./dist/index.umd.js",
16
+ "types": "./dist/index.d.ts"
17
+ }
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/minimalstuff/ui"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc && vite build",
25
+ "format": "prettier --write --parser typescript '**/*.{ts,tsx}'",
26
+ "lint": "eslint . --ext .ts,.tsx --report-unused-disable-directives --max-warnings 0",
27
+ "dev": "vite",
28
+ "preview": "vite preview",
29
+ "test": "vitest run",
30
+ "test-watch": "vitest",
31
+ "test:ui": "vitest --ui",
32
+ "test:staged": "vitest related --run",
33
+ "coverage:staged": "vitest related --coverage --run",
34
+ "release": "release-it",
35
+ "storybook": "storybook dev -p 6006",
36
+ "build-storybook": "storybook build"
37
+ },
38
+ "keywords": [],
39
+ "author": "",
40
+ "license": "ISC",
41
+ "devDependencies": {
42
+ "@emotion/babel-plugin": "^11.11.0",
43
+ "@storybook/addon-essentials": "^8.1.10",
44
+ "@storybook/addon-interactions": "^8.1.10",
45
+ "@storybook/addon-links": "^8.1.10",
46
+ "@storybook/addon-onboarding": "^8.1.10",
47
+ "@storybook/blocks": "^8.1.10",
48
+ "@storybook/react": "^8.1.10",
49
+ "@storybook/react-vite": "^8.1.10",
50
+ "@storybook/test": "^8.1.10",
51
+ "@testing-library/jest-dom": "^6.4.6",
52
+ "@testing-library/react": "^16.0.0",
53
+ "@types/react": "^18.3.3",
54
+ "@typescript-eslint/eslint-plugin": "^7.13.0",
55
+ "@typescript-eslint/parser": "^7.13.0",
56
+ "@vitejs/plugin-react-swc": "^3.7.0",
57
+ "@vitest/coverage-v8": "^1.6.0",
58
+ "eslint": "^8.57.0",
59
+ "eslint-config-prettier": "^9.1.0",
60
+ "eslint-plugin-prettier": "^5.1.3",
61
+ "eslint-plugin-react": "^7.34.2",
62
+ "eslint-plugin-react-hooks": "^4.6.2",
63
+ "eslint-plugin-storybook": "^0.8.0",
64
+ "husky": "^9.0.11",
65
+ "jsdom": "^24.1.0",
66
+ "lint-staged": "^15.2.7",
67
+ "prettier": "^3.3.2",
68
+ "release-it": "^17.3.0",
69
+ "storybook": "^8.1.10",
70
+ "typescript": "^5.4.5",
71
+ "vite": "^5.3.0",
72
+ "vite-plugin-dts": "^3.9.1",
73
+ "vitest": "^1.6.0"
74
+ },
75
+ "dependencies": {
76
+ "@emotion/react": "^11.11.4",
77
+ "@emotion/styled": "^11.11.5",
78
+ "@types/node": "^20.14.2",
79
+ "hex-rgb": "^5.0.0",
80
+ "react": "^18.3.1",
81
+ "react-dom": "^18.3.1",
82
+ "vite-tsconfig-paths": "^4.3.2"
83
+ },
84
+ "lint-staged": {
85
+ "*.{ts,tsx}": [
86
+ "pnpm format",
87
+ "pnpm lint",
88
+ "pnpm test:staged",
89
+ "pnpm coverage:staged"
90
+ ]
91
+ },
92
+ "volta": {
93
+ "node": "20.14.0"
94
+ },
95
+ "eslintConfig": {
96
+ "extends": [
97
+ "plugin:storybook/recommended"
98
+ ]
99
+ },
100
+ "packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
101
+ }