typewritingclass 0.2.2 → 0.2.3
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/borders-pzt8w5Wv.d.cts +24 -0
- package/dist/borders-pzt8w5Wv.d.ts +24 -0
- package/dist/chunk-34VD2OBF.cjs +74 -0
- package/dist/chunk-6CEDQ6GF.cjs +36 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-ATLK64TQ.js +85 -0
- package/dist/chunk-BAZLFQIV.cjs +85 -0
- package/dist/chunk-CB7B6PHY.cjs +19 -0
- package/dist/chunk-EBHM46CV.cjs +25 -0
- package/dist/chunk-IL3LVS32.js +36 -0
- package/dist/chunk-JKT74FUK.js +25 -0
- package/dist/chunk-L3IF2OVA.cjs +354 -0
- package/{src/theme/animations.ts → dist/chunk-L7AJQJBR.js} +16 -8
- package/dist/chunk-LARVCDO3.js +113 -0
- package/dist/chunk-M34ZK4IV.cjs +53 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-PBQX6PVK.js +80 -0
- package/dist/chunk-PTY5FTFB.cjs +80 -0
- package/dist/chunk-T776FXQK.js +53 -0
- package/dist/chunk-TAAEIXRF.js +74 -0
- package/dist/chunk-TUUH2FJY.cjs +39 -0
- package/dist/chunk-U2LSMKZS.js +60 -0
- package/dist/chunk-UUUE7HRN.cjs +60 -0
- package/dist/chunk-UUVUSZJS.cjs +113 -0
- package/dist/chunk-XEHQXLQR.js +354 -0
- package/dist/chunk-YHDPOIUZ.js +39 -0
- package/dist/colors-MvgcZKUW.d.cts +72 -0
- package/dist/colors-MvgcZKUW.d.ts +72 -0
- package/dist/index.cjs +2922 -0
- package/dist/index.d.cts +3515 -0
- package/dist/index.d.ts +3515 -0
- package/dist/index.js +2922 -0
- package/{src/theme/inject-theme.ts → dist/inject-theme-CTzyfQH0.d.cts} +4 -20
- package/dist/inject-theme-CTzyfQH0.d.ts +65 -0
- package/dist/inject.cjs +32 -0
- package/dist/inject.d.cts +2 -0
- package/dist/inject.d.ts +2 -0
- package/dist/inject.js +32 -0
- package/dist/rule.cjs +19 -0
- package/{src/rule.ts → dist/rule.d.cts} +10 -79
- package/dist/rule.d.ts +133 -0
- package/dist/rule.js +19 -0
- package/dist/runtime.cjs +9 -0
- package/{src/runtime.ts → dist/runtime.d.cts} +4 -7
- package/dist/runtime.d.ts +33 -0
- package/dist/runtime.js +9 -0
- package/dist/shadows-CWViP1Zk.d.cts +22 -0
- package/dist/shadows-CWViP1Zk.d.ts +22 -0
- package/dist/sizes-CS9iz8YG.d.cts +46 -0
- package/dist/sizes-CS9iz8YG.d.ts +46 -0
- package/dist/theme/animations.cjs +15 -0
- package/dist/theme/animations.d.cts +12 -0
- package/dist/theme/animations.d.ts +12 -0
- package/dist/theme/animations.js +15 -0
- package/dist/theme/borders.cjs +23 -0
- package/dist/theme/borders.d.cts +1 -0
- package/dist/theme/borders.d.ts +1 -0
- package/dist/theme/borders.js +23 -0
- package/dist/theme/colors.cjs +57 -0
- package/dist/theme/colors.d.cts +1 -0
- package/dist/theme/colors.d.ts +1 -0
- package/dist/theme/colors.js +57 -0
- package/dist/theme/createTheme.cjs +7 -0
- package/dist/theme/createTheme.d.cts +133 -0
- package/dist/theme/createTheme.d.ts +133 -0
- package/dist/theme/createTheme.js +7 -0
- package/dist/theme/filters.cjs +9 -0
- package/dist/theme/filters.d.cts +21 -0
- package/dist/theme/filters.d.ts +21 -0
- package/dist/theme/filters.js +9 -0
- package/dist/theme/index.cjs +35 -0
- package/dist/theme/index.d.cts +18 -0
- package/dist/theme/index.d.ts +18 -0
- package/dist/theme/index.js +35 -0
- package/dist/theme/shadows.cjs +21 -0
- package/dist/theme/shadows.d.cts +1 -0
- package/dist/theme/shadows.d.ts +1 -0
- package/dist/theme/shadows.js +21 -0
- package/dist/theme/sizes.cjs +21 -0
- package/dist/theme/sizes.d.cts +1 -0
- package/dist/theme/sizes.d.ts +1 -0
- package/dist/theme/sizes.js +21 -0
- package/dist/theme/typography.cjs +55 -0
- package/dist/theme/typography.d.cts +1 -0
- package/dist/theme/typography.d.ts +1 -0
- package/dist/theme/typography.js +55 -0
- package/dist/types-FfRD4Hbd.d.cts +346 -0
- package/dist/types-FfRD4Hbd.d.ts +346 -0
- package/dist/typography-C8wipcCK.d.cts +87 -0
- package/dist/typography-C8wipcCK.d.ts +87 -0
- package/package.json +117 -33
- package/src/css.ts +0 -140
- package/src/cx.ts +0 -105
- package/src/dcx.ts +0 -79
- package/src/dynamic.ts +0 -117
- package/src/hash.ts +0 -55
- package/src/index.ts +0 -139
- package/src/inject.ts +0 -86
- package/src/layer.ts +0 -81
- package/src/modifiers/aria.ts +0 -15
- package/src/modifiers/colorScheme.ts +0 -32
- package/src/modifiers/data.ts +0 -6
- package/src/modifiers/direction.ts +0 -5
- package/src/modifiers/group.ts +0 -21
- package/src/modifiers/index.ts +0 -17
- package/src/modifiers/media.ts +0 -11
- package/src/modifiers/peer.ts +0 -24
- package/src/modifiers/pseudo.ts +0 -183
- package/src/modifiers/pseudoElements.ts +0 -26
- package/src/modifiers/responsive.ts +0 -110
- package/src/modifiers/supports.ts +0 -6
- package/src/registry.ts +0 -171
- package/src/theme/borders.ts +0 -9
- package/src/theme/colors.ts +0 -326
- package/src/theme/createTheme.ts +0 -238
- package/src/theme/filters.ts +0 -20
- package/src/theme/index.ts +0 -9
- package/src/theme/shadows.ts +0 -8
- package/src/theme/sizes.ts +0 -37
- package/src/theme/spacing.ts +0 -44
- package/src/theme/typography.ts +0 -72
- package/src/tw.ts +0 -967
- package/src/types.ts +0 -273
- package/src/utilities/accessibility.ts +0 -33
- package/src/utilities/backgrounds.ts +0 -87
- package/src/utilities/borders.ts +0 -629
- package/src/utilities/colors.ts +0 -151
- package/src/utilities/effects.ts +0 -181
- package/src/utilities/filters.ts +0 -113
- package/src/utilities/index.ts +0 -57
- package/src/utilities/interactivity.ts +0 -254
- package/src/utilities/layout.ts +0 -1194
- package/src/utilities/spacing.ts +0 -681
- package/src/utilities/svg.ts +0 -35
- package/src/utilities/tables.ts +0 -54
- package/src/utilities/transforms.ts +0 -88
- package/src/utilities/transitions.ts +0 -107
- package/src/utilities/typography.ts +0 -387
- package/src/when.ts +0 -63
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const none = "0px";
|
|
2
|
+
declare const sm = "0.125rem";
|
|
3
|
+
declare const DEFAULT = "0.25rem";
|
|
4
|
+
declare const md = "0.375rem";
|
|
5
|
+
declare const lg = "0.5rem";
|
|
6
|
+
declare const xl = "0.75rem";
|
|
7
|
+
declare const _2xl = "1rem";
|
|
8
|
+
declare const _3xl = "1.5rem";
|
|
9
|
+
declare const full = "9999px";
|
|
10
|
+
|
|
11
|
+
declare const borders_DEFAULT: typeof DEFAULT;
|
|
12
|
+
declare const borders__2xl: typeof _2xl;
|
|
13
|
+
declare const borders__3xl: typeof _3xl;
|
|
14
|
+
declare const borders_full: typeof full;
|
|
15
|
+
declare const borders_lg: typeof lg;
|
|
16
|
+
declare const borders_md: typeof md;
|
|
17
|
+
declare const borders_none: typeof none;
|
|
18
|
+
declare const borders_sm: typeof sm;
|
|
19
|
+
declare const borders_xl: typeof xl;
|
|
20
|
+
declare namespace borders {
|
|
21
|
+
export { borders_DEFAULT as DEFAULT, borders__2xl as _2xl, borders__3xl as _3xl, borders_full as full, borders_lg as lg, borders_md as md, borders_none as none, borders_sm as sm, borders_xl as xl };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { DEFAULT as D, _2xl as _, _3xl as a, borders as b, full as f, lg as l, md as m, none as n, sm as s, xl as x };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const none = "0px";
|
|
2
|
+
declare const sm = "0.125rem";
|
|
3
|
+
declare const DEFAULT = "0.25rem";
|
|
4
|
+
declare const md = "0.375rem";
|
|
5
|
+
declare const lg = "0.5rem";
|
|
6
|
+
declare const xl = "0.75rem";
|
|
7
|
+
declare const _2xl = "1rem";
|
|
8
|
+
declare const _3xl = "1.5rem";
|
|
9
|
+
declare const full = "9999px";
|
|
10
|
+
|
|
11
|
+
declare const borders_DEFAULT: typeof DEFAULT;
|
|
12
|
+
declare const borders__2xl: typeof _2xl;
|
|
13
|
+
declare const borders__3xl: typeof _3xl;
|
|
14
|
+
declare const borders_full: typeof full;
|
|
15
|
+
declare const borders_lg: typeof lg;
|
|
16
|
+
declare const borders_md: typeof md;
|
|
17
|
+
declare const borders_none: typeof none;
|
|
18
|
+
declare const borders_sm: typeof sm;
|
|
19
|
+
declare const borders_xl: typeof xl;
|
|
20
|
+
declare namespace borders {
|
|
21
|
+
export { borders_DEFAULT as DEFAULT, borders__2xl as _2xl, borders__3xl as _3xl, borders_full as full, borders_lg as lg, borders_md as md, borders_none as none, borders_sm as sm, borders_xl as xl };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { DEFAULT as D, _2xl as _, _3xl as a, borders as b, full as f, lg as l, md as m, none as n, sm as s, xl as x };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
4
|
+
|
|
5
|
+
// src/theme/spacing.ts
|
|
6
|
+
var spacing_exports = {};
|
|
7
|
+
_chunk75ZPJI57cjs.__export.call(void 0, spacing_exports, {
|
|
8
|
+
resolveSpacing: () => resolveSpacing,
|
|
9
|
+
spacingScale: () => spacingScale
|
|
10
|
+
});
|
|
11
|
+
var spacingScale = {
|
|
12
|
+
0: "0px",
|
|
13
|
+
0.5: "0.125rem",
|
|
14
|
+
1: "0.25rem",
|
|
15
|
+
1.5: "0.375rem",
|
|
16
|
+
2: "0.5rem",
|
|
17
|
+
2.5: "0.625rem",
|
|
18
|
+
3: "0.75rem",
|
|
19
|
+
3.5: "0.875rem",
|
|
20
|
+
4: "1rem",
|
|
21
|
+
5: "1.25rem",
|
|
22
|
+
6: "1.5rem",
|
|
23
|
+
7: "1.75rem",
|
|
24
|
+
8: "2rem",
|
|
25
|
+
9: "2.25rem",
|
|
26
|
+
10: "2.5rem",
|
|
27
|
+
11: "2.75rem",
|
|
28
|
+
12: "3rem",
|
|
29
|
+
14: "3.5rem",
|
|
30
|
+
16: "4rem",
|
|
31
|
+
20: "5rem",
|
|
32
|
+
24: "6rem",
|
|
33
|
+
28: "7rem",
|
|
34
|
+
32: "8rem",
|
|
35
|
+
36: "9rem",
|
|
36
|
+
40: "10rem",
|
|
37
|
+
44: "11rem",
|
|
38
|
+
48: "12rem",
|
|
39
|
+
52: "13rem",
|
|
40
|
+
56: "14rem",
|
|
41
|
+
60: "15rem",
|
|
42
|
+
64: "16rem",
|
|
43
|
+
72: "18rem",
|
|
44
|
+
80: "20rem",
|
|
45
|
+
96: "24rem"
|
|
46
|
+
};
|
|
47
|
+
function resolveSpacing(value) {
|
|
48
|
+
if (typeof value === "string") return value;
|
|
49
|
+
if (value in spacingScale) return spacingScale[value];
|
|
50
|
+
return `${value * 0.25}rem`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/theme/inject-theme.ts
|
|
54
|
+
var themeStyleEl = null;
|
|
55
|
+
function injectTheme(cssText) {
|
|
56
|
+
if (typeof document === "undefined") return;
|
|
57
|
+
if (!themeStyleEl) {
|
|
58
|
+
themeStyleEl = document.createElement("style");
|
|
59
|
+
themeStyleEl.id = "twc-theme";
|
|
60
|
+
document.head.appendChild(themeStyleEl);
|
|
61
|
+
}
|
|
62
|
+
themeStyleEl.textContent += (themeStyleEl.textContent ? "\n" : "") + cssText;
|
|
63
|
+
}
|
|
64
|
+
function setTheme(name) {
|
|
65
|
+
if (typeof document === "undefined") return;
|
|
66
|
+
document.documentElement.setAttribute("data-theme", name);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
exports.resolveSpacing = resolveSpacing; exports.spacing_exports = spacing_exports; exports.injectTheme = injectTheme; exports.setTheme = setTheme;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
4
|
+
|
|
5
|
+
// src/theme/shadows.ts
|
|
6
|
+
var shadows_exports = {};
|
|
7
|
+
_chunk75ZPJI57cjs.__export.call(void 0, shadows_exports, {
|
|
8
|
+
DEFAULT: () => DEFAULT,
|
|
9
|
+
_2xl: () => _2xl,
|
|
10
|
+
inner: () => inner,
|
|
11
|
+
lg: () => lg,
|
|
12
|
+
md: () => md,
|
|
13
|
+
none: () => none,
|
|
14
|
+
sm: () => sm,
|
|
15
|
+
xl: () => xl
|
|
16
|
+
});
|
|
17
|
+
var sm = "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
18
|
+
var DEFAULT = "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";
|
|
19
|
+
var md = "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
20
|
+
var lg = "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";
|
|
21
|
+
var xl = "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";
|
|
22
|
+
var _2xl = "0 25px 50px -12px rgb(0 0 0 / 0.25)";
|
|
23
|
+
var inner = "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)";
|
|
24
|
+
var none = "0 0 #0000";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
exports.sm = sm; exports.DEFAULT = DEFAULT; exports.md = md; exports.lg = lg; exports.xl = xl; exports._2xl = _2xl; exports.inner = inner; exports.none = none; exports.shadows_exports = shadows_exports;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.__export = __export;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/theme/createTheme.ts
|
|
2
|
+
function varName(...parts) {
|
|
3
|
+
return `--twc-${parts.join("-")}`;
|
|
4
|
+
}
|
|
5
|
+
function varRef(name) {
|
|
6
|
+
return `var(${name})`;
|
|
7
|
+
}
|
|
8
|
+
function createTheme(config) {
|
|
9
|
+
const name = config.name ?? "default";
|
|
10
|
+
const properties = [];
|
|
11
|
+
const colorVars = {};
|
|
12
|
+
const spacingVars = {};
|
|
13
|
+
const typographyVars = { textSizes: {}, fontWeights: {} };
|
|
14
|
+
const borderVars = {};
|
|
15
|
+
const shadowVars = {};
|
|
16
|
+
if (config.colors) {
|
|
17
|
+
for (const [colorName, scale] of Object.entries(config.colors)) {
|
|
18
|
+
colorVars[colorName] = {};
|
|
19
|
+
for (const [shade, hex] of Object.entries(scale)) {
|
|
20
|
+
const vn = varName("color", colorName, shade);
|
|
21
|
+
properties.push(` ${vn}: ${hex};`);
|
|
22
|
+
colorVars[colorName][shade] = varRef(vn);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (config.spacing) {
|
|
27
|
+
for (const [key, value] of Object.entries(config.spacing)) {
|
|
28
|
+
const vn = varName("spacing", key);
|
|
29
|
+
properties.push(` ${vn}: ${value};`);
|
|
30
|
+
spacingVars[key] = varRef(vn);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (config.typography?.textSizes) {
|
|
34
|
+
for (const [sizeName, size] of Object.entries(config.typography.textSizes)) {
|
|
35
|
+
const fsvn = varName("text", sizeName, "fs");
|
|
36
|
+
const lhvn = varName("text", sizeName, "lh");
|
|
37
|
+
properties.push(` ${fsvn}: ${size.fontSize};`);
|
|
38
|
+
properties.push(` ${lhvn}: ${size.lineHeight};`);
|
|
39
|
+
typographyVars.textSizes[sizeName] = {
|
|
40
|
+
fontSize: varRef(fsvn),
|
|
41
|
+
lineHeight: varRef(lhvn)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (config.typography?.fontWeights) {
|
|
46
|
+
for (const [weightName, weight] of Object.entries(config.typography.fontWeights)) {
|
|
47
|
+
const vn = varName("font", weightName);
|
|
48
|
+
properties.push(` ${vn}: ${weight};`);
|
|
49
|
+
typographyVars.fontWeights[weightName] = varRef(vn);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (config.borders) {
|
|
53
|
+
for (const [borderName, value] of Object.entries(config.borders)) {
|
|
54
|
+
const vn = varName("border", borderName);
|
|
55
|
+
properties.push(` ${vn}: ${value};`);
|
|
56
|
+
borderVars[borderName] = varRef(vn);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (config.shadows) {
|
|
60
|
+
for (const [shadowName, value] of Object.entries(config.shadows)) {
|
|
61
|
+
const vn = varName("shadow", shadowName);
|
|
62
|
+
properties.push(` ${vn}: ${value};`);
|
|
63
|
+
shadowVars[shadowName] = varRef(vn);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const selector = name === "default" ? ":root" : `[data-theme="${name}"]`;
|
|
67
|
+
const cssText = properties.length > 0 ? `${selector} {
|
|
68
|
+
${properties.join("\n")}
|
|
69
|
+
}` : "";
|
|
70
|
+
return {
|
|
71
|
+
name,
|
|
72
|
+
cssText,
|
|
73
|
+
vars: {
|
|
74
|
+
colors: colorVars,
|
|
75
|
+
spacing: spacingVars,
|
|
76
|
+
typography: typographyVars,
|
|
77
|
+
borders: borderVars,
|
|
78
|
+
shadows: shadowVars
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
createTheme
|
|
85
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/theme/createTheme.ts
|
|
2
|
+
function varName(...parts) {
|
|
3
|
+
return `--twc-${parts.join("-")}`;
|
|
4
|
+
}
|
|
5
|
+
function varRef(name) {
|
|
6
|
+
return `var(${name})`;
|
|
7
|
+
}
|
|
8
|
+
function createTheme(config) {
|
|
9
|
+
const name = _nullishCoalesce(config.name, () => ( "default"));
|
|
10
|
+
const properties = [];
|
|
11
|
+
const colorVars = {};
|
|
12
|
+
const spacingVars = {};
|
|
13
|
+
const typographyVars = { textSizes: {}, fontWeights: {} };
|
|
14
|
+
const borderVars = {};
|
|
15
|
+
const shadowVars = {};
|
|
16
|
+
if (config.colors) {
|
|
17
|
+
for (const [colorName, scale] of Object.entries(config.colors)) {
|
|
18
|
+
colorVars[colorName] = {};
|
|
19
|
+
for (const [shade, hex] of Object.entries(scale)) {
|
|
20
|
+
const vn = varName("color", colorName, shade);
|
|
21
|
+
properties.push(` ${vn}: ${hex};`);
|
|
22
|
+
colorVars[colorName][shade] = varRef(vn);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (config.spacing) {
|
|
27
|
+
for (const [key, value] of Object.entries(config.spacing)) {
|
|
28
|
+
const vn = varName("spacing", key);
|
|
29
|
+
properties.push(` ${vn}: ${value};`);
|
|
30
|
+
spacingVars[key] = varRef(vn);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (_optionalChain([config, 'access', _ => _.typography, 'optionalAccess', _2 => _2.textSizes])) {
|
|
34
|
+
for (const [sizeName, size] of Object.entries(config.typography.textSizes)) {
|
|
35
|
+
const fsvn = varName("text", sizeName, "fs");
|
|
36
|
+
const lhvn = varName("text", sizeName, "lh");
|
|
37
|
+
properties.push(` ${fsvn}: ${size.fontSize};`);
|
|
38
|
+
properties.push(` ${lhvn}: ${size.lineHeight};`);
|
|
39
|
+
typographyVars.textSizes[sizeName] = {
|
|
40
|
+
fontSize: varRef(fsvn),
|
|
41
|
+
lineHeight: varRef(lhvn)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (_optionalChain([config, 'access', _3 => _3.typography, 'optionalAccess', _4 => _4.fontWeights])) {
|
|
46
|
+
for (const [weightName, weight] of Object.entries(config.typography.fontWeights)) {
|
|
47
|
+
const vn = varName("font", weightName);
|
|
48
|
+
properties.push(` ${vn}: ${weight};`);
|
|
49
|
+
typographyVars.fontWeights[weightName] = varRef(vn);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (config.borders) {
|
|
53
|
+
for (const [borderName, value] of Object.entries(config.borders)) {
|
|
54
|
+
const vn = varName("border", borderName);
|
|
55
|
+
properties.push(` ${vn}: ${value};`);
|
|
56
|
+
borderVars[borderName] = varRef(vn);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (config.shadows) {
|
|
60
|
+
for (const [shadowName, value] of Object.entries(config.shadows)) {
|
|
61
|
+
const vn = varName("shadow", shadowName);
|
|
62
|
+
properties.push(` ${vn}: ${value};`);
|
|
63
|
+
shadowVars[shadowName] = varRef(vn);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const selector = name === "default" ? ":root" : `[data-theme="${name}"]`;
|
|
67
|
+
const cssText = properties.length > 0 ? `${selector} {
|
|
68
|
+
${properties.join("\n")}
|
|
69
|
+
}` : "";
|
|
70
|
+
return {
|
|
71
|
+
name,
|
|
72
|
+
cssText,
|
|
73
|
+
vars: {
|
|
74
|
+
colors: colorVars,
|
|
75
|
+
spacing: spacingVars,
|
|
76
|
+
typography: typographyVars,
|
|
77
|
+
borders: borderVars,
|
|
78
|
+
shadows: shadowVars
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
exports.createTheme = createTheme;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/theme/animations.ts
|
|
2
|
+
var spin = "spin 1s linear infinite";
|
|
3
|
+
var ping = "ping 1s cubic-bezier(0, 0, 0.2, 1) infinite";
|
|
4
|
+
var pulse = "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite";
|
|
5
|
+
var bounce = "bounce 1s infinite";
|
|
6
|
+
var keyframes = {
|
|
7
|
+
spin: `@keyframes spin { to { transform: rotate(360deg); } }`,
|
|
8
|
+
ping: `@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }`,
|
|
9
|
+
pulse: `@keyframes pulse { 50% { opacity: .5; } }`,
|
|
10
|
+
bounce: `@keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8,0,1,1); } 50% { transform: none; animation-timing-function: cubic-bezier(0,0,0.2,1); } }`
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.spin = spin; exports.ping = ping; exports.pulse = pulse; exports.bounce = bounce; exports.keyframes = keyframes;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/theme/filters.ts
|
|
2
|
+
var blur = {
|
|
3
|
+
none: "0",
|
|
4
|
+
sm: "4px",
|
|
5
|
+
DEFAULT: "8px",
|
|
6
|
+
md: "12px",
|
|
7
|
+
lg: "16px",
|
|
8
|
+
xl: "24px",
|
|
9
|
+
_2xl: "40px",
|
|
10
|
+
_3xl: "64px"
|
|
11
|
+
};
|
|
12
|
+
var dropShadow = {
|
|
13
|
+
sm: "0 1px 1px rgb(0 0 0 / 0.05)",
|
|
14
|
+
DEFAULT: "0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06)",
|
|
15
|
+
md: "0 4px 3px rgb(0 0 0 / 0.07), 0 2px 2px rgb(0 0 0 / 0.06)",
|
|
16
|
+
lg: "0 10px 8px rgb(0 0 0 / 0.04), 0 4px 3px rgb(0 0 0 / 0.1)",
|
|
17
|
+
xl: "0 20px 13px rgb(0 0 0 / 0.03), 0 8px 5px rgb(0 0 0 / 0.08)",
|
|
18
|
+
_2xl: "0 25px 25px rgb(0 0 0 / 0.15)",
|
|
19
|
+
none: "0 0 #0000"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.blur = blur; exports.dropShadow = dropShadow;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/theme/shadows.ts
|
|
6
|
+
var shadows_exports = {};
|
|
7
|
+
__export(shadows_exports, {
|
|
8
|
+
DEFAULT: () => DEFAULT,
|
|
9
|
+
_2xl: () => _2xl,
|
|
10
|
+
inner: () => inner,
|
|
11
|
+
lg: () => lg,
|
|
12
|
+
md: () => md,
|
|
13
|
+
none: () => none,
|
|
14
|
+
sm: () => sm,
|
|
15
|
+
xl: () => xl
|
|
16
|
+
});
|
|
17
|
+
var sm = "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
18
|
+
var DEFAULT = "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";
|
|
19
|
+
var md = "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
20
|
+
var lg = "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";
|
|
21
|
+
var xl = "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";
|
|
22
|
+
var _2xl = "0 25px 50px -12px rgb(0 0 0 / 0.25)";
|
|
23
|
+
var inner = "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)";
|
|
24
|
+
var none = "0 0 #0000";
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
sm,
|
|
28
|
+
DEFAULT,
|
|
29
|
+
md,
|
|
30
|
+
lg,
|
|
31
|
+
xl,
|
|
32
|
+
_2xl,
|
|
33
|
+
inner,
|
|
34
|
+
none,
|
|
35
|
+
shadows_exports
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/theme/filters.ts
|
|
2
|
+
var blur = {
|
|
3
|
+
none: "0",
|
|
4
|
+
sm: "4px",
|
|
5
|
+
DEFAULT: "8px",
|
|
6
|
+
md: "12px",
|
|
7
|
+
lg: "16px",
|
|
8
|
+
xl: "24px",
|
|
9
|
+
_2xl: "40px",
|
|
10
|
+
_3xl: "64px"
|
|
11
|
+
};
|
|
12
|
+
var dropShadow = {
|
|
13
|
+
sm: "0 1px 1px rgb(0 0 0 / 0.05)",
|
|
14
|
+
DEFAULT: "0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06)",
|
|
15
|
+
md: "0 4px 3px rgb(0 0 0 / 0.07), 0 2px 2px rgb(0 0 0 / 0.06)",
|
|
16
|
+
lg: "0 10px 8px rgb(0 0 0 / 0.04), 0 4px 3px rgb(0 0 0 / 0.1)",
|
|
17
|
+
xl: "0 20px 13px rgb(0 0 0 / 0.03), 0 8px 5px rgb(0 0 0 / 0.08)",
|
|
18
|
+
_2xl: "0 25px 25px rgb(0 0 0 / 0.15)",
|
|
19
|
+
none: "0 0 #0000"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
blur,
|
|
24
|
+
dropShadow
|
|
25
|
+
};
|