@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.
Files changed (176) hide show
  1. package/README.md +141 -4
  2. package/accordion/index.js +2 -4
  3. package/accordion-item/index.js +26 -20
  4. package/action-group/index.js +47 -0
  5. package/avatar/index.js +70 -0
  6. package/badge/index.js +17 -21
  7. package/banner/index.js +23 -87
  8. package/breadcrumb/index.js +21 -18
  9. package/breadcrumb-item/index.js +19 -12
  10. package/button/index.js +19 -757
  11. package/calendar/index.js +67 -25
  12. package/calendar-event/index.js +115 -0
  13. package/card/index.js +132 -0
  14. package/checkbox/index.js +184 -0
  15. package/dialog/index.js +281 -0
  16. package/divider/index.js +3 -0
  17. package/elevation/index.js +3 -31
  18. package/fab/index.js +105 -0
  19. package/focus/index.js +18 -3
  20. package/header/index.js +66 -0
  21. package/icon/index.js +9 -5
  22. package/index.js +53 -20
  23. package/layout/index.js +4 -6
  24. package/lib/accordion-item/accordion-item.d.ts +2 -2
  25. package/lib/accordion-item/index.d.ts +2 -1
  26. package/lib/action-group/action-group.d.ts +10 -0
  27. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  28. package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
  29. package/lib/avatar/avatar.d.ts +15 -0
  30. package/lib/avatar/avatar.template.d.ts +4 -0
  31. package/lib/avatar/index.d.ts +3 -0
  32. package/lib/badge/badge.d.ts +5 -5
  33. package/lib/badge/index.d.ts +1 -1
  34. package/lib/banner/banner.d.ts +1 -1
  35. package/lib/banner/banner.template.d.ts +0 -2
  36. package/lib/banner/index.d.ts +1 -0
  37. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  38. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  39. package/lib/breadcrumb-item/index.d.ts +1 -0
  40. package/lib/button/button.d.ts +6 -5
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +3 -1
  43. package/lib/calendar/index.d.ts +0 -1
  44. package/lib/calendar-event/calendar-event.d.ts +14 -0
  45. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  46. package/lib/calendar-event/index.d.ts +2 -0
  47. package/lib/card/card.d.ts +10 -0
  48. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  49. package/lib/card/index.d.ts +4 -0
  50. package/lib/checkbox/checkbox.d.ts +5 -0
  51. package/lib/checkbox/checkbox.template.d.ts +4 -0
  52. package/lib/checkbox/index.d.ts +4 -0
  53. package/lib/components.d.ts +27 -10
  54. package/lib/dialog/dialog.d.ts +20 -0
  55. package/lib/dialog/dialog.template.d.ts +4 -0
  56. package/lib/dialog/index.d.ts +5 -0
  57. package/lib/divider/divider.d.ts +3 -0
  58. package/lib/divider/divider.template.d.ts +4 -0
  59. package/lib/divider/index.d.ts +2 -0
  60. package/lib/elevation/elevation.d.ts +1 -0
  61. package/lib/elevation/index.d.ts +1 -1
  62. package/lib/enums.d.ts +11 -6
  63. package/lib/fab/fab.d.ts +13 -0
  64. package/lib/fab/fab.template.d.ts +4 -0
  65. package/lib/fab/index.d.ts +4 -0
  66. package/lib/focus/index.d.ts +1 -1
  67. package/lib/header/header.d.ts +5 -0
  68. package/lib/header/header.template.d.ts +4 -0
  69. package/lib/header/index.d.ts +3 -0
  70. package/lib/icon/icon.d.ts +4 -3
  71. package/lib/layout/index.d.ts +1 -1
  72. package/lib/layout/layout.d.ts +3 -3
  73. package/lib/menu/index.d.ts +12 -0
  74. package/lib/menu/menu.d.ts +10 -0
  75. package/lib/menu/menu.template.d.ts +3 -0
  76. package/lib/menu-item/index.d.ts +3 -0
  77. package/lib/menu-item/menu-item.d.ts +7 -0
  78. package/lib/menu-item/menu-item.template.d.ts +5 -0
  79. package/lib/nav/index.d.ts +2 -0
  80. package/lib/nav/nav.d.ts +3 -0
  81. package/lib/nav/nav.template.d.ts +4 -0
  82. package/lib/nav-disclosure/index.d.ts +4 -0
  83. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  84. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  85. package/lib/nav-item/index.d.ts +4 -0
  86. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  87. package/lib/nav-item/nav-item.template.d.ts +4 -0
  88. package/lib/{text → note}/index.d.ts +1 -1
  89. package/lib/note/note.d.ts +10 -0
  90. package/lib/note/note.template.d.ts +5 -0
  91. package/lib/number-field/index.d.ts +4 -0
  92. package/lib/number-field/number-field.d.ts +16 -0
  93. package/lib/number-field/number-field.template.d.ts +4 -0
  94. package/lib/popup/index.d.ts +1 -1
  95. package/lib/popup/popup.d.ts +2 -1
  96. package/lib/progress/progress.d.ts +1 -1
  97. package/lib/progress-ring/progress-ring.d.ts +2 -1
  98. package/lib/radio/index.d.ts +3 -0
  99. package/lib/radio/radio.d.ts +4 -0
  100. package/lib/radio/radio.template.d.ts +4 -0
  101. package/lib/side-drawer/index.d.ts +1 -1
  102. package/lib/side-drawer/side-drawer.d.ts +3 -2
  103. package/lib/text-anchor/text-anchor.d.ts +1 -1
  104. package/lib/text-area/index.d.ts +3 -0
  105. package/lib/text-area/text-area.d.ts +9 -0
  106. package/lib/text-area/text-area.template.d.ts +4 -0
  107. package/lib/text-field/index.d.ts +4 -0
  108. package/lib/text-field/text-field.d.ts +16 -0
  109. package/lib/text-field/text-field.template.d.ts +5 -0
  110. package/lib/tooltip/tooltip.d.ts +2 -2
  111. package/menu/index.js +381 -0
  112. package/menu-item/index.js +19 -0
  113. package/nav/index.js +17 -0
  114. package/nav-disclosure/index.js +88 -0
  115. package/nav-item/index.js +45 -0
  116. package/note/index.js +66 -0
  117. package/number-field/index.js +529 -0
  118. package/package.json +51 -7
  119. package/popup/index.js +23 -2061
  120. package/progress/index.js +35 -28
  121. package/progress-ring/index.js +9 -5
  122. package/radio/index.js +174 -0
  123. package/shared/anchor.js +10 -2
  124. package/shared/aria-global.js +2 -86
  125. package/shared/base-progress.js +5 -0
  126. package/shared/breadcrumb-item.js +1 -1
  127. package/shared/button.js +200 -0
  128. package/shared/calendar-event.js +26 -0
  129. package/shared/dialog-polyfill.esm.js +858 -0
  130. package/shared/enums.js +79 -0
  131. package/shared/es.object.assign.js +7 -6
  132. package/shared/export.js +995 -0
  133. package/shared/focus.js +5 -0
  134. package/shared/focus2.js +11 -0
  135. package/shared/form-associated.js +466 -0
  136. package/shared/form-elements.js +299 -0
  137. package/shared/icon.js +533 -520
  138. package/shared/index.js +71 -55
  139. package/shared/index2.js +110 -13
  140. package/shared/index3.js +35 -0
  141. package/shared/index4.js +86 -0
  142. package/shared/index5.js +2100 -0
  143. package/shared/index6.js +371 -0
  144. package/shared/iterators.js +61 -0
  145. package/shared/key-codes.js +90 -0
  146. package/shared/object-keys.js +13 -0
  147. package/shared/patterns/focus.d.ts +3 -0
  148. package/shared/patterns/form-elements.d.ts +22 -0
  149. package/shared/patterns/index.d.ts +1 -0
  150. package/shared/ref.js +41 -0
  151. package/shared/regexp-flags.js +21 -0
  152. package/shared/start-end.js +50 -0
  153. package/shared/text-anchor.js +2 -11
  154. package/shared/text-anchor.template.js +5 -2
  155. package/shared/to-string.js +51 -0
  156. package/shared/web.dom-collections.iterator.js +78 -1083
  157. package/side-drawer/index.js +44 -23
  158. package/styles/core/all.css +75 -0
  159. package/styles/core/theme.css +11 -0
  160. package/styles/core/typography.css +69 -0
  161. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  162. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  163. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  164. package/styles/fonts/spezia.css +9 -12
  165. package/styles/tokens/theme-dark.css +211 -0
  166. package/styles/tokens/theme-light.css +211 -0
  167. package/text-anchor/index.js +9 -1
  168. package/text-area/index.js +304 -0
  169. package/text-field/index.js +152 -0
  170. package/tooltip/index.js +23 -16
  171. package/lib/text/text.d.ts +0 -10
  172. package/shared/style-inject.es.js +0 -28
  173. package/sidenav-item/index.js +0 -38
  174. package/styles/themes/dark.css +0 -205
  175. package/styles/themes/light.css +0 -205
  176. package/text/index.js +0 -45
