@odx/ui 1.0.0-rc.4 → 1.0.0-rc.6

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 (31) hide show
  1. package/core-theme.css +1 -1
  2. package/package.json +1 -1
  3. package/scss/abstract/_utils.scss +7 -2
  4. package/scss/cdk/active-indicator.scss +25 -0
  5. package/scss/components/accordion-item.component.scss +5 -8
  6. package/scss/components/area-header.component.scss +6 -6
  7. package/scss/components/button.component.scss +3 -1
  8. package/scss/components/checkbox.component.scss +1 -1
  9. package/scss/components/form-field.component.scss +11 -7
  10. package/scss/components/header.component.scss +1 -1
  11. package/scss/components/list-item.component.scss +106 -0
  12. package/scss/components/list.component.scss +3 -0
  13. package/scss/components/main-menu-item.component.scss +1 -1
  14. package/scss/components/modal.component.scss +18 -2
  15. package/scss/components/radio-button.component.scss +1 -1
  16. package/scss/components/rail-navigation-item.component.scss +60 -0
  17. package/scss/components/rail-navigation.component.scss +32 -0
  18. package/scss/components/slider.component.scss +130 -0
  19. package/scss/components/switch.component.scss +2 -3
  20. package/scss/components/toggle-button-group.component.scss +42 -5
  21. package/scss/components/toggle-button.component.scss +42 -28
  22. package/scss/core.scss +12 -0
  23. package/scss/layout/_content.scss +20 -0
  24. package/scss/layout/_helpers.scss +0 -16
  25. package/scss/layout/_text-list.scss +18 -0
  26. package/scss/layout/_typography.scss +17 -22
  27. package/scss/reset.scss +4 -0
  28. package/scss/variables/_color-palettes.scss +0 -1
  29. package/scss/variables/_colors.scss +3 -0
  30. package/scss/variables/_controls.scss +1 -2
  31. package/scss/variables/_visuals.scss +3 -3
@@ -0,0 +1,25 @@
1
+ @use '../abstract/motion';
2
+
3
+ .odx-cdk-active-indicator {
4
+ @include motion.transition(all);
5
+
6
+ opacity: 0;
7
+ pointer-events: none;
8
+ position: absolute;
9
+ transform-origin: 0 0;
10
+ z-index: 0;
11
+
12
+ &--horizontal {
13
+ left: 0;
14
+ width: 0;
15
+ }
16
+
17
+ &--vertical {
18
+ height: 0;
19
+ top: 0;
20
+ }
21
+
22
+ &--is-active {
23
+ opacity: 1;
24
+ }
25
+ }
@@ -7,17 +7,15 @@
7
7
  .odx-accordion-item {
8
8
  $root: &;
9
9
 
10
- @include dimensions.padding(math.div(1, 6), 'bottom');
10
+ @include motion.transition(color);
11
+ @include dimensions.padding(math.div(6, 24), top);
12
+ @include dimensions.padding(math.div(5, 24), bottom);
11
13
 
12
14
  border-bottom: 1px solid var(--odx-input-control-outline-color);
13
15
  display: block;
14
16
 
15
- &:not(:last-child) {
16
- @include dimensions.margin(1, 'bottom');
17
- }
18
-
19
17
  &__panel {
20
- @include dimensions.padding-x(math.div(4, 24));
18
+ @include dimensions.padding-x(math.div(8, 24));
21
19
  @include dimensions.line-height(1.5, 1);
22
20
  @include motion.transition(background-color outline-color);
23
21
  @include utils.interactive(true);
@@ -46,8 +44,7 @@
46
44
  }
47
45
 
48
46
  &__slot {
49
- @include dimensions.padding-x(math.div(4, 24));
50
- @include dimensions.padding-y(math.div(8, 24));
47
+ @include dimensions.padding(math.div(8, 24));
51
48
 
52
49
  overflow: hidden;
53
50
  }
@@ -41,14 +41,14 @@
41
41
 
42
42
  &__title {
43
43
  @extend .odx-title;
44
- @extend .odx-title--6;
44
+ @extend .odx-title-6;
45
45
 
46
46
  color: var(--odx-area-header-title-color);
47
47
  }
48
48
 
49
49
  &__subtitle {
50
50
  @extend .odx-subtitle;
51
- @extend .odx-title--6;
51
+ @extend .odx-subtitle-6;
52
52
 
53
53
  color: var(--odx-area-header-subtitle-color);
54
54
  }
@@ -94,7 +94,7 @@
94
94
  }
