@scalar/components 0.12.75 → 0.13.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 (164) hide show
  1. package/dist/components/ScalarButton/ScalarButton.stories.d.ts +3 -0
  2. package/dist/components/ScalarButton/ScalarButton.stories.d.ts.map +1 -1
  3. package/dist/components/ScalarButton/ScalarButton.vue.d.ts.map +1 -1
  4. package/dist/components/ScalarButton/ScalarButton.vue.js +29 -32
  5. package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts +30 -5
  6. package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts.map +1 -1
  7. package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts +24 -7
  8. package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts.map +1 -1
  9. package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +34 -18
  10. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +16 -82
  11. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
  12. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +23 -22
  13. package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.d.ts +7 -2
  14. package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.d.ts.map +1 -1
  15. package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.js +23 -28
  16. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts +25 -1
  17. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
  18. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +58 -56
  19. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts +5 -11
  20. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts.map +1 -1
  21. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +43 -43
  22. package/dist/components/ScalarCombobox/types.d.ts +4 -2
  23. package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
  24. package/dist/components/ScalarCombobox/types.js +8 -3
  25. package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts +73 -105
  26. package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts.map +1 -1
  27. package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts +40 -22
  28. package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
  29. package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +32 -42
  30. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.d.ts +35 -0
  31. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.d.ts.map +1 -0
  32. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +7 -0
  33. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +37 -0
  34. package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue.d.ts +17 -1
  35. package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue.d.ts.map +1 -1
  36. package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue.js +7 -6
  37. package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue2.js +4 -0
  38. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts +18 -15
  39. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts.map +1 -1
  40. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +2 -2
  41. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +19 -29
  42. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts +32 -0
  43. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts.map +1 -0
  44. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +28 -0
  45. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue2.js +4 -0
  46. package/dist/components/ScalarDropdown/index.d.ts +2 -0
  47. package/dist/components/ScalarDropdown/index.d.ts.map +1 -1
  48. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.spec.d.ts +2 -0
  49. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.spec.d.ts.map +1 -0
  50. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.stories.d.ts +6 -0
  51. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.stories.d.ts.map +1 -0
  52. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.d.ts +18 -0
  53. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.d.ts.map +1 -0
  54. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.js +23 -0
  55. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue2.js +4 -0
  56. package/dist/components/ScalarErrorBoundary/index.d.ts +2 -0
  57. package/dist/components/ScalarErrorBoundary/index.d.ts.map +1 -0
  58. package/dist/components/ScalarFloating/ScalarFloating.stories.d.ts +4 -0
  59. package/dist/components/ScalarFloating/ScalarFloating.stories.d.ts.map +1 -1
  60. package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +5 -4
  61. package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
  62. package/dist/components/ScalarFloating/ScalarFloating.vue.js +32 -29
  63. package/dist/components/ScalarFloating/index.d.ts +1 -1
  64. package/dist/components/ScalarFloating/index.d.ts.map +1 -1
  65. package/dist/components/ScalarFloating/types.d.ts +15 -7
  66. package/dist/components/ScalarFloating/types.d.ts.map +1 -1
  67. package/dist/components/ScalarFloating/useResizeWithTarget.d.ts +3 -0
  68. package/dist/components/ScalarFloating/useResizeWithTarget.d.ts.map +1 -1
  69. package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +1 -0
  70. package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts.map +1 -1
  71. package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts.map +1 -1
  72. package/dist/components/ScalarIcon/ScalarIcon.vue.js +2 -2
  73. package/dist/components/ScalarIcon/ScalarIcon.vue2.js +18 -15
  74. package/dist/components/ScalarIcon/icons/Hide.svg.js +10 -9
  75. package/dist/components/ScalarIcon/icons/Show.svg.js +7 -8
  76. package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +10 -7
  77. package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts.map +1 -1
  78. package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts +1 -1
  79. package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts.map +1 -1
  80. package/dist/components/ScalarIconButton/ScalarIconButton.vue.js +19 -21
  81. package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts +52 -25
  82. package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts.map +1 -1
  83. package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts +41 -22
  84. package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
  85. package/dist/components/ScalarListbox/ScalarListbox.vue.js +46 -85
  86. package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts +8 -0
  87. package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts.map +1 -0
  88. package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js +26 -0
  89. package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue2.js +4 -0
  90. package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts +8 -0
  91. package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts.map +1 -0
  92. package/dist/components/ScalarListbox/ScalarListboxItem.vue.js +53 -0
  93. package/dist/components/ScalarListbox/ScalarListboxItem.vue2.js +4 -0
  94. package/dist/components/ScalarListbox/index.d.ts +3 -1
  95. package/dist/components/ScalarListbox/index.d.ts.map +1 -1
  96. package/dist/components/ScalarListbox/types.d.ts +1 -0
  97. package/dist/components/ScalarListbox/types.d.ts.map +1 -1
  98. package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts +28 -6
  99. package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts.map +1 -1
  100. package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts +2 -2
  101. package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts.map +1 -1
  102. package/dist/components/ScalarLoading/ScalarLoading.vue.js +3 -3
  103. package/dist/components/ScalarLoading/ScalarLoading.vue2.js +29 -30
  104. package/dist/components/ScalarMenu/ScalarMenu.stories.d.ts +133 -108
  105. package/dist/components/ScalarMenu/ScalarMenu.stories.d.ts.map +1 -1
  106. package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts +34 -18
  107. package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts.map +1 -1
  108. package/dist/components/ScalarMenu/ScalarMenu.vue.js +22 -20
  109. package/dist/components/ScalarMenu/ScalarMenuButton.vue.d.ts +2 -2
  110. package/dist/components/ScalarMenu/ScalarMenuButton.vue.d.ts.map +1 -1
  111. package/dist/components/ScalarMenu/ScalarMenuButton.vue.js +25 -17
  112. package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts.map +1 -1
  113. package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +17 -10
  114. package/dist/components/ScalarMenu/ScalarMenuProduct.vue.d.ts +2 -2
  115. package/dist/components/ScalarMenu/ScalarMenuProduct.vue.d.ts.map +1 -1
  116. package/dist/components/ScalarMenu/ScalarMenuProduct.vue.js +22 -16
  117. package/dist/components/ScalarMenu/ScalarMenuProducts.vue.d.ts +1 -1
  118. package/dist/components/ScalarMenu/ScalarMenuProducts.vue.d.ts.map +1 -1
  119. package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +25 -22
  120. package/dist/components/ScalarMenu/ScalarMenuResources.vue.d.ts +1 -1
  121. package/dist/components/ScalarMenu/ScalarMenuResources.vue.js +3 -3
  122. package/dist/components/ScalarMenu/ScalarMenuSection.vue.d.ts +2 -2
  123. package/dist/components/ScalarMenu/ScalarMenuSection.vue.d.ts.map +1 -1
  124. package/dist/components/ScalarMenu/ScalarMenuSection.vue.js +18 -15
  125. package/dist/components/ScalarMenu/ScalarMenuSection.vue2.js +4 -0
  126. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts +1 -1
  127. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts.map +1 -1
  128. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +18 -16
  129. package/dist/components/ScalarModal/ScalarModal.stories.d.ts +3 -3
  130. package/dist/components/ScalarModal/ScalarModal.vue.d.ts +2 -2
  131. package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts +20 -116
  132. package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts.map +1 -1
  133. package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts +4 -11
  134. package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts.map +1 -1
  135. package/dist/components/ScalarPopover/ScalarPopover.vue.js +23 -24
  136. package/dist/components/ScalarPopover/index.d.ts +1 -0
  137. package/dist/components/ScalarPopover/index.d.ts.map +1 -1
  138. package/dist/components/ScalarPopover/types.d.ts +15 -0
  139. package/dist/components/ScalarPopover/types.d.ts.map +1 -0
  140. package/dist/components/ScalarSearchInput/ScalarSearchInput.stories.d.ts +6 -1
  141. package/dist/components/ScalarSearchInput/ScalarSearchInput.stories.d.ts.map +1 -1
  142. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +3 -3
  143. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue2.js +10 -10
  144. package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.d.ts.map +1 -1
  145. package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +31 -35
  146. package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.d.ts.map +1 -1
  147. package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.js +12 -18
  148. package/dist/components/ScalarToggle/ScalarToggle.stories.d.ts +26 -39
  149. package/dist/components/ScalarToggle/ScalarToggle.stories.d.ts.map +1 -1
  150. package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts +3 -5
  151. package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts.map +1 -1
  152. package/dist/components/ScalarToggle/ScalarToggle.vue.js +24 -35
  153. package/dist/hooks/useBindCx.d.ts +51 -0
  154. package/dist/hooks/useBindCx.d.ts.map +1 -0
  155. package/dist/hooks/useBindCx.js +34 -0
  156. package/dist/hooks/useBindCx.stories.d.ts +430 -0
  157. package/dist/hooks/useBindCx.stories.d.ts.map +1 -0
  158. package/dist/hooks/useBindCx.test.d.ts +2 -0
  159. package/dist/hooks/useBindCx.test.d.ts.map +1 -0
  160. package/dist/index.d.ts +3 -1
  161. package/dist/index.d.ts.map +1 -1
  162. package/dist/index.js +80 -68
  163. package/dist/style.css +1 -1
  164. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  import o from "./ScalarDropdownItem.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a4980d5e"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-457c1cd3"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,41 +1,31 @@
