carbon-components-svelte 0.97.0 → 0.98.1
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/css/_contained-list.scss +311 -0
- package/css/_slider.scss +35 -0
- package/css/all.css +1 -1
- package/css/all.scss +1 -0
- package/css/g10.css +1 -1
- package/css/g10.scss +1 -0
- package/css/g100.css +1 -1
- package/css/g100.scss +1 -0
- package/css/g80.css +1 -1
- package/css/g80.scss +1 -0
- package/css/g90.css +1 -1
- package/css/g90.scss +1 -0
- package/css/white.css +1 -1
- package/css/white.scss +1 -0
- package/package.json +1 -1
- package/src/Checkbox/Checkbox.svelte +16 -2
- package/src/ComboBox/ComboBox.svelte +9 -3
- package/src/ContainedList/ContainedList.svelte +69 -0
- package/src/ContainedList/ContainedListItem.svelte +50 -0
- package/src/ContainedList/index.js +2 -0
- package/src/ContentSwitcher/ContentSwitcher.svelte +15 -3
- package/src/ContentSwitcher/Switch.svelte +1 -7
- package/src/DataTable/DataTable.svelte +9 -42
- package/src/DataTable/DataTableTypes.d.ts +2 -2
- package/src/DataTable/ToolbarSearch.svelte +2 -1
- package/src/DataTable/data-table-utils.d.ts +54 -0
- package/src/DataTable/data-table-utils.js +239 -0
- package/src/FileUploader/FileUploader.svelte +21 -2
- package/src/Heading/Heading.svelte +41 -0
- package/src/Heading/Section.svelte +86 -0
- package/src/Heading/index.js +2 -0
- package/src/Slider/Slider.svelte +64 -27
- package/src/StructuredList/StructuredList.svelte +10 -1
- package/src/Tile/RadioTile.svelte +16 -1
- package/src/Tooltip/Tooltip.svelte +8 -1
- package/src/TreeView/TreeView.svelte +108 -65
- package/src/index.js +3 -0
- package/types/ComboBox/ComboBox.svelte.d.ts +1 -1
- package/types/ContainedList/ContainedList.svelte.d.ts +44 -0
- package/types/ContainedList/ContainedListItem.svelte.d.ts +28 -0
- package/types/ContentSwitcher/ContentSwitcher.svelte.d.ts +1 -1
- package/types/DataTable/DataTableTypes.d.ts +2 -2
- package/types/DataTable/data-table-utils.d.ts +54 -0
- package/types/FileUploader/FileUploader.svelte.d.ts +13 -0
- package/types/Heading/Heading.svelte.d.ts +11 -0
- package/types/Heading/Section.svelte.d.ts +54 -0
- package/types/Slider/Slider.svelte.d.ts +12 -0
- package/types/index.d.ts +4 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// This file adds contained list styles from carbon-components v11+
|
|
2
|
+
// to ensure compatibility with carbon-components v10.58.12.
|
|
3
|
+
// The ContainedList component provides a structured list with header and items.
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
// Copyright IBM Corp. 2022, 2024
|
|
7
|
+
//
|
|
8
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
9
|
+
// LICENSE file in the root directory of this source tree.
|
|
10
|
+
//
|
|
11
|
+
|
|
12
|
+
@import 'carbon-components/scss/globals/scss/vars';
|
|
13
|
+
@import 'carbon-components/scss/globals/scss/helper-mixins';
|
|
14
|
+
@import 'carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
|
|
15
|
+
|
|
16
|
+
/// Contained List styles
|
|
17
|
+
/// @access private
|
|
18
|
+
/// @group contained-list
|
|
19
|
+
@mixin contained-list {
|
|
20
|
+
// Tag within contained list
|
|
21
|
+
.#{$prefix}--contained-list .#{$prefix}--tag {
|
|
22
|
+
// Tag size adjustments for contained list context
|
|
23
|
+
height: 1.5rem; // 24px equivalent to md size
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// List container
|
|
27
|
+
.#{$prefix}--contained-list > ul {
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Header
|
|
33
|
+
.#{$prefix}--contained-list__header {
|
|
34
|
+
position: sticky;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
top: 0;
|
|
39
|
+
padding-left: $spacing-05;
|
|
40
|
+
padding-right: $spacing-05;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.#{$prefix}--contained-list__label {
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Search within contained list
|
|
48
|
+
.#{$prefix}--contained-list .#{$prefix}--search {
|
|
49
|
+
position: sticky;
|
|
50
|
+
z-index: 1;
|
|
51
|
+
|
|
52
|
+
&.#{$prefix}--search--expandable .#{$prefix}--search-input {
|
|
53
|
+
background-color: $field-01;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Search top offset for disclosed variant (fixed height)
|
|
58
|
+
.#{$prefix}--contained-list--disclosed .#{$prefix}--search {
|
|
59
|
+
top: 2rem; // Fixed header height for disclosed variant
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Search top offset for on-page variant (size-dependent)
|
|
63
|
+
.#{$prefix}--contained-list--on-page .#{$prefix}--search {
|
|
64
|
+
top: 3rem; // Default md size header height
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--sm
|
|
68
|
+
.#{$prefix}--search {
|
|
69
|
+
top: 2rem; // sm size header height
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--lg
|
|
73
|
+
.#{$prefix}--search {
|
|
74
|
+
top: 4rem; // lg size header height
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--xl
|
|
78
|
+
.#{$prefix}--search {
|
|
79
|
+
top: 4.5rem; // xl size header height
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Omit search input background when used inside contained list
|
|
83
|
+
.#{$prefix}--contained-list .#{$prefix}--search .#{$prefix}--search-input {
|
|
84
|
+
background-color: $ui-background;
|
|
85
|
+
border-bottom: 1px solid $ui-03;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.#{$prefix}--contained-list
|
|
89
|
+
.#{$prefix}--search
|
|
90
|
+
.#{$prefix}--search-close::before {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.#{$prefix}--contained-list .#{$prefix}--search .#{$prefix}--search-close {
|
|
95
|
+
border-right: 2px solid transparent;
|
|
96
|
+
outline: none;
|
|
97
|
+
|
|
98
|
+
&:focus {
|
|
99
|
+
@include focus-outline('outline');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.#{$prefix}--contained-list
|
|
104
|
+
.#{$prefix}--search
|
|
105
|
+
.#{$prefix}--search-input
|
|
106
|
+
~ .#{$prefix}--search-close:hover {
|
|
107
|
+
border-bottom: 1px solid transparent;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.#{$prefix}--contained-list
|
|
111
|
+
.#{$prefix}--search
|
|
112
|
+
.#{$prefix}--search-input:focus
|
|
113
|
+
~ .#{$prefix}--search-close:hover {
|
|
114
|
+
border: 2px solid $focus;
|
|
115
|
+
border-left: 0;
|
|
116
|
+
outline: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// "On Page" variant
|
|
120
|
+
.#{$prefix}--contained-list--on-page + .#{$prefix}--contained-list--on-page {
|
|
121
|
+
margin-top: $spacing-05;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.#{$prefix}--contained-list--on-page .#{$prefix}--contained-list__header {
|
|
125
|
+
@include type-style('heading-01');
|
|
126
|
+
|
|
127
|
+
background-color: $ui-background;
|
|
128
|
+
height: 3rem;
|
|
129
|
+
border-bottom: 1px solid $ui-03;
|
|
130
|
+
color: $text-01;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Size variants for on-page header
|
|
134
|
+
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--sm
|
|
135
|
+
.#{$prefix}--contained-list__header {
|
|
136
|
+
height: 2rem;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--lg
|
|
140
|
+
.#{$prefix}--contained-list__header {
|
|
141
|
+
height: 4rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--xl
|
|
145
|
+
.#{$prefix}--contained-list__header {
|
|
146
|
+
height: 4.5rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// "Disclosed" variant
|
|
150
|
+
.#{$prefix}--contained-list--disclosed .#{$prefix}--contained-list__header {
|
|
151
|
+
@include type-style('label-01');
|
|
152
|
+
|
|
153
|
+
background-color: $ui-01;
|
|
154
|
+
height: 2rem;
|
|
155
|
+
color: $text-02;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// List item
|
|
159
|
+
.#{$prefix}--contained-list-item {
|
|
160
|
+
position: relative;
|
|
161
|
+
display: list-item;
|
|
162
|
+
list-style: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.#{$prefix}--contained-list-item:not(:first-of-type) {
|
|
166
|
+
margin-top: -1px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.#{$prefix}--contained-list-item__content {
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.#{$prefix}--contained-list-item--clickable
|
|
174
|
+
.#{$prefix}--contained-list-item__content {
|
|
175
|
+
@include button-reset;
|
|
176
|
+
|
|
177
|
+
text-align: left;
|
|
178
|
+
transition: background-color 150ms;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.#{$prefix}--contained-list-item__content,
|
|
182
|
+
.#{$prefix}--contained-list-item--clickable
|
|
183
|
+
.#{$prefix}--contained-list-item__content {
|
|
184
|
+
@include type-style('body-short-01');
|
|
185
|
+
|
|
186
|
+
// Calculate padding based on line-height
|
|
187
|
+
// body-short-01 line-height is typically 1.25rem (20px)
|
|
188
|
+
// Height is 3rem (48px) for md size, so padding = (48px - 20px) / 2 = 14px
|
|
189
|
+
padding: 0.875rem $spacing-05; // 14px vertical, 16px horizontal
|
|
190
|
+
color: $text-01;
|
|
191
|
+
min-height: 3rem; // md size default
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Size variants for list items
|
|
195
|
+
.#{$prefix}--contained-list--sm
|
|
196
|
+
.#{$prefix}--contained-list-item__content,
|
|
197
|
+
.#{$prefix}--contained-list--sm
|
|
198
|
+
.#{$prefix}--contained-list-item--clickable
|
|
199
|
+
.#{$prefix}--contained-list-item__content {
|
|
200
|
+
min-height: 2rem; // 32px
|
|
201
|
+
padding-top: 0.375rem; // (32px - 20px) / 2 = 6px
|
|
202
|
+
padding-bottom: 0.375rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.#{$prefix}--contained-list--lg
|
|
206
|
+
.#{$prefix}--contained-list-item__content,
|
|
207
|
+
.#{$prefix}--contained-list--lg
|
|
208
|
+
.#{$prefix}--contained-list-item--clickable
|
|
209
|
+
.#{$prefix}--contained-list-item__content {
|
|
210
|
+
min-height: 4rem; // 64px
|
|
211
|
+
padding-top: 1.375rem; // (64px - 20px) / 2 = 22px
|
|
212
|
+
padding-bottom: 1.375rem;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.#{$prefix}--contained-list--xl
|
|
216
|
+
.#{$prefix}--contained-list-item__content,
|
|
217
|
+
.#{$prefix}--contained-list--xl
|
|
218
|
+
.#{$prefix}--contained-list-item--clickable
|
|
219
|
+
.#{$prefix}--contained-list-item__content {
|
|
220
|
+
min-height: 4.5rem; // 72px
|
|
221
|
+
padding-top: 1.625rem; // (72px - 20px) / 2 = 26px
|
|
222
|
+
padding-bottom: 1.625rem;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.#{$prefix}--contained-list-item:not(:last-of-type)::before {
|
|
226
|
+
position: absolute;
|
|
227
|
+
background-color: $ui-03;
|
|
228
|
+
height: 1px;
|
|
229
|
+
content: '';
|
|
230
|
+
bottom: 0;
|
|
231
|
+
left: 0;
|
|
232
|
+
right: 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.#{$prefix}--contained-list--inset-rulers
|
|
236
|
+
.#{$prefix}--contained-list-item:not(:last-of-type)::before {
|
|
237
|
+
left: $spacing-05;
|
|
238
|
+
right: $spacing-05;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.#{$prefix}--contained-list-item--clickable
|
|
242
|
+
.#{$prefix}--contained-list-item__content:not(:disabled):hover {
|
|
243
|
+
background-color: $hover-ui;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.#{$prefix}--contained-list-item--clickable
|
|
247
|
+
.#{$prefix}--contained-list-item__content:not(:disabled):active {
|
|
248
|
+
background-color: $active-ui;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.#{$prefix}--contained-list-item--clickable
|
|
252
|
+
.#{$prefix}--contained-list-item__content:disabled {
|
|
253
|
+
color: $disabled-02;
|
|
254
|
+
cursor: not-allowed;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.#{$prefix}--contained-list-item--clickable
|
|
258
|
+
.#{$prefix}--contained-list-item__content:focus {
|
|
259
|
+
outline: none;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.#{$prefix}--contained-list-item--clickable
|
|
263
|
+
.#{$prefix}--contained-list-item__content:focus::after {
|
|
264
|
+
@include focus-outline('outline');
|
|
265
|
+
|
|
266
|
+
position: absolute;
|
|
267
|
+
content: '';
|
|
268
|
+
top: 0;
|
|
269
|
+
left: 0;
|
|
270
|
+
right: 0;
|
|
271
|
+
bottom: 0;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.#{$prefix}--contained-list-item--with-action
|
|
275
|
+
.#{$prefix}--contained-list-item__content {
|
|
276
|
+
padding-right: $spacing-10;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.#{$prefix}--contained-list__action,
|
|
280
|
+
.#{$prefix}--contained-list-item__action {
|
|
281
|
+
position: absolute;
|
|
282
|
+
display: flex;
|
|
283
|
+
justify-content: flex-end;
|
|
284
|
+
top: 0;
|
|
285
|
+
left: 0;
|
|
286
|
+
right: 0;
|
|
287
|
+
pointer-events: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.#{$prefix}--contained-list__action > *,
|
|
291
|
+
.#{$prefix}--contained-list-item__action > * {
|
|
292
|
+
pointer-events: all;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.#{$prefix}--contained-list-item--with-icon
|
|
296
|
+
.#{$prefix}--contained-list-item__content {
|
|
297
|
+
display: grid;
|
|
298
|
+
column-gap: $spacing-04;
|
|
299
|
+
grid-template-columns: 1rem 1fr;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.#{$prefix}--contained-list-item__icon {
|
|
303
|
+
display: inline-flex;
|
|
304
|
+
padding-top: $spacing-01;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@include exports('contained-list') {
|
|
309
|
+
@include contained-list;
|
|
310
|
+
}
|
|
311
|
+
|
package/css/_slider.scss
CHANGED
|
@@ -17,6 +17,41 @@
|
|
|
17
17
|
/// @access private
|
|
18
18
|
/// @group slider
|
|
19
19
|
@mixin slider-validation {
|
|
20
|
+
//----------------------------------------------
|
|
21
|
+
// Input wrapper and icons
|
|
22
|
+
// ---------------------------------------------
|
|
23
|
+
.#{$prefix}--slider-text-input-wrapper {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-block;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.#{$prefix}--slider-text-input-wrapper
|
|
29
|
+
.#{$prefix}--slider-text-input.#{$prefix}--text-input--invalid,
|
|
30
|
+
.#{$prefix}--slider-text-input-wrapper
|
|
31
|
+
.#{$prefix}--slider-text-input--warn {
|
|
32
|
+
width: 6rem;
|
|
33
|
+
padding-right: 3rem;
|
|
34
|
+
text-align: left;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.#{$prefix}--slider__invalid-icon {
|
|
38
|
+
position: absolute;
|
|
39
|
+
fill: $support-error;
|
|
40
|
+
// top/transform used to center invalid icon in IE11
|
|
41
|
+
top: 50%;
|
|
42
|
+
right: $spacing-05;
|
|
43
|
+
transform: translateY(-50%);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.#{$prefix}--slider__invalid-icon.#{$prefix}--slider__invalid-icon--warning {
|
|
47
|
+
fill: $support-warning;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.#{$prefix}--slider__invalid-icon--warning path[data-icon-path="inner-path"] {
|
|
51
|
+
fill: $inverse-01;
|
|
52
|
+
opacity: 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
20
55
|
//----------------------------------------------
|
|
21
56
|
// Validation message
|
|
22
57
|
// ---------------------------------------------
|