spicykatsu 0.0.2 → 0.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.
package/README.md CHANGED
@@ -1 +1,6 @@
1
- # SpicyKatsuLib
1
+ # SpicyKatsuLib
2
+
3
+ Fun, simple library for Vue3. Something for me to play around with in my projects.
4
+ The idea is to make things simple and lightweight. While keeping functionality.
5
+
6
+ Included will be componenets and utilites. Maybe more in the future.
@@ -1,8 +1,8 @@
1
- import { openBlock as n, createElementBlock as o, normalizeClass as f, normalizeStyle as b, toDisplayString as c, createCommentVNode as r, createElementVNode as m, renderSlot as v, ref as g, withDirectives as k, vModelText as C, mergeProps as B, withKeys as x, withModifiers as $, createBlock as V, Transition as I, withCtx as w } from "vue";
2
- const T = ["disabled"], A = {
1
+ import { openBlock as o, createElementBlock as r, normalizeClass as g, normalizeStyle as w, toDisplayString as c, createCommentVNode as s, createElementVNode as y, renderSlot as b, ref as h, withDirectives as M, vModelText as Y, mergeProps as k, withKeys as C, withModifiers as B, createBlock as I, Transition as T, withCtx as V } from "vue";
2
+ const x = ["disabled"], $ = {
3
3
  key: 0,
4
4
  class: "spicyBtnIcon"
5
- }, D = {
5
+ }, X = {
6
6
  __name: "SpicyBtn",
7
7
  props: {
8
8
  variant: {
@@ -34,22 +34,22 @@ const T = ["disabled"], A = {
34
34
  }
35
35
  },
36
36
  emits: ["click"],
37
- setup(e, { emit: i }) {
38
- return (t, l) => (n(), o("button", {
39
- class: f(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
40
- style: b({ "--color": e.color, "--textColor": e.textColor, "--hoverColor": e.hoverColor }),
37
+ setup(e, { emit: t }) {
38
+ return (n, a) => (o(), r("button", {
39
+ class: g(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
40
+ style: w({ "--color": e.color, "--textColor": e.textColor, "--hoverColor": e.hoverColor }),
41
41
  disabled: e.disabled,
42
- onClick: l[0] || (l[0] = (...a) => t.onClick && t.onClick(...a))
42
+ onClick: a[0] || (a[0] = (...l) => n.onClick && n.onClick(...l))
43
43
  }, [
44
- e.icon ? (n(), o("span", A, c(e.icon), 1)) : r("", !0),
45
- m("span", null, c(e.text), 1),
46
- v(t.$slots, "default")
47
- ], 14, T));
44
+ e.icon ? (o(), r("span", $, c(e.icon), 1)) : s("", !0),
45
+ y("span", null, c(e.text), 1),
46
+ b(n.$slots, "default")
47
+ ], 14, x));
48
48
  }
49
- }, N = ["placeholder"], z = {
49
+ }, F = ["placeholder"], O = {
50
50
  key: 0,
51
51
  class: "spicyInputError"
52
- }, W = {
52
+ }, Z = {
53
53
  __name: "SpicyLabel",
54
54
  props: {
55
55
  value: {
@@ -75,68 +75,68 @@ const T = ["disabled"], A = {
75
75
  }
76
76
  },
77
77
  setup(e) {
78
- const i = e, t = `spicyInput-${d()}`, l = g(i.value), a = g(!1);
78
+ const t = e, n = `spicyInput-${d()}`, a = h(t.value), l = h(!1);
79
79
  function d() {
80
- const s = "0123456789abcdefghijklmnopqrstuvwxyz";
80
+ const i = "0123456789abcdefghijklmnopqrstuvwxyz";
81
81
  let u = "";
82
- for (let y = 0; y < 6; y++)
83
- u += s.charAt(Math.floor(Math.random() * s.length));
82
+ for (let f = 0; f < 6; f++)
83
+ u += i.charAt(Math.floor(Math.random() * i.length));
84
84
  return u;
85
85
  }
86
- const h = (s) => {
87
- l.value = s.target.value;
88
- }, p = () => {
89
- a.value = !1;
86
+ const p = (i) => {
87
+ a.value = i.target.value;
90
88
  }, S = () => {
91
- a.value = !0;
89
+ l.value = !1;
90
+ }, D = () => {
91
+ l.value = !0;
92
92
  };
93
- return (s, u) => (n(), o("div", {
94
- class: f(["spicyInputWrapper", [e.variant, { hasValue: l.value || e.value, hasFocus: a.value, hasError: e.error }]])
93
+ return (i, u) => (o(), r("div", {
94
+ class: g(["spicyInputWrapper", [e.variant, { hasValue: a.value || e.value, hasFocus: l.value, hasError: e.error }]])
95
95
  }, [
96
- m("label", {
96
+ y("label", {
97
97
  class: "spicyInputLabel",
98
- for: t
98
+ for: n
99
99
  }, c(e.label), 1),
100
- k(m("input", {
101
- id: t,
102
- class: f(["spicyInput", e.variant]),
103
- "onUpdate:modelValue": u[0] || (u[0] = (y) => l.value = y),
100
+ M(y("input", {
101
+ id: n,
102
+ class: g(["spicyInput", e.variant]),
103
+ "onUpdate:modelValue": u[0] || (u[0] = (f) => a.value = f),
104
104
  placeholder: e.placeholder,
105
- onInput: h,
106
- onBlur: p,
107
- onFocus: S
108
- }, null, 42, N), [
109
- [C, l.value]
105
+ onInput: p,
106
+ onBlur: S,
107
+ onFocus: D
108
+ }, null, 42, F), [
109
+ [Y, a.value]
110
110
  ]),
111
- v(s.$slots, "default"),
112
- e.error ? (n(), o("span", z, c(e.error), 1)) : r("", !0)
111
+ b(i.$slots, "default"),
112
+ e.error ? (o(), r("span", O, c(e.error), 1)) : s("", !0)
113
113
  ], 2));
114
114
  }
115
- }, E = ["aria-checked", "onKeydown"], F = /* @__PURE__ */ m("div", { class: "spicyToggleKnob" }, null, -1), K = [
116
- F
117
- ], j = {
115
+ }, j = ["aria-checked", "onKeydown"], U = /* @__PURE__ */ y("div", { class: "spicyToggleKnob" }, null, -1), L = [
116
+ U
117
+ ], _ = {
118
118
  __name: "SpicyToggle",
119
119
  props: {
120
120
  modelValue: Boolean
121
121
  },
122
122
  emits: ["update:modelValue"],
123
- setup(e, { emit: i }) {
124
- const t = e, l = i, a = () => {
125
- l("update:modelValue", !t.modelValue);
123
+ setup(e, { emit: t }) {
124
+ const n = e, a = t, l = () => {
125
+ a("update:modelValue", !n.modelValue);
126
126
  };
127
- return (d, h) => (n(), o("div", B({
127
+ return (d, p) => (o(), r("div", k({
128
128
  class: ["spicyToggle", { "is-active": e.modelValue }],
129
- onClick: a,
129
+ onClick: l,
130
130
  role: "switch",
131
131
  "aria-checked": e.modelValue.toString(),
132
132
  tabindex: "0",
133
- onKeydown: x($(a, ["prevent"]), ["space"])
134
- }, d.$attrs), K, 16, E));
133
+ onKeydown: C(B(l, ["prevent"]), ["space"])
134
+ }, d.$attrs), L, 16, j));
135
135
  }
136
- }, L = {
136
+ }, N = {
137
137
  key: 0,
138
138
  class: "spicyAlertIcon"
139
- }, M = { key: 1 }, q = {
139
+ }, A = { key: 1 }, ee = {
140
140
  __name: "SpicyAlert",
141
141
  props: {
142
142
  variant: {
@@ -160,33 +160,116 @@ const T = ["disabled"], A = {
160
160
  }
161
161
  },
162
162
  setup(e) {
163
- const i = e, t = g(!0), l = () => {
164
- t.value = !1;
163
+ const t = e, n = h(!0), a = () => {
164
+ n.value = !1;
165
165
  };
166
- return i.autoClose > 0 && setTimeout(() => {
167
- t.value = !1;
168
- }, i.autoClose), (a, d) => (n(), V(I, { name: "fade" }, {
169
- default: w(() => [
170
- t.value ? (n(), o("div", {
166
+ return t.autoClose > 0 && setTimeout(() => {
167
+ n.value = !1;
168
+ }, t.autoClose), (l, d) => (o(), I(T, { name: "fade" }, {
169
+ default: V(() => [
170
+ n.value ? (o(), r("div", {
171
171
  key: 0,
172
- class: f(["spicyAlert", e.variant])
172
+ class: g(["spicyAlert", e.variant])
173
173
  }, [
174
- e.iconOnly || e.text ? (n(), o("span", L, c(e.icon), 1)) : r("", !0),
175
- !e.iconOnly && e.text ? (n(), o("span", M, c(e.text), 1)) : r("", !0),
176
- e.closable ? (n(), o("button", {
174
+ e.iconOnly || e.text ? (o(), r("span", N, c(e.icon), 1)) : s("", !0),
175
+ !e.iconOnly && e.text ? (o(), r("span", A, c(e.text), 1)) : s("", !0),
176
+ e.closable ? (o(), r("button", {
177
177
  key: 2,
178
178
  class: "closeButton",
179
- onClick: l
180
- }, "×")) : r("", !0)
181
- ], 2)) : r("", !0)
179
+ onClick: a
180
+ }, "×")) : s("", !0)
181
+ ], 2)) : s("", !0)
182
182
  ]),
183
183
  _: 1
184
184
  }));
185
185
  }
186
186
  };
187
+ function m(e) {
188
+ try {
189
+ return new URL(e), !0;
190
+ } catch (t) {
191
+ return console.error("Invalid URL:", t), !1;
192
+ }
193
+ }
194
+ function P(e) {
195
+ return m(e) ? new URL(e).hostname : null;
196
+ }
197
+ function z(e, t) {
198
+ if (!m(e))
199
+ return e;
200
+ const n = new URL(e);
201
+ return Object.keys(t).forEach((a) => n.searchParams.append(a, t[a])), n.toString();
202
+ }
203
+ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
204
+ __proto__: null,
205
+ appendParamsToUrl: z,
206
+ getHostname: P,
207
+ isUrlValid: m
208
+ }, Symbol.toStringTag, { value: "Module" }));
209
+ function v(e, t) {
210
+ const n = {
211
+ YYYY: () => e.getFullYear().toString(),
212
+ MM: () => (e.getMonth() + 1).toString().padStart(2, "0"),
213
+ DD: () => e.getDate().toString().padStart(2, "0")
214
+ };
215
+ return t.replace(
216
+ /YYYY|MM|DD/g,
217
+ (a) => n[a]()
218
+ );
219
+ }
220
+ function E(e) {
221
+ const [t, n, a] = e.split("-");
222
+ return new Date(Number(t), Number(n) - 1, Number(a));
223
+ }
224
+ function K(e, t) {
225
+ const n = Math.abs(t.getTime() - e.getTime());
226
+ return Math.ceil(n / (1e3 * 60 * 60 * 24));
227
+ }
228
+ function R(e, t) {
229
+ const n = new Date(e);
230
+ return n.setDate(e.getDate() + t), n;
231
+ }
232
+ function W(e, t) {
233
+ const n = new Date(e);
234
+ return n.setDate(e.getDate() - t), n;
235
+ }
236
+ function q(e) {
237
+ const t = /* @__PURE__ */ new Date();
238
+ return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
239
+ }
240
+ function H(e) {
241
+ const t = /* @__PURE__ */ new Date();
242
+ return t.setDate(t.getDate() - 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
243
+ }
244
+ function G(e) {
245
+ const t = /* @__PURE__ */ new Date();
246
+ return t.setDate(t.getDate() + 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
247
+ }
248
+ function J(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
249
+ if (typeof e != "string" || typeof t != "object" || !t.hasOwnProperty("show") || typeof t.show != "boolean")
250
+ throw new Error(
251
+ 'Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.'
252
+ );
253
+ let a = v(/* @__PURE__ */ new Date(), e);
254
+ return t.separator && t.separator !== "-" && (a = a.replace(/-/g, t.separator)), t.show ? { value: a, isVisible: !0 } : { value: a, isVisible: !1 };
255
+ }
256
+ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
257
+ __proto__: null,
258
+ currentDate: J,
259
+ dateAdd: R,
260
+ dateDiff: K,
261
+ dateIsToday: q,
262
+ dateIsTomorrow: G,
263
+ dateIsYesterday: H,
264
+ dateSubtract: W,
265
+ formatDate: v,
266
+ parseDate: E
267
+ }, Symbol.toStringTag, { value: "Module" }));
187
268
  export {
188
- q as SpicyAlert,
189
- D as SpicyBtn,
190
- W as SpicyLabel,
191
- j as SpicyToggle
269
+ ee as SpicyAlert,
270
+ X as SpicyBtn,
271
+ Z as SpicyLabel,
272
+ _ as SpicyToggle,
273
+ ne as dateUtils,
274
+ te as urlUtils
192
275
  };
@@ -1 +1 @@
1
- (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.SpicyKatsu={},o.Vue))})(this,function(o,e){"use strict";const m=["disabled"],y={key:0,class:"spicyBtnIcon"},f={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,color:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(t,{emit:i}){return(l,n)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["spicyBtn",{outlined:t.variant==="outlined",disabled:t.disabled}]),style:e.normalizeStyle({"--color":t.color,"--textColor":t.textColor,"--hoverColor":t.hoverColor}),disabled:t.disabled,onClick:n[0]||(n[0]=(...a)=>l.onClick&&l.onClick(...a))},[t.icon?(e.openBlock(),e.createElementBlock("span",y,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.text),1),e.renderSlot(l.$slots,"default")],14,m))}},p=["placeholder"],g={key:0,class:"spicyInputError"},h={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:"Label"},error:{type:String,default:""},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)}},setup(t){const i=t,l=`spicyInput-${s()}`,n=e.ref(i.value),a=e.ref(!1);function s(){const c="0123456789abcdefghijklmnopqrstuvwxyz";let r="";for(let d=0;d<6;d++)r+=c.charAt(Math.floor(Math.random()*c.length));return r}const u=c=>{n.value=c.target.value},E=()=>{a.value=!1},$=()=>{a.value=!0};return(c,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyInputWrapper",[t.variant,{hasValue:n.value||t.value,hasFocus:a.value,hasError:t.error}]])},[e.createElementVNode("label",{class:"spicyInputLabel",for:l},e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("input",{id:l,class:e.normalizeClass(["spicyInput",t.variant]),"onUpdate:modelValue":r[0]||(r[0]=d=>n.value=d),placeholder:t.placeholder,onInput:u,onBlur:E,onFocus:$},null,42,p),[[e.vModelText,n.value]]),e.renderSlot(c.$slots,"default"),t.error?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}},S=["aria-checked","onKeydown"],k=[e.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],B={__name:"SpicyToggle",props:{modelValue:Boolean},emits:["update:modelValue"],setup(t,{emit:i}){const l=t,n=i,a=()=>{n("update:modelValue",!l.modelValue)};return(s,u)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["spicyToggle",{"is-active":t.modelValue}],onClick:a,role:"switch","aria-checked":t.modelValue.toString(),tabindex:"0",onKeydown:e.withKeys(e.withModifiers(a,["prevent"]),["space"])},s.$attrs),k,16,S))}},b={key:0,class:"spicyAlertIcon"},C={key:1},V={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:t=>["info","success","warning","error","custom"].includes(t)},text:{type:String,default:""},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(t){const i=t,l=e.ref(!0),n=()=>{l.value=!1};return i.autoClose>0&&setTimeout(()=>{l.value=!1},i.autoClose),(a,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyAlert",t.variant])},[t.iconOnly||t.text?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),!t.iconOnly&&t.text?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,class:"closeButton",onClick:n},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}))}};o.SpicyAlert=V,o.SpicyBtn=f,o.SpicyLabel=h,o.SpicyToggle=B,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.SpicyKatsu={},l.Vue))})(this,function(l,t){"use strict";const m=["disabled"],y={key:0,class:"spicyBtnIcon"},p={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,color:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(e,{emit:n}){return(o,a)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["spicyBtn",{outlined:e.variant==="outlined",disabled:e.disabled}]),style:t.normalizeStyle({"--color":e.color,"--textColor":e.textColor,"--hoverColor":e.hoverColor}),disabled:e.disabled,onClick:a[0]||(a[0]=(...r)=>o.onClick&&o.onClick(...r))},[e.icon?(t.openBlock(),t.createElementBlock("span",y,t.toDisplayString(e.icon),1)):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(e.text),1),t.renderSlot(o.$slots,"default")],14,m))}},h=["placeholder"],S={key:0,class:"spicyInputError"},b={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:"Label"},error:{type:String,default:""},variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)}},setup(e){const n=e,o=`spicyInput-${s()}`,a=t.ref(n.value),r=t.ref(!1);function s(){const i="0123456789abcdefghijklmnopqrstuvwxyz";let c="";for(let d=0;d<6;d++)c+=i.charAt(Math.floor(Math.random()*i.length));return c}const g=i=>{a.value=i.target.value},z=()=>{r.value=!1},L=()=>{r.value=!0};return(i,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["spicyInputWrapper",[e.variant,{hasValue:a.value||e.value,hasFocus:r.value,hasError:e.error}]])},[t.createElementVNode("label",{class:"spicyInputLabel",for:o},t.toDisplayString(e.label),1),t.withDirectives(t.createElementVNode("input",{id:o,class:t.normalizeClass(["spicyInput",e.variant]),"onUpdate:modelValue":c[0]||(c[0]=d=>a.value=d),placeholder:e.placeholder,onInput:g,onBlur:z,onFocus:L},null,42,h),[[t.vModelText,a.value]]),t.renderSlot(i.$slots,"default"),e.error?(t.openBlock(),t.createElementBlock("span",S,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)],2))}},D=["aria-checked","onKeydown"],k=[t.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],w={__name:"SpicyToggle",props:{modelValue:Boolean},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,r=()=>{a("update:modelValue",!o.modelValue)};return(s,g)=>(t.openBlock(),t.createElementBlock("div",t.mergeProps({class:["spicyToggle",{"is-active":e.modelValue}],onClick:r,role:"switch","aria-checked":e.modelValue.toString(),tabindex:"0",onKeydown:t.withKeys(t.withModifiers(r,["prevent"]),["space"])},s.$attrs),k,16,D))}},B={key:0,class:"spicyAlertIcon"},C={key:1},V={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:e=>["info","success","warning","error","custom"].includes(e)},text:{type:String,default:""},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(e){const n=e,o=t.ref(!0),a=()=>{o.value=!1};return n.autoClose>0&&setTimeout(()=>{o.value=!1},n.autoClose),(r,s)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade"},{default:t.withCtx(()=>[o.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["spicyAlert",e.variant])},[e.iconOnly||e.text?(t.openBlock(),t.createElementBlock("span",B,t.toDisplayString(e.icon),1)):t.createCommentVNode("",!0),!e.iconOnly&&e.text?(t.openBlock(),t.createElementBlock("span",C,t.toDisplayString(e.text),1)):t.createCommentVNode("",!0),e.closable?(t.openBlock(),t.createElementBlock("button",{key:2,class:"closeButton",onClick:a},"×")):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0)]),_:1}))}};function u(e){try{return new URL(e),!0}catch(n){return console.error("Invalid URL:",n),!1}}function M(e){return u(e)?new URL(e).hostname:null}function Y(e,n){if(!u(e))return e;const o=new URL(e);return Object.keys(n).forEach(a=>o.searchParams.append(a,n[a])),o.toString()}const T=Object.freeze(Object.defineProperty({__proto__:null,appendParamsToUrl:Y,getHostname:M,isUrlValid:u},Symbol.toStringTag,{value:"Module"}));function f(e,n){const o={YYYY:()=>e.getFullYear().toString(),MM:()=>(e.getMonth()+1).toString().padStart(2,"0"),DD:()=>e.getDate().toString().padStart(2,"0")};return n.replace(/YYYY|MM|DD/g,a=>o[a]())}function E(e){const[n,o,a]=e.split("-");return new Date(Number(n),Number(o)-1,Number(a))}function N(e,n){const o=Math.abs(n.getTime()-e.getTime());return Math.ceil(o/(1e3*60*60*24))}function I(e,n){const o=new Date(e);return o.setDate(e.getDate()+n),o}function $(e,n){const o=new Date(e);return o.setDate(e.getDate()-n),o}function j(e){const n=new Date;return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}function F(e){const n=new Date;return n.setDate(n.getDate()-1),e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}function O(e){const n=new Date;return n.setDate(n.getDate()+1),e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}function U(e="YYYY-MM-DD",n={show:!0,separator:"-"}){if(typeof e!="string"||typeof n!="object"||!n.hasOwnProperty("show")||typeof n.show!="boolean")throw new Error('Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.');let a=f(new Date,e);return n.separator&&n.separator!=="-"&&(a=a.replace(/-/g,n.separator)),n.show?{value:a,isVisible:!0}:{value:a,isVisible:!1}}const x=Object.freeze(Object.defineProperty({__proto__:null,currentDate:U,dateAdd:I,dateDiff:N,dateIsToday:j,dateIsTomorrow:O,dateIsYesterday:F,dateSubtract:$,formatDate:f,parseDate:E},Symbol.toStringTag,{value:"Module"}));l.SpicyAlert=V,l.SpicyBtn=p,l.SpicyLabel=b,l.SpicyToggle=w,l.dateUtils=x,l.urlUtils=T,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .spicyBtn{padding:8px 16px;background-color:var(--color, var(--primaryColor));border:none;border-radius:4px;color:var(--textColor);cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--borderColor);color:#424242}.spicyBtn.disabled{opacity:.5;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:#616161}.spicyBtn.outlined:hover:not(.disabled){background-color:#424242;color:var(--textColor)}.spicyBtnIcon{margin-right:6px}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor);transition:top .25s,font-size .25s,color .25s;pointer-events:none;font-size:18px;background-color:transparent}.spicyInput{padding:20px 16px 8px;border:none;border-bottom:1px solid var(--borderColor);font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor)}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--labelFocus)}.outlined .spicyInput{border:1px solid var(--borderColor);border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--borderColor)}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-16px;font-size:16px;color:var(--labelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px;margin-top:4px}.spicyToggle{width:50px;height:24px;background-color:var(--borderColor);border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--primaryColor)}.spicyToggleKnob{width:20px;height:20px;background-color:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 2px 4px #0003}.spicyToggle.is-active .spicyToggleKnob{transform:translate(26px)}.spicyToggle:focus{outline:none;box-shadow:0 0 0 2px #5e138180}.fade-enter-active,.fade-leave-active{transition:opacity .5s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.info{background-color:#e0e0e0;color:#333}.success{background-color:#d4edda;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyAlertIcon{margin-right:8px}.closeButton{margin-left:auto;background:none;border:none;cursor:pointer}:root{--primaryColor: #5e1381;--primaryColorHover: #811faf;--errorColor: #ff0000;--borderColor: #ccc;--textColor: #ddd;--disabledOpacity: .5;--labelFocus: var(--primaryColor);--fontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--fontSize: 14px;--fontWeight: 500;--borderWidth: 2px;--borderRadius: 4px}.spicyText{color:var(--textColor);font-family:var(--fontFamily);font-size:var(--fontSize);font-weight:var(--fontWeight)}
1
+ .spicyBtn{padding:8px 16px;background-color:var(--color, var(--primaryColor));border:none;border-radius:4px;color:var(--textColor);cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--borderColor);color:#424242}.spicyBtn.disabled{opacity:.5;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor, grey)}.spicyBtn.outlined:hover:not(.disabled){background-color:var(--hoverColor, grey);color:var(--textColor)}.spicyBtnIcon{margin-right:6px}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor);transition:top .25s,font-size .25s,color .25s;pointer-events:none;font-size:18px;background-color:transparent}.spicyInput{padding:20px 16px 8px;border:none;border-bottom:1px solid var(--borderColor);font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor)}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--labelFocus)}.outlined .spicyInput{border:1px solid var(--borderColor);border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--borderColor)}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-16px;font-size:16px;color:var(--labelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px;margin-top:4px}.spicyToggle{width:50px;height:24px;background-color:var(--borderColor);border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--primaryColor)}.spicyToggleKnob{width:20px;height:20px;background-color:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 2px 4px #0003}.spicyToggle.is-active .spicyToggleKnob{transform:translate(26px)}.spicyToggle:focus{outline:none;box-shadow:0 0 0 2px #5e138180}.fade-enter-active,.fade-leave-active{transition:opacity .5s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.info{background-color:#e0e0e0;color:#333}.success{background-color:#d4edda;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyAlertIcon{margin-right:8px}.closeButton{margin-left:auto;background:none;border:none;cursor:pointer}:root{--primaryColor: #5e1381;--primaryColorHover: #811faf;--errorColor: #ff0000;--borderColor: #ccc;--textColor: #ddd;--disabledOpacity: .5;--labelFocus: var(--primaryColor);--fontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--fontSize: 14px;--fontWeight: 500;--borderWidth: 2px;--borderRadius: 4px}.spicyText{color:var(--textColor);font-family:var(--fontFamily);font-size:var(--fontSize);font-weight:var(--fontWeight)}.spicyHeader{color:var(--textColor);font-family:var(--fontFamily);font-size:24px;font-weight:700}
package/package.json CHANGED
@@ -1,17 +1,21 @@
1
1
  {
2
2
  "name": "spicykatsu",
3
- "description": "Comp Library for Vue",
3
+ "description": "Simple Library for Vue3.",
4
4
  "license": "MIT",
5
5
  "author": "Sato",
6
6
  "private": false,
7
- "version": "0.0.2",
8
- "files": ["dist/", "package.json", "README.md"],
7
+ "version": "0.0.3",
8
+ "files": [
9
+ "dist/",
10
+ "package.json",
11
+ "README.md"
12
+ ],
9
13
  "type": "module",
10
14
  "main": "dist/spicykatsu.es.js",
11
15
  "scripts": {
12
16
  "dev": "vite",
13
17
  "build": "vue-tsc && vite build",
14
- "preview": "vite preview",
18
+ "publish": "npm publish",
15
19
  "docs:dev": "vitepress dev docs",
16
20
  "test": "jest"
17
21
  },
@@ -20,9 +24,8 @@
20
24
  },
21
25
  "devDependencies": {
22
26
  "@vitejs/plugin-vue": "^5.0.4",
23
- "typescript": "^5.2.2",
24
- "vite": "^5.2.0",
25
- "vitepress": "^1.0.1",
26
- "vue-tsc": "^2.0.6"
27
+ "typescript": "^5.4.4",
28
+ "vite": "^5.2.8",
29
+ "vue-tsc": "^2.0.10"
27
30
  }
28
31
  }