@modul/mbui 0.0.13-beta-pv-53036-cf3bc48d → 0.0.13-beta-pv-53127-63b6a630
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/Base/Input/Base.d.ts +4 -0
- package/dist/Base/Input/Base.js +20 -0
- package/dist/Base/Input/Base.js.map +1 -0
- package/dist/Base/Input/Input.d.ts +4 -0
- package/dist/Base/Input/Input.js +18 -0
- package/dist/Base/Input/Input.js.map +1 -0
- package/dist/Base/Input/index.d.ts +2 -0
- package/dist/Base/Input/index.js +7 -0
- package/dist/Base/Input/index.js.map +1 -0
- package/dist/Base/Input/types.d.ts +9 -0
- package/dist/Base/Input/types.js +3 -0
- package/dist/Base/Input/types.js.map +1 -0
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Chip/Chip.d.ts +1 -1
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/{Alert/Alert.d.ts → Info/Info.d.ts} +4 -4
- package/dist/{Alert/Alert.js → Info/Info.js} +7 -7
- package/dist/Info/Info.js.map +1 -0
- package/dist/Info/index.d.ts +1 -0
- package/dist/Info/index.js +6 -0
- package/dist/Info/index.js.map +1 -0
- package/dist/Input/Input.js +1 -1
- package/dist/Input/Input.js.map +1 -1
- package/dist/Input/index.d.ts +0 -1
- package/dist/Input/index.js +1 -3
- package/dist/Input/index.js.map +1 -1
- package/dist/Input-OTP/Input.d.ts +4 -4
- package/dist/Page/Page.js +1 -1
- package/dist/Page/Page.js.map +1 -1
- package/dist/Progress/Progress.d.ts +4 -0
- package/dist/Progress/Progress.js +12 -0
- package/dist/Progress/Progress.js.map +1 -0
- package/dist/Progress/index.d.ts +1 -0
- package/dist/Progress/index.js +6 -0
- package/dist/Progress/index.js.map +1 -0
- package/dist/index.d.ts +20 -27
- package/dist/index.js +10 -41
- package/dist/index.js.map +1 -1
- package/package.json +4 -11
- package/src/Drawer/Drawer.tsx +2 -2
- package/src/DrawerCompanyList/CompanyList.tsx +63 -0
- package/src/DrawerCompanyList/index.ts +1 -0
- package/src/{Alert/Alert.tsx → Info/Info.tsx} +6 -6
- package/src/Info/index.ts +1 -0
- package/src/Input/Input.tsx +1 -1
- package/src/Input/index.ts +1 -2
- package/src/Label/Label.tsx +1 -1
- package/src/Page/Page.tsx +1 -1
- package/src/Progress/Progress.tsx +23 -0
- package/src/Progress/index.ts +1 -0
- package/src/assets/css/global.css +9 -22
- package/src/index.ts +41 -67
- package/dist/Alert/Alert.js.map +0 -1
- package/dist/Alert/index.d.ts +0 -1
- package/dist/Alert/index.js +0 -6
- package/dist/Alert/index.js.map +0 -1
- package/dist/AlertDialog/AlertDialog.d.ts +0 -20
- package/dist/AlertDialog/AlertDialog.js +0 -42
- package/dist/AlertDialog/AlertDialog.js.map +0 -1
- package/dist/AlertDialog/index.d.ts +0 -1
- package/dist/AlertDialog/index.js +0 -16
- package/dist/AlertDialog/index.js.map +0 -1
- package/dist/Calendar/Calendar.d.ts +0 -8
- package/dist/Calendar/Calendar.js +0 -45
- package/dist/Calendar/Calendar.js.map +0 -1
- package/dist/Calendar/index.d.ts +0 -1
- package/dist/Calendar/index.js +0 -6
- package/dist/Calendar/index.js.map +0 -1
- package/dist/DatePicker/DatePicker.d.ts +0 -9
- package/dist/DatePicker/DatePicker.js +0 -23
- package/dist/DatePicker/DatePicker.js.map +0 -1
- package/dist/DatePicker/index.d.ts +0 -1
- package/dist/DatePicker/index.js +0 -6
- package/dist/DatePicker/index.js.map +0 -1
- package/dist/Form/Form.d.ts +0 -23
- package/dist/Form/Form.js +0 -73
- package/dist/Form/Form.js.map +0 -1
- package/dist/Form/index.d.ts +0 -1
- package/dist/Form/index.js +0 -13
- package/dist/Form/index.js.map +0 -1
- package/dist/Input/InputMask.d.ts +0 -3
- package/dist/Input/InputMask.js +0 -12
- package/dist/Input/InputMask.js.map +0 -1
- package/dist/Label/Label.d.ts +0 -5
- package/dist/Label/Label.js +0 -13
- package/dist/Label/Label.js.map +0 -1
- package/dist/Label/index.d.ts +0 -1
- package/dist/Label/index.js +0 -6
- package/dist/Label/index.js.map +0 -1
- package/dist/Select/Select.d.ts +0 -3
- package/dist/Select/Select.js +0 -11
- package/dist/Select/Select.js.map +0 -1
- package/dist/Select/SelectAccountCard.d.ts +0 -4
- package/dist/Select/SelectAccountCard.js +0 -75
- package/dist/Select/SelectAccountCard.js.map +0 -1
- package/dist/Select/SelectAsync.d.ts +0 -8
- package/dist/Select/SelectAsync.js +0 -73
- package/dist/Select/SelectAsync.js.map +0 -1
- package/dist/Select/SelectBase.d.ts +0 -6
- package/dist/Select/SelectBase.js +0 -72
- package/dist/Select/SelectBase.js.map +0 -1
- package/dist/Select/index.d.ts +0 -4
- package/dist/Select/index.js +0 -12
- package/dist/Select/index.js.map +0 -1
- package/dist/Switch/Switch.d.ts +0 -4
- package/dist/Switch/Switch.js +0 -31
- package/dist/Switch/Switch.js.map +0 -1
- package/dist/Switch/index.d.ts +0 -1
- package/dist/Switch/index.js +0 -6
- package/dist/Switch/index.js.map +0 -1
- package/dist/Textarea/Textarea.d.ts +0 -5
- package/dist/Textarea/Textarea.js +0 -12
- package/dist/Textarea/Textarea.js.map +0 -1
- package/dist/Textarea/index.d.ts +0 -1
- package/dist/Textarea/index.js +0 -6
- package/dist/Textarea/index.js.map +0 -1
- package/src/Alert/index.ts +0 -1
- package/src/AlertDialog/AlertDialog.tsx +0 -138
- package/src/AlertDialog/index.ts +0 -13
- package/src/Calendar/Calendar.tsx +0 -61
- package/src/Calendar/index.ts +0 -1
- package/src/DatePicker/DatePicker.tsx +0 -38
- package/src/DatePicker/index.ts +0 -1
- package/src/Form/Form.tsx +0 -152
- package/src/Form/index.ts +0 -1
- package/src/Input/InputMask.tsx +0 -15
- package/src/Select/Select.tsx +0 -8
- package/src/Select/SelectAccountCard.tsx +0 -162
- package/src/Select/SelectAsync.tsx +0 -183
- package/src/Select/SelectBase.tsx +0 -181
- package/src/Select/index.ts +0 -4
- package/src/Switch/Switch.tsx +0 -47
- package/src/Switch/index.ts +0 -1
- package/src/Textarea/Textarea.tsx +0 -24
- package/src/Textarea/index.ts +0 -1
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
import { DropdownSmallOld, CheckSmall } from '../Icon'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
components,
|
|
7
|
-
ControlProps,
|
|
8
|
-
OptionProps,
|
|
9
|
-
DropdownIndicatorProps,
|
|
10
|
-
StylesConfig,
|
|
11
|
-
SingleValueProps,
|
|
12
|
-
MenuProps,
|
|
13
|
-
PlaceholderProps,
|
|
14
|
-
ValueContainerProps,
|
|
15
|
-
InputProps,
|
|
16
|
-
LoadingIndicatorProps,
|
|
17
|
-
IndicatorsContainerProps,
|
|
18
|
-
} from 'react-select'
|
|
19
|
-
|
|
20
|
-
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'
|
|
26
|
-
|
|
27
|
-
const colourStyles: StylesConfig = {
|
|
28
|
-
control: () => ({}),
|
|
29
|
-
option: () => ({}),
|
|
30
|
-
input: () => ({}),
|
|
31
|
-
dropdownIndicator: () => ({}),
|
|
32
|
-
indicatorsContainer: () => ({}),
|
|
33
|
-
menu: () => ({}),
|
|
34
|
-
menuList: () => ({}),
|
|
35
|
-
singleValue: () => ({}),
|
|
36
|
-
valueContainer: () => ({}),
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const Input = ({...props }: InputProps) => {
|
|
40
|
-
return <components.Input className='col-start-1 col-end-3 row-start-1 row-end-2' {...props} />
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const Control = ({ children, ...props }: ControlProps) => {
|
|
44
|
-
const { isFocused } = props
|
|
45
|
-
return (
|
|
46
|
-
<components.Control
|
|
47
|
-
className={cn(selectTriggerClasses, { 'outline outline-primary outline-offset-2 outline-2': isFocused })}
|
|
48
|
-
{...props}
|
|
49
|
-
>
|
|
50
|
-
{children}
|
|
51
|
-
</components.Control>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const optionClasses =
|
|
56
|
-
'flex items-center first:rounded-t-sm last:rounded-b-sm px-[16px] py-[12px] w-full cursor-default select-none outline-none'
|
|
57
|
-
|
|
58
|
-
const Option = ({ children, ...props }: OptionProps) => {
|
|
59
|
-
const {
|
|
60
|
-
isSelected,
|
|
61
|
-
isFocused,
|
|
62
|
-
isDisabled,
|
|
63
|
-
} = props
|
|
64
|
-
return (
|
|
65
|
-
<components.Option
|
|
66
|
-
className={cn(optionClasses, { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled })}
|
|
67
|
-
{...props}
|
|
68
|
-
>
|
|
69
|
-
<span className="flex basis-0 grow">{children}</span>
|
|
70
|
-
|
|
71
|
-
<span className="ml-[16px] w-[24px] h-[24px] shrink-0">
|
|
72
|
-
{isSelected && (
|
|
73
|
-
<CheckSmall
|
|
74
|
-
width="24"
|
|
75
|
-
height="24"
|
|
76
|
-
className="text-primary"
|
|
77
|
-
/>
|
|
78
|
-
)}
|
|
79
|
-
</span>
|
|
80
|
-
</components.Option>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const IndicatorsContainer = ({ children, ...props }: IndicatorsContainerProps) => {
|
|
85
|
-
return (
|
|
86
|
-
<components.IndicatorsContainer className='flex items-center gap-x-[8px] shrink-0' {...props}>
|
|
87
|
-
{children}
|
|
88
|
-
</components.IndicatorsContainer>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const LoadingIndicator = ({...props }: LoadingIndicatorProps) => {
|
|
93
|
-
return (
|
|
94
|
-
<components.LoadingIndicator
|
|
95
|
-
className='text-light shrink-0'
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const DropdownIndicator = ({ children, ...props }: DropdownIndicatorProps) => {
|
|
102
|
-
return (
|
|
103
|
-
<components.DropdownIndicator
|
|
104
|
-
className="shrink-0"
|
|
105
|
-
{...props}
|
|
106
|
-
>
|
|
107
|
-
<DropdownSmallOld
|
|
108
|
-
className="text-light"
|
|
109
|
-
width="12"
|
|
110
|
-
height="12"
|
|
111
|
-
/>
|
|
112
|
-
</components.DropdownIndicator>
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const ValueContainer = ({ children, ...props }: ValueContainerProps) => {
|
|
117
|
-
return (
|
|
118
|
-
<components.ValueContainer
|
|
119
|
-
className="flex-1 grid"
|
|
120
|
-
{...props}
|
|
121
|
-
>
|
|
122
|
-
{children}
|
|
123
|
-
</components.ValueContainer>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const SingleValue = ({ children, ...props }: SingleValueProps) => {
|
|
128
|
-
return (
|
|
129
|
-
<components.SingleValue
|
|
130
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2"
|
|
131
|
-
{...props}
|
|
132
|
-
>
|
|
133
|
-
{children}
|
|
134
|
-
</components.SingleValue>
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const Menu = ({ children, ...props }: MenuProps) => {
|
|
139
|
-
return (
|
|
140
|
-
<components.Menu
|
|
141
|
-
className="z-[1] absolute inset-x-0 bg-page shadow-sm mt-[8px] rounded-sm"
|
|
142
|
-
{...props}
|
|
143
|
-
>
|
|
144
|
-
{children}
|
|
145
|
-
</components.Menu>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const Placeholder = ({ children, ...props }: PlaceholderProps) => {
|
|
150
|
-
return (
|
|
151
|
-
<components.Placeholder
|
|
152
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2 text-[16px] text-light truncate"
|
|
153
|
-
{...props}
|
|
154
|
-
>
|
|
155
|
-
{children}
|
|
156
|
-
</components.Placeholder>
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const SelectAsync = ({ ...props }) => (
|
|
161
|
-
<AsyncSelect
|
|
162
|
-
components={{
|
|
163
|
-
Control,
|
|
164
|
-
Option,
|
|
165
|
-
SingleValue,
|
|
166
|
-
DropdownIndicator,
|
|
167
|
-
IndicatorSeparator: () => null,
|
|
168
|
-
Menu,
|
|
169
|
-
ValueContainer,
|
|
170
|
-
Placeholder,
|
|
171
|
-
Input,
|
|
172
|
-
LoadingIndicator,
|
|
173
|
-
IndicatorsContainer
|
|
174
|
-
}}
|
|
175
|
-
styles={colourStyles}
|
|
176
|
-
unstyled={true}
|
|
177
|
-
{...props}
|
|
178
|
-
/>
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
SelectAsync.displayName = 'SelectAsync'
|
|
182
|
-
|
|
183
|
-
export { SelectAsync }
|
|
@@ -1,181 +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
|
-
PlaceholderProps,
|
|
14
|
-
ValueContainerProps,
|
|
15
|
-
InputProps,
|
|
16
|
-
LoadingIndicatorProps,
|
|
17
|
-
IndicatorsContainerProps,
|
|
18
|
-
} from 'react-select'
|
|
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'
|
|
24
|
-
|
|
25
|
-
const colourStyles: StylesConfig = {
|
|
26
|
-
control: () => ({}),
|
|
27
|
-
option: () => ({}),
|
|
28
|
-
input: () => ({}),
|
|
29
|
-
dropdownIndicator: () => ({}),
|
|
30
|
-
indicatorsContainer: () => ({}),
|
|
31
|
-
menu: () => ({}),
|
|
32
|
-
menuList: () => ({}),
|
|
33
|
-
singleValue: () => ({}),
|
|
34
|
-
valueContainer: () => ({}),
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const Input = ({...props }: InputProps) => {
|
|
38
|
-
return <components.Input className='col-start-1 col-end-3 row-start-1 row-end-2' {...props} />
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const Control = ({ children, ...props }: ControlProps) => {
|
|
42
|
-
const { isFocused } = props
|
|
43
|
-
return (
|
|
44
|
-
<components.Control
|
|
45
|
-
className={cn(selectTriggerClasses, { 'outline outline-primary outline-offset-2 outline-2': isFocused })}
|
|
46
|
-
{...props}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
</components.Control>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const optionClasses =
|
|
54
|
-
'flex items-center first:rounded-t-sm last:rounded-b-sm px-[16px] py-[12px] w-full cursor-default select-none outline-none'
|
|
55
|
-
|
|
56
|
-
const Option = ({ children, ...props }: OptionProps) => {
|
|
57
|
-
const {
|
|
58
|
-
isSelected,
|
|
59
|
-
isFocused,
|
|
60
|
-
isDisabled,
|
|
61
|
-
} = props
|
|
62
|
-
return (
|
|
63
|
-
<components.Option
|
|
64
|
-
className={cn(optionClasses, { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled })}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
<span className="flex basis-0 grow">{children}</span>
|
|
68
|
-
|
|
69
|
-
<span className="ml-[16px] w-[24px] h-[24px] shrink-0">
|
|
70
|
-
{isSelected && (
|
|
71
|
-
<CheckSmall
|
|
72
|
-
width="24"
|
|
73
|
-
height="24"
|
|
74
|
-
className="text-primary"
|
|
75
|
-
/>
|
|
76
|
-
)}
|
|
77
|
-
</span>
|
|
78
|
-
</components.Option>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const IndicatorsContainer = ({ children, ...props }: IndicatorsContainerProps) => {
|
|
83
|
-
return (
|
|
84
|
-
<components.IndicatorsContainer className='flex items-center gap-x-[8px] shrink-0' {...props}>
|
|
85
|
-
{children}
|
|
86
|
-
</components.IndicatorsContainer>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const LoadingIndicator = ({...props }: LoadingIndicatorProps) => {
|
|
91
|
-
return (
|
|
92
|
-
<components.LoadingIndicator
|
|
93
|
-
className='text-light shrink-0'
|
|
94
|
-
{...props}
|
|
95
|
-
/>
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const DropdownIndicator = ({ children, ...props }: DropdownIndicatorProps) => {
|
|
100
|
-
return (
|
|
101
|
-
<components.DropdownIndicator
|
|
102
|
-
className="shrink-0"
|
|
103
|
-
{...props}
|
|
104
|
-
>
|
|
105
|
-
<DropdownSmallOld
|
|
106
|
-
className="text-light"
|
|
107
|
-
width="12"
|
|
108
|
-
height="12"
|
|
109
|
-
/>
|
|
110
|
-
</components.DropdownIndicator>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const ValueContainer = ({ children, ...props }: ValueContainerProps) => {
|
|
115
|
-
return (
|
|
116
|
-
<components.ValueContainer
|
|
117
|
-
className="flex-1 grid"
|
|
118
|
-
{...props}
|
|
119
|
-
>
|
|
120
|
-
{children}
|
|
121
|
-
</components.ValueContainer>
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const SingleValue = ({ children, ...props }: SingleValueProps) => {
|
|
126
|
-
return (
|
|
127
|
-
<components.SingleValue
|
|
128
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2"
|
|
129
|
-
{...props}
|
|
130
|
-
>
|
|
131
|
-
{children}
|
|
132
|
-
</components.SingleValue>
|
|
133
|
-
)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const Menu = ({ children, ...props }: MenuProps) => {
|
|
137
|
-
return (
|
|
138
|
-
<components.Menu
|
|
139
|
-
className="z-[1] absolute inset-x-0 bg-page shadow-sm mt-[8px] rounded-sm"
|
|
140
|
-
{...props}
|
|
141
|
-
>
|
|
142
|
-
{children}
|
|
143
|
-
</components.Menu>
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const Placeholder = ({ children, ...props }: PlaceholderProps) => {
|
|
148
|
-
return (
|
|
149
|
-
<components.Placeholder
|
|
150
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2 text-[16px] text-light truncate"
|
|
151
|
-
{...props}
|
|
152
|
-
>
|
|
153
|
-
{children}
|
|
154
|
-
</components.Placeholder>
|
|
155
|
-
)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const SelectBase = (props) => (
|
|
159
|
-
<Select
|
|
160
|
-
components={{
|
|
161
|
-
Control,
|
|
162
|
-
Option,
|
|
163
|
-
SingleValue,
|
|
164
|
-
DropdownIndicator,
|
|
165
|
-
IndicatorSeparator: () => null,
|
|
166
|
-
Menu,
|
|
167
|
-
ValueContainer,
|
|
168
|
-
Placeholder,
|
|
169
|
-
Input,
|
|
170
|
-
LoadingIndicator,
|
|
171
|
-
IndicatorsContainer
|
|
172
|
-
}}
|
|
173
|
-
styles={colourStyles}
|
|
174
|
-
unstyled={true}
|
|
175
|
-
{...props}
|
|
176
|
-
/>
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
SelectBase.displayName = 'SelectBase'
|
|
180
|
-
|
|
181
|
-
export { SelectBase }
|
package/src/Select/index.ts
DELETED
package/src/Switch/Switch.tsx
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from "react"
|
|
3
|
-
import * as SwitchPrimitives from "@radix-ui/react-switch"
|
|
4
|
-
|
|
5
|
-
import { cn } from "../@/lib/utils"
|
|
6
|
-
|
|
7
|
-
const rootClasses = `
|
|
8
|
-
inline-flex items-center bg-light
|
|
9
|
-
data-[state=checked]:bg-primary data-[state=unchecked]:bg-input
|
|
10
|
-
disabled:opacity-50 shadow-sm rounded-full
|
|
11
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
12
|
-
w-[32px] h-[18px]
|
|
13
|
-
transition-colors cursor-pointer
|
|
14
|
-
disabled:cursor-not-allowed peer shrink-0
|
|
15
|
-
focus-visible:outline-none
|
|
16
|
-
`
|
|
17
|
-
const ThumbClasses = `
|
|
18
|
-
border-2 border-input data-[state=checked]:border-primary
|
|
19
|
-
bg-page shadow-md rounded-full ring-0
|
|
20
|
-
w-[18px] h-[18px]
|
|
21
|
-
transition-transform
|
|
22
|
-
data-[state=checked]:translate-x-[14px] data-[state=unchecked]:translate-x-0
|
|
23
|
-
pointer-events-none
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
const Switch = React.forwardRef<
|
|
27
|
-
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
28
|
-
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
29
|
-
>(({ className, ...props }, ref) => (
|
|
30
|
-
<SwitchPrimitives.Root
|
|
31
|
-
className={cn(
|
|
32
|
-
rootClasses,
|
|
33
|
-
className
|
|
34
|
-
)}
|
|
35
|
-
{...props}
|
|
36
|
-
ref={ref}
|
|
37
|
-
>
|
|
38
|
-
<span className=""></span>
|
|
39
|
-
<SwitchPrimitives.Thumb
|
|
40
|
-
className={ThumbClasses}
|
|
41
|
-
/>
|
|
42
|
-
</SwitchPrimitives.Root>
|
|
43
|
-
))
|
|
44
|
-
|
|
45
|
-
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
46
|
-
|
|
47
|
-
export { Switch }
|
package/src/Switch/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Switch } from './Switch'
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "../@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export interface TextareaProps
|
|
6
|
-
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
7
|
-
|
|
8
|
-
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
9
|
-
({ className, ...props }, ref) => {
|
|
10
|
-
return (
|
|
11
|
-
<textarea
|
|
12
|
-
className={cn(
|
|
13
|
-
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 placeholder:text-light focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
-
className
|
|
15
|
-
)}
|
|
16
|
-
ref={ref}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
)
|
|
22
|
-
Textarea.displayName = "Textarea"
|
|
23
|
-
|
|
24
|
-
export { Textarea }
|
package/src/Textarea/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Textarea } from './Textarea'
|