@scalar/components 0.14.37 → 0.14.38
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/ScalarCheckboxInput/ScalarCheckbox.vue.d.ts +23 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.d.ts.map +1 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.js +27 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue2.js +4 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.d.ts +21 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.d.ts.map +1 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.js +37 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue2.js +4 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.d.ts +33 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.d.ts.map +1 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.js +45 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue2.js +4 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.d.ts +21 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.d.ts.map +1 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.js +38 -0
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue2.js +4 -0
- package/dist/components/ScalarCheckboxInput/index.d.ts +6 -0
- package/dist/components/ScalarCheckboxInput/index.d.ts.map +1 -0
- package/dist/components/ScalarCheckboxInput/types.d.ts +7 -0
- package/dist/components/ScalarCheckboxInput/types.d.ts.map +1 -0
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.d.ts +1 -1
- package/dist/components/ScalarForm/ScalarFormInput.vue.d.ts +28 -0
- package/dist/components/ScalarForm/ScalarFormInput.vue.d.ts.map +1 -0
- package/dist/components/ScalarForm/ScalarFormInput.vue.js +39 -0
- package/dist/components/ScalarForm/ScalarFormInput.vue2.js +4 -0
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue.d.ts +39 -0
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue.d.ts.map +1 -0
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue.js +23 -0
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue2.js +4 -0
- package/dist/components/ScalarForm/ScalarFormSection.vue.js +5 -5
- package/dist/components/ScalarForm/index.d.ts +3 -1
- package/dist/components/ScalarForm/index.d.ts.map +1 -1
- package/dist/components/ScalarForm/useFormGroups.d.ts +18 -0
- package/dist/components/ScalarForm/useFormGroups.d.ts.map +1 -0
- package/dist/components/ScalarForm/useFormGroups.js +9 -0
- package/dist/components/ScalarListbox/ScalarListboxInput.vue.d.ts +24 -0
- package/dist/components/ScalarListbox/ScalarListboxInput.vue.d.ts.map +1 -0
- package/dist/components/ScalarListbox/ScalarListboxInput.vue.js +26 -0
- package/dist/components/ScalarListbox/ScalarListboxInput.vue2.js +4 -0
- package/dist/components/ScalarListbox/index.d.ts +2 -1
- package/dist/components/ScalarListbox/index.d.ts.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarMarkdown/samples/index.d.ts +1 -1
- package/dist/components/ScalarMarkdown/samples/tables.d.ts +1 -1
- package/dist/components/ScalarMarkdown/samples/tables.d.ts.map +1 -1
- package/dist/components/ScalarTextArea/ScalarTextArea.vue.d.ts.map +1 -1
- package/dist/components/ScalarTextArea/ScalarTextArea.vue.js +27 -28
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.d.ts +4 -0
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.d.ts.map +1 -1
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +53 -44
- package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts +5 -3
- package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.js +24 -22
- package/dist/components/ScalarToggle/ScalarToggleGroup.vue.d.ts +21 -0
- package/dist/components/ScalarToggle/ScalarToggleGroup.vue.d.ts.map +1 -0
- package/dist/components/ScalarToggle/ScalarToggleGroup.vue.js +35 -0
- package/dist/components/ScalarToggle/ScalarToggleGroup.vue2.js +4 -0
- package/dist/components/ScalarToggle/ScalarToggleInput.vue.d.ts +28 -0
- package/dist/components/ScalarToggle/ScalarToggleInput.vue.d.ts.map +1 -0
- package/dist/components/ScalarToggle/ScalarToggleInput.vue.js +36 -0
- package/dist/components/ScalarToggle/ScalarToggleInput.vue2.js +4 -0
- package/dist/components/ScalarToggle/index.d.ts +2 -0
- package/dist/components/ScalarToggle/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +184 -166
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/components/ScalarCheckbox/ScalarCheckbox.vue.d.ts +0 -26
- package/dist/components/ScalarCheckbox/ScalarCheckbox.vue.d.ts.map +0 -1
- package/dist/components/ScalarCheckbox/index.d.ts +0 -2
- package/dist/components/ScalarCheckbox/index.d.ts.map +0 -1
|
@@ -27,6 +27,6 @@ export declare const samples: readonly [{
|
|
|
27
27
|
readonly value: "\nA paragraph is simply one or more consecutive lines of text, separated\nby one or more blank lines. (A blank line is any line that looks like a\nblank line -- a line containing nothing but spaces or tabs is considered\nblank.) Normal paragraphs should not be indented with spaces or tabs.\n\n---\n\nLine with a soft break\n...following line.\n\nLine with a hard break \n...following line.\n\n--- \n\nLine with several blank lines after...\n\n\n\n...following paragraph.\n";
|
|
28
28
|
}, {
|
|
29
29
|
readonly label: "Tables";
|
|
30
|
-
readonly value: "\nBasic Table\n\n| Syntax
|
|
30
|
+
readonly value: "\nBasic Table\n\n| Syntax | Description |\n| ------------------------------------------------- | ----------- |\n| Header | Title |\n| Paragraph | Text |\n| Superlongtextinasinglecolumnshouldwrapatsomepoint | Text |\n\n\n---\n\nTable with alignment\n\n| Syntax | Description | Test Text |\n| :--- | :----: | ---: |\n| Header | Title | Here's this |\n| Paragraph | Text | And more |\n";
|
|
31
31
|
}];
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "\nBasic Table\n\n| Syntax
|
|
1
|
+
declare const _default: "\nBasic Table\n\n| Syntax | Description |\n| ------------------------------------------------- | ----------- |\n| Header | Title |\n| Paragraph | Text |\n| Superlongtextinasinglecolumnshouldwrapatsomepoint | Text |\n\n\n---\n\nTable with alignment\n\n| Syntax | Description | Test Text |\n| :--- | :----: | ---: |\n| Header | Title | Here's this |\n| Paragraph | Text | And more |\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../../src/components/ScalarMarkdown/samples/tables.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../../src/components/ScalarMarkdown/samples/tables.ts"],"names":[],"mappings":";AAAA,wBAkBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarTextArea.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarTextArea/ScalarTextArea.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarTextArea.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarTextArea/ScalarTextArea.vue"],"names":[],"mappings":"AAuDA;;;;;;;GAOG;;iBAuBU,MAAM;;;;iBAAN,MAAM;;;;AAtBnB,wBAwGC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import { useTextareaAutosize as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as u, useModel as m, onMounted as f, createBlock as d, openBlock as c, unref as t, mergeProps as l, withCtx as p, withDirectives as x, createElementVNode as _, vModelText as v } from "vue";
|
|
2
|
+
import { useBindCx as h } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import { useTextareaAutosize as k } from "@vueuse/core";
|
|
4
|
+
import C from "../ScalarForm/ScalarFormInput.vue.js";
|
|
5
|
+
const V = {}, T = /* @__PURE__ */ u({
|
|
6
|
+
...V,
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "ScalarTextArea",
|
|
8
9
|
props: {
|
|
@@ -10,32 +11,30 @@ const g = {}, A = /* @__PURE__ */ a({
|
|
|
10
11
|
modelModifiers: {}
|
|
11
12
|
},
|
|
12
13
|
emits: ["update:modelValue"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
14
|
+
setup(a) {
|
|
15
|
+
const o = m(a, "modelValue"), { textarea: r } = k({
|
|
15
16
|
// @ts-expect-error - unexpected type mismatch
|
|
16
|
-
input:
|
|
17
|
+
input: o,
|
|
17
18
|
styleProp: "minHeight"
|
|
18
|
-
}), { classCx: i, otherAttrs:
|
|
19
|
-
return
|
|
20
|
-
"autofocus" in
|
|
21
|
-
}), (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
])
|
|
36
|
-
], 16));
|
|
19
|
+
}), { classCx: i, otherAttrs: n } = h();
|
|
20
|
+
return f(() => {
|
|
21
|
+
"autofocus" in n.value && r.value?.focus();
|
|
22
|
+
}), (w, e) => (c(), d(t(C), l({ is: "div" }, t(i)("custom-scroll flex text-c-1 min-h-0 shrink cursor-text"), {
|
|
23
|
+
onClick: e[1] || (e[1] = (s) => t(r)?.focus())
|
|
24
|
+
}), {
|
|
25
|
+
default: p(() => [
|
|
26
|
+
x(_("textarea", l({
|
|
27
|
+
ref_key: "textarea",
|
|
28
|
+
ref: r,
|
|
29
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => o.value = s)
|
|
30
|
+
}, t(n), { class: "w-full resize-none border-none bg-transparent text-sm focus-within:outline-none" }), null, 16), [
|
|
31
|
+
[v, o.value]
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
_: 1
|
|
35
|
+
}, 16));
|
|
37
36
|
}
|
|
38
37
|
});
|
|
39
38
|
export {
|
|
40
|
-
|
|
39
|
+
T as default
|
|
41
40
|
};
|
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
* <ScalarTextInput v-model="model" />
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
} & {
|
|
10
12
|
modelValue?: string;
|
|
11
13
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
14
|
"update:modelValue": (value: string | undefined) => any;
|
|
13
15
|
}, string, import("vue").PublicProps, Readonly<{
|
|
16
|
+
readonly?: boolean;
|
|
17
|
+
} & {
|
|
14
18
|
modelValue?: string;
|
|
15
19
|
}> & Readonly<{
|
|
16
20
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarTextInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarTextInput/ScalarTextInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarTextInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarTextInput/ScalarTextInput.vue"],"names":[],"mappings":"AAwFA;;;;;;;GAOG;;eAGU,OAAO;;iBA6BP,MAAM;;;;eA7BN,OAAO;;iBA6BP,MAAM;;;;aA2GN,CAAC,KAAK,IAAiB,KAAK,GAAG;;aAC/B,CAAC,KAAK,IAAiB,KAAK,GAAG;;aAC/B,CAAC,KAAK,IAAiB,KAAK,GAAG;;YAChC,CAAC,KAAK,IAAiB,KAAK,GAAG;;AA7I3C,wBAkLC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,64 +1,73 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as y, mergeModels as v, useModel as x, ref as _, onMounted as $, createBlock as k, openBlock as t, unref as r, mergeProps as c, withCtx as w, createElementVNode as i, renderSlot as o, createElementBlock as n, createCommentVNode as l, withDirectives as C, vModelDynamic as V, toDisplayString as b } from "vue";
|
|
2
|
+
import { useBindCx as g } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import B from "../ScalarForm/ScalarFormInput.vue.js";
|
|
4
|
+
const M = { class: "flex flex-1 relative" }, D = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "select-none whitespace-nowrap text-sm text-transparent"
|
|
6
|
-
},
|
|
7
|
+
}, S = ["readonly", "aria-readonly"], A = {
|
|
7
8
|
key: 1,
|
|
8
9
|
class: "absolute inset-0 select-none overflow-hidden whitespace-nowrap text-sm"
|
|
9
|
-
},
|
|
10
|
+
}, E = {
|
|
10
11
|
key: 0,
|
|
11
12
|
class: "text-c-2"
|
|
12
|
-
},
|
|
13
|
+
}, N = { class: "text-transparent" }, z = {
|
|
13
14
|
key: 1,
|
|
14
15
|
class: "text-c-2"
|
|
15
|
-
},
|
|
16
|
-
...
|
|
16
|
+
}, I = {}, j = /* @__PURE__ */ y({
|
|
17
|
+
...I,
|
|
17
18
|
inheritAttrs: !1,
|
|
18
19
|
__name: "ScalarTextInput",
|
|
19
|
-
props: {
|
|
20
|
+
props: /* @__PURE__ */ v({
|
|
21
|
+
readonly: { type: Boolean }
|
|
22
|
+
}, {
|
|
20
23
|
modelValue: {},
|
|
21
24
|
modelModifiers: {}
|
|
22
|
-
},
|
|
25
|
+
}),
|
|
23
26
|
emits: ["update:modelValue"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
"autofocus" in u.value &&
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ref_key: "input",
|
|
42
|
-
ref: i,
|
|
43
|
-
"onUpdate:modelValue": o[0] || (o[0] = (p) => r.value = p),
|
|
44
|
-
class: "z-1 min-w-0 flex-1 border-none bg-transparent text-sm placeholder:font-[inherit] focus-within:outline-none"
|
|
45
|
-
}, f(u)), null, 16), [
|
|
46
|
-
[w, r.value]
|
|
47
|
-
]),
|
|
48
|
-
e.$slots.prefix || e.$slots.suffix ? (s(), t("div", V, [
|
|
49
|
-
e.$slots.prefix ? (s(), t("span", C, [
|
|
50
|
-
n(e.$slots, "prefix")
|
|
27
|
+
setup(d) {
|
|
28
|
+
const a = x(d, "modelValue"), s = _(), { classCx: p, otherAttrs: u } = g();
|
|
29
|
+
$(() => {
|
|
30
|
+
"autofocus" in u.value && s.value?.focus();
|
|
31
|
+
});
|
|
32
|
+
function m() {
|
|
33
|
+
d.readonly ? s.value?.select() : s.value?.focus();
|
|
34
|
+
}
|
|
35
|
+
return (e, f) => (t(), k(r(B), c(
|
|
36
|
+
{ is: "div" },
|
|
37
|
+
r(p)("cursor-text text-c-1", e.readonly ? "" : "focus-within:bg-b-1"),
|
|
38
|
+
{ onClick: m }
|
|
39
|
+
), {
|
|
40
|
+
default: w(() => [
|
|
41
|
+
i("div", M, [
|
|
42
|
+
e.$slots.prefix ? (t(), n("span", D, [
|
|
43
|
+
o(e.$slots, "prefix")
|
|
51
44
|
])) : l("", !0),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
C(i("input", c({
|
|
46
|
+
ref_key: "input",
|
|
47
|
+
ref: s,
|
|
48
|
+
"onUpdate:modelValue": f[0] || (f[0] = (h) => a.value = h),
|
|
49
|
+
readonly: e.readonly,
|
|
50
|
+
"aria-readonly": e.readonly || void 0,
|
|
51
|
+
class: "z-1 min-w-0 flex-1 border-none bg-transparent text-sm placeholder:font-[inherit] focus-within:outline-none"
|
|
52
|
+
}, r(u)), null, 16, S), [
|
|
53
|
+
[V, a.value]
|
|
54
|
+
]),
|
|
55
|
+
e.$slots.prefix || e.$slots.suffix ? (t(), n("div", A, [
|
|
56
|
+
e.$slots.prefix ? (t(), n("span", E, [
|
|
57
|
+
o(e.$slots, "prefix")
|
|
58
|
+
])) : l("", !0),
|
|
59
|
+
i("span", N, b(a.value || e.$attrs.placeholder), 1),
|
|
60
|
+
e.$slots.suffix ? (t(), n("span", z, [
|
|
61
|
+
o(e.$slots, "suffix")
|
|
62
|
+
])) : l("", !0)
|
|
55
63
|
])) : l("", !0)
|
|
56
|
-
])
|
|
64
|
+
]),
|
|
65
|
+
o(e.$slots, "aside")
|
|
57
66
|
]),
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
_: 3
|
|
68
|
+
}, 16));
|
|
60
69
|
}
|
|
61
70
|
});
|
|
62
71
|
export {
|
|
63
|
-
|
|
72
|
+
j as default
|
|
64
73
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
modelValue?: boolean;
|
|
3
2
|
disabled?: boolean;
|
|
4
3
|
label?: string;
|
|
5
4
|
};
|
|
6
|
-
|
|
5
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
6
|
+
modelValue?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
9
|
"update:modelValue": (value: boolean) => any;
|
|
8
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
9
11
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
10
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
13
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"names":[],"mappings":"AA+CA,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAyBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;;;;;AAmEF,wBAOG"}
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
import { defineComponent as u, createElementBlock as t, openBlock as
|
|
2
|
-
import { cva as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as c, mergeModels as u, useModel as m, createElementBlock as t, openBlock as o, normalizeClass as n, unref as r, createElementVNode as b, createCommentVNode as p, toDisplayString as f } from "vue";
|
|
2
|
+
import { cva as h, cx as v } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
const g = ["aria-checked", "aria-disabled"], k = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "sr-only"
|
|
6
|
-
},
|
|
6
|
+
}, x = /* @__PURE__ */ c({
|
|
7
7
|
__name: "ScalarToggle",
|
|
8
|
-
props: {
|
|
9
|
-
modelValue: { type: Boolean },
|
|
8
|
+
props: /* @__PURE__ */ u({
|
|
10
9
|
disabled: { type: Boolean },
|
|
11
10
|
label: {}
|
|
12
|
-
},
|
|
11
|
+
}, {
|
|
12
|
+
modelValue: { type: Boolean, default: !1 },
|
|
13
|
+
modelModifiers: {}
|
|
14
|
+
}),
|
|
13
15
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
|
|
16
|
+
setup(l) {
|
|
17
|
+
const s = l, e = m(l, "modelValue");
|
|
18
|
+
function d() {
|
|
19
|
+
s.disabled || (e.value = !e.value);
|
|
18
20
|
}
|
|
19
|
-
const
|
|
21
|
+
const i = h({
|
|
20
22
|
base: "relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300",
|
|
21
23
|
variants: {
|
|
22
24
|
checked: { true: "bg-c-accent" },
|
|
23
25
|
disabled: { true: "cursor-not-allowed opacity-40" }
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
|
-
return (
|
|
27
|
-
"aria-checked": e.
|
|
28
|
-
"aria-disabled":
|
|
29
|
-
class:
|
|
28
|
+
return (a, y) => (o(), t("button", {
|
|
29
|
+
"aria-checked": e.value,
|
|
30
|
+
"aria-disabled": a.disabled,
|
|
31
|
+
class: n(r(v)(r(i)({ checked: e.value, disabled: a.disabled }))),
|
|
30
32
|
role: "switch",
|
|
31
33
|
type: "button",
|
|
32
|
-
onClick:
|
|
34
|
+
onClick: d
|
|
33
35
|
}, [
|
|
34
|
-
|
|
35
|
-
class:
|
|
36
|
+
b("div", {
|
|
37
|
+
class: n(["absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300", { "translate-x-2.5": e.value }])
|
|
36
38
|
}, null, 2),
|
|
37
|
-
|
|
38
|
-
], 10,
|
|
39
|
+
a.label ? (o(), t("span", k, f(a.label), 1)) : p("", !0)
|
|
40
|
+
], 10, g));
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
x as default
|
|
43
45
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ScalarCheckboxOption } from '../ScalarCheckboxInput';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Toggle Group component
|
|
4
|
+
*
|
|
5
|
+
* A group of toggle inputs allowing for multiple selections.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
|
8
|
+
options?: ScalarCheckboxOption[];
|
|
9
|
+
} & {
|
|
10
|
+
modelValue?: ScalarCheckboxOption[];
|
|
11
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: ScalarCheckboxOption[]) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
14
|
+
options?: ScalarCheckboxOption[];
|
|
15
|
+
} & {
|
|
16
|
+
modelValue?: ScalarCheckboxOption[];
|
|
17
|
+
}> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: ScalarCheckboxOption[]) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=ScalarToggleGroup.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarToggleGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/ScalarToggleGroup.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAKlE;;;;GAIG;;cAGS,oBAAoB,EAAE;;iBAYrB,oBAAoB,EAAE;;;;cAZvB,oBAAoB,EAAE;;iBAYrB,oBAAoB,EAAE;;;;AAdnC,wBA8FC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as n, mergeModels as s, useModel as f, createBlock as o, openBlock as t, unref as c, withCtx as u, createElementBlock as _, Fragment as i, renderList as p, createTextVNode as V, toDisplayString as v } from "vue";
|
|
2
|
+
import g from "./ScalarToggleInput.vue.js";
|
|
3
|
+
import k from "../ScalarForm/ScalarFormInputGroup.vue.js";
|
|
4
|
+
const x = {}, C = /* @__PURE__ */ n({
|
|
5
|
+
...x,
|
|
6
|
+
__name: "ScalarToggleGroup",
|
|
7
|
+
props: /* @__PURE__ */ s({
|
|
8
|
+
options: { default: () => [] }
|
|
9
|
+
}, {
|
|
10
|
+
modelValue: { default: [] },
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(r) {
|
|
15
|
+
const l = f(r, "modelValue");
|
|
16
|
+
return (m, B) => (t(), o(c(k), null, {
|
|
17
|
+
default: u(() => [
|
|
18
|
+
(t(!0), _(i, null, p(m.options, (e) => (t(), o(g, {
|
|
19
|
+
modelValue: l.value?.some(({ value: a }) => a === e.value),
|
|
20
|
+
"onUpdate:modelValue": (a) => l.value = a ? [...l.value, e] : l.value.filter(({ value: d }) => d !== e.value),
|
|
21
|
+
key: e.value
|
|
22
|
+
}, {
|
|
23
|
+
default: u(() => [
|
|
24
|
+
V(v(e.label), 1)
|
|
25
|
+
]),
|
|
26
|
+
_: 2
|
|
27
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
28
|
+
]),
|
|
29
|
+
_: 1
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
C as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scalar Toggle Input component
|
|
3
|
+
*
|
|
4
|
+
* A create a toggle input component for use in forms.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <ScalarToggleInput v-model="model" type="checkbox">
|
|
8
|
+
* Label
|
|
9
|
+
* </ScalarToggleInput>
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
12
|
+
modelValue?: boolean;
|
|
13
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
16
|
+
modelValue?: boolean;
|
|
17
|
+
}> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
+
default?: (props: {}) => any;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ScalarToggleInput.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarToggleInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/ScalarToggleInput.vue"],"names":[],"mappings":"AA6CA;;;;;;;;;GASG;;iBAYU,OAAO;;;;iBAAP,OAAO;;;;cAsDN,CAAC,KAAK,IAAgB,KAAK,GAAG;;AAjE5C,wBAoGC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as u, useModel as d, createBlock as i, openBlock as c, unref as t, mergeProps as l, withCtx as f, createElementVNode as p, createVNode as _, renderSlot as V } from "vue";
|
|
2
|
+
import { useBindCx as x } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import g from "./ScalarToggle.vue.js";
|
|
4
|
+
import h from "../ScalarForm/ScalarFormInput.vue.js";
|
|
5
|
+
const v = { class: "flex-1 text-left min-w-0 truncate" }, B = {}, w = /* @__PURE__ */ u({
|
|
6
|
+
...B,
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "ScalarToggleInput",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: { type: Boolean },
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(r) {
|
|
15
|
+
const e = d(r, "modelValue"), { classCx: a, otherAttrs: s } = x();
|
|
16
|
+
return (n, o) => (c(), i(t(h), l(
|
|
17
|
+
{ is: "label" },
|
|
18
|
+
t(a)("cursor-pointer gap-2 hover:bg-b-2", { "text-c-1": e.value })
|
|
19
|
+
), {
|
|
20
|
+
default: f(() => [
|
|
21
|
+
p("div", v, [
|
|
22
|
+
V(n.$slots, "default")
|
|
23
|
+
]),
|
|
24
|
+
_(g, l({
|
|
25
|
+
modelValue: e.value,
|
|
26
|
+
"onUpdate:modelValue": o[0] || (o[0] = (m) => e.value = m),
|
|
27
|
+
class: "shrink-0"
|
|
28
|
+
}, t(s)), null, 16, ["modelValue"])
|
|
29
|
+
]),
|
|
30
|
+
_: 3
|
|
31
|
+
}, 16));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
w as default
|
|
36
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
+
export { compose, cva, cx, tw, useBindCx } from '@scalar/use-hooks/useBindCx';
|
|
2
3
|
export * from './components/ScalarButton';
|
|
3
4
|
export * from './components/ScalarCard';
|
|
5
|
+
export * from './components/ScalarCheckboxInput';
|
|
4
6
|
export * from './components/ScalarCodeBlock';
|
|
5
7
|
export * from './components/ScalarColorModeToggle';
|
|
6
8
|
export * from './components/ScalarCombobox';
|
|
@@ -29,6 +31,5 @@ export * from './components/ScalarTextInput';
|
|
|
29
31
|
export * from './components/ScalarToggle';
|
|
30
32
|
export * from './components/ScalarTooltip';
|
|
31
33
|
export * from './components/ScalarVirtualText';
|
|
32
|
-
export { useBindCx, cva, cx, compose, tw } from '@scalar/use-hooks/useBindCx';
|
|
33
34
|
export * from './helpers';
|
|
34
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE7E,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,WAAW,CAAA"}
|