@matteusan/himig 1.2.3 → 1.3.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 (43) hide show
  1. package/.yarn/cache/@matteusan-sentro-npm-0.1.25-9dadcacaf9-2964e33fdc.zip +0 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/_index.scss +21 -13
  4. package/ms-badge/_badge-extend.scss +3 -3
  5. package/ms-badge/_badge-styles.scss +8 -0
  6. package/ms-button/_button-extend.scss +3 -3
  7. package/ms-button/_button-mixins.scss +28 -17
  8. package/ms-button/_button-styles.scss +13 -9
  9. package/ms-button/_button-theme.scss +5 -5
  10. package/ms-card/_card-base.scss +243 -0
  11. package/{ms-surface/_surface-extend.scss → ms-card/_card-extend.scss} +6 -6
  12. package/{ms-item-card/_item-card-styles.scss → ms-card/_card-styles.scss} +28 -25
  13. package/{ms-item-card/_item-card-theme.scss → ms-card/_card-theme.scss} +27 -25
  14. package/{ms-sprite → ms-card}/_index.scss +1 -1
  15. package/ms-core/_index.scss +2 -1
  16. package/{ms-sprite/_sprite-styles.scss → ms-core/component/_component-extend.scss} +28 -29
  17. package/{ms-surface → ms-core/component}/_index.scss +1 -2
  18. package/ms-core/struct/_struct-utils.scss +3 -7
  19. package/ms-core/theme/_theme-merge.scss +1 -1
  20. package/ms-core/theme/_theme-properties.scss +9 -0
  21. package/ms-core/theme/_theme-setters.scss +5 -2
  22. package/ms-form-field/_form-field-base.scss +25 -22
  23. package/ms-form-field/_form-field-extend.scss +3 -3
  24. package/ms-form-field/_form-field-styles.scss +83 -72
  25. package/ms-form-field/_form-field-theme.scss +10 -8
  26. package/ms-list/_list-base.scss +1 -0
  27. package/ms-list/_list-extend.scss +3 -3
  28. package/ms-list/_list-theme.scss +2 -2
  29. package/ms-select-field/_index.scss +24 -0
  30. package/ms-select-field/_select-field-base.scss +108 -0
  31. package/ms-select-field/_select-field-extend.scss +53 -0
  32. package/ms-select-field/_select-field-styles.scss +203 -0
  33. package/{ms-surface/_surface-theme.scss → ms-select-field/_select-field-theme.scss} +29 -19
  34. package/{ms-item-card → ms-tick-field}/_index.scss +2 -2
  35. package/ms-tick-field/_tick-field-base.scss +78 -0
  36. package/{ms-item-card/_item-card-extend.scss → ms-tick-field/_tick-field-extend.scss} +6 -6
  37. package/ms-tick-field/_tick-field-styles.scss +121 -0
  38. package/ms-tick-field/_tick-field-theme.scss +77 -0
  39. package/ms-utils/_color-utils.scss +0 -1
  40. package/package.json +1 -1
  41. package/ms-item-card/_item-card-base.scss +0 -96
  42. package/ms-surface/_surface-base.scss +0 -111
  43. package/ms-surface/_surface-styles.scss +0 -88
@@ -21,8 +21,9 @@
21
21
  //---------------------------------------------------
22
22
 
23
23
  @use '../ms-core';
24
- @use 'item-card-base' as base;
25
- @use 'item-card-theme' as theme;
24
+ @use 'sass:list';
25
+ @use 'card-base' as base;
26
+ @use 'card-theme' as theme;
26
27
 
