@likec4/styles 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -0
  3. package/build.config.ts +27 -0
  4. package/dev.ts +36 -0
  5. package/dist/css/conditions.mjs +36 -0
  6. package/dist/css/css.d.ts +22 -0
  7. package/dist/css/css.mjs +45 -0
  8. package/dist/css/cva.d.ts +6 -0
  9. package/dist/css/cva.mjs +87 -0
  10. package/dist/css/cx.d.ts +5 -0
  11. package/dist/css/cx.mjs +15 -0
  12. package/dist/css/index.d.ts +5 -0
  13. package/dist/css/index.mjs +4 -0
  14. package/dist/css/sva.d.ts +4 -0
  15. package/dist/css/sva.mjs +41 -0
  16. package/dist/helpers.mjs +336 -0
  17. package/dist/jsx/aspect-ratio.d.ts +10 -0
  18. package/dist/jsx/aspect-ratio.mjs +14 -0
  19. package/dist/jsx/bleed.d.ts +10 -0
  20. package/dist/jsx/bleed.mjs +14 -0
  21. package/dist/jsx/box.d.ts +10 -0
  22. package/dist/jsx/box.mjs +14 -0
  23. package/dist/jsx/center.d.ts +10 -0
  24. package/dist/jsx/center.mjs +14 -0
  25. package/dist/jsx/circle.d.ts +10 -0
  26. package/dist/jsx/circle.mjs +14 -0
  27. package/dist/jsx/container.d.ts +10 -0
  28. package/dist/jsx/container.mjs +14 -0
  29. package/dist/jsx/cq.d.ts +10 -0
  30. package/dist/jsx/cq.mjs +14 -0
  31. package/dist/jsx/divider.d.ts +10 -0
  32. package/dist/jsx/divider.mjs +14 -0
  33. package/dist/jsx/factory-helper.mjs +22 -0
  34. package/dist/jsx/factory.d.ts +3 -0
  35. package/dist/jsx/factory.mjs +80 -0
  36. package/dist/jsx/flex.d.ts +10 -0
  37. package/dist/jsx/flex.mjs +14 -0
  38. package/dist/jsx/float.d.ts +10 -0
  39. package/dist/jsx/float.mjs +14 -0
  40. package/dist/jsx/grid-item.d.ts +10 -0
  41. package/dist/jsx/grid-item.mjs +14 -0
  42. package/dist/jsx/grid.d.ts +10 -0
  43. package/dist/jsx/grid.mjs +14 -0
  44. package/dist/jsx/hstack.d.ts +10 -0
  45. package/dist/jsx/hstack.mjs +14 -0
  46. package/dist/jsx/index.d.ts +24 -0
  47. package/dist/jsx/index.mjs +22 -0
  48. package/dist/jsx/is-valid-prop.d.ts +11 -0
  49. package/dist/jsx/is-valid-prop.mjs +17 -0
  50. package/dist/jsx/link-overlay.d.ts +10 -0
  51. package/dist/jsx/link-overlay.mjs +14 -0
  52. package/dist/jsx/spacer.d.ts +10 -0
  53. package/dist/jsx/spacer.mjs +14 -0
  54. package/dist/jsx/square.d.ts +10 -0
  55. package/dist/jsx/square.mjs +14 -0
  56. package/dist/jsx/stack.d.ts +10 -0
  57. package/dist/jsx/stack.mjs +14 -0
  58. package/dist/jsx/visually-hidden.d.ts +10 -0
  59. package/dist/jsx/visually-hidden.mjs +14 -0
  60. package/dist/jsx/vstack.d.ts +10 -0
  61. package/dist/jsx/vstack.mjs +14 -0
  62. package/dist/jsx/wrap.d.ts +10 -0
  63. package/dist/jsx/wrap.mjs +14 -0
  64. package/dist/patterns/aspect-ratio.d.ts +21 -0
  65. package/dist/patterns/aspect-ratio.mjs +38 -0
  66. package/dist/patterns/bleed.d.ts +22 -0
  67. package/dist/patterns/bleed.mjs +24 -0
  68. package/dist/patterns/box.d.ts +21 -0
  69. package/dist/patterns/box.mjs +15 -0
  70. package/dist/patterns/center.d.ts +21 -0
  71. package/dist/patterns/center.mjs +21 -0
  72. package/dist/patterns/circle.d.ts +21 -0
  73. package/dist/patterns/circle.mjs +25 -0
  74. package/dist/patterns/container.d.ts +21 -0
  75. package/dist/patterns/container.mjs +21 -0
  76. package/dist/patterns/cq.d.ts +22 -0
  77. package/dist/patterns/cq.mjs +21 -0
  78. package/dist/patterns/divider.d.ts +23 -0
  79. package/dist/patterns/divider.mjs +25 -0
  80. package/dist/patterns/flex.d.ts +27 -0
  81. package/dist/patterns/flex.mjs +26 -0
  82. package/dist/patterns/float.d.ts +24 -0
  83. package/dist/patterns/float.mjs +52 -0
  84. package/dist/patterns/grid-item.d.ts +26 -0
  85. package/dist/patterns/grid-item.mjs +25 -0
  86. package/dist/patterns/grid.d.ts +25 -0
  87. package/dist/patterns/grid.mjs +27 -0
  88. package/dist/patterns/hstack.d.ts +22 -0
  89. package/dist/patterns/hstack.mjs +24 -0
  90. package/dist/patterns/index.d.ts +21 -0
  91. package/dist/patterns/index.mjs +20 -0
  92. package/dist/patterns/link-overlay.d.ts +21 -0
  93. package/dist/patterns/link-overlay.mjs +24 -0
  94. package/dist/patterns/spacer.d.ts +21 -0
  95. package/dist/patterns/spacer.mjs +21 -0
  96. package/dist/patterns/square.d.ts +21 -0
  97. package/dist/patterns/square.mjs +24 -0
  98. package/dist/patterns/stack.d.ts +24 -0
  99. package/dist/patterns/stack.mjs +24 -0
  100. package/dist/patterns/visually-hidden.d.ts +21 -0
  101. package/dist/patterns/visually-hidden.mjs +18 -0
  102. package/dist/patterns/vstack.d.ts +22 -0
  103. package/dist/patterns/vstack.mjs +24 -0
  104. package/dist/patterns/wrap.d.ts +25 -0
  105. package/dist/patterns/wrap.mjs +25 -0
  106. package/dist/recipes/action-btn.d.ts +43 -0
  107. package/dist/recipes/action-btn.mjs +41 -0
  108. package/dist/recipes/create-recipe.mjs +82 -0
  109. package/dist/recipes/index.d.ts +2 -0
  110. package/dist/recipes/index.mjs +1 -0
  111. package/dist/styles.css +1601 -0
  112. package/dist/tokens/index.d.ts +9 -0
  113. package/dist/tokens/index.mjs +5044 -0
  114. package/dist/tokens/tokens.d.ts +45 -0
  115. package/dist/types/composition.d.ts +164 -0
  116. package/dist/types/conditions.d.ts +328 -0
  117. package/dist/types/csstype.d.ts +21298 -0
  118. package/dist/types/global.d.ts +20 -0
  119. package/dist/types/index.d.ts +8 -0
  120. package/dist/types/jsx.d.ts +52 -0
  121. package/dist/types/parts.d.ts +8 -0
  122. package/dist/types/pattern.d.ts +78 -0
  123. package/dist/types/prop-type.d.ts +232 -0
  124. package/dist/types/recipe.d.ts +181 -0
  125. package/dist/types/selectors.d.ts +59 -0
  126. package/dist/types/static-css.d.ts +56 -0
  127. package/dist/types/style-props.d.ts +7499 -0
  128. package/dist/types/system-types.d.ts +193 -0
  129. package/package.json +85 -0
  130. package/panda.config.ts +6 -0
  131. package/postcss.d.mts +6 -0
  132. package/postcss.mjs +2 -0
  133. package/preset.d.mts +2746 -0
  134. package/preset.mjs +2746 -0
  135. package/preset.ts +3 -0
  136. package/vite.d.mts +5 -0
  137. package/vite.mjs +5 -0
