@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.
Files changed (89) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/css/css.mjs +1 -1
  3. package/css/cva.mjs +2 -2
  4. package/css/sva.mjs +2 -2
  5. package/helpers.mjs +50 -20
  6. package/jsx/cq.d.ts +10 -0
  7. package/jsx/cq.mjs +18 -0
  8. package/jsx/index.d.ts +1 -0
  9. package/jsx/index.mjs +2 -1
  10. package/jsx/is-valid-prop.d.ts +8 -1
  11. package/jsx/is-valid-prop.mjs +2 -2
  12. package/package.json +1 -1
  13. package/patterns/aspect-ratio.mjs +5 -2
  14. package/patterns/bleed.mjs +12 -7
  15. package/patterns/box.mjs +5 -2
  16. package/patterns/center.mjs +5 -2
  17. package/patterns/circle.mjs +5 -2
  18. package/patterns/container.mjs +5 -2
  19. package/patterns/cq.d.ts +22 -0
  20. package/patterns/cq.mjs +21 -0
  21. package/patterns/divider.mjs +8 -4
  22. package/patterns/flex.mjs +5 -2
  23. package/patterns/float.mjs +10 -3
  24. package/patterns/grid-item.mjs +5 -2
  25. package/patterns/grid.mjs +11 -6
  26. package/patterns/hstack.mjs +8 -4
  27. package/patterns/index.d.ts +2 -1
  28. package/patterns/index.mjs +2 -1
  29. package/patterns/link-box.mjs +5 -2
  30. package/patterns/link-overlay.mjs +5 -2
  31. package/patterns/spacer.mjs +5 -2
  32. package/patterns/square.mjs +5 -2
  33. package/patterns/stack.mjs +8 -4
  34. package/patterns/visually-hidden.mjs +5 -2
  35. package/patterns/vstack.mjs +8 -4
  36. package/patterns/wrap.mjs +5 -2
  37. package/recipes/accordion.mjs +3 -3
  38. package/recipes/avatar-group-slot-recipe.mjs +3 -3
  39. package/recipes/avatar-slot-recipe.mjs +3 -3
  40. package/recipes/badge-recipe.mjs +2 -2
  41. package/recipes/banner-close-button-recipe.mjs +2 -2
  42. package/recipes/banner-description-recipe.mjs +2 -2
  43. package/recipes/banner-icon-slot-recipe.mjs +3 -3
  44. package/recipes/banner-link-recipe.mjs +2 -2
  45. package/recipes/banner-slot-recipe.mjs +3 -3
  46. package/recipes/banner-title-recipe.mjs +2 -2
  47. package/recipes/broadcast-slot-recipe.d.ts +1 -1
  48. package/recipes/broadcast-slot-recipe.mjs +5 -5
  49. package/recipes/button-group-recipe.mjs +2 -2
  50. package/recipes/button-recipe.mjs +2 -2
  51. package/recipes/checkbox-slot-recipe.mjs +3 -3
  52. package/recipes/divider-recipe.mjs +2 -2
  53. package/recipes/dropzone-slot-recipe.mjs +3 -3
  54. package/recipes/form-control-slot-recipe.mjs +3 -3
  55. package/recipes/icon-recipe.mjs +2 -2
  56. package/recipes/input-addon-slot-recipe.mjs +3 -3
  57. package/recipes/input-group-slot-recipe.mjs +3 -3
  58. package/recipes/input-slot-recipe.mjs +3 -3
  59. package/recipes/input-tag-slot-recipe.mjs +3 -3
  60. package/recipes/modal-slot-recipe.mjs +3 -3
  61. package/recipes/popover-content-recipe.mjs +2 -2
  62. package/recipes/popover-list-item-recipe.mjs +2 -2
  63. package/recipes/popover-list-recipe.mjs +2 -2
  64. package/recipes/progress-slot-recipe.mjs +3 -3
  65. package/recipes/radio-slot-recipe.mjs +3 -3
  66. package/recipes/segmented-control-slot-recipe.mjs +3 -3
  67. package/recipes/select-slot-recipe.mjs +3 -3
  68. package/recipes/selected-border-recipe.mjs +2 -2
  69. package/recipes/shared-slot-recipe.mjs +3 -3
  70. package/recipes/spinner-recipe.mjs +2 -2
  71. package/recipes/tab-list-recipe.mjs +2 -2
  72. package/recipes/tab-recipe.mjs +2 -2
  73. package/recipes/table-container-recipe.mjs +2 -2
  74. package/recipes/table-recipe.mjs +2 -2
  75. package/recipes/tag-slot-recipe.mjs +3 -3
  76. package/recipes/text-recipe.mjs +2 -2
  77. package/recipes/textarea-recipe.mjs +2 -2
  78. package/recipes/toast-slot-recipe.mjs +3 -3
  79. package/recipes/toggle-slot-recipe.mjs +3 -3
  80. package/recipes/tooltip-recipe.mjs +2 -2
  81. package/recipes/upload-list-slot-recipe.mjs +3 -3
  82. package/recipes/upload-slot-recipe.mjs +3 -3
  83. package/tokens/index.mjs +0 -20
  84. package/tokens/tokens.d.ts +4 -4
  85. package/types/conditions.d.ts +2 -2
  86. package/types/pattern.d.ts +13 -2
  87. package/types/prop-type.d.ts +96 -13
  88. package/types/recipe.d.ts +5 -2
  89. package/types/static-css.d.ts +5 -3
@@ -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: "auto" | "square" | "landscape" | "portrait" | "wide" | "ultrawide" | "golden";
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
- type PropertyTypeValue<T extends string> = T extends keyof PropertyTypes
315
- ? ConditionalValue<PropertyTypes[T] | CssValue<T> | (string & {})>
316
- : never;
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
- type CssPropertyValue<T extends string> = T extends keyof CssProperties
319
- ? ConditionalValue<CssProperties[T] | (string & {})>
320
- : never;
396
+ type PropOrCondition<Key, Value> = ConditionalValue<Value | (string & {})>
321
397
 
322
- export type PropertyValue<T extends string> = T extends keyof PropertyTypes
323
- ? PropertyTypeValue<T>
324
- : T extends keyof CssProperties
325
- ? CssPropertyValue<T>
326
- : ConditionalValue<string | number>
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<S extends string, T extends SlotRecipeVariantRecord<S>> {
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
  */
@@ -33,9 +33,11 @@ export interface StaticCssOptions {
33
33
  /**
34
34
  * The css recipes to generate.
35
35
  */
36
- recipes?: {
37
- [recipe: string]: RecipeRule[]
38
- }
36
+ recipes?:
37
+ | '*'
38
+ | {
39
+ [recipe: string]: RecipeRule[]
40
+ }
39
41
  /**
40
42
  * The css patterns to generate.
41
43
  */