@times-design-system/components-wordpress 1.8.0 → 1.8.1-alpha.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 (44) hide show
  1. package/README.md +44 -0
  2. package/dist/blocks/ad-container/block.json +3 -1
  3. package/dist/blocks/button/block.json +5 -6
  4. package/dist/blocks/button/edit.js +15 -21
  5. package/dist/blocks/button/render.php +43 -46
  6. package/dist/blocks/button/save.js +13 -19
  7. package/dist/blocks/button/style.css +8 -25
  8. package/dist/blocks/chip/block.json +7 -3
  9. package/dist/blocks/chip/render.php +1 -1
  10. package/dist/blocks/chip/style.css +3 -3
  11. package/dist/blocks/dialog-box/block.json +2 -1
  12. package/dist/blocks/divider/block.json +3 -1
  13. package/dist/blocks/flag/block.json +7 -3
  14. package/dist/blocks/flag/style.css +19 -22
  15. package/dist/blocks/icon/block.json +3 -2
  16. package/dist/blocks/icon/render.php +1 -1
  17. package/dist/blocks/icon-button/block.json +5 -2
  18. package/dist/blocks/icon-button/render.php +3 -2
  19. package/dist/blocks/icon-button/style.css +9 -8
  20. package/dist/blocks/input/block.json +3 -1
  21. package/dist/blocks/input/style.css +31 -17
  22. package/dist/blocks/input-helper-message/block.json +2 -1
  23. package/dist/blocks/link/block.json +7 -3
  24. package/dist/blocks/link/style.css +123 -21
  25. package/dist/blocks/tab/block.json +2 -1
  26. package/dist/blocks/tab/style.css +146 -17
  27. package/dist/blocks/tab-group/block.json +2 -1
  28. package/dist/blocks/text/block.json +3 -1
  29. package/dist/blocks/toast/block.json +3 -1
  30. package/dist/blocks/toast/style.css +32 -31
  31. package/dist/blocks/utils/render-icon.php +39 -0
  32. package/dist/blocks/utils/sanitize-data-attributes.php +37 -0
  33. package/dist/icon-data.json +3895 -1952
  34. package/dist/index.cjs +997 -278
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.css +1 -1
  37. package/dist/index.css.map +1 -1
  38. package/dist/index.js +998 -279
  39. package/dist/index.js.map +1 -1
  40. package/dist/plugin.php +162 -12
  41. package/dist/utils/render-icon.php +32 -6
  42. package/package.json +9 -6
  43. package/plugin.php +162 -12
  44. package/dist/blocks/button/style-editor.css +0 -15
package/README.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  WordPress Gutenberg blocks built from Times Design System components. Provides Full Site Editing (FSE) compatible blocks for React-based design tokens and SCSS styling.
4
4
 
5
+ ## ⚠️ CRITICAL: CSS Bundling Requirement
6
+
7
+ **All block CSS files must be imported in `src/index.js` for styles to be bundled and deployed.** Without these imports, styles will not appear in WordPress.
8
+
9
+ When adding a new block:
10
+
11
+ 1. Create `src/blocks/{blockName}/style.css`
12
+ 2. **Add to `src/index.js`**: `import './blocks/{blockName}/style.css';`
13
+ 3. Run `npm run build` (includes CSS import validation)
14
+
15
+ See [STYLING_BUNDLING_GUIDE.md](./STYLING_BUNDLING_GUIDE.md) for full details on CSS bundling, troubleshooting, and deployment.
16
+
17
+ ## 🚀 Quick Start (Local Testing)
18
+
19
+ Test blocks locally with Docker in 3 minutes:
20
+
21
+ ```bash
22
+ # Build plugin (includes CSS import validation)
23
+ npm run build
24
+
25
+ # Start WordPress
26
+ cd ../..
27
+ make wp-start
28
+ ```
29
+
30
+ Then visit **http://localhost:8080** and activate the plugin in WordPress Admin.
31
+
32
+ 📖 **Full guide**: See [WORDPRESS_SETUP.md](../../WORDPRESS_SETUP.md) for complete testing, development, and deployment instructions.
33
+
34
+ ## 📚 Documentation
35
+
36
+ ### Component Transformation
37
+
38
+ - [BLOCK_TRANSFORMATION_GUIDE.md](./BLOCK_TRANSFORMATION_GUIDE.md) — **READ THIS** for adding or updating blocks. Comprehensive guide covering markup parity, typography mapping, accessibility, and common pitfalls.
39
+ - [BUTTON_BLOCK_COMPARISON.md](./BUTTON_BLOCK_COMPARISON.md) — Detailed case study of Button Block transformation, showing React vs WordPress side-by-side, changes made, and verification steps.
40
+
41
+ ### Operations & Maintenance
42
+
43
+ - [DEPLOYMENT_AND_MAINTENANCE.md](./DEPLOYMENT_AND_MAINTENANCE.md) — Step-by-step deployment, troubleshooting, adding new blocks, and CI/CD integration.
44
+ - [STYLING_BUNDLING_GUIDE.md](./STYLING_BUNDLING_GUIDE.md) — Technical reference for CSS bundling architecture and debugging style issues.
45
+
5
46
  ## Overview
