@flikk/ui 1.0.0-beta.10 → 1.0.0-beta.12
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 +2 -1
- package/dist/components/ai/MessageHistory/MessageHistory.js +1 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +1 -0
- package/dist/components/ai/index.js +1 -0
- package/dist/components/core/Accordion/Accordion.animations.d.ts +6 -1
- package/dist/components/core/Accordion/Accordion.animations.js +15 -1
- package/dist/components/core/Accordion/Accordion.d.ts +1 -1
- package/dist/components/core/Accordion/Accordion.js +2 -2
- package/dist/components/core/Accordion/Accordion.theme.d.ts +2 -2
- package/dist/components/core/Accordion/Accordion.theme.js +6 -6
- package/dist/components/core/Accordion/Accordion.types.d.ts +34 -4
- package/dist/components/core/Accordion/AccordionBody.d.ts +3 -0
- package/dist/components/core/Accordion/{AccordionContent.js → AccordionBody.js} +4 -4
- package/dist/components/core/Accordion/AccordionItem.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +20 -6
- package/dist/components/core/Accordion/index.d.ts +2 -2
- package/dist/components/core/Alert/Alert.js +5 -1
- package/dist/components/core/Alert/Alert.types.d.ts +3 -3
- package/dist/components/core/Badge/Badge.theme.js +2 -2
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +7 -3
- package/dist/components/core/Breadcrumbs/Breadcrumbs.types.d.ts +1 -1
- package/dist/components/core/Button/Button.js +22 -25
- package/dist/components/core/Button/Button.ripple.d.ts +5 -1
- package/dist/components/core/Button/Button.ripple.js +27 -17
- package/dist/components/core/Button/Button.theme.d.ts +1 -2
- package/dist/components/core/Button/Button.theme.js +7 -7
- package/dist/components/core/Button/index.d.ts +2 -0
- package/dist/components/core/Calendar/Calendar.js +3 -3
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +3 -3
- package/dist/components/core/Card/Card.theme.js +6 -6
- package/dist/components/core/Card/Card.types.d.ts +8 -13
- package/dist/components/core/Card/CardBody.d.ts +3 -0
- package/dist/components/core/Card/CardBody.js +11 -0
- package/dist/components/core/Card/CardSubtitle.d.ts +1 -1
- package/dist/components/core/Card/CardTitle.d.ts +1 -1
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/Carousel/Carousel.js +4 -4
- package/dist/components/core/Carousel/Carousel.types.d.ts +4 -4
- package/dist/components/core/Carousel/CarouselBody.d.ts +4 -0
- package/dist/components/core/Carousel/{CarouselContent.js → CarouselBody.js} +3 -3
- package/dist/components/core/Carousel/index.d.ts +2 -1
- package/dist/components/core/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.js +6 -6
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenuBody.d.ts +6 -0
- package/dist/components/core/ContextMenu/{ContextMenuContent.js → ContextMenuBody.js} +4 -4
- package/dist/components/core/ContextMenu/ContextMenuSubBody.d.ts +6 -0
- package/dist/components/core/ContextMenu/{ContextMenuSubContent.js → ContextMenuSubBody.js} +4 -4
- package/dist/components/core/ContextMenu/index.d.ts +1 -1
- package/dist/components/core/Drawer/Drawer.d.ts +2 -2
- package/dist/components/core/Drawer/Drawer.js +28 -9
- package/dist/components/core/Drawer/Drawer.theme.d.ts +2 -0
- package/dist/components/core/Drawer/Drawer.theme.js +12 -10
- package/dist/components/core/Drawer/Drawer.types.d.ts +8 -6
- package/dist/components/core/Drawer/DrawerBody.d.ts +5 -0
- package/dist/components/core/Drawer/{DrawerContent.js → DrawerBody.js} +3 -3
- package/dist/components/core/Drawer/DrawerHeader.js +1 -0
- package/dist/components/core/Drawer/DrawerTitle.js +1 -1
- package/dist/components/core/Drawer/index.d.ts +2 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +3 -3
- package/dist/components/core/Dropdown/DropdownSection.js +3 -1
- package/dist/components/core/MenuItem/MenuItem.js +3 -1
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +1 -1
- package/dist/components/core/Message/Message.js +2 -2
- package/dist/components/core/Message/Message.types.d.ts +1 -1
- package/dist/components/core/Message/MessageBody.d.ts +8 -0
- package/dist/components/core/Message/{MessageContent.js → MessageBody.js} +3 -3
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.js +5 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/Modal.types.d.ts +5 -2
- package/dist/components/core/Modal/ModalHeader.js +1 -0
- package/dist/components/core/ModalStack/ModalStackModal.js +1 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +3 -1
- package/dist/components/core/Popover/Popover.d.ts +1 -1
- package/dist/components/core/Popover/Popover.js +4 -4
- package/dist/components/core/Popover/Popover.theme.d.ts +1 -1
- package/dist/components/core/Popover/Popover.theme.js +2 -2
- package/dist/components/core/Popover/Popover.types.d.ts +3 -3
- package/dist/components/core/Popover/PopoverBody.d.ts +7 -0
- package/dist/components/core/Popover/{PopoverContent.js → PopoverBody.js} +5 -5
- package/dist/components/core/Popover/index.d.ts +4 -3
- package/dist/components/core/Tabs/Tabs.animations.d.ts +2 -2
- package/dist/components/core/Tabs/Tabs.animations.js +3 -3
- package/dist/components/core/Tabs/Tabs.d.ts +1 -1
- package/dist/components/core/Tabs/Tabs.js +3 -3
- package/dist/components/core/Tabs/Tabs.theme.d.ts +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tabs/Tabs.types.d.ts +9 -9
- package/dist/components/core/Tabs/TabsBody.d.ts +6 -0
- package/dist/components/core/Tabs/{TabsContent.js → TabsBody.js} +8 -8
- package/dist/components/core/Tabs/index.d.ts +2 -2
- package/dist/components/core/Toast/Toast.js +5 -1
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/index.js +7 -2
- package/dist/components/data-display/Feed/Feed.js +10 -2
- package/dist/components/data-display/Feed/Feed.types.d.ts +4 -4
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +1 -0
- package/dist/components/data-display/KPI/KPI.js +2 -2
- package/dist/components/data-display/KPI/KPI.types.d.ts +3 -3
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.types.d.ts +3 -3
- package/dist/components/data-display/Table/TableColumnManager.js +3 -1
- package/dist/components/data-display/Table/TableFilter.js +2 -1
- package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
- package/dist/components/forms/Checkbox/Checkbox.js +1 -1
- package/dist/components/forms/Checkbox/Checkbox.types.d.ts +5 -5
- package/dist/components/forms/Checkbox/CheckboxGroup.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPicker.types.d.ts +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerBody.d.ts +7 -0
- package/dist/components/forms/ColorPicker/{ColorPickerContent.js → ColorPickerBody.js} +5 -5
- package/dist/components/forms/ColorPicker/index.d.ts +2 -2
- package/dist/components/forms/DatePicker/DatePicker.d.ts +7 -3
- package/dist/components/forms/DatePicker/DatePicker.js +6 -5
- package/dist/components/forms/DatePicker/DatePicker.theme.js +3 -3
- package/dist/components/forms/DatePicker/DatePicker.types.d.ts +9 -4
- package/dist/components/forms/DatePicker/DatePickerBody.d.ts +7 -0
- package/dist/components/forms/DatePicker/{DatePickerContent.js → DatePickerBody.js} +10 -9
- package/dist/components/forms/DatePicker/index.d.ts +2 -2
- package/dist/components/forms/Input/Input.js +2 -2
- package/dist/components/forms/Input/Input.types.d.ts +4 -4
- package/dist/components/forms/Radio/Radio.js +1 -1
- package/dist/components/forms/Radio/Radio.types.d.ts +5 -5
- package/dist/components/forms/Radio/RadioGroup.js +1 -1
- package/dist/components/forms/Select/Select.js +2 -2
- package/dist/components/forms/Select/Select.types.d.ts +4 -4
- package/dist/components/forms/Switch/Switch.js +1 -1
- package/dist/components/forms/Switch/Switch.types.d.ts +4 -4
- package/dist/components/forms/Textarea/Textarea.js +2 -2
- package/dist/components/forms/Textarea/Textarea.types.d.ts +4 -4
- package/dist/components/forms/index.d.ts +2 -2
- package/dist/components/forms/index.js +2 -2
- package/dist/components/layout/FormLayout/FormLayout.d.ts +0 -2
- package/dist/components/layout/FormLayout/FormLayout.js +12 -6
- package/dist/components/layout/FormLayout/FormLayout.theme.js +2 -5
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +8 -26
- package/dist/components/layout/FormLayout/FormLayoutSection.js +3 -2
- package/dist/components/layout/FormLayout/index.d.ts +1 -1
- package/dist/index.js +9 -4
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/global.scss +1 -1
- package/dist/components/core/Accordion/AccordionContent.d.ts +0 -3
- package/dist/components/core/Button/Button.animations.d.ts +0 -5
- package/dist/components/core/Card/CardContent.d.ts +0 -3
- package/dist/components/core/Card/CardContent.js +0 -11
- package/dist/components/core/Carousel/CarouselContent.d.ts +0 -4
- package/dist/components/core/ContextMenu/ContextMenuContent.d.ts +0 -6
- package/dist/components/core/ContextMenu/ContextMenuSubContent.d.ts +0 -6
- package/dist/components/core/Drawer/DrawerContent.d.ts +0 -5
- package/dist/components/core/Message/MessageContent.d.ts +0 -8
- package/dist/components/core/Popover/PopoverContent.d.ts +0 -7
- package/dist/components/core/Tabs/TabsContent.d.ts +0 -6
- package/dist/components/forms/ColorPicker/ColorPickerContent.d.ts +0 -7
- package/dist/components/forms/DatePicker/DatePickerContent.d.ts +0 -7
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +0 -3
- package/dist/components/layout/FormLayout/FormLayoutBody.js +0 -13
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +0 -3
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +0 -12
|
@@ -45,10 +45,10 @@ const getUnderlineTransition = (shouldReduceMotion) => {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
* Get
|
|
48
|
+
* Get TabsBody animation variants for directional fade animations
|
|
49
49
|
* Provides smooth fade-in from bottom and fade-out to top transitions
|
|
50
50
|
*/
|
|
51
|
-
const
|
|
51
|
+
const getTabsBodyVariants = (shouldReduceMotion) => {
|
|
52
52
|
if (shouldReduceMotion !== null && shouldReduceMotion !== void 0 ? shouldReduceMotion : false) {
|
|
53
53
|
// Reduced motion: no animation variants
|
|
54
54
|
return undefined;
|
|
@@ -81,4 +81,4 @@ const getTabsContentVariants = (shouldReduceMotion) => {
|
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
export {
|
|
84
|
+
export { getTabsBodyVariants, getTabsTriggerVariants, getUnderlineTransition };
|
|
@@ -3,5 +3,5 @@ import { TabsProps } from "./Tabs.types";
|
|
|
3
3
|
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
4
|
List: React.ForwardRefExoticComponent<import("./Tabs.types").TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
Trigger: React.ForwardRefExoticComponent<import("./Tabs.types").TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
|
|
6
|
+
Body: React.ForwardRefExoticComponent<import("./Tabs.types").TabsBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
};
|
|
@@ -5,11 +5,11 @@ import { tabsTheme } from './Tabs.theme.js';
|
|
|
5
5
|
import { TabsContext } from './TabsContext.js';
|
|
6
6
|
import { TabsList } from './TabsList.js';
|
|
7
7
|
import { TabsTrigger } from './TabsTrigger.js';
|
|
8
|
-
import {
|
|
8
|
+
import { TabsBody } from './TabsBody.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Tabs component for organizing content into separate views
|
|
12
|
-
* Uses compound component pattern with Tabs.List, Tabs.Trigger, and Tabs.
|
|
12
|
+
* Uses compound component pattern with Tabs.List, Tabs.Trigger, and Tabs.Body
|
|
13
13
|
* Supports optional Framer Motion animations and comprehensive accessibility
|
|
14
14
|
*/
|
|
15
15
|
const TabsComponent = React__default.forwardRef(({ value, defaultValue, onValueChange, orientation = "horizontal", size = "md", disabled = false, children, className, darkMode = false, ...props }, ref) => {
|
|
@@ -84,7 +84,7 @@ TabsComponent.displayName = "Tabs";
|
|
|
84
84
|
const Tabs = Object.assign(TabsComponent, {
|
|
85
85
|
List: TabsList,
|
|
86
86
|
Trigger: TabsTrigger,
|
|
87
|
-
|
|
87
|
+
Body: TabsBody,
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
export { Tabs };
|
|
@@ -13,8 +13,8 @@ const tabsTheme = {
|
|
|
13
13
|
sm: "px-2 py-1.5 text-base gap-1",
|
|
14
14
|
md: "px-2 py-2 text-base gap-1",
|
|
15
15
|
},
|
|
16
|
-
//
|
|
17
|
-
|
|
16
|
+
// TabsBody styles with proper CSS variables
|
|
17
|
+
bodyStyle: "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2",
|
|
18
18
|
// Sliding underline styles
|
|
19
19
|
underlineStyle: "absolute bottom-0 h-0.5 bg-[var(--color-primary)] transition-none",
|
|
20
20
|
};
|
|
@@ -23,8 +23,8 @@ export type TabsOrientation = "horizontal";
|
|
|
23
23
|
* <Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
|
|
24
24
|
* <Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
|
|
25
25
|
* </Tabs.List>
|
|
26
|
-
* <Tabs.
|
|
27
|
-
* <Tabs.
|
|
26
|
+
* <Tabs.Body value="tab1">Content 1</Tabs.Body>
|
|
27
|
+
* <Tabs.Body value="tab2">Content 2</Tabs.Body>
|
|
28
28
|
* </Tabs>
|
|
29
29
|
*
|
|
30
30
|
* // Uncontrolled mode
|
|
@@ -46,7 +46,7 @@ export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
46
46
|
size?: TabsSize;
|
|
47
47
|
/** Whether all tabs are disabled - individual triggers can also be disabled */
|
|
48
48
|
disabled?: boolean;
|
|
49
|
-
/** Children components - typically Tabs.List and Tabs.
|
|
49
|
+
/** Children components - typically Tabs.List and Tabs.Body components */
|
|
50
50
|
children?: React.ReactNode;
|
|
51
51
|
/**
|
|
52
52
|
* Force dark mode styling for the component. Use when placing the component
|
|
@@ -98,20 +98,20 @@ export interface TabsTriggerProps extends React.HTMLAttributes<HTMLButtonElement
|
|
|
98
98
|
'aria-label'?: string;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* TabsBody component props - content panel for each tab
|
|
102
102
|
* @example
|
|
103
103
|
* ```tsx
|
|
104
|
-
* <Tabs.
|
|
104
|
+
* <Tabs.Body value="profile">
|
|
105
105
|
* <UserProfile data={profileData} />
|
|
106
|
-
* </Tabs.
|
|
106
|
+
* </Tabs.Body>
|
|
107
107
|
*
|
|
108
108
|
* // Force mount content for performance or state preservation
|
|
109
|
-
* <Tabs.
|
|
109
|
+
* <Tabs.Body value="settings" forceMount>
|
|
110
110
|
* <SettingsForm /> // Form state preserved when tab is inactive
|
|
111
|
-
* </Tabs.
|
|
111
|
+
* </Tabs.Body>
|
|
112
112
|
* ```
|
|
113
113
|
*/
|
|
114
|
-
export interface
|
|
114
|
+
export interface TabsBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
115
115
|
/** The value that corresponds to a TabsTrigger value - determines when content is shown */
|
|
116
116
|
value: string;
|
|
117
117
|
/** Whether to keep content mounted in DOM when inactive (useful for preserving form state) */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabsBodyProps } from "./Tabs.types";
|
|
3
|
+
/**
|
|
4
|
+
* TabsBody component displays content panels for tabs with directional fade animations
|
|
5
|
+
*/
|
|
6
|
+
export declare const TabsBody: React.ForwardRefExoticComponent<TabsBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -4,12 +4,12 @@ import { useReducedMotion, motion, AnimatePresence } from 'motion/react';
|
|
|
4
4
|
import { cn } from '../../../utils/cn.js';
|
|
5
5
|
import { tabsTheme } from './Tabs.theme.js';
|
|
6
6
|
import { useTabsContext } from './TabsContext.js';
|
|
7
|
-
import {
|
|
7
|
+
import { getTabsBodyVariants } from './Tabs.animations.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* TabsBody component displays content panels for tabs with directional fade animations
|
|
11
11
|
*/
|
|
12
|
-
const
|
|
12
|
+
const TabsBody = React__default.forwardRef(({ value, forceMount = false, children, className, ...props }, ref) => {
|
|
13
13
|
const { value: selectedValue, orientation } = useTabsContext();
|
|
14
14
|
const shouldReduceMotion = useReducedMotion();
|
|
15
15
|
// Check if we're in Storybook and should disable animations
|
|
@@ -18,10 +18,10 @@ const TabsContent = React__default.forwardRef(({ value, forceMount = false, chil
|
|
|
18
18
|
const isSelected = value === selectedValue;
|
|
19
19
|
const shouldRender = forceMount || isSelected;
|
|
20
20
|
// Compute animation variants without a global cache (HMR-safe)
|
|
21
|
-
const contentVariants = useMemo(() =>
|
|
21
|
+
const contentVariants = useMemo(() => getTabsBodyVariants(shouldDisableAnimations), [shouldDisableAnimations]);
|
|
22
22
|
// For forceMount, we handle visibility differently to preserve DOM
|
|
23
23
|
if (forceMount) {
|
|
24
|
-
return (jsx(motion.div, { ref: ref, role: "tabpanel", "aria-labelledby": `${value}-tab`, id: `${value}-content`, tabIndex: 0, className: cn(tabsTheme.
|
|
24
|
+
return (jsx(motion.div, { ref: ref, role: "tabpanel", "aria-labelledby": `${value}-tab`, id: `${value}-content`, tabIndex: 0, className: cn(tabsTheme.bodyStyle, !isSelected && "hidden", // Hide when not selected but force mounted
|
|
25
25
|
className // User overrides take precedence
|
|
26
26
|
), "data-state": isSelected ? "active" : "inactive", "data-orientation": orientation, style: {
|
|
27
27
|
// Ensure proper stacking context for animations
|
|
@@ -39,12 +39,12 @@ const TabsContent = React__default.forwardRef(({ value, forceMount = false, chil
|
|
|
39
39
|
exit: "exit",
|
|
40
40
|
variants: contentVariants,
|
|
41
41
|
};
|
|
42
|
-
return (jsx(AnimatePresence, { mode: "wait", children: isSelected && (jsx(motion.div, { ref: ref, role: "tabpanel", "aria-labelledby": `${value}-tab`, id: `${value}-content`, tabIndex: 0, className: cn(tabsTheme.
|
|
42
|
+
return (jsx(AnimatePresence, { mode: "wait", children: isSelected && (jsx(motion.div, { ref: ref, role: "tabpanel", "aria-labelledby": `${value}-tab`, id: `${value}-content`, tabIndex: 0, className: cn(tabsTheme.bodyStyle, className // User overrides take precedence
|
|
43
43
|
), "data-state": "active", "data-orientation": orientation, style: {
|
|
44
44
|
// Ensure proper stacking context for animations
|
|
45
45
|
position: "relative",
|
|
46
46
|
}, ...animationProps, ...props, children: children }, `content-${value}`)) }));
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
TabsBody.displayName = "Tabs.Body";
|
|
49
49
|
|
|
50
|
-
export {
|
|
50
|
+
export { TabsBody };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Tabs } from './Tabs';
|
|
2
2
|
export { TabsList } from './TabsList';
|
|
3
3
|
export { TabsTrigger } from './TabsTrigger';
|
|
4
|
-
export {
|
|
4
|
+
export { TabsBody } from './TabsBody';
|
|
5
5
|
export { TabsContext, useTabsContext } from './TabsContext';
|
|
6
|
-
export type { TabsProps, TabsListProps, TabsTriggerProps,
|
|
6
|
+
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsBodyProps, TabsSize, TabsOrientation, TabsContextValue } from './Tabs.types';
|
|
@@ -73,7 +73,11 @@ onDismiss, index = 0, isExpanded = false, totalToasts = 1, onMouseEnter, onMouse
|
|
|
73
73
|
}, [stackingStyle.zIndex, index]);
|
|
74
74
|
const toastNode = (jsxs(motion.div, { ref: setRefs, layout: true, initial: shouldReduceMotion ? false : toastAnimations.initial, animate: animateValue, exit: shouldReduceMotion
|
|
75
75
|
? { ...toastAnimations.exit, transition: { duration: 0 } }
|
|
76
|
-
: toastAnimations.exit, transition: shouldReduceMotion ? { duration: 0 } : toastAnimations.transition, className: cn(toastTheme.baseStyle, isTextOnly && 'items-center', ((_a = toastTheme.variants) === null || _a === void 0 ? void 0 : _a[variant]) || "", 'pointer-events-auto', index > 0 && !isExpanded && 'absolute top-0 left-0', className), style: styleValue, role: "alert", "aria-live": "polite", children: [jsx("div", { className: isTextOnly ? toastTheme.iconCenteredStyle : toastTheme.iconStyle, children: resolvedIcon }), jsxs("div", { className: "flex-1 min-w-0", children: [title && (
|
|
76
|
+
: toastAnimations.exit, transition: shouldReduceMotion ? { duration: 0 } : toastAnimations.transition, className: cn(toastTheme.baseStyle, isTextOnly && 'items-center', ((_a = toastTheme.variants) === null || _a === void 0 ? void 0 : _a[variant]) || "", 'pointer-events-auto', index > 0 && !isExpanded && 'absolute top-0 left-0', className), style: styleValue, role: "alert", "aria-live": "polite", children: [jsx("div", { className: isTextOnly ? toastTheme.iconCenteredStyle : toastTheme.iconStyle, children: resolvedIcon }), jsxs("div", { className: "flex-1 min-w-0", children: [title && (typeof title === 'string'
|
|
77
|
+
? jsx("div", { className: isTextOnly ? toastTheme.textOnlyStyle : toastTheme.titleStyle, children: title })
|
|
78
|
+
: title), subtitle && (typeof subtitle === 'string'
|
|
79
|
+
? jsx("div", { className: toastTheme.subtitleStyle, children: subtitle })
|
|
80
|
+
: subtitle), action && (jsx("div", { className: "mt-2", children: jsx("button", { type: "button", className: toastTheme.actionStyle, onClick: handleActionClick, children: action.label }) }))] }), dismissible && (jsx("button", { type: "button", className: isTextOnly ? toastTheme.closeButtonCenteredStyle : toastTheme.closeButtonStyle, onClick: handleDismiss, "aria-label": "Dismiss notification", children: jsx(XMarkIcon, { className: "w-4 h-4" }) }))] }));
|
|
77
81
|
if (darkMode) {
|
|
78
82
|
return jsx("div", { className: "dark", children: toastNode });
|
|
79
83
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Toast visual variant
|
|
4
4
|
*/
|
|
5
|
-
export type ToastVariant =
|
|
5
|
+
export type ToastVariant = "default" | "glass";
|
|
6
6
|
/**
|
|
7
7
|
* Toast state (e.g., loading indicator)
|
|
8
8
|
*/
|
|
9
|
-
export type ToastState =
|
|
10
|
-
export type ToastPosition =
|
|
9
|
+
export type ToastState = "default" | "loading";
|
|
10
|
+
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
11
11
|
export interface ToastAction {
|
|
12
12
|
label: string;
|
|
13
13
|
onClick: () => void;
|
|
@@ -42,15 +42,15 @@ export interface ToastData {
|
|
|
42
42
|
id: string;
|
|
43
43
|
variant?: ToastVariant;
|
|
44
44
|
state?: ToastState;
|
|
45
|
-
title?:
|
|
46
|
-
subtitle?:
|
|
45
|
+
title?: ReactNode;
|
|
46
|
+
subtitle?: ReactNode;
|
|
47
47
|
icon?: ReactNode;
|
|
48
48
|
action?: ToastAction;
|
|
49
49
|
duration?: number;
|
|
50
50
|
dismissible?: boolean;
|
|
51
51
|
onDismiss?: () => void;
|
|
52
52
|
}
|
|
53
|
-
export interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
53
|
+
export interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
54
54
|
/** Toast data */
|
|
55
55
|
toast: ToastData;
|
|
56
56
|
/** Custom class name */
|
|
@@ -93,7 +93,7 @@ export interface ToastProviderProps {
|
|
|
93
93
|
}
|
|
94
94
|
export interface ToastContextValue {
|
|
95
95
|
toasts: ToastData[];
|
|
96
|
-
addToast: (toast: Omit<ToastData,
|
|
96
|
+
addToast: (toast: Omit<ToastData, "id">) => string;
|
|
97
97
|
removeToast: (id: string) => void;
|
|
98
98
|
removeAllToasts: () => void;
|
|
99
99
|
}
|
|
@@ -121,7 +121,7 @@ export interface UseToastReturn {
|
|
|
121
121
|
info: (title: string, options?: UseToastOptions & {
|
|
122
122
|
subtitle?: string;
|
|
123
123
|
}) => string;
|
|
124
|
-
loading: (title: string, options?: Omit<UseToastOptions,
|
|
124
|
+
loading: (title: string, options?: Omit<UseToastOptions, "state"> & {
|
|
125
125
|
subtitle?: string;
|
|
126
126
|
}) => string;
|
|
127
127
|
dismiss: (id: string) => void;
|
|
@@ -7,6 +7,7 @@ export { Badge } from './Badge/Badge.js';
|
|
|
7
7
|
export { Breadcrumbs } from './Breadcrumbs/Breadcrumbs.js';
|
|
8
8
|
export { breadcrumbsTheme, breadcrumbsVariants, defaultSeparator } from './Breadcrumbs/Breadcrumbs.theme.js';
|
|
9
9
|
export { Button } from './Button/Button.js';
|
|
10
|
+
export { getRippleAnimation, getRippleColorClass, useRipple } from './Button/Button.ripple.js';
|
|
10
11
|
export { ButtonGroup } from './ButtonGroup/ButtonGroup.js';
|
|
11
12
|
export { ButtonGroupSeparator } from './ButtonGroup/ButtonGroupSeparator.js';
|
|
12
13
|
export { ButtonGroupText } from './ButtonGroup/ButtonGroupText.js';
|
|
@@ -17,11 +18,13 @@ export { CalendarMini } from './Calendar/CalendarMini/CalendarMini.js';
|
|
|
17
18
|
export { Card } from './Card/Card.js';
|
|
18
19
|
export { CardStack } from './CardStack/CardStack.js';
|
|
19
20
|
export { Carousel } from './Carousel/Carousel.js';
|
|
21
|
+
export { CarouselBody } from './Carousel/CarouselBody.js';
|
|
20
22
|
export { CommandPalette } from './CommandPalette/CommandPalette.js';
|
|
21
23
|
export { commandPaletteTheme } from './CommandPalette/CommandPalette.theme.js';
|
|
22
24
|
export { Separator } from './Separator/Separator.js';
|
|
23
25
|
export { separatorTheme } from './Separator/Separator.theme.js';
|
|
24
26
|
export { Drawer } from './Drawer/Drawer.js';
|
|
27
|
+
export { DrawerBody } from './Drawer/DrawerBody.js';
|
|
25
28
|
export { Dropdown } from './Dropdown/Dropdown.js';
|
|
26
29
|
export { DropdownTrigger } from './Dropdown/DropdownTrigger.js';
|
|
27
30
|
export { DropdownMenu } from './Dropdown/DropdownMenu.js';
|
|
@@ -40,6 +43,7 @@ export { PageHeading } from './PageHeading/PageHeading.js';
|
|
|
40
43
|
export { Pagination } from './Pagination/Pagination.js';
|
|
41
44
|
export { Popover } from './Popover/Popover.js';
|
|
42
45
|
export { PopoverContext, usePopoverContext } from './Popover/PopoverContext.js';
|
|
46
|
+
export { PopoverBody } from './Popover/PopoverBody.js';
|
|
43
47
|
export { Progress } from './Progress/Progress.js';
|
|
44
48
|
export { Rating } from './Rating/Rating.js';
|
|
45
49
|
export { ScrollArea } from './ScrollArea/ScrollArea.js';
|
|
@@ -51,7 +55,7 @@ export { SlidingNumber } from './SlidingNumber/SlidingNumber.js';
|
|
|
51
55
|
export { Tabs } from './Tabs/Tabs.js';
|
|
52
56
|
export { TabsList } from './Tabs/TabsList.js';
|
|
53
57
|
export { TabsTrigger } from './Tabs/TabsTrigger.js';
|
|
54
|
-
export {
|
|
58
|
+
export { TabsBody } from './Tabs/TabsBody.js';
|
|
55
59
|
export { TabsContext, useTabsContext } from './Tabs/TabsContext.js';
|
|
56
60
|
export { Tooltip } from './Tooltip/Tooltip.js';
|
|
57
61
|
export { baseTooltipVariants, getTooltipVariants, tooltipSpringConfig } from './Tooltip/Tooltip.animations.js';
|
|
@@ -70,6 +74,7 @@ export { Message } from './Message/Message.js';
|
|
|
70
74
|
export { messageTheme } from './Message/Message.theme.js';
|
|
71
75
|
export { messageListTheme } from './Message/MessageList.theme.js';
|
|
72
76
|
export { TypeWriter } from './Message/TypeWriter.js';
|
|
77
|
+
export { MessageBody } from './Message/MessageBody.js';
|
|
73
78
|
export { Empty } from './Empty/Empty.js';
|
|
74
79
|
export { emptyTheme } from './Empty/Empty.theme.js';
|
|
75
80
|
export { Masonry } from './Masonry/Masonry.js';
|
|
@@ -94,7 +99,7 @@ export { Pill } from './Pill/Pill.js';
|
|
|
94
99
|
export { pillTheme } from './Pill/Pill.theme.js';
|
|
95
100
|
export { SocialIcon } from './SocialIcon/SocialIcon.js';
|
|
96
101
|
export { AnimatePresence } from 'motion/react';
|
|
97
|
-
export {
|
|
102
|
+
export { CardBody } from './Card/CardBody.js';
|
|
98
103
|
export { CardFooter } from './Card/CardFooter.js';
|
|
99
104
|
export { CardHeader } from './Card/CardHeader.js';
|
|
100
105
|
export { CardSubtitle } from './Card/CardSubtitle.js';
|
|
@@ -52,9 +52,17 @@ const FeedItem = React__default.forwardRef(({ variant = "default", title, timest
|
|
|
52
52
|
switch (variant) {
|
|
53
53
|
case "default":
|
|
54
54
|
case "icon":
|
|
55
|
-
return (jsxs("div", { className: cn(theme.contentStyle, "py-1.5"), children: [jsxs("p", { className: theme.actionTextStyle, children: [title &&
|
|
55
|
+
return (jsxs("div", { className: cn(theme.contentStyle, "py-1.5"), children: [jsxs("p", { className: theme.actionTextStyle, children: [title && (typeof title === 'string'
|
|
56
|
+
? jsxs("span", { className: theme.titleStyle, children: [title, " "] })
|
|
57
|
+
: title), children] }), timestamp && (typeof timestamp === 'string'
|
|
58
|
+
? jsx("p", { className: theme.timestampStyle, children: timestamp })
|
|
59
|
+
: timestamp)] }));
|
|
56
60
|
case "avatar":
|
|
57
|
-
return (jsxs("div", { className: theme.contentStyle, children: [title && (
|
|
61
|
+
return (jsxs("div", { className: theme.contentStyle, children: [title && (typeof title === 'string'
|
|
62
|
+
? jsx("p", { className: cn(theme.titleStyle, "text-base"), children: title })
|
|
63
|
+
: title), jsx("p", { className: cn(theme.actionTextStyle, "mt-0.5"), children: children }), timestamp && (typeof timestamp === 'string'
|
|
64
|
+
? jsx("p", { className: theme.timestampStyle, children: timestamp })
|
|
65
|
+
: timestamp)] }));
|
|
58
66
|
case "comment-input": {
|
|
59
67
|
const handleSubmit = () => {
|
|
60
68
|
const trimmed = inputValue.trim();
|
|
@@ -36,18 +36,18 @@ export interface FeedThemeOverrides {
|
|
|
36
36
|
commentInputWrapperStyle?: string;
|
|
37
37
|
commentInputFooterStyle?: string;
|
|
38
38
|
}
|
|
39
|
-
export interface FeedProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
export interface FeedProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
40
40
|
children: ReactNode;
|
|
41
41
|
theme?: FeedThemeOverrides;
|
|
42
42
|
className?: string;
|
|
43
43
|
}
|
|
44
|
-
export interface FeedItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, "onSubmit"> {
|
|
44
|
+
export interface FeedItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, "onSubmit" | "title"> {
|
|
45
45
|
/** Visual variant of the feed item */
|
|
46
46
|
variant?: FeedItemVariant;
|
|
47
47
|
/** Name/label of the entity that performed the action */
|
|
48
|
-
title?:
|
|
48
|
+
title?: ReactNode;
|
|
49
49
|
/** Timestamp label (e.g. "6d ago") */
|
|
50
|
-
timestamp?:
|
|
50
|
+
timestamp?: ReactNode;
|
|
51
51
|
/** Icon element for the "icon" variant indicator */
|
|
52
52
|
icon?: ReactNode;
|
|
53
53
|
/** Avatar configuration for avatar/comment-input variants */
|
|
@@ -11,7 +11,7 @@ const GanttTaskContextMenu = ({ task, children, }) => {
|
|
|
11
11
|
if (readonly || (!onTaskUpdate && !onTaskDuplicate && !onTaskDelete)) {
|
|
12
12
|
return jsx(Fragment, { children: children });
|
|
13
13
|
}
|
|
14
|
-
return (jsxs(ContextMenu, { children: [jsx(ContextMenu.Trigger, { children: children }), jsxs(ContextMenu.
|
|
14
|
+
return (jsxs(ContextMenu, { children: [jsx(ContextMenu.Trigger, { children: children }), jsxs(ContextMenu.Body, { children: [onTaskUpdate && (jsxs(ContextMenu.Item, { onSelect: () => onTaskUpdate(task.id, { completed: !task.completed, progress: task.completed ? 0 : 100 }), children: [jsx(CheckCircleIcon, { className: "size-4 mr-2" }), task.completed ? "Mark as incomplete" : "Mark as done"] })), onTaskUpdate && (jsxs(ContextMenu.Sub, { children: [jsx(ContextMenu.SubTrigger, { children: "Progress" }), jsx(ContextMenu.SubBody, { children: PROGRESS_STEPS.map((val) => (jsxs(ContextMenu.Item, { onSelect: () => onTaskUpdate(task.id, { progress: val, completed: val === 100 }), children: [val, "%"] }, val))) })] })), (onTaskDuplicate || onTaskDelete) && jsx(ContextMenu.Separator, {}), onTaskDuplicate && (jsxs(ContextMenu.Item, { onSelect: () => onTaskDuplicate(task.id), children: [jsx(DocumentDuplicateIcon, { className: "size-4 mr-2" }), "Duplicate"] })), onTaskDelete && (jsxs(ContextMenu.Item, { onSelect: () => onTaskDelete(task.id), className: "text-[var(--color-danger)]", children: [jsx(TrashIcon, { className: "size-4 mr-2" }), "Delete"] }))] })] }));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { GanttTaskContextMenu };
|
|
@@ -4,6 +4,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { useGanttContext } from './GanttChart.js';
|
|
5
5
|
import { Segmented } from '../../core/Segmented/Segmented.js';
|
|
6
6
|
import { Button } from '../../core/Button/Button.js';
|
|
7
|
+
import 'react';
|
|
7
8
|
import { Checkbox } from '../../forms/Checkbox/Checkbox.js';
|
|
8
9
|
|
|
9
10
|
const ZOOM_OPTIONS = [
|
|
@@ -32,7 +32,7 @@ const KPI = React__default.forwardRef(({ value, label, trend, trendLabel, progre
|
|
|
32
32
|
return Math.round((Math.min(Math.max(progress, 0), 100) / 100) * barCount);
|
|
33
33
|
}, [progress, barCount]);
|
|
34
34
|
const barSize = kpiTheme.barSizes[size];
|
|
35
|
-
return (jsxs("div", { ref: ref, className: cn(theme.baseStyle, className), ...props, children: [jsxs("div", { className: "flex items-start justify-between", children: [jsxs("div", { className: "flex items-baseline gap-2", children: [jsx("span", { className: cn(theme.valueSizes[size]), children: value }), label && (jsxs("span", { className: cn(theme.labelStyle, theme.labelSizes[size]), children: [icon && (jsx("span", { className: "inline-flex items-center mr-1", children: icon })), label] }))] }), formattedTrend && trendDirection && (jsxs("span", { className: cn("inline-flex items-center gap-0.5 font-medium", theme.trendSizes[size], trendDirection === "up" && theme.trendPositive, trendDirection === "down" && theme.trendNegative, trendDirection === "neutral" && theme.trendNeutral), children: [formattedTrend, trendDirection === "up" && jsx(ArrowUpRightIcon, { className: "size-4" }), trendDirection === "down" && jsx(ArrowDownRightIcon, { className: "size-4" })] }))] }), progress !== undefined && (jsx("div", { className: cn("flex items-end", barSize.gap), role: "img", "aria-label": `Progress: ${progress}%`, children: Array.from({ length: barCount }, (_, i) => {
|
|
35
|
+
return (jsxs("div", { ref: ref, className: cn(theme.baseStyle, className), ...props, children: [jsxs("div", { className: "flex items-start justify-between", children: [jsxs("div", { className: "flex items-baseline gap-2", children: [jsx("span", { className: cn(theme.valueSizes[size]), children: value }), label && (typeof label === 'string' ? (jsxs("span", { className: cn(theme.labelStyle, theme.labelSizes[size]), children: [icon && (jsx("span", { className: "inline-flex items-center mr-1", children: icon })), label] })) : label)] }), formattedTrend && trendDirection && (typeof formattedTrend === 'string' ? (jsxs("span", { className: cn("inline-flex items-center gap-0.5 font-medium", theme.trendSizes[size], trendDirection === "up" && theme.trendPositive, trendDirection === "down" && theme.trendNegative, trendDirection === "neutral" && theme.trendNeutral), children: [formattedTrend, trendDirection === "up" && jsx(ArrowUpRightIcon, { className: "size-4" }), trendDirection === "down" && jsx(ArrowDownRightIcon, { className: "size-4" })] })) : formattedTrend)] }), progress !== undefined && (jsx("div", { className: cn("flex items-end", barSize.gap), role: "img", "aria-label": `Progress: ${progress}%`, children: Array.from({ length: barCount }, (_, i) => {
|
|
36
36
|
const isFilled = i < filledBars;
|
|
37
37
|
const fadeDistance = filledBars - i;
|
|
38
38
|
const fillOpacity = isFilled && fadeDistance <= 3
|
|
@@ -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-sm" : "text-base"), children: subtitle }))] }));
|
|
46
|
+
}) })), subtitle && (typeof subtitle === 'string' ? (jsx("span", { className: cn(theme.subtitleStyle, size === "sm" ? "text-sm" : "text-base"), children: subtitle })) : subtitle)] }));
|
|
47
47
|
});
|
|
48
48
|
KPI.displayName = "KPI";
|
|
49
49
|
|
|
@@ -38,7 +38,7 @@ export interface KPIProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">
|
|
|
38
38
|
/**
|
|
39
39
|
* Label describing the metric (e.g. "Fund raised", "Total Revenue")
|
|
40
40
|
*/
|
|
41
|
-
label?:
|
|
41
|
+
label?: ReactNode;
|
|
42
42
|
/**
|
|
43
43
|
* Percentage change value (e.g. 20, -5.3). Determines trend direction & color.
|
|
44
44
|
*/
|
|
@@ -46,7 +46,7 @@ export interface KPIProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">
|
|
|
46
46
|
/**
|
|
47
47
|
* Custom trend label override (default: auto-formats as "+20%" or "-5.3%")
|
|
48
48
|
*/
|
|
49
|
-
trendLabel?:
|
|
49
|
+
trendLabel?: ReactNode;
|
|
50
50
|
/**
|
|
51
51
|
* Progress value from 0-100. Controls how many bars are filled.
|
|
52
52
|
*/
|
|
@@ -59,7 +59,7 @@ export interface KPIProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">
|
|
|
59
59
|
/**
|
|
60
60
|
* Subtitle text below the bars (e.g. "Compared to last month")
|
|
61
61
|
*/
|
|
62
|
-
subtitle?:
|
|
62
|
+
subtitle?: ReactNode;
|
|
63
63
|
/**
|
|
64
64
|
* Icon to display before the label.
|
|
65
65
|
*/
|
|
@@ -11,9 +11,9 @@ 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-base font-medium", trendDirection === "up"
|
|
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: [typeof label === 'string' ? (jsx("div", { className: cn(metricTheme.labelStyle, sizeStyles.label), children: label })) : label, jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: cn(metricTheme.valueStyle, sizeStyles.value), children: value }), trendValue && (typeof trendValue === 'string' ? (jsxs("div", { className: cn("flex items-center w-fit gap-1 text-base font-medium", trendDirection === "up"
|
|
15
15
|
? "text-[var(--color-success)]"
|
|
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 }))] }) }));
|
|
16
|
+
: "text-[var(--color-danger)]"), children: [trendIcon, " ", trendValue] })) : trendValue)] }), subtitle && (typeof subtitle === 'string' ? (jsx("div", { className: cn(metricTheme.subtitleStyle, sizeStyles.subtitle), children: subtitle })) : subtitle)] })] }), trendChart && (jsx("div", { className: "w-full h-12 flex-shrink-0 -mt-4", children: trendChart }))] }) }));
|
|
17
17
|
});
|
|
18
18
|
Metric.displayName = "Metric";
|
|
19
19
|
|
|
@@ -12,16 +12,16 @@ export interface MetricProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
/**
|
|
13
13
|
* Label describing the metric
|
|
14
14
|
*/
|
|
15
|
-
label:
|
|
15
|
+
label: React.ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Optional subtitle or secondary text
|
|
18
18
|
*/
|
|
19
|
-
subtitle?:
|
|
19
|
+
subtitle?: React.ReactNode;
|
|
20
20
|
/**
|
|
21
21
|
* Trend value to display (e.g., "+10.34%", "-5.2%")
|
|
22
22
|
* Also acts as boolean - if provided, trend badge is shown
|
|
23
23
|
*/
|
|
24
|
-
trendValue?:
|
|
24
|
+
trendValue?: React.ReactNode;
|
|
25
25
|
/**
|
|
26
26
|
* Trend direction - determines icon and color
|
|
27
27
|
* @default 'up'
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Popover } from '../../core/Popover/Popover.js';
|
|
3
3
|
import '../../core/Popover/PopoverContext.js';
|
|
4
|
+
import '../../core/Popover/PopoverBody.js';
|
|
4
5
|
import { Cog6ToothIcon } from '@heroicons/react/24/outline';
|
|
5
6
|
import { Button } from '../../core/Button/Button.js';
|
|
7
|
+
import 'react';
|
|
6
8
|
import { Checkbox } from '../../forms/Checkbox/Checkbox.js';
|
|
7
9
|
import { Sortable, SortableItem } from '../../core/Sortable/Sortable.js';
|
|
8
10
|
|
|
@@ -16,7 +18,7 @@ function TableColumnManagerComponent({ columns, visibleColumns, columnOrder, onT
|
|
|
16
18
|
const displayName = typeof column.header === 'string' ? column.header : column.id;
|
|
17
19
|
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
20
|
};
|
|
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.
|
|
21
|
+
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.Body, { 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
22
|
}
|
|
21
23
|
const TableColumnManager = TableColumnManagerComponent;
|
|
22
24
|
|
|
@@ -8,6 +8,7 @@ import { Select } from '../../forms/Select/Select.js';
|
|
|
8
8
|
import '../../forms/Select/Select.theme.js';
|
|
9
9
|
import { Popover } from '../../core/Popover/Popover.js';
|
|
10
10
|
import '../../core/Popover/PopoverContext.js';
|
|
11
|
+
import '../../core/Popover/PopoverBody.js';
|
|
11
12
|
import { FunnelIcon, XMarkIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
12
13
|
import { cn } from '../../../utils/cn.js';
|
|
13
14
|
|
|
@@ -206,7 +207,7 @@ function TableFilter({ columns, filterConfig, onFilterChange, filterLogic: contr
|
|
|
206
207
|
return true;
|
|
207
208
|
return f.value != null && f.value !== "";
|
|
208
209
|
}).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-sm font-medium", children: appliedFilterCount }))] }) }), jsx(Popover.
|
|
210
|
+
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.Body, { 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
211
|
? "bg-[var(--color-background)] text-[var(--color-text-primary)] shadow-sm"
|
|
211
212
|
: "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
213
|
? "bg-[var(--color-background)] text-[var(--color-text-primary)] shadow-sm"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
3
3
|
import { Button } from '../../core/Button/Button.js';
|
|
4
|
-
import { cn } from '../../../utils/cn.js';
|
|
5
4
|
import 'react';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Selection header that appears when rows are selected
|
|
@@ -57,7 +57,7 @@ const CheckboxComponent = React__default.forwardRef(({ id: idProp, name: namePro
|
|
|
57
57
|
ref(node);
|
|
58
58
|
else if (ref)
|
|
59
59
|
ref.current = node;
|
|
60
|
-
}, type: "checkbox", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? `${id}-description` : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn(checkboxTheme.inputStyle, checkboxTheme.sizes[size], indeterminate && "bg-neutral-200") }), indeterminate && (jsx(MinusIcon, { className: cn("pointer-events-none col-start-1 row-start-1 self-center justify-self-center opacity-100 stroke-neutral-600 transition-opacity duration-200", size === "sm" ? "size-3" : "size-4"), strokeWidth: 3 })), isChecked && !indeterminate && (jsx(CheckIcon, { className: cn("pointer-events-none col-start-1 row-start-1 self-center justify-self-center opacity-100 stroke-white transition-opacity duration-200", size === "sm" ? "size-3" : "size-4"), strokeWidth: 3 }))] }), (label || description) && (jsxs("label", { htmlFor: id, className: cn("cursor-pointer", isDisabled && "cursor-not-allowed"), children: [label && (jsx("span", { className: cn(formLabelTheme.baseStyle, formLabelTheme.stateStyles[state], "mb-0"), children: label })), description && (jsx("div", { id: `${id}-description`, className: checkboxTheme.descriptionStyle, children: description }))] }))] }));
|
|
60
|
+
}, type: "checkbox", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? `${id}-description` : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn(checkboxTheme.inputStyle, checkboxTheme.sizes[size], indeterminate && "bg-neutral-200") }), indeterminate && (jsx(MinusIcon, { className: cn("pointer-events-none col-start-1 row-start-1 self-center justify-self-center opacity-100 stroke-neutral-600 transition-opacity duration-200", size === "sm" ? "size-3" : "size-4"), strokeWidth: 3 })), isChecked && !indeterminate && (jsx(CheckIcon, { className: cn("pointer-events-none col-start-1 row-start-1 self-center justify-self-center opacity-100 stroke-white transition-opacity duration-200", size === "sm" ? "size-3" : "size-4"), strokeWidth: 3 }))] }), (label || description) && (jsxs("label", { htmlFor: id, className: cn("cursor-pointer", isDisabled && "cursor-not-allowed"), children: [label && (typeof label === 'string' ? (jsx("span", { className: cn(formLabelTheme.baseStyle, formLabelTheme.stateStyles[state], "mb-0"), children: label })) : (label)), description && (typeof description === 'string' ? (jsx("div", { id: `${id}-description`, className: checkboxTheme.descriptionStyle, children: description })) : (description))] }))] }));
|
|
61
61
|
});
|
|
62
62
|
CheckboxComponent.displayName = "Checkbox";
|
|
63
63
|
const Checkbox = Object.assign(CheckboxComponent, {
|
|
@@ -21,8 +21,8 @@ export interface CheckboxProps extends Omit<React.HTMLAttributes<HTMLInputElemen
|
|
|
21
21
|
checked?: boolean;
|
|
22
22
|
indeterminate?: boolean;
|
|
23
23
|
onChange?: (checked: boolean, value: string) => void;
|
|
24
|
-
label?:
|
|
25
|
-
description?:
|
|
24
|
+
label?: React.ReactNode;
|
|
25
|
+
description?: React.ReactNode;
|
|
26
26
|
state?: CheckboxState;
|
|
27
27
|
size?: CheckboxSize;
|
|
28
28
|
className?: string;
|
|
@@ -38,9 +38,9 @@ export interface CheckboxGroupProps extends Omit<React.HTMLAttributes<HTMLFieldS
|
|
|
38
38
|
size?: CheckboxSize;
|
|
39
39
|
state?: CheckboxState;
|
|
40
40
|
orientation?: CheckboxGroupOrientation;
|
|
41
|
-
label?:
|
|
42
|
-
description?:
|
|
43
|
-
error?:
|
|
41
|
+
label?: React.ReactNode;
|
|
42
|
+
description?: React.ReactNode;
|
|
43
|
+
error?: React.ReactNode;
|
|
44
44
|
required?: boolean;
|
|
45
45
|
className?: string;
|
|
46
46
|
}
|
|
@@ -32,8 +32,8 @@ const CheckboxGroup = React__default.forwardRef(({ value: controlledValue, defau
|
|
|
32
32
|
state,
|
|
33
33
|
}), [groupName, currentValue, size, state]);
|
|
34
34
|
const labelState = error ? "invalid" : state === "disabled" ? "disabled" : "default";
|
|
35
|
-
return (jsx(CheckboxGroupContext.Provider, { value: contextValue, children: jsxs("fieldset", { ref: ref, role: "group", "aria-labelledby": label ? labelId : undefined, "aria-describedby": description ? descriptionId : undefined, "aria-required": required || undefined, "aria-invalid": error ? true : undefined, "aria-errormessage": error ? errorId : undefined, className: cn("border-0 p-0 m-0", checkboxTheme.groupStyle, className), ...props, children: [label && (jsxs("legend", { id: labelId, className: cn(formLabelTheme.baseStyle, formLabelTheme.stateStyles[labelState]), children: [label, required && (jsx("span", { className: formLabelTheme.requiredIndicatorStyle, children: "*" }))] })), description && (jsx("p", { id: descriptionId, className: checkboxTheme.groupDescriptionStyle, children: description })), jsx("div", { className: cn(checkboxTheme.groupItemsStyle, orientation === "horizontal" &&
|
|
36
|
-
checkboxTheme.groupHorizontalStyle), children: children }), error && (jsx("p", { id: errorId, role: "alert", className: checkboxTheme.groupErrorStyle, children: error }))] }) }));
|
|
35
|
+
return (jsx(CheckboxGroupContext.Provider, { value: contextValue, children: jsxs("fieldset", { ref: ref, role: "group", "aria-labelledby": label ? labelId : undefined, "aria-describedby": description ? descriptionId : undefined, "aria-required": required || undefined, "aria-invalid": error ? true : undefined, "aria-errormessage": error ? errorId : undefined, className: cn("border-0 p-0 m-0", checkboxTheme.groupStyle, className), ...props, children: [label && (typeof label === 'string' ? (jsxs("legend", { id: labelId, className: cn(formLabelTheme.baseStyle, formLabelTheme.stateStyles[labelState]), children: [label, required && (jsx("span", { className: formLabelTheme.requiredIndicatorStyle, children: "*" }))] })) : (label)), description && (typeof description === 'string' ? (jsx("p", { id: descriptionId, className: checkboxTheme.groupDescriptionStyle, children: description })) : (description)), jsx("div", { className: cn(checkboxTheme.groupItemsStyle, orientation === "horizontal" &&
|
|
36
|
+
checkboxTheme.groupHorizontalStyle), children: children }), error && (typeof error === 'string' ? (jsx("p", { id: errorId, role: "alert", className: checkboxTheme.groupErrorStyle, children: error })) : (error))] }) }));
|
|
37
37
|
});
|
|
38
38
|
CheckboxGroup.displayName = "Checkbox.Group";
|
|
39
39
|
|
|
@@ -14,7 +14,7 @@ export declare const useColorPicker: () => ColorPickerContextValue;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const ColorPicker: React.ForwardRefExoticComponent<ColorPickerProps & React.RefAttributes<HTMLDivElement>> & {
|
|
16
16
|
Trigger: React.FC<import("./ColorPicker.types").ColorPickerTriggerProps>;
|
|
17
|
-
|
|
17
|
+
Body: React.FC<import("./ColorPicker.types").ColorPickerBodyProps>;
|
|
18
18
|
Canvas: React.FC<{
|
|
19
19
|
className?: string;
|
|
20
20
|
}>;
|