@skewedaspect/sleekspace-ui 0.8.1 → 0.9.1

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 (191) 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/NumberInput/SkNumberInput.vue.d.ts +8 -0
  7. package/dist/components/Page/SkPage.vue.d.ts +9 -0
  8. package/dist/components/ScrollArea/SkScrollArea.vue.d.ts +105 -4
  9. package/dist/composables/useCustomColors.d.ts +18 -56
  10. package/{src → dist}/global.d.ts +6 -2
  11. package/dist/sleekspace-ui.css +4257 -1253
  12. package/dist/sleekspace-ui.es.js +300 -170
  13. package/dist/sleekspace-ui.umd.js +299 -169
  14. package/dist/static/classes.d.ts +18 -0
  15. package/dist/static/components/alert.d.ts +12 -0
  16. package/dist/static/components/avatar.d.ts +9 -0
  17. package/dist/static/components/breadcrumbs.d.ts +6 -0
  18. package/dist/static/components/button.d.ts +13 -0
  19. package/dist/static/components/card.d.ts +5 -0
  20. package/dist/static/components/checkbox.d.ts +10 -0
  21. package/dist/static/components/colorPicker.d.ts +8 -0
  22. package/dist/static/components/divider.d.ts +8 -0
  23. package/dist/static/components/dropdown.d.ts +8 -0
  24. package/dist/static/components/field.d.ts +15 -0
  25. package/dist/static/components/group.d.ts +5 -0
  26. package/dist/static/components/input.d.ts +14 -0
  27. package/dist/static/components/navBar.d.ts +16 -0
  28. package/dist/static/components/numberInput.d.ts +15 -0
  29. package/dist/static/components/page.d.ts +9 -0
  30. package/dist/static/components/pagination.d.ts +5 -0
  31. package/dist/static/components/panel.d.ts +11 -0
  32. package/dist/static/components/progress.d.ts +9 -0
  33. package/dist/static/components/radio.d.ts +11 -0
  34. package/dist/static/components/select.d.ts +10 -0
  35. package/dist/static/components/sidebar.d.ts +9 -0
  36. package/dist/static/components/skeleton.d.ts +11 -0
  37. package/dist/static/components/slider.d.ts +12 -0
  38. package/dist/static/components/spinner.d.ts +12 -0
  39. package/dist/static/components/switchInput.d.ts +10 -0
  40. package/dist/static/components/table.d.ts +12 -0
  41. package/dist/static/components/tag.d.ts +8 -0
  42. package/dist/static/components/tagsInput.d.ts +7 -0
  43. package/dist/static/components/textarea.d.ts +12 -0
  44. package/dist/static/components/toolbar.d.ts +12 -0
  45. package/dist/static/components/tooltip.d.ts +7 -0
  46. package/dist/static/escape.d.ts +2 -0
  47. package/dist/static/index.cjs.js +1 -0
  48. package/dist/static/index.d.ts +68 -0
  49. package/dist/static/index.es.js +732 -0
  50. package/dist/static/render.d.ts +12 -0
  51. package/dist/static/specs.d.ts +2 -0
  52. package/dist/static/types.d.ts +43 -0
  53. package/dist/tokens.css +322 -0
  54. package/dist/types/index.d.ts +36 -0
  55. package/dist/utils/slots.d.ts +6 -0
  56. package/docs/guides/installation.md +8 -2
  57. package/docs/guides/pure-css/_meta.yaml +8 -0
  58. package/docs/guides/pure-css/class-api.md +1070 -0
  59. package/docs/guides/pure-css/custom-elements.md +574 -0
  60. package/docs/guides/pure-css/index.md +86 -0
  61. package/docs/guides/pure-css/limitations.md +152 -0
  62. package/docs/guides/pure-css/static-helpers.md +1203 -0
  63. package/llms-full.txt +3739 -261
  64. package/package.json +19 -5
  65. package/src/components/Alert/SkAlert.vue +4 -2
  66. package/src/components/Breadcrumbs/SkBreadcrumbs.vue +6 -12
  67. package/src/components/Button/SkButton.vue +8 -5
  68. package/src/components/Card/SkCard.vue +13 -5
  69. package/src/components/Checkbox/SkCheckbox.vue +9 -2
  70. package/src/components/ContextMenu/SkContextMenuRadioGroup.vue +4 -1
  71. package/src/components/Dropdown/SkDropdown.vue +20 -3
  72. package/src/components/Dropdown/SkDropdownRadioGroup.vue +4 -1
  73. package/src/components/Dropdown/types.ts +2 -1
  74. package/src/components/Modal/SkModal.vue +11 -4
  75. package/src/components/NavBar/SkNavBar.vue +19 -8
  76. package/src/components/NavBar/context.ts +4 -2
  77. package/src/components/NavBar/types.ts +6 -1
  78. package/src/components/NumberInput/SkNumberInput.vue +10 -1
  79. package/src/components/Page/SkPage.vue +29 -15
  80. package/src/components/Panel/SkPanel.vue +2 -1
  81. package/src/components/Popover/SkPopover.vue +11 -4
  82. package/src/components/Radio/SkRadio.vue +9 -2
  83. package/src/components/ScrollArea/SkScrollArea.vue +78 -5
  84. package/src/components/Switch/SkSwitch.vue +14 -13
  85. package/src/components/Tabs/SkTab.vue +7 -2
  86. package/src/components/TreeView/SkTreeItem.vue +10 -2
  87. package/src/components/TreeView/SkTreeView.vue +7 -2
  88. package/src/composables/useCustomColors.ts +86 -77
  89. package/src/composables/usePortalContext.test.ts +0 -2
  90. package/src/shims.d.ts +10 -0
  91. package/src/static/__tests__/parity.test.ts +717 -0
  92. package/src/static/__tests__/parityHarness.test.ts +98 -0
  93. package/src/static/__tests__/parityHarness.ts +260 -0
  94. package/src/static/classes.test.ts +82 -0
  95. package/src/static/classes.ts +111 -0
  96. package/src/static/components/__tests__/helpers.test.ts +837 -0
  97. package/src/static/components/alert.ts +117 -0
  98. package/src/static/components/avatar.ts +86 -0
  99. package/src/static/components/breadcrumbs.ts +28 -0
  100. package/src/static/components/button.ts +75 -0
  101. package/src/static/components/card.ts +27 -0
  102. package/src/static/components/checkbox.ts +48 -0
  103. package/src/static/components/colorPicker.ts +45 -0
  104. package/src/static/components/divider.ts +39 -0
  105. package/src/static/components/dropdown.ts +36 -0
  106. package/src/static/components/field.ts +86 -0
  107. package/src/static/components/group.ts +27 -0
  108. package/src/static/components/input.ts +55 -0
  109. package/src/static/components/navBar.ts +94 -0
  110. package/src/static/components/numberInput.ts +64 -0
  111. package/src/static/components/page.ts +31 -0
  112. package/src/static/components/pagination.ts +27 -0
  113. package/src/static/components/panel.ts +33 -0
  114. package/src/static/components/progress.ts +31 -0
  115. package/src/static/components/radio.ts +53 -0
  116. package/src/static/components/select.ts +51 -0
  117. package/src/static/components/sidebar.ts +85 -0
  118. package/src/static/components/skeleton.ts +66 -0
  119. package/src/static/components/slider.ts +50 -0
  120. package/src/static/components/spinner.ts +94 -0
  121. package/src/static/components/switchInput.ts +49 -0
  122. package/src/static/components/table.ts +88 -0
  123. package/src/static/components/tag.ts +76 -0
  124. package/src/static/components/tagsInput.ts +35 -0
  125. package/src/static/components/textarea.ts +53 -0
  126. package/src/static/components/toolbar.ts +74 -0
  127. package/src/static/components/tooltip.ts +29 -0
  128. package/src/static/escape.test.ts +53 -0
  129. package/src/static/escape.ts +28 -0
  130. package/src/static/generated/defaults.ts +379 -0
  131. package/src/static/generated/propTypes.ts +426 -0
  132. package/src/static/index.ts +116 -0
  133. package/src/static/render.test.ts +83 -0
  134. package/src/static/render.ts +76 -0
  135. package/src/static/specs.test.ts +58 -0
  136. package/src/static/specs.ts +230 -0
  137. package/src/static/types.ts +176 -0
  138. package/src/styles/__tests__/testHelpers.ts +97 -0
  139. package/src/styles/base/_custom-elements.scss +51 -0
  140. package/src/styles/base/_index.scss +4 -0
  141. package/src/styles/components/__tests__/componentSelectors.test.ts +2575 -0
  142. package/src/styles/components/_alert.scss +82 -39
  143. package/src/styles/components/_avatar.scss +102 -47
  144. package/src/styles/components/_breadcrumbs.scss +39 -37
  145. package/src/styles/components/_button.scss +58 -5
  146. package/src/styles/components/_card.scss +64 -2
  147. package/src/styles/components/_checkbox.scss +35 -5
  148. package/src/styles/components/_color-picker.scss +48 -13
  149. package/src/styles/components/_divider.scss +86 -52
  150. package/src/styles/components/_dropdown.scss +214 -0
  151. package/src/styles/components/_field.scss +76 -23
  152. package/src/styles/components/_group.scss +190 -79
  153. package/src/styles/components/_index.scss +1 -0
  154. package/src/styles/components/_input.scss +81 -5
  155. package/src/styles/components/_menu.scss +1 -1
  156. package/src/styles/components/_navbar.scss +76 -45
  157. package/src/styles/components/_number-input.scss +98 -85
  158. package/src/styles/components/_page.scss +82 -23
  159. package/src/styles/components/_pagination.scss +240 -212
  160. package/src/styles/components/_panel.scss +268 -122
  161. package/src/styles/components/_progress.scss +120 -70
  162. package/src/styles/components/_radio.scss +35 -5
  163. package/src/styles/components/_scroll-area.scss +50 -22
  164. package/src/styles/components/_select.scss +40 -9
  165. package/src/styles/components/_sidebar.scss +59 -34
  166. package/src/styles/components/_skeleton.scss +111 -65
  167. package/src/styles/components/_slider.scss +34 -10
  168. package/src/styles/components/_spinner.scss +107 -56
  169. package/src/styles/components/_switch.scss +36 -5
  170. package/src/styles/components/_table.scss +150 -166
  171. package/src/styles/components/_tag.scss +244 -154
  172. package/src/styles/components/_tags-input.scss +46 -12
  173. package/src/styles/components/_textarea.scss +36 -5
  174. package/src/styles/components/_toolbar.scss +85 -31
  175. package/src/styles/components/_tooltip.scss +172 -3
  176. package/src/styles/mixins/_cut-border.scss +18 -4
  177. package/src/styles/mixins/_dual-selector.scss +192 -0
  178. package/src/styles/mixins/_index.scss +1 -0
  179. package/src/styles/mixins/dualSelector.test.ts +151 -0
  180. package/src/styles/themes/_colorful.scss +25 -0
  181. package/src/styles/themes/_greyscale.scss +25 -0
  182. package/src/styles/themes/_shade-scale.scss +39 -0
  183. package/src/styles/tokens/_semantic-color-kinds.scss +66 -0
  184. package/src/{types.ts → types/index.ts} +19 -11
  185. package/src/utils/slots.ts +75 -0
  186. package/web-types.json +980 -137
  187. package/dist/composables/useCustomColors.test.d.ts +0 -1
  188. package/dist/composables/useFocusTrap.test.d.ts +0 -1
  189. package/dist/composables/usePortalContext.test.d.ts +0 -1
  190. package/dist/styles/mixins/fluidSize.test.d.ts +0 -1
  191. package/dist/types.d.ts +0 -29
