@stamcat/craftsman 0.0.28 → 0.0.29

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,23 +1,11 @@
1
1
  //#region \0rolldown/runtime.js
2
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
2
+ var e = Object.defineProperty, t = (t, n) => {
3
3
  let r = {};
4
- for (var i in e) t(r, i, {
5
- get: e[i],
4
+ for (var i in t) e(r, i, {
5
+ get: t[i],
6
6
  enumerable: !0
7
7
  });
8
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
9
- }, c = (e, i, o, s) => {
10
- if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
11
- get: ((e) => i[e]).bind(null, d),
12
- enumerable: !(s = n(i, d)) || s.enumerable
13
- });
14
- return e;
15
- }, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
16
- value: n,
17
- enumerable: !0
18
- }) : a, n)), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
19
- if (typeof require < "u") return require.apply(this, arguments);
20
- throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
21
- });
8
+ return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
9
+ };
22
10
  //#endregion
23
- export { o as __commonJSMin, s as __exportAll, u as __require, l as __toESM };
11
+ export { t as __exportAll };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamcat/craftsman",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "type": "module",
5
5
  "description": "A powerful, lightweight framework for design systems",
6
6
  "repository": {
@@ -30,11 +30,9 @@
30
30
  "country-flag-icons": "1.6.20",
31
31
  "dompurify": "3.4.13",
32
32
  "embla-carousel-react": "8.6.0",
33
- "react": "19.2.7",
34
33
  "react-date-picker": "12.0.2",
35
34
  "react-datetime-picker": "7.0.2",
36
35
  "react-device-detect": "2.2.3",
37
- "react-dom": "19.2.7",
38
36
  "react-icons": "5.7.0",
39
37
  "react-international-phone": "4.8.0",
40
38
  "react-intl": "10.1.20",
@@ -44,6 +42,10 @@
44
42
  "typescript-plugin-css-modules": "5.2.0",
45
43
  "zod": "4.4.3"
46
44
  },
45
+ "peerDependencies": {
46
+ "react": "19.2.7",
47
+ "react-dom": "19.2.7"
48
+ },
47
49
  "devDependencies": {},
