@modul/mbui 0.0.11 → 0.0.12-beta-pv-53036-82db3f95
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.js +1 -1
- package/dist/Info/Info.js.map +1 -1
- package/dist/Input/Input.js +1 -1
- package/dist/Input/Input.js.map +1 -1
- package/package.json +2 -1
- package/src/@/config/index.ts +3 -1
- package/src/Info/Info.tsx +1 -1
- package/src/Input/Input.tsx +1 -1
- package/src/Select/SelectAccountCard.tsx +163 -0
- package/src/Select/index.ts +1 -0
- package/src/assets/css/global.css +6 -2
package/dist/Info/Info.js
CHANGED
|
@@ -6,7 +6,7 @@ const React = (0, tslib_1.__importStar)(require("react"));
|
|
|
6
6
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
7
7
|
const utils_1 = require("../@/lib/utils");
|
|
8
8
|
// import { cn } from "@/lib/utils" порешать с алиасами
|
|
9
|
-
const infoVariants = (0, class_variance_authority_1.cva)('px-[16px] py-[12px] rounded-
|
|
9
|
+
const infoVariants = (0, class_variance_authority_1.cva)('px-[16px] py-[12px] rounded-sm text-[14px]', {
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
light: 'bg-[--cl-graphite-7]',
|
package/dist/Info/Info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Info.js","sourceRoot":"","sources":["../../src/Info/Info.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,uEAAiE;AAEjE,0CAAmC;AACnC,uDAAuD;AAEvD,MAAM,YAAY,GAAG,IAAA,8BAAG,EAAC,
|
|
1
|
+
{"version":3,"file":"Info.js","sourceRoot":"","sources":["../../src/Info/Info.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,uEAAiE;AAEjE,0CAAmC;AACnC,uDAAuD;AAEvD,MAAM,YAAY,GAAG,IAAA,8BAAG,EAAC,4CAA4C,EAAE;IACtE,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,kBAAkB;YAC3B,QAAQ,EAAE,wBAAwB;SAClC;KACD;IACD,eAAe,EAAE;QAChB,OAAO,EAAE,OAAO;KAChB;CACD,CAAC,CAAA;AAMF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAyB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzG,OAAO,CACN,6BACC,SAAS,EAAE,IAAA,UAAE,EAAC,YAAY,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,KAC/C,KAAK,IAER,QAAQ,CACJ,CACN,CAAA;AACF,CAAC,CAAC,CAAA;AAIO,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA"}
|
package/dist/Input/Input.js
CHANGED
|
@@ -10,7 +10,7 @@ const InputLabel = React.forwardRef(({ className, children, ...props }) => {
|
|
|
10
10
|
exports.InputLabel = InputLabel;
|
|
11
11
|
InputLabel.displayName = 'InputLabel';
|
|
12
12
|
const InputField = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
13
|
-
return (React.createElement("input", { type: type, className: (0, utils_1.cn)('border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-
|
|
13
|
+
return (React.createElement("input", { type: type, className: (0, utils_1.cn)('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', className), ref: ref, ...props }));
|
|
14
14
|
});
|
|
15
15
|
exports.InputField = InputField;
|
|
16
16
|
InputField.displayName = 'InputField';
|
package/dist/Input/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,0CAAmC;AAEnC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACrC,OAAO,CACN,+BACC,SAAS,EAAE,IAAA,UAAE,EAAC,0GAA0G,EAAE,SAAS,CAAC,KAChI,KAAK,IAER,QAAQ,CACF,CACR,CAAA;AACF,CAAC,CACD,CAAA;AAoBoB,gCAAU;AAlB/B,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAgE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzI,OAAO,CACN,+BACC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAA,UAAE,EACZ,
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,0CAAmC;AAEnC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACrC,OAAO,CACN,+BACC,SAAS,EAAE,IAAA,UAAE,EAAC,0GAA0G,EAAE,SAAS,CAAC,KAChI,KAAK,IAER,QAAQ,CACF,CACR,CAAA;AACF,CAAC,CACD,CAAA;AAoBoB,gCAAU;AAlB/B,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAgE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzI,OAAO,CACN,+BACC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAA,UAAE,EACZ,sUAAsU,EACtU,SAAS,CACT,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAC,CAAA;AAIO,gCAAU;AAFnB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modul/mbui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12-beta-pv-53036-82db3f95",
|
|
4
4
|
"packageManager": "yarn@3.5.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"lodash": "4.17.5",
|
|
40
40
|
"react-datepicker": "4.16.0",
|
|
41
41
|
"react-imask": "7.1.3",
|
|
42
|
+
"react-select": "5.8.0",
|
|
42
43
|
"tailwind-merge": "^2.3.0",
|
|
43
44
|
"tailwindcss": "^3.4.4",
|
|
44
45
|
"tailwindcss-animate": "^1.0.7",
|
package/src/@/config/index.ts
CHANGED
|
@@ -43,6 +43,7 @@ export default {
|
|
|
43
43
|
},
|
|
44
44
|
backgroundColor: {
|
|
45
45
|
page: 'var(--page-bg)',
|
|
46
|
+
light: 'var(--bg-light)',
|
|
46
47
|
...button.backgroundColor,
|
|
47
48
|
...label.backgroundColor
|
|
48
49
|
},
|
|
@@ -57,7 +58,8 @@ export default {
|
|
|
57
58
|
...button.borderColor
|
|
58
59
|
},
|
|
59
60
|
borderRadius: {
|
|
60
|
-
'
|
|
61
|
+
'sm': 'var(--border-radius-sm)',
|
|
62
|
+
'md': 'var(--border-radius-md)',
|
|
61
63
|
},
|
|
62
64
|
keyframes: {
|
|
63
65
|
'accordion-down': {
|
package/src/Info/Info.tsx
CHANGED
|
@@ -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 infoVariants = cva('px-[16px] py-[12px] rounded-
|
|
7
|
+
const infoVariants = cva('px-[16px] py-[12px] rounded-sm text-[14px]', {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
light: 'bg-[--cl-graphite-7]',
|
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
|
+
'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,163 @@
|
|
|
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
|
+
} from 'react-select'
|
|
15
|
+
|
|
16
|
+
import { cn } from '../@/lib/utils'
|
|
17
|
+
|
|
18
|
+
const selectTriggerClasses: string =
|
|
19
|
+
'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'
|
|
20
|
+
|
|
21
|
+
const colourStyles: StylesConfig = {
|
|
22
|
+
control: () => ({}),
|
|
23
|
+
option: () => ({}),
|
|
24
|
+
input: () => ({}),
|
|
25
|
+
dropdownIndicator: () => ({}),
|
|
26
|
+
indicatorsContainer: () => ({}),
|
|
27
|
+
menu: () => ({}),
|
|
28
|
+
menuList: () => ({}),
|
|
29
|
+
singleValue: () => ({}),
|
|
30
|
+
valueContainer: () => ({}),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const Control = ({ children, ...props }: ControlProps) => {
|
|
34
|
+
const style = { cursor: 'pointer' }
|
|
35
|
+
return (
|
|
36
|
+
<components.Control
|
|
37
|
+
className={selectTriggerClasses}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</components.Control>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const optionClasses =
|
|
46
|
+
'flex items-center first:rounded-t-md last:rounded-b-md px-[12px] py-[16px] w-full cursor-default select-none outline-none'
|
|
47
|
+
|
|
48
|
+
const Option = ({ children, ...props }: OptionProps) => {
|
|
49
|
+
console.log({ ...props })
|
|
50
|
+
const {
|
|
51
|
+
isSelected,
|
|
52
|
+
isFocused,
|
|
53
|
+
isDisabled,
|
|
54
|
+
data : { label, account, balance, cur },
|
|
55
|
+
} = props
|
|
56
|
+
const style = { cursor: 'pointer' }
|
|
57
|
+
return (
|
|
58
|
+
<components.Option
|
|
59
|
+
className={cn(
|
|
60
|
+
optionClasses,
|
|
61
|
+
{ 'bg-light': isFocused },
|
|
62
|
+
{ 'opacity-50 pointer-events-none': isDisabled }
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
<span className="flex basis-0 grow">
|
|
67
|
+
<span>
|
|
68
|
+
<span>{label}</span><br/>
|
|
69
|
+
<span className='text-[14px] text-light'>{account}</span>
|
|
70
|
+
</span>
|
|
71
|
+
<span className='ml-auto shrink-0'>
|
|
72
|
+
{balance} {cur}
|
|
73
|
+
</span>
|
|
74
|
+
</span>
|
|
75
|
+
|
|
76
|
+
<span className='ml-[16px] w-[24px] h-[24px] shrink-0'>
|
|
77
|
+
{isSelected && (
|
|
78
|
+
<CheckSmall
|
|
79
|
+
width="24"
|
|
80
|
+
height="24"
|
|
81
|
+
className="text-primary"
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
</span>
|
|
85
|
+
|
|
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 className='col-start-1 col-end-3 row-start-1 row-end-2' {...props}>
|
|
121
|
+
<span className="block max-w-full text-[16px] truncate leading-[1.5]">
|
|
122
|
+
{label} <span className="opacity-75 text-[14px] leading-[1.42]">{account}</span>
|
|
123
|
+
</span>
|
|
124
|
+
<span className="block mt-[8px] font-medium text-[24px] leading-[1.333]">
|
|
125
|
+
{balance} {cur}
|
|
126
|
+
</span>
|
|
127
|
+
</components.SingleValue>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const Menu = ({ children, ...props }: MenuProps) => {
|
|
132
|
+
return (
|
|
133
|
+
<components.Menu
|
|
134
|
+
className="bg-page drop-shadow-1 mt-[8px] rounded-md"
|
|
135
|
+
{...props}
|
|
136
|
+
>
|
|
137
|
+
{children}
|
|
138
|
+
</components.Menu>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const SelectAccountCard = React.forwardRef<Select, { className: string | undefined }>(({ className, ...props }, ref) => (
|
|
143
|
+
<Select
|
|
144
|
+
className={cn(className)}
|
|
145
|
+
classNamePrefix="super"
|
|
146
|
+
isDisabled={false}
|
|
147
|
+
isSearchable={false}
|
|
148
|
+
components={{
|
|
149
|
+
Control,
|
|
150
|
+
Option,
|
|
151
|
+
SingleValue,
|
|
152
|
+
DropdownIndicator,
|
|
153
|
+
IndicatorSeparator: () => null,
|
|
154
|
+
Menu,
|
|
155
|
+
ValueContainer,
|
|
156
|
+
}}
|
|
157
|
+
styles={colourStyles}
|
|
158
|
+
unstyled={true}
|
|
159
|
+
{...props}
|
|
160
|
+
/>
|
|
161
|
+
))
|
|
162
|
+
|
|
163
|
+
export { SelectAccountCard }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectAccountCard } from './SelectAccountCard'
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
--cl-red-6: #f9c1bd;
|
|
74
74
|
--cl-red-7: #ffe9e9;
|
|
75
75
|
|
|
76
|
-
--
|
|
76
|
+
--base: var(--cl-graphite-1);
|
|
77
77
|
--primary: var(--cl-blue-2);
|
|
78
78
|
--primary-light: var(--cl-blue-7);
|
|
79
79
|
--success: var(--cl-green-3);
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
--light: var(--cl-graphite-3);
|
|
82
82
|
--dark: var(--cl-graphite-2);
|
|
83
83
|
--disabled: var(--cl-graphite-4);
|
|
84
|
+
--bg-light: var(--cl-graphite-7);
|
|
84
85
|
--warning: var(--cl-yellow-2);
|
|
85
86
|
--warning-light: var(--cl-yellow-7);
|
|
86
87
|
--critical: var(--cl-red-4);
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
|
|
90
91
|
--page-bg: var(--cl-white);
|
|
91
92
|
|
|
93
|
+
|
|
92
94
|
/* ЦВЕТ КНОПОК */
|
|
93
95
|
/* =========================================== */
|
|
94
96
|
--btn-primary: var(--cl-white);
|
|
@@ -130,6 +132,7 @@
|
|
|
130
132
|
|
|
131
133
|
/* ЦВЕТ ПОЛЯ ВВОДА */
|
|
132
134
|
/* =========================================== */
|
|
135
|
+
|
|
133
136
|
|
|
134
137
|
/* =========================================== */
|
|
135
138
|
/* ЦВЕТ ПОЛЯ ВВОДА */
|
|
@@ -138,7 +141,8 @@
|
|
|
138
141
|
/* BORDER */
|
|
139
142
|
/* =========================================== */
|
|
140
143
|
--border-color: var(--cl-graphite-5);
|
|
141
|
-
--border-radius-
|
|
144
|
+
--border-radius-sm: 4px;
|
|
145
|
+
--border-radius-md: 8px;
|
|
142
146
|
/* =========================================== */
|
|
143
147
|
/* BORDER */
|
|
144
148
|
|