@mlw-packages/react-components 1.7.2 → 1.7.3

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/index.d.mts CHANGED
@@ -26,6 +26,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
27
27
  import { Drawer } from 'vaul';
28
28
  import * as PopoverPrimitive from '@radix-ui/react-popover';
29
+ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
29
30
 
30
31
  type ErrorMessageProps = {
31
32
  error?: string;
@@ -150,51 +151,6 @@ interface SelectPropsWithGroupItems<T extends string> extends DefaultSelectProps
150
151
  type SelectProps<T extends string> = SelectPropsWithItems<T> | SelectPropsWithGroupItems<T>;
151
152
  declare function Select<T extends string>({ items, groupItems, placeholder, onChange, error, testIds, }: SelectProps<T>): react_jsx_runtime.JSX.Element;
152
153
 
153
- interface ChartData {
154
- [key: string]: string | number | boolean | null | undefined;
155
- }
156
- interface XAxisConfig$1 {
157
- dataKey: string;
158
- label?: string;
159
- formatter?: (value: string | number) => string;
160
- autoLabel?: boolean;
161
- }
162
- type SeriesProp = {
163
- bar?: string[];
164
- line?: string[];
165
- area?: string[];
166
- };
167
- interface ChartProps {
168
- data: ChartData[];
169
- series?: SeriesProp;
170
- className?: string;
171
- chartMargin?: Partial<{
172
- top: number;
173
- right: number;
174
- left: number;
175
- bottom: number;
176
- }>;
177
- height?: number;
178
- width?: number | string;
179
- colors?: string[];
180
- gridColor?: string;
181
- showGrid?: boolean;
182
- showTooltip?: boolean;
183
- showLegend?: boolean;
184
- title?: string;
185
- titlePosition?: "left" | "center" | "right";
186
- showLabels?: boolean;
187
- labelMap?: Record<string, string>;
188
- xAxis?: XAxisConfig$1 | string;
189
- enableHighlights?: boolean;
190
- enableShowOnly?: boolean;
191
- enablePeriodsDropdown?: boolean;
192
- enableDraggableTooltips?: boolean;
193
- showTooltipTotal?: boolean;
194
- maxTooltips?: number;
195
- }
196
- declare const Chart: React__default.FC<ChartProps>;
197
-
198
154
  declare const formatFieldName: (fieldName: string) => string;
199
155
  declare const detectDataFields: (data: Record<string, unknown>[], xAxisKey: string) => string[];
200
156
  declare const detectXAxis: (data: Record<string, unknown>[]) => string;
@@ -239,7 +195,58 @@ type LabelRendererProps = {
239
195
  cx?: number | string;
240
196
  cy?: number | string;
241
197
  };
242
- declare const renderPillLabel: (color: string, variant: Variant) => (props: LabelRendererProps) => react_jsx_runtime.JSX.Element;
198
+ type valueFormatter = (props: {
199
+ value: number | string | undefined;
200
+ formattedValue: string;
201
+ [key: string]: unknown;
202
+ }) => string;
203
+ declare const renderPillLabel: (color: string, variant: Variant, valueFormatter?: valueFormatter) => (props: LabelRendererProps) => react_jsx_runtime.JSX.Element;
204
+
205
+ interface ChartData {
206
+ [key: string]: string | number | boolean | null | undefined;
207
+ }
208
+ interface XAxisConfig$1 {
209
+ dataKey: string;
210
+ label?: string;
211
+ valueFormatter?: (value: string | number) => string;
212
+ autoLabel?: boolean;
213
+ }
214
+ type SeriesProp = {
215
+ bar?: string[];
216
+ line?: string[];
217
+ area?: string[];
218
+ };
219
+ interface ChartProps {
220
+ data: ChartData[];
221
+ series?: SeriesProp;
222
+ className?: string;
223
+ chartMargin?: Partial<{
224
+ top: number;
225
+ right: number;
226
+ left: number;
227
+ bottom: number;
228
+ }>;
229
+ height?: number;
230
+ width?: number | string;
231
+ colors?: string[];
232
+ gridColor?: string;
233
+ showGrid?: boolean;
234
+ showTooltip?: boolean;
235
+ showLegend?: boolean;
236
+ title?: string;
237
+ titlePosition?: "left" | "center" | "right";
238
+ showLabels?: boolean;
239
+ labelMap?: Record<string, string>;
240
+ valueFormatter?: valueFormatter;
241
+ xAxis?: XAxisConfig$1 | string;
242
+ enableHighlights?: boolean;
243
+ enableShowOnly?: boolean;
244
+ enablePeriodsDropdown?: boolean;
245
+ enableDraggableTooltips?: boolean;
246
+ showTooltipTotal?: boolean;
247
+ maxTooltips?: number;
248
+ }
249
+ declare const Chart: React__default.FC<ChartProps>;
243
250
 
244
251
  interface BarChartData {
245
252
  [key: string]: string | number | boolean | null | undefined;
@@ -247,13 +254,13 @@ interface BarChartData {
247
254
  interface XAxisConfig {
248
255
  dataKey: string;
249
256
  label?: string;
250
- formatter?: (value: string | number) => string;
257
+ valueFormatter?: (value: string | number) => string;
251
258
  autoLabel?: boolean;
252
259
  }
253
260
  interface DataMapper {
254
261
  [dataKey: string]: {
255
262
  label?: string;
256
- formatter?: (value: string | number) => string | number;
263
+ valueFormatter?: (value: string | number) => string | number;
257
264
  color?: string;
258
265
  type?: "number" | "string" | "auto";
259
266
  visible?: boolean;
@@ -359,7 +366,7 @@ declare const ShowOnly: React__default.FC<Props$3>;
359
366
 
360
367
  interface MapperEntry {
361
368
  label?: string;
362
- formatter?: (value: string | number) => string | number;
369
+ valueFormatter?: (value: string | number) => string | number;
363
370
  color?: string;
364
371
  type?: string;
365
372
  visible?: boolean;
@@ -411,6 +418,7 @@ interface DraggableTooltipProps {
411
418
  highlightedSeries?: Set<string>;
412
419
  toggleHighlight?: (key: string) => void;
413
420
  showOnlyHighlighted?: boolean;
421
+ valueFormatter?: valueFormatter;
414
422
  }
415
423
  declare const DraggableTooltip: React__default.NamedExoticComponent<DraggableTooltipProps>;
416
424
 
@@ -427,6 +435,7 @@ interface Props$1 {
427
435
  finalColors?: Record<string, string>;
428
436
  periodLabel?: string;
429
437
  totalLabel?: string;
438
+ valueFormatter?: valueFormatter;
430
439
  }
431
440
  declare const RechartTooltipWithTotal: React__default.FC<Props$1>;
432
441
 
@@ -442,6 +451,7 @@ interface Props {
442
451
  label?: string;
443
452
  finalColors?: Record<string, string>;
444
453
  periodLabel?: string;
454
+ valueFormatter?: valueFormatter;
445
455
  }
446
456
  declare const TooltipSimple: React__default.FC<Props>;
447
457
 
@@ -1191,6 +1201,29 @@ interface TimePickerInputProps extends Omit<React__default.InputHTMLAttributes<H
1191
1201
  }
1192
1202
  declare const TimePickerInput: React__default.ForwardRefExoticComponent<TimePickerInputProps & React__default.RefAttributes<HTMLInputElement>>;
1193
1203
 
1204
+ declare function ContextMenuBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Root>): react_jsx_runtime.JSX.Element;
1205
+ declare function ContextMenuTriggerBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
1206
+ declare function ContextMenuGroupBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Group>): react_jsx_runtime.JSX.Element;
1207
+ declare function ContextMenuPortalBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Portal>): react_jsx_runtime.JSX.Element;
1208
+ declare function ContextMenuSubBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Sub>): react_jsx_runtime.JSX.Element;
1209
+ declare function ContextMenuRadioGroupBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): react_jsx_runtime.JSX.Element;
1210
+ declare function ContextMenuSubTriggerBase({ className, inset, children, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
1211
+ inset?: boolean;
1212
+ }): react_jsx_runtime.JSX.Element;
1213
+ declare function ContextMenuSubContentBase({ className, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.SubContent>): react_jsx_runtime.JSX.Element;
1214
+ declare function ContextMenuContentBase({ className, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Content>): react_jsx_runtime.JSX.Element;
1215
+ declare function ContextMenuItemBase({ className, inset, variant, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Item> & {
1216
+ inset?: boolean;
1217
+ variant?: "default" | "destructive";
1218
+ }): react_jsx_runtime.JSX.Element;
1219
+ declare function ContextMenuCheckboxItemBase({ className, children, checked, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): react_jsx_runtime.JSX.Element;
1220
+ declare function ContextMenuRadioItemBase({ className, children, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): react_jsx_runtime.JSX.Element;
1221
+ declare function ContextMenuLabelBase({ className, inset, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Label> & {
1222
+ inset?: boolean;
1223
+ }): react_jsx_runtime.JSX.Element;
1224
+ declare function ContextMenuSeparatorBase({ className, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Separator>): react_jsx_runtime.JSX.Element;
1225
+ declare function ContextMenuShortcutBase({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
1226
+
1194
1227
  declare function useIsMobile(): boolean;
1195
1228
 
1196
1229
  interface Position {
@@ -1210,4 +1243,4 @@ declare const useDrag: (options?: UseDragOptions) => {
1210
1243
  isDragging: boolean;
1211
1244
  };
1212
1245
 
1213
- export { AddButton, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, BackButton, BadgeBase, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, type CalendarProps, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPrevious, ChangeButton, Chart, CheckButton, CheckboxBase, CloseAllButton, CloseButton, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, CopyButton, DateTimePicker, type DebouncedInputProps, DeleteButton, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, EditButton, ErrorMessage, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getArrowByType, getDateByType, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, toast, useChartHighlights, useDrag, useIsMobile, useTheme };
1246
+ export { AddButton, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, BackButton, BadgeBase, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, type CalendarProps, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPrevious, ChangeButton, Chart, CheckButton, CheckboxBase, CloseAllButton, CloseButton, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, type DebouncedInputProps, DeleteButton, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, EditButton, ErrorMessage, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getArrowByType, getDateByType, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, toast, useChartHighlights, useDrag, useIsMobile, useTheme, type valueFormatter };
package/dist/index.d.ts CHANGED
@@ -26,6 +26,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
27
27
  import { Drawer } from 'vaul';
28
28
  import * as PopoverPrimitive from '@radix-ui/react-popover';
29
+ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
29
30
 
30
31
  type ErrorMessageProps = {
31
32
  error?: string;
@@ -150,51 +151,6 @@ interface SelectPropsWithGroupItems<T extends string> extends DefaultSelectProps
150
151
  type SelectProps<T extends string> = SelectPropsWithItems<T> | SelectPropsWithGroupItems<T>;
151
152
  declare function Select<T extends string>({ items, groupItems, placeholder, onChange, error, testIds, }: SelectProps<T>): react_jsx_runtime.JSX.Element;
152
153
 
153
- interface ChartData {
154
- [key: string]: string | number | boolean | null | undefined;
155
- }
156
- interface XAxisConfig$1 {
157
- dataKey: string;
158
- label?: string;
159
- formatter?: (value: string | number) => string;
160
- autoLabel?: boolean;
161
- }
162
- type SeriesProp = {
163
- bar?: string[];
164
- line?: string[];
165
- area?: string[];
166
- };
167
- interface ChartProps {
168
- data: ChartData[];
169
- series?: SeriesProp;
170
- className?: string;
171
- chartMargin?: Partial<{
172
- top: number;
173
- right: number;
174
- left: number;
175
- bottom: number;
176
- }>;
177
- height?: number;
178
- width?: number | string;
179
- colors?: string[];
180
- gridColor?: string;
181
- showGrid?: boolean;
182
- showTooltip?: boolean;
183
- showLegend?: boolean;
184
- title?: string;
185
- titlePosition?: "left" | "center" | "right";
186
- showLabels?: boolean;
187
- labelMap?: Record<string, string>;
188
- xAxis?: XAxisConfig$1 | string;
189
- enableHighlights?: boolean;
190
- enableShowOnly?: boolean;
191
- enablePeriodsDropdown?: boolean;
192
- enableDraggableTooltips?: boolean;
193
- showTooltipTotal?: boolean;
194
- maxTooltips?: number;
195
- }
196
- declare const Chart: React__default.FC<ChartProps>;
197
-
198
154
  declare const formatFieldName: (fieldName: string) => string;
199
155
  declare const detectDataFields: (data: Record<string, unknown>[], xAxisKey: string) => string[];
200
156
  declare const detectXAxis: (data: Record<string, unknown>[]) => string;
@@ -239,7 +195,58 @@ type LabelRendererProps = {
239
195
  cx?: number | string;
240
196
  cy?: number | string;
241
197
  };
242
- declare const renderPillLabel: (color: string, variant: Variant) => (props: LabelRendererProps) => react_jsx_runtime.JSX.Element;
198
+ type valueFormatter = (props: {
199
+ value: number | string | undefined;
200
+ formattedValue: string;
201
+ [key: string]: unknown;
202
+ }) => string;
203
+ declare const renderPillLabel: (color: string, variant: Variant, valueFormatter?: valueFormatter) => (props: LabelRendererProps) => react_jsx_runtime.JSX.Element;
204
+
205
+ interface ChartData {
206
+ [key: string]: string | number | boolean | null | undefined;
207
+ }
208
+ interface XAxisConfig$1 {
209
+ dataKey: string;
210
+ label?: string;
211
+ valueFormatter?: (value: string | number) => string;
212
+ autoLabel?: boolean;
213
+ }
214
+ type SeriesProp = {
215
+ bar?: string[];
216
+ line?: string[];
217
+ area?: string[];
218
+ };
219
+ interface ChartProps {
220
+ data: ChartData[];
221
+ series?: SeriesProp;
222
+ className?: string;
223
+ chartMargin?: Partial<{
224
+ top: number;
225
+ right: number;
226
+ left: number;
227
+ bottom: number;
228
+ }>;
229
+ height?: number;
230
+ width?: number | string;
231
+ colors?: string[];
232
+ gridColor?: string;
233
+ showGrid?: boolean;
234
+ showTooltip?: boolean;
235
+ showLegend?: boolean;
236
+ title?: string;
237
+ titlePosition?: "left" | "center" | "right";
238
+ showLabels?: boolean;
239
+ labelMap?: Record<string, string>;
240
+ valueFormatter?: valueFormatter;
241
+ xAxis?: XAxisConfig$1 | string;
242
+ enableHighlights?: boolean;
243
+ enableShowOnly?: boolean;
244
+ enablePeriodsDropdown?: boolean;
245
+ enableDraggableTooltips?: boolean;
246
+ showTooltipTotal?: boolean;
247
+ maxTooltips?: number;
248
+ }
249
+ declare const Chart: React__default.FC<ChartProps>;
243
250
 
244
251
  interface BarChartData {
245
252
  [key: string]: string | number | boolean | null | undefined;
@@ -247,13 +254,13 @@ interface BarChartData {
247
254
  interface XAxisConfig {
248
255
  dataKey: string;
249
256
  label?: string;
250
- formatter?: (value: string | number) => string;
257
+ valueFormatter?: (value: string | number) => string;
251
258
  autoLabel?: boolean;
252
259
  }
253
260
  interface DataMapper {
254
261
  [dataKey: string]: {
255
262
  label?: string;
256
- formatter?: (value: string | number) => string | number;
263
+ valueFormatter?: (value: string | number) => string | number;
257
264
  color?: string;
258
265
  type?: "number" | "string" | "auto";
259
266
  visible?: boolean;
@@ -359,7 +366,7 @@ declare const ShowOnly: React__default.FC<Props$3>;
359
366
 
360
367
  interface MapperEntry {
361
368
  label?: string;
362
- formatter?: (value: string | number) => string | number;
369
+ valueFormatter?: (value: string | number) => string | number;
363
370
  color?: string;
364
371
  type?: string;
365
372
  visible?: boolean;
@@ -411,6 +418,7 @@ interface DraggableTooltipProps {
411
418
  highlightedSeries?: Set<string>;
412
419
  toggleHighlight?: (key: string) => void;
413
420
  showOnlyHighlighted?: boolean;
421
+ valueFormatter?: valueFormatter;
414
422
  }
415
423
  declare const DraggableTooltip: React__default.NamedExoticComponent<DraggableTooltipProps>;
416
424
 
@@ -427,6 +435,7 @@ interface Props$1 {
427
435
  finalColors?: Record<string, string>;
428
436
  periodLabel?: string;
429
437
  totalLabel?: string;
438
+ valueFormatter?: valueFormatter;
430
439
  }
431
440
  declare const RechartTooltipWithTotal: React__default.FC<Props$1>;
432
441
 
@@ -442,6 +451,7 @@ interface Props {
442
451
  label?: string;
443
452
  finalColors?: Record<string, string>;
444
453
  periodLabel?: string;
454
+ valueFormatter?: valueFormatter;
445
455
  }
446
456
  declare const TooltipSimple: React__default.FC<Props>;
447
457
 
@@ -1191,6 +1201,29 @@ interface TimePickerInputProps extends Omit<React__default.InputHTMLAttributes<H
1191
1201
  }
1192
1202
  declare const TimePickerInput: React__default.ForwardRefExoticComponent<TimePickerInputProps & React__default.RefAttributes<HTMLInputElement>>;
1193
1203
 
1204
+ declare function ContextMenuBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Root>): react_jsx_runtime.JSX.Element;
1205
+ declare function ContextMenuTriggerBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
1206
+ declare function ContextMenuGroupBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Group>): react_jsx_runtime.JSX.Element;
1207
+ declare function ContextMenuPortalBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Portal>): react_jsx_runtime.JSX.Element;
1208
+ declare function ContextMenuSubBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.Sub>): react_jsx_runtime.JSX.Element;
1209
+ declare function ContextMenuRadioGroupBase(props: React$1.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): react_jsx_runtime.JSX.Element;
1210
+ declare function ContextMenuSubTriggerBase({ className, inset, children, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
1211
+ inset?: boolean;
1212
+ }): react_jsx_runtime.JSX.Element;
1213
+ declare function ContextMenuSubContentBase({ className, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.SubContent>): react_jsx_runtime.JSX.Element;
1214
+ declare function ContextMenuContentBase({ className, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Content>): react_jsx_runtime.JSX.Element;
1215
+ declare function ContextMenuItemBase({ className, inset, variant, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Item> & {
1216
+ inset?: boolean;
1217
+ variant?: "default" | "destructive";
1218
+ }): react_jsx_runtime.JSX.Element;
1219
+ declare function ContextMenuCheckboxItemBase({ className, children, checked, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): react_jsx_runtime.JSX.Element;
1220
+ declare function ContextMenuRadioItemBase({ className, children, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): react_jsx_runtime.JSX.Element;
1221
+ declare function ContextMenuLabelBase({ className, inset, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Label> & {
1222
+ inset?: boolean;
1223
+ }): react_jsx_runtime.JSX.Element;
1224
+ declare function ContextMenuSeparatorBase({ className, ...props }: React$1.ComponentProps<typeof ContextMenuPrimitive.Separator>): react_jsx_runtime.JSX.Element;
1225
+ declare function ContextMenuShortcutBase({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
1226
+
1194
1227
  declare function useIsMobile(): boolean;
1195
1228
 
1196
1229
  interface Position {
@@ -1210,4 +1243,4 @@ declare const useDrag: (options?: UseDragOptions) => {
1210
1243
  isDragging: boolean;
1211
1244
  };
1212
1245
 
1213
- export { AddButton, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, BackButton, BadgeBase, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, type CalendarProps, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPrevious, ChangeButton, Chart, CheckButton, CheckboxBase, CloseAllButton, CloseButton, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, CopyButton, DateTimePicker, type DebouncedInputProps, DeleteButton, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, EditButton, ErrorMessage, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getArrowByType, getDateByType, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, toast, useChartHighlights, useDrag, useIsMobile, useTheme };
1246
+ export { AddButton, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, BackButton, BadgeBase, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, type CalendarProps, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPrevious, ChangeButton, Chart, CheckButton, CheckboxBase, CloseAllButton, CloseButton, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, type DebouncedInputProps, DeleteButton, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, EditButton, ErrorMessage, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getArrowByType, getDateByType, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, toast, useChartHighlights, useDrag, useIsMobile, useTheme, type valueFormatter };