@vev/silke 1.0.15 → 1.0.17
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 +16 -0
- package/dist/chunk-SOFGXMET.js +22 -0
- package/dist/chunk-SOFGXMET.js.LEGAL.txt +11 -0
- package/dist/{chunk-KMZFUBRE.js.map → chunk-SOFGXMET.js.map} +3 -3
- package/dist/index.js +44 -9
- package/dist/index.js.LEGAL.txt +45 -21
- package/dist/index.js.map +4 -4
- package/dist/silke-code-editor-3Y2KM5KB.js +25 -0
- package/dist/silke-code-editor-3Y2KM5KB.js.LEGAL.txt +0 -0
- package/dist/silke-code-editor-3Y2KM5KB.js.map +7 -0
- package/dist/styles.css +351 -425
- package/esbuild.config.mjs +47 -43
- package/jest.config.js +1 -2
- package/package.json +4 -4
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +33 -7
- package/src/components/silke-autocomplete-field/autocomplete-tags.tsx +6 -2
- package/src/components/silke-autocomplete-field/autocomplete-types.ts +4 -0
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.mdx +67 -24
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +32 -13
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.spec.tsx +24 -111
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +305 -219
- package/src/components/silke-box/silke-box.scss +9 -10
- package/src/components/silke-box/silke-box.tsx +9 -0
- package/src/components/silke-button/silke-button.scss +3 -3
- package/src/components/silke-color-picker/silke-color-info.tsx +2 -18
- package/src/components/silke-context-menu/silke-context-menu.tsx +0 -1
- package/src/components/silke-css-number-field/silke-css-number-field.mdx +43 -4
- package/src/components/silke-css-number-field/silke-css-number-field.scss +47 -14
- package/src/components/silke-css-number-field/silke-css-number-field.tsx +114 -186
- package/src/components/silke-css-number-field/utils.ts +25 -0
- package/src/components/silke-drawer/silke-drawer.tsx +0 -14
- package/src/components/silke-form/silke-form.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field.tsx +2 -2
- package/src/components/silke-form-schema/fields/event-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/icon-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/image-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/layout-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/link-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/number-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/object-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/select-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/string-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/toggle-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/upload-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/utils/generate-image.ts +1 -1
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +6 -5
- package/src/components/silke-form-schema/schema-utils.ts +1 -1
- package/src/components/silke-form-schema/silke-form-schema.tsx +1 -1
- package/src/components/silke-form-schema/silke-schema-context.tsx +1 -1
- package/src/components/silke-form-schema/silke-schema-field.tsx +1 -1
- package/src/components/silke-form-schema/silke-schema-fields.tsx +1 -1
- package/src/components/silke-image/silke-image.scss +2 -2
- package/src/components/silke-modal/silke-modal.tsx +11 -2
- package/src/components/silke-navigation-link/silke-navigation-link.scss +12 -2
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +21 -17
- package/src/components/silke-notification/silke-notification.scss +1 -1
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +1 -2
- package/src/components/silke-popover/silke-popover.tsx +1 -20
- package/src/components/silke-select-field/silke-select-field.mdx +137 -7
- package/src/components/silke-select-field/silke-select-field.spec.tsx +45 -128
- package/src/components/silke-sortable-list/silke-nested-sortable-item.tsx +17 -2
- package/src/components/silke-sortable-list/silke-nested-sortable-list.tsx +6 -2
- package/src/components/silke-sortable-list/silke-nested-sortable-utils.ts +6 -0
- package/src/components/silke-table/silke-table.tsx +1 -1
- package/src/components/silke-tag/silke-tag.tsx +3 -3
- package/src/components/silke-text-field/silke-text-field-item.tsx +12 -7
- package/src/components/silke-text-field/silke-text-field-outline.tsx +39 -42
- package/src/components/silke-text-field/silke-text-field.mdx +73 -6
- package/src/components/silke-text-field/silke-text-field.scss +153 -247
- package/src/components/silke-text-field/silke-text-field.tsx +4 -3
- package/src/components/silke-tooltip/silke-icon-tooltip.tsx +2 -1
- package/src/docs/app.tsx +9 -16
- package/src/hooks/form/use-form-field.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-drop-zone.ts +0 -3
- package/src/hooks/use-uniq-id.ts +6 -0
- package/src/icons.tsx +9 -1
- package/tsconfig.json +1 -1
- package/webpack.docs.ts +1 -1
- package/dist/chunk-KMZFUBRE.js +0 -22
- package/dist/chunk-KMZFUBRE.js.LEGAL.txt +0 -8
- package/dist/silke-code-editor-UX2ML2WG.js +0 -23
- package/dist/silke-code-editor-UX2ML2WG.js.map +0 -7
|
@@ -138,16 +138,6 @@ button.box {
|
|
|
138
138
|
padding-right: $size;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
.height-#{$name} {
|
|
142
|
-
height: #{$size * 2};
|
|
143
|
-
min-height: #{$size * 2};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.width-#{$name} {
|
|
147
|
-
width: #{$size * 2};
|
|
148
|
-
min-width: #{$size * 2};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
141
|
.gap-#{$name} {
|
|
152
142
|
gap: $size;
|
|
153
143
|
}
|
|
@@ -165,6 +155,15 @@ button.box {
|
|
|
165
155
|
width: $size;
|
|
166
156
|
min-width: $size;
|
|
167
157
|
}
|
|
158
|
+
|
|
159
|
+
.minHeight-#{$name} {
|
|
160
|
+
min-height: #{$size};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.minWidth-#{$name} {
|
|
164
|
+
min-width: #{$size};
|
|
165
|
+
}
|
|
166
|
+
|
|
168
167
|
}
|
|
169
168
|
|
|
170
169
|
.overflow-hidden{
|
|
@@ -53,6 +53,10 @@ type BaseProps = {
|
|
|
53
53
|
height?: BoxSize;
|
|
54
54
|
/** Width of the box (x2 of the spaceing, example: 'm' = 32px wide) */
|
|
55
55
|
width?: BoxSize;
|
|
56
|
+
/** Width of the box (x2 of the spaceing, example: 'm' = 32px wide) */
|
|
57
|
+
minHeight?: BoxSize;
|
|
58
|
+
/** Width of the box (x2 of the spaceing, example: 'm' = 32px wide) */
|
|
59
|
+
minWidth?: BoxSize;
|
|
56
60
|
/** Background color */
|
|
57
61
|
bg?: SilkeColor;
|
|
58
62
|
/** Background color on hover */
|
|
@@ -190,6 +194,8 @@ function BoxComp(
|
|
|
190
194
|
size,
|
|
191
195
|
width = size,
|
|
192
196
|
height = size,
|
|
197
|
+
minWidth,
|
|
198
|
+
minHeight,
|
|
193
199
|
children,
|
|
194
200
|
color,
|
|
195
201
|
colorHover,
|
|
@@ -240,6 +246,9 @@ function BoxComp(
|
|
|
240
246
|
if (width) cl.push(styles['width-' + width]);
|
|
241
247
|
if (height) cl.push(styles['height-' + height]);
|
|
242
248
|
|
|
249
|
+
if (minWidth) cl.push(styles['minWidth-' + minWidth]);
|
|
250
|
+
if (minHeight) cl.push(styles['minHeight-' + minHeight]);
|
|
251
|
+
|
|
243
252
|
if (color) cl.push('color-' + color);
|
|
244
253
|
if (colorHover) cl.push('color-hover-' + colorHover);
|
|
245
254
|
if (bg) cl.push('bg-' + bg);
|
|
@@ -63,26 +63,10 @@ export function ColorInfo({ rgba, noTransparency, onChange }: ColorInfoProps) {
|
|
|
63
63
|
{ value: 'HEX', label: 'HEX' },
|
|
64
64
|
{ value: 'RGB', label: 'RGB' },
|
|
65
65
|
]}
|
|
66
|
-
renderItem={({ item, selected }) => {
|
|
67
|
-
return (
|
|
68
|
-
<SilkeBox
|
|
69
|
-
hPad="xs"
|
|
70
|
-
bgHover="brand-secondary-30"
|
|
71
|
-
flex
|
|
72
|
-
vAlign="center"
|
|
73
|
-
gap="xs"
|
|
74
|
-
align="center"
|
|
75
|
-
>
|
|
76
|
-
<SilkeText size="small" flex color={selected ? 'accent-50' : 'neutral-80'}>
|
|
77
|
-
{item.label}
|
|
78
|
-
</SilkeText>
|
|
79
|
-
</SilkeBox>
|
|
80
|
-
);
|
|
81
|
-
}}
|
|
82
66
|
/>
|
|
83
67
|
</SilkeBox>
|
|
84
68
|
|
|
85
|
-
<SilkeBox style={{ width:
|
|
69
|
+
<SilkeBox style={{ width: 82 }} flex gap="s">
|
|
86
70
|
{format === 'HEX' ? (
|
|
87
71
|
<SilkeTextField
|
|
88
72
|
flex
|
|
@@ -109,7 +93,7 @@ export function ColorInfo({ rgba, noTransparency, onChange }: ColorInfoProps) {
|
|
|
109
93
|
)}
|
|
110
94
|
</SilkeBox>
|
|
111
95
|
|
|
112
|
-
<SilkeBox style={{ width:
|
|
96
|
+
<SilkeBox style={{ width: 62 }}>
|
|
113
97
|
<SilkeCssNumberField
|
|
114
98
|
min={0}
|
|
115
99
|
max={100}
|
|
@@ -9,11 +9,50 @@ You can wrap the filed in a css context to enable automatic convertion between f
|
|
|
9
9
|
const [value, setValue] = React.useState('20px');
|
|
10
10
|
const formats = ['px', '%', 'em', 'vh', 'vw']
|
|
11
11
|
|
|
12
|
-
<SilkeBox column>
|
|
12
|
+
<SilkeBox column gap="s">
|
|
13
13
|
<h1>{value}</h1>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
{["default", "zombie", "ghost"].map((kind) => (
|
|
15
|
+
<SilkeBox gap="s" key={kind} style={{width: 380}}>
|
|
16
|
+
<SilkeCssNumberField kind={kind} label="Label" allowAuto value={value} size="xs" formats={formats} onChange={setValue} />
|
|
17
|
+
<SilkeCssNumberField kind={kind} label="Label" allowAuto value={value} size="s" formats={formats} onChange={setValue} />
|
|
18
|
+
<SilkeCssNumberField kind={kind} value={value} label="Label" formats={formats} onChange={setValue}/>
|
|
19
|
+
<SilkeCssNumberField kind={kind} label="Label" value={value} inline formats={formats} onChange={setValue} />
|
|
20
|
+
</SilkeBox>
|
|
21
|
+
))}
|
|
22
|
+
</SilkeBox>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
const [value, setValue] = React.useState('20px');
|
|
27
|
+
const formats = ['px', '%', 'em', 'vh', 'vw']
|
|
28
|
+
|
|
29
|
+
<TextFieldContext inline="label-inside" size="xs">
|
|
30
|
+
<SilkeBox column gap="s">
|
|
31
|
+
<h1>{value}</h1>
|
|
32
|
+
{["default", "zombie", "ghost"].map((kind) => (
|
|
33
|
+
<SilkeBox gap="s" key={kind} style={{width: 256}}>
|
|
34
|
+
<SilkeCssNumberField kind={kind} label="Label" allowAuto value={value} formats={formats} onChange={setValue} />
|
|
35
|
+
<SilkeCssNumberField kind={kind} value={value} label="Label" formats={formats} onChange={setValue}/>
|
|
36
|
+
<SilkeCssNumberField kind={kind} label="Label" value={value} formats={formats} onChange={setValue} />
|
|
37
|
+
</SilkeBox>
|
|
38
|
+
))}
|
|
39
|
+
</SilkeBox>
|
|
40
|
+
</TextFieldContext>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Validation
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const [value, setValue] = React.useState('20%');
|
|
47
|
+
const formats = ['px', '%', 'em', 'vh', 'vw']
|
|
48
|
+
|
|
49
|
+
<SilkeBox column gap="s">
|
|
50
|
+
<h1>{value}</h1>
|
|
51
|
+
{["default", "zombie", "ghost"].map((kind) => (
|
|
52
|
+
<SilkeBox gap="s" key={kind}>
|
|
53
|
+
<SilkeCssNumberField kind={kind} value={value} label="Label" onChange={setValue} min={0} max={100}/>
|
|
54
|
+
</SilkeBox>
|
|
55
|
+
))}
|
|
17
56
|
</SilkeBox>
|
|
18
57
|
```
|
|
19
58
|
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
@use "../../variables" as *;
|
|
2
2
|
|
|
3
3
|
.root {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
&:hover,
|
|
6
|
+
&.openFormat {
|
|
7
|
+
.downIcon {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transform: translateX(0);
|
|
8
10
|
}
|
|
9
11
|
}
|
|
12
|
+
|
|
13
|
+
&.openFormat.openFormat{
|
|
14
|
+
--text-field-bg: var(--color-neutral-20);
|
|
15
|
+
--text-field-hover-bg: var(--color-neutral-20);
|
|
16
|
+
--text-field-focus-border-color: transparent;
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
}
|
|
11
20
|
|
|
12
21
|
.field {
|
|
@@ -17,17 +26,25 @@
|
|
|
17
26
|
white-space: nowrap;
|
|
18
27
|
align-self: center;
|
|
19
28
|
justify-self: end;
|
|
20
|
-
min-width: 1ch;
|
|
21
|
-
padding: 0 1px;
|
|
22
|
-
text-align: right;
|
|
23
|
-
flex: 1;
|
|
24
29
|
overflow: hidden;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
min-width: 1px;
|
|
31
|
+
|
|
32
|
+
padding:0 !important;
|
|
33
|
+
// width: auto !important;
|
|
34
|
+
&.hasFormats{
|
|
35
|
+
max-width: calc(100% - 16px);
|
|
36
|
+
}
|
|
37
|
+
flex: none !important;
|
|
38
|
+
text-align: right;
|
|
39
|
+
position: relative;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.inputHolder{
|
|
43
|
+
&:first-child{
|
|
44
|
+
padding: 0 4px;
|
|
45
|
+
}
|
|
46
|
+
&:not(:first-child){
|
|
47
|
+
padding:0;
|
|
31
48
|
}
|
|
32
49
|
}
|
|
33
50
|
|
|
@@ -55,3 +72,19 @@
|
|
|
55
72
|
width: 100%;
|
|
56
73
|
cursor: ew-resize;
|
|
57
74
|
}
|
|
75
|
+
|
|
76
|
+
.downIcon {
|
|
77
|
+
background: transparent;
|
|
78
|
+
outline: none;
|
|
79
|
+
border: none;
|
|
80
|
+
opacity: 0;
|
|
81
|
+
font-size: 0.845em;
|
|
82
|
+
transform: translateX(4px);
|
|
83
|
+
color: var(--text-field-placeholder-color);
|
|
84
|
+
transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.downIcon:hover,
|
|
88
|
+
.openFormat .downIcon {
|
|
89
|
+
color: var(--text-field-color);
|
|
90
|
+
}
|