@vonage/vivid 3.0.0-next.7 → 3.0.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/index.js +61 -0
- package/accordion-item/index.js +125 -0
- package/badge/index.js +64 -0
- package/banner/index.js +212 -0
- package/breadcrumb/index.js +100 -0
- package/breadcrumb-item/index.js +55 -0
- package/button/index.js +761 -0
- package/calendar/index.js +1521 -0
- package/elevation/index.js +31 -0
- package/focus/index.js +3 -0
- package/icon/index.js +34 -0
- package/{src/index.ts → index.d.ts} +2 -2
- package/index.js +32 -0
- package/layout/index.js +53 -0
- package/lib/accordion/accordion.d.ts +9 -0
- package/lib/accordion/accordion.template.d.ts +4 -0
- package/lib/accordion/index.d.ts +2 -0
- package/lib/accordion-item/accordion-item.d.ts +13 -0
- package/lib/accordion-item/accordion-item.template.d.ts +4 -0
- package/lib/accordion-item/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +17 -0
- package/lib/badge/badge.template.d.ts +4 -0
- package/lib/badge/index.d.ts +3 -0
- package/lib/banner/banner.d.ts +20 -0
- package/lib/banner/banner.template.d.ts +6 -0
- package/lib/banner/index.d.ts +2 -0
- package/lib/breadcrumb/breadcrumb.d.ts +3 -0
- package/lib/breadcrumb/index.d.ts +2 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -0
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -0
- package/lib/breadcrumb-item/index.d.ts +3 -0
- package/lib/button/button.d.ts +17 -0
- package/lib/button/button.template.d.ts +4 -0
- package/lib/button/index.d.ts +21 -0
- package/lib/calendar/calendar.d.ts +11 -0
- package/lib/calendar/calendar.template.d.ts +4 -0
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
- package/lib/calendar/index.d.ts +3 -0
- package/{src/lib/components.ts → lib/components.d.ts} +16 -16
- package/lib/elevation/elevation.d.ts +4 -0
- package/lib/elevation/elevation.template.d.ts +4 -0
- package/lib/elevation/index.d.ts +2 -0
- package/lib/enums.d.ts +45 -0
- package/lib/focus/focus.d.ts +3 -0
- package/lib/focus/focus.template.d.ts +4 -0
- package/lib/focus/index.d.ts +2 -0
- package/lib/icon/icon.d.ts +11 -0
- package/lib/icon/icon.placeholder.d.ts +1 -0
- package/lib/icon/icon.template.d.ts +4 -0
- package/lib/icon/index.d.ts +2 -0
- package/lib/layout/index.d.ts +2 -0
- package/lib/layout/layout.d.ts +16 -0
- package/lib/layout/layout.template.d.ts +4 -0
- package/lib/popup/index.d.ts +4 -0
- package/lib/popup/popup.d.ts +17 -0
- package/lib/popup/popup.template.d.ts +4 -0
- package/lib/progress/index.d.ts +2 -0
- package/lib/progress/progress.d.ts +9 -0
- package/lib/progress/progress.template.d.ts +5 -0
- package/lib/progress-ring/index.d.ts +2 -0
- package/lib/progress-ring/progress-ring.d.ts +6 -0
- package/lib/progress-ring/progress-ring.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +2 -0
- package/lib/side-drawer/side-drawer.d.ts +8 -0
- package/lib/side-drawer/side-drawer.template.d.ts +4 -0
- package/lib/sidenav-item/index.d.ts +3 -0
- package/lib/sidenav-item/sidenav-item.d.ts +6 -0
- package/lib/sidenav-item/sidenav-item.template.d.ts +4 -0
- package/lib/text/index.d.ts +2 -0
- package/lib/text/text.d.ts +10 -0
- package/lib/text/text.template.d.ts +4 -0
- package/lib/text-anchor/index.d.ts +2 -0
- package/lib/text-anchor/text-anchor.d.ts +7 -0
- package/lib/text-anchor/text-anchor.template.d.ts +4 -0
- package/lib/tooltip/index.d.ts +3 -0
- package/lib/tooltip/tooltip.d.ts +8 -0
- package/lib/tooltip/tooltip.template.d.ts +4 -0
- package/package.json +13 -3
- package/popup/index.js +2065 -0
- package/progress/index.js +98 -0
- package/progress-ring/index.js +76 -0
- package/shared/_has.js +58 -0
- package/shared/affix.js +29 -0
- package/shared/anchor.js +78 -0
- package/shared/apply-mixins.js +22 -0
- package/shared/aria-global.js +156 -0
- package/shared/base-progress.js +65 -0
- package/shared/breadcrumb-item.js +25 -0
- package/shared/class-names.js +15 -0
- package/shared/design-system/index.d.ts +3 -0
- package/shared/es.object.assign.js +68 -0
- package/shared/icon.js +1393 -0
- package/shared/index.js +4998 -0
- package/shared/index2.js +21 -0
- package/shared/patterns/affix.d.ts +9 -0
- package/{src/shared/patterns/index.ts → shared/patterns/index.d.ts} +1 -1
- package/shared/slotted.js +119 -0
- package/shared/style-inject.es.js +28 -0
- package/shared/text-anchor.js +21 -0
- package/shared/text-anchor.template.js +54 -0
- package/shared/web.dom-collections.iterator.js +1479 -0
- package/shared/when.js +15 -0
- package/side-drawer/index.js +81 -0
- package/sidenav-item/index.js +38 -0
- package/styles/fonts/spezia.css +23 -0
- package/styles/themes/dark.css +205 -0
- package/styles/themes/light.css +205 -0
- package/text/index.js +45 -0
- package/text-anchor/index.js +19 -0
- package/tooltip/index.js +65 -0
- package/.babelrc +0 -3
- package/.eslintrc.json +0 -70
- package/.stylelintrc.json +0 -8
- package/CHANGELOG.json +0 -343
- package/CHANGELOG.md +0 -45
- package/jest.config.cjs +0 -20
- package/playwright.config.dev.ts +0 -21
- package/playwright.config.ts +0 -34
- package/project.json +0 -122
- package/rollup.config.prod.ts +0 -50
- package/setupJestTests.js +0 -17
- package/src/lib/accordion/README.md +0 -55
- package/src/lib/accordion/accordion.scss +0 -10
- package/src/lib/accordion/accordion.spec.ts +0 -91
- package/src/lib/accordion/accordion.template.ts +0 -23
- package/src/lib/accordion/accordion.ts +0 -49
- package/src/lib/accordion/index.ts +0 -14
- package/src/lib/accordion/ui.test.ts +0 -37
- 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 +0 -113
- package/src/lib/accordion-item/accordion-item.scss +0 -91
- package/src/lib/accordion-item/accordion-item.spec.ts +0 -103
- package/src/lib/accordion-item/accordion-item.template.ts +0 -62
- package/src/lib/accordion-item/accordion-item.ts +0 -67
- package/src/lib/accordion-item/index.ts +0 -14
- package/src/lib/accordion-item/partials/variables.scss +0 -1
- package/src/lib/accordion-item/ui.test.ts +0 -37
- 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 +0 -112
- package/src/lib/badge/badge.scss +0 -64
- package/src/lib/badge/badge.spec.ts +0 -114
- package/src/lib/badge/badge.template.ts +0 -36
- package/src/lib/badge/badge.ts +0 -97
- package/src/lib/badge/index.ts +0 -23
- package/src/lib/badge/ui.test.ts +0 -28
- 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 +0 -117
- package/src/lib/banner/banner.scss +0 -71
- package/src/lib/banner/banner.spec.ts +0 -355
- package/src/lib/banner/banner.template.ts +0 -61
- package/src/lib/banner/banner.ts +0 -77
- package/src/lib/banner/index.ts +0 -14
- package/src/lib/banner/ui.test.ts +0 -64
- 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 +0 -25
- package/src/lib/breadcrumb/breadcrumb.scss +0 -3
- package/src/lib/breadcrumb/breadcrumb.spec.ts +0 -78
- package/src/lib/breadcrumb/breadcrumb.ts +0 -10
- package/src/lib/breadcrumb/index.ts +0 -13
- package/src/lib/breadcrumb/ui.test.ts +0 -36
- 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 +0 -40
- package/src/lib/breadcrumb-item/breadcrumb-item.scss +0 -28
- package/src/lib/breadcrumb-item/breadcrumb-item.spec.ts +0 -192
- package/src/lib/breadcrumb-item/breadcrumb-item.template.ts +0 -37
- package/src/lib/breadcrumb-item/breadcrumb-item.ts +0 -15
- package/src/lib/breadcrumb-item/index.ts +0 -16
- package/src/lib/breadcrumb-item/ui.test.ts +0 -38
- 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 +0 -120
- package/src/lib/button/button.scss +0 -142
- package/src/lib/button/button.spec.ts +0 -131
- package/src/lib/button/button.template.ts +0 -89
- package/src/lib/button/button.ts +0 -95
- package/src/lib/button/index.ts +0 -25
- package/src/lib/button/partials/variables.scss +0 -2
- package/src/lib/button/ui.test.ts +0 -32
- 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 +0 -70
- package/src/lib/calendar/calendar.scss +0 -176
- package/src/lib/calendar/calendar.spec.ts +0 -341
- package/src/lib/calendar/calendar.template.ts +0 -93
- package/src/lib/calendar/calendar.ts +0 -139
- package/src/lib/calendar/helpers/calendar.date-functions.ts +0 -31
- package/src/lib/calendar/helpers/calendar.event-context.ts +0 -72
- package/src/lib/calendar/helpers/calendar.keyboard-interactions.ts +0 -65
- package/src/lib/calendar/index.ts +0 -16
- package/src/lib/calendar/partials/_variables.scss +0 -15
- package/src/lib/calendar/ui.test.ts +0 -32
- 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 +0 -7
- package/src/lib/elevation/README.md +0 -99
- package/src/lib/elevation/elevation.scss +0 -15
- package/src/lib/elevation/elevation.spec.ts +0 -55
- package/src/lib/elevation/elevation.template.ts +0 -26
- package/src/lib/elevation/elevation.ts +0 -17
- package/src/lib/elevation/index.ts +0 -17
- package/src/lib/elevation/partials/_elevation.mixin.scss +0 -4
- package/src/lib/elevation/ui.test.ts +0 -32
- 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 +0 -55
- package/src/lib/focus/README.md +0 -1
- package/src/lib/focus/focus.scss +0 -17
- package/src/lib/focus/focus.template.ts +0 -16
- package/src/lib/focus/focus.ts +0 -10
- package/src/lib/focus/index.ts +0 -21
- package/src/lib/focus/partials/variables.scss +0 -2
- package/src/lib/icon/README.md +0 -70
- package/src/lib/icon/__snapshots__/icon.spec.ts.snap +0 -16
- package/src/lib/icon/icon.placeholder.ts +0 -12
- package/src/lib/icon/icon.scss +0 -52
- package/src/lib/icon/icon.spec.ts +0 -106
- package/src/lib/icon/icon.template.ts +0 -23
- package/src/lib/icon/icon.ts +0 -93
- package/src/lib/icon/index.ts +0 -14
- package/src/lib/layout/README.md +0 -154
- package/src/lib/layout/index.ts +0 -18
- package/src/lib/layout/layout.scss +0 -40
- package/src/lib/layout/layout.spec.ts +0 -73
- package/src/lib/layout/layout.template.ts +0 -29
- package/src/lib/layout/layout.ts +0 -46
- package/src/lib/layout/partials/_functions.scss +0 -15
- package/src/lib/layout/partials/_mixins.scss +0 -5
- package/src/lib/layout/partials/_variables.scss +0 -23
- package/src/lib/layout/ui.test.ts +0 -32
- 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 +0 -261
- package/src/lib/popup/index.ts +0 -21
- package/src/lib/popup/popup.scss +0 -43
- package/src/lib/popup/popup.spec.ts +0 -265
- package/src/lib/popup/popup.template.ts +0 -41
- package/src/lib/popup/popup.ts +0 -158
- package/src/lib/popup/ui.test.ts +0 -111
- 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 +0 -107
- package/src/lib/progress/index.ts +0 -14
- package/src/lib/progress/progress.scss +0 -133
- package/src/lib/progress/progress.spec.ts +0 -173
- package/src/lib/progress/progress.template.ts +0 -62
- package/src/lib/progress/progress.ts +0 -25
- package/src/lib/progress/ui.test.ts +0 -70
- 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 +0 -90
- package/src/lib/progress-ring/index.ts +0 -15
- package/src/lib/progress-ring/progress-ring.scss +0 -75
- package/src/lib/progress-ring/progress-ring.spec.ts +0 -139
- package/src/lib/progress-ring/progress-ring.template.ts +0 -82
- package/src/lib/progress-ring/progress-ring.ts +0 -18
- package/src/lib/progress-ring/ui.test.ts +0 -35
- 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 +0 -304
- package/src/lib/side-drawer/index.ts +0 -16
- package/src/lib/side-drawer/partials/variables.scss +0 -6
- package/src/lib/side-drawer/side-drawer.scss +0 -109
- package/src/lib/side-drawer/side-drawer.spec.ts +0 -118
- package/src/lib/side-drawer/side-drawer.template.ts +0 -51
- package/src/lib/side-drawer/side-drawer.ts +0 -58
- package/src/lib/side-drawer/ui.test.ts +0 -102
- 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 +0 -41
- package/src/lib/sidenav-item/index.ts +0 -20
- package/src/lib/sidenav-item/sidenav-item.scss +0 -51
- package/src/lib/sidenav-item/sidenav-item.spec.ts +0 -64
- package/src/lib/sidenav-item/sidenav-item.template.ts +0 -25
- package/src/lib/sidenav-item/sidenav-item.ts +0 -15
- package/src/lib/sidenav-item/ui.test.ts +0 -32
- 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 +0 -119
- package/src/lib/text/index.ts +0 -14
- package/src/lib/text/text.scss +0 -92
- package/src/lib/text/text.spec.ts +0 -54
- package/src/lib/text/text.template.ts +0 -28
- package/src/lib/text/text.ts +0 -55
- package/src/lib/text/ui.test.ts +0 -39
- 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 +0 -5
- package/src/lib/text-anchor/index.ts +0 -12
- package/src/lib/text-anchor/text-anchor.spec.ts +0 -153
- package/src/lib/text-anchor/text-anchor.template.ts +0 -66
- package/src/lib/text-anchor/text-anchor.ts +0 -22
- package/src/lib/tooltip/README.md +0 -132
- package/src/lib/tooltip/index.ts +0 -16
- package/src/lib/tooltip/partials/variables.scss +0 -1
- package/src/lib/tooltip/tooltip.scss +0 -18
- package/src/lib/tooltip/tooltip.spec.ts +0 -70
- package/src/lib/tooltip/tooltip.template.ts +0 -30
- package/src/lib/tooltip/tooltip.ts +0 -44
- package/src/lib/tooltip/ui.test.ts +0 -53
- 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 +0 -12
- package/src/shared/patterns/affix.ts +0 -56
- package/src/types/extract-gfm.d.ts +0 -5
- package/src/types/style.d.ts +0 -4
- package/src/visual-tests/visual-tests-utils.ts +0 -76
- package/tsconfig.json +0 -36
- package/tsconfig.lib.json +0 -11
- package/tsconfig.spec.json +0 -16
package/button/index.js
ADDED
|
@@ -0,0 +1,761 @@
|
|
|
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 Wed, 27 Apr 2022 11:58:36 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-contrast: var(--vvd-color-neutral-90);\n --connotation-fierce: var(--vvd-color-neutral-80);\n --connotation-strong: 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-contrast: var(--vvd-color-cta-90);\n --connotation-fierce: var(--vvd-color-cta-80);\n --connotation-strong: var(--vvd-color-cta-70);\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-contrast: var(--vvd-color-success-90);\n --connotation-fierce: var(--vvd-color-success-80);\n --connotation-strong: var(--vvd-color-success-70);\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-contrast: var(--vvd-color-alert-90);\n --connotation-fierce: var(--vvd-color-alert-80);\n --connotation-strong: var(--vvd-color-alert-70);\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:not(:disabled, .disabled).appearance-filled, .control.hovered:not(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation-strong);\n --_appearance-color-outline: transaprent;\n}\n.control:hover:not(:disabled, .disabled).appearance-outlined, .control.hovered:not(:disabled, .disabled).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:not(:disabled, .disabled), .control.hovered:not(:disabled, .disabled) {\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:not(:disabled, .disabled).appearance-filled, .control.active:not(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation-fierce);\n --_appearance-color-outline: transaprent;\n}\n.control:active:not(:disabled, .disabled).appearance-outlined, .control.active:not(:disabled, .disabled).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:not(:disabled, .disabled), .control.active:not(:disabled, .disabled) {\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 };
|