48
50
  "overrides": {
49
51
  "postcss": "8.5.23",
@@ -2,25 +2,25 @@
2
2
  import { InputWrapper as e } from "../Input/InputWrapper.esm.js";
3
3
  import './DateRangePicker.css';import '../DatePicker/ReactCalendar.css';/* empty css */
4
4
  /* empty css */
5
- import t from "../../../node_modules/@wojtekmaj/react-daterange-picker/dist/DateRangePicker.esm.js";
6
- import n from "clsx";
7
- import { jsx as r } from "react/jsx-runtime";
8
- import { useId as i } from "react";
9
- import { FaRegCalendar as a, FaX as o } from "react-icons/fa6";
5
+ import t from "clsx";
6
+ import { jsx as n } from "react/jsx-runtime";
7
+ import { useId as r } from "react";
8
+ import { FaRegCalendar as i, FaX as a } from "react-icons/fa6";
9
+ import { DateRangePicker as o } from "@wojtekmaj/react-daterange-picker";
10
10
  //#region src/components/DateRangePicker/DateRangePicker.tsx
11
11
  var s = ({ label: s, id: c, labelPosition: l = "top", required: u = !1, error: d, style: f, className: p, ...m }) => {
12
- let h = i();
13
- return /* @__PURE__ */ r(e, {
12
+ let h = r();
13
+ return /* @__PURE__ */ n(e, {
14
14
  id: c || h,
15
- className: n("dateRangePicker", p),
15
+ className: t("dateRangePicker", p),
16
16
  label: s,
17
17
  labelPosition: l,
18
18
  error: d,
19
19
  required: u,
20
20
  style: f,
21
- children: /* @__PURE__ */ r(t, {
22
- calendarIcon: /* @__PURE__ */ r(a, { size: 16 }),
23
- clearIcon: /* @__PURE__ */ r(o, { size: 14 }),
21
+ children: /* @__PURE__ */ n(o, {
22
+ calendarIcon: /* @__PURE__ */ n(i, { size: 16 }),
23
+ clearIcon: /* @__PURE__ */ n(a, { size: 14 }),
24
24
  ...m
25
25
  })
26
26
  });
@@ -4,17 +4,17 @@ import { InputWrapper as t } from "../Input/InputWrapper.esm.js";
4
4
  import './DateTimePicker.css';import '../DatePicker/ReactCalendar.css';/* empty css */
5
5
  import { resolveLocale as n } from "../TimePicker/utilities.esm.js";
6
6
  import { TimePickerDisplay as r } from "../TimePicker/TimePickerDisplay.esm.js";
7
- import { require_lib as i } from "../../../node_modules/react-device-detect/dist/lib.esm.js";
8
7
  /* empty css */
9
- import a from "clsx";
10
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
11
- import { useEffect as c, useId as l, useRef as u, useState as d } from "react";
12
- import { FaRegCalendar as f, FaX as p } from "react-icons/fa6";
8
+ import i from "clsx";
9
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
10
+ import { useEffect as s, useId as c, useRef as l, useState as u } from "react";
11
+ import { FaRegCalendar as d, FaX as f } from "react-icons/fa6";
12
+ import { isMobile as p } from "react-device-detect";
13
13
  import { DateTimePicker as m } from "react-datetime-picker";
14
14
  //#region src/components/DateTimePicker/DateTimePicker.tsx
15
- var h = i(), g = ({ label: i, id: g, labelPosition: _ = "top", required: v = !1, error: y, style: b, className: x, locale: S, labels: C, format: w, value: T, onChange: E, ...D }) => {
16
- let O = l(), k = g || O, A = u(null), [j, M] = d(!1), N = n(S);
17
- c(() => {
15
+ var h = ({ label: h, id: g, labelPosition: _ = "top", required: v = !1, error: y, style: b, className: x, locale: S, labels: C, format: w, value: T, onChange: E, ...D }) => {
16
+ let O = c(), k = g || O, A = l(null), [j, M] = u(!1), N = n(S);
17
+ s(() => {
18
18
  if (!j) return;
19
19
  let e = (e) => {
20
20
  let t = e.target;
@@ -25,7 +25,7 @@ var h = i(), g = ({ label: i, id: g, labelPosition: _ = "top", required: v = !1,
25
25
  };
26
26
  }, [j]);
27
27
  let P = () => {
28
- if (!h.isMobile && T instanceof Date) {
28
+ if (!p && T instanceof Date) {
29
29
  M(!0);
30
30
  return;
31
31
  }
@@ -33,40 +33,40 @@ var h = i(), g = ({ label: i, id: g, labelPosition: _ = "top", required: v = !1,
33
33
  }, F = (e) => {
34
34
  e.target instanceof HTMLInputElement && P();
35
35
  }, I = (e) => {
36
- h.isMobile && e.key === "Enter" && M(!1);
36
+ p && e.key === "Enter" && M(!1);
37
37
  }, L = (e) => {
38
38
  let [t, n] = e.split(":"), r = Number(t), i = Number(n);
39
39
  if (Number.isNaN(r) || Number.isNaN(i)) return;
40
40
  let a = T instanceof Date ? new Date(T) : /* @__PURE__ */ new Date();
41
41
  a.setHours(r, i, 0, 0), E?.(a);
42
42
  };
43
- return /* @__PURE__ */ o("div", {
43
+ return /* @__PURE__ */ a("div", {
44
44
  ref: A,
45
45
  className: "dateTimePicker",
46
46
  onKeyDown: I,
47
- children: /* @__PURE__ */ s(t, {
47
+ children: /* @__PURE__ */ o(t, {
48
48
  id: k,
49
49
  onFocus: F,
50
- className: a(x, "dateTimePicker_wrapper"),
51
- label: i,
50
+ className: i(x, "dateTimePicker_wrapper"),
51
+ label: h,
52
52
  labelPosition: _,
53
53
  error: y,
54
54
  required: v,
55
55
  style: b,
56
56
  value: T instanceof Date ? T.toISOString() : void 0,
57
- children: [/* @__PURE__ */ o(m, {
57
+ children: [/* @__PURE__ */ a(m, {
58
58
  isClockOpen: !1,
59
59
  onClockOpen: P,
60
60
  onClockClose: () => {},
61
61
  onCalendarOpen: () => M(!1),
62
- calendarIcon: /* @__PURE__ */ o(f, { size: 16 }),
63
- clearIcon: /* @__PURE__ */ o(p, { size: 14 }),
62
+ calendarIcon: /* @__PURE__ */ a(d, { size: 16 }),
63
+ clearIcon: /* @__PURE__ */ a(f, { size: 14 }),
64
64
  value: T,
65
65
  onChange: E,
66
66
  ...D
67
- }), j && /* @__PURE__ */ o("div", {
67
+ }), j && /* @__PURE__ */ a("div", {
68
68
  className: "dateTimePicker__time-display",
69
- children: /* @__PURE__ */ o(r, {
69
+ children: /* @__PURE__ */ a(r, {
70
70
  value: e(T, S),
71
71
  onChange: L,
72
72
  locale: N,
@@ -79,4 +79,4 @@ var h = i(), g = ({ label: i, id: g, labelPosition: _ = "top", required: v = !1,
79
79
  });
80
80
  };
81
81
  //#endregion
82
- export { g as DateTimePicker };
82
+ export { h as DateTimePicker };
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { combine as e } from "../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.esm.js";
3
- import { draggable as t, dropTargetForElements as n } from "../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.esm.js";
4
- import { isItemData as r } from "./utilities.esm.js";
5
- import i from "clsx";
6
- import { jsx as a } from "react/jsx-runtime";
7
- import { useEffect as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
2
+ import { isItemData as e } from "./utilities.esm.js";
3
+ import t from "clsx";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ import { useEffect as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
6
+ import { draggable as s, dropTargetForElements as c } from "@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter";
7
+ import { combine as l } from "@atlaskit/pragmatic-drag-and-drop/utils/combine";
8
8
  //#region src/components/SortableList/ListItem.tsx
9
9
  function u({ item: u, index: d, getKey: f, renderItem: p, disabled: m, listId: h }) {
10
- let [g, _] = l(null), [v, y] = l(null), [b, x] = l(!1), [S, C] = l(null), w = c(null), T = c(null), E = f(u, d);
11
- return s(() => {
10
+ let [g, _] = o(null), [v, y] = o(null), [b, x] = o(!1), [S, C] = o(null), w = a(null), T = a(null), E = f(u, d);
11
+ return i(() => {
12
12
  w.current = g;
13
13
  let e = w.current;
14
14
  if (!e) return;
@@ -18,24 +18,24 @@ function u({ item: u, index: d, getKey: f, renderItem: p, disabled: m, listId: h
18
18
  !r || window.matchMedia("(prefers-reduced-motion: reduce)").matches || (e.style.transition = "none", e.style.transform = `translateY(${r}px)`, requestAnimationFrame(() => {
19
19
  e.style.transition = "", e.style.transform = "";
20
20
  }));
21
- }, [g, d]), o(() => {
21
+ }, [g, d]), r(() => {
22
22
  if (!g || m) return;
23
- let i = {
23
+ let t = {
24
24
  key: E,
25
25
  index: d,
26
26
  listId: h,
27
27
  item: u
28
28
  };
29
- return e(t({
29
+ return l(s({
30
30
  element: g,
31
31
  dragHandle: v ?? void 0,
32
- getInitialData: () => i,
32
+ getInitialData: () => t,
33
33
  onDragStart: () => x(!0),
34
34
  onDrop: () => x(!1)
35
- }), n({
35
+ }), c({
36
36
  element: g,
37
- getData: () => i,
38
- canDrop: ({ source: e }) => r(e.data) && e.data.key !== E,
37
+ getData: () => t,
38
+ canDrop: ({ source: t }) => e(t.data) && t.data.key !== E,
39
39
  onDrag: ({ location: e }) => {
40
40
  let t = g.getBoundingClientRect(), n = e.current.input.clientY > t.top + t.height / 2;
41
41
  C(n ? "bottom" : "top");
@@ -51,9 +51,9 @@ function u({ item: u, index: d, getKey: f, renderItem: p, disabled: m, listId: h
51
51
  m,
52
52
  h,
53
53
  u
54
- ]), /* @__PURE__ */ a("li", {
54
+ ]), /* @__PURE__ */ n("li", {
55
55
  ref: _,
56
- className: i("sortable-list-item", b && "dragging", S && `drop-${S}`),
56
+ className: t("sortable-list-item", b && "dragging", S && `drop-${S}`),
57
57
  children: p({
58
58
  item: u,
59
59
  index: d,
@@ -1,20 +1,20 @@
1
1
  "use client";
2
- import { monitorForElements as e } from "../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.esm.js";
3
- import { reorder as t } from "../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/reorder.esm.js";
4
2
  import './SortableList.css';/* empty css */
5
- import { isItemData as n } from "./utilities.esm.js";
6
- import { SortableListItem as r } from "./ListItem.esm.js";
7
- import i from "clsx";
8
- import { jsx as a } from "react/jsx-runtime";
9
- import { useEffect as o, useId as s } from "react";
3
+ import { isItemData as e } from "./utilities.esm.js";
4
+ import { SortableListItem as t } from "./ListItem.esm.js";
5
+ import n from "clsx";
6
+ import { jsx as r } from "react/jsx-runtime";
7
+ import { useEffect as i, useId as a } from "react";
8
+ import { monitorForElements as o } from "@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter";
9
+ import { reorder as s } from "@atlaskit/pragmatic-drag-and-drop/utils/reorder";
10
10
  //#region src/components/SortableList/SortableList.tsx
11
11
  var c = ({ items: c, getKey: l, renderItem: u, onReorder: d, disabled: f, className: p, style: m, listId: h, onReceive: g }) => {
12
- let _ = s(), v = h ?? _, y = (e, n) => {
13
- let r = c.findIndex((t, n) => l(t, n) === e), i = c.findIndex((e, t) => l(e, t) === n);
14
- r === -1 || i === -1 || r === i || d(t({
12
+ let _ = a(), v = h ?? _, y = (e, t) => {
13
+ let n = c.findIndex((t, n) => l(t, n) === e), r = c.findIndex((e, n) => l(e, n) === t);
14
+ n === -1 || r === -1 || n === r || d(s({
15
15
  list: c,
16
- startIndex: r,
17
- finishIndex: i
16
+ startIndex: n,
17
+ finishIndex: r
18
18
  }));
19
19
  }, b = (e) => {
20
20
  let t = c.findIndex((t, n) => l(t, n) === e);
@@ -23,12 +23,12 @@ var c = ({ items: c, getKey: l, renderItem: u, onReorder: d, disabled: f, classN
23
23
  let n = c.findIndex((e, n) => l(e, n) === t);
24
24
  g?.(e, n === -1 ? c.length : n);
25
25
  };
26
- return o(() => {
27
- if (!f) return e({ onDrop: ({ source: e, location: t }) => {
28
- let r = t.current.dropTargets[0];
29
- if (!r || !n(e.data) || !n(r.data)) return;
30
- let i = e.data.listId, a = r.data.listId, o = i === v, s = a === v;
31
- o && s ? y(e.data.key, r.data.key) : o ? b(e.data.key) : s && g && x(e.data.item, r.data.key);
26
+ return i(() => {
27
+ if (!f) return o({ onDrop: ({ source: t, location: n }) => {
28
+ let r = n.current.dropTargets[0];
29
+ if (!r || !e(t.data) || !e(r.data)) return;
30
+ let i = t.data.listId, a = r.data.listId, o = i === v, s = a === v;
31
+ o && s ? y(t.data.key, r.data.key) : o ? b(t.data.key) : s && g && x(t.data.item, r.data.key);
32
32
  } });
33
33
  }, [
34
34
  c,
@@ -37,17 +37,17 @@ var c = ({ items: c, getKey: l, renderItem: u, onReorder: d, disabled: f, classN
37
37
  f,
38
38
  v,
39
39
  g
40
- ]), /* @__PURE__ */ a("ul", {
41
- className: i("sortable-list", p),
40
+ ]), /* @__PURE__ */ r("ul", {
41
+ className: n("sortable-list", p),
42
42
  style: m,
43
- children: c.map((e, t) => /* @__PURE__ */ a(r, {
43
+ children: c.map((e, n) => /* @__PURE__ */ r(t, {
44
44
  item: e,
45
- index: t,
45
+ index: n,
46
46
  getKey: l,
47
47
  renderItem: u,
48
48
  disabled: f,
49
49
  listId: v
50
- }, l(e, t)))
50
+ }, l(e, n)))
51
51
  });
52
52
  };
53
53
  //#endregion
@@ -4,29 +4,29 @@ import { InputWrapper as t } from "../Input/InputWrapper.esm.js";
4
4
  import './TimePicker.css';/* empty css */
5
5
  import { resolveLocale as n } from "./utilities.esm.js";
6
6
  import { TimePickerDisplay as r } from "./TimePickerDisplay.esm.js";
7
- import { require_lib as i } from "../../../node_modules/react-device-detect/dist/lib.esm.js";
8
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
9
- import { useEffect as s, useState as c } from "react";
10
- import { FaClock as l, FaRegClock as u, FaX as d } from "react-icons/fa6";
11
- import { autoUpdate as f, flip as p, offset as m, shift as h, useFloating as g } from "@floating-ui/react-dom";
12
- import { TimePicker as _ } from "react-time-picker";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
+ import { useEffect as o, useState as s } from "react";
9
+ import { FaClock as c, FaRegClock as l, FaX as u } from "react-icons/fa6";
10
+ import { autoUpdate as d, flip as f, offset as p, shift as m, useFloating as h } from "@floating-ui/react-dom";
11
+ import { TimePicker as g } from "react-time-picker";
12
+ import { isMobile as _ } from "react-device-detect";
13
13
  //#region src/components/TimePicker/TimePicker.tsx
14
- var v = i(), y = (i) => {
15
- let { labels: y, locale: b, format: x, value: S, onChange: C, label: w, labelPosition: T, error: E, required: D, name: O, ...k } = i, [A, j] = c(null), [M, N] = c(null), { floatingStyles: P } = g({
14
+ var v = (v) => {
15
+ let { labels: y, locale: b, format: x, value: S, onChange: C, label: w, labelPosition: T, error: E, required: D, name: O, ...k } = v, [A, j] = s(null), [M, N] = s(null), { floatingStyles: P } = h({
16
16
  placement: "bottom-start",
17
17
  strategy: "absolute",
18
- whileElementsMounted: f,
18
+ whileElementsMounted: d,
19
19
  middleware: [
20
- m(4),
21
- p(),
22
- h()
20
+ p(4),
21
+ f(),
22
+ m()
23
23
  ],
24
24
  elements: {
25
25
  reference: A,
26
26
  floating: M
27
27
  }
28
- }), [F, I] = c(!1), L = n(b);
29
- return s(() => {
28
+ }), [F, I] = s(!1), L = n(b);
29
+ return o(() => {
30
30
  if (!F) return;
31
31
  let e = (e) => {
32
32
  A?.contains(e.target) || M?.contains(e.target) || I(!1);
@@ -38,50 +38,50 @@ var v = i(), y = (i) => {
38
38
  F,
39
39
  A,
40
40
  M
41
- ]), /* @__PURE__ */ o("div", {
41
+ ]), /* @__PURE__ */ a("div", {
42
42
  className: "timePicker",
43
43
  ref: j,
44
44
  onFocus: (e) => {
45
- v.isMobile || e.target instanceof HTMLInputElement && I(!0);
45
+ _ || e.target instanceof HTMLInputElement && I(!0);
46
46
  },
47
47
  onKeyDown: (e) => {
48
48
  e.key === "Enter" && I(!1);
49
49
  },
50
50
  children: [
51
- O && /* @__PURE__ */ a("input", {
51
+ O && /* @__PURE__ */ i("input", {
52
52
  type: "hidden",
53
53
  name: O,
54
54
  value: typeof S == "string" ? S : "",
55
55
  readOnly: !0
56
56
  }),
57
- /* @__PURE__ */ a(t, {
57
+ /* @__PURE__ */ i(t, {
58
58
  label: w,
59
59
  labelPosition: T,
60
60
  error: E,
61
61
  required: D,
62
- children: /* @__PURE__ */ o("div", {
62
+ children: /* @__PURE__ */ a("div", {
63
63
  className: "timePicker__field",
64
- children: [/* @__PURE__ */ a(_, {
64
+ children: [/* @__PURE__ */ i(g, {
65
65
  ...k,
66
66
  value: S,
67
67
  onChange: C,
68
68
  locale: L,
69
69
  required: D,
70
70
  disableClock: !0,
71
- clearIcon: /* @__PURE__ */ a(d, { size: 14 })
72
- }), !v.isMobile && /* @__PURE__ */ a(e, {
71
+ clearIcon: /* @__PURE__ */ i(u, { size: 14 })
72
+ }), !_ && /* @__PURE__ */ i(e, {
73
73
  type: "button",
74
74
  variant: "text",
75
75
  onClick: () => I((e) => !e),
76
76
  "aria-label": F ? "Hide time picker" : "Show time picker",
77
77
  "aria-pressed": F,
78
- disabled: i.disabled,
78
+ disabled: v.disabled,
79
79
  className: "input-view-toggle",
80
- children: a(F ? l : u, { size: 16 })
80
+ children: i(F ? c : l, { size: 16 })
81
81
  })]
82
82
  })
83
83
  }),
84
- !v.isMobile && /* @__PURE__ */ a(r, {
84
+ !_ && /* @__PURE__ */ i(r, {
85
85
  value: S,
86
86
  onChange: (e) => C?.(e),
87
87
  locale: L,
@@ -95,4 +95,4 @@ var v = i(), y = (i) => {
95
95
  });
96
96
  };
97
97
  //#endregion
98
- export { y as TimePicker };
98
+ export { v as TimePicker };