@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,265 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ADD_TEMPLATE_TO_FIXTURE,
|
|
3
|
-
elementUpdated,
|
|
4
|
-
fixture,
|
|
5
|
-
getControlElement
|
|
6
|
-
} from '@vivid-nx/shared';
|
|
7
|
-
import * as floatingUI from '@floating-ui/dom';
|
|
8
|
-
import type { Button } from '../button/button';
|
|
9
|
-
import { Popup } from './popup';
|
|
10
|
-
import '.';
|
|
11
|
-
|
|
12
|
-
const COMPONENT_TAG = 'vwc-popup';
|
|
13
|
-
|
|
14
|
-
describe('vwc-popup', () => {
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
async function setupPopupToOpenWithAnchor() {
|
|
19
|
-
const anchor = await setAnchor();
|
|
20
|
-
element.anchor = 'anchor';
|
|
21
|
-
await elementUpdated(element);
|
|
22
|
-
element.open = true;
|
|
23
|
-
return anchor;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let element: Popup;
|
|
27
|
-
|
|
28
|
-
beforeEach(async () => {
|
|
29
|
-
element = await fixture(`<${COMPONENT_TAG}></${COMPONENT_TAG}>`) as Popup;
|
|
30
|
-
global.ResizeObserver = jest.fn()
|
|
31
|
-
.mockImplementation(() => ({
|
|
32
|
-
observe: jest.fn(),
|
|
33
|
-
unobserve: jest.fn(),
|
|
34
|
-
disconnect: jest.fn()
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
afterEach(function () {
|
|
39
|
-
jest.clearAllMocks();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('clean observable', () => {
|
|
43
|
-
it('should clean observable on disconnectedCallback', async function () {
|
|
44
|
-
const cleanupMock = jest.fn();
|
|
45
|
-
jest.spyOn(floatingUI, 'autoUpdate').mockReturnValue(cleanupMock);
|
|
46
|
-
await setupPopupToOpenWithAnchor();
|
|
47
|
-
element.disconnectedCallback();
|
|
48
|
-
expect(cleanupMock).toHaveBeenCalled();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should clean observable when anchor is undefined', async function () {
|
|
52
|
-
const cleanupMock = jest.fn();
|
|
53
|
-
jest.spyOn(floatingUI, 'autoUpdate').mockReturnValue(cleanupMock);
|
|
54
|
-
await setupPopupToOpenWithAnchor();
|
|
55
|
-
element.anchor = '';
|
|
56
|
-
await elementUpdated(element);
|
|
57
|
-
expect(cleanupMock).toHaveBeenCalled();
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('viewport visibility transition', function () {
|
|
62
|
-
|
|
63
|
-
const computePositionResult = {
|
|
64
|
-
'x': -15,
|
|
65
|
-
'y': 0,
|
|
66
|
-
'placement': 'left',
|
|
67
|
-
'strategy': 'fixed',
|
|
68
|
-
'middlewareData': {
|
|
69
|
-
'flip': {},
|
|
70
|
-
'hide': {
|
|
71
|
-
'referenceHiddenOffsets': {
|
|
72
|
-
'top': 0,
|
|
73
|
-
'right': 0,
|
|
74
|
-
'bottom': 0,
|
|
75
|
-
'left': 0
|
|
76
|
-
},
|
|
77
|
-
'referenceHidden': true
|
|
78
|
-
},
|
|
79
|
-
'inline': {},
|
|
80
|
-
'arrow': {
|
|
81
|
-
'y': 0,
|
|
82
|
-
'centerOffset': 0
|
|
83
|
-
},
|
|
84
|
-
'offset': {
|
|
85
|
-
'x': -12,
|
|
86
|
-
'y': 0
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
beforeEach(function () {
|
|
92
|
-
jest.spyOn(floatingUI, 'computePosition');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
afterEach(function () {
|
|
96
|
-
(floatingUI.computePosition as jest.MockedFunction<any>).mockRestore();
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @param hidden
|
|
101
|
-
*/
|
|
102
|
-
async function makePopupHidden(hidden = true) {
|
|
103
|
-
computePositionResult.middlewareData.hide.referenceHidden = hidden;
|
|
104
|
-
(floatingUI.computePosition as jest.MockedFunction<any>).mockReturnValue(Promise.resolve(computePositionResult));
|
|
105
|
-
await element.updatePosition();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
it('should be hidden when not in viewport', async function () {
|
|
109
|
-
await setupPopupToOpenWithAnchor();
|
|
110
|
-
await makePopupHidden(true);
|
|
111
|
-
|
|
112
|
-
expect(element.popupEl.style.visibility)
|
|
113
|
-
.toEqual('hidden');
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('should be hidden when not in viewport', async function () {
|
|
117
|
-
await setupPopupToOpenWithAnchor();
|
|
118
|
-
await makePopupHidden(false);
|
|
119
|
-
expect(element.popupEl.style.visibility)
|
|
120
|
-
.toEqual('visible');
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe('basic', () => {
|
|
125
|
-
it('initializes as a vwc-popup', async () => {
|
|
126
|
-
expect(element)
|
|
127
|
-
.toBeInstanceOf(Popup);
|
|
128
|
-
expect(element.open)
|
|
129
|
-
.toBeFalsy();
|
|
130
|
-
expect(element.arrow)
|
|
131
|
-
.toBeFalsy();
|
|
132
|
-
expect(element.dismissible)
|
|
133
|
-
.toBeFalsy();
|
|
134
|
-
expect(element.anchor)
|
|
135
|
-
.toBeUndefined();
|
|
136
|
-
expect(element.corner)
|
|
137
|
-
.toEqual('left');
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
describe('show', () => {
|
|
142
|
-
it('should set "open" to true', async () => {
|
|
143
|
-
await setAnchor();
|
|
144
|
-
element.anchor = 'anchor';
|
|
145
|
-
await elementUpdated(element);
|
|
146
|
-
|
|
147
|
-
element.open = true;
|
|
148
|
-
element.updatePosition();
|
|
149
|
-
await elementUpdated(element);
|
|
150
|
-
|
|
151
|
-
expect(element.open)
|
|
152
|
-
.toEqual(true);
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
describe('hide', () => {
|
|
157
|
-
it('should set "open" to false', async () => {
|
|
158
|
-
element.open = true;
|
|
159
|
-
|
|
160
|
-
element.open = false;
|
|
161
|
-
element.updatePosition();
|
|
162
|
-
await elementUpdated(element);
|
|
163
|
-
|
|
164
|
-
expect(element.open)
|
|
165
|
-
.toEqual(false);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
describe('render arrow', () => {
|
|
170
|
-
it('should remove the arrow class on the container if arrow is false', async () => {
|
|
171
|
-
expect(element.shadowRoot?.querySelector('.arrow'))
|
|
172
|
-
.toBeNull();
|
|
173
|
-
});
|
|
174
|
-
it('should set the arrow class on the container if arrow is true', async () => {
|
|
175
|
-
element.arrow = true;
|
|
176
|
-
element.open = true;
|
|
177
|
-
await elementUpdated(element);
|
|
178
|
-
|
|
179
|
-
await setAnchor();
|
|
180
|
-
element.anchor = 'anchor';
|
|
181
|
-
await elementUpdated(element);
|
|
182
|
-
|
|
183
|
-
element.arrowEl = element.shadowRoot?.querySelector('.arrow') as HTMLElement;
|
|
184
|
-
element.updatePosition();
|
|
185
|
-
await elementUpdated(element);
|
|
186
|
-
|
|
187
|
-
expect(element.shadowRoot?.querySelector('.arrow'))
|
|
188
|
-
.not
|
|
189
|
-
.toBeNull();
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
describe('render dismiss', () => {
|
|
194
|
-
it('should remove the dismiss class on the container if dismissible is false', async () => {
|
|
195
|
-
expect(element.shadowRoot?.querySelector('.dismissible'))
|
|
196
|
-
.toBeNull();
|
|
197
|
-
});
|
|
198
|
-
it('should set the dismiss class on the container if dismissible is true', async () => {
|
|
199
|
-
element.dismissible = true;
|
|
200
|
-
|
|
201
|
-
await elementUpdated(element);
|
|
202
|
-
expect(element.shadowRoot?.querySelector('.dismissible'))
|
|
203
|
-
.not
|
|
204
|
-
.toBeNull();
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
describe('handle dismiss', () => {
|
|
209
|
-
it('should hide when dismiss button is clicked', async () => {
|
|
210
|
-
await setAnchor();
|
|
211
|
-
element.anchor = 'anchor';
|
|
212
|
-
element.dismissible = true;
|
|
213
|
-
await elementUpdated(element);
|
|
214
|
-
|
|
215
|
-
element.open = true;
|
|
216
|
-
expect(element.open)
|
|
217
|
-
.toEqual(true);
|
|
218
|
-
|
|
219
|
-
await elementUpdated(element);
|
|
220
|
-
const dismissButton = element.shadowRoot?.querySelector('vwc-button');
|
|
221
|
-
(dismissButton as HTMLElement).click();
|
|
222
|
-
await elementUpdated(element);
|
|
223
|
-
|
|
224
|
-
expect(element.open)
|
|
225
|
-
.toEqual(false);
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
describe('alternate', () => {
|
|
230
|
-
it('should set to alternate', async () => {
|
|
231
|
-
expect(getControlElement(element)
|
|
232
|
-
.getAttribute('part'))
|
|
233
|
-
.toEqual('');
|
|
234
|
-
element.alternate = true;
|
|
235
|
-
|
|
236
|
-
await elementUpdated(element);
|
|
237
|
-
expect(getControlElement(element)
|
|
238
|
-
.getAttribute('part'))
|
|
239
|
-
.toEqual('vvd-theme-alternate');
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
describe('accessibility', () => {
|
|
244
|
-
it('should set aria-hidden', async () => {
|
|
245
|
-
expect(getControlElement(element)
|
|
246
|
-
.getAttribute('aria-hidden'))
|
|
247
|
-
.toEqual('true');
|
|
248
|
-
element.open = true;
|
|
249
|
-
|
|
250
|
-
await elementUpdated(element);
|
|
251
|
-
expect(getControlElement(element)
|
|
252
|
-
.getAttribute('aria-hidden'))
|
|
253
|
-
.toEqual('false');
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
*
|
|
259
|
-
*/
|
|
260
|
-
async function setAnchor() {
|
|
261
|
-
const anchorEl = await fixture('<vwc-button id="anchor"></vwc-button>', ADD_TEMPLATE_TO_FIXTURE) as Button;
|
|
262
|
-
await elementUpdated(anchorEl);
|
|
263
|
-
return anchorEl;
|
|
264
|
-
}
|
|
265
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { html, ref, when } from '@microsoft/fast-element';
|
|
2
|
-
import { classNames } from '@microsoft/fast-web-utilities';
|
|
3
|
-
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
4
|
-
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
5
|
-
import type { Popup } from './popup';
|
|
6
|
-
|
|
7
|
-
const getClasses = ({
|
|
8
|
-
open, dismissible, alternate
|
|
9
|
-
}: Popup) => classNames(
|
|
10
|
-
'control',
|
|
11
|
-
['open', Boolean(open)],
|
|
12
|
-
['dismissible', Boolean(dismissible)],
|
|
13
|
-
['alternate', Boolean(alternate)]
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The template for the {@link @vonage/vivid#Popup} component.
|
|
18
|
-
*
|
|
19
|
-
* @returns {ViewTemplate<Popup>} A template capable of creating HTMLView instances or rendering directly to DOM.
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export const popupTemplate: (
|
|
23
|
-
context: ElementDefinitionContext,
|
|
24
|
-
definition: FoundationElementDefinition
|
|
25
|
-
) => ViewTemplate<Popup> = () => html`
|
|
26
|
-
<vwc-elevation>
|
|
27
|
-
<!--the popup-wrapper is needed for alternating the inside of the popup nd not its shadow-->
|
|
28
|
-
<div class="popup-wrapper" ${ref('popupEl')}>
|
|
29
|
-
<div class="${getClasses}" aria-hidden="${(x) => x.open ? 'false' : 'true'}"
|
|
30
|
-
part="${(x) => x.alternate ? 'vvd-theme-alternate' : ''}">
|
|
31
|
-
<div class="popup-content">
|
|
32
|
-
<slot></slot>
|
|
33
|
-
${when(x => x.dismissible,
|
|
34
|
-
html<Popup>`<vwc-button size="base-small" @click="${x => (x.open = false)}"
|
|
35
|
-
class="dismissible" icon="close-small-solid" shape="pill"></vwc-button>`)}
|
|
36
|
-
</div>
|
|
37
|
-
${when(x => x.arrow,
|
|
38
|
-
html<Popup>`<div class="arrow" ${ref('arrowEl')}></div>`)}
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</vwc-elevation>`;
|
package/src/lib/popup/popup.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { attr } from '@microsoft/fast-element';
|
|
2
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
-
import { arrow, autoUpdate, computePosition, flip, hide, inline, offset, Strategy } from '@floating-ui/dom';
|
|
4
|
-
import type { Placement } from '@floating-ui/dom';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Base class for popup
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export class Popup extends FoundationElement {
|
|
12
|
-
get #arrowPosition(): any { return { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }; }
|
|
13
|
-
get #padding(): number { return 0; }
|
|
14
|
-
get #distance(): number { return 12; }
|
|
15
|
-
get #strategy(): Strategy { return 'fixed'; }
|
|
16
|
-
get #middleware(): Array<any> {
|
|
17
|
-
const middleware = [flip(), hide(), inline()];
|
|
18
|
-
if (this.arrow) { middleware.push(arrow({ element: this.arrowEl, padding: this.#padding }), offset(this.#distance)); }
|
|
19
|
-
return middleware;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#cleanup?: () => void; // cleans the autoupdate
|
|
23
|
-
|
|
24
|
-
#anchorEl: Element | null | undefined;
|
|
25
|
-
|
|
26
|
-
popupEl!: HTMLElement;
|
|
27
|
-
|
|
28
|
-
arrowEl!: HTMLElement;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* indicates whether the popup is open
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
* HTML Attribute: open
|
|
35
|
-
*/
|
|
36
|
-
@attr({
|
|
37
|
-
mode: 'boolean',
|
|
38
|
-
}) open = false;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* adds close button to the popup
|
|
42
|
-
*
|
|
43
|
-
* @public
|
|
44
|
-
* HTML Attribute: dismissible
|
|
45
|
-
*/
|
|
46
|
-
@attr({
|
|
47
|
-
mode: 'boolean',
|
|
48
|
-
}) dismissible = false;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* adds small triangle to indicate the trigger element
|
|
52
|
-
*
|
|
53
|
-
* @public
|
|
54
|
-
* HTML Attribute: arrow
|
|
55
|
-
*/
|
|
56
|
-
@attr({
|
|
57
|
-
mode: 'boolean',
|
|
58
|
-
}) arrow = false;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* set the color-scheme to dark
|
|
62
|
-
*
|
|
63
|
-
* @public
|
|
64
|
-
* HTML Attribute: alternate
|
|
65
|
-
*/
|
|
66
|
-
@attr({
|
|
67
|
-
mode: 'boolean',
|
|
68
|
-
}) alternate = false;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* the placement of the popup
|
|
72
|
-
*
|
|
73
|
-
* @public
|
|
74
|
-
* HTML Attribute: corner
|
|
75
|
-
*/
|
|
76
|
-
@attr({ mode: 'fromView' }) corner?: Placement = 'left';
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* ID reference to element in the popup’s owner document.
|
|
80
|
-
*
|
|
81
|
-
* @public
|
|
82
|
-
* HTML Attribute: anchor
|
|
83
|
-
*/
|
|
84
|
-
@attr anchor!: string;
|
|
85
|
-
|
|
86
|
-
constructor() {
|
|
87
|
-
super();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
override disconnectedCallback(): void {
|
|
91
|
-
super.disconnectedCallback();
|
|
92
|
-
this.#cleanup?.();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
override attributeChangedCallback(name: string, oldValue: string, newValue: string): void {
|
|
96
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
97
|
-
switch (name) {
|
|
98
|
-
case 'anchor': {
|
|
99
|
-
this.#anchorEl = this.#getAnchorById();
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (this.#anchorEl && this.popupEl) {
|
|
104
|
-
this.#cleanup = autoUpdate(this.#anchorEl, this.popupEl, () => this.updatePosition());
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.#cleanup?.();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Updates popup's position
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
async updatePosition() {
|
|
117
|
-
if (!this.open || !this.#anchorEl) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const positionData = await computePosition(this.#anchorEl, this.popupEl, {
|
|
122
|
-
placement: this.corner,
|
|
123
|
-
strategy: this.#strategy,
|
|
124
|
-
middleware: this.#middleware
|
|
125
|
-
});
|
|
126
|
-
this.#assignPopupPosition(positionData);
|
|
127
|
-
if (this.arrow) { this.#assignArrowPosition(positionData); }
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
#assignPopupPosition(data: any): void {
|
|
131
|
-
const { x: popupX, y: popupY } = data;
|
|
132
|
-
const { referenceHidden } = data.middlewareData.hide;
|
|
133
|
-
Object.assign(this.popupEl.style, {
|
|
134
|
-
left: `${popupX}px`,
|
|
135
|
-
top: `${popupY}px`,
|
|
136
|
-
visibility: referenceHidden ? 'hidden' : 'visible',
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
#assignArrowPosition(data: any): void {
|
|
141
|
-
const { x: arrowX, y: arrowY } = data.middlewareData.arrow;
|
|
142
|
-
const side: string = this.#arrowPosition[data.placement.split('-')[0]];
|
|
143
|
-
Object.assign(this.arrowEl.style, {
|
|
144
|
-
left: `${arrowX}px`,
|
|
145
|
-
top: `${arrowY}px`,
|
|
146
|
-
right: '',
|
|
147
|
-
bottom: '',
|
|
148
|
-
[side]: '-4px',
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Gets the anchor element by id
|
|
154
|
-
*/
|
|
155
|
-
#getAnchorById(): HTMLElement | null {
|
|
156
|
-
return document.getElementById(this.anchor);
|
|
157
|
-
}
|
|
158
|
-
}
|
package/src/lib/popup/ui.test.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { expect, test } from '@playwright/test';
|
|
2
|
-
import type { Page } from '@playwright/test';
|
|
3
|
-
import {
|
|
4
|
-
loadComponents,
|
|
5
|
-
loadTemplate
|
|
6
|
-
} from '../../visual-tests/visual-tests-utils.ts';
|
|
7
|
-
|
|
8
|
-
const components = ['popup', 'text', 'icon', 'button'];
|
|
9
|
-
test('should show the component', async ({ page }: { page: Page }) => {
|
|
10
|
-
const template =`
|
|
11
|
-
<style>
|
|
12
|
-
.contentWrapper{
|
|
13
|
-
width: 70px;
|
|
14
|
-
padding: 0.25rem;
|
|
15
|
-
}
|
|
16
|
-
.square {
|
|
17
|
-
height: 150px;
|
|
18
|
-
width: 400px;
|
|
19
|
-
}
|
|
20
|
-
.wrapper{
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 300px;
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
background-color: grey;
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
|
-
<div class="wrapper">
|
|
31
|
-
<div id="anchor5" class="square"></div>
|
|
32
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="right-end" alternate>
|
|
33
|
-
<div class="contentWrapper">
|
|
34
|
-
<vwc-text tight font-face="body-2">right-end</vwc-text>
|
|
35
|
-
</div>
|
|
36
|
-
</vwc-popup>
|
|
37
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="right" arrow>
|
|
38
|
-
<div class="contentWrapper">
|
|
39
|
-
<vwc-text tight font-face="body-2">right</vwc-text>
|
|
40
|
-
</div>
|
|
41
|
-
</vwc-popup>
|
|
42
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="right-start" dismissible>
|
|
43
|
-
<div class="contentWrapper">
|
|
44
|
-
<vwc-text tight font-face="body-2">right-start</vwc-text>
|
|
45
|
-
</div>
|
|
46
|
-
</vwc-popup>
|
|
47
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="left-end" alternate>
|
|
48
|
-
<div class="contentWrapper">
|
|
49
|
-
<vwc-text tight font-face="body-2">left-end</vwc-text>
|
|
50
|
-
</div>
|
|
51
|
-
</vwc-popup>
|
|
52
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="left" arrow>
|
|
53
|
-
<div class="contentWrapper">
|
|
54
|
-
<vwc-text tight font-face="body-2">left</vwc-text>
|
|
55
|
-
</div>
|
|
56
|
-
</vwc-popup>
|
|
57
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="left-start" dismissible>
|
|
58
|
-
<div class="contentWrapper">
|
|
59
|
-
<vwc-text tight font-face="body-2">left-start</vwc-text>
|
|
60
|
-
</div>
|
|
61
|
-
</vwc-popup>
|
|
62
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="top-end" alternate>
|
|
63
|
-
<div class="contentWrapper">
|
|
64
|
-
<vwc-text tight font-face="body-2">top-end</vwc-text>
|
|
65
|
-
</div>
|
|
66
|
-
</vwc-popup>
|
|
67
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="top" arrow>
|
|
68
|
-
<div class="contentWrapper">
|
|
69
|
-
<vwc-text tight font-face="body-2">top</vwc-text>
|
|
70
|
-
</div>
|
|
71
|
-
</vwc-popup>
|
|
72
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="top-start" dismissible>
|
|
73
|
-
<div class="contentWrapper">
|
|
74
|
-
<vwc-text tight font-face="body-2">top-start</vwc-text>
|
|
75
|
-
</div>
|
|
76
|
-
</vwc-popup>
|
|
77
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="bottom-end" alternate>
|
|
78
|
-
<div class="contentWrapper">
|
|
79
|
-
<vwc-text tight font-face="body-2">bottom-end</vwc-text>
|
|
80
|
-
</div>
|
|
81
|
-
</vwc-popup>
|
|
82
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="bottom" arrow>
|
|
83
|
-
<div class="contentWrapper">
|
|
84
|
-
<vwc-text tight font-face="body-2">bottom</vwc-text>
|
|
85
|
-
</div>
|
|
86
|
-
</vwc-popup>
|
|
87
|
-
<vwc-popup id="popup" anchor="anchor5" open corner="bottom-start" dismissible>
|
|
88
|
-
<div class="contentWrapper">
|
|
89
|
-
<vwc-text tight font-face="body-2">bottom-start</vwc-text>
|
|
90
|
-
</div>
|
|
91
|
-
</vwc-popup>
|
|
92
|
-
</div>
|
|
93
|
-
`;
|
|
94
|
-
|
|
95
|
-
await loadComponents({
|
|
96
|
-
page,
|
|
97
|
-
components,
|
|
98
|
-
});
|
|
99
|
-
await loadTemplate({
|
|
100
|
-
page,
|
|
101
|
-
template,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const testWrapper = await page.$('#wrapper');
|
|
105
|
-
await page.waitForLoadState('networkidle');
|
|
106
|
-
|
|
107
|
-
expect(await testWrapper?.screenshot())
|
|
108
|
-
.toMatchSnapshot(
|
|
109
|
-
'./snapshots/popup.png',
|
|
110
|
-
);
|
|
111
|
-
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# progress
|
|
2
|
-
|
|
3
|
-
Progress is used to display the length of time a process will take or to visualize percentage value (referred to as a determinate state) and to represent an unspecified wait time (referred to as an indeterminate state).
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
<script type="module">import '@vonage/vivid/progress';</script>
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## API
|
|
11
|
-
|
|
12
|
-
### Min/Max
|
|
13
|
-
Use `min`, `max` in order to determine the range of the progress.
|
|
14
|
-
|
|
15
|
-
- Type: `number`
|
|
16
|
-
- Default: `undefined`
|
|
17
|
-
|
|
18
|
-
```html preview
|
|
19
|
-
<vwc-progress min="0" max="50" value="12.5"></vwc-progress>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Value
|
|
23
|
-
Use `value` in order to set the state of the progress. String value will set the state to `indetermintate`.
|
|
24
|
-
|
|
25
|
-
- Type: `number` | `string`
|
|
26
|
-
- Default: `undefined`
|
|
27
|
-
|
|
28
|
-
```html preview
|
|
29
|
-
<vwc-progress min="0" max="50" value="12.5"></vwc-progress>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Paused
|
|
33
|
-
Use the `paused` attribute to show a disabled state of the progress.
|
|
34
|
-
|
|
35
|
-
- Type: `boolean`
|
|
36
|
-
- Default: `false`
|
|
37
|
-
|
|
38
|
-
```html preview
|
|
39
|
-
<h2>Determinate</h2>
|
|
40
|
-
<vwc-progress min="0" max="50" value="25" paused></vwc-progress>
|
|
41
|
-
<br/>
|
|
42
|
-
<br/>
|
|
43
|
-
<h2>Indeterminate</h2>
|
|
44
|
-
<vwc-progress min="0" max="50" value="indeterminate" paused></vwc-progress>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Reverse
|
|
48
|
-
|
|
49
|
-
Use the `reverse` attribute to set the progress from right to left.
|
|
50
|
-
|
|
51
|
-
- Type: `boolean`
|
|
52
|
-
- Default: `false`
|
|
53
|
-
|
|
54
|
-
```html preview
|
|
55
|
-
<vwc-progress min="0" max="50" value="25" reverse></vwc-progress>
|
|
56
|
-
<br/>
|
|
57
|
-
<br/>
|
|
58
|
-
<vwc-progress min="0" max="50" value="indeterminate" reverse></vwc-progress>
|
|
59
|
-
```
|
|
60
|
-
### Connotation
|
|
61
|
-
- Type: `'primary'` | `'cta'` | `'success'` | `'alert'` | `'pacific'`
|
|
62
|
-
- Default: `'primary'`
|
|
63
|
-
|
|
64
|
-
```html preview
|
|
65
|
-
<vwc-progress min="0" max="100" value="25" connotation="primary"></vwc-progress>
|
|
66
|
-
<br/>
|
|
67
|
-
<br/>
|
|
68
|
-
<vwc-progress min="0" max="100" value="25" connotation="cta"></vwc-progress>
|
|
69
|
-
<br/>
|
|
70
|
-
<br/>
|
|
71
|
-
<vwc-progress min="0" max="100" value="25" connotation="success"></vwc-progress>
|
|
72
|
-
<br/>
|
|
73
|
-
<br/>
|
|
74
|
-
<vwc-progress min="0" max="100" value="25" connotation="alert"></vwc-progress>
|
|
75
|
-
<br/>
|
|
76
|
-
<br/>
|
|
77
|
-
<vwc-progress min="0" max="100" value="25" connotation="pacific"></vwc-progress>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Shape
|
|
81
|
-
Use the `shape` attribute in order to set `rounded` and `sharp` borders.
|
|
82
|
-
|
|
83
|
-
- Type: `'rounded'` | `'sharp'`
|
|
84
|
-
- Default: `'rounded'`
|
|
85
|
-
|
|
86
|
-
```html preview
|
|
87
|
-
<vwc-progress min="0" max="50" value="25" shape="rounded"></vwc-progress>
|
|
88
|
-
<br/>
|
|
89
|
-
<br/>
|
|
90
|
-
<vwc-progress min="0" max="50" value="25"></vwc-progress>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Example Usage
|
|
94
|
-
|
|
95
|
-
### Determinate State
|
|
96
|
-
Set the `min`, `max` and `value` in order to show the determinate state.
|
|
97
|
-
|
|
98
|
-
In the example below, we set the value to `12.5` while the range is `0` to `50`. This means, 25% of the progress bar will be filled.
|
|
99
|
-
```html preview
|
|
100
|
-
<vwc-progress min="0" max="50" value="12.5"></vwc-progress>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Indeterminate
|
|
104
|
-
Set `value` to be a non-number value (e.g. `indeterminate`) to show an indeterminate state.
|
|
105
|
-
```html preview
|
|
106
|
-
<vwc-progress min="0" max="50" value="indeterminate"></vwc-progress>
|
|
107
|
-
```
|