@onereach/styles 0.1.14 → 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,238 +0,0 @@
1
- @use "sass:list";
2
- @use "../utils/index" as *;
3
- @use "../variables/initial";
4
-
5
- $textbox-prefix: initial.$base-prefix !default;
6
-
7
- $textbox-border-width: 1px !default;
8
-
9
- $textbox-placeholder-color: var(--c-neutral-4) !default;
10
-
11
- $textbox-color-error: var(--c-error) !default;
12
-
13
- $textbox-bg: var(--c-neutral-1) !default;
14
- $textbox-bg-hover: var(--c-white) !default;
15
- $textbox-bg-focus: var(--c-white) !default;
16
- $textbox-bg-disabled: var(--c-neutral-2) !default;
17
-
18
- $textbox-border-color: var(--c-neutral-2) !default;
19
- $textbox-border-color-hover: var(--c-neutral-2-darken-3) !default;
20
- $textbox-border-color-focus: var(--c-primary) !default;
21
- $textbox-border-color-active: var(--c-neutral-2-darken-5) !default;
22
- $textbox-border-color-disabled: var(--c-neutral-2) !default;
23
-
24
- $textbox-border-color-error: var(--c-error) !default;
25
- $textbox-border-color-error-hover: var(--c-error-darken-3) !default;
26
- $textbox-border-color-error-focus: var(--c-error-darken-5) !default;
27
- $textbox-border-color-error-disabled: var(--c-error) !default;
28
-
29
- $textbox-border-radius: px-to-rem(4) !default;
30
-
31
- $textbox-height: px-to-rem(36) !default;
32
- $textbox-min-width: px-to-rem(114) !default;
33
-
34
- $textbox-padding: px-to-rem(10) !default;
35
-
36
- $textbox-font-size: var(--fs-1) !default;
37
-
38
- $textbox-label-margin: 0 0 px-to-rem(4) !default;
39
- $textbox-label-color: var(--c-neutral-4) !default;
40
-
41
- .#{$textbox-prefix}-textbox {
42
- display: flex;
43
- align-items: flex-start;
44
-
45
- > div {
46
- &:not(.#{$textbox-prefix}-textbox--append, .#{$textbox-prefix}-textbox--prepend) {
47
- width: 100%;
48
- }
49
- }
50
-
51
- &--label {
52
- margin: $textbox-label-margin;
53
- color: $textbox-label-color;
54
-
55
- .material-icons {
56
- font-size: var(--fs-1);
57
- }
58
- }
59
-
60
- &--append,
61
- &--prepend {
62
- position: relative;
63
- display: inline-flex;
64
- align-items: center;
65
- min-height: $textbox-height;
66
- }
67
-
68
- &--append {
69
- margin-left: px-to-rem(10);
70
- }
71
-
72
- &--prepend {
73
- margin-right: px-to-rem(10);
74
- }
75
-
76
- &--input {
77
- display: block;
78
- width: 100%;
79
- min-width: $textbox-min-width;
80
- height: $textbox-height;
81
- padding: $textbox-padding;
82
- font-family: inherit;
83
- font-size: $textbox-font-size;
84
- background-color: $textbox-bg;
85
- border: $textbox-border-width solid $textbox-border-color;
86
- border-radius: $textbox-border-radius;
87
- outline: none;
88
-
89
- @include transition(border-color, background-color);
90
-
91
- &[type="password"],
92
- &[type="search"] {
93
- padding-right: calc(#{$textbox-padding} + #{px-to-rem(26)});
94
- }
95
-
96
- &-wr {
97
- position: relative;
98
- width: 100%;
99
- }
100
-
101
- &-toggle-btn {
102
- position: absolute;
103
- top: 50%;
104
- right: 0;
105
- z-index: 1;
106
- transform: translate(-#{list.nth($textbox-padding, 1)}, -50%);
107
- }
108
-
109
- &::placeholder {
110
- color: $textbox-placeholder-color;
111
-
112
- @include transition(opacity);
113
- }
114
-
115
- @include hover {
116
- background-color: $textbox-bg-hover;
117
- border-color: $textbox-border-color-hover;
118
- }
119
-
120
- @include active {
121
- border-color: $textbox-border-color-active;
122
- }
123
-
124
- @include focus {
125
- background-color: $textbox-bg-focus;
126
- border-color: $textbox-border-color-focus;
127
-
128
- &::placeholder {
129
- opacity: 0;
130
- }
131
- }
132
-
133
- @include disabled {
134
- background-color: $textbox-bg-disabled;
135
- border-color: $textbox-border-color-disabled;
136
- }
137
- }
138
-
139
- &--textarea {
140
- @extend .#{$textbox-prefix}-textbox--input;
141
-
142
- min-height: px-to-rem(79);
143
- max-height: px-to-rem(142);
144
- overflow-x: hidden;
145
- overflow-y: auto;
146
- resize: none;
147
- }
148
-
149
- &--info {
150
- width: 100%;
151
- margin: 0;
152
-
153
- @include transition(height, opacity);
154
- }
155
-
156
- &--counter {
157
- flex-shrink: 0;
158
- margin-left: auto;
159
- font-size: var(--fs-0);
160
- line-height: px-to-rem(14);
161
- color: var(--c-neutral-4);
162
- }
163
-
164
- &--hint,
165
- &-error {
166
- flex-shrink: 1;
167
-
168
- @include transition(height, opacity);
169
- }
170
-
171
- &.is-small {
172
- .#{$textbox-prefix}-textbox {
173
- &--input {
174
- padding: px-to-rem(8) px-to-rem(10);
175
- font-size: var(--fs-0);
176
-
177
- &[type="password"],
178
- &[type="search"] {
179
- padding-right: calc(#{px-to-rem(10)} + #{px-to-rem(12) * 2});
180
- }
181
-
182
- &-toggle-btn {
183
- .material-icons {
184
- font-size: var(--fs-1);
185
- }
186
- }
187
- }
188
- }
189
- }
190
-
191
- &.has-counter {
192
- .#{$textbox-prefix}-textbox {
193
- &--hint,
194
- &--error {
195
- padding-right: px-to-rem(15);
196
- }
197
- }
198
- }
199
-
200
- &.is-show-info {
201
- .#{$textbox-prefix}-textbox {
202
- &--info {
203
- display: flex;
204
- align-items: flex-start;
205
- justify-content: space-between;
206
- padding-top: px-to-rem(4);
207
- }
208
- }
209
- }
210
-
211
- @include disabled {
212
- .#{$textbox-prefix}-textbox {
213
- &--input-toggle-btn {
214
- pointer-events: none;
215
- }
216
- }
217
- }
218
-
219
- @include has-error {
220
- .#{$textbox-prefix}-textbox {
221
- &--input {
222
- border-color: $textbox-border-color-error;
223
-
224
- @include hover {
225
- border-color: $textbox-border-color-error-hover;
226
- }
227
-
228
- @include focus {
229
- border-color: $textbox-border-color-error-focus;
230
- }
231
-
232
- @include disabled {
233
- border-color: $textbox-border-color-error-disabled;
234
- }
235
- }
236
- }
237
- }
238
- }
@@ -1,19 +0,0 @@
1
- @use "../../variables/tokens/design-tokens" as *;
2
- @use "sass:string";
3
- @use "sass:map";
4
- @use "px-to-rem" as *;
5
-
6
- @function get-font-size($levelIndex: 0, $unit: rem) {
7
- $value: map.get($design-tokens, typography, font-sizes, string.quote(level-#{$levelIndex}));
8
- $defaultValue: map.get($design-tokens, typography, line-heights, string.quote(level-0));
9
-
10
- @if $value and $unit == rem {
11
- @return px-to-rem($value);
12
- }
13
-
14
- @else if $value and $unit != rem {
15
- @return #{$value + $unit};
16
- }
17
-
18
- @return $defaultValue or 0;
19
- }
@@ -1,14 +0,0 @@
1
- @use "../../variables/tokens/design-tokens" as *;
2
- @use "sass:string";
3
- @use "sass:map";
4
-
5
- @function get-font-weight($levelIndex: 0) {
6
- $value: map.get($design-tokens, typography, font-weights, string.quote(level-#{$levelIndex}));
7
- $defaultValue: map.get($design-tokens, typography, font-weights, string.quote(level-0));
8
-
9
- @if $value {
10
- @return $value;
11
- }
12
-
13
- @return $defaultValue or normal;
14
- }