@scalar/components 0.14.36 → 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.
Files changed (73) hide show
  1. package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.d.ts +23 -0
  2. package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.d.ts.map +1 -0
  3. package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.js +27 -0
  4. package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue2.js +4 -0
  5. package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.d.ts +21 -0
  6. package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.d.ts.map +1 -0
  7. package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.js +37 -0
  8. package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue2.js +4 -0
  9. package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.d.ts +33 -0
  10. package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.d.ts.map +1 -0
  11. package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.js +45 -0
  12. package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue2.js +4 -0
  13. package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.d.ts +21 -0
  14. package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.d.ts.map +1 -0
  15. package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.js +38 -0
  16. package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue2.js +4 -0
  17. package/dist/components/ScalarCheckboxInput/index.d.ts +6 -0
  18. package/dist/components/ScalarCheckboxInput/index.d.ts.map +1 -0
  19. package/dist/components/ScalarCheckboxInput/types.d.ts +7 -0
  20. package/dist/components/ScalarCheckboxInput/types.d.ts.map +1 -0
  21. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +11 -13
  22. package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.d.ts +1 -1
  23. package/dist/components/ScalarForm/ScalarFormInput.vue.d.ts +28 -0
  24. package/dist/components/ScalarForm/ScalarFormInput.vue.d.ts.map +1 -0
  25. package/dist/components/ScalarForm/ScalarFormInput.vue.js +39 -0
  26. package/dist/components/ScalarForm/ScalarFormInput.vue2.js +4 -0
  27. package/dist/components/ScalarForm/ScalarFormInputGroup.vue.d.ts +39 -0
  28. package/dist/components/ScalarForm/ScalarFormInputGroup.vue.d.ts.map +1 -0
  29. package/dist/components/ScalarForm/ScalarFormInputGroup.vue.js +23 -0
  30. package/dist/components/ScalarForm/ScalarFormInputGroup.vue2.js +4 -0
  31. package/dist/components/ScalarForm/ScalarFormSection.vue.js +5 -5
  32. package/dist/components/ScalarForm/index.d.ts +3 -1
  33. package/dist/components/ScalarForm/index.d.ts.map +1 -1
  34. package/dist/components/ScalarForm/useFormGroups.d.ts +18 -0
  35. package/dist/components/ScalarForm/useFormGroups.d.ts.map +1 -0
  36. package/dist/components/ScalarForm/useFormGroups.js +9 -0
  37. package/dist/components/ScalarListbox/ScalarListboxInput.vue.d.ts +24 -0
  38. package/dist/components/ScalarListbox/ScalarListboxInput.vue.d.ts.map +1 -0
  39. package/dist/components/ScalarListbox/ScalarListboxInput.vue.js +26 -0
  40. package/dist/components/ScalarListbox/ScalarListboxInput.vue2.js +4 -0
  41. package/dist/components/ScalarListbox/index.d.ts +2 -1
  42. package/dist/components/ScalarListbox/index.d.ts.map +1 -1
  43. package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.d.ts.map +1 -1
  44. package/dist/components/ScalarMarkdown/samples/index.d.ts +1 -1
  45. package/dist/components/ScalarMarkdown/samples/tables.d.ts +1 -1
  46. package/dist/components/ScalarMarkdown/samples/tables.d.ts.map +1 -1
  47. package/dist/components/ScalarTextArea/ScalarTextArea.vue.d.ts.map +1 -1
  48. package/dist/components/ScalarTextArea/ScalarTextArea.vue.js +27 -28
  49. package/dist/components/ScalarTextInput/ScalarTextInput.vue.d.ts +4 -0
  50. package/dist/components/ScalarTextInput/ScalarTextInput.vue.d.ts.map +1 -1
  51. package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +53 -44
  52. package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts +5 -3
  53. package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts.map +1 -1
  54. package/dist/components/ScalarToggle/ScalarToggle.vue.js +24 -22
  55. package/dist/components/ScalarToggle/ScalarToggleGroup.vue.d.ts +21 -0
  56. package/dist/components/ScalarToggle/ScalarToggleGroup.vue.d.ts.map +1 -0
  57. package/dist/components/ScalarToggle/ScalarToggleGroup.vue.js +35 -0
  58. package/dist/components/ScalarToggle/ScalarToggleGroup.vue2.js +4 -0
  59. package/dist/components/ScalarToggle/ScalarToggleInput.vue.d.ts +28 -0
  60. package/dist/components/ScalarToggle/ScalarToggleInput.vue.d.ts.map +1 -0
  61. package/dist/components/ScalarToggle/ScalarToggleInput.vue.js +36 -0
  62. package/dist/components/ScalarToggle/ScalarToggleInput.vue2.js +4 -0
  63. package/dist/components/ScalarToggle/index.d.ts +2 -0
  64. package/dist/components/ScalarToggle/index.d.ts.map +1 -1
  65. package/dist/index.d.ts +2 -1
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +184 -166
  68. package/dist/style.css +1 -1
  69. package/package.json +6 -6
  70. package/dist/components/ScalarCheckbox/ScalarCheckbox.vue.d.ts +0 -26
  71. package/dist/components/ScalarCheckbox/ScalarCheckbox.vue.d.ts.map +0 -1
  72. package/dist/components/ScalarCheckbox/index.d.ts +0 -2
  73. package/dist/components/ScalarCheckbox/index.d.ts.map +0 -1
