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

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 (62) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +32 -0
  3. package/core-theme.css +1 -1
  4. package/package.json +6 -8
  5. package/scss/{modules → abstract}/_breakpoints.scss +11 -11
  6. package/scss/{modules/_vertical-rythm.scss → abstract/_dimensions.scss} +28 -26
  7. package/scss/abstract/_index.scss +5 -0
  8. package/scss/abstract/_motion.scss +10 -0
  9. package/scss/abstract/_typography.scss +25 -0
  10. package/scss/abstract/_utils.scss +114 -0
  11. package/scss/components/accordion-item.component.scss +59 -0
  12. package/scss/components/accordion.component.scss +3 -0
  13. package/scss/components/{action-group/action-group.component.scss → action-group.component.scss} +10 -6
  14. package/scss/components/{area-header/area-header.component.scss → area-header.component.scss} +28 -27
  15. package/scss/components/{avatar/avatar.component.scss → avatar.component.scss} +13 -13
  16. package/scss/components/{badge/badge.component.scss → badge.component.scss} +10 -10
  17. package/scss/components/button-group.component.scss +98 -0
  18. package/scss/components/button.component.scss +123 -0
  19. package/scss/components/checkbox.component.scss +116 -0
  20. package/scss/components/content-box.component.scss +50 -0
  21. package/scss/components/form-field.component.scss +204 -0
  22. package/scss/components/header.component.scss +40 -0
  23. package/scss/components/icon.component.scss +35 -0
  24. package/scss/components/{link/link.component.scss → link.component.scss} +6 -4
  25. package/scss/components/{logo/logo.component.scss → logo.component.scss} +5 -4
  26. package/scss/components/main-menu-button.component.scss +7 -0
  27. package/scss/components/{main-menu/components/main-menu-item.component.scss → main-menu-item.component.scss} +13 -12
  28. package/scss/components/{main-menu/main-menu.component.scss → main-menu.component.scss} +35 -28
  29. package/scss/components/modal.component.scss +85 -0
  30. package/scss/components/radio-button.component.scss +120 -0
  31. package/scss/components/radio-group.component.scss +14 -0
  32. package/scss/components/switch.component.scss +163 -0
  33. package/scss/components/toggle-button-group.component.scss +25 -0
  34. package/scss/components/toggle-button.component.scss +55 -0
  35. package/scss/core.scss +34 -30
  36. package/scss/layout/_base.scss +29 -0
  37. package/scss/layout/_helpers.scss +95 -0
  38. package/scss/{modules → layout}/_layout.scss +96 -46
  39. package/scss/layout/_typography.scss +117 -0
  40. package/scss/{base/_reset.scss → reset.scss} +25 -5
  41. package/scss/variables/_color-palettes.scss +57 -54
  42. package/scss/variables/_colors.scss +12 -15
  43. package/scss/variables/_controls.scss +48 -0
  44. package/scss/variables/_index.scss +6 -0
  45. package/scss/variables/_typography.scss +18 -0
  46. package/scss/variables/_vertical-rythm.scss +3 -0
  47. package/scss/variables/_visuals.scss +12 -7
  48. package/core-icons.css +0 -13
  49. package/scss/_helpers.scss +0 -15
  50. package/scss/base/_mixins.scss +0 -3
  51. package/scss/base/_utils.scss +0 -19
  52. package/scss/base/mixins/_container.scss +0 -31
  53. package/scss/base/mixins/_control.scss +0 -50
  54. package/scss/base/mixins/_transition.scss +0 -10
  55. package/scss/components/button/button.component.scss +0 -94
  56. package/scss/components/checkbox/checkbox.component.scss +0 -130
  57. package/scss/components/content-box/content-box.component.scss +0 -50
  58. package/scss/components/header/header.component.scss +0 -39
  59. package/scss/components/icon/icon.component.scss +0 -38
  60. package/scss/components/main-menu/components/main-menu-button.component.scss +0 -7
  61. package/scss/components/radio-group/_radio-group.component.scss +0 -145
  62. package/scss/modules/_typography.scss +0 -161
