@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
@@ -1,12 +1,12 @@
1
1
  /*
2
- * Themed GhostMenubar surface, triggers, and menu items. Visual values use
3
- * semantic --ghost-* tokens with no component-specific literals.
2
+ * Themed menubar 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-menubar-content,
8
- .ghost-themed-scope .ghost-menubar-content,
9
- .ghost-menubar-content[data-themed]
7
+ :is(.ghost-theme, .ghost-themed-scope)
8
+ :is(.ghost-menubar-content, [data-part='sub-content']),
9
+ :is(.ghost-menubar-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,194 +24,116 @@
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-menubar-content [data-part='label'],
31
- .ghost-themed-scope .ghost-menubar-content [data-part='label'],
32
- .ghost-menubar-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
- }
40
-
41
- :where(
42
- .ghost-theme .ghost-menubar-content [data-part='item'],
43
- .ghost-themed-scope .ghost-menubar-content [data-part='item'],
44
- .ghost-menubar-content[data-themed] [data-part='item'],
45
- .ghost-theme .ghost-menubar-content [data-part='checkbox-item'],
46
- .ghost-themed-scope .ghost-menubar-content [data-part='checkbox-item'],
47
- .ghost-menubar-content[data-themed] [data-part='checkbox-item'],
48
- .ghost-theme .ghost-menubar-content [data-part='radio-item'],
49
- .ghost-themed-scope .ghost-menubar-content [data-part='radio-item'],
50
- .ghost-menubar-content[data-themed] [data-part='radio-item']
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;
69
- }
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
+ }
70
36
 
71
- :where(
72
- .ghost-theme .ghost-menubar-content [data-part='item']:hover,
73
- .ghost-themed-scope .ghost-menubar-content [data-part='item']:hover,
74
- .ghost-menubar-content[data-themed] [data-part='item']:hover,
75
- .ghost-theme .ghost-menubar-content [data-part='checkbox-item']:hover,
76
- .ghost-themed-scope
77
- .ghost-menubar-content
78
- [data-part='checkbox-item']:hover,
79
- .ghost-menubar-content[data-themed] [data-part='checkbox-item']:hover,
80
- .ghost-theme .ghost-menubar-content [data-part='radio-item']:hover,
81
- .ghost-themed-scope .ghost-menubar-content [data-part='radio-item']:hover,
82
- .ghost-menubar-content[data-themed] [data-part='radio-item']:hover
83
- ) {
84
- background-color: var(--ghost-elevation-2-bg);
85
- }
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;
69
+
70
+ &:where([data-part='sub-trigger']) {
71
+ background-color: transparent;
72
+ text-align: start;
73
+ }
86
74
 
87
- :where(
88
- .ghost-theme .ghost-menubar-content [data-part='item']:focus-visible,
89
- .ghost-themed-scope .ghost-menubar-content [data-part='item']:focus-visible,
90
- .ghost-menubar-content[data-themed] [data-part='item']:focus-visible,
91
- .ghost-theme
92
- .ghost-menubar-content
93
- [data-part='checkbox-item']:focus-visible,
94
- .ghost-themed-scope
95
- .ghost-menubar-content
96
- [data-part='checkbox-item']:focus-visible,
97
- .ghost-menubar-content[data-themed]
98
- [data-part='checkbox-item']:focus-visible,
99
- .ghost-theme .ghost-menubar-content [data-part='radio-item']:focus-visible,
100
- .ghost-themed-scope
101
- .ghost-menubar-content
102
- [data-part='radio-item']:focus-visible,
103
- .ghost-menubar-content[data-themed] [data-part='radio-item']:focus-visible
104
- ) {
105
- outline: var(--ghost-focus-ring-width) solid var(--ghost-focus-ring-color);
106
- outline-offset: var(--ghost-focus-ring-offset);
107
- }
75
+ &:where(:hover, [data-part='sub-trigger'][data-state='open']) {
76
+ background-color: var(--ghost-elevation-2-bg);
77
+ }
108
78
 
109
- :where(
110
- .ghost-theme .ghost-menubar-content [data-part='item'][data-disabled],
111
- .ghost-themed-scope
112
- .ghost-menubar-content
113
- [data-part='item'][data-disabled],
114
- .ghost-menubar-content[data-themed] [data-part='item'][data-disabled],
115
- .ghost-theme
116
- .ghost-menubar-content
117
- [data-part='checkbox-item'][data-disabled],
118
- .ghost-themed-scope
119
- .ghost-menubar-content
120
- [data-part='checkbox-item'][data-disabled],
121
- .ghost-menubar-content[data-themed]
122
- [data-part='checkbox-item'][data-disabled],
123
- .ghost-theme .ghost-menubar-content [data-part='radio-item'][data-disabled],
124
- .ghost-themed-scope
125
- .ghost-menubar-content
126
- [data-part='radio-item'][data-disabled],
127
- .ghost-menubar-content[data-themed] [data-part='radio-item'][data-disabled]
128
- ) {
129
- color: var(--ghost-text-muted);
130
- cursor: not-allowed;
131
- opacity: var(--ghost-action-disabled-opacity);
132
- }
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);
133
83
 
134
- :where(
135
- .ghost-theme .ghost-menubar-content [data-part='separator'],
136
- .ghost-themed-scope .ghost-menubar-content [data-part='separator'],
137
- .ghost-menubar-content[data-themed] [data-part='separator']
138
- ) {
139
- align-self: stretch;
140
- background-color: var(--ghost-border-default);
141
- block-size: var(--ghost-border-hairline-width);
142
- border: none;
143
- margin-block: var(--ghost-space-gap-xs);
144
- padding: 0;
145
- }
84
+ @media (forced-colors: active) {
85
+ outline-color: Highlight;
86
+ }
87
+ }
146
88
 
147
- :where(
148
- .ghost-theme .ghost-menubar-content[data-state='open'],
149
- .ghost-themed-scope .ghost-menubar-content[data-state='open'],
150
- .ghost-menubar-content[data-themed][data-state='open']
151
- ) {
152
- transition: opacity var(--ghost-motion-fade-duration)
153
- 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
+ }
154
95
 
155
- @starting-style {
156
- 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
+ }
157
108
  }
158
109
 
159
- @media (prefers-reduced-motion: no-preference) {
160
- transition:
161
- opacity var(--ghost-motion-duration-fast)
162
- var(--ghost-motion-enter-easing),
163
- 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);
164
113
 
165
114
  @starting-style {
166
- 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
+ }
167
128
  }
168
129
  }
169
- }
170
130
 
171
- @media (forced-colors: active) {
172
- :where(
173
- .ghost-theme .ghost-menubar-content,
174
- .ghost-themed-scope .ghost-menubar-content,
175
- .ghost-menubar-content[data-themed]
176
- ) {
131
+ @media (forced-colors: active) {
177
132
  background-color: Canvas;
178
133
  border-color: CanvasText;
179
134
  box-shadow: none;
180
135
  color: CanvasText;
181
136
  }
182
-
183
- :where(
184
- .ghost-theme .ghost-menubar-content [data-part='item']:focus-visible,
185
- .ghost-themed-scope
186
- .ghost-menubar-content
187
- [data-part='item']:focus-visible,
188
- .ghost-menubar-content[data-themed] [data-part='item']:focus-visible,
189
- .ghost-theme
190
- .ghost-menubar-content
191
- [data-part='checkbox-item']:focus-visible,
192
- .ghost-themed-scope
193
- .ghost-menubar-content
194
- [data-part='checkbox-item']:focus-visible,
195
- .ghost-menubar-content[data-themed]
196
- [data-part='checkbox-item']:focus-visible,
197
- .ghost-theme
198
- .ghost-menubar-content
199
- [data-part='radio-item']:focus-visible,
200
- .ghost-themed-scope
201
- .ghost-menubar-content
202
- [data-part='radio-item']:focus-visible,
203
- .ghost-menubar-content[data-themed] [data-part='radio-item']:focus-visible
204
- ) {
205
- outline-color: Highlight;
206
- }
207
-
208
- :where(
209
- .ghost-theme .ghost-menubar-content [data-part='separator'],
210
- .ghost-themed-scope .ghost-menubar-content [data-part='separator'],
211
- .ghost-menubar-content[data-themed] [data-part='separator']
212
- ) {
213
- background-color: CanvasText;
214
- }
215
137
  }
216
138
 
217
139
  :where(.ghost-theme .ghost-menubar, .ghost-themed-scope .ghost-menubar) {
@@ -220,23 +142,20 @@
220
142
  flex-wrap: wrap;
221
143
  font-family: var(--ghost-type-family-sans);
222
144
  gap: var(--ghost-space-gap-xs);
223
- }
224
-
225
- :where(
226
- .ghost-theme .ghost-menubar [data-part='trigger'],
227
- .ghost-themed-scope .ghost-menubar [data-part='trigger']
228
- ) {
229
- border-radius: var(--ghost-radius-md);
230
- color: var(--ghost-surface-fg);
231
- font: inherit;
232
- padding: var(--ghost-space-inset-sm) var(--ghost-space-inset-md);
233
- }
234
145
 
235
- :where(
236
- .ghost-theme .ghost-menubar [data-part='trigger']:focus-visible,
237
- .ghost-themed-scope .ghost-menubar [data-part='trigger']:focus-visible
238
- ) {
239
- outline: var(--ghost-focus-ring-width) solid var(--ghost-focus-ring-color);
240
- outline-offset: var(--ghost-focus-ring-offset);
146
+ /* A trigger rendered as GhostButton sits inside the button's theme scope. */
147
+ & > :where([data-part='trigger']),
148
+ & > :where(.ghost-themed-scope) > :where([data-part='trigger']) {
149
+ border-radius: var(--ghost-radius-md);
150
+ color: var(--ghost-surface-fg);
151
+ font: inherit;
152
+ padding: var(--ghost-space-inset-sm) var(--ghost-space-inset-md);
153
+
154
+ &:where(:focus-visible) {
155
+ outline: var(--ghost-focus-ring-width) solid
156
+ var(--ghost-focus-ring-color);
157
+ outline-offset: var(--ghost-focus-ring-offset);
158
+ }
159
+ }
241
160
  }
