vagaro-tw-components
Version:
Tailwind CSS React TypeScript components for Vagaro
1 lines • 14.2 kB
Source Map (JSON)
{"version":3,"sources":["../src/utils/cn.ts","../src/components/Button.tsx","../src/components/Card.tsx","../src/components/Input.tsx","../src/components/Badge.tsx","../src/components/RightArrow.tsx","../src/components/PageBanner.tsx"],"names":["cn","inputs","twMerge","clsx","buttonVariants","buttonSizes","Button","forwardRef","className","variant","size","fullWidth","loading","disabled","children","props","ref","jsxs","jsx","cardVariants","cardPadding","Card","padding","Input","label","error","helperText","id","inputId","badgeVariants","badgeSizes","Badge","RightArrow","fillClass","width","height","ariaLabel","RightArrow_default","PageBanner","text","href","LinkComponent","linkProps","openInNewTab","defaultLinkProps"],"mappings":"qIAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCDA,IAAMG,EAAiB,CACrB,OAAA,CAAS,oEACT,CAAA,SAAA,CAAW,oEACX,CAAA,OAAA,CAAS,uHACT,CAAA,KAAA,CAAO,wDACP,CAAA,MAAA,CAAQ,2DACV,CAAA,CAEMC,CAAc,CAAA,CAClB,EAAI,CAAA,qBAAA,CACJ,GAAI,qBACJ,CAAA,EAAA,CAAI,mBACN,CAAA,CAEaC,CAASC,CAAAA,UAAAA,CACpB,CAAC,CACC,SAAAC,CAAAA,CAAAA,CACA,OAAAC,CAAAA,CAAAA,CAAU,SACV,CAAA,IAAA,CAAAC,CAAO,CAAA,IAAA,CACP,UAAAC,CAAY,CAAA,KAAA,CACZ,OAAAC,CAAAA,CAAAA,CAAU,KACV,CAAA,QAAA,CAAAC,CACA,CAAA,QAAA,CAAAC,CACA,CAAA,GAAGC,CACL,CAAA,CAAGC,CAECC,GAAAA,IAAAA,CAAC,QACC,CAAA,CAAA,GAAA,CAAKD,EACL,SAAWhB,CAAAA,CAAAA,CACT,sLACAI,CAAAA,CAAAA,CAAeK,CAAO,CAAA,CACtBJ,CAAYK,CAAAA,CAAI,CA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wind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import React, { forwardRef } from 'react';\nimport { cn } from '../utils/cn';\nimport type { ButtonProps } from '../types';\n\nconst buttonVariants = {\n primary: 'bg-vagaro-primary text-white hover:bg-blue-700 focus:ring-blue-500',\n secondary: 'bg-vagaro-secondary text-white hover:bg-red-600 focus:ring-red-500',\n outline: 'border-2 border-vagaro-primary text-vagaro-primary hover:bg-vagaro-primary hover:text-white focus:ring-vagaro-primary',\n ghost: 'text-vagaro-dark hover:bg-gray-100 focus:ring-gray-500',\n danger: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500'\n};\n\nconst buttonSizes = {\n sm: 'px-3 py-1.5 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg'\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ \n className, \n variant = 'primary', \n size = 'md', \n fullWidth = false,\n loading = false,\n disabled,\n children,\n ...props \n }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed',\n buttonVariants[variant],\n buttonSizes[size],\n fullWidth && 'w-full',\n loading && 'cursor-wait',\n className\n )}\n disabled={disabled || loading}\n {...props}\n >\n {loading && (\n <svg \n className=\"animate-spin -ml-1 mr-2 h-4 w-4\" \n xmlns=\"http://www.w3.org/2000/svg\" \n fill=\"none\" \n viewBox=\"0 0 24 24\"\n >\n <circle \n className=\"opacity-25\" \n cx=\"12\" \n cy=\"12\" \n r=\"10\" \n stroke=\"currentColor\" \n strokeWidth=\"4\"\n />\n <path \n className=\"opacity-75\" \n fill=\"currentColor\" \n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n )}\n {children}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';","import React, { forwardRef } from 'react';\nimport { cn } from '../utils/cn';\nimport type { CardProps } from '../types';\n\nconst cardVariants = {\n default: 'bg-white',\n bordered: 'bg-white border border-gray-200',\n shadow: 'bg-white shadow-lg'\n};\n\nconst cardPadding = {\n none: '',\n sm: 'p-3',\n md: 'p-6',\n lg: 'p-8'\n};\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(\n ({ className, variant = 'default', padding = 'md', children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'rounded-lg',\n cardVariants[variant],\n cardPadding[padding],\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nCard.displayName = 'Card';","import React, { forwardRef } from 'react';\nimport { cn } from '../utils/cn';\nimport type { InputProps } from '../types';\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, label, error, helperText, fullWidth = false, id, ...props }, ref) => {\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n \n return (\n <div className={cn('flex flex-col gap-1', fullWidth && 'w-full')}>\n {label && (\n <label \n htmlFor={inputId}\n className=\"text-sm font-medium text-gray-700\"\n >\n {label}\n </label>\n )}\n <input\n ref={ref}\n id={inputId}\n className={cn(\n 'px-3 py-2 border rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2',\n error\n ? 'border-red-500 focus:ring-red-500'\n : 'border-gray-300 focus:border-vagaro-primary focus:ring-vagaro-primary',\n fullWidth && 'w-full',\n className\n )}\n aria-invalid={!!error}\n aria-describedby={error ? `${inputId}-error` : helperText ? `${inputId}-helper` : undefined}\n {...props}\n />\n {error && (\n <p id={`${inputId}-error`} className=\"text-sm text-red-600\">\n {error}\n </p>\n )}\n {helperText && !error && (\n <p id={`${inputId}-helper`} className=\"text-sm text-gray-500\">\n {helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = 'Input';","import React, { forwardRef } from 'react';\nimport { cn } from '../utils/cn';\nimport type { BadgeProps } from '../types';\n\nconst badgeVariants = {\n default: 'bg-gray-100 text-gray-800',\n primary: 'bg-blue-100 text-blue-800',\n secondary: 'bg-purple-100 text-purple-800',\n success: 'bg-green-100 text-green-800',\n warning: 'bg-yellow-100 text-yellow-800',\n danger: 'bg-red-100 text-red-800'\n};\n\nconst badgeSizes = {\n sm: 'px-2 py-0.5 text-xs',\n md: 'px-2.5 py-1 text-sm',\n lg: 'px-3 py-1.5 text-base'\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant = 'default', size = 'md', children, ...props }, ref) => {\n return (\n <span\n ref={ref}\n className={cn(\n 'inline-flex items-center font-medium rounded-full',\n badgeVariants[variant],\n badgeSizes[size],\n className\n )}\n {...props}\n >\n {children}\n </span>\n );\n }\n);\n\nBadge.displayName = 'Badge';","import React from 'react';\n\ninterface RightArrowProps {\n /**\n * CSS class for styling the SVG\n */\n fillClass?: string;\n /**\n * Width of the SVG icon\n * @default '1em'\n */\n width?: string | number;\n /**\n * Height of the SVG icon\n * @default '1em'\n */\n height?: string | number;\n /**\n * Accessible label for the icon\n * @default 'Right arrow icon'\n */\n ariaLabel?: string;\n}\n\nconst RightArrow: React.FC<RightArrowProps> = ({ \n fillClass, \n width = '1em', \n height = '1em',\n ariaLabel = 'Right arrow icon'\n}) => {\n return (\n <svg\n aria-label={ariaLabel}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 448 512\"\n className={fillClass}\n width={width}\n height={height}\n >\n <path\n d=\"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport default RightArrow;\n","import React from 'react'\nimport RightArrow from './RightArrow'\n\ninterface PageBannerProps {\n /**\n * The text content to display in the banner\n */\n text: string\n /**\n * The URL to link to\n */\n href: string\n /**\n * Optional custom link component (e.g., Next.js Link)\n * If not provided, uses a standard anchor tag\n */\n linkComponent?: React.ElementType\n /**\n * Additional props to pass to the link component\n */\n linkProps?: Record<string, any>\n /**\n * Whether to open the link in a new tab\n * @default true\n */\n openInNewTab?: boolean\n}\n\nexport const PageBanner: React.FC<PageBannerProps> = ({ \n text,\n href,\n linkComponent: LinkComponent = 'a',\n linkProps = {},\n openInNewTab = true\n}) => {\n const defaultLinkProps = {\n href,\n ...(openInNewTab && {\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }),\n className: \"group\",\n ...linkProps\n }\n\n return (\n <LinkComponent {...defaultLinkProps}>\n <div className=\"mt-16 flex h-24 items-center justify-center rounded bg-inkLightest p-4 text-center text-lg font-semibold text-primary transition-all duration-300 group-hover:bg-primary group-hover:text-white md:text-2xl\">\n <div className=\"div\">\n {text}\n </div>\n <RightArrow\n fillClass=\"text-primary group-hover:text-white ml-2\"\n width=\"16\"\n height=\"16\"\n />\n </div>\n </LinkComponent>\n )\n}"]}