@pandacss/studio 0.10.0 → 0.11.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.
- package/package.json +8 -8
- package/styled-system/css/css.mjs +12 -8
- package/styled-system/jsx/bleed.d.ts +9 -0
- package/styled-system/jsx/bleed.mjs +9 -0
- package/styled-system/jsx/index.d.ts +2 -0
- package/styled-system/jsx/index.mjs +2 -0
- package/styled-system/jsx/visually-hidden.d.ts +9 -0
- package/styled-system/jsx/visually-hidden.mjs +8 -0
- package/styled-system/patterns/bleed.d.ts +21 -0
- package/styled-system/patterns/bleed.mjs +20 -0
- package/styled-system/patterns/index.d.ts +2 -0
- package/styled-system/patterns/index.mjs +2 -0
- package/styled-system/patterns/visually-hidden.d.ts +20 -0
- package/styled-system/patterns/visually-hidden.mjs +16 -0
- package/styled-system/types/prop-type.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "The automated token documentation for Panda CSS",
|
|
5
5
|
"main": "dist/studio.js",
|
|
6
6
|
"module": "dist/studio.mjs",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"react": "18.2.0",
|
|
34
34
|
"react-dom": "18.2.0",
|
|
35
35
|
"vite": "4.4.8",
|
|
36
|
-
"@pandacss/types": "0.
|
|
37
|
-
"@pandacss/config": "0.
|
|
38
|
-
"@pandacss/shared": "0.
|
|
39
|
-
"@pandacss/token-dictionary": "0.
|
|
40
|
-
"@pandacss/logger": "0.
|
|
41
|
-
"@pandacss/node": "0.
|
|
36
|
+
"@pandacss/types": "0.11.0",
|
|
37
|
+
"@pandacss/config": "0.11.0",
|
|
38
|
+
"@pandacss/shared": "0.11.0",
|
|
39
|
+
"@pandacss/token-dictionary": "0.11.0",
|
|
40
|
+
"@pandacss/logger": "0.11.0",
|
|
41
|
+
"@pandacss/node": "0.11.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "18.2.18",
|
|
45
45
|
"@types/react-dom": "18.2.7",
|
|
46
46
|
"@vitejs/plugin-react": "4.0.4",
|
|
47
47
|
"execa": "7.2.0",
|
|
48
|
-
"@pandacss/dev": "0.
|
|
48
|
+
"@pandacss/dev": "0.11.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"codegen": "panda",
|
|
@@ -2,18 +2,22 @@ import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../he
|
|
|
2
2
|
import { sortConditions, finalizeConditions } from './conditions.mjs'
|
|
3
3
|
|
|
4
4
|
const utilities =
|
|
5
|
-
'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/1,insetInlineStart:start/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/paddingY,paddingBlockEnd:pb,paddingBlockStart:pt,paddingInline:px/1,paddingInlineEnd:pe/paddingEnd,paddingInlineStart:ps/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/marginY,marginBlockEnd:mb,marginBlockStart:mt,marginInline:mx/marginX,marginInlineEnd:me/marginEnd,marginInlineStart:ms/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,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,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,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
|
+
'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,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,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,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'
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const shorthands =
|
|
7
|
+
const classNames = new Map()
|
|
8
|
+
const shorthands = new Map()
|
|
9
9
|
utilities.split(',').forEach((utility) => {
|
|
10
10
|
const [prop, meta] = utility.split(':')
|
|
11
|
-
const [className,
|
|
12
|
-
|
|
13
|
-
if (
|
|
11
|
+
const [className, ...shorthandList] = meta.split('/')
|
|
12
|
+
classNames.set(prop, className)
|
|
13
|
+
if (shorthandList.length) {
|
|
14
|
+
shorthandList.forEach((shorthand) => {
|
|
15
|
+
shorthands.set(shorthand === '1' ? className : shorthand, prop)
|
|
16
|
+
})
|
|
17
|
+
}
|
|
14
18
|
})
|
|
15
19
|
|
|
16
|
-
const resolveShorthand = (prop) => shorthands
|
|
20
|
+
const resolveShorthand = (prop) => shorthands.get(prop) || prop
|
|
17
21
|
|
|
18
22
|
const context = {
|
|
19
23
|
conditions: {
|
|
@@ -24,7 +28,7 @@ const context = {
|
|
|
24
28
|
utility: {
|
|
25
29
|
transform: (prop, value) => {
|
|
26
30
|
const key = resolveShorthand(prop)
|
|
27
|
-
const propKey =
|
|
31
|
+
const propKey = classNames.get(key) || hypenateProperty(key)
|
|
28
32
|
return { className: `${propKey}_${withoutSpace(value)}` }
|
|
29
33
|
},
|
|
30
34
|
hasShorthand: true,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { FunctionComponent } from 'react'
|
|
3
|
+
import type { BleedProperties } from '../patterns/bleed'
|
|
4
|
+
import type { HTMLPandaProps } from '../types/jsx'
|
|
5
|
+
|
|
6
|
+
export type BleedProps = BleedProperties & Omit<HTMLPandaProps<'div'>, keyof BleedProperties >
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export declare const Bleed: FunctionComponent<BleedProps>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createElement, forwardRef } from 'react'
|
|
2
|
+
import { panda } from './factory.mjs'
|
|
3
|
+
import { getBleedStyle } from '../patterns/bleed.mjs'
|
|
4
|
+
|
|
5
|
+
export const Bleed = /* @__PURE__ */ forwardRef(function Bleed(props, ref) {
|
|
6
|
+
const { inline, block, ...restProps } = props
|
|
7
|
+
const styleProps = getBleedStyle({ inline, block })
|
|
8
|
+
return createElement(panda.div, { ref, ...styleProps, ...restProps })
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { FunctionComponent } from 'react'
|
|
3
|
+
import type { VisuallyHiddenProperties } from '../patterns/visually-hidden'
|
|
4
|
+
import type { HTMLPandaProps } from '../types/jsx'
|
|
5
|
+
|
|
6
|
+
export type VisuallyHiddenProps = VisuallyHiddenProperties & Omit<HTMLPandaProps<'div'>, keyof VisuallyHiddenProperties >
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export declare const VisuallyHidden: FunctionComponent<VisuallyHiddenProps>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createElement, forwardRef } from 'react'
|
|
2
|
+
import { panda } from './factory.mjs'
|
|
3
|
+
import { getVisuallyHiddenStyle } from '../patterns/visually-hidden.mjs'
|
|
4
|
+
|
|
5
|
+
export const VisuallyHidden = /* @__PURE__ */ forwardRef(function VisuallyHidden(props, ref) {
|
|
6
|
+
const styleProps = getVisuallyHiddenStyle()
|
|
7
|
+
return createElement(panda.div, { ref, ...styleProps, ...props })
|
|
8
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
3
|
+
import type { PropertyValue } from '../types/prop-type'
|
|
4
|
+
import type { Properties } from '../types/csstype'
|
|
5
|
+
import type { Tokens } from '../tokens'
|
|
6
|
+
|
|
7
|
+
export type BleedProperties = {
|
|
8
|
+
inline?: PropertyValue<'marginInline'>
|
|
9
|
+
block?: PropertyValue<'marginBlock'>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
type BleedOptions = BleedProperties & Omit<SystemStyleObject, keyof BleedProperties >
|
|
14
|
+
|
|
15
|
+
interface BleedPatternFn {
|
|
16
|
+
(options?: BleedOptions): string
|
|
17
|
+
raw: (options: BleedOptions) => BleedOptions
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export declare const bleed: BleedPatternFn;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { mapObject } from '../helpers.mjs'
|
|
2
|
+
import { css } from '../css/index.mjs'
|
|
3
|
+
|
|
4
|
+
const bleedConfig = {
|
|
5
|
+
transform(props) {
|
|
6
|
+
const { inline = '0', block = '0', ...rest } = props
|
|
7
|
+
return {
|
|
8
|
+
'--bleed-x': `spacing.${inline}`,
|
|
9
|
+
'--bleed-y': `spacing.${block}`,
|
|
10
|
+
marginInline: 'calc(var(--bleed-x, 0) * -1)',
|
|
11
|
+
marginBlock: 'calc(var(--bleed-y, 0) * -1)',
|
|
12
|
+
...rest,
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const getBleedStyle = (styles = {}) => bleedConfig.transform(styles, { map: mapObject })
|
|
18
|
+
|
|
19
|
+
export const bleed = (styles) => css(getBleedStyle(styles))
|
|
20
|
+
bleed.raw = (styles) => styles
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
3
|
+
import type { PropertyValue } from '../types/prop-type'
|
|
4
|
+
import type { Properties } from '../types/csstype'
|
|
5
|
+
import type { Tokens } from '../tokens'
|
|
6
|
+
|
|
7
|
+
export type VisuallyHiddenProperties = {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
type VisuallyHiddenOptions = VisuallyHiddenProperties & Omit<SystemStyleObject, keyof VisuallyHiddenProperties >
|
|
13
|
+
|
|
14
|
+
interface VisuallyHiddenPatternFn {
|
|
15
|
+
(options?: VisuallyHiddenOptions): string
|
|
16
|
+
raw: (options: VisuallyHiddenOptions) => VisuallyHiddenOptions
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export declare const visuallyHidden: VisuallyHiddenPatternFn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { mapObject } from '../helpers.mjs'
|
|
2
|
+
import { css } from '../css/index.mjs'
|
|
3
|
+
|
|
4
|
+
const visuallyHiddenConfig = {
|
|
5
|
+
transform(props) {
|
|
6
|
+
return {
|
|
7
|
+
srOnly: true,
|
|
8
|
+
...props,
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getVisuallyHiddenStyle = (styles = {}) => visuallyHiddenConfig.transform(styles, { map: mapObject })
|
|
14
|
+
|
|
15
|
+
export const visuallyHidden = (styles) => css(getVisuallyHiddenStyle(styles))
|
|
16
|
+
visuallyHidden.raw = (styles) => styles
|
|
@@ -302,7 +302,7 @@ type PropertyValueTypes = {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
305
|
-
? ConditionalValue<PropertyTypes[T] | CssValue<T
|
|
305
|
+
? ConditionalValue<PropertyTypes[T] | CssValue<T> | (string & {})>
|
|
306
306
|
: T extends keyof CssProperties
|
|
307
|
-
? ConditionalValue<CssProperties[T]>
|
|
307
|
+
? ConditionalValue<CssProperties[T] | (string & {})>
|
|
308
308
|
: ConditionalValue<string | number>
|