@ghostvue/themes 0.1.0 → 0.2.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 (44) hide show
  1. package/dist/calm.css +24 -14
  2. package/dist/components.d.ts +7 -2
  3. package/dist/components.js +6 -1
  4. package/dist/default.css +1006 -752
  5. package/dist/define.js +21 -3
  6. package/dist/generated/tokens.d.ts +11 -0
  7. package/dist/generated/tokens.js +11 -0
  8. package/dist/ghost-checkbox-group.d.ts +50 -0
  9. package/dist/ghost-checkbox-group.js +56 -0
  10. package/dist/ghost-field.d.ts +12 -3
  11. package/dist/ghost-field.js +6 -1
  12. package/dist/ghost-select.d.ts +52 -113
  13. package/dist/ghost-select.js +45 -68
  14. package/dist/ghost-submenu-content.d.ts +22 -0
  15. package/dist/ghost-submenu-content.js +17 -0
  16. package/dist/ghost-submenu-trigger.d.ts +11 -0
  17. package/dist/ghost-submenu-trigger.js +11 -0
  18. package/dist/ghost-submenu.d.ts +1 -0
  19. package/dist/ghost-submenu.js +1 -0
  20. package/dist/ghost-tags-input.d.ts +75 -0
  21. package/dist/ghost-tags-input.js +54 -0
  22. package/dist/index.d.ts +7 -2
  23. package/dist/index.js +6 -1
  24. package/dist/manifest.json +471 -11
  25. package/dist/mono.css +24 -14
  26. package/dist/recipes/checkbox-group.css +30 -0
  27. package/dist/recipes/command-palette.css +52 -0
  28. package/dist/recipes/context-menu.css +95 -184
  29. package/dist/recipes/data-table.css +151 -144
  30. package/dist/recipes/dialog.css +68 -10
  31. package/dist/recipes/drawer.css +109 -11
  32. package/dist/recipes/dropdown-menu.css +95 -189
  33. package/dist/recipes/hover-card.css +19 -0
  34. package/dist/recipes/menubar.css +110 -191
  35. package/dist/recipes/popover.css +19 -0
  36. package/dist/recipes/progress.css +7 -2
  37. package/dist/recipes/scroll-area.css +43 -2
  38. package/dist/recipes/segmented-control.css +62 -3
  39. package/dist/recipes/tags-input.css +120 -0
  40. package/dist/tokens/semantic.json +5 -0
  41. package/dist/tokens.css +24 -14
  42. package/dist/tokens.json +15 -0
  43. package/dist/vibrant.css +24 -14
  44. package/package.json +3 -3
@@ -7,14 +7,17 @@
7
7
  * localized `[dir]` subtree around its trigger, so the headless part resolves
8
8
  * the direction and these rules map it to left/right explicitly.
9
9
  *
10
- * Entry is a slide + fade via @starting-style (no exit animation: closed
11
- * drawers unmount immediately). Reduced motion keeps only an opacity fade.
10
+ * Entry is a slide + fade via @starting-style; exit slides back to the same
11
+ * edge (faster, accelerate easing) while useGhostPresence keeps the closed
12
+ * surface mounted. Geometry and forced-colors rules match the part classes
13
+ * without [data-state='open'] so the exiting surface keeps its edge offsets.
14
+ * Reduced motion keeps only an opacity fade.
12
15
  */
13
16
  @layer ghostvue-theme {
14
17
  :where(
15
- .ghost-theme .ghost-drawer-overlay[data-state='open'],
16
- .ghost-themed-scope .ghost-drawer-overlay[data-state='open'],
17
- .ghost-drawer-overlay[data-themed][data-state='open']
18
+ .ghost-theme .ghost-drawer-overlay,
19
+ .ghost-themed-scope .ghost-drawer-overlay,
20
+ .ghost-drawer-overlay[data-themed]
18
21
  ) {
19
22
  background-color: var(--ghost-scrim);
20
23
  inset: 0;
@@ -23,9 +26,9 @@
23
26
  }
24
27
 
25
28
  :where(
26
- .ghost-theme .ghost-drawer-content[data-state='open'],
27
- .ghost-themed-scope .ghost-drawer-content[data-state='open'],
28
- .ghost-drawer-content[data-themed][data-state='open']
29
+ .ghost-theme .ghost-drawer-content,
30
+ .ghost-themed-scope .ghost-drawer-content,
31
+ .ghost-drawer-content[data-themed]
29
32
  ) {
30
33
  align-content: start;
31
34
  background-color: var(--ghost-elevation-4-bg);
@@ -281,6 +284,87 @@
281
284
  translate: 0 100%;
282
285
  }
283
286
  }
