@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useRef, useCallback } from 'react';
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Custom hook for managing ripple effects on button clicks
|
|
@@ -21,6 +21,13 @@ function useRipple(config = {}) {
|
|
|
21
21
|
const { scale = 10, duration = 600, effect = 'default' } = config;
|
|
22
22
|
const [ripples, setRipples] = useState([]);
|
|
23
23
|
const buttonRef = useRef(null);
|
|
24
|
+
const timeoutsRef = useRef([]);
|
|
25
|
+
// Cleanup all pending timeouts on unmount
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
return () => {
|
|
28
|
+
timeoutsRef.current.forEach(clearTimeout);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
24
31
|
const createRipple = useCallback((event) => {
|
|
25
32
|
const button = buttonRef.current;
|
|
26
33
|
if (!button)
|
|
@@ -44,12 +51,14 @@ function useRipple(config = {}) {
|
|
|
44
51
|
maxDuration = 800; // Longest layer duration
|
|
45
52
|
break;
|
|
46
53
|
case 'particle':
|
|
47
|
-
// Multiple small ripples at random offsets
|
|
54
|
+
// Multiple small ripples at random offsets (random values stored for stable renders)
|
|
48
55
|
newRipples = Array.from({ length: 6 }, (_, i) => ({
|
|
49
56
|
id: baseId + i,
|
|
50
57
|
x: x + (Math.random() - 0.5) * 20,
|
|
51
58
|
y: y + (Math.random() - 0.5) * 20,
|
|
52
59
|
layer: i + 1,
|
|
60
|
+
randomScale: Math.random(),
|
|
61
|
+
randomDuration: Math.random(),
|
|
53
62
|
}));
|
|
54
63
|
maxDuration = 700;
|
|
55
64
|
break;
|
|
@@ -75,12 +84,11 @@ function useRipple(config = {}) {
|
|
|
75
84
|
newRipples = [{ id: baseId, x, y, layer: 1 }];
|
|
76
85
|
maxDuration = 800;
|
|
77
86
|
// Spawn echo ripples with delays
|
|
78
|
-
setTimeout(() => {
|
|
87
|
+
timeoutsRef.current.push(setTimeout(() => {
|
|
79
88
|
setRipples((prev) => [...prev, { id: baseId + 10, x, y, layer: 2 }]);
|
|
80
|
-
}, 100)
|
|
81
|
-
setTimeout(() => {
|
|
89
|
+
}, 100), setTimeout(() => {
|
|
82
90
|
setRipples((prev) => [...prev, { id: baseId + 20, x, y, layer: 3 }]);
|
|
83
|
-
}, 200);
|
|
91
|
+
}, 200));
|
|
84
92
|
break;
|
|
85
93
|
case 'default':
|
|
86
94
|
default:
|
|
@@ -91,9 +99,9 @@ function useRipple(config = {}) {
|
|
|
91
99
|
}
|
|
92
100
|
setRipples((prev) => [...prev, ...newRipples]);
|
|
93
101
|
// Auto-remove all ripples after longest animation completes
|
|
94
|
-
setTimeout(() => {
|
|
102
|
+
timeoutsRef.current.push(setTimeout(() => {
|
|
95
103
|
setRipples((prev) => prev.filter((r) => r.id < baseId || r.id > baseId + 30));
|
|
96
|
-
}, maxDuration);
|
|
104
|
+
}, maxDuration));
|
|
97
105
|
}, [duration, effect]);
|
|
98
106
|
return {
|
|
99
107
|
ripples,
|
|
@@ -124,8 +132,6 @@ function getRippleColorClass(variant, color) {
|
|
|
124
132
|
return "bg-[var(--color-danger)]/20";
|
|
125
133
|
case "neutral":
|
|
126
134
|
return "bg-[var(--color-neutral-500)]/20";
|
|
127
|
-
case "muted":
|
|
128
|
-
return "bg-[var(--color-text-muted)]/20";
|
|
129
135
|
default:
|
|
130
136
|
return "bg-[var(--color-primary)]/20";
|
|
131
137
|
}
|
|
@@ -133,7 +139,9 @@ function getRippleColorClass(variant, color) {
|
|
|
133
139
|
/**
|
|
134
140
|
* Get animation properties for specific ripple effect and layer
|
|
135
141
|
*/
|
|
136
|
-
function getRippleAnimation(effect,
|
|
142
|
+
function getRippleAnimation(effect, ripple, baseScale) {
|
|
143
|
+
var _a, _b, _c;
|
|
144
|
+
const layer = (_a = ripple.layer) !== null && _a !== void 0 ? _a : 1;
|
|
137
145
|
switch (effect) {
|
|
138
146
|
case 'aurora':
|
|
139
147
|
// Triple layer with different speeds and opacities
|
|
@@ -158,15 +166,17 @@ function getRippleAnimation(effect, layer, baseScale) {
|
|
|
158
166
|
transition: { duration: 0.8, ease: "easeOut" },
|
|
159
167
|
};
|
|
160
168
|
}
|
|
161
|
-
case 'particle':
|
|
162
|
-
//
|
|
163
|
-
const
|
|
164
|
-
const
|
|
169
|
+
case 'particle': {
|
|
170
|
+
// Use pre-computed random values from ripple creation for stable renders
|
|
171
|
+
const particleScale = baseScale * (0.7 + ((_b = ripple.randomScale) !== null && _b !== void 0 ? _b : 0.5) * 0.6);
|
|
172
|
+
const particleDelay = layer * 0.025;
|
|
173
|
+
const particleDuration = 0.5 + ((_c = ripple.randomDuration) !== null && _c !== void 0 ? _c : 0.5) * 0.2;
|
|
165
174
|
return {
|
|
166
175
|
initial: { scale: 0, opacity: 0.6 },
|
|
167
|
-
animate: { scale:
|
|
168
|
-
transition: { duration:
|
|
176
|
+
animate: { scale: particleScale, opacity: 0 },
|
|
177
|
+
transition: { duration: particleDuration, ease: "easeOut", delay: particleDelay },
|
|
169
178
|
};
|
|
179
|
+
}
|
|
170
180
|
case 'glass':
|
|
171
181
|
if (layer === 1) {
|
|
172
182
|
// Outer expanding ring
|
|
@@ -3,7 +3,7 @@ import { ButtonColor, ButtonVariant, ButtonSize, ButtonState } from "./Button.ty
|
|
|
3
3
|
* Theme structure for the Button component using variant-first organization
|
|
4
4
|
* This structure enables reliable dark: variants and className overrides
|
|
5
5
|
*/
|
|
6
|
-
interface ButtonTheme {
|
|
6
|
+
export interface ButtonTheme {
|
|
7
7
|
baseStyle: string;
|
|
8
8
|
variantStyles: Record<ButtonVariant, string>;
|
|
9
9
|
variantColors: {
|
|
@@ -24,4 +24,3 @@ interface ButtonTheme {
|
|
|
24
24
|
* Default theme for the Button component
|
|
25
25
|
*/
|
|
26
26
|
export declare const buttonTheme: ButtonTheme;
|
|
27
|
-
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const buttonTheme = {
|
|
5
5
|
// Base styles for the button element
|
|
6
|
-
baseStyle: "relative inline-flex items-center justify-center gap-2
|
|
6
|
+
baseStyle: "relative inline-flex items-center justify-center gap-2 focus:outline-none rounded-[var(--button-radius)] overflow-hidden cursor-pointer transition-all duration-300 ease-in-out min-w-fit flex-shrink-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 cursor-pointer",
|
|
7
7
|
// Visual style variants - STRUCTURE only (no colors)
|
|
8
8
|
variantStyles: {
|
|
9
9
|
filled: "border hover:brightness-[0.9] dark:hover:brightness-[1.15]",
|
|
@@ -124,19 +124,19 @@ const buttonTheme = {
|
|
|
124
124
|
// Size variants
|
|
125
125
|
sizes: {
|
|
126
126
|
sm: {
|
|
127
|
-
default: "min-h-[var(--button-min-h-sm)] px-[var(--button-px-sm)] py-[var(--button-py-sm)] text-
|
|
127
|
+
default: "font-semibold min-h-[var(--button-min-h-sm)] px-[var(--button-px-sm)] py-[var(--button-py-sm)] text-base",
|
|
128
128
|
iconOnly: "size-[var(--button-icon-size-sm)] p-[var(--button-icon-p-sm)]",
|
|
129
|
-
link: "p-0 text-
|
|
129
|
+
link: "font-semibold p-0 text-base h-fit",
|
|
130
130
|
},
|
|
131
131
|
md: {
|
|
132
|
-
default: "min-h-[var(--button-min-h-md)] px-[var(--button-px-md)] py-[var(--button-py-md)] text-
|
|
132
|
+
default: "font-semibold min-h-[var(--button-min-h-md)] px-[var(--button-px-md)] py-[var(--button-py-md)] text-base",
|
|
133
133
|
iconOnly: "size-[var(--button-icon-size-md)] p-[var(--button-icon-p-md)]",
|
|
134
|
-
link: "p-0 text-
|
|
134
|
+
link: "font-semibold p-0 text-base h-fit",
|
|
135
135
|
},
|
|
136
136
|
lg: {
|
|
137
|
-
default: "min-h-[var(--button-min-h-lg)] px-[var(--button-px-lg)] py-[var(--button-py-lg)] text-
|
|
137
|
+
default: "font-semibold min-h-[var(--button-min-h-lg)] px-[var(--button-px-lg)] py-[var(--button-py-lg)] text-lg",
|
|
138
138
|
iconOnly: "size-[var(--button-icon-size-lg)] p-[var(--button-icon-p-lg)]",
|
|
139
|
-
link: "p-0 text-
|
|
139
|
+
link: "font-semibold p-0 text-lg h-fit",
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
142
|
// State styles
|
|
@@ -224,8 +224,8 @@ const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultVal
|
|
|
224
224
|
// Generate year options - filter based on minDate/maxDate
|
|
225
225
|
const currentDate = new Date();
|
|
226
226
|
const defaultYearRange = {
|
|
227
|
-
start: currentDate.getFullYear() -
|
|
228
|
-
end: currentDate.getFullYear()
|
|
227
|
+
start: currentDate.getFullYear() - 100,
|
|
228
|
+
end: currentDate.getFullYear(),
|
|
229
229
|
};
|
|
230
230
|
const actualYearRange = yearRange || defaultYearRange;
|
|
231
231
|
const yearOptions = useMemo(() => {
|
|
@@ -239,7 +239,7 @@ const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultVal
|
|
|
239
239
|
endYear = Math.min(endYear, maxDate.getFullYear());
|
|
240
240
|
}
|
|
241
241
|
const options = [];
|
|
242
|
-
for (let year =
|
|
242
|
+
for (let year = endYear; year >= startYear; year--) {
|
|
243
243
|
options.push({
|
|
244
244
|
id: year,
|
|
245
245
|
value: year.toString(),
|
|
@@ -2,7 +2,7 @@ import { CardComponent } from './Card.types';
|
|
|
2
2
|
import { CardHeader } from './CardHeader';
|
|
3
3
|
import { CardTitle } from './CardTitle';
|
|
4
4
|
import { CardSubtitle } from './CardSubtitle';
|
|
5
|
-
import {
|
|
5
|
+
import { CardBody } from './CardBody';
|
|
6
6
|
import { CardFooter } from './CardFooter';
|
|
7
|
-
export { CardHeader, CardTitle, CardSubtitle,
|
|
7
|
+
export { CardHeader, CardTitle, CardSubtitle, CardBody, CardFooter };
|
|
8
8
|
export declare const Card: CardComponent;
|
|
@@ -5,7 +5,7 @@ import { cardTheme } from './Card.theme.js';
|
|
|
5
5
|
import { CardHeader } from './CardHeader.js';
|
|
6
6
|
import { CardTitle } from './CardTitle.js';
|
|
7
7
|
import { CardSubtitle } from './CardSubtitle.js';
|
|
8
|
-
import {
|
|
8
|
+
import { CardBody } from './CardBody.js';
|
|
9
9
|
import { CardFooter } from './CardFooter.js';
|
|
10
10
|
|
|
11
11
|
const CardRoot = React__default.forwardRef(({ children, className, theme: customTheme = {}, darkMode = false, ...props }, ref) => {
|
|
@@ -21,8 +21,8 @@ const Card = Object.assign(CardRoot, {
|
|
|
21
21
|
Header: CardHeader,
|
|
22
22
|
Title: CardTitle,
|
|
23
23
|
Subtitle: CardSubtitle,
|
|
24
|
-
|
|
24
|
+
Body: CardBody,
|
|
25
25
|
Footer: CardFooter,
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
export { Card,
|
|
28
|
+
export { Card, CardBody, CardFooter, CardHeader, CardSubtitle, CardTitle };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const cardTheme = {
|
|
2
|
-
baseStyle: "rounded-[var(--card-radius)] overflow-hidden bg-white border border-[var(--color-border)] shadow-xs dark:bg-[var(--color-background-secondary)]
|
|
3
|
-
headerStyle: "flex flex-col
|
|
4
|
-
titleStyle: "text-
|
|
5
|
-
subtitleStyle: "text-
|
|
6
|
-
|
|
7
|
-
footerStyle: "flex items-center p-
|
|
2
|
+
baseStyle: "rounded-[var(--card-radius)] overflow-hidden bg-white border border-[var(--color-border)] shadow-xs dark:bg-[var(--color-background-secondary)]",
|
|
3
|
+
headerStyle: "flex flex-col p-6",
|
|
4
|
+
titleStyle: "text-lg font-semibold leading-none text-[var(--color-text-primary)]",
|
|
5
|
+
subtitleStyle: "text-base text-[var(--color-text-muted)] mt-1.5",
|
|
6
|
+
bodyStyle: "p-6 pt-0",
|
|
7
|
+
footerStyle: "flex items-center p-6 pt-0",
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { cardTheme };
|
|
@@ -4,7 +4,7 @@ export interface CardTheme {
|
|
|
4
4
|
headerStyle: string;
|
|
5
5
|
titleStyle: string;
|
|
6
6
|
subtitleStyle: string;
|
|
7
|
-
|
|
7
|
+
bodyStyle: string;
|
|
8
8
|
footerStyle: string;
|
|
9
9
|
}
|
|
10
10
|
export interface CardThemeOverrides {
|
|
@@ -12,7 +12,7 @@ export interface CardThemeOverrides {
|
|
|
12
12
|
headerStyle?: string;
|
|
13
13
|
titleStyle?: string;
|
|
14
14
|
subtitleStyle?: string;
|
|
15
|
-
|
|
15
|
+
bodyStyle?: string;
|
|
16
16
|
footerStyle?: string;
|
|
17
17
|
}
|
|
18
18
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -39,28 +39,23 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
39
39
|
}
|
|
40
40
|
export interface CardComponent extends ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement>> {
|
|
41
41
|
Header: ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
42
|
-
Title: ForwardRefExoticComponent<CardTitleProps & RefAttributes<
|
|
43
|
-
Subtitle: ForwardRefExoticComponent<CardSubtitleProps & RefAttributes<
|
|
44
|
-
|
|
42
|
+
Title: ForwardRefExoticComponent<CardTitleProps & RefAttributes<HTMLDivElement>>;
|
|
43
|
+
Subtitle: ForwardRefExoticComponent<CardSubtitleProps & RefAttributes<HTMLDivElement>>;
|
|
44
|
+
Body: ForwardRefExoticComponent<CardBodyProps & RefAttributes<HTMLDivElement>>;
|
|
45
45
|
Footer: ForwardRefExoticComponent<CardFooterProps & RefAttributes<HTMLDivElement>>;
|
|
46
46
|
}
|
|
47
47
|
export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
-
children: ReactNode;
|
|
49
48
|
className?: string;
|
|
50
49
|
}
|
|
51
|
-
export interface
|
|
52
|
-
children: ReactNode;
|
|
50
|
+
export interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
53
51
|
className?: string;
|
|
54
52
|
}
|
|
55
53
|
export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
56
|
-
children: ReactNode;
|
|
57
54
|
className?: string;
|
|
58
55
|
}
|
|
59
|
-
export interface CardTitleProps extends HTMLAttributes<
|
|
60
|
-
children: ReactNode;
|
|
56
|
+
export interface CardTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
61
57
|
className?: string;
|
|
62
58
|
}
|
|
63
|
-
export interface CardSubtitleProps extends HTMLAttributes<
|
|
64
|
-
children: ReactNode;
|
|
59
|
+
export interface CardSubtitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
65
60
|
className?: string;
|
|
66
61
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { cardTheme } from './Card.theme.js';
|
|
5
|
+
|
|
6
|
+
const CardBody = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
7
|
+
return (jsx("div", { ref: ref, className: cn(cardTheme.bodyStyle, className), ...props, children: children }));
|
|
8
|
+
});
|
|
9
|
+
CardBody.displayName = 'Card.Body';
|
|
10
|
+
|
|
11
|
+
export { CardBody };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardSubtitleProps } from './Card.types';
|
|
3
|
-
export declare const CardSubtitle: React.ForwardRefExoticComponent<CardSubtitleProps & React.RefAttributes<
|
|
3
|
+
export declare const CardSubtitle: React.ForwardRefExoticComponent<CardSubtitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardTitleProps } from './Card.types';
|
|
3
|
-
export declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<
|
|
3
|
+
export declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Card, CardHeader, CardTitle, CardSubtitle,
|
|
2
|
-
export type { CardProps, CardHeaderProps, CardTitleProps, CardSubtitleProps,
|
|
1
|
+
export { Card, CardHeader, CardTitle, CardSubtitle, CardBody, CardFooter } from './Card';
|
|
2
|
+
export type { CardProps, CardHeaderProps, CardTitleProps, CardSubtitleProps, CardBodyProps, CardFooterProps, CardTheme, CardThemeOverrides } from './Card.types';
|
|
@@ -3,18 +3,18 @@ import React__default, { useState, useEffect, useCallback, useMemo } from 'react
|
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { carouselTheme } from './Carousel.theme.js';
|
|
5
5
|
import { CarouselContext } from './CarouselContext.js';
|
|
6
|
-
import {
|
|
6
|
+
import { CarouselBody } from './CarouselBody.js';
|
|
7
7
|
import { CarouselItem } from './CarouselItem.js';
|
|
8
8
|
import { CarouselPrevious } from './CarouselPrevious.js';
|
|
9
9
|
import { CarouselNext } from './CarouselNext.js';
|
|
10
10
|
|
|
11
11
|
const CarouselRoot = React__default.forwardRef(({ orientation = 'horizontal', opts = {}, showControls = false, defaultIndex = 0, onSlideChange, className, children, ...rest }, ref) => {
|
|
12
12
|
const { align = 'start', loop = false, slidesToScroll = 1, draggable = true, dragThreshold = 0.1, } = opts;
|
|
13
|
-
// Count total slides by looking for
|
|
13
|
+
// Count total slides by looking for CarouselBody and its CarouselItem children
|
|
14
14
|
const totalSlides = React__default.useMemo(() => {
|
|
15
15
|
let count = 0;
|
|
16
16
|
React__default.Children.forEach(children, (child) => {
|
|
17
|
-
if (React__default.isValidElement(child) && child.type ===
|
|
17
|
+
if (React__default.isValidElement(child) && child.type === CarouselBody) {
|
|
18
18
|
const contentProps = child.props;
|
|
19
19
|
count = React__default.Children.count(contentProps.children);
|
|
20
20
|
}
|
|
@@ -73,7 +73,7 @@ const CarouselRoot = React__default.forwardRef(({ orientation = 'horizontal', op
|
|
|
73
73
|
CarouselRoot.displayName = 'Carousel';
|
|
74
74
|
// Create compound component with sub-components
|
|
75
75
|
const Carousel = Object.assign(CarouselRoot, {
|
|
76
|
-
|
|
76
|
+
Body: CarouselBody,
|
|
77
77
|
Item: CarouselItem,
|
|
78
78
|
Previous: CarouselPrevious,
|
|
79
79
|
Next: CarouselNext,
|
|
@@ -67,13 +67,13 @@ export interface CarouselProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
67
67
|
*/
|
|
68
68
|
className?: string;
|
|
69
69
|
/**
|
|
70
|
-
* Children components (
|
|
70
|
+
* Children components (CarouselBody, CarouselPrevious, CarouselNext)
|
|
71
71
|
*/
|
|
72
72
|
children?: ReactNode;
|
|
73
73
|
}
|
|
74
|
-
export interface
|
|
74
|
+
export interface CarouselBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
75
75
|
/**
|
|
76
|
-
* Custom class name for the
|
|
76
|
+
* Custom class name for the body container
|
|
77
77
|
*/
|
|
78
78
|
className?: string;
|
|
79
79
|
/**
|
|
@@ -106,7 +106,7 @@ export interface CarouselControlProps extends HTMLAttributes<HTMLButtonElement>
|
|
|
106
106
|
'aria-label'?: string;
|
|
107
107
|
}
|
|
108
108
|
export interface CarouselComponent extends ForwardRefExoticComponent<CarouselProps & RefAttributes<HTMLDivElement>> {
|
|
109
|
-
|
|
109
|
+
Body: ForwardRefExoticComponent<CarouselBodyProps & RefAttributes<HTMLDivElement>>;
|
|
110
110
|
Item: ForwardRefExoticComponent<CarouselItemProps & RefAttributes<HTMLDivElement>>;
|
|
111
111
|
Previous: ForwardRefExoticComponent<CarouselControlProps & RefAttributes<HTMLButtonElement>>;
|
|
112
112
|
Next: ForwardRefExoticComponent<CarouselControlProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -5,7 +5,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
5
5
|
import { useCarouselContext } from './CarouselContext.js';
|
|
6
6
|
import { carouselTheme } from './Carousel.theme.js';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const CarouselBody = React__default.forwardRef(({ className, children, ...props }, ref) => {
|
|
9
9
|
const { currentIndex, orientation, opts, scrollPrev, scrollNext } = useCarouselContext();
|
|
10
10
|
const shouldReduceMotion = useReducedMotion();
|
|
11
11
|
const internalRef = React__default.useRef(null);
|
|
@@ -47,6 +47,6 @@ const CarouselContent = React__default.forwardRef(({ className, children, ...pro
|
|
|
47
47
|
});
|
|
48
48
|
}) }) }));
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
CarouselBody.displayName = 'Carousel.Body';
|
|
51
51
|
|
|
52
|
-
export {
|
|
52
|
+
export { CarouselBody };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { Carousel } from './Carousel';
|
|
2
|
-
export
|
|
2
|
+
export { CarouselBody } from './CarouselBody';
|
|
3
|
+
export type { CarouselProps, CarouselBodyProps, CarouselItemProps, CarouselControlProps, CarouselOptions, CarouselOrientation, } from './Carousel.types';
|
|
@@ -5,11 +5,11 @@ export declare const ContextMenu: {
|
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
7
|
Trigger: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuTriggerProps & React.RefAttributes<HTMLElement>>;
|
|
8
|
-
|
|
8
|
+
Body: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Item: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
Sub: React.FC<import("./ContextMenu.types").ContextMenuSubProps>;
|
|
11
11
|
SubTrigger: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
|
|
12
|
+
SubBody: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuSubBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
Separator: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
Label: React.ForwardRefExoticComponent<import("./ContextMenu.types").ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
};
|
|
@@ -3,11 +3,11 @@ import { useState, useRef, useCallback, useEffect } from 'react';
|
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { ContextMenuContext } from './ContextMenuContext.js';
|
|
5
5
|
import { ContextMenuTrigger } from './ContextMenuTrigger.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ContextMenuBody } from './ContextMenuBody.js';
|
|
7
7
|
import { ContextMenuItem } from './ContextMenuItem.js';
|
|
8
8
|
import { ContextMenuSub } from './ContextMenuSub.js';
|
|
9
9
|
import { ContextMenuSubTrigger } from './ContextMenuSubTrigger.js';
|
|
10
|
-
import {
|
|
10
|
+
import { ContextMenuSubBody } from './ContextMenuSubBody.js';
|
|
11
11
|
import { ContextMenuSeparator } from './ContextMenuSeparator.js';
|
|
12
12
|
import { ContextMenuLabel } from './ContextMenuLabel.js';
|
|
13
13
|
import { contextMenuTheme } from './ContextMenu.theme.js';
|
|
@@ -22,11 +22,11 @@ import { contextMenuTheme } from './ContextMenu.theme.js';
|
|
|
22
22
|
* <ContextMenu.Trigger>
|
|
23
23
|
* <div>Right click here</div>
|
|
24
24
|
* </ContextMenu.Trigger>
|
|
25
|
-
* <ContextMenu.
|
|
25
|
+
* <ContextMenu.Body>
|
|
26
26
|
* <ContextMenu.Item shortcut="⌘R">Reload</ContextMenu.Item>
|
|
27
27
|
* <ContextMenu.Separator />
|
|
28
28
|
* <ContextMenu.Item checked={true}>Show Bookmarks</ContextMenu.Item>
|
|
29
|
-
* </ContextMenu.
|
|
29
|
+
* </ContextMenu.Body>
|
|
30
30
|
* </ContextMenu>
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
@@ -78,11 +78,11 @@ ContextMenuRoot.displayName = "ContextMenu";
|
|
|
78
78
|
// Export as a unified component with sub-components
|
|
79
79
|
const ContextMenu = Object.assign(ContextMenuRoot, {
|
|
80
80
|
Trigger: ContextMenuTrigger,
|
|
81
|
-
|
|
81
|
+
Body: ContextMenuBody,
|
|
82
82
|
Item: ContextMenuItem,
|
|
83
83
|
Sub: ContextMenuSub,
|
|
84
84
|
SubTrigger: ContextMenuSubTrigger,
|
|
85
|
-
|
|
85
|
+
SubBody: ContextMenuSubBody,
|
|
86
86
|
Separator: ContextMenuSeparator,
|
|
87
87
|
Label: ContextMenuLabel,
|
|
88
88
|
});
|
|
@@ -26,7 +26,7 @@ export interface ContextMenuTriggerProps {
|
|
|
26
26
|
className?: string;
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface ContextMenuBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
30
30
|
children: ReactNode;
|
|
31
31
|
className?: string;
|
|
32
32
|
animation?: boolean;
|
|
@@ -53,7 +53,7 @@ export interface ContextMenuSubTriggerProps extends React.HTMLAttributes<HTMLDiv
|
|
|
53
53
|
className?: string;
|
|
54
54
|
disabled?: boolean;
|
|
55
55
|
}
|
|
56
|
-
export interface
|
|
56
|
+
export interface ContextMenuSubBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
57
57
|
children: ReactNode;
|
|
58
58
|
className?: string;
|
|
59
59
|
animation?: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ContextMenuBodyProps } from "./ContextMenu.types";
|
|
3
|
+
/**
|
|
4
|
+
* ContextMenuBody - Renders the menu at cursor position with keyboard navigation
|
|
5
|
+
*/
|
|
6
|
+
export declare const ContextMenuBody: React.ForwardRefExoticComponent<ContextMenuBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -7,9 +7,9 @@ import { useContextMenuContext } from './ContextMenuContext.js';
|
|
|
7
7
|
import { useIsClient } from '../../../hooks/useIsClient.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* ContextMenuBody - Renders the menu at cursor position with keyboard navigation
|
|
11
11
|
*/
|
|
12
|
-
const
|
|
12
|
+
const ContextMenuBody = React__default.forwardRef(({ children, className, animation = true, "aria-label": ariaLabel, ...props }, ref) => {
|
|
13
13
|
const { isOpen, onOpenChange, cursorPosition, contentRef, triggerRef, theme, } = useContextMenuContext();
|
|
14
14
|
const shouldReduceMotion = useReducedMotion();
|
|
15
15
|
const isClient = useIsClient();
|
|
@@ -192,6 +192,6 @@ const ContextMenuContent = React__default.forwardRef(({ children, className, ani
|
|
|
192
192
|
? createPortal(menuContent, document.body)
|
|
193
193
|
: null;
|
|
194
194
|
});
|
|
195
|
-
|
|
195
|
+
ContextMenuBody.displayName = "ContextMenu.Body";
|
|
196
196
|
|
|
197
|
-
export {
|
|
197
|
+
export { ContextMenuBody };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ContextMenuSubBodyProps } from "./ContextMenu.types";
|
|
3
|
+
/**
|
|
4
|
+
* ContextMenuSubBody - Submenu content positioned to the right of trigger
|
|
5
|
+
*/
|
|
6
|
+
export declare const ContextMenuSubBody: React.ForwardRefExoticComponent<ContextMenuSubBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -7,9 +7,9 @@ import { useContextMenuContext, useSubMenuContext } from './ContextMenuContext.j
|
|
|
7
7
|
import { useIsClient } from '../../../hooks/useIsClient.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* ContextMenuSubBody - Submenu content positioned to the right of trigger
|
|
11
11
|
*/
|
|
12
|
-
const
|
|
12
|
+
const ContextMenuSubBody = React__default.forwardRef(({ children, className, animation = true, ...props }, ref) => {
|
|
13
13
|
const { theme } = useContextMenuContext();
|
|
14
14
|
const { isOpen, triggerRef, onOpenChange } = useSubMenuContext();
|
|
15
15
|
const shouldReduceMotion = useReducedMotion();
|
|
@@ -101,6 +101,6 @@ const ContextMenuSubContent = React__default.forwardRef(({ children, className,
|
|
|
101
101
|
? createPortal(submenuContent, document.body)
|
|
102
102
|
: null;
|
|
103
103
|
});
|
|
104
|
-
|
|
104
|
+
ContextMenuSubBody.displayName = "ContextMenu.SubBody";
|
|
105
105
|
|
|
106
|
-
export {
|
|
106
|
+
export { ContextMenuSubBody };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ContextMenu } from "./ContextMenu";
|
|
2
|
-
export type { ContextMenuProps, ContextMenuTriggerProps,
|
|
2
|
+
export type { ContextMenuProps, ContextMenuTriggerProps, ContextMenuBodyProps, ContextMenuItemProps, ContextMenuSubProps, ContextMenuSubTriggerProps, ContextMenuSubBodyProps, ContextMenuSeparatorProps, ContextMenuLabelProps, ContextMenuThemeOverrides, } from "./ContextMenu.types";
|
|
3
3
|
export type { ContextMenuTheme } from "./ContextMenu.theme";
|
|
4
4
|
export { contextMenuTheme } from "./ContextMenu.theme";
|
|
@@ -16,8 +16,8 @@ export declare const Drawer: {
|
|
|
16
16
|
({ children, className, ...props }: import("./Drawer.types").DrawerSubtitleProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
({ children, className, ...props }: import("./Drawer.types").
|
|
19
|
+
Body: {
|
|
20
|
+
({ children, className, ...props }: import("./Drawer.types").DrawerBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
Footer: {
|