@reflow-js/templates 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.
- package/README.md +23 -0
- package/mfe/application.json +17 -0
- package/mfe/jest.config.js +7 -0
- package/mfe/package.json +18 -0
- package/mfe/public/index.html +21 -0
- package/mfe/reflow.config.json +35 -0
- package/mfe/src/index.ts +18 -0
- package/mfe/src/style.css +13 -0
- package/mfe/src/welcome-component.test.ts +38 -0
- package/mfe/src/welcome-component.ts +52 -0
- package/mfe/tsconfig.json +16 -0
- package/mfe-angular/README.md +14 -0
- package/mfe-angular/public/index.html +21 -0
- package/mfe-angular/reflow.config.json +23 -0
- package/mfe-angular/src/app.component.html +3 -0
- package/mfe-angular/src/components/welcome.component.ts +283 -0
- package/mfe-angular/src/index.ts +44 -0
- package/mfe-angular/src/styles.css +25 -0
- package/mfe-angular/tsconfig.json +16 -0
- package/mfe-react/README.md +0 -0
- package/mfe-react/application.json +5 -0
- package/mfe-react/public/index.html +22 -0
- package/mfe-react/reflow.config.json +34 -0
- package/mfe-react/src/App.tsx +21 -0
- package/mfe-react/src/components/welcome/welcome.component.tsx +74 -0
- package/mfe-react/src/components/welcome/welcome.style.css +224 -0
- package/mfe-react/src/index.css +25 -0
- package/mfe-react/src/index.tsx +39 -0
- package/mfe-react/tsconfig.json +19 -0
- package/mfe-react-tailwind/README.md +0 -0
- package/mfe-react-tailwind/application.json +5 -0
- package/mfe-react-tailwind/postcss.config.js +6 -0
- package/mfe-react-tailwind/public/index.html +22 -0
- package/mfe-react-tailwind/reflow.config.json +34 -0
- package/mfe-react-tailwind/src/App.tsx +21 -0
- package/mfe-react-tailwind/src/components/welcome/welcome.component.tsx +74 -0
- package/mfe-react-tailwind/src/components/welcome/welcome.style.css +224 -0
- package/mfe-react-tailwind/src/index.css +29 -0
- package/mfe-react-tailwind/src/index.tsx +39 -0
- package/mfe-react-tailwind/tailwind.config.js +11 -0
- package/mfe-react-tailwind/tsconfig.json +19 -0
- package/mfe-vue/README.md +14 -0
- package/mfe-vue/public/application.json +7 -0
- package/mfe-vue/public/index.html +21 -0
- package/mfe-vue/reflow.config.json +23 -0
- package/mfe-vue/src/App.vue +16 -0
- package/mfe-vue/src/components/Welcome.vue +307 -0
- package/mfe-vue/src/index.css +5 -0
- package/mfe-vue/src/index.ts +16 -0
- package/mfe-vue/tsconfig.json +14 -0
- package/package.json +23 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="rf-card">
|
|
3
|
+
<div class="rf-glow"></div>
|
|
4
|
+
<div class="rf-card__top-bar"></div>
|
|
5
|
+
<div class="rf-card__inner">
|
|
6
|
+
<div class="rf-card__header">
|
|
7
|
+
<div class="rf-icon-wrap">
|
|
8
|
+
<svg viewBox="0 0 128 128" width="24" height="24">
|
|
9
|
+
<path fill="#42b883" d="M78.8,10L64,35.4L49.2,10H0l64,110l64-110H78.8z"/>
|
|
10
|
+
<path fill="#35495e" d="M78.8,10L64,35.4L49.2,10H25.6L64,76l38.4-66H78.8z"/>
|
|
11
|
+
</svg>
|
|
12
|
+
</div>
|
|
13
|
+
<span class="rf-badge">Vue MFE</span>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<h1 class="rf-card__title">{{ title }}</h1>
|
|
17
|
+
<p class="rf-card__desc">{{ description }}</p>
|
|
18
|
+
|
|
19
|
+
<div class="rf-divider"></div>
|
|
20
|
+
|
|
21
|
+
<div class="rf-greeting">
|
|
22
|
+
<div class="rf-avatar">{{ name.charAt(0) }}</div>
|
|
23
|
+
<span class="rf-greeting__text">Hola, <strong class="rf-greeting__name">{{ name }}</strong></span>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="rf-actions">
|
|
27
|
+
<button class="rf-btn rf-btn--primary" @click="onPrimary">
|
|
28
|
+
<svg class="rf-btn__ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>
|
|
29
|
+
Acción del MFE
|
|
30
|
+
</button>
|
|
31
|
+
<button class="rf-btn rf-btn--ghost" @click="onSecondary">
|
|
32
|
+
<svg class="rf-btn__ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>
|
|
33
|
+
Shadow DOM
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="rf-chips">
|
|
38
|
+
<span class="rf-chip rf-chip--green">Vue 3.3+</span>
|
|
39
|
+
<span class="rf-chip rf-chip--muted">Reflow-js Core</span>
|
|
40
|
+
<span class="rf-chip rf-chip--outline">Encapsulated</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script lang="ts">
|
|
47
|
+
import { defineComponent } from 'vue';
|
|
48
|
+
|
|
49
|
+
export default defineComponent({
|
|
50
|
+
name: 'Welcome',
|
|
51
|
+
props: {
|
|
52
|
+
title: { type: String, default: 'demo-vue Vue MFE' },
|
|
53
|
+
description: { type: String, default: 'Componente Vue encapsulado con Shadow DOM por Reflow-js.' },
|
|
54
|
+
name: { type: String, default: 'Developer' }
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
onPrimary() {
|
|
58
|
+
console.log('[Reflow] Welcome primary action triggered');
|
|
59
|
+
},
|
|
60
|
+
onSecondary() {
|
|
61
|
+
alert(`¡Shadow DOM activo! Estilos de "${this.title}" están totalmente aislados.`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style scoped>
|
|
68
|
+
/* ── Color Palette (Vue Premium Green) ── */
|
|
69
|
+
:host {
|
|
70
|
+
--rf-vue-primary: #42b883;
|
|
71
|
+
--rf-vue-secondary: #35495e;
|
|
72
|
+
--rf-bg-dark: #0f172a;
|
|
73
|
+
--rf-surface: rgba(30, 41, 59, 0.7);
|
|
74
|
+
--rf-text-main: #F8FAFC;
|
|
75
|
+
--rf-text-muted: #94A3B8;
|
|
76
|
+
--rf-border: rgba(66, 184, 131, 0.3);
|
|
77
|
+
--rf-glow: rgba(66, 184, 131, 0.25);
|
|
78
|
+
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
width: 100%;
|
|
83
|
+
min-height: 400px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* ── Card Container ── */
|
|
87
|
+
.rf-card {
|
|
88
|
+
position: relative;
|
|
89
|
+
width: 100%;
|
|
90
|
+
max-width: 540px;
|
|
91
|
+
border-radius: 1.5rem;
|
|
92
|
+
background: var(--rf-surface);
|
|
93
|
+
backdrop-filter: blur(24px);
|
|
94
|
+
-webkit-backdrop-filter: blur(24px);
|
|
95
|
+
border: 1px solid var(--rf-border);
|
|
96
|
+
box-shadow:
|
|
97
|
+
0 20px 50px rgba(0, 0, 0, 0.3),
|
|
98
|
+
0 0 100px var(--rf-glow);
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
101
|
+
color: var(--rf-text-main);
|
|
102
|
+
transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.rf-card:hover {
|
|
106
|
+
transform: translateY(-4px);
|
|
107
|
+
box-shadow:
|
|
108
|
+
0 30px 60px rgba(0, 0, 0, 0.6),
|
|
109
|
+
0 0 150px rgba(66, 184, 131, 0.35);
|
|
110
|
+
border-color: rgba(66, 184, 131, 0.5);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ── Ambient Effects ── */
|
|
114
|
+
.rf-glow {
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: -40%;
|
|
117
|
+
right: -40%;
|
|
118
|
+
width: 80%;
|
|
119
|
+
height: 80%;
|
|
120
|
+
background: radial-gradient(circle, var(--rf-vue-primary) 0%, transparent 60%);
|
|
121
|
+
opacity: 0.15;
|
|
122
|
+
filter: blur(60px);
|
|
123
|
+
z-index: 0;
|
|
124
|
+
pointer-events: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.rf-card__top-bar {
|
|
128
|
+
height: 4px;
|
|
129
|
+
background: linear-gradient(90deg, var(--rf-vue-primary), var(--rf-vue-secondary));
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* ── Content ── */
|
|
134
|
+
.rf-card__inner {
|
|
135
|
+
position: relative;
|
|
136
|
+
padding: 2.5rem;
|
|
137
|
+
z-index: 1;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.rf-card__header {
|
|
141
|
+
display: flex;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
align-items: center;
|
|
144
|
+
margin-bottom: 2rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.rf-icon-wrap {
|
|
148
|
+
width: 52px;
|
|
149
|
+
height: 52px;
|
|
150
|
+
background: linear-gradient(135deg, rgba(66, 184, 131, 0.15), rgba(53, 73, 94, 0.15));
|
|
151
|
+
border-radius: 14px;
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.rf-badge {
|
|
159
|
+
font-size: 0.75rem;
|
|
160
|
+
font-weight: 700;
|
|
161
|
+
color: var(--rf-vue-primary);
|
|
162
|
+
background: rgba(66, 184, 131, 0.1);
|
|
163
|
+
padding: 0.4rem 1rem;
|
|
164
|
+
border-radius: 100px;
|
|
165
|
+
text-transform: uppercase;
|
|
166
|
+
letter-spacing: 0.08em;
|
|
167
|
+
border: 1px solid rgba(66, 184, 131, 0.2);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.rf-card__title {
|
|
171
|
+
font-size: 2rem;
|
|
172
|
+
font-weight: 700;
|
|
173
|
+
margin: 0 0 0.75rem 0;
|
|
174
|
+
color: #fff;
|
|
175
|
+
letter-spacing: -0.02em;
|
|
176
|
+
line-height: 1.1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.rf-card__desc {
|
|
180
|
+
font-size: 1.05rem;
|
|
181
|
+
color: var(--rf-text-muted);
|
|
182
|
+
margin: 0 0 2rem 0;
|
|
183
|
+
line-height: 1.6;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.rf-divider {
|
|
187
|
+
height: 1px;
|
|
188
|
+
background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
|
|
189
|
+
margin: 2rem 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* ── Greeting ── */
|
|
193
|
+
.rf-greeting {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: 1rem;
|
|
197
|
+
margin-bottom: 2rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.rf-avatar {
|
|
201
|
+
width: 42px;
|
|
202
|
+
height: 42px;
|
|
203
|
+
background: linear-gradient(135deg, var(--rf-vue-primary), #2C3E50);
|
|
204
|
+
border-radius: 50%;
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
color: white;
|
|
209
|
+
font-weight: 700;
|
|
210
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
211
|
+
font-size: 1.1rem;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.rf-greeting__text {
|
|
215
|
+
font-size: 0.95rem;
|
|
216
|
+
color: var(--rf-text-muted);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.rf-greeting__name {
|
|
220
|
+
color: var(--rf-vue-primary);
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ── Buttons ── */
|
|
225
|
+
.rf-actions {
|
|
226
|
+
display: grid;
|
|
227
|
+
grid-template-columns: 1.4fr 1fr;
|
|
228
|
+
gap: 1rem;
|
|
229
|
+
margin-bottom: 2rem;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.rf-btn {
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
gap: 0.5rem;
|
|
237
|
+
padding: 0.9rem 1rem;
|
|
238
|
+
border-radius: 12px;
|
|
239
|
+
font-size: 0.95rem;
|
|
240
|
+
font-weight: 600;
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
transition: all 0.25s ease;
|
|
243
|
+
border: none;
|
|
244
|
+
font-family: inherit;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.rf-btn--primary {
|
|
248
|
+
color: rgba(83, 36, 36, 0.86);
|
|
249
|
+
background: #50D495;
|
|
250
|
+
box-shadow: 0 4px 15px rgba(66, 184, 131, 0.3);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.rf-btn--primary:hover {
|
|
254
|
+
background: var(--rf-vue-primary);
|
|
255
|
+
transform: translateY(-2px);
|
|
256
|
+
box-shadow: 0 8px 25px rgba(66, 184, 131, 0.4);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.rf-btn--ghost {
|
|
260
|
+
background: rgba(15, 23, 42, 0.35);
|
|
261
|
+
color: #F8FAFC;
|
|
262
|
+
border: 1px solid rgba(248, 250, 252, 0.18);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.rf-btn--ghost:hover {
|
|
266
|
+
background: rgba(15, 23, 42, 0.55);
|
|
267
|
+
border-color: rgba(248, 250, 252, 0.3);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.rf-btn__ico {
|
|
271
|
+
width: 18px;
|
|
272
|
+
height: 18px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* ── Chips ── */
|
|
276
|
+
.rf-chips {
|
|
277
|
+
display: flex;
|
|
278
|
+
flex-wrap: wrap;
|
|
279
|
+
gap: 0.75rem;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.rf-chip {
|
|
283
|
+
font-size: 0.75rem;
|
|
284
|
+
padding: 0.4rem 0.85rem;
|
|
285
|
+
border-radius: 8px;
|
|
286
|
+
font-weight: 500;
|
|
287
|
+
letter-spacing: 0.02em;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.rf-chip--green {
|
|
291
|
+
background: rgba(66, 184, 131, 0.15);
|
|
292
|
+
color: #0f5132;
|
|
293
|
+
border: 1px solid rgba(66, 184, 131, 0.2);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.rf-chip--muted {
|
|
297
|
+
background: rgba(255, 255, 255, 0.04);
|
|
298
|
+
color: #94A3B8;
|
|
299
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.rf-chip--outline {
|
|
303
|
+
background: transparent;
|
|
304
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
305
|
+
color: #CBD5E1;
|
|
306
|
+
}
|
|
307
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Reflow } from '@reflow-js/core';
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
import Welcome from './components/Welcome.vue';
|
|
4
|
+
|
|
5
|
+
// IMPORTANT: Registering Vue as a dependency for Reflow.
|
|
6
|
+
// This allows the Reflow Core to mount Vue components within the Shadow DOM
|
|
7
|
+
// by using the same instance of Vue that is available in the MFE.
|
|
8
|
+
Reflow.setDependency('vue', Vue);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Registering the Vue component as a Reflow Web Component.
|
|
12
|
+
* Shadow DOM will be handled automatically by Reflow.
|
|
13
|
+
*/
|
|
14
|
+
Reflow.define('welcome-card', Welcome);
|
|
15
|
+
|
|
16
|
+
console.log('[Reflow-Vue] MFE Initialized');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"lib": ["ESNext", "DOM"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Node",
|
|
7
|
+
"strict": false,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"noEmit": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reflow-js/templates",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Project scaffolding templates consumed by @reflow-js/cli",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"mfe",
|
|
8
|
+
"mfe-angular",
|
|
9
|
+
"mfe-react",
|
|
10
|
+
"mfe-react-tailwind",
|
|
11
|
+
"mfe-vue",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"reflow",
|
|
17
|
+
"templates",
|
|
18
|
+
"scaffold"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
}
|
|
23
|
+
}
|