@@ -2,30 +2,17 @@
2
2
  // Progress Component Styles
3
3
  //----------------------------------------------------------------------------------------------------------------------
4
4
 
5
- @use '@/styles/mixins/cut-border' as *;
6
- @use '@/styles/mixins/responsive' as *;
5
+ @use '../theme/variables' as *;
6
+ @use '../mixins/cut-border' as *;
7
+ @use '../mixins/dual-selector' as *;
8
+ @use '../mixins/responsive' as *;
7
9
 
8
10
  //----------------------------------------------------------------------------------------------------------------------
9
-
10
- $kinds: (neutral, primary, accent, info, success, warning, danger);
11
-
12
- //----------------------------------------------------------------------------------------------------------------------
13
- // Kind Mixin
11
+ // Progress Design Tokens
14
12
  //----------------------------------------------------------------------------------------------------------------------
15
13
 
16
- @mixin progress-kind($kind)
17
- {
18
- &.sk-#{ '' + $kind }
19
- {
20
- --sk-progress-color-base: var(--sk-#{ $kind }-base);
21
- }
22
- }
23
-
24
- //----------------------------------------------------------------------------------------------------------------------
25
- // Progress Root (Track)
26
- //----------------------------------------------------------------------------------------------------------------------
27
-
28
- .sk-progress
14
+ .sk-progress,
15
+ sk-progress
29
16
  {
30
17
  // CSS Variables
31
18
  --sk-progress-color-base: var(--sk-primary-base);
@@ -33,7 +20,15 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
33
20
  --sk-progress-height: 1rem;
34
21
  --sk-progress-bevel: calc(var(--sk-progress-height) * 0.6);
35
22
  --sk-progress-slant: calc(var(--sk-progress-height) * 1.5);
23
+ }
24
+
25
+ //----------------------------------------------------------------------------------------------------------------------
26
+ // Progress Root (Track)
27
+ //----------------------------------------------------------------------------------------------------------------------
36
28
 
29
+ .sk-progress,
30
+ sk-progress
31
+ {
37
32
  position: relative;
38
33
  display: flex;
39
34
  align-items: center;
@@ -51,65 +46,70 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
51
46
  oklch(from var(--sk-progress-color-base) l c h / 0.3),
52
47
  (top-left bottom-right)
53
48
  );
49
+ }
54
50
 
