@itguy614/clean-ui 1.2.2 → 1.3.1

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 (245) hide show
  1. package/README.md +12 -0
  2. package/dist/clean-ui.css +1 -1
  3. package/dist/components/CuiAccordion.vue.js +2 -2
  4. package/dist/components/CuiAlert.vue.d.ts +3 -5
  5. package/dist/components/CuiAlert.vue.d.ts.map +1 -1
  6. package/dist/components/CuiAlert.vue.js +1 -1
  7. package/dist/components/CuiAlert.vue2.js +54 -50
  8. package/dist/components/CuiBadge.vue.js +3 -3
  9. package/dist/components/CuiBadge.vue2.js +23 -23
  10. package/dist/components/CuiBanner.vue.d.ts +15 -10
  11. package/dist/components/CuiBanner.vue.d.ts.map +1 -1
  12. package/dist/components/CuiBanner.vue.js +5 -80
  13. package/dist/components/CuiBanner.vue2.js +90 -2
  14. package/dist/components/CuiButton.vue.d.ts +9 -0
  15. package/dist/components/CuiButton.vue.d.ts.map +1 -1
  16. package/dist/components/CuiButton.vue.js +1 -1
  17. package/dist/components/CuiButton.vue2.js +77 -83
  18. package/dist/components/CuiButtonGroup.vue.d.ts +4 -2
  19. package/dist/components/CuiButtonGroup.vue.d.ts.map +1 -1
  20. package/dist/components/CuiButtonGroup.vue.js +1 -1
  21. package/dist/components/CuiButtonGroup.vue2.js +18 -9
  22. package/dist/components/CuiCard.vue.d.ts.map +1 -1
  23. package/dist/components/CuiCard.vue.js +5 -33
  24. package/dist/components/CuiCard.vue2.js +32 -2
  25. package/dist/components/CuiCardBody.vue.d.ts.map +1 -1
  26. package/dist/components/CuiCardBody.vue.js +5 -18
  27. package/dist/components/CuiCardBody.vue2.js +18 -2
  28. package/dist/components/CuiCardFooter.vue.d.ts.map +1 -1
  29. package/dist/components/CuiCardFooter.vue.js +5 -30
  30. package/dist/components/CuiCardFooter.vue2.js +25 -2
  31. package/dist/components/CuiCardHeader.vue.d.ts +5 -4
  32. package/dist/components/CuiCardHeader.vue.d.ts.map +1 -1
  33. package/dist/components/CuiCardHeader.vue.js +5 -49
  34. package/dist/components/CuiCardHeader.vue2.js +40 -2
  35. package/dist/components/CuiCardMedia.vue.d.ts.map +1 -1
  36. package/dist/components/CuiCardMedia.vue.js +3 -3
  37. package/dist/components/CuiCardMedia.vue2.js +6 -6
  38. package/dist/components/CuiCheckbox.vue.d.ts +2 -2
  39. package/dist/components/CuiCheckbox.vue.d.ts.map +1 -1
  40. package/dist/components/CuiCheckbox.vue.js +1 -1
  41. package/dist/components/CuiCheckbox.vue2.js +46 -34
  42. package/dist/components/CuiCheckboxGroup.vue.d.ts +2 -2
  43. package/dist/components/CuiCheckboxGroup.vue.d.ts.map +1 -1
  44. package/dist/components/CuiCheckboxGroup.vue.js +2 -2
  45. package/dist/components/CuiCheckboxGroup.vue2.js +45 -35
  46. package/dist/components/CuiCodeBlock.vue.d.ts.map +1 -1
  47. package/dist/components/CuiCodeBlock.vue.js +14 -11
  48. package/dist/components/CuiColorPicker.vue.d.ts +2 -2
  49. package/dist/components/CuiColorPicker.vue.d.ts.map +1 -1
  50. package/dist/components/CuiColorPicker.vue.js +117 -104
  51. package/dist/components/CuiCombobox.vue.d.ts +2 -2
  52. package/dist/components/CuiCombobox.vue.d.ts.map +1 -1
  53. package/dist/components/CuiCombobox.vue.js +5 -330
  54. package/dist/components/CuiCombobox.vue2.js +330 -2
  55. package/dist/components/CuiConfirmDialog.vue.d.ts +5 -4
  56. package/dist/components/CuiConfirmDialog.vue.d.ts.map +1 -1
  57. package/dist/components/CuiConfirmDialog.vue.js +84 -73
  58. package/dist/components/CuiContextMenu.vue.d.ts +40 -1
  59. package/dist/components/CuiContextMenu.vue.d.ts.map +1 -1
  60. package/dist/components/CuiContextMenu.vue.js +1 -1
  61. package/dist/components/CuiContextMenu.vue2.js +149 -91
  62. package/dist/components/CuiCopyButton.vue.d.ts.map +1 -1
  63. package/dist/components/CuiCopyButton.vue.js +5 -61
  64. package/dist/components/CuiCopyButton.vue2.js +68 -2
  65. package/dist/components/CuiDataGridCardView.vue.d.ts.map +1 -1
  66. package/dist/components/CuiDataGridCardView.vue.js +10 -9
  67. package/dist/components/CuiDataGridColumnManager.vue.d.ts.map +1 -1
  68. package/dist/components/CuiDataGridColumnManager.vue.js +12 -11
  69. package/dist/components/CuiDataGridPagination.vue.d.ts.map +1 -1
  70. package/dist/components/CuiDataGridPagination.vue.js +9 -8
  71. package/dist/components/CuiDataGridSearch.vue.d.ts.map +1 -1
  72. package/dist/components/CuiDataGridSearch.vue.js +12 -9
  73. package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
  74. package/dist/components/CuiDataGridTable.vue.js +213 -190
  75. package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
  76. package/dist/components/CuiDataGridViewManager.vue.js +21 -20
  77. package/dist/components/CuiDatePicker.vue.d.ts +2 -2
  78. package/dist/components/CuiDatePicker.vue.d.ts.map +1 -1
  79. package/dist/components/CuiDatePicker.vue.js +257 -173
  80. package/dist/components/CuiDateRangePicker.vue.d.ts +2 -2
  81. package/dist/components/CuiDateRangePicker.vue.d.ts.map +1 -1
  82. package/dist/components/CuiDateRangePicker.vue.js +262 -179
  83. package/dist/components/CuiDivider.vue.d.ts +1 -3
  84. package/dist/components/CuiDivider.vue.d.ts.map +1 -1
  85. package/dist/components/CuiDivider.vue.js +47 -59
  86. package/dist/components/CuiDropdownMenu.vue.js +2 -2
  87. package/dist/components/CuiDropdownRadioGroup.vue.d.ts +4 -1
  88. package/dist/components/CuiDropdownRadioGroup.vue.d.ts.map +1 -1
  89. package/dist/components/CuiDropdownRadioGroup.vue.js +27 -14
  90. package/dist/components/CuiDropdownSub.vue.js +2 -2
  91. package/dist/components/CuiEmptyState.vue.d.ts +5 -4
  92. package/dist/components/CuiEmptyState.vue.d.ts.map +1 -1
  93. package/dist/components/CuiEmptyState.vue.js +1 -1
  94. package/dist/components/CuiEmptyState.vue2.js +30 -24
  95. package/dist/components/CuiFieldset.vue.d.ts.map +1 -1
  96. package/dist/components/CuiFieldset.vue.js +1 -1
  97. package/dist/components/CuiFieldset.vue2.js +21 -21
  98. package/dist/components/CuiFileUpload.vue.d.ts +2 -2
  99. package/dist/components/CuiFileUpload.vue.d.ts.map +1 -1
  100. package/dist/components/CuiFileUpload.vue.js +70 -57
  101. package/dist/components/CuiFormField.vue.d.ts.map +1 -1
  102. package/dist/components/CuiFormField.vue.js +2 -2
  103. package/dist/components/CuiFormField.vue2.js +48 -42
  104. package/dist/components/CuiInput.vue.d.ts +2 -2
  105. package/dist/components/CuiInput.vue.d.ts.map +1 -1
  106. package/dist/components/CuiInput.vue.js +1 -1
  107. package/dist/components/CuiInput.vue2.js +97 -85
  108. package/dist/components/CuiInputStepper.vue.d.ts +2 -2
  109. package/dist/components/CuiInputStepper.vue.d.ts.map +1 -1
  110. package/dist/components/CuiInputStepper.vue.js +5 -187
  111. package/dist/components/CuiInputStepper.vue2.js +237 -2
  112. package/dist/components/CuiKbd.vue.d.ts.map +1 -1
  113. package/dist/components/CuiKbd.vue.js +6 -5
  114. package/dist/components/CuiMaskedInput.vue.d.ts +9 -3
  115. package/dist/components/CuiMaskedInput.vue.d.ts.map +1 -1
  116. package/dist/components/CuiMaskedInput.vue.js +132 -117
  117. package/dist/components/CuiModal.vue.d.ts +10 -2
  118. package/dist/components/CuiModal.vue.d.ts.map +1 -1
  119. package/dist/components/CuiModal.vue.js +2 -2
  120. package/dist/components/CuiModal.vue2.js +48 -44
  121. package/dist/components/CuiModalBody.vue.d.ts.map +1 -1
  122. package/dist/components/CuiModalBody.vue.js +16 -13
  123. package/dist/components/CuiModalFooter.vue.d.ts.map +1 -1
  124. package/dist/components/CuiModalFooter.vue.js +3 -2
  125. package/dist/components/CuiModalHeader.vue.d.ts +13 -4
  126. package/dist/components/CuiModalHeader.vue.d.ts.map +1 -1
  127. package/dist/components/CuiModalHeader.vue.js +54 -42
  128. package/dist/components/CuiPagination.vue.d.ts.map +1 -1
  129. package/dist/components/CuiPagination.vue.js +1 -1
  130. package/dist/components/CuiPagination.vue2.js +28 -25
  131. package/dist/components/CuiPopover.vue.d.ts.map +1 -1
  132. package/dist/components/CuiPopover.vue.js +80 -72
  133. package/dist/components/CuiRadio.vue.d.ts +2 -4
  134. package/dist/components/CuiRadio.vue.d.ts.map +1 -1
  135. package/dist/components/CuiRadio.vue.js +2 -2
  136. package/dist/components/CuiRadio.vue2.js +88 -74
  137. package/dist/components/CuiRadioGroup.vue.d.ts +2 -2
  138. package/dist/components/CuiRadioGroup.vue.d.ts.map +1 -1
  139. package/dist/components/CuiRadioGroup.vue.js +3 -3
  140. package/dist/components/CuiRadioGroup.vue2.js +47 -37
  141. package/dist/components/CuiRating.vue.d.ts.map +1 -1
  142. package/dist/components/CuiRating.vue.js +15 -14
  143. package/dist/components/CuiResizablePanels.vue.d.ts.map +1 -1
  144. package/dist/components/CuiResizablePanels.vue.js +10 -9
  145. package/dist/components/CuiSelect.vue.d.ts +2 -2
  146. package/dist/components/CuiSelect.vue.d.ts.map +1 -1
  147. package/dist/components/CuiSelect.vue.js +2 -2
  148. package/dist/components/CuiSelect.vue2.js +161 -151
  149. package/dist/components/CuiSkeleton.vue.js +2 -2
  150. package/dist/components/CuiSkeleton.vue2.js +10 -10
  151. package/dist/components/CuiSlideover.vue.d.ts +2 -2
  152. package/dist/components/CuiSlideover.vue.d.ts.map +1 -1
  153. package/dist/components/CuiSlideover.vue.js +34 -30
  154. package/dist/components/CuiSlider.vue.d.ts +2 -2
  155. package/dist/components/CuiSlider.vue.d.ts.map +1 -1
  156. package/dist/components/CuiSlider.vue.js +5 -154
  157. package/dist/components/CuiSlider.vue2.js +171 -2
  158. package/dist/components/CuiSpinner.vue.d.ts.map +1 -1
  159. package/dist/components/CuiSpinner.vue.js +5 -4
  160. package/dist/components/CuiTable.vue.d.ts.map +1 -1
  161. package/dist/components/CuiTable.vue.js +4 -1
  162. package/dist/components/CuiTableBody.vue.d.ts.map +1 -1
  163. package/dist/components/CuiTableBody.vue.js +6 -6
  164. package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
  165. package/dist/components/CuiTableCell.vue.js +11 -10
  166. package/dist/components/CuiTableFoot.vue.d.ts.map +1 -1
  167. package/dist/components/CuiTableFoot.vue.js +7 -7
  168. package/dist/components/CuiTableHead.vue.d.ts.map +1 -1
  169. package/dist/components/CuiTableHead.vue.js +7 -7
  170. package/dist/components/CuiTabs.vue.d.ts.map +1 -1
  171. package/dist/components/CuiTabs.vue.js +2 -2
  172. package/dist/components/CuiTabs.vue2.js +81 -76
  173. package/dist/components/CuiTagInput.vue.d.ts +2 -2
  174. package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
  175. package/dist/components/CuiTagInput.vue.js +5 -294
  176. package/dist/components/CuiTagInput.vue2.js +276 -2
  177. package/dist/components/CuiTextarea.vue.d.ts +2 -2
  178. package/dist/components/CuiTextarea.vue.d.ts.map +1 -1
  179. package/dist/components/CuiTextarea.vue.js +4 -4
  180. package/dist/components/CuiTextarea.vue2.js +73 -59
  181. package/dist/components/CuiTimePicker.vue.d.ts +2 -2
  182. package/dist/components/CuiTimePicker.vue.d.ts.map +1 -1
  183. package/dist/components/CuiTimePicker.vue.js +172 -97
  184. package/dist/components/CuiTimeline.vue.d.ts.map +1 -1
  185. package/dist/components/CuiTimeline.vue.js +6 -5
  186. package/dist/components/CuiTimelineItem.vue.d.ts.map +1 -1
  187. package/dist/components/CuiTimelineItem.vue.js +11 -10
  188. package/dist/components/CuiToast.vue.d.ts +8 -10
  189. package/dist/components/CuiToast.vue.d.ts.map +1 -1
  190. package/dist/components/CuiToast.vue.js +2 -2
  191. package/dist/components/CuiToast.vue2.js +69 -67
  192. package/dist/components/CuiToggle.vue.d.ts +2 -2
  193. package/dist/components/CuiToggle.vue.d.ts.map +1 -1
  194. package/dist/components/CuiToggle.vue.js +2 -2
  195. package/dist/components/CuiToggle.vue2.js +71 -59
  196. package/dist/components/CuiToggleGroup.vue.d.ts +2 -2
  197. package/dist/components/CuiToggleGroup.vue.d.ts.map +1 -1
  198. package/dist/components/CuiToggleGroup.vue.js +2 -2
  199. package/dist/components/CuiToggleGroup.vue2.js +45 -35
  200. package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
  201. package/dist/components/CuiTooltip.vue.js +2 -2
  202. package/dist/components/CuiTooltip.vue2.js +49 -45
  203. package/dist/components/CuiTransferList.vue.d.ts.map +1 -1
  204. package/dist/components/CuiTransferList.vue.js +31 -30
  205. package/dist/components/CuiTreeNode.vue.d.ts +9 -2
  206. package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
  207. package/dist/components/CuiTreeNode.vue.js +5 -179
  208. package/dist/components/CuiTreeNode.vue2.js +198 -2
  209. package/dist/components/CuiTreeView.vue.d.ts +33 -5
  210. package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
  211. package/dist/components/CuiTreeView.vue.js +187 -44
  212. package/dist/composables/useCalendarKeyboard.d.ts +48 -0
  213. package/dist/composables/useCalendarKeyboard.d.ts.map +1 -0
  214. package/dist/composables/useCalendarKeyboard.js +91 -0
  215. package/dist/composables/useFieldDescribedBy.d.ts +30 -0
  216. package/dist/composables/useFieldDescribedBy.d.ts.map +1 -0
  217. package/dist/composables/useFieldDescribedBy.js +11 -0
  218. package/dist/composables/useMessages.d.ts.map +1 -1
  219. package/dist/composables/useMessages.js +6 -6
  220. package/dist/composables/usePopover.d.ts.map +1 -1
  221. package/dist/composables/usePopover.js +10 -0
  222. package/dist/composables/useScrollShadows.d.ts +3 -0
  223. package/dist/composables/useScrollShadows.d.ts.map +1 -1
  224. package/dist/composables/useScrollShadows.js +15 -12
  225. package/dist/icons/builtin.d.ts.map +1 -1
  226. package/dist/icons/builtin.js +38 -37
  227. package/dist/index.d.ts +3 -2
  228. package/dist/index.d.ts.map +1 -1
  229. package/dist/index.js +185 -182
  230. package/dist/messages.d.ts +39 -4
  231. package/dist/messages.d.ts.map +1 -1
  232. package/dist/messages.js +8 -7
  233. package/dist/types/common.d.ts +90 -0
  234. package/dist/types/common.d.ts.map +1 -1
  235. package/dist/utils/colorIconMap.d.ts +47 -3
  236. package/dist/utils/colorIconMap.d.ts.map +1 -1
  237. package/dist/utils/colorIconMap.js +20 -5
  238. package/dist/utils/date.d.ts +13 -0
  239. package/dist/utils/date.d.ts.map +1 -1
  240. package/dist/utils/date.js +46 -40
  241. package/dist/utils/sizing.d.ts +26 -1
  242. package/dist/utils/sizing.d.ts.map +1 -1
  243. package/dist/utils/sizing.js +22 -21
  244. package/dist/version.js +1 -1
  245. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
