@odx/ui 1.0.3 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odx/ui",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
4
  "author": "Drägerwerk AG & Co.KGaA",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "peerDependencies": {
@@ -3,7 +3,7 @@
3
3
  @use '../../abstract/typography';
4
4
 
5
5
  .ag-theme-odx {
6
- --ag-border-color: var(--odx-c-seperator);
6
+ --ag-border-color: var(--odx-c-separator);
7
7
  --ag-foreground-color: var(--odx-c-text);
8
8
  --ag-secondary-foreground-color: var(--odx-c-text);
9
9
  --ag-disabled-foreground-color: vara(--odx-c-text-disabled);
@@ -0,0 +1,16 @@
1
+ @use '../abstract/dimensions';
2
+
3
+ .odx-autocomplete {
4
+ $root: &;
5
+
6
+ &__trigger {
7
+ height: 100%;
8
+ }
9
+
10
+ .odx-form-field-control {
11
+ height: 100%;
12
+ padding: 0;
13
+
14
+ @include dimensions.min-height(1.5);
15
+ }
16
+ }
@@ -41,7 +41,6 @@
41
41
 
42
42
  .odx-button-group {
43
43
  display: inline-flex;
44
- flex-wrap: wrap;
45
44
  gap: dimensions.get-size(math.div(2, 24));
46
45
 
47
46
  &--reverse {
@@ -23,6 +23,7 @@
23
23
  @include utils.interactive($with-background: false);
24
24
  @include utils.with-outline-bold();
25
25
 
26
+ appearance: none;
26
27
  border-radius: var(--odx-v-border-radius-controls);
27
28
  min-width: dimensions.get-size(1.5);
28
29
  vertical-align: middle;
@@ -31,10 +32,6 @@
31
32
  min-width: dimensions.get-size(3);
32
33
  }
33
34
 
34
- &__label {
35
- @include typography.prevent-text-overflow();
36
- }
37
-
38
35
  > .odx-icon {
39
36
  @include dimensions.margin-x(-$icon-margin);
40
37
  }
@@ -129,6 +126,7 @@
129
126
  @include dimensions.padding-x(2 * $icon-margin);
130
127
  @include typography.font-size(-1);
131
128
 
129
+ line-height: dimensions.get-size(1);
132
130
  min-width: dimensions.get-size(1);
133
131
 
134
132
  &:not(:has(> .odx-icon, > .odx-avatar)) {
@@ -0,0 +1,23 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+
4
+ $form-field-inner-padding: math.div(8, 24);
5
+
6
+ .odx-chip-list {
7
+ $root: &;
8
+
9
+ display: flex;
10
+ flex-direction: column;
11
+ width: 100%;
12
+
13
+ &-row {
14
+ &:has(.odx-chip) {
15
+ @include dimensions.padding($form-field-inner-padding, ('top', 'left', 'right'));
16
+ @include dimensions.padding(math.div(4, 24), ('bottom'));
17
+
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ gap: dimensions.get-size($form-field-inner-padding);
21
+ }
22
+ }
23
+ }
@@ -19,6 +19,13 @@ $dropdown-open-selector: '.odx-dropdown-host[aria-expanded="true"]';
19
19
  min-height: inherit;
20
20
  overflow: auto;
21
21
  }
22
+
23
+ &__option-list {
24
+ display: flex;
25
+ flex-direction: column;
26
+ max-height: var(--odx-select-max-height);
27
+ min-height: dimensions.get-size(1.5);
28
+ }
22
29
  }
23
30
 
24
31
  .odx-dropdown-overlay {
@@ -5,6 +5,7 @@
5
5
  .odx-expandable-list-item {
6
6
  $root: &;
7
7
 
8
+ display: block;
8
9
  position: relative;
9
10
 
10
11
  &::before {
@@ -13,6 +14,7 @@
13
14
  border-bottom: 1px solid var(--gray-200);
14
15
  content: '';
15
16
  display: block;
17
+ left: dimensions.get-size(math.div(1, 3));
16
18
  position: absolute;
17
19
  top: 0;
18
20
  width: calc(100% - #{dimensions.get-size(math.div(14, 24))});
@@ -27,7 +29,6 @@
27
29
  }
28
30
 
29
31
  &--danger + &::before,
30
- &--expanded + &::before,
31
32
  &:hover + &::before {
32
33
  border-color: transparent;
33
34
  }
@@ -59,6 +60,17 @@
59
60
  }
60
61
 
61
62
  &__slot {
63
+ #{$root}:last-child & {
64
+ .odx-list-item:last-child::after {
65
+ border-bottom: 1px solid var(--gray-200);
66
+ bottom: 0;
67
+ content: '';
68
+ display: block;
69
+ position: absolute;
70
+ width: calc(100% - #{dimensions.get-size(math.div(14, 24))});
71
+ }
72
+ }
73
+
62
74
  .odx-list-item__content {
63
75
  @include dimensions.padding(math.div(36, 24), left);
64
76
  }
@@ -15,6 +15,7 @@ body {
15
15
  .odx-form,
16
16
  .odx-form-group {
17
17
  --odx-grid-gutter: #{dimensions.get-size(0.5)};
18
+ --odx-form-field-horizontal-label-width: #{dimensions.get-size(math.div(150, 24))};
18
19
 
19
20
  row-gap: 0;
20
21
  }
@@ -60,10 +61,9 @@ body {
60
61
  }
61
62
 
62
63
  &-label {
63
- @include typography.prevent-text-overflow();
64
-
65
- display: block;
66
- max-width: 100%;
64
+ #{$root}:not(#{$root}--horizontal) & {
65
+ @include typography.prevent-text-overflow();
66
+ }
67
67
  }
68
68
 
69
69
  &__label {
@@ -71,16 +71,21 @@ body {
71
71
  @include dimensions.margin(-$form-field-label-height, 'top');
72
72
  @include typography.font-size(-1);
73
73
 
74
- display: flex;
75
74
  user-select: none;
76
75
 
77
- #{$root}--required:not(.is-readonly, .is-disabled) &::after {
76
+ #{$root}:not(#{$root}--horizontal, #{$root}--simple) & {
77
+ display: flex;
78
+ }
79
+
80
+ &-is-required {
78
81
  @include typography.font-size(0);
79
82
 
80
- color: var(--odx-c-error-text);
81
- content: '*';
82
83
  margin-left: 2px;
83
84
  vertical-align: top;
85
+
86
+ #{$root}--required:not(.is-readonly, .is-disabled) & {
87
+ color: var(--odx-c-error-text);
88
+ }
84
89
  }
85
90
  }
86
91
 
@@ -216,6 +221,24 @@ body {
216
221
  display: none;
217
222
  }
218
223
  }
224
+
225
+ &--horizontal {
226
+ @include dimensions.padding(math.div(8, 24), top);
227
+
228
+ flex-direction: row;
229
+
230
+ #{$root}__label {
231
+ @include dimensions.margin(0.25, top);
232
+
233
+ flex: 0 0 var(--odx-form-field-horizontal-label-width);
234
+ max-width: var(--odx-form-field-horizontal-label-width);
235
+ padding-left: 0;
236
+ }
237
+
238
+ #{$root}__inner {
239
+ flex: 1;
240
+ }
241
+ }
219
242
  }
