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

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;
@@ -80,9 +80,6 @@ $label-line-ifs: (
80
80
  --label--host-align-items: center;
81
81
  --label--host-justify-items: normal;
82
82
 
83
- --label-gap: 0.3rem;
84
- --label--host-gap: var(--label-gap);
85
-
86
83
  --label--iconstack-display: grid;
87
84
  --label--titlestack-display: grid;
88
85
  } @else if $label-style == h-icon-only {
@@ -101,9 +98,6 @@ $label-line-ifs: (
101
98
  --label--host-align-items: normal;
102
99
  --label--host-justify-items: center;
103
100
 
104
- --label-gap: 0.3rem;
105
- --label--host-gap: var(--label-gap);
106
-
107
101
  --label--iconstack-display: grid;
108
102
  --label--titlestack-display: grid;
109
103
  } @else if $label-style == v-icon-only {
@@ -117,25 +111,6 @@ $label-line-ifs: (
117
111
  }
118
112
  }
119
113
 
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
114
  @mixin set-label-font($value) {
140
115
  --label--titlestack-font-size: var(--label-#{$value}-font-size);
141
116
  --label--titlestack-line-height: var(--label-#{$value}-line-height);
@@ -172,67 +147,19 @@ $label-line-ifs: (
172
147
  @layer #{vars.$components-layer} {
173
148
  label-view {
174
149
  :where(&) {
175
- // transition: --label--style 1ms step-start;
176
-
177
150
  padding-inline: var(--label-padding-inline);
178
151
 
179
152
  align-items: var(--label--host-align-items,);
180
153
  justify-items: var(--label--host-justify-items,);
181
- // place-items: center;
182
- // place-content: center;
183
154
 
184
- // grid-auto-flow: column;
185
- // grid-auto-columns: minmax(0, 1fr);
186
155
  grid-template-columns: var(--label--host-grid-template-columns,);
187
156
  grid-template-rows: var(--label--host-grid-template-rows,);
188
- // grid-template-areas: 'label-image-stack label-title-stack';
189
157
 
190
- gap: var(--label--host-gap,); //;
158
+ gap: calc(var(--label-gap) * 1rem);
191
159
 
192
- // --label-image-size: 2rem;
193
160
  --label-imagestack-fontsize: calc(var(--label-image-size) * 1rem);
194
- // gap: 0;
195
161
 
196
162
  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
163
  }
237
164
 
238
165
  &:has(> [slot='image']) {
@@ -241,6 +168,7 @@ $label-line-ifs: (
241
168
  // background-color: green;
242
169
  }
243
170
  }
171
+
244
172
  &:has(> :not([slot])) {
245
173
  :where(&) {
246
174
  --label--has-title: yes;
@@ -250,7 +178,6 @@ $label-line-ifs: (
250
178
 
251
179
  > :not([slot]) {
252
180
  :where(&) {
253
- // grid-area: label-title-stack;
254
181
  overflow: var(--label--overflow,);
255
182
 
256
183
  text-overflow: var(--label--text-overflow,);
@@ -261,14 +188,29 @@ $label-line-ifs: (
261
188
 
262
189
  line-clamp: var(--label--line-clamp,);
263
190
  -webkit-line-clamp: var(--label--line-clamp,);
191
+
192
+ text-decoration: underline;
193
+
194
+ font-size: var(--label--titlestack-font-size,);
195
+
196
+ line-height: var(--label--titlestack-line-height,);
197
+
198
+ font-weight: var(--label--titlestack-font-weight,);
199
+
200
+ display: var(--label--titlestack-display, none);
264
201
  }
265
202
  }
266
203
 
267
- // > [slot='image'] {
268
- // :where(&:is(i)) {
269
- // line-height: 1.1;
270
- // }
271
- // }
204
+ > [slot='image'] {
205
+ aspect-ratio: 1 / 1;
206
+
207
+ inline-size: var(--label-imagestack-fontsize);
208
+ block-size: var(--label-imagestack-fontsize);
209
+
210
+ font-size: var(--label-imagestack-fontsize);
211
+
212
+ display: var(--label--iconstack-display, none);
213
+ }
272
214
 
273
215
  // vars
274
216
  @supports (x: #{string.unquote('if(else:red)')}) {
@@ -307,9 +249,6 @@ $label-line-ifs: (
307
249
  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
250
  );
309
251
 
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
252
  --label--iconstack-display: if(
314
253
  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
254
  );
@@ -335,15 +274,12 @@ $label-line-ifs: (
335
274
  }
336
275
  @container not style(--label-style) {
337
276
  &:not([label-style]) {
338
- // :where(&[image-hint='yes'][title-hint='yes']) {
339
277
  :where(&:has(> [slot='image']):has(> :not([slot]))) {
340
278
  @include set-label-style(h-title-and-icon);
341
279
  }
342
- // :where(&[image-hint='yes']:not([title-hint='yes'])) {
343
280
  :where(&:has(> [slot='image']):not(:has(> :not([slot])))) {
344
281
  @include set-label-style(h-icon-only);
345
282
  }
346
- // :where(&[title-hint='yes']:not([image-hint='yes'])) {
347
283
  :where(&:has(> :not([slot])):not(:has(> [slot='image']))) {
348
284
  @include set-label-style(h-title-only);
349
285
  }
@@ -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);
@@ -32,14 +35,17 @@
32
35
  --accentColor5: var(--gray5);
33
36
  }
34
37
 
35
- :where(&[is='bordered-button']) {
36
- // --accentEmphasis: light-dark(color-mix(in oklch, var(--gray) 50%, var(--black)), color-mix(in oklch, var(--gray) 50%, var(--white)));
37
- --accentSubtle: var(--gray4);
38
- }
38
+ // :where(&[is='bordered-button']) {
39
+ // // --accentEmphasis: light-dark(color-mix(in oklch, var(--gray) 50%, var(--black)), color-mix(in oklch, var(--gray) 50%, var(--white)));
40
+ // --accentSubtle: var(--gray4);
41
+ // }
39
42
  }
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);
@@ -47,13 +53,16 @@
47
53
  --accentColor5: var(--blue5);
48
54
  }
49
55
 
50
- :where(&[is='bordered-button']) {
51
- --accentSubtle: var(--blue4);
52
- }
56
+ // :where(&[is='bordered-button']) {
57
+ // --accentSubtle: var(--blue4);
58
+ // }
53
59
  }
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);
@@ -61,8 +70,8 @@
61
70
  --accentColor5: var(--red5);
62
71
  }
63
72
 
64
- :where(&[is='bordered-button']) {
65
- --accentSubtle: var(--red4);
66
- }
73
+ // :where(&[is='bordered-button']) {
74
+ // --accentSubtle: var(--red4);
75
+ // }
67
76
  }
68
77
  }
@@ -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
  },