95
95
 
96
96
  .odx-area-header__title {
97
- @extend .odx-title--5;
97
+ @extend .odx-title-5;
98
98
  }
99
99
  }
100
100
 
@@ -106,7 +106,7 @@
106
106
  }
107
107
 
108
108
  .odx-area-header__title {
109
- @extend .odx-title--4;
109
+ @extend .odx-title-4;
110
110
 
111
111
  @include breakpoints.down(tablet) {
112
112
  @include dimensions.line-height(1);
@@ -132,11 +132,11 @@
132
132
  }
133
133
 
134
134
  .odx-area-header__title {
135
- @extend .odx-title--2;
135
+ @extend .odx-title-2;
136
136
  }
137
137
 
138
138
  .odx-area-header__subtitle {
139
- @extend .odx-title--5;
139
+ @extend .odx-subtitle-5;
140
140
  }
141
141
 
142
142
  .odx-avatar {
@@ -19,6 +19,7 @@
19
19
  @include typography.font-weight(medium);
20
20
  @include utils.center-content(true);
21
21
  @include utils.interactive($with-background: false);
22
+ @include utils.with-outline-bold;
22
23
 
23
24
  border-radius: var(--odx-v-border-radius-controls);
24
25
  min-width: dimensions.get-size(1.5);
@@ -71,9 +72,10 @@
71
72
  }
72
73
 
73
74
  &--ghost {
75
+ @include utils.with-outline;
76
+
74
77
  background-color: transparent;
75
78
  color: var(--odx-c-link);
76
- outline-width: 1px;
77
79
 
78
80
  &:hover {
79
81
  background-color: var(--blue-700-5);
@@ -12,7 +12,7 @@
12
12
  display: inline-block;
13
13
 
14
14
  &.is-disabled {
15
- color: var(--odx-input-control-color-disabled);
15
+ color: var(--odx-control-color-disabled);
16
16
  }
17
17
 
18
18
  &.is-readonly {
@@ -21,7 +21,7 @@ $form-field-inner-padding: math.div(8, 24);
21
21
 
22
22
  .odx-form-field {
23
23
  $root: &;
24
- $control-selector: '> *:not(.odx-form-field__prefix, .odx-form-field__suffix)';
24
+ $control-selector: '.odx-form-field-control';
25
25
 
26
26
  @include dimensions.padding($form-field-label-height, top);
27
27
 
@@ -88,7 +88,7 @@ $form-field-inner-padding: math.div(8, 24);
88
88
  @include dimensions.min-height(1.5);
89
89
  @include motion.transition(background-color color outline-color);
90
90
  @include utils.with-outline();
91
- @include utils.focus-state(true, true, $focus-within-selector: $control-selector);
91
+ @include utils.focus-state(true, true, $control-selector);
92
92
 
93
93
  background-color: var(--odx-input-control-background-color);
94
94
  border-radius: var(--odx-v-border-radius-controls);
@@ -121,8 +121,8 @@ $form-field-inner-padding: math.div(8, 24);
121
121
  &::placeholder {
122
122
  @include typography.font-weight(normal);
123
123
 
124
- color: var(--odx-input-control-placeholder-color);
125
- opacity: 1;
124
+ color: var(--odx-input-control-color);
125
+ opacity: 0.65;
126
126
  }
127
127
  }
128
128
 
@@ -169,6 +169,10 @@ $form-field-inner-padding: math.div(8, 24);
169
169
 
170
170
  #{$control-selector} {
171
171
  @include utils.non-interactive;
172
+
173
+ &::placeholder {
174
+ color: var(--odx-input-control-color-disabled);
175
+ }
172
176
  }
173
177
  }
174
178
 
@@ -190,9 +194,9 @@ $form-field-inner-padding: math.div(8, 24);
190
194
  }
191
195
  }
