@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
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
import {elementUpdated, fixture} from '@vivid-nx/shared';
|
|
2
|
-
import type {Icon} from '../icon/icon';
|
|
3
|
-
import {Button} from '../button/button';
|
|
4
|
-
import {Connotation} from '../enums';
|
|
5
|
-
import { Banner } from './banner';
|
|
6
|
-
import type { BannerConnotation } from './banner';
|
|
7
|
-
import '.';
|
|
8
|
-
|
|
9
|
-
const COMPONENT_TAG = 'vwc-banner';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param element
|
|
13
|
-
* @param removable
|
|
14
|
-
*/
|
|
15
|
-
async function toggleRemovable(element: Banner, removable = true) {
|
|
16
|
-
element.removable = removable;
|
|
17
|
-
await elementUpdated(element);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
describe('vwc-banner', () => {
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
function dispatchAnimationEndEvent() {
|
|
25
|
-
const banner = element.shadowRoot?.querySelector('.banner');
|
|
26
|
-
const event = new Event('transitionend');
|
|
27
|
-
banner?.dispatchEvent(event);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
let element: Banner;
|
|
31
|
-
|
|
32
|
-
beforeEach(async () => {
|
|
33
|
-
element = (await fixture(
|
|
34
|
-
`<${COMPONENT_TAG}></${COMPONENT_TAG}>`
|
|
35
|
-
)) as Banner;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('basic', () => {
|
|
39
|
-
it('should be initialized as a vwc-banner', async () => {
|
|
40
|
-
expect(element)
|
|
41
|
-
.toBeInstanceOf(Banner);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('text', function () {
|
|
46
|
-
/**
|
|
47
|
-
* @param text
|
|
48
|
-
*/
|
|
49
|
-
async function setTextProperty(text: string | undefined) {
|
|
50
|
-
element.text = text;
|
|
51
|
-
await elementUpdated(element);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @param text
|
|
56
|
-
*/
|
|
57
|
-
async function setTextAttribute(text: string | undefined) {
|
|
58
|
-
element.setAttribute('text', text ? text : '');
|
|
59
|
-
await elementUpdated(element);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
function getText() {
|
|
66
|
-
const text = element.shadowRoot?.querySelector('.banner--message')?.textContent;
|
|
67
|
-
return text?.trim();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
it('should init with undefined and set as empty string in DOM', function () {
|
|
71
|
-
const initTextPropEmpty = element.text;
|
|
72
|
-
const initTextAttrEmpty = getText();
|
|
73
|
-
|
|
74
|
-
expect(initTextPropEmpty)
|
|
75
|
-
.toEqual(undefined);
|
|
76
|
-
expect(initTextAttrEmpty)
|
|
77
|
-
.toEqual('');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should reflect the message', async function () {
|
|
81
|
-
const messageText = 'Some Text';
|
|
82
|
-
|
|
83
|
-
await setTextProperty(messageText);
|
|
84
|
-
const DOMTextWithProperty = getText();
|
|
85
|
-
|
|
86
|
-
await setTextProperty(undefined);
|
|
87
|
-
await setTextAttribute(messageText);
|
|
88
|
-
const propertyTextWithAttribute = element.text;
|
|
89
|
-
|
|
90
|
-
expect(DOMTextWithProperty)
|
|
91
|
-
.toEqual(messageText);
|
|
92
|
-
expect(propertyTextWithAttribute)
|
|
93
|
-
.toEqual(messageText);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
describe('role', function () {
|
|
98
|
-
it('should be set to "status" on init', function () {
|
|
99
|
-
const role = element.shadowRoot?.querySelector('.banner--message')
|
|
100
|
-
?.getAttribute('role');
|
|
101
|
-
expect(role)
|
|
102
|
-
.toEqual('status');
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('should change role to role text', async function () {
|
|
106
|
-
element.role = 'alert';
|
|
107
|
-
await elementUpdated(element);
|
|
108
|
-
const role = element.shadowRoot?.querySelector('.banner--message')
|
|
109
|
-
?.getAttribute('role');
|
|
110
|
-
expect(role)
|
|
111
|
-
.toEqual('alert');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should change role when role attribute is set', async function () {
|
|
115
|
-
element.setAttribute('role', 'alert');
|
|
116
|
-
await elementUpdated(element);
|
|
117
|
-
const role = element.shadowRoot?.querySelector('.banner--message')
|
|
118
|
-
?.getAttribute('role');
|
|
119
|
-
expect(role)
|
|
120
|
-
.toEqual('alert');
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe('aria live', function () {
|
|
125
|
-
it('should be set to "live" on init', function () {
|
|
126
|
-
const ariaLive = element.shadowRoot?.querySelector('.banner--message')
|
|
127
|
-
?.getAttribute('aria-live');
|
|
128
|
-
expect(ariaLive)
|
|
129
|
-
.toEqual('polite');
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('should change aria-live to ariaLive text', async function () {
|
|
133
|
-
element.ariaLive = 'assertive';
|
|
134
|
-
await elementUpdated(element);
|
|
135
|
-
const ariaLive = element.shadowRoot?.querySelector('.banner--message')
|
|
136
|
-
?.getAttribute('aria-live');
|
|
137
|
-
expect(ariaLive)
|
|
138
|
-
.toEqual('assertive');
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('should change aria-live to ariaLive text', async function () {
|
|
142
|
-
element.setAttribute('aria-live', 'assertive');
|
|
143
|
-
await elementUpdated(element);
|
|
144
|
-
const ariaLive = element.shadowRoot?.querySelector('.banner--message')
|
|
145
|
-
?.getAttribute('aria-live');
|
|
146
|
-
expect(ariaLive)
|
|
147
|
-
.toEqual('assertive');
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
describe('remove', function () {
|
|
152
|
-
|
|
153
|
-
it('should fire removing event', async function () {
|
|
154
|
-
const spy = jest.fn();
|
|
155
|
-
element.addEventListener('vwc-banner:removing', spy);
|
|
156
|
-
element.remove();
|
|
157
|
-
expect(spy)
|
|
158
|
-
.toHaveBeenCalled();
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it('should fire removed after animation end', async function () {
|
|
162
|
-
|
|
163
|
-
const spy = jest.fn();
|
|
164
|
-
element.addEventListener('vwc-banner:removed', spy);
|
|
165
|
-
element.remove();
|
|
166
|
-
|
|
167
|
-
dispatchAnimationEndEvent();
|
|
168
|
-
|
|
169
|
-
expect(spy)
|
|
170
|
-
.toHaveBeenCalled();
|
|
171
|
-
expect(spy.mock.calls.length)
|
|
172
|
-
.toEqual(1);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
it('should disable removed and removing events after disconnected callback', async function () {
|
|
176
|
-
|
|
177
|
-
const spy = jest.fn();
|
|
178
|
-
element.addEventListener('vwc-banner:removed', spy);
|
|
179
|
-
element.addEventListener('vwc-banner:removing', spy);
|
|
180
|
-
element.disconnectedCallback();
|
|
181
|
-
|
|
182
|
-
element.remove();
|
|
183
|
-
dispatchAnimationEndEvent();
|
|
184
|
-
|
|
185
|
-
expect(spy.mock.calls.length)
|
|
186
|
-
.toEqual(0);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it('should remove the banner after dispatch', function () {
|
|
190
|
-
element.remove();
|
|
191
|
-
dispatchAnimationEndEvent();
|
|
192
|
-
expect(document.body.contains(element))
|
|
193
|
-
.toEqual(false);
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
describe('connotation', function () {
|
|
198
|
-
const possibleConnotations = [Connotation.Info,
|
|
199
|
-
Connotation.Announcement,
|
|
200
|
-
Connotation.Success,
|
|
201
|
-
Connotation.Warning,
|
|
202
|
-
Connotation.Alert
|
|
203
|
-
];
|
|
204
|
-
|
|
205
|
-
it('should leave connotation class empty if not set', async function () {
|
|
206
|
-
possibleConnotations.forEach(connotation => {
|
|
207
|
-
expect(element.shadowRoot?.querySelector('.banner')
|
|
208
|
-
?.classList
|
|
209
|
-
.contains(connotation))
|
|
210
|
-
.toEqual(false);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('should set a connotation class', async function () {
|
|
215
|
-
const connotation = possibleConnotations[2];
|
|
216
|
-
(element.connotation as Connotation) = connotation;
|
|
217
|
-
await elementUpdated(element);
|
|
218
|
-
expect(element.shadowRoot?.querySelector('.banner')
|
|
219
|
-
?.classList
|
|
220
|
-
.contains(`connotation-${connotation}`))
|
|
221
|
-
.toEqual(true);
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
describe('icon', function () {
|
|
226
|
-
let getIcon: () => Icon;
|
|
227
|
-
|
|
228
|
-
beforeEach(function () {
|
|
229
|
-
getIcon = () => element.shadowRoot?.querySelector('.icon > vwc-icon') as Icon;
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
it('should set the icon according to connotation info by default', function () {
|
|
233
|
-
expect(getIcon().type)
|
|
234
|
-
.toEqual('info-solid');
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it('should set the icon according to "icon" attribute', async function () {
|
|
238
|
-
element.setAttribute('icon', 'home');
|
|
239
|
-
await elementUpdated(element);
|
|
240
|
-
|
|
241
|
-
expect(getIcon().type)
|
|
242
|
-
.toEqual('home');
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
it('should set the icon according to set connotation', async function () {
|
|
246
|
-
const connotationIconMap: Map<BannerConnotation, string> = new Map([
|
|
247
|
-
[Connotation.Info, 'info-solid'],
|
|
248
|
-
[Connotation.Announcement, 'megaphone-solid'],
|
|
249
|
-
[Connotation.Success, 'check-circle-solid'],
|
|
250
|
-
[Connotation.Warning, 'warning-solid'],
|
|
251
|
-
[Connotation.Alert, 'error-solid']
|
|
252
|
-
]);
|
|
253
|
-
|
|
254
|
-
for (const [connotation, iconName] of connotationIconMap) {
|
|
255
|
-
element.connotation = connotation;
|
|
256
|
-
|
|
257
|
-
await elementUpdated(element);
|
|
258
|
-
|
|
259
|
-
expect(getIcon().type).toEqual(iconName);
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
describe('removable', function () {
|
|
265
|
-
it('should init to false', function () {
|
|
266
|
-
expect(element.removable)
|
|
267
|
-
.toEqual(false);
|
|
268
|
-
expect(element.hasAttribute('removable'))
|
|
269
|
-
.toEqual(false);
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
it('should toggle attribute on host', async function () {
|
|
273
|
-
await toggleRemovable(element);
|
|
274
|
-
const removeAttributeExistsWhenTrue = element.hasAttribute('removable');
|
|
275
|
-
|
|
276
|
-
await toggleRemovable(element, false);
|
|
277
|
-
const removeAttributeExistsWhenFalse = element.hasAttribute('removable');
|
|
278
|
-
|
|
279
|
-
expect(removeAttributeExistsWhenTrue)
|
|
280
|
-
.toEqual(true);
|
|
281
|
-
expect(removeAttributeExistsWhenFalse)
|
|
282
|
-
.toEqual(false);
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
it('should set removable property on attribute change', async function () {
|
|
286
|
-
element.toggleAttribute('removable');
|
|
287
|
-
await elementUpdated(element);
|
|
288
|
-
expect(element.removable)
|
|
289
|
-
.toEqual(true);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
it('should remove the remove button when removable is false', async function () {
|
|
293
|
-
expect(element.shadowRoot?.querySelector('.dismiss-button'))
|
|
294
|
-
.toEqual(null);
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
it('should add a remove button when true', async function () {
|
|
298
|
-
await toggleRemovable(element, true);
|
|
299
|
-
expect(element.shadowRoot?.querySelector('.dismiss-button'))
|
|
300
|
-
.toBeInstanceOf(Button);
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
it('should remove banner on remove button click', async function () {
|
|
304
|
-
await toggleRemovable(element, true);
|
|
305
|
-
const dismissButton = element.shadowRoot?.querySelector('.dismiss-button') as HTMLElement;
|
|
306
|
-
dismissButton.click();
|
|
307
|
-
dispatchAnimationEndEvent();
|
|
308
|
-
expect(document.body.contains(element))
|
|
309
|
-
.toEqual(false);
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
it('should add class "removing" to banner on remove button click', async function () {
|
|
313
|
-
await toggleRemovable(element, true);
|
|
314
|
-
const dismissButton = element.shadowRoot?.querySelector('.dismiss-button') as HTMLElement;
|
|
315
|
-
dismissButton.click();
|
|
316
|
-
expect(element.shadowRoot?.querySelector('.banner')?.classList.contains('removing')).toEqual(true);
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
describe('remove on escape key', function () {
|
|
321
|
-
it('should remove the button on escape key', async function () {
|
|
322
|
-
element.removable = true;
|
|
323
|
-
element.focus();
|
|
324
|
-
jest.spyOn(element, 'remove');
|
|
325
|
-
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
326
|
-
expect(element.remove).toHaveBeenCalled();
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
it('should remove the banner only on escape key', async function () {
|
|
330
|
-
element.removable = true;
|
|
331
|
-
element.focus();
|
|
332
|
-
const spy = jest.spyOn(element, 'remove');
|
|
333
|
-
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
|
|
334
|
-
expect((spy as any).mock.calls.length).toEqual(0);
|
|
335
|
-
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
it('should remove keydown listener after disconnection', async function () {
|
|
339
|
-
element.removable = true;
|
|
340
|
-
element.focus();
|
|
341
|
-
element.disconnectedCallback();
|
|
342
|
-
const spy = jest.spyOn(element, 'remove');
|
|
343
|
-
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
344
|
-
expect((spy as any).mock.calls.length).toEqual(0);
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
it('should remove the banner only if "removable" is true', async function () {
|
|
348
|
-
element.removable = false;
|
|
349
|
-
element.focus();
|
|
350
|
-
const spy = jest.spyOn(element, 'remove');
|
|
351
|
-
element.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
352
|
-
expect((spy as any).mock.calls.length).toEqual(0);
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {html, when} from '@microsoft/fast-element';
|
|
2
|
-
import type {ViewTemplate} from '@microsoft/fast-element';
|
|
3
|
-
import type {
|
|
4
|
-
ElementDefinitionContext,
|
|
5
|
-
FoundationElementDefinition,
|
|
6
|
-
} from '@microsoft/fast-foundation';
|
|
7
|
-
import {classNames} from '@microsoft/fast-web-utilities';
|
|
8
|
-
import '../button';
|
|
9
|
-
import '../text-anchor';
|
|
10
|
-
import {affixIconTemplateFactory} from '../../shared/patterns/affix';
|
|
11
|
-
import type {Banner} from './banner';
|
|
12
|
-
|
|
13
|
-
const getClasses = (_: Banner) => classNames(
|
|
14
|
-
'control',
|
|
15
|
-
[`connotation-${_.connotation}`, !!_.connotation]
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
function renderDismissButton() {
|
|
22
|
-
return html<Banner>`
|
|
23
|
-
<vwc-button
|
|
24
|
-
size="base-small"
|
|
25
|
-
class="dismiss-button"
|
|
26
|
-
icon="close-line"
|
|
27
|
-
@click="${x => x.remove()}">
|
|
28
|
-
</vwc-button>`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The template for the {@link @microsoft/fast-foundation#Banner} component.
|
|
33
|
-
*
|
|
34
|
-
* @param context
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export const BannerTemplate: (
|
|
38
|
-
context: ElementDefinitionContext,
|
|
39
|
-
definition: FoundationElementDefinition
|
|
40
|
-
) => ViewTemplate<Banner> = (context: ElementDefinitionContext) => {
|
|
41
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
42
|
-
|
|
43
|
-
return html<Banner>`
|
|
44
|
-
<div class="banner ${getClasses}" tabindex="0">
|
|
45
|
-
<header class="header">
|
|
46
|
-
<div class="user-content">
|
|
47
|
-
${x => affixIconTemplate(x.conditionedIcon)}
|
|
48
|
-
<div class="banner--message"
|
|
49
|
-
role="${x => x.role ? x.role : 'status'}"
|
|
50
|
-
aria-live="${x => x.ariaLive ? x.ariaLive : 'polite'}">
|
|
51
|
-
${x => x.text}
|
|
52
|
-
</div>
|
|
53
|
-
<slot class="action-items" name="actionItems"></slot>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
${when(x => x.removable, renderDismissButton())}
|
|
57
|
-
</header>
|
|
58
|
-
</div>
|
|
59
|
-
`;
|
|
60
|
-
};
|
|
61
|
-
|
package/src/lib/banner/banner.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import {applyMixins, FoundationElement} from '@microsoft/fast-foundation';
|
|
2
|
-
import {attr} from '@microsoft/fast-element';
|
|
3
|
-
import {Connotation} from '../enums';
|
|
4
|
-
import {AffixIcon} from '../../shared/patterns/affix';
|
|
5
|
-
|
|
6
|
-
export type BannerConnotation =
|
|
7
|
-
Connotation.Info |
|
|
8
|
-
Connotation.Announcement |
|
|
9
|
-
Connotation.Success |
|
|
10
|
-
Connotation.Warning |
|
|
11
|
-
Connotation.Alert;
|
|
12
|
-
|
|
13
|
-
const connotationIconMap = new Map([
|
|
14
|
-
[Connotation.Info, 'info-solid'],
|
|
15
|
-
[Connotation.Announcement, 'megaphone-solid'],
|
|
16
|
-
[Connotation.Success, 'check-circle-solid'],
|
|
17
|
-
[Connotation.Warning, 'warning-solid'],
|
|
18
|
-
[Connotation.Alert, 'error-solid']
|
|
19
|
-
]);
|
|
20
|
-
|
|
21
|
-
const defaultConnotation =
|
|
22
|
-
(connotation: Connotation | undefined = Connotation.Info) => connotationIconMap.get(connotation) as Connotation;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Base class for banner
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export class Banner extends FoundationElement {
|
|
30
|
-
@attr({attribute: 'action-href'}) actionHref: string | undefined;
|
|
31
|
-
@attr({attribute: 'action-text'}) actionText: string | undefined;
|
|
32
|
-
@attr({mode: 'boolean'}) removable = false;
|
|
33
|
-
@attr({attribute: 'aria-live'}) override ariaLive: any;
|
|
34
|
-
@attr() role: string | undefined;
|
|
35
|
-
@attr() text: string | undefined;
|
|
36
|
-
@attr() connotation: BannerConnotation | undefined;
|
|
37
|
-
|
|
38
|
-
get conditionedIcon() {
|
|
39
|
-
return this.icon ?? defaultConnotation(this.connotation);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
override connectedCallback() {
|
|
43
|
-
super.connectedCallback();
|
|
44
|
-
this.addEventListener('keydown', this.#closeOnKeyDown);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
override disconnectedCallback() {
|
|
48
|
-
super.disconnectedCallback();
|
|
49
|
-
this.removeEventListener('keydown', this.#closeOnKeyDown);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
override remove(): void {
|
|
53
|
-
this.$emit('vwc-banner:removing');
|
|
54
|
-
const banner = this.shadowRoot && this.shadowRoot.querySelector('.banner');
|
|
55
|
-
if (banner) {
|
|
56
|
-
banner.classList.add('removing');
|
|
57
|
-
banner.addEventListener('transitionend', this.#handleRemoveEnd);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
#handleRemoveEnd = () => {
|
|
62
|
-
this.$emit('vwc-banner:removed');
|
|
63
|
-
this.parentElement && this.parentElement.removeChild(this);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
#closeOnKeyDown = (e: KeyboardEvent) => {
|
|
67
|
-
if (e.key !== 'Escape' || !this.removable) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
this.remove();
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
applyMixins(Banner, AffixIcon);
|
|
75
|
-
|
|
76
|
-
export interface Banner extends AffixIcon {
|
|
77
|
-
}
|
package/src/lib/banner/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
-
import { designSystem } from '../../shared/design-system';
|
|
3
|
-
import styles from './banner.scss';
|
|
4
|
-
|
|
5
|
-
import { Banner } from './banner';
|
|
6
|
-
import { BannerTemplate as template } from './banner.template';
|
|
7
|
-
|
|
8
|
-
export const vividBanner = Banner.compose<FoundationElementDefinition>({
|
|
9
|
-
baseName: 'banner',
|
|
10
|
-
template: template as any,
|
|
11
|
-
styles,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
designSystem.register(vividBanner());
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import { expect, test } from '@playwright/test';
|
|
3
|
-
import type { Page } from '@playwright/test';
|
|
4
|
-
import {
|
|
5
|
-
extractHTMLBlocksFromReadme,
|
|
6
|
-
loadComponents,
|
|
7
|
-
loadTemplate,
|
|
8
|
-
} from '../../visual-tests/visual-tests-utils.ts';
|
|
9
|
-
|
|
10
|
-
const components = ['banner'];
|
|
11
|
-
|
|
12
|
-
test('should show the component', async ({ page }: { page: Page }) => {
|
|
13
|
-
const template = extractHTMLBlocksFromReadme(
|
|
14
|
-
path.join(new URL('.', import.meta.url).pathname, 'README.md')
|
|
15
|
-
).reduce(
|
|
16
|
-
(htmlString: string, block: string) =>
|
|
17
|
-
`${htmlString} <div style="margin: 5px;">${block}</div>`,
|
|
18
|
-
''
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
await loadComponents({
|
|
22
|
-
page,
|
|
23
|
-
components,
|
|
24
|
-
});
|
|
25
|
-
await loadTemplate({
|
|
26
|
-
page,
|
|
27
|
-
template,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const testWrapper = await page.$('#wrapper');
|
|
31
|
-
|
|
32
|
-
await page.waitForLoadState('networkidle');
|
|
33
|
-
|
|
34
|
-
expect(await testWrapper?.screenshot()).toMatchSnapshot(
|
|
35
|
-
'./snapshots/banner.png'
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('should remove the component when clicking on remove button', async ({ page }: { page: Page }) => {
|
|
40
|
-
const template = `
|
|
41
|
-
<vwc-banner removable icon="home" text="ET Phone!"></vwc-banner>
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
await loadComponents({
|
|
45
|
-
page,
|
|
46
|
-
components,
|
|
47
|
-
});
|
|
48
|
-
await loadTemplate({
|
|
49
|
-
page,
|
|
50
|
-
template,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
await page.waitForLoadState('networkidle');
|
|
54
|
-
|
|
55
|
-
const removeButton = await page.locator('.dismiss-button');
|
|
56
|
-
const element = await page.locator('vwc-banner');
|
|
57
|
-
|
|
58
|
-
await removeButton.click();
|
|
59
|
-
|
|
60
|
-
await element.waitFor({state: 'detached'});
|
|
61
|
-
|
|
62
|
-
expect(await element.count()).toEqual(0);
|
|
63
|
-
|
|
64
|
-
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# breadcrumb
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<script type="module">import '@vonage/vivid/breadcrumb-item';</script>
|
|
5
|
-
<script type="module">import '@vonage/vivid/breadcrumb';</script>
|
|
6
|
-
```
|
|
7
|
-
|
|
8
|
-
## Common Usage
|
|
9
|
-
```html preview
|
|
10
|
-
<vwc-breadcrumb>
|
|
11
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
12
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
13
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
14
|
-
<vwc-breadcrumb-item text="breadcrumb"></vwc-breadcrumb-item>
|
|
15
|
-
</vwc-breadcrumb>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Multiple hidden crumbs
|
|
19
|
-
```html preview
|
|
20
|
-
<vwc-breadcrumb>
|
|
21
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
22
|
-
<vwc-breadcrumb-item text="..."></vwc-breadcrumb-item>
|
|
23
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
24
|
-
</vwc-breadcrumb>
|
|
25
|
-
```
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {elementUpdated, fixture} from '@vivid-nx/shared';
|
|
2
|
-
import type {BreadcrumbItem} from '../breadcrumb-item/breadcrumb-item';
|
|
3
|
-
import { Breadcrumb } from './breadcrumb';
|
|
4
|
-
import '../breadcrumb-item';
|
|
5
|
-
import '.';
|
|
6
|
-
|
|
7
|
-
const COMPONENT_TAG = 'vwc-breadcrumb';
|
|
8
|
-
|
|
9
|
-
describe('vwc-breadcrumb', () => {
|
|
10
|
-
const breadcrumbItemsTemplate = `
|
|
11
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
12
|
-
<vwc-breadcrumb-item text="..."></vwc-breadcrumb-item>
|
|
13
|
-
<vwc-breadcrumb-item href="#" text="breadcrumb"></vwc-breadcrumb-item>
|
|
14
|
-
<vwc-breadcrumb-item text="breadcrumb"></vwc-breadcrumb-item>
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
let element: Breadcrumb;
|
|
18
|
-
|
|
19
|
-
beforeEach(async () => {
|
|
20
|
-
element = (await fixture(
|
|
21
|
-
`<${COMPONENT_TAG}>${breadcrumbItemsTemplate}</${COMPONENT_TAG}>`
|
|
22
|
-
)) as Breadcrumb;
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('basic', () => {
|
|
26
|
-
it('should be initialized as a vwc-breadcrumb', async () => {
|
|
27
|
-
expect(element).toBeInstanceOf(Breadcrumb);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should set separator true for all except the last item', function () {
|
|
32
|
-
const itemElements = element.querySelectorAll('vwc-breadcrumb-item') as unknown as BreadcrumbItem[];
|
|
33
|
-
|
|
34
|
-
expect(itemElements[0].separator).toEqual(true);
|
|
35
|
-
expect(itemElements[1].separator).toEqual(true);
|
|
36
|
-
expect(itemElements[2].separator).toEqual(true);
|
|
37
|
-
expect(itemElements[3].separator).toEqual(false);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('aria-current', function () {
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
function removeAElementFromBreadcrumbItem() {
|
|
45
|
-
newItem.shadowRoot?.querySelector('a')
|
|
46
|
-
?.remove();
|
|
47
|
-
}
|
|
48
|
-
let newItem: BreadcrumbItem;
|
|
49
|
-
|
|
50
|
-
beforeEach(async function () {
|
|
51
|
-
newItem = document.createElement('vwc-breadcrumb-item') as BreadcrumbItem;
|
|
52
|
-
newItem.href = '#';
|
|
53
|
-
newItem.text = 'breadcrumb';
|
|
54
|
-
element.appendChild(newItem);
|
|
55
|
-
await elementUpdated(element);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('should set aria-current to last node internal a element if last node is href', async function () {
|
|
59
|
-
const ariaCurrent = newItem.shadowRoot?.querySelector('a')?.getAttribute('aria-current');
|
|
60
|
-
expect(ariaCurrent).toEqual('page');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should set aria-current to last node if last node is href and doesnt have internal a element', async function () {
|
|
64
|
-
removeAElementFromBreadcrumbItem();
|
|
65
|
-
element.slottedBreadcrumbItemsChanged();
|
|
66
|
-
|
|
67
|
-
expect(newItem.ariaCurrent).toEqual('page');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('should not set aria-current to last node if last node is not href', async function () {
|
|
71
|
-
removeAElementFromBreadcrumbItem();
|
|
72
|
-
newItem.removeAttribute('href');
|
|
73
|
-
const ariaCurrent = newItem.getAttribute('aria-current');
|
|
74
|
-
expect(ariaCurrent).toEqual(null);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
});
|