@modul/mbui 0.0.13-beta-pv-53036-14e26eb5 → 0.0.13

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 (136) hide show
  1. package/dist/Base/Input/Base.d.ts +4 -0
  2. package/dist/Base/Input/Base.js +20 -0
  3. package/dist/Base/Input/Base.js.map +1 -0
  4. package/dist/Base/Input/Input.d.ts +4 -0
  5. package/dist/Base/Input/Input.js +18 -0
  6. package/dist/Base/Input/Input.js.map +1 -0
  7. package/dist/Base/Input/index.d.ts +2 -0
  8. package/dist/Base/Input/index.js +7 -0
  9. package/dist/Base/Input/index.js.map +1 -0
  10. package/dist/Base/Input/types.d.ts +9 -0
  11. package/dist/Base/Input/types.js +3 -0
  12. package/dist/Base/Input/types.js.map +1 -0
  13. package/dist/Button/Button.d.ts +1 -1
  14. package/dist/Chip/Chip.d.ts +1 -1
  15. package/dist/Drawer/Drawer.js +1 -1
  16. package/dist/Drawer/Drawer.js.map +1 -1
  17. package/dist/{Alert/Alert.d.ts → Info/Info.d.ts} +4 -4
  18. package/dist/{Alert/Alert.js → Info/Info.js} +7 -7
  19. package/dist/Info/Info.js.map +1 -0
  20. package/dist/Info/index.d.ts +1 -0
  21. package/dist/Info/index.js +6 -0
  22. package/dist/Info/index.js.map +1 -0
  23. package/dist/Input/Input.js +1 -1
  24. package/dist/Input/Input.js.map +1 -1
  25. package/dist/Input/index.d.ts +0 -1
  26. package/dist/Input/index.js +1 -3
  27. package/dist/Input/index.js.map +1 -1
  28. package/dist/Input-OTP/Input.d.ts +4 -4
  29. package/dist/Page/Page.js +1 -1
  30. package/dist/Page/Page.js.map +1 -1
  31. package/dist/Progress/Progress.d.ts +4 -0
  32. package/dist/Progress/Progress.js +12 -0
  33. package/dist/Progress/Progress.js.map +1 -0
  34. package/dist/Progress/index.d.ts +1 -0
  35. package/dist/Progress/index.js +6 -0
  36. package/dist/Progress/index.js.map +1 -0
  37. package/dist/index.d.ts +20 -27
  38. package/dist/index.js +10 -41
  39. package/dist/index.js.map +1 -1
  40. package/package.json +4 -12
  41. package/src/Drawer/Drawer.tsx +2 -2
  42. package/src/DrawerCompanyList/CompanyList.tsx +63 -0
  43. package/src/DrawerCompanyList/index.ts +1 -0
  44. package/src/{Alert/Alert.tsx → Info/Info.tsx} +6 -6
  45. package/src/Info/index.ts +1 -0
  46. package/src/Input/Input.tsx +1 -1
  47. package/src/Input/index.ts +1 -2
  48. package/src/Label/Label.tsx +1 -1
  49. package/src/Page/Page.tsx +1 -1
  50. package/src/Progress/Progress.tsx +23 -0
  51. package/src/Progress/index.ts +1 -0
  52. package/src/assets/css/global.css +9 -22
  53. package/src/index.ts +41 -67
  54. package/dist/Alert/Alert.js.map +0 -1
  55. package/dist/Alert/index.d.ts +0 -1
  56. package/dist/Alert/index.js +0 -6
  57. package/dist/Alert/index.js.map +0 -1
  58. package/dist/AlertDialog/AlertDialog.d.ts +0 -20
  59. package/dist/AlertDialog/AlertDialog.js +0 -42
  60. package/dist/AlertDialog/AlertDialog.js.map +0 -1
  61. package/dist/AlertDialog/index.d.ts +0 -1
  62. package/dist/AlertDialog/index.js +0 -16
  63. package/dist/AlertDialog/index.js.map +0 -1
  64. package/dist/Calendar/Calendar.d.ts +0 -8
  65. package/dist/Calendar/Calendar.js +0 -45
  66. package/dist/Calendar/Calendar.js.map +0 -1
  67. package/dist/Calendar/index.d.ts +0 -1
  68. package/dist/Calendar/index.js +0 -6
  69. package/dist/Calendar/index.js.map +0 -1
  70. package/dist/DatePicker/DatePicker.d.ts +0 -11
  71. package/dist/DatePicker/DatePicker.js +0 -23
  72. package/dist/DatePicker/DatePicker.js.map +0 -1
  73. package/dist/DatePicker/index.d.ts +0 -1
  74. package/dist/DatePicker/index.js +0 -6
  75. package/dist/DatePicker/index.js.map +0 -1
  76. package/dist/Form/Form.d.ts +0 -23
  77. package/dist/Form/Form.js +0 -73
  78. package/dist/Form/Form.js.map +0 -1
  79. package/dist/Form/index.d.ts +0 -1
  80. package/dist/Form/index.js +0 -13
  81. package/dist/Form/index.js.map +0 -1
  82. package/dist/Input/InputMask.d.ts +0 -3
  83. package/dist/Input/InputMask.js +0 -12
  84. package/dist/Input/InputMask.js.map +0 -1
  85. package/dist/Label/Label.d.ts +0 -5
  86. package/dist/Label/Label.js +0 -13
  87. package/dist/Label/Label.js.map +0 -1
  88. package/dist/Label/index.d.ts +0 -1
  89. package/dist/Label/index.js +0 -6
  90. package/dist/Label/index.js.map +0 -1
  91. package/dist/Select/Select.d.ts +0 -5
  92. package/dist/Select/Select.js +0 -11
  93. package/dist/Select/Select.js.map +0 -1
  94. package/dist/Select/SelectAccountCard.d.ts +0 -5
  95. package/dist/Select/SelectAccountCard.js +0 -77
  96. package/dist/Select/SelectAccountCard.js.map +0 -1
  97. package/dist/Select/SelectAsync.d.ts +0 -8
  98. package/dist/Select/SelectAsync.js +0 -73
  99. package/dist/Select/SelectAsync.js.map +0 -1
  100. package/dist/Select/SelectBase.d.ts +0 -8
  101. package/dist/Select/SelectBase.js +0 -74
  102. package/dist/Select/SelectBase.js.map +0 -1
  103. package/dist/Select/index.d.ts +0 -4
  104. package/dist/Select/index.js +0 -12
  105. package/dist/Select/index.js.map +0 -1
  106. package/dist/Switch/Switch.d.ts +0 -4
  107. package/dist/Switch/Switch.js +0 -31
  108. package/dist/Switch/Switch.js.map +0 -1
  109. package/dist/Switch/index.d.ts +0 -1
  110. package/dist/Switch/index.js +0 -6
  111. package/dist/Switch/index.js.map +0 -1
  112. package/dist/Textarea/Textarea.d.ts +0 -5
  113. package/dist/Textarea/Textarea.js +0 -12
  114. package/dist/Textarea/Textarea.js.map +0 -1
  115. package/dist/Textarea/index.d.ts +0 -1
  116. package/dist/Textarea/index.js +0 -6
  117. package/dist/Textarea/index.js.map +0 -1
  118. package/src/Alert/index.ts +0 -1
  119. package/src/AlertDialog/AlertDialog.tsx +0 -138
  120. package/src/AlertDialog/index.ts +0 -13
  121. package/src/Calendar/Calendar.tsx +0 -61
  122. package/src/Calendar/index.ts +0 -1
  123. package/src/DatePicker/DatePicker.tsx +0 -40
  124. package/src/DatePicker/index.ts +0 -1
  125. package/src/Form/Form.tsx +0 -152
  126. package/src/Form/index.ts +0 -1
  127. package/src/Input/InputMask.tsx +0 -15
  128. package/src/Select/Select.tsx +0 -19
  129. package/src/Select/SelectAccountCard.tsx +0 -175
  130. package/src/Select/SelectAsync.tsx +0 -183
  131. package/src/Select/SelectBase.tsx +0 -193
  132. package/src/Select/index.ts +0 -4
  133. package/src/Switch/Switch.tsx +0 -47
  134. package/src/Switch/index.ts +0 -1
  135. package/src/Textarea/Textarea.tsx +0 -24
  136. package/src/Textarea/index.ts +0 -1
