@scalar/components 0.13.16 → 0.13.18
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/README.md +87 -22
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts +1 -0
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts.map +1 -1
- package/dist/components/ScalarButton/variants.js +2 -2
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +1 -0
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +1 -0
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +1 -0
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +1 -0
- package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts +16 -16
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts +4 -5
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +28 -31
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts +10 -2
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +18 -13
- package/dist/components/ScalarFloating/ScalarFloating.stories.d.ts +0 -4
- package/dist/components/ScalarFloating/ScalarFloating.stories.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +2 -2
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +38 -40
- package/dist/components/ScalarFloating/ScalarFloatingBackdrop.vue.d.ts +28 -0
- package/dist/components/ScalarFloating/ScalarFloatingBackdrop.vue.d.ts.map +1 -0
- package/dist/components/ScalarFloating/ScalarFloatingBackdrop.vue.js +18 -0
- package/dist/components/ScalarFloating/ScalarFloatingBackdrop.vue2.js +4 -0
- package/dist/components/ScalarFloating/index.d.ts +1 -0
- package/dist/components/ScalarFloating/index.d.ts.map +1 -1
- package/dist/components/ScalarFloating/types.d.ts +8 -1
- package/dist/components/ScalarFloating/types.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts +2 -2
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts +2 -3
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +32 -37
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js +12 -11
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.js +8 -9
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.js +4 -4
- package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts +1 -0
- package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.js +26 -22
- package/dist/components/ScalarPopover/types.d.ts +7 -3
- package/dist/components/ScalarPopover/types.d.ts.map +1 -1
- package/dist/index.js +50 -48
- package/dist/style.css +1 -1
- package/package.json +5 -5
|
@@ -1,65 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as w, ref as d, computed as a, openBlock as s, createElementBlock as z, Fragment as S, createElementVNode as m, normalizeClass as $, renderSlot as u, createBlock as k, unref as o, withCtx as B, normalizeStyle as R, createCommentVNode as b } from "vue";
|
|
2
2
|
import { getSideAxis as g } from "@floating-ui/utils";
|
|
3
|
-
import { useFloating as x, autoUpdate as
|
|
3
|
+
import { useFloating as x, autoUpdate as E, offset as C, flip as F, shift as M, size as H } from "@floating-ui/vue";
|
|
4
4
|
import { useResizeWithTarget as T } from "./useResizeWithTarget.js";
|
|
5
5
|
import W from "../ScalarTeleport/ScalarTeleport.vue.js";
|
|
6
|
-
const I = /* @__PURE__ */
|
|
6
|
+
const I = /* @__PURE__ */ w({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarFloating",
|
|
9
9
|
props: {
|
|
10
|
-
placement: {},
|
|
11
|
-
|
|
10
|
+
placement: { default: "bottom" },
|
|
11
|
+
offset: { default: 5 },
|
|
12
|
+
resize: { type: Boolean, default: !1 },
|
|
12
13
|
target: {},
|
|
13
|
-
middleware: {},
|
|
14
|
+
middleware: { default: () => [] },
|
|
14
15
|
teleport: { type: [Boolean, String] }
|
|
15
16
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
17
|
+
setup(t) {
|
|
18
|
+
const i = d(null), n = d(null), r = a(() => {
|
|
18
19
|
var e;
|
|
19
|
-
if (typeof window < "u") {
|
|
20
|
+
if (typeof window < "u" && n.value) {
|
|
20
21
|
if (typeof t.target == "string") {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
console.warn(
|
|
24
|
-
`ScalarFloating: Target with id="${t.target}" not found`
|
|
25
|
-
);
|
|
22
|
+
const l = document.getElementById(t.target);
|
|
23
|
+
if (l) return l;
|
|
24
|
+
console.warn(`ScalarFloating: Target with id="${t.target}" not found`);
|
|
26
25
|
} else if (t.target instanceof HTMLElement) return t.target;
|
|
26
|
+
return ((e = n.value.children) == null ? void 0 : e[0]) || n.value;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
return ((e = r.value.children) == null ? void 0 : e[0]) || r.value;
|
|
30
|
-
}), s = T(i, {
|
|
28
|
+
}), f = T(r, {
|
|
31
29
|
enabled: a(() => t.resize)
|
|
32
|
-
}),
|
|
33
|
-
() => g(t.placement
|
|
30
|
+
}), c = a(
|
|
31
|
+
() => g(t.placement) === "y" ? f.width.value : void 0
|
|
34
32
|
), h = a(
|
|
35
|
-
() => g(t.placement
|
|
36
|
-
), { floatingStyles:
|
|
33
|
+
() => g(t.placement) === "x" ? f.height.value : void 0
|
|
34
|
+
), { floatingStyles: p, middlewareData: y } = x(r, i, {
|
|
37
35
|
placement: a(() => t.placement),
|
|
38
|
-
whileElementsMounted:
|
|
36
|
+
whileElementsMounted: E,
|
|
39
37
|
middleware: a(() => [
|
|
40
|
-
|
|
38
|
+
C(t.offset),
|
|
39
|
+
F(),
|
|
41
40
|
M(),
|
|
42
|
-
_(),
|
|
43
41
|
H({
|
|
44
|
-
apply({ availableWidth: e, availableHeight:
|
|
45
|
-
Object.assign(
|
|
42
|
+
apply({ availableWidth: e, availableHeight: l, elements: v }) {
|
|
43
|
+
Object.assign(v.floating.style, {
|
|
46
44
|
maxWidth: `${Math.max(0, e) - 25}px`,
|
|
47
|
-
maxHeight: `${Math.max(0,
|
|
45
|
+
maxHeight: `${Math.max(0, l) - 25}px`
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
}),
|
|
51
|
-
...t.middleware
|
|
49
|
+
...t.middleware
|
|
52
50
|
])
|
|
53
51
|
});
|
|
54
|
-
return (e,
|
|
52
|
+
return (e, l) => (s(), z(S, null, [
|
|
55
53
|
m("div", {
|
|
56
54
|
ref_key: "wrapperRef",
|
|
57
|
-
ref:
|
|
58
|
-
class:
|
|
55
|
+
ref: n,
|
|
56
|
+
class: $({ contents: !!e.$slots.default })
|
|
59
57
|
}, [
|
|
60
|
-
|
|
58
|
+
u(e.$slots, "default")
|
|
61
59
|
], 2),
|
|
62
|
-
e.$slots.floating ? (
|
|
60
|
+
e.$slots.floating ? (s(), k(o(W), {
|
|
63
61
|
key: 0,
|
|
64
62
|
disabled: !e.teleport,
|
|
65
63
|
to: typeof e.teleport == "string" ? e.teleport : void 0
|
|
@@ -67,19 +65,19 @@ const I = /* @__PURE__ */ z({
|
|
|
67
65
|
default: B(() => [
|
|
68
66
|
m("div", {
|
|
69
67
|
ref_key: "floatingRef",
|
|
70
|
-
ref:
|
|
71
|
-
class: "relative z-
|
|
72
|
-
style: R(
|
|
68
|
+
ref: i,
|
|
69
|
+
class: "relative z-context",
|
|
70
|
+
style: R(o(p))
|
|
73
71
|
}, [
|
|
74
|
-
|
|
75
|
-
data:
|
|
72
|
+
u(e.$slots, "floating", {
|
|
73
|
+
data: o(y),
|
|
76
74
|
height: h.value,
|
|
77
|
-
width:
|
|
75
|
+
width: c.value
|
|
78
76
|
})
|
|
79
77
|
], 4)
|
|
80
78
|
]),
|
|
81
79
|
_: 3
|
|
82
|
-
}, 8, ["disabled", "to"])) :
|
|
80
|
+
}, 8, ["disabled", "to"])) : b("", !0)
|
|
83
81
|
], 64));
|
|
84
82
|
}
|
|
85
83
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scalar floating backdrop component
|
|
3
|
+
*
|
|
4
|
+
* Provides an absolutely positioned backdrop for the floating element
|
|
5
|
+
* This is used internally by a number of the Scalar floating components
|
|
6
|
+
* (e.g. Dropdown, Popover, Listbox)
|
|
7
|
+
*
|
|
8
|
+
* You can use this component directly if you need to customize the backdrop
|
|
9
|
+
* for a floating component
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <ScalarDropdown>
|
|
13
|
+
* <!-- Menu stuff -->
|
|
14
|
+
* <template #backdrop>
|
|
15
|
+
* <ScalarFloatingBackdrop />
|
|
16
|
+
* </template>
|
|
17
|
+
* </ScalarDropdown>
|
|
18
|
+
*/
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
20
|
+
default?(_: {}): any;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ScalarFloatingBackdrop.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarFloatingBackdrop.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloatingBackdrop.vue"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;;;;GAiBG;;qBAuC0B,GAAG;;AAtChC,wBAoEC;AAKD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent as o, openBlock as r, createElementBlock as n, normalizeProps as s, guardReactiveProps as a, unref as l, renderSlot as i } from "vue";
|
|
2
|
+
import { useBindCx as c } from "../../hooks/useBindCx.js";
|
|
3
|
+
const d = {}, m = /* @__PURE__ */ o({
|
|
4
|
+
...d,
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "ScalarFloatingBackdrop",
|
|
7
|
+
setup(p) {
|
|
8
|
+
const { cx: e } = c();
|
|
9
|
+
return (t, u) => (r(), n("div", s(a(
|
|
10
|
+
l(e)("absolute inset-0 -z-1 rounded bg-b-1 shadow-lg brightness-lifted")
|
|
11
|
+
)), [
|
|
12
|
+
i(t.$slots, "default")
|
|
13
|
+
], 16));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
|
@@ -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;
|
|
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;AAChE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAEhF,YAAY,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Middleware, Placement } from '@floating-ui/vue';
|
|
1
|
+
import type { Middleware, OffsetOptions, Placement } from '@floating-ui/vue';
|
|
2
2
|
/** The props for the ScalarFloating component */
|
|
3
3
|
export type FloatingOptions = {
|
|
4
4
|
/**
|
|
@@ -8,6 +8,13 @@ export type FloatingOptions = {
|
|
|
8
8
|
* @see https://floating-ui.com/docs/computePosition#placement
|
|
9
9
|
*/
|
|
10
10
|
placement?: Placement;
|
|
11
|
+
/**
|
|
12
|
+
* The offset of the floating element relative to its reference element.
|
|
13
|
+
* @default 5 (5px)
|
|
14
|
+
*
|
|
15
|
+
* @see https://floating-ui.com/docs/offset
|
|
16
|
+
*/
|
|
17
|
+
offset?: OffsetOptions;
|
|
11
18
|
/**
|
|
12
19
|
* Whether or not track the reference element's width
|
|
13
20
|
* If enabled it will set `width` slot prop of the floating slot
|
|
@@ -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,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAI5E,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;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;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Slot } from 'vue';
|
|
2
1
|
import { type ScalarFloatingOptions } from '../ScalarFloating';
|
|
3
2
|
import type { Option } from './types';
|
|
4
3
|
type SingleSelectListboxProps = {
|
|
@@ -16,13 +15,13 @@ declare function __VLS_template(): {
|
|
|
16
15
|
default(props: {
|
|
17
16
|
/** Whether or not the listbox is open */
|
|
18
17
|
open: boolean;
|
|
19
|
-
}):
|
|
18
|
+
}): any;
|
|
20
19
|
}> & {
|
|
21
20
|
/** The reference element for the listbox */
|
|
22
21
|
default(props: {
|
|
23
22
|
/** Whether or not the listbox is open */
|
|
24
23
|
open: boolean;
|
|
25
|
-
}):
|
|
24
|
+
}): any;
|
|
26
25
|
};
|
|
27
26
|
refs: {};
|
|
28
27
|
rootEl: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarListbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListbox.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarListbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListbox.vue"],"names":[],"mappings":"AAwGA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,IAAI,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAA;AAkCD,iBAAS,cAAc;WA6HT,OAAO,IAA6B;;QA7IhD,4CAA4C;uBAC7B;YACb,yCAAyC;YACzC,IAAI,EAAE,OAAO,CAAA;SACd,GAAG,GAAG;;QAJP,4CAA4C;uBAC7B;YACb,yCAAyC;YACzC,IAAI,EAAE,OAAO,CAAA;SACd,GAAG,GAAG;;;;EA8IR;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;aAnLR,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;aAFL,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;;;aAFL,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;aAFL,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;;kFAwLhB,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,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Listbox as
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as c, openBlock as o, createBlock as r, unref as t, withCtx as l, createTextVNode as b, toDisplayString as y, createCommentVNode as m, createVNode as i, mergeProps as u, createElementBlock as p, createElementVNode as V, Fragment as g, renderList as B, normalizeStyle as _, renderSlot as k } from "vue";
|
|
2
|
+
import { Listbox as x, ListboxLabel as L, ListboxOptions as h, ListboxButton as $ } from "@headlessui/vue";
|
|
3
|
+
import { useBindCx as v } from "../../hooks/useBindCx.js";
|
|
4
|
+
import S from "./ScalarListboxItem.vue.js";
|
|
5
5
|
import C from "../ScalarFloating/ScalarFloating.vue.js";
|
|
6
|
-
|
|
6
|
+
import N from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
|
|
7
|
+
const w = { class: "custom-scroll min-h-0 flex-1" }, P = /* @__PURE__ */ c({
|
|
7
8
|
inheritAttrs: !1,
|
|
8
9
|
__name: "ScalarListbox",
|
|
9
10
|
props: {
|
|
@@ -13,78 +14,72 @@ const N = { class: "custom-scroll min-h-0 flex-1" }, O = /* @__PURE__ */ b({
|
|
|
13
14
|
multiple: { type: Boolean },
|
|
14
15
|
modelValue: {},
|
|
15
16
|
placement: {},
|
|
17
|
+
offset: {},
|
|
16
18
|
resize: { type: Boolean },
|
|
17
19
|
target: {},
|
|
18
20
|
middleware: {},
|
|
19
21
|
teleport: { type: [Boolean, String] }
|
|
20
22
|
},
|
|
21
23
|
emits: ["update:modelValue"],
|
|
22
|
-
setup(
|
|
23
|
-
const { cx:
|
|
24
|
-
return (e,
|
|
24
|
+
setup(z) {
|
|
25
|
+
const { cx: d } = v();
|
|
26
|
+
return (e, s) => (o(), r(t(x), {
|
|
25
27
|
modelValue: e.modelValue,
|
|
26
28
|
multiple: e.multiple,
|
|
27
|
-
"onUpdate:modelValue":
|
|
29
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.$emit("update:modelValue", a))
|
|
28
30
|
}, {
|
|
29
|
-
default: l(({ open:
|
|
30
|
-
e.label ? (o(),
|
|
31
|
+
default: l(({ open: a }) => [
|
|
32
|
+
e.label ? (o(), r(t(L), {
|
|
31
33
|
key: 0,
|
|
32
34
|
class: "sr-only"
|
|
33
35
|
}, {
|
|
34
36
|
default: l(() => [
|
|
35
|
-
|
|
37
|
+
b(y(e.label), 1)
|
|
36
38
|
]),
|
|
37
39
|
_: 1
|
|
38
|
-
})) :
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
resize: e.resize,
|
|
43
|
-
target: e.target,
|
|
44
|
-
teleport: e.teleport
|
|
45
|
-
}, {
|
|
40
|
+
})) : m("", !0),
|
|
41
|
+
i(t(C), u(e.$props, {
|
|
42
|
+
placement: e.placement ?? "bottom-start"
|
|
43
|
+
}), {
|
|
46
44
|
floating: l(({ width: f }) => [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
), [
|
|
54
|
-
u("div", N, [
|
|
55
|
-
s(t(v), { class: "flex flex-col p-0.75" }, {
|
|
45
|
+
a ? (o(), p("div", u({
|
|
46
|
+
key: 0,
|
|
47
|
+
style: { width: f }
|
|
48
|
+
}, t(d)("relative flex max-h-[inherit] w-40 rounded text-sm")), [
|
|
49
|
+
V("div", w, [
|
|
50
|
+
i(t(h), { class: "flex flex-col gap-0.75 p-0.75" }, {
|
|
56
51
|
default: l(() => [
|
|
57
|
-
(o(!0),
|
|
52
|
+
(o(!0), p(g, null, B(e.options, (n) => (o(), r(S, {
|
|
58
53
|
key: n.id,
|
|
59
54
|
option: n,
|
|
60
|
-
style:
|
|
55
|
+
style: _(e.multiple ? "checkbox" : "radio")
|
|
61
56
|
}, null, 8, ["option", "style"]))), 128))
|
|
62
57
|
]),
|
|
63
58
|
_: 1
|
|
64
59
|
})
|
|
65
60
|
]),
|
|
66
|
-
|
|
67
|
-
], 16)) :
|
|
61
|
+
i(t(N))
|
|
62
|
+
], 16)) : m("", !0)
|
|
68
63
|
]),
|
|
69
64
|
default: l(() => [
|
|
70
|
-
|
|
65
|
+
i(t($), {
|
|
71
66
|
id: e.id,
|
|
72
67
|
as: "template",
|
|
73
68
|
class: "justify-start focus:outline-none focus-visible:ring-1 focus-visible:ring-c-accent"
|
|
74
69
|
}, {
|
|
75
70
|
default: l(() => [
|
|
76
|
-
|
|
71
|
+
k(e.$slots, "default", { open: a })
|
|
77
72
|
]),
|
|
78
73
|
_: 2
|
|
79
74
|
}, 1032, ["id"])
|
|
80
75
|
]),
|
|
81
76
|
_: 2
|
|
82
|
-
},
|
|
77
|
+
}, 1040, ["placement"])
|
|
83
78
|
]),
|
|
84
79
|
_: 3
|
|
85
80
|
}, 8, ["modelValue", "multiple"]));
|
|
86
81
|
}
|
|
87
82
|
});
|
|
88
83
|
export {
|
|
89
|
-
|
|
84
|
+
P as default
|
|
90
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarListboxCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListboxCheckbox.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarListboxCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListboxCheckbox.vue"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB,CAAC;;AAyEF,wBAOG"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as o, openBlock as t, createElementBlock as r, normalizeClass as c, createBlock as s, unref as n, createCommentVNode as a } from "vue";
|
|
2
|
+
import l from "../ScalarIcon/ScalarIcon.vue.js";
|
|
3
|
+
const u = /* @__PURE__ */ o({
|
|
4
4
|
__name: "ScalarListboxCheckbox",
|
|
5
5
|
props: {
|
|
6
6
|
selected: { type: Boolean },
|
|
7
7
|
style: {}
|
|
8
8
|
},
|
|
9
|
-
setup(
|
|
10
|
-
return (e,
|
|
9
|
+
setup(p) {
|
|
10
|
+
return (e, i) => (t(), r("div", {
|
|
11
11
|
class: c(["flex size-4 items-center justify-center p-0.75", [
|
|
12
|
-
e.selected ? "bg-c-accent text-b-1" : "text-transparent
|
|
12
|
+
e.selected ? "bg-c-accent text-b-1" : "text-transparent shadow-border",
|
|
13
13
|
e.style === "checkbox" ? "rounded" : "rounded-full"
|
|
14
14
|
]])
|
|
15
15
|
}, [
|
|
16
|
-
s(n(
|
|
17
|
-
|
|
16
|
+
e.selected ? (t(), s(n(l), {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "relative top-[0.5px] size-3",
|
|
18
19
|
icon: "Checkmark",
|
|
19
|
-
thickness: "
|
|
20
|
-
})
|
|
20
|
+
thickness: "3"
|
|
21
|
+
})) : a("", !0)
|
|
21
22
|
], 2));
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
u as default
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarListboxItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListboxItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarListboxItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListboxItem.vue"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB,CAAC;;AAmGF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as l, openBlock as s, createBlock as p, unref as t, withCtx as c, createElementVNode as a, normalizeClass as n, createVNode as m, normalizeStyle as d, toDisplayString as
|
|
2
|
-
import { ListboxOption as
|
|
3
|
-
import { cva as f, cx as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as l, openBlock as s, createBlock as p, unref as t, withCtx as c, createElementVNode as a, normalizeClass as n, createVNode as m, normalizeStyle as d, toDisplayString as u } from "vue";
|
|
2
|
+
import { ListboxOption as b } from "@headlessui/vue";
|
|
3
|
+
import { cva as f, cx as v } from "../../cva.js";
|
|
4
|
+
import y from "./ScalarListboxCheckbox.vue.js";
|
|
5
5
|
const C = /* @__PURE__ */ l({
|
|
6
6
|
__name: "ScalarListboxItem",
|
|
7
7
|
props: {
|
|
@@ -14,7 +14,6 @@ const C = /* @__PURE__ */ l({
|
|
|
14
14
|
// Layout
|
|
15
15
|
"group/item",
|
|
16
16
|
"flex min-w-0 items-center gap-1.5 rounded px-2 py-1.5 text-left",
|
|
17
|
-
"first-of-type:mt-0.75 last-of-type:mb-0.75",
|
|
18
17
|
// Text / background style
|
|
19
18
|
"truncate bg-transparent text-c-1",
|
|
20
19
|
// Interaction
|
|
@@ -26,22 +25,22 @@ const C = /* @__PURE__ */ l({
|
|
|
26
25
|
disabled: { true: "pointer-events-none opacity-50" }
|
|
27
26
|
}
|
|
28
27
|
});
|
|
29
|
-
return (e, x) => (s(), p(t(
|
|
28
|
+
return (e, x) => (s(), p(t(b), {
|
|
30
29
|
as: "template",
|
|
31
30
|
disabled: e.option.disabled,
|
|
32
31
|
value: e.option
|
|
33
32
|
}, {
|
|
34
33
|
default: c(({ active: i, selected: o }) => [
|
|
35
34
|
a("li", {
|
|
36
|
-
class: n(t(
|
|
35
|
+
class: n(t(v)(t(r)({ active: i, selected: o, disabled: e.option.disabled })))
|
|
37
36
|
}, [
|
|
38
|
-
m(
|
|
37
|
+
m(y, {
|
|
39
38
|
selected: o,
|
|
40
39
|
style: d(e.style)
|
|
41
40
|
}, null, 8, ["selected", "style"]),
|
|
42
41
|
a("span", {
|
|
43
42
|
class: n(["inline-block min-w-0 flex-1 truncate", e.option.color ? e.option.color : "text-c-1"])
|
|
44
|
-
},
|
|
43
|
+
}, u(e.option.label), 3)
|
|
45
44
|
], 2)
|
|
46
45
|
]),
|
|
47
46
|
_: 1
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as n, openBlock as l, createBlock as
|
|
1
|
+
import { defineComponent as n, openBlock as l, createBlock as s, withCtx as o, createTextVNode as e, createVNode as r } from "vue";
|
|
2
2
|
import a from "./ScalarMenuLink.vue.js";
|
|
3
|
-
import
|
|
3
|
+
import i from "./ScalarMenuSection.vue.js";
|
|
4
4
|
const d = /* @__PURE__ */ n({
|
|
5
5
|
__name: "ScalarMenuResources",
|
|
6
6
|
setup(m) {
|
|
7
|
-
return (
|
|
7
|
+
return (p, t) => (l(), s(i, null, {
|
|
8
8
|
title: o(() => t[0] || (t[0] = [
|
|
9
9
|
e("Resources")
|
|
10
10
|
])),
|
|
11
11
|
default: o(() => [
|
|
12
12
|
r(a, {
|
|
13
|
-
href: "mailto:
|
|
13
|
+
href: "mailto:support@scalar.com",
|
|
14
14
|
icon: "Email",
|
|
15
15
|
target: "_blank"
|
|
16
16
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarPopover.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarPopover/ScalarPopover.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"ScalarPopover.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarPopover/ScalarPopover.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAMrD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC4B,CAAA;AAEtC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA;AAE7B,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KA0B5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarPopover.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarPopover/ScalarPopover.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarPopover.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarPopover/ScalarPopover.vue"],"names":[],"mappings":"AAkDA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAiBpC,iBAAS,cAAc;WAqFT,OAAO,IAA6B;;;;EAKjD;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,sTAMnB,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,40 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as P, PopoverPanel as
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as m, openBlock as i, createBlock as c, unref as e, withCtx as o, createVNode as r, normalizeProps as d, guardReactiveProps as u, mergeProps as _, renderSlot as l } from "vue";
|
|
2
|
+
import { Popover as P, PopoverPanel as v, PopoverButton as B } from "@headlessui/vue";
|
|
3
|
+
import { useBindCx as $ } from "../../hooks/useBindCx.js";
|
|
4
|
+
import g from "../ScalarFloating/ScalarFloating.vue.js";
|
|
5
|
+
import y from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
|
|
6
|
+
const b = /* @__PURE__ */ m({
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "ScalarPopover",
|
|
8
9
|
props: {
|
|
9
10
|
placement: {},
|
|
11
|
+
offset: {},
|
|
10
12
|
resize: { type: Boolean },
|
|
11
13
|
target: {},
|
|
12
14
|
middleware: {},
|
|
13
15
|
teleport: { type: [Boolean, String] }
|
|
14
16
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const { cx: p } =
|
|
17
|
-
return (
|
|
18
|
-
default:
|
|
19
|
-
r(e(
|
|
20
|
-
floating:
|
|
21
|
-
r(e(
|
|
22
|
-
style: { width:
|
|
17
|
+
setup(h) {
|
|
18
|
+
const { cx: p } = $();
|
|
19
|
+
return (t, k) => (i(), c(e(P), { as: "template" }, {
|
|
20
|
+
default: o(({ open: a }) => [
|
|
21
|
+
r(e(g), d(u(t.$props)), {
|
|
22
|
+
floating: o(({ width: s, height: f }) => [
|
|
23
|
+
r(e(v), _({
|
|
24
|
+
style: { width: s, height: f }
|
|
23
25
|
}, e(p)("relative flex flex-col p-0.75")), {
|
|
24
|
-
default:
|
|
25
|
-
|
|
26
|
-
close: () =>
|
|
26
|
+
default: o(({ close: n }) => [
|
|
27
|
+
l(t.$slots, "popover", {
|
|
28
|
+
close: () => n(),
|
|
27
29
|
open: a
|
|
28
30
|
}),
|
|
29
|
-
l
|
|
31
|
+
l(t.$slots, "backdrop", { open: a }, () => [
|
|
32
|
+
r(e(y))
|
|
33
|
+
])
|
|
30
34
|
]),
|
|
31
35
|
_: 2
|
|
32
36
|
}, 1040, ["style"])
|
|
33
37
|
]),
|
|
34
|
-
default:
|
|
35
|
-
r(e(
|
|
36
|
-
default:
|
|
37
|
-
|
|
38
|
+
default: o(() => [
|
|
39
|
+
r(e(B), { as: "template" }, {
|
|
40
|
+
default: o(() => [
|
|
41
|
+
l(t.$slots, "default", { open: a })
|
|
38
42
|
]),
|
|
39
43
|
_: 2
|
|
40
44
|
}, 1024)
|
|
@@ -47,5 +51,5 @@ const S = /* @__PURE__ */ f({
|
|
|
47
51
|
}
|
|
48
52
|
});
|
|
49
53
|
export {
|
|
50
|
-
|
|
54
|
+
b as default
|
|
51
55
|
};
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import type { Slot } from 'vue';
|
|
2
1
|
export type Slots = {
|
|
3
2
|
default(props: {
|
|
4
3
|
/** Whether or not the popover is open */
|
|
5
4
|
open: boolean;
|
|
6
|
-
}):
|
|
5
|
+
}): any;
|
|
7
6
|
/** The popover contents */
|
|
8
7
|
popover(props: {
|
|
9
8
|
/** Whether or not the popover is open */
|
|
10
9
|
open: boolean;
|
|
11
10
|
/** A callback to close the popover */
|
|
12
11
|
close: () => void;
|
|
13
|
-
}):
|
|
12
|
+
}): any;
|
|
13
|
+
/** Overrides the popover backdrop */
|
|
14
|
+
backdrop?(props: {
|
|
15
|
+
/** Whether or not the popover is open */
|
|
16
|
+
open: boolean;
|
|
17
|
+
}): any;
|
|
14
18
|
};
|
|
15
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarPopover/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarPopover/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,CAAC,KAAK,EAAE;QACb,yCAAyC;QACzC,IAAI,EAAE,OAAO,CAAA;KACd,GAAG,GAAG,CAAA;IACP,2BAA2B;IAC3B,OAAO,CAAC,KAAK,EAAE;QACb,yCAAyC;QACzC,IAAI,EAAE,OAAO,CAAA;QACb,sCAAsC;QACtC,KAAK,EAAE,MAAM,IAAI,CAAA;KAClB,GAAG,GAAG,CAAA;IACP,qCAAqC;IACrC,QAAQ,CAAC,CAAC,KAAK,EAAE;QACf,yCAAyC;QACzC,IAAI,EAAE,OAAO,CAAA;KACd,GAAG,GAAG,CAAA;CACR,CAAA"}
|