@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,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
- }
@@ -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-line-height($levelIndex: 0, $unit: rem) {
7
- $value: map.get($design-tokens, typography, line-heights, 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 1;
19
- }
@@ -1,18 +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-spacing($levelIndex: 0, $unit: rem) {
7
- $value: map.get($design-tokens, spacings, string.quote(level-#{$levelIndex}));
8
-
9
- @if $value and $unit == rem {
10
- @return px-to-rem($value);
11
- }
12
-
13
- @else if $value and $unit != rem {
14
- @return #{$value + $unit};
15
- }
16
-
17
- @return 0;
18
- }
File without changes
@@ -1,19 +0,0 @@
1
- @mixin heightVh($value: 100) {
2
- height: #{$value * 1vh};
3
- height: calc(var(--vh, 1vh) * #{$value});
4
- }
5
-
6
- @mixin heightVhStatic($value: 100) {
7
- height: #{$value * 1vh};
8
- height: calc(var(--vh-static, 1vh) * #{$value});
9
- }
10
-
11
- @mixin minHeightVh($value: 100) {
12
- min-height: #{$value * 1vh};
13
- min-height: calc(var(--vh, 1vh) * #{$value});
14
- }
15
-
16
- @mixin minHeightVhStatic($value: 100) {
17
- min-height: #{$value * 1vh};
18
- min-height: calc(var(--vh-static, 1vh) * #{$value});
19
- }