220
243
 
221
244
  .odx-form-field.is-readonly,
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  .odx-action-group:not(:last-child) {
33
- border-right: 1px solid var(--odx-c-seperator);
33
+ border-right: 1px solid var(--odx-c-separator);
34
34
  margin-right: dimensions.get-size(0.5);
35
35
  padding-right: dimensions.get-size(0.5);
36
36
  }
@@ -5,26 +5,17 @@
5
5
  $icon-sizes: (small math.div(16, 24) 1, large math.div(32, 24) 2, xlarge math.div(48, 24) 2);
6
6
 
7
7
  .odx-icon {
8
- @include dimensions.container(1);
9
- @include utils.center-content(true);
10
-
11
8
  flex: 0 0 auto;
12
9
  font-size: dimensions.get-size(1);
13
10
 
14
11
  @each $size, $size_factor, $factor in $icon-sizes {
15
12
  &--#{$size} {
16
- @include dimensions.container($factor, $size_factor);
17
-
18
13
  font-size: dimensions.get-size($size_factor);
19
14
  }
20
15
  }
21
16
 
22
17
  &--inline {
23
- @include dimensions.margin-y(0);
24
-
25
18
  font-size: inherit;
26
- height: 0.8em;
27
- line-height: 0.8em;
28
- width: 0.8em;
19
+ vertical-align: -0.1em;
29
20
  }
30
21
  }
@@ -119,7 +119,11 @@ $modal-padding: math.div(12, 24);
119
119
  @include dimensions.padding($modal-padding, bottom);
120
120
 
121
121
  gap: dimensions.get-size(math.div(16, 24));
122
- justify-content: flex-end;
122
+ margin-left: auto;
123
+
124
+ > .odx-button {
125
+ display: flex;
126
+ }
123
127
  }
124
128
  }
125
129
 
