typewritingclass 0.2.1 → 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.
Files changed (139) hide show
  1. package/dist/borders-pzt8w5Wv.d.cts +24 -0
  2. package/dist/borders-pzt8w5Wv.d.ts +24 -0
  3. package/dist/chunk-34VD2OBF.cjs +74 -0
  4. package/dist/chunk-6CEDQ6GF.cjs +36 -0
  5. package/dist/chunk-75ZPJI57.cjs +9 -0
  6. package/dist/chunk-ATLK64TQ.js +85 -0
  7. package/dist/chunk-BAZLFQIV.cjs +85 -0
  8. package/dist/chunk-CB7B6PHY.cjs +19 -0
  9. package/dist/chunk-EBHM46CV.cjs +25 -0
  10. package/dist/chunk-IL3LVS32.js +36 -0
  11. package/dist/chunk-JKT74FUK.js +25 -0
  12. package/dist/chunk-L3IF2OVA.cjs +354 -0
  13. package/{src/theme/animations.ts → dist/chunk-L7AJQJBR.js} +16 -8
  14. package/dist/chunk-LARVCDO3.js +113 -0
  15. package/dist/chunk-M34ZK4IV.cjs +53 -0
  16. package/dist/chunk-MLKGABMK.js +9 -0
  17. package/dist/chunk-PBQX6PVK.js +80 -0
  18. package/dist/chunk-PTY5FTFB.cjs +80 -0
  19. package/dist/chunk-T776FXQK.js +53 -0
  20. package/dist/chunk-TAAEIXRF.js +74 -0
  21. package/dist/chunk-TUUH2FJY.cjs +39 -0
  22. package/dist/chunk-U2LSMKZS.js +60 -0
  23. package/dist/chunk-UUUE7HRN.cjs +60 -0
  24. package/dist/chunk-UUVUSZJS.cjs +113 -0
  25. package/dist/chunk-XEHQXLQR.js +354 -0
  26. package/dist/chunk-YHDPOIUZ.js +39 -0
  27. package/dist/colors-MvgcZKUW.d.cts +72 -0
  28. package/dist/colors-MvgcZKUW.d.ts +72 -0
  29. package/dist/index.cjs +2922 -0
  30. package/dist/index.d.cts +3515 -0
  31. package/dist/index.d.ts +3515 -0
  32. package/dist/index.js +2922 -0
  33. package/{src/theme/inject-theme.ts → dist/inject-theme-CTzyfQH0.d.cts} +4 -20
  34. package/dist/inject-theme-CTzyfQH0.d.ts +65 -0
  35. package/dist/inject.cjs +32 -0
  36. package/dist/inject.d.cts +2 -0
  37. package/dist/inject.d.ts +2 -0
  38. package/dist/inject.js +32 -0
  39. package/dist/rule.cjs +19 -0
  40. package/{src/rule.ts → dist/rule.d.cts} +10 -79
  41. package/dist/rule.d.ts +133 -0
  42. package/dist/rule.js +19 -0
  43. package/dist/runtime.cjs +9 -0
  44. package/{src/runtime.ts → dist/runtime.d.cts} +4 -7
  45. package/dist/runtime.d.ts +33 -0
  46. package/dist/runtime.js +9 -0
  47. package/dist/shadows-CWViP1Zk.d.cts +22 -0
  48. package/dist/shadows-CWViP1Zk.d.ts +22 -0
  49. package/dist/sizes-CS9iz8YG.d.cts +46 -0
  50. package/dist/sizes-CS9iz8YG.d.ts +46 -0
  51. package/dist/theme/animations.cjs +15 -0
  52. package/dist/theme/animations.d.cts +12 -0
  53. package/dist/theme/animations.d.ts +12 -0
  54. package/dist/theme/animations.js +15 -0
  55. package/dist/theme/borders.cjs +23 -0
  56. package/dist/theme/borders.d.cts +1 -0
  57. package/dist/theme/borders.d.ts +1 -0
  58. package/dist/theme/borders.js +23 -0
  59. package/dist/theme/colors.cjs +57 -0
  60. package/dist/theme/colors.d.cts +1 -0
  61. package/dist/theme/colors.d.ts +1 -0
  62. package/dist/theme/colors.js +57 -0
  63. package/dist/theme/createTheme.cjs +7 -0
  64. package/dist/theme/createTheme.d.cts +133 -0
  65. package/dist/theme/createTheme.d.ts +133 -0
  66. package/dist/theme/createTheme.js +7 -0
  67. package/dist/theme/filters.cjs +9 -0
  68. package/dist/theme/filters.d.cts +21 -0
  69. package/dist/theme/filters.d.ts +21 -0
  70. package/dist/theme/filters.js +9 -0
  71. package/dist/theme/index.cjs +35 -0
  72. package/dist/theme/index.d.cts +18 -0
  73. package/dist/theme/index.d.ts +18 -0
  74. package/dist/theme/index.js +35 -0
  75. package/dist/theme/shadows.cjs +21 -0
  76. package/dist/theme/shadows.d.cts +1 -0
  77. package/dist/theme/shadows.d.ts +1 -0
  78. package/dist/theme/shadows.js +21 -0
  79. package/dist/theme/sizes.cjs +21 -0
  80. package/dist/theme/sizes.d.cts +1 -0
  81. package/dist/theme/sizes.d.ts +1 -0
  82. package/dist/theme/sizes.js +21 -0
  83. package/dist/theme/typography.cjs +55 -0
  84. package/dist/theme/typography.d.cts +1 -0
  85. package/dist/theme/typography.d.ts +1 -0
  86. package/dist/theme/typography.js +55 -0
  87. package/dist/types-FfRD4Hbd.d.cts +346 -0
  88. package/dist/types-FfRD4Hbd.d.ts +346 -0
  89. package/dist/typography-C8wipcCK.d.cts +87 -0
  90. package/dist/typography-C8wipcCK.d.ts +87 -0
  91. package/package.json +117 -33
  92. package/src/css.ts +0 -140
  93. package/src/cx.ts +0 -105
  94. package/src/dcx.ts +0 -79
  95. package/src/dynamic.ts +0 -117
  96. package/src/hash.ts +0 -55
  97. package/src/index.ts +0 -139
  98. package/src/inject.ts +0 -86
  99. package/src/layer.ts +0 -81
  100. package/src/modifiers/aria.ts +0 -15
  101. package/src/modifiers/colorScheme.ts +0 -32
  102. package/src/modifiers/data.ts +0 -6
  103. package/src/modifiers/direction.ts +0 -5
  104. package/src/modifiers/group.ts +0 -21
  105. package/src/modifiers/index.ts +0 -17
  106. package/src/modifiers/media.ts +0 -11
  107. package/src/modifiers/peer.ts +0 -24
  108. package/src/modifiers/pseudo.ts +0 -183
  109. package/src/modifiers/pseudoElements.ts +0 -26
  110. package/src/modifiers/responsive.ts +0 -110
  111. package/src/modifiers/supports.ts +0 -6
  112. package/src/registry.ts +0 -171
  113. package/src/theme/borders.ts +0 -9
  114. package/src/theme/colors.ts +0 -326
  115. package/src/theme/createTheme.ts +0 -238
  116. package/src/theme/filters.ts +0 -20
  117. package/src/theme/index.ts +0 -9
  118. package/src/theme/shadows.ts +0 -8
  119. package/src/theme/sizes.ts +0 -37
  120. package/src/theme/spacing.ts +0 -44
  121. package/src/theme/typography.ts +0 -72
  122. package/src/tw.ts +0 -960
  123. package/src/types.ts +0 -273
  124. package/src/utilities/accessibility.ts +0 -33
  125. package/src/utilities/backgrounds.ts +0 -87
  126. package/src/utilities/borders.ts +0 -629
  127. package/src/utilities/colors.ts +0 -151
  128. package/src/utilities/effects.ts +0 -181
  129. package/src/utilities/filters.ts +0 -113
  130. package/src/utilities/index.ts +0 -57
  131. package/src/utilities/interactivity.ts +0 -254
  132. package/src/utilities/layout.ts +0 -1194
  133. package/src/utilities/spacing.ts +0 -681
  134. package/src/utilities/svg.ts +0 -35
  135. package/src/utilities/tables.ts +0 -54
  136. package/src/utilities/transforms.ts +0 -88
  137. package/src/utilities/transitions.ts +0 -107
  138. package/src/utilities/typography.ts +0 -387
  139. package/src/when.ts +0 -63
