@clearstory/drywall-react 8.0.2 → 8.0.3

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,104 +1,147 @@
1
- import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import { n as i, h as x } from "../../index-SzwnPTHF.js";
3
- import { useContext as h, useCallback as b } from "react";
1
+ import { jsxs as x, jsx as r } from "react/jsx-runtime";
2
+ import { n, h } from "../../index-SzwnPTHF.js";
3
+ import { useContext as b, useCallback as w } from "react";
4
4
  import "../../icons/ClearstoryIcon.js";
5
5
  import "../../icons/InternalOnlyIcon.js";
6
6
  import "../../icons/MoneyBucketIcon.js";
7
7
  import "../../icons/MoreCircleOutlineIcon.js";
8
8
  import "../../icons/SparkleIcon.js";
9
- import { I as w, E as I, W as v, C } from "../../WarningAmberOutlined-DMySBPYG.js";
10
- import { C as R } from "../../Close-DFkW1yae.js";
11
- import { ToastLabelContext as y } from "./ToastLabelContext.js";
12
- import { B as k } from "../../Box-tMEqMAfx.js";
9
+ import { I, E as C, W as R, C as S } from "../../WarningAmberOutlined-DMySBPYG.js";
10
+ import { C as A } from "../../Close-DFkW1yae.js";
11
+ import { ToastLabelContext as B } from "./ToastLabelContext.js";
12
+ import { B as y } from "../../Box-tMEqMAfx.js";
13
13
  import { A as m } from "../../Alert-BzbQJE20.js";
