@mission-studio/puck 1.0.15 → 1.0.16

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.
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { P as PageTheme, b as ThemeColorKey, C as ColorValue, g as ThemeSpacingKey, T as ThemeBorderKey, d as ThemeShadowKey, m as CustomFieldProps } from './types-D-CIduaE.mjs';
4
+
5
+ type ThemeContextValue = {
6
+ theme: PageTheme;
7
+ resolveColor: (key: ThemeColorKey) => ColorValue;
8
+ resolveSpacing: (key: ThemeSpacingKey) => number;
9
+ resolveBorderRadius: (key: ThemeBorderKey) => number;
10
+ resolveShadow: (key: ThemeShadowKey) => string;
11
+ };
12
+ declare function ThemeProvider({ theme, children, }: {
13
+ theme: PageTheme | null;
14
+ children: ReactNode;
15
+ }): react_jsx_runtime.JSX.Element;
16
+ declare function useTheme(): ThemeContextValue;
17
+
18
+ declare const DEFAULT_THEME: PageTheme;
19
+
20
+ type ResponsiveVisibility = {
21
+ mobile: boolean;
22
+ desktop: boolean;
23
+ };
24
+ declare function ResponsiveToggleField({ value, onChangeAction, disabled, label, }: CustomFieldProps<ResponsiveVisibility>): react_jsx_runtime.JSX.Element;
25
+
26
+ export { DEFAULT_THEME as D, type ResponsiveVisibility as R, ThemeProvider as T, ResponsiveToggleField as a, useTheme as u };
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { P as PageTheme, b as ThemeColorKey, C as ColorValue, g as ThemeSpacingKey, T as ThemeBorderKey, d as ThemeShadowKey, m as CustomFieldProps } from './types-D-CIduaE.js';
4
+
5
+ type ThemeContextValue = {
6
+ theme: PageTheme;
7
+ resolveColor: (key: ThemeColorKey) => ColorValue;
8
+ resolveSpacing: (key: ThemeSpacingKey) => number;
9
+ resolveBorderRadius: (key: ThemeBorderKey) => number;
10
+ resolveShadow: (key: ThemeShadowKey) => string;
11
+ };
12
+ declare function ThemeProvider({ theme, children, }: {
13
+ theme: PageTheme | null;
14
+ children: ReactNode;
15
+ }): react_jsx_runtime.JSX.Element;
16
+ declare function useTheme(): ThemeContextValue;
17
+
18
+ declare const DEFAULT_THEME: PageTheme;
19
+
20
+ type ResponsiveVisibility = {
21
+ mobile: boolean;
22
+ desktop: boolean;
23
+ };
24
+ declare function ResponsiveToggleField({ value, onChangeAction, disabled, label, }: CustomFieldProps<ResponsiveVisibility>): react_jsx_runtime.JSX.Element;
25
+
26
+ export { DEFAULT_THEME as D, type ResponsiveVisibility as R, ThemeProvider as T, ResponsiveToggleField as a, useTheme as u };
@@ -0,0 +1,76 @@
1
+ // theme/defaults.ts
2
+ var DEFAULT_THEME = {
3
+ id: "default",
4
+ name: "Default Theme",
5
+ colors: {
6
+ primary: { color: "#3B82F6", opacity: 100 },
7
+ secondary: { color: "#8B5CF6", opacity: 100 },
8
+ accent: { color: "#10B981", opacity: 100 },
9
+ background: { color: "#FFFFFF", opacity: 100 },
10
+ foreground: { color: "#111827", opacity: 100 },
11
+ muted: { color: "#F3F4F6", opacity: 100 }
12
+ },
13
+ typography: {
14
+ fontFamily: {
15
+ heading: "system-ui, sans-serif",
16
+ body: "system-ui, sans-serif"
17
+ },
18
+ fontSize: {
19
+ base: "base",
20
+ heading: "4xl"
21
+ },
22
+ fontWeight: {
23
+ normal: 400,
24
+ heading: 700
25
+ }
26
+ },
27
+ spacing: {
28
+ xs: 8,
29
+ sm: 12,
30
+ md: 16,
31
+ lg: 24,
32
+ xl: 32
33
+ },
34
+ borders: {
35
+ radiusSmall: 4,
36
+ radiusMedium: 8,
37
+ radiusLarge: 16
38
+ },
39
+ shadows: {
40
+ small: "sm",
41
+ medium: "md",
42
+ large: "lg"
43
+ }
44
+ };
45
+
46
+ // utils/index.ts
47
+ import { twMerge } from "tailwind-merge";
48
+ import { clsx } from "clsx";
49
+ function isValidHex(color) {
50
+ return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
51
+ }
52
+ function hexToRgba(hex, opacity) {
53
+ const sanitized = hex.replace("#", "");
54
+ const r = parseInt(sanitized.slice(0, 2), 16);
55
+ const g = parseInt(sanitized.slice(2, 4), 16);
56
+ const b = parseInt(sanitized.slice(4, 6), 16);
57
+ return `rgba(${r}, ${g}, ${b}, ${opacity / 100})`;
58
+ }
59
+ function normalizeHex(hex) {
60
+ const sanitized = hex.replace("#", "").toUpperCase();
61
+ if (sanitized.length === 3) {
62
+ return `#${sanitized[0]}${sanitized[0]}${sanitized[1]}${sanitized[1]}${sanitized[2]}${sanitized[2]}`;
63
+ }
64
+ return `#${sanitized}`;
65
+ }
66
+ function cn(...inputs) {
67
+ return twMerge(clsx(inputs));
68
+ }
69
+
70
+ export {
71
+ DEFAULT_THEME,
72
+ isValidHex,
73
+ hexToRgba,
74
+ normalizeHex,
75
+ cn
76
+ };
@@ -1,3 +1,7 @@
1
+ import {
2
+ DEFAULT_THEME
3
+ } from "./chunk-D3L26TIT.mjs";
4
+
1
5
  // entries/context.tsx