@@ -0,0 +1,38 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/motion';
4
+ @use '../abstract/typography';
5
+
6
+ .odx-option {
7
+ @include dimensions.line-height(1.5, 1);
8
+ @include dimensions.margin(math.div(4, 24), bottom);
9
+ @include dimensions.padding-x(0.5);
10
+ @include motion.transition(background-color color outline-color);
11
+ @include typography.font-weight(normal);
12
+
13
+ border-radius: var(--odx-v-border-radius-controls);
14
+ cursor: pointer;
15
+ user-select: none;
16
+
17
+ &:last-child {
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ &.is-active,
22
+ &:hover {
23
+ background-color: var(--gray-50);
24
+ }
25
+
26
+ &.is-selected {
27
+ background-color: var(--cyan-500-15);
28
+ }
29
+
30
+ &.is-disabled {
31
+ color: var(--odx-control-color-disabled);
32
+ pointer-events: none;
33
+ }
34
+
35
+ > .odx-checkbox {
36
+ @include dimensions.margin(math.div(8, 24), right);
37
+ }
38
+ }
@@ -66,44 +66,3 @@ body {
66
66
  }
67
67
  }
68
68
  }
69
-
70
- .odx-select-dropdown {
71
- display: flex;
72
- flex-direction: column;
73
- max-height: var(--odx-select-max-height);
74
- min-height: dimensions.get-size(1.5);
75
- }
76
-
77
- .odx-option {
78
- @include dimensions.line-height(1.5, 1);
79
- @include dimensions.margin(math.div(4, 24), bottom);
80
- @include dimensions.padding-x(0.5);
81
- @include motion.transition(background-color color outline-color);
82
- @include typography.font-weight(normal);
83
-
84
- border-radius: var(--odx-v-border-radius-controls);
85
- cursor: pointer;
86
- user-select: none;
87
-
88
- &:last-child {
89
- margin-bottom: 0;
90
- }
91
-
92
- &.is-active,
93
- &:hover {
94
- background-color: var(--gray-50);
95
- }
96
-
97
- &.is-selected {
98
- background-color: var(--cyan-500-15);
99
- }
100
-
101
- &.is-disabled {
102
- color: var(--odx-control-color-disabled);
103
- pointer-events: none;
104
- }
105
-
106
- > .odx-checkbox {
107
- @include dimensions.margin(math.div(8, 24), right);
108
- }
109
- }
@@ -0,0 +1,94 @@
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-table {
9
+ --odx-table-background-color: var(--white);
10
+ --odx-table-head-border-color: var(--gray-900);
11
+ --odx-table-cell-border-color: var(--gray-200);
12
+ --odx-table-cell-background-color-hover: var(--blue-700-5);
13
+ --odx-table-cell-background-color-striped: var(--gray-50);
14
+ --odx-table-cell-background-color-active: var(--cyan-500-15);
15
+
16
+ $root: &;
17
+
18
+ background: var(--odx-table-background-color);
19
+ border: 0;
20
+ border-spacing: 0;
21
+ min-width: 100%;
22
+ table-layout: auto;
23
+ white-space: normal;
24
+
25
+ &__header-cell,
26
+ &__cell {
27
+ @include dimensions.padding-x(0.5);
28
+
29
+ border-bottom-style: solid;
30
+ border-bottom-width: 1px;
31
+ text-align: left;
32
+ }
33
+
34
+ &__cell {
35
+ border-bottom-color: var(--odx-table-cell-border-color);
36
+ height: dimensions.get-size(2);
37
+ vertical-align: middle;
38
+ }
39
+
40
+ &__header-cell-title {
41
+ align-items: center;
42
+ display: flex;
43
+ gap: dimensions.get-size(math.div(8, 24));
44
+ height: dimensions.get-size(2);
45
+ user-select: none;
46
+
47
+ &.sortable {
48
+ cursor: pointer;
49
+
50
+ > svg {
51
+ display: inline-block;
52
+ height: auto;
53
+ width: dimensions.get-size(math.div(16, 24));
54
+ }
55
+ }
56
+ }
57
+
58
+ &__header-cell {
59
+ @include typography.font-weight(medium);
60
+
61
+ border-bottom-color: var(--odx-table-head-border-color);
62
+
63
+ .odx-form-field {
64
+ height: dimensions.get-size(2);
65
+ justify-content: center;
66
+ padding: 0;
67
+
68
+ &__info {
69
+ display: none;
70
+ }
71
+ }
72
+ }
73
+
74
+ &--striped {
75
+ .odx-table__row:nth-child(odd) {
76
+ background-color: var(--odx-table-cell-background-color-striped);
77
+ }
78
+ }
79
+
80
+ &__body {
81
+ /* stylelint-disable-next-line no-descending-specificity */
82
+ .odx-table__row {
83
+ @include motion.transition(background-color);
84
+
85
+ &:hover {
86
+ background-color: var(--odx-table-cell-background-color-hover);
87
+ }
88
+
89
+ &:focus-visible {
90
+ background-color: var(--odx-table-cell-background-color-active);
91
+ }
92
+ }
93
+ }
94
+ }