@@ -0,0 +1,23 @@
1
+ import type { ScalarCheckboxType } from './types';
2
+ /**
3
+ * Scalar checkbox base component
4
+ *
5
+ * Provides a styled visual checkbox but not the underlying input element.
6
+ *
7
+ * This is used internally by the ScalarCheckboxInput component.
8
+ *
9
+ * If you're looking to create an interactive checkbox you
10
+ * probably want the ScalarCheckboxInput component.
11
+ *
12
+ * @example
13
+ * <ScalarCheckbox :selected="state" type="radio" />
14
+ */
15
+ declare const _default: import("vue").DefineComponent<{
16
+ selected?: boolean;
17
+ type?: ScalarCheckboxType;
18
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
19
+ selected?: boolean;
20
+ type?: ScalarCheckboxType;
21
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ export default _default;
23
+ //# sourceMappingURL=ScalarCheckbox.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCheckboxInput/ScalarCheckbox.vue"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAGjD;;;;;;;;;;;;GAYG;;eAGU,OAAO;WACX,kBAAkB;;eADd,OAAO;WACX,kBAAkB;;AAH3B,wBAqEC"}
@@ -0,0 +1,27 @@
1
+ import { defineComponent as o, createElementBlock as c, openBlock as t, normalizeClass as r, createBlock as a, createCommentVNode as n, unref as s } from "vue";
2
+ import { ScalarIconCheck as l } from "@scalar/icons";
3
+ const d = {}, i = /* @__PURE__ */ o({
4
+ ...d,
5
+ __name: "ScalarCheckbox",
6
+ props: {
7
+ selected: { type: Boolean },
8
+ type: { default: "checkbox" }
9
+ },
10
+ setup(p) {
11
+ return (e, m) => (t(), c("div", {
12
+ class: r(["flex size-4 items-center justify-center p-0.75", [
13
+ e.selected ? "bg-c-accent text-b-1" : "text-transparent shadow-border",
14
+ e.type === "checkbox" ? "rounded" : "rounded-full"
15
+ ]])
16
+ }, [
17
+ e.selected ? (t(), a(s(l), {
18
+ key: 0,
19
+ class: "size-3",
20
+ weight: "bold"
21
+ })) : n("", !0)
22
+ ], 2));
23
+ }
24
+ });
25
+ export {
26
+ i as default
27
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarCheckbox.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,21 @@
1
+ import type { ScalarCheckboxOption } from './types';
2
+ /**
3
+ * Scalar Checkbox Group component
4
+ *
5
+ * A group of checkbox 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=ScalarCheckboxGroup.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarCheckboxGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGnD;;;;GAIG;;cAGS,oBAAoB,EAAE;;iBAcrB,oBAAoB,EAAE;;;;cAdvB,oBAAoB,EAAE;;iBAcrB,oBAAoB,EAAE;;;;AAhBnC,wBAqGC"}
@@ -0,0 +1,37 @@
1
+ import { defineComponent as c, mergeModels as f, useModel as _, useId as i, createBlock as t, openBlock as u, unref as o, withCtx as m, createElementBlock as p, Fragment as v, renderList as V, createTextVNode as k, toDisplayString as x } from "vue";
2
+ import g from "./ScalarCheckboxInput.vue.js";
3
+ import h from "../ScalarForm/ScalarFormInputGroup.vue.js";
4
+ const B = {}, S = /* @__PURE__ */ c({
5
+ ...B,
6
+ __name: "ScalarCheckboxGroup",
7
+ props: /* @__PURE__ */ f({
8
+ options: { default: () => [] }
9
+ }, {
10
+ modelValue: { default: [] },
11
+ modelModifiers: {}
12
+ }),
13
+ emits: ["update:modelValue"],
14
+ setup(r) {
15
+ const l = _(r, "modelValue"), d = i();
16
+ return (n, C) => (u(), t(o(h), null, {
17
+ default: m(() => [
18
+ (u(!0), p(v, null, V(n.options, (e) => (u(), t(g, {
19
+ value: e.value,
20
+ name: o(d),
21
+ modelValue: l.value?.some(({ value: a }) => a === e.value),
22
+ "onUpdate:modelValue": (a) => l.value = a ? [...l.value, e] : l.value.filter(({ value: s }) => s !== e.value),
23
+ key: e.value
24
+ }, {
25
+ default: m(() => [
26
+ k(x(e.label), 1)
27
+ ]),
28
+ _: 2
29
+ }, 1032, ["value", "name", "modelValue", "onUpdate:modelValue"]))), 128))
30
+ ]),
31
+ _: 1
32
+ }));
33
+ }
34
+ });
35
+ export {
36
+ S as default
37
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarCheckboxGroup.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,33 @@
1
+ import type { ScalarCheckboxType } from './types';
2
+ /**
3
+ * Scalar Checkbox Input component
4
+ *
5
+ * A wrapper around the HTML input element for either checkboxes or radio buttons.
6
+ *
7
+ * @example
8
+ * <ScalarCheckboxInput v-model="model" type="checkbox">
9
+ * Option Label
10
+ * </ScalarCheckboxInput>
11
+ */
12
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
13
+ type?: ScalarCheckboxType;
14
+ } & {
15
+ modelValue?: boolean;
16
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: boolean | undefined) => any;
18
+ }, string, import("vue").PublicProps, Readonly<{
19
+ type?: ScalarCheckboxType;
20
+ } & {
21
+ modelValue?: boolean;
22
+ }> & Readonly<{
23
+ "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
25
+ default?: (props: {}) => any;
26
+ }>;
27
+ export default _default;
28
+ type __VLS_WithSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
33
+ //# sourceMappingURL=ScalarCheckboxInput.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarCheckboxInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCheckboxInput/ScalarCheckboxInput.vue"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAGjD;;;;;;;;;GASG;;WAGM,kBAAkB;;iBAcd,OAAO;;;;WAdX,kBAAkB;;iBAcd,OAAO;;;;cA6DN,CAAC,KAAK,IAAgB,KAAK,GAAG;;AA7E5C,wBAgHC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { defineComponent as u, mergeModels as c, useModel as m, createBlock as p, openBlock as f, unref as o, mergeProps as s, withCtx as _, createVNode as y, createElementVNode as r, withDirectives as h, renderSlot as v, vModelDynamic as x } from "vue";
2
+ import { useBindCx as V } from "@scalar/use-hooks/useBindCx";
3
+ import b from "./ScalarCheckbox.vue.js";
4
+ import k from "../ScalarForm/ScalarFormInput.vue.js";
5
+ const C = { class: "flex-1 text-left min-w-0 truncate" }, g = ["type"], B = {}, D = /* @__PURE__ */ u({
6
+ ...B,
7
+ inheritAttrs: !1,
8
+ __name: "ScalarCheckboxInput",
9
+ props: /* @__PURE__ */ c({
10
+ type: { default: "checkbox" }
11
+ }, {
12
+ modelValue: { type: Boolean },
13
+ modelModifiers: {}
14
+ }),
15
+ emits: ["update:modelValue"],
16
+ setup(a) {
17
+ const e = m(a, "modelValue"), { classCx: n, otherAttrs: d } = V();
18
+ return (t, l) => (f(), p(o(k), s(
19
+ { is: "label" },
20
+ o(n)("cursor-pointer gap-2 hover:bg-b-2", { "text-c-1": e.value })
21
+ ), {
22
+ default: _(() => [
23
+ y(b, {
24
+ selected: e.value,
25
+ type: t.type,
26
+ class: "shrink-0"
27
+ }, null, 8, ["selected", "type"]),
28
+ r("div", C, [
29
+ v(t.$slots, "default")
30
+ ]),
31
+ h(r("input", s({
32
+ type: t.type,
33
+ "onUpdate:modelValue": l[0] || (l[0] = (i) => e.value = i),
34
+ class: "sr-only"
35
+ }, o(d)), null, 16, g), [
36
+ [x, e.value]
37
+ ])
38
+ ]),
39
+ _: 3
40
+ }, 16));
41
+ }
42
+ });
43
+ export {
44
+ D as default
45
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarCheckboxInput.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,21 @@
1
+ import type { ScalarCheckboxOption } from './types';
2
+ /**
3
+ * Scalar Checkbox Radio Group component
4
+ *
5
+ * A group of radio inputs allowing for single selection.
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 | undefined) => any;
13
+ }, string, import("vue").PublicProps, Readonly<{
14
+ options?: ScalarCheckboxOption[];
15
+ } & {
16
+ modelValue?: ScalarCheckboxOption;
17
+ }> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: ScalarCheckboxOption | undefined) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
21
+ //# sourceMappingURL=ScalarCheckboxRadioGroup.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarCheckboxRadioGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGnD;;;;GAIG;;cAGS,oBAAoB,EAAE;;iBAarB,oBAAoB;;;;cAbrB,oBAAoB,EAAE;;iBAarB,oBAAoB;;;;AAfjC,wBAiGC"}
@@ -0,0 +1,38 @@
1
+ import { defineComponent as s, mergeModels as c, useModel as i, useId as _, createBlock as o, openBlock as l, unref as t, withCtx as u, createElementBlock as f, Fragment as p, renderList as v, createTextVNode as V, toDisplayString as k } from "vue";
2
+ import x from "./ScalarCheckboxInput.vue.js";
3
+ import g from "../ScalarForm/ScalarFormInputGroup.vue.js";
4
+ const h = {}, b = /* @__PURE__ */ s({
5
+ ...h,
6
+ __name: "ScalarCheckboxRadioGroup",
7
+ props: /* @__PURE__ */ c({
8
+ options: { default: () => [] }
9
+ }, {
10
+ modelValue: {},
11
+ modelModifiers: {}
12
+ }),
13
+ emits: ["update:modelValue"],
14
+ setup(r) {
15
+ const a = i(r, "modelValue"), d = _();
16
+ return (m, y) => (l(), o(t(g), null, {
17
+ default: u(() => [
18
+ (l(!0), f(p, null, v(m.options, (e) => (l(), o(x, {
19
+ type: "radio",
20
+ value: e.value,
21
+ name: t(d),
22
+ modelValue: a.value?.value === e.value,
23
+ "onUpdate:modelValue": (n) => a.value = n ? e : void 0,
24
+ key: e.value
25
+ }, {
26
+ default: u(() => [
27
+ V(k(e.label), 1)
28
+ ]),
29
+ _: 2
30
+ }, 1032, ["value", "name", "modelValue", "onUpdate:modelValue"]))), 128))
31
+ ]),
32
+ _: 1
33
+ }));
34
+ }
35
+ });
36
+ export {
37
+ b as default
38
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarCheckboxRadioGroup.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,6 @@
1
+ export { default as ScalarCheckboxInput } from './ScalarCheckboxInput.vue.js';
2
+ export { default as ScalarCheckboxGroup } from './ScalarCheckboxGroup.vue.js';
3
+ export { default as ScalarCheckboxRadioGroup } from './ScalarCheckboxRadioGroup.vue.js';
4
+ export { default as ScalarCheckbox } from './ScalarCheckbox.vue.js';
5
+ export type { ScalarCheckboxOption, ScalarCheckboxType } from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCheckboxInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACpF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEhE,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,7 @@
1
+ /** The mode for a ScalarCheckboxInput */
2
+ export type ScalarCheckboxType = 'checkbox' | 'radio';
3
+ export type ScalarCheckboxOption = {
4
+ label: string;
5
+ value: string;
6
+ };
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCheckboxInput/types.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,OAAO,CAAA;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1,6 +1,6 @@
1
- import { defineComponent as b, mergeModels as m, useModel as y, useSlots as c, ref as k, createBlock as i, openBlock as f, withCtx as t, createCommentVNode as V, createSlots as w, renderSlot as r, normalizeProps as s, guardReactiveProps as d } from "vue";
2
- import z from "./ScalarComboboxOptions.vue.js";
3
- import S from "./ScalarComboboxPopover.vue.js";
1
+ import { defineComponent as b, mergeModels as m, useModel as y, ref as c, createBlock as i, openBlock as f, withCtx as t, createCommentVNode as k, createSlots as V, renderSlot as r, normalizeProps as d, guardReactiveProps as s } from "vue";
2
+ import w from "./ScalarComboboxOptions.vue.js";
3
+ import z from "./ScalarComboboxPopover.vue.js";
4
4
  const P = /* @__PURE__ */ b({
5
5
  __name: "ScalarComboboxMultiselect",
6
6
  props: /* @__PURE__ */ m({
@@ -18,10 +18,8 @@ const P = /* @__PURE__ */ b({
18
18
  }),
19
19
  emits: /* @__PURE__ */ m(["add"], ["update:modelValue"]),
20
20
  setup(u, { expose: g, emit: v }) {
21
- const n = y(u, "modelValue"), $ = v;
22
- c();
23
- const p = k(null);
24
- return g({ comboboxPopoverRef: p }), (e, l) => (f(), i(S, {
21
+ const $ = v, n = y(u, "modelValue"), p = c(null);
22
+ return g({ comboboxPopoverRef: p }), (e, l) => (f(), i(z, {
25
23
  ref_key: "comboboxPopoverRef",
26
24
  ref: p,
27
25
  middleware: e.middleware,
@@ -35,7 +33,7 @@ const P = /* @__PURE__ */ b({
35
33
  r(e.$slots, "default", { open: a })
36
34
  ]),
37
35
  popover: t(({ open: a }) => [
38
- e.options?.length ? (f(), i(z, {
36
+ e.options?.length ? (f(), i(w, {
39
37
  key: 0,
40
38
  modelValue: n.value,
41
39
  "onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
@@ -44,29 +42,29 @@ const P = /* @__PURE__ */ b({
44
42
  options: e.options,
45
43
  placeholder: e.placeholder,
46
44
  onAdd: l[1] || (l[1] = (o) => $("add"))
47
- }, w({ _: 2 }, [
45
+ }, V({ _: 2 }, [
48
46
  e.$slots.option ? {
49
47
  name: "option",
50
48
  fn: t((o) => [
51
- r(e.$slots, "option", s(d(o)))
49
+ r(e.$slots, "option", d(s(o)))
52
50
  ]),
53
51
  key: "0"
54
52
  } : void 0,
55
53
  e.$slots.group ? {
56
54
  name: "group",
57
55
  fn: t((o) => [
58
- r(e.$slots, "group", s(d(o)))
56
+ r(e.$slots, "group", d(s(o)))
59
57
  ]),
60
58
  key: "1"
61
59
  } : void 0,
62
60
  e.$slots.add ? {
63
61
  name: "add",
64
62
  fn: t((o) => [
65
- r(e.$slots, "add", s(d(o)))
63
+ r(e.$slots, "add", d(s(o)))
66
64
  ]),
67
65
  key: "2"
68
66
  } : void 0
69
- ]), 1032, ["modelValue", "open", "options", "placeholder"])) : V("", !0)
67
+ ]), 1032, ["modelValue", "open", "options", "placeholder"])) : k("", !0)
70
68
  ]),
71
69
  _: 3
72
70
  }, 8, ["middleware", "offset", "placement", "resize", "target", "teleport"]));
@@ -53,8 +53,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
53
53
  /** The error message */
54
54
  error?: string;
55
55
  }> & Readonly<{
56
- "onUpdate:modelValue"?: ((value: File[] | undefined) => any) | undefined;
57
56
  onSelected?: ((value: File[]) => any) | undefined;
57
+ "onUpdate:modelValue"?: ((value: File[] | undefined) => any) | undefined;
58
58
  "onUpdate:error"?: ((value: string | undefined) => any) | undefined;
59
59
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
60
60
  /** Override the entire input */
@@ -0,0 +1,28 @@
1
+ import type { Component } from 'vue';
2
+ /**
3
+ * Scalar form input base component
4
+ *
5
+ * Provides a base for styling scalar form inputs and buttons
6
+ *
7
+ * This is used internally by the ScalarTextInput component and others
8
+ * If you want a text input consider using this component
9
+ *
10
+ * Renders a button by default can be used to render any kind of input or input wrapper
11
+ *
12
+ * @example
13
+ * <ScalarFormInput />
14
+ */
15
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
16
+ is?: string | Component;
17
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
18
+ is?: string | Component;
19
+ }> & Readonly<{}>, {}, {}, {}, {}, 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=ScalarFormInput.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarFormInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarForm/ScalarFormInput.vue"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAKpC;;;;;;;;;;;;GAYG;;SAGI,MAAM,GAAG,SAAS;;SAAlB,MAAM,GAAG,SAAS;;cAmDX,CAAC,KAAK,IAAgB,KAAK,GAAG;;AArD5C,wBAoFC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { defineComponent as s, createBlock as u, openBlock as i, resolveDynamicComponent as p, mergeProps as a, unref as e, withCtx as d, renderSlot as f } from "vue";
2
+ import { useBindCx as l, cva as c } from "@scalar/use-hooks/useBindCx";
3
+ import { useFormGroupInput as m } from "./useFormGroups.js";
4
+ const b = {}, y = /* @__PURE__ */ s({
5
+ ...b,
6
+ inheritAttrs: !1,
7
+ __name: "ScalarFormInput",
8
+ props: {
9
+ is: { default: "button" }
10
+ },
11
+ setup(_) {
12
+ const { cx: o } = l(), r = m(), n = c({
13
+ base: [
14
+ // Layout
15
+ "bg-b-1.5 flex items-center text-c-2 gap-0.75 px-3 py-2.5 ",
16
+ //Focus
17
+ "outline-offset-[-1px] has-[:focus-visible]:outline"
18
+ ],
19
+ variants: {
20
+ grouped: {
21
+ true: "first:rounded-t-[inherit] last:rounded-b-[inherit]",
22
+ false: "rounded border"
23
+ },
24
+ button: { true: "cursor-pointer hover:bg-b-2" }
25
+ }
26
+ });
27
+ return (t, g) => (i(), u(p(t.is), a({
28
+ type: t.is === "button" ? "button" : void 0
29
+ }, e(o)(e(n)({ button: t.is === "button", grouped: e(r) }))), {
30
+ default: d(() => [
31
+ f(t.$slots, "default")
32
+ ]),
33
+ _: 3
34
+ }, 16, ["type"]));
35
+ }
36
+ });
37
+ export {
38
+ y as default
39
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarFormInput.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,39 @@
1
+ import type { Component } from 'vue';
2
+ /**
3
+ * Scalar Form Group component
4
+ *
5
+ * Groups a set of ScalarFormInput or their derived components.
6
+ *
7
+ * @example
8
+ * <ScalarFormInputGroup>
9
+ * <!-- Inputs... -->
10
+ * </ScalarFormInputGroup>
11
+ */
12
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
13
+ /** The element to render
14
+ *
15
+ * If you want to use the group outside of a ScalarFormField,
16
+ * you can set this to 'fieldset'.
17
+ *
18
+ * @default 'div'
19
+ */
20
+ is?: string | Component;
21
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
22
+ /** The element to render
23
+ *
24
+ * If you want to use the group outside of a ScalarFormField,
25
+ * you can set this to 'fieldset'.
26
+ *
27
+ * @default 'div'
28
+ */
29
+ is?: string | Component;
30
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
31
+ default?: (props: {}) => any;
32
+ }>;
33
+ export default _default;
34
+ type __VLS_WithSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
39
+ //# sourceMappingURL=ScalarFormInputGroup.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarFormInputGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarForm/ScalarFormInputGroup.vue"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAKpC;;;;;;;;;GASG;;IAGD;;;;;;OAMG;SACE,MAAM,GAAG,SAAS;;IAPvB;;;;;;OAMG;SACE,MAAM,GAAG,SAAS;;cAiCX,CAAC,KAAK,IAAgB,KAAK,GAAG;;AA1C5C,wBAuEC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { defineComponent as r, createBlock as t, openBlock as n, resolveDynamicComponent as s, normalizeProps as a, guardReactiveProps as i, unref as p, withCtx as l, renderSlot as u } from "vue";
2
+ import { useBindCx as d } from "@scalar/use-hooks/useBindCx";
3
+ import { useFormGroup as f } from "./useFormGroups.js";
4
+ const m = {}, h = /* @__PURE__ */ r({
5
+ ...m,
6
+ inheritAttrs: !1,
7
+ __name: "ScalarFormInputGroup",
8
+ props: {
9
+ is: { default: "div" }
10
+ },
11
+ setup(c) {
12
+ const { cx: o } = d();
13
+ return f(), (e, _) => (n(), t(s(e.is), a(i(p(o)("flex flex-col border rounded divide-y"))), {
14
+ default: l(() => [
15
+ u(e.$slots, "default")
16
+ ]),
17
+ _: 3
18
+ }, 16));
19
+ }
20
+ });
21
+ export {
22
+ h as default
23
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ScalarFormInputGroup.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,9 +1,9 @@
1
1
  import s from "./ScalarFormSection.vue2.js";
2
2
  import { createElementBlock as n, openBlock as c, createElementVNode as t, renderSlot as o } from "vue";
3
- import l from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = { class: "flex min-w-0 flex-col gap-4" }, a = { class: "contents" }, d = { class: "text-lg font-medium text-c-1" };
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const l = { class: "flex min-w-0 flex-col gap-3" }, a = { class: "contents" }, d = { class: "text-base font-medium text-c-1" };
5
5
  function f(e, i, m, p, _, u) {
6
- return c(), n("fieldset", r, [
6
+ return c(), n("fieldset", l, [
7
7
  t("legend", a, [
8
8
  t("span", d, [
9
9
  o(e.$slots, "label")
@@ -12,7 +12,7 @@ function f(e, i, m, p, _, u) {
12
12
  o(e.$slots, "default")
13
13
  ]);
14
14
  }
15
- const g = /* @__PURE__ */ l(s, [["render", f]]);
15
+ const S = /* @__PURE__ */ r(s, [["render", f]]);
16
16
  export {
17
- g as default
17
+ S as default
18
18
  };
@@ -1,5 +1,7 @@
1
1
  export { default as ScalarForm } from './ScalarForm.vue.js';
2
+ export { default as ScalarFormError } from './ScalarFormError.vue.js';
2
3
  export { default as ScalarFormField } from './ScalarFormField.vue.js';
4
+ export { default as ScalarFormInput } from './ScalarFormInput.vue.js';
5
+ export { default as ScalarFormInputGroup } from './ScalarFormInputGroup.vue.js';
3
6
  export { default as ScalarFormSection } from './ScalarFormSection.vue.js';
4
- export { default as ScalarFormError } from './ScalarFormError.vue.js';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { type InjectionKey } from 'vue';
2
+ /**
3
+ * Tells a ScalarFormInput component that it is in a form group.
4
+ */
5
+ export declare const FORM_GROUP_SYMBOL: InjectionKey<boolean>;
6
+ /**
7
+ * Check if we're in a form group.
8
+ *
9
+ * This is called from ScalarFormInput components.
10
+ */
11
+ export declare const useFormGroupInput: () => boolean;
12
+ /**
13
+ * Set that this is a form group.
14
+ *
15
+ * This is called from ScalarFormInputGroup components.
16
+ */
17
+ export declare const useFormGroup: () => void;
18
+ //# sourceMappingURL=useFormGroups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormGroups.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarForm/useFormGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,KAAK,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAe,YAAY,CAAC,OAAO,CAAC,CAAA;AAElE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,eAE7B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,YAExB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { inject as r, provide as t } from "vue";
2
+ const o = Symbol(), u = () => r(o, !1), n = () => {
3
+ t(o, !0);
4
+ };
5
+ export {
6
+ o as FORM_GROUP_SYMBOL,
7
+ n as useFormGroup,
8
+ u as useFormGroupInput
9
+ };