@vonage/vivid 3.0.0-next.8 → 3.0.0-next.80
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 +141 -4
- package/accordion/index.js +2 -4
- package/accordion-item/index.js +26 -20
- package/action-group/index.js +47 -0
- package/avatar/index.js +70 -0
- package/badge/index.js +17 -21
- package/banner/index.js +23 -87
- package/breadcrumb/index.js +21 -18
- package/breadcrumb-item/index.js +19 -12
- package/button/index.js +19 -757
- package/calendar/index.js +67 -25
- 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 +3 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +105 -0
- package/focus/index.js +18 -3
- package/header/index.js +66 -0
- package/icon/index.js +9 -5
- package/index.js +53 -20
- package/layout/index.js +4 -6
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +5 -5
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- 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/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- 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 +27 -10
- 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 +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +11 -6
- 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/index.d.ts +1 -1
- 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 +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- 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/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/number-field/index.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +16 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +2 -1
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/index.d.ts +3 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- 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/tooltip.d.ts +2 -2
- package/menu/index.js +381 -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/number-field/index.js +529 -0
- package/package.json +51 -7
- package/popup/index.js +23 -2061
- package/progress/index.js +35 -28
- package/progress-ring/index.js +9 -5
- package/radio/index.js +174 -0
- package/shared/anchor.js +10 -2
- package/shared/aria-global.js +2 -86
- package/shared/base-progress.js +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +26 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +7 -6
- 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 +533 -520
- package/shared/index.js +71 -55
- package/shared/index2.js +110 -13
- package/shared/index3.js +35 -0
- package/shared/index4.js +86 -0
- package/shared/index5.js +2100 -0
- package/shared/index6.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/focus.d.ts +3 -0
- package/shared/patterns/form-elements.d.ts +22 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/ref.js +41 -0
- package/shared/regexp-flags.js +21 -0
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.js +2 -11
- package/shared/text-anchor.template.js +5 -2
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +78 -1083
- package/side-drawer/index.js +44 -23
- 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 +9 -12
- package/styles/tokens/theme-dark.css +211 -0
- package/styles/tokens/theme-light.css +211 -0
- package/text-anchor/index.js +9 -1
- package/text-area/index.js +304 -0
- package/text-field/index.js +152 -0
- package/tooltip/index.js +23 -16
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/sidenav-item/index.js +0 -38
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -45
package/README.md
CHANGED
|
@@ -1,7 +1,144 @@
|
|
|
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 tokens**, its 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 a wrapping element (advisably the `:root`).
|
|
41
|
+
|
|
42
|
+
Tokens 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
|
+
### Core (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, native HTML tags do.
|
|
61
|
+
|
|
62
|
+
These **core styles** rely on the tokens and fonts 👆 to be loaded.
|
|
63
|
+
|
|
64
|
+
To **include the core styles**, its css files must be loaded into the project from the `node_modules/@vonage/vivid/styles/core` folder and *require a `vvd-root` class* selector to be present on a wrapping element (advisably the `:root`).
|
|
65
|
+
|
|
66
|
+
- `theme.css` - Sets theme related styles
|
|
67
|
+
|
|
68
|
+
- `typography.css` - Sets typography related styles
|
|
69
|
+
|
|
70
|
+
- `all.css` - Sets all the above styles
|
|
71
|
+
|
|
72
|
+
Note: scss users can simply [forward](https://sass-lang.com/documentation/at-rules/forward) the styles to their scss project:
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
@forward 'node_modules/@vonage/vivid/styles/[path to file].css';
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Support
|
|
79
|
+
|
|
80
|
+
This library is open source, developed and maintained by the [Vonage Vivid team](Vonage/vivid).
|
|
81
|
+
|
|
82
|
+
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=).
|
|
83
|
+
|
|
84
|
+
## Roadmap
|
|
85
|
+
|
|
86
|
+
- View [components status](https://github.com/orgs/Vonage/projects/6)
|
|
87
|
+
|
|
88
|
+
- [What's on our plate](https://github.com/orgs/Vonage/projects/3/views/7)
|
|
89
|
+
|
|
90
|
+
- See the [open issues](https://github.com/vonage/vivid-3/issues) for a full list of proposed features (and known issues).
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
## Contributing
|
|
95
|
+
|
|
96
|
+
Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
|
97
|
+
|
|
98
|
+
## Versioning
|
|
99
|
+
|
|
100
|
+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [npm page](https://www.npmjs.com/package/@vonage/vivid).
|
|
101
|
+
|
|
102
|
+
## Authors
|
|
103
|
+
|
|
104
|
+
See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
This project is licensed under the Apache 2.0 License - see the [LICENSE.md](LICENSE.md) file for details
|
|
109
|
+
|
|
110
|
+
<!-- ## Acknowledgments
|
|
111
|
+
|
|
112
|
+
- Hat tip to anyone whose code was used
|
|
113
|
+
- Inspiration
|
|
114
|
+
- etc -->
|
|
115
|
+
|
|
116
|
+
## Built With
|
|
117
|
+
|
|
118
|
+
- [Fast](https://www.fast.design) - to extend element classes and compile code to native web components
|
|
119
|
+
- [Typescript](https://www.typescriptlang.org) - for ergonomic and type-safe code
|
|
120
|
+
- [Sass](https://sass-lang.com) - for styles authoring extensibility and consistency
|
|
121
|
+
|
|
122
|
+
## Quickstart
|
|
123
|
+
|
|
124
|
+
Global content delivery networks can help quickly integrate content within html pages, fetching content from an URL, skipping local builds entirely.
|
|
125
|
+
Such practice is often used when working on POCs or reproduction environments.
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
The following snippet fully renders a Vivid button component
|
|
129
|
+
|
|
130
|
+
```html
|
|
131
|
+
<!-- import spezia font -->
|
|
132
|
+
<link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/fonts/spezia.css">
|
|
133
|
+
|
|
134
|
+
<!-- import light theme style tokens -->
|
|
135
|
+
<link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/tokens/theme-light.css">
|
|
136
|
+
|
|
137
|
+
<!-- import Vivid button component -->
|
|
138
|
+
<script type="module" src="https://unpkg.com/@vonage/vivid@next/button/index.js"></script>
|
|
139
|
+
|
|
140
|
+
<!-- Part of the app (or a whole app) that contains vivid components -->
|
|
141
|
+
<div class="vvd-root">
|
|
142
|
+
<vwc-button label="Click me" appearance="filled" connotation="cta"></vwc-button>
|
|
143
|
+
</div>
|
|
144
|
+
```
|
package/accordion/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
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 { s as styleInject } from '../shared/style-inject.es.js';
|
|
3
2
|
import { c as classNames } from '../shared/class-names.js';
|
|
4
3
|
|
|
5
|
-
var css_248z = ".
|
|
6
|
-
styleInject(css_248z);
|
|
4
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 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}";
|
|
7
5
|
|
|
8
6
|
class Accordion extends FoundationElement {
|
|
9
7
|
constructor() {
|
|
@@ -45,7 +43,7 @@ __decorate([attr({
|
|
|
45
43
|
let _2 = t => t,
|
|
46
44
|
_t;
|
|
47
45
|
|
|
48
|
-
const getClasses = _ => classNames('
|
|
46
|
+
const getClasses = _ => classNames('base');
|
|
49
47
|
|
|
50
48
|
const AccordionTemplate = () => html(_t || (_t = _2`<div class="${0}">
|
|
51
49
|
<slot></slot>
|
package/accordion-item/index.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import '../focus/index.js';
|
|
1
3
|
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
-
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
3
4
|
import '../shared/web.dom-collections.iterator.js';
|
|
4
5
|
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
5
6
|
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
+
import { f as focusTemplateFactory } from '../shared/focus2.js';
|
|
6
8
|
import { w as when } from '../shared/when.js';
|
|
7
9
|
import { c as classNames } from '../shared/class-names.js';
|
|
8
|
-
import '../icon/index.js';
|
|
9
10
|
import '../shared/icon.js';
|
|
11
|
+
import '../shared/export.js';
|
|
12
|
+
import '../shared/iterators.js';
|
|
13
|
+
import '../shared/to-string.js';
|
|
10
14
|
import '../shared/_has.js';
|
|
15
|
+
import '../shared/focus.js';
|
|
16
|
+
import '../shared/object-keys.js';
|
|
11
17
|
|
|
12
|
-
var css_248z = "
|
|
13
|
-
styleInject(css_248z);
|
|
18
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 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: transparent;\n --_appearance-color-outline: transparent;\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: transparent;\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: transparent;\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}";
|
|
14
19
|
|
|
15
20
|
class AccordionItem extends FoundationElement {
|
|
16
21
|
constructor() {
|
|
17
22
|
super(...arguments);
|
|
18
|
-
this.heading = '';
|
|
19
23
|
this.noIndicator = false;
|
|
20
|
-
this.meta = '';
|
|
21
24
|
this.open = false;
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -40,9 +43,7 @@ class AccordionItem extends FoundationElement {
|
|
|
40
43
|
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
__decorate([attr(
|
|
44
|
-
mode: 'fromView'
|
|
45
|
-
}), __metadata("design:type", Object)], AccordionItem.prototype, "heading", void 0);
|
|
46
|
+
__decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "heading", void 0);
|
|
46
47
|
|
|
47
48
|
__decorate([attr({
|
|
48
49
|
attribute: 'heading-level'
|
|
@@ -53,9 +54,7 @@ __decorate([attr({
|
|
|
53
54
|
attribute: 'no-indicator'
|
|
54
55
|
}), __metadata("design:type", Object)], AccordionItem.prototype, "noIndicator", void 0);
|
|
55
56
|
|
|
56
|
-
__decorate([attr(
|
|
57
|
-
mode: 'fromView'
|
|
58
|
-
}), __metadata("design:type", Object)], AccordionItem.prototype, "meta", void 0);
|
|
57
|
+
__decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "meta", void 0);
|
|
59
58
|
|
|
60
59
|
__decorate([attr({
|
|
61
60
|
mode: 'boolean'
|
|
@@ -68,7 +67,9 @@ let _ = t => t,
|
|
|
68
67
|
_t2,
|
|
69
68
|
_t3,
|
|
70
69
|
_t4,
|
|
71
|
-
_t5
|
|
70
|
+
_t5,
|
|
71
|
+
_t6,
|
|
72
|
+
_t7;
|
|
72
73
|
const PANEL = 'panel';
|
|
73
74
|
|
|
74
75
|
const getClasses = ({
|
|
@@ -76,7 +77,7 @@ const getClasses = ({
|
|
|
76
77
|
iconTrailing,
|
|
77
78
|
icon,
|
|
78
79
|
noIndicator
|
|
79
|
-
}) => classNames('
|
|
80
|
+
}) => classNames('base', ['open', open], ['icon', Boolean(icon)], ['icon-trailing', iconTrailing], ['no-indicator', noIndicator]);
|
|
80
81
|
|
|
81
82
|
const AccordionItemTemplate = context => html(_t || (_t = _`
|
|
82
83
|
<div class="${0}">
|
|
@@ -98,10 +99,12 @@ const renderPanelHeader = (context, headingLevel) => {
|
|
|
98
99
|
|
|
99
100
|
const renderHeaderButton = context => {
|
|
100
101
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
102
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
101
103
|
return html(_t3 || (_t3 = _`
|
|
102
104
|
<button class="button" id="header" @click=${0}
|
|
103
|
-
|
|
105
|
+
aria-expanded=${0}
|
|
104
106
|
aria-controls="${0}">
|
|
107
|
+
${0}
|
|
105
108
|
${0}
|
|
106
109
|
<span class="heading-text">${0}</span>
|
|
107
110
|
${0}
|
|
@@ -109,16 +112,19 @@ const renderHeaderButton = context => {
|
|
|
109
112
|
${0}
|
|
110
113
|
</span>
|
|
111
114
|
</button>
|
|
112
|
-
`), x => x.open = !x.open, x => x.open, PANEL, 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 = _`
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
`))));
|
|
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>`))))));
|
|
116
119
|
};
|
|
117
120
|
|
|
118
121
|
const vividAccordionItem = AccordionItem.compose({
|
|
119
122
|
baseName: 'accordion-item',
|
|
120
123
|
template: AccordionItemTemplate,
|
|
121
|
-
styles: css_248z
|
|
124
|
+
styles: css_248z,
|
|
125
|
+
shadowOptions: {
|
|
126
|
+
delegatesFocus: true
|
|
127
|
+
}
|
|
122
128
|
});
|
|
123
129
|
designSystem.register(vividAccordionItem());
|
|
124
130
|
|
|
@@ -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 Wed, 19 Oct 2022 08:48:31 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: transparent;\n --_appearance-color-outline: transparent;\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,70 @@
|
|
|
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 { w as when } from '../shared/when.js';
|
|
4
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
5
|
+
import '../shared/icon.js';
|
|
6
|
+
import '../shared/export.js';
|
|
7
|
+
import '../shared/iterators.js';
|
|
8
|
+
import '../shared/to-string.js';
|
|
9
|
+
import '../shared/_has.js';
|
|
10
|
+
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 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: transparent;\n}\n.base.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\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: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.density-condensed {\n --_density: 32px;\n}\n.base.density-condensed .initials {\n font: var(--vvd-font-base-condensed-bold);\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 .initials {\n font: var(--vvd-font-heading4);\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) .initials {\n font: var(--vvd-font-base-extended-bold);\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 .initials {\n text-transform: uppercase;\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
|
+
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "name", void 0);
|
|
26
|
+
|
|
27
|
+
let _ = t => t,
|
|
28
|
+
_t,
|
|
29
|
+
_t2,
|
|
30
|
+
_t3;
|
|
31
|
+
|
|
32
|
+
const getClasses = ({
|
|
33
|
+
appearance,
|
|
34
|
+
connotation,
|
|
35
|
+
shape,
|
|
36
|
+
density
|
|
37
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)]);
|
|
38
|
+
|
|
39
|
+
function renderIcon() {
|
|
40
|
+
return html(_t || (_t = _`
|
|
41
|
+
<span class="icon">
|
|
42
|
+
<vwc-icon type="${0}"></vwc-icon>
|
|
43
|
+
</span>
|
|
44
|
+
`), x => x.icon ? `${x.icon}` : 'user-line');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function renderInitials() {
|
|
48
|
+
return html(_t2 || (_t2 = _`
|
|
49
|
+
<span class="initials">${0}</span>
|
|
50
|
+
`), ({
|
|
51
|
+
name
|
|
52
|
+
}) => name.substring(0, 2));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const AvatarTemplate = () => html(_t3 || (_t3 = _`
|
|
56
|
+
<span class="${0}">
|
|
57
|
+
<slot>
|
|
58
|
+
${0}
|
|
59
|
+
${0}
|
|
60
|
+
</slot>
|
|
61
|
+
</span>`), getClasses, when(x => x.name, renderInitials()), when(x => !x.name, renderIcon()));
|
|
62
|
+
|
|
63
|
+
const vividAvatar = Avatar.compose({
|
|
64
|
+
baseName: 'avatar',
|
|
65
|
+
template: AvatarTemplate,
|
|
66
|
+
styles: css_248z
|
|
67
|
+
});
|
|
68
|
+
designSystem.register(vividAvatar());
|
|
69
|
+
|
|
70
|
+
export { vividAvatar };
|
package/badge/index.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import '../icon/index.js';
|
|
2
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 '../shared/web.dom-collections.iterator.js';
|
|
4
3
|
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
5
4
|
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
6
|
-
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
7
5
|
import { c as classNames } from '../shared/class-names.js';
|
|
8
6
|
import '../shared/icon.js';
|
|
7
|
+
import '../shared/export.js';
|
|
8
|
+
import '../shared/iterators.js';
|
|
9
|
+
import '../shared/to-string.js';
|
|
9
10
|
import '../shared/_has.js';
|
|
10
11
|
import '../shared/when.js';
|
|
12
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
13
|
+
import '../shared/object-keys.js';
|
|
11
14
|
|
|
12
|
-
class Badge extends FoundationElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.text = '';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}
|
|
15
|
+
class Badge extends FoundationElement {}
|
|
19
16
|
|
|
20
17
|
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "connotation", void 0);
|
|
21
18
|
|
|
@@ -23,16 +20,13 @@ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "shape",
|
|
|
23
20
|
|
|
24
21
|
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "appearance", void 0);
|
|
25
22
|
|
|
26
|
-
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "
|
|
23
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "density", void 0);
|
|
27
24
|
|
|
28
|
-
__decorate([attr(
|
|
29
|
-
mode: 'fromView'
|
|
30
|
-
}), __metadata("design:type", Object)], Badge.prototype, "text", void 0);
|
|
25
|
+
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "text", void 0);
|
|
31
26
|
|
|
32
27
|
applyMixins(Badge, AffixIconWithTrailing);
|
|
33
28
|
|
|
34
|
-
var css_248z = "
|
|
35
|
-
styleInject(css_248z);
|
|
29
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 GMT\n */\n.base {\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_badge-block-size);\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.base.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.base.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.base.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.base.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.base.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.base: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.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base.appearance-duotone {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-subtle {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base.icon-only {\n contain: size;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .base.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .base.icon-only {\n inline-size: var(--_badge-block-size);\n }\n}\n\n/* Size */\n.base:not(.density-condensed):not(.density-extended) {\n --_badge-block-size: 24px;\n padding-inline: 10px;\n}\n\n.base.density-condensed {\n --_badge-block-size: 20px;\n padding-inline: 8px;\n}\n\n.base.density-extended {\n --_badge-block-size: 28px;\n padding-inline: 12px;\n}\n\n/* Shape */\n.base:not(.shape-pill) {\n border-radius: 4px;\n}\n\n.base.shape-pill {\n border-radius: 14px;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}";
|
|
36
30
|
|
|
37
31
|
let _ = t => t,
|
|
38
32
|
_t;
|
|
@@ -41,9 +35,11 @@ const getClasses = ({
|
|
|
41
35
|
connotation,
|
|
42
36
|
appearance,
|
|
43
37
|
shape,
|
|
44
|
-
|
|
45
|
-
iconTrailing
|
|
46
|
-
|
|
38
|
+
density,
|
|
39
|
+
iconTrailing,
|
|
40
|
+
text,
|
|
41
|
+
icon
|
|
42
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)], ['icon-trailing', iconTrailing], ['icon-only', !text && Boolean(icon)]);
|
|
47
43
|
|
|
48
44
|
const badgeTemplate = context => {
|
|
49
45
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
@@ -54,11 +50,11 @@ const badgeTemplate = context => {
|
|
|
54
50
|
</span>`), getClasses, x => affixIconTemplate(x.icon), x => x.text);
|
|
55
51
|
};
|
|
56
52
|
|
|
57
|
-
const
|
|
53
|
+
const vividBadge = Badge.compose({
|
|
58
54
|
baseName: 'badge',
|
|
59
55
|
template: badgeTemplate,
|
|
60
56
|
styles: css_248z
|
|
61
57
|
});
|
|
62
|
-
designSystem.register(
|
|
58
|
+
designSystem.register(vividBadge());
|
|
63
59
|
|
|
64
|
-
export {
|
|
60
|
+
export { vividBadge };
|