@modul/mbui 0.0.16-beta-pv-53139-6c26fe1d → 0.0.16-beta-pv-53147-00d3e008

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 (98) hide show
  1. package/dist/Alert/Alert.d.ts +15 -6
  2. package/dist/Alert/Alert.js +30 -19
  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/BottomNavigation/BottomNavigation.js +21 -3
  7. package/dist/BottomNavigation/BottomNavigation.js.map +1 -1
  8. package/dist/Button/Button.d.ts +2 -2
  9. package/dist/Button/Button.js +17 -119
  10. package/dist/Button/Button.js.map +1 -1
  11. package/dist/Button/index.js.map +1 -1
  12. package/dist/Calendar/Calendar.js +3 -3
  13. package/dist/Calendar/Calendar.js.map +1 -1
  14. package/dist/Chip/Chip.js +2 -3
  15. package/dist/Chip/Chip.js.map +1 -1
  16. package/dist/Collapsible/AccountCollapsible.js +18 -3
  17. package/dist/Collapsible/AccountCollapsible.js.map +1 -1
  18. package/dist/DatePicker/DatePicker.js +6 -6
  19. package/dist/DatePicker/DatePicker.js.map +1 -1
  20. package/dist/Drawer/Drawer.js +3 -3
  21. package/dist/Drawer/Drawer.js.map +1 -1
  22. package/dist/Form/Form.js +6 -6
  23. package/dist/Form/Form.js.map +1 -1
  24. package/dist/Icon/icons/InfoSolid.js +1 -1
  25. package/dist/Icon/icons/InfoSolid.js.map +1 -1
  26. package/dist/Input/Input.js +3 -3
  27. package/dist/Input/Input.js.map +1 -1
  28. package/dist/Input/InputMask.js +22 -1
  29. package/dist/Input/InputMask.js.map +1 -1
  30. package/dist/Input-OTP/Input.js +4 -5
  31. package/dist/Input-OTP/Input.js.map +1 -1
  32. package/dist/Label/Label.js +2 -2
  33. package/dist/Label/Label.js.map +1 -1
  34. package/dist/Page/Page.js +4 -4
  35. package/dist/Page/Page.js.map +1 -1
  36. package/dist/Popover/Popover.js +23 -2
  37. package/dist/Popover/Popover.js.map +1 -1
  38. package/dist/Progress/Progress.js +11 -3
  39. package/dist/Progress/Progress.js.map +1 -1
  40. package/dist/Select/SelectAccountCard.js +33 -7
  41. package/dist/Select/SelectAccountCard.js.map +1 -1
  42. package/dist/Select/SelectAsync.js +17 -6
  43. package/dist/Select/SelectAsync.js.map +1 -1
  44. package/dist/Select/SelectBase.js +17 -6
  45. package/dist/Select/SelectBase.js.map +1 -1
  46. package/dist/Slider/Slider.js +21 -5
  47. package/dist/Slider/Slider.js.map +1 -1
  48. package/dist/Switch/Switch.js +27 -13
  49. package/dist/Switch/Switch.js.map +1 -1
  50. package/dist/Tabs/Tabs.js +39 -9
  51. package/dist/Tabs/Tabs.js.map +1 -1
  52. package/dist/Textarea/Textarea.d.ts +1 -1
  53. package/dist/Textarea/Textarea.js +20 -3
  54. package/dist/Textarea/Textarea.js.map +1 -1
  55. package/dist/index.d.ts +3 -4
  56. package/dist/index.js +2 -6
  57. package/dist/index.js.map +1 -1
  58. package/package.json +1 -2
  59. package/src/@/config/index.ts +72 -72
  60. package/src/Alert/Alert.tsx +68 -25
  61. package/src/AlertDialog/AlertDialog.tsx +2 -3
  62. package/src/BottomNavigation/BottomNavigation.tsx +20 -2
  63. package/src/Button/Button.tsx +43 -140
  64. package/src/Button/index.ts +1 -1
  65. package/src/Calendar/Calendar.tsx +1 -1
  66. package/src/Chip/Chip.tsx +2 -3
  67. package/src/Collapsible/AccountCollapsible.tsx +19 -3
  68. package/src/DatePicker/DatePicker.tsx +5 -5
  69. package/src/Drawer/Drawer.tsx +2 -1
  70. package/src/Form/Form.tsx +5 -3
  71. package/src/Icon/icons/InfoSolid.tsx +1 -1
  72. package/src/Input/Input.tsx +1 -1
  73. package/src/Input/InputMask.tsx +22 -1
  74. package/src/Input-OTP/Input.tsx +1 -2
  75. package/src/Label/Label.tsx +1 -1
  76. package/src/Page/Page.tsx +1 -1
  77. package/src/Popover/Popover.tsx +24 -2
  78. package/src/Progress/Progress.tsx +11 -3
  79. package/src/Select/Select.tsx +1 -1
  80. package/src/Select/SelectAccountCard.tsx +32 -11
  81. package/src/Select/SelectAsync.tsx +16 -10
  82. package/src/Select/SelectBase.tsx +16 -6
  83. package/src/Slider/Slider.tsx +21 -4
  84. package/src/Switch/Switch.tsx +26 -13
  85. package/src/Tabs/Tabs.tsx +41 -9
  86. package/src/Textarea/Textarea.tsx +30 -19
  87. package/src/assets/css/global.css +11 -6
  88. package/src/index.ts +3 -7
  89. package/dist/Badge/Badge.d.ts +0 -10
  90. package/dist/Badge/Badge.js +0 -52
  91. package/dist/Badge/Badge.js.map +0 -1
  92. package/dist/Badge/index.d.ts +0 -1
  93. package/dist/Badge/index.js +0 -7
  94. package/dist/Badge/index.js.map +0 -1
  95. package/src/Badge/Badge.tsx +0 -58
  96. package/src/Badge/index.ts +0 -1
  97. package/src/Checkbox/Checkbox.tsx +0 -44
  98. package/src/Checkbox/index.ts +0 -1
