@eqtylab/equality 3.3.1 → 3.4.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/dist/index.d.cts CHANGED
@@ -273,8 +273,9 @@ interface CodeBlockProps {
273
273
  variant?: 'neutral' | 'primary' | 'success' | 'danger' | 'warning';
274
274
  codeLabel?: string;
275
275
  copy?: string;
276
+ lineNumbers?: boolean;
276
277
  }
277
- declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
278
+ declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, lineNumbers, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
278
279
 
279
280
  declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
280
281
  declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
@@ -927,7 +928,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
927
928
 
928
929
  declare const iconVariants: (props?: ({
929
930
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
930
- background?: "circle" | "square" | "transparent" | null | undefined;
931
+ background?: "square" | "circle" | "transparent" | null | undefined;
931
932
  } & class_variance_authority_types.ClassProp) | undefined) => string;
932
933
  declare const iconElevationVariants: (props?: ({
933
934
  elevation?: string | number | null | undefined;
@@ -1005,4 +1006,23 @@ declare const PortalContainerProvider: ({ container, children }: PortalContainer
1005
1006
 
1006
1007
  declare const useTheme: () => readonly [Theme$1 | undefined, (theme: Theme$1) => void];
1007
1008
 
1008
- 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, 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, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, 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, toast, useFormField, usePortalContainer, useTheme, useToast };
1009
+ /**
1010
+ * Marks a `<pre>` as a block the highlighter should scan. `CodeBlock` sets it; put it on your own
1011
+ * `<pre>` to opt a custom code view into the same pass. The palette lives in `CodeBlock`'s
1012
+ * stylesheet, so import the component somewhere too.
1013
+ */
1014
+ declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
1015
+ /**
1016
+ * Queue a rescan of every mounted code block, coalescing a frame's worth of mounts into one pass.
1017
+ *
1018
+ * Scanning is document-wide by necessity: each `highlightAll` clears the ranges the last one
1019
+ * registered, so a per-block call would erase every other block on the page. Blocks inside a
1020
+ * shadow root are out of reach.
1021
+ *
1022
+ * Passes are serialized for the same reason. `highlightAll` collects its elements before awaiting
1023
+ * their grammars and clears every registered range once they land, so overlapping passes let the
1024
+ * slower one finish last and wipe the blocks it was too early to see.
1025
+ */
1026
+ declare const scheduleHighlight: () => Promise<void>;
1027
+
1028
+ 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, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, 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, useFormField, usePortalContainer, useTheme, useToast };
package/dist/index.d.ts CHANGED
@@ -273,8 +273,9 @@ interface CodeBlockProps {
273
273
  variant?: 'neutral' | 'primary' | 'success' | 'danger' | 'warning';
274
274
  codeLabel?: string;
275
275
  copy?: string;
276
+ lineNumbers?: boolean;
276
277
  }
277
- declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
278
+ declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, lineNumbers, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
278
279
 
279
280
  declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
280
281
  declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
@@ -927,7 +928,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
927
928
 
928
929
  declare const iconVariants: (props?: ({
929
930
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
930
- background?: "circle" | "square" | "transparent" | null | undefined;
931
+ background?: "square" | "circle" | "transparent" | null | undefined;
931
932
  } & class_variance_authority_types.ClassProp) | undefined) => string;
932
933
  declare const iconElevationVariants: (props?: ({
933
934
  elevation?: string | number | null | undefined;
@@ -1005,4 +1006,23 @@ declare const PortalContainerProvider: ({ container, children }: PortalContainer
1005
1006
 
1006
1007
  declare const useTheme: () => readonly [Theme$1 | undefined, (theme: Theme$1) => void];
1007
1008
 
1008
- 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, 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, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, 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, toast, useFormField, usePortalContainer, useTheme, useToast };
1009
+ /**
1010
+ * Marks a `<pre>` as a block the highlighter should scan. `CodeBlock` sets it; put it on your own
1011
+ * `<pre>` to opt a custom code view into the same pass. The palette lives in `CodeBlock`'s
1012
+ * stylesheet, so import the component somewhere too.
1013
+ */
1014
+ declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
1015
+ /**
1016
+ * Queue a rescan of every mounted code block, coalescing a frame's worth of mounts into one pass.
1017
+ *
1018
+ * Scanning is document-wide by necessity: each `highlightAll` clears the ranges the last one
1019
+ * registered, so a per-block call would erase every other block on the page. Blocks inside a
1020
+ * shadow root are out of reach.
1021
+ *
1022
+ * Passes are serialized for the same reason. `highlightAll` collects its elements before awaiting
1023
+ * their grammars and clears every registered range once they land, so overlapping passes let the
1024
+ * slower one finish last and wipe the blocks it was too early to see.
1025
+ */
1026
+ declare const scheduleHighlight: () => Promise<void>;
1027
+
1028
+ 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, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, 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, useFormField, usePortalContainer, useTheme, useToast };
package/dist/index.js CHANGED
@@ -24,9 +24,9 @@ import styles11 from './card-content-header.module.module.css.module.css';
24
24
  import styles12 from './card.module.module.css.module.css';
25
25
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
26
26
  import styles13 from './checkbox.module.module.css.module.css';
27
- import { Prism } from 'react-syntax-highlighter';
28
27
  import styles15 from './code-block.module.module.css.module.css';
29
28
  import styles14 from './icon-button.module.module.css.module.css';
29
+ import { highlightAll } from 'microlighter';
30
30
  import { Command as Command$1 } from 'cmdk';
31
31
  import styles17 from './command.module.module.css.module.css';
32
32
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -1116,7 +1116,29 @@ function CopyButton({
1116
1116
  }
1117
1117
  );
1118
1118
  }
1119
- var WRAP = true;
1119
+ var CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
1120
+ var SELECTOR = `pre[${CODE_BLOCK_ATTRIBUTE}] > code`;
1121
+ var tail = Promise.resolve();
1122
+ var queued = null;
1123
+ var isSupported = () => typeof window !== "undefined" && typeof CSS !== "undefined" && Boolean(CSS.highlights);
1124
+ var scheduleHighlight = () => {
1125
+ if (!isSupported()) return Promise.resolve();
1126
+ if (queued) return queued;
1127
+ const pass = tail.then(
1128
+ () => new Promise((resolve) => {
1129
+ window.requestAnimationFrame(() => {
1130
+ queued = null;
1131
+ highlightAll({ selector: SELECTOR }).then(
1132
+ () => resolve(),
1133
+ () => resolve()
1134
+ );
1135
+ });
1136
+ })
1137
+ );
1138
+ queued = pass;
1139
+ tail = pass;
1140
+ return pass;
1141
+ };
1120
1142
  var CodeBlock = ({
1121
1143
  className,
1122
1144
  title,
@@ -1124,28 +1146,45 @@ var CodeBlock = ({
1124
1146
  language = "text",
1125
1147
  variant = "neutral",
1126
1148
  codeLabel,
1127
- copy
1149
+ copy,
1150
+ lineNumbers = false
1128
1151
  }) => {
1152
+ useEffect(() => {
1153
+ void scheduleHighlight();
1154
+ return () => void scheduleHighlight();
1155
+ }, [code, language]);
1156
+ const gutter = useMemo(() => {
1157
+ if (!lineNumbers) return null;
1158
+ const lines = code.replace(/\n$/, "").split("\n").length;
1159
+ return Array.from({ length: lines }, (_, index) => index + 1).join("\n");
1160
+ }, [code, lineNumbers]);
1129
1161
  return /* @__PURE__ */ jsxs("div", { className: cn(styles15["code-block"], styles15[variant], className), children: [
1130
1162
  /* @__PURE__ */ jsxs("div", { className: styles15.header, children: [
1131
1163
  /* @__PURE__ */ jsxs("div", { className: styles15["header-left"], children: [
1132
1164
  title && /* @__PURE__ */ jsx("span", { className: styles15.title, children: title }),
1133
- /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: styles15["badge"], children: language })
1165
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: styles15.badge, children: language })
1134
1166
  ] }),
1135
1167
  /* @__PURE__ */ jsx("div", { className: styles15["header-right"], children: /* @__PURE__ */ jsx(CopyButton, { value: copy || code, size: "sm" }) })
1136
1168
  ] }),
1137
- /* @__PURE__ */ jsx("div", { className: cn(styles15.content), children: /* @__PURE__ */ jsx(
1138
- Prism,
1169
+ /* @__PURE__ */ jsx(
1170
+ "div",
1139
1171
  {
1140
- language,
1141
- useInlineStyles: false,
1142
- wrapLines: WRAP,
1143
- wrapLongLines: WRAP,
1144
- className: styles15.pre,
1145
- codeTagProps: { className: cn(styles15.code, { [styles15.wrap]: WRAP }) },
1146
- children: code
1172
+ className: styles15.content,
1173
+ tabIndex: 0,
1174
+ role: "group",
1175
+ "aria-label": title ? `${title}, code block` : "Code block",
1176
+ children: /* @__PURE__ */ jsxs("div", { className: cn(styles15.body, { [styles15.numbered]: lineNumbers }), children: [
1177
+ gutter && /* @__PURE__ */ jsx("pre", { "aria-hidden": "true", className: styles15.gutter, children: gutter }),
1178
+ /* @__PURE__ */ jsx("pre", { className: styles15.pre, ...{ [CODE_BLOCK_ATTRIBUTE]: "" }, children: /* @__PURE__ */ jsx(
1179
+ "code",
1180
+ {
1181
+ className: cn(styles15.code, `language-${language}`, { [styles15.wrap]: !lineNumbers }),
1182
+ children: code
1183
+ }
1184
+ ) })
1185
+ ] })
1147
1186
  }
1148
- ) }),
1187
+ ),
1149
1188
  codeLabel && /* @__PURE__ */ jsx("div", { className: styles15["code-label"], children: /* @__PURE__ */ jsx("p", { className: styles15["code-label-text"], children: codeLabel }) })
1150
1189
  ] });
1151
1190
  };
@@ -4187,6 +4226,6 @@ var useTheme = () => {
4187
4226
  return [theme, setTheme];
4188
4227
  };
4189
4228
 
4190
- export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, 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, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, toast, useFormField, usePortalContainer, useTheme, useToast };
4229
+ export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, 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, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useFormField, usePortalContainer, useTheme, useToast };
4191
4230
  //# sourceMappingURL=index.js.map
4192
4231
  //# sourceMappingURL=index.js.map