@mekari/pixel3-styled-system 0.0.5-dev.1 → 0.0.5-dev.3
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/CHANGELOG.md +13 -0
- package/css/css.mjs +1 -1
- package/css/cva.mjs +2 -2
- package/css/sva.mjs +2 -2
- package/helpers.mjs +50 -20
- package/jsx/cq.d.ts +10 -0
- package/jsx/cq.mjs +18 -0
- package/jsx/index.d.ts +1 -0
- package/jsx/index.mjs +2 -1
- package/jsx/is-valid-prop.d.ts +8 -1
- package/jsx/is-valid-prop.mjs +2 -2
- package/package.json +1 -1
- package/patterns/aspect-ratio.mjs +5 -2
- package/patterns/bleed.mjs +12 -7
- package/patterns/box.mjs +5 -2
- package/patterns/center.mjs +5 -2
- package/patterns/circle.mjs +5 -2
- package/patterns/container.mjs +5 -2
- package/patterns/cq.d.ts +22 -0
- package/patterns/cq.mjs +21 -0
- package/patterns/divider.mjs +8 -4
- package/patterns/flex.mjs +5 -2
- package/patterns/float.mjs +10 -3
- package/patterns/grid-item.mjs +5 -2
- package/patterns/grid.mjs +11 -6
- package/patterns/hstack.mjs +8 -4
- package/patterns/index.d.ts +2 -1
- package/patterns/index.mjs +2 -1
- package/patterns/link-box.mjs +5 -2
- package/patterns/link-overlay.mjs +5 -2
- package/patterns/spacer.mjs +5 -2
- package/patterns/square.mjs +5 -2
- package/patterns/stack.mjs +8 -4
- package/patterns/visually-hidden.mjs +5 -2
- package/patterns/vstack.mjs +8 -4
- package/patterns/wrap.mjs +5 -2
- package/recipes/accordion.mjs +3 -3
- package/recipes/avatar-group-slot-recipe.mjs +3 -3
- package/recipes/avatar-slot-recipe.mjs +3 -3
- package/recipes/badge-recipe.mjs +2 -2
- package/recipes/banner-close-button-recipe.mjs +2 -2
- package/recipes/banner-description-recipe.mjs +2 -2
- package/recipes/banner-icon-slot-recipe.mjs +3 -3
- package/recipes/banner-link-recipe.mjs +2 -2
- package/recipes/banner-slot-recipe.mjs +3 -3
- package/recipes/banner-title-recipe.mjs +2 -2
- package/recipes/broadcast-slot-recipe.d.ts +1 -1
- package/recipes/broadcast-slot-recipe.mjs +5 -5
- package/recipes/button-group-recipe.mjs +2 -2
- package/recipes/button-recipe.mjs +2 -2
- package/recipes/checkbox-slot-recipe.mjs +3 -3
- package/recipes/divider-recipe.mjs +2 -2
- package/recipes/dropzone-slot-recipe.mjs +3 -3
- package/recipes/form-control-slot-recipe.mjs +3 -3
- package/recipes/icon-recipe.mjs +2 -2
- package/recipes/input-addon-slot-recipe.mjs +3 -3
- package/recipes/input-group-slot-recipe.mjs +3 -3
- package/recipes/input-slot-recipe.mjs +3 -3
- package/recipes/input-tag-slot-recipe.mjs +3 -3
- package/recipes/modal-slot-recipe.mjs +3 -3
- package/recipes/popover-content-recipe.mjs +2 -2
- package/recipes/popover-list-item-recipe.mjs +2 -2
- package/recipes/popover-list-recipe.mjs +2 -2
- package/recipes/progress-slot-recipe.mjs +3 -3
- package/recipes/radio-slot-recipe.mjs +3 -3
- package/recipes/segmented-control-slot-recipe.mjs +3 -3
- package/recipes/select-slot-recipe.mjs +3 -3
- package/recipes/selected-border-recipe.mjs +2 -2
- package/recipes/shared-slot-recipe.mjs +3 -3
- package/recipes/spinner-recipe.mjs +2 -2
- package/recipes/tab-list-recipe.mjs +2 -2
- package/recipes/tab-recipe.mjs +2 -2
- package/recipes/table-container-recipe.mjs +2 -2
- package/recipes/table-recipe.mjs +2 -2
- package/recipes/tag-slot-recipe.mjs +3 -3
- package/recipes/text-recipe.mjs +2 -2
- package/recipes/textarea-recipe.mjs +2 -2
- package/recipes/toast-slot-recipe.mjs +3 -3
- package/recipes/toggle-slot-recipe.mjs +3 -3
- package/recipes/tooltip-recipe.mjs +2 -2
- package/recipes/upload-list-slot-recipe.mjs +3 -3
- package/recipes/upload-slot-recipe.mjs +3 -3
- package/tokens/index.mjs +0 -20
- package/tokens/tokens.d.ts +4 -4
- package/types/conditions.d.ts +2 -2
- package/types/pattern.d.ts +13 -2
- package/types/prop-type.d.ts +96 -13
- package/types/recipe.d.ts +5 -2
- package/types/static-css.d.ts +5 -3
package/types/prop-type.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { CssProperties } from './system-types';
|
|
|
4
4
|
import type { Tokens } from '../tokens/index';
|
|
5
5
|
|
|
6
6
|
interface PropertyValueTypes {
|
|
7
|
-
aspectRatio: "
|
|
7
|
+
aspectRatio: Tokens["aspectRatios"];
|
|
8
8
|
zIndex: Tokens["zIndex"];
|
|
9
9
|
top: Tokens["spacing"];
|
|
10
10
|
left: Tokens["spacing"];
|
|
@@ -209,6 +209,7 @@ interface PropertyValueTypes {
|
|
|
209
209
|
strokeWidth: Tokens["borderWidths"];
|
|
210
210
|
srOnly: boolean;
|
|
211
211
|
debug: boolean;
|
|
212
|
+
containerName: Tokens["containerNames"] | CssProperties["containerName"];
|
|
212
213
|
colorPalette: "currentcolor" | "dark" | "white" | "background" | "overlay" | "brand" | "whiteAlpha" | "blackAlpha" | "gray" | "blue" | "red" | "green" | "orange" | "sky" | "teal" | "violet" | "amber" | "rose" | "stone" | "lime" | "pink" | "apricot" | "aqua" | "leaf" | "fuchsia" | "ice" | "ash";
|
|
213
214
|
textStyle: "overline" | "body.sm" | "body.md" | "label.sm" | "label.md" | "h3" | "h2" | "h1";
|
|
214
215
|
}
|
|
@@ -309,19 +310,101 @@ interface PropertyValueTypes {
|
|
|
309
310
|
y: Shorthand<"translateY">;
|
|
310
311
|
}
|
|
311
312
|
|
|
313
|
+
type StrictableProps =
|
|
314
|
+
| 'alignContent'
|
|
315
|
+
| 'alignItems'
|
|
316
|
+
| 'alignSelf'
|
|
317
|
+
| 'all'
|
|
318
|
+
| 'animationComposition'
|
|
319
|
+
| 'animationDirection'
|
|
320
|
+
| 'animationFillMode'
|
|
321
|
+
| 'appearance'
|
|
322
|
+
| 'backfaceVisibility'
|
|
323
|
+
| 'backgroundAttachment'
|
|
324
|
+
| 'backgroundClip'
|
|
325
|
+
| 'borderCollapse'
|
|
326
|
+
| 'border'
|
|
327
|
+
| 'borderBlock'
|
|
328
|
+
| 'borderBlockEnd'
|
|
329
|
+
| 'borderBlockStart'
|
|
330
|
+
| 'borderBottom'
|
|
331
|
+
| 'borderInline'
|
|
332
|
+
| 'borderInlineEnd'
|
|
333
|
+
| 'borderInlineStart'
|
|
334
|
+
| 'borderLeft'
|
|
335
|
+
| 'borderRight'
|
|
336
|
+
| 'borderTop'
|
|
337
|
+
| 'borderBlockEndStyle'
|
|
338
|
+
| 'borderBlockStartStyle'
|
|
339
|
+
| 'borderBlockStyle'
|
|
340
|
+
| 'borderBottomStyle'
|
|
341
|
+
| 'borderInlineEndStyle'
|
|
342
|
+
| 'borderInlineStartStyle'
|
|
343
|
+
| 'borderInlineStyle'
|
|
344
|
+
| 'borderLeftStyle'
|
|
345
|
+
| 'borderRightStyle'
|
|
346
|
+
| 'borderTopStyle'
|
|
347
|
+
| 'boxDecorationBreak'
|
|
348
|
+
| 'boxSizing'
|
|
349
|
+
| 'breakAfter'
|
|
350
|
+
| 'breakBefore'
|
|
351
|
+
| 'breakInside'
|
|
352
|
+
| 'captionSide'
|
|
353
|
+
| 'clear'
|
|
354
|
+
| 'columnFill'
|
|
355
|
+
| 'columnRuleStyle'
|
|
356
|
+
| 'contentVisibility'
|
|
357
|
+
| 'direction'
|
|
358
|
+
| 'display'
|
|
359
|
+
| 'emptyCells'
|
|
360
|
+
| 'flexDirection'
|
|
361
|
+
| 'flexWrap'
|
|
362
|
+
| 'float'
|
|
363
|
+
| 'fontKerning'
|
|
364
|
+
| 'forcedColorAdjust'
|
|
365
|
+
| 'isolation'
|
|
366
|
+
| 'lineBreak'
|
|
367
|
+
| 'mixBlendMode'
|
|
368
|
+
| 'objectFit'
|
|
369
|
+
| 'outlineStyle'
|
|
370
|
+
| 'overflow'
|
|
371
|
+
| 'overflowX'
|
|
372
|
+
| 'overflowY'
|
|
373
|
+
| 'overflowBlock'
|
|
374
|
+
| 'overflowInline'
|
|
375
|
+
| 'overflowWrap'
|
|
376
|
+
| 'pointerEvents'
|
|
377
|
+
| 'position'
|
|
378
|
+
| 'resize'
|
|
379
|
+
| 'scrollBehavior'
|
|
380
|
+
| 'touchAction'
|
|
381
|
+
| 'transformBox'
|
|
382
|
+
| 'transformStyle'
|
|
383
|
+
| 'userSelect'
|
|
384
|
+
| 'visibility'
|
|
385
|
+
| 'wordBreak'
|
|
386
|
+
| 'writingMode'
|
|
312
387
|
|
|
388
|
+
type WithEscapeHatch<T> = T | `[${string}]`
|
|
313
389
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
390
|
+
type FilterVagueString<Key, Value> = Value extends boolean
|
|
391
|
+
? Value
|
|
392
|
+
: Key extends StrictableProps
|
|
393
|
+
? Value extends `${infer _}` ? Value : never
|
|
394
|
+
: Value
|
|
317
395
|
|
|
318
|
-
|
|
319
|
-
? ConditionalValue<CssProperties[T] | (string & {})>
|
|
320
|
-
: never;
|
|
396
|
+
type PropOrCondition<Key, Value> = ConditionalValue<Value | (string & {})>
|
|
321
397
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
398
|
+
type PropertyTypeValue<T extends string> = T extends keyof PropertyTypes
|
|
399
|
+
? PropOrCondition<T, PropertyTypes[T] | CssValue<T>>
|
|
400
|
+
: never;
|
|
401
|
+
|
|
402
|
+
type CssPropertyValue<T extends string> = T extends keyof CssProperties
|
|
403
|
+
? PropOrCondition<T, CssProperties[T]>
|
|
404
|
+
: never;
|
|
405
|
+
|
|
406
|
+
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
407
|
+
? PropertyTypeValue<T>
|
|
408
|
+
: T extends keyof CssProperties
|
|
409
|
+
? CssPropertyValue<T>
|
|
410
|
+
: PropOrCondition<T, string | number>
|
package/types/recipe.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export type RecipeCompoundVariant<T> = T & {
|
|
|
47
47
|
css: SystemStyleObject
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export interface RecipeDefinition<T extends RecipeVariantRecord> {
|
|
50
|
+
export interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {
|
|
51
51
|
/**
|
|
52
52
|
* The base styles of the recipe.
|
|
53
53
|
*/
|
|
@@ -118,7 +118,10 @@ export type SlotRecipeCompoundVariant<S extends string, T> = T & {
|
|
|
118
118
|
css: SlotRecord<S, SystemStyleObject>
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export interface SlotRecipeDefinition<
|
|
121
|
+
export interface SlotRecipeDefinition<
|
|
122
|
+
S extends string = string,
|
|
123
|
+
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
124
|
+
> {
|
|
122
125
|
/**
|
|
123
126
|
* The parts/slots of the recipe.
|
|
124
127
|
*/
|
package/types/static-css.d.ts
CHANGED
|
@@ -33,9 +33,11 @@ export interface StaticCssOptions {
|
|
|
33
33
|
/**
|
|
34
34
|
* The css recipes to generate.
|
|
35
35
|
*/
|
|
36
|
-
recipes?:
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
recipes?:
|
|
37
|
+
| '*'
|
|
38
|
+
| {
|
|
39
|
+
[recipe: string]: RecipeRule[]
|
|
40
|
+
}
|
|
39
41
|
/**
|
|
40
42
|
* The css patterns to generate.
|
|
41
43
|
*/
|