55
- //------------------------------------------------------------------------------------------------------------------
56
- // Size Variants
57
- //------------------------------------------------------------------------------------------------------------------
51
+ //----------------------------------------------------------------------------------------------------------------------
52
+ // Kind Variants
53
+ //----------------------------------------------------------------------------------------------------------------------
58
54
 
59
- // Extra small: full parallelogram slant
60
- &.sk-xs
55
+ @each $kind in $kinds
56
+ {
57
+ @include kind-variant('progress', $kind)
61
58
  {
62
- --sk-progress-height: 0.5rem;
63
-
64
- // Override cut-border with full slant parallelogram
65
- border: none;
66
- clip-path: polygon(
67
- var(--sk-progress-slant) 0,
68
- 100% 0,
69
- calc(100% - var(--sk-progress-slant)) 100%,
70
- 0 100%
71
- );
72
-
73
- &::before
74
- {
75
- display: none;
76
- }
59
+ --sk-progress-color-base: var(--sk-#{ $kind }-base);
77
60
  }
61
+ }
78
62
 
79
- &.sk-sm
80
- {
81
- --sk-progress-height: 0.75rem;
82
- }
63
+ //----------------------------------------------------------------------------------------------------------------------
64
+ // Size Variants
65
+ //----------------------------------------------------------------------------------------------------------------------
83
66
 
84
- &.sk-md
85
- {
86
- --sk-progress-height: 1rem;
87
- }
67
+ @include size-variant('progress', 'xs')
68
+ {
69
+ --sk-progress-height: 0.5rem;
70
+
71
+ // Override cut-border with full slant parallelogram
72
+ border: none;
73
+ clip-path: polygon(
74
+ var(--sk-progress-slant) 0,
75
+ 100% 0,
76
+ calc(100% - var(--sk-progress-slant)) 100%,
77
+ 0 100%
78
+ );
88
79
 
89
- &.sk-lg
80
+ &::before
90
81
  {
91
- --sk-progress-height: 1.25rem;
82
+ display: none;
92
83
  }
84
+ }
93
85
 
94
- &.sk-xl
95
- {
96
- --sk-progress-height: 1.5rem;
97
- }
86
+ @include size-variant('progress', 'sm')
87
+ {
88
+ --sk-progress-height: 0.75rem;
89
+ }
98
90
 
99
- //------------------------------------------------------------------------------------------------------------------
100
- // Kind Variants
101
- //------------------------------------------------------------------------------------------------------------------
91
+ @include size-variant('progress', 'md')
92
+ {
93
+ --sk-progress-height: 1rem;
94
+ }
102
95
 
103
- @each $kind in $kinds
104
- {
105
- @include progress-kind($kind);
106
- }
96
+ @include size-variant('progress', 'lg')
97
+ {
98
+ --sk-progress-height: 1.25rem;
99
+ }
100
+
101
+ @include size-variant('progress', 'xl')
102
+ {
103
+ --sk-progress-height: 1.5rem;
104
+ }
107
105
 
108
- //------------------------------------------------------------------------------------------------------------------
109
- // Indeterminate State
110
- //------------------------------------------------------------------------------------------------------------------
106
+ //----------------------------------------------------------------------------------------------------------------------
107
+ // Indeterminate State
108
+ //----------------------------------------------------------------------------------------------------------------------
111
109
 
112
- &.sk-indeterminate .sk-progress-indicator
110
+ @include bool-modifier('progress', 'indeterminate')
111
+ {
112
+ .sk-progress-indicator
113
113
  {
114
114
  width: 25%;
115
115
  animation: sk-progress-indeterminate 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
@@ -187,7 +187,9 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
187
187
  }
188
188
 
189
189
  // Extra small size: slanted right edge to match parallelogram
190
- .sk-xs &
190
+ .sk-xs &,
191
+ .sk-size-xs &,
192
+ sk-progress[size="xs"] &
191
193
  {
192
194
  clip-path: polygon(
193
195
  0 0,
@@ -239,23 +241,33 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
239
241
 
240
242
  // Hide on extra small and small sizes (too small for readable text)
241
243
  .sk-xs &,
242
- .sk-sm &
244
+ .sk-size-xs &,
245
+ sk-progress[size="xs"] &,
246
+ .sk-sm &,
247
+ .sk-size-sm &,
248
+ sk-progress[size="sm"] &
243
249
  {
244
250
  display: none;
245
251
  }
246
252
 
247
253
  // Scale font size with progress bar size
248
- .sk-md &
254
+ .sk-md &,
255
+ .sk-size-md &,
256
+ sk-progress[size="md"] &
249
257
  {
250
258
  font-size: 0.75rem;
251
259
  }
252
260
 
253
- .sk-lg &
261
+ .sk-lg &,
262
+ .sk-size-lg &,
263
+ sk-progress[size="lg"] &
254
264
  {
255
265
  font-size: 0.875rem;
256
266
  }
257
267
 
258
- .sk-xl &
268
+ .sk-xl &,
269
+ .sk-size-xl &,
270
+ sk-progress[size="xl"] &
259
271
  {
260
272
  font-size: 1rem;
261
273
  }
@@ -292,3 +304,41 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
292
304
  }
293
305
 
294
306
  //----------------------------------------------------------------------------------------------------------------------
307
+ // Defaults When Absent
308
+ //----------------------------------------------------------------------------------------------------------------------
309
+
310
+ // Default size: md — fires when no sk-size-* class is present.
311
+ @include defaults-when-absent('progress', 'sk-size-')
312
+ {
313
+ --sk-progress-height: 1rem;
314
+ }
315
+
316
+ // Default kind: primary — explicit :not() chain for zero-specificity default.
317
+ $_progress-kind-not: '';
318
+ @each $kind in $kinds
319
+ {
320
+ $_progress-kind-not: $_progress-kind-not + ':not(.sk-' + $kind + ')';
321
+ }
322
+
323
+ .sk-progress:where(#{ $_progress-kind-not })
324
+ {
325
+ --sk-progress-color-base: var(--sk-primary-base);
326
+ }
327
+
328
+ //----------------------------------------------------------------------------------------------------------------------
329
+ // Custom-Element API Defaults (attribute-absence path)
330
+ //----------------------------------------------------------------------------------------------------------------------
331
+
332
+ // Default kind: primary — fires when <sk-progress> has no kind attribute.
333
+ @include defaults-when-no-attr('progress', 'kind')
334
+ {
335
+ --sk-progress-color-base: var(--sk-primary-base);
336
+ }
337
+
338
+ // Default size: md — fires when <sk-progress> has no size attribute.
339
+ @include defaults-when-no-attr('progress', 'size')
340
+ {
341
+ --sk-progress-height: 1rem;
342
+ }
343
+
344
+ //----------------------------------------------------------------------------------------------------------------------
@@ -1,4 +1,5 @@
1
- @use '@/styles/mixins' as *;
1
+ @use '../mixins' as *;
2
+ @use '../theme/variables' as *;
2
3
 
3
4
  //----------------------------------------------------------------------------------------------------------------------
4
5
  // Radio Component Styles
@@ -87,28 +88,41 @@
87
88
  transition-duration: var(--sk-transition-duration-base);
88
89
 
89
90
  // Size variants
90
- &.sk-sm
91
+
92
+ // Default: md when no sk-size-* class is present (zero-specificity, explicit class wins)
93
+ &:where(:not([class*="sk-size-"]))
94
+ {
95
+ width: 1.25rem;
96
+ height: 1.25rem;
97
+ --sk-radio-cut: 0.3rem;
98
+ }
99
+
100
+ &.sk-sm,
101
+ &.sk-size-sm
91
102
  {
92
103
  width: 1rem;
93
104
  height: 1rem;
94
105
  --sk-radio-cut: 0.24rem;
95
106
  }
96
107
 
97
- &.sk-md
108
+ &.sk-md,
109
+ &.sk-size-md
98
110
  {
99
111
  width: 1.25rem;
100
112
  height: 1.25rem;
101
113
  --sk-radio-cut: 0.3rem;
102
114
  }
103
115
 
104
- &.sk-lg
116
+ &.sk-lg,
117
+ &.sk-size-lg
105
118
  {
106
119
  width: 1.5rem;
107
120
  height: 1.5rem;
108
121
  --sk-radio-cut: 0.36rem;
109
122
  }
110
123
 
111
- &.sk-xl
124
+ &.sk-xl,
125
+ &.sk-size-xl
112
126
  {
113
127
  width: 1.75rem;
114
128
  height: 1.75rem;
@@ -260,3 +274,19 @@
260
274
  }
261
275
 
262
276
  //----------------------------------------------------------------------------------------------------------------------
277
+ // Defaults-when-absent: kind — neutral when no explicit kind class is present.
278
+ //----------------------------------------------------------------------------------------------------------------------
279
+
280
+ $_radio-kind-not: '';
281
+ @each $kind in $kinds
282
+ {
283
+ $_radio-kind-not: $_radio-kind-not + ':not(.sk-' + $kind + ')';
284
+ }
285
+
286
+ .sk-radio:where(#{ $_radio-kind-not })
287
+ {
288
+ --sk-radio-color-base: var(--sk-neutral-base);
289
+ --sk-radio-fg: var(--sk-neutral-text);
290
+ }
291
+
292
+ //----------------------------------------------------------------------------------------------------------------------
@@ -26,7 +26,7 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
26
26
  --sk-scroll-area-thumb-color: var(--sk-scroll-area-color-base);
27
27
  --sk-scroll-area-track-color: oklch(from var(--sk-neutral-base) l c h / 0.08);
28
28
  --sk-scroll-area-size: 0.5rem;
29
- --sk-scroll-area-fade: 1.5rem;
29
+ --sk-scroll-area-fade: 1rem;
30
30
 
31
31
  position: relative;
32
32
  overflow: hidden;
@@ -40,21 +40,33 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
40
40
  //----------------------------------------------------------------------------------------------------------------------
41
41
  // Edge fade
42
42
  //
43
- // Applied to the viewport via CSS mask-image so the content visibly tapers at the edges where
44
- // scrolling is possible. Always-on (not scroll-position aware) -- keeps the pattern pure-CSS
45
- // and avoids layout shift. Width is tunable via `--sk-scroll-area-fade`.
43
+ // Applied to the viewport via CSS mask-image so content visibly tapers at the edges where more
44
+ // scrolling is possible. The component sets `--sk-scroll-fade-{top|bottom|left|right}` (0 or 1)
45
+ // based on scroll position, collapsing the fade zone at edges you can't scroll past. Gradient
46
+ // uses smoothstep-ish stops for a gentler fall-off. Distance is tunable via `--sk-scroll-area-fade`.
46
47
  //----------------------------------------------------------------------------------------------------------------------
47
48
 
48
49
  .sk-scroll-area.sk-fade
49
50
  {
51
+ --sk-scroll-fade-top: 0;
52
+ --sk-scroll-fade-bottom: 0;
53
+ --sk-scroll-fade-left: 0;
54
+ --sk-scroll-fade-right: 0;
55
+
50
56
  &.sk-vertical .sk-scroll-area-viewport
51
57
  {
52
58
  mask-image: linear-gradient(
53
59
  to bottom,
54
- transparent 0,
55
- black var(--sk-scroll-area-fade),
56
- black calc(100% - var(--sk-scroll-area-fade)),
57
- transparent 100%
60
+ rgb(0 0 0 / 0) 0,
61
+ rgb(0 0 0 / 0.15) calc(var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-top)),
62
+ rgb(0 0 0 / 0.5) calc(var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-top)),
63
+ rgb(0 0 0 / 0.85) calc(var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-top)),
64
+ rgb(0 0 0 / 1) calc(var(--sk-scroll-area-fade) * var(--sk-scroll-fade-top)),
65
+ rgb(0 0 0 / 1) calc(100% - var(--sk-scroll-area-fade) * var(--sk-scroll-fade-bottom)),
66
+ rgb(0 0 0 / 0.85) calc(100% - var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-bottom)),
67
+ rgb(0 0 0 / 0.5) calc(100% - var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-bottom)),
68
+ rgb(0 0 0 / 0.15) calc(100% - var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-bottom)),
69
+ rgb(0 0 0 / 0) 100%
58
70
  );
59
71
  }
