@kywi-software/core 0.6.1 → 0.6.2

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.
@@ -382,3 +382,194 @@
382
382
  outline-offset: 3px;
383
383
  }
384
384
  [data-kywi-editing] [data-kywi-editable] { position: relative; cursor: text; }
385
+
386
+ /* ── Personalization UI ──────────────────────────────────────────────────────
387
+ * Default scaffolding for the client runtime's own surfaces (@kywi-software/js):
388
+ * the self-ID widget, the transparency bar, the personalization badge, and the
389
+ * variant-container loading state. Same contract as the rest of this file —
390
+ * neutral, token-driven, respectable out of the box, restyled by overriding
391
+ * `--kywi-*` tokens rather than rewriting rules. A theme that wants a bespoke
392
+ * widget can override any of these; nothing here is `!important`. */
393
+
394
+ /* Self-ID widget — shared card. Three display modes (inline / modal / slide-in)
395
+ * position the same card differently. `hello_bar_*` and `drawer` configs map to
396
+ * slide-in in the scaffold runtime. */
397
+ .kywi-selfid-widget {
398
+ box-sizing: border-box;
399
+ width: 100%;
400
+ max-width: 24rem;
401
+ padding: var(--kywi-spacing-lg, 1.5rem);
402
+ background: var(--kywi-color-surface, #f8fafc);
403
+ color: var(--kywi-color-text, #0f172a);
404
+ border: 1px solid var(--kywi-color-border, #e2e8f0);
405
+ border-radius: var(--kywi-border-radius-lg, 16px);
406
+ box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
407
+ font-family: var(--kywi-font-family-base, system-ui, sans-serif);
408
+ }
409
+ .kywi-selfid-inline { margin: var(--kywi-spacing-lg, 1.5rem) auto; }
410
+ .kywi-selfid-slide-in {
411
+ position: fixed;
412
+ right: var(--kywi-spacing-lg, 1.5rem);
413
+ bottom: var(--kywi-spacing-lg, 1.5rem);
414
+ z-index: 60;
415
+ animation: kywi-selfid-in 240ms ease-out both;
416
+ }
417
+ .kywi-selfid-modal {
418
+ position: fixed;
419
+ top: 50%;
420
+ left: 50%;
421
+ transform: translate(-50%, -50%);
422
+ z-index: 60;
423
+ animation: kywi-selfid-in 200ms ease-out both;
424
+ }
425
+ .kywi-selfid-modal::before {
426
+ content: "";
427
+ position: fixed;
428
+ inset: 0;
429
+ z-index: -1;
430
+ background: rgba(15, 23, 42, 0.45);
431
+ }
432
+ @keyframes kywi-selfid-in {
433
+ from { opacity: 0; transform: translateY(8px); }
434
+ to { opacity: 1; transform: translateY(0); }
435
+ }
436
+ .kywi-selfid-modal { animation-name: kywi-selfid-in-modal; }
437
+ @keyframes kywi-selfid-in-modal {
438
+ from { opacity: 0; transform: translate(-50%, -46%); }
439
+ to { opacity: 1; transform: translate(-50%, -50%); }
440
+ }
441
+ @media (prefers-reduced-motion: reduce) {
442
+ .kywi-selfid-slide-in, .kywi-selfid-modal { animation: none; }
443
+ }
444
+
445
+ .kywi-selfid-headline {
446
+ margin: 0 0 var(--kywi-spacing-xs, 0.25rem);
447
+ font-family: var(--kywi-font-family-heading, var(--kywi-font-family-base, system-ui, sans-serif));
448
+ font-size: 1.125rem;
449
+ line-height: 1.3;
450
+ color: var(--kywi-color-heading, var(--kywi-color-text, #0f172a));
451
+ }
452
+ .kywi-selfid-subheadline {
453
+ margin: 0 0 var(--kywi-spacing-md, 1rem);
454
+ font-size: 0.9rem;
455
+ color: var(--kywi-color-muted, #64748b);
456
+ }
457
+ .kywi-selfid-form { display: flex; flex-direction: column; gap: var(--kywi-spacing-md, 1rem); }
458
+ .kywi-selfid-field { display: flex; flex-direction: column; gap: var(--kywi-spacing-xs, 0.25rem); }
459
+ .kywi-selfid-field label { font-size: 0.8rem; font-weight: 600; color: var(--kywi-color-muted, #64748b); }
460
+ .kywi-selfid-field select,
461
+ .kywi-selfid-field input {
462
+ box-sizing: border-box;
463
+ width: 100%;
464
+ padding: 0.55rem 0.7rem;
465
+ font: inherit;
466
+ color: var(--kywi-color-text, #0f172a);
467
+ background: var(--kywi-color-background, #ffffff);
468
+ border: 1px solid var(--kywi-color-border, #e2e8f0);
469
+ border-radius: var(--kywi-border-radius-md, 10px);
470
+ }
471
+ .kywi-selfid-field select:focus,
472
+ .kywi-selfid-field input:focus {
473
+ outline: 2px solid var(--kywi-color-primary, #2563eb);
474
+ outline-offset: 1px;
475
+ border-color: var(--kywi-color-primary, #2563eb);
476
+ }
477
+ .kywi-selfid-actions { display: flex; align-items: center; gap: var(--kywi-spacing-sm, 0.5rem); }
478
+ .kywi-selfid-submit {
479
+ padding: 0.55rem 1.1rem;
480
+ font: inherit;
481
+ font-weight: 600;
482
+ cursor: pointer;
483
+ color: var(--kywi-color-primary-contrast, #ffffff);
484
+ background: var(--kywi-color-primary, #2563eb);
485
+ border: 1px solid transparent;
486
+ border-radius: var(--kywi-border-radius-md, 10px);
487
+ }
488
+ .kywi-selfid-submit:hover { filter: brightness(1.07); }
489
+ .kywi-selfid-skip {
490
+ padding: 0.55rem 0.6rem;
491
+ font: inherit;
492
+ cursor: pointer;
493
+ color: var(--kywi-color-muted, #64748b);
494
+ background: none;
495
+ border: none;
496
+ text-decoration: underline;
497
+ text-underline-offset: 2px;
498
+ }
499
+ .kywi-selfid-skip:hover { color: var(--kywi-color-text, #0f172a); }
500
+
501
+ /* Transparency bar — pinned to the bottom edge, one line. */
502
+ .kywi-transparency-bar {
503
+ position: fixed;
504
+ left: 0;
505
+ right: 0;
506
+ bottom: 0;
507
+ z-index: 55;
508
+ display: flex;
509
+ align-items: center;
510
+ justify-content: center;
511
+ gap: var(--kywi-spacing-md, 1rem);
512
+ padding: var(--kywi-spacing-sm, 0.5rem) var(--kywi-spacing-lg, 1.5rem);
513
+ font-family: var(--kywi-font-family-base, system-ui, sans-serif);
514
+ font-size: 0.85rem;
515
+ color: var(--kywi-color-text, #0f172a);
516
+ background: var(--kywi-color-surface, #f8fafc);
517
+ border-top: 1px solid var(--kywi-color-border, #e2e8f0);
518
+ }
519
+ .kywi-transparency-text { margin: 0; }
520
+ .kywi-transparency-opt-out {
521
+ padding: 0.3rem 0.75rem;
522
+ font: inherit;
523
+ cursor: pointer;
524
+ color: var(--kywi-color-text, #0f172a);
525
+ background: var(--kywi-color-background, #ffffff);
526
+ border: 1px solid var(--kywi-color-border, #e2e8f0);
527
+ border-radius: var(--kywi-border-radius-sm, 6px);
528
+ }
529
+ .kywi-transparency-opt-out:hover { border-color: var(--kywi-color-primary, #2563eb); }
530
+
531
+ /* Personalization badge — small inline pill. */
532
+ .kywi-personalization-badge {
533
+ display: inline-flex;
534
+ align-items: center;
535
+ gap: var(--kywi-spacing-sm, 0.5rem);
536
+ padding: 0.35rem 0.7rem;
537
+ font-size: 0.8rem;
538
+ color: var(--kywi-color-muted, #64748b);
539
+ background: var(--kywi-color-surface, #f8fafc);
540
+ border: 1px solid var(--kywi-color-border, #e2e8f0);
541
+ border-radius: 999px;
542
+ }
543
+ .kywi-badge-opt-out {
544
+ padding: 0.15rem 0.55rem;
545
+ font: inherit;
546
+ cursor: pointer;
547
+ color: var(--kywi-color-text, #0f172a);
548
+ background: var(--kywi-color-background, #ffffff);
549
+ border: 1px solid var(--kywi-color-border, #e2e8f0);
550
+ border-radius: var(--kywi-border-radius-sm, 6px);
551
+ }
552
+ .kywi-badge-opt-out:hover { border-color: var(--kywi-color-primary, #2563eb); }
553
+
554
+ /* Variant container — arms manage their own visibility (inline display).
555
+ * Only the loading state needs styling: a low skeleton shimmer while the client
556
+ * resolves which arm to show. */
557
+ .kywi-variant-loading { position: relative; min-height: 2rem; }
558
+ .kywi-variant-skeleton {
559
+ position: absolute;
560
+ inset: 0;
561
+ border-radius: var(--kywi-border-radius-md, 10px);
562
+ background: linear-gradient(90deg,
563
+ var(--kywi-color-surface, #f8fafc) 25%,
564
+ var(--kywi-color-border, #e2e8f0) 50%,
565
+ var(--kywi-color-surface, #f8fafc) 75%);
566
+ background-size: 200% 100%;
567
+ animation: kywi-variant-shimmer 1.4s ease-in-out infinite;
568
+ }
569
+ @keyframes kywi-variant-shimmer {
570
+ from { background-position: 200% 0; }
571
+ to { background-position: -200% 0; }
572
+ }
573
+ @media (prefers-reduced-motion: reduce) {
574
+ .kywi-variant-skeleton { animation: none; }
575
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kywi-software/core",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Kywi CMS core — schema generator, REST API, and admin UI for Next.js.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",