@pibit.ai/cure-design-system 0.3.26 → 0.3.30

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.
Files changed (39) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +96 -91
  4. package/dist/patterns/table/TableWrapper.d.ts +1 -1
  5. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  6. package/dist/patterns/table/TableWrapper.js +897 -542
  7. package/dist/patterns/table/cellRangeSelection.d.ts +64 -0
  8. package/dist/patterns/table/cellRangeSelection.d.ts.map +1 -0
  9. package/dist/patterns/table/cellRangeSelection.js +150 -0
  10. package/dist/patterns/table/cellRangeSelection.test.d.ts +2 -0
  11. package/dist/patterns/table/cellRangeSelection.test.d.ts.map +1 -0
  12. package/dist/patterns/table/index.d.ts +3 -2
  13. package/dist/patterns/table/index.d.ts.map +1 -1
  14. package/dist/patterns/table/rowReorderDrag.d.ts +70 -0
  15. package/dist/patterns/table/rowReorderDrag.d.ts.map +1 -0
  16. package/dist/patterns/table/rowReorderDrag.js +151 -0
  17. package/dist/patterns/table/rowReorderDrag.test.d.ts +2 -0
  18. package/dist/patterns/table/rowReorderDrag.test.d.ts.map +1 -0
  19. package/dist/patterns/table/table.d.ts.map +1 -1
  20. package/dist/patterns/table/table.js +36 -36
  21. package/dist/patterns/table/tableUndoRedo.d.ts.map +1 -1
  22. package/dist/patterns/table/tableUndoRedo.js +21 -18
  23. package/dist/patterns/table/toolbar/RowActionsMenu.d.ts +17 -1
  24. package/dist/patterns/table/toolbar/RowActionsMenu.d.ts.map +1 -1
  25. package/dist/patterns/table/toolbar/RowActionsMenu.js +69 -51
  26. package/dist/patterns/table/types.d.ts +29 -0
  27. package/dist/patterns/table/types.d.ts.map +1 -1
  28. package/dist/patterns/table/useTableUndoRedo.d.ts +9 -0
  29. package/dist/patterns/table/useTableUndoRedo.d.ts.map +1 -1
  30. package/dist/patterns/table/useTableUndoRedo.js +217 -127
  31. package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
  32. package/dist/primitives/checkbox/checkbox.js +16 -16
  33. package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
  34. package/dist/primitives/select/ExpandableSearchInput.js +2 -1
  35. package/dist/primitives/select/SearchInput.d.ts +7 -7
  36. package/dist/primitives/select/SearchInput.d.ts.map +1 -1
  37. package/dist/primitives/select/SearchInput.js +66 -62
  38. package/dist/styles/components.css +1 -1
  39. package/package.json +1 -1
@@ -1,48 +1,50 @@
1
- import { jsx as n, jsxs as g, Fragment as N } from "react/jsx-runtime";
2
- import { useRef as C, useCallback as f, useEffect as I, useMemo as L } from "react";
3
- import { SearchMd as E, XClose as P } from "@untitledui/icons";
4
- import { ComboBox as z, Group as R, Input as _ } from "react-aria-components";
1
+ import { jsx as a, jsxs as x, Fragment as C } from "react/jsx-runtime";
2
+ import { useRef as I, useCallback as h, useEffect as L, useMemo as E } from "react";
3
+ import { SearchMd as P, XClose as z } from "@untitledui/icons";
4
+ import { ComboBox as R, Group as _, Input as j } from "react-aria-components";
5
5
  import { cx as u } from "../../utils/cn.js";
