@pibit.ai/cure-design-system 0.6.45 → 0.6.47

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 (68) hide show
  1. package/dist/code-editor/index.d.ts +2 -0
  2. package/dist/code-editor/index.d.ts.map +1 -0
  3. package/dist/code-editor/index.js +6 -0
  4. package/dist/code-editor/theme.d.ts +9 -0
  5. package/dist/code-editor/theme.d.ts.map +1 -0
  6. package/dist/code-editor/theme.js +121 -0
  7. package/dist/index.d.ts +7 -3
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +363 -351
  10. package/dist/patterns/section-scroll-hint/index.d.ts +2 -0
  11. package/dist/patterns/section-scroll-hint/index.d.ts.map +1 -0
  12. package/dist/patterns/section-scroll-hint/section-scroll-hint-row.d.ts +15 -0
  13. package/dist/patterns/section-scroll-hint/section-scroll-hint-row.d.ts.map +1 -0
  14. package/dist/patterns/section-scroll-hint/section-scroll-hint-row.js +170 -0
  15. package/dist/primitives/avatar/avatar-label-group.d.ts +9 -0
  16. package/dist/primitives/avatar/avatar-label-group.d.ts.map +1 -0
  17. package/dist/primitives/avatar/avatar-label-group.js +40 -0
  18. package/dist/primitives/avatar/get-initials.d.ts +11 -0
  19. package/dist/primitives/avatar/get-initials.d.ts.map +1 -0
  20. package/dist/primitives/avatar/get-initials.js +9 -0
  21. package/dist/primitives/avatar/index.d.ts +2 -0
  22. package/dist/primitives/avatar/index.d.ts.map +1 -1
  23. package/dist/primitives/loading-dots/index.d.ts +2 -0
  24. package/dist/primitives/loading-dots/index.d.ts.map +1 -0
  25. package/dist/primitives/loading-dots/loading-dots.d.ts +13 -0
  26. package/dist/primitives/loading-dots/loading-dots.d.ts.map +1 -0
  27. package/dist/primitives/loading-dots/loading-dots.js +22 -0
  28. package/dist/primitives/score-indicator/index.d.ts +2 -0
  29. package/dist/primitives/score-indicator/index.d.ts.map +1 -0
  30. package/dist/primitives/score-indicator/score-indicator.d.ts +8 -0
  31. package/dist/primitives/score-indicator/score-indicator.d.ts.map +1 -0
  32. package/dist/primitives/score-indicator/score-indicator.js +56 -0
  33. package/dist/primitives/scroll-container/index.d.ts +2 -0
  34. package/dist/primitives/scroll-container/index.d.ts.map +1 -0
  35. package/dist/primitives/scroll-container/scroll-container.d.ts +22 -0
  36. package/dist/primitives/scroll-container/scroll-container.d.ts.map +1 -0
  37. package/dist/primitives/scroll-container/scroll-container.js +63 -0
  38. package/dist/rich-text/index.d.ts +8 -0
  39. package/dist/rich-text/index.d.ts.map +1 -0
  40. package/dist/rich-text/index.js +4 -0
  41. package/dist/styles/components.css +1 -1
  42. package/package.json +151 -1
  43. package/dist/applications/schedule-calendar/utils.test.d.ts +0 -2
  44. package/dist/applications/schedule-calendar/utils.test.d.ts.map +0 -1
  45. package/dist/patterns/condition-builder/utils.test.d.ts +0 -2
  46. package/dist/patterns/condition-builder/utils.test.d.ts.map +0 -1
  47. package/dist/patterns/table/cellRangeSelection.test.d.ts +0 -2
  48. package/dist/patterns/table/cellRangeSelection.test.d.ts.map +0 -1
  49. package/dist/patterns/table/rowReorderDrag.test.d.ts +0 -2
  50. package/dist/patterns/table/rowReorderDrag.test.d.ts.map +0 -1
  51. package/dist/patterns/table/tableUndoRedo.test.d.ts +0 -2
  52. package/dist/patterns/table/tableUndoRedo.test.d.ts.map +0 -1
  53. package/dist/patterns/table/tableZoomLayout.test.d.ts +0 -2
  54. package/dist/patterns/table/tableZoomLayout.test.d.ts.map +0 -1
  55. package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts +0 -2
  56. package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts.map +0 -1
  57. package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts +0 -2
  58. package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts.map +0 -1
  59. package/dist/patterns/table-component/buildTableColumns.test.d.ts +0 -2
  60. package/dist/patterns/table-component/buildTableColumns.test.d.ts.map +0 -1
  61. package/dist/patterns/table-component/columnReorderDrag.test.d.ts +0 -2
  62. package/dist/patterns/table-component/columnReorderDrag.test.d.ts.map +0 -1
  63. package/dist/primitives/dropdown/dropdown.nestedOverlay.test.d.ts +0 -2
  64. package/dist/primitives/dropdown/dropdown.nestedOverlay.test.d.ts.map +0 -1
  65. package/dist/primitives/select/__tests__/multi-select-utils.test.d.ts +0 -2
  66. package/dist/primitives/select/__tests__/multi-select-utils.test.d.ts.map +0 -1
  67. package/dist/utils/cn.test.d.ts +0 -2
  68. package/dist/utils/cn.test.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ export { SectionScrollHintRow, type SectionScrollHintRowProps, } from './section-scroll-hint-row';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/section-scroll-hint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface SectionScrollHintRowProps {
2
+ label: string;
3
+ direction: "previous" | "next";
4
+ visible: boolean;
5
+ onClick: () => void;
6
+ progress?: number;
7
+ /** Sticky offset so the overlay sits below the page header/tabs. */
8
+ stickyOffset?: number;
9
+ /** Overrides default `top-3` / `bottom-3` placement within the sticky row. */
10
+ insetClassName?: string;
11
+ /** Next hint: reserve height in layout so the control sits below content instead of overlaying it. */
12
+ reserveLayoutSpace?: boolean;
13
+ }
14
+ export declare const SectionScrollHintRow: import('react').NamedExoticComponent<SectionScrollHintRowProps>;
15
+ //# sourceMappingURL=section-scroll-hint-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-scroll-hint-row.d.ts","sourceRoot":"","sources":["../../../src/patterns/section-scroll-hint/section-scroll-hint-row.tsx"],"names":[],"mappings":"AAmKA,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,UAAU,GAAG,MAAM,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,oBAAoB,iEAqD/B,CAAC"}
@@ -0,0 +1,170 @@
1
+ import { jsx as o, jsxs as x } from "react/jsx-runtime";
2
+ import { memo as y, useRef as m, useState as w, useLayoutEffect as N, useEffect as R } from "react";
3
+ import { ChevronDownDouble as v } from "@untitledui/icons";
4
+ import { cx as f } from "../../utils/cn.js";
5
+ import { motion as z } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
6
+ const k = {
7
+ duration: 0.32,
8
+ ease: [0.22, 1, 0.36, 1]
9
+ }, _ = 0.52, E = 0.2;
10
+ function P(i, r) {
11
+ const s = m(0);
12
+ R(() => {
13
+ let t = 0;
14
+ const h = () => {
15
+ const c = s.current, a = i >= c ? _ : E, l = i - c, e = Math.abs(l) < 2e-3 ? i : c + l * a;
16
+ s.current = e;
17
+ const n = r.current;
18
+ n && (n.style.strokeDashoffset = String(1 - e)), e !== i && (t = requestAnimationFrame(h));
19
+ };
20
+ return t = requestAnimationFrame(h), () => cancelAnimationFrame(t);
21
+ }, [r, i]);
22
+ }
23
+ const H = y(function({
24
+ label: r,
25
+ isPrevious: s,
26
+ visible: t,
27
+ onClick: h,
28
+ progress: c = 0
29
+ }) {
30
+ const a = m(null), l = m(null), [e, n] = w({ width: 0, height: 0 }), b = Math.min(1, Math.max(0, c));
31
+ return P(b, l), N(() => {
32
+ const u = a.current;
33
+ if (!u) return;
34
+ const d = () => {
35
+ const g = Math.max(u.offsetWidth - 2, 10), S = Math.max(u.offsetHeight - 2, 10);
36
+ n({ width: g, height: S });
37
+ };
38
+ d();
39
+ const p = new ResizeObserver(d);
40
+ return p.observe(u), () => p.disconnect();
41
+ }, [r]), /* @__PURE__ */ x(
42
+ "button",
43
+ {
44
+ ref: a,
45
+ type: "button",
46
+ onClick: h,
47
+ tabIndex: t ? 0 : -1,
48
+ "aria-label": r,
49
+ className: f(
50
+ "relative inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-full bg-white px-3 py-2 text-xs font-medium transition-colors",
51
+ "hover:[&_.btn-label]:text-brand-secondary hover:[&_.chev-icon]:text-brand-secondary",
52
+ t ? "pointer-events-auto" : "pointer-events-none"
53
+ ),
54
+ children: [
55
+ /* @__PURE__ */ x(
56
+ "svg",
57
+ {
58
+ className: "pointer-events-none absolute inset-0 h-full w-full overflow-visible",
59
+ "aria-hidden": "true",
60
+ children: [
61
+ /* @__PURE__ */ o(
62
+ "rect",
63
+ {
64
+ x: 1,
65
+ y: 1,
66
+ width: e.width,
67
+ height: e.height,
68
+ rx: e.height / 2,
69
+ ry: e.height / 2,
70
+ fill: "none",
71
+ stroke: "var(--color-border-secondary)",
72
+ strokeWidth: 1
73
+ }
74
+ ),
75
+ /* @__PURE__ */ o(
76
+ "rect",
77
+ {
78
+ ref: l,
79
+ x: 1,
80
+ y: 1,
81
+ width: e.width,
82
+ height: e.height,
83
+ rx: e.height / 2,
84
+ ry: e.height / 2,
85
+ fill: "none",
86
+ stroke: "var(--color-fg-brand-primary)",
87
+ strokeWidth: 2,
88
+ pathLength: 1,
89
+ strokeDasharray: "1",
90
+ strokeLinecap: "round"
91
+ }
92
+ )
93
+ ]
94
+ }
95
+ ),
96
+ /* @__PURE__ */ o("span", { className: "btn-label relative z-[1] text-text-tertiary transition-colors", children: r }),
97
+ s && /* @__PURE__ */ o("span", { className: "chevrons relative z-[1] flex items-center", children: /* @__PURE__ */ o(
98
+ v,
99
+ {
100
+ size: 14,
101
+ className: "chev-icon rotate-180 text-fg-quaternary transition-colors"
102
+ }
103
+ ) }),
104
+ !s && /* @__PURE__ */ o("span", { className: "chevrons relative z-[1] flex items-center", children: /* @__PURE__ */ o(
105
+ v,
106
+ {
107
+ size: 14,
108
+ className: "chev-icon text-fg-quaternary transition-colors"
109
+ }
110
+ ) })
111
+ ]
112
+ }
113
+ );
114
+ }), j = y(function({
115
+ label: r,
116
+ direction: s,
117
+ visible: t,
118
+ onClick: h,
119
+ progress: c = 0,
120
+ stickyOffset: a = 0,
121
+ insetClassName: l,
122
+ reserveLayoutSpace: e = !1
123
+ }) {
124
+ const n = s === "previous";
125
+ return /* @__PURE__ */ o(
126
+ "div",
127
+ {
128
+ className: f(
129
+ "pointer-events-none sticky shrink-0 overflow-visible",
130
+ n ? "z-[32] h-0" : f(
131
+ "z-20 flex items-center justify-center px-4",
132
+ e ? "min-h-14" : "h-0"
133
+ )
134
+ ),
135
+ style: n ? { top: a } : { bottom: a },
136
+ "aria-hidden": !t,
137
+ children: /* @__PURE__ */ o(
138
+ z.div,
139
+ {
140
+ className: f(
141
+ "flex items-center justify-center",
142
+ n && "absolute inset-x-0 px-4",
143
+ n && (l ?? "top-3")
144
+ ),
145
+ initial: !1,
146
+ animate: {
147
+ opacity: t ? 1 : 0,
148
+ y: t ? 0 : n ? -12 : 12,
149
+ scale: t ? 1 : 0.94
150
+ },
151
+ transition: k,
152
+ style: { pointerEvents: "none" },
153
+ children: /* @__PURE__ */ o(
154
+ H,
155
+ {
156
+ label: r,
157
+ isPrevious: n,
158
+ visible: t,
159
+ onClick: h,
160
+ progress: c
161
+ }
162
+ )
163
+ }
164
+ )
165
+ }
166
+ );
167
+ });
168
+ export {
169
+ j as SectionScrollHintRow
170
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { AvatarProps } from './avatar';
3
+ export interface AvatarLabelGroupProps extends AvatarProps {
4
+ size: "xs" | "sm" | "md" | "lg" | "xl";
5
+ title: string | ReactNode;
6
+ subtitle: string | ReactNode;
7
+ }
8
+ export declare const AvatarLabelGroup: ({ title, subtitle, className, ...props }: AvatarLabelGroupProps) => import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=avatar-label-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar-label-group.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/avatar-label-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAWpD,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,gBAAgB,GAAI,0CAK9B,qBAAqB,4CAoBvB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { Avatar as m } from "./avatar.js";
3
+ import { cx as s } from "../../utils/cn.js";
4
+ const i = {
5
+ xs: { root: "gap-2", title: "text-xs", subtitle: "text-xs" },
6
+ sm: { root: "gap-2", title: "text-sm", subtitle: "text-xs" },
7
+ md: { root: "gap-2", title: "text-sm", subtitle: "text-sm" },
8
+ lg: { root: "gap-3", title: "text-md", subtitle: "text-md" },
9
+ xl: { root: "gap-4", title: "text-lg", subtitle: "text-md" }
10
+ }, u = ({
11
+ title: r,
12
+ subtitle: x,
13
+ className: a,
14
+ ...t
15
+ }) => /* @__PURE__ */ l(
16
+ "figure",
17
+ {
18
+ className: s(
19
+ "group flex min-w-0 flex-1 items-center",
20
+ i[t.size].root,
21
+ a
22
+ ),
23
+ children: [
24
+ /* @__PURE__ */ e(m, { ...t }),
25
+ /* @__PURE__ */ l("figcaption", { className: "min-w-0 flex-1", children: [
26
+ /* @__PURE__ */ e("p", { className: s(i[t.size].title), children: r }),
27
+ /* @__PURE__ */ e(
28
+ "p",
29
+ {
30
+ className: s("truncate text-tertiary", i[t.size].subtitle),
31
+ children: x
32
+ }
33
+ )
34
+ ] })
35
+ ]
36
+ }
37
+ );
38
+ export {
39
+ u as AvatarLabelGroup
40
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Extracts the initials from a full name, for the `Avatar` `initials` prop.
3
+ *
4
+ * @param name - The full name from which to extract initials.
5
+ * @returns The initials of the provided name. If the name contains only one word,
6
+ * it returns the first character of that word. With `showLastName`, it
7
+ * returns the first character of the first and last words. Returns an
8
+ * empty string if the name is undefined/null/empty.
9
+ */
10
+ export declare const getInitials: (name: string | undefined | null, showLastName?: boolean) => string;
11
+ //# sourceMappingURL=get-initials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-initials.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/get-initials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,eAAc,OAAe,WAS9B,CAAC"}
@@ -0,0 +1,9 @@
1
+ const s = (t, p = !1) => {
2
+ if (!t || typeof t != "string" || t.trim().length === 0)
3
+ return "";
4
+ const [e, r] = t.split(" ");
5
+ return p && r ? `${e.charAt(0).toUpperCase()}${r == null ? void 0 : r.charAt(0).toUpperCase()}` : e.charAt(0).toUpperCase();
6
+ };
7
+ export {
8
+ s as getInitials
9
+ };
@@ -1,2 +1,4 @@
1
1
  export { Avatar, type AvatarProps } from './avatar';
2
+ export { AvatarLabelGroup, type AvatarLabelGroupProps, } from './avatar-label-group';
3
+ export { getInitials } from './get-initials';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { LoadingDots, type LoadingDotsProps } from './loading-dots';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/loading-dots/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface LoadingDotsProps {
2
+ /** @default 'Loading' */
3
+ text?: string;
4
+ /** Milliseconds between dot steps. @default 500 */
5
+ speed?: number;
6
+ className?: string;
7
+ }
8
+ /**
9
+ * Inline text loader that cycles an ellipsis after the text ("Loading", "Loading.", …).
10
+ * The dots render in an absolutely-positioned span so the text never shifts.
11
+ */
12
+ export declare const LoadingDots: ({ text, speed, className, }: LoadingDotsProps) => import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=loading-dots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../src/primitives/loading-dots/loading-dots.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,6BAIzB,gBAAgB,4CAoBlB,CAAC"}
@@ -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
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Class for rich-text content rendered by the Tiptap editors (and read-only
3
+ * renderings of their output). The styles ship in the DS stylesheet
4
+ * (`styles/editors.css`): headings, lists, blockquote, code, links and data
5
+ * pills from DS typography and color tokens.
6
+ */
7
+ export declare const RICH_TEXT_CONTENT_CLASS = "cure-rich-text";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rich-text/index.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ const t = "cure-rich-text";
2
+ export {
3
+ t as RICH_TEXT_CONTENT_CLASS
4
+ };