@@ -1,142 +1,45 @@
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 '../@/lib/utils'
4
+ import { cn } from '@utils'
5
5
 
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',
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
+ },
107
29
  },
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,
30
+ defaultVariants: {
31
+ variant: 'primary',
32
+ size: 'md',
115
33
  },
116
- },
117
- defaultVariants: {
118
- variant: 'primary',
119
- size: 'md',
120
- },
121
- })
122
-
34
+ }
35
+ )
123
36
  const textVariants = cva(
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`,
37
+ 'inline-flex whitespace-nowrap transition-colors focus-visible:outline-current disabled:opacity-[.24] rounded-[.25em] disabled:pointer-events-none',
131
38
  {
132
39
  variants: {
133
40
  variant: {
134
41
  primary:
135
- `text-primary
136
- hover:text-primary-hover
137
- focus:text-primary-focus
138
- active:text-primary-active
139
- disabled:pointer-events-none`,
42
+ 'text-primary hover:text-primary-hover focus:text-primary-focus active:text-primary-active disabled:pointer-events-none',
140
43
  },
141
44
  },
142
45
  defaultVariants: {
@@ -153,18 +56,18 @@ export interface ButtonProps
153
56
  }
154
57
 
155
58
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
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
- }
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
+ }
168
71
  )
169
72
 
170
73
  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 '../@/lib/utils'
3
+ import { cn } from '@utils'
4
4
  import { ru } from 'date-fns/locale'
5
5
 
6
6
  const daySelectedClasses = 'bg-btn-primary text-btn-primary rounded-sm'
package/src/Chip/Chip.tsx CHANGED
@@ -1,8 +1,7 @@
1
- import React, { FC, PropsWithChildren } from 'react'
1
+ import React 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 '../@/lib/utils'
5
- // import { cn } from "@/lib/utils" порешать с алиасами
4
+ import { cn } from '@utils'
6
5
 
7
6
  const chipVariants = cva(
8
7
  '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 '../../src/Icon'
4
- import { cn } from '../@/lib/utils'
3
+ import { DropdownSmallOld } from '@/Icon'
4
+ import { cn } from '@utils'
5
5
  import { Slot } from '@radix-ui/react-slot'
6
6
 
7
7
  const AccountCollapsible = CollapsiblePrimitive.Root
@@ -28,6 +28,22 @@ 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
+ `
31
47
  const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps> = ({
32
48
  children,
33
49
  asChild = true,
@@ -38,7 +54,7 @@ const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps> = ({
38
54
  return (
39
55
  <Comp
40
56
  className={cn(
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',
57
+ accountCollapsibleClasses,
42
58
  className
43
59
  )}
44
60
  {...props}
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react'
2
2
  import { format } from 'date-fns'
3
- import { cn } from '../@/lib/utils'
4
- import { Calendar } from '../Calendar'
5
- import { Calendar as CalendarIcon } from '../Icon'
6
- import { Popover } from '../Popover'
3
+ import { cn } from '@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 border-input px-[12px] border rounded-sm h-[44px] text-left'
9
+ const trigegrClasses = 'inline-flex items-center px-[12px] h-[44px] text-left border-input border rounded-sm'
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 '../@/lib/utils'
3
+ import { cn } from '@utils'
4
4
  import { useContext } from 'react'
5
5
 
6
6
  const DrawerContext = React.createContext({direction: 'bottom', modal: false})
@@ -83,6 +83,7 @@ const DrawerContent = React.forwardRef<
83
83
  </DrawerPortal>
84
84
  )
85
85
  })
86
+
86
87
  DrawerContent.displayName = 'DrawerContent'
87
88
 
88
89
  export { Drawer, DrawerTrigger, DrawerContent, DrawerTitle, DrawerClose }
package/src/Form/Form.tsx CHANGED
@@ -2,9 +2,8 @@ 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
-
6
- import { cn } from '../@/lib/utils'
7
- import { Label } from '../Label'
5
+ import { cn } from '@utils'
6
+ import { Label } from '@/Label'
8
7
 
9
8
  const Form = FormProvider
10
9
 
@@ -74,6 +73,7 @@ const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivEl
74
73
  )
75
74
  }
76
75
  )
