sakana-element 1.0.2 → 1.0.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.
Files changed (37) hide show
  1. package/dist/es/Alert-Y-4NzXo2.js +15 -0
  2. package/dist/es/Button-QmYnZwSJ.js +15 -0
  3. package/dist/es/Collapse-DuP1vJB8.js +38 -0
  4. package/dist/es/Icon-DmsxaUyH.js +12 -0
  5. package/dist/es/index.js +21 -11
  6. package/dist/es/utils-CiAcDRmu.js +35 -0
  7. package/dist/es/vendor-DFf1bTHP.js +590 -0
  8. package/dist/index.css +1 -1
  9. package/dist/theme/Alert.css +113 -0
  10. package/dist/theme/Button.css +608 -0
  11. package/dist/theme/Collapse.css +114 -0
  12. package/dist/theme/Icon.css +25 -0
  13. package/dist/theme/index.css +181 -0
  14. package/dist/types/components/Alert/index.d.ts +122 -0
  15. package/dist/types/components/Alert/types.d.ts +17 -0
  16. package/dist/types/components/Button/index.d.ts +33 -24
  17. package/dist/types/components/Button/types.d.ts +7 -1
  18. package/dist/types/components/Collapse/constants.d.ts +4 -0
  19. package/dist/types/components/Collapse/index.d.ts +108 -0
  20. package/dist/types/components/Collapse/transitionEvents.d.ts +2 -0
  21. package/dist/types/components/Collapse/types.d.ts +20 -0
  22. package/dist/types/components/Icon/index.d.ts +3 -3
  23. package/dist/types/components/index.d.ts +2 -0
  24. package/dist/types/utils/error.d.ts +3 -0
  25. package/dist/types/utils/index.d.ts +2 -0
  26. package/dist/umd/index.css +1 -1
  27. package/dist/umd/index.css.gz +0 -0
  28. package/dist/umd/index.umd.cjs +27 -13
  29. package/dist/umd/index.umd.cjs.gz +0 -0
  30. package/package.json +54 -52
  31. package/dist/es/Button-B9E1LUtb.js +0 -106
  32. package/dist/es/Icon-D-m6M0GX.js +0 -49
  33. package/dist/es/utils-Dr2tNfHs.js +0 -14
  34. package/dist/es/vendor-B6hv2FuL.js +0 -829
  35. package/dist/types/components/Button/Button.vue.d.ts +0 -49
  36. package/dist/types/components/Button/ButtonGroup.vue.d.ts +0 -22
  37. package/dist/types/components/Icon/Icon.vue.d.ts +0 -13
