@vonage/vivid 3.36.0 → 3.38.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 (168) hide show
  1. package/accordion/index.js +3 -4
  2. package/accordion-item/index.js +3 -2
  3. package/alert/index.js +5 -4
  4. package/avatar/index.js +1 -1
  5. package/badge/index.js +2 -1
  6. package/banner/index.js +4 -3
  7. package/breadcrumb/index.js +0 -1
  8. package/breadcrumb-item/index.js +3 -2
  9. package/button/index.js +4 -3
  10. package/card/index.js +2 -3
  11. package/checkbox/index.js +3 -4
  12. package/combobox/index.js +7 -8
  13. package/custom-elements.json +386 -758
  14. package/data-grid/index.js +2 -3
  15. package/date-picker/index.js +10 -9
  16. package/date-range-picker/index.js +36 -0
  17. package/dialog/index.js +6 -7
  18. package/divider/index.js +1 -1
  19. package/elevation/index.js +1 -1
  20. package/empty-state/index.js +2 -3
  21. package/fab/index.js +4 -3
  22. package/file-picker/index.js +6 -4
  23. package/focus/index.js +1 -1
  24. package/header/index.js +2 -2
  25. package/icon/index.js +1 -1
  26. package/index.js +44 -42
  27. package/layout/index.js +1 -1
  28. package/lib/components.d.ts +1 -0
  29. package/lib/date-picker/date-picker.d.ts +5 -15
  30. package/lib/date-range-picker/date-range-picker.d.ts +16 -0
  31. package/lib/date-range-picker/definition.d.ts +3 -0
  32. package/lib/file-picker/file-picker.d.ts +8 -5
  33. package/lib/file-picker/file-picker.form-associated.d.ts +10 -0
  34. package/lib/file-picker/locale.d.ts +6 -0
  35. package/lib/number-field/number-field.d.ts +6 -2
  36. package/lib/tag-group/tag-group.d.ts +1 -0
  37. package/lib/tree-item/tree-item.template.d.ts +1 -1
  38. package/listbox/index.js +4 -5
  39. package/locales/en-GB.js +27 -3
  40. package/locales/en-US.js +27 -3
  41. package/locales/ja-JP.js +25 -1
  42. package/locales/zh-CN.js +25 -1
  43. package/menu/index.js +8 -9
  44. package/menu-item/index.js +4 -5
  45. package/nav/index.js +1 -1
  46. package/nav-disclosure/index.js +4 -3
  47. package/nav-item/index.js +4 -3
  48. package/note/index.js +3 -2
  49. package/number-field/index.js +6 -5
  50. package/option/index.js +4 -3
  51. package/package.json +1 -1
  52. package/pagination/index.js +5 -5
  53. package/popup/index.js +6 -5
  54. package/progress/index.js +1 -1
  55. package/progress-ring/index.js +1 -1
  56. package/radio/index.js +2 -2
  57. package/radio-group/index.js +2 -3
  58. package/select/index.js +8 -9
  59. package/shared/affix.js +5 -1
  60. package/shared/apply-mixins.js +1 -1
  61. package/shared/children.js +2 -2
  62. package/shared/date-picker/calendar/dateRange.d.ts +5 -0
  63. package/shared/date-picker/calendar/presentationDateRange.d.ts +5 -0
  64. package/shared/date-picker/date-picker-base.d.ts +20 -0
  65. package/shared/date-picker/date-picker-base.form-associated.d.ts +10 -0
  66. package/shared/date-picker/date-picker-base.template.d.ts +4 -0
  67. package/{lib → shared}/date-picker/locale.d.ts +6 -0
  68. package/shared/definition.js +5 -5
  69. package/shared/definition10.js +9 -14
  70. package/shared/definition11.js +1 -1
  71. package/shared/definition12.js +1 -1
  72. package/shared/definition13.js +3 -3
  73. package/shared/definition14.js +3 -3
  74. package/shared/definition15.js +5 -5
  75. package/shared/definition16.js +4 -5
  76. package/shared/definition17.js +59 -6016
  77. package/shared/definition18.js +350 -213
  78. package/shared/definition19.js +251 -67
  79. package/shared/definition2.js +2 -3
  80. package/shared/definition20.js +66 -58
  81. package/shared/definition21.js +43 -83
  82. package/shared/definition22.js +75 -2298
  83. package/shared/definition23.js +2361 -45
  84. package/shared/definition24.js +63 -27
  85. package/shared/definition25.js +24 -51
  86. package/shared/definition26.js +36 -806
  87. package/shared/definition27.js +820 -49
  88. package/shared/definition28.js +52 -89
  89. package/shared/definition29.js +88 -24
  90. package/shared/definition3.js +1 -1
  91. package/shared/definition30.js +25 -12
  92. package/shared/definition31.js +12 -53
  93. package/shared/definition32.js +29 -441
  94. package/shared/definition33.js +427 -197
  95. package/shared/definition34.js +260 -174
  96. package/shared/definition35.js +187 -69
  97. package/shared/definition36.js +68 -55
  98. package/shared/definition37.js +61 -422
  99. package/shared/definition38.js +435 -35
  100. package/shared/definition39.js +30 -679
  101. package/shared/definition4.js +3 -3
  102. package/shared/definition40.js +661 -77
  103. package/shared/definition41.js +77 -557
  104. package/shared/definition42.js +559 -106
  105. package/shared/definition43.js +105 -136
  106. package/shared/definition44.js +153 -17
  107. package/shared/definition45.js +16 -79
  108. package/shared/definition46.js +53 -475
  109. package/shared/definition47.js +506 -20
  110. package/shared/definition48.js +22 -121
  111. package/shared/definition49.js +115 -262
  112. package/shared/definition5.js +2 -2
  113. package/shared/definition50.js +248 -120
  114. package/shared/definition51.js +139 -123
  115. package/shared/definition52.js +84 -74
  116. package/shared/definition53.js +114 -70
  117. package/shared/definition54.js +81 -292
  118. package/shared/definition55.js +302 -13
  119. package/shared/definition56.js +11 -41
  120. package/shared/definition57.js +20 -154
  121. package/shared/definition58.js +181 -0
  122. package/shared/definition6.js +5 -5
  123. package/shared/definition7.js +4 -4
  124. package/shared/definition8.js +3 -3
  125. package/shared/definition9.js +1 -2
  126. package/shared/index.js +1 -1
  127. package/shared/index2.js +1 -1
  128. package/shared/listbox.js +1 -1
  129. package/shared/localization/Locale.d.ts +3 -1
  130. package/shared/localized.js +9 -0
  131. package/shared/patterns/affix.d.ts +3 -1
  132. package/shared/presentationDate.js +6133 -0
  133. package/shared/ref.js +1 -1
  134. package/shared/slotted.js +73 -3
  135. package/shared/text-anchor.template.js +4 -4
  136. package/shared/text-field.js +1 -1
  137. package/side-drawer/index.js +1 -1
  138. package/slider/index.js +2 -2
  139. package/split-button/index.js +4 -3
  140. package/style.css +265 -197
  141. package/styles/core/all.css +44 -13
  142. package/styles/core/theme.css +1 -1
  143. package/styles/core/typography.css +44 -13
  144. package/styles/tokens/theme-dark.css +4 -4
  145. package/styles/tokens/theme-light.css +4 -4
  146. package/styles/tokens/vivid-2-compat.css +1 -1
  147. package/switch/index.js +4 -3
  148. package/tab/index.js +4 -3
  149. package/tab-panel/index.js +1 -1
  150. package/tabs/index.js +6 -7
  151. package/tag/index.js +4 -3
  152. package/tag-group/index.js +1 -1
  153. package/text-anchor/index.js +1 -0
  154. package/text-area/index.js +4 -3
  155. package/text-field/index.js +4 -5
  156. package/toggletip/index.js +7 -6
  157. package/tooltip/index.js +7 -6
  158. package/tree-item/index.js +4 -5
  159. package/tree-view/index.js +1 -2
  160. package/vivid.api.json +105 -0
  161. package/lib/date-picker/date-picker.template.d.ts +0 -4
  162. package/shared/node-observation.js +0 -74
  163. /package/{lib → shared}/date-picker/calendar/calendarGrid.d.ts +0 -0
  164. /package/{lib → shared}/date-picker/calendar/dateStr.d.ts +0 -0
  165. /package/{lib → shared}/date-picker/calendar/month.d.ts +0 -0
  166. /package/{lib → shared}/date-picker/calendar/monthPickerGrid.d.ts +0 -0
  167. /package/{lib → shared}/date-picker/calendar/presentationDate.d.ts +0 -0
  168. /package/{lib → shared}/date-picker/calendar/year.d.ts +0 -0
