@indielayer/ui 1.4.0 → 1.5.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 (214) hide show
  1. package/docs/components/common/CodePreview.vue +1 -1
  2. package/docs/components/common/CodeSnippet.vue +5 -7
  3. package/docs/components/common/DocumentPage.vue +89 -93
  4. package/docs/components/menu/DocsMenu.vue +75 -122
  5. package/docs/components/toolbar/PreToolbar.vue +10 -12
  6. package/docs/components/toolbar/Toolbar.vue +21 -8
  7. package/docs/layouts/default.vue +7 -3
  8. package/docs/pages/colors.vue +49 -54
  9. package/docs/pages/component/button/button-group.vue +6 -2
  10. package/docs/pages/component/button/size.vue +1 -1
  11. package/docs/pages/component/carousel/usage.vue +2 -2
  12. package/docs/pages/component/form/usage.vue +3 -3
  13. package/docs/pages/component/formGroup/usage.vue +1 -0
  14. package/docs/pages/component/input/usage.vue +8 -9
  15. package/docs/pages/component/modal/composed.vue +3 -2
  16. package/docs/pages/component/modal/usage.vue +11 -6
  17. package/docs/pages/component/popover/usage.vue +3 -3
  18. package/docs/pages/component/select/usage.vue +1 -0
  19. package/docs/pages/component/tabs/usage.vue +6 -1
  20. package/docs/pages/component/textarea/usage.vue +10 -13
  21. package/docs/pages/component/toggle/usage.vue +9 -11
  22. package/docs/pages/component/tooltip/index.vue +2 -2
  23. package/docs/pages/component/tooltip/usage.vue +4 -8
  24. package/docs/pages/icons.vue +54 -58
  25. package/docs/pages/index.vue +73 -77
  26. package/docs/pages/play.vue +2 -14
  27. package/docs/pages/typography.vue +26 -30
  28. package/docs/router/index.ts +2 -0
  29. package/exports/tailwind.preset.js +0 -1
  30. package/lib/components/accordion/theme/AccordionItem.base.theme.js +7 -7
  31. package/lib/components/badge/Badge.vue.js +7 -7
  32. package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.js +1 -1
  33. package/lib/components/button/theme/Button.base.theme.js +7 -7
  34. package/lib/components/card/theme/Card.base.theme.js +1 -1
  35. package/lib/components/checkbox/Checkbox.vue.d.ts +3 -0
  36. package/lib/components/checkbox/Checkbox.vue2.js +23 -23
  37. package/lib/components/checkbox/theme/Checkbox.base.theme.js +6 -6
  38. package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +2 -2
  39. package/lib/components/container/theme/Container.base.theme.js +2 -2
  40. package/lib/components/divider/Divider.vue.js +14 -14
  41. package/lib/components/divider/theme/Divider.base.theme.js +2 -2
  42. package/lib/components/drawer/Drawer.vue.js +2 -2
  43. package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
  44. package/lib/components/form/Form.vue.js +1 -1
  45. package/lib/components/form/theme/Form.base.theme.js +4 -4
  46. package/lib/components/form/theme/Form.carbon.theme.js +4 -4
  47. package/lib/components/formGroup/FormGroup.vue.d.ts +3 -0
  48. package/lib/components/formGroup/FormGroup.vue.js +16 -15
  49. package/lib/components/formGroup/theme/FormGroup.base.theme.js +1 -1
  50. package/lib/components/icon/theme/Icon.base.theme.js +1 -1
  51. package/lib/components/index.js +108 -107
  52. package/lib/components/input/Input.vue.d.ts +3 -0
  53. package/lib/components/input/Input.vue.js +4 -3
  54. package/lib/components/input/theme/Input.base.theme.js +10 -10
  55. package/lib/components/input/theme/Input.carbon.theme.js +10 -10
  56. package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -3
  57. package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +2 -2
  58. package/lib/components/label/Label.vue.d.ts +3 -0
  59. package/lib/components/label/Label.vue.js +26 -20
  60. package/lib/components/label/theme/Label.base.theme.js +1 -1
  61. package/lib/components/label/theme/Label.carbon.theme.js +3 -3
  62. package/lib/components/link/Link.vue.js +2 -2
  63. package/lib/components/link/Link.vue2.js +4 -4
  64. package/lib/components/loader/theme/Loader.base.theme.js +1 -1
  65. package/lib/components/loader/theme/Loader.carbon.theme.js +1 -1
  66. package/lib/components/menu/Menu.vue.js +19 -19
  67. package/lib/components/menu/theme/MenuItem.base.theme.js +21 -31
  68. package/lib/components/modal/Modal.vue.d.ts +4 -0
  69. package/lib/components/modal/Modal.vue.js +78 -74
  70. package/lib/components/modal/theme/Modal.base.theme.js +10 -10
  71. package/lib/components/modal/theme/Modal.carbon.theme.js +3 -3
  72. package/lib/components/notifications/Notifications.vue.js +1 -1
  73. package/lib/components/notifications/theme/Notifications.base.theme.js +1 -1
  74. package/lib/components/notifications/theme/Notifications.carbon.theme.js +3 -3
  75. package/lib/components/pagination/Pagination.vue.js +27 -27
  76. package/lib/components/popover/Popover.vue.d.ts +13 -0
  77. package/lib/components/popover/Popover.vue.js +13 -8
  78. package/lib/components/popover/Popover.vue2.js +3 -2
  79. package/lib/components/popover/Popover.vue3.js +2 -3
  80. package/lib/components/popover/theme/PopoverContainer.base.theme.js +4 -4
  81. package/lib/components/popover/theme/PopoverContainer.carbon.theme.js +4 -4
  82. package/lib/components/progress/Progress.vue.js +11 -11
  83. package/lib/components/progress/theme/Progress.base.theme.js +10 -10
  84. package/lib/components/radio/Radio.vue.d.ts +3 -0
  85. package/lib/components/radio/theme/Radio.base.theme.js +28 -28
  86. package/lib/components/radio/theme/Radio.carbon.theme.js +8 -8
  87. package/lib/components/select/Select.vue.d.ts +16 -0
  88. package/lib/components/select/Select.vue.js +95 -92
  89. package/lib/components/select/theme/Select.base.theme.js +11 -11
  90. package/lib/components/select/theme/Select.carbon.theme.js +10 -10
  91. package/lib/components/skeleton/theme/Skeleton.base.theme.js +1 -1
  92. package/lib/components/slider/Slider.vue.d.ts +3 -0
  93. package/lib/components/slider/Slider.vue.js +1 -1
  94. package/lib/components/slider/theme/Slider.carbon.theme.js +6 -6
  95. package/lib/components/stepper/Stepper.vue.js +14 -14
  96. package/lib/components/tab/Tab.vue.js +55 -54
  97. package/lib/components/tab/theme/TabGroup.base.theme.js +15 -15
  98. package/lib/components/tab/theme/TabGroup.carbon.theme.js +8 -8
  99. package/lib/components/table/Table.vue.js +192 -194
  100. package/lib/components/table/theme/Table.base.theme.js +3 -3
  101. package/lib/components/table/theme/Table.carbon.theme.js +7 -7
  102. package/lib/components/table/theme/TableHead.base.theme.js +1 -1
  103. package/lib/components/table/theme/TableHead.carbon.theme.js +1 -1
  104. package/lib/components/table/theme/TableHeader.base.theme.js +1 -1
  105. package/lib/components/table/theme/TableHeader.carbon.theme.js +2 -2
  106. package/lib/components/table/theme/TableRow.base.theme.js +3 -3
  107. package/lib/components/table/theme/TableRow.carbon.theme.js +3 -3
  108. package/lib/components/tag/Tag.vue.js +4 -4
  109. package/lib/components/textarea/Textarea.vue.d.ts +7 -0
  110. package/lib/components/textarea/Textarea.vue.js +23 -21
  111. package/lib/components/textarea/theme/Textarea.base.theme.js +6 -6
  112. package/lib/components/textarea/theme/Textarea.carbon.theme.js +6 -6
  113. package/lib/components/toggle/Toggle.vue.d.ts +3 -0
  114. package/lib/components/toggle/Toggle.vue.js +26 -26
  115. package/lib/components/toggle/theme/Toggle.base.theme.js +1 -1
  116. package/lib/components/tooltip/ToggleTip.vue.d.ts +14 -0
  117. package/lib/components/tooltip/ToggleTip.vue.js +29 -0
  118. package/lib/components/tooltip/ToggleTip.vue2.js +4 -0
  119. package/lib/components/tooltip/Tooltip.vue.d.ts +22 -3
  120. package/lib/components/tooltip/Tooltip.vue.js +26 -17
  121. package/lib/components/tooltip/__tests__/ToggleTip.spec.d.ts +1 -0
  122. package/lib/components/tooltip/index.d.ts +2 -0
  123. package/lib/composables/useColors.js +9 -9
  124. package/lib/composables/useInputtable.d.ts +1 -0
  125. package/lib/composables/useInputtable.js +20 -19
  126. package/lib/index.js +37 -35
  127. package/lib/index.umd.js +7 -3
  128. package/lib/tailwind.preset.js +0 -1
  129. package/lib/themes/base/index.js +3 -6
  130. package/lib/themes/base/styles.css.js +4 -0
  131. package/lib/version.d.ts +1 -1
  132. package/lib/version.js +1 -1
  133. package/package.json +2 -1
  134. package/src/components/accordion/theme/AccordionItem.base.theme.ts +2 -2
  135. package/src/components/badge/Badge.vue +1 -1
  136. package/src/components/breadcrumbs/theme/Breadcrumbs.base.theme.ts +1 -1
  137. package/src/components/button/theme/Button.base.theme.ts +2 -2
  138. package/src/components/card/theme/Card.base.theme.ts +1 -1
  139. package/src/components/checkbox/Checkbox.vue +1 -1
  140. package/src/components/checkbox/theme/Checkbox.base.theme.ts +8 -8
  141. package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +2 -2
  142. package/src/components/container/theme/Container.base.theme.ts +2 -2
  143. package/src/components/divider/Divider.vue +1 -1
  144. package/src/components/divider/theme/Divider.base.theme.ts +2 -2
  145. package/src/components/drawer/Drawer.vue +2 -2
  146. package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
  147. package/src/components/form/Form.vue +1 -1
  148. package/src/components/form/theme/Form.base.theme.ts +1 -1
  149. package/src/components/form/theme/Form.carbon.theme.ts +1 -1
  150. package/src/components/formGroup/FormGroup.vue +1 -0
  151. package/src/components/formGroup/theme/FormGroup.base.theme.ts +1 -1
  152. package/src/components/icon/theme/Icon.base.theme.ts +2 -2
  153. package/src/components/input/Input.vue +2 -1
  154. package/src/components/input/theme/Input.base.theme.ts +5 -5
  155. package/src/components/input/theme/Input.carbon.theme.ts +6 -6
  156. package/src/components/inputFooter/theme/InputFooter.base.theme.ts +3 -3
  157. package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +2 -2
  158. package/src/components/label/Label.vue +4 -1
  159. package/src/components/label/theme/Label.base.theme.ts +1 -1
  160. package/src/components/label/theme/Label.carbon.theme.ts +1 -1
  161. package/src/components/link/Link.vue +1 -1
  162. package/src/components/loader/theme/Loader.base.theme.ts +1 -1
  163. package/src/components/loader/theme/Loader.carbon.theme.ts +1 -1
  164. package/src/components/menu/Menu.vue +3 -3
  165. package/src/components/menu/theme/MenuItem.base.theme.ts +30 -34
  166. package/src/components/modal/Modal.vue +8 -3
  167. package/src/components/modal/theme/Modal.base.theme.ts +9 -6
  168. package/src/components/modal/theme/Modal.carbon.theme.ts +3 -3
  169. package/src/components/notifications/Notifications.vue +1 -1
  170. package/src/components/notifications/theme/Notifications.base.theme.ts +1 -1
  171. package/src/components/notifications/theme/Notifications.carbon.theme.ts +1 -1
  172. package/src/components/pagination/Pagination.vue +3 -3
  173. package/src/components/popover/Popover.vue +77 -2
  174. package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
  175. package/src/components/popover/theme/PopoverContainer.carbon.theme.ts +1 -1
  176. package/src/components/progress/Progress.vue +1 -1
  177. package/src/components/progress/theme/Progress.base.theme.ts +2 -2
  178. package/src/components/radio/theme/Radio.base.theme.ts +8 -8
  179. package/src/components/radio/theme/Radio.carbon.theme.ts +1 -1
  180. package/src/components/select/Select.vue +7 -4
  181. package/src/components/select/theme/Select.base.theme.ts +8 -8
  182. package/src/components/select/theme/Select.carbon.theme.ts +8 -8
  183. package/src/components/skeleton/theme/Skeleton.base.theme.ts +1 -1
  184. package/src/components/slider/Slider.vue +1 -1
  185. package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
  186. package/src/components/stepper/Stepper.vue +3 -3
  187. package/src/components/tab/Tab.vue +3 -3
  188. package/src/components/tab/theme/TabGroup.base.theme.ts +4 -4
  189. package/src/components/tab/theme/TabGroup.carbon.theme.ts +3 -3
  190. package/src/components/table/Table.vue +2 -0
  191. package/src/components/table/theme/Table.base.theme.ts +1 -1
  192. package/src/components/table/theme/Table.carbon.theme.ts +2 -2
  193. package/src/components/table/theme/TableHead.base.theme.ts +1 -1
  194. package/src/components/table/theme/TableHead.carbon.theme.ts +1 -1
  195. package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
  196. package/src/components/table/theme/TableHeader.carbon.theme.ts +2 -2
  197. package/src/components/table/theme/TableRow.base.theme.ts +3 -3
  198. package/src/components/table/theme/TableRow.carbon.theme.ts +3 -3
  199. package/src/components/tag/Tag.vue +1 -1
  200. package/src/components/textarea/Textarea.vue +3 -1
  201. package/src/components/textarea/theme/Textarea.base.theme.ts +5 -4
  202. package/src/components/textarea/theme/Textarea.carbon.theme.ts +5 -5
  203. package/src/components/toggle/Toggle.vue +3 -3
  204. package/src/components/toggle/theme/Toggle.base.theme.ts +1 -1
  205. package/src/components/tooltip/ToggleTip.vue +31 -0
  206. package/src/components/tooltip/Tooltip.vue +14 -4
  207. package/src/components/tooltip/__tests__/ToggleTip.spec.ts +11 -0
  208. package/src/components/tooltip/index.ts +3 -0
  209. package/src/composables/useColors.ts +1 -1
  210. package/src/composables/useInputtable.ts +1 -0
  211. package/src/themes/base/index.ts +0 -3
  212. package/src/themes/base/styles.css +4 -0
  213. package/src/version.ts +1 -1
  214. package/volar.d.ts +1 -0
