@skewedaspect/sleekspace-ui 0.8.1 → 0.9.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.
Files changed (177) hide show
  1. package/dist/components/Dropdown/SkDropdown.vue.d.ts +9 -1
  2. package/dist/components/Dropdown/types.d.ts +2 -1
  3. package/dist/components/NavBar/SkNavBar.vue.d.ts +9 -1
  4. package/dist/components/NavBar/context.d.ts +2 -0
  5. package/dist/components/NavBar/types.d.ts +5 -1
  6. package/dist/components/Page/SkPage.vue.d.ts +9 -0
  7. package/dist/components/ScrollArea/SkScrollArea.vue.d.ts +105 -4
  8. package/dist/composables/useCustomColors.d.ts +18 -56
  9. package/{src → dist}/global.d.ts +6 -2
  10. package/dist/sleekspace-ui.css +4253 -1251
  11. package/dist/sleekspace-ui.es.js +204 -109
  12. package/dist/sleekspace-ui.umd.js +204 -109
  13. package/dist/static/classes.d.ts +18 -0
  14. package/dist/static/components/alert.d.ts +12 -0
  15. package/dist/static/components/avatar.d.ts +9 -0
  16. package/dist/static/components/breadcrumbs.d.ts +6 -0
  17. package/dist/static/components/button.d.ts +13 -0
  18. package/dist/static/components/card.d.ts +5 -0
  19. package/dist/static/components/checkbox.d.ts +10 -0
  20. package/dist/static/components/colorPicker.d.ts +8 -0
  21. package/dist/static/components/divider.d.ts +8 -0
  22. package/dist/static/components/dropdown.d.ts +8 -0
  23. package/dist/static/components/field.d.ts +15 -0
  24. package/dist/static/components/group.d.ts +5 -0
  25. package/dist/static/components/input.d.ts +14 -0
  26. package/dist/static/components/navBar.d.ts +16 -0
  27. package/dist/static/components/numberInput.d.ts +15 -0
  28. package/dist/static/components/page.d.ts +9 -0
  29. package/dist/static/components/pagination.d.ts +5 -0
  30. package/dist/static/components/panel.d.ts +11 -0
  31. package/dist/static/components/progress.d.ts +9 -0
  32. package/dist/static/components/radio.d.ts +11 -0
  33. package/dist/static/components/select.d.ts +10 -0
  34. package/dist/static/components/sidebar.d.ts +9 -0
  35. package/dist/static/components/skeleton.d.ts +11 -0
  36. package/dist/static/components/slider.d.ts +12 -0
  37. package/dist/static/components/spinner.d.ts +12 -0
  38. package/dist/static/components/switchInput.d.ts +10 -0
  39. package/dist/static/components/table.d.ts +12 -0
  40. package/dist/static/components/tag.d.ts +8 -0
  41. package/dist/static/components/tagsInput.d.ts +7 -0
  42. package/dist/static/components/textarea.d.ts +12 -0
  43. package/dist/static/components/toolbar.d.ts +12 -0
  44. package/dist/static/components/tooltip.d.ts +7 -0
  45. package/dist/static/escape.d.ts +2 -0
  46. package/dist/static/index.cjs.js +1 -0
  47. package/dist/static/index.d.ts +68 -0
  48. package/dist/static/index.es.js +732 -0
  49. package/dist/static/render.d.ts +12 -0
  50. package/dist/static/specs.d.ts +2 -0
  51. package/dist/static/types.d.ts +43 -0
  52. package/dist/tokens.css +322 -0
  53. package/dist/types/index.d.ts +36 -0
  54. package/docs/guides/installation.md +8 -2
  55. package/docs/guides/pure-css/_meta.yaml +8 -0
  56. package/docs/guides/pure-css/class-api.md +1070 -0
  57. package/docs/guides/pure-css/custom-elements.md +574 -0
  58. package/docs/guides/pure-css/index.md +86 -0
  59. package/docs/guides/pure-css/limitations.md +152 -0
  60. package/docs/guides/pure-css/static-helpers.md +1203 -0
  61. package/llms-full.txt +3736 -261
  62. package/package.json +16 -5
  63. package/src/components/Card/SkCard.vue +1 -0
  64. package/src/components/ContextMenu/SkContextMenuRadioGroup.vue +4 -1
  65. package/src/components/Dropdown/SkDropdown.vue +20 -3
  66. package/src/components/Dropdown/SkDropdownRadioGroup.vue +4 -1
  67. package/src/components/Dropdown/types.ts +2 -1
  68. package/src/components/NavBar/SkNavBar.vue +14 -4
  69. package/src/components/NavBar/context.ts +4 -2
  70. package/src/components/NavBar/types.ts +6 -1
  71. package/src/components/Page/SkPage.vue +11 -0
  72. package/src/components/Panel/SkPanel.vue +2 -1
  73. package/src/components/ScrollArea/SkScrollArea.vue +78 -5
  74. package/src/components/TreeView/SkTreeView.vue +7 -2
  75. package/src/composables/useCustomColors.ts +86 -77
  76. package/src/composables/usePortalContext.test.ts +0 -2
  77. package/src/shims.d.ts +10 -0
  78. package/src/static/__tests__/parity.test.ts +717 -0
  79. package/src/static/__tests__/parityHarness.test.ts +98 -0
  80. package/src/static/__tests__/parityHarness.ts +260 -0
  81. package/src/static/classes.test.ts +82 -0
  82. package/src/static/classes.ts +111 -0
  83. package/src/static/components/__tests__/helpers.test.ts +837 -0
  84. package/src/static/components/alert.ts +117 -0
  85. package/src/static/components/avatar.ts +86 -0
  86. package/src/static/components/breadcrumbs.ts +28 -0
  87. package/src/static/components/button.ts +75 -0
  88. package/src/static/components/card.ts +27 -0
  89. package/src/static/components/checkbox.ts +48 -0
  90. package/src/static/components/colorPicker.ts +45 -0
  91. package/src/static/components/divider.ts +39 -0
  92. package/src/static/components/dropdown.ts +36 -0
  93. package/src/static/components/field.ts +86 -0
  94. package/src/static/components/group.ts +27 -0
  95. package/src/static/components/input.ts +55 -0
  96. package/src/static/components/navBar.ts +94 -0
  97. package/src/static/components/numberInput.ts +64 -0
  98. package/src/static/components/page.ts +31 -0
  99. package/src/static/components/pagination.ts +27 -0
  100. package/src/static/components/panel.ts +33 -0
  101. package/src/static/components/progress.ts +31 -0
  102. package/src/static/components/radio.ts +53 -0
  103. package/src/static/components/select.ts +51 -0
  104. package/src/static/components/sidebar.ts +85 -0
  105. package/src/static/components/skeleton.ts +66 -0
  106. package/src/static/components/slider.ts +50 -0
  107. package/src/static/components/spinner.ts +94 -0
  108. package/src/static/components/switchInput.ts +49 -0
  109. package/src/static/components/table.ts +88 -0
  110. package/src/static/components/tag.ts +76 -0
  111. package/src/static/components/tagsInput.ts +35 -0
  112. package/src/static/components/textarea.ts +53 -0
  113. package/src/static/components/toolbar.ts +74 -0
  114. package/src/static/components/tooltip.ts +29 -0
  115. package/src/static/escape.test.ts +53 -0
  116. package/src/static/escape.ts +28 -0
  117. package/src/static/generated/defaults.ts +378 -0
  118. package/src/static/generated/propTypes.ts +425 -0
  119. package/src/static/index.ts +116 -0
  120. package/src/static/render.test.ts +83 -0
  121. package/src/static/render.ts +76 -0
  122. package/src/static/specs.test.ts +58 -0
  123. package/src/static/specs.ts +230 -0
  124. package/src/static/types.ts +176 -0
  125. package/src/styles/__tests__/testHelpers.ts +97 -0
  126. package/src/styles/base/_custom-elements.scss +51 -0
  127. package/src/styles/base/_index.scss +4 -0
  128. package/src/styles/components/__tests__/componentSelectors.test.ts +2575 -0
  129. package/src/styles/components/_alert.scss +82 -39
  130. package/src/styles/components/_avatar.scss +102 -47
  131. package/src/styles/components/_breadcrumbs.scss +39 -37
  132. package/src/styles/components/_button.scss +58 -5
  133. package/src/styles/components/_card.scss +64 -2
  134. package/src/styles/components/_checkbox.scss +35 -5
  135. package/src/styles/components/_color-picker.scss +48 -13
  136. package/src/styles/components/_divider.scss +86 -52
  137. package/src/styles/components/_dropdown.scss +214 -0
  138. package/src/styles/components/_field.scss +76 -23
  139. package/src/styles/components/_group.scss +190 -79
  140. package/src/styles/components/_index.scss +1 -0
  141. package/src/styles/components/_input.scss +81 -5
  142. package/src/styles/components/_menu.scss +1 -1
  143. package/src/styles/components/_navbar.scss +76 -45
  144. package/src/styles/components/_number-input.scss +88 -83
  145. package/src/styles/components/_page.scss +82 -23
  146. package/src/styles/components/_pagination.scss +240 -212
  147. package/src/styles/components/_panel.scss +268 -122
  148. package/src/styles/components/_progress.scss +120 -70
  149. package/src/styles/components/_radio.scss +35 -5
  150. package/src/styles/components/_scroll-area.scss +50 -22
  151. package/src/styles/components/_select.scss +40 -9
  152. package/src/styles/components/_sidebar.scss +59 -34
  153. package/src/styles/components/_skeleton.scss +111 -65
  154. package/src/styles/components/_slider.scss +34 -10
  155. package/src/styles/components/_spinner.scss +107 -56
  156. package/src/styles/components/_switch.scss +36 -5
  157. package/src/styles/components/_table.scss +150 -166
  158. package/src/styles/components/_tag.scss +244 -154
  159. package/src/styles/components/_tags-input.scss +46 -12
  160. package/src/styles/components/_textarea.scss +36 -5
  161. package/src/styles/components/_toolbar.scss +85 -31
  162. package/src/styles/components/_tooltip.scss +172 -3
  163. package/src/styles/mixins/_cut-border.scss +18 -4
  164. package/src/styles/mixins/_dual-selector.scss +192 -0
  165. package/src/styles/mixins/_index.scss +1 -0
  166. package/src/styles/mixins/dualSelector.test.ts +151 -0
  167. package/src/styles/themes/_colorful.scss +25 -0
  168. package/src/styles/themes/_greyscale.scss +25 -0
  169. package/src/styles/themes/_shade-scale.scss +39 -0
  170. package/src/styles/tokens/_semantic-color-kinds.scss +66 -0
  171. package/src/{types.ts → types/index.ts} +19 -11
  172. package/web-types.json +970 -137
  173. package/dist/composables/useCustomColors.test.d.ts +0 -1
  174. package/dist/composables/useFocusTrap.test.d.ts +0 -1
  175. package/dist/composables/usePortalContext.test.d.ts +0 -1
  176. package/dist/styles/mixins/fluidSize.test.d.ts +0 -1
  177. package/dist/types.d.ts +0 -29