@@ -1,9 +1,13 @@
1
- import { a as attr, h as html, r as registerFactory } from './index.js';
2
- import { B as BaseProgress } from './base-progress.js';
3
- import { w as when } from './when.js';
1
+ import { d as Size, S as Shape, B as Button, a as buttonRegistries } from './definition10.js';
2
+ import { a as attr, F as FoundationElement, o as observable, v as volatile, h as html, r as registerFactory } from './index.js';
3
+ import { e as elements } from './slotted.js';
4
+ import { r as ref } from './ref.js';
5
+ import { c as children } from './children.js';
6
+ import { r as repeat } from './repeat.js';
4
7
  import { c as classNames } from './class-names.js';
8
+ import { w as when } from './when.js';
5
9
 
6
- const styles = "/**\n * Do not edit directly\n * Generated on Wed, 13 Sep 2023 10:58:27 GMT\n */\n.base {\n align-items: center;\n block-size: var(--_size);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n outline: none;\n}\n.base.connotation-cta {\n /* @cssprop [--vvd-progress-ring-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-cta-primary, var(--vvd-color-cta-500));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-progress-ring-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-alert-primary, var(--vvd-color-alert-500));\n}\n.base.connotation-success {\n /* @cssprop [--vvd-progress-ring-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-success-primary, var(--vvd-color-success-500));\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-ring-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-ring-accent-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-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.size--6 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)) - 1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base.size--4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.size--2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size--1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 4));\n}\n.base.size-1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 4));\n}\n.base.size-2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 12));\n}\n.base.size-4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.base.size-5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n}\n.base:not(.size--6, .size--5, .size--4, .size--3, .size--2, .size--1, .size-1, .size-2, .size-3, .size-4, .size-5) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 1px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\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: 1px;\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}";
10
+ const styles = "/**\n * Do not edit directly\n * Generated on Fri, 13 Oct 2023 14:45:50 GMT\n */\n.control {\n display: inline-flex;\n justify-content: space-between;\n}\n.control:not(.shape-pill) {\n border-radius: 4px;\n}\n.control.shape-pill {\n border-radius: 14px;\n}\n\n.buttons-wrapper {\n display: flex;\n column-gap: 4px;\n}\n\n.vwc-pagination-button[size=super-condensed] {\n --base-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.vwc-pagination-button[size=condensed] {\n --base-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.vwc-pagination-button[size=normal] {\n --base-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.vwc-pagination-button::part(button) {\n padding-inline: 0;\n}\n\n.dots {\n align-self: center;\n text-align: center;\n}\n.dots:not(.size-super-condensed) {\n font: var(--vvd-typography-base-bold);\n}\n.dots.size-super-condensed {\n font: var(--vvd-typography-base-condensed-bold);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.dots.size-condensed {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.dots.size-normal {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}";
7
11
 
