@mekari/pixel3-styled-system 0.0.5-dev.2 → 0.0.5

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 (84) hide show
  1. package/CHANGELOG.md +17 -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/index.d.ts +1 -0
  7. package/jsx/index.mjs +2 -1
  8. package/jsx/is-valid-prop.d.ts +8 -1
  9. package/jsx/is-valid-prop.mjs +2 -2
  10. package/package.json +1 -1
  11. package/patterns/aspect-ratio.mjs +5 -2
  12. package/patterns/bleed.mjs +12 -7
  13. package/patterns/box.mjs +5 -2
  14. package/patterns/center.mjs +5 -2
  15. package/patterns/circle.mjs +5 -2
  16. package/patterns/container.mjs +5 -2
  17. package/patterns/divider.mjs +8 -4
  18. package/patterns/flex.mjs +5 -2
  19. package/patterns/float.mjs +10 -3
  20. package/patterns/grid-item.mjs +5 -2
  21. package/patterns/grid.mjs +11 -6
  22. package/patterns/hstack.mjs +8 -4
  23. package/patterns/index.d.ts +2 -1
  24. package/patterns/index.mjs +2 -1
  25. package/patterns/link-box.mjs +5 -2
  26. package/patterns/link-overlay.mjs +5 -2
  27. package/patterns/spacer.mjs +5 -2
  28. package/patterns/square.mjs +5 -2
  29. package/patterns/stack.mjs +8 -4
  30. package/patterns/visually-hidden.mjs +5 -2
  31. package/patterns/vstack.mjs +8 -4
  32. package/patterns/wrap.mjs +5 -2
  33. package/recipes/accordion.mjs +3 -3
  34. package/recipes/avatar-group-slot-recipe.mjs +3 -3
  35. package/recipes/avatar-slot-recipe.mjs +3 -3
  36. package/recipes/badge-recipe.mjs +2 -2
  37. package/recipes/banner-close-button-recipe.mjs +2 -2
  38. package/recipes/banner-description-recipe.mjs +2 -2
  39. package/recipes/banner-icon-slot-recipe.mjs +3 -3
  40. package/recipes/banner-link-recipe.mjs +2 -2
  41. package/recipes/banner-slot-recipe.mjs +3 -3
  42. package/recipes/banner-title-recipe.mjs +2 -2
  43. package/recipes/broadcast-slot-recipe.d.ts +1 -1
  44. package/recipes/broadcast-slot-recipe.mjs +5 -5
  45. package/recipes/button-group-recipe.mjs +2 -2
  46. package/recipes/button-recipe.mjs +2 -2
  47. package/recipes/checkbox-slot-recipe.mjs +3 -3
  48. package/recipes/divider-recipe.mjs +2 -2
  49. package/recipes/dropzone-slot-recipe.mjs +3 -3
  50. package/recipes/form-control-slot-recipe.mjs +3 -3
  51. package/recipes/icon-recipe.mjs +2 -2
  52. package/recipes/input-addon-slot-recipe.mjs +3 -3
  53. package/recipes/input-group-slot-recipe.mjs +3 -3
  54. package/recipes/input-slot-recipe.mjs +3 -3
  55. package/recipes/input-tag-slot-recipe.mjs +3 -3
  56. package/recipes/modal-slot-recipe.mjs +3 -3
  57. package/recipes/popover-content-recipe.mjs +2 -2
  58. package/recipes/popover-list-item-recipe.mjs +2 -2
  59. package/recipes/popover-list-recipe.mjs +2 -2
  60. package/recipes/progress-slot-recipe.mjs +3 -3
  61. package/recipes/radio-slot-recipe.mjs +3 -3
  62. package/recipes/segmented-control-slot-recipe.mjs +3 -3
  63. package/recipes/select-slot-recipe.mjs +3 -3
  64. package/recipes/selected-border-recipe.mjs +2 -2
  65. package/recipes/shared-slot-recipe.mjs +3 -3
  66. package/recipes/spinner-recipe.mjs +2 -2
  67. package/recipes/tab-list-recipe.mjs +2 -2
  68. package/recipes/tab-recipe.mjs +2 -2
  69. package/recipes/table-container-recipe.mjs +2 -2
  70. package/recipes/table-recipe.mjs +2 -2
  71. package/recipes/tag-slot-recipe.mjs +3 -3
  72. package/recipes/text-recipe.mjs +2 -2
  73. package/recipes/textarea-recipe.mjs +2 -2
  74. package/recipes/toast-slot-recipe.mjs +3 -3
  75. package/recipes/toggle-slot-recipe.mjs +3 -3
  76. package/recipes/tooltip-recipe.mjs +2 -2
  77. package/recipes/upload-list-slot-recipe.mjs +3 -3
  78. package/recipes/upload-slot-recipe.mjs +3 -3
  79. package/tokens/tokens.d.ts +1 -1
  80. package/types/conditions.d.ts +2 -2
  81. package/types/pattern.d.ts +13 -2
  82. package/types/prop-type.d.ts +96 -13
  83. package/types/recipe.d.ts +5 -2
  84. package/types/static-css.d.ts +5 -3
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const radioSlotRecipeDefaultVariants = {}
@@ -20,9 +20,9 @@ const radioSlotRecipeSlotNames = [
20
20
  ]
