@times-design-system/components-wordpress 0.4.0 → 0.7.2-alpha.2

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 (189) hide show
  1. package/BLOCK_CREATION_CHECKLIST.md +160 -0
  2. package/BUILD.md +411 -0
  3. package/CHANGELOG.md +22 -0
  4. package/LICENSE +29 -0
  5. package/README.md +972 -5
  6. package/TRANSFORMATION_GUIDE.md +635 -0
  7. package/block.json +10 -0
  8. package/dist/block.json +10 -0
  9. package/dist/blocks/ad-container/block.json +28 -0
  10. package/dist/blocks/ad-container/edit.js +42 -0
  11. package/dist/blocks/ad-container/index.js +10 -0
  12. package/dist/blocks/ad-container/save.js +16 -0
  13. package/dist/blocks/ad-container/style-editor.css +4 -0
  14. package/dist/blocks/ad-container/style.css +27 -0
  15. package/dist/blocks/button/block.json +89 -0
  16. package/dist/blocks/button/edit.js +187 -0
  17. package/dist/blocks/button/index.js +11 -0
  18. package/dist/blocks/button/save.js +52 -0
  19. package/dist/blocks/button/style-editor.css +15 -0
  20. package/dist/blocks/button/style.css +37 -0
  21. package/dist/blocks/chip/block.json +57 -0
  22. package/dist/blocks/chip/edit.js +113 -0
  23. package/dist/blocks/chip/index.js +10 -0
  24. package/dist/blocks/chip/save.js +36 -0
  25. package/dist/blocks/chip/style-editor.css +5 -0
  26. package/dist/blocks/chip/style.css +48 -0
  27. package/dist/blocks/divider/block.json +31 -0
  28. package/dist/blocks/divider/edit.js +42 -0
  29. package/dist/blocks/divider/index.js +10 -0
  30. package/dist/blocks/divider/save.js +18 -0
  31. package/dist/blocks/divider/style-editor.css +4 -0
  32. package/dist/blocks/divider/style.css +25 -0
  33. package/dist/blocks/flag/block.json +48 -0
  34. package/dist/blocks/flag/edit.js +82 -0
  35. package/dist/blocks/flag/index.js +10 -0
  36. package/dist/blocks/flag/save.js +25 -0
  37. package/dist/blocks/flag/style-editor.css +5 -0
  38. package/dist/blocks/flag/style.css +45 -0
  39. package/dist/blocks/icon-button/block.json +43 -0
  40. package/dist/blocks/icon-button/edit.js +82 -0
  41. package/dist/blocks/icon-button/index.js +10 -0
  42. package/dist/blocks/icon-button/save.js +29 -0
  43. package/dist/blocks/icon-button/style-editor.css +5 -0
  44. package/dist/blocks/icon-button/style.css +32 -0
  45. package/dist/blocks/input/block.json +47 -0
  46. package/dist/blocks/input/edit.js +78 -0
  47. package/dist/blocks/input/index.js +10 -0
  48. package/dist/blocks/input/save.js +27 -0
  49. package/dist/blocks/input/style-editor.css +8 -0
  50. package/dist/blocks/input/style.css +30 -0
  51. package/dist/blocks/link/block.json +71 -0
  52. package/dist/blocks/link/edit.js +151 -0
  53. package/dist/blocks/link/index.js +10 -0
  54. package/dist/blocks/link/save.js +46 -0
  55. package/dist/blocks/link/style-editor.css +5 -0
  56. package/dist/blocks/link/style.css +66 -0
  57. package/dist/blocks/text/block.json +32 -0
  58. package/dist/blocks/text/edit.js +56 -0
  59. package/dist/blocks/text/index.js +10 -0
  60. package/dist/blocks/text/save.js +18 -0
  61. package/dist/blocks/text/style-editor.css +4 -0
  62. package/dist/blocks/text/style.css +20 -0
  63. package/dist/blocks/toast/block.json +39 -0
  64. package/dist/blocks/toast/edit.js +85 -0
  65. package/dist/blocks/toast/index.js +10 -0
  66. package/dist/blocks/toast/save.js +29 -0
  67. package/dist/blocks/toast/style-editor.css +4 -0
  68. package/dist/blocks/toast/style.css +51 -0
  69. package/dist/index.cjs +2232 -0
  70. package/dist/index.cjs.map +1 -0
  71. package/dist/index.css +2 -0
  72. package/dist/index.css.map +1 -0
  73. package/dist/index.js +2196 -255
  74. package/dist/index.js.map +1 -1
  75. package/dist/plugin.php +79 -0
  76. package/dist/utils/classBuilder.js +53 -0
  77. package/package.json +39 -7
  78. package/plugin.php +79 -0
  79. package/rollup.config.js +39 -22
  80. package/scripts/build-plugin.cjs +121 -0
  81. package/scripts/create-block.sh +141 -0
  82. package/src/blocks/ad-container/block.json +28 -0
  83. package/src/blocks/ad-container/edit.js +42 -0
  84. package/src/blocks/ad-container/index.js +10 -0
  85. package/src/blocks/ad-container/save.js +16 -0
  86. package/src/blocks/ad-container/style-editor.css +4 -0
  87. package/src/blocks/ad-container/style.css +27 -0
  88. package/src/blocks/button/block.json +89 -0
  89. package/src/blocks/button/edit.js +187 -0
  90. package/src/blocks/button/index.js +11 -0
  91. package/src/blocks/button/save.js +52 -0
  92. package/src/blocks/button/style-editor.css +15 -0
  93. package/src/blocks/button/style.css +37 -0
  94. package/src/blocks/chip/block.json +57 -0
  95. package/src/blocks/chip/edit.js +113 -0
  96. package/src/blocks/chip/index.js +10 -0
  97. package/src/blocks/chip/save.js +36 -0
  98. package/src/blocks/chip/style-editor.css +5 -0
  99. package/src/blocks/chip/style.css +48 -0
  100. package/src/blocks/divider/block.json +31 -0
  101. package/src/blocks/divider/edit.js +42 -0
  102. package/src/blocks/divider/index.js +10 -0
  103. package/src/blocks/divider/save.js +18 -0
  104. package/src/blocks/divider/style-editor.css +4 -0
  105. package/src/blocks/divider/style.css +25 -0
  106. package/src/blocks/flag/block.json +48 -0
  107. package/src/blocks/flag/edit.js +82 -0
  108. package/src/blocks/flag/index.js +10 -0
  109. package/src/blocks/flag/save.js +25 -0
  110. package/src/blocks/flag/style-editor.css +5 -0
  111. package/src/blocks/flag/style.css +45 -0
  112. package/src/blocks/icon-button/block.json +43 -0
  113. package/src/blocks/icon-button/edit.js +82 -0
  114. package/src/blocks/icon-button/index.js +10 -0
  115. package/src/blocks/icon-button/save.js +29 -0
  116. package/src/blocks/icon-button/style-editor.css +5 -0
  117. package/src/blocks/icon-button/style.css +32 -0
  118. package/src/blocks/input/block.json +47 -0
  119. package/src/blocks/input/edit.js +78 -0
  120. package/src/blocks/input/index.js +10 -0
  121. package/src/blocks/input/save.js +27 -0
  122. package/src/blocks/input/style-editor.css +8 -0
  123. package/src/blocks/input/style.css +30 -0
  124. package/src/blocks/link/block.json +71 -0
  125. package/src/blocks/link/edit.js +151 -0
  126. package/src/blocks/link/index.js +10 -0
  127. package/src/blocks/link/save.js +46 -0
  128. package/src/blocks/link/style-editor.css +5 -0
  129. package/src/blocks/link/style.css +66 -0
  130. package/src/blocks/text/block.json +32 -0
  131. package/src/blocks/text/edit.js +56 -0
  132. package/src/blocks/text/index.js +10 -0
  133. package/src/blocks/text/save.js +18 -0
  134. package/src/blocks/text/style-editor.css +4 -0
  135. package/src/blocks/text/style.css +20 -0
  136. package/src/blocks/toast/block.json +39 -0
  137. package/src/blocks/toast/edit.js +85 -0
  138. package/src/blocks/toast/index.js +10 -0
  139. package/src/blocks/toast/save.js +29 -0
  140. package/src/blocks/toast/style-editor.css +4 -0
  141. package/src/blocks/toast/style.css +51 -0
  142. package/src/index.js +15 -12
  143. package/src/utils/classBuilder.js +53 -0
  144. package/tsconfig.json +4 -4
  145. package/__tests__/wordpress.test.js +0 -0
  146. package/dist/AdContainer/AdContainer.d.ts +0 -9
  147. package/dist/Article/ArticleMetaContainer/ArticleMetaContainer.d.ts +0 -8
  148. package/dist/Article/UpNextArticles/UpNextArticles.d.ts +0 -13
  149. package/dist/Button/Button.d.ts +0 -15
  150. package/dist/CommentsDisabled/CommentsDisabled.d.ts +0 -10
  151. package/dist/CommentsDisabled/CommentsDisabled.stories.d.ts +0 -44
  152. package/dist/CommentsDisabled/index.d.ts +0 -2
  153. package/dist/Divider/Divider.d.ts +0 -15
  154. package/dist/Input/Input.d.ts +0 -25
  155. package/dist/Link/Link.d.ts +0 -18
  156. package/dist/Text/Text.d.ts +0 -14
  157. package/dist/index.cjs.js +0 -299
  158. package/dist/index.cjs.js.map +0 -1
  159. package/dist/styles.css +0 -151
  160. package/dist/typographyStyles.css +0 -30
  161. package/dist/utils/cn.d.ts +0 -1
  162. package/dist/utils/hooks.d.ts +0 -8
  163. package/src/AdContainer/AdContainer.tsx +0 -31
  164. package/src/AdContainer/styles.css +0 -58
  165. package/src/Article/ArticleMetaContainer/ArticleMetaContainer.tsx +0 -14
  166. package/src/Article/ArticleMetaContainer/styles.css +0 -151
  167. package/src/Article/UpNextArticles/UpNextArticles.tsx +0 -69
  168. package/src/Article/UpNextArticles/styles.css +0 -151
  169. package/src/Button/Button.tsx +0 -36
  170. package/src/Button/styles.css +0 -30
  171. package/src/CommentsDisabled/CommentsDisabled.stories.tsx +0 -178
  172. package/src/CommentsDisabled/CommentsDisabled.tsx +0 -63
  173. package/src/CommentsDisabled/IMPLEMENTATION_SUMMARY.md +0 -305
  174. package/src/CommentsDisabled/README.md +0 -284
  175. package/src/CommentsDisabled/TOKEN_MAPPING.md +0 -269
  176. package/src/CommentsDisabled/index.ts +0 -2
  177. package/src/CommentsDisabled/styles.css +0 -82
  178. package/src/Divider/Divider.tsx +0 -41
  179. package/src/Divider/styles.css +0 -80
  180. package/src/Input/Input.tsx +0 -62
  181. package/src/Input/styles.css +0 -69
  182. package/src/Link/Link.tsx +0 -49
  183. package/src/Link/styles.css +0 -111
  184. package/src/Text/Text.tsx +0 -38
  185. package/src/Text/styles.css +0 -30
  186. package/src/Text/typographyStyles.css +0 -30
  187. package/src/utils/cn.js +0 -3
  188. package/src/utils/cn.tsx +0 -3
  189. package/src/utils/hooks.ts +0 -34
