@spesia/ui 1.10.7 → 1.10.9

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.
@@ -185,7 +185,7 @@ const De = ({
185
185
  padding: 2,
186
186
  display: "flex",
187
187
  flexDirection: a ? "row" : "column",
188
- gap: 4,
188
+ gap: 2,
189
189
  ".MuiChip-icon": {
190
190
  fill: (e) => {
191
191
  var r;
@@ -210,7 +210,8 @@ const De = ({
210
210
  le,
211
211
  {
212
212
  sx: {
213
- px: 3,
213
+ px: 2,
214
+ py: 4.5,
214
215
  backgroundColor: (n) => {
215
216
  var h;
216
217
  return e.label === (l == null ? void 0 : l.label) ? (h = n.vars) == null ? void 0 : h.palette.background.default : "transparent";
@@ -1,5 +1,5 @@
1
1
  export type TrendingChipProps = {
2
- value: number;
2
+ value?: number;
3
3
  iconOnly?: boolean;
4
4
  size?: "small" | "medium";
5
5
  className?: string;
@@ -1,92 +1,94 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { suitCx as c } from "../../helpers/suitCx.js";
3
- import { Box as i, Chip as h } from "@mui/material";
4
- import { ArrowDownward as n, ArrowUpward as s } from "@mui/icons-material";
5
- import { formatPercentage as l } from "../../helpers/utils.js";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import { suitCx as m } from "../../helpers/suitCx.js";
3
+ import { Box as x, Chip as a } from "@mui/material";
4
+ import { ArrowDownward as s, ArrowUpward as n } from "@mui/icons-material";
5
+ import { formatPercentage as g } from "../../helpers/utils.js";
6
6
  import { colors as t } from "../../styles/colors.js";
7
- const C = ({
8
- value: e,
9
- size: a,
10
- iconOnly: d,
11
- className: p
7
+ const N = ({
8
+ value: o,
9
+ size: c,
10
+ iconOnly: p,
11
+ className: h
12
12
  }) => {
13
- const o = c(
13
+ const i = m(
14
14
  {
15
15
  name: "TrendingChip"
16
16
  },
17
17
  {},
18
- p
19
- );
20
- return d ? e < 0 ? /* @__PURE__ */ r(
21
- i,
22
- {
23
- sx: {
24
- display: "inline-flex",
25
- alignItems: "center",
26
- justifyContent: "center",
27
- borderRadius: "100%",
28
- backgroundColor: "#F38840",
29
- color: t.neutral.white,
30
- width: "48px",
31
- height: "48px"
32
- },
33
- children: /* @__PURE__ */ r(
34
- n,
35
- {
36
- className: o(),
37
- sx: { width: "24px", height: "24px", rotate: "-45deg" }
38
- }
39
- )
40
- }
41
- ) : /* @__PURE__ */ r(
42
- i,
18
+ h
19
+ ), e = o === void 0 || o === 0 ? t.secondary.grey[30] : o < 0 ? "#F38840" : t.secondary.olive[50];
20
+ return p ? /* @__PURE__ */ d(
21
+ x,
43
22
  {
44
23
  sx: {
45
24
  display: "inline-flex",
46
25
  alignItems: "center",
47
26
  justifyContent: "center",
48
27
  borderRadius: "100%",
49
- backgroundColor: t.secondary.olive[50],
28
+ backgroundColor: e,
50
29
  color: t.neutral.white,
51
30
  width: "48px",
52
31
  height: "48px"
53
32
  },
54
- children: /* @__PURE__ */ r(
55
- s,
56
- {
57
- className: o(),
58
- sx: { width: "24px", height: "24px", rotate: "45deg" }
59
- }
60
- )
33
+ children: [
34
+ o === void 0 && /* @__PURE__ */ r("div", { children: "-" }),
35
+ o !== void 0 && o < 0 && /* @__PURE__ */ r(
36
+ s,
37
+ {
38
+ className: i(),
39
+ sx: { width: "24px", height: "24px", rotate: "-45deg" }
40
+ }
41
+ ),
42
+ o !== void 0 && o >= 0 && /* @__PURE__ */ r(
43
+ n,
44
+ {
45
+ className: i(),
46
+ sx: {
47
+ width: "24px",
48
+ height: "24px",
49
+ rotate: o === 0 ? "90deg" : "45deg"
50
+ }
51
+ }
52
+ )
53
+ ]
61
54
  }
62
55
  ) : /* @__PURE__ */ r(
63
- h,
56
+ a,
64
57
  {
65
- className: o(),
58
+ className: i(),
66
59
  variant: "outlined",
67
- size: a,
60
+ size: c,
68
61
  sx: {
69
62
  pointerEvents: "none",
70
63
  border: "none !important",
71
64
  borderRadius: 2,
72
- color: e >= 0 ? `${t.secondary.olive[50]} !important` : "#F38840 !important"
65
+ color: `${e} !important`
73
66
  },
74
- color: e < 0 ? "error" : "success",
75
- icon: e < 0 ? /* @__PURE__ */ r(
76
- n,
77
- {
78
- sx: { width: "18px", height: "18px", rotate: "-45deg" }
79
- }
80
- ) : /* @__PURE__ */ r(
81
- s,
82
- {
83
- sx: { width: "18px", height: "18px", rotate: "45deg" }
84
- }
85
- ),
86
- label: l(e, !1, 1)
67
+ color: o !== void 0 && o < 0 ? "error" : "success",
68
+ icon: o === void 0 ? void 0 : /* @__PURE__ */ d("div", { children: [
69
+ o !== void 0 && o < 0 && /* @__PURE__ */ r(
70
+ s,
71
+ {
72
+ className: i(),
73
+ sx: { width: "18px", height: "18px", rotate: "-45deg" }
74
+ }
75
+ ),
76
+ o !== void 0 && o >= 0 && /* @__PURE__ */ r(
77
+ n,
78
+ {
79
+ className: i(),
80
+ sx: {
81
+ width: "18px",
82
+ height: "18px",
83
+ rotate: o === 0 ? "90deg" : "45deg"
84
+ }
85
+ }
86
+ )
87
+ ] }),
88
+ label: o !== void 0 ? g(o, !1, 1) : "-"
87
89
  }
88
90
  );
89
91
  };
90
92
  export {
91
- C as TrendingChip
93
+ N as TrendingChip
92
94
  };
@@ -1,85 +1,126 @@
1
- const A = {
1
+ const k = {
2
2
  MuiAlert: {
3
3
  styleOverrides: {
4
- root: (t) => {
5
- var l, a, i, n, c, u, m, d, s, h, M, v, x;
6
- const r = t.ownerState.color || t.ownerState.severity, o = {
7
- borderRadius: t.theme.spacing(2),
8
- borderColor: (l = t.theme.vars) == null ? void 0 : l.palette.border.tertiary,
4
+ root: (e) => {
5
+ var o, l, i, n, c, m, u, d, h, g, M, b, v, s, A, y, x, f, p, C;
6
+ const r = e.ownerState.color || e.ownerState.severity, a = {
7
+ borderRadius: e.theme.spacing(4),
8
+ borderColor: (o = e.theme.vars) == null ? void 0 : o.palette.border.primary,
9
9
  borderWidth: 1,
10
10
  borderStyle: "solid",
11
+ backgroundColor: (l = e.theme.vars) == null ? void 0 : l.palette.background.paper,
11
12
  ".MuiAlert-message": {
12
- fontWeight: 400
13
+ fontWeight: 400,
14
+ marginTop: e.theme.spacing(1),
15
+ ".MuiAlertTitle-root": {
16
+ paddingTop: e.theme.spacing(1)
17
+ }
13
18
  },
14
19
  "&.MuiAlert-noBorder": {
15
20
  border: "none !important"
16
21
  },
17
22
  ".MuiAlert-icon": {
18
- color: (a = t.theme.vars) == null ? void 0 : a.palette.text.primary
23
+ color: (i = e.theme.vars) == null ? void 0 : i.palette.text.primary
19
24
  },
20
25
  ".MuiAlert-icon > .MuiSvgIcon-root path": {
21
- fill: (i = t.theme.vars) == null ? void 0 : i.palette.text.primary
26
+ fill: (n = e.theme.vars) == null ? void 0 : n.palette.text.primary
22
27
  }
23
28
  };
24
29
  if (r) {
25
- const e = (n = t.theme.vars) == null ? void 0 : n.palette[r];
26
- if (e)
30
+ const t = (c = e.theme.vars) == null ? void 0 : c.palette[r];
31
+ if (t)
27
32
  return {
28
- ...o,
29
- color: (c = t.theme.vars) == null ? void 0 : c.palette.text.grey,
33
+ ...a,
34
+ color: (m = e.theme.vars) == null ? void 0 : m.palette.text.primary,
30
35
  ".MuiAlertTitle-root": {
31
- color: e.main
36
+ color: (u = e.theme.vars) == null ? void 0 : u.palette.text.primary
32
37
  },
33
38
  ".MuiAlert-icon": {
34
- color: e.main
39
+ color: t.main,
40
+ display: "flex",
41
+ alignItems: "center",
42
+ justifyContent: "center",
43
+ width: 30,
44
+ height: 30,
45
+ padding: e.theme.spacing(1),
46
+ marginTop: e.theme.spacing(2),
47
+ marginBottom: e.theme.spacing(2),
48
+ background: t.lighter,
49
+ borderRadius: e.theme.spacing(2)
50
+ },
51
+ "&.MuiAlert-colorNeutral": {
52
+ ".MuiAlert-icon": {
53
+ background: `${(d = e.theme.vars) == null ? void 0 : d.palette.primary.lighter} !important`
54
+ }
55
+ },
56
+ "&.MuiAlert-colorSecondary": {
57
+ ".MuiAlert-icon": {
58
+ background: t.transparent
59
+ }
35
60
  },
36
61
  ".MuiAlert-icon > .MuiSvgIcon-root path": {
37
- fill: e.main
62
+ fill: t.main,
63
+ "&.MuiAlert-colorNeutral": {
64
+ fill: (h = e.theme.vars) == null ? void 0 : h.palette.text.primary
65
+ }
38
66
  },
39
67
  "&.MuiAlert-standard": {
40
- background: e.transparent
68
+ background: (g = e.theme.vars) == null ? void 0 : g.palette.background.paper,
69
+ borderColor: t.lighter,
70
+ "&.MuiAlert-colorNeutral": {
71
+ borderColor: (M = e.theme.vars) == null ? void 0 : M.palette.border.primary
72
+ }
73
+ },
74
+ "&.MuiAlert-outlined": {
75
+ borderColor: t.lighter,
76
+ "&.MuiAlert-colorNeutral": {
77
+ borderColor: (b = e.theme.vars) == null ? void 0 : b.palette.border.primary
78
+ }
41
79
  },
42
80
  "&.MuiAlert-filled": {
43
- color: e.contrastText,
44
- background: e.main,
45
- ".MuiAlertTitle-root": {
46
- color: e.contrastText
47
- },
81
+ background: t.transparent,
82
+ borderColor: t.lighter,
48
83
  ".MuiAlert-icon > .MuiSvgIcon-root path": {
49
- fill: e.contrastText
84
+ fill: t.main
50
85
  }
51
86
  }
52
87
  };
53
88
  }
54
89
  return {
55
- ...o,
56
- color: (u = t.theme.vars) == null ? void 0 : u.palette.text.grey,
90
+ ...a,
91
+ color: (v = e.theme.vars) == null ? void 0 : v.palette.text.grey,
57
92
  ".MuiAlertTitle-root": {
58
- color: (m = t.theme.vars) == null ? void 0 : m.palette.text.primary
93
+ color: (s = e.theme.vars) == null ? void 0 : s.palette.text.primary
59
94
  },
60
95
  ".MuiAlert-icon": {
61
- color: (d = t.theme.vars) == null ? void 0 : d.palette.text.primary
96
+ color: (A = e.theme.vars) == null ? void 0 : A.palette.text.primary
62
97
  },
63
98
  ".MuiAlert-icon > .MuiSvgIcon-root path": {
64
- fill: (s = t.theme.vars) == null ? void 0 : s.palette.text.primary
99
+ fill: (y = e.theme.vars) == null ? void 0 : y.palette.text.primary
65
100
  },
66
101
  "&.MuiAlert-filled": {
67
- color: (h = t.theme.vars) == null ? void 0 : h.palette.text.contrastText,
68
- background: (M = t.theme.vars) == null ? void 0 : M.palette.text.primary,
102
+ color: (x = e.theme.vars) == null ? void 0 : x.palette.text.contrastText,
103
+ background: (f = e.theme.vars) == null ? void 0 : f.palette.text.primary,
69
104
  ".MuiAlert-icon > .MuiSvgIcon-root path": {
70
- fill: (v = t.theme.vars) == null ? void 0 : v.palette.text.contrastText
105
+ fill: (p = e.theme.vars) == null ? void 0 : p.palette.text.contrastText
71
106
  },
72
107
  ".MuiAlertTitle-root": {
73
- color: (x = t.theme.vars) == null ? void 0 : x.palette.text.contrastText
108
+ color: (C = e.theme.vars) == null ? void 0 : C.palette.text.contrastText
74
109
  }
75
110
  }
76
111
  };
77
112
  },
78
- outlined: (t) => {
113
+ standard: (e) => {
114
+ var r;
115
+ return {
116
+ borderColor: (r = e.theme.vars) == null ? void 0 : r.palette.border.primary
117
+ };
118
+ },
119
+ outlined: (e) => {
79
120
  var r;
80
121
  return {
81
122
  border: "1px solid",
82
- borderColor: (r = t.theme.vars) == null ? void 0 : r.palette.border.tertiary,
123
+ borderColor: (r = e.theme.vars) == null ? void 0 : r.palette.border.primary,
83
124
  background: "transparent"
84
125
  };
85
126
  }
@@ -87,5 +128,5 @@ const A = {
87
128
  }
88
129
  };
89
130
  export {
90
- A as alertStyles
131
+ k as alertStyles
91
132
  };
@@ -1,25 +1,48 @@
1
- import { colors as n } from "../colors.js";
1
+ import { colors as o } from "../colors.js";
2
2
  const d = {
3
3
  MuiTab: {
4
4
  styleOverrides: {
5
5
  root: ({ theme: t }) => {
6
- var a, o, r, i;
6
+ var a, i, r, e;
7
7
  return {
8
- color: t.vars.palette.text.primary,
9
- borderRadius: 0,
10
- padding: 0,
11
- paddingTop: 12,
12
- marginRight: t.spacing(6),
13
- textTransform: "initial",
14
- display: "flex",
15
- alignItems: "center",
16
- flexDirection: "row",
17
- gap: 20,
18
- justifyContent: "flex-start",
19
- opacity: 0.2,
20
- "&.Mui-selected": {
8
+ ".MuiTabs-brand &": {
21
9
  color: t.vars.palette.text.primary,
22
- opacity: 1
10
+ borderRadius: 0,
11
+ padding: 0,
12
+ paddingTop: 12,
13
+ marginRight: t.spacing(6),
14
+ textTransform: "initial",
15
+ display: "flex",
16
+ alignItems: "center",
17
+ flexDirection: "row",
18
+ gap: 20,
19
+ justifyContent: "flex-start",
20
+ opacity: 0.2,
21
+ "&.Mui-selected": {
22
+ color: t.vars.palette.text.primary,
23
+ opacity: 1
24
+ }
25
+ },
26
+ ".MuiTabs-stretched &": {
27
+ color: t.vars.palette.text.secondary,
28
+ borderRadius: 0,
29
+ textTransform: "initial",
30
+ display: "flex",
31
+ textAlign: "center",
32
+ maxWidth: "none",
33
+ alignItems: "center",
34
+ flexDirection: "row",
35
+ gap: 20,
36
+ flexGrow: 1,
37
+ justifyContent: "flex-start",
38
+ borderBottom: `2px solid ${t.vars.palette.divider}`,
39
+ "&.Mui-selected": {
40
+ color: t.vars.palette.text.primary
41
+ },
42
+ "& span": {
43
+ display: "block",
44
+ flex: "1 1 auto"
45
+ }
23
46
  },
24
47
  ".MuiTabs-numbered &": {
25
48
  "&::before": {
@@ -49,7 +72,7 @@ const d = {
49
72
  opacity: 1,
50
73
  "&.Mui-selected": {
51
74
  background: (a = t.vars) == null ? void 0 : a.palette.background.brownBold,
52
- color: (o = t.vars) == null ? void 0 : o.palette.text.contrastText
75
+ color: (i = t.vars) == null ? void 0 : i.palette.text.contrastText
53
76
  },
54
77
  "@media (max-width: 599px)": {
55
78
  padding: 12,
@@ -57,6 +80,9 @@ const d = {
57
80
  paddingBottom: 0
58
81
  }
59
82
  },
83
+ ".MuiTabs-fullWidth &": {
84
+ flex: 1
85
+ },
60
86
  ".MuiTabs-rounded &": {
61
87
  color: t.vars.palette.text.secondary,
62
88
  padding: 28,
@@ -74,7 +100,7 @@ const d = {
74
100
  opacity: 1,
75
101
  "&.Mui-selected": {
76
102
  color: (r = t.vars) == null ? void 0 : r.palette.background.brownBold,
77
- background: (i = t.vars) == null ? void 0 : i.palette.text.contrastText
103
+ background: (e = t.vars) == null ? void 0 : e.palette.text.contrastText
78
104
  },
79
105
  "@media (max-width: 599px)": {
80
106
  padding: 12,
@@ -89,22 +115,44 @@ const d = {
89
115
  }, s = {
90
116
  MuiTabs: {
91
117
  styleOverrides: {
92
- root: () => ({}),
118
+ root: () => ({
119
+ "&.MuiTabs-stretched": {
120
+ width: "100%",
121
+ margin: 0
122
+ },
123
+ "&.MuiTabs-fullWidth": {
124
+ width: "100%"
125
+ }
126
+ }),
93
127
  scroller: () => ({
94
128
  ".MuiTabs-rounded &": {
95
129
  display: "flex",
96
130
  width: "auto"
131
+ },
132
+ ".MuiTabs-fullWidth &": {
133
+ width: "100%"
134
+ },
135
+ ".MuiTabs-stretched &": {
136
+ display: "flex",
137
+ width: "100%"
97
138
  }
98
139
  }),
99
140
  list: ({ theme: t }) => {
100
- var a, o, r;
141
+ var a, i, r;
101
142
  return {
102
143
  counterReset: "MuiTab-root",
144
+ ".MuiTabs-stretched &": {
145
+ display: "flex",
146
+ width: "100%",
147
+ alignItems: "center",
148
+ justifyContent: "space-between",
149
+ gap: 0
150
+ },
103
151
  ".MuiTabs-buttons &": {
104
152
  backgroundColor: (a = t.vars) == null ? void 0 : a.palette.background.paper,
105
153
  borderRadius: t.spacing(2),
106
154
  border: "1px solid",
107
- borderColor: (o = t == null ? void 0 : t.vars) == null ? void 0 : o.palette.border.primary,
155
+ borderColor: (i = t == null ? void 0 : t.vars) == null ? void 0 : i.palette.border.primary,
108
156
  display: "flex",
109
157
  alignItems: "center",
110
158
  justifyContent: "flex-start",
@@ -116,32 +164,43 @@ const d = {
116
164
  borderRadius: t.spacing(8),
117
165
  border: "0px solid",
118
166
  display: "flex",
167
+ width: "auto",
119
168
  alignItems: "center",
120
169
  justifyContent: "flex-start",
121
170
  gap: 0,
122
171
  padding: 0
172
+ },
173
+ ".MuiTabs-fullWidth &": {
174
+ width: "100%"
123
175
  }
124
176
  };
125
177
  },
126
178
  indicator: (t) => ({
127
- backgroundColor: n.primary.beige[10],
128
- height: "5px",
129
- top: 0,
130
- bottom: "auto",
131
- borderRadius: t.theme.spacing(2),
132
- "&:after": {
133
- content: '""',
134
- position: "absolute",
135
- left: 0,
136
- right: "auto",
179
+ ".MuiTabs-brand &": {
180
+ backgroundColor: o.primary.beige[10],
181
+ height: "5px",
137
182
  top: 0,
138
- bottom: 0,
139
- margin: "auto",
140
- width: "var(--indicator-width, 100%)",
141
- height: "100%",
142
- borderRadius: t.theme.spacing(3),
143
- backgroundColor: n.primary.coral[100],
144
- transition: "width 0.3s ease"
183
+ bottom: "auto",
184
+ borderRadius: t.theme.spacing(2),
185
+ "&:after": {
186
+ content: '""',
187
+ position: "absolute",
188
+ left: 0,
189
+ right: "auto",
190
+ top: 0,
191
+ bottom: 0,
192
+ margin: "auto",
193
+ width: "var(--indicator-width, 100%)",
194
+ height: "100%",
195
+ borderRadius: t.theme.spacing(3),
196
+ backgroundColor: o.primary.coral[100],
197
+ transition: "width 0.3s ease"
198
+ }
199
+ },
200
+ ".MuiTabs-stretched &": {
201
+ backgroundColor: o.primary.brown[50],
202
+ height: "2px",
203
+ borderRadius: t.theme.spacing(2)
145
204
  },
146
205
  ".MuiTabs-buttons &": {
147
206
  display: "none"
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.10.7",
6
+ "version": "1.10.9",
7
7
  "description": "The Spesia UI toolkit for React",
8
8
  "files": [
9
9
  "dist"
@@ -22,9 +22,24 @@
22
22
  },
23
23
  "type": "module",
24
24
  "private": false,
25
+ "scripts": {
26
+ "build": "tsc && vite build",
27
+ "build:analyze": "vite build && npx vite-bundle-visualizer",
28
+ "test:ci": "vitest run",
29
+ "test:watch": "vitest",
30
+ "test-storybook": "test-storybook",
31
+ "lint": "eslint",
32
+ "lint:fix": "eslint --fix",
33
+ "format": "prettier --check --ignore-path .gitignore .",
34
+ "format:fix": "prettier --write --ignore-path .gitignore .",
35
+ "dev": "storybook dev -p 6006",
36
+ "check-types": "tsc --noEmit",
37
+ "storybook": "storybook build"
38
+ },
25
39
  "keywords": [],
26
40
  "author": "tinna@spesia.is",
27
41
  "license": "ISC",
42
+ "packageManager": "pnpm@10.0.0+sha512.b8fef5494bd3fe4cbd4edabd0745df2ee5be3e4b0b8b08fa643aa3e4c6702ccc0f00d68fa8a8c9858a735a0032485a44990ed2810526c875e416f001b17df12b",
28
43
  "devDependencies": {
29
44
  "@chromatic-com/storybook": "^5.0.0",
30
45
  "@emotion/react": "^11.14.0",
@@ -65,7 +80,7 @@
65
80
  "classnames": "^2.5.1",
66
81
  "date-fns": "^4.1.0",
67
82
  "lottie-react": "^2.4.1",
68
- "lucide-react": "^0.563.0",
83
+ "lucide-react": "^1.31.0",
69
84
  "vite-plugin-svgr": "^4.5.0"
70
85
  },
71
86
  "peerDependencies": {
@@ -85,19 +100,5 @@
85
100
  "bugs": {
86
101
  "url": "https://github.com/Spesia/spesia/issues"
87
102
  },
88
- "homepage": "https://ui.test.spesia.is",
89
- "scripts": {
90
- "build": "tsc && vite build",
91
- "build:analyze": "vite build && npx vite-bundle-visualizer",
92
- "test:ci": "vitest run",
93
- "test:watch": "vitest",
94
- "test-storybook": "test-storybook",
95
- "lint": "eslint",
96
- "lint:fix": "eslint --fix",
97
- "format": "prettier --check --ignore-path .gitignore .",
98
- "format:fix": "prettier --write --ignore-path .gitignore .",
99
- "dev": "storybook dev -p 6006",
100
- "check-types": "tsc --noEmit",
101
- "storybook": "storybook build"
102
- }
103
- }
103
+ "homepage": "https://ui.test.spesia.is"
104
+ }