287
+
288
+ /* Exit: fade and slide back toward the anchored edge. */
289
+ :where(
290
+ .ghost-theme .ghost-drawer-overlay[data-state='closed'],
291
+ .ghost-themed-scope .ghost-drawer-overlay[data-state='closed'],
292
+ .ghost-drawer-overlay[data-themed][data-state='closed']
293
+ ) {
294
+ opacity: 0;
295
+ transition: opacity var(--ghost-motion-exit-duration)
296
+ var(--ghost-motion-exit-easing);
297
+ }
298
+
299
+ :where(
300
+ .ghost-theme .ghost-drawer-content[data-state='closed'],
301
+ .ghost-themed-scope .ghost-drawer-content[data-state='closed'],
302
+ .ghost-drawer-content[data-themed][data-state='closed']
303
+ ) {
304
+ opacity: 0;
305
+ transition:
306
+ opacity var(--ghost-motion-exit-duration)
307
+ var(--ghost-motion-exit-easing),
308
+ translate var(--ghost-motion-exit-duration)
309
+ var(--ghost-motion-exit-easing);
310
+ }
311
+
312
+ :where(
313
+ .ghost-theme
314
+ .ghost-drawer-content[data-state='closed']:is(
315
+ [data-side='start'][data-dir='ltr'],
316
+ [data-side='end'][data-dir='rtl']
317
+ ),
318
+ .ghost-themed-scope
319
+ .ghost-drawer-content[data-state='closed']:is(
320
+ [data-side='start'][data-dir='ltr'],
321
+ [data-side='end'][data-dir='rtl']
322
+ ),
323
+ .ghost-drawer-content[data-themed][data-state='closed']:is(
324
+ [data-side='start'][data-dir='ltr'],
325
+ [data-side='end'][data-dir='rtl']
326
+ )
327
+ ) {
328
+ translate: -100% 0;
329
+ }
330
+
331
+ :where(
332
+ .ghost-theme
333
+ .ghost-drawer-content[data-state='closed']:is(
334
+ [data-side='end'][data-dir='ltr'],
335
+ [data-side='start'][data-dir='rtl']
336
+ ),
337
+ .ghost-themed-scope
338
+ .ghost-drawer-content[data-state='closed']:is(
339
+ [data-side='end'][data-dir='ltr'],
340
+ [data-side='start'][data-dir='rtl']
341
+ ),
342
+ .ghost-drawer-content[data-themed][data-state='closed']:is(
343
+ [data-side='end'][data-dir='ltr'],
344
+ [data-side='start'][data-dir='rtl']
345
+ )
346
+ ) {
347
+ translate: 100% 0;
348
+ }
349
+
350
+ :where(
351
+ .ghost-theme .ghost-drawer-content[data-state='closed'][data-side='top'],
352
+ .ghost-themed-scope
353
+ .ghost-drawer-content[data-state='closed'][data-side='top'],
354
+ .ghost-drawer-content[data-themed][data-state='closed'][data-side='top']
355
+ ) {
356
+ translate: 0 -100%;
357
+ }
358
+
359
+ :where(
360
+ .ghost-theme
361
+ .ghost-drawer-content[data-state='closed'][data-side='bottom'],
362
+ .ghost-themed-scope
363
+ .ghost-drawer-content[data-state='closed'][data-side='bottom'],
364
+ .ghost-drawer-content[data-themed][data-state='closed'][data-side='bottom']
365
+ ) {
366
+ translate: 0 100%;
367
+ }
284
368
  }
285
369
 