8
12
  var __defProp = Object.defineProperty;
9
13
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -16,81 +20,195 @@ var __decorateClass = (decorators, target, key, kind) => {
16
20
  __defProp(target, key, result);
17
21
  return result;
18
22
  };
19
- class ProgressRing extends BaseProgress {
23
+ const MAX_DIGITS_AND_PLACEHOLDERS = 7;
24
+ const totalConverter = {
25
+ fromView: (value) => parseInt(value, 10),
26
+ toView: (value) => value.toString()
27
+ };
28
+ class Pagination extends FoundationElement {
29
+ constructor() {
30
+ super();
31
+ this.navIcons = false;
32
+ this.total = 0;
33
+ this.selectedIndex = 0;
34
+ this.addEventListener("tabpressed", (e) => {
35
+ const { value: currentLabel, shiftKey } = e.detail;
36
+ const index = this.paginationButtons.findIndex((button) => Number(button.label) === currentLabel);
37
+ const focusDirection = shiftKey ? -1 : 1;
38
+ const newIndex = index + focusDirection;
39
+ if (newIndex < 0) {
40
+ return this.prevButton.focus();
41
+ }
42
+ if (newIndex > this.paginationButtons.length - 1) {
43
+ return this.nextButton.focus();
44
+ }
45
+ this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
46
+ });
47
+ }
48
+ get pagesList() {
49
+ return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
50
+ if (i === 0)
51
+ return 1;
52
+ if (i === arr.length - 1)
53
+ return this.total;
54
+ if (this.selectedIndex !== void 0 && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
55
+ if (this.selectedIndex < 4) {
56
+ if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2)
57
+ return "...";
58
+ }
59
+ if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
60
+ if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2)
61
+ return this.selectedIndex + (i - 2);
62
+ if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2)
63
+ return "...";
64
+ }
65
+ if (this.selectedIndex > this.total - 5) {
66
+ if (i > 1)
67
+ return this.total - (6 - i);
68
+ if (i === 1)
69
+ return "...";
70
+ }
71
+ }
72
+ return i + 1;
73
+ });
74
+ }
75
+ totalChanged(_, newValue) {
76
+ if (newValue < 0) {
77
+ this.total = 0;
78
+ }
79
+ this.selectedIndex = 0;
80
+ }
81
+ selectedIndexChanged(oldValue, newValue) {
82
+ if (oldValue === void 0)
83
+ return;
84
+ this.$emit("pagination-change", { selectedIndex: newValue, total: this.total, oldIndex: oldValue });
85
+ }
86
+ paginationButtonsChanged(_, newValue) {
87
+ newValue.forEach((button) => {
88
+ button.shadowRoot.querySelector("button").setAttribute("part", "button");
89
+ });
90
+ }
20
91
  }
