@carbon/styles 0.12.0-rc.0 → 0.14.0-rc.0

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.
Files changed (37) hide show
  1. package/package.json +10 -10
  2. package/scss/_config.scss +6 -0
  3. package/scss/_type.scss +1 -0
  4. package/scss/components/_index.scss +1 -0
  5. package/scss/components/accordion/_accordion.scss +7 -3
  6. package/scss/components/button/_button.scss +4 -3
  7. package/scss/components/button/_mixins.scss +7 -3
  8. package/scss/components/button/_tokens.scss +16 -16
  9. package/scss/components/checkbox/_checkbox.scss +7 -0
  10. package/scss/components/code-snippet/_code-snippet.scss +2 -2
  11. package/scss/components/content-switcher/_content-switcher.scss +28 -1
  12. package/scss/components/data-table/action/_data-table-action.scss +99 -25
  13. package/scss/components/date-picker/_date-picker.scss +1 -1
  14. package/scss/components/date-picker/_flatpickr.scss +1 -0
  15. package/scss/components/dropdown/_dropdown.scss +0 -16
  16. package/scss/components/link/_link.scss +15 -2
  17. package/scss/components/list-box/_list-box.scss +1 -15
  18. package/scss/components/modal/_modal.scss +91 -102
  19. package/scss/components/notification/_inline-notification.scss +3 -0
  20. package/scss/components/notification/_toast-notification.scss +3 -0
  21. package/scss/components/number-input/_number-input.scss +1 -1
  22. package/scss/components/pagination/_pagination.scss +56 -7
  23. package/scss/components/radio-button/_radio-button.scss +3 -2
  24. package/scss/components/select/_select.scss +7 -2
  25. package/scss/components/slider/_slider.scss +1 -1
  26. package/scss/components/tabs/_tabs.scss +21 -0
  27. package/scss/components/tag/_tag.scss +1 -1
  28. package/scss/components/text-area/_text-area.scss +7 -1
  29. package/scss/components/text-input/_text-input.scss +1 -1
  30. package/scss/components/tile/_tile.scss +1 -1
  31. package/scss/components/toggle/_toggle.scss +2 -2
  32. package/scss/components/toggletip/_index.scss +11 -0
  33. package/scss/components/toggletip/_toggletip.scss +81 -0
  34. package/scss/components/tooltip/_index.scss +1 -0
  35. package/scss/components/tooltip/_tooltip.scss +30 -0
  36. package/scss/components/ui-shell/header/_header.scss +2 -0
  37. package/scss/fonts/_src.scss +100 -28
@@ -10,3 +10,4 @@
10
10
 
11
11
  @include tooltip.tooltip;
12
12
  @include tooltip.icon-tooltip;
13
+ @include tooltip.definition-tooltip;
@@ -11,6 +11,8 @@
11
11
  @use '../../type';
12
12
  @use '../../utilities/custom-property';
13
13
  @use '../../utilities/convert';
14
+ @use '../../utilities/button-reset';
15
+ @use '../../utilities/focus-outline';
14
16
 
15
17
  $tooltip-padding-block: custom-property.get-var(
16
18
  'tooltip-padding-block',
@@ -37,6 +39,34 @@ $tooltip-padding-inline: custom-property.get-var(
37
39
  }
38
40
  }
39
41
 
42
+ @mixin definition-tooltip {
43
+ .#{$prefix}--definition-term {
44
+ @include button-reset.reset;
45
+
46
+ border-bottom: 1px dotted theme.$border-strong;
47
+ border-radius: 0;
48
+
49
+ color: theme.$text-primary;
50
+ }
51
+
52
+ .#{$prefix}--definition-term:focus {
53
+ @include focus-outline.focus-outline;
54
+
55
+ border-bottom-color: theme.$border-interactive;
56
+ }
57
+
58
+ .#{$prefix}--definition-term:hover {
59
+ border-bottom-color: theme.$border-interactive;
60
+ }
61
+
62
+ .#{$prefix}--definition-tooltip {
63
+ @include type.type-style('body-long-01');
64
+
65
+ max-width: convert.rem(176px);
66
+ padding: convert.rem(8px) convert.rem(16px);
67
+ }
68
+ }
69
+
40
70
  @mixin icon-tooltip {
41
71
  .#{$prefix}--icon-tooltip {
42
72
  @include custom-property.declaration(
@@ -36,6 +36,7 @@
36
36
  .#{$prefix}--header__action {
37
37
  @include button-reset.reset();
38
38
 
39
+ display: inline-flex;
39
40
  width: mini-units(6);
40
41
  height: mini-units(6);
41
42
  border: rem(2px) solid transparent;
@@ -80,6 +81,7 @@
80
81
  }
81
82
 
82
83
  .#{$prefix}--header__action.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger {
84
+ align-items: center;
83
85
  justify-content: center;
84
86
  }
85
87
 
@@ -21,6 +21,57 @@ $-filenames: (
21
21
  IBM-Plex-Serif: 'IBMPlexSerif',
22
22
  );
23
23
 