@@ -0,0 +1,193 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue, Nested } from './conditions';
3
+ import type { AtRule, Globals, PropertiesFallback } from './csstype';
4
+ import type { SystemProperties, CssVarProperties } from './style-props';
5
+
6
+ type String = string & {}
7
+ type Number = number & {}
8
+
9
+ export type Pretty<T> = { [K in keyof T]: T[K] } & {}
10
+
11
+ export type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never
12
+
13
+ export type DistributiveUnion<T, U> = {
14
+ [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]
15
+ } & DistributiveOmit<U, keyof T>
16
+
17
+ export type Assign<T, U> = {
18
+ [K in keyof T]: K extends keyof U ? U[K] : T[K]
19
+ } & U
20
+
21
+ /* -----------------------------------------------------------------------------
22
+ * Native css properties
23
+ * -----------------------------------------------------------------------------*/
24
+
25
+ type DashedIdent = `--${string}`
26
+
27
+ type StringToMultiple<T extends string> = T | `${T}, ${T}`
28
+
29
+ export type PositionAreaAxis =
30
+ | 'left'
31
+ | 'center'
32
+ | 'right'
33
+ | 'x-start'
34
+ | 'x-end'
35
+ | 'span-x-start'
36
+ | 'span-x-end'
37
+ | 'x-self-start'
38
+ | 'x-self-end'
39
+ | 'span-x-self-start'
40
+ | 'span-x-self-end'
41
+ | 'span-all'
42
+ | 'top'
43
+ | 'bottom'
44
+ | 'span-top'
45
+ | 'span-bottom'
46
+ | 'y-start'
47
+ | 'y-end'
48
+ | 'span-y-start'
49
+ | 'span-y-end'
50
+ | 'y-self-start'
51
+ | 'y-self-end'
52
+ | 'span-y-self-start'
53
+ | 'span-y-self-end'
54
+ | 'block-start'
55
+ | 'block-end'
56
+ | 'span-block-start'
57
+ | 'span-block-end'
58
+ | 'inline-start'
59
+ | 'inline-end'
60
+ | 'span-inline-start'
61
+ | 'span-inline-end'
62
+ | 'self-block-start'
63
+ | 'self-block-end'
64
+ | 'span-self-block-start'
65
+ | 'span-self-block-end'
66
+ | 'self-inline-start'
67
+ | 'self-inline-end'
68
+ | 'span-self-inline-start'
69
+ | 'span-self-inline-end'
70
+ | 'start'
71
+ | 'end'
72
+ | 'span-start'
73
+ | 'span-end'
74
+ | 'self-start'
75
+ | 'self-end'
76
+ | 'span-self-start'
77
+ | 'span-self-end'
78
+
79
+ type PositionTry =
80
+ | 'normal'
81
+ | 'flip-block'
82
+ | 'flip-inline'
83
+ | 'top'
84
+ | 'bottom'
85
+ | 'left'
86
+ | 'right'
87
+ | 'block-start'
88
+ | 'block-end'
89
+ | 'inline-start'
90
+ | 'inline-end'
91
+ | DashedIdent
92
+
93
+ export interface ModernCssProperties {
94
+ anchorName?: Globals | 'none' | DashedIdent | StringToMultiple<DashedIdent>
95
+ anchorScope?: Globals | 'none' | 'all' | DashedIdent | StringToMultiple<DashedIdent>
96
+ fieldSizing?: Globals | 'fixed' | 'content'
97
+ interpolateSize?: Globals | 'allow-keywords' | 'numeric-only'
98
+ positionAnchor?: Globals | 'auto' | DashedIdent
99
+ positionArea?: Globals | 'auto' | PositionAreaAxis | `${PositionAreaAxis} ${PositionAreaAxis}` | String
100
+ positionTry?: Globals | StringToMultiple<PositionTry> | String
101
+ positionTryFallback?: Globals | 'none' | StringToMultiple<PositionTry> | String
102
+ positionTryOrder?: Globals | 'normal' | 'most-width' | 'most-height' | 'most-block-size' | 'most-inline-size'
103
+ positionVisibility?: Globals | 'always' | 'anchors-visible' | 'no-overflow'
104
+ textWrapMode?: Globals | 'wrap' | 'nowrap'
105
+ textSpacingTrim?: Globals | 'normal' | 'space-all' | 'space-first' | 'trim-start'
106
+ textWrapStyle?: Globals | 'auto' | 'balance' | 'pretty' | 'stable'
107
+ }
108
+
109
+ export type CssProperty = keyof PropertiesFallback
110
+
111
+ export interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties, ModernCssProperties {}
112
+
113
+ export interface CssKeyframes {
114
+ [name: string]: {
115
+ [time: string]: CssProperties
116
+ }
117
+ }
118
+
119
+ /* -----------------------------------------------------------------------------
120
+ * Conditional css properties
121
+ * -----------------------------------------------------------------------------*/
122
+
123
+ interface GenericProperties {
124
+ [key: string]: ConditionalValue<String | Number | boolean>
125
+ }
126
+
127
+ /* -----------------------------------------------------------------------------
128
+ * Native css props
129
+ * -----------------------------------------------------------------------------*/
130
+
131
+ export type NestedCssProperties = Nested<CssProperties>
132
+
133
+ export type SystemStyleObject = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>
134
+
135
+ export interface GlobalStyleObject {
136
+ [selector: string]: SystemStyleObject
137
+ }
138
+ export interface ExtendableGlobalStyleObject {
139
+ [selector: string]: SystemStyleObject | undefined
140
+ extend?: GlobalStyleObject | undefined
141
+ }
142
+
143
+ /* -----------------------------------------------------------------------------
144
+ * Composition (text styles, layer styles)
145
+ * -----------------------------------------------------------------------------*/
146
+
147
+ type FilterStyleObject<P extends string> = {
148
+ [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown
149
+ }
150
+
151
+ export type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>
152
+
153
+ /* -----------------------------------------------------------------------------
154
+ * Font face
155
+ * -----------------------------------------------------------------------------*/
156
+
157
+ export type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>
158
+
159
+ export type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>
160
+
161
+ export interface GlobalFontface {
162
+ [name: string]: FontfaceRule | FontfaceRule[]
163
+ }
164
+
165
+ export interface ExtendableGlobalFontface {
166
+ [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined
167
+ extend?: GlobalFontface | undefined
168
+ }
169
+
170
+ /* -----------------------------------------------------------------------------
171
+ * Jsx style props
172
+ * -----------------------------------------------------------------------------*/
173
+ interface WithCss {
174
+ css?: SystemStyleObject | SystemStyleObject[]
175
+ }
176
+
177
+ export type JsxStyleProps = SystemStyleObject & WithCss
178
+
179
+ export interface PatchedHTMLProps {
180
+ htmlWidth?: string | number
181
+ htmlHeight?: string | number
182
+ htmlTranslate?: 'yes' | 'no' | undefined
183
+ htmlContent?: string
184
+ }
185
+
186
+ export type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'
187
+
188
+ type WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps
189
+
190
+ export type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<
191
+ WithHTMLProps<T>,
192
+ P
193
+ >
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@likec4/styles",
3
+ "license": "MIT",
4
+ "version": "1.27.0",
5
+ "bugs": "https://github.com/likec4/likec4/issues",
6
+ "homepage": "https://likec4.dev",
7
+ "author": "Denis Davydkov <denis@davydkov.com>",
8
+ "type": "module",
9
+ "files": [
10
+ "dist",
11
+ "*.mts",
12
+ "*.mjs",
13
+ "*.ts"
14
+ ],
15
+ "publishConfig": {
16
+ "registry": "https://registry.npmjs.org",
17
+ "access": "public"
18
+ },
19
+ "exports": {
20
+ "./css": {
21
+ "types": "./dist/css/index.d.ts",
22
+ "default": "./dist/css/index.mjs"
23
+ },
24
+ "./tokens": {
25
+ "types": "./dist/tokens/index.d.ts",
26
+ "default": "./dist/tokens/index.mjs"
27
+ },
28
+ "./types": {
29
+ "types": "./dist/types/index.d.ts"
30
+ },
31
+ "./patterns": {
32
+ "types": "./dist/patterns/index.d.ts",
33
+ "default": "./dist/patterns/index.mjs"
34
+ },
35
+ "./jsx": {
36
+ "types": "./dist/jsx/index.d.ts",
37
+ "default": "./dist/jsx/index.mjs"
38
+ },
39
+ "./postcss": {
40
+ "types": "./postcss.d.mts",
41
+ "default": "./postcss.mjs"
42
+ },
43
+ "./recipes": {
44
+ "types": "./dist/recipes/index.d.ts",
45
+ "default": "./dist/recipes/index.mjs"
46
+ },
47
+ "./preset": {
48
+ "sources": "./preset.ts",
49
+ "default": {
50
+ "types": "./preset.d.mts",
51
+ "import": "./preset.mjs",
52
+ "default": "./preset.mjs"
53
+ }
54
+ },
55
+ "./vite": {
56
+ "types": "./vite.d.mts",
57
+ "default": "./vite.mjs"
58
+ },
59
+ "./dev": "./dev.ts"
60
+ },
61
+ "dependencies": {
62
+ "@pandacss/dev": "^0.53.3",
63
+ "@pandabox/unplugin": "^0.2.1"
64
+ },
65
+ "devDependencies": {
66
+ "@pandabox/utils": "^0.0.5",
67
+ "@pandabox/panda-plugins": "^0.0.8",
68
+ "std-env": "^3.8.1",
69
+ "@types/react": "^19.0.12",
70
+ "@types/react-dom": "^19.0.4",
71
+ "postcss": "^8.5.3",
72
+ "remeda": "^2.21.2",
73
+ "nano-spawn": "^0.2.0",
74
+ "unbuild": "^3.5.0",
75
+ "typescript": "^5.8.2",
76
+ "@likec4/style-preset": "1.27.0",
77
+ "@likec4/tsconfig": "1.27.0"
78
+ },
79
+ "scripts": {
80
+ "typecheck": "tsc --noEmit",
81
+ "build": "unbuild",
82
+ "generate": "panda codegen && panda cssgen",
83
+ "emit-pkg": "panda emit-pkg --base dist"
84
+ }
85
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from './dev'
2
+
3
+ export default defineConfig({
4
+ // The output directory for your css system
5
+ outdir: 'dist',
6
+ })
package/postcss.d.mts ADDED
@@ -0,0 +1,6 @@
1
+ import { type PluginOptions } from '@pandacss/dev/postcss'
2
+ import type { PluginCreator } from 'postcss'
3
+
4
+ declare const pandaCss: PluginCreator<PluginOptions>
5
+
6
+ export { pandaCss as default }
package/postcss.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import pandacss from '@pandacss/dev/postcss'
2
+ export default pandacss