6
47
 
7
48
  This package transforms `@times-design-system/components-react` components into WordPress Gutenberg blocks:
@@ -846,9 +887,12 @@ Then follow the [BLOCK_CREATION_CHECKLIST.md](./BLOCK_CREATION_CHECKLIST.md) whi
846
887
 
847
888
  For detailed context on component patterns, see [TRANSFORMATION_GUIDE.md](./TRANSFORMATION_GUIDE.md).
848
889
 
890
+ For icon handling in blocks (variants, extraction, color transformation), see [ICON_HANDLING.md](./ICON_HANDLING.md).
891
+
849
892
  ## Resources
850
893
 
851
894
  - [Complete Transformation Guide](./TRANSFORMATION_GUIDE.md) — Detailed step-by-step process
895
+ - [Icon Handling Guide](./ICON_HANDLING.md) — Icons, variants, color theming
852
896
  - [Block Creation Checklist](./BLOCK_CREATION_CHECKLIST.md) — Quality assurance checklist
853
897
  - [WordPress Blocks Documentation](https://developer.wordpress.org/block-editor/)
854
898
  - [Gutenberg Block API](https://developer.wordpress.org/block-editor/reference-guides/block-api/)
@@ -35,5 +35,7 @@
35
35
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
36
36
  }
37
37
  },
38
- "example": {}
38
+ "example": {},
39
+ "script": "times-design-system",
40
+ "editorScript": "times-design-system"
39
41
  }
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "size": {
33
33
  "type": "string",
34
- "enum": ["small", "medium", "large"],
34
+ "enum": ["small", "medium", "large", "xlarge"],
35
35
  "default": "large",
36
36
  "description": "Controls the overall dimensions of the button"
37
37
  },
@@ -77,11 +77,11 @@
77
77
  },
78
78
  "iconLeft": {
79
79
  "type": "string",
80
- "description": "Icon name to display on the left side of the label"
80
+ "description": "Icon on the left with variant prefix (e.g., 'filled_circle', 'outlined_circle')"
81
81
  },
82
82
  "iconRight": {
83
83
  "type": "string",
84
- "description": "Icon name to display on the right side of the label"
84
+ "description": "Icon on the right with variant prefix (e.g., 'filled_circle', 'outlined_circle')"
85
85
  },
86
86
  "ariaLabel": {
87
87
  "type": "string",
@@ -98,7 +98,6 @@
98
98
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
99
99
  }
100
100
  },
101
- "editorScript": "file:./index.js",
102
- "editorStyle": "file:./style-editor.css",
103
- "style": "file:./style.css"
101
+ "editorScript": "times-design-system",
102
+ "script": "times-design-system"
104
103
  }
@@ -7,7 +7,6 @@ import {
7
7
  } from '@wordpress/components';
8
8
  import { RichText } from '@wordpress/block-editor';
9
9
  import { buildButtonClass } from '../../utils/classBuilder.js';
10
- import './style-editor.css';
11
10
 
