@vonage/vivid 3.0.0 → 3.1.0

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.
Files changed (337) hide show
  1. package/README.md +176 -4
  2. package/accordion/index.js +22 -61
  3. package/accordion-item/index.js +16 -118
  4. package/action-group/index.js +5 -0
  5. package/avatar/index.js +11 -0
  6. package/badge/index.js +9 -53
  7. package/banner/index.js +20 -210
  8. package/breadcrumb/index.js +7 -96
  9. package/breadcrumb-item/index.js +15 -46
  10. package/button/index.js +19 -751
  11. package/calendar/index.js +6 -1520
  12. package/calendar-event/index.js +9 -0
  13. package/card/index.js +10 -133
  14. package/checkbox/index.js +16 -0
  15. package/combobox/index.js +35 -0
  16. package/custom-elements.json +6214 -0
  17. package/data-grid/index.js +1104 -0
  18. package/dialog/index.js +24 -0
  19. package/divider/index.js +6 -0
  20. package/elevation/index.js +4 -30
  21. package/fab/index.js +22 -0
  22. package/focus/index.js +4 -2
  23. package/header/index.js +6 -0
  24. package/icon/index.js +8 -36
  25. package/index.js +77 -26
  26. package/layout/index.js +4 -52
  27. package/lib/accordion/accordion.d.ts +3 -7
  28. package/lib/accordion/accordion.template.d.ts +1 -2
  29. package/lib/accordion/definition.d.ts +1 -0
  30. package/lib/accordion/index.d.ts +1 -2
  31. package/lib/accordion-item/accordion-item.d.ts +2 -6
  32. package/lib/accordion-item/accordion-item.template.d.ts +4 -4
  33. package/lib/accordion-item/definition.d.ts +1 -0
  34. package/lib/accordion-item/index.d.ts +1 -3
  35. package/lib/action-group/action-group.d.ts +10 -0
  36. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  37. package/lib/action-group/definition.d.ts +1 -0
  38. package/lib/action-group/index.d.ts +1 -0
  39. package/lib/avatar/avatar.d.ts +15 -0
  40. package/lib/avatar/avatar.template.d.ts +4 -0
  41. package/lib/avatar/definition.d.ts +1 -0
  42. package/lib/avatar/index.d.ts +1 -0
  43. package/lib/badge/badge.d.ts +2 -4
  44. package/lib/badge/definition.d.ts +3 -0
  45. package/lib/badge/index.d.ts +1 -3
  46. package/lib/banner/banner.d.ts +1 -1
  47. package/lib/banner/banner.template.d.ts +0 -2
  48. package/lib/banner/definition.d.ts +1 -0
  49. package/lib/banner/index.d.ts +1 -2
  50. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  51. package/lib/breadcrumb/definition.d.ts +1 -0
  52. package/lib/breadcrumb/index.d.ts +1 -2
  53. package/lib/breadcrumb-item/definition.d.ts +1 -0
  54. package/lib/breadcrumb-item/index.d.ts +1 -3
  55. package/lib/button/button.d.ts +3 -2
  56. package/lib/button/definition.d.ts +1 -0
  57. package/lib/button/index.d.ts +1 -21
  58. package/lib/calendar/calendar.d.ts +3 -1
  59. package/lib/calendar/definition.d.ts +1 -0
  60. package/lib/calendar/index.d.ts +1 -3
  61. package/lib/calendar-event/calendar-event.d.ts +14 -0
  62. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  63. package/lib/calendar-event/definition.d.ts +1 -0
  64. package/lib/calendar-event/index.d.ts +1 -0
  65. package/lib/card/card.d.ts +2 -2
  66. package/lib/card/definition.d.ts +1 -0
  67. package/lib/card/index.d.ts +1 -5
  68. package/lib/checkbox/checkbox.d.ts +5 -0
  69. package/lib/checkbox/checkbox.template.d.ts +4 -0
  70. package/lib/checkbox/definition.d.ts +1 -0
  71. package/lib/checkbox/index.d.ts +1 -0
  72. package/lib/combobox/combobox.d.ts +14 -0
  73. package/lib/combobox/combobox.template.d.ts +4 -0
  74. package/lib/combobox/definition.d.ts +3 -0
  75. package/lib/combobox/index.d.ts +1 -0
  76. package/lib/components.d.ts +44 -16
  77. package/lib/data-grid/data-grid-cell.d.ts +5 -0
  78. package/lib/data-grid/data-grid-cell.template.d.ts +4 -0
  79. package/lib/data-grid/data-grid-row.d.ts +3 -0
  80. package/lib/data-grid/data-grid-row.template.d.ts +3 -0
  81. package/lib/data-grid/data-grid.d.ts +3 -0
  82. package/lib/data-grid/data-grid.options.d.ts +31 -0
  83. package/lib/data-grid/data-grid.template.d.ts +3 -0
  84. package/lib/data-grid/definition.d.ts +6 -0
  85. package/lib/data-grid/index.d.ts +1 -0
  86. package/lib/dialog/definition.d.ts +1 -0
  87. package/lib/dialog/dialog.d.ts +23 -0
  88. package/lib/dialog/dialog.template.d.ts +4 -0
  89. package/lib/dialog/index.d.ts +1 -0
  90. package/lib/divider/definition.d.ts +1 -0
  91. package/lib/divider/divider.d.ts +3 -0
  92. package/lib/divider/divider.template.d.ts +4 -0
  93. package/lib/divider/index.d.ts +1 -0
  94. package/lib/elevation/definition.d.ts +1 -0
  95. package/lib/elevation/elevation.d.ts +1 -0
  96. package/lib/elevation/index.d.ts +1 -2
  97. package/lib/enums.d.ts +19 -6
  98. package/lib/fab/definition.d.ts +3 -0
  99. package/lib/fab/fab.d.ts +13 -0
  100. package/lib/fab/fab.template.d.ts +4 -0
  101. package/lib/fab/index.d.ts +1 -0
  102. package/lib/focus/definition.d.ts +3 -0
  103. package/lib/focus/index.d.ts +1 -2
  104. package/lib/{sidenav-item/index.d.ts → header/definition.d.ts} +2 -2
  105. package/lib/header/header.d.ts +5 -0
  106. package/lib/header/header.template.d.ts +4 -0
  107. package/lib/header/index.d.ts +1 -0
  108. package/lib/icon/definition.d.ts +3 -0
  109. package/lib/icon/icon.d.ts +5 -6
  110. package/lib/icon/index.d.ts +1 -2
  111. package/lib/layout/definition.d.ts +3 -0
  112. package/lib/layout/index.d.ts +1 -2
  113. package/lib/layout/layout.d.ts +4 -4
  114. package/lib/listbox/definition.d.ts +3 -0
  115. package/lib/listbox/index.d.ts +1 -0
  116. package/lib/listbox/listbox.d.ts +6 -0
  117. package/lib/listbox/listbox.template.d.ts +4 -0
  118. package/lib/menu/definition.d.ts +11 -0
  119. package/lib/menu/index.d.ts +1 -0
  120. package/lib/menu/menu.d.ts +10 -0
  121. package/lib/menu/menu.template.d.ts +3 -0
  122. package/lib/menu-item/definition.d.ts +3 -0
  123. package/lib/menu-item/index.d.ts +1 -0
  124. package/lib/menu-item/menu-item.d.ts +8 -0
  125. package/lib/menu-item/menu-item.template.d.ts +5 -0
  126. package/lib/nav/definition.d.ts +3 -0
  127. package/lib/nav/index.d.ts +1 -0
  128. package/lib/nav/nav.d.ts +3 -0
  129. package/lib/nav/nav.template.d.ts +4 -0
  130. package/lib/nav-disclosure/definition.d.ts +3 -0
  131. package/lib/nav-disclosure/index.d.ts +1 -0
  132. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  133. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  134. package/lib/nav-item/definition.d.ts +3 -0
  135. package/lib/nav-item/index.d.ts +1 -0
  136. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  137. package/lib/nav-item/nav-item.template.d.ts +4 -0
  138. package/lib/note/definition.d.ts +3 -0
  139. package/lib/note/index.d.ts +1 -0
  140. package/lib/note/note.d.ts +10 -0
  141. package/lib/{text/text.template.d.ts → note/note.template.d.ts} +2 -2
  142. package/lib/number-field/definition.d.ts +4 -0
  143. package/lib/number-field/index.d.ts +1 -0
  144. package/lib/number-field/number-field.d.ts +14 -0
  145. package/lib/number-field/number-field.template.d.ts +4 -0
  146. package/lib/option/definition.d.ts +3 -0
  147. package/lib/option/index.d.ts +1 -0
  148. package/lib/option/option.d.ts +9 -0
  149. package/lib/option/option.template.d.ts +4 -0
  150. package/lib/popup/definition.d.ts +3 -0
  151. package/lib/popup/index.d.ts +1 -4
  152. package/lib/popup/popup.d.ts +8 -4
  153. package/lib/progress/definition.d.ts +3 -0
  154. package/lib/progress/index.d.ts +1 -2
  155. package/lib/progress/progress.d.ts +1 -1
  156. package/lib/progress-ring/definition.d.ts +3 -0
  157. package/lib/progress-ring/index.d.ts +1 -2
  158. package/lib/progress-ring/progress-ring.d.ts +2 -1
  159. package/lib/radio/definition.d.ts +3 -0
  160. package/lib/radio/index.d.ts +1 -0
  161. package/lib/radio/radio.d.ts +4 -0
  162. package/lib/radio/radio.template.d.ts +4 -0
  163. package/lib/radio-group/definition.d.ts +11 -0
  164. package/lib/radio-group/index.d.ts +1 -0
  165. package/lib/radio-group/radio-group.d.ts +4 -0
  166. package/lib/radio-group/radio-group.template.d.ts +4 -0
  167. package/lib/select/definition.d.ts +3 -0
  168. package/lib/select/index.d.ts +1 -0
  169. package/lib/select/select.d.ts +17 -0
  170. package/lib/select/select.template.d.ts +4 -0
  171. package/lib/side-drawer/definition.d.ts +3 -0
  172. package/lib/side-drawer/index.d.ts +1 -2
  173. package/lib/side-drawer/side-drawer.d.ts +3 -2
  174. package/lib/slider/definition.d.ts +3 -0
  175. package/lib/slider/index.d.ts +1 -0
  176. package/lib/slider/slider.d.ts +4 -0
  177. package/lib/slider/slider.template.d.ts +4 -0
  178. package/lib/switch/definition.d.ts +3 -0
  179. package/lib/switch/index.d.ts +1 -0
  180. package/lib/switch/switch.d.ts +7 -0
  181. package/lib/switch/switch.template.d.ts +4 -0
  182. package/lib/tab/definition.d.ts +3 -0
  183. package/lib/tab/index.d.ts +1 -0
  184. package/lib/tab/tab.d.ts +9 -0
  185. package/lib/tab/tab.template.d.ts +3 -0
  186. package/lib/tab-panel/definition.d.ts +3 -0
  187. package/lib/tab-panel/index.d.ts +1 -0
  188. package/lib/tab-panel/tab-panel.d.ts +3 -0
  189. package/lib/tab-panel/tab-panel.template.d.ts +2 -0
  190. package/lib/tabs/definition.d.ts +3 -0
  191. package/lib/tabs/index.d.ts +1 -0
  192. package/lib/tabs/tabs.d.ts +10 -0
  193. package/lib/tabs/tabs.template.d.ts +2 -0
  194. package/lib/text-anchor/definition.d.ts +3 -0
  195. package/lib/text-anchor/index.d.ts +1 -2
  196. package/lib/text-area/definition.d.ts +3 -0
  197. package/lib/text-area/index.d.ts +1 -0
  198. package/lib/text-area/text-area.d.ts +9 -0
  199. package/lib/text-area/text-area.template.d.ts +4 -0
  200. package/lib/text-field/definition.d.ts +3 -0
  201. package/lib/text-field/index.d.ts +1 -0
  202. package/lib/text-field/text-field.d.ts +14 -0
  203. package/lib/text-field/text-field.template.d.ts +4 -0
  204. package/lib/tooltip/definition.d.ts +3 -0
  205. package/lib/tooltip/index.d.ts +1 -3
  206. package/lib/tooltip/tooltip.d.ts +6 -6
  207. package/listbox/index.js +27 -0
  208. package/menu/index.js +30 -0
  209. package/menu-item/index.js +20 -0
  210. package/nav/index.js +4 -0
  211. package/nav-disclosure/index.js +17 -0
  212. package/nav-item/index.js +22 -0
  213. package/note/index.js +15 -0
  214. package/number-field/index.js +459 -0
  215. package/option/index.js +21 -0
  216. package/package.json +21 -11
  217. package/popup/index.js +21 -2062
  218. package/progress/index.js +6 -98
  219. package/progress-ring/index.js +6 -75
  220. package/radio/index.js +12 -0
  221. package/radio-group/index.js +11 -0
  222. package/select/index.js +34 -0
  223. package/shared/affix.js +2 -8
  224. package/shared/anchor.js +10 -2
  225. package/shared/apply-mixins.js +5 -4
  226. package/shared/aria-global.js +2 -86
  227. package/shared/aria.js +9 -0
  228. package/shared/base-progress.js +5 -0
  229. package/shared/breadcrumb-item.js +1 -1
  230. package/shared/button.js +200 -0
  231. package/shared/calendar-event.js +19 -0
  232. package/shared/definition.js +225 -0
  233. package/shared/definition10.js +99 -0
  234. package/shared/definition11.js +48 -0
  235. package/shared/definition12.js +763 -0
  236. package/shared/definition13.js +111 -0
  237. package/shared/definition14.js +114 -0
  238. package/shared/definition15.js +32 -0
  239. package/shared/definition16.js +172 -0
  240. package/shared/definition17.js +727 -0
  241. package/shared/definition18.js +1531 -0
  242. package/shared/definition19.js +261 -0
  243. package/shared/definition2.js +150 -0
  244. package/shared/definition20.js +221 -0
  245. package/shared/definition21.js +78 -0
  246. package/shared/definition22.js +87 -0
  247. package/shared/definition23.js +58 -0
  248. package/shared/definition24.js +44 -0
  249. package/shared/definition25.js +58 -0
  250. package/shared/definition26.js +348 -0
  251. package/shared/definition27.js +363 -0
  252. package/shared/definition28.js +21 -0
  253. package/shared/definition29.js +75 -0
  254. package/shared/definition3.js +29 -0
  255. package/shared/definition30.js +31 -0
  256. package/shared/definition31.js +49 -0
  257. package/shared/definition32.js +94 -0
  258. package/shared/definition33.js +77 -0
  259. package/shared/definition34.js +45 -0
  260. package/shared/definition35.js +435 -0
  261. package/shared/definition36.js +634 -0
  262. package/shared/definition37.js +86 -0
  263. package/shared/definition38.js +592 -0
  264. package/shared/definition39.js +147 -0
  265. package/shared/definition4.js +19 -0
  266. package/shared/definition40.js +67 -0
  267. package/shared/definition41.js +32 -0
  268. package/shared/definition42.js +440 -0
  269. package/shared/definition43.js +282 -0
  270. package/shared/definition44.js +119 -0
  271. package/shared/definition45.js +77 -0
  272. package/shared/definition5.js +38 -0
  273. package/shared/definition6.js +60 -0
  274. package/shared/definition7.js +45 -0
  275. package/shared/definition8.js +113 -0
  276. package/shared/definition9.js +107 -0
  277. package/shared/design-system/index.d.ts +1 -1
  278. package/shared/dialog-polyfill.esm.js +858 -0
  279. package/shared/direction.js +20 -0
  280. package/shared/dom.js +8 -0
  281. package/shared/enums.js +70 -0
  282. package/shared/es.object.assign.js +2 -3
  283. package/shared/es.regexp.to-string.js +59 -0
  284. package/shared/focus.js +5 -0
  285. package/shared/focus2.js +11 -0
  286. package/shared/form-associated.js +466 -0
  287. package/shared/form-elements.js +127 -0
  288. package/shared/icon.js +538 -567
  289. package/shared/index.js +1664 -83
  290. package/shared/key-codes.js +100 -0
  291. package/shared/listbox.js +995 -0
  292. package/shared/numbers.js +34 -0
  293. package/shared/patterns/affix.d.ts +1 -1
  294. package/shared/patterns/focus.d.ts +3 -0
  295. package/shared/patterns/form-elements/form-elements.d.ts +43 -0
  296. package/shared/patterns/form-elements/index.d.ts +1 -0
  297. package/shared/patterns/index.d.ts +2 -0
  298. package/shared/radio.js +127 -0
  299. package/shared/ref.js +41 -0
  300. package/shared/repeat.js +764 -0
  301. package/shared/select.options.js +10 -0
  302. package/shared/slotted.js +1 -1
  303. package/shared/start-end.js +50 -0
  304. package/shared/string-trim.js +40 -0
  305. package/shared/strings.js +9 -0
  306. package/shared/text-anchor.js +0 -2
  307. package/shared/text-anchor.template.js +6 -5
  308. package/shared/text-field.js +3 -0
  309. package/shared/text-field2.js +225 -0
  310. package/shared/to-string.js +51 -0
  311. package/side-drawer/index.js +5 -81
  312. package/slider/index.js +17 -0
  313. package/styles/core/all.css +83 -0
  314. package/styles/core/theme.css +11 -0
  315. package/styles/core/typography.css +77 -0
  316. package/styles/tokens/theme-dark.css +228 -0
  317. package/styles/tokens/theme-light.css +228 -0
  318. package/switch/index.js +18 -0
  319. package/tab/index.js +16 -0
  320. package/tab-panel/index.js +4 -0
  321. package/tabs/index.js +24 -0
  322. package/text-anchor/index.js +11 -6
  323. package/text-area/index.js +23 -0
  324. package/text-field/index.js +24 -0
  325. package/tooltip/index.js +18 -55
  326. package/vivid.api.json +3695 -0
  327. package/lib/text/index.d.ts +0 -2
  328. package/lib/text/text.d.ts +0 -10
  329. package/shared/index2.js +0 -21
  330. package/shared/object-set-prototype-of.js +0 -1009
  331. package/shared/style-inject.es.js +0 -28
  332. package/shared/web.dom-collections.iterator.js +0 -473
  333. package/sidenav-item/index.js +0 -39
  334. package/styles/fonts/spezia.css +0 -23
  335. package/styles/themes/dark.css +0 -205
  336. package/styles/themes/light.css +0 -205
  337. package/text/index.js +0 -46
