@mekari/pixel3-styled-system 0.0.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.
Files changed (211) hide show
  1. package/.turbo/turbo-build.log +16 -0
  2. package/chunks/packages__accordion__src__accordion.css +10 -0
  3. package/chunks/packages__avatar2__src__modules__avatar.recipes.css +166 -0
  4. package/chunks/packages__avatar__src__avatar.style.css +150 -0
  5. package/chunks/packages__avatar__src__avatar.styles.css +171 -0
  6. package/chunks/packages__avatar__src__modules__avatar.recipes.css +191 -0
  7. package/chunks/packages__core__node_modules__@mekari__pixel3-accordion__src__accordion.css +10 -0
  8. package/chunks/packages__core__node_modules__@mekari__pixel3-avatar2__src__modules__avatar.recipes.css +166 -0
  9. package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__avatar.css +16 -0
  10. package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__avatar.style.css +150 -0
  11. package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__avatar.styles.css +171 -0
  12. package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__modules__avatar.recipes.css +191 -0
  13. package/css/conditions.mjs +34 -0
  14. package/css/css.d.ts +9 -0
  15. package/css/css.mjs +44 -0
  16. package/css/cva.d.ts +6 -0
  17. package/css/cva.mjs +85 -0
  18. package/css/cx.d.ts +5 -0
  19. package/css/cx.mjs +15 -0
  20. package/css/index.d.ts +5 -0
  21. package/css/index.mjs +4 -0
  22. package/css/sva.d.ts +4 -0
  23. package/css/sva.mjs +35 -0
  24. package/global.css +59 -0
  25. package/helpers.mjs +300 -0
  26. package/jsx/aspect-ratio.d.ts +10 -0
  27. package/jsx/aspect-ratio.mjs +16 -0
  28. package/jsx/bleed.d.ts +10 -0
  29. package/jsx/bleed.mjs +16 -0
  30. package/jsx/box.d.ts +10 -0
  31. package/jsx/box.mjs +16 -0
  32. package/jsx/center.d.ts +10 -0
  33. package/jsx/center.mjs +16 -0
  34. package/jsx/circle.d.ts +10 -0
  35. package/jsx/circle.mjs +16 -0
  36. package/jsx/container.d.ts +10 -0
  37. package/jsx/container.mjs +16 -0
  38. package/jsx/divider.d.ts +10 -0
  39. package/jsx/divider.mjs +16 -0
  40. package/jsx/factory-helper.mjs +22 -0
  41. package/jsx/factory.d.ts +4 -0
  42. package/jsx/factory.mjs +85 -0
  43. package/jsx/flex.d.ts +10 -0
  44. package/jsx/flex.mjs +16 -0
  45. package/jsx/float.d.ts +10 -0
  46. package/jsx/float.mjs +16 -0
  47. package/jsx/grid-item.d.ts +10 -0
  48. package/jsx/grid-item.mjs +16 -0
  49. package/jsx/grid.d.ts +10 -0
  50. package/jsx/grid.mjs +16 -0
  51. package/jsx/hstack.d.ts +10 -0
  52. package/jsx/hstack.mjs +16 -0
  53. package/jsx/index.d.ts +27 -0
  54. package/jsx/index.mjs +22 -0
  55. package/jsx/is-valid-prop.d.ts +5 -0
  56. package/jsx/is-valid-prop.mjs +17 -0
  57. package/jsx/link-box.d.ts +10 -0
  58. package/jsx/link-box.mjs +16 -0
  59. package/jsx/link-overlay.d.ts +10 -0
  60. package/jsx/link-overlay.mjs +16 -0
  61. package/jsx/spacer.d.ts +10 -0
  62. package/jsx/spacer.mjs +16 -0
  63. package/jsx/square.d.ts +10 -0
  64. package/jsx/square.mjs +16 -0
  65. package/jsx/stack.d.ts +10 -0
  66. package/jsx/stack.mjs +16 -0
  67. package/jsx/visually-hidden.d.ts +10 -0
  68. package/jsx/visually-hidden.mjs +16 -0
  69. package/jsx/vstack.d.ts +10 -0
  70. package/jsx/vstack.mjs +16 -0
  71. package/jsx/wrap.d.ts +10 -0
  72. package/jsx/wrap.mjs +16 -0
  73. package/package.json +40 -0
  74. package/patterns/aspect-ratio.d.ts +21 -0
  75. package/patterns/aspect-ratio.mjs +35 -0
  76. package/patterns/bleed.d.ts +22 -0
  77. package/patterns/bleed.mjs +19 -0
  78. package/patterns/box.d.ts +21 -0
  79. package/patterns/box.mjs +12 -0
  80. package/patterns/center.d.ts +21 -0
  81. package/patterns/center.mjs +18 -0
  82. package/patterns/circle.d.ts +21 -0
  83. package/patterns/circle.mjs +22 -0
  84. package/patterns/container.d.ts +21 -0
  85. package/patterns/container.mjs +18 -0
  86. package/patterns/divider.d.ts +23 -0
  87. package/patterns/divider.mjs +21 -0
  88. package/patterns/flex.d.ts +27 -0
  89. package/patterns/flex.mjs +23 -0
  90. package/patterns/float.d.ts +24 -0
  91. package/patterns/float.mjs +45 -0
  92. package/patterns/grid-item.d.ts +26 -0
  93. package/patterns/grid-item.mjs +22 -0
  94. package/patterns/grid.d.ts +25 -0
  95. package/patterns/grid.mjs +22 -0
  96. package/patterns/hstack.d.ts +22 -0
  97. package/patterns/hstack.mjs +20 -0
  98. package/patterns/index.d.ts +21 -0
  99. package/patterns/index.mjs +20 -0
  100. package/patterns/link-box.d.ts +21 -0
  101. package/patterns/link-box.mjs +19 -0
  102. package/patterns/link-overlay.d.ts +21 -0
  103. package/patterns/link-overlay.mjs +24 -0
  104. package/patterns/spacer.d.ts +21 -0
  105. package/patterns/spacer.mjs +18 -0
  106. package/patterns/square.d.ts +21 -0
  107. package/patterns/square.mjs +21 -0
  108. package/patterns/stack.d.ts +24 -0
  109. package/patterns/stack.mjs +20 -0
  110. package/patterns/visually-hidden.d.ts +21 -0
  111. package/patterns/visually-hidden.mjs +15 -0
  112. package/patterns/vstack.d.ts +22 -0
  113. package/patterns/vstack.mjs +20 -0
  114. package/patterns/wrap.d.ts +25 -0
  115. package/patterns/wrap.mjs +22 -0
  116. package/recipes/accordion.d.ts +27 -0
  117. package/recipes/accordion.mjs +50 -0
  118. package/recipes/avatar-group-recipe.d.ts +27 -0
  119. package/recipes/avatar-group-recipe.mjs +43 -0
  120. package/recipes/avatar-group-slot-recipe.d.ts +27 -0
  121. package/recipes/avatar-group-slot-recipe.mjs +43 -0
  122. package/recipes/avatar-recipe.d.ts +30 -0
  123. package/recipes/avatar-recipe.mjs +122 -0
  124. package/recipes/avatar-slot-recipe.d.ts +29 -0
  125. package/recipes/avatar-slot-recipe.mjs +116 -0
  126. package/recipes/badge-recipe.d.ts +29 -0
  127. package/recipes/badge-recipe.mjs +160 -0
  128. package/recipes/button-group-recipe.d.ts +27 -0
  129. package/recipes/button-group-recipe.mjs +22 -0
  130. package/recipes/button-recipe.d.ts +28 -0
  131. package/recipes/button-recipe.mjs +94 -0
  132. package/recipes/checkbox-slot-recipe.d.ts +27 -0
  133. package/recipes/checkbox-slot-recipe.mjs +38 -0
  134. package/recipes/create-recipe.d.ts +1 -0
  135. package/recipes/create-recipe.mjs +79 -0
  136. package/recipes/icon-recipe.d.ts +27 -0
  137. package/recipes/icon-recipe.mjs +29 -0
  138. package/recipes/index.d.ts +30 -0
  139. package/recipes/index.mjs +29 -0
  140. package/recipes/input-addon-recipe.d.ts +29 -0
  141. package/recipes/input-addon-recipe.mjs +107 -0
  142. package/recipes/input-addon-slot-recipe.d.ts +28 -0
  143. package/recipes/input-addon-slot-recipe.mjs +45 -0
  144. package/recipes/input-group-recipe.d.ts +27 -0
  145. package/recipes/input-group-recipe.mjs +30 -0
  146. package/recipes/input-group-slot-recipe.d.ts +27 -0
  147. package/recipes/input-group-slot-recipe.mjs +30 -0
  148. package/recipes/input-recipe.d.ts +30 -0
  149. package/recipes/input-recipe.mjs +63 -0
  150. package/recipes/input-slot-recipe.d.ts +28 -0
  151. package/recipes/input-slot-recipe.mjs +53 -0
  152. package/recipes/popover-content-recipe.d.ts +28 -0
  153. package/recipes/popover-content-recipe.mjs +34 -0
  154. package/recipes/popover-list-item-recipe.d.ts +27 -0
  155. package/recipes/popover-list-item-recipe.mjs +22 -0
  156. package/recipes/popover-list-recipe.d.ts +27 -0
  157. package/recipes/popover-list-recipe.mjs +22 -0
  158. package/recipes/progress-slot-recipe.d.ts +28 -0
  159. package/recipes/progress-slot-recipe.mjs +57 -0
  160. package/recipes/radio-slot-recipe.d.ts +27 -0
  161. package/recipes/radio-slot-recipe.mjs +38 -0
  162. package/recipes/select-slot-recipe.d.ts +27 -0
  163. package/recipes/select-slot-recipe.mjs +51 -0
  164. package/recipes/selected-border-recipe.d.ts +28 -0
  165. package/recipes/selected-border-recipe.mjs +88 -0
  166. package/recipes/shared-slot-recipe.d.ts +27 -0
  167. package/recipes/shared-slot-recipe.mjs +30 -0
  168. package/recipes/spinner-recipe.d.ts +27 -0
  169. package/recipes/spinner-recipe.mjs +29 -0
  170. package/recipes/tab-list-recipe.d.ts +27 -0
  171. package/recipes/tab-list-recipe.mjs +22 -0
  172. package/recipes/tab-recipe.d.ts +28 -0
  173. package/recipes/tab-recipe.mjs +87 -0
  174. package/recipes/table-container-recipe.d.ts +27 -0
  175. package/recipes/table-container-recipe.mjs +22 -0
  176. package/recipes/table-head-recipe.d.ts +27 -0
  177. package/recipes/table-head-recipe.mjs +22 -0
  178. package/recipes/table-recipe.d.ts +27 -0
  179. package/recipes/table-recipe.mjs +22 -0
  180. package/recipes/tag-recipe.d.ts +28 -0
  181. package/recipes/tag-recipe.mjs +66 -0
  182. package/recipes/tag-slot-recipe.d.ts +28 -0
  183. package/recipes/tag-slot-recipe.mjs +66 -0
  184. package/recipes/text-recipe.d.ts +28 -0
  185. package/recipes/text-recipe.mjs +40 -0
  186. package/recipes/textarea-recipe.d.ts +27 -0
  187. package/recipes/textarea-recipe.mjs +26 -0
  188. package/recipes/toggle-slot-recipe.d.ts +27 -0
  189. package/recipes/toggle-slot-recipe.mjs +38 -0
  190. package/recipes/tooltip-recipe.d.ts +27 -0
  191. package/recipes/tooltip-recipe.mjs +22 -0
  192. package/reset.css +214 -0
  193. package/styles.css +246 -0
  194. package/tokens/index.css +179 -0
  195. package/tokens/index.d.ts +9 -0
  196. package/tokens/index.mjs +848 -0
  197. package/tokens/keyframes.css +23 -0
  198. package/tokens/tokens.d.ts +57 -0
  199. package/types/composition.d.ts +111 -0
  200. package/types/conditions.d.ts +256 -0
  201. package/types/csstype.d.ts +20749 -0
  202. package/types/global.d.ts +19 -0
  203. package/types/index.d.ts +8 -0
  204. package/types/jsx.d.ts +54 -0
  205. package/types/parts.d.ts +8 -0
  206. package/types/pattern.d.ts +63 -0
  207. package/types/prop-type.d.ts +317 -0
  208. package/types/recipe.d.ts +146 -0
  209. package/types/selectors.d.ts +59 -0
  210. package/types/style-props.d.ts +653 -0
  211. package/types/system-types.d.ts +93 -0