@@ -1,111 +0,0 @@
1
- .tds-link {
2
- display: inline;
3
- text-decoration: underline;
4
- text-decoration-color: currentColor;
5
- text-underline-offset: 0.2em;
6
- cursor: pointer;
7
- transition: color 0.2s ease, text-decoration-color 0.2s ease;
8
- font-family: var(--tds-font-family040, 'Roboto', sans-serif);
9
- font-size: var(--tds-font-size030, 1rem);
10
- font-weight: var(--tds-font-weight040, 400);
11
- line-height: var(--tds-font-line-height040, 1.5);
12
- }
13
-
14
- /* Primary variant (default) - Link color */
15
- .tds-link--primary {
16
- color: var(--interactive-link-primary-default, #005c8a);
17
- }
18
-
19
- .tds-link--primary:visited {
20
- color: var(--interactive-link-primary-visited, #005c8a);
21
- }
22
-
23
- .tds-link--primary:hover {
24
- color: var(--interactive-link-primary-hover, #004568);
25
- text-decoration-thickness: 0.15em;
26
- }
27
-
28
- .tds-link--primary:focus {
29
- outline: 2px solid var(--interactive-link-primary-default, #005c8a);
30
- outline-offset: 0.25em;
31
- border-radius: 2px;
32
- }
33
-
34
- .tds-link--primary:active {
35
- color: var(--interactive-link-primary-active, #003d52);
36
- }
37
-
38
- /* Secondary variant */
39
- .tds-link--secondary {
40
- color: var(--text-secondary, #666666);
41
- }
42
-
43
- .tds-link--secondary:visited {
44
- color: var(--text-secondary, #666666);
45
- }
46
-
47
- .tds-link--secondary:hover {
48
- color: var(--text-primary, #1a1a1a);
49
- text-decoration-thickness: 0.15em;
50
- }
51
-
52
- .tds-link--secondary:focus {
53
- outline: 2px solid var(--text-secondary, #666666);
54
- outline-offset: 0.25em;
55
- border-radius: 2px;
56
- }
57
-
58
- .tds-link--secondary:active {
59
- color: var(--text-primary, #1a1a1a);
60
- }
61
-
62
- /* Danger variant */
63
- .tds-link--danger {
64
- color: var(--text-error, #d32f2f);
65
- }
66
-
67
- .tds-link--danger:visited {
68
- color: var(--text-error, #d32f2f);
69
- }
70
-
71
- .tds-link--danger:hover {
72
- color: var(--text-error-hover, #b71c1c);
73
- text-decoration-thickness: 0.15em;
74
- }
75
-
76
- .tds-link--danger:focus {
77
- outline: 2px solid var(--text-error, #d32f2f);
78
- outline-offset: 0.25em;
79
- border-radius: 2px;
80
- }
81
-
82
- .tds-link--danger:active {
83
- color: var(--text-error-active, #9a0000);
84
- }
85
-
86
- /* Disabled state */
87
- .tds-link:disabled,
88
- .tds-link[aria-disabled='true'] {
89
- opacity: 0.6;
90
- cursor: not-allowed;
91
- text-decoration: none;
92
- }
93
-
94
- /* Dark mode support (optional) */
95
- @media (prefers-color-scheme: dark) {
96
- .tds-link--primary {
97
- color: var(--interactive-link-primary-default-dark, #66b3e0);
98
- }
99
-
100
- .tds-link--primary:hover {
101
- color: var(--interactive-link-primary-hover-dark, #8fd4ff);
102
- }
103
-
104
- .tds-link--secondary {
105
- color: var(--text-secondary-dark, #999999);
106
- }
107
-
108
- .tds-link--secondary:hover {
109
- color: var(--text-primary-dark, #e0e0e0);
110
- }
111
- }
package/src/Text/Text.tsx DELETED
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import './styles.css';
3
- import './typographyStyles.css';
4
- import { cn } from '../utils/cn';
5
-
6
- interface TextProps {
7
- as?: 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
8
- typographyStyle?: string;
9
- classes?: string;
10
- styles?: { [key: string]: string };
11
- children?: React.ReactNode;
12
- }
13
-
14
- export const Text: React.FC<TextProps> = ({
15
- as,
16
- typographyStyle,
17
- styles,
18
- classes,
19
- children
20
- }) => {
21
- const TextComponent = as || 'p';
22
- const transformedTypographyStyle =
23
- typographyStyle?.replaceAll('.', '-').toLowerCase() ?? '';
24
-
25
- return (
26
- <TextComponent
27
- className={cn(
28
- classes,
29
- typographyStyle
30
- ? `--tds-typography-tokens-${transformedTypographyStyle}`
31
- : undefined
32
- )}
33
- style={styles ? styles : undefined}
34
- >
35
- {children}
36
- </TextComponent>
37
- );
38
- };
@@ -1,30 +0,0 @@
1
- .storybook-button {
2
- display: inline-block;
3
- cursor: pointer;
4
- border: 0;
5
- border-radius: 3em;
6
- font-weight: 700;
7
- line-height: 1;
8
- font-family: 'Roboto', 'Roboto-Regular', Helvetica, Arial, sans-serif;
9
- }
10
- .storybook-button--primary {
11
- background-color: #555ab9;
12
- color: white;
13
- }
14
- .storybook-button--secondary {
15
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
16
- background-color: transparent;
17
- color: #333;
18
- }
19
- .storybook-button--small {
20
- padding: 10px 16px;
21
- font-size: 12px;
22
- }
23
- .storybook-button--medium {
24
- padding: 11px 20px;
25
- font-size: 14px;
26
- }
27
- .storybook-button--large {
28
- padding: 12px 24px;
29
- font-size: 16px;
30
- }
@@ -1,30 +0,0 @@
1
- .storybook-button {
2
- display: inline-block;
3
- cursor: pointer;
4
- border: 0;
5
- border-radius: 3em;
6
- font-weight: 700;
7
- line-height: 1;
8
- font-family: 'Roboto', 'Roboto-Regular', Helvetica, Arial, sans-serif;
9
- }
10
- .storybook-button--primary {
11
- background-color: #555ab9;
12
- color: white;
13
- }
14
- .storybook-button--secondary {
15
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
16
- background-color: transparent;
17
- color: #333;
18
- }
19
- .storybook-button--small {
20
- padding: 10px 16px;
21
- font-size: 12px;
22
- }
23
- .storybook-button--medium {
24
- padding: 11px 20px;
25
- font-size: 14px;
26
- }
27
- .storybook-button--large {
28
- padding: 12px 24px;
29
- font-size: 16px;
30
- }
package/src/utils/cn.js DELETED
@@ -1,3 +0,0 @@
1
- export const cn = (...classNames) => {
2
- return classNames.filter(Boolean).join(' ');
3
- };
package/src/utils/cn.tsx DELETED
@@ -1,3 +0,0 @@
1
- export const cn = (...classNames: (string | undefined)[]) => {
2
- return classNames.filter(Boolean).join(' ');
3
- };
@@ -1,34 +0,0 @@
1
- // function possibly for future use with typography tokens.
2
- // takes a token and tokens object, returns media query string referencing typography token values.
3
- type UseTypographyToken = (
4
- typographyToken: string,
5
- tokens: {
6
- breakpoints: { [key: string]: number };
7
- [key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
8
- }
9
- ) => string;
10
-
11
- export const useTypographyToken: UseTypographyToken = (
12
- typographyToken,
13
- tokens
14
- ) => `
15
- .${typographyToken} {
16
- font: ${typographyToken}
17
-
18
- @media (min-width: ${tokens.breakpoints.sm}px) {
19
- fontSize: ${tokens['Viewport/ Small'].typography[typographyToken].fontSize};
20
- }
21
-
22
- @media (min-width: ${tokens.breakpoints.md}px) {
23
- fontSize: ${tokens['Viewport/ Medium'].typography[typographyToken].fontSize};
24
- }
25
-
26
- @media (min-width: ${tokens.breakpoints.lg}px) {
27
- fontSize: ${tokens['Viewport/ Large'].typography[typographyToken].fontSize};
28
- }
29
-
30
- @media (min-width: ${tokens.breakpoints.xl}px) {
31
- fontSize: ${tokens['Viewport/ XLarge'].typography[typographyToken].fontSize};
32
- }
33
- }
34
- `;