@vev/silke 1.0.16 → 1.0.18
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-LAB2YEXC.js.map → chunk-SOFGXMET.js.map} +3 -3
- package/dist/index.js +43 -8
- package/dist/index.js.LEGAL.txt +6 -10
- package/dist/index.js.map +4 -4
- package/dist/silke-code-editor-LBP2WDX3.js +25 -0
- package/dist/silke-code-editor-LBP2WDX3.js.map +7 -0
- package/dist/styles.css +593 -618
- package/package.json +6 -6
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +33 -7
- package/src/components/silke-autocomplete-field/autocomplete-tags.tsx +8 -4
- 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 -109
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +304 -220
- package/src/components/silke-box/silke-box.mdx +2 -1
- package/src/components/silke-box/silke-box.scss +9 -10
- package/src/components/silke-box/silke-box.tsx +9 -0
- package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +5 -1
- package/src/components/silke-button/silke-button.scss +3 -3
- package/src/components/silke-checkbox/silke-checkbox.mdx +11 -2
- package/src/components/silke-color-palettes/silke-color-palette.mdx +2 -2
- package/src/components/silke-color-picker/color.ts +12 -0
- package/src/components/silke-color-picker/index.ts +1 -0
- package/src/components/silke-color-picker/silke-color-info.tsx +2 -18
- package/src/components/silke-color-picker/silke-color-picker.mdx +19 -9
- package/src/components/silke-color-picker/silke-color-picker.tsx +4 -13
- package/src/components/silke-context-menu/silke-context-menu-item.tsx +5 -1
- package/src/components/silke-context-menu/silke-context-menu.scss +5 -1
- package/src/components/silke-context-menu/silke-context-menu.tsx +4 -2
- 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.mdx +13 -13
- package/src/components/silke-drawer/silke-drawer.tsx +0 -14
- package/src/components/silke-form/silke-form.mdx +15 -3
- package/src/components/silke-form/silke-form.tsx +1 -1
- package/src/components/silke-form-schema/fields/event-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +14 -6
- package/src/components/silke-form-schema/silke-schema-field.tsx +12 -11
- package/src/components/silke-form-schema/silke-schema-fields.tsx +2 -2
- package/src/components/silke-icon/silke-icon.tsx +3 -1
- package/src/components/silke-image/silke-image.scss +2 -2
- package/src/components/silke-loader/silke-loader.mdx +3 -4
- package/src/components/silke-modal/silke-modal.tsx +11 -2
- package/src/components/silke-navigation-link/silke-navigation-link.mdx +6 -1
- 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-object-field/silke-object-field.mdx +10 -3
- 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-progress-indicator/silke-progress-indicator.mdx +9 -3
- package/src/components/silke-radio-button/silke-radio-button.mdx +7 -1
- package/src/components/silke-search-field/silke-search-field.mdx +12 -4
- package/src/components/silke-select-field/silke-select-field.mdx +137 -7
- package/src/components/silke-select-field/silke-select-field.spec.tsx +44 -126
- 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-tabs/silke-tabs.mdx +2 -2
- package/src/components/silke-tag/silke-tag.mdx +51 -13
- package/src/components/silke-tag/silke-tag.scss +52 -10
- package/src/components/silke-tag/silke-tag.tsx +48 -24
- 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-tile/silke-tile.mdx +39 -8
- package/src/components/silke-toggle/silke-toggle.mdx +29 -5
- package/src/components/silke-toolbar/silke-toolbar.mdx +35 -15
- package/src/components/silke-tooltip/silke-icon-tooltip.tsx +2 -1
- package/src/docs/app.tsx +9 -16
- package/src/docs/parser.ts +1 -1
- package/src/hooks/form/use-form-field.ts +1 -1
- package/src/hooks/hooks.mdx +3 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-uniq-id.ts +6 -0
- package/src/icons.tsx +10 -2
- package/dist/chunk-LAB2YEXC.js +0 -22
- package/dist/silke-code-editor-WEBZ7JXL.js +0 -25
- package/dist/silke-code-editor-WEBZ7JXL.js.map +0 -7
- /package/dist/{chunk-LAB2YEXC.js.LEGAL.txt → chunk-SOFGXMET.js.LEGAL.txt} +0 -0
- /package/dist/{silke-code-editor-WEBZ7JXL.js.LEGAL.txt → silke-code-editor-LBP2WDX3.js.LEGAL.txt} +0 -0
|
@@ -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
|
|
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
<p>Text info in this text</p>
|
|
7
7
|
</SilkeTile>
|
|
8
8
|
|
|
9
|
-
<SilkeTile
|
|
9
|
+
<SilkeTile
|
|
10
|
+
title="Clickable tile"
|
|
11
|
+
subTitle="With tags"
|
|
12
|
+
tags={["tags", "text"]}
|
|
13
|
+
onClick={() => {}}
|
|
14
|
+
>
|
|
10
15
|
<p>Text info in this text</p>
|
|
11
16
|
</SilkeTile>
|
|
12
|
-
<SilkeTile
|
|
17
|
+
<SilkeTile
|
|
18
|
+
title="Selected tile"
|
|
19
|
+
subTitle="Tile Sub Title"
|
|
20
|
+
selected
|
|
21
|
+
onClick={() => {}}
|
|
22
|
+
>
|
|
13
23
|
<p>Text info in this text</p>
|
|
14
24
|
</SilkeTile>
|
|
15
25
|
</SilkeBox>
|
|
@@ -19,7 +29,10 @@
|
|
|
19
29
|
|
|
20
30
|
```js
|
|
21
31
|
<SilkeBox column gap>
|
|
22
|
-
<SilkeTile
|
|
32
|
+
<SilkeTile
|
|
33
|
+
title="With menu"
|
|
34
|
+
menu={[{ label: "Item 1" }, { label: "Item 2" }]}
|
|
35
|
+
>
|
|
23
36
|
<p>Text info in this text</p>
|
|
24
37
|
</SilkeTile>
|
|
25
38
|
</SilkeBox>
|
|
@@ -30,7 +43,12 @@
|
|
|
30
43
|
```js
|
|
31
44
|
const [firstOpen, setFirstOpen] = React.useState();
|
|
32
45
|
<SilkeBox column gap>
|
|
33
|
-
<SilkeTile
|
|
46
|
+
<SilkeTile
|
|
47
|
+
title="Tile title"
|
|
48
|
+
subTitle="Tile Sub Title"
|
|
49
|
+
expandable
|
|
50
|
+
onExpand={setFirstOpen}
|
|
51
|
+
>
|
|
34
52
|
<h3>This text shows when expanded</h3>
|
|
35
53
|
{ipsum.p()}
|
|
36
54
|
</SilkeTile>
|
|
@@ -57,7 +75,12 @@ const handleExpand = (expanding) => {
|
|
|
57
75
|
setText(null);
|
|
58
76
|
}
|
|
59
77
|
};
|
|
60
|
-
<SilkeTile
|
|
78
|
+
<SilkeTile
|
|
79
|
+
title="Tile title"
|
|
80
|
+
subTitle="Tile Sub Title"
|
|
81
|
+
expandable
|
|
82
|
+
onExpand={handleExpand}
|
|
83
|
+
>
|
|
61
84
|
{text}
|
|
62
85
|
</SilkeTile>;
|
|
63
86
|
```
|
|
@@ -76,7 +99,7 @@ const handleExpand = (expanding) => {
|
|
|
76
99
|
</SilkeTile>
|
|
77
100
|
|
|
78
101
|
<SilkeTile
|
|
79
|
-
icon={{ type: 2, value: { url: ipsum.image() }}}
|
|
102
|
+
icon={{ type: 2, value: { url: ipsum.image() } }}
|
|
80
103
|
subTitle={ipsum.text()}
|
|
81
104
|
title="Tile with image icon"
|
|
82
105
|
/>
|
|
@@ -101,7 +124,11 @@ const [value, setValue] = React.useState(0);
|
|
|
101
124
|
<SilkeTileSelect
|
|
102
125
|
value={value}
|
|
103
126
|
onChange={setValue}
|
|
104
|
-
items={ipsum.list(5, (value) => ({
|
|
127
|
+
items={ipsum.list(5, (value) => ({
|
|
128
|
+
value,
|
|
129
|
+
title: ipsum.name(),
|
|
130
|
+
subTitle: ipsum.name(10),
|
|
131
|
+
}))}
|
|
105
132
|
/>;
|
|
106
133
|
```
|
|
107
134
|
|
|
@@ -113,6 +140,10 @@ const [value, setValue] = React.useState([1]);
|
|
|
113
140
|
multiple
|
|
114
141
|
value={value}
|
|
115
142
|
onChange={setValue}
|
|
116
|
-
items={ipsum.list(5, (value) => ({
|
|
143
|
+
items={ipsum.list(5, (value) => ({
|
|
144
|
+
value,
|
|
145
|
+
title: ipsum.name(),
|
|
146
|
+
subTitle: ipsum.name(10),
|
|
147
|
+
}))}
|
|
117
148
|
/>;
|
|
118
149
|
```
|
|
@@ -8,10 +8,24 @@ const [agree, setAgree] = React.useState(false);
|
|
|
8
8
|
|
|
9
9
|
<>
|
|
10
10
|
<SilkeBox>
|
|
11
|
-
<SilkeToggle
|
|
11
|
+
<SilkeToggle
|
|
12
|
+
label="Toggle with label"
|
|
13
|
+
value={checked}
|
|
14
|
+
onChange={setChecked}
|
|
15
|
+
/>
|
|
12
16
|
</SilkeBox>
|
|
13
|
-
<SilkeToggle
|
|
14
|
-
|
|
17
|
+
<SilkeToggle
|
|
18
|
+
required
|
|
19
|
+
label="This toggle is required"
|
|
20
|
+
value={agree}
|
|
21
|
+
onChange={setAgree}
|
|
22
|
+
/>
|
|
23
|
+
<SilkeToggle
|
|
24
|
+
small
|
|
25
|
+
label="Tiny toggle, tiny text"
|
|
26
|
+
value={checked}
|
|
27
|
+
onChange={setChecked}
|
|
28
|
+
/>
|
|
15
29
|
</>;
|
|
16
30
|
```
|
|
17
31
|
|
|
@@ -21,7 +35,12 @@ const [agree, setAgree] = React.useState(false);
|
|
|
21
35
|
const [checked, setChecked] = React.useState(true);
|
|
22
36
|
|
|
23
37
|
<>
|
|
24
|
-
<SilkeToggle
|
|
38
|
+
<SilkeToggle
|
|
39
|
+
disabled
|
|
40
|
+
label="Toggle with label"
|
|
41
|
+
value={checked}
|
|
42
|
+
onChange={setChecked}
|
|
43
|
+
/>
|
|
25
44
|
<SilkeToggle
|
|
26
45
|
disabled
|
|
27
46
|
small
|
|
@@ -29,7 +48,12 @@ const [checked, setChecked] = React.useState(true);
|
|
|
29
48
|
value={checked}
|
|
30
49
|
onChange={setChecked}
|
|
31
50
|
/>
|
|
32
|
-
<SilkeToggle
|
|
51
|
+
<SilkeToggle
|
|
52
|
+
disabled
|
|
53
|
+
label="Toggle with label (off)"
|
|
54
|
+
value={!checked}
|
|
55
|
+
onChange={setChecked}
|
|
56
|
+
/>
|
|
33
57
|
<SilkeToggle
|
|
34
58
|
disabled
|
|
35
59
|
small
|
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
# Toolbar
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<SilkeToolbar>
|
|
5
|
+
<SilkeSearchField label="Search" />
|
|
6
|
+
<SilkeSelectField
|
|
7
|
+
label="Filter"
|
|
8
|
+
items={[
|
|
9
|
+
{ label: "Apple", value: "apple" },
|
|
10
|
+
{ label: "Banana", value: "banana" },
|
|
11
|
+
]}
|
|
12
|
+
/>
|
|
13
|
+
<SilkeButton label="New project" kind="primary" />
|
|
14
|
+
</SilkeToolbar>
|
|
9
15
|
```
|
|
10
16
|
|
|
11
17
|
## Large
|
|
18
|
+
|
|
12
19
|
```js
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
<SilkeToolbar size="l">
|
|
21
|
+
<SilkeSearchField label="Search" />
|
|
22
|
+
<SilkeSelectField
|
|
23
|
+
label="Filter"
|
|
24
|
+
items={[
|
|
25
|
+
{ label: "Apple", value: "apple" },
|
|
26
|
+
{ label: "Banana", value: "banana" },
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
<SilkeButton label="New project" kind="primary" />
|
|
30
|
+
</SilkeToolbar>
|
|
18
31
|
```
|
|
19
32
|
|
|
20
33
|
## Small
|
|
21
34
|
|
|
22
35
|
## Large
|
|
36
|
+
|
|
23
37
|
```js
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
<SilkeToolbar size="s">
|
|
39
|
+
<SilkeSearchField label="Search" />
|
|
40
|
+
<SilkeSelectField
|
|
41
|
+
label="Filter"
|
|
42
|
+
items={[
|
|
43
|
+
{ label: "Apple", value: "apple" },
|
|
44
|
+
{ label: "Banana", value: "banana" },
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
<SilkeButton label="New project" kind="primary" />
|
|
48
|
+
</SilkeToolbar>
|
|
29
49
|
```
|
|
@@ -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
|
)}
|