@hyalo/angular 0.0.0-stage → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/LICENSE +21 -0
- package/README.md +45 -2
- package/fesm2022/hyalo-angular-accordion.mjs +230 -0
- package/fesm2022/hyalo-angular-accordion.mjs.map +1 -0
- package/fesm2022/hyalo-angular-alert.mjs +171 -0
- package/fesm2022/hyalo-angular-alert.mjs.map +1 -0
- package/fesm2022/hyalo-angular-aspect-ratio.mjs +64 -0
- package/fesm2022/hyalo-angular-aspect-ratio.mjs.map +1 -0
- package/fesm2022/hyalo-angular-avatar.mjs +169 -0
- package/fesm2022/hyalo-angular-avatar.mjs.map +1 -0
- package/fesm2022/hyalo-angular-badge.mjs +268 -0
- package/fesm2022/hyalo-angular-badge.mjs.map +1 -0
- package/fesm2022/hyalo-angular-bento.mjs +132 -0
- package/fesm2022/hyalo-angular-bento.mjs.map +1 -0
- package/fesm2022/hyalo-angular-blocks.mjs +985 -0
- package/fesm2022/hyalo-angular-blocks.mjs.map +1 -0
- package/fesm2022/hyalo-angular-border-beam.mjs +73 -0
- package/fesm2022/hyalo-angular-border-beam.mjs.map +1 -0
- package/fesm2022/hyalo-angular-breadcrumb.mjs +77 -0
- package/fesm2022/hyalo-angular-breadcrumb.mjs.map +1 -0
- package/fesm2022/hyalo-angular-button-group.mjs +90 -0
- package/fesm2022/hyalo-angular-button-group.mjs.map +1 -0
- package/fesm2022/hyalo-angular-button.mjs +204 -0
- package/fesm2022/hyalo-angular-button.mjs.map +1 -0
- package/fesm2022/hyalo-angular-card.mjs +221 -0
- package/fesm2022/hyalo-angular-card.mjs.map +1 -0
- package/fesm2022/hyalo-angular-carousel.mjs +709 -0
- package/fesm2022/hyalo-angular-carousel.mjs.map +1 -0
- package/fesm2022/hyalo-angular-chapter-nav.mjs +336 -0
- package/fesm2022/hyalo-angular-chapter-nav.mjs.map +1 -0
- package/fesm2022/hyalo-angular-chart-engine-DSJop6He.mjs +5 -0
- package/fesm2022/hyalo-angular-chart-engine-DSJop6He.mjs.map +1 -0
- package/fesm2022/hyalo-angular-chart.mjs +391 -0
- package/fesm2022/hyalo-angular-chart.mjs.map +1 -0
- package/fesm2022/hyalo-angular-choice.mjs +789 -0
- package/fesm2022/hyalo-angular-choice.mjs.map +1 -0
- package/fesm2022/hyalo-angular-code-block-highlight-B20d5C76.mjs +40 -0
- package/fesm2022/hyalo-angular-code-block-highlight-B20d5C76.mjs.map +1 -0
- package/fesm2022/hyalo-angular-code-block.mjs +161 -0
- package/fesm2022/hyalo-angular-code-block.mjs.map +1 -0
- package/fesm2022/hyalo-angular-command.mjs +193 -0
- package/fesm2022/hyalo-angular-command.mjs.map +1 -0
- package/fesm2022/hyalo-angular-copy.mjs +138 -0
- package/fesm2022/hyalo-angular-copy.mjs.map +1 -0
- package/fesm2022/hyalo-angular-core.mjs +424 -0
- package/fesm2022/hyalo-angular-core.mjs.map +1 -0
- package/fesm2022/hyalo-angular-description-list.mjs +57 -0
- package/fesm2022/hyalo-angular-description-list.mjs.map +1 -0
- package/fesm2022/hyalo-angular-dialog.mjs +600 -0
- package/fesm2022/hyalo-angular-dialog.mjs.map +1 -0
- package/fesm2022/hyalo-angular-divider.mjs +66 -0
- package/fesm2022/hyalo-angular-divider.mjs.map +1 -0
- package/fesm2022/hyalo-angular-empty-state.mjs +123 -0
- package/fesm2022/hyalo-angular-empty-state.mjs.map +1 -0
- package/fesm2022/hyalo-angular-field.mjs +344 -0
- package/fesm2022/hyalo-angular-field.mjs.map +1 -0
- package/fesm2022/hyalo-angular-filter.mjs +309 -0
- package/fesm2022/hyalo-angular-filter.mjs.map +1 -0
- package/fesm2022/hyalo-angular-hotspot.mjs +225 -0
- package/fesm2022/hyalo-angular-hotspot.mjs.map +1 -0
- package/fesm2022/hyalo-angular-hover-card.mjs +233 -0
- package/fesm2022/hyalo-angular-hover-card.mjs.map +1 -0
- package/fesm2022/hyalo-angular-icon.mjs +385 -0
- package/fesm2022/hyalo-angular-icon.mjs.map +1 -0
- package/fesm2022/hyalo-angular-image-compare.mjs +168 -0
- package/fesm2022/hyalo-angular-image-compare.mjs.map +1 -0
- package/fesm2022/hyalo-angular-interaction.mjs +446 -0
- package/fesm2022/hyalo-angular-interaction.mjs.map +1 -0
- package/fesm2022/hyalo-angular-kbd.mjs +41 -0
- package/fesm2022/hyalo-angular-kbd.mjs.map +1 -0
- package/fesm2022/hyalo-angular-lightbox.mjs +228 -0
- package/fesm2022/hyalo-angular-lightbox.mjs.map +1 -0
- package/fesm2022/hyalo-angular-link.mjs +42 -0
- package/fesm2022/hyalo-angular-link.mjs.map +1 -0
- package/fesm2022/hyalo-angular-list.mjs +131 -0
- package/fesm2022/hyalo-angular-list.mjs.map +1 -0
- package/fesm2022/hyalo-angular-marquee.mjs +197 -0
- package/fesm2022/hyalo-angular-marquee.mjs.map +1 -0
- package/fesm2022/hyalo-angular-menu.mjs +423 -0
- package/fesm2022/hyalo-angular-menu.mjs.map +1 -0
- package/fesm2022/hyalo-angular-mesh.mjs +126 -0
- package/fesm2022/hyalo-angular-mesh.mjs.map +1 -0
- package/fesm2022/hyalo-angular-motion.mjs +620 -0
- package/fesm2022/hyalo-angular-motion.mjs.map +1 -0
- package/fesm2022/hyalo-angular-navbar.mjs +343 -0
- package/fesm2022/hyalo-angular-navbar.mjs.map +1 -0
- package/fesm2022/hyalo-angular-navigation-menu.mjs +222 -0
- package/fesm2022/hyalo-angular-navigation-menu.mjs.map +1 -0
- package/fesm2022/hyalo-angular-number-ticker.mjs +174 -0
- package/fesm2022/hyalo-angular-number-ticker.mjs.map +1 -0
- package/fesm2022/hyalo-angular-overlay.mjs +163 -0
- package/fesm2022/hyalo-angular-overlay.mjs.map +1 -0
- package/fesm2022/hyalo-angular-pagination.mjs +187 -0
- package/fesm2022/hyalo-angular-pagination.mjs.map +1 -0
- package/fesm2022/hyalo-angular-popover-overlay-kit-6wPwnxln.mjs +3 -0
- package/fesm2022/hyalo-angular-popover.mjs +516 -0
- package/fesm2022/hyalo-angular-popover.mjs.map +1 -0
- package/fesm2022/hyalo-angular-progress.mjs +209 -0
- package/fesm2022/hyalo-angular-progress.mjs.map +1 -0
- package/fesm2022/hyalo-angular-progressive-blur.mjs +73 -0
- package/fesm2022/hyalo-angular-progressive-blur.mjs.map +1 -0
- package/fesm2022/hyalo-angular-refraction-renderer-5ZA-kfsA.mjs +186 -0
- package/fesm2022/hyalo-angular-refraction-renderer-5ZA-kfsA.mjs.map +1 -0
- package/fesm2022/hyalo-angular-refraction.mjs +178 -0
- package/fesm2022/hyalo-angular-refraction.mjs.map +1 -0
- package/fesm2022/hyalo-angular-scroll-area.mjs +93 -0
- package/fesm2022/hyalo-angular-scroll-area.mjs.map +1 -0
- package/fesm2022/hyalo-angular-scroll-to-top.mjs +127 -0
- package/fesm2022/hyalo-angular-scroll-to-top.mjs.map +1 -0
- package/fesm2022/hyalo-angular-segmented.mjs +223 -0
- package/fesm2022/hyalo-angular-segmented.mjs.map +1 -0
- package/fesm2022/hyalo-angular-select.mjs +561 -0
- package/fesm2022/hyalo-angular-select.mjs.map +1 -0
- package/fesm2022/hyalo-angular-sidebar.mjs +241 -0
- package/fesm2022/hyalo-angular-sidebar.mjs.map +1 -0
- package/fesm2022/hyalo-angular-skeleton.mjs +131 -0
- package/fesm2022/hyalo-angular-skeleton.mjs.map +1 -0
- package/fesm2022/hyalo-angular-sparkline.mjs +110 -0
- package/fesm2022/hyalo-angular-sparkline.mjs.map +1 -0
- package/fesm2022/hyalo-angular-split-text.mjs +126 -0
- package/fesm2022/hyalo-angular-split-text.mjs.map +1 -0
- package/fesm2022/hyalo-angular-stat.mjs +193 -0
- package/fesm2022/hyalo-angular-stat.mjs.map +1 -0
- package/fesm2022/hyalo-angular-stepper.mjs +254 -0
- package/fesm2022/hyalo-angular-stepper.mjs.map +1 -0
- package/fesm2022/hyalo-angular-table.mjs +335 -0
- package/fesm2022/hyalo-angular-table.mjs.map +1 -0
- package/fesm2022/hyalo-angular-tabs.mjs +324 -0
- package/fesm2022/hyalo-angular-tabs.mjs.map +1 -0
- package/fesm2022/hyalo-angular-theme.mjs +94 -0
- package/fesm2022/hyalo-angular-theme.mjs.map +1 -0
- package/fesm2022/hyalo-angular-timeline.mjs +157 -0
- package/fesm2022/hyalo-angular-timeline.mjs.map +1 -0
- package/fesm2022/hyalo-angular-toast.mjs +323 -0
- package/fesm2022/hyalo-angular-toast.mjs.map +1 -0
- package/fesm2022/hyalo-angular.mjs +2 -0
- package/package.json +329 -3
- package/styles/hyalo-core.css +25 -0
- package/styles/hyalo.css +17 -0
- package/styles/overlays/dialog.css +9 -0
- package/styles/overlays/popover.css +9 -0
- package/styles/overlays/select.css +9 -0
- package/styles/overlays/toast.css +8 -0
- package/styles/palettes/aurora.css +47 -0
- package/styles/palettes/ember.css +47 -0
- package/styles/palettes/graphite.css +47 -0
- package/styles/palettes/ocean.css +47 -0
- package/styles/palettes/orchid.css +47 -0
- package/styles/palettes/rose.css +47 -0
- package/styles/parts/card.css +49 -0
- package/styles/parts/dialog.css +116 -0
- package/styles/parts/drawer.css +124 -0
- package/styles/parts/field.css +44 -0
- package/styles/parts/glass.css +139 -0
- package/styles/parts/motion.css +101 -0
- package/styles/parts/navbar.css +55 -0
- package/styles/parts/popover.css +27 -0
- package/styles/parts/presence.css +55 -0
- package/styles/parts/reset.css +42 -0
- package/styles/parts/select.css +46 -0
- package/styles/parts/themes.css +105 -0
- package/styles/parts/toast.css +128 -0
- package/styles/parts/tokens.css +151 -0
- package/styles/parts/typography.css +81 -0
- package/types/hyalo-angular-accordion.d.ts +74 -0
- package/types/hyalo-angular-alert.d.ts +47 -0
- package/types/hyalo-angular-aspect-ratio.d.ts +13 -0
- package/types/hyalo-angular-avatar.d.ts +39 -0
- package/types/hyalo-angular-badge.d.ts +82 -0
- package/types/hyalo-angular-bento.d.ts +25 -0
- package/types/hyalo-angular-blocks.d.ts +272 -0
- package/types/hyalo-angular-border-beam.d.ts +15 -0
- package/types/hyalo-angular-breadcrumb.d.ts +22 -0
- package/types/hyalo-angular-button-group.d.ts +19 -0
- package/types/hyalo-angular-button.d.ts +89 -0
- package/types/hyalo-angular-card.d.ts +61 -0
- package/types/hyalo-angular-carousel.d.ts +147 -0
- package/types/hyalo-angular-chapter-nav.d.ts +79 -0
- package/types/hyalo-angular-chart.d.ts +90 -0
- package/types/hyalo-angular-choice.d.ts +259 -0
- package/types/hyalo-angular-code-block.d.ts +46 -0
- package/types/hyalo-angular-command.d.ts +41 -0
- package/types/hyalo-angular-copy.d.ts +39 -0
- package/types/hyalo-angular-core.d.ts +210 -0
- package/types/hyalo-angular-description-list.d.ts +16 -0
- package/types/hyalo-angular-dialog.d.ts +171 -0
- package/types/hyalo-angular-divider.d.ts +12 -0
- package/types/hyalo-angular-empty-state.d.ts +30 -0
- package/types/hyalo-angular-field.d.ts +141 -0
- package/types/hyalo-angular-filter.d.ts +122 -0
- package/types/hyalo-angular-hotspot.d.ts +70 -0
- package/types/hyalo-angular-hover-card.d.ts +47 -0
- package/types/hyalo-angular-icon.d.ts +122 -0
- package/types/hyalo-angular-image-compare.d.ts +55 -0
- package/types/hyalo-angular-interaction.d.ts +131 -0
- package/types/hyalo-angular-kbd.d.ts +5 -0
- package/types/hyalo-angular-lightbox.d.ts +67 -0
- package/types/hyalo-angular-link.d.ts +5 -0
- package/types/hyalo-angular-list.d.ts +30 -0
- package/types/hyalo-angular-marquee.d.ts +48 -0
- package/types/hyalo-angular-menu.d.ts +105 -0
- package/types/hyalo-angular-mesh.d.ts +36 -0
- package/types/hyalo-angular-motion.d.ts +218 -0
- package/types/hyalo-angular-navbar.d.ts +110 -0
- package/types/hyalo-angular-navigation-menu.d.ts +47 -0
- package/types/hyalo-angular-number-ticker.d.ts +52 -0
- package/types/hyalo-angular-overlay.d.ts +40 -0
- package/types/hyalo-angular-pagination.d.ts +59 -0
- package/types/hyalo-angular-popover.d.ts +152 -0
- package/types/hyalo-angular-progress.d.ts +46 -0
- package/types/hyalo-angular-progressive-blur.d.ts +14 -0
- package/types/hyalo-angular-refraction.d.ts +46 -0
- package/types/hyalo-angular-scroll-area.d.ts +18 -0
- package/types/hyalo-angular-scroll-to-top.d.ts +31 -0
- package/types/hyalo-angular-segmented.d.ts +79 -0
- package/types/hyalo-angular-select.d.ts +176 -0
- package/types/hyalo-angular-sidebar.d.ts +57 -0
- package/types/hyalo-angular-skeleton.d.ts +34 -0
- package/types/hyalo-angular-sparkline.d.ts +19 -0
- package/types/hyalo-angular-split-text.d.ts +24 -0
- package/types/hyalo-angular-stat.d.ts +56 -0
- package/types/hyalo-angular-stepper.d.ts +63 -0
- package/types/hyalo-angular-table.d.ts +125 -0
- package/types/hyalo-angular-tabs.d.ts +102 -0
- package/types/hyalo-angular-theme.d.ts +46 -0
- package/types/hyalo-angular-timeline.d.ts +36 -0
- package/types/hyalo-angular-toast.d.ts +79 -0
- package/types/hyalo-angular.d.ts +2 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, booleanAttribute, input, model } from "@angular/core";
|
|
3
|
+
import { HyIcon } from "@hyalo/angular/icon";
|
|
4
|
+
var HySidebar = class HySidebar {
|
|
5
|
+
collapsed = model(false, ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
|
|
6
|
+
toggle = (value) => !value;
|
|
7
|
+
label = input("Main navigation", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
8
|
+
collapseLabel = input("Collapse navigation", ...ngDevMode ? [{ debugName: "collapseLabel" }] : /* istanbul ignore next */ []);
|
|
9
|
+
expandLabel = input("Expand navigation", ...ngDevMode ? [{ debugName: "expandLabel" }] : /* istanbul ignore next */ []);
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11
|
+
minVersion: "12.0.0",
|
|
12
|
+
version: "22.2.3",
|
|
13
|
+
ngImport: i0,
|
|
14
|
+
type: HySidebar,
|
|
15
|
+
deps: [],
|
|
16
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
17
|
+
});
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
19
|
+
minVersion: "17.1.0",
|
|
20
|
+
version: "22.2.3",
|
|
21
|
+
type: HySidebar,
|
|
22
|
+
isStandalone: true,
|
|
23
|
+
selector: "hy-sidebar",
|
|
24
|
+
inputs: {
|
|
25
|
+
collapsed: {
|
|
26
|
+
classPropertyName: "collapsed",
|
|
27
|
+
publicName: "collapsed",
|
|
28
|
+
isSignal: true,
|
|
29
|
+
isRequired: false,
|
|
30
|
+
transformFunction: null
|
|
31
|
+
},
|
|
32
|
+
label: {
|
|
33
|
+
classPropertyName: "label",
|
|
34
|
+
publicName: "label",
|
|
35
|
+
isSignal: true,
|
|
36
|
+
isRequired: false,
|
|
37
|
+
transformFunction: null
|
|
38
|
+
},
|
|
39
|
+
collapseLabel: {
|
|
40
|
+
classPropertyName: "collapseLabel",
|
|
41
|
+
publicName: "collapseLabel",
|
|
42
|
+
isSignal: true,
|
|
43
|
+
isRequired: false,
|
|
44
|
+
transformFunction: null
|
|
45
|
+
},
|
|
46
|
+
expandLabel: {
|
|
47
|
+
classPropertyName: "expandLabel",
|
|
48
|
+
publicName: "expandLabel",
|
|
49
|
+
isSignal: true,
|
|
50
|
+
isRequired: false,
|
|
51
|
+
transformFunction: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
outputs: { collapsed: "collapsedChange" },
|
|
55
|
+
host: { properties: {
|
|
56
|
+
"attr.data-collapsed": "collapsed()",
|
|
57
|
+
"style.--hy-sidebar-label-display": "collapsed()?\"none\":null",
|
|
58
|
+
"style.--hy-sidebar-item-justify": "collapsed()?\"center\":null"
|
|
59
|
+
} },
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
template: "<header>\n <div class=\"brand\"><ng-content select=\"[hySidebarBrand]\" /></div>\n <button\n type=\"button\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"collapsed.update(toggle)\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n aria-hidden=\"true\"\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"3\" />\n <path d=\"M9 4v16\" />\n </svg>\n </button>\n</header>\n<nav [attr.aria-label]=\"label()\"><ng-content /></nav>\n<footer><ng-content select=\"[hySidebarFooter]\" /></footer>\n",
|
|
62
|
+
styles: [":host{display:flex;flex-direction:column;flex:none;gap:1.5rem;inline-size:var(--hy-sidebar-width, 16rem);max-inline-size:100%;min-inline-size:0;padding:.75rem;border:1px solid var(--hy-line);border-radius:var(--hy-radius-m);background:var(--hy-surface-2);box-sizing:border-box}:host([data-collapsed=\"true\"]){inline-size:4.5rem}header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-block-size:44px}.brand{display:var(--hy-sidebar-label-display, block);min-inline-size:0;padding-inline-start:.375rem}button{display:grid;place-items:center;flex:none;inline-size:44px;block-size:44px;padding:0;background:transparent;color:var(--hy-ink-2);border:1px solid transparent;border-radius:var(--hy-radius-s);cursor:pointer;transition:background-color .12s ease,color .12s ease}button svg{transition:transform var(--hy-dur-quick) var(--hy-ease-out)}:host([data-collapsed=\"true\"]) button svg{transform:rotateY(180deg)}:host-context([dir=\"rtl\"]) button svg{scale:-1 1}@media(hover:hover)and (pointer:fine){button:hover{background:var(--hy-surface-3);color:var(--hy-ink)}}button:active{background:var(--hy-surface-4)}nav{display:grid;align-content:start;gap:.375rem}footer{margin-block-start:auto;display:var(--hy-sidebar-label-display, block);padding-block-start:1rem;border-block-start:1px solid var(--hy-line)}footer:empty{display:none}button:focus-visible{outline:2px solid var(--hy-primary);outline-offset:2px}@media(prefers-reduced-motion:reduce){button svg{transition:none}}:host-context([data-hy-motion=\"reduced\"]) button svg{transition:none}\n"],
|
|
63
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
67
|
+
minVersion: "12.0.0",
|
|
68
|
+
version: "22.2.3",
|
|
69
|
+
ngImport: i0,
|
|
70
|
+
type: HySidebar,
|
|
71
|
+
decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: "hy-sidebar",
|
|
75
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
76
|
+
host: {
|
|
77
|
+
"[attr.data-collapsed]": "collapsed()",
|
|
78
|
+
"[style.--hy-sidebar-label-display]": "collapsed()?\"none\":null",
|
|
79
|
+
"[style.--hy-sidebar-item-justify]": "collapsed()?\"center\":null"
|
|
80
|
+
},
|
|
81
|
+
template: "<header>\n <div class=\"brand\"><ng-content select=\"[hySidebarBrand]\" /></div>\n <button\n type=\"button\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"collapsed.update(toggle)\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n aria-hidden=\"true\"\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"3\" />\n <path d=\"M9 4v16\" />\n </svg>\n </button>\n</header>\n<nav [attr.aria-label]=\"label()\"><ng-content /></nav>\n<footer><ng-content select=\"[hySidebarFooter]\" /></footer>\n",
|
|
82
|
+
styles: [":host{display:flex;flex-direction:column;flex:none;gap:1.5rem;inline-size:var(--hy-sidebar-width, 16rem);max-inline-size:100%;min-inline-size:0;padding:.75rem;border:1px solid var(--hy-line);border-radius:var(--hy-radius-m);background:var(--hy-surface-2);box-sizing:border-box}:host([data-collapsed=\"true\"]){inline-size:4.5rem}header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-block-size:44px}.brand{display:var(--hy-sidebar-label-display, block);min-inline-size:0;padding-inline-start:.375rem}button{display:grid;place-items:center;flex:none;inline-size:44px;block-size:44px;padding:0;background:transparent;color:var(--hy-ink-2);border:1px solid transparent;border-radius:var(--hy-radius-s);cursor:pointer;transition:background-color .12s ease,color .12s ease}button svg{transition:transform var(--hy-dur-quick) var(--hy-ease-out)}:host([data-collapsed=\"true\"]) button svg{transform:rotateY(180deg)}:host-context([dir=\"rtl\"]) button svg{scale:-1 1}@media(hover:hover)and (pointer:fine){button:hover{background:var(--hy-surface-3);color:var(--hy-ink)}}button:active{background:var(--hy-surface-4)}nav{display:grid;align-content:start;gap:.375rem}footer{margin-block-start:auto;display:var(--hy-sidebar-label-display, block);padding-block-start:1rem;border-block-start:1px solid var(--hy-line)}footer:empty{display:none}button:focus-visible{outline:2px solid var(--hy-primary);outline-offset:2px}@media(prefers-reduced-motion:reduce){button svg{transition:none}}:host-context([data-hy-motion=\"reduced\"]) button svg{transition:none}\n"]
|
|
83
|
+
}]
|
|
84
|
+
}],
|
|
85
|
+
propDecorators: {
|
|
86
|
+
collapsed: [{
|
|
87
|
+
type: i0.Input,
|
|
88
|
+
args: [{
|
|
89
|
+
isSignal: true,
|
|
90
|
+
alias: "collapsed",
|
|
91
|
+
required: false
|
|
92
|
+
}]
|
|
93
|
+
}, {
|
|
94
|
+
type: i0.Output,
|
|
95
|
+
args: ["collapsedChange"]
|
|
96
|
+
}],
|
|
97
|
+
label: [{
|
|
98
|
+
type: i0.Input,
|
|
99
|
+
args: [{
|
|
100
|
+
isSignal: true,
|
|
101
|
+
alias: "label",
|
|
102
|
+
required: false
|
|
103
|
+
}]
|
|
104
|
+
}],
|
|
105
|
+
collapseLabel: [{
|
|
106
|
+
type: i0.Input,
|
|
107
|
+
args: [{
|
|
108
|
+
isSignal: true,
|
|
109
|
+
alias: "collapseLabel",
|
|
110
|
+
required: false
|
|
111
|
+
}]
|
|
112
|
+
}],
|
|
113
|
+
expandLabel: [{
|
|
114
|
+
type: i0.Input,
|
|
115
|
+
args: [{
|
|
116
|
+
isSignal: true,
|
|
117
|
+
alias: "expandLabel",
|
|
118
|
+
required: false
|
|
119
|
+
}]
|
|
120
|
+
}]
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var HySidebarItem = class HySidebarItem {
|
|
124
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
125
|
+
icon = input.required(...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
126
|
+
active = input(false, {
|
|
127
|
+
...ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {},
|
|
128
|
+
transform: booleanAttribute
|
|
129
|
+
});
|
|
130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
131
|
+
minVersion: "12.0.0",
|
|
132
|
+
version: "22.2.3",
|
|
133
|
+
ngImport: i0,
|
|
134
|
+
type: HySidebarItem,
|
|
135
|
+
deps: [],
|
|
136
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
137
|
+
});
|
|
138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
139
|
+
minVersion: "17.1.0",
|
|
140
|
+
version: "22.2.3",
|
|
141
|
+
type: HySidebarItem,
|
|
142
|
+
isStandalone: true,
|
|
143
|
+
selector: "a[hySidebarItem]",
|
|
144
|
+
inputs: {
|
|
145
|
+
label: {
|
|
146
|
+
classPropertyName: "label",
|
|
147
|
+
publicName: "label",
|
|
148
|
+
isSignal: true,
|
|
149
|
+
isRequired: true,
|
|
150
|
+
transformFunction: null
|
|
151
|
+
},
|
|
152
|
+
icon: {
|
|
153
|
+
classPropertyName: "icon",
|
|
154
|
+
publicName: "icon",
|
|
155
|
+
isSignal: true,
|
|
156
|
+
isRequired: true,
|
|
157
|
+
transformFunction: null
|
|
158
|
+
},
|
|
159
|
+
active: {
|
|
160
|
+
classPropertyName: "active",
|
|
161
|
+
publicName: "active",
|
|
162
|
+
isSignal: true,
|
|
163
|
+
isRequired: false,
|
|
164
|
+
transformFunction: null
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
host: { properties: {
|
|
168
|
+
"attr.aria-label": "label()",
|
|
169
|
+
"attr.title": "label()",
|
|
170
|
+
"attr.aria-current": "active()?\"page\":null"
|
|
171
|
+
} },
|
|
172
|
+
ngImport: i0,
|
|
173
|
+
template: "<hy-icon [name]=\"icon()\" /><span class=\"label\">{{label()}}</span><ng-content />",
|
|
174
|
+
isInline: true,
|
|
175
|
+
styles: [":host{display:flex;align-items:center;justify-content:var(--hy-sidebar-item-justify, start);gap:.75rem;min-block-size:44px;min-inline-size:0;padding:.625rem .75rem;border:1px solid transparent;border-radius:var(--hy-radius-s);color:var(--hy-ink-2);text-decoration:none;font-size:.875rem;font-weight:500;line-height:1.4;box-sizing:border-box;transition:background-color .12s ease,color .12s ease}.label{display:var(--hy-sidebar-label-display, inline);min-inline-size:0;overflow-wrap:anywhere}@media(hover:hover)and (pointer:fine){:host(:hover){background:var(--hy-surface-3);color:var(--hy-ink)}}:host(:active){background:var(--hy-surface-4)}:host([aria-current=\"page\"]){background:var(--hy-primary-wash);color:var(--hy-primary);font-weight:600}:host(:focus-visible){outline:2px solid var(--hy-primary);outline-offset:2px}hy-icon{flex:none;inline-size:1.125rem;block-size:1.125rem}\n"],
|
|
176
|
+
dependencies: [{
|
|
177
|
+
kind: "component",
|
|
178
|
+
type: HyIcon,
|
|
179
|
+
selector: "hy-icon",
|
|
180
|
+
inputs: [
|
|
181
|
+
"name",
|
|
182
|
+
"icon",
|
|
183
|
+
"label",
|
|
184
|
+
"size",
|
|
185
|
+
"strokeWidth"
|
|
186
|
+
]
|
|
187
|
+
}],
|
|
188
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
192
|
+
minVersion: "12.0.0",
|
|
193
|
+
version: "22.2.3",
|
|
194
|
+
ngImport: i0,
|
|
195
|
+
type: HySidebarItem,
|
|
196
|
+
decorators: [{
|
|
197
|
+
type: Component,
|
|
198
|
+
args: [{
|
|
199
|
+
selector: "a[hySidebarItem]",
|
|
200
|
+
imports: [HyIcon],
|
|
201
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
202
|
+
template: "<hy-icon [name]=\"icon()\" /><span class=\"label\">{{label()}}</span><ng-content />",
|
|
203
|
+
host: {
|
|
204
|
+
"[attr.aria-label]": "label()",
|
|
205
|
+
"[attr.title]": "label()",
|
|
206
|
+
"[attr.aria-current]": "active()?\"page\":null"
|
|
207
|
+
},
|
|
208
|
+
styles: [":host{display:flex;align-items:center;justify-content:var(--hy-sidebar-item-justify, start);gap:.75rem;min-block-size:44px;min-inline-size:0;padding:.625rem .75rem;border:1px solid transparent;border-radius:var(--hy-radius-s);color:var(--hy-ink-2);text-decoration:none;font-size:.875rem;font-weight:500;line-height:1.4;box-sizing:border-box;transition:background-color .12s ease,color .12s ease}.label{display:var(--hy-sidebar-label-display, inline);min-inline-size:0;overflow-wrap:anywhere}@media(hover:hover)and (pointer:fine){:host(:hover){background:var(--hy-surface-3);color:var(--hy-ink)}}:host(:active){background:var(--hy-surface-4)}:host([aria-current=\"page\"]){background:var(--hy-primary-wash);color:var(--hy-primary);font-weight:600}:host(:focus-visible){outline:2px solid var(--hy-primary);outline-offset:2px}hy-icon{flex:none;inline-size:1.125rem;block-size:1.125rem}\n"]
|
|
209
|
+
}]
|
|
210
|
+
}],
|
|
211
|
+
propDecorators: {
|
|
212
|
+
label: [{
|
|
213
|
+
type: i0.Input,
|
|
214
|
+
args: [{
|
|
215
|
+
isSignal: true,
|
|
216
|
+
alias: "label",
|
|
217
|
+
required: true
|
|
218
|
+
}]
|
|
219
|
+
}],
|
|
220
|
+
icon: [{
|
|
221
|
+
type: i0.Input,
|
|
222
|
+
args: [{
|
|
223
|
+
isSignal: true,
|
|
224
|
+
alias: "icon",
|
|
225
|
+
required: true
|
|
226
|
+
}]
|
|
227
|
+
}],
|
|
228
|
+
active: [{
|
|
229
|
+
type: i0.Input,
|
|
230
|
+
args: [{
|
|
231
|
+
isSignal: true,
|
|
232
|
+
alias: "active",
|
|
233
|
+
required: false
|
|
234
|
+
}]
|
|
235
|
+
}]
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
const HY_SIDEBAR = [HySidebar, HySidebarItem];
|
|
239
|
+
export { HY_SIDEBAR, HySidebar, HySidebarItem };
|
|
240
|
+
|
|
241
|
+
//# sourceMappingURL=hyalo-angular-sidebar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyalo-angular-sidebar.mjs","names":[],"sources":["../../../projects/hyalo/sidebar/sidebar.ts","../../../projects/hyalo/sidebar/sidebar.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, booleanAttribute, input, model } from '@angular/core';\nimport { HyIcon } from '@hyalo/angular/icon';\n@Component({\n selector: 'hy-sidebar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './sidebar.html',\n styleUrl: './sidebar.css',\n host: {\n '[attr.data-collapsed]': 'collapsed()',\n '[style.--hy-sidebar-label-display]': 'collapsed()?\"none\":null',\n '[style.--hy-sidebar-item-justify]': 'collapsed()?\"center\":null',\n },\n})\nexport class HySidebar {\n readonly collapsed = model(false);\n protected readonly toggle = (value: boolean): boolean => !value;\n readonly label = input('Main navigation');\n readonly collapseLabel = input('Collapse navigation');\n readonly expandLabel = input('Expand navigation');\n}\n@Component({\n // Native elements preserve link, list, key, and button semantics.\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'a[hySidebarItem]',\n imports: [HyIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: '<hy-icon [name]=\"icon()\" /><span class=\"label\">{{label()}}</span><ng-content />',\n host: {\n '[attr.aria-label]': 'label()',\n '[attr.title]': 'label()',\n '[attr.aria-current]': 'active()?\"page\":null',\n },\n styleUrl: './sidebar-item.css',\n})\nexport class HySidebarItem {\n readonly label = input.required<string>();\n readonly icon = input.required<string>();\n readonly active = input(false, { transform: booleanAttribute });\n}\nexport const HY_SIDEBAR = [HySidebar, HySidebarItem] as const;\n","<header>\n <div class=\"brand\"><ng-content select=\"[hySidebarBrand]\" /></div>\n <button\n type=\"button\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"collapsed.update(toggle)\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n aria-hidden=\"true\"\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"3\" />\n <path d=\"M9 4v16\" />\n </svg>\n </button>\n</header>\n<nav [attr.aria-label]=\"label()\"><ng-content /></nav>\n<footer><ng-content select=\"[hySidebarFooter]\" /></footer>\n"],"mappings":";;;AAaA,IAAa,YAAb,MAAa,UAAS;CACX,YAAY,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACd,UAAU,UAA4B,CAAC;CACjD,QAAQ,MAAM,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,gBAAgB,MAAM,uBAAsB,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,cAAc,MAAM,qBAAoB,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CALtC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,WAAA;IAAA,mBAAA;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,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,YAAA;GAAA,mBAAA;GAAA,cAAA;GAAA,qBAAA;EAAA,EAAA;EAAA,UAAA;EAAA,UARd;EAAiF,UAAA;EAAA,QAAA,CAAA,s3BAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MAFjF;GAAM,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAUL,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAdzB,MAAA;EAGW,MAAA,CAAA;GAAA,UAAA;GAAkB,SACnB,CAAC,MAAM;GAAC,iBACA,wBAAwB;GAAM,UACrC;GAAiF,MACrF;IACJ,qBAAqB;IACrB,gBAAgB;IAChB,uBAAuB;GACxB;GAAA,QAAA,CAAA,s3BAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,MAAa,aAAa,CAAC,WAAW,aAAa"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input } from "@angular/core";
|
|
3
|
+
import { HyMotion } from "@hyalo/angular/motion";
|
|
4
|
+
var HySkeleton = class HySkeleton {
|
|
5
|
+
motion = inject(HyMotion);
|
|
6
|
+
animate = computed(() => this.motion.enabled() && this.animation() !== "none", ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
|
|
7
|
+
animation = input("shimmer", ...ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []);
|
|
8
|
+
shape = input("text", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
9
|
+
width = input("100%", ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
10
|
+
height = input("1em", ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "22.2.3",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: HySkeleton,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
18
|
+
});
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
20
|
+
minVersion: "17.1.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
type: HySkeleton,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
selector: "hy-skeleton",
|
|
25
|
+
inputs: {
|
|
26
|
+
animation: {
|
|
27
|
+
classPropertyName: "animation",
|
|
28
|
+
publicName: "animation",
|
|
29
|
+
isSignal: true,
|
|
30
|
+
isRequired: false,
|
|
31
|
+
transformFunction: null
|
|
32
|
+
},
|
|
33
|
+
shape: {
|
|
34
|
+
classPropertyName: "shape",
|
|
35
|
+
publicName: "shape",
|
|
36
|
+
isSignal: true,
|
|
37
|
+
isRequired: false,
|
|
38
|
+
transformFunction: null
|
|
39
|
+
},
|
|
40
|
+
width: {
|
|
41
|
+
classPropertyName: "width",
|
|
42
|
+
publicName: "width",
|
|
43
|
+
isSignal: true,
|
|
44
|
+
isRequired: false,
|
|
45
|
+
transformFunction: null
|
|
46
|
+
},
|
|
47
|
+
height: {
|
|
48
|
+
classPropertyName: "height",
|
|
49
|
+
publicName: "height",
|
|
50
|
+
isSignal: true,
|
|
51
|
+
isRequired: false,
|
|
52
|
+
transformFunction: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
host: {
|
|
56
|
+
attributes: { "aria-hidden": "true" },
|
|
57
|
+
properties: {
|
|
58
|
+
"attr.data-shape": "shape()",
|
|
59
|
+
"attr.data-animate": "animate()",
|
|
60
|
+
"attr.data-animation": "animation()",
|
|
61
|
+
"style.inline-size": "width()",
|
|
62
|
+
"style.block-size": "height()"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
ngImport: i0,
|
|
66
|
+
template: "",
|
|
67
|
+
isInline: true,
|
|
68
|
+
styles: [":host{display:block;position:relative;overflow:clip;border-radius:var(--hy-radius-s);background:var(--hy-surface-3)}:host([data-shape=\"circle\"]){border-radius:50%}:host([data-animate=\"true\"][data-animation=\"shimmer\"]):after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent,var(--hy-surface-1),transparent);animation:hy-shimmer 1.8s linear infinite}:host([data-animate=\"true\"][data-animation=\"pulse\"]){animation:hy-pulse 1.8s var(--hy-ease-inout) infinite}@keyframes hy-pulse{50%{opacity:.45}}@keyframes hy-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host,:host:after{animation:none!important}}\n"],
|
|
69
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
73
|
+
minVersion: "12.0.0",
|
|
74
|
+
version: "22.2.3",
|
|
75
|
+
ngImport: i0,
|
|
76
|
+
type: HySkeleton,
|
|
77
|
+
decorators: [{
|
|
78
|
+
type: Component,
|
|
79
|
+
args: [{
|
|
80
|
+
selector: "hy-skeleton",
|
|
81
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
82
|
+
host: {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
"[attr.data-shape]": "shape()",
|
|
85
|
+
"[attr.data-animate]": "animate()",
|
|
86
|
+
"[attr.data-animation]": "animation()",
|
|
87
|
+
"[style.inline-size]": "width()",
|
|
88
|
+
"[style.block-size]": "height()"
|
|
89
|
+
},
|
|
90
|
+
template: "",
|
|
91
|
+
styles: [":host{display:block;position:relative;overflow:clip;border-radius:var(--hy-radius-s);background:var(--hy-surface-3)}:host([data-shape=\"circle\"]){border-radius:50%}:host([data-animate=\"true\"][data-animation=\"shimmer\"]):after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent,var(--hy-surface-1),transparent);animation:hy-shimmer 1.8s linear infinite}:host([data-animate=\"true\"][data-animation=\"pulse\"]){animation:hy-pulse 1.8s var(--hy-ease-inout) infinite}@keyframes hy-pulse{50%{opacity:.45}}@keyframes hy-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host,:host:after{animation:none!important}}\n"]
|
|
92
|
+
}]
|
|
93
|
+
}],
|
|
94
|
+
propDecorators: {
|
|
95
|
+
animation: [{
|
|
96
|
+
type: i0.Input,
|
|
97
|
+
args: [{
|
|
98
|
+
isSignal: true,
|
|
99
|
+
alias: "animation",
|
|
100
|
+
required: false
|
|
101
|
+
}]
|
|
102
|
+
}],
|
|
103
|
+
shape: [{
|
|
104
|
+
type: i0.Input,
|
|
105
|
+
args: [{
|
|
106
|
+
isSignal: true,
|
|
107
|
+
alias: "shape",
|
|
108
|
+
required: false
|
|
109
|
+
}]
|
|
110
|
+
}],
|
|
111
|
+
width: [{
|
|
112
|
+
type: i0.Input,
|
|
113
|
+
args: [{
|
|
114
|
+
isSignal: true,
|
|
115
|
+
alias: "width",
|
|
116
|
+
required: false
|
|
117
|
+
}]
|
|
118
|
+
}],
|
|
119
|
+
height: [{
|
|
120
|
+
type: i0.Input,
|
|
121
|
+
args: [{
|
|
122
|
+
isSignal: true,
|
|
123
|
+
alias: "height",
|
|
124
|
+
required: false
|
|
125
|
+
}]
|
|
126
|
+
}]
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export { HySkeleton };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=hyalo-angular-skeleton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyalo-angular-skeleton.mjs","names":[],"sources":["../../../projects/hyalo/skeleton/skeleton.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\r\nimport { HyMotion } from '@hyalo/angular/motion';\r\nexport type HySkeletonAnimation = 'shimmer' | 'pulse' | 'none';\r\n/** Decorative placeholder. Put aria-busy on the region being loaded. */\r\n@Component({\r\n selector: 'hy-skeleton',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n 'aria-hidden': 'true',\r\n '[attr.data-shape]': 'shape()',\r\n '[attr.data-animate]': 'animate()',\r\n '[attr.data-animation]': 'animation()',\r\n '[style.inline-size]': 'width()',\r\n '[style.block-size]': 'height()',\r\n },\r\n template: '',\r\n styleUrl: './skeleton.css',\r\n})\r\nexport class HySkeleton {\r\n private readonly motion = inject(HyMotion);\r\n protected readonly animate = computed(() => this.motion.enabled() && this.animation() !== 'none');\r\n readonly animation = input<HySkeletonAnimation>('shimmer');\r\n readonly shape = input<'text' | 'circle' | 'rect'>('text');\r\n readonly width = input('100%');\r\n readonly height = input('1em');\r\n}\r\n"],"mappings":";;;AAkBA,IAAa,aAAb,MAAa,WAAU;CACJ,SAAS,OAAO,QAAQ;CACtB,UAAU,eAAe,KAAK,OAAO,QAAO,KAAM,KAAK,UAAS,MAAO,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACxF,YAAY,MAA2B,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACjD,QAAQ,MAAkC,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BA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ACvB;GAAA,UACS;GAAE,QAAA,CAAA,isBAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
|
|
3
|
+
var HySparkline = class HySparkline {
|
|
4
|
+
data = input.required(...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
5
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
6
|
+
points = computed(() => {
|
|
7
|
+
const values = this.data().filter(Number.isFinite);
|
|
8
|
+
if (!values.length) return "";
|
|
9
|
+
const maximum = values[0] ?? 0;
|
|
10
|
+
let scale = Math.abs(maximum);
|
|
11
|
+
for (const value of values) scale = Math.max(scale, Math.abs(value));
|
|
12
|
+
const normalized = values.map((value) => scale ? value / scale : 0);
|
|
13
|
+
let min = Infinity, max = -Infinity;
|
|
14
|
+
for (const value of normalized) {
|
|
15
|
+
min = Math.min(min, value);
|
|
16
|
+
max = Math.max(max, value);
|
|
17
|
+
}
|
|
18
|
+
const selected = /* @__PURE__ */ new Set([0, values.length - 1]);
|
|
19
|
+
const bucket = Math.max(1, Math.ceil(values.length / 80));
|
|
20
|
+
for (let start = 0; start < values.length; start += bucket) {
|
|
21
|
+
let low = start, high = start;
|
|
22
|
+
for (let i = start; i < Math.min(values.length, start + bucket); i++) {
|
|
23
|
+
if ((normalized[i] ?? 0) < (normalized[low] ?? 0)) low = i;
|
|
24
|
+
if ((normalized[i] ?? 0) > (normalized[high] ?? 0)) high = i;
|
|
25
|
+
}
|
|
26
|
+
selected.add(low);
|
|
27
|
+
selected.add(high);
|
|
28
|
+
}
|
|
29
|
+
return [...selected].sort((a, b) => a - b).map((index) => (values.length === 1 ? 100 : index / (values.length - 1) * 196 + 2).toFixed(2) + "," + (max === min ? 24 : 44 - ((normalized[index] ?? 0) - min) / (max - min) * 40).toFixed(2)).join(" ");
|
|
30
|
+
}, ...ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []);
|
|
31
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
32
|
+
minVersion: "12.0.0",
|
|
33
|
+
version: "22.2.3",
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
type: HySparkline,
|
|
36
|
+
deps: [],
|
|
37
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
38
|
+
});
|
|
39
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
40
|
+
minVersion: "17.1.0",
|
|
41
|
+
version: "22.2.3",
|
|
42
|
+
type: HySparkline,
|
|
43
|
+
isStandalone: true,
|
|
44
|
+
selector: "hy-sparkline",
|
|
45
|
+
inputs: {
|
|
46
|
+
data: {
|
|
47
|
+
classPropertyName: "data",
|
|
48
|
+
publicName: "data",
|
|
49
|
+
isSignal: true,
|
|
50
|
+
isRequired: true,
|
|
51
|
+
transformFunction: null
|
|
52
|
+
},
|
|
53
|
+
label: {
|
|
54
|
+
classPropertyName: "label",
|
|
55
|
+
publicName: "label",
|
|
56
|
+
isSignal: true,
|
|
57
|
+
isRequired: true,
|
|
58
|
+
transformFunction: null
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
host: {
|
|
62
|
+
attributes: { "role": "img" },
|
|
63
|
+
properties: { "attr.aria-label": "label()" }
|
|
64
|
+
},
|
|
65
|
+
ngImport: i0,
|
|
66
|
+
template: "<svg viewBox=\"0 0 200 48\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\r\n <polyline\r\n [attr.points]=\"points()\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linejoin=\"round\"\r\n stroke-linecap=\"round\"\r\n vector-effect=\"non-scaling-stroke\"\r\n />\r\n</svg>\r\n",
|
|
67
|
+
styles: [":host{display:block;inline-size:100%;block-size:3rem;color:var(--hy-primary)}svg{display:block;inline-size:100%;block-size:100%}\n"],
|
|
68
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
72
|
+
minVersion: "12.0.0",
|
|
73
|
+
version: "22.2.3",
|
|
74
|
+
ngImport: i0,
|
|
75
|
+
type: HySparkline,
|
|
76
|
+
decorators: [{
|
|
77
|
+
type: Component,
|
|
78
|
+
args: [{
|
|
79
|
+
selector: "hy-sparkline",
|
|
80
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
81
|
+
host: {
|
|
82
|
+
role: "img",
|
|
83
|
+
"[attr.aria-label]": "label()"
|
|
84
|
+
},
|
|
85
|
+
template: "<svg viewBox=\"0 0 200 48\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\r\n <polyline\r\n [attr.points]=\"points()\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linejoin=\"round\"\r\n stroke-linecap=\"round\"\r\n vector-effect=\"non-scaling-stroke\"\r\n />\r\n</svg>\r\n",
|
|
86
|
+
styles: [":host{display:block;inline-size:100%;block-size:3rem;color:var(--hy-primary)}svg{display:block;inline-size:100%;block-size:100%}\n"]
|
|
87
|
+
}]
|
|
88
|
+
}],
|
|
89
|
+
propDecorators: {
|
|
90
|
+
data: [{
|
|
91
|
+
type: i0.Input,
|
|
92
|
+
args: [{
|
|
93
|
+
isSignal: true,
|
|
94
|
+
alias: "data",
|
|
95
|
+
required: true
|
|
96
|
+
}]
|
|
97
|
+
}],
|
|
98
|
+
label: [{
|
|
99
|
+
type: i0.Input,
|
|
100
|
+
args: [{
|
|
101
|
+
isSignal: true,
|
|
102
|
+
alias: "label",
|
|
103
|
+
required: true
|
|
104
|
+
}]
|
|
105
|
+
}]
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export { HySparkline };
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=hyalo-angular-sparkline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyalo-angular-sparkline.mjs","names":[],"sources":["../../../projects/hyalo/sparkline/sparkline.ts","../../../projects/hyalo/sparkline/sparkline.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\r\n@Component({\r\n selector: 'hy-sparkline',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './sparkline.html',\r\n styleUrl: './sparkline.css',\r\n host: { role: 'img', '[attr.aria-label]': 'label()' },\r\n})\r\nexport class HySparkline {\r\n readonly data = input.required<readonly number[]>();\r\n readonly label = input.required<string>();\r\n readonly points = computed(() => {\r\n const values = this.data().filter(Number.isFinite);\r\n if (!values.length) return '';\r\n const maximum = values[0] ?? 0;\r\n let scale = Math.abs(maximum);\r\n for (const value of values) scale = Math.max(scale, Math.abs(value));\r\n const normalized = values.map((value) => (scale ? value / scale : 0));\r\n let min = Infinity,\r\n max = -Infinity;\r\n for (const value of normalized) {\r\n min = Math.min(min, value);\r\n max = Math.max(max, value);\r\n }\r\n const selected = new Set([0, values.length - 1]);\r\n const bucket = Math.max(1, Math.ceil(values.length / 80));\r\n for (let start = 0; start < values.length; start += bucket) {\r\n let low = start,\r\n high = start;\r\n for (let i = start; i < Math.min(values.length, start + bucket); i++) {\r\n if ((normalized[i] ?? 0) < (normalized[low] ?? 0)) low = i;\r\n if ((normalized[i] ?? 0) > (normalized[high] ?? 0)) high = i;\r\n }\r\n selected.add(low);\r\n selected.add(high);\r\n }\r\n return [...selected]\r\n .sort((a, b) => a - b)\r\n .map(\r\n (index) =>\r\n (values.length === 1 ? 100 : (index / (values.length - 1)) * 196 + 2).toFixed(2) +\r\n ',' +\r\n (max === min ? 24 : 44 - (((normalized[index] ?? 0) - min) / (max - min)) * 40).toFixed(\r\n 2,\r\n ),\r\n )\r\n .join(' ');\r\n });\r\n}\r\n","<svg viewBox=\"0 0 200 48\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\r\n <polyline\r\n [attr.points]=\"points()\"\r\n fill=\"none\"\r\n stroke=\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AAA,oIAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, afterNextRender, afterRenderEffect, computed, inject, input, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { HyMotion } from "@hyalo/angular/motion";
|
|
4
|
+
var HySplitText = class HySplitText {
|
|
5
|
+
el = inject(ElementRef).nativeElement;
|
|
6
|
+
motion = inject(HyMotion);
|
|
7
|
+
destroyRef = inject(DestroyRef);
|
|
8
|
+
measure = viewChild.required("measure", ...ngDevMode ? [{ debugName: "measure" }] : /* istanbul ignore next */ []);
|
|
9
|
+
text = input.required(...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
10
|
+
lines = signal([], ...ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []);
|
|
11
|
+
entered = signal(false, ...ngDevMode ? [{ debugName: "entered" }] : /* istanbul ignore next */ []);
|
|
12
|
+
ready = signal(false, ...ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []);
|
|
13
|
+
remeasure;
|
|
14
|
+
shown = computed(() => this.entered() || !this.motion.enabled(), ...ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []);
|
|
15
|
+
words = computed(() => this.text().split(/(\s+)/u), ...ngDevMode ? [{ debugName: "words" }] : /* istanbul ignore next */ []);
|
|
16
|
+
constructor() {
|
|
17
|
+
afterRenderEffect(() => {
|
|
18
|
+
this.text();
|
|
19
|
+
if (this.ready()) this.remeasure?.();
|
|
20
|
+
});
|
|
21
|
+
afterNextRender(() => {
|
|
22
|
+
let alive = true;
|
|
23
|
+
const split = () => {
|
|
24
|
+
const lines = [];
|
|
25
|
+
let top;
|
|
26
|
+
for (const child of Array.from(this.measure().nativeElement.children)) {
|
|
27
|
+
const y = child.getBoundingClientRect().top;
|
|
28
|
+
if (top === void 0 || Math.abs(y - top) > 2) {
|
|
29
|
+
lines.push(child.textContent ?? "");
|
|
30
|
+
top = y;
|
|
31
|
+
} else lines[lines.length - 1] += child.textContent ?? "";
|
|
32
|
+
}
|
|
33
|
+
this.lines.set(lines);
|
|
34
|
+
};
|
|
35
|
+
const resize = typeof ResizeObserver === "function" ? new ResizeObserver(split) : null;
|
|
36
|
+
this.remeasure = split;
|
|
37
|
+
resize?.observe(this.el);
|
|
38
|
+
this.el.ownerDocument.fonts?.ready.then(() => {
|
|
39
|
+
if (alive) split();
|
|
40
|
+
});
|
|
41
|
+
split();
|
|
42
|
+
this.ready.set(true);
|
|
43
|
+
const observer = typeof IntersectionObserver === "function" ? new IntersectionObserver(([entry]) => {
|
|
44
|
+
if (entry?.isIntersecting) {
|
|
45
|
+
this.entered.set(true);
|
|
46
|
+
observer?.disconnect();
|
|
47
|
+
}
|
|
48
|
+
}) : null;
|
|
49
|
+
if (observer) observer.observe(this.el);
|
|
50
|
+
else this.entered.set(true);
|
|
51
|
+
this.destroyRef.onDestroy(() => {
|
|
52
|
+
alive = false;
|
|
53
|
+
resize?.disconnect();
|
|
54
|
+
observer?.disconnect();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
59
|
+
minVersion: "12.0.0",
|
|
60
|
+
version: "22.2.3",
|
|
61
|
+
ngImport: i0,
|
|
62
|
+
type: HySplitText,
|
|
63
|
+
deps: [],
|
|
64
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
65
|
+
});
|
|
66
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
67
|
+
minVersion: "17.0.0",
|
|
68
|
+
version: "22.2.3",
|
|
69
|
+
type: HySplitText,
|
|
70
|
+
isStandalone: true,
|
|
71
|
+
selector: "hy-split-text",
|
|
72
|
+
inputs: { text: {
|
|
73
|
+
classPropertyName: "text",
|
|
74
|
+
publicName: "text",
|
|
75
|
+
isSignal: true,
|
|
76
|
+
isRequired: true,
|
|
77
|
+
transformFunction: null
|
|
78
|
+
} },
|
|
79
|
+
host: { properties: { "attr.data-shown": "shown()" } },
|
|
80
|
+
viewQueries: [{
|
|
81
|
+
propertyName: "measure",
|
|
82
|
+
first: true,
|
|
83
|
+
predicate: ["measure"],
|
|
84
|
+
descendants: true,
|
|
85
|
+
isSignal: true
|
|
86
|
+
}],
|
|
87
|
+
ngImport: i0,
|
|
88
|
+
template: "<span class=\"accessible\">{{ text() }}</span>\r\n<span #measure class=\"measure\" aria-hidden=\"true\">\r\n @for (word of words(); track $index) {\r\n <span>{{ word }}</span>\r\n }\r\n</span>\r\n<span class=\"visual\" aria-hidden=\"true\">\r\n @for (line of lines(); track $index; let i = $index) {\r\n <span class=\"line\"\r\n ><span [style.transition-delay.ms]=\"i * 60\">{{ line }}</span></span\r\n >\r\n } @empty {\r\n {{ text() }}\r\n }\r\n</span>\r\n",
|
|
89
|
+
styles: [":host{display:block;position:relative}.accessible{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.measure{position:absolute;inset:0;visibility:hidden;pointer-events:none;white-space:pre-wrap}.line{display:block;overflow:clip}.line>span{display:block;transition:transform var(--hy-dur-scene) var(--hy-ease-out),opacity var(--hy-dur-scene) var(--hy-ease-out)}:host([data-shown=\"false\"]) .line>span{transform:translateY(100%);opacity:0}@media(prefers-reduced-motion:reduce){.line>span{transform:none!important;opacity:1!important;transition:none}}\n"],
|
|
90
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
94
|
+
minVersion: "12.0.0",
|
|
95
|
+
version: "22.2.3",
|
|
96
|
+
ngImport: i0,
|
|
97
|
+
type: HySplitText,
|
|
98
|
+
decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{
|
|
101
|
+
selector: "hy-split-text",
|
|
102
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
103
|
+
host: { "[attr.data-shown]": "shown()" },
|
|
104
|
+
template: "<span class=\"accessible\">{{ text() }}</span>\r\n<span #measure class=\"measure\" aria-hidden=\"true\">\r\n @for (word of words(); track $index) {\r\n <span>{{ word }}</span>\r\n }\r\n</span>\r\n<span class=\"visual\" aria-hidden=\"true\">\r\n @for (line of lines(); track $index; let i = $index) {\r\n <span class=\"line\"\r\n ><span [style.transition-delay.ms]=\"i * 60\">{{ line }}</span></span\r\n >\r\n } @empty {\r\n {{ text() }}\r\n }\r\n</span>\r\n",
|
|
105
|
+
styles: [":host{display:block;position:relative}.accessible{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.measure{position:absolute;inset:0;visibility:hidden;pointer-events:none;white-space:pre-wrap}.line{display:block;overflow:clip}.line>span{display:block;transition:transform var(--hy-dur-scene) var(--hy-ease-out),opacity var(--hy-dur-scene) var(--hy-ease-out)}:host([data-shown=\"false\"]) .line>span{transform:translateY(100%);opacity:0}@media(prefers-reduced-motion:reduce){.line>span{transform:none!important;opacity:1!important;transition:none}}\n"]
|
|
106
|
+
}]
|
|
107
|
+
}],
|
|
108
|
+
ctorParameters: () => [],
|
|
109
|
+
propDecorators: {
|
|
110
|
+
measure: [{
|
|
111
|
+
type: i0.ViewChild,
|
|
112
|
+
args: ["measure", { isSignal: true }]
|
|
113
|
+
}],
|
|
114
|
+
text: [{
|
|
115
|
+
type: i0.Input,
|
|
116
|
+
args: [{
|
|
117
|
+
isSignal: true,
|
|
118
|
+
alias: "text",
|
|
119
|
+
required: true
|
|
120
|
+
}]
|
|
121
|
+
}]
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
export { HySplitText };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=hyalo-angular-split-text.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyalo-angular-split-text.mjs","names":[],"sources":["../../../projects/hyalo/split-text/split-text.ts","../../../projects/hyalo/split-text/split-text.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n afterNextRender,\r\n afterRenderEffect,\r\n computed,\r\n inject,\r\n input,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { HyMotion } from '@hyalo/angular/motion';\r\n/** Splits measured lines after hydration. The accessible text is read once. */\r\n@Component({\r\n selector: 'hy-split-text',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[attr.data-shown]': 'shown()' },\r\n templateUrl: './split-text.html',\r\n styleUrl: './split-text.css',\r\n})\r\nexport class HySplitText {\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\r\n private readonly motion = inject(HyMotion);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly measure = viewChild.required<ElementRef<HTMLElement>>('measure');\r\n readonly text = input.required<string>();\r\n protected readonly lines = signal<readonly string[]>([]);\r\n private readonly entered = signal(false);\r\n private readonly ready = signal(false);\r\n private remeasure: (() => void) | undefined;\r\n protected readonly shown = computed(() => this.entered() || !this.motion.enabled());\r\n protected readonly words = computed(() => this.text().split(/(\\s+)/u));\r\n constructor() {\r\n afterRenderEffect(() => {\r\n this.text();\r\n if (this.ready()) this.remeasure?.();\r\n });\r\n afterNextRender(() => {\r\n let alive = true;\r\n const split = (): void => {\r\n const lines: string[] = [];\r\n let top: number | undefined;\r\n for (const child of Array.from(this.measure().nativeElement.children)) {\r\n const y = child.getBoundingClientRect().top;\r\n if (top === undefined || Math.abs(y - top) > 2) {\r\n lines.push(child.textContent ?? '');\r\n top = y;\r\n } else lines[lines.length - 1] += child.textContent ?? '';\r\n }\r\n this.lines.set(lines);\r\n };\r\n const resize = typeof ResizeObserver === 'function' ? new ResizeObserver(split) : null;\r\n this.remeasure = split;\r\n resize?.observe(this.el);\r\n void this.el.ownerDocument.fonts?.ready.then(() => {\r\n if (alive) split();\r\n });\r\n split();\r\n this.ready.set(true);\r\n const observer =\r\n typeof IntersectionObserver === 'function'\r\n ? new IntersectionObserver(([entry]) => {\r\n if (entry?.isIntersecting) {\r\n this.entered.set(true);\r\n observer?.disconnect();\r\n }\r\n })\r\n : null;\r\n if (observer) observer.observe(this.el);\r\n else this.entered.set(true);\r\n this.destroyRef.onDestroy(() => {\r\n alive = false;\r\n resize?.disconnect();\r\n observer?.disconnect();\r\n });\r\n });\r\n }\r\n}\r\n","<span class=\"accessible\">{{ text() }}</span>\r\n<span #measure class=\"measure\" aria-hidden=\"true\">\r\n @for (word of words(); track $index) {\r\n <span>{{ word }}</span>\r\n }\r\n</span>\r\n<span class=\"visual\" aria-hidden=\"true\">\r\n @for (line of lines(); track $index; let i = $index) {\r\n <span class=\"line\"\r\n ><span [style.transition-delay.ms]=\"i * 60\">{{ line }}</span></span\r\n >\r\n } @empty {\r\n {{ text() }}\r\n }\r\n</span>\r\n"],"mappings":";;;AAsBA,IAAa,cAAb,MAAa,YAAW;CACL,KAAK,OAAgC,UAAU,CAAC,CAAC;CACjD,SAAS,OAAO,QAAQ;CACxB,aAAa,OAAO,UAAU;CAC9B,UAAU,UAAU,SAAkC,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACxE,OAAO,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACrB,QAAQ,OAA0B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,QAAQ,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC9B;CACW,QAAQ,eAAe,KAAK,QAAO,KAAM,CAAC,KAAK,OAAO,QAAO,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA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