@pibit.ai/cure-design-system 0.6.44 → 0.6.46

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 (47) hide show
  1. package/dist/_virtual/index.js +3 -2
  2. package/dist/_virtual/index2.js +2 -3
  3. package/dist/index.d.ts +8 -4
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +345 -331
  6. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  7. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  8. package/dist/patterns/section-scroll-hint/index.d.ts +2 -0
  9. package/dist/patterns/section-scroll-hint/index.d.ts.map +1 -0
  10. package/dist/patterns/section-scroll-hint/section-scroll-hint-row.d.ts +15 -0
  11. package/dist/patterns/section-scroll-hint/section-scroll-hint-row.d.ts.map +1 -0
  12. package/dist/patterns/section-scroll-hint/section-scroll-hint-row.js +170 -0
  13. package/dist/patterns/table/index.d.ts +2 -2
  14. package/dist/patterns/table/index.d.ts.map +1 -1
  15. package/dist/patterns/table/toolbar/TableToolbar.d.ts +3 -0
  16. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
  17. package/dist/patterns/table/toolbar/TableToolbar.js +137 -134
  18. package/dist/patterns/table/toolbar/ToolbarRefreshButton.d.ts +12 -0
  19. package/dist/patterns/table/toolbar/ToolbarRefreshButton.d.ts.map +1 -0
  20. package/dist/patterns/table/toolbar/ToolbarRefreshButton.js +20 -0
  21. package/dist/patterns/table/toolbar/index.d.ts +1 -0
  22. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  23. package/dist/primitives/avatar/avatar-label-group.d.ts +9 -0
  24. package/dist/primitives/avatar/avatar-label-group.d.ts.map +1 -0
  25. package/dist/primitives/avatar/avatar-label-group.js +40 -0
  26. package/dist/primitives/avatar/get-initials.d.ts +11 -0
  27. package/dist/primitives/avatar/get-initials.d.ts.map +1 -0
  28. package/dist/primitives/avatar/get-initials.js +9 -0
  29. package/dist/primitives/avatar/index.d.ts +2 -0
  30. package/dist/primitives/avatar/index.d.ts.map +1 -1
  31. package/dist/primitives/loading-dots/index.d.ts +2 -0
  32. package/dist/primitives/loading-dots/index.d.ts.map +1 -0
  33. package/dist/primitives/loading-dots/loading-dots.d.ts +13 -0
  34. package/dist/primitives/loading-dots/loading-dots.d.ts.map +1 -0
  35. package/dist/primitives/loading-dots/loading-dots.js +22 -0
  36. package/dist/primitives/score-indicator/index.d.ts +2 -0
  37. package/dist/primitives/score-indicator/index.d.ts.map +1 -0
  38. package/dist/primitives/score-indicator/score-indicator.d.ts +8 -0
  39. package/dist/primitives/score-indicator/score-indicator.d.ts.map +1 -0
  40. package/dist/primitives/score-indicator/score-indicator.js +56 -0
  41. package/dist/primitives/scroll-container/index.d.ts +2 -0
  42. package/dist/primitives/scroll-container/index.d.ts.map +1 -0
  43. package/dist/primitives/scroll-container/scroll-container.d.ts +22 -0
  44. package/dist/primitives/scroll-container/scroll-container.d.ts.map +1 -0
  45. package/dist/primitives/scroll-container/scroll-container.js +63 -0
  46. package/dist/styles/components.css +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,22 @@
