@pibit.ai/cure-design-system 0.3.5 → 0.3.7

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 (35) hide show
  1. package/dist/foundations/dot-icon/index.d.ts +7 -0
  2. package/dist/foundations/dot-icon/index.d.ts.map +1 -0
  3. package/dist/foundations/dot-icon/index.js +10 -0
  4. package/dist/index.d.ts +3 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +40 -34
  7. package/dist/patterns/table/table.js +1 -1
  8. package/dist/patterns/tree-view/index.d.ts +2 -0
  9. package/dist/patterns/tree-view/index.d.ts.map +1 -0
  10. package/dist/patterns/tree-view/tree-view.d.ts +61 -0
  11. package/dist/patterns/tree-view/tree-view.d.ts.map +1 -0
  12. package/dist/patterns/tree-view/tree-view.js +167 -0
  13. package/dist/primitives/badge/badge-types.d.ts +17 -0
  14. package/dist/primitives/badge/badge-types.d.ts.map +1 -0
  15. package/dist/primitives/badge/badge-types.js +8 -0
  16. package/dist/primitives/badge/badge.d.ts +115 -22
  17. package/dist/primitives/badge/badge.d.ts.map +1 -1
  18. package/dist/primitives/badge/badge.js +292 -38
  19. package/dist/primitives/badge/index.d.ts +2 -1
  20. package/dist/primitives/badge/index.d.ts.map +1 -1
  21. package/dist/primitives/heading/heading.d.ts +1 -1
  22. package/dist/primitives/text/text.d.ts +1 -1
  23. package/dist/styles/components.css +1 -1
  24. package/package.json +3 -2
  25. package/dist/patterns/table/TableWrapper.js +0 -141
  26. package/dist/patterns/tree/TreeDemo.d.ts +0 -7
  27. package/dist/patterns/tree/TreeDemo.d.ts.map +0 -1
  28. package/dist/patterns/tree/TreeStructure.d.ts +0 -14
  29. package/dist/patterns/tree/TreeStructure.d.ts.map +0 -1
  30. package/dist/patterns/tree/constants.d.ts +0 -18
  31. package/dist/patterns/tree/constants.d.ts.map +0 -1
  32. package/dist/patterns/tree/helper.d.ts +0 -6
  33. package/dist/patterns/tree/helper.d.ts.map +0 -1
  34. package/dist/patterns/tree/interface.d.ts +0 -9
  35. package/dist/patterns/tree/interface.d.ts.map +0 -1
