@modul/mbui 0.0.16-beta-pv-53147-00d3e008 → 0.0.16-beta-pv-53139-88618ef5

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.
Files changed (104) hide show
  1. package/dist/Alert/Alert.d.ts +6 -15
  2. package/dist/Alert/Alert.js +19 -30
  3. package/dist/Alert/Alert.js.map +1 -1
  4. package/dist/AlertDialog/AlertDialog.js +10 -10
  5. package/dist/AlertDialog/AlertDialog.js.map +1 -1
  6. package/dist/Badge/Badge.d.ts +10 -0
  7. package/dist/Badge/Badge.js +52 -0
  8. package/dist/Badge/Badge.js.map +1 -0
  9. package/dist/Badge/index.d.ts +1 -0
  10. package/dist/Badge/index.js +7 -0
  11. package/dist/Badge/index.js.map +1 -0
  12. package/dist/BottomNavigation/BottomNavigation.js +3 -21
  13. package/dist/BottomNavigation/BottomNavigation.js.map +1 -1
  14. package/dist/Button/Button.d.ts +2 -2
  15. package/dist/Button/Button.js +119 -17
  16. package/dist/Button/Button.js.map +1 -1
  17. package/dist/Button/index.js.map +1 -1
  18. package/dist/Calendar/Calendar.js +3 -3
  19. package/dist/Calendar/Calendar.js.map +1 -1
  20. package/dist/Checkbox/Checkbox.d.ts +4 -0
  21. package/dist/Checkbox/Checkbox.js +35 -0
  22. package/dist/Checkbox/Checkbox.js.map +1 -0
  23. package/dist/Checkbox/index.d.ts +1 -0
  24. package/dist/Checkbox/index.js +6 -0
  25. package/dist/Checkbox/index.js.map +1 -0
  26. package/dist/Chip/Chip.js +3 -2
  27. package/dist/Chip/Chip.js.map +1 -1
  28. package/dist/Collapsible/AccountCollapsible.js +3 -18
  29. package/dist/Collapsible/AccountCollapsible.js.map +1 -1
  30. package/dist/DatePicker/DatePicker.js +6 -6
  31. package/dist/DatePicker/DatePicker.js.map +1 -1
  32. package/dist/Drawer/Drawer.js +3 -3
  33. package/dist/Drawer/Drawer.js.map +1 -1
  34. package/dist/Form/Form.js +6 -6
  35. package/dist/Form/Form.js.map +1 -1
  36. package/dist/Icon/icons/InfoSolid.js +1 -1
  37. package/dist/Icon/icons/InfoSolid.js.map +1 -1
  38. package/dist/Input/Input.js +3 -3
  39. package/dist/Input/Input.js.map +1 -1
  40. package/dist/Input/InputMask.js +1 -22
  41. package/dist/Input/InputMask.js.map +1 -1
  42. package/dist/Input-OTP/Input.js +5 -4
  43. package/dist/Input-OTP/Input.js.map +1 -1
  44. package/dist/Label/Label.js +2 -2
  45. package/dist/Label/Label.js.map +1 -1
  46. package/dist/Page/Page.js +4 -4
  47. package/dist/Page/Page.js.map +1 -1
  48. package/dist/Popover/Popover.js +2 -23
  49. package/dist/Popover/Popover.js.map +1 -1
  50. package/dist/Progress/Progress.js +3 -11
  51. package/dist/Progress/Progress.js.map +1 -1
  52. package/dist/Select/SelectAccountCard.js +7 -33
  53. package/dist/Select/SelectAccountCard.js.map +1 -1
  54. package/dist/Select/SelectAsync.js +6 -17
  55. package/dist/Select/SelectAsync.js.map +1 -1
  56. package/dist/Select/SelectBase.js +6 -17
  57. package/dist/Select/SelectBase.js.map +1 -1
  58. package/dist/Slider/Slider.js +5 -21
  59. package/dist/Slider/Slider.js.map +1 -1
  60. package/dist/Switch/Switch.js +13 -27
  61. package/dist/Switch/Switch.js.map +1 -1
  62. package/dist/Tabs/Tabs.js +9 -39
  63. package/dist/Tabs/Tabs.js.map +1 -1
  64. package/dist/Textarea/Textarea.d.ts +1 -1
  65. package/dist/Textarea/Textarea.js +3 -20
  66. package/dist/Textarea/Textarea.js.map +1 -1
  67. package/dist/index.d.ts +5 -3
  68. package/dist/index.js +8 -2
  69. package/dist/index.js.map +1 -1
  70. package/package.json +2 -1
  71. package/src/@/config/index.ts +72 -72
  72. package/src/Alert/Alert.tsx +25 -68
  73. package/src/AlertDialog/AlertDialog.tsx +3 -2
  74. package/src/Badge/Badge.tsx +58 -0
  75. package/src/Badge/index.ts +1 -0
  76. package/src/BottomNavigation/BottomNavigation.tsx +2 -20
  77. package/src/Button/Button.tsx +140 -43
  78. package/src/Button/index.ts +1 -1
  79. package/src/Calendar/Calendar.tsx +1 -1
  80. package/src/Checkbox/Checkbox.tsx +44 -0
  81. package/src/Checkbox/index.ts +1 -0
  82. package/src/Chip/Chip.tsx +3 -2
  83. package/src/Collapsible/AccountCollapsible.tsx +3 -19
  84. package/src/DatePicker/DatePicker.tsx +5 -5
  85. package/src/Drawer/Drawer.tsx +1 -2
  86. package/src/Form/Form.tsx +3 -5
  87. package/src/Icon/icons/InfoSolid.tsx +1 -1
  88. package/src/Input/Input.tsx +1 -1
  89. package/src/Input/InputMask.tsx +1 -22
  90. package/src/Input-OTP/Input.tsx +2 -1
  91. package/src/Label/Label.tsx +1 -1
  92. package/src/Page/Page.tsx +1 -1
  93. package/src/Popover/Popover.tsx +2 -24
  94. package/src/Progress/Progress.tsx +3 -11
  95. package/src/Select/Select.tsx +1 -1
  96. package/src/Select/SelectAccountCard.tsx +11 -32
  97. package/src/Select/SelectAsync.tsx +10 -16
  98. package/src/Select/SelectBase.tsx +6 -16
  99. package/src/Slider/Slider.tsx +4 -21
  100. package/src/Switch/Switch.tsx +13 -26
  101. package/src/Tabs/Tabs.tsx +9 -41
  102. package/src/Textarea/Textarea.tsx +19 -30
  103. package/src/assets/css/global.css +6 -11
  104. package/src/index.ts +9 -3
