@pyck/styled-system 0.0.1

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 (238) hide show
  1. package/dist/css/conditions.mjs +36 -0
  2. package/dist/css/css.d.ts +22 -0
  3. package/dist/css/css.mjs +45 -0
  4. package/dist/css/cva.d.ts +6 -0
  5. package/dist/css/cva.mjs +87 -0
  6. package/dist/css/cx.d.ts +5 -0
  7. package/dist/css/cx.mjs +15 -0
  8. package/dist/css/index.d.ts +5 -0
  9. package/dist/css/index.mjs +4 -0
  10. package/dist/css/sva.d.ts +4 -0
  11. package/dist/css/sva.mjs +46 -0
  12. package/dist/helpers.mjs +328 -0
  13. package/dist/jsx/aspect-ratio.d.ts +10 -0
  14. package/dist/jsx/aspect-ratio.mjs +14 -0
  15. package/dist/jsx/bleed.d.ts +10 -0
  16. package/dist/jsx/bleed.mjs +14 -0
  17. package/dist/jsx/box.d.ts +10 -0
  18. package/dist/jsx/box.mjs +14 -0
  19. package/dist/jsx/center.d.ts +10 -0
  20. package/dist/jsx/center.mjs +14 -0
  21. package/dist/jsx/circle.d.ts +10 -0
  22. package/dist/jsx/circle.mjs +14 -0
  23. package/dist/jsx/container.d.ts +10 -0
  24. package/dist/jsx/container.mjs +14 -0
  25. package/dist/jsx/cq.d.ts +10 -0
  26. package/dist/jsx/cq.mjs +14 -0
  27. package/dist/jsx/create-style-context.d.ts +54 -0
  28. package/dist/jsx/create-style-context.mjs +118 -0
  29. package/dist/jsx/divider.d.ts +10 -0
  30. package/dist/jsx/divider.mjs +14 -0
  31. package/dist/jsx/factory-helper.mjs +22 -0
  32. package/dist/jsx/factory.d.ts +3 -0
  33. package/dist/jsx/factory.mjs +89 -0
  34. package/dist/jsx/flex.d.ts +10 -0
  35. package/dist/jsx/flex.mjs +14 -0
  36. package/dist/jsx/float.d.ts +10 -0
  37. package/dist/jsx/float.mjs +14 -0
  38. package/dist/jsx/grid-item.d.ts +10 -0
  39. package/dist/jsx/grid-item.mjs +14 -0
  40. package/dist/jsx/grid.d.ts +10 -0
  41. package/dist/jsx/grid.mjs +14 -0
  42. package/dist/jsx/hstack.d.ts +10 -0
  43. package/dist/jsx/hstack.mjs +14 -0
  44. package/dist/jsx/index.d.ts +25 -0
  45. package/dist/jsx/index.mjs +23 -0
  46. package/dist/jsx/is-valid-prop.d.ts +11 -0
  47. package/dist/jsx/is-valid-prop.mjs +17 -0
  48. package/dist/jsx/link-overlay.d.ts +10 -0
  49. package/dist/jsx/link-overlay.mjs +14 -0
  50. package/dist/jsx/spacer.d.ts +10 -0
  51. package/dist/jsx/spacer.mjs +14 -0
  52. package/dist/jsx/square.d.ts +10 -0
  53. package/dist/jsx/square.mjs +14 -0
  54. package/dist/jsx/stack.d.ts +10 -0
  55. package/dist/jsx/stack.mjs +14 -0
  56. package/dist/jsx/visually-hidden.d.ts +10 -0
  57. package/dist/jsx/visually-hidden.mjs +14 -0
  58. package/dist/jsx/vstack.d.ts +10 -0
  59. package/dist/jsx/vstack.mjs +14 -0
  60. package/dist/jsx/wrap.d.ts +10 -0
  61. package/dist/jsx/wrap.mjs +14 -0
  62. package/dist/patterns/aspect-ratio.d.ts +20 -0
  63. package/dist/patterns/aspect-ratio.mjs +38 -0
  64. package/dist/patterns/bleed.d.ts +21 -0
  65. package/dist/patterns/bleed.mjs +24 -0
  66. package/dist/patterns/box.d.ts +20 -0
  67. package/dist/patterns/box.mjs +15 -0
  68. package/dist/patterns/center.d.ts +20 -0
  69. package/dist/patterns/center.mjs +21 -0
  70. package/dist/patterns/circle.d.ts +20 -0
  71. package/dist/patterns/circle.mjs +25 -0
  72. package/dist/patterns/container.d.ts +20 -0
  73. package/dist/patterns/container.mjs +22 -0
  74. package/dist/patterns/cq.d.ts +21 -0
  75. package/dist/patterns/cq.mjs +21 -0
  76. package/dist/patterns/divider.d.ts +22 -0
  77. package/dist/patterns/divider.mjs +25 -0
  78. package/dist/patterns/flex.d.ts +26 -0
  79. package/dist/patterns/flex.mjs +26 -0
  80. package/dist/patterns/float.d.ts +23 -0
  81. package/dist/patterns/float.mjs +52 -0
  82. package/dist/patterns/grid-item.d.ts +25 -0
  83. package/dist/patterns/grid-item.mjs +25 -0
  84. package/dist/patterns/grid.d.ts +24 -0
  85. package/dist/patterns/grid.mjs +25 -0
  86. package/dist/patterns/hstack.d.ts +21 -0
  87. package/dist/patterns/hstack.mjs +24 -0
  88. package/dist/patterns/index.d.ts +21 -0
  89. package/dist/patterns/index.mjs +20 -0
  90. package/dist/patterns/link-overlay.d.ts +20 -0
  91. package/dist/patterns/link-overlay.mjs +24 -0
  92. package/dist/patterns/spacer.d.ts +20 -0
  93. package/dist/patterns/spacer.mjs +21 -0
  94. package/dist/patterns/square.d.ts +20 -0
  95. package/dist/patterns/square.mjs +24 -0
  96. package/dist/patterns/stack.d.ts +23 -0
  97. package/dist/patterns/stack.mjs +24 -0
  98. package/dist/patterns/visually-hidden.d.ts +20 -0
  99. package/dist/patterns/visually-hidden.mjs +18 -0
  100. package/dist/patterns/vstack.d.ts +21 -0
  101. package/dist/patterns/vstack.mjs +24 -0
  102. package/dist/patterns/wrap.d.ts +24 -0
  103. package/dist/patterns/wrap.mjs +25 -0
  104. package/dist/recipes/absolute-center.d.ts +34 -0
  105. package/dist/recipes/absolute-center.mjs +32 -0
  106. package/dist/recipes/action-bar.d.ts +31 -0
  107. package/dist/recipes/action-bar.mjs +49 -0
  108. package/dist/recipes/avatar.d.ts +43 -0
  109. package/dist/recipes/avatar.mjs +75 -0
  110. package/dist/recipes/badge.d.ts +38 -0
  111. package/dist/recipes/badge.mjs +40 -0
  112. package/dist/recipes/breadcrumb.d.ts +38 -0
  113. package/dist/recipes/breadcrumb.mjs +70 -0
  114. package/dist/recipes/button.d.ts +38 -0
  115. package/dist/recipes/button.mjs +44 -0
  116. package/dist/recipes/card.d.ts +34 -0
  117. package/dist/recipes/card.mjs +63 -0
  118. package/dist/recipes/carousel.d.ts +35 -0
  119. package/dist/recipes/carousel.mjs +93 -0
  120. package/dist/recipes/checkbox.d.ts +38 -0
  121. package/dist/recipes/checkbox.mjs +67 -0
  122. package/dist/recipes/checkmark.d.ts +38 -0
  123. package/dist/recipes/checkmark.mjs +39 -0
  124. package/dist/recipes/clipboard.d.ts +31 -0
  125. package/dist/recipes/clipboard.mjs +53 -0
  126. package/dist/recipes/collapsible.d.ts +34 -0
  127. package/dist/recipes/collapsible.mjs +54 -0
  128. package/dist/recipes/combobox.d.ts +38 -0
  129. package/dist/recipes/combobox.mjs +112 -0
  130. package/dist/recipes/create-recipe.mjs +82 -0
  131. package/dist/recipes/data-list.d.ts +31 -0
  132. package/dist/recipes/data-list.mjs +53 -0
  133. package/dist/recipes/date-picker.d.ts +31 -0
  134. package/dist/recipes/date-picker.mjs +133 -0
  135. package/dist/recipes/dialog.d.ts +46 -0
  136. package/dist/recipes/dialog.mjs +106 -0
  137. package/dist/recipes/drawer.d.ts +38 -0
  138. package/dist/recipes/drawer.mjs +90 -0
  139. package/dist/recipes/drilldown-menu.d.ts +31 -0
  140. package/dist/recipes/drilldown-menu.mjs +53 -0
  141. package/dist/recipes/field.d.ts +31 -0
  142. package/dist/recipes/field.mjs +61 -0
  143. package/dist/recipes/fieldset.d.ts +31 -0
  144. package/dist/recipes/fieldset.mjs +73 -0
  145. package/dist/recipes/floating-panel.d.ts +31 -0
  146. package/dist/recipes/floating-panel.mjs +73 -0
  147. package/dist/recipes/form.d.ts +31 -0
  148. package/dist/recipes/form.mjs +24 -0
  149. package/dist/recipes/group.d.ts +36 -0
  150. package/dist/recipes/group.mjs +72 -0
  151. package/dist/recipes/heading.d.ts +31 -0
  152. package/dist/recipes/heading.mjs +38 -0
  153. package/dist/recipes/icon.d.ts +34 -0
  154. package/dist/recipes/icon.mjs +36 -0
  155. package/dist/recipes/index.d.ts +58 -0
  156. package/dist/recipes/index.mjs +57 -0
  157. package/dist/recipes/input-addon.d.ts +38 -0
  158. package/dist/recipes/input-addon.mjs +39 -0
  159. package/dist/recipes/input-group.d.ts +34 -0
  160. package/dist/recipes/input-group.mjs +49 -0
  161. package/dist/recipes/input.d.ts +38 -0
  162. package/dist/recipes/input.mjs +42 -0
  163. package/dist/recipes/kbd.d.ts +38 -0
  164. package/dist/recipes/kbd.mjs +42 -0
  165. package/dist/recipes/link.d.ts +34 -0
  166. package/dist/recipes/link.mjs +30 -0
  167. package/dist/recipes/mark.d.ts +34 -0
  168. package/dist/recipes/mark.mjs +32 -0
  169. package/dist/recipes/menu.d.ts +34 -0
  170. package/dist/recipes/menu.mjs +97 -0
  171. package/dist/recipes/number-input.d.ts +38 -0
  172. package/dist/recipes/number-input.mjs +78 -0
  173. package/dist/recipes/pagination.d.ts +31 -0
  174. package/dist/recipes/pagination.mjs +57 -0
  175. package/dist/recipes/popover.d.ts +31 -0
  176. package/dist/recipes/popover.mjs +81 -0
  177. package/dist/recipes/progress-circle.d.ts +34 -0
  178. package/dist/recipes/progress-circle.mjs +75 -0
  179. package/dist/recipes/progress.d.ts +44 -0
  180. package/dist/recipes/progress.mjs +98 -0
  181. package/dist/recipes/radio-card-group.d.ts +38 -0
  182. package/dist/recipes/radio-card-group.mjs +69 -0
  183. package/dist/recipes/radio-group.d.ts +38 -0
  184. package/dist/recipes/radio-group.mjs +68 -0
  185. package/dist/recipes/scroll-area.d.ts +38 -0
  186. package/dist/recipes/scroll-area.mjs +70 -0
  187. package/dist/recipes/segment-group.d.ts +35 -0
  188. package/dist/recipes/segment-group.mjs +69 -0
  189. package/dist/recipes/select.d.ts +38 -0
  190. package/dist/recipes/select.mjs +111 -0
  191. package/dist/recipes/skeleton.d.ts +39 -0
  192. package/dist/recipes/skeleton.mjs +40 -0
  193. package/dist/recipes/slider.d.ts +42 -0
  194. package/dist/recipes/slider.mjs +94 -0
  195. package/dist/recipes/spinner.d.ts +34 -0
  196. package/dist/recipes/spinner.mjs +36 -0
  197. package/dist/recipes/stat.d.ts +31 -0
  198. package/dist/recipes/stat.mjs +41 -0
  199. package/dist/recipes/steps.d.ts +42 -0
  200. package/dist/recipes/steps.mjs +97 -0
  201. package/dist/recipes/switch-recipe.d.ts +38 -0
  202. package/dist/recipes/switch-recipe.mjs +65 -0
  203. package/dist/recipes/table.d.ts +40 -0
  204. package/dist/recipes/table.mjs +83 -0
  205. package/dist/recipes/tabs.d.ts +39 -0
  206. package/dist/recipes/tabs.mjs +72 -0
  207. package/dist/recipes/tags-input.d.ts +38 -0
  208. package/dist/recipes/tags-input.mjs +86 -0
  209. package/dist/recipes/text.d.ts +31 -0
  210. package/dist/recipes/text.mjs +38 -0
  211. package/dist/recipes/textarea.d.ts +38 -0
  212. package/dist/recipes/textarea.mjs +41 -0
  213. package/dist/recipes/toast.d.ts +31 -0
  214. package/dist/recipes/toast.mjs +53 -0
  215. package/dist/recipes/toggle-group.d.ts +31 -0
  216. package/dist/recipes/toggle-group.mjs +44 -0
  217. package/dist/recipes/tooltip.d.ts +34 -0
  218. package/dist/recipes/tooltip.mjs +57 -0
  219. package/dist/recipes/tree-view.d.ts +34 -0
  220. package/dist/recipes/tree-view.mjs +97 -0
  221. package/dist/tokens/index.d.ts +9 -0
  222. package/dist/tokens/index.mjs +3060 -0
  223. package/dist/tokens/tokens.d.ts +63 -0
  224. package/dist/types/composition.d.ts +227 -0
  225. package/dist/types/conditions.d.ts +314 -0
  226. package/dist/types/csstype.d.ts +22570 -0
  227. package/dist/types/global.d.ts +20 -0
  228. package/dist/types/index.d.ts +8 -0
  229. package/dist/types/jsx.d.ts +69 -0
  230. package/dist/types/parts.d.ts +8 -0
  231. package/dist/types/pattern.d.ts +78 -0
  232. package/dist/types/prop-type.d.ts +253 -0
  233. package/dist/types/recipe.d.ts +181 -0
  234. package/dist/types/selectors.d.ts +59 -0
  235. package/dist/types/static-css.d.ts +56 -0
  236. package/dist/types/style-props.d.ts +8091 -0
  237. package/dist/types/system-types.d.ts +151 -0
  238. package/package.json +76 -0