21
21
  const radioSlotRecipeSlotFns = /* @__PURE__ */ radioSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, radioSlotRecipeDefaultVariants, getSlotCompoundVariant(radioSlotRecipeCompoundVariants, slotName))])
22
22
 
23
- const radioSlotRecipeFn = (props = {}) => {
23
+ const radioSlotRecipeFn = memo((props = {}) => {
24
24
  return Object.fromEntries(radioSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
25
- }
25
+ })
26
26
 
27
27
  const radioSlotRecipeVariantKeys = []
28
28
 
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const segmentedControlSlotRecipeDefaultVariants = {}
@@ -32,9 +32,9 @@ const segmentedControlSlotRecipeSlotNames = [
32
32
  ]
33
33
  const segmentedControlSlotRecipeSlotFns = /* @__PURE__ */ segmentedControlSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, segmentedControlSlotRecipeDefaultVariants, getSlotCompoundVariant(segmentedControlSlotRecipeCompoundVariants, slotName))])
34
34
 
35
- const segmentedControlSlotRecipeFn = (props = {}) => {
35
+ const segmentedControlSlotRecipeFn = memo((props = {}) => {
36
36
  return Object.fromEntries(segmentedControlSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
37
- }
37
+ })
38
38
 
39
39
  const segmentedControlSlotRecipeVariantKeys = []
40
40
 
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const selectSlotRecipeDefaultVariants = {
@@ -26,9 +26,9 @@ const selectSlotRecipeSlotNames = [
26
26
  ]
27
27
  const selectSlotRecipeSlotFns = /* @__PURE__ */ selectSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, selectSlotRecipeDefaultVariants, getSlotCompoundVariant(selectSlotRecipeCompoundVariants, slotName))])
28
28
 
