kozenet_ui 0.1.4 → 0.1.6

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +79 -16
  4. data/app/assets/fonts/kozenet_ui/inter-latin.woff2 +0 -0
  5. data/app/assets/fonts/kozenet_ui/jetbrains-mono-latin.woff2 +0 -0
  6. data/app/assets/fonts/kozenet_ui/source-serif-4-latin.woff2 +0 -0
  7. data/app/assets/javascripts/kozenet_ui/index.js +226 -17
  8. data/app/assets/stylesheets/kozenet_ui/base.css +5 -0
  9. data/app/assets/stylesheets/kozenet_ui/components/avatar.css +4 -1
  10. data/app/assets/stylesheets/kozenet_ui/components/badge.css +11 -1
  11. data/app/assets/stylesheets/kozenet_ui/components/button.css +21 -1
  12. data/app/assets/stylesheets/kozenet_ui/components/header.css +227 -38
  13. data/app/assets/stylesheets/kozenet_ui/components/utilities.css +52 -1
  14. data/app/assets/stylesheets/kozenet_ui/fonts.css +37 -0
  15. data/app/assets/stylesheets/kozenet_ui/tokens.css +150 -53
  16. data/app/components/kozenet_ui/base_component.rb +21 -1
  17. data/app/components/kozenet_ui/header_component/action_button_component.html.erb +4 -2
  18. data/app/components/kozenet_ui/header_component/action_button_component.rb +78 -4
  19. data/app/components/kozenet_ui/header_component/nav_item_component.html.erb +1 -1
  20. data/app/components/kozenet_ui/header_component/nav_item_component.rb +6 -0
  21. data/app/components/kozenet_ui/header_component/user_menu_component.html.erb +5 -7
  22. data/app/components/kozenet_ui/header_component.html.erb +39 -30
  23. data/app/components/kozenet_ui/header_component.rb +26 -4
  24. data/app/helpers/kozenet_ui/component_helper.rb +82 -8
  25. data/app/helpers/kozenet_ui/icon_helper.rb +11 -7
  26. data/docs/README.md +25 -0
  27. data/docs/components/README.md +44 -0
  28. data/docs/components/avatar.md +73 -0
  29. data/docs/components/badge.md +74 -0
  30. data/docs/components/button.md +95 -0
  31. data/docs/components/header.md +199 -0
  32. data/docs/foundations/README.md +14 -0
  33. data/docs/foundations/fonts.md +136 -0
  34. data/lib/generators/kozenet_ui/install/install_generator.rb +94 -8
  35. data/lib/generators/kozenet_ui/install/templates/kozenet_ui.rb +3 -0
  36. data/lib/kozenet_ui/configuration.rb +35 -0
  37. data/lib/kozenet_ui/engine.rb +89 -14
  38. data/lib/kozenet_ui/theme/palette.rb +21 -7
  39. data/lib/kozenet_ui/theme/variants.rb +1 -0
  40. data/lib/kozenet_ui/version.rb +1 -1
  41. data/lib/kozenet_ui.rb +2 -0
  42. metadata +34 -13
  43. data/app/assets/images/kozenet_ui/icons/cart.svg +0 -1
  44. data/app/assets/images/kozenet_ui/icons/heart.svg +0 -1
