@mmapp/react 0.1.0-alpha.18 → 0.1.0-alpha.19

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 (52) hide show
  1. package/dist/actions-MFI2V4DX.mjs +116 -0
  2. package/dist/atoms/index.d.mts +2 -2
  3. package/dist/atoms/index.d.ts +2 -2
  4. package/dist/atoms/index.js +1 -1
  5. package/dist/atoms/index.mjs +1 -1
  6. package/dist/builtin-atoms-C-sNyYJl.d.mts +647 -0
  7. package/dist/builtin-atoms-C-sNyYJl.d.ts +647 -0
  8. package/dist/builtin-atoms-DCKrjG7i.d.mts +96 -0
  9. package/dist/builtin-atoms-DCKrjG7i.d.ts +96 -0
  10. package/dist/builtin-atoms-DRD3EwG6.d.mts +648 -0
  11. package/dist/builtin-atoms-DRD3EwG6.d.ts +648 -0
  12. package/dist/builtin-atoms-jt04b7Rw.d.mts +643 -0
  13. package/dist/builtin-atoms-jt04b7Rw.d.ts +643 -0
  14. package/dist/chunk-247T4GDJ.mjs +677 -0
  15. package/dist/chunk-3H6CR7E7.mjs +1924 -0
  16. package/dist/chunk-3PL6FL6I.mjs +96 -0
  17. package/dist/chunk-3SJSW3C4.mjs +2039 -0
  18. package/dist/chunk-5OI2VI57.mjs +1964 -0
  19. package/dist/chunk-CL6FYZ43.mjs +105 -0
  20. package/dist/chunk-ENQOCZI5.mjs +1938 -0
  21. package/dist/chunk-FB3WCZAU.mjs +512 -0
  22. package/dist/chunk-GLJ7VC7Z.mjs +684 -0
  23. package/dist/chunk-HHMWR6NA.mjs +504 -0
  24. package/dist/chunk-HULEMSN2.mjs +120 -0
  25. package/dist/chunk-J5MW6CRU.mjs +1938 -0
  26. package/dist/chunk-PNTTKNYU.mjs +677 -0
  27. package/dist/chunk-TY5OTJP4.mjs +684 -0
  28. package/dist/chunk-WV7DVCP6.mjs +513 -0
  29. package/dist/chunk-YFMPTGUF.mjs +677 -0
  30. package/dist/{chunk-2VJQJM7S.mjs → chunk-ZDWACXZN.mjs} +1 -1
  31. package/dist/composition-BJ6QQTWT.mjs +12 -0
  32. package/dist/composition-XBGKKCI7.mjs +57 -0
  33. package/dist/content-QVPFUG4P.mjs +246 -0
  34. package/dist/control-flow-CBREHWJW.mjs +35 -0
  35. package/dist/control-flow-FWBOI6SM.mjs +35 -0
  36. package/dist/control-flow-ZWUGCDSP.mjs +35 -0
  37. package/dist/data-WCMIZYKD.mjs +97 -0
  38. package/dist/grouping-E6F377VZ.mjs +204 -0
  39. package/dist/grouping-FRPOEXO3.mjs +233 -0
  40. package/dist/index.d.mts +4 -433
  41. package/dist/index.d.ts +4 -433
  42. package/dist/index.js +3648 -581
  43. package/dist/index.mjs +335 -1040
  44. package/dist/input-PUOZDNSI.mjs +222 -0
  45. package/dist/layout-RATDMCLP.mjs +106 -0
  46. package/dist/navigation-VCT7ZBMA.mjs +15 -0
  47. package/dist/navigation-WFV7YWOU.mjs +14 -0
  48. package/dist/player/index.d.mts +37 -11
  49. package/dist/player/index.d.ts +37 -11
  50. package/dist/player/index.js +3280 -174
  51. package/dist/player/index.mjs +55 -5
  52. package/package.json +4 -4