76
+
77
77
  FormItem.displayName = 'FormItem'
78
78
 
79
79
  const FormLabel = React.forwardRef<
@@ -91,6 +91,7 @@ const FormLabel = React.forwardRef<
91
91
  />
92
92
  )
93
93
  })
94
+
94
95
  FormLabel.displayName = 'FormLabel'
95
96
 
96
97
  const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(
@@ -108,6 +109,7 @@ const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.Compon
108
109
  )
109
110
  }
110
111
  )
112
+
111
113
  FormControl.displayName = 'FormControl'
112
114
 
113
115
  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="#4971D0"
13
+ fill="currentColor"
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 '../@/lib/utils'
2
+ import { cn } from '@utils'
3
3
 
4
4
  const InputLabel = React.forwardRef<HTMLLabelElement, React.LabelHTMLAttributes<HTMLLabelElement>>(
5
5
  ({ className, children, ...props }) => {
@@ -1,7 +1,28 @@
1
1
  import * as React from 'react'
2
2
  import { IMaskInput } from 'react-imask'
3
3
 
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'
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
+ `
5
26
 
6
27
  const InputMask: React.FC = ({ ...props }) => {
7
28
  return (
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { OTPInput, OTPInputContext } from 'input-otp'
3
- import { cn } from '../@/lib/utils'
4
- // import { cn } from "@/lib/utils" порешать с алиасами
3
+ import { cn } from '@utils'
5
4
 
6
5
  const InputOTP = React.forwardRef<React.ElementRef<typeof OTPInput>, React.ComponentPropsWithoutRef<typeof OTPInput>>(
7
6
  ({ className, containerClassName, ...props }, ref) => (
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import * as LabelPrimitive from '@radix-ui/react-label'
3
3
  import { cva, type VariantProps } from 'class-variance-authority'
4
- import { cn } from '../@/lib/utils'
4
+ import { cn } from '@utils'
5
5
 
6
6
  const labelVariants = cva('peer-disabled:opacity-70 peer-disabled:cursor-not-allowed')
7
7
 
package/src/Page/Page.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react'
2
- import { cn } from '../@/lib/utils'
2
+ import { cn } from '@utils'
3
3
 
4
4
  type IProps = {
5
5
  children?: React.ReactNode
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import cn from 'classnames'
2
+ import cn from 'clsx'
3
3
  import * as PopoverPrimitive from '@radix-ui/react-popover'
4
4
  import {PopoverPortalProps, PopoverProps} from "@radix-ui/react-popover";
5
5
 
@@ -17,6 +17,28 @@ const PopoverPortal: React.FC<PopoverPortalProps> = ({ children, ...props }) =>
17
17
  <PopoverPrimitive.Portal {...props}>{children}</PopoverPrimitive.Portal>
18
18
  )
19
19
 
20
+ const popoverContentClasses = `
21
+ z-50
22
+ w-72
23
+ p-4
24
+ text-popover-foreground
25
+ bg-popover
26
+ border
27
+ rounded-md
28
+ shadow-md
29
+ outline-none
30
+ data-[state=open]:animate-in
31
+ data-[state=closed]:animate-out
32
+ data-[state=closed]:fade-out-0
33
+ data-[state=open]:fade-in-0
34
+ data-[state=closed]:zoom-out-95
35
+ data-[state=open]:zoom-in-95
36
+ data-[side=bottom]:slide-in-from-top-2
37
+ data-[side=left]:slide-in-from-right-2
38
+ data-[side=right]:slide-in-from-left-2
39
+ data-[side=top]:slide-in-from-bottom-2
40
+ `
41
+
20
42
  const PopoverContent = React.forwardRef<
21
43
  React.ElementRef<typeof PopoverPrimitive.Content>,
22
44
  React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
@@ -26,7 +48,7 @@ const PopoverContent = React.forwardRef<
26
48
  align={align}
27
49
  sideOffset={sideOffset}
28
50
  className={cn(
29
- 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
51
+ popoverContentClasses,
30
52
  className
31
53
  )}
32
54
  {...props}
@@ -1,7 +1,15 @@
1
1
  import * as React from 'react'
2
2
  import * as ProgressPrimitive from '@radix-ui/react-progress'
3
+ import { cn } from '@utils'
3
4
 
4
- import { cn } from '../@/lib/utils'
5
+ const progessClasses = `
6
+ relative
7
+ w-full
8
+ h-[--progress-height]
9
+ bg-[--progress-bg]
10
+ rounded-full
11
+ overflow-hidden
12
+ `
5
13
 
6
14
  const Progress = React.forwardRef<
7
15
  React.ElementRef<typeof ProgressPrimitive.Root>,
@@ -9,11 +17,11 @@ const Progress = React.forwardRef<
9
17
  >(({ className, value, ...props }, ref) => (
10
18
  <ProgressPrimitive.Root
11
19
  ref={ref}
12
- className={cn('relative h-[--progress-height] w-full overflow-hidden rounded-full bg-[--progress-bg]', className)}
20
+ className={cn(progessClasses, className)}
13
21
  {...props}
14
22
  >
15
23
  <ProgressPrimitive.Indicator
16
- className="bg-primary rounded-full w-full h-full transition-all"
24
+ className="bg-primary rounded-full transition-all size-full"
17
25
  style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
18
26
  />
19
27
  </ProgressPrimitive.Root>
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { SelectBase } from './SelectBase'
3
- import {GroupBase, Props} from "react-select";
3
+ import { GroupBase, Props } from "react-select";
4
4
 
5
5
  type SelectBaseProps<
6
6
  Option,
@@ -1,7 +1,5 @@
1
1
  import * as React from 'react'
2
-
3
- import { DropdownSmallOld, CheckSmall } from '../Icon'
4
-
2
+ import { DropdownSmallOld, CheckSmall } from '@/Icon'
5
3
  import Select, {
6
4
  components,
7
5
  ControlProps,
@@ -14,11 +12,24 @@ import Select, {
14
12
  Props,
15
13
  GroupBase,
16
14
  } from 'react-select'
17
-
18
- import { cn } from '../@/lib/utils'
19
-
20
- const selectTriggerClasses: string =
21
- 'flex items-center bg-gradient-to-r from-[--cl-blue-3] to-primary shadow-[0px_8px_18px_0px_rgba(73,113,208,0.38)] px-[16px] py-[8px] border-none rounded-md min-h-[80px] text-left text-white cursor-pointer'
15
+ import { cn } from '@utils'
16
+
17
+ const selectTriggerClasses: string = `
18
+ flex
19
+ items-center
20
+ py-[8px]
21
+ px-[16px]
22
+ min-h-[80px]
23
+ border-none
24
+ rounded-md
25
+ text-left
26
+ text-white
27
+ bg-gradient-to-r
28
+ from-[--cl-blue-3]
29
+ to-primary
30
+ shadow-[0px_8px_18px_0px_rgba(73,113,208,0.38)]
31
+ cursor-pointer
32
+ `
22
33
 
23
34
  const colourStyles: StylesConfig = {
24
35
  control: () => ({}),
@@ -47,8 +58,18 @@ const Control = ({ children, ...props }: ControlProps) => {
47
58
  )
48
59
  }
49
60
 
50
- const optionClasses =
51
- 'flex items-center first:rounded-t-md last:rounded-b-md px-[12px] py-[16px] w-full cursor-default select-none outline-none'
61
+ const optionClasses = `
62
+ flex
63
+ items-center
64
+ py-[16px]
65
+ px-[12px]
66
+ w-full
67
+ first:rounded-t-md
68
+ last:rounded-b-md
69
+ cursor-default
70
+ select-none
71
+ outline-none
72
+ `
52
73
 
53
74
  const Option = ({ children, ...props }: OptionProps) => {
54
75
  const {
@@ -74,7 +95,7 @@ const Option = ({ children, ...props }: OptionProps) => {
74
95
  </span>
75
96
  </span>
76
97
 
77
- <span className="ml-[16px] w-[24px] h-[24px] shrink-0">
98
+ <span className="ml-[16px] shrink-0 size-[24px]">
78
99
  {isSelected && (
79
100
  <CheckSmall
80
101
  width="24"
@@ -1,7 +1,5 @@
1
1
  import * as React from 'react'
2
-
3
- import { DropdownSmallOld, CheckSmall } from '../Icon'
4
-
2
+ import { DropdownSmallOld, CheckSmall } from '@/Icon'
5
3
  import {
6
4
  components,
7
5
  ControlProps,
@@ -16,13 +14,21 @@ import {
16
14
  LoadingIndicatorProps,
17
15
  IndicatorsContainerProps,
18
16
  } from 'react-select'
19
-
20
17
  import AsyncSelect from 'react-select/async'
21
-
22
- import { cn } from '../@/lib/utils'
23
-
24
- const selectTriggerClasses: string =
25
- 'flex items-center border-[1px] border-input rounded-sm h-[44px] text-left px-[16px] py-[12px] cursor-pointer'
18
+ import { cn } from '@utils'
19
+
20
+ const selectTriggerClasses: string = `
21
+ flex
22
+ items-center
23
+ py-[12px]
24
+ px-[16px]
25
+ h-[44px]
26
+ border-[1px]
27
+ border-input
28
+ rounded-sm
29
+ text-left
30
+ cursor-pointer
31
+ `
26
32
 
27
33
  const colourStyles: StylesConfig = {
28
34
  control: () => ({}),
@@ -68,7 +74,7 @@ const Option = ({ children, ...props }: OptionProps) => {
68
74
  >
69
75
  <span className="flex basis-0 grow">{children}</span>
70
76
 
71
- <span className="ml-[16px] w-[24px] h-[24px] shrink-0">
77
+ <span className="ml-[16px] shrink-0 size-[24px]">
72
78
  {isSelected && (
73
79
  <CheckSmall
74
80
  width="24"
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
 
3
- import { DropdownSmallOld, CheckSmall } from '../Icon'
3
+ import { DropdownSmallOld, CheckSmall } from '@/Icon'
4
4
 
5
5
  import Select, {
6
6
  components,
@@ -17,10 +17,20 @@ import Select, {
17
17
  IndicatorsContainerProps, GroupBase, Props,
18
18
  } from 'react-select'
19
19
 
20
- import { cn } from '../@/lib/utils'
21
-
22
- const selectTriggerClasses: string =
23
- 'flex items-center border-[1px] border-input rounded-sm h-[44px] text-left px-[16px] py-[12px] cursor-pointer'
20
+ import { cn } from '@utils'
21
+
22
+ const selectTriggerClasses: string = `
23
+ flex
24
+ items-center
25
+ py-[12px]
26
+ px-[16px]
27
+ h-[44px]
28
+ text-left
29
+ border-[1px]
30
+ border-input
31
+ rounded-sm
32
+ cursor-pointer
33
+ `
24
34
 
25
35
  const colourStyles: StylesConfig = {
26
36
  control: () => ({}),
@@ -66,7 +76,7 @@ const Option = ({ children, ...props }: OptionProps) => {
66
76
  >
67
77
  <span className="flex basis-0 grow">{children}</span>
68
78
 
69
- <span className="ml-[16px] w-[24px] h-[24px] shrink-0">
79
+ <span className="ml-[16px] shrink-0 size-[24px]">
70
80
  {isSelected && (
71
81
  <CheckSmall
72
82
  width="24"