cynx-ui 1.2.28 → 1.2.30
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.
|
@@ -75,7 +75,7 @@ export function ActionsMenu({ items, align = 'right' }) {
|
|
|
75
75
|
type="button"
|
|
76
76
|
onClick={toggle}
|
|
77
77
|
style={{
|
|
78
|
-
width:
|
|
78
|
+
width: 32, height: 32, borderRadius: 'var(--rads,8px)',
|
|
79
79
|
border: isOpen ? '1px solid var(--accent,#f99e2c)' : '1px solid var(--border-light,#d7d8e0)',
|
|
80
80
|
background: 'var(--surface,#fff)',
|
|
81
81
|
cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center',
|
package/components/Button.jsx
CHANGED
|
@@ -80,21 +80,10 @@ const VARIANTS = {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const SIZES = {
|
|
83
|
-
xs: { padding: '4px 8px', fontSize: 12, height:
|
|
83
|
+
xs: { padding: '4px 8px', fontSize: 12, height: 32 },
|
|
84
84
|
sm: { padding: '4px 8px', fontSize: 12, height: 32 },
|
|
85
|
-
md: { padding: '8px 16px', fontSize: 13, height:
|
|
86
|
-
lg: { padding: '10px 20px', fontSize: 14, height:
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const ICON_STYLE = {
|
|
90
|
-
padding: 0,
|
|
91
|
-
width: 30,
|
|
92
|
-
height: 30,
|
|
93
|
-
borderRadius: 'var(--rads,8px)',
|
|
94
|
-
display: 'inline-flex',
|
|
95
|
-
alignItems: 'center',
|
|
96
|
-
justifyContent: 'center',
|
|
97
|
-
lineHeight: 0,
|
|
85
|
+
md: { padding: '8px 16px', fontSize: 13, height: 32 },
|
|
86
|
+
lg: { padding: '10px 20px', fontSize: 14, height: 32 },
|
|
98
87
|
};
|
|
99
88
|
|
|
100
89
|
export default function Button({
|
|
@@ -141,8 +130,8 @@ export default function Button({
|
|
|
141
130
|
border: v.border,
|
|
142
131
|
padding: isIconOnly ? 0 : s.padding,
|
|
143
132
|
fontSize: s.fontSize,
|
|
144
|
-
height:
|
|
145
|
-
width: isIconOnly ?
|
|
133
|
+
height: s.height,
|
|
134
|
+
width: isIconOnly ? s.height : undefined,
|
|
146
135
|
...(v.paddingLeft !== undefined && { paddingLeft: v.paddingLeft }),
|
|
147
136
|
...(v.paddingRight !== undefined && { paddingRight: v.paddingRight }),
|
|
148
137
|
...(v.boxShadow !== undefined && { boxShadow: v.boxShadow }),
|
package/components/Input.jsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useRef, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
const SIZES = {
|
|
4
|
-
xs: { height:
|
|
4
|
+
xs: { height: 32, fontSize: 11, paddingH: 8 },
|
|
5
5
|
sm: { height: 32, fontSize: 12, paddingH: 9 },
|
|
6
|
-
md: { height:
|
|
7
|
-
lg: { height:
|
|
6
|
+
md: { height: 32, fontSize: 13, paddingH: 11 },
|
|
7
|
+
lg: { height: 32, fontSize: 14, paddingH: 14 },
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export default function Input({
|
|
@@ -17,6 +17,7 @@ export default function Input({
|
|
|
17
17
|
iconRight,
|
|
18
18
|
clearable = false,
|
|
19
19
|
suffix,
|
|
20
|
+
multiline = false,
|
|
20
21
|
onClear,
|
|
21
22
|
className = '',
|
|
22
23
|
style = {},
|
|
@@ -36,8 +37,8 @@ export default function Input({
|
|
|
36
37
|
|
|
37
38
|
const hasIconLeft = !!icon;
|
|
38
39
|
const hasIconRight = !!iconRight;
|
|
39
|
-
const showClear = clearable && !!value && !props.disabled;
|
|
40
|
-
const hasSuffix = !!suffix;
|
|
40
|
+
const showClear = clearable && !!value && !props.disabled && !multiline;
|
|
41
|
+
const hasSuffix = !!suffix && !multiline;
|
|
41
42
|
const showRightSlot = showClear || hasSuffix;
|
|
42
43
|
|
|
43
44
|
return (
|
|
@@ -95,6 +96,45 @@ export default function Input({
|
|
|
95
96
|
</span>
|
|
96
97
|
)}
|
|
97
98
|
|
|
99
|
+
{multiline ? (
|
|
100
|
+
<textarea
|
|
101
|
+
ref={inputRef}
|
|
102
|
+
className={className}
|
|
103
|
+
style={{
|
|
104
|
+
display: 'block',
|
|
105
|
+
width: '100%',
|
|
106
|
+
minHeight: 70,
|
|
107
|
+
resize: 'vertical',
|
|
108
|
+
whiteSpace: 'pre-wrap',
|
|
109
|
+
overflowWrap: 'break-word',
|
|
110
|
+
background: props.disabled ? 'var(--grey-1,#f5f5f8)' : 'var(--input-bg,#fff)',
|
|
111
|
+
border: `1px solid ${error ? 'var(--danger,#f64747)' : focused ? 'var(--accent,#f99e2c)' : hovered ? 'var(--accent,#f99e2c)' : 'var(--bd,#d7d8e0)'}`,
|
|
112
|
+
borderRadius: 'var(--rads,8px)',
|
|
113
|
+
color: 'var(--t1,#1a1a2e)',
|
|
114
|
+
fontFamily: 'var(--f,var(--sans,inherit))',
|
|
115
|
+
fontSize: s.fontSize,
|
|
116
|
+
padding: 0,
|
|
117
|
+
paddingTop: 8,
|
|
118
|
+
paddingBottom: 8,
|
|
119
|
+
paddingLeft: hasIconLeft ? 34 : 12,
|
|
120
|
+
paddingRight: (hasIconRight || showRightSlot) ? 34 : 12,
|
|
121
|
+
outline: 'none',
|
|
122
|
+
transition: 'border-color .14s, box-shadow .14s',
|
|
123
|
+
boxShadow: error
|
|
124
|
+
? 'var(--dd, rgba(246,71,71,.12)), var(--shadow,0 1px 3px rgba(20,22,41,.1))'
|
|
125
|
+
: focused
|
|
126
|
+
? 'var(--pd, rgba(249,158,44,.12)), var(--shadow,0 1px 3px rgba(20,22,41,.1))'
|
|
127
|
+
: 'var(--shadow,0 1px 3px rgba(20,22,41,.1))',
|
|
128
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
129
|
+
cursor: props.disabled ? 'not-allowed' : undefined,
|
|
130
|
+
...style,
|
|
131
|
+
}}
|
|
132
|
+
value={value}
|
|
133
|
+
{...props}
|
|
134
|
+
onFocus={e => { setFocused(true); props.onFocus?.(e); }}
|
|
135
|
+
onBlur={e => { setFocused(false); setHovered(false); props.onBlur?.(e); }}
|
|
136
|
+
/>
|
|
137
|
+
) : (
|
|
98
138
|
<input
|
|
99
139
|
ref={inputRef}
|
|
100
140
|
className={className}
|
|
@@ -129,6 +169,7 @@ export default function Input({
|
|
|
129
169
|
// onMouseEnter={() => setHovered(true)}
|
|
130
170
|
// onMouseLeave={() => setHovered(false)}
|
|
131
171
|
/>
|
|
172
|
+
)}
|
|
132
173
|
|
|
133
174
|
{showClear && (
|
|
134
175
|
<button
|
|
@@ -128,7 +128,7 @@ export default function MultiSelect({ value = [], onChange, options = [], placeh
|
|
|
128
128
|
<div ref={btnRef} style={{ position: 'relative' }}>
|
|
129
129
|
<button type="button" onClick={toggleOpen} style={{
|
|
130
130
|
display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 6,
|
|
131
|
-
width: '100%', padding: '6px 10px', minHeight:
|
|
131
|
+
width: '100%', padding: '6px 10px', minHeight: 32,
|
|
132
132
|
border: `1px solid ${open ? 'var(--accent)' : 'var(--border)'}`,
|
|
133
133
|
borderRadius: 'var(--rads)',
|
|
134
134
|
background: 'var(--surface)',
|
package/components/Select.jsx
CHANGED
|
@@ -128,7 +128,7 @@ export default function Select({
|
|
|
128
128
|
justifyContent: 'space-between',
|
|
129
129
|
gap: 8,
|
|
130
130
|
padding: '8px 11px',
|
|
131
|
-
height:
|
|
131
|
+
height: 32,
|
|
132
132
|
background: 'var(--sf,var(--surface))',
|
|
133
133
|
border: `1.5px solid ${open ? 'var(--accent)' : 'var(--bd2,var(--border))'}`,
|
|
134
134
|
borderRadius: 'var(--rmd,var(--rads))',
|
|
@@ -219,7 +219,7 @@ export default function Select({
|
|
|
219
219
|
style={{
|
|
220
220
|
width: '100%',
|
|
221
221
|
padding: '7px 10px',
|
|
222
|
-
height:
|
|
222
|
+
height: 32,
|
|
223
223
|
background: 'var(--sf2,var(--grey-1))',
|
|
224
224
|
border: '1.5px solid var(--bd2,var(--border))',
|
|
225
225
|
borderRadius: 'var(--rmd,var(--rads))',
|
package/components/TabBar.jsx
CHANGED
|
@@ -69,7 +69,8 @@ export default function TabBar({ tabs, active, onChange, capitalize = false, pad
|
|
|
69
69
|
onClick={() => onChange(t.id)}
|
|
70
70
|
style={{
|
|
71
71
|
display: 'flex', alignItems: 'center', gap: 5,
|
|
72
|
-
|
|
72
|
+
height: 24,
|
|
73
|
+
padding: padding || '0 12px',
|
|
73
74
|
border: 'none',
|
|
74
75
|
borderRadius: 'var(--radxs, 6px)',
|
|
75
76
|
background: isActive ? 'var(--surface,#fff)' : 'transparent',
|