@indielayer/ui 1.10.2 → 1.10.3

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.
@@ -1,15 +1,15 @@
1
1
  const g = {
2
2
  classes: {
3
3
  wrapper({ props: e, slots: n, data: i }) {
4
- const l = ["relative transition duration-150 focus:outline-none inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden align-middle active:!shadow-none border appearance-none"];
5
- return i.isButtonGroup || l.push(e.rounded ? "rounded-full" : "rounded-md"), !e.flat && !e.light && !e.ghost && !e.disabled && !e.loading && l.push("shadow-sm"), e.size === "xs" ? l.push(n.default ? `py-1 text-xs ${e.icon, "px-2"}` : "leading-none p-1") : e.size === "sm" ? l.push(n.default ? `py-1.5 text-sm ${e.icon, "px-3"}` : "leading-none p-1.5") : e.size === "lg" ? l.push(n.default ? `py-3 text-lg ${e.icon ? "px-4" : "px-6"}` : "leading-none p-3") : e.size === "xl" ? l.push(n.default ? `py-4 text-xl ${e.icon, "px-6"}` : "leading-none p-4") : l.push(n.default ? `py-2 ${e.icon ? "px-4" : "px-5"}` : "leading-none p-2"), e.disabled ? l.push("cursor-not-allowed") : e.loading ? l.push("cursor-default") : l.push("cursor-pointer"), l;
4
+ const l = ["relative transition duration-150 focus:outline-none inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden align-middle active:!shadow-none border appearance-none shrink-0"];
5
+ return i.isButtonGroup || l.push(e.rounded ? "rounded-full" : "rounded-md"), !e.flat && !e.light && !e.ghost && !e.disabled && !e.loading && l.push("shadow-sm"), e.size === "xs" ? l.push(n.default ? `py-1 text-xs ${e.icon, "px-2"}` : "leading-none p-1") : e.size === "sm" ? l.push(n.default ? `py-1.5 text-sm ${e.icon, "px-3"}` : "leading-none p-1.5") : e.size === "lg" ? l.push(n.default ? `py-3 text-lg ${e.icon ? "px-4" : "px-6"}` : "leading-none p-3") : e.size === "xl" ? l.push(n.default ? `py-4 text-xl ${e.icon, "px-6"}` : "leading-none p-3.5") : l.push(n.default ? `py-2 ${e.icon ? "px-4" : "px-5"}` : "leading-none p-[0.532rem]"), e.disabled ? l.push("cursor-not-allowed") : e.loading ? l.push("cursor-default") : l.push("cursor-pointer"), l;
6
6
  },
7
7
  iconLeft: ({ slots: e }) => e.default ? "mr-2" : "m-0.5",
8
8
  iconRight: ({ slots: e }) => e.default ? "ml-2" : "m-0.5"
9
9
  },
10
10
  styles({ props: e, colors: n, css: i, data: l }) {
11
- const a = n.getPalette("gray"), t = e.color ? n.getPalette(e.color) : a, d = [], b = e.color && e.light, r = !e.color && !e.ghost;
12
- return e.glow && d.push(i.get("glow", n.getColorOpacity(e.color ? t[500] : a[500], 0.5))), r ? e.disabled ? d.push(i.variables({
11
+ const a = n.getPalette("gray"), t = e.color ? n.getPalette(e.color) : a, d = [], r = e.color && e.light, b = !e.color && !e.ghost;
12
+ return e.glow && d.push(i.get("glow", n.getColorOpacity(e.color ? t[500] : a[500], 0.5))), b ? e.disabled ? d.push(i.variables({
13
13
  bg: a[50],
14
14
  text: a[300],
15
15
  border: a[200],
@@ -31,7 +31,7 @@ const g = {
31
31
  hover: { bg: e.loading ? "" : a[700], border: a[600] },
32
32
  active: { bg: e.loading ? "" : a[600], border: a[500] }
33
33
  }
34
- })) : b ? ((!e.outlined || e.disabled) && d.push(i.get("border", "transparent")), e.disabled ? d.push(i.variables({
34
+ })) : r ? ((!e.outlined || e.disabled) && d.push(i.get("border", "transparent")), e.disabled ? d.push(i.variables({
35
35
  bg: t[50],
36
36
  text: t[200],
37
37
  border: "transparent",
@@ -60,7 +60,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
60
60
  type: BooleanConstructor;
61
61
  default: boolean;
62
62
  };
63
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "submit"[], "submit", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
+ }>, {
64
+ validate: () => boolean;
65
+ submit: (e: Event) => void;
66
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "submit"[], "submit", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
64
67
  autoValidate: {
65
68
  type: BooleanConstructor;
66
69
  default: boolean;
@@ -1,10 +1,10 @@
1
- import { defineComponent as E, provide as I, onMounted as S, watch as $, nextTick as A, openBlock as c, createElementBlock as f, normalizeStyle as C, unref as n, normalizeClass as l, renderSlot as d, toDisplayString as p, createCommentVNode as m, createElementVNode as y } from "vue";
2
- import { injectFormKey as N } from "../../composables/keys.js";
3
- import { useTheme as T } from "../../composables/useTheme.js";
4
- const j = {
1
+ import { defineComponent as I, provide as S, onMounted as $, watch as A, nextTick as C, openBlock as c, createElementBlock as f, normalizeStyle as N, unref as n, normalizeClass as l, renderSlot as d, toDisplayString as h, createCommentVNode as m, createElementVNode as b } from "vue";
2
+ import { injectFormKey as T } from "../../composables/keys.js";
3
+ import { useTheme as j } from "../../composables/useTheme.js";
4
+ const w = {
5
5
  key: 0,
6
6
  class: "mb-6"
7
- }, w = ["disabled"], z = {
7
+ }, z = ["disabled"], D = {
8
8
  autoValidate: {
9
9
  type: Boolean,
10
10
  default: !0
@@ -24,17 +24,17 @@ const j = {
24
24
  type: Boolean,
25
25
  default: !0
26
26
  }
27
- }, D = {
27
+ }, P = {
28
28
  name: "XForm"
29
- }, O = /* @__PURE__ */ E({
30
- ...D,
31
- props: z,
29
+ }, X = /* @__PURE__ */ I({
30
+ ...P,
31
+ props: D,
32
32
  emits: ["submit"],
33
- setup(h, { emit: b }) {
34
- const u = h, F = b, s = [];
35
- I(N, {
33
+ setup(F, { expose: g, emit: V }) {
34
+ const u = F, k = V, s = [];
35
+ S(T, {
36
36
  registerInput: (e, t, o, i) => {
37
- const a = s.find((B) => B.name === e);
37
+ const a = s.find((E) => E.name === e);
38
38
  a ? (a.focus = t, a.validate = o, a.setError = i) : s.push({ name: e, focus: t, validate: o, setError: i });
39
39
  },
40
40
  unregisterInput: (e) => {
@@ -42,10 +42,10 @@ const j = {
42
42
  s.splice(t, 1);
43
43
  },
44
44
  isInsideForm: !0
45
- }), S(async () => {
45
+ }), $(async () => {
46
46
  u.autoFocus && s && s.length > 0 && setTimeout(s[0].focus, 50);
47
- }), $(() => u.errors, (e) => {
48
- e && A(() => {
47
+ }), A(() => u.errors, (e) => {
48
+ e && C(() => {
49
49
  if (Array.isArray(e))
50
50
  e.forEach((t, o) => {
51
51
  const i = s.find((a) => a.name === t.field);
@@ -57,44 +57,46 @@ const j = {
57
57
  }
58
58
  });
59
59
  });
60
- const g = () => {
60
+ const p = () => {
61
61
  let e = !0;
62
62
  return s.forEach((t) => {
63
63
  !t.validate() && e && (e = !1, t.focus && t.focus());
64
64
  }), e;
65
- }, V = (e) => {
65
+ }, y = (e) => {
66
66
  e.preventDefault(), e.stopPropagation();
67
- const t = u.autoValidate ? g() : !0;
68
- F("submit", t);
69
- }, { styles: k, classes: r, className: v } = T("Form", {}, u);
67
+ const t = u.autoValidate ? p() : !0;
68
+ k("submit", t);
69
+ };
70
+ g({ validate: p, submit: y });
71
+ const { styles: v, classes: r, className: B } = j("Form", {}, u);
70
72
  return (e, t) => (c(), f("form", {
71
- style: C(n(k)),
73
+ style: N(n(v)),
72
74
  class: l([
73
- n(v),
75
+ n(B),
74
76
  n(r).wrapper
75
77
  ]),
76
- onSubmit: V
78
+ onSubmit: y
77
79
  }, [
78
80
  d(e.$slots, "header", {}, () => [
79
- e.title || e.description ? (c(), f("div", j, [
81
+ e.title || e.description ? (c(), f("div", w, [
80
82
  e.title ? (c(), f("p", {
81
83
  key: 0,
82
84
  class: l(n(r).title)
83
- }, p(e.title), 3)) : m("", !0),
85
+ }, h(e.title), 3)) : m("", !0),
84
86
  e.description ? (c(), f("p", {
85
87
  key: 1,
86
88
  class: l(n(r).description)
87
- }, p(e.description), 3)) : m("", !0)
89
+ }, h(e.description), 3)) : m("", !0)
88
90
  ])) : m("", !0)
89
91
  ]),
90
- y("fieldset", {
92
+ b("fieldset", {
91
93
  disabled: e.disabled,
92
94
  class: l([n(r).content, "contents"])
93
95
  }, [
94
96
  d(e.$slots, "default")
95
- ], 10, w),
97
+ ], 10, z),
96
98
  e.hasFooter ? d(e.$slots, "footer", { key: 0 }, () => [
97
- y("div", {
99
+ b("div", {
98
100
  class: l(n(r).footer)
99
101
  }, [
100
102
  d(e.$slots, "primary-action"),
@@ -105,5 +107,5 @@ const j = {
105
107
  }
106
108
  });
107
109
  export {
108
- O as default
110
+ X as default
109
111
  };