melonykit 1.8.2 → 1.9.0

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,4 +1,4 @@
1
- import { a as e } from "./functions-BD3ZVwwW.js";
1
+ import { a as e } from "./functions-mQlYMSp2.js";
2
2
  import { signal as t } from "@preact/signals";
3
3
  import { useEffect as n, useMemo as r } from "preact/hooks";
4
4
  // src/browser/_route-to.js
package/dist/browser.js CHANGED
@@ -1 +1 @@
1
- export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-Bu2EkIKI.js";
1
+ export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-BhVmije8.js";
@@ -241,47 +241,51 @@ var v = (e) => {
241
241
  let c = /* @__PURE__ */ new Date();
242
242
  return c.setDate(c[r + "Date"]() + 1), o[r + "FullYear"]() === e && o[r + "Month"]() === t && o[r + "Date"]() === n ? a ? "Tdy" : "Today" : s[r + "FullYear"]() === e && s[r + "Month"]() === t && s[r + "Date"]() === n ? a ? "Ysd" : "Yesterday" : c[r + "FullYear"]() === e && c[r + "Month"]() === t && c[r + "Date"]() === n ? a ? "Tmw" : "Tomorrow" : i;
243
243
  };
244
- // src/functions/checks/_is-nil.js
244
+ // src/functions/checks/_is-boolean.js
245
245
  function S(e) {
246
+ return typeof e == "boolean";
247
+ }
248
+ // src/functions/checks/_is-nil.js
249
+ function C(e) {
246
250
  return e == null;
247
251
  }
248
252
  // src/functions/checks/_is-object.js
