@central-design-system/components 3.0.0-beta.11 → 3.0.0-beta.13
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/dist/cds.css +1 -1
- package/dist/cds.es.js +5409 -5350
- package/dist/cds.umd.js +5 -5
- package/dist/components/CdsAutocomplete/CdsAutocomplete.vue.d.ts +24 -9
- package/dist/components/CdsBadge/CdsBadge.vue.d.ts +3 -3
- package/dist/components/CdsButton/CdsButton.vue.d.ts +8 -8
- package/dist/components/CdsCombobox/CdsCombobox.vue.d.ts +38 -13
- package/dist/components/CdsContainer/CdsContainer.vue.d.ts +5 -5
- package/dist/components/CdsDrawer/CdsDrawer.vue.d.ts +4 -4
- package/dist/components/CdsDropdown/CdsDropdown.vue.d.ts +44 -37
- package/dist/components/CdsExpandablePanel/CdsExpandablePanels.vue.d.ts +5 -5
- package/dist/components/CdsFooter/CdsFooter.vue.d.ts +12 -3
- package/dist/components/CdsHeader/CdsHeader.vue.d.ts +12 -3
- package/dist/components/CdsIcon/CdsIcon.vue.d.ts +11 -0
- package/dist/components/CdsList/CdsList.vue.d.ts +12 -3
- package/dist/components/CdsList/CdsListItem.vue.d.ts +1 -1
- package/dist/components/CdsStatus/CdsStatus.vue.d.ts +5 -5
- package/dist/components/CdsTable/utils/index.d.ts +1 -0
- package/dist/components/CdsTable/utils/vnode.d.ts +10 -0
- package/dist/components/CdsTabs/CdsTabs.vue.d.ts +3 -3
- package/dist/components/CdsToolbar/CdsToolbar.vue.d.ts +42 -0
- package/dist/composable/appearance.d.ts +1 -1
- package/dist/composable/index.d.ts +2 -1
- package/dist/composable/invertColor.d.ts +19 -0
- package/dist/composable/layout.d.ts +20 -20
- package/dist/composable/select.d.ts +8 -3
- package/dist/composable/transparent.d.ts +19 -0
- package/dist/utils/colors.d.ts +1 -1
- package/package.json +1 -1
- package/src/scss/modules/grid/_css-grid.scss +12 -19
- package/src/scss/modules/grid/_flex-grid.scss +9 -5
- package/src/scss/modules/grid/_mixins.scss +23 -31
- package/src/scss/themes/index.ts +1 -1
- package/src/scss/utility/index.scss +1 -0
- package/src/scss/utility/typography.scss +63 -0
- package/src/scss/utility/variables/exports/_display.scss +4 -4
- package/src/scss/utility/variables/exports/_typography.scss +22 -0
- package/src/scss/utility/variables/index.scss +1 -0
- package/src/scss/utility/variables/typography.scss +93 -0
- package/dist/composable/dark.d.ts +0 -19
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
/// @access private
|
|
25
25
|
/// @group @cds/grid
|
|
26
26
|
@mixin -make-container($breakpoints: $grid-breakpoints) {
|
|
27
|
-
margin-
|
|
28
|
-
margin-left: auto;
|
|
27
|
+
margin-inline: auto;
|
|
29
28
|
|
|
30
29
|
@include -set-largest-breakpoint($breakpoints);
|
|
31
30
|
|
|
@@ -38,15 +37,13 @@
|
|
|
38
37
|
|
|
39
38
|
@if $prev-margin != $margin {
|
|
40
39
|
@include cds-breakpoint($name) {
|
|
41
|
-
padding-
|
|
42
|
-
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
43
|
-
}
|
|
44
|
-
} @else {
|
|
45
|
-
@include cds-breakpoint($name) {
|
|
46
|
-
padding-right: #{($grid-gutter * 0.5) + $margin};
|
|
47
|
-
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
40
|
+
padding-inline: #{($grid-gutter * 0.5) + $margin};
|
|
48
41
|
}
|
|
49
42
|
}
|
|
43
|
+
} @else {
|
|
44
|
+
@include cds-breakpoint($name) {
|
|
45
|
+
padding-inline: #{($grid-gutter * 0.5) + $margin};
|
|
46
|
+
}
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -57,7 +54,7 @@
|
|
|
57
54
|
/// @group @cds/grid
|
|
58
55
|
@mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
|
|
59
56
|
$largest-breakpoint: -last-map-item($breakpoints);
|
|
60
|
-
max-
|
|
57
|
+
max-inline-size: map.get($largest-breakpoint, 'width');
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
/// Add in the max-widths for each breakpoint to the container
|
|
@@ -67,7 +64,7 @@
|
|
|
67
64
|
@mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
|
|
68
65
|
@each $name, $value in $breakpoints {
|
|
69
66
|
@include cds-breakpoint($name) {
|
|
70
|
-
max-
|
|
67
|
+
max-inline-size: map.get($value, width);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
}
|
|
@@ -88,22 +85,19 @@
|
|
|
88
85
|
// Prevent columns from becoming too narrow when at smaller grid tiers by
|
|
89
86
|
// always setting `width: 100%;`. This works because we use `flex` values
|
|
90
87
|
// later on to override this initial width.
|
|
91
|
-
|
|
92
|
-
padding-
|
|
93
|
-
padding-left: ($gutter * 0.5);
|
|
88
|
+
inline-size: 100%;
|
|
89
|
+
padding-inline: $gutter * 0.5;
|
|
94
90
|
|
|
95
91
|
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each side.
|
|
96
92
|
.#{$prefix}-row-condensed &,
|
|
97
93
|
.#{$prefix}-grid-condensed & {
|
|
98
|
-
padding-
|
|
99
|
-
padding-left: ($condensed-gutter * 0.5);
|
|
94
|
+
padding-inline: $condensed-gutter * 0.5;
|
|
100
95
|
}
|
|
101
96
|
|
|
102
97
|
// For our narrow use-case, our container hangs 16px into the gutter
|
|
103
98
|
.#{$prefix}-row-narrow &,
|
|
104
99
|
.#{$prefix}-grid-narrow & {
|
|
105
|
-
padding-
|
|
106
|
-
padding-left: 0;
|
|
100
|
+
padding-inline: 0 $gutter * 0.5;
|
|
107
101
|
}
|
|
108
102
|
}
|
|
109
103
|
|
|
@@ -122,8 +116,8 @@
|
|
|
122
116
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
123
117
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
124
118
|
// do not appear to require this.
|
|
125
|
-
max-width: math.percentage(math.div($span, $columns));
|
|
126
119
|
flex: 0 0 math.percentage(math.div($span, $columns));
|
|
120
|
+
max-inline-size: math.percentage(math.div($span, $columns));
|
|
127
121
|
}
|
|
128
122
|
}
|
|
129
123
|
|
|
@@ -137,9 +131,9 @@
|
|
|
137
131
|
$offset: math.div($span, $columns);
|
|
138
132
|
|
|
139
133
|
@if $offset == 0 {
|
|
140
|
-
margin-
|
|
134
|
+
margin-inline-start: 0;
|
|
141
135
|
} @else {
|
|
142
|
-
margin-
|
|
136
|
+
margin-inline-start: math.percentage($offset);
|
|
143
137
|
}
|
|
144
138
|
}
|
|
145
139
|
|
|
@@ -181,9 +175,9 @@
|
|
|
181
175
|
// Provide basic `.col-{bp}` classes for equal-width flexbox columns
|
|
182
176
|
.#{$prefix}-col,
|
|
183
177
|
.#{$prefix}-col#{$infix} {
|
|
184
|
-
max-width: 100%;
|
|
185
178
|
flex-basis: 0;
|
|
186
179
|
flex-grow: 1;
|
|
180
|
+
max-inline-size: 100%;
|
|
187
181
|
}
|
|
188
182
|
|
|
189
183
|
.#{$prefix}-col-auto,
|
|
@@ -192,7 +186,7 @@
|
|
|
192
186
|
|
|
193
187
|
// Reset earlier grid tiers
|
|
194
188
|
width: auto;
|
|
195
|
-
max-
|
|
189
|
+
max-inline-size: 100%;
|
|
196
190
|
flex: 0 0 auto;
|
|
197
191
|
}
|
|
198
192
|
|
|
@@ -233,8 +227,7 @@
|
|
|
233
227
|
@mixin -make-row($gutter: $grid-gutter) {
|
|
234
228
|
display: flex;
|
|
235
229
|
flex-wrap: wrap;
|
|
236
|
-
margin-
|
|
237
|
-
margin-left: -1 * $gutter * 0.5;
|
|
230
|
+
margin-inline: -1 * $gutter * 0.5;
|
|
238
231
|
}
|
|
239
232
|
|
|
240
233
|
|
|
@@ -249,18 +242,17 @@
|
|
|
249
242
|
@mixin -no-gutter {
|
|
250
243
|
.#{$prefix}-no-gutter,
|
|
251
244
|
.#{$prefix}-row.#{$prefix}-no-gutter [class*='#{$prefix}-col'] {
|
|
252
|
-
padding-
|
|
253
|
-
padding-left: 0;
|
|
245
|
+
padding-inline: 0;
|
|
254
246
|
}
|
|
255
247
|
|
|
256
248
|
.#{$prefix}-no-gutter--start,
|
|
257
249
|
.#{$prefix}-row.#{$prefix}-no-gutter--start [class*='#{$prefix}-col'] {
|
|
258
|
-
padding-
|
|
250
|
+
padding-inline-start: 0;
|
|
259
251
|
}
|
|
260
252
|
|
|
261
253
|
.#{$prefix}-no-gutter--end,
|
|
262
254
|
.#{$prefix}-row.#{$prefix}-no-gutter--end [class*='#{$prefix}-col'] {
|
|
263
|
-
padding-
|
|
255
|
+
padding-inline-end: 0;
|
|
264
256
|
}
|
|
265
257
|
}
|
|
266
258
|
|
|
@@ -275,11 +267,11 @@
|
|
|
275
267
|
/// @group @carbon/grid
|
|
276
268
|
@mixin -hang($gutter: $grid-gutter) {
|
|
277
269
|
.#{$prefix}-hang--start {
|
|
278
|
-
padding-
|
|
270
|
+
padding-inline-start: $gutter * 0.5;
|
|
279
271
|
}
|
|
280
272
|
|
|
281
273
|
.#{$prefix}-hang--end {
|
|
282
|
-
padding-
|
|
274
|
+
padding-inline-end: $gutter * 0.5;
|
|
283
275
|
}
|
|
284
276
|
}
|
|
285
277
|
|
package/src/scss/themes/index.ts
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@import "./variables";
|
|
2
|
+
|
|
3
|
+
@each $type, $value in $typography {
|
|
4
|
+
.cds-text-#{$type} {
|
|
5
|
+
@each $name, $val in $value {
|
|
6
|
+
@if $name == 'size' {
|
|
7
|
+
font-size: $val !important;
|
|
8
|
+
} @else if $name == 'height' {
|
|
9
|
+
line-height: $val !important;
|
|
10
|
+
} @else if $name == 'weight' {
|
|
11
|
+
font-weight: $val !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
font-family: var(--cds-font-family-sans) !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@each $breakpoint, $map in $grid-breakpoints {
|
|
19
|
+
$breakpoint-width: map-get($map, 'width');
|
|
20
|
+
|
|
21
|
+
@media (min-width: $breakpoint-width) {
|
|
22
|
+
@each $type, $value in $typography {
|
|
23
|
+
.#{$breakpoint}\:cds-text-#{$type} {
|
|
24
|
+
@each $name, $val in $value {
|
|
25
|
+
@if $name == 'size' {
|
|
26
|
+
font-size: $val !important;
|
|
27
|
+
} @else if $name == 'height' {
|
|
28
|
+
line-height: $val !important;
|
|
29
|
+
} @else if $name == 'weight' {
|
|
30
|
+
font-weight: $val !important;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
font-family: var(--cds-font-family-sans) !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@each $key, $value in $typography-properties {
|
|
40
|
+
$prefix: map-get($value, 'name');
|
|
41
|
+
$propertyMap: map-get($value, 'map');
|
|
42
|
+
$cssProperty: map-get($value, 'property');
|
|
43
|
+
|
|
44
|
+
// Без брейкпоинтов
|
|
45
|
+
@each $name, $propValue in $propertyMap {
|
|
46
|
+
.cds-#{$prefix}#{$name} {
|
|
47
|
+
#{$cssProperty}: $propValue !important;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Брейкпоинты
|
|
52
|
+
@each $breakpoint, $map in $grid-breakpoints {
|
|
53
|
+
$width: map-get($map, 'width');
|
|
54
|
+
|
|
55
|
+
@media (min-width: $width) {
|
|
56
|
+
@each $name, $propValue in $propertyMap {
|
|
57
|
+
.#{$breakpoint}\:cds-#{$prefix}#{$name} {
|
|
58
|
+
#{$cssProperty}: $propValue !important;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import "../typography";
|
|
2
|
+
|
|
3
|
+
@each $name, $value in $typography {
|
|
4
|
+
.text-#{$name} {
|
|
5
|
+
font-size: map-get($value, 'size');
|
|
6
|
+
line-height: map-get($value, 'height');
|
|
7
|
+
font-weight: map-get($value, 'weight');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@each $key, $value in $typography-properties {
|
|
12
|
+
$prefix: map-get($value, 'name');
|
|
13
|
+
$propertyMap: map-get($value, 'map');
|
|
14
|
+
$cssProperty: map-get($value, 'property');
|
|
15
|
+
|
|
16
|
+
// Без брейкпоинтов
|
|
17
|
+
@each $name, $propValue in $propertyMap {
|
|
18
|
+
.#{$prefix}#{$name} {
|
|
19
|
+
#{$cssProperty}: $propValue;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
@import "../../mixins/typo";
|
|
2
|
+
|
|
3
|
+
$xs: ('size': var(--cds-font-body-size-xs), 'height': var(--cds-font-height-body), 'weight': var(--cds-font-weight-light));
|
|
4
|
+
$sm: ('size': var(--cds-font-body-size-s), 'height': var(--cds-font-height-body), 'weight': var(--cds-font-weight-light));
|
|
5
|
+
$md: ('size': var(--cds-font-body-size-m), 'height': var(--cds-font-height-body), 'weight': var(--cds-font-weight-light));
|
|
6
|
+
$lg: ('size': var(--cds-font-body-size-l), 'height': var(--cds-font-height-body), 'weight': var(--cds-font-weight-normal));
|
|
7
|
+
$h1: ('size': var(--cds-font-heading-1), 'height': var(--cds-font-height-heading), 'weight': var(--cds-font-weight-light));
|
|
8
|
+
$h2: ('size': var(--cds-font-heading-2), 'height': var(--cds-font-height-heading), 'weight': var(--cds-font-weight-light));
|
|
9
|
+
$h3: ('size': var(--cds-font-heading-3), 'height': var(--cds-font-height-heading), 'weight': var(--cds-font-weight-light));
|
|
10
|
+
$h4: ('size': var(--cds-font-heading-4), 'height': var(--cds-font-height-heading), 'weight': var(--cds-font-weight-bold));
|
|
11
|
+
$h5: ('size': var(--cds-font-heading-5), 'height': var(--cds-font-height-heading), 'weight': var(--cds-font-weight-bold));
|
|
12
|
+
$h6: ('size': var(--cds-font-heading-6), 'height': var(--cds-font-height-heading), 'weight': var(--cds-font-weight-bold));
|
|
13
|
+
$display1: ('size': var(--cds-font-display-1), 'height': var(--cds-font-height-display), 'weight': var(--cds-font-weight-bold));
|
|
14
|
+
$display2: ('size': var(--cds-font-display-2), 'height': var(--cds-font-height-display), 'weight': var(--cds-font-weight-bold));
|
|
15
|
+
|
|
16
|
+
$typography: (
|
|
17
|
+
'h1': $h1,
|
|
18
|
+
'h2': $h2,
|
|
19
|
+
'h3': $h3,
|
|
20
|
+
'h4': $h4,
|
|
21
|
+
'h5': $h5,
|
|
22
|
+
'h6': $h6,
|
|
23
|
+
'xs': $xs,
|
|
24
|
+
'sm': $sm,
|
|
25
|
+
'md': $md,
|
|
26
|
+
'lg': $lg,
|
|
27
|
+
'display-1': $display1,
|
|
28
|
+
'display-2': $display2
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
$font-weight: (
|
|
32
|
+
'normal': normal,
|
|
33
|
+
'bold': bold,
|
|
34
|
+
'100': 100,
|
|
35
|
+
'200': 200,
|
|
36
|
+
'300': 300,
|
|
37
|
+
'400': 400,
|
|
38
|
+
'500': 500,
|
|
39
|
+
'600': 600,
|
|
40
|
+
'700': 700,
|
|
41
|
+
'800': 800,
|
|
42
|
+
'900': 900
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
$font-style: (
|
|
46
|
+
'normal': normal,
|
|
47
|
+
'italic': italic,
|
|
48
|
+
'oblique': oblique
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
$text-align: (
|
|
52
|
+
'left': left,
|
|
53
|
+
'right': right,
|
|
54
|
+
'center': center,
|
|
55
|
+
'justify': justify
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
$text-decoration: (
|
|
59
|
+
'none': none,
|
|
60
|
+
'underline': underline,
|
|
61
|
+
'overline': overline,
|
|
62
|
+
'line-through': line-through
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
$text-transform: (
|
|
66
|
+
'none': none,
|
|
67
|
+
'capitalize': capitalize,
|
|
68
|
+
'uppercase': uppercase,
|
|
69
|
+
'lowercase': lowercase
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
$line-height: (
|
|
73
|
+
'normal': normal,
|
|
74
|
+
'1': 1,
|
|
75
|
+
'2': 2
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
$letter-spacing: (
|
|
79
|
+
'normal': normal,
|
|
80
|
+
'tight': -0.05em,
|
|
81
|
+
0: 0,
|
|
82
|
+
'wide': 0.05em
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
$typography-properties: (
|
|
86
|
+
'weight': ('name': 'font-weight-', 'map': $font-weight, 'property': 'font-weight'),
|
|
87
|
+
'style': ('name': 'font-style-', 'map': $font-style, 'property': 'font-style'),
|
|
88
|
+
'align': ('name': 'align-', 'map': $text-align, 'property': 'text-align'),
|
|
89
|
+
'decoration': ('name': 'text-decoration-', 'map': $text-decoration, 'property': 'text-decoration'),
|
|
90
|
+
'transform': ('name': 'text-transform-', 'map': $text-transform, 'property': 'text-transform'),
|
|
91
|
+
'line-height': ('name': 'line-height-', 'map': $line-height, 'property': 'line-height'),
|
|
92
|
+
'letter-spacing': ('name': 'letter-spacing-', 'map': $letter-spacing, 'property': 'letter-spacing'),
|
|
93
|
+
);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ComputedRef, PropType } from 'vue';
|
|
2
|
-
export interface IDarkProps {
|
|
3
|
-
dark: boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface IUseDark {
|
|
6
|
-
darkClasses: ComputedRef<string | undefined>;
|
|
7
|
-
}
|
|
8
|
-
export declare const makeDarkProps: <Defaults extends {
|
|
9
|
-
dark?: unknown;
|
|
10
|
-
} = {}>(defaults?: Defaults | undefined) => import('../utils').AppendDefault<{
|
|
11
|
-
/**
|
|
12
|
-
* Темная тема
|
|
13
|
-
*/
|
|
14
|
-
dark: {
|
|
15
|
-
type: PropType<boolean>;
|
|
16
|
-
default: boolean;
|
|
17
|
-
};
|
|
18
|
-
}, Defaults>;
|
|
19
|
-
export declare function useDark(props: IDarkProps, name: string): IUseDark;
|