@mockifydev/react 0.1.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 (100) hide show
  1. package/assets/devices/iPhone 13 - Midnight.png +0 -0
  2. package/assets/devices/iPhone 13 - Starlight.png +0 -0
  3. package/assets/devices/iPhone 13 Mini - Midnight.png +0 -0
  4. package/assets/devices/iPhone 13 Mini - Starlight.png +0 -0
  5. package/assets/devices/iPhone 13 Mini.png +0 -0
  6. package/assets/devices/iPhone 13 Pro - Graphite.png +0 -0
  7. package/assets/devices/iPhone 13 Pro - Silver.png +0 -0
  8. package/assets/devices/iPhone 13 Pro Max - Graphite.png +0 -0
  9. package/assets/devices/iPhone 13 Pro Max - Silver.png +0 -0
  10. package/assets/devices/iPhone 13 Pro Max.png +0 -0
  11. package/assets/devices/iPhone 13 Pro.png +0 -0
  12. package/assets/devices/iPhone 13.png +0 -0
  13. package/assets/devices/iPhone 14 - Blue.png +0 -0
  14. package/assets/devices/iPhone 14 - Midnight.png +0 -0
  15. package/assets/devices/iPhone 14 - Purple.png +0 -0
  16. package/assets/devices/iPhone 14 - Red.png +0 -0
  17. package/assets/devices/iPhone 14 - Starlight.png +0 -0
  18. package/assets/devices/iPhone 14 Plus - Blue.png +0 -0
  19. package/assets/devices/iPhone 14 Plus - Midnight.png +0 -0
  20. package/assets/devices/iPhone 14 Plus - Purple.png +0 -0
  21. package/assets/devices/iPhone 14 Plus - Red.png +0 -0
  22. package/assets/devices/iPhone 14 Plus - Starlight.png +0 -0
  23. package/assets/devices/iPhone 14 Plus.png +0 -0
  24. package/assets/devices/iPhone 14 Pro - Deep Purple.png +0 -0
  25. package/assets/devices/iPhone 14 Pro - Gold.png +0 -0
  26. package/assets/devices/iPhone 14 Pro - Silver.png +0 -0
  27. package/assets/devices/iPhone 14 Pro - Space Black.png +0 -0
  28. package/assets/devices/iPhone 14 Pro Max - Deep Purple.png +0 -0
  29. package/assets/devices/iPhone 14 Pro Max - Gold.png +0 -0
  30. package/assets/devices/iPhone 14 Pro Max - Silver.png +0 -0
  31. package/assets/devices/iPhone 14 Pro Max - Space Black.png +0 -0
  32. package/assets/devices/iPhone 14 Pro Max.png +0 -0
  33. package/assets/devices/iPhone 14 Pro.png +0 -0
  34. package/assets/devices/iPhone 14.png +0 -0
  35. package/assets/devices/iPhone 15 - Black.png +0 -0
  36. package/assets/devices/iPhone 15 - Blue.png +0 -0
  37. package/assets/devices/iPhone 15 - Green.png +0 -0
  38. package/assets/devices/iPhone 15 - Pink.png +0 -0
  39. package/assets/devices/iPhone 15 - Yellow.png +0 -0
  40. package/assets/devices/iPhone 15 Plus - Black.png +0 -0
  41. package/assets/devices/iPhone 15 Plus - Blue.png +0 -0
  42. package/assets/devices/iPhone 15 Plus - Green.png +0 -0
  43. package/assets/devices/iPhone 15 Plus - Pink.png +0 -0
  44. package/assets/devices/iPhone 15 Plus - Yellow.png +0 -0
  45. package/assets/devices/iPhone 15 Plus.png +0 -0
  46. package/assets/devices/iPhone 15 Pro - Black Titanium.png +0 -0
  47. package/assets/devices/iPhone 15 Pro - Blue Titanium.png +0 -0
  48. package/assets/devices/iPhone 15 Pro - Natural Titanium.png +0 -0
  49. package/assets/devices/iPhone 15 Pro - White Titanium.png +0 -0
  50. package/assets/devices/iPhone 15 Pro Max - Black Titanium.png +0 -0
  51. package/assets/devices/iPhone 15 Pro Max - Blue Titanium.png +0 -0
  52. package/assets/devices/iPhone 15 Pro Max - Natural Titanium.png +0 -0
  53. package/assets/devices/iPhone 15 Pro Max - White Titanium.png +0 -0
  54. package/assets/devices/iPhone 15 Pro Max.png +0 -0
  55. package/assets/devices/iPhone 15 Pro.png +0 -0
  56. package/assets/devices/iPhone 15.png +0 -0
  57. package/assets/devices/iPhone 16 - Black.png +0 -0
  58. package/assets/devices/iPhone 16 - Pink.png +0 -0
  59. package/assets/devices/iPhone 16 - Teal.png +0 -0
  60. package/assets/devices/iPhone 16 - Ultramarine.png +0 -0
  61. package/assets/devices/iPhone 16 - White.png +0 -0
  62. package/assets/devices/iPhone 16 Plus - Black.png +0 -0
  63. package/assets/devices/iPhone 16 Plus - Pink.png +0 -0
  64. package/assets/devices/iPhone 16 Plus - Teal.png +0 -0
  65. package/assets/devices/iPhone 16 Plus - Ultramarine.png +0 -0
  66. package/assets/devices/iPhone 16 Plus - White.png +0 -0
  67. package/assets/devices/iPhone 16 Pro - Black Titanium.png +0 -0
  68. package/assets/devices/iPhone 16 Pro - Desert Titanium.png +0 -0
  69. package/assets/devices/iPhone 16 Pro - Natural Titanium.png +0 -0
  70. package/assets/devices/iPhone 16 Pro - White Titanium.png +0 -0
  71. package/assets/devices/iPhone 16 Pro Max - Black Titanium.png +0 -0
  72. package/assets/devices/iPhone 16 Pro Max - Desert Titanium.png +0 -0
  73. package/assets/devices/iPhone 16 Pro Max - Natural Titanium.png +0 -0
  74. package/assets/devices/iPhone 16 Pro Max - White Titanium.png +0 -0
  75. package/assets/devices/iPhone 17 - Black.png +0 -0
  76. package/assets/devices/iPhone 17 - Lavender.png +0 -0
  77. package/assets/devices/iPhone 17 - Mist Blue.png +0 -0
  78. package/assets/devices/iPhone 17 - Sage.png +0 -0
  79. package/assets/devices/iPhone 17 - White.png +0 -0
  80. package/assets/devices/iPhone 17 Pro - Cosmic Orange.png +0 -0
  81. package/assets/devices/iPhone 17 Pro - Deep Blue.png +0 -0
  82. package/assets/devices/iPhone 17 Pro - Silver.png +0 -0
  83. package/assets/devices/iPhone 17 Pro Max - Cosmic Orange.png +0 -0
  84. package/assets/devices/iPhone 17 Pro Max - Deep Blue.png +0 -0
  85. package/assets/devices/iPhone 17 Pro Max - Silver.png +0 -0
  86. package/assets/devices/iPhone Air - Cloud White.png +0 -0
  87. package/assets/devices/iPhone Air - Light Gold.png +0 -0
  88. package/assets/devices/iPhone Air - Sky Blue.png +0 -0
  89. package/assets/devices/iPhone Air - Space Black.png +0 -0
  90. package/assets/status-bar/Notch Status Bar Black.png +0 -0
  91. 16 Max Status Bar Black.png +0 -0
  92. 16 Plus Status Bar Black.png +0 -0
  93. package/bin/cli.mjs +146 -0
  94. package/dist/index.cjs +562 -0
  95. package/dist/index.cjs.map +1 -0
  96. package/dist/index.d.cts +112 -0
  97. package/dist/index.d.ts +112 -0
  98. package/dist/index.js +539 -0
  99. package/dist/index.js.map +1 -0
  100. package/package.json +63 -0
