@shipfox/react-ui 0.32.0 → 0.32.1
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/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/command/command.d.ts +2 -2
- package/dist/components/command/command.js +1 -1
- package/dist/components/dashboard/components/charts/bar-chart.js +4 -0
- package/dist/components/dashboard/components/charts/chart-tooltip.js +1 -1
- package/dist/components/dashboard/components/charts/line-chart.js +4 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/form/form.js +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/inline-tips/inline-tips.d.ts +1 -1
- package/dist/components/inline-tips/inline-tips.js +1 -1
- package/dist/components/modal/modal.d.ts +2 -2
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +1 -1
- package/dist/components/sheet/sheet.d.ts +2 -2
- package/dist/components/sheet/sheet.js +1 -1
- package/dist/components/shiny-text/shiny-text.d.ts +1 -1
- package/dist/components/shipql-editor/lexical/shipql-plugin.d.ts +1 -1
- package/dist/components/shipql-editor/lexical/shipql-plugin.js +2 -2
- package/dist/components/shipql-editor/suggestions/shipql-range-facet-panel.js +18 -15
- package/dist/components/shipql-editor/suggestions/types.d.ts +4 -2
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/toast/toast.d.ts +1 -1
- package/dist/components/toast/toast.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/dropdown-input/dropdown-input.d.ts +0 -25
- package/dist/components/dropdown-input/dropdown-input.js +0 -188
- package/dist/components/dropdown-input/index.d.ts +0 -2
- package/dist/components/dropdown-input/index.js +0 -3
|
@@ -23,6 +23,6 @@ declare function AlertDescription({ className, ...props }: ComponentProps<'div'>
|
|
|
23
23
|
declare function AlertActions({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
declare function AlertAction({ className, ...props }: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
declare function AlertClose({ className, variant: variantProp, onClick, ...props }: ComponentProps<'button'> & VariantProps<typeof closeIconVariants>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export { Alert, AlertContent, AlertTitle, AlertDescription, AlertActions, AlertAction, AlertClose, alertDefaultTransition, };
|
|
27
26
|
export type { AlertProps };
|
|
27
|
+
export { Alert, AlertAction, AlertActions, AlertClose, AlertContent, AlertDescription, AlertTitle, alertDefaultTransition, };
|
|
28
28
|
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -218,6 +218,6 @@ function AlertClose({ className, variant: variantProp, onClick, ...props }) {
|
|
|
218
218
|
})
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
-
export { Alert,
|
|
221
|
+
export { Alert, AlertAction, AlertActions, AlertClose, AlertContent, AlertDescription, AlertTitle, alertDefaultTransition };
|
|
222
222
|
|
|
223
223
|
//# sourceMappingURL=alert.js.map
|
|
@@ -20,5 +20,5 @@ export type AvatarProps = ComponentProps<typeof AvatarPrimitive.Root> & VariantP
|
|
|
20
20
|
logoClassName?: string;
|
|
21
21
|
};
|
|
22
22
|
export declare function Avatar({ className, radius, size, content, src, alt, fallback, animateOnHover, logoName, logoClassName, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {
|
|
23
|
+
export { AvatarFallback, AvatarImage, AvatarRoot };
|
|
24
24
|
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -160,6 +160,6 @@ export function Avatar({ className, radius, size = 'md', content = 'letters', sr
|
|
|
160
160
|
children: renderContent()
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
export {
|
|
163
|
+
export { AvatarFallback, AvatarImage, AvatarRoot };
|
|
164
164
|
|
|
165
165
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -24,6 +24,6 @@ declare function CommandGroup({ className, ...props }: ComponentProps<typeof Com
|
|
|
24
24
|
declare function CommandSeparator({ className, ...props }: ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
declare function CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
declare function CommandShortcut({ className, children, ...props }: ComponentProps<typeof Kbd>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export {
|
|
28
|
-
export
|
|
27
|
+
export type { CommandInputProps, CommandTriggerProps };
|
|
28
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommandTrigger, commandTriggerVariants, };
|
|
29
29
|
//# sourceMappingURL=command.d.ts.map
|
|
@@ -189,6 +189,6 @@ function CommandShortcut({ className, children, ...props }) {
|
|
|
189
189
|
children: children
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
export { Command,
|
|
192
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommandTrigger, commandTriggerVariants };
|
|
193
193
|
|
|
194
194
|
//# sourceMappingURL=command.js.map
|
|
@@ -46,6 +46,10 @@ export function BarChart({ data, bars, height = 200, xAxis, yAxis, grid, tooltip
|
|
|
46
46
|
/*#__PURE__*/ _jsx(ResponsiveContainer, {
|
|
47
47
|
width: "100%",
|
|
48
48
|
height: "100%",
|
|
49
|
+
initialDimension: {
|
|
50
|
+
width: 320,
|
|
51
|
+
height: 200
|
|
52
|
+
},
|
|
49
53
|
children: /*#__PURE__*/ _jsxs(RechartsBarChart, {
|
|
50
54
|
data: isEmpty ? [] : data,
|
|
51
55
|
margin: {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Text } from '../../../../components/typography/index.js';
|
|
3
3
|
import { cn } from '../../../../utils/cn.js';
|
|
4
4
|
export function ChartTooltipContent({ active, label, payload, hoveredDataKey, labelFormatter }) {
|
|
5
|
-
const isVisible = active && payload
|
|
5
|
+
const isVisible = active && payload?.length;
|
|
6
6
|
if (!isVisible) return null;
|
|
7
7
|
return /*#__PURE__*/ _jsxs("div", {
|
|
8
8
|
className: "flex flex-col gap-4 rounded-8 p-12 bg-background-neutral-overlay border border-border-neutral-base shadow-lg",
|
|
@@ -41,6 +41,10 @@ export function LineChart({ data, lines, height = 200, xAxis, yAxis, grid, toolt
|
|
|
41
41
|
/*#__PURE__*/ _jsx(ResponsiveContainer, {
|
|
42
42
|
width: "100%",
|
|
43
43
|
height: "100%",
|
|
44
|
+
initialDimension: {
|
|
45
|
+
width: 320,
|
|
46
|
+
height: 200
|
|
47
|
+
},
|
|
44
48
|
children: /*#__PURE__*/ _jsxs(RechartsLineChart, {
|
|
45
49
|
data: isEmpty ? [] : data,
|
|
46
50
|
margin: {
|
|
@@ -53,6 +53,6 @@ type DropdownMenuSubTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.S
|
|
|
53
53
|
};
|
|
54
54
|
declare function DropdownMenuSubTrigger({ className, inset, icon, children, ...props }: DropdownMenuSubTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
55
55
|
declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
56
|
-
export {
|
|
57
|
-
export
|
|
56
|
+
export type { DropdownMenuCheckboxItemProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuRadioItemProps, DropdownMenuShortcutProps, DropdownMenuSubTriggerProps, };
|
|
57
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, dropdownMenuContentVariants, dropdownMenuItemVariants, dropdownMenuLabelVariants, };
|
|
58
58
|
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -275,6 +275,6 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
275
275
|
...props
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
|
-
export { DropdownMenu,
|
|
278
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, dropdownMenuContentVariants, dropdownMenuItemVariants, dropdownMenuLabelVariants };
|
|
279
279
|
|
|
280
280
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -7,5 +7,5 @@ declare const FormLabel: React.ForwardRefExoticComponent<Omit<import("@radix-ui/
|
|
|
7
7
|
declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
8
8
|
declare const FormDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
9
|
declare const FormMessage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
10
|
-
export { Form,
|
|
10
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage };
|
|
11
11
|
//# sourceMappingURL=form.d.ts.map
|
|
@@ -101,6 +101,6 @@ const FormMessage = /*#__PURE__*/ React.forwardRef(({ className, children, ...pr
|
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
FormMessage.displayName = 'FormMessage';
|
|
104
|
-
export { Form,
|
|
104
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage };
|
|
105
105
|
|
|
106
106
|
//# sourceMappingURL=form.js.map
|
|
@@ -15,7 +15,6 @@ export * from './dashboard';
|
|
|
15
15
|
export * from './date-picker';
|
|
16
16
|
export * from './date-time-range-picker';
|
|
17
17
|
export * from './dot-grid';
|
|
18
|
-
export * from './dropdown-input';
|
|
19
18
|
export * from './dropdown-menu';
|
|
20
19
|
export * from './dynamic-item';
|
|
21
20
|
export * from './empty-state';
|
package/dist/components/index.js
CHANGED
|
@@ -15,7 +15,6 @@ export * from './dashboard/index.js';
|
|
|
15
15
|
export * from './date-picker/index.js';
|
|
16
16
|
export * from './date-time-range-picker/index.js';
|
|
17
17
|
export * from './dot-grid/index.js';
|
|
18
|
-
export * from './dropdown-input/index.js';
|
|
19
18
|
export * from './dropdown-menu/index.js';
|
|
20
19
|
export * from './dynamic-item/index.js';
|
|
21
20
|
export * from './empty-state/index.js';
|
|
@@ -15,5 +15,5 @@ declare const inlineTipsActionVariants: (props?: ({
|
|
|
15
15
|
variant?: "primary" | "secondary" | null | undefined;
|
|
16
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
17
|
declare function InlineTipsAction({ className, variant, ...props }: ComponentProps<'button'> & VariantProps<typeof inlineTipsActionVariants>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export { InlineTips,
|
|
18
|
+
export { InlineTips, InlineTipsAction, InlineTipsActions, InlineTipsContent, InlineTipsDescription, InlineTipsTitle, };
|
|
19
19
|
//# sourceMappingURL=inline-tips.d.ts.map
|
|
@@ -93,6 +93,6 @@ function InlineTipsAction({ className, variant, ...props }) {
|
|
|
93
93
|
...props
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
export { InlineTips,
|
|
96
|
+
export { InlineTips, InlineTipsAction, InlineTipsActions, InlineTipsContent, InlineTipsDescription, InlineTipsTitle };
|
|
97
97
|
|
|
98
98
|
//# sourceMappingURL=inline-tips.js.map
|
|
@@ -41,6 +41,6 @@ type ModalBodyHeaderProps = ComponentProps<'div'> & {
|
|
|
41
41
|
children?: ReactNode;
|
|
42
42
|
};
|
|
43
43
|
declare function ModalBodyHeader({ className, src, alt, title, description, children, ...props }: ModalBodyHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
export {
|
|
45
|
-
export
|
|
44
|
+
export type { ModalBodyHeaderProps, ModalContentProps, ModalDescriptionProps, ModalHeaderProps, ModalOverlayProps, ModalTitleProps, };
|
|
45
|
+
export { Modal, ModalBody, ModalBodyHeader, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, modalContentVariants, modalDefaultTransition, modalOverlayVariants, };
|
|
46
46
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -288,6 +288,6 @@ function ModalBodyHeader({ className, src, alt = '', title, description, childre
|
|
|
288
288
|
]
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
export { Modal,
|
|
291
|
+
export { Modal, ModalBody, ModalBodyHeader, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, modalContentVariants, modalDefaultTransition, modalOverlayVariants };
|
|
292
292
|
|
|
293
293
|
//# sourceMappingURL=modal.js.map
|
|
@@ -8,5 +8,5 @@ declare function PopoverContent({ className, align, sideOffset, container, ...pr
|
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare function PopoverArrow({ className, ...props }: ComponentProps<typeof PopoverPrimitive.Arrow>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare function PopoverClose({ ...props }: ComponentProps<typeof PopoverPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export { Popover,
|
|
11
|
+
export { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger };
|
|
12
12
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -43,6 +43,6 @@ function PopoverClose({ ...props }) {
|
|
|
43
43
|
...props
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
export { Popover,
|
|
46
|
+
export { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger };
|
|
47
47
|
|
|
48
48
|
//# sourceMappingURL=popover.js.map
|
|
@@ -22,6 +22,6 @@ type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & {
|
|
|
22
22
|
};
|
|
23
23
|
declare function SelectItem({ className, children, icon, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
declare function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export {
|
|
26
|
-
export
|
|
25
|
+
export type { SelectItemProps, SelectTriggerProps };
|
|
26
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, selectTriggerVariants, };
|
|
27
27
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -149,6 +149,6 @@ function SelectSeparator({ className, ...props }) {
|
|
|
149
149
|
...props
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
export { Select,
|
|
152
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, selectTriggerVariants };
|
|
153
153
|
|
|
154
154
|
//# sourceMappingURL=select.js.map
|
|
@@ -28,6 +28,6 @@ type SheetDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
|
|
|
28
28
|
declare function SheetDescription({ className, ...props }: SheetDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
type SheetBodyProps = ComponentProps<'div'>;
|
|
30
30
|
declare function SheetBody({ className, children, ...props }: SheetBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export {
|
|
32
|
-
export
|
|
31
|
+
export type { SheetBodyProps, SheetContentProps, SheetDescriptionProps, SheetFooterProps, SheetHeaderProps, SheetOverlayProps, SheetTitleProps, };
|
|
32
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, sheetContentVariants, sheetOverlayVariants, };
|
|
33
33
|
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -158,6 +158,6 @@ function SheetBody({ className, children, ...props }) {
|
|
|
158
158
|
children: children
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
export { Sheet,
|
|
161
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, sheetContentVariants, sheetOverlayVariants };
|
|
162
162
|
|
|
163
163
|
//# sourceMappingURL=sheet.js.map
|
|
@@ -5,6 +5,6 @@ type ShinyTextProps = {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
};
|
|
7
7
|
declare function ShinyText({ text, disabled, speed, className }: ShinyTextProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export { ShinyText };
|
|
9
8
|
export type { ShinyTextProps };
|
|
9
|
+
export { ShinyText };
|
|
10
10
|
//# sourceMappingURL=shiny-text.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { type LeafAstNode } from './shipql-leaf-node';
|
|
|
3
3
|
export declare const REMOVE_LEAF_COMMAND: import("lexical").LexicalCommand<string>;
|
|
4
4
|
interface ShipQLPluginProps {
|
|
5
5
|
onLeafFocus?: (node: LeafAstNode | null) => void;
|
|
6
|
-
formatLeafDisplay?: (source: string) => string;
|
|
6
|
+
formatLeafDisplay?: (source: string, node: LeafAstNode) => string;
|
|
7
7
|
}
|
|
8
8
|
export declare function ShipQLPlugin({ onLeafFocus, formatLeafDisplay }: ShipQLPluginProps): null;
|
|
9
9
|
export {};
|
|
@@ -236,7 +236,7 @@ export function ShipQLPlugin({ onLeafFocus, formatLeafDisplay }) {
|
|
|
236
236
|
if (!para) return;
|
|
237
237
|
para.clear();
|
|
238
238
|
const fmt = formatLeafDisplayRef.current;
|
|
239
|
-
const newNodes = nextSegments.map((seg)=>seg.kind === 'leaf' ? $createShipQLLeafNode(seg.text, seg.node, fmt?.(seg.text)) : $createTextNode(seg.text));
|
|
239
|
+
const newNodes = nextSegments.map((seg)=>seg.kind === 'leaf' ? $createShipQLLeafNode(seg.text, seg.node, fmt?.(seg.text, seg.node)) : $createTextNode(seg.text));
|
|
240
240
|
for (const node of newNodes)para.append(node);
|
|
241
241
|
// Restore cursor to the same absolute character position.
|
|
242
242
|
if (savedOffset >= 0 && newNodes.length > 0) {
|
|
@@ -279,7 +279,7 @@ export function ShipQLPlugin({ onLeafFocus, formatLeafDisplay }) {
|
|
|
279
279
|
const fmt = formatLeafDisplayRef.current;
|
|
280
280
|
para.clear();
|
|
281
281
|
for (const seg of segments){
|
|
282
|
-
para.append(seg.kind === 'leaf' ? $createShipQLLeafNode(seg.text, seg.node, fmt?.(seg.text)) : $createTextNode(seg.text));
|
|
282
|
+
para.append(seg.kind === 'leaf' ? $createShipQLLeafNode(seg.text, seg.node, fmt?.(seg.text, seg.node)) : $createTextNode(seg.text));
|
|
283
283
|
}
|
|
284
284
|
});
|
|
285
285
|
return ()=>{
|
|
@@ -10,14 +10,14 @@ const RANGE_OP_RE = /^([<>]=?)(.+)$/;
|
|
|
10
10
|
function formatRangeDisplay(raw, fmt) {
|
|
11
11
|
const bracketMatch = RANGE_BRACKET_RE.exec(raw);
|
|
12
12
|
if (bracketMatch) {
|
|
13
|
-
const min =
|
|
14
|
-
const max =
|
|
15
|
-
if (
|
|
13
|
+
const min = bracketMatch[1];
|
|
14
|
+
const max = bracketMatch[2];
|
|
15
|
+
if (min && max) return `[${fmt(min)} TO ${fmt(max)}]`;
|
|
16
16
|
}
|
|
17
17
|
const opMatch = RANGE_OP_RE.exec(raw);
|
|
18
18
|
if (opMatch) {
|
|
19
|
-
const v =
|
|
20
|
-
if (
|
|
19
|
+
const v = opMatch[2];
|
|
20
|
+
if (v) return `${opMatch[1]}${fmt(v)}`;
|
|
21
21
|
}
|
|
22
22
|
return raw;
|
|
23
23
|
}
|
|
@@ -88,21 +88,21 @@ export function ShipQLRangeFacetPanel({ facetName, config, onApply, isSelectingR
|
|
|
88
88
|
selectedPresetIndexRef.current = selectedPresetIndex;
|
|
89
89
|
const presetRowRefs = useRef([]);
|
|
90
90
|
// Local string state for inputs so mid-edit typing isn't clamped
|
|
91
|
-
const [minText, setMinText] = useState(fmt(absMin));
|
|
92
|
-
const [maxText, setMaxText] = useState(fmt(absMax));
|
|
91
|
+
const [minText, setMinText] = useState(fmt(String(absMin)));
|
|
92
|
+
const [maxText, setMaxText] = useState(fmt(String(absMax)));
|
|
93
93
|
const [isEditingMin, setIsEditingMin] = useState(false);
|
|
94
94
|
const [isEditingMax, setIsEditingMax] = useState(false);
|
|
95
95
|
const [lo, hi] = sliderValues;
|
|
96
96
|
// Keep input text in sync when slider moves (only when not actively editing)
|
|
97
97
|
useEffect(()=>{
|
|
98
|
-
if (!isEditingMin) setMinText(fmt(lo));
|
|
98
|
+
if (!isEditingMin) setMinText(fmt(String(lo)));
|
|
99
99
|
}, [
|
|
100
100
|
lo,
|
|
101
101
|
fmt,
|
|
102
102
|
isEditingMin
|
|
103
103
|
]);
|
|
104
104
|
useEffect(()=>{
|
|
105
|
-
if (!isEditingMax) setMaxText(fmt(hi));
|
|
105
|
+
if (!isEditingMax) setMaxText(fmt(String(hi)));
|
|
106
106
|
}, [
|
|
107
107
|
hi,
|
|
108
108
|
fmt,
|
|
@@ -118,7 +118,7 @@ export function ShipQLRangeFacetPanel({ facetName, config, onApply, isSelectingR
|
|
|
118
118
|
hi
|
|
119
119
|
]);
|
|
120
120
|
}
|
|
121
|
-
setMinText(fmt(lo));
|
|
121
|
+
setMinText(fmt(String(lo)));
|
|
122
122
|
}, [
|
|
123
123
|
absMin,
|
|
124
124
|
hi,
|
|
@@ -135,7 +135,7 @@ export function ShipQLRangeFacetPanel({ facetName, config, onApply, isSelectingR
|
|
|
135
135
|
clamped
|
|
136
136
|
]);
|
|
137
137
|
}
|
|
138
|
-
setMaxText(fmt(hi));
|
|
138
|
+
setMaxText(fmt(String(hi)));
|
|
139
139
|
}, [
|
|
140
140
|
absMax,
|
|
141
141
|
lo,
|
|
@@ -166,10 +166,12 @@ export function ShipQLRangeFacetPanel({ facetName, config, onApply, isSelectingR
|
|
|
166
166
|
isSelectingRef
|
|
167
167
|
]);
|
|
168
168
|
const addLabel = useMemo(()=>{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (hi === absMax) return `Add ">=${
|
|
172
|
-
return `Add "
|
|
169
|
+
const fmtLo = fmt(String(lo));
|
|
170
|
+
const fmtHi = fmt(String(hi));
|
|
171
|
+
if (lo === absMin && hi === absMax) return `Add ">=${fmtLo},<=${fmtHi}"`;
|
|
172
|
+
if (lo === absMin) return `Add "<=${fmtHi}"`;
|
|
173
|
+
if (hi === absMax) return `Add ">=${fmtLo}"`;
|
|
174
|
+
return `Add ">=${fmtLo},<=${fmtHi}"`;
|
|
173
175
|
}, [
|
|
174
176
|
lo,
|
|
175
177
|
hi,
|
|
@@ -302,6 +304,7 @@ export function ShipQLRangeFacetPanel({ facetName, config, onApply, isSelectingR
|
|
|
302
304
|
className: "flex-1",
|
|
303
305
|
min: absMin,
|
|
304
306
|
max: absMax,
|
|
307
|
+
step: config.step,
|
|
305
308
|
value: sliderValues,
|
|
306
309
|
onValueChange: (vals)=>{
|
|
307
310
|
const newLo = vals[0];
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import type { AstNode } from '@shipfox/shipql-parser';
|
|
1
2
|
export interface RangeFacetConfig {
|
|
2
3
|
type: 'range';
|
|
3
4
|
min: string;
|
|
4
5
|
max: string;
|
|
6
|
+
step?: number;
|
|
5
7
|
presets?: string[];
|
|
6
|
-
format?: (value:
|
|
8
|
+
format?: (value: string) => string;
|
|
7
9
|
}
|
|
8
10
|
export type FacetDef = string | {
|
|
9
11
|
name: string;
|
|
10
12
|
config: RangeFacetConfig;
|
|
11
13
|
};
|
|
12
|
-
export type FormatLeafDisplay = (source: string) => string;
|
|
14
|
+
export type FormatLeafDisplay = (source: string, node: AstNode) => string;
|
|
13
15
|
export interface SuggestionItem {
|
|
14
16
|
value: string;
|
|
15
17
|
label: React.ReactNode;
|
|
@@ -7,5 +7,5 @@ declare function TableRow({ className, ...props }: ComponentProps<'tr'>): import
|
|
|
7
7
|
declare function TableHead({ className, ...props }: ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare function TableCell({ className, ...props }: ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare function TableCaption({ className, ...props }: ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export { Table,
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
11
11
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -60,6 +60,6 @@ function TableCaption({ className, ...props }) {
|
|
|
60
60
|
...props
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
export { Table,
|
|
63
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
64
64
|
|
|
65
65
|
//# sourceMappingURL=table.js.map
|
|
@@ -46,5 +46,5 @@ type TabsContentProps = ComponentProps<'div'> & {
|
|
|
46
46
|
children: ReactNode;
|
|
47
47
|
};
|
|
48
48
|
declare function TabsContent({ children, value, className, ...props }: TabsContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
49
|
-
export { Tabs,
|
|
49
|
+
export { Tabs, TabsContent, type TabsContentProps, TabsContents, type TabsContentsProps, type TabsContextType, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, useTabs, };
|
|
50
50
|
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -238,6 +238,6 @@ function TabsContent({ children, value, className, ...props }) {
|
|
|
238
238
|
children: children
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
export { Tabs,
|
|
241
|
+
export { Tabs, TabsContent, TabsContents, TabsList, TabsTrigger, useTabs };
|
|
242
242
|
|
|
243
243
|
//# sourceMappingURL=tabs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ToasterProps as SonnerToasterProps, toast as sonnerToast } from 'sonner';
|
|
2
2
|
type ToasterProps = Omit<SonnerToasterProps, 'theme'>;
|
|
3
3
|
declare function Toaster({ ...props }: ToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export {
|
|
4
|
+
export { sonnerToast as toast, Toaster, type ToasterProps };
|
|
5
5
|
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -15,6 +15,6 @@ type TooltipContentProps = ComponentProps<typeof TooltipPrimitive.Content> & Var
|
|
|
15
15
|
transition?: Transition;
|
|
16
16
|
};
|
|
17
17
|
declare function TooltipContent({ className, sideOffset, children, variant, size, animated, transition, ...props }: TooltipContentProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, tooltipContentVariants, defaultTransition, };
|
|
19
18
|
export type { TooltipContentProps };
|
|
19
|
+
export { defaultTransition, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, tooltipContentVariants, };
|
|
20
20
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -93,6 +93,6 @@ function TooltipContent({ className, sideOffset = 8, children, variant, size, an
|
|
|
93
93
|
})
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
export {
|
|
96
|
+
export { defaultTransition, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, tooltipContentVariants };
|
|
97
97
|
|
|
98
98
|
//# sourceMappingURL=tooltip.js.map
|