@bezdenegsvarkinet/ui-library 1.0.1 → 1.1.0

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 CHANGED
@@ -25,9 +25,6 @@ __export(index_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(index_exports);
27
27
 
28
- // src/stories/button/button.tsx
29
- var import_class_variance_authority2 = require("class-variance-authority");
30
-
31
28
  // src/lib/utils.ts
32
29
  var import_clsx = require("clsx");
33
30
  var import_tailwind_merge = require("tailwind-merge");
@@ -35,16 +32,16 @@ function cn(...inputs) {
35
32
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
36
33
  }
37
34
 
38
- // src/stories/typography/typography.tsx
35
+ // src/stories/typography/ui/typography.tsx
39
36
  var import_class_variance_authority = require("class-variance-authority");
40
37
 
41
- // src/stories/typography/typography-sizes.ts
38
+ // src/stories/typography/config/typography-sizes.ts
42
39
  var typographySizes = {
43
40
  "button/m/16": "text-[16px] font-medium",
44
41
  "button/m/14": "text-[14px] font-medium"
45
42
  };
46
43
 
47
- // src/stories/typography/typography.tsx
44
+ // src/stories/typography/ui/typography.tsx
48
45
  var import_jsx_runtime = require("react/jsx-runtime");
49
46
  var typographyVariants = (0, import_class_variance_authority.cva)("transition-all duration-300 leading-[100%]", {
50
47
  variants: {
@@ -61,14 +58,17 @@ var Typography = ({ children, tag = "p", size, className, ...props }) => {
61
58
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { ...props, className: cn(typographyVariants({ size, className })), children });
62
59
  };
63
60
 
64
- // src/stories/button/button-bgs.ts
61
+ // src/stories/button/ui/button.tsx
62
+ var import_class_variance_authority2 = require("class-variance-authority");
63
+
64
+ // src/stories/button/config/button-bgs.ts
65
65
  var buttonBgs = {
66
66
  primary: "bg-blue-500 text-white hover:bg-blue-600",
67
67
  secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300",
68
68
  outline: "bg-transparent border-2 border-blue-500 text-blue-500 hover:bg-blue-50"
69
69
  };
70
70
 
71
- // src/stories/button/button-sizes.ts
71
+ // src/stories/button/config/button-sizes.ts
72
72
  var buttonSizes = {
73
73
  "32": "h-[32px]",
74
74
  "40": "h-[40px]",
@@ -76,7 +76,7 @@ var buttonSizes = {
76
76
  "56": "h-[56px]"
77
77
  };
78
78
 
79
- // src/stories/button/button.tsx
79
+ // src/stories/button/ui/button.tsx
80
80
  var import_jsx_runtime2 = require("react/jsx-runtime");
81
81
  var buttonVariants = (0, import_class_variance_authority2.cva)("transition-all duration-300 py-2 px-4 rounded-[8px] leading-[100%]", {
82
82
  variants: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/stories/button/button.tsx","../src/lib/utils.ts","../src/stories/typography/typography.tsx","../src/stories/typography/typography-sizes.ts","../src/stories/button/button-bgs.ts","../src/stories/button/button-sizes.ts"],"sourcesContent":["// Экспортируем только компоненты, не stories и не CSS\nexport { Button } from './stories/button/button'\nexport { Typography } from './stories/typography/typography'\n\nexport type { IButtonProps } from './stories/button/button'\nexport type { ITypographyProps } from './stories/typography/typography'\n\n// Импортируем CSS с Tailwind (он попадёт в сборку)\nimport './index.css'","'use client'\n\nimport { FC } from 'react'\nimport { cva, VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { Typography } from '../typography/typography'\nimport { buttonBgs } from './button-bgs'\nimport { buttonSizes } from './button-sizes'\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}","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 '../typography/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}\n\nexport type TTypographySizes = keyof typeof typographySizes","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 h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,EAAE,UAAU,IAAI,MAAM,WAAW,UAAU,OAAO,GAAG,MAAM,MAAM;AACzG,SACC,6CAAC,YAAQ,GAAG,OAAO,WAAW,GAAG,eAAe,EAAE,IAAI,MAAM,UAAU,CAAC,CAAC,GACtE,oBAAU,6CAAC,cAAY,UAAS,IAAgB,UAClD;AAEF;","names":["import_class_variance_authority","import_jsx_runtime"]}
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 * from './stories/typography'\nexport * 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 buttonSizes = {\n\t'32': 'h-[32px]',\n\t'40': 'h-[40px]',\n\t'48': 'h-[48px]',\n\t'56': 'h-[56px]',\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AA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_class_variance_authority","import_jsx_runtime"]}
package/dist/index.d.cts CHANGED
@@ -2,6 +2,16 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import { FC } from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
+ declare const typographyVariants: (props?: ({
6
+ size?: "button/m/16" | "button/m/14" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ type TTag = 'p' | 'span';
9
+ interface ITypographyProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {
10
+ children: React.ReactNode;
11
+ tag?: TTag;
12
+ }
13
+ declare const Typography: FC<ITypographyProps>;
14
+
5
15
  declare const buttonVariants: (props?: ({
6
16
  bg?: "primary" | "secondary" | "outline" | null | undefined;
7
17
  size?: "32" | "40" | "48" | "56" | null | undefined;
@@ -24,14 +34,4 @@ interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Va
24
34
  */
25
35
  declare const Button: FC<IButtonProps>;
26
36
 
27
- declare const typographyVariants: (props?: ({
28
- size?: "button/m/16" | "button/m/14" | null | undefined;
29
- } & class_variance_authority_types.ClassProp) | undefined) => string;
30
- type TTag = 'p' | 'span';
31
- interface ITypographyProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {
32
- children: React.ReactNode;
33
- tag?: TTag;
34
- }
35
- declare const Typography: FC<ITypographyProps>;
36
-
37
- export { Button, type IButtonProps, type ITypographyProps, Typography };
37
+ export { Button, Typography };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,16 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import { FC } from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
+ declare const typographyVariants: (props?: ({
6
+ size?: "button/m/16" | "button/m/14" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ type TTag = 'p' | 'span';
9
+ interface ITypographyProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {
10
+ children: React.ReactNode;
11
+ tag?: TTag;
12
+ }
13
+ declare const Typography: FC<ITypographyProps>;
14
+
5
15
  declare const buttonVariants: (props?: ({
6
16
  bg?: "primary" | "secondary" | "outline" | null | undefined;
7
17
  size?: "32" | "40" | "48" | "56" | null | undefined;
@@ -24,14 +34,4 @@ interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Va
24
34
  */
25
35
  declare const Button: FC<IButtonProps>;
26
36
 
27
- declare const typographyVariants: (props?: ({
28
- size?: "button/m/16" | "button/m/14" | null | undefined;
29
- } & class_variance_authority_types.ClassProp) | undefined) => string;
30
- type TTag = 'p' | 'span';
31
- interface ITypographyProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {
32
- children: React.ReactNode;
33
- tag?: TTag;
34
- }
35
- declare const Typography: FC<ITypographyProps>;
36
-
37
- export { Button, type IButtonProps, type ITypographyProps, Typography };
37
+ export { Button, Typography };
package/dist/index.js CHANGED
@@ -1,6 +1,3 @@
1
- // src/stories/button/button.tsx
2
- import { cva as cva2 } from "class-variance-authority";
3
-
4
1
  // src/lib/utils.ts
5
2
  import { clsx } from "clsx";
6
3
  import { twMerge } from "tailwind-merge";
@@ -8,16 +5,16 @@ function cn(...inputs) {
8
5
  return twMerge(clsx(inputs));
9
6
  }
10
7
 
11
- // src/stories/typography/typography.tsx
8
+ // src/stories/typography/ui/typography.tsx
12
9
  import { cva } from "class-variance-authority";
13
10
 
14
- // src/stories/typography/typography-sizes.ts
11
+ // src/stories/typography/config/typography-sizes.ts
15
12
  var typographySizes = {
16
13
  "button/m/16": "text-[16px] font-medium",
17
14
  "button/m/14": "text-[14px] font-medium"
18
15
  };
19
16
 
20
- // src/stories/typography/typography.tsx
17
+ // src/stories/typography/ui/typography.tsx
21
18
  import { jsx } from "react/jsx-runtime";
22
19
  var typographyVariants = cva("transition-all duration-300 leading-[100%]", {
23
20
  variants: {
@@ -34,14 +31,17 @@ var Typography = ({ children, tag = "p", size, className, ...props }) => {
34
31
  return /* @__PURE__ */ jsx(Tag, { ...props, className: cn(typographyVariants({ size, className })), children });
35
32
  };
36
33
 
37
- // src/stories/button/button-bgs.ts
34
+ // src/stories/button/ui/button.tsx
35
+ import { cva as cva2 } from "class-variance-authority";
36
+
37
+ // src/stories/button/config/button-bgs.ts
38
38
  var buttonBgs = {
39
39
  primary: "bg-blue-500 text-white hover:bg-blue-600",
40
40
  secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300",
41
41
  outline: "bg-transparent border-2 border-blue-500 text-blue-500 hover:bg-blue-50"
42
42
  };
43
43
 
44
- // src/stories/button/button-sizes.ts
44
+ // src/stories/button/config/button-sizes.ts
45
45
  var buttonSizes = {
46
46
  "32": "h-[32px]",
47
47
  "40": "h-[40px]",
@@ -49,7 +49,7 @@ var buttonSizes = {
49
49
  "56": "h-[56px]"
50
50
  };
51
51
 
52
- // src/stories/button/button.tsx
52
+ // src/stories/button/ui/button.tsx
53
53
  import { jsx as jsx2 } from "react/jsx-runtime";
54
54
  var buttonVariants = cva2("transition-all duration-300 py-2 px-4 rounded-[8px] leading-[100%]", {
55
55
  variants: {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/stories/button/button.tsx","../src/lib/utils.ts","../src/stories/typography/typography.tsx","../src/stories/typography/typography-sizes.ts","../src/stories/button/button-bgs.ts","../src/stories/button/button-sizes.ts"],"sourcesContent":["'use client'\n\nimport { FC } from 'react'\nimport { cva, VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { Typography } from '../typography/typography'\nimport { buttonBgs } from './button-bgs'\nimport { buttonSizes } from './button-sizes'\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}","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 '../typography/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}\n\nexport type TTypographySizes = keyof typeof typographySizes","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 buttonSizes = {\n\t'32': 'h-[32px]',\n\t'40': 'h-[40px]',\n\t'48': 'h-[48px]',\n\t'56': 'h-[56px]',\n}"],"mappings":";AAGA,SAAS,OAAAA,YAAyB;;;ACHlC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACDA,SAAS,WAAyB;;;ACJ3B,IAAM,kBAAkB;AAAA,EAC9B,eAAe;AAAA,EACf,eAAe;AAChB;;;AD2BE;AAvBF,IAAM,qBAAqB,IAAI,8CAA8C;AAAA,EAC5E,UAAU;AAAA,IACT,MAAM;AAAA,MACL,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,EACP;AACD,CAAC;AAUM,IAAM,aAAmC,CAAC,EAAE,UAAU,MAAM,KAAK,MAAM,WAAW,GAAG,MAAM,MAAM;AACvG,QAAM,MAAM;AAEZ,SACC,oBAAC,OAAK,GAAG,OAAO,WAAW,GAAG,mBAAmB,EAAE,MAAM,UAAU,CAAC,CAAC,GACnE,UACF;AAEF;;;AElCO,IAAM,YAAY;AAAA,EACxB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AACV;;;ACJO,IAAM,cAAc;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;;;ALwCc,gBAAAC,YAAA;AApCd,IAAM,iBAAiBC,KAAI,sEAAsE;AAAA,EAChG,UAAU;AAAA,IACT,IAAI;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACL,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EACA,iBAAiB;AAAA,IAChB,IAAI;AAAA,IACJ,MAAM;AAAA,EACP;AACD,CAAC;AAoBM,IAAM,SAA2B,CAAC,EAAE,UAAU,IAAI,MAAM,WAAW,UAAU,OAAO,GAAG,MAAM,MAAM;AACzG,SACC,gBAAAD,KAAC,YAAQ,GAAG,OAAO,WAAW,GAAG,eAAe,EAAE,IAAI,MAAM,UAAU,CAAC,CAAC,GACtE,oBAAU,gBAAAA,KAAC,cAAY,UAAS,IAAgB,UAClD;AAEF;","names":["cva","jsx","cva"]}
1
+ {"version":3,"sources":["../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":["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 buttonSizes = {\n\t'32': 'h-[32px]',\n\t'40': 'h-[40px]',\n\t'48': 'h-[48px]',\n\t'56': 'h-[56px]',\n}"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACDA,SAAS,WAAyB;;;ACJ3B,IAAM,kBAAkB;AAAA,EAC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"version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"