@marvalt/dstyler 0.1.18 → 0.1.21

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 (52) hide show
  1. package/dist/components/AutoBlock.d.ts +8 -0
  2. package/dist/components/AutoBlock.d.ts.map +1 -1
  3. package/dist/components/AutoSection.d.ts +4 -1
  4. package/dist/components/AutoSection.d.ts.map +1 -1
  5. package/dist/components/StyledPage.d.ts +6 -0
  6. package/dist/components/StyledPage.d.ts.map +1 -1
  7. package/dist/components/index.d.ts +1 -1
  8. package/dist/components/index.d.ts.map +1 -1
  9. package/dist/engine/detectSections.d.ts.map +1 -1
  10. package/dist/engine/index.d.ts.map +1 -1
  11. package/dist/engine/renderBlock.d.ts +0 -3
  12. package/dist/engine/renderBlock.d.ts.map +1 -1
  13. package/dist/engine/selectTemplate.d.ts.map +1 -1
  14. package/dist/index.d.ts +159 -90
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.esm.js +478 -500
  17. package/dist/index.esm.js.map +1 -1
  18. package/dist/index.js +481 -499
  19. package/dist/index.js.map +1 -1
  20. package/dist/providers/ThemeProvider.d.ts.map +1 -1
  21. package/dist/providers/index.d.ts.map +1 -1
  22. package/dist/templates/FooterMinimal.d.ts.map +1 -1
  23. package/dist/templates/HeroDefault.d.ts.map +1 -1
  24. package/dist/templates/SectionBase.d.ts.map +1 -1
  25. package/dist/templates/SectionWave.d.ts.map +1 -1
  26. package/dist/templates/blocks/BlockButton.d.ts +6 -2
  27. package/dist/templates/blocks/BlockButton.d.ts.map +1 -1
  28. package/dist/templates/blocks/BlockForm.d.ts +6 -2
  29. package/dist/templates/blocks/BlockForm.d.ts.map +1 -1
  30. package/dist/templates/blocks/BlockImage.d.ts +6 -2
  31. package/dist/templates/blocks/BlockImage.d.ts.map +1 -1
  32. package/dist/templates/blocks/BlockText.d.ts +6 -2
  33. package/dist/templates/blocks/BlockText.d.ts.map +1 -1
  34. package/dist/templates/blocks/index.d.ts.map +1 -1
  35. package/dist/templates/index.d.ts +1 -0
  36. package/dist/templates/index.d.ts.map +1 -1
  37. package/dist/tokens/css-vars.d.ts.map +1 -1
  38. package/dist/tokens/index.d.ts.map +1 -1
  39. package/dist/tokens/tokens.d.ts.map +1 -1
  40. package/dist/tokens/wordpress-to-tokens.d.ts.map +1 -1
  41. package/dist/types/block.d.ts +2 -0
  42. package/dist/types/block.d.ts.map +1 -1
  43. package/dist/types/index.d.ts +1 -1
  44. package/dist/types/index.d.ts.map +1 -1
  45. package/dist/types/section.d.ts.map +1 -1
  46. package/dist/types/theme.d.ts.map +1 -1
  47. package/dist/utils/createColorMapper.d.ts.map +1 -1
  48. package/dist/utils/index.d.ts +1 -1
  49. package/dist/utils/index.d.ts.map +1 -1
  50. package/dist/utils/responsive.d.ts.map +1 -1
  51. package/package.json +52 -69
  52. package/README.md +0 -76
package/README.md DELETED
@@ -1,76 +0,0 @@
1
- # @marvalt/dstyler
2
-
3
- Design system package for styling WordPress content with zero-config templates.
4
-
5
- ## Description
6
-
7
- `@marvalt/dstyler` is a lightweight renderer that:
8
- - Applies global design tokens (colors, spacing, typography)
9
- - Maps parsed WordPress sections → React templates
10
- - Ensures consistent responsive styling across the site
11
- - Renders blocks (text, images, buttons, forms) inside sections
12
- - Provides utilities to bridge design tokens with WordPress color mapping
13
-
14
- ## Installation
15
-
16
- ```bash
17
- npm install @marvalt/dstyler
18
- ```
19
-
20
- ## Usage
21
-
22
- ### Basic Usage
23
-
24
- ```tsx
25
- import { ThemeProvider, StyledPage } from '@marvalt/dstyler';
26
- import { getThemeStyles } from '@marvalt/wadapter';
27
-
28
- <ThemeProvider wpStyles={getThemeStyles()}>
29
- <StyledPage page={page} registry={registry} />
30
- </ThemeProvider>
31
- ```
32
-
33
- ### Creating Color Mapper from Design Tokens
34
-
35
- Bridge dstyler design tokens with wparser's color mapping system:
36
-
37
- ```tsx
38
- import { createColorMapperFromTokens } from '@marvalt/dstyler';
39
- import { createEnhancedRegistry } from '@marvalt/wparser';
40
- import { loadTheme } from '@/config/themes';
41
-
42
- // Get your design tokens
43
- const tokens = await loadTheme();
44
-
45
- // Generate colorMapper from tokens
46
- const colorMapper = createColorMapperFromTokens(tokens, {
47
- // Optional overrides for specific WordPress color names
48
- 'accent-6': 'bg-[#4a90a4] text-white',
49
- });
50
-
51
- // Use with wparser registry
52
- const registry = createEnhancedRegistry(mappings, undefined, colorMapper);
53
- ```
54
-
55
- ### Using Semantic Tailwind Classes
56
-
57
- If your Tailwind config has semantic colors defined (primary, secondary, etc.):
58
-
59
- ```tsx
60
- import { createColorMapperWithSemanticClasses } from '@marvalt/dstyler';
61
-
62
- const colorMapper = createColorMapperWithSemanticClasses(tokens, {
63
- 'accent-1': 'bg-primary text-primary-foreground',
64
- 'accent-2': 'bg-secondary text-secondary-foreground',
65
- });
66
- ```
67
-
68
- ## License
69
-
70
- GPL-3.0-or-later
71
-
72
-
73
-
74
-
75
-
76
-