21
92
  __decorateClass([
22
93
  attr
23
- ], ProgressRing.prototype, "connotation", 2);
94
+ ], Pagination.prototype, "size", 2);
24
95
  __decorateClass([
25
96
  attr
26
- ], ProgressRing.prototype, "size", 2);
97
+ ], Pagination.prototype, "shape", 2);
98
+ __decorateClass([
99
+ observable
100
+ ], Pagination.prototype, "paginationButtons", 2);
101
+ __decorateClass([
102
+ observable
103
+ ], Pagination.prototype, "prevButton", 2);
104
+ __decorateClass([
105
+ observable
106
+ ], Pagination.prototype, "nextButton", 2);
107
+ __decorateClass([
108
+ attr({ attribute: "nav-icons", mode: "boolean" })
109
+ ], Pagination.prototype, "navIcons", 2);
110
+ __decorateClass([
111
+ volatile
112
+ ], Pagination.prototype, "pagesList", 1);
113
+ __decorateClass([
114
+ attr({ mode: "reflect", converter: totalConverter })
115
+ ], Pagination.prototype, "total", 2);
116
+ __decorateClass([
117
+ attr({ mode: "reflect", converter: totalConverter, attribute: "selected-index" })
118
+ ], Pagination.prototype, "selectedIndex", 2);
27
119
 
