@carbon/element-styles 0.3.6 → 0.3.7-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 (91) hide show
  1. package/README.md +51 -33
  2. package/css/prebuilt/editorial.css +1 -1
  3. package/css/prebuilt/expressive.css +2 -2
  4. package/css/prebuilt/productive.css +2 -2
  5. package/index.scss +2 -2
  6. package/package.json +30 -16
  7. package/scss/_config.scss +1 -1
  8. package/scss/elements/_heading/index.scss +3 -3
  9. package/scss/elements/_input/index.scss +11 -11
  10. package/scss/elements/_labelled-input/index.scss +41 -39
  11. package/scss/elements/_layer/index.scss +29 -17
  12. package/scss/elements/abbreviation/index.scss +5 -5
  13. package/scss/elements/address/index.scss +5 -5
  14. package/scss/elements/anchor/index.scss +10 -10
  15. package/scss/elements/block-quotation/index.scss +7 -7
  16. package/scss/elements/body/index.scss +6 -6
  17. package/scss/elements/bold-text/index.scss +4 -4
  18. package/scss/elements/button/index.scss +19 -19
  19. package/scss/elements/checkbox/index.scss +16 -14
  20. package/scss/elements/code/index.scss +6 -6
  21. package/scss/elements/color-input/index.scss +24 -27
  22. package/scss/elements/combo-box/index.scss +22 -20
  23. package/scss/elements/date-input/index.scss +18 -16
  24. package/scss/elements/date-time-input/index.scss +18 -16
  25. package/scss/elements/deleted-text/index.scss +6 -6
  26. package/scss/elements/description-list/index.scss +5 -5
  27. package/scss/elements/details/index.scss +12 -11
  28. package/scss/elements/dialog/index.scss +63 -49
  29. package/scss/elements/email-input/index.scss +17 -15
  30. package/scss/elements/fieldset/index.scss +11 -9
  31. package/scss/elements/file-input/index.scss +10 -9
  32. package/scss/elements/footer/index.scss +6 -6
  33. package/scss/elements/header-navigation/index.scss +11 -11
  34. package/scss/elements/heading-level-1/index.scss +5 -5
  35. package/scss/elements/heading-level-2/index.scss +5 -5
  36. package/scss/elements/heading-level-3/index.scss +5 -5
  37. package/scss/elements/heading-level-4/index.scss +5 -5
  38. package/scss/elements/heading-level-5/index.scss +5 -5
  39. package/scss/elements/heading-level-6/index.scss +5 -5
  40. package/scss/elements/horizontal-rule/index.scss +8 -8
  41. package/scss/elements/image/index.scss +3 -3
  42. package/scss/elements/inline-loading/index.scss +11 -12
  43. package/scss/elements/inline-quotation/index.scss +4 -4
  44. package/scss/elements/inserted-text/index.scss +6 -6
  45. package/scss/elements/italic-text/index.scss +4 -4
  46. package/scss/elements/keyboard-input/index.scss +6 -6
  47. package/scss/elements/label/index.scss +9 -9
  48. package/scss/elements/main/index.scss +6 -6
  49. package/scss/elements/marked-text/index.scss +7 -7
  50. package/scss/elements/menu/index.scss +13 -12
  51. package/scss/elements/number-input/index.scss +15 -13
  52. package/scss/elements/ordered-list/index.scss +5 -5
  53. package/scss/elements/paragraph/index.scss +4 -4
  54. package/scss/elements/password-input/index.scss +16 -14
  55. package/scss/elements/popover/index.scss +32 -37
  56. package/scss/elements/preformatted/index.scss +5 -5
  57. package/scss/elements/progress-bar/index.scss +20 -18
  58. package/scss/elements/radio-button/index.scss +14 -12
  59. package/scss/elements/range-input/index.scss +13 -11
  60. package/scss/elements/search-input/index.scss +18 -16
  61. package/scss/elements/select/index.scss +24 -22
  62. package/scss/elements/side-navigation/index.scss +11 -11
  63. package/scss/elements/small-text/index.scss +5 -5
  64. package/scss/elements/table/index.scss +16 -12
  65. package/scss/elements/tabs/index.scss +20 -16
  66. package/scss/elements/telephone-number-input/index.scss +17 -15
  67. package/scss/elements/text-area/index.scss +20 -16
  68. package/scss/elements/text-input/index.scss +17 -15
  69. package/scss/elements/tile/index.scss +14 -13
  70. package/scss/elements/time-input/index.scss +18 -16
  71. package/scss/elements/toggle/index.scss +20 -16
  72. package/scss/elements/tooltip/index.scss +13 -11
  73. package/scss/elements/tree-view/index.scss +11 -11
  74. package/scss/elements/unordered-list/index.scss +7 -7
  75. package/scss/elements/url-input/index.scss +17 -15
  76. package/scss/layout/_density.scss +6 -6
  77. package/scss/layout/_mode.scss +269 -161
  78. package/scss/layout/_size.scss +16 -10
  79. package/scss/layout/index.scss +3 -3
  80. package/scss/prebuilt/editorial/_elements.scss +34 -32
  81. package/scss/prebuilt/editorial/_layout.scss +4 -4
  82. package/scss/prebuilt/editorial/index.scss +9 -9
  83. package/scss/prebuilt/expressive/_elements.scss +74 -70
  84. package/scss/prebuilt/expressive/_layout.scss +4 -4
  85. package/scss/prebuilt/expressive/index.scss +9 -9
  86. package/scss/prebuilt/productive/_elements.scss +69 -67
  87. package/scss/prebuilt/productive/_layout.scss +4 -4
  88. package/scss/prebuilt/productive/index.scss +9 -9
  89. package/scss/utilities/_carbon.scss +28 -25
  90. package/scss/utilities/_icons.scss +1 -1
  91. package/scss/utilities/_tokens.scss +5 -5