60
72
 
@@ -62,31 +74,47 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
62
74
  {
63
75
  mask-image: linear-gradient(
64
76
  to right,
65
- transparent 0,
66
- black var(--sk-scroll-area-fade),
67
- black calc(100% - var(--sk-scroll-area-fade)),
68
- transparent 100%
77
+ rgb(0 0 0 / 0) 0,
78
+ rgb(0 0 0 / 0.15) calc(var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-left)),
79
+ rgb(0 0 0 / 0.5) calc(var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-left)),
80
+ rgb(0 0 0 / 0.85) calc(var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-left)),
81
+ rgb(0 0 0 / 1) calc(var(--sk-scroll-area-fade) * var(--sk-scroll-fade-left)),
82
+ rgb(0 0 0 / 1) calc(100% - var(--sk-scroll-area-fade) * var(--sk-scroll-fade-right)),
83
+ rgb(0 0 0 / 0.85) calc(100% - var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-right)),
84
+ rgb(0 0 0 / 0.5) calc(100% - var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-right)),
85
+ rgb(0 0 0 / 0.15) calc(100% - var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-right)),
86
+ rgb(0 0 0 / 0) 100%
69
87
  );
70
88
  }
71
89
 
72
90
  &.sk-both .sk-scroll-area-viewport
73
91
  {
74
- // Two masks composited with `intersect` so only the center (opaque on both axes) is
75
- // fully opaque; the remaining three edges fade.
76
92
  mask-image:
77
93
  linear-gradient(
78
94
  to bottom,
79
- transparent 0,
80
- black var(--sk-scroll-area-fade),
81
- black calc(100% - var(--sk-scroll-area-fade)),
82
- transparent 100%
95
+ rgb(0 0 0 / 0) 0,
96
+ rgb(0 0 0 / 0.15) calc(var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-top)),
97
+ rgb(0 0 0 / 0.5) calc(var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-top)),
98
+ rgb(0 0 0 / 0.85) calc(var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-top)),
99
+ rgb(0 0 0 / 1) calc(var(--sk-scroll-area-fade) * var(--sk-scroll-fade-top)),
100
+ rgb(0 0 0 / 1) calc(100% - var(--sk-scroll-area-fade) * var(--sk-scroll-fade-bottom)),
101
+ rgb(0 0 0 / 0.85) calc(100% - var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-bottom)),
102
+ rgb(0 0 0 / 0.5) calc(100% - var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-bottom)),
103
+ rgb(0 0 0 / 0.15) calc(100% - var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-bottom)),
104
+ rgb(0 0 0 / 0) 100%
83
105
  ),
