@loopr-ai/craft 0.1.0 → 0.3.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.
- package/dist/ButtonBase-750a4103.js +832 -0
- package/dist/TransitionGroupContext-e16207d6.js +127 -0
- package/dist/assets/theme.css +1 -0
- package/dist/chainPropTypes-004bf492.js +8 -0
- package/dist/components/cell/AvatarGroup/index.d.ts +31 -0
- package/dist/components/cell/AvatarGroup/index.js +390 -0
- package/dist/components/cell/Button/index.d.ts +19 -4
- package/dist/components/cell/Button/index.js +383 -4
- package/dist/components/cell/Chip/index.d.ts +27 -0
- package/dist/components/cell/Chip/index.js +483 -0
- package/dist/components/cell/ProgressBar/index.d.ts +27 -0
- package/dist/components/cell/ProgressBar/index.js +326 -0
- package/dist/components/cell/Search/index.d.ts +25 -0
- package/dist/components/cell/Search/index.js +26358 -0
- package/dist/components/cell/Typography/index.d.ts +20 -0
- package/dist/components/cell/Typography/index.js +217 -0
- package/dist/createSvgIcon-5dcb7caa.js +184 -0
- package/dist/createTheme-95c30431.js +2221 -0
- package/dist/emotion-react.browser.esm-ff33c213.js +439 -0
- package/dist/exactProp-a28c53c1.js +13 -0
- package/dist/global/colors.d.ts +16 -0
- package/dist/global/colors.js +22 -0
- package/dist/global/constants.js +1 -0
- package/dist/global/enums.js +1 -0
- package/dist/global/interfaces.d.ts +6 -0
- package/dist/global/interfaces.js +1 -0
- package/dist/global/theme.d.ts +35 -0
- package/dist/global/theme.js +76 -0
- package/dist/main.d.ts +8 -2
- package/dist/main.js +14 -4
- package/dist/providers/CraftThemeProvider.d.ts +16 -0
- package/dist/providers/CraftThemeProvider.js +135 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +4 -0
- package/dist/styled-05df7dc6.js +699 -0
- package/dist/unsupportedProp-3dbf01f6.js +9 -0
- package/dist/useTheme-462e5dc6.js +10 -0
- package/dist/useThemeWithoutDefault-188598a8.js +950 -0
- package/package.json +24 -3
- package/dist/components/cell/Input/index.d.ts +0 -5
- package/dist/components/cell/Input/index.js +0 -6
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import { jsx as m, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { useMemo as L } from "react";
|
|
4
|
+
import { g as X, c as r, _ as f, e as b, a as Y, P as l } from "../../../createTheme-95c30431.js";
|
|
5
|
+
import { g as Z, s as U, a as w, c as k, b as oo } from "../../../styled-05df7dc6.js";
|
|
6
|
+
import { c as ao } from "../../../createSvgIcon-5dcb7caa.js";
|
|
7
|
+
import { u as lo } from "../../../TransitionGroupContext-e16207d6.js";
|
|
8
|
+
import { B as M } from "../../../ButtonBase-750a4103.js";
|
|
9
|
+
import { u as eo } from "../../../unsupportedProp-3dbf01f6.js";
|
|
10
|
+
const ro = ao(/* @__PURE__ */ m("path", {
|
|
11
|
+
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
|
|
12
|
+
}), "Cancel");
|
|
13
|
+
function co(o) {
|
|
14
|
+
return X("MuiChip", o);
|
|
15
|
+
}
|
|
16
|
+
const io = Z("MuiChip", ["root", "sizeSmall", "sizeMedium", "colorError", "colorInfo", "colorPrimary", "colorSecondary", "colorSuccess", "colorWarning", "disabled", "clickable", "clickableColorPrimary", "clickableColorSecondary", "deletable", "deletableColorPrimary", "deletableColorSecondary", "outlined", "filled", "outlinedPrimary", "outlinedSecondary", "filledPrimary", "filledSecondary", "avatar", "avatarSmall", "avatarMedium", "avatarColorPrimary", "avatarColorSecondary", "icon", "iconSmall", "iconMedium", "iconColorPrimary", "iconColorSecondary", "label", "labelSmall", "labelMedium", "deleteIcon", "deleteIconSmall", "deleteIconMedium", "deleteIconColorPrimary", "deleteIconColorSecondary", "deleteIconOutlinedColorPrimary", "deleteIconOutlinedColorSecondary", "deleteIconFilledColorPrimary", "deleteIconFilledColorSecondary", "focusVisible"]), e = io, to = ["avatar", "className", "clickable", "color", "component", "deleteIcon", "disabled", "icon", "label", "onClick", "onDelete", "onKeyDown", "onKeyUp", "size", "variant", "tabIndex", "skipFocusWhenDisabled"], no = (o) => {
|
|
17
|
+
const {
|
|
18
|
+
classes: a,
|
|
19
|
+
disabled: s,
|
|
20
|
+
size: c,
|
|
21
|
+
color: t,
|
|
22
|
+
iconColor: p,
|
|
23
|
+
onDelete: d,
|
|
24
|
+
clickable: i,
|
|
25
|
+
variant: u
|
|
26
|
+
} = o, $ = {
|
|
27
|
+
root: ["root", u, s && "disabled", `size${r(c)}`, `color${r(t)}`, i && "clickable", i && `clickableColor${r(t)}`, d && "deletable", d && `deletableColor${r(t)}`, `${u}${r(t)}`],
|
|
28
|
+
label: ["label", `label${r(c)}`],
|
|
29
|
+
avatar: ["avatar", `avatar${r(c)}`, `avatarColor${r(t)}`],
|
|
30
|
+
icon: ["icon", `icon${r(c)}`, `iconColor${r(p)}`],
|
|
31
|
+
deleteIcon: ["deleteIcon", `deleteIcon${r(c)}`, `deleteIconColor${r(t)}`, `deleteIcon${r(u)}Color${r(t)}`]
|
|
32
|
+
};
|
|
33
|
+
return oo($, co, a);
|
|
34
|
+
}, so = U("div", {
|
|
35
|
+
name: "MuiChip",
|
|
36
|
+
slot: "Root",
|
|
37
|
+
overridesResolver: (o, a) => {
|
|
38
|
+
const {
|
|
39
|
+
ownerState: s
|
|
40
|
+
} = o, {
|
|
41
|
+
color: c,
|
|
42
|
+
iconColor: t,
|
|
43
|
+
clickable: p,
|
|
44
|
+
onDelete: d,
|
|
45
|
+
size: i,
|
|
46
|
+
variant: u
|
|
47
|
+
} = s;
|
|
48
|
+
return [{
|
|
49
|
+
[`& .${e.avatar}`]: a.avatar
|
|
50
|
+
}, {
|
|
51
|
+
[`& .${e.avatar}`]: a[`avatar${r(i)}`]
|
|
52
|
+
}, {
|
|
53
|
+
[`& .${e.avatar}`]: a[`avatarColor${r(c)}`]
|
|
54
|
+
}, {
|
|
55
|
+
[`& .${e.icon}`]: a.icon
|
|
56
|
+
}, {
|
|
57
|
+
[`& .${e.icon}`]: a[`icon${r(i)}`]
|
|
58
|
+
}, {
|
|
59
|
+
[`& .${e.icon}`]: a[`iconColor${r(t)}`]
|
|
60
|
+
}, {
|
|
61
|
+
[`& .${e.deleteIcon}`]: a.deleteIcon
|
|
62
|
+
}, {
|
|
63
|
+
[`& .${e.deleteIcon}`]: a[`deleteIcon${r(i)}`]
|
|
64
|
+
}, {
|
|
65
|
+
[`& .${e.deleteIcon}`]: a[`deleteIconColor${r(c)}`]
|
|
66
|
+
}, {
|
|
67
|
+
[`& .${e.deleteIcon}`]: a[`deleteIcon${r(u)}Color${r(c)}`]
|
|
68
|
+
}, a.root, a[`size${r(i)}`], a[`color${r(c)}`], p && a.clickable, p && c !== "default" && a[`clickableColor${r(c)})`], d && a.deletable, d && c !== "default" && a[`deletableColor${r(c)}`], a[u], a[`${u}${r(c)}`]];
|
|
69
|
+
}
|
|
70
|
+
})(({
|
|
71
|
+
theme: o,
|
|
72
|
+
ownerState: a
|
|
73
|
+
}) => {
|
|
74
|
+
const s = o.palette.mode === "light" ? o.palette.grey[700] : o.palette.grey[300];
|
|
75
|
+
return f({
|
|
76
|
+
maxWidth: "100%",
|
|
77
|
+
fontFamily: o.typography.fontFamily,
|
|
78
|
+
fontSize: o.typography.pxToRem(13),
|
|
79
|
+
display: "inline-flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
height: 32,
|
|
83
|
+
color: (o.vars || o).palette.text.primary,
|
|
84
|
+
backgroundColor: (o.vars || o).palette.action.selected,
|
|
85
|
+
borderRadius: 32 / 2,
|
|
86
|
+
whiteSpace: "nowrap",
|
|
87
|
+
transition: o.transitions.create(["background-color", "box-shadow"]),
|
|
88
|
+
// We disable the focus ring for mouse, touch and keyboard users.
|
|
89
|
+
outline: 0,
|
|
90
|
+
textDecoration: "none",
|
|
91
|
+
border: 0,
|
|
92
|
+
// Remove `button` border
|
|
93
|
+
padding: 0,
|
|
94
|
+
// Remove `button` padding
|
|
95
|
+
verticalAlign: "middle",
|
|
96
|
+
boxSizing: "border-box",
|
|
97
|
+
[`&.${e.disabled}`]: {
|
|
98
|
+
opacity: (o.vars || o).palette.action.disabledOpacity,
|
|
99
|
+
pointerEvents: "none"
|
|
100
|
+
},
|
|
101
|
+
[`& .${e.avatar}`]: {
|
|
102
|
+
marginLeft: 5,
|
|
103
|
+
marginRight: -6,
|
|
104
|
+
width: 24,
|
|
105
|
+
height: 24,
|
|
106
|
+
color: o.vars ? o.vars.palette.Chip.defaultAvatarColor : s,
|
|
107
|
+
fontSize: o.typography.pxToRem(12)
|
|
108
|
+
},
|
|
109
|
+
[`& .${e.avatarColorPrimary}`]: {
|
|
110
|
+
color: (o.vars || o).palette.primary.contrastText,
|
|
111
|
+
backgroundColor: (o.vars || o).palette.primary.dark
|
|
112
|
+
},
|
|
113
|
+
[`& .${e.avatarColorSecondary}`]: {
|
|
114
|
+
color: (o.vars || o).palette.secondary.contrastText,
|
|
115
|
+
backgroundColor: (o.vars || o).palette.secondary.dark
|
|
116
|
+
},
|
|
117
|
+
[`& .${e.avatarSmall}`]: {
|
|
118
|
+
marginLeft: 4,
|
|
119
|
+
marginRight: -4,
|
|
120
|
+
width: 18,
|
|
121
|
+
height: 18,
|
|
122
|
+
fontSize: o.typography.pxToRem(10)
|
|
123
|
+
},
|
|
124
|
+
[`& .${e.icon}`]: f({
|
|
125
|
+
marginLeft: 5,
|
|
126
|
+
marginRight: -6
|
|
127
|
+
}, a.size === "small" && {
|
|
128
|
+
fontSize: 18,
|
|
129
|
+
marginLeft: 4,
|
|
130
|
+
marginRight: -4
|
|
131
|
+
}, a.iconColor === a.color && f({
|
|
132
|
+
color: o.vars ? o.vars.palette.Chip.defaultIconColor : s
|
|
133
|
+
}, a.color !== "default" && {
|
|
134
|
+
color: "inherit"
|
|
135
|
+
})),
|
|
136
|
+
[`& .${e.deleteIcon}`]: f({
|
|
137
|
+
WebkitTapHighlightColor: "transparent",
|
|
138
|
+
color: o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / 0.26)` : b(o.palette.text.primary, 0.26),
|
|
139
|
+
fontSize: 22,
|
|
140
|
+
cursor: "pointer",
|
|
141
|
+
margin: "0 5px 0 -6px",
|
|
142
|
+
"&:hover": {
|
|
143
|
+
color: o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / 0.4)` : b(o.palette.text.primary, 0.4)
|
|
144
|
+
}
|
|
145
|
+
}, a.size === "small" && {
|
|
146
|
+
fontSize: 16,
|
|
147
|
+
marginRight: 4,
|
|
148
|
+
marginLeft: -4
|
|
149
|
+
}, a.color !== "default" && {
|
|
150
|
+
color: o.vars ? `rgba(${o.vars.palette[a.color].contrastTextChannel} / 0.7)` : b(o.palette[a.color].contrastText, 0.7),
|
|
151
|
+
"&:hover, &:active": {
|
|
152
|
+
color: (o.vars || o).palette[a.color].contrastText
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
}, a.size === "small" && {
|
|
156
|
+
height: 24
|
|
157
|
+
}, a.color !== "default" && {
|
|
158
|
+
backgroundColor: (o.vars || o).palette[a.color].main,
|
|
159
|
+
color: (o.vars || o).palette[a.color].contrastText
|
|
160
|
+
}, a.onDelete && {
|
|
161
|
+
[`&.${e.focusVisible}`]: {
|
|
162
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))` : b(o.palette.action.selected, o.palette.action.selectedOpacity + o.palette.action.focusOpacity)
|
|
163
|
+
}
|
|
164
|
+
}, a.onDelete && a.color !== "default" && {
|
|
165
|
+
[`&.${e.focusVisible}`]: {
|
|
166
|
+
backgroundColor: (o.vars || o).palette[a.color].dark
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}, ({
|
|
170
|
+
theme: o,
|
|
171
|
+
ownerState: a
|
|
172
|
+
}) => f({}, a.clickable && {
|
|
173
|
+
userSelect: "none",
|
|
174
|
+
WebkitTapHighlightColor: "transparent",
|
|
175
|
+
cursor: "pointer",
|
|
176
|
+
"&:hover": {
|
|
177
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))` : b(o.palette.action.selected, o.palette.action.selectedOpacity + o.palette.action.hoverOpacity)
|
|
178
|
+
},
|
|
179
|
+
[`&.${e.focusVisible}`]: {
|
|
180
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))` : b(o.palette.action.selected, o.palette.action.selectedOpacity + o.palette.action.focusOpacity)
|
|
181
|
+
},
|
|
182
|
+
"&:active": {
|
|
183
|
+
boxShadow: (o.vars || o).shadows[1]
|
|
184
|
+
}
|
|
185
|
+
}, a.clickable && a.color !== "default" && {
|
|
186
|
+
[`&:hover, &.${e.focusVisible}`]: {
|
|
187
|
+
backgroundColor: (o.vars || o).palette[a.color].dark
|
|
188
|
+
}
|
|
189
|
+
}), ({
|
|
190
|
+
theme: o,
|
|
191
|
+
ownerState: a
|
|
192
|
+
}) => f({}, a.variant === "outlined" && {
|
|
193
|
+
backgroundColor: "transparent",
|
|
194
|
+
border: o.vars ? `1px solid ${o.vars.palette.Chip.defaultBorder}` : `1px solid ${o.palette.mode === "light" ? o.palette.grey[400] : o.palette.grey[700]}`,
|
|
195
|
+
[`&.${e.clickable}:hover`]: {
|
|
196
|
+
backgroundColor: (o.vars || o).palette.action.hover
|
|
197
|
+
},
|
|
198
|
+
[`&.${e.focusVisible}`]: {
|
|
199
|
+
backgroundColor: (o.vars || o).palette.action.focus
|
|
200
|
+
},
|
|
201
|
+
[`& .${e.avatar}`]: {
|
|
202
|
+
marginLeft: 4
|
|
203
|
+
},
|
|
204
|
+
[`& .${e.avatarSmall}`]: {
|
|
205
|
+
marginLeft: 2
|
|
206
|
+
},
|
|
207
|
+
[`& .${e.icon}`]: {
|
|
208
|
+
marginLeft: 4
|
|
209
|
+
},
|
|
210
|
+
[`& .${e.iconSmall}`]: {
|
|
211
|
+
marginLeft: 2
|
|
212
|
+
},
|
|
213
|
+
[`& .${e.deleteIcon}`]: {
|
|
214
|
+
marginRight: 5
|
|
215
|
+
},
|
|
216
|
+
[`& .${e.deleteIconSmall}`]: {
|
|
217
|
+
marginRight: 3
|
|
218
|
+
}
|
|
219
|
+
}, a.variant === "outlined" && a.color !== "default" && {
|
|
220
|
+
color: (o.vars || o).palette[a.color].main,
|
|
221
|
+
border: `1px solid ${o.vars ? `rgba(${o.vars.palette[a.color].mainChannel} / 0.7)` : b(o.palette[a.color].main, 0.7)}`,
|
|
222
|
+
[`&.${e.clickable}:hover`]: {
|
|
223
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : b(o.palette[a.color].main, o.palette.action.hoverOpacity)
|
|
224
|
+
},
|
|
225
|
+
[`&.${e.focusVisible}`]: {
|
|
226
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.focusOpacity})` : b(o.palette[a.color].main, o.palette.action.focusOpacity)
|
|
227
|
+
},
|
|
228
|
+
[`& .${e.deleteIcon}`]: {
|
|
229
|
+
color: o.vars ? `rgba(${o.vars.palette[a.color].mainChannel} / 0.7)` : b(o.palette[a.color].main, 0.7),
|
|
230
|
+
"&:hover, &:active": {
|
|
231
|
+
color: (o.vars || o).palette[a.color].main
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
})), po = U("span", {
|
|
235
|
+
name: "MuiChip",
|
|
236
|
+
slot: "Label",
|
|
237
|
+
overridesResolver: (o, a) => {
|
|
238
|
+
const {
|
|
239
|
+
ownerState: s
|
|
240
|
+
} = o, {
|
|
241
|
+
size: c
|
|
242
|
+
} = s;
|
|
243
|
+
return [a.label, a[`label${r(c)}`]];
|
|
244
|
+
}
|
|
245
|
+
})(({
|
|
246
|
+
ownerState: o
|
|
247
|
+
}) => f({
|
|
248
|
+
overflow: "hidden",
|
|
249
|
+
textOverflow: "ellipsis",
|
|
250
|
+
paddingLeft: 12,
|
|
251
|
+
paddingRight: 12,
|
|
252
|
+
whiteSpace: "nowrap"
|
|
253
|
+
}, o.size === "small" && {
|
|
254
|
+
paddingLeft: 8,
|
|
255
|
+
paddingRight: 8
|
|
256
|
+
}));
|
|
257
|
+
function K(o) {
|
|
258
|
+
return o.key === "Backspace" || o.key === "Delete";
|
|
259
|
+
}
|
|
260
|
+
const S = /* @__PURE__ */ v.forwardRef(function(a, s) {
|
|
261
|
+
const c = w({
|
|
262
|
+
props: a,
|
|
263
|
+
name: "MuiChip"
|
|
264
|
+
}), {
|
|
265
|
+
avatar: t,
|
|
266
|
+
className: p,
|
|
267
|
+
clickable: d,
|
|
268
|
+
color: i = "default",
|
|
269
|
+
component: u,
|
|
270
|
+
deleteIcon: $,
|
|
271
|
+
disabled: I = !1,
|
|
272
|
+
icon: y,
|
|
273
|
+
label: W,
|
|
274
|
+
onClick: D,
|
|
275
|
+
onDelete: C,
|
|
276
|
+
onKeyDown: F,
|
|
277
|
+
onKeyUp: E,
|
|
278
|
+
size: j = "medium",
|
|
279
|
+
variant: B = "filled",
|
|
280
|
+
tabIndex: h,
|
|
281
|
+
skipFocusWhenDisabled: _ = !1
|
|
282
|
+
// TODO v6: Rename to `focusableWhenDisabled`.
|
|
283
|
+
} = c, A = Y(c, to), x = v.useRef(null), H = lo(x, s), N = (n) => {
|
|
284
|
+
n.stopPropagation(), C && C(n);
|
|
285
|
+
}, q = (n) => {
|
|
286
|
+
n.currentTarget === n.target && K(n) && n.preventDefault(), F && F(n);
|
|
287
|
+
}, G = (n) => {
|
|
288
|
+
n.currentTarget === n.target && (C && K(n) ? C(n) : n.key === "Escape" && x.current && x.current.blur()), E && E(n);
|
|
289
|
+
}, O = d !== !1 && D ? !0 : d, R = O || C ? M : u || "div", z = f({}, c, {
|
|
290
|
+
component: R,
|
|
291
|
+
disabled: I,
|
|
292
|
+
size: j,
|
|
293
|
+
color: i,
|
|
294
|
+
iconColor: /* @__PURE__ */ v.isValidElement(y) && y.props.color || i,
|
|
295
|
+
onDelete: !!C,
|
|
296
|
+
clickable: O,
|
|
297
|
+
variant: B
|
|
298
|
+
}), g = no(z), J = R === M ? f({
|
|
299
|
+
component: u || "div",
|
|
300
|
+
focusVisibleClassName: g.focusVisible
|
|
301
|
+
}, C && {
|
|
302
|
+
disableRipple: !0
|
|
303
|
+
}) : {};
|
|
304
|
+
let V = null;
|
|
305
|
+
C && (V = $ && /* @__PURE__ */ v.isValidElement($) ? /* @__PURE__ */ v.cloneElement($, {
|
|
306
|
+
className: k($.props.className, g.deleteIcon),
|
|
307
|
+
onClick: N
|
|
308
|
+
}) : /* @__PURE__ */ m(ro, {
|
|
309
|
+
className: k(g.deleteIcon),
|
|
310
|
+
onClick: N
|
|
311
|
+
}));
|
|
312
|
+
let P = null;
|
|
313
|
+
t && /* @__PURE__ */ v.isValidElement(t) && (P = /* @__PURE__ */ v.cloneElement(t, {
|
|
314
|
+
className: k(g.avatar, t.props.className)
|
|
315
|
+
}));
|
|
316
|
+
let T = null;
|
|
317
|
+
return y && /* @__PURE__ */ v.isValidElement(y) && (T = /* @__PURE__ */ v.cloneElement(y, {
|
|
318
|
+
className: k(g.icon, y.props.className)
|
|
319
|
+
})), process.env.NODE_ENV !== "production" && P && T && console.error("MUI: The Chip component can not handle the avatar and the icon prop at the same time. Pick one."), /* @__PURE__ */ Q(so, f({
|
|
320
|
+
as: R,
|
|
321
|
+
className: k(g.root, p),
|
|
322
|
+
disabled: O && I ? !0 : void 0,
|
|
323
|
+
onClick: D,
|
|
324
|
+
onKeyDown: q,
|
|
325
|
+
onKeyUp: G,
|
|
326
|
+
ref: H,
|
|
327
|
+
tabIndex: _ && I ? -1 : h,
|
|
328
|
+
ownerState: z
|
|
329
|
+
}, J, A, {
|
|
330
|
+
children: [P || T, /* @__PURE__ */ m(po, {
|
|
331
|
+
className: k(g.label),
|
|
332
|
+
ownerState: z,
|
|
333
|
+
children: W
|
|
334
|
+
}), V]
|
|
335
|
+
}));
|
|
336
|
+
});
|
|
337
|
+
process.env.NODE_ENV !== "production" && (S.propTypes = {
|
|
338
|
+
// ----------------------------- Warning --------------------------------
|
|
339
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
340
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
341
|
+
// ----------------------------------------------------------------------
|
|
342
|
+
/**
|
|
343
|
+
* The Avatar element to display.
|
|
344
|
+
*/
|
|
345
|
+
avatar: l.element,
|
|
346
|
+
/**
|
|
347
|
+
* This prop isn't supported.
|
|
348
|
+
* Use the `component` prop if you need to change the children structure.
|
|
349
|
+
*/
|
|
350
|
+
children: eo,
|
|
351
|
+
/**
|
|
352
|
+
* Override or extend the styles applied to the component.
|
|
353
|
+
*/
|
|
354
|
+
classes: l.object,
|
|
355
|
+
/**
|
|
356
|
+
* @ignore
|
|
357
|
+
*/
|
|
358
|
+
className: l.string,
|
|
359
|
+
/**
|
|
360
|
+
* If `true`, the chip will appear clickable, and will raise when pressed,
|
|
361
|
+
* even if the onClick prop is not defined.
|
|
362
|
+
* If `false`, the chip will not appear clickable, even if onClick prop is defined.
|
|
363
|
+
* This can be used, for example,
|
|
364
|
+
* along with the component prop to indicate an anchor Chip is clickable.
|
|
365
|
+
* Note: this controls the UI and does not affect the onClick event.
|
|
366
|
+
*/
|
|
367
|
+
clickable: l.bool,
|
|
368
|
+
/**
|
|
369
|
+
* The color of the component.
|
|
370
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
371
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
372
|
+
* @default 'default'
|
|
373
|
+
*/
|
|
374
|
+
color: l.oneOfType([l.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), l.string]),
|
|
375
|
+
/**
|
|
376
|
+
* The component used for the root node.
|
|
377
|
+
* Either a string to use a HTML element or a component.
|
|
378
|
+
*/
|
|
379
|
+
component: l.elementType,
|
|
380
|
+
/**
|
|
381
|
+
* Override the default delete icon element. Shown only if `onDelete` is set.
|
|
382
|
+
*/
|
|
383
|
+
deleteIcon: l.element,
|
|
384
|
+
/**
|
|
385
|
+
* If `true`, the component is disabled.
|
|
386
|
+
* @default false
|
|
387
|
+
*/
|
|
388
|
+
disabled: l.bool,
|
|
389
|
+
/**
|
|
390
|
+
* Icon element.
|
|
391
|
+
*/
|
|
392
|
+
icon: l.element,
|
|
393
|
+
/**
|
|
394
|
+
* The content of the component.
|
|
395
|
+
*/
|
|
396
|
+
label: l.node,
|
|
397
|
+
/**
|
|
398
|
+
* @ignore
|
|
399
|
+
*/
|
|
400
|
+
onClick: l.func,
|
|
401
|
+
/**
|
|
402
|
+
* Callback fired when the delete icon is clicked.
|
|
403
|
+
* If set, the delete icon will be shown.
|
|
404
|
+
*/
|
|
405
|
+
onDelete: l.func,
|
|
406
|
+
/**
|
|
407
|
+
* @ignore
|
|
408
|
+
*/
|
|
409
|
+
onKeyDown: l.func,
|
|
410
|
+
/**
|
|
411
|
+
* @ignore
|
|
412
|
+
*/
|
|
413
|
+
onKeyUp: l.func,
|
|
414
|
+
/**
|
|
415
|
+
* The size of the component.
|
|
416
|
+
* @default 'medium'
|
|
417
|
+
*/
|
|
418
|
+
size: l.oneOfType([l.oneOf(["medium", "small"]), l.string]),
|
|
419
|
+
/**
|
|
420
|
+
* If `true`, allows the disabled chip to escape focus.
|
|
421
|
+
* If `false`, allows the disabled chip to receive focus.
|
|
422
|
+
* @default false
|
|
423
|
+
*/
|
|
424
|
+
skipFocusWhenDisabled: l.bool,
|
|
425
|
+
/**
|
|
426
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
427
|
+
*/
|
|
428
|
+
sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
|
|
429
|
+
/**
|
|
430
|
+
* @ignore
|
|
431
|
+
*/
|
|
432
|
+
tabIndex: l.number,
|
|
433
|
+
/**
|
|
434
|
+
* The variant to use.
|
|
435
|
+
* @default 'filled'
|
|
436
|
+
*/
|
|
437
|
+
variant: l.oneOfType([l.oneOf(["filled", "outlined"]), l.string])
|
|
438
|
+
});
|
|
439
|
+
const uo = S, bo = {
|
|
440
|
+
new: {
|
|
441
|
+
color: "#E0F2FF",
|
|
442
|
+
textColor: "#3C4FE0"
|
|
443
|
+
},
|
|
444
|
+
active: {
|
|
445
|
+
color: "#FFF7E2",
|
|
446
|
+
textColor: "#E7AB11"
|
|
447
|
+
},
|
|
448
|
+
completed: {
|
|
449
|
+
color: "#0EB43C1F",
|
|
450
|
+
textColor: "#0EB43C"
|
|
451
|
+
},
|
|
452
|
+
error: {
|
|
453
|
+
color: "#FF00001F",
|
|
454
|
+
textColor: "#FF0000"
|
|
455
|
+
}
|
|
456
|
+
}, Io = ({
|
|
457
|
+
color: o,
|
|
458
|
+
textColor: a,
|
|
459
|
+
status: s = "new",
|
|
460
|
+
sx: c,
|
|
461
|
+
...t
|
|
462
|
+
}) => {
|
|
463
|
+
const p = L(() => {
|
|
464
|
+
let i = {};
|
|
465
|
+
return i = o ? { color: o } : i, i = a ? { ...i, textColor: a } : i, {
|
|
466
|
+
...bo[s],
|
|
467
|
+
...i
|
|
468
|
+
};
|
|
469
|
+
}, [o, a, s]), d = L(
|
|
470
|
+
() => ({
|
|
471
|
+
borderRadius: "0.5rem",
|
|
472
|
+
backgroundColor: p.color,
|
|
473
|
+
color: p.textColor,
|
|
474
|
+
fontWeight: 700,
|
|
475
|
+
...c
|
|
476
|
+
}),
|
|
477
|
+
[p]
|
|
478
|
+
);
|
|
479
|
+
return /* @__PURE__ */ m(uo, { sx: d, ...t });
|
|
480
|
+
};
|
|
481
|
+
export {
|
|
482
|
+
Io as default
|
|
483
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LinearProgressProps as MuiLinearProgressProps } from "@mui/material/LinearProgress";
|
|
2
|
+
import { CraftFC } from "../../../global/interfaces";
|
|
3
|
+
/**
|
|
4
|
+
* This ProgressBar Component is a wrapper of MuiLinearProgress Component with some custom styles for the look props
|
|
5
|
+
* @param value The value of the progress indicator should be between 0 and 100 (inclusive)
|
|
6
|
+
* @param extrapolateColor A function that returns a color string based on the value of the progress indicator
|
|
7
|
+
* @param trackColor The color of the track
|
|
8
|
+
*/
|
|
9
|
+
export interface ProgressBarProps extends MuiLinearProgressProps {
|
|
10
|
+
/**
|
|
11
|
+
* The function that returns a color string based on the value of the progress indicator
|
|
12
|
+
* example:
|
|
13
|
+
* ```tsx
|
|
14
|
+
* function extrapolateColor(value: number) {
|
|
15
|
+
*return value >= 55 ? "red" : "green";
|
|
16
|
+
*}
|
|
17
|
+
*<ProgressBar value={55} extrapolateColor={extrapolateColor} trackColor="purple"></ProgressBar>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
extrapolateColor?: (value: number) => string;
|
|
21
|
+
trackColor?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* This ProgressBar Component is a wrapper of MuiLinearProgress Component with some custom styles for the look props
|
|
25
|
+
*/
|
|
26
|
+
declare const ProgressBar: CraftFC<ProgressBarProps>;
|
|
27
|
+
export default ProgressBar;
|