@@ -0,0 +1,15 @@
1
+ import { defineComponent as e, useSlots as t, ref as l, computed as o, createBlock as s, openBlock as a, Transition as c, withCtx as r, withDirectives as n, createElementVNode as i, normalizeClass as p, createCommentVNode as f, createElementBlock as _, normalizeStyle as d, renderSlot as u, createTextVNode as m, toDisplayString as v, createVNode as y, withModifiers as w, vShow as h } from "vue";
2
+ import { t as I, _ as k, w as x } from "./utils-CiAcDRmu.js";
3
+ import { E as $ } from "./Icon-DmsxaUyH.js";
4
+ const b = { class: "er-alert__content" }, g = { class: "er-alert__description" }, B = { key: 0, class: "er-alert__close" }, E = x(k(e({ name: "ErAlert", __name: "Alert", props: { title: {}, type: { default: "info" }, description: {}, effect: { default: "light" }, closable: { type: Boolean, default: true }, center: { type: Boolean }, showIcon: { type: Boolean } }, emits: ["close"], setup(e2, { expose: k2, emit: x2 }) {
5
+ const E2 = e2, j = x2, A = t(), C = l(true), q = o(() => I.get(E2.type) ?? "circle-info"), z = o(() => E2.description || A.default);
6
+ function D() {
7
+ C.value = false, j("close");
8
+ }
9
+ return k2({ open: function() {
10
+ C.value = true;
11
+ }, close: D }), (e3, t2) => (a(), s(c, { name: "er-alert-fade" }, { default: r(() => [n(i("div", { class: p(["er-alert", { [`er-alert__${e3.type}`]: e3.type, [`er-alert__${e3.effect}`]: e3.effect, "text-center": e3.center }]), role: "alert" }, [e3.showIcon ? (a(), s($, { key: 0, class: p(["er-alert__icon", { "big-icon": z.value }]), icon: q.value }, null, 8, ["class", "icon"])) : f("", true), i("div", b, [i("span", { class: p(["er-alert__title", { "with-desc": z.value }]), style: d({ display: e3.center && !e3.showIcon ? "flow" : "inline" }) }, [u(e3.$slots, "title", {}, () => [m(v(e3.title), 1)], true)], 6), i("p", g, [u(e3.$slots, "default", {}, () => [m(v(e3.description), 1)], true)]), e3.closable ? (a(), _("div", B, [y($, { onClick: w(D, ["stop"]), icon: "xmark" })])) : f("", true)])], 2), [[h, C.value]])]), _: 3 }));
12
+ } }), [["__scopeId", "data-v-243a5d29"]]));
13
+ export {
14
+ E
15
+ };
@@ -0,0 +1,15 @@
1
+ import { defineComponent as e, useSlots as o, inject as t, ref as a, computed as l, createBlock as i, openBlock as s, resolveDynamicComponent as n, unref as d, normalizeClass as u, withCtx as r, renderSlot as p, createCommentVNode as c, createVNode as y, normalizeStyle as f, provide as v, reactive as b, toRef as g, createElementBlock as m } from "vue";
2
+ import { E as _ } from "./Icon-DmsxaUyH.js";
3
+ import { t as B } from "./vendor-DFf1bTHP.js";
4
+ import { _ as z, w as T } from "./utils-CiAcDRmu.js";
5
+ const k = Symbol("BUTTON_GROUP_CTX_KEY"), x = z(e({ name: "ErButton", __name: "Button", props: { tag: { default: "button" }, type: {}, size: {}, nativeType: { default: "button" }, disabled: { type: Boolean }, loading: { type: Boolean }, icon: {}, circle: { type: Boolean }, plain: { type: Boolean }, round: { type: Boolean }, loadingIcon: {}, autofocus: { type: Boolean }, useThrottle: { type: Boolean, default: true }, throttleDuration: { default: 500 } }, emits: ["click"], setup(e2, { expose: v2, emit: b2 }) {
6
+ const g2 = e2, m2 = b2, z2 = o(), T2 = t(k, void 0), x2 = a(), h2 = l(() => (T2 == null ? void 0 : T2.size) ?? (g2 == null ? void 0 : g2.size) ?? ""), E2 = l(() => (T2 == null ? void 0 : T2.type) ?? (g2 == null ? void 0 : g2.type) ?? ""), I2 = l(() => (T2 == null ? void 0 : T2.disabled) || (g2 == null ? void 0 : g2.disabled) || false), $2 = l(() => ({ marginRight: z2.default ? "6px" : "0px" })), j = (e3) => m2("click", e3), G = B(j, g2.throttleDuration, { trailing: false });
7
+ return v2({ ref: x2, disabled: I2, size: h2, type: E2 }), (e3, o2) => (s(), i(n(e3.tag), { ref_key: "_ref", ref: x2, autofocus: e3.autofocus, type: "button" === e3.tag ? e3.nativeType : void 0, class: u(["er-button", { [`er-button--${E2.value}`]: E2.value, [`er-button--${h2.value}`]: h2.value, "is-plain": e3.plain, "is-round": e3.round, "is-circle": e3.circle, "is-disabled": I2.value, "is-loading": e3.loading }]), disabled: !(!I2.value && !e3.loading) || void 0, onClick: o2[0] || (o2[0] = (o3) => e3.useThrottle ? d(G)(o3) : j(o3)) }, { default: r(() => [e3.loading ? p(e3.$slots, "loading", { key: 0 }, () => [y(_, { class: "loading-icon", icon: e3.loadingIcon ?? "spinner", style: f($2.value), size: "1x", spin: "" }, null, 8, ["icon", "style"])], true) : c("", true), e3.icon && !e3.loading ? (s(), i(_, { key: 1, icon: e3.icon, style: f($2.value), size: "1x" }, null, 8, ["icon", "style"])) : c("", true), p(e3.$slots, "default", {}, void 0, true)]), _: 3 }, 8, ["autofocus", "type", "disabled", "class"]));
8
+ } }), [["__scopeId", "data-v-7ba94f2d"]]), h = { class: "er-button-group" }, E = z(e({ name: "ErButtonGroup", __name: "ButtonGroup", props: { size: {}, type: {}, disabled: { type: Boolean } }, setup(e2) {
9
+ const o2 = e2;
10
+ return v(k, b({ size: g(o2, "size"), type: g(o2, "type"), disabled: g(o2, "disabled") })), (e3, o3) => (s(), m("div", h, [p(e3.$slots, "default", {}, void 0, true)]));
11
+ } }), [["__scopeId", "data-v-f316cd1a"]]), I = T(x), $ = T(E);
12
+ export {
13
+ I as E,
14
+ $ as a
15
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent as e, ref as a, watchEffect as l, watch as o, provide as t, createElementBlock as s, openBlock as i, renderSlot as d, inject as n, computed as c, normalizeClass as r, createElementVNode as m, createVNode as p, createTextVNode as u, toDisplayString as v, Transition as h, mergeProps as f, toHandlers as _, unref as g, withCtx as y, withDirectives as b, vShow as C } from "vue";
2
+ import { d as I, _ as E, w as $ } from "./utils-CiAcDRmu.js";
3
+ import { E as w } from "./Icon-DmsxaUyH.js";
4
+ const x = Symbol("collapseContext"), V = { class: "er-collapse" }, k = "ErCollapse", j = E(e({ name: k, __name: "Collapse", props: { modelValue: {}, accordion: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: n2 }) {
5
+ const c2 = e2, r2 = n2, m2 = a(c2.modelValue);
6
+ function p2(e3) {
7
+ m2.value = e3, r2("update:modelValue", e3), r2("change", e3);
8
+ }
9
+ return c2.accordion && m2.value.length > 1 && console.warn("accordion mode should only have one active item"), l(() => {
10
+ c2.accordion && m2.value.length > 1 && I(k, "accordion mode should only have one active item");
11
+ }), o(() => c2.modelValue, (e3) => p2(e3)), t(x, { activeNames: m2, handleItemClick: function(e3) {
12
+ let a2 = [...m2.value];
13
+ if (c2.accordion) return a2 = [a2[0] === e3 ? "" : e3], void p2(a2);
14
+ const l2 = a2.indexOf(e3);
15
+ l2 > -1 ? a2.splice(l2, 1) : a2.push(e3), p2(a2);
16
+ } }), (e3, a2) => (i(), s("div", V, [d(e3.$slots, "default", {}, void 0, true)]));
17
+ } }), [["__scopeId", "data-v-51f3c344"]]), B = (e2) => e2.style.height = "0px", L = (e2) => e2.style.height = `${e2.scrollHeight}px`, N = (e2) => e2.style.height = "", H = (e2) => e2.style.overflow = "hidden", O = (e2) => e2.style.overflow = "", S = { beforeEnter(e2) {
18
+ B(e2), H(e2);
19
+ }, enter: (e2) => L(e2), afterEnter(e2) {
20
+ N(e2), O(e2);
21
+ }, beforeLeave(e2) {
22
+ L(e2), H(e2);
23
+ }, leave: (e2) => B(e2), afterLeave(e2) {
24
+ N(e2), O(e2);
25
+ } }, q = ["id"], z = { class: "er-collapse-item__title" }, A = { class: "er-collapse-item__wapper" }, D = ["id"], F = E(e({ name: "ErCollapseItem", __name: "CollapseItem", props: { name: {}, title: {}, disabled: { type: Boolean } }, setup(e2) {
26
+ const a2 = e2, l2 = n(x, void 0), o2 = c(() => {
27
+ var _a;
28
+ return (_a = l2 == null ? void 0 : l2.activeNames.value) == null ? void 0 : _a.includes(a2.name);
29
+ });
30
+ function t2() {
31
+ a2.disabled || (l2 == null ? void 0 : l2.handleItemClick(a2.name));
32
+ }
33
+ return (e3, a3) => (i(), s("div", { class: r(["er-collapse-item", { "is-disabled": e3.disabled }]) }, [m("div", { class: r(["er-collapse-item__header", { "is-disabled": e3.disabled, "is-active": o2.value }]), id: `item-header-${e3.name}`, onClick: t2 }, [m("span", z, [d(e3.$slots, "title", {}, () => [u(v(e3.title), 1)], true)]), p(w, { icon: "angle-right", class: "header-angle" })], 10, q), p(h, f({ name: "slide" }, _(g(S))), { default: y(() => [b(m("div", A, [m("div", { class: "er-collapse-item__content", id: `item-content-${e3.name}` }, [d(e3.$slots, "default", {}, void 0, true)], 8, D)], 512), [[C, o2.value]])]), _: 3 }, 16)], 2));
34
+ } }), [["__scopeId", "data-v-0542cc04"]]), G = $(j), J = $(F);
35
+ export {
36
+ G as E,
37
+ J as a
38
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as e, computed as o, createElementBlock as t, openBlock as a, mergeProps as n, createVNode as p, unref as l, normalizeProps as s, guardReactiveProps as r } from "vue";
2
+ import { FontAwesomeIcon as i } from "@fortawesome/vue-fontawesome";
3
+ import { o as y } from "./vendor-DFf1bTHP.js";
4
+ import { _ as m, w as c } from "./utils-CiAcDRmu.js";
5
+ const B = m(e({ name: "ErIcon", inheritAttrs: false, __name: "Icon", props: { border: { type: Boolean }, fixedWidth: { type: Boolean }, flip: {}, icon: {}, mask: {}, listItem: { type: Boolean }, pull: {}, pulse: { type: Boolean }, rotation: {}, swapOpacity: { type: Boolean }, size: {}, spin: { type: Boolean }, transform: {}, symbol: { type: [Boolean, String] }, title: {}, inverse: { type: Boolean }, bounce: { type: Boolean }, shake: { type: Boolean }, beat: { type: Boolean }, fade: { type: Boolean }, beatFade: { type: Boolean }, spinPulse: { type: Boolean }, spinReverse: { type: Boolean }, type: {}, color: {} }, setup(e2) {
6
+ const m2 = e2, c2 = o(() => y(m2, ["type", "color"])), B2 = o(() => ({ color: m2.color ?? void 0 }));
7
+ return (e3, o2) => (a(), t("i", n({ class: ["er-icon", [`er-icon-${m2.type}`]], style: B2.value }, e3.$attrs), [p(l(i), s(r(c2.value)), null, 16)], 16));
8
+ } }), [["__scopeId", "data-v-36ba3bf8"]]), u = c(B);
9
+ export {
10
+ B as E,
11
+ u as a
12
+ };
package/dist/es/index.js CHANGED
@@ -1,14 +1,24 @@
1
- import { m as o } from "./utils-Dr2tNfHs.js";
2
- import { library as r } from "@fortawesome/fontawesome-svg-core";
3
- import { fas as t } from "@fortawesome/free-solid-svg-icons";
4
- import { E as a, a as m } from "./Button-B9E1LUtb.js";
5
- import { E as s } from "./Icon-D-m6M0GX.js";
6
- const n = [a, m, s];
7
- r.add(t);
8
- const E = o(n);
1
+ import { m as _ } from "./utils-CiAcDRmu.js";
2
+ import { library as o } from "@fortawesome/fontawesome-svg-core";
3
+ import { fas as n } from "@fortawesome/free-solid-svg-icons";
4
+ import { E as a, a as t } from "./Button-QmYnZwSJ.js";
5
+ import { a as r } from "./Icon-DmsxaUyH.js";
6
+ import { E as s, a as e } from "./Collapse-DuP1vJB8.js";
7
+ import { E as i } from "./Alert-Y-4NzXo2.js";
8
+ const m = [a, t, r, s, e, i];
9
+ !function() {
10
+ {
11
+ const _2 = "\n__________________________________________________________________________________________________________\n\n _______ __ _______ __ __ \n | __|.---.-.| |--..---.-..-----..---.-. ______ | ___|| |.-----..--------..-----..-----.| |_ \n |__ || _ || < | _ || || _ ||______|| ___|| || -__|| || -__|| || _|\n |_______||___._||__|__||___._||__|__||___._| |_______||__||_____||__|__|__||_____||__|__||____|\n \n__________________________________________________________________________________________________________\n author:Sakana\n", o2 = "\nbackground: linear-gradient(135deg, orange 60%, cyan);\nbackground-clip: text;\ncolor: transparent;\nfont-size: 16px; \nline-height: 1;\nfont-family: monospace;\nfont-weight: 600;\n";
12
+ console.info(`%c${_2}`, o2);
13
+ }
14
+ }(), o.add(n);
15
+ const f = _(m);
9
16
  export {
17
+ i as ErAlert,
10
18
  a as ErButton,
11
- m as ErButtonGroup,
12
- s as ErIcon,
13
- E as default
19
+ t as ErButtonGroup,
20
+ s as ErCollapse,
21
+ e as ErCollapseItem,
22
+ r as ErIcon,
23
+ f as default
14
24
  };