@@ -2,19 +2,28 @@
2
2
  // Skeleton Component Styles
3
3
  //----------------------------------------------------------------------------------------------------------------------
4
4
 
5
- @use '@/styles/mixins/responsive' as *;
5
+ @use '../mixins' as *;
6
6
 
7
7
  //----------------------------------------------------------------------------------------------------------------------
8
- // Base Skeleton
8
+ // Skeleton Design Tokens
9
9
  //----------------------------------------------------------------------------------------------------------------------
10
10
 
11
- .sk-skeleton
11
+ .sk-skeleton,
12
+ sk-skeleton
12
13
  {
13
14
  // CSS Variables
14
15
  --sk-skeleton-base: oklch(from var(--sk-neutral-base) l c h / 0.12);
15
16
  --sk-skeleton-highlight: oklch(from var(--sk-neutral-base) calc(l * 1.3) c h / 0.25);
16
17
  --sk-skeleton-bevel: 0.35em;
18
+ }
17
19
 
20
+ //----------------------------------------------------------------------------------------------------------------------
21
+ // Base Skeleton
22
+ //----------------------------------------------------------------------------------------------------------------------
23
+
24
+ .sk-skeleton,
25
+ sk-skeleton
26
+ {
18
27
  position: relative;
19
28
  display: block;
20
29
  background: var(--sk-skeleton-base);
@@ -22,67 +31,71 @@
22
31
 
23
32
  // Default dimensions
24
33
  min-height: 1em;
34
+ }
25
35
 