@@ -1,138 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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'
@@ -1,61 +0,0 @@
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 }
@@ -1 +0,0 @@
1
- export { Calendar } from './Calendar'
@@ -1,40 +0,0 @@
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 }
@@ -1 +0,0 @@
1
- export { DatePicker } from './DatePicker'
package/src/Form/Form.tsx DELETED
@@ -1,152 +0,0 @@
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 }
package/src/Form/index.ts DELETED
@@ -1 +0,0 @@
1
- export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } from './Form'
@@ -1,15 +0,0 @@
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 }
@@ -1,19 +0,0 @@
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 }
@@ -1,175 +0,0 @@
1
- import * as React from 'react'
2
-
3
- import { DropdownSmallOld, CheckSmall } from '../Icon'
4
-
5
- import Select, {
6
- components,
7
- ControlProps,
8
- OptionProps,
9
- DropdownIndicatorProps,
10
- StylesConfig,
11
- SingleValueProps,
12
- MenuProps,
13
- ValueContainerProps,
14
- Props,
15
- GroupBase,
16
- } 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'
22
-
23
- const colourStyles: StylesConfig = {
24
- control: () => ({}),
25
- option: () => ({}),
26
- input: () => ({}),
27
- dropdownIndicator: () => ({}),
28
- indicatorsContainer: () => ({}),
29
- menu: () => ({}),
30
- menuList: () => ({}),
31
- singleValue: () => ({}),
32
- valueContainer: () => ({}),
33
- }
34
-
35
- const Control = ({ children, ...props }: ControlProps) => {
36
- const { isFocused } = props
37
- return (
38
- <components.Control
39
- className={cn(
40
- selectTriggerClasses,
41
- { 'outline outline-primary outline-offset-2 outline-2': isFocused }
42
- )}
43
- {...props}
44
- >
45
- {children}
46
- </components.Control>
47
- )
48
- }
49
-
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'
52
-
53
- const Option = ({ children, ...props }: OptionProps) => {
54
- const {
55
- isSelected,
56
- isFocused,
57
- isDisabled,
58
- // @ts-ignore
59
- data: { label, account, balance, cur },
60
- } = props
61
- return (
62
- <components.Option
63
- className={cn(optionClasses, { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled })}
64
- {...props}
65
- >
66
- <span className="flex basis-0 grow">
67
- <span>
68
- <span>{label}</span>
69
- <br />
70
- <span className="text-[14px] text-light">{account}</span>
71
- </span>
72
- <span className="ml-auto shrink-0">
73
- {balance}&nbsp;{cur}
74
- </span>
75
- </span>
76
-
77
- <span className="ml-[16px] w-[24px] h-[24px] shrink-0">
78
- {isSelected && (
79
- <CheckSmall
80
- width="24"
81
- height="24"
82
- className="text-primary"
83
- />
84
- )}
85
- </span>
86
- </components.Option>
87
- )
88
- }
89
-
90
- const DropdownIndicator = ({ children, ...props }: DropdownIndicatorProps) => {
91
- return (
92
- <components.DropdownIndicator
93
- className="shrink-0"
94
- {...props}
95
- >
96
- <DropdownSmallOld
97
- className="text-white"
98
- width="16"
99
- height="16"
100
- />
101
- </components.DropdownIndicator>
102
- )
103
- }
104
-
105
- const ValueContainer = ({ children, ...props }: ValueContainerProps) => {
106
- return (
107
- <components.ValueContainer
108
- className="flex-1 grid"
109
- {...props}
110
- >
111
- {children}
112
- </components.ValueContainer>
113
- )
114
- }
115
-
116
- const SingleValue = ({ children, ...props }: SingleValueProps) => {
117
- // @ts-ignore
118
- const { label, account, balance, cur } = props.data
119
- return (
120
- <components.SingleValue
121
- className="col-start-1 col-end-3 row-start-1 row-end-2"
122
- {...props}
123
- >
124
- <span className="block max-w-full text-[16px] truncate leading-[1.5]">
125
- {label} <span className="opacity-75 text-[14px] leading-[1.42]">{account}</span>
126
- </span>
127
- <span className="block mt-[8px] font-medium text-[24px] leading-[1.333]">
128
- {balance} {cur}
129
- </span>
130
- </components.SingleValue>
131
- )
132
- }
133
-
134
- const Menu = ({ children, ...props }: MenuProps) => {
135
- return (
136
- <components.Menu
137
- className="z-[1] absolute inset-x-0 bg-page shadow-md mt-[8px] rounded-md"
138
- {...props}
139
- >
140
- {children}
141
- </components.Menu>
142
- )
143
- }
144
-
145
- type SelectAccountCardProps<
146
- Option,
147
- IsMulti extends boolean = false,
148
- Group extends GroupBase<Option> = GroupBase<Option>
149
- > = Props<Option, IsMulti, Group>
150
-
151
- const SelectAccountCard = <
152
- Option,
153
- IsMulti extends boolean = false,
154
- Group extends GroupBase<Option> = GroupBase<Option>
155
- >(props: SelectAccountCardProps<Option, IsMulti, Group>) => {
156
- return (
157
- <Select
158
- isSearchable={false}
159
- components={{
160
- Control,
161
- Option,
162
- SingleValue,
163
- DropdownIndicator,
164
- IndicatorSeparator: () => null,
165
- Menu,
166
- ValueContainer,
167
- }}
168
- styles={colourStyles}
169
- unstyled={true}
170
- {...props}
171
- />
172
- )
173
- }
174
-
175
- export { SelectAccountCard }