@spesia/ui 1.0.1-24 → 1.0.1-27
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 +16 -16
- package/dist/colors.scss +18 -18
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/fonts.scss +20 -18
- package/dist/index.js +14 -11
- package/dist/styles/alert/alert.d.ts +1 -1
- package/dist/styles/button/button.d.ts +1 -1
- package/dist/styles/chip/chip.d.ts +1 -1
- package/dist/styles/index.d.ts +2 -2
- package/dist/styles/palette.d.ts +1 -1
- package/package.json +18 -3
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ export default function SpesiaThemeProvider ( { children }: Props ) {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
```
|
|
46
|
+
|
|
46
47
|
and reference it in your main App.tsx file or providers file:
|
|
47
48
|
|
|
48
49
|
```javascript
|
|
@@ -57,19 +58,18 @@ import SpesiaThemeProvider from '../path-to-provider';
|
|
|
57
58
|
</App>
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
|
|
61
61
|
## Available components
|
|
62
62
|
|
|
63
63
|
These Material UI components have been themed so far:
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
- Alert
|
|
66
|
+
- Button
|
|
67
|
+
- Card
|
|
68
|
+
- Chip
|
|
69
|
+
- Dialog
|
|
70
|
+
- TextField
|
|
71
|
+
- Typography
|
|
72
|
+
- Tooltip
|
|
73
73
|
|
|
74
74
|
We also have custom components that you can import, example:
|
|
75
75
|
|
|
@@ -102,8 +102,8 @@ When that is building correct, create a folder under `stories/components/[Compon
|
|
|
102
102
|
|
|
103
103
|
There are two build scripts:
|
|
104
104
|
|
|
105
|
-
1
|
|
106
|
-
2
|
|
105
|
+
1. `pnpm build` > This builds the theme as a ui library so that it can be published as an npm registry.
|
|
106
|
+
2. `pnpm storybook` > This builds a static storybook website for demonstration purposes.
|
|
107
107
|
|
|
108
108
|
### Dockerfile
|
|
109
109
|
|
|
@@ -114,15 +114,15 @@ Use `docker build . -t spesia-ui-kit` to build it.
|
|
|
114
114
|
## Spesia colors
|
|
115
115
|
|
|
116
116
|
### Typescript/javascript
|
|
117
|
+
|
|
117
118
|
The @spesia/ui package also exports a `colors` file, in case you need to reference colors in the theme directly.
|
|
118
119
|
|
|
119
120
|
Example:
|
|
120
121
|
|
|
121
122
|
```javascript
|
|
122
|
-
import { color } from
|
|
123
|
+
import { color } from "@spesia/ui";
|
|
123
124
|
|
|
124
125
|
const chartColor = colors.primary.blue[400];
|
|
125
|
-
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
### CSS
|
|
@@ -130,10 +130,10 @@ const chartColor = colors.primary.blue[400];
|
|
|
130
130
|
You can also import the colors in your scss file as scss variables:
|
|
131
131
|
|
|
132
132
|
```css
|
|
133
|
-
@use
|
|
133
|
+
@use "@spesia/ui/dist/colors.scss";
|
|
134
134
|
|
|
135
135
|
.MyContainer {
|
|
136
|
-
|
|
136
|
+
background: $gray100;
|
|
137
137
|
}
|
|
138
138
|
```
|
|
139
139
|
|
|
@@ -152,4 +152,4 @@ When you are ready to push your commits to remote, remember to push the tags as
|
|
|
152
152
|
```
|
|
153
153
|
git push
|
|
154
154
|
git push --tags
|
|
155
|
-
```
|
|
155
|
+
```
|
package/dist/colors.scss
CHANGED
|
@@ -9,8 +9,8 @@ $blue400: #3d7e8f;
|
|
|
9
9
|
$blue500: #0d5e73;
|
|
10
10
|
$blue600: #0a4959;
|
|
11
11
|
|
|
12
|
-
$coral50: color.scale(#
|
|
13
|
-
$coral100: #
|
|
12
|
+
$coral50: color.scale(#ffe6dc, $lightness: 10%);
|
|
13
|
+
$coral100: #ffe6dc;
|
|
14
14
|
$coral200: color.scale(#fea381, $lightness: 10%);
|
|
15
15
|
$coral400: #fea381;
|
|
16
16
|
$coral500: #fd7c4b;
|
|
@@ -33,29 +33,29 @@ $semanticYellow600: rgba(114, 86, 21, 1);
|
|
|
33
33
|
|
|
34
34
|
//danger
|
|
35
35
|
|
|
36
|
-
$semanticRed50: rgba(255,74,74,0.05);
|
|
37
|
-
$semanticRed100: rgba(255,74,74,0.1);
|
|
38
|
-
$semanticRed200: rgba(199,58,58,0.14);
|
|
39
|
-
$semanticRed400: rgba(199,58,58,0.8);
|
|
40
|
-
$semanticRed500: rgba(199,58,58,1);
|
|
36
|
+
$semanticRed50: rgba(255, 74, 74, 0.05);
|
|
37
|
+
$semanticRed100: rgba(255, 74, 74, 0.1);
|
|
38
|
+
$semanticRed200: rgba(199, 58, 58, 0.14);
|
|
39
|
+
$semanticRed400: rgba(199, 58, 58, 0.8);
|
|
40
|
+
$semanticRed500: rgba(199, 58, 58, 1);
|
|
41
41
|
$semanticRed600: rgba(159, 46, 46, 1);
|
|
42
42
|
|
|
43
43
|
//success
|
|
44
44
|
|
|
45
|
-
$semanticGreen50: rgba(24,128,56,0.05);
|
|
46
|
-
$semanticGreen100: rgba(24,128,56,0.1);
|
|
47
|
-
$semanticGreen200: rgba(24,128,56,0.14);
|
|
48
|
-
$semanticGreen400: rgba(24,128,56,0.8);
|
|
49
|
-
$semanticGreen500: rgba(24,128,56,1);
|
|
45
|
+
$semanticGreen50: rgba(24, 128, 56, 0.05);
|
|
46
|
+
$semanticGreen100: rgba(24, 128, 56, 0.1);
|
|
47
|
+
$semanticGreen200: rgba(24, 128, 56, 0.14);
|
|
48
|
+
$semanticGreen400: rgba(24, 128, 56, 0.8);
|
|
49
|
+
$semanticGreen500: rgba(24, 128, 56, 1);
|
|
50
50
|
$semanticGreen600: rgba(19, 102, 45, 1);
|
|
51
51
|
|
|
52
52
|
//info
|
|
53
53
|
|
|
54
|
-
$semanticBlue50: rgba(26,116,168,0.08);
|
|
55
|
-
$semanticBlue100: rgba(26,116,168,0.1);
|
|
56
|
-
$semanticBlue200: rgba(26,116,168,0.2);
|
|
57
|
-
$semanticBlue400: rgba(70,143,186,0.8);
|
|
58
|
-
$semanticBlue500: rgba(26,116,168,1);
|
|
54
|
+
$semanticBlue50: rgba(26, 116, 168, 0.08);
|
|
55
|
+
$semanticBlue100: rgba(26, 116, 168, 0.1);
|
|
56
|
+
$semanticBlue200: rgba(26, 116, 168, 0.2);
|
|
57
|
+
$semanticBlue400: rgba(70, 143, 186, 0.8);
|
|
58
|
+
$semanticBlue500: rgba(26, 116, 168, 1);
|
|
59
59
|
$semanticBlue600: rgba(21, 93, 134, 1);
|
|
60
60
|
|
|
61
61
|
$neutral50: #f5f5f5;
|
|
@@ -67,7 +67,7 @@ $neutral600: color.scale(#737373, $lightness: -10%);
|
|
|
67
67
|
|
|
68
68
|
// Text and background colors
|
|
69
69
|
|
|
70
|
-
$gray0: rgba(2,0,0,0.02);
|
|
70
|
+
$gray0: rgba(2, 0, 0, 0.02);
|
|
71
71
|
$gray25: #fafafa;
|
|
72
72
|
$gray50: #f5f5f5;
|
|
73
73
|
$gray100: #e5e5e5;
|
|
@@ -3,7 +3,7 @@ export interface LogoProps {
|
|
|
3
3
|
alt?: string;
|
|
4
4
|
height?: number;
|
|
5
5
|
width?: number;
|
|
6
|
-
color?:
|
|
6
|
+
color?: "blue" | "black" | "white";
|
|
7
7
|
}
|
|
8
8
|
declare const Logo: ({ withText, color, height, width, ...rest }: LogoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
export default Logo;
|
package/dist/fonts.scss
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
font-family: "Montserrat";
|
|
3
|
+
src: url("/fonts/Montserrat/Montserrat-VariableFont_wght.ttf")
|
|
4
|
+
format("truetype");
|
|
5
|
+
font-weight: normal;
|
|
6
|
+
font-style: normal;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
@font-face {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
font-family: "Montserrat";
|
|
11
|
+
src: url("/fonts/Montserrat/Montserrat-Italic-VariableFont_wght.ttf")
|
|
12
|
+
format("truetype");
|
|
13
|
+
font-weight: normal;
|
|
14
|
+
font-style: italic;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
@font-face {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
font-family: "Montserrat Fallback";
|
|
19
|
+
src: local("Arial");
|
|
20
|
+
ascent-override: 85.79%;
|
|
21
|
+
descent-override: 22.25%;
|
|
22
|
+
line-gap-override: 0%;
|
|
23
|
+
size-adjust: 112.83%;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
.montserrat-font {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
font-family: "Montserrat", "Montserrat Fallback";
|
|
28
|
+
font-style: normal;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
.montserrat-font-variable {
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
+
--font-spesia: "Montserrat", "Montserrat Fallback";
|
|
33
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -3470,11 +3470,19 @@ const bo = io({
|
|
|
3470
3470
|
}
|
|
3471
3471
|
}
|
|
3472
3472
|
}
|
|
3473
|
-
}, So = "spesiaTheme", Co = ({
|
|
3473
|
+
}, So = "spesiaTheme", Co = ({
|
|
3474
|
+
withText: e,
|
|
3475
|
+
color: r = "black",
|
|
3476
|
+
height: t,
|
|
3477
|
+
width: n,
|
|
3478
|
+
...o
|
|
3479
|
+
}) => {
|
|
3474
3480
|
const a = e ? 4.272388059701493 : 1.3432835820895523;
|
|
3475
3481
|
let c = t, l = n;
|
|
3476
3482
|
const f = r === "blue" ? $.primary.blue[500] : r === "white" ? $.neutral.white : $.neutral.black;
|
|
3477
|
-
return n || t ? (n && t && (console.warn(
|
|
3483
|
+
return n || t ? (n && t && (console.warn(
|
|
3484
|
+
"Logo: Both width and height are specified. Width will be ignored in order to maintain correct aspect ratio."
|
|
3485
|
+
), l = void 0), c && !l ? l = c * a : l && !t && (c = l / a), /* @__PURE__ */ ie(
|
|
3478
3486
|
"svg",
|
|
3479
3487
|
{
|
|
3480
3488
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3488,14 +3496,7 @@ const bo = io({
|
|
|
3488
3496
|
/* @__PURE__ */ er("g", { children: [
|
|
3489
3497
|
/* @__PURE__ */ ie("path", { d: "M31.39714478,122.66193447C31.39714478,60.23646992,78.03020523,8.70349147,138.3606424.99608211,133.22022503.33939701,127.9809798.00000134,122.66207001.00000134,54.91762723.00000134,0,54.91762857,0,122.66193447c0,67.74423746,54.91762723,122.66186469,122.66207001,122.66186469,5.31890979,0,10.55815502-.33939567,15.69857239-.99608077-60.33043717-7.70740936-106.96349762-59.24038781-106.96349762-121.66578392Z" }),
|
|
3490
3498
|
/* @__PURE__ */ ie("path", { d: "M82.97816835,122.66193447c0-62.42546455,46.63306045-113.958443,106.96349762-121.66585236C184.8012486.33939701,179.56200337.00000134,174.24309358.00000134,106.4986508.00000134,51.58102357,54.91762857,51.58102357,122.66193447c0,67.74423746,54.91762723,122.66186469,122.66207001,122.66186469,5.31890979,0,10.55815502-.33939567,15.69857239-.99608077-60.33043717-7.70740936-106.96349762-59.24038781-106.96349762-121.66578392Z" }),
|
|
3491
|
-
/* @__PURE__ */ ie(
|
|
3492
|
-
"circle",
|
|
3493
|
-
{
|
|
3494
|
-
cx: "225.82401894",
|
|
3495
|
-
cy: "122.66190085",
|
|
3496
|
-
r: "122.66190085"
|
|
3497
|
-
}
|
|
3498
|
-
)
|
|
3499
|
+
/* @__PURE__ */ ie("circle", { cx: "225.82401894", cy: "122.66190085", r: "122.66190085" })
|
|
3499
3500
|
] }),
|
|
3500
3501
|
e && /* @__PURE__ */ er("g", { children: [
|
|
3501
3502
|
/* @__PURE__ */ ie(
|
|
@@ -3543,7 +3544,9 @@ const bo = io({
|
|
|
3543
3544
|
] })
|
|
3544
3545
|
] }) })
|
|
3545
3546
|
}
|
|
3546
|
-
)) : (console.error(
|
|
3547
|
+
)) : (console.error(
|
|
3548
|
+
"Logo: You need to specify either a width or a height for the logo."
|
|
3549
|
+
), null);
|
|
3547
3550
|
};
|
|
3548
3551
|
export {
|
|
3549
3552
|
Co as Logo,
|
package/dist/styles/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ThemeOptions } from '@mui/material';
|
|
2
|
-
export type ComponentStyles = ThemeOptions[
|
|
2
|
+
export type ComponentStyles = ThemeOptions["components"];
|
|
3
3
|
declare const theme: import('@mui/material').Theme;
|
|
4
|
-
declare module
|
|
4
|
+
declare module "@mui/material/styles" {
|
|
5
5
|
interface Theme {
|
|
6
6
|
transparent: {
|
|
7
7
|
primary: string;
|
package/dist/styles/palette.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spesia/ui",
|
|
3
|
-
"version": "1.0.1-
|
|
3
|
+
"version": "1.0.1-27",
|
|
4
4
|
"description": "The Spesia UI toolkit for React",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
|
-
"main": "
|
|
9
|
-
"types": "
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"private": false,
|
|
18
|
+
"lint-staged": {
|
|
19
|
+
"**/*.(js|jsx|ts|tsx)": [
|
|
20
|
+
"npx eslint --fix"
|
|
21
|
+
],
|
|
22
|
+
"**/*.(js|jsx|ts|tsx|css|less|scss|md|json|yml|yaml)": [
|
|
23
|
+
"pnpm run format:fix"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
18
26
|
"keywords": [],
|
|
19
27
|
"author": "tinna@spesia.is",
|
|
20
28
|
"license": "ISC",
|
|
@@ -39,6 +47,9 @@
|
|
|
39
47
|
"@types/react": "^19.0.10",
|
|
40
48
|
"@vitest/browser": "^3.0.8",
|
|
41
49
|
"@vitest/coverage-v8": "^3.0.8",
|
|
50
|
+
"eslint": "^9.23.0",
|
|
51
|
+
"eslint-config-next": "^15.2.2",
|
|
52
|
+
"eslint-config-prettier": "^9.1.0",
|
|
42
53
|
"playwright": "^1.51.0",
|
|
43
54
|
"react": "^19.0.0",
|
|
44
55
|
"react-dom": "^19.0.0",
|
|
@@ -72,6 +83,10 @@
|
|
|
72
83
|
"test:ci": "vitest run",
|
|
73
84
|
"test:watch": "vitest",
|
|
74
85
|
"test-storybook": "test-storybook",
|
|
86
|
+
"lint": "eslint",
|
|
87
|
+
"lint:fix": "eslint --fix",
|
|
88
|
+
"format": "prettier --check --ignore-path .gitignore .",
|
|
89
|
+
"format:fix": "prettier --write --ignore-path .gitignore .",
|
|
75
90
|
"dev": "storybook dev -p 6006",
|
|
76
91
|
"storybook": "storybook build",
|
|
77
92
|
"check-types": "tsc --noEmit"
|