sixseconds-modules 1.6.194 → 2.0.1

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.
@@ -1 +1,2 @@
1
1
  export * from './mui';
2
+ export * from './shadowIsland';
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Renders `children` inside an open Shadow DOM so the host application's CSS
4
+ * physically cannot cross into the component — it always renders with only its
5
+ * own styling, in every app it is embedded in.
6
+ *
7
+ * Why a nested React root (instead of `createPortal`): React attaches its native
8
+ * event listeners to the root container. If we portalled into the shadow root
9
+ * from the host's (light-DOM) React root, the shadow boundary would retarget
10
+ * `event.target` to the host element and the header's clicks would never reach
11
+ * their handlers. Creating a dedicated root INSIDE the shadow root keeps React's
12
+ * listeners within the boundary, so interactivity works normally.
13
+ *
14
+ * Client-only by design: shadow roots cannot be created during SSR, and every
15
+ * real consumer already loads the header via `dynamic({ ssr: false })`.
16
+ */
17
+ export declare function ShadowIsland({ children }: {
18
+ children: ReactNode;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,449 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");
2
+
3
+ /* ==========================================================================
4
+ Style isolation — keep the header looking the same in every host app.
5
+
6
+ Two layers work together (see providers/shadowIsland.tsx):
7
+ 1. `:host` — the Shadow DOM boundary reset. Inherited properties
8
+ (font, color, line-height, letter-spacing, text-align, …) are the
9
+ only things that cross a shadow boundary, so we neutralise them once
10
+ here and re-establish our own baseline. Host author rules cannot
11
+ reach past the boundary at all.
12
+ 2. `.sixseconds-header-root` — a defensive reset for the light DOM. It
13
+ applies when this stylesheet is used outside the shadow root (e.g. a
14
+ consumer imports `sixseconds-modules/styles`, or during the brief
15
+ pre-mount window), so leaked host rules for bare tags (button, a, ul,
16
+ li, *, resets) get reverted before our styles apply.
17
+
18
+ IMPORTANT — specificity/order contract:
19
+ `.sixseconds-header-root, .sixseconds-header-root *` is specificity
20
+ (0,1,0), identical to an Emotion-generated class. This reset is declared
21
+ ABOVE all component rules, so at equal specificity our own MUI/Emotion
22
+ styles (injected/declared later) always win. Never raise this reset to
23
+ an element-qualified selector or add `!important` — that would beat the
24
+ header's own styling. `all: revert` also intentionally leaves custom
25
+ properties, `direction` and `unicode-bidi` untouched, so RTL keeps
26
+ working.
27
+ ========================================================================== */
28
+ :host {
29
+ /* `!important` is load-bearing: for NORMAL declarations the outer (document)
30
+ tree wins the shadow cascade, so a host page rule that happens to match our
31
+ host element (e.g. `div { font-family: … }`) would otherwise beat this reset
32
+ and re-leak inherited props across the boundary. `!important` makes the inner
33
+ (shadow) tree win. `all` intentionally leaves `direction`/`unicode-bidi` and
34
+ custom properties untouched, so RTL context still inherits (the header has
35
+ `[dir='rtl']` handling) — this is desired. Our isolated MUI theme does not
36
+ enable CSS variables, so no `--mui-*` host var is consumed inside the tree. */
37
+ all: initial !important;
38
+ box-sizing: border-box !important;
39
+ display: block !important;
40
+ font-family: "Inter", sans-serif !important;
41
+ color: #1a1c1e !important;
42
+ line-height: 1.5 !important;
43
+ text-align: start !important;
44
+ -webkit-font-smoothing: antialiased !important;
45
+ }
46
+
47
+ .sixseconds-header-root,
48
+ .sixseconds-header-root *,
49
+ .sixseconds-header-root *::before,
50
+ .sixseconds-header-root *::after {
51
+ all: revert;
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ .sixseconds-header-root blockquote,
56
+ .sixseconds-header-root dl,
57
+ .sixseconds-header-root dd,
58
+ .sixseconds-header-root h1,
59
+ .sixseconds-header-root h2,
60
+ .sixseconds-header-root h3,
61
+ .sixseconds-header-root h4,
62
+ .sixseconds-header-root h5,
63
+ .sixseconds-header-root h6,
64
+ .sixseconds-header-root hr,
65
+ .sixseconds-header-root figure,
66
+ .sixseconds-header-root p,
67
+ .sixseconds-header-root pre,
68
+ .sixseconds-header-root span,
69
+ .sixseconds-header-root a,
70
+ .sixseconds-header-root div,
71
+ .sixseconds-header-root li,
72
+ .sixseconds-header-root button {
73
+ font-family: "Inter", sans-serif !important;
74
+ }
75
+
76
+ .sixseconds-header-main-list-menu {
77
+ display: flex;
78
+ }
79
+
80
+ .sixseconds-header-main-list-menu li {
81
+ padding: 0.5rem 0.5rem;
82
+ }
83
+
84
+ .sixseconds-header-main-list-menu li a {
85
+ padding: 0 0.25rem;
86
+ font-weight: 500;
87
+ font-size: 12px;
88
+ }
89
+
90
+ .sixseconds-header-main-list-menu .sixseconds-header-menu-item {
91
+ position: relative;
92
+ padding: 0 16px;
93
+ display: flex;
94
+ align-items: center;
95
+ height: 100%;
96
+ }
97
+
98
+ .sixseconds-header-main-list-menu .sixseconds-header-menu-link {
99
+ text-decoration: none;
100
+ color: #2a2a2a;
101
+ /* Closer to 6seconds */
102
+ font-weight: 500;
103
+ font-size: 15px;
104
+ padding: 8px 4px;
105
+ transition: color 0.2s ease;
106
+ font-family: "Inter", sans-serif;
107
+ display: flex;
108
+ align-items: center;
109
+ gap: 4px;
110
+ }
111
+
112
+ .sixseconds-header-main-list-menu .sixseconds-header-menu-link:hover {
113
+ color: #0073b1;
114
+ }
115
+
116
+ /* Submenu (Dropdown) */
117
+ .sixseconds-header-main-list-menu .sixseconds-header-submenu-data {
118
+ position: absolute;
119
+ top: 150%;
120
+ left: 0;
121
+ background: white;
122
+ border: 1px solid #e2e8f0;
123
+ border-top: 3px solid #0073b1;
124
+ box-shadow:
125
+ 0px 12px 48px rgba(0, 0, 0, 0.12),
126
+ 0 4px 16px rgba(0, 0, 0, 0.08);
127
+ /* Even more premium shadow */
128
+ display: block;
129
+ opacity: 0;
130
+ visibility: hidden;
131
+ transform: translateY(12px);
132
+ width: 200px;
133
+ z-index: 1000;
134
+ border-radius: 4px;
135
+ /* More angular per 6seconds style */
136
+ padding: 8px 0;
137
+ transition:
138
+ opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
139
+ transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
140
+ visibility 0.25s;
141
+ }
142
+
143
+ .sixseconds-header-main-list-menu .sixseconds-header-submenu-data li {
144
+ list-style: none;
145
+ padding: 0;
146
+ }
147
+
148
+ .sixseconds-header-main-list-menu .sixseconds-header-submenu-link {
149
+ display: block;
150
+ padding: 12px 28px;
151
+ text-decoration: none;
152
+ color: #2a2a2a;
153
+ /* Darker grey */
154
+ font-weight: 400;
155
+ font-size: 14.5px;
156
+ line-height: 1.4;
157
+ white-space: normal;
158
+ transition: all 0.2s ease;
159
+ }
160
+
161
+ .sixseconds-header-main-list-menu .sixseconds-header-submenu-link:hover {
162
+ background: #f0f7fb;
163
+ color: #0073b1;
164
+ padding-left: 32px;
165
+ /* Slight nudge */
166
+ }
167
+
168
+ /* Caret rotation on hover */
169
+ .sixseconds-header-main-list-menu .sixseconds-header-menu-item:hover .sixseconds-header-desktop-caret {
170
+ transform: rotate(180deg);
171
+ }
172
+
173
+ /* Show dropdown on hover */
174
+ .sixseconds-header-main-list-menu .sixseconds-header-menu-item:hover .sixseconds-header-submenu-data {
175
+ opacity: 1;
176
+ visibility: visible;
177
+ transform: translateY(0);
178
+ }
179
+
180
+ .sixseconds-header-small-device-menu {
181
+ display: none;
182
+ width: 100%;
183
+ left: 0;
184
+ top: 64px;
185
+ background-color: #fff;
186
+ position: fixed;
187
+ overflow-y: auto;
188
+ height: 95vh;
189
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
190
+ }
191
+
192
+ .sixseconds-header-small-device-menu a.sixseconds-header-bg-main-menu {
193
+ display: block;
194
+ text-decoration: none;
195
+ }
196
+
197
+ .sixseconds-header-submenu-child li {
198
+ padding: 0.5rem 0;
199
+ }
200
+
201
+ .sixseconds-header-submenu-child li a {
202
+ text-decoration: none;
203
+ }
204
+
205
+ .sixseconds-header-layout-mobile-menu {
206
+ padding-bottom: 12px;
207
+ padding-inline: 0;
208
+ height: 95vh;
209
+ overflow-y: auto;
210
+ padding-top: 8px;
211
+ }
212
+
213
+ .sixseconds-header-small-device-menu a {
214
+ background-color: transparent;
215
+ font-size: 16px;
216
+ /* Slightly larger */
217
+ font-weight: 600;
218
+ /* Bolder for parent items */
219
+ color: #1a1c1e;
220
+ margin-bottom: 4px;
221
+ padding: 16px 20px;
222
+ border-bottom: 1px solid #f1f3f4;
223
+ display: flex;
224
+ align-items: center;
225
+ justify-content: space-between;
226
+ }
227
+
228
+ .sixseconds-header-small-device-menu .sixseconds-header-submenu-child {
229
+ padding-left: 0px;
230
+ min-width: 100%;
231
+ max-width: 100%;
232
+ margin-top: 0;
233
+ background-color: #fbfbfc;
234
+ /* Slightly different background for sub-items */
235
+ color: #1a1c1e;
236
+ }
237
+
238
+ .sixseconds-header-small-device-menu ul li .sixseconds-header-submenu-child-link {
239
+ padding: 12px 32px;
240
+ /* Indent more */
241
+ font-weight: 400;
242
+ /* Regular weight for sub-links */
243
+ font-size: 14px;
244
+ }
245
+
246
+ .sixseconds-header-small-device-menu ul li a {
247
+ background-color: transparent;
248
+ color: #4a4d50;
249
+ }
250
+
251
+ .sixseconds-header-small-device-menu ul {
252
+ padding-left: 15px;
253
+ }
254
+
255
+ .sixseconds-header-desktop-menu {
256
+ display: flex;
257
+ }
258
+
259
+ .sixseconds-header-button-hamburger {
260
+ display: none;
261
+ position: absolute;
262
+ right: 20px;
263
+ top: 18px;
264
+ z-index: 9;
265
+ }
266
+
267
+ .sixseconds-header-root .tox-editor-header {
268
+ background-color: transparent;
269
+ }
270
+
271
+ .sixseconds-header-hamburger-icon-btn {
272
+ padding: 8px;
273
+ color: #5f6368;
274
+ }
275
+
276
+ .sixseconds-header-desktop-menu .sixseconds-header-menu-item .sixseconds-header-menu-link {
277
+ font-size: 14px;
278
+ font-weight: 500;
279
+ }
280
+
281
+ .sixseconds-header-small-device-menu {
282
+ padding-inline: 20px;
283
+ }
284
+
285
+ @media screen and (max-width: 600px) and (min-width: 320px) {
286
+ .sixseconds-header-notification-icon-error .MuiBadge-badge {
287
+ font-size: 10px;
288
+ padding: 0 4px;
289
+ min-width: 16px;
290
+ right: 5px;
291
+ background-color: #d32f2f;
292
+ }
293
+
294
+ .sixseconds-header-submenu nav {
295
+ padding: 0 !important;
296
+ }
297
+
298
+ .sixseconds-header-root .MuiPagination-root.MuiPagination-outlined {
299
+ display: flex;
300
+ justify-content: center;
301
+ margin-left: 0;
302
+ }
303
+
304
+ .sixseconds-header-toggle-btn-menu {
305
+ position: absolute;
306
+ right: 20px;
307
+ top: 12px;
308
+ z-index: 99;
309
+ }
310
+
311
+ .sixseconds-header-right-icons {
312
+ padding-right: 25px;
313
+ }
314
+
315
+ .sixseconds-header-button-hamburger {
316
+ display: block;
317
+ }
318
+
319
+ .sixseconds-header-desktop-menu {
320
+ display: none;
321
+ }
322
+
323
+ .sixseconds-header-small-device-menu {
324
+ display: block;
325
+ width: 100%;
326
+ position: fixed;
327
+ left: 0;
328
+ background: #fff;
329
+ top: 64px;
330
+ }
331
+
332
+ .main.sixseconds-header-login-page .sixseconds-header-login-body {
333
+ width: 90% !important;
334
+ }
335
+
336
+ .sixseconds-header-submenu {
337
+ width: 100%;
338
+ max-width: 100% !important;
339
+ }
340
+
341
+ .sixseconds-header-sidebar {
342
+ width: 280px !important;
343
+ background-color: #f9fafb;
344
+ z-index: 99;
345
+ border-right: 1px solid #e0e0e0;
346
+ }
347
+
348
+ .sixseconds-header-sidemenu {
349
+ width: 280px;
350
+ background-color: #f9fafb;
351
+ }
352
+
353
+ .sixseconds-header-logo {
354
+ opacity: 1;
355
+ }
356
+
357
+ .sixseconds-header-profile .sixseconds-header-menu {
358
+ min-width: 280px;
359
+ width: 100% !important;
360
+ }
361
+ }
362
+
363
+ @media screen and (max-width: 1024px) and (min-width: 600px) {
364
+ .sixseconds-header-toggle-btn-menu {
365
+ position: absolute;
366
+ right: 20px;
367
+ top: 12px;
368
+ }
369
+
370
+ .sixseconds-header-right-icons {
371
+ padding-right: 25px;
372
+ }
373
+
374
+ .sixseconds-header-button-hamburger {
375
+ display: block;
376
+ }
377
+
378
+ .sixseconds-header-desktop-menu {
379
+ display: none;
380
+ }
381
+
382
+ .sixseconds-header-small-device-menu {
383
+ display: block;
384
+ }
385
+
386
+ .main.sixseconds-header-login-page .sixseconds-header-login-body {
387
+ width: 450px !important;
388
+ }
389
+
390
+ .sixseconds-header-banner {
391
+ margin-left: 0 !important;
392
+ }
393
+
394
+ .sixseconds-header-submenu {
395
+ width: 100%;
396
+ max-width: 100% !important;
397
+ }
398
+
399
+ .sixseconds-header-sidebar {
400
+ width: 280px !important;
401
+ background-color: #f9fafb;
402
+ z-index: 99;
403
+ }
404
+
405
+ .sixseconds-header-sidemenu {
406
+ width: 280px;
407
+ background-color: #f9fafb;
408
+ }
409
+
410
+ .sixseconds-header-logo {
411
+ opacity: 1;
412
+ }
413
+
414
+ .sixseconds-header-profile .sixseconds-header-menu {
415
+ min-width: 280px;
416
+ width: 100% !important;
417
+ }
418
+ }
419
+
420
+ @media screen and (max-width: 1380px) and (min-width: 1024px) {
421
+ .sixseconds-header-right-icons {
422
+ padding-right: 25px;
423
+ }
424
+
425
+ .sixseconds-header-button-hamburger {
426
+ display: block;
427
+ }
428
+
429
+ .sixseconds-header-desktop-menu {
430
+ display: none;
431
+ }
432
+
433
+ .sixseconds-header-small-device-menu {
434
+ display: block;
435
+ width: 100%;
436
+ position: fixed;
437
+ left: 0;
438
+ background: #fff;
439
+ top: 64px;
440
+ }
441
+
442
+ .sixseconds-header-button-hamburger {
443
+ display: block;
444
+ }
445
+
446
+ .sixseconds-header-right-icons {
447
+ padding-right: 25px;
448
+ }
449
+ }
@@ -1,2 +1,9 @@
1
1
  /// <reference types="vite/client" />
2
2
  /// <reference types="vite-plugin-svgr/client" />
3
+
4
+ // Explicit (more specific than vite/client's `*?inline`) so importing the
5
+ // stylesheet as a string is typed regardless of resolution order.
6
+ declare module "*.css?inline" {
7
+ const css: string
8
+ export default css
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sixseconds-modules",
3
- "version": "1.6.194",
3
+ "version": "2.0.1",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",