@loopr-ai/craft 0.0.0 → 0.2.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 (33) hide show
  1. package/dist/TransitionGroupContext-ee5b34c9.js +132 -0
  2. package/dist/assets/theme.css +1 -0
  3. package/dist/components/cell/Button/index.d.ts +19 -4
  4. package/dist/components/cell/Button/index.js +1209 -4
  5. package/dist/components/cell/ProgressBar/index.d.ts +27 -0
  6. package/dist/components/cell/ProgressBar/index.js +325 -0
  7. package/dist/components/cell/Search/index.d.ts +25 -0
  8. package/dist/components/cell/Search/index.js +26539 -0
  9. package/dist/components/cell/Typography/index.d.ts +20 -0
  10. package/dist/components/cell/Typography/index.js +217 -0
  11. package/dist/createTheme-eb26b87a.js +2221 -0
  12. package/dist/emotion-react.browser.esm-ff33c213.js +439 -0
  13. package/dist/exactProp-0925aa6f.js +13 -0
  14. package/dist/global/colors.d.ts +16 -0
  15. package/dist/global/colors.js +22 -0
  16. package/dist/global/constants.js +1 -0
  17. package/dist/global/enums.js +1 -0
  18. package/dist/global/interfaces.d.ts +6 -0
  19. package/dist/global/interfaces.js +1 -0
  20. package/dist/global/theme.d.ts +35 -0
  21. package/dist/global/theme.js +76 -0
  22. package/dist/main.d.ts +6 -2
  23. package/dist/main.js +8 -2
  24. package/dist/providers/CraftThemeProvider.d.ts +16 -0
  25. package/dist/providers/CraftThemeProvider.js +128 -0
  26. package/dist/providers/index.d.ts +2 -0
  27. package/dist/providers/index.js +4 -0
  28. package/dist/styled-b8bfdd6b.js +699 -0
  29. package/dist/useTheme-a9e2b32c.js +10 -0
  30. package/dist/useThemeWithoutDefault-188598a8.js +950 -0
  31. package/package.json +25 -4
  32. package/dist/components/cell/Input/index.d.ts +0 -5
  33. 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-eb26b87a.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-b8bfdd6b.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
+ };