@times-design-system/components-wordpress 1.13.0 → 1.16.1-alpha.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.
- package/dist/STYLE_HANDLES.md +3 -1
- package/dist/blocks/ad-container/block.json +5 -0
- package/dist/blocks/ad-container/render.php +10 -1
- package/dist/blocks/ad-container/style.css +1 -1
- package/dist/blocks/ad-container/style.scss +4 -3
- package/dist/blocks/button/block.json +5 -0
- package/dist/blocks/button/init.js +1 -1
- package/dist/blocks/button/render.php +12 -2
- package/dist/blocks/button/style.css +1 -1
- package/dist/blocks/button/style.scss +33 -33
- package/dist/blocks/chip/block.json +15 -0
- package/dist/blocks/chip/render.php +54 -21
- package/dist/blocks/chip/style.css +1 -1
- package/dist/blocks/chip/style.scss +137 -77
- package/dist/blocks/dialog-box/block.json +5 -0
- package/dist/blocks/dialog-box/render.php +9 -1
- package/dist/blocks/dialog-box/style.css +1 -1
- package/dist/blocks/dialog-box/style.scss +8 -6
- package/dist/blocks/divider/block.json +21 -1
- package/dist/blocks/divider/render.php +9 -1
- package/dist/blocks/divider/style.css +1 -1
- package/dist/blocks/divider/style.scss +5 -4
- package/dist/blocks/icon/block.json +5 -0
- package/dist/blocks/icon/render.php +10 -12
- package/dist/blocks/icon/style.css +1 -1
- package/dist/blocks/icon/style.scss +5 -1
- package/dist/blocks/icon-button/block.json +5 -0
- package/dist/blocks/icon-button/render.php +16 -6
- package/dist/blocks/icon-button/style.css +1 -1
- package/dist/blocks/icon-button/style.scss +34 -33
- package/dist/blocks/input/block.json +5 -0
- package/dist/blocks/input/render.php +10 -1
- package/dist/blocks/input/style.css +1 -1
- package/dist/blocks/input/style.scss +16 -14
- package/dist/blocks/input-helper-message/block.json +5 -0
- package/dist/blocks/input-helper-message/render.php +9 -1
- package/dist/blocks/input-helper-message/style.css +1 -1
- package/dist/blocks/input-helper-message/style.scss +7 -6
- package/dist/blocks/label/block.json +68 -0
- package/dist/blocks/label/edit.js +79 -0
- package/dist/blocks/label/index.js +11 -0
- package/dist/blocks/label/render.php +56 -0
- package/dist/blocks/label/save.js +21 -0
- package/dist/blocks/label/style.css +1 -0
- package/dist/blocks/label/style.scss +39 -0
- package/dist/blocks/link/block.json +5 -0
- package/dist/blocks/link/render.php +3 -1
- package/dist/blocks/link/style.css +1 -1
- package/dist/blocks/link/style.scss +20 -19
- package/dist/blocks/tab/block.json +5 -0
- package/dist/blocks/tab/render.php +9 -1
- package/dist/blocks/tab/style.css +1 -1
- package/dist/blocks/tab/style.scss +17 -16
- package/dist/blocks/tab-group/block.json +5 -0
- package/dist/blocks/tab-group/render.php +9 -1
- package/dist/blocks/tab-group/style.css +1 -1
- package/dist/blocks/tab-group/style.scss +4 -2
- package/dist/blocks/tag/block.json +5 -0
- package/dist/blocks/tag/render.php +10 -1
- package/dist/blocks/tag/style.css +1 -1
- package/dist/blocks/tag/style.scss +24 -26
- package/dist/blocks/text/block.json +5 -0
- package/dist/blocks/text/render.php +9 -1
- package/dist/blocks/text/style.scss +1 -1
- package/dist/blocks/toast/block.json +5 -0
- package/dist/blocks/toast/render.php +10 -1
- package/dist/blocks/toast/style.css +1 -1
- package/dist/blocks/toast/style.scss +14 -13
- package/dist/icon-data.json +1 -1
- package/dist/index.cjs +485 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +485 -177
- package/dist/index.js.map +1 -1
- package/dist/plugin.php +1 -0
- package/dist/style-handles.json +5 -0
- package/dist/utils/render-icon.php +129 -117
- package/dist/utils/sanitize-aria-attributes.php +109 -0
- package/package.json +4 -4
- package/plugin.php +1 -0
- package/dist/blocks/utils/render-icon.php +0 -106
- package/dist/blocks/utils/sanitize-data-attributes.php +0 -37
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
/* Uses SCSS variables from @times-design-system/theme-scss */
|
|
3
3
|
/* Icon buttons inherit base button styles for colors, intents, etc. */
|
|
4
4
|
|
|
5
|
-
@import '@times-design-system/theme-scss/src/
|
|
5
|
+
@import '@times-design-system/theme-scss/src/theme-classes.scss';
|
|
6
|
+
@import '@times-design-system/theme-scss/src/theme-apply.scss';
|
|
6
7
|
@import '@times-design-system/theme-scss/src/tds-layout.scss';
|
|
7
8
|
|
|
8
9
|
/* Icon button base styling - applies button variables and states */
|
|
9
10
|
.tds-icon-button {
|
|
10
|
-
--tds-button-bg:
|
|
11
|
-
--tds-button-fg:
|
|
11
|
+
--tds-button-bg: var(--interactive-primary-fill-default);
|
|
12
|
+
--tds-button-fg: var(--interactive-primary-text-default);
|
|
12
13
|
--tds-button-border: transparent;
|
|
13
|
-
--tds-button-bg-hover:
|
|
14
|
-
--tds-button-fg-hover:
|
|
14
|
+
--tds-button-bg-hover: var(--interactive-primary-fill-hover);
|
|
15
|
+
--tds-button-fg-hover: var(--interactive-primary-text-hover);
|
|
15
16
|
--tds-button-border-hover: transparent;
|
|
16
|
-
--tds-button-bg-pressed:
|
|
17
|
-
--tds-button-fg-pressed:
|
|
17
|
+
--tds-button-bg-pressed: var(--interactive-primary-fill-pressed);
|
|
18
|
+
--tds-button-fg-pressed: var(--interactive-primary-text-pressed);
|
|
18
19
|
--tds-button-border-pressed: transparent;
|
|
19
20
|
--tds-button-border-focus: transparent;
|
|
20
|
-
--tds-button-focus-ring:
|
|
21
|
+
--tds-button-focus-ring: var(--text-tertiary);
|
|
21
22
|
|
|
22
23
|
position: relative;
|
|
23
24
|
display: flex;
|
|
@@ -88,40 +89,40 @@
|
|
|
88
89
|
|
|
89
90
|
/* Intent variants - shared with button block */
|
|
90
91
|
.tds-button--intent-primary {
|
|
91
|
-
--tds-button-bg:
|
|
92
|
-
--tds-button-fg:
|
|
92
|
+
--tds-button-bg: var(--interactive-primary-fill-default);
|
|
93
|
+
--tds-button-fg: var(--interactive-primary-text-default);
|
|
93
94
|
--tds-button-border: transparent;
|
|
94
|
-
--tds-button-bg-hover:
|
|
95
|
-
--tds-button-fg-hover:
|
|
95
|
+
--tds-button-bg-hover: var(--interactive-primary-fill-hover);
|
|
96
|
+
--tds-button-fg-hover: var(--interactive-primary-text-hover);
|
|
96
97
|
--tds-button-border-hover: transparent;
|
|
97
|
-
--tds-button-bg-pressed:
|
|
98
|
-
--tds-button-fg-pressed:
|
|
98
|
+
--tds-button-bg-pressed: var(--interactive-primary-fill-pressed);
|
|
99
|
+
--tds-button-fg-pressed: var(--interactive-primary-text-pressed);
|
|
99
100
|
--tds-button-border-pressed: transparent;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
.tds-button--intent-secondary {
|
|
103
|
-
--tds-button-bg:
|
|
104
|
-
--tds-button-fg:
|
|
105
|
-
--tds-button-border:
|
|
106
|
-
--tds-button-bg-hover:
|
|
107
|
-
--tds-button-fg-hover:
|
|
108
|
-
--tds-button-border-hover:
|
|
109
|
-
--tds-button-bg-pressed:
|
|
110
|
-
--tds-button-fg-pressed:
|
|
111
|
-
--tds-button-border-pressed:
|
|
112
|
-
--tds-button-border-focus:
|
|
104
|
+
--tds-button-bg: var(--interactive-secondary-fill-default);
|
|
105
|
+
--tds-button-fg: var(--interactive-secondary-text-default);
|
|
106
|
+
--tds-button-border: var(--interactive-secondary-border-default);
|
|
107
|
+
--tds-button-bg-hover: var(--interactive-secondary-fill-hover);
|
|
108
|
+
--tds-button-fg-hover: var(--interactive-secondary-text-hover);
|
|
109
|
+
--tds-button-border-hover: var(--interactive-secondary-border-hover);
|
|
110
|
+
--tds-button-bg-pressed: var(--interactive-secondary-fill-pressed);
|
|
111
|
+
--tds-button-fg-pressed: var(--interactive-secondary-text-pressed);
|
|
112
|
+
--tds-button-border-pressed: var(--interactive-secondary-border-pressed);
|
|
113
|
+
--tds-button-border-focus: var(--interactive-secondary-border-default);
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
.tds-button--intent-negative {
|
|
116
|
-
--tds-button-bg:
|
|
117
|
-
--tds-button-fg:
|
|
118
|
-
--tds-button-border:
|
|
119
|
-
--tds-button-bg-hover:
|
|
120
|
-
--tds-button-fg-hover:
|
|
121
|
-
--tds-button-border-hover:
|
|
122
|
-
--tds-button-bg-pressed:
|
|
123
|
-
--tds-button-fg-pressed:
|
|
124
|
-
--tds-button-border-pressed:
|
|
117
|
+
--tds-button-bg: var(--interactive-negative-fill-default);
|
|
118
|
+
--tds-button-fg: var(--interactive-negative-text-default);
|
|
119
|
+
--tds-button-border: var(--interactive-negative-border-default);
|
|
120
|
+
--tds-button-bg-hover: var(--interactive-negative-fill-hover);
|
|
121
|
+
--tds-button-fg-hover: var(--interactive-negative-text-hover);
|
|
122
|
+
--tds-button-border-hover: var(--interactive-negative-border-hover);
|
|
123
|
+
--tds-button-bg-pressed: var(--interactive-negative-fill-pressed);
|
|
124
|
+
--tds-button-fg-pressed: var(--interactive-negative-text-pressed);
|
|
125
|
+
--tds-button-border-pressed: var(--interactive-negative-border-pressed);
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
/* Icon button specific sizing */
|
|
@@ -59,6 +59,11 @@
|
|
|
59
59
|
"type": "object",
|
|
60
60
|
"default": {},
|
|
61
61
|
"description": "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
62
|
+
},
|
|
63
|
+
"ariaAttributes": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"default": {},
|
|
66
|
+
"description": "Custom aria-* attributes for extensibility (allowlisted server-side)"
|
|
62
67
|
}
|
|
63
68
|
},
|
|
64
69
|
"example": {},
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
require_once __DIR__ . '/../../utils/sanitize-data-attributes.php';
|
|
14
|
+
require_once __DIR__ . '/../../utils/sanitize-aria-attributes.php';
|
|
14
15
|
|
|
15
16
|
$label = isset($attributes['label']) ? sanitize_text_field($attributes['label']) : '';
|
|
16
17
|
$placeholder = isset($attributes['placeholder']) ? sanitize_text_field($attributes['placeholder']) : '';
|
|
@@ -28,6 +29,13 @@ foreach ($sanitized_data_attributes as $attr_name => $attr_value) {
|
|
|
28
29
|
$data_attrs_html .= ' ' . esc_attr($attr_name) . '="' . esc_attr($attr_value) . '"';
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
// Sanitize and prepare aria-* attributes
|
|
33
|
+
$sanitized_aria_attributes = tds_sanitize_aria_attributes($attributes['ariaAttributes'] ?? [], 'input', $attributes);
|
|
34
|
+
$aria_attrs_html = '';
|
|
35
|
+
foreach ($sanitized_aria_attributes as $attr_name => $attr_value) {
|
|
36
|
+
$aria_attrs_html .= ' ' . esc_attr($attr_name) . '="' . esc_attr($attr_value) . '"';
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
$input_classes = ['tds-input'];
|
|
32
40
|
if ($element_class_name) {
|
|
33
41
|
$input_classes[] = $element_class_name;
|
|
@@ -50,6 +58,7 @@ $wrapper_attrs = get_block_wrapper_attributes();
|
|
|
50
58
|
<?php echo $name ? 'name="' . esc_attr($name) . '"' : ''; ?>
|
|
51
59
|
<?php echo $id ? 'id="' . esc_attr($id) . '"' : ''; ?>
|
|
52
60
|
class="<?php echo esc_attr(implode(' ', $input_classes)); ?>"
|
|
53
|
-
<?php echo
|
|
61
|
+
<?php echo $aria_attrs_html; ?>
|
|
62
|
+
<?php echo $data_attrs_html; ?>
|
|
54
63
|
/>
|
|
55
64
|
</div>
|