Skip to content

Commit

Permalink
fix(docs): eslint tailwindcss rules update
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-karger committed Nov 14, 2023
1 parent ca10d49 commit f9a86fe
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion apps/docs/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"settings": {
"tailwindcss": {
"callees": ["cn"],
"callees": ["cn", "cva"],
"config": "tailwind.config.cjs"
}
},
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@fontsource/inter": "^5.0.14",
"@kobalte/core": "^0.11.1",
"@kobalte/core": "^0.11.2",
"@modular-forms/solid": "^0.20.0",
"@solid-primitives/keyboard": "^1.2.5",
"@solidjs/meta": "^0.28.6",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/public/registry/ui/alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"files": [
{
"name": "alert.tsx",
"content": "import type { Component, ComponentProps } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport { Alert as AlertPrimitive } from \"@kobalte/core\"\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\n\r\nconst alertVariants = cva(\r\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-background text-foreground\",\r\n destructive:\r\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\"\r\n }\r\n },\r\n defaultVariants: {\r\n variant: \"default\"\r\n }\r\n }\r\n)\r\n\r\ninterface AlertProps extends AlertPrimitive.AlertRootProps, VariantProps<typeof alertVariants> {}\r\n\r\nconst Alert: Component<AlertProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\", \"variant\"])\r\n return (\r\n <AlertPrimitive.Root\r\n class={cn(alertVariants({ variant: props.variant }), props.class)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\nconst AlertTitle: Component<ComponentProps<\"h5\">> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\"])\r\n return <h5 class={cn(\"mb-1 font-medium leading-none tracking-tight\", props.class)} {...rest} />\r\n}\r\n\r\nconst AlertDescription: Component<ComponentProps<\"div\">> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\"])\r\n return <div class={cn(\"text-sm [&_p]:leading-relaxed\", props.class)} {...rest} />\r\n}\r\n\r\nexport { Alert, AlertTitle, AlertDescription }\r\n"
"content": "import type { Component, ComponentProps } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport { Alert as AlertPrimitive } from \"@kobalte/core\"\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\n\r\nconst alertVariants = cva(\r\n \"[&>svg]:text-foreground relative w-full rounded-lg border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-background text-foreground\",\r\n destructive:\r\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\"\r\n }\r\n },\r\n defaultVariants: {\r\n variant: \"default\"\r\n }\r\n }\r\n)\r\n\r\ninterface AlertProps extends AlertPrimitive.AlertRootProps, VariantProps<typeof alertVariants> {}\r\n\r\nconst Alert: Component<AlertProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\", \"variant\"])\r\n return (\r\n <AlertPrimitive.Root\r\n class={cn(alertVariants({ variant: props.variant }), props.class)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\nconst AlertTitle: Component<ComponentProps<\"h5\">> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\"])\r\n return <h5 class={cn(\"mb-1 font-medium leading-none tracking-tight\", props.class)} {...rest} />\r\n}\r\n\r\nconst AlertDescription: Component<ComponentProps<\"div\">> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\"])\r\n return <div class={cn(\"text-sm [&_p]:leading-relaxed\", props.class)} {...rest} />\r\n}\r\n\r\nexport { Alert, AlertTitle, AlertDescription }\r\n"
}
],
"type": "ui"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/public/registry/ui/badge-delta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files": [
{
"name": "badge-delta.tsx",
"content": "import type { Component } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\nimport type { IconTypes } from \"solid-icons\"\r\nimport {\r\n TbArrowDown,\r\n TbArrowDownRight,\r\n TbArrowRight,\r\n TbArrowUp,\r\n TbArrowUpRight\r\n} from \"solid-icons/tb\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\nimport type { BadgeProps } from \"~/registry/ui/badge\"\r\nimport { Badge } from \"~/registry/ui/badge\"\r\n\r\ntype DeltaType = \"increase\" | \"moderateIncrease\" | \"unchanged\" | \"moderateDecrease\" | \"decrease\"\r\n\r\nconst badgeDeltaVariants = cva(\"\", {\r\n variants: {\r\n variant: {\r\n success: \"bg-success hover:bg-success text-success-foreground\",\r\n warning: \"bg-warning hover:bg-warning text-warning-foreground\",\r\n error: \"bg-error hover:bg-error text-error-foreground\"\r\n }\r\n }\r\n})\r\ntype DeltaVariant = NonNullable<VariantProps<typeof badgeDeltaVariants>[\"variant\"]>\r\n\r\nconst iconMap: { [key in DeltaType]: IconTypes } = {\r\n increase: TbArrowUp,\r\n moderateIncrease: TbArrowUpRight,\r\n unchanged: TbArrowRight,\r\n moderateDecrease: TbArrowDownRight,\r\n decrease: TbArrowDown\r\n}\r\n\r\nconst variantMap: { [key in DeltaType]: DeltaVariant } = {\r\n increase: \"success\",\r\n moderateIncrease: \"success\",\r\n unchanged: \"warning\",\r\n moderateDecrease: \"error\",\r\n decrease: \"error\"\r\n}\r\n\r\nexport interface BadgeDeltaProps extends Omit<BadgeProps, \"variant\"> {\r\n deltaType: DeltaType\r\n}\r\n\r\nconst BadgeDelta: Component<BadgeDeltaProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\", \"children\", \"deltaType\"])\r\n const Icon = iconMap[props.deltaType]\r\n const variant = variantMap[props.deltaType]\r\n\r\n return (\r\n <Badge class={cn(badgeDeltaVariants({ variant }), props.class)} {...rest}>\r\n <span class=\"flex gap-1\">\r\n <Icon class=\"h-4 w-4\" />\r\n {props.children}\r\n </span>\r\n </Badge>\r\n )\r\n}\r\n\r\nexport { BadgeDelta }\r\n"
"content": "import type { Component } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\nimport type { IconTypes } from \"solid-icons\"\r\nimport {\r\n TbArrowDown,\r\n TbArrowDownRight,\r\n TbArrowRight,\r\n TbArrowUp,\r\n TbArrowUpRight\r\n} from \"solid-icons/tb\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\nimport type { BadgeProps } from \"~/registry/ui/badge\"\r\nimport { Badge } from \"~/registry/ui/badge\"\r\n\r\ntype DeltaType = \"increase\" | \"moderateIncrease\" | \"unchanged\" | \"moderateDecrease\" | \"decrease\"\r\n\r\nconst badgeDeltaVariants = cva(\"\", {\r\n variants: {\r\n variant: {\r\n success: \"bg-success text-success-foreground hover:bg-success\",\r\n warning: \"bg-warning text-warning-foreground hover:bg-warning\",\r\n error: \"bg-error text-error-foreground hover:bg-error\"\r\n }\r\n }\r\n})\r\ntype DeltaVariant = NonNullable<VariantProps<typeof badgeDeltaVariants>[\"variant\"]>\r\n\r\nconst iconMap: { [key in DeltaType]: IconTypes } = {\r\n increase: TbArrowUp,\r\n moderateIncrease: TbArrowUpRight,\r\n unchanged: TbArrowRight,\r\n moderateDecrease: TbArrowDownRight,\r\n decrease: TbArrowDown\r\n}\r\n\r\nconst variantMap: { [key in DeltaType]: DeltaVariant } = {\r\n increase: \"success\",\r\n moderateIncrease: \"success\",\r\n unchanged: \"warning\",\r\n moderateDecrease: \"error\",\r\n decrease: \"error\"\r\n}\r\n\r\nexport interface BadgeDeltaProps extends Omit<BadgeProps, \"variant\"> {\r\n deltaType: DeltaType\r\n}\r\n\r\nconst BadgeDelta: Component<BadgeDeltaProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"class\", \"children\", \"deltaType\"])\r\n const Icon = iconMap[props.deltaType]\r\n const variant = variantMap[props.deltaType]\r\n\r\n return (\r\n <Badge class={cn(badgeDeltaVariants({ variant }), props.class)} {...rest}>\r\n <span class=\"flex gap-1\">\r\n <Icon class=\"h-4 w-4\" />\r\n {props.children}\r\n </span>\r\n </Badge>\r\n )\r\n}\r\n\r\nexport { BadgeDelta }\r\n"
}
],
"type": "ui"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/public/registry/ui/badge.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": [
{
"name": "badge.tsx",
"content": "import type { Component, ComponentProps } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\n\r\nconst badgeVariants = cva(\r\n \"inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary hover:bg-primary/80 border-transparent text-primary-foreground\",\r\n secondary:\r\n \"bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground\",\r\n destructive:\r\n \"bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground\",\r\n outline: \"text-foreground\"\r\n }\r\n },\r\n defaultVariants: {\r\n variant: \"default\"\r\n }\r\n }\r\n)\r\n\r\nexport interface BadgeProps extends ComponentProps<\"div\">, VariantProps<typeof badgeVariants> {}\r\n\r\nconst Badge: Component<BadgeProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"variant\", \"class\"])\r\n return <div class={cn(badgeVariants({ variant: props.variant }), props.class)} {...rest} />\r\n}\r\n\r\nexport { Badge, badgeVariants }\r\n"
"content": "import type { Component, ComponentProps } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\n\r\nconst badgeVariants = cva(\r\n \"focus:ring-ring inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary text-primary-foreground hover:bg-primary/80 border-transparent\",\r\n secondary:\r\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent\",\r\n destructive:\r\n \"bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent\",\r\n outline: \"text-foreground\"\r\n }\r\n },\r\n defaultVariants: {\r\n variant: \"default\"\r\n }\r\n }\r\n)\r\n\r\nexport interface BadgeProps extends ComponentProps<\"div\">, VariantProps<typeof badgeVariants> {}\r\n\r\nconst Badge: Component<BadgeProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"variant\", \"class\"])\r\n return <div class={cn(badgeVariants({ variant: props.variant }), props.class)} {...rest} />\r\n}\r\n\r\nexport { Badge, badgeVariants }\r\n"
}
],
"type": "ui"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/public/registry/ui/button.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"files": [
{
"name": "button.tsx",
"content": "import type { Component, ComponentProps } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\n\r\nconst buttonVariants = cva(\r\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n outline: \"border border-input hover:bg-accent hover:text-accent-foreground\",\r\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\r\n link: \"text-primary underline-offset-4 hover:underline\"\r\n },\r\n size: {\r\n default: \"h-10 px-4 py-2\",\r\n sm: \"h-9 rounded-md px-3\",\r\n lg: \"h-11 rounded-md px-8\"\r\n }\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\"\r\n }\r\n }\r\n)\r\n\r\nexport interface ButtonProps\r\n extends ComponentProps<\"button\">,\r\n VariantProps<typeof buttonVariants> {}\r\n\r\nconst Button: Component<ButtonProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"variant\", \"size\", \"class\"])\r\n return (\r\n <button\r\n class={cn(buttonVariants({ variant: props.variant, size: props.size }), props.class)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\nexport { Button, buttonVariants }\r\n"
"content": "import type { Component, ComponentProps } from \"solid-js\"\r\nimport { splitProps } from \"solid-js\"\r\n\r\nimport type { VariantProps } from \"class-variance-authority\"\r\nimport { cva } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"~/lib/utils\"\r\n\r\nconst buttonVariants = cva(\r\n \"ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n outline: \"border-input hover:bg-accent hover:text-accent-foreground border\",\r\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\r\n link: \"text-primary underline-offset-4 hover:underline\"\r\n },\r\n size: {\r\n default: \"h-10 px-4 py-2\",\r\n sm: \"h-9 rounded-md px-3\",\r\n lg: \"h-11 rounded-md px-8\"\r\n }\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\"\r\n }\r\n }\r\n)\r\n\r\nexport interface ButtonProps\r\n extends ComponentProps<\"button\">,\r\n VariantProps<typeof buttonVariants> {}\r\n\r\nconst Button: Component<ButtonProps> = (props) => {\r\n const [, rest] = splitProps(props, [\"variant\", \"size\", \"class\"])\r\n return (\r\n <button\r\n class={cn(buttonVariants({ variant: props.variant, size: props.size }), props.class)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\nexport { Button, buttonVariants }\r\n"
}
],
"type": "ui"
Expand Down
Loading

0 comments on commit f9a86fe

Please sign in to comment.