package/progress/index.js CHANGED
@@ -1,18 +1,19 @@
1
1
  import { _ 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 { h as classofRaw, _ as _export, f as functionUncurryThis } from '../shared/web.dom-collections.iterator.js';
2
+ import '../shared/web.dom-collections.iterator.js';
3
+ import { c as classofRaw, _ as _export, f as functionUncurryThis } from '../shared/export.js';
4
4
  import { B as BaseProgress } from '../shared/base-progress.js';
5
5
  import { w as when } from '../shared/when.js';
6
6
  import { c as classNames } from '../shared/class-names.js';
7
+ import '../shared/object-keys.js';
8
+ import '../shared/iterators.js';
7
9
 
8
- var css_248z = ".base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n}\n\n.base:not(.connotation-pacific):not(.connotation-cta):not(.connotation-alert):not(.connotation-success) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n}\n\n.base.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n}\n\n.base.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n}\n\n.base.connotation-pacific {\n --connotation: linear-gradient(to right, var(--vvd-color-info-30), var(--vvd-color-cta-70));\n}\n\n.indeterminate {\n display: flex;\n overflow: hidden;\n width: 100%;\n height: 100%;\n border-radius: 3px;\n}\n\n.progress {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--vvd-color-neutral-20);\n block-size: 100%;\n inline-size: 100%;\n}\n.progress .indeterminate {\n background-color: var(--connotation);\n}\n\n.determinate {\n background-color: var(--connotation);\n block-size: 100%;\n border-radius: 3px;\n transition: all 0.2s ease-in-out;\n}\n.connotation-pacific .determinate {\n background-image: var(--connotation);\n}\n\n.indeterminate-indicator-1, .indeterminate-indicator-2 {\n position: absolute;\n animation: indeterminate-1 2s infinite;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-20);\n block-size: 100%;\n inline-size: 30%;\n opacity: 0;\n}\n\n.indeterminate-indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.connotation-pacific .indeterminate-indicator-1, .connotation-pacific .indeterminate-indicator-2 {\n background-image: var(--connotation);\n}\n\n.reverse .indeterminate-indicator-1, .reverse .indeterminate-indicator-2 {\n animation-direction: reverse;\n}\n.reverse .determinate {\n position: absolute;\n right: 0;\n}\n\n.base.shape-sharp .determinate, .base.shape-sharp .indeterminate {\n border-radius: 0;\n}\n\n.base.paused .indeterminate-indicator-1,\n.base.paused .indeterminate-indicator-2 {\n animation-play-state: paused;\n background-color: var(--connotation);\n}\n\n.base.paused .determinate {\n background-color: var(--vvd-color-neutral-40);\n}\n\n@keyframes indeterminate-1 {\n 0% {\n opacity: 1;\n transform: translateX(-100%);\n }\n 70% {\n opacity: 1;\n transform: translateX(300%);\n }\n 70.01% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translateX(300%);\n }\n}\n@keyframes indeterminate-2 {\n 0% {\n opacity: 0;\n transform: translateX(-150%);\n }\n 29.99% {\n opacity: 0;\n }\n 30% {\n opacity: 1;\n transform: translateX(-150%);\n }\n 100% {\n opacity: 1;\n transform: translateX(166.66%);\n }\n}";
9
- styleInject(css_248z);
10
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 GMT\n */\n.base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.base:not(.connotation-pacific).connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base:not(.connotation-pacific).connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600));\n}\n\n.progress {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: center;\n background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n inline-size: 100%;\n /* Shape */\n}\n.base:not(.shape-sharp) .progress {\n border-radius: 3px;\n}\n\n.indeterminate {\n display: flex;\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n\n.determinate {\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n transition: all 0.2s ease-in-out;\n}\n.connotation-pacific .determinate {\n background-image: var(--_connotation-color-primary);\n}\n.reverse .determinate {\n position: absolute;\n right: 0;\n}\n.paused .determinate {\n background-color: var(--vvd-color-neutral-300);\n}\n\n.indicator-1 {\n animation: indeterminate-1 2s infinite;\n inline-size: 30%;\n}\n\n.indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.indicator-1,\n.indicator-2 {\n position: absolute;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n opacity: 0;\n}\n.connotation-pacific .indicator-1,\n.connotation-pacific .indicator-2 {\n background-image: var(--_connotation-color-primary);\n}\n.paused .indicator-1,\n.paused .indicator-2 {\n animation-play-state: paused;\n background-color: var(--_connotation-color-primary);\n}\n.reverse .indicator-1,\n.reverse .indicator-2 {\n animation-direction: reverse;\n}\n\n@keyframes indeterminate-1 {\n 0% {\n opacity: 1;\n transform: translateX(-100%);\n }\n 70% {\n opacity: 1;\n transform: translateX(300%);\n }\n 70.01% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translateX(300%);\n }\n}\n@keyframes indeterminate-2 {\n 0% {\n opacity: 0;\n transform: translateX(-150%);\n }\n 29.99% {\n opacity: 0;\n }\n 30% {\n opacity: 1;\n transform: translateX(-150%);\n }\n 100% {\n opacity: 1;\n transform: translateX(166.66%);\n }\n}";
10
11
 