@@ -5,12 +5,12 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
10
  $config: () !default;
11
11
 
12
12
  $-default-config: (
13
- selector: 'img, picture',
13
+ selector: "img, picture",
14
14
  );
15
15
 
16
16
  /// @group image
@@ -19,7 +19,7 @@ $-default-config: (
19
19
  @mixin styles($config: $config) {
20
20
  $props: map.deep-merge($-default-config, $config);
21
21
 
22
- #{map.get($props, 'selector')} {
22
+ #{map.get($props, "selector")} {
23
23
  max-inline-size: 100%;
24
24
  }
25
25
  }
@@ -5,16 +5,16 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/config' as carbon-config;
11
- @use '@carbon/styles/scss/theme';
12
- @use '@carbon/styles/scss/spacing';
13
- @use '@carbon/styles/scss/motion';
10
+ @use "@carbon/styles/scss/config" as carbon-config;
11
+ @use "@carbon/styles/scss/theme";
12
+ @use "@carbon/styles/scss/spacing";
13
+ @use "@carbon/styles/scss/motion";
14
14
 
15
- @use '../../config';
16
- @use '../../layout';
17
- @use '../../utilities/guards';
15
+ @use "../../config";
16
+ @use "../../layout";
17
+ @use "../../utilities/guards";
18
18
 
19
19
  $config: () !default;
20
20
 
