melonykit 1.6.1 → 1.7.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-DkAbnk05.js";
1
+ import { a as e } from "./functions-C0XYAMNN.js";
2
2
  import { signal as t } from "@preact/signals";
3
3
  import { useEffect as n, useMemo as r } from "preact/hooks";
4
4
  //#region 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-CLUp6bMQ.js";
1
+ export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-CaBX4YcI.js";
@@ -283,13 +283,18 @@ function D(e) {
283
283
  return Number.isInteger(e);
284
284
  }
285
285
  //#endregion
286
- //#region src/functions/_kebab-case-to-title-case.js
286
+ //#region src/functions/_kebab-case-to-camel-case.js
287
287
  function O(e) {
288
+ return t(e) ? e.split("-").filter(Boolean).map((e, t) => t === 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join("") : "";
289
+ }
290
+ //#endregion
291
+ //#region src/functions/_kebab-case-to-title-case.js
292
+ function k(e) {
288
293
  return t(e) ? e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
289
294
  }
290
295
  //#endregion
291
296
  //#region src/functions/_median.js
292
- function k(e) {
297
+ function A(e) {
293
298
  if (!Array.isArray(e) || e.length === 0) return null;
294
299
  for (let t of e) if (!Number.isFinite(t)) return null;
295
300
  let t = [...e].sort((e, t) => e - t), n = Math.floor(t.length / 2);
@@ -297,7 +302,7 @@ function k(e) {
297
302
  }
298
303
  //#endregion
299
304
  //#region src/functions/_request.js
300
- async function A({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
305
+ async function j({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
301
306
  let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
302
307
  method: n,
303
308
  headers: {
@@ -318,7 +323,7 @@ async function A({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
318
323
  }
319
324
  //#endregion
320
325
  //#region src/functions/_risk-reward.js
321
- function j(e = {}) {
326
+ function M(e = {}) {
322
327
  let { entry: t, exit: n, riskRatio: r = 20 } = e ?? {};
323
328
  if (!c(t) || t <= 0 || !c(n) || n <= 0 || !c(r) || r <= 0) return null;
324
329
  let i = (n - t) / t / (r / 100);
@@ -326,17 +331,17 @@ function j(e = {}) {
326
331
  }
327
332
  //#endregion
328
333
  //#region src/functions/_size.js
329
- function M(e) {
334
+ function N(e) {
330
335
  return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
331
336
  }
332
337
  //#endregion
333
338
  //#region src/functions/_slugify.js
334
- function N(e) {
339
+ function P(e) {
335
340
  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, "") : "";
336
341
  }
337
342
  //#endregion
338
343
  //#region src/functions/_to-number.js
339
- function P(e, t = null) {
344
+ function F(e, t = null) {
340
345
  let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
341
346
  if (!Number.isFinite(n)) return null;
342
347
  if (t == null) return n;
@@ -344,4 +349,4 @@ function P(e, t = null) {
344
349
  return Math.round(n * r) / r;
345
350
  }
346
351
  //#endregion
347
- export { t as C, n as S, c as _, A as a, a as b, D as c, w as d, C as f, l as g, u as h, j as i, E as l, _ as m, N as n, k as o, S as p, M as r, O as s, P as t, T as u, s as v, e as w, i as x, o as y };
352
+ 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 };
package/dist/functions.js CHANGED
@@ -1 +1 @@
1
- export { w as average, S as camelCaseToTitleCase, x as convertHexToRgba, g as createCache, h as darkenHexColor, m as formatDate, b as isArray, y as isEmptyArray, d as isEmptyObject, u as isEmptyString, l as isFloat, v as isFunction, c as isInteger, p as isNil, _ as isNumber, f as isObject, C as isString, s as kebabCaseToTitleCase, o as median, a as request, i as riskReward, r as size, n as slugify, t as toNumber } from "./functions-DkAbnk05.js";
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-C0XYAMNN.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as e, t } from "./browser-CLUp6bMQ.js";
2
- import { h as n, n as r, u as i } from "./functions-DkAbnk05.js";
1
+ import { n as e, t } from "./browser-CaBX4YcI.js";
2
+ import { d as n, g as r, n as i } from "./functions-C0XYAMNN.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";
@@ -1146,7 +1146,7 @@ var Nt = xt`
1146
1146
  `,
1147
1147
  secondary: O`
1148
1148
  color: ${k.colors.fore.primary};
1149
- border-color: ${n(k.colors.secondary, .2)};
1149
+ border-color: ${r(k.colors.secondary, .2)};
1150
1150
  background-color: ${k.colors.secondary};
1151
1151
  `,
1152
1152
  neutral: O`
@@ -1423,7 +1423,7 @@ function Ut(t, n) {
1423
1423
  return e(Wt(t), n);
1424
1424
  }
1425
1425
  function Wt(e) {
1426
- let t = r(e);
1426
+ let t = i(e);
1427
1427
  return t ? `accordions:${t}:is-open` : "";
1428
1428
  }
1429
1429
  var Gt = {
@@ -1656,15 +1656,15 @@ var Xt = {
1656
1656
  transition: width .3s ease;
1657
1657
  `,
1658
1658
  normal: O`
1659
- border: solid 1px ${n(k.colors.primary, .3)};
1659
+ border: solid 1px ${r(k.colors.primary, .3)};
1660
1660
  background-color: ${k.colors.primary};
1661
1661
  `,
1662
1662
  warn: O`
1663
- border: solid 1px ${n(k.colors.secondary, .2)};
1663
+ border: solid 1px ${r(k.colors.secondary, .2)};
1664
1664
  background-color: ${k.colors.secondary};
1665
1665
  `,
1666
1666
  danger: O`
1667
- border: solid 1px ${n(k.colors.danger, .3)};
1667
+ border: solid 1px ${r(k.colors.danger, .3)};
1668
1668
  background-color: ${k.colors.danger};
1669
1669
  `
1670
1670
  };
@@ -2042,7 +2042,7 @@ var un = {
2042
2042
  height: 1rem;
2043
2043
  margin-top: -.375rem;
2044
2044
  border-radius: 50%;
2045
- border: solid 1px ${n(k.colors.primary, .3)};
2045
+ border: solid 1px ${r(k.colors.primary, .3)};
2046
2046
  background-color: ${k.colors.primary};
2047
2047
  transition: transform .15s ease;
2048
2048
  }
@@ -2254,7 +2254,7 @@ var mn = xt`
2254
2254
  --checked-background-color: ${k.colors.primary};
2255
2255
  `,
2256
2256
  secondary: O`
2257
- --checked-border-color: ${n(k.colors.secondary, .2)};
2257
+ --checked-border-color: ${r(k.colors.secondary, .2)};
2258
2258
  --checked-background-color: ${k.colors.secondary};
2259
2259
  `,
2260
2260
  input: O`
@@ -2362,7 +2362,7 @@ var xn = {
2362
2362
  background-color: ${k.colors.back.secondary};
2363
2363
 
2364
2364
  &:before {
2365
- border-color: ${n(k.colors.primary, .3)};
2365
+ border-color: ${r(k.colors.primary, .3)};
2366
2366
  background-color: ${k.colors.primary};
2367
2367
  transform: translate(${yn}px, -50%);
2368
2368
  }
@@ -2401,18 +2401,18 @@ var xn = {
2401
2401
  };
2402
2402
  //#endregion
2403
2403
  //#region src/components/_tag.jsx
2404
- function Sn({ className: e, variant: t = "normal", iconName: n = "", label: r }) {
2404
+ function Sn({ className: e, variant: t = "normal", iconName: r = "", label: i }) {
2405
2405
  return /* @__PURE__ */ u(l, { children: /* @__PURE__ */ d("div", {
2406
2406
  className: D(Cn.base, Cn[t] ?? Cn.normal, e),
2407
- "has-icon": !i(n),
2408
- children: [n && /* @__PURE__ */ u(l, { children: /* @__PURE__ */ u(Tt, {
2407
+ "has-icon": !n(r),
2408
+ children: [r && /* @__PURE__ */ u(l, { children: /* @__PURE__ */ u(Tt, {
2409
2409
  className: O`
2410
2410
  ${k.extends.verticalCenter}
2411
2411
  left: .4rem;
2412
2412
  `,
2413
- iconName: n,
2413
+ iconName: r,
2414
2414
  size: ".9rem"
2415
- }) }), r]
2415
+ }) }), i]
2416
2416
  }) });
2417
2417
  }
2418
2418
  var Cn = { base: O`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Vadim Hermann",
3
3
  "name": "melonykit",
4
- "version": "1.6.1",
4
+ "version": "1.7.0",
5
5
  "type": "module",
6
6
  "description": "Preact based ui and utility functions toolkit",
7
7
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "@playwright/test": "1.64.1",
44
44
  "@preact/preset-vite": "2.10.6",
45
45
  "@preact/signals": "2.11.2",
46
- "@types/node": "26.6.5",
46
+ "@types/node": "26.6.6",
47
47
  "preact": "11.0.1",
48
48
  "vite": "8.3.5",
49
49
  "vite-plugin-mkcert": "2.1.0"