11
12
  var classof = classofRaw;
12
13
 
13
14
  // `IsArray` abstract operation
14
15
  // https://tc39.es/ecma262/#sec-isarray
15
- // eslint-disable-next-line es/no-array-isarray -- safe
16
+ // eslint-disable-next-line es-x/no-array-isarray -- safe
16
17
  var isArray$1 = Array.isArray || function isArray(argument) {
17
18
  return classof(argument) == 'Array';
18
19
  };
@@ -21,7 +22,7 @@ var $ = _export;
21
22
  var uncurryThis = functionUncurryThis;
22
23
  var isArray = isArray$1;
23
24
 
24
- var un$Reverse = uncurryThis([].reverse);
25
+ var nativeReverse = uncurryThis([].reverse);
25
26
  var test = [1, 2];
26
27
 
27
28
  // `Array.prototype.reverse` method
@@ -32,7 +33,7 @@ $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()
32
33
  reverse: function reverse() {
33
34
  // eslint-disable-next-line no-self-assign -- dirty hack
34
35
  if (isArray(this)) this.length = this.length;
35
- return un$Reverse(this);
36
+ return nativeReverse(this);
36
37
  }
37
38
  });
38
39
 
@@ -57,35 +58,41 @@ let _2 = t => t,
57
58
  _t2,
