Skip to content

Commit

Permalink
chore: try with npm token
Browse files Browse the repository at this point in the history
  • Loading branch information
nahoc committed Apr 2, 2024
1 parent ceadee6 commit 7b64cfb
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 45 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: npm run typecheck
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import cn from "./cn";
const Checkbox = forwardRef<
ElementRef<typeof CheckboxPrimitive.Root>,
ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
"peer size-4 shrink-0 rounded-[4px] border border-primary shadow disabled:cursor-not-allowed data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
className,
)}
{...props}
{...rest}
>
<CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")}>
<CheckIcon className="size-3" />
Expand Down
34 changes: 17 additions & 17 deletions command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ import cn from "./cn";
import { Dialog, DialogContent } from "./dialog";

const Command = forwardRef<ElementRef<typeof CommandPrimitive>, ComponentPropsWithoutRef<typeof CommandPrimitive>>(
({ className, ...props }, ref) => (
({ className, ...rest }, ref) => (
<CommandPrimitive
ref={ref}
className={cn(
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
className,
)}
{...props}
{...rest}
/>
),
);
Command.displayName = CommandPrimitive.displayName;

interface CommandDialogProps extends DialogProps {}

const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
const CommandDialog = ({ children, ...rest }: CommandDialogProps) => {
return (
<Dialog {...props}>
<Dialog {...rest}>
<DialogContent className="overflow-hidden p-0">
<Command className="[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground">
{children}
Expand All @@ -38,16 +38,16 @@ const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
const CommandInput = forwardRef<
ElementRef<typeof CommandPrimitive.Input>,
ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
<SearchIcon className="mr-2 h-4 w-4 shrink-0 opacity-50" />
<SearchIcon className="mr-2 size-4 shrink-0 opacity-50" />
<CommandPrimitive.Input
ref={ref}
className={cn(
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed placeholder:text-muted-foreground disabled:opacity-50",
className,
)}
{...props}
{...rest}
/>
</div>
));
Expand All @@ -57,11 +57,11 @@ CommandInput.displayName = CommandPrimitive.Input.displayName;
const CommandList = forwardRef<
ElementRef<typeof CommandPrimitive.List>,
ComponentPropsWithoutRef<typeof CommandPrimitive.List>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<CommandPrimitive.List
ref={ref}
className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
{...props}
{...rest}
/>
));

Expand All @@ -77,14 +77,14 @@ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
const CommandGroup = forwardRef<
ElementRef<typeof CommandPrimitive.Group>,
ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<CommandPrimitive.Group
ref={ref}
className={cn(
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
className,
)}
{...props}
{...rest}
/>
));

Expand All @@ -93,29 +93,29 @@ CommandGroup.displayName = CommandPrimitive.Group.displayName;
const CommandSeparator = forwardRef<
ElementRef<typeof CommandPrimitive.Separator>,
ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Separator ref={ref} className={cn("-mx-1 h-px bg-border", className)} {...props} />
>(({ className, ...rest }, ref) => (
<CommandPrimitive.Separator ref={ref} className={cn("-mx-1 h-px bg-border", className)} {...rest} />
));
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;

const CommandItem = forwardRef<
ElementRef<typeof CommandPrimitive.Item>,
ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<CommandPrimitive.Item
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:opacity-50",
className,
)}
{...props}
{...rest}
/>
));

CommandItem.displayName = CommandPrimitive.Item.displayName;

