@hjmds/design-contracts 1.33.2 → 1.34.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.
@@ -1,3 +1,4 @@
1
+ import { solidAccentColor, themeColor } from "./color-references.js";
1
2
  import { collectionItemContract, fieldFrameContract, floatingSurfaceContract, focusIndicatorContract, formSupportContract, } from "./component-contracts.js";
2
3
  import { backdrop, breakpoint, control, glyph, layer, largeTextThreshold, layout, fontWeight, motion, motionPreset, opacity, radius, spacing, stroke, typography, } from "./foundations.js";
3
4
  import { buttonRecipe } from "./base-recipes.js";
@@ -137,7 +138,7 @@ export const selectionGroupRecipe = {
137
138
  states: { disabledOpacity: opacity.disabled },
138
139
  };
139
140
  export const badgeRecipe = {
140
- slots: ["root", "icon", "label"],
141
+ slots: ["root", "icon", "label", "trailing"],
141
142
  defaults: { tone: "neutral", size: "medium", variant: "filled" },
142
143
  variants: {
143
144
  filled: {
@@ -149,68 +150,22 @@ export const badgeRecipe = {
149
150
  borderFallback: semanticColors.border.default,
150
151
  },
151
152
  },
153
+ // 2026-10-18: match the Today Baseball status plate reference: solid fill,
154
+ // white copy and compact rounded corners. Outline retains its tone-colored copy.
152
155
  tones: {
153
- // A canvas-colored plate is invisible on the canvas, so neutral and brand badges read as plain text beside a
154
- // tinted success badge (2026-10-17 review E3). The plate stays white (canvas) and the neutral border draws it.
155
- neutral: {
156
- content: semanticColors.content.secondary,
157
- outlineContent: semanticColors.content.secondary,
158
- background: semanticColors.canvas,
159
- border: semanticColors.border.default,
160
- },
161
- strong: {
162
- content: semanticColors.content.inverse,
163
- outlineContent: semanticColors.content.primary,
164
- background: semanticColors.content.primary,
165
- border: null,
166
- },
167
- brand: {
168
- content: semanticColors.content.brand,
169
- outlineContent: semanticColors.content.brand,
170
- // The brand tint now means "selected" everywhere (see
171
- // `selectionControlRecipe`/`segmentedControlRecipe`), so a badge that
172
- // only labels something — a season, a grade, a question number —
173
- // cannot wear it: rows of static badges started reading as a filter
174
- // with one option switched on. The plate goes neutral and the brand
175
- // stays in the copy.
176
- background: semanticColors.canvas,
177
- border: semanticColors.border.default,
178
- },
179
- info: {
180
- content: semanticColors.feedback.info.foreground,
181
- outlineContent: semanticColors.feedback.info.foreground,
182
- background: semanticColors.canvas,
183
- border: semanticColors.feedback.info.border,
184
- },
185
- success: {
186
- content: semanticColors.feedback.success.foreground,
187
- outlineContent: semanticColors.feedback.success.foreground,
188
- background: semanticColors.feedback.success.badgeBackground,
189
- border: semanticColors.feedback.success.border,
190
- },
191
- warning: {
192
- content: semanticColors.feedback.warning.foreground,
193
- outlineContent: semanticColors.feedback.warning.foreground,
194
- background: semanticColors.feedback.warning.badgeBackground,
195
- border: semanticColors.feedback.warning.border,
196
- },
197
- attention: {
198
- content: semanticColors.feedback.attention.foreground,
199
- outlineContent: semanticColors.feedback.attention.foreground,
200
- background: semanticColors.feedback.attention.badgeBackground,
201
- border: semanticColors.feedback.attention.border,
202
- },
203
- danger: {
204
- content: semanticColors.feedback.danger.foreground,
205
- outlineContent: semanticColors.feedback.danger.foreground,
206
- background: semanticColors.feedback.danger.badgeBackground,
207
- border: semanticColors.feedback.danger.border,
208
- },
156
+ neutral: { content: semanticColors.content.inverse, outlineContent: semanticColors.content.secondary, background: themeColor("neutralFill"), border: null },
157
+ strong: { content: semanticColors.content.inverse, outlineContent: semanticColors.content.primary, background: themeColor("strongFill"), border: null },
158
+ brand: { content: semanticColors.content.inverse, outlineContent: semanticColors.content.brand, background: semanticColors.action.brand.background, border: null },
159
+ info: { content: semanticColors.content.inverse, outlineContent: semanticColors.feedback.info.foreground, background: solidAccentColor("info"), border: semanticColors.feedback.info.border },
160
+ success: { content: semanticColors.content.inverse, outlineContent: semanticColors.feedback.success.foreground, background: solidAccentColor("success"), border: semanticColors.feedback.success.border },
161
+ warning: { content: semanticColors.content.inverse, outlineContent: semanticColors.feedback.warning.foreground, background: solidAccentColor("warning"), border: semanticColors.feedback.warning.border },
162
+ attention: { content: semanticColors.content.inverse, outlineContent: semanticColors.feedback.attention.foreground, background: solidAccentColor("attention"), border: semanticColors.feedback.attention.border },
163
+ danger: { content: semanticColors.action.danger.content, outlineContent: semanticColors.content.danger, background: semanticColors.action.danger.background, border: semanticColors.feedback.danger.border },
209
164
  },
210
165
  sizes: {
211
166
  small: {
212
167
  minHeight: 20,
213
- paddingHorizontal: spacing.xxs,
168
+ paddingHorizontal: spacing.xs,
214
169
  gap: spacing.xxs,
215
170
  textVariant: "caption",
216
171
  },
@@ -221,9 +176,9 @@ export const badgeRecipe = {
221
176
  textVariant: "caption",
222
177
  },
223
178
  },
224
- radius: "full",
179
+ radius: "sm",
225
180
  borderWidth: stroke.default,
226
- fontWeight: fontWeight.medium,
181
+ fontWeight: fontWeight.bold,
227
182
  };
228
183
  /** Search is a field specialization with stable affordance and clear targets. */
229
184
  export const searchFieldRecipe = {