@@ -0,0 +1,46 @@
1
+ declare const full = "100%";
2
+ declare const screen = "100vw";
3
+ declare const screenH = "100vh";
4
+ declare const min = "min-content";
5
+ declare const max = "max-content";
6
+ declare const fit = "fit-content";
7
+ declare const auto = "auto";
8
+ declare const maxWidths: {
9
+ readonly none: "none";
10
+ readonly 0: "0rem";
11
+ readonly xs: "20rem";
12
+ readonly sm: "24rem";
13
+ readonly md: "28rem";
14
+ readonly lg: "32rem";
15
+ readonly xl: "36rem";
16
+ readonly '2xl': "42rem";
17
+ readonly '3xl': "48rem";
18
+ readonly '4xl': "56rem";
19
+ readonly '5xl': "64rem";
20
+ readonly '6xl': "72rem";
21
+ readonly '7xl': "80rem";
22
+ readonly full: "100%";
23
+ readonly min: "min-content";
24
+ readonly max: "max-content";
25
+ readonly fit: "fit-content";
26
+ readonly prose: "65ch";
27
+ readonly screenSm: "640px";
28
+ readonly screenMd: "768px";
29
+ readonly screenLg: "1024px";
30
+ readonly screenXl: "1280px";
31
+ readonly screen2xl: "1536px";
32
+ };
33
+
34
+ declare const sizes_auto: typeof auto;
35
+ declare const sizes_fit: typeof fit;
36
+ declare const sizes_full: typeof full;
37
+ declare const sizes_max: typeof max;
38
+ declare const sizes_maxWidths: typeof maxWidths;
39
+ declare const sizes_min: typeof min;
40
+ declare const sizes_screen: typeof screen;
41
+ declare const sizes_screenH: typeof screenH;
42
+ declare namespace sizes {
43
+ export { sizes_auto as auto, sizes_fit as fit, sizes_full as full, sizes_max as max, sizes_maxWidths as maxWidths, sizes_min as min, sizes_screen as screen, sizes_screenH as screenH };
44
+ }
45
+
46
+ export { auto as a, full as b, maxWidths as c, min as d, screen as e, fit as f, screenH as g, max as m, sizes as s };
@@ -0,0 +1,15 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkCB7B6PHYcjs = require('../chunk-CB7B6PHY.cjs');
8
+ require('../chunk-75ZPJI57.cjs');
9
+
10
+
11
+
12
+
13
+
14
+
15
+ exports.bounce = _chunkCB7B6PHYcjs.bounce; exports.keyframes = _chunkCB7B6PHYcjs.keyframes; exports.ping = _chunkCB7B6PHYcjs.ping; exports.pulse = _chunkCB7B6PHYcjs.pulse; exports.spin = _chunkCB7B6PHYcjs.spin;
@@ -0,0 +1,12 @@
1
+ declare const spin = "spin 1s linear infinite";
2
+ declare const ping = "ping 1s cubic-bezier(0, 0, 0.2, 1) infinite";
3
+ declare const pulse = "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite";
4
+ declare const bounce = "bounce 1s infinite";
5
+ declare const keyframes: {
6
+ spin: string;
7
+ ping: string;
8
+ pulse: string;
9
+ bounce: string;
10
+ };
11
+
12
+ export { bounce, keyframes, ping, pulse, spin };
@@ -0,0 +1,12 @@
1
+ declare const spin = "spin 1s linear infinite";
2
+ declare const ping = "ping 1s cubic-bezier(0, 0, 0.2, 1) infinite";
3
+ declare const pulse = "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite";
4
+ declare const bounce = "bounce 1s infinite";
5
+ declare const keyframes: {
6
+ spin: string;
7
+ ping: string;
8
+ pulse: string;
9
+ bounce: string;
10
+ };
11
+
12
+ export { bounce, keyframes, ping, pulse, spin };
@@ -0,0 +1,15 @@
1
+ import {
2
+ bounce,
3
+ keyframes,
4
+ ping,
5
+ pulse,
6
+ spin
7
+ } from "../chunk-L7AJQJBR.js";
8
+ import "../chunk-MLKGABMK.js";
9
+ export {
10
+ bounce,
11
+ keyframes,
12
+ ping,
13
+ pulse,
14
+ spin
15
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+ var _chunkTUUH2FJYcjs = require('../chunk-TUUH2FJY.cjs');
12
+ require('../chunk-75ZPJI57.cjs');
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+ exports.DEFAULT = _chunkTUUH2FJYcjs.DEFAULT; exports._2xl = _chunkTUUH2FJYcjs._2xl; exports._3xl = _chunkTUUH2FJYcjs._3xl; exports.full = _chunkTUUH2FJYcjs.full; exports.lg = _chunkTUUH2FJYcjs.lg; exports.md = _chunkTUUH2FJYcjs.md; exports.none = _chunkTUUH2FJYcjs.none; exports.sm = _chunkTUUH2FJYcjs.sm; exports.xl = _chunkTUUH2FJYcjs.xl;
@@ -0,0 +1 @@
1
+ export { D as DEFAULT, _ as _2xl, a as _3xl, f as full, l as lg, m as md, n as none, s as sm, x as xl } from '../borders-pzt8w5Wv.cjs';
@@ -0,0 +1 @@
1
+ export { D as DEFAULT, _ as _2xl, a as _3xl, f as full, l as lg, m as md, n as none, s as sm, x as xl } from '../borders-pzt8w5Wv.js';
@@ -0,0 +1,23 @@
1
+ import {
2
+ DEFAULT,
3
+ _2xl,
4
+ _3xl,
5
+ full,
6
+ lg,
7
+ md,
8
+ none,
9
+ sm,
10
+ xl
11
+ } from "../chunk-YHDPOIUZ.js";
12
+ import "../chunk-MLKGABMK.js";
13
+ export {
14
+ DEFAULT,
15
+ _2xl,
16
+ _3xl,
17
+ full,
18
+ lg,
19
+ md,
20
+ none,
21
+ sm,
22
+ xl
23
+ };
@@ -0,0 +1,57 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+ var _chunkL3IF2OVAcjs = require('../chunk-L3IF2OVA.cjs');
29
+ require('../chunk-75ZPJI57.cjs');
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+ exports.amber = _chunkL3IF2OVAcjs.amber; exports.black = _chunkL3IF2OVAcjs.black; exports.blue = _chunkL3IF2OVAcjs.blue; exports.currentColor = _chunkL3IF2OVAcjs.currentColor; exports.cyan = _chunkL3IF2OVAcjs.cyan; exports.emerald = _chunkL3IF2OVAcjs.emerald; exports.fuchsia = _chunkL3IF2OVAcjs.fuchsia; exports.gray = _chunkL3IF2OVAcjs.gray; exports.green = _chunkL3IF2OVAcjs.green; exports.indigo = _chunkL3IF2OVAcjs.indigo; exports.lime = _chunkL3IF2OVAcjs.lime; exports.neutral = _chunkL3IF2OVAcjs.neutral; exports.orange = _chunkL3IF2OVAcjs.orange; exports.pink = _chunkL3IF2OVAcjs.pink; exports.purple = _chunkL3IF2OVAcjs.purple; exports.red = _chunkL3IF2OVAcjs.red; exports.rose = _chunkL3IF2OVAcjs.rose; exports.sky = _chunkL3IF2OVAcjs.sky; exports.slate = _chunkL3IF2OVAcjs.slate; exports.stone = _chunkL3IF2OVAcjs.stone; exports.teal = _chunkL3IF2OVAcjs.teal; exports.transparent = _chunkL3IF2OVAcjs.transparent; exports.violet = _chunkL3IF2OVAcjs.violet; exports.white = _chunkL3IF2OVAcjs.white; exports.yellow = _chunkL3IF2OVAcjs.yellow; exports.zinc = _chunkL3IF2OVAcjs.zinc;
@@ -0,0 +1 @@
1
+ export { C as ColorScale, a as amber, b as black, d as blue, e as currentColor, f as cyan, g as emerald, h as fuchsia, i as gray, j as green, k as indigo, l as lime, n as neutral, o as orange, p as pink, m as purple, r as red, q as rose, s as sky, t as slate, u as stone, v as teal, w as transparent, x as violet, y as white, z as yellow, A as zinc } from '../colors-MvgcZKUW.cjs';
@@ -0,0 +1 @@
1
+ export { C as ColorScale, a as amber, b as black, d as blue, e as currentColor, f as cyan, g as emerald, h as fuchsia, i as gray, j as green, k as indigo, l as lime, n as neutral, o as orange, p as pink, m as purple, r as red, q as rose, s as sky, t as slate, u as stone, v as teal, w as transparent, x as violet, y as white, z as yellow, A as zinc } from '../colors-MvgcZKUW.js';
@@ -0,0 +1,57 @@
1
+ import {
2
+ amber,
3
+ black,
4
+ blue,
5
+ currentColor,
6
+ cyan,
7
+ emerald,
8
+ fuchsia,
9
+ gray,
10
+ green,
11
+ indigo,
12
+ lime,
13
+ neutral,
14
+ orange,
15
+ pink,
16
+ purple,
17
+ red,
18
+ rose,
19
+ sky,
20
+ slate,
21
+ stone,
22
+ teal,
23
+ transparent,
24
+ violet,
25
+ white,
26
+ yellow,
27
+ zinc
28
+ } from "../chunk-XEHQXLQR.js";
29
+ import "../chunk-MLKGABMK.js";
30
+ export {
31
+ amber,
32
+ black,
33
+ blue,
34
+ currentColor,
35
+ cyan,
36
+ emerald,
37
+ fuchsia,
38
+ gray,
39
+ green,
40
+ indigo,
41
+ lime,
42
+ neutral,
43
+ orange,
44
+ pink,
45
+ purple,
46
+ red,
47
+ rose,
48
+ sky,
49
+ slate,
50
+ stone,
51
+ teal,
52
+ transparent,
53
+ violet,
54
+ white,
55
+ yellow,
56
+ zinc
57
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkBAZLFQIVcjs = require('../chunk-BAZLFQIV.cjs');
4
+ require('../chunk-75ZPJI57.cjs');
5
+
6
+
7
+ exports.createTheme = _chunkBAZLFQIVcjs.createTheme;
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Configuration object for defining a theme's design tokens.
3
+ *
4
+ * Pass this to {@link createTheme} to generate CSS custom properties and
5
+ * a type-safe `vars` accessor for use in style utilities.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const config: ThemeConfig = {
10
+ * name: 'light',
11
+ * colors: {
12
+ * blue: { 500: '#3b82f6', 600: '#2563eb' },
13
+ * },
14
+ * spacing: { 4: '1rem', 8: '2rem' },
15
+ * }
16
+ * ```
17
+ */
18
+ interface ThemeConfig {
19
+ /** Optional theme name. Defaults to `'default'` which targets `:root`. Any other name targets `[data-theme="<name>"]`. */
20
+ name?: string;
21
+ /** Color palette scales, keyed by color name, then by shade (e.g., `{ blue: { 500: '#3b82f6' } }`). */
22
+ colors?: Record<string, Record<string | number, string>>;
23
+ /** Spacing scale, keyed by size token (e.g., `{ 4: '1rem', 8: '2rem' }`). */
24
+ spacing?: Record<string | number, string>;
25
+ /** Typography tokens for text sizes and font weights. */
26
+ typography?: {
27
+ /** Named text size presets with `fontSize` and `lineHeight` values. */
28
+ textSizes?: Record<string, {
29
+ fontSize: string;
30
+ lineHeight: string;
31
+ }>;
32
+ /** Named font weight presets (e.g., `{ bold: '700' }`). */
33
+ fontWeights?: Record<string, string>;
34
+ };
35
+ /** Named border style tokens (e.g., `{ default: '1px solid #e5e7eb' }`). */
36
+ borders?: Record<string, string>;
37
+ /** Named box-shadow tokens (e.g., `{ md: '0 4px 6px rgba(0,0,0,0.1)' }`). */
38
+ shadows?: Record<string, string>;
39
+ }
40
+ /**
41
+ * The result returned by {@link createTheme}.
42
+ *
43
+ * Contains the generated CSS text for injection and a `vars` object whose
44
+ * values are `var(--twc-...)` references ready to pass to style utilities.
45
+ */
46
+ interface ThemeResult {
47
+ /** The theme name, matching the `name` from {@link ThemeConfig} (defaults to `'default'`). */
48
+ name: string;
49
+ /**
50
+ * A complete CSS rule string containing all custom property declarations.
51
+ *
52
+ * For the default theme this targets `:root`; for named themes it targets
53
+ * `[data-theme="<name>"]`. Inject with {@link injectTheme}.
54
+ */
55
+ cssText: string;
56
+ /** Type-safe accessor whose leaf values are `var(--twc-...)` CSS references. */
57
+ vars: ThemeVars;
58
+ }
59
+ /**
60
+ * Type-safe map of CSS `var()` references generated from a {@link ThemeConfig}.
61
+ *
62
+ * Every leaf value is a string like `var(--twc-color-blue-500)` that can be
63
+ * passed directly to style utilities such as `bg()`, `color()`, and `p()`.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const { vars } = createTheme({ colors: { blue: { 500: '#3b82f6' } } })
68
+ * vars.colors.blue[500] // "var(--twc-color-blue-500)"
69
+ *
70
+ * // Use in style utilities:
71
+ * cx(bg(vars.colors.blue[500]))
72
+ * ```
73
+ */
74
+ interface ThemeVars {
75
+ /** Color `var()` references, organized by color name and shade. */
76
+ colors: Record<string, Record<string | number, string>>;
77
+ /** Spacing `var()` references, keyed by size token. */
78
+ spacing: Record<string | number, string>;
79
+ /** Typography `var()` references for text sizes and font weights. */
80
+ typography: {
81
+ /** Text size `var()` references with `fontSize` and `lineHeight` keys. */
82
+ textSizes: Record<string, {
83
+ fontSize: string;
84
+ lineHeight: string;
85
+ }>;
86
+ /** Font weight `var()` references keyed by weight name. */
87
+ fontWeights: Record<string, string>;
88
+ };
89
+ /** Border `var()` references keyed by border name. */
90
+ borders: Record<string, string>;
91
+ /** Shadow `var()` references keyed by shadow name. */
92
+ shadows: Record<string, string>;
93
+ }
94
+ /**
95
+ * Creates a theme from a configuration of design tokens.
96
+ *
97
+ * Converts all token values into CSS custom properties and returns:
98
+ * - `cssText`: a string ready to inject into a `<style>` element via {@link injectTheme}
99
+ * - `vars`: a mirrored object whose leaf values are `var(--twc-...)` references,
100
+ * suitable for passing directly into style utilities like `bg()`, `color()`, `p()`, etc.
101
+ *
102
+ * The default theme (no `name` or `name: 'default'`) targets the `:root` selector.
103
+ * Named themes target `[data-theme="<name>"]` and can be activated with {@link setTheme}.
104
+ *
105
+ * @param config - The theme configuration containing design tokens.
106
+ * @returns A {@link ThemeResult} with `name`, `cssText`, and `vars`.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * import { createTheme, injectTheme } from 'typewritingclass/theme'
111
+ * import { cx, bg, p } from 'typewritingclass'
112
+ *
113
+ * const { cssText, vars } = createTheme({
114
+ * name: 'light',
115
+ * colors: {
116
+ * blue: { 500: '#3b82f6', 600: '#2563eb' },
117
+ * gray: { 100: '#f3f4f6', 900: '#111827' },
118
+ * },
119
+ * spacing: { 4: '1rem', 8: '2rem' },
120
+ * shadows: { md: '0 4px 6px rgba(0,0,0,0.1)' },
121
+ * })
122
+ *
123
+ * // Inject the generated CSS custom properties into the document
124
+ * injectTheme(cssText)
125
+ *
126
+ * // Use vars in style utilities — they resolve to var(--twc-...) references
127
+ * cx(bg(vars.colors.blue[500]), p(vars.spacing[4]))
128
+ * // CSS: .abc { background-color: var(--twc-color-blue-500); padding: var(--twc-spacing-4); }
129
+ * ```
130
+ */
131
+ declare function createTheme(config: ThemeConfig): ThemeResult;
132
+
133
+ export { type ThemeConfig, type ThemeResult, type ThemeVars, createTheme };
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Configuration object for defining a theme's design tokens.
3
+ *
4
+ * Pass this to {@link createTheme} to generate CSS custom properties and
5
+ * a type-safe `vars` accessor for use in style utilities.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const config: ThemeConfig = {
10
+ * name: 'light',
11
+ * colors: {
12
+ * blue: { 500: '#3b82f6', 600: '#2563eb' },
13
+ * },
14
+ * spacing: { 4: '1rem', 8: '2rem' },
15
+ * }
16
+ * ```
17
+ */
18
+ interface ThemeConfig {
19
+ /** Optional theme name. Defaults to `'default'` which targets `:root`. Any other name targets `[data-theme="<name>"]`. */
20
+ name?: string;
21
+ /** Color palette scales, keyed by color name, then by shade (e.g., `{ blue: { 500: '#3b82f6' } }`). */
22
+ colors?: Record<string, Record<string | number, string>>;
23
+ /** Spacing scale, keyed by size token (e.g., `{ 4: '1rem', 8: '2rem' }`). */
24
+ spacing?: Record<string | number, string>;
25
+ /** Typography tokens for text sizes and font weights. */
26
+ typography?: {
27
+ /** Named text size presets with `fontSize` and `lineHeight` values. */
28
+ textSizes?: Record<string, {
29
+ fontSize: string;
30
+ lineHeight: string;
31
+ }>;
32
+ /** Named font weight presets (e.g., `{ bold: '700' }`). */
33
+ fontWeights?: Record<string, string>;
34
+ };
35
+ /** Named border style tokens (e.g., `{ default: '1px solid #e5e7eb' }`). */
36
+ borders?: Record<string, string>;
37
+ /** Named box-shadow tokens (e.g., `{ md: '0 4px 6px rgba(0,0,0,0.1)' }`). */
38
+ shadows?: Record<string, string>;
39
+ }
40
+ /**
41
+ * The result returned by {@link createTheme}.
42
+ *
43
+ * Contains the generated CSS text for injection and a `vars` object whose
44
+ * values are `var(--twc-...)` references ready to pass to style utilities.
45
+ */
46
+ interface ThemeResult {
47
+ /** The theme name, matching the `name` from {@link ThemeConfig} (defaults to `'default'`). */
48
+ name: string;
49
+ /**
50
+ * A complete CSS rule string containing all custom property declarations.
51
+ *
52
+ * For the default theme this targets `:root`; for named themes it targets
53
+ * `[data-theme="<name>"]`. Inject with {@link injectTheme}.
54
+ */
55
+ cssText: string;
56
+ /** Type-safe accessor whose leaf values are `var(--twc-...)` CSS references. */
57
+ vars: ThemeVars;
58
+ }
59
+ /**
60
+ * Type-safe map of CSS `var()` references generated from a {@link ThemeConfig}.
61
+ *
62
+ * Every leaf value is a string like `var(--twc-color-blue-500)` that can be
63
+ * passed directly to style utilities such as `bg()`, `color()`, and `p()`.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const { vars } = createTheme({ colors: { blue: { 500: '#3b82f6' } } })
68
+ * vars.colors.blue[500] // "var(--twc-color-blue-500)"
69
+ *
70
+ * // Use in style utilities:
71
+ * cx(bg(vars.colors.blue[500]))
72
+ * ```
73
+ */
74
+ interface ThemeVars {
75
+ /** Color `var()` references, organized by color name and shade. */
76
+ colors: Record<string, Record<string | number, string>>;
77
+ /** Spacing `var()` references, keyed by size token. */
78
+ spacing: Record<string | number, string>;
79
+ /** Typography `var()` references for text sizes and font weights. */
80
+ typography: {
81
+ /** Text size `var()` references with `fontSize` and `lineHeight` keys. */
82
+ textSizes: Record<string, {
83
+ fontSize: string;
84
+ lineHeight: string;
85
+ }>;
86
+ /** Font weight `var()` references keyed by weight name. */
87
+ fontWeights: Record<string, string>;
88
+ };
89
+ /** Border `var()` references keyed by border name. */
90
+ borders: Record<string, string>;
91
+ /** Shadow `var()` references keyed by shadow name. */
92
+ shadows: Record<string, string>;
93
+ }
94
+ /**
95
+ * Creates a theme from a configuration of design tokens.
96
+ *
97
+ * Converts all token values into CSS custom properties and returns:
98
+ * - `cssText`: a string ready to inject into a `<style>` element via {@link injectTheme}
99
+ * - `vars`: a mirrored object whose leaf values are `var(--twc-...)` references,
100
+ * suitable for passing directly into style utilities like `bg()`, `color()`, `p()`, etc.
101
+ *
102
+ * The default theme (no `name` or `name: 'default'`) targets the `:root` selector.
103
+ * Named themes target `[data-theme="<name>"]` and can be activated with {@link setTheme}.
104
+ *
105
+ * @param config - The theme configuration containing design tokens.
106
+ * @returns A {@link ThemeResult} with `name`, `cssText`, and `vars`.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * import { createTheme, injectTheme } from 'typewritingclass/theme'
111
+ * import { cx, bg, p } from 'typewritingclass'
112
+ *
113
+ * const { cssText, vars } = createTheme({
114
+ * name: 'light',
115
+ * colors: {
116
+ * blue: { 500: '#3b82f6', 600: '#2563eb' },
117
+ * gray: { 100: '#f3f4f6', 900: '#111827' },
118
+ * },
119
+ * spacing: { 4: '1rem', 8: '2rem' },
120
+ * shadows: { md: '0 4px 6px rgba(0,0,0,0.1)' },
121
+ * })
122
+ *
123
+ * // Inject the generated CSS custom properties into the document
124
+ * injectTheme(cssText)
125
+ *
126
+ * // Use vars in style utilities — they resolve to var(--twc-...) references
127
+ * cx(bg(vars.colors.blue[500]), p(vars.spacing[4]))
128
+ * // CSS: .abc { background-color: var(--twc-color-blue-500); padding: var(--twc-spacing-4); }
129
+ * ```
130
+ */
131
+ declare function createTheme(config: ThemeConfig): ThemeResult;
132
+
133
+ export { type ThemeConfig, type ThemeResult, type ThemeVars, createTheme };
@@ -0,0 +1,7 @@
1
+ import {
2
+ createTheme
3
+ } from "../chunk-ATLK64TQ.js";
4
+ import "../chunk-MLKGABMK.js";
5
+ export {
6
+ createTheme
7
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkEBHM46CVcjs = require('../chunk-EBHM46CV.cjs');
5
+ require('../chunk-75ZPJI57.cjs');
6
+
7
+
8
+
9
+ exports.blur = _chunkEBHM46CVcjs.blur; exports.dropShadow = _chunkEBHM46CVcjs.dropShadow;
@@ -0,0 +1,21 @@
1
+ declare const blur: {
2
+ none: string;
3
+ sm: string;
4
+ DEFAULT: string;
5
+ md: string;
6
+ lg: string;
7
+ xl: string;
8
+ _2xl: string;
9
+ _3xl: string;
10
+ };
11
+ declare const dropShadow: {
12
+ sm: string;
13
+ DEFAULT: string;
14
+ md: string;
15
+ lg: string;
16
+ xl: string;
17
+ _2xl: string;
18
+ none: string;
19
+ };
20
+
21
+ export { blur, dropShadow };
@@ -0,0 +1,21 @@
1
+ declare const blur: {
2
+ none: string;
3
+ sm: string;
4
+ DEFAULT: string;
5
+ md: string;
6
+ lg: string;
7
+ xl: string;
8
+ _2xl: string;
9
+ _3xl: string;
10
+ };
11
+ declare const dropShadow: {
12
+ sm: string;
13
+ DEFAULT: string;
14
+ md: string;
15
+ lg: string;
16
+ xl: string;
17
+ _2xl: string;
18
+ none: string;
19
+ };
20
+
21
+ export { blur, dropShadow };
@@ -0,0 +1,9 @@
1
+ import {
2
+ blur,
3
+ dropShadow
4
+ } from "../chunk-JKT74FUK.js";
5
+ import "../chunk-MLKGABMK.js";
6
+ export {
7
+ blur,
8
+ dropShadow
9
+ };
@@ -0,0 +1,35 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunk34VD2OBFcjs = require('../chunk-34VD2OBF.cjs');
6
+
7
+
8
+ var _chunkL3IF2OVAcjs = require('../chunk-L3IF2OVA.cjs');
9
+
10
+
11
+ var _chunkUUVUSZJScjs = require('../chunk-UUVUSZJS.cjs');
12
+
13
+
14
+ var _chunkUUUE7HRNcjs = require('../chunk-UUUE7HRN.cjs');
15
+
16
+
17
+ var _chunk6CEDQ6GFcjs = require('../chunk-6CEDQ6GF.cjs');
18
+
19
+
20
+ var _chunkTUUH2FJYcjs = require('../chunk-TUUH2FJY.cjs');
21
+
22
+
23
+ var _chunkBAZLFQIVcjs = require('../chunk-BAZLFQIV.cjs');
24
+ require('../chunk-75ZPJI57.cjs');
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ exports.borders = _chunkTUUH2FJYcjs.borders_exports; exports.colors = _chunkL3IF2OVAcjs.colors_exports; exports.createTheme = _chunkBAZLFQIVcjs.createTheme; exports.injectTheme = _chunk34VD2OBFcjs.injectTheme; exports.setTheme = _chunk34VD2OBFcjs.setTheme; exports.shadows = _chunk6CEDQ6GFcjs.shadows_exports; exports.sizes = _chunkUUUE7HRNcjs.sizes_exports; exports.spacing = _chunk34VD2OBFcjs.spacing_exports; exports.typography = _chunkUUVUSZJScjs.typography_exports;