@@ -1,81 +1,38 @@
1
1
  import * as React from 'react'
2
- import { cn } from '@utils'
3
- import { CheckCircleSolid, InfoSolid, Warning } from '@/Icon'
4
- import { ReactNode } from "react";
5
-
6
- const AleltIconClasses = '[&+div]:ml-[8px] shrink-0'
7
- const AlertIcons = {
8
- info: <InfoSolid aria-hidden={true} className={cn(AleltIconClasses, 'text-primary')} width={24} height={24} />,
9
- warning: <Warning aria-hidden={true} className={cn(AleltIconClasses, 'text-warning')} width={24} height={24} />,
10
- success: <CheckCircleSolid aria-hidden={true} className={cn(AleltIconClasses, 'text-success')} width={24} height={24} />,
11
- critical: <InfoSolid aria-hidden={true} className={cn(AleltIconClasses, 'text-critical')} width={24} height={24} />
12
- }
13
-
14
- const Title = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => (
15
- <div
16
- role="heading"
17
- ref={ref}
18
- className={cn('text-[14px] font-medium', className)}
19
- {...props}
20
- />
21
- ))
22
-
23
- const Description = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => (
24
- <p
25
- ref={ref}
26
- className={cn('text-[14px] [&>a]:text-primary [&>a]:underline', className)}
27
- {...props}
28
- />
29
- ))
30
-
31
- const getClass = (variant, type): string => {
32
- const commonClasses = 'px-[8px] py-[16px] border rounded-md '
33
- const variants = {
34
- info: `${type !== 'text' ? `${commonClasses} bg-primary-light border-primary` : 'text-primary'}`,
35
- warning: `${type !== 'text' ? `${commonClasses} bg-warning-light border-warning` : 'text-warning'}`,
36
- success: `${type !== 'text' ? `${commonClasses} bg-success-light border-success` : 'text-success'}`,
37
- critical: `${type !== 'text' ? `${commonClasses} bg-critical-light border-critical` : 'text-critical'}`,
38
- }
39
- return variants[variant]
40
-
41
- }
42
-
43
- interface TAlertComponents {
44
- displayName: string;
45
- Title: typeof Title;
46
- Description: typeof Description;
47
- }
48
-
49
- interface IAlertProps {
50
- className?: string;
51
- variant?: string;
52
- type?: string;
53
- children: ReactNode;
2
+ import { cva, type VariantProps } from 'class-variance-authority'
3
+
4
+ import { cn } from '../@/lib/utils'
5
+ // import { cn } from "@/lib/utils" порешать с алиасами
6
+
7
+ const alertVariants = cva('px-[16px] py-[12px] rounded-sm text-[14px]', {
8
+ variants: {
9
+ variant: {
10
+ light: 'bg-[--cl-graphite-7]',
11
+ success: 'bg-success-light',
12
+ warning: 'bg-warning-light',
13
+ critical: 'bg-critical text-white',
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: 'light'
18
+ },
19
+ })
20
+
21
+
22
+ export interface IProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
54
23
  }
55
24
 
56
- type TAlertProps = IAlertProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
57
-
58
- const Alert: React.FC<TAlertProps> & TAlertComponents = ({ className, variant = 'info', type, children, ...props }) => {
25
+ const Alert = React.forwardRef<HTMLDivElement, IProps>(({ className, variant, children, ...props }, ref) => {
59
26
  return (
60
27
  <div
61
- className={cn('flex', getClass(variant, type))}
62
- role='alert'
28
+ className={cn(alertVariants({ variant, className }))}
63
29
  {...props}
64
30
  >
65
- {AlertIcons[variant]}
66
- <div className='pt-[2px]'>
67
- {children}
68
- </div>
31
+ {children}
69
32
  </div>
70
33
  )
71
- }
34
+ })
72
35
 
73
36
  Alert.displayName = 'Alert'
74
37
 
75
- Alert.Title = Title
76
- Alert.Title.displayName = 'Alert.Title'
77
-
78
- Alert.Description = Description
79
- Alert.Description.displayName = "Alert.Description"
80
-
81
38
  export { Alert }
@@ -1,7 +1,8 @@
1
1
  import * as React from "react"
2
2
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
3
- import { cn } from "@utils"
4
- import { buttonVariants } from "@/Button"
3
+
4
+ import { cn } from "../@/lib/utils"
5
+ import { buttonVariants } from "../Button"
5
6
 
6
7
  const AlertDialog = AlertDialogPrimitive.Root
7
8
 
@@ -0,0 +1,58 @@
1
+ import * as React from 'react'
2
+ import { cva, type VariantProps } from 'class-variance-authority'
3
+
4
+ import { cn } from '../@/lib/utils'
5
+
6
+ const badgeClasses = {
7
+ variant: {
8
+ base: `
9
+ inline-block
10
+ focus:ring-2
11
+ focus:ring-ring
12
+ focus:ring-offset-2
13
+ focus:outline-none
14
+ transition-colors
15
+ rounded-full
16
+ `,
17
+ default: `
18
+ bg-critical
19
+ text-white
20
+ `,
21
+ },
22
+ size: {
23
+ default: 'size-[16px] text-[10px] text-center leadimg-[1] truncate',
24
+ dot: 'size-[10px] bg-critical-light border-critical border-[3px]',
25
+ sm: '',
26
+ md: '',
27
+ lg: '',
28
+ },
29
+ }
30
+
31
+ const badgeVariants = cva(badgeClasses.variant.base, {
32
+ variants: {
33
+ variant: {
34
+ default: badgeClasses.variant.default,
35
+ },
36
+ size: {
37
+ default: badgeClasses.size.default,
38
+ dot: badgeClasses.size.dot
39
+ },
40
+ },
41
+ defaultVariants: {
42
+ variant: 'default',
43
+ size: 'default',
44
+ },
45
+ })
46
+
47
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
48
+
49
+ function Badge({ className, variant, size, ...props }: BadgeProps) {
50
+ return (
51
+ <div
52
+ className={cn(badgeVariants({ variant, size }), className)}
53
+ {...props}
54
+ />
55
+ )
56
+ }
57
+
58
+ export { Badge, badgeVariants }
@@ -0,0 +1 @@
1
+ export { Badge, badgeVariants } from './Badge'
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { Slot } from '@radix-ui/react-slot'
3
- import { cn } from '@utils'
3
+ import { cn } from '../@/lib/utils'
4
4
 
5
5
  export interface BottomNavigationLinkProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
6
  asChild?: boolean
@@ -11,25 +11,7 @@ export type IProps = {
11
11
  children: React.ReactNode
12
12
  }
13
13
 
14
- const btnClasses = `
15
- inline-flex
16
- flex-col
17
- place-items-center
18
- gap-y-[8px]
19
- w-full
20
- p-[8px]
21
- text-[10px]
22
- text-center
23
- text-light
24
- leading-[1.33]
25
- transition
26
- duration-300
27
- hover:bg-btn-ghost-hover
28
- hover:text-primary
29
- focus:bg-btn-ghost-focus
30
- active:bg-btn-ghost-active
31
- data-[status=active]:text-primary
32
- `
14
+ const btnClasses = 'inline-flex flex-col place-items-center gap-y-[8px] hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active p-[8px] w-full text-[10px] text-center text-light hover:text-primary data-[status=active]:text-primary leading-[1.33] transition duration-300'
33
15
 
34
16
  const BottomNavigationLink = React.forwardRef<HTMLButtonElement, BottomNavigationLinkProps>(({ className, asChild, ...props }, ref) => {
35
17
  const Comp = asChild ? Slot : "button"
@@ -1,45 +1,142 @@
1
1
  import * as React from 'react'
2
2
  import { Slot } from '@radix-ui/react-slot'
3
3
  import { cva, type VariantProps } from 'class-variance-authority'
4
- import { cn } from '@utils'
4
+ import { cn } from '../@/lib/utils'
5
5
 
6
- const buttonVariants = cva(
7
- 'inline-flex justify-center items-center border-[2px] disabled:opacity-[.24] focus-visible:ring ring-offset-1 font-medium whitespace-nowrap transition-colors focus-visible:outline-none disabled:pointer-events-none',
8
- {
9
- variants: {
10
- variant: {
11
- primary:
12
- 'text-btn-primary bg-btn-primary hover:bg-btn-primary-hover focus:bg-btn-primary-focus active:bg-btn-primary-active border-btn-primary hover:border-btn-primary-hover focus:border-btn-primary-focus active:border-btn-primary-active',
13
- secondary:
14
- 'text-btn-secondary bg-btn-secondary hover:bg-btn-secondary-hover focus:bg-btn-secondary-focus active:bg-btn-secondary-active border-btn-secondary hover:border-btn-secondary-hover focus:border-btn-secondary-focus active:border-btn-secondary-active',
15
- success:
16
- 'text-btn-success bg-btn-success hover:bg-btn-success-hover focus:bg-btn-success-focus active:bg-btn-success-active border-btn-success hover:border-btn-success-hover focus:border-btn-success-focus active:border-btn-success-active',
17
- 'primary-outline':
18
- 'text-btn-primary-outline hover:text-btn-primary-outline-hover focus:text-btn-primary-outline-focus active:text-btn-primary-outline-active bg-btn-primary-outline hover:bg-btn-primary-outline-hover focus:bg-btn-primary-outline-focus active:bg-btn-primary-outline-active border-btn-primary-outline hover:border-btn-primary-outline-hover focus:border-btn-primary-outline-focus active:border-btn-primary-outline-active',
19
- outline: 'border-[1px] text-btn-outline border-btn-outline ring-[currentColor]',
20
- ghost: 'text-btn-ghost bg-btn-ghost hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active border-transparent',
21
- },
22
- size: {
23
- lg: 'h-[52px] px-[32px] text-[16px] leading-[1.08] rounded-[4px]',
24
- md: 'h-[44px] px-[24px] text-[14px] leading-[1.08] rounded-[4px]',
25
- sm: 'h-[36px] px-[20px] text-[12px] leading-none rounded-[3px]',
26
- xs: 'h-[28px] px-[12px] text-[11px] leading-none rounded-[2px]',
27
- xxs: 'h-[20px] px-[8px] text-[9px] leading-none rounded-[2px]',
28
- },
6
+ const buttonClasses= {
7
+ variant: {
8
+ base: `
9
+ inline-flex
10
+ justify-center
11
+ items-center
12
+ font-medium
13
+ border-[2px]
14
+ whitespace-nowrap
15
+ transition-colors
16
+ ring-offset-1
17
+ focus-visible:ring
18
+ focus-visible:outline-none
19
+ disabled:pointer-events-none
20
+ disabled:opacity-[.24]`,
21
+ primary: `
22
+ text-btn-primary
23
+ bg-btn-primary
24
+ border-btn-primary
25
+ hover:bg-btn-primary-hover
26
+ hover:border-btn-primary-hover
27
+ focus:bg-btn-primary-focus
28
+ focus:border-btn-primary-focus
29
+ active:border-btn-primary-active
30
+ active:bg-btn-primary-active`,
31
+ secondary: `
32
+ text-btn-secondary
33
+ bg-btn-secondary
34
+ border-btn-secondary
35
+ hover:bg-btn-secondary-hover
36
+ hover:border-btn-secondary-hover
37
+ focus:bg-btn-secondary-focus
38
+ focus:border-btn-secondary-focus
39
+ active:bg-btn-secondary-active
40
+ active:border-btn-secondary-active`,
41
+ success: `
42
+ text-btn-success
43
+ bg-btn-success
44
+ border-btn-success
45
+ hover:bg-btn-success-hover
46
+ active:border-btn-success-active
47
+ focus:bg-btn-success-focus
48
+ focus:border-btn-success-focus
49
+ active:bg-btn-success-active
50
+ hover:border-btn-success-hover`,
51
+ primaryOutline: `
52
+ text-btn-primary-outline
53
+ bg-btn-primary-outline
54
+ border-btn-primary-outline
55
+ hover:text-btn-primary-outline-hover
56
+ hover:bg-btn-primary-outline-hover
57
+ hover:border-btn-primary-outline-hover
58
+ focus:text-btn-primary-outline-focus
59
+ focus:bg-btn-primary-outline-focus
60
+ focus:border-btn-primary-outline-focus
61
+ active:text-btn-primary-outline-active
62
+ active:bg-btn-primary-outline-active
63
+ active:border-btn-primary-outline-active`,
64
+ outline: `
65
+ text-btn-outline
66
+ border-[1px]
67
+ border-btn-outline
68
+ ring-[currentColor]`,
69
+ ghost: `
70
+ text-btn-ghost
71
+ bg-btn-ghost
72
+ border-transparent
73
+ hover:bg-btn-ghost-hover
74
+ focus:bg-btn-ghost-focus
75
+ active:bg-btn-ghost-active`,
76
+ widget: `
77
+ justify-start
78
+ h-[72px]
79
+ w-full p-[16px]
80
+ space-x-[16px]
81
+ text-left
82
+ rounded-md
83
+ shadow-md
84
+ border-transparent`,
85
+ },
86
+ size: {
87
+ lg: 'h-[52px] px-[32px] text-[16px] leading-[1.08] rounded-[4px]',
88
+ md: 'h-[44px] px-[24px] text-[14px] leading-[1.08] rounded-[4px]',
89
+ sm: 'h-[36px] px-[20px] text-[12px] leading-none rounded-[3px]',
90
+ xs: 'h-[28px] px-[12px] text-[11px] leading-none rounded-[2px]',
91
+ xxs: 'h-[20px] px-[8px] text-[9px] leading-none rounded-[2px]',
92
+ widget: `h-[72px] p-[16px]`
93
+ }
94
+ }
95
+
96
+ const buttonVariants = cva(buttonClasses.variant.base, {
97
+ variants: {
98
+ variant: {
99
+ primary: buttonClasses.variant.primary,
100
+ secondary: buttonClasses.variant.secondary,
101
+ success: buttonClasses.variant.success,
102
+ 'primary-outline': buttonClasses.variant.primaryOutline,
103
+ outline: buttonClasses.variant.outline,
104
+ ghost: buttonClasses.variant.ghost,
105
+ widget: buttonClasses.variant.widget,
106
+ // link: 'text-primary underline-offset-4 hover:underline',
29
107
  },
30
- defaultVariants: {
31
- variant: 'primary',
32
- size: 'md',
108
+ size: {
109
+ lg: buttonClasses.size.lg,
110
+ md: buttonClasses.size.md,
111
+ widget: buttonClasses.size.widget,
112
+ sm: buttonClasses.size.sm,
113
+ xs: buttonClasses.size.xs,
114
+ xxs: buttonClasses.size.xxs,
33
115
  },
34
- }
35
- )
116
+ },
117
+ defaultVariants: {
118
+ variant: 'primary',
119
+ size: 'md',
120
+ },
121
+ })
122
+
36
123
  const textVariants = cva(
37
- 'inline-flex whitespace-nowrap transition-colors focus-visible:outline-current disabled:opacity-[.24] rounded-[.25em] disabled:pointer-events-none',
124
+ `inline-flex
125
+ whitespace-nowrap
126
+ transition-colors
127
+ rounded-[.25em]
128
+ focus-visible:outline-current
129
+ disabled:opacity-[.24]
130
+ disabled:pointer-events-none`,
38
131
  {
39
132
  variants: {
40
133
  variant: {
41
134
  primary:
42
- 'text-primary hover:text-primary-hover focus:text-primary-focus active:text-primary-active disabled:pointer-events-none',
135
+ `text-primary
136
+ hover:text-primary-hover
137
+ focus:text-primary-focus
138
+ active:text-primary-active
139
+ disabled:pointer-events-none`,
43
140
  },
44
141
  },
45
142
  defaultVariants: {
@@ -56,18 +153,18 @@ export interface ButtonProps
56
153
  }
57
154
 
58
155
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
59
- ({ className, variant, size, asText = false, asChild = false, ...props }, ref) => {
60
- const Comp = asChild ? Slot : "button"
61
- // @ts-ignore
62
- const classes = asText ? textVariants<any>({ variant, className }) : buttonVariants({ variant, size, className });
63
- return (
64
- <Comp
65
- className={cn(classes)}
66
- ref={ref}
67
- {...props}
68
- />
69
- )
70
- }
156
+ ({ className, variant, size, asText = false, asChild = false, ...props }, ref) => {
157
+ const Comp = asChild ? Slot : 'button'
158
+ // @ts-ignore
159
+ const classes = asText ? textVariants<any>({ variant, className }) : buttonVariants({ variant, size, className })
160
+ return (
161
+ <Comp
162
+ className={cn(classes)}
163
+ ref={ref}
164
+ {...props}
165
+ />
166
+ )
167
+ }
71
168
  )
72
169
 
73
170
  Button.displayName = 'Button'
@@ -1 +1 @@
1
- export { Button, buttonVariants } from './Button'
1
+ export {Button, buttonVariants} from './Button'
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { DayPicker } from 'react-day-picker'
3
- import { cn } from '@utils'
3
+ import { cn } from '../@/lib/utils'
4
4
  import { ru } from 'date-fns/locale'
5
5
 
6
6
  const daySelectedClasses = 'bg-btn-primary text-btn-primary rounded-sm'
@@ -0,0 +1,44 @@
1
+ import * as React from 'react'
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
3
+ import { CheckSmall } from '../Icon/icons'
4
+
5
+ const checkboxClasses = {
6
+ root: `
7
+ peer
8
+ size-[18px]
9
+ shrink-0
10
+ rounded-sm
11
+ border-2
12
+ border-input
13
+ focus-visible:outline-none
14
+ focus-visible:ring-1 focus-visible:ring-ring
15
+ disabled:cursor-not-allowed disabled:opacity-50
16
+ data-[state=checked]:bg-primary
17
+ data-[state=checked]:border-primary
18
+ data-[state=checked]:text-white
19
+ `,
20
+ indicator: `
21
+ flex
22
+ justify-center
23
+ items-center
24
+ text-current
25
+ `
26
+ }
27
+
28
+ const Checkbox = React.forwardRef<
29
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
30
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
31
+ >(({ className, ...props }, ref) => (
32
+ <CheckboxPrimitive.Root
33
+ ref={ref}
34
+ className={checkboxClasses.root}
35
+ {...props}
36
+ >
37
+ <CheckboxPrimitive.Indicator className={checkboxClasses.indicator}>
38
+ <CheckSmall className="size-[14px]" />
39
+ </CheckboxPrimitive.Indicator>
40
+ </CheckboxPrimitive.Root>
41
+ ))
42
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName
43
+
44
+ export { Checkbox }
@@ -0,0 +1 @@
1
+ export { Checkbox } from './Checkbox'
package/src/Chip/Chip.tsx CHANGED
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { FC, PropsWithChildren } from 'react'
2
2
  import { cva, type VariantProps } from 'class-variance-authority'
3
3
  import { Slot } from '@radix-ui/react-slot'
4
- import { cn } from '@utils'
4
+ import { cn } from '../@/lib/utils'
5
+ // import { cn } from "@/lib/utils" порешать с алиасами
5
6
 
6
7
  const chipVariants = cva(
7
8
  'inline-flex justify-center items-center border-[2px] disabled:opacity-[.24] rounded-full ring-offset-1 font-medium whitespace-nowrap transition-colors disabled:pointer-events-none',
@@ -1,7 +1,7 @@
1
1
  import React, { FC, ReactNode } from 'react'
2
2
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'
3
- import { DropdownSmallOld } from '@/Icon'
4
- import { cn } from '@utils'
3
+ import { DropdownSmallOld } from '../../src/Icon'
4
+ import { cn } from '../@/lib/utils'
5
5
  import { Slot } from '@radix-ui/react-slot'
6
6
 
7
7
  const AccountCollapsible = CollapsiblePrimitive.Root
@@ -28,22 +28,6 @@ const AccountCollapsibleHeader: FC<AccountCollapsibleHeaderProps> = ({ label })
28
28
  </AccountCollapsibleTrigger>
29
29
  )
30
30
  }
31
-
32
- const accountCollapsibleClasses = `
33
- text-left
34
- w-full
35
- rounded-[4px]
36
- px-[12px]
37
- py-[16px]
38
- bg-btn-secondary
39
- border-btn-secondary
40
- hover:bg-btn-secondary-hover
41
- hover:border-btn-secondary-hover
42
- focus:bg-btn-secondary-focus
43
- focus:border-btn-secondary-focus
44
- active:border-btn-secondary-active
45
- active:bg-btn-secondary-active
46
- `
47
31
  const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps> = ({
48
32
  children,
49
33
  asChild = true,
@@ -54,7 +38,7 @@ const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps> = ({
54
38
  return (
55
39
  <Comp
56
40
  className={cn(
57
- accountCollapsibleClasses,
41
+ 'text-left w-full rounded-[4px] px-[12px] py-[16px] bg-btn-secondary hover:bg-btn-secondary-hover focus:bg-btn-secondary-focus active:bg-btn-secondary-active border-btn-secondary hover:border-btn-secondary-hover focus:border-btn-secondary-focus active:border-btn-secondary-active',
58
42
  className
59
43
  )}
60
44
  {...props}
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react'
2
2
  import { format } from 'date-fns'
3
- import { cn } from '@utils'
4
- import { Calendar } from '@/Calendar'
5
- import { Calendar as CalendarIcon } from '@/Icon'
6
- import { Popover } from '@/Popover'
3
+ import { cn } from '../@/lib/utils'
4
+ import { Calendar } from '../Calendar'
5
+ import { Calendar as CalendarIcon } from '../Icon'
6
+ import { Popover } from '../Popover'
7
7
  import { ru } from 'date-fns/locale'
8
8
 
9
- const trigegrClasses = 'inline-flex items-center px-[12px] h-[44px] text-left border-input border rounded-sm'
9
+ const trigegrClasses = 'inline-flex items-center border-input px-[12px] border rounded-sm h-[44px] text-left'
10
10
 
11
11
  interface IProps {
12
12
  mode?: any;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { Drawer as DrawerPrimitive } from 'vaul'
3
- import { cn } from '@utils'
3
+ import { cn } from '../@/lib/utils'
4
4
  import { useContext } from 'react'
5
5
 
6
6
  const DrawerContext = React.createContext({direction: 'bottom', modal: false})
@@ -83,7 +83,6 @@ const DrawerContent = React.forwardRef<
83
83
  </DrawerPortal>
84
84
  )
85
85
  })
86
-
87
86
  DrawerContent.displayName = 'DrawerContent'
88
87
 
89
88
  export { Drawer, DrawerTrigger, DrawerContent, DrawerTitle, DrawerClose }
package/src/Form/Form.tsx CHANGED
@@ -2,8 +2,9 @@ import * as React from 'react'
2
2
  import * as LabelPrimitive from '@radix-ui/react-label'
3
3
  import { Slot } from '@radix-ui/react-slot'
4
4
  import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from 'react-hook-form'
5
- import { cn } from '@utils'
6
- import { Label } from '@/Label'
5
+
6
+ import { cn } from '../@/lib/utils'
7
+ import { Label } from '../Label'
7
8
 
8
9
  const Form = FormProvider
9
10
 
@@ -73,7 +74,6 @@ const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivEl
73
74
  )
74
75
  }
75
76
  )
76
-
77
77
  FormItem.displayName = 'FormItem'
78
78
 
79
79
  const FormLabel = React.forwardRef<
@@ -91,7 +91,6 @@ const FormLabel = React.forwardRef<
91
91
  />
92
92
  )
93
93
  })
94
-
95
94
  FormLabel.displayName = 'FormLabel'
96
95
 
97
96
  const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(
@@ -109,7 +108,6 @@ const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.Compon
109
108
  )
110
109
  }
111
110
  )
