@modul/mbui 0.0.13 → 0.0.14-beta-pv-53036-7dcefc7f
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/{Info/Info.d.ts → Alert/Alert.d.ts} +4 -4
- package/dist/{Info/Info.js → Alert/Alert.js} +7 -7
- package/dist/Alert/Alert.js.map +1 -0
- package/dist/Alert/index.d.ts +1 -0
- package/dist/Alert/index.js +6 -0
- package/dist/Alert/index.js.map +1 -0
- package/dist/AlertDialog/AlertDialog.d.ts +20 -0
- package/dist/AlertDialog/AlertDialog.js +42 -0
- package/dist/AlertDialog/AlertDialog.js.map +1 -0
- package/dist/AlertDialog/index.d.ts +1 -0
- package/dist/AlertDialog/index.js +16 -0
- package/dist/AlertDialog/index.js.map +1 -0
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Calendar/Calendar.d.ts +8 -0
- package/dist/Calendar/Calendar.js +45 -0
- package/dist/Calendar/Calendar.js.map +1 -0
- package/dist/Calendar/index.d.ts +1 -0
- package/dist/Calendar/index.js +6 -0
- package/dist/Calendar/index.js.map +1 -0
- package/dist/Chip/Chip.d.ts +1 -1
- package/dist/DatePicker/DatePicker.d.ts +11 -0
- package/dist/DatePicker/DatePicker.js +23 -0
- package/dist/DatePicker/DatePicker.js.map +1 -0
- package/dist/DatePicker/index.d.ts +1 -0
- package/dist/DatePicker/index.js +6 -0
- package/dist/DatePicker/index.js.map +1 -0
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Form/Form.d.ts +23 -0
- package/dist/Form/Form.js +73 -0
- package/dist/Form/Form.js.map +1 -0
- package/dist/Form/index.d.ts +1 -0
- package/dist/Form/index.js +13 -0
- package/dist/Form/index.js.map +1 -0
- package/dist/Input/Input.js +1 -1
- package/dist/Input/Input.js.map +1 -1
- package/dist/Input/InputMask.d.ts +3 -0
- package/dist/Input/InputMask.js +12 -0
- package/dist/Input/InputMask.js.map +1 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Input/index.js +3 -1
- package/dist/Input/index.js.map +1 -1
- package/dist/Input-OTP/Input.d.ts +4 -4
- package/dist/Label/Label.d.ts +5 -0
- package/dist/Label/Label.js +13 -0
- package/dist/Label/Label.js.map +1 -0
- package/dist/Label/index.d.ts +1 -0
- package/dist/Label/index.js +6 -0
- package/dist/Label/index.js.map +1 -0
- package/dist/Page/Page.js +1 -1
- package/dist/Page/Page.js.map +1 -1
- package/dist/Progress/Progress.js +1 -1
- package/dist/Progress/Progress.js.map +1 -1
- package/dist/Select/Select.d.ts +5 -0
- package/dist/Select/Select.js +11 -0
- package/dist/Select/Select.js.map +1 -0
- package/dist/Select/SelectAccountCard.d.ts +5 -0
- package/dist/Select/SelectAccountCard.js +77 -0
- package/dist/Select/SelectAccountCard.js.map +1 -0
- package/dist/Select/SelectAsync.d.ts +8 -0
- package/dist/Select/SelectAsync.js +73 -0
- package/dist/Select/SelectAsync.js.map +1 -0
- package/dist/Select/SelectBase.d.ts +8 -0
- package/dist/Select/SelectBase.js +74 -0
- package/dist/Select/SelectBase.js.map +1 -0
- package/dist/Select/index.d.ts +4 -0
- package/dist/Select/index.js +12 -0
- package/dist/Select/index.js.map +1 -0
- package/dist/Switch/Switch.d.ts +4 -0
- package/dist/Switch/Switch.js +31 -0
- package/dist/Switch/Switch.js.map +1 -0
- package/dist/Switch/index.d.ts +1 -0
- package/dist/Switch/index.js +6 -0
- package/dist/Switch/index.js.map +1 -0
- package/dist/Textarea/Textarea.d.ts +5 -0
- package/dist/Textarea/Textarea.js +12 -0
- package/dist/Textarea/Textarea.js.map +1 -0
- package/dist/Textarea/index.d.ts +1 -0
- package/dist/Textarea/index.js +6 -0
- package/dist/Textarea/index.js.map +1 -0
- package/dist/index.d.ts +27 -19
- package/dist/index.js +41 -8
- package/dist/index.js.map +1 -1
- package/package.json +10 -3
- package/src/{Info/Info.tsx → Alert/Alert.tsx} +6 -6
- package/src/Alert/index.ts +1 -0
- package/src/AlertDialog/AlertDialog.tsx +138 -0
- package/src/AlertDialog/index.ts +13 -0
- package/src/Calendar/Calendar.tsx +61 -0
- package/src/Calendar/index.ts +1 -0
- package/src/DatePicker/DatePicker.tsx +40 -0
- package/src/DatePicker/index.ts +1 -0
- package/src/Drawer/Drawer.tsx +2 -2
- package/src/Form/Form.tsx +152 -0
- package/src/Form/index.ts +1 -0
- package/src/Input/Input.tsx +1 -1
- package/src/Input/InputMask.tsx +15 -0
- package/src/Input/index.ts +2 -1
- package/src/Label/Label.tsx +1 -1
- package/src/Page/Page.tsx +1 -1
- package/src/Progress/Progress.tsx +1 -1
- package/src/Select/Select.tsx +19 -0
- package/src/Select/SelectAccountCard.tsx +175 -0
- package/src/Select/SelectAsync.tsx +183 -0
- package/src/Select/SelectBase.tsx +193 -0
- package/src/Select/index.ts +4 -0
- package/src/Switch/Switch.tsx +47 -0
- package/src/Switch/index.ts +1 -0
- package/src/Textarea/Textarea.tsx +24 -0
- package/src/Textarea/index.ts +1 -0
- package/src/assets/css/global.css +20 -0
- package/src/index.ts +68 -40
- package/dist/Base/Input/Base.d.ts +0 -4
- package/dist/Base/Input/Base.js +0 -20
- package/dist/Base/Input/Base.js.map +0 -1
- package/dist/Base/Input/Input.d.ts +0 -4
- package/dist/Base/Input/Input.js +0 -18
- package/dist/Base/Input/Input.js.map +0 -1
- package/dist/Base/Input/index.d.ts +0 -2
- package/dist/Base/Input/index.js +0 -7
- package/dist/Base/Input/index.js.map +0 -1
- package/dist/Base/Input/types.d.ts +0 -9
- package/dist/Base/Input/types.js +0 -3
- package/dist/Base/Input/types.js.map +0 -1
- package/dist/Info/Info.js.map +0 -1
- package/dist/Info/index.d.ts +0 -1
- package/dist/Info/index.js +0 -6
- package/dist/Info/index.js.map +0 -1
- package/src/DrawerCompanyList/CompanyList.tsx +0 -63
- package/src/DrawerCompanyList/index.ts +0 -1
- package/src/Info/index.ts +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,uCAAmC;AAmDlC,wFAnDQ,iBAAO,OAmDR;AAlDR,iCAA6B;AAmD5B,qFAnDQ,WAAI,OAmDR;AAlDL,qCAAiC;AAmDhC,uFAnDQ,eAAM,OAmDR;AAlDP,uCAAmC;AAmDlC,wFAnDQ,iBAAO,OAmDR;AAlDR,+DAAyB;AAmDxB,eAnDM,cAAI,CAmDN;AAlDL,2CAAsF;AAmDrF,yFAnDQ,oBAAQ,OAmDR;AACR,8FApDkB,yBAAa,OAoDlB;AACb,6FArDiC,wBAAY,OAqDjC;AACZ,kGAtD+C,6BAAiB,OAsD/C;AArDlB,yDAK2B;AAoE1B,iGAxEA,mCAAgB,OAwEA;AAChB,qGAxEA,uCAAoB,OAwEA;AACpB,yGAxEA,2CAAwB,OAwEA;AACxB,qGAxEA,uCAAoB,OAwEA;AAtErB,0DAA8B;AA6D7B,oBAAI;AA5DL,+CAAmF;AA+ClF,4FA/CQ,yBAAW,OA+CR;AACX,mGAhDqB,gCAAkB,OAgDrB;AAClB,mGAjDyC,gCAAkB,OAiDzC;AAhDnB,+CAMsB;AA2CrB,mGAhDA,gCAAkB,OAgDA;AAClB,yGAhDA,sCAAwB,OAgDA;AACxB,0GAhDA,uCAAyB,OAgDA;AACzB,0GAhDA,uCAAyB,OAgDA;AACzB,8GAhDA,2CAA6B,OAgDA;AA9C9B,qCAAiC;AA+ChC,uFA/CQ,eAAM,OA+CR;AA9CP,mCAA+B;AAiD9B,sFAjDQ,aAAK,OAiDR;AAhDN,yCAAkC;AAiDjC,mFAjDQ,UAAE,OAiDR;AAhDH,qCAAyF;AAkDxF,uFAlDQ,eAAM,OAkDR;AACN,8FAnDgB,sBAAa,OAmDhB;AACb,4FApD+B,oBAAW,OAoD/B;AACX,4FArD4C,oBAAW,OAqD5C;AACX,8FAtDyD,sBAAa,OAsDzD;AArDd,iCAA6B;AA0D5B,qFA1DQ,WAAI,OA0DR;AAzDL,iCAA6B;AA0D5B,qFA1DQ,WAAI,OA0DR;AAzDL,mCAA2D;AA0C1D,2FA1CQ,kBAAU,OA0CR;AACV,2FA3CoB,kBAAU,OA2CpB;AA+BV,0FA1EgC,iBAAS,OA0EhC;AAzEV,mCAA+B;AA0D9B,sFA1DQ,aAAK,OA0DR;AAzDN,qCAAiC;AA0DhC,uFA1DQ,eAAM,OA0DR;AAzDP,mCAA+B;AA0D9B,sFA1DQ,aAAK,OA0DR;AAzDN,yCAAqC;AA0DpC,yFA1DQ,mBAAQ,OA0DR;AAzDT,qCAAyD;AA0DxD,kGA1DQ,0BAAiB,OA0DR;AAUjB,4FApE2B,oBAAW,OAoE3B;AAnEZ,iCAAwG;AA0DvG,qFA1DQ,WAAI,OA0DR;AACJ,0FA3Dc,gBAAS,OA2Dd;AACT,0FA5DyB,gBAAS,OA4DzB;AACT,yFA7DoC,eAAQ,OA6DpC;AACR,4FA9D8C,kBAAW,OA8D9C;AACX,gGA/D2D,sBAAe,OA+D3D;AACf,4FAhE4E,kBAAW,OAgE5E;AA/DZ,yCAAqC;AAgEpC,yFAhEQ,mBAAQ,OAgER;AA/DT,6CAAyC;AAgExC,2FAhEQ,uBAAU,OAgER;AA/DX,qCAAiC;AAkEhC,uFAlEQ,eAAM,OAkER;AAjEP,yCAAqC;AAgDpC,yFAhDQ,mBAAQ,OAgDR;AA/CT,+CAUsB;AAuDrB,4FAhEA,yBAAW,OAgEA;AACX,mGAhEA,gCAAkB,OAgEA;AAClB,mGAhEA,gCAAkB,OAgEA;AAClB,kGAhEA,+BAAiB,OAgEA;AACjB,kGAhEA,+BAAiB,OAgEA;AACjB,iGAhEA,8BAAgB,OAgEA;AAChB,uGAhEA,oCAAsB,OAgEA;AACtB,kGAhEA,+BAAiB,OAgEA;AACjB,kGAhEA,+BAAiB,OAgEA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modul/mbui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-beta-pv-53036-7dcefc7f",
|
|
4
4
|
"packageManager": "yarn@3.5.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@hookform/resolvers": "3.9.0",
|
|
24
25
|
"@radix-ui/react-accordion": "^1.2.0",
|
|
26
|
+
"@radix-ui/react-alert-dialog": "1.1.1",
|
|
25
27
|
"@radix-ui/react-collapsible": "1.1.0",
|
|
26
28
|
"@radix-ui/react-dropdown-menu": "2.1.1",
|
|
27
29
|
"@radix-ui/react-label": "2.1.0",
|
|
@@ -30,6 +32,7 @@
|
|
|
30
32
|
"@radix-ui/react-select": "2.1.1",
|
|
31
33
|
"@radix-ui/react-slider": "^1.2.0",
|
|
32
34
|
"@radix-ui/react-slot": "1.1.0",
|
|
35
|
+
"@radix-ui/react-switch": "1.1.0",
|
|
33
36
|
"@radix-ui/react-tabs": "^1.1.0",
|
|
34
37
|
"@radix-ui/react-tooltip": "^1.1.2",
|
|
35
38
|
"@types/lodash": "4.17.5",
|
|
@@ -38,11 +41,15 @@
|
|
|
38
41
|
"input-otp": "1.2.4",
|
|
39
42
|
"lodash": "4.17.5",
|
|
40
43
|
"react-datepicker": "4.16.0",
|
|
41
|
-
"react-
|
|
44
|
+
"react-day-picker": "^9.0.8",
|
|
45
|
+
"react-hook-form": "7.53.0",
|
|
46
|
+
"react-imask": "7.6.1",
|
|
47
|
+
"react-select": "5.8.0",
|
|
42
48
|
"tailwind-merge": "^2.3.0",
|
|
43
49
|
"tailwindcss": "^3.4.4",
|
|
44
50
|
"tailwindcss-animate": "^1.0.7",
|
|
45
|
-
"vaul": "0.9.1"
|
|
51
|
+
"vaul": "0.9.1",
|
|
52
|
+
"zod": "3.23.8"
|
|
46
53
|
},
|
|
47
54
|
"devDependencies": {
|
|
48
55
|
"@babel/core": "^7.9.0",
|
|
@@ -4,7 +4,7 @@ import { cva, type VariantProps } from 'class-variance-authority'
|
|
|
4
4
|
import { cn } from '../@/lib/utils'
|
|
5
5
|
// import { cn } from "@/lib/utils" порешать с алиасами
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const alertVariants = cva('px-[16px] py-[12px] rounded-sm text-[14px]', {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
light: 'bg-[--cl-graphite-7]',
|
|
@@ -19,13 +19,13 @@ const infoVariants = cva('px-[16px] py-[12px] rounded-1 text-[14px]', {
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
export interface IProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof
|
|
22
|
+
export interface IProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const Alert = React.forwardRef<HTMLDivElement, IProps>(({ className, variant, children, ...props }, ref) => {
|
|
26
26
|
return (
|
|
27
27
|
<div
|
|
28
|
-
className={cn(
|
|
28
|
+
className={cn(alertVariants({ variant, className }))}
|
|
29
29
|
{...props}
|
|
30
30
|
>
|
|
31
31
|
{children}
|
|
@@ -33,6 +33,6 @@ const Info = React.forwardRef<HTMLDivElement, IProps>(({ className, variant, chi
|
|
|
33
33
|
)
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Alert.displayName = 'Alert'
|
|
37
37
|
|
|
38
|
-
export {
|
|
38
|
+
export { Alert }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert } from './Alert'
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../@/lib/utils"
|
|
5
|
+
import { buttonVariants } from "../Button"
|
|
6
|
+
|
|
7
|
+
const AlertDialog = AlertDialogPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
10
|
+
|
|
11
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
12
|
+
|
|
13
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
14
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
16
|
+
>(({ className, ...props }, ref) => (
|
|
17
|
+
<AlertDialogPrimitive.Overlay
|
|
18
|
+
className={cn(
|
|
19
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
ref={ref}
|
|
24
|
+
/>
|
|
25
|
+
))
|
|
26
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
27
|
+
|
|
28
|
+
const AlertDialogContent = React.forwardRef<
|
|
29
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
30
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
31
|
+
>(({ className, ...props }, ref) => (
|
|
32
|
+
<AlertDialogPortal>
|
|
33
|
+
<AlertDialogOverlay />
|
|
34
|
+
<AlertDialogPrimitive.Content
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(
|
|
37
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-input bg-dialog p-[16px] shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-md",
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
</AlertDialogPortal>
|
|
43
|
+
))
|
|
44
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
45
|
+
|
|
46
|
+
const AlertDialogHeader = ({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
50
|
+
<div
|
|
51
|
+
className={cn(
|
|
52
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
59
|
+
|
|
60
|
+
const AlertDialogFooter = ({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
64
|
+
<div
|
|
65
|
+
className={cn(
|
|
66
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
67
|
+
className
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
73
|
+
|
|
74
|
+
const AlertDialogTitle = React.forwardRef<
|
|
75
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
76
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
77
|
+
>(({ className, ...props }, ref) => (
|
|
78
|
+
<AlertDialogPrimitive.Title
|
|
79
|
+
ref={ref}
|
|
80
|
+
className={cn("text-lg font-semibold", className)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
))
|
|
84
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
85
|
+
|
|
86
|
+
const AlertDialogDescription = React.forwardRef<
|
|
87
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
88
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
89
|
+
>(({ className, ...props }, ref) => (
|
|
90
|
+
<AlertDialogPrimitive.Description
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
))
|
|
96
|
+
AlertDialogDescription.displayName =
|
|
97
|
+
AlertDialogPrimitive.Description.displayName
|
|
98
|
+
|
|
99
|
+
const AlertDialogAction = React.forwardRef<
|
|
100
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
101
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
102
|
+
>(({ className, ...props }, ref) => (
|
|
103
|
+
<AlertDialogPrimitive.Action
|
|
104
|
+
ref={ref}
|
|
105
|
+
className={cn(buttonVariants({variant: 'primary', size: 'sm'}), className)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
))
|
|
109
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
110
|
+
|
|
111
|
+
const AlertDialogCancel = React.forwardRef<
|
|
112
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
113
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
114
|
+
>(({ className, ...props }, ref) => (
|
|
115
|
+
<AlertDialogPrimitive.Cancel
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={cn(
|
|
118
|
+
buttonVariants({ variant: "outline", size: 'sm' }),
|
|
119
|
+
className
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
))
|
|
124
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
AlertDialog,
|
|
128
|
+
AlertDialogPortal,
|
|
129
|
+
AlertDialogOverlay,
|
|
130
|
+
AlertDialogTrigger,
|
|
131
|
+
AlertDialogContent,
|
|
132
|
+
AlertDialogHeader,
|
|
133
|
+
AlertDialogFooter,
|
|
134
|
+
AlertDialogTitle,
|
|
135
|
+
AlertDialogDescription,
|
|
136
|
+
AlertDialogAction,
|
|
137
|
+
AlertDialogCancel,
|
|
138
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export {
|
|
2
|
+
AlertDialog,
|
|
3
|
+
AlertDialogPortal,
|
|
4
|
+
AlertDialogOverlay,
|
|
5
|
+
AlertDialogTrigger,
|
|
6
|
+
AlertDialogContent,
|
|
7
|
+
AlertDialogHeader,
|
|
8
|
+
AlertDialogFooter,
|
|
9
|
+
AlertDialogTitle,
|
|
10
|
+
AlertDialogDescription,
|
|
11
|
+
AlertDialogAction,
|
|
12
|
+
AlertDialogCancel,
|
|
13
|
+
} from './AlertDialog'
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { DayPicker } from 'react-day-picker'
|
|
3
|
+
import { cn } from '../@/lib/utils'
|
|
4
|
+
import { ru } from 'date-fns/locale'
|
|
5
|
+
|
|
6
|
+
const daySelectedClasses = 'bg-btn-primary text-btn-primary rounded-sm'
|
|
7
|
+
const dayTodayClasses = 'bg-btn-secondary text-btn-secondary rounded-sm'
|
|
8
|
+
const rangeMiddleClasses = 'date-range-middle aria-selected:bg-btn-primary/50 aria-selected:text-white'
|
|
9
|
+
const btnNavClasses =
|
|
10
|
+
'opacity-50 hover:opacity-100 ring-offset-2 focus-visible:opacity-100 focus-visible:outline-primary border-input border rounded-sm shadow-sm'
|
|
11
|
+
|
|
12
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>
|
|
13
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
|
|
14
|
+
return (
|
|
15
|
+
<DayPicker
|
|
16
|
+
locale={ru}
|
|
17
|
+
showOutsideDays={showOutsideDays}
|
|
18
|
+
className={cn('inline-flex', className)}
|
|
19
|
+
classNames={{
|
|
20
|
+
months: 'relative',
|
|
21
|
+
month: 'flex flex-col space-y-[16px] items-center',
|
|
22
|
+
month_grid: 'w-full border-collapse',
|
|
23
|
+
month_caption: 'inline m-x-auto',
|
|
24
|
+
caption_label: 'text-sm font-medium capitalize',
|
|
25
|
+
nav: 'flex justify-between absolute start-0 end-0',
|
|
26
|
+
button_previous: btnNavClasses,
|
|
27
|
+
button_next: btnNavClasses,
|
|
28
|
+
weekdays: 'flex',
|
|
29
|
+
weekday: 'text-light w-[32px] font-normal text-[14px]',
|
|
30
|
+
week: 'flex w-full mt-2',
|
|
31
|
+
day_button: 'w-[32px] h-[32px] p-0',
|
|
32
|
+
day: cn(
|
|
33
|
+
'aria-selected:opacity-100 text-[14px] leading-[1]',
|
|
34
|
+
props.mode === 'range'
|
|
35
|
+
? '[&:(.day-range-middle)]:rounded-0 [&:has(>.day-range-end)]:rounded-r-sm [&:has(>.day-range-start)]:rounded-l-sm first:[&:has([aria-selected])]:rounded-l-sm last:[&:has([aria-selected])]:rounded-r-sm'
|
|
36
|
+
: '[&:([aria-selected])]:rounded-sm'
|
|
37
|
+
),
|
|
38
|
+
range_start: 'day-range-start',
|
|
39
|
+
range_end: 'day-range-end',
|
|
40
|
+
range_middle: rangeMiddleClasses,
|
|
41
|
+
selected: daySelectedClasses,
|
|
42
|
+
today: dayTodayClasses,
|
|
43
|
+
outside:
|
|
44
|
+
'day-outside opacity-50 aria-selected:bg-primary aria-selected:text-[white] aria-selected:opacity-30',
|
|
45
|
+
disabled: 'text-light opacity-50',
|
|
46
|
+
hidden: 'invisible',
|
|
47
|
+
...classNames,
|
|
48
|
+
}}
|
|
49
|
+
components={
|
|
50
|
+
{
|
|
51
|
+
// Chevron: () => <Left className="w-4 h-4" />,
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Calendar.displayName = 'Calendar'
|
|
60
|
+
|
|
61
|
+
export { Calendar }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar } from './Calendar'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
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'
|
|
7
|
+
import { ru } from 'date-fns/locale'
|
|
8
|
+
|
|
9
|
+
const trigegrClasses = 'inline-flex items-center border-input px-[12px] border rounded-sm h-[44px] text-left'
|
|
10
|
+
|
|
11
|
+
interface IProps {
|
|
12
|
+
mode?: any;
|
|
13
|
+
placeholder?: string,
|
|
14
|
+
date?: Date,
|
|
15
|
+
classTrigger?: string,
|
|
16
|
+
triggerDisabled?: boolean,
|
|
17
|
+
onSelect?: (value: Date) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const DatePicker: React.FC<IProps> = ({placeholder, triggerDisabled, date, classTrigger, ...props}) => {
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Popover>
|
|
24
|
+
<Popover.Trigger asChild>
|
|
25
|
+
<button className={cn(trigegrClasses, {'bg-light text-light':triggerDisabled}, classTrigger)} disabled={triggerDisabled}>
|
|
26
|
+
{date ? <span className='w-[calc(100%-26px)] truncate'>{format(date ,'PPP', {locale: ru})}</span> : <span className='w-[calc(100%-26px)] text-light truncate'>{placeholder}</span>}
|
|
27
|
+
<CalendarIcon width={18} height={18} className="ml-[8px] text-light shrink-0" />
|
|
28
|
+
</button>
|
|
29
|
+
</Popover.Trigger>
|
|
30
|
+
<Popover.Content
|
|
31
|
+
className="bg-page p-0 w-auto"
|
|
32
|
+
align="center"
|
|
33
|
+
>
|
|
34
|
+
<Calendar {...props}/>
|
|
35
|
+
</Popover.Content>
|
|
36
|
+
</Popover>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { DatePicker }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from './DatePicker'
|
package/src/Drawer/Drawer.tsx
CHANGED
|
@@ -47,8 +47,8 @@ const DrawerContent = React.forwardRef<
|
|
|
47
47
|
<DrawerPrimitive.Content
|
|
48
48
|
ref={ref}
|
|
49
49
|
className={cn(
|
|
50
|
-
`z-50 fixed inset-x-0 flex flex-col bg-page
|
|
51
|
-
direction === 'top' ? 'top-0 rounded-b-
|
|
50
|
+
`z-50 fixed inset-x-0 flex flex-col bg-page shadow-sm max-h-[94%] sm:container`,
|
|
51
|
+
direction === 'top' ? 'top-0 rounded-b-sm ' : 'bottom-0 rounded-t-sm',
|
|
52
52
|
className
|
|
53
53
|
)}
|
|
54
54
|
{...props}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label'
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
4
|
+
import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from 'react-hook-form'
|
|
5
|
+
|
|
6
|
+
import { cn } from '../@/lib/utils'
|
|
7
|
+
import { Label } from '../Label'
|
|
8
|
+
|
|
9
|
+
const Form = FormProvider
|
|
10
|
+
|
|
11
|
+
type FormFieldContextValue<
|
|
12
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
13
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
|
14
|
+
> = {
|
|
15
|
+
name: TName
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)
|
|
19
|
+
|
|
20
|
+
const FormField = <
|
|
21
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
22
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
|
23
|
+
>({
|
|
24
|
+
...props
|
|
25
|
+
}: ControllerProps<TFieldValues, TName>) => {
|
|
26
|
+
return (
|
|
27
|
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
28
|
+
<Controller {...props} />
|
|
29
|
+
</FormFieldContext.Provider>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const useFormField = () => {
|
|
34
|
+
const fieldContext = React.useContext(FormFieldContext)
|
|
35
|
+
const itemContext = React.useContext(FormItemContext)
|
|
36
|
+
const { getFieldState, formState } = useFormContext()
|
|
37
|
+
|
|
38
|
+
const fieldState = getFieldState(fieldContext.name, formState)
|
|
39
|
+
|
|
40
|
+
if (!fieldContext) {
|
|
41
|
+
throw new Error('useFormField should be used within <FormField>')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { id } = itemContext
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
name: fieldContext.name,
|
|
49
|
+
formItemId: `${id}-form-item`,
|
|
50
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
51
|
+
formMessageId: `${id}-form-item-message`,
|
|
52
|
+
...fieldState,
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type FormItemContextValue = {
|
|
57
|
+
id: string
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)
|
|
61
|
+
|
|
62
|
+
const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
63
|
+
({ className, ...props }, ref) => {
|
|
64
|
+
const id = React.useId()
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<FormItemContext.Provider value={{ id }}>
|
|
68
|
+
<div
|
|
69
|
+
ref={ref}
|
|
70
|
+
className={cn('space-y-2', className)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
</FormItemContext.Provider>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
FormItem.displayName = 'FormItem'
|
|
78
|
+
|
|
79
|
+
const FormLabel = React.forwardRef<
|
|
80
|
+
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
81
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
82
|
+
>(({ className, ...props }, ref) => {
|
|
83
|
+
const { error, formItemId } = useFormField()
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Label
|
|
87
|
+
ref={ref}
|
|
88
|
+
className={cn(error && 'text-destructive', className)}
|
|
89
|
+
htmlFor={formItemId}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
})
|
|
94
|
+
FormLabel.displayName = 'FormLabel'
|
|
95
|
+
|
|
96
|
+
const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(
|
|
97
|
+
({ ...props }, ref) => {
|
|
98
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Slot
|
|
102
|
+
ref={ref}
|
|
103
|
+
id={formItemId}
|
|
104
|
+
aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
|
|
105
|
+
aria-invalid={!!error}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
FormControl.displayName = 'FormControl'
|
|
112
|
+
|
|
113
|
+
const FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
114
|
+
({ className, ...props }, ref) => {
|
|
115
|
+
const { formDescriptionId } = useFormField()
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<p
|
|
119
|
+
ref={ref}
|
|
120
|
+
id={formDescriptionId}
|
|
121
|
+
className={cn('text-[0.8rem] text-light', className)}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
FormDescription.displayName = 'FormDescription'
|
|
128
|
+
|
|
129
|
+
const FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
130
|
+
({ className, children, ...props }, ref) => {
|
|
131
|
+
const { error, formMessageId } = useFormField()
|
|
132
|
+
const body = error ? String(error?.message) : children
|
|
133
|
+
|
|
134
|
+
if (!body) {
|
|
135
|
+
return null
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<p
|
|
140
|
+
ref={ref}
|
|
141
|
+
id={formMessageId}
|
|
142
|
+
className={cn('text-[0.8rem] font-medium text-destructive', className)}
|
|
143
|
+
{...props}
|
|
144
|
+
>
|
|
145
|
+
{body}
|
|
146
|
+
</p>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
FormMessage.displayName = 'FormMessage'
|
|
151
|
+
|
|
152
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } from './Form'
|
package/src/Input/Input.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const InputField = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<
|
|
|
21
21
|
<input
|
|
22
22
|
type={type}
|
|
23
23
|
className={cn(
|
|
24
|
-
'border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-
|
|
24
|
+
'form-input px-[16px] 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',
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
ref={ref}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { IMaskInput } from 'react-imask'
|
|
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'
|
|
5
|
+
|
|
6
|
+
const InputMask: React.FC = ({ ...props }) => {
|
|
7
|
+
return (
|
|
8
|
+
<IMaskInput
|
|
9
|
+
className={inputClasses}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { InputMask }
|
package/src/Input/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { InputField, InputLabel } from './Input'
|
|
1
|
+
export { InputField, InputLabel } from './Input'
|
|
2
|
+
export { InputMask } from './InputMask'
|
package/src/Label/Label.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import * as LabelPrimitive from '@radix-ui/react-label'
|
|
|
3
3
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
4
|
import { cn } from '../@/lib/utils'
|
|
5
5
|
|
|
6
|
-
const labelVariants = cva('peer-disabled:opacity-70
|
|
6
|
+
const labelVariants = cva('peer-disabled:opacity-70 peer-disabled:cursor-not-allowed')
|
|
7
7
|
|
|
8
8
|
const Label = React.forwardRef<
|
|
9
9
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
package/src/Page/Page.tsx
CHANGED
|
@@ -15,7 +15,7 @@ const Navbar: FC<IProps> = ({ children, className }) => {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const Content: FC<IProps> = ({ children, className }) => {
|
|
18
|
-
return <div className={cn('px-[20px] py-[16px]', className)}>{children}</div>
|
|
18
|
+
return <div className={cn('px-[20px] py-[16px] overflow-y-auto', className)}>{children}</div>
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const Page: IPage = ({ children, className }: IProps) => {
|
|
@@ -9,7 +9,7 @@ const Progress = React.forwardRef<
|
|
|
9
9
|
>(({ className, value, ...props }, ref) => (
|
|
10
10
|
<ProgressPrimitive.Root
|
|
11
11
|
ref={ref}
|
|
12
|
-
className={cn('relative h-[--progress-height] w-full overflow-hidden rounded-full bg-[--
|
|
12
|
+
className={cn('relative h-[--progress-height] w-full overflow-hidden rounded-full bg-[--progress-bg]', className)}
|
|
13
13
|
{...props}
|
|
14
14
|
>
|
|
15
15
|
<ProgressPrimitive.Indicator
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SelectBase } from './SelectBase'
|
|
3
|
+
import {GroupBase, Props} from "react-select";
|
|
4
|
+
|
|
5
|
+
type SelectBaseProps<
|
|
6
|
+
Option,
|
|
7
|
+
IsMulti extends boolean = false,
|
|
8
|
+
Group extends GroupBase<Option> = GroupBase<Option>
|
|
9
|
+
> = Props<Option, IsMulti, Group>
|
|
10
|
+
|
|
11
|
+
function Select<
|
|
12
|
+
Option,
|
|
13
|
+
IsMulti extends boolean = false,
|
|
14
|
+
Group extends GroupBase<Option> = GroupBase<Option>
|
|
15
|
+
>(props: SelectBaseProps<Option, IsMulti, Group>) {
|
|
16
|
+
return <SelectBase {...props}/>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Select }
|