@times-design-system/components-wordpress 1.5.3 → 1.7.0

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 (175) hide show
  1. package/dist/blocks/ad-container/block.json +10 -0
  2. package/dist/blocks/ad-container/edit.js +17 -1
  3. package/dist/blocks/ad-container/render.php +14 -0
  4. package/dist/blocks/button/block.json +19 -5
  5. package/dist/blocks/button/edit.js +33 -15
  6. package/dist/blocks/button/render.php +38 -2
  7. package/dist/blocks/button/style.css +63 -0
  8. package/dist/blocks/chip/block.json +12 -7
  9. package/dist/blocks/chip/edit.js +20 -17
  10. package/dist/blocks/chip/render.php +25 -3
  11. package/dist/blocks/dialog-box/block.json +10 -0
  12. package/dist/blocks/dialog-box/edit.js +17 -0
  13. package/dist/blocks/dialog-box/render.php +18 -7
  14. package/dist/blocks/divider/block.json +10 -0
  15. package/dist/blocks/divider/edit.js +18 -2
  16. package/dist/blocks/divider/render.php +14 -1
  17. package/dist/blocks/flag/block.json +10 -0
  18. package/dist/blocks/flag/edit.js +27 -2
  19. package/dist/blocks/flag/render.php +25 -1
  20. package/dist/blocks/icon/block.json +10 -0
  21. package/dist/blocks/icon/edit.js +17 -0
  22. package/dist/blocks/icon/render.php +19 -8
  23. package/dist/blocks/icon-button/block.json +15 -0
  24. package/dist/blocks/icon-button/edit.js +33 -1
  25. package/dist/blocks/icon-button/render.php +19 -0
  26. package/dist/blocks/icon-button/style.css +37 -3
  27. package/dist/blocks/input/block.json +10 -0
  28. package/dist/blocks/input/edit.js +27 -1
  29. package/dist/blocks/input/render.php +17 -1
  30. package/dist/blocks/input-helper-message/block.json +10 -0
  31. package/dist/blocks/input-helper-message/edit.js +17 -0
  32. package/dist/blocks/input-helper-message/render.php +18 -7
  33. package/dist/blocks/link/block.json +12 -7
  34. package/dist/blocks/link/edit.js +21 -18
  35. package/dist/blocks/link/render.php +25 -3
  36. package/dist/blocks/tab/block.json +10 -0
  37. package/dist/blocks/tab/edit.js +17 -0
  38. package/dist/blocks/tab/render.php +18 -7
  39. package/dist/blocks/tab-group/block.json +10 -0
  40. package/dist/blocks/tab-group/edit.js +17 -0
  41. package/dist/blocks/tab-group/render.php +18 -7
  42. package/dist/blocks/text/block.json +10 -0
  43. package/dist/blocks/text/edit.js +18 -2
  44. package/dist/blocks/text/render.php +14 -1
  45. package/dist/blocks/toast/block.json +10 -0
  46. package/dist/blocks/toast/edit.js +18 -1
  47. package/dist/blocks/toast/render.php +14 -0
  48. package/dist/index.cjs +389 -148
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.js +389 -148
  51. package/dist/index.js.map +1 -1
  52. package/dist/utils/DATA_ATTRIBUTES_USAGE.md +377 -0
  53. package/dist/utils/sanitize-data-attributes.php +109 -0
  54. package/package.json +9 -3
  55. package/BLOCK_CREATION_CHECKLIST.md +0 -385
  56. package/BUILD.md +0 -411
  57. package/CHANGELOG.md +0 -85
  58. package/SCSS_VARIABLES_REFERENCE.md +0 -316
  59. package/STYLING_SYNC_GUIDE.md +0 -306
  60. package/TESTING.md +0 -152
  61. package/TRANSFORMATION_GUIDE.md +0 -908
  62. package/dist/blocks/button/style-resolved.css +0 -153
  63. package/lib/wordpress.js +0 -7
  64. package/rollup.config.js +0 -75
  65. package/scripts/build-plugin.cjs +0 -121
  66. package/scripts/create-block.sh +0 -141
  67. package/scripts/create-wordpress-block-tests.cjs +0 -438
  68. package/scripts/create-wordpress-block.cjs +0 -681
  69. package/src/blocks/ad-container/block.json +0 -29
  70. package/src/blocks/ad-container/edit.js +0 -42
  71. package/src/blocks/ad-container/index.js +0 -10
  72. package/src/blocks/ad-container/render.php +0 -27
  73. package/src/blocks/ad-container/save.js +0 -16
  74. package/src/blocks/ad-container/style-editor.css +0 -4
  75. package/src/blocks/ad-container/style.css +0 -30
  76. package/src/blocks/button/block.json +0 -90
  77. package/src/blocks/button/edit.js +0 -187
  78. package/src/blocks/button/index.js +0 -11
  79. package/src/blocks/button/render.php +0 -71
  80. package/src/blocks/button/save.js +0 -52
  81. package/src/blocks/button/style-editor.css +0 -15
  82. package/src/blocks/button/style-resolved.css +0 -153
  83. package/src/blocks/button/style.css +0 -157
  84. package/src/blocks/chip/block.json +0 -58
  85. package/src/blocks/chip/edit.js +0 -113
  86. package/src/blocks/chip/index.js +0 -10
  87. package/src/blocks/chip/render.php +0 -40
  88. package/src/blocks/chip/save.js +0 -36
  89. package/src/blocks/chip/style-editor.css +0 -5
  90. package/src/blocks/chip/style.css +0 -87
  91. package/src/blocks/dialog-box/block.json +0 -24
  92. package/src/blocks/dialog-box/edit.js +0 -41
  93. package/src/blocks/dialog-box/index.js +0 -17
  94. package/src/blocks/dialog-box/render.php +0 -24
  95. package/src/blocks/dialog-box/save.js +0 -23
  96. package/src/blocks/dialog-box/style.css +0 -23
  97. package/src/blocks/divider/block.json +0 -32
  98. package/src/blocks/divider/edit.js +0 -42
  99. package/src/blocks/divider/index.js +0 -10
  100. package/src/blocks/divider/render.php +0 -31
  101. package/src/blocks/divider/save.js +0 -18
  102. package/src/blocks/divider/style-editor.css +0 -4
  103. package/src/blocks/divider/style.css +0 -37
  104. package/src/blocks/flag/block.json +0 -49
  105. package/src/blocks/flag/edit.js +0 -82
  106. package/src/blocks/flag/index.js +0 -10
  107. package/src/blocks/flag/render.php +0 -34
  108. package/src/blocks/flag/save.js +0 -25
  109. package/src/blocks/flag/style-editor.css +0 -5
  110. package/src/blocks/flag/style.css +0 -54
  111. package/src/blocks/icon/block.json +0 -24
  112. package/src/blocks/icon/edit.js +0 -41
  113. package/src/blocks/icon/index.js +0 -17
  114. package/src/blocks/icon/render.php +0 -24
  115. package/src/blocks/icon/save.js +0 -23
  116. package/src/blocks/icon/style.css +0 -23
  117. package/src/blocks/icon-button/block.json +0 -44
  118. package/src/blocks/icon-button/edit.js +0 -82
  119. package/src/blocks/icon-button/index.js +0 -10
  120. package/src/blocks/icon-button/render.php +0 -46
  121. package/src/blocks/icon-button/save.js +0 -29
  122. package/src/blocks/icon-button/style-editor.css +0 -5
  123. package/src/blocks/icon-button/style.css +0 -31
  124. package/src/blocks/input/block.json +0 -48
  125. package/src/blocks/input/edit.js +0 -78
  126. package/src/blocks/input/index.js +0 -10
  127. package/src/blocks/input/render.php +0 -39
  128. package/src/blocks/input/save.js +0 -27
  129. package/src/blocks/input/style-editor.css +0 -8
  130. package/src/blocks/input/style.css +0 -53
  131. package/src/blocks/input-helper-message/block.json +0 -24
  132. package/src/blocks/input-helper-message/edit.js +0 -42
  133. package/src/blocks/input-helper-message/index.js +0 -17
  134. package/src/blocks/input-helper-message/render.php +0 -24
  135. package/src/blocks/input-helper-message/save.js +0 -23
  136. package/src/blocks/input-helper-message/style.css +0 -23
  137. package/src/blocks/link/block.json +0 -72
  138. package/src/blocks/link/edit.js +0 -151
  139. package/src/blocks/link/index.js +0 -10
  140. package/src/blocks/link/render.php +0 -44
  141. package/src/blocks/link/save.js +0 -46
  142. package/src/blocks/link/style-editor.css +0 -5
  143. package/src/blocks/link/style.css +0 -119
  144. package/src/blocks/tab/block.json +0 -24
  145. package/src/blocks/tab/edit.js +0 -41
  146. package/src/blocks/tab/index.js +0 -17
  147. package/src/blocks/tab/render.php +0 -24
  148. package/src/blocks/tab/save.js +0 -23
  149. package/src/blocks/tab/style.css +0 -23
  150. package/src/blocks/tab-group/block.json +0 -24
  151. package/src/blocks/tab-group/edit.js +0 -41
  152. package/src/blocks/tab-group/index.js +0 -17
  153. package/src/blocks/tab-group/render.php +0 -24
  154. package/src/blocks/tab-group/save.js +0 -23
  155. package/src/blocks/tab-group/style.css +0 -23
  156. package/src/blocks/text/block.json +0 -33
  157. package/src/blocks/text/edit.js +0 -56
  158. package/src/blocks/text/index.js +0 -10
  159. package/src/blocks/text/render.php +0 -26
  160. package/src/blocks/text/save.js +0 -18
  161. package/src/blocks/text/style-editor.css +0 -4
  162. package/src/blocks/text/style.css +0 -7
  163. package/src/blocks/toast/block.json +0 -40
  164. package/src/blocks/toast/edit.js +0 -85
  165. package/src/blocks/toast/index.js +0 -10
  166. package/src/blocks/toast/render.php +0 -37
  167. package/src/blocks/toast/save.js +0 -29
  168. package/src/blocks/toast/style-editor.css +0 -4
  169. package/src/blocks/toast/style.css +0 -67
  170. package/src/index.js +0 -16
  171. package/src/utils/classBuilder.js +0 -53
  172. package/tsconfig.json +0 -116
  173. package/vitest.config.js +0 -28
  174. package/vitest.config.ts +0 -28
  175. package/vitest.setup.ts +0 -129
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * Block Rendering: InputHelperMessage
4
- *
5
- * Server-side rendering for the InputHelperMessage block.
6
- * Reference: packages/components-react/src/InputHelperMessage/
7
- *
8
- * @param array $attributes Block attributes
9
- * @param string $content Saved block content
10
- * @param WP_Block $block The block instance
11
- * @return string Rendered HTML
12
- */
13
-
14
- $wrapper_attributes = get_block_wrapper_attributes();
15
-
16
- // TODO: Render the InputHelperMessage component
17
- // Extract attributes and render appropriate HTML with BEM classes
18
-
19
- ?>
20
- <div <?php echo wp_kses_post( $wrapper_attributes ); ?>>
21
- <!-- TODO: Render InputHelperMessage component here -->
22
- <!-- Use CSS custom properties from packages/tokens/data/resolved-hexes.json -->
23
- <!-- Apply BEM naming: tds-input-helper-message--{modifier} -->
24
- </div>
@@ -1,23 +0,0 @@
1
- /**
2
- * Block Save Component: InputHelperMessage
3
- *
4
- * Renders the static output saved to the database.
5
- * Reference: packages/components-react/src/InputHelperMessage/
6
- */
7
-
8
- import { useBlockProps } from '@wordpress/block-editor';
9
-
10
- export function save(props) {
11
- const { attributes } = props;
12
- const blockProps = useBlockProps.save();
13
-
14
- // TODO: Render the actual InputHelperMessage component with attributes
15
- // This output is saved to the database and displayed on the frontend
16
-
17
- return (
18
- <div {...blockProps}>
19
- {/* TODO: Render InputHelperMessage component */}
20
- {attributes.content && <p>{attributes.content}</p>}
21
- </div>
22
- );
23
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Styles for InputHelperMessage Block
3
- *
4
- * Reference: packages/components-react/src/InputHelperMessage/
5
- * Token Reference: packages/tokens/data/resolved-hexes.json
6
- *
7
- * TODO: Adapt styles from React component
8
- * - Copy relevant CSS from React component
9
- * - Map CSS custom properties to resolved hex values
10
- * - Use BEM naming: .tds-input-helper-message--{modifier}
11
- */
12
-
13
- .tds-input-helper-message {
14
- /* TODO: Add component styles here */
15
- }
16
-
17
- .tds-input-helper-message--focus {
18
- /* TODO: Add focus state styles */
19
- }
20
-
21
- .tds-input-helper-message--disabled {
22
- /* TODO: Add disabled state styles */
23
- }
@@ -1,72 +0,0 @@
1
- {
2
- "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 3,
4
- "name": "tds/link",
5
- "title": "Link",
6
- "category": "common",
7
- "description": "Styled link component with variants and states",
8
- "icon": "link",
9
- "supports": {
10
- "html": false,
11
- "spacing": {
12
- "margin": true
13
- }
14
- },
15
- "render": "file:./render.php",
16
- "attributes": {
17
- "href": {
18
- "type": "string",
19
- "default": ""
20
- },
21
- "content": {
22
- "type": "string",
23
- "default": ""
24
- },
25
- "intent": {
26
- "type": "string",
27
- "default": "primary",
28
- "enum": ["primary", "secondary", "negative"]
29
- },
30
- "sentiment": {
31
- "type": "string",
32
- "default": "neutral",
33
- "enum": ["neutral", "positive", "negative"]
34
- },
35
- "size": {
36
- "type": "string",
37
- "default": "medium",
38
- "enum": ["small", "medium", "large"]
39
- },
40
- "state": {
41
- "type": "string",
42
- "default": "base",
43
- "enum": ["base", "hover", "visited", "focus", "disabled"]
44
- },
45
- "iconLeft": {
46
- "type": "string",
47
- "default": ""
48
- },
49
- "iconRight": {
50
- "type": "string",
51
- "default": ""
52
- },
53
- "inline": {
54
- "type": "boolean",
55
- "default": true
56
- },
57
- "ariaLabel": {
58
- "type": "string",
59
- "default": ""
60
- },
61
- "target": {
62
- "type": "string",
63
- "default": "_self",
64
- "enum": ["_self", "_blank", "_parent", "_top"]
65
- },
66
- "rel": {
67
- "type": "string",
68
- "default": ""
69
- }
70
- },
71
- "example": {}
72
- }
@@ -1,151 +0,0 @@
1
- import {
2
- useBlockProps,
3
- RichText,
4
- InspectorControls
5
- } from '@wordpress/block-editor';
6
- import {
7
- PanelBody,
8
- TextControl,
9
- SelectControl,
10
- ToggleControl
11
- } from '@wordpress/components';
12
-
13
- const edit = ({ attributes, setAttributes }) => {
14
- const {
15
- href,
16
- content,
17
- intent,
18
- sentiment,
19
- size,
20
- state,
21
- iconLeft,
22
- iconRight,
23
- inline,
24
- ariaLabel,
25
- target,
26
- rel
27
- } = attributes;
28
- const blockProps = useBlockProps();
29
-
30
- const buildClass = () => {
31
- const classes = ['tds-link'];
32
- classes.push(`tds-link--intent-${intent}`);
33
- classes.push(`tds-link--sentiment-${sentiment}`);
34
- classes.push(`tds-link--size-${size}`);
35
- classes.push(`tds-link--state-${state}`);
36
- if (!inline) classes.push('tds-link--block');
37
- return classes.join(' ');
38
- };
39
-
40
- return (
41
- <>
42
- <InspectorControls>
43
- <PanelBody title="Link Settings">
44
- <TextControl
45
- label="URL"
46
- value={href}
47
- onChange={(val) => setAttributes({ href: val })}
48
- type="url"
49
- />
50
- <SelectControl
51
- label="Intent"
52
- value={intent}
53
- options={[
54
- { label: 'Primary', value: 'primary' },
55
- { label: 'Secondary', value: 'secondary' },
56
- { label: 'Negative', value: 'negative' }
57
- ]}
58
- onChange={(val) => setAttributes({ intent: val })}
59
- />
60
- <SelectControl
61
- label="Sentiment"
62
- value={sentiment}
63
- options={[
64
- { label: 'Neutral', value: 'neutral' },
65
- { label: 'Positive', value: 'positive' },
66
- { label: 'Negative', value: 'negative' }
67
- ]}
68
- onChange={(val) => setAttributes({ sentiment: val })}
69
- />
70
- <SelectControl
71
- label="Size"
72
- value={size}
73
- options={[
74
- { label: 'Small', value: 'small' },
75
- { label: 'Medium', value: 'medium' },
76
- { label: 'Large', value: 'large' }
77
- ]}
78
- onChange={(val) => setAttributes({ size: val })}
79
- />
80
- <SelectControl
81
- label="State"
82
- value={state}
83
- options={[
84
- { label: 'Base', value: 'base' },
85
- { label: 'Hover', value: 'hover' },
86
- { label: 'Visited', value: 'visited' },
87
- { label: 'Focus', value: 'focus' },
88
- { label: 'Disabled', value: 'disabled' }
89
- ]}
90
- onChange={(val) => setAttributes({ state: val })}
91
- />
92
- <TextControl
93
- label="Left Icon"
94
- value={iconLeft}
95
- onChange={(val) => setAttributes({ iconLeft: val })}
96
- />
97
- <TextControl
98
- label="Right Icon"
99
- value={iconRight}
100
- onChange={(val) => setAttributes({ iconRight: val })}
101
- />
102
- <ToggleControl
103
- label="Inline"
104
- checked={inline}
105
- onChange={(val) => setAttributes({ inline: val })}
106
- />
107
- <SelectControl
108
- label="Target"
109
- value={target}
110
- options={[
111
- { label: 'Same window', value: '_self' },
112
- { label: 'New window', value: '_blank' },
113
- { label: 'Parent', value: '_parent' },
114
- { label: 'Top', value: '_top' }
115
- ]}
116
- onChange={(val) => setAttributes({ target: val })}
117
- />
118
- <TextControl
119
- label="Rel"
120
- value={rel}
121
- onChange={(val) => setAttributes({ rel: val })}
122
- />
123
- <TextControl
124
- label="Aria Label"
125
- value={ariaLabel}
126
- onChange={(val) => setAttributes({ ariaLabel: val })}
127
- />
128
- </PanelBody>
129
- </InspectorControls>
130
- <a
131
- {...blockProps}
132
- href={href || '#'}
133
- className={buildClass()}
134
- aria-label={ariaLabel}
135
- target={target}
136
- rel={rel}
137
- >
138
- {iconLeft && <span className="tds-link__icon-left">{iconLeft}</span>}
139
- <RichText
140
- value={content}
141
- onChange={(val) => setAttributes({ content: val })}
142
- placeholder="Link text"
143
- className="tds-link__content"
144
- />
145
- {iconRight && <span className="tds-link__icon-right">{iconRight}</span>}
146
- </a>
147
- </>
148
- );
149
- };
150
-
151
- export default edit;
@@ -1,10 +0,0 @@
1
- import { registerBlockType } from '@wordpress/blocks';
2
- import metadata from './block.json';
3
- import edit from './edit';
4
- import save from './save';
5
-
6
- registerBlockType(metadata.name, {
7
- ...metadata,
8
- edit,
9
- save
10
- });
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Link Block Render Callback
4
- *
5
- * Renders the Link block on the frontend.
6
- *
7
- * @package TimesDesignSystem\ComponentsWordPress
8
- * @var array $attributes Block attributes
9
- * @var string $content Block content
10
- * @var WP_Block $block Block instance
11
- */
12
-
13
- $href = isset($attributes['href']) ? esc_url($attributes['href']) : '';
14
- $content_text = isset($attributes['content']) ? wp_kses_post($attributes['content']) : '';
15
- $intent = isset($attributes['intent']) ? sanitize_text_field($attributes['intent']) : '';
16
- $sentiment = isset($attributes['sentiment']) ? sanitize_text_field($attributes['sentiment']) : '';
17
- $size = isset($attributes['size']) ? sanitize_text_field($attributes['size']) : '';
18
- $state = isset($attributes['state']) ? sanitize_text_field($attributes['state']) : '';
19
- $inline = isset($attributes['inline']) ? (bool) $attributes['inline'] : true;
20
- $aria_label = isset($attributes['ariaLabel']) ? sanitize_text_field($attributes['ariaLabel']) : '';
21
- $target = isset($attributes['target']) ? sanitize_text_field($attributes['target']) : '_self';
22
- $rel = isset($attributes['rel']) ? sanitize_text_field($attributes['rel']) : '';
23
-
24
- $classes = ['tds-link'];
25
- $classes[] = 'tds-link--intent-' . $intent;
26
- $classes[] = 'tds-link--sentiment-' . $sentiment;
27
- $classes[] = 'tds-link--size-' . $size;
28
- $classes[] = 'tds-link--state-' . $state;
29
- if (!$inline) {
30
- $classes[] = 'tds-link--block';
31
- }
32
-
33
- $wrapper_attrs = get_block_wrapper_attributes(['class' => implode(' ', $classes)]);
34
- ?>
35
-
36
- <a
37
- <?php echo wp_kses_post($wrapper_attrs); ?>
38
- href="<?php echo esc_attr($href); ?>"
39
- <?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
40
- <?php echo ($target !== '_self') ? 'target="' . esc_attr($target) . '"' : ''; ?>
41
- <?php echo $rel ? 'rel="' . esc_attr($rel) . '"' : ''; ?>
42
- >
43
- <span class="tds-link__content"><?php echo wp_kses_post($content_text); ?></span>
44
- </a>
@@ -1,46 +0,0 @@
1
- import { useBlockProps, RichText } from '@wordpress/block-editor';
2
-
3
- const save = ({ attributes }) => {
4
- const {
5
- href,
6
- content,
7
- intent,
8
- sentiment,
9
- size,
10
- state,
11
- iconLeft,
12
- iconRight,
13
- inline,
14
- ariaLabel,
15
- target,
16
- rel
17
- } = attributes;
18
- const blockProps = useBlockProps.save();
19
-
20
- const buildClass = () => {
21
- const classes = ['tds-link'];
22
- classes.push(`tds-link--intent-${intent}`);
23
- classes.push(`tds-link--sentiment-${sentiment}`);
24
- classes.push(`tds-link--size-${size}`);
25
- classes.push(`tds-link--state-${state}`);
26
- if (!inline) classes.push('tds-link--block');
27
- return classes.join(' ');
28
- };
29
-
30
- return (
31
- <a
32
- {...blockProps}
33
- href={href}
34
- className={buildClass()}
35
- aria-label={ariaLabel}
36
- target={target !== '_self' ? target : undefined}
37
- rel={rel || undefined}
38
- >
39
- {iconLeft && <span className="tds-link__icon-left">{iconLeft}</span>}
40
- <RichText.Content value={content} className="tds-link__content" />
41
- {iconRight && <span className="tds-link__icon-right">{iconRight}</span>}
42
- </a>
43
- );
44
- };
45
-
46
- export default save;
@@ -1,5 +0,0 @@
1
- /* Link Editor Styles */
2
- .wp-block-times-link {
3
- display: inline-block;
4
- margin: var(--spacing-s);
5
- }
@@ -1,119 +0,0 @@
1
- /* Link Block Frontend Styles */
2
- /* These styles mirror the React Link component styles */
3
-
4
- .tds-link {
5
- --tds-link-color-default: #286c96;
6
- --tds-link-color-hover: #286c96;
7
- --tds-link-color-pressed: #286c96;
8
- --tds-link-color-visited: #286c96;
9
- --tds-link-color-disabled: #bfbfbf;
10
- --tds-link-underline-default: #286c96;
11
- --tds-link-underline-hover: #286c96;
12
- --tds-link-underline-pressed: #286c96;
13
- --tds-link-underline-visited: #286c96;
14
- --tds-link-focus-ring: #737373;
15
- --tds-link-icon-size: 20px;
16
-
17
- position: relative;
18
- display: inline-flex;
19
- align-items: center;
20
- gap: 4px;
21
- color: var(--tds-link-color-default);
22
- cursor: pointer;
23
- font-family: Roboto;
24
- font-size: 1.6rem;
25
- font-weight: 400;
26
- line-height: 1.5;
27
- text-decoration: underline;
28
- text-decoration-color: var(--tds-link-underline-default);
29
- text-decoration-skip-ink: auto;
30
- text-underline-offset: 4px;
31
- text-decoration-thickness: 2px;
32
- transition: color 0.36s cubic-bezier(0.22, 1, 0.36, 1), text-decoration-color 0.36s cubic-bezier(0.22, 1, 0.36, 1), text-decoration-thickness 0.36s cubic-bezier(0.22, 1, 0.36, 1);
33
- }
34
-
35
- .tds-link--intent-secondary {
36
- --tds-link-color-default: var(--interactive-link-secondary-text-default, #1a191a);
37
- --tds-link-color-hover: var(--interactive-link-secondary-text-hover, #1a191a);
38
- --tds-link-color-pressed: var(--interactive-link-secondary-text-pressed, #1a191a);
39
- --tds-link-color-visited: var(--interactive-link-secondary-text-visited, var(--interactive-link-secondary-text-default, #1a191a));
40
- --tds-link-underline-default: var(--interactive-link-secondary-underline-default, var(--tds-link-color-default));
41
- --tds-link-underline-hover: var(--interactive-link-secondary-underline-hover, var(--tds-link-color-hover));
42
- --tds-link-underline-pressed: var(--interactive-link-secondary-underline-pressed, var(--tds-link-color-pressed));
43
- --tds-link-underline-visited: var(--interactive-link-secondary-underline-visited, var(--tds-link-color-visited));
44
- }
45
-
46
- .tds-link--sentiment-brand {
47
- font-family: var(--fontFamily020);
48
- }
49
-
50
- .tds-link--sentiment-utility {
51
- font-family: var(--fontFamily040);
52
- font-weight: var(--fontWeight070);
53
- }
54
-
55
- .tds-link--size-xsmall {
56
- font-size: 1.2rem;
57
- gap: 4px;
58
- --tds-link-icon-size: 16px;
59
- }
60
-
61
- .tds-link--size-small {
62
- font-size: 1.4rem;
63
- gap: 4px;
64
- --tds-link-icon-size: 16px;
65
- }
66
-
67
- .tds-link--size-medium {
68
- font-size: 1.6rem;
69
- gap: 6px;
70
- --tds-link-icon-size: 20px;
71
- }
72
-
73
- .tds-link--size-large {
74
- font-size: 1.8rem;
75
- gap: 8px;
76
- --tds-link-icon-size: 24px;
77
- }
78
-
79
- .tds-link__content {
80
- white-space: nowrap;
81
- }
82
-
83
- .tds-link:hover:not(.tds-link--is-disabled) {
84
- color: var(--tds-link-color-hover);
85
- text-decoration-color: var(--tds-link-underline-hover);
86
- text-decoration-thickness: var(--spacing-02);
87
- }
88
-
89
- .tds-link:active:not(.tds-link--is-disabled) {
90
- color: var(--tds-link-color-pressed);
91
- text-decoration-color: var(--tds-link-underline-pressed);
92
- }
93
-
94
- .tds-link:visited:not(.tds-link--is-disabled) {
95
- color: var(--tds-link-color-visited);
96
- text-decoration-color: var(--tds-link-underline-visited);
97
- }
98
-
99
- .tds-link:focus-visible:not(.tds-link--is-disabled) {
100
- outline: none;
101
- color: var(--tds-link-color-default);
102
- text-decoration-color: var(--tds-link-underline-default);
103
- }
104
-
105
- .tds-link:focus-visible:not(.tds-link--is-disabled)::after {
106
- content: '';
107
- position: absolute;
108
- inset: -4px;
109
- border: 2px solid #737373;
110
- pointer-events: none;
111
- }
112
-
113
- .tds-link.tds-link--is-disabled,
114
- .tds-link[aria-disabled='true'] {
115
- color: var(--tds-link-color-disabled);
116
- text-decoration-color: var(--tds-link-color-disabled);
117
- cursor: not-allowed;
118
- pointer-events: none;
119
- }
@@ -1,24 +0,0 @@
1
- {
2
- "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 3,
4
- "name": "tds/tab",
5
- "title": "Times Design System - Tab",
6
- "category": "common",
7
- "description": "WordPress block for Times Design System Tab component",
8
- "icon": "block-default",
9
- "supports": {
10
- "html": false,
11
- "multiple": true,
12
- "reusable": true,
13
- "customClassName": true
14
- },
15
- "textdomain": "times-blocks",
16
- "attributes": {
17
- "content": {
18
- "type": "string",
19
- "default": ""
20
- }
21
- },
22
- "render": "file:./render.php",
23
- "editorScript": "file:./index.js"
24
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Block Editor Component: Tab
3
- *
4
- * Renders the editor UI for the Tab block in Gutenberg.
5
- * Reference: packages/components-react/src/Tab/
6
- */
7
-
8
- import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
9
- import { PanelBody, TextControl } from '@wordpress/components';
10
-
11
- export function edit(props) {
12
- const { attributes, setAttributes } = props;
13
- const blockProps = useBlockProps();
14
-
15
- // TODO: Implement editor UI based on component props
16
- // - Add inspector controls for attributes
17
- // - Render preview of component in editor
18
- // - Handle attribute changes via setAttributes()
19
-
20
- return (
21
- <>
22
- <InspectorControls>
23
- <PanelBody title="Tab Settings" initialOpen={true}>
24
- <TextControl
25
- label="Content"
26
- value={attributes.content || ''}
27
- onChange={(content) => setAttributes({ content })}
28
- placeholder="Enter content..."
29
- />
30
- {/* TODO: Add more controls based on component variants */}
31
- </PanelBody>
32
- </InspectorControls>
33
- <div {...blockProps}>
34
- <p>📝 Tab block editor</p>
35
- <p style={{ fontSize: '12px', color: '#666' }}>
36
- TODO: Render the Tab component here with current attributes
37
- </p>
38
- </div>
39
- </>
40
- );
41
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * WordPress Block Loader: Tab
3
- *
4
- * Reference: packages/components-react/src/Tab/
5
- * TODO: Update attributes in block.json based on component props
6
- */
7
-
8
- import { registerBlockType } from '@wordpress/blocks';
9
- import { edit as Edit } from './edit';
10
- import { save as Save } from './save';
11
- import blockConfig from './block.json';
12
-
13
- registerBlockType(blockConfig.name, {
14
- ...blockConfig,
15
- edit: Edit,
16
- save: Save
17
- });
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * Block Rendering: Tab
4
- *
5
- * Server-side rendering for the Tab block.
6
- * Reference: packages/components-react/src/Tab/
7
- *
8
- * @param array $attributes Block attributes
9
- * @param string $content Saved block content
10
- * @param WP_Block $block The block instance
11
- * @return string Rendered HTML
12
- */
13
-
14
- $wrapper_attributes = get_block_wrapper_attributes();
15
-
16
- // TODO: Render the Tab component
17
- // Extract attributes and render appropriate HTML with BEM classes
18
-
19
- ?>
20
- <div <?php echo wp_kses_post( $wrapper_attributes ); ?>>
21
- <!-- TODO: Render Tab component here -->
22
- <!-- Use CSS custom properties from packages/tokens/data/resolved-hexes.json -->
23
- <!-- Apply BEM naming: tds-tab--{modifier} -->
24
- </div>
@@ -1,23 +0,0 @@
1
- /**
2
- * Block Save Component: Tab
3
- *
4
- * Renders the static output saved to the database.
5
- * Reference: packages/components-react/src/Tab/
6
- */
7
-
8
- import { useBlockProps } from '@wordpress/block-editor';
9
-
10
- export function save(props) {
11
- const { attributes } = props;
12
- const blockProps = useBlockProps.save();
13
-
14
- // TODO: Render the actual Tab component with attributes
15
- // This output is saved to the database and displayed on the frontend
16
-
17
- return (
18
- <div {...blockProps}>
19
- {/* TODO: Render Tab component */}
20
- {attributes.content && <p>{attributes.content}</p>}
21
- </div>
22
- );
23
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Styles for Tab Block
3
- *
4
- * Reference: packages/components-react/src/Tab/
5
- * Token Reference: packages/tokens/data/resolved-hexes.json
6
- *
7
- * TODO: Adapt styles from React component
8
- * - Copy relevant CSS from React component
9
- * - Map CSS custom properties to resolved hex values
10
- * - Use BEM naming: .tds-tab--{modifier}
11
- */
12
-
13
- .tds-tab {
14
- /* TODO: Add component styles here */
15
- }
16
-
17
- .tds-tab--focus {
18
- /* TODO: Add focus state styles */
19
- }
20
-
21
- .tds-tab--disabled {
22
- /* TODO: Add disabled state styles */
23
- }