@@ -31,14 +31,13 @@ $-stroke-width: 0.125rem;
31
31
  @mixin styles($config: $config) {
32
32
  $props: map.deep-merge($-default-config, $config);
33
33
 
34
- #{map.get($props, 'selector')} {
35
-
34
+ #{map.get($props, "selector")} {
36
35
  display: flex;
37
36
  align-items: center;
38
37
  column-gap: spacing.$spacing-03;
39
38
 
40
39
  &::before {
41
- content: '';
40
+ content: "";
42
41
  display: inline-block;
43
42
  block-size: calc($-size - $-stroke-width * 2);
44
43
  inline-size: calc($-size - $-stroke-width * 2);
@@ -58,7 +57,7 @@ $-stroke-width: 0.125rem;
58
57
 
59
58
  &::after {
60
59
  @include layout.mode--body-compact;
61
- content: 'Loading';
60
+ content: "Loading";
62
61
  color: theme.$text-secondary;
63
62
  }
64
63
 
@@ -5,14 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '../../layout';
10
+ @use "../../layout";
11
11
 
12
12
  $config: () !default;
13
13
 
14
14
  $-default-config: (
15
- selector: 'q',
15
+ selector: "q",
16
16
  );
17
17
 
18
18
  /// @group inline-quotation
@@ -21,7 +21,7 @@ $-default-config: (
21
21
  @mixin styles($config: $config) {
22
22
  $props: map.deep-merge($-default-config, $config);
23
23
 
24
- #{map.get($props, 'selector')} {
24
+ #{map.get($props, "selector")} {
25
25
  quotes: auto;
26
26
  font-style: italic;
27
27
  }
@@ -5,17 +5,17 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/spacing';
11
- @use '@carbon/styles/scss/components/tag/tokens' as tag-tokens;
10
+ @use "@carbon/styles/scss/spacing";
11
+ @use "@carbon/styles/scss/components/tag/tokens" as tag-tokens;
12
12
 
13
- @use '../../layout';
13
+ @use "../../layout";
14
14
 
15
15
  $config: () !default;
16
16
 
17
17
  $-default-config: (
18
- selector: 'ins',
18
+ selector: "ins",
19
19
  );
20
20
 
21
21
  /// @group inserted-text
@@ -24,7 +24,7 @@ $-default-config: (
24
24
  @mixin styles($config: $config) {
25
25
  $props: map.deep-merge($-default-config, $config);
26
26
 
27
- #{map.get($props, 'selector')} {
27
+ #{map.get($props, "selector")} {
28
28
  padding-inline: spacing.$spacing-01;
29
29
  background-color: tag-tokens.$tag-background-green;
30
30
  color: tag-tokens.$tag-color-green;
@@ -5,14 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '../../layout';
10
+ @use "../../layout";
11
11
 
12
12
  $config: () !default;
13
13
 
14
14
  $-default-config: (
15
- selector: 'i, em',
15
+ selector: "i, em",
16
16
  );
17
17
 
18
18
  /// @group italic-text
@@ -21,7 +21,7 @@ $-default-config: (
21
21
  @mixin styles($config: $config) {
22
22
  $props: map.deep-merge($-default-config, $config);
23
23
 
24
- #{map.get($props, 'selector')} {
24
+ #{map.get($props, "selector")} {
25
25
  font-style: italic;
26
26
  }
27
27
  }
@@ -5,17 +5,17 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/theme';
11
- @use '@carbon/styles/scss/spacing';
10
+ @use "@carbon/styles/scss/theme";
11
+ @use "@carbon/styles/scss/spacing";
12
12
 
13
- @use '../../layout';
13
+ @use "../../layout";
14
14
 
15
15
  $config: () !default;
16
16
 
17
17
  $-default-config: (
18
- selector: 'kbd',
18
+ selector: "kbd",
19
19
  );
20
20
 
21
21
  /// @group keyboard-input
@@ -24,7 +24,7 @@ $-default-config: (
24
24
  @mixin styles($config: $config) {
25
25
  $props: map.deep-merge($-default-config, $config);
26
26
 
27
- #{map.get($props, 'selector')} {
27
+ #{map.get($props, "selector")} {
28
28
  @include layout.mode--code;
29
29
  background-color: transparent;
30
30
  outline: 0.0625rem solid theme.$border-subtle;
@@ -5,18 +5,18 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/theme';
11
- @use '@carbon/styles/scss/spacing';
10
+ @use "@carbon/styles/scss/theme";
11
+ @use "@carbon/styles/scss/spacing";
12
12
 
13
- @use '../../layout';
13
+ @use "../../layout";
14
14
 
15
15
  $config: () !default;
16
16
 
17
17
  $-default-config: (
18
- selector: 'label',
19
- axis: 'block',
18
+ selector: "label",
19
+ axis: "block",
20
20
  );
21
21
 
22
22
  /// @group label
@@ -26,7 +26,7 @@ $-default-config: (
26
26
  @mixin styles($config: $config) {
27
27
  $props: map.deep-merge($-default-config, $config);
28
28
 
29
- #{map.get($props, 'selector')} {
29
+ #{map.get($props, "selector")} {
30
30
  display: grid;
31
31
  gap: spacing.$spacing-03;
32
32
  color: theme.$text-secondary;
@@ -35,13 +35,13 @@ $-default-config: (
35
35
  color: theme.$text-disabled;
36
36
  }
37
37
 
38
- @if map.get($props, 'axis') == 'block' {
38
+ @if map.get($props, "axis") == "block" {
39
39
  @include layout.mode--label;
40
40
  // flex-direction: column;
41
41
  grid-auto-flow: row;
42
42
  }
43
43
 
44
- @if map.get($props, 'axis') == 'inline' {
44
+ @if map.get($props, "axis") == "inline" {
45
45
  @include layout.mode--body-compact;
46
46
  // flex-direction: row;
47
47
  grid-auto-flow: column;
@@ -5,17 +5,17 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/theme';
11
- @use '@carbon/styles/scss/spacing';
10
+ @use "@carbon/styles/scss/theme";
11
+ @use "@carbon/styles/scss/spacing";
12
12
 
13
- @use '../../layout';
13
+ @use "../../layout";
14
14
 
15
15
  $config: () !default;
16
16
 
17
17
  $-default-config: (
18
- selector: 'main',
18
+ selector: "main",
19
19
  );
20
20
 
21
21
  /// @group main
@@ -24,7 +24,7 @@ $-default-config: (
24
24
  @mixin styles($config: $config) {
25
25
  $props: map.deep-merge($-default-config, $config);
26
26
 
27
- #{map.get($props, 'selector')} {
27
+ #{map.get($props, "selector")} {
28
28
  padding-inline: spacing.$spacing-07;
29
29
  padding-block-start: spacing.$spacing-07;
30
30
  padding-block-end: spacing.$spacing-10;
@@ -5,18 +5,18 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/spacing';
11
- @use '@carbon/styles/scss/colors';
12
- @use '@carbon/styles/scss/theme';
10
+ @use "@carbon/styles/scss/spacing";
11
+ @use "@carbon/styles/scss/colors";
12
+ @use "@carbon/styles/scss/theme";
13
13
 
14
- @use '../../layout';
14
+ @use "../../layout";
15
15
 
16
16
  $config: () !default;
17
17
 
18
18
  $-default-config: (
19
- selector: 'mark',
19
+ selector: "mark",
20
20
  );
21
21
 
22
22
  /// @group marked-text
@@ -25,7 +25,7 @@ $-default-config: (
25
25
  @mixin styles($config: $config) {
26
26
  $props: map.deep-merge($-default-config, $config);
27
27
 
28
- #{map.get($props, 'selector')} {
28
+ #{map.get($props, "selector")} {
29
29
  padding-inline: spacing.$spacing-01;
30
30
  background-color: colors.$yellow-20;
31
31
  color: colors.$black;
@@ -5,16 +5,16 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/theme';
11
- @use '@carbon/styles/scss/spacing';
12
- @use '@carbon/styles/scss/utilities/box-shadow';
13
- @use '@carbon/styles/scss/utilities/focus-outline';
10
+ @use "@carbon/styles/scss/theme";
11
+ @use "@carbon/styles/scss/spacing";
12
+ @use "@carbon/styles/scss/utilities/box-shadow";
13
+ @use "@carbon/styles/scss/utilities/focus-outline";
14
14
 
15
- @use '../../layout';
16
- @use '../../utilities/icons';
17
- @use '../../utilities/guards';
15
+ @use "../../layout";
16
+ @use "../../utilities/icons";
17
+ @use "../../utilities/guards";
18
18
 
19
19
  $config: () !default;
20
20
 
@@ -28,7 +28,7 @@ $-default-config: (
28
28
  @mixin styles($config: $config) {
29
29
  $props: map.deep-merge($-default-config, $config);
30
30
 
31
- #{map.get($props, 'selector')} {
31
+ #{map.get($props, "selector")} {
32
32
  @include box-shadow.box-shadow;
33
33
  background-color: theme.$layer;
34
34
  list-style: none;
@@ -63,7 +63,7 @@ $-default-config: (
63
63
  }
64
64
 
65
65
  &:focus {
66
- @include focus-outline.focus-outline('outline');
66
+ @include focus-outline.focus-outline("outline");
67
67
  }
68
68
  }
69
69
 
@@ -71,7 +71,7 @@ $-default-config: (
71
71
  & li[role="menuitem"]::before,
72
72
  & li[role="menuitemcheckbox"]::before,
73
73
  & li[role="menuitemradio"]::before {
74
- content: '';
74
+ content: "";
75
75
  display: block;
76
76
  inline-size: 1rem;
77
77
  translate: 0 0.0625rem;
@@ -90,7 +90,8 @@ $-default-config: (
90
90
  translate: 0 0.0625rem;
91
91
  }
92
92
 
93
- &:has(li > svg) li:not(:has(> svg)):is([role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]) {
93
+ &:has(li > svg)
94
+ li:not(:has(> svg)):is([role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]) {
94
95
  column-gap: calc(spacing.$spacing-03 + 1rem + spacing.$spacing-03);
95
96
  }
96
97
 
@@ -5,15 +5,15 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '../_labelled-input';
10
+ @use "../_labelled-input";
11
11
 
12
12
  $config: () !default;
13
13
 
14
14
  $-default-config: (
15
15
  selector: 'label:has(input[type="number"])',
16
- axis: 'block',
16
+ axis: "block",
17
17
  );
18
18
 
19
19
  /// @group number-input
@@ -23,15 +23,17 @@ $-default-config: (
23
23
  @mixin styles($config: $config) {
24
24
  $props: map.deep-merge($-default-config, $config);
25
25
 
26
- #{map.get($props, 'selector')} {
27
- @include labelled-input.styles((
28
- label: (
29
- selector: '&',
30
- axis: map.get($props, 'axis'),
31
- ),
32
- input: (
33
- selector: 'input[type="number"]',
34
- ),
35
- ));
26
+ #{map.get($props, "selector")} {
27
+ @include labelled-input.styles(
28
+ (
29
+ label: (
30
+ selector: "&",
31
+ axis: map.get($props, "axis"),
32
+ ),
33
+ input: (
34
+ selector: 'input[type="number"]',
35
+ ),
36
+ )
37
+ );
36
38
  }
37
39
  }
@@ -5,16 +5,16 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '@carbon/styles/scss/spacing';
10
+ @use "@carbon/styles/scss/spacing";
11
11
 
12
- @use '../../layout';
12
+ @use "../../layout";
13
13
 
14
14
  $config: () !default;
15
15
 
16
16
  $-default-config: (
17
- selector: 'ol',
17
+ selector: "ol",
18
18
  );
19
19
 
20
20
  /// @group ordered-list
@@ -23,7 +23,7 @@ $-default-config: (
23
23
  @mixin styles($config: $config) {
24
24
  $props: map.deep-merge($-default-config, $config);
25
25
 
26
- #{map.get($props, 'selector')} {
26
+ #{map.get($props, "selector")} {
27
27
  list-style-type: decimal;
28
28
  padding: 0;
29
29
  margin-inline-start: layout.$density--padding;
@@ -5,14 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '../../layout';
10
+ @use "../../layout";
11
11
 
12
12
  $config: () !default;
13
13
 
14
14
  $-default-config: (
15
- selector: 'p',
15
+ selector: "p",
16
16
  );
17
17
 
18
18
  /// @group paragraph
@@ -21,7 +21,7 @@ $-default-config: (
21
21
  @mixin styles($config: $config) {
22
22
  $props: map.deep-merge($-default-config, $config);
23
23
 
24
- #{map.get($props, 'selector')} {
24
+ #{map.get($props, "selector")} {
25
25
  @include layout.mode--body;
26
26
  max-inline-size: layout.$mode--max-inline-size;
27
27
  margin-block: layout.$mode--margin-block;
@@ -5,15 +5,15 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- @use 'sass:map';
8
+ @use "sass:map";
9
9
 
10
- @use '../_labelled-input';
10
+ @use "../_labelled-input";
11
11
 
12
12
  $config: () !default;
13
13
 
14
14
  $-default-config: (
15
15
  selector: 'label:has(input[type="password"])',
16
- axis: 'block',
16
+ axis: "block",
17
17
  );
18
18
 
19
19
  /// @group password-input
@@ -23,16 +23,18 @@ $-default-config: (
23
23
  @mixin styles($config: $config) {
24
24
  $props: map.deep-merge($-default-config, $config);
25
25
 
26
- #{map.get($props, 'selector')} {
27
- @include labelled-input.styles((
28
- label: (
29
- selector: '&',
30
- axis: map.get($props, 'axis'),
31
- ),
32
- input: (
33
- selector: 'input[type="password"]',
34
- ),
35
- input-invalid-slot: 'after',
36
- ));
26
+ #{map.get($props, "selector")} {
27
+ @include labelled-input.styles(
28
+ (
29
+ label: (
30
+ selector: "&",
31
+ axis: map.get($props, "axis"),
32
+ ),
33
+ input: (
34
+ selector: 'input[type="password"]',
35
+ ),
36
+ input-invalid-slot: "after",
37
+ )
38
+ );
37
39
  }
38
40
  }