84
106
  linear-gradient(
85
107
  to right,
86
- transparent 0,
87
- black var(--sk-scroll-area-fade),
88
- black calc(100% - var(--sk-scroll-area-fade)),
89
- transparent 100%
108
+ rgb(0 0 0 / 0) 0,
109
+ rgb(0 0 0 / 0.15) calc(var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-left)),
110
+ rgb(0 0 0 / 0.5) calc(var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-left)),
111
+ rgb(0 0 0 / 0.85) calc(var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-left)),
112
+ rgb(0 0 0 / 1) calc(var(--sk-scroll-area-fade) * var(--sk-scroll-fade-left)),
113
+ rgb(0 0 0 / 1) calc(100% - var(--sk-scroll-area-fade) * var(--sk-scroll-fade-right)),
114
+ rgb(0 0 0 / 0.85) calc(100% - var(--sk-scroll-area-fade) * 0.75 * var(--sk-scroll-fade-right)),
115
+ rgb(0 0 0 / 0.5) calc(100% - var(--sk-scroll-area-fade) * 0.5 * var(--sk-scroll-fade-right)),
116
+ rgb(0 0 0 / 0.15) calc(100% - var(--sk-scroll-area-fade) * 0.25 * var(--sk-scroll-fade-right)),
117
+ rgb(0 0 0 / 0) 100%
90
118
  );
