@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
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# accordion
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<script type="module">
|
|
5
|
-
import '@vonage/vivid/accordion';
|
|
6
|
-
</script>
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
```html preview
|
|
10
|
-
<vwc-accordion>
|
|
11
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
12
|
-
<vwc-text>content</vwc-text>
|
|
13
|
-
</vwc-accordion-item>
|
|
14
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
15
|
-
<vwc-text>content</vwc-text>
|
|
16
|
-
</vwc-accordion-item>
|
|
17
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
18
|
-
<vwc-text>content</vwc-text>
|
|
19
|
-
</vwc-accordion-item>
|
|
20
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
21
|
-
<vwc-text>content</vwc-text>
|
|
22
|
-
</vwc-accordion-item>
|
|
23
|
-
</vwc-accordion>
|
|
24
|
-
```
|
|
25
|
-
## Multi
|
|
26
|
-
Add the `multi` attribute to the accordion to allow multiple items to be open at once.
|
|
27
|
-
|
|
28
|
-
- Type: `boolean`
|
|
29
|
-
- Default: `false`
|
|
30
|
-
|
|
31
|
-
```html preview
|
|
32
|
-
<vwc-accordion multi>
|
|
33
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
34
|
-
<vwc-text>content</vwc-text>
|
|
35
|
-
</vwc-accordion-item>
|
|
36
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
37
|
-
<vwc-text>content</vwc-text>
|
|
38
|
-
</vwc-accordion-item>
|
|
39
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
40
|
-
<vwc-text>content</vwc-text>
|
|
41
|
-
</vwc-accordion-item>
|
|
42
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
43
|
-
<vwc-text>content</vwc-text>
|
|
44
|
-
</vwc-accordion-item>
|
|
45
|
-
</vwc-accordion>
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Methods
|
|
49
|
-
|
|
50
|
-
### CloseAll
|
|
51
|
-
|
|
52
|
-
- Type: function
|
|
53
|
-
- Returns: `void`
|
|
54
|
-
|
|
55
|
-
Closes all the accordion items from the open state.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
@use '../../../../../node_modules/@vonage/vivid-tokens/dist/sass/themes/consts' as theme-consts;
|
|
2
|
-
|
|
3
|
-
.control {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
::slotted(vwc-accordion-item:not(:only-of-type)) {
|
|
9
|
-
border-bottom: 1px solid var(#{theme-consts.$vvd-color-neutral-30});
|
|
10
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { elementUpdated, fixture } from '@vivid-nx/shared';
|
|
2
|
-
import type { AccordionItem } from '../accordion-item/accordion-item';
|
|
3
|
-
import { Accordion } from './accordion';
|
|
4
|
-
import '.';
|
|
5
|
-
import '../accordion-item';
|
|
6
|
-
|
|
7
|
-
const COMPONENT_TAG = 'vwc-accordion';
|
|
8
|
-
|
|
9
|
-
describe('vwc-accordion', () => {
|
|
10
|
-
let element: Accordion;
|
|
11
|
-
let accordionItem1: AccordionItem;
|
|
12
|
-
let accordionItem2: AccordionItem;
|
|
13
|
-
|
|
14
|
-
beforeEach(async () => {
|
|
15
|
-
element = (await fixture(
|
|
16
|
-
`<${COMPONENT_TAG}>
|
|
17
|
-
<vwc-accordion-item heading="accordion item" id="item1"><p>content</p></vwc-accordion-item>
|
|
18
|
-
<vwc-accordion-item heading="accordion item" id="item2"><p>content</p></vwc-accordion-item>
|
|
19
|
-
</${COMPONENT_TAG}>`
|
|
20
|
-
)) as Accordion;
|
|
21
|
-
await elementUpdated(element);
|
|
22
|
-
|
|
23
|
-
accordionItem1 = element.querySelector('#item1') as AccordionItem;
|
|
24
|
-
accordionItem2 = element.querySelector('#item2') as AccordionItem;
|
|
25
|
-
await elementUpdated(accordionItem1);
|
|
26
|
-
await elementUpdated(accordionItem2);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('basic', () => {
|
|
30
|
-
it('should be initialized as a vwc-accordion', async () => {
|
|
31
|
-
expect(element).toBeInstanceOf(Accordion);
|
|
32
|
-
expect(element.multi).toBeFalsy();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('non multi', () => {
|
|
37
|
-
it('should only allow one accordion items open at a time', async () => {
|
|
38
|
-
expect(accordionItem1.open).toBeFalsy();
|
|
39
|
-
expect(accordionItem2.open).toBeFalsy();
|
|
40
|
-
|
|
41
|
-
accordionItem1.open = true;
|
|
42
|
-
await elementUpdated(element);
|
|
43
|
-
accordionItem2.open = true;
|
|
44
|
-
await elementUpdated(element);
|
|
45
|
-
|
|
46
|
-
expect(accordionItem1.open).toBeFalsy();
|
|
47
|
-
expect(accordionItem2.open).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe('multi', () => {
|
|
52
|
-
it('should allow all accordion items open when multi', async () => {
|
|
53
|
-
element.multi = true;
|
|
54
|
-
await elementUpdated(element);
|
|
55
|
-
|
|
56
|
-
expect(accordionItem1.open).toBeFalsy();
|
|
57
|
-
expect(accordionItem2.open).toBeFalsy();
|
|
58
|
-
|
|
59
|
-
accordionItem1.open = true;
|
|
60
|
-
await elementUpdated(element);
|
|
61
|
-
accordionItem2.open = true;
|
|
62
|
-
await elementUpdated(element);
|
|
63
|
-
|
|
64
|
-
expect(accordionItem1.open).toBeTruthy();
|
|
65
|
-
expect(accordionItem2.open).toBeTruthy();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
describe('close all', () => {
|
|
71
|
-
it('should close all accordion items', async () => {
|
|
72
|
-
element.multi = true;
|
|
73
|
-
await elementUpdated(element);
|
|
74
|
-
|
|
75
|
-
accordionItem1.open = true;
|
|
76
|
-
await elementUpdated(element);
|
|
77
|
-
accordionItem2.open = true;
|
|
78
|
-
await elementUpdated(element);
|
|
79
|
-
|
|
80
|
-
expect(accordionItem1.open).toBeTruthy();
|
|
81
|
-
expect(accordionItem2.open).toBeTruthy();
|
|
82
|
-
|
|
83
|
-
element.closeAll();
|
|
84
|
-
await elementUpdated(element);
|
|
85
|
-
|
|
86
|
-
expect(accordionItem1.open).toBeFalsy();
|
|
87
|
-
expect(accordionItem2.open).toBeFalsy();
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
});
|
|
@@ -1,23 +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 { Accordion } from './accordion';
|
|
9
|
-
|
|
10
|
-
const getClasses = (_: Accordion) => classNames('control');
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param context
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export const AccordionTemplate: (
|
|
18
|
-
context: ElementDefinitionContext,
|
|
19
|
-
definition: FoundationElementDefinition
|
|
20
|
-
) => ViewTemplate<Accordion> = (
|
|
21
|
-
) => html`<div class="${getClasses}">
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</div>`;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
-
import type { AccordionItem } from '../accordion-item/accordion-item';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base class for accordion
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class Accordion extends FoundationElement {
|
|
11
|
-
private accordionItems: HTMLCollectionOf<AccordionItem> | undefined = undefined;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @public
|
|
16
|
-
* HTML Attribute: multi
|
|
17
|
-
*/
|
|
18
|
-
@attr({
|
|
19
|
-
mode: 'boolean',
|
|
20
|
-
}) multi = false;
|
|
21
|
-
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.addEventListener('opened', this.handleOpened);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
override connectedCallback(): void {
|
|
28
|
-
super.connectedCallback();
|
|
29
|
-
this.accordionItems = this.children as HTMLCollectionOf<AccordionItem>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
private handleOpened(e: Event): any {
|
|
33
|
-
if (!this.multi && this.accordionItems) {
|
|
34
|
-
for (let i = 0; i < this.accordionItems.length; i++) {
|
|
35
|
-
if (this.accordionItems[i] !== e.target) {
|
|
36
|
-
this.accordionItems[i].open = false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
closeAll(): void {
|
|
43
|
-
if (this.accordionItems) {
|
|
44
|
-
for (let i = 0; i < this.accordionItems.length; i++) {
|
|
45
|
-
this.accordionItems[i].open = false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
-
import { designSystem } from '../../shared/design-system';
|
|
3
|
-
import styles from './accordion.scss';
|
|
4
|
-
|
|
5
|
-
import { Accordion } from './accordion';
|
|
6
|
-
import { AccordionTemplate as template } from './accordion.template';
|
|
7
|
-
|
|
8
|
-
export const vividAccordion = Accordion.compose<FoundationElementDefinition>({
|
|
9
|
-
baseName: 'accordion',
|
|
10
|
-
template: template as any,
|
|
11
|
-
styles,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
designSystem.register(vividAccordion());
|
|
@@ -1,37 +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 = ['accordion','accordion-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
|
-
await loadTemplate({
|
|
26
|
-
page,
|
|
27
|
-
template,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const testWrapper = await page.$('#wrapper');
|
|
31
|
-
|
|
32
|
-
await page.waitForLoadState('networkidle');
|
|
33
|
-
|
|
34
|
-
expect(await testWrapper?.screenshot()).toMatchSnapshot(
|
|
35
|
-
'./snapshots/accordion.png'
|
|
36
|
-
);
|
|
37
|
-
});
|
|
Binary file
|
|
Binary file
|
package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Firefox-darwin.png
DELETED
|
Binary file
|
package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Firefox-linux.png
DELETED
|
Binary file
|
package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Safari-darwin.png
DELETED
|
Binary file
|
|
Binary file
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# accordion-item
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<script type="module">
|
|
5
|
-
import '@vonage/vivid/accordion-item';
|
|
6
|
-
</script>
|
|
7
|
-
```
|
|
8
|
-
## Heading
|
|
9
|
-
Add the `heading` attribute to set the heading text.
|
|
10
|
-
|
|
11
|
-
- Type: `string`
|
|
12
|
-
- Default: `''`
|
|
13
|
-
|
|
14
|
-
```html preview
|
|
15
|
-
<vwc-accordion-item heading="accordion item with heading">
|
|
16
|
-
<vwc-text font-face="body-1">
|
|
17
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
18
|
-
</vwc-text>
|
|
19
|
-
</vwc-accordion-item>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Heading-Level
|
|
23
|
-
|
|
24
|
-
Use the `heading-level` attribute (or `headingLevel` property) to set the accordion heading level so it fits correctly within the outline of the page. Read more on [heading elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements).
|
|
25
|
-
|
|
26
|
-
- Type: `2` | `3` | `4` | `5` | `6`
|
|
27
|
-
- Default: `3`
|
|
28
|
-
|
|
29
|
-
The following sets the heading of accordion-item to level 2
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
<vwc-accordion-item heading="my heading" heading-level="2"></vwc-accordion-item>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
which will output the shadow tree heading element to be rendered as a `<h2>` tag
|
|
36
|
-
|
|
37
|
-
e.g.
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
<h2 class="header">
|
|
41
|
-
<button>
|
|
42
|
-
<!-- ... -->
|
|
43
|
-
</button>
|
|
44
|
-
</h2>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Open
|
|
48
|
-
Use the `open` attribute to set the accordion-item's open state.
|
|
49
|
-
|
|
50
|
-
- Type: `boolean`
|
|
51
|
-
- Default: `false`
|
|
52
|
-
|
|
53
|
-
```html preview
|
|
54
|
-
<vwc-accordion-item heading="Click to toggle accordion item" open>
|
|
55
|
-
<vwc-text font-face="body-1">
|
|
56
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
57
|
-
</vwc-text>
|
|
58
|
-
</vwc-accordion-item>
|
|
59
|
-
```
|
|
60
|
-
## No-Indicator
|
|
61
|
-
Add the `no-indicator` attribute (or `noIndicator` property) to remove the indicator icon from the heading.
|
|
62
|
-
|
|
63
|
-
- Type: `boolean`
|
|
64
|
-
- Default: `false`
|
|
65
|
-
|
|
66
|
-
```html preview
|
|
67
|
-
<vwc-accordion-item heading="accordion item without indicator" no-indicator>
|
|
68
|
-
<vwc-text font-face="body-1">
|
|
69
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
70
|
-
</vwc-text>
|
|
71
|
-
</vwc-accordion-item>
|
|
72
|
-
```
|
|
73
|
-
## Meta
|
|
74
|
-
Add the `meta` attribute to add metadata to the heading.
|
|
75
|
-
|
|
76
|
-
- Type: `string`
|
|
77
|
-
- Default: `''`
|
|
78
|
-
|
|
79
|
-
```html preview
|
|
80
|
-
<vwc-accordion-item heading="accordion item with metadata" meta="meta-data">
|
|
81
|
-
<vwc-text font-face="body-1">
|
|
82
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
83
|
-
</vwc-text>
|
|
84
|
-
</vwc-accordion-item>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Icon
|
|
88
|
-
Add the `icon` attribute to add an icon to the heading.
|
|
89
|
-
|
|
90
|
-
- Type: `string`
|
|
91
|
-
- Default: `''`
|
|
92
|
-
|
|
93
|
-
```html preview
|
|
94
|
-
<vwc-accordion-item heading="accordion item with icon" icon="chat-solid">
|
|
95
|
-
<vwc-text font-face="body-1">
|
|
96
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
97
|
-
</vwc-text>
|
|
98
|
-
</vwc-accordion-item>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Icon-Trailing
|
|
102
|
-
Add the `icon-trailing` attribute (or `iconTrailing` property) to add an icon to the right of the heading text. Mind that `icon-trailing` will override the Indicator.
|
|
103
|
-
|
|
104
|
-
- Type: `boolean`
|
|
105
|
-
- Default: `false`
|
|
106
|
-
|
|
107
|
-
```html preview
|
|
108
|
-
<vwc-accordion-item heading="accordion item with icon-trailing" icon="chat-solid" icon-trailing>
|
|
109
|
-
<vwc-text font-face="body-1">
|
|
110
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
111
|
-
</vwc-text>
|
|
112
|
-
</vwc-accordion-item>
|
|
113
|
-
```
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
@use 'partials/variables' as variables;
|
|
2
|
-
@use '../../../../shared/src/lib/sass/mixins/typography' as typography;
|
|
3
|
-
@use '../../../../../node_modules/@vonage/vivid-tokens/dist/sass/themes/consts' as theme-consts;
|
|
4
|
-
|
|
5
|
-
.body {
|
|
6
|
-
@include typography.typography-cat-shorthand('body-2');
|
|
7
|
-
|
|
8
|
-
padding: 8px 32px 24px 16px;
|
|
9
|
-
.icon:not(.icon-trailing) &{
|
|
10
|
-
padding-left: 48px;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.control {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
|
|
18
|
-
&:not(.open) {
|
|
19
|
-
.toggle-close,
|
|
20
|
-
.body {
|
|
21
|
-
display: none;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
&.open{
|
|
25
|
-
.toggle-open {
|
|
26
|
-
display: none;
|
|
27
|
-
}
|
|
28
|
-
.toggle-close {
|
|
29
|
-
display: initial;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.header {
|
|
35
|
-
padding: 0;
|
|
36
|
-
margin: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.button {
|
|
40
|
-
@include typography.typography-cat-shorthand('subtitle-2');
|
|
41
|
-
|
|
42
|
-
position: relative;
|
|
43
|
-
display: flex;
|
|
44
|
-
width: 100%;
|
|
45
|
-
align-items: center;
|
|
46
|
-
padding: 16px;
|
|
47
|
-
border: 0 none;
|
|
48
|
-
background: transparent;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
|
|
51
|
-
&:hover {
|
|
52
|
-
background: var(#{theme-consts.$vvd-color-neutral-10});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.heading-text {
|
|
56
|
-
flex-grow: 1;
|
|
57
|
-
margin-inline-end: auto;
|
|
58
|
-
text-align: left;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.meta {
|
|
62
|
-
@include typography.typography-cat-shorthand('body-2-bold');
|
|
63
|
-
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
max-width: 20%;
|
|
66
|
-
flex-shrink: 0;
|
|
67
|
-
color: var(#{theme-consts.$vvd-color-neutral-70});
|
|
68
|
-
margin-inline-start: 1rem;
|
|
69
|
-
text-align: end;
|
|
70
|
-
text-overflow: ellipsis;
|
|
71
|
-
white-space: nowrap;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.indicator {
|
|
75
|
-
display: flex;
|
|
76
|
-
vwc-icon,
|
|
77
|
-
slot[name="indicator"i]::slotted(vwc-icon) {
|
|
78
|
-
margin-inline-start: 16px;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.icon {
|
|
83
|
-
margin-inline-end: 16px;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Icon */
|
|
88
|
-
|
|
89
|
-
.icon-trailing .icon {
|
|
90
|
-
order: 1;
|
|
91
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { elementUpdated, fixture, getControlElement } from '@vivid-nx/shared';
|
|
2
|
-
import { AccordionItem } from './accordion-item';
|
|
3
|
-
import '.';
|
|
4
|
-
|
|
5
|
-
const COMPONENT_TAG = 'vwc-accordion-item';
|
|
6
|
-
|
|
7
|
-
describe('vwc-accordion-item', () => {
|
|
8
|
-
let element: AccordionItem;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
element = (await fixture(
|
|
12
|
-
`<${COMPONENT_TAG}></${COMPONENT_TAG}>`
|
|
13
|
-
)) as AccordionItem;
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
describe('basic', () => {
|
|
17
|
-
it('should be initialized as a vwc-accordion-item', async () => {
|
|
18
|
-
expect(element).toBeInstanceOf(AccordionItem);
|
|
19
|
-
expect(element.open).toBeFalsy();
|
|
20
|
-
expect(element.icon).toBeUndefined();
|
|
21
|
-
expect(element.iconTrailing).toBeFalsy();
|
|
22
|
-
expect(element.meta).toEqual('');
|
|
23
|
-
expect(element.noIndicator).toBeFalsy();
|
|
24
|
-
expect(element.heading).toEqual('');
|
|
25
|
-
expect(element.headingLevel).toBeUndefined();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('show', () => {
|
|
30
|
-
it('should set "open" to true and add "open" class', async () => {
|
|
31
|
-
expect(getControlElement(element).classList.contains('open')).toBeFalsy();
|
|
32
|
-
|
|
33
|
-
element.open = true;
|
|
34
|
-
await elementUpdated(element);
|
|
35
|
-
expect(element.open).toBeTruthy();
|
|
36
|
-
expect(getControlElement(element).classList.contains('open')).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('hide', () => {
|
|
41
|
-
it('should unset "open"', async () => {
|
|
42
|
-
element.open = true;
|
|
43
|
-
await elementUpdated(element);
|
|
44
|
-
expect(getControlElement(element).classList.contains('open')).toBeTruthy();
|
|
45
|
-
|
|
46
|
-
element.open = false;
|
|
47
|
-
await elementUpdated(element);
|
|
48
|
-
expect(element.open).toBeFalsy();
|
|
49
|
-
expect(getControlElement(element).classList.contains('open')).toBeFalsy();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe('toggle', () => {
|
|
54
|
-
it('should toggle "open" state', async () => {
|
|
55
|
-
const button: any = element.shadowRoot?.querySelector('.button');
|
|
56
|
-
expect(getControlElement(element).classList.contains('open')).toBeFalsy();
|
|
57
|
-
|
|
58
|
-
button.click();
|
|
59
|
-
await elementUpdated(element);
|
|
60
|
-
expect(element.open).toBeTruthy();
|
|
61
|
-
expect(getControlElement(element).classList.contains('open')).toBeTruthy();
|
|
62
|
-
|
|
63
|
-
button.click();
|
|
64
|
-
await elementUpdated(element);
|
|
65
|
-
expect(element.open).toBeFalsy();
|
|
66
|
-
expect(getControlElement(element).classList.contains('open')).toBeFalsy();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe('icon', () => {
|
|
71
|
-
it('should set icon class', async () => {
|
|
72
|
-
expect(getControlElement(element).classList.contains('icon')).toBeFalsy();
|
|
73
|
-
element.icon = 'chat-solid';
|
|
74
|
-
await elementUpdated(element);
|
|
75
|
-
expect(getControlElement(element).classList.contains('icon')).toBeTruthy();
|
|
76
|
-
});
|
|
77
|
-
it('should set iconTrailing', async () => {
|
|
78
|
-
expect(getControlElement(element).classList.contains('icon-trailing')).toBeFalsy();
|
|
79
|
-
element.icon = 'chat-solid';
|
|
80
|
-
element.iconTrailing = true;
|
|
81
|
-
await elementUpdated(element);
|
|
82
|
-
expect(getControlElement(element).classList.contains('icon-trailing')).toBeTruthy();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe('no-indicator', () => {
|
|
87
|
-
it('should remove indicator class', async () => {
|
|
88
|
-
expect(getControlElement(element).classList.contains('no-indicator')).toBeFalsy();
|
|
89
|
-
element.noIndicator = true;
|
|
90
|
-
await elementUpdated(element);
|
|
91
|
-
expect(getControlElement(element).classList.contains('no-indicator')).toBeTruthy();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe('heading level', () => {
|
|
96
|
-
it('should update heading level', async () => {
|
|
97
|
-
expect(element.shadowRoot?.querySelector('.header')?.tagName).toEqual('H3');
|
|
98
|
-
element.headingLevel = 4;
|
|
99
|
-
await elementUpdated(element);
|
|
100
|
-
expect(element.shadowRoot?.querySelector('.header')?.tagName).toEqual('H4');
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
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 { affixIconTemplateFactory } from '../../shared/patterns/affix';
|
|
9
|
-
import type { AccordionItem } from './accordion-item';
|
|
10
|
-
|
|
11
|
-
const PANEL = 'panel';
|
|
12
|
-
|
|
13
|
-
const getClasses = ({
|
|
14
|
-
open, iconTrailing, icon, noIndicator
|
|
15
|
-
}: AccordionItem) => classNames(
|
|
16
|
-
'control',
|
|
17
|
-
['open', open],
|
|
18
|
-
['icon', Boolean(icon)],
|
|
19
|
-
['icon-trailing', iconTrailing],
|
|
20
|
-
['no-indicator', noIndicator],
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const AccordionItemTemplate: (
|
|
24
|
-
context: ElementDefinitionContext,
|
|
25
|
-
definition: FoundationElementDefinition
|
|
26
|
-
) => ViewTemplate<AccordionItem> = (context) => html<AccordionItem>`
|
|
27
|
-
<div class="${getClasses}">
|
|
28
|
-
${x => renderPanelHeader(context, x.headingLevel)}
|
|
29
|
-
<div class="body" id="${PANEL}" role="region" aria-labelledby="header">
|
|
30
|
-
<slot></slot>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const renderPanelHeader = (context: ElementDefinitionContext, headingLevel: number | string | undefined) => {
|
|
36
|
-
const header: string = headingLevel ? 'h' + headingLevel : 'h3';
|
|
37
|
-
return html<AccordionItem>`
|
|
38
|
-
<${header} class="header">
|
|
39
|
-
${renderHeaderButton(context)}
|
|
40
|
-
</${header}>
|
|
41
|
-
`;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const renderHeaderButton = (context: ElementDefinitionContext) => {
|
|
45
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
46
|
-
|
|
47
|
-
return html<AccordionItem>`
|
|
48
|
-
<button class="button" id="header" @click=${x => x.open = !x.open}
|
|
49
|
-
?aria-expanded=${x => x.open}
|
|
50
|
-
aria-controls="${PANEL}">
|
|
51
|
-
${x => affixIconTemplate(x.icon)}
|
|
52
|
-
<span class="heading-text">${x => x.heading}</span>
|
|
53
|
-
${when(x => x.meta, html`<span class="meta">${x => x.meta}</span>`)}
|
|
54
|
-
<span class="indicator">
|
|
55
|
-
${when(x => !x.noIndicator && !x.iconTrailing, html`
|
|
56
|
-
<vwc-icon class="toggle-open" type='chevron-down-solid'></vwc-icon>
|
|
57
|
-
<vwc-icon class="toggle-close" type='chevron-up-solid'></vwc-icon>
|
|
58
|
-
`)}
|
|
59
|
-
</span>
|
|
60
|
-
</button>
|
|
61
|
-
`;
|
|
62
|
-
};
|