@eqtylab/equality 3.3.1 → 3.5.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/code-block.module.module.css.module.css +209 -96
- package/dist/generated/color-vars.css +10 -0
- package/dist/generated/global-light-tokens.css +10 -0
- package/dist/generated/light-tokens.css +10 -0
- package/dist/generated/tailwind-tokens.css +10 -0
- package/dist/index.cjs +60 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/dist/theme.module.module.css.module.css +10 -0
- package/package.json +2 -3
package/dist/index.d.cts
CHANGED
|
@@ -135,6 +135,7 @@ var Light = {
|
|
|
135
135
|
color: {
|
|
136
136
|
brand: {
|
|
137
137
|
green: {
|
|
138
|
+
$deprecated: true,
|
|
138
139
|
$type: "color",
|
|
139
140
|
$value: {
|
|
140
141
|
colorSpace: "display-p3",
|
|
@@ -147,6 +148,7 @@ var Light = {
|
|
|
147
148
|
}
|
|
148
149
|
},
|
|
149
150
|
primary: {
|
|
151
|
+
$deprecated: true,
|
|
150
152
|
$type: "color",
|
|
151
153
|
$value: {
|
|
152
154
|
colorSpace: "display-p3",
|
|
@@ -159,6 +161,7 @@ var Light = {
|
|
|
159
161
|
}
|
|
160
162
|
},
|
|
161
163
|
red: {
|
|
164
|
+
$deprecated: true,
|
|
162
165
|
$type: "color",
|
|
163
166
|
$value: {
|
|
164
167
|
colorSpace: "display-p3",
|
|
@@ -171,6 +174,7 @@ var Light = {
|
|
|
171
174
|
}
|
|
172
175
|
},
|
|
173
176
|
secondary: {
|
|
177
|
+
$deprecated: true,
|
|
174
178
|
$type: "color",
|
|
175
179
|
$value: {
|
|
176
180
|
colorSpace: "display-p3",
|
|
@@ -183,6 +187,7 @@ var Light = {
|
|
|
183
187
|
}
|
|
184
188
|
},
|
|
185
189
|
yellow: {
|
|
190
|
+
$deprecated: true,
|
|
186
191
|
$type: "color",
|
|
187
192
|
$value: {
|
|
188
193
|
colorSpace: "display-p3",
|
|
@@ -273,8 +278,9 @@ interface CodeBlockProps {
|
|
|
273
278
|
variant?: 'neutral' | 'primary' | 'success' | 'danger' | 'warning';
|
|
274
279
|
codeLabel?: string;
|
|
275
280
|
copy?: string;
|
|
281
|
+
lineNumbers?: boolean;
|
|
276
282
|
}
|
|
277
|
-
declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
283
|
+
declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, lineNumbers, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
278
284
|
|
|
279
285
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
280
286
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -927,7 +933,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
|
|
|
927
933
|
|
|
928
934
|
declare const iconVariants: (props?: ({
|
|
929
935
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
930
|
-
background?: "
|
|
936
|
+
background?: "square" | "circle" | "transparent" | null | undefined;
|
|
931
937
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
932
938
|
declare const iconElevationVariants: (props?: ({
|
|
933
939
|
elevation?: string | number | null | undefined;
|
|
@@ -1005,4 +1011,23 @@ declare const PortalContainerProvider: ({ container, children }: PortalContainer
|
|
|
1005
1011
|
|
|
1006
1012
|
declare const useTheme: () => readonly [Theme$1 | undefined, (theme: Theme$1) => void];
|
|
1007
1013
|
|
|
1008
|
-
|
|
1014
|
+
/**
|
|
1015
|
+
* Marks a `<pre>` as a block the highlighter should scan. `CodeBlock` sets it; put it on your own
|
|
1016
|
+
* `<pre>` to opt a custom code view into the same pass. The palette lives in `CodeBlock`'s
|
|
1017
|
+
* stylesheet, so import the component somewhere too.
|
|
1018
|
+
*/
|
|
1019
|
+
declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
|
|
1020
|
+
/**
|
|
1021
|
+
* Queue a rescan of every mounted code block, coalescing a frame's worth of mounts into one pass.
|
|
1022
|
+
*
|
|
1023
|
+
* Scanning is document-wide by necessity: each `highlightAll` clears the ranges the last one
|
|
1024
|
+
* registered, so a per-block call would erase every other block on the page. Blocks inside a
|
|
1025
|
+
* shadow root are out of reach.
|
|
1026
|
+
*
|
|
1027
|
+
* Passes are serialized for the same reason. `highlightAll` collects its elements before awaiting
|
|
1028
|
+
* their grammars and clears every registered range once they land, so overlapping passes let the
|
|
1029
|
+
* slower one finish last and wipe the blocks it was too early to see.
|
|
1030
|
+
*/
|
|
1031
|
+
declare const scheduleHighlight: () => Promise<void>;
|
|
1032
|
+
|
|
1033
|
+
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
|
@@ -135,6 +135,7 @@ var Light = {
|
|
|
135
135
|
color: {
|
|
136
136
|
brand: {
|
|
137
137
|
green: {
|
|
138
|
+
$deprecated: true,
|
|
138
139
|
$type: "color",
|
|
139
140
|
$value: {
|
|
140
141
|
colorSpace: "display-p3",
|
|
@@ -147,6 +148,7 @@ var Light = {
|
|
|
147
148
|
}
|
|
148
149
|
},
|
|
149
150
|
primary: {
|
|
151
|
+
$deprecated: true,
|
|
150
152
|
$type: "color",
|
|
151
153
|
$value: {
|
|
152
154
|
colorSpace: "display-p3",
|
|
@@ -159,6 +161,7 @@ var Light = {
|
|
|
159
161
|
}
|
|
160
162
|
},
|
|
161
163
|
red: {
|
|
164
|
+
$deprecated: true,
|
|
162
165
|
$type: "color",
|
|
163
166
|
$value: {
|
|
164
167
|
colorSpace: "display-p3",
|
|
@@ -171,6 +174,7 @@ var Light = {
|
|
|
171
174
|
}
|
|
172
175
|
},
|
|
173
176
|
secondary: {
|
|
177
|
+
$deprecated: true,
|
|
174
178
|
$type: "color",
|
|
175
179
|
$value: {
|
|
176
180
|
colorSpace: "display-p3",
|
|
@@ -183,6 +187,7 @@ var Light = {
|
|
|
183
187
|
}
|
|
184
188
|
},
|
|
185
189
|
yellow: {
|
|
190
|
+
$deprecated: true,
|
|
186
191
|
$type: "color",
|
|
187
192
|
$value: {
|
|
188
193
|
colorSpace: "display-p3",
|
|
@@ -273,8 +278,9 @@ interface CodeBlockProps {
|
|
|
273
278
|
variant?: 'neutral' | 'primary' | 'success' | 'danger' | 'warning';
|
|
274
279
|
codeLabel?: string;
|
|
275
280
|
copy?: string;
|
|
281
|
+
lineNumbers?: boolean;
|
|
276
282
|
}
|
|
277
|
-
declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
283
|
+
declare const CodeBlock: ({ className, title, code, language, variant, codeLabel, copy, lineNumbers, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
278
284
|
|
|
279
285
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
280
286
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -927,7 +933,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
|
|
|
927
933
|
|
|
928
934
|
declare const iconVariants: (props?: ({
|
|
929
935
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
930
|
-
background?: "
|
|
936
|
+
background?: "square" | "circle" | "transparent" | null | undefined;
|
|
931
937
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
932
938
|
declare const iconElevationVariants: (props?: ({
|
|
933
939
|
elevation?: string | number | null | undefined;
|
|
@@ -1005,4 +1011,23 @@ declare const PortalContainerProvider: ({ container, children }: PortalContainer
|
|
|
1005
1011
|
|
|
1006
1012
|
declare const useTheme: () => readonly [Theme$1 | undefined, (theme: Theme$1) => void];
|
|
1007
1013
|
|
|
1008
|
-
|
|
1014
|
+
/**
|
|
1015
|
+
* Marks a `<pre>` as a block the highlighter should scan. `CodeBlock` sets it; put it on your own
|
|
1016
|
+
* `<pre>` to opt a custom code view into the same pass. The palette lives in `CodeBlock`'s
|
|
1017
|
+
* stylesheet, so import the component somewhere too.
|
|
1018
|
+
*/
|
|
1019
|
+
declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
|
|
1020
|
+
/**
|
|
1021
|
+
* Queue a rescan of every mounted code block, coalescing a frame's worth of mounts into one pass.
|
|
1022
|
+
*
|
|
1023
|
+
* Scanning is document-wide by necessity: each `highlightAll` clears the ranges the last one
|
|
1024
|
+
* registered, so a per-block call would erase every other block on the page. Blocks inside a
|
|
1025
|
+
* shadow root are out of reach.
|
|
1026
|
+
*
|
|
1027
|
+
* Passes are serialized for the same reason. `highlightAll` collects its elements before awaiting
|
|
1028
|
+
* their grammars and clears every registered range once they land, so overlapping passes let the
|
|
1029
|
+
* slower one finish last and wipe the blocks it was too early to see.
|
|
1030
|
+
*/
|
|
1031
|
+
declare const scheduleHighlight: () => Promise<void>;
|
|
1032
|
+
|
|
1033
|
+
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';
|
|
@@ -609,6 +609,7 @@ var equality_tokens_default = {
|
|
|
609
609
|
color: {
|
|
610
610
|
brand: {
|
|
611
611
|
green: {
|
|
612
|
+
$deprecated: true,
|
|
612
613
|
$type: "color",
|
|
613
614
|
$value: {
|
|
614
615
|
colorSpace: "display-p3",
|
|
@@ -617,6 +618,7 @@ var equality_tokens_default = {
|
|
|
617
618
|
}
|
|
618
619
|
},
|
|
619
620
|
primary: {
|
|
621
|
+
$deprecated: true,
|
|
620
622
|
$type: "color",
|
|
621
623
|
$value: {
|
|
622
624
|
colorSpace: "display-p3",
|
|
@@ -625,6 +627,7 @@ var equality_tokens_default = {
|
|
|
625
627
|
}
|
|
626
628
|
},
|
|
627
629
|
red: {
|
|
630
|
+
$deprecated: true,
|
|
628
631
|
$type: "color",
|
|
629
632
|
$value: {
|
|
630
633
|
colorSpace: "display-p3",
|
|
@@ -633,6 +636,7 @@ var equality_tokens_default = {
|
|
|
633
636
|
}
|
|
634
637
|
},
|
|
635
638
|
secondary: {
|
|
639
|
+
$deprecated: true,
|
|
636
640
|
$type: "color",
|
|
637
641
|
$value: {
|
|
638
642
|
colorSpace: "display-p3",
|
|
@@ -641,6 +645,7 @@ var equality_tokens_default = {
|
|
|
641
645
|
}
|
|
642
646
|
},
|
|
643
647
|
yellow: {
|
|
648
|
+
$deprecated: true,
|
|
644
649
|
$type: "color",
|
|
645
650
|
$value: {
|
|
646
651
|
colorSpace: "display-p3",
|
|
@@ -1116,7 +1121,29 @@ function CopyButton({
|
|
|
1116
1121
|
}
|
|
1117
1122
|
);
|
|
1118
1123
|
}
|
|
1119
|
-
var
|
|
1124
|
+
var CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
|
|
1125
|
+
var SELECTOR = `pre[${CODE_BLOCK_ATTRIBUTE}] > code`;
|
|
1126
|
+
var tail = Promise.resolve();
|
|
1127
|
+
var queued = null;
|
|
1128
|
+
var isSupported = () => typeof window !== "undefined" && typeof CSS !== "undefined" && Boolean(CSS.highlights);
|
|
1129
|
+
var scheduleHighlight = () => {
|
|
1130
|
+
if (!isSupported()) return Promise.resolve();
|
|
1131
|
+
if (queued) return queued;
|
|
1132
|
+
const pass = tail.then(
|
|
1133
|
+
() => new Promise((resolve) => {
|
|
1134
|
+
window.requestAnimationFrame(() => {
|
|
1135
|
+
queued = null;
|
|
1136
|
+
highlightAll({ selector: SELECTOR }).then(
|
|
1137
|
+
() => resolve(),
|
|
1138
|
+
() => resolve()
|
|
1139
|
+
);
|
|
1140
|
+
});
|
|
1141
|
+
})
|
|
1142
|
+
);
|
|
1143
|
+
queued = pass;
|
|
1144
|
+
tail = pass;
|
|
1145
|
+
return pass;
|
|
1146
|
+
};
|
|
1120
1147
|
var CodeBlock = ({
|
|
1121
1148
|
className,
|
|
1122
1149
|
title,
|
|
@@ -1124,28 +1151,45 @@ var CodeBlock = ({
|
|
|
1124
1151
|
language = "text",
|
|
1125
1152
|
variant = "neutral",
|
|
1126
1153
|
codeLabel,
|
|
1127
|
-
copy
|
|
1154
|
+
copy,
|
|
1155
|
+
lineNumbers = false
|
|
1128
1156
|
}) => {
|
|
1157
|
+
useEffect(() => {
|
|
1158
|
+
void scheduleHighlight();
|
|
1159
|
+
return () => void scheduleHighlight();
|
|
1160
|
+
}, [code, language]);
|
|
1161
|
+
const gutter = useMemo(() => {
|
|
1162
|
+
if (!lineNumbers) return null;
|
|
1163
|
+
const lines = code.replace(/\n$/, "").split("\n").length;
|
|
1164
|
+
return Array.from({ length: lines }, (_, index) => index + 1).join("\n");
|
|
1165
|
+
}, [code, lineNumbers]);
|
|
1129
1166
|
return /* @__PURE__ */ jsxs("div", { className: cn(styles15["code-block"], styles15[variant], className), children: [
|
|
1130
1167
|
/* @__PURE__ */ jsxs("div", { className: styles15.header, children: [
|
|
1131
1168
|
/* @__PURE__ */ jsxs("div", { className: styles15["header-left"], children: [
|
|
1132
1169
|
title && /* @__PURE__ */ jsx("span", { className: styles15.title, children: title }),
|
|
1133
|
-
/* @__PURE__ */ jsx(Badge, { variant: "neutral", className: styles15
|
|
1170
|
+
/* @__PURE__ */ jsx(Badge, { variant: "neutral", className: styles15.badge, children: language })
|
|
1134
1171
|
] }),
|
|
1135
1172
|
/* @__PURE__ */ jsx("div", { className: styles15["header-right"], children: /* @__PURE__ */ jsx(CopyButton, { value: copy || code, size: "sm" }) })
|
|
1136
1173
|
] }),
|
|
1137
|
-
/* @__PURE__ */ jsx(
|
|
1138
|
-
|
|
1174
|
+
/* @__PURE__ */ jsx(
|
|
1175
|
+
"div",
|
|
1139
1176
|
{
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
className: styles15.
|
|
1145
|
-
|
|
1146
|
-
|
|
1177
|
+
className: styles15.content,
|
|
1178
|
+
tabIndex: 0,
|
|
1179
|
+
role: "group",
|
|
1180
|
+
"aria-label": title ? `${title}, code block` : "Code block",
|
|
1181
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn(styles15.body, { [styles15.numbered]: lineNumbers }), children: [
|
|
1182
|
+
gutter && /* @__PURE__ */ jsx("pre", { "aria-hidden": "true", className: styles15.gutter, children: gutter }),
|
|
1183
|
+
/* @__PURE__ */ jsx("pre", { className: styles15.pre, ...{ [CODE_BLOCK_ATTRIBUTE]: "" }, children: /* @__PURE__ */ jsx(
|
|
1184
|
+
"code",
|
|
1185
|
+
{
|
|
1186
|
+
className: cn(styles15.code, `language-${language}`, { [styles15.wrap]: !lineNumbers }),
|
|
1187
|
+
children: code
|
|
1188
|
+
}
|
|
1189
|
+
) })
|
|
1190
|
+
] })
|
|
1147
1191
|
}
|
|
1148
|
-
)
|
|
1192
|
+
),
|
|
1149
1193
|
codeLabel && /* @__PURE__ */ jsx("div", { className: styles15["code-label"], children: /* @__PURE__ */ jsx("p", { className: styles15["code-label-text"], children: codeLabel }) })
|
|
1150
1194
|
] });
|
|
1151
1195
|
};
|
|
@@ -4187,6 +4231,6 @@ var useTheme = () => {
|
|
|
4187
4231
|
return [theme, setTheme];
|
|
4188
4232
|
};
|
|
4189
4233
|
|
|
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 };
|
|
4234
|
+
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
4235
|
//# sourceMappingURL=index.js.map
|
|
4192
4236
|
//# sourceMappingURL=index.js.map
|