@jungherz-de/glasskit-elements 0.8.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/LICENSE +21 -0
- package/README.md +263 -0
- package/dist/glasskit-elements.esm.js +1789 -0
- package/dist/glasskit-elements.js +1819 -0
- package/dist/glasskit-elements.min.js +1 -0
- package/package.json +43 -0
- package/src/base.js +181 -0
- package/src/components/buttons/glk-button.js +80 -0
- package/src/components/containers/glk-accordion-item.js +61 -0
- package/src/components/containers/glk-accordion.js +12 -0
- package/src/components/content/glk-avatar.js +58 -0
- package/src/components/content/glk-badge.js +37 -0
- package/src/components/content/glk-card.js +33 -0
- package/src/components/content/glk-divider.js +11 -0
- package/src/components/content/glk-status.js +35 -0
- package/src/components/content/glk-title.js +16 -0
- package/src/components/feedback/glk-modal.js +98 -0
- package/src/components/feedback/glk-progress.js +77 -0
- package/src/components/feedback/glk-toast.js +104 -0
- package/src/components/forms/glk-checkbox.js +103 -0
- package/src/components/forms/glk-input.js +138 -0
- package/src/components/forms/glk-radio.js +109 -0
- package/src/components/forms/glk-range.js +112 -0
- package/src/components/forms/glk-search.js +87 -0
- package/src/components/forms/glk-select.js +96 -0
- package/src/components/forms/glk-textarea.js +95 -0
- package/src/components/forms/glk-toggle.js +121 -0
- package/src/components/navigation/glk-nav.js +12 -0
- package/src/components/navigation/glk-pill.js +48 -0
- package/src/components/navigation/glk-tab-bar.js +31 -0
- package/src/components/navigation/glk-tab-item.js +74 -0
- package/src/index.js +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var GlassKitElements=function(t){"use strict";const e=new CSSStyleSheet;e.replaceSync("[class*=gl-],[class*=glass-],[class*=glass-]::after,[class*=glass-]::before{box-sizing:border-box}:root,[data-theme=dark]{--gl-color-primary:#f5a623;--gl-color-primary-dark:#d4692a;--gl-color-primary-mid:#e07a24;--gl-color-bg-dark:#0e2530;--gl-color-bg-mid:#1a3d4e;--gl-color-bg-light:#1b3e50;--gl-color-text:#ffffff;--gl-color-text-muted:rgba(255, 255, 255, 0.60);--gl-color-text-on-light:#1a3a4a;--gl-color-text-heading:#ffffff;--gl-color-success:#34c759;--gl-color-error:#ff3b30;--gl-color-warning:#ffcc00;--gl-surface-1:rgba(255, 255, 255, 0.08);--gl-surface-2:rgba(255, 255, 255, 0.10);--gl-surface-3:rgba(255, 255, 255, 0.14);--gl-surface-4:rgba(255, 255, 255, 0.16);--gl-surface-5:rgba(255, 255, 255, 0.22);--gl-surface-milk:rgba(255, 255, 255, 0.55);--gl-surface-milk-strong:rgba(255, 255, 255, 0.75);--gl-surface-overlay:rgba(0, 0, 0, 0.50);--gl-card-glow-top:rgba(255, 255, 255, 0.32);--gl-card-glow-mid:rgba(255, 255, 255, 0.22);--gl-card-glow-low:rgba(255, 255, 255, 0.14);--gl-card-glow-bottom:rgba(255, 255, 255, 0.08);--gl-card-icon-color:rgba(255, 255, 255, 0.8);--gl-card-text-color:rgba(255, 255, 255, 0.7);--gl-border-subtle:rgba(255, 255, 255, 0.18);--gl-border-medium:rgba(255, 255, 255, 0.30);--gl-border-strong:rgba(255, 255, 255, 0.40);--gl-border-milk:rgba(255, 255, 255, 0.60);--gl-border-warm:rgba(255, 200, 100, 0.35);--gl-border-focus:rgba(245, 166, 35, 0.60);--gl-icon-default:rgba(255, 255, 255, 0.6);--gl-icon-muted:rgba(255, 255, 255, 0.45);--gl-icon-strong:rgba(255, 255, 255, 0.8);--gl-icon-on-primary:#ffffff;--gl-icon-on-secondary:#1a3a4a;--gl-icon-on-tertiary:rgba(255, 255, 255, 0.6);--gl-blur:24px;--gl-blur-light:16px;--gl-blur-soft:12px;--gl-blur-heavy:40px;--gl-radius-pill:50%;--gl-radius-full:9999px;--gl-radius-card:24px;--gl-radius-btn:16px;--gl-radius-input:14px;--gl-radius-sm:12px;--gl-radius-xs:8px;--gl-shadow-card:0 8px 32px rgba(0, 0, 0, 0.18);--gl-shadow-btn:0 4px 16px rgba(0, 0, 0, 0.12);--gl-shadow-btn-primary:0 6px 24px rgba(230, 130, 40, 0.35),0 2px 8px rgba(0, 0, 0, 0.15);--gl-shadow-glow:0 2px 12px rgba(255, 255, 255, 0.08),0 4px 16px rgba(0, 0, 0, 0.15);--gl-shadow-modal:0 24px 80px rgba(0, 0, 0, 0.4),0 8px 32px rgba(0, 0, 0, 0.2);--gl-shadow-toast:0 8px 32px rgba(0, 0, 0, 0.25);--gl-shadow-focus:0 0 0 3px rgba(245, 166, 35, 0.3);--gl-inset-subtle:inset 0 1px 1px rgba(255, 255, 255, 0.10);--gl-inset-medium:inset 0 1px 1px rgba(255, 255, 255, 0.15);--gl-inset-strong:inset 0 1px 2px rgba(255, 255, 255, 0.25);--gl-inset-milk:inset 0 1px 2px rgba(255, 255, 255, 0.40);--gl-bg-aurora-1:rgba(60, 160, 160, 0.25);--gl-bg-aurora-2:rgba(200, 140, 60, 0.12);--gl-bg-aurora-3:rgba(80, 180, 200, 0.18);--gl-bg-light-streak-1:rgba(90, 210, 200, 0.14);--gl-bg-light-streak-2:rgba(110, 200, 190, 0.10);--gl-bg-warm-glow:rgba(220, 160, 70, 0.10);--gl-space-2xs:4px;--gl-space-xs:8px;--gl-space-sm:12px;--gl-space-md:16px;--gl-space-lg:20px;--gl-space-xl:24px;--gl-space-2xl:32px;--gl-space-3xl:40px;--gl-space-4xl:56px;--gl-font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',Roboto,Helvetica,Arial,sans-serif;--gl-font-size-xs:13px;--gl-font-size-sm:14px;--gl-font-size-base:15px;--gl-font-size-btn:16px;--gl-font-size-lg:18px;--gl-font-size-title:24px;--gl-font-size-modal:20px;--gl-font-weight-normal:400;--gl-font-weight-medium:500;--gl-font-weight-semibold:600;--gl-transition:all 0.25s ease;--gl-transition-fast:all 0.15s ease;--gl-transition-modal:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);--gl-tab-bar-height:82px;--gl-placeholder:rgba(255, 255, 255, 0.35);--gl-accordion-body-color:var(--gl-color-text-muted);--gl-toggle-thumb-bg:linear-gradient(to bottom,\n rgba(255,255,255,0.9) 0%,\n rgba(255,255,255,0.7) 100%);--gl-range-track-bg:var(--gl-surface-2);--gl-range-track-border:var(--gl-border-subtle)}[data-theme=light]{--gl-color-primary:#e8852d;--gl-color-primary-dark:#c96a1e;--gl-color-primary-mid:#d97826;--gl-color-bg-dark:#e8ecf1;--gl-color-bg-mid:#f0f4f8;--gl-color-bg-light:#f5f7fa;--gl-color-text:#1a2a36;--gl-color-text-muted:rgba(26, 42, 54, 0.55);--gl-color-text-on-light:#1a3a4a;--gl-color-text-heading:#0f1f2a;--gl-color-success:#28a745;--gl-color-error:#dc3545;--gl-color-warning:#e6a800;--gl-surface-1:rgba(255, 255, 255, 0.50);--gl-surface-2:rgba(255, 255, 255, 0.60);--gl-surface-3:rgba(255, 255, 255, 0.70);--gl-surface-4:rgba(255, 255, 255, 0.75);--gl-surface-5:rgba(255, 255, 255, 0.85);--gl-surface-milk:rgba(255, 255, 255, 0.85);--gl-surface-milk-strong:rgba(255, 255, 255, 0.92);--gl-surface-overlay:rgba(0, 0, 0, 0.25);--gl-card-glow-top:rgba(255, 255, 255, 0.90);--gl-card-glow-mid:rgba(255, 255, 255, 0.78);--gl-card-glow-low:rgba(255, 255, 255, 0.65);--gl-card-glow-bottom:rgba(255, 255, 255, 0.50);--gl-card-icon-color:rgba(26, 42, 54, 0.5);--gl-card-text-color:rgba(26, 42, 54, 0.6);--gl-border-subtle:rgba(0, 0, 0, 0.08);--gl-border-medium:rgba(0, 0, 0, 0.12);--gl-border-strong:rgba(0, 0, 0, 0.15);--gl-border-milk:rgba(0, 0, 0, 0.10);--gl-border-warm:rgba(232, 133, 45, 0.30);--gl-border-focus:rgba(232, 133, 45, 0.50);--gl-icon-default:rgba(26, 42, 54, 0.50);--gl-icon-muted:rgba(26, 42, 54, 0.35);--gl-icon-strong:rgba(26, 42, 54, 0.70);--gl-icon-on-primary:#ffffff;--gl-icon-on-secondary:#1a3a4a;--gl-icon-on-tertiary:rgba(26, 42, 54, 0.50);--gl-shadow-card:0 4px 20px rgba(0, 0, 0, 0.06);--gl-shadow-btn:0 2px 10px rgba(0, 0, 0, 0.06);--gl-shadow-btn-primary:0 4px 16px rgba(232, 133, 45, 0.25),0 2px 6px rgba(0, 0, 0, 0.08);--gl-shadow-glow:0 2px 8px rgba(0, 0, 0, 0.05),0 4px 12px rgba(0, 0, 0, 0.04);--gl-shadow-modal:0 16px 48px rgba(0, 0, 0, 0.12),0 4px 16px rgba(0, 0, 0, 0.08);--gl-shadow-toast:0 4px 20px rgba(0, 0, 0, 0.10);--gl-shadow-focus:0 0 0 3px rgba(232, 133, 45, 0.25);--gl-inset-subtle:inset 0 1px 1px rgba(255, 255, 255, 0.60);--gl-inset-medium:inset 0 1px 1px rgba(255, 255, 255, 0.70);--gl-inset-strong:inset 0 1px 2px rgba(255, 255, 255, 0.80);--gl-inset-milk:inset 0 1px 2px rgba(255, 255, 255, 0.90);--gl-bg-aurora-1:rgba(100, 200, 220, 0.15);--gl-bg-aurora-2:rgba(240, 180, 100, 0.10);--gl-bg-aurora-3:rgba(120, 200, 230, 0.12);--gl-bg-light-streak-1:rgba(140, 230, 220, 0.10);--gl-bg-light-streak-2:rgba(160, 220, 210, 0.08);--gl-bg-warm-glow:rgba(240, 180, 100, 0.08);--gl-placeholder:rgba(26, 42, 54, 0.30);--gl-accordion-body-color:var(--gl-color-text-muted);--gl-toggle-thumb-bg:linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);--gl-range-track-bg:var(--gl-surface-2);--gl-range-track-border:var(--gl-border-subtle)}.glass-bg{background:radial-gradient(ellipse at 20% 40%,var(--gl-bg-aurora-1) 0,transparent 55%),radial-gradient(ellipse at 80% 65%,var(--gl-bg-aurora-2) 0,transparent 50%),radial-gradient(ellipse at 50% 20%,var(--gl-bg-aurora-3) 0,transparent 50%),linear-gradient(170deg,var(--gl-color-bg-light) 0,var(--gl-color-bg-mid) 50%,var(--gl-color-bg-dark) 100%);position:relative;min-height:100vh;overflow-x:hidden;font-family:var(--gl-font-family);color:var(--gl-color-text);-webkit-font-smoothing:antialiased;transition:background .4s,color .3s}.glass-bg::before{content:'';position:absolute;top:20%;left:-30%;width:160%;height:55%;background:radial-gradient(ellipse at 35% 45%,var(--gl-bg-light-streak-1) 0,transparent 50%),radial-gradient(ellipse at 65% 55%,var(--gl-bg-light-streak-2) 0,transparent 45%);transform:rotate(-8deg);pointer-events:none;z-index:0}.glass-bg::after{content:'';position:absolute;top:40%;right:-20%;width:70%;height:50%;background:radial-gradient(ellipse at center,var(--gl-bg-warm-glow) 0,transparent 65%);pointer-events:none;z-index:0}.glass-bg>*{position:relative;z-index:1}.glass-bg--has-tab-bar{padding-bottom:var(--gl-tab-bar-height)}.glass-nav{display:flex;justify-content:space-between;align-items:center;padding:0 var(--gl-space-xs)}.glass-pill{width:46px;height:46px;border-radius:var(--gl-radius-pill);background:var(--gl-surface-3);backdrop-filter:blur(var(--gl-blur));-webkit-backdrop-filter:blur(var(--gl-blur));border:1.5px solid var(--gl-border-strong);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--gl-transition);color:var(--gl-color-text);box-shadow:var(--gl-shadow-glow),var(--gl-inset-medium);outline:0;-webkit-tap-highlight-color:transparent}.glass-pill:hover{background:var(--gl-surface-5);transform:scale(1.05)}.glass-pill:active{transform:scale(.95)}.glass-pill svg{width:20px;height:20px;fill:none;stroke:var(--gl-color-text);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.glass-title{text-align:center;color:var(--gl-color-text-heading);font-size:var(--gl-font-size-title);font-weight:var(--gl-font-weight-semibold);line-height:1.3;text-shadow:0 2px 12px rgba(0,0,0,.15);letter-spacing:-.3px}.glass-card{background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur));-webkit-backdrop-filter:blur(var(--gl-blur));border:1.5px solid var(--gl-border-medium);border-radius:var(--gl-radius-card);padding:var(--gl-space-3xl) var(--gl-space-xl) var(--gl-space-2xl);box-shadow:var(--gl-shadow-card),var(--gl-inset-strong)}.glass-card--glow{position:relative;overflow:hidden;background:linear-gradient(to bottom,var(--gl-card-glow-top) 0,var(--gl-card-glow-mid) 25%,var(--gl-card-glow-low) 55%,var(--gl-card-glow-bottom) 100%)}.glass-card--glow::before{content:'';position:absolute;top:0;left:10%;right:10%;height:1px;background:linear-gradient(90deg,transparent 0,rgba(255,255,255,.5) 30%,rgba(255,255,255,.6) 50%,rgba(255,255,255,.5) 70%,transparent 100%);z-index:1}.glass-card__icon{display:flex;align-items:center;justify-content:center;margin:0 auto var(--gl-space-lg)}.glass-card__icon svg{width:64px;height:64px;stroke:var(--gl-card-icon-color);stroke-width:1.2;fill:none}.glass-card__text{color:var(--gl-card-text-color);font-size:var(--gl-font-size-base);font-weight:var(--gl-font-weight-normal);line-height:1.55;text-align:center}.glass-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:56px;border:none;border-radius:var(--gl-radius-btn);font-family:var(--gl-font-family);font-size:var(--gl-font-size-btn);font-weight:var(--gl-font-weight-semibold);cursor:pointer;transition:var(--gl-transition);outline:0;-webkit-tap-highlight-color:transparent}.glass-btn svg{width:20px;height:20px;flex-shrink:0}.glass-btn--primary{background:linear-gradient(135deg,var(--gl-color-primary) 0,var(--gl-color-primary-mid) 50%,var(--gl-color-primary-dark) 100%);color:#fff;border:1px solid var(--gl-border-warm);box-shadow:var(--gl-shadow-btn-primary),var(--gl-inset-strong)}.glass-btn--primary svg{fill:var(--gl-icon-on-primary);stroke:var(--gl-icon-on-primary);stroke-width:0}.glass-btn--primary:hover{transform:translateY(-1px)}.glass-btn--primary:active{transform:translateY(1px)}.glass-btn--secondary{background:linear-gradient(to bottom,var(--gl-surface-milk-strong) 0,var(--gl-surface-milk) 100%);backdrop-filter:blur(var(--gl-blur));-webkit-backdrop-filter:blur(var(--gl-blur));border:1.5px solid var(--gl-border-milk);color:var(--gl-color-text-on-light);box-shadow:var(--gl-shadow-btn),var(--gl-inset-milk)}.glass-btn--secondary svg{fill:none;stroke:var(--gl-icon-on-secondary);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.glass-btn--secondary:hover{transform:translateY(-1px)}.glass-btn--secondary:active{transform:translateY(1px)}.glass-btn--tertiary{background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-light));-webkit-backdrop-filter:blur(var(--gl-blur-light));border:1px solid var(--gl-border-subtle);color:var(--gl-color-text-muted);box-shadow:0 4px 12px rgba(0,0,0,.1),var(--gl-inset-subtle)}.glass-btn--tertiary svg{fill:none;stroke:var(--gl-icon-on-tertiary);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.glass-btn--tertiary:hover{background:var(--gl-surface-4);color:var(--gl-color-text);transform:translateY(-1px)}.glass-btn--tertiary:active{transform:translateY(1px)}.glass-btn--sm{height:44px;font-size:var(--gl-font-size-sm);border-radius:var(--gl-radius-sm)}.glass-btn--lg{height:64px;font-size:var(--gl-font-size-lg)}.glass-btn--auto{width:auto;padding:0 var(--gl-space-xl)}.glass-status{background:var(--gl-surface-1);backdrop-filter:blur(var(--gl-blur-light));-webkit-backdrop-filter:blur(var(--gl-blur-light));border:1px solid var(--gl-border-subtle);border-radius:var(--gl-radius-btn);padding:var(--gl-space-md) var(--gl-space-lg);display:flex;align-items:center;gap:var(--gl-space-sm);box-shadow:0 4px 12px rgba(0,0,0,.08),var(--gl-inset-subtle)}.glass-status svg{width:20px;height:20px;flex-shrink:0;stroke:var(--gl-icon-muted);stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.glass-status p{color:var(--gl-color-text-muted);font-size:var(--gl-font-size-sm);font-weight:var(--gl-font-weight-normal);line-height:1.45}.glass-input-group{display:flex;flex-direction:column;gap:var(--gl-space-xs)}.glass-label{font-size:var(--gl-font-size-sm);font-weight:var(--gl-font-weight-medium);color:var(--gl-icon-strong);padding-left:var(--gl-space-2xs)}.glass-input{width:100%;height:52px;padding:0 var(--gl-space-md);background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-light));-webkit-backdrop-filter:blur(var(--gl-blur-light));border:1.5px solid var(--gl-border-medium);border-radius:var(--gl-radius-input);color:var(--gl-color-text);font-family:var(--gl-font-family);font-size:var(--gl-font-size-base);transition:var(--gl-transition);outline:0;box-shadow:var(--gl-inset-subtle);-webkit-tap-highlight-color:transparent}.glass-input::placeholder{color:var(--gl-placeholder)}.glass-input:focus{border-color:var(--gl-border-focus);background:var(--gl-surface-3);box-shadow:var(--gl-shadow-focus),var(--gl-inset-medium)}.glass-input:disabled{opacity:.4;cursor:not-allowed}.glass-input--error{border-color:var(--gl-color-error)}.glass-input--error:focus{box-shadow:0 0 0 3px rgba(255,59,48,.25),var(--gl-inset-medium)}.glass-hint{font-size:var(--gl-font-size-xs);color:var(--gl-color-text-muted);padding-left:var(--gl-space-2xs)}.glass-hint--error{color:var(--gl-color-error)}.glass-textarea{width:100%;min-height:120px;padding:var(--gl-space-md);background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-light));-webkit-backdrop-filter:blur(var(--gl-blur-light));border:1.5px solid var(--gl-border-medium);border-radius:var(--gl-radius-input);color:var(--gl-color-text);font-family:var(--gl-font-family);font-size:var(--gl-font-size-base);line-height:1.5;resize:vertical;transition:var(--gl-transition);outline:0;box-shadow:var(--gl-inset-subtle)}.glass-textarea::placeholder{color:var(--gl-placeholder)}.glass-textarea:focus{border-color:var(--gl-border-focus);background:var(--gl-surface-3);box-shadow:var(--gl-shadow-focus),var(--gl-inset-medium)}.glass-select{width:100%;height:52px;padding:0 var(--gl-space-3xl) 0 var(--gl-space-md);background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-light));-webkit-backdrop-filter:blur(var(--gl-blur-light));border:1.5px solid var(--gl-border-medium);border-radius:var(--gl-radius-input);color:var(--gl-color-text);font-family:var(--gl-font-family);font-size:var(--gl-font-size-base);transition:var(--gl-transition);outline:0;box-shadow:var(--gl-inset-subtle);cursor:pointer;appearance:none;-webkit-appearance:none;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right 16px center}.glass-select:focus{border-color:var(--gl-border-focus);box-shadow:var(--gl-shadow-focus),var(--gl-inset-medium)}.glass-select option{background:var(--gl-color-bg-mid);color:var(--gl-color-text)}.glass-search{position:relative;display:flex;align-items:center}.glass-search__icon{position:absolute;left:var(--gl-space-md);width:18px;height:18px;stroke:var(--gl-icon-muted)!important;stroke-width:2!important;stroke-linecap:round!important;stroke-linejoin:round!important;fill:none!important;pointer-events:none;z-index:2}.glass-search .glass-input{padding-left:44px;border-radius:var(--gl-radius-full)}.glass-toggle{display:inline-flex;align-items:center;gap:var(--gl-space-sm);cursor:pointer;-webkit-tap-highlight-color:transparent}.glass-toggle__input{position:absolute;opacity:0;width:0;height:0}.glass-toggle__track{position:relative;width:52px;height:30px;background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-soft));-webkit-backdrop-filter:blur(var(--gl-blur-soft));border:1.5px solid var(--gl-border-medium);border-radius:var(--gl-radius-full);transition:var(--gl-transition);box-shadow:var(--gl-inset-subtle);flex-shrink:0}.glass-toggle__thumb{position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:var(--gl-radius-pill);background:var(--gl-toggle-thumb-bg);box-shadow:0 2px 6px rgba(0,0,0,.2),var(--gl-inset-milk);transition:var(--gl-transition)}.glass-toggle__input:checked+.glass-toggle__track{background:linear-gradient(135deg,var(--gl-color-primary) 0,var(--gl-color-primary-dark) 100%);border-color:var(--gl-border-warm)}.glass-toggle__input:checked+.glass-toggle__track .glass-toggle__thumb{transform:translateX(22px)}.glass-toggle__input:focus-visible+.glass-toggle__track{box-shadow:var(--gl-shadow-focus)}.glass-toggle__label{font-size:var(--gl-font-size-base);color:var(--gl-color-text);user-select:none}.glass-checkbox{display:inline-flex;align-items:center;gap:var(--gl-space-sm);cursor:pointer;-webkit-tap-highlight-color:transparent}.glass-checkbox__input{position:absolute;opacity:0;width:0;height:0}.glass-checkbox__box{width:24px;height:24px;border-radius:var(--gl-radius-xs);background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-soft));-webkit-backdrop-filter:blur(var(--gl-blur-soft));border:1.5px solid var(--gl-border-medium);display:flex;align-items:center;justify-content:center;transition:var(--gl-transition);box-shadow:var(--gl-inset-subtle);flex-shrink:0}.glass-checkbox__box svg{width:14px;height:14px;stroke:white;stroke-width:3;fill:none;stroke-linecap:round;stroke-linejoin:round;opacity:0;transform:scale(.5);transition:var(--gl-transition-fast)}.glass-checkbox__input:checked+.glass-checkbox__box{background:linear-gradient(135deg,var(--gl-color-primary) 0,var(--gl-color-primary-dark) 100%);border-color:var(--gl-border-warm)}.glass-checkbox__input:checked+.glass-checkbox__box svg{opacity:1;transform:scale(1)}.glass-checkbox__input:focus-visible+.glass-checkbox__box{box-shadow:var(--gl-shadow-focus)}.glass-checkbox__label{font-size:var(--gl-font-size-base);color:var(--gl-color-text);user-select:none}.glass-radio{display:inline-flex;align-items:center;gap:var(--gl-space-sm);cursor:pointer;-webkit-tap-highlight-color:transparent}.glass-radio__input{position:absolute;opacity:0;width:0;height:0}.glass-radio__circle{width:24px;height:24px;border-radius:var(--gl-radius-pill);background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-soft));border:1.5px solid var(--gl-border-medium);display:flex;align-items:center;justify-content:center;transition:var(--gl-transition);box-shadow:var(--gl-inset-subtle);flex-shrink:0}.glass-radio__dot{width:10px;height:10px;border-radius:var(--gl-radius-pill);background:#fff;opacity:0;transform:scale(0);transition:var(--gl-transition-fast)}.glass-radio__input:checked+.glass-radio__circle{background:linear-gradient(135deg,var(--gl-color-primary) 0,var(--gl-color-primary-dark) 100%);border-color:var(--gl-border-warm)}.glass-radio__input:checked+.glass-radio__circle .glass-radio__dot{opacity:1;transform:scale(1)}.glass-radio__input:focus-visible+.glass-radio__circle{box-shadow:var(--gl-shadow-focus)}.glass-radio__label{font-size:var(--gl-font-size-base);color:var(--gl-color-text);user-select:none}.glass-range-group{display:flex;flex-direction:column;gap:var(--gl-space-xs)}.glass-range-header{display:flex;justify-content:space-between;align-items:baseline}.glass-range-value{font-size:var(--gl-font-size-sm);font-weight:var(--gl-font-weight-semibold);color:var(--gl-color-primary);font-variant-numeric:tabular-nums}.glass-range{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:var(--gl-radius-full);background:var(--gl-range-track-bg);border:1px solid var(--gl-range-track-border);outline:0;cursor:pointer}.glass-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:26px;height:26px;border-radius:var(--gl-radius-pill);background:linear-gradient(135deg,var(--gl-color-primary) 0,var(--gl-color-primary-dark) 100%);border:2px solid rgba(255,255,255,.5);box-shadow:0 2px 8px rgba(230,130,40,.35),var(--gl-inset-strong);margin-top:-10px;cursor:pointer;transition:var(--gl-transition)}.glass-range::-webkit-slider-thumb:hover{transform:scale(1.1)}.glass-range::-moz-range-thumb{width:26px;height:26px;border-radius:var(--gl-radius-pill);background:linear-gradient(135deg,var(--gl-color-primary) 0,var(--gl-color-primary-dark) 100%);border:2px solid rgba(255,255,255,.5);box-shadow:0 2px 8px rgba(230,130,40,.35);cursor:pointer}.glass-range::-moz-range-track{height:6px;border-radius:var(--gl-radius-full);background:var(--gl-range-track-bg);border:1px solid var(--gl-range-track-border)}.glass-range:focus-visible{box-shadow:var(--gl-shadow-focus)}.glass-progress{width:100%;display:flex;flex-direction:column;gap:var(--gl-space-xs)}.glass-progress__header{display:flex;justify-content:space-between;align-items:baseline}.glass-progress__label{font-size:var(--gl-font-size-sm);font-weight:var(--gl-font-weight-medium);color:var(--gl-icon-strong)}.glass-progress__value{font-size:var(--gl-font-size-xs);font-weight:var(--gl-font-weight-semibold);color:var(--gl-color-text-muted);font-variant-numeric:tabular-nums}.glass-progress__track{width:100%;height:8px;border-radius:var(--gl-radius-full);background:var(--gl-surface-2);border:1px solid var(--gl-border-subtle);overflow:hidden;box-shadow:var(--gl-inset-subtle)}.glass-progress__fill{height:100%;border-radius:var(--gl-radius-full);background:linear-gradient(90deg,var(--gl-color-primary) 0,var(--gl-color-primary-dark) 100%);box-shadow:0 0 8px rgba(245,166,35,.3),var(--gl-inset-strong);transition:width .5s cubic-bezier(.4, 0, .2, 1);position:relative}.glass-progress__fill::after{content:'';position:absolute;top:0;left:0;right:0;height:50%;border-radius:var(--gl-radius-full);background:linear-gradient(to bottom,rgba(255,255,255,.3) 0,transparent 100%)}.glass-progress--sm .glass-progress__track{height:4px}.glass-progress--lg .glass-progress__track{height:12px}.glass-progress--success .glass-progress__fill{background:linear-gradient(90deg,#34c759 0,#2da44e 100%);box-shadow:0 0 8px rgba(52,199,89,.3),var(--gl-inset-strong)}.glass-progress--error .glass-progress__fill{background:linear-gradient(90deg,#ff3b30 0,#d63027 100%);box-shadow:0 0 8px rgba(255,59,48,.3),var(--gl-inset-strong)}.glass-modal-overlay{position:fixed;inset:0;background:var(--gl-surface-overlay);backdrop-filter:blur(var(--gl-blur-soft));-webkit-backdrop-filter:blur(var(--gl-blur-soft));display:flex;align-items:center;justify-content:center;padding:var(--gl-space-lg);z-index:1000;opacity:0;pointer-events:none;transition:var(--gl-transition-modal);font-family:var(--gl-font-family);-webkit-font-smoothing:antialiased}.glass-modal-overlay.is-active{opacity:1;pointer-events:auto}.glass-modal{width:100%;max-width:340px;background:linear-gradient(to bottom,var(--gl-card-glow-top) 0,var(--gl-card-glow-bottom) 100%);backdrop-filter:blur(var(--gl-blur-heavy));-webkit-backdrop-filter:blur(var(--gl-blur-heavy));border:1.5px solid var(--gl-border-medium);border-radius:var(--gl-radius-card);overflow:hidden;box-shadow:var(--gl-shadow-modal);transform:scale(.9) translateY(20px);transition:var(--gl-transition-modal);position:relative}.glass-modal-overlay.is-active .glass-modal{transform:scale(1) translateY(0)}.glass-modal::before{content:'';position:absolute;top:0;left:10%;right:10%;height:1px;background:linear-gradient(90deg,transparent 0,rgba(255,255,255,.4) 30%,rgba(255,255,255,.5) 50%,rgba(255,255,255,.4) 70%,transparent 100%)}.glass-modal__header{padding:var(--gl-space-xl) var(--gl-space-xl) var(--gl-space-sm);text-align:center}.glass-modal__title{font-size:var(--gl-font-size-modal);font-weight:var(--gl-font-weight-semibold);color:var(--gl-color-text)}.glass-modal__body{padding:var(--gl-space-sm) var(--gl-space-xl) var(--gl-space-xl);text-align:center}.glass-modal__body p{color:var(--gl-color-text-muted);font-size:var(--gl-font-size-base);line-height:1.55}.glass-modal__footer{display:flex;border-top:1px solid var(--gl-border-subtle)}.glass-modal__action{flex:1;height:52px;background:0 0;border:none;font-family:var(--gl-font-family);font-size:var(--gl-font-size-btn);font-weight:var(--gl-font-weight-medium);color:var(--gl-color-text-muted);cursor:pointer;transition:var(--gl-transition-fast);outline:0}.glass-modal__action:hover{background:var(--gl-surface-1)}.glass-modal__action+.glass-modal__action{border-left:1px solid var(--gl-border-subtle)}.glass-modal__action--primary{color:var(--gl-color-primary);font-weight:var(--gl-font-weight-semibold)}.glass-modal__action--danger{color:var(--gl-color-error);font-weight:var(--gl-font-weight-semibold)}.glass-toast{position:fixed;top:var(--gl-space-4xl);left:50%;transform:translateX(-50%) translateY(-20px);min-width:280px;max-width:340px;padding:var(--gl-space-md) var(--gl-space-lg);background:linear-gradient(to bottom,var(--gl-surface-4) 0,var(--gl-surface-2) 100%);backdrop-filter:blur(var(--gl-blur));-webkit-backdrop-filter:blur(var(--gl-blur));border:1px solid var(--gl-border-medium);border-radius:var(--gl-radius-btn);display:flex;align-items:center;gap:var(--gl-space-sm);box-shadow:var(--gl-shadow-toast),var(--gl-inset-medium);z-index:1100;opacity:0;pointer-events:none;transition:var(--gl-transition-modal);font-family:var(--gl-font-family);-webkit-font-smoothing:antialiased}.glass-toast.is-visible{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:auto}.glass-toast__icon{width:22px;height:22px;flex-shrink:0;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.glass-toast--success .glass-toast__icon{stroke:var(--gl-color-success)}.glass-toast--error .glass-toast__icon{stroke:var(--gl-color-error)}.glass-toast--warning .glass-toast__icon{stroke:var(--gl-color-warning)}.glass-toast__text{font-size:var(--gl-font-size-sm);font-weight:var(--gl-font-weight-medium);color:var(--gl-color-text);line-height:1.4}.glass-tab-bar{position:fixed;bottom:0;left:0;right:0;height:var(--gl-tab-bar-height);background:linear-gradient(to bottom,var(--gl-surface-3) 0,var(--gl-surface-1) 100%);backdrop-filter:blur(var(--gl-blur));-webkit-backdrop-filter:blur(var(--gl-blur));border-top:1px solid var(--gl-border-subtle);display:flex;justify-content:space-around;align-items:flex-start;padding-top:var(--gl-space-xs);padding-bottom:env(safe-area-inset-bottom,8px);z-index:900;box-shadow:0 -4px 20px rgba(0,0,0,.08),var(--gl-inset-subtle)}.glass-tab-bar__item{display:flex;flex-direction:column;align-items:center;gap:var(--gl-space-2xs);padding:var(--gl-space-2xs) var(--gl-space-sm);background:0 0;border:none;cursor:pointer;transition:var(--gl-transition);outline:0;-webkit-tap-highlight-color:transparent;min-width:60px}.glass-tab-bar__icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;position:relative}.glass-tab-bar__icon svg{width:24px;height:24px;fill:none;stroke:var(--gl-icon-muted);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:var(--gl-transition)}.glass-tab-bar__label{font-size:10px;font-weight:var(--gl-font-weight-medium);color:var(--gl-icon-muted);transition:var(--gl-transition);letter-spacing:.2px}.glass-tab-bar__item.is-active .glass-tab-bar__icon svg{stroke:var(--gl-color-primary);filter:drop-shadow(0 0 6px rgba(245,166,35,.35))}.glass-tab-bar__item.is-active .glass-tab-bar__label{color:var(--gl-color-primary)}.glass-tab-bar__item.is-active .glass-tab-bar__icon::after{content:'';position:absolute;bottom:-6px;left:50%;transform:translateX(-50%);width:4px;height:4px;border-radius:var(--gl-radius-pill);background:var(--gl-color-primary);box-shadow:0 0 6px rgba(245,166,35,.5)}.glass-tab-bar__item:not(.is-active):hover .glass-tab-bar__icon svg{stroke:var(--gl-icon-default)}.glass-tab-bar__item:not(.is-active):hover .glass-tab-bar__label{color:var(--gl-icon-default)}.glass-tab-bar__badge{position:absolute;top:-4px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:var(--gl-radius-full);background:var(--gl-color-error);color:#fff;font-size:10px;font-weight:var(--gl-font-weight-semibold);display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(255,59,48,.4)}.glass-accordion{display:flex;flex-direction:column;gap:var(--gl-space-xs)}.glass-accordion__item{background:var(--gl-surface-2);backdrop-filter:blur(var(--gl-blur-light));-webkit-backdrop-filter:blur(var(--gl-blur-light));border:1px solid var(--gl-border-subtle);border-radius:var(--gl-radius-btn);overflow:hidden;transition:var(--gl-transition);box-shadow:var(--gl-inset-subtle)}.glass-accordion__item.is-open{background:var(--gl-surface-3);border-color:var(--gl-border-medium);box-shadow:0 4px 16px rgba(0,0,0,.1),var(--gl-inset-medium)}.glass-accordion__trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:var(--gl-space-sm);padding:var(--gl-space-md) var(--gl-space-lg);background:0 0;border:none;cursor:pointer;font-family:var(--gl-font-family);font-size:var(--gl-font-size-base);font-weight:var(--gl-font-weight-semibold);color:var(--gl-color-text);text-align:left;outline:0;transition:var(--gl-transition);-webkit-tap-highlight-color:transparent}.glass-accordion__trigger:hover{color:var(--gl-color-primary)}.glass-accordion__trigger-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0}.glass-accordion__trigger-icon svg{width:18px;height:18px;fill:none;stroke:var(--gl-icon-default);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .3s cubic-bezier(.4, 0, .2, 1)}.glass-accordion__item.is-open .glass-accordion__trigger-icon svg{transform:rotate(180deg);stroke:var(--gl-color-primary)}.glass-accordion__content{max-height:0;overflow:hidden;transition:max-height .35s cubic-bezier(.4, 0, .2, 1)}.glass-accordion__item.is-open .glass-accordion__content{max-height:500px}.glass-accordion__body{padding:0 var(--gl-space-lg) var(--gl-space-lg);color:var(--gl-accordion-body-color);font-size:var(--gl-font-size-sm);line-height:1.6}.glass-badge{display:inline-flex;align-items:center;gap:var(--gl-space-2xs);padding:var(--gl-space-2xs) var(--gl-space-sm);background:var(--gl-surface-3);backdrop-filter:blur(var(--gl-blur-soft));-webkit-backdrop-filter:blur(var(--gl-blur-soft));border:1px solid var(--gl-border-subtle);border-radius:var(--gl-radius-full);font-size:var(--gl-font-size-xs);font-weight:var(--gl-font-weight-medium);color:var(--gl-color-text);box-shadow:var(--gl-inset-subtle)}.glass-badge--primary{background:linear-gradient(135deg,rgba(245,166,35,.25) 0,rgba(212,105,42,.2) 100%);border-color:var(--gl-border-warm);color:var(--gl-color-primary)}.glass-badge--success{background:rgba(52,199,89,.15);border-color:rgba(52,199,89,.3);color:var(--gl-color-success)}.glass-badge--error{background:rgba(255,59,48,.15);border-color:rgba(255,59,48,.3);color:var(--gl-color-error)}.glass-divider{height:1px;border:none;background:linear-gradient(90deg,transparent 0,var(--gl-border-subtle) 20%,var(--gl-border-medium) 50%,var(--gl-border-subtle) 80%,transparent 100%)}.glass-avatar{width:44px;height:44px;border-radius:var(--gl-radius-pill);background:var(--gl-surface-3);backdrop-filter:blur(var(--gl-blur-soft));-webkit-backdrop-filter:blur(var(--gl-blur-soft));border:1.5px solid var(--gl-border-strong);display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:var(--gl-shadow-glow),var(--gl-inset-medium);flex-shrink:0;font-size:var(--gl-font-size-btn);font-weight:var(--gl-font-weight-semibold);color:var(--gl-color-text)}.glass-avatar img{width:100%;height:100%;object-fit:cover}.glass-avatar--sm{width:32px;height:32px;font-size:var(--gl-font-size-xs)}.glass-avatar--lg{width:56px;height:56px;font-size:var(--gl-font-size-lg)}.glass-theme-toggle{width:46px;height:46px;border-radius:var(--gl-radius-pill);background:var(--gl-surface-3);backdrop-filter:blur(var(--gl-blur));-webkit-backdrop-filter:blur(var(--gl-blur));border:1.5px solid var(--gl-border-strong);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--gl-transition);box-shadow:var(--gl-shadow-glow),var(--gl-inset-medium);outline:0;-webkit-tap-highlight-color:transparent}.glass-theme-toggle:hover{background:var(--gl-surface-5);transform:scale(1.05)}.glass-theme-toggle:active{transform:scale(.95)}.glass-theme-toggle svg{width:20px;height:20px;fill:none;stroke:var(--gl-color-text);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.glass-theme-toggle .icon-sun{display:none}.glass-theme-toggle .icon-moon,[data-theme=light] .glass-theme-toggle .icon-sun{display:block}[data-theme=light] .glass-theme-toggle .icon-moon{display:none}.gl-stack{display:flex;flex-direction:column}.gl-row{display:flex;flex-direction:row;align-items:center}.gl-stack--2xs{gap:var(--gl-space-2xs)}.gl-stack--xs{gap:var(--gl-space-xs)}.gl-stack--sm{gap:var(--gl-space-sm)}.gl-stack--md{gap:var(--gl-space-md)}.gl-stack--lg{gap:var(--gl-space-lg)}.gl-stack--xl{gap:var(--gl-space-xl)}.gl-row--xs{gap:var(--gl-space-xs)}.gl-row--sm{gap:var(--gl-space-sm)}.gl-row--md{gap:var(--gl-space-md)}.gl-text-center{text-align:center}.gl-text-muted{color:var(--gl-color-text-muted)}.gl-text-sm{font-size:var(--gl-font-size-sm)}.gl-mt-sm{margin-top:var(--gl-space-sm)}.gl-mt-md{margin-top:var(--gl-space-md)}.gl-mt-lg{margin-top:var(--gl-space-lg)}.gl-mt-xl{margin-top:var(--gl-space-xl)}.gl-mb-sm{margin-bottom:var(--gl-space-sm)}.gl-mb-md{margin-bottom:var(--gl-space-md)}.gl-mb-lg{margin-bottom:var(--gl-space-lg)}.gl-mb-xl{margin-bottom:var(--gl-space-xl)}.gl-px{padding-left:var(--gl-space-lg);padding-right:var(--gl-space-lg)}.gl-w-full{width:100%}.gl-flex-1{flex:1}\n/*# sourceMappingURL=glasskit.min.css.map */");const s=new Set;function a(){return document.documentElement.getAttribute("data-theme")||"dark"}if("undefined"!=typeof window&&"undefined"!=typeof MutationObserver){new MutationObserver(function(){const t=a();for(const e of s)e._syncTheme(t)}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}const r=new CSSStyleSheet;r.replaceSync("\n :host { display: block; }\n :host([hidden]) { display: none; }\n .glk-wrapper { display: contents; }\n");const i=new CSSStyleSheet;i.replaceSync("\n :host { display: inline-block; }\n :host([hidden]) { display: none; }\n .glk-wrapper { display: contents; }\n");class l extends HTMLElement{static get displayInline(){return!1}static get observedAttributes(){return[]}constructor(){super(),this._initialized=!1,this._shadow=this.attachShadow({mode:"open"});const t=this.constructor.displayInline?i:r;this._shadow.adoptedStyleSheets=[e,t]}connectedCallback(){this._initialized||(this._initialized=!0,this._wrapper=document.createElement("div"),this._wrapper.className="glk-wrapper",this._wrapper.setAttribute("data-theme",a()),this._shadow.appendChild(this._wrapper),this.render(),this.setupEvents(),s.add(this))}disconnectedCallback(){s.delete(this),this.teardownEvents()}attributeChangedCallback(t,e,s){this._initialized&&e!==s&&this.onAttributeChanged(t,e,s)}_syncTheme(t){this._wrapper&&this._wrapper.setAttribute("data-theme",t)}render(){}setupEvents(){}teardownEvents(){}onAttributeChanged(t,e,s){}getBoolAttr(t){return this.hasAttribute(t)}setBoolAttr(t,e){e?this.setAttribute(t,""):this.removeAttribute(t)}createElement(t,e=[],s={}){const a=document.createElement(t);e.length&&a.classList.add(...e);for(const[t,e]of Object.entries(s))a.setAttribute(t,e);return a}emit(t,e=null){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}}class n extends l{static formAssociated=!0;constructor(){super(),this._internals=this.attachInternals()}get form(){return this._internals.form}get validationMessage(){return this._internals.validationMessage}get validity(){return this._internals.validity}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.resetValue()}formStateRestoreCallback(t,e){this.restoreValue(t)}resetValue(){}restoreValue(t){}setFormValue(t){this._internals.setFormValue(t)}setValidity(t,e,s){this._internals.setValidity(t,e,s)}}class o extends l{render(){const t=this.createElement("nav",["glass-nav"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("glk-nav",o);class g extends l{static get observedAttributes(){return["label","disabled"]}render(){this._btn=this.createElement("button",["glass-pill"]),this.getBoolAttr("disabled")&&(this._btn.disabled=!0);const t=this.getAttribute("label");t&&this._btn.setAttribute("aria-label",t),this._btn.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._btn)}setupEvents(){this._onClick=()=>{this.getBoolAttr("disabled")||this.emit("glk-click")},this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(t){if(this._btn)switch(t){case"label":this._btn.setAttribute("aria-label",this.getAttribute("label")||"");break;case"disabled":this._btn.disabled=this.getBoolAttr("disabled")}}}customElements.define("glk-pill",g);class d extends l{render(){const t=this.createElement("nav",["glass-tab-bar"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}setupEvents(){this._onTabSelect=t=>{this.querySelectorAll("glk-tab-item").forEach(e=>{e!==t.target&&e.removeAttribute("active")}),this.emit("glk-tab-change",{tab:t.target})},this.addEventListener("glk-tab-select",this._onTabSelect)}teardownEvents(){this.removeEventListener("glk-tab-select",this._onTabSelect)}}customElements.define("glk-tab-bar",d);class c extends l{static get observedAttributes(){return["label","active","badge"]}render(){this._btn=this.createElement("button",["glass-tab-bar__item"]),this.getBoolAttr("active")&&this._btn.classList.add("is-active"),this._iconEl=this.createElement("span",["glass-tab-bar__icon"]),this._iconEl.appendChild(document.createElement("slot")),this._labelEl=this.createElement("span",["glass-tab-bar__label"]),this._labelEl.textContent=this.getAttribute("label")||"",this._btn.appendChild(this._iconEl),this._btn.appendChild(this._labelEl);const t=this.getAttribute("badge");t&&(this._badgeEl=this.createElement("span",["glass-tab-bar__badge"]),this._badgeEl.textContent=t,this._btn.appendChild(this._badgeEl)),this._wrapper.appendChild(this._btn)}setupEvents(){this._onClick=()=>{this.setAttribute("active",""),this.emit("glk-tab-select")},this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(t){if(this._btn)switch(t){case"active":this._btn.classList.toggle("is-active",this.getBoolAttr("active"));break;case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"badge":{const t=this.getAttribute("badge");t?(this._badgeEl||(this._badgeEl=this.createElement("span",["glass-tab-bar__badge"]),this._btn.appendChild(this._badgeEl)),this._badgeEl.textContent=t):this._badgeEl&&(this._badgeEl.remove(),this._badgeEl=null);break}}}}customElements.define("glk-tab-item",c);class h extends l{static get observedAttributes(){return["glow"]}render(){this._card=this.createElement("div",this._computeClasses()),this._card.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._card)}onAttributeChanged(t){"glow"===t&&this._card&&(this._card.className=this._computeClasses().join(" "))}_computeClasses(){const t=["glass-card"];return this.getBoolAttr("glow")&&t.push("glass-card--glow"),t}get glow(){return this.getBoolAttr("glow")}set glow(t){this.setBoolAttr("glow",t)}}customElements.define("glk-card",h);const u=["primary","success","error"];class b extends l{static get displayInline(){return!0}static get observedAttributes(){return["variant"]}render(){this._badge=this.createElement("span",this._computeClasses()),this._badge.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._badge)}onAttributeChanged(t){"variant"===t&&this._badge&&(this._badge.className=this._computeClasses().join(" "))}_computeClasses(){const t=["glass-badge"],e=this.getAttribute("variant");return e&&u.includes(e)&&t.push(`glass-badge--${e}`),t}get variant(){return this.getAttribute("variant")}set variant(t){this.setAttribute("variant",t)}}customElements.define("glk-badge",b);const p=["sm","lg"];class v extends l{static get displayInline(){return!0}static get observedAttributes(){return["size","src","alt"]}render(){this._avatar=this.createElement("div",this._computeClasses()),this._updateContent(),this._wrapper.appendChild(this._avatar)}onAttributeChanged(t){this._avatar&&("size"===t?this._avatar.className=this._computeClasses().join(" "):"src"!==t&&"alt"!==t||this._updateContent())}_updateContent(){const t=this.getAttribute("src");if(this._avatar.innerHTML="",t){const e=this.createElement("img",[],{src:t,alt:this.getAttribute("alt")||""});this._avatar.appendChild(e)}else this._avatar.appendChild(document.createElement("slot"))}_computeClasses(){const t=["glass-avatar"],e=this.getAttribute("size");return e&&p.includes(e)&&t.push(`glass-avatar--${e}`),t}get size(){return this.getAttribute("size")}set size(t){this.setAttribute("size",t)}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t)}}customElements.define("glk-avatar",v);class m extends l{static get observedAttributes(){return[]}render(){const t=this.createElement("div",["glass-title"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("glk-title",m);class _ extends l{render(){const t=this.createElement("div",["glass-divider"]);this._wrapper.appendChild(t)}}customElements.define("glk-divider",_);class x extends l{static get observedAttributes(){return["message"]}render(){this._container=this.createElement("div",["glass-status"]),this._iconSlot=this.createElement("span",[]),this._iconSlot.appendChild(this.createElement("slot",[],{name:"icon"})),this._messageEl=this.createElement("p",[]),this._messageEl.textContent=this.getAttribute("message")||"",this._container.appendChild(this._iconSlot),this._container.appendChild(this._messageEl),this._wrapper.appendChild(this._container)}onAttributeChanged(t){"message"===t&&this._messageEl&&(this._messageEl.textContent=this.getAttribute("message")||"")}get message(){return this.getAttribute("message")}set message(t){this.setAttribute("message",t)}}customElements.define("glk-status",x);const f=["primary","secondary","tertiary"],k=["sm","md","lg","auto"];class w extends l{static get observedAttributes(){return["variant","size","disabled","type"]}render(){this._btn=this.createElement("button",this._computeClasses(),{type:this.getAttribute("type")||"button"}),this.getBoolAttr("disabled")&&(this._btn.disabled=!0),this._btn.appendChild(document.createElement("slot")),this._wrapper.appendChild(this._btn)}setupEvents(){this._onClick=t=>{if(this.getBoolAttr("disabled"))return t.preventDefault(),void t.stopPropagation();this.emit("glk-click")},this._btn.addEventListener("click",this._onClick)}teardownEvents(){this._btn?.removeEventListener("click",this._onClick)}onAttributeChanged(t){if(this._btn)switch(t){case"variant":case"size":this._btn.className=this._computeClasses().join(" ");break;case"disabled":this._btn.disabled=this.getBoolAttr("disabled");break;case"type":this._btn.setAttribute("type",this.getAttribute("type")||"button")}}_computeClasses(){const t=["glass-btn"],e=this.getAttribute("variant");e&&f.includes(e)&&t.push(`glass-btn--${e}`);const s=this.getAttribute("size");return s&&k.includes(s)&&t.push(`glass-btn--${s}`),t}get variant(){return this.getAttribute("variant")}set variant(t){this.setAttribute("variant",t)}get size(){return this.getAttribute("size")}set size(t){this.setAttribute("size",t)}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}}customElements.define("glk-button",w);class A extends n{static get observedAttributes(){return["label","type","placeholder","error","hint","disabled","name","value","required"]}render(){const t=this.createElement("div",["glass-input-group"]);this._labelEl=this.createElement("label",["glass-label"]),this._labelEl.textContent=this.getAttribute("label")||"",this._input=this.createElement("input",this._computeInputClasses(),{type:this.getAttribute("type")||"text"});const e=this.getAttribute("placeholder");e&&this._input.setAttribute("placeholder",e);const s=this.getAttribute("name");s&&this._input.setAttribute("name",s);const a=this.getAttribute("value");a&&(this._input.value=a),this.getBoolAttr("disabled")&&(this._input.disabled=!0),this.getBoolAttr("required")&&(this._input.required=!0),this._hintEl=this.createElement("span",this._computeHintClasses()),this._hintEl.textContent=this.getAttribute("hint")||"",t.appendChild(this._labelEl),t.appendChild(this._input),this.getAttribute("hint")&&t.appendChild(this._hintEl),this._group=t,this._wrapper.appendChild(t),this._syncFormValue()}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("glk-input",{value:this._input.value}),this.dispatchEvent(new Event("input",{bubbles:!0}))},this._onChangeNative=()=>{this.emit("glk-change",{value:this._input.value}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("input",this._onInput),this._input.addEventListener("change",this._onChangeNative)}teardownEvents(){this._input?.removeEventListener("input",this._onInput),this._input?.removeEventListener("change",this._onChangeNative)}onAttributeChanged(t){if(this._input)switch(t){case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"type":this._input.setAttribute("type",this.getAttribute("type")||"text");break;case"placeholder":this._input.setAttribute("placeholder",this.getAttribute("placeholder")||"");break;case"error":this._input.className=this._computeInputClasses().join(" "),this._hintEl.className=this._computeHintClasses().join(" ");break;case"hint":this._hintEl.textContent=this.getAttribute("hint")||"",this.getAttribute("hint")&&!this._hintEl.parentNode&&this._group.appendChild(this._hintEl);break;case"disabled":this._input.disabled=this.getBoolAttr("disabled");break;case"name":this._input.setAttribute("name",this.getAttribute("name")||"");break;case"value":this._input.value=this.getAttribute("value")||"",this._syncFormValue();break;case"required":this._input.required=this.getBoolAttr("required")}}_computeInputClasses(){const t=["glass-input"];return this.getBoolAttr("error")&&t.push("glass-input--error"),t}_computeHintClasses(){const t=["glass-hint"];return this.getBoolAttr("error")&&t.push("glass-hint--error"),t}_syncFormValue(){this.setFormValue(this._input.value)}resetValue(){this._input.value=this.getAttribute("value")||"",this._syncFormValue()}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t),this._syncFormValue()}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}}customElements.define("glk-input",A);class y extends n{static get observedAttributes(){return["label","placeholder","rows","disabled","name","value","required"]}render(){const t=this.createElement("div",["glass-input-group"]);this._labelEl=this.createElement("label",["glass-label"]),this._labelEl.textContent=this.getAttribute("label")||"",this._textarea=this.createElement("textarea",["glass-textarea"]);const e=this.getAttribute("placeholder");e&&this._textarea.setAttribute("placeholder",e);const s=this.getAttribute("rows");s&&this._textarea.setAttribute("rows",s);const a=this.getAttribute("name");a&&this._textarea.setAttribute("name",a);const r=this.getAttribute("value");r&&(this._textarea.value=r),this.getBoolAttr("disabled")&&(this._textarea.disabled=!0),this.getBoolAttr("required")&&(this._textarea.required=!0),t.appendChild(this._labelEl),t.appendChild(this._textarea),this._wrapper.appendChild(t),this._syncFormValue()}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("glk-input",{value:this._textarea.value}),this.dispatchEvent(new Event("input",{bubbles:!0}))},this._textarea.addEventListener("input",this._onInput)}teardownEvents(){this._textarea?.removeEventListener("input",this._onInput)}onAttributeChanged(t){if(this._textarea)switch(t){case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"placeholder":this._textarea.setAttribute("placeholder",this.getAttribute("placeholder")||"");break;case"rows":this._textarea.setAttribute("rows",this.getAttribute("rows")||"");break;case"disabled":this._textarea.disabled=this.getBoolAttr("disabled");break;case"name":this._textarea.setAttribute("name",this.getAttribute("name")||"");break;case"value":this._textarea.value=this.getAttribute("value")||"",this._syncFormValue()}}_syncFormValue(){this.setFormValue(this._textarea.value)}resetValue(){this._textarea.value=this.getAttribute("value")||"",this._syncFormValue()}get value(){return this._textarea?.value??""}set value(t){this._textarea&&(this._textarea.value=t),this._syncFormValue()}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}}customElements.define("glk-textarea",y);class E extends n{static get observedAttributes(){return["label","disabled","name","value","required"]}render(){const t=this.createElement("div",["glass-input-group"]);this._labelEl=this.createElement("label",["glass-label"]),this._labelEl.textContent=this.getAttribute("label")||"",this._select=this.createElement("select",["glass-select"]);const e=this.getAttribute("name");e&&this._select.setAttribute("name",e),this.getBoolAttr("disabled")&&(this._select.disabled=!0),this.getBoolAttr("required")&&(this._select.required=!0),this._moveOptions(),t.appendChild(this._labelEl),t.appendChild(this._select),this._wrapper.appendChild(t);const s=this.getAttribute("value");s&&(this._select.value=s),this._syncFormValue()}_moveOptions(){this.querySelectorAll("option").forEach(t=>{this._select.appendChild(t.cloneNode(!0))})}setupEvents(){this._onChange=()=>{this._syncFormValue(),this.emit("glk-change",{value:this._select.value}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._select.addEventListener("change",this._onChange)}teardownEvents(){this._select?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(this._select)switch(t){case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"disabled":this._select.disabled=this.getBoolAttr("disabled");break;case"name":this._select.setAttribute("name",this.getAttribute("name")||"");break;case"value":this._select.value=this.getAttribute("value")||"",this._syncFormValue()}}_syncFormValue(){this.setFormValue(this._select.value)}resetValue(){this._select.selectedIndex=0,this._syncFormValue()}get value(){return this._select?.value??""}set value(t){this._select&&(this._select.value=t),this._syncFormValue()}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}}customElements.define("glk-select",E);class C extends n{static get observedAttributes(){return["placeholder","name","value","disabled"]}render(){const t=this.createElement("div",["glass-search"]),e=this.createElement("span",["glass-search__icon"]);e.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',this._input=this.createElement("input",["glass-input"],{type:"search"});const s=this.getAttribute("placeholder");s&&this._input.setAttribute("placeholder",s);const a=this.getAttribute("name");a&&this._input.setAttribute("name",a);const r=this.getAttribute("value");r&&(this._input.value=r),this.getBoolAttr("disabled")&&(this._input.disabled=!0),t.appendChild(e),t.appendChild(this._input),this._wrapper.appendChild(t),this._syncFormValue()}setupEvents(){this._onInput=()=>{this._syncFormValue(),this.emit("glk-input",{value:this._input.value}),this.dispatchEvent(new Event("input",{bubbles:!0}))},this._input.addEventListener("input",this._onInput)}teardownEvents(){this._input?.removeEventListener("input",this._onInput)}onAttributeChanged(t){if(this._input)switch(t){case"placeholder":this._input.setAttribute("placeholder",this.getAttribute("placeholder")||"");break;case"name":this._input.setAttribute("name",this.getAttribute("name")||"");break;case"value":this._input.value=this.getAttribute("value")||"",this._syncFormValue();break;case"disabled":this._input.disabled=this.getBoolAttr("disabled")}}_syncFormValue(){this.setFormValue(this._input.value)}resetValue(){this._input.value=this.getAttribute("value")||"",this._syncFormValue()}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t),this._syncFormValue()}}customElements.define("glk-search",C);class z extends n{static get observedAttributes(){return["checked","disabled","label","name","value"]}render(){const t=this.createElement("label",["glass-toggle"]);this._input=this.createElement("input",["glass-toggle__input"],{type:"checkbox"});const e=this.getAttribute("name");e&&this._input.setAttribute("name",e);const s=this.createElement("span",["glass-toggle__track"]),a=this.createElement("span",["glass-toggle__thumb"]);s.appendChild(a),this._labelEl=this.createElement("span",["glass-toggle__label"]),this._labelEl.textContent=this.getAttribute("label")||"",t.appendChild(this._input),t.appendChild(s),t.appendChild(this._labelEl),this.getBoolAttr("checked")&&(this._input.checked=!0),this.getBoolAttr("disabled")&&(this._input.disabled=!0),this._defaultChecked=this.getBoolAttr("checked"),this._wrapper.appendChild(t),this._syncFormValue(),this.setAttribute("role","switch"),this.setAttribute("aria-checked",String(this._input.checked)),this.getBoolAttr("disabled")&&this.setAttribute("aria-disabled","true")}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this.setAttribute("aria-checked",String(this._input.checked)),this._syncFormValue(),this.emit("glk-change",{checked:this._input.checked}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(!this._syncing&&this._input)switch(t){case"checked":this._input.checked=this.getBoolAttr("checked"),this.setAttribute("aria-checked",String(this._input.checked)),this._syncFormValue();break;case"disabled":this._input.disabled=this.getBoolAttr("disabled"),this.setAttribute("aria-disabled",String(this.getBoolAttr("disabled")));break;case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"name":this._input.setAttribute("name",this.getAttribute("name")||"")}}_syncFormValue(){const t=this.getAttribute("value")||"on";this.setFormValue(this._input.checked?t:null)}resetValue(){this._input.checked=this._defaultChecked,this.setBoolAttr("checked",this._defaultChecked),this.setAttribute("aria-checked",String(this._defaultChecked)),this._syncFormValue()}restoreValue(t){t&&(this._input.checked=!0,this.setBoolAttr("checked",!0))}get checked(){return this._input?.checked??!1}set checked(t){this._input&&(this._input.checked=t),this.setBoolAttr("checked",t),this.setAttribute("aria-checked",String(t)),this._syncFormValue()}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}get label(){return this.getAttribute("label")}set label(t){this.setAttribute("label",t)}}customElements.define("glk-toggle",z);class B extends n{static get observedAttributes(){return["checked","disabled","label","name","value"]}render(){const t=this.createElement("label",["glass-checkbox"]);this._input=this.createElement("input",["glass-checkbox__input"],{type:"checkbox"});const e=this.getAttribute("name");e&&this._input.setAttribute("name",e);const s=this.createElement("span",["glass-checkbox__box"]);s.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',this._labelEl=this.createElement("span",["glass-checkbox__label"]),this._labelEl.textContent=this.getAttribute("label")||"",t.appendChild(this._input),t.appendChild(s),t.appendChild(this._labelEl),this.getBoolAttr("checked")&&(this._input.checked=!0),this.getBoolAttr("disabled")&&(this._input.disabled=!0),this._defaultChecked=this.getBoolAttr("checked"),this._wrapper.appendChild(t),this._syncFormValue()}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this._syncFormValue(),this.emit("glk-change",{checked:this._input.checked}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(!this._syncing&&this._input)switch(t){case"checked":this._input.checked=this.getBoolAttr("checked"),this._syncFormValue();break;case"disabled":this._input.disabled=this.getBoolAttr("disabled");break;case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"name":this._input.setAttribute("name",this.getAttribute("name")||"")}}_syncFormValue(){const t=this.getAttribute("value")||"on";this.setFormValue(this._input.checked?t:null)}resetValue(){this._input.checked=this._defaultChecked,this.setBoolAttr("checked",this._defaultChecked),this._syncFormValue()}get checked(){return this._input?.checked??!1}set checked(t){this._input&&(this._input.checked=t),this.setBoolAttr("checked",t),this._syncFormValue()}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")||"on"}set value(t){this.setAttribute("value",t)}}customElements.define("glk-checkbox",B);class V extends n{static get observedAttributes(){return["checked","disabled","label","name","value"]}render(){const t=this.createElement("label",["glass-radio"]);this._input=this.createElement("input",["glass-radio__input"],{type:"radio"});const e=this.getAttribute("name");e&&this._input.setAttribute("name",e);const s=this.getAttribute("value");s&&this._input.setAttribute("value",s);const a=this.createElement("span",["glass-radio__circle"]),r=this.createElement("span",["glass-radio__dot"]);a.appendChild(r),this._labelEl=this.createElement("span",["glass-radio__label"]),this._labelEl.textContent=this.getAttribute("label")||"",t.appendChild(this._input),t.appendChild(a),t.appendChild(this._labelEl),this.getBoolAttr("checked")&&(this._input.checked=!0),this.getBoolAttr("disabled")&&(this._input.disabled=!0),this._defaultChecked=this.getBoolAttr("checked"),this._wrapper.appendChild(t),this._syncFormValue()}setupEvents(){this._onChange=()=>{this._syncing=!0,this.setBoolAttr("checked",this._input.checked),this._syncing=!1,this._syncFormValue(),this.emit("glk-change",{checked:this._input.checked,value:this._input.value}),this.dispatchEvent(new Event("change",{bubbles:!0}))},this._input.addEventListener("change",this._onChange)}teardownEvents(){this._input?.removeEventListener("change",this._onChange)}onAttributeChanged(t){if(!this._syncing&&this._input)switch(t){case"checked":this._input.checked=this.getBoolAttr("checked"),this._syncFormValue();break;case"disabled":this._input.disabled=this.getBoolAttr("disabled");break;case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"name":this._input.setAttribute("name",this.getAttribute("name")||"");break;case"value":this._input.setAttribute("value",this.getAttribute("value")||""),this._syncFormValue()}}_syncFormValue(){const t=this.getAttribute("value")||"";this.setFormValue(this._input.checked?t:null)}resetValue(){this._input.checked=this._defaultChecked,this.setBoolAttr("checked",this._defaultChecked),this._syncFormValue()}get checked(){return this._input?.checked??!1}set checked(t){this._input&&(this._input.checked=t),this.setBoolAttr("checked",t),this._syncFormValue()}get disabled(){return this.getBoolAttr("disabled")}set disabled(t){this.setBoolAttr("disabled",t)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}}customElements.define("glk-radio",V);class F extends n{static get observedAttributes(){return["label","min","max","value","step","name","disabled"]}render(){const t=this.createElement("div",["glass-range-group"]),e=this.createElement("div",["glass-range-header"]);this._labelEl=this.createElement("label",[]),this._labelEl.textContent=this.getAttribute("label")||"",this._valueEl=this.createElement("span",["glass-range-value"]),e.appendChild(this._labelEl),e.appendChild(this._valueEl),this._input=this.createElement("input",["glass-range"],{type:"range",min:this.getAttribute("min")||"0",max:this.getAttribute("max")||"100",value:this.getAttribute("value")||"50"});const s=this.getAttribute("step");s&&this._input.setAttribute("step",s);const a=this.getAttribute("name");a&&this._input.setAttribute("name",a),this.getBoolAttr("disabled")&&(this._input.disabled=!0),this._updateValueDisplay(),t.appendChild(e),t.appendChild(this._input),this._wrapper.appendChild(t),this._defaultValue=this._input.value,this._syncFormValue()}setupEvents(){this._onInput=()=>{this._updateValueDisplay(),this._syncFormValue(),this.emit("glk-input",{value:this._input.value}),this.dispatchEvent(new Event("input",{bubbles:!0}))},this._input.addEventListener("input",this._onInput)}teardownEvents(){this._input?.removeEventListener("input",this._onInput)}onAttributeChanged(t){if(this._input)switch(t){case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"min":this._input.min=this.getAttribute("min")||"0";break;case"max":this._input.max=this.getAttribute("max")||"100";break;case"value":this._input.value=this.getAttribute("value")||"50",this._updateValueDisplay(),this._syncFormValue();break;case"step":this._input.step=this.getAttribute("step")||"";break;case"name":this._input.setAttribute("name",this.getAttribute("name")||"");break;case"disabled":this._input.disabled=this.getBoolAttr("disabled")}}_updateValueDisplay(){this._valueEl.textContent=`${this._input.value}%`}_syncFormValue(){this.setFormValue(this._input.value)}resetValue(){this._input.value=this._defaultValue,this._updateValueDisplay(),this._syncFormValue()}get value(){return this._input?.value??""}set value(t){this._input&&(this._input.value=t),this._updateValueDisplay(),this._syncFormValue()}}customElements.define("glk-range",F);const L=["success","error"],S=["sm","lg"];class j extends l{static get observedAttributes(){return["value","label","variant","size"]}render(){this._container=this.createElement("div",this._computeClasses());const t=this.createElement("div",["glass-progress__header"]);this._labelEl=this.createElement("span",["glass-progress__label"]),this._labelEl.textContent=this.getAttribute("label")||"",this._valueEl=this.createElement("span",["glass-progress__value"]),t.appendChild(this._labelEl),t.appendChild(this._valueEl);const e=this.createElement("div",["glass-progress__track"]);this._fill=this.createElement("div",["glass-progress__fill"]),e.appendChild(this._fill),this._container.appendChild(t),this._container.appendChild(e),this._updateValue(),this._wrapper.appendChild(this._container)}onAttributeChanged(t){if(this._container)switch(t){case"value":this._updateValue();break;case"label":this._labelEl.textContent=this.getAttribute("label")||"";break;case"variant":case"size":this._container.className=this._computeClasses().join(" ")}}_updateValue(){const t=Math.min(100,Math.max(0,parseInt(this.getAttribute("value")||"0",10)));this._fill.style.width=`${t}%`,this._valueEl.textContent=`${t}%`}_computeClasses(){const t=["glass-progress"],e=this.getAttribute("variant");e&&L.includes(e)&&t.push(`glass-progress--${e}`);const s=this.getAttribute("size");return s&&S.includes(s)&&t.push(`glass-progress--${s}`),t}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",String(t))}}customElements.define("glk-progress",j);class I extends l{static get observedAttributes(){return["open","title"]}render(){this._overlay=this.createElement("div",["glass-modal-overlay"]);const t=this.createElement("div",["glass-modal"]),e=this.createElement("div",["glass-modal__header"]);this._titleEl=this.createElement("h2",["glass-modal__title"]),this._titleEl.textContent=this.getAttribute("title")||"",e.appendChild(this._titleEl);const s=this.createElement("div",["glass-modal__body"]);s.appendChild(document.createElement("slot")),this._footer=this.createElement("div",["glass-modal__footer"]),this._populateFooter(),t.appendChild(e),t.appendChild(s),t.appendChild(this._footer),this._overlay.appendChild(t),this._wrapper.appendChild(this._overlay),this.getBoolAttr("open")&&this._overlay.classList.add("is-active")}_populateFooter(){this._footer.innerHTML="";const t=this.querySelector('[slot="actions"]');if(t){t.querySelectorAll("button").forEach(t=>{const e=t.cloneNode(!0);e.addEventListener("click",()=>t.click()),this._footer.appendChild(e)})}}setupEvents(){this._onOverlayClick=t=>{t.target===this._overlay&&(this.removeAttribute("open"),this.emit("glk-close"))},this._overlay.addEventListener("click",this._onOverlayClick),this._onKeydown=t=>{"Escape"===t.key&&this.getBoolAttr("open")&&(this.removeAttribute("open"),this.emit("glk-close"))},document.addEventListener("keydown",this._onKeydown)}teardownEvents(){this._overlay?.removeEventListener("click",this._onOverlayClick),document.removeEventListener("keydown",this._onKeydown)}onAttributeChanged(t){if(this._overlay)switch(t){case"open":this._overlay.classList.toggle("is-active",this.getBoolAttr("open"));break;case"title":this._titleEl.textContent=this.getAttribute("title")||""}}show(){this.setAttribute("open","")}close(){this.removeAttribute("open")}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}}customElements.define("glk-modal",I);const T=["success","error","warning"],G={success:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>',error:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',warning:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>'};class M extends l{static get observedAttributes(){return["message","variant","duration","visible"]}render(){this._toast=this.createElement("div",this._computeClasses()),this._iconEl=this.createElement("span",["glass-toast__icon"]),this._textEl=this.createElement("span",["glass-toast__text"]),this._textEl.textContent=this.getAttribute("message")||"",this._updateIcon(),this._toast.appendChild(this._iconEl),this._toast.appendChild(this._textEl),this._wrapper.appendChild(this._toast),this.getBoolAttr("visible")&&this._show()}onAttributeChanged(t){if(this._toast)switch(t){case"message":this._textEl.textContent=this.getAttribute("message")||"";break;case"variant":this._toast.className=this._computeClasses().join(" "),this._updateIcon();break;case"visible":this.getBoolAttr("visible")?this._show():this._hide()}}_computeClasses(){const t=["glass-toast"],e=this.getAttribute("variant");return e&&T.includes(e)&&t.push(`glass-toast--${e}`),t}_updateIcon(){const t=this.getAttribute("variant");this._iconEl.innerHTML=G[t]||G.success}_show(){this._toast.classList.add("is-visible");const t=parseInt(this.getAttribute("duration")||"3000",10);t>0&&(clearTimeout(this._timer),this._timer=setTimeout(()=>{this.removeAttribute("visible"),this.emit("glk-dismiss")},t))}_hide(){this._toast.classList.remove("is-visible"),clearTimeout(this._timer)}show(t,e,s){t&&this.setAttribute("message",t),e&&this.setAttribute("variant",e),s&&this.setAttribute("duration",String(s)),this.setAttribute("visible","")}dismiss(){this.removeAttribute("visible")}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._timer)}}customElements.define("glk-toast",M);class N extends l{render(){const t=this.createElement("div",["glass-accordion"]);t.appendChild(document.createElement("slot")),this._wrapper.appendChild(t)}}customElements.define("glk-accordion",N);class q extends l{static get observedAttributes(){return["title","open"]}render(){this._item=this.createElement("div",["glass-accordion__item"]),this.getBoolAttr("open")&&this._item.classList.add("is-open"),this._trigger=this.createElement("button",["glass-accordion__trigger"]),this._triggerText=document.createTextNode(this.getAttribute("title")||""),this._trigger.appendChild(this._triggerText),this._trigger.insertAdjacentHTML("beforeend",'<span class="glass-accordion__trigger-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="6 9 12 15 18 9"/></svg></span>'),this._content=this.createElement("div",["glass-accordion__content"]);const t=this.createElement("div",["glass-accordion__body"]);t.appendChild(document.createElement("slot")),this._content.appendChild(t),this._item.appendChild(this._trigger),this._item.appendChild(this._content),this._wrapper.appendChild(this._item)}setupEvents(){this._onClick=()=>{this.setBoolAttr("open",!this.getBoolAttr("open")),this.emit("glk-toggle",{open:this.getBoolAttr("open")})},this._trigger.addEventListener("click",this._onClick)}teardownEvents(){this._trigger?.removeEventListener("click",this._onClick)}onAttributeChanged(t){if(this._item)switch(t){case"open":this._item.classList.toggle("is-open",this.getBoolAttr("open"));break;case"title":this._triggerText.textContent=this.getAttribute("title")||""}}get open(){return this.getBoolAttr("open")}set open(t){this.setBoolAttr("open",t)}}return customElements.define("glk-accordion-item",q),t.GlkAccordion=N,t.GlkAccordionItem=q,t.GlkAvatar=v,t.GlkBadge=b,t.GlkButton=w,t.GlkCard=h,t.GlkCheckbox=B,t.GlkDivider=_,t.GlkInput=A,t.GlkModal=I,t.GlkNav=o,t.GlkPill=g,t.GlkProgress=j,t.GlkRadio=V,t.GlkRange=F,t.GlkSearch=C,t.GlkSelect=E,t.GlkStatus=x,t.GlkTabBar=d,t.GlkTabItem=c,t.GlkTextarea=y,t.GlkTitle=m,t.GlkToast=M,t.GlkToggle=z,t}({});
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jungherz-de/glasskit-elements",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Vanilla JavaScript Web Components wrapping the GlassKit CSS glassmorphism library",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/glasskit-elements.js",
|
|
8
|
+
"module": "dist/glasskit-elements.esm.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/glasskit-elements.esm.js",
|
|
12
|
+
"default": "./dist/glasskit-elements.js"
|
|
13
|
+
},
|
|
14
|
+
"./components/*": "./dist/components/*.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"src/",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rollup -c",
|
|
23
|
+
"dev": "rollup -c --watch",
|
|
24
|
+
"serve": "npx serve ."
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"web-components",
|
|
28
|
+
"custom-elements",
|
|
29
|
+
"glassmorphism",
|
|
30
|
+
"glasskit",
|
|
31
|
+
"ui-components",
|
|
32
|
+
"vanilla-js"
|
|
33
|
+
],
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@jungherz-de/glasskit": ">=1.3.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@jungherz-de/glasskit": "^1.3.0",
|
|
39
|
+
"rollup": "^4.0.0",
|
|
40
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
41
|
+
"@rollup/plugin-terser": "^0.4.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/base.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { glassSheet } from '@jungherz-de/glasskit/glasskit-styles.js';
|
|
2
|
+
|
|
3
|
+
// ── Global Theme Sync ──
|
|
4
|
+
// Single MutationObserver that watches data-theme on <html>
|
|
5
|
+
// and notifies all GlkElement instances.
|
|
6
|
+
|
|
7
|
+
const instances = new Set();
|
|
8
|
+
|
|
9
|
+
function getCurrentTheme() {
|
|
10
|
+
return document.documentElement.getAttribute('data-theme') || 'dark';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function syncAllThemes() {
|
|
14
|
+
const theme = getCurrentTheme();
|
|
15
|
+
for (const instance of instances) {
|
|
16
|
+
instance._syncTheme(theme);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof window !== 'undefined' && typeof MutationObserver !== 'undefined') {
|
|
21
|
+
const observer = new MutationObserver(syncAllThemes);
|
|
22
|
+
observer.observe(document.documentElement, {
|
|
23
|
+
attributes: true,
|
|
24
|
+
attributeFilter: ['data-theme']
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ── Host Stylesheet ──
|
|
29
|
+
// Sets display:block on all custom elements by default.
|
|
30
|
+
// Inline components (badge, avatar) override this.
|
|
31
|
+
|
|
32
|
+
const hostSheet = new CSSStyleSheet();
|
|
33
|
+
hostSheet.replaceSync(`
|
|
34
|
+
:host { display: block; }
|
|
35
|
+
:host([hidden]) { display: none; }
|
|
36
|
+
.glk-wrapper { display: contents; }
|
|
37
|
+
`);
|
|
38
|
+
|
|
39
|
+
const inlineHostSheet = new CSSStyleSheet();
|
|
40
|
+
inlineHostSheet.replaceSync(`
|
|
41
|
+
:host { display: inline-block; }
|
|
42
|
+
:host([hidden]) { display: none; }
|
|
43
|
+
.glk-wrapper { display: contents; }
|
|
44
|
+
`);
|
|
45
|
+
|
|
46
|
+
// ── Base Class ──
|
|
47
|
+
|
|
48
|
+
export class GlkElement extends HTMLElement {
|
|
49
|
+
|
|
50
|
+
/** Override in subclass to use inline-block display */
|
|
51
|
+
static get displayInline() { return false; }
|
|
52
|
+
|
|
53
|
+
static get observedAttributes() {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
constructor() {
|
|
58
|
+
super();
|
|
59
|
+
this._initialized = false;
|
|
60
|
+
this._shadow = this.attachShadow({ mode: 'open' });
|
|
61
|
+
const displaySheet = this.constructor.displayInline ? inlineHostSheet : hostSheet;
|
|
62
|
+
this._shadow.adoptedStyleSheets = [glassSheet, displaySheet];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
connectedCallback() {
|
|
66
|
+
if (!this._initialized) {
|
|
67
|
+
this._initialized = true;
|
|
68
|
+
|
|
69
|
+
// Create theme wrapper (display:contents makes it layout-transparent)
|
|
70
|
+
this._wrapper = document.createElement('div');
|
|
71
|
+
this._wrapper.className = 'glk-wrapper';
|
|
72
|
+
this._wrapper.setAttribute('data-theme', getCurrentTheme());
|
|
73
|
+
this._shadow.appendChild(this._wrapper);
|
|
74
|
+
|
|
75
|
+
this.render();
|
|
76
|
+
this.setupEvents();
|
|
77
|
+
|
|
78
|
+
// Register for theme sync
|
|
79
|
+
instances.add(this);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
instances.delete(this);
|
|
85
|
+
this.teardownEvents();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
89
|
+
if (!this._initialized) return;
|
|
90
|
+
if (oldValue === newValue) return;
|
|
91
|
+
this.onAttributeChanged(name, oldValue, newValue);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
_syncTheme(theme) {
|
|
95
|
+
if (this._wrapper) {
|
|
96
|
+
this._wrapper.setAttribute('data-theme', theme);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Subclasses override to build inner DOM inside this._wrapper. */
|
|
101
|
+
render() {}
|
|
102
|
+
|
|
103
|
+
/** Subclasses override to attach event listeners. */
|
|
104
|
+
setupEvents() {}
|
|
105
|
+
|
|
106
|
+
/** Subclasses override to remove event listeners. */
|
|
107
|
+
teardownEvents() {}
|
|
108
|
+
|
|
109
|
+
/** Subclasses override to react to attribute changes. */
|
|
110
|
+
onAttributeChanged(name, oldValue, newValue) {}
|
|
111
|
+
|
|
112
|
+
// ── Utility Methods ──
|
|
113
|
+
|
|
114
|
+
getBoolAttr(name) {
|
|
115
|
+
return this.hasAttribute(name);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
setBoolAttr(name, value) {
|
|
119
|
+
if (value) {
|
|
120
|
+
this.setAttribute(name, '');
|
|
121
|
+
} else {
|
|
122
|
+
this.removeAttribute(name);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
createElement(tag, classes = [], attrs = {}) {
|
|
127
|
+
const el = document.createElement(tag);
|
|
128
|
+
if (classes.length) el.classList.add(...classes);
|
|
129
|
+
for (const [key, val] of Object.entries(attrs)) {
|
|
130
|
+
el.setAttribute(key, val);
|
|
131
|
+
}
|
|
132
|
+
return el;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
emit(eventName, detail = null) {
|
|
136
|
+
this.dispatchEvent(new CustomEvent(eventName, {
|
|
137
|
+
bubbles: true,
|
|
138
|
+
composed: true,
|
|
139
|
+
detail
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ── Form-Associated Base Class ──
|
|
145
|
+
|
|
146
|
+
export class GlkFormElement extends GlkElement {
|
|
147
|
+
|
|
148
|
+
static formAssociated = true;
|
|
149
|
+
|
|
150
|
+
constructor() {
|
|
151
|
+
super();
|
|
152
|
+
this._internals = this.attachInternals();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
get form() { return this._internals.form; }
|
|
156
|
+
get validationMessage() { return this._internals.validationMessage; }
|
|
157
|
+
get validity() { return this._internals.validity; }
|
|
158
|
+
|
|
159
|
+
checkValidity() { return this._internals.checkValidity(); }
|
|
160
|
+
reportValidity() { return this._internals.reportValidity(); }
|
|
161
|
+
|
|
162
|
+
formResetCallback() {
|
|
163
|
+
this.resetValue();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
formStateRestoreCallback(state, mode) {
|
|
167
|
+
this.restoreValue(state);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Subclasses override. */
|
|
171
|
+
resetValue() {}
|
|
172
|
+
restoreValue(state) {}
|
|
173
|
+
|
|
174
|
+
setFormValue(value) {
|
|
175
|
+
this._internals.setFormValue(value);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
setValidity(flags, message, anchor) {
|
|
179
|
+
this._internals.setValidity(flags, message, anchor);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { GlkElement } from '../../base.js';
|
|
2
|
+
|
|
3
|
+
const VARIANTS = ['primary', 'secondary', 'tertiary'];
|
|
4
|
+
const SIZES = ['sm', 'md', 'lg', 'auto'];
|
|
5
|
+
|
|
6
|
+
class GlkButton extends GlkElement {
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return ['variant', 'size', 'disabled', 'type'];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
this._btn = this.createElement('button', this._computeClasses(), {
|
|
13
|
+
type: this.getAttribute('type') || 'button'
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
if (this.getBoolAttr('disabled')) {
|
|
17
|
+
this._btn.disabled = true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
this._btn.appendChild(document.createElement('slot'));
|
|
21
|
+
this._wrapper.appendChild(this._btn);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
setupEvents() {
|
|
25
|
+
this._onClick = (e) => {
|
|
26
|
+
if (this.getBoolAttr('disabled')) {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.emit('glk-click');
|
|
32
|
+
};
|
|
33
|
+
this._btn.addEventListener('click', this._onClick);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
teardownEvents() {
|
|
37
|
+
this._btn?.removeEventListener('click', this._onClick);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
onAttributeChanged(name) {
|
|
41
|
+
if (!this._btn) return;
|
|
42
|
+
switch (name) {
|
|
43
|
+
case 'variant':
|
|
44
|
+
case 'size':
|
|
45
|
+
this._btn.className = this._computeClasses().join(' ');
|
|
46
|
+
break;
|
|
47
|
+
case 'disabled':
|
|
48
|
+
this._btn.disabled = this.getBoolAttr('disabled');
|
|
49
|
+
break;
|
|
50
|
+
case 'type':
|
|
51
|
+
this._btn.setAttribute('type', this.getAttribute('type') || 'button');
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_computeClasses() {
|
|
57
|
+
const classes = ['glass-btn'];
|
|
58
|
+
const variant = this.getAttribute('variant');
|
|
59
|
+
if (variant && VARIANTS.includes(variant)) {
|
|
60
|
+
classes.push(`glass-btn--${variant}`);
|
|
61
|
+
}
|
|
62
|
+
const size = this.getAttribute('size');
|
|
63
|
+
if (size && SIZES.includes(size)) {
|
|
64
|
+
classes.push(`glass-btn--${size}`);
|
|
65
|
+
}
|
|
66
|
+
return classes;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get variant() { return this.getAttribute('variant'); }
|
|
70
|
+
set variant(v) { this.setAttribute('variant', v); }
|
|
71
|
+
|
|
72
|
+
get size() { return this.getAttribute('size'); }
|
|
73
|
+
set size(v) { this.setAttribute('size', v); }
|
|
74
|
+
|
|
75
|
+
get disabled() { return this.getBoolAttr('disabled'); }
|
|
76
|
+
set disabled(v) { this.setBoolAttr('disabled', v); }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
customElements.define('glk-button', GlkButton);
|
|
80
|
+
export { GlkButton };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { GlkElement } from '../../base.js';
|
|
2
|
+
|
|
3
|
+
const CHEVRON_SVG = `<span class="glass-accordion__trigger-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="6 9 12 15 18 9"/></svg></span>`;
|
|
4
|
+
|
|
5
|
+
class GlkAccordionItem extends GlkElement {
|
|
6
|
+
static get observedAttributes() {
|
|
7
|
+
return ['title', 'open'];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
this._item = this.createElement('div', ['glass-accordion__item']);
|
|
12
|
+
if (this.getBoolAttr('open')) this._item.classList.add('is-open');
|
|
13
|
+
|
|
14
|
+
// Trigger button
|
|
15
|
+
this._trigger = this.createElement('button', ['glass-accordion__trigger']);
|
|
16
|
+
this._triggerText = document.createTextNode(this.getAttribute('title') || '');
|
|
17
|
+
this._trigger.appendChild(this._triggerText);
|
|
18
|
+
this._trigger.insertAdjacentHTML('beforeend', CHEVRON_SVG);
|
|
19
|
+
|
|
20
|
+
// Content
|
|
21
|
+
this._content = this.createElement('div', ['glass-accordion__content']);
|
|
22
|
+
const body = this.createElement('div', ['glass-accordion__body']);
|
|
23
|
+
body.appendChild(document.createElement('slot'));
|
|
24
|
+
this._content.appendChild(body);
|
|
25
|
+
|
|
26
|
+
this._item.appendChild(this._trigger);
|
|
27
|
+
this._item.appendChild(this._content);
|
|
28
|
+
|
|
29
|
+
this._wrapper.appendChild(this._item);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
setupEvents() {
|
|
33
|
+
this._onClick = () => {
|
|
34
|
+
this.setBoolAttr('open', !this.getBoolAttr('open'));
|
|
35
|
+
this.emit('glk-toggle', { open: this.getBoolAttr('open') });
|
|
36
|
+
};
|
|
37
|
+
this._trigger.addEventListener('click', this._onClick);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
teardownEvents() {
|
|
41
|
+
this._trigger?.removeEventListener('click', this._onClick);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onAttributeChanged(name) {
|
|
45
|
+
if (!this._item) return;
|
|
46
|
+
switch (name) {
|
|
47
|
+
case 'open':
|
|
48
|
+
this._item.classList.toggle('is-open', this.getBoolAttr('open'));
|
|
49
|
+
break;
|
|
50
|
+
case 'title':
|
|
51
|
+
this._triggerText.textContent = this.getAttribute('title') || '';
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get open() { return this.getBoolAttr('open'); }
|
|
57
|
+
set open(v) { this.setBoolAttr('open', v); }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
customElements.define('glk-accordion-item', GlkAccordionItem);
|
|
61
|
+
export { GlkAccordionItem };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GlkElement } from '../../base.js';
|
|
2
|
+
|
|
3
|
+
class GlkAccordion extends GlkElement {
|
|
4
|
+
render() {
|
|
5
|
+
const container = this.createElement('div', ['glass-accordion']);
|
|
6
|
+
container.appendChild(document.createElement('slot'));
|
|
7
|
+
this._wrapper.appendChild(container);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
customElements.define('glk-accordion', GlkAccordion);
|
|
12
|
+
export { GlkAccordion };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { GlkElement } from '../../base.js';
|
|
2
|
+
|
|
3
|
+
const SIZES = ['sm', 'lg'];
|
|
4
|
+
|
|
5
|
+
class GlkAvatar extends GlkElement {
|
|
6
|
+
static get displayInline() { return true; }
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return ['size', 'src', 'alt'];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
this._avatar = this.createElement('div', this._computeClasses());
|
|
13
|
+
this._updateContent();
|
|
14
|
+
this._wrapper.appendChild(this._avatar);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
onAttributeChanged(name) {
|
|
18
|
+
if (!this._avatar) return;
|
|
19
|
+
if (name === 'size') {
|
|
20
|
+
this._avatar.className = this._computeClasses().join(' ');
|
|
21
|
+
} else if (name === 'src' || name === 'alt') {
|
|
22
|
+
this._updateContent();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_updateContent() {
|
|
27
|
+
const src = this.getAttribute('src');
|
|
28
|
+
this._avatar.innerHTML = '';
|
|
29
|
+
if (src) {
|
|
30
|
+
const img = this.createElement('img', [], {
|
|
31
|
+
src,
|
|
32
|
+
alt: this.getAttribute('alt') || ''
|
|
33
|
+
});
|
|
34
|
+
this._avatar.appendChild(img);
|
|
35
|
+
} else {
|
|
36
|
+
// Use slotted text content (initials)
|
|
37
|
+
this._avatar.appendChild(document.createElement('slot'));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_computeClasses() {
|
|
42
|
+
const classes = ['glass-avatar'];
|
|
43
|
+
const size = this.getAttribute('size');
|
|
44
|
+
if (size && SIZES.includes(size)) {
|
|
45
|
+
classes.push(`glass-avatar--${size}`);
|
|
46
|
+
}
|
|
47
|
+
return classes;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get size() { return this.getAttribute('size'); }
|
|
51
|
+
set size(v) { this.setAttribute('size', v); }
|
|
52
|
+
|
|
53
|
+
get src() { return this.getAttribute('src'); }
|
|
54
|
+
set src(v) { this.setAttribute('src', v); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
customElements.define('glk-avatar', GlkAvatar);
|
|
58
|
+
export { GlkAvatar };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GlkElement } from '../../base.js';
|
|
2
|
+
|
|
3
|
+
const VARIANTS = ['primary', 'success', 'error'];
|
|
4
|
+
|
|
5
|
+
class GlkBadge extends GlkElement {
|
|
6
|
+
static get displayInline() { return true; }
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return ['variant'];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
this._badge = this.createElement('span', this._computeClasses());
|
|
13
|
+
this._badge.appendChild(document.createElement('slot'));
|
|
14
|
+
this._wrapper.appendChild(this._badge);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
onAttributeChanged(name) {
|
|
18
|
+
if (name === 'variant' && this._badge) {
|
|
19
|
+
this._badge.className = this._computeClasses().join(' ');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_computeClasses() {
|
|
24
|
+
const classes = ['glass-badge'];
|
|
25
|
+
const variant = this.getAttribute('variant');
|
|
26
|
+
if (variant && VARIANTS.includes(variant)) {
|
|
27
|
+
classes.push(`glass-badge--${variant}`);
|
|
28
|
+
}
|
|
29
|
+
return classes;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get variant() { return this.getAttribute('variant'); }
|
|
33
|
+
set variant(v) { this.setAttribute('variant', v); }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
customElements.define('glk-badge', GlkBadge);
|
|
37
|
+
export { GlkBadge };
|