@swiftwc/ui 0.0.0-dev.23 → 0.0.0-dev.24

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.
@@ -5,9 +5,9 @@
5
5
 
6
6
  // scalpel precision
7
7
  @property --label-gap {
8
- syntax: '<length>';
8
+ syntax: '<number>';
9
9
  inherits: false;
10
- initial-value: 0;
10
+ initial-value: 0.3;
11
11
  }
12
12
 
13
13
  @property --label-image-size {
@@ -22,18 +22,18 @@
22
22
  initial-value: 0;
23
23
  }
24
24
 
25
- // @property --label-font-weight {
26
- // syntax: 'ultra-light | thin | light | regular | medium | semibold | bold | heavy | black';
27
- // inherits: false;
28
- // initial-value: regular;
29
- // }
30
-
31
25
  // @property --label-style {
32
26
  // syntax: 'title-and-icon | icon-only | title-only | automatic';
33
27
  // inherits: true;
34
28
  // initial-value: automatic;
35
29
  // }
36
30
 
31
+ // @property --label-font-weight {
32
+ // syntax: 'ultra-light | thin | light | regular | medium | semibold | bold | heavy | black';
33
+ // inherits: false;
34
+ // initial-value: regular;
35
+ // }
36
+
37
37
  // @property --label--style {
38
38
  // syntax: '<number>';
39
39
  // inherits: false;
@@ -79,20 +79,10 @@ $label-line-ifs: (
79
79
  --label--host-grid-template-rows: minmax(0, 1fr);
80
80
  --label--host-align-items: center;
81
81
  --label--host-justify-items: normal;
82
-
83
- --label-gap: 0.3rem;
84
- --label--host-gap: var(--label-gap);
85
-
86
- --label--iconstack-display: grid;
87
- --label--titlestack-display: grid;
88
82
  } @else if $label-style == h-icon-only {
89
83
  --label-style: icon-only;
90
-
91
- --label--iconstack-display: grid;
92
84
  } @else if $label-style == h-title-only {
93
85
  --label-style: title-only;
94
-
95
- --label--titlestack-display: grid;
96
86
  } @else if $label-style == v-title-and-icon {
97
87
  --label-style: title-and-icon;
98
88
 
@@ -100,42 +90,13 @@ $label-line-ifs: (
100
90
  --label--host-grid-template-rows: auto minmax(0, 1fr);
101
91
  --label--host-align-items: normal;
102
92
  --label--host-justify-items: center;
103
-
104
- --label-gap: 0.3rem;
105
- --label--host-gap: var(--label-gap);
106
-
107
- --label--iconstack-display: grid;
108
- --label--titlestack-display: grid;
109
93
  } @else if $label-style == v-icon-only {
110
94
  --label-style: icon-only;
111
-
112
- --label--iconstack-display: grid;
113
95
  } @else if $label-style == v-title-only {
114
96
  --label-style: title-only;
115
-
116
- --label--titlestack-display: grid;
117
97
  }
118
98
  }
119
99
 