286
370
  /* Reduced motion: no spatial movement in resting or starting state; a short
@@ -299,6 +383,20 @@
299
383
  translate: none;
300
384
  }
301
385
 
386
+ :where(
387
+ .ghost-theme .ghost-drawer-overlay[data-state='closed'],
388
+ .ghost-themed-scope .ghost-drawer-overlay[data-state='closed'],
389
+ .ghost-drawer-overlay[data-themed][data-state='closed'],
390
+ .ghost-theme .ghost-drawer-content[data-state='closed'],
391
+ .ghost-themed-scope .ghost-drawer-content[data-state='closed'],
392
+ .ghost-drawer-content[data-themed][data-state='closed']
393
+ ) {
394
+ opacity: 0;
395
+ transition: opacity var(--ghost-motion-fade-duration)
396
+ var(--ghost-motion-easing-standard);
397
+ translate: none;
398
+ }
399
+
302
400
  @starting-style {
303
401
  :where(
304
402
  .ghost-theme .ghost-drawer-overlay[data-state='open'],
@@ -316,9 +414,9 @@
316
414
 
317
415
  @media (forced-colors: active) {
318
416
  :where(
319
- .ghost-theme .ghost-drawer-content[data-state='open'],
320
- .ghost-themed-scope .ghost-drawer-content[data-state='open'],
321
- .ghost-drawer-content[data-themed][data-state='open']
417
+ .ghost-theme .ghost-drawer-content,
418
+ .ghost-themed-scope .ghost-drawer-content,
419
+ .ghost-drawer-content[data-themed]
322
420
  ) {
323
421
  background-color: Canvas;
324
422
  border-color: CanvasText;
@@ -1,12 +1,12 @@
1
1
  /*
2
- * Themed GhostDropdownMenu surface and items. Visual values use semantic
3
- * --ghost-* tokens with no component-specific literals.
2
+ * Themed dropdown and submenu surfaces use elevation and control tokens.
3
+ * Each surface styles its own items and the immediate groups it contains.
4
4
  */