58
59
  _t3;
59
60
 
60
- const getClasses = _ => classNames('base', [`connotation-${_.connotation}`, !!_.connotation], [`shape-${_.shape}`, !!_.shape], ['reverse', _.reverse]);
61
+ const getClasses = ({
62
+ connotation,
63
+ shape,
64
+ reverse,
65
+ paused
66
+ }) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
61
67
 
62
- const ProgressTemplate = _ => {
68
+ function determinate() {
63
69
  return html(_t || (_t = _2`
70
+ <span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
71
+ }
72
+
73
+ function indeterminate() {
74
+ return html(_t2 || (_t2 = _2`
75
+ <span class="indeterminate" name="indeterminate">
76
+ <span class="indicator-1"></span>
77
+ <span class="indicator-2"></span>
78
+ </span>`));
79
+ }
80
+
81
+ const ProgressTemplate = _ => {
82
+ return html(_t3 || (_t3 = _2`
64
83
  <div
65
84
  role="progressbar"
66
85
  aria-valuenow="${0}"
67
86
  aria-valuemin="${0}"
68
87
  aria-valuemax="${0}"
69
- class="${0} ${0}"
88
+ class="${0}"
70
89
  >
71
- ${0}
72
- ${0}
73
- </div>
74
- `), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
75
- <div class="progress">
76
- <div
77
- class="determinate"
78
- style="width: ${0}%"
79
- ></div>
80
- </div>
81
- `), x => x.percentComplete)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
82
- <div class="progress indeterminate">
83
- <span class="indeterminate" name="indeterminate">
84
- <span class="indeterminate-indicator-1"></span>
85
- <span class="indeterminate-indicator-2"></span>
86
- </span>
87
- </div>
88
- `))));
90
+ <div class="progress">
91
+ ${0}
92
+ ${0}
93
+ </div>
94
+ </div>
95
+ `), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
89
96
  };
