@onereach/styles 0.1.15 → 0.1.17

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.
@@ -1,126 +0,0 @@
1
- @use "../utils/index" as *;
2
- @use "../base/animation" as *;
3
- @use "../variables/initial";
4
-
5
- $loader-prefix: initial.$base-prefix !default;
6
-
7
- $loader-width: px-to-rem(24) !default;
8
- $loader-height: $loader-width !default;
9
-
10
- $loader-border-width: 2px !default;
11
- $loader-border-color: inherit !default;
12
-
13
- @keyframes loaderLinear {
14
- 0% {
15
- transform: translate(-100%, 0);
16
- }
17
-
18
- 100% {
19
- transform: translate(100%, 0);
20
- }
21
- }
22
-
23
- // loader types mixins
24
- @mixin default-type() {
25
- &.is-default {
26
- &::after {
27
- width: $loader-width;
28
- height: $loader-height;
29
- content: '';
30
- border-color: $loader-border-color;
31
- border-top: $loader-border-width solid;
32
- border-right: $loader-border-width solid;
33
- border-bottom: $loader-border-width solid transparent !important;
34
- border-left: $loader-border-width solid;
35
- border-radius: 50%;
36
- animation: spinAround 0.7s linear infinite;
37
- }
38
- }
39
- }
40
-
41
- @mixin text-type() {
42
- &.is-text {
43
- > span {
44
- display: inline-flex;
45
- }
46
-
47
- @for $i from 0 through 3 {
48
- .#{$loader-prefix}-loader--dot:nth-child(#{$i}) {
49
- animation: fade 1s initial.$transition-function $i * 0.2s infinite;
50
- }
51
- }
52
- }
53
- }
54
-
55
- @mixin linear-type() {
56
- &.is-linear {
57
- width: 100%;
58
- max-width: px-to-rem(432);
59
-
60
- .#{$loader-prefix}-loader {
61
- &--linear {
62
- display: flex;
63
- flex-direction: column;
64
- align-items: center;
65
- width: 100%;
66
-
67
- &-title {
68
- margin-bottom: var(--s-4);
69
- font-size: initial.$subheading-font-size;
70
- font-weight: initial.$subheading-font-weight;
71
- line-height: initial.$subheading-line-height;
72
- color: var(--c-neutral-6);
73
- letter-spacing: px-to-rem(-0.45);
74
- }
75
-
76
- &-loader {
77
- position: relative;
78
- display: block;
79
- width: 100%;
80
- height: px-to-rem(4);
81
- margin-bottom: var(--s-4);
82
- overflow: hidden;
83
- background-color: var(--c-neutral-2);
84
- border-radius: px-to-rem(2);
85
-
86
- > span {
87
- position: absolute;
88
- top: 0;
89
- left: 0;
90
- width: 100%;
91
- height: 100%;
92
- animation: loaderLinear 1.2s initial.$transition-function infinite;
93
-
94
- &::after {
95
- position: absolute;
96
- top: 0;
97
- left: 0;
98
- width: 100%;
99
- max-width: px-to-rem(112);
100
- height: 100%;
101
- content: '';
102
- background-color: var(--c-primary);
103
- border-radius: px-to-rem(2);
104
- }
105
- }
106
- }
107
-
108
- &-desc {
109
- color: var(--c-neutral-5);
110
- }
111
- }
112
- }
113
- }
114
- }
115
-
116
- .#{$loader-prefix}-loader {
117
- position: relative;
118
- display: inline-flex;
119
- align-items: center;
120
- justify-content: center;
121
-
122
- // types
123
- @include default-type;
124
- @include text-type;
125
- @include linear-type;
126
- }
@@ -1,33 +0,0 @@
1
- @use "../utils/index" as *;
2
- @use "../variables/initial";
3
-
4
- $radio-group-prefix: initial.$base-prefix !default;
5
- $radio-group-column-mb: var(--s-4) !default;
6
- $radio-group-row-mr: var(--s-4) !default;
7
-
8
- .#{$radio-group-prefix}-radio-group {
9
- &.is-column {
10
- display: flex;
11
- flex-direction: column;
12
- align-items: flex-start;
13
- justify-content: flex-start;
14
-
15
- > * {
16
- &:not(:last-child) {
17
- margin-bottom: $radio-group-column-mb;
18
- }
19
- }
20
- }
21
-
22
- &.is-row {
23
- display: flex;
24
- align-items: flex-start;
25
- justify-content: flex-start;
26
-
27
- > * {
28
- &:not(:last-child) {
29
- margin-right: $radio-group-row-mr;
30
- }
31
- }
32
- }
33
- }
@@ -1,118 +0,0 @@
1
- @use "../utils/index" as *;
2
- @use "../variables/initial";
3
-
4
- $radio-prefix: initial.$base-prefix !default;
5
- $radio-icon-size: px-to-rem(16) !default;
6
-
7
- $radio-dot-size: $radio-icon-size - px-to-rem(12) !default;
8
- $radio-dot-bg: var(--c-white) !default;
9
-
10
- $radio-icon-border-width: px-to-rem(1) !default;
11
- $radio-icon-border-color: var(--c-neutral-2) !default;
12
- $radio-icon-border-color-hover: var(--c-neutral-2-darken-3) !default;
13
- $radio-icon-border-color-active: var(--c-neutral-2-darken-5) !default;
14
-
15
- $radio-icon-bg: var(--c-white) !default;
16
- $radio-icon-bg-hover: var(--c-white-darken-3) !default;
17
- $radio-icon-bg-active: var(--c-white-darken-5) !default;
18
- $radio-icon-bg-checked: var(--c-primary) !default;
19
-
20
- $radio-content-spacing: var(--s-3) !default;
21
- $radio-content-color: var(--c-neutral-6) !default;
22
- $radio-content-color-disabled: var(--c-neutral-4) !default;
23
-
24
- @mixin is-checked() {
25
- &.is-checked {
26
- .#{$radio-prefix}-radio {
27
- &--radio {
28
- background-color: $radio-icon-bg-checked;
29
- border-color: $radio-icon-bg-checked;
30
-
31
- &::after {
32
- transform: translate(-50%, -50%) scale(1);
33
- }
34
- }
35
- }
36
- }
37
- }
38
-
39
- .#{$radio-prefix}-radio {
40
- display: inline-flex;
41
- align-items: center;
42
- cursor: pointer;
43
-
44
- &--input {
45
- @include visually-hidden;
46
- }
47
-
48
- &--radio {
49
- position: relative;
50
- width: $radio-icon-size;
51
- min-width: $radio-icon-size;
52
- height: $radio-icon-size;
53
- min-height: $radio-icon-size;
54
- margin-right: $radio-content-spacing;
55
- background-color: $radio-icon-bg;
56
- border: $radio-icon-border-width solid $radio-icon-border-color;
57
- border-radius: initial.$round;
58
-
59
- @include transition(border-color, background-color, opacity);
60
-
61
- &::after {
62
- position: absolute;
63
- top: 50%;
64
- left: 50%;
65
- width: $radio-dot-size;
66
- height: $radio-dot-size;
67
- content: '';
68
- background-color: $radio-dot-bg;
69
- border-radius: inherit;
70
- transition-delay: 0.15s;
71
- transform: translate(-50%, -50%) scale(0);
72
-
73
- @include transition(transform);
74
- }
75
- }
76
-
77
- &--content {
78
- color: $radio-content-color;
79
-
80
- @include transition(color);
81
- }
82
-
83
- @include is-checked;
84
-
85
- @include hover {
86
- &:not(.is-checked) {
87
- .#{$radio-prefix}-radio {
88
- &--radio {
89
- background-color: $radio-icon-bg-hover;
90
- border-color: $radio-icon-border-color-hover;
91
- }
92
- }
93
- }
94
- }
95
-
96
- @include active {
97
- &:not(.is-checked) {
98
- .#{$radio-prefix}-radio {
99
- &--radio {
100
- background-color: $radio-icon-bg-active;
101
- border-color: $radio-icon-border-color-active;
102
- }
103
- }
104
- }
105
- }
106
-
107
- @include disabled {
108
- .#{$radio-prefix}-radio {
109
- &--radio {
110
- opacity: 0.5;
111
- }
112
-
113
- &--content {
114
- color: $radio-content-color-disabled;
115
- }
116
- }
117
- }
118
- }
@@ -1,165 +0,0 @@
1
- @use "../utils/index" as *;
2
- @use "../variables/initial";
3
-
4
- // base
5
- $switch-prefix: initial.$base-prefix !default;
6
-
7
- // layer
8
- $switch-layer-width: px-to-rem(34) !default;
9
- $switch-layer-height: px-to-rem(14) !default;
10
-
11
- $switch-layer-bg: var(--c-neutral-2) !default;
12
- $switch-layer-bg-hover: var(--c-neutral-2-darken-3) !default;
13
- $switch-layer-bg-active: var(--c-neutral-2-darken-5) !default;
14
-
15
- $switch-layer-bg-checked: var(--c-primary) !default;
16
- $switch-layer-bg-checked-hover: var(--c-primary-darken-3) !default;
17
- $switch-layer-bg-checked-active: var(--c-primary-darken-5) !default;
18
- $switch-layer-bg-checked-disabled: var(--c-primary-lighten-20) !default;
19
-
20
- // knob
21
- $switch-knob-size: px-to-rem(20) !default;
22
- $switch-knob-bg: var(--c-white) !default;
23
- $switch-knob-box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.16), 0 1px 1px 0 rgba(0, 0, 0, 0.24) !default;
24
- $switch-knob-box-shadow-disabled: 0 0 1px 0 rgba(0, 0, 0, 0.16), 0 1px 1px 0 rgba(0, 0, 0, 0.24) !default;
25
-
26
- $switch-knob-border-width: 1px !default;
27
- $switch-knob-border-color: var(--c-neutral-1) !default;
28
-
29
- $switch-loader-size: calc(#{$switch-knob-size} - #{px-to-rem(5)});
30
- $switch-loader-color: var(--c-primary) !default;
31
-
32
- $switch-content-spacing: var(--s-3) !default;
33
- $switch-content-color: var(--c-neutral-6) !default;
34
- $switch-content-color-disabled: var(--c-neutral-4) !default;
35
-
36
- @mixin is-checked() {
37
- &.is-checked {
38
- .#{$switch-prefix}-switch {
39
- &--layer {
40
- background-color: $switch-layer-bg-checked;
41
- }
42
-
43
- &--knob {
44
- transform: translate(calc(100% - 3px), -50%);
45
- }
46
- }
47
-
48
- @include hover {
49
- .#{$switch-prefix}-switch {
50
- &--layer {
51
- background-color: $switch-layer-bg-checked-hover;
52
- }
53
- }
54
- }
55
-
56
- @include active {
57
- .#{$switch-prefix}-switch {
58
- &--layer {
59
- background-color: $switch-layer-bg-checked-active;
60
- }
61
- }
62
- }
63
- }
64
- }
65
-
66
- .#{$switch-prefix}-switch {
67
- display: inline-flex;
68
- align-items: center;
69
- cursor: pointer;
70
-
71
- &--input {
72
- @include visually-hidden;
73
- }
74
-
75
- &--switcher {
76
- position: relative;
77
- display: inline-flex;
78
- margin-right: $switch-content-spacing;
79
- }
80
-
81
- &--layer {
82
- width: $switch-layer-width;
83
- min-width: $switch-layer-width;
84
- height: $switch-layer-height;
85
- min-height: $switch-layer-height;
86
- background-color: $switch-layer-bg;
87
- border-radius: initial.$round;
88
-
89
- @include transition(background-color, opacity);
90
- }
91
-
92
- &--knob {
93
- position: absolute;
94
- top: 50%;
95
- left: 0;
96
- z-index: 1;
97
- display: flex;
98
- align-items: center;
99
- justify-content: center;
100
- width: $switch-knob-size;
101
- min-width: $switch-knob-size;
102
- height: $switch-knob-size;
103
- min-height: $switch-knob-size;
104
- background-color: $switch-knob-bg;
105
- border-width: $switch-knob-border-width solid $switch-knob-border-color;
106
- border-radius: 9999px;
107
- box-shadow: $switch-knob-box-shadow;
108
- transform: translate(-3px, -50%);
109
-
110
- @include transition(transform, box-shadow);
111
- }
112
-
113
- &--content {
114
- color: $switch-content-color;
115
-
116
- @include transition(color);
117
- }
118
-
119
- &--loader {
120
- &.#{$switch-prefix}-loader {
121
- &::after {
122
- width: $switch-loader-size;
123
- min-width: $switch-loader-size;
124
- height: $switch-loader-size;
125
- min-height: $switch-loader-size;
126
- border-color: $switch-loader-color;
127
- }
128
- }
129
- }
130
-
131
- @include hover {
132
- .#{$switch-prefix}-switch {
133
- &--layer {
134
- background-color: $switch-layer-bg-hover;
135
- }
136
- }
137
- }
138
-
139
- @include active {
140
- .#{$switch-prefix}-switch {
141
- &--layer {
142
- background-color: $switch-layer-bg-active;
143
- }
144
- }
145
- }
146
-
147
- @include disabled {
148
- .#{$switch-prefix}-switch {
149
- &--layer {
150
- opacity: 0.5;
151
- }
152
-
153
- &--knob {
154
- box-shadow: $switch-knob-box-shadow-disabled;
155
- }
156
-
157
- &--content {
158
- color: $switch-content-color-disabled;
159
- }
160
- }
161
- }
162
-
163
- @include is-checked;
164
- @include loading;
165
- }
@@ -1,42 +0,0 @@
1
- @use "../utils/index" as *;
2
- @use "../variables/initial";
3
-
4
- $tab-header-item-prefix: initial.$base-prefix !default;
5
- $tab-header-item-color: var(--c-neutral-5) !default;
6
- $tab-header-item-font-weight: var(--fw-2) !default;
7
- $tab-header-item-font-size: var(--fs-1) !default;
8
- $tab-header-item-line-height: var(--lh-1) !default;
9
-
10
- $tab-header-item-color-hover: var(--c-neutral-6) !default;
11
- $tab-header-item-color-active: var(--c-neutral-6) !default;
12
- $tab-header-item-color-disabled: var(--c-neutral-3) !default;
13
-
14
- .#{$tab-header-item-prefix}-tab-header-item {
15
- padding: 0;
16
- font-size: $tab-header-item-font-size;
17
- font-weight: $tab-header-item-font-weight;
18
- line-height: $tab-header-item-line-height;
19
- color: $tab-header-item-color;
20
- cursor: pointer;
21
- background-color: transparent;
22
- border: 0;
23
-
24
- &:not(:last-child) {
25
- margin-right: var(--s-6);
26
- }
27
-
28
- @include transition(color);
29
-
30
- @include hover {
31
- color: $tab-header-item-color-hover;
32
- }
33
-
34
- @include disabled {
35
- color: $tab-header-item-color-disabled;
36
- }
37
-
38
- &.is-active {
39
- color: $tab-header-item-color-active;
40
- cursor: default;
41
- }
42
- }
@@ -1,32 +0,0 @@
1
- @use "../utils/index" as *;
2
- @use "../variables/initial";
3
-
4
- $tabs-prefix: initial.$base-prefix !default;
5
-
6
- .#{$tabs-prefix}-tabs {
7
- width: 100%;
8
- overflow: hidden;
9
-
10
- &--header {
11
- position: relative;
12
- padding: 0 var(--s-4) var(--s-3);
13
- border-bottom: 1px solid var(--c-neutral-2);
14
- }
15
-
16
- &--tabs {
17
- display: flex;
18
- width: 100%;
19
- }
20
-
21
- &--indicator {
22
- position: absolute;
23
- bottom: -1px;
24
- left: 0;
25
- z-index: 1;
26
- width: auto;
27
- height: px-to-rem(2);
28
- background-color: var(--c-neutral-6);
29
-
30
- @include transition(transform, width);
31
- }
32
- }