package/css/css.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+ import type { SystemStyleObject } from '../types/index';
3
+
4
+ interface CssFunction {
5
+ (...styles: Array<SystemStyleObject | undefined | null | false>): string
6
+ raw: (...styles: Array<SystemStyleObject | undefined | null | false>) => SystemStyleObject
7
+ }
8
+
9
+ export declare const css: CssFunction;
package/css/css.mjs ADDED
@@ -0,0 +1,44 @@
1
+ import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.mjs';
2
+ import { sortConditions, finalizeConditions } from './conditions.mjs';
3
+
4
+ const utilities = "aspectRatio:aspect,boxDecorationBreak:decoration,zIndex:z,boxSizing:box,objectPosition:object,objectFit:object,overscrollBehavior:overscroll,overscrollBehaviorX:overscroll-x,overscrollBehaviorY:overscroll-y,position:pos/1,top:top,left:left,insetInline:inset-x,insetBlock:inset-y,inset:inset,insetBlockEnd:inset-b,insetBlockStart:inset-t,insetInlineEnd:end/insetEnd/1,insetInlineStart:start/insetStart/1,right:right,bottom:bottom,insetX:inset-x,insetY:inset-y,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:basis,flex:flex,flexDirection:flex/flexDir,flexGrow:grow,flexShrink:shrink,gridTemplateColumns:grid-cols,gridTemplateRows:grid-rows,gridColumn:col-span,gridRow:row-span,gridColumnStart:col-start,gridColumnEnd:col-end,gridAutoFlow:grid-flow,gridAutoColumns:auto-cols,gridAutoRows:auto-rows,gap:gap,gridGap:gap,gridRowGap:gap-x,gridColumnGap:gap-y,rowGap:gap-x,columnGap:gap-y,justifyContent:justify,alignContent:content,alignItems:items,alignSelf:self,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pb,paddingBlockStart:pt,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mb,marginBlockStart:mt,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,outlineWidth:ring/ringWidth,outlineColor:ring/ringColor,outline:ring/1,outlineOffset:ring/ringOffset,divideX:divide-x,divideY:divide-y,divideColor:divide,divideStyle:divide,width:w/1,inlineSize:w,minWidth:min-w/minW,minInlineSize:min-w,maxWidth:max-w/maxW,maxInlineSize:max-w,height:h/1,blockSize:h,minHeight:min-h/minH,minBlockSize:min-h,maxHeight:max-h/maxH,maxBlockSize:max-b,color:text,fontFamily:font,fontSize:fs,fontWeight:font,fontSmoothing:smoothing,fontVariantNumeric:numeric,letterSpacing:tracking,lineHeight:leading,textAlign:text,textDecoration:text-decor,textDecorationColor:text-decor,textEmphasisColor:text-emphasis,textDecorationStyle:decoration,textDecorationThickness:decoration,textUnderlineOffset:underline-offset,textTransform:text,textIndent:indent,textShadow:text-shadow,textOverflow:text,verticalAlign:align,wordBreak:break,textWrap:text,truncate:truncate,lineClamp:clamp,listStyleType:list,listStylePosition:list,listStyleImage:list-img,backgroundPosition:bg/bgPosition,backgroundPositionX:bg-x/bgPositionX,backgroundPositionY:bg-y/bgPositionY,backgroundAttachment:bg/bgAttachment,backgroundClip:bg-clip/bgClip,background:bg/1,backgroundColor:bg/bgColor,backgroundOrigin:bg-origin/bgOrigin,backgroundImage:bg-img/bgImage,backgroundRepeat:bg-repeat/bgRepeat,backgroundBlendMode:bg-blend/bgBlendMode,backgroundSize:bg/bgSize,backgroundGradient:bg-gradient/bgGradient,textGradient:text-gradient,gradientFrom:from,gradientTo:to,gradientVia:via,borderRadius:rounded/1,borderTopLeftRadius:rounded-tl/roundedTopLeft,borderTopRightRadius:rounded-tr/roundedTopRight,borderBottomRightRadius:rounded-br/roundedBottomRight,borderBottomLeftRadius:rounded-bl/roundedBottomLeft,borderTopRadius:rounded-t/roundedTop,borderRightRadius:rounded-r/roundedRight,borderBottomRadius:rounded-b/roundedBottom,borderLeftRadius:rounded-l/roundedLeft,borderStartStartRadius:rounded-ss/roundedStartStart,borderStartEndRadius:rounded-se/roundedStartEnd,borderStartRadius:rounded-s/roundedStart,borderEndStartRadius:rounded-es/roundedEndStart,borderEndEndRadius:rounded-ee/roundedEndEnd,borderEndRadius:rounded-e/roundedEnd,border:border,borderWidth:border-w,borderTopWidth:border-tw,borderLeftWidth:border-lw,borderRightWidth:border-rw,borderBottomWidth:border-bw,borderColor:border,borderInline:border-x/borderX,borderInlineWidth:border-x/borderXWidth,borderInlineColor:border-x/borderXColor,borderBlock:border-y/borderY,borderBlockWidth:border-y/borderYWidth,borderBlockColor:border-y/borderYColor,borderLeft:border-l,borderLeftColor:border-l,borderInlineStart:border-s/borderStart,borderInlineStartWidth:border-s/borderStartWidth,borderInlineStartColor:border-s/borderStartColor,borderRight:border-r,borderRightColor:border-r,borderInlineEnd:border-e/borderEnd,borderInlineEndWidth:border-e/borderEndWidth,borderInlineEndColor:border-e/borderEndColor,borderTop:border-t,borderTopColor:border-t,borderBottom:border-b,borderBottomColor:border-b,borderBlockEnd:border-be,borderBlockEndColor:border-be,borderBlockStart:border-bs,borderBlockStartColor:border-bs,boxShadow:shadow/1,boxShadowColor:shadow/shadowColor,mixBlendMode:mix-blend,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:backdrop,backdropBlur:backdrop-blur,backdropBrightness:backdrop-brightness,backdropContrast:backdrop-contrast,backdropGrayscale:backdrop-grayscale,backdropHueRotate:backdrop-hue-rotate,backdropInvert:backdrop-invert,backdropOpacity:backdrop-opacity,backdropSaturate:backdrop-saturate,backdropSepia:backdrop-sepia,borderCollapse:border,borderSpacing:border-spacing,borderSpacingX:border-spacing-x,borderSpacingY:border-spacing-y,tableLayout:table,transitionTimingFunction:ease,transitionDelay:delay,transitionDuration:duration,transitionProperty:transition-prop,transition:transition,animation:animation,animationName:animation-name,animationDelay:animation-delay,transformOrigin:origin,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,accentColor:accent,caretColor:caret,scrollBehavior:scroll,scrollbar:scrollbar,scrollMargin:scroll-m,scrollMarginX:scroll-mx,scrollMarginY:scroll-my,scrollMarginLeft:scroll-ml,scrollMarginRight:scroll-mr,scrollMarginTop:scroll-mt,scrollMarginBottom:scroll-mb,scrollMarginBlock:scroll-my,scrollMarginBlockEnd:scroll-mb,scrollMarginBlockStart:scroll-mt,scrollMarginInline:scroll-mx,scrollMarginInlineEnd:scroll-me,scrollMarginInlineStart:scroll-ms,scrollPadding:scroll-p,scrollPaddingBlock:scroll-pb,scrollPaddingBlockStart:scroll-pt,scrollPaddingBlockEnd:scroll-pb,scrollPaddingInline:scroll-px,scrollPaddingInlineEnd:scroll-pe,scrollPaddingInlineStart:scroll-ps,scrollPaddingX:scroll-px,scrollPaddingY:scroll-py,scrollPaddingLeft:scroll-pl,scrollPaddingRight:scroll-pr,scrollPaddingTop:scroll-pt,scrollPaddingBottom:scroll-pb,scrollSnapAlign:snap,scrollSnapStop:snap,scrollSnapType:snap,scrollSnapStrictness:strictness,scrollSnapMargin:snap-m,scrollSnapMarginTop:snap-mt,scrollSnapMarginBottom:snap-mb,scrollSnapMarginLeft:snap-ml,scrollSnapMarginRight:snap-mr,touchAction:touch,userSelect:select,fill:fill,stroke:stroke,strokeWidth:stroke-w,srOnly:sr,debug:debug,appearance:appearance,backfaceVisibility:backface,clipPath:clip-path,hyphens:hyphens,mask:mask,maskImage:mask-image,maskSize:mask-size,textSizeAdjust:text-size-adjust,textStyle:textStyle"
5
+
6
+ const classNameByProp = new Map()
7
+ const shorthands = new Map()
8
+ utilities.split(',').forEach((utility) => {
9
+ const [prop, meta] = utility.split(':')
10
+ const [className, ...shorthandList] = meta.split('/')
11
+ classNameByProp.set(prop, className)
12
+ if (shorthandList.length) {
13
+ shorthandList.forEach((shorthand) => {
14
+ shorthands.set(shorthand === '1' ? className : shorthand, prop)
15
+ })
16
+ }
17
+ })
18
+
19
+ const resolveShorthand = (prop) => shorthands.get(prop) || prop
20
+
21
+ const context = {
22
+
23
+ conditions: {
24
+ shift: sortConditions,
25
+ finalize: finalizeConditions,
26
+ breakpoints: { keys: ["base","sm","md","lg","xl"] }
27
+ },
28
+ utility: {
29
+ prefix: "mp",
30
+ transform: (prop, value) => {
31
+ const key = resolveShorthand(prop)
32
+ const propKey = classNameByProp.get(key) || hypenateProperty(key)
33
+ return { className: `${propKey}_${withoutSpace(value)}` }
34
+ },
35
+ hasShorthand: true,
36
+ resolveShorthand: resolveShorthand,
37
+ }
38
+ }
39
+
40
+ const cssFn = createCss(context)
41
+ export const css = (...styles) => cssFn(mergeCss(...styles))
42
+ css.raw = (...styles) => mergeCss(...styles)
43
+
44
+ export const { mergeCss, assignCss } = createMergeCss(context)
package/css/cva.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ import type { RecipeCreatorFn } from '../types/recipe';
3
+
4
+ export declare const cva: RecipeCreatorFn
5
+
6
+ export type { RecipeVariantProps } from '../types/recipe';
package/css/cva.mjs ADDED
@@ -0,0 +1,85 @@
1
+ import { compact, mergeProps, splitProps, uniq } from '../helpers.mjs';
2
+ import { css, mergeCss } from './css.mjs';
3
+
4
+ const defaults = (conf) => ({
5
+ base: {},
6
+ variants: {},
7
+ defaultVariants: {},
8
+ compoundVariants: [],
9
+ ...conf,
10
+ })
11
+
12
+ export function cva(config) {
13
+ const { base, variants, defaultVariants, compoundVariants } = defaults(config)
14
+
15
+ function resolve(props = {}) {
16
+ const computedVariants = { ...defaultVariants, ...compact(props) }
17
+ let variantCss = { ...base }
18
+ for (const [key, value] of Object.entries(computedVariants)) {
19
+ if (variants[key]?.[value]) {
20
+ variantCss = mergeCss(variantCss, variants[key][value])
21
+ }
22
+ }
23
+ const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants)
24
+ return mergeCss(variantCss, compoundVariantCss)
25
+ }
26
+
27
+ function merge(__cva) {
28
+ const override = defaults(__cva.config)
29
+ const variantKeys = uniq(__cva.variantKeys, Object.keys(variants))
30
+ return cva({
31
+ base: mergeCss(base, override.base),
32
+ variants: Object.fromEntries(
33
+ variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
34
+ ),
35
+ defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
36
+ compoundVariants: [...compoundVariants, ...override.compoundVariants],
37
+ })
38
+ }
39
+
40
+ function cvaFn(props) {
41
+ return css(resolve(props))
42
+ }
43
+
44
+ const variantKeys = Object.keys(variants)
45
+
46
+ function splitVariantProps(props) {
47
+ return splitProps(props, variantKeys)
48
+ }
49
+
50
+ const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
51
+
52
+ return Object.assign(cvaFn, {
53
+ __cva__: true,
54
+ variantMap,
55
+ variantKeys,
56
+ raw: resolve,
57
+ config,
58
+ merge,
59
+ splitVariantProps,
60
+ })
61
+ }
62
+
63
+ export function getCompoundVariantCss(compoundVariants, variantMap) {
64
+ let result = {}
65
+ compoundVariants.forEach((compoundVariant) => {
66
+ const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
67
+ if (key === 'css') return true
68
+
69
+ const values = Array.isArray(value) ? value : [value]
70
+ return values.some((value) => variantMap[key] === value)
71
+ })
72
+
73
+ if (isMatching) {
74
+ result = mergeCss(result, compoundVariant.css)
75
+ }
76
+ })
77
+
78
+ return result
79
+ }
80
+
81
+ export function assertCompoundVariant(name, compoundVariants, variants, prop) {
82
+ if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
83
+ throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
84
+ }
85
+ }
package/css/cx.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /* eslint-disable */
2
+ type Argument = string | boolean | null | undefined
3
+
4
+ /** Conditionally join classNames into a single string */
5
+ export declare function cx(...args: Argument[]): string
package/css/cx.mjs ADDED
@@ -0,0 +1,15 @@
1
+ function cx() {
2
+ let str = '',
3
+ i = 0,
4
+ arg
5
+
6
+ for (; i < arguments.length; ) {
7
+ if ((arg = arguments[i++]) && typeof arg === 'string') {
8
+ str && (str += ' ')
9
+ str += arg
10
+ }
11
+ }
12
+ return str
13
+ }
14
+
15
+ export { cx }
package/css/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /* eslint-disable */
2
+ export * from './css';
3
+ export * from './cx';
4
+ export * from './cva';
5
+ export * from './sva';
package/css/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ export * from './css.mjs';
2
+ export * from './cx.mjs';
3
+ export * from './cva.mjs';
4
+ export * from './sva.mjs';
package/css/sva.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ import type { SlotRecipeCreatorFn } from '../types/recipe';
3
+
4
+ export declare const sva: SlotRecipeCreatorFn
package/css/sva.mjs ADDED
@@ -0,0 +1,35 @@
1
+ import { getSlotRecipes, splitProps } from '../helpers.mjs';
2
+ import { cva } from './cva.mjs';
3
+
4
+ export function sva(config) {
5
+ const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
6
+
7
+ function svaFn(props) {
8
+ const result = slots.map(([slot, cvaFn]) => [slot, cvaFn(props)])
9
+ return Object.fromEntries(result)
10
+ }
11
+
12
+ function raw(props) {
13
+ const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
14
+ return Object.fromEntries(result)
15
+ }
16
+
17
+ const variants = config.variants ?? {};
18
+ const variantKeys = Object.keys(variants);
19
+
20
+ function splitVariantProps(props) {
21
+ return splitProps(props, variantKeys);
22
+ }
23
+
24
+ const variantMap = Object.fromEntries(
25
+ Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
26
+ );
27
+
28
+ return Object.assign(svaFn, {
29
+ __cva__: false,
30
+ raw,
31
+ variantMap,
32
+ variantKeys,
33
+ splitVariantProps,
34
+ })
35
+ }
package/global.css ADDED
@@ -0,0 +1,59 @@
1
+ @layer pixel_base {
2
+ :root {
3
+ --made-with-panda: '🐼';
4
+ }
5
+
6
+ *, *::before, *::after, ::backdrop {
7
+ --blur: ;
8
+ --brightness: ;
9
+ --contrast: ;
10
+ --grayscale: ;
11
+ --hue-rotate: ;
12
+ --invert: ;
13
+ --saturate: ;
14
+ --sepia: ;
15
+ --drop-shadow: ;
16
+ --backdrop-blur: ;
17
+ --backdrop-brightness: ;
18
+ --backdrop-contrast: ;
19
+ --backdrop-grayscale: ;
20
+ --backdrop-hue-rotate: ;
21
+ --backdrop-invert: ;
22
+ --backdrop-opacity: ;
23
+ --backdrop-saturate: ;
24
+ --backdrop-sepia: ;
25
+ --scroll-snap-strictness: proximity;
26
+ --border-spacing-x: 0;
27
+ --border-spacing-y: 0;
28
+ --translate-x: 0;
29
+ --translate-y: 0;
30
+ --rotate: 0;
31
+ --skew-x: 0;
32
+ --skew-y: 0;
33
+ --scale-x: 1;
34
+ --scale-y: 1;
35
+ }
36
+
37
+ html {
38
+ -moz-osx-font-smoothing: grayscale;
39
+ text-rendering: optimizeLegibility;
40
+ -webkit-font-smoothing: antialiased;
41
+ -webkit-text-size-adjust: 100%;
42
+ }
43
+
44
+ body {
45
+ background: var(--mp-colors-white);
46
+ color: var(--mp-colors-dark);
47
+ font-family: var(--mp-fonts-body);
48
+ font-size: 14px;
49
+ }
50
+
51
+ body.dark, .dark body {
52
+ color-scheme: dark;
53
+ }
54
+
55
+ *, *::before, *::after {
56
+ border-style: solid;
57
+ box-sizing: border-box;
58
+ }
59
+ }
package/helpers.mjs ADDED
@@ -0,0 +1,300 @@
1
+ // src/assert.ts
2
+ function isObject(value) {
3
+ return typeof value === "object" && value != null && !Array.isArray(value);
4
+ }
5
+
6
+ // src/compact.ts
7
+ function compact(value) {
8
+ return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
9
+ }
10
+
11
+ // src/condition.ts
12
+ var isBaseCondition = (v) => v === "base";
13
+ function filterBaseConditions(c) {
14
+ return c.slice().filter((v) => !isBaseCondition(v));
15
+ }
16
+
17
+ // src/css-important.ts
18
+ var importantRegex = /!(important)?$/;
19
+ function isImportant(value) {
20
+ return typeof value === "string" ? importantRegex.test(value) : false;
21
+ }
22
+ function withoutImportant(value) {
23
+ return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
24
+ }
25
+ function withoutSpace(str) {
26
+ return typeof str === "string" ? str.replaceAll(" ", "_") : str;
27
+ }
28
+
29
+ // src/hash.ts
30
+ function toChar(code) {
31
+ return String.fromCharCode(code + (code > 25 ? 39 : 97));
32
+ }
33
+ function toName(code) {
34
+ let name = "";
35
+ let x;
36
+ for (x = Math.abs(code); x > 52; x = x / 52 | 0)
37
+ name = toChar(x % 52) + name;
38
+ return toChar(x % 52) + name;
39
+ }
40
+ function toPhash(h, x) {
41
+ let i = x.length;
42
+ while (i)
43
+ h = h * 33 ^ x.charCodeAt(--i);
44
+ return h;
45
+ }
46
+ function toHash(value) {
47
+ return toName(toPhash(5381, value) >>> 0);
48
+ }
49
+
50
+ // src/merge-props.ts
51
+ function mergeProps(...sources) {
52
+ const objects = sources.filter(Boolean);
53
+ return objects.reduce((prev, obj) => {
54
+ Object.keys(obj).forEach((key) => {
55
+ const prevValue = prev[key];
56
+ const value = obj[key];
57
+ if (isObject(prevValue) && isObject(value)) {
58
+ prev[key] = mergeProps(prevValue, value);
59
+ } else {
60
+ prev[key] = value;
61
+ }
62
+ });
63
+ return prev;
64
+ }, {});
65
+ }
66
+
67
+ // src/walk-object.ts
68
+ var isNotNullish = (element) => element != null;
69
+ function walkObject(target, predicate, options = {}) {
70
+ const { stop, getKey } = options;
71
+ function inner(value, path = []) {
72
+ if (isObject(value) || Array.isArray(value)) {
73
+ const result = {};
74
+ for (const [prop, child] of Object.entries(value)) {
75
+ const key = getKey?.(prop) ?? prop;
76
+ const childPath = [...path, key];
77
+ if (stop?.(value, childPath)) {
78
+ return predicate(value, path);
79
+ }
80
+ const next = inner(child, childPath);
81
+ if (isNotNullish(next)) {
82
+ result[key] = next;
83
+ }
84
+ }
85
+ return result;
86
+ }
87
+ return predicate(value, path);
88
+ }
89
+ return inner(target);
90
+ }
91
+ function mapObject(obj, fn) {
92
+ if (!isObject(obj))
93
+ return fn(obj);
94
+ return walkObject(obj, (value) => fn(value));
95
+ }
96
+
97
+ // src/normalize-style-object.ts
98
+ function toResponsiveObject(values, breakpoints) {
99
+ return values.reduce((acc, current, index) => {
100
+ const key = breakpoints[index];
101
+ if (current != null) {
102
+ acc[key] = current;
103
+ }
104
+ return acc;
105
+ }, {});
106
+ }
107
+ function normalizeShorthand(styles, context) {
108
+ const { hasShorthand, resolveShorthand } = context.utility;
109
+ return walkObject(styles, (v) => v, {
110
+ getKey: (prop) => {
111
+ return hasShorthand ? resolveShorthand(prop) : prop;
112
+ }
113
+ });
114
+ }
115
+ function normalizeStyleObject(styles, context) {
116
+ const { utility, conditions } = context;
117
+ const { hasShorthand, resolveShorthand } = utility;
118
+ return walkObject(
119
+ styles,
120
+ (value) => {
121
+ return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
122
+ },
123
+ {
124
+ stop: (value) => Array.isArray(value),
125
+ getKey: (prop) => {
126
+ return hasShorthand ? resolveShorthand(prop) : prop;
127
+ }
128
+ }
129
+ );
130
+ }
131
+
132
+ // src/classname.ts
133
+ var fallbackCondition = {
134
+ shift: (v) => v,
135
+ finalize: (v) => v,
136
+ breakpoints: { keys: [] }
137
+ };
138
+ var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
139
+ function createCss(context) {
140
+ const { utility, hash, conditions: conds = fallbackCondition } = context;
141
+ const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
142
+ const hashFn = (conditions, className) => {
143
+ let result;
144
+ if (hash) {
145
+ const baseArray = [...conds.finalize(conditions), className];
146
+ result = formatClassName(toHash(baseArray.join(":")));
147
+ } else {
148
+ const baseArray = [...conds.finalize(conditions), formatClassName(className)];
149
+ result = baseArray.join(":");
150
+ }
151
+ return result;
152
+ };
153
+ return (styleObject = {}) => {
154
+ const normalizedObject = normalizeStyleObject(styleObject, context);
155
+ const classNames = /* @__PURE__ */ new Set();
156
+ walkObject(normalizedObject, (value, paths) => {
157
+ const important = isImportant(value);
158
+ if (value == null)
159
+ return;
160
+ const [prop, ...allConditions] = conds.shift(paths);
161
+ const conditions = filterBaseConditions(allConditions);
162
+ const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
163
+ let className = hashFn(conditions, transformed.className);
164
+ if (important)
165
+ className = `${className}!`;
166
+ classNames.add(className);
167
+ });
168
+ return Array.from(classNames).join(" ");
169
+ };
170
+ }
171
+ function compactStyles(...styles) {
172
+ return styles.filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
173
+ }
174
+ function createMergeCss(context) {
175
+ function resolve(styles) {
176
+ const allStyles = compactStyles(...styles);
177
+ if (allStyles.length === 1)
178
+ return allStyles;
179
+ return allStyles.map((style) => normalizeShorthand(style, context));
180
+ }
181
+ function mergeCss(...styles) {
182
+ return mergeProps(...resolve(styles));
183
+ }
184
+ function assignCss(...styles) {
185
+ return Object.assign({}, ...resolve(styles));
186
+ }
187
+ return { mergeCss, assignCss };
188
+ }
189
+
190
+ // src/memo.ts
191
+ var memo = (fn) => {
192
+ const cache = /* @__PURE__ */ new Map();
193
+ const get = (...args) => {
194
+ const key = JSON.stringify(args);
195
+ if (cache.has(key)) {
196
+ return cache.get(key);
197
+ }
198
+ const result = fn(...args);
199
+ cache.set(key, result);
200
+ return result;
201
+ };
202
+ return get;
203
+ };
204
+
205
+ // src/hypenate-property.ts
206
+ var wordRegex = /([A-Z])/g;
207
+ var msRegex = /^ms-/;
208
+ var hypenateProperty = memo((property) => {
209
+ if (property.startsWith("--"))
210
+ return property;
211
+ return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
212
+ });
213
+
214
+ // src/slot.ts
215
+ var getSlotRecipes = (recipe = {}) => {
216
+ const init = (slot) => ({
217
+ className: [recipe.className, slot].filter(Boolean).join("__"),
218
+ base: recipe.base?.[slot] ?? {},
219
+ variants: {},
220
+ defaultVariants: recipe.defaultVariants ?? {},
221
+ compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
222
+ });
223
+ const slots = recipe.slots ?? [];
224
+ const recipeParts = slots.map((slot) => [slot, init(slot)]);
225
+ for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
226
+ for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
227
+ recipeParts.forEach(([slot, slotRecipe]) => {
228
+ slotRecipe.variants[variantsKey] ??= {};
229
+ slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
230
+ });
231
+ }
232
+ }
233
+ return Object.fromEntries(recipeParts);
234
+ };
235
+ var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
236
+
237
+ // src/split-props.ts
238
+ function splitProps(props, ...keys) {
239
+ const descriptors = Object.getOwnPropertyDescriptors(props);
240
+ const dKeys = Object.keys(descriptors);
241
+ const split = (k) => {
242
+ const clone = {};
243
+ for (let i = 0; i < k.length; i++) {
244
+ const key = k[i];
245
+ if (descriptors[key]) {
246
+ Object.defineProperty(clone, key, descriptors[key]);
247
+ delete descriptors[key];
248
+ }
249
+ }
250
+ return clone;
251
+ };
252
+ const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
253
+ return keys.map(fn).concat(split(dKeys));
254
+ }
255
+
256
+ // src/uniq.ts
257
+ var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);
258
+ export {
259
+ compact,
260
+ createCss,
261
+ createMergeCss,
262
+ filterBaseConditions,
263
+ getSlotCompoundVariant,
264
+ getSlotRecipes,
265
+ hypenateProperty,
266
+ isBaseCondition,
267
+ isObject,
268
+ mapObject,
269
+ memo,
270
+ mergeProps,
271
+ splitProps,
272
+ toHash,
273
+ uniq,
274
+ walkObject,
275
+ withoutSpace
276
+ };
277
+
278
+
279
+
280
+ // src/normalize-html.ts
281
+ var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
282
+ function convert(key) {
283
+ return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
284
+ }
285
+ function normalizeHTMLProps(props) {
286
+ return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
287
+ }
288
+ normalizeHTMLProps.keys = htmlProps;
289
+ export {
290
+ normalizeHTMLProps
291
+ };
292
+
293
+
294
+ export function __spreadValues(a, b) {
295
+ return { ...a, ...b }
296
+ }
297
+
298
+ export function __objRest(source, exclude) {
299
+ return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
300
+ }
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ import type { FunctionalComponent } from 'vue'
3
+ import type { AspectRatioProperties } from '../patterns/aspect-ratio';
4
+ import type { HTMLStyledProps } from '../types/jsx';
5
+ import type { DistributiveOmit } from '../types/system-types';
6
+
7
+ export interface AspectRatioProps extends AspectRatioProperties, DistributiveOmit<HTMLStyledProps<'div'>, keyof AspectRatioProperties | 'aspectRatio'> {}
8
+
9
+
10
+ export declare const AspectRatio: FunctionalComponent<AspectRatioProps>
@@ -0,0 +1,16 @@
1
+ import { defineComponent, h, computed } from 'vue'
2
+ import { styled } from './factory.mjs';
3
+ import { getAspectRatioStyle } from '../patterns/aspect-ratio.mjs';
4
+
5
+ export const AspectRatio = defineComponent({
6
+ name: 'AspectRatio',
7
+ inheritAttrs: false,
8
+ props: ["ratio"],
9
+ setup(props, { attrs, slots }) {
10
+ const styleProps = computed(() => getAspectRatioStyle(props))
11
+ return () => {
12
+ const computedProps = { ...styleProps.value, ...attrs }
13
+ return h(styled.div, computedProps, slots)
14
+ }
15
+ }
16
+ })
package/jsx/bleed.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ import type { FunctionalComponent } from 'vue'
3
+ import type { BleedProperties } from '../patterns/bleed';
4
+ import type { HTMLStyledProps } from '../types/jsx';
5
+ import type { DistributiveOmit } from '../types/system-types';
6
+
7
+ export interface BleedProps extends BleedProperties, DistributiveOmit<HTMLStyledProps<'div'>, keyof BleedProperties > {}
8
+
9
+
10
+ export declare const Bleed: FunctionalComponent<BleedProps>
package/jsx/bleed.mjs ADDED
@@ -0,0 +1,16 @@
1
+ import { defineComponent, h, computed } from 'vue'
2
+ import { styled } from './factory.mjs';
3
+ import { getBleedStyle } from '../patterns/bleed.mjs';
4
+
5
+ export const Bleed = defineComponent({
6
+ name: 'Bleed',
7
+ inheritAttrs: false,
8
+ props: ["inline", "block"],
9
+ setup(props, { attrs, slots }) {
10
+ const styleProps = computed(() => getBleedStyle(props))
11
+ return () => {
12
+ const computedProps = { ...styleProps.value, ...attrs }
13
+ return h(styled.div, computedProps, slots)
14
+ }
15
+ }
16
+ })
package/jsx/box.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ import type { FunctionalComponent } from 'vue'
3
+ import type { BoxProperties } from '../patterns/box';
4
+ import type { HTMLStyledProps } from '../types/jsx';
5
+ import type { DistributiveOmit } from '../types/system-types';
6
+
7
+ export interface BoxProps extends BoxProperties, DistributiveOmit<HTMLStyledProps<'div'>, keyof BoxProperties > {}
8
+
9
+
10
+ export declare const Box: FunctionalComponent<BoxProps>
package/jsx/box.mjs ADDED
@@ -0,0 +1,16 @@
1
+ import { defineComponent, h, computed } from 'vue'
2
+ import { styled } from './factory.mjs';
3
+ import { getBoxStyle } from '../patterns/box.mjs';
4
+
5
+ export const Box = defineComponent({
6
+ name: 'Box',
7
+ inheritAttrs: false,
8
+ props: [],
9
+ setup(props, { attrs, slots }) {
10
+ const styleProps = computed(() => getBoxStyle(props))
11
+ return () => {
12
+ const computedProps = { ...styleProps.value, ...attrs }
13
+ return h(styled.div, computedProps, slots)
14
+ }
15
+ }
16
+ })