@pibit.ai/cure-design-system 0.3.20 → 0.3.21

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 (31) hide show
  1. package/README.md +1 -0
  2. package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -1
  3. package/dist/applications/schedule-calendar/schedule-calendar.js +24 -22
  4. package/dist/applications/schedule-calendar/utils.d.ts +13 -3
  5. package/dist/applications/schedule-calendar/utils.d.ts.map +1 -1
  6. package/dist/applications/schedule-calendar/utils.js +136 -117
  7. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  8. package/dist/patterns/table/TableWrapper.js +776 -661
  9. package/dist/patterns/table/table.d.ts.map +1 -1
  10. package/dist/patterns/table/table.js +44 -43
  11. package/dist/patterns/table/toolbar/AlignDropdown.js +14 -14
  12. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +9 -0
  13. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
  14. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +115 -81
  15. package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
  16. package/dist/patterns/table/toolbar/SummaryFooter.js +34 -27
  17. package/dist/patterns/table/toolbar/index.d.ts +1 -1
  18. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  19. package/dist/patterns/table/toolbar/tableToolbarHelpers.js +1 -1
  20. package/dist/primitives/select/searchable-select.d.ts +5 -3
  21. package/dist/primitives/select/searchable-select.d.ts.map +1 -1
  22. package/dist/primitives/select/searchable-select.js +196 -177
  23. package/dist/primitives/select/select-item.d.ts.map +1 -1
  24. package/dist/primitives/select/select-item.js +70 -54
  25. package/dist/primitives/select/select.d.ts +7 -2
  26. package/dist/primitives/select/select.d.ts.map +1 -1
  27. package/dist/primitives/select/select.js +161 -137
  28. package/dist/primitives/tooltip/ellipsis-content.d.ts.map +1 -1
  29. package/dist/primitives/tooltip/ellipsis-content.js +46 -43
  30. package/dist/styles/components.css +1 -1
  31. package/package.json +1 -1
@@ -1,25 +1,28 @@
1
- import { jsxs as v, Fragment as y, jsx as u } from "react/jsx-runtime";
1
+ import { jsxs as v, Fragment as y, jsx as c } from "react/jsx-runtime";
2
2
  import { useState as w, useRef as x, useEffect as b } from "react";
3
3
  import { createPortal as P } from "react-dom";
4
- import { computePosition as M, offset as $, autoPlacement as E, size as R, shift as W } from "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
4
+ import { computePosition as $, offset as E, autoPlacement as M, size as W, shift as k } from "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
5
5
  import { cx as T } from "../../utils/cn.js";