- import { defineComponent as N, ref as b, computed as n, watch as P, onMounted as S, onUnmounted as T, withDirectives as V, openBlock as i, createElementBlock as a, mergeProps as z, Fragment as E, createTextVNode as g, toDisplayString as v, createBlock as L, createCommentVNode as c, createElementVNode as y, renderSlot as $, unref as O, createVNode as A, normalizeStyle as R, vShow as F } from "vue";
1
+ import { defineComponent as P, ref as y, computed as c, watch as S, onMounted as N, onUnmounted as T, withDirectives as V, openBlock as i, createElementBlock as a, mergeProps as z, renderSlot as m, Fragment as E, createTextVNode as $, toDisplayString as f, createBlock as L, createCommentVNode as n, createElementVNode as _, unref as R, createVNode as A, normalizeStyle as F, vShow as K } from "vue";
2
2
  import h from "./CuiIcon.vue.js";
3
- import { COLOR_ICON_MAP as K } from "../utils/colorIconMap.js";
4
- import { resolveLiveRegion as U } from "../utils/liveRegion.js";
5
- import { useMessages as j } from "../composables/useMessages.js";
6
- const q = {
3
+ import { resolveRoleIcon as U } from "../utils/colorIconMap.js";
4
+ import { resolveLiveRegion as j } from "../utils/liveRegion.js";
5
+ import { useMessages as q } from "../composables/useMessages.js";
6
+ const G = {
7
7
  key: 0,
8
8
  class: "cui-toast__icon"
9
- }, G = { class: "cui-toast__body" }, H = {
9
+ }, H = { class: "cui-toast__body" }, J = {
10
10
  key: 0,
11
11
  class: "cui-toast__title"
12
- }, J = {
12
+ }, O = {
13
13
  key: 1,
14
14
  class: "cui-toast__description"
15
15
  }, Q = {
@@ -18,7 +18,7 @@ const q = {
18
18
  }, W = ["aria-label"], X = {
19
19
  key: 2,
20
20
  class: "cui-toast__progress"
21
- }, _ = 50, ot = /* @__PURE__ */ N({
21
+ }, k = 50, oe = /* @__PURE__ */ P({
22
22
  __name: "CuiToast",
23
23
  props: {
24
24
  toastId: {},
@@ -29,101 +29,103 @@ const q = {
29
29
  autoDismiss: { default: 5e3 },
30
30
  showProgress: { type: Boolean, default: !0 },
31
31
  animation: { default: "none" },
32
- icon: {},
33
- noIcon: { type: Boolean, default: !1 },
34
32
  active: { type: Boolean, default: !0 },
35
33
  hidden: { type: Boolean, default: !1 },
36
34
  color: { default: "primary" },
37
- live: {}
35
+ live: {},
36
+ icon: {},
37
+ noIcon: { type: Boolean, default: !1 }
38
38
  },
39
39
  emits: ["dismiss"],
40
- setup(s, { emit: k }) {
41
- const o = s, D = k, u = b(!1), l = b(0);
40
+ setup(o, { emit: p }) {
41
+ const s = o, D = p, l = y(!1), u = y(0);
42
42
  let r = null;
43
- const I = n(() => !o.autoDismiss || o.autoDismiss === 0 ? 0 : Math.min(l.value / o.autoDismiss * 100, 100));
44
- function m() {
45
- r || !o.autoDismiss || o.autoDismiss === 0 || (r = setInterval(() => {
46
- !u.value && o.active && (l.value += _, l.value >= o.autoDismiss && f());
47
- }, _));
43
+ const I = c(() => !s.autoDismiss || s.autoDismiss === 0 ? 0 : Math.min(u.value / s.autoDismiss * 100, 100));
44
+ function b() {
45
+ r || !s.autoDismiss || s.autoDismiss === 0 || (r = setInterval(() => {
46
+ !l.value && s.active && (u.value += k, u.value >= s.autoDismiss && g());
47
+ }, k));
48
48
  }
49
- P(
50
- () => o.active,
51
- (t) => {
52
- t && !r && m();
49
+ S(
50
+ () => s.active,
51
+ (e) => {
52
+ e && !r && b();
53
53
  }
54
54
  );
55
- function f() {
55
+ function g() {
56
56
  r && clearInterval(r), D("dismiss");
57
57
  }
58
- function p() {
59
- u.value = !0;
60
- }
61
58
  function x() {
62
- u.value = !1;
59
+ l.value = !0;
60
+ }
61
+ function B() {
62
+ l.value = !1;
63
63
  }
64
- S(() => {
65
- o.active && m();
64
+ N(() => {
65
+ s.active && b();
66
66
  }), T(() => {
67
67
  r && clearInterval(r);
68
68
  });
69
- const B = n(() => {
70
- const t = o.color, d = o.variant, e = {
71
- "--_toast-focus-ring": `var(--cui-${t}-focus-ring)`
69
+ const M = c(() => {
70
+ const e = s.color, v = s.variant, t = {
71
+ "--_toast-focus-ring": `var(--cui-${e}-focus-ring)`
72
72
  };
73
- return d === "solid" ? (e.background = `var(--cui-${t}-solid, var(--cui-${t}))`, e.color = `var(--cui-${t}-text)`, e["--_toast-icon-color"] = `var(--cui-${t}-text)`, e["--_toast-dismiss-color"] = `var(--cui-${t}-text)`, e["--_toast-progress-bg"] = "rgb(255 255 255 / 0.2)", e["--_toast-progress-bar"] = "rgb(255 255 255 / 0.6)") : d === "outline" ? (e.background = "var(--cui-surface-base)", e.color = `var(--cui-${t})`, e.border = `1px solid var(--cui-${t}-border)`, e["--_toast-icon-color"] = `var(--cui-${t})`, e["--_toast-dismiss-color"] = "var(--cui-text-secondary)", e["--_toast-progress-bg"] = `var(--cui-${t}-bg)`, e["--_toast-progress-bar"] = `var(--cui-${t})`) : (e.background = `var(--cui-${t}-bg)`, e.color = "var(--cui-text-body)", e.border = `1px solid var(--cui-${t}-border)`, e["--_toast-icon-color"] = `var(--cui-${t})`, e["--_toast-dismiss-color"] = "var(--cui-text-secondary)", e["--_toast-progress-bg"] = `var(--cui-${t}-border)`, e["--_toast-progress-bar"] = `var(--cui-${t})`), e;
74
- }), C = n(() => K[o.color] ?? "info"), M = n(() => U(o.color, o.live)), w = j();
75
- return (t, d) => V((i(), a("div", z({
73
+ return v === "solid" ? (t.background = `var(--cui-${e}-solid, var(--cui-${e}))`, t.color = `var(--cui-${e}-text)`, t["--_toast-icon-color"] = `var(--cui-${e}-text)`, t["--_toast-dismiss-color"] = `var(--cui-${e}-text)`, t["--_toast-progress-bg"] = "rgb(255 255 255 / 0.2)", t["--_toast-progress-bar"] = "rgb(255 255 255 / 0.6)") : v === "outline" ? (t.background = "var(--cui-surface-base)", t.color = `var(--cui-${e})`, t.border = `1px solid var(--cui-${e}-border)`, t["--_toast-icon-color"] = `var(--cui-${e})`, t["--_toast-dismiss-color"] = "var(--cui-text-secondary)", t["--_toast-progress-bg"] = `var(--cui-${e}-bg)`, t["--_toast-progress-bar"] = `var(--cui-${e})`) : (t.background = `var(--cui-${e}-bg)`, t.color = "var(--cui-text-body)", t.border = `1px solid var(--cui-${e}-border)`, t["--_toast-icon-color"] = `var(--cui-${e})`, t["--_toast-dismiss-color"] = "var(--cui-text-secondary)", t["--_toast-progress-bg"] = `var(--cui-${e}-border)`, t["--_toast-progress-bar"] = `var(--cui-${e})`), t;
74
+ }), d = c(() => U(s.icon, s.color)), w = c(() => j(s.color, s.live)), C = q();
75
+ return (e, v) => V((i(), a("div", z({
76
76
  class: ["cui-toast", [
77
- s.animation !== "none" ? `cui-toast--${s.animation}` : ""
77
+ o.animation !== "none" ? `cui-toast--${o.animation}` : ""
78
78
  ]],
79
- style: B.value
80
- }, M.value, {
81
- onMouseenter: p,
82
- onMouseleave: x
79
+ style: M.value
80
+ }, w.value, {
81
+ onMouseenter: x,
82
+ onMouseleave: B
83
83
  }), [
84
- s.noIcon ? c("", !0) : (i(), a("div", q, [
85
- s.icon ? (i(), a(E, { key: 0 }, [
86
- g(v(s.icon), 1)
87
- ], 64)) : (i(), L(h, {
88
- key: 1,
89
- name: C.value,
90
- size: "1.25rem"
91
- }, null, 8, ["name"]))
84
+ o.noIcon ? n("", !0) : (i(), a("div", G, [
85
+ m(e.$slots, "icon", {}, () => [
86
+ d.value.text ? (i(), a(E, { key: 0 }, [
87
+ $(f(d.value.text), 1)
88
+ ], 64)) : (i(), L(h, {
89
+ key: 1,
90
+ name: d.value.name,
91
+ size: "1.25rem"
92
+ }, null, 8, ["name"]))
93
+ ], !0)
92
94
  ])),
93
- y("div", G, [
94
- s.title ? (i(), a("div", H, v(s.title), 1)) : c("", !0),
95
- s.description || t.$slots.default ? (i(), a("div", J, [
96
- $(t.$slots, "default", {}, () => [
97
- g(v(s.description), 1)
95
+ _("div", H, [
96
+ o.title ? (i(), a("div", J, f(o.title), 1)) : n("", !0),
97
+ o.description || e.$slots.default ? (i(), a("div", O, [
98
+ m(e.$slots, "default", {}, () => [
99
+ $(f(o.description), 1)
98
100
  ], !0)
99
- ])) : c("", !0),
100
- t.$slots.actions ? (i(), a("div", Q, [
101
- $(t.$slots, "actions", {}, void 0, !0)
102
- ])) : c("", !0)
101
+ ])) : n("", !0),
102
+ e.$slots.actions ? (i(), a("div", Q, [
103
+ m(e.$slots, "actions", {}, void 0, !0)
104
+ ])) : n("", !0)
103
105
  ]),
104
- s.dismissible ? (i(), a("button", {
106
+ o.dismissible ? (i(), a("button", {
105
107
  key: 1,
106
108
  type: "button",
107
109
  class: "cui-toast__dismiss",
108
- "aria-label": O(w).dismiss,
109
- onClick: f
110
+ "aria-label": R(C).dismiss,
111
+ onClick: g
110
112
  }, [
111
113
  A(h, {
112
114
  name: "x",
113
115
  size: "0.875rem"
114
116
  })
115
- ], 8, W)) : c("", !0),
116
- s.showProgress && s.autoDismiss && s.autoDismiss > 0 && s.active ? (i(), a("div", X, [
117
- y("div", {
117
+ ], 8, W)) : n("", !0),
118
+ o.showProgress && o.autoDismiss && o.autoDismiss > 0 && o.active ? (i(), a("div", X, [
119
+ _("div", {
118
120
  class: "cui-toast__progress-bar",
119
- style: R({ width: `${100 - I.value}%` })
121
+ style: F({ width: `${100 - I.value}%` })
120
122
  }, null, 4)
121
- ])) : c("", !0)
123
+ ])) : n("", !0)
122
124
  ], 16)), [
123
- [F, !s.hidden]
125
+ [K, !o.hidden]
124
126
  ]);
125
127
  }
126
128
  });
127
129
  export {
128
- ot as default
130
+ oe as default
129
131
  };
@@ -1,5 +1,5 @@
1
- import type { CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps } from "../types/common";
2
- export interface CuiToggleProps extends HideableProps, ColorableProps, SizeableProps, DisableableProps {
1
+ import type { CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps, NativeControlProps } from "../types/common";
2
+ export interface CuiToggleProps extends NativeControlProps, HideableProps, ColorableProps, SizeableProps, DisableableProps {
3
3
  /** The value this toggle represents (group mode) */
4
4
  value?: string | number;
5
5
  /** v-model binding (standalone boolean mode) */
@@ -1 +1 @@
1
- {"version":3,"file":"CuiToggle.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiToggle.vue"],"names":[],"mappings":"AAsRA,OAAO,KAAK,EAAY,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGzH,MAAM,WAAW,cAAe,SAAQ,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IACpG,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA4MD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA+BnD,QAAA,MAAM,eAAe;;;;;;;;cA/OR,OAAO;;;;gBAFL,OAAO;6EA0PpB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E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EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CuiToggle.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-87d8cb85"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c339f60c"]]);
5
5
  export {
6
- _ as default
6
+ m as default
7
7
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as B, inject as D, computed as i, ref as E, withDirectives as N, openBlock as v, createElementBlock as m, normalizeStyle as g, normalizeClass as R, createElementVNode as u, withModifiers as T, createCommentVNode as b, renderSlot as k, createTextVNode as p, toDisplayString as S, vShow as x } from "vue";
2
- import { ToggleGroupKey as K } from "./multi-select-group-context.js";
3
- import { clampSize as L } from "../utils/sizing.js";
4
- const O = ["aria-checked", "aria-disabled", "tabindex"], P = ["value", "checked", "disabled", "readonly"], X = {
1
+ import { defineComponent as D, inject as R, computed as o, ref as E, withDirectives as q, openBlock as v, createElementBlock as m, normalizeStyle as b, normalizeClass as L, createElementVNode as s, withModifiers as N, createCommentVNode as f, renderSlot as k, createTextVNode as p, toDisplayString as S, vShow as T } from "vue";
2
+ import { ToggleGroupKey as x } from "./multi-select-group-context.js";
3
+ import { clampSize as K } from "../utils/sizing.js";
4
+ const O = ["id", "aria-describedby", "aria-required", "aria-labelledby", "aria-checked", "aria-disabled", "tabindex"], P = ["name", "autocomplete", "value", "checked", "disabled", "readonly"], X = {
5
5
  key: 0,
6
6
  class: "cui-toggle__label-wrap"
7
7
  }, j = { class: "cui-toggle__label" }, G = {
8
8
  key: 0,
9
9
  class: "cui-toggle__description"
10
- }, Z = /* @__PURE__ */ B({
10
+ }, Z = /* @__PURE__ */ D({
11
11
  __name: "CuiToggle",
12
12
  props: {
13
13
  value: {},
@@ -16,98 +16,110 @@ const O = ["aria-checked", "aria-disabled", "tabindex"], P = ["value", "checked"
16
16
  description: {},
17
17
  showLabels: { type: Boolean, default: !1 },
18
18
  readonly: { type: Boolean, default: !1 },
19
+ name: {},
20
+ autocomplete: {},
21
+ id: {},
22
+ ariaDescribedby: {},
23
+ ariaLabelledby: {},
24
+ ariaRequired: { type: Boolean },
19
25
  hidden: { type: Boolean, default: !1 },
20
26
  color: {},
21
27
  size: { default: "md" },
22
28
  disabled: { type: Boolean, default: !1 }
23
29
  },
24
30
  emits: ["update:modelValue"],
25
- setup(a, { expose: w, emit: z }) {
26
- const t = a, _ = z, e = D(K, null), s = i(() => e && t.value !== void 0 ? e.modelValue.value.includes(t.value) : t.modelValue === !0), n = i(() => e != null && e.disabled.value ? !0 : t.disabled), d = i(() => e != null && e.readonly.value ? !0 : t.readonly), r = i(() => t.color ?? (e == null ? void 0 : e.color.value) ?? "primary"), f = E();
27
- function h() {
28
- n.value || d.value || (e && t.value !== void 0 ? e.toggle(t.value) : _("update:modelValue", !t.modelValue));
31
+ setup(e, { expose: w, emit: z }) {
32
+ const t = e, $ = z, l = R(x, null), r = o(() => l && t.value !== void 0 ? l.modelValue.value.includes(t.value) : t.modelValue === !0), u = o(() => l != null && l.disabled.value ? !0 : t.disabled), d = o(() => l != null && l.readonly.value ? !0 : t.readonly), n = o(() => t.color ?? (l == null ? void 0 : l.color.value) ?? "primary"), g = E();
33
+ function y() {
34
+ u.value || d.value || (l && t.value !== void 0 ? l.toggle(t.value) : $("update:modelValue", !t.modelValue));
29
35
  }
30
- function $(l) {
31
- (l.key === " " || l.key === "Enter") && (l.preventDefault(), h());
36
+ function V(a) {
37
+ (a.key === " " || a.key === "Enter") && (a.preventDefault(), y());
32
38
  }
33
- w({ el: f, focus: () => {
34
- var l;
35
- return (l = f.value) == null ? void 0 : l.focus();
39
+ w({ el: g, focus: () => {
40
+ var a;
41
+ return (a = g.value) == null ? void 0 : a.focus();
36
42
  } });
37
- const V = ["sm", "md", "lg"], C = {
43
+ const B = ["sm", "md", "lg"], C = {
38
44
  sm: { w: "2rem", h: "1.125rem", knob: "0.875rem", travel: "0.875rem", labelSize: "0.5rem" },
39
45
  md: { w: "2.75rem", h: "1.5rem", knob: "1.25rem", travel: "1.25rem", labelSize: "0.625rem" },
40
46
  lg: { w: "3.5rem", h: "1.875rem", knob: "1.5rem", travel: "1.625rem", labelSize: "0.6875rem" }
41
- }, y = i(() => L(t.size, V)), o = i(() => C[y.value]);
42
- return (l, c) => N((v(), m("label", {
47
+ }, h = o(() => K(t.size, B)), i = o(() => C[h.value]);
48
+ return (a, c) => q((v(), m("label", {
43
49
  ref_key: "elRef",
44
- ref: f,
45
- class: R(["cui-toggle", {
46
- "cui-toggle--checked": s.value,
47
- "cui-toggle--disabled": n.value,
50
+ ref: g,
51
+ class: L(["cui-toggle", {
52
+ "cui-toggle--checked": r.value,
53
+ "cui-toggle--disabled": u.value,
48
54
  "cui-toggle--readonly": d.value
49
55
  }]),
50
- style: g({ "--_toggle-focus-ring": `var(--cui-${r.value}-focus-ring)` }),
56
+ style: b({ "--_toggle-focus-ring": `var(--cui-${n.value}-focus-ring)` }),
57
+ id: e.id,
51
58
  role: "switch",
52
- "aria-checked": s.value,
53
- "aria-disabled": n.value || d.value || void 0,
54
- tabindex: n.value ? -1 : 0,
55
- onClick: h,
56
- onKeydown: $
59
+ "aria-describedby": e.ariaDescribedby,
60
+ "aria-required": e.ariaRequired || void 0,
61
+ "aria-labelledby": e.ariaLabelledby,
62
+ "aria-checked": r.value,
63
+ "aria-disabled": u.value || d.value || void 0,
64
+ tabindex: u.value ? -1 : 0,
65
+ onClick: y,
66
+ onKeydown: V
57
67
  }, [
58
- u("input", {
68
+ s("input", {
69
+ name: e.name,
70
+ autocomplete: e.autocomplete,
59
71
  type: "checkbox",
60
- value: a.value !== void 0 ? String(a.value) : void 0,
61
- checked: s.value,
62
- disabled: n.value,
72
+ value: e.value !== void 0 ? String(e.value) : void 0,
73
+ checked: r.value,
74
+ disabled: u.value,
63
75
  readonly: d.value,
64
76
  tabindex: "-1",
65
77
  "aria-hidden": "true",
66
78
  class: "cui-toggle__input",
67
- onClick: c[0] || (c[0] = T(() => {
79
+ onClick: c[0] || (c[0] = N(() => {
68
80
  }, ["stop", "prevent"]))
69
81
  }, null, 8, P),
70
- u("span", {
82
+ s("span", {
71
83
  class: "cui-toggle__track",
72
- style: g({
73
- width: o.value.w,
74
- height: o.value.h,
75
- "--_toggle-color": `var(--cui-${r.value})`,
76
- "--_toggle-bg": `var(--cui-${r.value}-bg)`,
77
- "--_toggle-hover": `var(--cui-${r.value}-hover)`,
78
- "--_toggle-active": `var(--cui-${r.value}-active)`
84
+ style: b({
85
+ width: i.value.w,
86
+ height: i.value.h,
87
+ "--_toggle-color": `var(--cui-${n.value})`,
88
+ "--_toggle-bg": `var(--cui-${n.value}-bg)`,
89
+ "--_toggle-hover": `var(--cui-${n.value}-hover)`,
90
+ "--_toggle-active": `var(--cui-${n.value}-active)`
79
91
  })
80
92
  }, [
81
- a.showLabels && y.value !== "sm" && s.value ? (v(), m("span", {
93
+ e.showLabels && h.value !== "sm" && r.value ? (v(), m("span", {
82
94
  key: 0,
83
95
  class: "cui-toggle__labels",
84
- style: g({ fontSize: o.value.labelSize })
96
+ style: b({ fontSize: i.value.labelSize })
85
97
  }, [...c[1] || (c[1] = [
86
- u("span", { class: "cui-toggle__on-label" }, "ON", -1)
87
- ])], 4)) : b("", !0),
88
- u("span", {
98
+ s("span", { class: "cui-toggle__on-label" }, "ON", -1)
99
+ ])], 4)) : f("", !0),
100
+ s("span", {
89
101
  class: "cui-toggle__knob",
90
- style: g({
91
- width: o.value.knob,
92
- height: o.value.knob,
93
- transform: s.value ? `translateX(${o.value.travel})` : "translateX(0)"
102
+ style: b({
103
+ width: i.value.knob,
104
+ height: i.value.knob,
105
+ transform: r.value ? `translateX(${i.value.travel})` : "translateX(0)"
94
106
  })
95
107
  }, null, 4)
96
108
  ], 4),
97
- a.label || l.$slots.default || a.description || l.$slots.description ? (v(), m("span", X, [
98
- u("span", j, [
99
- k(l.$slots, "default", {}, () => [
100
- p(S(a.label), 1)
109
+ e.label || a.$slots.default || e.description || a.$slots.description ? (v(), m("span", X, [
110
+ s("span", j, [
111
+ k(a.$slots, "default", {}, () => [
112
+ p(S(e.label), 1)
101
113
  ], !0)
102
114
  ]),
103
- a.description || l.$slots.description ? (v(), m("span", G, [
104
- k(l.$slots, "description", {}, () => [
105
- p(S(a.description), 1)
115
+ e.description || a.$slots.description ? (v(), m("span", G, [
116
+ k(a.$slots, "description", {}, () => [
117
+ p(S(e.description), 1)
106
118
  ], !0)
107
- ])) : b("", !0)
108
- ])) : b("", !0)
119
+ ])) : f("", !0)
120
+ ])) : f("", !0)
109
121
  ], 46, O)), [
110
- [x, !a.hidden]
122
+ [T, !e.hidden]
111
123
  ]);
112
124
  }
113
125
  });
@@ -1,5 +1,5 @@
1
- import type { CuiAutoOrientation, HideableProps, ColorableProps, DisableableProps } from "../types/common";
2
- export interface CuiToggleGroupProps extends HideableProps, ColorableProps, DisableableProps {
1
+ import type { CuiAutoOrientation, HideableProps, ColorableProps, DisableableProps, AriaLabelableProps } from "../types/common";
2
+ export interface CuiToggleGroupProps extends AriaLabelableProps, HideableProps, ColorableProps, DisableableProps {
3
3
  /** Array of selected values */
4
4
  modelValue?: Array<string | number>;
5
5
  /** Layout orientation — auto: horizontal for ≤2 options, vertical for 3+ */
@@ -1 +1 @@
1
- {"version":3,"file":"CuiToggleGroup.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiToggleGroup.vue"],"names":[],"mappings":"AAiIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG3G,MAAM,WAAW,mBAAoB,SAAQ,aAAa,EAAE,cAAc,EAAE,gBAAgB;IAC1F,+BAA+B;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACpC,4EAA4E;IAC5E,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,gCAAgC;I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AAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoHD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAwB/C,QAAA,MAAM,eAAe;;;;;WAnJX,OAAO;cAFJ,OAAO;;;;iBAFJ,kBAAkB;gBAFnB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;6EAiKnC,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CuiToggleGroup.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ab30c50c"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8f2fb834"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -1,9 +1,7 @@
1
- import { defineComponent as y, useSlots as h, computed as u, provide as v, toRef as a, withDirectives as b, openBlock as s, createElementBlock as c, normalizeClass as V, createElementVNode as S, renderSlot as B, toDisplayString as C, createCommentVNode as k, vShow as x } from "vue";
2
- import { ToggleGroupKey as D } from "./multi-select-group-context.js";
3
- const M = ["aria-label", "aria-invalid"], w = { class: "cui-toggle-group__options" }, z = {
4
- key: 0,
5
- class: "cui-toggle-group__error"
6
- }, N = /* @__PURE__ */ y({
1
+ import { defineComponent as p, useSlots as B, computed as u, provide as V, toRef as i, withDirectives as S, openBlock as s, createElementBlock as c, normalizeClass as C, unref as f, createElementVNode as D, renderSlot as q, toDisplayString as k, createCommentVNode as x, vShow as L } from "vue";
2
+ import { useFieldDescribedBy as M } from "../composables/useFieldDescribedBy.js";
3
+ import { ToggleGroupKey as R } from "./multi-select-group-context.js";
4
+ const w = ["id", "aria-labelledby", "aria-describedby", "aria-required", "aria-label", "aria-invalid"], z = { class: "cui-toggle-group__options" }, E = ["id"], $ = /* @__PURE__ */ p({
7
5
  __name: "CuiToggleGroup",
8
6
  props: {
9
7
  modelValue: { default: () => [] },
@@ -12,48 +10,60 @@ const M = ["aria-label", "aria-invalid"], w = { class: "cui-toggle-group__option
12
10
  error: { type: Boolean, default: !1 },
13
11
  errorMessage: {},
14
12
  label: {},
13
+ id: {},
14
+ ariaDescribedby: {},
15
+ ariaLabelledby: {},
16
+ ariaRequired: { type: Boolean },
15
17
  hidden: { type: Boolean, default: !1 },
16
18
  color: { default: "primary" },
17
19
  disabled: { type: Boolean, default: !1 }
18
20
  },
19
21
  emits: ["update:modelValue"],
20
- setup(o, { emit: f }) {
21
- const e = o, g = f, i = h(), m = u(() => {
22
- var r;
23
- const t = (r = i.default) == null ? void 0 : r.call(i);
24
- return t ? t.reduce((l, n) => {
25
- var d;
26
- return n.type === Symbol.for("v-fgm") || n.type === Symbol.for("v-fgt") ? l + (((d = n.children) == null ? void 0 : d.length) ?? 0) : l + 1;
22
+ setup(e, { emit: g }) {
23
+ const r = e, { errorId: b, describedBy: m } = M(r), y = g, t = B(), v = u(() => {
24
+ var a;
25
+ const o = (a = t.default) == null ? void 0 : a.call(t);
26
+ return o ? o.reduce((l, d) => {
27
+ var n;
28
+ return d.type === Symbol.for("v-fgm") || d.type === Symbol.for("v-fgt") ? l + (((n = d.children) == null ? void 0 : n.length) ?? 0) : l + 1;
27
29
  }, 0) : 0;
28
- }), p = u(() => e.orientation !== "auto" ? e.orientation : m.value <= 2 ? "horizontal" : "vertical");
29
- return v(D, {
30
- modelValue: a(e, "modelValue"),
31
- color: a(e, "color"),
32
- disabled: a(e, "disabled"),
33
- readonly: a(e, "readonly"),
34
- toggle(t) {
35
- if (e.disabled || e.readonly) return;
36
- const r = [...e.modelValue], l = r.indexOf(t);
37
- l >= 0 ? r.splice(l, 1) : r.push(t), g("update:modelValue", r);
30
+ }), h = u(() => r.orientation !== "auto" ? r.orientation : v.value <= 2 ? "horizontal" : "vertical");
31
+ return V(R, {
32
+ modelValue: i(r, "modelValue"),
33
+ color: i(r, "color"),
34
+ disabled: i(r, "disabled"),
35
+ readonly: i(r, "readonly"),
36
+ toggle(o) {
37
+ if (r.disabled || r.readonly) return;
38
+ const a = [...r.modelValue], l = a.indexOf(o);
39
+ l >= 0 ? a.splice(l, 1) : a.push(o), y("update:modelValue", a);
38
40
  }
39
- }), (t, r) => b((s(), c("div", {
41
+ }), (o, a) => S((s(), c("div", {
40
42
  role: "group",
41
- "aria-label": o.label,
42
- "aria-invalid": o.error || void 0,
43
- class: V(["cui-toggle-group", [
44
- `cui-toggle-group--${p.value}`,
45
- { "cui-toggle-group--error": o.error }
43
+ id: e.id,
44
+ "aria-labelledby": e.ariaLabelledby,
45
+ "aria-describedby": f(m),
46
+ "aria-required": e.ariaRequired || void 0,
47
+ "aria-label": e.ariaLabelledby ? void 0 : e.label,
48
+ "aria-invalid": e.error || void 0,
49
+ class: C(["cui-toggle-group", [
50
+ `cui-toggle-group--${h.value}`,
51
+ { "cui-toggle-group--error": e.error }
46
52
  ]])
47
53
  }, [
48
- S("div", w, [
49
- B(t.$slots, "default", {}, void 0, !0)
54
+ D("div", z, [
55
+ q(o.$slots, "default", {}, void 0, !0)
50
56
  ]),
51
- o.error && o.errorMessage ? (s(), c("div", z, C(o.errorMessage), 1)) : k("", !0)
52
- ], 10, M)), [
53
- [x, !o.hidden]
57
+ e.error && e.errorMessage ? (s(), c("div", {
58
+ key: 0,
59
+ id: f(b),
60
+ class: "cui-toggle-group__error"
61
+ }, k(e.errorMessage), 9, E)) : x("", !0)
62
+ ], 10, w)), [
63
+ [L, !e.hidden]
54
64
  ]);
55
65
  }
56
66
  });
57
67
  export {
58
- N as default
68
+ $ as default
59
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CuiTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTooltip.vue"],"names":[],"mappings":"AAsRA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEvF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE,MAAM,WAAW,eAAgB,SAAQ,aAAa,EAAE,cAAc,EAAE,gBAAgB;IACtF,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,mCAAmC;IACnC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAsOD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAwC/C,QAAA,MAAM,eAAe;;;;;;;eA5RP,gBAAgB;aAElB,cAAc;eAEZ,MAAM;eAEN,MAAM;aAER,OAAO;6EA4RjB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAz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ER,OAAO;6EAuTjB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CuiTooltip.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-db0bf3e6"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cd44838e"]]);
5
5
  export {
6
- i as default
6
+ m as default
7
7
  };