@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
@@ -1,6 +1,385 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import e from "react";
3
- const m = ({ children: t, ...o }) => /* @__PURE__ */ r("button", { ...o, children: t }), u = e.memo(m);
1
+ import { jsx as C, jsxs as F } from "react/jsx-runtime";
2
+ import { getColorToHex as v } from "../../../global/colors.js";
3
+ import { g as U, c as e, _ as t, e as b, a as D, P as a } from "../../../createTheme-95c30431.js";
4
+ import * as p from "react";
5
+ import { g as H, s as y, r as A, e as q, a as J, c as R, b as K } from "../../../styled-05df7dc6.js";
6
+ import { B as Q } from "../../../ButtonBase-750a4103.js";
7
+ function X(o) {
8
+ return U("MuiButton", o);
9
+ }
10
+ const Y = H("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]), g = Y, k = /* @__PURE__ */ p.createContext({});
11
+ process.env.NODE_ENV !== "production" && (k.displayName = "ButtonGroupContext");
12
+ const Z = k, N = /* @__PURE__ */ p.createContext(void 0);
13
+ process.env.NODE_ENV !== "production" && (N.displayName = "ButtonGroupButtonContext");
14
+ const w = N, oo = ["children", "color", "component", "className", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"], no = (o) => {
15
+ const {
16
+ color: n,
17
+ disableElevation: i,
18
+ fullWidth: l,
19
+ size: r,
20
+ variant: c,
21
+ classes: s
22
+ } = o, x = {
23
+ root: ["root", c, `${c}${e(n)}`, `size${e(r)}`, `${c}Size${e(r)}`, n === "inherit" && "colorInherit", i && "disableElevation", l && "fullWidth"],
24
+ label: ["label"],
25
+ startIcon: ["startIcon", `iconSize${e(r)}`],
26
+ endIcon: ["endIcon", `iconSize${e(r)}`]
27
+ }, f = K(x, X, s);
28
+ return t({}, s, f);
29
+ }, E = (o) => t({}, o.size === "small" && {
30
+ "& > *:nth-of-type(1)": {
31
+ fontSize: 18
32
+ }
33
+ }, o.size === "medium" && {
34
+ "& > *:nth-of-type(1)": {
35
+ fontSize: 20
36
+ }
37
+ }, o.size === "large" && {
38
+ "& > *:nth-of-type(1)": {
39
+ fontSize: 22
40
+ }
41
+ }), ao = y(Q, {
42
+ shouldForwardProp: (o) => A(o) || o === "classes",
43
+ name: "MuiButton",
44
+ slot: "Root",
45
+ overridesResolver: (o, n) => {
46
+ const {
47
+ ownerState: i
48
+ } = o;
49
+ return [n.root, n[i.variant], n[`${i.variant}${e(i.color)}`], n[`size${e(i.size)}`], n[`${i.variant}Size${e(i.size)}`], i.color === "inherit" && n.colorInherit, i.disableElevation && n.disableElevation, i.fullWidth && n.fullWidth];
50
+ }
51
+ })(({
52
+ theme: o,
53
+ ownerState: n
54
+ }) => {
55
+ var i, l;
56
+ const r = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800], c = o.palette.mode === "light" ? o.palette.grey.A100 : o.palette.grey[700];
57
+ return t({}, o.typography.button, {
58
+ minWidth: 64,
59
+ padding: "6px 16px",
60
+ borderRadius: (o.vars || o).shape.borderRadius,
61
+ transition: o.transitions.create(["background-color", "box-shadow", "border-color", "color"], {
62
+ duration: o.transitions.duration.short
63
+ }),
64
+ "&:hover": t({
65
+ textDecoration: "none",
66
+ backgroundColor: o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : b(o.palette.text.primary, o.palette.action.hoverOpacity),
67
+ // Reset on touch devices, it doesn't add specificity
68
+ "@media (hover: none)": {
69
+ backgroundColor: "transparent"
70
+ }
71
+ }, n.variant === "text" && n.color !== "inherit" && {
72
+ backgroundColor: o.vars ? `rgba(${o.vars.palette[n.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : b(o.palette[n.color].main, o.palette.action.hoverOpacity),
73
+ // Reset on touch devices, it doesn't add specificity
74
+ "@media (hover: none)": {
75
+ backgroundColor: "transparent"
76
+ }
77
+ }, n.variant === "outlined" && n.color !== "inherit" && {
78
+ border: `1px solid ${(o.vars || o).palette[n.color].main}`,
79
+ backgroundColor: o.vars ? `rgba(${o.vars.palette[n.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : b(o.palette[n.color].main, o.palette.action.hoverOpacity),
80
+ // Reset on touch devices, it doesn't add specificity
81
+ "@media (hover: none)": {
82
+ backgroundColor: "transparent"
83
+ }
84
+ }, n.variant === "contained" && {
85
+ backgroundColor: o.vars ? o.vars.palette.Button.inheritContainedHoverBg : c,
86
+ boxShadow: (o.vars || o).shadows[4],
87
+ // Reset on touch devices, it doesn't add specificity
88
+ "@media (hover: none)": {
89
+ boxShadow: (o.vars || o).shadows[2],
90
+ backgroundColor: (o.vars || o).palette.grey[300]
91
+ }
92
+ }, n.variant === "contained" && n.color !== "inherit" && {
93
+ backgroundColor: (o.vars || o).palette[n.color].dark,
94
+ // Reset on touch devices, it doesn't add specificity
95
+ "@media (hover: none)": {
96
+ backgroundColor: (o.vars || o).palette[n.color].main
97
+ }
98
+ }),
99
+ "&:active": t({}, n.variant === "contained" && {
100
+ boxShadow: (o.vars || o).shadows[8]
101
+ }),
102
+ [`&.${g.focusVisible}`]: t({}, n.variant === "contained" && {
103
+ boxShadow: (o.vars || o).shadows[6]
104
+ }),
105
+ [`&.${g.disabled}`]: t({
106
+ color: (o.vars || o).palette.action.disabled
107
+ }, n.variant === "outlined" && {
108
+ border: `1px solid ${(o.vars || o).palette.action.disabledBackground}`
109
+ }, n.variant === "contained" && {
110
+ color: (o.vars || o).palette.action.disabled,
111
+ boxShadow: (o.vars || o).shadows[0],
112
+ backgroundColor: (o.vars || o).palette.action.disabledBackground
113
+ })
114
+ }, n.variant === "text" && {
115
+ padding: "6px 8px"
116
+ }, n.variant === "text" && n.color !== "inherit" && {
117
+ color: (o.vars || o).palette[n.color].main
118
+ }, n.variant === "outlined" && {
119
+ padding: "5px 15px",
120
+ border: "1px solid currentColor"
121
+ }, n.variant === "outlined" && n.color !== "inherit" && {
122
+ color: (o.vars || o).palette[n.color].main,
123
+ border: o.vars ? `1px solid rgba(${o.vars.palette[n.color].mainChannel} / 0.5)` : `1px solid ${b(o.palette[n.color].main, 0.5)}`
124
+ }, n.variant === "contained" && {
125
+ color: o.vars ? (
126
+ // this is safe because grey does not change between default light/dark mode
127
+ o.vars.palette.text.primary
128
+ ) : (i = (l = o.palette).getContrastText) == null ? void 0 : i.call(l, o.palette.grey[300]),
129
+ backgroundColor: o.vars ? o.vars.palette.Button.inheritContainedBg : r,
130
+ boxShadow: (o.vars || o).shadows[2]
131
+ }, n.variant === "contained" && n.color !== "inherit" && {
132
+ color: (o.vars || o).palette[n.color].contrastText,
133
+ backgroundColor: (o.vars || o).palette[n.color].main
134
+ }, n.color === "inherit" && {
135
+ color: "inherit",
136
+ borderColor: "currentColor"
137
+ }, n.size === "small" && n.variant === "text" && {
138
+ padding: "4px 5px",
139
+ fontSize: o.typography.pxToRem(13)
140
+ }, n.size === "large" && n.variant === "text" && {
141
+ padding: "8px 11px",
142
+ fontSize: o.typography.pxToRem(15)
143
+ }, n.size === "small" && n.variant === "outlined" && {
144
+ padding: "3px 9px",
145
+ fontSize: o.typography.pxToRem(13)
146
+ }, n.size === "large" && n.variant === "outlined" && {
147
+ padding: "7px 21px",
148
+ fontSize: o.typography.pxToRem(15)
149
+ }, n.size === "small" && n.variant === "contained" && {
150
+ padding: "4px 10px",
151
+ fontSize: o.typography.pxToRem(13)
152
+ }, n.size === "large" && n.variant === "contained" && {
153
+ padding: "8px 22px",
154
+ fontSize: o.typography.pxToRem(15)
155
+ }, n.fullWidth && {
156
+ width: "100%"
157
+ });
158
+ }, ({
159
+ ownerState: o
160
+ }) => o.disableElevation && {
161
+ boxShadow: "none",
162
+ "&:hover": {
163
+ boxShadow: "none"
164
+ },
165
+ [`&.${g.focusVisible}`]: {
166
+ boxShadow: "none"
167
+ },
168
+ "&:active": {
169
+ boxShadow: "none"
170
+ },
171
+ [`&.${g.disabled}`]: {
172
+ boxShadow: "none"
173
+ }
174
+ }), io = y("span", {
175
+ name: "MuiButton",
176
+ slot: "StartIcon",
177
+ overridesResolver: (o, n) => {
178
+ const {
179
+ ownerState: i
180
+ } = o;
181
+ return [n.startIcon, n[`iconSize${e(i.size)}`]];
182
+ }
183
+ })(({
184
+ ownerState: o
185
+ }) => t({
186
+ display: "inherit",
187
+ marginRight: 8,
188
+ marginLeft: -4
189
+ }, o.size === "small" && {
190
+ marginLeft: -2
191
+ }, E(o))), ro = y("span", {
192
+ name: "MuiButton",
193
+ slot: "EndIcon",
194
+ overridesResolver: (o, n) => {
195
+ const {
196
+ ownerState: i
197
+ } = o;
198
+ return [n.endIcon, n[`iconSize${e(i.size)}`]];
199
+ }
200
+ })(({
201
+ ownerState: o
202
+ }) => t({
203
+ display: "inherit",
204
+ marginRight: -4,
205
+ marginLeft: 8
206
+ }, o.size === "small" && {
207
+ marginRight: -2
208
+ }, E(o))), O = /* @__PURE__ */ p.forwardRef(function(n, i) {
209
+ const l = p.useContext(Z), r = p.useContext(w), c = q(l, n), s = J({
210
+ props: c,
211
+ name: "MuiButton"
212
+ }), {
213
+ children: x,
214
+ color: f = "primary",
215
+ component: z = "button",
216
+ className: T,
217
+ disabled: m = !1,
218
+ disableElevation: P = !1,
219
+ disableFocusRipple: B = !1,
220
+ endIcon: I,
221
+ focusVisibleClassName: W,
222
+ fullWidth: M = !1,
223
+ size: S = "medium",
224
+ startIcon: $,
225
+ type: h,
226
+ variant: V = "text"
227
+ } = s, L = D(s, oo), u = t({}, s, {
228
+ color: f,
229
+ component: z,
230
+ disabled: m,
231
+ disableElevation: P,
232
+ disableFocusRipple: B,
233
+ fullWidth: M,
234
+ size: S,
235
+ type: h,
236
+ variant: V
237
+ }), d = no(u), _ = $ && /* @__PURE__ */ C(io, {
238
+ className: d.startIcon,
239
+ ownerState: u,
240
+ children: $
241
+ }), G = I && /* @__PURE__ */ C(ro, {
242
+ className: d.endIcon,
243
+ ownerState: u,
244
+ children: I
245
+ }), j = r || "";
246
+ return /* @__PURE__ */ F(ao, t({
247
+ ownerState: u,
248
+ className: R(l.className, d.root, T, j),
249
+ component: z,
250
+ disabled: m,
251
+ focusRipple: !B,
252
+ focusVisibleClassName: R(d.focusVisible, W),
253
+ ref: i,
254
+ type: h
255
+ }, L, {
256
+ classes: d,
257
+ children: [_, x, G]
258
+ }));
259
+ });
260
+ process.env.NODE_ENV !== "production" && (O.propTypes = {
261
+ // ----------------------------- Warning --------------------------------
262
+ // | These PropTypes are generated from the TypeScript type definitions |
263
+ // | To update them edit the d.ts file and run "yarn proptypes" |
264
+ // ----------------------------------------------------------------------
265
+ /**
266
+ * The content of the component.
267
+ */
268
+ children: a.node,
269
+ /**
270
+ * Override or extend the styles applied to the component.
271
+ */
272
+ classes: a.object,
273
+ /**
274
+ * @ignore
275
+ */
276
+ className: a.string,
277
+ /**
278
+ * The color of the component.
279
+ * It supports both default and custom theme colors, which can be added as shown in the
280
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
281
+ * @default 'primary'
282
+ */
283
+ color: a.oneOfType([a.oneOf(["inherit", "primary", "secondary", "success", "error", "info", "warning"]), a.string]),
284
+ /**
285
+ * The component used for the root node.
286
+ * Either a string to use a HTML element or a component.
287
+ */
288
+ component: a.elementType,
289
+ /**
290
+ * If `true`, the component is disabled.
291
+ * @default false
292
+ */
293
+ disabled: a.bool,
294
+ /**
295
+ * If `true`, no elevation is used.
296
+ * @default false
297
+ */
298
+ disableElevation: a.bool,
299
+ /**
300
+ * If `true`, the keyboard focus ripple is disabled.
301
+ * @default false
302
+ */
303
+ disableFocusRipple: a.bool,
304
+ /**
305
+ * If `true`, the ripple effect is disabled.
306
+ *
307
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
308
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
309
+ * @default false
310
+ */
311
+ disableRipple: a.bool,
312
+ /**
313
+ * Element placed after the children.
314
+ */
315
+ endIcon: a.node,
316
+ /**
317
+ * @ignore
318
+ */
319
+ focusVisibleClassName: a.string,
320
+ /**
321
+ * If `true`, the button will take up the full width of its container.
322
+ * @default false
323
+ */
324
+ fullWidth: a.bool,
325
+ /**
326
+ * The URL to link to when the button is clicked.
327
+ * If defined, an `a` element will be used as the root node.
328
+ */
329
+ href: a.string,
330
+ /**
331
+ * The size of the component.
332
+ * `small` is equivalent to the dense button styling.
333
+ * @default 'medium'
334
+ */
335
+ size: a.oneOfType([a.oneOf(["small", "medium", "large"]), a.string]),
336
+ /**
337
+ * Element placed before the children.
338
+ */
339
+ startIcon: a.node,
340
+ /**
341
+ * The system prop that allows defining system overrides as well as additional CSS styles.
342
+ */
343
+ sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object]),
344
+ /**
345
+ * @ignore
346
+ */
347
+ type: a.oneOfType([a.oneOf(["button", "reset", "submit"]), a.string]),
348
+ /**
349
+ * The variant to use.
350
+ * @default 'text'
351
+ */
352
+ variant: a.oneOfType([a.oneOf(["contained", "outlined", "text"]), a.string])
353
+ });
354
+ const to = O, uo = ({
355
+ variant: o = "contained",
356
+ disabled: n = !1,
357
+ look: i = "normal",
358
+ children: l,
359
+ sx: r,
360
+ ...c
361
+ }) => {
362
+ let s = {};
363
+ return i === "modified" ? (n === !1 && (s = {
364
+ border: "0rem",
365
+ backgroundColor: v("modify"),
366
+ color: v("primary"),
367
+ "&:hover": {
368
+ border: "0.0625rem solid",
369
+ borderColor: v("primary"),
370
+ backgroundColor: v("modify")
371
+ }
372
+ }), o = "outlined") : o === "contained" && n === !0 && (s = {
373
+ "&.Mui-disabled": {
374
+ backgroundColor: "#C4C4C4",
375
+ color: "#000000",
376
+ boxShadow: "none"
377
+ }
378
+ }), r = {
379
+ ...s,
380
+ ...r
381
+ }, /* @__PURE__ */ C(to, { variant: o, disabled: n, sx: r, ...c, children: l });
382
+ };
4
383
  export {
5
- u as default
384
+ uo as default
6
385
  };
@@ -0,0 +1,27 @@
1
+ import { ChipProps as MuiChipProps } from "@mui/material/Chip";
2
+ import { CraftFC } from "../../../global/interfaces";
3
+ /**
4
+ * The Chip component is a custom Chip component that has a custom styling and extends the MUI Chip component.
5
+ */
6
+ interface ChipProps extends Omit<MuiChipProps, "color"> {
7
+ /**
8
+ * The color of the Chip component.
9
+ */
10
+ color?: string;
11
+ /**
12
+ * The color of the text of the Chip component.
13
+ */
14
+ textColor?: string;
15
+ /**
16
+ * The status of the chip component will show different colors depending on the status.
17
+ * @default "new"
18
+ */
19
+ status?: "new" | "active" | "completed" | "error";
20
+ }
21
+ /**
22
+ * The Chip component is a custom Chip component that has a custom styling and extends the MUI Chip component.
23
+ * @param color The color of the Chip component.
24
+ * @param textColor The color of the text of the Chip component.
25
+ */
26
+ declare const Chip: CraftFC<ChipProps>;
27
+ export default Chip;