14
- import { I as T } from "../../IconButton-B1h37ok8.js";
15
- const q = () => {
16
- const t = h(y);
17
- if (!t)
14
+ import { I as k } from "../../IconButton-B1h37ok8.js";
15
+ const D = () => {
16
+ const a = b(B);
17
+ if (!a)
18
18
  throw new Error(
19
19
  'useToast must be used within a ToastProvider. Make sure to wrap your component with <ToastProvider closeAriaLabel="...">'
20
20
  );
21
- const { closeAriaLabel: n } = t;
21
+ const { closeAriaLabel: s } = a;
22
22
  return {
23
- notify: b(
24
- (c, l = {}) => {
25
- const { type: r = "info", details: e, ...d } = l, s = {
23
+ notify: w(
24
+ (c, d = {}) => {
25
+ const { type: e = "info", details: i, ...p } = d, l = {
26
26
  success: "success",
27
27
  warning: "warning",
28
28
  error: "error",
29
29
  info: "info"
30
- }, f = {
31
- success: /* @__PURE__ */ o(C, { sx: { marginRight: 0.5 } }),
32
- warning: /* @__PURE__ */ o(v, { sx: { marginRight: 0.5 } }),
33
- error: /* @__PURE__ */ o(I, { sx: { marginRight: 0.5 } }),
34
- info: /* @__PURE__ */ o(w, { sx: { marginRight: 0.5 } })
30
+ }, u = {
31
+ success: /* @__PURE__ */ r(
32
+ S,
33
+ {
34
+ sx: {
35
+ color: ({ vars: o }) => o?.palette.success.main,
36
+ marginRight: 0.5
37
+ }
38
+ }
39
+ ),
40
+ warning: /* @__PURE__ */ r(
41
+ R,
42
+ {
43
+ sx: {
44
+ color: ({ vars: o }) => o?.palette.warning.main,
45
+ marginRight: 0.5
46
+ }
47
+ }
48
+ ),
49
+ error: /* @__PURE__ */ r(
50
+ C,
51
+ {
52
+ sx: {
53
+ color: ({ vars: o }) => o?.palette.error.main,
54
+ marginRight: 0.5
55
+ }
56
+ }
57
+ ),
58
+ info: /* @__PURE__ */ r(
59
+ I,
60
+ {
61
+ sx: {
62
+ color: ({ vars: o }) => o?.palette.info.main,
63
+ marginRight: 0.5
64
+ }
65
+ }
66
+ )
35
67
  };
36
- return i(
37
- (a) => {
38
- const u = x(c, a);
39
- return /* @__PURE__ */ p(
40
- k,
68
+ return n(
69
+ (o) => {
70
+ const f = h(c, o);
71
+ return /* @__PURE__ */ x(
72
+ y,
41
73
  {
42
74
  sx: {
75
+ borderRadius: "4px",
76
+ boxShadow: 2,
43
77
  minWidth: { xs: "auto", sm: "18rem" },
44
78
  maxWidth: "18rem"
45
79
  },
46
80
  children: [
47
- /* @__PURE__ */ o(
81
+ /* @__PURE__ */ r(
48
82
  m,
49
83
  {
50
84
  role: "none",
51
- severity: s[r],
52
- variant: "filled",
53
- icon: f[r],
54
- action: /* @__PURE__ */ o(
55
- T,
85
+ severity: l[e],
86
+ variant: "standard",
87
+ icon: u[e],
88
+ action: /* @__PURE__ */ r(
89
+ k,
56
90
  {
57
91
  color: "inherit",
58
92
  size: "small",
59
- onClick: () => i.dismiss(a.id),
60
- "aria-label": n,
93
+ onClick: () => n.dismiss(o.id),
94
+ "aria-label": s,
61
95
  sx: {
62
96
  marginLeft: 0.5
63
97
  },
64
- children: /* @__PURE__ */ o(R, { fontSize: "small" })
98
+ children: /* @__PURE__ */ r(A, { fontSize: "small" })
65
99
  }
66
100
  ),
67
101
  sx: [
68
102
  {
69
- boxShadow: 2,
103
+ boxShadow: 0,
70
104
  fontSize: "0.875rem",
71
105
  zIndex: 2
72
106
  },
73
- !!e && {
107
+ !!i && {
74
108
  borderBottomLeftRadius: 0,
75
109
  borderBottomRightRadius: 0
76
110
  }
77
111
  ],
78
- children: u
112
+ children: f
79
113
  }
80
114
  ),
81
- e && /* @__PURE__ */ o(
115
+ i && /* @__PURE__ */ r(
82
116
  m,
83
117
  {
84
118
  role: "none",
85
119
  icon: !1,
86
- severity: s[r],
120
+ severity: l[e],
87
121
  variant: "outlined",
88
- sx: ({ vars: g }) => ({
89
- backgroundColor: g?.palette.background.surface,
90
- borderTopLeftRadius: 0,
91
- borderTopRightRadius: 0,
92
- boxShadow: 2,
93
- fontSize: "0.75rem",
94
- alignItems: "flex-start",
95
- fontWeight: "normal",
96
- maxHeight: "7rem",
97
- overflowX: "auto",
98
- overflowY: "auto",
99
- zIndex: 1
100
- }),
101
- children: e
122
+ sx: ({ vars: t }) => {
123
+ const g = {
124
+ success: t?.palette.Alert.successStandardBg,
125
+ warning: t?.palette.Alert.warningStandardBg,
126
+ error: t?.palette.Alert.errorStandardBg,
127
+ info: t?.palette.Alert.infoStandardBg
128
+ };
129
+ return {
130
+ backgroundColor: t?.palette.background.paper,
131
+ borderColor: g[e],
132
+ borderTopLeftRadius: 0,
133
+ borderTopRightRadius: 0,
134
+ boxShadow: 0,
135
+ fontSize: "0.75rem",
136
+ alignItems: "flex-start",
137
+ fontWeight: "normal",
138
+ maxHeight: "7rem",
139
+ overflowX: "auto",
140
+ overflowY: "auto",
141
+ zIndex: 1
142
+ };
143
+ },
144
+ children: i
102
145
  }
103
146
  )
104
147
  ]
@@ -113,18 +156,18 @@ const q = () => {
113
156
  background: "none",
114
157
  boxShadow: "none"
115
158
  },
116
- duration: r === "error" || r === "warning" ? 1 / 0 : 5e3,
159
+ duration: e === "error" || e === "warning" ? 1 / 0 : 5e3,
117
160
  icon: null,
118
- ...d
161
+ ...p
119
162
  }
120
163
  );
121
164
  },
122
- [n]
165
+ [s]
123
166
  ),
124
- dismissNotification: i.dismiss,
125
- removeNotifications: i.remove
167
+ dismissNotification: n.dismiss,
168
+ removeNotifications: n.remove
126
169
  };
127
170
  };
128
171
  export {
129
- q as useToast
172
+ D as useToast
130
173
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clearstory/drywall-react",
3
- "version": "8.0.2",
3
+ "version": "8.0.3",
4
4
  "license": "UNLICENSED",
5
5
  "description": "a Clearstory software design system",
6
6
  "type": "module",