@vonage/vivid 3.0.0-next.7 → 3.0.0-next.71
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/README.md +137 -4
- package/accordion/index.js +59 -0
- package/accordion-item/index.js +131 -0
- package/action-group/index.js +47 -0
- package/avatar/index.js +51 -0
- package/badge/index.js +58 -0
- package/banner/index.js +149 -0
- package/breadcrumb/index.js +103 -0
- package/breadcrumb-item/index.js +62 -0
- package/button/index.js +130 -0
- package/calendar/index.js +1563 -0
- package/calendar-event/index.js +115 -0
- package/card/index.js +132 -0
- package/checkbox/index.js +184 -0
- package/dialog/index.js +281 -0
- package/divider/index.js +86 -0
- package/elevation/index.js +3 -0
- package/fab/index.js +105 -0
- package/focus/index.js +18 -0
- package/header/index.js +66 -0
- package/icon/index.js +38 -0
- package/{src/index.ts → index.d.ts} +2 -2
- package/index.js +63 -0
- package/layout/index.js +51 -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 +4 -0
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/action-group/action-group.template.d.ts +4 -0
- package/lib/action-group/index.d.ts +2 -0
- package/lib/avatar/avatar.d.ts +14 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/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 +4 -0
- package/lib/banner/index.d.ts +3 -0
- package/lib/breadcrumb/breadcrumb.d.ts +3 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -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 +4 -0
- package/lib/button/button.d.ts +18 -0
- package/lib/button/button.template.d.ts +4 -0
- package/lib/button/index.d.ts +4 -0
- package/lib/calendar/calendar.d.ts +13 -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 +2 -0
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/card/card.template.d.ts +4 -0
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +32 -0
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +5 -0
- package/lib/elevation/elevation.template.d.ts +4 -0
- package/lib/elevation/index.d.ts +2 -0
- package/lib/enums.d.ts +51 -0
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -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/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +12 -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/menu/index.d.ts +12 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/index.d.ts +3 -0
- package/lib/menu-item/menu-item.d.ts +7 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/nav-item/nav-item.d.ts +6 -0
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/note/index.d.ts +2 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/popup/index.d.ts +4 -0
- package/lib/popup/popup.d.ts +18 -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 +7 -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 +9 -0
- package/lib/side-drawer/side-drawer.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/text-area/index.d.ts +3 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +16 -0
- package/lib/text-field/text-field.template.d.ts +5 -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/menu/index.js +380 -0
- package/menu-item/index.js +19 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +88 -0
- package/nav-item/index.js +45 -0
- package/note/index.js +66 -0
- package/package.json +56 -5
- package/popup/index.js +26 -0
- package/progress/index.js +105 -0
- package/progress-ring/index.js +80 -0
- package/shared/_has.js +58 -0
- package/shared/affix.js +29 -0
- package/shared/anchor.js +86 -0
- package/shared/apply-mixins.js +22 -0
- package/shared/aria-global.js +72 -0
- package/shared/base-progress.js +70 -0
- package/shared/breadcrumb-item.js +25 -0
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +26 -0
- package/shared/class-names.js +15 -0
- package/shared/design-system/index.d.ts +3 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +69 -0
- package/shared/export.js +995 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +299 -0
- package/shared/icon.js +1406 -0
- package/shared/index.js +5014 -0
- package/shared/index2.js +35 -0
- package/shared/index3.js +2117 -0
- package/shared/index4.js +371 -0
- package/shared/iterators.js +61 -0
- package/shared/key-codes.js +90 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/affix.d.ts +9 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements.d.ts +22 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/ref.js +41 -0
- package/shared/slotted.js +119 -0
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.js +12 -0
- package/shared/text-anchor.template.js +57 -0
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +474 -0
- package/shared/when.js +15 -0
- package/side-drawer/index.js +102 -0
- package/styles/core/all.css +75 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +69 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +20 -0
- package/styles/tokens/theme-dark.css +210 -0
- package/styles/tokens/theme-light.css +210 -0
- package/text-anchor/index.js +27 -0
- package/text-area/index.js +304 -0
- package/text-field/index.js +152 -0
- package/tooltip/index.js +71 -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/components.ts +0 -16
- 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/shared/patterns/index.ts +0 -1
- 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
package/src/lib/text/README.md
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# text
|
|
2
|
-
|
|
3
|
-
Represents a text custom element.
|
|
4
|
-
The component provisions the Vivid typography font faces and connotations supported by our design system.
|
|
5
|
-
|
|
6
|
-
```js
|
|
7
|
-
<script type='module'>
|
|
8
|
-
import '@vonage/vivid/text';
|
|
9
|
-
</script>
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Font face
|
|
13
|
-
|
|
14
|
-
Use the `font-face` attribute or `fontFace` property to change the text's font face.
|
|
15
|
-
|
|
16
|
-
- Type: `'headline-1'` | `'headline-2'` | `'title-1'` | `'title-2'` | `'subtitle-1'` | `'subtitle-2'` | `'body-1'` | `'body-1-bold'` | `'body-1-code'` | `'body-1-link'` | `'body-2'` | `'body-2-bold'` | `'body-2-code'` | `'body-2-link'` | `'caption'` | `'caption-bold'` | `'caption-code'` | `'caption-link'` | `'rounded'` | `'pill'`
|
|
17
|
-
- Default: `'body-1'`
|
|
18
|
-
|
|
19
|
-
```html preview
|
|
20
|
-
<vwc-text font-face="headline-1">headline-1</vwc-text>
|
|
21
|
-
<vwc-text font-face="headline-2">headline-2</vwc-text>
|
|
22
|
-
<vwc-text font-face="title-1">title-1</vwc-text>
|
|
23
|
-
<vwc-text font-face="title-2">title-2</vwc-text>
|
|
24
|
-
<vwc-text font-face="subtitle-1">subtitle-1</vwc-text>
|
|
25
|
-
<vwc-text font-face="subtitle-2">subtitle-2</vwc-text>
|
|
26
|
-
<vwc-text font-face="body-1">body-1</vwc-text>
|
|
27
|
-
<vwc-text font-face="body-1-bold">body-1-bold</vwc-text>
|
|
28
|
-
<vwc-text font-face="body-1-code">body-1-code</vwc-text>
|
|
29
|
-
<vwc-text font-face="body-1-link">body-1-link</vwc-text>
|
|
30
|
-
<vwc-text font-face="body-2">body-2</vwc-text>
|
|
31
|
-
<vwc-text font-face="body-2-bold">body-2-bold</vwc-text>
|
|
32
|
-
<vwc-text font-face="body-2-code">body-2-code</vwc-text>
|
|
33
|
-
<vwc-text font-face="body-2-link">body-2-link</vwc-text>
|
|
34
|
-
<vwc-text font-face="caption">caption</vwc-text><br>
|
|
35
|
-
<vwc-text font-face="caption-bold">caption-bold</vwc-text><br>
|
|
36
|
-
<vwc-text font-face="caption-code">caption-code</vwc-text><br>
|
|
37
|
-
<vwc-text font-face="caption-link">caption-link</vwc-text><br>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Tight
|
|
41
|
-
|
|
42
|
-
By default, some font faces are styled with block margins in accordance to article related context. enabling the `tight` attribute/property will opt-out.
|
|
43
|
-
|
|
44
|
-
- Type: `boolean`
|
|
45
|
-
- Default: `true`
|
|
46
|
-
|
|
47
|
-
```html preview
|
|
48
|
-
<style>
|
|
49
|
-
vwc-text[tight] {
|
|
50
|
-
display: block;
|
|
51
|
-
}
|
|
52
|
-
</style>
|
|
53
|
-
<vwc-text tight font-face="headline-1">headline-1</vwc-text>
|
|
54
|
-
<vwc-text tight font-face="headline-2">headline-2</vwc-text>
|
|
55
|
-
<vwc-text tight font-face="title-1">title-1</vwc-text>
|
|
56
|
-
<vwc-text tight font-face="title-2">title-2</vwc-text>
|
|
57
|
-
<vwc-text tight font-face="subtitle-1">subtitle-1</vwc-text>
|
|
58
|
-
<vwc-text tight font-face="subtitle-2">subtitle-2</vwc-text>
|
|
59
|
-
<vwc-text tight font-face="body-1">body-1</vwc-text>
|
|
60
|
-
<vwc-text tight font-face="body-1-bold">body-1-bold</vwc-text>
|
|
61
|
-
<vwc-text tight font-face="body-1-code">body-1-code</vwc-text>
|
|
62
|
-
<vwc-text tight font-face="body-1-link">body-1-link</vwc-text>
|
|
63
|
-
<vwc-text tight font-face="body-2">body-2</vwc-text>
|
|
64
|
-
<vwc-text tight font-face="body-2-bold">body-2-bold</vwc-text>
|
|
65
|
-
<vwc-text tight font-face="body-2-code">body-2-code</vwc-text>
|
|
66
|
-
<vwc-text tight font-face="body-2-link">body-2-link</vwc-text>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Connotation
|
|
70
|
-
|
|
71
|
-
Set the `connotation` attribute/property to change the text's connotated color.
|
|
72
|
-
It accepts a subset of predefined values.
|
|
73
|
-
|
|
74
|
-
- Type: `'primary'` | `'cta'` | `'success'` | `'alert'` | `'announcement'` | `'info'`
|
|
75
|
-
- Default: `undefined` (inherits `currentColor`)
|
|
76
|
-
|
|
77
|
-
```html preview
|
|
78
|
-
<vwc-text>undefined</vwc-text>
|
|
79
|
-
<vwc-text connotation='primary'>primary</vwc-text>
|
|
80
|
-
<vwc-text connotation='cta'>cta</vwc-text>
|
|
81
|
-
<vwc-text connotation='success'>success</vwc-text>
|
|
82
|
-
<vwc-text connotation='alert'>alert</vwc-text>
|
|
83
|
-
<vwc-text connotation='announcement'>announcement</vwc-text>
|
|
84
|
-
<vwc-text connotation='info'>info</vwc-text>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Semantic usage
|
|
88
|
-
|
|
89
|
-
HTML semantics indicates authoring intent and is important for accessibility, search engine optimizations and clear code.
|
|
90
|
-
Therefore, you'd probably need to nest html tags that apply different styling and may affect the font face appearance provided by the `vwc-text` element.
|
|
91
|
-
This component takes care of overriding the direct nested child within the component to `inherit` applied font face (if not over specified by the application styles).
|
|
92
|
-
|
|
93
|
-
custom elements (not extending a built-in native element with the is="" attribute) have a [transparent content model](https://html.spec.whatwg.org/multipage/dom.html#transparent-content-models).
|
|
94
|
-
|
|
95
|
-
This means they can be ignored when a parent is validating its own content model`s children.
|
|
96
|
-
|
|
97
|
-
note that web component cannot style or access any descendent greater than a direct child.
|
|
98
|
-
|
|
99
|
-
The following will generate a `caption` styled font face even though it's wrapped by a `h1` tag -
|
|
100
|
-
|
|
101
|
-
```html preview
|
|
102
|
-
<vwc-text font-face="caption">
|
|
103
|
-
<h1>
|
|
104
|
-
lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
105
|
-
</h1>
|
|
106
|
-
</vwc-text>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Alternatively, 'vwc-text' can, itself, nest within a semantic tag -
|
|
110
|
-
|
|
111
|
-
```html preview
|
|
112
|
-
<h1>
|
|
113
|
-
<vwc-text font-face="caption">
|
|
114
|
-
lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
115
|
-
</vwc-text>
|
|
116
|
-
</h1>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
More on [custom elements transparent content model](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts)
|
package/src/lib/text/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
-
import { designSystem } from '../../shared/design-system';
|
|
3
|
-
import styles from './text.scss';
|
|
4
|
-
|
|
5
|
-
import { Text } from './text';
|
|
6
|
-
import { TextTemplate as template } from './text.template';
|
|
7
|
-
|
|
8
|
-
export const vividText = Text.compose<FoundationElementDefinition>({
|
|
9
|
-
baseName: 'text',
|
|
10
|
-
template: template as any,
|
|
11
|
-
styles,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
designSystem.register(vividText());
|
package/src/lib/text/text.scss
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
@use 'sass:list';
|
|
3
|
-
@use '../../../../shared/src/lib/sass/mixins/typography' as typography;
|
|
4
|
-
@use '../../../../../node_modules/@vonage/vivid-tokens/dist/sass/typography/web' as typography-scale;
|
|
5
|
-
|
|
6
|
-
@use '../../../../shared/src/lib/sass/mixins/connotation/config' with (
|
|
7
|
-
$subset: primary cta success alert announcement info
|
|
8
|
-
);
|
|
9
|
-
@use '../../../../shared/src/lib/sass/mixins/connotation' as connotation;
|
|
10
|
-
|
|
11
|
-
$font-faces: ();
|
|
12
|
-
|
|
13
|
-
@each $key, $value in typography-scale.$typography-category-list {
|
|
14
|
-
$font-faces: list.join($font-faces, $key, $separator: comma)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@function get-default-selector($font-faces){
|
|
18
|
-
$classes: ();
|
|
19
|
-
|
|
20
|
-
@each $font-face in $font-faces {
|
|
21
|
-
$classes: list.join($classes, '.font-face-#{$font-face}', $separator: comma)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@return '&:not(#{$classes})';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
$default-selector: get-default-selector($font-faces);
|
|
28
|
-
|
|
29
|
-
%not-tight {
|
|
30
|
-
&:not(.tight) {
|
|
31
|
-
display: block;
|
|
32
|
-
margin: var(--font-face-margin, 0);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.control {
|
|
37
|
-
@each $font-face in $font-faces {
|
|
38
|
-
&.font-face-#{$font-face} {
|
|
39
|
-
@include typography.typography-cat-shorthand(#{$font-face});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
#{$default-selector} {
|
|
44
|
-
@include typography.typography-cat-shorthand('body-1');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@include connotation.connotation;
|
|
48
|
-
|
|
49
|
-
color: var(#{connotation.$vvd-color-connotation});
|
|
50
|
-
|
|
51
|
-
&.font-face-headline-1,
|
|
52
|
-
&.font-face-headline-2 {
|
|
53
|
-
--font-face-margin: 2.5rem 0;
|
|
54
|
-
@extend %not-tight;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.font-face-title-1,
|
|
58
|
-
&.font-face-title-2 {
|
|
59
|
-
--font-face-margin: 2rem 0;
|
|
60
|
-
@extend %not-tight;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&.font-face-subtitle-1,
|
|
64
|
-
&.font-face-subtitle-2 {
|
|
65
|
-
--font-face-margin: 1.5rem 0;
|
|
66
|
-
@extend %not-tight;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#{$default-selector},
|
|
70
|
-
&.font-face-body-1,
|
|
71
|
-
&.font-face-body-1-bold,
|
|
72
|
-
&.font-face-body-1-code,
|
|
73
|
-
&.font-face-body-1-link,
|
|
74
|
-
&.font-face-body-2,
|
|
75
|
-
&.font-face-body-2-bold,
|
|
76
|
-
&.font-face-body-2-code,
|
|
77
|
-
&.font-face-body-2-link {
|
|
78
|
-
--font-face-margin: 1rem 0;
|
|
79
|
-
@extend %not-tight;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
::slotted(:where(h1, h2, h3, h4, h5, h6, p)) {
|
|
84
|
-
margin: initial;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
::slotted(*) {
|
|
89
|
-
color: inherit;
|
|
90
|
-
font: inherit;
|
|
91
|
-
}
|
|
92
|
-
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { elementUpdated, fixture, getControlElement } from '@vivid-nx/shared';
|
|
2
|
-
import { Text } from './text';
|
|
3
|
-
import '.';
|
|
4
|
-
|
|
5
|
-
const COMPONENT_TAG = 'vwc-text';
|
|
6
|
-
|
|
7
|
-
describe('vwc-text', () => {
|
|
8
|
-
let element: Text;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
element = (await fixture(`<${COMPONENT_TAG}></${COMPONENT_TAG}>`)) as Text;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe('basic', () => {
|
|
15
|
-
it('should be initialized as a vwc-text', async () => {
|
|
16
|
-
expect(element).toBeInstanceOf(Text);
|
|
17
|
-
expect(element.connotation).toBeUndefined();
|
|
18
|
-
expect(element.fontFace).toBeUndefined();
|
|
19
|
-
expect(element.tight).toBeFalsy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('connotation', () => {
|
|
24
|
-
it('should set correct internal connotation style', async () => {
|
|
25
|
-
const connotation = 'info';
|
|
26
|
-
(element as any).connotation = connotation;
|
|
27
|
-
await elementUpdated(element);
|
|
28
|
-
|
|
29
|
-
const control = getControlElement(element);
|
|
30
|
-
expect(control.classList.contains(`connotation-${connotation}`)).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
describe('font face', () => {
|
|
35
|
-
it('should set correct internal font face style', async () => {
|
|
36
|
-
const fontFace = 'headline-2';
|
|
37
|
-
(element as any).fontFace = fontFace;
|
|
38
|
-
await elementUpdated(element);
|
|
39
|
-
|
|
40
|
-
const control = getControlElement(element);
|
|
41
|
-
expect(control.classList.contains(`font-face-${fontFace}`)).toBeTruthy();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('tight', () => {
|
|
46
|
-
it('should set correct internal tight style', async () => {
|
|
47
|
-
(element as any).tight = true;
|
|
48
|
-
await elementUpdated(element);
|
|
49
|
-
|
|
50
|
-
const control = getControlElement(element);
|
|
51
|
-
expect(control.classList.contains('tight')).toBeTruthy();
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { html } from '@microsoft/fast-element';
|
|
2
|
-
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
3
|
-
import type {
|
|
4
|
-
ElementDefinitionContext,
|
|
5
|
-
FoundationElementDefinition,
|
|
6
|
-
} from '@microsoft/fast-foundation';
|
|
7
|
-
import { classNames } from '@microsoft/fast-web-utilities';
|
|
8
|
-
import type { Text } from './text';
|
|
9
|
-
|
|
10
|
-
const getClasses = ({connotation, fontFace, tight}: Text) =>
|
|
11
|
-
classNames(
|
|
12
|
-
'control',
|
|
13
|
-
[`connotation-${connotation}`, Boolean(connotation)],
|
|
14
|
-
[`font-face-${fontFace}`, Boolean(fontFace)],
|
|
15
|
-
['tight', tight],
|
|
16
|
-
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The template for the {@link @microsoft/fast-foundation#Text} component.
|
|
21
|
-
*
|
|
22
|
-
* @param context
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export const TextTemplate: (
|
|
26
|
-
context: ElementDefinitionContext,
|
|
27
|
-
definition: FoundationElementDefinition
|
|
28
|
-
) => ViewTemplate<Text> = () => html`<slot class="${getClasses}"></slot>`;
|
package/src/lib/text/text.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import type { Connotation } from '../enums.js';
|
|
4
|
-
import type { VVDFontFace } from '../../../../../node_modules/@vonage/vivid-tokens/dist/types/typography/font-faces';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Types of Text connotation.
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
type TextConnotation = Extract<Connotation,
|
|
12
|
-
| Connotation.Primary
|
|
13
|
-
| Connotation.CTA
|
|
14
|
-
| Connotation.Success
|
|
15
|
-
| Connotation.Alert
|
|
16
|
-
| Connotation.Announcement
|
|
17
|
-
| Connotation.Info>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Base class for text
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export class Text extends FoundationElement {
|
|
25
|
-
/**
|
|
26
|
-
* The connotation the Text should have.
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
* @remarks
|
|
30
|
-
* HTML Attribute: connotation
|
|
31
|
-
*/
|
|
32
|
-
@attr connotation?: TextConnotation;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Indicates the icon affix alignment.
|
|
36
|
-
*
|
|
37
|
-
* @public
|
|
38
|
-
* @remarks
|
|
39
|
-
* HTML Attribute: icon-trailing
|
|
40
|
-
*/
|
|
41
|
-
@attr({
|
|
42
|
-
attribute: 'font-face',
|
|
43
|
-
}) fontFace?: VVDFontFace;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Indicates whether text should have margins.
|
|
47
|
-
*
|
|
48
|
-
* @public
|
|
49
|
-
* @remarks
|
|
50
|
-
* HTML Attribute: tight
|
|
51
|
-
*/
|
|
52
|
-
@attr({
|
|
53
|
-
mode: 'boolean',
|
|
54
|
-
}) tight = false;
|
|
55
|
-
}
|
package/src/lib/text/ui.test.ts
DELETED
|
@@ -1,39 +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 = ['text'];
|
|
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
|
-
)
|
|
16
|
-
.reduce(
|
|
17
|
-
(htmlString: string, block: string) =>
|
|
18
|
-
`${htmlString} <div style="margin: 5px;">${block}</div>`,
|
|
19
|
-
''
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
await loadComponents({
|
|
23
|
-
page,
|
|
24
|
-
components,
|
|
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())
|
|
36
|
-
.toMatchSnapshot(
|
|
37
|
-
'./snapshots/text.png'
|
|
38
|
-
);
|
|
39
|
-
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
-
import { designSystem } from '../../shared/design-system';
|
|
3
|
-
|
|
4
|
-
import { TextAnchor } from './text-anchor';
|
|
5
|
-
import { textAnchorTemplate as template } from './text-anchor.template';
|
|
6
|
-
|
|
7
|
-
export const vividTextAnchor = TextAnchor.compose<FoundationElementDefinition>({
|
|
8
|
-
baseName: 'text-anchor',
|
|
9
|
-
template: template as any,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
designSystem.register(vividTextAnchor());
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import {elementUpdated, fixture, setAttribute} from '@vivid-nx/shared';
|
|
2
|
-
import {TextAnchor} from './text-anchor';
|
|
3
|
-
import '.';
|
|
4
|
-
|
|
5
|
-
const COMPONENT_TAG = 'vwc-text-anchor';
|
|
6
|
-
|
|
7
|
-
describe( 'vwc-text-anchor', () => {
|
|
8
|
-
let element: TextAnchor;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
element = (await fixture(`<${COMPONENT_TAG}></${COMPONENT_TAG}>`)) as TextAnchor;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe('basic', () => {
|
|
15
|
-
it('should be initialized as a vwc-text-anchor', async () => {
|
|
16
|
-
expect(element).toBeInstanceOf(TextAnchor);
|
|
17
|
-
expect(element.text).toEqual('');
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
describe('text', () => {
|
|
22
|
-
it('set text property to node', async () => {
|
|
23
|
-
const text = 'lorem';
|
|
24
|
-
element.text = text;
|
|
25
|
-
await elementUpdated(element);
|
|
26
|
-
|
|
27
|
-
const { control } = element;
|
|
28
|
-
expect(control?.textContent?.trim())
|
|
29
|
-
.toEqual(text);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
function getAnchorElement() {
|
|
37
|
-
const anchorElement = element.shadowRoot?.querySelector('a');
|
|
38
|
-
return anchorElement;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
describe('bindings', () => {
|
|
43
|
-
/**
|
|
44
|
-
* @param str
|
|
45
|
-
*/
|
|
46
|
-
function capitalizeFirstLetter(str: string) {
|
|
47
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
it('should set aria labels', async function () {
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
function setAriaLabelsOnElementObject() {
|
|
56
|
-
ARIA_PROPS.forEach(ariaProp => {
|
|
57
|
-
const ariaPropOnObject = `aria${capitalizeFirstLetter(ariaProp)}`;
|
|
58
|
-
(element as any)[ariaPropOnObject] = ariaProp;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const ARIA_PROPS = [
|
|
63
|
-
'atomic', 'busy', 'controls', 'current', 'describedby',
|
|
64
|
-
'details', 'disabled', 'errormessage', 'expanded',
|
|
65
|
-
'flowto', 'haspopup', 'hidden', 'invalid', 'keyshortcuts',
|
|
66
|
-
'label', 'labelledby', 'live', 'owns', 'relevant', 'roledescription'
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
const anchorElement = getAnchorElement();
|
|
70
|
-
|
|
71
|
-
setAriaLabelsOnElementObject();
|
|
72
|
-
await elementUpdated(element);
|
|
73
|
-
|
|
74
|
-
ARIA_PROPS.forEach(ariaProp => {
|
|
75
|
-
const ariaPropOnElement = `aria-${ariaProp}`;
|
|
76
|
-
|
|
77
|
-
expect(anchorElement?.getAttribute(ariaPropOnElement)).toEqual(ariaProp);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('should set the "href" attribute', async function () {
|
|
82
|
-
const attribute = 'href';
|
|
83
|
-
const anchorElement = getAnchorElement();
|
|
84
|
-
const text = 'stam';
|
|
85
|
-
await setAttribute(element, attribute, text);
|
|
86
|
-
|
|
87
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should set the "hreflang" attribute', async function () {
|
|
91
|
-
const attribute = 'hreflang';
|
|
92
|
-
const anchorElement = getAnchorElement();
|
|
93
|
-
const text = 'stam';
|
|
94
|
-
await setAttribute(element, attribute, text);
|
|
95
|
-
|
|
96
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should set the "download" attribute', async function () {
|
|
100
|
-
const attribute = 'download';
|
|
101
|
-
const anchorElement = getAnchorElement();
|
|
102
|
-
const text = 'stam';
|
|
103
|
-
await setAttribute(element, attribute, text);
|
|
104
|
-
|
|
105
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('should set the "ping" attribute', async function () {
|
|
109
|
-
const attribute = 'ping';
|
|
110
|
-
const anchorElement = getAnchorElement();
|
|
111
|
-
const text = 'stam';
|
|
112
|
-
await setAttribute(element, attribute, text);
|
|
113
|
-
|
|
114
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('should set the "referrerpolicy" attribute', async function () {
|
|
118
|
-
const attribute = 'referrerpolicy';
|
|
119
|
-
const anchorElement = getAnchorElement();
|
|
120
|
-
const text = 'stam';
|
|
121
|
-
await setAttribute(element, attribute, text);
|
|
122
|
-
|
|
123
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should set the "rel" attribute', async function () {
|
|
127
|
-
const attribute = 'rel';
|
|
128
|
-
const anchorElement = getAnchorElement();
|
|
129
|
-
const text = 'stam';
|
|
130
|
-
await setAttribute(element, attribute, text);
|
|
131
|
-
|
|
132
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('should set the "target" attribute', async function () {
|
|
136
|
-
const attribute = 'target';
|
|
137
|
-
const anchorElement = getAnchorElement();
|
|
138
|
-
const text = 'stam';
|
|
139
|
-
await setAttribute(element, attribute, text);
|
|
140
|
-
|
|
141
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('should set the "type" attribute', async function () {
|
|
145
|
-
const attribute = 'type';
|
|
146
|
-
const anchorElement = getAnchorElement();
|
|
147
|
-
const text = 'stam';
|
|
148
|
-
await setAttribute(element, attribute, text);
|
|
149
|
-
|
|
150
|
-
expect(anchorElement?.getAttribute(attribute)).toEqual(text);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { html, ref } from '@microsoft/fast-element';
|
|
2
|
-
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
3
|
-
import type {
|
|
4
|
-
ElementDefinitionContext,
|
|
5
|
-
FoundationElementDefinition,
|
|
6
|
-
} from '@microsoft/fast-foundation';
|
|
7
|
-
import { classNames } from '@microsoft/fast-web-utilities';
|
|
8
|
-
import { affixIconTemplateFactory } from '../../shared/patterns/affix';
|
|
9
|
-
import type { TextAnchor } from './text-anchor';
|
|
10
|
-
|
|
11
|
-
const getClasses = ({text, icon}: TextAnchor) => classNames(
|
|
12
|
-
'control',
|
|
13
|
-
['icon-only', !text && !!icon],
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The template for the {@link @microsoft/fast-foundation#(Anchor:class)} component.
|
|
18
|
-
*
|
|
19
|
-
* @param context
|
|
20
|
-
* @param definition
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export const textAnchorTemplate: (
|
|
24
|
-
context: ElementDefinitionContext,
|
|
25
|
-
definition: FoundationElementDefinition
|
|
26
|
-
) => ViewTemplate<TextAnchor> = (
|
|
27
|
-
context: ElementDefinitionContext,
|
|
28
|
-
) => {
|
|
29
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
30
|
-
|
|
31
|
-
return html`<a
|
|
32
|
-
class="${getClasses}"
|
|
33
|
-
download="${x => x.download}"
|
|
34
|
-
href="${x => x.href}"
|
|
35
|
-
hreflang="${x => x.hreflang}"
|
|
36
|
-
ping="${x => x.ping}"
|
|
37
|
-
referrerpolicy="${x => x.referrerpolicy}"
|
|
38
|
-
rel="${x => x.rel}"
|
|
39
|
-
target="${x => x.target}"
|
|
40
|
-
type="${x => x.type}"
|
|
41
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
42
|
-
aria-busy="${x => x.ariaBusy}"
|
|
43
|
-
aria-controls="${x => x.ariaControls}"
|
|
44
|
-
aria-current="${x => x.ariaCurrent}"
|
|
45
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
46
|
-
aria-details="${x => x.ariaDetails}"
|
|
47
|
-
aria-disabled="${x => x.ariaDisabled}"
|
|
48
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
49
|
-
aria-expanded="${x => x.ariaExpanded}"
|
|
50
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
51
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
52
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
53
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
54
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
55
|
-
aria-label="${x => x.ariaLabel}"
|
|
56
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
57
|
-
aria-live="${x => x.ariaLive}"
|
|
58
|
-
aria-owns="${x => x.ariaOwns}"
|
|
59
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
60
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
61
|
-
${ref('control')}
|
|
62
|
-
>
|
|
63
|
-
${x => affixIconTemplate(x.icon)}
|
|
64
|
-
${x => x.text}
|
|
65
|
-
</a>
|
|
66
|
-
`;};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Anchor, applyMixins } from '@microsoft/fast-foundation';
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import { AffixIcon } from '../../shared/patterns/affix';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base class for text-anchor
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class TextAnchor extends Anchor {
|
|
11
|
-
/**
|
|
12
|
-
* Indicates the text anchor's text.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
* @remarks
|
|
16
|
-
* HTML Attribute: text
|
|
17
|
-
*/
|
|
18
|
-
@attr({ mode: 'fromView' }) text = '';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface TextAnchor extends AffixIcon {}
|
|
22
|
-
applyMixins(TextAnchor, AffixIcon);
|