@odx/ui 1.0.0-rc.1 → 1.0.0-rc.10

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 (92) hide show
  1. package/323d385340fb9fee6450.svg +6 -0
  2. package/LICENSE +1 -0
  3. package/README.md +32 -0
  4. package/core-icons.css +39 -9
  5. package/core-icons.woff2 +0 -0
  6. package/core-theme.css +1 -1
  7. package/package.json +7 -8
  8. package/scss/{modules → abstract}/_breakpoints.scss +11 -11
  9. package/scss/{modules/_vertical-rythm.scss → abstract/_dimensions.scss} +29 -26
  10. package/scss/abstract/_index.scss +5 -0
  11. package/scss/abstract/_motion.scss +12 -0
  12. package/scss/abstract/_typography.scss +25 -0
  13. package/scss/abstract/_utils.scss +124 -0
  14. package/scss/cdk/active-indicator.scss +25 -0
  15. package/scss/cdk/connected-overlay.scss +36 -0
  16. package/scss/components/accordion-item.component.scss +56 -0
  17. package/scss/components/accordion.component.scss +3 -0
  18. package/scss/components/{action-group/action-group.component.scss → action-group.component.scss} +11 -7
  19. package/scss/components/{area-header/area-header.component.scss → area-header.component.scss} +33 -39
  20. package/scss/components/{avatar/avatar.component.scss → avatar.component.scss} +18 -13
  21. package/scss/components/{badge/badge.component.scss → badge.component.scss} +15 -24
  22. package/scss/components/bar.component.scss +86 -0
  23. package/scss/components/breadcrumbs.component.scss +26 -0
  24. package/scss/components/button-group.component.scss +99 -0
  25. package/scss/components/button.component.scss +129 -0
  26. package/scss/components/checkbox.component.scss +117 -0
  27. package/scss/components/chip.component.scss +52 -0
  28. package/scss/components/circular-progress.component.scss +75 -0
  29. package/scss/components/content-box.component.scss +54 -0
  30. package/scss/components/dropdown.component.scss +28 -0
  31. package/scss/components/form-field.component.scss +208 -0
  32. package/scss/components/header.component.scss +40 -0
  33. package/scss/components/icon.component.scss +35 -0
  34. package/scss/components/inline-message.component.scss +33 -0
  35. package/scss/components/launch-tile.component.scss +118 -0
  36. package/scss/components/{link/link.component.scss → link.component.scss} +6 -4
  37. package/scss/components/list-item.component.scss +107 -0
  38. package/scss/components/list.component.scss +3 -0
  39. package/scss/components/loading-spinner.component.scss +54 -0
  40. package/scss/components/{logo/logo.component.scss → logo.component.scss} +5 -4
  41. package/scss/components/main-menu-button.component.scss +7 -0
  42. package/scss/components/{main-menu/components/main-menu-item.component.scss → main-menu-item.component.scss} +14 -12
  43. package/scss/components/{main-menu/main-menu.component.scss → main-menu.component.scss} +37 -29
  44. package/scss/components/menu-item.component.scss +8 -0
  45. package/scss/components/menu.component.scss +16 -0
  46. package/scss/components/modal.component.scss +144 -0
  47. package/scss/components/progress.component.scss +41 -0
  48. package/scss/components/radio-button.component.scss +120 -0
  49. package/scss/components/radio-group.component.scss +14 -0
  50. package/scss/components/rail-navigation-item.component.scss +60 -0
  51. package/scss/components/rail-navigation.component.scss +32 -0
  52. package/scss/components/select.component.scss +103 -0
  53. package/scss/components/slider.component.scss +131 -0
  54. package/scss/components/spinbox.component.scss +124 -0
  55. package/scss/components/switch.component.scss +163 -0
  56. package/scss/components/tab-bar-item.component.scss +53 -0
  57. package/scss/components/tab-bar.component.scss +124 -0
  58. package/scss/components/toast-item.component.scss +79 -0
  59. package/scss/components/toast.component.scss +33 -0
  60. package/scss/components/toggle-button-group.component.scss +63 -0
  61. package/scss/components/toggle-button.component.scss +69 -0
  62. package/scss/components/tooltip.component.scss +34 -0
  63. package/scss/core.scss +66 -30
  64. package/scss/layout/_base.scss +35 -0
  65. package/scss/layout/_content.scss +25 -0
  66. package/scss/layout/_description-list.scss +30 -0
  67. package/scss/layout/_helpers.scss +85 -0
  68. package/scss/{modules → layout}/_layout.scss +96 -46
  69. package/scss/layout/_text-list.scss +18 -0
  70. package/scss/layout/_typography.scss +114 -0
  71. package/scss/{base/_reset.scss → reset.scss} +30 -5
  72. package/scss/variables/_color-palettes.scss +59 -55
  73. package/scss/variables/_colors.scss +15 -15
  74. package/scss/variables/_controls.scss +47 -0
  75. package/scss/variables/_index.scss +6 -0
  76. package/scss/variables/_typography.scss +18 -0
  77. package/scss/variables/_vertical-rythm.scss +3 -0
  78. package/scss/variables/_visuals.scss +15 -8
  79. package/scss/_helpers.scss +0 -15
  80. package/scss/base/_mixins.scss +0 -3
  81. package/scss/base/_utils.scss +0 -19
  82. package/scss/base/mixins/_container.scss +0 -31
  83. package/scss/base/mixins/_control.scss +0 -50
  84. package/scss/base/mixins/_transition.scss +0 -10
  85. package/scss/components/button/button.component.scss +0 -94
  86. package/scss/components/checkbox/checkbox.component.scss +0 -130
  87. package/scss/components/content-box/content-box.component.scss +0 -50
  88. package/scss/components/header/header.component.scss +0 -39
  89. package/scss/components/icon/icon.component.scss +0 -38
  90. package/scss/components/main-menu/components/main-menu-button.component.scss +0 -7
  91. package/scss/components/radio-group/_radio-group.component.scss +0 -145
  92. package/scss/modules/_typography.scss +0 -161
