@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,66 +0,0 @@
|
|
|
1
|
-
import { html, ref } 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 { affixIconTemplateFactory } from '../../shared/patterns/affix';
|
|
9
|
-
import type { TextAnchor } from './text-anchor';
|
|
10
|
-
|
|
11
|
-
const getClasses = ({text, icon}: TextAnchor) => classNames(
|
|
12
|
-
'control',
|
|
13
|
-
['icon-only', !text && !!icon],
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The template for the {@link @microsoft/fast-foundation#(Anchor:class)} component.
|
|
18
|
-
*
|
|
19
|
-
* @param context
|
|
20
|
-
* @param definition
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export const textAnchorTemplate: (
|
|
24
|
-
context: ElementDefinitionContext,
|
|
25
|
-
definition: FoundationElementDefinition
|
|
26
|
-
) => ViewTemplate<TextAnchor> = (
|
|
27
|
-
context: ElementDefinitionContext,
|
|
28
|
-
) => {
|
|
29
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
30
|
-
|
|
31
|
-
return html`<a
|
|
32
|
-
class="${getClasses}"
|
|
33
|
-
download="${x => x.download}"
|
|
34
|
-
href="${x => x.href}"
|
|
35
|
-
hreflang="${x => x.hreflang}"
|
|
36
|
-
ping="${x => x.ping}"
|
|
37
|
-
referrerpolicy="${x => x.referrerpolicy}"
|
|
38
|
-
rel="${x => x.rel}"
|
|
39
|
-
target="${x => x.target}"
|
|
40
|
-
type="${x => x.type}"
|
|
41
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
42
|
-
aria-busy="${x => x.ariaBusy}"
|
|
43
|
-
aria-controls="${x => x.ariaControls}"
|
|
44
|
-
aria-current="${x => x.ariaCurrent}"
|
|
45
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
46
|
-
aria-details="${x => x.ariaDetails}"
|
|
47
|
-
aria-disabled="${x => x.ariaDisabled}"
|
|
48
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
49
|
-
aria-expanded="${x => x.ariaExpanded}"
|
|
50
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
51
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
52
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
53
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
54
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
55
|
-
aria-label="${x => x.ariaLabel}"
|
|
56
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
57
|
-
aria-live="${x => x.ariaLive}"
|
|
58
|
-
aria-owns="${x => x.ariaOwns}"
|
|
59
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
60
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
61
|
-
${ref('control')}
|
|
62
|
-
>
|
|
63
|
-
${x => affixIconTemplate(x.icon)}
|
|
64
|
-
${x => x.text}
|
|
65
|
-
</a>
|
|
66
|
-
`;};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Anchor, applyMixins } from '@microsoft/fast-foundation';
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import { AffixIcon } from '../../shared/patterns/affix';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base class for text-anchor
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class TextAnchor extends Anchor {
|
|
11
|
-
/**
|
|
12
|
-
* Indicates the text anchor's text.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
* @remarks
|
|
16
|
-
* HTML Attribute: text
|
|
17
|
-
*/
|
|
18
|
-
@attr({ mode: 'fromView' }) text = '';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface TextAnchor extends AffixIcon {}
|
|
22
|
-
applyMixins(TextAnchor, AffixIcon);
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# tooltip
|
|
2
|
-
|
|
3
|
-
A tooltip is a brief, informative message or descriptions or explanations for their paired element. Tooltips in general are less accessible so be sure to follow our accessibility recommendation in the docs.
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
<script type="module">
|
|
7
|
-
import '@vonage/vivid/tooltip';
|
|
8
|
-
</script>
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Anchor
|
|
12
|
-
The tooltip can be placed on interactive controls (things that can be clicked or focusable) such as: button, checkbox, input text.
|
|
13
|
-
The tooltip can't be placed on non-interactive elements such as paragraph or plain div.
|
|
14
|
-
Do not target non-interactive controls as a tooltip's anchor (such as non-focusable / disabled elements).
|
|
15
|
-
|
|
16
|
-
- Type: `string`
|
|
17
|
-
- Default: `undefined`
|
|
18
|
-
|
|
19
|
-
```html preview
|
|
20
|
-
<style>
|
|
21
|
-
.wrapper{
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 120px;
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
<div class="wrapper">
|
|
30
|
-
<vwc-button id="anchor" icon="help-line" shape="pill" aria-describedby="tooltip"></vwc-button>
|
|
31
|
-
<vwc-tooltip id="tooltip" anchor="anchor" text="I'm a tooltip" open></vwc-tooltip>
|
|
32
|
-
</div>
|
|
33
|
-
```
|
|
34
|
-
## Text
|
|
35
|
-
The tooltip is a description and therefor, the tooltip itself can not be interactive. `vwc-tooltip` contains only text.
|
|
36
|
-
|
|
37
|
-
- Type: `string`
|
|
38
|
-
- Default: `''`
|
|
39
|
-
|
|
40
|
-
## Open
|
|
41
|
-
Use the `open` attribute to indicate whether the tooltip is open.
|
|
42
|
-
|
|
43
|
-
- Type: `boolean`
|
|
44
|
-
- Default: `false`
|
|
45
|
-
|
|
46
|
-
```html preview
|
|
47
|
-
<style>
|
|
48
|
-
.wrapper{
|
|
49
|
-
width: 100%;
|
|
50
|
-
height: 120px;
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
}
|
|
55
|
-
vwc-tooltip#tooltip{
|
|
56
|
-
--tooltip-inline-size:200px;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
59
|
-
<div class="wrapper">
|
|
60
|
-
<vwc-button id="button" icon="info-line" shape="pill" aria-describedby="tooltip"></vwc-button>
|
|
61
|
-
<vwc-tooltip id="tooltip" anchor="button" text="Click on the icon to toggle"></vwc-tooltip>
|
|
62
|
-
</div>
|
|
63
|
-
<script>
|
|
64
|
-
button.addEventListener('click', toggleOpen);
|
|
65
|
-
function toggleOpen() {
|
|
66
|
-
tooltip.open = !tooltip.open;
|
|
67
|
-
}
|
|
68
|
-
</script>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Corner
|
|
72
|
-
|
|
73
|
-
Use the `corner` attribute to set the placement of the tooltip around the anchor.
|
|
74
|
-
|
|
75
|
-
- Type: `'top'` | `'top-start'` | `'top-end'` | `'right'` | `'right-start'` | `'right-end'` | `'bottom'` | `'bottom-start'` | `'bottom-end'`| `'left'` | `'left-start'`| `'left-end'`
|
|
76
|
-
- Default: `'left'`
|
|
77
|
-
|
|
78
|
-
```html preview
|
|
79
|
-
<style>
|
|
80
|
-
.wrapper{
|
|
81
|
-
width: 100%;
|
|
82
|
-
height: 220px;
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
justify-content: center;
|
|
86
|
-
}
|
|
87
|
-
vwc-tooltip#tooltip2{
|
|
88
|
-
--tooltip-inline-size:100px;
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
91
|
-
<div class="wrapper">
|
|
92
|
-
<vwc-button id="anchor2" aria-describedby="tooltip2" appearance='outlined' label='This is an anchor'></vwc-button>
|
|
93
|
-
<vwc-tooltip id="tooltip2" anchor="anchor2" open text="right" corner="right">
|
|
94
|
-
</vwc-tooltip>
|
|
95
|
-
<vwc-tooltip id="tooltip2" anchor="anchor2" open text="left" corner="left">
|
|
96
|
-
</vwc-tooltip>
|
|
97
|
-
<vwc-tooltip id="tooltip2" anchor="anchor2" open text="top" corner="top">
|
|
98
|
-
</vwc-tooltip>
|
|
99
|
-
<vwc-tooltip id="tooltip2" anchor="anchor2" open text="bottom" corner="bottom">
|
|
100
|
-
</vwc-tooltip>
|
|
101
|
-
</div>
|
|
102
|
-
```
|
|
103
|
-
## Usage inside text
|
|
104
|
-
```html preview
|
|
105
|
-
<div>
|
|
106
|
-
<vwc-text font-face="body-1" tight>Text with tooltip - press the question mark<vwc-button id="button3" icon="help-line" shape="pill" aria-describedby="tooltip3"></vwc-button>more text after tooltip.</vwc-text>
|
|
107
|
-
<vwc-tooltip id="tooltip3" anchor="button3" corner="bottom-end" text="I'm the tooltip content"></vwc-tooltip>
|
|
108
|
-
</div>
|
|
109
|
-
<script>
|
|
110
|
-
button3.addEventListener('click', toggle);
|
|
111
|
-
function toggle() {
|
|
112
|
-
tooltip3.open = !tooltip3.open;
|
|
113
|
-
}
|
|
114
|
-
</script>
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Accessibility
|
|
118
|
-
Be sure to add `aria-describedby="vwc-tooltip's ID"` on the tooltip trigger element for screen readers readability.
|
|
119
|
-
|
|
120
|
-
```js
|
|
121
|
-
<vwc-button id="anchor" aria-describedby="tooltip"></vwc-button>
|
|
122
|
-
<vwc-tooltip id="tooltip" anchor="anchor"></vwc-tooltip>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## CSS Custom Properties
|
|
126
|
-
|
|
127
|
-
### Inline-size
|
|
128
|
-
- `--tooltip-inline-size`
|
|
129
|
-
- Type: `Number`
|
|
130
|
-
- Default: `240px`
|
|
131
|
-
|
|
132
|
-
Controls the tooltip width.
|
package/src/lib/tooltip/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import '../popup';
|
|
2
|
-
|
|
3
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
4
|
-
import { designSystem } from '../../shared/design-system';
|
|
5
|
-
import styles from './tooltip.scss';
|
|
6
|
-
|
|
7
|
-
import { Tooltip } from './tooltip';
|
|
8
|
-
import { TooltipTemplate as template } from './tooltip.template';
|
|
9
|
-
|
|
10
|
-
export const vividTooltip = Tooltip.compose<FoundationElementDefinition>({
|
|
11
|
-
baseName: 'tooltip',
|
|
12
|
-
template: template as any,
|
|
13
|
-
styles,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
designSystem.register(vividTooltip());
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$tooltip-inline-size: --tooltip-inline-size;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
@use 'partials/variables' as variables;
|
|
2
|
-
@use '../../../../../node_modules/@vonage/vivid-tokens/dist/sass/themes/consts' as theme-consts;
|
|
3
|
-
@use '../../../../shared/src/lib/sass/mixins/typography' as typography;
|
|
4
|
-
|
|
5
|
-
.control {
|
|
6
|
-
pointer-events: none;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.tooltip {
|
|
10
|
-
width: var(#{variables.$tooltip-inline-size}, 240px);
|
|
11
|
-
|
|
12
|
-
&-text {
|
|
13
|
-
@include typography.typography-cat-shorthand('body-2-bold');
|
|
14
|
-
|
|
15
|
-
padding: 8px 12px;
|
|
16
|
-
color: var(#{theme-consts.$vvd-color-on-canvas});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { ADD_TEMPLATE_TO_FIXTURE, elementUpdated, fixture } from '@vivid-nx/shared';
|
|
2
|
-
import type { Button } from '../button/button';
|
|
3
|
-
import { Tooltip } from './tooltip';
|
|
4
|
-
import '.';
|
|
5
|
-
|
|
6
|
-
const COMPONENT_TAG = 'vwc-tooltip';
|
|
7
|
-
|
|
8
|
-
describe('vwc-tooltip', () => {
|
|
9
|
-
let element: Tooltip;
|
|
10
|
-
|
|
11
|
-
global.ResizeObserver = jest.fn()
|
|
12
|
-
.mockImplementation(() => ({
|
|
13
|
-
observe: jest.fn(),
|
|
14
|
-
unobserve: jest.fn(),
|
|
15
|
-
disconnect: jest.fn()
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
beforeEach(async () => {
|
|
19
|
-
element = (await fixture(
|
|
20
|
-
`<${COMPONENT_TAG}></${COMPONENT_TAG}>`
|
|
21
|
-
)) as Tooltip;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe('basic', () => {
|
|
25
|
-
it('should be initialized as a vwc-tooltip', async () => {
|
|
26
|
-
expect(element).toBeInstanceOf(Tooltip);
|
|
27
|
-
expect(element.open)
|
|
28
|
-
.toBeFalsy();
|
|
29
|
-
expect(element.anchor)
|
|
30
|
-
.toBeUndefined();
|
|
31
|
-
expect(element.corner)
|
|
32
|
-
.toBeUndefined;
|
|
33
|
-
expect(element.text)
|
|
34
|
-
.toEqual('');
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('show', () => {
|
|
39
|
-
it('should set "open" to true', async () => {
|
|
40
|
-
await setAnchor();
|
|
41
|
-
element.anchor = 'anchor';
|
|
42
|
-
await elementUpdated(element);
|
|
43
|
-
|
|
44
|
-
element.open = true;
|
|
45
|
-
await elementUpdated(element);
|
|
46
|
-
|
|
47
|
-
expect(element.open)
|
|
48
|
-
.toEqual(true);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe('hide', () => {
|
|
53
|
-
it('should set "open" to false', async () => {
|
|
54
|
-
element.open = false;
|
|
55
|
-
await elementUpdated(element);
|
|
56
|
-
|
|
57
|
-
expect(element.open)
|
|
58
|
-
.toEqual(false);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
async function setAnchor() {
|
|
66
|
-
const anchorEl = await fixture('<vwc-button id="anchor"></vwc-button>', ADD_TEMPLATE_TO_FIXTURE) as Button;
|
|
67
|
-
await elementUpdated(anchorEl);
|
|
68
|
-
return anchorEl;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { html } 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 type { Tooltip } from './tooltip';
|
|
9
|
-
|
|
10
|
-
const getClasses = (_: Tooltip) => classNames('control');
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The template for the {@link @microsoft/fast-foundation#Tooltip} component.
|
|
14
|
-
*
|
|
15
|
-
* @param context
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export const TooltipTemplate: (
|
|
19
|
-
context: ElementDefinitionContext,
|
|
20
|
-
definition: FoundationElementDefinition
|
|
21
|
-
) => ViewTemplate<Tooltip> = () => html`
|
|
22
|
-
<vwc-popup class="${getClasses}" arrow alternate="true"
|
|
23
|
-
corner=${(x) => x.corner} open=${(x) => x.open} anchor=${(x) => x.anchor}
|
|
24
|
-
exportparts="vvd-theme-alternate">
|
|
25
|
-
<div class="tooltip">
|
|
26
|
-
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
27
|
-
<div class="tooltip-text">${(x) => x.text}</div>
|
|
28
|
-
</header>
|
|
29
|
-
</div>
|
|
30
|
-
</vwc-popup>`;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import type { Placement } from '@floating-ui/dom';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base class for tooltip
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class Tooltip extends FoundationElement {
|
|
11
|
-
/**
|
|
12
|
-
* the text of the tooltip
|
|
13
|
-
* accepts string
|
|
14
|
-
*
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
@attr({ mode: 'fromView' }) text = '';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* indicates whether the tooltip is open
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
* HTML Attribute: open
|
|
24
|
-
*/
|
|
25
|
-
@attr({
|
|
26
|
-
mode: 'boolean',
|
|
27
|
-
}) open = false;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* the placement of the tooltip
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
* HTML Attribute: corner
|
|
34
|
-
*/
|
|
35
|
-
@attr corner?: Placement;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* ID reference to element in the tooltip's owner document.
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
* HTML Attribute: anchor
|
|
42
|
-
*/
|
|
43
|
-
@attr anchor?: string;
|
|
44
|
-
}
|
|
@@ -1,53 +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 = ['tooltip','button'];
|
|
9
|
-
|
|
10
|
-
test('should show the component', async ({ page }: { page: Page }) => {
|
|
11
|
-
const template = `
|
|
12
|
-
<style>
|
|
13
|
-
.wrapper{
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 220px;
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
}
|
|
20
|
-
vwc-tooltip#tooltip{
|
|
21
|
-
--tooltip-inline-size:100px;
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
24
|
-
<div class="wrapper">
|
|
25
|
-
<vwc-button id="anchor" aria-describedby="tooltip" appearance='outlined' label='This is an anchor'></vwc-button>
|
|
26
|
-
<vwc-tooltip id="tooltip" anchor="anchor" open text="right" corner="right">
|
|
27
|
-
</vwc-tooltip>
|
|
28
|
-
<vwc-tooltip id="tooltip" anchor="anchor" open text="left" corner="left">
|
|
29
|
-
</vwc-tooltip>
|
|
30
|
-
<vwc-tooltip id="tooltip" anchor="anchor" open text="top" corner="top">
|
|
31
|
-
</vwc-tooltip>
|
|
32
|
-
<vwc-tooltip id="tooltip" anchor="anchor" open text="bottom" corner="bottom">
|
|
33
|
-
</vwc-tooltip>
|
|
34
|
-
</div>
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
await loadComponents({
|
|
38
|
-
page,
|
|
39
|
-
components,
|
|
40
|
-
});
|
|
41
|
-
await loadTemplate({
|
|
42
|
-
page,
|
|
43
|
-
template,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const testWrapper = await page.$('#wrapper');
|
|
47
|
-
|
|
48
|
-
await page.waitForLoadState('networkidle');
|
|
49
|
-
|
|
50
|
-
expect(await testWrapper?.screenshot()).toMatchSnapshot(
|
|
51
|
-
'./snapshots/tooltip.png'
|
|
52
|
-
);
|
|
53
|
-
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
2
|
-
|
|
3
|
-
// common components dependency
|
|
4
|
-
/**
|
|
5
|
-
* @param {HTMLElement} element - The element to get or create a design system for.
|
|
6
|
-
* @returns {DesignSystem} - Represents a configurable design system. An API gateway to design system features.
|
|
7
|
-
*/
|
|
8
|
-
export function provideVividDesignSystem(element?: HTMLElement): DesignSystem {
|
|
9
|
-
return DesignSystem.getOrCreate(element).withPrefix('vwc');
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const designSystem = provideVividDesignSystem();
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { attr, html } from '@microsoft/fast-element';
|
|
2
|
-
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
3
|
-
import type { ElementDefinitionContext } from '@microsoft/fast-foundation';
|
|
4
|
-
import { Icon } from '../../lib/icon/icon';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A mixin class implementing prefix elements.
|
|
8
|
-
* These are generally used to decorate text elements with icons or other visual indicators.
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export class AffixIcon {
|
|
13
|
-
/**
|
|
14
|
-
* A decorative icon the custom element should have.
|
|
15
|
-
*
|
|
16
|
-
* @public
|
|
17
|
-
* @remarks
|
|
18
|
-
* HTML Attribute: icon
|
|
19
|
-
*/
|
|
20
|
-
@attr icon?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* A mixin class implementing icon affix (prefix or suffix) alignment.
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export class AffixIconWithTrailing extends AffixIcon {
|
|
29
|
-
/**
|
|
30
|
-
* Indicates the icon affix alignment.
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
* @remarks
|
|
34
|
-
* HTML Attribute: icon-trailing
|
|
35
|
-
*/
|
|
36
|
-
@attr({
|
|
37
|
-
mode: 'boolean',
|
|
38
|
-
attribute: 'icon-trailing',
|
|
39
|
-
}) iconTrailing = false;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The template for the prefixed element.
|
|
44
|
-
* For use with {@link AffixIcon}
|
|
45
|
-
*
|
|
46
|
-
* @param context
|
|
47
|
-
* @param icon
|
|
48
|
-
* @public
|
|
49
|
-
*/
|
|
50
|
-
export const affixIconTemplateFactory: (context: ElementDefinitionContext) =>
|
|
51
|
-
(icon?: string) => ViewTemplate<AffixIcon> | null = (context: ElementDefinitionContext) => {
|
|
52
|
-
const iconTag = context.tagFor(Icon);
|
|
53
|
-
return (icon?: string) => icon
|
|
54
|
-
? html`<span class="icon"><${iconTag} :type="${() => icon}"></${iconTag}></span>`
|
|
55
|
-
: null;
|
|
56
|
-
};
|
package/src/types/style.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import type {Page} from '@playwright/test';
|
|
4
|
-
import * as extract from 'extract-gfm';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @param str
|
|
8
|
-
* @param find
|
|
9
|
-
* @param replace
|
|
10
|
-
*/
|
|
11
|
-
export function replaceAll(str: string, find: string, replace: string) {
|
|
12
|
-
return str.replace(new RegExp(find, 'g'), replace);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param pathToReadme
|
|
17
|
-
*/
|
|
18
|
-
export function extractHTMLBlocksFromReadme(pathToReadme: string): string[] {
|
|
19
|
-
const readmeFileContents = fs.readFileSync(path.resolve(pathToReadme))
|
|
20
|
-
.toString();
|
|
21
|
-
const readmeFileSnippets = extract.extractBlocks(readmeFileContents);
|
|
22
|
-
return readmeFileSnippets.filter((block: any) => block.lang === 'html')
|
|
23
|
-
.map((block: any) => replaceAll(block.code.replace('preview', ''), '\n', ''));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const defaultStyles = [
|
|
27
|
-
'http://127.0.0.1:8080/dist/libs/styles/fonts/spezia.css',
|
|
28
|
-
'http://127.0.0.1:8080/dist/libs/styles/themes/light.css'
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @param root0
|
|
33
|
-
* @param root0.page
|
|
34
|
-
* @param root0.components
|
|
35
|
-
* @param root0.styleUrls
|
|
36
|
-
*/
|
|
37
|
-
export async function loadComponents({
|
|
38
|
-
page,
|
|
39
|
-
components,
|
|
40
|
-
styleUrls = defaultStyles,
|
|
41
|
-
}: {
|
|
42
|
-
page: Page,
|
|
43
|
-
components: string[],
|
|
44
|
-
styleUrls?: string[]
|
|
45
|
-
}) {
|
|
46
|
-
await page.goto('http://127.0.0.1:8080/scripts/visual-tests/index.html');
|
|
47
|
-
|
|
48
|
-
(async function () {
|
|
49
|
-
for (const component of components) {
|
|
50
|
-
await page.addScriptTag({
|
|
51
|
-
url: `http://127.0.0.1:8080/dist/libs/components/${component}/index.js`,
|
|
52
|
-
type: 'module',
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
})();
|
|
56
|
-
|
|
57
|
-
const styleTags$ = styleUrls.map(url => page.addStyleTag({url}));
|
|
58
|
-
await Promise.all(styleTags$);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @param root0
|
|
63
|
-
* @param root0.page
|
|
64
|
-
* @param root0.template
|
|
65
|
-
*/
|
|
66
|
-
export async function loadTemplate({
|
|
67
|
-
page,
|
|
68
|
-
template,
|
|
69
|
-
}: { page: Page, template: string }) {
|
|
70
|
-
const wrappedTemplate = `<div id="wrapper">${template}</div>`;
|
|
71
|
-
await page.addScriptTag({
|
|
72
|
-
content: `
|
|
73
|
-
document.body.innerHTML = \`${wrappedTemplate}\`;
|
|
74
|
-
`,
|
|
75
|
-
});
|
|
76
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ES2017",
|
|
5
|
-
"module": "ES2015",
|
|
6
|
-
"preserveWatchOutput": true,
|
|
7
|
-
"moduleResolution": "Node",
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"noImplicitReturns": true,
|
|
13
|
-
"noImplicitOverride": true,
|
|
14
|
-
"noUnusedLocals": true,
|
|
15
|
-
"noUnusedParameters": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"importsNotUsedAsValues": "error",
|
|
18
|
-
"strict": true,
|
|
19
|
-
"experimentalDecorators": true,
|
|
20
|
-
"stripInternal": true, // check if we need it
|
|
21
|
-
"importHelpers": true,
|
|
22
|
-
"allowSyntheticDefaultImports": true,
|
|
23
|
-
"removeComments": true,
|
|
24
|
-
"composite": true
|
|
25
|
-
},
|
|
26
|
-
"files": [],
|
|
27
|
-
"include": [],
|
|
28
|
-
"references": [
|
|
29
|
-
{
|
|
30
|
-
"path": "./tsconfig.lib.json",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "./tsconfig.spec.json"
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"rootDirs": ["src", "src/lib"],
|
|
5
|
-
"outDir": "../../dist/out-tsc",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"types": ["node"]
|
|
8
|
-
},
|
|
9
|
-
"exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.config.*.ts", "**/visual-tests/**/*", "*.*"],
|
|
10
|
-
"include": ["**/*.ts"]
|
|
11
|
-
}
|