@febkosq8/arc 0.8.0 → 0.8.2

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/dist/arc.js CHANGED
@@ -11,16 +11,16 @@ import { FiChevronDown as N, FiChevronRight as P, FiMonitor as F, FiMoon as I, F
11
11
  import { Dialog as R } from "@base-ui/react/dialog";
12
12
  import { RxCross1 as z } from "react-icons/rx";
13
13
  import { Select as B } from "@base-ui/react/select";
14
- import { rankItem as ee } from "@tanstack/match-sorter-utils";
15
- import { columnFilteringFeature as te, columnResizingFeature as ne, columnSizingFeature as re, columnVisibilityFeature as ie, createColumnHelper as ae, createFilteredRowModel as oe, createPaginatedRowModel as se, createSortedRowModel as ce, filterFn_includesString as le, globalFilteringFeature as ue, rowPaginationFeature as de, rowSortingFeature as fe, sortFn_alphanumeric as pe, sortFn_alphanumericCaseSensitive as me, sortFn_basic as he, sortFn_datetime as ge, sortFn_text as _e, sortFn_textCaseSensitive as ve, tableFeatures as ye, useTable as be } from "@tanstack/react-table";
16
- import { Switch as xe } from "@base-ui/react/switch";
17
- //#region components/button-group.tsx
18
- var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, children: s, ...c }) => /* @__PURE__ */ f("div", {
14
+ import { rankItem as V } from "@tanstack/match-sorter-utils";
15
+ import { columnFilteringFeature as ee, columnResizingFeature as te, columnSizingFeature as ne, columnVisibilityFeature as re, createColumnHelper as ie, createFilteredRowModel as ae, createPaginatedRowModel as oe, createSortedRowModel as se, filterFn_includesString as ce, globalFilteringFeature as le, rowPaginationFeature as ue, rowSortingFeature as de, sortFn_alphanumeric as fe, sortFn_alphanumericCaseSensitive as pe, sortFn_basic as me, sortFn_datetime as he, sortFn_text as ge, sortFn_textCaseSensitive as _e, tableFeatures as ve, useTable as ye } from "@tanstack/react-table";
16
+ import { Switch as be } from "@base-ui/react/switch";
17
+ // components/button-group.tsx
18
+ var xe = ({ className: e, orientation: r = "horizontal", selectedVariant: o, children: s, ...c }) => /* @__PURE__ */ f("div", {
19
19
  role: "group",
20
20
  className: t("arc-button-group inline-flex w-fit gap-0 overflow-hidden rounded-md border border-border", "[&>.arc-button]:rounded-none! [&>.arc-button:not(:first-child)]:border-l [&>.arc-button:not(:first-child)]:border-border", "[&>.arc-double-click-button]:z-1 [&>.arc-double-click-button]:m-0 [&>.arc-double-click-button]:rounded-none! [&>.arc-double-click-button]:p-0", "[&>.arc-double-click-button>.arc-button]:rounded-none! [&>.arc-double-click-button>.arc-double-click-progress-ring]:inset-0 [&>.arc-double-click-button>.arc-double-click-progress-ring]:z-2 [&>.arc-double-click-button>.arc-double-click-progress-ring]:rounded-[inherit]", "[&>.arc-long-press-button]:z-1 [&>.arc-long-press-button]:m-0 [&>.arc-long-press-button]:rounded-none! [&>.arc-long-press-button]:p-0", "[&>.arc-long-press-button>.arc-button]:rounded-none! [&>.arc-long-press-button>.arc-double-click-progress-ring]:inset-0 [&>.arc-long-press-button>.arc-double-click-progress-ring]:z-2 [&>.arc-long-press-button>.arc-double-click-progress-ring]:rounded-[inherit]", r === "vertical" && "flex-col items-stretch [&>.arc-button]:w-full [&>.arc-double-click-button]:w-full [&>.arc-long-press-button]:w-full [&>.arc-button:not(:first-child)]:border-t [&>.arc-button:not(:first-child)]:border-l-0 [&>.arc-double-click-button:not(:first-child)]:border-t [&>.arc-double-click-button:not(:first-child)]:border-l-0 [&>.arc-long-press-button:not(:first-child)]:border-t [&>.arc-long-press-button:not(:first-child)]:border-l-0 [&>.arc-double-click-button:first-child]:rounded-t-md [&>.arc-double-click-button:last-child]:rounded-b-md [&>.arc-long-press-button:first-child]:rounded-t-md [&>.arc-long-press-button:last-child]:rounded-b-md", r === "horizontal" && "[&>.arc-double-click-button:not(:first-child)]:border-l [&>.arc-double-click-button:not(:first-child)]:border-border [&>.arc-long-press-button:not(:first-child)]:border-l [&>.arc-long-press-button:not(:first-child)]:border-border [&>.arc-double-click-button:first-child]:rounded-l-md [&>.arc-double-click-button:last-child]:rounded-r-md [&>.arc-long-press-button:first-child]:rounded-l-md [&>.arc-long-press-button:last-child]:rounded-r-md", e),
21
21
  ...c,
22
22
  children: n.map(s, (e) => !o || !a(e) ? e : e.props["aria-pressed"] === !0 ? i(e, { variant: o }) : e)
23
- }), Ce = e("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 truncate", {
23
+ }), Se = e("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 truncate", {
24
24
  variants: {
25
25
  variant: {
26
26
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
@@ -53,14 +53,14 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
53
53
  variant: "primary",
54
54
  size: "md"
55
55
  }
56
- }), V = Object.assign(({ className: e, variant: n, size: r, ...i }) => /* @__PURE__ */ f("button", {
57
- className: t("arc-button", Ce({
56
+ }), H = Object.assign(({ className: e, variant: n, size: r, ...i }) => /* @__PURE__ */ f("button", {
57
+ className: t("arc-button", Se({
58
58
  variant: n,
59
59
  size: r,
60
60
  className: e
61
61
  })),
62
62
  ...i
63
- }), { Group: Se }), we = ({ doubleClickMsDuration: e = 2e3, feedbackVariant: n = "warning", feedbackContent: r, variant: i = "primary", children: a, onClick: s, onDoubleClick: c, className: d, style: m, ...h }) => {
63
+ }), { Group: xe }), Ce = ({ doubleClickMsDuration: e = 2e3, feedbackVariant: n = "warning", feedbackContent: r, variant: i = "primary", children: a, onClick: s, onDoubleClick: c, className: d, style: m, ...h }) => {
64
64
  let [g, _] = u(!1), [v, y] = u(0), b = l(void 0), x = l(void 0), S = l(0), C = {
65
65
  primary: "var(--color-primary)",
66
66
  secondary: "var(--color-secondary-foreground)",
@@ -88,7 +88,7 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
88
88
  "aria-hidden": !g,
89
89
  children: w
90
90
  })]
91
- }), E = /* @__PURE__ */ f(V, {
91
+ }), E = /* @__PURE__ */ f(H, {
92
92
  ...h,
93
93
  children: T,
94
94
  className: t(d),
@@ -123,7 +123,7 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
123
123
  }
124
124
  })]