90
97
 
91
98
  const vividProgress = Progress.compose({
@@ -1,22 +1,26 @@
1
1
  import { _ 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 { B as BaseProgress } from '../shared/base-progress.js';
4
3
  import { w as when } from '../shared/when.js';
5
4
  import { c as classNames } from '../shared/class-names.js';
6
5
 
7
- var css_248z = ".base {\n width: 36px;\n height: 36px;\n align-items: center;\n outline: none;\n}\n.base.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n}\n\n.base:not(.connotation-cta):not(.connotation-alert):not(.connotation-success) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n}\n\n.base.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n}\n\n.base.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n}\n\n.base.base-large {\n width: 48px;\n height: 48px;\n}\n\n.base.base-small {\n width: 24px;\n height: 24px;\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 2px;\n}\n\n.determinate {\n fill: none;\n stroke: var(--connotation);\n stroke-linecap: round;\n stroke-width: 2px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.indeterminate-indicator-1 {\n animation: spin-infinite 2s linear infinite;\n fill: none;\n stroke: var(--connotation);\n stroke-linecap: round;\n stroke-width: 2px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.base.paused .indeterminate-indicator-1 {\n animation-play-state: paused;\n stroke: var(--vvd-color-neutral);\n}\n\n.base.paused .determinate {\n stroke: var(--vvd-color-neutral);\n}\n\n@keyframes spin-infinite {\n 0% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(0deg);\n }\n 50% {\n stroke-dasharray: 21.99px 21.99px;\n transform: rotate(450deg);\n }\n 100% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(1080deg);\n }\n}";
8
- styleInject(css_248z);
6
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 GMT\n */\n.base {\n align-items: center;\n block-size: var(--_density);\n color: var(--_appearance-color-text);\n inline-size: var(--_density);\n outline: none;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.density-5 {\n --_density: calc(5 * 4px);\n}\n.base.density-6 {\n --_density: calc(6 * 4px);\n}\n.base.density-7 {\n --_density: calc(7 * 4px);\n}\n.base.density-8 {\n --_density: calc(8 * 4px);\n}\n.base.density-9 {\n --_density: calc(9 * 4px);\n}\n.base.density-11 {\n --_density: calc(11 * 4px);\n}\n.base.density-12 {\n --_density: calc(12 * 4px);\n}\n.base.density-13 {\n --_density: calc(13 * 4px);\n}\n.base:not(.density-5, .density-6, .density-7, .density-8, .density-9, .density-11, .density-12, .density-13) {\n --_density: calc(10 * 4px);\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 2px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 2px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.indeterminate-indicator-1 {\n animation: spin-infinite 2s linear infinite;\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 2px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.base.paused .indeterminate-indicator-1 {\n animation-play-state: paused;\n}\n\n@keyframes spin-infinite {\n 0% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(0deg);\n }\n 50% {\n stroke-dasharray: 21.99px 21.99px;\n transform: rotate(450deg);\n }\n 100% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(1080deg);\n }\n}";
9
7
 
10
8
  class ProgressRing extends BaseProgress {}
11
9
 
12
- __decorate([attr(), __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
10
+ __decorate([attr, __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
11
+
12
+ __decorate([attr, __metadata("design:type", Number)], ProgressRing.prototype, "density", void 0);
13
13
 
14
14
  let _2 = t => t,
15
15
  _t,
16
16
  _t2,
17
17
  _t3;
18
18
 
19
- const getClasses = _ => classNames('base', [`connotation-${_.connotation}`, !!_.connotation]);
19
+ const getClasses = ({
20
+ connotation,
21
+ density,
22
+ paused
23
+ }) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`density-${(density ? Number(density) : 0) + 10}`, !!density]);
20
24
 
21
25
  const progressSegments = 44;
22
26
  const ProgressRingTemplate = _ => html(_t || (_t = _2`
package/radio/index.js ADDED
@@ -0,0 +1,174 @@
1
+ import '../focus/index.js';
2
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
3
+ import { C as CheckableFormAssociated } from '../shared/form-associated.js';
4
+ import { a as keySpace } from '../shared/key-codes.js';
5
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
6
+ import { w as when } from '../shared/when.js';
7
+ import { c as classNames } from '../shared/class-names.js';
8
+ import '../shared/focus.js';
9
+
10
+ class _Radio extends FoundationElement {
11
+ }
12
+ /**
13
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Radio:class)} component.
14
+ *
15
+ * @internal
16
+ */
17
+ class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.proxy = document.createElement("input");
21
+ }
22
+ }
23
+
24
+ /**
25
+ * A Radio Custom HTML Element.
26
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radio | ARIA radio }.
27
+ *
28
+ * @slot checked-indicator - The checked indicator
29
+ * @slot - The default slot for the label
30
+ * @csspart control - The element representing the visual radio control
31
+ * @csspart label - The label
32
+ * @fires change - Emits a custom change event when the checked state changes
33
+ *
34
+ * @public
35
+ */
36
+ class Radio$1 extends FormAssociatedRadio {
37
+ constructor() {
38
+ super();
39
+ /**
40
+ * The element's value to be included in form submission when checked.
41
+ * Default to "on" to reach parity with input[type="radio"]
42
+ *
43
+ * @internal
44
+ */
45
+ this.initialValue = "on";
46
+ /**
47
+ * @internal
48
+ */
49
+ this.keypressHandler = (e) => {
50
+ switch (e.key) {
51
+ case keySpace:
52
+ if (!this.checked && !this.readOnly) {
53
+ this.checked = true;
54
+ }
55
+ return;
56
+ }
57
+ return true;
58
+ };
59
+ this.proxy.setAttribute("type", "radio");
60
+ }
61
+ readOnlyChanged() {
62
+ if (this.proxy instanceof HTMLInputElement) {
63
+ this.proxy.readOnly = this.readOnly;
64
+ }
65
+ }
66
+ /**
67
+ * @internal
68
+ */
69
+ defaultCheckedChanged() {
70
+ var _a;
71
+ if (this.$fastController.isConnected && !this.dirtyChecked) {
72
+ // Setting this.checked will cause us to enter a dirty state,
73
+ // but if we are clean when defaultChecked is changed, we want to stay
74
+ // in a clean state, so reset this.dirtyChecked
75
+ if (!this.isInsideRadioGroup()) {
76
+ this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false;
77
+ this.dirtyChecked = false;
78
+ }
79
+ }
80
+ }
81
+ /**
82
+ * @internal
83
+ */
84
+ connectedCallback() {
85
+ var _a, _b;
86
+ super.connectedCallback();
87
+ this.validate();
88
+ if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" &&
89
+ this.getAttribute("tabindex") === null) {
90
+ if (!this.disabled) {
91
+ this.setAttribute("tabindex", "0");
92
+ }
93
+ }
94
+ if (this.checkedAttribute) {
95
+ if (!this.dirtyChecked) {
96
+ // Setting this.checked will cause us to enter a dirty state,
97
+ // but if we are clean when defaultChecked is changed, we want to stay
98
+ // in a clean state, so reset this.dirtyChecked
99
+ if (!this.isInsideRadioGroup()) {
100
+ this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false;
101
+ this.dirtyChecked = false;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ isInsideRadioGroup() {
107
+ const parent = this.closest("[role=radiogroup]");
108
+ return parent !== null;
109
+ }
110
+ /**
111
+ * @internal
112
+ */
113
+ clickHandler(e) {
114
+ if (!this.disabled && !this.readOnly && !this.checked) {
115
+ this.checked = true;
116
+ }
117
+ }
118
+ }
119
+ __decorate([
120
+ attr({ attribute: "readonly", mode: "boolean" })
121
+ ], Radio$1.prototype, "readOnly", void 0);
122
+ __decorate([
123
+ observable
124
+ ], Radio$1.prototype, "name", void 0);
125
+ __decorate([
126
+ observable
127
+ ], Radio$1.prototype, "defaultSlottedNodes", void 0);
128
+
129
+ 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 align-items: center;\n cursor: pointer;\n gap: 8px;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\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:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-canvas-text);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n@supports selector(:focus-visible) {\n .base:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base.disabled {\n cursor: not-allowed;\n}\n\n.control {\n position: relative;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n background-color: var(--vvd-color-canvas);\n border-radius: 50%;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n}\n.control::after {\n position: absolute;\n background-color: var(--_appearance-color-outline);\n border-radius: inherit;\n content: \"\";\n inset: 5px;\n}\n.base:not(.checked) .control::after {\n display: none;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-font-base);\n}\n.base.disabled label {\n color: var(--vvd-color-neutral-400);\n cursor: not-allowed;\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 50%;\n}\n.base:not(:focus-visible) .focus-indicator {\n display: none;\n}";
130
+
131
+ class Radio extends Radio$1 {}
132
+
133
+ __decorate([attr, __metadata("design:type", String)], Radio.prototype, "label", void 0);
134
+
135
+ let _ = t => t,
136
+ _t,
137
+ _t2;
138
+
139
+ const getClasses = ({
140
+ checked,
141
+ disabled
142
+ }) => classNames('base', ['checked', Boolean(checked)], ['disabled', Boolean(disabled)]);
143
+
144
+ const RadioTemplate = context => {
145
+ const focusTemplate = focusTemplateFactory(context);
146
+ return html(_t || (_t = _`
147
+ <span class="${0}"
148
+ role="radio"
149
+ aria-checked="${0}"
150
+ aria-required="${0}"
151
+ aria-disabled="${0}"
152
+ tabindex="${0}"
153
+ @keypress="${0}"
154
+ @click="${0}"
155
+ >
156
+ <div class="control">
157
+ ${0}
158
+ </div>
159
+ ${0}
160
+ </span>
161
+ `), getClasses, x => x.checked, x => x.required, x => x.disabled, x => x.disabled ? null : 0, (x, c) => x.keypressHandler(c.event), (x, c) => x.clickHandler(c.event), () => focusTemplate, when(x => x.label, html(_t2 || (_t2 = _`<label class="label">${0}</label>`), x => x.label)));
162
+ };
163
+
164
+ const vividRadio = Radio.compose({
165
+ baseName: 'radio',
166
+ template: RadioTemplate,
167
+ styles: css_248z,
168
+ shadowOptions: {
169
+ delegatesFocus: true
170
+ }
171
+ });
172
+ designSystem.register(vividRadio());
173
+
174
+ export { vividRadio };
package/shared/anchor.js CHANGED
@@ -1,11 +1,18 @@
1
1
  import { F as FoundationElement, _ as __decorate, a as attr, o as observable } from './index.js';
2
2
  import { a as applyMixins } from './apply-mixins.js';
3
- import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global.js';
3
+ import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
4
+ import { S as StartEnd } from './start-end.js';
4
5
 
5
6
  /**
6
7
  * An Anchor Custom HTML Element.
7
8
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
8
9
  *
10
+ * @slot start - Content which can be provided before the anchor content
11
+ * @slot end - Content which can be provided after the anchor content
12
+ * @slot - The default slot for anchor content
13
+ * @csspart control - The anchor element
14
+ * @csspart content - The element wrapping anchor content
15
+ *
9
16
  * @public
10
17
  */
11
18
  class Anchor extends FoundationElement {
@@ -20,7 +27,8 @@ class Anchor extends FoundationElement {
20
27
  var _a;
21
28
  // Check to see if delegatesFocus is supported
22
29
  if (window.ShadowRoot &&
23
- !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
30
+ !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
31
+ ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
24
32
  this.focus = () => {
25
33
  this.control.focus();
26
34
  };
@@ -1,88 +1,4 @@
1
- import { A as AttachedBehaviorHTMLDirective, h as html, _ as __decorate, a as attr } from './index.js';
2
-
3
- /**
4
- * The runtime behavior for template references.
5
- * @public
6
- */
7
- class RefBehavior {
8
- /**
9
- * Creates an instance of RefBehavior.
10
- * @param target - The element to reference.
11
- * @param propertyName - The name of the property to assign the reference to.
12
- */
13
- constructor(target, propertyName) {
14
- this.target = target;
15
- this.propertyName = propertyName;
16
- }
17
- /**
18
- * Bind this behavior to the source.
19
- * @param source - The source to bind to.
20
- * @param context - The execution context that the binding is operating within.
21
- */
22
- bind(source) {
23
- source[this.propertyName] = this.target;
24
- }
25
- /**
26
- * Unbinds this behavior from the source.
27
- * @param source - The source to unbind from.
28
- */
29
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
30
- unbind() { }
31
- }
32
- /**
33
- * A directive that observes the updates a property with a reference to the element.
34
- * @param propertyName - The name of the property to assign the reference to.
35
- * @public
36
- */
37
- function ref(propertyName) {
38
- return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName);
39
- }
40
-
41
- /**
42
- * A mixin class implementing start and end elements.
43
- * These are generally used to decorate text elements with icons or other visual indicators.
44
- * @public
45
- */
46
- class StartEnd {
47
- handleStartContentChange() {
48
- this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0);
49
- }
50
- handleEndContentChange() {
51
- this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0);
52
- }
53
- }
54
- /**
55
- * The template for the end element.
56
- * For use with {@link StartEnd}
57
- *
58
- * @public
59
- * @deprecated - use endSlotTemplate
60
- */
61
- html `
62
- <span part="end" ${ref("endContainer")}>
63
- <slot
64
- name="end"
65
- ${ref("end")}
66
- @slotchange="${x => x.handleEndContentChange()}"
67
- ></slot>
68
- </span>
69
- `;
70
- /**
71
- * The template for the start element.
72
- * For use with {@link StartEnd}
73
- *
74
- * @public
75
- * @deprecated - use startSlotTemplate
76
- */
77
- html `
78
- <span part="start" ${ref("startContainer")}>
79
- <slot
80
- name="start"
81
- ${ref("start")}
82
- @slotchange="${x => x.handleStartContentChange()}"
83
- ></slot>
84
- </span>
85
- `;
1
+ import { _ as __decorate, a as attr } from './index.js';
86
2
 
87
3
  /**
88
4
  * Some states and properties are applicable to all host language elements regardless of whether a role is applied.
@@ -153,4 +69,4 @@ __decorate([
153
69
  attr({ attribute: "aria-roledescription" })
154
70
  ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
155
71
 
156
- export { ARIAGlobalStatesAndProperties as A, StartEnd as S, ref as r };
72
+ export { ARIAGlobalStatesAndProperties as A };
@@ -4,6 +4,11 @@ import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumber
4
4
  * An Progress HTML Element.
5
5
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
6
6
  *
7
+ * @slot indeterminate - The slot for a custom indeterminate indicator
8
+ * @csspart progress - Represents the progress element
9
+ * @csspart determinate - The determinate indicator
10
+ * @csspart indeterminate - The indeterminate indicator
11
+ *
7
12
  * @public
8
13
  */
9
14
  class BaseProgress extends FoundationElement {
@@ -1,7 +1,7 @@
1
1
  import { _ as __decorate, o as observable } from './index.js';
2
2
  import { A as Anchor, D as DelegatesARIALink } from './anchor.js';
3
3
  import { a as applyMixins } from './apply-mixins.js';
4
- import { S as StartEnd } from './aria-global.js';
4
+ import { S as StartEnd } from './start-end.js';
5
5
 
6
6
  /**
7
7
  * A Breadcrumb Item Custom HTML Element.