@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
|
@@ -1,98 +1,178 @@
|
|
|
1
|
-
@use
|
|
2
|
-
$kinds: (
|
|
3
|
-
name: default,
|
|
4
|
-
bg: var(--color-neutral-20),
|
|
5
|
-
bg-disabled: var(--color-neutral-10),
|
|
6
|
-
border-width: 1px,
|
|
7
|
-
border-color: var(--color-neutral-20),
|
|
8
|
-
border-color-hover: var(--color-neutral-40),
|
|
9
|
-
border-color-focus: var(--color-neutral-60),
|
|
10
|
-
border-radius: var(--border-radius-small),
|
|
11
|
-
),
|
|
12
|
-
(
|
|
13
|
-
name: secondary,
|
|
14
|
-
bg: transparent,
|
|
15
|
-
bg-disabled: transparent,
|
|
16
|
-
bg-hover: transparent,
|
|
17
|
-
border-width: 0 0 1px 0,
|
|
18
|
-
border-color: var(--color-neutral-30),
|
|
19
|
-
border-color-hover: var(--color-neutral-70),
|
|
20
|
-
border-color-focus: var(--color-neutral-90),
|
|
21
|
-
),
|
|
22
|
-
(
|
|
23
|
-
name: ghost,
|
|
24
|
-
bg: transparent,
|
|
25
|
-
bg-hover: transparent,
|
|
26
|
-
bg-disabled: transparent,
|
|
27
|
-
border-width: 0 0 1px 0,
|
|
28
|
-
border-color: transparent,
|
|
29
|
-
border-color-hover: transparent,
|
|
30
|
-
border-color-focus: var(--color-neutral-90),
|
|
31
|
-
);
|
|
1
|
+
@use "../../variables" as *;
|
|
32
2
|
|
|
33
3
|
.root {
|
|
4
|
+
--text-field-font-size: 14px;
|
|
5
|
+
--text-field-height: 40px;
|
|
6
|
+
--text-field-error-color: var(--color-error-30);
|
|
7
|
+
--text-field-help-color: var(--color-neutral-70);
|
|
8
|
+
--text-field-disabled-color: var(--color-neutral-30);
|
|
9
|
+
--text-field-placeholder-color: var(--color-neutral-70);
|
|
10
|
+
--text-field-disabled-placeholder-color: var(--color-neutral-50);
|
|
11
|
+
|
|
12
|
+
--text-field-bg: var(--color-neutral-20);
|
|
13
|
+
--text-field-hover-bg: var(--color-neutral-20);
|
|
14
|
+
--text-field-disabled-bg: var(--color-neutral-10);
|
|
15
|
+
|
|
16
|
+
--text-field-border-width: 1px;
|
|
17
|
+
--text-field-border-color: var(--color-neutral-20);
|
|
18
|
+
--text-field-hover-border-color: var(--color-neutral-40);
|
|
19
|
+
--text-field-focus-border-color: var(--color-neutral-60);
|
|
20
|
+
--text-field-disabled-border-color: var(--text-field-disabled-bg);
|
|
21
|
+
--text-field-error-border-color: var(--color-error-20);
|
|
22
|
+
|
|
23
|
+
--text-field-border-radius: var(--border-radius-small);
|
|
24
|
+
|
|
25
|
+
----current-border-color:transparent;
|
|
26
|
+
|
|
34
27
|
width: 100%;
|
|
35
28
|
min-width: 0;
|
|
36
|
-
|
|
29
|
+
font-size: var(--text-field-font-size);
|
|
30
|
+
|
|
31
|
+
&.ghost {
|
|
32
|
+
/** Zoombie fileds for now */
|
|
33
|
+
// --text-field-bg: transparent;
|
|
34
|
+
// --text-field-hover-bg: transparent;
|
|
35
|
+
// --text-field-disabled-bg: transparent;
|
|
36
|
+
|
|
37
|
+
// --text-field-border-width: 1px;
|
|
38
|
+
// --text-field-border-color: transparent;
|
|
39
|
+
// --text-field-hover-border-color: var(--color-neutral-20);
|
|
40
|
+
// --text-field-focus-border-color: var(--color-accent-30);
|
|
41
|
+
|
|
42
|
+
/** True ghost field code but Betsy wanted to tweak more on design */
|
|
43
|
+
--text-field-bg: transparent;
|
|
44
|
+
--text-field-hover-bg: transparent;
|
|
45
|
+
--text-field-disabled-bg: transparent;
|
|
46
|
+
|
|
47
|
+
--text-field-border-width: 0;
|
|
48
|
+
--text-field-border-color: transparent;
|
|
49
|
+
--text-field-hover-border-color: transparent;
|
|
50
|
+
--text-field-focus-border-color: transparent;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.zombie {
|
|
54
|
+
--text-field-bg: transparent;
|
|
55
|
+
--text-field-hover-bg: transparent;
|
|
56
|
+
--text-field-disabled-bg: transparent;
|
|
57
|
+
|
|
58
|
+
--text-field-border-width: 1px;
|
|
59
|
+
--text-field-border-color: transparent;
|
|
60
|
+
--text-field-hover-border-color: var(--color-neutral-20);
|
|
61
|
+
--text-field-focus-border-color: var(--color-accent-30);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.disabled {
|
|
65
|
+
.field {
|
|
66
|
+
background-color: var(--text-field-disabled-bg);
|
|
67
|
+
}
|
|
37
68
|
|
|
38
|
-
.field {
|
|
39
|
-
|
|
40
|
-
}
|
|
69
|
+
.field {
|
|
70
|
+
border-color: var(--text-field-disabled-border-color);
|
|
71
|
+
}
|
|
41
72
|
|
|
42
|
-
.label,
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
73
|
+
.label,
|
|
74
|
+
.help,
|
|
75
|
+
.input {
|
|
76
|
+
color: var(--text-field-disabled-color);
|
|
77
|
+
}
|
|
46
78
|
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
}
|
|
79
|
+
.input::placeholder {
|
|
80
|
+
color: var(--text-field-disabled-placeholder-color);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
50
83
|
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
|
|
84
|
+
&:not(.disabled):hover {
|
|
85
|
+
.field {
|
|
86
|
+
background-color: var(--text-field-hover-bg);
|
|
87
|
+
--current-border-color: var(--text-field-hover-border-color);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
54
90
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
&.error {
|
|
92
|
+
.field {
|
|
93
|
+
--current-border-color: var(--text-field-error-border-color);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.help {
|
|
97
|
+
color: var(--text-field-error-color);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.field:has(.input:focus),
|
|
102
|
+
.field:has([data-input]:focus) {
|
|
103
|
+
--current-border-color: var(--text-field-focus-border-color);
|
|
58
104
|
}
|
|
59
105
|
}
|
|
60
106
|
|
|
61
|
-
.
|
|
62
|
-
|
|
107
|
+
.tiny,
|
|
108
|
+
.small {
|
|
109
|
+
--text-field-border-radius: var(--border-radius-tiny);
|
|
63
110
|
}
|
|
64
111
|
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
|
|
112
|
+
.tiny {
|
|
113
|
+
--text-field-font-size: 12px;
|
|
114
|
+
--text-field-height: 24px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.small {
|
|
118
|
+
--text-field-font-size: 14px;
|
|
119
|
+
--text-field-height: 32px;
|
|
68
120
|
}
|
|
69
121
|
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
122
|
+
.field {
|
|
123
|
+
position: relative;
|
|
124
|
+
background-color: var(--text-field-bg);
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
border-radius: var(--text-field-border-radius);
|
|
127
|
+
transition: color 80ms;
|
|
128
|
+
|
|
129
|
+
&::after{
|
|
130
|
+
content: "";
|
|
131
|
+
display: block;
|
|
132
|
+
position: absolute;
|
|
133
|
+
inset: 0 0 0 0;
|
|
134
|
+
border: 0 solid var(--current-border-color);
|
|
135
|
+
border-radius: var(--text-field-border-radius);
|
|
136
|
+
border-width: var(--text-field-border-width);
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
// Label placed inside field
|
|
140
|
+
.label {
|
|
141
|
+
font-weight: 400;
|
|
142
|
+
color: var(--text-field-help-color);
|
|
143
|
+
font-size: var(--text-field-font-size);
|
|
73
144
|
}
|
|
74
145
|
}
|
|
75
146
|
|
|
76
|
-
.
|
|
77
|
-
|
|
147
|
+
.label {
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.help {
|
|
152
|
+
color: var(--text-field-help-color);
|
|
153
|
+
font-size: 0.85em;
|
|
78
154
|
}
|
|
79
155
|
|
|
80
|
-
.
|
|
81
|
-
|
|
156
|
+
.help,
|
|
157
|
+
.label {
|
|
158
|
+
line-height: 1;
|
|
82
159
|
}
|
|
83
160
|
|
|
84
|
-
.input
|
|
161
|
+
.input,
|
|
162
|
+
[data-input] {
|
|
85
163
|
@include font(14px);
|
|
86
164
|
flex: 1;
|
|
87
165
|
background: transparent;
|
|
88
166
|
outline: none;
|
|
89
167
|
border: none;
|
|
168
|
+
white-space: nowrap;
|
|
90
169
|
/** Hack to fix flex padding so input does not push out text field items */
|
|
91
170
|
overflow: hidden;
|
|
92
|
-
padding: 0;
|
|
171
|
+
padding: 0 8px;
|
|
93
172
|
resize: none;
|
|
94
173
|
color: var(--color-neutral-100);
|
|
95
|
-
line-height:
|
|
174
|
+
line-height: var(--text-field-height);
|
|
175
|
+
font-size: var(--text-field-font-size);
|
|
96
176
|
|
|
97
177
|
&::selection {
|
|
98
178
|
background-color: rgba(var(--color-accent-30-rgb), 0.32);
|
|
@@ -100,200 +180,26 @@ $kinds: (
|
|
|
100
180
|
}
|
|
101
181
|
|
|
102
182
|
&::placeholder {
|
|
103
|
-
color: var(--
|
|
183
|
+
color: var(--text-field-placeholder-color);
|
|
104
184
|
}
|
|
105
185
|
}
|
|
186
|
+
[data-placeholder]:empty::before {
|
|
187
|
+
white-space: nowrap;
|
|
188
|
+
content: attr(data-placeholder);
|
|
189
|
+
display: block;
|
|
190
|
+
color: var(--text-field-placeholder-color);
|
|
191
|
+
}
|
|
106
192
|
|
|
107
193
|
textarea {
|
|
108
194
|
margin-top: 8px;
|
|
109
195
|
margin-bottom: 8px;
|
|
110
196
|
}
|
|
111
197
|
|
|
112
|
-
.
|
|
113
|
-
position: absolute;
|
|
114
|
-
bottom: 0;
|
|
115
|
-
left: 0;
|
|
116
|
-
right: 0;
|
|
117
|
-
top: 0;
|
|
118
|
-
pointer-events: none;
|
|
119
|
-
margin: 0;
|
|
120
|
-
border: 0 solid currentColor;
|
|
121
|
-
|
|
122
|
-
&:hover {
|
|
123
|
-
color: var(--color-neutral-30)
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@each $kind in $kinds {
|
|
128
|
-
.#{map-get($kind, name)} {
|
|
129
|
-
.field {
|
|
130
|
-
background-color: map-get($kind, bg);
|
|
131
|
-
border-radius: map-get($kind, border-radius);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.border {
|
|
135
|
-
border-width: map-get($kind, border-width);
|
|
136
|
-
color: map-get($kind, border-color);
|
|
137
|
-
transition: color 80ms;
|
|
138
|
-
border-radius: map-get($kind, border-radius);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&.disabled .field {
|
|
142
|
-
background-color: map-get($kind, bg-disabled);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&:not(.disabled):hover {
|
|
146
|
-
.field {
|
|
147
|
-
background-color: map-get($kind, bg-hover);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.border {
|
|
151
|
-
color: map-get($kind, border-color-hover);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.input, [contenteditable="true"] {
|
|
155
|
-
&:focus ~ .border {
|
|
156
|
-
color: map-get($kind, var(--color-neutral-100));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.input, [contenteditable="true"] {
|
|
162
|
-
&:focus ~ .border {
|
|
163
|
-
color: map-get($kind, border-color-focus);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&.error input ~ .border {
|
|
168
|
-
color: var(--color-warning-30);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
textarea.input{
|
|
198
|
+
.inputMultiline {
|
|
174
199
|
line-height: 1.2em !important;
|
|
200
|
+
white-space: pre-line;
|
|
175
201
|
}
|
|
176
202
|
|
|
177
|
-
.
|
|
178
|
-
font-size: 12px;
|
|
179
|
-
|
|
180
|
-
.input {
|
|
181
|
-
font-size: 12px;
|
|
182
|
-
line-height: 24px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.help, .formErrorMessage {
|
|
186
|
-
font-size: 10px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&.default {
|
|
190
|
-
.field {
|
|
191
|
-
border-radius: var(--border-radius-tiny);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.border {
|
|
195
|
-
border-radius: var(--border-radius-tiny);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.input {
|
|
199
|
-
padding: 0 8px;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.small {
|
|
205
|
-
font-size: 14px;
|
|
206
|
-
|
|
207
|
-
.input {
|
|
208
|
-
font-size: 14px;
|
|
209
|
-
line-height: 32px;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.help, .formErrorMessage {
|
|
213
|
-
font-size: 12px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
&.default {
|
|
217
|
-
.field {
|
|
218
|
-
border-radius: var(--border-radius-tiny);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.border {
|
|
222
|
-
border-radius: var(--border-radius-tiny);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.input {
|
|
226
|
-
padding: 0 8px;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.base {
|
|
232
|
-
font-size: 16px;
|
|
233
|
-
|
|
234
|
-
.help, .label, .formErrorMessage {
|
|
235
|
-
font-size: 14px;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.input {
|
|
239
|
-
line-height: 40px;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
&.default {
|
|
243
|
-
.field, .border {
|
|
244
|
-
border-radius: var(--border-radius-small);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.input {
|
|
248
|
-
padding: 0 8px;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
.ghost {
|
|
252
|
-
.field, .border {
|
|
253
|
-
outline: none;
|
|
254
|
-
border: none;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.large {
|
|
260
|
-
font-size: 16px;
|
|
261
|
-
|
|
262
|
-
.help, .label, .formErrorMessage {
|
|
263
|
-
font-size: 14px;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.input {
|
|
267
|
-
line-height: 48px;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
&.default {
|
|
271
|
-
.field, .border {
|
|
272
|
-
border-radius: var(--border-radius-small);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.input {
|
|
276
|
-
padding-left: 16px;
|
|
277
|
-
padding-right: 16px;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.tiny, .small, .base, .large {
|
|
283
|
-
.inputMultiline {
|
|
284
|
-
line-height: 1.4;
|
|
285
|
-
overflow-y: auto;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Place the border on the outside of secondary fields
|
|
290
|
-
.secondary .border {
|
|
291
|
-
top: -1px;
|
|
292
|
-
left: -1px;
|
|
293
|
-
bottom: -1px;
|
|
294
|
-
right: -1px;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.itemBefore ~ .input {
|
|
203
|
+
.itemBefore ~ .input, .itemBefore ~ [data-input] {
|
|
298
204
|
padding: 0;
|
|
299
205
|
}
|
|
@@ -9,6 +9,7 @@ import React, {
|
|
|
9
9
|
useMemo,
|
|
10
10
|
useRef,
|
|
11
11
|
} from 'react';
|
|
12
|
+
import { useUniqId } from '../../hooks';
|
|
12
13
|
import { useFormField } from '../../hooks/form';
|
|
13
14
|
import { FormFieldProps } from '../silke-form';
|
|
14
15
|
import { SilkeTextFieldItem } from './silke-text-field-item';
|
|
@@ -93,9 +94,9 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
93
94
|
const helpId = useMemo(() => {
|
|
94
95
|
return `help-${generateGuid()}`;
|
|
95
96
|
}, []);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
|
|
98
|
+
const uid = useUniqId('silke-input');
|
|
99
|
+
const inputId = rest.id || uid;
|
|
99
100
|
|
|
100
101
|
const { type } = rest as Omit<InputHTMLAttributes<HTMLInputElement>, OmitAttrs>;
|
|
101
102
|
|
|
@@ -5,6 +5,7 @@ import { SilkeBox } from '../silke-box';
|
|
|
5
5
|
import { SilkeIcon, SilkeIcons } from '../silke-icon';
|
|
6
6
|
import { SilkeShortcuts } from './silke-shortcuts';
|
|
7
7
|
import { SilkeTooltip, SilkeTooltipProps } from './silke-tooltip';
|
|
8
|
+
import sanitizeHtml from 'sanitize-html';
|
|
8
9
|
|
|
9
10
|
type SilkeIconTooltipProps = {
|
|
10
11
|
icon?: SilkeIcons;
|
|
@@ -96,7 +97,7 @@ export function SilkeIconTooltip({
|
|
|
96
97
|
>
|
|
97
98
|
<SilkeBox gap="s" ref={contentRef} style={{ pointerEvents: interactive ? 'all' : 'none' }}>
|
|
98
99
|
{isString(tooltip) ? (
|
|
99
|
-
<span dangerouslySetInnerHTML={{ __html: tooltip }} />
|
|
100
|
+
<span dangerouslySetInnerHTML={{ __html: sanitizeHtml(tooltip) }} />
|
|
100
101
|
) : (
|
|
101
102
|
<span>{tooltip}</span>
|
|
102
103
|
)}
|
package/src/docs/app.tsx
CHANGED
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
import { Keyboard } from '@vev/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { last, startCase } from 'lodash';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { BrowserRouter, Link, Route, Switch, useHistory, useLocation } from 'react-router-dom';
|
|
3
5
|
import {
|
|
4
6
|
Flex,
|
|
5
7
|
SilkeAutocompleteField,
|
|
6
8
|
SilkeBox,
|
|
7
9
|
SilkeButton,
|
|
8
|
-
SilkeColorPicker,
|
|
9
|
-
SilkeColorPickerButton,
|
|
10
10
|
SilkeDivider,
|
|
11
11
|
SilkeDrawer,
|
|
12
|
-
|
|
12
|
+
SilkeIcon,
|
|
13
13
|
SilkeNavigationLink,
|
|
14
14
|
SilkeThemeEditor,
|
|
15
15
|
} from '../components';
|
|
16
|
-
import {
|
|
17
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
18
|
-
import {
|
|
19
|
-
BrowserRouter,
|
|
20
|
-
Link,
|
|
21
|
-
Route,
|
|
22
|
-
Switch,
|
|
23
|
-
useHistory,
|
|
24
|
-
useLocation,
|
|
25
|
-
withRouter,
|
|
26
|
-
} from 'react-router-dom';
|
|
27
|
-
import { SilkeColorTheme, SilkeThemeProvider } from '../silke-theme-provider';
|
|
16
|
+
import { SilkeThemeProvider } from '../silke-theme-provider';
|
|
28
17
|
import { AppRoute, AppStore, loadAppRoutes } from './data/app';
|
|
18
|
+
import { useStore } from './data/flux';
|
|
29
19
|
import { DocsProvider } from './docs-provider';
|
|
30
20
|
|
|
31
21
|
const sleep = (timeout = 2000) => new Promise((resolve) => setTimeout(resolve, timeout));
|
|
@@ -94,7 +84,10 @@ function AppToolbar({ onReqestShowTheme }: { onReqestShowTheme: () => void }) {
|
|
|
94
84
|
>
|
|
95
85
|
{showSearch ? (
|
|
96
86
|
<SilkeAutocompleteField
|
|
87
|
+
inline="label-inside"
|
|
97
88
|
autoFocus
|
|
89
|
+
placeholder="Search components"
|
|
90
|
+
label={<SilkeIcon icon="search" />}
|
|
98
91
|
items={routes.map((route) => ({
|
|
99
92
|
label: getRouteLabel(route),
|
|
100
93
|
value: route.path,
|
package/src/hooks/index.ts
CHANGED
|
@@ -34,21 +34,18 @@ export function useDropZone(
|
|
|
34
34
|
if (eventTarget === e.target) return null;
|
|
35
35
|
eventTarget = e.target;
|
|
36
36
|
|
|
37
|
-
e.stopPropagation();
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
if (enterRef.current) enterRef.current(e);
|
|
40
39
|
};
|
|
41
40
|
const onLeave = (e: DragEvent) => {
|
|
42
41
|
if (leaveRef.current && e.target === eventTarget) {
|
|
43
42
|
eventTarget = null;
|
|
44
|
-
e.stopPropagation();
|
|
45
43
|
e.preventDefault();
|
|
46
44
|
leaveRef.current(e);
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
47
|
const onDrop = (e: DragEvent) => {
|
|
50
48
|
eventTarget = null;
|
|
51
|
-
e.stopPropagation();
|
|
52
49
|
e.preventDefault();
|
|
53
50
|
if (dropRef.current) dropRef.current(e);
|
|
54
51
|
};
|
package/src/icons.tsx
CHANGED
|
@@ -25,6 +25,7 @@ export const SilkeIconDefinitions = {
|
|
|
25
25
|
menuMore: 'fal fa-ellipsis-v',
|
|
26
26
|
menu: 'fal fa-bars',
|
|
27
27
|
drag: 'fal fa-grip-lines',
|
|
28
|
+
'drag.dots': 'fa-solid fa-grip-dots-vertical',
|
|
28
29
|
remove: 'fal fa-minus',
|
|
29
30
|
'error.circle': 'fal fa-exclamation-circle',
|
|
30
31
|
'warning.triangle': 'fal fa-triangle-exclamation',
|
|
@@ -160,6 +161,7 @@ export const SilkeIconDefinitions = {
|
|
|
160
161
|
template: 'fal fa-copy',
|
|
161
162
|
page: 'fal fa-page',
|
|
162
163
|
project: 'fal fa-browser',
|
|
164
|
+
projects: 'fal fa-browsers',
|
|
163
165
|
draft: 'fal fa-file',
|
|
164
166
|
account: 'fal fa-building',
|
|
165
167
|
user: 'fal fa-user',
|
|
@@ -266,6 +268,7 @@ export const SilkeIconDefinitions = {
|
|
|
266
268
|
'list.ol': 'fal fa-list-ol',
|
|
267
269
|
'list.check': 'fal fa-list-check',
|
|
268
270
|
table: 'fal fa-table',
|
|
271
|
+
'table.layout': 'fa fa-table-layout',
|
|
269
272
|
text: 'fal fa-text',
|
|
270
273
|
'text.subscript': 'fal fa-subscript',
|
|
271
274
|
'text.superscript': 'fal fa-superscript',
|
|
@@ -350,9 +353,14 @@ export const SilkeIconDefinitions = {
|
|
|
350
353
|
// Interactions
|
|
351
354
|
'interaction.icon': 'fa-regular fa-bolt',
|
|
352
355
|
'interaction.active': 'fa-solid fa-bolt',
|
|
353
|
-
'interaction.inactive': 'fa-
|
|
356
|
+
'interaction.inactive': 'fa-light fa-bolt',
|
|
354
357
|
'interaction.click': 'fa-light fa-hand-pointer',
|
|
358
|
+
'interaction.double-click': 'fa-light fa-bullseye-pointer',
|
|
355
359
|
'interaction.arrow': 'fa-regular fa-arrow-down',
|
|
360
|
+
'interaction.mouse': 'fa-regular fa-computer-mouse-scrollwheel',
|
|
361
|
+
'interaction.mouse-enter': 'fa-regular fa-up-right',
|
|
362
|
+
'interaction.mouse-leave': 'fa-regular fa-down-left',
|
|
363
|
+
'interaction.timer': 'fa-regular fa-timer',
|
|
356
364
|
};
|
|
357
365
|
|
|
358
366
|
function CustomComponentIcon({ className }: { className?: string }) {
|
package/tsconfig.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
|
-
"exclude": ["../../node_modules/**/*", "./src/docs/**/*"],
|
|
3
|
+
"exclude": ["../../node_modules/**/*", "./src/docs/**/*", "**/*.spec.ts", "**/*.spec.tsx"],
|
|
4
4
|
"include": ["src/**/*", "../../@types"],
|
|
5
5
|
"compilerOptions": {
|
|
6
6
|
"strict": true,
|