@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/README.md
CHANGED
|
@@ -1,7 +1,140 @@
|
|
|
1
|
-
# components
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
# Vivid UI
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
Essential UI **web components** for building modern web applications, bound to provide a **safe**, **simple** and **intuitive** interface.
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
To integrate Vivid components into your project, run:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @vonage/vivid # or yarn add @vonage/vivid
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Import components in your project via [side effect imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#import_a_module_for_its_side_effects_only):
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import '@vonage/vivid/button';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
And include in HTML:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<vwc-button label="Click me"></vwc-button>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For a full list of components and API, explore the [components docs](https://vivid.deno.dev/components/accordion/) 📚.
|
|
31
|
+
|
|
32
|
+
### Tokens (Prerequisite)
|
|
33
|
+
|
|
34
|
+
The Vivid components library rely on a set of **design tokens** (in the form of css custom properties).
|
|
35
|
+
|
|
36
|
+
Tokens should not affect the look of the application rather just provide a common set of identities (such as colors, typography, spacing etc') to be used by the components to look as intended.
|
|
37
|
+
|
|
38
|
+
As the task of loading css is not trivial, and may vary from project to project, this library does not provide any way to load the css. It is up to the author to load the css in the most appropriate manner for their project.
|
|
39
|
+
|
|
40
|
+
To **include the styles**, css files must be loaded into the project from the `node_modules/@vonage/vivid/styles/tokens` folder and *require a `vvd-root` class* selector to be present on the wrapping element (advisably `:root`).
|
|
41
|
+
|
|
42
|
+
Folder contains the following files:
|
|
43
|
+
|
|
44
|
+
- `theme-light.css` - Light theme
|
|
45
|
+
|
|
46
|
+
- `theme-dark.css` - Dark theme
|
|
47
|
+
|
|
48
|
+
Only one theme is required to be loaded.
|
|
49
|
+
|
|
50
|
+
### Fonts (Prerequisite)
|
|
51
|
+
|
|
52
|
+
- `node_modules/@vonage/vivid/styles/fonts/spezia.css` - Loads the *Spezia* variable font and defines its font face values. *Spezia* is Vonage's branded font and is required by most Vivid components. folder also contains the font files.
|
|
53
|
+
|
|
54
|
+
Note that font files are not included within the css file, and must be copied to application assets separately (within the same parsed css folder). This is to allow the author to choose the most appropriate way to load the font files based on their project.
|
|
55
|
+
|
|
56
|
+
### Styles (Optional)
|
|
57
|
+
|
|
58
|
+
In Addition, this library provides a set of styles (combined with the tokens and fonts) that can be used to embody the Vivid design system into an application.
|
|
59
|
+
|
|
60
|
+
These styles are not required by vivid components directly. however, they do rely on the tokens and fonts 👆 to be loaded as components do.
|
|
61
|
+
|
|
62
|
+
- `node_modules/@vonage/vivid/styles/core/theme.css` - Sets theme related styles
|
|
63
|
+
|
|
64
|
+
- `node_modules/@vonage/vivid/styles/core/typography.css` - Sets typography related styles
|
|
65
|
+
|
|
66
|
+
- `node_modules/@vonage/vivid/styles/core/all.css` - Sets all the above styles
|
|
67
|
+
|
|
68
|
+
Note: scss users can simply [forward](https://sass-lang.com/documentation/at-rules/forward) the styles to their scss project:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
@forward 'node_modules/@vonage/vivid/styles/[path to file].css';
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Support
|
|
75
|
+
|
|
76
|
+
This library is open source, developed and maintained by the [Vonage Vivid team](Vonage/vivid).
|
|
77
|
+
|
|
78
|
+
For any questions, please open a [bug report](https://github.com/Vonage/vivid-3/issues/new?assignees=&labels=&template=bug_report.md&title=) or [feature request](https://github.com/Vonage/vivid-3/issues/new?assignees=&labels=&template=feature_request.md&title=).
|
|
79
|
+
|
|
80
|
+
## Roadmap
|
|
81
|
+
|
|
82
|
+
- View [components status](https://github.com/orgs/Vonage/projects/6)
|
|
83
|
+
|
|
84
|
+
- [What's on our plate](https://github.com/orgs/Vonage/projects/3/views/7)
|
|
85
|
+
|
|
86
|
+
- See the [open issues](https://github.com/vonage/vivid-3/issues) for a full list of proposed features (and known issues).
|
|
87
|
+
|
|
88
|
+
We publish a *next* release on every successful merge to main, so you never need to wait for a new stable version to make use of any updates.
|
|
89
|
+
|
|
90
|
+
## Contributing
|
|
91
|
+
|
|
92
|
+
Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
|
93
|
+
|
|
94
|
+
## Versioning
|
|
95
|
+
|
|
96
|
+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [npm page](https://www.npmjs.com/package/@vonage/vivid).
|
|
97
|
+
|
|
98
|
+
## Authors
|
|
99
|
+
|
|
100
|
+
See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
This project is licensed under the Apache 2.0 License - see the [LICENSE.md](LICENSE.md) file for details
|
|
105
|
+
|
|
106
|
+
<!-- ## Acknowledgments
|
|
107
|
+
|
|
108
|
+
- Hat tip to anyone whose code was used
|
|
109
|
+
- Inspiration
|
|
110
|
+
- etc -->
|
|
111
|
+
|
|
112
|
+
## Built With
|
|
113
|
+
|
|
114
|
+
- [Fast](https://www.fast.design) - to extend element classes and compile code to native web components
|
|
115
|
+
- [Typescript](https://www.typescriptlang.org) - for ergonomic and type-safe code
|
|
116
|
+
- [Sass](https://sass-lang.com) - for styles authoring extensibility and consistency
|
|
117
|
+
|
|
118
|
+
## Quickstart
|
|
119
|
+
|
|
120
|
+
Global content delivery networks can help quickly integrate content within html pages, fetching content from an URL, skipping local builds entirely.
|
|
121
|
+
Such practice is often used when working on POCs or reproduction environments.
|
|
122
|
+
Tools like [UNPKG](https://unpkg.com), [jsDeliver](https://www.jsdelivr.com), [Skypack](https://www.skypack.dev) etc' are bound to deliver any content registered in the npm registry.
|
|
123
|
+
|
|
124
|
+
The following snippet fully renders a Vivid button component
|
|
125
|
+
|
|
126
|
+
```html
|
|
127
|
+
<!-- import spezia font -->
|
|
128
|
+
<link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/fonts/spezia.css">
|
|
129
|
+
|
|
130
|
+
<!-- import light theme style tokens -->
|
|
131
|
+
<link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/tokens/theme-light.css">
|
|
132
|
+
|
|
133
|
+
<!-- import typography for desktop -->
|
|
134
|
+
<link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/typography/desktop.css">
|
|
135
|
+
|
|
136
|
+
<!-- import Vivid button component -->
|
|
137
|
+
<script type="module" src="https://unpkg.com/@vonage/vivid@next/button/index.js"></script>
|
|
138
|
+
|
|
139
|
+
<vwc-button label="Click me" appearance="filled" connotation="cta"></vwc-button>
|
|
140
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\n.base {\n display: flex;\n flex-direction: column;\n}\n\n::slotted(vwc-accordion-item:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-200);\n}";
|
|
5
|
+
|
|
6
|
+
class Accordion extends FoundationElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.accordionItems = undefined;
|
|
10
|
+
this.multi = false;
|
|
11
|
+
this.addEventListener('opened', this.handleOpened);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
super.connectedCallback();
|
|
16
|
+
this.accordionItems = this.children;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
handleOpened(e) {
|
|
20
|
+
if (!this.multi && this.accordionItems) {
|
|
21
|
+
for (let i = 0; i < this.accordionItems.length; i++) {
|
|
22
|
+
if (this.accordionItems[i] !== e.target) {
|
|
23
|
+
this.accordionItems[i].open = false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
closeAll() {
|
|
30
|
+
if (this.accordionItems) {
|
|
31
|
+
for (let i = 0; i < this.accordionItems.length; i++) {
|
|
32
|
+
this.accordionItems[i].open = false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
__decorate([attr({
|
|
40
|
+
mode: 'boolean'
|
|
41
|
+
}), __metadata("design:type", Object)], Accordion.prototype, "multi", void 0);
|
|
42
|
+
|
|
43
|
+
let _2 = t => t,
|
|
44
|
+
_t;
|
|
45
|
+
|
|
46
|
+
const getClasses = _ => classNames('base');
|
|
47
|
+
|
|
48
|
+
const AccordionTemplate = () => html(_t || (_t = _2`<div class="${0}">
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</div>`), getClasses);
|
|
51
|
+
|
|
52
|
+
const vividAccordion = Accordion.compose({
|
|
53
|
+
baseName: 'accordion',
|
|
54
|
+
template: AccordionTemplate,
|
|
55
|
+
styles: css_248z
|
|
56
|
+
});
|
|
57
|
+
designSystem.register(vividAccordion());
|
|
58
|
+
|
|
59
|
+
export { vividAccordion };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import '../focus/index.js';
|
|
3
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
4
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
5
|
+
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
6
|
+
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
+
import { f as focusTemplateFactory } from '../shared/focus2.js';
|
|
8
|
+
import { w as when } from '../shared/when.js';
|
|
9
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
10
|
+
import '../shared/icon.js';
|
|
11
|
+
import '../shared/export.js';
|
|
12
|
+
import '../shared/iterators.js';
|
|
13
|
+
import '../shared/to-string.js';
|
|
14
|
+
import '../shared/_has.js';
|
|
15
|
+
import '../shared/focus.js';
|
|
16
|
+
import '../shared/object-keys.js';
|
|
17
|
+
|
|
18
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\n.body {\n padding: 8px 32px 24px 16px;\n font: var(--vvd-font-base);\n}\n.icon:not(.icon-trailing) .body {\n padding-left: 48px;\n}\n\n.base {\n display: flex;\n flex-direction: column;\n}\n.base:not(.open) .body {\n display: none;\n}\n\n.header {\n padding: 0;\n margin: 0;\n}\n\n.button {\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 16px;\n border: 0 none;\n margin: 0;\n background-color: var(--_appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n cursor: pointer;\n font: var(--vvd-font-heading4);\n}\n.button {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.button:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transaprent;\n}\n.button:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transaprent;\n}\n.button {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n}\n@supports selector(:focus-visible) {\n .button:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .button {\n user-select: none;\n }\n}\n.button .heading-text {\n flex-grow: 1;\n margin-inline-end: auto;\n text-align: left;\n}\n.button .meta {\n overflow: hidden;\n max-width: 20%;\n flex-shrink: 0;\n color: var(--vvd-color-neutral-600);\n font: var(--vvd-font-base-bold);\n margin-inline-start: 16px;\n text-align: end;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.button .indicator {\n display: flex;\n}\n.button .indicator vwc-icon,\n.button .indicator slot[name=indicator i]::slotted(vwc-icon) {\n margin-inline-start: 16px;\n}\n.button .icon {\n margin-inline-end: 16px;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}\n\n.button:not(:focus-visible) > .focus-indicator {\n display: none;\n}";
|
|
19
|
+
|
|
20
|
+
class AccordionItem extends FoundationElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.noIndicator = false;
|
|
24
|
+
this.open = false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
28
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
29
|
+
|
|
30
|
+
if (name === 'open') {
|
|
31
|
+
newValue === null ? this.emitEvent('closed') : this.emitEvent('opened');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
emitEvent(name) {
|
|
36
|
+
const init = {
|
|
37
|
+
bubbles: true,
|
|
38
|
+
composed: true
|
|
39
|
+
};
|
|
40
|
+
const ev = new CustomEvent(name, init);
|
|
41
|
+
this.dispatchEvent(ev);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
__decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "heading", void 0);
|
|
47
|
+
|
|
48
|
+
__decorate([attr({
|
|
49
|
+
attribute: 'heading-level'
|
|
50
|
+
}), __metadata("design:type", Number)], AccordionItem.prototype, "headingLevel", void 0);
|
|
51
|
+
|
|
52
|
+
__decorate([attr({
|
|
53
|
+
mode: 'boolean',
|
|
54
|
+
attribute: 'no-indicator'
|
|
55
|
+
}), __metadata("design:type", Object)], AccordionItem.prototype, "noIndicator", void 0);
|
|
56
|
+
|
|
57
|
+
__decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "meta", void 0);
|
|
58
|
+
|
|
59
|
+
__decorate([attr({
|
|
60
|
+
mode: 'boolean'
|
|
61
|
+
}), __metadata("design:type", Object)], AccordionItem.prototype, "open", void 0);
|
|
62
|
+
|
|
63
|
+
applyMixins(AccordionItem, AffixIconWithTrailing);
|
|
64
|
+
|
|
65
|
+
let _ = t => t,
|
|
66
|
+
_t,
|
|
67
|
+
_t2,
|
|
68
|
+
_t3,
|
|
69
|
+
_t4,
|
|
70
|
+
_t5,
|
|
71
|
+
_t6,
|
|
72
|
+
_t7;
|
|
73
|
+
const PANEL = 'panel';
|
|
74
|
+
|
|
75
|
+
const getClasses = ({
|
|
76
|
+
open,
|
|
77
|
+
iconTrailing,
|
|
78
|
+
icon,
|
|
79
|
+
noIndicator
|
|
80
|
+
}) => classNames('base', ['open', open], ['icon', Boolean(icon)], ['icon-trailing', iconTrailing], ['no-indicator', noIndicator]);
|
|
81
|
+
|
|
82
|
+
const AccordionItemTemplate = context => html(_t || (_t = _`
|
|
83
|
+
<div class="${0}">
|
|
84
|
+
${0}
|
|
85
|
+
<div class="body" id="${0}" role="region" aria-labelledby="header">
|
|
86
|
+
<slot></slot>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
`), getClasses, x => renderPanelHeader(context, x.headingLevel), PANEL);
|
|
90
|
+
|
|
91
|
+
const renderPanelHeader = (context, headingLevel) => {
|
|
92
|
+
const header = headingLevel ? 'h' + headingLevel : 'h3';
|
|
93
|
+
return html(_t2 || (_t2 = _`
|
|
94
|
+
<${0} class="header">
|
|
95
|
+
${0}
|
|
96
|
+
</${0}>
|
|
97
|
+
`), header, renderHeaderButton(context), header);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const renderHeaderButton = context => {
|
|
101
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
102
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
103
|
+
return html(_t3 || (_t3 = _`
|
|
104
|
+
<button class="button" id="header" @click=${0}
|
|
105
|
+
aria-expanded=${0}
|
|
106
|
+
aria-controls="${0}">
|
|
107
|
+
${0}
|
|
108
|
+
${0}
|
|
109
|
+
<span class="heading-text">${0}</span>
|
|
110
|
+
${0}
|
|
111
|
+
<span class="indicator">
|
|
112
|
+
${0}
|
|
113
|
+
</span>
|
|
114
|
+
</button>
|
|
115
|
+
`), x => x.open = !x.open, x => x.open, PANEL, () => focusTemplate, x => affixIconTemplate(x.icon), x => x.heading, when(x => x.meta, html(_t4 || (_t4 = _`<span class="meta">${0}</span>`), x => x.meta)), when(x => !x.noIndicator && !x.iconTrailing, html(_t5 || (_t5 = _`
|
|
116
|
+
${0}
|
|
117
|
+
${0}
|
|
118
|
+
`), when(x => !x.open, html(_t6 || (_t6 = _`<vwc-icon type='chevron-down-solid'></vwc-icon>`))), when(x => x.open, html(_t7 || (_t7 = _`<vwc-icon type='chevron-up-solid'></vwc-icon>`))))));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const vividAccordionItem = AccordionItem.compose({
|
|
122
|
+
baseName: 'accordion-item',
|
|
123
|
+
template: AccordionItemTemplate,
|
|
124
|
+
styles: css_248z,
|
|
125
|
+
shadowOptions: {
|
|
126
|
+
delegatesFocus: true
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
designSystem.register(vividAccordionItem());
|
|
130
|
+
|
|
131
|
+
export { vividAccordionItem };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
3
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
4
|
+
import '../shared/export.js';
|
|
5
|
+
import '../shared/object-keys.js';
|
|
6
|
+
import '../shared/iterators.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n inline-size: inherit;\n vertical-align: middle;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base::before {\n position: absolute;\n z-index: 1;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inset: 0;\n pointer-events: none;\n}\n.base:not(.tight) {\n padding: 4px;\n column-gap: 4px;\n}\n\n/* Shape */\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.base.shape-pill {\n border-radius: 24px;\n}\n\n/* Separator */\n::slotted(vwc-divider) {\n align-self: stretch;\n margin-block: 4px;\n}";
|
|
9
|
+
|
|
10
|
+
class ActionGroup extends FoundationElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.tight = false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
__decorate([attr, __metadata("design:type", String)], ActionGroup.prototype, "shape", void 0);
|
|
19
|
+
|
|
20
|
+
__decorate([attr, __metadata("design:type", String)], ActionGroup.prototype, "appearance", void 0);
|
|
21
|
+
|
|
22
|
+
__decorate([attr({
|
|
23
|
+
mode: 'boolean'
|
|
24
|
+
}), __metadata("design:type", Object)], ActionGroup.prototype, "tight", void 0);
|
|
25
|
+
|
|
26
|
+
let _ = t => t,
|
|
27
|
+
_t;
|
|
28
|
+
|
|
29
|
+
const getClasses = ({
|
|
30
|
+
appearance,
|
|
31
|
+
shape,
|
|
32
|
+
tight
|
|
33
|
+
}) => classNames('base', [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['tight', tight]);
|
|
34
|
+
|
|
35
|
+
const ActionGroupTemplate = () => html(_t || (_t = _`
|
|
36
|
+
<div class="${0}">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</div>`), getClasses);
|
|
39
|
+
|
|
40
|
+
const vividActionGroup = ActionGroup.compose({
|
|
41
|
+
baseName: 'action-group',
|
|
42
|
+
template: ActionGroupTemplate,
|
|
43
|
+
styles: css_248z
|
|
44
|
+
});
|
|
45
|
+
designSystem.register(vividActionGroup());
|
|
46
|
+
|
|
47
|
+
export { vividActionGroup };
|
package/avatar/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
3
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
4
|
+
import '../shared/icon.js';
|
|
5
|
+
import '../shared/export.js';
|
|
6
|
+
import '../shared/iterators.js';
|
|
7
|
+
import '../shared/to-string.js';
|
|
8
|
+
import '../shared/_has.js';
|
|
9
|
+
import '../shared/when.js';
|
|
10
|
+
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\n.base {\n display: inline-flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_density);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n inline-size: var(--_density);\n vertical-align: middle;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n}\n.base:not(.connotation-cta) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transaprent;\n}\n.base.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base.density-condensed {\n --_density: 32px;\n}\n.base.density-condensed .icon {\n font-size: calc(32px / 2);\n}\n.base.density-extended {\n --_density: 48px;\n}\n.base.density-extended .icon {\n font-size: calc(48px / 2);\n}\n.base:not(.density-condensed, .density-extended) {\n --_density: 40px;\n}\n.base:not(.density-condensed, .density-extended) .icon {\n font-size: calc(40px / 2);\n}\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n.base.shape-pill {\n border-radius: 50%;\n}\n.base ::slotted(*) {\n block-size: 100%;\n inline-size: 100%;\n object-fit: cover;\n}";
|
|
12
|
+
|
|
13
|
+
class Avatar extends FoundationElement {}
|
|
14
|
+
|
|
15
|
+
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "connotation", void 0);
|
|
16
|
+
|
|
17
|
+
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "shape", void 0);
|
|
18
|
+
|
|
19
|
+
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "appearance", void 0);
|
|
20
|
+
|
|
21
|
+
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "density", void 0);
|
|
22
|
+
|
|
23
|
+
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "icon", void 0);
|
|
24
|
+
|
|
25
|
+
let _ = t => t,
|
|
26
|
+
_t;
|
|
27
|
+
|
|
28
|
+
const getClasses = ({
|
|
29
|
+
appearance,
|
|
30
|
+
connotation,
|
|
31
|
+
shape,
|
|
32
|
+
density
|
|
33
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)]);
|
|
34
|
+
|
|
35
|
+
const AvatarTemplate = () => html(_t || (_t = _`
|
|
36
|
+
<span class="${0}">
|
|
37
|
+
<slot>
|
|
38
|
+
<span class="icon">
|
|
39
|
+
<vwc-icon type="${0}"></vwc-icon>
|
|
40
|
+
</span>
|
|
41
|
+
</slot>
|
|
42
|
+
</span>`), getClasses, x => x.icon ? `${x.icon}` : 'user-line');
|
|
43
|
+
|
|
44
|
+
const vividAvatar = Avatar.compose({
|
|
45
|
+
baseName: 'avatar',
|
|
46
|
+
template: AvatarTemplate,
|
|
47
|
+
styles: css_248z
|
|
48
|
+
});
|
|
49
|
+
designSystem.register(vividAvatar());
|
|
50
|
+
|
|
51
|
+
export { vividAvatar };
|
package/badge/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
3
|
+
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
4
|
+
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
5
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
6
|
+
import '../shared/icon.js';
|
|
7
|
+
import '../shared/export.js';
|
|
8
|
+
import '../shared/iterators.js';
|
|
9
|
+
import '../shared/to-string.js';
|
|
10
|
+
import '../shared/_has.js';
|
|
11
|
+
import '../shared/when.js';
|
|
12
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
13
|
+
import '../shared/object-keys.js';
|
|
14
|
+
|
|
15
|
+
class Badge extends FoundationElement {}
|
|
16
|
+
|
|
17
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "connotation", void 0);
|
|
18
|
+
|
|
19
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "shape", void 0);
|
|
20
|
+
|
|
21
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "appearance", void 0);
|
|
22
|
+
|
|
23
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "density", void 0);
|
|
24
|
+
|
|
25
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "text", void 0);
|
|
26
|
+
|
|
27
|
+
applyMixins(Badge, AffixIconWithTrailing);
|
|
28
|
+
|
|
29
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\n.control {\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n column-gap: 8px;\n font: var(--vvd-font-base-condensed-bold);\n vertical-align: middle;\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-cta-500);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n --_connotation-color-soft: var(--vvd-color-success-100);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n}\n.control.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-warning-500);\n --_connotation-color-soft: var(--vvd-color-warning-100);\n --_connotation-color-contrast: var(--vvd-color-warning-800);\n}\n.control.connotation-information {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-information-500);\n --_connotation-color-soft: var(--vvd-color-information-100);\n --_connotation-color-contrast: var(--vvd-color-information-800);\n}\n.control:not(.connotation-cta, .connotation-success, .connotation-alert, .connotation-warning, .connotation-information) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transaprent;\n}\n.control.appearance-duotone {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.control.appearance-subtle {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transaprent;\n}\n\n/* Size */\n.control:not(.density-condensed):not(.density-extended) {\n block-size: 24px;\n padding-inline: 10px;\n}\n\n.control.density-condensed {\n block-size: 20px;\n padding-inline: 8px;\n}\n\n.control.density-extended {\n block-size: 28px;\n padding-inline: 12px;\n}\n\n/* Shape */\n.control:not(.shape-pill) {\n border-radius: 4px;\n}\n\n.control.shape-pill {\n border-radius: 14px;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}";
|
|
30
|
+
|
|
31
|
+
let _ = t => t,
|
|
32
|
+
_t;
|
|
33
|
+
|
|
34
|
+
const getClasses = ({
|
|
35
|
+
connotation,
|
|
36
|
+
appearance,
|
|
37
|
+
shape,
|
|
38
|
+
density,
|
|
39
|
+
iconTrailing
|
|
40
|
+
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)], ['icon-trailing', iconTrailing]);
|
|
41
|
+
|
|
42
|
+
const badgeTemplate = context => {
|
|
43
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
44
|
+
return html(_t || (_t = _`
|
|
45
|
+
<span class="${0}">
|
|
46
|
+
${0}
|
|
47
|
+
${0}
|
|
48
|
+
</span>`), getClasses, x => affixIconTemplate(x.icon), x => x.text);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const vividBadge = Badge.compose({
|
|
52
|
+
baseName: 'badge',
|
|
53
|
+
template: badgeTemplate,
|
|
54
|
+
styles: css_248z
|
|
55
|
+
});
|
|
56
|
+
designSystem.register(vividBadge());
|
|
57
|
+
|
|
58
|
+
export { vividBadge };
|
package/banner/index.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import '../button/index.js';
|
|
2
|
+
import { F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
3
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
4
|
+
import { C as Connotation } from '../shared/enums.js';
|
|
5
|
+
import { b as AffixIcon, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
6
|
+
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
+
import { w as when } from '../shared/when.js';
|
|
8
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
9
|
+
import '../icon/index.js';
|
|
10
|
+
import '../shared/icon.js';
|
|
11
|
+
import '../shared/export.js';
|
|
12
|
+
import '../shared/iterators.js';
|
|
13
|
+
import '../shared/to-string.js';
|
|
14
|
+
import '../shared/_has.js';
|
|
15
|
+
import '../focus/index.js';
|
|
16
|
+
import '../shared/focus.js';
|
|
17
|
+
import '../shared/button.js';
|
|
18
|
+
import '../shared/form-associated.js';
|
|
19
|
+
import '../shared/key-codes.js';
|
|
20
|
+
import '../shared/aria-global.js';
|
|
21
|
+
import '../shared/start-end.js';
|
|
22
|
+
import '../shared/ref.js';
|
|
23
|
+
import '../shared/focus2.js';
|
|
24
|
+
import '../shared/object-keys.js';
|
|
25
|
+
|
|
26
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\n.control {\n overflow: hidden;\n max-height: 160px;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n transition: max-height var(--transition-delay, 200ms);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control:not(.connotation-success, .connotation-alert, .connotation-announcement, .connotation-warning) {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transaprent;\n}\n.control.removing {\n max-height: 0;\n}\n.control > .header {\n display: flex;\n min-height: 60px;\n align-items: center;\n justify-content: flex-start;\n font: var(--vvd-font-base-bold);\n}\n.control > .header > .user-content {\n display: flex;\n flex: 1 0;\n align-items: center;\n justify-content: center;\n padding-inline: 16px;\n}\n.control > .header > .user-content > .icon {\n flex: 0 0 auto;\n font-size: 20px;\n margin-inline-end: 15px;\n}\n.control > .header > .user-content > .action-items {\n display: inline-block;\n flex: 0 0 auto;\n padding-inline-start: 15px;\n}\n.control > .header > .user-content > .message {\n padding: 20px 0;\n}\n.control > .header > .dismiss-button {\n --vvd-icon-button-color: inherit;\n flex: 0 0 auto;\n margin-inline-end: 8px;\n}";
|
|
27
|
+
|
|
28
|
+
var _Banner_handleRemoveEnd, _Banner_closeOnKeyDown;
|
|
29
|
+
const connotationIconMap = new Map([[Connotation.Information, 'info-solid'], [Connotation.Announcement, 'megaphone-solid'], [Connotation.Success, 'check-circle-solid'], [Connotation.Warning, 'warning-solid'], [Connotation.Alert, 'error-solid']]);
|
|
30
|
+
|
|
31
|
+
const defaultConnotation = (connotation = Connotation.Information) => connotationIconMap.get(connotation);
|
|
32
|
+
|
|
33
|
+
class Banner extends FoundationElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.removable = false;
|
|
37
|
+
|
|
38
|
+
_Banner_handleRemoveEnd.set(this, () => {
|
|
39
|
+
this.$emit('removed');
|
|
40
|
+
this.parentElement && this.parentElement.removeChild(this);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
_Banner_closeOnKeyDown.set(this, e => {
|
|
44
|
+
if (e.key !== 'Escape' || !this.removable) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this.remove();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get conditionedIcon() {
|
|
53
|
+
var _a;
|
|
54
|
+
|
|
55
|
+
return (_a = this.icon) !== null && _a !== void 0 ? _a : defaultConnotation(this.connotation);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
connectedCallback() {
|
|
59
|
+
super.connectedCallback();
|
|
60
|
+
this.addEventListener('keydown', __classPrivateFieldGet(this, _Banner_closeOnKeyDown, "f"));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
disconnectedCallback() {
|
|
64
|
+
super.disconnectedCallback();
|
|
65
|
+
this.removeEventListener('keydown', __classPrivateFieldGet(this, _Banner_closeOnKeyDown, "f"));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
remove() {
|
|
69
|
+
this.$emit('removing');
|
|
70
|
+
const banner = this.shadowRoot && this.shadowRoot.querySelector('.banner');
|
|
71
|
+
|
|
72
|
+
if (banner) {
|
|
73
|
+
banner.classList.add('removing');
|
|
74
|
+
banner.addEventListener('transitionend', __classPrivateFieldGet(this, _Banner_handleRemoveEnd, "f"));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
_Banner_handleRemoveEnd = new WeakMap(), _Banner_closeOnKeyDown = new WeakMap();
|
|
80
|
+
|
|
81
|
+
__decorate([attr({
|
|
82
|
+
attribute: 'action-href'
|
|
83
|
+
}), __metadata("design:type", Object)], Banner.prototype, "actionHref", void 0);
|
|
84
|
+
|
|
85
|
+
__decorate([attr({
|
|
86
|
+
attribute: 'action-text'
|
|
87
|
+
}), __metadata("design:type", Object)], Banner.prototype, "actionText", void 0);
|
|
88
|
+
|
|
89
|
+
__decorate([attr({
|
|
90
|
+
mode: 'boolean'
|
|
91
|
+
}), __metadata("design:type", Object)], Banner.prototype, "removable", void 0);
|
|
92
|
+
|
|
93
|
+
__decorate([attr({
|
|
94
|
+
attribute: 'aria-live'
|
|
95
|
+
}), __metadata("design:type", Object)], Banner.prototype, "ariaLive", void 0);
|
|
96
|
+
|
|
97
|
+
__decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "role", void 0);
|
|
98
|
+
|
|
99
|
+
__decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "text", void 0);
|
|
100
|
+
|
|
101
|
+
__decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "connotation", void 0);
|
|
102
|
+
|
|
103
|
+
applyMixins(Banner, AffixIcon);
|
|
104
|
+
|
|
105
|
+
let _2 = t => t,
|
|
106
|
+
_t,
|
|
107
|
+
_t2;
|
|
108
|
+
|
|
109
|
+
const getClasses = _ => classNames('control', [`connotation-${_.connotation}`, !!_.connotation]);
|
|
110
|
+
|
|
111
|
+
function renderDismissButton() {
|
|
112
|
+
return html(_t || (_t = _2`
|
|
113
|
+
<vwc-button
|
|
114
|
+
density="condensed"
|
|
115
|
+
class="dismiss-button"
|
|
116
|
+
icon="close-line"
|
|
117
|
+
@click="${0}">
|
|
118
|
+
</vwc-button>`), x => x.remove());
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const BannerTemplate = context => {
|
|
122
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
123
|
+
return html(_t2 || (_t2 = _2`
|
|
124
|
+
<div class="banner ${0}" tabindex="0">
|
|
125
|
+
<header class="header">
|
|
126
|
+
<div class="user-content">
|
|
127
|
+
${0}
|
|
128
|
+
<div class="banner--message"
|
|
129
|
+
role="${0}"
|
|
130
|
+
aria-live="${0}">
|
|
131
|
+
${0}
|
|
132
|
+
</div>
|
|
133
|
+
<slot class="action-items" name="action-items"></slot>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
${0}
|
|
137
|
+
</header>
|
|
138
|
+
</div>
|
|
139
|
+
`), getClasses, x => affixIconTemplate(x.conditionedIcon), x => x.role ? x.role : 'status', x => x.ariaLive ? x.ariaLive : 'polite', x => x.text, when(x => x.removable, renderDismissButton()));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const vividBanner = Banner.compose({
|
|
143
|
+
baseName: 'banner',
|
|
144
|
+
template: BannerTemplate,
|
|
145
|
+
styles: css_248z
|
|
146
|
+
});
|
|
147
|
+
designSystem.register(vividBanner());
|
|
148
|
+
|
|
149
|
+
export { vividBanner };
|