@flikk/ui 1.0.0-beta.7 → 1.0.0-beta.9
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/ai/ApprovalCard/ApprovalCard.js +1 -1
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -1
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +1 -1
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +6 -6
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +4 -4
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +6 -6
- package/dist/components/charts/ActivityRings/ActivityRings.js +1 -1
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +2 -2
- package/dist/components/charts/BarChart/BarChart.js +3 -3
- package/dist/components/charts/ChartContainer.js +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +2 -2
- package/dist/components/charts/DonutChart/DonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.js +7 -7
- package/dist/components/charts/Heatmap/Heatmap.theme.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapCell.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapLegend.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +2 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +1 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +2 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +2 -2
- package/dist/components/charts/shared/ChartErrorBoundary/ChartErrorBoundary.js +1 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +4 -4
- package/dist/components/core/Alert/Alert.js +1 -0
- package/dist/components/core/Alert/Alert.theme.js +4 -8
- package/dist/components/core/Alert/Alert.types.d.ts +2 -1
- package/dist/components/core/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/core/Avatar/Avatar.theme.js +5 -5
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.theme.js +11 -6
- package/dist/components/core/Badge/Badge.types.d.ts +2 -1
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/core/Button/Button.theme.js +38 -32
- package/dist/components/core/Button/Button.types.d.ts +2 -1
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +1 -1
- package/dist/components/core/Calendar/Calendar.js +1 -1
- package/dist/components/core/Calendar/Calendar.theme.js +5 -5
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +1 -1
- package/dist/components/core/Card/Card.theme.js +2 -2
- package/dist/components/core/CommandPalette/CommandItem.js +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -3
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +3 -3
- package/dist/components/core/ContextMenu/ContextMenuItem.js +1 -1
- package/dist/components/core/Drawer/Drawer.theme.js +2 -2
- package/dist/components/core/Dropdown/Dropdown.theme.js +1 -1
- package/dist/components/core/Empty/Empty.theme.js +2 -2
- package/dist/components/core/Kbd/Kbd.theme.js +3 -3
- package/dist/components/core/Loader/Loader.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +2 -2
- package/dist/components/core/Message/Message.js +1 -1
- package/dist/components/core/Message/Message.theme.js +4 -4
- package/dist/components/core/Modal/Modal.theme.js +2 -2
- package/dist/components/core/NavItem/NavItem.js +1 -1
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +2 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.theme.js +3 -3
- package/dist/components/core/Popover/PopoverContent.js +2 -0
- package/dist/components/core/Progress/Progress.theme.js +10 -7
- package/dist/components/core/Progress/Progress.types.d.ts +2 -1
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Sidebar/SidebarNavGroup.js +1 -1
- package/dist/components/core/Spinner/Spinner.theme.js +3 -5
- package/dist/components/core/Spinner/Spinner.types.d.ts +2 -1
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +2 -2
- package/dist/components/core/Toast/Toast.theme.js +4 -4
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +2 -2
- package/dist/components/data-display/Feed/Feed.js +1 -1
- package/dist/components/data-display/Feed/Feed.theme.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +1 -1
- package/dist/components/data-display/GanttChart/GanttMilestone.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +2 -2
- package/dist/components/data-display/KPI/KPI.js +1 -1
- package/dist/components/data-display/KPI/KPI.theme.js +10 -11
- package/dist/components/data-display/KPI/KPI.types.d.ts +2 -1
- package/dist/components/data-display/Metric/Metric.js +1 -1
- package/dist/components/data-display/Metric/Metric.theme.js +11 -7
- package/dist/components/data-display/Metric/Metric.types.d.ts +2 -1
- package/dist/components/data-display/Table/Table.theme.js +3 -3
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +1 -1
- package/dist/components/data-display/Table/TableFilter.js +3 -3
- package/dist/components/data-display/Table/TableHeader.js +1 -1
- package/dist/components/data-display/Table/TablePagination.js +1 -1
- package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +3 -1
- package/dist/components/effects/CustomCursor/CustomCursor.types.d.ts +2 -1
- package/dist/components/effects/StickyScroll/StickyScroll.js +1 -1
- package/dist/components/forms/Checkbox/Checkbox.d.ts +3 -4
- package/dist/components/forms/Checkbox/Checkbox.js +33 -9
- package/dist/components/forms/Checkbox/Checkbox.theme.js +7 -1
- package/dist/components/forms/Checkbox/Checkbox.types.d.ts +28 -2
- package/dist/components/forms/Checkbox/CheckboxContext.d.ts +14 -0
- package/dist/components/forms/Checkbox/CheckboxContext.js +12 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.d.ts +3 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.js +40 -0
- package/dist/components/forms/Checkbox/index.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +7 -7
- package/dist/components/forms/CronInput/CronInput.js +1 -1
- package/dist/components/forms/CronInput/CronInput.theme.js +8 -8
- package/dist/components/forms/DatePicker/DatePicker.theme.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerContent.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.theme.js +4 -4
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/Input/Input.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/InputTag/InputTag.js +1 -1
- package/dist/components/forms/Mention/Mention.theme.js +3 -3
- package/dist/components/forms/Radio/Radio.d.ts +3 -4
- package/dist/components/forms/Radio/Radio.js +21 -4
- package/dist/components/forms/Radio/Radio.theme.js +7 -1
- package/dist/components/forms/Radio/Radio.types.d.ts +30 -4
- package/dist/components/forms/Radio/RadioContext.d.ts +14 -0
- package/dist/components/forms/Radio/RadioContext.js +12 -0
- package/dist/components/forms/Radio/RadioGroup.d.ts +3 -0
- package/dist/components/forms/Radio/RadioGroup.js +36 -0
- package/dist/components/forms/Radio/index.d.ts +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +1 -1
- package/dist/components/forms/Select/Select.theme.js +1 -1
- package/dist/components/forms/Signature/Signature.theme.js +1 -1
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +2 -2
- package/dist/components/forms/TransferList/TransferList.js +2 -2
- package/dist/components/forms/TransferList/TransferList.theme.js +6 -6
- package/dist/components/forms/forms.theme.js +6 -6
- package/dist/components/forms/index.d.ts +2 -2
- package/dist/components/layout/FormLayout/FormLayout.theme.js +4 -4
- package/dist/hooks/useSelectPortal.d.ts +3 -2
- package/dist/hooks/useSelectPortal.js +44 -19
- package/dist/styles.css +1 -1
- package/dist/utils/colorUtils.d.ts +23 -0
- package/dist/utils/colorUtils.js +45 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/theme.css +19 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const navItemTheme = {
|
|
2
|
-
baseStyle: "relative flex items-center gap-2 px-2 py-1.5 text-
|
|
2
|
+
baseStyle: "relative flex items-center gap-2 px-2 py-1.5 text-base font-medium cursor-pointer select-none transition-all duration-300 w-full rounded-[var(--nav-item-radius)] outline-none group",
|
|
3
3
|
icon: "size-4 text-[var(--color-text-secondary)]",
|
|
4
4
|
text: "flex-1 min-w-0 truncate",
|
|
5
5
|
states: {
|
|
@@ -15,8 +15,8 @@ const offlineIndicatorTheme = {
|
|
|
15
15
|
offline: "bg-[var(--color-neutral-900)]/90 backdrop-blur-sm text-white",
|
|
16
16
|
online: "bg-[var(--color-success)]/90 backdrop-blur-sm text-[var(--color-success-contrast)]",
|
|
17
17
|
icon: "size-4 flex-shrink-0",
|
|
18
|
-
message: "text-
|
|
19
|
-
queueCount: "text-
|
|
18
|
+
message: "text-sm font-medium",
|
|
19
|
+
queueCount: "text-sm opacity-80 ml-1",
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export { offlineIndicatorTheme };
|
|
@@ -2,7 +2,7 @@ const pageHeadingTheme = {
|
|
|
2
2
|
baseStyle: "flex flex-col pb-6 mb-6",
|
|
3
3
|
headerStyle: "flex items-center gap-4",
|
|
4
4
|
titleStyle: "text-2xl font-semibold tracking-tight text-[var(--color-text-primary)]",
|
|
5
|
-
subtitleStyle: "text-
|
|
5
|
+
subtitleStyle: "text-base text-[var(--color-text-muted)] mt-1",
|
|
6
6
|
actionsStyle: "sm:ml-auto flex items-center gap-2 shrink-0",
|
|
7
7
|
iconStyle: "flex items-center justify-center shrink-0 text-[var(--color-text-muted)]",
|
|
8
8
|
separatorStyle: "border-b border-[var(--color-border)] mt-4",
|
|
@@ -26,8 +26,8 @@ const paginationTheme = {
|
|
|
26
26
|
"data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:pointer-events-none",
|
|
27
27
|
// Unified item sizes
|
|
28
28
|
itemSizes: {
|
|
29
|
-
sm: "size-8 min-w-[2rem] text-
|
|
30
|
-
md: "size-10 min-w-[2.5rem] text-
|
|
29
|
+
sm: "size-8 min-w-[2rem] text-base",
|
|
30
|
+
md: "size-10 min-w-[2.5rem] text-base",
|
|
31
31
|
},
|
|
32
32
|
// Ellipsis styles
|
|
33
33
|
ellipsisStyle: "inline-flex items-center justify-center font-medium text-[var(--color-text-muted)] dark:text-[var(--color-neutral-500)] cursor-default pointer-events-none",
|
|
@@ -27,9 +27,9 @@ const pillTheme = {
|
|
|
27
27
|
* Size variants
|
|
28
28
|
*/
|
|
29
29
|
sizes: {
|
|
30
|
-
sm: "text-
|
|
31
|
-
md: "text-
|
|
32
|
-
lg: "text-
|
|
30
|
+
sm: "text-sm px-2 py-0.5 gap-0.5",
|
|
31
|
+
md: "text-base px-2.5 py-1 gap-1",
|
|
32
|
+
lg: "text-base px-3 py-1 gap-1.5",
|
|
33
33
|
},
|
|
34
34
|
/**
|
|
35
35
|
* Icon sizes for iconStart and CheckIcon
|
|
@@ -61,6 +61,8 @@ const PopoverContent = React__default.forwardRef(({ children, className, animati
|
|
|
61
61
|
placement: placement,
|
|
62
62
|
offset: offset || 8,
|
|
63
63
|
autoWidth: true,
|
|
64
|
+
onClose: () => { if (!preventClose)
|
|
65
|
+
onOpenChange(false); },
|
|
64
66
|
});
|
|
65
67
|
// Click outside detection (active when no backdrop — with backdrop, Overlay handles it)
|
|
66
68
|
useClickOutside(localRef, (e) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { semanticBgColors } from '../../../utils/colorUtils.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Default theme configuration for Progress component
|
|
3
5
|
*/
|
|
@@ -9,9 +11,9 @@ const progressTheme = {
|
|
|
9
11
|
// Fill (progress bar) styles
|
|
10
12
|
fillStyle: "h-full rounded-full",
|
|
11
13
|
// Label text styles
|
|
12
|
-
labelStyle: "text-
|
|
14
|
+
labelStyle: "text-base font-medium text-[var(--color-text-secondary)] tabular-nums min-w-[2.5rem] text-right",
|
|
13
15
|
// Inside label styles (when label is positioned inside the bar)
|
|
14
|
-
insideLabelStyle: "absolute inset-0 flex items-center justify-center text-
|
|
16
|
+
insideLabelStyle: "absolute inset-0 flex items-center justify-center text-sm font-medium text-[var(--color-primary-contrast)] tabular-nums",
|
|
15
17
|
// Size variants for track height
|
|
16
18
|
sizes: {
|
|
17
19
|
sm: "h-1.5",
|
|
@@ -20,11 +22,12 @@ const progressTheme = {
|
|
|
20
22
|
},
|
|
21
23
|
// Color variants for the fill
|
|
22
24
|
colors: {
|
|
23
|
-
neutral:
|
|
24
|
-
primary:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
neutral: semanticBgColors.neutral + " dark:bg-[var(--color-neutral-500)]",
|
|
26
|
+
primary: semanticBgColors.primary + " dark:bg-[var(--color-primary-400)]",
|
|
27
|
+
secondary: semanticBgColors.secondary + " dark:bg-[var(--color-secondary-400)]",
|
|
28
|
+
success: semanticBgColors.success + " dark:bg-[var(--color-success-400)]",
|
|
29
|
+
warning: semanticBgColors.warning + " dark:bg-[var(--color-warning-400)]",
|
|
30
|
+
danger: semanticBgColors.danger + " dark:bg-[var(--color-danger-400)]",
|
|
28
31
|
},
|
|
29
32
|
// Indeterminate animation styles
|
|
30
33
|
indeterminateStyle: "animate-[progress-indeterminate_1.5s_ease-in-out_infinite]",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { SemanticColor } from "../../../utils/colorUtils";
|
|
2
3
|
export type ProgressSize = "sm" | "md" | "lg";
|
|
3
|
-
export type ProgressColor =
|
|
4
|
+
export type ProgressColor = SemanticColor;
|
|
4
5
|
export type ProgressLabelPosition = "right" | "top" | "bottom" | "inside";
|
|
5
6
|
/**
|
|
6
7
|
* Theme configuration for Progress component
|
|
@@ -25,9 +25,9 @@ const segmentedItemTheme = {
|
|
|
25
25
|
baseStyle: "relative flex min-h-full min-w-fit flex-1 items-center justify-center transition-all duration-200 rounded-[calc(var(--segmented-radius)-1.5px)] font-medium cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary-500)] focus-visible:ring-offset-1",
|
|
26
26
|
// Size variants using CSS variables
|
|
27
27
|
sizes: {
|
|
28
|
-
sm: "text-
|
|
29
|
-
md: "text-
|
|
30
|
-
lg: "text-
|
|
28
|
+
sm: "text-base px-[var(--segmented-px-sm)]",
|
|
29
|
+
md: "text-base px-[var(--segmented-px-md)]",
|
|
30
|
+
lg: "text-base px-[var(--segmented-px-lg)]",
|
|
31
31
|
},
|
|
32
32
|
// Selected state
|
|
33
33
|
selectedStyle: "text-[var(--color-text-primary)] z-10",
|
|
@@ -7,7 +7,7 @@ const SidebarNavGroup = React__default.forwardRef(({ title, showTitleWhenCollaps
|
|
|
7
7
|
const sidebarContext = useSidebarContext();
|
|
8
8
|
const collapsed = (sidebarContext === null || sidebarContext === void 0 ? void 0 : sidebarContext.collapsed) || false;
|
|
9
9
|
const showTitle = title && (!collapsed || showTitleWhenCollapsed);
|
|
10
|
-
return (jsxs("div", { ref: ref, className: cn("space-y-1", className), ...props, children: [showTitle && (jsx("div", { className: "px-2 py-2", children: jsx("h3", { className: "text-
|
|
10
|
+
return (jsxs("div", { ref: ref, className: cn("space-y-1", className), ...props, children: [showTitle && (jsx("div", { className: "px-2 py-2", children: jsx("h3", { className: "text-sm font-semibold text-[var(--color-text-muted)] uppercase tracking-wider", children: title }) })), collapsed && !showTitleWhenCollapsed && (jsx("div", { className: "h-px bg-[var(--color-border)] mx-2 my-2" })), jsx("div", { className: "space-y-1", children: children })] }));
|
|
11
11
|
});
|
|
12
12
|
SidebarNavGroup.displayName = "SidebarNavGroup";
|
|
13
13
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { semanticSpinnerColors } from '../../../utils/colorUtils.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Default theme for the Spinner component
|
|
3
5
|
*/
|
|
@@ -12,12 +14,8 @@ const spinnerTheme = {
|
|
|
12
14
|
},
|
|
13
15
|
// Color variants
|
|
14
16
|
colors: {
|
|
15
|
-
|
|
17
|
+
...semanticSpinnerColors,
|
|
16
18
|
dark: "border-[var(--color-background-quinary)] border-t-transparent",
|
|
17
|
-
primary: "border-[var(--color-primary)] border-t-transparent",
|
|
18
|
-
success: "border-[var(--color-success)] border-t-transparent",
|
|
19
|
-
warning: "border-[var(--color-warning)] border-t-transparent",
|
|
20
|
-
danger: "border-[var(--color-danger)] border-t-transparent",
|
|
21
19
|
},
|
|
22
20
|
// Animation class with drop shadow
|
|
23
21
|
animation: "animate-[spin_1s_linear_infinite] rounded-full",
|
|
@@ -21,8 +21,9 @@ export interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
21
21
|
*/
|
|
22
22
|
theme?: SpinnerThemeOverrides;
|
|
23
23
|
}
|
|
24
|
+
import { SemanticColor } from "../../../utils/colorUtils";
|
|
24
25
|
export type SpinnerSize = "sm" | "md" | "lg";
|
|
25
|
-
export type SpinnerColor =
|
|
26
|
+
export type SpinnerColor = SemanticColor | "dark";
|
|
26
27
|
export interface SpinnerThemeOverrides {
|
|
27
28
|
baseStyle?: string;
|
|
28
29
|
sizes?: Partial<Record<SpinnerSize, string>>;
|
|
@@ -10,8 +10,8 @@ const tabsTheme = {
|
|
|
10
10
|
triggerStyle: "relative inline-flex items-center justify-center whitespace-nowrap font-medium transition-all duration-300 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] data-[state=active]:text-[var(--color-primary)]",
|
|
11
11
|
// TabsTrigger size variants using CSS variables where applicable
|
|
12
12
|
triggerSizes: {
|
|
13
|
-
sm: "px-2 py-1.5 text-
|
|
14
|
-
md: "px-2 py-2 text-
|
|
13
|
+
sm: "px-2 py-1.5 text-base gap-1",
|
|
14
|
+
md: "px-2 py-2 text-base gap-1",
|
|
15
15
|
},
|
|
16
16
|
// TabsContent styles with proper CSS variables
|
|
17
17
|
contentStyle: "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2",
|
|
@@ -3,8 +3,8 @@ const tagTheme = {
|
|
|
3
3
|
"bg-white dark:bg-[var(--color-background-secondary)] border border-[var(--color-border)] " +
|
|
4
4
|
"text-[var(--color-text-primary)]",
|
|
5
5
|
sizes: {
|
|
6
|
-
sm: "text-
|
|
7
|
-
md: "text-
|
|
6
|
+
sm: "text-sm px-2.5 py-0.5",
|
|
7
|
+
md: "text-base px-2.5 py-0.5",
|
|
8
8
|
},
|
|
9
9
|
disabledStyle: "opacity-50 cursor-not-allowed",
|
|
10
10
|
removeButtonStyle: "inline-flex items-center justify-center rounded-full p-1 " +
|
|
@@ -8,10 +8,10 @@ const toastTheme = {
|
|
|
8
8
|
},
|
|
9
9
|
iconStyle: "flex-shrink-0 size-5 mt-0.5",
|
|
10
10
|
iconCenteredStyle: "flex-shrink-0 size-5",
|
|
11
|
-
titleStyle: "font-semibold text-
|
|
12
|
-
textOnlyStyle: "text-
|
|
13
|
-
subtitleStyle: "text-
|
|
14
|
-
actionStyle: "text-
|
|
11
|
+
titleStyle: "font-semibold text-base",
|
|
12
|
+
textOnlyStyle: "text-base",
|
|
13
|
+
subtitleStyle: "text-base mt-0.5 opacity-60",
|
|
14
|
+
actionStyle: "text-sm font-medium px-2 py-1 rounded border bg-white/80 hover:bg-white transition-colors cursor-pointer " +
|
|
15
15
|
"dark:bg-white/10 dark:border-white/20 dark:hover:bg-white/20 dark:text-white",
|
|
16
16
|
closeButtonStyle: "absolute top-2 right-2 flex-shrink-0 w-4 h-4 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
|
|
17
17
|
closeButtonCenteredStyle: "flex-shrink-0 w-4 h-4 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const tooltipTheme = {
|
|
2
2
|
// Base style for the tooltip - using fixed positioning for portal rendering
|
|
3
|
-
baseStyle: "fixed z-[99] rounded-[var(--tooltip-radius)] py-1 px-2 text-
|
|
3
|
+
baseStyle: "fixed z-[99] rounded-[var(--tooltip-radius)] py-1 px-2 text-sm text-[var(--color-text-primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 pointer-events-none bg-white/60 backdrop-blur-md outline outline-[var(--color-border)] shadow-lg border-t-[1px] border-white " +
|
|
4
4
|
"dark:bg-neutral-800/80 dark:outline-[var(--color-border)]/80 dark:border-[var(--color-border)]",
|
|
5
5
|
};
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const treeTheme = {
|
|
2
2
|
baseStyle: 'flex flex-col w-full',
|
|
3
3
|
nodeStyle: 'flex items-center py-1 pr-1 rounded-[calc(var(--radius-base)*0.75)] hover:bg-[var(--color-background-secondary)] cursor-pointer transition-colors select-none gap-2',
|
|
4
|
-
labelStyle: 'flex-1 text-
|
|
4
|
+
labelStyle: 'flex-1 text-lg text-[var(--color-text-primary)] truncate',
|
|
5
5
|
iconStyle: 'flex-shrink-0 text-[var(--color-text-muted)]',
|
|
6
6
|
expandIconStyle: 'flex-shrink-0 mr-1 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] transition-colors cursor-pointer size-4 flex items-center justify-center',
|
|
7
7
|
indentSize: '1rem',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const descriptionListTheme = {
|
|
2
2
|
baseStyle: "divide-y divide-[var(--color-border)] min-w-0",
|
|
3
3
|
itemStyle: "px-4 py-3",
|
|
4
|
-
termStyle: "text-
|
|
5
|
-
detailStyle: "mt-1 text-
|
|
4
|
+
termStyle: "text-base/6 font-medium text-[var(--color-text-primary)]",
|
|
5
|
+
detailStyle: "mt-1 text-base/6 text-[var(--color-text-secondary)]",
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { descriptionListTheme };
|
|
@@ -54,7 +54,7 @@ const FeedItem = React__default.forwardRef(({ variant = "default", title, timest
|
|
|
54
54
|
case "icon":
|
|
55
55
|
return (jsxs("div", { className: cn(theme.contentStyle, "py-1.5"), children: [jsxs("p", { className: theme.actionTextStyle, children: [title && jsxs("span", { className: theme.titleStyle, children: [title, " "] }), children] }), timestamp && jsx("p", { className: theme.timestampStyle, children: timestamp })] }));
|
|
56
56
|
case "avatar":
|
|
57
|
-
return (jsxs("div", { className: theme.contentStyle, children: [title && (jsx("p", { className: cn(theme.titleStyle, "text-
|
|
57
|
+
return (jsxs("div", { className: theme.contentStyle, children: [title && (jsx("p", { className: cn(theme.titleStyle, "text-base"), children: title })), jsx("p", { className: cn(theme.actionTextStyle, "mt-0.5"), children: children }), timestamp && jsx("p", { className: theme.timestampStyle, children: timestamp })] }));
|
|
58
58
|
case "comment-input": {
|
|
59
59
|
const handleSubmit = () => {
|
|
60
60
|
const trimmed = inputValue.trim();
|
|
@@ -12,8 +12,8 @@ const feedTheme = {
|
|
|
12
12
|
// Content
|
|
13
13
|
contentStyle: "min-w-0 flex-1",
|
|
14
14
|
titleStyle: "font-medium text-[var(--color-text-primary)]",
|
|
15
|
-
actionTextStyle: "text-
|
|
16
|
-
timestampStyle: "mt-1 text-
|
|
15
|
+
actionTextStyle: "text-base text-[var(--color-text-secondary)]",
|
|
16
|
+
timestampStyle: "mt-1 text-sm text-[var(--color-text-muted)]/80 whitespace-nowrap font-medium",
|
|
17
17
|
// Comment input
|
|
18
18
|
commentInputWrapperStyle: "min-w-0 flex-1 space-y-2",
|
|
19
19
|
commentInputFooterStyle: "flex justify-end",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const ganttChartTheme = {
|
|
2
|
-
baseStyle: "flex flex-col w-full overflow-hidden text-
|
|
2
|
+
baseStyle: "flex flex-col w-full overflow-hidden text-base",
|
|
3
3
|
toolbarStyle: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 border-b border-[var(--color-border)] bg-[var(--color-background-secondary)]",
|
|
4
4
|
tablePanelStyle: "hidden sm:flex flex-col shrink-0 overflow-hidden",
|
|
5
5
|
chartPanelStyle: "flex flex-col flex-1 min-w-0 overflow-hidden",
|
|
@@ -9,7 +9,7 @@ const ganttChartTheme = {
|
|
|
9
9
|
tableTaskRowStyle: "flex items-center hover:bg-[var(--color-background-secondary)] transition-colors",
|
|
10
10
|
tableCellStyle: "px-3 truncate text-[var(--color-text-primary)]",
|
|
11
11
|
timelineHeaderStyle: "bg-[var(--color-background)] border-b border-[var(--color-border)]",
|
|
12
|
-
timelineMonthStyle: "text-
|
|
12
|
+
timelineMonthStyle: "text-sm font-medium text-[var(--color-text-secondary)] px-2 border-b border-[var(--color-border)] flex items-center",
|
|
13
13
|
timelineDayStyle: "text-[10px] text-[var(--color-text-muted)] flex items-center justify-center",
|
|
14
14
|
gridLineStyle: "border-r border-[var(--color-border)]/30",
|
|
15
15
|
weekendStyle: "bg-[var(--color-background-secondary)]/50",
|
|
@@ -64,7 +64,7 @@ const GanttChartPanel = forwardRef(({ onScroll, days, monthSpans }, ref) => {
|
|
|
64
64
|
}
|
|
65
65
|
}, [rows, focusedTaskId, setFocusedTaskId, onTaskClick]);
|
|
66
66
|
if (tasks.length === 0) {
|
|
67
|
-
return (jsx("div", { className: cn(theme.chartPanelStyle, "items-center justify-center"), children: jsxs("div", { className: "flex flex-col items-center gap-2 text-[var(--color-text-muted)]", children: [jsx(CalendarDaysIcon, { className: "size-10 opacity-40" }), jsx("div", { className: "text-
|
|
67
|
+
return (jsx("div", { className: cn(theme.chartPanelStyle, "items-center justify-center"), children: jsxs("div", { className: "flex flex-col items-center gap-2 text-[var(--color-text-muted)]", children: [jsx(CalendarDaysIcon, { className: "size-10 opacity-40" }), jsx("div", { className: "text-base font-medium", children: "No tasks to display" }), jsx("div", { className: "text-sm opacity-70", children: "Add tasks to see them on the timeline" })] }) }));
|
|
68
68
|
}
|
|
69
69
|
return (jsx("div", { className: cn(theme.chartPanelStyle), children: jsx("div", { ref: ref, className: "overflow-auto flex-1 min-h-0 focus:outline-none", onScroll: onScroll, onKeyDown: handleKeyDown, tabIndex: 0, role: "grid", "aria-label": "Gantt chart timeline", "data-gantt-chart-scroll": true, children: jsxs("div", { style: { width: totalWidth }, children: [jsx("div", { className: "sticky top-0 z-10", children: jsx(GanttTimelineHeader, { days: days, monthSpans: monthSpans }) }), jsxs("div", { className: "relative", style: { height: bodyHeight }, children: [jsx(GanttTimelineGrid, { days: days, height: bodyHeight }), jsx(GanttDependencyArrows, {}), rows.map((row, i) => {
|
|
70
70
|
const top = i * rowHeight;
|
|
@@ -13,7 +13,7 @@ const GanttMilestone = React__default.memo(({ task, group, top, }) => {
|
|
|
13
13
|
const left = offset * dayWidth + dayWidth / 2;
|
|
14
14
|
const size = 14;
|
|
15
15
|
const barColor = (_a = task.color) !== null && _a !== void 0 ? _a : group.color;
|
|
16
|
-
const tooltipContent = (jsxs("div", { className: "text-
|
|
16
|
+
const tooltipContent = (jsxs("div", { className: "text-sm space-y-1", children: [jsx("div", { className: "font-semibold", children: task.title }), jsxs("div", { className: "flex items-center gap-1.5 text-[var(--color-text-placeholder)]", children: [jsx("span", { className: "inline-block size-2 rounded-full shrink-0", style: { backgroundColor: group.color } }), group.title] }), jsx("div", { children: formatDateShort(task.endDate) })] }));
|
|
17
17
|
const handleClick = (e) => {
|
|
18
18
|
onTaskClick === null || onTaskClick === void 0 ? void 0 : onTaskClick(task, e);
|
|
19
19
|
};
|
|
@@ -33,7 +33,7 @@ const GanttMilestone = React__default.memo(({ task, group, top, }) => {
|
|
|
33
33
|
border: "2px solid var(--color-background, white)",
|
|
34
34
|
transform: "rotate(45deg)",
|
|
35
35
|
boxShadow: "0 1px 3px rgba(0,0,0,0.2)",
|
|
36
|
-
} }), jsx("span", { className: "absolute text-
|
|
36
|
+
} }), jsx("span", { className: "absolute text-sm font-medium whitespace-nowrap pointer-events-none", style: {
|
|
37
37
|
left: size + 4,
|
|
38
38
|
top: size / 2,
|
|
39
39
|
transform: "translateY(-50%)",
|
|
@@ -14,7 +14,7 @@ const GanttTableGroupRow = React__default.memo(({ row, }) => {
|
|
|
14
14
|
e.preventDefault();
|
|
15
15
|
toggleGroup(row.group.id);
|
|
16
16
|
}
|
|
17
|
-
}, role: "button", tabIndex: 0, "aria-expanded": !isCollapsed, "aria-label": `${row.group.title} — ${row.completedCount} of ${row.taskCount} completed`, children: [jsxs("div", { className: "flex items-center gap-2 px-3 flex-1 min-w-0", children: [jsx(motion.div, { variants: chevronVariants, animate: isCollapsed ? "collapsed" : "open", children: jsx(ChevronRightIcon, { className: "size-4 text-[var(--color-text-muted)]" }) }), jsx("div", { className: "size-2.5 rounded-full shrink-0", style: { backgroundColor: row.group.color } }), jsx("span", { className: "font-medium text-[var(--color-text-primary)] truncate", children: row.group.title }), jsxs("span", { className: "text-
|
|
17
|
+
}, role: "button", tabIndex: 0, "aria-expanded": !isCollapsed, "aria-label": `${row.group.title} — ${row.completedCount} of ${row.taskCount} completed`, children: [jsxs("div", { className: "flex items-center gap-2 px-3 flex-1 min-w-0", children: [jsx(motion.div, { variants: chevronVariants, animate: isCollapsed ? "collapsed" : "open", children: jsx(ChevronRightIcon, { className: "size-4 text-[var(--color-text-muted)]" }) }), jsx("div", { className: "size-2.5 rounded-full shrink-0", style: { backgroundColor: row.group.color } }), jsx("span", { className: "font-medium text-[var(--color-text-primary)] truncate", children: row.group.title }), jsxs("span", { className: "text-sm text-[var(--color-text-muted)] shrink-0", children: [row.completedCount, "/", row.taskCount] })] }), onTaskAdd && !readonly && (jsx("button", { className: "p-1 mr-2 rounded hover:bg-[var(--color-background-tertiary)] text-[var(--color-text-muted)] opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity", "aria-label": `Add task to ${row.group.title}`, onClick: (e) => {
|
|
18
18
|
e.stopPropagation();
|
|
19
19
|
onTaskAdd(row.group.id);
|
|
20
20
|
}, children: jsx(PlusIcon, { className: "size-4" }) }))] }));
|
|
@@ -162,7 +162,7 @@ const GanttTaskBar = React__default.memo(({ task, group, top, }) => {
|
|
|
162
162
|
onTaskClick === null || onTaskClick === void 0 ? void 0 : onTaskClick(task, e);
|
|
163
163
|
};
|
|
164
164
|
// ----- Tooltip -----
|
|
165
|
-
const tooltipContent = (jsxs("div", { className: "text-
|
|
165
|
+
const tooltipContent = (jsxs("div", { className: "text-sm space-y-2 min-w-[180px]", children: [jsx("div", { className: "font-semibold text-base", children: task.title }), jsxs("div", { className: "flex items-center gap-1.5 opacity-70", children: [jsx("span", { className: "inline-block size-2 rounded-full shrink-0", style: { backgroundColor: group.color } }), group.title] }), jsxs("div", { className: "space-y-0.5", children: [jsxs("div", { children: [formatDateShort(task.startDate), " \u2014 ", formatDateShort(task.endDate)] }), jsx("div", { className: "opacity-70", children: formatDuration(task.startDate, task.endDate) })] }), jsxs("div", { children: [jsxs("div", { className: "flex justify-between mb-1", children: [jsx("span", { children: "Progress" }), jsxs("span", { className: "font-medium", children: [task.progress, "%"] })] }), jsx("div", { className: "h-1.5 rounded-full bg-white/20 overflow-hidden", children: jsx("div", { className: "h-full rounded-full", style: {
|
|
166
166
|
width: `${task.progress}%`,
|
|
167
167
|
backgroundColor: barColor,
|
|
168
168
|
} }) })] }), task.assignee && (jsxs("div", { className: "flex items-center gap-1.5 pt-0.5", children: [jsx(Avatar, { src: task.assignee.avatar, alt: task.assignee.name, size: "xs" }), jsx("span", { children: task.assignee.name })] })), isBehindSchedule && (jsxs("div", { className: "text-[var(--color-warning)] text-[10px]", children: ["Behind schedule (expected ", expectedProgress, "%)"] }))] }));
|
|
@@ -195,7 +195,7 @@ const GanttTaskBar = React__default.memo(({ task, group, top, }) => {
|
|
|
195
195
|
} }), isBehindSchedule && (jsx("div", { className: "absolute top-0 bottom-0 w-px", style: {
|
|
196
196
|
left: `${expectedProgress}%`,
|
|
197
197
|
borderLeft: "2px dashed rgba(255,255,255,0.5)",
|
|
198
|
-
} })), task.completed && (jsx("div", { className: "absolute top-1/2 left-2 right-2 h-px bg-white/60", style: { transform: "translateY(-0.5px)" } })), canDragDates && (jsx("div", { className: "absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize z-20 rounded-l-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/10", onPointerDown: resizeLeftDrag.handlePointerDown })), canDragDates && (jsx("div", { className: "absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize z-20 rounded-r-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/10", onPointerDown: resizeRightDrag.handlePointerDown })), canDragProgress && !isNarrow && (jsx("div", { className: "absolute top-0 bottom-0 w-3 cursor-ew-resize z-20 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", style: { left: `calc(${displayProgress}% - 6px)` }, onPointerDown: progressDrag.handlePointerDown, children: jsx("div", { className: "w-0.5 h-3 rounded-full bg-white/80 shadow" }) })), !isNarrow && (jsxs("div", { className: "relative flex items-center gap-1.5 px-1 z-10 min-w-0 pointer-events-none", children: [task.assignee && (jsx(Avatar, { src: task.assignee.avatar, alt: task.assignee.name, size: "xs" })), jsx("span", { className: "truncate text-
|
|
198
|
+
} })), task.completed && (jsx("div", { className: "absolute top-1/2 left-2 right-2 h-px bg-white/60", style: { transform: "translateY(-0.5px)" } })), canDragDates && (jsx("div", { className: "absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize z-20 rounded-l-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/10", onPointerDown: resizeLeftDrag.handlePointerDown })), canDragDates && (jsx("div", { className: "absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize z-20 rounded-r-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/10", onPointerDown: resizeRightDrag.handlePointerDown })), canDragProgress && !isNarrow && (jsx("div", { className: "absolute top-0 bottom-0 w-3 cursor-ew-resize z-20 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", style: { left: `calc(${displayProgress}% - 6px)` }, onPointerDown: progressDrag.handlePointerDown, children: jsx("div", { className: "w-0.5 h-3 rounded-full bg-white/80 shadow" }) })), !isNarrow && (jsxs("div", { className: "relative flex items-center gap-1.5 px-1 z-10 min-w-0 pointer-events-none", children: [task.assignee && (jsx(Avatar, { src: task.assignee.avatar, alt: task.assignee.name, size: "xs" })), jsx("span", { className: "truncate text-sm text-[var(--color-text-inverse)] font-medium", children: task.title })] }))] }), isNarrow && (jsx("span", { className: "absolute text-sm font-medium whitespace-nowrap pointer-events-none", style: {
|
|
199
199
|
left: visualWidth + 6,
|
|
200
200
|
top: barHeight / 2,
|
|
201
201
|
transform: "translateY(-50%)",
|
|
@@ -43,7 +43,7 @@ const KPI = React__default.forwardRef(({ value, label, trend, trendLabel, progre
|
|
|
43
43
|
ease: "easeOut",
|
|
44
44
|
delay: i * 0.03,
|
|
45
45
|
} })) }, i));
|
|
46
|
-
}) })), subtitle && (jsx("span", { className: cn(theme.subtitleStyle, size === "sm" ? "text-
|
|
46
|
+
}) })), subtitle && (jsx("span", { className: cn(theme.subtitleStyle, size === "sm" ? "text-sm" : "text-base"), children: subtitle }))] }));
|
|
47
47
|
});
|
|
48
48
|
KPI.displayName = "KPI";
|
|
49
49
|
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
+
import { semanticBgColors } from '../../../utils/colorUtils.js';
|
|
2
|
+
|
|
1
3
|
const kpiTheme = {
|
|
2
4
|
baseStyle: "flex flex-col gap-3",
|
|
3
5
|
valueSizes: {
|
|
4
|
-
sm: "text-
|
|
6
|
+
sm: "text-2xl font-bold text-[var(--color-text-primary)]",
|
|
5
7
|
md: "text-3xl font-bold text-[var(--color-text-primary)]",
|
|
6
8
|
lg: "text-4xl font-bold text-[var(--color-text-primary)]",
|
|
7
9
|
},
|
|
8
10
|
labelStyle: "text-[var(--color-text-muted)]",
|
|
9
11
|
labelSizes: {
|
|
10
|
-
sm: "text-
|
|
11
|
-
md: "text-
|
|
12
|
-
lg: "text-
|
|
12
|
+
sm: "text-sm",
|
|
13
|
+
md: "text-base",
|
|
14
|
+
lg: "text-lg",
|
|
13
15
|
},
|
|
14
16
|
trendPositive: "text-[var(--color-success)]",
|
|
15
17
|
trendNegative: "text-[var(--color-danger)]",
|
|
16
18
|
trendNeutral: "text-[var(--color-text-muted)]",
|
|
17
19
|
trendSizes: {
|
|
18
|
-
sm: "text-
|
|
19
|
-
md: "text-
|
|
20
|
-
lg: "text-
|
|
20
|
+
sm: "text-sm",
|
|
21
|
+
md: "text-base",
|
|
22
|
+
lg: "text-lg",
|
|
21
23
|
},
|
|
22
24
|
barFilledColors: {
|
|
23
|
-
|
|
24
|
-
success: "bg-[var(--color-success)]",
|
|
25
|
-
warning: "bg-[var(--color-warning)]",
|
|
26
|
-
danger: "bg-[var(--color-danger)]",
|
|
25
|
+
...semanticBgColors,
|
|
27
26
|
neutral: "bg-[var(--color-text-secondary)]",
|
|
28
27
|
},
|
|
29
28
|
barEmptyColor: "bg-[var(--color-background-tertiary)]",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode, HTMLAttributes } from "react";
|
|
2
|
+
import { SemanticColor } from "../../../utils/colorUtils";
|
|
2
3
|
export type KPISize = "sm" | "md" | "lg";
|
|
3
|
-
export type KPIColor =
|
|
4
|
+
export type KPIColor = SemanticColor;
|
|
4
5
|
export interface KPITheme {
|
|
5
6
|
baseStyle: string;
|
|
6
7
|
valueSizes: Record<KPISize, string>;
|
|
@@ -11,7 +11,7 @@ const Metric = React__default.forwardRef(({ value, label, subtitle, trendValue,
|
|
|
11
11
|
const variantStyles = metricTheme.variants[variant];
|
|
12
12
|
const variantColorStyles = metricTheme.variantColors[variant] || "";
|
|
13
13
|
const iconStyles = ((_a = metricTheme.iconContainerVariantColors[variant]) === null || _a === void 0 ? void 0 : _a[color]) || "";
|
|
14
|
-
return (jsx("div", { ref: ref, className: cn(metricTheme.baseStyle, variantStyles, variantColorStyles, sizeStyles.container, className), "data-size": size, ...props, children: jsxs("div", { className: "flex flex-col gap-3 ", children: [jsxs("div", { className: cn("flex items-start gap-3", sizeStyles.contentPadding), children: [icon && (jsx("div", { className: cn(metricTheme.iconContainerStyle, iconStyles, sizeStyles.iconContainer), children: icon })), jsxs("div", { className: "flex flex-col flex-1", children: [jsx("div", { className: cn(metricTheme.labelStyle, sizeStyles.label), children: label }), jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: cn(metricTheme.valueStyle, sizeStyles.value), children: value }), trendValue && (jsxs("div", { className: cn("flex items-center w-fit gap-1 text-
|
|
14
|
+
return (jsx("div", { ref: ref, className: cn(metricTheme.baseStyle, variantStyles, variantColorStyles, sizeStyles.container, className), "data-size": size, ...props, children: jsxs("div", { className: "flex flex-col gap-3 ", children: [jsxs("div", { className: cn("flex items-start gap-3", sizeStyles.contentPadding), children: [icon && (jsx("div", { className: cn(metricTheme.iconContainerStyle, iconStyles, sizeStyles.iconContainer), children: icon })), jsxs("div", { className: "flex flex-col flex-1", children: [jsx("div", { className: cn(metricTheme.labelStyle, sizeStyles.label), children: label }), jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: cn(metricTheme.valueStyle, sizeStyles.value), children: value }), trendValue && (jsxs("div", { className: cn("flex items-center w-fit gap-1 text-base font-medium", trendDirection === "up"
|
|
15
15
|
? "text-[var(--color-success)]"
|
|
16
16
|
: "text-[var(--color-danger)]"), children: [trendIcon, " ", trendValue] }))] }), subtitle && (jsx("div", { className: cn(metricTheme.subtitleStyle, sizeStyles.subtitle), children: subtitle }))] })] }), trendChart && (jsx("div", { className: "w-full h-12 flex-shrink-0 -mt-4", children: trendChart }))] }) }));
|
|
17
17
|
});
|
|
@@ -22,6 +22,8 @@ const metricTheme = {
|
|
|
22
22
|
"dark:bg-[var(--color-background-secondary)]",
|
|
23
23
|
primary: "bg-white text-[var(--color-primary)] border border-[var(--color-border)] " +
|
|
24
24
|
"dark:bg-[var(--color-background-secondary)]",
|
|
25
|
+
secondary: "bg-white text-[var(--color-secondary)] border border-[var(--color-border)] " +
|
|
26
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
25
27
|
success: "bg-white text-[var(--color-success)] border border-[var(--color-border)] " +
|
|
26
28
|
"dark:bg-[var(--color-background-secondary)]",
|
|
27
29
|
warning: "bg-white text-[var(--color-warning)] border border-[var(--color-border)] " +
|
|
@@ -33,6 +35,8 @@ const metricTheme = {
|
|
|
33
35
|
neutral: "glass-effect-1 !ring-0 text-[var(--color-text-primary)]",
|
|
34
36
|
primary: "glass-effect-2 !ring-0 shadow-lg shadow-blue-500/10 text-[var(--color-primary)] " +
|
|
35
37
|
"dark:text-[var(--color-primary-400)]",
|
|
38
|
+
secondary: "glass-effect-2 !ring-0 shadow-lg shadow-gray-500/10 text-[var(--color-secondary)] " +
|
|
39
|
+
"dark:text-[var(--color-secondary-400)]",
|
|
36
40
|
success: "glass-effect-2 !ring-0 shadow-lg shadow-green-500/10 text-[var(--color-success)] " +
|
|
37
41
|
"dark:text-[var(--color-success-400)]",
|
|
38
42
|
warning: "glass-effect-2 !ring-0 shadow-lg shadow-yellow-500/10 text-[var(--color-warning)] " +
|
|
@@ -47,25 +51,25 @@ const metricTheme = {
|
|
|
47
51
|
container: "", // Padding moved to content section
|
|
48
52
|
contentPadding: "p-3",
|
|
49
53
|
iconContainer: "size-10",
|
|
50
|
-
label: "text-
|
|
51
|
-
value: "text-
|
|
52
|
-
subtitle: "text-
|
|
54
|
+
label: "text-sm",
|
|
55
|
+
value: "text-2xl",
|
|
56
|
+
subtitle: "text-sm mt-1",
|
|
53
57
|
},
|
|
54
58
|
md: {
|
|
55
59
|
container: "", // Padding moved to content section
|
|
56
60
|
contentPadding: "p-4",
|
|
57
61
|
iconContainer: "size-14",
|
|
58
|
-
label: "text-
|
|
62
|
+
label: "text-base",
|
|
59
63
|
value: "text-2xl",
|
|
60
|
-
subtitle: "text-
|
|
64
|
+
subtitle: "text-sm mt-0.5",
|
|
61
65
|
},
|
|
62
66
|
lg: {
|
|
63
67
|
container: "", // Padding moved to content section
|
|
64
68
|
contentPadding: "p-5",
|
|
65
69
|
iconContainer: "size-16",
|
|
66
|
-
label: "text-
|
|
70
|
+
label: "text-lg",
|
|
67
71
|
value: "text-3xl",
|
|
68
|
-
subtitle: "text-
|
|
72
|
+
subtitle: "text-base mt-1",
|
|
69
73
|
},
|
|
70
74
|
},
|
|
71
75
|
// Common element styles
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SemanticColor } from '../../../utils/colorUtils';
|
|
2
3
|
export type MetricSize = 'sm' | 'md' | 'lg';
|
|
3
|
-
export type MetricColor =
|
|
4
|
+
export type MetricColor = SemanticColor;
|
|
4
5
|
export type MetricVariant = 'filled' | 'glass';
|
|
5
6
|
export type TrendDirection = 'up' | 'down';
|
|
6
7
|
export interface MetricProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -3,7 +3,7 @@ const tableTheme = {
|
|
|
3
3
|
// Uses border-separate so sticky cells keep their borders (border-collapse
|
|
4
4
|
// paints borders on the table grid, which sticky cells float above)
|
|
5
5
|
// Light: white background | Dark: neutral-900 background
|
|
6
|
-
baseStyle: "w-full border-separate border-spacing-0 text-
|
|
6
|
+
baseStyle: "w-full border-separate border-spacing-0 text-base " + "",
|
|
7
7
|
// Variant styles
|
|
8
8
|
// Each variant gets dark mode border colors and alternate row colors
|
|
9
9
|
variants: {
|
|
@@ -23,7 +23,7 @@ const tableTheme = {
|
|
|
23
23
|
// Header styles
|
|
24
24
|
// Light: primary text, light border | Dark: neutral-200 text, neutral-700 border
|
|
25
25
|
headerStyle: "text-left font-semibold sticky top-0 border-b first:pl-4 last:pr-4 " +
|
|
26
|
-
"text-[var(--color-text-secondary)]/80 text-
|
|
26
|
+
"text-[var(--color-text-secondary)]/80 text-base border-[var(--color-border)] ",
|
|
27
27
|
// Cell styles — borders on cells (not rows) so sticky columns keep them
|
|
28
28
|
// Light: primary text | Dark: neutral-300 text
|
|
29
29
|
cellStyle: "border-b border-b-[var(--color-border)] first:pl-4 last:pr-4 " +
|
|
@@ -46,7 +46,7 @@ const tableTheme = {
|
|
|
46
46
|
"dark:shadow-[var(--color-neutral-900)]/50",
|
|
47
47
|
// Utility controls - Column manager button
|
|
48
48
|
// Light: white bg with light border | Dark: neutral-800 bg with neutral-600 border
|
|
49
|
-
columnManagerButton: "inline-flex items-center gap-2 rounded-[calc(var(--radius-base)*0.75)] px-3 py-2 text-
|
|
49
|
+
columnManagerButton: "inline-flex items-center gap-2 rounded-[calc(var(--radius-base)*0.75)] px-3 py-2 text-base font-medium " +
|
|
50
50
|
"focus:outline-none focus:ring-2 focus:ring-[var(--color-primary-500)] focus:ring-offset-2 " +
|
|
51
51
|
"dark:focus:ring-offset-[var(--color-neutral-900)] " +
|
|
52
52
|
"bg-white border border-[var(--color-neutral-300)] text-[var(--color-text-primary)] hover:bg-[var(--color-neutral-50)] " +
|
|
@@ -17,7 +17,7 @@ const TableActionsMenu = ({ actions, row, onClose, className, }) => {
|
|
|
17
17
|
var _a;
|
|
18
18
|
const isDisabled = (_a = action.disabled) === null || _a === void 0 ? void 0 : _a.call(action, row);
|
|
19
19
|
const Icon = action.icon;
|
|
20
|
-
return (jsxs("button", { onClick: () => handleActionClick(action), disabled: isDisabled, className: cn("w-full flex items-center gap-3 px-3 py-2 text-
|
|
20
|
+
return (jsxs("button", { onClick: () => handleActionClick(action), disabled: isDisabled, className: cn("w-full flex items-center gap-3 px-3 py-2 text-base font-medium text-left transition-all duration-300", "hover:bg-[var(--color-background-secondary)] focus:bg-[var(--color-background-secondary)] focus:outline-none rounded-sm cursor-pointer", action.variant === 'danger'
|
|
21
21
|
? "text-[var(--color-danger)] hover:bg-[var(--color-danger-50)] focus:bg-[var(--color-danger-50)]"
|
|
22
22
|
: "text-[var(--color-text-primary)]", isDisabled && "opacity-50 cursor-not-allowed hover:bg-transparent"), role: "menuitem", "aria-label": action.label, children: [jsx(Icon, { className: "size-4 flex-shrink-0" }), jsx("span", { children: action.label })] }, action.id));
|
|
23
23
|
}) }));
|
|
@@ -16,7 +16,7 @@ function TableColumnManagerComponent({ columns, visibleColumns, columnOrder, onT
|
|
|
16
16
|
const displayName = typeof column.header === 'string' ? column.header : column.id;
|
|
17
17
|
return (jsx(Checkbox, { id: `column-checkbox-${column.id}`, name: `column-${column.id}`, value: column.id, checked: isVisible, onChange: () => onToggleColumn(column.id), "aria-label": `Toggle visibility for ${displayName} column`, label: displayName, state: isLocked ? 'disabled' : 'default' }));
|
|
18
18
|
};
|
|
19
|
-
return (jsxs(Popover, { placement: "bottom-end", offset: 8, children: [jsx(Popover.Trigger, { children: jsxs(Button, { color: "neutral", variant: "filled", "aria-label": "Manage column visibility", children: [jsx(Cog6ToothIcon, { className: "size-5", "aria-hidden": "true" }), "Manage Columns"] }) }), jsx(Popover.Content, { className: "p-0", children: jsxs("div", { className: "w-64 p-3 overflow-hidden", role: "dialog", "aria-labelledby": "column-manager-title", "aria-describedby": "column-manager-description", "aria-modal": "true", children: [jsx("div", { id: "column-manager-title", className: "text-
|
|
19
|
+
return (jsxs(Popover, { placement: "bottom-end", offset: 8, children: [jsx(Popover.Trigger, { children: jsxs(Button, { color: "neutral", variant: "filled", "aria-label": "Manage column visibility", children: [jsx(Cog6ToothIcon, { className: "size-5", "aria-hidden": "true" }), "Manage Columns"] }) }), jsx(Popover.Content, { className: "p-0", children: jsxs("div", { className: "w-64 p-3 overflow-hidden", role: "dialog", "aria-labelledby": "column-manager-title", "aria-describedby": "column-manager-description", "aria-modal": "true", children: [jsx("div", { id: "column-manager-title", className: "text-sm uppercase font-bold mb-3 text-[var(--color-text-placeholder)]", children: "Manage Columns" }), jsx("div", { id: "column-manager-description", className: "sr-only", children: "Use checkboxes to control which columns are visible in the table. Locked columns cannot be hidden." }), jsx("div", { className: "space-y-0.5", role: "group", "aria-label": "Column visibility options", children: onColumnReorder ? (jsx(Sortable, { onReorder: onColumnReorder, showDragHandle: true, className: "space-y-0.5", children: orderedColumns.map((column) => (jsx(SortableItem, { id: column.id, disabled: column.locked === true, className: `hover:bg-[var(--color-background-tertiary)] rounded-lg p-1.5 transition-colors ${column.locked ? 'bg-[var(--color-background-secondary)]' : ''}`, children: renderColumnItem(column) }, column.id))) })) : (orderedColumns.map((column) => (jsx("div", { className: `hover:bg-[var(--color-background-tertiary)] rounded-lg p-1.5 transition-colors ${column.locked ? 'bg-[var(--color-background-secondary)]' : ''}`, children: renderColumnItem(column) }, column.id)))) }), jsx("div", { className: "mt-3 flex justify-end", children: jsx(Button, { color: "neutral", variant: "filled", className: "w-full", onClick: onResetToDefault, children: "Reset to Default" }) })] }) })] }));
|
|
20
20
|
}
|
|
21
21
|
const TableColumnManager = TableColumnManagerComponent;
|
|
22
22
|
|
|
@@ -23,7 +23,7 @@ function FilterValueInput({ filter, column, filterType, onValueChange, }) {
|
|
|
23
23
|
if (isBetweenOperator(filter.operator)) {
|
|
24
24
|
const betweenValue = Array.isArray(filter.value) ? filter.value : ["", ""];
|
|
25
25
|
const inputType = filterType === "date" ? "date" : "number";
|
|
26
|
-
return (jsxs("div", { className: "flex items-center gap-1 flex-1 min-w-0", children: [jsx(Input, { value: (_a = betweenValue[0]) !== null && _a !== void 0 ? _a : "", onChange: (e) => onValueChange([e.target.value, betweenValue[1]]), placeholder: "Min", size: "sm", type: inputType, className: "flex-1 min-w-0" }), jsx("span", { className: "text-
|
|
26
|
+
return (jsxs("div", { className: "flex items-center gap-1 flex-1 min-w-0", children: [jsx(Input, { value: (_a = betweenValue[0]) !== null && _a !== void 0 ? _a : "", onChange: (e) => onValueChange([e.target.value, betweenValue[1]]), placeholder: "Min", size: "sm", type: inputType, className: "flex-1 min-w-0" }), jsx("span", { className: "text-sm text-[var(--color-text-muted)]", children: "\u2013" }), jsx(Input, { value: (_b = betweenValue[1]) !== null && _b !== void 0 ? _b : "", onChange: (e) => onValueChange([betweenValue[0], e.target.value]), placeholder: "Max", size: "sm", type: inputType, className: "flex-1 min-w-0" })] }));
|
|
27
27
|
}
|
|
28
28
|
// Select filter type
|
|
29
29
|
if (filterType === "select" && (column === null || column === void 0 ? void 0 : column.filterOptions)) {
|
|
@@ -206,9 +206,9 @@ function TableFilter({ columns, filterConfig, onFilterChange, filterLogic: contr
|
|
|
206
206
|
return true;
|
|
207
207
|
return f.value != null && f.value !== "";
|
|
208
208
|
}).length;
|
|
209
|
-
return (jsxs(Popover, { placement: "bottom-end", offset: 8, closeOnClickOutside: false, children: [jsx(Popover.Trigger, { children: jsxs(Button, { color: "neutral", variant: "outline", "aria-label": "Filter table data", size: "sm", children: [jsx(FunnelIcon, { className: "size-4", "aria-hidden": "true" }), "Filters", appliedFilterCount > 0 && (jsx("span", { className: "ml-1 inline-flex items-center justify-center size-5 rounded-full bg-[var(--color-primary)] text-[var(--color-primary-contrast)] text-
|
|
209
|
+
return (jsxs(Popover, { placement: "bottom-end", offset: 8, closeOnClickOutside: false, children: [jsx(Popover.Trigger, { children: jsxs(Button, { color: "neutral", variant: "outline", "aria-label": "Filter table data", size: "sm", children: [jsx(FunnelIcon, { className: "size-4", "aria-hidden": "true" }), "Filters", appliedFilterCount > 0 && (jsx("span", { className: "ml-1 inline-flex items-center justify-center size-5 rounded-full bg-[var(--color-primary)] text-[var(--color-primary-contrast)] text-sm font-medium", children: appliedFilterCount }))] }) }), jsx(Popover.Content, { className: "p-0 max-w-none", children: jsxs("div", { className: cn("w-[500px] p-3", className), role: "dialog", "aria-labelledby": "table-filter-title", "aria-modal": "true", children: [jsxs("div", { className: "flex items-center justify-between mb-3", children: [jsx("div", { id: "table-filter-title", className: "text-sm uppercase font-bold text-[var(--color-text-placeholder)]", children: "Filters" }), activeFilters.length > 1 && (jsxs("div", { className: "flex items-center gap-0.5 rounded-md bg-[var(--color-background-secondary)] p-0.5", children: [jsx("button", { type: "button", className: cn("px-2.5 py-0.5 text-sm font-medium rounded transition-colors", filterLogic === "and"
|
|
210
210
|
? "bg-[var(--color-background)] text-[var(--color-text-primary)] shadow-sm"
|
|
211
|
-
: "text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"), onClick: () => handleSetLogic("and"), children: "AND" }), jsx("button", { type: "button", className: cn("px-2.5 py-0.5 text-
|
|
211
|
+
: "text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"), onClick: () => handleSetLogic("and"), children: "AND" }), jsx("button", { type: "button", className: cn("px-2.5 py-0.5 text-sm font-medium rounded transition-colors", filterLogic === "or"
|
|
212
212
|
? "bg-[var(--color-background)] text-[var(--color-text-primary)] shadow-sm"
|
|
213
213
|
: "text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"), onClick: () => handleSetLogic("or"), children: "OR" })] }))] }), jsx("div", { className: "-m-1 p-1 space-y-2 max-h-[300px] overflow-y-auto", children: activeFilters.map((filter) => {
|
|
214
214
|
const selectedColumn = getSelectedColumn(filter.columnId);
|