@@ -0,0 +1,5 @@
1
+ @forward 'breakpoints';
2
+ @forward 'dimensions';
3
+ @forward 'motion';
4
+ @forward 'typography';
5
+ @forward 'utils';
@@ -0,0 +1,10 @@
1
+ @mixin transition($properties, $duration: var(--odx-v-transition-duration), $delay: 0ms) {
2
+ $props: ();
3
+
4
+ @each $prop in $properties {
5
+ $props: append($props, $prop, comma);
6
+ }
7
+
8
+ transition: all $duration $delay var(--odx-v-transition-easing-fn);
9
+ transition-property: $props;
10
+ }
@@ -0,0 +1,25 @@
1
+ @use 'sass:math';
2
+ @use 'utils';
3
+
4
+ @mixin font-size($size: 1) {
5
+ @if math.round($size) != $size {
6
+ @error '$size must me an integer';
7
+ }
8
+
9
+ @if $size < 0 {
10
+ font-size: calc(var(--odx-typography-base-size) * utils.css-pow(var(--odx-typography-negative-font-scaling-factor), $size));
11
+ } @else {
12
+ font-size: calc(var(--odx-typography-base-size) * utils.css-pow(var(--odx-typography-positive-font-scaling-factor), $size));
13
+ }
14
+ }
15
+
16
+ @mixin font-weight($value: normal) {
17
+ font-weight: var(--odx-typography-font-weight-#{$value});
18
+ letter-spacing: var(--odx-typography-font-weight-#{$value}-letter-spacing);
19
+ }
20
+
21
+ @mixin prevent-text-overflow() {
22
+ overflow: hidden;
23
+ text-overflow: ellipsis;
24
+ white-space: nowrap;
25
+ }
@@ -0,0 +1,114 @@
1
+ @use 'sass:math';
2
+
3
+ @function css-pow($value, $exponent) {
4
+ $css-value: 1;
5
+
6
+ @if $exponent < 0 {
7
+ @for $i from 1 through math.abs($exponent) {
8
+ $css-value: $css-value + '*1/#{$value}';
9
+ }
10
+ }
11
+
12
+ @if $exponent > 0 {
13
+ @for $i from 1 through $exponent {
14
+ $css-value: $css-value + '*#{$value}';
15
+ }
16
+ }
17
+
18
+ @return calc(#{$css-value});
19
+ }
20
+
21
+ @mixin center-content($inline: false) {
22
+ @if $inline {
23
+ display: inline-flex;
24
+ } @else {
25
+ display: flex;
26
+ }
27
+
28
+ align-items: center;
29
+ justify-content: center;
30
+ }
31
+
32
+ @mixin vertical-center-content($inline: false) {
33
+ @if $inline {
34
+ display: inline-flex;
35
+ } @else {
36
+ display: flex;
37
+ }
38
+
39
+ align-items: center;
40
+ }
41
+
42
+ @mixin horizontal-center-content($inline: false) {
43
+ @if $inline {
44
+ display: inline-flex;
45
+ } @else {
46
+ display: flex;
47
+ }
48
+
49
+ justify-content: center;
50
+ }
51
+
52
+ @mixin visually-hidden() {
53
+ appearance: none;
54
+ height: 0;
55
+ margin: 0;
56
+ opacity: 0;
57
+ outline: none !important;
58
+ padding: 0;
59
+ position: absolute;
60
+ width: 0;
61
+ }
62
+
63
+ @mixin _focus-styles($with-background) {
64
+ outline-color: var(--odx-c-focus-outline);
65
+ @if $with-background {
66
+ &,
67
+ &:hover {
68
+ background-color: var(--odx-c-focus);
69
+ }
70
+ }
71
+ }
72
+
73
+ @mixin focus-state($with-background: true, $focus-within: false, $focus-within-selector: null) {
74
+ @if $focus-within {
75
+ @if $focus-within-selector {
76
+ $focus-within-selector: '#{$focus-within-selector}:focus-visible';
77
+ } @else {
78
+ $focus-within-selector: ':focus-visible';
79
+ }
80
+
81
+ &:focus-within:has(#{$focus-within-selector}) {
82
+ @include _focus-styles($with-background);
83
+ @content;
84
+ }
85
+ } @else {
86
+ &:focus-visible {
87
+ @include _focus-styles($with-background);
88
+ @content;
89
+ }
90
+ }
91
+ }
92
+
93
+ @mixin with-outline {
94
+ outline: var(--odx-v-outline);
95
+ outline-offset: var(--odx-v-outline-offset);
96
+ }
97
+
98
+ @mixin interactive($with-background: true, $focus-within: false) {
99
+ @include with-outline;
100
+ @include focus-state($with-background, $focus-within);
101
+
102
+ cursor: pointer;
103
+ user-select: none;
104
+
105
+ &:disabled,
106
+ &.is-disabled {
107
+ @include non-interactive();
108
+ }
109
+ }
110
+
111
+ @mixin non-interactive() {
112
+ pointer-events: none;
113
+ user-select: none;
114
+ }
@@ -0,0 +1,59 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+ @use '../abstract/motion';
4
+ @use '../abstract/typography';
5
+ @use '../abstract/utils';
6
+
7
+ .odx-accordion-item {
8
+ $root: &;
9
+
10
+ @include dimensions.padding(math.div(1, 6), 'bottom');
11
+
12
+ border-bottom: 1px solid var(--odx-input-control-outline-color);
13
+ display: block;
14
+
15
+ &:not(:last-child) {
16
+ @include dimensions.margin(1, 'bottom');
17
+ }
18
+
19
+ &__panel {
20
+ @include dimensions.padding-x(math.div(4, 24));
21
+ @include dimensions.line-height(1.5, 1);
22
+ @include motion.transition(background-color outline-color);
23
+ @include utils.interactive(true);
24
+
25
+ border-radius: var(--odx-v-border-radius-controls);
26
+ display: grid;
27
+ grid-template-columns: 1fr auto;
28
+
29
+ &:hover {
30
+ background-color: var(--blue-700-5);
31
+ }
32
+
33
+ #{$root}--expanded & {
34
+ @include typography.font-weight(medium);
35
+ }
36
+ }
37
+
38
+ &__icon {
39
+ @include motion.transition(transform);
40
+
41
+ transform: rotate(0deg);
42
+
43
+ #{$root}--expanded & {
44
+ transform: rotateX(180deg);
45
+ }
46
+ }
47
+
48
+ &__slot {
49
+ @include dimensions.padding-x(math.div(4, 24));
50
+ @include dimensions.padding-y(math.div(8, 24));
51
+
52
+ overflow: hidden;
53
+ }
54
+
55
+ &.is-disabled {
56
+ color: var(--odx-c-text-disabled);
57
+ pointer-events: none;
58
+ }
59
+ }
@@ -0,0 +1,3 @@
1
+ .odx-accordion {
2
+ display: block;
3
+ }
@@ -1,12 +1,12 @@
1
- @use '../../modules/vertical-rythm' as vr;
2
- @use '../../base/mixins' as mx;
3
- @use '../button/button.component';
1
+ @use '../abstract/dimensions';
2
+ @use '../abstract/utils';
3
+ @use 'button.component';
4
4
 
5
5
  .odx-action-group {
6
- @include vr.height(2, 1.5);
7
- @include mx.vertical-center-content(true);
6
+ @include dimensions.height(2, 1.5);
7
+ @include utils.vertical-center-content(true);
8
8
 
9
- gap: vr.get-size(0.25);
9
+ gap: dimensions.get-size(0.25);
10
10
 
11
11
  &--reverse {
12
12
  flex-direction: row-reverse;
@@ -18,6 +18,10 @@
18
18
 
19
19
  color: var(--odx-c-control-text);
20
20
 
21
+ &:hover {
22
+ color: var(--odx-c-control-text);
23
+ }
24
+
21
25
  &:focus-visible {
22
26
  outline-color: var(--odx-c-focus-outline);
23
27
  }
@@ -1,9 +1,10 @@
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 '../avatar/avatar.component';
6
- @use '../../base/mixins' as mx;
2
+ @use '../abstract/breakpoints';
3
+ @use '../abstract/dimensions';
4
+ @use '../abstract/utils';
5
+ @use '../abstract/typography';
6
+ @use 'avatar.component';
7
+ @use '../layout/typography' as *;
7
8
 
8
9
  :root {
9
10
  --odx-area-header-title-color: var(--odx-c-headline);
@@ -11,11 +12,11 @@
11
12
  }
12
13
 
13
14
  .odx-area-header {
14
- @include vr.padding-x(1);
15
+ @include dimensions.padding-x(1);
15
16
 
16
17
  &,
17
18
  &__container {
18
- column-gap: vr.get-size(math.div(20, 24));
19
+ column-gap: dimensions.get-size(math.div(20, 24));
19
20
  display: flex;
20
21
  }
21
22
 
@@ -27,7 +28,7 @@
27
28
  &__inner,
28
29
  &__title,
29
30
  &__subtitle {
30
- @include t.prevent-text-overflow();
31
+ @include typography.prevent-text-overflow();
31
32
  }
32
33
 
33
34
  &__title,
@@ -65,10 +66,10 @@
65
66
  }
66
67
 
67
68
  &__content {
68
- @include mx.vertical-center-content();
69
+ @include utils.vertical-center-content();
69
70
 
70
71
  flex-wrap: wrap;
71
- min-height: vr.get-size(2);
72
+ min-height: dimensions.get-size(2);
72
73
  }
73
74
 
74
75
  &--small,
@@ -84,7 +85,7 @@
84
85
 
85
86
  &--large,
86
87
  &--xlarge {
87
- @include br.down(tablet) {
88
+ @include breakpoints.down(tablet) {
88
89
  flex-wrap: wrap;
89
90
 
90
91
  .odx-area-header__content {
@@ -95,8 +96,8 @@
95
96
  }
96
97
 
97
98
  &--medium {
98
- @include br.up(tablet) {
99
- @include vr.padding-y(0.5);
99
+ @include breakpoints.up(tablet) {
100
+ @include dimensions.padding-y(0.5);
100
101
  }
101
102
 
102
103
  .odx-area-header__title {
@@ -105,17 +106,17 @@
105
106
  }
106
107
 
107
108
  &--large {
108
- @include vr.padding-y(0.25);
109
+ @include dimensions.padding-y(0.25);
109
110
 
110
- @include br.up(tablet) {
111
- @include vr.padding-y(0.5);
111
+ @include breakpoints.up(tablet) {
112
+ @include dimensions.padding-y(0.5);
112
113
  }
113
114
 
114
115
  .odx-area-header__title {
115
116
  @extend .odx-title--4;
116
117
 
117
- @include br.down(tablet) {
118
- @include vr.line-height(1);
118
+ @include breakpoints.down(tablet) {
119
+ @include dimensions.line-height(1);
119
120
  }
120
121
  }
121
122
 
@@ -125,15 +126,15 @@
125
126
  }
126
127
 
127
128
  &--xlarge {
128
- @include vr.padding-y(0.5);
129
+ @include dimensions.padding-y(0.5);
129
130
 
130
- @include br.up(tablet) {
131
- @include vr.padding-y(1);
131
+ @include breakpoints.up(tablet) {
132
+ @include dimensions.padding-y(1);
132
133
 
133
- gap: vr.get-size(1);
134
+ gap: dimensions.get-size(1);
134
135
 
135
136
  .odx-area-header__container {
136
- @include vr.padding(1, top);
137
+ @include dimensions.padding(1, top);
137
138
  }
138
139
  }
139
140
 
@@ -148,16 +149,16 @@
148
149
  .odx-avatar {
149
150
  @extend .odx-avatar--large;
150
151
 
151
- @include br.up(tablet) {
152
- @include vr.margin(-0.5, top);
152
+ @include breakpoints.up(tablet) {
153
+ @include dimensions.margin(-0.5, top);
153
154
  }
154
155
  }
155
156
 
156
157
  .odx-area-header__content {
157
158
  align-self: flex-end;
158
159
 
159
- @include br.up(tablet) {
160
- @include vr.margin(-0.5, bottom);
160
+ @include breakpoints.up(tablet) {
161
+ @include dimensions.margin(-0.5, bottom);
161
162
  }
162
163
  }
163
164
  }
@@ -1,29 +1,29 @@
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
28
  vertical-align: middle;
29
29
 
@@ -34,7 +34,7 @@
34
34
  &--medium {
35
35
  @include avatar-size(2, 1.5, 0, 1);
36
36
 
37
- @include br.up(tablet) {
37
+ @include breakpoints.up(tablet) {
38
38
  @include avatar-size(3, math.div(64, 24), 2, 1.5);
39
39
  }
40
40
  }
@@ -42,7 +42,7 @@
42
42
  &--large {
43
43
  @include avatar-size(3, math.div(64, 24), 2, 1.5);
44
44
 
45
- @include br.up(tablet) {
45
+ @include breakpoints.up(tablet) {
46
46
  @include avatar-size(4, 4, 4, 2.25);
47
47
  }
48
48
  }
@@ -1,28 +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
21
  left: 0;
23
22
  min-width: $badge-size;
24
23
  outline: 1px solid transparent;
25
24
  top: 0;
25
+ vertical-align: middle;
26
26
  z-index: 9999;
27
27
 
28
28
  &::before {
@@ -0,0 +1,98 @@
1
+ @use 'sass:math';
2
+ @use '../abstract/dimensions';
3
+
4
+ @mixin buttons-radius($vertical: false, $reversed: false) {
5
+ $start: 'first';
6
+ $end: 'last';
7
+ @if $reversed {
8
+ $start: 'last';
9
+ $end: 'first';
10
+ }
11
+
12
+ @if $vertical {
13
+ margin: 0;
14
+
15
+ &:#{$start}-child {
16
+ border-bottom-left-radius: 0;
17
+ border-bottom-right-radius: 0;
18
+ }
19
+
20
+ &:#{$end}-child {
21
+ border-top-left-radius: 0;
22
+ border-top-right-radius: 0;
23
+ }
24
+ } @else {
25
+ &:#{$start}-child {
26
+ border-bottom-right-radius: 0;
27
+ border-top-right-radius: 0;
28
+ }
29
+
30
+ &:#{$end}-child {
31
+ border-bottom-left-radius: 0;
32
+ border-top-left-radius: 0;
33
+ }
34
+ }
35
+
36
+ &:not(:first-child, :last-child) {
37
+ border-radius: 0;
38
+ }
39
+ }
40
+
41
+ .odx-button-group {
42
+ display: inline-flex;
43
+ flex-wrap: wrap;
44
+ gap: dimensions.get-size(math.div(2, 24));
45
+
46
+ &--reverse {
47
+ flex-direction: row-reverse;
48
+ justify-content: flex-end;
49
+ }
50
+
51
+ &--reverse#{&}--vertical#{&}--block {
52
+ flex-direction: column-reverse;
53
+ justify-content: flex-end;
54
+ }
55
+
56
+ &--block {
57
+ display: flex;
58
+ width: 100%;
59
+ }
60
+
61
+ &:not(#{&}--vertical)#{&}--align-right {
62
+ justify-content: flex-end;
63
+ }
64
+
65
+ &:not(#{&}--vertical)#{&}--align-right#{&}--reverse {
66
+ justify-content: flex-start;
67
+ }
68
+
69
+ &:not(#{&}--vertical, #{&}--reverse) .odx-button {
70
+ @include buttons-radius();
71
+ }
72
+
73
+ &:not(#{&}--vertical)#{&}--reverse .odx-button {
74
+ @include buttons-radius(false, true);
75
+ }
76
+
77
+ &--vertical {
78
+ @include dimensions.margin-y(math.div(10, 24));
79
+
80
+ flex-direction: column;
81
+
82
+ .odx-button {
83
+ @include dimensions.height(math.div(35, 24));
84
+ }
85
+ }
86
+
87
+ &:not(#{&}--reverse)#{&}--vertical {
88
+ .odx-button {
89
+ @include buttons-radius(true);
90
+ }
91
+ }
92
+
93
+ &#{&}--reverse#{&}--vertical {
94
+ .odx-button {
95
+ @include buttons-radius(true, true);
96
+ }
97
+ }
98
+ }