249
- function C(e) {
250
- return !S(e) && typeof e == "object" && !a(e);
253
+ function w(e) {
254
+ return !C(e) && typeof e == "object" && !a(e);
251
255
  }
252
256
  // src/functions/checks/_is-empty-object.js
253
- function w(e) {
254
- return C(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
257
+ function T(e) {
258
+ return w(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
255
259
  }
256
260
  // src/functions/checks/_is-empty-string.js
257
- function T(e) {
261
+ function E(e) {
258
262
  return t(e) && e.trim().length === 0;
259
263
  }
260
264
  // src/functions/checks/_is-float.js
261
- function E(e) {
265
+ function D(e) {
262
266
  return c(e) && !Number.isInteger(e);
263
267
  }
264
268
  // src/functions/checks/_is-integer.js
265
- function D(e) {
269
+ function O(e) {
266
270
  return Number.isInteger(e);
267
271
  }
268
272
  // src/functions/_kebab-case-to-camel-case.js
269
- function O(e) {
273
+ function k(e) {
270
274
  return t(e) ? e.split("-").filter(Boolean).map((e, t) => t === 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join("") : "";
271
275
  }
272
276
  // src/functions/_kebab-case-to-title-case.js
273
- function k(e) {
277
+ function A(e) {
274
278
  return t(e) ? e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
275
279
  }
276
280
  // src/functions/_median.js
277
- function A(e) {
281
+ function j(e) {
278
282
  if (!Array.isArray(e) || e.length === 0) return null;
279
283
  for (let t of e) if (!Number.isFinite(t)) return null;
280
284
  let t = [...e].sort((e, t) => e - t), n = Math.floor(t.length / 2);
281
285
  return t.length % 2 == 0 ? (t[n - 1] + t[n]) / 2 : t[n];
282
286
  }
283
287
  // src/functions/_request.js
284
- async function j({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
288
+ async function M({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
285
289
  let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
286
290
  method: n,
287
291
  headers: {
@@ -301,26 +305,26 @@ async function j({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
301
305
  return a.ok || (s.error = s.data ?? /* @__PURE__ */ Error(`Request failed with status ${a.status}.`)), s;
302
306
  }
303
307
  // src/functions/_risk-reward.js
304
- function M(e = {}) {
308
+ function N(e = {}) {
305
309
  let { entry: t, exit: n, riskRatio: r = 20 } = e ?? {};
306
310
  if (!c(t) || t <= 0 || !c(n) || n <= 0 || !c(r) || r <= 0) return null;
307
311
  let i = (n - t) / t / (r / 100);
308
312
  return Math.round(i * 10) / 10;
309
313
  }
310
314
  // src/functions/_size.js
311
- function N(e) {
315
+ function P(e) {
312
316
  return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
313
317
  }
314
318
  // src/functions/_slugify.js
315
- function P(e) {
319
+ function F(e) {
316
320
  return typeof e == "string" ? e.trim().toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/æ/g, "ae").replace(/œ/g, "oe").replace(/ø/g, "o").normalize("NFD").replace(/\p{Diacritic}/gu, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") : "";
317
321
  }
318
322
  // src/functions/_to-number.js
319
- function F(e, t = null) {
323
+ function I(e, t = null) {
320
324
  let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
321
325
  if (!Number.isFinite(n)) return null;
322
326
  if (t == null) return n;
323
327
  let r = 10 ** t;
324
328
  return Math.round(n * r) / r;
325
329
  }
326
- export { n as C, i as S, e as T, l as _, j as a, o as b, O as c, T as d, w as f, u as g, _ as h, M as i, D as l, S as m, P as n, A as o, C as p, N as r, k as s, F as t, E as u, c as v, t as w, a as x, s as y };
330
+ export { i as C, e as E, a as S, t as T, u as _, M as a, s as b, k as c, E as d, T as f, _ as g, S as h, N as i, O as l, C as m, F as n, j as o, w as p, P as r, A as s, I as t, D as u, l as v, n as w, o as x, c as y };
package/dist/functions.js CHANGED
@@ -1 +1 @@
1
- export { T as average, C as camelCaseToTitleCase, S as convertHexToRgba, _ as createCache, g as darkenHexColor, h as formatDate, x as isArray, b as isEmptyArray, f as isEmptyObject, d as isEmptyString, u as isFloat, y as isFunction, l as isInteger, m as isNil, v as isNumber, p as isObject, w as isString, c as kebabCaseToCamelCase, s as kebabCaseToTitleCase, o as median, a as request, i as riskReward, r as size, n as slugify, t as toNumber } from "./functions-BD3ZVwwW.js";
1
+ export { E as average, w as camelCaseToTitleCase, C as convertHexToRgba, v as createCache, _ as darkenHexColor, g as formatDate, S as isArray, h as isBoolean, x as isEmptyArray, f as isEmptyObject, d as isEmptyString, u as isFloat, b as isFunction, l as isInteger, m as isNil, y as isNumber, p as isObject, T as isString, c as kebabCaseToCamelCase, s as kebabCaseToTitleCase, o as median, a as request, i as riskReward, r as size, n as slugify, t as toNumber } from "./functions-mQlYMSp2.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { d as e, g as t, n } from "./functions-BD3ZVwwW.js";
2
- import { n as r, t as i } from "./browser-Bu2EkIKI.js";
1
+ import { _ as e, d as t, n } from "./functions-mQlYMSp2.js";
2
+ import { n as r, t as i } from "./browser-BhVmije8.js";
3
3
  import { useSignal as a } from "@preact/signals";
4
4
  import { useEffect as o, useId as s, useRef as c } from "preact/hooks";
5
5
  import { Fragment as l, jsx as u, jsxs as d } from "preact/jsx-runtime";
@@ -1131,7 +1131,7 @@ var Nt = xt`
1131
1131
  `,
1132
1132
  secondary: O`
1133
1133
  color: ${k.colors.fore.primary};
1134
- border-color: ${t(k.colors.secondary, .2)};
1134
+ border-color: ${e(k.colors.secondary, .2)};
1135
1135
  background-color: ${k.colors.secondary};
1136
1136
  `,
1137
1137
  neutral: O`
@@ -1636,15 +1636,15 @@ var Xt = {
1636
1636
  transition: width .3s ease;
1637
1637
  `,
1638
1638
  normal: O`
1639
- border: solid 1px ${t(k.colors.primary, .3)};
1639
+ border: solid 1px ${e(k.colors.primary, .3)};
1640
1640
  background-color: ${k.colors.primary};
1641
1641
  `,
1642
1642
  warn: O`
1643
- border: solid 1px ${t(k.colors.secondary, .2)};
1643
+ border: solid 1px ${e(k.colors.secondary, .2)};
1644
1644
  background-color: ${k.colors.secondary};
1645
1645
  `,
1646
1646
  danger: O`
1647
- border: solid 1px ${t(k.colors.danger, .3)};
1647
+ border: solid 1px ${e(k.colors.danger, .3)};
1648
1648
  background-color: ${k.colors.danger};
1649
1649
  `
1650
1650
  };
@@ -2016,7 +2016,7 @@ var un = {
2016
2016
  height: 1rem;
2017
2017
  margin-top: -.375rem;
2018
2018
  border-radius: 50%;
2019
- border: solid 1px ${t(k.colors.primary, .3)};
2019
+ border: solid 1px ${e(k.colors.primary, .3)};
2020
2020
  background-color: ${k.colors.primary};
2021
2021
  transition: transform .15s ease;
2022
2022
  }
@@ -2226,7 +2226,7 @@ var mn = xt`
2226
2226
  --checked-background-color: ${k.colors.primary};
2227
2227
  `,
2228
2228
  secondary: O`
2229
- --checked-border-color: ${t(k.colors.secondary, .2)};
2229
+ --checked-border-color: ${e(k.colors.secondary, .2)};
2230
2230
  --checked-background-color: ${k.colors.secondary};
2231
2231
  `,
2232
2232
  input: O`
@@ -2334,7 +2334,7 @@ var xn = {
2334
2334
  background-color: ${k.colors.back.secondary};
2335
2335
 
2336
2336
  &:before {
2337
- border-color: ${t(k.colors.primary, .3)};
2337
+ border-color: ${e(k.colors.primary, .3)};
2338
2338
  background-color: ${k.colors.primary};
2339
2339
  transform: translate(${yn}px, -50%);
2340
2340
  }
@@ -2372,10 +2372,10 @@ var xn = {
2372
2372
  `
2373
2373
  };
2374
2374
  // src/components/_tag.jsx
2375
- function Sn({ className: t, variant: n = "normal", iconName: r = "", label: i }) {
2375
+ function Sn({ className: e, variant: n = "normal", iconName: r = "", label: i }) {
2376
2376
  return /* @__PURE__ */ u(l, { children: /* @__PURE__ */ d("div", {
2377
- className: D(Cn.base, Cn[n] ?? Cn.normal, t),
2378
- "has-icon": !e(r),
2377
+ className: D(Cn.base, Cn[n] ?? Cn.normal, e),
2378
+ "has-icon": !t(r),
2379
2379
  children: [r && /* @__PURE__ */ u(l, { children: /* @__PURE__ */ u(Tt, {
2380
2380
  className: O`
2381
2381
  ${k.extends.verticalCenter}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Vadim Hermann",
3
3
  "name": "melonykit",
4
- "version": "1.8.2",
4
+ "version": "1.9.0",
5
5
  "type": "module",
6
6
  "description": "Preact based ui and utility functions toolkit",
7
7
  "main": "./dist/index.js",