@luxonis/depthai-pipeline-lib 3.4.0-rc.2 → 3.5.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/dist/index.css +1696 -2
- package/dist/src/components/BridgeEdge.js +3 -13
- package/dist/src/components/Node.js +18 -65
- package/dist/src/components/PipelineCanvas.js +1 -2
- package/dist/src/components/PipelineLegend.d.ts +1 -1
- package/dist/src/components/PipelineLegend.js +10 -24
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -5
- package/dist/panda.css +0 -1342
- package/dist/src/styled-system/css/conditions.mjs +0 -36
- package/dist/src/styled-system/css/css.d.mts +0 -22
- package/dist/src/styled-system/css/css.mjs +0 -45
- package/dist/src/styled-system/css/cva.d.mts +0 -6
- package/dist/src/styled-system/css/cva.mjs +0 -87
- package/dist/src/styled-system/css/cx.d.mts +0 -5
- package/dist/src/styled-system/css/cx.mjs +0 -15
- package/dist/src/styled-system/css/index.d.mts +0 -5
- package/dist/src/styled-system/css/index.mjs +0 -4
- package/dist/src/styled-system/css/sva.d.mts +0 -4
- package/dist/src/styled-system/css/sva.mjs +0 -41
- package/dist/src/styled-system/helpers.mjs +0 -327
- package/dist/src/styled-system/patterns/aspect-ratio.d.mts +0 -21
- package/dist/src/styled-system/patterns/aspect-ratio.mjs +0 -38
- package/dist/src/styled-system/patterns/bleed.d.mts +0 -22
- package/dist/src/styled-system/patterns/bleed.mjs +0 -24
- package/dist/src/styled-system/patterns/box.d.mts +0 -21
- package/dist/src/styled-system/patterns/box.mjs +0 -15
- package/dist/src/styled-system/patterns/center.d.mts +0 -21
- package/dist/src/styled-system/patterns/center.mjs +0 -21
- package/dist/src/styled-system/patterns/circle.d.mts +0 -21
- package/dist/src/styled-system/patterns/circle.mjs +0 -25
- package/dist/src/styled-system/patterns/container.d.mts +0 -21
- package/dist/src/styled-system/patterns/container.mjs +0 -21
- package/dist/src/styled-system/patterns/cq.d.mts +0 -22
- package/dist/src/styled-system/patterns/cq.mjs +0 -21
- package/dist/src/styled-system/patterns/divider.d.mts +0 -23
- package/dist/src/styled-system/patterns/divider.mjs +0 -25
- package/dist/src/styled-system/patterns/flex.d.mts +0 -27
- package/dist/src/styled-system/patterns/flex.mjs +0 -26
- package/dist/src/styled-system/patterns/float.d.mts +0 -24
- package/dist/src/styled-system/patterns/float.mjs +0 -52
- package/dist/src/styled-system/patterns/grid-item.d.mts +0 -26
- package/dist/src/styled-system/patterns/grid-item.mjs +0 -25
- package/dist/src/styled-system/patterns/grid.d.mts +0 -25
- package/dist/src/styled-system/patterns/grid.mjs +0 -27
- package/dist/src/styled-system/patterns/hstack.d.mts +0 -22
- package/dist/src/styled-system/patterns/hstack.mjs +0 -24
- package/dist/src/styled-system/patterns/index.d.mts +0 -21
- package/dist/src/styled-system/patterns/index.mjs +0 -20
- package/dist/src/styled-system/patterns/link-overlay.d.mts +0 -21
- package/dist/src/styled-system/patterns/link-overlay.mjs +0 -24
- package/dist/src/styled-system/patterns/spacer.d.mts +0 -21
- package/dist/src/styled-system/patterns/spacer.mjs +0 -21
- package/dist/src/styled-system/patterns/square.d.mts +0 -21
- package/dist/src/styled-system/patterns/square.mjs +0 -24
- package/dist/src/styled-system/patterns/stack.d.mts +0 -24
- package/dist/src/styled-system/patterns/stack.mjs +0 -24
- package/dist/src/styled-system/patterns/visually-hidden.d.mts +0 -21
- package/dist/src/styled-system/patterns/visually-hidden.mjs +0 -18
- package/dist/src/styled-system/patterns/vstack.d.mts +0 -22
- package/dist/src/styled-system/patterns/vstack.mjs +0 -24
- package/dist/src/styled-system/patterns/wrap.d.mts +0 -25
- package/dist/src/styled-system/patterns/wrap.mjs +0 -25
- package/dist/src/styled-system/recipes/accordion.d.mts +0 -32
- package/dist/src/styled-system/recipes/accordion.mjs +0 -48
- package/dist/src/styled-system/recipes/alert-description.d.mts +0 -32
- package/dist/src/styled-system/recipes/alert-description.mjs +0 -24
- package/dist/src/styled-system/recipes/alert-dialog.d.mts +0 -32
- package/dist/src/styled-system/recipes/alert-dialog.mjs +0 -72
- package/dist/src/styled-system/recipes/alert-title.d.mts +0 -32
- package/dist/src/styled-system/recipes/alert-title.mjs +0 -24
- package/dist/src/styled-system/recipes/alert.d.mts +0 -35
- package/dist/src/styled-system/recipes/alert.mjs +0 -31
- package/dist/src/styled-system/recipes/avatar.d.mts +0 -32
- package/dist/src/styled-system/recipes/avatar.mjs +0 -40
- package/dist/src/styled-system/recipes/badge.d.mts +0 -35
- package/dist/src/styled-system/recipes/badge.mjs +0 -33
- package/dist/src/styled-system/recipes/blockquote.d.mts +0 -32
- package/dist/src/styled-system/recipes/blockquote.mjs +0 -24
- package/dist/src/styled-system/recipes/button.d.mts +0 -39
- package/dist/src/styled-system/recipes/button.mjs +0 -42
- package/dist/src/styled-system/recipes/calendar.d.mts +0 -32
- package/dist/src/styled-system/recipes/calendar.mjs +0 -120
- package/dist/src/styled-system/recipes/card-content.d.mts +0 -32
- package/dist/src/styled-system/recipes/card-content.mjs +0 -24
- package/dist/src/styled-system/recipes/card-description.d.mts +0 -32
- package/dist/src/styled-system/recipes/card-description.mjs +0 -24
- package/dist/src/styled-system/recipes/card-footer.d.mts +0 -32
- package/dist/src/styled-system/recipes/card-footer.mjs +0 -24
- package/dist/src/styled-system/recipes/card-header.d.mts +0 -32
- package/dist/src/styled-system/recipes/card-header.mjs +0 -24
- package/dist/src/styled-system/recipes/card-title.d.mts +0 -32
- package/dist/src/styled-system/recipes/card-title.mjs +0 -24
- package/dist/src/styled-system/recipes/card.d.mts +0 -32
- package/dist/src/styled-system/recipes/card.mjs +0 -24
- package/dist/src/styled-system/recipes/checkbox.d.mts +0 -32
- package/dist/src/styled-system/recipes/checkbox.mjs +0 -36
- package/dist/src/styled-system/recipes/collapsible.d.mts +0 -32
- package/dist/src/styled-system/recipes/collapsible.mjs +0 -40
- package/dist/src/styled-system/recipes/command-dialog.d.mts +0 -32
- package/dist/src/styled-system/recipes/command-dialog.mjs +0 -36
- package/dist/src/styled-system/recipes/command.d.mts +0 -32
- package/dist/src/styled-system/recipes/command.mjs +0 -68
- package/dist/src/styled-system/recipes/context-menu.d.mts +0 -35
- package/dist/src/styled-system/recipes/context-menu.mjs +0 -100
- package/dist/src/styled-system/recipes/create-recipe.mjs +0 -82
- package/dist/src/styled-system/recipes/dialog.d.mts +0 -32
- package/dist/src/styled-system/recipes/dialog.mjs +0 -68
- package/dist/src/styled-system/recipes/dropdown-menu.d.mts +0 -32
- package/dist/src/styled-system/recipes/dropdown-menu.mjs +0 -92
- package/dist/src/styled-system/recipes/form-control.d.mts +0 -32
- package/dist/src/styled-system/recipes/form-control.mjs +0 -24
- package/dist/src/styled-system/recipes/form-description.d.mts +0 -32
- package/dist/src/styled-system/recipes/form-description.mjs +0 -24
- package/dist/src/styled-system/recipes/form-item.d.mts +0 -32
- package/dist/src/styled-system/recipes/form-item.mjs +0 -24
- package/dist/src/styled-system/recipes/form-label.d.mts +0 -32
- package/dist/src/styled-system/recipes/form-label.mjs +0 -24
- package/dist/src/styled-system/recipes/form-message.d.mts +0 -32
- package/dist/src/styled-system/recipes/form-message.mjs +0 -24
- package/dist/src/styled-system/recipes/h1.d.mts +0 -32
- package/dist/src/styled-system/recipes/h1.mjs +0 -24
- package/dist/src/styled-system/recipes/h2.d.mts +0 -32
- package/dist/src/styled-system/recipes/h2.mjs +0 -24
- package/dist/src/styled-system/recipes/h3.d.mts +0 -32
- package/dist/src/styled-system/recipes/h3.mjs +0 -24
- package/dist/src/styled-system/recipes/h4.d.mts +0 -32
- package/dist/src/styled-system/recipes/h4.mjs +0 -24
- package/dist/src/styled-system/recipes/hover-card.d.mts +0 -32
- package/dist/src/styled-system/recipes/hover-card.mjs +0 -40
- package/dist/src/styled-system/recipes/icon.d.mts +0 -51
- package/dist/src/styled-system/recipes/icon.mjs +0 -54
- package/dist/src/styled-system/recipes/index.d.mts +0 -74
- package/dist/src/styled-system/recipes/index.mjs +0 -73
- package/dist/src/styled-system/recipes/inline-code.d.mts +0 -32
- package/dist/src/styled-system/recipes/inline-code.mjs +0 -24
- package/dist/src/styled-system/recipes/input.d.mts +0 -32
- package/dist/src/styled-system/recipes/input.mjs +0 -24
- package/dist/src/styled-system/recipes/label.d.mts +0 -32
- package/dist/src/styled-system/recipes/label.mjs +0 -24
- package/dist/src/styled-system/recipes/large.d.mts +0 -32
- package/dist/src/styled-system/recipes/large.mjs +0 -24
- package/dist/src/styled-system/recipes/lead.d.mts +0 -32
- package/dist/src/styled-system/recipes/lead.mjs +0 -24
- package/dist/src/styled-system/recipes/link.d.mts +0 -32
- package/dist/src/styled-system/recipes/link.mjs +0 -24
- package/dist/src/styled-system/recipes/list.d.mts +0 -32
- package/dist/src/styled-system/recipes/list.mjs +0 -24
- package/dist/src/styled-system/recipes/menubar.d.mts +0 -32
- package/dist/src/styled-system/recipes/menubar.mjs +0 -96
- package/dist/src/styled-system/recipes/muted.d.mts +0 -32
- package/dist/src/styled-system/recipes/muted.mjs +0 -24
- package/dist/src/styled-system/recipes/navigation-menu.d.mts +0 -32
- package/dist/src/styled-system/recipes/navigation-menu.mjs +0 -64
- package/dist/src/styled-system/recipes/p.d.mts +0 -32
- package/dist/src/styled-system/recipes/p.mjs +0 -24
- package/dist/src/styled-system/recipes/popover.d.mts +0 -32
- package/dist/src/styled-system/recipes/popover.mjs +0 -44
- package/dist/src/styled-system/recipes/progress.d.mts +0 -32
- package/dist/src/styled-system/recipes/progress.mjs +0 -36
- package/dist/src/styled-system/recipes/radio-group.d.mts +0 -32
- package/dist/src/styled-system/recipes/radio-group.mjs +0 -44
- package/dist/src/styled-system/recipes/scroll-area.d.mts +0 -32
- package/dist/src/styled-system/recipes/scroll-area.mjs +0 -48
- package/dist/src/styled-system/recipes/select.d.mts +0 -32
- package/dist/src/styled-system/recipes/select.mjs +0 -68
- package/dist/src/styled-system/recipes/separator.d.mts +0 -35
- package/dist/src/styled-system/recipes/separator.mjs +0 -31
- package/dist/src/styled-system/recipes/sheet.d.mts +0 -35
- package/dist/src/styled-system/recipes/sheet.mjs +0 -83
- package/dist/src/styled-system/recipes/skeleton.d.mts +0 -32
- package/dist/src/styled-system/recipes/skeleton.mjs +0 -24
- package/dist/src/styled-system/recipes/slider.d.mts +0 -32
- package/dist/src/styled-system/recipes/slider.mjs +0 -44
- package/dist/src/styled-system/recipes/small.d.mts +0 -32
- package/dist/src/styled-system/recipes/small.mjs +0 -24
- package/dist/src/styled-system/recipes/switch-recipe.d.mts +0 -32
- package/dist/src/styled-system/recipes/switch-recipe.mjs +0 -36
- package/dist/src/styled-system/recipes/table-body.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-body.mjs +0 -24
- package/dist/src/styled-system/recipes/table-caption.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-caption.mjs +0 -24
- package/dist/src/styled-system/recipes/table-cell.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-cell.mjs +0 -24
- package/dist/src/styled-system/recipes/table-container.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-container.mjs +0 -24
- package/dist/src/styled-system/recipes/table-footer.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-footer.mjs +0 -24
- package/dist/src/styled-system/recipes/table-head.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-head.mjs +0 -24
- package/dist/src/styled-system/recipes/table-header.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-header.mjs +0 -24
- package/dist/src/styled-system/recipes/table-row.d.mts +0 -32
- package/dist/src/styled-system/recipes/table-row.mjs +0 -24
- package/dist/src/styled-system/recipes/table.d.mts +0 -32
- package/dist/src/styled-system/recipes/table.mjs +0 -24
- package/dist/src/styled-system/recipes/tabs.d.mts +0 -32
- package/dist/src/styled-system/recipes/tabs.mjs +0 -44
- package/dist/src/styled-system/recipes/textarea.d.mts +0 -32
- package/dist/src/styled-system/recipes/textarea.mjs +0 -24
- package/dist/src/styled-system/recipes/toast-viewport.d.mts +0 -32
- package/dist/src/styled-system/recipes/toast-viewport.mjs +0 -24
- package/dist/src/styled-system/recipes/toast.d.mts +0 -35
- package/dist/src/styled-system/recipes/toast.mjs +0 -61
- package/dist/src/styled-system/recipes/toggle.d.mts +0 -39
- package/dist/src/styled-system/recipes/toggle.mjs +0 -37
- package/dist/src/styled-system/recipes/tooltip.d.mts +0 -32
- package/dist/src/styled-system/recipes/tooltip.mjs +0 -40
- package/dist/src/styled-system/recipes/typography-table-container.d.mts +0 -32
- package/dist/src/styled-system/recipes/typography-table-container.mjs +0 -24
- package/dist/src/styled-system/recipes/typography-table.d.mts +0 -32
- package/dist/src/styled-system/recipes/typography-table.mjs +0 -24
- package/dist/src/styled-system/tokens/index.d.mts +0 -9
- package/dist/src/styled-system/tokens/index.mjs +0 -2732
- package/dist/src/styled-system/tokens/tokens.d.mts +0 -63
- package/dist/src/styled-system/types/composition.d.mts +0 -164
- package/dist/src/styled-system/types/conditions.d.mts +0 -322
- package/dist/src/styled-system/types/csstype.d.mts +0 -21298
- package/dist/src/styled-system/types/global.d.mts +0 -20
- package/dist/src/styled-system/types/index.d.mts +0 -7
- package/dist/src/styled-system/types/parts.d.mts +0 -8
- package/dist/src/styled-system/types/pattern.d.mts +0 -78
- package/dist/src/styled-system/types/prop-type.d.mts +0 -264
- package/dist/src/styled-system/types/recipe.d.mts +0 -181
- package/dist/src/styled-system/types/selectors.d.mts +0 -59
- package/dist/src/styled-system/types/static-css.d.mts +0 -56
- package/dist/src/styled-system/types/style-props.d.mts +0 -7549
- package/dist/src/styled-system/types/system-types.d.mts +0 -193
|
@@ -1,36 +0,0 @@
|
|
|
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,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,2lg,2lgOnly,2lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smTo2lg,smToXl,smTo2xl,mdToLg,mdTo2lg,mdToXl,mdTo2xl,lgTo2lg,lgToXl,lgTo2xl,2lgToXl,2lgTo2xl,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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import type { SystemStyleObject } from '../types/index.d.mts';
|
|
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;
|
|
@@ -1,45 +0,0 @@
|
|
|
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:space_x,spaceY:space_y,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,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,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:tracking/1,lineHeight:leading/1,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,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,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:backdrop_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:container,containerName:cq-n,containerType:cq-t,cursor:cursor,animateIn:animate_in,animateOut:animate_out,fadeIn:animate_fade_in,fadeOut:animate_fade_out,zoomIn:animate_zoom_in,zoomOut:animate_zoom_out,spinIn:animate_spin_in,spinOut:animate_spin_out,slideInFromTop:animate_slide_in_from_top,slideInFromBottom:animate_slide_in_from_bottom,slideInFromLeft:animate_slide_in_from_left,slideInFromRight:animate_slide_in_from_right,slideOutToTop:animate_slide_out_to_top,slideOutToBottom:animate_slide_out_to_bottom,slideOutToLeft:animate_slide_out_to_left,slideOutToRight:animate_slide_out_to_right,backgroundAlpha:background-alpha/bga,gradientFromAlpha:from-alpha,gradientToAlpha:to-alpha,borderAlpha:border_color_alpha/bca,focusRingWidth:focus-ring-width,focusRingColor:focus-ring-color,focusRingOffsetWidth:focus-ring-offset-width,focusRingOffsetColor:focus-ring-offset-color,focusRingInset:focus-ring-inset,textAlpha:text_alpha/ca,textStyle:textStyle,layerStyle:layerStyle"
|
|
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","2lg","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)
|
|
@@ -1,87 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { compact, getSlotRecipes, memo, splitProps } from '../helpers.mjs';
|
|
2
|
-
import { cva } from './cva.mjs';
|
|
3
|
-
import { cx } from './cx.mjs';
|
|
4
|
-
|
|
5
|
-
const slotClass = (className, slot) => className + '__' + slot
|
|
6
|
-
|
|
7
|
-
export function sva(config) {
|
|
8
|
-
const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
|
|
9
|
-
const defaultVariants = config.defaultVariants ?? {}
|
|
10
|
-
|
|
11
|
-
function svaFn(props) {
|
|
12
|
-
const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), config.className && slotClass(config.className, slot))])
|
|
13
|
-
return Object.fromEntries(result)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function raw(props) {
|
|
17
|
-
const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
|
|
18
|
-
return Object.fromEntries(result)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const variants = config.variants ?? {};
|
|
22
|
-
const variantKeys = Object.keys(variants);
|
|
23
|
-
|
|
24
|
-
function splitVariantProps(props) {
|
|
25
|
-
return splitProps(props, variantKeys);
|
|
26
|
-
}
|
|
27
|
-
const getVariantProps = (variants) => ({ ...(defaultVariants || {}), ...compact(variants) })
|
|
28
|
-
|
|
29
|
-
const variantMap = Object.fromEntries(
|
|
30
|
-
Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
return Object.assign(memo(svaFn), {
|
|
34
|
-
__cva__: false,
|
|
35
|
-
raw,
|
|
36
|
-
variantMap,
|
|
37
|
-
variantKeys,
|
|
38
|
-
splitVariantProps,
|
|
39
|
-
getVariantProps,
|
|
40
|
-
})
|
|
41
|
-
}
|
|
@@ -1,327 +0,0 @@
|
|
|
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)
|
|
26
|
-
name = toChar(x % 52) + name;
|
|
27
|
-
return toChar(x % 52) + name;
|
|
28
|
-
}
|
|
29
|
-
function toPhash(h, x) {
|
|
30
|
-
let i = x.length;
|
|
31
|
-
while (i)
|
|
32
|
-
h = h * 33 ^ x.charCodeAt(--i);
|
|
33
|
-
return h;
|
|
34
|
-
}
|
|
35
|
-
function toHash(value) {
|
|
36
|
-
return toName(toPhash(5381, value) >>> 0);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/important.ts
|
|
40
|
-
var importantRegex = /\s*!(important)?/i;
|
|
41
|
-
function isImportant(value) {
|
|
42
|
-
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
43
|
-
}
|
|
44
|
-
function withoutImportant(value) {
|
|
45
|
-
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
46
|
-
}
|
|
47
|
-
function withoutSpace(str) {
|
|
48
|
-
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/memo.ts
|
|
52
|
-
var memo = (fn) => {
|
|
53
|
-
const cache = /* @__PURE__ */ new Map();
|
|
54
|
-
const get = (...args) => {
|
|
55
|
-
const key = JSON.stringify(args);
|
|
56
|
-
if (cache.has(key)) {
|
|
57
|
-
return cache.get(key);
|
|
58
|
-
}
|
|
59
|
-
const result = fn(...args);
|
|
60
|
-
cache.set(key, result);
|
|
61
|
-
return result;
|
|
62
|
-
};
|
|
63
|
-
return get;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// src/merge-props.ts
|
|
67
|
-
var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
68
|
-
function mergeProps(...sources) {
|
|
69
|
-
return sources.reduce((prev, obj) => {
|
|
70
|
-
if (!obj)
|
|
71
|
-
return prev;
|
|
72
|
-
Object.keys(obj).forEach((key) => {
|
|
73
|
-
if (MERGE_OMIT.has(key))
|
|
74
|
-
return;
|
|
75
|
-
const prevValue = prev[key];
|
|
76
|
-
const value = obj[key];
|
|
77
|
-
if (isObject(prevValue) && isObject(value)) {
|
|
78
|
-
prev[key] = mergeProps(prevValue, value);
|
|
79
|
-
} else {
|
|
80
|
-
prev[key] = value;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
return prev;
|
|
84
|
-
}, {});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// src/walk-object.ts
|
|
88
|
-
var isNotNullish = (element) => element != null;
|
|
89
|
-
function walkObject(target, predicate, options = {}) {
|
|
90
|
-
const { stop, getKey } = options;
|
|
91
|
-
function inner(value, path = []) {
|
|
92
|
-
if (isObjectOrArray(value)) {
|
|
93
|
-
const result = {};
|
|
94
|
-
for (const [prop, child] of Object.entries(value)) {
|
|
95
|
-
const key = getKey?.(prop, child) ?? prop;
|
|
96
|
-
const childPath = [...path, key];
|
|
97
|
-
if (stop?.(value, childPath)) {
|
|
98
|
-
return predicate(value, path);
|
|
99
|
-
}
|
|
100
|
-
const next = inner(child, childPath);
|
|
101
|
-
if (isNotNullish(next)) {
|
|
102
|
-
result[key] = next;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
return predicate(value, path);
|
|
108
|
-
}
|
|
109
|
-
return inner(target);
|
|
110
|
-
}
|
|
111
|
-
function mapObject(obj, fn) {
|
|
112
|
-
if (Array.isArray(obj))
|
|
113
|
-
return obj.map((value) => fn(value));
|
|
114
|
-
if (!isObject(obj))
|
|
115
|
-
return fn(obj);
|
|
116
|
-
return walkObject(obj, (value) => fn(value));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// src/normalize-style-object.ts
|
|
120
|
-
function toResponsiveObject(values, breakpoints) {
|
|
121
|
-
return values.reduce(
|
|
122
|
-
(acc, current, index) => {
|
|
123
|
-
const key = breakpoints[index];
|
|
124
|
-
if (current != null) {
|
|
125
|
-
acc[key] = current;
|
|
126
|
-
}
|
|
127
|
-
return acc;
|
|
128
|
-
},
|
|
129
|
-
{}
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
133
|
-
const { utility, conditions } = context;
|
|
134
|
-
const { hasShorthand, resolveShorthand } = utility;
|
|
135
|
-
return walkObject(
|
|
136
|
-
styles,
|
|
137
|
-
(value) => {
|
|
138
|
-
return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
stop: (value) => Array.isArray(value),
|
|
142
|
-
getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// src/classname.ts
|
|
148
|
-
var fallbackCondition = {
|
|
149
|
-
shift: (v) => v,
|
|
150
|
-
finalize: (v) => v,
|
|
151
|
-
breakpoints: { keys: [] }
|
|
152
|
-
};
|
|
153
|
-
var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
|
|
154
|
-
function createCss(context) {
|
|
155
|
-
const { utility, hash, conditions: conds = fallbackCondition } = context;
|
|
156
|
-
const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
|
|
157
|
-
const hashFn = (conditions, className) => {
|
|
158
|
-
let result;
|
|
159
|
-
if (hash) {
|
|
160
|
-
const baseArray = [...conds.finalize(conditions), className];
|
|
161
|
-
result = formatClassName(utility.toHash(baseArray, toHash));
|
|
162
|
-
} else {
|
|
163
|
-
const baseArray = [...conds.finalize(conditions), formatClassName(className)];
|
|
164
|
-
result = baseArray.join(":");
|
|
165
|
-
}
|
|
166
|
-
return result;
|
|
167
|
-
};
|
|
168
|
-
return memo(({ base, ...styles } = {}) => {
|
|
169
|
-
const styleObject = Object.assign(styles, base);
|
|
170
|
-
const normalizedObject = normalizeStyleObject(styleObject, context);
|
|
171
|
-
const classNames = /* @__PURE__ */ new Set();
|
|
172
|
-
walkObject(normalizedObject, (value, paths) => {
|
|
173
|
-
if (value == null)
|
|
174
|
-
return;
|
|
175
|
-
const important = isImportant(value);
|
|
176
|
-
const [prop, ...allConditions] = conds.shift(paths);
|
|
177
|
-
const conditions = filterBaseConditions(allConditions);
|
|
178
|
-
const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
|
|
179
|
-
let className = hashFn(conditions, transformed.className);
|
|
180
|
-
if (important)
|
|
181
|
-
className = `${className}!`;
|
|
182
|
-
classNames.add(className);
|
|
183
|
-
});
|
|
184
|
-
return Array.from(classNames).join(" ");
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function compactStyles(...styles) {
|
|
188
|
-
return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
|
|
189
|
-
}
|
|
190
|
-
function createMergeCss(context) {
|
|
191
|
-
function resolve(styles) {
|
|
192
|
-
const allStyles = compactStyles(...styles);
|
|
193
|
-
if (allStyles.length === 1)
|
|
194
|
-
return allStyles;
|
|
195
|
-
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
196
|
-
}
|
|
197
|
-
function mergeCss(...styles) {
|
|
198
|
-
return mergeProps(...resolve(styles));
|
|
199
|
-
}
|
|
200
|
-
function assignCss(...styles) {
|
|
201
|
-
return Object.assign({}, ...resolve(styles));
|
|
202
|
-
}
|
|
203
|
-
return { mergeCss: memo(mergeCss), assignCss };
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// src/hypenate-property.ts
|
|
207
|
-
var wordRegex = /([A-Z])/g;
|
|
208
|
-
var msRegex = /^ms-/;
|
|
209
|
-
var hypenateProperty = memo((property) => {
|
|
210
|
-
if (property.startsWith("--"))
|
|
211
|
-
return property;
|
|
212
|
-
return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// src/is-css-function.ts
|
|
216
|
-
var fns = ["min", "max", "clamp", "calc"];
|
|
217
|
-
var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
|
|
218
|
-
var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
|
|
219
|
-
|
|
220
|
-
// src/is-css-unit.ts
|
|
221
|
-
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,%";
|
|
222
|
-
var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
|
|
223
|
-
var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
|
|
224
|
-
var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
|
|
225
|
-
|
|
226
|
-
// src/is-css-var.ts
|
|
227
|
-
var isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
|
|
228
|
-
|
|
229
|
-
// src/pattern-fns.ts
|
|
230
|
-
var patternFns = {
|
|
231
|
-
map: mapObject,
|
|
232
|
-
isCssFunction,
|
|
233
|
-
isCssVar,
|
|
234
|
-
isCssUnit
|
|
235
|
-
};
|
|
236
|
-
var getPatternStyles = (pattern, styles) => {
|
|
237
|
-
if (!pattern?.defaultValues)
|
|
238
|
-
return styles;
|
|
239
|
-
const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
|
|
240
|
-
return Object.assign({}, defaults, compact(styles));
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
// src/slot.ts
|
|
244
|
-
var getSlotRecipes = (recipe = {}) => {
|
|
245
|
-
const init = (slot) => ({
|
|
246
|
-
className: [recipe.className, slot].filter(Boolean).join("__"),
|
|
247
|
-
base: recipe.base?.[slot] ?? {},
|
|
248
|
-
variants: {},
|
|
249
|
-
defaultVariants: recipe.defaultVariants ?? {},
|
|
250
|
-
compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
|
|
251
|
-
});
|
|
252
|
-
const slots = recipe.slots ?? [];
|
|
253
|
-
const recipeParts = slots.map((slot) => [slot, init(slot)]);
|
|
254
|
-
for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
|
|
255
|
-
for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
|
|
256
|
-
recipeParts.forEach(([slot, slotRecipe]) => {
|
|
257
|
-
slotRecipe.variants[variantsKey] ??= {};
|
|
258
|
-
slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return Object.fromEntries(recipeParts);
|
|
263
|
-
};
|
|
264
|
-
var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
|
|
265
|
-
|
|
266
|
-
// src/split-props.ts
|
|
267
|
-
function splitProps(props, ...keys) {
|
|
268
|
-
const descriptors = Object.getOwnPropertyDescriptors(props);
|
|
269
|
-
const dKeys = Object.keys(descriptors);
|
|
270
|
-
const split = (k) => {
|
|
271
|
-
const clone = {};
|
|
272
|
-
for (let i = 0; i < k.length; i++) {
|
|
273
|
-
const key = k[i];
|
|
274
|
-
if (descriptors[key]) {
|
|
275
|
-
Object.defineProperty(clone, key, descriptors[key]);
|
|
276
|
-
delete descriptors[key];
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return clone;
|
|
280
|
-
};
|
|
281
|
-
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
|
|
282
|
-
return keys.map(fn).concat(split(dKeys));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// src/uniq.ts
|
|
286
|
-
var uniq = (...items) => {
|
|
287
|
-
const set = items.reduce((acc, currItems) => {
|
|
288
|
-
if (currItems) {
|
|
289
|
-
currItems.forEach((item) => acc.add(item));
|
|
290
|
-
}
|
|
291
|
-
return acc;
|
|
292
|
-
}, /* @__PURE__ */ new Set([]));
|
|
293
|
-
return Array.from(set);
|
|
294
|
-
};
|
|
295
|
-
export {
|
|
296
|
-
compact,
|
|
297
|
-
createCss,
|
|
298
|
-
createMergeCss,
|
|
299
|
-
filterBaseConditions,
|
|
300
|
-
getPatternStyles,
|
|
301
|
-
getSlotCompoundVariant,
|
|
302
|
-
getSlotRecipes,
|
|
303
|
-
hypenateProperty,
|
|
304
|
-
isBaseCondition,
|
|
305
|
-
isObject,
|
|
306
|
-
mapObject,
|
|
307
|
-
memo,
|
|
308
|
-
mergeProps,
|
|
309
|
-
patternFns,
|
|
310
|
-
splitProps,
|
|
311
|
-
toHash,
|
|
312
|
-
uniq,
|
|
313
|
-
walkObject,
|
|
314
|
-
withoutSpace
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
export function __spreadValues(a, b) {
|
|
322
|
-
return { ...a, ...b }
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export function __objRest(source, exclude) {
|
|
326
|
-
return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
|
|
327
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import type { SystemStyleObject, ConditionalValue } from '../types/index.d.mts';
|
|
3
|
-
import type { Properties } from '../types/csstype.d.mts';
|
|
4
|
-
import type { SystemProperties } from '../types/style-props.d.mts';
|
|
5
|
-
import type { DistributiveOmit } from '../types/system-types.d.mts';
|
|
6
|
-
import type { Tokens } from '../tokens/index.d.mts';
|
|
7
|
-
|
|
8
|
-
export interface AspectRatioProperties {
|
|
9
|
-
ratio?: ConditionalValue<number>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
interface AspectRatioStyles extends AspectRatioProperties, DistributiveOmit<SystemStyleObject, keyof AspectRatioProperties | 'aspectRatio'> {}
|
|
14
|
-
|
|
15
|
-
interface AspectRatioPatternFn {
|
|
16
|
-
(styles?: AspectRatioStyles): string
|
|
17
|
-
raw: (styles?: AspectRatioStyles) => SystemStyleObject
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare const aspectRatio: AspectRatioPatternFn;
|