@@ -0,0 +1,35 @@
1
+ import { f as r } from "./vendor-DFf1bTHP.js";
2
+ function n(n2) {
3
+ return (c2) => r(n2, (r2) => {
4
+ c2.use(r2);
5
+ });
6
+ }
7
+ const c = (r2) => (r2.install = (n2) => {
8
+ const c2 = r2.name;
9
+ n2.component(c2, r2);
10
+ }, r2);
11
+ class o extends Error {
12
+ constructor(r2) {
13
+ super(r2), this.name = "ErUIError";
14
+ }
15
+ }
16
+ function s(r2, n2) {
17
+ if ("production" !== process.env.NODE_ENV) {
18
+ const c2 = function(r3, n3) {
19
+ return new o(`[${r3}]:${n3}`);
20
+ }(r2, n2);
21
+ console.warn(c2);
22
+ }
23
+ }
24
+ const e = /* @__PURE__ */ new Map([["info", "circle-info"], ["success", "check-circle"], ["warning", "circle-exclamation"], ["danger", "circle-xmark"], ["error", "circle-xmark"]]), t = (r2, n2) => {
25
+ const c2 = r2.__vccOpts || r2;
26
+ for (const [r3, o2] of n2) c2[r3] = o2;
27
+ return c2;
28
+ };
29
+ export {
30
+ t as _,
31
+ s as d,
32
+ n as m,
33
+ e as t,
34
+ c as w
35
+ };