@flikk/ui 1.0.0-beta.11 → 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 +1 -1
- package/dist/components/ai/MessageHistory/MessageHistory.js +1 -0
- package/dist/components/ai/PromptInput/PromptInput.js +7 -125
- package/dist/components/ai/PromptInput/VoiceRecorder.js +0 -77
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +1 -0
- package/dist/components/ai/index.js +1 -0
- 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 +4 -4
- package/dist/components/core/Accordion/Accordion.types.d.ts +23 -18
- 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 +16 -7
- 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/Breadcrumbs/Breadcrumbs.js +7 -3
- package/dist/components/core/Breadcrumbs/Breadcrumbs.types.d.ts +1 -1
- package/dist/components/core/Button/Button.js +2 -8
- package/dist/components/core/Button/Button.theme.js +7 -7
- 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 +3 -3
- package/dist/components/core/Card/Card.types.d.ts +4 -4
- package/dist/components/core/Card/CardBody.d.ts +3 -0
- package/dist/components/core/Card/CardBody.js +11 -0
- 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.js +1 -1
- 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/DrawerBody.js +11 -0
- 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/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 +6 -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/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 +2 -1
- package/dist/components/data-display/Table/TableFilter.js +2 -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/FileUpload/FileUpload.js +0 -78
- 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/TimePicker/TimePickerContent.js +1 -78
- package/dist/components/forms/index.d.ts +2 -2
- package/dist/components/forms/index.js +2 -80
- 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 +196 -198
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/core/Accordion/AccordionContent.d.ts +0 -3
- 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/Drawer/DrawerContent.js +0 -11
- 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 -91
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +0 -3
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +0 -12
|
@@ -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-base",
|
|
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-base h-fit",
|
|
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-base",
|
|
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-base h-fit",
|
|
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-lg",
|
|
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-lg h-fit",
|
|
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,9 +1,9 @@
|
|
|
1
1
|
const cardTheme = {
|
|
2
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
|
|
3
|
+
headerStyle: "flex flex-col p-6",
|
|
4
4
|
titleStyle: "text-lg font-semibold leading-none text-[var(--color-text-primary)]",
|
|
5
|
-
subtitleStyle: "text-
|
|
6
|
-
|
|
5
|
+
subtitleStyle: "text-base text-[var(--color-text-muted)] mt-1.5",
|
|
6
|
+
bodyStyle: "p-6 pt-0",
|
|
7
7
|
footerStyle: "flex items-center p-6 pt-0",
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -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> {
|
|
@@ -41,13 +41,13 @@ export interface CardComponent extends ForwardRefExoticComponent<CardProps & Ref
|
|
|
41
41
|
Header: ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
42
42
|
Title: ForwardRefExoticComponent<CardTitleProps & RefAttributes<HTMLDivElement>>;
|
|
43
43
|
Subtitle: ForwardRefExoticComponent<CardSubtitleProps & RefAttributes<HTMLDivElement>>;
|
|
44
|
-
|
|
44
|
+
Body: ForwardRefExoticComponent<CardBodyProps & RefAttributes<HTMLDivElement>>;
|
|
45
45
|
Footer: ForwardRefExoticComponent<CardFooterProps & RefAttributes<HTMLDivElement>>;
|
|
46
46
|
}
|
|
47
47
|
export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
48
|
className?: string;
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
51
51
|
className?: string;
|
|
52
52
|
}
|
|
53
53
|
export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -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,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: {
|
|
@@ -8,7 +8,7 @@ import { drawerOverlayAnimations, getDrawerContentAnimations } from './Drawer.an
|
|
|
8
8
|
import { DrawerHeader } from './DrawerHeader.js';
|
|
9
9
|
import { DrawerTitle } from './DrawerTitle.js';
|
|
10
10
|
import { DrawerSubtitle } from './DrawerSubtitle.js';
|
|
11
|
-
import {
|
|
11
|
+
import { DrawerBody } from './DrawerBody.js';
|
|
12
12
|
import { DrawerFooter } from './DrawerFooter.js';
|
|
13
13
|
|
|
14
14
|
// Create context for Drawer components
|
|
@@ -43,7 +43,18 @@ const DrawerRoot = ({ isOpen, onClose, title, subtitle, icon, position = "right"
|
|
|
43
43
|
theme,
|
|
44
44
|
titleId,
|
|
45
45
|
subtitleId,
|
|
46
|
-
}), [
|
|
46
|
+
}), [
|
|
47
|
+
isOpen,
|
|
48
|
+
onClose,
|
|
49
|
+
position,
|
|
50
|
+
size,
|
|
51
|
+
closeOnOverlayClick,
|
|
52
|
+
closeOnEsc,
|
|
53
|
+
showCloseButton,
|
|
54
|
+
theme,
|
|
55
|
+
titleId,
|
|
56
|
+
subtitleId,
|
|
57
|
+
]);
|
|
47
58
|
// Detect if children contain a compound Drawer.Header
|
|
48
59
|
const hasCompoundHeader = React__default.Children.toArray(children).some((child) => {
|
|
49
60
|
var _a;
|
|
@@ -52,19 +63,27 @@ const DrawerRoot = ({ isOpen, onClose, title, subtitle, icon, position = "right"
|
|
|
52
63
|
});
|
|
53
64
|
// Auto-generate header when using prop shorthand (backward compat)
|
|
54
65
|
const shouldAutoRenderHeader = !hasCompoundHeader && (title || showCloseButton);
|
|
55
|
-
//
|
|
66
|
+
// Detect whether size is a preset token or an arbitrary Tailwind class
|
|
67
|
+
const SIZE_TOKENS = ["sm", "md", "lg", "full"];
|
|
68
|
+
const isSizeToken = SIZE_TOKENS.includes(size);
|
|
69
|
+
// Get size variant based on position (only for preset tokens)
|
|
56
70
|
const isHorizontal = position === "left" || position === "right";
|
|
57
|
-
const sizeVariant =
|
|
58
|
-
?
|
|
59
|
-
|
|
71
|
+
const sizeVariant = isSizeToken
|
|
72
|
+
? isHorizontal
|
|
73
|
+
? drawerSizeVariants.horizontal[size]
|
|
74
|
+
: drawerSizeVariants.vertical[size]
|
|
75
|
+
: size; // treat arbitrary string as a raw Tailwind class
|
|
60
76
|
// Use different positioning for full-width/height drawers
|
|
61
77
|
const positionVariant = size === "full"
|
|
62
78
|
? drawerPositionVariantsFullWidth[position]
|
|
63
79
|
: drawerPositionVariantsWithMargin[position];
|
|
64
|
-
return (jsx(Overlay, { isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "none", role: "dialog", ariaModal: true, ariaLabelledBy: titleId, ariaDescribedBy: subtitleId, contentClassName: cn(theme.container, positionVariant, size !== "full" && sizeVariant,
|
|
80
|
+
return (jsx(Overlay, { isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "none", role: "dialog", ariaModal: true, ariaLabelledBy: titleId, ariaDescribedBy: subtitleId, contentClassName: cn(theme.container, positionVariant, isSizeToken && size !== "full" && sizeVariant, !isSizeToken && sizeVariant, // raw Tailwind class
|
|
81
|
+
className), animations: {
|
|
65
82
|
overlay: drawerOverlayAnimations,
|
|
66
83
|
content: getDrawerContentAnimations(position),
|
|
67
|
-
}, ...props, children: jsx(DrawerContext.Provider, { value: contextValue, children: jsxs("div", { className: theme.inner, children: [shouldAutoRenderHeader && (jsxs(DrawerHeader, { icon: icon, children: [title &&
|
|
84
|
+
}, ...props, children: jsx(DrawerContext.Provider, { value: contextValue, children: jsxs("div", { className: theme.inner, children: [shouldAutoRenderHeader && (jsxs(DrawerHeader, { icon: icon, children: [title &&
|
|
85
|
+
(typeof title === "string" ? (jsx(DrawerTitle, { children: title })) : (title)), subtitle &&
|
|
86
|
+
(typeof subtitle === "string" ? (jsx(DrawerSubtitle, { children: subtitle })) : (subtitle))] })), children] }) }) }));
|
|
68
87
|
};
|
|
69
88
|
DrawerRoot.displayName = "Drawer";
|
|
70
89
|
// Attach compound subcomponents
|
|
@@ -72,7 +91,7 @@ const Drawer = Object.assign(DrawerRoot, {
|
|
|
72
91
|
Header: DrawerHeader,
|
|
73
92
|
Title: DrawerTitle,
|
|
74
93
|
Subtitle: DrawerSubtitle,
|
|
75
|
-
|
|
94
|
+
Body: DrawerBody,
|
|
76
95
|
Footer: DrawerFooter,
|
|
77
96
|
});
|
|
78
97
|
|
|
@@ -10,7 +10,7 @@ const drawerTheme = {
|
|
|
10
10
|
headerContent: "flex items-start gap-3 flex-1 min-w-0",
|
|
11
11
|
title: "text-lg font-semibold leading-6 text-[var(--color-text-primary)]",
|
|
12
12
|
subtitle: "text-base text-[var(--color-text-secondary)] mt-0.5",
|
|
13
|
-
|
|
13
|
+
body: "flex-1 overflow-y-auto p-4",
|
|
14
14
|
footer: "flex items-center justify-end gap-3 p-4 border-t border-[var(--color-border)] shrink-0 " +
|
|
15
15
|
"dark:border-[var(--color-border)]",
|
|
16
16
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
3
|
-
export type
|
|
3
|
+
export type DrawerSizeToken = "sm" | "md" | "lg" | "full";
|
|
4
|
+
/** Preset size token or any arbitrary Tailwind width/height class, e.g. `"w-80"`, `"w-[50vw]"` */
|
|
5
|
+
export type DrawerSize = DrawerSizeToken | (string & {});
|
|
4
6
|
export interface DrawerTheme {
|
|
5
7
|
overlay: string;
|
|
6
8
|
container: string;
|
|
@@ -9,7 +11,7 @@ export interface DrawerTheme {
|
|
|
9
11
|
headerContent: string;
|
|
10
12
|
title: string;
|
|
11
13
|
subtitle: string;
|
|
12
|
-
|
|
14
|
+
body: string;
|
|
13
15
|
footer: string;
|
|
14
16
|
}
|
|
15
17
|
export interface DrawerThemeOverrides {
|
|
@@ -20,7 +22,7 @@ export interface DrawerThemeOverrides {
|
|
|
20
22
|
headerContent?: string;
|
|
21
23
|
title?: string;
|
|
22
24
|
subtitle?: string;
|
|
23
|
-
|
|
25
|
+
body?: string;
|
|
24
26
|
footer?: string;
|
|
25
27
|
}
|
|
26
28
|
export interface DrawerContextValue {
|
|
@@ -39,9 +41,9 @@ export interface DrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
39
41
|
isOpen: boolean;
|
|
40
42
|
onClose: () => void;
|
|
41
43
|
/** Title text displayed in the drawer header */
|
|
42
|
-
title?:
|
|
44
|
+
title?: React.ReactNode;
|
|
43
45
|
/** Subtitle text displayed below the title */
|
|
44
|
-
subtitle?:
|
|
46
|
+
subtitle?: React.ReactNode;
|
|
45
47
|
/** Icon displayed to the left of the title/description */
|
|
46
48
|
icon?: React.ReactNode;
|
|
47
49
|
position?: DrawerPosition;
|
|
@@ -75,7 +77,7 @@ export interface DrawerSubtitleProps extends React.HTMLAttributes<HTMLParagraphE
|
|
|
75
77
|
children: React.ReactNode;
|
|
76
78
|
className?: string;
|
|
77
79
|
}
|
|
78
|
-
export interface
|
|
80
|
+
export interface DrawerBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
79
81
|
children: React.ReactNode;
|
|
80
82
|
className?: string;
|
|
81
83
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../../utils/cn.js';
|
|
3
|
+
import { useDrawerContext } from './Drawer.js';
|
|
4
|
+
|
|
5
|
+
const DrawerBody = ({ children, className, ...props }) => {
|
|
6
|
+
const { theme } = useDrawerContext();
|
|
7
|
+
return (jsx("div", { className: cn(theme.body, className), ...props, children: children }));
|
|
8
|
+
};
|
|
9
|
+
DrawerBody.displayName = "Drawer.Body";
|
|
10
|
+
|
|
11
|
+
export { DrawerBody };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { Drawer } from "./Drawer";
|
|
2
|
-
export
|
|
2
|
+
export { DrawerBody } from "./DrawerBody";
|
|
3
|
+
export type { DrawerProps, DrawerPosition, DrawerSize, DrawerThemeOverrides, DrawerHeaderProps, DrawerTitleProps, DrawerSubtitleProps, DrawerBodyProps, DrawerFooterProps, } from "./Drawer.types";
|
|
@@ -59,16 +59,16 @@ export interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
59
59
|
className?: string;
|
|
60
60
|
startContent?: ReactNode;
|
|
61
61
|
endContent?: ReactNode;
|
|
62
|
-
subtitle?:
|
|
62
|
+
subtitle?: ReactNode;
|
|
63
63
|
shortcut?: ReactNode;
|
|
64
64
|
isDisabled?: boolean;
|
|
65
65
|
isDanger?: boolean;
|
|
66
66
|
onAction?: () => void;
|
|
67
67
|
}
|
|
68
|
-
export interface DropdownSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
68
|
+
export interface DropdownSectionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
69
69
|
children: ReactNode;
|
|
70
70
|
className?: string;
|
|
71
|
-
title?:
|
|
71
|
+
title?: ReactNode;
|
|
72
72
|
showDivider?: boolean;
|
|
73
73
|
}
|
|
74
74
|
export interface DropdownSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -8,7 +8,9 @@ import { useDropdownContext } from './DropdownContext.js';
|
|
|
8
8
|
*/
|
|
9
9
|
const DropdownSection = React__default.forwardRef(({ children, className, title, showDivider = false, ...props }, ref) => {
|
|
10
10
|
const { theme } = useDropdownContext();
|
|
11
|
-
return (jsxs(Fragment, { children: [showDivider && jsx("div", { className: theme.separatorStyle, role: "separator" }), jsxs("div", { ref: ref, role: "group", "aria-label": title, className: cn(theme.sectionStyle, className), ...props, children: [title && (
|
|
11
|
+
return (jsxs(Fragment, { children: [showDivider && jsx("div", { className: theme.separatorStyle, role: "separator" }), jsxs("div", { ref: ref, role: "group", "aria-label": typeof title === 'string' ? title : undefined, className: cn(theme.sectionStyle, className), ...props, children: [title && (typeof title === 'string'
|
|
12
|
+
? jsx("div", { className: theme.sectionTitleStyle, role: "presentation", children: title })
|
|
13
|
+
: title), children] })] }));
|
|
12
14
|
});
|
|
13
15
|
DropdownSection.displayName = "DropdownSection";
|
|
14
16
|
|
|
@@ -26,7 +26,9 @@ const MenuItem = React__default.forwardRef(({ children, className, startContent,
|
|
|
26
26
|
handleClick();
|
|
27
27
|
}
|
|
28
28
|
}, [handleClick]);
|
|
29
|
-
return (jsxs("div", { ref: ref, role: role, tabIndex: disabled ? undefined : -1, "aria-disabled": disabled, "data-focused": isFocused, "data-disabled": disabled, className: cn(theme.baseStyle, theme.focusStyle, isDanger && theme.dangerStyle, className), onClick: handleClick, onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props, children: [startContent && (jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: startContent })), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsx("span", { className: "truncate", children: children }), shortcut && (jsx("span", { className: "ml-auto flex-shrink-0", children: shortcut }))] }), subtitle &&
|
|
29
|
+
return (jsxs("div", { ref: ref, role: role, tabIndex: disabled ? undefined : -1, "aria-disabled": disabled, "data-focused": isFocused, "data-disabled": disabled, className: cn(theme.baseStyle, theme.focusStyle, isDanger && theme.dangerStyle, className), onClick: handleClick, onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props, children: [startContent && (jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: startContent })), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsx("span", { className: "truncate", children: children }), shortcut && (jsx("span", { className: "ml-auto flex-shrink-0", children: shortcut }))] }), subtitle && (typeof subtitle === 'string'
|
|
30
|
+
? jsx("div", { className: theme.subtitleStyle, children: subtitle })
|
|
31
|
+
: subtitle)] }), endContent && (jsx("div", { className: "flex items-center justify-center ml-2", children: endContent }))] }));
|
|
30
32
|
});
|
|
31
33
|
MenuItem.displayName = "MenuItem";
|
|
32
34
|
|
|
@@ -10,7 +10,7 @@ export interface MenuItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
10
10
|
/** Icon or element at the end (right side) */
|
|
11
11
|
endContent?: ReactNode;
|
|
12
12
|
/** Secondary text below the label */
|
|
13
|
-
subtitle?:
|
|
13
|
+
subtitle?: ReactNode;
|
|
14
14
|
/** Keyboard shortcut display */
|
|
15
15
|
shortcut?: ReactNode;
|
|
16
16
|
/** Whether the item is disabled */
|