@serendie/ui 0.1.6

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 (172) hide show
  1. package/README.md +86 -0
  2. package/dist/components/Accordion.d.ts +23 -0
  3. package/dist/components/AccordionGroup.d.ts +2 -0
  4. package/dist/components/Avatar.d.ts +40 -0
  5. package/dist/components/Badge.d.ts +90 -0
  6. package/dist/components/Banner.d.ts +43 -0
  7. package/dist/components/BottomNavigation.d.ts +2 -0
  8. package/dist/components/BottomNavigationItem.d.ts +30 -0
  9. package/dist/components/Button.d.ts +133 -0
  10. package/dist/components/CheckBox.d.ts +47 -0
  11. package/dist/components/ChoiceBox.d.ts +8 -0
  12. package/dist/components/DashboardWidget.d.ts +13 -0
  13. package/dist/components/Divider.d.ts +33 -0
  14. package/dist/components/Drawer.d.ts +40 -0
  15. package/dist/components/DropdownMenu.d.ts +14 -0
  16. package/dist/components/IconButton.d.ts +81 -0
  17. package/dist/components/List.d.ts +2 -0
  18. package/dist/components/ListItem.d.ts +46 -0
  19. package/dist/components/ModalDialog.d.ts +15 -0
  20. package/dist/components/NotificationBadge.d.ts +54 -0
  21. package/dist/components/ProgressIndicator.d.ts +29 -0
  22. package/dist/components/RadioButton.d.ts +30 -0
  23. package/dist/components/RadioGroup.d.ts +2 -0
  24. package/dist/components/Search.d.ts +51 -0
  25. package/dist/components/Select.d.ts +63 -0
  26. package/dist/components/SvgIcon.d.ts +75 -0
  27. package/dist/components/SvgIcon.stories.d.ts +7 -0
  28. package/dist/components/Switch.d.ts +10 -0
  29. package/dist/components/TabItem.d.ts +22 -0
  30. package/dist/components/Tabs.d.ts +3 -0
  31. package/dist/components/TextArea.d.ts +8 -0
  32. package/dist/components/TextField.d.ts +7 -0
  33. package/dist/components/Toast.d.ts +35 -0
  34. package/dist/components/TopAppBar.d.ts +37 -0
  35. package/dist/index.cjs +65 -0
  36. package/dist/index.d.ts +33 -0
  37. package/dist/index.js +19523 -0
  38. package/dist/preset.d.ts +534 -0
  39. package/dist/recipes/index.d.ts +2 -0
  40. package/dist/styles.css +1 -0
  41. package/dist/tokens/getToken.d.ts +789 -0
  42. package/dist/tokens/index.d.ts +1808 -0
  43. package/dist/tokens/keyframes/index.d.ts +10 -0
  44. package/package.json +100 -0
  45. package/styled-system/css/conditions.js +34 -0
  46. package/styled-system/css/css.d.ts +22 -0
  47. package/styled-system/css/css.js +45 -0
  48. package/styled-system/css/cva.d.ts +6 -0
  49. package/styled-system/css/cva.js +87 -0
  50. package/styled-system/css/cx.d.ts +5 -0
  51. package/styled-system/css/cx.js +15 -0
  52. package/styled-system/css/index.d.ts +5 -0
  53. package/styled-system/css/index.js +4 -0
  54. package/styled-system/css/sva.d.ts +4 -0
  55. package/styled-system/css/sva.js +41 -0
  56. package/styled-system/helpers.js +326 -0
  57. package/styled-system/jsx/aspect-ratio.d.ts +10 -0
  58. package/styled-system/jsx/aspect-ratio.js +14 -0
  59. package/styled-system/jsx/bleed.d.ts +10 -0
  60. package/styled-system/jsx/bleed.js +14 -0
  61. package/styled-system/jsx/box.d.ts +10 -0
  62. package/styled-system/jsx/box.js +14 -0
  63. package/styled-system/jsx/center.d.ts +10 -0
  64. package/styled-system/jsx/center.js +14 -0
  65. package/styled-system/jsx/circle.d.ts +10 -0
  66. package/styled-system/jsx/circle.js +14 -0
  67. package/styled-system/jsx/container.d.ts +10 -0
  68. package/styled-system/jsx/container.js +14 -0
  69. package/styled-system/jsx/cq.d.ts +10 -0
  70. package/styled-system/jsx/cq.js +14 -0
  71. package/styled-system/jsx/divider.d.ts +10 -0
  72. package/styled-system/jsx/divider.js +14 -0
  73. package/styled-system/jsx/factory-helper.js +22 -0
  74. package/styled-system/jsx/factory.d.ts +3 -0
  75. package/styled-system/jsx/factory.js +80 -0
  76. package/styled-system/jsx/flex.d.ts +10 -0
  77. package/styled-system/jsx/flex.js +14 -0
  78. package/styled-system/jsx/float.d.ts +10 -0
  79. package/styled-system/jsx/float.js +14 -0
  80. package/styled-system/jsx/grid-item.d.ts +10 -0
  81. package/styled-system/jsx/grid-item.js +14 -0
  82. package/styled-system/jsx/grid.d.ts +10 -0
  83. package/styled-system/jsx/grid.js +14 -0
  84. package/styled-system/jsx/hstack.d.ts +10 -0
  85. package/styled-system/jsx/hstack.js +14 -0
  86. package/styled-system/jsx/index.d.ts +24 -0
  87. package/styled-system/jsx/index.js +22 -0
  88. package/styled-system/jsx/is-valid-prop.d.ts +11 -0
  89. package/styled-system/jsx/is-valid-prop.js +17 -0
  90. package/styled-system/jsx/link-overlay.d.ts +10 -0
  91. package/styled-system/jsx/link-overlay.js +14 -0
  92. package/styled-system/jsx/spacer.d.ts +10 -0
  93. package/styled-system/jsx/spacer.js +14 -0
  94. package/styled-system/jsx/square.d.ts +10 -0
  95. package/styled-system/jsx/square.js +14 -0
  96. package/styled-system/jsx/stack.d.ts +10 -0
  97. package/styled-system/jsx/stack.js +14 -0
  98. package/styled-system/jsx/visually-hidden.d.ts +10 -0
  99. package/styled-system/jsx/visually-hidden.js +14 -0
  100. package/styled-system/jsx/vstack.d.ts +10 -0
  101. package/styled-system/jsx/vstack.js +14 -0
  102. package/styled-system/jsx/wrap.d.ts +10 -0
  103. package/styled-system/jsx/wrap.js +14 -0
  104. package/styled-system/patterns/aspect-ratio.d.ts +21 -0
  105. package/styled-system/patterns/aspect-ratio.js +38 -0
  106. package/styled-system/patterns/bleed.d.ts +22 -0
  107. package/styled-system/patterns/bleed.js +24 -0
  108. package/styled-system/patterns/box.d.ts +21 -0
  109. package/styled-system/patterns/box.js +15 -0
  110. package/styled-system/patterns/center.d.ts +21 -0
  111. package/styled-system/patterns/center.js +21 -0
  112. package/styled-system/patterns/circle.d.ts +21 -0
  113. package/styled-system/patterns/circle.js +25 -0
  114. package/styled-system/patterns/container.d.ts +21 -0
  115. package/styled-system/patterns/container.js +21 -0
  116. package/styled-system/patterns/cq.d.ts +22 -0
  117. package/styled-system/patterns/cq.js +21 -0
  118. package/styled-system/patterns/divider.d.ts +23 -0
  119. package/styled-system/patterns/divider.js +25 -0
  120. package/styled-system/patterns/flex.d.ts +27 -0
  121. package/styled-system/patterns/flex.js +26 -0
  122. package/styled-system/patterns/float.d.ts +24 -0
  123. package/styled-system/patterns/float.js +52 -0
  124. package/styled-system/patterns/grid-item.d.ts +26 -0
  125. package/styled-system/patterns/grid-item.js +25 -0
  126. package/styled-system/patterns/grid.d.ts +25 -0
  127. package/styled-system/patterns/grid.js +27 -0
  128. package/styled-system/patterns/hstack.d.ts +22 -0
  129. package/styled-system/patterns/hstack.js +24 -0
  130. package/styled-system/patterns/index.d.ts +21 -0
  131. package/styled-system/patterns/index.js +20 -0
  132. package/styled-system/patterns/link-overlay.d.ts +21 -0
  133. package/styled-system/patterns/link-overlay.js +24 -0
  134. package/styled-system/patterns/spacer.d.ts +21 -0
  135. package/styled-system/patterns/spacer.js +21 -0
  136. package/styled-system/patterns/square.d.ts +21 -0
  137. package/styled-system/patterns/square.js +24 -0
  138. package/styled-system/patterns/stack.d.ts +24 -0
  139. package/styled-system/patterns/stack.js +24 -0
  140. package/styled-system/patterns/visually-hidden.d.ts +21 -0
  141. package/styled-system/patterns/visually-hidden.js +18 -0
  142. package/styled-system/patterns/vstack.d.ts +22 -0
  143. package/styled-system/patterns/vstack.js +24 -0
  144. package/styled-system/patterns/wrap.d.ts +25 -0
  145. package/styled-system/patterns/wrap.js +25 -0
  146. package/styled-system/themes/asagi.json +5 -0
  147. package/styled-system/themes/index.d.ts +36 -0
  148. package/styled-system/themes/index.js +24 -0
  149. package/styled-system/themes/kurikawa.json +5 -0
  150. package/styled-system/themes/sumire.json +5 -0
  151. package/styled-system/themes/theme-asagi.json +5 -0
  152. package/styled-system/themes/theme-kurikawa.json +5 -0
  153. package/styled-system/themes/theme-sumire.json +5 -0
  154. package/styled-system/themes/theme-tsutsuji.json +5 -0
  155. package/styled-system/themes/tsutsuji.json +5 -0
  156. package/styled-system/tokens/index.d.ts +9 -0
  157. package/styled-system/tokens/index.js +3548 -0
  158. package/styled-system/tokens/tokens.d.ts +48 -0
  159. package/styled-system/types/composition.d.ts +138 -0
  160. package/styled-system/types/conditions.d.ts +214 -0
  161. package/styled-system/types/csstype.d.ts +21298 -0
  162. package/styled-system/types/global.d.ts +19 -0
  163. package/styled-system/types/index.d.ts +8 -0
  164. package/styled-system/types/jsx.d.ts +52 -0
  165. package/styled-system/types/parts.d.ts +8 -0
  166. package/styled-system/types/pattern.d.ts +78 -0
  167. package/styled-system/types/prop-type.d.ts +237 -0
  168. package/styled-system/types/recipe.d.ts +181 -0
  169. package/styled-system/types/selectors.d.ts +59 -0
  170. package/styled-system/types/static-css.d.ts +51 -0
  171. package/styled-system/types/style-props.d.ts +7468 -0
  172. package/styled-system/types/system-types.d.ts +88 -0