@@ -14,16 +14,16 @@
14
14
  .kz-header.kz-header-blur {
15
15
  backdrop-filter: blur(28px) saturate(1.4);
16
16
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
17
- background: linear-gradient(135deg,
18
- rgba(245, 247, 250, 0.88),
17
+ background: linear-gradient(135deg,
18
+ rgba(245, 247, 250, 0.88),
19
19
  rgba(240, 243, 247, 0.82)
20
20
  );
21
21
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
22
22
  }
23
23
 
24
24
  .dark .kz-header.kz-header-blur {
25
- background: linear-gradient(135deg,
26
- rgba(15, 18, 24, 0.85),
25
+ background: linear-gradient(135deg,
26
+ rgba(15, 18, 24, 0.85),
27
27
  rgba(20, 24, 30, 0.82)
28
28
  );
29
29
  border-color: rgba(255, 255, 255, 0.06);
@@ -36,6 +36,8 @@
36
36
  margin-right: auto;
37
37
  padding-left: 1rem;
38
38
  padding-right: 1rem;
39
+ padding-top: 0.5rem;
40
+ padding-bottom: 0.5rem;
39
41
  height: 78px;
40
42
  display: grid;
41
43
  grid-template-columns: auto 1fr auto;
@@ -53,9 +55,18 @@
53
55
 
54
56
  /* Left section (brand + nav) */
55
57
  .kz-header-start {
58
+ grid-column: 1;
56
59
  display: flex;
57
60
  align-items: center;
58
61
  gap: 1rem;
62
+ min-width: 0;
63
+ }
64
+
65
+ .kz-header-start-actions {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 0.5rem;
69
+ flex: 0 0 auto;
59
70
  }
60
71
 
61
72
  /* Brand */
@@ -63,6 +74,8 @@
63
74
  display: flex;
64
75
  align-items: center;
65
76
  gap: 0.625rem;
77
+ min-width: 0;
78
+ max-width: 100%;
66
79
  font-weight: 600;
67
80
  font-size: 1.125rem;
68
81
  text-decoration: none;
@@ -74,13 +87,15 @@
74
87
  .kz-brand img {
75
88
  height: 44px;
76
89
  width: auto;
90
+ max-width: min(220px, 48vw);
91
+ object-fit: contain;
77
92
  display: block;
78
93
  }
79
94
 
80
95
  .kz-brand .accent {
81
- background: linear-gradient(110deg,
82
- rgb(var(--kz-primary-500) / 1),
83
- rgb(var(--kz-accent-500) / 1) 55%,
96
+ background: linear-gradient(110deg,
97
+ rgb(var(--kz-primary-500) / 1),
98
+ rgb(var(--kz-accent-500) / 1) 55%,
84
99
  rgb(var(--kz-accent-400) / 1)
85
100
  );
86
101
  -webkit-background-clip: text;
@@ -129,8 +144,10 @@
129
144
 
130
145
  /* Search */
131
146
  .kz-search-col {
147
+ grid-column: 2;
132
148
  display: none;
133
149
  display: block;
150
+ min-width: 0;
134
151
  }
135
152
 
136
153
  .kz-search-wrap {
@@ -139,8 +156,8 @@
139
156
  align-items: center;
140
157
  height: 48px;
141
158
  border-radius: 18px;
142
- background: linear-gradient(135deg,
143
- rgba(255, 255, 255, 0.75),
159
+ background: linear-gradient(135deg,
160
+ rgba(255, 255, 255, 0.75),
144
161
  rgba(255, 255, 255, 0.55)
145
162
  );
146
163
  border: 1px solid rgba(0, 0, 0, 0.06);
@@ -149,8 +166,8 @@
149
166
  }
150
167
 
151
168
  .dark .kz-search-wrap {
152
- background: linear-gradient(135deg,
153
- rgba(255, 255, 255, 0.1),
169
+ background: linear-gradient(135deg,
170
+ rgba(255, 255, 255, 0.1),
154
171
  rgba(255, 255, 255, 0.06)
155
172
  );
156
173
  border-color: rgba(255, 255, 255, 0.08);
@@ -182,6 +199,8 @@
182
199
 
183
200
  /* Actions */
184
201
  .kz-header-actions {
202
+ grid-column: 3;
203
+ justify-self: end;
185
204
  display: flex;
186
205
  align-items: center;
187
206
  gap: 0.5rem;
@@ -194,8 +213,8 @@
194
213
  width: 46px;
195
214
  height: 46px;
196
215
  border-radius: var(--kz-radius-md);
197
- background: linear-gradient(135deg,
198
- rgba(255, 255, 255, 0.65),
216
+ background: linear-gradient(135deg,
217
+ rgba(255, 255, 255, 0.65),
199
218
  rgba(255, 255, 255, 0.5)
200
219
  );
201
220
  border: 1px solid rgba(0, 0, 0, 0.05);
@@ -203,26 +222,78 @@
203
222
  transition: var(--kz-transition-base);
204
223
  }
205
224
 
225
+ .kz-action-btn-with-text {
226
+ width: auto;
227
+ min-width: 46px;
228
+ gap: 0.45rem;
229
+ padding-left: 0.85rem;
230
+ padding-right: 0.95rem;
231
+ font-size: 0.78rem;
232
+ font-weight: var(--kz-font-weight-semibold);
233
+ text-decoration: none;
234
+ white-space: nowrap;
235
+ }
236
+
237
+ .kz-action-visible-mobile {
238
+ display: none;
239
+ }
240
+
206
241
  .kz-action-btn:hover {
207
- background: linear-gradient(135deg,
208
- rgba(255, 255, 255, 0.9),
242
+ background: linear-gradient(135deg,
243
+ rgba(255, 255, 255, 0.9),
209
244
  rgba(255, 255, 255, 0.75)
210
245
  );
211
246
  color: var(--kz-text-default);
212
247
  transform: translateY(-2px);
213
248
  }
214
249
 
250
+ .kz-action-btn-icon {
251
+ display: inline-flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ width: 1.25rem;
255
+ height: 1.25rem;
256
+ line-height: 0;
257
+ flex: 0 0 auto;
258
+ }
259
+
260
+ .kz-action-btn-svg {
261
+ display: block;
262
+ width: 1.25rem;
263
+ height: 1.25rem;
264
+ overflow: visible;
265
+ }
266
+
267
+ .kz-action-btn-label {
268
+ position: absolute;
269
+ width: 1px;
270
+ height: 1px;
271
+ overflow: hidden;
272
+ clip: rect(0, 0, 0, 0);
273
+ white-space: nowrap;
274
+ }
275
+
276
+ .kz-action-btn-text {
277
+ display: inline-flex;
278
+ align-items: center;
279
+ line-height: 1;
280
+ }
281
+
282
+ .kz-header .md\:hidden {
283
+ display: none;
284
+ }
285
+
215
286
  .dark .kz-action-btn {
216
- background: linear-gradient(135deg,
217
- rgba(255, 255, 255, 0.12),
287
+ background: linear-gradient(135deg,
288
+ rgba(255, 255, 255, 0.12),
218
289
  rgba(255, 255, 255, 0.08)
219
290
  );
220
291
  border-color: rgba(255, 255, 255, 0.1);
221
292
  }
222
293
 
223
294
  .dark .kz-action-btn:hover {
224
- background: linear-gradient(135deg,
225
- rgba(255, 255, 255, 0.18),
295
+ background: linear-gradient(135deg,
296
+ rgba(255, 255, 255, 0.18),
226
297
  rgba(255, 255, 255, 0.12)
227
298
  );
228
299
  }
@@ -254,8 +325,8 @@
254
325
  height: 46px;
255
326
  border-radius: var(--kz-radius-md);
256
327
  overflow: hidden;
257
- background: linear-gradient(135deg,
258
- rgba(255, 255, 255, 0.65),
328
+ background: linear-gradient(135deg,
329
+ rgba(255, 255, 255, 0.65),
259
330
  rgba(255, 255, 255, 0.5)
260
331
  );
261
332
  border: 1px solid rgba(0, 0, 0, 0.05);
@@ -265,9 +336,32 @@
265
336
  justify-content: center;
266
337
  }
267
338
 
339
+ .kz-avatar-btn img {
340
+ width: 2rem;
341
+ height: 2rem;
342
+ border-radius: 999px;
343
+ object-fit: cover;
344
+ }
345
+
346
+ .kz-user-menu {
347
+ position: relative;
348
+ }
349
+
350
+ .kz-user-initial {
351
+ width: 2rem;
352
+ height: 2rem;
353
+ border-radius: 999px;
354
+ display: inline-flex;
355
+ align-items: center;
356
+ justify-content: center;
357
+ font-weight: var(--kz-font-weight-bold);
358
+ background: var(--kz-cta-gradient);
359
+ color: var(--kz-cta-text);
360
+ }
361
+
268
362
  .dark .kz-avatar-btn {
269
- background: linear-gradient(135deg,
270
- rgba(255, 255, 255, 0.12),
363
+ background: linear-gradient(135deg,
364
+ rgba(255, 255, 255, 0.12),
271
365
  rgba(255, 255, 255, 0.08)
272
366
  );
273
367
  border-color: rgba(255, 255, 255, 0.1);
@@ -285,8 +379,8 @@
285
379
  right: 0;
286
380
  top: 78px;
287
381
  padding: 1rem 1rem 1.25rem;
288
- background: linear-gradient(135deg,
289
- rgba(245, 247, 250, 0.95),
382
+ background: linear-gradient(135deg,
383
+ rgba(245, 247, 250, 0.95),
290
384
  rgba(240, 243, 247, 0.9)
291
385
  );
292
386
  backdrop-filter: blur(26px) saturate(1.4);
@@ -301,8 +395,8 @@
301
395
  }
302
396
 
303
397
  .dark .kz-mobile-panel {
304
- background: linear-gradient(135deg,
305
- rgba(15, 18, 24, 0.95),
398
+ background: linear-gradient(135deg,
399
+ rgba(15, 18, 24, 0.95),
306
400
  rgba(20, 24, 30, 0.9)
307
401
  );
308
402
  border-color: rgba(255, 255, 255, 0.06);
@@ -317,8 +411,8 @@
317
411
  min-width: 220px;
318
412
  padding: 0.55rem 0.55rem 0.7rem;
319
413
  border-radius: 18px;
320
- background: linear-gradient(135deg,
321
- rgba(255, 255, 255, 0.9),
414
+ background: linear-gradient(135deg,
415
+ rgba(255, 255, 255, 0.9),
322
416
  rgba(255, 255, 255, 0.75)
323
417
  );
324
418
  backdrop-filter: blur(26px) saturate(1.4);
@@ -327,9 +421,13 @@
327
421
  animation: fadeIn 0.28s ease;
328
422
  }
329
423
 
424
+ .kz-user-dropdown.hidden {
425
+ display: none;
426
+ }
427
+
330
428
  .dark .kz-user-dropdown {
331
- background: linear-gradient(135deg,
332
- rgba(20, 24, 30, 0.92),
429
+ background: linear-gradient(135deg,
430
+ rgba(20, 24, 30, 0.92),
333
431
  rgba(18, 22, 28, 0.88)
334
432
  );
335
433
  border-color: rgba(255, 255, 255, 0.08);
@@ -351,15 +449,59 @@
351
449
  .kz-nav-links {
352
450
  display: none;
353
451
  }
354
-
452
+
355
453
  .kz-search-col {
356
454
  display: none;
357
455
  }
456
+
457
+ .kz-action-visible-desktop {
458
+ display: none;
459
+ }
460
+
461
+ .kz-action-visible-mobile {
462
+ display: inline-flex;
463
+ }
464
+
465
+ .kz-mobile-trigger {
466
+ display: inline-flex;
467
+ align-items: center;
468
+ justify-content: center;
469
+ width: 46px;
470
+ height: 46px;
471
+ border-radius: var(--kz-radius-md);
472
+ background: color-mix(in srgb, var(--kz-bg-elevated) 78%, transparent);
473
+ border: 1px solid var(--kz-border-default);
474
+ color: var(--kz-text-default);
475
+ }
476
+
477
+ .kz-header .md\:hidden {
478
+ display: inline-flex;
479
+ }
358
480
  }
359
481
 
360
482
  @media (max-width: 640px) {
361
483
  .kz-header-bar {
362
484
  grid-template-columns: 1fr auto;
485
+ gap: 0.75rem;
486
+ }
487
+
488
+ .kz-header-start {
489
+ grid-column: 1;
490
+ gap: 0.65rem;
491
+ }
492
+
493
+ .kz-header-actions {
494
+ grid-column: 2;
495
+ }
496
+
497
+ .kz-brand {
498
+ padding-left: 0.25rem;
499
+ padding-right: 0.25rem;
500
+ }
501
+
502
+ .kz-brand img {
503
+ height: 40px;
504
+ max-width: min(180px, 46vw);
363
505
  }
364
506
  }
365
507
 
@@ -369,21 +511,68 @@
369
511
  .kz-cta:hover {
370
512
  transform: none;
371
513
  }
372
-
514
+
373
515
  .kz-mobile-panel {
374
516
  transition: none;
375
517
  }
376
518
  }
377
519
 
378
520
  @media (prefers-color-scheme: dark) {
379
- :root {
380
- color-scheme: dark;
381
- --kz-cta-gradient: var(--kz-cta-gradient-dark);
382
- --kz-cta-text: var(--kz-cta-text-dark);
521
+ :root:not([data-theme="light"]):not(.light) .kz-header.kz-header-blur {
522
+ background: linear-gradient(135deg,
523
+ rgba(15, 18, 24, 0.85),
524
+ rgba(20, 24, 30, 0.82)
525
+ );
526
+ border-color: rgba(255, 255, 255, 0.06);
527
+ }
528
+
529
+ :root:not([data-theme="light"]):not(.light) .kz-nav-link:hover {
530
+ background: rgba(255, 255, 255, 0.08);
531
+ }
532
+
533
+ :root:not([data-theme="light"]):not(.light) .kz-search-wrap {
534
+ background: linear-gradient(135deg,
535
+ rgba(255, 255, 255, 0.1),
536
+ rgba(255, 255, 255, 0.06)
537
+ );
538
+ border-color: rgba(255, 255, 255, 0.08);
539
+ }
540
+
541
+ :root:not([data-theme="light"]):not(.light) .kz-action-btn,
542
+ :root:not([data-theme="light"]):not(.light) .kz-avatar-btn {
543
+ background: linear-gradient(135deg,
544
+ rgba(255, 255, 255, 0.12),
545
+ rgba(255, 255, 255, 0.08)
546
+ );
547
+ border-color: rgba(255, 255, 255, 0.1);
548
+ }
549
+
550
+ :root:not([data-theme="light"]):not(.light) .kz-action-btn:hover {
551
+ background: linear-gradient(135deg,
552
+ rgba(255, 255, 255, 0.18),
553
+ rgba(255, 255, 255, 0.12)
554
+ );
555
+ }
556
+
557
+ :root:not([data-theme="light"]):not(.light) .kz-mobile-panel {
558
+ background: linear-gradient(135deg,
559
+ rgba(15, 18, 24, 0.95),
560
+ rgba(20, 24, 30, 0.9)
561
+ );
562
+ border-color: rgba(255, 255, 255, 0.06);
563
+ box-shadow: 0 24px 60px -26px rgba(0, 0, 0, 0.8);
564
+ }
565
+
566
+ :root:not([data-theme="light"]):not(.light) .kz-user-dropdown {
567
+ background: linear-gradient(135deg,
568
+ rgba(20, 24, 30, 0.92),
569
+ rgba(18, 22, 28, 0.88)
570
+ );
571
+ border-color: rgba(255, 255, 255, 0.08);
383
572
  }
384
573
  }
385
574
  }
386
575
 
387
576
  header {
388
577
  background: none;
389
- }
578
+ }
@@ -1,4 +1,48 @@
1
1
  @layer components {
2
+ .hidden {
3
+ display: none !important;
4
+ }
5
+
6
+ .block {
7
+ display: block !important;
8
+ }
9
+
10
+ .inline-flex {
11
+ display: inline-flex;
12
+ }
13
+
14
+ .flex {
15
+ display: flex;
16
+ }
17
+
18
+ .items-center {
19
+ align-items: center;
20
+ }
21
+
22
+ .justify-center {
23
+ justify-content: center;
24
+ }
25
+
26
+ .gap-1 {
27
+ gap: 0.25rem;
28
+ }
29
+
30
+ .gap-2 {
31
+ gap: 0.5rem;
32
+ }
33
+
34
+ .origin-top {
35
+ transform-origin: top center;
36
+ }
37
+
38
+ .scale-y-0 {
39
+ transform: scaleY(0);
40
+ }
41
+
42
+ .scale-y-100 {
43
+ transform: scaleY(1);
44
+ }
45
+
2
46
  /* Layout utilities */
3
47
  .container-fluid {
4
48
  width: 100%;
@@ -196,6 +240,13 @@
196
240
  border-color: rgba(255, 255, 255, 0.1);
197
241
  }
198
242
 
243
+ @media (prefers-color-scheme: dark) {
244
+ :root:not([data-theme="light"]):not(.light) .glass-panel {
245
+ background: rgba(0, 0, 0, 0.2);
246
+ border-color: rgba(255, 255, 255, 0.1);
247
+ }
248
+ }
249
+
199
250
  /* Play surface (gradient background) */
200
251
  .play-surface {
201
252
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
@@ -267,4 +318,4 @@
267
318
 
268
319
  [data-theme='system'] .theme-icon-system {
269
320
  display: inline-flex;
270
- }
321
+ }
@@ -0,0 +1,37 @@
1
+ /* Kozenet UI Web Fonts */
2
+
3
+ @font-face {
4
+ font-family: "Inter";
5
+ src: url("inter-latin.woff2") format("woff2");
6
+ font-style: normal;
7
+ font-weight: 100 900;
8
+ font-display: swap;
9
+ }
10
+
11
+ @font-face {
12
+ font-family: "Source Serif 4";
13
+ src: url("source-serif-4-latin.woff2") format("woff2");
14
+ font-style: normal;
15
+ font-weight: 200 900;
16
+ font-display: swap;
17
+ }
18
+
19
+ @font-face {
20
+ font-family: "JetBrains Mono";
21
+ src: url("jetbrains-mono-latin.woff2") format("woff2");
22
+ font-style: normal;
23
+ font-weight: 100 800;
24
+ font-display: swap;
25
+ }
26
+
27
+ @layer base {
28
+ :root {
29
+ --kz-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
30
+ --kz-font-serif: "Source Serif 4", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
31
+ --kz-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
32
+
33
+ --font-sans: var(--kz-font-sans);
34
+ --font-serif: var(--kz-font-serif);
35
+ --font-mono: var(--kz-font-mono);
36
+ }
37
+ }