@@ -1,4 +1,4 @@
1
- import { defineComponent as V, ref as P, watch as q, openBlock as m, createBlock as d, normalizeStyle as K, unref as r, normalizeClass as R, withCtx as j, createElementVNode as F, mergeProps as H, toHandlers as L, withKeys as $, createCommentVNode as D } from "vue";
1
+ import { defineComponent as x, ref as P, watch as q, openBlock as m, createBlock as d, normalizeStyle as K, unref as r, normalizeClass as R, withCtx as j, createElementVNode as F, mergeProps as H, toHandlers as L, withKeys as $, createCommentVNode as D } from "vue";
2
2
  import { useResizeObserver as O, useEventListener as X } from "../../node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9/node_modules/@vueuse/core/index.js";
3
3
  import { useCSS as A } from "../../composables/useCSS.js";
4
4
  import { useTheme as G } from "../../composables/useTheme.js";
@@ -27,51 +27,53 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
27
27
  placeholder: String,
28
28
  adjustToText: Boolean,
29
29
  preventEnter: Boolean,
30
- block: Boolean
30
+ block: Boolean,
31
+ resizable: Boolean
31
32
  }, Y = {
32
33
  name: "XTextarea",
33
34
  validators: {
34
35
  ...u.validators()
35
36
  }
36
- }, de = /* @__PURE__ */ V({
37
+ }, de = /* @__PURE__ */ x({
37
38
  ...Y,
38
39
  props: W,
39
40
  emits: s.emits(),
40
41
  setup(f, { expose: c, emit: h }) {
41
42
  const t = f, b = h, o = P(null);
42
- O(o, n), typeof window < "u" && X(window, "resize", n), q([() => t.modelValue, () => t.size], () => {
43
- setTimeout(n);
43
+ O(o, l), typeof window < "u" && X(window, "resize", l), q([() => t.modelValue, () => t.size], () => {
44
+ setTimeout(l);
44
45
  });
45
46
  const g = A("textarea"), y = J().getPalette("primary"), v = g.get("border", y[400]);
46
47
  function w() {
47
- n();
48
+ l();
48
49
  }
49
50
  function S(e) {
50
51
  t.preventEnter && e.preventDefault(), e.stopPropagation();
51
52
  }
52
- function n() {
53
+ function l() {
53
54
  t.adjustToText && o.value && (o.value.style.height = "1px", o.value.style.height = 2 + o.value.scrollHeight + "px");
54
55
  }
55
56
  const { focus: a, blur: k } = p(o), {
56
- errorInternal: l,
57
+ errorInternal: n,
57
58
  hideFooterInternal: N,
58
59
  isInsideForm: T,
59
- inputListeners: C,
60
- reset: z,
61
- validate: E,
62
- setError: I
63
- } = s(t, { focus: a, emit: b }), { styles: x, classes: i, className: B } = G("Textarea", {}, t, { errorInternal: l });
64
- return c({ focus: a, blur: k, reset: z, validate: E, setError: I }), (e, _) => (m(), d(M, {
65
- style: K(r(x)),
60
+ inputListeners: z,
61
+ reset: C,
62
+ validate: B,
63
+ setError: E
64
+ } = s(t, { focus: a, emit: b }), { styles: I, classes: i, className: V } = G("Textarea", {}, t, { errorInternal: n });
65
+ return c({ focus: a, blur: k, reset: C, validate: B, setError: E }), (e, _) => (m(), d(M, {
66
+ style: K(r(I)),
66
67
  block: e.block,
67
68
  disabled: e.disabled,
68
69
  required: e.required,
69
70
  "is-inside-form": r(T),
70
71
  label: e.label,
71
72
  class: R([
72
- r(B),
73
+ r(V),
73
74
  r(i).wrapper
74
- ])
75
+ ]),
76
+ tooltip: e.tooltip
75
77
  }, {
76
78
  default: j(() => [
77
79
  F("textarea", H({
@@ -80,7 +82,7 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
80
82
  ref: o,
81
83
  class: ["", [
82
84
  r(i).input,
83
- r(l) ? "border-red-500 dark:border-red-400 focus:outline-red-500" : "focus:outline-[color:var(--x-textarea-border)]"
85
+ r(n) ? "border-error-500 dark:border-error-400 focus:outline-error-500" : "focus:outline-[color:var(--x-textarea-border)]"
84
86
  ]],
85
87
  style: r(v),
86
88
  disabled: e.disabled,
@@ -94,18 +96,18 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
94
96
  placeholder: e.placeholder,
95
97
  readonly: e.readonly,
96
98
  value: e.modelValue ? String(e.modelValue) : ""
97
- }, L(r(C), !0), {
99
+ }, L(r(z), !0), {
98
100
  onKeydown: $(S, ["enter"]),
99
101
  onInput: w
100
102
  }), null, 16, U),
101
103
  r(N) ? D("", !0) : (m(), d(Q, {
102
104
  key: 0,
103
- error: r(l),
105
+ error: r(n),
104
106
  helper: e.helper
105
107
  }, null, 8, ["error", "helper"]))
106
108
  ]),
107
109
  _: 1
108
- }, 8, ["style", "block", "disabled", "required", "is-inside-form", "label", "class"]));
110
+ }, 8, ["style", "block", "disabled", "required", "is-inside-form", "label", "class", "tooltip"]));
109
111
  }
110
112
  });
111
113
  export {
@@ -1,12 +1,12 @@
1
- const t = {
1
+ const a = {
2
2
  classes: {
3
3
  wrapper: "",
4
- input: ({ props: r, data: a }) => {
5
- const e = ["resize-none appearance-none block w-full placeholder-gray-400 dark:placeholder-gray-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-gray-300 dark:border-gray-700 border shadow-sm rounded-md"];
6
- return !a.errorInternal && !r.disabled && e.push("hover:border-gray-400 dark:hover:border-gray-500"), r.size === "xs" ? e.push("px-2 py-1 text-xs") : r.size === "sm" ? e.push("px-2 py-2 text-sm") : r.size === "lg" ? e.push("px-4 py-3 text-lg") : r.size === "xl" ? e.push("px-5 py-4 text-xl") : e.push("px-3 py-2"), e.push(r.disabled ? "bg-gray-100 dark:bg-gray-900 text-gray-500 cursor-not-allowed" : "bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200"), e;
4
+ input: ({ props: s, data: r }) => {
5
+ const e = ["appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border shadow-sm rounded-md"];
6
+ return s.resizable || e.push("resize-none"), !r.errorInternal && !s.disabled && e.push("hover:border-secondary-400 dark:hover:border-secondary-500"), s.size === "xs" ? e.push("px-2 py-1 text-xs") : s.size === "sm" ? e.push("px-2 py-2 text-sm") : s.size === "lg" ? e.push("px-4 py-3 text-lg") : s.size === "xl" ? e.push("px-5 py-4 text-xl") : e.push("px-3 py-2"), e.push(s.disabled ? "bg-secondary-100 dark:bg-secondary-700 text-secondary-400 dark:text-secondary-600 cursor-not-allowed" : "bg-white dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), e;
7
7
  }
8
8
  }
9
- }, s = t;
9
+ }, t = a;
10
10
  export {
11
- s as default
11
+ t as default
12
12
  };
@@ -1,12 +1,12 @@
1
- const t = {
1
+ const a = {
2
2
  classes: {
3
3
  wrapper: "",
4
- input: ({ props: r, data: a }) => {
5
- const e = ["resize-none appearance-none block w-full placeholder-gray-400 dark:placeholder-gray-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-gray-300 dark:border-gray-700 border-b text-sm px-4"];
6
- return !a.errorInternal && !r.disabled && e.push("hover:border-gray-400 dark:hover:border-gray-500"), r.size === "xs" || r.size === "sm" ? e.push("py-1.5") : r.size === "lg" || r.size === "xl" ? e.push("py-3.5") : e.push("py-2.5"), r.disabled ? e.push("bg-gray-100 dark:bg-gray-900 text-gray-300 cursor-not-allowed") : r.readonly ? e.push("bg-white dark:bg-gray-900 text-gray-700") : e.push("bg-gray-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200"), e;
4
+ input: ({ props: r, data: s }) => {
5
+ const e = ["resize-none appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border-b text-sm px-4"];
6
+ return !s.errorInternal && !r.disabled && e.push("hover:border-secondary-400 dark:hover:border-secondary-500"), r.size === "xs" || r.size === "sm" ? e.push("py-1.5") : r.size === "lg" || r.size === "xl" ? e.push("py-3.5") : e.push("py-2.5"), r.disabled ? e.push("bg-secondary-100 dark:bg-secondary-900 text-secondary-300 cursor-not-allowed") : r.readonly ? e.push("bg-white dark:bg-secondary-900 text-secondary-700") : e.push("bg-secondary-50 dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), e;
7
7
  }
8
8
  }
9
- }, s = t;
9
+ }, n = a;
10
10
  export {
11
- s as default
11
+ n as default
12
12
  };
@@ -19,6 +19,7 @@ declare const toggleProps: {
19
19
  readonly type: ArrayConstructor;
20
20
  readonly default: () => never[];
21
21
  };
22
+ tooltip: StringConstructor;
22
23
  disabled: BooleanConstructor;
23
24
  loading: BooleanConstructor;
24
25
  loadingLabel: StringConstructor;
@@ -59,6 +60,7 @@ declare const _default: import("vue").DefineComponent<{
59
60
  readonly type: ArrayConstructor;
60
61
  readonly default: () => never[];
61
62
  };
63
+ tooltip: StringConstructor;
62
64
  disabled: BooleanConstructor;
63
65
  loading: BooleanConstructor;
64
66
  loadingLabel: StringConstructor;
@@ -100,6 +102,7 @@ declare const _default: import("vue").DefineComponent<{
100
102
  readonly type: ArrayConstructor;
101
103
  readonly default: () => never[];
102
104
  };
105
+ tooltip: StringConstructor;
103
106
  disabled: BooleanConstructor;
104
107
  loading: BooleanConstructor;
105
108
  loadingLabel: StringConstructor;
@@ -1,8 +1,8 @@
1
- import { defineComponent as T, ref as $, computed as D, openBlock as t, createElementBlock as b, normalizeClass as o, unref as r, createElementVNode as a, normalizeStyle as R, withDirectives as S, vModelCheckbox as F, toDisplayString as L, createCommentVNode as i, createBlock as c } from "vue";
1
+ import { defineComponent as T, ref as $, computed as D, openBlock as d, createElementBlock as b, normalizeClass as l, unref as r, createElementVNode as a, normalizeStyle as R, withDirectives as S, vModelCheckbox as F, toDisplayString as L, createCommentVNode as t, createBlock as g } from "vue";
2
2
  import { useTheme as M } from "../../composables/useTheme.js";
3
3
  import { useCommon as f } from "../../composables/useCommon.js";
4
4
  import { useColors as P } from "../../composables/useColors.js";
5
- import { useInputtable as n } from "../../composables/useInputtable.js";
5
+ import { useInputtable as i } from "../../composables/useInputtable.js";
6
6
  import { useInteractive as v } from "../../composables/useInteractive.js";
7
7
  import U from "../spinner/Spinner.vue.js";
8
8
  import W from "../inputFooter/InputFooter.vue.js";
@@ -10,7 +10,7 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
10
10
  ...f.props(),
11
11
  ...P.props("primary"),
12
12
  ...v.props(),
13
- ...n.props(),
13
+ ...i.props(),
14
14
  glow: Boolean
15
15
  }, H = {
16
16
  name: "XToggle",
@@ -20,11 +20,11 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
20
20
  }, ee = /* @__PURE__ */ T({
21
21
  ...H,
22
22
  props: G,
23
- emits: n.emits(!1),
23
+ emits: i.emits(!1),
24
24
  setup(h, { expose: k, emit: y }) {
25
- const d = h, u = y, m = $(null), l = D({
25
+ const n = h, u = y, m = $(null), o = D({
26
26
  get() {
27
- return !!d.modelValue;
27
+ return !!n.modelValue;
28
28
  },
29
29
  set(e) {
30
30
  u("update:modelValue", e);
@@ -35,9 +35,9 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
35
35
  reset: z,
36
36
  validate: B,
37
37
  setError: I
38
- } = n(d, { focus: p, emit: u, withListeners: !1 }), { styles: q, classes: s, className: E } = M("Toggle", {}, d);
39
- return k({ focus: p, blur: w, reset: z, validate: B, setError: I }), (e, g) => (t(), b("label", {
40
- class: o(["inline-block", [
38
+ } = i(n, { focus: p, emit: u, withListeners: !1 }), { styles: q, classes: s, className: E } = M("Toggle", {}, n);
39
+ return k({ focus: p, blur: w, reset: z, validate: B, setError: I }), (e, c) => (d(), b("label", {
40
+ class: l(["inline-block", [
41
41
  r(E),
42
42
  r(s).wrapper,
43
43
  e.disabled ? "cursor-not-allowed" : "cursor-pointer"
@@ -45,23 +45,23 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
45
45
  }, [
46
46
  a("div", X, [
47
47
  a("div", {
48
- class: o(["flex items-center rounded-full transition-colors duration-300 border-[3px] shrink-0 !border-transparent", {
48
+ class: l(["flex items-center rounded-full transition-colors duration-300 border-[3px] shrink-0 !border-transparent", {
49
49
  [`shadow-lg shadow-${e.color}-500/50`]: e.glow && e.modelValue,
50
- "bg-gray-300 dark:bg-gray-500": !e.disabled && !l.value && !e.loading,
51
- "bg-gray-100 dark:bg-gray-700": e.disabled || e.loading,
52
- "bg-[color:var(--x-toggle-bg)] dark:bg-[color:var(--x-toggle-dark-bg)]": !e.disabled && l.value
50
+ "bg-secondary-300 dark:bg-secondary-500": !e.disabled && !o.value && !e.loading,
51
+ "bg-secondary-100 dark:bg-secondary-700": e.disabled || e.loading,
52
+ "bg-[color:var(--x-toggle-bg)] dark:bg-[color:var(--x-toggle-dark-bg)]": !e.disabled && o.value
53
53
  }]),
54
54
  style: R(r(q))
55
55
  }, [
56
56
  a("div", {
57
- class: o(r(s).buttonWrapper)
57
+ class: l(r(s).buttonWrapper)
58
58
  }, [
59
59
  S(a("input", {
60
60
  id: e.id,
61
61
  ref_key: "elRef",
62
62
  ref: m,
63
- "onUpdate:modelValue": g[0] || (g[0] = (N) => l.value = N),
64
- "aria-checked": l.value ? "true" : "false",
63
+ "onUpdate:modelValue": c[0] || (c[0] = (N) => o.value = N),
64
+ "aria-checked": o.value ? "true" : "false",
65
65
  "aria-disabled": e.disabled ? "true" : void 0,
66
66
  type: "checkbox",
67
67
  class: "hidden",
@@ -70,32 +70,32 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
70
70
  required: e.required,
71
71
  value: e.modelValue
72
72
  }, null, 8, j), [
73
- [F, l.value]
73
+ [F, o.value]
74
74
  ]),
75
75
  a("div", {
76
- class: o([
76
+ class: l([
77
77
  r(s).button,
78
78
  {
79
- "translate-x-full": l.value,
79
+ "translate-x-full": o.value,
80
80
  shadow: !e.disabled
81
81
  },
82
- e.disabled ? "bg-gray-50 dark:bg-gray-800" : "bg-white dark:bg-gray-800"
82
+ e.disabled ? "bg-secondary-50 dark:bg-secondary-800" : "bg-white dark:bg-secondary-800"
83
83
  ])
84
84
  }, null, 2)
85
85
  ], 2)
86
86
  ], 6),
87
- e.label ? (t(), b("span", {
87
+ e.label ? (d(), b("span", {
88
88
  key: 0,
89
- class: o(["ml-2", r(s).label]),
89
+ class: l(["ml-2", r(s).label]),
90
90
  textContent: L(e.label)
91
- }, null, 10, A)) : i("", !0),
92
- e.loading ? (t(), c(U, {
91
+ }, null, 10, A)) : t("", !0),
92
+ e.loading ? (d(), g(U, {
93
93
  key: 1,
94
94
  size: e.size,
95
95
  class: "ml-1"
96
- }, null, 8, ["size"])) : i("", !0)
96
+ }, null, 8, ["size"])) : t("", !0)
97
97
  ]),
98
- r(V) ? i("", !0) : (t(), c(W, {
98
+ r(V) ? t("", !0) : (d(), g(W, {
99
99
  key: 0,
100
100
  error: r(C),
101
101
  helper: e.helper
@@ -2,7 +2,7 @@ const i = {
2
2
  classes: {
3
3
  wrapper: "",
4
4
  label: ({ props: t }) => {
5
- const e = "font-medium text-gray-800 dark:text-gray-200";
5
+ const e = "font-medium text-secondary-800 dark:text-secondary-200";
6
6
  return t.size === "xs" ? e + " text-xs" : t.size === "sm" ? e + " text-sm" : t.size === "lg" ? e + " text-lg" : t.size === "xl" ? e + " text-xl" : e + " text-sm";
7
7
  },
8
8
  buttonWrapper: ({ props: t }) => {
@@ -0,0 +1,14 @@
1
+ import { type ExtractPublicPropTypes } from 'vue';
2
+ declare const toggleTipProps: {
3
+ content: StringConstructor;
4
+ icon: StringConstructor;
5
+ };
6
+ export type ToggleTipProps = ExtractPublicPropTypes<typeof toggleTipProps>;
7
+ declare const _default: import("vue").DefineComponent<{
8
+ content: StringConstructor;
9
+ icon: StringConstructor;
10
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
+ content: StringConstructor;
12
+ icon: StringConstructor;
13
+ }>>, {}, {}>;
14
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { defineComponent as r, computed as i, openBlock as p, createBlock as s, withCtx as o, createElementVNode as a, createVNode as m } from "vue";
2
+ import l from "./Tooltip.vue.js";
3
+ import _ from "../icon/Icon.vue.js";
4
+ import { infoIcon as d } from "../../common/icons.js";
5
+ const u = ["innerHTML"], f = {
6
+ content: String,
7
+ icon: String
8
+ }, g = { name: "XToggleTip" }, y = /* @__PURE__ */ r({
9
+ ...g,
10
+ props: f,
11
+ setup(t) {
12
+ const e = t, n = i(() => e.icon || d);
13
+ return (c, T) => (p(), s(l, { placement: "auto" }, {
14
+ tooltip: o(() => [
15
+ a("div", { innerHTML: c.content }, null, 8, u)
16
+ ]),
17
+ default: o(() => [
18
+ m(_, {
19
+ icon: n.value,
20
+ class: "text-secondary-500 dark:text-secondary-300 cursor-pointer"
21
+ }, null, 8, ["icon"])
22
+ ]),
23
+ _: 1
24
+ }));
25
+ }
26
+ });
27
+ export {
28
+ y as default
29
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ToggleTip.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,7 +1,26 @@
1
- import type { ExtractPublicPropTypes } from 'vue';
2
- declare const tooltipProps: {};
1
+ import type { ExtractPublicPropTypes, PropType } from 'vue';
2
+ import { type Placement } from 'floating-vue';
3
+ declare const tooltipProps: {
4
+ placement: {
5
+ type: PropType<Placement>;
6
+ default: string;
7
+ };
8
+ };
9
+ export type PopoverPlacement = Placement;
3
10
  export type TooltipProps = ExtractPublicPropTypes<typeof tooltipProps>;
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
11
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
12
+ placement: {
13
+ type: PropType<Placement>;
14
+ default: string;
15
+ };
16
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
17
+ placement: {
18
+ type: PropType<Placement>;
19
+ default: string;
20
+ };
21
+ }>>, {
22
+ placement: Placement;
23
+ }, {}>, {
5
24
  default?(_: {}): any;
6
25
  tooltip?(_: {}): any;
7
26
  }>;
@@ -1,31 +1,40 @@
1
- import { defineComponent as s, openBlock as r, createBlock as a, withCtx as t, createElementVNode as n, createVNode as l, renderSlot as o } from "vue";
1
+ import { defineComponent as r, openBlock as a, createBlock as s, withCtx as e, createElementVNode as l, createVNode as n, renderSlot as o } from "vue";
2
2
  import c from "../popover/Popover.vue.js";
3
- import "../popover/Popover.vue2.js";
4
- import i from "../popover/PopoverContainer.vue.js";
5
- const m = { class: "dark" }, _ = { name: "XTooltip" }, k = /* @__PURE__ */ s({
3
+ import "../popover/Popover.vue3.js";
4
+ import p from "../popover/PopoverContainer.vue.js";
5
+ import "../../node_modules/.pnpm/floating-vue@5.2.0_vue@3.3.9/node_modules/floating-vue/dist/floating-vue.js";
6
+ const i = { class: "dark" }, m = {
7
+ placement: {
8
+ type: String,
9
+ default: "bottom"
10
+ }
11
+ }, _ = { name: "XTooltip" }, $ = /* @__PURE__ */ r({
6
12
  ..._,
7
- setup(p) {
8
- return (e, d) => (r(), a(c, {
9
- triggers: ["hover"],
10
- class: "inline-block"
13
+ props: m,
14
+ setup(d) {
15
+ return (t, f) => (a(), s(c, {
16
+ triggers: ["hover", "click"],
17
+ class: "inline-block",
18
+ "hide-arrow": !1,
19
+ placement: t.placement
11
20
  }, {
12
- content: t(() => [
13
- n("div", m, [
14
- l(i, { class: "p-2 text-white text-sm w-max max-w-xs" }, {
15
- default: t(() => [
16
- o(e.$slots, "tooltip")
21
+ content: e(() => [
22
+ l("div", i, [
23
+ n(p, { class: "p-2 text-white text-xs w-max max-w-xs" }, {
24
+ default: e(() => [
25
+ o(t.$slots, "tooltip")
17
26
  ]),
18
27
  _: 3
19
28
  })
20
29
  ])
21
30
  ]),
22
- default: t(() => [
23
- o(e.$slots, "default")
31
+ default: e(() => [
32
+ o(t.$slots, "default")
24
33
  ]),
25
34
  _: 3
26
- }));
35
+ }, 8, ["placement"]));
27
36
  }
28
37
  });
29
38
  export {
30
- k as default
39
+ $ as default
31
40
  };
@@ -1,2 +1,4 @@
1
1
  export { default as XTooltip } from './Tooltip.vue';
2
2
  export type { TooltipProps } from './Tooltip.vue';
3
+ export { default as XToggleTip } from './ToggleTip.vue';
4
+ export type { ToggleTipProps } from './ToggleTip.vue';
@@ -2,27 +2,27 @@ import { inject as m, computed as p, unref as f } from "vue";
2
2
  import { injectThemeKey as g } from "./keys.js";
3
3
  import { tailwindColors as n, setOpacity as l, isValidColor as d, colorShade as t } from "../common/colors.js";
4
4
  import { mergeRightDeep as y } from "../common/utils.js";
5
- const i = {}, C = {
6
- primary: n.sky,
5
+ const a = {}, C = {
6
+ primary: n.emerald,
7
7
  secondary: n.slate,
8
8
  success: n.green,
9
9
  warning: n.yellow,
10
10
  error: n.red
11
- }, a = (r) => n[r], c = (r, s) => l(r, s), w = () => {
11
+ }, i = (r) => n[r], c = (r, s) => l(r, s), w = () => {
12
12
  const r = m(g, {}), s = p(() => y(C, f(r).colors || {}));
13
13
  return {
14
14
  getPalette: (e) => {
15
15
  if (!e)
16
- return a("gray");
17
- const o = a(e);
16
+ return i("gray");
17
+ const o = i(e);
18
18
  if (o)
19
19
  return o;
20
- if (i[e])
21
- return i[e];
20
+ if (a[e])
21
+ return a[e];
22
22
  if (s.value[e])
23
23
  return s.value[e];
24
24
  if (!d(e))
25
- return console.warn(`Invalid color: ${e}`), a("gray");
25
+ return console.warn(`Invalid color: ${e}`), i("gray");
26
26
  const u = {
27
27
  50: t(e, 0.9),
28
28
  100: t(e, 0.8),
@@ -36,7 +36,7 @@ const i = {}, C = {
36
36
  900: t(e, -0.7),
37
37
  950: t(e, -0.8)
38
38
  };
39
- return i[e] = u, u;
39
+ return a[e] = u, u;
40
40
  },
41
41
  getColorOpacity: c
42
42
  };
@@ -46,5 +46,6 @@ export declare const useInputtable: {
46
46
  readonly type: ArrayConstructor;
47
47
  readonly default: () => never[];
48
48
  };
49
+ readonly tooltip: StringConstructor;
49
50
  };
50
51
  };
@@ -1,11 +1,11 @@
1
- import { ref as i, watch as h, inject as G, computed as j, onMounted as A, onUnmounted as O } from "vue";
1
+ import { ref as a, watch as h, inject as G, computed as j, onMounted as A, onUnmounted as O } from "vue";
2
2
  import { injectFormGroupKey as K, injectFormKey as M } from "./keys.js";
3
3
  const y = (r, { focus: I, emit: o, withListeners: b = !0 }) => {
4
- const s = i(!0), n = i(r.error), v = i(r.hideFooter), V = r.name ? r.name : (Math.random() + 1).toString(36).substring(7), a = i(V);
4
+ const s = a(!0), u = a(r.error), v = a(r.hideFooter), V = r.name ? r.name : (Math.random() + 1).toString(36).substring(7), i = a(V);
5
5
  h(() => r.error, (e) => {
6
- n.value = e;
6
+ u.value = e;
7
7
  }), h(() => r.name, (e) => {
8
- e && (a.value = e);
8
+ e && (i.value = e);
9
9
  });
10
10
  const t = G(K, {
11
11
  registerInputGroup: () => {
@@ -25,28 +25,28 @@ const y = (r, { focus: I, emit: o, withListeners: b = !0 }) => {
25
25
  },
26
26
  isInsideForm: !1
27
27
  }), S = () => {
28
- n.value = "", s.value = !0, o("update:modelValue", "");
28
+ u.value = "", s.value = !0, o("update:modelValue", "");
29
29
  }, F = (e) => {
30
- n.value = e;
30
+ u.value = e;
31
31
  }, m = (e) => {
32
32
  e = e || r.modelValue, s.value = !1;
33
33
  for (let p = 0; p < r.rules.length; p++) {
34
- const u = r.rules[p];
34
+ const n = r.rules[p];
35
35
  let l = !0;
36
- if (typeof u == "function")
37
- l = u(e);
38
- else if (Array.isArray(u) && u.length === 2) {
39
- const { 0: d, 1: g } = u;
36
+ if (typeof n == "function")
37
+ l = n(e);
38
+ else if (Array.isArray(n) && n.length === 2) {
39
+ const { 0: d, 1: g } = n;
40
40
  l = d(e, g);
41
41
  } else {
42
- const d = u.fn, { options: g } = u;
42
+ const d = n.fn, { options: g } = n;
43
43
  l = d(e, g);
44
44
  }
45
45
  if (l !== !0)
46
- return n.value = l, !1;
46
+ return u.value = l, !1;
47
47
  }
48
- return n.value = "", !0;
49
- }, f = i(!1), B = b ? j(() => ({
48
+ return u.value = "", !0;
49
+ }, f = a(!1), B = b ? j(() => ({
50
50
  focus: (e) => {
51
51
  f.value = !0, o("focus", e);
52
52
  },
@@ -68,12 +68,12 @@ const y = (r, { focus: I, emit: o, withListeners: b = !0 }) => {
68
68
  }
69
69
  };
70
70
  return A(() => {
71
- t.isInsideFormGroup ? t.registerInputGroup(a.value, I) : c.registerInput(a.value, I, m, F);
71
+ t.isInsideFormGroup ? t.registerInputGroup(i.value, I) : c.registerInput(i.value, I, m, F);
72
72
  }), O(() => {
73
- t.isInsideFormGroup ? t.unregisterInputGroup(a.value) : c.unregisterInput(a.value);
73
+ t.isInsideFormGroup ? t.unregisterInputGroup(i.value) : c.unregisterInput(i.value);
74
74
  }), {
75
75
  isFirstValidation: s,
76
- errorInternal: n,
76
+ errorInternal: u,
77
77
  hideFooterInternal: v,
78
78
  isFocused: f,
79
79
  isInsideForm: c.isInsideForm,
@@ -103,7 +103,8 @@ y.props = () => ({
103
103
  rules: {
104
104
  type: Array,
105
105
  default: () => []
106
- }
106
+ },
107
+ tooltip: String
107
108
  });
108
109
  export {
109
110
  y as useInputtable