29
- const selectSlotRecipeFn = (props = {}) => {
29
+ const selectSlotRecipeFn = memo((props = {}) => {
30
30
  return Object.fromEntries(selectSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
31
- }
31
+ })
32
32
 
33
33
  const selectSlotRecipeVariantKeys = [
34
34
  "size"
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const selectedBorderRecipeFn = /* @__PURE__ */ createRecipe('selected-border', {
@@ -73,7 +73,7 @@ const selectedBorderRecipeVariantMap = {
73
73
 
74
74
  const selectedBorderRecipeVariantKeys = Object.keys(selectedBorderRecipeVariantMap)
75
75
 
76
- export const selectedBorderRecipe = /* @__PURE__ */ Object.assign(selectedBorderRecipeFn, {
76
+ export const selectedBorderRecipe = /* @__PURE__ */ Object.assign(memo(selectedBorderRecipeFn), {
77
77
  __recipe__: true,
78
78
  __name__: 'selectedBorderRecipe',
79
79
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const sharedSlotRecipeDefaultVariants = {}
@@ -12,9 +12,9 @@ const sharedSlotRecipeSlotNames = [
12
12
  ]
13
13
  const sharedSlotRecipeSlotFns = /* @__PURE__ */ sharedSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, sharedSlotRecipeDefaultVariants, getSlotCompoundVariant(sharedSlotRecipeCompoundVariants, slotName))])
14
14
 
15
- const sharedSlotRecipeFn = (props = {}) => {
15
+ const sharedSlotRecipeFn = memo((props = {}) => {
16
16
  return Object.fromEntries(sharedSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
17
- }
17
+ })
18
18
 
19
19
  const sharedSlotRecipeVariantKeys = []
20
20
 
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const spinnerRecipeFn = /* @__PURE__ */ createRecipe('spinner', {
@@ -14,7 +14,7 @@ const spinnerRecipeVariantMap = {
14
14
 
15
15
  const spinnerRecipeVariantKeys = Object.keys(spinnerRecipeVariantMap)
16
16
 
17
- export const spinnerRecipe = /* @__PURE__ */ Object.assign(spinnerRecipeFn, {
17
+ export const spinnerRecipe = /* @__PURE__ */ Object.assign(memo(spinnerRecipeFn), {
18
18
  __recipe__: true,
19
19
  __name__: 'spinnerRecipe',
20
20
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const tabListRecipeFn = /* @__PURE__ */ createRecipe('tab-list', {}, [])
@@ -7,7 +7,7 @@ const tabListRecipeVariantMap = {}
7
7
 
8
8
  const tabListRecipeVariantKeys = Object.keys(tabListRecipeVariantMap)
9
9
 
10
- export const tabListRecipe = /* @__PURE__ */ Object.assign(tabListRecipeFn, {
10
+ export const tabListRecipe = /* @__PURE__ */ Object.assign(memo(tabListRecipeFn), {
11
11
  __recipe__: true,
12
12
  __name__: 'tabListRecipe',
13
13
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const tabRecipeFn = /* @__PURE__ */ createRecipe('tab', {
@@ -72,7 +72,7 @@ const tabRecipeVariantMap = {
72
72
 
73
73
  const tabRecipeVariantKeys = Object.keys(tabRecipeVariantMap)
74
74
 
75
- export const tabRecipe = /* @__PURE__ */ Object.assign(tabRecipeFn, {
75
+ export const tabRecipe = /* @__PURE__ */ Object.assign(memo(tabRecipeFn), {
76
76
  __recipe__: true,
77
77
  __name__: 'tabRecipe',
78
78
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const tableContainerRecipeFn = /* @__PURE__ */ createRecipe('table-container', {}, [])
@@ -7,7 +7,7 @@ const tableContainerRecipeVariantMap = {}
7
7
 
8
8
  const tableContainerRecipeVariantKeys = Object.keys(tableContainerRecipeVariantMap)
9
9
 
10
- export const tableContainerRecipe = /* @__PURE__ */ Object.assign(tableContainerRecipeFn, {
10
+ export const tableContainerRecipe = /* @__PURE__ */ Object.assign(memo(tableContainerRecipeFn), {
11
11
  __recipe__: true,
12
12
  __name__: 'tableContainerRecipe',
13
13
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const tableRecipeFn = /* @__PURE__ */ createRecipe('table', {}, [])
@@ -7,7 +7,7 @@ const tableRecipeVariantMap = {}
7
7
 
8
8
  const tableRecipeVariantKeys = Object.keys(tableRecipeVariantMap)
9
9
 
10
- export const tableRecipe = /* @__PURE__ */ Object.assign(tableRecipeFn, {
10
+ export const tableRecipe = /* @__PURE__ */ Object.assign(memo(tableRecipeFn), {
11
11
  __recipe__: true,
12
12
  __name__: 'tableRecipe',
13
13
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const tagSlotRecipeDefaultVariants = {
@@ -44,9 +44,9 @@ const tagSlotRecipeSlotNames = [
44
44
  ]
45
45
  const tagSlotRecipeSlotFns = /* @__PURE__ */ tagSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, tagSlotRecipeDefaultVariants, getSlotCompoundVariant(tagSlotRecipeCompoundVariants, slotName))])
46
46
 
47
- const tagSlotRecipeFn = (props = {}) => {
47
+ const tagSlotRecipeFn = memo((props = {}) => {
48
48
  return Object.fromEntries(tagSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
49
- }
49
+ })
50
50
 
51
51
  const tagSlotRecipeVariantKeys = [
52
52
  "size",
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const textRecipeFn = /* @__PURE__ */ createRecipe('text', {
@@ -25,7 +25,7 @@ const textRecipeVariantMap = {
25
25
 
26
26
  const textRecipeVariantKeys = Object.keys(textRecipeVariantMap)
27
27
 
28
- export const textRecipe = /* @__PURE__ */ Object.assign(textRecipeFn, {
28
+ export const textRecipe = /* @__PURE__ */ Object.assign(memo(textRecipeFn), {
29
29
  __recipe__: true,
30
30
  __name__: 'textRecipe',
31
31
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const textareaRecipeFn = /* @__PURE__ */ createRecipe('textarea', {}, [])
@@ -11,7 +11,7 @@ const textareaRecipeVariantMap = {
11
11
 
12
12
  const textareaRecipeVariantKeys = Object.keys(textareaRecipeVariantMap)
13
13
 
14
- export const textareaRecipe = /* @__PURE__ */ Object.assign(textareaRecipeFn, {
14
+ export const textareaRecipe = /* @__PURE__ */ Object.assign(memo(textareaRecipeFn), {
15
15
  __recipe__: true,
16
16
  __name__: 'textareaRecipe',
17
17
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const toastSlotRecipeDefaultVariants = {
@@ -39,9 +39,9 @@ const toastSlotRecipeSlotNames = [
39
39
  ]
40
40
  const toastSlotRecipeSlotFns = /* @__PURE__ */ toastSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, toastSlotRecipeDefaultVariants, getSlotCompoundVariant(toastSlotRecipeCompoundVariants, slotName))])
41
41
 
42
- const toastSlotRecipeFn = (props = {}) => {
42
+ const toastSlotRecipeFn = memo((props = {}) => {
43
43
  return Object.fromEntries(toastSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
44
- }
44
+ })
45
45
 
46
46
  const toastSlotRecipeVariantKeys = [
47
47
  "variant"
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const toggleSlotRecipeDefaultVariants = {}
@@ -20,9 +20,9 @@ const toggleSlotRecipeSlotNames = [
20
20
  ]
21
21
  const toggleSlotRecipeSlotFns = /* @__PURE__ */ toggleSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, toggleSlotRecipeDefaultVariants, getSlotCompoundVariant(toggleSlotRecipeCompoundVariants, slotName))])
22
22
 
23
- const toggleSlotRecipeFn = (props = {}) => {
23
+ const toggleSlotRecipeFn = memo((props = {}) => {
24
24
  return Object.fromEntries(toggleSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
25
- }
25
+ })
26
26
 
27
27
  const toggleSlotRecipeVariantKeys = []
28
28
 
@@ -1,4 +1,4 @@
1
- import { splitProps } from '../helpers.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
4
  const tooltipRecipeFn = /* @__PURE__ */ createRecipe('tooltip', {}, [])
@@ -7,7 +7,7 @@ const tooltipRecipeVariantMap = {}
7
7
 
8
8
  const tooltipRecipeVariantKeys = Object.keys(tooltipRecipeVariantMap)
9
9
 
10
- export const tooltipRecipe = /* @__PURE__ */ Object.assign(tooltipRecipeFn, {
10
+ export const tooltipRecipe = /* @__PURE__ */ Object.assign(memo(tooltipRecipeFn), {
11
11
  __recipe__: true,
12
12
  __name__: 'tooltipRecipe',
13
13
  raw: (props) => props,
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const uploadListSlotRecipeDefaultVariants = {}
@@ -20,9 +20,9 @@ const uploadListSlotRecipeSlotNames = [
20
20
  ]
21
21
  const uploadListSlotRecipeSlotFns = /* @__PURE__ */ uploadListSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, uploadListSlotRecipeDefaultVariants, getSlotCompoundVariant(uploadListSlotRecipeCompoundVariants, slotName))])
22
22
 
23
- const uploadListSlotRecipeFn = (props = {}) => {
23
+ const uploadListSlotRecipeFn = memo((props = {}) => {
24
24
  return Object.fromEntries(uploadListSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
25
- }
25
+ })
26
26
 
27
27
  const uploadListSlotRecipeVariantKeys = []
28
28
 
@@ -1,4 +1,4 @@
1
- import { splitProps, getSlotCompoundVariant } from '../helpers.mjs';
1
+ import { getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
2
  import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const uploadSlotRecipeDefaultVariants = {}
@@ -16,9 +16,9 @@ const uploadSlotRecipeSlotNames = [
16
16
  ]
17
17
  const uploadSlotRecipeSlotFns = /* @__PURE__ */ uploadSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, uploadSlotRecipeDefaultVariants, getSlotCompoundVariant(uploadSlotRecipeCompoundVariants, slotName))])
18
18
 
19
- const uploadSlotRecipeFn = (props = {}) => {
19
+ const uploadSlotRecipeFn = memo((props = {}) => {
20
20
  return Object.fromEntries(uploadSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn(props)]))
21
- }
21
+ })
22
22
 
23
23
  const uploadSlotRecipeVariantKeys = []
24
24
 
@@ -54,4 +54,4 @@ export type Tokens = {
54
54
  animationName: AnimationName
55
55
  } & { [token: string]: never }
56
56
 
57
- export type TokenCategory = "zIndex" | "opacity" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "lineHeights" | "letterSpacings" | "sizes" | "shadows" | "spacing" | "radii" | "borders" | "durations" | "easings" | "animations" | "blurs" | "gradients" | "breakpoints" | "assets"
57
+ export type TokenCategory = "aspectRatios" | "zIndex" | "opacity" | "colors" | "fonts" | "fontSizes" | "fontWeights" | "lineHeights" | "letterSpacings" | "sizes" | "shadows" | "spacing" | "radii" | "borders" | "borderWidths" | "durations" | "easings" | "animations" | "blurs" | "gradients" | "breakpoints" | "assets"
@@ -116,9 +116,9 @@ export interface Conditions {
116
116
  "_inRange": string
117
117
  /** `&:out-of-range` */
118
118
  "_outOfRange": string
119
- /** `&::placeholder` */
119
+ /** `&::placeholder, &[data-placeholder]` */
120
120
  "_placeholder": string
121
- /** `&:placeholder-shown` */
121
+ /** `&:is(:placeholder-shown, [data-placeholder-shown])` */
122
122
  "_placeholderShown": string
123
123
  /** `&:is([aria-pressed=true], [data-pressed])` */
124
124
  "_pressed": string
@@ -13,13 +13,20 @@ export type PatternProperty =
13
13
 
14
14
  export interface PatternHelpers {
15
15
  map: (value: any, fn: (value: string) => string | undefined) => any
16
+ isCssUnit: (value: any) => boolean
17
+ isCssVar: (value: any) => boolean
18
+ isCssFunction: (value: any) => boolean
16
19
  }
17
20
 
18
21
  export interface PatternProperties {
19
22
  [key: string]: PatternProperty
20
23
  }
21
24
 
22
- type Props<T> = Record<LiteralUnion<keyof T>, any>
25
+ type InferProps<T> = Record<LiteralUnion<keyof T>, any>
26
+
27
+ export type PatternDefaultValue<T> = Partial<InferProps<T>>
28
+
29
+ export type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>
23
30
 
24
31
  export interface PatternConfig<T extends PatternProperties = PatternProperties> {
25
32
  /**
@@ -35,10 +42,14 @@ export interface PatternConfig<T extends PatternProperties = PatternProperties>
35
42
  * The properties of the pattern.
36
43
  */
37
44
  properties?: T
45
+ /**
46
+ * The default values of the pattern.
47
+ */
48
+ defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>
38
49
  /**
39
50
  * The css object this pattern will generate.
40
51
  */
41
- transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject
52
+ transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject
42
53
  /**
43
54
  * The jsx element name this pattern will generate.
44
55
  */
@@ -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
  */