@bgunnarsson/react-primitives 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.cjs +35 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -622,4 +622,18 @@ interface ContainerProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
|
622
622
|
}
|
|
623
623
|
declare const Container: (props: ContainerProps) => react_jsx_runtime.JSX.Element;
|
|
624
624
|
|
|
625
|
-
|
|
625
|
+
interface CodeBlockProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
626
|
+
code: string;
|
|
627
|
+
title?: string;
|
|
628
|
+
}
|
|
629
|
+
declare const CodeBlock: ({ code, title, children, ...props }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
630
|
+
|
|
631
|
+
interface HeaderProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
632
|
+
}
|
|
633
|
+
declare const Header: (props: HeaderProps) => react_jsx_runtime.JSX.Element;
|
|
634
|
+
|
|
635
|
+
interface FooterProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
636
|
+
}
|
|
637
|
+
declare const Footer: (props: FooterProps) => react_jsx_runtime.JSX.Element;
|
|
638
|
+
|
|
639
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, BreadcrumbsLink, type BreadcrumbsLinkProps, BreadcrumbsList, type BreadcrumbsListProps, BreadcrumbsPage, type BreadcrumbsPageProps, type BreadcrumbsProps, BreadcrumbsSeparator, type BreadcrumbsSeparatorProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, type CardProps, Carousel, type CarouselApi, CarouselContent, type CarouselContentProps, CarouselItem, type CarouselItemProps, CarouselNext, type CarouselNextProps, CarouselPrevious, type CarouselPreviousProps, type CarouselProps, Checkbox, CheckboxGroup, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps, type CheckboxProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, CollapsibleTrigger, Combobox, ComboboxContent, type ComboboxContentProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, ComboboxList, type ComboboxListProps, type ComboboxProps, ComboboxTrigger, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, type ContextMenuCheckboxItemProps, ContextMenuContent, type ContextMenuContentProps, ContextMenuGroup, ContextMenuItem, type ContextMenuItemProps, ContextMenuLabel, type ContextMenuLabelProps, ContextMenuRadioGroup, ContextMenuRadioItem, type ContextMenuRadioItemProps, ContextMenuSeparator, type ContextMenuSeparatorProps, ContextMenuSub, ContextMenuSubContent, type ContextMenuSubContentProps, ContextMenuSubTrigger, type ContextMenuSubTriggerProps, ContextMenuTrigger, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerHandle, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, EmptyState, EmptyStateAction, type EmptyStateActionProps, EmptyStateDescription, type EmptyStateDescriptionProps, EmptyStateIcon, type EmptyStateIconProps, type EmptyStateProps, EmptyStateTitle, type EmptyStateTitleProps, FileInput, type FileInputProps, Footer, type FooterProps, FormControl, type FormControlProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, Grid, GridItem, type GridItemProps, type GridProps, Header, type HeaderProps, HoverCard, HoverCardContent, type HoverCardContentProps, HoverCardTrigger, Icon, type IconProps, Input, type InputProps, Label, type LabelProps, Lightbox, type LightboxProps, Link, type LinkProps, Nav, NavItem, type NavItemProps, NavList, type NavListProps, type NavProps, NumberInput, type NumberInputProps, Pagination, PaginationContent, type PaginationContentProps, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps, Picture, type PictureProps, type PictureSource, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, Richtext, type RichtextProps, ScrollArea, type ScrollAreaProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetOverlay, type SheetOverlayProps, SheetPortal, type SheetSide, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stat, StatHelpText, type StatHelpTextProps, StatLabel, type StatLabelProps, type StatProps, StatValue, type StatValueProps, Stepper, StepperDescription, type StepperDescriptionProps, StepperIndicator, type StepperIndicatorProps, StepperItem, type StepperItemProps, type StepperProps, StepperSeparator, type StepperSeparatorProps, StepperTitle, type StepperTitleProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, TabsTrigger, type TabsTriggerProps, Text, type TextProps, Textarea, type TextareaProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipTrigger, VideoPlayer, type VideoPlayerProps, useCarousel };
|
package/dist/index.d.ts
CHANGED
|
@@ -622,4 +622,18 @@ interface ContainerProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
|
622
622
|
}
|
|
623
623
|
declare const Container: (props: ContainerProps) => react_jsx_runtime.JSX.Element;
|
|
624
624
|
|
|
625
|
-
|
|
625
|
+
interface CodeBlockProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
626
|
+
code: string;
|
|
627
|
+
title?: string;
|
|
628
|
+
}
|
|
629
|
+
declare const CodeBlock: ({ code, title, children, ...props }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
630
|
+
|
|
631
|
+
interface HeaderProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
632
|
+
}
|
|
633
|
+
declare const Header: (props: HeaderProps) => react_jsx_runtime.JSX.Element;
|
|
634
|
+
|
|
635
|
+
interface FooterProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
636
|
+
}
|
|
637
|
+
declare const Footer: (props: FooterProps) => react_jsx_runtime.JSX.Element;
|
|
638
|
+
|
|
639
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, BreadcrumbsLink, type BreadcrumbsLinkProps, BreadcrumbsList, type BreadcrumbsListProps, BreadcrumbsPage, type BreadcrumbsPageProps, type BreadcrumbsProps, BreadcrumbsSeparator, type BreadcrumbsSeparatorProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, type CardProps, Carousel, type CarouselApi, CarouselContent, type CarouselContentProps, CarouselItem, type CarouselItemProps, CarouselNext, type CarouselNextProps, CarouselPrevious, type CarouselPreviousProps, type CarouselProps, Checkbox, CheckboxGroup, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps, type CheckboxProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, CollapsibleTrigger, Combobox, ComboboxContent, type ComboboxContentProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, ComboboxList, type ComboboxListProps, type ComboboxProps, ComboboxTrigger, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, type ContextMenuCheckboxItemProps, ContextMenuContent, type ContextMenuContentProps, ContextMenuGroup, ContextMenuItem, type ContextMenuItemProps, ContextMenuLabel, type ContextMenuLabelProps, ContextMenuRadioGroup, ContextMenuRadioItem, type ContextMenuRadioItemProps, ContextMenuSeparator, type ContextMenuSeparatorProps, ContextMenuSub, ContextMenuSubContent, type ContextMenuSubContentProps, ContextMenuSubTrigger, type ContextMenuSubTriggerProps, ContextMenuTrigger, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerHandle, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, EmptyState, EmptyStateAction, type EmptyStateActionProps, EmptyStateDescription, type EmptyStateDescriptionProps, EmptyStateIcon, type EmptyStateIconProps, type EmptyStateProps, EmptyStateTitle, type EmptyStateTitleProps, FileInput, type FileInputProps, Footer, type FooterProps, FormControl, type FormControlProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, Grid, GridItem, type GridItemProps, type GridProps, Header, type HeaderProps, HoverCard, HoverCardContent, type HoverCardContentProps, HoverCardTrigger, Icon, type IconProps, Input, type InputProps, Label, type LabelProps, Lightbox, type LightboxProps, Link, type LinkProps, Nav, NavItem, type NavItemProps, NavList, type NavListProps, type NavProps, NumberInput, type NumberInputProps, Pagination, PaginationContent, type PaginationContentProps, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps, Picture, type PictureProps, type PictureSource, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, Richtext, type RichtextProps, ScrollArea, type ScrollAreaProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetOverlay, type SheetOverlayProps, SheetPortal, type SheetSide, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stat, StatHelpText, type StatHelpTextProps, StatLabel, type StatLabelProps, type StatProps, StatValue, type StatValueProps, Stepper, StepperDescription, type StepperDescriptionProps, StepperIndicator, type StepperIndicatorProps, StepperItem, type StepperItemProps, type StepperProps, StepperSeparator, type StepperSeparatorProps, StepperTitle, type StepperTitleProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, TabsTrigger, type TabsTriggerProps, Text, type TextProps, Textarea, type TextareaProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipTrigger, VideoPlayer, type VideoPlayerProps, useCarousel };
|
package/dist/index.js
CHANGED
|
@@ -942,6 +942,37 @@ var GridItem = (props) => /* @__PURE__ */ jsx53("div", { ...props });
|
|
|
942
942
|
// src/components/Container/Container.tsx
|
|
943
943
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
944
944
|
var Container = (props) => /* @__PURE__ */ jsx54("div", { ...props });
|
|
945
|
+
|
|
946
|
+
// src/components/CodeBlock/CodeBlock.tsx
|
|
947
|
+
import { useState } from "react";
|
|
948
|
+
import { jsx as jsx55, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
949
|
+
var CodeBlock = ({ code, title, children, ...props }) => {
|
|
950
|
+
const [copied, setCopied] = useState(false);
|
|
951
|
+
const handleCopy = () => {
|
|
952
|
+
navigator.clipboard.writeText(code).then(() => {
|
|
953
|
+
setCopied(true);
|
|
954
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
955
|
+
});
|
|
956
|
+
};
|
|
957
|
+
return /* @__PURE__ */ jsxs15("div", { ...props, children: [
|
|
958
|
+
/* @__PURE__ */ jsxs15("div", { "data-slot": "header", children: [
|
|
959
|
+
title && /* @__PURE__ */ jsx55("span", { "data-slot": "title", children: title }),
|
|
960
|
+
/* @__PURE__ */ jsx55("button", { "data-slot": "copy", "data-copied": copied, onClick: handleCopy, type: "button", "aria-label": "Copy code", children: copied ? /* @__PURE__ */ jsx55("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx55("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs15("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
961
|
+
/* @__PURE__ */ jsx55("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
962
|
+
/* @__PURE__ */ jsx55("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
963
|
+
] }) })
|
|
964
|
+
] }),
|
|
965
|
+
/* @__PURE__ */ jsx55("pre", { "data-slot": "pre", children: /* @__PURE__ */ jsx55("code", { "data-slot": "code", children: children ?? code }) })
|
|
966
|
+
] });
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
// src/components/Header/Header.tsx
|
|
970
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
971
|
+
var Header2 = (props) => /* @__PURE__ */ jsx56("header", { ...props });
|
|
972
|
+
|
|
973
|
+
// src/components/Footer/Footer.tsx
|
|
974
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
975
|
+
var Footer = (props) => /* @__PURE__ */ jsx57("footer", { ...props });
|
|
945
976
|
export {
|
|
946
977
|
Accordion,
|
|
947
978
|
AccordionContent,
|
|
@@ -980,6 +1011,7 @@ export {
|
|
|
980
1011
|
Checkbox,
|
|
981
1012
|
CheckboxGroup,
|
|
982
1013
|
CheckboxGroupItem,
|
|
1014
|
+
CodeBlock,
|
|
983
1015
|
Collapsible,
|
|
984
1016
|
CollapsibleContent,
|
|
985
1017
|
CollapsibleTrigger,
|
|
@@ -1042,12 +1074,14 @@ export {
|
|
|
1042
1074
|
EmptyStateIcon,
|
|
1043
1075
|
EmptyStateTitle,
|
|
1044
1076
|
FileInput,
|
|
1077
|
+
Footer,
|
|
1045
1078
|
FormControl,
|
|
1046
1079
|
FormField,
|
|
1047
1080
|
FormLabel,
|
|
1048
1081
|
FormMessage,
|
|
1049
1082
|
Grid,
|
|
1050
1083
|
GridItem,
|
|
1084
|
+
Header2 as Header,
|
|
1051
1085
|
HoverCard,
|
|
1052
1086
|
HoverCardContent,
|
|
1053
1087
|
HoverCardTrigger,
|