sakana-element 2.3.0 → 2.4.1

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 (119) hide show
  1. package/README.md +5 -5
  2. package/dist/es/{Alert-BwTsp4X3.js → Alert-DRIDwear.js} +2 -2
  3. package/dist/es/{Avatar-CJu6JYV3.js → Avatar-Dkvvhw_D.js} +1 -1
  4. package/dist/es/{Badge-BmxZXX8k.js → Badge-CLNacHVq.js} +2 -2
  5. package/dist/es/{Breadcrumb-BP8MSklj.js → Breadcrumb-CfJA9NZz.js} +2 -2
  6. package/dist/es/{Button-BJHtN7gh.js → Button-Dj1DIvXh.js} +3 -3
  7. package/dist/es/{Card-DJHkCmsz.js → Card-meh7F1e2.js} +1 -1
  8. package/dist/es/ChatBubble-Ccr3wzoK.js +9 -0
  9. package/dist/es/{Checkbox-DX8L3fyp.js → Checkbox-vOcwl1OX.js} +3 -3
  10. package/dist/es/{Collapse-Ir3V9CuO.js → Collapse-BG58s0uJ.js} +4 -4
  11. package/dist/es/{ConfigProvider-CsbSqwwi.js → ConfigProvider-Cr8Hpzf2.js} +2 -2
  12. package/dist/es/Diff-KQ44cDcY.js +64 -0
  13. package/dist/es/{Divider-C7PtODSK.js → Divider-CYYeUqYc.js} +1 -1
  14. package/dist/es/{Drawer-C2eVmvUp.js → Drawer-CDXFDfrf.js} +2 -2
  15. package/dist/es/{Dropdown-CVg_c2fB.js → Dropdown-CPZtzHPx.js} +9 -9
  16. package/dist/es/{FileInput-BE26BmXm.js → FileInput-Ram4-wy2.js} +3 -3
  17. package/dist/es/Filter-CLLkrn-W.js +40 -0
  18. package/dist/es/{Form-7lZt5ehf.js → Form-po3aIrSN.js} +62 -61
  19. package/dist/es/{Icon-BLDDdSU-.js → Icon-XJfGGAMY.js} +1 -1
  20. package/dist/es/{Indicator-B-en-MgG.js → Indicator-vsSp5r5K.js} +1 -1
  21. package/dist/es/{Input-C5HuVehE.js → Input-KrNqNZMe.js} +5 -5
  22. package/dist/es/Kbd-CtCGx7_s.js +13 -0
  23. package/dist/es/{Link-Av9RdcFv.js → Link-Bbwdgs74.js} +1 -1
  24. package/dist/es/{Loading-CBNDUWQd.js → Loading-DiyIiKxO.js} +3 -3
  25. package/dist/es/{Message-DgnyyuXn.js → Message-BoNCtMo7.js} +14 -14
  26. package/dist/es/{Notification-LYRXnVAf.js → Notification-CFY-yvRf.js} +13 -13
  27. package/dist/es/{Overlay-CpvMhnuU.js → Overlay-DoFA2lgP.js} +1 -1
  28. package/dist/es/Pixelate-dqwHc6nX.js +39 -0
  29. package/dist/es/{Popconfirm-DvxFdLrw.js → Popconfirm-DPOujyiA.js} +12 -12
  30. package/dist/es/{Progress-Bc5INMhJ.js → Progress-B0oYE8Z3.js} +1 -1
  31. package/dist/es/{Radio-263_rtRl.js → Radio-C-Ot7pLA.js} +3 -3
  32. package/dist/es/Resizable-G5KVHayx.js +151 -0
  33. package/dist/es/{Select-7ZxUCS8z.js → Select-DqxPeAKK.js} +14 -14
  34. package/dist/es/Skeleton-4SeKRKn9.js +15 -0
  35. package/dist/es/{Switch-DiCsMJT3.js → Switch-C_tBxZtT.js} +3 -3
  36. package/dist/es/{Table-BvA_xzDe.js → Table-Cr6HFL4_.js} +1 -1
  37. package/dist/es/{Tooltip-J3ji6weH.js → Tooltip-rak4BryQ.js} +3 -3
  38. package/dist/es/Validator-DKVfknvI.js +40 -0
  39. package/dist/es/{hooks-BqobYUzS.js → hooks-pTjI-j9o.js} +51 -53
  40. package/dist/es/index.js +119 -90
  41. package/dist/es/utils-DzOow9K9.js +155 -0
  42. package/dist/es/{vendor-DXmGx29U.js → vendor-DrBJKLFW.js} +254 -210
  43. package/dist/index.css +1 -1
  44. package/dist/{es/theme → theme}/Badge.css +151 -151
  45. package/dist/{es/theme → theme}/Button.css +92 -8
  46. package/dist/theme/ChatBubble.css +218 -0
  47. package/dist/{es/theme → theme}/Checkbox.css +138 -18
  48. package/dist/{es/theme → theme}/Collapse.css +96 -96
  49. package/dist/theme/Diff.css +110 -0
  50. package/dist/{es/theme → theme}/Divider.css +42 -3
  51. package/dist/{es/theme → theme}/Dropdown.css +2 -2
  52. package/dist/{es/theme → theme}/FileInput.css +32 -0
  53. package/dist/theme/Filter.css +598 -0
  54. package/dist/{es/theme → theme}/Input.css +414 -407
  55. package/dist/theme/Kbd.css +104 -0
  56. package/dist/{es/theme → theme}/Message.css +1 -1
  57. package/dist/{es/theme → theme}/Notification.css +44 -44
  58. package/dist/{es/theme → theme}/Radio.css +114 -48
  59. package/dist/theme/Resizable.css +95 -0
  60. package/dist/{es/theme → theme}/Select.css +198 -88
  61. package/dist/theme/Skeleton.css +192 -0
  62. package/dist/{es/theme → theme}/Switch.css +22 -3
  63. package/dist/theme/Validator.css +25 -0
  64. package/dist/types/components/ChatBubble/constants.d.ts +2 -0
  65. package/dist/types/components/ChatBubble/index.d.ts +27 -0
  66. package/dist/types/components/ChatBubble/types.d.ts +10 -0
  67. package/dist/types/components/Diff/constants.d.ts +4 -0
  68. package/dist/types/components/Diff/index.d.ts +67 -0
  69. package/dist/types/components/Diff/types.d.ts +29 -0
  70. package/dist/types/components/Dropdown/index.d.ts +3 -3
  71. package/dist/types/components/Filter/constants.d.ts +5 -0
  72. package/dist/types/components/Filter/index.d.ts +59 -0
  73. package/dist/types/components/Filter/types.d.ts +38 -0
  74. package/dist/types/components/Icon/index.d.ts +1 -0
  75. package/dist/types/components/Kbd/constants.d.ts +3 -0
  76. package/dist/types/components/Kbd/index.d.ts +24 -0
  77. package/dist/types/components/Kbd/types.d.ts +10 -0
  78. package/dist/types/components/Pixelate/index.d.ts +3 -3
  79. package/dist/types/components/Popconfirm/index.d.ts +3 -3
  80. package/dist/types/components/Resizable/constants.d.ts +3 -0
  81. package/dist/types/components/Resizable/index.d.ts +135 -0
  82. package/dist/types/components/Resizable/types.d.ts +52 -0
  83. package/dist/types/components/Select/index.d.ts +3 -3
  84. package/dist/types/components/Skeleton/index.d.ts +36 -0
  85. package/dist/types/components/Skeleton/types.d.ts +12 -0
  86. package/dist/types/components/Tooltip/index.d.ts +3 -3
  87. package/dist/types/components/Validator/index.d.ts +52 -0
  88. package/dist/types/components/Validator/types.d.ts +13 -0
  89. package/dist/types/components/index.d.ts +8 -1
  90. package/dist/types/core/index.d.ts +1 -1
  91. package/dist/types/hooks/index.d.ts +2 -0
  92. package/dist/types/hooks/useFocusController.d.ts +1 -1
  93. package/dist/types/utils/index.d.ts +1 -0
  94. package/dist/types/utils/pixelate.d.ts +10 -0
  95. package/dist/types/utils/style.d.ts +1 -0
  96. package/dist/umd/index.css +1 -1
  97. package/dist/umd/index.css.gz +0 -0
  98. package/dist/umd/index.umd.cjs +3 -3
  99. package/dist/umd/index.umd.cjs.gz +0 -0
  100. package/package.json +4 -4
  101. package/dist/es/Pixelate-BPypBgJU.js +0 -67
  102. package/dist/es/utils-BS5vsvlM.js +0 -101
  103. /package/dist/{es/theme → theme}/Alert.css +0 -0
  104. /package/dist/{es/theme → theme}/Avatar.css +0 -0
  105. /package/dist/{es/theme → theme}/Breadcrumb.css +0 -0
  106. /package/dist/{es/theme → theme}/Card.css +0 -0
  107. /package/dist/{es/theme → theme}/Drawer.css +0 -0
  108. /package/dist/{es/theme → theme}/Form.css +0 -0
  109. /package/dist/{es/theme → theme}/Icon.css +0 -0
  110. /package/dist/{es/theme → theme}/Indicator.css +0 -0
  111. /package/dist/{es/theme → theme}/Link.css +0 -0
  112. /package/dist/{es/theme → theme}/Loading.css +0 -0
  113. /package/dist/{es/theme → theme}/Overlay.css +0 -0
  114. /package/dist/{es/theme → theme}/Popconfirm.css +0 -0
  115. /package/dist/{es/theme → theme}/Progress.css +0 -0
  116. /package/dist/{es/theme → theme}/Table.css +0 -0
  117. /package/dist/{es/theme → theme}/Tooltip.css +0 -0
  118. /package/dist/{es/theme → theme}/fonts/zpix.woff2 +0 -0
  119. /package/dist/{es/theme → theme}/index.css +0 -0
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sakana-element",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "description": "A pixel-style Vue 3 component library, built with TypeScript and Vitest",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",
@@ -37,11 +37,11 @@
37
37
  "license": "ISC",