27
28
  @mixin render(
28
29
  $color: (),
@@ -35,30 +36,32 @@
35
36
  $typography: ms-core.theme-merge(theme.$init-typography, $typography);
36
37
  $settings: ms-core.theme-merge(theme.$init-settings, $settings);
37
38
 
38
- @include base.init() {
39
- @include ms-core.color-bind('item-card', $color);
40
- @include ms-core.struct-bind('item-card', $struct);
41
- @include ms-core.struct-bind('item-card-footer', (
42
- padding: ms-core.theme-get($struct, 'padding', 'footer'),
39
+ @include base.init(
40
+ $struct,
41
+ $typography
42
+ ) {
43
+ @include ms-core.color-apply('card', (
44
+ fill: ms-core.theme-get($color, 'fill'),
45
+ ink: ms-core.theme-get($color, 'ink'),
43
46
  ));
44
- @include ms-core.typography-bind('item-card', $typography);
45
- @include ms-core.typography-bind('item-card-title', (
46
- family: ms-core.theme-get($typography, 'family', 'title'),
47
- size: ms-core.theme-get($typography, 'size', 'title'),
48
- weight: ms-core.theme-get($typography, 'weight', 'title'),
49
- line-height: ms-core.theme-get($typography, 'line-height', 'title'),
50
- ));
51
- @include ms-core.typography-bind('item-card-subtitle', (
52
- family: ms-core.theme-get($typography, 'family', 'subtitle'),
53
- size: ms-core.theme-get($typography, 'size', 'subtitle'),
54
- weight: ms-core.theme-get($typography, 'weight', 'subtitle'),
55
- line-height: ms-core.theme-get($typography, 'line-height', 'subtitle'),
56
- ));
57
- @include ms-core.typography-bind('item-card-footer', (
58
- family: ms-core.theme-get($typography, 'family', 'footer'),
59
- size: ms-core.theme-get($typography, 'size', 'footer'),
60
- weight: ms-core.theme-get($typography, 'weight', 'footer'),
61
- line-height: ms-core.theme-get($typography, 'line-height', 'footer'),
47
+ @include ms-core.color-border('card', ms-core.theme-get($color, 'border'), 'bind');
48
+ @include ms-core.struct-apply('card', (
49
+ radius: ms-core.theme-get($struct, 'radius'),
50
+ shadow: 'none',
62
51
  ));
52
+
53
+ &:where(.is-outlined) {
54
+ @include ms-core.color-bind('card', (
55
+ fill: ms-core.theme-get($color, 'fill', 'outlined'),
56
+ ink: ms-core.theme-get($color, 'ink'),
57
+ border: ms-core.theme-get($color, 'border')
58
+ ));
59
+ }
60
+
61
+ &:where(.is-raised) {
62
+ @include ms-core.struct-bind('card', (
63
+ shadow: 'low'
64
+ ));
65
+ }
63
66
  }
64
67
  }
@@ -21,46 +21,48 @@
21
21
  //---------------------------------------------------
22
22
 
23
23
  $init-color: (
24
- fill: 'surface-400',
24
+ fill: (
25
+ default: 'surface-200',
26
+ outlined: 'surface-alpha-400'
27
+ ),
25
28
  ink: 'surface-ink',
26
- border: 'surface-400',
29
+ border: 'surface-200',
27
30
  );
28
31
 
29
32
  $init-struct: (
30
- padding: (
31
- default: 'md',
32
- footer: ('sm' 'md')
33
- ),
34
- radius: 'small',
35
- gap: 'sm',
33
+ radius: 'md',
34
+ padding: 'lg',
36
35
  border-width: 'xs',
37
- border-style: solid,
36
+ border-style: 'solid',
37
+ gap: (
38
+ section: 'md',
39
+ header: 'md',
40
+ footer: 'md',
41
+ )
38
42
  );
39
43
 
40
44
  $init-typography: (
41
45
  family: (
42
- default: 'global',
43
- title: 'title',
44
- subtitle: 'subtitle',
45
- footer: 'small'
46
+ 'default': 'body',
47
+ 'title': 'subtitle',
48
+ 'subtitle': 'body',
46
49
  ),
47
50
  size: (
48
- default: 'body',
49
- title: 'subtitle',
50
- subtitle: 'small',
51
- footer: 'small'
51
+ 'default': 'body',
52
+ 'title': 'title',
53
+ 'subtitle': 'body',
54
+ 'icon': 66px
52
55
  ),
53
56
  weight: (
54
- default: 'normal',
55
- title: 'bold',
56
- subtitle: 'normal',
57
- footer: 'normal'
57
+ 'default': 'normal',
58
+ 'title': 'bold',
59
+ 'subtitle': 'normal',
58
60
  ),
59
61
  line-height: (
60
- default: 'normal',
61
- title: 'normal',
62
- footer: 'condensed',
63
- )
62
+ 'default': 'normal',
63
+ 'title': 'normal',
64
+ 'subtitle': 'normal',
65
+ ),
64
66
  );
65
67
 
66
68
  $init-settings: ();
@@ -20,4 +20,4 @@
20
20
  // SOFTWARE.
21
21
  //---------------------------------------------------
22
22
 
23
- @forward 'sprite-styles';
23
+ @forward 'card-styles';
@@ -73,4 +73,5 @@ $type-inherit-template: (
73
73
  @forward 'color' as color-*;
74
74
  @forward 'struct' as struct-*;
75
75
  @forward 'sprite' as sprite-*;
76
- @forward 'typography' as typography-*;
76
+ @forward 'typography' as typography-*;
77
+ @forward 'component' as component-*;
@@ -20,38 +20,37 @@
20
20
  // SOFTWARE.
21
21
  //---------------------------------------------------
22
22
 
23
- @use '../ms-core';
23
+ @use 'sass:list';
24
+ @use 'sass:string';
25
+ @use '../tools';
24
26
 
25
- @mixin render() {
26
- .ms-sprite {
27
- @include ms-core.sprite-styles();
27
+ @mixin extend($component-name, $extension) {
28
+ $_extensions: tools.str-split($extension, '.');
29
+ $_sanitized-extension: '';
28
30
 
29
- &:where(.is-icon) {
30
- position: relative;
31
- @include ms-core.color-ink('sprite', inherit);
32
- @include ms-core.typography-size('sprite-font', 'size.md');
33
- /* @fallback */
34
- @include ms-core.struct-bind('sprite', (
35
- width: (
36
- default: 'size.md',
37
- max: max-content
38
- ),
39
- height: 'size.md',
40
- ));
41
-
42
- > * {
43
- position: relative;
44
- @include ms-core.color-ink('sprite', inherit);
45
- @include ms-core.typography-size('sprite-font', 'size.md');
46
- /* @fallback */
47
- @include ms-core.struct-bind('sprite', (
48
- width: (
49
- default: 'size.md',
50
- max: max-content
51
- ),
52
- height: 'size.md',
53
- ));
31
+ @each $ext in $_extensions {
32
+ @if list.index($_extensions, $ext) == 1 {
33
+ @if string.slice($ext, 1, 3) == 'is-' {
34
+ $_sanitized-extension: $_sanitized-extension + string.slice($ext, 4);
35
+ } @else {
36
+ $_sanitized-extension: $_sanitized-extension + $ext;
37
+ }
38
+ } @else if list.index($_extensions, $ext) == list.length($_extensions) {
39
+ @if string.slice($ext, 1, 3) == 'is-' {
40
+ $_sanitized-extension: $_sanitized-extension + '.#{$ext}';
41
+ } @else {
42
+ $_sanitized-extension: $_sanitized-extension + '.is-#{$ext}';
43
+ }
44
+ } @else {
45
+ @if string.slice($ext, 1, 3) == 'is-' {
46
+ $_sanitized-extension: $_sanitized-extension + '.#{$ext}';
47
+ } @else {
48
+ $_sanitized-extension: $_sanitized-extension + '.is-#{$ext}';
54
49
  }
55
50
  }
56
51
  }
52
+
53
+ .hs-#{$component-name}.is-#{$_sanitized-extension} {
54
+ @content;
55
+ }
57
56
  }
@@ -20,5 +20,4 @@
20
20
  // SOFTWARE.
21
21
  //---------------------------------------------------
22
22
 
23
- @forward 'surface-styles';
24
- @forward 'surface-extend';
23
+ @forward 'component-extend';
@@ -75,7 +75,7 @@ $_valid-arbitrary-values: (0, inherit);
75
75
  /// @param {string} $intent
76
76
  /// @return {void} width styles.
77
77
  @mixin height($component, $height, $intent: 'create') {
78
- @if tools.is-type('map', $height, $errors: false) {
78
+ @if tools.is-type($height, 'map', $errors: false) {
79
79
  $min: map.get($height, 'min');
80
80
  $default: map.get($height, 'default');
81
81
  $max: map.get($height, 'max');
@@ -157,7 +157,7 @@ $_valid-arbitrary-values: (0, inherit);
157
157
  @mixin border-width($component, $border-width, $intent: 'create') {
158
158
  @include theme.property(
159
159
  border-width,
160
- ('#{$component}-border-width', theme.token-switch('border-#{$border-width}', tokens.primitive-token-switch('border.#{$border-width}', $border-width))),
160
+ ('#{$component}-border-width', _parse-value('border', $border-width)),
161
161
  $intent
162
162
  );
163
163
  }
@@ -211,11 +211,7 @@ $_valid-arbitrary-values: (0, inherit);
211
211
  theme.token-switch('#{$key}-#{$value}', tokens.primitive-token-switch('#{$key}.#{$value}', $value)),
212
212
  'space');
213
213
  } @else {
214
- @if not list.index($_valid-arbitrary-values, $value) {
215
- @error 'Invalid value: #{$value}. Expecting a valid #{$key} token, inherit, or the number 0.';
216
- } @else {
217
- $result: list.append($result, $value, 'space');
218
- }
214
+ $result: list.append($result, $value, 'space');
219
215
  }
220
216
  }
221
217
  @return $result;
@@ -42,5 +42,5 @@
42
42
  /// @param {map} $modifying-map
43
43
  /// @return {map} The merged map.
44
44
  @function _smart-merge($base-map, $modifying-map) {
45
- @return map.merge($base-map, $modifying-map);
45
+ @return map.deep-merge($base-map, $modifying-map);
46
46
  }
@@ -21,8 +21,10 @@
21
21
  //---------------------------------------------------
22
22
 
23
23
  @use '../tokens' as primitive-token;
24
+ @use '../tools';
24
25
  @use 'sass:map';
25
26
  @use 'sass:list';
27
+ @use 'sass:string';
26
28
 
27
29
  @use 'theme-tokens' as token;
28
30
  @use 'theme-keys' as key;
@@ -48,5 +50,12 @@ $_valid-intents: (
48
50
  }
49
51
 
50
52
  @function _assert-value($query) {
53
+ @if tools.is-type($query, 'list', false) {
54
+ @if list.length($query) == 2 and
55
+ token.check(list.nth($query, 1)) or primitive-token.primitive-token-check(list.nth($query, 1)) and
56
+ list.nth($query, 2) == string.unquote('!important') {
57
+ @return token.switch(list.nth($query, 1), primitive-token.primitive-token-switch(list.nth($query, 1))) + ' ' + list.nth($query, 2);
58
+ }
59
+ }
51
60
  @return token.switch($query, primitive-token.primitive-token-switch($query));
52
61
  }
@@ -36,7 +36,7 @@ $expressive-inks: false !default;
36
36
  $error: (),
37
37
  $warning: (),
38
38
  $success: (),
39
- $undefined: (),
39
+ $disabled: (),
40
40
  $radius: (),
41
41
  $breakpoints: (),
42
42
  $global: (),
@@ -84,7 +84,10 @@ $expressive-inks: false !default;
84
84
  $background-ink: tools.get-ink(tokens.primitive-token-switch($background)),
85
85
  $error: _color-theme-token-module($error),
86
86
  $error-alpha: _alpha-color-theme-token-module($error),
87
- $undefined: _color-theme-token-module($undefined),
87
+ $disabled: (
88
+ 'default': map.get($disabled, 'default'),
89
+ 'ink': tools.prioritize(map.get($disabled, 'ink'), tools.get-ink(map.get($disabled, 'default'), $expressive-inks)),
90
+ ),
88
91
  $radius: _shape-theme-token-module(map.merge($_init-radius, $radius)),
89
92
  $family: _typography-theme-token-module($_typography-mapper, 'family'),
90
93
  $size: _typography-theme-token-module($_typography-mapper, 'size'),
@@ -22,8 +22,11 @@
22
22
 
23
23
  @use '../ms-core';
24
24
 
25
+ @use 'sass:math';
26
+
25
27
  @mixin init($top-label-distance, $left-label-distance, $top-padding) {
26
28
  .ms-form-field {
29
+ width: 100%;
27
30
  display: flex;
28
31
  flex-flow: column nowrap;
29
32
  position: relative;
@@ -32,8 +35,8 @@
32
35
 
33
36
  .ms-form-field__label {
34
37
  position: absolute;
35
- top: calc(#{$top-label-distance} + 2px);
36
- left: calc(#{$left-label-distance} + 1px);
38
+ top: calc(#{$top-label-distance});
39
+ left: calc(#{$left-label-distance} + 2px);
37
40
  @include ms-core.color-apply('form-field-label', (
38
41
  fill: rgba(0 0 0 / 0),
39
42
  ink: inherit,
@@ -41,16 +44,29 @@
41
44
  @include ms-core.struct-apply('form-field-label', (
42
45
  padding: ('xs' 'xs' 0 0),
43
46
  ));
44
- @include ms-core.typography-apply('form-field-label', (
45
- family: inherit,
46
- size: inherit,
47
- weight: inherit,
48
- line-height: inherit,
49
- ));
47
+ @include ms-core.typography-apply('form-field-label', ms-core.$type-inherit-template);
50
48
  @include ms-core.prefix(transition, all var(--ms-transition-time) ease);
51
49
  cursor: text;
52
50
  }
53
51
 
52
+ &:has(.ms-form-field__input:focus),
53
+ &:has(.ms-form-field__input:not(:placeholder-shown)), {
54
+ .ms-form-field__label {
55
+ top: math.div($top-label-distance, 2);
56
+ @include ms-core.typography-bind('form-field-label', (
57
+ family: 'small',
58
+ size: 'small',
59
+ ));
60
+ }
61
+ }
62
+
63
+ &:has(.ms-form-field__label) {
64
+ .ms-form-field__input {
65
+ @include ms-core.key-bind('form-field-placeholder-ink', rgba(0 0 0 / 0) !important);
66
+ padding-top: calc(#{$top-padding} + 1rem) !important;
67
+ }
68
+ }
69
+
54
70
  .ms-form-field__input {
55
71
  @include ms-core.struct-apply('form-field', (
56
72
  width: 100%,
@@ -61,7 +77,6 @@
61
77
  shadow: 'none',
62
78
  ));
63
79
  padding: ms-core.key-get('form-field-padding');
64
- padding-top: calc(#{$top-padding} + 1rem) !important;
65
80
  @include ms-core.color-apply('form-field', (
66
81
  fill: inherit,
67
82
  ink: inherit,
@@ -80,21 +95,9 @@
80
95
  @include ms-core.prefix(transition, all var(--ms-transition-time) ease);
81
96
 
82
97
  &::placeholder {
83
- // display: none !important;
84
- color: rgba(0 0 0 / 0) !important;
98
+ color: ms-core.key-create('form-field-placeholder-ink', inherit);
85
99
  user-select: none !important;
86
100
  }
87
-
88
- &:focus,
89
- &:not(:placeholder-shown){
90
- + .ms-form-field__label {
91
- top: 0.33rem;
92
- @include ms-core.typography-bind('form-field-label', (
93
- family: 'small',
94
- size: 'small',
95
- ));
96
- }
97
- }
98
101
  }
99
102
 
100
103
  .ms-form-field__helper {
@@ -23,10 +23,10 @@
23
23
  @use '../ms-core';
24
24
 
25
25
  /// Component variant maker.
26
- /// @param {string} $variant
26
+ /// @param {string} $variants
27
27
  /// @return {*} extension class.
28
- @mixin extend($variant) {
29
- .ms-form-field.is-#{$variant} {
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('form-field', $variants) {
30
30
  @content;
31
31
  }
32
32
  }
@@ -39,7 +39,7 @@
39
39
  $resolve-padding: if(list.length(ms-core.theme-get($struct, 'padding')) >= 2, list.nth(ms-core.theme-get($struct, 'padding'), 2), list.nth(ms-core.theme-get($struct, 'padding'), 1));
40
40
 
41
41
  @include base.init(
42
- 0.7rem,
42
+ ms-core.primitive-token-switch('padding.#{$resolve-padding}', $resolve-padding),
43
43
  ms-core.primitive-token-switch('padding.#{$resolve-padding}', $resolve-padding),
44
44
  ms-core.primitive-token-switch('padding.#{list.nth(ms-core.theme-get($struct, 'padding'), 1)}', list.nth(ms-core.theme-get($struct, 'padding'), 1)),
45
45
  ) {
@@ -53,6 +53,19 @@
53
53
  weight: ms-core.theme-get($typography, 'weight'),
54
54
  line-height: ms-core.theme-get($typography, 'height'),
55
55
  ));
56
+ user-select: none;
57
+ }
58
+
59
+ &:has(.ms-form-field__input:not(:read-only):not(:disabled)) {
60
+ .ms-form-field__label {
61
+ @include ms-core.color-bind('form-field-label', (
62
+ ink: ms-core.theme-get($color, 'ink'),
63
+ ));
64
+ }
65
+ }
66
+
67
+ &:has(.ms-form-field__input:read-only:disabled) {
68
+ @include ms-core.color-ink('form-field-helper', ms-core.theme-get($color, 'ink', 'disabled'), 'bind');
56
69
  }
57
70
 
58
71
  .ms-form-field__input {
@@ -76,28 +89,17 @@
76
89
  @include ms-core.color-bind('form-field', (
77
90
  fill: ms-core.theme-get($color, 'fill'),
78
91
  ink: ms-core.theme-get($color, 'ink'),
79
- border: ms-core.theme-get($color, 'fill'),
92
+ border: ms-core.theme-get($color, 'border'),
80
93
  ));
81
94
 
82
95
  &:focus {
83
96
  @include ms-core.color-bind('form-field', (
97
+ fill: ms-core.theme-get($color, 'fill', 'hover'),
84
98
  border: ms-core.theme-get($color, 'border', 'focus'),
85
99
  ));
86
100
  @include ms-core.struct-bind('form-field', (
87
101
  border-width: ms-core.theme-get($struct, 'border-width', 'focus'),
88
102
  ));
89
-
90
- + .ms-form-field__label {
91
- @include ms-core.color-bind('form-field-label', (
92
- fill: ms-core.theme-get($color, 'fill'),
93
- ));
94
- }
95
- }
96
-
97
- + .ms-form-field__label {
98
- @include ms-core.color-bind('form-field-label', (
99
- ink: ms-core.theme-get($color, 'ink'),
100
- ));
101
103
  }
102
104
  }
103
105
 
@@ -105,8 +107,10 @@
105
107
  &:disabled {
106
108
  @include ms-core.color-bind('form-field', (
107
109
  fill: ms-core.theme-get($color, 'fill', 'disabled'),
110
+ ink: ms-core.theme-get($color, 'ink', 'disabled'),
108
111
  border: ms-core.theme-get($color, 'fill', 'disabled'),
109
112
  ));
113
+ cursor: not-allowed;
110
114
  }
111
115
  }
112
116
 
@@ -123,41 +127,89 @@
123
127
  ));
124
128
  }
125
129
 
126
- &:where(.is-error) {
127
- .ms-form-field__input:not(:read-only),
128
- .ms-form-field__input:not(:disabled) {
129
- @include ms-core.color-bind('form-field', (
130
- ink: 'error-400',
131
- ));
132
-
133
- &:focus {
134
- @include ms-core.color-bind('form-field', (
135
- border: 'error-400'
130
+ &:where(.is-outlined) {
131
+ &:has(.ms-form-field__input:not(:read-only):not(:disabled)) {
132
+ .ms-form-field__label {
133
+ @include ms-core.color-bind('form-field-label', (
134
+ ink: ms-core.theme-get($color, 'ink'),
136
135
  ));
137
136
  }
137
+ }
138
138
 
139
- + .ms-form-field__label {
140
- @include ms-core.color-bind('form-field-label', (
141
- ink: 'error-400',
139
+ .ms-form-field__input {
140
+ &:not(:read-only),
141
+ &:not(:disabled) {
142
+ @include ms-core.color-bind('form-field', (
143
+ fill: rgba(0 0 0 / 0) !important,
144
+ ink: ms-core.theme-get($color, 'ink'),
145
+ border: ms-core.theme-get($color, 'border'),
142
146
  ));
143
147
 
144
- + .ms-form-field__helper {
145
- @include ms-core.color-bind('form-field-helper', (
146
- ink: 'error-400',
148
+ &:focus {
149
+ @include ms-core.color-bind('form-field', (
150
+ border: ms-core.theme-get($color, 'border', 'focus'),
151
+ ));
152
+ @include ms-core.struct-bind('form-field', (
153
+ border-width: ms-core.theme-get($struct, 'border-width', 'focus'),
147
154
  ));
148
155
  }
149
156
  }
157
+
158
+ &:read-only,
159
+ &:disabled {
160
+ @include ms-core.color-bind('form-field', (
161
+ fill: transparent,
162
+ ink: ms-core.theme-get($color, 'ink', 'disabled'),
163
+ border: ms-core.theme-get($color, 'fill', 'disabled'),
164
+ ));
165
+ }
150
166
  }
151
167
 
168
+ &:where(.is-error) {
169
+ .ms-form-field__input:not(:read-only),
170
+ .ms-form-field__input:not(:disabled) {
171
+ @include ms-core.color-bind('form-field', (
172
+ fill: rgba(0 0 0 / 0) !important,
173
+ border: 'error-alpha-600',
174
+ ));
175
+ }
176
+ }
177
+ }
178
+
179
+ &:where(.is-error) {
152
180
  .ms-form-field__label {
153
181
  @include ms-core.color-bind('form-field-label', (
154
182
  ink: ms-core.theme-get($color, 'ink', 'disabled'),
155
183
  ));
156
184
  }
157
185
 
186
+ &:has(.ms-form-field__input:not(:read-only):not(:disabled)) {
187
+ .ms-form-field__label {
188
+ @include ms-core.color-bind('form-field-label', (
189
+ ink: 'error-400',
190
+ ));
191
+ }
192
+ }
193
+
194
+ .ms-form-field__input:not(:disabled),
195
+ .ms-form-field__input:not(:read-only) {
196
+ @include ms-core.color-bind('form-field', (
197
+ fill: 'error-alpha-300',
198
+ ink: 'error-400',
199
+ border: 'error-alpha-400'
200
+ ));
201
+
202
+ &:focus {
203
+ @include ms-core.color-bind('form-field', (
204
+ fill: 'error-alpha-300',
205
+ border: 'error-400'
206
+ ));
207
+ }
208
+ }
209
+
158
210
  .ms-form-field__helper {
159
211
  @include ms-core.color-bind('form-field-helper', (
160
- ink: ms-core.theme-get($color, 'ink', 'helper'),
212
+ ink: 'error-400',
161
213
  ));
162
214
  }
163
215
  }
@@ -167,46 +219,5 @@
167
219
  shadow: 'xs',
168
220
  ));
169
221
  }
170
-
171
- &:where(.is-control) {
172
- $target-dimension: ms-core.theme-get($typography, 'size');
173
-
174
- .ms-form-field__label,
175
- .ms-form-field__input,
176
- .ms-form-field__helper {
177
- width: auto;
178
- position: static;
179
- padding: 0;
180
- }
181
-
182
- .ms-form-field__label,
183
- .ms-form-field__input:focus + .ms-form-field__label {
184
- background-color: unset;
185
- @include ms-core.color-bind('form-field-label', (
186
- ink: ms-core.theme-get($color, 'ink', 'helper') !important,
187
- ));
188
- border-color: unset;
189
- font-size: unset;
190
- }
191
-
192
- .ms-form-field__label {
193
- width: 100%;
194
- user-select: none;
195
- cursor: default;
196
- }
197
-
198
- .ms-form-field__input[type='radio'],
199
- .ms-form-field__input[type='checkbox'] {
200
- width: ms-core.token-switch('size-#{$target-dimension}', ms-core.primitive-token-switch('size.#{$target-dimension}'));
201
- height: ms-core.token-switch('size-#{$target-dimension}', ms-core.primitive-token-switch('size.#{$target-dimension}'));
202
- margin-right: ms-core.primitive-token-get('spacing.xs');
203
- cursor: pointer;
204
- }
205
-
206
- .ms-form-field__helper {
207
- margin-left: calc(calc(#{ms-core.token-switch('size-#{$target-dimension}', ms-core.primitive-token-switch('size.#{$target-dimension}'))} + 3px) + #{ms-core.primitive-token-get('spacing.xs')});
208
- user-select: none;
209
- }
210
- }
211
222
  }
212
223
  }