242
161
  }
@@ -59,6 +59,25 @@
59
59
  }
60
60
  }
61
61
 
62
+ /* Exit: reduced motion keeps scale at 1 and only fades. */
63
+ :where(
64
+ .ghost-theme .ghost-popover-content[data-state='closed'],
65
+ .ghost-themed-scope .ghost-popover-content[data-state='closed'],
66
+ .ghost-popover-content[data-themed][data-state='closed']
67
+ ) {
68
+ opacity: 0;
69
+ transition: opacity var(--ghost-motion-fade-duration)
70
+ var(--ghost-motion-easing-standard);
71
+
72
+ @media (prefers-reduced-motion: no-preference) {
73
+ scale: 0.98;
74
+ transition:
75
+ opacity var(--ghost-motion-exit-duration)
76
+ var(--ghost-motion-exit-easing),
77
+ scale var(--ghost-motion-exit-duration) var(--ghost-motion-exit-easing);
78
+ }
79
+ }
80
+
62
81
  @media (forced-colors: active) {
63
82
  :where(
64
83
  .ghost-theme .ghost-popover-content,
@@ -24,9 +24,14 @@
24
24
  }
25
25
 
26
26
  :where(
27
- .ghost-theme .ghost-progress [data-part='indicator'],
28
- .ghost-themed-scope .ghost-progress [data-part='indicator']
27
+ .ghost-theme .ghost-progress > [data-part='indicator'],
28
+ .ghost-themed-scope .ghost-progress > [data-part='indicator']
29
29
  ) {
30
+ --_ghost-progress-update-baseline: var(
31
+ --_ghost-progress-intensity-baseline,
32
+ 1
33
+ );
34
+
30
35
  background-color: var(--_ghost-progress-fill);
31
36
  block-size: 100%;
32
37
  border-radius: inherit;
@@ -1,7 +1,8 @@
1
1
  /*
2
2
  * Themed GhostScrollArea. Native scrolling only; no custom scrollbar parts.
3
- * Logical sizing is left to the consumer; this recipe adds containment and
4
- * platform scrollbar affordances under --ghost-* tokens.
3
+ * Logical sizing is left to the consumer; this recipe adds containment,
4
+ * scrollbar clearance, and platform scrollbar affordances under --ghost-*
5
+ * tokens.
5
6
  */
6
7
  @layer ghostvue-theme {
7
8
  :where(.ghost-theme .ghost-scroll-area, .ghost-scroll-area[data-themed]) {
@@ -10,6 +11,46 @@
10
11
  -webkit-overflow-scrolling: touch;
11
12
  }
12
13
 
14
+ /*
15
+ * Scrollbar clearance. Overlay scrollbars (macOS, iOS, Android, Chromium
16
+ * overlay mode) draw over the scrollport and ignore scrollbar-gutter, so
17
+ * content needs its own room on the edge where each enabled axis's
18
+ * scrollbar sits: inline-end for vertical scrolling, block-end for
19
+ * horizontal scrolling. Keyed on data-orientation rather than
20
+ * data-overflow so the padding is present before content overflows and
21
+ * no layout shift happens when it starts to. Classic scrollbars take their
22
+ * own track beside this padding, so content clears them too.
23
+ * Logical properties keep the clearance on the scrollbar side in RTL.
24
+ */
25
+ :where(
26
+ .ghost-theme
27
+ .ghost-scroll-area:is(
28
+ [data-orientation='vertical'],
29
+ [data-orientation='both']
30
+ ),
31
+ .ghost-scroll-area[data-themed]:is(
32
+ [data-orientation='vertical'],
33
+ [data-orientation='both']
34
+ )
35
+ ) {
36
+ padding-inline-end: var(--ghost-space-inset-scrollbar);
37
+ }
38
+
39
+ :where(
40
+ .ghost-theme
41
+ .ghost-scroll-area:is(
42
+ [data-orientation='horizontal'],
43
+ [data-orientation='both']
44
+ ),
45
+ .ghost-scroll-area[data-themed]:is(
46
+ [data-orientation='horizontal'],
47
+ [data-orientation='both']
48
+ )
49
+ ) {
50
+ padding-block-end: var(--ghost-space-inset-scrollbar);
51
+ }
52
+
53
+ /* Classic scrollbars: reserve the track up front when it always shows. */
13
54
  :where(
14
55
  .ghost-theme .ghost-scroll-area[data-type='scroll'],
15
56
  .ghost-scroll-area[data-themed][data-type='scroll']
@@ -1,6 +1,22 @@
1
1
  /*
2
2
  * Themed GhostSegmentedControl with equal-width segments and a sliding
3
3
  * indicator positioned from CSS variables (no layout reads).
4
+ *
5
+ * The indicator assumes every segment is exactly 1/n of the track, so the
6
+ * track is a grid of equal `fr` columns rather than a row of `flex: 1 1 0`
7
+ * items. A shrink-to-fit flex container sizes itself to the *sum* of the
8
+ * labels and then splits that sum evenly, leaving too little room for the
9
+ * longest labels. Grid resolves `1fr` from the widest label when the control
10
+ * sizes to content, so every segment fits its label and matches the indicator.
11
+ *
12
+ * Supported sizing: the default inline grid sizes to the widest label. To span
13
+ * a container, set `display: grid` (or a width) on the root. Consumers that
14
+ * override the root to `display: flex` keep equal segments through the items'
15
+ * `flex: 1 1 0` fallback, which grid layout ignores. The fallback works when
16
+ * the flex root fills its container or has an explicit width. Vertical flex
17
+ * roots keep equal rows only while labels share one height: a column flex
18
+ * root has no definite height to split, and `min-height: 0` would collapse
19
+ * auto-height roots, so vertical wrapping labels need the default grid.
4
20
  */
5
21
  @layer ghostvue-theme {
6
22
  :where(
@@ -9,7 +25,14 @@
9
25
  .ghost-segmented-control[data-themed]
10
26
  ) {
11
27
  box-sizing: border-box;
12
- display: inline-flex;
28
+ display: inline-grid;
29
+ grid-auto-flow: column;
30
+ /*
31
+ * `minmax(0, 1fr)` keeps the columns equal even when a consumer constrains
32
+ * the control below its content width; a bare `1fr` would let one track
33
+ * grow to its min-content width and break the indicator's 1/n geometry.
34
+ */
35
+ grid-auto-columns: minmax(0, 1fr);
13
36
  position: relative;
14
37
  font-family: var(--ghost-type-family-sans);
15
38
  font-feature-settings: var(--ghost-type-feature-default);
@@ -27,8 +50,14 @@
27
50
  .ghost-themed-scope .ghost-segmented-control[aria-orientation='vertical'],
28
51
  .ghost-segmented-control[data-themed][aria-orientation='vertical']
29
52
  ) {
53
+ grid-auto-flow: row;
54
+ grid-auto-columns: auto;
55
+ /*
56
+ * Flex fallback axis for roots overridden to `display: flex`. Rows follow
57
+ * label heights there (no `min-height: 0`; see the header comment).
58
+ */
30
59
  flex-direction: column;
31
- align-items: stretch;
60
+ grid-auto-rows: minmax(0, 1fr);
32
61
  width: max-content;
33
62
  }
34
63
 
@@ -114,6 +143,11 @@
114
143
  ) {
115
144
  position: relative;
116
145
  z-index: 1;
146
+ /*
147
+ * Ignored in the default grid track. Kept as the equal-width fallback for
148
+ * roots overridden to `display: flex`; `min-width: 0` stops a long label's
149
+ * min-content size from widening one segment past its 1/n share.
150
+ */
117
151
  flex: 1 1 0;
118
152
  min-width: 0;
119
153
  background: transparent;
@@ -123,6 +157,11 @@
123
157
  cursor: pointer;
124
158
  font: inherit;
125
159
  padding: var(--ghost-space-inset-sm) var(--ghost-space-inset-md);
160
+ /* Buttons center by default; non-button `as` hosts should match. */
161
+ text-align: center;
162
+ /* Wrap labels within constrained tracks so they stay over the indicator. */
163
+ white-space: normal;
164
+ overflow-wrap: anywhere;
126
165
  }
127
166
 
128
167
  :where(
@@ -139,7 +178,14 @@
139
178
  .ghost-segmented-control-item[data-themed]:focus-visible
140
179
  ) {
141
180
  outline: var(--ghost-focus-ring-width) solid var(--ghost-focus-ring-color);
142
- outline-offset: var(--ghost-focus-ring-offset);
181
+ /*
182
+ * Inset ring: segments sit only a few pixels inside the track, so the
183
+ * usual outward offset doubled up with the indicator's border and spilled
184
+ * past the control's edge. Drawn over the segment's own edge, the ring
185
+ * replaces the indicator border instead of stacking on it, and stays
186
+ * inside the control while leaving the label's padding clear.
187
+ */
188
+ outline-offset: calc(-1 * var(--ghost-focus-ring-width));
143
189
  }
144
190
 
145
191
  :where(
@@ -174,5 +220,18 @@
174
220
  ) {
175
221
  border-color: Highlight;
176
222
  }
223
+
224
+ /*
225
+ * Forced colors paint every segment's transparent border as ButtonBorder,
226
+ * so an inset ring would land on that border and barely change. Move the
227
+ * ring back outside the segment, where it stays distinguishable.
228
+ */
229
+ :where(
230
+ .ghost-theme .ghost-segmented-control-item:focus-visible,
231
+ .ghost-themed-scope .ghost-segmented-control-item:focus-visible,
232
+ .ghost-segmented-control-item[data-themed]:focus-visible
233
+ ) {
234
+ outline-offset: var(--ghost-focus-ring-offset);
235
+ }
177
236
  }
178
237
  }
@@ -0,0 +1,120 @@
1
+ @layer ghostvue-theme {
2
+ :where(.ghost-tags-input[data-themed]) {
3
+ background: var(--ghost-surface-bg);
4
+ border: var(--ghost-border-hairline-width) solid var(--ghost-border-default);
5
+ border-radius: var(--ghost-action-radius);
6
+ color: var(--ghost-text-default);
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ align-items: center;
10
+ gap: var(--ghost-space-gap-xs);
11
+ padding: var(--ghost-space-gap-xs);
12
+ font-family: var(--ghost-type-family-sans);
13
+ min-inline-size: 0;
14
+ }
15
+
16
+ :where(.ghost-tags-input[data-themed][data-invalid]) {
17
+ border-color: var(--ghost-border-danger);
18
+ }
19
+
20
+ :where(.ghost-tags-input[data-themed][data-readonly]),
21
+ :where(.ghost-tags-input[data-themed][data-disabled]),
22
+ :where(.ghost-tags-input[data-themed]:has(> [data-part='input']:disabled)) {
23
+ background: var(--ghost-surface-muted-bg);
24
+ }
25
+
26
+ :where(.ghost-tags-input[data-themed]) > :where([data-part='list']) {
27
+ display: flex;
28
+ flex-wrap: wrap;
29
+ gap: var(--ghost-space-gap-xs);
30
+ margin: 0;
31
+ padding: 0;
32
+ list-style: none;
33
+ min-inline-size: 0;
34
+ max-inline-size: 100%;
35
+ }
36
+
37
+ :where(.ghost-tags-input[data-themed])
38
+ > :where([data-part='list'])
39
+ > :where([data-part='tag']) {
40
+ display: inline-flex;
41
+ align-items: center;
42
+ gap: var(--ghost-space-gap-xs);
43
+ min-inline-size: 0;
44
+ max-inline-size: 100%;
45
+ overflow-wrap: anywhere;
46
+ padding-inline: var(--ghost-space-inset-xs);
47
+ border-radius: var(--ghost-action-radius);
48
+ color: var(--ghost-action-neutral-fg);
49
+ background: var(--ghost-action-neutral-bg);
50
+ }
51
+
52
+ :where(.ghost-tags-input[data-themed])
53
+ > :where([data-part='list'])
54
+ > :where([data-part='tag'])
55
+ > :where([data-part='remove']) {
56
+ background: transparent;
57
+ border: 0;
58
+ border-radius: var(--ghost-action-radius);
59
+ color: inherit;
60
+ cursor: pointer;
61
+ flex: none;
62
+ font: inherit;
63
+ min-block-size: var(--ghost-control-size-sm-min);
64
+ min-inline-size: var(--ghost-control-size-sm-min);
65
+ padding: 0;
66
+ }
67
+
68
+ :where(.ghost-tags-input[data-themed])
69
+ > :where([data-part='list'])
70
+ > :where([data-part='tag'])
71
+ > :where([data-part='remove']:hover:not(:disabled)) {
72
+ background: var(--ghost-action-neutral-bg-hover);
73
+ }
74
+
75
+ :where(.ghost-tags-input[data-themed])
76
+ > :where([data-part='list'])
77
+ > :where([data-part='tag'])
78
+ > :where([data-part='remove']:disabled) {
79
+ cursor: not-allowed;
80
+ }
81
+
82
+ :where(.ghost-tags-input[data-themed]) > :where([data-part='input']) {
83
+ background: transparent;
84
+ border: 0;
85
+ border-radius: var(--ghost-action-radius);
86
+ color: inherit;
87
+ flex: 1 1 8ch;
88
+ font: inherit;
89
+ min-block-size: var(--ghost-control-size-md-min);
90
+ min-inline-size: 0;
91
+ padding-inline: var(--ghost-space-inset-xs);
92
+ }
93
+
94
+ :where(.ghost-tags-input[data-themed])
95
+ > :where([data-part='input']::placeholder) {
96
+ color: var(--ghost-text-muted);
97
+ opacity: 1;
98
+ }
99
+
100
+ :where(.ghost-tags-input[data-themed])
101
+ > :where([data-part='input']:focus-visible),
102
+ :where(.ghost-tags-input[data-themed])
103
+ > :where([data-part='list'])
104
+ > :where([data-part='tag'])
105
+ > :where([data-part='remove']:focus-visible) {
106
+ outline: var(--ghost-focus-ring-width) solid var(--ghost-focus-ring-color);
107
+ outline-offset: var(--ghost-focus-ring-offset);
108
+ }
109
+
110
+ @media (forced-colors: active) {
111
+ :where(.ghost-tags-input[data-themed])
112
+ > :where([data-part='input']:focus-visible),
113
+ :where(.ghost-tags-input[data-themed])
114
+ > :where([data-part='list'])
115
+ > :where([data-part='tag'])
116
+ > :where([data-part='remove']:focus-visible) {
117
+ outline-color: Highlight;
118
+ }
119
+ }
120
+ }