125
125
  });
126
- }, Te = ({ longPressMsDuration: e = 2500, onLongPress: n, onClick: r, preventClick: i = !0, feedbackVariant: a = "warning", feedbackContent: s, variant: c = "primary", children: d, ...m }) => {
126
+ }, we = ({ longPressMsDuration: e = 2500, onLongPress: n, onClick: r, preventClick: i = !0, feedbackVariant: a = "warning", feedbackContent: s, variant: c = "primary", children: d, ...m }) => {
127
127
  let h = l(void 0), g = l(void 0), _ = l(0), v = l(!1), [y, b] = u(!1), [x, S] = u(0), C = () => {
128
128
  h.current && clearTimeout(h.current), g.current && clearInterval(g.current), h.current = void 0, g.current = void 0;
129
129
  };
@@ -155,7 +155,7 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
155
155
  return /* @__PURE__ */ p("span", {
156
156
  className: "arc-long-press-button relative inline-flex",
157
157
  "data-long-press-state": y ? "pressing" : void 0,
158
- children: [/* @__PURE__ */ f(V, {
158
+ children: [/* @__PURE__ */ f(H, {
159
159
  ...m,
160
160
  children: E,
161
161
  variant: c,
@@ -190,7 +190,7 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
190
190
  }
191
191
  })]
192
192
  });
193
- }, Ee = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted ring-1 ring-border transition-all", {
193
+ }, Te = e("arc-avatar inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted ring-1 ring-border transition-all", {
194
194
  variants: { size: {
195
195
  xs: "size-6 text-xs",
196
196
  sm: "size-7 text-sm",
@@ -199,12 +199,12 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
199
199
  xl: "size-12 text-xl"
200
200
  } },
201
201
  defaultVariants: { size: "md" }
202
- }), De = ({ name: e, image: n, size: r, className: i, ...a }) => {
202
+ }), Ee = ({ name: e, image: n, size: r, className: i, ...a }) => {
203
203
  let [s, l] = u(!1), d = n?.trim(), p = !!d && !s, m = c(() => e?.split(" ", 3)?.map((e) => e[0])?.filter((e) => /[A-Za-z]/.test(e))?.join("") || "U", [e]);
204
204
  return o(() => {
205
205
  l(!1);
206
206
  }, [d]), /* @__PURE__ */ f("span", {
207
- className: t(Ee({
207
+ className: t(Te({
208
208
  size: r,
209
209
  className: i
210
210
  })),
@@ -221,11 +221,11 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
221
221
  children: m
222
222
  })
223
223
  });
224
- }, Oe = ({ className: e, ...n }) => /* @__PURE__ */ f("div", {
224
+ }, De = ({ className: e, ...n }) => /* @__PURE__ */ f("div", {
225
225
  role: "separator",
226
226
  className: t("arc-divider w-full border-b border-border", e),
227
227
  ...n
228
- }), ke = ({ items: e, value: n, onChange: r, className: i, placeholder: a = "Select an option", disabled: o, name: s, preventEmpty: c = !1, "data-name": l, "data-required": u }) => {
228
+ }), Oe = ({ items: e, value: n, onChange: r, className: i, placeholder: a = "Select an option", disabled: o, name: s, preventEmpty: c = !1, "data-name": l, "data-required": u }) => {
229
229
  let d = e.find((e) => String(e.key) === String(n)) ?? null;
230
230
  return /* @__PURE__ */ f(m.Root, {
231
231
  items: e,
@@ -286,7 +286,7 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
286
286
  }) })]
287
287
  })
288
288
  });
