@eqtylab/equality 4.5.0 → 4.6.0
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/CHANGELOG.md +22 -0
- package/dist/dropdown-menu.module.module.css.module.css +5 -0
- package/dist/generated/color-vars.css +10 -0
- package/dist/generated/dark-tokens.css +4 -0
- package/dist/generated/global-dark-tokens.css +4 -0
- package/dist/generated/global-light-tokens.css +6 -0
- package/dist/generated/light-tokens.css +6 -0
- package/dist/generated/tailwind-tokens.css +6 -0
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/segmented-controls.module.module.css.module.css +23 -3
- package/dist/select.module.module.css.module.css +4 -4
- package/dist/theme-utilities.css +1 -0
- package/dist/theme.module.module.css.module.css +31 -11
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -772,6 +772,7 @@ declare const SectionHeading: ({ heading, description, renderRightContent, class
|
|
|
772
772
|
|
|
773
773
|
type SegmentedControlsDisplay = 'both' | 'text-only' | 'icon-only';
|
|
774
774
|
type SegmentedControlsSize = 'sm' | 'md' | 'lg';
|
|
775
|
+
type SegmentedControlVariant = 'primary' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
775
776
|
interface SegmentedControlOption {
|
|
776
777
|
/** Unique value used to identify the option. */
|
|
777
778
|
value: string;
|
|
@@ -781,6 +782,8 @@ interface SegmentedControlOption {
|
|
|
781
782
|
icon?: React$1.ReactElement | string;
|
|
782
783
|
/** Optional content rendered after the label. */
|
|
783
784
|
suffix?: React$1.ReactNode;
|
|
785
|
+
/** Colour of the indicator while this option is selected. */
|
|
786
|
+
variant?: SegmentedControlVariant;
|
|
784
787
|
}
|
|
785
788
|
interface SegmentedControlsProps {
|
|
786
789
|
options: SegmentedControlOption[];
|
|
@@ -1100,4 +1103,4 @@ declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
|
|
|
1100
1103
|
*/
|
|
1101
1104
|
declare const scheduleHighlight: (root?: Node) => Promise<void>;
|
|
1102
1105
|
|
|
1103
|
-
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, type SegmentedControlsSize, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
|
|
1106
|
+
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, type SegmentedControlVariant, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, type SegmentedControlsSize, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -772,6 +772,7 @@ declare const SectionHeading: ({ heading, description, renderRightContent, class
|
|
|
772
772
|
|
|
773
773
|
type SegmentedControlsDisplay = 'both' | 'text-only' | 'icon-only';
|
|
774
774
|
type SegmentedControlsSize = 'sm' | 'md' | 'lg';
|
|
775
|
+
type SegmentedControlVariant = 'primary' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
775
776
|
interface SegmentedControlOption {
|
|
776
777
|
/** Unique value used to identify the option. */
|
|
777
778
|
value: string;
|
|
@@ -781,6 +782,8 @@ interface SegmentedControlOption {
|
|
|
781
782
|
icon?: React$1.ReactElement | string;
|
|
782
783
|
/** Optional content rendered after the label. */
|
|
783
784
|
suffix?: React$1.ReactNode;
|
|
785
|
+
/** Colour of the indicator while this option is selected. */
|
|
786
|
+
variant?: SegmentedControlVariant;
|
|
784
787
|
}
|
|
785
788
|
interface SegmentedControlsProps {
|
|
786
789
|
options: SegmentedControlOption[];
|
|
@@ -1100,4 +1103,4 @@ declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
|
|
|
1100
1103
|
*/
|
|
1101
1104
|
declare const scheduleHighlight: (root?: Node) => Promise<void>;
|
|
1102
1105
|
|
|
1103
|
-
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, type SegmentedControlsSize, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
|
|
1106
|
+
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, type SegmentedControlVariant, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, type SegmentedControlsSize, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
|
package/dist/index.js
CHANGED
|
@@ -1853,6 +1853,12 @@ function handleListKeyDown(state, event, { searchSelector, itemSelector }) {
|
|
|
1853
1853
|
const edgeItem = event.key === "ArrowUp" ? items[0] : items[items.length - 1];
|
|
1854
1854
|
if (edgeItem && edgeItem === target?.closest(itemSelector)) {
|
|
1855
1855
|
event.preventDefault();
|
|
1856
|
+
if (event.key === "ArrowDown") {
|
|
1857
|
+
for (let el = target; el; el = el.parentElement) {
|
|
1858
|
+
el.scrollTop = 0;
|
|
1859
|
+
if (el === event.currentTarget) break;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1856
1862
|
state.requestFocus();
|
|
1857
1863
|
return;
|
|
1858
1864
|
}
|
|
@@ -3834,6 +3840,7 @@ var SegmentedControls = ({
|
|
|
3834
3840
|
const allHaveIcons = options.every((option) => option.icon != null);
|
|
3835
3841
|
const effectiveDisplay = display === "icon-only" && !allHaveIcons ? "both" : display;
|
|
3836
3842
|
const isIconOnly = effectiveDisplay === "icon-only";
|
|
3843
|
+
const activeVariant = options.find((option) => option.value === value)?.variant ?? "primary";
|
|
3837
3844
|
const containerRef = useRef(null);
|
|
3838
3845
|
const segmentRefs = useRef({});
|
|
3839
3846
|
const [indicator, setIndicator] = useState({
|
|
@@ -3865,7 +3872,12 @@ var SegmentedControls = ({
|
|
|
3865
3872
|
"div",
|
|
3866
3873
|
{
|
|
3867
3874
|
ref: containerRef,
|
|
3868
|
-
className: cn(
|
|
3875
|
+
className: cn(
|
|
3876
|
+
styles49["segmented-controls"],
|
|
3877
|
+
styles49[`size--${size}`],
|
|
3878
|
+
styles49[`variant--${activeVariant}`],
|
|
3879
|
+
className
|
|
3880
|
+
),
|
|
3869
3881
|
children: [
|
|
3870
3882
|
options.map((option) => {
|
|
3871
3883
|
const currentlyActive = option.value === value;
|