@@ -0,0 +1,112 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /** A single color variant for a device. */
4
+ interface DeviceColorVariant {
5
+ /** Human-readable color name, e.g. "Natural Titanium" */
6
+ name: string;
7
+ /** Path to the frame PNG for this color (relative to basePath) */
8
+ frameSrc: string;
9
+ /** CSS hex color for the UI swatch */
10
+ swatch: string;
11
+ }
12
+ /** Configuration for a device model. Contains all frame geometry and color variants. */
13
+ interface DeviceConfig {
14
+ /** Display name, e.g. "iPhone 16 Pro" */
15
+ name: string;
16
+ /** Default frame PNG path (relative to basePath) */
17
+ frameSrc: string;
18
+ /** Native width of the frame PNG in pixels */
19
+ framePngWidth: number;
20
+ /** Native height of the frame PNG in pixels */
21
+ framePngHeight: number;
22
+ /** Screen left offset as a fraction of frame width (0–1) */
23
+ screenLeftFraction: number;
24
+ /** Screen top offset as a fraction of frame height (0–1) */
25
+ screenTopFraction: number;
26
+ /** Screen width as a fraction of frame width (0–1) */
27
+ screenWidthFraction: number;
28
+ /** Screen height as a fraction of frame height (0–1) */
29
+ screenHeightFraction: number;
30
+ /** Screen corner radius as a fraction of frame width (0–1) */
31
+ screenRadiusFraction: number;
32
+ /** Status bar PNG path (relative to basePath) */
33
+ statusBarSrc: string;
34
+ /** Status bar height as a fraction of screen height (0–1) */
35
+ statusBarHeightFraction: number;
36
+ /** Available color variants. Empty array = single-color device. */
37
+ colors: DeviceColorVariant[];
38
+ /** Default color name. Must match one of colors[].name. */
39
+ defaultColor?: string;
40
+ }
41
+ /** Props for the DeviceMockup component. */
42
+ interface DeviceMockupProps {
43
+ /** Device configuration object */
44
+ device: DeviceConfig;
45
+ /** Content to render inside the phone screen */
46
+ children?: React.ReactNode;
47
+ /** Rendered width in pixels. @default 320 */
48
+ width?: number;
49
+ /** Screen background color when no children are provided. @default "#f2f2f2" */
50
+ screenColor?: string;
51
+ /** Show the status bar overlay. @default true */
52
+ showStatusBar?: boolean;
53
+ /** Additional CSS class for the outer wrapper */
54
+ className?: string;
55
+ /** Inline styles for the outer wrapper */
56
+ style?: React.CSSProperties;
57
+ /** Color variant name. Falls back to defaultColor, then frameSrc. */
58
+ color?: string;
59
+ /**
60
+ * Base path for device frame and status bar assets.
61
+ * Defaults to the unpkg CDN so it works out of the box — no setup needed.
62
+ * Set to "/mockify" if you self-host with `npx @mockify/react init`.
63
+ * @default "https://unpkg.com/@mockify/react@latest/assets"
64
+ */
65
+ basePath?: string;
66
+ }
67
+
68
+ /**
69
+ * Renders an ultra-realistic iPhone device mockup.
70
+ *
71
+ * Uses a 3-layer compositing approach:
72
+ * 1. Screen content area (z-index 10)
73
+ * 2. Status bar PNG overlay
74
+ * 3. Device frame PNG on top (z-index 20, pointer-events: none)
75
+ *
76
+ * All positioning is fraction-based so mockups scale to any size.
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * import { DeviceMockup, iPhone16Pro } from "@mockify/react";
81
+ *
82
+ * <DeviceMockup device={iPhone16Pro} width={320}>
83
+ * <img src="/screenshot.png" alt="App" style={{ width: "100%", height: "100%", objectFit: "cover" }} />
84
+ * </DeviceMockup>
85
+ * ```
86
+ */
87
+ declare function DeviceMockup({ device, children, width, screenColor, showStatusBar, className, style, color, basePath, }: DeviceMockupProps): react_jsx_runtime.JSX.Element;
88
+
89
+ declare const iPhone13: DeviceConfig;
90
+ declare const iPhone13Mini: DeviceConfig;
91
+ declare const iPhone13Pro: DeviceConfig;
92
+ declare const iPhone13ProMax: DeviceConfig;
93
+ declare const iPhone14: DeviceConfig;
94
+ declare const iPhone14Plus: DeviceConfig;
95
+ declare const iPhone14Pro: DeviceConfig;
96
+ declare const iPhone14ProMax: DeviceConfig;
97
+ declare const iPhone15: DeviceConfig;
98
+ declare const iPhone15Plus: DeviceConfig;
99
+ declare const iPhone15Pro: DeviceConfig;
100
+ declare const iPhone15ProMax: DeviceConfig;
101
+ declare const iPhone16: DeviceConfig;
102
+ declare const iPhone16Plus: DeviceConfig;
103
+ declare const iPhone16Pro: DeviceConfig;
104
+ declare const iPhone16ProMax: DeviceConfig;
105
+ declare const iPhone17: DeviceConfig;
106
+ declare const iPhone17Pro: DeviceConfig;
107
+ declare const iPhone17ProMax: DeviceConfig;
108
+ declare const iPhoneAir: DeviceConfig;
109
+ /** All 20 available devices, ordered newest first. */
110
+ declare const allDevices: DeviceConfig[];
111
+
112
+ export { type DeviceColorVariant, type DeviceConfig, DeviceMockup, type DeviceMockupProps, allDevices, iPhone13, iPhone13Mini, iPhone13Pro, iPhone13ProMax, iPhone14, iPhone14Plus, iPhone14Pro, iPhone14ProMax, iPhone15, iPhone15Plus, iPhone15Pro, iPhone15ProMax, iPhone16, iPhone16Plus, iPhone16Pro, iPhone16ProMax, iPhone17, iPhone17Pro, iPhone17ProMax, iPhoneAir };
@@ -0,0 +1,112 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /** A single color variant for a device. */
4
+ interface DeviceColorVariant {
5
+ /** Human-readable color name, e.g. "Natural Titanium" */
6
+ name: string;
7
+ /** Path to the frame PNG for this color (relative to basePath) */
8
+ frameSrc: string;
9
+ /** CSS hex color for the UI swatch */
10
+ swatch: string;
11
+ }
12
+ /** Configuration for a device model. Contains all frame geometry and color variants. */
13
+ interface DeviceConfig {
14
+ /** Display name, e.g. "iPhone 16 Pro" */
15
+ name: string;
16
+ /** Default frame PNG path (relative to basePath) */
17
+ frameSrc: string;
18
+ /** Native width of the frame PNG in pixels */
19
+ framePngWidth: number;
20
+ /** Native height of the frame PNG in pixels */
21
+ framePngHeight: number;
22
+ /** Screen left offset as a fraction of frame width (0–1) */
23
+ screenLeftFraction: number;
24
+ /** Screen top offset as a fraction of frame height (0–1) */
25
+ screenTopFraction: number;
26
+ /** Screen width as a fraction of frame width (0–1) */
27
+ screenWidthFraction: number;
28
+ /** Screen height as a fraction of frame height (0–1) */
29
+ screenHeightFraction: number;
30
+ /** Screen corner radius as a fraction of frame width (0–1) */
31
+ screenRadiusFraction: number;
32
+ /** Status bar PNG path (relative to basePath) */
33
+ statusBarSrc: string;
34
+ /** Status bar height as a fraction of screen height (0–1) */
35
+ statusBarHeightFraction: number;
36
+ /** Available color variants. Empty array = single-color device. */
37
+ colors: DeviceColorVariant[];
38
+ /** Default color name. Must match one of colors[].name. */
39
+ defaultColor?: string;
40
+ }
41
+ /** Props for the DeviceMockup component. */
42
+ interface DeviceMockupProps {
43
+ /** Device configuration object */
44
+ device: DeviceConfig;
45
+ /** Content to render inside the phone screen */
46
+ children?: React.ReactNode;
47
+ /** Rendered width in pixels. @default 320 */
48
+ width?: number;
49
+ /** Screen background color when no children are provided. @default "#f2f2f2" */
50
+ screenColor?: string;
51
+ /** Show the status bar overlay. @default true */
52
+ showStatusBar?: boolean;
53
+ /** Additional CSS class for the outer wrapper */
54
+ className?: string;
55
+ /** Inline styles for the outer wrapper */
56
+ style?: React.CSSProperties;
57
+ /** Color variant name. Falls back to defaultColor, then frameSrc. */
58
+ color?: string;
59
+ /**
60
+ * Base path for device frame and status bar assets.
61
+ * Defaults to the unpkg CDN so it works out of the box — no setup needed.
62
+ * Set to "/mockify" if you self-host with `npx @mockify/react init`.
63
+ * @default "https://unpkg.com/@mockify/react@latest/assets"
64
+ */
65
+ basePath?: string;
66
+ }
67
+
68
+ /**
69
+ * Renders an ultra-realistic iPhone device mockup.
70
+ *
71
+ * Uses a 3-layer compositing approach:
72
+ * 1. Screen content area (z-index 10)
73
+ * 2. Status bar PNG overlay
74
+ * 3. Device frame PNG on top (z-index 20, pointer-events: none)
75
+ *
76
+ * All positioning is fraction-based so mockups scale to any size.
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * import { DeviceMockup, iPhone16Pro } from "@mockify/react";
81
+ *
82
+ * <DeviceMockup device={iPhone16Pro} width={320}>
83
+ * <img src="/screenshot.png" alt="App" style={{ width: "100%", height: "100%", objectFit: "cover" }} />
84
+ * </DeviceMockup>
85
+ * ```
86
+ */
87
+ declare function DeviceMockup({ device, children, width, screenColor, showStatusBar, className, style, color, basePath, }: DeviceMockupProps): react_jsx_runtime.JSX.Element;
88
+
89
+ declare const iPhone13: DeviceConfig;
90
+ declare const iPhone13Mini: DeviceConfig;
91
+ declare const iPhone13Pro: DeviceConfig;
92
+ declare const iPhone13ProMax: DeviceConfig;
93
+ declare const iPhone14: DeviceConfig;
94
+ declare const iPhone14Plus: DeviceConfig;
95
+ declare const iPhone14Pro: DeviceConfig;
96
+ declare const iPhone14ProMax: DeviceConfig;
97
+ declare const iPhone15: DeviceConfig;
98
+ declare const iPhone15Plus: DeviceConfig;
99
+ declare const iPhone15Pro: DeviceConfig;
100
+ declare const iPhone15ProMax: DeviceConfig;
101
+ declare const iPhone16: DeviceConfig;
102
+ declare const iPhone16Plus: DeviceConfig;
103
+ declare const iPhone16Pro: DeviceConfig;
104
+ declare const iPhone16ProMax: DeviceConfig;
105
+ declare const iPhone17: DeviceConfig;
106
+ declare const iPhone17Pro: DeviceConfig;
107
+ declare const iPhone17ProMax: DeviceConfig;
108
+ declare const iPhoneAir: DeviceConfig;
109
+ /** All 20 available devices, ordered newest first. */
110
+ declare const allDevices: DeviceConfig[];
111
+
112
+ export { type DeviceColorVariant, type DeviceConfig, DeviceMockup, type DeviceMockupProps, allDevices, iPhone13, iPhone13Mini, iPhone13Pro, iPhone13ProMax, iPhone14, iPhone14Plus, iPhone14Pro, iPhone14ProMax, iPhone15, iPhone15Plus, iPhone15Pro, iPhone15ProMax, iPhone16, iPhone16Plus, iPhone16Pro, iPhone16ProMax, iPhone17, iPhone17Pro, iPhone17ProMax, iPhoneAir };