@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,139 +0,0 @@
|
|
|
1
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import {
|
|
4
|
-
ARROW_DOWN,
|
|
5
|
-
ARROW_LEFT,
|
|
6
|
-
ARROW_RIGHT,
|
|
7
|
-
ARROW_UP,
|
|
8
|
-
getHeaderDescendantGridCell,
|
|
9
|
-
getNextFocusableGridElement,
|
|
10
|
-
isCellOrHeader,
|
|
11
|
-
PredefindKeys,
|
|
12
|
-
} from './helpers/calendar.keyboard-interactions';
|
|
13
|
-
import { getEventContext } from './helpers/calendar.event-context';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Base class for calendar
|
|
18
|
-
*
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export class Calendar extends FoundationElement {
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The date within a week of choice.
|
|
25
|
-
* Accepts any parameter acceptable by the `Date()` constructor.
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
@attr datetime?: Date | string;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The day to show as the first within a work week.
|
|
33
|
-
* Accepts either Sunday or Monday
|
|
34
|
-
* Calendar will - programmatically - default to Monday if not specified
|
|
35
|
-
*
|
|
36
|
-
* (only applicable for views of more than a single day)
|
|
37
|
-
*
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
@attr({ attribute: 'start-day' }) startDay?: 'sunday' | 'monday';
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A locale string or array of locale strings that contain one or more language or locale tags.
|
|
44
|
-
* If you include more than one locale string,
|
|
45
|
-
* list them in descending order of priority so that the first entry is the preferred locale.
|
|
46
|
-
* If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
47
|
-
* This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
|
|
48
|
-
* e.g. en-US | en-US, he-IL
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
@attr locales?: string | string[] | undefined;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The convention of displayed time in which the day runs from midnight to midnight and is divided into 24 or 12 hours.
|
|
56
|
-
* Unless provided, choice will be set according to local time preference (e.g. US = 12, IL = 24)
|
|
57
|
-
*
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
@attr({ mode: 'boolean' }) hour12 = false;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
_hours = 24;
|
|
66
|
-
/**
|
|
67
|
-
* @internal
|
|
68
|
-
*/
|
|
69
|
-
_days = 7;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
hoursAsDatetime = (Array.from({ length: this._hours - 1 }) as Date[])
|
|
75
|
-
.fill(new Date(new Date().setHours(0, 0, 0)))
|
|
76
|
-
.map((d, i) => new Date(d.setHours(++i)));
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @param dateArr array of dates. requires at least 1 date to be set within the array
|
|
80
|
-
* @returns array of incremental dates from the first date in the array
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
_generateDaysArr = (dateArr: [Date, ...Date[]]): Date[] => {
|
|
84
|
-
if (dateArr.length == this._days) {
|
|
85
|
-
return dateArr;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const lastDate = new Date(dateArr[dateArr.length - 1]);
|
|
89
|
-
lastDate.setDate(lastDate.getDate() + 1);
|
|
90
|
-
|
|
91
|
-
return this._generateDaysArr([...dateArr, lastDate]);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Fire an event
|
|
96
|
-
*
|
|
97
|
-
* @param {string} event - event name
|
|
98
|
-
* @param {Object} [detail={}] - optional event detail object
|
|
99
|
-
* @returns {boolean} - return true
|
|
100
|
-
*/
|
|
101
|
-
getEventContext = getEventContext;
|
|
102
|
-
|
|
103
|
-
private arrowKeysInteractions(key: PredefindKeys) {
|
|
104
|
-
const activeElement = (this.shadowRoot as ShadowRoot).activeElement;
|
|
105
|
-
let focusNext: Element | null | void;
|
|
106
|
-
|
|
107
|
-
if (isCellOrHeader(activeElement)) {
|
|
108
|
-
focusNext = getNextFocusableGridElement.call(this, key, activeElement);
|
|
109
|
-
} else if (activeElement?.matches('em[role="button"i]')) {
|
|
110
|
-
focusNext = getHeaderDescendantGridCell.call(this, key, activeElement as HTMLElement);
|
|
111
|
-
} else {
|
|
112
|
-
focusNext = (this.shadowRoot as ShadowRoot).querySelector('[role="columnheader"i]');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
this.moveTo(focusNext as HTMLElement);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
private moveTo(el: HTMLElement | null | undefined) {
|
|
119
|
-
const onBlur = ({ target }: FocusEvent) => (target as HTMLElement).setAttribute('tabindex', '-1');
|
|
120
|
-
|
|
121
|
-
el?.addEventListener('blur', onBlur, { once: true });
|
|
122
|
-
el?.setAttribute('tabindex', '0');
|
|
123
|
-
el?.focus();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
onKeydown({ key }: KeyboardEvent) {
|
|
128
|
-
const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(predefinedKey => predefinedKey == key);
|
|
129
|
-
|
|
130
|
-
if (isArrow) {
|
|
131
|
-
this.arrowKeysInteractions(key as PredefindKeys);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// after this event handler is executed,
|
|
135
|
-
// preventDefault() will be called on the event object by default.
|
|
136
|
-
// we need to return true from our handler to opt - out of this behavior.
|
|
137
|
-
return !isArrow;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a valid date string from date object e.g. 2020-01-01
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This method returns valid date string to be used as html time tag datetime value
|
|
6
|
-
* @param date - js date object
|
|
7
|
-
* @returns a date as a string value in ISO format.
|
|
8
|
-
*/
|
|
9
|
-
export function getValidDateString(date: Date): string {
|
|
10
|
-
const twoDigit = (num: number) => `0${num}`.slice(-2);
|
|
11
|
-
return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(date.getDate())}`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const weekdaysMap = new Map([
|
|
15
|
-
['sunday', 0],
|
|
16
|
-
['monday', 1],
|
|
17
|
-
]);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param date
|
|
21
|
-
* @param startDay
|
|
22
|
-
*/
|
|
23
|
-
export function getFirstDateOfTheWeek(date: Date = new Date(), startDay: 'sunday' | 'monday'): Date {
|
|
24
|
-
date = new Date(date);
|
|
25
|
-
|
|
26
|
-
let num = weekdaysMap.get(startDay);
|
|
27
|
-
num ??= 1;
|
|
28
|
-
const day = date.getDate() - ((date.getDay() + 7 - num) % 7);
|
|
29
|
-
|
|
30
|
-
return new Date(date.setDate(day));
|
|
31
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { isEmpty, not } from 'ramda';
|
|
2
|
-
import type { Calendar } from '../calendar';
|
|
3
|
-
// import { isCellOrHeader } from './calendar.keyboard-interactions';
|
|
4
|
-
|
|
5
|
-
export interface CalendarEventContext {
|
|
6
|
-
day?: number;
|
|
7
|
-
hour?: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @param el
|
|
12
|
-
*/
|
|
13
|
-
function getDay(el: HTMLElement): number | void {
|
|
14
|
-
const cellOrHeader = el.closest('[role="gridcell"i], [role="columnheader"i]');
|
|
15
|
-
if (cellOrHeader) {
|
|
16
|
-
const { parentElement } = cellOrHeader;
|
|
17
|
-
if (parentElement) {
|
|
18
|
-
return parentElement.children && Array.from(parentElement.children).indexOf(cellOrHeader);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param e
|
|
25
|
-
* @param el
|
|
26
|
-
* @param hours
|
|
27
|
-
*/
|
|
28
|
-
function getHour(e: MouseEvent, el: HTMLElement, hours: number): number | void {
|
|
29
|
-
const rowHeaderOrCell = el.closest('[role="rowheader"], [role="gridcell"i]') as HTMLElement;
|
|
30
|
-
|
|
31
|
-
if (rowHeaderOrCell) {
|
|
32
|
-
const DOMRect = rowHeaderOrCell.getBoundingClientRect();
|
|
33
|
-
const offsetY = e.clientY - DOMRect.y;
|
|
34
|
-
const hourHeight = DOMRect.height / hours;
|
|
35
|
-
const hour = offsetY / hourHeight;
|
|
36
|
-
|
|
37
|
-
return Math.round((hour + Number.EPSILON) * 100) / 100;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @param this
|
|
43
|
-
* @param shadowRoot
|
|
44
|
-
* @param hours
|
|
45
|
-
* @param e
|
|
46
|
-
*/
|
|
47
|
-
export const getEventContext = function(this: Calendar, e: KeyboardEvent | MouseEvent): CalendarEventContext | null {
|
|
48
|
-
|
|
49
|
-
if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) {
|
|
50
|
-
throw new Error('Invalid event. Event must be instance of KeyboardEvent or MouseEvent');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const [el] = e.composedPath();
|
|
54
|
-
|
|
55
|
-
if (!(el && el instanceof HTMLElement && (this.shadowRoot as ShadowRoot).contains(el))) {
|
|
56
|
-
throw new Error('Invalid event. Event must contain a target object which is a direct descendant of calendar');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const day = getDay(el);
|
|
60
|
-
let hour;
|
|
61
|
-
|
|
62
|
-
if (e instanceof MouseEvent) {
|
|
63
|
-
hour = getHour(e, el, this._hours);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const context = {
|
|
67
|
-
...(day != undefined && { day }),
|
|
68
|
-
...(hour != undefined && { hour }),
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return not(isEmpty(context)) ? context : null;
|
|
72
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Calendar } from '../calendar';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const ARROW_UP = 'ArrowUp';
|
|
5
|
-
export const ARROW_RIGHT = 'ArrowRight';
|
|
6
|
-
export const ARROW_DOWN = 'ArrowDown';
|
|
7
|
-
export const ARROW_LEFT = 'ArrowLeft';
|
|
8
|
-
|
|
9
|
-
export type PredefindKeys = typeof ARROW_UP | typeof ARROW_RIGHT | typeof ARROW_DOWN | typeof ARROW_LEFT;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param el
|
|
13
|
-
*/
|
|
14
|
-
export function isCellOrHeader(el: unknown): el is HTMLElement {
|
|
15
|
-
return el instanceof HTMLElement
|
|
16
|
-
&& (
|
|
17
|
-
el.matches('[role="gridcell"i]')
|
|
18
|
-
|| el.matches('[role="columnheader"i]')
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const getCellOrHeader = (f: HTMLElement) => (f.matches('[role="columnheader"i]')
|
|
23
|
-
? '[role="gridcell"i]'
|
|
24
|
-
: '[role="columnheader"i]');
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param this
|
|
28
|
-
* @param key
|
|
29
|
-
* @param activeElement
|
|
30
|
-
*/
|
|
31
|
-
export function getNextFocusableGridElement(
|
|
32
|
-
this: Calendar, key: PredefindKeys, activeElement: HTMLElement
|
|
33
|
-
): Element | null | void {
|
|
34
|
-
if (activeElement.parentNode instanceof HTMLElement) {
|
|
35
|
-
switch (key) {
|
|
36
|
-
case ARROW_RIGHT:
|
|
37
|
-
return activeElement.nextElementSibling || activeElement.parentNode.firstElementChild;
|
|
38
|
-
case ARROW_LEFT:
|
|
39
|
-
return activeElement.previousElementSibling || activeElement.parentNode.lastElementChild;
|
|
40
|
-
case ARROW_UP:
|
|
41
|
-
case ARROW_DOWN: {
|
|
42
|
-
const { children } = activeElement.parentNode;
|
|
43
|
-
const i = Array.from(children).indexOf(activeElement);
|
|
44
|
-
return (this.shadowRoot as ShadowRoot).querySelector(
|
|
45
|
-
`${getCellOrHeader(activeElement as HTMLElement)}:nth-child(${i + 1})`
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @param this
|
|
54
|
-
* @param key
|
|
55
|
-
* @param activeElement
|
|
56
|
-
*/
|
|
57
|
-
export function getHeaderDescendantGridCell(this: Calendar, key: PredefindKeys, activeElement: HTMLElement): Element | null | undefined {
|
|
58
|
-
if (key !== ARROW_DOWN) {return;}
|
|
59
|
-
|
|
60
|
-
const header = activeElement.closest('[role="columnheader"i]') as HTMLElement;
|
|
61
|
-
const columnHeaders = (this.shadowRoot as ShadowRoot).querySelectorAll('[role="columnheader"i]');
|
|
62
|
-
const i = Array.from(columnHeaders).indexOf(header);
|
|
63
|
-
return (this.shadowRoot as ShadowRoot).querySelector(`[role="gridcell"i]:nth-child(${i + 1})`);
|
|
64
|
-
|
|
65
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import '../elevation';
|
|
2
|
-
|
|
3
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
4
|
-
import { designSystem } from '../../shared/design-system';
|
|
5
|
-
import styles from './calendar.scss';
|
|
6
|
-
|
|
7
|
-
import { Calendar } from './calendar';
|
|
8
|
-
import { CalendarTemplate as template } from './calendar.template';
|
|
9
|
-
|
|
10
|
-
export const vividCalendar = Calendar.compose<FoundationElementDefinition>({
|
|
11
|
-
baseName: 'calendar',
|
|
12
|
-
template: template as any,
|
|
13
|
-
styles,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
designSystem.register(vividCalendar());
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// number of columns according to days of week
|
|
2
|
-
$total-columns: 7;
|
|
3
|
-
|
|
4
|
-
// the rows according to hours a day
|
|
5
|
-
$total-rows: 24;
|
|
6
|
-
$gap: 1px;
|
|
7
|
-
$calendar-shape: --vvd-calendar-shape;
|
|
8
|
-
|
|
9
|
-
// event variables
|
|
10
|
-
$color: --vvd-calendar-event--primary-color;
|
|
11
|
-
$day: --vvd-calendar-event--day;
|
|
12
|
-
$start: --vvd-calendar-event--start;
|
|
13
|
-
$duration: --vvd-calendar-event--duration;
|
|
14
|
-
$indent: --vvd-calendar-event--indent;
|
|
15
|
-
$overlap-count: --vvd-calendar-event--overlap-count;
|
|
@@ -1,32 +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 = ['calendar'];
|
|
9
|
-
|
|
10
|
-
test('should show the component', async ({ page }: { page: Page }) => {
|
|
11
|
-
const template =`
|
|
12
|
-
<vwc-calendar datetime="2022-01-01"></vwc-calendar>
|
|
13
|
-
<vwc-calendar datetime="2022-01-01" hour12 locales="he-IL" start-day="sunday" style="direction: rtl"></vwc-calendar>
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
await loadComponents({
|
|
17
|
-
page,
|
|
18
|
-
components,
|
|
19
|
-
});
|
|
20
|
-
await loadTemplate({
|
|
21
|
-
page,
|
|
22
|
-
template,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const testWrapper = await page.$('#wrapper');
|
|
26
|
-
await page.waitForLoadState('networkidle');
|
|
27
|
-
|
|
28
|
-
expect(await testWrapper?.screenshot())
|
|
29
|
-
.toMatchSnapshot(
|
|
30
|
-
'./snapshots/calendar.png',
|
|
31
|
-
);
|
|
32
|
-
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# elevation
|
|
2
|
-
|
|
3
|
-
The _elevation_ component enables a user to set perceived elevation to a certain level.
|
|
4
|
-
**Note: This component is responsible for the perceived visual elevation alone and not for the HTML elements stacking context.**
|
|
5
|
-
|
|
6
|
-
```js
|
|
7
|
-
<script type='module'>
|
|
8
|
-
import '@vonage/vivid/elevation';
|
|
9
|
-
</script>
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
```html preview
|
|
13
|
-
<style>
|
|
14
|
-
#card {
|
|
15
|
-
padding: 20px;
|
|
16
|
-
text-align: center;
|
|
17
|
-
border-radius: 6px;
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
20
|
-
|
|
21
|
-
<vwc-layout gutters="base-small">
|
|
22
|
-
<vwc-elevation id="elevation">
|
|
23
|
-
<div id="card">
|
|
24
|
-
Hover me!
|
|
25
|
-
</div>
|
|
26
|
-
</vwc-elevation>
|
|
27
|
-
</vwc-layout>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
elevation.addEventListener("mouseenter", this.onMouseEnter);
|
|
31
|
-
elevation.addEventListener("mouseleave", this.onMouseLeave);
|
|
32
|
-
|
|
33
|
-
function onMouseEnter() {
|
|
34
|
-
elevation.setAttribute('dp', '24');
|
|
35
|
-
card.innerText = 'Get OFF of me!';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function onMouseLeave() {
|
|
39
|
-
elevation.removeAttribute('dp');
|
|
40
|
-
card.innerText = 'Hover me!';
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## DP
|
|
47
|
-
|
|
48
|
-
Use the `dp` attribute to change the elevation's level in Density-Independent Pixels (DP).
|
|
49
|
-
|
|
50
|
-
- Type: `0`|`2`|`4`|`8`|`12`|`16`|`24`
|
|
51
|
-
- Default: `2`
|
|
52
|
-
|
|
53
|
-
```html preview
|
|
54
|
-
<style>
|
|
55
|
-
.card {
|
|
56
|
-
padding: 20px;
|
|
57
|
-
text-align: center;
|
|
58
|
-
border-radius: 6px;
|
|
59
|
-
}
|
|
60
|
-
</style>
|
|
61
|
-
|
|
62
|
-
<vwc-layout column-spacing="base-large" column-basis="block" gutters="base-small">
|
|
63
|
-
<vwc-elevation dp="0">
|
|
64
|
-
<div class="card">
|
|
65
|
-
This is the content inside the elevation with DP 0
|
|
66
|
-
</div>
|
|
67
|
-
</vwc-elevation>
|
|
68
|
-
<vwc-elevation dp="2">
|
|
69
|
-
<div class="card">
|
|
70
|
-
This is the content inside the elevation with DP 2
|
|
71
|
-
</div>
|
|
72
|
-
</vwc-elevation>
|
|
73
|
-
<vwc-elevation dp="4">
|
|
74
|
-
<div class="card">
|
|
75
|
-
This is the content inside the elevation with DP 4
|
|
76
|
-
</div>
|
|
77
|
-
</vwc-elevation>
|
|
78
|
-
<vwc-elevation dp="8">
|
|
79
|
-
<div class="card">
|
|
80
|
-
This is the content inside the elevation with DP 8
|
|
81
|
-
</div>
|
|
82
|
-
</vwc-elevation>
|
|
83
|
-
<vwc-elevation dp="12">
|
|
84
|
-
<div class="card">
|
|
85
|
-
This is the content inside the elevation with DP 12
|
|
86
|
-
</div>
|
|
87
|
-
</vwc-elevation>
|
|
88
|
-
<vwc-elevation dp="16">
|
|
89
|
-
<div class="card">
|
|
90
|
-
This is the content inside the elevation with DP 16
|
|
91
|
-
</div>
|
|
92
|
-
</vwc-elevation>
|
|
93
|
-
<vwc-elevation dp="24">
|
|
94
|
-
<div class="card">
|
|
95
|
-
This is the content inside the elevation with DP 24
|
|
96
|
-
</div>
|
|
97
|
-
</vwc-elevation>
|
|
98
|
-
</vwc-layout>
|
|
99
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use '../../../../shared/src/lib/sass/mixins/utils' as utils;
|
|
3
|
-
@use 'partials/elevation.mixin' as elevation;
|
|
4
|
-
|
|
5
|
-
$dps: 0 2 4 8 12 16 24;
|
|
6
|
-
|
|
7
|
-
.control {
|
|
8
|
-
$default: list.nth($dps, 2);
|
|
9
|
-
|
|
10
|
-
@include utils.spread-list-selectors('.dp', $dps, $default) using ($type) {
|
|
11
|
-
::slotted(*) {
|
|
12
|
-
@include elevation.get-elevation($type);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { elementUpdated, fixture, getControlElement } from '@vivid-nx/shared';
|
|
2
|
-
import { Elevation } from './elevation';
|
|
3
|
-
import '.';
|
|
4
|
-
|
|
5
|
-
const COMPONENT_TAG = 'vwc-elevation';
|
|
6
|
-
|
|
7
|
-
describe('vwc-elevation', () => {
|
|
8
|
-
let element: Elevation;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
element = await fixture(`<${COMPONENT_TAG}></${COMPONENT_TAG}>`) as Elevation;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe('basic', () => {
|
|
15
|
-
it('initializes as a vwc-elevation', async () => {
|
|
16
|
-
expect(element).toBeInstanceOf(Elevation);
|
|
17
|
-
expect(element.dp).toBeUndefined();
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
describe('dp', () => {
|
|
22
|
-
it('should change the property when the attribute changes', async () => {
|
|
23
|
-
const startingDP = 8;
|
|
24
|
-
element.dp = startingDP;
|
|
25
|
-
await elementUpdated(element);
|
|
26
|
-
|
|
27
|
-
const propertyValueBeforeChange = element.dp;
|
|
28
|
-
element.setAttribute('dp', '4');
|
|
29
|
-
|
|
30
|
-
expect(propertyValueBeforeChange).toEqual(startingDP);
|
|
31
|
-
expect(element.dp).toEqual('4');
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should set the dp class on the wrapper element', async () => {
|
|
35
|
-
const startingDP = 8;
|
|
36
|
-
const nextDP = '24';
|
|
37
|
-
element.dp = startingDP;
|
|
38
|
-
await elementUpdated(element);
|
|
39
|
-
const classPrefix = 'dp-';
|
|
40
|
-
|
|
41
|
-
const startingDPClassExists = getControlElement(element).classList.contains(`${classPrefix}${startingDP}`);
|
|
42
|
-
|
|
43
|
-
element.setAttribute('dp', nextDP);
|
|
44
|
-
await elementUpdated(element);
|
|
45
|
-
const nextDPClassExists = getControlElement(element).classList.contains(`${classPrefix}${nextDP}`);
|
|
46
|
-
expect(startingDPClassExists).toEqual(true);
|
|
47
|
-
expect(nextDPClassExists).toEqual(true);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should have a slot', async () => {
|
|
52
|
-
await elementUpdated(element);
|
|
53
|
-
expect(Boolean(element.shadowRoot?.querySelector('slot'))).toEqual(true);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { html } 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 { Elevation } from './elevation';
|
|
6
|
-
|
|
7
|
-
const getClasses = ({
|
|
8
|
-
dp
|
|
9
|
-
}: Elevation) => classNames(
|
|
10
|
-
'control',
|
|
11
|
-
[`dp-${dp}`, Boolean(dp)],
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The template for the {@link @vonage/vivid#Elevation} component.
|
|
16
|
-
*
|
|
17
|
-
* @returns {ViewTemplate<Elevation>} A template capable of creating HTMLView instances or rendering directly to DOM.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export const elevationTemplate: (
|
|
21
|
-
context: ElementDefinitionContext,
|
|
22
|
-
definition: FoundationElementDefinition
|
|
23
|
-
) => ViewTemplate<Elevation> = () => html`
|
|
24
|
-
<div class="${getClasses}" part="base">
|
|
25
|
-
<slot></slot>
|
|
26
|
-
</div>`;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { attr } from '@microsoft/fast-element';
|
|
2
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Base class for elevation
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export class Elevation extends FoundationElement {
|
|
10
|
-
/**
|
|
11
|
-
* Indicates the elevation's dp.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
* HTML Attribute: dp
|
|
15
|
-
*/
|
|
16
|
-
@attr dp?: 0 | 2 | 4 | 8 | 12 | 16 | 24; // TODO: get values from design tokens
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
-
import { designSystem } from '../../shared/design-system';
|
|
3
|
-
import { Elevation } from './elevation';
|
|
4
|
-
import styles from './elevation.scss';
|
|
5
|
-
import { elevationTemplate as template } from './elevation.template';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Represents an elevation custom element.
|
|
10
|
-
*/
|
|
11
|
-
export const VIVIDElevation = Elevation.compose<FoundationElementDefinition>({
|
|
12
|
-
baseName: 'elevation',
|
|
13
|
-
template: template as any,
|
|
14
|
-
styles,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
designSystem.register(VIVIDElevation());
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import {expect, test} from '@playwright/test';
|
|
3
|
-
import type {Page} from '@playwright/test';
|
|
4
|
-
import {
|
|
5
|
-
extractHTMLBlocksFromReadme,
|
|
6
|
-
loadComponents,
|
|
7
|
-
loadTemplate
|
|
8
|
-
} from '../../visual-tests/visual-tests-utils.ts';
|
|
9
|
-
|
|
10
|
-
const components = ['elevation', 'layout'];
|
|
11
|
-
test('should show the component', async ({page}: { page: Page }) => {
|
|
12
|
-
const template = extractHTMLBlocksFromReadme(path.join(new URL('.', import.meta.url).pathname, 'README.md'))
|
|
13
|
-
.reduce((htmlString: string, block: string) => `${htmlString} <div style="margin: 5px;">${block}</div>`, '');
|
|
14
|
-
|
|
15
|
-
await loadComponents({
|
|
16
|
-
page,
|
|
17
|
-
components,
|
|
18
|
-
});
|
|
19
|
-
await loadTemplate({
|
|
20
|
-
page,
|
|
21
|
-
template,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const testWrapper = await page.$('#wrapper');
|
|
25
|
-
|
|
26
|
-
await page.waitForLoadState('networkidle');
|
|
27
|
-
|
|
28
|
-
expect(await testWrapper?.screenshot())
|
|
29
|
-
.toMatchSnapshot(
|
|
30
|
-
'./snapshots/elevation.png',
|
|
31
|
-
);
|
|
32
|
-
});
|
|
Binary file
|
|
Binary file
|
package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Firefox-darwin.png
DELETED
|
Binary file
|