2
6
  import { createContext, useContext } from "react";
3
7
  import { jsx } from "react/jsx-runtime";
@@ -32,51 +36,6 @@ function useEntries() {
32
36
  return context;
33
37
  }
34
38
 
35
- // theme/defaults.ts
36
- var DEFAULT_THEME = {
37
- id: "default",
38
- name: "Default Theme",
39
- colors: {
40
- primary: { color: "#3B82F6", opacity: 100 },
41
- secondary: { color: "#8B5CF6", opacity: 100 },
42
- accent: { color: "#10B981", opacity: 100 },
43
- background: { color: "#FFFFFF", opacity: 100 },
44
- foreground: { color: "#111827", opacity: 100 },
45
- muted: { color: "#F3F4F6", opacity: 100 }
46
- },
47
- typography: {
48
- fontFamily: {
49
- heading: "system-ui, sans-serif",
50
- body: "system-ui, sans-serif"
51
- },
52
- fontSize: {
53
- base: "base",
54
- heading: "4xl"
55
- },
56
- fontWeight: {
57
- normal: 400,
58
- heading: 700
59
- }
60
- },
61
- spacing: {
62
- xs: 8,
63
- sm: 12,
64
- md: 16,
65
- lg: 24,
66
- xl: 32
67
- },
68
- borders: {
69
- radiusSmall: 4,
70
- radiusMedium: 8,
71
- radiusLarge: 16
72
- },
73
- shadows: {
74
- small: "sm",
75
- medium: "md",
76
- large: "lg"
77
- }
78
- };
79
-
80
39
  // theme/context.tsx
81
40
  import { createContext as createContext2, useContext as useContext2 } from "react";
82
41
  import { jsx as jsx2 } from "react/jsx-runtime";
@@ -145,40 +104,11 @@ var getShadowCSS = (value) => {
145
104
  return preset?.css ?? "none";
146
105
  };
147
106
 
148
- // utils/index.ts
149
- import { twMerge } from "tailwind-merge";
150
- import { clsx } from "clsx";
151
- function isValidHex(color) {
152
- return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
153
- }
154
- function hexToRgba(hex, opacity) {
155
- const sanitized = hex.replace("#", "");
156
- const r = parseInt(sanitized.slice(0, 2), 16);
157
- const g = parseInt(sanitized.slice(2, 4), 16);
158
- const b = parseInt(sanitized.slice(4, 6), 16);
159
- return `rgba(${r}, ${g}, ${b}, ${opacity / 100})`;
160
- }
161
- function normalizeHex(hex) {
162
- const sanitized = hex.replace("#", "").toUpperCase();
163
- if (sanitized.length === 3) {
164
- return `#${sanitized[0]}${sanitized[0]}${sanitized[1]}${sanitized[1]}${sanitized[2]}${sanitized[2]}`;
165
- }
166
- return `#${sanitized}`;
167
- }
168
- function cn(...inputs) {
169
- return twMerge(clsx(inputs));
170
- }
171
-
172
107
  export {
173
108
  EntriesProvider,
174
109
  useEntries,
175
- DEFAULT_THEME,
176
110
  ThemeProvider,
177
111
  useTheme,
178
- isValidHex,
179
- hexToRgba,
180
- normalizeHex,
181
- cn,
182
112
  shadowPresets,
183
113
  getShadowCSS
184
114
  };
@@ -1,14 +1,16 @@
1
1
  import {
2
- cn,
3
2
  getShadowCSS,
4
- hexToRgba,
5
3
  useEntries,
6
4
  useTheme
7
- } from "./chunk-XRKFMCSS.mjs";
5
+ } from "./chunk-KV2RSRAM.mjs";
8
6
  import {
9
7
  useGtmEvent,
10
8
  useUtmParams
11
9
  } from "./chunk-QSWQDR6M.mjs";
10
+ import {
11
+ cn,
12
+ hexToRgba
13
+ } from "./chunk-D3L26TIT.mjs";
12
14
 
13
15
  // components/page/Heading.tsx
14
16
  import { jsx } from "react/jsx-runtime";
@@ -9,14 +9,16 @@ import {
9
9
  spacingScale
10
10
  } from "./chunk-A3QDUUOF.mjs";
11
11
  import {
12
- cn,
13
- hexToRgba,
14
- isValidHex,
15
- normalizeHex,
16
12
  shadowPresets,
17
13
  useEntries,
18
14
  useTheme
19
- } from "./chunk-XRKFMCSS.mjs";
15
+ } from "./chunk-KV2RSRAM.mjs";
16
+ import {
17
+ cn,
18
+ hexToRgba,
19
+ isValidHex,
20
+ normalizeHex
21
+ } from "./chunk-D3L26TIT.mjs";
20
22
 
21
23
  // fields/BorderRadiusField.tsx
22
24
  import { useState } from "react";
@@ -0,0 +1,5 @@
1
+ import { Config } from '@measured/puck';
2
+
3
+ declare const config: Config;
4
+
5
+ export { config };
@@ -0,0 +1,5 @@
1
+ import { Config } from '@measured/puck';
2
+
3
+ declare const config: Config;
4
+
5
+ export { config };