@scalar/components 0.12.76 → 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.
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts +3 -0
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts.map +1 -1
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarButton/ScalarButton.vue.js +29 -32
- package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts +30 -5
- package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts +24 -7
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +34 -18
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +16 -82
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +23 -22
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.d.ts +7 -2
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.js +23 -28
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts +25 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +58 -56
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts +5 -11
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +43 -43
- package/dist/components/ScalarCombobox/types.d.ts +4 -2
- package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/types.js +8 -3
- package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts +73 -105
- package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts +40 -22
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +32 -42
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.d.ts +35 -0
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.d.ts.map +1 -0
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +7 -0
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +37 -0
- package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue.d.ts +17 -1
- package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue.js +7 -6
- package/dist/components/ScalarDropdown/ScalarDropdownDivider.vue2.js +4 -0
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts +18 -15
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +2 -2
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +19 -29
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts +32 -0
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts.map +1 -0
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +28 -0
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue2.js +4 -0
- package/dist/components/ScalarDropdown/index.d.ts +2 -0
- package/dist/components/ScalarDropdown/index.d.ts.map +1 -1
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.spec.d.ts +2 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.spec.d.ts.map +1 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.stories.d.ts +6 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.stories.d.ts.map +1 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.d.ts +18 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.d.ts.map +1 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.js +23 -0
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue2.js +4 -0
- package/dist/components/ScalarErrorBoundary/index.d.ts +2 -0
- package/dist/components/ScalarErrorBoundary/index.d.ts.map +1 -0
- package/dist/components/ScalarFloating/ScalarFloating.stories.d.ts +4 -0
- package/dist/components/ScalarFloating/ScalarFloating.stories.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +5 -4
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +32 -29
- package/dist/components/ScalarFloating/index.d.ts +1 -1
- package/dist/components/ScalarFloating/index.d.ts.map +1 -1
- package/dist/components/ScalarFloating/types.d.ts +15 -7
- package/dist/components/ScalarFloating/types.d.ts.map +1 -1
- package/dist/components/ScalarFloating/useResizeWithTarget.d.ts +3 -0
- package/dist/components/ScalarFloating/useResizeWithTarget.d.ts.map +1 -1
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +1 -0
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts.map +1 -1
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts.map +1 -1
- package/dist/components/ScalarIcon/ScalarIcon.vue.js +2 -2
- package/dist/components/ScalarIcon/ScalarIcon.vue2.js +18 -15
- package/dist/components/ScalarIcon/icons/Hide.svg.js +10 -9
- package/dist/components/ScalarIcon/icons/Show.svg.js +7 -8
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +10 -7
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts.map +1 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts +1 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.js +19 -21
- package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts +52 -25
- package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts +41 -22
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +46 -85
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts +8 -0
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts.map +1 -0
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js +26 -0
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue2.js +4 -0
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts +8 -0
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts.map +1 -0
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.js +53 -0
- package/dist/components/ScalarListbox/ScalarListboxItem.vue2.js +4 -0
- package/dist/components/ScalarListbox/index.d.ts +3 -1
- package/dist/components/ScalarListbox/index.d.ts.map +1 -1
- package/dist/components/ScalarListbox/types.d.ts +1 -0
- package/dist/components/ScalarListbox/types.d.ts.map +1 -1
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts +28 -6
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts.map +1 -1
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts +2 -2
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts.map +1 -1
- package/dist/components/ScalarLoading/ScalarLoading.vue.js +3 -3
- package/dist/components/ScalarLoading/ScalarLoading.vue2.js +29 -30
- package/dist/components/ScalarMenu/ScalarMenu.stories.d.ts +133 -108
- package/dist/components/ScalarMenu/ScalarMenu.stories.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts +34 -18
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.js +22 -20
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.d.ts +2 -2
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.js +25 -17
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +17 -10
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.d.ts +2 -2
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.js +22 -16
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.d.ts +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +25 -22
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.d.ts +1 -1
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.js +3 -3
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.d.ts +2 -2
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.js +18 -15
- package/dist/components/ScalarMenu/ScalarMenuSection.vue2.js +4 -0
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +18 -16
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts +3 -3
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +2 -2
- package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts +20 -116
- package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts +4 -11
- package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.js +23 -24
- package/dist/components/ScalarPopover/index.d.ts +1 -0
- package/dist/components/ScalarPopover/index.d.ts.map +1 -1
- package/dist/components/ScalarPopover/types.d.ts +15 -0
- package/dist/components/ScalarPopover/types.d.ts.map +1 -0
- package/dist/components/ScalarSearchInput/ScalarSearchInput.stories.d.ts +6 -1
- package/dist/components/ScalarSearchInput/ScalarSearchInput.stories.d.ts.map +1 -1
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +3 -3
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue2.js +10 -10
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +31 -35
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.js +12 -18
- package/dist/components/ScalarToggle/ScalarToggle.stories.d.ts +26 -39
- package/dist/components/ScalarToggle/ScalarToggle.stories.d.ts.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts +3 -5
- package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.js +24 -35
- package/dist/hooks/useBindCx.d.ts +51 -0
- package/dist/hooks/useBindCx.d.ts.map +1 -0
- package/dist/hooks/useBindCx.js +34 -0
- package/dist/hooks/useBindCx.stories.d.ts +430 -0
- package/dist/hooks/useBindCx.stories.d.ts.map +1 -0
- package/dist/hooks/useBindCx.test.d.ts +2 -0
- package/dist/hooks/useBindCx.test.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -68
- package/dist/style.css +1 -1
- 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
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-457c1cd3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { MenuItem as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
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(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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
|
+
};
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarErrorBoundary.spec.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarErrorBoundary/ScalarErrorBoundary.spec.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
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":"
|
|
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():
|
|
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
|
-
}):
|
|
17
|
+
}): Slot;
|
|
17
18
|
}> & {
|
|
18
19
|
/** The reference element for the element in the #floating slot */
|
|
19
|
-
default():
|
|
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
|
-
}):
|
|
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":"
|
|
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
|
|
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
|
|
4
|
-
import { useResizeWithTarget as
|
|
5
|
-
const
|
|
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
|
-
|
|
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,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 } =
|
|
31
|
+
), { floatingStyles: y, middlewareData: v } = F(i, n, {
|
|
29
32
|
placement: a(() => t.placement),
|
|
30
|
-
whileElementsMounted:
|
|
33
|
+
whileElementsMounted: M,
|
|
31
34
|
middleware: a(() => [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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) => (
|
|
49
|
+
return (e, o) => (f(), S(b, null, [
|
|
47
50
|
r("div", {
|
|
48
51
|
ref_key: "wrapperRef",
|
|
49
52
|
ref: l,
|
|
50
|
-
class:
|
|
53
|
+
class: $({ contents: !!e.$slots.default })
|
|
51
54
|
}, [
|
|
52
|
-
|
|
55
|
+
p(e.$slots, "default")
|
|
53
56
|
], 2),
|
|
54
|
-
e.
|
|
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",
|
|
62
|
+
r("div", _, [
|
|
60
63
|
r("div", {
|
|
61
64
|
ref_key: "floatingRef",
|
|
62
|
-
ref:
|
|
65
|
+
ref: n,
|
|
63
66
|
class: "relative z-overlay",
|
|
64
|
-
style:
|
|
67
|
+
style: R(m(y))
|
|
65
68
|
}, [
|
|
66
|
-
|
|
67
|
-
data:
|
|
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"])) :
|
|
76
|
+
], 8, ["disabled", "to"])) : E("", !0)
|
|
74
77
|
], 64));
|
|
75
78
|
}
|
|
76
79
|
});
|
|
77
80
|
export {
|
|
78
|
-
|
|
81
|
+
D as default
|
|
79
82
|
};
|
|
@@ -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
|
|
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
|
-
|
|
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;
|
|
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;
|
|
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":"
|
|
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
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f4f53d32"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cva as
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
+
p((o) => ({
|
|
17
|
+
ce5c5c8a: a.value
|
|
16
18
|
}));
|
|
17
|
-
const e = r,
|
|
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
|
-
}),
|
|
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
|
-
),
|
|
39
|
-
if (e.icon) return
|
|
40
|
-
if (e.logo) return
|
|
40
|
+
), c = s(() => {
|
|
41
|
+
if (e.icon) return _(e.icon);
|
|
42
|
+
if (e.logo) return b(e.logo);
|
|
41
43
|
});
|
|
42
|
-
return (o,
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
51
|
+
y as default
|
|
49
52
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
const
|
|
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(
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
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 };
|