26
- //------------------------------------------------------------------------------------------------------------------
27
- // Shape Variants
28
- //------------------------------------------------------------------------------------------------------------------
36
+ //----------------------------------------------------------------------------------------------------------------------
37
+ // Shape Modifiers
38
+ //----------------------------------------------------------------------------------------------------------------------
29
39
 
30
- // Text variant - beveled corners (top-left and bottom-right) for text lines
31
- &.sk-text
32
- {
33
- --sk-skeleton-bevel: 0.35em;
34
- height: 1em;
35
- min-width: 2em;
36
- clip-path: polygon(
37
- var(--sk-skeleton-bevel) 0,
38
- 100% 0,
39
- 100% calc(100% - var(--sk-skeleton-bevel)),
40
- calc(100% - var(--sk-skeleton-bevel)) 100%,
41
- 0 100%,
42
- 0 var(--sk-skeleton-bevel)
43
- );
44
- }
40
+ // Text variant beveled corners (top-left and bottom-right) for text lines
41
+ @include single-choice-modifier('skeleton', 'shape', 'text')
42
+ {
43
+ --sk-skeleton-bevel: 0.35em;
44
+ height: 1em;
45
+ min-width: 2em;
46
+ clip-path: polygon(
47
+ var(--sk-skeleton-bevel) 0,
48
+ 100% 0,
49
+ 100% calc(100% - var(--sk-skeleton-bevel)),
50
+ calc(100% - var(--sk-skeleton-bevel)) 100%,
51
+ 0 100%,
52
+ 0 var(--sk-skeleton-bevel)
53
+ );
54
+ }
45
55
 
