@tumaet/prompt-ui-components 1.0.8 → 1.0.10
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.
- package/dist/components/ScoreLevelSelector.js +23 -0
- package/dist/components/ScoreLevelSelector.js.map +1 -0
- package/dist/components/getLevelConfig.js +55 -0
- package/dist/components/getLevelConfig.js.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/table/PromptTable/tableBarComponents/TableSearch.js +1 -1
- package/dist/components/table/PromptTable/tableBarComponents/TableSearch.js.map +1 -1
- package/dist/types/components/ScoreLevelSelector.d.ts +14 -0
- package/dist/types/components/getLevelConfig.d.ts +8 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/ui/chart.d.ts +6 -6
- package/package.json +17 -16
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LockIcon } from 'lucide-react';
|
|
3
|
+
import { ScoreLevel } from '@tumaet/prompt-shared-state';
|
|
4
|
+
import { cn } from '../lib/utils';
|
|
5
|
+
import { getLevelConfig } from './getLevelConfig';
|
|
6
|
+
const scoreLevels = Object.values(ScoreLevel);
|
|
7
|
+
export const ScoreLevelSelector = ({ selectedScore, onScoreChange, completed, descriptionsByLevel, labelsByLevel, showIndicators = true, indicators, hideUnselectedOnDesktop = true, className, }) => {
|
|
8
|
+
const hasIndicators = showIndicators && scoreLevels.some((level) => (indicators?.[level] ?? []).length > 0);
|
|
9
|
+
return (_jsx("div", { className: className, children: scoreLevels.map((level) => {
|
|
10
|
+
const config = getLevelConfig(level);
|
|
11
|
+
const isSelected = selectedScore === level;
|
|
12
|
+
const descriptionID = `score-level-${level}-description`;
|
|
13
|
+
const label = labelsByLevel?.[level] ?? config.title;
|
|
14
|
+
const levelIndicators = showIndicators ? indicators?.[level] ?? [] : [];
|
|
15
|
+
return (_jsxs("div", { className: cn('relative', hideUnselectedOnDesktop &&
|
|
16
|
+
selectedScore !== undefined &&
|
|
17
|
+
!isSelected &&
|
|
18
|
+
'lg:hidden'), children: [levelIndicators.length > 0 && (_jsx("div", { className: 'absolute -top-6 left-0 z-10 w-full', children: _jsx("div", { className: 'flex items-center justify-center gap-2 text-left', children: levelIndicators.map((indicator, index) => (_jsx("span", { className: 'flex items-center', children: indicator }, `${level}-indicator-${index}`))) }) })), _jsxs("button", { type: 'button', onClick: () => onScoreChange(level), disabled: completed, "aria-pressed": isSelected, "aria-disabled": completed, "aria-label": `Select ${label} score level`, "aria-describedby": descriptionID, className: cn('flex h-full w-full flex-col justify-start rounded-lg border-2 p-3 text-left text-sm transition-all', !isSelected && 'hover:bg-gray-100 dark:hover:bg-gray-800', isSelected
|
|
19
|
+
? cn(config.textColor, config.selectedBg)
|
|
20
|
+
: 'bg-gray-50 dark:bg-gray-900', !completed && 'focus:ring-2 focus:ring-gray-400 focus:ring-offset-2', completed && 'cursor-not-allowed opacity-80', hasIndicators && 'mt-2', !selectedScore && config.border), children: [_jsxs("div", { className: 'mb-1 flex justify-between', children: [_jsx("span", { className: 'font-semibold', children: label }), completed && isSelected && (_jsx("span", { className: 'flex items-center gap-1', children: _jsx(LockIcon, { className: cn('h-4 w-4 text-muted-foreground', isSelected && 'dark:text-gray-200') }) }))] }), _jsx("p", { id: descriptionID, className: cn('line-clamp-3 text-muted-foreground', isSelected && 'dark:text-gray-200'), children: descriptionsByLevel[level] })] })] }, level));
|
|
21
|
+
}) }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ScoreLevelSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScoreLevelSelector.js","sourceRoot":"","sources":["../../src/components/ScoreLevelSelector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,OAAO,EAAE,EA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assertUnreachable = (value) => {
|
|
3
|
+
throw new Error(`Unhandled ScoreLevel: ${String(value)}`);
|
|
4
|
+
};
|
|
5
|
+
export const getLevelConfig = (level, unknown) => {
|
|
6
|
+
const unknownConfig = {
|
|
7
|
+
title: 'Unknown',
|
|
8
|
+
textColor: 'text-gray-700 dark:text-gray-100',
|
|
9
|
+
selectedBg: 'bg-gray-100 dark:bg-gray-600',
|
|
10
|
+
border: 'border-gray-200 dark:border-gray-200',
|
|
11
|
+
};
|
|
12
|
+
if (unknown) {
|
|
13
|
+
return unknownConfig;
|
|
14
|
+
}
|
|
15
|
+
switch (level) {
|
|
16
|
+
case ScoreLevel.VeryBad:
|
|
17
|
+
return {
|
|
18
|
+
title: 'Strongly Disagree',
|
|
19
|
+
textColor: 'text-red-700 dark:text-red-100',
|
|
20
|
+
selectedBg: 'bg-red-200 dark:bg-red-600',
|
|
21
|
+
border: 'border-red-200 dark:border-red-200',
|
|
22
|
+
};
|
|
23
|
+
case ScoreLevel.Bad:
|
|
24
|
+
return {
|
|
25
|
+
title: 'Disagree',
|
|
26
|
+
textColor: 'text-orange-700 dark:text-orange-100',
|
|
27
|
+
selectedBg: 'bg-orange-200 dark:bg-orange-600',
|
|
28
|
+
border: 'border-orange-200 dark:border-orange-200',
|
|
29
|
+
};
|
|
30
|
+
case ScoreLevel.Ok:
|
|
31
|
+
return {
|
|
32
|
+
title: 'Neutral',
|
|
33
|
+
textColor: 'text-yellow-700 dark:text-yellow-100',
|
|
34
|
+
selectedBg: 'bg-yellow-200 dark:bg-yellow-600',
|
|
35
|
+
border: 'border-yellow-200 dark:border-yellow-200',
|
|
36
|
+
};
|
|
37
|
+
case ScoreLevel.Good:
|
|
38
|
+
return {
|
|
39
|
+
title: 'Agree',
|
|
40
|
+
textColor: 'text-green-700 dark:text-green-100',
|
|
41
|
+
selectedBg: 'bg-green-200 dark:bg-green-600',
|
|
42
|
+
border: 'border-green-200 dark:border-green-200',
|
|
43
|
+
};
|
|
44
|
+
case ScoreLevel.VeryGood:
|
|
45
|
+
return {
|
|
46
|
+
title: 'Strongly Agree',
|
|
47
|
+
textColor: 'text-blue-700 dark:text-blue-100',
|
|
48
|
+
selectedBg: 'bg-blue-200 dark:bg-blue-600',
|
|
49
|
+
border: 'border-blue-200 dark:border-blue-200',
|
|
50
|
+
};
|
|
51
|
+
default:
|
|
52
|
+
return assertUnreachable(level);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=getLevelConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLevelConfig.js","sourceRoot":"","sources":["../../src/components/getLevelConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AASxD,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAS,EAAE;IAChD,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AAC3D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAE,OAAiB,EAAoB,EAAE;IACvF,MAAM,aAAa,GAAqB;QACtC,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,kCAAkC;QAC7C,UAAU,EAAE,8BAA8B;QAC1C,MAAM,EAAE,sCAAsC;KAC/C,CAAA;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,UAAU,CAAC,OAAO;YACrB,OAAO;gBACL,KAAK,EAAE,mBAAmB;gBAC1B,SAAS,EAAE,gCAAgC;gBAC3C,UAAU,EAAE,4BAA4B;gBACxC,MAAM,EAAE,oCAAoC;aAC7C,CAAA;QACH,KAAK,UAAU,CAAC,GAAG;YACjB,OAAO;gBACL,KAAK,EAAE,UAAU;gBACjB,SAAS,EAAE,sCAAsC;gBACjD,UAAU,EAAE,kCAAkC;gBAC9C,MAAM,EAAE,0CAA0C;aACnD,CAAA;QACH,KAAK,UAAU,CAAC,EAAE;YAChB,OAAO;gBACL,KAAK,EAAE,SAAS;gBAChB,SAAS,EAAE,sCAAsC;gBACjD,UAAU,EAAE,kCAAkC;gBAC9C,MAAM,EAAE,0CAA0C;aACnD,CAAA;QACH,KAAK,UAAU,CAAC,IAAI;YAClB,OAAO;gBACL,KAAK,EAAE,OAAO;gBACd,SAAS,EAAE,oCAAoC;gBAC/C,UAAU,EAAE,gCAAgC;gBAC5C,MAAM,EAAE,wCAAwC;aACjD,CAAA;QACH,KAAK,UAAU,CAAC,QAAQ;YACtB,OAAO;gBACL,KAAK,EAAE,gBAAgB;gBACvB,SAAS,EAAE,kCAAkC;gBAC7C,UAAU,EAAE,8BAA8B;gBAC1C,MAAM,EAAE,sCAAsC;aAC/C,CAAA;QACH;YACE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACnC,CAAC;AACH,CAAC,CAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -10,5 +10,7 @@ export * from './LoadingPage';
|
|
|
10
10
|
export * from './ManagementPageHeader';
|
|
11
11
|
export * from './MultiSelect';
|
|
12
12
|
export * from './SaveChangesAlert';
|
|
13
|
+
export * from './ScoreLevelSelector';
|
|
13
14
|
export * from './UnauthorizedPage';
|
|
15
|
+
export * from './getLevelConfig';
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
|
|
@@ -22,7 +22,7 @@ export function TableSearch({ value, onChange, table, filters }) {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
const showFilter = filters && filters.length > 0 && table;
|
|
25
|
-
return (_jsx("div", { className: 'relative flex-1 min-w-0 h-full', children: _jsxs("div", { className: 'flex rounded-md border border-input focus-within:ring-1 focus-within:ring-ring overflow-hidden h-
|
|
25
|
+
return (_jsx("div", { className: 'relative flex-1 min-w-0 h-full', children: _jsxs("div", { className: 'flex rounded-md border border-input focus-within:ring-1 focus-within:ring-ring overflow-hidden h-10', children: [_jsxs("div", { className: 'relative flex-1 min-w-0', children: [_jsx(Input, { placeholder: 'Search ... (press Enter)', value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, className: 'h-full pl-3 sm:pl-9 w-full border-0 shadow-none focus-visible:ring-0 rounded-none' }), _jsx(SearchIcon, { className: 'absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground hidden sm:block' })] }), showFilter && (_jsx(TableFiltersMenu, { table: table, filters: filters, trigger: _jsxs("button", { type: 'button', "aria-label": 'Filter', className: 'flex items-center gap-1.5 shrink-0 border-l ' +
|
|
26
26
|
'border-input px-3 text-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors outline-none', children: [_jsx(Filter, { className: 'h-4 w-4' }), _jsx("span", { className: 'hidden sm:inline', children: "Filter" })] }) }))] }) }));
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=TableSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSearch.js","sourceRoot":"","sources":["../../../../../src/components/table/PromptTable/tableBarComponents/TableSearch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAA+B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAS9D,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAoB;IAC/E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACnD,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAElC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzB,YAAY,CAAC,OAAO,GAAG,KAAK,CAAA;YAC5B,OAAM;QACR,CAAC;QACD,aAAa,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,MAAM,aAAa,GAAG,CAAC,CAAkC,EAAE,EAAE;QAC3D,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YACpD,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,QAAQ,CAAC,UAAU,CAAC,CAAA;YACpB,YAAY,CAAC,OAAO,GAAG,IAAI,CAAA;YAC3B,aAAa,CAAC,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAA;IAEzD,OAAO,CACL,cAAK,SAAS,EAAC,gCAAgC,YAC7C,eAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"TableSearch.js","sourceRoot":"","sources":["../../../../../src/components/table/PromptTable/tableBarComponents/TableSearch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAA+B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAS9D,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAoB;IAC/E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACnD,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAElC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzB,YAAY,CAAC,OAAO,GAAG,KAAK,CAAA;YAC5B,OAAM;QACR,CAAC;QACD,aAAa,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,MAAM,aAAa,GAAG,CAAC,CAAkC,EAAE,EAAE;QAC3D,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YACpD,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,QAAQ,CAAC,UAAU,CAAC,CAAA;YACpB,YAAY,CAAC,OAAO,GAAG,IAAI,CAAA;YAC3B,aAAa,CAAC,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAA;IAEzD,OAAO,CACL,cAAK,SAAS,EAAC,gCAAgC,YAC7C,eAAK,SAAS,EAAC,qGAAqG,aAClH,eAAK,SAAS,EAAC,yBAAyB,aACtC,KAAC,KAAK,IACJ,WAAW,EAAC,0BAA0B,EACtC,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC9C,SAAS,EAAE,aAAa,EACxB,SAAS,EAAC,mFAAmF,GAC7F,EACF,KAAC,UAAU,IAAC,SAAS,EAAC,wFAAwF,GAAG,IAC7G,EAEL,UAAU,IAAI,CACb,KAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EACL,kBACE,IAAI,EAAC,QAAQ,gBACF,QAAQ,EACnB,SAAS,EACP,8CAA8C;4BAC9C,qHAAqH,aAGvH,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,EAC9B,eAAM,SAAS,EAAC,kBAAkB,uBAAc,IACzC,GAEX,CACH,IACG,GACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { ScoreLevel } from '@tumaet/prompt-shared-state';
|
|
3
|
+
export interface ScoreLevelSelectorProps {
|
|
4
|
+
selectedScore?: ScoreLevel;
|
|
5
|
+
onScoreChange: (value: ScoreLevel) => void;
|
|
6
|
+
completed: boolean;
|
|
7
|
+
descriptionsByLevel: Record<ScoreLevel, string>;
|
|
8
|
+
labelsByLevel?: Partial<Record<ScoreLevel, string>>;
|
|
9
|
+
showIndicators?: boolean;
|
|
10
|
+
indicators?: Partial<Record<ScoreLevel, ReactNode[]>>;
|
|
11
|
+
hideUnselectedOnDesktop?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ScoreLevelSelector: ({ selectedScore, onScoreChange, completed, descriptionsByLevel, labelsByLevel, showIndicators, indicators, hideUnselectedOnDesktop, className, }: ScoreLevelSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScoreLevel } from '@tumaet/prompt-shared-state';
|
|
2
|
+
export interface ScoreLevelConfig {
|
|
3
|
+
title: string;
|
|
4
|
+
textColor: string;
|
|
5
|
+
selectedBg: string;
|
|
6
|
+
border: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const getLevelConfig: (level: ScoreLevel, unknown?: boolean) => ScoreLevelConfig;
|
|
@@ -25,23 +25,23 @@ declare const ChartStyle: ({ id, config }: {
|
|
|
25
25
|
config: ChartConfig;
|
|
26
26
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
27
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
28
|
-
declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<Omit<RechartsPrimitive.DefaultTooltipContentProps<
|
|
28
|
+
declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<Omit<RechartsPrimitive.DefaultTooltipContentProps<RechartsPrimitive.TooltipValueType, import("recharts/types/component/DefaultTooltipContent").NameType>, "label" | "viewBox" | "active" | "payload" | "coordinate" | "accessibilityLayer"> & {
|
|
29
29
|
active?: boolean;
|
|
30
30
|
allowEscapeViewBox?: import("recharts/types/util/types").AllowInDimension;
|
|
31
31
|
animationDuration?: import("recharts/types/util/types").AnimationDuration;
|
|
32
32
|
animationEasing?: import("recharts/types/util/types").AnimationTiming;
|
|
33
33
|
axisId?: RechartsPrimitive.AxisId;
|
|
34
|
-
content?: import("recharts/types/component/Tooltip").ContentType<
|
|
34
|
+
content?: import("recharts/types/component/Tooltip").ContentType<RechartsPrimitive.TooltipValueType, import("recharts/types/component/DefaultTooltipContent").NameType> | undefined;
|
|
35
35
|
contentStyle?: React.CSSProperties;
|
|
36
36
|
cursor?: import("recharts/types/component/Cursor").CursorDefinition;
|
|
37
37
|
defaultIndex?: number | RechartsPrimitive.TooltipIndex;
|
|
38
38
|
filterNull?: boolean;
|
|
39
|
-
formatter?: ((value:
|
|
39
|
+
formatter?: ((value: RechartsPrimitive.TooltipValueType, name: import("recharts/types/component/DefaultTooltipContent").NameType, item: import("recharts/types/state/tooltipSlice").TooltipPayloadEntry, index: number, payload: RechartsPrimitive.TooltipPayload) => React.ReactNode | [React.ReactNode, React.ReactNode]) | undefined;
|
|
40
40
|
includeHidden?: boolean | undefined;
|
|
41
41
|
isAnimationActive?: boolean | "auto";
|
|
42
|
-
itemSorter?:
|
|
42
|
+
itemSorter?: RechartsPrimitive.TooltipItemSorter;
|
|
43
43
|
itemStyle?: React.CSSProperties;
|
|
44
|
-
labelFormatter?: (
|
|
44
|
+
labelFormatter?: (label: any, payload: RechartsPrimitive.TooltipPayload) => React.ReactNode;
|
|
45
45
|
labelStyle?: React.CSSProperties;
|
|
46
46
|
offset?: number | RechartsPrimitive.Coordinate;
|
|
47
47
|
payloadUniqBy?: import("recharts/types/util/payload/getUniqPayload").UniqueOption<import("recharts/types/state/tooltipSlice").TooltipPayloadEntry>;
|
|
@@ -62,7 +62,7 @@ declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<Omit<Rec
|
|
|
62
62
|
payload?: any[];
|
|
63
63
|
label?: any;
|
|
64
64
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
-
declare const ChartLegend:
|
|
65
|
+
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
66
66
|
declare const ChartLegendContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
67
67
|
payload?: any[];
|
|
68
68
|
verticalAlign?: "top" | "bottom";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tumaet/prompt-ui-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ls1intum/prompt-lib.git"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"build": "yarn build:esm && yarn build:copy-css",
|
|
27
27
|
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\""
|
|
28
28
|
},
|
|
29
|
-
"packageManager": "yarn@4.
|
|
29
|
+
"packageManager": "yarn@4.13.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hookform/resolvers": "^
|
|
31
|
+
"@hookform/resolvers": "^5.2.2",
|
|
32
32
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
33
33
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
34
34
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
@@ -66,40 +66,41 @@
|
|
|
66
66
|
"@tiptap/pm": "^2.27.2",
|
|
67
67
|
"@tiptap/react": "^2.27.2",
|
|
68
68
|
"@tiptap/starter-kit": "^2.27.2",
|
|
69
|
+
"@tumaet/prompt-shared-state": "^1.0.8",
|
|
69
70
|
"class-variance-authority": "^0.7.1",
|
|
70
71
|
"clsx": "^2.1.1",
|
|
71
72
|
"cmdk": "1.1.1",
|
|
72
73
|
"date-fns": "^4.1.0",
|
|
73
74
|
"highlight.js": "^11.11.1",
|
|
74
75
|
"lowlight": "^3.3.0",
|
|
75
|
-
"lucide-react": "^0.
|
|
76
|
-
"postcss": "^8.5.
|
|
77
|
-
"postcss-preset-env": "^
|
|
76
|
+
"lucide-react": "^1.0.1",
|
|
77
|
+
"postcss": "^8.5.8",
|
|
78
|
+
"postcss-preset-env": "^11.2.0",
|
|
78
79
|
"react": "^19.2.4",
|
|
79
80
|
"react-day-picker": "8.10.1",
|
|
80
81
|
"react-dom": "^19.2.4",
|
|
81
|
-
"react-hook-form": "^7.
|
|
82
|
+
"react-hook-form": "^7.72.0",
|
|
82
83
|
"react-medium-image-zoom": "^5.4.1",
|
|
83
|
-
"react-router-dom": "^7.13.
|
|
84
|
-
"recharts": "^3.
|
|
84
|
+
"react-router-dom": "^7.13.2",
|
|
85
|
+
"recharts": "^3.8.0",
|
|
85
86
|
"sonner": "^2.0.7",
|
|
86
87
|
"tailwind-merge": "^2.6.1",
|
|
87
88
|
"tsc-alias": "^1.8.16",
|
|
88
89
|
"typescript": "^5.9.3"
|
|
89
90
|
},
|
|
90
91
|
"devDependencies": {
|
|
91
|
-
"@eslint/compat": "^
|
|
92
|
+
"@eslint/compat": "^2.0.3",
|
|
92
93
|
"@types/react": "^19.2.14",
|
|
93
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
94
|
-
"@typescript-eslint/parser": "^8.
|
|
95
|
-
"eslint": "^
|
|
94
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
95
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
96
|
+
"eslint": "^10.1.0",
|
|
96
97
|
"eslint-plugin-prettier": "^5.5.5",
|
|
97
98
|
"eslint-plugin-react": "^7.37.5",
|
|
98
|
-
"eslint-plugin-react-hooks": "^
|
|
99
|
-
"postcss-cli": "^
|
|
99
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
100
|
+
"postcss-cli": "^11.0.1",
|
|
100
101
|
"prettier": "^3.8.1"
|
|
101
102
|
},
|
|
102
103
|
"resolutions": {
|
|
103
|
-
"tar": "^7.5.
|
|
104
|
+
"tar": "^7.5.13"
|
|
104
105
|
}
|
|
105
106
|
}
|