@times-design-system/components-wordpress 1.8.1-alpha.0 → 1.8.1-alpha.4

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 (42) hide show
  1. package/README.md +41 -0
  2. package/dist/blocks/ad-container/block.json +3 -1
  3. package/dist/blocks/button/block.json +3 -4
  4. package/dist/blocks/button/edit.js +15 -21
  5. package/dist/blocks/button/render.php +40 -43
  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 +3 -1
  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 +3 -1
  14. package/dist/blocks/flag/style.css +19 -22
  15. package/dist/blocks/icon/block.json +2 -1
  16. package/dist/blocks/icon-button/block.json +3 -1
  17. package/dist/blocks/icon-button/render.php +3 -2
  18. package/dist/blocks/icon-button/style.css +9 -8
  19. package/dist/blocks/input/block.json +3 -1
  20. package/dist/blocks/input/style.css +31 -17
  21. package/dist/blocks/input-helper-message/block.json +2 -1
  22. package/dist/blocks/link/block.json +3 -1
  23. package/dist/blocks/link/style.css +123 -21
  24. package/dist/blocks/tab/block.json +2 -1
  25. package/dist/blocks/tab/style.css +146 -17
  26. package/dist/blocks/tab-group/block.json +2 -1
  27. package/dist/blocks/text/block.json +3 -1
  28. package/dist/blocks/toast/block.json +3 -1
  29. package/dist/blocks/toast/style.css +32 -31
  30. package/dist/blocks/utils/render-icon.php +39 -0
  31. package/dist/blocks/utils/sanitize-data-attributes.php +37 -0
  32. package/dist/icon-data.json +2661 -2661
  33. package/dist/index.cjs +975 -263
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.css +1 -1
  36. package/dist/index.css.map +1 -1
  37. package/dist/index.js +976 -264
  38. package/dist/index.js.map +1 -1
  39. package/dist/plugin.php +162 -12
  40. package/package.json +9 -6
  41. package/plugin.php +162 -12
  42. package/dist/blocks/button/style-editor.css +0 -15
@@ -1,27 +1,31 @@
1
- /* Input Block Frontend Styles */
2
- /* Using resolved design token values for self-contained styling */
1
+ /* Input component styles using design tokens */
3
2
 
4
3
  .tds-input-wrapper {
5
4
  display: flex;
6
5
  flex-direction: column;
7
- gap: 8px;
6
+ gap: var(--spacing-05);
8
7
  }
9
8
 
10
9
  /* Label styles */