6
- const j = ({
7
- content: e,
8
- className: c = "",
6
+ const z = (t) => {
7
+ const e = t.trim();
8
+ return e ? /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e) || e.startsWith("//") ? e : `https://${e}` : "";
9
+ }, R = ({
10
+ content: t,
11
+ className: e = "",
9
12
  link: f = !1,
10
13
  textClassName: m = "",
11
14
  tooltipClassName: h = ""
12
15
  }) => {
13
- const [i, a] = w(!1), [p, g] = w({ top: -9999, left: -9999 }), o = x(null), s = x(null), n = x(null);
16
+ const [a, s] = w(!1), [p, g] = w({ top: -9999, left: -9999 }), n = x(null), u = x(null), i = x(null);
14
17
  return b(() => () => {
15
- n.current != null && clearTimeout(n.current);
18
+ i.current != null && clearTimeout(i.current);
16
19
  }, []), b(() => {
17
- if (!i || !o.current || !s.current) return;
18
- let t = !1;
19
- return M(o.current, s.current, {
20
+ if (!a || !n.current || !u.current) return;
21
+ let r = !1;
22
+ return $(n.current, u.current, {
20
23
  middleware: [
21
- $(8),
22
- E({
24
+ E(8),
25
+ M({
23
26
  allowedPlacements: [
24
27
  "top-start",
25
28
  "top",
@@ -29,53 +32,53 @@ const j = ({
29
32
  "bottom-end"
30
33
  ]
31
34
  }),
32
- R({
35
+ W({
33
36
  padding: 8,
34
- apply({ availableWidth: r, availableHeight: l, elements: d }) {
37
+ apply({ availableWidth: o, availableHeight: l, elements: d }) {
35
38
  Object.assign(d.floating.style, {
36
- maxWidth: `${Math.min(r, 512)}px`,
39
+ maxWidth: `${Math.min(o, 512)}px`,
37
40
  maxHeight: `${Math.min(l, window.innerHeight * 0.4)}px`
38
41
  });
39
42
  }
40
43
  }),
41
- W({ padding: 8 })
44
+ k({ padding: 8 })
42
45
  ]
43
- }).then(({ x: r, y: l }) => {
44
- t || g({ top: l, left: r });
46
+ }).then(({ x: o, y: l }) => {
47
+ r || g({ top: l, left: o });
45
48
  }), () => {
46
- t = !0;
49
+ r = !0;
47
50
  };
48
- }, [i]), /* @__PURE__ */ v(y, { children: [
49
- /* @__PURE__ */ u(
51
+ }, [a]), /* @__PURE__ */ v(y, { children: [
52
+ /* @__PURE__ */ c(
50
53
  "span",
51
54
  {
52
- ref: o,
55
+ ref: n,
53
56
  className: T(
54
57
  "whitespace-nowrap overflow-hidden text-ellipsis w-full block",
55
58
  m,
56
- c,
59
+ e,
57
60
  f ? "!text-[var(--color-brand-600)]" : ""
58
61
  ),
59
62
  onMouseEnter: () => {
60
- !o.current || !(o.current.scrollWidth > o.current.clientWidth) || (g({ top: -9999, left: -9999 }), a(!0));
63
+ !n.current || !(n.current.scrollWidth > n.current.clientWidth) || (g({ top: -9999, left: -9999 }), s(!0));
61
64
  },
62
- onMouseLeave: (t) => {
63
- var r;
64
- (r = s.current) != null && r.contains(t.relatedTarget) || (n.current != null && clearTimeout(n.current), n.current = setTimeout(() => {
65
+ onMouseLeave: (r) => {
66
+ var o;
67
+ (o = u.current) != null && o.contains(r.relatedTarget) || (i.current != null && clearTimeout(i.current), i.current = setTimeout(() => {
65
68
  var l, d;
66
- n.current = null, !((l = s.current) != null && l.matches(":hover")) && !((d = o.current) != null && d.matches(":hover")) && a(!1);
69
+ i.current = null, !((l = u.current) != null && l.matches(":hover")) && !((d = n.current) != null && d.matches(":hover")) && s(!1);
67
70
  }, 100));
68
71
  },
69
- children: f ? /* @__PURE__ */ u("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: e }) : e
72
+ children: f ? /* @__PURE__ */ c("a", { href: z(t), target: "_blank", rel: "noopener noreferrer", children: t }) : t
70
73
  }
71
74
  ),
72
- i && P(
73
- /* @__PURE__ */ u(
75
+ a && P(
76
+ /* @__PURE__ */ c(
74
77
  "div",
75
78
  {
76
79
  "data-react-aria-top-layer": "true",
77
80
  role: "tooltip",
78
- ref: s,
81
+ ref: u,
79
82
  className: T(
80
83
  "fixed px-3 py-2 text-xs font-semibold text-white bg-primary-solid rounded-lg shadow-lg z-[9999] max-w-lg max-h-[40vh] overflow-y-auto break-words whitespace-normal",
81
84
  h
@@ -84,30 +87,30 @@ const j = ({
84
87
  top: `${p.top}px`,
85
88
  left: `${p.left}px`
86
89
  },
87
- onClick: (t) => t.stopPropagation(),
88
- onMouseLeave: (t) => {
89
- var r;
90
- (r = o.current) != null && r.contains(t.relatedTarget) || a(!1);
90
+ onClick: (r) => r.stopPropagation(),
91
+ onMouseLeave: (r) => {
92
+ var o;
93
+ (o = n.current) != null && o.contains(r.relatedTarget) || s(!1);
91
94
  },
92
- children: e
95
+ children: t
93
96
  }
94
97
  ),
95
98
  document.body
96
99
  )
97
100
  ] });
98
- }, N = (e, c = "", f, m = "start", h, i, a, p) => e === "" || e === "-" ? /* @__PURE__ */ u("span", { className: `text-left ${c}`, children: e || i || "-" }) : /* @__PURE__ */ u(
99
- j,
101
+ }, N = (t, e = "", f, m = "start", h, a, s, p) => t === "" || t === "-" ? /* @__PURE__ */ c("span", { className: `text-left ${e}`, children: t || a || "-" }) : /* @__PURE__ */ c(
102
+ R,
100
103
  {
101
- content: e,
102
- className: c,
104
+ content: t,
105
+ className: e,
103
106
  link: f,
104
107
  tooltipPosition: m,
105
108
  tooltipSide: h,
106
- textClassName: a,
109
+ textClassName: s,
107
110
  tooltipClassName: p
108
111
  }
109
112
  );
110
113
  export {
111
- j as EllipsisContentWithTooltip,
114
+ R as EllipsisContentWithTooltip,
112
115
  N as createEllipsisContent
113
116
  };