@vev/silke 1.0.19 → 1.0.21
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/CHANGELOG.md +20 -0
- package/dist/{chunk-FIPWO3IB.js → chunk-PP74IZDW.js} +2 -2
- package/dist/{chunk-FIPWO3IB.js.map → chunk-PP74IZDW.js.map} +2 -2
- package/dist/index.js +20 -20
- package/dist/index.js.map +4 -4
- package/dist/silke/src/components/silke-box/silke-box.d.ts +1 -2
- package/dist/silke/src/components/silke-card/silke-card.d.ts +2 -0
- package/dist/silke/src/components/silke-form-schema/fields/number-field.d.ts +3 -1
- package/dist/silke/src/components/silke-form-schema/silke-schema-field.d.ts +2 -2
- package/dist/silke/src/components/silke-tabs/silke-tab.d.ts +4 -7
- package/dist/silke/src/components/silke-tabs/silke-tabs.d.ts +4 -6
- package/dist/silke/src/components/silke-text-field/silke-text-field-outline.d.ts +1 -2
- package/dist/silke/src/components/silke-tooltip/silke-shortcuts.d.ts +1 -1
- package/dist/silke/src/components/silke-upload-field/silke-upload-field.d.ts +1 -0
- package/dist/silke/src/icons.d.ts +3 -0
- package/dist/{silke-code-editor-HB2Z4Q5W.js → silke-code-editor-4TSQ5KJ3.js} +12 -12
- package/dist/silke-code-editor-4TSQ5KJ3.js.map +7 -0
- package/dist/styles.css +330 -356
- package/dist/utils/src/interactions/get-interaction-map.d.ts +3 -0
- package/dist/utils/src/interactions/index.d.ts +2 -0
- package/dist/utils/src/interactions/interaction-map-to-array.d.ts +2 -0
- package/dist/utils/src/types/context.d.ts +1 -1
- package/dist/utils/src/types/index.d.ts +1 -0
- package/dist/utils/src/types/interaction.d.ts +15 -4
- package/dist/utils/src/types/oauth.d.ts +13 -0
- package/dist/utils/src/types/vev-plugin.d.ts +39 -8
- package/package.json +5 -4
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +1 -0
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +22 -9
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +12 -10
- package/src/components/silke-box/silke-box.mdx +2 -2
- package/src/components/silke-box/silke-box.scss +2 -1
- package/src/components/silke-box/silke-box.tsx +1 -2
- package/src/components/silke-button/silke-button.scss +2 -2
- package/src/components/silke-card/silke-card-grid.tsx +1 -3
- package/src/components/silke-card/silke-card.scss +28 -3
- package/src/components/silke-card/silke-card.tsx +27 -9
- package/src/components/silke-code-snippet/silke-code-snippet.tsx +2 -2
- package/src/components/silke-form-schema/fields/image-field.tsx +4 -2
- package/src/components/silke-form-schema/fields/link-field.tsx +2 -6
- package/src/components/silke-form-schema/fields/number-field.tsx +47 -43
- package/src/components/silke-form-schema/fields/object-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/select-field.tsx +37 -49
- package/src/components/silke-form-schema/fields/string-field.tsx +13 -28
- package/src/components/silke-form-schema/fields/toggle-field.tsx +8 -10
- package/src/components/silke-form-schema/silke-form-schema.mdx +14 -26
- package/src/components/silke-form-schema/silke-form-schema.tsx +4 -1
- package/src/components/silke-form-schema/silke-schema-field.tsx +8 -8
- package/src/components/silke-form-schema/silke-schema-fields.tsx +2 -2
- package/src/components/silke-icon-picker/silke-icon-picker.tsx +1 -1
- package/src/components/silke-list-card/silke-list-card.tsx +0 -2
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +1 -1
- package/src/components/silke-tabs/silke-tab.tsx +17 -50
- package/src/components/silke-tabs/silke-tabs.mdx +4 -16
- package/src/components/silke-tabs/silke-tabs.scss +24 -81
- package/src/components/silke-tabs/silke-tabs.tsx +12 -10
- package/src/components/silke-tag/silke-tag.mdx +78 -24
- package/src/components/silke-tag/silke-tag.scss +4 -1
- package/src/components/silke-text/silke-title.scss +0 -2
- package/src/components/silke-text-field/silke-text-field-outline.tsx +28 -16
- package/src/components/silke-text-field/silke-text-field.mdx +12 -0
- package/src/components/silke-text-field/silke-text-field.scss +8 -1
- package/src/components/silke-text-field/silke-text-field.tsx +2 -2
- package/src/components/silke-upload-field/silke-upload-field.tsx +5 -1
- package/src/icons.tsx +9 -19
- package/src/styles/core.scss +6 -0
- package/dist/silke-code-editor-HB2Z4Q5W.js.map +0 -7
- package/dist/utils/src/keyboard/key-list.d.ts +0 -4
- /package/dist/{chunk-FIPWO3IB.js.LEGAL.txt → chunk-PP74IZDW.js.LEGAL.txt} +0 -0
- /package/dist/{silke-code-editor-HB2Z4Q5W.js.LEGAL.txt → silke-code-editor-4TSQ5KJ3.js.LEGAL.txt} +0 -0
|
@@ -1,94 +1,37 @@
|
|
|
1
|
-
@use '../../variables' as *;
|
|
2
|
-
$tab-height: $size-m;
|
|
3
|
-
|
|
4
1
|
.tabs {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
white-space: nowrap;
|
|
12
|
-
min-height: $size-m;
|
|
13
|
-
align-items: center;
|
|
14
|
-
display: flex;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tab:focus {
|
|
18
|
-
outline: none;
|
|
19
|
-
box-shadow: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.tab:focus-visible:after {
|
|
23
|
-
content: "";
|
|
24
|
-
position: absolute;
|
|
25
|
-
left: 0;
|
|
26
|
-
right: 0;
|
|
27
|
-
top: 2px;
|
|
28
|
-
bottom: 2px;
|
|
29
|
-
display: block;
|
|
30
|
-
border: 2px solid var(--color-neutral-100);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.tabs.standard {
|
|
34
|
-
a.tab {
|
|
35
|
-
justify-content: center;
|
|
36
|
-
min-width: 110px;
|
|
37
|
-
padding: 8px 16px 6px;
|
|
38
|
-
color: var(--color-neutral-100);
|
|
39
|
-
border-bottom: 1px rgba(var(--color-neutral-100-rgb), var(--opacity-level-light)) solid;
|
|
40
|
-
margin-right: 1px;
|
|
41
|
-
margin-bottom:-1px;
|
|
42
|
-
position: relative;
|
|
2
|
+
&:not(.s) {
|
|
3
|
+
.tab {
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
height: 32px;
|
|
6
|
+
}
|
|
43
7
|
}
|
|
44
8
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
border-bottom: 2px var(--color-accent-30) solid;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.tab[disabled],
|
|
55
|
-
.tab[disabled]:hover {
|
|
56
|
-
color: var(--color-neutral-30);
|
|
57
|
-
border-bottom-color: var(--color-neutral-5);
|
|
9
|
+
&.s{
|
|
10
|
+
.tab {
|
|
11
|
+
height: 24px;
|
|
12
|
+
font-size:12px;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
}
|
|
58
15
|
}
|
|
59
16
|
}
|
|
17
|
+
.tab {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
height:32px;
|
|
20
|
+
border: none;
|
|
21
|
+
outline: none;
|
|
22
|
+
color: var(--color-neutral-70);
|
|
60
23
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
padding: 6px 50px 8px 16px;
|
|
65
|
-
color: var(--color-neutral-100);
|
|
66
|
-
position: relative;
|
|
67
|
-
border-top: 2px solid transparent;
|
|
24
|
+
&:disabled {
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
color: var(--color-neutral-40);
|
|
68
27
|
}
|
|
69
28
|
|
|
70
|
-
|
|
71
|
-
background: var(--color-
|
|
29
|
+
&.active {
|
|
30
|
+
background: var(--color-surface-3);
|
|
72
31
|
color: var(--color-neutral-100);
|
|
73
|
-
text-decoration: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.tab:focus {
|
|
77
|
-
outline: none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.tab[disabled],
|
|
81
|
-
.tab[disabled]:hover {
|
|
82
|
-
color: var(--color-neutral-30);
|
|
83
|
-
background: transparent;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
a.tab--active {
|
|
87
|
-
border-top-color: var(--color-accent-30);
|
|
88
|
-
color: var(--color-neutral-80);
|
|
89
32
|
}
|
|
90
33
|
|
|
91
|
-
.
|
|
92
|
-
background: var(--color-
|
|
34
|
+
&:hover:not(.active):not(:disabled) {
|
|
35
|
+
background: var(--color-surface-2);
|
|
93
36
|
}
|
|
94
37
|
}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import classnames from 'classnames/bind';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { BoxProps, SilkeBox } from '../silke-box';
|
|
2
|
+
import { BoxDivProps, BoxSize, BoxSpace, SilkeBox } from '../silke-box';
|
|
5
3
|
import styles from './silke-tabs.scss';
|
|
6
4
|
|
|
7
|
-
const cl = classnames.bind(styles);
|
|
8
|
-
|
|
9
5
|
type TabsProps = {
|
|
10
|
-
|
|
11
|
-
bg?: SilkeColor;
|
|
6
|
+
size?: 's' | 'base';
|
|
12
7
|
children: React.ReactNode;
|
|
13
|
-
} &
|
|
8
|
+
} & Omit<BoxDivProps, 'size' | 'height' | 'width'>;
|
|
14
9
|
|
|
15
|
-
export function SilkeTabs({
|
|
10
|
+
export function SilkeTabs({ children, size, className, ...rest }: TabsProps) {
|
|
11
|
+
let gap: BoxSpace = 'm';
|
|
12
|
+
let cl = styles.tabs;
|
|
13
|
+
if (size === 's') {
|
|
14
|
+
cl += ' ' + styles.s;
|
|
15
|
+
gap = 's';
|
|
16
|
+
}
|
|
17
|
+
if (className) cl += ' ' + className;
|
|
16
18
|
return (
|
|
17
|
-
<SilkeBox className={cl
|
|
19
|
+
<SilkeBox className={cl} gap={gap} {...rest}>
|
|
18
20
|
{children}
|
|
19
21
|
</SilkeBox>
|
|
20
22
|
);
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
```js
|
|
2
2
|
<SilkeBox column gap>
|
|
3
|
-
{[
|
|
3
|
+
{[
|
|
4
|
+
"sand",
|
|
5
|
+
"yellow",
|
|
6
|
+
"green",
|
|
7
|
+
"red",
|
|
8
|
+
"gray",
|
|
9
|
+
"blue",
|
|
10
|
+
"brandYellow",
|
|
11
|
+
"dark",
|
|
12
|
+
].map((color) => (
|
|
4
13
|
<SilkeBox gap key={color}>
|
|
5
14
|
<SilkeTag color={color} label={color} />
|
|
6
15
|
<SilkeTag color={color} label={ipsum.name()} onRemove={() => {}} />
|
|
7
16
|
<SilkeTag color={color} label={ipsum.name(10)} onRemove={() => {}} />
|
|
8
|
-
<SilkeTag color={color} label="Disabled" disabled/>
|
|
17
|
+
<SilkeTag color={color} label="Disabled" disabled />
|
|
9
18
|
</SilkeBox>
|
|
10
19
|
))}
|
|
11
20
|
</SilkeBox>
|
|
@@ -15,7 +24,16 @@
|
|
|
15
24
|
|
|
16
25
|
```js
|
|
17
26
|
<SilkeBox gap>
|
|
18
|
-
{[
|
|
27
|
+
{[
|
|
28
|
+
"sand",
|
|
29
|
+
"yellow",
|
|
30
|
+
"green",
|
|
31
|
+
"red",
|
|
32
|
+
"gray",
|
|
33
|
+
"blue",
|
|
34
|
+
"brandYellow",
|
|
35
|
+
"dark",
|
|
36
|
+
].map((color) => (
|
|
19
37
|
<SilkeBox gap key={color} col>
|
|
20
38
|
<SilkeTag kind="outlined" color={color} label={color} outline />
|
|
21
39
|
</SilkeBox>
|
|
@@ -27,12 +45,27 @@
|
|
|
27
45
|
|
|
28
46
|
```js
|
|
29
47
|
<SilkeBox gap>
|
|
30
|
-
{[
|
|
48
|
+
{[
|
|
49
|
+
"sand",
|
|
50
|
+
"yellow",
|
|
51
|
+
"green",
|
|
52
|
+
"red",
|
|
53
|
+
"gray",
|
|
54
|
+
"blue",
|
|
55
|
+
"brandYellow",
|
|
56
|
+
"dark",
|
|
57
|
+
].map((color) => (
|
|
31
58
|
<SilkeBox gap key={color} col>
|
|
32
|
-
<SilkeTag
|
|
59
|
+
<SilkeTag
|
|
60
|
+
kind="secondary"
|
|
61
|
+
color={color}
|
|
62
|
+
label={color}
|
|
63
|
+
outline
|
|
64
|
+
icon="react"
|
|
65
|
+
/>
|
|
33
66
|
</SilkeBox>
|
|
34
67
|
))}
|
|
35
|
-
|
|
68
|
+
<SilkeTag kind="secondary" label="Emoji" outline icon="😎" />
|
|
36
69
|
</SilkeBox>
|
|
37
70
|
```
|
|
38
71
|
|
|
@@ -40,18 +73,21 @@
|
|
|
40
73
|
|
|
41
74
|
```js
|
|
42
75
|
<SilkeBox gap column>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
<SilkeBox gap>
|
|
77
|
+
<SilkeTag label="Primary base" />
|
|
78
|
+
<SilkeTag size="tiny" label=" Primary tiny" />
|
|
79
|
+
<SilkeTag size="tiny" icon="eye" label=" Primary tiny" />
|
|
80
|
+
</SilkeBox>
|
|
81
|
+
<SilkeBox gap>
|
|
82
|
+
<SilkeTag kind="outlined" label="Outlined base" />
|
|
83
|
+
<SilkeTag kind="outlined" size="tiny" label="Outlined tiny" />
|
|
84
|
+
<SilkeTag kind="outlined" size="tiny" icon="eye" label="Outlined tiny" />
|
|
85
|
+
</SilkeBox>
|
|
86
|
+
<SilkeBox gap>
|
|
87
|
+
<SilkeTag kind="secondary" label="Secondary base" />
|
|
88
|
+
<SilkeTag kind="secondary" size="tiny" label="Secondary tiny" />
|
|
89
|
+
<SilkeTag kind="secondary" size="tiny" icon="eye" label="Secondary tiny" />
|
|
90
|
+
</SilkeBox>
|
|
55
91
|
</SilkeBox>
|
|
56
92
|
```
|
|
57
93
|
|
|
@@ -59,7 +95,16 @@
|
|
|
59
95
|
|
|
60
96
|
```js
|
|
61
97
|
<SilkeBox gap>
|
|
62
|
-
{[
|
|
98
|
+
{[
|
|
99
|
+
"sand",
|
|
100
|
+
"yellow",
|
|
101
|
+
"green",
|
|
102
|
+
"red",
|
|
103
|
+
"gray",
|
|
104
|
+
"blue",
|
|
105
|
+
"brandYellow",
|
|
106
|
+
"dark",
|
|
107
|
+
].map((color) => (
|
|
63
108
|
<SilkeBox gap key={color} col>
|
|
64
109
|
<SilkeTag color={color} label={color} icon="react" />
|
|
65
110
|
</SilkeBox>
|
|
@@ -71,14 +116,23 @@
|
|
|
71
116
|
|
|
72
117
|
```js
|
|
73
118
|
<SilkeBox gap>
|
|
74
|
-
{[
|
|
119
|
+
{[
|
|
120
|
+
"sand",
|
|
121
|
+
"yellow",
|
|
122
|
+
"green",
|
|
123
|
+
"red",
|
|
124
|
+
"gray",
|
|
125
|
+
"blue",
|
|
126
|
+
"brandYellow",
|
|
127
|
+
"dark",
|
|
128
|
+
].map((color) => (
|
|
75
129
|
<SilkeBox gap key={color} col>
|
|
76
|
-
<SilkeTag color={color}
|
|
130
|
+
<SilkeTag color={color} icon="react" />
|
|
77
131
|
</SilkeBox>
|
|
78
132
|
))}
|
|
79
|
-
<SilkeBox gap
|
|
80
|
-
|
|
81
|
-
|
|
133
|
+
<SilkeBox gap col>
|
|
134
|
+
<SilkeTag kind="secondary" color="green" icon="react" />
|
|
135
|
+
</SilkeBox>
|
|
82
136
|
</SilkeBox>
|
|
83
137
|
```
|
|
84
138
|
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
background-color: rgb(var(--tag-background));
|
|
67
67
|
height: var(--tag-height);
|
|
68
68
|
max-height: var(--tag-height);
|
|
69
|
-
min-width:
|
|
69
|
+
min-width: var(--tag-height);
|
|
70
70
|
max-width: 150px;
|
|
71
71
|
font-size: 12px;
|
|
72
72
|
border-radius: calc(var(--tag-height) / 2);
|
|
@@ -128,6 +128,9 @@
|
|
|
128
128
|
padding: 0 4px;
|
|
129
129
|
font-size: 12px;
|
|
130
130
|
}
|
|
131
|
+
.tagIcon{
|
|
132
|
+
font-size:12px;
|
|
133
|
+
}
|
|
131
134
|
|
|
132
135
|
&.tiny .disabled {
|
|
133
136
|
background-color: var(--color-neutral-40);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps, BoxSize, BoxSpace, SilkeBox } from '../silke-box';
|
|
3
3
|
import ButtonContext from '../silke-button/context';
|
|
4
|
-
import { SilkeIcon } from '../silke-icon';
|
|
5
4
|
import { SilkeText } from '../silke-text/silke-text';
|
|
6
5
|
import styles from './silke-text-field.scss';
|
|
7
6
|
import { useTextFieldContext } from './text-field-context';
|
|
8
7
|
import { SilkeTextFieldItem } from './silke-text-field-item';
|
|
8
|
+
import { SilkeIconTooltip } from '../silke-tooltip';
|
|
9
9
|
|
|
10
10
|
type InputSize = 'tiny' | 'small' | 'base' | 'large';
|
|
11
11
|
|
|
@@ -39,8 +39,7 @@ export type SilkeTextFieldOutlineProps = {
|
|
|
39
39
|
vAlign?: BoxProps['vAlign'];
|
|
40
40
|
/** Inline will add the label before the input field */
|
|
41
41
|
inline?: boolean | 'label-inside';
|
|
42
|
-
|
|
43
|
-
inlineLabelWidth?: number;
|
|
42
|
+
|
|
44
43
|
/** Field required input (if string the string will be used as error msg) */
|
|
45
44
|
/** Helpful tip or explanation of function of the field */
|
|
46
45
|
help?: React.ReactNode;
|
|
@@ -55,6 +54,7 @@ export type SilkeTextFieldOutlineProps = {
|
|
|
55
54
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
56
55
|
onMouseDown?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
57
56
|
disabled?: boolean;
|
|
57
|
+
tooltip?: string;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextFieldOutlineProps>(
|
|
@@ -81,7 +81,7 @@ export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextF
|
|
|
81
81
|
onClick,
|
|
82
82
|
onMouseDown,
|
|
83
83
|
disabled,
|
|
84
|
-
|
|
84
|
+
tooltip,
|
|
85
85
|
}: SilkeTextFieldOutlineProps,
|
|
86
86
|
ref,
|
|
87
87
|
) => {
|
|
@@ -104,16 +104,23 @@ export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextF
|
|
|
104
104
|
const boxSize: BoxSize = size === 'xs' ? 's' : size === 's' ? 'base' : 'm';
|
|
105
105
|
|
|
106
106
|
const labelComponent = label && (
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
<SilkeBox vAlign="center" flex>
|
|
108
|
+
<SilkeText
|
|
109
|
+
className={styles.label}
|
|
110
|
+
tag="label"
|
|
111
|
+
id={labelUsingAria ? labelId : undefined}
|
|
112
|
+
htmlFor={!labelUsingAria ? labelId : undefined}
|
|
113
|
+
color="neutral-100"
|
|
114
|
+
size={size === 'xs' ? 'small' : 'base'}
|
|
115
|
+
>
|
|
116
|
+
{label}
|
|
117
|
+
</SilkeText>
|
|
118
|
+
{tooltip && (
|
|
119
|
+
<SilkeBox style={{ height: '10px', marginTop: '-13px' }}>
|
|
120
|
+
<SilkeIconTooltip tooltip={tooltip} icon="tooltip" />
|
|
121
|
+
</SilkeBox>
|
|
122
|
+
)}
|
|
123
|
+
</SilkeBox>
|
|
117
124
|
);
|
|
118
125
|
return (
|
|
119
126
|
<SilkeBox
|
|
@@ -151,13 +158,18 @@ export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextF
|
|
|
151
158
|
{!inline && (
|
|
152
159
|
<SilkeBox hAlign="spread" className={styles.help}>
|
|
153
160
|
{showHelp && help && (
|
|
154
|
-
<SilkeText flex id={helpId}>
|
|
161
|
+
<SilkeText flex id={helpId} size={size === 'xs' ? 'micro' : 'base'}>
|
|
155
162
|
{help}
|
|
156
163
|
</SilkeText>
|
|
157
164
|
)}
|
|
158
165
|
{showHelp && helpRight && <SilkeText>{helpRight}</SilkeText>}
|
|
159
166
|
{showError && (
|
|
160
|
-
<SilkeText
|
|
167
|
+
<SilkeText
|
|
168
|
+
flex
|
|
169
|
+
aria-live="polite"
|
|
170
|
+
role="alert"
|
|
171
|
+
size={size === 'xs' ? 'micro' : 'base'}
|
|
172
|
+
>
|
|
161
173
|
{error}
|
|
162
174
|
</SilkeText>
|
|
163
175
|
)}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
--text-field-error-border-color: var(--color-error-20);
|
|
22
22
|
|
|
23
23
|
--text-field-border-radius: var(--border-radius-small);
|
|
24
|
+
--text-field-label-weight: 600;
|
|
24
25
|
|
|
25
26
|
----current-border-color:transparent;
|
|
26
27
|
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
.tiny {
|
|
113
114
|
--text-field-font-size: 12px;
|
|
114
115
|
--text-field-height: 24px;
|
|
116
|
+
--text-field-label-weight: 400;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
.small {
|
|
@@ -144,7 +146,7 @@
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
.label {
|
|
147
|
-
font-weight:
|
|
149
|
+
font-weight: var(--text-field-label-weight);
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
.help {
|
|
@@ -157,6 +159,11 @@
|
|
|
157
159
|
line-height: 1;
|
|
158
160
|
}
|
|
159
161
|
|
|
162
|
+
.helpSmall {
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
font-weight: 400;
|
|
165
|
+
}
|
|
166
|
+
|
|
160
167
|
.input,
|
|
161
168
|
[data-input] {
|
|
162
169
|
@include font(14px);
|
|
@@ -86,8 +86,8 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
86
86
|
kind,
|
|
87
87
|
inline,
|
|
88
88
|
disabled,
|
|
89
|
-
inlineLabelWidth,
|
|
90
89
|
readOnly,
|
|
90
|
+
tooltip,
|
|
91
91
|
...rest
|
|
92
92
|
} = useFormField(props, validateText);
|
|
93
93
|
|
|
@@ -139,7 +139,6 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
139
139
|
className={className}
|
|
140
140
|
error={error}
|
|
141
141
|
inline={inline}
|
|
142
|
-
inlineLabelWidth={inlineLabelWidth}
|
|
143
142
|
helpId={helpId}
|
|
144
143
|
labelId={inputId}
|
|
145
144
|
help={help}
|
|
@@ -147,6 +146,7 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
147
146
|
label={label}
|
|
148
147
|
flex={flex}
|
|
149
148
|
disabled={disabled}
|
|
149
|
+
tooltip={tooltip}
|
|
150
150
|
>
|
|
151
151
|
{before}
|
|
152
152
|
{React.createElement(multiline ? 'textarea' : 'input', {
|
|
@@ -35,6 +35,7 @@ type BaseProps = {
|
|
|
35
35
|
useFileModel?: boolean;
|
|
36
36
|
multiple?: boolean;
|
|
37
37
|
autoFocus?: boolean;
|
|
38
|
+
onSelectFiles?: (value: any) => void;
|
|
38
39
|
} & Omit<BoxLabelProps, 'onChange'>;
|
|
39
40
|
|
|
40
41
|
type SingleField = { multiple?: false | undefined } & BaseProps &
|
|
@@ -175,7 +176,10 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
175
176
|
maxLength={1024}
|
|
176
177
|
name={name}
|
|
177
178
|
multiple={multiple}
|
|
178
|
-
onChange={(e) =>
|
|
179
|
+
onChange={(e) => {
|
|
180
|
+
if (props.onSelectFiles) return props.onSelectFiles(e.currentTarget.files);
|
|
181
|
+
handleFiles(e.currentTarget.files);
|
|
182
|
+
}}
|
|
179
183
|
/>
|
|
180
184
|
<SilkeBox
|
|
181
185
|
pad="m"
|
package/src/icons.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
|
|
3
3
|
export const SilkeIconDefinitions = {
|
|
4
4
|
// BASIC ICONS
|
|
@@ -13,6 +13,7 @@ export const SilkeIconDefinitions = {
|
|
|
13
13
|
'edit.pen': 'fal fa-pen',
|
|
14
14
|
error: 'fas fa-exclamation',
|
|
15
15
|
help: 'fal fa-question-circle',
|
|
16
|
+
community: 'fal fa-user-group-simple',
|
|
16
17
|
'check.circle.outline': 'fal fa-check-circle',
|
|
17
18
|
play: 'fal fa-play',
|
|
18
19
|
emoji: 'fal fa-smile',
|
|
@@ -38,8 +39,9 @@ export const SilkeIconDefinitions = {
|
|
|
38
39
|
rollback: 'fal fa-history',
|
|
39
40
|
settings: 'fal fa-cog',
|
|
40
41
|
search: 'fal fa-search',
|
|
42
|
+
library: 'fal fa-book',
|
|
41
43
|
'search.file': 'fal fa-file-magnifying-glass',
|
|
42
|
-
filter: 'fal fa-
|
|
44
|
+
filter: 'fal fa-sliders-simple',
|
|
43
45
|
copy: 'fal fa-copy',
|
|
44
46
|
paste: 'fal fa-paste',
|
|
45
47
|
random: 'fal fa-random',
|
|
@@ -203,6 +205,7 @@ export const SilkeIconDefinitions = {
|
|
|
203
205
|
'object.group': 'fal fa-object-group',
|
|
204
206
|
'object.ungroup': 'fal fa-object-ungroup',
|
|
205
207
|
pin: 'fal fa-map-pin',
|
|
208
|
+
'component.add': 'fal fa-grid-round-2-plus',
|
|
206
209
|
'main-component': MainComponent,
|
|
207
210
|
section: Section,
|
|
208
211
|
frame: 'fal fa-frame',
|
|
@@ -578,23 +581,10 @@ function PlacementBottom() {
|
|
|
578
581
|
|
|
579
582
|
function MainComponent() {
|
|
580
583
|
return (
|
|
581
|
-
<
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
d="M8 6C9.1598 6 10.0273 5.1598 10.0273 4C10.0273 2.8402 9.1598 1.99219 8 1.99219C6.8402 1.99219 5.98828 2.8402 5.98828 4C5.98828 5.1598 6.8402 6 8 6ZM8 7C9.65685 7 11 5.65685 11 4C11 2.34315 9.65685 1 8 1C6.34315 1 5 2.34315 5 4C5 5.65685 6.34315 7 8 7Z"
|
|
586
|
-
/>
|
|
587
|
-
<path
|
|
588
|
-
fillRule="evenodd"
|
|
589
|
-
clipRule="evenodd"
|
|
590
|
-
d="M12.0156 13C13.1754 13 14.043 12.1598 14.043 11C14.043 9.8402 13.1754 8.99219 12.0156 8.99219C10.8558 8.99219 10.0039 9.8402 10.0039 11C10.0039 12.1598 10.8558 13 12.0156 13ZM12.0156 14C13.6725 14 15.0156 12.6569 15.0156 11C15.0156 9.34315 13.6725 8 12.0156 8C10.3588 8 9.01562 9.34315 9.01562 11C9.01562 12.6569 10.3588 14 12.0156 14Z"
|
|
591
|
-
/>
|
|
592
|
-
<path
|
|
593
|
-
fillRule="evenodd"
|
|
594
|
-
clipRule="evenodd"
|
|
595
|
-
d="M3.98438 13C5.14417 13 6.01172 12.1598 6.01172 11C6.01172 9.8402 5.14417 8.99219 3.98438 8.99219C2.82458 8.99219 1.97266 9.8402 1.97266 11C1.97266 12.1598 2.82458 13 3.98438 13ZM3.98438 14C5.64123 14 6.98438 12.6569 6.98438 11C6.98438 9.34315 5.64123 8 3.98438 8C2.32752 8 0.984375 9.34315 0.984375 11C0.984375 12.6569 2.32752 14 3.98438 14Z"
|
|
596
|
-
/>
|
|
597
|
-
</svg>
|
|
584
|
+
<i
|
|
585
|
+
className="fal fa-border-all fa-sm fa-rotate-by"
|
|
586
|
+
style={{ '--fa-rotate-angle': '45deg' } as CSSProperties}
|
|
587
|
+
/>
|
|
598
588
|
);
|
|
599
589
|
}
|
|
600
590
|
|