@unpunnyfuns/swatchbook-blocks 0.15.0 → 0.17.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 +63 -1
- package/dist/index.mjs +569 -20
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +383 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -226,6 +226,68 @@ 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. Defaults to `true`.
|
|
250
|
+
*/
|
|
251
|
+
searchable?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Called with the *currently-selected* variant's dot-path on row click.
|
|
254
|
+
* When set, the built-in expand-in-place behavior is suppressed — the
|
|
255
|
+
* consumer owns follow-up UI.
|
|
256
|
+
*/
|
|
257
|
+
onSelect?(path: string): void;
|
|
258
|
+
/**
|
|
259
|
+
* Map from a display label to a suffix matched against each token's
|
|
260
|
+
* trailing path segment. Tokens whose leaves match a suffix are grouped
|
|
261
|
+
* under a shared "base" path (the path with the suffix stripped), and
|
|
262
|
+
* the group renders as a single row with a pill selector — clicking a
|
|
263
|
+
* pill swaps the displayed values to that variant. Sibling tokens
|
|
264
|
+
* without a suffix that share the group's base path are labeled `base`.
|
|
265
|
+
*
|
|
266
|
+
* Matches both DTCG-idiomatic and Backmarket-style conventions:
|
|
267
|
+
* - **Dot segment** (`color.bg.hi.disabled`): last dot-segment equals
|
|
268
|
+
* the suffix (`disabled`). Base path = drop the last segment.
|
|
269
|
+
* - **Hyphen tail** (`color.bg.hi-d`): last dot-segment ends in
|
|
270
|
+
* `-<suffix>` (`d`). Base path = trim the `-<suffix>` from the leaf.
|
|
271
|
+
*
|
|
272
|
+
* Longest-suffix-wins. Hyphen-tail form requires an actual hyphen
|
|
273
|
+
* boundary — suffix `0` does not match `neutral-900`.
|
|
274
|
+
*
|
|
275
|
+
* Single-member groups render as plain rows (no pill selector). Empty
|
|
276
|
+
* map (default) disables grouping entirely; each token renders as its
|
|
277
|
+
* own row, identical to the pre-grouping behavior.
|
|
278
|
+
*/
|
|
279
|
+
variants?: Record<string, string>;
|
|
280
|
+
}
|
|
281
|
+
declare function ColorTable({
|
|
282
|
+
filter,
|
|
283
|
+
caption,
|
|
284
|
+
sortBy,
|
|
285
|
+
sortDir,
|
|
286
|
+
searchable,
|
|
287
|
+
onSelect,
|
|
288
|
+
variants
|
|
289
|
+
}: ColorTableProps): ReactElement;
|
|
290
|
+
//#endregion
|
|
229
291
|
//#region src/Diagnostics.d.ts
|
|
230
292
|
interface DiagnosticsProps {
|
|
231
293
|
/** Override the section caption. Defaults to a severity summary. */
|
|
@@ -705,5 +767,5 @@ declare function TypographyScale({
|
|
|
705
767
|
sortDir
|
|
706
768
|
}: TypographyScaleProps): ReactElement;
|
|
707
769
|
//#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 };
|
|
770
|
+
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
771
|
//# sourceMappingURL=index.d.mts.map
|