@pandacss/preset-open-props 0.0.0-dev-20231209011552
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 +21 -0
- package/dist/index.d.mts +107 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.js +254 -0
- package/dist/index.mjs +217 -0
- package/package.json +41 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 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/dist/index.d.mts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as _pandacss_types from '@pandacss/types';
|
|
2
|
+
|
|
3
|
+
declare const preset: {
|
|
4
|
+
theme: {
|
|
5
|
+
keyframes: {};
|
|
6
|
+
tokens: {
|
|
7
|
+
borderWidths: {
|
|
8
|
+
[k: string]: {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
radii: {
|
|
13
|
+
[k: string]: {
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
easings: {
|
|
18
|
+
[k: string]: {
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
zIndex: {
|
|
23
|
+
[k: string]: {
|
|
24
|
+
value: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
letterSpacings: {
|
|
28
|
+
[k: string]: {
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
fonts: {
|
|
33
|
+
[k: string]: {
|
|
34
|
+
value: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
lineHeights: {
|
|
38
|
+
[k: string]: {
|
|
39
|
+
value: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
fontWeights: {
|
|
43
|
+
[k: string]: {
|
|
44
|
+
value: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
fontSizes: {
|
|
48
|
+
[k: string]: {
|
|
49
|
+
value: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
shadows: {
|
|
53
|
+
[k: string]: {
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
assets: {
|
|
58
|
+
[k: string]: {
|
|
59
|
+
value: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
gradients: {
|
|
63
|
+
[k: string]: {
|
|
64
|
+
value: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
colors: {
|
|
68
|
+
[k: string]: {
|
|
69
|
+
value: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
spacing: {
|
|
73
|
+
[k: string]: {
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
sizes: {
|
|
78
|
+
[k: string]: {
|
|
79
|
+
value: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
animations: _pandacss_types.Dict;
|
|
83
|
+
};
|
|
84
|
+
semanticTokens: {
|
|
85
|
+
animations: {};
|
|
86
|
+
shadows: {
|
|
87
|
+
[k: string]: {
|
|
88
|
+
value: {
|
|
89
|
+
_dark: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
breakpoints: {
|
|
95
|
+
xxs: string;
|
|
96
|
+
xs: string;
|
|
97
|
+
sm: string;
|
|
98
|
+
md: string;
|
|
99
|
+
lg: string;
|
|
100
|
+
xl: string;
|
|
101
|
+
xxl: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
utilities: _pandacss_types.UtilityConfig;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { preset as default, preset };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as _pandacss_types from '@pandacss/types';
|
|
2
|
+
|
|
3
|
+
declare const preset: {
|
|
4
|
+
theme: {
|
|
5
|
+
keyframes: {};
|
|
6
|
+
tokens: {
|
|
7
|
+
borderWidths: {
|
|
8
|
+
[k: string]: {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
radii: {
|
|
13
|
+
[k: string]: {
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
easings: {
|
|
18
|
+
[k: string]: {
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
zIndex: {
|
|
23
|
+
[k: string]: {
|
|
24
|
+
value: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
letterSpacings: {
|
|
28
|
+
[k: string]: {
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
fonts: {
|
|
33
|
+
[k: string]: {
|
|
34
|
+
value: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
lineHeights: {
|
|
38
|
+
[k: string]: {
|
|
39
|
+
value: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
fontWeights: {
|
|
43
|
+
[k: string]: {
|
|
44
|
+
value: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
fontSizes: {
|
|
48
|
+
[k: string]: {
|
|
49
|
+
value: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
shadows: {
|
|
53
|
+
[k: string]: {
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
assets: {
|
|
58
|
+
[k: string]: {
|
|
59
|
+
value: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
gradients: {
|
|
63
|
+
[k: string]: {
|
|
64
|
+
value: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
colors: {
|
|
68
|
+
[k: string]: {
|
|
69
|
+
value: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
spacing: {
|
|
73
|
+
[k: string]: {
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
sizes: {
|
|
78
|
+
[k: string]: {
|
|
79
|
+
value: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
animations: _pandacss_types.Dict;
|
|
83
|
+
};
|
|
84
|
+
semanticTokens: {
|
|
85
|
+
animations: {};
|
|
86
|
+
shadows: {
|
|
87
|
+
[k: string]: {
|
|
88
|
+
value: {
|
|
89
|
+
_dark: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
breakpoints: {
|
|
95
|
+
xxs: string;
|
|
96
|
+
xs: string;
|
|
97
|
+
sm: string;
|
|
98
|
+
md: string;
|
|
99
|
+
lg: string;
|
|
100
|
+
xl: string;
|
|
101
|
+
xxl: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
utilities: _pandacss_types.UtilityConfig;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { preset as default, preset };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
default: () => src_default,
|
|
34
|
+
preset: () => preset
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
|
|
38
|
+
// src/keyframes.ts
|
|
39
|
+
var import_animations = __toESM(require("open-props/src/animations"));
|
|
40
|
+
var import_easing = __toESM(require("open-props/src/easing"));
|
|
41
|
+
|
|
42
|
+
// src/utils.ts
|
|
43
|
+
var import_css = __toESM(require("css"));
|
|
44
|
+
var camelize = (text) => {
|
|
45
|
+
return text.replace(/[-]+(.)?/g, (_, c) => c ? c.toUpperCase() : "").toLowerCase().replace(/^./, (match) => match.toLowerCase());
|
|
46
|
+
};
|
|
47
|
+
var transformOpenPropsObj = (obj, keyTransform = camelize, valueTransform = (text) => text) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [keyTransform(key), { value: valueTransform(value) }]));
|
|
48
|
+
var cssKeyframesToObj = (_css) => {
|
|
49
|
+
const parsedCss = import_css.default.parse(_css);
|
|
50
|
+
const stylesheet = parsedCss.stylesheet;
|
|
51
|
+
if (!stylesheet)
|
|
52
|
+
return {};
|
|
53
|
+
function isKeyframe(rule2) {
|
|
54
|
+
return "keyframes" in rule2 && rule2.type === "keyframes";
|
|
55
|
+
}
|
|
56
|
+
const rule = stylesheet.rules[0];
|
|
57
|
+
if (!isKeyframe(rule) || !rule.keyframes)
|
|
58
|
+
return {};
|
|
59
|
+
return rule.keyframes.map((keyframe) => {
|
|
60
|
+
const key = keyframe.values.join(", ");
|
|
61
|
+
const value = keyframe.declarations?.map((decl) => ({
|
|
62
|
+
[decl.property]: decl.value
|
|
63
|
+
})).reduce((acc, nxt) => Object.assign({}, acc, nxt), {});
|
|
64
|
+
return { [key]: value };
|
|
65
|
+
}).reduce((acc, nxt) => Object.assign({}, acc, nxt), {});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/keyframes.ts
|
|
69
|
+
var easings = transformOpenPropsObj(
|
|
70
|
+
import_easing.default,
|
|
71
|
+
(key) => key.replace("--ease-", ""),
|
|
72
|
+
(value) => value.replace("ease", "easings")
|
|
73
|
+
);
|
|
74
|
+
var _keyframes = Object.entries(import_animations.default).filter(([key]) => key.includes("@"));
|
|
75
|
+
var keyframes = _keyframes.reduce((acc, [_key, value]) => {
|
|
76
|
+
const key = _key.replace(/--animation-(.*?)-@(.*)/, "$1");
|
|
77
|
+
const suffix = _key.includes("media:dark") ? "-dark" : "";
|
|
78
|
+
return Object.assign({}, acc, {
|
|
79
|
+
[key + suffix]: cssKeyframesToObj(value)
|
|
80
|
+
});
|
|
81
|
+
}, {});
|
|
82
|
+
var animations = Object.entries(import_animations.default).filter(([key]) => !key.includes("@")).reduce(
|
|
83
|
+
(acc, [key, value]) => Object.assign({}, acc, { [key.replace("--animation-", "")]: { value: value.replace("ease", "easings") } }),
|
|
84
|
+
{}
|
|
85
|
+
);
|
|
86
|
+
var semanticAnimations = _keyframes.filter(([key]) => key.includes("media:dark")).reduce((acc, [_key]) => {
|
|
87
|
+
const key = _key.replace(/--animation-(.*?)-@(.*)/, "$1");
|
|
88
|
+
const value = animations[key].value;
|
|
89
|
+
return Object.assign({}, acc, {
|
|
90
|
+
[key]: { value: { _dark: value.replace(key, key + "-dark") } }
|
|
91
|
+
});
|
|
92
|
+
}, {});
|
|
93
|
+
|
|
94
|
+
// src/breakpoints.ts
|
|
95
|
+
var breakpoints = {
|
|
96
|
+
xxs: "240px",
|
|
97
|
+
xs: "360px",
|
|
98
|
+
sm: "480px",
|
|
99
|
+
md: "768px",
|
|
100
|
+
lg: "1024px",
|
|
101
|
+
xl: "1440px",
|
|
102
|
+
xxl: "1920px"
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// src/colors.ts
|
|
106
|
+
var import_colors = __toESM(require("open-props/src/colors"));
|
|
107
|
+
var import_colors_hsl = __toESM(require("open-props/src/colors-hsl"));
|
|
108
|
+
var base = transformOpenPropsObj(import_colors.default);
|
|
109
|
+
var hsl = transformOpenPropsObj(import_colors_hsl.default);
|
|
110
|
+
var colors = Object.assign({}, base, hsl);
|
|
111
|
+
|
|
112
|
+
// src/zIndex.ts
|
|
113
|
+
var import_zindex = __toESM(require("open-props/src/zindex"));
|
|
114
|
+
var zIndex = transformOpenPropsObj(import_zindex.default);
|
|
115
|
+
|
|
116
|
+
// src/assets.ts
|
|
117
|
+
var import_svg = __toESM(require("open-props/src/svg"));
|
|
118
|
+
var assets = transformOpenPropsObj(import_svg.default);
|
|
119
|
+
|
|
120
|
+
// src/gradients.ts
|
|
121
|
+
var import_gradients = __toESM(require("open-props/src/gradients"));
|
|
122
|
+
var noiseFilters = Object.fromEntries(
|
|
123
|
+
Object.entries(import_gradients.default).filter(([key]) => key.includes("-filter-")).map(([key, value]) => [camelize(key), value])
|
|
124
|
+
);
|
|
125
|
+
var gradients = Object.fromEntries(
|
|
126
|
+
Object.entries(import_gradients.default).filter(([key]) => !key.includes("-filter-")).map(([key, value]) => [camelize(key.replace("--gradient-", "")), { value }])
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
// src/borders.ts
|
|
130
|
+
var import_borders = __toESM(require("open-props/src/borders"));
|
|
131
|
+
var borderWidths = Object.fromEntries(
|
|
132
|
+
Object.entries(import_borders.default).filter(([key]) => key.includes("-size-")).map(([key, value]) => [key.replace("--border-size-", ""), { value }])
|
|
133
|
+
);
|
|
134
|
+
var radii = Object.fromEntries(
|
|
135
|
+
Object.entries(import_borders.default).filter(([key]) => !key.includes("-size-")).map(([key, value]) => [key.replace("--radius-", ""), { value }])
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
// src/shadows.ts
|
|
139
|
+
var import_shadows = __toESM(require("open-props/src/shadows"));
|
|
140
|
+
var _shadows = Object.entries(import_shadows.default).filter(([key]) => /--(shadow|inner-shadow)-\d+/.test(key));
|
|
141
|
+
var _shadow_vars = Object.keys(import_shadows.default).filter(
|
|
142
|
+
(key) => !/--(shadow|inner-shadow)-\d+/.test(key) && !key.includes("media:dark")
|
|
143
|
+
);
|
|
144
|
+
var shadows = Object.fromEntries(
|
|
145
|
+
_shadows.map(([key, _value]) => {
|
|
146
|
+
const value = _shadow_vars.reduce((result, str) => {
|
|
147
|
+
return result.replaceAll(`var(${str})`, import_shadows.default[str]);
|
|
148
|
+
}, _value);
|
|
149
|
+
return [
|
|
150
|
+
camelize(key.replace("-shadow-", "")),
|
|
151
|
+
{
|
|
152
|
+
value
|
|
153
|
+
}
|
|
154
|
+
];
|
|
155
|
+
})
|
|
156
|
+
);
|
|
157
|
+
var semanticShadows = Object.fromEntries(
|
|
158
|
+
_shadows.map(([key, _value]) => {
|
|
159
|
+
const value = _shadow_vars.reduce((result, str) => {
|
|
160
|
+
return result.replaceAll(`var(${str})`, import_shadows.default[str + "-@media:dark"]);
|
|
161
|
+
}, _value);
|
|
162
|
+
return [
|
|
163
|
+
camelize(key.replace("-shadow-", "")),
|
|
164
|
+
{
|
|
165
|
+
value: { _dark: value }
|
|
166
|
+
}
|
|
167
|
+
];
|
|
168
|
+
})
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
// src/sizes.ts
|
|
172
|
+
var import_sizes = __toESM(require("open-props/src/sizes"));
|
|
173
|
+
var spacing = transformOpenPropsObj(import_sizes.default, (key) => key.replace("--size-", ""));
|
|
174
|
+
var sizes = spacing;
|
|
175
|
+
|
|
176
|
+
// src/typography.ts
|
|
177
|
+
var import_fonts = __toESM(require("open-props/src/fonts"));
|
|
178
|
+
var transformFonts = (_v) => {
|
|
179
|
+
const v = `--font-${_v}-`;
|
|
180
|
+
return Object.fromEntries(
|
|
181
|
+
Object.entries(import_fonts.default).filter(([key]) => key.startsWith(v)).map(([key, value]) => [key.replace(v, ""), { value }])
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
var fontWeights = transformFonts("weight");
|
|
185
|
+
var lineHeights = transformFonts("lineheight");
|
|
186
|
+
var letterSpacings = transformFonts("letterspacing");
|
|
187
|
+
var fontSizes = transformFonts("size");
|
|
188
|
+
var _fonts = ["sans", "serif", "mono"];
|
|
189
|
+
var fonts = Object.fromEntries(_fonts.map((v) => [v, { value: import_fonts.default[`--font-${v}`] }]));
|
|
190
|
+
|
|
191
|
+
// src/tokens.ts
|
|
192
|
+
var defineTokens = (v) => v;
|
|
193
|
+
var tokens = defineTokens({
|
|
194
|
+
borderWidths,
|
|
195
|
+
radii,
|
|
196
|
+
easings,
|
|
197
|
+
zIndex,
|
|
198
|
+
letterSpacings,
|
|
199
|
+
fonts,
|
|
200
|
+
lineHeights,
|
|
201
|
+
fontWeights,
|
|
202
|
+
fontSizes,
|
|
203
|
+
shadows,
|
|
204
|
+
assets,
|
|
205
|
+
gradients,
|
|
206
|
+
colors,
|
|
207
|
+
spacing,
|
|
208
|
+
sizes,
|
|
209
|
+
animations
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// src/utilities.ts
|
|
213
|
+
var import_masks = __toESM(require("open-props/src/masks.corner-cuts"));
|
|
214
|
+
var import_masks2 = __toESM(require("open-props/src/masks.edges"));
|
|
215
|
+
var masks = Object.fromEntries(
|
|
216
|
+
Object.entries(Object.assign({}, import_masks.default, import_masks2.default)).map(([key, value]) => [
|
|
217
|
+
camelize(key.replace("--mask-", "")),
|
|
218
|
+
value
|
|
219
|
+
])
|
|
220
|
+
);
|
|
221
|
+
var utilities = {
|
|
222
|
+
WebkitMask: {
|
|
223
|
+
values: masks,
|
|
224
|
+
transform(value) {
|
|
225
|
+
return {
|
|
226
|
+
WebkitMask: value
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
filter: {
|
|
231
|
+
className: "filter",
|
|
232
|
+
values: noiseFilters
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/index.ts
|
|
237
|
+
var definePreset = (config) => config;
|
|
238
|
+
var preset = definePreset({
|
|
239
|
+
theme: {
|
|
240
|
+
keyframes,
|
|
241
|
+
tokens,
|
|
242
|
+
semanticTokens: {
|
|
243
|
+
animations: semanticAnimations,
|
|
244
|
+
shadows: semanticShadows
|
|
245
|
+
},
|
|
246
|
+
breakpoints
|
|
247
|
+
},
|
|
248
|
+
utilities
|
|
249
|
+
});
|
|
250
|
+
var src_default = preset;
|
|
251
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
252
|
+
0 && (module.exports = {
|
|
253
|
+
preset
|
|
254
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// src/keyframes.ts
|
|
2
|
+
import Animations from "open-props/src/animations";
|
|
3
|
+
import Easings from "open-props/src/easing";
|
|
4
|
+
|
|
5
|
+
// src/utils.ts
|
|
6
|
+
import css from "css";
|
|
7
|
+
var camelize = (text) => {
|
|
8
|
+
return text.replace(/[-]+(.)?/g, (_, c) => c ? c.toUpperCase() : "").toLowerCase().replace(/^./, (match) => match.toLowerCase());
|
|
9
|
+
};
|
|
10
|
+
var transformOpenPropsObj = (obj, keyTransform = camelize, valueTransform = (text) => text) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [keyTransform(key), { value: valueTransform(value) }]));
|
|
11
|
+
var cssKeyframesToObj = (_css) => {
|
|
12
|
+
const parsedCss = css.parse(_css);
|
|
13
|
+
const stylesheet = parsedCss.stylesheet;
|
|
14
|
+
if (!stylesheet)
|
|
15
|
+
return {};
|
|
16
|
+
function isKeyframe(rule2) {
|
|
17
|
+
return "keyframes" in rule2 && rule2.type === "keyframes";
|
|
18
|
+
}
|
|
19
|
+
const rule = stylesheet.rules[0];
|
|
20
|
+
if (!isKeyframe(rule) || !rule.keyframes)
|
|
21
|
+
return {};
|
|
22
|
+
return rule.keyframes.map((keyframe) => {
|
|
23
|
+
const key = keyframe.values.join(", ");
|
|
24
|
+
const value = keyframe.declarations?.map((decl) => ({
|
|
25
|
+
[decl.property]: decl.value
|
|
26
|
+
})).reduce((acc, nxt) => Object.assign({}, acc, nxt), {});
|
|
27
|
+
return { [key]: value };
|
|
28
|
+
}).reduce((acc, nxt) => Object.assign({}, acc, nxt), {});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/keyframes.ts
|
|
32
|
+
var easings = transformOpenPropsObj(
|
|
33
|
+
Easings,
|
|
34
|
+
(key) => key.replace("--ease-", ""),
|
|
35
|
+
(value) => value.replace("ease", "easings")
|
|
36
|
+
);
|
|
37
|
+
var _keyframes = Object.entries(Animations).filter(([key]) => key.includes("@"));
|
|
38
|
+
var keyframes = _keyframes.reduce((acc, [_key, value]) => {
|
|
39
|
+
const key = _key.replace(/--animation-(.*?)-@(.*)/, "$1");
|
|
40
|
+
const suffix = _key.includes("media:dark") ? "-dark" : "";
|
|
41
|
+
return Object.assign({}, acc, {
|
|
42
|
+
[key + suffix]: cssKeyframesToObj(value)
|
|
43
|
+
});
|
|
44
|
+
}, {});
|
|
45
|
+
var animations = Object.entries(Animations).filter(([key]) => !key.includes("@")).reduce(
|
|
46
|
+
(acc, [key, value]) => Object.assign({}, acc, { [key.replace("--animation-", "")]: { value: value.replace("ease", "easings") } }),
|
|
47
|
+
{}
|
|
48
|
+
);
|
|
49
|
+
var semanticAnimations = _keyframes.filter(([key]) => key.includes("media:dark")).reduce((acc, [_key]) => {
|
|
50
|
+
const key = _key.replace(/--animation-(.*?)-@(.*)/, "$1");
|
|
51
|
+
const value = animations[key].value;
|
|
52
|
+
return Object.assign({}, acc, {
|
|
53
|
+
[key]: { value: { _dark: value.replace(key, key + "-dark") } }
|
|
54
|
+
});
|
|
55
|
+
}, {});
|
|
56
|
+
|
|
57
|
+
// src/breakpoints.ts
|
|
58
|
+
var breakpoints = {
|
|
59
|
+
xxs: "240px",
|
|
60
|
+
xs: "360px",
|
|
61
|
+
sm: "480px",
|
|
62
|
+
md: "768px",
|
|
63
|
+
lg: "1024px",
|
|
64
|
+
xl: "1440px",
|
|
65
|
+
xxl: "1920px"
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/colors.ts
|
|
69
|
+
import Colors from "open-props/src/colors";
|
|
70
|
+
import ColorsHSL from "open-props/src/colors-hsl";
|
|
71
|
+
var base = transformOpenPropsObj(Colors);
|
|
72
|
+
var hsl = transformOpenPropsObj(ColorsHSL);
|
|
73
|
+
var colors = Object.assign({}, base, hsl);
|
|
74
|
+
|
|
75
|
+
// src/zIndex.ts
|
|
76
|
+
import zindex from "open-props/src/zindex";
|
|
77
|
+
var zIndex = transformOpenPropsObj(zindex);
|
|
78
|
+
|
|
79
|
+
// src/assets.ts
|
|
80
|
+
import svg from "open-props/src/svg";
|
|
81
|
+
var assets = transformOpenPropsObj(svg);
|
|
82
|
+
|
|
83
|
+
// src/gradients.ts
|
|
84
|
+
import Gradients from "open-props/src/gradients";
|
|
85
|
+
var noiseFilters = Object.fromEntries(
|
|
86
|
+
Object.entries(Gradients).filter(([key]) => key.includes("-filter-")).map(([key, value]) => [camelize(key), value])
|
|
87
|
+
);
|
|
88
|
+
var gradients = Object.fromEntries(
|
|
89
|
+
Object.entries(Gradients).filter(([key]) => !key.includes("-filter-")).map(([key, value]) => [camelize(key.replace("--gradient-", "")), { value }])
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// src/borders.ts
|
|
93
|
+
import Borders from "open-props/src/borders";
|
|
94
|
+
var borderWidths = Object.fromEntries(
|
|
95
|
+
Object.entries(Borders).filter(([key]) => key.includes("-size-")).map(([key, value]) => [key.replace("--border-size-", ""), { value }])
|
|
96
|
+
);
|
|
97
|
+
var radii = Object.fromEntries(
|
|
98
|
+
Object.entries(Borders).filter(([key]) => !key.includes("-size-")).map(([key, value]) => [key.replace("--radius-", ""), { value }])
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
// src/shadows.ts
|
|
102
|
+
import Shadows from "open-props/src/shadows";
|
|
103
|
+
var _shadows = Object.entries(Shadows).filter(([key]) => /--(shadow|inner-shadow)-\d+/.test(key));
|
|
104
|
+
var _shadow_vars = Object.keys(Shadows).filter(
|
|
105
|
+
(key) => !/--(shadow|inner-shadow)-\d+/.test(key) && !key.includes("media:dark")
|
|
106
|
+
);
|
|
107
|
+
var shadows = Object.fromEntries(
|
|
108
|
+
_shadows.map(([key, _value]) => {
|
|
109
|
+
const value = _shadow_vars.reduce((result, str) => {
|
|
110
|
+
return result.replaceAll(`var(${str})`, Shadows[str]);
|
|
111
|
+
}, _value);
|
|
112
|
+
return [
|
|
113
|
+
camelize(key.replace("-shadow-", "")),
|
|
114
|
+
{
|
|
115
|
+
value
|
|
116
|
+
}
|
|
117
|
+
];
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
var semanticShadows = Object.fromEntries(
|
|
121
|
+
_shadows.map(([key, _value]) => {
|
|
122
|
+
const value = _shadow_vars.reduce((result, str) => {
|
|
123
|
+
return result.replaceAll(`var(${str})`, Shadows[str + "-@media:dark"]);
|
|
124
|
+
}, _value);
|
|
125
|
+
return [
|
|
126
|
+
camelize(key.replace("-shadow-", "")),
|
|
127
|
+
{
|
|
128
|
+
value: { _dark: value }
|
|
129
|
+
}
|
|
130
|
+
];
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
// src/sizes.ts
|
|
135
|
+
import Sizes from "open-props/src/sizes";
|
|
136
|
+
var spacing = transformOpenPropsObj(Sizes, (key) => key.replace("--size-", ""));
|
|
137
|
+
var sizes = spacing;
|
|
138
|
+
|
|
139
|
+
// src/typography.ts
|
|
140
|
+
import Fonts from "open-props/src/fonts";
|
|
141
|
+
var transformFonts = (_v) => {
|
|
142
|
+
const v = `--font-${_v}-`;
|
|
143
|
+
return Object.fromEntries(
|
|
144
|
+
Object.entries(Fonts).filter(([key]) => key.startsWith(v)).map(([key, value]) => [key.replace(v, ""), { value }])
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
var fontWeights = transformFonts("weight");
|
|
148
|
+
var lineHeights = transformFonts("lineheight");
|
|
149
|
+
var letterSpacings = transformFonts("letterspacing");
|
|
150
|
+
var fontSizes = transformFonts("size");
|
|
151
|
+
var _fonts = ["sans", "serif", "mono"];
|
|
152
|
+
var fonts = Object.fromEntries(_fonts.map((v) => [v, { value: Fonts[`--font-${v}`] }]));
|
|
153
|
+
|
|
154
|
+
// src/tokens.ts
|
|
155
|
+
var defineTokens = (v) => v;
|
|
156
|
+
var tokens = defineTokens({
|
|
157
|
+
borderWidths,
|
|
158
|
+
radii,
|
|
159
|
+
easings,
|
|
160
|
+
zIndex,
|
|
161
|
+
letterSpacings,
|
|
162
|
+
fonts,
|
|
163
|
+
lineHeights,
|
|
164
|
+
fontWeights,
|
|
165
|
+
fontSizes,
|
|
166
|
+
shadows,
|
|
167
|
+
assets,
|
|
168
|
+
gradients,
|
|
169
|
+
colors,
|
|
170
|
+
spacing,
|
|
171
|
+
sizes,
|
|
172
|
+
animations
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// src/utilities.ts
|
|
176
|
+
import MaskCornerCuts from "open-props/src/masks.corner-cuts";
|
|
177
|
+
import MaskEdges from "open-props/src/masks.edges";
|
|
178
|
+
var masks = Object.fromEntries(
|
|
179
|
+
Object.entries(Object.assign({}, MaskCornerCuts, MaskEdges)).map(([key, value]) => [
|
|
180
|
+
camelize(key.replace("--mask-", "")),
|
|
181
|
+
value
|
|
182
|
+
])
|
|
183
|
+
);
|
|
184
|
+
var utilities = {
|
|
185
|
+
WebkitMask: {
|
|
186
|
+
values: masks,
|
|
187
|
+
transform(value) {
|
|
188
|
+
return {
|
|
189
|
+
WebkitMask: value
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
filter: {
|
|
194
|
+
className: "filter",
|
|
195
|
+
values: noiseFilters
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// src/index.ts
|
|
200
|
+
var definePreset = (config) => config;
|
|
201
|
+
var preset = definePreset({
|
|
202
|
+
theme: {
|
|
203
|
+
keyframes,
|
|
204
|
+
tokens,
|
|
205
|
+
semanticTokens: {
|
|
206
|
+
animations: semanticAnimations,
|
|
207
|
+
shadows: semanticShadows
|
|
208
|
+
},
|
|
209
|
+
breakpoints
|
|
210
|
+
},
|
|
211
|
+
utilities
|
|
212
|
+
});
|
|
213
|
+
var src_default = preset;
|
|
214
|
+
export {
|
|
215
|
+
src_default as default,
|
|
216
|
+
preset
|
|
217
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pandacss/preset-open-props",
|
|
3
|
+
"version": "0.0.0-dev-20231209011552",
|
|
4
|
+
"description": "A preset for Open Props",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"author": "Abraham Aremu <anubra266@gmail.com>",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"source": "./src/index.ts",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"require": "./dist/index.js",
|
|
18
|
+
"import": {
|
|
19
|
+
"types": "./dist/index.d.mts",
|
|
20
|
+
"default": "./dist/index.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"css": "^3.0.0",
|
|
30
|
+
"open-props": "^1.6.13",
|
|
31
|
+
"@pandacss/types": "0.0.0-dev-20231209011552"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/css": "^0.0.37"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup src/index.ts --format=esm,cjs --dts",
|
|
38
|
+
"build-fast": "tsup src/index.ts --format=esm,cjs --no-dts",
|
|
39
|
+
"dev": "pnpm build-fast --watch"
|
|
40
|
+
}
|
|
41
|
+
}
|