6
- import { getPlatformShortcutLabel as j } from "../../utils/keyboard-shortcut.js";
7
- import { sizes as x } from "./select.js";
8
- import { ButtonUtility as q } from "../button/button-utility.js";
9
- const B = {
6
+ import { getPlatformShortcutLabel as q } from "../../utils/keyboard-shortcut.js";
7
+ import { sizes as w } from "./select.js";
8
+ import { ButtonUtility as B } from "../button/button-utility.js";
9
+ const G = {
10
10
  sm: "h-8",
11
11
  md: "h-9",
12
12
  lg: "h-11"
13
- }, G = ({
13
+ }, M = ({
14
14
  size: s,
15
15
  shortcut: i,
16
- placeholder: p,
16
+ bordered: p = !1,
17
+ placeholder: m,
17
18
  shortcutClassName: d,
18
- onKeyDown: m,
19
+ onKeyDown: f,
19
20
  onClear: o,
20
21
  hasValue: r,
21
22
  className: l
22
- }) => /* @__PURE__ */ n(
23
- R,
23
+ }) => /* @__PURE__ */ a(
24
+ _,
24
25
  {
25
- className: ({ isFocusWithin: a, isDisabled: c }) => u(
26
+ className: ({ isFocusWithin: n, isDisabled: c }) => u(
26
27
  "relative flex w-full items-center gap-2 rounded-md bg-primary outline-hidden transition-shadow duration-100 ease-linear ring-inset",
28
+ p && "border border-secondary",
27
29
  c && "cursor-not-allowed bg-disabled_subtle",
28
- a && "ring-1 ring-brand",
29
- B[s],
30
- x[s].root,
30
+ n && "ring-1 ring-brand",
31
+ G[s],
32
+ w[s].root,
31
33
  l
32
34
  ),
33
- children: ({ isDisabled: a }) => /* @__PURE__ */ g(N, { children: [
34
- /* @__PURE__ */ n(
35
- E,
35
+ children: ({ isDisabled: n }) => /* @__PURE__ */ x(C, { children: [
36
+ /* @__PURE__ */ a(
37
+ P,
36
38
  {
37
39
  color: "var(--color-utility-gray-300)",
38
40
  className: "pointer-events-none size-4 flex-shrink-0"
39
41
  }
40
42
  ),
41
- /* @__PURE__ */ n("div", { className: "relative flex w-full items-center gap-2", children: /* @__PURE__ */ n(
42
- _,
43
+ /* @__PURE__ */ a("div", { className: "relative flex w-full items-center gap-2", children: /* @__PURE__ */ a(
44
+ j,
43
45
  {
44
- placeholder: p,
45
- onKeyDown: m,
46
+ placeholder: m,
47
+ onKeyDown: f,
46
48
  className: u(
47
49
  "z-10 w-full appearance-none bg-transparent text-sm text-primary caret-alpha-black/90 placeholder:text-placeholder_subtle focus:outline-hidden disabled:cursor-not-allowed disabled:text-disabled disabled:placeholder:text-disabled",
48
50
  r && "pr-6",
@@ -50,34 +52,34 @@ const B = {
50
52
  )
51
53
  }
52
54
  ) }),
53
- /* @__PURE__ */ g("div", { className: "flex-shrink-0", children: [
54
- r && !a && /* @__PURE__ */ n(
55
- q,
55
+ /* @__PURE__ */ x("div", { className: "flex-shrink-0", children: [
56
+ r && !n && /* @__PURE__ */ a(
57
+ B,
56
58
  {
57
- icon: /* @__PURE__ */ n(P, { size: 14 }),
59
+ icon: /* @__PURE__ */ a(z, { size: 14 }),
58
60
  color: "tertiary",
59
61
  onClick: o,
60
62
  "aria-label": "Clear search"
61
63
  }
62
64
  ),
63
- i && !r && /* @__PURE__ */ n(
65
+ i && !r && /* @__PURE__ */ a(
64
66
  "div",
65
67
  {
66
68
  className: u(
67
69
  "pointer-events-none absolute inset-y-0.5 right-0.5 z-10 flex items-center rounded-r-[inherit] bg-linear-to-r from-transparent pl-8",
68
- a && "to-bg-disabled_subtle",
69
- x[s].shortcut,
70
+ n && "to-bg-disabled_subtle",
71
+ w[s].shortcut,
70
72
  d
71
73
  ),
72
- children: /* @__PURE__ */ n(
74
+ children: /* @__PURE__ */ a(
73
75
  "span",
74
76
  {
75
77
  className: u(
76
78
  "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
77
- a && "bg-transparent text-disabled"
79
+ n && "bg-transparent text-disabled"
78
80
  ),
79
81
  "aria-hidden": "true",
80
- children: j(["meta"], "K")
82
+ children: q(["meta"], "K")
81
83
  }
82
84
  )
83
85
  }
@@ -86,32 +88,33 @@ const B = {
86
88
  ] })
87
89
  }
88
90
  );
89
- function O({
91
+ function Q({
90
92
  size: s = "sm",
91
93
  shortcut: i = !1,
92
94
  registerShortcut: p,
95
+ bordered: m = !1,
93
96
  placeholder: d,
94
- shortcutClassName: m,
97
+ shortcutClassName: f,
95
98
  value: o,
96
99
  onChange: r,
97
100
  onKeyDown: l,
98
- className: a,
101
+ className: n,
99
102
  isDisabled: c = !1,
100
- "aria-label": w,
101
- ...k
103
+ "aria-label": k,
104
+ ...v
102
105
  }) {
103
- const h = C(null), y = p ?? i, b = f(() => {
106
+ const y = I(null), b = p ?? i, g = h(() => {
104
107
  var e, t;
105
- (t = (e = h.current) == null ? void 0 : e.querySelector("input")) == null || t.focus();
108
+ (t = (e = y.current) == null ? void 0 : e.querySelector("input")) == null || t.focus();
106
109
  }, []);
107
- I(() => {
108
- if (!y || c) return;
110
+ L(() => {
111
+ if (!b || c) return;
109
112
  const e = (t) => {
110
- (t.metaKey || t.ctrlKey) && !t.shiftKey && !t.altKey && t.key.toLowerCase() === "k" && (t.preventDefault(), t.stopPropagation(), b());
113
+ (t.metaKey || t.ctrlKey) && !t.shiftKey && !t.altKey && t.key.toLowerCase() === "k" && (t.preventDefault(), t.stopPropagation(), g());
111
114
  };
112
115
  return window.addEventListener("keydown", e, { capture: !0 }), () => window.removeEventListener("keydown", e, { capture: !0 });
113
- }, [y, c, b]);
114
- const v = f(
116
+ }, [b, c, g]);
117
+ const S = h(
115
118
  (e) => {
116
119
  if ((e.metaKey || e.ctrlKey) && !e.shiftKey && !e.altKey && e.key.toLowerCase() === "k") {
117
120
  e.preventDefault(), e.stopPropagation();
@@ -120,38 +123,39 @@ function O({
120
123
  e.key === "Enter" && (e.preventDefault(), e.stopPropagation()), l == null || l(e);
121
124
  },
122
125
  [l]
123
- ), S = f(() => {
126
+ ), K = h(() => {
124
127
  r == null || r("");
125
- }, [r]), K = L(() => !!o && o.length > 0, [o]);
126
- return /* @__PURE__ */ n(
127
- z,
128
+ }, [r]), N = E(() => !!o && o.length > 0, [o]);
129
+ return /* @__PURE__ */ a(
130
+ R,
128
131
  {
129
- ...k,
130
- ref: h,
132
+ ...v,
133
+ ref: y,
131
134
  inputValue: o,
132
135
  onInputChange: r,
133
136
  menuTrigger: "manual",
134
137
  items: [],
135
138
  allowsCustomValue: !0,
136
139
  isDisabled: c,
137
- "aria-label": w || d || "Search",
138
- className: u("w-xs", a),
139
- children: () => /* @__PURE__ */ n(
140
- G,
140
+ "aria-label": k || d || "Search",
141
+ className: u("w-xs", n),
142
+ children: () => /* @__PURE__ */ a(
143
+ M,
141
144
  {
142
145
  size: s,
143
146
  shortcut: i,
147
+ bordered: m,
144
148
  placeholder: d,
145
- shortcutClassName: m,
146
- onKeyDown: v,
147
- onClear: S,
148
- hasValue: K,
149
- className: a
149
+ shortcutClassName: f,
150
+ onKeyDown: S,
151
+ onClear: K,
152
+ hasValue: N,
153
+ className: n
150
154
  }
151
155
  )
152
156
  }
153
157
  );
154
158
  }
155
159
  export {
156
- O as default
160
+ Q as default
157
161
  };