@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.
Files changed (41) hide show
  1. package/dist/ButtonBase-750a4103.js +832 -0
  2. package/dist/TransitionGroupContext-e16207d6.js +127 -0
  3. package/dist/assets/theme.css +1 -0
  4. package/dist/chainPropTypes-004bf492.js +8 -0
  5. package/dist/components/cell/AvatarGroup/index.d.ts +31 -0
  6. package/dist/components/cell/AvatarGroup/index.js +390 -0
  7. package/dist/components/cell/Button/index.d.ts +19 -4
  8. package/dist/components/cell/Button/index.js +383 -4
  9. package/dist/components/cell/Chip/index.d.ts +27 -0
  10. package/dist/components/cell/Chip/index.js +483 -0
  11. package/dist/components/cell/ProgressBar/index.d.ts +27 -0
  12. package/dist/components/cell/ProgressBar/index.js +326 -0
  13. package/dist/components/cell/Search/index.d.ts +25 -0
  14. package/dist/components/cell/Search/index.js +26358 -0
  15. package/dist/components/cell/Typography/index.d.ts +20 -0
  16. package/dist/components/cell/Typography/index.js +217 -0
  17. package/dist/createSvgIcon-5dcb7caa.js +184 -0
  18. package/dist/createTheme-95c30431.js +2221 -0
  19. package/dist/emotion-react.browser.esm-ff33c213.js +439 -0
  20. package/dist/exactProp-a28c53c1.js +13 -0
  21. package/dist/global/colors.d.ts +16 -0
  22. package/dist/global/colors.js +22 -0
  23. package/dist/global/constants.js +1 -0
  24. package/dist/global/enums.js +1 -0
  25. package/dist/global/interfaces.d.ts +6 -0
  26. package/dist/global/interfaces.js +1 -0
  27. package/dist/global/theme.d.ts +35 -0
  28. package/dist/global/theme.js +76 -0
  29. package/dist/main.d.ts +8 -2
  30. package/dist/main.js +14 -4
  31. package/dist/providers/CraftThemeProvider.d.ts +16 -0
  32. package/dist/providers/CraftThemeProvider.js +135 -0
  33. package/dist/providers/index.d.ts +2 -0
  34. package/dist/providers/index.js +4 -0
  35. package/dist/styled-05df7dc6.js +699 -0
  36. package/dist/unsupportedProp-3dbf01f6.js +9 -0
  37. package/dist/useTheme-462e5dc6.js +10 -0
  38. package/dist/useThemeWithoutDefault-188598a8.js +950 -0
  39. package/package.json +24 -3
  40. package/dist/components/cell/Input/index.d.ts +0 -5
  41. package/dist/components/cell/Input/index.js +0 -6