38
38
  "repository": {
39
39
  "type": "git",
40
- "url": "git+https://github.com/yu859/sakana-element.git"
40
+ "url": "git+https://github.com/SaKaNa-Y/sakana-element.git"
41
41
  },
42
- "homepage": "https://github.com/yu859/sakana-element#readme",
42
+ "homepage": "https://github.com/SaKaNa-Y/sakana-element#readme",
43
43
  "bugs": {
44
- "url": "https://github.com/yu859/sakana-element/issues"
44
+ "url": "https://github.com/SaKaNa-Y/sakana-element/issues"
45
45
  },
46
46
  "dependencies": {
47
47
  "@popperjs/core": "^2.11.8"
@@ -1,67 +0,0 @@
1
- import { w as e } from "./utils-BS5vsvlM.js";
2
- import { defineComponent as t, ref as n, computed as r, watch as a, createElementBlock as l, openBlock as i, normalizeStyle as o, createElementVNode as u } from "vue";
3
- const s = ["src"], h = e(t({ name: "PxPixelate", __name: "Pixelate", props: { src: {}, pixelSize: { default: 8 }, width: {}, height: {}, grayscale: { type: Boolean, default: false }, palette: {}, background: { default: "#FFFFFF" } }, emits: ["rendered", "error"], setup(e2, { expose: t2, emit: h2 }) {
4
- const c = e2, g = h2, d = n(), f = n(), p = n(false), m = r((() => {
5
- const e3 = {};
6
- return null != c.width && (e3.width = "number" == typeof c.width ? `${c.width}px` : c.width), null != c.height && (e3.height = "number" == typeof c.height ? `${c.height}px` : c.height), e3;
7
- })), y = r((() => {
8
- const e3 = { "image-rendering": "pixelated" };
9
- return null != c.width && (e3.width = "100%"), null != c.height && (e3.height = "100%"), e3;
10
- }));
11
- function v(e3, t3, n2, r2) {
12
- let a2 = 1 / 0, l2 = r2[0];
13
- for (const i2 of r2) {
14
- const r3 = (e3 - i2[0]) ** 2 + (t3 - i2[1]) ** 2 + (n2 - i2[2]) ** 2;
15
- r3 < a2 && (a2 = r3, l2 = i2);
16
- }
17
- return l2;
18
- }
19
- function x() {
20
- const e3 = d.value, t3 = f.value;
21
- if (!e3 || !t3 || !p.value) return;
22
- const n2 = e3.getContext("2d");
23
- if (!n2) return;
24
- const r2 = t3.naturalWidth, a2 = t3.naturalHeight;
25
- e3.width = r2, e3.height = a2, n2.fillStyle = c.background, n2.fillRect(0, 0, r2, a2), n2.drawImage(t3, 0, 0, r2, a2);
26
- const l2 = n2.getImageData(0, 0, r2, a2).data, i2 = Math.max(1, Math.round(c.pixelSize)), o2 = c.palette ? c.palette.map(((e4) => "string" == typeof e4 ? (function(e5) {
27
- const t4 = e5.replace("#", "");
28
- return [parseInt(t4.substring(0, 2), 16), parseInt(t4.substring(2, 4), 16), parseInt(t4.substring(4, 6), 16)];
29
- })(e4) : e4)) : null;
30
- n2.fillStyle = c.background, n2.fillRect(0, 0, r2, a2);
31
- for (let e4 = 0; e4 < a2; e4 += i2) for (let t4 = 0; t4 < r2; t4 += i2) {
32
- const u2 = Math.min(i2, r2 - t4), s2 = Math.min(i2, a2 - e4);
33
- let h3 = 0, g2 = 0, d2 = 0, f2 = 0;
34
- for (let n3 = 0; n3 < s2; n3++) for (let a3 = 0; a3 < u2; a3++) {
35
- const i3 = 4 * ((e4 + n3) * r2 + (t4 + a3));
36
- h3 += l2[i3], g2 += l2[i3 + 1], d2 += l2[i3 + 2], f2++;
37
- }
38
- let p2 = Math.round(h3 / f2), m2 = Math.round(g2 / f2), y2 = Math.round(d2 / f2);
39
- c.grayscale && (p2 = m2 = y2 = Math.round(0.299 * p2 + 0.587 * m2 + 0.114 * y2)), o2 && ([p2, m2, y2] = v(p2, m2, y2, o2)), n2.fillStyle = `rgb(${p2},${m2},${y2})`, n2.fillRect(t4, e4, u2, s2);
40
- }
41
- g("rendered");
42
- }
43
- function w() {
44
- p.value = true, x();
45
- }
46
- function b(e3) {
47
- g("error", e3);
48
- }
49
- return a((() => [c.pixelSize, c.grayscale, c.palette, c.background]), (() => {
50
- p.value && x();
51
- })), a((() => c.src), (() => {
52
- p.value = false;
53
- })), t2({ render: function() {
54
- x();
55
- }, canvasRef: d, originRef: f, getSize: function() {
56
- const e3 = d.value;
57
- return { width: (e3 == null ? void 0 : e3.width) ?? 0, height: (e3 == null ? void 0 : e3.height) ?? 0 };
58
- }, getImageData: function() {
59
- const e3 = d.value;
60
- if (!e3 || !p.value) return null;
61
- const t3 = e3.getContext("2d");
62
- return t3 ? t3.getImageData(0, 0, e3.width, e3.height) : null;
63
- } }), (e3, t3) => (i(), l("div", { class: "px-pixelate", style: o(m.value) }, [u("canvas", { ref_key: "canvasRef", ref: d, style: o(y.value) }, null, 4), u("img", { ref_key: "originRef", ref: f, src: e3.src, style: { display: "none" }, crossorigin: "anonymous", onLoad: w, onError: b }, null, 40, s)], 4));
64
- } }));
65
- export {
66
- h as P
67
- };
@@ -1,101 +0,0 @@
1
- import { h as e, d as o, y as r } from "./vendor-DXmGx29U.js";
2
- import { defineComponent as n } from "vue";
3
- function t(e2, o2) {
4
- const r2 = parseInt(e2.replace("#", ""), 16);
5
- return `#${(Math.max(0, (r2 >> 16) - Math.round(2.55 * o2)) << 16 | Math.max(0, (r2 >> 8 & 255) - Math.round(2.55 * o2)) << 8 | Math.max(0, (255 & r2) - Math.round(2.55 * o2))).toString(16).padStart(6, "0")}`;
6
- }
7
- function c(e2, o2) {
8
- const r2 = parseInt(e2.replace("#", ""), 16);
9
- return `#${(Math.min(255, (r2 >> 16) + Math.round(2.55 * o2)) << 16 | Math.min(255, (r2 >> 8 & 255) + Math.round(2.55 * o2)) << 8 | Math.min(255, (255 & r2) + Math.round(2.55 * o2))).toString(16).padStart(6, "0")}`;
10
- }
11
- function s(e2) {
12
- const o2 = parseInt(e2.replace("#", ""), 16);
13
- return (0.299 * (o2 >> 16) + 0.587 * (o2 >> 8 & 255) + 0.114 * (255 & o2)) / 255 > 0.6 ? "#1e1e2e" : "#ffffff";
14
- }
15
- function a(e2) {
16
- return { color: e2, dark: t(e2, 15), light: c(e2, 35), contrast: s(e2), transparent: "transparent" };
17
- }
18
- function i(e2, o2, r2) {
19
- const n2 = {};
20
- for (const [t2, c2] of Object.entries(r2)) n2[`--${o2}-${t2}`] = e2[c2];
21
- return n2;
22
- }
23
- const l = { outline: { "text-color": "color", "bg-color": "transparent", "border-color": "color", "shadow-color": "transparent" }, dash: { "text-color": "color", "bg-color": "light", "border-color": "color", "shadow-color": "transparent" }, default: { "text-color": "contrast", "bg-color": "color", "border-color": "dark", "shadow-color": "dark" } };
24
- function f(e2, o2) {
25
- }
26
- const u = { spinner: "loader", loading: "loader", "eye-slash": "eye-closed", "eye-off": "eye-closed", xmark: "close", x: "close", times: "close", "circle-xmark": "close-box", "x-circle": "close-box", "times-circle": "close-box", error: "close-box", "circle-info": "info-box", "info-circle": "info-box", info: "info-box", "check-circle": "check", "circle-check": "check", success: "check", "circle-exclamation": "warning-box", "exclamation-circle": "warning-box", warning: "warning-box", "angle-down": "chevron-down", "caret-down": "chevron-down", "angle-up": "chevron-up", "caret-up": "chevron-up", "angle-left": "chevron-left", "caret-left": "chevron-left", "angle-right": "chevron-right", "caret-right": "chevron-right", "question-circle": "info-box", "circle-question": "info-box", help: "info-box", question: "info-box", gear: "sliders", cog: "sliders", settings: "sliders", star: "bookmark", "star-solid": "bookmark" };
27
- function d(e2) {
28
- return e2 in u ? u[e2] : e2;
29
- }
30
- const h = /* @__PURE__ */ new Set(["svg", "path", "rect", "circle", "ellipse", "line", "polyline", "polygon", "g", "defs", "clipPath", "mask", "title", "desc", "linearGradient", "radialGradient", "stop", "symbol", "use"]), p = /^on/i, m = /^\s*javascript\s*:/i;
31
- function g(e2) {
32
- if (!e2 || "string" != typeof e2) return "";
33
- if ("undefined" == typeof DOMParser) return "";
34
- const o2 = new DOMParser().parseFromString(e2, "image/svg+xml");
35
- return o2.querySelector("parsererror") ? "" : (b(o2.documentElement), o2.documentElement.outerHTML);
36
- }
37
- function b(e2) {
38
- const o2 = Array.from(e2.children);
39
- for (const e3 of o2) {
40
- const o3 = e3.tagName.toLowerCase();
41
- if (h.has(o3)) {
42
- for (const o4 of Array.from(e3.attributes)) (p.test(o4.name) || "href" === o4.name && m.test(o4.value) || "xlink:href" === o4.name && m.test(o4.value)) && e3.removeAttribute(o4.name);
43
- b(e3);
44
- } else e3.remove();
45
- }
46
- }
47
- const x = /* @__PURE__ */ new Map();
48
- function v(e2) {
49
- for (const [o2, r2] of Object.entries(e2)) x.set(o2, g(r2));
50
- }
51
- function w(e2) {
52
- return x.get(e2);
53
- }
54
- const k = (e2) => (e2.install = (o2) => {
55
- const r2 = e2.name;
56
- o2.component(r2, e2);
57
- }, e2), y = (e2, o2) => (e2.install = (r2) => {
58
- r2.config.globalProperties[o2] = e2;
59
- }, e2);
60
- function M(e2, o2) {
61
- for (; e2.length >= o2; ) e2[0].props.onDestroy();
62
- }
63
- function N(e2) {
64
- let o2 = false, r2 = 0;
65
- const n2 = (o3) => {
66
- var _a;
67
- "Escape" === o3.code && ((_a = e2()) == null ? void 0 : _a.handler.close());
68
- };
69
- return { register() {
70
- r2++, o2 || (document.addEventListener("keydown", n2), o2 = true);
71
- }, unregister() {
72
- r2--, r2 <= 0 && (document.removeEventListener("keydown", n2), o2 = false, r2 = 0);
73
- } };
74
- }
75
- function S(r2, n2 = "px") {
76
- return r2 ? e(r2) || ((e2) => !!o(e2) && !Number.isNaN(Number(e2)))(r2) ? `${r2}${n2}` : o(r2) ? r2 : void 0 : "";
77
- }
78
- const O = /* @__PURE__ */ new Map([["info", "info-box"], ["success", "check"], ["warning", "warning-box"], ["danger", "close-box"], ["error", "close-box"]]), $ = n({ props: { vNode: { type: [String, Object, Function], required: true } }, setup: (e2) => () => r(e2.vNode) ? e2.vNode() : e2.vNode }), j = (e2, o2) => {
79
- const r2 = e2.__vccOpts || e2;
80
- for (const [e3, n2] of o2) r2[e3] = n2;
81
- return r2;
82
- };
83
- export {
84
- $ as R,
85
- l as S,
86
- j as _,
87
- d as a,
88
- v as b,
89
- a as c,
90
- f as d,
91
- S as e,
92
- M as f,
93
- w as g,
94
- N as h,
95
- y as i,
96
- c as l,
97
- i as r,
98
- g as s,
99
- O as t,
100
- k as w
101
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes