@odx/ui 1.0.0-rc.1

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 (37) hide show
  1. package/24031beb1b96a58f519c.woff2 +0 -0
  2. package/5eabf29514e9649c8c73.woff2 +0 -0
  3. package/README.md +0 -0
  4. package/core-icons.css +13 -0
  5. package/core-theme.css +1 -0
  6. package/eb2051d1f9da906e0b3e.woff2 +0 -0
  7. package/package.json +16 -0
  8. package/scss/_helpers.scss +15 -0
  9. package/scss/base/_mixins.scss +3 -0
  10. package/scss/base/_reset.scss +136 -0
  11. package/scss/base/_utils.scss +19 -0
  12. package/scss/base/mixins/_container.scss +31 -0
  13. package/scss/base/mixins/_control.scss +50 -0
  14. package/scss/base/mixins/_transition.scss +10 -0
  15. package/scss/components/action-group/action-group.component.scss +25 -0
  16. package/scss/components/area-header/area-header.component.scss +164 -0
  17. package/scss/components/avatar/avatar.component.scss +59 -0
  18. package/scss/components/badge/badge.component.scss +59 -0
  19. package/scss/components/button/button.component.scss +94 -0
  20. package/scss/components/checkbox/checkbox.component.scss +130 -0
  21. package/scss/components/content-box/content-box.component.scss +50 -0
  22. package/scss/components/header/header.component.scss +39 -0
  23. package/scss/components/icon/icon.component.scss +38 -0
  24. package/scss/components/link/link.component.scss +50 -0
  25. package/scss/components/logo/logo.component.scss +27 -0
  26. package/scss/components/main-menu/components/main-menu-button.component.scss +7 -0
  27. package/scss/components/main-menu/components/main-menu-item.component.scss +45 -0
  28. package/scss/components/main-menu/main-menu.component.scss +117 -0
  29. package/scss/components/radio-group/_radio-group.component.scss +145 -0
  30. package/scss/core.scss +43 -0
  31. package/scss/modules/_breakpoints.scss +80 -0
  32. package/scss/modules/_layout.scss +108 -0
  33. package/scss/modules/_typography.scss +161 -0
  34. package/scss/modules/_vertical-rythm.scss +78 -0
  35. package/scss/variables/_color-palettes.scss +90 -0
  36. package/scss/variables/_colors.scss +85 -0
  37. package/scss/variables/_visuals.scss +11 -0
@@ -0,0 +1,117 @@
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;
6
+ @use '../button/button.component';
7
+ @use 'components/main-menu-button.component';
8
+ @use 'components/main-menu-item.component';
9
+
10
+ :root {
11
+ --odx-main-menu-max-width: 100vw;
12
+ --odx-main-menu-background-color: var(--odx-c-primary);
13
+ --odx-main-menu-text-color: var(--odx-c-primary-text);
14
+ --odx-main-menu-highlight-color: var(--odx-c-highlight);
15
+
16
+ @include br.up(phone) {
17
+ --odx-main-menu-max-width: min(100vw, 384px);
18
+ }
19
+ }
20
+
21
+ .odx-main-menu {
22
+ --odx-area-header-title-color: var(--odx-main-menu-highlight-color);
23
+ --odx-area-header-subtitle-color: var(--odx-c-text-inverse);
24
+
25
+ &__inner {
26
+ background-color: var(--odx-main-menu-background-color);
27
+ color: var(--odx-main-menu-text-color);
28
+ display: grid;
29
+ grid-template-rows: auto auto 1fr auto auto;
30
+ height: 100%;
31
+ left: 0;
32
+ max-height: 100vh;
33
+ max-width: var(--odx-main-menu-max-width);
34
+ position: fixed;
35
+ top: 0;
36
+ z-index: 9000;
37
+ }
38
+
39
+ &__overlay {
40
+ background-color: var(--odx-c-overlay);
41
+ height: 100%;
42
+ left: 0;
43
+ position: absolute;
44
+ top: 0;
45
+ width: 100%;
46
+ z-index: 8999;
47
+ }
48
+
49
+ &__actions {
50
+ @include vr.height(2);
51
+ @include vr.margin-x(0.5);
52
+ }
53
+
54
+ &__header,
55
+ &__footer {
56
+ max-width: inherit;
57
+ }
58
+
59
+ &__close {
60
+ @extend .odx-button--ghost;
61
+
62
+ align-self: flex-start;
63
+ color: inherit;
64
+ }
65
+
66
+ &__content {
67
+ @include vr.padding-x(0.5);
68
+
69
+ display: flex;
70
+ flex-direction: column;
71
+ max-width: calc(var(--odx-main-menu-max-width) + vr.get-size(2));
72
+ min-height: vr.get-size(5);
73
+ overflow: auto;
74
+
75
+ > * {
76
+ flex: 0 0 auto;
77
+ }
78
+ }
79
+
80
+ &__info {
81
+ @extend .odx-text;
82
+ @include vr.padding-x(1);
83
+ @include vr.padding-y(0.5);
84
+
85
+ column-gap: vr.get-size(1);
86
+ display: flex;
87
+ flex-wrap: wrap;
88
+
89
+ @include br.up(tablet) {
90
+ @include vr.padding-y(1);
91
+ }
92
+ }
93
+
94
+ &__footer {
95
+ @include mx.center-content();
96
+ @include vr.height(1);
97
+ @include vr.padding-x(1);
98
+ @include vr.padding(math.div(16, 24), top);
99
+ @include vr.padding(math.div(32, 24), bottom);
100
+
101
+ display: grid;
102
+ gap: vr.get-size(0.5);
103
+ grid-template-columns: 1fr auto;
104
+ user-select: none;
105
+
106
+ > .odx-text {
107
+ @include vr.line-height(math.div(12, 24));
108
+
109
+ opacity: 0.3;
110
+ word-wrap: break-word;
111
+ }
112
+ }
113
+
114
+ .odx-link:visited {
115
+ color: var(--odx-c-link);
116
+ }
117
+ }
@@ -0,0 +1,145 @@
1
+ @use 'sass:math';
2
+ @use '../../modules/vertical-rythm' as vr;
3
+ @use '../../modules/typography' as t;
4
+ @use '../../base/mixins' as mx;
5
+
6
+ :root {
7
+ --odx-radio-button-color: var(--odx-c-highlight-text);
8
+ --odx-radio-button-color-disabled: var(--odx-c-control-text-disabled);
9
+
10
+ --odx-radio-button-background-color: var(--odx-c-control);
11
+ --odx-radio-button-background-color-active: var(--odx-c-highlight);
12
+ --odx-radio-button-background-color-disabled: var(--odx-c-control-disabled);
13
+ --odx-radio-button-background-color-readonly: var(--white);
14
+
15
+ --odx-radio-button-border-color: var(--odx-c-control-disabled);
16
+ --odx-radio-button-border-color-active: var(--odx-c-highlight);
17
+ --odx-radio-button-border-color-hover: var(--odx-c-control-hover);
18
+ --odx-radio-button-border-color-readonly: var(--odx-c-control-disabled);
19
+
20
+ --odx-radio-button-label-color: var(--odx-c-text);
21
+ --odx-radio-button-label-color-disabled: var(--odx-c-text-disabled);
22
+ }
23
+
24
+ .odx-radio-group {
25
+ @include vr.padding-y(0.5);
26
+
27
+ display: block;
28
+
29
+ &--horizontal {
30
+ column-gap: vr.get-size(0.5);
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ }
34
+ }
35
+
36
+ .odx-radio-button {
37
+ $root: &;
38
+
39
+ color: var(--odx-radio-button-label-color);
40
+ display: block;
41
+
42
+ &.is-disabled,
43
+ &.is-readonly {
44
+ @include mx.non-interactive();
45
+ }
46
+
47
+ &.is-disabled {
48
+ color: var(--odx-radio-button-label-color-disabled);
49
+ }
50
+
51
+ &__label {
52
+ @include mx.interactive($focus-within: true);
53
+ @include vr.line-height(1);
54
+ @include mx.transition(background-color color outline);
55
+ @include t.font-size(0);
56
+
57
+ border-radius: var(--odx-v-border-radius-controls);
58
+ border-radius: vr.get-size(0.5);
59
+ border-bottom-right-radius: var(--odx-v-border-radius-controls);
60
+ border-top-right-radius: var(--odx-v-border-radius-controls);
61
+ color: inherit;
62
+ cursor: pointer;
63
+ display: inline-flex;
64
+ min-height: vr.get-size(1);
65
+ padding: 0 2px;
66
+ vertical-align: top;
67
+ }
68
+
69
+ &__input {
70
+ @include mx.visually-hidden();
71
+ }
72
+
73
+ &__indicator {
74
+ @include vr.container(1, math.div(20, 24));
75
+ @include mx.transition(background-color border-color);
76
+ @include mx.center-content();
77
+
78
+ background-color: var(--odx-radio-button-background-color);
79
+ border: 1px solid var(--odx-radio-button-border-color);
80
+ border-radius: 50%;
81
+ box-sizing: border-box;
82
+ color: var(--odx-radio-button-color);
83
+ flex: 0 0 auto;
84
+
85
+ &::before {
86
+ @include mx.transition(transform);
87
+ @include vr.container(math.div(4, 24));
88
+
89
+ background-color: currentcolor;
90
+ border-radius: 50%;
91
+ content: '';
92
+ transform: scale(0);
93
+ }
94
+
95
+ #{$root}:hover & {
96
+ border-color: var(--odx-radio-button-border-color-hover);
97
+ }
98
+
99
+ #{$root}__input:checked ~ & {
100
+ background-color: var(--odx-radio-button-background-color-active);
101
+ border-color: var(--odx-radio-button-border-color-active);
102
+ }
103
+
104
+ #{$root}.has-error & {
105
+ background-color: var(--odx-c-error);
106
+ border-color: var(--odx-c-error-outline);
107
+ color: var(--odx-c-error-text);
108
+ }
109
+
110
+ #{$root}.has-error:hover & {
111
+ border-color: var(--odx-c-error-outline-hover);
112
+ }
113
+
114
+ #{$root}.is-disabled & {
115
+ background-color: var(--odx-radio-button-background-color-disabled);
116
+ border-color: transparent;
117
+ color: var(--odx-radio-button-color-disabled);
118
+ }
119
+
120
+ #{$root}.is-readonly & {
121
+ background-color: var(--odx-radio-button-background-color-readonly);
122
+ border-color: var(--odx-radio-button-border-color-readonly);
123
+ color: inherit;
124
+ }
125
+ }
126
+
127
+ &__content {
128
+ @include vr.margin(0.5, left);
129
+
130
+ padding-left: 2px;
131
+
132
+ &:empty {
133
+ margin: 0;
134
+ padding: 0;
135
+ }
136
+ }
137
+
138
+ &__input:checked ~ .odx-radio-button__indicator::before {
139
+ transform: scale(1);
140
+ }
141
+
142
+ &--no-label .odx-radio-button__label {
143
+ border-radius: vr.get-size(0.5);
144
+ }
145
+ }
package/scss/core.scss ADDED
@@ -0,0 +1,43 @@
1
+ @use 'base/reset';
2
+ @use 'helpers';
3
+
4
+ /*
5
+ Variables
6
+ */
7
+ @use 'variables/color-palettes';
8
+ @use 'variables/colors';
9
+ @use 'variables/visuals';
10
+
11
+ /*
12
+ Modules
13
+ */
14
+ @use 'modules/breakpoints' with (
15
+ $breakpoints: (
16
+ 'phone-s': 360px,
17
+ 'phone': 420px,
18
+ 'tablet': 768px,
19
+ 'desktop-s': 960px,
20
+ 'desktop': 1200px,
21
+ )
22
+ );
23
+ @use 'modules/layout' as layout;
24
+ @use 'modules/typography' as t;
25
+ @use 'modules/vertical-rythm' as vr;
26
+
27
+ /*
28
+ Components
29
+ */
30
+
31
+ @use 'components/action-group/action-group.component';
32
+ @use 'components/area-header/area-header.component';
33
+ @use 'components/avatar/avatar.component';
34
+ @use 'components/badge/badge.component';
35
+ @use 'components/button/button.component';
36
+ @use 'components/checkbox/checkbox.component';
37
+ @use 'components/content-box/content-box.component';
38
+ @use 'components/icon/icon.component';
39
+ @use 'components/link/link.component';
40
+ @use 'components/logo/logo.component';
41
+ @use 'components/main-menu/main-menu.component';
42
+ @use 'components/header/header.component';
43
+ @use 'components/radio-group/radio-group.component';
@@ -0,0 +1,80 @@
1
+ /* stylelint-disable block-closing-brace-newline-after */
2
+ @use 'sass:list';
3
+ @use 'sass:map';
4
+
5
+ $breakpoints: () !default;
6
+
7
+ @function get-breakpoint-names() {
8
+ @return map.keys($breakpoints);
9
+ }
10
+
11
+ @function get-value($breakpoint) {
12
+ @if $breakpoint and not map.has-key($breakpoints, $breakpoint) {
13
+ @error "Invalid breakpoint, `#{$breakpoint}` doesn't exist. Choose one of #{map.keys(breakpoints.$values)}.";
14
+ }
15
+
16
+ @return map.get($breakpoints, $breakpoint);
17
+ }
18
+
19
+ @function get-next-value($breakpoint) {
20
+ @if $breakpoint and not map.has-key($breakpoints, $breakpoint) {
21
+ @error "Invalid breakpoint, `#{$breakpoint}` doesn't exist. Choose one of #{map.keys(breakpoints.$values)}.";
22
+ }
23
+
24
+ $keys: get-breakpoint-names();
25
+ $index: list.index($keys, $breakpoint);
26
+
27
+ @return if($index < length($keys), list.nth($keys, $index + 1), null);
28
+ }
29
+
30
+ @function get-min-value($breakpoint) {
31
+ $value: get-value($breakpoint);
32
+
33
+ @return if($value != 0, $value, null);
34
+ }
35
+
36
+ @function get-max-value($breakpoint) {
37
+ $value: get-value($breakpoint);
38
+
39
+ @return if($value > 0, $value - 1, null);
40
+ }
41
+
42
+ @mixin up($breakpoint) {
43
+ $min: get-min-value($breakpoint);
44
+
45
+ @if $min {
46
+ @media (min-width: $min) {
47
+ @content;
48
+ }
49
+ } @else {
50
+ @content;
51
+ }
52
+ }
53
+
54
+ @mixin down($breakpoint) {
55
+ $max: get-max-value($breakpoint);
56
+
57
+ @if $max {
58
+ @media (max-width: $max) {
59
+ @content;
60
+ }
61
+ } @else {
62
+ @content;
63
+ }
64
+ }
65
+
66
+ @mixin only($breakpoint) {
67
+ $min: get-min-value($breakpoint);
68
+ $next: get-next-value($breakpoint);
69
+ $max: get-max-value($breakpoint);
70
+
71
+ @if $min != null and $max != null {
72
+ @media (min-width: $min) and (max-width: $max) {
73
+ @content;
74
+ }
75
+ } @else if $max == null {
76
+ @include up($token) {
77
+ @content;
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,108 @@
1
+ @use './breakpoints';
2
+ @use './vertical-rythm' as vr;
3
+
4
+ $columns: 12 !default;
5
+
6
+ @function create-selector($value, $match: '~') {
7
+ @return "[odxLayout#{$match}='#{$value}']";
8
+ }
9
+
10
+ :root {
11
+ --odx-grid-gutter: #{vr.get-size(1)};
12
+ }
13
+
14
+ #{create-selector(grid)} {
15
+ display: grid;
16
+ gap: var(--odx-grid-gutter);
17
+ grid-template-columns: repeat(12, 1fr);
18
+
19
+ @each $breakpoint in breakpoints.get-breakpoint-names() {
20
+ &#{create-selector(\@#{$breakpoint}, '*')} {
21
+ grid-template-columns: 12fr;
22
+ }
23
+ }
24
+
25
+ @for $index from 1 through $columns {
26
+ &#{create-selector($index)} {
27
+ grid-template-columns: repeat(calc($columns / $index), 1fr);
28
+ }
29
+
30
+ #{create-selector($index)} {
31
+ grid-column: span $index / span $index;
32
+ }
33
+
34
+ #{create-selector(offset-#{$index})} {
35
+ grid-column-start: $index !important;
36
+ }
37
+ }
38
+
39
+ @each $breakpoint in breakpoints.get-breakpoint-names() {
40
+ @include breakpoints.up($breakpoint) {
41
+ @for $index from 1 through $columns {
42
+ &#{create-selector(#{$index}\@#{$breakpoint})} {
43
+ grid-template-columns: repeat(calc($columns / $index), 1fr);
44
+ }
45
+
46
+ #{create-selector(#{$index}\@#{$breakpoint})} {
47
+ grid-column: span $index / span $index;
48
+ }
49
+
50
+ #{create-selector(offset-#{$index}\@#{$breakpoint})} {
51
+ grid-column-start: $index !important;
52
+ }
53
+ }
54
+
55
+ #{create-selector(first\@#{$breakpoint})} {
56
+ order: -1;
57
+ }
58
+
59
+ #{create-selector(last\@#{$breakpoint})} {
60
+ order: $columns;
61
+ }
62
+ }
63
+ }
64
+
65
+ &#{create-selector(gap-none)} {
66
+ gap: 0;
67
+ }
68
+
69
+ &#{create-selector(gap-row-none)} {
70
+ row-gap: 0;
71
+ }
72
+
73
+ &#{create-selector(gap-column-none)} {
74
+ column-gap: 0;
75
+ }
76
+
77
+ &#{create-selector(vertical-center)} {
78
+ align-items: center;
79
+ }
80
+
81
+ &#{create-selector(vertical-start)} {
82
+ align-items: flex-start;
83
+ }
84
+
85
+ &#{create-selector(vertical-end)} {
86
+ align-items: flex-end;
87
+ }
88
+
89
+ &#{create-selector(horizontal-center)} {
90
+ justify-items: center;
91
+ }
92
+
93
+ &#{create-selector(horizontal-start)} {
94
+ justify-items: flex-start;
95
+ }
96
+
97
+ &#{create-selector(horizontal-end)} {
98
+ justify-items: flex-end;
99
+ }
100
+
101
+ #{create-selector(first)} {
102
+ order: -1;
103
+ }
104
+
105
+ #{create-selector(last)} {
106
+ order: $columns;
107
+ }
108
+ }
@@ -0,0 +1,161 @@
1
+ /* stylelint-disable block-closing-brace-newline-after */
2
+ @use 'sass:math';
3
+ @use 'breakpoints' as br;
4
+ @use 'vertical-rythm' as vr;
5
+ @use '../base/utils' as utils;
6
+
7
+ $base-size: 16px;
8
+ $base-line-height: 1.5;
9
+
10
+ @mixin font-size($size: 1) {
11
+ @if math.round($size) != $size {
12
+ @error '$size must me an integer';
13
+ }
14
+
15
+ @if $size < 0 {
16
+ font-size: calc(var(--odx-t-base-size) * utils.css-pow(var(--odx-t-negative-font-scaling-factor), $size));
17
+ } @else {
18
+ font-size: calc(var(--odx-t-base-size) * utils.css-pow(var(--odx-t-positive-font-scaling-factor), $size));
19
+ }
20
+ }
21
+
22
+ @mixin prevent-text-overflow() {
23
+ overflow: hidden;
24
+ text-overflow: ellipsis;
25
+ white-space: nowrap;
26
+ }
27
+
28
+ :root {
29
+ --odx-t-base-size: #{$base-size};
30
+ --odx-t-base-line-height: #{$base-line-height};
31
+ --odx-t-font-weight-normal: normal;
32
+ --odx-t-font-weight-medium: 500;
33
+ --odx-t-font-weight-bold: bold;
34
+ --odx-t-positive-font-scaling-factor: 1.125;
35
+ --odx-t-negative-font-scaling-factor: 1.2;
36
+
37
+ @include br.up(tablet) {
38
+ --odx-t-positive-font-scaling-factor: 1.25;
39
+ }
40
+ }
41
+
42
+ @font-face {
43
+ font-family: Pangea;
44
+ font-style: normal;
45
+ font-weight: normal;
46
+ src: url('../assets/fonts/PangeaText-RegularWeb.woff2') format('woff2');
47
+ }
48
+
49
+ @font-face {
50
+ font-family: Pangea;
51
+ font-style: normal;
52
+ font-weight: 500;
53
+ src: url('../assets/fonts/PangeaText-MediumWeb.woff2') format('woff2');
54
+ }
55
+
56
+ @font-face {
57
+ font-family: Pangea;
58
+ font-style: normal;
59
+ font-weight: bold;
60
+ src: url('../assets/fonts/PangeaText-SemiBoldWeb.woff2') format('woff2');
61
+ }
62
+
63
+ html body {
64
+ @include font-size(0);
65
+ @include vr.line-height(1);
66
+
67
+ color: var(--odx-c-text);
68
+ font-family: Pangea, sans-serif;
69
+ font-weight: var(--odx-t-font-weight-normal);
70
+ }
71
+
72
+ h1,
73
+ h2,
74
+ h3,
75
+ h4,
76
+ h5,
77
+ h6,
78
+ .odx-title,
79
+ .odx-subtitle {
80
+ color: var(--odx-c-headline);
81
+ font-weight: var(--odx-t-font-weight-bold);
82
+ }
83
+
84
+ .odx-subtitle {
85
+ font-weight: var(--odx-t-font-weight-normal);
86
+ }
87
+
88
+ h1,
89
+ .odx-title--1 {
90
+ @include font-size(5);
91
+ @include vr.line-height(2, math.div(40, 24));
92
+
93
+ @include br.up(tablet) {
94
+ @include vr.line-height(3, math.div(64, 24));
95
+ }
96
+ }
97
+
98
+ h2,
99
+ .odx-title--2 {
100
+ @include font-size(4);
101
+ @include vr.line-height(2, 1.5);
102
+
103
+ @include br.up(tablet) {
104
+ @include vr.line-height(3, math.div(54, 24));
105
+ }
106
+ }
107
+
108
+ h3,
109
+ .odx-title--3 {
110
+ @include font-size(3);
111
+ @include vr.line-height(2, math.div(32, 24));
112
+
113
+ @include br.up(tablet) {
114
+ @include vr.line-height(2, math.div(42, 24));
115
+ }
116
+ }
117
+
118
+ h4,
119
+ .odx-title--4 {
120
+ @include font-size(2);
121
+ @include vr.line-height(2, math.div(30, 24));
122
+ }
123
+
124
+ h5,
125
+ .odx-title--5 {
126
+ @include font-size(1);
127
+ @include vr.line-height(1);
128
+ }
129
+
130
+ h6,
131
+ .odx-title--6 {
132
+ @include font-size(0);
133
+ @include vr.line-height(1);
134
+ }
135
+
136
+ p,
137
+ .odx-text {
138
+ @include vr.line-height(1);
139
+
140
+ font-weight: var(--odx-t-font-weight-normal);
141
+
142
+ &--small {
143
+ @include font-size(-1);
144
+ @include vr.line-height(1, math.div(20, 24));
145
+ }
146
+
147
+ &--xsmall {
148
+ @include font-size(-2);
149
+ @include vr.line-height(1, math.div(16, 24));
150
+ }
151
+ }
152
+
153
+ .odx-fs-normal {
154
+ font-weight: var(--odx-t-font-weight-normal);
155
+ }
156
+
157
+ b,
158
+ strong,
159
+ .odx-fs-bold {
160
+ font-weight: var(--odx-t-font-weight-bold);
161
+ }