@everymatrix/my-register-wc 1.0.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/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@everymatrix/my-register-wc",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/build-register-wc.js"
9
+ },
10
+ "./styles.css": "./dist/build-register-wc.css"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "peerDependencies": {
16
+ "react": "^19.0.0",
17
+ "react-dom": "^19.0.0"
18
+ },
19
+ "devDependencies": {
20
+ "react": "^19.0.0",
21
+ "react-dom": "^19.0.0"
22
+ }
23
+ }
@@ -0,0 +1,391 @@
1
+ @import "tailwindcss";
2
+ /* @import 'tw-animate-css'; */
3
+ @source '../libs/';
4
+
5
+ @theme {
6
+ /* Extend Tailwind classes here */
7
+
8
+ /* COLORS */
9
+
10
+ --color-primary: #22b14f;
11
+ --color-primary-hover: #2dce5f;
12
+ --color-secondary: #ffffff;
13
+ --color-secondary-hover: rgba(0, 0, 0, 15%);
14
+ --color-secondary-active: rgba(0, 0, 0, 25%);
15
+ --color-tertiary: #3d3d3d;
16
+ --color-tertiary-hover: #474747;
17
+ --color-accent: rgba(34, 177, 79, 0.2);
18
+ --color-accent-hover: rgba(34, 177, 79, 0.5);
19
+ --color-txt-primary: #ffffff;
20
+ --color-txt-primary-hover: rgba(255, 255, 255, 70%);
21
+ --color-txt-secondary: rgba(255, 255, 255, 50%);
22
+ --color-txt-tertiary: #2dce5f;
23
+ --color-bg-primary: #000000;
24
+ --color-bg-secondary: #1c1c1c;
25
+ --color-bg-elements: #333333;
26
+ --color-border-elements: #3b3b3b;
27
+ --color-nav-bar: #2b2b2b;
28
+ --color-notification: #22b14f;
29
+ --color-error: #f3514b;
30
+ --color-success: #22b14f;
31
+ --color-contrast-primary: #8bcb8f;
32
+ --color-info: #ffd21e;
33
+ --color-pending: #d9a80d;
34
+ --color-rollback: #5a88d7;
35
+ --color-bg-lottery: #170b0b;
36
+ --color-bg-lottery-card: #130505;
37
+ --color-bg-lottery-dialog: #2c2525;
38
+ --custom-shadow: 4px 4px 4px 1px rgba(0, 0, 0, 0.25);
39
+
40
+ /* SPACING */
41
+ --spacing-7.5: 1.875rem;
42
+ --spacing-15: 3.75rem;
43
+ --spacing-18: 4.5rem;
44
+
45
+ /* RADIUS */
46
+ --radius-2.5: 0.625rem;
47
+
48
+ /* BREAKPOINTS */
49
+ --breakpoint-sm: 22.5rem;
50
+ --breakpoint-smd: 26rem;
51
+ --breakpoint-md: 48rem;
52
+ --breakpoint-lg: 62rem;
53
+ --breakpoint-xl: 87.5rem;
54
+ --breakpoint-2xl: 120rem;
55
+
56
+ /* SHADOW */
57
+ --custom-shadow: 4px 4px 4px 1px rgba(0, 0, 0, 0.25);
58
+
59
+ /* TEXT */
60
+ --text-xxs: 0.625rem;
61
+
62
+ /* BUTTON */
63
+ --btn-active-scale: 0.93;
64
+
65
+ @keyframes pulse {
66
+ 50% {
67
+ opacity: 0.15;
68
+ }
69
+ }
70
+
71
+ --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
72
+
73
+ --stripes-angle: 45deg;
74
+ --stripes-size: 5px;
75
+
76
+ --modal-height: min(560px, 100dvh);
77
+
78
+ /* HEIGHT */
79
+ --height-dvh-15: calc(100dvh - var(--spacing-15));
80
+ --height-dvh-30: calc(100dvh - var(--spacing-15) - var(--spacing-15));
81
+
82
+ /* ------------------- */
83
+
84
+ --animate-drawer-slide-in: drawer-slide-in 0.5s cubic-bezier(0.32, 0.72, 0, 1) both;
85
+ --animate-drawer-slide-out: drawer-slide-out 0.5s cubic-bezier(0.32, 0.72, 0, 1) both;
86
+
87
+ @keyframes drawer-slide-in {
88
+ 0% {
89
+ transform: translateY(100%);
90
+ }
91
+ 100% {
92
+ transform: translateY(0);
93
+ }
94
+ }
95
+
96
+ @keyframes drawer-slide-out {
97
+ 0% {
98
+ transform: translateY(0);
99
+ }
100
+ 100% {
101
+ transform: translateY(100%);
102
+ }
103
+ }
104
+
105
+ @keyframes fade-in {
106
+ 0% {
107
+ opacity: 0;
108
+ }
109
+ 100% {
110
+ opacity: 1;
111
+ }
112
+ }
113
+ --animate-fade-in: fade-in 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
114
+
115
+ @keyframes fade-out {
116
+ 0% {
117
+ opacity: 1;
118
+ }
119
+ 100% {
120
+ opacity: 0;
121
+ }
122
+ }
123
+ --animate-fade-out: fade-out 120ms cubic-bezier(0.4, 0, 0.2, 1) both;
124
+
125
+ --animate-slide-in-left: slide-in-left 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
126
+
127
+ @keyframes slide-in-left {
128
+ 0% {
129
+ transform: translateX(-16px);
130
+ opacity: 0;
131
+ }
132
+ 100% {
133
+ transform: translateX(0);
134
+ opacity: 1;
135
+ }
136
+ }
137
+
138
+ --animate-slide-fade-y-in: slide-fade-y-in 240ms cubic-bezier(0, 0, 0.2, 1) both;
139
+
140
+ @keyframes slide-fade-y-in {
141
+ 0% {
142
+ transform: translateY(-16px);
143
+ opacity: 0;
144
+ }
145
+ 100% {
146
+ transform: translateY(0);
147
+ opacity: 1;
148
+ }
149
+ }
150
+
151
+ --animate-slide-fade-y-out: slide-fade-y-out 160ms cubic-bezier(0, 0, 0.2, 1) both;
152
+
153
+ @keyframes slide-fade-y-out {
154
+ 0% {
155
+ transform: translateY(0);
156
+ opacity: 1;
157
+ }
158
+ 100% {
159
+ transform: translateY(-16px);
160
+ opacity: 0;
161
+ }
162
+ }
163
+
164
+ --animate-scale-in: scale-in 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
165
+
166
+ @keyframes scale-in {
167
+ 0% {
168
+ transform: scale(0.96);
169
+ opacity: 0;
170
+ }
171
+ 100% {
172
+ transform: scale(1);
173
+ opacity: 1;
174
+ }
175
+ }
176
+
177
+ --animate-scale-out: scale-out 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
178
+
179
+ @keyframes scale-out {
180
+ 0% {
181
+ transform: scale(1);
182
+ opacity: 1;
183
+ }
184
+ 100% {
185
+ transform: scale(0.96);
186
+ opacity: 0;
187
+ }
188
+ }
189
+
190
+ --animate-slide-in-right: slide-in-right 3s cubic-bezier(0, 0, 0.2, 1) both;
191
+
192
+ @keyframes slide-in-right {
193
+ 0% {
194
+ transform: translateX(16px);
195
+ opacity: 0;
196
+ }
197
+ 100% {
198
+ transform: translateX(0);
199
+ opacity: 1;
200
+ }
201
+ }
202
+ }
203
+
204
+ @layer utilities {
205
+ .absolute-center {
206
+ position: absolute;
207
+ top: '50%';
208
+ left: '50%';
209
+ transform: 'translate(-50%, -50%)';
210
+ }
211
+
212
+ .bg-stripes {
213
+ background-image: repeating-linear-gradient(
214
+ var(--stripes-angle),
215
+ var(--color-primary-hover),
216
+ var(--color-primary-hover) var(--stripes-size),
217
+ var(--color-primary) var(--stripes-size),
218
+ var(--color-primary) calc(var(--stripes-size) * 2)
219
+ );
220
+ }
221
+
222
+ .navigation-mask-fade {
223
+ -webkit-mask-size: 100% 100%;
224
+ mask-size: 100% 100%;
225
+ -webkit-mask-repeat: no-repeat;
226
+ mask-repeat: no-repeat;
227
+ }
228
+
229
+ .navigation-mask-fade {
230
+ --fade: 24px;
231
+ }
232
+
233
+ .navigation-mask-none {
234
+ -webkit-mask-image: linear-gradient(to right, var(--color-bg-elements) 0, var(--color-bg-elements) 100%);
235
+ mask-image: linear-gradient(to right, var(--color-bg-elements) 0, var(--color-bg-elements) 100%);
236
+ }
237
+
238
+ .navigation-mask-left {
239
+ -webkit-mask-image: linear-gradient(
240
+ to right,
241
+ transparent 0,
242
+ var(--color-bg-elements) var(--fade),
243
+ var(--color-bg-elements) 100%
244
+ );
245
+ mask-image: linear-gradient(
246
+ to right,
247
+ transparent 0,
248
+ var(--color-bg-elements) var(--fade),
249
+ var(--color-bg-elements) 100%
250
+ );
251
+ }
252
+
253
+ .navigation-mask-right {
254
+ -webkit-mask-image: linear-gradient(
255
+ to right,
256
+ var(--color-bg-elements) 0,
257
+ var(--color-bg-elements) calc(100% - var(--fade)),
258
+ transparent 100%
259
+ );
260
+ mask-image: linear-gradient(
261
+ to right,
262
+ var(--color-bg-elements) 0,
263
+ var(--color-bg-elements) calc(100% - var(--fade)),
264
+ transparent 100%
265
+ );
266
+ }
267
+
268
+ .navigation-mask-both {
269
+ -webkit-mask-image: linear-gradient(
270
+ to right,
271
+ transparent 0,
272
+ var(--color-bg-elements) var(--fade),
273
+ var(--color-bg-elements) calc(100% - var(--fade)),
274
+ transparent 100%
275
+ );
276
+ mask-image: linear-gradient(
277
+ to right,
278
+ transparent 0,
279
+ var(--color-bg-elements) var(--fade),
280
+ var(--color-bg-elements) calc(100% - var(--fade)),
281
+ transparent 100%
282
+ );
283
+ }
284
+
285
+ .mark-a-tags {
286
+ a {
287
+ color: var(--color-primary);
288
+ font-weight: 500;
289
+ }
290
+ }
291
+ }
292
+
293
+ :root {
294
+ --color-primary: #22b14f;
295
+ --color-primary-hover: #2dce5f;
296
+ --color-secondary: #ffffff;
297
+ --color-secondary-hover: rgba(0, 0, 0, 15%);
298
+ --color-secondary-active: rgba(0, 0, 0, 25%);
299
+ --color-tertiary: #3d3d3d;
300
+ --color-tertiary-hover: #474747;
301
+ --color-accent: rgba(34, 177, 79, 0.2);
302
+ --color-accent-hover: rgba(34, 177, 79, 0.5);
303
+ --color-txt-primary: #ffffff;
304
+ --color-txt-primary-hover: rgba(255, 255, 255, 70%);
305
+ --color-txt-secondary: rgba(255, 255, 255, 50%);
306
+ --color-txt-tertiary: #2dce5f;
307
+ --color-bg-primary: #000000;
308
+ --color-bg-secondary: #1c1c1c;
309
+ --color-bg-elements: #333333;
310
+ --color-border-elements: #3b3b3b;
311
+ --color-nav-bar: #2b2b2b;
312
+ --color-notification: #22b14f;
313
+ --color-error: #f3514b;
314
+ --color-success: #22b14f;
315
+ --color-info: #ffd21e;
316
+ --color-pending: #d9a80d;
317
+ --color-rollback: #5a88d7;
318
+ --color-bg-lottery: #170b0b;
319
+ --color-bg-lottery-card: #130505;
320
+ --color-bg-lottery-dialog: #2c2525;
321
+ --color-contrast-primary: #8bcb8f;
322
+ --custom-shadow: 4px 4px 4px 1px rgba(0, 0, 0, 0.25);
323
+ }
324
+
325
+ html {
326
+ scrollbar-gutter: stable;
327
+ }
328
+
329
+ * {
330
+ scrollbar-color: var(--color-bg-primary) var(--color-bg-elements);
331
+ scrollbar-width: thin;
332
+
333
+ &::-webkit-scrollbar {
334
+ width: 0.6rem;
335
+ height: 0.8rem;
336
+ border-radius: 0.5rem;
337
+ background-color: var(--color-bg-primary);
338
+ }
339
+
340
+ &::-webkit-scrollbar-thumb {
341
+ border-radius: 0.5rem;
342
+ background-color: var(--color-bg-elements);
343
+ }
344
+
345
+ &::-webkit-scrollbar-track {
346
+ border-radius: 0.5rem;
347
+ background-color: var(--color-bg-primary);
348
+ }
349
+ }
350
+
351
+ @media (max-width: 1024px) {
352
+ * {
353
+ -ms-overflow-style: none;
354
+ scrollbar-width: none;
355
+ }
356
+
357
+ *::-webkit-scrollbar {
358
+ display: none;
359
+ }
360
+
361
+ nav::-webkit-scrollbar {
362
+ display: unset;
363
+ }
364
+
365
+ nav {
366
+ scrollbar-width: thin;
367
+ scrollbar-color: var(--color-bg-secondary) var(--color-bg-elements);
368
+ }
369
+ }
370
+
371
+ html body[data-scroll-locked] {
372
+ margin-right: 0 !important;
373
+ }
374
+
375
+ .lottery-bg-gradient {
376
+ border: var(--lottery-hakuna-collapse-border-width, 1px) solid transparent;
377
+ border-radius: var(--lottery-hakuna-collapse-border-radius, 12px);
378
+ background-origin: border-box;
379
+ background-clip: padding-box, border-box;
380
+ background-image:
381
+ linear-gradient(var(--lottery-hakuna-collapse-bg, #120505), var(--lottery-hakuna-collapse-bg, #120505)),
382
+ linear-gradient(
383
+ to top left,
384
+ var(--lottery-hakuna-collapse-border-gradient-start, #c52217)
385
+ var(--lottery-hakuna-collapse-border-gradient-start-stop, 32%),
386
+ var(--lottery-hakuna-collapse-border-gradient-end, #2c2525)
387
+ var(--lottery-hakuna-collapse-border-gradient-end-stop, 68%)
388
+ );
389
+ overflow: hidden;
390
+ margin-bottom: var(--lottery-hakuna-collapse-margin-bottom, 10px);
391
+ }
@@ -0,0 +1,86 @@
1
+ import React, { Suspense, useMemo } from 'react';
2
+ import r2wc from '@r2wc/react-to-web-component';
3
+ import { setEnvConfig } from '../utils/src/helpers/env';
4
+
5
+ // IMPORTANT: this import is what makes esbuild emit a CSS file.
6
+ // Make sure this file contains Tailwind v4 entry (@import "tailwindcss";)
7
+ import './register-wc.css';
8
+
9
+ // If the module default-exports the component:
10
+ const LazyRegister = React.lazy(
11
+ () => import('../frameworks/src/react/features/auth/components/register/register.island')
12
+ );
13
+
14
+ function normalizeEnv(env: unknown) {
15
+ if (!env) return undefined;
16
+ if (typeof env === 'string') {
17
+ try {
18
+ return JSON.parse(env);
19
+ } catch {
20
+ return undefined;
21
+ }
22
+ }
23
+ return env;
24
+ }
25
+
26
+ function RegisterWC(props: any) {
27
+ const env = useMemo(() => normalizeEnv(props.env), [props.env]);
28
+
29
+ // Don't load/render until env exists (prevents import-time env reads)
30
+ if (!env) return null;
31
+
32
+ setEnvConfig(env);
33
+
34
+ return (
35
+ <Suspense fallback={null}>
36
+ <LazyRegister {...props} />
37
+ </Suspense>
38
+ );
39
+ }
40
+
41
+ // Give TS a shape that includes the lifecycle methods r2wc adds at runtime
42
+ type R2WCCtor = CustomElementConstructor & {
43
+ prototype: HTMLElement & {
44
+ connectedCallback?: () => void;
45
+ disconnectedCallback?: () => void;
46
+ };
47
+ };
48
+
49
+ const WebComponent = r2wc(RegisterWC, {
50
+ shadow: 'open',
51
+ props: {
52
+ env: 'json',
53
+ step: 'string',
54
+ locals: 'json',
55
+ },
56
+ events: {
57
+ onStepChange: { bubbles: true, composed: true },
58
+ },
59
+ }) as unknown as R2WCCtor;
60
+
61
+ class MyRegisterElement extends WebComponent {
62
+ connectedCallback() {
63
+ // Attach CSS to shadow root BEFORE React mounts
64
+ if (this.shadowRoot && !this.shadowRoot.querySelector('link[data-wc-style="1"]')) {
65
+ const link = document.createElement('link');
66
+ link.rel = 'stylesheet';
67
+ link.dataset.wcStyle = '1';
68
+
69
+ // This file must exist next to the emitted JS
70
+ link.href = new URL('./build-register-wc.css', import.meta.url).toString();
71
+
72
+ this.shadowRoot.prepend(link);
73
+ }
74
+
75
+ // TS-safe call into r2wc base implementation
76
+ WebComponent.prototype.connectedCallback?.call(this);
77
+ }
78
+
79
+ disconnectedCallback() {
80
+ WebComponent.prototype.disconnectedCallback?.call(this);
81
+ }
82
+ }
83
+
84
+ if (!customElements.get('my-register')) {
85
+ customElements.define('my-register', MyRegisterElement);
86
+ }