flikkui 0.1.0-beta.4 → 0.1.0-beta.6
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/charts/AreaChart/AreaChart.js +434 -0
- package/dist/components/charts/AreaChart/AreaChart.types.js +7 -0
- package/dist/components/charts/BarChart/BarChart.js +402 -0
- package/dist/components/charts/BarChart/BarChart.types.js +7 -0
- package/dist/components/charts/ChartContainer.js +38 -0
- package/dist/components/charts/Heatmap/Heatmap.js +153 -0
- package/dist/components/charts/Heatmap/HeatmapCell.js +100 -0
- package/dist/components/charts/Heatmap/HeatmapLegend.js +20 -0
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +174 -0
- package/dist/components/charts/LineChart/LineChart.js +396 -0
- package/dist/components/charts/LineChart/LineChart.types.js +7 -0
- package/dist/components/charts/hooks/useChartAccessibility.js +127 -0
- package/dist/components/charts/hooks/useChartTheme.js +86 -0
- package/dist/components/charts/hooks/useChartValidation.js +59 -0
- package/dist/components/charts/hooks/useTooltipPosition.js +292 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +30 -0
- package/dist/components/charts/shared/ChartAxis/YAxis.js +97 -0
- package/dist/components/charts/shared/ChartCrosshair/ChartCrosshair.js +35 -0
- package/dist/components/charts/shared/ChartCrosshair/ChartCrosshair.theme.js +11 -0
- package/dist/components/charts/shared/ChartErrorBoundary/ChartErrorBoundary.js +66 -0
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +22 -0
- package/dist/components/charts/shared/ChartLegend/ChartLegend.js +30 -0
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +22 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +25 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.theme.js +9 -0
- package/dist/components/charts/shared/ChartText/ChartText.js +33 -0
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +9 -0
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.js +62 -0
- package/dist/components/charts/theme/chart.theme.js +73 -0
- package/dist/components/charts/types/chart.types.js +29 -0
- package/dist/components/charts/utils/chart-validation.js +292 -0
- package/dist/components/charts/utils/color-utils.js +175 -0
- package/dist/components/core/Accordion/Accordion.animations.js +45 -0
- package/dist/components/core/Accordion/Accordion.js +52 -0
- package/dist/components/core/Accordion/Accordion.theme.js +8 -0
- package/dist/components/core/Accordion/AccordionContent.js +25 -0
- package/dist/components/core/Accordion/AccordionItem.js +56 -0
- package/dist/components/core/Accordion/AccordionTrigger.js +32 -0
- package/dist/components/core/Accordion/index.js +5 -0
- package/dist/components/core/Avatar/Avatar.js +94 -0
- package/dist/components/core/Avatar/Avatar.theme.js +25 -0
- package/dist/components/core/AvatarGroup/AvatarGroup.animations.js +79 -0
- package/dist/components/core/AvatarGroup/AvatarGroup.js +67 -0
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +23 -0
- package/dist/components/core/Badge/Badge.animations.js +109 -0
- package/dist/components/core/Badge/Badge.js +101 -0
- package/dist/components/core/Badge/Badge.theme.js +41 -0
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +8 -8
- package/dist/components/core/Button/Button.theme.js +5 -5
- package/dist/components/core/Card/Card.js +46 -0
- package/dist/components/core/Card/Card.theme.js +5 -0
- package/dist/components/core/Divider/Divider.js +21 -0
- package/dist/components/core/Divider/Divider.theme.js +19 -0
- package/dist/components/core/Pagination/Pagination.js +113 -0
- package/dist/components/core/Pagination/Pagination.theme.js +27 -0
- package/dist/components/core/Segmented/Segmented.js +69 -0
- package/dist/components/core/Segmented/Segmented.theme.js +40 -0
- package/dist/components/core/Segmented/SegmentedContext.js +8 -0
- package/dist/components/core/Segmented/SegmentedItem.js +30 -0
- package/dist/components/core/Stepper/Stepper.js +57 -0
- package/dist/components/core/Stepper/Stepper.theme.js +9 -0
- package/dist/components/core/Stepper/components/ConnectorLine.js +42 -0
- package/dist/components/core/Stepper/components/IconCircle.js +44 -0
- package/dist/components/core/Stepper/components/ProgressIndicator.js +12 -0
- package/dist/components/core/Stepper/components/StepContent.js +36 -0
- package/dist/components/core/Stepper/components/StepperItem.js +22 -0
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tooltip/Tooltip.animations.js +46 -0
- package/dist/components/core/Tooltip/Tooltip.js +85 -0
- package/dist/components/core/Tooltip/Tooltip.theme.js +11 -0
- package/dist/components/core/Tooltip/useTooltipPositioning.js +59 -0
- package/dist/components/core/Tree/Tree.animations.js +38 -0
- package/dist/components/core/Tree/Tree.js +177 -0
- package/dist/components/core/Tree/Tree.theme.js +11 -0
- package/dist/components/data-display/Table/Table.js +177 -0
- package/dist/components/data-display/Table/Table.theme.js +28 -0
- package/dist/components/data-display/Table/Table.utils.js +28 -0
- package/dist/components/data-display/Table/components/DeclarativeComponents.js +123 -0
- package/dist/components/data-display/Table/components/TableActions/TableActions.js +56 -0
- package/dist/components/data-display/Table/components/TableActions/TableActionsMenu.js +29 -0
- package/dist/components/data-display/Table/components/TableColumnManager/TableColumnManager.js +85 -0
- package/dist/components/data-display/Table/components/TableColumnManager/TableColumnManager.theme.js +21 -0
- package/dist/components/data-display/Table/components/TablePagination/TablePagination.js +51 -0
- package/dist/components/data-display/Table/components/TableSelectionHeader/TableSelectionHeader.js +29 -0
- package/dist/components/data-display/Table/components/core/TableBody.js +32 -0
- package/dist/components/data-display/Table/components/core/TableCell.js +47 -0
- package/dist/components/data-display/Table/components/core/TableHeader.js +77 -0
- package/dist/components/data-display/Table/components/core/TableRow.js +46 -0
- package/dist/components/data-display/Table/index.js +20 -0
- package/dist/components/feedback/Alert/Alert.js +36 -0
- package/dist/components/feedback/Alert/Alert.theme.js +17 -0
- package/dist/components/feedback/ChatMessage/ChatMessage.js +26 -0
- package/dist/components/feedback/ChatMessage/ChatMessage.theme.js +16 -0
- package/dist/components/feedback/Empty/Empty.js +26 -0
- package/dist/components/feedback/Empty/Empty.theme.js +13 -0
- package/dist/components/feedback/Notification/Notification.js +41 -0
- package/dist/components/feedback/Notification/Notification.theme.js +49 -0
- package/dist/components/feedback/Spinner/Spinner.theme.js +3 -3
- package/dist/components/feedback/Toast/Toast.animations.js +58 -0
- package/dist/components/feedback/Toast/Toast.js +67 -0
- package/dist/components/feedback/Toast/Toast.theme.js +18 -0
- package/dist/components/feedback/Toast/ToastProvider.js +73 -0
- package/dist/components/feedback/Toast/useToast.js +91 -0
- package/dist/components/forms/Checkbox/Checkbox.theme.js +1 -1
- package/dist/components/forms/FormLabel/FormLabel.theme.js +2 -2
- package/dist/components/forms/Input/Input.theme.js +4 -4
- package/dist/components/forms/Radio/Radio.theme.js +2 -2
- package/dist/components/forms/Select/Select.js +1 -1
- package/dist/components/forms/Select/Select.theme.js +5 -5
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +19 -19
- package/dist/components/forms/forms.theme.js +8 -8
- package/dist/components/navigation/NavItem/NavItem.js +93 -0
- package/dist/components/navigation/NavItem/NavItem.theme.js +27 -0
- package/dist/components/navigation/Sidebar/Sidebar.js +28 -0
- package/dist/components/navigation/Sidebar/Sidebar.theme.js +16 -0
- package/dist/components/navigation/Sidebar/SidebarContent.js +12 -0
- package/dist/components/navigation/Sidebar/SidebarContext.js +38 -0
- package/dist/components/navigation/Sidebar/SidebarFooter.js +11 -0
- package/dist/components/navigation/Sidebar/SidebarHeader.js +22 -0
- package/dist/components/navigation/Sidebar/SidebarNav.js +11 -0
- package/dist/components/navigation/Sidebar/SidebarNavGroup.js +19 -0
- package/dist/components/navigation/Sidebar/SidebarToggle.js +26 -0
- package/dist/icons/core/TickIcon.js +3 -1
- package/dist/index.d.ts +29 -4
- package/dist/index.js +64 -4
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronDoubleLeftIcon.js +28 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronDoubleRightIcon.js +28 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronLeftIcon.js +28 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/Cog6ToothIcon.js +32 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentIcon.js +28 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/EllipsisVerticalIcon.js +28 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/PlusIcon.js +28 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/ArrowPathIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/BellIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/ExclamationTriangleIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/InformationCircleIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/XMarkIcon.js +26 -0
- package/dist/node_modules/tslib/tslib.es6.js +15 -1
- package/dist/utils/dateUtils.js +32 -0
- package/dist/utils/debounce.js +21 -0
- package/package.json +1 -1
- package/dist/styles.css +0 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import ForwardRef from '../../../node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js';
|
|
2
|
+
import ForwardRef$1 from '../../../node_modules/@heroicons/react/24/solid/esm/ExclamationTriangleIcon.js';
|
|
3
|
+
import ForwardRef$2 from '../../../node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js';
|
|
4
|
+
import ForwardRef$3 from '../../../node_modules/@heroicons/react/24/solid/esm/InformationCircleIcon.js';
|
|
5
|
+
import ForwardRef$4 from '../../../node_modules/@heroicons/react/24/solid/esm/BellIcon.js';
|
|
6
|
+
|
|
7
|
+
var notificationTheme = {
|
|
8
|
+
// Base container styles - layout and spacing only
|
|
9
|
+
baseStyle: 'relative flex items-start gap-4 rounded-xl border-t border-white px-6 py-4 shadow-md shadow-[var(--color-neutral-500)]/10 bg-white/80 backdrop-blur-sm ring-[1px] ring-offset-[0.5px] text-sm',
|
|
10
|
+
// Title typography only (color comes from variant)
|
|
11
|
+
titleStyle: 'font-semibold',
|
|
12
|
+
// Description text styles - stays neutral across all variants
|
|
13
|
+
descriptionStyle: 'text-text-secondary/90 mt-1',
|
|
14
|
+
// Comprehensive variant definitions
|
|
15
|
+
variants: {
|
|
16
|
+
default: {
|
|
17
|
+
containerStyle: 'bg-[var(--color-neutral-50)] ring-border',
|
|
18
|
+
iconColor: 'text-[var(--color-primary)]',
|
|
19
|
+
titleColor: 'text-text-primary',
|
|
20
|
+
defaultIcon: ForwardRef$4,
|
|
21
|
+
},
|
|
22
|
+
info: {
|
|
23
|
+
containerStyle: 'bg-[var(--color-primary-50)] ring-[var(--color-primary)]/10',
|
|
24
|
+
iconColor: 'text-[var(--color-primary)]',
|
|
25
|
+
titleColor: 'text-[var(--color-primary-700)]',
|
|
26
|
+
defaultIcon: ForwardRef$3,
|
|
27
|
+
},
|
|
28
|
+
success: {
|
|
29
|
+
containerStyle: 'bg-[var(--color-success-50)] ring-[var(--color-success)]/20',
|
|
30
|
+
iconColor: 'text-[var(--color-success)]',
|
|
31
|
+
titleColor: 'text-[var(--color-success-700)]',
|
|
32
|
+
defaultIcon: ForwardRef$2,
|
|
33
|
+
},
|
|
34
|
+
warning: {
|
|
35
|
+
containerStyle: 'bg-[var(--color-warning-50)] ring-[var(--color-warning)]/10',
|
|
36
|
+
iconColor: 'text-[var(--color-warning)]',
|
|
37
|
+
titleColor: 'text-[var(--color-warning-700)]',
|
|
38
|
+
defaultIcon: ForwardRef$1,
|
|
39
|
+
},
|
|
40
|
+
error: {
|
|
41
|
+
containerStyle: 'bg-[var(--color-danger-50)] ring-[var(--color-danger)]/10',
|
|
42
|
+
iconColor: 'text-[var(--color-danger)]',
|
|
43
|
+
titleColor: 'text-[var(--color-danger-700)]',
|
|
44
|
+
defaultIcon: ForwardRef,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { notificationTheme };
|
|
@@ -12,12 +12,12 @@ var spinnerTheme = {
|
|
|
12
12
|
},
|
|
13
13
|
// Color variants
|
|
14
14
|
colors: {
|
|
15
|
-
primary: "border-primary-600 border-t-transparent",
|
|
16
|
-
secondary: "border-neutral-400 border-t-transparent",
|
|
15
|
+
primary: "border-[var(--color-primary-600)] border-t-transparent",
|
|
16
|
+
secondary: "border-[var(--color-neutral-400)] border-t-transparent",
|
|
17
17
|
success: "border-green-500 border-t-transparent",
|
|
18
18
|
warning: "border-yellow-500 border-t-transparent",
|
|
19
19
|
error: "border-red-500 border-t-transparent",
|
|
20
|
-
neutral: "border-neutral-500 border-t-transparent",
|
|
20
|
+
neutral: "border-[var(--color-neutral-500)] border-t-transparent",
|
|
21
21
|
},
|
|
22
22
|
// Animation class with drop shadow
|
|
23
23
|
animation: "animate-[spin_1s_linear_infinite] rounded-full",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var toastAnimations = {
|
|
2
|
+
// Initial state when toast appears
|
|
3
|
+
initial: {
|
|
4
|
+
opacity: 0,
|
|
5
|
+
y: 50,
|
|
6
|
+
scale: 0.3,
|
|
7
|
+
},
|
|
8
|
+
// Exit animation when toast is dismissed
|
|
9
|
+
exit: {
|
|
10
|
+
opacity: 0,
|
|
11
|
+
scale: 0.5,
|
|
12
|
+
transition: { duration: 0.2 },
|
|
13
|
+
},
|
|
14
|
+
// Spring transition configuration
|
|
15
|
+
transition: {
|
|
16
|
+
type: "spring",
|
|
17
|
+
stiffness: 500,
|
|
18
|
+
damping: 30,
|
|
19
|
+
mass: 1,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
// Stacking animation utilities
|
|
23
|
+
var getToastStackingAnimation = function (index, totalToasts, isExpanded) {
|
|
24
|
+
if (totalToasts === 1)
|
|
25
|
+
return {};
|
|
26
|
+
var maxVisible = 3; // Show max 3 toasts in stack
|
|
27
|
+
var stackIndex = Math.min(index, maxVisible - 1);
|
|
28
|
+
if (isExpanded) {
|
|
29
|
+
// Expanded state - show all toasts with sufficient gap to prevent overlap
|
|
30
|
+
// Use a larger gap to accommodate variable heights
|
|
31
|
+
return {
|
|
32
|
+
y: index * 100, // 100px gap between toasts when expanded (increased from 80px)
|
|
33
|
+
scale: 1,
|
|
34
|
+
zIndex: totalToasts - index,
|
|
35
|
+
opacity: 1,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Stacked state - compress toasts
|
|
40
|
+
if (index >= maxVisible) {
|
|
41
|
+
// Show toasts beyond max visible but more compressed
|
|
42
|
+
return {
|
|
43
|
+
y: (maxVisible - 1) * 16,
|
|
44
|
+
scale: 1 - (maxVisible - 1) * 0.08,
|
|
45
|
+
zIndex: 0,
|
|
46
|
+
opacity: 0.3,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
y: stackIndex * 16, // 16px offset for each toast (increased from 12px)
|
|
51
|
+
scale: 1 - stackIndex * 0.08,
|
|
52
|
+
zIndex: totalToasts - index,
|
|
53
|
+
opacity: 1 - stackIndex * 0.25,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { getToastStackingAnimation, toastAnimations };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __rest } from '../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import React__default, { useEffect } from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { toastTheme } from './Toast.theme.js';
|
|
5
|
+
import { toastAnimations, getToastStackingAnimation } from './Toast.animations.js';
|
|
6
|
+
import ForwardRef from '../../../node_modules/@heroicons/react/24/solid/esm/ArrowPathIcon.js';
|
|
7
|
+
import ForwardRef$1 from '../../../node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js';
|
|
8
|
+
import ForwardRef$2 from '../../../node_modules/@heroicons/react/24/solid/esm/ExclamationTriangleIcon.js';
|
|
9
|
+
import ForwardRef$3 from '../../../node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js';
|
|
10
|
+
import ForwardRef$4 from '../../../node_modules/@heroicons/react/24/solid/esm/InformationCircleIcon.js';
|
|
11
|
+
import ForwardRef$5 from '../../../node_modules/@heroicons/react/24/solid/esm/XMarkIcon.js';
|
|
12
|
+
import { motion } from '../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js';
|
|
13
|
+
|
|
14
|
+
var variantIcons = {
|
|
15
|
+
info: ForwardRef$4,
|
|
16
|
+
success: ForwardRef$3,
|
|
17
|
+
warning: ForwardRef$2,
|
|
18
|
+
error: ForwardRef$1,
|
|
19
|
+
loading: ForwardRef,
|
|
20
|
+
};
|
|
21
|
+
var Toast = React__default.forwardRef(function (_a, ref) {
|
|
22
|
+
var _b, _c, _d, _e, _f;
|
|
23
|
+
var toast = _a.toast, className = _a.className; _a.theme; var onDismiss = _a.onDismiss, _h = _a.index, index = _h === void 0 ? 0 : _h, _j = _a.isExpanded, isExpanded = _j === void 0 ? false : _j, _k = _a.totalToasts, totalToasts = _k === void 0 ? 1 : _k, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave; __rest(_a, ["toast", "className", "theme", "onDismiss", "index", "isExpanded", "totalToasts", "onMouseEnter", "onMouseLeave"]);
|
|
24
|
+
var id = toast.id, _l = toast.variant, variant = _l === void 0 ? 'info' : _l, title = toast.title, description = toast.description, icon = toast.icon, action = toast.action, _m = toast.duration, duration = _m === void 0 ? 5000 : _m, _o = toast.dismissible, dismissible = _o === void 0 ? true : _o;
|
|
25
|
+
var IconComponent = variantIcons[variant];
|
|
26
|
+
// Auto-dismiss after duration
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
if (duration > 0 && dismissible) {
|
|
29
|
+
var timer_1 = setTimeout(function () {
|
|
30
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(id);
|
|
31
|
+
}, duration);
|
|
32
|
+
return function () { return clearTimeout(timer_1); };
|
|
33
|
+
}
|
|
34
|
+
}, [duration, dismissible, id, onDismiss]);
|
|
35
|
+
var handleDismiss = function () {
|
|
36
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(id);
|
|
37
|
+
};
|
|
38
|
+
var handleActionClick = function () {
|
|
39
|
+
action === null || action === void 0 ? void 0 : action.onClick();
|
|
40
|
+
if (dismissible) {
|
|
41
|
+
handleDismiss();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var stackingStyle = getToastStackingAnimation(index, totalToasts, isExpanded);
|
|
45
|
+
return (React__default.createElement(motion.div, { ref: ref, layout: true, initial: toastAnimations.initial, animate: {
|
|
46
|
+
opacity: (_b = stackingStyle.opacity) !== null && _b !== void 0 ? _b : 1,
|
|
47
|
+
y: (_c = stackingStyle.y) !== null && _c !== void 0 ? _c : 0,
|
|
48
|
+
scale: (_d = stackingStyle.scale) !== null && _d !== void 0 ? _d : 1,
|
|
49
|
+
zIndex: (_e = stackingStyle.zIndex) !== null && _e !== void 0 ? _e : 1
|
|
50
|
+
}, exit: toastAnimations.exit, transition: toastAnimations.transition, className: cn(toastTheme.baseStyle, toastTheme.variants[variant], 'pointer-events-auto', index > 0 && !isExpanded && 'absolute top-0 left-0', className), style: {
|
|
51
|
+
zIndex: (_f = stackingStyle.zIndex) !== null && _f !== void 0 ? _f : 1,
|
|
52
|
+
position: index > 0 ? 'absolute' : 'relative',
|
|
53
|
+
top: index > 0 ? 0 : undefined,
|
|
54
|
+
left: index > 0 ? 0 : undefined,
|
|
55
|
+
}, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, role: "alert", "aria-live": "polite" },
|
|
56
|
+
React__default.createElement("div", { className: toastTheme.iconStyle }, icon || React__default.createElement(IconComponent, { className: cn("w-5 h-5", variant === 'loading' && "animate-spin") })),
|
|
57
|
+
React__default.createElement("div", { className: "flex-1 min-w-0" },
|
|
58
|
+
title && (React__default.createElement("div", { className: toastTheme.titleStyle }, title)),
|
|
59
|
+
description && (React__default.createElement("div", { className: toastTheme.descriptionStyle }, description)),
|
|
60
|
+
action && (React__default.createElement("div", { className: "mt-2" },
|
|
61
|
+
React__default.createElement("button", { type: "button", className: toastTheme.actionStyle, onClick: handleActionClick }, action.label)))),
|
|
62
|
+
dismissible && (React__default.createElement("button", { type: "button", className: toastTheme.closeButtonStyle, onClick: handleDismiss, "aria-label": "Dismiss notification" },
|
|
63
|
+
React__default.createElement(ForwardRef$5, { className: "w-4 h-4" })))));
|
|
64
|
+
});
|
|
65
|
+
Toast.displayName = 'Toast';
|
|
66
|
+
|
|
67
|
+
export { Toast };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var toastTheme = {
|
|
2
|
+
baseStyle: 'flex items-start gap-3 rounded-2xl border-[2px] px-4 py-3 shadow-2xl backdrop-blur-sm min-w-80 max-w-md ring-[0.5px] ring-white',
|
|
3
|
+
variants: {
|
|
4
|
+
info: 'bg-sky-200/50 border-sky-200/40 text-sky-800 shadow-sky-600/20',
|
|
5
|
+
success: 'bg-[var(--color-success-100)]/50 border-[var(--color-success-200)]/40 text-[var(--color-success-800)] shadow-[var(--color-success-600)]/20',
|
|
6
|
+
warning: 'bg-[var(--color-warning-100)]/50 border-[var(--color-warning-200)]/40 text-[var(--color-warning-800)] shadow-[var(--color-warning-600)]/20',
|
|
7
|
+
error: 'bg-[var(--color-danger-100)]/50 border-[var(--color-danger-200)]/40 text-[var(--color-danger-800)] shadow-[var(--color-danger-600)]/20',
|
|
8
|
+
loading: 'bg-gray-100/50 border-[var(--color-neutral-200)]/40 text-text-primary',
|
|
9
|
+
},
|
|
10
|
+
iconStyle: 'flex-shrink-0 size-5 mt-0.5',
|
|
11
|
+
titleStyle: 'font-semibold text-sm',
|
|
12
|
+
descriptionStyle: 'text-sm mt-0.5 opacity-60',
|
|
13
|
+
actionStyle: 'text-xs font-medium px-2 py-1 rounded border bg-white/80 hover:bg-white transition-colors cursor-pointer',
|
|
14
|
+
closeButtonStyle: 'absolute top-2 right-2 flex-shrink-0 w-4 h-4 opacity-70 hover:opacity-100 transition-opacity cursor-pointer',
|
|
15
|
+
containerStyle: 'fixed z-50 pointer-events-none',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { toastTheme };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { __assign, __spreadArray } from '../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import React__default, { createContext, useState, useCallback, useContext } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { Toast } from './Toast.js';
|
|
5
|
+
import { toastTheme } from './Toast.theme.js';
|
|
6
|
+
import { cn } from '../../../utils/cn.js';
|
|
7
|
+
import { AnimatePresence } from '../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js';
|
|
8
|
+
|
|
9
|
+
var ToastContext = createContext(undefined);
|
|
10
|
+
var positionStyles = {
|
|
11
|
+
'top-left': 'top-4 left-4',
|
|
12
|
+
'top-center': 'top-4 left-1/2 -translate-x-1/2',
|
|
13
|
+
'top-right': 'top-4 right-4',
|
|
14
|
+
'bottom-left': 'bottom-4 left-4',
|
|
15
|
+
'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2',
|
|
16
|
+
'bottom-right': 'bottom-4 right-4',
|
|
17
|
+
};
|
|
18
|
+
var ToastProvider = function (_a) {
|
|
19
|
+
var children = _a.children, _b = _a.position, position = _b === void 0 ? 'top-right' : _b, _c = _a.maxToasts, maxToasts = _c === void 0 ? 5 : _c, _d = _a.defaultDuration, defaultDuration = _d === void 0 ? 5000 : _d;
|
|
20
|
+
var _e = useState([]), toasts = _e[0], setToasts = _e[1];
|
|
21
|
+
var _f = useState(false), isHovered = _f[0], setIsHovered = _f[1];
|
|
22
|
+
var hoverTimeoutRef = React__default.useRef(null);
|
|
23
|
+
var addToast = useCallback(function (toastData) {
|
|
24
|
+
var _a;
|
|
25
|
+
var id = Math.random().toString(36).substring(2, 9);
|
|
26
|
+
var newToast = __assign(__assign({}, toastData), { id: id, duration: (_a = toastData.duration) !== null && _a !== void 0 ? _a : defaultDuration });
|
|
27
|
+
setToasts(function (current) {
|
|
28
|
+
var updated = __spreadArray([newToast], current, true);
|
|
29
|
+
// Limit the number of toasts
|
|
30
|
+
return updated.slice(0, maxToasts);
|
|
31
|
+
});
|
|
32
|
+
return id;
|
|
33
|
+
}, [maxToasts, defaultDuration]);
|
|
34
|
+
var removeToast = useCallback(function (id) {
|
|
35
|
+
setToasts(function (current) { return current.filter(function (toast) { return toast.id !== id; }); });
|
|
36
|
+
}, []);
|
|
37
|
+
var removeAllToasts = useCallback(function () {
|
|
38
|
+
setToasts([]);
|
|
39
|
+
}, []);
|
|
40
|
+
var handleMouseEnter = useCallback(function () {
|
|
41
|
+
if (hoverTimeoutRef.current) {
|
|
42
|
+
clearTimeout(hoverTimeoutRef.current);
|
|
43
|
+
hoverTimeoutRef.current = null;
|
|
44
|
+
}
|
|
45
|
+
setIsHovered(true);
|
|
46
|
+
}, []);
|
|
47
|
+
var handleMouseLeave = useCallback(function () {
|
|
48
|
+
// Add a small delay before collapsing to prevent flickering
|
|
49
|
+
hoverTimeoutRef.current = setTimeout(function () {
|
|
50
|
+
setIsHovered(false);
|
|
51
|
+
}, 150);
|
|
52
|
+
}, []);
|
|
53
|
+
var contextValue = {
|
|
54
|
+
toasts: toasts,
|
|
55
|
+
addToast: addToast,
|
|
56
|
+
removeToast: removeToast,
|
|
57
|
+
removeAllToasts: removeAllToasts,
|
|
58
|
+
};
|
|
59
|
+
return (React__default.createElement(ToastContext.Provider, { value: contextValue },
|
|
60
|
+
children,
|
|
61
|
+
typeof window !== 'undefined' && createPortal(React__default.createElement("div", { className: cn(toastTheme.containerStyle, positionStyles[position]), "aria-live": "polite", "aria-label": "Notifications" },
|
|
62
|
+
React__default.createElement("div", { className: "relative", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
63
|
+
React__default.createElement(AnimatePresence, { mode: "popLayout" }, toasts.map(function (toast, index) { return (React__default.createElement(Toast, { key: toast.id, toast: toast, onDismiss: removeToast, index: index, isExpanded: isHovered, totalToasts: toasts.length, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave })); })))), document.body)));
|
|
64
|
+
};
|
|
65
|
+
var useToastContext = function () {
|
|
66
|
+
var context = useContext(ToastContext);
|
|
67
|
+
if (!context) {
|
|
68
|
+
throw new Error('useToastContext must be used within a ToastProvider');
|
|
69
|
+
}
|
|
70
|
+
return context;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { ToastProvider, useToastContext };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useToastContext } from './ToastProvider.js';
|
|
3
|
+
|
|
4
|
+
var useToast = function () {
|
|
5
|
+
var _a = useToastContext(), addToast = _a.addToast, removeToast = _a.removeToast, removeAllToasts = _a.removeAllToasts;
|
|
6
|
+
var toast = useCallback(function (title, options) {
|
|
7
|
+
return addToast({
|
|
8
|
+
title: title,
|
|
9
|
+
variant: (options === null || options === void 0 ? void 0 : options.variant) || 'info',
|
|
10
|
+
description: options === null || options === void 0 ? void 0 : options.description,
|
|
11
|
+
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
12
|
+
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
13
|
+
action: options === null || options === void 0 ? void 0 : options.action,
|
|
14
|
+
icon: options === null || options === void 0 ? void 0 : options.icon,
|
|
15
|
+
});
|
|
16
|
+
}, [addToast]);
|
|
17
|
+
var success = useCallback(function (title, options) {
|
|
18
|
+
return addToast({
|
|
19
|
+
title: title,
|
|
20
|
+
variant: 'success',
|
|
21
|
+
description: options === null || options === void 0 ? void 0 : options.description,
|
|
22
|
+
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
23
|
+
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
24
|
+
action: options === null || options === void 0 ? void 0 : options.action,
|
|
25
|
+
icon: options === null || options === void 0 ? void 0 : options.icon,
|
|
26
|
+
});
|
|
27
|
+
}, [addToast]);
|
|
28
|
+
var error = useCallback(function (title, options) {
|
|
29
|
+
return addToast({
|
|
30
|
+
title: title,
|
|
31
|
+
variant: 'error',
|
|
32
|
+
description: options === null || options === void 0 ? void 0 : options.description,
|
|
33
|
+
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
34
|
+
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
35
|
+
action: options === null || options === void 0 ? void 0 : options.action,
|
|
36
|
+
icon: options === null || options === void 0 ? void 0 : options.icon,
|
|
37
|
+
});
|
|
38
|
+
}, [addToast]);
|
|
39
|
+
var warning = useCallback(function (title, options) {
|
|
40
|
+
return addToast({
|
|
41
|
+
title: title,
|
|
42
|
+
variant: 'warning',
|
|
43
|
+
description: options === null || options === void 0 ? void 0 : options.description,
|
|
44
|
+
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
45
|
+
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
46
|
+
action: options === null || options === void 0 ? void 0 : options.action,
|
|
47
|
+
icon: options === null || options === void 0 ? void 0 : options.icon,
|
|
48
|
+
});
|
|
49
|
+
}, [addToast]);
|
|
50
|
+
var info = useCallback(function (title, options) {
|
|
51
|
+
return addToast({
|
|
52
|
+
title: title,
|
|
53
|
+
variant: 'info',
|
|
54
|
+
description: options === null || options === void 0 ? void 0 : options.description,
|
|
55
|
+
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
56
|
+
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
57
|
+
action: options === null || options === void 0 ? void 0 : options.action,
|
|
58
|
+
icon: options === null || options === void 0 ? void 0 : options.icon,
|
|
59
|
+
});
|
|
60
|
+
}, [addToast]);
|
|
61
|
+
var loading = useCallback(function (title, options) {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
return addToast({
|
|
64
|
+
title: title,
|
|
65
|
+
variant: 'loading',
|
|
66
|
+
description: options === null || options === void 0 ? void 0 : options.description,
|
|
67
|
+
duration: (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 0, // Loading toasts don't auto-dismiss by default
|
|
68
|
+
dismissible: (_b = options === null || options === void 0 ? void 0 : options.dismissible) !== null && _b !== void 0 ? _b : false, // Loading toasts are not dismissible by default
|
|
69
|
+
action: options === null || options === void 0 ? void 0 : options.action,
|
|
70
|
+
icon: options === null || options === void 0 ? void 0 : options.icon,
|
|
71
|
+
});
|
|
72
|
+
}, [addToast]);
|
|
73
|
+
var dismiss = useCallback(function (id) {
|
|
74
|
+
removeToast(id);
|
|
75
|
+
}, [removeToast]);
|
|
76
|
+
var dismissAll = useCallback(function () {
|
|
77
|
+
removeAllToasts();
|
|
78
|
+
}, [removeAllToasts]);
|
|
79
|
+
return {
|
|
80
|
+
toast: toast,
|
|
81
|
+
success: success,
|
|
82
|
+
error: error,
|
|
83
|
+
warning: warning,
|
|
84
|
+
info: info,
|
|
85
|
+
loading: loading,
|
|
86
|
+
dismiss: dismiss,
|
|
87
|
+
dismissAll: dismissAll,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export { useToast };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var checkboxTheme = {
|
|
5
5
|
baseStyle: "relative flex items-start gap-3",
|
|
6
6
|
inputContainerStyle: "relative flex-shrink-0 group grid grid-cols-1",
|
|
7
|
-
inputStyle: "col-start-1 row-start-1 appearance-none rounded-md border-2 border-gray-300 bg-white checked:border-primary
|
|
7
|
+
inputStyle: "col-start-1 row-start-1 appearance-none rounded-md border-2 border-gray-300 bg-white checked:border-[var(--color-primary)] checked:bg-[var(--color-primary)] disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-primary-600)] checked:outline-2 checked:outline-[var(--color-primary-100)] checked:outline-offset-1 transition-all duration-400 data-[state=disabled]:border-gray-300 data-[state=disabled]:bg-gray-100",
|
|
8
8
|
descriptionStyle: "text-base text-text-secondary mt-0.5",
|
|
9
9
|
sizes: {
|
|
10
10
|
sm: "size-5 mt-0.25",
|
|
@@ -8,10 +8,10 @@ var formLabelTheme = {
|
|
|
8
8
|
stateStyles: {
|
|
9
9
|
default: "text-text-primary",
|
|
10
10
|
disabled: "text-text-disabled",
|
|
11
|
-
invalid: "text-danger
|
|
11
|
+
invalid: "text-[var(--color-danger)]",
|
|
12
12
|
},
|
|
13
13
|
// Required indicator style
|
|
14
|
-
requiredIndicatorStyle: "text-danger
|
|
14
|
+
requiredIndicatorStyle: "text-[var(--color-danger)] ml-1",
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { formLabelTheme };
|
|
@@ -61,19 +61,19 @@ var inputTheme = {
|
|
|
61
61
|
strengthStyles: {
|
|
62
62
|
weak: {
|
|
63
63
|
label: "Weak",
|
|
64
|
-
color: "text-danger
|
|
64
|
+
color: "text-[var(--color-danger)]",
|
|
65
65
|
},
|
|
66
66
|
moderate: {
|
|
67
67
|
label: "Moderate",
|
|
68
|
-
color: "text-warning
|
|
68
|
+
color: "text-[var(--color-warning)]",
|
|
69
69
|
},
|
|
70
70
|
strong: {
|
|
71
71
|
label: "Strong",
|
|
72
|
-
color: "text-success
|
|
72
|
+
color: "text-[var(--color-success)]",
|
|
73
73
|
},
|
|
74
74
|
"very-strong": {
|
|
75
75
|
label: "Very Strong",
|
|
76
|
-
color: "text-success
|
|
76
|
+
color: "text-[var(--color-success)]",
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
},
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var radioTheme = {
|
|
5
5
|
baseStyle: "relative flex items-start gap-3",
|
|
6
6
|
inputContainerStyle: "relative flex-shrink-0 flex items-center justify-center",
|
|
7
|
-
inputStyle: "appearance-none rounded-full border-2 border-gray-300 bg-white checked:border-primary
|
|
8
|
-
dotStyle: "absolute pointer-events-none rounded-full bg-primary
|
|
7
|
+
inputStyle: "appearance-none rounded-full border-2 border-gray-300 bg-white checked:border-[var(--color-primary)] checked:bg-white disabled:border-gray-300 disabled:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-primary-600)] checked:outline-2 checked:outline-[var(--color-primary-100)] checked:outline-offset-1 transition-all duration-400 data-[state=disabled]:border-gray-300 data-[state=disabled]:bg-gray-100",
|
|
8
|
+
dotStyle: "absolute pointer-events-none rounded-full bg-[var(--color-primary)] opacity-0 transition-all duration-400",
|
|
9
9
|
descriptionStyle: "text-sm text-text-secondary mt-1",
|
|
10
10
|
sizes: {
|
|
11
11
|
sm: "size-5 mt-0.25",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from '../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import React__default, { createContext,
|
|
2
|
+
import React__default, { createContext, useState, useRef, useEffect, useContext } from 'react';
|
|
3
3
|
import { selectTheme } from './Select.theme.js';
|
|
4
4
|
import { FormLabel } from '../FormLabel/FormLabel.js';
|
|
5
5
|
import { Input } from '../Input/Input.js';
|
|
@@ -26,15 +26,15 @@ var selectTheme = {
|
|
|
26
26
|
// Hover state variants - inherited from common form theme
|
|
27
27
|
hoverStates: formsBaseTheme.hoverStates,
|
|
28
28
|
// Options container style
|
|
29
|
-
optionsContainerStyle: "absolute z-10 mt-1.5 w-full min-w-[14rem] max-h-60 overflow-auto rounded-[var(--form-rounded)] bg-white py-0 text-sm shadow-xl ring-1 ring-slate-200 focus:outline-none scrollbar-thin scrollbar-thumb-neutral-300 scrollbar-track-neutral-100",
|
|
29
|
+
optionsContainerStyle: "absolute z-10 mt-1.5 w-full min-w-[14rem] max-h-60 overflow-auto rounded-[var(--form-rounded)] bg-white py-0 text-sm shadow-xl ring-1 ring-slate-200 focus:outline-none scrollbar-thin scrollbar-thumb-[var(--color-neutral-300)] scrollbar-track-[var(--color-neutral-100)]",
|
|
30
30
|
// Search input style
|
|
31
31
|
searchInputStyle: "group",
|
|
32
32
|
// Individual option style
|
|
33
|
-
optionStyle: "relative cursor-pointer select-none py-2 px-3 text-neutral-900 hover:text-primary
|
|
33
|
+
optionStyle: "relative cursor-pointer select-none py-2 px-3 text-[var(--color-neutral-900)] hover:text-[var(--color-primary)] hover:bg-[var(--color-primary-50)]/50",
|
|
34
34
|
// Selected option style
|
|
35
|
-
selectedOptionStyle: "font-medium text-primary
|
|
35
|
+
selectedOptionStyle: "font-medium text-[var(--color-primary)]",
|
|
36
36
|
// Disabled option style
|
|
37
|
-
disabledOptionStyle: "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-neutral-900",
|
|
37
|
+
disabledOptionStyle: "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--color-neutral-900)]",
|
|
38
38
|
// Helper text style - inherited from common form theme
|
|
39
39
|
helperTextStyle: formsBaseTheme.helperText,
|
|
40
40
|
// Helper text state variants
|
|
@@ -47,7 +47,7 @@ var selectTheme = {
|
|
|
47
47
|
// Right icon style - inherited from common form theme
|
|
48
48
|
rightIconStyle: formsBaseTheme.iconStyles.right,
|
|
49
49
|
// Check icon style for selected options
|
|
50
|
-
checkIconStyle: "absolute inset-y-0 right-0 flex items-center pr-3 text-primary-600",
|
|
50
|
+
checkIconStyle: "absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--color-primary-600)]",
|
|
51
51
|
// Icon padding styles - inherited from common form theme
|
|
52
52
|
iconPadding: formsBaseTheme.iconStyles.padding,
|
|
53
53
|
};
|
|
@@ -8,7 +8,7 @@ var switchTheme = {
|
|
|
8
8
|
container: "items-start",
|
|
9
9
|
track: {
|
|
10
10
|
base: "w-10 h-6 rounded-full transition-colors cursor-pointer shadow-inner",
|
|
11
|
-
checked: "bg-primary-600",
|
|
11
|
+
checked: "bg-[var(--color-primary-600)]",
|
|
12
12
|
unchecked: "bg-slate-200",
|
|
13
13
|
disabled: "opacity-50 cursor-not-allowed"
|
|
14
14
|
},
|
|
@@ -10,20 +10,20 @@ var timePickerTheme = {
|
|
|
10
10
|
// Input field styles - following Input component pattern
|
|
11
11
|
inputStyle: [
|
|
12
12
|
// Base styles
|
|
13
|
-
"w-full border border-neutral-300 rounded-[var(--form-rounded)]",
|
|
14
|
-
"bg-white text-neutral-900 placeholder:text-neutral-500",
|
|
13
|
+
"w-full border border-[var(--color-neutral-300)] rounded-[var(--form-rounded)]",
|
|
14
|
+
"bg-white text-[var(--color-neutral-900)] placeholder:text-[var(--color-neutral-500)]",
|
|
15
15
|
"font-medium transition-colors duration-200",
|
|
16
|
-
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500",
|
|
16
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--color-primary-500)]/20 focus:border-[var(--color-primary-500)]",
|
|
17
17
|
// Cursor and interaction
|
|
18
18
|
"cursor-pointer select-none",
|
|
19
19
|
// Disabled state
|
|
20
|
-
"disabled:bg-neutral-50 disabled:text-neutral-400 disabled:cursor-not-allowed",
|
|
21
|
-
"disabled:border-neutral-200"
|
|
20
|
+
"disabled:bg-[var(--color-neutral-50)] disabled:text-[var(--color-neutral-400)] disabled:cursor-not-allowed",
|
|
21
|
+
"disabled:border-[var(--color-neutral-200)]"
|
|
22
22
|
].join(" "),
|
|
23
23
|
// Dropdown container styles
|
|
24
24
|
dropdownStyle: [
|
|
25
25
|
// Base container
|
|
26
|
-
"absolute z-50 mt-2 bg-white border border-neutral-200",
|
|
26
|
+
"absolute z-50 mt-2 bg-white border border-[var(--color-neutral-200)]",
|
|
27
27
|
"rounded-[var(--form-rounded)] shadow-lg",
|
|
28
28
|
// Animation and interaction
|
|
29
29
|
"animate-in fade-in-0 zoom-in-95 duration-200",
|
|
@@ -32,7 +32,7 @@ var timePickerTheme = {
|
|
|
32
32
|
].join(" "),
|
|
33
33
|
// Time selector container
|
|
34
34
|
selectorContainerStyle: [
|
|
35
|
-
"flex divide-x divide-neutral-200",
|
|
35
|
+
"flex divide-x divide-[var(--color-neutral-200)]",
|
|
36
36
|
"h-48 overflow-hidden"
|
|
37
37
|
].join(" "),
|
|
38
38
|
// Individual selector column
|
|
@@ -43,31 +43,31 @@ var timePickerTheme = {
|
|
|
43
43
|
// Time selector items
|
|
44
44
|
selectorItemStyle: [
|
|
45
45
|
"flex items-center justify-center py-2 px-3",
|
|
46
|
-
"text-sm font-medium text-neutral-700",
|
|
47
|
-
"hover:bg-neutral-50 cursor-pointer transition-colors",
|
|
48
|
-
"border-b border-neutral-100 last:border-b-0",
|
|
46
|
+
"text-sm font-medium text-[var(--color-neutral-700)]",
|
|
47
|
+
"hover:bg-[var(--color-neutral-50)] cursor-pointer transition-colors",
|
|
48
|
+
"border-b border-[var(--color-neutral-100)] last:border-b-0",
|
|
49
49
|
"min-h-[2.5rem]"
|
|
50
50
|
].join(" "),
|
|
51
51
|
// Selected item styles
|
|
52
52
|
selectedItemStyle: [
|
|
53
|
-
"bg-primary-50 text-primary-700 font-semibold",
|
|
54
|
-
"border-l-2 border-l-primary-500"
|
|
53
|
+
"bg-[var(--color-primary-50)] text-[var(--color-primary-700)] font-semibold",
|
|
54
|
+
"border-l-2 border-l-[var(--color-primary-500)]"
|
|
55
55
|
].join(" "),
|
|
56
56
|
// Disabled item styles
|
|
57
57
|
disabledItemStyle: [
|
|
58
|
-
"text-neutral-300 cursor-not-allowed",
|
|
58
|
+
"text-[var(--color-neutral-300)] cursor-not-allowed",
|
|
59
59
|
"hover:bg-transparent"
|
|
60
60
|
].join(" "),
|
|
61
61
|
// Clear button styles
|
|
62
62
|
clearButtonStyle: [
|
|
63
63
|
"absolute right-8 top-1/2 -translate-y-1/2",
|
|
64
|
-
"p-1 rounded text-neutral-400 hover:text-neutral-600",
|
|
65
|
-
"hover:bg-neutral-100 transition-colors"
|
|
64
|
+
"p-1 rounded text-[var(--color-neutral-400)] hover:text-[var(--color-neutral-600)]",
|
|
65
|
+
"hover:bg-[var(--color-neutral-100)] transition-colors"
|
|
66
66
|
].join(" "),
|
|
67
67
|
// Trigger icon styles
|
|
68
68
|
triggerIconStyle: [
|
|
69
69
|
"absolute right-3 top-1/2 -translate-y-1/2",
|
|
70
|
-
"text-neutral-400 pointer-events-none"
|
|
70
|
+
"text-[var(--color-neutral-400)] pointer-events-none"
|
|
71
71
|
].join(" "),
|
|
72
72
|
// Size variants
|
|
73
73
|
sizes: {
|
|
@@ -90,12 +90,12 @@ var timePickerTheme = {
|
|
|
90
90
|
// State variants
|
|
91
91
|
states: {
|
|
92
92
|
default: {
|
|
93
|
-
inputStyle: "border-neutral-300 focus:border-primary-500 focus:ring-primary-500/20",
|
|
94
|
-
dropdownStyle: "border-neutral-200"
|
|
93
|
+
inputStyle: "border-[var(--color-neutral-300)] focus:border-[var(--color-primary-500)] focus:ring-[var(--color-primary-500)]/20",
|
|
94
|
+
dropdownStyle: "border-[var(--color-neutral-200)]"
|
|
95
95
|
},
|
|
96
96
|
disabled: {
|
|
97
97
|
inputStyle: [
|
|
98
|
-
"bg-neutral-50 border-neutral-200 text-neutral-400",
|
|
98
|
+
"bg-[var(--color-neutral-50)] border-[var(--color-neutral-200)] text-[var(--color-neutral-400)]",
|
|
99
99
|
"cursor-not-allowed"
|
|
100
100
|
].join(" "),
|
|
101
101
|
dropdownStyle: "opacity-50 pointer-events-none"
|
|
@@ -8,7 +8,7 @@ var formsBaseTheme = {
|
|
|
8
8
|
// Common wrapper style
|
|
9
9
|
wrapperStyle: "relative w-full",
|
|
10
10
|
// Common input group style with focus, hover, and state variations
|
|
11
|
-
inputGroupBaseStyle: "relative flex rounded-[var(--form-rounded)] outline outline-1 outline-gray-300 focus-within:outline-2 focus-within:outline-primary-600 focus-within:-outline-offset-1 focus-within:ring-4 focus-within:ring-primary
|
|
11
|
+
inputGroupBaseStyle: "relative flex rounded-[var(--form-rounded)] outline outline-1 outline-gray-300 focus-within:outline-2 focus-within:outline-[var(--color-primary-600)] focus-within:-outline-offset-1 focus-within:ring-4 focus-within:ring-[var(--color-primary)]/10 bg-white transition-all",
|
|
12
12
|
// Common base input/control style
|
|
13
13
|
controlBaseStyle: "w-full bg-transparent text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none",
|
|
14
14
|
// Size variants - consistent across all form components
|
|
@@ -30,14 +30,14 @@ var formsBaseTheme = {
|
|
|
30
30
|
// Common state variants
|
|
31
31
|
states: {
|
|
32
32
|
default: "",
|
|
33
|
-
disabled: "cursor-not-allowed bg-neutral-200 outline-neutral-200 [&_input]:text-gray-500 [&_textarea]:text-gray-500 [&_select]:text-gray-500 [&_input]:cursor-not-allowed [&_textarea]:cursor-not-allowed [&_select]:cursor-not-allowed [&_input]:placeholder:text-gray-400 [&_textarea]:placeholder:text-gray-400 [&_select]:placeholder:text-gray-400 [&_button]:cursor-not-allowed",
|
|
34
|
-
invalid: "outline-danger-500 bg-danger-50 focus-within:outline-danger-500",
|
|
33
|
+
disabled: "cursor-not-allowed bg-[var(--color-neutral-200)] outline-[var(--color-neutral-200)] [&_input]:text-gray-500 [&_textarea]:text-gray-500 [&_select]:text-gray-500 [&_input]:cursor-not-allowed [&_textarea]:cursor-not-allowed [&_select]:cursor-not-allowed [&_input]:placeholder:text-gray-400 [&_textarea]:placeholder:text-gray-400 [&_select]:placeholder:text-gray-400 [&_button]:cursor-not-allowed",
|
|
34
|
+
invalid: "outline-[var(--color-danger-500)] bg-[var(--color-danger-50)] focus-within:outline-[var(--color-danger-500)]",
|
|
35
35
|
},
|
|
36
36
|
// Common focus state variants
|
|
37
37
|
focusStates: {
|
|
38
|
-
default: "outline-2 outline-primary-600 -outline-offset-1 ring-4 ring-primary
|
|
38
|
+
default: "outline-2 outline-[var(--color-primary-600)] -outline-offset-1 ring-4 ring-[var(--color-primary)]/10",
|
|
39
39
|
disabled: "outline-none",
|
|
40
|
-
invalid: "outline-2 outline-danger-500 -outline-offset-1 ring-4 ring-danger-500/10",
|
|
40
|
+
invalid: "outline-2 outline-[var(--color-danger-500)] -outline-offset-1 ring-4 ring-[var(--color-danger-500)]/10",
|
|
41
41
|
},
|
|
42
42
|
// Common hover state variants
|
|
43
43
|
hoverStates: {
|
|
@@ -46,11 +46,11 @@ var formsBaseTheme = {
|
|
|
46
46
|
invalid: "",
|
|
47
47
|
},
|
|
48
48
|
// Common helper text style with state variations
|
|
49
|
-
helperText: "text-xs text-gray-500 mt-1.5 [.state-disabled_&]:text-gray-400 [.state-invalid_&]:text-danger-500",
|
|
49
|
+
helperText: "text-xs text-gray-500 mt-1.5 [.state-disabled_&]:text-gray-400 [.state-invalid_&]:text-[var(--color-danger-500)]",
|
|
50
50
|
// Common icon styles
|
|
51
51
|
iconStyles: {
|
|
52
|
-
left: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-neutral-500",
|
|
53
|
-
right: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-neutral-500",
|
|
52
|
+
left: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-[var(--color-neutral-500)]",
|
|
53
|
+
right: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-[var(--color-neutral-500)]",
|
|
54
54
|
padding: {
|
|
55
55
|
left: "pl-10",
|
|
56
56
|
right: "pr-10",
|