@bezdenegsvarkinet/ui-library 1.1.0 → 1.1.2
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/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/lib/utils.ts","../src/stories/typography/ui/typography.tsx","../src/stories/typography/config/typography-sizes.ts","../src/stories/button/ui/button.tsx","../src/stories/button/config/button-bgs.ts","../src/stories/button/config/button-sizes.ts"],"sourcesContent":["// Экспортируем только компоненты, не stories и не CSS\nexport
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/lib/utils.ts","../src/stories/typography/ui/typography.tsx","../src/stories/typography/config/typography-sizes.ts","../src/stories/button/ui/button.tsx","../src/stories/button/config/button-bgs.ts","../src/stories/button/config/button-sizes.ts"],"sourcesContent":["// Экспортируем только компоненты, не stories и не CSS\nexport { Typography } from './stories/typography'\nexport { Button } from './stories/button'\n\n// export type { IButtonProps } from 'src/stories/button/ui/button'\n// export type { ITypographyProps } from 'src/stories/typography/ui/typography'\n\n// Импортируем CSS с Tailwind (он попадёт в сборку)\nimport './index.css'","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client'\n\nimport { FC } from 'react'\nimport { cn } from '@/lib/utils'\nimport { cva, VariantProps } from 'class-variance-authority'\nimport { typographySizes } from '../config/typography-sizes'\n\nconst typographyVariants = cva('transition-all duration-300 leading-[100%]', {\n\tvariants: {\n\t\tsize: {\n\t\t\t...typographySizes,\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: 'button/m/16',\n\t},\n})\n\ntype TTag = 'p' | 'span'\n\nexport interface ITypographyProps\n\textends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {\n\tchildren: React.ReactNode\n\ttag?: TTag\n}\n\nexport const Typography: FC<ITypographyProps> = ({ children, tag = 'p', size, className, ...props }) => {\n\tconst Tag = tag\n\n\treturn (\n\t\t<Tag {...props} className={cn(typographyVariants({ size, className }))}>\n\t\t\t{children}\n\t\t</Tag>\n\t)\n}","export const typographySizes = {\n\t'button/m/16': 'text-[16px] font-medium',\n\t'button/m/14': 'text-[14px] font-medium',\n}","'use client'\n\nimport { FC } from 'react'\nimport { cva, VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { Typography } from '@/stories/typography'\nimport { buttonBgs, buttonSizes } from '../config'\n\nconst buttonVariants = cva('transition-all duration-300 py-2 px-4 rounded-[8px] leading-[100%]', {\n\tvariants: {\n\t\tbg: {\n\t\t\t...buttonBgs,\n\t\t},\n\t\tsize: {\n\t\t\t...buttonSizes,\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tbg: 'primary',\n\t\tsize: '32',\n\t},\n})\n\nexport interface IButtonProps\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n\t/** Контент кнопки (текст или иконки) */\n\tchildren: React.ReactNode\n\t/**\n\t * Если true, оборачивает children в компонент Typography для единообразия.\n\t * По умолчанию false.\n\t */\n\tasChild?: boolean\n}\n\n/**\n * Компонент Button используется для интерактивных элементов действия.\n * Поддерживает различные варианты оформления (bg) и размеры (size).\n *\n * @example\n * <Button bg=\"primary\" size=\"40\">Нажми меня</Button>\n */\nexport const Button: FC<IButtonProps> = ({ children, bg, size, className, asChild = false, ...props }) => {\n\treturn (\n\t\t<button {...props} className={cn(buttonVariants({ bg, size, className }))}>\n\t\t\t{asChild ? <Typography>{children}</Typography> : children}\n\t\t</button>\n\t)\n}","export const buttonBgs = {\n\tprimary: 'bg-blue-500 text-white hover:bg-blue-600',\n\tsecondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300',\n\toutline: 'bg-transparent border-2 border-blue-500 text-blue-500 hover:bg-blue-50',\n}","export const buttonSiz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