46
- // Circular variant - perfect circle (avatar, icon placeholder)
47
- &.sk-circular
48
- {
49
- border-radius: 50%;
50
- aspect-ratio: 1;
51
- }
56
+ // Circular variant perfect circle (avatar, icon placeholder)
57
+ @include single-choice-modifier('skeleton', 'shape', 'circular')
58
+ {
59
+ border-radius: 50%;
60
+ aspect-ratio: 1;
61
+ }
52
62
 
53
- // Square variant - beveled top-left and bottom-right (avatar placeholder)
54
- &.sk-square
55
- {
56
- --sk-skeleton-bevel: var(--sk-radius-lg);
57
- aspect-ratio: 1;
58
- clip-path: polygon(
59
- var(--sk-skeleton-bevel) 0,
60
- 100% 0,
61
- 100% calc(100% - var(--sk-skeleton-bevel)),
62
- calc(100% - var(--sk-skeleton-bevel)) 100%,
63
- 0 100%,
64
- 0 var(--sk-skeleton-bevel)
65
- );
66
- }
63
+ // Square variant beveled top-left and bottom-right (avatar placeholder)
64
+ @include single-choice-modifier('skeleton', 'shape', 'square')
65
+ {
66
+ --sk-skeleton-bevel: var(--sk-radius-lg);
67
+ aspect-ratio: 1;
68
+ clip-path: polygon(
69
+ var(--sk-skeleton-bevel) 0,
70
+ 100% 0,
71
+ 100% calc(100% - var(--sk-skeleton-bevel)),
72
+ calc(100% - var(--sk-skeleton-bevel)) 100%,
73
+ 0 100%,
74
+ 0 var(--sk-skeleton-bevel)
75
+ );
76
+ }
67
77
 
68
- // Rectangular variant - beveled bottom-right corner only (card, image placeholder)
69
- &.sk-rectangular
70
- {
71
- --sk-skeleton-bevel: var(--sk-radius-lg);
72
- clip-path: polygon(
73
- 0 0,
74
- 100% 0,
75
- 100% calc(100% - var(--sk-skeleton-bevel)),
76
- calc(100% - var(--sk-skeleton-bevel)) 100%,
77
- 0 100%
78
- );
79
- }
78
+ // Rectangular variant beveled bottom-right corner only (card, image placeholder)
79
+ @include single-choice-modifier('skeleton', 'shape', 'rectangular')
80
+ {
81
+ --sk-skeleton-bevel: var(--sk-radius-lg);
82
+ clip-path: polygon(
83
+ 0 0,
84
+ 100% 0,
85
+ 100% calc(100% - var(--sk-skeleton-bevel)),
86
+ calc(100% - var(--sk-skeleton-bevel)) 100%,
87
+ 0 100%
88
+ );
89
+ }
80
90
 
81
- //------------------------------------------------------------------------------------------------------------------
82
- // Shimmer Animation
83
- //------------------------------------------------------------------------------------------------------------------
91
+ //----------------------------------------------------------------------------------------------------------------------
92
+ // Animation Modifiers
93
+ //----------------------------------------------------------------------------------------------------------------------
84
94
 
85
- &.sk-shimmer::after
95
+ // Shimmer animation — sweeping highlight from left to right
96
+ @include bool-modifier('skeleton', 'shimmer')
97
+ {
98
+ &::after
86
99
  {
87
100
  content: '';
88
101
  position: absolute;
@@ -95,15 +108,12 @@
95
108
  );
96
109
  animation: sk-skeleton-shimmer 1.5s ease-in-out infinite;
97
110
  }
111
+ }
98
112
 