12
11
  export default function Edit({ attributes, setAttributes }) {
13
12
  const {
@@ -29,10 +28,6 @@ export default function Edit({ attributes, setAttributes }) {
29
28
  dataAttributes
30
29
  } = attributes;
31
30
 
32
- const blockProps = useBlockProps({
33
- className: 'tds-button-wrapper'
34
- });
35
-
36
31
  const buttonClass = buildButtonClass({
37
32
  intent,
38
33
  size,
@@ -44,21 +39,19 @@ export default function Edit({ attributes, setAttributes }) {
44
39
 
45
40
  return (
46
41
  <>
47
- <div {...blockProps}>
48
- <Element
49
- className={buttonClass}
50
- disabled={!href && disabled}
51
- href={href}
52
- target={target}
53
- rel={rel}
54
- type={!href ? type : undefined}
55
- aria-label={ariaLabel}
56
- >
57
- <span className="tds-button__label-container">
58
- <span className="tds-button__label">{label}</span>
59
- </span>
60
- </Element>
61
- </div>
42
+ <Element
43
+ className={buttonClass}
44
+ disabled={!href && disabled}
45
+ href={href}
46
+ target={target}
47
+ rel={rel}
48
+ type={!href ? type : undefined}
49
+ aria-label={ariaLabel}
50
+ >
51
+ <span className="tds-button__label-container">
52
+ <span className="tds-button__label">{label}</span>
53
+ </span>
54
+ </Element>
62
55
 
63
56
  <InspectorControls>
64
57
  <PanelBody title="Button Settings">
@@ -86,7 +79,8 @@ export default function Edit({ attributes, setAttributes }) {
86
79
  options={[
87
80
  { label: 'Small', value: 'small' },
88
81
  { label: 'Medium', value: 'medium' },
89
- { label: 'Large', value: 'large' }
82
+ { label: 'Large', value: 'large' },
83
+ { label: 'XLarge', value: 'xlarge' }
90
84
  ]}
91
85
  onChange={(value) => setAttributes({ size: value })}
92
86
  />
@@ -51,7 +51,7 @@ $classes[] = 'tds-button--intent-' . $intent;
51
51
  $classes[] = 'tds-button--size-' . $size;
52
52
  $classes[] = 'tds-button--behaviour-' . $behaviour;
53
53
  if ($isRounded) {
54
- $classes[] = 'tds-button--rounded';
54
+ $classes[] = 'tds-button--is-rounded';
55
55
  }
56
56
  if ($isLoading) {
57
57
  $classes[] = 'tds-button--loading';
@@ -66,52 +66,49 @@ if ($element_class_name) {
66
66
 
67
67
  $button_class = implode(' ', $classes);
68
68
  $element_tag = $href ? 'a' : 'button';
69
- $wrapper_attrs = get_block_wrapper_attributes(['class' => 'tds-button-wrapper']);
70
69
  ?>
71
70
 
72
- <div <?php echo wp_kses_post($wrapper_attrs); ?>>
73
- <?php
74
- if ($element_tag === 'a') {
75
- ?>
76
- <a
77
- class="<?php echo esc_attr($button_class); ?>"
78
- href="<?php echo esc_attr($href); ?>"
79
- <?php echo $target ? 'target="' . esc_attr($target) . '"' : ''; ?>
80
- <?php echo $rel ? 'rel="' . esc_attr($rel) . '"' : ''; ?>
81
- <?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
82
- <?php echo wp_kses_post($data_attrs_html); ?>
83
- >
84
- <span class="tds-button__label-container">
85
- <?php if ($icon_left) : ?>
86
- <span class="tds-button__icon tds-button__icon--left"><?php echo wp_kses_post(tds_render_icon($icon_left, $icon_size)); ?></span>
71
+ <?php
72
+ if ($element_tag === 'a') {
73
+ ?>
74
+ <a
75
+ class="<?php echo esc_attr($button_class); ?>"
76
+ href="<?php echo esc_attr($href); ?>"
77
+ <?php echo $target ? 'target="' . esc_attr($target) . '"' : ''; ?>
78
+ <?php echo $rel ? 'rel="' . esc_attr($rel) . '"' : ''; ?>
79
+ <?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
80
+ <?php echo wp_kses_post($data_attrs_html); ?>
81
+ >
82
+ <span class="tds-button__label-container">
83
+ <?php if ($icon_left) : ?>
84
+ <span class="tds-button__icon tds-button__icon--left"><?php echo wp_kses_post(tds_render_icon($icon_left, $icon_size)); ?></span>
85
+ <?php endif; ?>
86
+ <span class="tds-button__label"><?php echo wp_kses_post($label); ?></span>
87
+ <?php if ($icon_right) : ?>
88
+ <span class="tds-button__icon tds-button__icon--right"><?php echo wp_kses_post(tds_render_icon($icon_right, $icon_size)); ?></span>
87
89
  <?php endif; ?>
88
- <span class="tds-button__label"><?php echo wp_kses_post($label); ?></span>
89
- <?php if ($icon_right) : ?>
90
- <span class="tds-button__icon tds-button__icon--right"><?php echo wp_kses_post(tds_render_icon($icon_right, $icon_size)); ?></span>
91
- <?php endif; ?>
92
- </span>
93
- </a>
94
- <?php
95
- } else {
96
- ?>
97
- <button
98
- class="<?php echo esc_attr($button_class); ?>"
99
- <?php echo $disabled ? 'disabled' : ''; ?>
100
- type="<?php echo esc_attr($type); ?>"
101
- <?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
102
- <?php echo wp_kses_post($data_attrs_html); ?>
103
- >
104
- <span class="tds-button__label-container">
105
- <?php if ($icon_left) : ?>
106
- <span class="tds-button__icon tds-button__icon--left"><?php echo wp_kses_post(tds_render_icon($icon_left, $icon_size)); ?></span>
107
- <?php endif; ?>
108
- <span class="tds-button__label"><?php echo wp_kses_post($label); ?></span>
109
- <?php if ($icon_right) : ?>
110
- <span class="tds-button__icon tds-button__icon--right"><?php echo wp_kses_post(tds_render_icon($icon_right, $icon_size)); ?></span>
111
- <?php endif; ?>
112
- </span>
113
- </button>
114
- <?php
115
- }
90
+ </span>
91
+ </a>
92
+ <?php
93
+ } else {
116
94
  ?>
117
- </div>
95
+ <button
96
+ class="<?php echo esc_attr($button_class); ?>"
97
+ <?php echo $disabled ? 'disabled' : ''; ?>
98
+ type="<?php echo esc_attr($type); ?>"
99
+ <?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
100
+ <?php echo wp_kses_post($data_attrs_html); ?>
101
+ >
102
+ <?php if ($icon_left) : ?>
103
+ <span class="tds-button__icon tds-button__icon--left"><?php echo wp_kses_post(tds_render_icon($icon_left, $icon_size)); ?></span>
104
+ <?php endif; ?>
105
+ <span class="tds-button__label-container">
106
+ <span class="tds-button__label"><?php echo wp_kses_post($label); ?></span>
107
+ </span>
108
+ <?php if ($icon_right) : ?>
109
+ <span class="tds-button__icon tds-button__icon--right"><?php echo wp_kses_post(tds_render_icon($icon_right, $icon_size)); ?></span>
110
+ <?php endif; ?>
111
+ </button>
112
+ <?php
113
+ }
114
+ ?>
@@ -18,10 +18,6 @@ export default function Save({ attributes }) {
18
18
  ariaLabel
19
19
  } = attributes;
20
20
 
21
- const blockProps = useBlockProps.save({
22
- className: 'tds-button-wrapper'
23
- });
24
-
25
21
  const buttonClass = buildButtonClass({
26
22
  intent,
27
23
  size,
@@ -33,20 +29,18 @@ export default function Save({ attributes }) {
33
29
  const Element = href ? 'a' : 'button';
34
30
 
35
31
  return (
36
- <div {...blockProps}>
37
- <Element
38
- className={buttonClass}
39
- disabled={!href && disabled}
40
- href={href}
41
- target={target}
42
- rel={rel}
43
- type={!href ? type : undefined}
44
- aria-label={ariaLabel}
45
- >
46
- <span className="tds-button__label-container">
47
- <span className="tds-button__label">{label}</span>
48
- </span>
49
- </Element>
50
- </div>
32
+ <Element
33
+ className={buttonClass}
34
+ disabled={!href && disabled}
35
+ href={href}
36
+ target={target}
37
+ rel={rel}
38
+ type={!href ? type : undefined}
39
+ aria-label={ariaLabel}
40
+ >
41
+ <span className="tds-button__label-container">
42
+ <span className="tds-button__label">{label}</span>
43
+ </span>
44
+ </Element>
51
45
  );
52
46
  }
@@ -66,7 +66,7 @@
66
66
  gap: 0;
67
67
  }
68
68
 
69
- .tds-button--rounded {
69
+ .tds-button--is-rounded {
70
70
  border-radius: 9999px;
71
71
  }
72
72
 
@@ -108,35 +108,35 @@
108
108
  }
109
109
 
110
110
  .tds-button--size-small {
111
- min-height: 32px;
111
+ min-height: 40px;
112
112
  padding: 0 12px;
113
113
  min-width: 80px;
114
- font-size: 1.4rem;
115
114
  --tds-button-label-inline-padding: 4px;
115
+ font-size: 0.875rem; /* utility.button.small */
116
116
  }
117
117
 
118
118
  .tds-button--size-medium {
119
119
  min-height: 48px;
120
120
  min-width: 100px;
121
121
  padding: 0 16px;
122
- font-size: 1.6rem;
123
122
  --tds-button-label-inline-padding: 8px;
123
+ font-size: 1rem; /* utility.button.medium */
124
124
  }
125
125
 
126
126
  .tds-button--size-large {
127
- min-height: 64px;
127
+ min-height: 56px;
128
128
  min-width: 130px;
129
129
  padding: 0 24px;
130
- font-size: 1.8rem;
131
130
  --tds-button-label-inline-padding: 8px;
131
+ font-size: 1rem; /* utility.button.medium - mapped from large */
132
132
  }
133
133
 
134
134
  .tds-button--size-xlarge {
135
- min-height: 80px;
135
+ min-height: 64px;
136
136
  min-width: 130px;
137
137
  padding: 0 24px;
138
- font-size: 1.8rem;
139
138
  --tds-button-label-inline-padding: 8px;
139
+ font-size: 1.125rem; /* utility.button.large - mapped from xlarge */
140
140
  }
141
141
 
142
142
  .tds-button--behaviour-hug {
@@ -147,27 +147,10 @@
147
147
  width: 100%;
148
148
  }
149
149
 
150
- .tds-button-wrapper {
151
- display: inline-block;
152
- }
153
-
154
150
  .tds-button__label-container {
155
- display: inline-flex;
156
- align-items: center;
157
- justify-content: center;
158
- flex: 0 0 auto;
159
- width: fit-content;
160
151
  padding: 0 var(--tds-button-label-inline-padding);
161
152
  }
162
153
 
163
- .tds-button__label {
164
- display: inline-flex;
165
- align-items: center;
166
- justify-content: center;
167
- flex: 0 0 auto;
168
- width: fit-content;
169
- }
170
-
171
154
  .tds-button__icon,
172
155
  .tds-button__spinner {
173
156
  display: inline-flex;
@@ -38,11 +38,13 @@
38
38
  },
39
39
  "iconLeft": {
40
40
  "type": "string",
41
- "default": ""
41
+ "default": "",
42
+ "description": "Icon on the left with variant prefix (e.g., 'filled_circle')"
42
43
  },
43
44
  "iconRight": {
44
45
  "type": "string",
45
- "default": ""
46
+ "default": "",
47
+ "description": "Icon on the right with variant prefix (e.g., 'outlined_circle')"
46
48
  },
47
49
  "ariaLabel": {
48
50
  "type": "string",
@@ -59,5 +61,7 @@
59
61
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
60
62
  }
61
63
  },
62
- "example": {}
64
+ "example": {},
65
+ "script": "times-design-system",
66
+ "editorScript": "times-design-system"
63
67
  }
@@ -13,7 +13,7 @@
13
13
  require_once __DIR__ . '/../../utils/sanitize-data-attributes.php';
14
14
  require_once __DIR__ . '/../../utils/render-icon.php';
15
15
 
16
- $content_text = isset($attributes['content']) ? wp_kses_post($attributes['content']) : '';
16
+ $content_text = isset($attributes['content']) ? wp_kses_post($attributes['content']) : 'Chip content';
17
17
  $intent = isset($attributes['intent']) ? sanitize_text_field($attributes['intent']) : '';
18
18
  $size = isset($attributes['size']) ? sanitize_text_field($attributes['size']) : '';
19
19
  $channel = isset($attributes['channel']) ? (bool) $attributes['channel'] : false;
@@ -69,15 +69,15 @@
69
69
  }
70
70
 
71
71
  .tds-chip--size-small {
72
- min-height: 32px;
72
+ min-height: 36px;
73
73
  padding: 0 12px;
74
- font-size: 1.4rem;
74
+ font-size: 0.875rem; /* utility.button.small */
75
75
  }
76
76
 
77
77
  .tds-chip--size-large {
78
78
  min-height: 48px;
79
79
  padding: 0 16px;
80
- font-size: 1.6rem;
80
+ font-size: 1.125rem; /* utility.button.large */
81
81
  }
82
82
 
83
83
  .tds-chip__content {
@@ -30,5 +30,6 @@
30
30
  }
31
31
  },
32
32
  "render": "file:./render.php",
33
- "editorScript": "file:./index.js"
33
+ "editorScript": "times-design-system",
34
+ "script": "times-design-system"
34
35
  }
@@ -38,5 +38,7 @@
38
38
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
39
39
  }
40
40
  },
41
- "example": {}
41
+ "example": {},
42
+ "script": "times-design-system",
43
+ "editorScript": "times-design-system"
42
44
  }
@@ -34,11 +34,13 @@
34
34
  },
35
35
  "iconLeft": {
36
36
  "type": "string",
37
- "default": ""
37
+ "default": "",
38
+ "description": "Icon on the left with variant prefix (e.g., 'filled_check')"
38
39
  },
39
40
  "iconRight": {
40
41
  "type": "string",
41
- "default": ""
42
+ "default": "",
43
+ "description": "Icon on the right with variant prefix (e.g., 'outlined_check')"
42
44
  },
43
45
  "ariaLabel": {
44
46
  "type": "string",
@@ -55,5 +57,7 @@
55
57
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
56
58
  }
57
59
  },