@@ -1,141 +0,0 @@
1
- import { jsx as t, jsxs as m, Fragment as N } from "react/jsx-runtime";
2
- import { forwardRef as E, useState as g, useRef as S, useEffect as O } from "react";
3
- import { createPortal as j } from "react-dom";
4
- import { TableCard as H, Table as f } from "./table.js";
5
- import { cx as x } from "../../utils/cn.js";
6
- const F = E(function({
7
- data: d,
8
- columns: a,
9
- renderRowCell: i,
10
- onRowClick: l,
11
- arialabel: c,
12
- size: n = "sm",
13
- allowDefaultRowClass: y = !1,
14
- centeredHeaders: h = [],
15
- rootClassName: o,
16
- removeBorders: k,
17
- headerClassName: W,
18
- isRowExpandable: w,
19
- renderExpandedContent: v
20
- }, u) {
21
- return /* @__PURE__ */ t(H.Root, { ref: u, className: x("overflow-x-auto", o), size: n, children: /* @__PURE__ */ m(f, { "aria-label": c, size: n, children: [
22
- /* @__PURE__ */ t(f.Header, { className: x("sticky top-0", W), children: a.map((e, p) => /* @__PURE__ */ t(
23
- f.Head,
24
- {
25
- sticky: e.sticky,
26
- stickyOffset: e.stickyOffset,
27
- id: e.key,
28
- label: e.label,
29
- isRowHeader: !0,
30
- allowsSorting: e.allowsSorting,
31
- headerCellClass: h.includes(e.key) ? "justify-center" : "",
32
- style: {
33
- maxWidth: e.maxWidth,
34
- minWidth: e.maxWidth,
35
- width: e.maxWidth
36
- },
37
- className: "overflow-hidde"
38
- },
39
- p
40
- )) }),
41
- /* @__PURE__ */ t(f.Body, { items: d, children: (e) => {
42
- const p = w ? w(e) : !1, b = e.id || e.rule_id || String(e);
43
- return /* @__PURE__ */ t(
44
- f.Row,
45
- {
46
- onAction: () => l == null ? void 0 : l(e),
47
- id: b,
48
- isExpandable: p,
49
- renderExpandedContent: p ? v : void 0,
50
- columns: a,
51
- className: x(
52
- l && "cursor-pointer",
53
- y ? "prose" : "",
54
- k && "[&>td]:after:hidden"
55
- // Remove row borders
56
- ),
57
- children: a.map((s, T) => /* @__PURE__ */ t(
58
- f.Cell,
59
- {
60
- sticky: s.sticky,
61
- stickyOffset: s.stickyOffset,
62
- style: {
63
- maxWidth: s.maxWidth,
64
- minWidth: s.maxWidth,
65
- width: s.maxWidth
66
- },
67
- className: "overflow-x-hidden text-left",
68
- children: T === 0 && p ? /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: i(s.key, e[s.key], e) }) : i(s.key, e[s.key], e)
69
- },
70
- s.key
71
- ))
72
- },
73
- b
74
- );
75
- } })
76
- ] }) });
77
- }), $ = ({
78
- content: r,
79
- className: d = "",
80
- link: a = !1,
81
- tooltipPosition: i = "center"
82
- }) => {
83
- const [l, c] = g(!1), [n, y] = g({ top: 0, left: 0 }), h = S(null);
84
- return O(() => {
85
- if (l && h.current) {
86
- const o = h.current.getBoundingClientRect();
87
- y({
88
- top: o.top - 8,
89
- // 8px above the element (accounts for tooltip height + margin)
90
- left: i === "start" ? o.left : o.left + o.width / 2
91
- // start: left align; center: center horizontally
92
- });
93
- }
94
- }, [l, i]), /* @__PURE__ */ m(N, { children: [
95
- /* @__PURE__ */ t(
96
- "span",
97
- {
98
- ref: h,
99
- className: x(
100
- "whitespace-nowrap overflow-hidden text-ellipsis w-full text-left text-secondary block",
101
- d,
102
- a ? "!text-[var(--color-brand-600)]" : ""
103
- ),
104
- onMouseEnter: () => c(!0),
105
- onMouseLeave: () => c(!1),
106
- children: a ? /* @__PURE__ */ t("a", { href: r, target: "_blank", children: r }) : r
107
- }
108
- ),
109
- l && j(
110
- /* @__PURE__ */ t(
111
- "div",
112
- {
113
- className: x(
114
- "fixed px-3 py-2 text-xs font-semibold text-white bg-primary-solid rounded-lg shadow-lg pointer-events-none -translate-y-full z-999 max-w-2xs lg:max-w-xs xl:max-w-sm break-words whitespace-normal",
115
- i === "center" && "-translate-x-1/2",
116
- d
117
- ),
118
- style: {
119
- top: `${n.top}px`,
120
- left: `${n.left}px`
121
- },
122
- children: r
123
- }
124
- ),
125
- document.body
126
- )
127
- ] });
128
- }, I = (r, d = "", a, i) => r === "" || r === "-" ? /* @__PURE__ */ t("span", { className: `text-left ${d}`, children: r || "-" }) : /* @__PURE__ */ t(
129
- $,
130
- {
131
- content: r,
132
- className: d,
133
- link: a,
134
- tooltipPosition: i
135
- }
136
- );
137
- export {
138
- $ as EllipsisContentWithTooltip,
139
- F as TableWrapper,
140
- I as createEllipsisContent
141
- };
@@ -1,7 +0,0 @@
1
- declare const TreeDemo: () => import("react/jsx-runtime").JSX.Element;
2
- export declare const CustomLeaf: ({ data }: {
3
- data: any;
4
- type: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default TreeDemo;
7
- //# sourceMappingURL=TreeDemo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TreeDemo.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree/TreeDemo.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,QAAQ,+CAQb,CAAA;AACD,eAAO,MAAM,UAAU,GAAI,UAAU;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,4CAW5D,CAAC;AACF,eAAe,QAAQ,CAAC"}
@@ -1,14 +0,0 @@
1
- import { TreeNode } from './interface';
2
- import { TreeConfig } from './helper';
3
- export type { TreeConfig };
4
- export interface TreeStructureProps {
5
- data: any[];
6
- config: TreeConfig;
7
- CustomLeaf: React.FC<{
8
- data: any;
9
- type: any;
10
- }>;
11
- onNodeClick?: (node: TreeNode) => void;
12
- }
13
- export declare const TreeEngine: ({ data, config, onNodeClick, CustomLeaf }: TreeStructureProps) => import("react/jsx-runtime").JSX.Element;
14
- //# sourceMappingURL=TreeStructure.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TreeStructure.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree/TreeStructure.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AAEjD,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,UAAU,GAAI,2CAA2C,kBAAkB,4CA8CvF,CAAC"}
@@ -1,18 +0,0 @@
1
- export declare const dummyTreeStructure: {
2
- id: string;
3
- type: string;
4
- children: {
5
- id: string;
6
- type: string;
7
- children: {
8
- id: string;
9
- type: string;
10
- children: {
11
- id: string;
12
- type: string;
13
- children: never[];
14
- }[];
15
- }[];
16
- }[];
17
- }[];
18
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;GAoF9B,CAAC"}
@@ -1,6 +0,0 @@
1
- export type TreeConfig = {
2
- labelKey: string;
3
- childrenPaths: string[];
4
- };
5
- export declare const buildTree: (fields: any[], config: TreeConfig, parentPath?: string) => any[];
6
- //# sourceMappingURL=helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree/helper.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,SAAS,GAClB,QAAQ,GAAG,EAAE,EACb,QAAQ,UAAU,EAClB,aAAY,MAAW,KACxB,GAAG,EA+BL,CAAC"}
@@ -1,9 +0,0 @@
1
- export interface TreeNode {
2
- id: string;
3
- label: string;
4
- type: string;
5
- children: TreeNode[];
6
- metadata: any;
7
- [key: string]: any;
8
- }
9
- //# sourceMappingURL=interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree/interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB"}