@unisphere/nx 3.14.0 → 3.16.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.
- package/dist/generators/add-documentation/USAGE.md +64 -0
- package/dist/generators/add-documentation/add-documentation.d.ts +1 -1
- package/dist/generators/add-documentation/add-documentation.d.ts.map +1 -1
- package/dist/generators/add-documentation/add-documentation.js +80 -41
- package/dist/generators/add-documentation/schema.d.ts +4 -1
- package/dist/generators/add-documentation/schema.json +19 -10
- package/dist/generators/add-documentation/templates/babel.config.js +3 -0
- package/dist/generators/add-documentation/templates/docs/api/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docs/changelog/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docs/getting-started/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docusaurus.config.ts.template +116 -0
- package/dist/generators/add-documentation/templates/package.json.template +57 -0
- package/dist/generators/add-documentation/templates/postcss.config.js +6 -0
- package/dist/generators/add-documentation/templates/sidebars.ts +9 -0
- package/dist/generators/add-documentation/templates/src/components/demo-placeholder-card.tsx +33 -0
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/genie/integrate-genie-guide.tsx +149 -0
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/notifications/notifications-react-guide.tsx +211 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-features/index.tsx +239 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-features/styles.module.css +87 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/index.tsx +76 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/styles.module.css +120 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/index.tsx +22 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/styles.module.css +38 -0
- package/dist/generators/add-documentation/templates/src/components/interactive-code-panel.tsx +258 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/developer-toolbox-experience.tsx +84 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/hello-world-experience.tsx +130 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/notificaitons-experience.tsx +635 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/reactions-experience.tsx +117 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/introduction-card.tsx +117 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/playground-card.tsx +67 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/use-color-mode.ts +20 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/utils.ts +8 -0
- package/dist/generators/add-documentation/templates/src/css/custom.css +487 -0
- package/dist/generators/add-documentation/templates/src/css/hero.module.css +190 -0
- package/dist/generators/add-documentation/templates/src/pages/index.module.css +59 -0
- package/dist/generators/add-documentation/templates/src/pages/index.tsx.template +191 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/index.tsx +145 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/styles.module.css +132 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/MobileSidebar/Header/index.tsx +45 -0
- package/dist/generators/add-documentation/templates/static/.nojekyll +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-1.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-2.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-3.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-4.png +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/divider.svg +5 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Architecture.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Cost.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/ExternalLink.svg +3 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Infra.svg +8 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Redundancies.svg +6 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Speed.svg +6 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Standards.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Unified.svg +12 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/custo.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/flame.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/keepr.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/loggi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/palleto.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/publi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/tinker.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/img/favicon.ico +0 -0
- package/dist/generators/add-documentation/templates/static/img/logo.svg +6 -0
- package/dist/generators/add-documentation/templates/static/img/logo_big.svg +12 -0
- package/dist/generators/add-documentation/templates/static/img/logo_big_dark.svg +12 -0
- package/dist/generators/add-documentation/templates/static/img/logo_dark.svg +6 -0
- package/dist/generators/add-documentation/templates/static/img/unisphere-social-card.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/llm/INTEGRATE.md +497 -0
- package/dist/generators/add-documentation/templates/static/robots.txt +5 -0
- package/dist/generators/add-documentation/templates/static/team/amirc.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/erans.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/hadass.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/hillelc.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/idoz.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/lianb.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/nirb.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/nivs.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/omric.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/roeed.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/sivana.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/stask.png +0 -0
- package/dist/generators/add-documentation/templates/static/team/tanyal.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/tomere.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/tornikem.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/yairn.jpeg +0 -0
- package/dist/generators/add-documentation/templates/tailwind.config.js +30 -0
- package/dist/generators/add-documentation/templates/tsconfig.json +7 -0
- package/dist/generators/add-package/add-package.d.ts.map +1 -1
- package/dist/generators/add-package/add-package.js +9 -4
- package/dist/generators/add-package/schema.d.ts +1 -1
- package/dist/generators/add-package/schema.json +18 -10
- package/dist/generators/rename-package/rename-package.d.ts.map +1 -1
- package/dist/generators/rename-package/rename-package.js +12 -0
- package/dist/generators/utils.d.ts +1 -1
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +8 -10
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts +10 -0
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -0
- package/dist/migrations/3-15-0/add-experience-documentation.js +20 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.d.ts +10 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.d.ts.map +1 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.js +32 -0
- package/dist/migrations/3-6-3/remove-rollup-patch.d.ts +1 -1
- package/dist/migrations/3-6-3/remove-rollup-patch.d.ts.map +1 -1
- package/dist/migrations/3-6-3/remove-rollup-patch.js +16 -6
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.d.ts +9 -0
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.d.ts.map +1 -0
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.js +68 -0
- package/dist/shared.d.ts +4 -2
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +3 -1
- package/migrations.json +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { getUnisphereInstance } from '@unisphere/runtime-js'
|
|
4
|
+
import { useEffect } from 'react'
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { NotificationsRuntime, NotificationTypes, AlertIconEnum } from '@unisphere/notifications-core';
|
|
7
|
+
import { PlaygroundCard } from '@site/src/components/ui-shared/playground-card';
|
|
8
|
+
|
|
9
|
+
export const NotificationsExperience = ({ preload }: { preload?: boolean }) => {
|
|
10
|
+
|
|
11
|
+
const [runtime, setRuntime] = useState<NotificationsRuntime | null>(null);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
getUnisphereInstance('').then(workspace => {
|
|
15
|
+
const runtime = workspace.getRuntime<NotificationsRuntime>('unisphere.widget.notifications', 'notifications');
|
|
16
|
+
setRuntime(runtime);
|
|
17
|
+
}).catch(e => {
|
|
18
|
+
console.error(e)
|
|
19
|
+
})
|
|
20
|
+
}, [preload])
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<PlaygroundCard
|
|
25
|
+
title="Playground - Notifications"
|
|
26
|
+
>
|
|
27
|
+
<div style={{ marginBottom: '1rem', color: '#64748b', fontSize: '0.9rem' }}>
|
|
28
|
+
Experience Unisphere's notification system with different types and styles. Each button demonstrates a different notification approach.
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
style={{
|
|
33
|
+
display: 'grid',
|
|
34
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
|
|
35
|
+
gap: '12px',
|
|
36
|
+
marginBottom: '1rem'
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
{/* Toast Notification */}
|
|
40
|
+
<button
|
|
41
|
+
onClick={() => runtime?.addNotification({
|
|
42
|
+
type: NotificationTypes.Toast,
|
|
43
|
+
content: {
|
|
44
|
+
title: 'Toast Alert! 🍞',
|
|
45
|
+
message: 'This toast is more reliable than your morning bread. Unlike your code, it actually pops up when expected!',
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
})}
|
|
49
|
+
disabled={!runtime}
|
|
50
|
+
style={{
|
|
51
|
+
padding: '12px 16px',
|
|
52
|
+
backgroundColor: runtime ? '#3b82f6' : '#94a3b8',
|
|
53
|
+
color: 'white',
|
|
54
|
+
border: 'none',
|
|
55
|
+
borderRadius: '8px',
|
|
56
|
+
fontSize: '14px',
|
|
57
|
+
fontWeight: '500',
|
|
58
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
59
|
+
transition: 'all 0.2s ease',
|
|
60
|
+
display: 'flex',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
justifyContent: 'center',
|
|
63
|
+
gap: '8px'
|
|
64
|
+
}}
|
|
65
|
+
onMouseEnter={(e) => {
|
|
66
|
+
if (runtime) {
|
|
67
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#2563eb';
|
|
68
|
+
}
|
|
69
|
+
}}
|
|
70
|
+
onMouseLeave={(e) => {
|
|
71
|
+
if (runtime) {
|
|
72
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#3b82f6';
|
|
73
|
+
}
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
🍞 Toast
|
|
77
|
+
</button>
|
|
78
|
+
|
|
79
|
+
{/* Overlay Notification
|
|
80
|
+
<button
|
|
81
|
+
onClick={() => runtime?.addNotification({
|
|
82
|
+
type: NotificationTypes.Overlay,
|
|
83
|
+
content: {
|
|
84
|
+
title: 'Welcome to Unisphere',
|
|
85
|
+
message: 'This overlay demonstrates how important announcements can be displayed prominently.',
|
|
86
|
+
actions: [
|
|
87
|
+
{ label: 'Get Started', action: () => console.log('Get Started clicked') },
|
|
88
|
+
{ label: 'Learn More', action: () => console.log('Learn More clicked') }
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
})}
|
|
92
|
+
disabled={!runtime}
|
|
93
|
+
style={{
|
|
94
|
+
padding: '12px 16px',
|
|
95
|
+
backgroundColor: runtime ? '#10b981' : '#94a3b8',
|
|
96
|
+
color: 'white',
|
|
97
|
+
border: 'none',
|
|
98
|
+
borderRadius: '8px',
|
|
99
|
+
fontSize: '14px',
|
|
100
|
+
fontWeight: '500',
|
|
101
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
102
|
+
transition: 'all 0.2s ease',
|
|
103
|
+
display: 'flex',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
gap: '8px'
|
|
107
|
+
}}
|
|
108
|
+
onMouseEnter={(e) => {
|
|
109
|
+
if (runtime) {
|
|
110
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#059669';
|
|
111
|
+
}
|
|
112
|
+
}}
|
|
113
|
+
onMouseLeave={(e) => {
|
|
114
|
+
if (runtime) {
|
|
115
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#10b981';
|
|
116
|
+
}
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
📋 Overlay
|
|
120
|
+
</button> */}
|
|
121
|
+
|
|
122
|
+
{/* Custom Toast */}
|
|
123
|
+
<button
|
|
124
|
+
onClick={() => runtime?.addNotification({
|
|
125
|
+
type: NotificationTypes.CustomToast,
|
|
126
|
+
callbacks: {
|
|
127
|
+
onMounted: (div: HTMLDivElement) => {
|
|
128
|
+
// Create custom toast content with funny documentation-relevant message
|
|
129
|
+
div.innerHTML = `
|
|
130
|
+
<div style="
|
|
131
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
132
|
+
color: white;
|
|
133
|
+
padding: 16px 20px;
|
|
134
|
+
border-radius: 12px;
|
|
135
|
+
box-shadow: 0 8px 32px rgba(0,0,0,0.2);
|
|
136
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
137
|
+
max-width: 350px;
|
|
138
|
+
position: relative;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
">
|
|
141
|
+
<div style="
|
|
142
|
+
position: absolute;
|
|
143
|
+
top: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
height: 3px;
|
|
147
|
+
background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
|
|
148
|
+
animation: shimmer 2s infinite;
|
|
149
|
+
"></div>
|
|
150
|
+
<div style="display: flex; align-items: center; gap: 12px;">
|
|
151
|
+
<div style="font-size: 24px;">🎉</div>
|
|
152
|
+
<div>
|
|
153
|
+
<div style="font-weight: 600; margin-bottom: 4px;">
|
|
154
|
+
Documentation Ninja Achievement Unlocked!
|
|
155
|
+
</div>
|
|
156
|
+
<div style="font-size: 14px; opacity: 0.9; line-height: 1.4;">
|
|
157
|
+
You've successfully triggered a custom toast! Your developer skills are
|
|
158
|
+
<strong>over 9000</strong> 🚀. The docs are proud of you.
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
<div style="
|
|
163
|
+
margin-top: 12px;
|
|
164
|
+
padding-top: 12px;
|
|
165
|
+
border-top: 1px solid rgba(255,255,255,0.2);
|
|
166
|
+
font-size: 12px;
|
|
167
|
+
opacity: 0.8;
|
|
168
|
+
text-align: center;
|
|
169
|
+
">
|
|
170
|
+
💡 Pro tip: Custom toasts can contain any HTML content!
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
<style>
|
|
174
|
+
@keyframes shimmer {
|
|
175
|
+
0% { transform: translateX(-100%); }
|
|
176
|
+
100% { transform: translateX(100%); }
|
|
177
|
+
}
|
|
178
|
+
</style>
|
|
179
|
+
`;
|
|
180
|
+
},
|
|
181
|
+
onUnmounted: (id: string) => {
|
|
182
|
+
console.log('🎉 Custom toast with ID', id, 'has been dismissed. Thanks for playing!');
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
})}
|
|
186
|
+
disabled={!runtime}
|
|
187
|
+
style={{
|
|
188
|
+
padding: '12px 16px',
|
|
189
|
+
backgroundColor: runtime ? '#8b5cf6' : '#94a3b8',
|
|
190
|
+
color: 'white',
|
|
191
|
+
border: 'none',
|
|
192
|
+
borderRadius: '8px',
|
|
193
|
+
fontSize: '14px',
|
|
194
|
+
fontWeight: '500',
|
|
195
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
196
|
+
transition: 'all 0.2s ease',
|
|
197
|
+
display: 'flex',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
justifyContent: 'center',
|
|
200
|
+
gap: '8px'
|
|
201
|
+
}}
|
|
202
|
+
onMouseEnter={(e) => {
|
|
203
|
+
if (runtime) {
|
|
204
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#7c3aed';
|
|
205
|
+
}
|
|
206
|
+
}}
|
|
207
|
+
onMouseLeave={(e) => {
|
|
208
|
+
if (runtime) {
|
|
209
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#8b5cf6';
|
|
210
|
+
}
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
🎨 Custom Toast
|
|
214
|
+
</button>
|
|
215
|
+
|
|
216
|
+
{/* Borderless Toast */}
|
|
217
|
+
<button
|
|
218
|
+
onClick={() => runtime?.addNotification({
|
|
219
|
+
type: NotificationTypes.BorderlessToast,
|
|
220
|
+
callbacks: {
|
|
221
|
+
onMounted: (div: HTMLDivElement) => {
|
|
222
|
+
// Create a funny borderless toast with coffee theme
|
|
223
|
+
div.innerHTML = `
|
|
224
|
+
<div style="
|
|
225
|
+
background: linear-gradient(45deg, #8B4513, #D2691E, #CD853F);
|
|
226
|
+
color: white;
|
|
227
|
+
padding: 16px 24px;
|
|
228
|
+
border-radius: 50px;
|
|
229
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
230
|
+
box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
gap: 12px;
|
|
234
|
+
max-width: 400px;
|
|
235
|
+
position: relative;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
animation: float 3s ease-in-out infinite;
|
|
238
|
+
">
|
|
239
|
+
<div style="
|
|
240
|
+
position: absolute;
|
|
241
|
+
top: 0;
|
|
242
|
+
left: -100%;
|
|
243
|
+
width: 100%;
|
|
244
|
+
height: 100%;
|
|
245
|
+
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
|
|
246
|
+
animation: shimmer 2s infinite;
|
|
247
|
+
"></div>
|
|
248
|
+
<div style="font-size: 24px; z-index: 1;">☕</div>
|
|
249
|
+
<div style="z-index: 1;">
|
|
250
|
+
<div style="font-weight: 600; font-size: 14px; margin-bottom: 2px;">
|
|
251
|
+
Borderless Achievement Unlocked! 🏆
|
|
252
|
+
</div>
|
|
253
|
+
<div style="font-size: 13px; opacity: 0.9; line-height: 1.3;">
|
|
254
|
+
Like your code after 3 cups of coffee - no boundaries, just pure magic! ✨
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
<div style="
|
|
258
|
+
font-size: 20px;
|
|
259
|
+
z-index: 1;
|
|
260
|
+
animation: bounce 1s ease-in-out infinite alternate;
|
|
261
|
+
">🚀</div>
|
|
262
|
+
</div>
|
|
263
|
+
<style>
|
|
264
|
+
@keyframes float {
|
|
265
|
+
0%, 100% { transform: translateY(0px); }
|
|
266
|
+
50% { transform: translateY(-5px); }
|
|
267
|
+
}
|
|
268
|
+
@keyframes shimmer {
|
|
269
|
+
0% { left: -100%; }
|
|
270
|
+
100% { left: 100%; }
|
|
271
|
+
}
|
|
272
|
+
@keyframes bounce {
|
|
273
|
+
0% { transform: scale(1); }
|
|
274
|
+
100% { transform: scale(1.1); }
|
|
275
|
+
}
|
|
276
|
+
</style>
|
|
277
|
+
`;
|
|
278
|
+
},
|
|
279
|
+
onUnmounted: (id: string) => {
|
|
280
|
+
console.log('☕ Borderless toast with ID', id, 'has floated away like steam from your coffee cup! Keep coding! 🚀');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
})}
|
|
284
|
+
disabled={!runtime}
|
|
285
|
+
style={{
|
|
286
|
+
padding: '12px 16px',
|
|
287
|
+
backgroundColor: runtime ? '#f59e0b' : '#94a3b8',
|
|
288
|
+
color: 'white',
|
|
289
|
+
border: 'none',
|
|
290
|
+
borderRadius: '8px',
|
|
291
|
+
fontSize: '14px',
|
|
292
|
+
fontWeight: '500',
|
|
293
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
294
|
+
transition: 'all 0.2s ease',
|
|
295
|
+
display: 'flex',
|
|
296
|
+
alignItems: 'center',
|
|
297
|
+
justifyContent: 'center',
|
|
298
|
+
gap: '8px'
|
|
299
|
+
}}
|
|
300
|
+
onMouseEnter={(e) => {
|
|
301
|
+
if (runtime) {
|
|
302
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#d97706';
|
|
303
|
+
}
|
|
304
|
+
}}
|
|
305
|
+
onMouseLeave={(e) => {
|
|
306
|
+
if (runtime) {
|
|
307
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#f59e0b';
|
|
308
|
+
}
|
|
309
|
+
}}
|
|
310
|
+
>
|
|
311
|
+
✨ Borderless
|
|
312
|
+
</button>
|
|
313
|
+
|
|
314
|
+
{/* Custom Overlay */}
|
|
315
|
+
<button
|
|
316
|
+
onClick={() => runtime?.addNotification({
|
|
317
|
+
type: NotificationTypes.CustomOverlay,
|
|
318
|
+
options: {
|
|
319
|
+
duration: 3000
|
|
320
|
+
},
|
|
321
|
+
callbacks: {
|
|
322
|
+
onMounted: (div: HTMLDivElement) => {
|
|
323
|
+
// Create a hilarious developer-themed custom overlay (no backdrop since one exists)
|
|
324
|
+
div.innerHTML = `
|
|
325
|
+
<div style="
|
|
326
|
+
position: fixed;
|
|
327
|
+
top: 20px;
|
|
328
|
+
right: 20px;
|
|
329
|
+
z-index: 1000;
|
|
330
|
+
animation: slideInRight 0.3s ease-out;
|
|
331
|
+
">
|
|
332
|
+
|
|
333
|
+
<div style="
|
|
334
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
335
|
+
max-width: 280px;
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
">
|
|
339
|
+
|
|
340
|
+
<div style="display: flex; align-items: flex-start; gap: 12px;">
|
|
341
|
+
<div style="font-size: 20px; margin-top: 2px;">🤖</div>
|
|
342
|
+
|
|
343
|
+
<div style="flex: 1;">
|
|
344
|
+
<div style="
|
|
345
|
+
font-weight: 600;
|
|
346
|
+
font-size: 14px;
|
|
347
|
+
color: #f3f4f6;
|
|
348
|
+
margin-bottom: 4px;
|
|
349
|
+
">
|
|
350
|
+
Custom Overlay Active
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
<div style="
|
|
354
|
+
font-size: 13px;
|
|
355
|
+
color: #d1d5db;
|
|
356
|
+
line-height: 1.4;
|
|
357
|
+
margin-bottom: 12px;
|
|
358
|
+
">
|
|
359
|
+
You've unlocked advanced notification powers! ✨
|
|
360
|
+
</div>
|
|
361
|
+
|
|
362
|
+
<div style="display: flex; gap: 8px;">
|
|
363
|
+
<button
|
|
364
|
+
style="
|
|
365
|
+
background: #3b82f6;
|
|
366
|
+
color: white;
|
|
367
|
+
border: none;
|
|
368
|
+
padding: 6px 12px;
|
|
369
|
+
border-radius: 6px;
|
|
370
|
+
font-size: 12px;
|
|
371
|
+
font-weight: 500;
|
|
372
|
+
cursor: pointer;
|
|
373
|
+
transition: all 0.2s ease;
|
|
374
|
+
"
|
|
375
|
+
onmouseover="this.style.background='#2563eb'"
|
|
376
|
+
onmouseout="this.style.background='#3b82f6'"
|
|
377
|
+
>
|
|
378
|
+
Got it!
|
|
379
|
+
</button>
|
|
380
|
+
|
|
381
|
+
<button
|
|
382
|
+
style="
|
|
383
|
+
background: rgba(255,255,255,0.06);
|
|
384
|
+
color: #e5e7eb;
|
|
385
|
+
border: 1px solid rgba(255,255,255,0.15);
|
|
386
|
+
padding: 6px 12px;
|
|
387
|
+
border-radius: 6px;
|
|
388
|
+
font-size: 12px;
|
|
389
|
+
font-weight: 500;
|
|
390
|
+
cursor: pointer;
|
|
391
|
+
transition: all 0.2s ease;
|
|
392
|
+
"
|
|
393
|
+
onmouseover="this.style.background='rgba(255,255,255,0.12)'"
|
|
394
|
+
onmouseout="this.style.background='rgba(255,255,255,0.06)'"
|
|
395
|
+
>
|
|
396
|
+
☕ Later
|
|
397
|
+
</button>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
<button
|
|
402
|
+
onclick="this.closest('[style*=fixed]').style.display='none';"
|
|
403
|
+
style="
|
|
404
|
+
background: transparent;
|
|
405
|
+
border: none;
|
|
406
|
+
color: #9ca3af;
|
|
407
|
+
font-size: 16px;
|
|
408
|
+
cursor: pointer;
|
|
409
|
+
padding: 2px;
|
|
410
|
+
line-height: 1;
|
|
411
|
+
transition: color 0.2s ease;
|
|
412
|
+
"
|
|
413
|
+
onmouseover="this.style.color='#f3f4f6'"
|
|
414
|
+
onmouseout="this.style.color='#9ca3af'"
|
|
415
|
+
>
|
|
416
|
+
×
|
|
417
|
+
</button>
|
|
418
|
+
</div>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
<style>
|
|
423
|
+
@keyframes slideInRight {
|
|
424
|
+
from { transform: translateX(100%); opacity: 0; }
|
|
425
|
+
to { transform: translateX(0); opacity: 1; }
|
|
426
|
+
}
|
|
427
|
+
</style>
|
|
428
|
+
`;
|
|
429
|
+
},
|
|
430
|
+
onUnmounted: (id: string) => {
|
|
431
|
+
console.log('🤖 Custom overlay with ID', id, 'has completed its mission! Developer productivity levels: MAXIMUM! 🚀☕');
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
})}
|
|
435
|
+
disabled={!runtime}
|
|
436
|
+
style={{
|
|
437
|
+
padding: '12px 16px',
|
|
438
|
+
backgroundColor: runtime ? '#ef4444' : '#94a3b8',
|
|
439
|
+
color: 'white',
|
|
440
|
+
border: 'none',
|
|
441
|
+
borderRadius: '8px',
|
|
442
|
+
fontSize: '14px',
|
|
443
|
+
fontWeight: '500',
|
|
444
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
445
|
+
transition: 'all 0.2s ease',
|
|
446
|
+
display: 'flex',
|
|
447
|
+
alignItems: 'center',
|
|
448
|
+
justifyContent: 'center',
|
|
449
|
+
gap: '8px'
|
|
450
|
+
}}
|
|
451
|
+
onMouseEnter={(e) => {
|
|
452
|
+
if (runtime) {
|
|
453
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#dc2626';
|
|
454
|
+
}
|
|
455
|
+
}}
|
|
456
|
+
onMouseLeave={(e) => {
|
|
457
|
+
if (runtime) {
|
|
458
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#ef4444';
|
|
459
|
+
}
|
|
460
|
+
}}
|
|
461
|
+
>
|
|
462
|
+
🚀 Custom Overlay
|
|
463
|
+
</button>
|
|
464
|
+
|
|
465
|
+
{/* Information Alert */}
|
|
466
|
+
<button
|
|
467
|
+
onClick={() => runtime?.addNotification({
|
|
468
|
+
type: NotificationTypes.Alert,
|
|
469
|
+
text: 'Did you know? Unisphere can load experiences faster than you can say "JavaScript framework fatigue"! 🚀',
|
|
470
|
+
variant: AlertIconEnum.Information,
|
|
471
|
+
showIcon: true
|
|
472
|
+
})}
|
|
473
|
+
disabled={!runtime}
|
|
474
|
+
style={{
|
|
475
|
+
padding: '12px 16px',
|
|
476
|
+
backgroundColor: runtime ? '#3b82f6' : '#94a3b8',
|
|
477
|
+
color: 'white',
|
|
478
|
+
border: 'none',
|
|
479
|
+
borderRadius: '8px',
|
|
480
|
+
fontSize: '14px',
|
|
481
|
+
fontWeight: '500',
|
|
482
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
483
|
+
transition: 'all 0.2s ease',
|
|
484
|
+
display: 'flex',
|
|
485
|
+
alignItems: 'center',
|
|
486
|
+
justifyContent: 'center',
|
|
487
|
+
gap: '8px'
|
|
488
|
+
}}
|
|
489
|
+
onMouseEnter={(e) => {
|
|
490
|
+
if (runtime) {
|
|
491
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#2563eb';
|
|
492
|
+
}
|
|
493
|
+
}}
|
|
494
|
+
onMouseLeave={(e) => {
|
|
495
|
+
if (runtime) {
|
|
496
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#3b82f6';
|
|
497
|
+
}
|
|
498
|
+
}}
|
|
499
|
+
>
|
|
500
|
+
ℹ️ Info Alert
|
|
501
|
+
</button>
|
|
502
|
+
|
|
503
|
+
{/* Success Alert */}
|
|
504
|
+
<button
|
|
505
|
+
onClick={() => runtime?.addNotification({
|
|
506
|
+
type: NotificationTypes.Alert,
|
|
507
|
+
text: 'Congratulations! You\'ve successfully mastered the art of clicking buttons. Your developer level has increased! 🎉',
|
|
508
|
+
variant: AlertIconEnum.Success,
|
|
509
|
+
showIcon: true
|
|
510
|
+
})}
|
|
511
|
+
disabled={!runtime}
|
|
512
|
+
style={{
|
|
513
|
+
padding: '12px 16px',
|
|
514
|
+
backgroundColor: runtime ? '#10b981' : '#94a3b8',
|
|
515
|
+
color: 'white',
|
|
516
|
+
border: 'none',
|
|
517
|
+
borderRadius: '8px',
|
|
518
|
+
fontSize: '14px',
|
|
519
|
+
fontWeight: '500',
|
|
520
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
521
|
+
transition: 'all 0.2s ease',
|
|
522
|
+
display: 'flex',
|
|
523
|
+
alignItems: 'center',
|
|
524
|
+
justifyContent: 'center',
|
|
525
|
+
gap: '8px'
|
|
526
|
+
}}
|
|
527
|
+
onMouseEnter={(e) => {
|
|
528
|
+
if (runtime) {
|
|
529
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#059669';
|
|
530
|
+
}
|
|
531
|
+
}}
|
|
532
|
+
onMouseLeave={(e) => {
|
|
533
|
+
if (runtime) {
|
|
534
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#10b981';
|
|
535
|
+
}
|
|
536
|
+
}}
|
|
537
|
+
>
|
|
538
|
+
✅ Success Alert
|
|
539
|
+
</button>
|
|
540
|
+
|
|
541
|
+
{/* Warning Alert */}
|
|
542
|
+
<button
|
|
543
|
+
onClick={() => runtime?.addNotification({
|
|
544
|
+
type: NotificationTypes.Alert,
|
|
545
|
+
text: 'Warning: Your coffee levels are dangerously low! Productivity may decrease by 73%. Please refuel immediately! ☕',
|
|
546
|
+
variant: AlertIconEnum.Warning,
|
|
547
|
+
showIcon: true
|
|
548
|
+
})}
|
|
549
|
+
disabled={!runtime}
|
|
550
|
+
style={{
|
|
551
|
+
padding: '12px 16px',
|
|
552
|
+
backgroundColor: runtime ? '#f59e0b' : '#94a3b8',
|
|
553
|
+
color: 'white',
|
|
554
|
+
border: 'none',
|
|
555
|
+
borderRadius: '8px',
|
|
556
|
+
fontSize: '14px',
|
|
557
|
+
fontWeight: '500',
|
|
558
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
559
|
+
transition: 'all 0.2s ease',
|
|
560
|
+
display: 'flex',
|
|
561
|
+
alignItems: 'center',
|
|
562
|
+
justifyContent: 'center',
|
|
563
|
+
gap: '8px'
|
|
564
|
+
}}
|
|
565
|
+
onMouseEnter={(e) => {
|
|
566
|
+
if (runtime) {
|
|
567
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#d97706';
|
|
568
|
+
}
|
|
569
|
+
}}
|
|
570
|
+
onMouseLeave={(e) => {
|
|
571
|
+
if (runtime) {
|
|
572
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#f59e0b';
|
|
573
|
+
}
|
|
574
|
+
}}
|
|
575
|
+
>
|
|
576
|
+
⚠️ Warning Alert
|
|
577
|
+
</button>
|
|
578
|
+
|
|
579
|
+
{/* Error Alert */}
|
|
580
|
+
<button
|
|
581
|
+
onClick={() => runtime?.addNotification({
|
|
582
|
+
type: NotificationTypes.Alert,
|
|
583
|
+
text: 'Error 404: Your motivation not found. Have you tried turning your coffee machine off and on again? 🤖',
|
|
584
|
+
variant: AlertIconEnum.Error,
|
|
585
|
+
showIcon: true
|
|
586
|
+
})}
|
|
587
|
+
disabled={!runtime}
|
|
588
|
+
style={{
|
|
589
|
+
padding: '12px 16px',
|
|
590
|
+
backgroundColor: runtime ? '#dc2626' : '#94a3b8',
|
|
591
|
+
color: 'white',
|
|
592
|
+
border: 'none',
|
|
593
|
+
borderRadius: '8px',
|
|
594
|
+
fontSize: '14px',
|
|
595
|
+
fontWeight: '500',
|
|
596
|
+
cursor: runtime ? 'pointer' : 'not-allowed',
|
|
597
|
+
transition: 'all 0.2s ease',
|
|
598
|
+
display: 'flex',
|
|
599
|
+
alignItems: 'center',
|
|
600
|
+
justifyContent: 'center',
|
|
601
|
+
gap: '8px'
|
|
602
|
+
}}
|
|
603
|
+
onMouseEnter={(e) => {
|
|
604
|
+
if (runtime) {
|
|
605
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#b91c1c';
|
|
606
|
+
}
|
|
607
|
+
}}
|
|
608
|
+
onMouseLeave={(e) => {
|
|
609
|
+
if (runtime) {
|
|
610
|
+
(e.target as HTMLButtonElement).style.backgroundColor = '#dc2626';
|
|
611
|
+
}
|
|
612
|
+
}}
|
|
613
|
+
>
|
|
614
|
+
❌ Error Alert
|
|
615
|
+
</button>
|
|
616
|
+
</div>
|
|
617
|
+
|
|
618
|
+
{!runtime && (
|
|
619
|
+
<div
|
|
620
|
+
style={{
|
|
621
|
+
padding: '12px 16px',
|
|
622
|
+
backgroundColor: '#fef3c7',
|
|
623
|
+
border: '1px solid #f59e0b',
|
|
624
|
+
borderRadius: '8px',
|
|
625
|
+
fontSize: '14px',
|
|
626
|
+
color: '#92400e',
|
|
627
|
+
textAlign: 'center'
|
|
628
|
+
}}
|
|
629
|
+
>
|
|
630
|
+
💡 Notifications runtime is loading... Buttons will be enabled once ready.
|
|
631
|
+
</div>
|
|
632
|
+
)}
|
|
633
|
+
</PlaygroundCard>
|
|
634
|
+
);
|
|
635
|
+
}
|