11
- .tds-input__label {
12
- color: #1a1a1a;
10
+ .tds-input-label {
11
+ color: var(--text-primary, #1a1a1a);
13
12
  display: flex;
14
13
  align-items: center;
15
- gap: 4px;
14
+ gap: var(--spacing-03);
15
+ }
16
+
17
+ /* Required asterisk */
18
+ .tds-input-required {
19
+ color: var(--text-error, #cc0000);
16
20
  }
17
21
 
18
22
  /* Input field styles */
19
23
  .tds-input {
20
24
  width: 100%;
21
- padding: 8px 12px;
22
- color: #1a1a1a;
23
- background-color: #ffffff;
24
- border: 1px solid #999999;
25
+ padding: var(--spacing-05) var(--spacing-07);
26
+ color: var(--text-primary, #1a1a1a);
27
+ background-color: var(--interactive-background-default, #ffffff);
28
+ border: 1px solid var(--border-primary, #999999);
25
29
  border-radius: 0;
26
30
  transition: all 0.2s ease-in-out;
27
31
  box-sizing: border-box;
@@ -30,24 +34,34 @@
30
34
  /* Input focus state */
31
35
  .tds-input:focus {
32
36
  outline: none;
33
- border-color: #0f4aa2;
34
- box-shadow: 0 0 0 2px rgba(15, 74, 162, 0.1);
37
+ border-color: var(--text-interactive-primary, #0f4aa2);
38
+ box-shadow: 0 0 0 var(--spacing-01) rgba(15, 74, 162, 0.1);
35
39
  }
36
40
 
37
41
  /* Input hover state */
38
42
  .tds-input:hover:not(:disabled) {
39
- border-color: #0f4aa2;
43
+ border-color: var(--text-interactive-primary, #0f4aa2);
40
44
  }
41
45
 
42
46
  /* Input disabled state */
43
47
  .tds-input:disabled {
44
- background-color: #f2f2f2;
45
- color: #999999;
46
- border-color: #cccccc;
48
+ background-color: var(--interactive-background-disabled, #f2f2f2);
49
+ color: var(--text-disabled, #999999);
50
+ border-color: var(--border-disabled, #cccccc);
47
51
  cursor: not-allowed;
48
52
  }
49
53
 
50
54
  /* Input placeholder */
51
55
  .tds-input::placeholder {
52
- color: #666666;
56
+ color: var(--text-secondary, #666666);
57
+ }
58
+
59
+ /* Input error state (optional class to apply) */
60
+ .tds-input.error {
61
+ border-color: var(--text-error, #cc0000);
62
+ }
63
+
64
+ .tds-input.error:focus {
65
+ border-color: var(--text-error, #cc0000);
66
+ box-shadow: 0 0 0 var(--spacing-01) rgba(204, 0, 0, 0.1);
53
67
  }
@@ -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
  }
@@ -75,5 +75,7 @@
75
75
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
76
76
  }
77
77
  },
78
- "example": {}
78
+ "example": {},
79
+ "script": "times-design-system",
80
+ "editorScript": "times-design-system"
79
81
  }
@@ -2,37 +2,37 @@
2
2
  /* These styles mirror the React Link component styles */
3
3
 
4
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;
5
+ --tds-link-color-default: var(--interactive-link-primary-text-default, #286c96);
6
+ --tds-link-color-hover: var(--interactive-link-primary-text-hover, #286c96);
7
+ --tds-link-color-pressed: var(--interactive-link-primary-text-pressed, #286c96);
8
+ --tds-link-color-visited: var(--interactive-link-primary-text-visited, #286c96);
9
+ --tds-link-color-disabled: var(--interactive-disabled-b, #bfbfbf);
10
+ --tds-link-underline-default: var(--interactive-link-primary-underline-default, var(--tds-link-color-default));
11
+ --tds-link-underline-hover: var(--interactive-link-primary-underline-hover, var(--tds-link-color-hover));
12
+ --tds-link-underline-pressed: var(--interactive-link-primary-underline-pressed, var(--tds-link-color-pressed));
13
+ --tds-link-underline-visited: var(--interactive-link-primary-underline-visited, var(--tds-link-color-visited));
14
+ --tds-link-focus-ring: var(--focus-border, #737373);
15
15
  --tds-link-icon-size: 20px;
16
16
 
17
17
  position: relative;
18
18
  display: inline-flex;
19
19
  align-items: center;
20
- gap: 4px;
20
+ gap: var(--spacing-03);
21
21
  color: var(--tds-link-color-default);
22
22
  cursor: pointer;
23
- font-family: Roboto;
24
- font-size: 1.6rem;
25
- font-weight: 400;
26
- line-height: 1.5;
23
+ font-family: var(--fontFamily040, sans-serif);
24
+ font-size: var(--fontSize030, 1rem);
25
+ font-weight: var(--fontWeight040, 400);
26
+ line-height: var(--fontLineHeight040, 1.5);
27
27
  text-decoration: underline;
28
28
  text-decoration-color: var(--tds-link-underline-default);
29
29
  text-decoration-skip-ink: auto;
30
- text-underline-offset: 4px;
31
- text-decoration-thickness: 2px;
30
+ text-underline-offset: var(--spacing-03);
31
+ text-decoration-thickness: var(--spacing-01);
32
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
33
  }
34
34
 
35
- .tds-link--intent-secondary {
35
+ .tds-link--secondary {
36
36
  --tds-link-color-default: var(--interactive-link-secondary-text-default, #1a191a);
37
37
  --tds-link-color-hover: var(--interactive-link-secondary-text-hover, #1a191a);
38
38
  --tds-link-color-pressed: var(--interactive-link-secondary-text-pressed, #1a191a);
@@ -43,6 +43,17 @@
43
43
  --tds-link-underline-visited: var(--interactive-link-secondary-underline-visited, var(--tds-link-color-visited));
44
44
  }
45
45
 
46
+ .tds-link--danger {
47
+ --tds-link-color-default: var(--interactive-negative-text-default, #cc0705);
48
+ --tds-link-color-hover: var(--interactive-negative-text-hover, #cc0705);
49
+ --tds-link-color-pressed: var(--interactive-negative-text-pressed, #cc0705);
50
+ --tds-link-color-visited: var(--interactive-negative-text-default, #cc0705);
51
+ --tds-link-underline-default: var(--interactive-negative-text-default, #cc0705);
52
+ --tds-link-underline-hover: var(--interactive-negative-text-hover, #cc0705);
53
+ --tds-link-underline-pressed: var(--interactive-negative-text-pressed, #cc0705);
54
+ --tds-link-underline-visited: var(--interactive-negative-text-default, #cc0705);
55
+ }
56
+
46
57
  .tds-link--sentiment-brand {
47
58
  font-family: var(--fontFamily020);
48
59
  }
@@ -53,9 +64,100 @@
53
64
  }
54
65
 
55
66
  .tds-link--size-xsmall {
56
- font-size: 1.2rem;
57
- gap: 4px;
58
- --tds-link-icon-size: 16px;
67
+ font-size: var(--fontSize010, 12px);
68
+ gap: var(--spacing-03);
69
+ --tds-link-icon-size: var(--spacing-09);
70
+ }
71
+
72
+ .tds-link--size-small {
73
+ font-size: var(--fontSize020, 14px);
74
+ gap: var(--spacing-03);
75
+ --tds-link-icon-size: var(--spacing-09);
76
+ }
77
+
78
+ .tds-link--size-medium {
79
+ font-size: var(--fontSize030, 16px);
80
+ gap: var(--spacing-04);
81
+ --tds-link-icon-size: var(--spacing-11);
82
+ }
83
+
84
+ .tds-link--size-large {
85
+ font-size: var(--fontSize040, 18px);
86
+ gap: var(--spacing-05);
87
+ --tds-link-icon-size: var(--spacing-13);
88
+ }
89
+
90
+ .tds-link__label {
91
+ white-space: nowrap;
92
+ }
93
+
94
+ .tds-link__icon {
95
+ display: inline-flex;
96
+ align-items: center;
97
+ justify-content: center;
98
+ width: var(--tds-link-icon-size);
99
+ height: var(--tds-link-icon-size);
100
+ flex: 0 0 var(--tds-link-icon-size);
101
+ }
102
+
103
+ .tds-link__icon-svg {
104
+ width: 100%;
105
+ height: 100%;
106
+ }
107
+
108
+ .tds-link:hover:not(.tds-link--is-disabled) {
109
+ color: var(--tds-link-color-hover);
110
+ text-decoration-color: var(--tds-link-underline-hover);
111
+ text-decoration-thickness: var(--spacing-02);
112
+ }
113
+
114
+ .tds-link:active:not(.tds-link--is-disabled) {
115
+ color: var(--tds-link-color-pressed);
116
+ text-decoration-color: var(--tds-link-underline-pressed);
117
+ }
118
+
119
+ .tds-link:visited:not(.tds-link--is-disabled) {
120
+ color: var(--tds-link-color-visited);
121
+ text-decoration-color: var(--tds-link-underline-visited);
122
+ }
123
+
124
+ .tds-link:focus-visible:not(.tds-link--is-disabled) {
125
+ outline: none;
126
+ color: var(--tds-link-color-default);
127
+ text-decoration-color: var(--tds-link-underline-default);
128
+ }
129
+
130
+ .tds-link:focus-visible:not(.tds-link--is-disabled)::after {
131
+ content: '';
132
+ position: absolute;
133
+ inset: calc(var(--spacing-03) * -1);
134
+ border: var(--spacing-01) solid var(--tds-link-focus-ring);
135
+ pointer-events: none;
136
+ }
137
+
138
+ .tds-link.tds-link--is-disabled,
139
+ .tds-link[aria-disabled='true'] {
140
+ color: var(--tds-link-color-disabled);
141
+ text-decoration-color: var(--tds-link-color-disabled);
142
+ cursor: not-allowed;
143
+ pointer-events: none;
144
+ }
145
+
146
+ .tds-link--standalone {
147
+ text-decoration: none;
148
+ }
149
+
150
+ .tds-link--standalone:hover:not(.tds-link--is-disabled) {
151
+ text-decoration: none;
152
+ }
153
+
154
+ .tds-link--standalone:active:not(.tds-link--is-disabled) {
155
+ text-decoration: none;
156
+ }
157
+
158
+ .tds-link--standalone.tds-link--is-disabled,
159
+ .tds-link--standalone[aria-disabled='true'] {
160
+ text-decoration: none;
59
161
  }
60
162
 
61
163
  .tds-link--size-small {
@@ -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
  }
@@ -1,23 +1,152 @@
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
1
  .tds-tab {
14
- /* TODO: Add component styles here */
2
+ --tds-tab-bg: var(--interactive-tab-fill-default, transparent);
3
+ --tds-tab-bg-hover: var(--interactive-tab-fill-hover, #f2f2f2);
4
+ --tds-tab-bg-pressed: var(--interactive-tab-fill-pressed, #e6e6e6);
5
+ --tds-tab-fg: var(--interactive-tab-text-default, #1a1a1a);
6
+ --tds-tab-fg-hover: var(--interactive-tab-text-hover, #404040);
7
+ --tds-tab-fg-pressed: var(--interactive-tab-text-pressed, #404040);
8
+ --tds-tab-icon: var(--interactive-tab-icon-default, #1a1a1a);
9
+ --tds-tab-icon-hover: var(--interactive-tab-icon-hover, #404040);
10
+ --tds-tab-icon-pressed: var(--interactive-tab-icon-pressed, #404040);
11
+ --tds-tab-selected-border: var(--interactive-tab-selected-border-default, #1a1a1a);
12
+ --tds-tab-focus-ring: var(--focus-border, #737373);
13
+
14
+ position: relative;
15
+ display: inline-flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ gap: var(--spacing-05);
19
+ border: 0;
20
+ border-bottom: 2px solid transparent;
21
+ background-color: var(--tds-tab-bg);
22
+ color: var(--tds-tab-fg);
23
+ font-family: var(--fontFamily040, sans-serif);
24
+ font-weight: var(--fontWeight050, 500);
25
+ line-height: var(--fontLineHeight030, 1.25);
26
+ white-space: nowrap;
27
+ cursor: pointer;
28
+ transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
29
+ }
30
+
31
+ .tds-tab:hover:not(:disabled) {
32
+ background-color: var(--tds-tab-bg-hover);
33
+ color: var(--tds-tab-fg-hover);
34
+ }
35
+
36
+ .tds-tab:active:not(:disabled) {
37
+ background-color: var(--tds-tab-bg-pressed);
38
+ color: var(--tds-tab-fg-pressed);
39
+ }
40
+
41
+ .tds-tab:focus-visible {
42
+ outline: none;
43
+ background-color: var(--tds-tab-bg-hover);
44
+ color: var(--tds-tab-fg-hover);
45
+ }
46
+
47
+ .tds-tab:focus-visible::after {
48
+ content: '';
49
+ position: absolute;
50
+ inset: calc(var(--spacing-02, 2px) * -1);
51
+ border: var(--spacing-01, 1px) solid var(--tds-tab-focus-ring);
52
+ border-radius: var(--spacing-02, 2px);
53
+ pointer-events: none;
54
+ }
55
+
56
+ .tds-tab:disabled {
57
+ background-color: var(--interactive-disabled-b, #bfbfbf);
58
+ color: var(--interactive-disabled-a, #d9d9d9);
59
+ cursor: not-allowed;
60
+ }
61
+
62
+ .tds-tab--state-hover:not(:disabled) {
63
+ background-color: var(--tds-tab-bg-hover);
64
+ color: var(--tds-tab-fg-hover);
65
+ }
66
+
67
+ .tds-tab--state-pressed:not(:disabled) {
68
+ background-color: var(--tds-tab-bg-pressed);
69
+ color: var(--tds-tab-fg-pressed);
70
+ }
71
+
72
+ .tds-tab--state-focus:not(:disabled) {
73
+ background-color: var(--tds-tab-bg-hover);
74
+ color: var(--tds-tab-fg-hover);
75
+ }
76
+
77
+ .tds-tab--state-focus:not(:disabled)::after {
78
+ content: '';
79
+ position: absolute;
80
+ inset: calc(var(--spacing-02, 2px) * -1);
81
+ border: var(--spacing-01, 1px) solid var(--tds-tab-focus-ring);
82
+ border-radius: var(--spacing-02, 2px);
83
+ pointer-events: none;
84
+ }
85
+
86
+ .tds-tab--state-disabled {
87
+ background-color: var(--interactive-disabled-b, #bfbfbf);
88
+ color: var(--interactive-disabled-a, #d9d9d9);
89
+ cursor: not-allowed;
90
+ }
91
+
92
+ .tds-tab--active-true {
93
+ border-bottom-color: var(--tds-tab-selected-border);
94
+ }
95
+
96
+ .tds-tab--active-false {
97
+ border-bottom-color: transparent;
98
+ }
99
+
100
+ .tds-tab--size-medium {
101
+ min-height: var(--spacing-17, 40px);
102
+ padding: 0 var(--spacing-07);
103
+ font-size: var(--fontSize030, 1rem);
104
+ line-height: var(--fontLineHeight020, 1.125);
105
+ }
106
+
107
+ .tds-tab--size-large {
108
+ min-height: var(--spacing-18, 48px);
109
+ padding: 0 var(--spacing-09);
110
+ font-size: var(--fontSize040, 1.125rem);
111
+ line-height: var(--fontLineHeight020, 1.125);
112
+ }
113
+
114
+ .tds-tab__label {
115
+ display: inline-flex;
116
+ align-items: center;
117
+ justify-content: center;
118
+ }
119
+
120
+ .tds-tab__icon {
121
+ display: inline-flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ color: var(--tds-tab-icon);
125
+ }
126
+
127
+ .tds-tab:hover:not(:disabled) .tds-tab__icon,
128
+ .tds-tab:focus-visible .tds-tab__icon,
129
+ .tds-tab--state-hover:not(:disabled) .tds-tab__icon,
130
+ .tds-tab--state-focus:not(:disabled) .tds-tab__icon {
131
+ color: var(--tds-tab-icon-hover);
132
+ }
133
+
134
+ .tds-tab:active:not(:disabled) .tds-tab__icon,
135
+ .tds-tab--state-pressed:not(:disabled) .tds-tab__icon {
136
+ color: var(--tds-tab-icon-pressed);
137
+ }
138
+
139
+ .tds-tab:disabled .tds-tab__icon,
140
+ .tds-tab--state-disabled .tds-tab__icon {
141
+ color: var(--interactive-disabled-a, #d9d9d9);
15
142
  }
16
143
 
17
- .tds-tab--focus {
18
- /* TODO: Add focus state styles */
144
+ .tds-tab--size-medium .tds-tab__icon {
145
+ width: var(--spacing-09, 16px);
146
+ height: var(--spacing-09, 16px);
19
147
  }
20
148
 
21
- .tds-tab--disabled {
22
- /* TODO: Add disabled state styles */
149
+ .tds-tab--size-large .tds-tab__icon {
150
+ width: var(--spacing-11, 20px);
151
+ height: var(--spacing-11, 20px);
23
152
  }
@@ -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
  }
@@ -39,5 +39,7 @@
39
39
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
40
40
  }
41
41
  },
42
- "example": {}
42
+ "example": {},
43
+ "script": "times-design-system",
44
+ "editorScript": "times-design-system"
43
45
  }
@@ -46,5 +46,7 @@
46
46
  "description": "Custom data-* attributes for extensibility (allowlisted server-side)"
47
47
  }
48
48
  },
49
- "example": {}
49
+ "example": {},
50
+ "script": "times-design-system",
51
+ "editorScript": "times-design-system"
50
52
  }
@@ -1,17 +1,13 @@
1
1
  /* Toast Block Frontend Styles */
2
- /* Using resolved design token values for self-contained styling */
2
+ /* Using design tokens for self-contained styling */
3
3
 
4
4
  .tds-toast {
5
- --tds-toast-fill: #22724f;
6
- --tds-toast-text: #ffffff;
7
- --tds-toast-link: #ffffff;
8
-
9
5
  display: inline-flex;
10
6
  align-items: center;
11
- gap: 12px;
7
+ gap: var(--spacing-07);
12
8
  width: 373px;
13
- min-height: 48px;
14
- padding: 12px 16px;
9
+ min-height: var(--spacing-18);
10
+ padding: var(--spacing-07) var(--spacing-09);
15
11
  border-radius: 4px;
16
12
  background: var(--tds-toast-fill);
17
13
  color: var(--tds-toast-text);
@@ -19,49 +15,54 @@
19
15
  box-sizing: border-box;
20
16
  }
21
17
 
22
- .tds-toast__content {
23
- flex: 1 1 auto;
24
- min-width: 0;
18
+ .tds-toast__icon {
19
+ display: inline-flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ flex: 0 0 auto;
23
+ color: var(--tds-toast-text);
25
24
  }
26
25
 
27
26
  .tds-toast__label {
28
- font-family: Roboto;
29
- font-size: 1.6rem;
30
- line-height: 1.5;
31
- font-weight: 400;
27
+ flex: 1 1 auto;
28
+ min-width: 0;
29
+ font-family: var(--fontFamily040, sans-serif);
30
+ font-size: var(--fontSize030, 1rem);
31
+ line-height: var(--fontLineHeight040, 1.5);
32
+ font-weight: var(--fontWeight040, 400);
32
33
  }
33
34
 
34
35
  .tds-toast__link {
35
36
  flex: 0 0 auto;
36
- font-family: Roboto;
37
- font-size: 1.6rem;
38
- line-height: 1.5;
39
- font-weight: 700;
37
+ font-family: var(--fontFamily040, sans-serif);
38
+ font-size: var(--fontSize030, 1rem);
39
+ line-height: var(--fontLineHeight040, 1.5);
40
+ font-weight: var(--fontWeight070, 700);
40
41
  text-decoration: underline;
41
42
  color: var(--tds-toast-link);
42
43
  cursor: pointer;
43
44
  }
44
45
 
45
46
  .tds-toast--intent-success {
46
- --tds-toast-fill: #22724f;
47
- --tds-toast-text: #ffffff;
48
- --tds-toast-link: #ffffff;
47
+ --tds-toast-fill: var(--toast-fill-success, #22724f);
48
+ --tds-toast-text: var(--toast-text-success, #ffffff);
49
+ --tds-toast-link: var(--toast-link-success-default, #ffffff);
49
50
  }
50
51
 
51
52
  .tds-toast--intent-info {
52
- --tds-toast-fill: #0a3472;
53
- --tds-toast-text: #ffffff;
54
- --tds-toast-link: #ffffff;
53
+ --tds-toast-fill: var(--toast-fill-info, #0a3472);
54
+ --tds-toast-text: var(--toast-text-info, #ffffff);
55
+ --tds-toast-link: var(--toast-link-info-default, #ffffff);
55
56
  }
56
57
 
57
58
  .tds-toast--intent-warning {
58
- --tds-toast-fill: #e49307;
59
- --tds-toast-text: #000000;
60
- --tds-toast-link: #000000;
59
+ --tds-toast-fill: var(--toast-fill-warning, #e49307);
60
+ --tds-toast-text: var(--toast-text-warning, #000000);
61
+ --tds-toast-link: var(--toast-link-warning-default, #000000);
61
62
  }
62
63
 
63
64
  .tds-toast--intent-error {
64
- --tds-toast-fill: #cb0705;
65
- --tds-toast-text: #ffffff;
66
- --tds-toast-link: #ffffff;
65
+ --tds-toast-fill: var(--toast-fill-error, #cb0705);
66
+ --tds-toast-text: var(--toast-text-error, #ffffff);
67
+ --tds-toast-link: var(--toast-link-error-default, #ffffff);
67
68
  }
@@ -0,0 +1,39 @@
1
+ <?php
2
+ /**
3
+ * Icon Rendering Utility
4
+ *
5
+ * Renders icon SVG markup from icon names.
6
+ *
7
+ * @package TimesDesignSystem\ComponentsWordPress
8
+ */
9
+
10
+ if (!function_exists('tds_render_icon')) {
11
+ /**
12
+ * Render an icon by name with size and variant support
13
+ *
14
+ * @param string $icon Icon identifier (e.g., 'filled_search', 'outline_close')
15
+ * @param string $size Icon size: 'small', 'medium', 'large'
16
+ * @return string SVG markup for the icon
17
+ */
18
+ function tds_render_icon($icon, $size = 'medium') {
19
+ if (!$icon) {
20
+ return '';
21
+ }
22
+
23
+ // Sanitize icon name
24
+ $icon = sanitize_text_field($icon);
25
+ $size = sanitize_text_field($size);
26
+
27
+ // Build SVG class list
28
+ $classes = ['tds-icon', 'tds-icon--' . $size];
29
+
30
+ // Return SVG use reference
31
+ // In production, this would use an actual icon library
32
+ // For static preview purposes, return a simple SVG placeholder
33
+ return sprintf(
34
+ '<svg class="%s" aria-hidden="true"><use href="#icon-%s"></use></svg>',
35
+ esc_attr(implode(' ', $classes)),
36
+ esc_attr($icon)
37
+ );
38
+ }
39
+ }
@@ -0,0 +1,37 @@
1
+ <?php
2
+ /**
3
+ * Data Attributes Sanitization Utility
4
+ *
5
+ * Sanitizes and prepares data-* attributes for blocks.
6
+ *
7
+ * @package TimesDesignSystem\ComponentsWordPress
8
+ */
9
+
10
+ if (!function_exists('tds_sanitize_data_attributes')) {
11
+ /**
12
+ * Sanitize data-* attributes for a block
13
+ *
14
+ * @param array $attributes Data attributes to sanitize
15
+ * @param string $block_name Name of the block
16
+ * @param array $full_attributes Full block attributes array
17
+ * @return array Sanitized data attributes
18
+ */
19
+ function tds_sanitize_data_attributes($attributes = [], $block_name = '', $full_attributes = []) {
20
+ if (!is_array($attributes)) {
21
+ return [];
22
+ }
23
+
24
+ $sanitized = [];
25
+ foreach ($attributes as $key => $value) {
26
+ // Sanitize the key and value
27
+ $safe_key = 'data-' . sanitize_html_class($key);
28
+ $safe_value = sanitize_text_field($value);
29
+
30
+ if ($safe_key && $safe_value) {
31
+ $sanitized[$safe_key] = $safe_value;
32
+ }
33
+ }
34
+
35
+ return $sanitized;
36
+ }
37
+ }