package/README.md CHANGED
@@ -1,7 +1,179 @@
1
- # components
2
1
 
3
- This library was generated with [Nx](https://nx.dev).
2
+ # Vivid UI
4
3
 
5
- ## Running unit tests
4
+ Essential UI **web components** for building modern web applications, bound to provide a **safe**, **simple** and **intuitive** interface.
6
5
 
7
- Run `nx test components` to execute the unit tests via [Jest](https://jestjs.io).
6
+ ![image](https://user-images.githubusercontent.com/10883919/189522882-968358df-ee7c-4256-b61b-550cf369a087.png)
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
+ Vivid uses `Montserrat` and `Roboto Mono` Google fonts.
53
+ Learn how to load fonts into your application [with google-fonts](https://fonts.google.com/knowledge/using_type/using_web_fonts_from_a_font_delivery_service#loading-web-fonts)
54
+
55
+ ** Unless explicitly stated otherwise, *Vonage products* should use the brand specified `Spezia` font families.
56
+ Vonage teams may review guidelines at the [Spezia webfont kit](https://github.com/Vonage/spezia-webfont-kit).
57
+
58
+ 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).
59
+ This is to allow the author to choose the most appropriate way to load the font files based on their project.
60
+
61
+ ### Core (Optional)
62
+
63
+ 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.
64
+
65
+ These styles are not required by vivid components directly. however, native HTML tags do.
66
+
67
+ These **core styles** rely on the tokens and fonts 👆 to be loaded.
68
+
69
+ 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`. When set on the `:root` (html element), typeface sizes are able to descend from the root font-size, thus comply with the [WCAG 1.4.4](https://www.w3.org/WAI/WCAG21/Understanding/resize-text)).
70
+
71
+ - `theme.css` - Sets theme related styles
72
+
73
+ - `typography.css` - Sets typography related styles
74
+
75
+ - `all.css` - Sets all the above styles
76
+
77
+ Note: scss users can simply [forward](https://sass-lang.com/documentation/at-rules/forward) the styles to their scss project:
78
+
79
+ ```css
80
+ @forward 'node_modules/@vonage/vivid/styles/[path to file].css';
81
+ ```
82
+
83
+ ## Advanced Usage
84
+
85
+ ### Scoped Elements (🧪 Alpha)
86
+
87
+ Custom elements, by browsers limitations, are registered globally, and thus may conflict when multiple versions of the library are used in the same application as all custom elements register under the same namespace.
88
+
89
+ Enforcing only a single version of the library to be used simultaneously makes it difficult to progressively migrate to newer versions of the library, as each update will require a full application update.
90
+ Also, in a micro-frontend architecture, this can be a major bottleneck as each micro-frontend may use a different version of the library.
91
+
92
+ To work around this limitation, Vivid provides a way for authors' to scope each custom element namespace by passing an argument to the `prefix` parameter when registering each custom element.
93
+
94
+ The following example will register *badge* custom element as `dashboard-badge`:
95
+
96
+ ```js
97
+ import { registerBadge } from '@vonage/vivid';
98
+
99
+ registerBadge('dashboard');
100
+ ```
101
+
102
+ then use it as:
103
+
104
+ ```html
105
+ <dashboard-badge text="dashboard scoped badge"></dashboard-badge>
106
+ ```
107
+
108
+ Remember to not include the default side-effect import (`import '@vonage/vivid/button';`) when using scoped elements as it will register the default namespace.
109
+
110
+ Even though custom elements can be registered under different namespaces, as many as needed, this approach lets you enjoy the benefits of [npm dedupe](https://docs.npmjs.com/cli/v8/commands/npm-dedupe) to ensure only a single version of the library is used in the application.
111
+
112
+ ## Support
113
+
114
+ This library is open source, developed and maintained by the [Vonage Vivid teams](https://github.com/orgs/Vonage/teams/vivid/teams).
115
+
116
+ For any questions, please open a [bug report](https://github.com/Vonage/vivid-3/issues/new?assignees=yonatankra%2C+rachelbt%2C+rinaok%2C+yinonov&labels=bug&template=bug_report.yml&title=%5BYOUR+TITLE%5D%3A+Brief+description) or [feature request](https://github.com/Vonage/vivid-3/issues/new?assignees=yonatankra%2C+rachelbt%2C+rinaok%2C+yinonov&labels=Feature+request&template=feature_request.yml&title=%5BYOUR+TITLE%5D%3A+Brief+description).
117
+
118
+ ## Roadmap
119
+
120
+ - View [components status](https://github.com/orgs/Vonage/projects/6)
121
+
122
+ - [What's on our plate](https://github.com/orgs/Vonage/projects/3/views/7)
123
+
124
+ - See the [open issues](https://github.com/vonage/vivid-3/issues) for a full list of proposed features (and known issues).
125
+
126
+ 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.
127
+
128
+ ## Contributing
129
+
130
+ Please read [CONTRIBUTING.md](https://github.com/Vonage/vivid-3/blob/main/.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
131
+
132
+ ## Versioning
133
+
134
+ We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [npm page](https://www.npmjs.com/package/@vonage/vivid).
135
+
136
+ ## Authors
137
+
138
+ See also the list of [contributors](https://github.com/Vonage/vivid-3/graphs/contributors) who participated in this project.
139
+
140
+ ## License
141
+
142
+ This project is licensed under the Apache 2.0 License - see the [LICENSE.md](https://github.com/Vonage/vivid-3/blob/main/LICENSE.md) file for details
143
+
144
+ <!-- ## Acknowledgments
145
+
146
+ - Hat tip to anyone whose code was used
147
+ - Inspiration
148
+ - etc -->
149
+
150
+ ## Built With
151
+
152
+ - [Fast](https://www.fast.design) - to extend element classes and compile code to native web components
153
+ - [Typescript](https://www.typescriptlang.org) - for ergonomic and type-safe code
154
+ - [Sass](https://sass-lang.com) - for styles authoring extensibility and consistency
155
+
156
+ ## Quickstart
157
+
158
+ Global content delivery networks can help quickly integrate content within html pages, fetching content from an URL, skipping local builds entirely.
159
+ Such practice is often used when working on POCs or reproduction environments.
160
+ 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.
161
+
162
+ The following snippet fully renders a Vivid button component
163
+
164
+ ```html
165
+ <!-- import Montserrat & Roboto-Mono fonts -->
166
+ <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
167
+ <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&family=Roboto+Mono:wght@400;500&display=swap" rel="stylesheet">
168
+
169
+ <!-- import light theme style tokens -->
170
+ <link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/tokens/theme-light.css">
171
+
172
+ <!-- import Vivid button component -->
173
+ <script type="module" src="https://unpkg.com/@vonage/vivid@next/button/index.js"></script>
174
+
175
+ <!-- Part of the app (or a whole app) that contains vivid components -->
176
+ <div class="vvd-root">
177
+ <vwc-button label="Click me" appearance="filled" connotation="cta"></vwc-button>
178
+ </div>
179
+ ```
@@ -1,61 +1,22 @@
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
- import { c as classNames } from '../shared/class-names.js';
4
-
5
- var css_248z = ".control {\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-30);\n}";
6
- styleInject(css_248z);
7
-
8
- class Accordion extends FoundationElement {
9
- constructor() {
10
- super();
11
- this.accordionItems = undefined;
12
- this.multi = false;
13
- this.addEventListener('opened', this.handleOpened);
14
- }
15
-
16
- connectedCallback() {
17
- super.connectedCallback();
18
- this.accordionItems = this.children;
19
- }
20
-
21
- handleOpened(e) {
22
- if (!this.multi && this.accordionItems) {
23
- for (let i = 0; i < this.accordionItems.length; i++) {
24
- if (this.accordionItems[i] !== e.target) {
25
- this.accordionItems[i].open = false;
26
- }
27
- }
28
- }
29
- }
30
-
31
- closeAll() {
32
- if (this.accordionItems) {
33
- for (let i = 0; i < this.accordionItems.length; i++) {
34
- this.accordionItems[i].open = false;
35
- }
36
- }
37
- }
38
-
39
- }
40
-
41
- __decorate([attr({
42
- mode: 'boolean'
43
- }), __metadata("design:type", Object)], Accordion.prototype, "multi", void 0);
44
-
45
- let _2 = t => t,
46
- _t;
47
-
48
- const getClasses = _ => classNames('control');
49
-
50
- const AccordionTemplate = () => html(_t || (_t = _2`<div class="${0}">
51
- <slot></slot>
52
- </div>`), getClasses);
53
-
54
- const vividAccordion = Accordion.compose({
55
- baseName: 'accordion',
56
- template: AccordionTemplate,
57
- styles: css_248z
58
- });
59
- designSystem.register(vividAccordion());
60
-
61
- export { vividAccordion };
1
+ import { r as registerAccordion } from '../shared/definition.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition2.js';
4
+ import '../shared/definition3.js';
5
+ import '../shared/icon.js';
6
+ import '../shared/to-string.js';
7
+ import '../shared/string-trim.js';
8
+ import '../shared/_has.js';
9
+ import '../shared/class-names.js';
10
+ import '../shared/when.js';
11
+ import '../shared/definition4.js';
12
+ import '../shared/focus.js';
13
+ import '../shared/affix.js';
14
+ import '../shared/start-end.js';
15
+ import '../shared/ref.js';
16
+ import '../shared/apply-mixins.js';
17
+ import '../shared/focus2.js';
18
+ import '../shared/key-codes.js';
19
+ import '../shared/numbers.js';
20
+ import '../shared/slotted.js';
21
+
22
+ registerAccordion();
@@ -1,120 +1,18 @@
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
- import '../shared/web.dom-collections.iterator.js';
4
- import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
5
- import { a as applyMixins } from '../shared/apply-mixins.js';
6
- import { w as when } from '../shared/when.js';
7
- import { c as classNames } from '../shared/class-names.js';
8
- import '../icon/index.js';
9
- import '../shared/object-set-prototype-of.js';
1
+ import { r as registerAccordionItem } from '../shared/definition2.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition3.js';
10
4
  import '../shared/icon.js';
5
+ import '../shared/to-string.js';
6
+ import '../shared/string-trim.js';
11
7
  import '../shared/_has.js';
12
-
13
- var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.body {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n padding: 8px 32px 24px 16px;\n}\n.icon:not(.icon-trailing) .body {\n padding-left: 48px;\n}\n\n.control {\n display: flex;\n flex-direction: column;\n}\n.control:not(.open) .toggle-close,\n.control:not(.open) .body {\n display: none;\n}\n.control.open .toggle-open {\n display: none;\n}\n.control.open .toggle-close {\n display: initial;\n}\n\n.header {\n padding: 0;\n margin: 0;\n}\n\n.button {\n font: 500 condensed 20px / 28px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 16px;\n border: 0 none;\n background: transparent;\n cursor: pointer;\n}\n.button:hover {\n background: var(--vvd-color-neutral-10);\n}\n.button .heading-text {\n flex-grow: 1;\n margin-inline-end: auto;\n text-align: left;\n}\n.button .meta {\n font: 600 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n overflow: hidden;\n max-width: 20%;\n flex-shrink: 0;\n color: var(--vvd-color-neutral-70);\n margin-inline-start: 1rem;\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}";
14
- styleInject(css_248z);
15
-
16
- class AccordionItem extends FoundationElement {
17
- constructor() {
18
- super(...arguments);
19
- this.noIndicator = false;
20
- this.open = false;
21
- }
22
-
23
- attributeChangedCallback(name, oldValue, newValue) {
24
- super.attributeChangedCallback(name, oldValue, newValue);
25
-
26
- if (name === 'open') {
27
- newValue === null ? this.emitEvent('closed') : this.emitEvent('opened');
28
- }
29
- }
30
-
31
- emitEvent(name) {
32
- const init = {
33
- bubbles: true,
34
- composed: true
35
- };
36
- const ev = new CustomEvent(name, init);
37
- this.dispatchEvent(ev);
38
- }
39
-
40
- }
41
-
42
- __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "heading", void 0);
43
-
44
- __decorate([attr({
45
- attribute: 'heading-level'
46
- }), __metadata("design:type", Number)], AccordionItem.prototype, "headingLevel", void 0);
47
-
48
- __decorate([attr({
49
- mode: 'boolean',
50
- attribute: 'no-indicator'
51
- }), __metadata("design:type", Object)], AccordionItem.prototype, "noIndicator", void 0);
52
-
53
- __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "meta", void 0);
54
-
55
- __decorate([attr({
56
- mode: 'boolean'
57
- }), __metadata("design:type", Object)], AccordionItem.prototype, "open", void 0);
58
-
59
- applyMixins(AccordionItem, AffixIconWithTrailing);
60
-
61
- let _ = t => t,
62
- _t,
63
- _t2,
64
- _t3,
65
- _t4,
66
- _t5;
67
- const PANEL = 'panel';
68
-
69
- const getClasses = ({
70
- open,
71
- iconTrailing,
72
- icon,
73
- noIndicator
74
- }) => classNames('control', ['open', open], ['icon', Boolean(icon)], ['icon-trailing', iconTrailing], ['no-indicator', noIndicator]);
75
-
76
- const AccordionItemTemplate = context => html(_t || (_t = _`
77
- <div class="${0}">
78
- ${0}
79
- <div class="body" id="${0}" role="region" aria-labelledby="header">
80
- <slot></slot>
81
- </div>
82
- </div>
83
- `), getClasses, x => renderPanelHeader(context, x.headingLevel), PANEL);
84
-
85
- const renderPanelHeader = (context, headingLevel) => {
86
- const header = headingLevel ? 'h' + headingLevel : 'h3';
87
- return html(_t2 || (_t2 = _`
88
- <${0} class="header">
89
- ${0}
90
- </${0}>
91
- `), header, renderHeaderButton(context), header);
92
- };
93
-
94
- const renderHeaderButton = context => {
95
- const affixIconTemplate = affixIconTemplateFactory(context);
96
- return html(_t3 || (_t3 = _`
97
- <button class="button" id="header" @click=${0}
98
- ?aria-expanded=${0}
99
- aria-controls="${0}">
100
- ${0}
101
- <span class="heading-text">${0}</span>
102
- ${0}
103
- <span class="indicator">
104
- ${0}
105
- </span>
106
- </button>
107
- `), 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 = _`
108
- <vwc-icon class="toggle-open" type='chevron-down-solid'></vwc-icon>
109
- <vwc-icon class="toggle-close" type='chevron-up-solid'></vwc-icon>
110
- `))));
111
- };
112
-
113
- const vividAccordionItem = AccordionItem.compose({
114
- baseName: 'accordion-item',
115
- template: AccordionItemTemplate,
116
- styles: css_248z
117
- });
118
- designSystem.register(vividAccordionItem());
119
-
120
- export { vividAccordionItem };
8
+ import '../shared/class-names.js';
9
+ import '../shared/when.js';
10
+ import '../shared/definition4.js';
11
+ import '../shared/focus.js';
12
+ import '../shared/affix.js';
13
+ import '../shared/start-end.js';
14
+ import '../shared/ref.js';
15
+ import '../shared/apply-mixins.js';
16
+ import '../shared/focus2.js';
17
+
18
+ registerAccordionItem();
@@ -0,0 +1,5 @@
1
+ import { r as registerActionGroup } from '../shared/definition5.js';
2
+ import '../shared/index.js';
3
+ import '../shared/class-names.js';
4
+
5
+ registerActionGroup();
@@ -0,0 +1,11 @@
1
+ import { r as registerAvatar } from '../shared/definition6.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition3.js';
4
+ import '../shared/icon.js';
5
+ import '../shared/to-string.js';
6
+ import '../shared/string-trim.js';
7
+ import '../shared/_has.js';
8
+ import '../shared/class-names.js';
9
+ import '../shared/when.js';
10
+
11
+ registerAvatar();
package/badge/index.js CHANGED
@@ -1,57 +1,13 @@
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 { s as styleInject } from '../shared/style-inject.es.js';
6
- import { c as classNames } from '../shared/class-names.js';
1
+ import { r as registerBadge } from '../shared/definition7.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition3.js';
7
4
  import '../shared/icon.js';
8
- import '../shared/object-set-prototype-of.js';
5
+ import '../shared/to-string.js';
6
+ import '../shared/string-trim.js';
9
7
  import '../shared/_has.js';
8
+ import '../shared/class-names.js';
10
9
  import '../shared/when.js';
11
- import '../shared/web.dom-collections.iterator.js';
10
+ import '../shared/affix.js';
11
+ import '../shared/apply-mixins.js';
12
12
 
13
- class Badge extends FoundationElement {}
14
-
15
- __decorate([attr, __metadata("design:type", String)], Badge.prototype, "connotation", void 0);
16
-
17
- __decorate([attr, __metadata("design:type", String)], Badge.prototype, "shape", void 0);
18
-
19
- __decorate([attr, __metadata("design:type", String)], Badge.prototype, "appearance", void 0);
20
-
21
- __decorate([attr, __metadata("design:type", String)], Badge.prototype, "size", void 0);
22
-
23
- __decorate([attr, __metadata("design:type", String)], Badge.prototype, "text", void 0);
24
-
25
- applyMixins(Badge, AffixIconWithTrailing);
26
-
27
- var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.control {\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\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 vertical-align: middle;\n}\n.control:not(.connotation-cta):not(.connotation-success):not(.connotation-alert):not(.connotation-warning):not(.connotation-info) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n --connotation-basis: var(--vvd-color-neutral);\n --connotation-soft: var(--vvd-color-neutral-20);\n --connotation-contrast: var(--vvd-color-neutral-90);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n --connotation-basis: var(--vvd-color-cta);\n --connotation-soft: var(--vvd-color-cta-20);\n --connotation-contrast: var(--vvd-color-cta-90);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-basis: var(--vvd-color-success);\n --connotation-soft: var(--vvd-color-success-20);\n --connotation-contrast: var(--vvd-color-success-90);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-basis: var(--vvd-color-alert);\n --connotation-soft: var(--vvd-color-alert-20);\n --connotation-contrast: var(--vvd-color-alert-90);\n}\n\n.control.connotation-warning {\n --connotation: var(--vvd-color-warning);\n --on-connotation: var(--vvd-color-on-warning);\n --connotation-basis: var(--vvd-color-warning);\n --connotation-soft: var(--vvd-color-warning-20);\n --connotation-contrast: var(--vvd-color-warning-90);\n}\n\n.control.connotation-info {\n --connotation: var(--vvd-color-info);\n --on-connotation: var(--vvd-color-on-info);\n --connotation-basis: var(--vvd-color-info);\n --connotation-soft: var(--vvd-color-info-20);\n --connotation-contrast: var(--vvd-color-info-90);\n}\n\n.control {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation);\n --_appearance-color-outline: transaprent;\n}\n.control.appearance-duotone {\n --_appearance-color-text: var(--connotation-contrast);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--connotation-basis);\n}\n.control.appearance-subtle {\n --_appearance-color-text: var(--connotation-contrast);\n --_appearance-color-fill: var(--connotation-soft);\n --_appearance-color-outline: transaprent;\n}\n\n/* Size */\n.control:not(.size-base-small):not(.size-base-large) {\n block-size: 24px;\n padding-inline: 10px;\n}\n\n.control.size-base-small {\n block-size: 20px;\n padding-inline: 8px;\n}\n\n.control.size-base-large {\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}";
28
- styleInject(css_248z);
29
-
30
- let _ = t => t,
31
- _t;
32
-
33
- const getClasses = ({
34
- connotation,
35
- appearance,
36
- shape,
37
- size,
38
- iconTrailing
39
- }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ['icon-trailing', iconTrailing]);
40
-
41
- const badgeTemplate = context => {
42
- const affixIconTemplate = affixIconTemplateFactory(context);
43
- return html(_t || (_t = _`
44
- <span class="${0}">
45
- ${0}
46
- ${0}
47
- </span>`), getClasses, x => affixIconTemplate(x.icon), x => x.text);
48
- };
49
-
50
- const VIVIDBadge = Badge.compose({
51
- baseName: 'badge',
52
- template: badgeTemplate,
53
- styles: css_248z
54
- });
55
- designSystem.register(VIVIDBadge());
56
-
57
- export { VIVIDBadge };
13
+ registerBadge();