@@ -0,0 +1,326 @@
1
+ import { jsxs as j, jsx as v } from "react/jsx-runtime";
2
+ import { getColorToHex as $ } from "../../../global/colors.js";
3
+ import { g as D, c as n, _ as l, a as q, P as o, l as E, d as U } from "../../../createTheme-95c30431.js";
4
+ import * as z from "react";
5
+ import { g as w, s as h, a as A, c as F, b as K } from "../../../styled-05df7dc6.js";
6
+ import { u as V } from "../../../useTheme-462e5dc6.js";
7
+ import { k as P, c as x } from "../../../emotion-react.browser.esm-ff33c213.js";
8
+ function S(r) {
9
+ return D("MuiLinearProgress", r);
10
+ }
11
+ w("MuiLinearProgress", ["root", "colorPrimary", "colorSecondary", "determinate", "indeterminate", "buffer", "query", "dashed", "dashedColorPrimary", "dashedColorSecondary", "bar", "barColorPrimary", "barColorSecondary", "bar1Indeterminate", "bar1Determinate", "bar1Buffer", "bar2Indeterminate", "bar2Buffer"]);
12
+ const X = ["className", "color", "value", "valueBuffer", "variant"];
13
+ let c = (r) => r, B, N, O, _, I, M;
14
+ const C = 4, Y = P(B || (B = c`
15
+ 0% {
16
+ left: -35%;
17
+ right: 100%;
18
+ }
19
+
20
+ 60% {
21
+ left: 100%;
22
+ right: -90%;
23
+ }
24
+
25
+ 100% {
26
+ left: 100%;
27
+ right: -90%;
28
+ }
29
+ `)), H = P(N || (N = c`
30
+ 0% {
31
+ left: -200%;
32
+ right: 100%;
33
+ }
34
+
35
+ 60% {
36
+ left: 107%;
37
+ right: -8%;
38
+ }
39
+
40
+ 100% {
41
+ left: 107%;
42
+ right: -8%;
43
+ }
44
+ `)), W = P(O || (O = c`
45
+ 0% {
46
+ opacity: 1;
47
+ background-position: 0 -23px;
48
+ }
49
+
50
+ 60% {
51
+ opacity: 0;
52
+ background-position: 0 -23px;
53
+ }
54
+
55
+ 100% {
56
+ opacity: 1;
57
+ background-position: -200px -23px;
58
+ }
59
+ `)), G = (r) => {
60
+ const {
61
+ classes: e,
62
+ variant: a,
63
+ color: t
64
+ } = r, f = {
65
+ root: ["root", `color${n(t)}`, a],
66
+ dashed: ["dashed", `dashedColor${n(t)}`],
67
+ bar1: ["bar", `barColor${n(t)}`, (a === "indeterminate" || a === "query") && "bar1Indeterminate", a === "determinate" && "bar1Determinate", a === "buffer" && "bar1Buffer"],
68
+ bar2: ["bar", a !== "buffer" && `barColor${n(t)}`, a === "buffer" && `color${n(t)}`, (a === "indeterminate" || a === "query") && "bar2Indeterminate", a === "buffer" && "bar2Buffer"]
69
+ };
70
+ return K(f, S, e);
71
+ }, k = (r, e) => e === "inherit" ? "currentColor" : r.vars ? r.vars.palette.LinearProgress[`${e}Bg`] : r.palette.mode === "light" ? E(r.palette[e].main, 0.62) : U(r.palette[e].main, 0.5), J = h("span", {
72
+ name: "MuiLinearProgress",
73
+ slot: "Root",
74
+ overridesResolver: (r, e) => {
75
+ const {
76
+ ownerState: a
77
+ } = r;
78
+ return [e.root, e[`color${n(a.color)}`], e[a.variant]];
79
+ }
80
+ })(({
81
+ ownerState: r,
82
+ theme: e
83
+ }) => l({
84
+ position: "relative",
85
+ overflow: "hidden",
86
+ display: "block",
87
+ height: 4,
88
+ zIndex: 0,
89
+ // Fix Safari's bug during composition of different paint.
90
+ "@media print": {
91
+ colorAdjust: "exact"
92
+ },
93
+ backgroundColor: k(e, r.color)
94
+ }, r.color === "inherit" && r.variant !== "buffer" && {
95
+ backgroundColor: "none",
96
+ "&::before": {
97
+ content: '""',
98
+ position: "absolute",
99
+ left: 0,
100
+ top: 0,
101
+ right: 0,
102
+ bottom: 0,
103
+ backgroundColor: "currentColor",
104
+ opacity: 0.3
105
+ }
106
+ }, r.variant === "buffer" && {
107
+ backgroundColor: "transparent"
108
+ }, r.variant === "query" && {
109
+ transform: "rotate(180deg)"
110
+ })), Q = h("span", {
111
+ name: "MuiLinearProgress",
112
+ slot: "Dashed",
113
+ overridesResolver: (r, e) => {
114
+ const {
115
+ ownerState: a
116
+ } = r;
117
+ return [e.dashed, e[`dashedColor${n(a.color)}`]];
118
+ }
119
+ })(({
120
+ ownerState: r,
121
+ theme: e
122
+ }) => {
123
+ const a = k(e, r.color);
124
+ return l({
125
+ position: "absolute",
126
+ marginTop: 0,
127
+ height: "100%",
128
+ width: "100%"
129
+ }, r.color === "inherit" && {
130
+ opacity: 0.3
131
+ }, {
132
+ backgroundImage: `radial-gradient(${a} 0%, ${a} 16%, transparent 42%)`,
133
+ backgroundSize: "10px 10px",
134
+ backgroundPosition: "0 -23px"
135
+ });
136
+ }, x(_ || (_ = c`
137
+ animation: ${0} 3s infinite linear;
138
+ `), W)), Z = h("span", {
139
+ name: "MuiLinearProgress",
140
+ slot: "Bar1",
141
+ overridesResolver: (r, e) => {
142
+ const {
143
+ ownerState: a
144
+ } = r;
145
+ return [e.bar, e[`barColor${n(a.color)}`], (a.variant === "indeterminate" || a.variant === "query") && e.bar1Indeterminate, a.variant === "determinate" && e.bar1Determinate, a.variant === "buffer" && e.bar1Buffer];
146
+ }
147
+ })(({
148
+ ownerState: r,
149
+ theme: e
150
+ }) => l({
151
+ width: "100%",
152
+ position: "absolute",
153
+ left: 0,
154
+ bottom: 0,
155
+ top: 0,
156
+ transition: "transform 0.2s linear",
157
+ transformOrigin: "left",
158
+ backgroundColor: r.color === "inherit" ? "currentColor" : (e.vars || e).palette[r.color].main
159
+ }, r.variant === "determinate" && {
160
+ transition: `transform .${C}s linear`
161
+ }, r.variant === "buffer" && {
162
+ zIndex: 1,
163
+ transition: `transform .${C}s linear`
164
+ }), ({
165
+ ownerState: r
166
+ }) => (r.variant === "indeterminate" || r.variant === "query") && x(I || (I = c`
167
+ width: auto;
168
+ animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
169
+ `), Y)), rr = h("span", {
170
+ name: "MuiLinearProgress",
171
+ slot: "Bar2",
172
+ overridesResolver: (r, e) => {
173
+ const {
174
+ ownerState: a
175
+ } = r;
176
+ return [e.bar, e[`barColor${n(a.color)}`], (a.variant === "indeterminate" || a.variant === "query") && e.bar2Indeterminate, a.variant === "buffer" && e.bar2Buffer];
177
+ }
178
+ })(({
179
+ ownerState: r,
180
+ theme: e
181
+ }) => l({
182
+ width: "100%",
183
+ position: "absolute",
184
+ left: 0,
185
+ bottom: 0,
186
+ top: 0,
187
+ transition: "transform 0.2s linear",
188
+ transformOrigin: "left"
189
+ }, r.variant !== "buffer" && {
190
+ backgroundColor: r.color === "inherit" ? "currentColor" : (e.vars || e).palette[r.color].main
191
+ }, r.color === "inherit" && {
192
+ opacity: 0.3
193
+ }, r.variant === "buffer" && {
194
+ backgroundColor: k(e, r.color),
195
+ transition: `transform .${C}s linear`
196
+ }), ({
197
+ ownerState: r
198
+ }) => (r.variant === "indeterminate" || r.variant === "query") && x(M || (M = c`
199
+ width: auto;
200
+ animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
201
+ `), H)), T = /* @__PURE__ */ z.forwardRef(function(e, a) {
202
+ const t = A({
203
+ props: e,
204
+ name: "MuiLinearProgress"
205
+ }), {
206
+ className: f,
207
+ color: y = "primary",
208
+ value: d,
209
+ valueBuffer: b,
210
+ variant: s = "indeterminate"
211
+ } = t, R = q(t, X), u = l({}, t, {
212
+ color: y,
213
+ variant: s
214
+ }), m = G(u), L = V(), p = {}, g = {
215
+ bar1: {},
216
+ bar2: {}
217
+ };
218
+ if (s === "determinate" || s === "buffer")
219
+ if (d !== void 0) {
220
+ p["aria-valuenow"] = Math.round(d), p["aria-valuemin"] = 0, p["aria-valuemax"] = 100;
221
+ let i = d - 100;
222
+ L.direction === "rtl" && (i = -i), g.bar1.transform = `translateX(${i}%)`;
223
+ } else
224
+ process.env.NODE_ENV !== "production" && console.error("MUI: You need to provide a value prop when using the determinate or buffer variant of LinearProgress .");
225
+ if (s === "buffer")
226
+ if (b !== void 0) {
227
+ let i = (b || 0) - 100;
228
+ L.direction === "rtl" && (i = -i), g.bar2.transform = `translateX(${i}%)`;
229
+ } else
230
+ process.env.NODE_ENV !== "production" && console.error("MUI: You need to provide a valueBuffer prop when using the buffer variant of LinearProgress.");
231
+ return /* @__PURE__ */ j(J, l({
232
+ className: F(m.root, f),
233
+ ownerState: u,
234
+ role: "progressbar"
235
+ }, p, {
236
+ ref: a
237
+ }, R, {
238
+ children: [s === "buffer" ? /* @__PURE__ */ v(Q, {
239
+ className: m.dashed,
240
+ ownerState: u
241
+ }) : null, /* @__PURE__ */ v(Z, {
242
+ className: m.bar1,
243
+ ownerState: u,
244
+ style: g.bar1
245
+ }), s === "determinate" ? null : /* @__PURE__ */ v(rr, {
246
+ className: m.bar2,
247
+ ownerState: u,
248
+ style: g.bar2
249
+ })]
250
+ }));
251
+ });
252
+ process.env.NODE_ENV !== "production" && (T.propTypes = {
253
+ // ----------------------------- Warning --------------------------------
254
+ // | These PropTypes are generated from the TypeScript type definitions |
255
+ // | To update them edit the d.ts file and run "yarn proptypes" |
256
+ // ----------------------------------------------------------------------
257
+ /**
258
+ * Override or extend the styles applied to the component.
259
+ */
260
+ classes: o.object,
261
+ /**
262
+ * @ignore
263
+ */
264
+ className: o.string,
265
+ /**
266
+ * The color of the component.
267
+ * It supports both default and custom theme colors, which can be added as shown in the
268
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
269
+ * @default 'primary'
270
+ */
271
+ color: o.oneOfType([o.oneOf(["inherit", "primary", "secondary"]), o.string]),
272
+ /**
273
+ * The system prop that allows defining system overrides as well as additional CSS styles.
274
+ */
275
+ sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
276
+ /**
277
+ * The value of the progress indicator for the determinate and buffer variants.
278
+ * Value between 0 and 100.
279
+ */
280
+ value: o.number,
281
+ /**
282
+ * The value for the buffer variant.
283
+ * Value between 0 and 100.
284
+ */
285
+ valueBuffer: o.number,
286
+ /**
287
+ * The variant to use.
288
+ * Use indeterminate or query when there is no progress value.
289
+ * @default 'indeterminate'
290
+ */
291
+ variant: o.oneOf(["buffer", "determinate", "indeterminate", "query"])
292
+ });
293
+ const er = T;
294
+ function ar(r) {
295
+ return r >= 100 ? $("success") : $("primary");
296
+ }
297
+ const cr = ({
298
+ value: r = 0,
299
+ color: e = "primary",
300
+ extrapolateColor: a = ar,
301
+ trackColor: t,
302
+ sx: f,
303
+ ...y
304
+ }) => {
305
+ const b = { ...{
306
+ borderRadius: "0.625rem",
307
+ backgroundColor: t ?? "#F3F3F3",
308
+ height: "0.5rem",
309
+ "& .MuiLinearProgress-bar": {
310
+ backgroundColor: a(r)
311
+ }
312
+ }, ...f };
313
+ return /* @__PURE__ */ v(
314
+ er,
315
+ {
316
+ variant: "determinate",
317
+ value: r,
318
+ color: e,
319
+ sx: b,
320
+ ...y
321
+ }
322
+ );
323
+ };
324
+ export {
325
+ cr as default
326
+ };
@@ -0,0 +1,25 @@
1
+ /** @jsxImportSource react */
2
+ import { SxProps } from "@mui/material";
3
+ import { BaseTextFieldProps as MuiBaseTextFieldProps } from "@mui/material/TextField";
4
+ import { CraftFC } from "../../../global/interfaces";
5
+ /**
6
+ * The props of the Search component extend the MuiBaseTextFieldProps interface.
7
+ * @see https://mui.com/api/text-field/#props
8
+ */
9
+ interface SearchProps extends MuiBaseTextFieldProps {
10
+ sx?: SxProps;
11
+ borderColor?: string;
12
+ borderColorHover?: string;
13
+ borderColorFocus?: string;
14
+ backgroundColor?: string;
15
+ iconColor?: string;
16
+ }
17
+ /**
18
+ * The Search component is a custom TextField component that has a search icon
19
+ * as a start adornment.
20
+ *
21
+ * @param {SearchProps} props The props of the Search component.
22
+ * @returns {JSX.Element} The Search component.
23
+ */
24
+ declare const Search: CraftFC<SearchProps>;
25
+ export default Search;