@modul/mbui 0.0.9 → 0.0.10-beta-pv-52970-e24498f8
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/BottomNavigation/BottomNavigation.js +1 -1
- package/dist/BottomNavigation/BottomNavigation.js.map +1 -1
- package/dist/Button/Button.js +2 -2
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +2 -1
- package/dist/Button/index.js.map +1 -1
- package/dist/Chip/Chip.d.ts +11 -0
- package/dist/Chip/Chip.js +39 -0
- package/dist/Chip/Chip.js.map +1 -0
- package/dist/Chip/index.d.ts +1 -0
- package/dist/Chip/index.js +6 -0
- package/dist/Chip/index.js.map +1 -0
- package/dist/{DasboardDrawer → DashboardDrawer}/DashboardDrawer.d.ts +2 -1
- package/dist/{DasboardDrawer → DashboardDrawer}/DashboardDrawer.js +11 -8
- package/dist/DashboardDrawer/DashboardDrawer.js.map +1 -0
- package/dist/DashboardDrawer/index.js.map +1 -0
- package/dist/Page/Page.d.ts +4 -3
- package/dist/Page/Page.js +7 -1
- package/dist/Page/Page.js.map +1 -1
- package/dist/Page/index.d.ts +1 -1
- package/dist/Page/index.js +2 -1
- package/dist/Page/index.js.map +1 -1
- package/dist/Tabs/Tabs.d.ts +2 -2
- package/dist/Tabs/Tabs.js +8 -7
- package/dist/Tabs/Tabs.js.map +1 -1
- package/dist/Tabs/index.d.ts +1 -3
- package/dist/Tabs/index.js +2 -4
- package/dist/Tabs/index.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/package.json +15 -11
- package/src/@/config/index.ts +24 -8
- package/src/@/config/label.ts +89 -0
- package/src/BottomNavigation/BottomNavigation.tsx +1 -2
- package/src/Button/Button.tsx +2 -2
- package/src/Button/index.ts +1 -1
- package/src/Chip/Chip.tsx +56 -0
- package/src/Chip/index.ts +1 -0
- package/src/DashboardDrawer/DashboardDrawer.tsx +119 -0
- package/src/Drawer/BottomDrawer.tsx +108 -0
- package/src/{DasboardDrawer → Drawer}/DashboardDrawer.tsx +4 -2
- package/src/Input/Input.tsx +35 -0
- package/src/Input/index.ts +1 -0
- package/src/Label/Label.tsx +20 -0
- package/src/Label/index.ts +1 -0
- package/src/Page/Page.tsx +13 -3
- package/src/Page/index.ts +1 -1
- package/src/Tabs/Tabs.tsx +12 -12
- package/src/Tabs/index.ts +1 -5
- package/src/assets/css/global.css +34 -7
- package/src/index.ts +6 -2
- package/dist/DasboardDrawer/DashboardDrawer.js.map +0 -1
- package/dist/DasboardDrawer/index.js.map +0 -1
- package/src/Tabs/ant-tabs.styl +0 -91
- /package/dist/{DasboardDrawer → DashboardDrawer}/index.d.ts +0 -0
- /package/dist/{DasboardDrawer → DashboardDrawer}/index.js +0 -0
- /package/src/{DasboardDrawer → DashboardDrawer}/index.ts +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
textColor: {
|
|
3
|
+
label: {
|
|
4
|
+
primary: {
|
|
5
|
+
DEFAULT: 'var(--btn-primary)',
|
|
6
|
+
outline: {
|
|
7
|
+
DEFAULT: 'var(--btn-primary-bg)',
|
|
8
|
+
hover: 'var(--btn-primary-hover-bg)',
|
|
9
|
+
focus: 'var(var(--btn-primary-focus-bg)',
|
|
10
|
+
active: 'var(--btn-primary-active-bg)',
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
secondary: 'var(--btn-secondary)',
|
|
14
|
+
success: 'var(--btn-success)',
|
|
15
|
+
ghost: 'var(--btn-ghost)',
|
|
16
|
+
outline: {
|
|
17
|
+
DEFAULT: 'var(--btn-ghost)',
|
|
18
|
+
hover: 'var(--btn-ghost-hover-bg)',
|
|
19
|
+
focus: 'var(var(--btn-ghost-focus-bg)',
|
|
20
|
+
active: 'var(--btn-ghost-active-bg)',
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
backgroundColor: {
|
|
25
|
+
label: {
|
|
26
|
+
primary: {
|
|
27
|
+
DEFAULT: 'var(--btn-primary-bg)',
|
|
28
|
+
hover: 'var(--btn-primary-hover-bg)',
|
|
29
|
+
focus: 'var(var(--btn-primary-focus-bg)',
|
|
30
|
+
active: 'var(--btn-primary-active-bg)',
|
|
31
|
+
},
|
|
32
|
+
secondary: {
|
|
33
|
+
DEFAULT: 'var(--btn-secondary-bg)',
|
|
34
|
+
hover: 'var(--btn-secondary-hover-bg)',
|
|
35
|
+
focus: 'var(var(--btn-secondary-focus-bg)',
|
|
36
|
+
active: 'var(--btn-secondary-active-bg)',
|
|
37
|
+
},
|
|
38
|
+
success: {
|
|
39
|
+
DEFAULT: 'var(--btn-success-bg)',
|
|
40
|
+
hover: 'var(--btn-success-hover-bg)',
|
|
41
|
+
focus: 'var(var(--btn-success-focus-bg)',
|
|
42
|
+
active: 'var(--btn-success-active-bg)',
|
|
43
|
+
},
|
|
44
|
+
ghost: {
|
|
45
|
+
DEFAULT: 'var(--btn-ghost-bg)',
|
|
46
|
+
hover: 'var(--btn-ghost-hover-bg)',
|
|
47
|
+
focus: 'var(var(--btn-ghost-focus-bg)',
|
|
48
|
+
active: 'var(--btn-ghost-active-bg)',
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
borderColor: {
|
|
53
|
+
btn: {
|
|
54
|
+
primary: {
|
|
55
|
+
DEFAULT: 'var(--btn-primary-bg)',
|
|
56
|
+
hover: 'var(--btn-primary-hover-bg)',
|
|
57
|
+
focus: 'var(var(--btn-primary-focus-bg)',
|
|
58
|
+
active: 'var(--btn-primary-active-bg)',
|
|
59
|
+
outline: {
|
|
60
|
+
DEFAULT: 'var(--btn-primary-bg)',
|
|
61
|
+
hover: 'var(--btn-primary-hover-bg)',
|
|
62
|
+
focus: 'var(var(--btn-primary-focus-bg)',
|
|
63
|
+
active: 'var(--btn-primary-active-bg)',
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
secondary: {
|
|
67
|
+
DEFAULT: 'var(--btn-secondary-bg)',
|
|
68
|
+
hover: 'var(--btn-secondary-hover-bg)',
|
|
69
|
+
focus: 'var(var(--btn-secondary-focus-bg)',
|
|
70
|
+
active: 'var(--btn-secondary-active-bg)',
|
|
71
|
+
},
|
|
72
|
+
success: {
|
|
73
|
+
DEFAULT: 'var(--btn-success-bg)',
|
|
74
|
+
hover: 'var(--btn-success-hover-bg)',
|
|
75
|
+
focus: 'var(var(--btn-success-focus-bg)',
|
|
76
|
+
active: 'var(--btn-success-active-bg)',
|
|
77
|
+
},
|
|
78
|
+
ghost: {
|
|
79
|
+
DEFAULT: 'var(--btn-ghost-bg)',
|
|
80
|
+
hover: 'var(--btn-ghost-hover-bg)',
|
|
81
|
+
focus: 'var(var(--btn-ghost-focus-bg)',
|
|
82
|
+
active: 'var(--btn-ghost-active-bg)',
|
|
83
|
+
},
|
|
84
|
+
outline: {
|
|
85
|
+
DEFAULT: 'var(--btn-ghost)',
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -11,8 +11,7 @@ export type IProps = {
|
|
|
11
11
|
children: React.ReactNode
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const btnClasses =
|
|
15
|
-
'inline-flex flex-col gap-y-[8px] place-items-center hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active p-[8px] w-full text-[10px] text-center hover:text-primary leading-[1.33] transition duration-300'
|
|
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'
|
|
16
15
|
|
|
17
16
|
const BottomNavigationLink = React.forwardRef<HTMLButtonElement, BottomNavigationLinkProps>(({ className, asChild, ...props }, ref) => {
|
|
18
17
|
const Comp = asChild ? Slot : "button"
|
package/src/Button/Button.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { cn } from '../@/lib/utils'
|
|
|
6
6
|
// import { cn } from "@/lib/utils" порешать с алиасами
|
|
7
7
|
|
|
8
8
|
const buttonVariants = cva(
|
|
9
|
-
'inline-flex items-center border-[2px]
|
|
9
|
+
'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',
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
@@ -37,7 +37,7 @@ const buttonVariants = cva(
|
|
|
37
37
|
}
|
|
38
38
|
)
|
|
39
39
|
const textVariants = cva(
|
|
40
|
-
'inline-flex whitespace-nowrap transition-colors focus-visible:outline-current rounded-[.25em] disabled:pointer-events-none
|
|
40
|
+
'inline-flex whitespace-nowrap transition-colors focus-visible:outline-current disabled:opacity-[.24] rounded-[.25em] disabled:pointer-events-none',
|
|
41
41
|
{
|
|
42
42
|
variants: {
|
|
43
43
|
variant: {
|
package/src/Button/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {Button} from './Button'
|
|
1
|
+
export {Button, buttonVariants} from './Button'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
4
|
+
import { cn } from '../@/lib/utils'
|
|
5
|
+
// import { cn } from "@/lib/utils" порешать с алиасами
|
|
6
|
+
|
|
7
|
+
const chipVariants = cva(
|
|
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',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
primary:
|
|
13
|
+
'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',
|
|
14
|
+
secondary:
|
|
15
|
+
'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',
|
|
16
|
+
success:
|
|
17
|
+
'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',
|
|
18
|
+
'primary-outline':
|
|
19
|
+
'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',
|
|
20
|
+
outline: 'border-[1px] text-btn-outline border-btn-outline ring-[currentColor]',
|
|
21
|
+
ghost: 'text-btn-ghost bg-btn-ghost hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active border-transparent',
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
lg: '',
|
|
25
|
+
md: '',
|
|
26
|
+
sm: 'h-[14px] px-[20px] text-[10px] leading-[1.4]',
|
|
27
|
+
xs: '',
|
|
28
|
+
xxs: '',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: 'secondary',
|
|
33
|
+
size: 'sm',
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
export interface IChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof chipVariants> {
|
|
39
|
+
asChild?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Chip = React.forwardRef<HTMLButtonElement, IChipProps>(({ children, variant, size, className, asChild = false, ...props }, ref) => {
|
|
43
|
+
const Comp = asChild ? Slot : "span"
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Comp
|
|
47
|
+
className={cn(chipVariants({ variant, size, className }))}
|
|
48
|
+
ref={ref}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
Chip.displayName = 'Chip'
|
|
55
|
+
|
|
56
|
+
export { Chip }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Chip } from './Chip'
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul'
|
|
3
|
+
import { Check } from '../Icon'
|
|
4
|
+
import { cn } from '../@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => <DrawerPrimitive.Root {...props} />
|
|
7
|
+
|
|
8
|
+
Drawer.displayName = 'Drawer'
|
|
9
|
+
|
|
10
|
+
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const DrawerPortal = DrawerPrimitive.Portal
|
|
13
|
+
|
|
14
|
+
const DrawerClose = DrawerPrimitive.Close
|
|
15
|
+
|
|
16
|
+
const DrawerTitle = React.forwardRef<
|
|
17
|
+
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
18
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
19
|
+
>(({ className, ...props }, ref) => (
|
|
20
|
+
<DrawerPrimitive.Title
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn(className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
))
|
|
26
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
27
|
+
|
|
28
|
+
const DrawerFooter: React.FC = () => (
|
|
29
|
+
<DrawerClose className="p-[16px]">
|
|
30
|
+
<svg
|
|
31
|
+
className="mx-auto"
|
|
32
|
+
width="38"
|
|
33
|
+
height="10"
|
|
34
|
+
viewBox="0 0 38 10"
|
|
35
|
+
fill="none"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
d="M0 7.39774C0 8.68678 1.25226 9.60455 2.48147 9.21638L17.7955 4.38038C18.5794 4.13282 19.4206 4.13282 20.2045 4.38038L35.5185 9.21638C36.7477 9.60455 38 8.68678 38 7.39774C38 6.56568 37.4606 5.82966 36.6671 5.5791L20.2045 0.380377C19.4206 0.132817 18.5794 0.132817 17.7955 0.380377L1.33286 5.5791C0.539422 5.82966 0 6.56568 0 7.39774Z"
|
|
40
|
+
fill="#243036"
|
|
41
|
+
fillOpacity="0.24"
|
|
42
|
+
/>
|
|
43
|
+
</svg>
|
|
44
|
+
</DrawerClose>
|
|
45
|
+
)
|
|
46
|
+
type DrawerListProps = {
|
|
47
|
+
children: React.ReactNode
|
|
48
|
+
}
|
|
49
|
+
const DrawerList: React.FC<DrawerListProps> = ({ children }) => {
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
role="list"
|
|
53
|
+
className="px-[20px] divide-y"
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
type DrawerListItemProps = {
|
|
60
|
+
value: string
|
|
61
|
+
label: string | JSX.Element
|
|
62
|
+
isActive?: boolean
|
|
63
|
+
onClick?: () => void
|
|
64
|
+
}
|
|
65
|
+
const DrawerListItem: React.FC<DrawerListItemProps> = ({ label, value, isActive, onClick }) => {
|
|
66
|
+
return (
|
|
67
|
+
<button
|
|
68
|
+
className="flex py-[16px] w-full text-left"
|
|
69
|
+
role="listitem"
|
|
70
|
+
aria-selected={isActive}
|
|
71
|
+
aria-labelledby="1"
|
|
72
|
+
onClick={onClick}
|
|
73
|
+
>
|
|
74
|
+
<span className="w-[calc(100%-50px)]">
|
|
75
|
+
<span
|
|
76
|
+
className="flex [&+span]:mt-[4px] font-medium text-[14px] text-muted leading-[1.28]"
|
|
77
|
+
id="1"
|
|
78
|
+
>
|
|
79
|
+
<span className="[&+span]:ml-[8px] truncate">{label}</span>
|
|
80
|
+
|
|
81
|
+
<span className="inline-flex bg-[#EE7C2D] px-[4px] rounded-full h-[16px] text-[#fff] text-[12px] truncate leading-[16px] shrink-0">
|
|
82
|
+
23
|
|
83
|
+
</span>
|
|
84
|
+
</span>
|
|
85
|
+
<span className="block font-bold text-[20px] leading-[1.2]">{value}</span>
|
|
86
|
+
</span>
|
|
87
|
+
{isActive && (
|
|
88
|
+
<Check
|
|
89
|
+
width={16}
|
|
90
|
+
height={16}
|
|
91
|
+
className="ml-auto text-primary self-center"
|
|
92
|
+
/>
|
|
93
|
+
)}
|
|
94
|
+
</button>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const DrawerContent = React.forwardRef<
|
|
99
|
+
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
100
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
101
|
+
>(({ className, children, ...props }, ref) => (
|
|
102
|
+
<DrawerPortal>
|
|
103
|
+
<DrawerPrimitive.Content
|
|
104
|
+
ref={ref}
|
|
105
|
+
className={cn(
|
|
106
|
+
'fixed inset-x-0 top-0 flex h-auto flex-col bg-page drop-shadow-1 rounded-[8px] #24303614; 0px 0px 16px 4px',
|
|
107
|
+
className
|
|
108
|
+
)}
|
|
109
|
+
{...props}
|
|
110
|
+
>
|
|
111
|
+
<DrawerTitle className="sr-only">Выбор компании</DrawerTitle>
|
|
112
|
+
{children}
|
|
113
|
+
<DrawerFooter />
|
|
114
|
+
</DrawerPrimitive.Content>
|
|
115
|
+
</DrawerPortal>
|
|
116
|
+
))
|
|
117
|
+
DrawerContent.displayName = 'DrawerContent'
|
|
118
|
+
|
|
119
|
+
export { Drawer, DrawerTrigger, DrawerContent, DrawerClose, DrawerList, DrawerListItem }
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul'
|
|
3
|
+
import { cn } from '../@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => <DrawerPrimitive.Root {...props} />
|
|
6
|
+
|
|
7
|
+
Drawer.displayName = 'Drawer'
|
|
8
|
+
|
|
9
|
+
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
10
|
+
|
|
11
|
+
const DrawerPortal = DrawerPrimitive.Portal
|
|
12
|
+
|
|
13
|
+
const DrawerClose = DrawerPrimitive.Close
|
|
14
|
+
|
|
15
|
+
const DrawerTitle = React.forwardRef<
|
|
16
|
+
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
17
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
18
|
+
>(({ className, ...props }, ref) => (
|
|
19
|
+
<DrawerPrimitive.Title
|
|
20
|
+
ref={ref}
|
|
21
|
+
className={cn(className)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
))
|
|
25
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
26
|
+
|
|
27
|
+
const DrawerFooter: React.FC = () => (
|
|
28
|
+
<DrawerClose className="p-[16px]">
|
|
29
|
+
<svg
|
|
30
|
+
className="mx-auto"
|
|
31
|
+
width="38"
|
|
32
|
+
height="10"
|
|
33
|
+
viewBox="0 0 38 10"
|
|
34
|
+
fill="none"
|
|
35
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
36
|
+
>
|
|
37
|
+
<path
|
|
38
|
+
d="M0 7.39774C0 8.68678 1.25226 9.60455 2.48147 9.21638L17.7955 4.38038C18.5794 4.13282 19.4206 4.13282 20.2045 4.38038L35.5185 9.21638C36.7477 9.60455 38 8.68678 38 7.39774C38 6.56568 37.4606 5.82966 36.6671 5.5791L20.2045 0.380377C19.4206 0.132817 18.5794 0.132817 17.7955 0.380377L1.33286 5.5791C0.539422 5.82966 0 6.56568 0 7.39774Z"
|
|
39
|
+
fill="#243036"
|
|
40
|
+
fillOpacity="0.24"
|
|
41
|
+
/>
|
|
42
|
+
</svg>
|
|
43
|
+
</DrawerClose>
|
|
44
|
+
)
|
|
45
|
+
type DrawerListProps = {
|
|
46
|
+
children: React.ReactNode
|
|
47
|
+
}
|
|
48
|
+
const DrawerList: React.FC<DrawerListProps> = ({ children }) => {
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
role="listbox"
|
|
52
|
+
className="px-[20px]"
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
type DrawerListItemProps = {
|
|
59
|
+
value: string
|
|
60
|
+
label: string | JSX.Element
|
|
61
|
+
isSelected?: boolean,
|
|
62
|
+
}
|
|
63
|
+
const DrawerListItem: React.FC<DrawerListItemProps> = ({ label, value, isSelected }) => {
|
|
64
|
+
return (
|
|
65
|
+
<div
|
|
66
|
+
role="option"
|
|
67
|
+
aria-labelledby="1"
|
|
68
|
+
aria-selected={isSelected}
|
|
69
|
+
className="flex"
|
|
70
|
+
tabIndex={0}
|
|
71
|
+
>
|
|
72
|
+
<div className="shrink-0">
|
|
73
|
+
<p
|
|
74
|
+
className="font-medium text-[14px] text-muted leading-[1.4]"
|
|
75
|
+
id="1"
|
|
76
|
+
>
|
|
77
|
+
{label}
|
|
78
|
+
</p>
|
|
79
|
+
<p className="font-bold text-[20px] leading-[1.2]">{value}</p>
|
|
80
|
+
</div>
|
|
81
|
+
{isSelected && <span></span>}
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const DrawerContent = React.forwardRef<
|
|
87
|
+
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
88
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
89
|
+
>(({ className, children, ...props }, ref) => (
|
|
90
|
+
<DrawerPortal>
|
|
91
|
+
<DrawerPrimitive.Content
|
|
92
|
+
ref={ref}
|
|
93
|
+
className={cn(
|
|
94
|
+
'fixed inset-x-0 top-0 flex h-auto flex-col bg-page drop-shadow-1 rounded-[8px] #24303614; 0px 0px 16px 4px',
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
97
|
+
|
|
98
|
+
{...props}
|
|
99
|
+
>
|
|
100
|
+
<DrawerTitle className="sr-only">Выбор компании</DrawerTitle>
|
|
101
|
+
{children}
|
|
102
|
+
<DrawerFooter />
|
|
103
|
+
</DrawerPrimitive.Content>
|
|
104
|
+
</DrawerPortal>
|
|
105
|
+
))
|
|
106
|
+
DrawerContent.displayName = 'DrawerContent'
|
|
107
|
+
|
|
108
|
+
export { Drawer, DrawerTrigger, DrawerContent, DrawerClose, DrawerList, DrawerListItem }
|
|
@@ -3,6 +3,7 @@ import { Drawer as DrawerPrimitive } from 'vaul'
|
|
|
3
3
|
import { cn } from '../@/lib/utils'
|
|
4
4
|
|
|
5
5
|
const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => <DrawerPrimitive.Root {...props} />
|
|
6
|
+
|
|
6
7
|
Drawer.displayName = 'Drawer'
|
|
7
8
|
|
|
8
9
|
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
@@ -48,7 +49,7 @@ const DrawerList: React.FC<DrawerListProps> = ({ children }) => {
|
|
|
48
49
|
return (
|
|
49
50
|
<div
|
|
50
51
|
role="listbox"
|
|
51
|
-
className="px-[
|
|
52
|
+
className="px-[20px]"
|
|
52
53
|
>
|
|
53
54
|
{children}
|
|
54
55
|
</div>
|
|
@@ -90,9 +91,10 @@ const DrawerContent = React.forwardRef<
|
|
|
90
91
|
<DrawerPrimitive.Content
|
|
91
92
|
ref={ref}
|
|
92
93
|
className={cn(
|
|
93
|
-
'fixed inset-x-0 top-0 flex h-auto flex-col bg-
|
|
94
|
+
'fixed inset-x-0 top-0 flex h-auto flex-col bg-page drop-shadow-1 rounded-[8px] #24303614; 0px 0px 16px 4px',
|
|
94
95
|
className
|
|
95
96
|
)}
|
|
97
|
+
|
|
96
98
|
{...props}
|
|
97
99
|
>
|
|
98
100
|
<DrawerTitle className="sr-only">Выбор компании</DrawerTitle>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '../@/lib/utils'
|
|
3
|
+
|
|
4
|
+
const InputLabel = React.forwardRef<HTMLLabelElement, React.LabelHTMLAttributes<HTMLLabelElement>>(
|
|
5
|
+
({ className, children, ...props }) => {
|
|
6
|
+
return (
|
|
7
|
+
<label
|
|
8
|
+
className={cn('mb-[4px] font-medium text-[12px] text-light leading-[1.33] focus:text-primary focus-visible:text-primary', className)}
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
{children}
|
|
12
|
+
</label>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
InputLabel.displayName = 'InputLabel'
|
|
18
|
+
|
|
19
|
+
const InputField = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(({ className, type, ...props }, ref) => {
|
|
20
|
+
return (
|
|
21
|
+
<input
|
|
22
|
+
type={type}
|
|
23
|
+
className={cn(
|
|
24
|
+
'border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-1 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',
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
ref={ref}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
InputField.displayName = 'InputField'
|
|
34
|
+
|
|
35
|
+
export { InputField, InputLabel }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputField, InputLabel } from './Input'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
+
import { cn } from '../@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const labelVariants = cva('peer-disabled:opacity-70 font-medium text-[12px] leading-[1.33] peer-disabled:cursor-not-allowed')
|
|
7
|
+
|
|
8
|
+
const Label = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<LabelPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(labelVariants(), className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
))
|
|
18
|
+
Label.displayName = LabelPrimitive.Root.displayName
|
|
19
|
+
|
|
20
|
+
export { Label }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label } from './Label'
|
package/src/Page/Page.tsx
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import React, {FC} from 'react';
|
|
2
2
|
import { cn } from '../@/lib/utils';
|
|
3
3
|
|
|
4
|
-
type
|
|
4
|
+
type IProps = {
|
|
5
5
|
children?: React.ReactNode,
|
|
6
6
|
className?: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const PageNavbar: FC<IProps> = ({children, className}) => {
|
|
10
|
+
return <div className={cn('flex items-center h-[44px] px-[20px]', className)}>
|
|
11
|
+
{children}
|
|
12
|
+
</div>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
PageNavbar.displayName = 'PageNavbar'
|
|
16
|
+
|
|
17
|
+
const Page: FC<IProps> = ({children, className}) => {
|
|
10
18
|
return (
|
|
11
19
|
<div className={cn('sm:container bg-page h-screen', className)}>
|
|
12
20
|
{children}
|
|
@@ -14,4 +22,6 @@ const Page: FC<IPageProps> = ({children, className}) => {
|
|
|
14
22
|
);
|
|
15
23
|
}
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
Page.displayName = 'Page'
|
|
26
|
+
|
|
27
|
+
export { Page, PageNavbar };
|
package/src/Page/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Page } from './Page'
|
|
1
|
+
export { Page, PageNavbar } from './Page'
|
package/src/Tabs/Tabs.tsx
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import cn from 'classnames'
|
|
3
3
|
import * as TabsPrimitive from '@radix-ui/react-tabs'
|
|
4
|
-
import {TabsProps} from
|
|
4
|
+
import { TabsProps } from '@radix-ui/react-tabs'
|
|
5
5
|
|
|
6
6
|
type TabsComponents = {
|
|
7
|
-
List: typeof TabsList
|
|
8
|
-
Trigger: typeof TabsTrigger
|
|
9
|
-
Content: typeof TabsContent
|
|
7
|
+
List: typeof TabsList
|
|
8
|
+
Trigger: typeof TabsTrigger
|
|
9
|
+
Content: typeof TabsContent
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const Tabs: React.FC<TabsProps> & TabsComponents = ({ ...props }) => <TabsPrimitive.Root {...props}/>
|
|
12
|
+
const Tabs: React.FC<TabsProps> & TabsComponents = ({ ...props }) => <TabsPrimitive.Root {...props} />
|
|
13
13
|
|
|
14
14
|
const TabsList = React.forwardRef<
|
|
15
15
|
React.ElementRef<typeof TabsPrimitive.List>,
|
|
@@ -18,7 +18,7 @@ const TabsList = React.forwardRef<
|
|
|
18
18
|
<TabsPrimitive.List
|
|
19
19
|
ref={ref}
|
|
20
20
|
className={cn(
|
|
21
|
-
'inline-flex
|
|
21
|
+
'inline-flex items-center gap-x-[24px] border-b-2',
|
|
22
22
|
className
|
|
23
23
|
)}
|
|
24
24
|
{...props}
|
|
@@ -32,7 +32,7 @@ const TabsTrigger = React.forwardRef<
|
|
|
32
32
|
<TabsPrimitive.Trigger
|
|
33
33
|
ref={ref}
|
|
34
34
|
className={cn(
|
|
35
|
-
|
|
35
|
+
'inline-flex relative after:-bottom-[2px] after:absolute after:inset-x-0 justify-center items-center after:bg-primary disabled:opacity-50 pb-[12px] data-[state=active]:border-bottom-[2px] rounded-[4px] focus-visible:ring-2 focus-visible:ring-ring ring-offset-background focus-visible:ring-offset-2 data-[state=active]:after:h-[3px] text-[14px] data-[state=active]:text-primary leading-[1.4] whitespace-nowrap motion-reduce:hover:transform-none transition-all after:transition-all motion-reduce:transition-none focus-visible:outline-none disabled:pointer-events-none',
|
|
36
36
|
className
|
|
37
37
|
)}
|
|
38
38
|
{...props}
|
|
@@ -46,7 +46,7 @@ const TabsContent = React.forwardRef<
|
|
|
46
46
|
<TabsPrimitive.Content
|
|
47
47
|
ref={ref}
|
|
48
48
|
className={cn(
|
|
49
|
-
'
|
|
49
|
+
'ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
50
50
|
className
|
|
51
51
|
)}
|
|
52
52
|
{...props}
|
|
@@ -54,10 +54,10 @@ const TabsContent = React.forwardRef<
|
|
|
54
54
|
))
|
|
55
55
|
|
|
56
56
|
Tabs.List = TabsList
|
|
57
|
-
TabsList.displayName =
|
|
57
|
+
TabsList.displayName = 'TabsList'
|
|
58
58
|
Tabs.Trigger = TabsTrigger
|
|
59
|
-
TabsTrigger.displayName =
|
|
59
|
+
TabsTrigger.displayName = 'TabsTrigger'
|
|
60
60
|
Tabs.Content = TabsContent
|
|
61
|
-
TabsContent.displayName =
|
|
61
|
+
TabsContent.displayName = 'TabsContent'
|
|
62
62
|
|
|
63
|
-
export
|
|
63
|
+
export { Tabs }
|
package/src/Tabs/index.ts
CHANGED