120
- // @mixin set-label-truncation-mode($value) {
121
- // @if $value == 'tail' {
122
- // --label--overflow: hidden;
123
-
124
- // --label--text-overflow: ellipsis;
125
- // }
126
- // }
127
-
128
- // @mixin set-label-line-limit($value) {
129
- // @if $value == 1 {
130
- // --label--host-white-space: nowrap;
131
- // } @else {
132
- // --label--host-white-space: normal;
133
- // --label--display: -webkit-box;
134
- // --label--box-orient: vertical;
135
- // --label--line-clamp: #{$value};
136
- // }
137
- // }
138
-
139
100
  @mixin set-label-font($value) {
140
101
  --label--titlestack-font-size: var(--label-#{$value}-font-size);
141
102
  --label--titlestack-line-height: var(--label-#{$value}-line-height);
@@ -172,67 +133,19 @@ $label-line-ifs: (
172
133
  @layer #{vars.$components-layer} {
173
134
  label-view {
174
135
  :where(&) {
175
- // transition: --label--style 1ms step-start;
176
-
177
136
  padding-inline: var(--label-padding-inline);
178
137
 
179
138
  align-items: var(--label--host-align-items,);
180
139
  justify-items: var(--label--host-justify-items,);
181
- // place-items: center;
182
- // place-content: center;
183
140
 
184
- // grid-auto-flow: column;
185
- // grid-auto-columns: minmax(0, 1fr);
186
141
  grid-template-columns: var(--label--host-grid-template-columns,);
187
142
  grid-template-rows: var(--label--host-grid-template-rows,);
188
- // grid-template-areas: 'label-image-stack label-title-stack';
189
143
 
190
- gap: var(--label--host-gap,); //;
144
+ gap: calc(var(--label-gap) * 1rem);
191
145
 
192
- // --label-image-size: 2rem;
193
146
  --label-imagestack-fontsize: calc(var(--label-image-size) * 1rem);
194
- // gap: 0;
195
147
 
196
148
  white-space: var(--label--host-white-space,);
197
-
198
- &::part(label-image-stack),
199
- &::part(label-title-stack) {
200
- // display: none;
201
-
202
- grid-auto-columns: minmax(0, 1fr);
203
- grid-auto-rows: minmax(0, 1fr);
204
- // grid-template-columns: subgrid;
205
- // grid-template-rows: subgrid;
206
- }
207
-
208
- &::part(label-image-stack) {
209
- display: var(--label--iconstack-display, none);
210
- }
211
-
212
- &::part(label-title-stack) {
213
- display: var(--label--titlestack-display, none);
214
- }
215
-
216
- &::part(label-image-stack) {
217
- aspect-ratio: 1 / 1;
218
-
219
- inline-size: var(--label-imagestack-fontsize);
220
- font-size: var(--label-imagestack-fontsize);
221
-
222
- // line-height: 1;
223
-
224
- // grid-area: label-image-stack;
225
- }
226
-
227
- &::part(label-title-stack) {
228
- text-decoration: underline;
229
-
230
- font-size: var(--label--titlestack-font-size,);
231
- line-height: var(--label--titlestack-line-height,);
232
- font-weight: var(--label--titlestack-font-weight,);
233
-
234
- // grid-area: label-title-stack;
235
- }
236
149
  }
237
150
 
238
151
  &:has(> [slot='image']) {
@@ -241,6 +154,7 @@ $label-line-ifs: (
241
154
  // background-color: green;
242
155
  }
243
156
  }
157
+
244
158
  &:has(> :not([slot])) {
245
159
  :where(&) {
246
160
  --label--has-title: yes;
@@ -250,7 +164,6 @@ $label-line-ifs: (
250
164
 
251
165
  > :not([slot]) {
252
166
  :where(&) {
253
- // grid-area: label-title-stack;
254
167
  overflow: var(--label--overflow,);
255
168
 
256
169
  text-overflow: var(--label--text-overflow,);
@@ -261,14 +174,25 @@ $label-line-ifs: (
261
174
 
262
175
  line-clamp: var(--label--line-clamp,);
263
176
  -webkit-line-clamp: var(--label--line-clamp,);
177
+
178
+ text-decoration: underline;
179
+
180
+ font-size: var(--label--titlestack-font-size,);
181
+
182
+ line-height: var(--label--titlestack-line-height,);
183
+
184
+ font-weight: var(--label--titlestack-font-weight,);
264
185
  }
265
186
  }
266
187
 
267
- // > [slot='image'] {
268
- // :where(&:is(i)) {
269
- // line-height: 1.1;
270
- // }
271
- // }
188
+ > [slot='image'] {
189
+ aspect-ratio: 1 / 1;
190
+
191
+ inline-size: var(--label-imagestack-fontsize);
192
+ block-size: var(--label-imagestack-fontsize);
193
+
194
+ font-size: var(--label-imagestack-fontsize);
195
+ }
272
196
 
273
197
  // vars
274
198
  @supports (x: #{string.unquote('if(else:red)')}) {
@@ -306,17 +230,6 @@ $label-line-ifs: (
306
230
  style(--label-style: title-and-icon): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;) ;
307
231
  else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;) ; else: minmax(0, 1fr) ;) ;
308
232
  );
309
-
310
- --label-gap: if(style(--label-style: title-and-icon): 0.3rem ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): 0.3rem ;) ;);
311
- --label--host-gap: if(style(--label-style: title-and-icon): var(--label-gap) ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): var(--label-gap) ;) ;);
312
-
313
- --label--iconstack-display: if(
314
- style(--label-style: icon-only): grid ; style(--label-style: title-only): none ; style(--label-style: title-and-icon): grid ; else: if(style(--label--has-icon: yes): grid ; else: none;) ;
315
- );
316
-
317
- --label--titlestack-display: if(
318
- style(--label-style: icon-only): none ; style(--label-style: title-only): grid ; style(--label-style: title-and-icon): grid ; else: if(style(--label--has-title: yes): grid ; else: none;) ;
319
- );
320
233
  }
321
234
  }
322
235
 
@@ -335,15 +248,12 @@ $label-line-ifs: (
335
248
  }
336
249
  @container not style(--label-style) {
337
250
  &:not([label-style]) {
338
- // :where(&[image-hint='yes'][title-hint='yes']) {
339
251
  :where(&:has(> [slot='image']):has(> :not([slot]))) {
340
252
  @include set-label-style(h-title-and-icon);
341
253
  }
342
- // :where(&[image-hint='yes']:not([title-hint='yes'])) {
343
254
  :where(&:has(> [slot='image']):not(:has(> :not([slot])))) {
344
255
  @include set-label-style(h-icon-only);
345
256
  }
346
- // :where(&[title-hint='yes']:not([image-hint='yes'])) {
347
257
  :where(&:has(> :not([slot])):not(:has(> [slot='image']))) {
348
258
  @include set-label-style(h-title-only);
349
259
  }
@@ -0,0 +1,98 @@
1
+ @use '../vars';
2
+
3
+ // @property --progress-view-style {
4
+ // syntax: 'circular | linear';
5
+ // inherits: false;
6
+ // initial-value: circular;
7
+ // }
8
+ @property --progress-view-style-index {
9
+ syntax: '<number>';
10
+ inherits: false;
11
+ initial-value: 0;
12
+ }
13
+
14
+ @layer #{vars.$components-layer} {
15
+ progress-view {
16
+ :where(&) {
17
+ transition: --progress-view-style-index 1ms step-start;
18
+
19
+ grid-template-columns: minmax(0, 1fr);
20
+
21
+ place-items: center;
22
+ place-content: center;
23
+
24
+ gap: 0.3rem;
25
+
26
+ &::part(progress-line-control) {
27
+ background-color: var(--gray3);
28
+
29
+ inline-size: 100%;
30
+ block-size: 5px;
31
+
32
+ border-radius: var(--pill-border-radius);
33
+
34
+ border-left: solid 40px var(--accentColorEffective, var(--accentColor));
35
+ }
36
+
37
+ &::part(progress-circular-control) {
38
+ position: relative;
39
+
40
+ inline-size: 2rem;
41
+ block-size: 2rem;
42
+ }
43
+
44
+ &::part(progress-circular-blade) {
45
+ position: absolute;
46
+ inset: 32.5% auto auto 42.5%;
47
+ inline-size: 12.5%;
48
+ block-size: 32.5%;
49
+ background-color: var(--accentColorEffective, var(--secondary));
50
+ border-radius: var(--pill-border-radius);
51
+ will-change: opacity;
52
+ @media (prefers-reduced-motion: no-preference) {
53
+ animation: progressViewCircular 1s linear infinite;
54
+ }
55
+ }
56
+ &::part(progress-circular-blade-1) {
57
+ transform: rotate(45deg) translateY(-100%);
58
+ animation-delay: -1.625s;
59
+ }
60
+ &::part(progress-circular-blade-2) {
61
+ transform: rotate(90deg) translateY(-100%);
62
+ animation-delay: -1.5s;
63
+ }
64
+ &::part(progress-circular-blade-3) {
65
+ transform: rotate(135deg) translateY(-100%);
66
+ animation-delay: -1.375s;
67
+ }
68
+ &::part(progress-circular-blade-4) {
69
+ transform: rotate(180deg) translateY(-100%);
70
+ animation-delay: -1.25s;
71
+ }
72
+ &::part(progress-circular-blade-5) {
73
+ transform: rotate(225deg) translateY(-100%);
74
+ animation-delay: -1.125s;
75
+ }
76
+ &::part(progress-circular-blade-6) {
77
+ transform: rotate(270deg) translateY(-100%);
78
+ animation-delay: -1s;
79
+ }
80
+ &::part(progress-circular-blade-7) {
81
+ transform: rotate(315deg) translateY(-100%);
82
+ animation-delay: -0.875s;
83
+ }
84
+ &::part(progress-circular-blade-8) {
85
+ transform: rotate(360deg) translateY(-100%);
86
+ animation-delay: -0.75s;
87
+ }
88
+ }
89
+
90
+ @each $k, $v in (circular: 0, linear: 1) {
91
+ &[progress-view-style='#{$k}'] {
92
+ :where(&) {
93
+ --progress-view-style-index: #{$v};
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,23 @@
1
+ @use '../vars';
2
+ @use '../mixins';
3
+
4
+ @layer #{vars.$transitions-layer} {
5
+ @media (prefers-reduced-motion: no-preference) {
6
+ progress-view {
7
+ :where(&) {
8
+ //
9
+ }
10
+ }
11
+ }
12
+ @keyframes progressViewCircular {
13
+ 0% {
14
+ opacity: 0.85;
15
+ }
16
+ 50% {
17
+ opacity: 0.25;
18
+ }
19
+ 100% {
20
+ opacity: 0.25;
21
+ }
22
+ }
23
+ }
@@ -25,6 +25,9 @@
25
25
 
26
26
  [tint='gray'] {
27
27
  :where(&) {
28
+ --accentColorEffective: var(--gray);
29
+ --accentColorEffective4: var(--gray4);
30
+
28
31
  --accentColor: var(--gray);
29
32
  --accentColor2: var(--gray2);
30
33
  --accentColor3: var(--gray3);
@@ -40,6 +43,9 @@
40
43
 
41
44
  [tint='blue'] {
42
45
  :where(&) {
46
+ --accentColorEffective: var(--blue);
47
+ --accentColorEffective4: var(--blue4);
48
+
43
49
  --accentColor: var(--blue);
44
50
  --accentColor2: var(--blue2);
45
51
  --accentColor3: var(--blue3);
@@ -54,6 +60,9 @@
54
60
 
55
61
  [tint='red'] {
56
62
  :where(&) {
63
+ --accentColorEffective: var(--red);
64
+ --accentColorEffective4: var(--red4);
65
+
57
66
  --accentColor: var(--red);
58
67
  --accentColor2: var(--red2);
59
68
  --accentColor3: var(--red3);
@@ -190,6 +190,21 @@
190
190
  {
191
191
  "name": "plain-button"
192
192
  },
193
+ {
194
+ "name": "progress-view",
195
+ "description": "",
196
+ "attributes": [
197
+ {
198
+ "name": "label"
199
+ },
200
+ {
201
+ "name": "current-value-label"
202
+ },
203
+ {
204
+ "name": "value"
205
+ }
206
+ ]
207
+ },
193
208
  {
194
209
  "name": "screen-view"
195
210
  },