@@ -0,0 +1,36 @@
1
+ import { withoutSpace } from '../helpers.mjs';
2
+
3
+ const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_pinned,_on,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base"
4
+ const conditions = new Set(conditionsStr.split(','))
5
+
6
+ const conditionRegex = /^@|&|&$/
7
+
8
+ export function isCondition(value){
9
+ return conditions.has(value) || conditionRegex.test(value)
10
+ }
11
+
12
+ const underscoreRegex = /^_/
13
+ const conditionsSelectorRegex = /&|@/
14
+
15
+ export function finalizeConditions(paths){
16
+ return paths.map((path) => {
17
+ if (conditions.has(path)){
18
+ return path.replace(underscoreRegex, '')
19
+ }
20
+
21
+ if (conditionsSelectorRegex.test(path)){
22
+ return `[${withoutSpace(path.trim())}]`
23
+ }
24
+
25
+ return path
26
+ })}
27
+
28
+ export function sortConditions(paths){
29
+ return paths.sort((a, b) => {
30
+ const aa = isCondition(a)
31
+ const bb = isCondition(b)
32
+ if (aa && !bb) return 1
33
+ if (!aa && bb) return -1
34
+ return 0
35
+ })
36
+ }
@@ -0,0 +1,22 @@
1
+ /* eslint-disable */
2
+ import type { SystemStyleObject } from '../types/index';
3
+
4
+ type Styles = SystemStyleObject | undefined | null | false
5
+
6
+ interface CssRawFunction {
7
+ (styles: Styles): SystemStyleObject
8
+ (styles: Styles[]): SystemStyleObject
9
+ (...styles: Array<Styles | Styles[]>): SystemStyleObject
10
+ (styles: Styles): SystemStyleObject
11
+ }
12
+
13
+ interface CssFunction {
14
+ (styles: Styles): string
15
+ (styles: Styles[]): string
16
+ (...styles: Array<Styles | Styles[]>): string
17
+ (styles: Styles): string
18
+
19
+ raw: CssRawFunction
20
+ }
21
+
22
+ export declare const css: CssFunction;
@@ -0,0 +1,45 @@
1
+ import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.mjs';
2
+ import { sortConditions, finalizeConditions } from './conditions.mjs';
3
+
4
+ const utilities = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,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:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,backgroundLinear:bg-linear/bgLinear,backgroundRadial:bg-radial/bgRadial,backgroundConic:bg-conic/bgConic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor,textStyle:textStyle,layerStyle:layerStyle,animationStyle:animationStyle"
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","2xl"] }
27
+ },
28
+ utility: {
29
+
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
+ toHash: (path, hashFn) => hashFn(path.join(":")),
37
+ resolveShorthand: resolveShorthand,
38
+ }
39
+ }
40
+
41
+ const cssFn = createCss(context)
42
+ export const css = (...styles) => cssFn(mergeCss(...styles))
43
+ css.raw = (...styles) => mergeCss(...styles)
44
+
45
+ export const { mergeCss, assignCss } = createMergeCss(context)
@@ -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 { RecipeVariant, RecipeVariantProps } from '../types/recipe';
@@ -0,0 +1,87 @@
1
+ import { compact, mergeProps, memo, 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
+ const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
15
+
16
+ function resolve(props = {}) {
17
+ const computedVariants = getVariantProps(props)
18
+ let variantCss = { ...base }
19
+ for (const [key, value] of Object.entries(computedVariants)) {
20
+ if (variants[key]?.[value]) {
21
+ variantCss = mergeCss(variantCss, variants[key][value])
22
+ }
23
+ }
24
+ const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants)
25
+ return mergeCss(variantCss, compoundVariantCss)
26
+ }
27
+
28
+ function merge(__cva) {
29
+ const override = defaults(__cva.config)
30
+ const variantKeys = uniq(__cva.variantKeys, Object.keys(variants))
31
+ return cva({
32
+ base: mergeCss(base, override.base),
33
+ variants: Object.fromEntries(
34
+ variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
35
+ ),
36
+ defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
37
+ compoundVariants: [...compoundVariants, ...override.compoundVariants],
38
+ })
39
+ }
40
+
41
+ function cvaFn(props) {
42
+ return css(resolve(props))
43
+ }
44
+
45
+ const variantKeys = Object.keys(variants)
46
+
47
+ function splitVariantProps(props) {
48
+ return splitProps(props, variantKeys)
49
+ }
50
+
51
+ const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
52
+
53
+ return Object.assign(memo(cvaFn), {
54
+ __cva__: true,
55
+ variantMap,
56
+ variantKeys,
57
+ raw: resolve,
58
+ config,
59
+ merge,
60
+ splitVariantProps,
61
+ getVariantProps
62
+ })
63
+ }
64
+
65
+ export function getCompoundVariantCss(compoundVariants, variantMap) {
66
+ let result = {}
67
+ compoundVariants.forEach((compoundVariant) => {
68
+ const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
69
+ if (key === 'css') return true
70
+
71
+ const values = Array.isArray(value) ? value : [value]
72
+ return values.some((value) => variantMap[key] === value)
73
+ })
74
+
75
+ if (isMatching) {
76
+ result = mergeCss(result, compoundVariant.css)
77
+ }
78
+ })
79
+
80
+ return result
81
+ }
82
+
83
+ export function assertCompoundVariant(name, compoundVariants, variants, prop) {
84
+ if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
85
+ throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
86
+ }
87
+ }
@@ -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
@@ -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 }
@@ -0,0 +1,5 @@
1
+ /* eslint-disable */
2
+ export * from './css';
3
+ export * from './cx';
4
+ export * from './cva';
5
+ export * from './sva';
@@ -0,0 +1,4 @@
1
+ export * from './css.mjs';
2
+ export * from './cx.mjs';
3
+ export * from './cva.mjs';
4
+ export * from './sva.mjs';
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ import type { SlotRecipeCreatorFn } from '../types/recipe';
3
+
4
+ export declare const sva: SlotRecipeCreatorFn
@@ -0,0 +1,46 @@
1
+ import { compact, getSlotRecipes, memo, splitProps } from '../helpers.mjs';
2
+ import { cva } from './cva.mjs';
3
+ import { cx } from './cx.mjs';
4
+
5
+ export function sva(config) {
6
+ const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
7
+ const defaultVariants = config.defaultVariants ?? {}
8
+
9
+ const classNameMap = slots.reduce((acc, [slot, cvaFn]) => {
10
+ if (config.className) acc[slot] = cvaFn.config.className
11
+ return acc
12
+ }, {})
13
+
14
+ function svaFn(props) {
15
+ const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), classNameMap[slot])])
16
+ return Object.fromEntries(result)
17
+ }
18
+
19
+ function raw(props) {
20
+ const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
21
+ return Object.fromEntries(result)
22
+ }
23
+
24
+ const variants = config.variants ?? {};
25
+ const variantKeys = Object.keys(variants);
26
+
27
+ function splitVariantProps(props) {
28
+ return splitProps(props, variantKeys);
29
+ }
30
+ const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
31
+
32
+ const variantMap = Object.fromEntries(
33
+ Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
34
+ );
35
+
36
+ return Object.assign(memo(svaFn), {
37
+ __cva__: false,
38
+ raw,
39
+ config,
40
+ variantMap,
41
+ variantKeys,
42
+ classNameMap,
43
+ splitVariantProps,
44
+ getVariantProps,
45
+ })
46
+ }
@@ -0,0 +1,328 @@
1
+ // src/assert.ts
2
+ function isObject(value) {
3
+ return typeof value === "object" && value != null && !Array.isArray(value);
4
+ }
5
+ var isObjectOrArray = (obj) => typeof obj === "object" && obj !== null;
6
+
7
+ // src/compact.ts
8
+ function compact(value) {
9
+ return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
10
+ }
11
+
12
+ // src/condition.ts
13
+ var isBaseCondition = (v) => v === "base";
14
+ function filterBaseConditions(c) {
15
+ return c.slice().filter((v) => !isBaseCondition(v));
16
+ }
17
+
18
+ // src/hash.ts
19
+ function toChar(code) {
20
+ return String.fromCharCode(code + (code > 25 ? 39 : 97));
21
+ }
22
+ function toName(code) {
23
+ let name = "";
24
+ let x;
25
+ for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
26
+ return toChar(x % 52) + name;
27
+ }
28
+ function toPhash(h, x) {
29
+ let i = x.length;
30
+ while (i) h = h * 33 ^ x.charCodeAt(--i);
31
+ return h;
32
+ }
33
+ function toHash(value) {
34
+ return toName(toPhash(5381, value) >>> 0);
35
+ }
36
+
37
+ // src/important.ts
38
+ var importantRegex = /\s*!(important)?/i;
39
+ function isImportant(value) {
40
+ return typeof value === "string" ? importantRegex.test(value) : false;
41
+ }
42
+ function withoutImportant(value) {
43
+ return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
44
+ }
45
+ function withoutSpace(str) {
46
+ return typeof str === "string" ? str.replaceAll(" ", "_") : str;
47
+ }
48
+
49
+ // src/memo.ts
50
+ var memo = (fn) => {
51
+ const cache = /* @__PURE__ */ new Map();
52
+ const get = (...args) => {
53
+ const key = JSON.stringify(args);
54
+ if (cache.has(key)) {
55
+ return cache.get(key);
56
+ }
57
+ const result = fn(...args);
58
+ cache.set(key, result);
59
+ return result;
60
+ };
61
+ return get;
62
+ };
63
+
64
+ // src/merge-props.ts
65
+ var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
66
+ function mergeProps(...sources) {
67
+ return sources.reduce((prev, obj) => {
68
+ if (!obj) return prev;
69
+ Object.keys(obj).forEach((key) => {
70
+ if (MERGE_OMIT.has(key)) return;
71
+ const prevValue = prev[key];
72
+ const value = obj[key];
73
+ if (isObject(prevValue) && isObject(value)) {
74
+ prev[key] = mergeProps(prevValue, value);
75
+ } else {
76
+ prev[key] = value;
77
+ }
78
+ });
79
+ return prev;
80
+ }, {});
81
+ }
82
+
83
+ // src/walk-object.ts
84
+ var isNotNullish = (element) => element != null;
85
+ function walkObject(target, predicate, options = {}) {
86
+ const { stop, getKey } = options;
87
+ function inner(value, path = []) {
88
+ if (isObjectOrArray(value)) {
89
+ const result = {};
90
+ for (const [prop, child] of Object.entries(value)) {
91
+ const key = getKey?.(prop, child) ?? prop;
92
+ const childPath = [...path, key];
93
+ if (stop?.(value, childPath)) {
94
+ return predicate(value, path);
95
+ }
96
+ const next = inner(child, childPath);
97
+ if (isNotNullish(next)) {
98
+ result[key] = next;
99
+ }
100
+ }
101
+ return result;
102
+ }
103
+ return predicate(value, path);
104
+ }
105
+ return inner(target);
106
+ }
107
+ function mapObject(obj, fn) {
108
+ if (Array.isArray(obj)) return obj.map((value) => fn(value));
109
+ if (!isObject(obj)) return fn(obj);
110
+ return walkObject(obj, (value) => fn(value));
111
+ }
112
+
113
+ // src/normalize-style-object.ts
114
+ function toResponsiveObject(values, breakpoints) {
115
+ return values.reduce(
116
+ (acc, current, index) => {
117
+ const key = breakpoints[index];
118
+ if (current != null) {
119
+ acc[key] = current;
120
+ }
121
+ return acc;
122
+ },
123
+ {}
124
+ );
125
+ }
126
+ function normalizeStyleObject(styles, context, shorthand = true) {
127
+ const { utility, conditions } = context;
128
+ const { hasShorthand, resolveShorthand } = utility;
129
+ return walkObject(
130
+ styles,
131
+ (value) => {
132
+ return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
133
+ },
134
+ {
135
+ stop: (value) => Array.isArray(value),
136
+ getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
137
+ }
138
+ );
139
+ }
140
+
141
+ // src/classname.ts
142
+ var fallbackCondition = {
143
+ shift: (v) => v,
144
+ finalize: (v) => v,
145
+ breakpoints: { keys: [] }
146
+ };
147
+ var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
148
+ function createCss(context) {
149
+ const { utility, hash, conditions: conds = fallbackCondition } = context;
150
+ const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
151
+ const hashFn = (conditions, className) => {
152
+ let result;
153
+ if (hash) {
154
+ const baseArray = [...conds.finalize(conditions), className];
155
+ result = formatClassName(utility.toHash(baseArray, toHash));
156
+ } else {
157
+ const baseArray = [...conds.finalize(conditions), formatClassName(className)];
158
+ result = baseArray.join(":");
159
+ }
160
+ return result;
161
+ };
162
+ return memo(({ base, ...styles } = {}) => {
163
+ const styleObject = Object.assign(styles, base);
164
+ const normalizedObject = normalizeStyleObject(styleObject, context);
165
+ const classNames = /* @__PURE__ */ new Set();
166
+ walkObject(normalizedObject, (value, paths) => {
167
+ if (value == null) return;
168
+ const important = isImportant(value);
169
+ const [prop, ...allConditions] = conds.shift(paths);
170
+ const conditions = filterBaseConditions(allConditions);
171
+ const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
172
+ let className = hashFn(conditions, transformed.className);
173
+ if (important) className = `${className}!`;
174
+ classNames.add(className);
175
+ });
176
+ return Array.from(classNames).join(" ");
177
+ });
178
+ }
179
+ function compactStyles(...styles) {
180
+ return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
181
+ }
182
+ function createMergeCss(context) {
183
+ function resolve(styles) {
184
+ const allStyles = compactStyles(...styles);
185
+ if (allStyles.length === 1) return allStyles;
186
+ return allStyles.map((style) => normalizeStyleObject(style, context));
187
+ }
188
+ function mergeCss(...styles) {
189
+ return mergeProps(...resolve(styles));
190
+ }
191
+ function assignCss(...styles) {
192
+ return Object.assign({}, ...resolve(styles));
193
+ }
194
+ return { mergeCss: memo(mergeCss), assignCss };
195
+ }
196
+
197
+ // src/hypenate-property.ts
198
+ var wordRegex = /([A-Z])/g;
199
+ var msRegex = /^ms-/;
200
+ var hypenateProperty = memo((property) => {
201
+ if (property.startsWith("--")) return property;
202
+ return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
203
+ });
204
+
205
+ // src/is-css-function.ts
206
+ var fns = ["min", "max", "clamp", "calc"];
207
+ var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
208
+ var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
209
+
210
+ // src/is-css-unit.ts
211
+ var lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";
212
+ var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
213
+ var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
214
+ var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
215
+
216
+ // src/is-css-var.ts
217
+ var isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
218
+
219
+ // src/pattern-fns.ts
220
+ var patternFns = {
221
+ map: mapObject,
222
+ isCssFunction,
223
+ isCssVar,
224
+ isCssUnit
225
+ };
226
+ var getPatternStyles = (pattern, styles) => {
227
+ if (!pattern?.defaultValues) return styles;
228
+ const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
229
+ return Object.assign({}, defaults, compact(styles));
230
+ };
231
+
232
+ // src/slot.ts
233
+ var getSlotRecipes = (recipe = {}) => {
234
+ const init = (slot) => ({
235
+ className: [recipe.className, slot].filter(Boolean).join("__"),
236
+ base: recipe.base?.[slot] ?? {},
237
+ variants: {},
238
+ defaultVariants: recipe.defaultVariants ?? {},
239
+ compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
240
+ });
241
+ const slots = recipe.slots ?? [];
242
+ const recipeParts = slots.map((slot) => [slot, init(slot)]);
243
+ for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
244
+ for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
245
+ recipeParts.forEach(([slot, slotRecipe]) => {
246
+ slotRecipe.variants[variantsKey] ??= {};
247
+ slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
248
+ });
249
+ }
250
+ }
251
+ return Object.fromEntries(recipeParts);
252
+ };
253
+ var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
254
+
255
+ // src/split-props.ts
256
+ function splitProps(props, ...keys) {
257
+ const descriptors = Object.getOwnPropertyDescriptors(props);
258
+ const dKeys = Object.keys(descriptors);
259
+ const split = (k) => {
260
+ const clone = {};
261
+ for (let i = 0; i < k.length; i++) {
262
+ const key = k[i];
263
+ if (descriptors[key]) {
264
+ Object.defineProperty(clone, key, descriptors[key]);
265
+ delete descriptors[key];
266
+ }
267
+ }
268
+ return clone;
269
+ };
270
+ const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
271
+ return keys.map(fn).concat(split(dKeys));
272
+ }
273
+
274
+ // src/uniq.ts
275
+ var uniq = (...items) => {
276
+ const set = items.reduce((acc, currItems) => {
277
+ if (currItems) {
278
+ currItems.forEach((item) => acc.add(item));
279
+ }
280
+ return acc;
281
+ }, /* @__PURE__ */ new Set([]));
282
+ return Array.from(set);
283
+ };
284
+ export {
285
+ compact,
286
+ createCss,
287
+ createMergeCss,
288
+ filterBaseConditions,
289
+ getPatternStyles,
290
+ getSlotCompoundVariant,
291
+ getSlotRecipes,
292
+ hypenateProperty,
293
+ isBaseCondition,
294
+ isObject,
295
+ mapObject,
296
+ memo,
297
+ mergeProps,
298
+ patternFns,
299
+ splitProps,
300
+ toHash,
301
+ uniq,
302
+ walkObject,
303
+ withoutSpace
304
+ };
305
+
306
+
307
+
308
+ // src/normalize-html.ts
309
+ var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
310
+ function convert(key) {
311
+ return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
312
+ }
313
+ function normalizeHTMLProps(props) {
314
+ return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
315
+ }
316
+ normalizeHTMLProps.keys = htmlProps;
317
+ export {
318
+ normalizeHTMLProps
319
+ };
320
+
321
+
322
+ export function __spreadValues(a, b) {
323
+ return { ...a, ...b }
324
+ }
325
+
326
+ export function __objRest(source, exclude) {
327
+ return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
328
+ }
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ import type { FunctionComponent } from 'react'
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: FunctionComponent<AspectRatioProps>
@@ -0,0 +1,14 @@
1
+ import { createElement, forwardRef } from 'react'
2
+
3
+ import { splitProps } from '../helpers.mjs';
4
+ import { getAspectRatioStyle } from '../patterns/aspect-ratio.mjs';
5
+ import { styled } from './factory.mjs';
6
+
7
+ export const AspectRatio = /* @__PURE__ */ forwardRef(function AspectRatio(props, ref) {
8
+ const [patternProps, restProps] = splitProps(props, ["ratio"])
9
+
10
+ const styleProps = getAspectRatioStyle(patternProps)
11
+ const mergedProps = { ref, ...styleProps, ...restProps }
12
+
13
+ return createElement(styled.div, mergedProps)
14
+ })
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ import type { FunctionComponent } from 'react'
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: FunctionComponent<BleedProps>