1
+ import { jsxs as l, jsx as c } from "react/jsx-runtime";
2
+ import { useState as i, useEffect as f } from "react";
3
+ import { cx as m } from "../../utils/cn.js";
4
+ const x = ({
5
+ text: e = "Loading",
6
+ speed: t = 500,
7
+ className: s
8
+ }) => {
9
+ const [n, o] = i("");
10
+ return f(() => {
11
+ const a = setInterval(() => {
12
+ o((r) => r === "..." ? "" : r + ".");
13
+ }, t);
14
+ return () => clearInterval(a);
15
+ }, [t]), /* @__PURE__ */ l("span", { className: m("relative", s), children: [
16
+ e,
17
+ /* @__PURE__ */ c("span", { className: "absolute left-full", children: n })
18
+ ] });
19
+ };
20
+ export {
21
+ x as LoadingDots
22
+ };
@@ -0,0 +1,2 @@
1
+ export { ScoreIndicator, type ScoreIndicatorProps } from './score-indicator';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/score-indicator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface ScoreIndicatorProps {
2
+ score: number;
3
+ /** @default 5 */
4
+ maxScore?: number;
5
+ }
6
+ export declare const ScoreIndicator: ({ score, maxScore, }: ScoreIndicatorProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ScoreIndicator;
8
+ //# sourceMappingURL=score-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"score-indicator.d.ts","sourceRoot":"","sources":["../../../src/primitives/score-indicator/score-indicator.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmBD,eAAO,MAAM,cAAc,GAAI,sBAG5B,mBAAmB,4CA0ErB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
+ const l = 20, S = (s, e) => {
3
+ const t = s / e * 5;
4
+ return t >= 0 && t < 2.5 ? "var(--color-utility-error-500)" : t >= 2.5 && t <= 3.5 ? "var(--color-utility-warning-500)" : t > 3.5 ? "var(--color-utility-success-500)" : "var(--color-utility-gray-500)";
5
+ }, j = ({
6
+ score: s,
7
+ maxScore: e = 5
8
+ }) => {
9
+ const t = s / e * 100, g = Math.round(t / 100 * l), u = S(s, e);
10
+ return /* @__PURE__ */ o("div", { children: /* @__PURE__ */ d("div", { className: "relative flex h-[150px] w-[300px] flex-col", children: [
11
+ /* @__PURE__ */ o(
12
+ "svg",
13
+ {
14
+ width: "300",
15
+ height: "200",
16
+ viewBox: "0 0 300 200",
17
+ className: "absolute -top-[30px] left-0",
18
+ children: (() => {
19
+ const c = [], h = 180 / (l - 1), r = 105, a = 18, m = 12;
20
+ for (let n = 0; n < l; n++) {
21
+ const i = (180 + n * h) * Math.PI / 180, p = 150 + Math.cos(i) * (r - a), x = 150 + Math.sin(i) * (r - a), f = 150 + Math.cos(i) * r, y = 150 + Math.sin(i) * r, v = n < g ? 1 : 0.15;
22
+ c.push(
23
+ /* @__PURE__ */ o(
24
+ "line",
25
+ {
26
+ x1: p,
27
+ y1: x,
28
+ x2: f,
29
+ y2: y,
30
+ stroke: u,
31
+ strokeWidth: m,
32
+ strokeLinecap: "round",
33
+ opacity: v,
34
+ style: {
35
+ transition: "opacity 0.3s ease",
36
+ transitionDelay: `${n * 0.03}s`
37
+ }
38
+ },
39
+ n
40
+ )
41
+ );
42
+ }
43
+ return c;
44
+ })()
45
+ }
46
+ ),
47
+ /* @__PURE__ */ d("div", { className: "z-[1] mt-[65px] flex flex-col items-center justify-center", children: [
48
+ /* @__PURE__ */ o("div", { className: "text-display-lg leading-none font-bold tracking-normal text-primary", children: s.toString().padStart(1, "0") }),
49
+ /* @__PURE__ */ o("div", { className: "text-xs font-medium tracking-[0.5px] text-tertiary", children: e === 10 ? "Submission Score" : `Score out of ${e}` })
50
+ ] })
51
+ ] }) });
52
+ };
53
+ export {
54
+ j as ScoreIndicator,
55
+ j as default
56
+ };
@@ -0,0 +1,2 @@
1
+ export { ScrollContainer, type ScrollContainerProps } from './scroll-container';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/scroll-container/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ export interface ScrollContainerProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ threshold?: number;
6
+ /**
7
+ * Fixed at the top edge of the scroll area when there is vertical overflow and the viewport is not at the start of the content.
8
+ * Hidden when there is no overflow or when scrolled to the top (`scrollTop` is 0).
9
+ */
10
+ topOverflowIndicator?: React.ReactNode;
11
+ /**
12
+ * Fixed at the bottom edge of the scroll area when there is vertical overflow and the viewport is not at the end of the content.
13
+ * Hidden when there is no overflow or when scrolled to the bottom.
14
+ */
15
+ bottomOverflowIndicator?: React.ReactNode;
16
+ }
17
+ /**
18
+ * Indicator strips use `background-color: inherit` so they stay opaque and match the parent
19
+ * surface, including `hover:bg-*` on the parent (e.g. a card wrapper with `bg-*` + `hover:bg-*`).
20
+ */
21
+ export declare function ScrollContainer({ children, className, threshold, topOverflowIndicator, bottomOverflowIndicator, }: ScrollContainerProps): import("react/jsx-runtime").JSX.Element;
22
+ //# sourceMappingURL=scroll-container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-container.d.ts","sourceRoot":"","sources":["../../../src/primitives/scroll-container/scroll-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAIjE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3C;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,SAAa,EACb,oBAAoB,EACpB,uBAA0D,GAC3D,EAAE,oBAAoB,2CAwEtB"}
@@ -0,0 +1,63 @@
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { useRef as p, useState as h, useLayoutEffect as w } from "react";
3
+ import { ChevronDownDouble as B } from "@untitledui/icons";
4
+ import { cx as v } from "../../utils/cn.js";
5
+ function S() {
6
+ return /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-2", children: [
7
+ /* @__PURE__ */ e("p", { className: "text-2xs font-medium text-tertiary", children: "Scroll for more" }),
8
+ /* @__PURE__ */ e(B, { size: 12, className: "text-fg-quaternary" })
9
+ ] });
10
+ }
11
+ function T({
12
+ children: y,
13
+ className: N,
14
+ threshold: b = 1,
15
+ topOverflowIndicator: n,
16
+ bottomOverflowIndicator: o = S()
17
+ }) {
18
+ const l = p(null), r = p(null), [c, g] = h(!1), [a, j] = h(!1);
19
+ return w(() => {
20
+ const t = l.current;
21
+ if (!t) return;
22
+ const i = () => {
23
+ const { scrollTop: u, scrollHeight: d, clientHeight: f } = t, m = d > f;
24
+ g(
25
+ !!(n && m && u > 0)
26
+ ), j(
27
+ !!(o && m && u + f < d - b)
28
+ );
29
+ };
30
+ i(), t.addEventListener("scroll", i, { passive: !0 });
31
+ const s = new ResizeObserver(i);
32
+ return s.observe(t), r.current && s.observe(r.current), () => {
33
+ t.removeEventListener("scroll", i), s.disconnect();
34
+ };
35
+ }, [n, o]), /* @__PURE__ */ x("div", { className: "relative flex min-h-0 flex-1 flex-col bg-inherit", children: [
36
+ /* @__PURE__ */ e("div", { ref: l, className: "overflow-y-auto", children: /* @__PURE__ */ e("div", { ref: r, className: N, children: y }) }),
37
+ n ? /* @__PURE__ */ e(
38
+ "div",
39
+ {
40
+ "aria-hidden": !c,
41
+ className: v(
42
+ "pointer-events-none absolute inset-x-0 top-0 z-10 flex w-full justify-center bg-inherit px-3 pt-1.5 transition-opacity duration-50 ease-out motion-reduce:transition-none",
43
+ c ? "opacity-100" : "opacity-0"
44
+ ),
45
+ children: /* @__PURE__ */ e("div", { className: "pointer-events-none", children: n })
46
+ }
47
+ ) : null,
48
+ o ? /* @__PURE__ */ e(
49
+ "div",
50
+ {
51
+ "aria-hidden": !a,
52
+ className: v(
53
+ "pointer-events-none absolute inset-x-0 bottom-0 z-10 flex w-full justify-center bg-inherit px-3 pt-1.5 transition-opacity duration-50 ease-out motion-reduce:transition-none",
54
+ a ? "opacity-100" : "opacity-0"
55
+ ),
56
+ children: /* @__PURE__ */ e("div", { className: "pointer-events-none", children: o })
57
+ }
58
+ ) : null
59
+ ] });
60
+ }
61
+ export {
62
+ T as ScrollContainer
63
+ };