192
196
 
193
- .odx-form-group,
194
- .odx-form-field {
195
- &.is-readonly .odx-form-field__info {
197
+ .odx-form-field.is-readonly,
198
+ .odx-form-group:has(.odx-form-field.is-readonly) {
199
+ .odx-form-field__info {
196
200
  @include utils.non-interactive();
197
201
 
198
202
  opacity: 0;
@@ -24,7 +24,7 @@
24
24
 
25
25
  &__title {
26
26
  @extend .odx-title;
27
- @extend .odx-title--6;
27
+ @extend .odx-title-6;
28
28
  @include typography.prevent-text-overflow();
29
29
  }
30
30
 
@@ -0,0 +1,106 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/utils';
4
+ @use '../abstract/motion';
5
+ @use '../abstract/typography';
6
+
7
+ .odx-list-item {
8
+ $root: &;
9
+
10
+ @include dimensions.padding-x(math.div(1, 3));
11
+ @include dimensions.line-height(2, 1);
12
+ @include motion.transition(border-bottom-color background-color outline-color color);
13
+ @include utils.interactive(false);
14
+ @include utils.vertical-center-content();
15
+
16
+ border-radius: var(--odx-v-border-radius-controls);
17
+ gap: dimensions.get-size(math.div(1, 3));
18
+ position: relative;
19
+
20
+ > [odxListSuffix] {
21
+ margin-left: auto;
22
+ }
23
+
24
+ &:not(.is-disabled) {
25
+ cursor: pointer;
26
+ }
27
+
28
+ &::before {
29
+ @include motion.transition(border-color);
30
+
31
+ border-bottom: 1px solid var(--gray-200);
32
+ content: '';
33
+ display: block;
34
+ position: absolute;
35
+ top: 0;
36
+ width: calc(100% - #{dimensions.get-size(math.div(14, 24))});
37
+ }
38
+
39
+ &:hover,
40
+ &:focus-visible,
41
+ &:first-child {
42
+ &::before {
43
+ border-bottom-color: transparent;
44
+ }
45
+ }
46
+
47
+ &:hover {
48
+ background-color: var(--blue-700-5);
49
+ }
50
+
51
+ &--danger + &::before,
52
+ &--selected + &::before,
53
+ &:hover + &::before {
54
+ border-color: transparent;
55
+ }
56
+
57
+ &.is-disabled {
58
+ color: var(--odx-control-color-disabled);
59
+ pointer-events: none;
60
+ }
61
+
62
+ &--danger {
63
+ --odx-c-focus: var(--odx-c-danger);
64
+
65
+ @include utils.with-outline-bold;
66
+
67
+ background-color: var(--odx-c-danger);
68
+ color: var(--odx-c-danger-text);
69
+
70
+ &::before {
71
+ border-bottom-color: transparent;
72
+ }
73
+
74
+ &:hover {
75
+ background-color: var(--odx-c-danger-hover);
76
+ }
77
+
78
+ &.is-disabled {
79
+ color: var(--odx-c-danger-text-disabled);
80
+ }
81
+ }
82
+
83
+ &--selected {
84
+ background-color: var(--odx-c-selected);
85
+
86
+ &::before {
87
+ border-bottom-color: transparent;
88
+ }
89
+
90
+ &:hover {
91
+ background-color: var(--odx-c-selected-hover);
92
+ }
93
+
94
+ &#{$root}--danger {
95
+ background-color: var(--odx-c-danger-active);
96
+
97
+ &:hover {
98
+ background-color: var(--red-800);
99
+ }
100
+
101
+ &.is-disabled {
102
+ color: var(--odx-c-danger-text);
103
+ }
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,3 @@
1
+ .odx-list {
2
+ display: block;
3
+ }
@@ -16,7 +16,7 @@
16
16
  @include dimensions.height(3, math.div(7, 3));
17
17
  @include dimensions.padding-x(math.div(2, 3));
18
18
  @include motion.transition(color background-color outline);
19
- @include utils.interactive();
19
+ @include utils.interactive(false);
20
20
  @include utils.vertical-center-content();
21
21
  @include typography.font-weight(medium);
22
22
  @include typography.prevent-text-overflow();
@@ -15,7 +15,6 @@
15
15
  display: block;
16
16
  height: 100%;
17
17
  left: 0;
18
- overflow: auto;
19
18
  overscroll-behavior: contain;
20
19
  position: fixed;
21
20
  top: 0;
@@ -27,8 +26,13 @@
27
26
  --odx-modal-margin-x: #{dimensions.get-size(1)};
28
27
  }
29
28
 
29
+ &--sidesheet {
30
+ backdrop-filter: unset;
31
+ background-color: unset;
32
+ }
33
+
30
34
  &__container {
31
- @include dimensions.padding-x(math.div(16, 24));
35
+ @include dimensions.padding-x(1);
32
36
 
33
37
  background-color: var(--odx-c-background-content);
34
38
  border-radius: var(--odx-v-border-radius);
@@ -47,6 +51,14 @@
47
51
  #{$root}--large & {
48
52
  --odx-modal-max-width: #{dimensions.get-size(50)};
49
53
  }
54
+
55
+ #{$root}--sidesheet & {
56
+ height: 100%;
57
+ left: unset;
58
+ margin-right: dimensions.get-size(0.5);
59
+ max-height: calc(100vh - var(--odx-modal-margin-y) - #{dimensions.get-size(1)});
60
+ right: 0;
61
+ }
50
62
  }
51
63
 
52
64
  &__header,
@@ -73,6 +85,10 @@
73
85
 
74
86
  display: block;
75
87
  overflow: auto;
88
+
89
+ #{$root}--sidesheet & {
90
+ flex: 1;
91
+ }
76
92
  }
77
93
 
78
94
  &__footer {
@@ -11,7 +11,7 @@
11
11
  display: block;
12
12
 
13
13
  &.is-disabled {
14
- color: var(--odx-input-control-color-disabled);
14
+ color: var(--odx-control-color-disabled);
15
15
  }
16
16
 
17
17
  &.is-readonly {
@@ -0,0 +1,60 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/motion';
4
+ @use '../abstract/typography';
5
+ @use '../abstract/breakpoints';
6
+ @use '../abstract//utils';
7
+
8
+ .odx-rail-navigation-item {
9
+ @include motion.transition(outline-color background-color color);
10
+ @include dimensions.padding(math.div(8, 24));
11
+ @include utils.interactive(false);
12
+
13
+ align-items: center;
14
+ background-color: unset;
15
+ border-radius: dimensions.get-size(math.div(3, 24));
16
+ box-sizing: border-box;
17
+ display: flex;
18
+ text-align: left;
19
+
20
+ &:hover {
21
+ background-color: var(--blue-700-5);
22
+ }
23
+
24
+ &.is-selected {
25
+ background-color: var(--odx-c-selected);
26
+
27
+ &:hover {
28
+ background-color: var(--odx-c-selected-hover);
29
+ }
30
+ }
31
+
32
+ &.is-disabled {
33
+ background-color: transparent;
34
+ color: var(--odx-control-color-disabled);
35
+ pointer-events: none;
36
+ }
37
+
38
+ &__container {
39
+ @include typography.prevent-text-overflow();
40
+ @include motion.transition(width padding-left opacity);
41
+
42
+ opacity: 0;
43
+ overflow: hidden;
44
+ padding-left: 0;
45
+ width: 0;
46
+
47
+ .odx-rail-navigation.is-open & {
48
+ &:not(:empty) {
49
+ @include dimensions.padding(math.div(8, 24), left);
50
+
51
+ opacity: 1;
52
+ width: calc(var(--odx-rail-navigation-max-width) - dimensions.get-size(math.div(64, 24)));
53
+ }
54
+ }
55
+ }
56
+
57
+ > .odx-icon {
58
+ margin: 0;
59
+ }
60
+ }
@@ -0,0 +1,32 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/motion';
4
+ @use '../abstract/breakpoints';
5
+
6
+ .odx-rail-navigation {
7
+ --odx-rail-navigation-max-width: 230px;
8
+
9
+ @include motion.transition(max-width);
10
+
11
+ align-items: flex-start;
12
+ display: inline-flex;
13
+ flex-direction: column;
14
+ height: 100%;
15
+ justify-content: space-between;
16
+ padding: dimensions.get-size(1) dimensions.get-size(math.div(8, 24));
17
+
18
+ &__expand > .odx-icon {
19
+ @include motion.transition(transform);
20
+ }
21
+
22
+ &__content {
23
+ display: flex;
24
+ flex-direction: column;
25
+ gap: dimensions.get-size(math.div(12, 24));
26
+ overflow: auto;
27
+ }
28
+
29
+ &.is-open &__expand > .odx-icon {
30
+ transform: rotateY(180deg);
31
+ }
32
+ }
@@ -0,0 +1,130 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/motion';
4
+
5
+ .odx-slider {
6
+ --odx-control-outline-color: var(--gray-200);
7
+ --odx-control-background-color: var(--gray-100);
8
+ --odx-control-background-color-hover: var(--cyan-600);
9
+ $root: &;
10
+ $thumb-size: dimensions.get-size(math.div(20, 24));
11
+ $track-height: dimensions.get-size(math.div(4, 24));
12
+
13
+ appearance: none;
14
+ box-sizing: border-box;
15
+ display: block;
16
+ width: 100%;
17
+
18
+ @mixin track-container() {
19
+ background-color: var(--odx-control-background-color);
20
+ border-radius: 2px;
21
+ outline: 1px solid var(--odx-control-outline-color);
22
+ outline-offset: -1px;
23
+ }
24
+
25
+ @mixin track-progress() {
26
+ border-radius: 2px;
27
+ height: $track-height;
28
+ position: relative;
29
+ }
30
+
31
+ @mixin thumb() {
32
+ @include motion.transition(background-color outline-color);
33
+
34
+ appearance: none;
35
+ background-color: var(--odx-control-background-color-selected);
36
+ border-radius: 50%;
37
+ height: $thumb-size;
38
+ margin-top: calc(#{$thumb-size} / -2 + #{$track-height} / 2);
39
+ outline: 1px solid var(--white);
40
+ width: $thumb-size;
41
+ }
42
+
43
+ &::-webkit-slider-container {
44
+ @include track-container();
45
+
46
+ margin: calc((#{$thumb-size} - #{$track-height}) / 2) 0;
47
+ }
48
+
49
+ &::-moz-range-track {
50
+ @include track-container();
51
+
52
+ height: $track-height;
53
+ }
54
+
55
+ &::-webkit-slider-runnable-track {
56
+ @include track-progress();
57
+
58
+ background: linear-gradient(var(--odx-control-background-color-selected), var(--odx-control-background-color-selected)) 0 / var(--odx-slider-filled) 100%
59
+ no-repeat,
60
+ transparent;
61
+ }
62
+
63
+ &::-moz-range-progress {
64
+ @include track-progress();
65
+
66
+ background: var(--odx-control-background-color-selected);
67
+ }
68
+
69
+ &::-webkit-slider-thumb {
70
+ @include thumb();
71
+
72
+ position: relative;
73
+ }
74
+
75
+ &::-moz-range-thumb {
76
+ @include thumb();
77
+
78
+ border: unset;
79
+ }
80
+
81
+ &.is-disabled {
82
+ &::-webkit-slider-container {
83
+ background-color: var(--odx-control-background-color-disabled);
84
+ outline: 1px solid transparent;
85
+ }
86
+
87
+ &::-moz-range-track {
88
+ background-color: var(--odx-control-background-color-disabled);
89
+ outline: 1px solid transparent;
90
+ }
91
+
92
+ &::-webkit-slider-thumb {
93
+ background-color: var(--odx-c-text-disabled);
94
+ outline: 1px solid transparent;
95
+ }
96
+
97
+ &::-moz-range-thumb {
98
+ background-color: var(--odx-c-text-disabled);
99
+ outline: 1px solid transparent;
100
+ }
101
+
102
+ &::-webkit-slider-runnable-track {
103
+ background-image: linear-gradient(var(--odx-c-text-disabled), var(--odx-c-text-disabled));
104
+ }
105
+
106
+ &::-moz-range-progress {
107
+ background-image: linear-gradient(var(--odx-c-text-disabled), var(--odx-c-text-disabled));
108
+ }
109
+ }
110
+
111
+ &:focus-visible {
112
+ &::-webkit-slider-thumb {
113
+ outline: 2px solid var(--odx-c-highlight-active);
114
+ }
115
+
116
+ &::-moz-range-thumb {
117
+ outline: 2px solid var(--odx-c-highlight-active);
118
+ }
119
+ }
120
+
121
+ &:hover:not(.is-disabled) {
122
+ &::-webkit-slider-thumb {
123
+ background-color: var(--odx-control-background-color-hover);
124
+ }
125
+
126
+ &::-moz-range-thumb {
127
+ background-color: var(--odx-control-background-color-hover);
128
+ }
129
+ }
130
+ }
@@ -21,7 +21,7 @@
21
21
  display: inline-block;
22
22
 
23
23
  &.is-disabled {
24
- color: var(--odx-input-control-color-disabled);
24
+ color: var(--odx-control-color-disabled);
25
25
  }
26
26
 
27
27
  &.is-readonly {
@@ -91,8 +91,7 @@
91
91
  content: '';
92
92
  display: block;
93
93
  height: $track-size;
94
- outline: var(--odx-v-outline);
95
- outline-color: var(--odx-c-background-content);
94
+ outline: 1px solid var(--odx-c-background-content);
96
95
  position: absolute;
97
96
  top: calc(#{$track-size} / -2 + 50%);
98
97
  transform: translateX(-1px);
@@ -4,22 +4,59 @@
4
4
  @use '../abstract/utils';
5
5
 
6
6
  .odx-toggle-button-group {
7
+ --odx-toggle-button-border-radius: 2px;
8
+
9
+ $root: &;
7
10
  @include dimensions.height(2, 1.5);
8
11
  @include dimensions.padding-x(math.div(6, 24));
9
- @include motion.transition(background-color);
12
+ @include motion.transition(background-color outline-color);
10
13
  @include utils.center-content(true);
11
- @include utils.with-outline();
14
+ @include utils.with-outline;
12
15
 
13
16
  border-radius: var(--odx-v-border-radius-controls);
14
17
  column-gap: dimensions.get-size(math.div(6, 24));
18
+ position: relative;
19
+
20
+ &__indicator {
21
+ @include dimensions.height(2, 1);
22
+ @include utils.with-outline;
23
+
24
+ background-color: var(--odx-c-highlight);
25
+ border-radius: var(--odx-toggle-button-border-radius);
26
+
27
+ #{$root}.is-disabled & {
28
+ background-color: var(--odx-c-secondary-disabled);
29
+ }
30
+
31
+ #{$root}.is-readonly & {
32
+ background-color: transparent;
33
+ outline-color: currentcolor;
34
+ }
35
+
36
+ #{$root}.is-readonly.is-disabled & {
37
+ background-color: transparent;
38
+ outline-color: var(--odx-c-secondary-disabled);
39
+ }
40
+
41
+ #{$root}:focus-within:has(:focus-visible) & {
42
+ outline-color: var(--odx-c-highlight-active);
43
+ }
44
+ }
45
+
46
+ .odx-toggle-button {
47
+ z-index: 1;
48
+ }
15
49
 
16
50
  &.has-error:not(.is-disabled, .is-readonly) {
17
51
  background-color: var(--odx-c-error);
18
52
  outline-color: var(--odx-c-error-outline);
19
53
  }
20
54
 
21
- &:not(.is-disabled, .is-readonly):hover,
22
- &:focus-within:has(:focus-visible) {
23
- background-color: var(--blue-700-5);
55
+ &.is-active {
56
+ @include utils.focus-state($focus-within: true);
57
+
58
+ &:not(.is-disabled, .is-readonly):hover {
59
+ background-color: var(--blue-700-5);
60
+ }
24
61
  }
25
62
  }