28
- const getClasses = ({ connotation, size, paused }) => classNames(
29
- "base",
30
- ["disabled", !!paused],
31
- [`connotation-${connotation}`, !!connotation],
32
- [`size-${size}`, !!size]
33
- );
34
- const progressSegments = 44;
35
- const ProgressRingTemplate = (_) => html`
36
- <div
37
- role="progressbar"
38
- aria-valuenow="${(x) => x.value}"
39
- aria-valuemin="${(x) => x.min}"
40
- aria-valuemax="${(x) => x.max}"
41
- class="${(x) => x.paused ? "paused" : ""} ${getClasses}"
42
- >
43
- ${when(
44
- (x) => typeof x.value === "number",
120
+ const ALLOWED_SIZES = [Size.SuperCondensed, Size.Condensed, Size.Normal];
121
+ const ALLOWED_SHAPES = [Shape.Rounded, Shape.Pill];
122
+ const handleSelection = (value, { parent: x }) => {
123
+ return x.selectedIndex = Number(value) - 1;
124
+ };
125
+ const handleKeyDown = (value, { event, parent }) => {
126
+ if (event.key === " " || event.key === "Enter") {
127
+ handleSelection(value, { parent });
128
+ }
129
+ if (event.key === "Tab") {
130
+ event.target.dispatchEvent(
131
+ new CustomEvent("tabpressed", { detail: { value, shiftKey: event.shiftKey }, bubbles: true, composed: true })
132
+ );
133
+ }
134
+ };
135
+ const getClasses = (_) => classNames("control");
136
+ function getButtonAppearance(value, { parent }) {
137
+ return parent.selectedIndex === Number(value) - 1 ? "filled" : "ghost";
138
+ }
139
+ const paginationButtonRenderer = (buttonTag) => html`
140
+ ${when(
141
+ (value) => value !== "...",
45
142
  html`
46
- <svg
47
- class="progress"
48
- viewBox="0 0 16 16"
49
- >
50
- <circle
51
- class="background"
52
- cx="8px"
53
- cy="8px"
54
- r="7px"
55
- ></circle>
56
- <circle
57
- class="determinate"
58
- style="stroke-dasharray: ${(x) => progressSegments * x.percentComplete / 100}px ${progressSegments}px"
59
- cx="8px"
60
- cy="8px"
61
- r="7px"
62
- ></circle>
63
- </svg>
64
- `
143
+ <${buttonTag} class="vwc-pagination-button"
144
+ label="${(value) => value}"
145
+ appearance="${getButtonAppearance}"
146
+ size="${(_, { parent: x }) => getPaginationSize(x)}"
147
+ shape="${(_, { parent: x }) => getPaginationShape(x)}"
148
+ style="inline-size: ${(value) => getPaginationButtonWidth(value)};"
149
+ tabindex="0"
150
+ aria-current="${(value, { parent }) => parent.selectedIndex === Number(value) - 1}"
151
+ @click="${handleSelection}"
152
+ @keydown="${handleKeyDown}">
153
+ </${buttonTag}>
154
+ `
65
155
  )}
66
- ${when(
67
- (x) => typeof x.value !== "number",
156
+ ${when(
157
+ (value) => value === "...",
68
158
  html`
69
- <svg class="progress" viewBox="0 0 16 16">
70
- <circle
71
- class="background"
72
- cx="8px"
73
- cy="8px"
74
- r="7px"
75
- ></circle>
76
- <circle
77
- class="indeterminate-indicator-1"
78
- cx="8px"
79
- cy="8px"
80
- r="7px"
81
- ></circle>
82
- </svg>
83
- `
84
- )}
85
- </div>
86
- `;
159
+ <div
160
+ class="dots size-${(_, { parent: x }) => getPaginationSize(x)}">
161
+ ...
162
+ </div>`
163
+ )}`;
164
+ const getPaginationSize = (x) => {
165
+ if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
166
+ return Size.SuperCondensed;
167
+ }
168
+ return x.size;
169
+ };
170
+ const getPaginationShape = (x) => {
171
+ if (!x.shape || !ALLOWED_SHAPES.includes(x.shape)) {
172
+ return Shape.Rounded;
173
+ }
174
+ return x.shape;
175
+ };
176
+ const getPaginationButtonWidth = (value) => {
177
+ return `calc(var(--base-size) + ${String(value).length - 1}ch)`;
178
+ };
179
+ const PaginationTemplate = (context) => {
180
+ const buttonTag = context.tagFor(Button);
181
+ const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
182
+ return html`
183
+ <div class="${getClasses}">
184
+ <${buttonTag} class="prev-button" ${ref("prevButton")}
185
+ label="${(x) => !x.navIcons ? "Previous" : null}"
186
+ icon="${(x) => x.navIcons ? "chevron-left-line" : null}"
187
+ size="${getPaginationSize}"
188
+ shape="${getPaginationShape}"
189
+ ?disabled="${(x) => x.total === 0 || x.selectedIndex === 0}"
190
+ @click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex--}"
191
+ ></${buttonTag}>
192
+ <div id="buttons-wrapper" class="buttons-wrapper" ${children({ property: "paginationButtons", filter: elements(buttonTag) })}>
193
+ ${repeat((x) => x.pagesList, paginationButtonTemplate, { positioning: true })}
194
+ </div>
195
+ <${buttonTag} class="next-button" ${ref("nextButton")}
196
+ label="${(x) => !x.navIcons ? "Next" : null}"
197
+ icon="${(x) => x.navIcons ? "chevron-right-line" : null}"
198
+ size="${getPaginationSize}"
199
+ shape="${getPaginationShape}"
200
+ ?disabled="${(x) => x.total === 0 || x.selectedIndex === x.total - 1}"
201
+ @click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex++}"
202
+ ></${buttonTag}>
203
+ </div>`;
204
+ };
87
205
 
88
- const progressRingDefinition = ProgressRing.compose({
89
- baseName: "progress-ring",
90
- template: ProgressRingTemplate,
206
+ const paginationDefinition = Pagination.compose({
207
+ baseName: "pagination",
208
+ template: PaginationTemplate,
91
209
  styles
92
210
  });
93
- const progressRingRegistries = [progressRingDefinition()];
94
- const registerProgressRing = registerFactory(progressRingRegistries);
211
+ const paginationRegistries = [paginationDefinition(), buttonRegistries];
212
+ const registerPagination = registerFactory(paginationRegistries);
95
213
 
96
- export { ProgressRing as P, progressRingRegistries as a, progressRingDefinition as p, registerProgressRing as r };
214
+ export { paginationRegistries as a, paginationDefinition as p, registerPagination as r };
@@ -3,7 +3,7 @@ import { B as BaseProgress } from './base-progress.js';
3
3
  import { w as when } from './when.js';
4
4
  import { c as classNames } from './class-names.js';
5
5
 
6
- const styles = "/**\n * Do not edit directly\n * Generated on Wed, 13 Sep 2023 10:58:27 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 /* @cssprop [--vvd-progress-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-progress-cta-soft=var(--vvd-color-cta-100)] */\n --_connotation-color-soft: var(--vvd-progress-cta-soft, var(--vvd-color-cta-100));\n}\n.base:not(.connotation-pacific).connotation-alert {\n /* @cssprop [--vvd-progress-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-progress-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-progress-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-pacific).connotation-success {\n /* @cssprop [--vvd-progress-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-progress-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-progress-success-soft, var(--vvd-color-success-100));\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-progress-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-progress-accent-soft, var(--vvd-color-neutral-100));\n}\n.base:not(.connotation-pacific) {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\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 block-size: 100%;\n inline-size: 100%;\n /* Shape */\n}\n.base:not(.connotation-pacific) .progress {\n background-color: var(--_appearance-color-fill);\n}\n.base.connotation-pacific .progress {\n background-color: var(--vvd-color-neutral-100);\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: 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}";
6
+ const styles = "/**\n * Do not edit directly\n * Generated on Fri, 13 Oct 2023 14:45:50 GMT\n */\n.base {\n align-items: center;\n block-size: var(--_size);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n outline: none;\n}\n.base.connotation-cta {\n /* @cssprop [--vvd-progress-ring-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-cta-primary, var(--vvd-color-cta-500));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-progress-ring-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-alert-primary, var(--vvd-color-alert-500));\n}\n.base.connotation-success {\n /* @cssprop [--vvd-progress-ring-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-success-primary, var(--vvd-color-success-500));\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-ring-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-ring-accent-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-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.size--6 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)) - 1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base.size--4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.size--2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size--1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 4));\n}\n.base.size-1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 4));\n}\n.base.size-2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 12));\n}\n.base.size-4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.base.size-5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n}\n.base:not(.size--6, .size--5, .size--4, .size--3, .size--2, .size--1, .size-1, .size-2, .size-3, .size-4, .size-5) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 1px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\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: 1px;\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}";
7
7
 
8
8
  var __defProp = Object.defineProperty;
9
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -16,68 +16,81 @@ var __decorateClass = (decorators, target, key, kind) => {
16
16
  __defProp(target, key, result);
17
17
  return result;
18
18
  };
19
- class Progress extends BaseProgress {
20
- constructor() {
21
- super(...arguments);
22
- this.reverse = false;
23
- }
19
+ class ProgressRing extends BaseProgress {
24
20
  }
25
21
  __decorateClass([
26
- attr()
27
- ], Progress.prototype, "shape", 2);
22
+ attr
23
+ ], ProgressRing.prototype, "connotation", 2);
28
24
  __decorateClass([
29
- attr()
30
- ], Progress.prototype, "connotation", 2);
31
- __decorateClass([
32
- attr({ mode: "boolean" })
33
- ], Progress.prototype, "reverse", 2);
25
+ attr
26
+ ], ProgressRing.prototype, "size", 2);
34
27
 
