@birdapi/velinstyle 1.1.0 → 1.2.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/README.de.md +89 -161
- package/README.md +187 -119
- package/cli/blueprint.js +98 -5
- package/cli/blueprints/app-chrome.html +18 -0
- package/cli/blueprints/benefits-grid.html +9 -0
- package/cli/blueprints/bottom-nav-mobile.html +2 -1
- package/cli/blueprints/cookie-consent.html +1 -1
- package/cli/blueprints/cta-band.html +6 -0
- package/cli/blueprints/faq-section.html +18 -0
- package/cli/blueprints/filter-bar.html +4 -4
- package/cli/blueprints/form-contact.html +6 -5
- package/cli/blueprints/hero-section.html +3 -3
- package/cli/blueprints/notification-center.html +1 -1
- package/cli/blueprints/onboarding.html +2 -1
- package/cli/blueprints/ops-console.html +29 -0
- package/cli/blueprints/pricing-band.html +37 -0
- package/cli/blueprints/process-steps.html +10 -0
- package/cli/blueprints/services-grid.html +9 -0
- package/cli/blueprints/settings-panel.html +8 -6
- package/cli/blueprints/split-hero.html +25 -0
- package/cli/blueprints/testimonials.html +8 -0
- package/cli/blueprints/trust-bar.html +10 -0
- package/cli/cli-manifest.json +81 -17
- package/cli/contrast-utils.js +97 -0
- package/cli/create.js +370 -0
- package/cli/docgen/extract-attributes.js +128 -10
- package/cli/docgen/extract-cli.js +3 -2
- package/cli/docgen/extract-components.js +61 -2
- package/cli/docgen/extract-utilities.js +10 -10
- package/cli/doctor.js +119 -0
- package/cli/index.js +560 -44
- package/cli/meta.js +84 -1
- package/cli/perf-audit.js +15 -2
- package/cli/prompt-engine.js +243 -0
- package/cli/review.js +268 -0
- package/cli/scaffold.js +119 -4
- package/cli/scanner-rules-data.js +7 -0
- package/cli/scanner.js +357 -4
- package/cli/serve.js +81 -0
- package/cli/skills.js +223 -0
- package/cli/transparency.js +221 -0
- package/cli/wc-api.js +89 -0
- package/cli/workflow.js +42 -0
- package/components/index.js +2 -0
- package/components/runtime/component-loaders.js +2 -0
- package/components/velin-accordion.js +62 -13
- package/components/velin-bottom-nav.js +10 -0
- package/components/velin-calendar.js +212 -0
- package/components/velin-command.js +18 -2
- package/components/velin-data-table.js +78 -1
- package/components/velin-dialog.js +4 -1
- package/components/velin-drawer.js +2 -4
- package/components/velin-file-dropzone.js +162 -0
- package/components/velin-icon.js +22 -1
- package/components/velin-lightbox.js +5 -3
- package/components/velin-modal.js +2 -4
- package/components/velin-search.js +1 -1
- package/components/velin-sheet.js +2 -4
- package/core/a11y/component-contracts.json +20 -3
- package/core/attributes/registry.js +14 -0
- package/core/meta/build.js +125 -5
- package/core/meta/design-constraints/contact.json +9 -0
- package/core/meta/design-constraints/faq.json +9 -0
- package/core/meta/design-constraints/hero.json +13 -0
- package/core/meta/knowledge/components.json +622 -0
- package/core/meta/knowledge/tokens.json +282 -0
- package/core/meta/pages/registry.json +294 -0
- package/core/meta/schema.js +13 -1
- package/core/meta/sections/registry.json +185 -0
- package/core/transparency/attach.js +74 -0
- package/core/transparency/claims.js +97 -0
- package/core/transparency/doctor.js +142 -0
- package/core/transparency/engine.js +75 -0
- package/core/transparency/export.js +98 -0
- package/core/transparency/index.js +30 -0
- package/core/transparency/migrate.js +130 -0
- package/core/transparency/normalize.js +125 -0
- package/core/transparency/policy.js +105 -0
- package/core/transparency/providers.js +235 -0
- package/core/transparency/registry.js +104 -0
- package/core/transparency/renderer.js +111 -0
- package/core/transparency/reporter.js +113 -0
- package/core/transparency/validator.js +112 -0
- package/dist/chunks/attach-H2ZSEAE6.js +365 -0
- package/dist/chunks/{attributes-STYCS3O5.js → attributes-A423NX5J.js} +3 -3
- package/dist/chunks/attributes-DZCXX2RZ.js +404 -0
- package/dist/chunks/{attributes-353XDOAX.js → attributes-F6UPIEVP.js} +1 -1
- package/dist/chunks/{attributes-ADOKLKA7.js → attributes-GLYXGGAL.js} +3 -3
- package/dist/chunks/{attributes-TPANLMLF.js → attributes-UFTYOSAU.js} +3 -3
- package/dist/chunks/attributes-XGLXLR2T.js +391 -0
- package/dist/chunks/attributes-YF4NI2QS.js +391 -0
- package/dist/chunks/browser-AUABBYUK.js +1544 -0
- package/dist/chunks/{chunk-RSMRR27R.js → chunk-2LSKX57P.js} +12 -10
- package/dist/chunks/{chunk-IEHKRARD.js → chunk-2TGCVDUL.js} +11 -9
- package/dist/chunks/{chunk-SRL6EWHP.js → chunk-5JWGUAPC.js} +17 -13
- package/dist/chunks/chunk-7YSO2OQ2.js +113 -0
- package/dist/chunks/{chunk-QVHYL3R4.js → chunk-BHR3ZG6U.js} +6 -6
- package/dist/chunks/chunk-CQMTCEI6.js +113 -0
- package/dist/chunks/{chunk-J472ERN2.js → chunk-JMSIHEYX.js} +15 -4
- package/dist/chunks/{chunk-MKZP2TBH.js → chunk-L7ZGUU4D.js} +2 -2
- package/dist/chunks/chunk-TUGIPKW5.js +113 -0
- package/dist/chunks/{highlight-GJHHV4KM.js → highlight-M2ELQNYK.js} +1 -1
- package/dist/chunks/runtime-entry.js +1 -1
- package/dist/chunks/{velin-accordion-FBIPAEXG.js → velin-accordion-WSY6BMLA.js} +64 -10
- package/dist/chunks/{velin-bottom-nav-7GEMPIM6.js → velin-bottom-nav-5RVRNGIP.js} +25 -0
- package/dist/chunks/{velin-bottom-nav-N3DFQR66.js → velin-bottom-nav-N5F4UO2I.js} +26 -1
- package/dist/chunks/velin-calendar-OFE6THUD.js +210 -0
- package/dist/chunks/velin-calendar-PGVNJTXK.js +217 -0
- package/dist/chunks/velin-calendar-XC7JRDSH.js +217 -0
- package/dist/chunks/{velin-code-block-CIAURDRJ.js → velin-code-block-ZGWG7JI5.js} +1 -1
- package/dist/chunks/{velin-combobox-NXS4QB4R.js → velin-combobox-56V2ZWT5.js} +1 -1
- package/dist/chunks/{velin-command-ONKO2A3J.js → velin-command-2HO2EKR6.js} +29 -2
- package/dist/chunks/{velin-command-TMLSRGIU.js → velin-command-ZJSLPK7B.js} +30 -3
- package/dist/chunks/{velin-copy-NYDBOKXT.js → velin-copy-XDQSV2XU.js} +1 -1
- package/dist/chunks/{velin-countdown-4ZVDGK4R.js → velin-countdown-V4Z5MA63.js} +1 -1
- package/dist/chunks/velin-data-table-UVR42UUM.js +372 -0
- package/dist/chunks/{velin-dialog-GTTZI564.js → velin-dialog-3YK2RPRV.js} +9 -2
- package/dist/chunks/{velin-dialog-ELFOZIXZ.js → velin-dialog-S24KAP4S.js} +3 -1
- package/dist/chunks/{velin-drawer-BE6TYN3H.js → velin-drawer-5PNU624J.js} +2 -4
- package/dist/chunks/{velin-drawer-DLL2GLT6.js → velin-drawer-CCM6S25D.js} +3 -5
- package/dist/chunks/{velin-email-RBX6ZR4S.js → velin-email-TNFONXPW.js} +1 -1
- package/dist/chunks/velin-file-dropzone-QRGF2JNA.js +154 -0
- package/dist/chunks/velin-file-dropzone-XIZMJ3NB.js +154 -0
- package/dist/chunks/{velin-icon-7M76DOPB.js → velin-icon-A6NCXGUK.js} +59 -17
- package/dist/chunks/{velin-icon-ZTSKUOVN.js → velin-icon-EC4B5XCM.js} +18 -5
- package/dist/chunks/{velin-lightbox-6E7CAATP.js → velin-lightbox-FFK4TUUP.js} +7 -6
- package/dist/chunks/{velin-lightbox-NXA3U2FM.js → velin-lightbox-P725FLTY.js} +5 -4
- package/dist/chunks/{velin-menubar-J66JXRWW.js → velin-menubar-6I2LM5HL.js} +1 -1
- package/dist/chunks/{velin-modal-5HYNNNUI.js → velin-modal-ICTMGRSU.js} +7 -8
- package/dist/chunks/{velin-modal-AEOTZ67O.js → velin-modal-JBNODH7D.js} +2 -4
- package/dist/chunks/{velin-popover-T72HK3DF.js → velin-popover-WZG2GHBL.js} +25 -4
- package/dist/chunks/{velin-rating-N4DI2XNL.js → velin-rating-QBBYRRBU.js} +1 -1
- package/dist/chunks/{velin-search-7B4KJ6TX.js → velin-search-B3L6J2RP.js} +2 -2
- package/dist/chunks/{velin-search-2XRQFBCS.js → velin-search-L3UG6NDQ.js} +5 -4
- package/dist/chunks/{velin-secure-field-6PV7RZDJ.js → velin-secure-field-DGYMP7OK.js} +1 -1
- package/dist/chunks/{velin-segmented-control-GYD5BIXQ.js → velin-segmented-control-P74GJPAR.js} +1 -1
- package/dist/chunks/{velin-sheet-R2Y67X6H.js → velin-sheet-M5GZZD7G.js} +2 -4
- package/dist/chunks/{velin-sheet-OUK6572T.js → velin-sheet-X7RXIWKV.js} +3 -5
- package/dist/chunks/{velin-stepper-X54WGHDG.js → velin-stepper-4YQJUHPC.js} +12 -5
- package/dist/chunks/{velin-toast-OMMOA2DK.js → velin-toast-UG5LWTG2.js} +5 -1
- package/dist/chunks/{velin-tooltip-BDHGRTQB.js → velin-tooltip-ZDH5SDLU.js} +1 -1
- package/dist/llms.txt +31 -8
- package/dist/search-index.json +182 -10
- package/dist/velin-agent.json +3980 -31
- package/dist/velinstyle-components.iife.js +1622 -286
- package/dist/velinstyle-components.js +1624 -286
- package/dist/velinstyle-components.min.js +262 -114
- package/dist/velinstyle.css +412 -67
- package/dist/velinstyle.d.ts +2 -0
- package/dist/velinstyle.min.css +1 -1
- package/package.json +21 -6
- package/packages/skill-engine/README.md +24 -0
- package/packages/skill-engine/package.json +7 -0
- package/packages/skill-engine/src/catalog.js +29 -0
- package/packages/skill-engine/src/index.js +5 -0
- package/packages/skill-engine/src/install.js +69 -0
- package/packages/skill-engine/src/registry.js +27 -0
- package/packages/skill-engine/src/resolve.js +68 -0
- package/packages/skill-engine/src/validate.js +40 -0
- package/packages/velinstyle-skills/README.md +6 -0
- package/packages/velinstyle-skills/adapter.json +8 -0
- package/packages/velinstyle-skills/bundles/landing-starter.bundle.yaml +12 -0
- package/packages/velinstyle-skills/bundles/review-suite.bundle.yaml +11 -0
- package/packages/velinstyle-skills/catalog.json +1004 -0
- package/packages/velinstyle-skills/graphs/component-ship.graph.yaml +14 -0
- package/packages/velinstyle-skills/graphs/landingpage.graph.yaml +21 -0
- package/packages/velinstyle-skills/graphs/release-gate.graph.yaml +15 -0
- package/packages/velinstyle-skills/index.js +22 -0
- package/packages/velinstyle-skills/package.json +7 -0
- package/packages/velinstyle-skills/packs/accessibility.pack.yaml +9 -0
- package/packages/velinstyle-skills/packs/design.pack.yaml +10 -0
- package/packages/velinstyle-skills/packs/documentation.pack.yaml +8 -0
- package/packages/velinstyle-skills/packs/enterprise.pack.yaml +10 -0
- package/packages/velinstyle-skills/packs/frontend.pack.yaml +10 -0
- package/packages/velinstyle-skills/packs/review.pack.yaml +9 -0
- package/packages/velinstyle-skills/projects/admin-panel.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/blog.project.yaml +11 -0
- package/packages/velinstyle-skills/projects/documentation-portal.project.yaml +13 -0
- package/packages/velinstyle-skills/projects/ecommerce-shop.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/landing-page.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/laravel-dashboard.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/marketing-website.project.yaml +14 -0
- package/packages/velinstyle-skills/projects/portfolio.project.yaml +12 -0
- package/packages/velinstyle-skills/registry.json +142 -0
- package/packages/velinstyle-skills/scripts/generate-assets.mjs +163 -0
- package/packages/velinstyle-skills/skills/velin-a11y-focus-keyboard/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-a11y-page-checklist/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-a11y-scan-fix/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-ai-agent-briefing/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-ai-plan-scaffold-review/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-ai-skill-authoring/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-accessibility-map/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-api-contract/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-recipe/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-select-compose/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-design-hero-compose/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-design-section-rhythm/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-design-surface-roles/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dev-component-wire/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dev-page-scaffold/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dev-plan-first/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-docs-component-guide/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-docs-generate-api/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dx-doctor-setup/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dx-project-init/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-migration-legacy-wc/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-migration-prefix-classes/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-perf-audit-fix/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-perf-runtime-tree-shake/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-release-changelog-sync/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-release-meta-rebuild/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-review-conversion-hero/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-review-page-gate/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-review-seo-meta/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-security-sanitize-html/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-security-scan-pii/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-testing-a11y-suite/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-testing-visual-smoke/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-themes-apply-token/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-themes-contrast-check/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-utilities-layout-apply/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-utilities-prefix-fix/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-utilities-token-map/SKILL.md +57 -0
- package/packages/velinstyle-skills/templates/admin-panel.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/blog.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/documentation-portal.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/ecommerce-shop.template.yaml +13 -0
- package/packages/velinstyle-skills/templates/landing-page.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/laravel-dashboard.template.yaml +11 -0
- package/packages/velinstyle-skills/templates/marketing-website.template.yaml +13 -0
- package/packages/velinstyle-skills/templates/portfolio.template.yaml +12 -0
- package/schemas/component-knowledge.schema.json +33 -0
- package/schemas/design-constraint.schema.json +15 -0
- package/schemas/design-intelligence.schema.json +19 -0
- package/schemas/design-rule.schema.json +19 -0
- package/schemas/page-template.schema.json +24 -0
- package/schemas/review-report.schema.json +36 -0
- package/schemas/section.schema.json +22 -0
- package/schemas/skill-bundle.schema.json +15 -0
- package/schemas/skill-graph.schema.json +25 -0
- package/schemas/skill-pack.schema.json +14 -0
- package/schemas/skill-project.schema.json +16 -0
- package/schemas/skill-record.schema.json +27 -0
- package/schemas/skill-registry.schema.json +17 -0
- package/schemas/skill-template.schema.json +17 -0
- package/schemas/token-graph.schema.json +27 -0
- package/schemas/utility.schema.json +166 -0
- package/src/components/alert.css +22 -1
- package/src/components/calendar-dropzone.css +5 -0
- package/src/components/transparency.css +138 -0
- package/src/layout/app-shell.css +33 -0
- package/src/tokens/shadow.css +13 -0
- package/src/utilities/border.css +2 -0
- package/src/utilities/display.css +1 -24
- package/src/utilities/responsive.css +16 -1
- package/src/utilities/spacing.css +32 -0
- package/src/velinstyle.css +3 -0
- package/dist/chunks/attributes-3BZLI7XF.js +0 -364
- package/dist/chunks/attributes-4N5JP4CG.js +0 -364
- package/dist/chunks/attributes-5Q2WXGRC.js +0 -374
- package/dist/chunks/attributes-AIR7SVLK.js +0 -364
- package/dist/chunks/attributes-BGRN5XZO.js +0 -364
- package/dist/chunks/attributes-BVSQAYLR.js +0 -364
- package/dist/chunks/attributes-CDYFUY7Y.js +0 -364
- package/dist/chunks/attributes-JMYJZBPE.js +0 -364
- package/dist/chunks/attributes-R5JY3X4O.js +0 -374
- package/dist/chunks/attributes-TNSPQTHX.js +0 -374
- package/dist/chunks/chunk-2354NEBP.js +0 -109
- package/dist/chunks/chunk-2VNA7G7S.js +0 -109
- package/dist/chunks/chunk-AQLRJSGG.js +0 -109
- package/dist/chunks/chunk-EWPSDMQT.js +0 -109
- package/dist/chunks/chunk-LA7264K4.js +0 -85
- package/dist/chunks/chunk-QTJJ3DPO.js +0 -109
- package/dist/chunks/chunk-RZQVWFHW.js +0 -109
- package/dist/chunks/chunk-U4XHMZ7D.js +0 -109
- package/dist/chunks/chunk-V5YIUA6G.js +0 -109
- package/dist/chunks/chunk-XIET2VSZ.js +0 -109
- package/dist/chunks/chunk-XYLJ2GCB.js +0 -205
- package/dist/chunks/chunk-ZPSPKUYD.js +0 -109
- package/dist/chunks/highlight-XTHRKBA3.js +0 -37
- package/dist/chunks/velin-bottom-nav-2N2TYWOF.js +0 -86
- package/dist/chunks/velin-carousel-Y5VCOABZ.js +0 -213
- package/dist/chunks/velin-code-block-ASUBTAQV.js +0 -119
- package/dist/chunks/velin-code-block-TSUKPY4C.js +0 -123
- package/dist/chunks/velin-code-block-Y6CM726Q.js +0 -119
- package/dist/chunks/velin-combobox-2KDTCQ7N.js +0 -155
- package/dist/chunks/velin-command-M7RNHUPR.js +0 -136
- package/dist/chunks/velin-copy-T5KDTDXP.js +0 -81
- package/dist/chunks/velin-countdown-5XSTN3BH.js +0 -101
- package/dist/chunks/velin-counter-ISCTEAHI.js +0 -118
- package/dist/chunks/velin-dialog-D2GUHSCD.js +0 -144
- package/dist/chunks/velin-dialog-IJLFDXAJ.js +0 -144
- package/dist/chunks/velin-dialog-TNS3WXMB.js +0 -144
- package/dist/chunks/velin-drawer-MJS6WCF7.js +0 -130
- package/dist/chunks/velin-email-N5B5ZYTE.js +0 -90
- package/dist/chunks/velin-icon-KZO3IEHG.js +0 -164
- package/dist/chunks/velin-lightbox-I75U6JF4.js +0 -140
- package/dist/chunks/velin-lightbox-QOTB4PRL.js +0 -140
- package/dist/chunks/velin-lightbox-UCD6N7HF.js +0 -140
- package/dist/chunks/velin-live-dot-XHUZCIDZ.js +0 -67
- package/dist/chunks/velin-menubar-SFEXJE56.js +0 -86
- package/dist/chunks/velin-modal-2HOBXE6F.js +0 -176
- package/dist/chunks/velin-modal-GLI2XZZB.js +0 -176
- package/dist/chunks/velin-popover-EXINRIGJ.js +0 -145
- package/dist/chunks/velin-popover-OXX7MRZ6.js +0 -145
- package/dist/chunks/velin-popover-YKCCROJG.js +0 -145
- package/dist/chunks/velin-rating-XRQJV4LO.js +0 -91
- package/dist/chunks/velin-scroll-top-F2FCZNYD.js +0 -58
- package/dist/chunks/velin-search-4YHJWYSS.js +0 -556
- package/dist/chunks/velin-search-LWHY23Q5.js +0 -474
- package/dist/chunks/velin-secure-field-H7FSBUJW.js +0 -95
- package/dist/chunks/velin-segmented-control-PQX6LKOJ.js +0 -109
- package/dist/chunks/velin-sheet-3OGI4HD7.js +0 -119
- package/dist/chunks/velin-sparkline-GVEANJVW.js +0 -184
- package/dist/chunks/velin-sparkline-KDA3GQAN.js +0 -162
- package/dist/chunks/velin-stepper-2ZIHLKGM.js +0 -141
- package/dist/chunks/velin-stepper-FYEUEWE6.js +0 -141
- package/dist/chunks/velin-stepper-wc-QU3KRVQR.js +0 -133
- package/dist/chunks/velin-theme-toggle-BNNS7WLV.js +0 -285
- package/dist/chunks/velin-theme-toggle-NO7V4TWI.js +0 -285
- package/dist/chunks/velin-theme-toggle-QELCJM2Q.js +0 -291
- package/dist/chunks/velin-toast-RCZ4CSUC.js +0 -109
- package/dist/chunks/velin-toast-WEUBTJG6.js +0 -109
- package/dist/chunks/velin-tooltip-664IOHZA.js +0 -112
- package/dist/chunks/velin-tooltip-wc-LXDVT6DE.js +0 -103
- package/dist/chunks/worker-client-R6DBYPFT.js +0 -46
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
rovingTabindex
|
|
3
|
-
} from "./chunk-42VVPW6N.js";
|
|
4
|
-
import {
|
|
5
|
-
escapeHTML
|
|
6
|
-
} from "./chunk-MKZP2TBH.js";
|
|
7
|
-
|
|
8
|
-
// components/velin-combobox.js
|
|
9
|
-
var styles = `
|
|
10
|
-
:host { display: inline-block; position: relative; }
|
|
11
|
-
.listbox {
|
|
12
|
-
position: absolute; z-index: var(--velin-z-dropdown, 100);
|
|
13
|
-
inset-block-start: 100%; inset-inline-start: 0;
|
|
14
|
-
min-inline-size: 100%; margin-block-start: var(--velin-space-1, 0.25rem);
|
|
15
|
-
padding-block: var(--velin-space-1, 0.25rem);
|
|
16
|
-
background: var(--velin-color-surface-bright, #fff);
|
|
17
|
-
border: 1px solid var(--velin-color-border, #ddd);
|
|
18
|
-
border-radius: var(--velin-radius-md, 0.5rem);
|
|
19
|
-
box-shadow: var(--velin-shadow-lg, 0 10px 15px rgba(0,0,0,0.08));
|
|
20
|
-
opacity: 0; visibility: hidden;
|
|
21
|
-
transition: opacity 150ms ease, visibility 150ms ease;
|
|
22
|
-
}
|
|
23
|
-
:host([open]) .listbox { opacity: 1; visibility: visible; }
|
|
24
|
-
::slotted([role="option"]) {
|
|
25
|
-
display: block; inline-size: 100%;
|
|
26
|
-
padding: var(--velin-space-2, 0.5rem) var(--velin-space-4, 1rem);
|
|
27
|
-
min-block-size: 2.5rem;
|
|
28
|
-
text-align: start; background: none; border: none;
|
|
29
|
-
cursor: pointer; font-size: var(--velin-text-base, 1rem);
|
|
30
|
-
}
|
|
31
|
-
::slotted([role="option"][aria-selected="true"]) {
|
|
32
|
-
background: var(--velin-color-surface-dim, #eee);
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
var VelinCombobox = class extends HTMLElement {
|
|
36
|
-
static get observedAttributes() {
|
|
37
|
-
return ["open", "aria-label"];
|
|
38
|
-
}
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
42
|
-
this._onDocClick = this._onDocClick.bind(this);
|
|
43
|
-
this._onKey = this._onKey.bind(this);
|
|
44
|
-
}
|
|
45
|
-
connectedCallback() {
|
|
46
|
-
const listId = `velin-combobox-list-${Math.random().toString(36).slice(2, 9)}`;
|
|
47
|
-
this._listId = listId;
|
|
48
|
-
const listLabel = escapeHTML(this.getAttribute("aria-label") || "Options");
|
|
49
|
-
this.shadowRoot.innerHTML = `
|
|
50
|
-
<style>${styles}</style>
|
|
51
|
-
<slot name="trigger"></slot>
|
|
52
|
-
<div class="listbox" id="${listId}" role="listbox" aria-label="${listLabel}" part="listbox"><slot></slot></div>
|
|
53
|
-
`;
|
|
54
|
-
const triggerSlot = this.shadowRoot.querySelector('slot[name="trigger"]');
|
|
55
|
-
triggerSlot.addEventListener("slotchange", () => this._wireTrigger());
|
|
56
|
-
this.shadowRoot.querySelector("slot:not([name])")?.addEventListener("slotchange", () => this._wireOptions());
|
|
57
|
-
this._wireTrigger();
|
|
58
|
-
this._wireOptions();
|
|
59
|
-
this.addEventListener("keydown", this._onKey);
|
|
60
|
-
}
|
|
61
|
-
_wireTrigger() {
|
|
62
|
-
const trigger = this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];
|
|
63
|
-
if (!trigger) return;
|
|
64
|
-
trigger.setAttribute("role", "combobox");
|
|
65
|
-
trigger.setAttribute("aria-expanded", this.hasAttribute("open") ? "true" : "false");
|
|
66
|
-
trigger.setAttribute("aria-controls", this._listId);
|
|
67
|
-
trigger.setAttribute("aria-autocomplete", "list");
|
|
68
|
-
if (!trigger.id) trigger.id = `velin-combobox-trigger-${Math.random().toString(36).slice(2, 9)}`;
|
|
69
|
-
const list = this.shadowRoot.querySelector(".listbox");
|
|
70
|
-
if (list) list.setAttribute("aria-labelledby", trigger.id);
|
|
71
|
-
if (!trigger.dataset.velinComboWired) {
|
|
72
|
-
trigger.dataset.velinComboWired = "1";
|
|
73
|
-
trigger.addEventListener("click", () => this.toggle());
|
|
74
|
-
trigger.addEventListener("keydown", (e) => {
|
|
75
|
-
if (e.key === "ArrowDown" || e.key === "Enter") {
|
|
76
|
-
e.preventDefault();
|
|
77
|
-
this.open();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
_wireOptions() {
|
|
83
|
-
const options = this._getOptions();
|
|
84
|
-
options.forEach((el, i) => {
|
|
85
|
-
el.setAttribute("role", "option");
|
|
86
|
-
el.setAttribute("aria-selected", el.hasAttribute("selected") ? "true" : "false");
|
|
87
|
-
el.setAttribute("tabindex", i === 0 ? "0" : "-1");
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
_getOptions() {
|
|
91
|
-
const slot = this.shadowRoot.querySelector("slot:not([name])");
|
|
92
|
-
return slot ? slot.assignedElements().filter((el) => !el.hidden) : [];
|
|
93
|
-
}
|
|
94
|
-
toggle() {
|
|
95
|
-
this.hasAttribute("open") ? this.close() : this.open();
|
|
96
|
-
}
|
|
97
|
-
open() {
|
|
98
|
-
this.setAttribute("open", "");
|
|
99
|
-
const trigger = this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];
|
|
100
|
-
if (trigger) trigger.setAttribute("aria-expanded", "true");
|
|
101
|
-
document.addEventListener("click", this._onDocClick, true);
|
|
102
|
-
requestAnimationFrame(() => {
|
|
103
|
-
const opts = this._getOptions();
|
|
104
|
-
if (opts.length) opts[0].focus();
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
close() {
|
|
108
|
-
this.removeAttribute("open");
|
|
109
|
-
const trigger = this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];
|
|
110
|
-
if (trigger) {
|
|
111
|
-
trigger.setAttribute("aria-expanded", "false");
|
|
112
|
-
trigger.focus();
|
|
113
|
-
}
|
|
114
|
-
document.removeEventListener("click", this._onDocClick, true);
|
|
115
|
-
this.dispatchEvent(new CustomEvent("velin-close", { bubbles: true }));
|
|
116
|
-
}
|
|
117
|
-
_onDocClick(e) {
|
|
118
|
-
if (!this.contains(e.target)) this.close();
|
|
119
|
-
}
|
|
120
|
-
_onKey(e) {
|
|
121
|
-
if (!this.hasAttribute("open")) return;
|
|
122
|
-
if (e.key === "Escape") {
|
|
123
|
-
this.close();
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const options = this._getOptions();
|
|
127
|
-
if (!options.length) return;
|
|
128
|
-
rovingTabindex(this, options, e);
|
|
129
|
-
if (e.key === "Enter" && options.includes(e.target)) {
|
|
130
|
-
this._selectOption(e.target);
|
|
131
|
-
this.close();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
_selectOption(el) {
|
|
135
|
-
this._getOptions().forEach((o) => o.setAttribute("aria-selected", o === el ? "true" : "false"));
|
|
136
|
-
const trigger = this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];
|
|
137
|
-
if (trigger && "value" in trigger) trigger.value = el.textContent?.trim() || "";
|
|
138
|
-
this.dispatchEvent(new CustomEvent("velin-select", { bubbles: true, detail: { option: el } }));
|
|
139
|
-
}
|
|
140
|
-
attributeChangedCallback(name) {
|
|
141
|
-
if (name === "open") this._wireTrigger();
|
|
142
|
-
if (name === "aria-label") {
|
|
143
|
-
const list = this.shadowRoot?.querySelector(".listbox");
|
|
144
|
-
if (list) list.setAttribute("aria-label", escapeHTML(this.getAttribute("aria-label") || "Options"));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
disconnectedCallback() {
|
|
148
|
-
document.removeEventListener("click", this._onDocClick, true);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
customElements.define("velin-combobox", VelinCombobox);
|
|
152
|
-
var velin_combobox_default = VelinCombobox;
|
|
153
|
-
export {
|
|
154
|
-
velin_combobox_default as default
|
|
155
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SHADOW_A11Y_STYLES
|
|
3
|
-
} from "./chunk-F7OLHTGX.js";
|
|
4
|
-
import {
|
|
5
|
-
clearBackgroundInert,
|
|
6
|
-
restoreFocus,
|
|
7
|
-
saveFocus,
|
|
8
|
-
setBackgroundInert,
|
|
9
|
-
trapFocus
|
|
10
|
-
} from "./chunk-42VVPW6N.js";
|
|
11
|
-
import {
|
|
12
|
-
escapeHTML
|
|
13
|
-
} from "./chunk-MKZP2TBH.js";
|
|
14
|
-
|
|
15
|
-
// components/velin-command.js
|
|
16
|
-
var styles = `
|
|
17
|
-
${SHADOW_A11Y_STYLES}
|
|
18
|
-
:host { display: contents; }
|
|
19
|
-
.overlay {
|
|
20
|
-
position: fixed; inset: 0; z-index: var(--velin-z-modal, 500);
|
|
21
|
-
display: flex; align-items: flex-start; justify-content: center;
|
|
22
|
-
padding: 10vh var(--velin-space-4, 1rem) var(--velin-space-4, 1rem);
|
|
23
|
-
background: var(--velin-color-overlay, rgba(0,0,0,0.4));
|
|
24
|
-
opacity: 0; visibility: hidden;
|
|
25
|
-
transition: opacity 150ms ease, visibility 150ms ease;
|
|
26
|
-
}
|
|
27
|
-
:host([open]) .overlay { opacity: 1; visibility: visible; }
|
|
28
|
-
.panel {
|
|
29
|
-
inline-size: min(32rem, 100%);
|
|
30
|
-
background: var(--velin-color-surface-bright, #fff);
|
|
31
|
-
border-radius: var(--velin-radius-lg, 0.75rem);
|
|
32
|
-
box-shadow: var(--velin-shadow-xl, 0 20px 25px rgba(0,0,0,0.1));
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
}
|
|
35
|
-
.search {
|
|
36
|
-
inline-size: 100%; padding: var(--velin-space-4, 1rem);
|
|
37
|
-
border: none; border-bottom: 1px solid var(--velin-color-border, #ddd);
|
|
38
|
-
font-size: var(--velin-text-base, 1rem);
|
|
39
|
-
background: transparent;
|
|
40
|
-
color: var(--velin-color-text, #111);
|
|
41
|
-
}
|
|
42
|
-
.results { max-block-size: 20rem; overflow-y: auto; padding: var(--velin-space-2, 0.5rem); }
|
|
43
|
-
::slotted(button) {
|
|
44
|
-
display: flex; inline-size: 100%;
|
|
45
|
-
padding: var(--velin-space-3, 0.75rem) var(--velin-space-4, 1rem);
|
|
46
|
-
min-block-size: 2.5rem;
|
|
47
|
-
border: none; background: none; text-align: start;
|
|
48
|
-
cursor: pointer; font-size: var(--velin-text-base, 1rem);
|
|
49
|
-
border-radius: var(--velin-radius-sm, 0.25rem);
|
|
50
|
-
}
|
|
51
|
-
::slotted(button[hidden]) { display: none; }
|
|
52
|
-
::slotted(button:focus-visible) {
|
|
53
|
-
background: var(--velin-color-surface-dim, #eee);
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
var VelinCommand = class extends HTMLElement {
|
|
57
|
-
static get observedAttributes() {
|
|
58
|
-
return ["open"];
|
|
59
|
-
}
|
|
60
|
-
constructor() {
|
|
61
|
-
super();
|
|
62
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
63
|
-
this._prev = null;
|
|
64
|
-
this._onKey = this._onKey.bind(this);
|
|
65
|
-
this._onInput = this._onInput.bind(this);
|
|
66
|
-
}
|
|
67
|
-
connectedCallback() {
|
|
68
|
-
const placeholder = escapeHTML(this.getAttribute("placeholder") || "Search commands\u2026");
|
|
69
|
-
this.shadowRoot.innerHTML = `
|
|
70
|
-
<style>${styles}</style>
|
|
71
|
-
<div class="overlay" part="overlay">
|
|
72
|
-
<div class="panel" role="dialog" aria-modal="true" aria-label="Command palette" part="panel">
|
|
73
|
-
<input class="search" type="search" autocomplete="off" placeholder="${placeholder}" aria-label="Search" part="search" />
|
|
74
|
-
<div class="results" part="results"><slot></slot></div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
`;
|
|
78
|
-
this.shadowRoot.querySelector(".search").addEventListener("input", this._onInput);
|
|
79
|
-
this.shadowRoot.querySelector("slot")?.addEventListener("slotchange", () => this._filter(""));
|
|
80
|
-
this._filter("");
|
|
81
|
-
}
|
|
82
|
-
attributeChangedCallback(name) {
|
|
83
|
-
if (name === "open") this.hasAttribute("open") ? this._open() : this._close();
|
|
84
|
-
}
|
|
85
|
-
open() {
|
|
86
|
-
this.setAttribute("open", "");
|
|
87
|
-
}
|
|
88
|
-
close() {
|
|
89
|
-
this.removeAttribute("open");
|
|
90
|
-
this.dispatchEvent(new CustomEvent("velin-close", { bubbles: true }));
|
|
91
|
-
}
|
|
92
|
-
_open() {
|
|
93
|
-
this._prev = saveFocus();
|
|
94
|
-
setBackgroundInert(this);
|
|
95
|
-
document.addEventListener("keydown", this._onKey);
|
|
96
|
-
requestAnimationFrame(() => {
|
|
97
|
-
this.shadowRoot.querySelector(".search")?.focus();
|
|
98
|
-
this._filter("");
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
_close() {
|
|
102
|
-
document.removeEventListener("keydown", this._onKey);
|
|
103
|
-
clearBackgroundInert();
|
|
104
|
-
restoreFocus(this._prev);
|
|
105
|
-
const input = this.shadowRoot.querySelector(".search");
|
|
106
|
-
if (input) input.value = "";
|
|
107
|
-
this._filter("");
|
|
108
|
-
}
|
|
109
|
-
_onInput(e) {
|
|
110
|
-
this._filter(e.target.value);
|
|
111
|
-
}
|
|
112
|
-
_filter(query) {
|
|
113
|
-
const q = query.trim().toLowerCase();
|
|
114
|
-
const slot = this.shadowRoot.querySelector("slot");
|
|
115
|
-
slot?.assignedElements().forEach((btn) => {
|
|
116
|
-
const text = btn.textContent?.trim().toLowerCase() || "";
|
|
117
|
-
const match = !q || text.includes(q);
|
|
118
|
-
btn.hidden = !match;
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
_onKey(e) {
|
|
122
|
-
if (e.key === "Escape") {
|
|
123
|
-
this.close();
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
trapFocus(this.shadowRoot, e);
|
|
127
|
-
}
|
|
128
|
-
disconnectedCallback() {
|
|
129
|
-
document.removeEventListener("keydown", this._onKey);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
customElements.define("velin-command", VelinCommand);
|
|
133
|
-
var velin_command_default = VelinCommand;
|
|
134
|
-
export {
|
|
135
|
-
velin_command_default as default
|
|
136
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
escapeHTML
|
|
3
|
-
} from "./chunk-LA7264K4.js";
|
|
4
|
-
|
|
5
|
-
// components/velin-copy.js
|
|
6
|
-
var styles = `
|
|
7
|
-
:host { display: inline-flex; }
|
|
8
|
-
button {
|
|
9
|
-
display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
|
|
10
|
-
min-width: 2.75rem; min-height: 2.75rem; padding: 0.375rem 0.625rem;
|
|
11
|
-
background: var(--velin-color-surface-dim, #f0f0f0);
|
|
12
|
-
border: 1px solid var(--velin-color-border, #ddd);
|
|
13
|
-
border-radius: var(--velin-radius-md, 0.5rem); cursor: pointer;
|
|
14
|
-
color: var(--velin-color-text-muted, #666);
|
|
15
|
-
font-size: var(--velin-text-sm, 0.875rem);
|
|
16
|
-
transition: background 150ms ease, color 150ms ease;
|
|
17
|
-
}
|
|
18
|
-
button:hover { background: var(--velin-color-surface, #e0e0e0); color: var(--velin-color-text, #111); }
|
|
19
|
-
button:focus-visible { outline: 3px solid var(--velin-color-focus, #2563eb); outline-offset: 2px; }
|
|
20
|
-
button[data-copied] { color: var(--velin-color-success, #16a34a); border-color: var(--velin-color-success, #16a34a); }
|
|
21
|
-
svg { width: 1rem; height: 1rem; flex-shrink: 0; }
|
|
22
|
-
.check { display: none; }
|
|
23
|
-
button[data-copied] .copy-icon { display: none; }
|
|
24
|
-
button[data-copied] .check { display: block; }
|
|
25
|
-
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
|
|
26
|
-
`;
|
|
27
|
-
var VelinCopy = class extends HTMLElement {
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this.attachShadow({ mode: "open" });
|
|
31
|
-
}
|
|
32
|
-
connectedCallback() {
|
|
33
|
-
const label = escapeHTML(this.getAttribute("label") || "");
|
|
34
|
-
this.shadowRoot.innerHTML = `
|
|
35
|
-
<style>${styles}</style>
|
|
36
|
-
<button part="button" aria-label="Copy">
|
|
37
|
-
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
38
|
-
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
39
|
-
</svg>
|
|
40
|
-
<svg class="check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
41
|
-
<polyline points="20 6 9 17 4 12"/>
|
|
42
|
-
</svg>
|
|
43
|
-
${label ? `<span>${label}</span>` : ""}
|
|
44
|
-
</button>
|
|
45
|
-
`;
|
|
46
|
-
this.shadowRoot.querySelector("button").addEventListener("click", () => this._copy());
|
|
47
|
-
}
|
|
48
|
-
_getCopyText() {
|
|
49
|
-
return this.getAttribute("value") || this.getAttribute("text") || this.dataset.source || "";
|
|
50
|
-
}
|
|
51
|
-
async _copy() {
|
|
52
|
-
const value = this._getCopyText();
|
|
53
|
-
if (!value) return;
|
|
54
|
-
try {
|
|
55
|
-
await navigator.clipboard.writeText(value);
|
|
56
|
-
} catch {
|
|
57
|
-
const ta = document.createElement("textarea");
|
|
58
|
-
ta.value = value;
|
|
59
|
-
ta.style.cssText = "position:fixed;opacity:0";
|
|
60
|
-
document.body.appendChild(ta);
|
|
61
|
-
ta.select();
|
|
62
|
-
document.execCommand("copy");
|
|
63
|
-
ta.remove();
|
|
64
|
-
}
|
|
65
|
-
const btn = this.shadowRoot.querySelector("button");
|
|
66
|
-
btn.setAttribute("data-copied", "");
|
|
67
|
-
btn.setAttribute("aria-label", "Copied");
|
|
68
|
-
this.dispatchEvent(new CustomEvent("velin-copied", { bubbles: true, detail: { value } }));
|
|
69
|
-
setTimeout(() => {
|
|
70
|
-
btn.removeAttribute("data-copied");
|
|
71
|
-
btn.setAttribute("aria-label", "Copy");
|
|
72
|
-
}, 2e3);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
if (!customElements.get("velin-copy")) {
|
|
76
|
-
customElements.define("velin-copy", VelinCopy);
|
|
77
|
-
}
|
|
78
|
-
var velin_copy_default = VelinCopy;
|
|
79
|
-
export {
|
|
80
|
-
velin_copy_default as default
|
|
81
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
escapeHTML
|
|
3
|
-
} from "./chunk-LA7264K4.js";
|
|
4
|
-
|
|
5
|
-
// components/velin-countdown.js
|
|
6
|
-
var styles = `
|
|
7
|
-
:host { display: inline-flex; font-variant-numeric: tabular-nums; }
|
|
8
|
-
.wrap { display: inline-flex; gap: var(--velin-space-3, 0.75rem); align-items: flex-start; }
|
|
9
|
-
.segment {
|
|
10
|
-
display: flex; flex-direction: column; align-items: center;
|
|
11
|
-
min-width: 3.5rem;
|
|
12
|
-
}
|
|
13
|
-
.value {
|
|
14
|
-
font-size: var(--velin-text-3xl, 1.953rem);
|
|
15
|
-
font-weight: var(--velin-weight-bold, 700);
|
|
16
|
-
line-height: 1;
|
|
17
|
-
color: var(--velin-color-text, #1a1a2e);
|
|
18
|
-
}
|
|
19
|
-
.label {
|
|
20
|
-
font-size: var(--velin-text-xs, 0.75rem);
|
|
21
|
-
color: var(--velin-color-text-muted, #888);
|
|
22
|
-
text-transform: uppercase;
|
|
23
|
-
letter-spacing: 0.05em;
|
|
24
|
-
margin-top: var(--velin-space-1, 0.25rem);
|
|
25
|
-
}
|
|
26
|
-
.separator {
|
|
27
|
-
font-size: var(--velin-text-2xl, 1.563rem);
|
|
28
|
-
font-weight: 700;
|
|
29
|
-
color: var(--velin-color-text-muted, #888);
|
|
30
|
-
align-self: flex-start;
|
|
31
|
-
padding-top: 0.2em;
|
|
32
|
-
}
|
|
33
|
-
:host([size="sm"]) .value { font-size: var(--velin-text-xl, 1.25rem); }
|
|
34
|
-
:host([size="sm"]) .segment { min-width: 2.5rem; }
|
|
35
|
-
:host([size="lg"]) .value { font-size: var(--velin-text-5xl, 3.052rem); }
|
|
36
|
-
`;
|
|
37
|
-
var VelinCountdown = class extends HTMLElement {
|
|
38
|
-
static get observedAttributes() {
|
|
39
|
-
return ["datetime"];
|
|
40
|
-
}
|
|
41
|
-
constructor() {
|
|
42
|
-
super();
|
|
43
|
-
this.attachShadow({ mode: "open" });
|
|
44
|
-
this._timer = null;
|
|
45
|
-
}
|
|
46
|
-
connectedCallback() {
|
|
47
|
-
this.shadowRoot.innerHTML = `<style>${styles}</style><div class="wrap"></div>`;
|
|
48
|
-
this._wrap = this.shadowRoot.querySelector(".wrap");
|
|
49
|
-
this.setAttribute("role", "timer");
|
|
50
|
-
this.setAttribute("aria-live", "polite");
|
|
51
|
-
this.setAttribute("aria-atomic", "true");
|
|
52
|
-
this._start();
|
|
53
|
-
}
|
|
54
|
-
_start() {
|
|
55
|
-
this._update();
|
|
56
|
-
this._timer = setInterval(() => this._update(), 1e3);
|
|
57
|
-
}
|
|
58
|
-
_update() {
|
|
59
|
-
const target = new Date(this.getAttribute("datetime")).getTime();
|
|
60
|
-
const now = Date.now();
|
|
61
|
-
const diff = Math.max(0, target - now);
|
|
62
|
-
const days = Math.floor(diff / 864e5);
|
|
63
|
-
const hours = Math.floor(diff % 864e5 / 36e5);
|
|
64
|
-
const minutes = Math.floor(diff % 36e5 / 6e4);
|
|
65
|
-
const seconds = Math.floor(diff % 6e4 / 1e3);
|
|
66
|
-
const pad = (n) => String(n).padStart(2, "0");
|
|
67
|
-
const showDays = this.getAttribute("show-days") !== "false";
|
|
68
|
-
const lDays = escapeHTML(this.getAttribute("label-days") || "Days");
|
|
69
|
-
const lHours = escapeHTML(this.getAttribute("label-hours") || "Hours");
|
|
70
|
-
const lMin = escapeHTML(this.getAttribute("label-minutes") || "Min");
|
|
71
|
-
const lSec = escapeHTML(this.getAttribute("label-seconds") || "Sec");
|
|
72
|
-
let html = "";
|
|
73
|
-
if (showDays) html += `<div class="segment" part="days"><span class="value">${pad(days)}</span><span class="label">${lDays}</span></div><span class="separator">:</span>`;
|
|
74
|
-
html += `<div class="segment" part="hours"><span class="value">${pad(hours)}</span><span class="label">${lHours}</span></div><span class="separator">:</span>`;
|
|
75
|
-
html += `<div class="segment" part="minutes"><span class="value">${pad(minutes)}</span><span class="label">${lMin}</span></div><span class="separator">:</span>`;
|
|
76
|
-
html += `<div class="segment" part="seconds"><span class="value">${pad(seconds)}</span><span class="label">${lSec}</span></div>`;
|
|
77
|
-
if (this._wrap) {
|
|
78
|
-
this._wrap.innerHTML = html;
|
|
79
|
-
}
|
|
80
|
-
const ariaText = `${days} days, ${hours} hours, ${minutes} minutes, ${seconds} seconds remaining`;
|
|
81
|
-
this.setAttribute("aria-label", ariaText);
|
|
82
|
-
if (diff <= 0) {
|
|
83
|
-
clearInterval(this._timer);
|
|
84
|
-
this.dispatchEvent(new CustomEvent("velin-countdown-end", { bubbles: true }));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
disconnectedCallback() {
|
|
88
|
-
if (this._timer) clearInterval(this._timer);
|
|
89
|
-
}
|
|
90
|
-
attributeChangedCallback() {
|
|
91
|
-
if (this._timer) {
|
|
92
|
-
clearInterval(this._timer);
|
|
93
|
-
this._start();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
customElements.define("velin-countdown", VelinCountdown);
|
|
98
|
-
var velin_countdown_default = VelinCountdown;
|
|
99
|
-
export {
|
|
100
|
-
velin_countdown_default as default
|
|
101
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// components/velin-counter.js
|
|
2
|
-
var easeOutExpo = (t) => t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
|
|
3
|
-
function buildFormatter(host) {
|
|
4
|
-
const format = (host.getAttribute("format") || "number").toLowerCase();
|
|
5
|
-
const locale = host.getAttribute("locale") || void 0;
|
|
6
|
-
const decimalsAttr = host.getAttribute("decimals");
|
|
7
|
-
const decimals = decimalsAttr != null ? Math.max(0, Number.parseInt(decimalsAttr, 10) || 0) : null;
|
|
8
|
-
const opts = {};
|
|
9
|
-
if (decimals != null) {
|
|
10
|
-
opts.minimumFractionDigits = decimals;
|
|
11
|
-
opts.maximumFractionDigits = decimals;
|
|
12
|
-
}
|
|
13
|
-
if (format === "currency") {
|
|
14
|
-
opts.style = "currency";
|
|
15
|
-
opts.currency = host.getAttribute("currency") || "EUR";
|
|
16
|
-
} else if (format === "percent") {
|
|
17
|
-
opts.style = "percent";
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
return new Intl.NumberFormat(locale, opts);
|
|
21
|
-
} catch {
|
|
22
|
-
return new Intl.NumberFormat(void 0, opts);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
var VelinCounter = class extends HTMLElement {
|
|
26
|
-
static get observedAttributes() {
|
|
27
|
-
return ["from", "to", "duration", "decimals", "prefix", "suffix", "format", "currency", "locale"];
|
|
28
|
-
}
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
|
-
this._rafId = 0;
|
|
32
|
-
this._started = false;
|
|
33
|
-
this._observer = null;
|
|
34
|
-
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
this._render(this._fromValue());
|
|
37
|
-
if (this.getAttribute("autostart") === "false") return;
|
|
38
|
-
this._scheduleStart();
|
|
39
|
-
}
|
|
40
|
-
disconnectedCallback() {
|
|
41
|
-
cancelAnimationFrame(this._rafId);
|
|
42
|
-
this._observer?.disconnect();
|
|
43
|
-
}
|
|
44
|
-
attributeChangedCallback(name) {
|
|
45
|
-
if (!this.isConnected) return;
|
|
46
|
-
if (name === "to" || name === "from") {
|
|
47
|
-
this.start();
|
|
48
|
-
} else {
|
|
49
|
-
this._render(this._lastValue ?? this._toValue());
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
_fromValue() {
|
|
53
|
-
return Number.parseFloat(this.getAttribute("from")) || 0;
|
|
54
|
-
}
|
|
55
|
-
_toValue() {
|
|
56
|
-
return Number.parseFloat(this.getAttribute("to")) || 0;
|
|
57
|
-
}
|
|
58
|
-
_duration() {
|
|
59
|
-
return Math.max(0, Number.parseFloat(this.getAttribute("duration")) || 900);
|
|
60
|
-
}
|
|
61
|
-
_scheduleStart() {
|
|
62
|
-
if (this._started) return;
|
|
63
|
-
if (typeof IntersectionObserver === "undefined") {
|
|
64
|
-
this.start();
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this._observer = new IntersectionObserver((entries) => {
|
|
68
|
-
for (const entry of entries) {
|
|
69
|
-
if (entry.isIntersecting) {
|
|
70
|
-
this.start();
|
|
71
|
-
this._observer.disconnect();
|
|
72
|
-
this._observer = null;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, { threshold: 0.2 });
|
|
77
|
-
this._observer.observe(this);
|
|
78
|
-
}
|
|
79
|
-
start() {
|
|
80
|
-
cancelAnimationFrame(this._rafId);
|
|
81
|
-
this._started = true;
|
|
82
|
-
const from = this._fromValue();
|
|
83
|
-
const to = this._toValue();
|
|
84
|
-
const duration = this._duration();
|
|
85
|
-
const reduced = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
86
|
-
if (reduced || duration === 0) {
|
|
87
|
-
this._render(to);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const start = performance.now();
|
|
91
|
-
const tick = (now) => {
|
|
92
|
-
const t = Math.min(1, (now - start) / duration);
|
|
93
|
-
const value = from + (to - from) * easeOutExpo(t);
|
|
94
|
-
this._render(value);
|
|
95
|
-
if (t < 1) this._rafId = requestAnimationFrame(tick);
|
|
96
|
-
};
|
|
97
|
-
this._rafId = requestAnimationFrame(tick);
|
|
98
|
-
}
|
|
99
|
-
reset() {
|
|
100
|
-
cancelAnimationFrame(this._rafId);
|
|
101
|
-
this._started = false;
|
|
102
|
-
this._render(this._fromValue());
|
|
103
|
-
}
|
|
104
|
-
_render(value) {
|
|
105
|
-
this._lastValue = value;
|
|
106
|
-
const formatter = buildFormatter(this);
|
|
107
|
-
const prefix = this.getAttribute("prefix") || "";
|
|
108
|
-
const suffix = this.getAttribute("suffix") || "";
|
|
109
|
-
this.textContent = `${prefix}${formatter.format(value)}${suffix}`;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
if (typeof customElements !== "undefined" && !customElements.get("velin-counter")) {
|
|
113
|
-
customElements.define("velin-counter", VelinCounter);
|
|
114
|
-
}
|
|
115
|
-
var velin_counter_default = VelinCounter;
|
|
116
|
-
export {
|
|
117
|
-
velin_counter_default as default
|
|
118
|
-
};
|