1
- import { defineComponent as i, openBlock as s, createBlock as d, unref as t, withCtx as l, createElementVNode as c, normalizeClass as m, renderSlot as p } from "vue";
2
- import { MenuItem as u } from "@headlessui/vue";
3
- import { cva as b, cx as f } from "../../cva.js";
4
- const C = /* @__PURE__ */ i({
1
+ import { defineComponent as a, openBlock as l, createBlock as i, unref as n, withCtx as t, createVNode as s, renderSlot as p } from "vue";
2
+ import { MenuItem as m } from "@headlessui/vue";
3
+ import u from "./ScalarDropdownButton.vue.js";
4
+ const f = {}, B = /* @__PURE__ */ a({
5
+ ...f,
5
6
  __name: "ScalarDropdownItem",
6
7
  props: {
7
8
  disabled: { type: Boolean }
8
9
  },
9
10
  emits: ["click"],
10
- setup(v) {
11
- const r = b({
12
- base: [
13
- // Layout
14
- "h-8 min-w-0 items-center gap-1.5 rounded px-2.5 py-1.5 text-left",
15
- // Text / background style
16
- "truncate text-sm text-c-1",
17
- // Interaction
18
- "cursor-pointer hover:bg-b-2 hover:text-c-1"
19
- ],
20
- variants: {
21
- disabled: { true: "pointer-events-none text-c-3" },
22
- active: { true: "bg-b-2 text-c-1" }
23
- }
24
- });
25
- return (e, o) => (s(), d(t(u), { disabled: e.disabled }, {
26
- default: l(({ active: n }) => [
27
- c("button", {
28
- class: m(["item", t(f)("scalar-dropdown-item", t(r)({ active: n, disabled: e.disabled }))]),
29
- type: "button",
30
- onClick: o[0] || (o[0] = (a) => e.$emit("click", a))
31
- }, [
32
- p(e.$slots, "default", {}, void 0, !0)
33
- ], 2)
11
+ setup(c) {
12
+ return (e, o) => (l(), i(n(m), { disabled: e.disabled }, {
13
+ default: t(({ active: d }) => [
14
+ s(u, {
15
+ active: d,
16
+ disabled: e.disabled,
17
+ onClick: o[0] || (o[0] = (r) => e.$emit("click", r))
18
+ }, {
19
+ default: t(() => [
20
+ p(e.$slots, "default", {}, void 0, !0)
21
+ ]),
22
+ _: 2
23
+ }, 1032, ["active", "disabled"])
34
24
  ]),
35
25
  _: 3
36
26
  }, 8, ["disabled"]));
37
27
  }
38
28
  });
39
29
  export {
40
- C as default
30
+ B as default
41
31
  };
@@ -0,0 +1,32 @@
1
+ import type { Component } from 'vue';
2
+ /**
3
+ * Scalar dropdown menu component
4
+ *
5
+ * Provides a scrollable container for dropdown items
6
+ * This is used internally by the ScalarDropdown component
7
+ *
8
+ * If you're looking to create a dropdown menu with a trigger
9
+ * button you probably want the ScalarDropdown component
10
+ *
11
+ * @example
12
+ * <ScalarDropdownMenu>
13
+ * <ScalarDropdownItem>Item 1</ScalarDropdownItem>
14
+ * <ScalarDropdownItem>Item 2</ScalarDropdownItem>
15
+ * </ScalarDropdownMenu>
16
+ */
17
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
18
+ /** The component to render */
19
+ is?: string | Component;
20
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
21
+ /** The component to render */
22
+ is?: string | Component;
23
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
24
+ default?(_: {}): any;
25
+ }>;
26
+ export default _default;
27
+ type __VLS_WithTemplateSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
32
+ //# sourceMappingURL=ScalarDropdownMenu.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarDropdownMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarDropdown/ScalarDropdownMenu.vue"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC;;;;;;;;;;;;;;GAcG;;IAID,8BAA8B;SACzB,MAAM,GAAG,SAAS;;IADvB,8BAA8B;SACzB,MAAM,GAAG,SAAS;;qBA6DI,GAAG;;AAjEhC,wBAgGC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { defineComponent as t, openBlock as l, createBlock as n, resolveDynamicComponent as r, withCtx as d, createElementVNode as e, renderSlot as a } from "vue";
2
+ const i = { class: "custom-scroll min-h-0 flex-1" }, c = { class: "flex flex-col p-0.75" }, u = {}, p = /* @__PURE__ */ t({
3
+ ...u,
4
+ __name: "ScalarDropdownMenu",
5
+ props: {
6
+ is: {}
7
+ },
8
+ setup(_) {
9
+ return (o, s) => (l(), n(r(o.is ?? "div"), {
10
+ class: "relative flex w-56 rounded border",
11
+ role: "menu",
12
+ tabindex: "0"
13
+ }, {
14
+ default: d(() => [
15
+ e("div", i, [
16
+ e("div", c, [
17
+ a(o.$slots, "default")
18
+ ]),
19
+ s[0] || (s[0] = e("div", { class: "absolute inset-0 -z-1 rounded bg-b-1 shadow-lg brightness-lifted" }, null, -1))
20
+ ])
21
+ ]),
22
+ _: 3
23
+ }));
24
+ }
25
+ });
26
+ export {
27
+ p as default
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarDropdownMenu.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,4 +1,6 @@
1
1
  export { default as ScalarDropdown } from './ScalarDropdown.vue.js';
2
2
  export { default as ScalarDropdownDivider } from './ScalarDropdownDivider.vue.js';
3
+ export { default as ScalarDropdownButton } from './ScalarDropdownButton.vue.js';
3
4
  export { default as ScalarDropdownItem } from './ScalarDropdownItem.vue.js';
5
+ export { default as ScalarDropdownMenu } from './ScalarDropdownMenu.vue.js';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarDropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarDropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ScalarErrorBoundary.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarErrorBoundary.spec.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarErrorBoundary/ScalarErrorBoundary.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Base: Story;
6
+ //# sourceMappingURL=ScalarErrorBoundary.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarErrorBoundary.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarErrorBoundary/ScalarErrorBoundary.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAKrD,QAAA,MAAM,IAAI,EAAE,IAkBgC,CAAA;AAE5C,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA"}
@@ -0,0 +1,18 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: any;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
18
+ //# sourceMappingURL=ScalarErrorBoundary.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarErrorBoundary.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarErrorBoundary/ScalarErrorBoundary.vue"],"names":[],"mappings":"AAsDA,iBAAS,cAAc;WAyDT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { defineComponent as c, ref as a, onErrorCaptured as m, renderSlot as p, openBlock as l, createElementBlock as d, createElementVNode as i, toDisplayString as u, createCommentVNode as _ } from "vue";
2
+ const f = {
3
+ key: 1,
4
+ class: "rounded border bg-b-2 p-3 text-sm"
5
+ }, v = {
6
+ key: 0,
7
+ class: "mt-2 rounded border bg-b-1 p-2 font-code text-c-2"
8
+ }, E = /* @__PURE__ */ c({
9
+ __name: "ScalarErrorBoundary",
10
+ setup(b) {
11
+ const n = a(!1), e = a();
12
+ return m((r, t, o) => (console.error("[ERROR]", r, o), n.value = !0, e.value = r, !1)), (r, t) => {
13
+ var o, s;
14
+ return n.value ? (l(), d("div", f, [
15
+ t[0] || (t[0] = i("div", { class: "p-2" }, "Oops, something went wrong here.", -1)),
16
+ e.value ? (l(), d("div", v, u((o = e.value) == null ? void 0 : o.name) + ": " + u((s = e.value) == null ? void 0 : s.message), 1)) : _("", !0)
17
+ ])) : p(r.$slots, "default", { key: 0 });
18
+ };
19
+ }
20
+ });
21
+ export {
22
+ E as default
23
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarErrorBoundary.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export { default as ScalarErrorBoundary } from './ScalarErrorBoundary.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarErrorBoundary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -3,4 +3,8 @@ declare const meta: Meta;
3
3
  export default meta;
4
4
  type Story = StoryObj<typeof meta>;
5
5
  export declare const Base: Story;
6
+ /**
7
+ * You can override the offset (or other middleware) by passing a custom middleware array
8
+ */
9
+ export declare const CustomOffset: Story;
6
10
  //# sourceMappingURL=ScalarFloating.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarFloating.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloating.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAIrD,QAAA,MAAM,IAAI,EAAE,IA6B2B,CAAA;AAEvC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA"}
1
+ {"version":3,"file":"ScalarFloating.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloating.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAIrD,QAAA,MAAM,IAAI,EAAE,IA6B2B,CAAA;AAEvC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAsB1B,CAAA"}
@@ -1,10 +1,11 @@
1
1
  import { type MiddlewareData } from '@floating-ui/vue';
2
+ import { type Slot } from 'vue';
2
3
  import type { FloatingOptions } from './types';
3
4
  declare function __VLS_template(): {
4
5
  attrs: Partial<{}>;
5
6
  slots: Readonly<{
6
7
  /** The reference element for the element in the #floating slot */
7
- default(): any;
8
+ default(): Slot;
8
9
  /** The floating element */
9
10
  floating(props: {
10
11
  /** The width of the reference element if `resize` is true and placement is on the y axis */
@@ -13,10 +14,10 @@ declare function __VLS_template(): {
13
14
  height?: string;
14
15
  /** The middleware data return by Floating UI */
15
16
  data?: MiddlewareData;
16
- }): any;
17
+ }): Slot;
17
18
  }> & {
18
19
  /** The reference element for the element in the #floating slot */
19
- default(): any;
20
+ default(): Slot;
20
21
  /** The floating element */
21
22
  floating(props: {
22
23
  /** The width of the reference element if `resize` is true and placement is on the y axis */
@@ -25,7 +26,7 @@ declare function __VLS_template(): {
25
26
  height?: string;
26
27
  /** The middleware data return by Floating UI */
27
28
  data?: MiddlewareData;
28
- }): any;
29
+ }): Slot;
29
30
  };
30
31
  refs: {
31
32
  wrapperRef: HTMLDivElement;
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarFloating.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloating.vue"],"names":[],"mappings":"AA4GA,OAAO,EACL,KAAK,cAAc,EAOpB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AA4E9C,iBAAS,cAAc;WAuDT,OAAO,IAA6B;;QA1HhD,kEAAkE;mBACvD,GAAG;QACd,2BAA2B;wBACX;YACd,4FAA4F;YAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,6FAA6F;YAC7F,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,gDAAgD;YAChD,IAAI,CAAC,EAAE,cAAc,CAAA;SACtB,GAAG,GAAG;;QAVP,kEAAkE;mBACvD,GAAG;QACd,2BAA2B;wBACX;YACd,4FAA4F;YAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,6FAA6F;YAC7F,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,gDAAgD;YAChD,IAAI,CAAC,EAAE,cAAc,CAAA;SACtB,GAAG,GAAG;;;;;;;EAqHR;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0SAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarFloating.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloating.vue"],"names":[],"mappings":"AAsHA,OAAO,EACL,KAAK,cAAc,EAOpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAY,KAAK,IAAI,EAAiB,MAAM,KAAK,CAAA;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAsF9C,iBAAS,cAAc;WAuDT,OAAO,IAA6B;;QApIhD,kEAAkE;mBACvD,IAAI;QACf,2BAA2B;wBACX;YACd,4FAA4F;YAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,6FAA6F;YAC7F,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,gDAAgD;YAChD,IAAI,CAAC,EAAE,cAAc,CAAA;SACtB,GAAG,IAAI;;QAVR,kEAAkE;mBACvD,IAAI;QACf,2BAA2B;wBACX;YACd,4FAA4F;YAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,6FAA6F;YAC7F,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,gDAAgD;YAChD,IAAI,CAAC,EAAE,cAAc,CAAA;SACtB,GAAG,IAAI;;;;;;;EA+HT;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0SAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,38 +1,41 @@
1
- import { defineComponent as z, ref as p, computed as a, openBlock as d, createElementBlock as R, Fragment as b, createElementVNode as r, normalizeClass as S, renderSlot as m, createBlock as k, Teleport as B, normalizeStyle as $, unref as f, createCommentVNode as x } from "vue";
1
+ import { defineComponent as z, ref as d, computed as a, openBlock as f, createElementBlock as S, Fragment as b, createElementVNode as r, normalizeClass as $, renderSlot as p, createBlock as k, Teleport as B, normalizeStyle as R, unref as m, createCommentVNode as E } from "vue";
2
2
  import { getSideAxis as c } from "@floating-ui/utils";
3
- import { useFloating as C, autoUpdate as E, offset as F, flip as M, shift as O, size as W } from "@floating-ui/vue";
4
- import { useResizeWithTarget as _ } from "./useResizeWithTarget.js";
5
- const A = { class: "scalar-app" }, j = /* @__PURE__ */ z({
3
+ import { useFloating as F, autoUpdate as M, offset as T, flip as x, shift as C, size as H } from "@floating-ui/vue";
4
+ import { useResizeWithTarget as W } from "./useResizeWithTarget.js";
5
+ const _ = { class: "scalar-app" }, D = /* @__PURE__ */ z({
6
6
  inheritAttrs: !1,
7
7
  __name: "ScalarFloating",
8
8
  props: {
9
9
  placement: {},
10
10
  resize: { type: Boolean },
11
- targetRef: {},
11
+ target: {},
12
12
  middleware: {},
13
- isOpen: { type: Boolean },
14
13
  teleport: { type: [Boolean, String] }
15
14
  },
16
15
  setup(g) {
17
- const t = g, i = p(null), l = p(null), n = a(
18
- () => {
19
- var e, o;
20
- return (t.targetRef || ((o = (e = l.value) == null ? void 0 : e.children) == null ? void 0 : o[0]) || l.value) ?? void 0;
21
- }
22
- ), s = _(n, {
16
+ const t = g, n = d(null), l = d(null), i = a(() => {
17
+ var e;
18
+ if (typeof t.target == "string") {
19
+ const o = document.getElementById(t.target);
20
+ if (o) return o;
21
+ console.warn(`ScalarFloating: Target with id="${t.target}" not found`);
22
+ } else if (t.target instanceof HTMLElement) return t.target;
23
+ if (l.value)
24
+ return ((e = l.value.children) == null ? void 0 : e[0]) || l.value;
25
+ }), s = W(i, {
23
26
  enabled: a(() => t.resize)
24
27
  }), u = a(
25
28
  () => c(t.placement || "bottom") === "y" ? s.width.value : void 0
26
29
  ), h = a(
27
30
  () => c(t.placement || "bottom") === "x" ? s.height.value : void 0
28
- ), { floatingStyles: y, middlewareData: v } = C(n, i, {
31
+ ), { floatingStyles: y, middlewareData: v } = F(i, n, {
29
32
  placement: a(() => t.placement),
30
- whileElementsMounted: E,
33
+ whileElementsMounted: M,
31
34
  middleware: a(() => [
32
- F(5),
33
- M(),
34
- O(),
35
- W({
35
+ T(5),
36
+ x(),
37
+ C(),
38
+ H({
36
39
  apply({ availableWidth: e, availableHeight: o, elements: w }) {
37
40
  Object.assign(w.floating.style, {
38
41
  maxWidth: `${Math.max(0, e) - 25}px`,
@@ -43,37 +46,37 @@ const A = { class: "scalar-app" }, j = /* @__PURE__ */ z({
43
46
  ...t.middleware ?? []
44
47
  ])
45
48
  });
46
- return (e, o) => (d(), R(b, null, [
49
+ return (e, o) => (f(), S(b, null, [
47
50
  r("div", {
48
51
  ref_key: "wrapperRef",
49
52
  ref: l,
50
- class: S({ contents: !!e.$slots.default })
53
+ class: $({ contents: !!e.$slots.default })
51
54
  }, [
52
- m(e.$slots, "default")
55
+ p(e.$slots, "default")
53
56
  ], 2),
54
- e.isOpen ? (d(), k(B, {
57
+ e.$slots.floating ? (f(), k(B, {
55
58
  key: 0,
56
59
  disabled: !e.teleport,
57
60
  to: typeof e.teleport == "string" ? e.teleport : "body"
58
61
  }, [
59
- r("div", A, [
62
+ r("div", _, [
60
63
  r("div", {
61
64
  ref_key: "floatingRef",
62
- ref: i,
65
+ ref: n,
63
66
  class: "relative z-overlay",
64
- style: $(f(y))
67
+ style: R(m(y))
65
68
  }, [
66
- m(e.$slots, "floating", {
67
- data: f(v),
69
+ p(e.$slots, "floating", {
70
+ data: m(v),
68
71
  height: h.value,
69
72
  width: u.value
70
73
  })
71
74
  ], 4)
72
75
  ])
73
- ], 8, ["disabled", "to"])) : x("", !0)
76
+ ], 8, ["disabled", "to"])) : E("", !0)
74
77
  ], 64));
75
78
  }
76
79
  });
77
80
  export {
78
- j as default
81
+ D as default
79
82
  };
@@ -1,3 +1,3 @@
1
1
  export { default as ScalarFloating } from './ScalarFloating.vue.js';
2
- export type { FloatingOptions } from './types';
2
+ export type { FloatingOptions as ScalarFloatingOptions } from './types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEhE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEhE,YAAY,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,SAAS,CAAA"}
@@ -1,8 +1,11 @@
1
1
  import type { Middleware, Placement } from '@floating-ui/vue';
2
+ /** The props for the ScalarFloating component */
2
3
  export type FloatingOptions = {
3
4
  /**
4
5
  * Where to place the floating element relative to its reference element.
5
6
  * @default 'bottom'
7
+ *
8
+ * @see https://floating-ui.com/docs/computePosition#placement
6
9
  */
7
10
  placement?: Placement;
8
11
  /**
@@ -11,20 +14,25 @@ export type FloatingOptions = {
11
14
  */
12
15
  resize?: boolean;
13
16
  /**
14
- * Override the targetRef, useful if we are not passing a button
17
+ * Override the target, useful if we are not passing a button
15
18
  * into the slot but is controlled from an external button
19
+ *
20
+ * Can be a string id or a reference to an element
16
21
  */
17
- targetRef?: HTMLElement;
22
+ target?: string | HTMLElement;
18
23
  /**
19
24
  * Floating UI Middleware to be passed to Floating UI
25
+ *
26
+ * Overrides the default middleware
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * // change the offset to 10px
31
+ * middleware: [offset(10)]
32
+ * ```
20
33
  * @see https://floating-ui.com/docs/computePosition#middleware
21
34
  */
22
35
  middleware?: Middleware[];
23
- /**
24
- * Whether the floating element is open or not.
25
- * @default false
26
- */
27
- isOpen?: boolean;
28
36
  /**
29
37
  * Whether to teleport the floating element.
30
38
  * Can be an `id` to teleport to or `true` to teleport to the `<body>`.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAG7D,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE7D,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAC7B;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
@@ -2,6 +2,9 @@ import { type MaybeRefOrGetter } from 'vue';
2
2
  type ResizeOptions = {
3
3
  enabled?: MaybeRefOrGetter<boolean>;
4
4
  };
5
+ /**
6
+ * Resize a floating element to match a target element
7
+ */
5
8
  export declare function useResizeWithTarget(target: MaybeRefOrGetter<Element | undefined>, opts?: ResizeOptions): {
6
9
  width: import("vue").ComputedRef<string | undefined>;
7
10
  height: import("vue").ComputedRef<string | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"useResizeWithTarget.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/useResizeWithTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;AAE1E,KAAK,aAAa,GAAG;IACnB,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CACpC,CAAA;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,EAC7C,IAAI,GAAE,aAAsC;;;EA+B7C"}
1
+ {"version":3,"file":"useResizeWithTarget.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/useResizeWithTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;AAE1E,KAAK,aAAa,GAAG;IACnB,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CACpC,CAAA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,EAC7C,IAAI,GAAE,aAAsC;;;EA+B7C"}
@@ -94,6 +94,7 @@ declare const meta: {
94
94
  export default meta;
95
95
  type Story = StoryObj<typeof meta>;
96
96
  export declare const Base: Story;
97
+ export declare const CustomClasses: Story;
97
98
  export declare const AllSizes: Story;
98
99
  export declare const AllIcons: StoryObj;
99
100
  //# sourceMappingURL=ScalarIcon.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarIcon.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarIcon/ScalarIcon.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAOrD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ByB,CAAA;AAEnC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAElB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,QAQtB,CAAA"}
1
+ {"version":3,"file":"ScalarIcon.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarIcon/ScalarIcon.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAMrD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ByB,CAAA;AAEnC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAElB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,QAQtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarIcon.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarIcon/ScalarIcon.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAA;AAIvC,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAoB,MAAM,SAAS,CAAA;AAIhE;;GAEG;AAEH,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAA;AAElD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAGF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgBb,CAAA;;AAqFF,wBAOG"}
1
+ {"version":3,"file":"ScalarIcon.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarIcon/ScalarIcon.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAA;AAKvC,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAoB,MAAM,SAAS,CAAA;AAIhE;;GAEG;AAEH,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAA;AAElD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAMF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgBb,CAAA;;AAyFF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ScalarIcon.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-bcfed797"]]);
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f4f53d32"]]);
5
5
  export {
6
- f as default
6
+ c as default
7
7
  };
@@ -1,7 +1,9 @@
1
- import { defineComponent as c, useCssVars as u, computed as s, openBlock as p, createBlock as m, resolveDynamicComponent as f, mergeProps as z, unref as i } from "vue";
2
- import { cva as d, cx as g } from "../../cva.js";
3
- import { getIcon as v, getLogo as x } from "./utils/index.js";
4
- const C = /* @__PURE__ */ c({
1
+ import { defineComponent as u, useCssVars as p, computed as s, openBlock as m, createBlock as f, resolveDynamicComponent as z, normalizeProps as d, guardReactiveProps as g, unref as i } from "vue";
2
+ import { cva as v } from "../../cva.js";
3
+ import { useBindCx as x } from "../../hooks/useBindCx.js";
4
+ import { getIcon as _, getLogo as b } from "./utils/index.js";
5
+ const y = /* @__PURE__ */ u({
6
+ inheritAttrs: !1,
5
7
  __name: "ScalarIcon",
6
8
  props: {
7
9
  icon: {},
@@ -11,10 +13,10 @@ const C = /* @__PURE__ */ c({
11
13
  label: {}
12
14
  },
13
15
  setup(r) {
14
- u((o) => ({
15
- "1fd08b42": n.value
16
+ p((o) => ({
17
+ ce5c5c8a: a.value
16
18
  }));
17
- const e = r, l = d({
19
+ const e = r, { cx: t } = x(), n = v({
18
20
  variants: {
19
21
  size: {
20
22
  xs: "size-3",
@@ -30,20 +32,21 @@ const C = /* @__PURE__ */ c({
30
32
  defaultVariants: {
31
33
  size: "full"
32
34
  }
33
- }), n = s(() => e.thickness ?? "2"), t = s(
35
+ }), a = s(() => e.thickness ?? "2"), l = s(
34
36
  () => e.label ? { ariaLabel: e.label } : {
35
37
  ariaHidden: !0,
36
38
  role: "presentation"
37
39
  }
38
- ), a = s(() => {
39
- if (e.icon) return v(e.icon);
40
- if (e.logo) return x(e.logo);
40
+ ), c = s(() => {
41
+ if (e.icon) return _(e.icon);
42
+ if (e.logo) return b(e.logo);
41
43
  });
42
- return (o, b) => (p(), m(f(a.value), z({
43
- class: i(g)("scalar-icon", i(l)({ size: o.size }))
44
- }, t.value), null, 16, ["class"]));
44
+ return (o, k) => (m(), f(z(c.value), d(g({
45
+ ...i(t)("scalar-icon", i(n)({ size: o.size })),
46
+ ...l.value
47
+ })), null, 16));
45
48
  }
46
49
  });
47
50
  export {
48
- C as default
51
+ y as default
49
52
  };
@@ -1,16 +1,17 @@
1
- import { openBlock as n, createElementBlock as t, createElementVNode as o } from "vue";
2
- const r = {
1
+ import { openBlock as o, createElementBlock as n, createElementVNode as r } from "vue";
2
+ const t = {
3
3
  xmlns: "http://www.w3.org/2000/svg",
4
4
  fill: "none",
5
- stroke: "currentColor",
6
- "stroke-linecap": "round",
7
- "stroke-linejoin": "round",
8
5
  viewBox: "0 0 24 24"
9
6
  };
10
- function l(a, e) {
11
- return n(), t("svg", r, e[0] || (e[0] = [
12
- o("path", { d: "M2.78 21 21.53 3M9 19.05a9.9 9.9 0 0 0 3 .45c4.1.07 8.26-2.81 10.82-5.64a1.65 1.65 0 0 0 0-2.22 20 20 0 0 0-3.07-2.76m-2.66-1.61A11.3 11.3 0 0 0 12 6c-4-.07-8.2 2.75-10.82 5.64a1.65 1.65 0 0 0 0 2.22 20 20 0 0 0 4.93 4M9 15.07a3.85 3.85 0 0 1 5.5-5.28" }, null, -1),
13
- o("path", { d: "M15.75 12.75A3.75 3.75 0 0 1 12 16.5" }, null, -1)
7
+ function l(s, e) {
8
+ return o(), n("svg", t, e[0] || (e[0] = [
9
+ r("path", {
10
+ stroke: "currentColor",
11
+ "stroke-linecap": "round",
12
+ "stroke-linejoin": "round",
13
+ d: "M9.88 14.12a3 3 0 1 1 4.24-4.24m-3.39 9.04q.632.079 1.27.08c7 0 10-7 10-7a13.2 13.2 0 0 0-1.67-2.68M6.61 17.39A13.5 13.5 0 0 1 2 12s3-7 10-7a9.74 9.74 0 0 1 5.39 1.61M2 22 22 2"
14
+ }, null, -1)
14
15
  ]));
15
16
  }
16
17
  const d = { render: l };