@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,20 @@
1
+ import { TypographyProps as MuiTypographyProps } from "@mui/material/Typography";
2
+ import { CustomColors } from "../../../global/colors";
3
+ import { CraftFC } from "../../../global/interfaces";
4
+ interface TypographyProps extends MuiTypographyProps {
5
+ /**
6
+ * The type of typography to render.
7
+ * @default "bodyText"
8
+ */
9
+ type?: "headingLarge" | "headingMedium" | "headingSmall" | "bodyText" | "smallText" | "boldText" | "subtitleNormal" | "subtitleSmall" | "helperText";
10
+ textColor?: CustomColors;
11
+ }
12
+ /**
13
+ * The Typography component is used to display text.
14
+ * @param type The type of typography to render.
15
+ * @param color The color of the text.
16
+ * @param children The content to display.
17
+ * @param props The props passed to the Typography component.
18
+ */
19
+ declare const Typography: CraftFC<TypographyProps>;
20
+ export default Typography;
@@ -0,0 +1,217 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { getColorToHex as O } from "../../../global/colors.js";
3
+ import { fontCustomizations as j } from "../../../global/theme.js";
4
+ import { a as b, _ as p, b as W, i as M, g as _, c as d, P as r } from "../../../createTheme-95c30431.js";
5
+ import * as $ from "react";
6
+ import { g as N, s as R, a as U, c as A, b as E } from "../../../styled-05df7dc6.js";
7
+ const k = ["sx"], z = (o) => {
8
+ var t, a;
9
+ const n = {
10
+ systemProps: {},
11
+ otherProps: {}
12
+ }, s = (t = o == null || (a = o.theme) == null ? void 0 : a.unstable_sxConfig) != null ? t : W;
13
+ return Object.keys(o).forEach((e) => {
14
+ s[e] ? n.systemProps[e] = o[e] : n.otherProps[e] = o[e];
15
+ }), n;
16
+ };
17
+ function D(o) {
18
+ const {
19
+ sx: t
20
+ } = o, a = b(o, k), {
21
+ systemProps: n,
22
+ otherProps: s
23
+ } = z(a);
24
+ let e;
25
+ return Array.isArray(t) ? e = [n, ...t] : typeof t == "function" ? e = (...l) => {
26
+ const i = t(...l);
27
+ return M(i) ? p({}, n, i) : n;
28
+ } : e = p({}, n, t), p({}, s, {
29
+ sx: e
30
+ });
31
+ }
32
+ function L(o) {
33
+ return _("MuiTypography", o);
34
+ }
35
+ N("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
36
+ const V = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"], H = (o) => {
37
+ const {
38
+ align: t,
39
+ gutterBottom: a,
40
+ noWrap: n,
41
+ paragraph: s,
42
+ variant: e,
43
+ classes: l
44
+ } = o, i = {
45
+ root: ["root", e, o.align !== "inherit" && `align${d(t)}`, a && "gutterBottom", n && "noWrap", s && "paragraph"]
46
+ };
47
+ return E(i, L, l);
48
+ }, J = R("span", {
49
+ name: "MuiTypography",
50
+ slot: "Root",
51
+ overridesResolver: (o, t) => {
52
+ const {
53
+ ownerState: a
54
+ } = o;
55
+ return [t.root, a.variant && t[a.variant], a.align !== "inherit" && t[`align${d(a.align)}`], a.noWrap && t.noWrap, a.gutterBottom && t.gutterBottom, a.paragraph && t.paragraph];
56
+ }
57
+ })(({
58
+ theme: o,
59
+ ownerState: t
60
+ }) => p({
61
+ margin: 0
62
+ }, t.variant === "inherit" && {
63
+ // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
64
+ font: "inherit"
65
+ }, t.variant !== "inherit" && o.typography[t.variant], t.align !== "inherit" && {
66
+ textAlign: t.align
67
+ }, t.noWrap && {
68
+ overflow: "hidden",
69
+ textOverflow: "ellipsis",
70
+ whiteSpace: "nowrap"
71
+ }, t.gutterBottom && {
72
+ marginBottom: "0.35em"
73
+ }, t.paragraph && {
74
+ marginBottom: 16
75
+ })), y = {
76
+ h1: "h1",
77
+ h2: "h2",
78
+ h3: "h3",
79
+ h4: "h4",
80
+ h5: "h5",
81
+ h6: "h6",
82
+ subtitle1: "h6",
83
+ subtitle2: "h6",
84
+ body1: "p",
85
+ body2: "p",
86
+ inherit: "p"
87
+ }, S = {
88
+ primary: "primary.main",
89
+ textPrimary: "text.primary",
90
+ secondary: "secondary.main",
91
+ textSecondary: "text.secondary",
92
+ error: "error.main"
93
+ }, q = (o) => S[o] || o, x = /* @__PURE__ */ $.forwardRef(function(t, a) {
94
+ const n = U({
95
+ props: t,
96
+ name: "MuiTypography"
97
+ }), s = q(n.color), e = D(p({}, n, {
98
+ color: s
99
+ })), {
100
+ align: l = "inherit",
101
+ className: i,
102
+ component: h,
103
+ gutterBottom: v = !1,
104
+ noWrap: T = !1,
105
+ paragraph: g = !1,
106
+ variant: c = "body1",
107
+ variantMapping: m = y
108
+ } = e, P = b(e, V), u = p({}, e, {
109
+ align: l,
110
+ color: s,
111
+ className: i,
112
+ component: h,
113
+ gutterBottom: v,
114
+ noWrap: T,
115
+ paragraph: g,
116
+ variant: c,
117
+ variantMapping: m
118
+ }), C = h || (g ? "p" : m[c] || y[c]) || "span", B = H(u);
119
+ return /* @__PURE__ */ f(J, p({
120
+ as: C,
121
+ ref: a,
122
+ ownerState: u,
123
+ className: A(B.root, i)
124
+ }, P));
125
+ });
126
+ process.env.NODE_ENV !== "production" && (x.propTypes = {
127
+ // ----------------------------- Warning --------------------------------
128
+ // | These PropTypes are generated from the TypeScript type definitions |
129
+ // | To update them edit the d.ts file and run "yarn proptypes" |
130
+ // ----------------------------------------------------------------------
131
+ /**
132
+ * Set the text-align on the component.
133
+ * @default 'inherit'
134
+ */
135
+ align: r.oneOf(["center", "inherit", "justify", "left", "right"]),
136
+ /**
137
+ * The content of the component.
138
+ */
139
+ children: r.node,
140
+ /**
141
+ * Override or extend the styles applied to the component.
142
+ */
143
+ classes: r.object,
144
+ /**
145
+ * @ignore
146
+ */
147
+ className: r.string,
148
+ /**
149
+ * The component used for the root node.
150
+ * Either a string to use a HTML element or a component.
151
+ */
152
+ component: r.elementType,
153
+ /**
154
+ * If `true`, the text will have a bottom margin.
155
+ * @default false
156
+ */
157
+ gutterBottom: r.bool,
158
+ /**
159
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
160
+ *
161
+ * Note that text overflow can only happen with block or inline-block level elements
162
+ * (the element needs to have a width in order to overflow).
163
+ * @default false
164
+ */
165
+ noWrap: r.bool,
166
+ /**
167
+ * If `true`, the element will be a paragraph element.
168
+ * @default false
169
+ */
170
+ paragraph: r.bool,
171
+ /**
172
+ * The system prop that allows defining system overrides as well as additional CSS styles.
173
+ */
174
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
175
+ /**
176
+ * Applies the theme typography styles.
177
+ * @default 'body1'
178
+ */
179
+ variant: r.oneOfType([r.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), r.string]),
180
+ /**
181
+ * The component maps the variant prop to a range of different HTML element types.
182
+ * For instance, subtitle1 to `<h6>`.
183
+ * If you wish to change that mapping, you can provide your own.
184
+ * Alternatively, you can use the `component` prop.
185
+ * @default {
186
+ * h1: 'h1',
187
+ * h2: 'h2',
188
+ * h3: 'h3',
189
+ * h4: 'h4',
190
+ * h5: 'h5',
191
+ * h6: 'h6',
192
+ * subtitle1: 'h6',
193
+ * subtitle2: 'h6',
194
+ * body1: 'p',
195
+ * body2: 'p',
196
+ * inherit: 'p',
197
+ * }
198
+ */
199
+ variantMapping: r.object
200
+ });
201
+ const w = x, X = ({
202
+ type: o = "bodyText",
203
+ textColor: t = "black",
204
+ children: a,
205
+ sx: n,
206
+ ...s
207
+ }) => {
208
+ const e = {
209
+ ...j[o],
210
+ color: O(t),
211
+ ...n
212
+ };
213
+ return /* @__PURE__ */ f(w, { sx: e, ...s, children: a });
214
+ };
215
+ export {
216
+ X as default
217
+ };
@@ -0,0 +1,184 @@
1
+ import { g as b, c as h, a as w, _ as y, P as o } from "./createTheme-95c30431.js";
2
+ import * as v from "react";
3
+ import { jsxs as C, jsx as z } from "react/jsx-runtime";
4
+ import { g as T, s as N, a as R, c as O, b as B } from "./styled-05df7dc6.js";
5
+ function j(e) {
6
+ return b("MuiSvgIcon", e);
7
+ }
8
+ T("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
9
+ const A = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"], E = (e) => {
10
+ const {
11
+ color: n,
12
+ fontSize: t,
13
+ classes: r
14
+ } = e, i = {
15
+ root: ["root", n !== "inherit" && `color${h(n)}`, `fontSize${h(t)}`]
16
+ };
17
+ return B(i, j, r);
18
+ }, V = N("svg", {
19
+ name: "MuiSvgIcon",
20
+ slot: "Root",
21
+ overridesResolver: (e, n) => {
22
+ const {
23
+ ownerState: t
24
+ } = e;
25
+ return [n.root, t.color !== "inherit" && n[`color${h(t.color)}`], n[`fontSize${h(t.fontSize)}`]];
26
+ }
27
+ })(({
28
+ theme: e,
29
+ ownerState: n
30
+ }) => {
31
+ var t, r, i, d, f, c, g, u, m, s, a, p, l;
32
+ return {
33
+ userSelect: "none",
34
+ width: "1em",
35
+ height: "1em",
36
+ display: "inline-block",
37
+ // the <svg> will define the property that has `currentColor`
38
+ // e.g. heroicons uses fill="none" and stroke="currentColor"
39
+ fill: n.hasSvgAsChild ? void 0 : "currentColor",
40
+ flexShrink: 0,
41
+ transition: (t = e.transitions) == null || (r = t.create) == null ? void 0 : r.call(t, "fill", {
42
+ duration: (i = e.transitions) == null || (i = i.duration) == null ? void 0 : i.shorter
43
+ }),
44
+ fontSize: {
45
+ inherit: "inherit",
46
+ small: ((d = e.typography) == null || (f = d.pxToRem) == null ? void 0 : f.call(d, 20)) || "1.25rem",
47
+ medium: ((c = e.typography) == null || (g = c.pxToRem) == null ? void 0 : g.call(c, 24)) || "1.5rem",
48
+ large: ((u = e.typography) == null || (m = u.pxToRem) == null ? void 0 : m.call(u, 35)) || "2.1875rem"
49
+ }[n.fontSize],
50
+ // TODO v5 deprecate, v6 remove for sx
51
+ color: (s = (a = (e.vars || e).palette) == null || (a = a[n.color]) == null ? void 0 : a.main) != null ? s : {
52
+ action: (p = (e.vars || e).palette) == null || (p = p.action) == null ? void 0 : p.active,
53
+ disabled: (l = (e.vars || e).palette) == null || (l = l.action) == null ? void 0 : l.disabled,
54
+ inherit: void 0
55
+ }[n.color]
56
+ };
57
+ }), S = /* @__PURE__ */ v.forwardRef(function(n, t) {
58
+ const r = R({
59
+ props: n,
60
+ name: "MuiSvgIcon"
61
+ }), {
62
+ children: i,
63
+ className: d,
64
+ color: f = "inherit",
65
+ component: c = "svg",
66
+ fontSize: g = "medium",
67
+ htmlColor: u,
68
+ inheritViewBox: m = !1,
69
+ titleAccess: s,
70
+ viewBox: a = "0 0 24 24"
71
+ } = r, p = w(r, A), l = /* @__PURE__ */ v.isValidElement(i) && i.type === "svg", $ = y({}, r, {
72
+ color: f,
73
+ component: c,
74
+ fontSize: g,
75
+ instanceFontSize: n.fontSize,
76
+ inheritViewBox: m,
77
+ viewBox: a,
78
+ hasSvgAsChild: l
79
+ }), x = {};
80
+ m || (x.viewBox = a);
81
+ const I = E($);
82
+ return /* @__PURE__ */ C(V, y({
83
+ as: c,
84
+ className: O(I.root, d),
85
+ focusable: "false",
86
+ color: u,
87
+ "aria-hidden": s ? void 0 : !0,
88
+ role: s ? "img" : void 0,
89
+ ref: t
90
+ }, x, p, l && i.props, {
91
+ ownerState: $,
92
+ children: [l ? i.props.children : i, s ? /* @__PURE__ */ z("title", {
93
+ children: s
94
+ }) : null]
95
+ }));
96
+ });
97
+ process.env.NODE_ENV !== "production" && (S.propTypes = {
98
+ // ----------------------------- Warning --------------------------------
99
+ // | These PropTypes are generated from the TypeScript type definitions |
100
+ // | To update them edit the d.ts file and run "yarn proptypes" |
101
+ // ----------------------------------------------------------------------
102
+ /**
103
+ * Node passed into the SVG element.
104
+ */
105
+ children: o.node,
106
+ /**
107
+ * Override or extend the styles applied to the component.
108
+ */
109
+ classes: o.object,
110
+ /**
111
+ * @ignore
112
+ */
113
+ className: o.string,
114
+ /**
115
+ * The color of the component.
116
+ * It supports both default and custom theme colors, which can be added as shown in the
117
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
118
+ * You can use the `htmlColor` prop to apply a color attribute to the SVG element.
119
+ * @default 'inherit'
120
+ */
121
+ color: o.oneOfType([o.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), o.string]),
122
+ /**
123
+ * The component used for the root node.
124
+ * Either a string to use a HTML element or a component.
125
+ */
126
+ component: o.elementType,
127
+ /**
128
+ * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
129
+ * @default 'medium'
130
+ */
131
+ fontSize: o.oneOfType([o.oneOf(["inherit", "large", "medium", "small"]), o.string]),
132
+ /**
133
+ * Applies a color attribute to the SVG element.
134
+ */
135
+ htmlColor: o.string,
136
+ /**
137
+ * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
138
+ * prop will be ignored.
139
+ * Useful when you want to reference a custom `component` and have `SvgIcon` pass that
140
+ * `component`'s viewBox to the root node.
141
+ * @default false
142
+ */
143
+ inheritViewBox: o.bool,
144
+ /**
145
+ * The shape-rendering attribute. The behavior of the different options is described on the
146
+ * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).
147
+ * If you are having issues with blurry icons you should investigate this prop.
148
+ */
149
+ shapeRendering: o.string,
150
+ /**
151
+ * The system prop that allows defining system overrides as well as additional CSS styles.
152
+ */
153
+ sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
154
+ /**
155
+ * Provides a human-readable title for the element that contains it.
156
+ * https://www.w3.org/TR/SVG-access/#Equivalent
157
+ */
158
+ titleAccess: o.string,
159
+ /**
160
+ * Allows you to redefine what the coordinates without units mean inside an SVG element.
161
+ * For example, if the SVG element is 500 (width) by 200 (height),
162
+ * and you pass viewBox="0 0 50 20",
163
+ * this means that the coordinates inside the SVG will go from the top left corner (0,0)
164
+ * to bottom right (50,20) and each unit will be worth 10px.
165
+ * @default '0 0 24 24'
166
+ */
167
+ viewBox: o.string
168
+ });
169
+ S.muiName = "SvgIcon";
170
+ const _ = S;
171
+ function D(e, n) {
172
+ function t(r, i) {
173
+ return /* @__PURE__ */ z(_, y({
174
+ "data-testid": `${n}Icon`,
175
+ ref: i
176
+ }, r, {
177
+ children: e
178
+ }));
179
+ }
180
+ return process.env.NODE_ENV !== "production" && (t.displayName = `${n}Icon`), t.muiName = _.muiName, /* @__PURE__ */ v.memo(/* @__PURE__ */ v.forwardRef(t));
181
+ }
182
+ export {
183
+ D as c
184
+ };