@vonage/vivid 3.0.0-next.6 → 3.0.0-next.7
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/.babelrc +3 -0
- package/.eslintrc.json +70 -0
- package/.stylelintrc.json +8 -0
- package/CHANGELOG.json +343 -0
- package/CHANGELOG.md +45 -0
- package/jest.config.cjs +20 -0
- package/package.json +4 -13
- package/playwright.config.dev.ts +21 -0
- package/playwright.config.ts +34 -0
- package/project.json +122 -0
- package/rollup.config.prod.ts +50 -0
- package/setupJestTests.js +17 -0
- package/{index.d.ts → src/index.ts} +2 -2
- package/src/lib/accordion/README.md +55 -0
- package/src/lib/accordion/accordion.scss +10 -0
- package/src/lib/accordion/accordion.spec.ts +91 -0
- package/src/lib/accordion/accordion.template.ts +23 -0
- package/src/lib/accordion/accordion.ts +49 -0
- package/src/lib/accordion/index.ts +14 -0
- package/src/lib/accordion/ui.test.ts +37 -0
- package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Chrome-Stable-darwin.png +0 -0
- package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Chrome-Stable-linux.png +0 -0
- package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Firefox-linux.png +0 -0
- package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Safari-darwin.png +0 -0
- package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Safari-linux.png +0 -0
- package/src/lib/accordion-item/README.md +113 -0
- package/src/lib/accordion-item/accordion-item.scss +91 -0
- package/src/lib/accordion-item/accordion-item.spec.ts +103 -0
- package/src/lib/accordion-item/accordion-item.template.ts +62 -0
- package/src/lib/accordion-item/accordion-item.ts +67 -0
- package/src/lib/accordion-item/index.ts +14 -0
- package/src/lib/accordion-item/partials/variables.scss +1 -0
- package/src/lib/accordion-item/ui.test.ts +37 -0
- package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Chrome-Stable-darwin.png +0 -0
- package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Chrome-Stable-linux.png +0 -0
- package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Firefox-linux.png +0 -0
- package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Safari-darwin.png +0 -0
- package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Safari-linux.png +0 -0
- package/src/lib/badge/README.md +112 -0
- package/src/lib/badge/badge.scss +64 -0
- package/src/lib/badge/badge.spec.ts +114 -0
- package/src/lib/badge/badge.template.ts +36 -0
- package/src/lib/badge/badge.ts +97 -0
- package/src/lib/badge/index.ts +23 -0
- package/src/lib/badge/ui.test.ts +28 -0
- package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Chrome-Stable-darwin.png +0 -0
- package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Chrome-Stable-linux.png +0 -0
- package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Firefox-linux.png +0 -0
- package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Safari-darwin.png +0 -0
- package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Safari-linux.png +0 -0
- package/src/lib/banner/README.md +117 -0
- package/src/lib/banner/banner.scss +71 -0
- package/src/lib/banner/banner.spec.ts +355 -0
- package/src/lib/banner/banner.template.ts +61 -0
- package/src/lib/banner/banner.ts +77 -0
- package/src/lib/banner/index.ts +14 -0
- package/src/lib/banner/ui.test.ts +64 -0
- package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Chrome-Stable-darwin.png +0 -0
- package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Chrome-Stable-linux.png +0 -0
- package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Firefox-linux.png +0 -0
- package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Safari-darwin.png +0 -0
- package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Safari-linux.png +0 -0
- package/src/lib/breadcrumb/README.md +25 -0
- package/src/lib/breadcrumb/breadcrumb.scss +3 -0
- package/src/lib/breadcrumb/breadcrumb.spec.ts +78 -0
- package/src/lib/breadcrumb/breadcrumb.ts +10 -0
- package/src/lib/breadcrumb/index.ts +13 -0
- package/src/lib/breadcrumb/ui.test.ts +36 -0
- package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Chrome-Stable-darwin.png +0 -0
- package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Chrome-Stable-linux.png +0 -0
- package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Firefox-linux.png +0 -0
- package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Safari-darwin.png +0 -0
- package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Safari-linux.png +0 -0
- package/src/lib/breadcrumb-item/README.md +40 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.scss +28 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.spec.ts +192 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.template.ts +37 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.ts +15 -0
- package/src/lib/breadcrumb-item/index.ts +16 -0
- package/src/lib/breadcrumb-item/ui.test.ts +38 -0
- package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Chrome-Stable-darwin.png +0 -0
- package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Chrome-Stable-linux.png +0 -0
- package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Firefox-linux.png +0 -0
- package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Safari-darwin.png +0 -0
- package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Safari-linux.png +0 -0
- package/src/lib/button/README.md +120 -0
- package/src/lib/button/button.scss +142 -0
- package/src/lib/button/button.spec.ts +131 -0
- package/src/lib/button/button.template.ts +89 -0
- package/src/lib/button/button.ts +95 -0
- package/src/lib/button/index.ts +25 -0
- package/src/lib/button/partials/variables.scss +2 -0
- package/src/lib/button/ui.test.ts +32 -0
- package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Chrome-Stable-darwin.png +0 -0
- package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Chrome-Stable-linux.png +0 -0
- package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Firefox-linux.png +0 -0
- package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Safari-darwin.png +0 -0
- package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Safari-linux.png +0 -0
- package/src/lib/calendar/README.md +70 -0
- package/src/lib/calendar/calendar.scss +176 -0
- package/src/lib/calendar/calendar.spec.ts +341 -0
- package/src/lib/calendar/calendar.template.ts +93 -0
- package/src/lib/calendar/calendar.ts +139 -0
- package/src/lib/calendar/helpers/calendar.date-functions.ts +31 -0
- package/src/lib/calendar/helpers/calendar.event-context.ts +72 -0
- package/src/lib/calendar/helpers/calendar.keyboard-interactions.ts +65 -0
- package/src/lib/calendar/index.ts +16 -0
- package/src/lib/calendar/partials/_variables.scss +15 -0
- package/src/lib/calendar/ui.test.ts +32 -0
- package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Chrome-Stable-darwin.png +0 -0
- package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Chrome-Stable-linux.png +0 -0
- package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Firefox-linux.png +0 -0
- package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Safari-darwin.png +0 -0
- package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Safari-linux.png +0 -0
- package/src/lib/components.spec.ts +7 -0
- package/{lib/components.d.ts → src/lib/components.ts} +16 -16
- package/src/lib/elevation/README.md +99 -0
- package/src/lib/elevation/elevation.scss +15 -0
- package/src/lib/elevation/elevation.spec.ts +55 -0
- package/src/lib/elevation/elevation.template.ts +26 -0
- package/src/lib/elevation/elevation.ts +17 -0
- package/src/lib/elevation/index.ts +17 -0
- package/src/lib/elevation/partials/_elevation.mixin.scss +4 -0
- package/src/lib/elevation/ui.test.ts +32 -0
- package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Chrome-Stable-darwin.png +0 -0
- package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Chrome-Stable-linux.png +0 -0
- package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Firefox-linux.png +0 -0
- package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Safari-darwin.png +0 -0
- package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Safari-linux.png +0 -0
- package/src/lib/enums.ts +55 -0
- package/src/lib/focus/README.md +1 -0
- package/src/lib/focus/focus.scss +17 -0
- package/src/lib/focus/focus.template.ts +16 -0
- package/src/lib/focus/focus.ts +10 -0
- package/src/lib/focus/index.ts +21 -0
- package/src/lib/focus/partials/variables.scss +2 -0
- package/src/lib/icon/README.md +70 -0
- package/src/lib/icon/__snapshots__/icon.spec.ts.snap +16 -0
- package/src/lib/icon/icon.placeholder.ts +12 -0
- package/src/lib/icon/icon.scss +52 -0
- package/src/lib/icon/icon.spec.ts +106 -0
- package/src/lib/icon/icon.template.ts +23 -0
- package/src/lib/icon/icon.ts +93 -0
- package/src/lib/icon/index.ts +14 -0
- package/src/lib/layout/README.md +154 -0
- package/src/lib/layout/index.ts +18 -0
- package/src/lib/layout/layout.scss +40 -0
- package/src/lib/layout/layout.spec.ts +73 -0
- package/src/lib/layout/layout.template.ts +29 -0
- package/src/lib/layout/layout.ts +46 -0
- package/src/lib/layout/partials/_functions.scss +15 -0
- package/src/lib/layout/partials/_mixins.scss +5 -0
- package/src/lib/layout/partials/_variables.scss +23 -0
- package/src/lib/layout/ui.test.ts +32 -0
- package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Chrome-Stable-darwin.png +0 -0
- package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Chrome-Stable-linux.png +0 -0
- package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Firefox-linux.png +0 -0
- package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Safari-darwin.png +0 -0
- package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Safari-linux.png +0 -0
- package/src/lib/popup/README.md +261 -0
- package/src/lib/popup/index.ts +21 -0
- package/src/lib/popup/popup.scss +43 -0
- package/src/lib/popup/popup.spec.ts +265 -0
- package/src/lib/popup/popup.template.ts +41 -0
- package/src/lib/popup/popup.ts +158 -0
- package/src/lib/popup/ui.test.ts +111 -0
- package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Chrome-Stable-darwin.png +0 -0
- package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Chrome-Stable-linux.png +0 -0
- package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Firefox-linux.png +0 -0
- package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Safari-darwin.png +0 -0
- package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Safari-linux.png +0 -0
- package/src/lib/progress/README.md +107 -0
- package/src/lib/progress/index.ts +14 -0
- package/src/lib/progress/progress.scss +133 -0
- package/src/lib/progress/progress.spec.ts +173 -0
- package/src/lib/progress/progress.template.ts +62 -0
- package/src/lib/progress/progress.ts +25 -0
- package/src/lib/progress/ui.test.ts +70 -0
- package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Chrome-Stable-darwin.png +0 -0
- package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Chrome-Stable-linux.png +0 -0
- package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Firefox-linux.png +0 -0
- package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Safari-darwin.png +0 -0
- package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Safari-linux.png +0 -0
- package/src/lib/progress-ring/README.md +90 -0
- package/src/lib/progress-ring/index.ts +15 -0
- package/src/lib/progress-ring/progress-ring.scss +75 -0
- package/src/lib/progress-ring/progress-ring.spec.ts +139 -0
- package/src/lib/progress-ring/progress-ring.template.ts +82 -0
- package/src/lib/progress-ring/progress-ring.ts +18 -0
- package/src/lib/progress-ring/ui.test.ts +35 -0
- package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Chrome-Stable-darwin.png +0 -0
- package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Chrome-Stable-linux.png +0 -0
- package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Firefox-linux.png +0 -0
- package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Safari-darwin.png +0 -0
- package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Safari-linux.png +0 -0
- package/src/lib/side-drawer/README.md +304 -0
- package/src/lib/side-drawer/index.ts +16 -0
- package/src/lib/side-drawer/partials/variables.scss +6 -0
- package/src/lib/side-drawer/side-drawer.scss +109 -0
- package/src/lib/side-drawer/side-drawer.spec.ts +118 -0
- package/src/lib/side-drawer/side-drawer.template.ts +51 -0
- package/src/lib/side-drawer/side-drawer.ts +58 -0
- package/src/lib/side-drawer/ui.test.ts +102 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Chrome-Stable-darwin.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Chrome-Stable-linux.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Firefox-linux.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Safari-darwin.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Safari-linux.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Chrome-Stable-darwin.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Chrome-Stable-linux.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Firefox-linux.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Safari-darwin.png +0 -0
- package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Safari-linux.png +0 -0
- package/src/lib/sidenav-item/README.md +41 -0
- package/src/lib/sidenav-item/index.ts +20 -0
- package/src/lib/sidenav-item/sidenav-item.scss +51 -0
- package/src/lib/sidenav-item/sidenav-item.spec.ts +64 -0
- package/src/lib/sidenav-item/sidenav-item.template.ts +25 -0
- package/src/lib/sidenav-item/sidenav-item.ts +15 -0
- package/src/lib/sidenav-item/ui.test.ts +32 -0
- package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Chrome-Stable-darwin.png +0 -0
- package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Chrome-Stable-linux.png +0 -0
- package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Firefox-linux.png +0 -0
- package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Safari-darwin.png +0 -0
- package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Safari-linux.png +0 -0
- package/src/lib/text/README.md +119 -0
- package/src/lib/text/index.ts +14 -0
- package/src/lib/text/text.scss +92 -0
- package/src/lib/text/text.spec.ts +54 -0
- package/src/lib/text/text.template.ts +28 -0
- package/src/lib/text/text.ts +55 -0
- package/src/lib/text/ui.test.ts +39 -0
- package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Chrome-Stable-darwin.png +0 -0
- package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Chrome-Stable-linux.png +0 -0
- package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Firefox-linux.png +0 -0
- package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Safari-darwin.png +0 -0
- package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Safari-linux.png +0 -0
- package/src/lib/text-anchor/README.md +5 -0
- package/src/lib/text-anchor/index.ts +12 -0
- package/src/lib/text-anchor/text-anchor.spec.ts +153 -0
- package/src/lib/text-anchor/text-anchor.template.ts +66 -0
- package/src/lib/text-anchor/text-anchor.ts +22 -0
- package/src/lib/tooltip/README.md +132 -0
- package/src/lib/tooltip/index.ts +16 -0
- package/src/lib/tooltip/partials/variables.scss +1 -0
- package/src/lib/tooltip/tooltip.scss +18 -0
- package/src/lib/tooltip/tooltip.spec.ts +70 -0
- package/src/lib/tooltip/tooltip.template.ts +30 -0
- package/src/lib/tooltip/tooltip.ts +44 -0
- package/src/lib/tooltip/ui.test.ts +53 -0
- package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Chrome-Stable-darwin.png +0 -0
- package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Chrome-Stable-linux.png +0 -0
- package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Firefox-darwin.png +0 -0
- package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Firefox-linux.png +0 -0
- package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Safari-darwin.png +0 -0
- package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Safari-linux.png +0 -0
- package/src/shared/design-system/index.ts +12 -0
- package/src/shared/patterns/affix.ts +56 -0
- package/{shared/patterns/index.d.ts → src/shared/patterns/index.ts} +1 -1
- package/src/types/extract-gfm.d.ts +5 -0
- package/src/types/style.d.ts +4 -0
- package/src/visual-tests/visual-tests-utils.ts +76 -0
- package/tsconfig.json +36 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +16 -0
- package/accordion/index.js +0 -61
- package/accordion-item/index.js +0 -125
- package/badge/index.js +0 -64
- package/banner/index.js +0 -212
- package/breadcrumb/index.js +0 -100
- package/breadcrumb-item/index.js +0 -55
- package/button/index.js +0 -761
- package/calendar/index.js +0 -1521
- package/elevation/index.js +0 -31
- package/focus/index.js +0 -3
- package/icon/index.js +0 -34
- package/index.js +0 -32
- package/layout/index.js +0 -53
- package/lib/accordion/accordion.d.ts +0 -9
- package/lib/accordion/accordion.template.d.ts +0 -4
- package/lib/accordion/index.d.ts +0 -2
- package/lib/accordion-item/accordion-item.d.ts +0 -13
- package/lib/accordion-item/accordion-item.template.d.ts +0 -4
- package/lib/accordion-item/index.d.ts +0 -3
- package/lib/badge/badge.d.ts +0 -17
- package/lib/badge/badge.template.d.ts +0 -4
- package/lib/badge/index.d.ts +0 -3
- package/lib/banner/banner.d.ts +0 -20
- package/lib/banner/banner.template.d.ts +0 -6
- package/lib/banner/index.d.ts +0 -2
- package/lib/breadcrumb/breadcrumb.d.ts +0 -3
- package/lib/breadcrumb/index.d.ts +0 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +0 -5
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -4
- package/lib/breadcrumb-item/index.d.ts +0 -3
- package/lib/button/button.d.ts +0 -17
- package/lib/button/button.template.d.ts +0 -4
- package/lib/button/index.d.ts +0 -21
- package/lib/calendar/calendar.d.ts +0 -11
- package/lib/calendar/calendar.template.d.ts +0 -4
- package/lib/calendar/helpers/calendar.date-functions.d.ts +0 -2
- package/lib/calendar/helpers/calendar.event-context.d.ts +0 -6
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +0 -9
- package/lib/calendar/index.d.ts +0 -3
- package/lib/elevation/elevation.d.ts +0 -4
- package/lib/elevation/elevation.template.d.ts +0 -4
- package/lib/elevation/index.d.ts +0 -2
- package/lib/enums.d.ts +0 -45
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/focus/index.d.ts +0 -2
- package/lib/icon/icon.d.ts +0 -11
- package/lib/icon/icon.placeholder.d.ts +0 -1
- package/lib/icon/icon.template.d.ts +0 -4
- package/lib/icon/index.d.ts +0 -2
- package/lib/layout/index.d.ts +0 -2
- package/lib/layout/layout.d.ts +0 -16
- package/lib/layout/layout.template.d.ts +0 -4
- package/lib/popup/index.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -29
- package/lib/popup/popup.template.d.ts +0 -4
- package/lib/progress/index.d.ts +0 -2
- package/lib/progress/progress.d.ts +0 -9
- package/lib/progress/progress.template.d.ts +0 -5
- package/lib/progress-ring/index.d.ts +0 -2
- package/lib/progress-ring/progress-ring.d.ts +0 -6
- package/lib/progress-ring/progress-ring.template.d.ts +0 -4
- package/lib/side-drawer/index.d.ts +0 -2
- package/lib/side-drawer/side-drawer.d.ts +0 -12
- package/lib/side-drawer/side-drawer.template.d.ts +0 -4
- package/lib/sidenav-item/index.d.ts +0 -3
- package/lib/sidenav-item/sidenav-item.d.ts +0 -6
- package/lib/sidenav-item/sidenav-item.template.d.ts +0 -4
- package/lib/text/index.d.ts +0 -2
- package/lib/text/text.d.ts +0 -10
- package/lib/text/text.template.d.ts +0 -4
- package/lib/text-anchor/index.d.ts +0 -2
- package/lib/text-anchor/text-anchor.d.ts +0 -7
- package/lib/text-anchor/text-anchor.template.d.ts +0 -4
- package/lib/tooltip/index.d.ts +0 -3
- package/lib/tooltip/tooltip.d.ts +0 -10
- package/lib/tooltip/tooltip.template.d.ts +0 -4
- package/popup/index.js +0 -2087
- package/progress/index.js +0 -98
- package/progress-ring/index.js +0 -76
- package/shared/_has.js +0 -58
- package/shared/affix.js +0 -29
- package/shared/anchor.js +0 -78
- package/shared/apply-mixins.js +0 -22
- package/shared/aria-global.js +0 -156
- package/shared/base-progress.js +0 -65
- package/shared/breadcrumb-item.js +0 -25
- package/shared/class-names.js +0 -15
- package/shared/design-system/index.d.ts +0 -3
- package/shared/es.object.assign.js +0 -68
- package/shared/icon.js +0 -1393
- package/shared/index.js +0 -4991
- package/shared/index2.js +0 -21
- package/shared/patterns/affix.d.ts +0 -9
- package/shared/slotted.js +0 -119
- package/shared/style-inject.es.js +0 -28
- package/shared/text-anchor.js +0 -21
- package/shared/text-anchor.template.js +0 -54
- package/shared/web.dom-collections.iterator.js +0 -1479
- package/shared/when.js +0 -15
- package/side-drawer/index.js +0 -103
- package/sidenav-item/index.js +0 -38
- package/styles/fonts/spezia.css +0 -23
- package/styles/themes/dark.css +0 -193
- package/styles/themes/light.css +0 -193
- package/text/index.js +0 -45
- package/text-anchor/index.js +0 -19
- package/tooltip/index.js +0 -73
package/button/index.js
DELETED
|
@@ -1,761 +0,0 @@
|
|
|
1
|
-
import '../icon/index.js';
|
|
2
|
-
import { F as Focus } from '../shared/index2.js';
|
|
3
|
-
import { e as emptyArray, D as DOM, a as attr, o as observable, F as FoundationElement, _ as __decorate, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
4
|
-
import '../shared/web.dom-collections.iterator.js';
|
|
5
|
-
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
6
|
-
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
-
import { A as ARIAGlobalStatesAndProperties, S as StartEnd, r as ref } from '../shared/aria-global.js';
|
|
8
|
-
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
9
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
10
|
-
import '../shared/icon.js';
|
|
11
|
-
import '../shared/_has.js';
|
|
12
|
-
import '../shared/when.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Key Code values
|
|
16
|
-
* @deprecated - KeyCodes are deprecated, use individual string key exports
|
|
17
|
-
*/
|
|
18
|
-
var KeyCodes;
|
|
19
|
-
(function (KeyCodes) {
|
|
20
|
-
KeyCodes[KeyCodes["alt"] = 18] = "alt";
|
|
21
|
-
KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown";
|
|
22
|
-
KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft";
|
|
23
|
-
KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight";
|
|
24
|
-
KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp";
|
|
25
|
-
KeyCodes[KeyCodes["back"] = 8] = "back";
|
|
26
|
-
KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
|
|
27
|
-
KeyCodes[KeyCodes["break"] = 19] = "break";
|
|
28
|
-
KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
|
|
29
|
-
KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
|
|
30
|
-
KeyCodes[KeyCodes["colon"] = 186] = "colon";
|
|
31
|
-
KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
|
|
32
|
-
KeyCodes[KeyCodes["comma"] = 188] = "comma";
|
|
33
|
-
KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
|
|
34
|
-
KeyCodes[KeyCodes["delete"] = 46] = "delete";
|
|
35
|
-
KeyCodes[KeyCodes["end"] = 35] = "end";
|
|
36
|
-
KeyCodes[KeyCodes["enter"] = 13] = "enter";
|
|
37
|
-
KeyCodes[KeyCodes["equals"] = 187] = "equals";
|
|
38
|
-
KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
|
|
39
|
-
KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
|
|
40
|
-
KeyCodes[KeyCodes["escape"] = 27] = "escape";
|
|
41
|
-
KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
|
|
42
|
-
KeyCodes[KeyCodes["function1"] = 112] = "function1";
|
|
43
|
-
KeyCodes[KeyCodes["function10"] = 121] = "function10";
|
|
44
|
-
KeyCodes[KeyCodes["function11"] = 122] = "function11";
|
|
45
|
-
KeyCodes[KeyCodes["function12"] = 123] = "function12";
|
|
46
|
-
KeyCodes[KeyCodes["function2"] = 113] = "function2";
|
|
47
|
-
KeyCodes[KeyCodes["function3"] = 114] = "function3";
|
|
48
|
-
KeyCodes[KeyCodes["function4"] = 115] = "function4";
|
|
49
|
-
KeyCodes[KeyCodes["function5"] = 116] = "function5";
|
|
50
|
-
KeyCodes[KeyCodes["function6"] = 117] = "function6";
|
|
51
|
-
KeyCodes[KeyCodes["function7"] = 118] = "function7";
|
|
52
|
-
KeyCodes[KeyCodes["function8"] = 119] = "function8";
|
|
53
|
-
KeyCodes[KeyCodes["function9"] = 120] = "function9";
|
|
54
|
-
KeyCodes[KeyCodes["home"] = 36] = "home";
|
|
55
|
-
KeyCodes[KeyCodes["insert"] = 45] = "insert";
|
|
56
|
-
KeyCodes[KeyCodes["menu"] = 93] = "menu";
|
|
57
|
-
KeyCodes[KeyCodes["minus"] = 189] = "minus";
|
|
58
|
-
KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
|
|
59
|
-
KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
|
|
60
|
-
KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
|
|
61
|
-
KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
|
|
62
|
-
KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
|
|
63
|
-
KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
|
|
64
|
-
KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
|
|
65
|
-
KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
|
|
66
|
-
KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
|
|
67
|
-
KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
|
|
68
|
-
KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
|
|
69
|
-
KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
|
|
70
|
-
KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
|
|
71
|
-
KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
|
|
72
|
-
KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
|
|
73
|
-
KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
|
|
74
|
-
KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
|
|
75
|
-
KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
|
|
76
|
-
KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
|
|
77
|
-
KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
|
|
78
|
-
KeyCodes[KeyCodes["period"] = 190] = "period";
|
|
79
|
-
KeyCodes[KeyCodes["print"] = 44] = "print";
|
|
80
|
-
KeyCodes[KeyCodes["quote"] = 222] = "quote";
|
|
81
|
-
KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
|
|
82
|
-
KeyCodes[KeyCodes["shift"] = 16] = "shift";
|
|
83
|
-
KeyCodes[KeyCodes["space"] = 32] = "space";
|
|
84
|
-
KeyCodes[KeyCodes["tab"] = 9] = "tab";
|
|
85
|
-
KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
|
|
86
|
-
KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
|
|
87
|
-
KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
|
|
88
|
-
KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
|
|
89
|
-
})(KeyCodes || (KeyCodes = {}));
|
|
90
|
-
const keyEnter = "Enter";
|
|
91
|
-
|
|
92
|
-
const proxySlotName = "form-associated-proxy";
|
|
93
|
-
const ElementInternalsKey = "ElementInternals";
|
|
94
|
-
/**
|
|
95
|
-
* @alpha
|
|
96
|
-
*/
|
|
97
|
-
const supportsElementInternals = ElementInternalsKey in window &&
|
|
98
|
-
"setFormValue" in window[ElementInternalsKey].prototype;
|
|
99
|
-
const InternalsMap = new WeakMap();
|
|
100
|
-
/**
|
|
101
|
-
* Base function for providing Custom Element Form Association.
|
|
102
|
-
*
|
|
103
|
-
* @alpha
|
|
104
|
-
*/
|
|
105
|
-
function FormAssociated(BaseCtor) {
|
|
106
|
-
const C = class extends BaseCtor {
|
|
107
|
-
constructor(...args) {
|
|
108
|
-
super(...args);
|
|
109
|
-
/**
|
|
110
|
-
* Track whether the value has been changed from the initial value
|
|
111
|
-
*/
|
|
112
|
-
this.dirtyValue = false;
|
|
113
|
-
/**
|
|
114
|
-
* Sets the element's disabled state. A disabled element will not be included during form submission.
|
|
115
|
-
*
|
|
116
|
-
* @remarks
|
|
117
|
-
* HTML Attribute: disabled
|
|
118
|
-
*/
|
|
119
|
-
this.disabled = false;
|
|
120
|
-
/**
|
|
121
|
-
* These are events that are still fired by the proxy
|
|
122
|
-
* element based on user / programmatic interaction.
|
|
123
|
-
*
|
|
124
|
-
* The proxy implementation should be transparent to
|
|
125
|
-
* the app author, so block these events from emitting.
|
|
126
|
-
*/
|
|
127
|
-
this.proxyEventsToBlock = ["change", "click"];
|
|
128
|
-
this.proxyInitialized = false;
|
|
129
|
-
this.required = false;
|
|
130
|
-
this.initialValue = this.initialValue || "";
|
|
131
|
-
if (!this.elementInternals) {
|
|
132
|
-
// When elementInternals is not supported, formResetCallback is
|
|
133
|
-
// bound to an event listener, so ensure the handler's `this`
|
|
134
|
-
// context is correct.
|
|
135
|
-
this.formResetCallback = this.formResetCallback.bind(this);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Must evaluate to true to enable elementInternals.
|
|
140
|
-
* Feature detects API support and resolve respectively
|
|
141
|
-
*
|
|
142
|
-
* @internal
|
|
143
|
-
*/
|
|
144
|
-
static get formAssociated() {
|
|
145
|
-
return supportsElementInternals;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Returns the validity state of the element
|
|
149
|
-
*
|
|
150
|
-
* @alpha
|
|
151
|
-
*/
|
|
152
|
-
get validity() {
|
|
153
|
-
return this.elementInternals
|
|
154
|
-
? this.elementInternals.validity
|
|
155
|
-
: this.proxy.validity;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Retrieve a reference to the associated form.
|
|
159
|
-
* Returns null if not associated to any form.
|
|
160
|
-
*
|
|
161
|
-
* @alpha
|
|
162
|
-
*/
|
|
163
|
-
get form() {
|
|
164
|
-
return this.elementInternals ? this.elementInternals.form : this.proxy.form;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Retrieve the localized validation message,
|
|
168
|
-
* or custom validation message if set.
|
|
169
|
-
*
|
|
170
|
-
* @alpha
|
|
171
|
-
*/
|
|
172
|
-
get validationMessage() {
|
|
173
|
-
return this.elementInternals
|
|
174
|
-
? this.elementInternals.validationMessage
|
|
175
|
-
: this.proxy.validationMessage;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Whether the element will be validated when the
|
|
179
|
-
* form is submitted
|
|
180
|
-
*/
|
|
181
|
-
get willValidate() {
|
|
182
|
-
return this.elementInternals
|
|
183
|
-
? this.elementInternals.willValidate
|
|
184
|
-
: this.proxy.willValidate;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* A reference to all associated label elements
|
|
188
|
-
*/
|
|
189
|
-
get labels() {
|
|
190
|
-
if (this.elementInternals) {
|
|
191
|
-
return Object.freeze(Array.from(this.elementInternals.labels));
|
|
192
|
-
}
|
|
193
|
-
else if (this.proxy instanceof HTMLElement &&
|
|
194
|
-
this.proxy.ownerDocument &&
|
|
195
|
-
this.id) {
|
|
196
|
-
// Labels associated by wrapping the element: <label><custom-element></custom-element></label>
|
|
197
|
-
const parentLabels = this.proxy.labels;
|
|
198
|
-
// Labels associated using the `for` attribute
|
|
199
|
-
const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));
|
|
200
|
-
const labels = parentLabels
|
|
201
|
-
? forLabels.concat(Array.from(parentLabels))
|
|
202
|
-
: forLabels;
|
|
203
|
-
return Object.freeze(labels);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
return emptyArray;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Invoked when the `value` property changes
|
|
211
|
-
* @param previous - the previous value
|
|
212
|
-
* @param next - the new value
|
|
213
|
-
*
|
|
214
|
-
* @remarks
|
|
215
|
-
* If elements extending `FormAssociated` implement a `valueChanged` method
|
|
216
|
-
* They must be sure to invoke `super.valueChanged(previous, next)` to ensure
|
|
217
|
-
* proper functioning of `FormAssociated`
|
|
218
|
-
*/
|
|
219
|
-
valueChanged(previous, next) {
|
|
220
|
-
this.dirtyValue = true;
|
|
221
|
-
if (this.proxy instanceof HTMLElement) {
|
|
222
|
-
this.proxy.value = this.value;
|
|
223
|
-
}
|
|
224
|
-
this.currentValue = this.value;
|
|
225
|
-
this.setFormValue(this.value);
|
|
226
|
-
this.validate();
|
|
227
|
-
}
|
|
228
|
-
currentValueChanged() {
|
|
229
|
-
this.value = this.currentValue;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Invoked when the `initialValue` property changes
|
|
233
|
-
*
|
|
234
|
-
* @param previous - the previous value
|
|
235
|
-
* @param next - the new value
|
|
236
|
-
*
|
|
237
|
-
* @remarks
|
|
238
|
-
* If elements extending `FormAssociated` implement a `initialValueChanged` method
|
|
239
|
-
* They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure
|
|
240
|
-
* proper functioning of `FormAssociated`
|
|
241
|
-
*/
|
|
242
|
-
initialValueChanged(previous, next) {
|
|
243
|
-
// If the value is clean and the component is connected to the DOM
|
|
244
|
-
// then set value equal to the attribute value.
|
|
245
|
-
if (!this.dirtyValue) {
|
|
246
|
-
this.value = this.initialValue;
|
|
247
|
-
this.dirtyValue = false;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Invoked when the `disabled` property changes
|
|
252
|
-
*
|
|
253
|
-
* @param previous - the previous value
|
|
254
|
-
* @param next - the new value
|
|
255
|
-
*
|
|
256
|
-
* @remarks
|
|
257
|
-
* If elements extending `FormAssociated` implement a `disabledChanged` method
|
|
258
|
-
* They must be sure to invoke `super.disabledChanged(previous, next)` to ensure
|
|
259
|
-
* proper functioning of `FormAssociated`
|
|
260
|
-
*/
|
|
261
|
-
disabledChanged(previous, next) {
|
|
262
|
-
if (this.proxy instanceof HTMLElement) {
|
|
263
|
-
this.proxy.disabled = this.disabled;
|
|
264
|
-
}
|
|
265
|
-
DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Invoked when the `name` property changes
|
|
269
|
-
*
|
|
270
|
-
* @param previous - the previous value
|
|
271
|
-
* @param next - the new value
|
|
272
|
-
*
|
|
273
|
-
* @remarks
|
|
274
|
-
* If elements extending `FormAssociated` implement a `nameChanged` method
|
|
275
|
-
* They must be sure to invoke `super.nameChanged(previous, next)` to ensure
|
|
276
|
-
* proper functioning of `FormAssociated`
|
|
277
|
-
*/
|
|
278
|
-
nameChanged(previous, next) {
|
|
279
|
-
if (this.proxy instanceof HTMLElement) {
|
|
280
|
-
this.proxy.name = this.name;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Invoked when the `required` property changes
|
|
285
|
-
*
|
|
286
|
-
* @param previous - the previous value
|
|
287
|
-
* @param next - the new value
|
|
288
|
-
*
|
|
289
|
-
* @remarks
|
|
290
|
-
* If elements extending `FormAssociated` implement a `requiredChanged` method
|
|
291
|
-
* They must be sure to invoke `super.requiredChanged(previous, next)` to ensure
|
|
292
|
-
* proper functioning of `FormAssociated`
|
|
293
|
-
*/
|
|
294
|
-
requiredChanged(prev, next) {
|
|
295
|
-
if (this.proxy instanceof HTMLElement) {
|
|
296
|
-
this.proxy.required = this.required;
|
|
297
|
-
}
|
|
298
|
-
DOM.queueUpdate(() => this.classList.toggle("required", this.required));
|
|
299
|
-
this.validate();
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* The element internals object. Will only exist
|
|
303
|
-
* in browsers supporting the attachInternals API
|
|
304
|
-
*/
|
|
305
|
-
get elementInternals() {
|
|
306
|
-
if (!supportsElementInternals) {
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
let internals = InternalsMap.get(this);
|
|
310
|
-
if (!internals) {
|
|
311
|
-
internals = this.attachInternals();
|
|
312
|
-
InternalsMap.set(this, internals);
|
|
313
|
-
}
|
|
314
|
-
return internals;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* @internal
|
|
318
|
-
*/
|
|
319
|
-
connectedCallback() {
|
|
320
|
-
super.connectedCallback();
|
|
321
|
-
this.addEventListener("keypress", this._keypressHandler);
|
|
322
|
-
if (!this.value) {
|
|
323
|
-
this.value = this.initialValue;
|
|
324
|
-
this.dirtyValue = false;
|
|
325
|
-
}
|
|
326
|
-
if (!this.elementInternals) {
|
|
327
|
-
this.attachProxy();
|
|
328
|
-
if (this.form) {
|
|
329
|
-
this.form.addEventListener("reset", this.formResetCallback);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @internal
|
|
335
|
-
*/
|
|
336
|
-
disconnectedCallback() {
|
|
337
|
-
this.proxyEventsToBlock.forEach(name => this.proxy.removeEventListener(name, this.stopPropagation));
|
|
338
|
-
if (!this.elementInternals && this.form) {
|
|
339
|
-
this.form.removeEventListener("reset", this.formResetCallback);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Return the current validity of the element.
|
|
344
|
-
*/
|
|
345
|
-
checkValidity() {
|
|
346
|
-
return this.elementInternals
|
|
347
|
-
? this.elementInternals.checkValidity()
|
|
348
|
-
: this.proxy.checkValidity();
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Return the current validity of the element.
|
|
352
|
-
* If false, fires an invalid event at the element.
|
|
353
|
-
*/
|
|
354
|
-
reportValidity() {
|
|
355
|
-
return this.elementInternals
|
|
356
|
-
? this.elementInternals.reportValidity()
|
|
357
|
-
: this.proxy.reportValidity();
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Set the validity of the control. In cases when the elementInternals object is not
|
|
361
|
-
* available (and the proxy element is used to report validity), this function will
|
|
362
|
-
* do nothing unless a message is provided, at which point the setCustomValidity method
|
|
363
|
-
* of the proxy element will be invoked with the provided message.
|
|
364
|
-
* @param flags - Validity flags
|
|
365
|
-
* @param message - Optional message to supply
|
|
366
|
-
* @param anchor - Optional element used by UA to display an interactive validation UI
|
|
367
|
-
*/
|
|
368
|
-
setValidity(flags, message, anchor) {
|
|
369
|
-
if (this.elementInternals) {
|
|
370
|
-
this.elementInternals.setValidity(flags, message, anchor);
|
|
371
|
-
}
|
|
372
|
-
else if (typeof message === "string") {
|
|
373
|
-
this.proxy.setCustomValidity(message);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Invoked when a connected component's form or fieldset has its disabled
|
|
378
|
-
* state changed.
|
|
379
|
-
* @param disabled - the disabled value of the form / fieldset
|
|
380
|
-
*/
|
|
381
|
-
formDisabledCallback(disabled) {
|
|
382
|
-
this.disabled = disabled;
|
|
383
|
-
}
|
|
384
|
-
formResetCallback() {
|
|
385
|
-
this.value = this.initialValue;
|
|
386
|
-
this.dirtyValue = false;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Attach the proxy element to the DOM
|
|
390
|
-
*/
|
|
391
|
-
attachProxy() {
|
|
392
|
-
var _a;
|
|
393
|
-
if (!this.proxyInitialized) {
|
|
394
|
-
this.proxyInitialized = true;
|
|
395
|
-
this.proxy.style.display = "none";
|
|
396
|
-
this.proxyEventsToBlock.forEach(name => this.proxy.addEventListener(name, this.stopPropagation));
|
|
397
|
-
// These are typically mapped to the proxy during
|
|
398
|
-
// property change callbacks, but during initialization
|
|
399
|
-
// on the initial call of the callback, the proxy is
|
|
400
|
-
// still undefined. We should find a better way to address this.
|
|
401
|
-
this.proxy.disabled = this.disabled;
|
|
402
|
-
this.proxy.required = this.required;
|
|
403
|
-
if (typeof this.name === "string") {
|
|
404
|
-
this.proxy.name = this.name;
|
|
405
|
-
}
|
|
406
|
-
if (typeof this.value === "string") {
|
|
407
|
-
this.proxy.value = this.value;
|
|
408
|
-
}
|
|
409
|
-
this.proxy.setAttribute("slot", proxySlotName);
|
|
410
|
-
this.proxySlot = document.createElement("slot");
|
|
411
|
-
this.proxySlot.setAttribute("name", proxySlotName);
|
|
412
|
-
}
|
|
413
|
-
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot);
|
|
414
|
-
this.appendChild(this.proxy);
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Detach the proxy element from the DOM
|
|
418
|
-
*/
|
|
419
|
-
detachProxy() {
|
|
420
|
-
var _a;
|
|
421
|
-
this.removeChild(this.proxy);
|
|
422
|
-
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot);
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Sets the validity of the custom element. By default this uses the proxy element to determine
|
|
426
|
-
* validity, but this can be extended or replaced in implementation.
|
|
427
|
-
*/
|
|
428
|
-
validate() {
|
|
429
|
-
if (this.proxy instanceof HTMLElement) {
|
|
430
|
-
this.setValidity(this.proxy.validity, this.proxy.validationMessage);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Associates the provided value (and optional state) with the parent form.
|
|
435
|
-
* @param value - The value to set
|
|
436
|
-
* @param state - The state object provided to during session restores and when autofilling.
|
|
437
|
-
*/
|
|
438
|
-
setFormValue(value, state) {
|
|
439
|
-
if (this.elementInternals) {
|
|
440
|
-
this.elementInternals.setFormValue(value, state || value);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
_keypressHandler(e) {
|
|
444
|
-
switch (e.key) {
|
|
445
|
-
case keyEnter:
|
|
446
|
-
if (this.form instanceof HTMLFormElement) {
|
|
447
|
-
// Implicit submission
|
|
448
|
-
const defaultButton = this.form.querySelector("[type=submit]");
|
|
449
|
-
defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click();
|
|
450
|
-
}
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Used to stop propagation of proxy element events
|
|
456
|
-
* @param e - Event object
|
|
457
|
-
*/
|
|
458
|
-
stopPropagation(e) {
|
|
459
|
-
e.stopPropagation();
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
attr({ mode: "boolean" })(C.prototype, "disabled");
|
|
463
|
-
attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue");
|
|
464
|
-
attr({ attribute: "current-value" })(C.prototype, "currentValue");
|
|
465
|
-
attr(C.prototype, "name");
|
|
466
|
-
attr({ mode: "boolean" })(C.prototype, "required");
|
|
467
|
-
observable(C.prototype, "value");
|
|
468
|
-
return C;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
class _Button extends FoundationElement {
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
|
|
475
|
-
*
|
|
476
|
-
* @internal
|
|
477
|
-
*/
|
|
478
|
-
class FormAssociatedButton extends FormAssociated(_Button) {
|
|
479
|
-
constructor() {
|
|
480
|
-
super(...arguments);
|
|
481
|
-
this.proxy = document.createElement("input");
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* A Button Custom HTML Element.
|
|
487
|
-
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
|
|
488
|
-
*
|
|
489
|
-
* @public
|
|
490
|
-
*/
|
|
491
|
-
class Button$1 extends FormAssociatedButton {
|
|
492
|
-
constructor() {
|
|
493
|
-
super(...arguments);
|
|
494
|
-
/**
|
|
495
|
-
* Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
|
|
496
|
-
* @internal
|
|
497
|
-
*/
|
|
498
|
-
this.handleClick = (e) => {
|
|
499
|
-
var _a;
|
|
500
|
-
if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
|
|
501
|
-
e.stopPropagation();
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
/**
|
|
505
|
-
* Submits the parent form
|
|
506
|
-
*/
|
|
507
|
-
this.handleSubmission = () => {
|
|
508
|
-
if (!this.form) {
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
const attached = this.proxy.isConnected;
|
|
512
|
-
if (!attached) {
|
|
513
|
-
this.attachProxy();
|
|
514
|
-
}
|
|
515
|
-
// Browser support for requestSubmit is not comprehensive
|
|
516
|
-
// so click the proxy if it isn't supported
|
|
517
|
-
typeof this.form.requestSubmit === "function"
|
|
518
|
-
? this.form.requestSubmit(this.proxy)
|
|
519
|
-
: this.proxy.click();
|
|
520
|
-
if (!attached) {
|
|
521
|
-
this.detachProxy();
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
/**
|
|
525
|
-
* Resets the parent form
|
|
526
|
-
*/
|
|
527
|
-
this.handleFormReset = () => {
|
|
528
|
-
var _a;
|
|
529
|
-
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
530
|
-
};
|
|
531
|
-
/**
|
|
532
|
-
* Overrides the focus call for where delegatesFocus is unsupported.
|
|
533
|
-
* This check works for Chrome, Edge Chromium, FireFox, and Safari
|
|
534
|
-
* Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
|
|
535
|
-
*/
|
|
536
|
-
this.handleUnsupportedDelegatesFocus = () => {
|
|
537
|
-
var _a;
|
|
538
|
-
// Check to see if delegatesFocus is supported
|
|
539
|
-
if (window.ShadowRoot &&
|
|
540
|
-
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
|
|
541
|
-
this.focus = () => {
|
|
542
|
-
this.control.focus();
|
|
543
|
-
};
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
formactionChanged() {
|
|
548
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
549
|
-
this.proxy.formAction = this.formaction;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
formenctypeChanged() {
|
|
553
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
554
|
-
this.proxy.formEnctype = this.formenctype;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
formmethodChanged() {
|
|
558
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
559
|
-
this.proxy.formMethod = this.formmethod;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
formnovalidateChanged() {
|
|
563
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
564
|
-
this.proxy.formNoValidate = this.formnovalidate;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
formtargetChanged() {
|
|
568
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
569
|
-
this.proxy.formTarget = this.formtarget;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
typeChanged(previous, next) {
|
|
573
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
574
|
-
this.proxy.type = this.type;
|
|
575
|
-
}
|
|
576
|
-
next === "submit" && this.addEventListener("click", this.handleSubmission);
|
|
577
|
-
previous === "submit" && this.removeEventListener("click", this.handleSubmission);
|
|
578
|
-
next === "reset" && this.addEventListener("click", this.handleFormReset);
|
|
579
|
-
previous === "reset" && this.removeEventListener("click", this.handleFormReset);
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* @internal
|
|
583
|
-
*/
|
|
584
|
-
connectedCallback() {
|
|
585
|
-
var _a;
|
|
586
|
-
super.connectedCallback();
|
|
587
|
-
this.proxy.setAttribute("type", this.type);
|
|
588
|
-
this.handleUnsupportedDelegatesFocus();
|
|
589
|
-
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
590
|
-
if (elements) {
|
|
591
|
-
elements.forEach((span) => {
|
|
592
|
-
span.addEventListener("click", this.handleClick);
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* @internal
|
|
598
|
-
*/
|
|
599
|
-
disconnectedCallback() {
|
|
600
|
-
var _a;
|
|
601
|
-
super.disconnectedCallback();
|
|
602
|
-
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
603
|
-
if (elements) {
|
|
604
|
-
elements.forEach((span) => {
|
|
605
|
-
span.removeEventListener("click", this.handleClick);
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
__decorate([
|
|
611
|
-
attr({ mode: "boolean" })
|
|
612
|
-
], Button$1.prototype, "autofocus", void 0);
|
|
613
|
-
__decorate([
|
|
614
|
-
attr({ attribute: "form" })
|
|
615
|
-
], Button$1.prototype, "formId", void 0);
|
|
616
|
-
__decorate([
|
|
617
|
-
attr
|
|
618
|
-
], Button$1.prototype, "formaction", void 0);
|
|
619
|
-
__decorate([
|
|
620
|
-
attr
|
|
621
|
-
], Button$1.prototype, "formenctype", void 0);
|
|
622
|
-
__decorate([
|
|
623
|
-
attr
|
|
624
|
-
], Button$1.prototype, "formmethod", void 0);
|
|
625
|
-
__decorate([
|
|
626
|
-
attr({ mode: "boolean" })
|
|
627
|
-
], Button$1.prototype, "formnovalidate", void 0);
|
|
628
|
-
__decorate([
|
|
629
|
-
attr
|
|
630
|
-
], Button$1.prototype, "formtarget", void 0);
|
|
631
|
-
__decorate([
|
|
632
|
-
attr
|
|
633
|
-
], Button$1.prototype, "type", void 0);
|
|
634
|
-
__decorate([
|
|
635
|
-
observable
|
|
636
|
-
], Button$1.prototype, "defaultSlottedContent", void 0);
|
|
637
|
-
/**
|
|
638
|
-
* Includes ARIA states and properties relating to the ARIA button role
|
|
639
|
-
*
|
|
640
|
-
* @public
|
|
641
|
-
*/
|
|
642
|
-
class DelegatesARIAButton {
|
|
643
|
-
}
|
|
644
|
-
__decorate([
|
|
645
|
-
attr({ attribute: "aria-expanded" })
|
|
646
|
-
], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
|
|
647
|
-
__decorate([
|
|
648
|
-
attr({ attribute: "aria-pressed" })
|
|
649
|
-
], DelegatesARIAButton.prototype, "ariaPressed", void 0);
|
|
650
|
-
applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
|
|
651
|
-
applyMixins(Button$1, StartEnd, DelegatesARIAButton);
|
|
652
|
-
|
|
653
|
-
class Button extends Button$1 {
|
|
654
|
-
constructor() {
|
|
655
|
-
super(...arguments);
|
|
656
|
-
this.label = '';
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "connotation", void 0);
|
|
662
|
-
|
|
663
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "shape", void 0);
|
|
664
|
-
|
|
665
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "appearance", void 0);
|
|
666
|
-
|
|
667
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "size", void 0);
|
|
668
|
-
|
|
669
|
-
__decorate([attr({
|
|
670
|
-
mode: 'fromView'
|
|
671
|
-
}), __metadata("design:type", Object)], Button.prototype, "label", void 0);
|
|
672
|
-
|
|
673
|
-
applyMixins(Button, AffixIconWithTrailing);
|
|
674
|
-
|
|
675
|
-
var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n:host {\n outline: 0 none;\n}\n\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background-color: var(--_appearance-color-fill);\n block-size: var(--button-block-size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n cursor: pointer;\n outline: 0 none;\n vertical-align: middle;\n}\n.control:not(.connotation-cta):not(.connotation-success):not(.connotation-alert) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n --connotation-diverse: var(--vvd-color-neutral-70);\n --connotation-contrast: var(--vvd-color-neutral-90);\n --connotation-soft: var(--vvd-color-neutral-20);\n --connotation-pale: var(--vvd-color-neutral-10);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n --connotation-diverse: var(--vvd-color-cta-70);\n --connotation-contrast: var(--vvd-color-cta-90);\n --connotation-soft: var(--vvd-color-cta-20);\n --connotation-pale: var(--vvd-color-cta-10);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-diverse: var(--vvd-color-success-70);\n --connotation-contrast: var(--vvd-color-success-90);\n --connotation-soft: var(--vvd-color-success-20);\n --connotation-pale: var(--vvd-color-success-10);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-diverse: var(--vvd-color-alert-70);\n --connotation-contrast: var(--vvd-color-alert-90);\n --connotation-soft: var(--vvd-color-alert-20);\n --connotation-pale: var(--vvd-color-alert-10);\n}\n\n.control.appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation);\n --_appearance-color-outline: transaprent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--connotation);\n}\n.control {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:hover.appearance-filled, .control.hovered.appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation-diverse);\n --_appearance-color-outline: transaprent;\n}\n.control:hover.appearance-outlined, .control.hovered.appearance-outlined {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: var(--connotation-pale);\n --_appearance-color-outline: var(--connotation);\n}\n.control:hover, .control.hovered {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: var(--connotation-pale);\n --_appearance-color-outline: transaprent;\n}\n.control:disabled.appearance-filled, .control.disabled.appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-30);\n --_appearance-color-fill: var(--vvd-color-neutral-10);\n --_appearance-color-outline: transaprent;\n}\n.control:disabled.appearance-outlined, .control.disabled.appearance-outlined {\n --_appearance-color-text: var(--vvd-color-neutral-30);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--vvd-color-neutral-30);\n}\n.control:disabled, .control.disabled {\n --_appearance-color-text: var(--vvd-color-neutral-30);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:active.appearance-filled, .control.active.appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation-contrast);\n --_appearance-color-outline: transaprent;\n}\n.control:active.appearance-outlined, .control.active.appearance-outlined {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: var(--connotation-soft);\n --_appearance-color-outline: var(--connotation);\n}\n.control:active, .control.active {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: var(--connotation-soft);\n --_appearance-color-outline: transaprent;\n}\n.control.icon-only {\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--button-block-size);\n }\n}\n\n/* Size */\n.control.size-base-small {\n --button-block-size: 32px;\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.size-base-small:not(.icon-only) {\n --button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control.size-base-small .icon {\n font-size: 16px;\n}\n\n.control.size-base-large {\n --button-block-size: 48px;\n font: 600 ultra-condensed 16px / 24px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.size-base-large:not(.icon-only) {\n --button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control.size-base-large .icon {\n font-size: 24px;\n}\n\n.control:not(.size-base-small):not(.size-base-large) {\n --button-block-size: 40px;\n font: 600 ultra-condensed 14px / 100% SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control:not(.size-base-small):not(.size-base-large):not(.icon-only) {\n --button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control:not(.size-base-small):not(.size-base-large) .icon {\n font-size: 20px;\n}\n\n/* Shape */\n.control:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.control.shape-pill:not(.icon-only) {\n border-radius: 24px;\n}\n.control.shape-pill.icon-only {\n border-radius: 50%;\n}\n\n/* Icon */\n:not(.icon-trailing) .icon {\n margin-inline-end: var(--button-icon-gap);\n}\n.icon-trailing .icon {\n order: 1;\n margin-inline-start: var(--button-icon-gap);\n}\n\n:not(:focus) .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
|
|
676
|
-
styleInject(css_248z);
|
|
677
|
-
|
|
678
|
-
let _ = t => t,
|
|
679
|
-
_t,
|
|
680
|
-
_t2;
|
|
681
|
-
|
|
682
|
-
const getAppearanceClassName = (appearance, disabled) => {
|
|
683
|
-
let className = `appearance-${appearance}`;
|
|
684
|
-
disabled && (className += ' disabled');
|
|
685
|
-
return className;
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
const getClasses = ({
|
|
689
|
-
connotation,
|
|
690
|
-
appearance,
|
|
691
|
-
shape,
|
|
692
|
-
size,
|
|
693
|
-
icon,
|
|
694
|
-
label,
|
|
695
|
-
disabled,
|
|
696
|
-
iconTrailing
|
|
697
|
-
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [getAppearanceClassName(appearance, disabled), Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing]);
|
|
698
|
-
|
|
699
|
-
const focusTemplate = context => {
|
|
700
|
-
const focusTag = context.tagFor(Focus);
|
|
701
|
-
return html(_t || (_t = _`<${0} class="focus-indicator"></${0}>`), focusTag, focusTag);
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
const buttonTemplate = context => {
|
|
705
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
706
|
-
return html(_t2 || (_t2 = _`
|
|
707
|
-
<button
|
|
708
|
-
class="${0}"
|
|
709
|
-
?autofocus="${0}"
|
|
710
|
-
?disabled="${0}"
|
|
711
|
-
form="${0}"
|
|
712
|
-
formaction="${0}"
|
|
713
|
-
formenctype="${0}"
|
|
714
|
-
formmethod="${0}"
|
|
715
|
-
formnovalidate="${0}"
|
|
716
|
-
formtarget="${0}"
|
|
717
|
-
name="${0}"
|
|
718
|
-
type="${0}"
|
|
719
|
-
value="${0}"
|
|
720
|
-
aria-atomic="${0}"
|
|
721
|
-
aria-busy="${0}"
|
|
722
|
-
aria-controls="${0}"
|
|
723
|
-
aria-current="${0}"
|
|
724
|
-
aria-describedby="${0}"
|
|
725
|
-
aria-details="${0}"
|
|
726
|
-
aria-disabled="${0}"
|
|
727
|
-
aria-errormessage="${0}"
|
|
728
|
-
aria-expanded="${0}"
|
|
729
|
-
aria-flowto="${0}"
|
|
730
|
-
aria-haspopup="${0}"
|
|
731
|
-
aria-hidden="${0}"
|
|
732
|
-
aria-invalid="${0}"
|
|
733
|
-
aria-keyshortcuts="${0}"
|
|
734
|
-
aria-label="${0}"
|
|
735
|
-
aria-labelledby="${0}"
|
|
736
|
-
aria-live="${0}"
|
|
737
|
-
aria-owns="${0}"
|
|
738
|
-
aria-pressed="${0}"
|
|
739
|
-
aria-relevant="${0}"
|
|
740
|
-
aria-roledescription="${0}"
|
|
741
|
-
${0}
|
|
742
|
-
>
|
|
743
|
-
${0}
|
|
744
|
-
${0}
|
|
745
|
-
${0}
|
|
746
|
-
</button>
|
|
747
|
-
`), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate(context), x => affixIconTemplate(x.icon), x => x.label);
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
const vividButton = Button.compose({
|
|
751
|
-
baseName: 'button',
|
|
752
|
-
baseClass: Button$1,
|
|
753
|
-
template: buttonTemplate,
|
|
754
|
-
styles: css_248z,
|
|
755
|
-
shadowOptions: {
|
|
756
|
-
delegatesFocus: true
|
|
757
|
-
}
|
|
758
|
-
});
|
|
759
|
-
designSystem.register(vividButton());
|
|
760
|
-
|
|
761
|
-
export { vividButton };
|