@@ -0,0 +1,10 @@
1
+ export declare const SerendieKeyframes: {
2
+ spin: {
3
+ "0%": {
4
+ transform: string;
5
+ };
6
+ "100%": {
7
+ transform: string;
8
+ };
9
+ };
10
+ };
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "@serendie/ui",
3
+ "description": "Adaptive UI component library as part of Serendie Design System by Mitsubishi Electric",
4
+ "version": "0.1.6",
5
+ "type": "module",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "dev": "npm run storybook",
9
+ "build:panda": "panda codegen",
10
+ "build:components": "vite build",
11
+ "build": "npm run build:panda && npm run build:components",
12
+ "lint": "eslint . --report-unused-disable-directives --max-warnings 0",
13
+ "lint:fix": "eslint . --fix",
14
+ "format": "prettier --write .",
15
+ "storybook": "storybook dev -p 6006",
16
+ "build:storybook": "npm run build && storybook build",
17
+ "test": "test-storybook",
18
+ "panda": "panda",
19
+ "connect:publish": "npx figma connect publish",
20
+ "connect:unpublish": "npx figma connect unpublish",
21
+ "chromatic": "chromatic --build-script-name=build:storybook",
22
+ "release": "release-it --config ../.release-it.json"
23
+ },
24
+ "peerDependencies": {
25
+ "@ark-ui/react": "^3.5.0",
26
+ "react": "^18.3.1",
27
+ "react-dom": "^18.3.1"
28
+ },
29
+ "dependencies": {
30
+ "@ark-ui/react": "^3.5.0",
31
+ "@pandacss/dev": "^0.42.0",
32
+ "@serendie/symbols": "^0.0.5",
33
+ "merge-refs": "^1.3.0",
34
+ "styled-components": "^5.3.3",
35
+ "styled-system": "^5.1.5"
36
+ },
37
+ "devDependencies": {
38
+ "chromatic": "^11.20.2",
39
+ "@chromatic-com/storybook": "^1.6.1",
40
+ "@figma/code-connect": "^1.2.1",
41
+ "@material-design-icons/svg": "^0.14.13",
42
+ "@serendie/design-token": "file:../design-tokens/",
43
+ "@storybook/addon-designs": "^8.0.3",
44
+ "@storybook/addon-essentials": "^8.2.4",
45
+ "@storybook/addon-interactions": "^8.2.4",
46
+ "@storybook/addon-links": "^8.2.4",
47
+ "@storybook/addon-onboarding": "^8.2.4",
48
+ "@storybook/addon-themes": "^8.2.8",
49
+ "@storybook/blocks": "^8.2.4",
50
+ "@storybook/react": "^8.2.4",
51
+ "@storybook/react-vite": "^8.3.1",
52
+ "@storybook/test": "^8.2.4",
53
+ "@storybook/test-runner": "^0.19.1",
54
+ "@types/react": "^18.3.1",
55
+ "@types/react-dom": "^18.3.0",
56
+ "@vitejs/plugin-react": "^4.3.1",
57
+ "storybook": "^8.2.4",
58
+ "typescript": "^5.5.3",
59
+ "vite": "^5.3.3",
60
+ "vite-plugin-dts": "^4.2.1",
61
+ "vite-plugin-svgr": "^4.2.0"
62
+ },
63
+ "exports": {
64
+ ".": {
65
+ "types": "./dist/index.d.ts",
66
+ "require": "./dist/index.cjs",
67
+ "import": "./dist/index.js"
68
+ },
69
+ "./css": {
70
+ "types": "./styled-system/css/index.d.ts",
71
+ "require": "./styled-system/css/index.js",
72
+ "import": "./styled-system/css/index.js"
73
+ },
74
+ "./tokens": {
75
+ "types": "./styled-system/tokens/index.d.ts",
76
+ "require": "./styled-system/tokens/index.js",
77
+ "import": "./styled-system/tokens/index.js"
78
+ },
79
+ "./types": {
80
+ "types": "./styled-system/types/index.d.ts",
81
+ "require": "./styled-system/types/index.js",
82
+ "import": "./styled-system/types/index.js"
83
+ },
84
+ "./patterns": {
85
+ "types": "./styled-system/patterns/index.d.ts",
86
+ "require": "./styled-system/patterns/index.js",
87
+ "import": "./styled-system/patterns/index.js"
88
+ },
89
+ "./jsx": {
90
+ "types": "./styled-system/jsx/index.d.ts",
91
+ "require": "./styled-system/jsx/index.js",
92
+ "import": "./styled-system/jsx/index.js"
93
+ },
94
+ "./styles.css": "./dist/styles.css"
95
+ },
96
+ "files": [
97
+ "dist",
98
+ "styled-system"
99
+ ]
100
+ }
@@ -0,0 +1,34 @@
1
+ import { withoutSpace } from '../helpers.js';
2
+
3
+ const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_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,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,expanded,expandedOnly,expandedDown,_themeAsagi,_themeKurikawa,_themeSumire,_themeTsutsuji,base"
4
+ const conditions = new Set(conditionsStr.split(','))
5
+
6
+ export function isCondition(value){
7
+ return conditions.has(value) || /^@|&|&$/.test(value)
8
+ }
9
+
10
+ const underscoreRegex = /^_/
11
+ const conditionsSelectorRegex = /&|@/
12
+
13
+ export function finalizeConditions(paths){
14
+ return paths.map((path) => {
15
+ if (conditions.has(path)){
16
+ return path.replace(underscoreRegex, '')
17
+ }
18
+
19
+ if (conditionsSelectorRegex.test(path)){
20
+ return `[${withoutSpace(path.trim())}]`
21
+ }
22
+
23
+ return path
24
+ })}
25
+
26
+ export function sortConditions(paths){
27
+ return paths.sort((a, b) => {
28
+ const aa = isCondition(a)
29
+ const bb = isCondition(b)
30
+ if (aa && !bb) return 1
31
+ if (!aa && bb) return -1
32
+ return 0
33
+ })
34
+ }
@@ -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.js';
2
+ import { sortConditions, finalizeConditions } from './conditions.js';
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,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: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,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,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,textStyle:textStyle"
5
+
6
+ const classNameByProp = new Map()
7
+ const shorthands = new Map()
8
+ utilities.split(',').forEach((utility) => {
9
+ const [prop, meta] = utility.split(':')
10
+ const [className, ...shorthandList] = meta.split('/')
11
+ classNameByProp.set(prop, className)
12
+ if (shorthandList.length) {
13
+ shorthandList.forEach((shorthand) => {
14
+ shorthands.set(shorthand === '1' ? className : shorthand, prop)
15
+ })
16
+ }
17
+ })
18
+
19
+ const resolveShorthand = (prop) => shorthands.get(prop) || prop
20
+
21
+ const context = {
22
+
23
+ conditions: {
24
+ shift: sortConditions,
25
+ finalize: finalizeConditions,
26
+ breakpoints: { keys: ["base","expanded"] }
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.js';
2
+ import { css, mergeCss } from './css.js';
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.js';
2
+ export * from './cx.js';
3
+ export * from './cva.js';
4
+ export * from './sva.js';
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ import type { SlotRecipeCreatorFn } from '../types/recipe';
3
+
4
+ export declare const sva: SlotRecipeCreatorFn
@@ -0,0 +1,41 @@
1
+ import { compact, getSlotRecipes, memo, splitProps } from '../helpers.js';
2
+ import { cva } from './cva.js';
3
+ import { cx } from './cx.js';
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
+ }