91
119
  mask-composite: intersect;
92
120
  }
@@ -1,4 +1,5 @@
1
- @use '@/styles/mixins/cut-border' as *;
1
+ @use '../mixins/cut-border' as *;
2
+ @use '../theme/variables' as *;
2
3
 
3
4
  //----------------------------------------------------------------------------------------------------------------------
4
5
  // Select Component Styles
@@ -14,23 +15,33 @@
14
15
  display: inline-flex;
15
16
  width: 100%;
16
17
 
18
+ // Default: md when no sk-size-* class is present (zero-specificity, explicit class wins)
19
+ &:where(:not([class*="sk-size-"]))
20
+ {
21
+ --sk-select-cut: 0.5rem;
22
+ }
23
+
17
24
  // Size variants
18
- &.sk-sm
25
+ &.sk-sm,
26
+ &.sk-size-sm
19
27
  {
20
28
  --sk-select-cut: 0.4rem;
21
29
  }
22
30
 
23
- &.sk-md
31
+ &.sk-md,
32
+ &.sk-size-md
24
33
  {
25
34
  --sk-select-cut: 0.5rem;
26
35
  }
27
36
 
28
- &.sk-lg
37
+ &.sk-lg,
38
+ &.sk-size-lg
29
39
  {
30
40
  --sk-select-cut: 0.6rem;
31
41
  }
