@vialiq/flux-ui 0.20.0 → 0.22.0

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.
@@ -0,0 +1,259 @@
1
+ @use '../styles/variables' as tokens;
2
+ @use '../styles/functions' as func;
3
+
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ // COMPONENT: vi-progress
6
+ // ─────────────────────────────────────────────────────────────────────────────
7
+
8
+ :host {
9
+ display: block;
10
+ width: 100%;
11
+ }
12
+
13
+ .vi-progress {
14
+ display: flex;
15
+ align-items: center;
16
+ gap: var(--vi-progress-gap, #{tokens.$spacing-sm});
17
+ font-family: var(--vi-font-family, #{tokens.$font-family-base});
18
+
19
+ // Level 1: Consumer override
20
+ // Level 2: Component default
21
+ // Level 3: Semantic token
22
+ --progress-track-bg: var(--vi-progress-track-bg, #{tokens.$layer-03});
23
+ --progress-indicator-bg: var(--vi-progress-indicator-bg, #{tokens.$color-primary});
24
+ --progress-text-color: var(--vi-progress-text-color, #{tokens.$text-primary});
25
+ --progress-border-radius: var(--vi-progress-border-radius, #{tokens.$border-radius-full});
26
+ --progress-line-height: var(--vi-progress-line-height, #{func.to-rem(8px)});
27
+ --progress-circle-size: var(--vi-progress-circle-size, #{func.to-rem(120px)});
28
+ --progress-font-size: var(--vi-progress-font-size, #{tokens.$font-size-base});
29
+
30
+ // Variants
31
+ &.vi-progress--variant-primary {
32
+ --progress-indicator-bg: var(--vi-progress-primary-bg, #{tokens.$color-primary});
33
+ }
34
+ &.vi-progress--variant-success {
35
+ --progress-indicator-bg: var(--vi-progress-success-bg, #{tokens.$color-green-500});
36
+ }
37
+ &.vi-progress--variant-error {
38
+ --progress-indicator-bg: var(--vi-progress-error-bg, #{tokens.$color-red-500});
39
+ }
40
+ &.vi-progress--variant-warning {
41
+ --progress-indicator-bg: var(--vi-progress-warning-bg, #{tokens.$color-yellow-500});
42
+ }
43
+
44
+ // Sizes
45
+ &.vi-progress--size-sm {
46
+ --progress-line-height: var(--vi-progress-line-height-sm, #{func.to-rem(6px)});
47
+ --progress-font-size: var(--vi-progress-font-size-sm, #{tokens.$font-size-sm});
48
+ --progress-circle-size: var(--vi-progress-circle-size-sm, #{func.to-rem(80px)});
49
+ }
50
+ &.vi-progress--size-md {
51
+ --progress-line-height: var(--vi-progress-line-height-md, #{func.to-rem(8px)});
52
+ --progress-font-size: var(--vi-progress-font-size-md, #{tokens.$font-size-base});
53
+ --progress-circle-size: var(--vi-progress-circle-size-md, #{func.to-rem(120px)});
54
+ }
55
+ &.vi-progress--size-lg {
56
+ --progress-line-height: var(--vi-progress-line-height-lg, #{func.to-rem(12px)});
57
+ --progress-font-size: var(--vi-progress-font-size-lg, #{tokens.$font-size-lg});
58
+ --progress-circle-size: var(--vi-progress-circle-size-lg, #{func.to-rem(160px)});
59
+ }
60
+ }
61
+
62
+ // ─────────────────────────────────────────────────────────────────────────────
63
+ // TYPE: LINE
64
+ // ─────────────────────────────────────────────────────────────────────────────
65
+
66
+ .vi-progress--line {
67
+ .vi-progress-outer {
68
+ flex: 1 1 auto;
69
+ }
70
+
71
+ .vi-progress-track {
72
+ background-color: var(--progress-track-bg);
73
+ border-radius: var(--progress-border-radius);
74
+ height: var(--progress-line-height);
75
+ overflow: hidden; // Ensures indicator is clipped to radius
76
+ position: relative;
77
+ width: 100%;
78
+ }
79
+
80
+ .vi-progress-success-indicator {
81
+ background-color: var(--progress-success-bg, #{tokens.$color-success});
82
+ border-radius: var(--progress-border-radius);
83
+ height: 100%;
84
+ position: absolute;
85
+ left: 0;
86
+ top: 0;
87
+ transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
88
+ }
89
+
90
+ .vi-progress-indicator {
91
+ background-color: var(--progress-indicator-bg);
92
+ border-radius: var(--progress-border-radius);
93
+ height: 100%;
94
+ position: absolute;
95
+ left: 0;
96
+ top: 0;
97
+ transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
98
+ }
99
+
100
+ // Status: active (gleaming sweep animation)
101
+ &.vi-progress--status-active .vi-progress-indicator::before {
102
+ content: '';
103
+ position: absolute;
104
+ top: 0;
105
+ left: 0;
106
+ bottom: 0;
107
+ right: 0;
108
+ background: var(--vi-progress-gleam-bg, #{tokens.$layer-01});
109
+ opacity: 0;
110
+ animation: vi-progress-active-gleam 2s cubic-bezier(0.23, 1, 0.32, 1) infinite;
111
+ }
112
+ }
113
+
114
+ // ─────────────────────────────────────────────────────────────────────────────
115
+ // TYPE: CIRCLE
116
+ // ─────────────────────────────────────────────────────────────────────────────
117
+
118
+ .vi-progress--circle,
119
+ .vi-progress--dashboard {
120
+ position: relative;
121
+ display: inline-flex;
122
+ flex-direction: column;
123
+ justify-content: center;
124
+ align-items: center;
125
+ width: var(--progress-circle-size);
126
+ height: var(--progress-circle-size);
127
+ gap: 0; // Text is overlaid
128
+
129
+ .vi-progress-circle-svg {
130
+ width: 100%;
131
+ height: 100%;
132
+ transform: rotate(-90deg);
133
+ }
134
+
135
+ .vi-progress-circle-track {
136
+ fill: transparent;
137
+ stroke: var(--progress-track-bg);
138
+ // stroke-width is provided inline via JS based on props, but fallback here
139
+ stroke-width: var(--vi-progress-circle-stroke-width, 6);
140
+ }
141
+
142
+ .vi-progress-circle-success {
143
+ fill: transparent;
144
+ stroke: var(--progress-success-bg, #{tokens.$color-success});
145
+ stroke-width: var(--vi-progress-circle-stroke-width, 6);
146
+ transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1);
147
+ }
148
+
149
+ .vi-progress-circle-indicator {
150
+ fill: transparent;
151
+ stroke: var(--progress-indicator-bg);
152
+ stroke-width: var(--vi-progress-circle-stroke-width, 6);
153
+ transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
154
+ }
155
+
156
+ .vi-progress-info {
157
+ position: absolute;
158
+ left: 50%;
159
+ top: 50%;
160
+ transform: translate(-50%, -50%);
161
+ width: 100%;
162
+ text-align: center;
163
+ }
164
+ }
165
+
166
+ // ─────────────────────────────────────────────────────────────────────────────
167
+ // TYPE: STEPS
168
+ // ─────────────────────────────────────────────────────────────────────────────
169
+
170
+ .vi-progress--steps {
171
+ .vi-progress-steps {
172
+ flex: 1 1 auto;
173
+ display: flex;
174
+ gap: var(--vi-progress-step-gap, #{func.to-rem(4px)});
175
+ align-items: center;
176
+ }
177
+
178
+ .vi-progress-step-item {
179
+ flex: 1;
180
+ border-radius: var(--progress-border-radius);
181
+ transition: background-color 0.3s ease, height 0.3s ease;
182
+ }
183
+ }
184
+
185
+ // ─────────────────────────────────────────────────────────────────────────────
186
+ // INFO TEXT & ICONS
187
+ // ─────────────────────────────────────────────────────────────────────────────
188
+
189
+ .vi-progress-info {
190
+ color: var(--progress-text-color);
191
+ font-size: var(--progress-font-size);
192
+ line-height: 1;
193
+ white-space: nowrap;
194
+ word-break: keep-all;
195
+
196
+ // Align icons nicely
197
+ display: flex;
198
+ align-items: center;
199
+ justify-content: center;
200
+
201
+ vi-icon {
202
+ font-size: calc(var(--progress-font-size) * 1.15); // icons slightly larger than text
203
+ }
204
+
205
+ // Specific icon colors overriding text color
206
+ .vi-progress--variant-success & vi-icon {
207
+ color: var(--progress-indicator-bg);
208
+ }
209
+ .vi-progress--variant-error & vi-icon {
210
+ color: var(--progress-indicator-bg);
211
+ }
212
+
213
+ // Simulate filled icons for Line mode
214
+ .vi-progress--line.vi-progress--status-success & vi-icon,
215
+ .vi-progress--line.vi-progress--status-exception & vi-icon {
216
+ background-color: var(--progress-indicator-bg);
217
+ color: #{tokens.$text-inverse};
218
+ border-radius: 50%;
219
+ // Ensure the background is tightly fitted to the icon
220
+ width: 1em;
221
+ height: 1em;
222
+ display: inline-flex;
223
+ align-items: center;
224
+ justify-content: center;
225
+ }
226
+ }
227
+
228
+ // ─────────────────────────────────────────────────────────────────────────────
229
+ // ANIMATIONS
230
+ // ─────────────────────────────────────────────────────────────────────────────
231
+
232
+ @keyframes vi-progress-active-gleam {
233
+ 0% {
234
+ opacity: 0.1;
235
+ width: 0;
236
+ }
237
+ 20% {
238
+ opacity: 0.5;
239
+ width: 0;
240
+ }
241
+ 100% {
242
+ opacity: 0;
243
+ width: 100%;
244
+ }
245
+ }
246
+
247
+ @media (prefers-reduced-motion: reduce) {
248
+ .vi-progress-indicator {
249
+ transition: none !important;
250
+ }
251
+
252
+ .vi-progress--status-active .vi-progress-indicator::before {
253
+ animation: none !important;
254
+ }
255
+
256
+ .vi-progress-circle-indicator {
257
+ transition: none !important;
258
+ }
259
+ }
@@ -34,7 +34,7 @@
34
34
 
35
35
  .radio-group-items {
36
36
  display: flex;
37
- gap: var(--vi-radio-group-gap, 8px);
37
+ gap: var(--vi-radio-group-gap, #{tokens.$spacing-xs});
38
38
 
39
39
  &[orientation="vertical"] {
40
40
  flex-direction: column;
@@ -76,7 +76,7 @@
76
76
  .radio-wrapper {
77
77
  display: inline-flex;
78
78
  align-items: center;
79
- gap: var(--vi-radio-label-gap, 8px);
79
+ gap: var(--vi-radio-label-gap, #{tokens.$spacing-xs});
80
80
  cursor: pointer;
81
81
  font-family: #{tokens.$font-family-base};
82
82
  font-size: var(--vi-radio-label-font-size, #{tokens.$font-size-base});
@@ -104,8 +104,8 @@
104
104
  display: inline-flex;
105
105
  align-items: center;
106
106
  justify-content: center;
107
- width: var(--vi-radio-size, 18px);
108
- height: var(--vi-radio-size, 18px);
107
+ width: var(--vi-radio-size, #{tokens.$spacing-md});
108
+ height: var(--vi-radio-size, #{tokens.$spacing-md});
109
109
  border: #{tokens.$border-width-base} solid var(--vi-radio-border-color, #{tokens.$outline});
110
110
  border-radius: 50%;
111
111
  background-color: var(--vi-radio-background-color, #{tokens.$color-background});
@@ -115,8 +115,9 @@
115
115
 
116
116
  .radio-dot {
117
117
  box-sizing: border-box;
118
- width: var(--vi-radio-dot-size, 8px);
119
- height: var(--vi-radio-dot-size, 8px);
118
+ // 8px dot is half of the 16px ($spacing-md) circle; this ratio is intentional
119
+ width: var(--vi-radio-dot-size, calc(#{tokens.$spacing-md} / 2));
120
+ height: var(--vi-radio-dot-size, calc(#{tokens.$spacing-md} / 2));
120
121
  border-radius: 50%;
121
122
  background-color: var(--vi-radio-dot-color, #{tokens.$color-primary});
122
123
  transform: scale(0);
@@ -138,7 +139,7 @@
138
139
  .radio-input:focus-visible + .radio-circle {
139
140
  outline: #{tokens.$border-width-base} solid var(--vi-radio-focus-ring-color, #{tokens.$focus});
140
141
  outline-offset: 2px;
141
- box-shadow: 0 0 0 3px var(--vi-radio-focus-ring-glow, #{tokens.$color-blue-200});
142
+ box-shadow: #{tokens.$focus-ring-shadow};
142
143
  }
143
144
 
144
145
  // Hover state (only on non-disabled)
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  @use '../styles/variables' as tokens;
9
+ @use '../styles/functions' as func;
9
10
 
10
11
  @layer components {
11
12
  // -------------------------------------------------------------------------
@@ -38,14 +39,14 @@
38
39
  justify-content: space-between;
39
40
  box-sizing: border-box;
40
41
  width: 100%;
41
- min-height: var(--vi-select-sizing-min-height, 40px);
42
- padding: var(--vi-select-spacing-padding-block, #{tokens.$spacing-xs})
43
- var(--vi-select-spacing-padding-inline, #{tokens.$spacing-sm});
42
+ min-height: var(--vi-select-sizing-min-height, #{tokens.$spacing-xl});
43
+ padding: var(--vi-select-spacing-padding-block, #{tokens.$spacing-unit})
44
+ var(--vi-select-spacing-padding-inline, #{func.to-rem(11px)});
44
45
  background-color: var(--vi-select-background-color, #{tokens.$color-background});
45
46
  border: var(--vi-select-border-width, #{tokens.$border-width-thin}) solid var(--vi-select-border-color, #{tokens.$border-03});
46
- border-radius: var(--vi-select-shape-border-radius, #{tokens.$border-radius-lg});
47
+ border-radius: var(--vi-select-shape-border-radius, #{func.to-rem(6px)});
47
48
  font-family: inherit;
48
- font-size: var(--vi-font-size-base, #{tokens.$font-size-base});
49
+ font-size: var(--vi-font-size-base, #{func.to-rem(14px)});
49
50
  color: var(--vi-select-text-color, #{tokens.$color-foreground});
50
51
  transition: border-color 150ms ease, box-shadow 150ms ease;
51
52
  cursor: pointer;
@@ -69,7 +70,7 @@
69
70
  border-color: var(--vi-select-focus-ring-color, #{tokens.$focus});
70
71
  outline: var(--vi-border-width-base, 2px) solid var(--vi-select-focus-ring-color, #{tokens.$focus});
71
72
  outline-offset: -1px;
72
- box-shadow: 0 0 0 3px var(--vi-select-focus-ring-glow, #{tokens.$color-blue-200});
73
+ box-shadow: #{tokens.$focus-ring-shadow};
73
74
  }
74
75
  }
75
76
 
@@ -289,7 +290,7 @@
289
290
  border-color: var(--vi-select-focus-ring-color, #{tokens.$focus});
290
291
  outline: var(--vi-border-width-base, 2px) solid var(--vi-select-focus-ring-color, #{tokens.$focus});
291
292
  outline-offset: -1px;
292
- box-shadow: 0 0 0 3px var(--vi-select-focus-ring-glow, #{tokens.$color-blue-200});
293
+ box-shadow: #{tokens.$focus-ring-shadow};
293
294
  }
294
295
  }
295
296
 
@@ -0,0 +1,35 @@
1
+ @use '../styles/variables' as tokens;
2
+ @use '../styles/functions' as func;
3
+ @use './animation';
4
+
5
+ @layer components {
6
+ .vi-skeleton {
7
+ display: block;
8
+ background: var(--vi-skeleton-color, #{tokens.$layer-02});
9
+ box-sizing: border-box;
10
+ /* Transition for smooth animation changes if needed */
11
+ transition: background 0.3s ease;
12
+ }
13
+
14
+ /* Shimmer Animation State */
15
+ .vi-skeleton--animation-shimmer {
16
+ background: linear-gradient(
17
+ 90deg,
18
+ var(--vi-skeleton-color, #{tokens.$layer-02}) 25%,
19
+ var(--vi-skeleton-to-color, #{tokens.$layer-03}) 37%,
20
+ var(--vi-skeleton-color, #{tokens.$layer-02}) 63%
21
+ );
22
+ background-size: 400% 100%;
23
+ animation: vi-shimmer 1.4s ease infinite;
24
+ }
25
+
26
+ /* Pulse Animation State */
27
+ .vi-skeleton--animation-pulse {
28
+ animation: vi-pulse 1.5s ease-in-out infinite;
29
+ }
30
+
31
+ /* None Animation State */
32
+ .vi-skeleton--animation-none {
33
+ /* No animation overrides, uses default static background */
34
+ }
35
+ }
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Spin component base styles.
3
+ *
4
+ * Provides the host-agnostic foundation for the loading spinner.
5
+ * Includes the dot animations and overlay dimming logic.
6
+ */
7
+
8
+ @use '../styles/functions' as func;
9
+ @use '../styles/variables' as tokens;
10
+
11
+ @layer components {
12
+
13
+ @keyframes viSpinRotate {
14
+ 100% {
15
+ transform: rotate(360deg);
16
+ }
17
+ }
18
+
19
+ @keyframes viSpinMove {
20
+ to {
21
+ opacity: 1;
22
+ }
23
+ }
24
+
25
+ .spin-wrapper {
26
+ display: inline-flex;
27
+ flex-direction: column;
28
+ align-items: center;
29
+ justify-content: center;
30
+ color: var(--vi-spin-color, var(--vi-color-primary, #{tokens.$color-primary}));
31
+ vertical-align: middle;
32
+ text-align: center;
33
+ opacity: 0;
34
+ transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
35
+
36
+ &.spinning {
37
+ opacity: 1;
38
+ }
39
+
40
+ &.spin-fullscreen {
41
+ position: fixed;
42
+ inset: 0;
43
+ z-index: 9999;
44
+ background-color: var(--vi-spin-fullscreen-bg, rgba(255, 255, 255, 0.8));
45
+ }
46
+ }
47
+
48
+ .spin-circle {
49
+ display: inline-block;
50
+ font-size: var(--vi-spin-size-md, #{func.to-rem(20px)});
51
+ width: 1em;
52
+ height: 1em;
53
+ animation: viSpinRotate 1s infinite linear;
54
+
55
+ &.spin-circle-determinate {
56
+ animation: none;
57
+ transform: rotate(-90deg);
58
+ }
59
+ }
60
+
61
+ .spin-dot {
62
+ position: relative;
63
+ display: inline-block;
64
+ font-size: var(--vi-spin-size-md, #{func.to-rem(20px)});
65
+ width: 1em;
66
+ height: 1em;
67
+ transform: rotate(45deg);
68
+ animation: viSpinRotate 1.2s infinite linear;
69
+ }
70
+
71
+ .spin-dot-item {
72
+ position: absolute;
73
+ display: block;
74
+ width: var(--vi-spin-item-size-md, 9px);
75
+ height: var(--vi-spin-item-size-md, 9px);
76
+ background-color: currentColor;
77
+ border-radius: 100%;
78
+ transform: scale(0.75);
79
+ transform-origin: 50% 50%;
80
+ opacity: 0.3;
81
+ animation: viSpinMove 1s infinite linear alternate;
82
+
83
+ &:nth-child(1) {
84
+ top: 0;
85
+ left: 0;
86
+ }
87
+ &:nth-child(2) {
88
+ top: 0;
89
+ right: 0;
90
+ animation-delay: 0.4s;
91
+ }
92
+ &:nth-child(3) {
93
+ right: 0;
94
+ bottom: 0;
95
+ animation-delay: 0.8s;
96
+ }
97
+ &:nth-child(4) {
98
+ bottom: 0;
99
+ left: 0;
100
+ animation-delay: 1.2s;
101
+ }
102
+ }
103
+
104
+ .spin-text {
105
+ margin-top: #{tokens.$spacing-xs};
106
+ font-family: #{tokens.$font-family-base};
107
+ font-size: var(--vi-spin-text-font-size, #{tokens.$font-size-sm});
108
+ color: var(--vi-spin-color, var(--vi-color-primary, #{tokens.$color-primary}));
109
+ }
110
+
111
+ // Sizes
112
+ .spin-sm {
113
+ .spin-circle, .spin-dot {
114
+ font-size: var(--vi-spin-size-sm, #{tokens.$font-size-base});
115
+ }
116
+ .spin-dot-item {
117
+ width: var(--vi-spin-item-size-sm, #{tokens.$spacing-unit});
118
+ height: var(--vi-spin-item-size-sm, #{tokens.$spacing-unit});
119
+ }
120
+ }
121
+
122
+ .spin-lg {
123
+ .spin-circle, .spin-dot {
124
+ font-size: var(--vi-spin-size-lg, #{tokens.$spacing-xl});
125
+ }
126
+ .spin-dot-item {
127
+ width: var(--vi-spin-item-size-lg, #{tokens.$font-size-base});
128
+ height: var(--vi-spin-item-size-lg, #{tokens.$font-size-base});
129
+ }
130
+ }
131
+
132
+ // Nested Overlay Mode
133
+ .spin-nested-loading {
134
+ position: relative;
135
+
136
+ .spin-container {
137
+ position: relative;
138
+ transition: opacity 0.3s;
139
+
140
+ &.spin-blur {
141
+ clear: both;
142
+ opacity: 0.5;
143
+ user-select: none;
144
+ pointer-events: none;
145
+ }
146
+ }
147
+
148
+ > .spin-wrapper {
149
+ position: absolute;
150
+ top: 0;
151
+ left: 0;
152
+ z-index: 4;
153
+ display: flex;
154
+ width: 100%;
155
+ height: 100%;
156
+ max-height: 400px;
157
+ }
158
+ }
159
+ }
@@ -1,4 +1,5 @@
1
1
  @use '../styles/variables' as tokens;
2
+ @use '../styles/functions' as func;
2
3
 
3
4
  @layer components {
4
5
  // ── Wrapper ──────────────────────────────────────────────────────────────────
@@ -10,7 +11,7 @@
10
11
  .switch-wrapper {
11
12
  display: inline-flex;
12
13
  align-items: flex-start;
13
- gap: var(--vi-switch-label-gap, 8px);
14
+ gap: var(--vi-switch-label-gap, #{tokens.$spacing-xs});
14
15
  cursor: pointer;
15
16
  font-family: #{tokens.$font-family-base};
16
17
  font-size: var(--vi-switch-label-font-size, #{tokens.$font-size-base});
@@ -52,15 +53,15 @@
52
53
  .switch-track {
53
54
  box-sizing: border-box;
54
55
  position: relative;
55
- width: var(--vi-switch-track-width, 44px);
56
- height: var(--vi-switch-track-height, 24px);
56
+ width: var(--vi-switch-track-width, func.to-rem(44px));
57
+ height: var(--vi-switch-track-height, func.to-rem(22px));
57
58
  background-color: var(--vi-switch-track-color-off, #{tokens.$border-03});
58
- border-radius: var(--vi-border-radius-full, 9999px);
59
+ border-radius: var(--vi-border-radius-full, #{tokens.$border-radius-full});
59
60
  transition: background-color var(--vi-switch-transition-duration, 150ms) ease;
60
61
  flex-shrink: 0;
61
62
  // Align track centre with first-line cap-height
62
63
  margin-top: calc(
63
- (1em * #{tokens.$line-height-normal} - var(--vi-switch-track-height, 24px)) / 2
64
+ (1em * #{tokens.$line-height-normal} - var(--vi-switch-track-height, func.to-rem(24px))) / 2
64
65
  );
65
66
  }
66
67
 
@@ -69,13 +70,13 @@
69
70
  .switch-thumb {
70
71
  position: absolute;
71
72
  top: 50%;
72
- left: var(--vi-switch-thumb-offset, 2px);
73
+ left: var(--vi-switch-thumb-offset, func.to-rem(2px));
73
74
  transform: translateY(-50%);
74
- width: var(--vi-switch-thumb-size, 18px);
75
- height: var(--vi-switch-thumb-size, 18px);
75
+ width: var(--vi-switch-thumb-size, func.to-rem(18px));
76
+ height: var(--vi-switch-thumb-size, func.to-rem(18px));
76
77
  background-color: var(--vi-switch-thumb-color, #{tokens.$text-primary-inverse});
77
78
  border-radius: 50%;
78
- box-shadow: var(--vi-switch-thumb-shadow, 0 1px 3px rgba(0, 0, 0, 0.2));
79
+ box-shadow: var(--vi-switch-thumb-shadow, #{tokens.$shadow-md});
79
80
  transition: left var(--vi-switch-transition-duration, 150ms) ease;
80
81
  }
81
82
 
@@ -86,7 +87,7 @@
86
87
 
87
88
  .switch-thumb {
88
89
  left: calc(
89
- 100% - var(--vi-switch-thumb-size, 18px) - var(--vi-switch-thumb-offset, 2px)
90
+ 100% - var(--vi-switch-thumb-size, func.to-rem(18px)) - var(--vi-switch-thumb-offset, func.to-rem(2px))
90
91
  );
91
92
  }
92
93
  }
@@ -97,7 +98,7 @@
97
98
  outline: #{tokens.$border-width-base} solid
98
99
  var(--vi-switch-focus-ring-color, #{tokens.$focus});
99
100
  outline-offset: 2px;
100
- box-shadow: 0 0 0 3px var(--vi-switch-focus-ring-glow, #{tokens.$color-blue-200});
101
+ box-shadow: #{tokens.$focus-ring-shadow};
101
102
  }
102
103
 
103
104
  // ── Disabled state ────────────────────────────────────────────────────────────
@@ -107,11 +108,11 @@
107
108
  opacity: var(--vi-switch-disabled-opacity, 0.5);
108
109
 
109
110
  .switch-track {
110
- background-color: #{tokens.$border-03};
111
+ background-color: var(--vi-switch-track-color-disabled, #{tokens.$border-03});
111
112
  }
112
113
 
113
114
  .switch-input:checked ~ .switch-track {
114
- background-color: #{tokens.$text-disabled};
115
+ background-color: var(--vi-switch-track-color-on-disabled, #{tokens.$text-disabled});
115
116
  }
116
117
  }
117
118
 
@@ -1,4 +1,5 @@
1
1
  @use '@vialiq/flux-ui/styles/variables' as tokens;
2
+ @use '../styles/functions' as func;
2
3
 
3
4
  @layer components {
4
5
 
@@ -12,7 +13,7 @@
12
13
  &:focus-visible {
13
14
  outline: 2px solid var(--vi-tabs-indicator-color, #{tokens.$color-primary});
14
15
  outline-offset: 2px;
15
- border-radius: 2px;
16
+ border-radius: #{func.to-rem(2px)};
16
17
  }
17
18
  }
18
19