58
- "example": {}
60
+ "example": {},
61
+ "script": "times-design-system",
62
+ "editorScript": "times-design-system"
59
63
  }
@@ -1,26 +1,23 @@
1
- /* Flag Block Frontend Styles */
2
- /* Using resolved design token values for self-contained styling */
1
+ /* Flag Block Frontend Styles (Tag Component) */
2
+ /* Using design tokens for self-contained styling */
3
3
 
4
4
  .tds-flag {
5
- --tds-flag-bg: #000000;
6
- --tds-flag-fg: #f2f2f2;
7
- --tds-flag-icon: var(--flag-fg);
8
- --tds-flag-border: transparent;
5
+ --tds-tag-bg: var(--tag-primary-fill, #000000);
6
+ --tds-tag-fg: var(--tag-primary-text, #f2f2f2);
9
7
 
10
8
  display: inline-flex;
11
9
  align-items: center;
12
10
  justify-content: center;
13
- gap: 4px;
11
+ gap: var(--spacing-03);
14
12
  min-height: 19px;
15
13
  min-width: 42px;
16
- padding: 0 2px;
17
- border-radius: 2px;
18
- border: 1px solid var(--tds-flag-border);
19
- background-color: var(--tds-flag-bg);
20
- color: var(--tds-flag-fg);
21
- font-family: Roboto;
22
- font-size: 1.4rem;
23
- font-weight: 500;
14
+ padding: var(--spacing-03) var(--spacing-04);
15
+ border-radius: var(--border-radius-50);
16
+ background-color: var(--tds-tag-bg);
17
+ color: var(--tds-tag-fg);
18
+ font-family: var(--fontFamily040, sans-serif);
19
+ font-size: var(--fontSize020, 14px);
20
+ font-weight: var(--fontWeight050, 500);
24
21
  line-height: 1.125;
25
22
  text-transform: uppercase;
26
23
  white-space: nowrap;
@@ -28,19 +25,19 @@
28
25
  }
29
26
 
30
27
  .tds-flag--size-small {
31
- font-size: 1.2rem;
28
+ padding: var(--spacing-01) var(--spacing-04);
29
+ font-size: var(--fontSize010, 12px);
30
+ gap: var(--spacing-01);
32
31
  }
33
32
 
34
33
  .tds-flag--intent-secondary {
35
- --tds-flag-bg: transparent;
36
- --tds-flag-fg: #1a1a1a;
37
- --tds-flag-icon: var(--tds-flag-fg);
34
+ --tds-tag-bg: transparent;
35
+ --tds-tag-fg: var(--text-primary, #1a1a1a);
38
36
  }
39
37
 
40
38
  .tds-flag--intent-callout {
41
- --tds-flag-bg: #b20908;
42
- --tds-flag-fg: #ffffff;
43
- --tds-flag-icon: var(--tds-flag-fg);
39
+ --tds-tag-bg: var(--tag-callout-primary-fill, #b20908);
40
+ --tds-tag-fg: var(--tag-callout-primary-text, #ffffff);
44
41
  }
45
42
 
46
43
  .tds-flag__label {
@@ -17,7 +17,7 @@
17
17
  "iconName": {
18
18
  "type": "string",
19
19
  "default": "",
20
- "description": "The name of the icon to display"
20
+ "description": "The name of the icon to display (e.g., 'filled_circle', 'outlined_check')"
21
21
  },
22
22
  "size": {
23
23
  "type": "string",
@@ -45,5 +45,6 @@
45
45
  }
46
46
  },
47
47
  "render": "file:./render.php",
48
- "editorScript": "file:./index.js"
48
+ "editorScript": "times-design-system",
49
+ "script": "times-design-system"
49
50
  }
@@ -33,7 +33,7 @@ if ($classes) {
33
33
  $wrapper_class = implode(' ', $wrapper_classes);
34
34
  $wrapper_attrs = get_block_wrapper_attributes(['class' => $wrapper_class]);
35
35
 
36
- // Render icon
36
+ // Render icon (icon name includes variant: filled_circle, outlined_circle, etc.)
37
37
  $svg_content = tds_render_icon($icon_name, $size);
38
38
  ?>
39
39
 
@@ -16,7 +16,8 @@
16
16
  "attributes": {
17
17
  "iconName": {
18
18
  "type": "string",
19
- "default": ""
19
+ "default": "",
20
+ "description": "Icon name with variant prefix (e.g., 'filled_accessibility', 'outlined_accessibility')"
20
21
  },
21
22
  "iconSize": {
22
23
  "type": "string",
@@ -69,5 +70,7 @@
69
70
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
70
71
  }
71
72
  },
72
- "example": {}
73
+ "example": {},
74
+ "script": "times-design-system",
75
+ "editorScript": "times-design-system"
73
76
  }
@@ -13,7 +13,7 @@
13
13
  require_once __DIR__ . '/../../utils/sanitize-data-attributes.php';
14
14
  require_once __DIR__ . '/../../utils/render-icon.php';
15
15
 
16
- $icon_name = isset($attributes['iconName']) ? sanitize_text_field($attributes['iconName']) : '';
16
+ $icon_name = isset($attributes['iconName']) ? sanitize_text_field($attributes['iconName']) : 'filled_check';
17
17
  $icon_size = isset($attributes['iconSize']) ? sanitize_text_field($attributes['iconSize']) : 'medium';
18
18
  $round = isset($attributes['round']) ? (bool) $attributes['round'] : false;
19
19
  $isLoading = isset($attributes['isLoading']) ? (bool) $attributes['isLoading'] : false;
@@ -31,8 +31,9 @@ foreach ($sanitized_data_attributes as $attr_name => $attr_value) {
31
31
  }
32
32
 
33
33
  $classes = ['tds-icon-button'];
34
+ $classes[] = 'tds-icon-button--size-' . $icon_size;
34
35
  if ($round) {
35
- $classes[] = 'tds-icon-button--round';
36
+ $classes[] = 'tds-icon-button--is-rounded';
36
37
  }
37
38
  if ($isLoading) {
38
39
  $classes[] = 'tds-icon-button--loading';