@vonage/vivid 3.0.0-next.6 → 3.0.0-next.7
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/.babelrc +3 -0
- package/.eslintrc.json +70 -0
- package/.stylelintrc.json +8 -0
- package/CHANGELOG.json +343 -0
- package/CHANGELOG.md +45 -0
- package/jest.config.cjs +20 -0
- package/package.json +4 -13
- package/playwright.config.dev.ts +21 -0
- package/playwright.config.ts +34 -0
- package/project.json +122 -0
- package/rollup.config.prod.ts +50 -0
- package/setupJestTests.js +17 -0
- package/{index.d.ts → src/index.ts} +2 -2
- package/src/lib/accordion/README.md +55 -0
- package/src/lib/accordion/accordion.scss +10 -0
- package/src/lib/accordion/accordion.spec.ts +91 -0
- package/src/lib/accordion/accordion.template.ts +23 -0
- package/src/lib/accordion/accordion.ts +49 -0
- package/src/lib/accordion/index.ts +14 -0
- package/src/lib/accordion/ui.test.ts +37 -0
- 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 +113 -0
- package/src/lib/accordion-item/accordion-item.scss +91 -0
- package/src/lib/accordion-item/accordion-item.spec.ts +103 -0
- package/src/lib/accordion-item/accordion-item.template.ts +62 -0
- package/src/lib/accordion-item/accordion-item.ts +67 -0
- package/src/lib/accordion-item/index.ts +14 -0
- package/src/lib/accordion-item/partials/variables.scss +1 -0
- package/src/lib/accordion-item/ui.test.ts +37 -0
- 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 +112 -0
- package/src/lib/badge/badge.scss +64 -0
- package/src/lib/badge/badge.spec.ts +114 -0
- package/src/lib/badge/badge.template.ts +36 -0
- package/src/lib/badge/badge.ts +97 -0
- package/src/lib/badge/index.ts +23 -0
- package/src/lib/badge/ui.test.ts +28 -0
- 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 +117 -0
- package/src/lib/banner/banner.scss +71 -0
- package/src/lib/banner/banner.spec.ts +355 -0
- package/src/lib/banner/banner.template.ts +61 -0
- package/src/lib/banner/banner.ts +77 -0
- package/src/lib/banner/index.ts +14 -0
- package/src/lib/banner/ui.test.ts +64 -0
- 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 +25 -0
- package/src/lib/breadcrumb/breadcrumb.scss +3 -0
- package/src/lib/breadcrumb/breadcrumb.spec.ts +78 -0
- package/src/lib/breadcrumb/breadcrumb.ts +10 -0
- package/src/lib/breadcrumb/index.ts +13 -0
- package/src/lib/breadcrumb/ui.test.ts +36 -0
- 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 +40 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.scss +28 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.spec.ts +192 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.template.ts +37 -0
- package/src/lib/breadcrumb-item/breadcrumb-item.ts +15 -0
- package/src/lib/breadcrumb-item/index.ts +16 -0
- package/src/lib/breadcrumb-item/ui.test.ts +38 -0
- 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 +120 -0
- package/src/lib/button/button.scss +142 -0
- package/src/lib/button/button.spec.ts +131 -0
- package/src/lib/button/button.template.ts +89 -0
- package/src/lib/button/button.ts +95 -0
- package/src/lib/button/index.ts +25 -0
- package/src/lib/button/partials/variables.scss +2 -0
- package/src/lib/button/ui.test.ts +32 -0
- 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 +70 -0
- package/src/lib/calendar/calendar.scss +176 -0
- package/src/lib/calendar/calendar.spec.ts +341 -0
- package/src/lib/calendar/calendar.template.ts +93 -0
- package/src/lib/calendar/calendar.ts +139 -0
- package/src/lib/calendar/helpers/calendar.date-functions.ts +31 -0
- package/src/lib/calendar/helpers/calendar.event-context.ts +72 -0
- package/src/lib/calendar/helpers/calendar.keyboard-interactions.ts +65 -0
- package/src/lib/calendar/index.ts +16 -0
- package/src/lib/calendar/partials/_variables.scss +15 -0
- package/src/lib/calendar/ui.test.ts +32 -0
- 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 +7 -0
- package/{lib/components.d.ts → src/lib/components.ts} +16 -16
- package/src/lib/elevation/README.md +99 -0
- package/src/lib/elevation/elevation.scss +15 -0
- package/src/lib/elevation/elevation.spec.ts +55 -0
- package/src/lib/elevation/elevation.template.ts +26 -0
- package/src/lib/elevation/elevation.ts +17 -0
- package/src/lib/elevation/index.ts +17 -0
- package/src/lib/elevation/partials/_elevation.mixin.scss +4 -0
- package/src/lib/elevation/ui.test.ts +32 -0
- 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 +55 -0
- package/src/lib/focus/README.md +1 -0
- package/src/lib/focus/focus.scss +17 -0
- package/src/lib/focus/focus.template.ts +16 -0
- package/src/lib/focus/focus.ts +10 -0
- package/src/lib/focus/index.ts +21 -0
- package/src/lib/focus/partials/variables.scss +2 -0
- package/src/lib/icon/README.md +70 -0
- package/src/lib/icon/__snapshots__/icon.spec.ts.snap +16 -0
- package/src/lib/icon/icon.placeholder.ts +12 -0
- package/src/lib/icon/icon.scss +52 -0
- package/src/lib/icon/icon.spec.ts +106 -0
- package/src/lib/icon/icon.template.ts +23 -0
- package/src/lib/icon/icon.ts +93 -0
- package/src/lib/icon/index.ts +14 -0
- package/src/lib/layout/README.md +154 -0
- package/src/lib/layout/index.ts +18 -0
- package/src/lib/layout/layout.scss +40 -0
- package/src/lib/layout/layout.spec.ts +73 -0
- package/src/lib/layout/layout.template.ts +29 -0
- package/src/lib/layout/layout.ts +46 -0
- package/src/lib/layout/partials/_functions.scss +15 -0
- package/src/lib/layout/partials/_mixins.scss +5 -0
- package/src/lib/layout/partials/_variables.scss +23 -0
- package/src/lib/layout/ui.test.ts +32 -0
- 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 +261 -0
- package/src/lib/popup/index.ts +21 -0
- package/src/lib/popup/popup.scss +43 -0
- package/src/lib/popup/popup.spec.ts +265 -0
- package/src/lib/popup/popup.template.ts +41 -0
- package/src/lib/popup/popup.ts +158 -0
- package/src/lib/popup/ui.test.ts +111 -0
- 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 +107 -0
- package/src/lib/progress/index.ts +14 -0
- package/src/lib/progress/progress.scss +133 -0
- package/src/lib/progress/progress.spec.ts +173 -0
- package/src/lib/progress/progress.template.ts +62 -0
- package/src/lib/progress/progress.ts +25 -0
- package/src/lib/progress/ui.test.ts +70 -0
- 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 +90 -0
- package/src/lib/progress-ring/index.ts +15 -0
- package/src/lib/progress-ring/progress-ring.scss +75 -0
- package/src/lib/progress-ring/progress-ring.spec.ts +139 -0
- package/src/lib/progress-ring/progress-ring.template.ts +82 -0
- package/src/lib/progress-ring/progress-ring.ts +18 -0
- package/src/lib/progress-ring/ui.test.ts +35 -0
- 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 +304 -0
- package/src/lib/side-drawer/index.ts +16 -0
- package/src/lib/side-drawer/partials/variables.scss +6 -0
- package/src/lib/side-drawer/side-drawer.scss +109 -0
- package/src/lib/side-drawer/side-drawer.spec.ts +118 -0
- package/src/lib/side-drawer/side-drawer.template.ts +51 -0
- package/src/lib/side-drawer/side-drawer.ts +58 -0
- package/src/lib/side-drawer/ui.test.ts +102 -0
- 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 +41 -0
- package/src/lib/sidenav-item/index.ts +20 -0
- package/src/lib/sidenav-item/sidenav-item.scss +51 -0
- package/src/lib/sidenav-item/sidenav-item.spec.ts +64 -0
- package/src/lib/sidenav-item/sidenav-item.template.ts +25 -0
- package/src/lib/sidenav-item/sidenav-item.ts +15 -0
- package/src/lib/sidenav-item/ui.test.ts +32 -0
- 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 +119 -0
- package/src/lib/text/index.ts +14 -0
- package/src/lib/text/text.scss +92 -0
- package/src/lib/text/text.spec.ts +54 -0
- package/src/lib/text/text.template.ts +28 -0
- package/src/lib/text/text.ts +55 -0
- package/src/lib/text/ui.test.ts +39 -0
- 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 +5 -0
- package/src/lib/text-anchor/index.ts +12 -0
- package/src/lib/text-anchor/text-anchor.spec.ts +153 -0
- package/src/lib/text-anchor/text-anchor.template.ts +66 -0
- package/src/lib/text-anchor/text-anchor.ts +22 -0
- package/src/lib/tooltip/README.md +132 -0
- package/src/lib/tooltip/index.ts +16 -0
- package/src/lib/tooltip/partials/variables.scss +1 -0
- package/src/lib/tooltip/tooltip.scss +18 -0
- package/src/lib/tooltip/tooltip.spec.ts +70 -0
- package/src/lib/tooltip/tooltip.template.ts +30 -0
- package/src/lib/tooltip/tooltip.ts +44 -0
- package/src/lib/tooltip/ui.test.ts +53 -0
- 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 +12 -0
- package/src/shared/patterns/affix.ts +56 -0
- package/{shared/patterns/index.d.ts → src/shared/patterns/index.ts} +1 -1
- package/src/types/extract-gfm.d.ts +5 -0
- package/src/types/style.d.ts +4 -0
- package/src/visual-tests/visual-tests-utils.ts +76 -0
- package/tsconfig.json +36 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +16 -0
- package/accordion/index.js +0 -61
- package/accordion-item/index.js +0 -125
- package/badge/index.js +0 -64
- package/banner/index.js +0 -212
- package/breadcrumb/index.js +0 -100
- package/breadcrumb-item/index.js +0 -55
- package/button/index.js +0 -761
- package/calendar/index.js +0 -1521
- package/elevation/index.js +0 -31
- package/focus/index.js +0 -3
- package/icon/index.js +0 -34
- package/index.js +0 -32
- package/layout/index.js +0 -53
- package/lib/accordion/accordion.d.ts +0 -9
- package/lib/accordion/accordion.template.d.ts +0 -4
- package/lib/accordion/index.d.ts +0 -2
- package/lib/accordion-item/accordion-item.d.ts +0 -13
- package/lib/accordion-item/accordion-item.template.d.ts +0 -4
- package/lib/accordion-item/index.d.ts +0 -3
- package/lib/badge/badge.d.ts +0 -17
- package/lib/badge/badge.template.d.ts +0 -4
- package/lib/badge/index.d.ts +0 -3
- package/lib/banner/banner.d.ts +0 -20
- package/lib/banner/banner.template.d.ts +0 -6
- package/lib/banner/index.d.ts +0 -2
- package/lib/breadcrumb/breadcrumb.d.ts +0 -3
- package/lib/breadcrumb/index.d.ts +0 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +0 -5
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -4
- package/lib/breadcrumb-item/index.d.ts +0 -3
- package/lib/button/button.d.ts +0 -17
- package/lib/button/button.template.d.ts +0 -4
- package/lib/button/index.d.ts +0 -21
- package/lib/calendar/calendar.d.ts +0 -11
- package/lib/calendar/calendar.template.d.ts +0 -4
- package/lib/calendar/helpers/calendar.date-functions.d.ts +0 -2
- package/lib/calendar/helpers/calendar.event-context.d.ts +0 -6
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +0 -9
- package/lib/calendar/index.d.ts +0 -3
- package/lib/elevation/elevation.d.ts +0 -4
- package/lib/elevation/elevation.template.d.ts +0 -4
- package/lib/elevation/index.d.ts +0 -2
- package/lib/enums.d.ts +0 -45
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/focus/index.d.ts +0 -2
- package/lib/icon/icon.d.ts +0 -11
- package/lib/icon/icon.placeholder.d.ts +0 -1
- package/lib/icon/icon.template.d.ts +0 -4
- package/lib/icon/index.d.ts +0 -2
- package/lib/layout/index.d.ts +0 -2
- package/lib/layout/layout.d.ts +0 -16
- package/lib/layout/layout.template.d.ts +0 -4
- package/lib/popup/index.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -29
- package/lib/popup/popup.template.d.ts +0 -4
- package/lib/progress/index.d.ts +0 -2
- package/lib/progress/progress.d.ts +0 -9
- package/lib/progress/progress.template.d.ts +0 -5
- package/lib/progress-ring/index.d.ts +0 -2
- package/lib/progress-ring/progress-ring.d.ts +0 -6
- package/lib/progress-ring/progress-ring.template.d.ts +0 -4
- package/lib/side-drawer/index.d.ts +0 -2
- package/lib/side-drawer/side-drawer.d.ts +0 -12
- package/lib/side-drawer/side-drawer.template.d.ts +0 -4
- package/lib/sidenav-item/index.d.ts +0 -3
- package/lib/sidenav-item/sidenav-item.d.ts +0 -6
- package/lib/sidenav-item/sidenav-item.template.d.ts +0 -4
- package/lib/text/index.d.ts +0 -2
- package/lib/text/text.d.ts +0 -10
- package/lib/text/text.template.d.ts +0 -4
- package/lib/text-anchor/index.d.ts +0 -2
- package/lib/text-anchor/text-anchor.d.ts +0 -7
- package/lib/text-anchor/text-anchor.template.d.ts +0 -4
- package/lib/tooltip/index.d.ts +0 -3
- package/lib/tooltip/tooltip.d.ts +0 -10
- package/lib/tooltip/tooltip.template.d.ts +0 -4
- package/popup/index.js +0 -2087
- package/progress/index.js +0 -98
- package/progress-ring/index.js +0 -76
- package/shared/_has.js +0 -58
- package/shared/affix.js +0 -29
- package/shared/anchor.js +0 -78
- package/shared/apply-mixins.js +0 -22
- package/shared/aria-global.js +0 -156
- package/shared/base-progress.js +0 -65
- package/shared/breadcrumb-item.js +0 -25
- package/shared/class-names.js +0 -15
- package/shared/design-system/index.d.ts +0 -3
- package/shared/es.object.assign.js +0 -68
- package/shared/icon.js +0 -1393
- package/shared/index.js +0 -4991
- package/shared/index2.js +0 -21
- package/shared/patterns/affix.d.ts +0 -9
- package/shared/slotted.js +0 -119
- package/shared/style-inject.es.js +0 -28
- package/shared/text-anchor.js +0 -21
- package/shared/text-anchor.template.js +0 -54
- package/shared/web.dom-collections.iterator.js +0 -1479
- package/shared/when.js +0 -15
- package/side-drawer/index.js +0 -103
- package/sidenav-item/index.js +0 -38
- package/styles/fonts/spezia.css +0 -23
- package/styles/themes/dark.css +0 -193
- package/styles/themes/light.css +0 -193
- package/text/index.js +0 -45
- package/text-anchor/index.js +0 -19
- package/tooltip/index.js +0 -73
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
+
import { breadcrumbTemplate as template } from '@microsoft/fast-foundation';
|
|
3
|
+
import { designSystem } from '../../shared/design-system';
|
|
4
|
+
import styles from './breadcrumb.scss';
|
|
5
|
+
import { Breadcrumb } from './breadcrumb';
|
|
6
|
+
|
|
7
|
+
export const vividBreadcrumb = Breadcrumb.compose<FoundationElementDefinition>({
|
|
8
|
+
baseName: 'breadcrumb',
|
|
9
|
+
template,
|
|
10
|
+
styles,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
designSystem.register(vividBreadcrumb());
|
|
@@ -0,0 +1,36 @@
|
|
|
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 = ['breadcrumb', 'breadcrumb-item'];
|
|
11
|
+
|
|
12
|
+
test('should show the component', async ({ page }: { page: Page }) => {
|
|
13
|
+
const template = extractHTMLBlocksFromReadme(
|
|
14
|
+
path.join(new URL('.', import.meta.url).pathname, 'README.md')
|
|
15
|
+
).reduce(
|
|
16
|
+
(htmlString: string, block: string) =>
|
|
17
|
+
`${htmlString} <div style="margin: 5px;">${block}</div>`,
|
|
18
|
+
''
|
|
19
|
+
);
|
|
20
|
+
await loadComponents({
|
|
21
|
+
page,
|
|
22
|
+
components,
|
|
23
|
+
});
|
|
24
|
+
await loadTemplate({
|
|
25
|
+
page,
|
|
26
|
+
template,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const testWrapper = await page.$('#wrapper');
|
|
30
|
+
|
|
31
|
+
await page.waitForLoadState('networkidle');
|
|
32
|
+
|
|
33
|
+
expect(await testWrapper?.screenshot()).toMatchSnapshot(
|
|
34
|
+
'./snapshots/breadcrumb.png'
|
|
35
|
+
);
|
|
36
|
+
});
|
|
Binary file
|
|
Binary file
|
package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Firefox-darwin.png
ADDED
|
Binary file
|
package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Firefox-linux.png
ADDED
|
Binary file
|
package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Safari-darwin.png
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# breadcrumb-item
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<script type="module">import '@vonage/vivid/breadcrumb-item';</script>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Link
|
|
8
|
+
|
|
9
|
+
```html preview
|
|
10
|
+
<vwc-breadcrumb-item
|
|
11
|
+
text="Breadcrumb"
|
|
12
|
+
href="https://vivid.vonage.com"></vwc-breadcrumb-item>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Text
|
|
16
|
+
|
|
17
|
+
```html preview
|
|
18
|
+
<vwc-breadcrumb-item
|
|
19
|
+
text="Breadcrumb" ></vwc-breadcrumb-item>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Combined
|
|
23
|
+
|
|
24
|
+
```html preview
|
|
25
|
+
<div style="display: flex">
|
|
26
|
+
<vwc-breadcrumb-item
|
|
27
|
+
text="Breadcrumb"
|
|
28
|
+
href="https://vivid.vonage.com"></vwc-breadcrumb-item>
|
|
29
|
+
|
|
30
|
+
<vwc-breadcrumb-item
|
|
31
|
+
text="Breadcrumb"
|
|
32
|
+
href="https://vivid.vonage.com"></vwc-breadcrumb-item>
|
|
33
|
+
|
|
34
|
+
<vwc-breadcrumb-item
|
|
35
|
+
text="..."></vwc-breadcrumb-item>
|
|
36
|
+
|
|
37
|
+
<vwc-breadcrumb-item
|
|
38
|
+
text="Breadcrumb" ></vwc-breadcrumb-item>
|
|
39
|
+
</div>
|
|
40
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use '../../../../shared/src/lib/sass/mixins/typography' as typography;
|
|
2
|
+
@use '../../../../../node_modules/@vonage/vivid-tokens/dist/sass/themes/consts' as theme-consts;
|
|
3
|
+
|
|
4
|
+
.breadcrumb-item {
|
|
5
|
+
@include typography.typography-cat-shorthand('body-2');
|
|
6
|
+
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
color: var(#{theme-consts.$vvd-color-neutral-70});
|
|
10
|
+
|
|
11
|
+
a {
|
|
12
|
+
color: var(--vvd-color-cta-70);
|
|
13
|
+
font: inherit;
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
a:hover {
|
|
18
|
+
text-decoration: underline;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
vwc-icon {
|
|
22
|
+
margin: 0 16px;
|
|
23
|
+
color: var(#{theme-consts.$vvd-color-on-canvas});
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {elementUpdated, fixture, getControlElement, setAttribute} from '@vivid-nx/shared';
|
|
2
|
+
import type {Icon} from '../icon/icon';
|
|
3
|
+
import { BreadcrumbItem } from './breadcrumb-item';
|
|
4
|
+
import '.';
|
|
5
|
+
|
|
6
|
+
const COMPONENT_TAG = 'vwc-breadcrumb-item';
|
|
7
|
+
|
|
8
|
+
describe('vwc-breadcrumb-item', () => {
|
|
9
|
+
|
|
10
|
+
let element: BreadcrumbItem;
|
|
11
|
+
|
|
12
|
+
beforeEach(async () => {
|
|
13
|
+
element = (await fixture(
|
|
14
|
+
`<${COMPONENT_TAG}></${COMPONENT_TAG}>`
|
|
15
|
+
)) as BreadcrumbItem;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should be initialized as a vwc-breadcrumb-item', async () => {
|
|
19
|
+
expect(element).toBeInstanceOf(BreadcrumbItem);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should display only icon when no prop is set', function () {
|
|
23
|
+
const controlElement = getControlElement(element);
|
|
24
|
+
const iconElementExists = Boolean(controlElement.querySelector(('vwc-icon')));
|
|
25
|
+
expect(iconElementExists).toEqual(true);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should be set as simple text when given only text', async function () {
|
|
29
|
+
const breadcrumbText = 'some text';
|
|
30
|
+
element.text = breadcrumbText;
|
|
31
|
+
await elementUpdated(element);
|
|
32
|
+
const controlElement = getControlElement(element);
|
|
33
|
+
expect(controlElement.textContent?.trim()).toEqual(breadcrumbText);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should set icon when "separator" is true', async function () {
|
|
37
|
+
const controlElement = getControlElement(element);
|
|
38
|
+
const iconElementExistsWhenSeparatorTrue = Boolean(controlElement.querySelector(('vwc-icon')));
|
|
39
|
+
|
|
40
|
+
element.separator = false;
|
|
41
|
+
await elementUpdated(element);
|
|
42
|
+
const iconElementExistsWithSeparatorFalse = Boolean(controlElement.querySelector(('vwc-icon')));
|
|
43
|
+
|
|
44
|
+
expect(iconElementExistsWithSeparatorFalse)
|
|
45
|
+
.toEqual(false);
|
|
46
|
+
expect(iconElementExistsWhenSeparatorTrue)
|
|
47
|
+
.toEqual(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should set as an anchor and icon when set with "href"', async function () {
|
|
51
|
+
const breadcrumbText = 'some text';
|
|
52
|
+
const href = 'https://google.com/';
|
|
53
|
+
element.text = breadcrumbText;
|
|
54
|
+
element.href = href;
|
|
55
|
+
await elementUpdated(element);
|
|
56
|
+
|
|
57
|
+
const controlElement = getControlElement(element);
|
|
58
|
+
const iconElement = controlElement.querySelector(('vwc-icon')) as Icon;
|
|
59
|
+
const anchorElement = controlElement.querySelector(('a'));
|
|
60
|
+
|
|
61
|
+
expect(anchorElement?.textContent?.trim()).toEqual(breadcrumbText);
|
|
62
|
+
expect((anchorElement as any)?.href).toEqual(element.href);
|
|
63
|
+
expect(iconElement?.type).toEqual('chevron-right-line');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe('bindings', () => {
|
|
67
|
+
|
|
68
|
+
beforeEach(async function () {
|
|
69
|
+
element.href = '#';
|
|
70
|
+
element.text = 'stam';
|
|
71
|
+
await elementUpdated(element);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
function getAnchorElement() {
|
|
78
|
+
const anchorElement = element.shadowRoot?.querySelector('a');
|
|
79
|
+
return anchorElement;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @param str
|
|
84
|
+
*/
|
|
85
|
+
function capitalizeFirstLetter(str: string) {
|
|
86
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
it('should set aria labels', async function () {
|
|
90
|
+
|
|
91
|
+
const ARIA_PROPS = [
|
|
92
|
+
'atomic', 'busy', 'controls', 'current', 'describedby',
|
|
93
|
+
'details', 'disabled', 'errormessage', 'expanded',
|
|
94
|
+
'flowto', 'haspopup', 'hidden', 'invalid', 'keyshortcuts',
|
|
95
|
+
'label', 'labelledby', 'live', 'owns', 'relevant', 'roledescription'
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
function setAriaLabelsOnElementObject() {
|
|
102
|
+
ARIA_PROPS.forEach(ariaProp => {
|
|
103
|
+
const ariaPropOnObject = `aria${capitalizeFirstLetter(ariaProp)}`;
|
|
104
|
+
(element as any)[ariaPropOnObject] = ariaProp;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const anchorElement = getAnchorElement();
|
|
109
|
+
|
|
110
|
+
setAriaLabelsOnElementObject();
|
|
111
|
+
await elementUpdated(element);
|
|
112
|
+
|
|
113
|
+
ARIA_PROPS.forEach(ariaProp => {
|
|
114
|
+
const ariaPropOnElement = `aria-${ariaProp}`;
|
|
115
|
+
|
|
116
|
+
expect(anchorElement?.getAttribute(ariaPropOnElement)).toEqual(ariaProp);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('should set the "href" attribute', async function () {
|
|
121
|
+
const attribute = 'href';
|
|
122
|
+
const anchorElement = getAnchorElement();
|
|
123
|
+
const text = 'stam';
|
|
124
|
+
await setAttribute(element, attribute, text);
|
|
125
|
+
|
|
126
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('should set the "hreflang" attribute', async function () {
|
|
130
|
+
const attribute = 'hreflang';
|
|
131
|
+
const anchorElement = getAnchorElement();
|
|
132
|
+
const text = 'stam';
|
|
133
|
+
await setAttribute(element, attribute, text);
|
|
134
|
+
|
|
135
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('should set the "download" attribute', async function () {
|
|
139
|
+
const attribute = 'download';
|
|
140
|
+
const anchorElement = getAnchorElement();
|
|
141
|
+
const text = 'stam';
|
|
142
|
+
await setAttribute(element, attribute, text);
|
|
143
|
+
|
|
144
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('should set the "ping" attribute', async function () {
|
|
148
|
+
const attribute = 'ping';
|
|
149
|
+
const anchorElement = getAnchorElement();
|
|
150
|
+
const text = 'stam';
|
|
151
|
+
await setAttribute(element, attribute, text);
|
|
152
|
+
|
|
153
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('should set the "referrerpolicy" attribute', async function () {
|
|
157
|
+
const attribute = 'referrerpolicy';
|
|
158
|
+
const anchorElement = getAnchorElement();
|
|
159
|
+
const text = 'stam';
|
|
160
|
+
await setAttribute(element, attribute, text);
|
|
161
|
+
|
|
162
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('should set the "rel" attribute', async function () {
|
|
166
|
+
const attribute = 'rel';
|
|
167
|
+
const anchorElement = getAnchorElement();
|
|
168
|
+
const text = 'stam';
|
|
169
|
+
await setAttribute(element, attribute, text);
|
|
170
|
+
|
|
171
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('should set the "target" attribute', async function () {
|
|
175
|
+
const attribute = 'target';
|
|
176
|
+
const anchorElement = getAnchorElement();
|
|
177
|
+
const text = 'stam';
|
|
178
|
+
await setAttribute(element, attribute, text);
|
|
179
|
+
|
|
180
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('should set the "type" attribute', async function () {
|
|
184
|
+
const attribute = 'type';
|
|
185
|
+
const anchorElement = getAnchorElement();
|
|
186
|
+
const text = 'stam';
|
|
187
|
+
await setAttribute(element, attribute, text);
|
|
188
|
+
|
|
189
|
+
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {html, when} from '@microsoft/fast-element';
|
|
2
|
+
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
3
|
+
import type {
|
|
4
|
+
ElementDefinitionContext,
|
|
5
|
+
FoundationElementDefinition,
|
|
6
|
+
} from '@microsoft/fast-foundation';
|
|
7
|
+
import { classNames } from '@microsoft/fast-web-utilities';
|
|
8
|
+
import {textAnchorTemplate} from '../text-anchor/text-anchor.template';
|
|
9
|
+
import type { BreadcrumbItem } from './breadcrumb-item';
|
|
10
|
+
|
|
11
|
+
const getClasses = (_: BreadcrumbItem) =>
|
|
12
|
+
classNames(
|
|
13
|
+
'control', 'breadcrumb-item'
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The template for the {@link @microsoft/fast-foundation#BreadcrumbItem} component.
|
|
18
|
+
*
|
|
19
|
+
* @param context
|
|
20
|
+
* @param definition
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export const BreadcrumbItemTemplate: (
|
|
24
|
+
context: ElementDefinitionContext,
|
|
25
|
+
definition: FoundationElementDefinition
|
|
26
|
+
) => ViewTemplate<BreadcrumbItem> =
|
|
27
|
+
(context: ElementDefinitionContext, definition: FoundationElementDefinition) => html`
|
|
28
|
+
<div roll="listitem" part="listitem" class="${getClasses}">
|
|
29
|
+
${when(x => x.text && !x.href,
|
|
30
|
+
html<BreadcrumbItem>`${x => x.text}`)}
|
|
31
|
+
|
|
32
|
+
${when(x => x.text && x.href && x.href.length > 0,
|
|
33
|
+
html<BreadcrumbItem>`${textAnchorTemplate(context, definition)}`)}
|
|
34
|
+
|
|
35
|
+
${when(x => x.separator,
|
|
36
|
+
html<BreadcrumbItem>`<vwc-icon type="chevron-right-line"></vwc-icon>`)}
|
|
37
|
+
</div>`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {BreadcrumbItem as FastBreadcrumbItem} from '@microsoft/fast-foundation';
|
|
2
|
+
import {attr} from '@microsoft/fast-element';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base class for breadcrumb-item
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export class BreadcrumbItem extends FastBreadcrumbItem {
|
|
10
|
+
@attr({ mode: 'fromView' }) text: string = '';
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '../icon';
|
|
2
|
+
|
|
3
|
+
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
4
|
+
import {designSystem} from '../../shared/design-system';
|
|
5
|
+
import styles from './breadcrumb-item.scss';
|
|
6
|
+
|
|
7
|
+
import {BreadcrumbItem} from './breadcrumb-item';
|
|
8
|
+
import {BreadcrumbItemTemplate as template} from './breadcrumb-item.template';
|
|
9
|
+
|
|
10
|
+
export const vividBreadcrumbItem = BreadcrumbItem.compose<FoundationElementDefinition>({
|
|
11
|
+
baseName: 'breadcrumb-item',
|
|
12
|
+
template: template as any,
|
|
13
|
+
styles,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
designSystem.register(vividBreadcrumbItem());
|
|
@@ -0,0 +1,38 @@
|
|
|
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 = ['breadcrumb-item'];
|
|
11
|
+
|
|
12
|
+
test('should show the component', async ({ page }: { page: Page }) => {
|
|
13
|
+
const template = extractHTMLBlocksFromReadme(
|
|
14
|
+
path.join(new URL('.', import.meta.url).pathname, 'README.md')
|
|
15
|
+
).reduce(
|
|
16
|
+
(htmlString: string, block: string) =>
|
|
17
|
+
`${htmlString} <div style="margin: 5px;">${block}</div>`,
|
|
18
|
+
''
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
await loadComponents({
|
|
22
|
+
page,
|
|
23
|
+
components,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
await loadTemplate({
|
|
27
|
+
page,
|
|
28
|
+
template,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const testWrapper = await page.$('#wrapper');
|
|
32
|
+
|
|
33
|
+
await page.waitForLoadState('networkidle');
|
|
34
|
+
|
|
35
|
+
expect(await testWrapper?.screenshot()).toMatchSnapshot(
|
|
36
|
+
'./snapshots/breadcrumb-item.png'
|
|
37
|
+
);
|
|
38
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# button
|
|
2
|
+
|
|
3
|
+
A button represents an action that the user can take. Use buttons to enable important actions.
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
<script type='module'>
|
|
7
|
+
import '@vonage/vivid/button';
|
|
8
|
+
</script>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Label
|
|
12
|
+
|
|
13
|
+
- Type: `String`
|
|
14
|
+
- Default: `''`
|
|
15
|
+
|
|
16
|
+
Add a `label` attribute to add text to the button.
|
|
17
|
+
|
|
18
|
+
```html preview
|
|
19
|
+
<vwc-button appearance='filled' label='A default button'></vwc-button>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Size
|
|
23
|
+
|
|
24
|
+
Use the `size` attribute to change the button's size.
|
|
25
|
+
|
|
26
|
+
- Type: `'base-small'` | `'base'` | `'base-large'`
|
|
27
|
+
- Default: `'base'`
|
|
28
|
+
|
|
29
|
+
```html preview
|
|
30
|
+
<vwc-button appearance='filled' label='base-small' size='base-small'></vwc-button>
|
|
31
|
+
<vwc-button appearance='filled' label='base' size='base'></vwc-button>
|
|
32
|
+
<vwc-button appearance='filled' label='base-large' size='base-large'></vwc-button>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Shape
|
|
36
|
+
|
|
37
|
+
Use the `shape` attribute to change the button's edges.
|
|
38
|
+
|
|
39
|
+
- Type: `'rounded'` | `'pill'`
|
|
40
|
+
- Default: `'rounded'`
|
|
41
|
+
|
|
42
|
+
```html preview
|
|
43
|
+
<vwc-button appearance='filled' label='rounded' shape='rounded'></vwc-button>
|
|
44
|
+
<vwc-button appearance='filled' label='pill' shape='pill'></vwc-button>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Icon
|
|
48
|
+
|
|
49
|
+
Button text can be affixed by a decorative icon, either by its start or end.
|
|
50
|
+
Use the `icon` attribute to add an icon. Use the `icon-trailing` to place the icon to the right.
|
|
51
|
+
|
|
52
|
+
```html preview
|
|
53
|
+
<vwc-button appearance="filled" label='icon' icon='check-line'></vwc-button>
|
|
54
|
+
<vwc-button appearance="filled" label='icon-trailing' icon='check-line' icon-trailing></vwc-button>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Icon Only
|
|
58
|
+
|
|
59
|
+
If label not applied...
|
|
60
|
+
|
|
61
|
+
```html preview
|
|
62
|
+
<vwc-button appearance="filled" icon='message-sent-line'></vwc-button>
|
|
63
|
+
<vwc-button appearance="filled" shape="pill" icon='message-sent-line'></vwc-button>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Appearance
|
|
67
|
+
|
|
68
|
+
Set the `appearance` attribute to change the button's appearance.
|
|
69
|
+
|
|
70
|
+
- Type: `'ghost'` | `'filled'` | `'outlined'`
|
|
71
|
+
- Default: `'ghost'`
|
|
72
|
+
|
|
73
|
+
```html preview
|
|
74
|
+
<vwc-button label='ghost' appearance='ghost'></vwc-button>
|
|
75
|
+
<vwc-button label='filled' appearance='filled'></vwc-button>
|
|
76
|
+
<vwc-button label='outlined' appearance='outlined'></vwc-button>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Connotation
|
|
80
|
+
|
|
81
|
+
Set the `connotation` attribute to change the button's connotation.
|
|
82
|
+
It accepts a subset of predefined values.
|
|
83
|
+
|
|
84
|
+
- Type: `'primary'` | `'cta'` | `'success'` | `'alert'` | `'announcement'` | `'info'`
|
|
85
|
+
- Default: `'primary'`
|
|
86
|
+
|
|
87
|
+
### Ghost button with connotation
|
|
88
|
+
|
|
89
|
+
```html preview
|
|
90
|
+
<vwc-button appearance="ghost" label='primary' connotation='primary'></vwc-button>
|
|
91
|
+
<vwc-button appearance="ghost" label='cta' connotation='cta'></vwc-button>
|
|
92
|
+
<vwc-button appearance="ghost" label='success' connotation='success'></vwc-button>
|
|
93
|
+
<vwc-button appearance="ghost" label='alert' connotation='alert'></vwc-button>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Filled button with connotation
|
|
97
|
+
|
|
98
|
+
```html preview
|
|
99
|
+
<vwc-button appearance="filled" label='primary' connotation='primary'></vwc-button>
|
|
100
|
+
<vwc-button appearance="filled" label='cta' connotation='cta'></vwc-button>
|
|
101
|
+
<vwc-button appearance="filled" label='success' connotation='success'></vwc-button>
|
|
102
|
+
<vwc-button appearance="filled" label='alert' connotation='alert'></vwc-button>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Outlined button with connotation
|
|
106
|
+
|
|
107
|
+
```html preview
|
|
108
|
+
<vwc-button appearance="outlined" label='primary' connotation='primary'></vwc-button>
|
|
109
|
+
<vwc-button appearance="outlined" label='cta' connotation='cta'></vwc-button>
|
|
110
|
+
<vwc-button appearance="outlined" label='success' connotation='success'></vwc-button>
|
|
111
|
+
<vwc-button appearance="outlined" label='alert' connotation='alert'></vwc-button>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## States
|
|
115
|
+
### Disabled
|
|
116
|
+
```html preview
|
|
117
|
+
<vwc-button disabled appearance='ghost' label='ghost'></vwc-button>
|
|
118
|
+
<vwc-button disabled appearance='filled' label='filled'></vwc-button>
|
|
119
|
+
<vwc-button disabled appearance='outlined' label='outlined'></vwc-button>
|
|
120
|
+
```
|