24
+ $-google-filenames: (
25
+ IBM-Plex-Mono: (
26
+ name: 'ibmplexmono',
27
+ version: 'v7',
28
+ hash: '-F63fjptAgt5VM-kVkqdyU8n1i8q131nj-otFQ',
29
+ ),
30
+ IBM-Plex-Sans-Arabic: (
31
+ name: 'ibmplexsansarabic',
32
+ version: 'v5',
33
+ hash: 'Qw3CZRtWPQCuHme67tEYUIx3Kh0PHR9N6Ys43PW5fslBEg0',
34
+ ),
35
+ IBM-Plex-Sans-Devanagari: (
36
+ name: 'ibmplexsansdevanagari',
37
+ version: 'v5',
38
+ hash: 'XRXH3JCMvG4IDoS9SubXB6W-UX5iehIMBFR2-O_PX0j1Uc7wCWQq',
39
+ ),
40
+ IBM-Plex-Sans-Hebrew: (
41
+ name: 'ibmplexsanshebrew',
42
+ version: 'v5',
43
+ hash: 'BCa2qYENg9Kw1mpLpO0bGM5lfHAAZHhDXE2v-lgVrjaNzC4',
44
+ ),
45
+ IBM-Plex-Sans-Thai-Looped: (
46
+ name: 'ibmplexsansthailooped',
47
+ version: 'v5',
48
+ hash: 'tss_AoJJRAhL3BTrK3r2xxbFhvKfyBB6l7hHT30L9BiKoXOrFCUb6Q',
49
+ ),
50
+ IBM-Plex-Sans-Thai: (
51
+ name: 'ibmplexsansthai',
52
+ version: 'v5',
53
+ hash: 'm8JPje1VVIzcq1HzJq2AEdo2Tj_qvLqMBNYgR8BKU4cX',
54
+ ),
55
+ IBM-Plex-Sans: (
56
+ name: 'ibmplexsans',
57
+ version: 'v9',
58
+ hash: 'zYXgKVElMYYaJe8bpLHnCwDKhdzeFaxOedfTDw',
59
+ ),
60
+ IBM-Plex-Serif: (
61
+ name: 'ibmplexserif',
62
+ version: 'v10',
63
+ hash: 'jizDREVNn1dOx-zrZ2X3pZvkTiUS2zcZiVbJsNo',
64
+ ),
65
+ );
66
+
67
+ @function -get-google-filename($map, $keys...) {
68
+ @each $key in $keys {
69
+ $map: map-get($map, $key);
70
+ }
71
+
72
+ @return $map;
73
+ }
74
+
24
75
  @function -get-base-filename($name) {
25
76
  @return map.get($-filenames, $name);
26
77
  }
@@ -37,44 +88,65 @@ $-filenames: (
37
88
  /// @param {List} $formats
38
89
  /// @returns List
39
90
  @function -default-resolver($name, $weight, $style, $unicode-range, $formats) {
40
- $filename: -get-base-filename($name);
91
+ @if (config.$use-google-fonts) {
92
+ $filename: -get-google-filename($-google-filenames, $name, 'name');
93
+ $version: -get-google-filename($-google-filenames, $name, 'version');
94
+ $hash: -get-google-filename($-google-filenames, $name, 'hash');
41
95
 
42
- // Special case for weight = Regular (400)
43
- @if $weight == Regular {
44
- @if $style == italic {
45
- $filename: '#{$filename}-Italic';
46
- } @else {
47
- $filename: '#{$filename}-Regular';
96
+ $filenames: ();
97
+
98
+ @each $format in $formats {
99
+ $url: 'https://fonts.gstatic.com/s/#{$filename}/#{$version}/#{$hash}';
100
+
101
+ // Add extension
102
+ $url: '#{$url}.#{$format}';
103
+ $filenames: list.append(
104
+ $filenames,
105
+ url('#{$url}') format('#{$format}'),
106
+ $separator: comma
107
+ );
48
108
  }
109
+
110
+ @return $filenames;
49
111
  } @else {
50
- // Otherwise add weight + optional style (italic)
51
- $filename: '#{$filename}-#{$weight}';
52
- @if $style == italic {
53
- $filename: '#{$filename}Italic';
112
+ $filename: -get-base-filename($name);
113
+
114
+ // Special case for weight = Regular (400)
115
+ @if $weight == Regular {
116
+ @if $style == italic {
117
+ $filename: '#{$filename}-Italic';
118
+ } @else {
119
+ $filename: '#{$filename}-Regular';
120
+ }
121
+ } @else {
122
+ // Otherwise add weight + optional style (italic)
123
+ $filename: '#{$filename}-#{$weight}';
124
+ @if $style == italic {
125
+ $filename: '#{$filename}Italic';
126
+ }
54
127
  }
55
- }
56
128
 
57
- $filenames: ();
129
+ $filenames: ();
58
130
 
59
- @each $format in $formats {
60
- $url: $filename;
131
+ @each $format in $formats {
132
+ $url: $filename;
133
+ @if $unicode-range {
134
+ $url: '#{config.$font-path}/#{$name}/fonts/split/#{$format}/#{$filename}-#{$unicode-range}';
135
+ } @else {
136
+ $url: '#{config.$font-path}/#{$name}/fonts/complete/#{$format}/#{$filename}';
137
+ }
61
138
 
62
- @if $unicode-range {
63
- $url: '#{config.$font-path}/#{$name}/fonts/split/#{$format}/#{$filename}-#{$unicode-range}';
64
- } @else {
65
- $url: '#{config.$font-path}/#{$name}/fonts/complete/#{$format}/#{$filename}';
139
+ // Add extension
140
+ $url: '#{$url}.#{$format}';
141
+ $filenames: list.append(
142
+ $filenames,
143
+ url('#{$url}') format('#{$format}'),
144
+ $separator: comma
145
+ );
66
146
  }
67
147
 
68
- // Add extension
69
- $url: '#{$url}.#{$format}';
70
- $filenames: list.append(
71
- $filenames,
72
- url('#{$url}') format('#{$format}'),
73
- $separator: comma
74
- );
148
+ @return $filenames;
75
149
  }
76
-
77
- @return $filenames;
78
150
  }
79
151
 
80
152
  /// The resolver used for locating the filepaths in `url() format()` values in