99
- //------------------------------------------------------------------------------------------------------------------
100
- // Pulse Animation
101
- //------------------------------------------------------------------------------------------------------------------
102
-
103
- &.sk-pulse
104
- {
105
- animation: sk-skeleton-pulse 1.5s ease-in-out infinite;
106
- }
113
+ // Pulse animation — opacity fade in/out
114
+ @include bool-modifier('skeleton', 'pulse')
115
+ {
116
+ animation: sk-skeleton-pulse 1.5s ease-in-out infinite;
107
117
  }
108
118
 
109
119
  //----------------------------------------------------------------------------------------------------------------------
@@ -146,7 +156,9 @@
146
156
  @include reduced-motion
147
157
  {
148
158
  .sk-skeleton,
159
+ sk-skeleton,
149
160
  .sk-skeleton::after,
161
+ sk-skeleton::after,
150
162
  .sk-skeleton-shimmer::after
151
163
  {
152
164
  animation: none;
@@ -154,3 +166,37 @@
154
166
  }
155
167
 
156
168
  //----------------------------------------------------------------------------------------------------------------------
169
+ // Defaults When Absent
170
+ //----------------------------------------------------------------------------------------------------------------------
171
+
172
+ // Default shape: rectangular — fires when no sk-shape-* class is present.
173
+ @include defaults-when-absent('skeleton', 'sk-shape-')
174
+ {
175
+ --sk-skeleton-bevel: var(--sk-radius-lg);
176
+ clip-path: polygon(
177
+ 0 0,
178
+ 100% 0,
179
+ 100% calc(100% - var(--sk-skeleton-bevel)),
180
+ calc(100% - var(--sk-skeleton-bevel)) 100%,
181
+ 0 100%
182
+ );
183
+ }
184
+
185
+ //----------------------------------------------------------------------------------------------------------------------
186
+ // Custom-Element API Defaults (attribute-absence path)
187
+ //----------------------------------------------------------------------------------------------------------------------
188
+
189
+ // Default shape: rectangular — fires when <sk-skeleton> has no shape attribute.
190
+ @include defaults-when-no-attr('skeleton', 'shape')
191
+ {
192
+ --sk-skeleton-bevel: var(--sk-radius-lg);
193
+ clip-path: polygon(
194
+ 0 0,
195
+ 100% 0,
196
+ 100% calc(100% - var(--sk-skeleton-bevel)),
197
+ calc(100% - var(--sk-skeleton-bevel)) 100%,
198
+ 0 100%
199
+ );
200
+ }
201
+
202
+ //----------------------------------------------------------------------------------------------------------------------
@@ -2,11 +2,8 @@
2
2
  // Slider Component Styles
3
3
  //----------------------------------------------------------------------------------------------------------------------
4
4
 
5
- @use '@/styles/mixins/cut-border' as *;
6
-
7
- //----------------------------------------------------------------------------------------------------------------------
8
-
9
- $kinds: (neutral, primary, accent, info, success, warning, danger);
5
+ @use '../mixins/cut-border' as *;
6
+ @use '../theme/variables' as *;
10
7
 
11
8
  //----------------------------------------------------------------------------------------------------------------------
12
9
  // Kind Mixin
@@ -61,31 +58,43 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
61
58
  // Size Variants
62
59
  //------------------------------------------------------------------------------------------------------------------
63
60
 
64
- &.sk-xs
61
+ // Default: md when no sk-size-* class is present (zero-specificity, explicit class wins)
62
+ &:where(:not([class*="sk-size-"]))
63
+ {
64
+ --sk-slider-track-size: 0.75rem;
65
+ --sk-slider-thumb-size: 1.25rem;
66
+ }
67
+
68
+ &.sk-xs,
69
+ &.sk-size-xs
65
70
  {
66
71
  --sk-slider-track-size: 0.375rem;
67
72
  --sk-slider-thumb-size: 0.75rem;
68
73
  }
69
74
 
70
- &.sk-sm
75
+ &.sk-sm,
76
+ &.sk-size-sm
71
77
  {
72
78
  --sk-slider-track-size: 0.5rem;
73
79
  --sk-slider-thumb-size: 1rem;
74
80
  }
75
81
 
76
- &.sk-md
82
+ &.sk-md,
83
+ &.sk-size-md
77
84
  {
78
85
  --sk-slider-track-size: 0.75rem;
79
86
  --sk-slider-thumb-size: 1.25rem;
80
87
  }
81
88
 
82
- &.sk-lg
89
+ &.sk-lg,
90
+ &.sk-size-lg
83
91
  {
84
92
  --sk-slider-track-size: 1rem;
85
93
  --sk-slider-thumb-size: 1.5rem;
86
94
  }
87
95
 
88
- &.sk-xl
96
+ &.sk-xl,
97
+ &.sk-size-xl
89
98
  {
90
99
  --sk-slider-track-size: 1.25rem;
91
100
  --sk-slider-thumb-size: 1.75rem;
@@ -261,3 +270,18 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
261
270
  }
262
271
 
263
272
  //----------------------------------------------------------------------------------------------------------------------
273
+ // Defaults-when-absent: kind — primary when no explicit kind class is present.
274
+ //----------------------------------------------------------------------------------------------------------------------
275
+
276
+ $_slider-kind-not: '';
277
+ @each $kind in $kinds
278
+ {
279
+ $_slider-kind-not: $_slider-kind-not + ':not(.sk-' + $kind + ')';
280
+ }
281
+
282
+ .sk-slider:where(#{ $_slider-kind-not })
283
+ {
284
+ --sk-slider-color-base: var(--sk-primary-base);
285
+ }
286
+
287
+ //----------------------------------------------------------------------------------------------------------------------
@@ -2,81 +2,81 @@
2
2
  // Spinner Component Styles
3
3
  //----------------------------------------------------------------------------------------------------------------------
4
4
 
5
- @use '@/styles/mixins/responsive' as *;
6
-
7
- $kinds: (neutral, primary, accent, info, success, warning, danger);
5
+ @use '../theme/variables' as *;
6
+ @use '../mixins/dual-selector' as *;
7
+ @use '../mixins/responsive' as *;
8
8
 
9
9
  //----------------------------------------------------------------------------------------------------------------------
10
- // Kind Mixin
10
+ // Spinner Design Tokens
11
11
  //----------------------------------------------------------------------------------------------------------------------
12
12
 
13
- @mixin spinner-kind($kind)
13
+ .sk-spinner,
14
+ sk-spinner
14
15
  {
15
- &.sk-#{ '' + $kind }
16
- {
17
- --sk-spinner-color: var(--sk-#{ $kind }-base);
18
- }
16
+ // CSS Variables
17
+ --sk-spinner-color: var(--sk-primary-base);
18
+ --sk-spinner-size: 2rem;
19
+ --sk-spinner-border-width: var(--sk-border-width-normal);
19
20
  }
20
21
 
21
22
  //----------------------------------------------------------------------------------------------------------------------
22
23
  // Spinner Root
23
24
  //----------------------------------------------------------------------------------------------------------------------
24
25
 
25
- .sk-spinner
26
+ .sk-spinner,
27
+ sk-spinner
26
28
  {
27
- // CSS Variables
28
- --sk-spinner-color: var(--sk-primary-base);
29
- --sk-spinner-size: 2rem;
30
- --sk-spinner-border-width: var(--sk-border-width-normal);
31
-
32
29
  display: inline-flex;
33
30
  align-items: center;
34
31
  justify-content: center;
35
32
  width: var(--sk-spinner-size);
36
33
  height: var(--sk-spinner-size);
34
+ }
37
35
 
38
- //------------------------------------------------------------------------------------------------------------------
39
- // Size Variants
40
- //------------------------------------------------------------------------------------------------------------------
36
+ //----------------------------------------------------------------------------------------------------------------------
37
+ // Kind Variants
38
+ //----------------------------------------------------------------------------------------------------------------------
41
39
 
42
- &.sk-xs
40
+ @each $kind in $kinds
41
+ {
42
+ @include kind-variant('spinner', $kind)
43
43
  {
44
- --sk-spinner-size: 1rem;
45
- --sk-spinner-border-width: var(--sk-border-width-thin);
44
+ --sk-spinner-color: var(--sk-#{ $kind }-base);
46
45
  }
46
+ }
47
47
 
48
- &.sk-sm
49
- {
50
- --sk-spinner-size: 1.5rem;
51
- --sk-spinner-border-width: var(--sk-border-width-thin);
52
- }
48
+ //----------------------------------------------------------------------------------------------------------------------
49
+ // Size Variants
50
+ //----------------------------------------------------------------------------------------------------------------------
53
51
 
54
- &.sk-md
55
- {
56
- --sk-spinner-size: 2rem;
57
- --sk-spinner-border-width: var(--sk-border-width-normal);
58
- }
52
+ @include size-variant('spinner', 'xs')
53
+ {
54
+ --sk-spinner-size: 1rem;
55
+ --sk-spinner-border-width: var(--sk-border-width-thin);
56
+ }
59
57
 
60
- &.sk-lg
61
- {
62
- --sk-spinner-size: 2.5rem;
63
- --sk-spinner-border-width: var(--sk-border-width-normal);
64
- }
58
+ @include size-variant('spinner', 'sm')
59
+ {
60
+ --sk-spinner-size: 1.5rem;
61
+ --sk-spinner-border-width: var(--sk-border-width-thin);
62
+ }
65
63
 
66
- &.sk-xl
67
- {
68
- --sk-spinner-size: 3rem;
69
- --sk-spinner-border-width: var(--sk-border-width-thick);
70
- }
64
+ @include size-variant('spinner', 'md')
65
+ {
66
+ --sk-spinner-size: 2rem;
67
+ --sk-spinner-border-width: var(--sk-border-width-normal);
68
+ }
71
69
 
72
- //------------------------------------------------------------------------------------------------------------------
73
- // Kind Variants
74
- //------------------------------------------------------------------------------------------------------------------
70
+ @include size-variant('spinner', 'lg')
71
+ {
72
+ --sk-spinner-size: 2.5rem;
73
+ --sk-spinner-border-width: var(--sk-border-width-normal);
74
+ }
75
75
 
76
- @each $kind in $kinds
77
- {
78
- @include spinner-kind($kind);
79
- }
76
+ @include size-variant('spinner', 'xl')
77
+ {
78
+ --sk-spinner-size: 3rem;
79
+ --sk-spinner-border-width: var(--sk-border-width-thick);
80
80
  }
81
81
 
82
82
  //----------------------------------------------------------------------------------------------------------------------
@@ -287,7 +287,8 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
287
287
  // Folding Variant - Expanding Orbit
288
288
  //----------------------------------------------------------------------------------------------------------------------
289
289
 
290
- .sk-crosshair-loader {
290
+ .sk-crosshair-loader
291
+ {
291
292
  width: var(--sk-spinner-size);
292
293
  aspect-ratio: 1;
293
294
  color: var(--sk-spinner-color);
@@ -295,7 +296,8 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
295
296
  background: radial-gradient(calc(var(--sk-spinner-size) * 0.25), currentColor 94%, #0000);
296
297
  }
297
298
 
298
- .sk-crosshair-loader:before {
299
+ .sk-crosshair-loader::before
300
+ {
299
301
  content: '';
300
302
  position: absolute;
301
303
  inset: 0;
@@ -309,21 +311,29 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
309
311
  animation: l18 1.5s infinite cubic-bezier(0.3, 1, 0, 1);
310
312
  }
311
313
 
312
- @keyframes l18 {
313
- 0% {
314
+ @keyframes l18
315
+ {
316
+ 0%
317
+ {
314
318
  opacity: 0.3;
315
319
  }
316
- 33% {
320
+
321
+ 33%
322
+ {
317
323
  inset: calc(var(--sk-spinner-size) * -0.25);
318
324
  transform: rotate(0deg);
319
325
  opacity: 1;
320
326
  }
321
- 66% {
327
+
328
+ 66%
329
+ {
322
330
  inset: calc(var(--sk-spinner-size) * -0.25);
323
331
  transform: rotate(90deg);
324
332
  opacity: 1;
325
333
  }
326
- 100% {
334
+
335
+ 100%
336
+ {
327
337
  inset: 0;
328
338
  transform: rotate(90deg);
329
339
  opacity: 0.3;
@@ -337,10 +347,51 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
337
347
 
338
348
  @include reduced-motion
339
349
  {
340
- .sk-spinner *
350
+ .sk-spinner *,
351
+ sk-spinner *
341
352
  {
342
353
  animation-duration: 8s !important;
343
354
  }
344
355
  }
345
356
 
346
357
  //----------------------------------------------------------------------------------------------------------------------
358
+ // Defaults When Absent
359
+ //----------------------------------------------------------------------------------------------------------------------
360
+
361
+ // Default size: md — fires when no sk-size-* class is present.
362
+ @include defaults-when-absent('spinner', 'sk-size-')
363
+ {
364
+ --sk-spinner-size: 2rem;
365
+ --sk-spinner-border-width: var(--sk-border-width-normal);
366
+ }
367
+
368
+ // Default kind: primary — explicit :not() chain for zero-specificity default.
369
+ $_spinner-kind-not: '';
370
+ @each $kind in $kinds
371
+ {
372
+ $_spinner-kind-not: $_spinner-kind-not + ':not(.sk-' + $kind + ')';
373
+ }
374
+
375
+ .sk-spinner:where(#{ $_spinner-kind-not })
376
+ {
377
+ --sk-spinner-color: var(--sk-primary-base);
378
+ }
379
+
380
+ //----------------------------------------------------------------------------------------------------------------------
381
+ // Custom-Element API Defaults (attribute-absence path)
382
+ //----------------------------------------------------------------------------------------------------------------------
383
+
384
+ // Default kind: primary — fires when <sk-spinner> has no kind attribute.
385
+ @include defaults-when-no-attr('spinner', 'kind')
386
+ {
387
+ --sk-spinner-color: var(--sk-primary-base);
388
+ }
389
+
390
+ // Default size: md — fires when <sk-spinner> has no size attribute.
391
+ @include defaults-when-no-attr('spinner', 'size')
392
+ {
393
+ --sk-spinner-size: 2rem;
394
+ --sk-spinner-border-width: var(--sk-border-width-normal);
395
+ }
396
+
397
+ //----------------------------------------------------------------------------------------------------------------------
@@ -85,6 +85,25 @@
85
85
  --sk-switch-track-border-color: var(--sk-switch-color-base);
86
86
  }
87
87
 
88
+ //----------------------------------------------------------------------------------------------------------------------
89
+ // Defaults-when-absent: kind — primary when no explicit kind class is present.
90
+ //----------------------------------------------------------------------------------------------------------------------
91
+
92
+ $_switch-kind-not: '';
93
+ @each $kind in $kinds
94
+ {
95
+ $_switch-kind-not: $_switch-kind-not + ':not(.sk-' + $kind + ')';
96
+ }
97
+
98
+ .sk-switch:where(#{ $_switch-kind-not })
99
+ {
100
+ --sk-switch-color-base: var(--sk-primary-base);
101
+ --sk-switch-fg: var(--sk-primary-text);
102
+ --sk-switch-track-border-color: var(--sk-primary-base);
103
+ --sk-switch-thumb-color: color-mix(in oklch, var(--sk-primary-base), black 20%);
104
+ --sk-switch-thumb-border-color: color-mix(in oklch, var(--sk-primary-base), black 20%);
105
+ }
106
+
88
107
  //----------------------------------------------------------------------------------------------------------------------
89
108
  // Switch Wrapper (contains switch + label)
90
109
  //----------------------------------------------------------------------------------------------------------------------
@@ -114,6 +133,13 @@
114
133
 
115
134
  .sk-switch
116
135
  {
136
+ // Default: md when no sk-size-* class is present (zero-specificity, explicit class wins)
137
+ &:where(:not([class*="sk-size-"]))
138
+ {
139
+ // md is the default; .sk-switch-wrapper:has(.sk-switch:not(.sk-size-*)) will use md tokens
140
+ --sk-switch-size: md;
141
+ }
142
+
117
143
  position: relative;
118
144
  width: var(--sk-switch-track-width);
119
145
  height: var(--sk-switch-track-height);
@@ -277,35 +303,40 @@
277
303
 
278
304
  .sk-switch-wrapper
279
305
  {
280
- &:has(.sk-switch.sk-xs)
306
+ &:has(.sk-switch.sk-xs),
307
+ &:has(.sk-switch.sk-size-xs)
281
308
  {
282
309
  --sk-switch-track-width: 24px;
283
310
  --sk-switch-track-height: 14px;
284
311
  --sk-switch-thumb-size: 8px;
285
312
  }
286
313
 
287
- &:has(.sk-switch.sk-sm)
314
+ &:has(.sk-switch.sk-sm),
315
+ &:has(.sk-switch.sk-size-sm)
288
316
  {
289
317
  --sk-switch-track-width: 28px;
290
318
  --sk-switch-track-height: 16px;
291
319
  --sk-switch-thumb-size: 8px;
292
320
  }
293
321
 
294
- &:has(.sk-switch.sk-md)
322
+ &:has(.sk-switch.sk-md),
323
+ &:has(.sk-switch.sk-size-md)
295
324
  {
296
325
  --sk-switch-track-width: 36px;
297
326
  --sk-switch-track-height: 20px;
298
327
  --sk-switch-thumb-size: 12px;
299
328
  }
300
329
 
301
- &:has(.sk-switch.sk-lg)
330
+ &:has(.sk-switch.sk-lg),
331
+ &:has(.sk-switch.sk-size-lg)
302
332
  {
303
333
  --sk-switch-track-width: 44px;
304
334
  --sk-switch-track-height: 24px;
305
335
  --sk-switch-thumb-size: 16px;
306
336
  }
307
337
 
308
- &:has(.sk-switch.sk-xl)
338
+ &:has(.sk-switch.sk-xl),
339
+ &:has(.sk-switch.sk-size-xl)
309
340
  {
310
341
  --sk-switch-track-width: 52px;
311
342
  --sk-switch-track-height: 28px;