35
- const getClasses = ({
36
- connotation,
37
- shape,
38
- reverse,
39
- paused
40
- }) => classNames(
28
+ const getClasses = ({ connotation, size, paused }) => classNames(
41
29
  "base",
42
- [`connotation-${connotation}`, Boolean(connotation)],
43
- [`shape-${shape}`, Boolean(shape)],
44
- ["reverse", Boolean(reverse)],
45
- ["paused", Boolean(paused)]
30
+ ["disabled", !!paused],
31
+ [`connotation-${connotation}`, !!connotation],
32
+ [`size-${size}`, !!size]
46
33
  );
47
- function determinate() {
48
- return html`
49
- <span class="determinate" style="width: ${(x) => x.percentComplete}%"></span>`;
50
- }
51
- function indeterminate() {
52
- return html`
53
- <span class="indeterminate" name="indeterminate">
54
- <span class="indicator-1"></span>
55
- <span class="indicator-2"></span>
56
- </span>`;
57
- }
58
- const ProgressTemplate = (_) => {
59
- return html`
60
- <div
61
- role="progressbar"
62
- aria-valuenow="${(x) => x.value}"
63
- aria-valuemin="${(x) => x.min}"
64
- aria-valuemax="${(x) => x.max}"
65
- class="${getClasses}"
34
+ const progressSegments = 44;
35
+ const ProgressRingTemplate = (_) => html`
36
+ <div
37
+ role="progressbar"
38
+ aria-valuenow="${(x) => x.value}"
39
+ aria-valuemin="${(x) => x.min}"
40
+ aria-valuemax="${(x) => x.max}"
41
+ class="${(x) => x.paused ? "paused" : ""} ${getClasses}"
66
42
  >
67
- <div class="progress">
68
- ${when((x) => typeof x.value === "number", determinate())}
69
- ${when((x) => typeof x.value !== "number", indeterminate())}
70
- </div>
71
- </div>
72
- `;
73
- };
43
+ ${when(
44
+ (x) => typeof x.value === "number",
45
+ html`
46
+ <svg
47
+ class="progress"
48
+ viewBox="0 0 16 16"
49
+ >
50
+ <circle
51
+ class="background"
52
+ cx="8px"
53
+ cy="8px"
54
+ r="7px"
55
+ ></circle>
56
+ <circle
57
+ class="determinate"
58
+ style="stroke-dasharray: ${(x) => progressSegments * x.percentComplete / 100}px ${progressSegments}px"
59
+ cx="8px"
60
+ cy="8px"
61
+ r="7px"
62
+ ></circle>
63
+ </svg>
64
+ `
65
+ )}
66
+ ${when(
67
+ (x) => typeof x.value !== "number",
68
+ html`
69
+ <svg class="progress" viewBox="0 0 16 16">
70
+ <circle
71
+ class="background"
72
+ cx="8px"
73
+ cy="8px"
74
+ r="7px"
75
+ ></circle>
76
+ <circle
77
+ class="indeterminate-indicator-1"
78
+ cx="8px"
79
+ cy="8px"
80
+ r="7px"
81
+ ></circle>
82
+ </svg>
83
+ `
84
+ )}
85
+ </div>
86
+ `;
74
87
 
75
- const progressDefinition = Progress.compose({
76
- baseName: "progress",
77
- template: ProgressTemplate,
88
+ const progressRingDefinition = ProgressRing.compose({
89
+ baseName: "progress-ring",
90
+ template: ProgressRingTemplate,
78
91
  styles
79
92
  });
80
- const progressRegistries = [progressDefinition()];
81
- const registerProgress = registerFactory(progressRegistries);
93
+ const progressRingRegistries = [progressRingDefinition()];
94
+ const registerProgressRing = registerFactory(progressRingRegistries);
82
95
 
83
- export { progressRegistries as a, progressDefinition as p, registerProgress as r };
96
+ export { ProgressRing as P, progressRingRegistries as a, progressRingDefinition as p, registerProgressRing as r };