@@ -0,0 +1,116 @@
1
+ // src/player/atoms/actions.tsx
2
+ import { useState, useCallback } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var VARIANT_STYLES = {
5
+ primary: { background: "#3182ce", color: "#fff", border: "1px solid #3182ce" },
6
+ secondary: { background: "#edf2f7", color: "#4a5568", border: "1px solid #e2e8f0" },
7
+ outline: { background: "transparent", color: "#3182ce", border: "1px solid #3182ce" },
8
+ ghost: { background: "transparent", color: "#4a5568", border: "1px solid transparent" },
9
+ danger: { background: "#e53e3e", color: "#fff", border: "1px solid #e53e3e" },
10
+ destructive: { background: "#e53e3e", color: "#fff", border: "1px solid #e53e3e" },
11
+ success: { background: "#38a169", color: "#fff", border: "1px solid #38a169" },
12
+ link: { background: "transparent", color: "#3182ce", border: "none", textDecoration: "underline" },
13
+ default: { background: "#fff", color: "#1a202c", border: "1px solid #e2e8f0" }
14
+ };
15
+ var SIZE_STYLES = {
16
+ xs: { padding: "2px 8px", fontSize: 11 },
17
+ sm: { padding: "4px 12px", fontSize: 13 },
18
+ md: { padding: "6px 16px", fontSize: 14 },
19
+ lg: { padding: "8px 24px", fontSize: 16 },
20
+ xl: { padding: "12px 32px", fontSize: 18 }
21
+ };
22
+ var Button = ({
23
+ children,
24
+ label,
25
+ value,
26
+ onClick,
27
+ variant,
28
+ size,
29
+ disabled,
30
+ loading: loadingProp,
31
+ icon,
32
+ iconRight,
33
+ fullWidth,
34
+ className,
35
+ style
36
+ }) => {
37
+ const [isLoading, setIsLoading] = useState(false);
38
+ const text = children ?? label ?? value;
39
+ const isDisabled = Boolean(disabled) || isLoading || Boolean(loadingProp);
40
+ const vs = VARIANT_STYLES[variant ?? "default"] ?? VARIANT_STYLES.default;
41
+ const ss = SIZE_STYLES[size ?? "md"] ?? SIZE_STYLES.md;
42
+ const handleClick = useCallback(async (e) => {
43
+ if (isDisabled) return;
44
+ if (typeof onClick === "function") {
45
+ const result = onClick(e);
46
+ if (result && typeof result === "object" && typeof result.then === "function") {
47
+ setIsLoading(true);
48
+ try {
49
+ await result;
50
+ } finally {
51
+ setIsLoading(false);
52
+ }
53
+ }
54
+ }
55
+ }, [onClick, isDisabled]);
56
+ return /* @__PURE__ */ jsxs(
57
+ "button",
58
+ {
59
+ className,
60
+ disabled: isDisabled,
61
+ onClick: handleClick,
62
+ style: {
63
+ ...vs,
64
+ ...ss,
65
+ borderRadius: 6,
66
+ cursor: isDisabled ? "not-allowed" : "pointer",
67
+ opacity: isDisabled ? 0.6 : 1,
68
+ fontWeight: 500,
69
+ display: "inline-flex",
70
+ alignItems: "center",
71
+ justifyContent: "center",
72
+ gap: 6,
73
+ width: fullWidth ? "100%" : void 0,
74
+ transition: "opacity 0.15s, background 0.15s",
75
+ ...style
76
+ },
77
+ children: [
78
+ isLoading || loadingProp ? "\u23F3" : icon ? String(icon) : null,
79
+ text != null ? String(text) : null,
80
+ iconRight ? String(iconRight) : null
81
+ ]
82
+ }
83
+ );
84
+ };
85
+ var Link = ({ children, href, to, label, onClick, external, className, style }) => {
86
+ const text = children ?? label;
87
+ const target = href ?? to;
88
+ const handleClick = useCallback((e) => {
89
+ if (typeof onClick === "function") {
90
+ e.preventDefault();
91
+ onClick(e);
92
+ }
93
+ }, [onClick]);
94
+ return /* @__PURE__ */ jsx(
95
+ "a",
96
+ {
97
+ href: target ?? "#",
98
+ className,
99
+ onClick: handleClick,
100
+ target: external ? "_blank" : void 0,
101
+ rel: external ? "noopener noreferrer" : void 0,
102
+ style: {
103
+ color: "#3182ce",
104
+ textDecoration: "none",
105
+ cursor: "pointer",
106
+ fontSize: 14,
107
+ ...style
108
+ },
109
+ children: text != null ? String(text) : target ?? "Link"
110
+ }
111
+ );
112
+ };
113
+ export {
114
+ Button,
115
+ Link
116
+ };
@@ -4,12 +4,12 @@ import { FC, ReactNode } from 'react';
4
4
  * Compile-Time Atom Stubs — markers for the compiler to recognize.
5
5
  *
6
6
  * These are NOT runtime components — they are compile-time type stubs that
7
- * the @mindmatrix/react-compiler recognizes in JSX and maps to IRExperienceNode
7
+ * the @mmapp/react-compiler recognizes in JSX and maps to IRExperienceNode
8
8
  * entries. At runtime, the frontend's ComponentTreeRenderer resolves the
9
9
  * component name string to the actual registered React component.
10
10
  *
11
11
  * Usage in .workflow.tsx files:
12
- * import { Stack, Row, Text, Button, TextInput } from '@mindmatrix/react/atoms';
12
+ * import { Stack, Row, Text, Button, TextInput } from '@mmapp/react/atoms';
13
13
  *
14
14
  * return (
15
15
  * <Stack gap={4}>
@@ -4,12 +4,12 @@ import { FC, ReactNode } from 'react';
4
4
  * Compile-Time Atom Stubs — markers for the compiler to recognize.
5
5
  *
6
6
  * These are NOT runtime components — they are compile-time type stubs that
7
- * the @mindmatrix/react-compiler recognizes in JSX and maps to IRExperienceNode
7
+ * the @mmapp/react-compiler recognizes in JSX and maps to IRExperienceNode
8
8
  * entries. At runtime, the frontend's ComponentTreeRenderer resolves the
9
9
  * component name string to the actual registered React component.
10
10
  *
11
11
  * Usage in .workflow.tsx files:
12
- * import { Stack, Row, Text, Button, TextInput } from '@mindmatrix/react/atoms';
12
+ * import { Stack, Row, Text, Button, TextInput } from '@mmapp/react/atoms';
13
13
  *
14
14
  * return (
15
15
  * <Stack gap={4}>
@@ -78,7 +78,7 @@ module.exports = __toCommonJS(atoms_exports);
78
78
  function stub(displayName) {
79
79
  const Component = () => {
80
80
  throw new Error(
81
- `<${displayName}> is a compile-time stub from @mindmatrix/react/atoms. It should only appear in .workflow.tsx files processed by the compiler. At runtime, use the ComponentTreeRenderer which resolves "${displayName}" from the component registry.`
81
+ `<${displayName}> is a compile-time stub from @mmapp/react/atoms. It should only appear in .workflow.tsx files processed by the compiler. At runtime, use the ComponentTreeRenderer which resolves "${displayName}" from the component registry.`
82
82
  );
83
83
  };
84
84
  Component.displayName = displayName;
@@ -52,7 +52,7 @@ import {
52
52
  Text,
53
53
  TextInput,
54
54
  TransitionActions
55
- } from "../chunk-2VJQJM7S.mjs";
55
+ } from "../chunk-ZDWACXZN.mjs";
56
56
  export {
57
57
  Accordion,
58
58
  AdaptiveCardGrid,