5
5
  @layer ghostvue-theme {
6
6
  :where(
7
- .ghost-theme .ghost-dropdown-menu-content,
8
- .ghost-themed-scope .ghost-dropdown-menu-content,
9
- .ghost-dropdown-menu-content[data-themed]
7
+ :is(.ghost-theme, .ghost-themed-scope)
8
+ :is(.ghost-dropdown-menu-content, [data-part='sub-content']),
9
+ :is(.ghost-dropdown-menu-content, [data-part='sub-content'])[data-themed]
10
10
  ) {
11
11
  background-color: var(--ghost-elevation-3-bg);
12
12
  border: var(--ghost-border-hairline-width) solid
@@ -24,209 +24,115 @@
24
24
  min-inline-size: max-content;
25
25
  padding: var(--ghost-space-inset-2xs);
26
26
  z-index: 50;
27
- }
28
27
 
29
- :where(
30
- .ghost-theme .ghost-dropdown-menu-content [data-part='label'],
31
- .ghost-themed-scope .ghost-dropdown-menu-content [data-part='label'],
32
- .ghost-dropdown-menu-content[data-themed] [data-part='label']
33
- ) {
34
- color: var(--ghost-text-muted);
35
- font-size: var(--ghost-type-size-sm);
36
- font-weight: var(--ghost-type-weight-semibold);
37
- padding: var(--ghost-space-inset-xs) var(--ghost-space-inset-sm);
38
- user-select: none;
39
- }
28
+ & > :where([data-part='label']),
29
+ & > :where([role='group']) > :where([data-part='label']) {
30
+ color: var(--ghost-text-muted);
31
+ font-size: var(--ghost-type-size-sm);
32
+ font-weight: var(--ghost-type-weight-semibold);
33
+ padding: var(--ghost-space-inset-xs) var(--ghost-space-inset-sm);
34
+ user-select: none;
35
+ }
40
36
 
41
- :where(
42
- .ghost-theme .ghost-dropdown-menu-content [data-part='item'],
43
- .ghost-themed-scope .ghost-dropdown-menu-content [data-part='item'],
44
- .ghost-dropdown-menu-content[data-themed] [data-part='item'],
45
- .ghost-theme .ghost-dropdown-menu-content [data-part='checkbox-item'],
46
- .ghost-themed-scope
47
- .ghost-dropdown-menu-content
48
- [data-part='checkbox-item'],
49
- .ghost-dropdown-menu-content[data-themed] [data-part='checkbox-item'],
50
- .ghost-theme .ghost-dropdown-menu-content [data-part='radio-item'],
51
- .ghost-themed-scope .ghost-dropdown-menu-content [data-part='radio-item'],
52
- .ghost-dropdown-menu-content[data-themed] [data-part='radio-item']
53
- ) {
54
- align-items: center;
55
- border: var(--ghost-border-hairline-width) solid transparent;
56
- border-radius: var(--ghost-radius-sm);
57
- box-sizing: border-box;
58
- color: var(--ghost-surface-fg);
59
- cursor: default;
60
- display: flex;
61
- font: inherit;
62
- font-size: var(--ghost-control-size-sm-font);
63
- gap: var(--ghost-space-gap-sm);
64
- min-block-size: var(--ghost-control-size-sm-min);
65
- outline: none;
66
- padding-block: var(--ghost-control-size-sm-padding-block);
67
- padding-inline: var(--ghost-space-inset-sm);
68
- transition: background-color var(--ghost-motion-duration-fast)
69
- var(--ghost-motion-easing-standard);
70
- user-select: none;
71
- }
37
+ &
38
+ > :where(
39
+ [data-part='item'],
40
+ [data-part='checkbox-item'],
41
+ [data-part='radio-item'],
42
+ [data-part='sub-trigger']
43
+ ),
44
+ &
45
+ > :where([role='group'])
46
+ > :where(
47
+ [data-part='item'],
48
+ [data-part='checkbox-item'],
49
+ [data-part='radio-item'],
50
+ [data-part='sub-trigger']
51
+ ) {
52
+ align-items: center;
53
+ border: var(--ghost-border-hairline-width) solid transparent;
54
+ border-radius: var(--ghost-radius-sm);
55
+ box-sizing: border-box;
56
+ color: var(--ghost-surface-fg);
57
+ cursor: default;
58
+ display: flex;
59
+ font: inherit;
60
+ font-size: var(--ghost-control-size-sm-font);
61
+ gap: var(--ghost-space-gap-sm);
62
+ min-block-size: var(--ghost-control-size-sm-min);
63
+ outline: none;
64
+ padding-block: var(--ghost-control-size-sm-padding-block);
65
+ padding-inline: var(--ghost-space-inset-sm);
66
+ transition: background-color var(--ghost-motion-duration-fast)
67
+ var(--ghost-motion-easing-standard);
68
+ user-select: none;
72
69
 
73
- :where(
74
- .ghost-theme .ghost-dropdown-menu-content [data-part='item']:hover,
75
- .ghost-themed-scope .ghost-dropdown-menu-content [data-part='item']:hover,
76
- .ghost-dropdown-menu-content[data-themed] [data-part='item']:hover,
77
- .ghost-theme .ghost-dropdown-menu-content [data-part='checkbox-item']:hover,
78
- .ghost-themed-scope
79
- .ghost-dropdown-menu-content
80
- [data-part='checkbox-item']:hover,
81
- .ghost-dropdown-menu-content[data-themed] [data-part='checkbox-item']:hover,
82
- .ghost-theme .ghost-dropdown-menu-content [data-part='radio-item']:hover,
83
- .ghost-themed-scope
84
- .ghost-dropdown-menu-content
85
- [data-part='radio-item']:hover,
86
- .ghost-dropdown-menu-content[data-themed] [data-part='radio-item']:hover
87
- ) {
88
- background-color: var(--ghost-elevation-2-bg);
89
- }
70
+ &:where([data-part='sub-trigger']) {
71
+ background-color: transparent;
72
+ text-align: start;
73
+ }
90
74
 
91
- :where(
92
- .ghost-theme .ghost-dropdown-menu-content [data-part='item']:focus-visible,
93
- .ghost-themed-scope
94
- .ghost-dropdown-menu-content
95
- [data-part='item']:focus-visible,
96
- .ghost-dropdown-menu-content[data-themed] [data-part='item']:focus-visible,
97
- .ghost-theme
98
- .ghost-dropdown-menu-content
99
- [data-part='checkbox-item']:focus-visible,
100
- .ghost-themed-scope
101
- .ghost-dropdown-menu-content
102
- [data-part='checkbox-item']:focus-visible,
103
- .ghost-dropdown-menu-content[data-themed]
104
- [data-part='checkbox-item']:focus-visible,
105
- .ghost-theme
106
- .ghost-dropdown-menu-content
107
- [data-part='radio-item']:focus-visible,
108
- .ghost-themed-scope
109
- .ghost-dropdown-menu-content
110
- [data-part='radio-item']:focus-visible,
111
- .ghost-dropdown-menu-content[data-themed]
112
- [data-part='radio-item']:focus-visible
113
- ) {
114
- outline: var(--ghost-focus-ring-width) solid var(--ghost-focus-ring-color);
115
- outline-offset: var(--ghost-focus-ring-offset);
116
- }
75
+ &:where(:hover, [data-part='sub-trigger'][data-state='open']) {
76
+ background-color: var(--ghost-elevation-2-bg);
77
+ }
117
78
 
118
- :where(
119
- .ghost-theme .ghost-dropdown-menu-content [data-part='item'][data-disabled],
120
- .ghost-themed-scope
121
- .ghost-dropdown-menu-content
122
- [data-part='item'][data-disabled],
123
- .ghost-dropdown-menu-content[data-themed] [data-part='item'][data-disabled],
124
- .ghost-theme
125
- .ghost-dropdown-menu-content
126
- [data-part='checkbox-item'][data-disabled],
127
- .ghost-themed-scope
128
- .ghost-dropdown-menu-content
129
- [data-part='checkbox-item'][data-disabled],
130
- .ghost-dropdown-menu-content[data-themed]
131
- [data-part='checkbox-item'][data-disabled],
132
- .ghost-theme
133
- .ghost-dropdown-menu-content
134
- [data-part='radio-item'][data-disabled],
135
- .ghost-themed-scope
136
- .ghost-dropdown-menu-content
137
- [data-part='radio-item'][data-disabled],
138
- .ghost-dropdown-menu-content[data-themed]
139
- [data-part='radio-item'][data-disabled]
140
- ) {
141
- color: var(--ghost-text-muted);
142
- cursor: not-allowed;
143
- opacity: var(--ghost-action-disabled-opacity);
144
- }
79
+ &:where(:focus-visible) {
80
+ outline: var(--ghost-focus-ring-width) solid
81
+ var(--ghost-focus-ring-color);
82
+ outline-offset: var(--ghost-focus-ring-offset);
145
83
 
146
- :where(
147
- .ghost-theme .ghost-dropdown-menu-content [data-part='separator'],
148
- .ghost-themed-scope .ghost-dropdown-menu-content [data-part='separator'],
149
- .ghost-dropdown-menu-content[data-themed] [data-part='separator']
150
- ) {
151
- align-self: stretch;
152
- background-color: var(--ghost-border-default);
153
- block-size: var(--ghost-border-hairline-width);
154
- border: none;
155
- margin-block: var(--ghost-space-gap-xs);
156
- padding: 0;
157
- }
84
+ @media (forced-colors: active) {
85
+ outline-color: Highlight;
86
+ }
87
+ }
158
88
 
159
- :where(
160
- .ghost-theme .ghost-dropdown-menu-content[data-state='open'],
161
- .ghost-themed-scope .ghost-dropdown-menu-content[data-state='open'],
162
- .ghost-dropdown-menu-content[data-themed][data-state='open']
163
- ) {
164
- transition: opacity var(--ghost-motion-fade-duration)
165
- var(--ghost-motion-easing-standard);
89
+ &:where([data-disabled]) {
90
+ color: var(--ghost-text-muted);
91
+ cursor: not-allowed;
92
+ opacity: var(--ghost-action-disabled-opacity);
93
+ }
94
+ }
166
95
 
167
- @starting-style {
168
- opacity: 0;
96
+ & > :where([data-part='separator']),
97
+ & > :where([role='group']) > :where([data-part='separator']) {
98
+ align-self: stretch;
99
+ background-color: var(--ghost-border-default);
100
+ block-size: var(--ghost-border-hairline-width);
101
+ border: none;
102
+ margin-block: var(--ghost-space-gap-xs);
103
+ padding: 0;
104
+
105
+ @media (forced-colors: active) {
106
+ background-color: CanvasText;
107
+ }
169
108
  }
170
109
 
171
- @media (prefers-reduced-motion: no-preference) {
172
- transition:
173
- opacity var(--ghost-motion-duration-fast)
174
- var(--ghost-motion-enter-easing),
175
- scale var(--ghost-motion-duration-fast) var(--ghost-motion-enter-easing);
110
+ &:where([data-state='open']) {
111
+ transition: opacity var(--ghost-motion-fade-duration)
112
+ var(--ghost-motion-easing-standard);
176
113
 
177
114
  @starting-style {
178
- scale: 0.98;
115
+ opacity: 0;
116
+ }
117
+
118
+ @media (prefers-reduced-motion: no-preference) {
119
+ transition:
120
+ opacity var(--ghost-motion-duration-fast)
121
+ var(--ghost-motion-enter-easing),
122
+ scale var(--ghost-motion-duration-fast)
123
+ var(--ghost-motion-enter-easing);
124
+
125
+ @starting-style {
126
+ scale: 0.98;
127
+ }
179
128
  }
180
129
  }
181
- }
182
130
 
183
- @media (forced-colors: active) {
184
- :where(
185
- .ghost-theme .ghost-dropdown-menu-content,
186
- .ghost-themed-scope .ghost-dropdown-menu-content,
187
- .ghost-dropdown-menu-content[data-themed]
188
- ) {
131
+ @media (forced-colors: active) {
189
132
  background-color: Canvas;
190
133
  border-color: CanvasText;
191
134
  box-shadow: none;
192
135
  color: CanvasText;
193
136
  }
194
-
195
- :where(
196
- .ghost-theme
197
- .ghost-dropdown-menu-content
198
- [data-part='item']:focus-visible,
199
- .ghost-themed-scope
200
- .ghost-dropdown-menu-content
201
- [data-part='item']:focus-visible,
202
- .ghost-dropdown-menu-content[data-themed]
203
- [data-part='item']:focus-visible,
204
- .ghost-theme
205
- .ghost-dropdown-menu-content
206
- [data-part='checkbox-item']:focus-visible,
207
- .ghost-themed-scope
208
- .ghost-dropdown-menu-content
209
- [data-part='checkbox-item']:focus-visible,
210
- .ghost-dropdown-menu-content[data-themed]
211
- [data-part='checkbox-item']:focus-visible,
212
- .ghost-theme
213
- .ghost-dropdown-menu-content
214
- [data-part='radio-item']:focus-visible,
215
- .ghost-themed-scope
216
- .ghost-dropdown-menu-content
217
- [data-part='radio-item']:focus-visible,
218
- .ghost-dropdown-menu-content[data-themed]
219
- [data-part='radio-item']:focus-visible
220
- ) {
221
- outline-color: Highlight;
222
- }
223
-
224
- :where(
225
- .ghost-theme .ghost-dropdown-menu-content [data-part='separator'],
226
- .ghost-themed-scope .ghost-dropdown-menu-content [data-part='separator'],
227
- .ghost-dropdown-menu-content[data-themed] [data-part='separator']
228
- ) {
229
- background-color: CanvasText;
230
- }
231
137
  }
232
138
  }
@@ -49,6 +49,25 @@
49
49
  }
50
50
  }
51
51
 
52
+ /* Exit: reduced motion keeps scale at 1 and only fades. */
53
+ :where(
54
+ .ghost-theme .ghost-hover-card-content[data-state='closed'],
55
+ .ghost-themed-scope .ghost-hover-card-content[data-state='closed'],
56
+ .ghost-hover-card-content[data-themed][data-state='closed']
57
+ ) {
58
+ opacity: 0;
59
+ transition: opacity var(--ghost-motion-fade-duration)
60
+ var(--ghost-motion-easing-standard);
61
+
62
+ @media (prefers-reduced-motion: no-preference) {
63
+ scale: 0.98;
64
+ transition:
65
+ opacity var(--ghost-motion-exit-duration)
66
+ var(--ghost-motion-exit-easing),
67
+ scale var(--ghost-motion-exit-duration) var(--ghost-motion-exit-easing);
68
+ }
69
+ }
70
+
52
71
  @media (forced-colors: active) {
53
72
  :where(
54
73
  .ghost-theme .ghost-hover-card-content,