32
42
 
33
- &.sk-xl
43
+ &.sk-xl,
44
+ &.sk-size-xl
34
45
  {
35
46
  --sk-select-cut: 0.7rem;
36
47
  }
@@ -165,28 +176,32 @@
165
176
  transition-duration: var(--sk-transition-duration-base);
166
177
 
167
178
  // Size variants
168
- .sk-select.sk-sm &
179
+ .sk-select.sk-sm &,
180
+ .sk-select.sk-size-sm &
169
181
  {
170
182
  height: 2rem;
171
183
  padding: 0 var(--sk-space-sm);
172
184
  font-size: 0.875rem;
173
185
  }
174
186
 
175
- .sk-select.sk-md &
187
+ .sk-select.sk-md &,
188
+ .sk-select.sk-size-md &
176
189
  {
177
190
  height: 2.5rem;
178
191
  padding: 0 var(--sk-space-md);
179
192
  font-size: 1rem;
180
193
  }
181
194
 
182
- .sk-select.sk-lg &
195
+ .sk-select.sk-lg &,
196
+ .sk-select.sk-size-lg &
183
197
  {
184
198
  height: 3rem;
185
199
  padding: 0 var(--sk-space-md);
186
200
  font-size: 1.125rem;
187
201
  }
188
202
 
189
- .sk-select.sk-xl &
203
+ .sk-select.sk-xl &,
204
+ .sk-select.sk-size-xl &
190
205
  {
191
206
  height: 3.5rem;
192
207
  padding: 0 var(--sk-space-md);
@@ -439,3 +454,19 @@
439
454
  }
440
455
 
441
456
  //----------------------------------------------------------------------------------------------------------------------
