@unpunnyfuns/swatchbook-blocks 0.15.0 → 0.16.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.
package/dist/index.d.mts CHANGED
@@ -226,6 +226,66 @@ declare function ColorPalette({
226
226
  sortDir
227
227
  }: ColorPaletteProps): ReactElement;
228
228
  //#endregion
229
+ //#region src/ColorTable.d.ts
230
+ interface ColorTableProps {
231
+ /**
232
+ * Token-path filter. Defaults to every `$type: color` token. `"color.*"`
233
+ * scopes to the semantic layer; `"color.palette.blue.*"` to a single ramp.
234
+ */
235
+ filter?: string;
236
+ /** Override the table caption. */
237
+ caption?: string;
238
+ /**
239
+ * Sort order.
240
+ * - `'path'` (default) — lexicographic on the dot-path.
241
+ * - `'value'` — perceptual (oklch L → C → H). Ramps read light→dark, then
242
+ * warm→cool within each lightness band.
243
+ * - `'none'` — preserve project iteration order.
244
+ */
245
+ sortBy?: SortBy;
246
+ /** `'asc'` (default) or `'desc'`. */
247
+ sortDir?: SortDir;
248
+ /**
249
+ * Render a fuzzy-search input above the table (case-insensitive,
250
+ * single-char typo tolerance, out-of-order terms, matches across path +
251
+ * any format value). Defaults to `true`.
252
+ */
253
+ searchable?: boolean;
254
+ /**
255
+ * Called with the clicked row's dot-path. When set, the built-in
256
+ * `<TokenDetail>` drawer is suppressed — the consumer owns follow-up UI.
257
+ */
258
+ onSelect?(path: string): void;
259
+ /**
260
+ * Map from a display label to a suffix matched against each token's
261
+ * trailing path segment. A row whose leaf matches one of the suffixes
262
+ * gets the corresponding label rendered as a pill after the token name.
263
+ *
264
+ * Accepts both DTCG-idiomatic and Backmarket-style conventions:
265
+ * - **Dot segment** (`color.bg.hi.disabled`): the last dot-segment equals
266
+ * the suffix exactly (`suffix === 'disabled'`).
267
+ * - **Hyphen tail** (`color.bg.hi-d`): the last dot-segment ends in
268
+ * `-<suffix>` (`suffix === 'd'`).
269
+ *
270
+ * Longest-suffix-wins: `{ hover: 'h', hoverDark: 'h-dark' }` picks
271
+ * `hoverDark` for a path ending in `-h-dark`. The hyphen-tail form
272
+ * requires an actual hyphen boundary — suffix `0` does not match
273
+ * `neutral-900`. Tokens that don't match any suffix render with no pill.
274
+ *
275
+ * Empty map (default) → no pills; the block behaves exactly as before.
276
+ */
277
+ variants?: Record<string, string>;
278
+ }
279
+ declare function ColorTable({
280
+ filter,
281
+ caption,
282
+ sortBy,
283
+ sortDir,
284
+ searchable,
285
+ onSelect,
286
+ variants
287
+ }: ColorTableProps): ReactElement;
288
+ //#endregion
229
289
  //#region src/Diagnostics.d.ts
230
290
  interface DiagnosticsProps {
231
291
  /** Override the section caption. Defaults to a severity summary. */
@@ -705,5 +765,5 @@ declare function TypographyScale({
705
765
  sortDir
706
766
  }: TypographyScaleProps): ReactElement;
707
767
  //#endregion
708
- export { AliasChain, type AliasChainProps, AliasedBy, type AliasedByProps, AxesContext, AxisVariance, type AxisVarianceProps, BorderPreview, type BorderPreviewProps, BorderSample, type BorderSampleProps, COLOR_FORMATS, type ColorFormat, ColorFormatContext, ColorPalette, type ColorPaletteProps, CompositeBreakdown, type CompositeBreakdownProps, CompositePreview, type CompositePreviewProps, ConsumerOutput, type ConsumerOutputProps, Diagnostics, type DiagnosticsProps, DimensionBar, type DimensionBarProps, type DimensionKind, DimensionScale, type DimensionScaleProps, FontFamilySample, type FontFamilySampleProps, FontWeightScale, type FontWeightScaleProps, type FormatColorResult, GradientPalette, type GradientPaletteProps, MotionPreview, type MotionPreviewProps, MotionSample, type MotionSampleProps, type MotionSpeed, type NormalizedColor, type ProjectSnapshot, ShadowPreview, type ShadowPreviewProps, ShadowSample, type ShadowSampleProps, StrokeStyleSample, type StrokeStyleSampleProps, SwatchbookContext, SwatchbookProvider, type SwatchbookProviderProps, ThemeContext, TokenDetail, type TokenDetailProps, TokenHeader, type TokenHeaderProps, TokenNavigator, type TokenNavigatorProps, TokenTable, type TokenTableProps, TokenUsageSnippet, type TokenUsageSnippetProps, TypographyScale, type TypographyScaleProps, type VirtualAxisShape as VirtualAxis, type VirtualAxisShape, type VirtualDiagnosticShape as VirtualDiagnostic, type VirtualDiagnosticShape, type VirtualPresetShape as VirtualPreset, type VirtualPresetShape, type VirtualThemeShape as VirtualTheme, type VirtualThemeShape, type VirtualTokenShape as VirtualToken, type VirtualTokenShape, formatColor, useActiveAxes, useActiveTheme, useColorFormat, useOptionalSwatchbookData, useSwatchbookData };
768
+ export { AliasChain, type AliasChainProps, AliasedBy, type AliasedByProps, AxesContext, AxisVariance, type AxisVarianceProps, BorderPreview, type BorderPreviewProps, BorderSample, type BorderSampleProps, COLOR_FORMATS, type ColorFormat, ColorFormatContext, ColorPalette, type ColorPaletteProps, ColorTable, type ColorTableProps, CompositeBreakdown, type CompositeBreakdownProps, CompositePreview, type CompositePreviewProps, ConsumerOutput, type ConsumerOutputProps, Diagnostics, type DiagnosticsProps, DimensionBar, type DimensionBarProps, type DimensionKind, DimensionScale, type DimensionScaleProps, FontFamilySample, type FontFamilySampleProps, FontWeightScale, type FontWeightScaleProps, type FormatColorResult, GradientPalette, type GradientPaletteProps, MotionPreview, type MotionPreviewProps, MotionSample, type MotionSampleProps, type MotionSpeed, type NormalizedColor, type ProjectSnapshot, ShadowPreview, type ShadowPreviewProps, ShadowSample, type ShadowSampleProps, StrokeStyleSample, type StrokeStyleSampleProps, SwatchbookContext, SwatchbookProvider, type SwatchbookProviderProps, ThemeContext, TokenDetail, type TokenDetailProps, TokenHeader, type TokenHeaderProps, TokenNavigator, type TokenNavigatorProps, TokenTable, type TokenTableProps, TokenUsageSnippet, type TokenUsageSnippetProps, TypographyScale, type TypographyScaleProps, type VirtualAxisShape as VirtualAxis, type VirtualAxisShape, type VirtualDiagnosticShape as VirtualDiagnostic, type VirtualDiagnosticShape, type VirtualPresetShape as VirtualPreset, type VirtualPresetShape, type VirtualThemeShape as VirtualTheme, type VirtualThemeShape, type VirtualTokenShape as VirtualToken, type VirtualTokenShape, formatColor, useActiveAxes, useActiveTheme, useColorFormat, useOptionalSwatchbookData, useSwatchbookData };
709
769
  //# sourceMappingURL=index.d.mts.map