@@ -1,30 +1,31 @@
1
1
  @use 'sass:math';
2
- @use '../../modules/breakpoints' as br;
3
- @use '../../modules/vertical-rythm' as vr;
4
- @use '../../modules/typography' as t;
5
- @use '../../base/mixins' as mx;
2
+ @use '../abstract/breakpoints';
3
+ @use '../abstract/dimensions';
4
+ @use '../abstract/utils';
5
+ @use '../abstract/typography';
6
6
 
7
7
  @mixin avatar-size($size-factor, $line-height-factor, $font-size, $icon-factor) {
8
- @include vr.container($size-factor, $line-height-factor);
9
- @include t.font-size($font-size);
8
+ @include dimensions.container($size-factor, $line-height-factor);
9
+ @include typography.font-size($font-size);
10
10
 
11
11
  > .odx-icon,
12
12
  > .odx-icon[class*='odx-icon--'] {
13
- @include vr.container($icon-factor);
13
+ @include dimensions.container($icon-factor);
14
14
 
15
- font-size: vr.get-size($icon-factor);
15
+ font-size: dimensions.get-size($icon-factor);
16
16
  }
17
17
  }
18
18
 
19
19
  .odx-avatar {
20
- @include mx.center-content(true);
21
- @include t.prevent-text-overflow();
20
+ @include utils.center-content(true);
21
+ @include typography.font-weight(medium);
22
+ @include typography.prevent-text-overflow();
22
23
 
23
24
  background-color: var(--blue-700-10);
24
25
  border-radius: 50%;
25
26
  color: var(--odx-c-text);
26
- font-weight: var(--odx-t-font-weight-medium);
27
27
  position: relative;
28
+ user-select: none;
28
29
  vertical-align: middle;
29
30
 
30
31
  &--small {
@@ -34,7 +35,7 @@
34
35
  &--medium {
35
36
  @include avatar-size(2, 1.5, 0, 1);
36
37
 
37
- @include br.up(tablet) {
38
+ @include breakpoints.up(tablet) {
38
39
  @include avatar-size(3, math.div(64, 24), 2, 1.5);
39
40
  }
40
41
  }
@@ -42,11 +43,15 @@
42
43
  &--large {
43
44
  @include avatar-size(3, math.div(64, 24), 2, 1.5);
44
45
 
45
- @include br.up(tablet) {
46
+ @include breakpoints.up(tablet) {
46
47
  @include avatar-size(4, 4, 4, 2.25);
47
48
  }
48
49
  }
49
50
 
51
+ &--rectangle {
52
+ border-radius: var(--odx-v-border-radius-controls);
53
+ }
54
+
50
55
  img {
51
56
  height: 100%;
52
57
  left: 0;
@@ -1,42 +1,28 @@
1
1
  @use 'sass:math';
2
- @use '../../base/mixins' as mx;
3
- @use '../../modules/typography' as t;
4
- @use '../../modules/vertical-rythm' as vr;
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/utils';
4
+ @use '../abstract/typography';
5
5
 
6
6
  :root {
7
7
  --odx-badge-contrast-color: var(--odx-c-background-content);
8
8
  }
9
9
 
10
10
  .odx-badge {
11
- $badge-size: vr.get-size(math.div(2, 3));
11
+ $badge-size: dimensions.get-size(math.div(2, 3));
12
12
 
13
- @include mx.center-content(true);
14
- @include mx.non-interactive();
15
- @include t.font-size(-2);
16
- @include vr.padding-x(math.div(1, 8));
13
+ @include dimensions.padding-x(math.div(1, 8));
14
+ @include utils.center-content(true);
15
+ @include utils.non-interactive();
16
+ @include typography.font-size(-2);
17
+ @include typography.font-weight(medium);
17
18
 
18
19
  border-radius: $badge-size;
19
- box-sizing: border-box;
20
- font-weight: var(--odx-t-font-weight-medium);
21
20
  height: $badge-size;
22
- left: 0;
23
21
  min-width: $badge-size;
24
22
  outline: 1px solid transparent;
25
- top: 0;
23
+ vertical-align: middle;
26
24
  z-index: 9999;
27
25
 
28
- &::before {
29
- content: attr(data-value);
30
- }
31
-
32
- &[data-value='0'] {
33
- display: none;
34
- }
35
-
36
- &[data-value^='-']::before {
37
- content: '';
38
- }
39
-
40
26
  &,
41
27
  &--highlight {
42
28
  background-color: var(--odx-c-highlight);
@@ -56,4 +42,9 @@
56
42
  &--contrast {
57
43
  outline-color: var(--odx-badge-contrast-color);
58
44
  }
45
+
46
+ .odx-badge-overlay > & {
47
+ display: flex;
48
+ margin: calc(#{$badge-size} / -2);
49
+ }
59
50
  }
@@ -0,0 +1,86 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/utils';
4
+ @use '../abstract/typography';
5
+ @use '../abstract/motion';
6
+ @use './dropdown.component' as dropdown;
7
+
8
+ :root {
9
+ --odx-bar-background-color: var(--cyan-500);
10
+ --odx-bar-background-color-hover: var(--cyan-600);
11
+ --odx-bar-background-color-active: var(--cyan-700);
12
+ --odx-bar-text-color: var(--white);
13
+ --odx-bar-text-color-disabled: var(--cyan-700);
14
+ }
15
+
16
+ .odx-bar {
17
+ @include dimensions.padding-x(math.div(12, 24));
18
+ @include dimensions.padding-y(math.div(6, 24));
19
+
20
+ align-items: center;
21
+ background-color: var(--odx-bar-background-color);
22
+ border-radius: dimensions.get-size(math.div(6, 24));
23
+ box-shadow: 0 2px 6px rgb(0 25 66 / 50%);
24
+ color: var(--odx-bar-text-color);
25
+ display: inline-flex;
26
+ gap: dimensions.get-size(math.div(12, 24));
27
+ width: max-content;
28
+
29
+ &-button {
30
+ $button: &;
31
+
32
+ @include motion.transition(background-color color outline);
33
+ @include utils.with-outline-bold();
34
+
35
+ align-items: center;
36
+ background-color: var(--odx-bar-background-color);
37
+ border-radius: var(--odx-v-border-radius-controls);
38
+ display: inline-flex;
39
+ font-size: dimensions.get-size(math.div(4, 3));
40
+ height: dimensions.get-size(math.div(36, 24));
41
+ outline-color: transparent;
42
+ outline-style: solid;
43
+
44
+ &:hover {
45
+ background-color: var(--odx-bar-background-color-hover);
46
+ }
47
+
48
+ &#{dropdown.$dropdown-open-selector},
49
+ &:active {
50
+ background-color: var(--odx-bar-background-color-active);
51
+ }
52
+
53
+ &:focus-visible {
54
+ outline-color: var(--odx-bar-background-color-active);
55
+ }
56
+
57
+ &--default {
58
+ @include dimensions.padding-x(math.div(28, 24));
59
+ }
60
+
61
+ &--small {
62
+ @include dimensions.padding-x(math.div(2, 24));
63
+ }
64
+
65
+ &.is-disabled {
66
+ @include utils.non-interactive();
67
+
68
+ color: var(--odx-bar-text-color-disabled);
69
+ }
70
+ }
71
+
72
+ &-label {
73
+ display: inline;
74
+ }
75
+
76
+ .odx-bar-parent & {
77
+ bottom: dimensions.get-size(math.div(16, 24));
78
+ left: 50%;
79
+ position: absolute;
80
+ transform: translateX(-50%);
81
+ }
82
+ }
83
+
84
+ .odx-bar-parent {
85
+ position: relative;
86
+ }
@@ -0,0 +1,26 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/utils';
4
+ @use '../abstract/typography';
5
+
6
+ .odx-breadcrumbs {
7
+ @include dimensions.padding-x(1);
8
+ @include dimensions.padding-y(math.div(12, 24));
9
+ @include utils.vertical-center-content();
10
+
11
+ flex-wrap: wrap;
12
+ gap: dimensions.get-size(math.div(8, 24));
13
+
14
+ .odx-link {
15
+ &:last-child {
16
+ @include typography.font-weight(bold);
17
+
18
+ color: var(--odx-c-text);
19
+ }
20
+ }
21
+
22
+ .odx-icon {
23
+ color: var(--gray-500);
24
+ font-size: dimensions.get-size(math.div(12, 24));
25
+ }
26
+ }
@@ -0,0 +1,99 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+
4
+ @mixin buttons-radius($vertical: false, $reversed: false) {
5
+ $start: 'first';
6
+ $end: 'last';
7
+
8
+ @if $reversed {
9
+ $start: 'last';
10
+ $end: 'first';
11
+ }
12
+
13
+ @if $vertical {
14
+ margin: 0;
15
+
16
+ &:#{$start}-child {
17
+ border-bottom-left-radius: 0;
18
+ border-bottom-right-radius: 0;
19
+ }
20
+
21
+ &:#{$end}-child {
22
+ border-top-left-radius: 0;
23
+ border-top-right-radius: 0;
24
+ }
25
+ } @else {
26
+ &:#{$start}-child {
27
+ border-bottom-right-radius: 0;
28
+ border-top-right-radius: 0;
29
+ }
30
+
31
+ &:#{$end}-child {
32
+ border-bottom-left-radius: 0;
33
+ border-top-left-radius: 0;
34
+ }
35
+ }
36
+
37
+ &:not(:first-child, :last-child) {
38
+ border-radius: 0;
39
+ }
40
+ }
41
+
42
+ .odx-button-group {
43
+ display: inline-flex;
44
+ flex-wrap: wrap;
45
+ gap: dimensions.get-size(math.div(2, 24));
46
+
47
+ &--reverse {
48
+ flex-direction: row-reverse;
49
+ justify-content: flex-end;
50
+ }
51
+
52
+ &--reverse#{&}--vertical#{&}--block {
53
+ flex-direction: column-reverse;
54
+ justify-content: flex-end;
55
+ }
56
+
57
+ &--block {
58
+ display: flex;
59
+ width: 100%;
60
+ }
61
+
62
+ &:not(#{&}--vertical)#{&}--align-right {
63
+ justify-content: flex-end;
64
+ }
65
+
66
+ &:not(#{&}--vertical)#{&}--align-right#{&}--reverse {
67
+ justify-content: flex-start;
68
+ }
69
+
70
+ &:not(#{&}--vertical, #{&}--reverse) .odx-button {
71
+ @include buttons-radius();
72
+ }
73
+
74
+ &:not(#{&}--vertical)#{&}--reverse .odx-button {
75
+ @include buttons-radius(false, true);
76
+ }
77
+
78
+ &--vertical {
79
+ @include dimensions.margin-y(math.div(10, 24));
80
+
81
+ flex-direction: column;
82
+
83
+ .odx-button {
84
+ @include dimensions.height(math.div(35, 24));
85
+ }
86
+ }
87
+
88
+ &:not(#{&}--reverse)#{&}--vertical {
89
+ .odx-button {
90
+ @include buttons-radius(true);
91
+ }
92
+ }
93
+
94
+ &#{&}--reverse#{&}--vertical {
95
+ .odx-button {
96
+ @include buttons-radius(true, true);
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,129 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/motion';
4
+ @use '../abstract/typography';
5
+ @use '../abstract/utils';
6
+ @use 'avatar.component' as avatar;
7
+ @use 'dropdown.component' as dropdown;
8
+ @use 'icon.component';
9
+
10
+ .odx-button {
11
+ $variants: secondary, primary, highlight, success, danger, confirmation;
12
+ $icon-margin: 0.25;
13
+
14
+ @extend .odx-button--secondary;
15
+ @include dimensions.height(2, 1.5);
16
+ @include dimensions.padding-x(2 * $icon-margin);
17
+ @include motion.transition(background-color color outline);
18
+ @include typography.prevent-text-overflow();
19
+ @include typography.font-size(0);
20
+ @include typography.font-weight(medium);
21
+ @include utils.center-content(true);
22
+ @include utils.interactive($with-background: false);
23
+ @include utils.with-outline-bold();
24
+
25
+ border-radius: var(--odx-v-border-radius-controls);
26
+ min-width: dimensions.get-size(1.5);
27
+ vertical-align: middle;
28
+
29
+ &:not(:has(> .odx-icon, > .odx-avatar)) {
30
+ min-width: dimensions.get-size(3);
31
+ }
32
+
33
+ > .odx-icon {
34
+ @include dimensions.margin-x(-$icon-margin);
35
+ }
36
+
37
+ > .odx-icon[alignLeft] {
38
+ @include dimensions.margin($icon-margin, right);
39
+ }
40
+
41
+ > .odx-icon[alignRight] {
42
+ @include dimensions.margin($icon-margin, left);
43
+ }
44
+
45
+ > .odx-avatar {
46
+ @include avatar.avatar-size(1.5, math.div(32, 24), 0, 1);
47
+ @include dimensions.margin-x(-2 * $icon-margin);
48
+ }
49
+
50
+ &--highlight:focus-visible {
51
+ outline-color: var(--blue-400);
52
+ }
53
+
54
+ @each $variant in $variants {
55
+ &--#{$variant} {
56
+ background-color: var(--odx-c-#{$variant});
57
+ color: var(--odx-c-#{$variant}-text);
58
+
59
+ &:hover {
60
+ background-color: var(--odx-c-#{$variant}-hover);
61
+ }
62
+
63
+ &#{dropdown.$dropdown-open-selector},
64
+ &:active {
65
+ background-color: var(--odx-c-#{$variant}-active);
66
+ }
67
+
68
+ &:disabled,
69
+ &.is-disabled {
70
+ background-color: var(--odx-c-#{$variant}-disabled);
71
+ color: var(--odx-c-#{$variant}-text-disabled);
72
+ }
73
+ }
74
+ }
75
+
76
+ &--ghost {
77
+ @include utils.with-outline();
78
+
79
+ background-color: transparent;
80
+ color: var(--odx-c-link);
81
+
82
+ &:hover {
83
+ background-color: var(--blue-700-5);
84
+ color: var(--odx-c-link-hover);
85
+ }
86
+
87
+ &:active {
88
+ color: var(--odx-c-link-active);
89
+ }
90
+
91
+ &#{dropdown.$dropdown-open-selector},
92
+ &:focus-visible,
93
+ &:active {
94
+ background-color: var(--odx-c-focus);
95
+ }
96
+
97
+ &:disabled,
98
+ &.is-disabled {
99
+ background-color: transparent;
100
+ color: var(--odx-c-link-disabled);
101
+ }
102
+ }
103
+
104
+ &--small {
105
+ $icon-margin: math.div(1, 8);
106
+
107
+ @include dimensions.height(1);
108
+ @include dimensions.padding-x(2 * $icon-margin);
109
+ @include typography.font-size(-1);
110
+
111
+ min-width: dimensions.get-size(1);
112
+
113
+ &:not(:has(> .odx-icon, > .odx-avatar)) {
114
+ min-width: dimensions.get-size(2);
115
+ }
116
+
117
+ > .odx-icon {
118
+ @include dimensions.margin-x(-2 * $icon-margin);
119
+ }
120
+
121
+ > .odx-icon[alignLeft] {
122
+ @include dimensions.margin($icon-margin, right);
123
+ }
124
+
125
+ > .odx-icon[alignRight] {
126
+ @include dimensions.margin($icon-margin, left);
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,117 @@
1
+ @use 'sass:math';
2
+ @use '../layout/helpers';
3
+ @use '../abstract/dimensions';
4
+ @use '../abstract/typography';
5
+ @use '../abstract/utils';
6
+ @use '../abstract/motion';
7
+
8
+ .odx-checkbox {
9
+ $root: &;
10
+
11
+ color: var(--odx-c-text);
12
+ display: inline-block;
13
+
14
+ &.is-disabled {
15
+ color: var(--odx-control-color-disabled);
16
+ }
17
+
18
+ &.is-readonly {
19
+ @include utils.non-interactive();
20
+ }
21
+
22
+ &__label {
23
+ @include dimensions.line-height(1);
24
+ @include motion.transition(background-color color outline-color);
25
+ @include typography.font-size(0);
26
+ @include utils.interactive($focus-within: true);
27
+
28
+ border-radius: var(--odx-v-border-radius-controls);
29
+ color: inherit;
30
+ display: inline-flex;
31
+ min-height: dimensions.get-size(1);
32
+ padding: 0 2px;
33
+ user-select: auto;
34
+ vertical-align: top;
35
+
36
+ #{$root}.is-disabled & {
37
+ cursor: default;
38
+ }
39
+ }
40
+
41
+ &__input {
42
+ @include utils.visually-hidden();
43
+ }
44
+
45
+ &__indicator {
46
+ @include dimensions.container(1, math.div(20, 24));
47
+ @include motion.transition(background-color color outline-color);
48
+ @include utils.center-content(true);
49
+ @include utils.with-outline();
50
+
51
+ background-color: var(--odx-control-background-color);
52
+ border-radius: var(--odx-v-border-radius-controls);
53
+ color: var(--odx-control-color-selected);
54
+ flex: 0 0 auto;
55
+ outline-color: var(--odx-control-outline-color);
56
+ padding: 1px;
57
+
58
+ > .odx-icon {
59
+ $checkmark-size: math.div(18, 24);
60
+
61
+ @include dimensions.container($checkmark-size);
62
+ @include motion.transition(opacity);
63
+
64
+ font-size: dimensions.get-size($checkmark-size);
65
+ opacity: 0;
66
+ }
67
+
68
+ #{$root}:hover & {
69
+ background-color: var(--odx-control-background-color-hover);
70
+ outline-color: var(--odx-control-outline-color-hover);
71
+ }
72
+
73
+ #{$root}.is-active &,
74
+ #{$root}__input:indeterminate ~ &,
75
+ #{$root}__input:checked ~ & {
76
+ background-color: var(--odx-control-background-color-selected);
77
+ outline-color: var(--odx-control-outline-color-selected);
78
+
79
+ > .odx-icon {
80
+ opacity: 1;
81
+ }
82
+ }
83
+
84
+ #{$root}.has-error & {
85
+ background-color: var(--odx-control-background-color-error);
86
+ color: var(--odx-control-color-error);
87
+ outline-color: var(--odx-control-outline-color-error);
88
+ }
89
+
90
+ #{$root}.has-error:hover & {
91
+ outline-color: var(--odx-control-outline-color-error-hover);
92
+ }
93
+
94
+ #{$root}.is-disabled & {
95
+ background-color: var(--odx-control-background-color-disabled);
96
+ color: var(--odx-control-color-disabled);
97
+ outline-color: var(--odx-control-outline-color-disabled);
98
+ }
99
+
100
+ #{$root}.is-readonly & {
101
+ background-color: var(--odx-control-background-color-readonly);
102
+ color: var(--odx-control-color-readonly);
103
+ outline-color: var(--odx-control-outline-color-readonly);
104
+ }
105
+ }
106
+
107
+ &__content {
108
+ @include dimensions.margin(0.5, left);
109
+
110
+ padding-left: 2px;
111
+
112
+ &:empty {
113
+ margin: 0;
114
+ padding: 0;
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,52 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/utils';
4
+ @use '../abstract/motion';
5
+ @use '../abstract/typography';
6
+
7
+ $sizes: 'small' 1 -1, 'medium' 1.5 0;
8
+ $variants: 'secondary', 'highlight', 'success', 'danger';
9
+
10
+ .odx-chip {
11
+ $root: &;
12
+
13
+ @include typography.font-weight(medium);
14
+ @include motion.transition(background-color color);
15
+
16
+ display: inline-flex;
17
+ gap: dimensions.get-size(math.div(4, 24));
18
+ user-select: none;
19
+
20
+ &__content {
21
+ @include typography.prevent-text-overflow();
22
+ }
23
+
24
+ &__action {
25
+ @include utils.center-content();
26
+ @include motion.transition(background-color color outline);
27
+
28
+ border-radius: 50%;
29
+ margin: 0;
30
+ }
31
+
32
+ @each $size, $size-factor, $font-size-factor in $sizes {
33
+ &--#{$size} {
34
+ @include dimensions.padding-x(math.div($size-factor, 3));
35
+ @include dimensions.line-height($size-factor);
36
+ @include typography.font-size($font-size-factor);
37
+
38
+ border-radius: dimensions.get-size(math.div($size-factor, 2));
39
+
40
+ #{$root}__action {
41
+ @include dimensions.margin(math.div($size-factor, -3), 'right');
42
+ }
43
+ }
44
+ }
45
+
46
+ @each $variant in $variants {
47
+ &--#{$variant} {
48
+ background-color: var(--odx-c-#{$variant});
49
+ color: var(--odx-c-#{$variant}-text);
50
+ }
51
+ }
52
+ }