457
+ // Defaults-when-absent: kind — neutral when no explicit kind class is present.
458
+ //----------------------------------------------------------------------------------------------------------------------
459
+
460
+ $_select-kind-not: '';
461
+ @each $kind in $kinds
462
+ {
463
+ $_select-kind-not: $_select-kind-not + ':not(.sk-' + $kind + ')';
464
+ }
465
+
466
+ .sk-select:where(#{ $_select-kind-not })
467
+ {
468
+ --sk-select-color-base: var(--sk-neutral-base);
469
+ --sk-select-fg: var(--sk-neutral-text);
470
+ }
471
+
472
+ //----------------------------------------------------------------------------------------------------------------------
@@ -1,4 +1,3 @@
1
-
2
1
  //----------------------------------------------------------------------------------------------------------------------
3
2
  // Sidebar Component Styles
4
3
  //----------------------------------------------------------------------------------------------------------------------
@@ -10,7 +9,8 @@
10
9
  // Sidebar Container
11
10
  //----------------------------------------------------------------------------------------------------------------------
12
11
 
13
- .sk-sidebar
12
+ .sk-sidebar,
13
+ sk-sidebar
14
14
  {
15
15
  width: var(--sk-sidebar-width, 180px);
16
16
  flex-shrink: 0;
@@ -42,37 +42,6 @@
42
42
  --sk-sidebar-item-active-text: var(--sk-neutral-text);
43
43
  --sk-sidebar-item-active-bg: color-mix(in oklch, var(--sk-sidebar-item-bg) 92%, white 8%);
44
44
 
45
- &.sk-primary
46
- {
47
- --sk-sidebar-color-base: var(--sk-primary-base);
48
- --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
49
- }
50
- &.sk-accent
51
- {
52
- --sk-sidebar-color-base: var(--sk-accent-base);
53
- --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
54
- }
55
- &.sk-info
56
- {
57
- --sk-sidebar-color-base: var(--sk-info-base);
58
- --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
59
- }
60
- &.sk-success
61
- {
62
- --sk-sidebar-color-base: var(--sk-success-base);
63
- --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
64
- }
65
- &.sk-warning
66
- {
67
- --sk-sidebar-color-base: var(--sk-warning-base);
68
- --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
69
- }
70
- &.sk-danger
71
- {
72
- --sk-sidebar-color-base: var(--sk-danger-base);
73
- --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
74
- }
75
-
76
45
  .sk-sidebar-nav
77
46
  {
78
47
  display: flex;
@@ -81,6 +50,61 @@
81
50
  }
82
51
  }
83
52
 
53
+ //----------------------------------------------------------------------------------------------------------------------
54
+ // Kind Variants
55
+ //----------------------------------------------------------------------------------------------------------------------
56
+
57
+ @each $kind in $kinds
58
+ {
59
+ @include kind-variant('sidebar', $kind)
60
+ {
61
+ --sk-sidebar-color-base: var(--sk-#{ $kind }-base);
62
+
63
+ @if $kind != neutral
64
+ {
65
+ --sk-sidebar-item-active-text: var(--sk-sidebar-color-base);
66
+ }
67
+ }
68
+ }
69
+
70
+ //----------------------------------------------------------------------------------------------------------------------
71
+ // Dense Modifier
72
+ //----------------------------------------------------------------------------------------------------------------------
73
+
74
+ @include bool-modifier('sidebar', 'dense')
75
+ {
76
+ // Opts out of the coarse-pointer touch-target floor on sidebar items.
77
+ --sk-sidebar-dense: 1;
78
+ }
79
+
80
+ //----------------------------------------------------------------------------------------------------------------------
81
+ // Defaults When Absent
82
+ //----------------------------------------------------------------------------------------------------------------------
83
+
84
+ // Default kind: neutral — explicit :not() chain for zero-specificity default.
85
+ $_sidebar-kind-not: '';
86
+ @each $kind in $kinds
87
+ {
88
+ $_sidebar-kind-not: $_sidebar-kind-not + ':not(.sk-' + $kind + ')';
89
+ }
90
+
91
+ .sk-sidebar:where(#{ $_sidebar-kind-not })
92
+ {
93
+ --sk-sidebar-color-base: var(--sk-neutral-base);
94
+ --sk-sidebar-item-active-text: var(--sk-neutral-text);
95
+ }
96
+
97
+ //----------------------------------------------------------------------------------------------------------------------
98
+ // Custom-Element API Defaults (attribute-absence path)
99
+ //----------------------------------------------------------------------------------------------------------------------
100
+
101
+ // Default kind: neutral — fires when <sk-sidebar> has no kind attribute.
102
+ @include defaults-when-no-attr('sidebar', 'kind')
103
+ {
104
+ --sk-sidebar-color-base: var(--sk-neutral-base);
105
+ --sk-sidebar-item-active-text: var(--sk-neutral-text);
106
+ }
107
+
84
108
  //----------------------------------------------------------------------------------------------------------------------
85
109
  // Sidebar Section
86
110
  //----------------------------------------------------------------------------------------------------------------------
@@ -118,7 +142,8 @@
118
142
  display: block;
119
143
 
120
144
  // Coarse-pointer touch-target floor. Parent .sk-sidebar.sk-dense opts out.
121
- .sk-sidebar:not(.sk-dense) &
145
+ .sk-sidebar:not(.sk-dense) &,
146
+ sk-sidebar:not([dense]) &
122
147
  {
123
148
  @include touch
124
149
  {