@pandacss/types 0.0.0-dev-20221121152823

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Segun Adebayo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@pandacss/types",
3
+ "version": "0.0.0-dev-20221121152823",
4
+ "description": "The types for css panda",
5
+ "main": "src/index.d.ts",
6
+ "author": "Segun Adebayo <joseshegs@gmail.com>",
7
+ "sideEffects": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "src"
13
+ ],
14
+ "devDependencies": {
15
+ "csstype": "3.1.1"
16
+ },
17
+ "scripts": {}
18
+ }
@@ -0,0 +1,106 @@
1
+ import type { PandaConditionalValue, Properties } from './panda-csstype'
2
+
3
+ export type Composition<V = any> = {
4
+ value: V
5
+ description?: string
6
+ }
7
+
8
+ type Nested<T> = {
9
+ [key: string]: T | Nested<T>
10
+ }
11
+
12
+ type TextStyleProperty =
13
+ | 'fontSize'
14
+ | 'fontSizeAdjust'
15
+ | 'fontVariationSettings'
16
+ | 'fontVariantPosition'
17
+ | 'fontVariantCaps'
18
+ | 'fontVariantNumeric'
19
+ | 'fontVariantAlternates'
20
+ | 'fontVariantLigatures'
21
+ | 'fontFamily'
22
+ | 'fontWeight'
23
+ | 'fontSynthesis'
24
+ | 'fontStyle'
25
+ | 'fontVariant'
26
+ | 'lineHeight'
27
+ | 'letterSpacing'
28
+ | 'textDecoration'
29
+ | 'textTransform'
30
+ | 'textIndent'
31
+ | 'textDecorationColor'
32
+ | 'textDecorationLine'
33
+ | 'textDecorationStyle'
34
+ | 'textEmphasisColor'
35
+ | 'textEmphasisPosition'
36
+ | 'textEmphasisStyle'
37
+ | 'hyphenateCharacter'
38
+ | 'textOrientation'
39
+ | 'textOverflow'
40
+ | 'textRendering'
41
+ | (string & {})
42
+
43
+ type TCondition = Record<string, string>
44
+
45
+ type TextStyle<Conditions extends TCondition = TCondition> = {
46
+ [K in TextStyleProperty]?: PandaConditionalValue<Conditions, Properties[K] | (string & {})>
47
+ }
48
+
49
+ type Placement =
50
+ | 'Top'
51
+ | 'Right'
52
+ | 'Bottom'
53
+ | 'Left'
54
+ | 'Inline'
55
+ | 'Block'
56
+ | 'InlineStart'
57
+ | 'InlineEnd'
58
+ | 'BlockStart'
59
+ | 'BlockEnd'
60
+
61
+ type Radius =
62
+ | `Top${'Right' | 'Left' | 'Start' | 'End'}`
63
+ | `Bottom${'Right' | 'Left' | 'Start' | 'End'}`
64
+ | `Start${'Start' | 'End'}`
65
+ | `End${'Start' | 'End'}`
66
+
67
+ type LayerStyleProperty =
68
+ | 'background'
69
+ | 'backgroundColor'
70
+ | 'backgroundImage'
71
+ | 'borderRadius'
72
+ | 'border'
73
+ | 'borderWidth'
74
+ | 'borderColor'
75
+ | 'borderStyle'
76
+ | 'boxShadow'
77
+ | 'filter'
78
+ | 'backdropFilter'
79
+ | 'transform'
80
+ | 'color'
81
+ | 'opacity'
82
+ | 'backgroundBlendMode'
83
+ | 'backgroundAttachment'
84
+ | 'backgroundClip'
85
+ | 'backgroundOrigin'
86
+ | 'backgroundPosition'
87
+ | 'backgroundRepeat'
88
+ | 'backgroundSize'
89
+ | `border${Placement}`
90
+ | `border${Placement}Width`
91
+ | `border${Radius}Radius`
92
+ | `border${Placement}Color`
93
+ | `border${Placement}Style`
94
+ | 'padding'
95
+ | `padding${Placement}`
96
+ | 'margin'
97
+ | `margin${Placement}`
98
+ | (string & {})
99
+
100
+ type LayerStyle<Conditions extends TCondition = TCondition> = {
101
+ [K in LayerStyleProperty]?: PandaConditionalValue<Conditions, Properties[K]>
102
+ }
103
+
104
+ export type TextStyles<Conditions extends TCondition = TCondition> = Nested<Composition<TextStyle<Conditions>>>
105
+
106
+ export type LayerStyles<Conditions extends TCondition = TCondition> = Nested<Composition<LayerStyle<Conditions>>>
@@ -0,0 +1,17 @@
1
+ export type BaseConditionType = 'at-rule' | 'parent-nesting' | 'self-nesting' | 'combinator-nesting'
2
+
3
+ export type BaseCondition = {
4
+ type: BaseConditionType
5
+ value: string
6
+ [key: string]: string
7
+ }
8
+
9
+ export type RawCondition = BaseCondition & { raw: string }
10
+
11
+ export type Conditions = {
12
+ [condition: string]: string
13
+ }
14
+
15
+ export type RecursiveCondition<T extends string, C extends string> =
16
+ | T
17
+ | { [K in C]?: RecursiveCondition<T, Exclude<C, K>> }
@@ -0,0 +1,158 @@
1
+ import type { LayerStyles, TextStyles } from './composition'
2
+ import type { Conditions as TConditions } from './conditions'
3
+ import type { Keyframes, GlobalCss } from './panda-csstype'
4
+ import type { PatternConfig } from './pattern'
5
+ import type { RecipeConfig } from './recipe'
6
+ import type { Dict, RequiredBy } from './shared'
7
+ import type { PartialTokens, SemanticTokens } from './tokens'
8
+ import type { UtilityConfig } from './utility'
9
+ import type { ClassGeneratorOptions } from './generator'
10
+
11
+ export type Config<
12
+ Conditions extends TConditions = TConditions,
13
+ Breakpoints extends Dict = Dict,
14
+ Tokens extends PartialTokens = PartialTokens,
15
+ > = {
16
+ /**
17
+ * The value separator used in the generated class names.
18
+ * @default '_'
19
+ */
20
+ separator?: '_' | '=' | '-'
21
+ /**
22
+ * The log level for the built-in logger.
23
+ */
24
+ logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent'
25
+ /**
26
+ * Used to create reusable config presets for your project or team.
27
+ */
28
+ presets?: string[]
29
+ /**
30
+ * Whether to include css reset styles in the generated css.
31
+ */
32
+ preflight?: boolean
33
+ /**
34
+ * Whether to minify the generated css.
35
+ */
36
+ minify?: boolean
37
+ /**
38
+ * The current working directory.
39
+ */
40
+ cwd?: string
41
+ /**
42
+ * Whether to hash the generated class names.
43
+ * This is useful if want to shorten the class names.
44
+ */
45
+ hash?: boolean
46
+ /**
47
+ * Whether to clean the output directory before generating the css.
48
+ */
49
+ clean?: boolean
50
+ /**
51
+ * The output directory.
52
+ */
53
+ outdir?: string
54
+ /**
55
+ * The css variable options for the generated design tokens
56
+ */
57
+ cssVar?: {
58
+ /**
59
+ * The prefix for the css variables.
60
+ */
61
+ prefix?: string
62
+ /**
63
+ * The root selector for the css variables.
64
+ * @default ':where(:host, :root)'
65
+ */
66
+ root?: string
67
+ }
68
+ /**
69
+ * Files to watch for changes.
70
+ */
71
+ include?: string[]
72
+ /**
73
+ * Files to ignore.
74
+ */
75
+ exclude?: string[]
76
+ /**
77
+ * Whether to watch for changes and regenerate the css.
78
+ */
79
+ watch?: boolean
80
+ /**
81
+ * Whether to use polling instead of filesystem events when watching.
82
+ */
83
+ poll?: boolean
84
+ /**
85
+ * The css selectors or media queries shortcuts.
86
+ * @example `{ hover: "&:hover" }`
87
+ */
88
+ conditions?: TConditions
89
+ /**
90
+ * The breakpoints for your project.
91
+ */
92
+ breakpoints?: Breakpoints
93
+ /**
94
+ * The css animation keyframes definitions.
95
+ */
96
+ keyframes?: Keyframes
97
+ /**
98
+ * The global styles for your project.
99
+ */
100
+ globalCss?: GlobalCss
101
+ /**
102
+ * The design tokens for your project.
103
+ */
104
+ tokens?: Tokens
105
+ /**
106
+ * The semantic design tokens for your project.
107
+ */
108
+ semanticTokens?: SemanticTokens<keyof Conditions | keyof Breakpoints | 'base' | '_'>
109
+ /**
110
+ * The typography styles for your project.
111
+ */
112
+ textStyles?: TextStyles
113
+ /**
114
+ * The layer styles for your project.
115
+ */
116
+ layerStyles?: LayerStyles
117
+ /**
118
+ * The css utility definitions.
119
+ */
120
+ utilities?: UtilityConfig
121
+ /**
122
+ * Multi-variant style definitions for your project.
123
+ * Useful for defining component styles.
124
+ */
125
+ recipes?: Record<string, RecipeConfig>
126
+ /**
127
+ * Common styling or layout patterns for your project.
128
+ */
129
+ patterns?: Record<string, PatternConfig>
130
+ /**
131
+ * The framework to use for generating supercharged elements.
132
+ * @default 'react'
133
+ */
134
+ jsxFramework?: 'react' | 'solid' | 'preact'
135
+ /**
136
+ * The factory name of the element
137
+ * @default 'panda'
138
+ *
139
+ * @example
140
+ * ```jsx
141
+ * <panda.button marginTop="40px">Click me</panda.button>
142
+ * ```
143
+ */
144
+ jsxFactory?: string
145
+ /**
146
+ * Options for the generated typescript definitions.
147
+ */
148
+ strictTokens?: boolean
149
+ /**
150
+ * @experimental
151
+ * Used to generate css utility classes for your project.
152
+ */
153
+ generator?: ClassGeneratorOptions
154
+ }
155
+
156
+ export type TConfig = Config<TConditions, Dict, Dict>
157
+
158
+ export type UserConfig = RequiredBy<Config, 'outdir' | 'cwd' | 'include'>