@spesia/ui 1.10.8 → 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.
@@ -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,9 +1,9 @@
1
- import { colors as i } 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, r, o, e;
6
+ var a, i, r, e;
7
7
  return {
8
8
  ".MuiTabs-brand &": {
9
9
  color: t.vars.palette.text.primary,
@@ -72,7 +72,7 @@ const d = {
72
72
  opacity: 1,
73
73
  "&.Mui-selected": {
74
74
  background: (a = t.vars) == null ? void 0 : a.palette.background.brownBold,
75
- color: (r = t.vars) == null ? void 0 : r.palette.text.contrastText
75
+ color: (i = t.vars) == null ? void 0 : i.palette.text.contrastText
76
76
  },
77
77
  "@media (max-width: 599px)": {
78
78
  padding: 12,
@@ -80,6 +80,9 @@ const d = {
80
80
  paddingBottom: 0
81
81
  }
82
82
  },
83
+ ".MuiTabs-fullWidth &": {
84
+ flex: 1
85
+ },
83
86
  ".MuiTabs-rounded &": {
84
87
  color: t.vars.palette.text.secondary,
85
88
  padding: 28,
@@ -96,7 +99,7 @@ const d = {
96
99
  borderRadius: t.spacing(8),
97
100
  opacity: 1,
98
101
  "&.Mui-selected": {
99
- color: (o = t.vars) == null ? void 0 : o.palette.background.brownBold,
102
+ color: (r = t.vars) == null ? void 0 : r.palette.background.brownBold,
100
103
  background: (e = t.vars) == null ? void 0 : e.palette.text.contrastText
101
104
  },
102
105
  "@media (max-width: 599px)": {
@@ -116,6 +119,9 @@ const d = {
116
119
  "&.MuiTabs-stretched": {
117
120
  width: "100%",
118
121
  margin: 0
122
+ },
123
+ "&.MuiTabs-fullWidth": {
124
+ width: "100%"
119
125
  }
120
126
  }),
121
127
  scroller: () => ({
@@ -123,13 +129,16 @@ const d = {
123
129
  display: "flex",
124
130
  width: "auto"
125
131
  },
132
+ ".MuiTabs-fullWidth &": {
133
+ width: "100%"
134
+ },
126
135
  ".MuiTabs-stretched &": {
127
136
  display: "flex",
128
137
  width: "100%"
129
138
  }
130
139
  }),
131
140
  list: ({ theme: t }) => {
132
- var a, r, o;
141
+ var a, i, r;
133
142
  return {
134
143
  counterReset: "MuiTab-root",
135
144
  ".MuiTabs-stretched &": {
@@ -143,7 +152,7 @@ const d = {
143
152
  backgroundColor: (a = t.vars) == null ? void 0 : a.palette.background.paper,
144
153
  borderRadius: t.spacing(2),
145
154
  border: "1px solid",
146
- borderColor: (r = t == null ? void 0 : t.vars) == null ? void 0 : r.palette.border.primary,
155
+ borderColor: (i = t == null ? void 0 : t.vars) == null ? void 0 : i.palette.border.primary,
147
156
  display: "flex",
148
157
  alignItems: "center",
149
158
  justifyContent: "flex-start",
@@ -151,7 +160,7 @@ const d = {
151
160
  padding: 4
152
161
  },
153
162
  ".MuiTabs-rounded &": {
154
- backgroundColor: (o = t.vars) == null ? void 0 : o.palette.background.alphaBrown,
163
+ backgroundColor: (r = t.vars) == null ? void 0 : r.palette.background.alphaBrown,
155
164
  borderRadius: t.spacing(8),
156
165
  border: "0px solid",
157
166
  display: "flex",
@@ -160,12 +169,15 @@ const d = {
160
169
  justifyContent: "flex-start",
161
170
  gap: 0,
162
171
  padding: 0
172
+ },
173
+ ".MuiTabs-fullWidth &": {
174
+ width: "100%"
163
175
  }
164
176
  };
165
177
  },
166
178
  indicator: (t) => ({
167
179
  ".MuiTabs-brand &": {
168
- backgroundColor: i.primary.beige[10],
180
+ backgroundColor: o.primary.beige[10],
169
181
  height: "5px",
170
182
  top: 0,
171
183
  bottom: "auto",
@@ -181,12 +193,12 @@ const d = {
181
193
  width: "var(--indicator-width, 100%)",
182
194
  height: "100%",
183
195
  borderRadius: t.theme.spacing(3),
184
- backgroundColor: i.primary.coral[100],
196
+ backgroundColor: o.primary.coral[100],
185
197
  transition: "width 0.3s ease"
186
198
  }
187
199
  },
188
200
  ".MuiTabs-stretched &": {
189
- backgroundColor: i.primary.brown[50],
201
+ backgroundColor: o.primary.brown[50],
190
202
  height: "2px",
191
203
  borderRadius: t.theme.spacing(2)
192
204
  },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.10.8",
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
+ }