289
- }, H = ({ data: e, className: n, ...r }) => {
289
+ }, U = ({ data: e, className: n, ...r }) => {
290
290
  let i = Array.isArray(e) ? e.join(", ") : typeof e == "string" ? e : null;
291
291
  return /* @__PURE__ */ f("em", {
292
292
  role: "alert",
@@ -295,19 +295,19 @@ var Se = ({ className: e, orientation: r = "horizontal", selectedVariant: o, chi
295
295
  ...r,
296
296
  children: i
297
297
  });
298
- }, Ae = /* @__PURE__ */ "*.+.×.÷.=.~.!.?.@.#.%.&.§.¶.※.◇.◆.○.●.△.▽.□.■.♠.♣.♦.♤.♧.♢.♪.♫.∴.∵".split(".");
299
- function U(e, t, n) {
298
+ }, ke = /* @__PURE__ */ "*.+.×.÷.=.~.!.?.@.#.%.&.§.¶.※.◇.◆.○.●.△.▽.□.■.♠.♣.♦.♤.♧.♢.♪.♫.∴.∵".split(".");
299
+ function W(e, t, n) {
300
300
  let r = Math.sin((e + 1) * 12.9898 + t * 78.233 + n * 37.719) * 43758.5453;
301
301
  return r - Math.floor(r);
302
302
  }
303
- var W = [
303
+ var G = [
304
304
  "circle",
305
305
  "square",
306
306
  "diamond",
307
307
  "star",
308
308
  "heart",
309
309
  "hexagon"
310
- ], je = e("arc-grid-loader__cell grid aspect-square w-full place-items-center overflow-hidden text-center leading-none break-all", {
310
+ ], Ae = e("arc-grid-loader__cell grid aspect-square w-full place-items-center overflow-hidden text-center leading-none break-all", {
311
311
  variants: { shape: {
312
312
  circle: "rounded-full",
313
313
  square: "rounded-md",
@@ -317,23 +317,23 @@ var W = [
317
317
  hexagon: "arc-grid-loader__cell--hexagon"
318
318
  } },
319
319
  defaultVariants: { shape: "circle" }
320
- }), Me = ({ className: e, rows: n = 3, columns: r = 3, size: i = 120, maxSize: a = 24, shape: s = "circle", shapes: c = W, colors: l = [], label: d = "Loading", symbols: p = Ae, style: m, ...h }) => {
321
- let [g, _] = u([]), [v, y] = u([]), [b, x] = u([]), S = c.length > 0 ? c : W, [C, w] = u(() => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
320
+ }), je = ({ className: e, rows: n = 3, columns: r = 3, size: i = 120, maxSize: a = 24, shape: s = "circle", shapes: c = G, colors: l = [], label: d = "Loading", symbols: p = ke, title: m, style: h, ...g }) => {
321
+ let [_, v] = u([]), [y, b] = u([]), [x, S] = u([]), C = c.length > 0 ? c : G, [w, T] = u(() => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
322
322
  if (o(() => {
323
- s === "mixed" && y(Array.from({ length: n * r }, () => S[Math.floor(Math.random() * S.length)]));
323
+ s === "mixed" && b(Array.from({ length: n * r }, () => C[Math.floor(Math.random() * C.length)]));
324
324
  }, [
325
- S,
325
+ C,
326
326
  r,
327
327
  n,
328
328
  s
329
329
  ]), o(() => {
330
- let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => w(e.matches);
330
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => T(e.matches);
331
331
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
332
332
  }, []), o(() => {
333
- C || p.length === 0 || _(Array.from({ length: n * r }, () => Math.floor(Math.random() * p.length)));
333
+ w || p.length === 0 || v(Array.from({ length: n * r }, () => Math.floor(Math.random() * p.length)));
334
334
  }, [
335
335
  r,
336
- C,
336
+ w,
337
337
  n,
338
338
  p
339
339
  ]), !Number.isInteger(n) || n < 1) throw RangeError("GridLoader rows must be a positive integer.");
@@ -341,15 +341,16 @@ var W = [
341
341
  if (!Number.isFinite(i) || i <= 0) throw RangeError("GridLoader size must be a positive number.");
342
342
  if (!Number.isFinite(a) || a <= 0) throw RangeError("GridLoader maxSize must be a positive number.");
343
343
  return /* @__PURE__ */ f("span", {
344
- ...h,
344
+ ...g,
345
345
  role: "status",
346
346
  "aria-live": "polite",
347
347
  "aria-label": d,
348
+ title: m ?? d,
348
349
  className: t("arc-grid-loader inline-flex shrink-0 items-center justify-center align-middle", e),
349
350
  style: {
350
351
  width: i,
351
352
  height: i,
352
- ...m
353
+ ...h
353
354
  },
354
355
  children: /* @__PURE__ */ f("span", {
355
356
  "aria-hidden": "true",
@@ -360,35 +361,35 @@ var W = [
360
361
  gridTemplateRows: `repeat(${n}, minmax(0, 1fr))`
361
362
  },
362
363
  children: Array.from({ length: n * r }, (e, o) => /* @__PURE__ */ f("span", {
363
- className: t(je({ shape: s === "mixed" ? v[o] ?? S[Math.floor(U(o, n, r) * S.length)] : s })),
364
+ className: t(Ae({ shape: s === "mixed" ? y[o] ?? C[Math.floor(W(o, n, r) * C.length)] : s })),
364
365
  onAnimationIteration: () => {
365
- s === "mixed" && y((e) => {
366
- let t = [...e], i = t[o] ?? S[Math.floor(U(o, n, r) * S.length)], a = S.filter((e) => e !== i);
366
+ s === "mixed" && b((e) => {
367
+ let t = [...e], i = t[o] ?? C[Math.floor(W(o, n, r) * C.length)], a = C.filter((e) => e !== i);
367
368
  return t[o] = a.length > 0 ? a[Math.floor(Math.random() * a.length)] : i, t;
368
- }), l.length > 1 && x((e) => {
369
+ }), l.length > 1 && S((e) => {
369
370
  let t = [...e];
370
371
  return t[o] = (t[o] ?? 0) + 1, t;
371
- }), p.length > 1 && _((e) => {
372
+ }), p.length > 1 && v((e) => {
372
373
  let t = [...e];
373
374
  return t[o] = ((t[o] ?? o % p.length) + (1 + Math.floor(Math.random() * (p.length - 1)))) % p.length, t;
374
375
  });
375
376
  },
376
377
  style: {
377
- animationDelay: l.length > 1 ? `${o / (n * r) * 1200}ms` : `${-U(o, n, r) * 1200}ms`,
378
- animationDuration: l.length > 1 ? "1200ms" : `${900 + U(o, n, r) * 600}ms`,
379
- backgroundColor: l.length > 0 ? l[(o + (b[o] ?? 0)) % l.length] : void 0,
378
+ animationDelay: l.length > 1 ? `${o / (n * r) * 1200}ms` : `${-W(o, n, r) * 1200}ms`,
379
+ animationDuration: l.length > 1 ? "1200ms" : `${900 + W(o, n, r) * 600}ms`,
380
+ backgroundColor: l.length > 0 ? l[(o + (x[o] ?? 0)) % l.length] : void 0,
380
381
  fontSize: `${Math.min(i / Math.max(n, r), a) * .4}px`,
381
382
  maxWidth: a,
382
383
  maxHeight: a
383
384
  },
384
385
  children: p.length > 0 && /* @__PURE__ */ f("span", {
385
386
  className: "grid h-full w-full place-items-center text-center leading-none",
386
- children: p[g[o] ?? o % p.length]
387
+ children: p[_[o] ?? o % p.length]
387
388
  })
388
389
  }, o))
389
390
  })
390
391
  });
391
- }, G = ({ cardContent: e, children: n, trigger: r = "hover", triggerRender: i, side: a = "bottom", align: o = "center", className: s, open: c, onOpenChange: l }) => /* @__PURE__ */ p(A.Root, {
392
+ }, K = ({ cardContent: e, children: n, trigger: r = "hover", triggerRender: i, side: a = "bottom", align: o = "center", className: s, open: c, onOpenChange: l }) => /* @__PURE__ */ p(A.Root, {
392
393
  open: c,
393
394
  onOpenChange: l,
394
395
  children: [/* @__PURE__ */ f(A.Trigger, {
@@ -406,7 +407,7 @@ var W = [
406
407
  children: [/* @__PURE__ */ f(A.Arrow, { className: t("border-border bg-popover h-3 w-3 rotate-45", "data-[side=bottom]:-top-1.5 data-[side=bottom]:border-t data-[side=bottom]:border-l", "data-[side=top]:-bottom-1.5 data-[side=top]:border-r data-[side=top]:border-b", "data-[side=left]:-right-1.5 data-[side=left]:border-t data-[side=left]:border-r", "data-[side=right]:-left-1.5 data-[side=right]:border-b data-[side=right]:border-l") }), e]
407
408
  })
408
409
  }) })]
409
- }), Ne = ({ id: e, label: n, help: r, errors: i, className: a, ...o }) => {
410
+ }), Me = ({ id: e, label: n, help: r, errors: i, className: a, ...o }) => {
410
411
  let s = Array.isArray(i) ? i.map((e) => e == null ? "" : String(e)) : typeof i == "string" ? i : null;
411
412
  return /* @__PURE__ */ p("div", {
412
413
  ...o,
@@ -418,7 +419,7 @@ var W = [
418
419
  htmlFor: e,
419
420
  children: n
420
421
  }),
421
- r != null && r !== !1 && /* @__PURE__ */ f(G, {
422
+ r != null && r !== !1 && /* @__PURE__ */ f(K, {
422
423
  trigger: "hover",
423
424
  triggerRender: /* @__PURE__ */ f("button", {
424
425
  type: "button",
@@ -434,10 +435,10 @@ var W = [
434
435
  "aria-hidden": "true"
435
436
  })
436
437
  }),
437
- s && (Array.isArray(s) ? s.length > 0 && /* @__PURE__ */ f(H, { data: s }) : /* @__PURE__ */ f(H, { data: s }))
438
+ s && (Array.isArray(s) ? s.length > 0 && /* @__PURE__ */ f(U, { data: s }) : /* @__PURE__ */ f(U, { data: s }))
438
439
  ]
439
440
  });
440
- }, Pe = e("arc-input rounded border text-foreground placeholder:text-muted-foreground focus:border-transparent focus:outline-hidden focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:border-muted disabled:bg-muted", {
441
+ }, Ne = e("arc-input rounded border text-foreground placeholder:text-muted-foreground focus:border-transparent focus:outline-hidden focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:border-muted disabled:bg-muted", {
441
442
  variants: {
442
443
  variant: {
443
444
  default: "border-border bg-background",
@@ -452,8 +453,8 @@ var W = [
452
453
  variant: "default",
453
454
  as: "input"
454
455
  }
455
- }), K = ({ as: e = "input", className: n, variant: r, ...i }) => {
456
- let a = t(Pe({
456
+ }), q = ({ as: e = "input", className: n, variant: r, ...i }) => {
457
+ let a = t(Ne({
457
458
  as: e,
458
459
  variant: r
459
460
  }), n);
@@ -462,7 +463,7 @@ var W = [
462
463
  autoComplete: "off",
463
464
  className: a
464
465
  });
465
- }, Fe = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
466
+ }, Pe = e("arc-card group relative rounded-lg border border-foreground/40 bg-card/90 p-3 shadow-xs", {
466
467
  variants: { variant: {
467
468
  primary: "border-primary bg-primary text-primary-foreground",
468
469
  secondary: "border-secondary bg-secondary text-secondary-foreground",
@@ -474,10 +475,10 @@ var W = [
474
475
  "outline-warning": "border-warning bg-background text-warning"
475
476
  } },
476
477
  defaultVariants: { variant: "outline-secondary" }
477
- }), q = (e) => {
478
+ }), J = (e) => {
478
479
  let { className: n, variant: r, hoverable: i = !0, hoverLift: a = !0, hoverBorder: o = !0, hoverGradient: s = !0, postHeaderBorder: c = !0, preFooterBorder: l = !0, onPointerMove: u, ...d } = e, p = i && a, m = i && o, h = i && s;
479
480
  return /* @__PURE__ */ f("div", {
480
- className: t(Fe({ variant: r }), h && "arc-card-cursor-border", c && "[&_.arc-card-header]:border-b", !c && "[&_.arc-card-header]:border-b-0", l && "[&_.arc-card-footer]:border-t", !l && "[&_.arc-card-footer]:border-t-0", (p || m) && "transition-[border-color,transform] duration-300 ease-out", p && "hover:-translate-y-1", m && "hover:border-primary", n),
481
+ className: t(Pe({ variant: r }), h && "arc-card-cursor-border", c && "[&_.arc-card-header]:border-b", !c && "[&_.arc-card-header]:border-b-0", l && "[&_.arc-card-footer]:border-t", !l && "[&_.arc-card-footer]:border-t-0", (p || m) && "transition-[border-color,transform] duration-300 ease-out", p && "hover:-translate-y-1", m && "hover:border-primary", n),
481
482
  onPointerMove: h ? (e) => {
482
483
  if (u?.(e), !h) return;
483
484
  let t = e.currentTarget.getBoundingClientRect();
@@ -486,28 +487,27 @@ var W = [
486
487
  ...d
487
488
  });
488
489
  };
489
- q.Header = (e) => {
490
+ J.Header = (e) => {
490
491
  let { className: n, ...r } = e;
491
492
  return /* @__PURE__ */ f("h2", {
492
493
  className: t("arc-card-header flex w-full typography-heading-3 flex-col border-foreground/40 px-0 pb-1", n),
493
494
  ...r
494
495
  });
495
- }, q.Content = (e) => {
496
+ }, J.Content = (e) => {
496
497
  let { className: n, ...r } = e;
497
498
  return /* @__PURE__ */ f("div", {
498
499
  className: t("arc-card-content typography-paragraph mt-0! w-full justify-between px-0 py-1 whitespace-pre-wrap", n),
499
500
  ...r
500
501
  });
501
- }, q.Footer = (e) => {
502
+ }, J.Footer = (e) => {
502
503
  let { className: n, ...r } = e;
503
504
  return /* @__PURE__ */ f("div", {
504
505
  className: t("arc-card-footer typography-muted mt-auto mb-0 flex w-full items-end justify-start border-foreground/40 px-0 pt-1", n),
505
506
  ...r
506
507
  });
507
508
  };
508
- //#endregion
509
- //#region utilities/date-handler.ts
510
- var J = class e {
509
+ // utilities/date-handler.ts
510
+ var Fe = class e {
511
511
  static toDateTime(e) {
512
512
  if (e == null || e === "") return j.invalid("missing date");
513
513
  if (e instanceof Date) return j.fromJSDate(e);
@@ -566,8 +566,8 @@ var J = class e {
566
566
  return n.replace("$ISO$", r).replace("$RELATIVE$", i);
567
567
  }
568
568
  }, Ie = ({ value: e, format: t = "$ISO$ ($RELATIVE$)", ...n }) => {
569
- let r = c(() => e ? J.getFormattedTime(e, t) : "", [e, t]);
570
- return /* @__PURE__ */ f(K, {
569
+ let r = c(() => e ? Fe.getFormattedTime(e, t) : "", [e, t]);
570
+ return /* @__PURE__ */ f(q, {
571
571
  type: "text",
572
572
  disabled: !0,
573
573
  readOnly: !0,
@@ -863,34 +863,34 @@ var J = class e {
863
863
  })),
864
864
  ...r
865
865
  }), We = (e, t, n, r) => {
866
- let i = e.getValue(t), a = ee(i, n);
866
+ let i = e.getValue(t), a = V(i, n);
867
867
  return r({ itemRank: a }), a.passed;
868
868
  }, Q = {
869
869
  fuzzy: We,
870
- includesString: le,
870
+ includesString: ce,
871
871
  select: (e, t, n) => {
872
872
  let r = e.getValue(t);
873
873
  return Array.isArray(r) ? r.some((e) => String(e) === String(n)) : typeof r == "string" && r.includes(",") ? r.split(",").map((e) => e.trim()).includes(String(n)) : String(r) === String(n);
874
874
  }
875
- }, Ge = ye({
875
+ }, Ge = ve({
876
876
  columnMeta: {},
877
- columnFilteringFeature: te,
878
- columnResizingFeature: ne,
879
- columnSizingFeature: re,
880
- columnVisibilityFeature: ie,
881
- globalFilteringFeature: ue,
882
- rowPaginationFeature: de,
883
- rowSortingFeature: fe,
884
- filteredRowModel: oe(),
885
- paginatedRowModel: se(),
886
- sortedRowModel: ce(),
877
+ columnFilteringFeature: ee,
878
+ columnResizingFeature: te,
879
+ columnSizingFeature: ne,
880
+ columnVisibilityFeature: re,
881
+ globalFilteringFeature: le,
882
+ rowPaginationFeature: ue,
883
+ rowSortingFeature: de,
884
+ filteredRowModel: ae(),
885
+ paginatedRowModel: oe(),
886
+ sortedRowModel: se(),
887
887
  sortFns: {
888
- alphanumeric: pe,
889
- alphanumericCaseSensitive: me,
890
- basic: he,
891
- datetime: ge,
892
- text: _e,
893
- textCaseSensitive: ve
888
+ alphanumeric: fe,
889
+ alphanumericCaseSensitive: pe,
890
+ basic: me,
891
+ datetime: he,
892
+ text: ge,
893
+ textCaseSensitive: _e
894
894
  },
895
895
  filterFns: Q
896
896
  });
@@ -904,7 +904,7 @@ function qe(e, t) {
904
904
  throw Error(`Unsupported table filterFn "${e}". Use "auto" or one of: ${Object.keys(Q).join(", ")}.`);
905
905
  }
906
906
  }
907
- var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, showHeader: a = !0, showFilters: o = !0, showSorting: l = !0 }) => {
907
+ var Je = ie(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, showHeader: a = !0, showFilters: o = !0, showSorting: l = !0 }) => {
908
908
  let d = s(), [m, b] = u({
909
909
  pageIndex: 0,
910
910
  pageSize: r
@@ -945,7 +945,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
945
945
  });
946
946
  },
947
947
  cell: e.cell ?? ((e) => e.getValue())
948
- })), [n]), P = be({
948
+ })), [n]), P = ye({
949
949
  data: e,
950
950
  columns: N,
951
951
  state: {
@@ -977,7 +977,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
977
977
  children: [
978
978
  /* @__PURE__ */ p("div", {
979
979
  className: "flex items-center gap-2",
980
- children: [/* @__PURE__ */ p(V, {
980
+ children: [/* @__PURE__ */ p(H, {
981
981
  variant: "outline-secondary",
982
982
  size: "sm",
983
983
  disabled: !M && O.length === 0,
@@ -995,7 +995,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
995
995
  children: [
996
996
  /* @__PURE__ */ p("div", {
997
997
  className: "flex items-center gap-1",
998
- children: [/* @__PURE__ */ f(V, {
998
+ children: [/* @__PURE__ */ f(H, {
999
999
  variant: "outline-secondary",
1000
1000
  size: "icon-md",
1001
1001
  className: "h-10 w-10 sm:h-8 sm:w-8",
@@ -1011,7 +1011,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
1011
1011
  "aria-hidden": "true",
1012
1012
  className: "h-3.5 w-3.5"
1013
1013
  })
1014
- }), /* @__PURE__ */ f(V, {
1014
+ }), /* @__PURE__ */ f(H, {
1015
1015
  variant: "outline-secondary",
1016
1016
  size: "icon-md",
1017
1017
  className: "h-10 w-10 sm:h-8 sm:w-8",
@@ -1057,7 +1057,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
1057
1057
  }),
1058
1058
  /* @__PURE__ */ p("div", {
1059
1059
  className: "flex items-center gap-1",
1060
- children: [/* @__PURE__ */ f(V, {
1060
+ children: [/* @__PURE__ */ f(H, {
1061
1061
  variant: "outline-secondary",
1062
1062
  size: "icon-md",
1063
1063
  className: "h-10 w-10 sm:h-8 sm:w-8",
@@ -1073,7 +1073,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
1073
1073
  "aria-hidden": "true",
1074
1074
  className: "h-3.5 w-3.5"
1075
1075
  })
1076
- }), /* @__PURE__ */ f(V, {
1076
+ }), /* @__PURE__ */ f(H, {
1077
1077
  variant: "outline-secondary",
1078
1078
  size: "icon-md",
1079
1079
  className: "h-10 w-10 sm:h-8 sm:w-8",
@@ -1152,7 +1152,7 @@ var Je = ae(), Ye = ({ data: e, columnDef: n, pageSize: r = 10, className: i, sh
1152
1152
  label: e.columnDef.meta?.headerLabel ?? e.id
1153
1153
  }))]
1154
1154
  })]
1155
- }), /* @__PURE__ */ f(V, {
1155
+ }), /* @__PURE__ */ f(H, {
1156
1156
  variant: "outline-secondary",
1157
1157
  size: "icon-sm",
1158
1158
  disabled: O.length === 0,
@@ -1262,7 +1262,7 @@ function Xe({ value: e, onChange: t, debounce: n = 500, ...r }) {
1262
1262
  i,
1263
1263
  n,
1264
1264
  t
1265
- ]), /* @__PURE__ */ f(K, {
1265
+ ]), /* @__PURE__ */ f(q, {
1266
1266
  ...r,
1267
1267
  value: i,
1268
1268
  onChange: (e) => a(e.target.value),
@@ -1301,9 +1301,9 @@ function Ze({ column: e, idPrefix: t = "" }) {
1301
1301
  });
1302
1302
  }
1303
1303
  function Qe({ table: e }) {
1304
- return /* @__PURE__ */ p(G, {
1304
+ return /* @__PURE__ */ p(K, {
1305
1305
  trigger: "click",
1306
- triggerRender: /* @__PURE__ */ f(V, {
1306
+ triggerRender: /* @__PURE__ */ f(H, {
1307
1307
  variant: "outline-secondary",
1308
1308
  size: "sm",
1309
1309
  title: "Toggle columns",
@@ -1316,7 +1316,7 @@ function Qe({ table: e }) {
1316
1316
  className: "flex flex-col",
1317
1317
  children: e.getAllLeafColumns().map((e) => {
1318
1318
  let n = e.columnDef.meta?.headerLabel ?? e.id, r = e.getCanHide(), i = e.getIsVisible();
1319
- return /* @__PURE__ */ p(V, {
1319
+ return /* @__PURE__ */ p(H, {
1320
1320
  variant: "ghost",
1321
1321
  size: "sm",
1322
1322
  disabled: !r,
@@ -1330,8 +1330,7 @@ function Qe({ table: e }) {
1330
1330
  children: [/* @__PURE__ */ f(O, { className: "mr-1.5 h-3 w-3" }), "Columns"]
1331
1331
  });
1332
1332
  }
1333
- //#endregion
1334
- //#region components/text-link.tsx
1333
+ // components/text-link.tsx
1335
1334
  var $e = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }) => /* @__PURE__ */ f("a", {
1336
1335
  className: t("arc-text-link rounded-md text-primary underline transition hover:text-primary/80 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-opacity-75", e),
1337
1336
  href: n,
@@ -1339,7 +1338,7 @@ var $e = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }
1339
1338
  rel: a ?? (i === "_blank" ? "noopener noreferrer" : void 0),
1340
1339
  ...o,
1341
1340
  children: r
1342
- }), et = ({ checked: e = !1, onChange: n, disabled: r = !1, variant: i = "primary", children: a, ...o }) => /* @__PURE__ */ f(xe.Root, {
1341
+ }), et = ({ checked: e = !1, onChange: n, disabled: r = !1, variant: i = "primary", children: a, ...o }) => /* @__PURE__ */ f(be.Root, {
1343
1342
  checked: e,
1344
1343
  disabled: r,
1345
1344
  onCheckedChange: n,
@@ -1348,7 +1347,7 @@ var $e = ({ className: e, href: n, text: r, target: i = "_blank", rel: a, ...o }
1348
1347
  disabled: r
1349
1348
  })),
1350
1349
  ...o,
1351
- children: a ? a(e) : /* @__PURE__ */ f(xe.Thumb, {
1350
+ children: a ? a(e) : /* @__PURE__ */ f(be.Thumb, {
1352
1351
  "aria-hidden": "true",
1353
1352
  className: nt({
1354
1353
  variant: i,
@@ -1555,8 +1554,7 @@ function ct({ variant: e = "dropdown", showLabel: n = !1 }) {
1555
1554
  })
1556
1555
  });
1557
1556
  }
1558
- //#endregion
1559
- //#region components/typing-animation.tsx
1557
+ // components/typing-animation.tsx
1560
1558
  function lt(e) {
1561
1559
  return e === "newline" ? "\n" : e === "comma" ? ", " : "";
1562
1560
  }
@@ -1646,13 +1644,13 @@ function dt({ strings: e, placeholder: t, perTick: n = {
1646
1644
  O,
1647
1645
  v
1648
1646
  ]);
1649
- let R = A ? "." : "", z = d !== "clear", B = lt(d), ee = w.reduce((e, t) => e + t.split("\n").length, 0);
1647
+ let R = A ? "." : "", z = d !== "clear", B = lt(d), V = w.reduce((e, t) => e + t.split("\n").length, 0);
1650
1648
  return z ? /* @__PURE__ */ f("div", {
1651
1649
  ref: (e) => {
1652
1650
  M.current = e;
1653
1651
  },
1654
1652
  className: "arc-typing-animation overflow-hidden",
1655
- style: { "--typing-roll-offset": ee },
1653
+ style: { "--typing-roll-offset": V },
1656
1654
  children: /* @__PURE__ */ p("div", {
1657
1655
  className: "whitespace-pre-line",
1658
1656
  children: [
@@ -1676,8 +1674,7 @@ function dt({ strings: e, placeholder: t, perTick: n = {
1676
1674
  })]
1677
1675
  });
1678
1676
  }
1679
- //#endregion
1680
- //#region utilities/hash-navigation.ts
1677
+ // utilities/hash-navigation.ts
1681
1678
  function ft({ intervalMs: e = 500, maxAttempts: t = 20, behavior: n = "smooth", block: r } = {}) {
1682
1679
  if (typeof window > "u") return () => {};
1683
1680
  let i = 0, a = setInterval(() => {
@@ -1711,5 +1708,4 @@ function mt({ container: e, sectionIds: t, hashFirstSection: n = !0, onActiveCha
1711
1708
  };
1712
1709
  return o(), e.addEventListener("scroll", o, { passive: !0 }), () => e.removeEventListener("scroll", o);
1713
1710
  }
1714
- //#endregion
1715
- export { De as Avatar, V as Button, Se as ButtonGroup, q as Card, J as DateHandler, Oe as Divider, we as DoubleClickButton, ke as Dropdown, H as ErrorText, Me as GridLoader, K as Input, Ie as InputTimestamp, Ne as LabelField, Te as LongPressButton, X as Menu, Be as Modal, Ve as MultiDropdown, Y as Pill, Re as PillLink, G as PreviewCard, Z as Select, et as Switch, Ye as Table, Ue as Tag, $e as TextLink, ct as ThemeSwitcher, dt as TypingAnimation, ft as navigateToHashOnLoad, mt as updateHashOnScroll, pt as useHashNavigationOnLoad };
1711
+ export { Ee as Avatar, H as Button, xe as ButtonGroup, J as Card, Fe as DateHandler, De as Divider, Ce as DoubleClickButton, Oe as Dropdown, U as ErrorText, je as GridLoader, q as Input, Ie as InputTimestamp, Me as LabelField, we as LongPressButton, X as Menu, Be as Modal, Ve as MultiDropdown, Y as Pill, Re as PillLink, K as PreviewCard, Z as Select, et as Switch, Ye as Table, Ue as Tag, $e as TextLink, ct as ThemeSwitcher, dt as TypingAnimation, ft as navigateToHashOnLoad, mt as updateHashOnScroll, pt as useHashNavigationOnLoad };
@@ -12,5 +12,5 @@ export interface GridLoaderProps extends React.ComponentPropsWithoutRef<"span">
12
12
  label?: string;
13
13
  symbols?: string[];
14
14
  }
15
- declare const GridLoader: ({ className, rows, columns, size, maxSize, shape, shapes, colors, label, symbols, style, ...props }: GridLoaderProps) => import('react').JSX.Element;
15
+ declare const GridLoader: ({ className, rows, columns, size, maxSize, shape, shapes, colors, label, symbols, title, style, ...props }: GridLoaderProps) => import('react').JSX.Element;
16
16
  export default GridLoader;
package/package.json CHANGED
@@ -1,67 +1,67 @@
1
- {
2
- "name": "@febkosq8/arc",
3
- "description": "A React components library for febkosq8",
4
- "private": false,
5
- "version": "0.8.0",
6
- "type": "module",
7
- "main": "./dist/arc.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/arc.js"
13
- },
14
- "./styles.css": "./components/index.css"
15
- },
16
- "files": [
17
- "dist",
18
- "components/index.css"
19
- ],
20
- "homepage": "https://www.npmjs.com/package/@febkosq8/arc",
21
- "repository": "https://github.com/febkosq8/arc",
22
- "packageManager": "pnpm@12.14.0",
23
- "scripts": {
24
- "build": "vite build",
25
- "storybook": "storybook dev -p 6006",
26
- "build-storybook": "storybook build",
27
- "prettier": "prettier --write .",
28
- "push-npm": "npm publish --access public",
29
- "prepublishOnly": "pnpm run build"
30
- },
31
- "peerDependencies": {
32
- "react": "19.3.1",
33
- "react-dom": "19.3.1"
34
- },
35
- "dependencies": {
36
- "@base-ui/react": "1.9.0",
37
- "@rinzai/zen": "0.14.0",
38
- "@tanstack/match-sorter-utils": "9.2.6",
39
- "@tanstack/react-table": "9.3.1",
40
- "luxon": "3.7.2",
41
- "react-icons": "5.7.0"
42
- },
43
- "devDependencies": {
44
- "@storybook/addon-docs": "10.6.2",
45
- "@storybook/react-vite": "10.6.2",
46
- "@tailwindcss/postcss": "4.3.3",
47
- "@types/luxon": "3.7.6",
48
- "@types/node": "26.6.5",
49
- "@types/react": "19.3.0",
50
- "@types/react-dom": "19.3.0",
51
- "@typescript/typescript6": "6.0.2",
52
- "@vitejs/plugin-react": "6.1.2",
53
- "eslint": "10.13.0",
54
- "prettier": "3.9.10",
55
- "prettier-plugin-css-order": "2.2.0",
56
- "prettier-plugin-organize-attributes": "1.0.0",
57
- "prettier-plugin-organize-imports": "4.3.0",
58
- "prettier-plugin-tailwindcss": "0.8.1",
59
- "react": "19.3.1",
60
- "react-dom": "19.3.1",
61
- "storybook": "10.6.2",
62
- "tailwindcss": "4.3.3",
63
- "typescript": "7.0.2",
64
- "unplugin-dts": "1.1.2",
65
- "vite": "8.3.4"
66
- }
67
- }
1
+ {
2
+ "name": "@febkosq8/arc",
3
+ "description": "A React components library for febkosq8",
4
+ "private": false,
5
+ "version": "0.8.2",
6
+ "type": "module",
7
+ "main": "./dist/arc.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/arc.js"
13
+ },
14
+ "./styles.css": "./components/index.css"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "components/index.css"
19
+ ],
20
+ "homepage": "https://www.npmjs.com/package/@febkosq8/arc",
21
+ "repository": "https://github.com/febkosq8/arc",
22
+ "packageManager": "pnpm@12.15.0",
23
+ "scripts": {
24
+ "build": "vite build",
25
+ "storybook": "storybook dev -p 6006",
26
+ "build-storybook": "storybook build",
27
+ "prettier": "prettier --write .",
28
+ "push-npm": "npm publish --access public",
29
+ "prepublishOnly": "pnpm run build"
30
+ },
31
+ "peerDependencies": {
32
+ "react": "19.3.1",
33
+ "react-dom": "19.3.1"
34
+ },
35
+ "dependencies": {
36
+ "@base-ui/react": "1.9.0",
37
+ "@rinzai/zen": "0.14.0",
38
+ "@tanstack/match-sorter-utils": "9.2.6",
39
+ "@tanstack/react-table": "9.3.1",
40
+ "luxon": "3.7.2",
41
+ "react-icons": "5.7.0"
42
+ },
43
+ "devDependencies": {
44
+ "@storybook/addon-docs": "10.6.3",
45
+ "@storybook/react-vite": "10.6.3",
46
+ "@tailwindcss/postcss": "4.3.3",
47
+ "@types/luxon": "3.7.6",
48
+ "@types/node": "26.6.5",
49
+ "@types/react": "19.3.0",
50
+ "@types/react-dom": "19.3.0",
51
+ "@typescript/typescript6": "6.0.2",
52
+ "@vitejs/plugin-react": "6.1.2",
53
+ "eslint": "10.13.0",
54
+ "prettier": "3.9.10",
55
+ "prettier-plugin-css-order": "2.2.0",
56
+ "prettier-plugin-organize-attributes": "1.0.0",
57
+ "prettier-plugin-organize-imports": "4.3.0",
58
+ "prettier-plugin-tailwindcss": "0.8.1",
59
+ "react": "19.3.1",
60
+ "react-dom": "19.3.1",
61
+ "storybook": "10.6.3",
62
+ "tailwindcss": "4.3.3",
63
+ "typescript": "7.0.2",
64
+ "unplugin-dts": "1.1.2",
65
+ "vite": "8.3.5"
66
+ }
67
+ }