112
-
113
111
  FormControl.displayName = 'FormControl'
114
112
 
115
113
  const FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
@@ -10,7 +10,7 @@ const SvgInfoSolid = (props: SVGProps<SVGSVGElement>) => (
10
10
  {...props}
11
11
  >
12
12
  <path
13
- fill="currentColor"
13
+ fill="#4971D0"
14
14
  d="M10 1.003c-4.96 0-9 4.04-9 9s4.04 9 9 9 9-4.04 9-9-4.04-9-9-9m1 13c0 .55-.45 1-1 1s-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1zm-1-6.8c-.66 0-1.2-.54-1.2-1.2s.54-1.2 1.2-1.2 1.2.54 1.2 1.2-.54 1.2-1.2 1.2"
15
15
  />
16
16
  </SvgIcon>
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react'
2
- import { cn } from '@utils'
2
+ import { cn } from '../@/lib/utils'
3
3
 
4
4
  const InputLabel = React.forwardRef<HTMLLabelElement, React.LabelHTMLAttributes<HTMLLabelElement>>(
5
5
  ({ className, children, ...props }) => {
@@ -1,28 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import { IMaskInput } from 'react-imask'
3
3
 
4
- const inputClasses = `
5
- form-input
6
- leading-[1.17]
7
- font-normal
8
- border
9
- border-input
10
- rounded-sm
11
- w-full
12
- h-[44px]
13
- bg-transparent
14
- file:bg-transparent
15
- file:text-sm
16
- file:font-medium
17
- file:border-0
18
- focus-visible:ring-1
19
- focus-visible:ring-ring
20
- disabled:cursor-not-allowed
21
- disabled:opacity-50
22
- placeholder:text-muted-foreground
23
- transition-colors
24
- focus-visible:outline-none
25
- `
4
+ const inputClasses = 'form-input border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed'
26
5
 
27
6
  const InputMask: React.FC = ({ ...props }) => {
28
7
  return (
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import { OTPInput, OTPInputContext } from 'input-otp'
3
- import { cn } from '@utils'
3
+ import { cn } from '../@/lib/utils'
4
+ // import { cn } from "@/lib/utils" порешать с алиасами
4
5
 
5
6
  const InputOTP = React.forwardRef<React.ElementRef<typeof OTPInput>, React.ComponentPropsWithoutRef<typeof OTPInput>>(
6
7
  ({ className, containerClassName, ...props }, ref) => (