@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,30 +2,15 @@
2
2
  // Toolbar Component Styles
3
3
  //----------------------------------------------------------------------------------------------------------------------
4
4
 
5
- @use '@/styles/mixins/cut-border' as *;
6
-
7
- $kinds: (neutral, primary, accent, info, success, warning, danger);
8
-
9
- //----------------------------------------------------------------------------------------------------------------------
10
- // Kind Mixin
11
- //----------------------------------------------------------------------------------------------------------------------
12
-
13
- @mixin toolbar-kind($kind)
14
- {
15
- &.sk-#{ '' + $kind }
16
- {
17
- --sk-toolbar-color-base: var(--sk-#{ $kind }-base);
18
- --sk-toolbar-fg: var(--sk-#{ $kind }-text);
19
- --sk-toolbar-hover: var(--sk-#{ $kind }-hover);
20
- --sk-toolbar-active: var(--sk-#{ $kind }-active);
21
- }
22
- }
5
+ @use '../theme/variables' as *;
6
+ @use '../mixins' as *;
23
7
 
24
8
  //----------------------------------------------------------------------------------------------------------------------
25
9
  // Toolbar Root
26
10
  //----------------------------------------------------------------------------------------------------------------------
27
11
 
28
- .sk-toolbar
12
+ .sk-toolbar,
13
+ sk-toolbar
29
14
  {
30
15
  --sk-toolbar-color-base: var(--sk-neutral-base);
31
16
  --sk-toolbar-fg: var(--sk-neutral-text);
@@ -50,11 +35,6 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
50
35
  background: oklch(from var(--sk-toolbar-color-base) l c h / 0.08);
51
36
  position: relative;
52
37
 
53
- &.sk-vertical
54
- {
55
- flex-direction: column;
56
- }
57
-
58
38
  //------------------------------------------------------------------------------------------------------------------
59
39
  // Corner Toggle Classes
60
40
  //------------------------------------------------------------------------------------------------------------------
@@ -134,17 +114,81 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
134
114
  );
135
115
  }
136
116
  }
117
+ }
137
118
 
138
- //------------------------------------------------------------------------------------------------------------------
139
- // Kind Variants
140
- //------------------------------------------------------------------------------------------------------------------
119
+ //----------------------------------------------------------------------------------------------------------------------
120
+ // Kind Variants
121
+ //----------------------------------------------------------------------------------------------------------------------
141
122
 
142
- @each $kind in $kinds
123
+ @each $kind in $kinds
124
+ {
125
+ @include kind-variant('toolbar', $kind)
143
126
  {
144
- @include toolbar-kind($kind);
127
+ --sk-toolbar-color-base: var(--sk-#{ $kind }-base);
128
+ --sk-toolbar-fg: var(--sk-#{ $kind }-text);
129
+ --sk-toolbar-hover: var(--sk-#{ $kind }-hover);
130
+ --sk-toolbar-active: var(--sk-#{ $kind }-active);
145
131
  }
146
132
  }
147
133
 
134
+ //----------------------------------------------------------------------------------------------------------------------
135
+ // Orientation Modifier
136
+ //----------------------------------------------------------------------------------------------------------------------
137
+
138
+ @include single-choice-modifier('toolbar', 'orientation', 'vertical')
139
+ {
140
+ flex-direction: column;
141
+ }
142
+
143
+ @include single-choice-modifier('toolbar', 'orientation', 'horizontal')
144
+ {
145
+ flex-direction: row;
146
+ }
147
+
148
+ //----------------------------------------------------------------------------------------------------------------------
149
+ // Defaults When Absent
150
+ //----------------------------------------------------------------------------------------------------------------------
151
+
152
+ // Default kind: neutral — explicit :not() chain for zero-specificity default.
153
+ $_toolbar-kind-not: '';
154
+ @each $kind in $kinds
155
+ {
156
+ $_toolbar-kind-not: $_toolbar-kind-not + ':not(.sk-' + $kind + ')';
157
+ }
158
+
159
+ .sk-toolbar:where(#{ $_toolbar-kind-not })
160
+ {
161
+ --sk-toolbar-color-base: var(--sk-neutral-base);
162
+ --sk-toolbar-fg: var(--sk-neutral-text);
163
+ --sk-toolbar-hover: var(--sk-neutral-hover);
164
+ --sk-toolbar-active: var(--sk-neutral-active);
165
+ }
166
+
167
+ // Default orientation: horizontal — fires when no sk-orientation-* class is present.
168
+ @include defaults-when-absent('toolbar', 'sk-orientation-')
169
+ {
170
+ flex-direction: row;
171
+ }
172
+
173
+ //----------------------------------------------------------------------------------------------------------------------
174
+ // Custom-Element API Defaults (attribute-absence path)
175
+ //----------------------------------------------------------------------------------------------------------------------
176
+
177
+ // Default kind: neutral — fires when <sk-toolbar> has no kind attribute.
178
+ @include defaults-when-no-attr('toolbar', 'kind')
179
+ {
180
+ --sk-toolbar-color-base: var(--sk-neutral-base);
181
+ --sk-toolbar-fg: var(--sk-neutral-text);
182
+ --sk-toolbar-hover: var(--sk-neutral-hover);
183
+ --sk-toolbar-active: var(--sk-neutral-active);
184
+ }
185
+
186
+ // Default orientation: horizontal — fires when <sk-toolbar> has no orientation attribute.
187
+ @include defaults-when-no-attr('toolbar', 'orientation')
188
+ {
189
+ flex-direction: row;
190
+ }
191
+
148
192
  //----------------------------------------------------------------------------------------------------------------------
149
193
  // Toolbar Button
150
194
  //----------------------------------------------------------------------------------------------------------------------
@@ -280,19 +324,29 @@ $kinds: (neutral, primary, accent, info, success, warning, danger);
280
324
  {
281
325
  background: oklch(from var(--sk-toolbar-color-base) l c h / 0.2);
282
326
 
283
- .sk-toolbar.sk-horizontal > &
327
+ .sk-toolbar.sk-orientation-horizontal > &,
328
+ sk-toolbar[orientation=horizontal] > &
284
329
  {
285
330
  width: 1px;
286
331
  align-self: stretch;
287
332
  margin: var(--sk-space-xs) var(--sk-space-xxs);
288
333
  }
289
334
 
290
- .sk-toolbar.sk-vertical > &
335
+ .sk-toolbar.sk-orientation-vertical > &,
336
+ sk-toolbar[orientation=vertical] > &
291
337
  {
292
338
  height: 1px;
293
339
  align-self: stretch;
294
340
  margin: var(--sk-space-xxs) var(--sk-space-xs);
295
341
  }
342
+
343
+ // Default: horizontal (no orientation class/attribute)
344
+ .sk-toolbar:where(:not([class*="sk-orientation-"])) > &
345
+ {
346
+ width: 1px;
347
+ align-self: stretch;
348
+ margin: var(--sk-space-xs) var(--sk-space-xxs);
349
+ }
296
350
  }
297
351
 
298
352
  //----------------------------------------------------------------------------------------------------------------------
@@ -1,5 +1,166 @@
1
- @use '@/styles/mixins/cut-border' as *;
2
- @use '@/styles/mixins/responsive' as *;
1
+ //----------------------------------------------------------------------------------------------------------------------
2
+ // Tooltip Component Styles
3
+ //----------------------------------------------------------------------------------------------------------------------
4
+
5
+ @use '../theme/variables' as *;
6
+ @use '../mixins' as *;
7
+
8
+ //----------------------------------------------------------------------------------------------------------------------
9
+ // Tooltip Design Tokens
10
+ //----------------------------------------------------------------------------------------------------------------------
11
+
12
+ .sk-tooltip,
13
+ sk-tooltip
14
+ {
15
+ // Color tokens
16
+ --sk-tooltip-color-base: var(--sk-neutral-base);
17
+ --sk-tooltip-border-color: transparent;
18
+
19
+ // Calculate darkened background like buttons (ghost hover state)
20
+ --sk-tooltip-bg: color-mix(
21
+ in oklch,
22
+ color-mix(in oklch, var(--sk-tooltip-color-base) 75%, transparent 25%),
23
+ #000 46.25%
24
+ );
25
+
26
+ // Calculate hover-like background
27
+ --sk-tooltip-bg-hover: color-mix(in oklch, var(--sk-tooltip-bg) 85%, white 15%);
28
+ }
29
+
30
+ //----------------------------------------------------------------------------------------------------------------------
31
+ // Tooltip Root
32
+ //----------------------------------------------------------------------------------------------------------------------
33
+
34
+ .sk-tooltip,
35
+ sk-tooltip
36
+ {
37
+ // Cut corners (border controlled by variant)
38
+ @include cut-border(
39
+ var(--sk-radius-md),
40
+ var(--sk-border-width-thin),
41
+ var(--sk-tooltip-border-color),
42
+ (top-left top-right bottom-left bottom-right)
43
+ );
44
+
45
+ position: relative;
46
+ padding: calc(var(--sk-space-md) / 4 + 2px) calc(var(--sk-space-lg) / 4 + 4px);
47
+ font-size: 0.875rem;
48
+ line-height: 1.4;
49
+
50
+ background: oklch(from var(--sk-tooltip-bg-hover) calc(l * 0.9) c h / 0.95);
51
+ color: var(--sk-neutral-text);
52
+ box-shadow:
53
+ var(--sk-shadow-md),
54
+ 0 0 8px oklch(from var(--sk-tooltip-color-base) l c h / 0.4);
55
+
56
+ max-width: 20rem;
57
+ z-index: var(--sk-z-tooltip);
58
+
59
+ // Content animation
60
+ &[data-state='delayed-open'],
61
+ &[data-state='instant-open']
62
+ {
63
+ animation: sk-tooltip-show var(--sk-transition-duration-fast) ease-out;
64
+ }
65
+
66
+ &[data-state='closed']
67
+ {
68
+ animation: sk-tooltip-hide var(--sk-transition-duration-fast) ease-in;
69
+ }
70
+ }
71
+
72
+ //----------------------------------------------------------------------------------------------------------------------
73
+ // Kind Variants
74
+ //----------------------------------------------------------------------------------------------------------------------
75
+
76
+ @each $kind in $kinds
77
+ {
78
+ @include kind-variant('tooltip', $kind)
79
+ {
80
+ --sk-tooltip-color-base: var(--sk-#{ $kind }-base);
81
+ color: var(--sk-#{ $kind }-text);
82
+ }
83
+ }
84
+
85
+ //----------------------------------------------------------------------------------------------------------------------
86
+ // Variant Variants (solid / outline)
87
+ //----------------------------------------------------------------------------------------------------------------------
88
+
89
+ @include variant-variant('tooltip', 'solid')
90
+ {
91
+ // Solid variant is the default — darkened background
92
+ background: oklch(from var(--sk-tooltip-bg-hover) calc(l * 0.9) c h / 0.95);
93
+ }
94
+
95
+ @include variant-variant('tooltip', 'outline')
96
+ {
97
+ // Border uses the color-base variable (works with custom colors)
98
+ --sk-tooltip-border-color: var(--sk-tooltip-color-base);
99
+
100
+ background: oklch(0 0 0 / 0.9);
101
+ box-shadow:
102
+ var(--sk-shadow-md),
103
+ inset 0 0 20px oklch(from var(--sk-tooltip-color-base) l c h / 0.5),
104
+ 0 0 8px oklch(from var(--sk-tooltip-color-base) l c h / 0.4);
105
+ }
106
+
107
+ //----------------------------------------------------------------------------------------------------------------------
108
+ // Placement Modifiers (single-choice — naive CSS positioning)
109
+ //----------------------------------------------------------------------------------------------------------------------
110
+
111
+ @include single-choice-modifier('tooltip', 'placement', 'top', 'placement')
112
+ {
113
+ // Placement is handled by the positioning library (Floating UI / Radix).
114
+ // This modifier exists so pure-CSS consumers can hint positioning.
115
+ transform-origin: bottom center;
116
+ }
117
+
118
+ @include single-choice-modifier('tooltip', 'placement', 'bottom', 'placement')
119
+ {
120
+ transform-origin: top center;
121
+ }
122
+
123
+ @include single-choice-modifier('tooltip', 'placement', 'left', 'placement')
124
+ {
125
+ transform-origin: right center;
126
+ }
127
+
128
+ @include single-choice-modifier('tooltip', 'placement', 'right', 'placement')
129
+ {
130
+ transform-origin: left center;
131
+ }
132
+
133
+ //----------------------------------------------------------------------------------------------------------------------
134
+ // Defaults When Absent
135
+ //----------------------------------------------------------------------------------------------------------------------
136
+
137
+ // Default kind: neutral
138
+ $_tooltip-kind-not: '';
139
+ @each $kind in $kinds
140
+ {
141
+ $_tooltip-kind-not: $_tooltip-kind-not + ':not(.sk-' + $kind + ')';
142
+ }
143
+
144
+ .sk-tooltip:where(#{ $_tooltip-kind-not })
145
+ {
146
+ --sk-tooltip-color-base: var(--sk-neutral-base);
147
+ color: var(--sk-neutral-text);
148
+ }
149
+
150
+ //----------------------------------------------------------------------------------------------------------------------
151
+ // Custom-Element API Defaults (attribute-absence path)
152
+ //----------------------------------------------------------------------------------------------------------------------
153
+
154
+ // Default kind: neutral
155
+ @include defaults-when-no-attr('tooltip', 'kind')
156
+ {
157
+ --sk-tooltip-color-base: var(--sk-neutral-base);
158
+ color: var(--sk-neutral-text);
159
+ }
160
+
161
+ //----------------------------------------------------------------------------------------------------------------------
162
+ // Tooltip Content (legacy class — kept for Radix/Floating UI compatibility)
163
+ //----------------------------------------------------------------------------------------------------------------------
3
164
 
4
165
  .sk-tooltip-content
5
166
  {
@@ -153,6 +314,8 @@
153
314
  }
154
315
  }
155
316
 
317
+ //----------------------------------------------------------------------------------------------------------------------
318
+
156
319
  .sk-tooltip-arrow
157
320
  {
158
321
  // Solid variant - match the background
@@ -175,7 +338,10 @@
175
338
  margin: 0;
176
339
  }
177
340
 
341
+ //----------------------------------------------------------------------------------------------------------------------
178
342
  // Animations
343
+ //----------------------------------------------------------------------------------------------------------------------
344
+
179
345
  @keyframes sk-tooltip-show
180
346
  {
181
347
  from
@@ -212,8 +378,11 @@
212
378
 
213
379
  @include reduced-motion
214
380
  {
215
- .sk-tooltip-content[data-state]
381
+ .sk-tooltip-content[data-state],
382
+ .sk-tooltip[data-state]
216
383
  {
217
384
  animation: none;
218
385
  }
219
386
  }
387
+
388
+ //----------------------------------------------------------------------------------------------------------------------
@@ -35,16 +35,30 @@
35
35
  $cut-bottom-right: list.index($corners, bottom-right) != null;
36
36
  $cut-bottom-left: list.index($corners, bottom-left) != null;
37
37
 
38
+ // Resolve per-corner radii up front — Sass's `if()` function is deprecated, so use `@if`/`@else` and
39
+ // pass the results through as property values.
40
+ $top-left-radius: 0;
41
+ @if $cut-top-left { $top-left-radius: $cut; }
42
+
43
+ $top-right-radius: 0;
44
+ @if $cut-top-right { $top-right-radius: $cut; }
45
+
46
+ $bottom-right-radius: 0;
47
+ @if $cut-bottom-right { $bottom-right-radius: $cut; }
48
+
49
+ $bottom-left-radius: 0;
50
+ @if $cut-bottom-left { $bottom-left-radius: $cut; }
51
+
38
52
  // Modern browsers with corner-shape support
39
53
  @supports (corner-shape: bevel)
40
54
  {
41
55
  border: $border-width solid $border-color;
42
56
 
43
57
  // Apply border-radius only to specified corners
44
- border-top-left-radius: if($cut-top-left, $cut, 0);
45
- border-top-right-radius: if($cut-top-right, $cut, 0);
46
- border-bottom-right-radius: if($cut-bottom-right, $cut, 0);
47
- border-bottom-left-radius: if($cut-bottom-left, $cut, 0);
58
+ border-top-left-radius: $top-left-radius;
59
+ border-top-right-radius: $top-right-radius;
60
+ border-bottom-right-radius: $bottom-right-radius;
61
+ border-bottom-left-radius: $bottom-left-radius;
48
62
 
49
63
  corner-shape: bevel;
50
64
  }
@@ -0,0 +1,192 @@
1
+ //----------------------------------------------------------------------------------------------------------------------
2
+ // Dual-Selector Mixins
3
+ //
4
+ // Emit class-form + attribute-form selector pairs so components can be authored as
5
+ // `<div class="sk-foo sk-primary">` (Layer 1 class API) or `<sk-foo kind="primary">` (Layer 2
6
+ // custom-element API) with the same compiled rules.
7
+ //
8
+ // Also provides the `defaults-when-absent` helper, which applies a default modifier's rules
9
+ // via `:where(:not([class*="prefix-"]))` — zero-specificity so any explicit class wins — for
10
+ // Bootstrap-style ergonomics where `<div class="sk-foo">` alone renders the default look.
11
+ //----------------------------------------------------------------------------------------------------------------------
12
+
13
+ //----------------------------------------------------------------------------------------------------------------------
14
+ // Private Helpers
15
+ //----------------------------------------------------------------------------------------------------------------------
16
+
17
+ // _attr-variant — shared core for kind-variant / size-variant / variant-variant.
18
+ // Emits `.sk-<component>.sk-<value>` and `sk-<component>[<attr>="<value>"]`.
19
+ // Force string coercion via `"" + $value` to suppress CSS color-name interpolation warnings
20
+ // (Sass warns when `yellow` or `red` appear in interpolation as color values, not strings).
21
+ @mixin _attr-variant($component, $attr, $value)
22
+ {
23
+ $v: "" + $value;
24
+ .sk-#{ $component }.sk-#{ $v },
25
+ sk-#{ $component }[#{ $attr }="#{ $v }"]
26
+ {
27
+ @content;
28
+ }
29
+ }
30
+
31
+ // _attr-valued-modifier — shared core for list-modifier / single-choice-modifier.
32
+ // $operator is the CSS attribute selector operator: '~=' for space-lists, '=' for exclusive.
33
+ // Force string coercion via `"" + $value` to suppress CSS color-name interpolation warnings
34
+ // (Sass warns when `yellow` or `red` appear in interpolation as color values, not strings).
35
+ @mixin _attr-valued-modifier($component, $family, $value, $attr, $operator)
36
+ {
37
+ $v: "" + $value;
38
+ $attribute: $family;
39
+ @if $attr != null { $attribute: $attr; }
40
+
41
+ .sk-#{ $component }.sk-#{ $family }-#{ $v },
42
+ sk-#{ $component }[#{ $attribute }#{ $operator }"#{ $v }"]
43
+ {
44
+ @content;
45
+ }
46
+ }
47
+
48
+ //----------------------------------------------------------------------------------------------------------------------
49
+ // kind-variant
50
+ //
51
+ // Delegates to `_attr-variant` with attr = 'kind'.
52
+ // Emits `.sk-<component>.sk-<kind>` and `sk-<component>[kind="<kind>"]`.
53
+ //----------------------------------------------------------------------------------------------------------------------
54
+
55
+ @mixin kind-variant($component, $kind)
56
+ {
57
+ @include _attr-variant($component, 'kind', $kind)
58
+ {
59
+ @content;
60
+ }
61
+ }
62
+
63
+ //----------------------------------------------------------------------------------------------------------------------
64
+ // size-variant
65
+ //
66
+ // Delegates to `_attr-variant` with attr = 'size', and additionally emits the `sk-size-<size>`
67
+ // prefixed class. The prefixed form is what `defaults-when-absent` keys on via `[class*="sk-size-"]`
68
+ // — a plain `[class*="sk-"]` would match every class in the library, so sizes need their own
69
+ // distinct prefix.
70
+ //
71
+ // Emits:
72
+ // .sk-<component>.sk-<size>,
73
+ // .sk-<component>.sk-size-<size>,
74
+ // sk-<component>[size="<size>"]
75
+ //----------------------------------------------------------------------------------------------------------------------
76
+
77
+ @mixin size-variant($component, $size)
78
+ {
79
+ .sk-#{ $component }.sk-#{ $size },
80
+ .sk-#{ $component }.sk-size-#{ $size },
81
+ sk-#{ $component }[size="#{ $size }"]
82
+ {
83
+ @content;
84
+ }
85
+ }
86
+
87
+ //----------------------------------------------------------------------------------------------------------------------
88
+ // variant-variant
89
+ //
90
+ // Delegates to `_attr-variant` with attr = 'variant'.
91
+ // Emits `.sk-<component>.sk-<variant>` and `sk-<component>[variant="<variant>"]`.
92
+ //----------------------------------------------------------------------------------------------------------------------
93
+
94
+ @mixin variant-variant($component, $variant)
95
+ {
96
+ @include _attr-variant($component, 'variant', $variant)
97
+ {
98
+ @content;
99
+ }
100
+ }
101
+
102
+ //----------------------------------------------------------------------------------------------------------------------
103
+ // bool-modifier
104
+ //
105
+ // Emit `.sk-<component>.sk-<modifier>` and `sk-<component>[<modifier>]` (attribute presence).
106
+ // Use for booleans like `no-border`, `no-decoration`, `dense`, `animated`.
107
+ //----------------------------------------------------------------------------------------------------------------------
108
+
109
+ @mixin bool-modifier($component, $modifier)
110
+ {
111
+ .sk-#{ $component }.sk-#{ $modifier },
112
+ sk-#{ $component }[#{ $modifier }]
113
+ {
114
+ @content;
115
+ }
116
+ }
117
+
118
+ //----------------------------------------------------------------------------------------------------------------------
119
+ // list-modifier
120
+ //
121
+ // Emit `.sk-<component>.sk-<family>-<value>` and `sk-<component>[<attr>~="<value>"]` for a
122
+ // single value of a space-separated list attribute. Use for `corners` (top-left, top-right, ...)
123
+ // or other multi-value families. Pass `$attr` when the HTML attribute name differs from `$family`.
124
+ //
125
+ // Example: @include list-modifier('panel', 'cut', 'top-left', 'corners') { ... }
126
+ // → .sk-panel.sk-cut-top-left, sk-panel[corners~="top-left"] { ... }
127
+ //----------------------------------------------------------------------------------------------------------------------
128
+
129
+ @mixin list-modifier($component, $family, $value, $attr: null)
130
+ {
131
+ @include _attr-valued-modifier($component, $family, $value, $attr, '~=')
132
+ {
133
+ @content;
134
+ }
135
+ }
136
+
137
+ //----------------------------------------------------------------------------------------------------------------------
138
+ // single-choice-modifier
139
+ //
140
+ // Emit `.sk-<component>.sk-<family>-<value>` and `sk-<component>[<attr>="<value>"]` for a
141
+ // single value of an exclusive attribute. Use for `decoration-corner`, `orientation`, etc.
142
+ // Pass `$attr` when the HTML attribute name differs from `$family`.
143
+ //----------------------------------------------------------------------------------------------------------------------
144
+
145
+ @mixin single-choice-modifier($component, $family, $value, $attr: null)
146
+ {
147
+ @include _attr-valued-modifier($component, $family, $value, $attr, '=')
148
+ {
149
+ @content;
150
+ }
151
+ }
152
+
153
+ //----------------------------------------------------------------------------------------------------------------------
154
+ // defaults-when-absent
155
+ //
156
+ // Emit `.sk-<component>:where(:not([class*="<prefix>"]))` — zero-specificity so any explicit
157
+ // class from the family wins. Use to apply default modifier rules when the author hasn't
158
+ // specified any class from the family.
159
+ //
160
+ // Note: this targets the class API (.sk-<component>) only. For the custom-element API, use
161
+ // `defaults-when-no-attr` to key on attribute absence instead.
162
+ //
163
+ // Example: @include defaults-when-absent('panel', 'sk-cut-') { --sk-panel-cut-br: ...; }
164
+ //----------------------------------------------------------------------------------------------------------------------
165
+
166
+ @mixin defaults-when-absent($component, $prefix)
167
+ {
168
+ .sk-#{ $component }:where(:not([class*="#{ $prefix }"]))
169
+ {
170
+ @content;
171
+ }
172
+ }
173
+
174
+ //----------------------------------------------------------------------------------------------------------------------
175
+ // defaults-when-no-attr
176
+ //
177
+ // Emit `sk-<component>:where(:not([<attr>]))` — zero-specificity so any explicit attribute
178
+ // value wins. Use alongside `defaults-when-absent` to apply the same default modifier rules
179
+ // for the custom-element API when no modifier attribute is present.
180
+ //
181
+ // Example: @include defaults-when-no-attr('panel', 'kind') { --sk-panel-color-base: ...; }
182
+ //----------------------------------------------------------------------------------------------------------------------
183
+
184
+ @mixin defaults-when-no-attr($component, $attr)
185
+ {
186
+ sk-#{ $component }:where(:not([#{ $attr }]))
187
+ {
188
+ @content;
189
+ }
190
+ }
191
+
192
+ //----------------------------------------------------------------------------------------------------------------------
@@ -4,5 +4,6 @@
4
4
 
5
5
  @forward 'cut-border';
6
6
  @forward 'responsive';
7
+ @forward 'dual-selector';
7
8
 
8
9
  //----------------------------------------------------------------------------------------------------------------------