const CommandShortcut = ({ className, ...props }: HTMLAttributes<HTMLSpanElement>) => {
return <span className={cn("ml-auto text-muted-foreground text-xs tracking-widest", className)} {...props} />;
const CommandShortcut = ({ className, ...rest }: HTMLAttributes<HTMLSpanElement>) => {
return <span className={cn("ml-auto text-muted-foreground text-xs tracking-widest", className)} {...rest} />;
};
CommandShortcut.displayName = "CommandShortcut";

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@risc0/ui",
"version": "0.0.18",
"version": "0.0.19",
"type": "module",
"scripts": {
"bump:version": "bunx changelogen --bump --no-output",
Expand Down
4 changes: 2 additions & 2 deletions popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PopoverAnchor = PopoverPrimitive.Anchor;
const PopoverContent = forwardRef<
ElementRef<typeof PopoverPrimitive.Content>,
ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
>(({ className, align = "center", sideOffset = 4, ...rest }, ref) => (
<PopoverPrimitive.Portal>
<PopoverPrimitive.Content
ref={ref}
Expand All @@ -21,7 +21,7 @@ const PopoverContent = forwardRef<
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
className,
)}
{...props}
{...rest}
/>
</PopoverPrimitive.Portal>
));
Expand Down
4 changes: 2 additions & 2 deletions progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import cn from "./cn";
const Progress = forwardRef<
ElementRef<typeof ProgressPrimitive.Root>,
ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
>(({ className, value, ...props }, ref) => (
>(({ className, value, ...rest }, ref) => (
<ProgressPrimitive.Root
ref={ref}
className={cn("relative h-1 w-full overflow-hidden rounded-full bg-primary/20", className)}
{...props}
{...rest}
>
<ProgressPrimitive.Indicator
className="h-full w-full flex-1 rounded-full bg-primary transition-all"
Expand Down
26 changes: 13 additions & 13 deletions sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const SheetPortal = SheetPrimitive.Portal;
const SheetOverlay = forwardRef<
ElementRef<typeof SheetPrimitive.Overlay>,
ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<SheetPrimitive.Overlay
className={cn(
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80 data-[state=closed]:animate-out data-[state=open]:animate-in",
className,
)}
{...props}
{...rest}
ref={ref}
/>
));
Expand Down Expand Up @@ -49,40 +49,40 @@ interface SheetContentProps
VariantProps<typeof sheetVariants> {}

const SheetContent = forwardRef<ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
({ side = "right", className, children, ...props }, ref) => (
({ side = "right", className, children, ...rest }, ref) => (
<SheetPortal>
<SheetOverlay />
<SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
<SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...rest}>
{children}
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity disabled:pointer-events-none data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2">
<XIcon className="h-4 w-4" />
<XIcon className="size-4" />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
</SheetPrimitive.Content>
</SheetPortal>
),
);

const SheetHeader = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (
<div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />
const SheetHeader = ({ className, ...rest }: HTMLAttributes<HTMLDivElement>) => (
<div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...rest} />
);

const SheetFooter = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (
<div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} />
const SheetFooter = ({ className, ...rest }: HTMLAttributes<HTMLDivElement>) => (
<div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...rest} />
);

const SheetTitle = forwardRef<
ElementRef<typeof SheetPrimitive.Title>,
ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Title ref={ref} className={cn("font-semibold text-foreground text-lg", className)} {...props} />
>(({ className, ...rest }, ref) => (
<SheetPrimitive.Title ref={ref} className={cn("font-semibold text-foreground text-lg", className)} {...rest} />
));

const SheetDescription = forwardRef<
ElementRef<typeof SheetPrimitive.Description>,
ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
>(({ className, ...props }, ref) => (
<SheetPrimitive.Description ref={ref} className={cn("text-muted-foreground text-sm", className)} {...props} />
>(({ className, ...rest }, ref) => (
<SheetPrimitive.Description ref={ref} className={cn("text-muted-foreground text-sm", className)} {...rest} />
));

SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
Expand Down
4 changes: 2 additions & 2 deletions slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import cn from "./cn";
const Slider = forwardRef<
ElementRef<typeof SliderPrimitive.Root>,
ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<SliderPrimitive.Root
ref={ref}
className={cn("relative flex w-full touch-none select-none items-center", className)}
{...props}
{...rest}
>
<SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20">
<SliderPrimitive.Range className="absolute h-full bg-primary" />
Expand Down
12 changes: 6 additions & 6 deletions tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@ import cn from "./cn";
const Tabs = TabsPrimitive.Root;

const TabsList = forwardRef<ElementRef<typeof TabsPrimitive.List>, ComponentPropsWithoutRef<typeof TabsPrimitive.List>>(
({ className, ...props }, ref) => (
({ className, ...rest }, ref) => (
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
className,
)}
{...props}
{...rest}
/>
),
);

const TabsTrigger = forwardRef<
ElementRef<typeof TabsPrimitive.Trigger>,
ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 font-medium text-sm ring-offset-background transition-all disabled:pointer-events-none data-[state=active]:bg-background data-[state=active]:text-foreground disabled:opacity-50 data-[state=active]:shadow focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className,
)}
{...props}
{...rest}
/>
));

const TabsContent = forwardRef<
ElementRef<typeof TabsPrimitive.Content>,
ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
>(({ className, ...rest }, ref) => (
<TabsPrimitive.Content
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className,
)}
{...props}
{...rest}
/>
));

Expand Down

0 comments on commit 7b64cfb

Please sign in to comment.