@times-design-system/components-wordpress 1.9.0 → 1.11.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/blocks/ad-container/block.json +1 -0
- package/dist/blocks/ad-container/style.css +1 -30
- package/dist/blocks/ad-container/style.scss +70 -0
- package/dist/blocks/button/block.json +68 -1
- package/dist/blocks/button/init.js +45 -0
- package/dist/blocks/button/render.php +2 -0
- package/dist/blocks/button/style.css +1 -203
- package/dist/blocks/button/style.scss +204 -0
- package/dist/blocks/chip/ONCLICK_USAGE.md +263 -0
- package/dist/blocks/chip/block.json +23 -3
- package/dist/blocks/chip/init.js +60 -0
- package/dist/blocks/chip/render.php +7 -2
- package/dist/blocks/chip/style.css +1 -108
- package/dist/blocks/chip/style.scss +213 -0
- package/dist/blocks/dialog-box/block.json +1 -0
- package/dist/blocks/dialog-box/style.css +1 -23
- package/dist/blocks/dialog-box/style.scss +113 -0
- package/dist/blocks/divider/block.json +1 -0
- package/dist/blocks/divider/style.css +1 -37
- package/dist/blocks/divider/style.scss +40 -0
- package/dist/blocks/icon/block.json +11 -1
- package/dist/blocks/icon/style.css +1 -23
- package/dist/blocks/icon/style.scss +10 -0
- package/dist/blocks/icon-button/block.json +42 -0
- package/dist/blocks/icon-button/init.js +56 -0
- package/dist/blocks/icon-button/render.php +5 -0
- package/dist/blocks/icon-button/style.css +1 -66
- package/dist/blocks/icon-button/style.scss +189 -0
- package/dist/blocks/input/block.json +1 -0
- package/dist/blocks/input/style.css +1 -67
- package/dist/blocks/input/style.scss +72 -0
- package/dist/blocks/input-helper-message/block.json +1 -0
- package/dist/blocks/input-helper-message/style.css +1 -23
- package/dist/blocks/input-helper-message/style.scss +45 -0
- package/dist/blocks/link/block.json +87 -3
- package/dist/blocks/link/init.js +54 -0
- package/dist/blocks/link/render.php +22 -12
- package/dist/blocks/link/style.css +1 -221
- package/dist/blocks/link/style.scss +163 -0
- package/dist/blocks/tab/block.json +1 -0
- package/dist/blocks/tab/style.css +1 -152
- package/dist/blocks/tab/style.scss +159 -0
- package/dist/blocks/tab-group/block.json +1 -0
- package/dist/blocks/tab-group/style.css +1 -23
- package/dist/blocks/tab-group/style.scss +32 -0
- package/dist/blocks/{flag → tag}/block.json +47 -14
- package/dist/blocks/{flag → tag}/edit.js +9 -20
- package/dist/blocks/{flag → tag}/index.js +2 -2
- package/dist/blocks/{flag → tag}/render.php +24 -19
- package/dist/blocks/tag/save.js +23 -0
- package/dist/blocks/{chip → tag}/style-editor.css +2 -2
- package/dist/blocks/tag/style.css +1 -0
- package/dist/blocks/tag/style.scss +115 -0
- package/dist/blocks/text/block.json +1 -0
- package/dist/blocks/text/style.css +1 -7
- package/dist/blocks/text/style.scss +11 -0
- package/dist/blocks/toast/block.json +1 -0
- package/dist/blocks/toast/style.css +1 -68
- package/dist/blocks/toast/style.scss +67 -0
- package/dist/blocks/utils/render-icon.php +72 -5
- package/dist/icon-data.json +1 -1
- package/dist/index.cjs +421 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +421 -54
- package/dist/index.js.map +1 -1
- package/dist/plugin.php +42 -0
- package/dist/utils/render-icon.php +11 -2
- package/package.json +6 -4
- package/plugin.php +42 -0
- package/dist/blocks/flag/save.js +0 -25
- package/dist/blocks/flag/style-editor.css +0 -5
- package/dist/blocks/flag/style.css +0 -72
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/* Chip Block Frontend Styles */
|
|
2
|
+
/* Uses SCSS variables from @times-design-system/theme-scss */
|
|
3
|
+
/* Synchronized with packages/components-react/src/Chip/styles.css */
|
|
4
|
+
|
|
5
|
+
@import '@times-design-system/theme-scss/src/palettes/core-light.scss';
|
|
6
|
+
@import '@times-design-system/theme-scss/src/tds-layout.scss';
|
|
7
|
+
@import '@times-design-system/theme-scss/src/tds-typography.scss';
|
|
8
|
+
|
|
9
|
+
.tds-chip {
|
|
10
|
+
--tds-chip-bg: #{$interactive-chip-primary-on-fill-default};
|
|
11
|
+
--tds-chip-bg-hover: #{$interactive-chip-primary-on-fill-hover};
|
|
12
|
+
--tds-chip-bg-pressed: #{$interactive-chip-primary-on-fill-pressed};
|
|
13
|
+
--tds-chip-fg: #{$interactive-chip-primary-on-text-default};
|
|
14
|
+
--tds-chip-fg-hover: #{$interactive-chip-primary-on-text-hover};
|
|
15
|
+
--tds-chip-fg-pressed: #{$interactive-chip-primary-on-text-pressed};
|
|
16
|
+
--tds-chip-icon: #{$interactive-chip-primary-on-icon-default};
|
|
17
|
+
--tds-chip-icon-hover: #{$interactive-chip-primary-on-icon-hover};
|
|
18
|
+
--tds-chip-icon-pressed: #{$interactive-chip-primary-on-icon-pressed};
|
|
19
|
+
--tds-chip-border: transparent;
|
|
20
|
+
--tds-chip-border-hover: transparent;
|
|
21
|
+
--tds-chip-border-pressed: transparent;
|
|
22
|
+
--tds-chip-focus-ring: #{$text-tertiary};
|
|
23
|
+
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
gap: $spacing-03;
|
|
29
|
+
border: 1px solid var(--tds-chip-border);
|
|
30
|
+
border-radius: $border-radius-full;
|
|
31
|
+
background-color: var(--tds-chip-bg);
|
|
32
|
+
color: var(--tds-chip-fg);
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition:
|
|
36
|
+
background-color 0.15s ease,
|
|
37
|
+
border-color 0.15s ease,
|
|
38
|
+
color 0.15s ease,
|
|
39
|
+
box-shadow 0.15s ease;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tds-chip:hover:not(:disabled) {
|
|
43
|
+
background-color: var(--tds-chip-bg-hover);
|
|
44
|
+
border-color: var(--tds-chip-border-hover);
|
|
45
|
+
color: var(--tds-chip-fg-hover);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.tds-chip:active:not(:disabled) {
|
|
49
|
+
background-color: var(--tds-chip-bg-pressed);
|
|
50
|
+
border-color: var(--tds-chip-border-pressed);
|
|
51
|
+
color: var(--tds-chip-fg-pressed);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tds-chip:focus-visible {
|
|
55
|
+
outline: none;
|
|
56
|
+
background-color: var(--tds-chip-bg-hover);
|
|
57
|
+
border-color: var(--tds-chip-border-hover);
|
|
58
|
+
color: var(--tds-chip-fg-hover);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.tds-chip:focus-visible::after {
|
|
62
|
+
content: '';
|
|
63
|
+
position: absolute;
|
|
64
|
+
inset: calc(#{$spacing-03} * -1);
|
|
65
|
+
border: $spacing-01 solid var(--tds-chip-focus-ring);
|
|
66
|
+
border-radius: inherit;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.tds-chip:disabled {
|
|
71
|
+
background-color: $interactive-disabled-b;
|
|
72
|
+
border-color: transparent;
|
|
73
|
+
color: $interactive-disabled-a;
|
|
74
|
+
cursor: not-allowed;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.tds-chip--size-small {
|
|
78
|
+
min-height: $spacing-16;
|
|
79
|
+
padding: 0 $spacing-07;
|
|
80
|
+
|
|
81
|
+
.tds-chip__label {
|
|
82
|
+
@include utility-button-small;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tds-chip__icon {
|
|
86
|
+
width: $spacing-09;
|
|
87
|
+
height: $spacing-09;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.tds-chip--size-large {
|
|
92
|
+
min-height: $spacing-18;
|
|
93
|
+
padding: 0 $spacing-09;
|
|
94
|
+
|
|
95
|
+
.tds-chip__label {
|
|
96
|
+
@include utility-button-large;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.tds-chip__icon {
|
|
100
|
+
width: $spacing-11;
|
|
101
|
+
height: $spacing-11;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.tds-chip__label {
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.tds-chip__icon {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
color: var(--tds-chip-icon);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.tds-chip:hover:not(:disabled) .tds-chip__icon,
|
|
119
|
+
.tds-chip:focus-visible .tds-chip__icon {
|
|
120
|
+
color: var(--tds-chip-icon-hover);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.tds-chip:active:not(:disabled) .tds-chip__icon {
|
|
124
|
+
color: var(--tds-chip-icon-pressed);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.tds-chip:disabled .tds-chip__icon {
|
|
128
|
+
color: $interactive-disabled-a;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Intent: Primary, Toggle: On (default) */
|
|
132
|
+
.tds-chip--intent-primary.tds-chip--toggle-on {
|
|
133
|
+
--tds-chip-bg: #{$interactive-chip-primary-on-fill-default};
|
|
134
|
+
--tds-chip-bg-hover: #{$interactive-chip-primary-on-fill-hover};
|
|
135
|
+
--tds-chip-bg-pressed: #{$interactive-chip-primary-on-fill-pressed};
|
|
136
|
+
--tds-chip-fg: #{$interactive-chip-primary-on-text-default};
|
|
137
|
+
--tds-chip-fg-hover: #{$interactive-chip-primary-on-text-hover};
|
|
138
|
+
--tds-chip-fg-pressed: #{$interactive-chip-primary-on-text-pressed};
|
|
139
|
+
--tds-chip-icon: #{$interactive-chip-primary-on-icon-default};
|
|
140
|
+
--tds-chip-icon-hover: #{$interactive-chip-primary-on-icon-hover};
|
|
141
|
+
--tds-chip-icon-pressed: #{$interactive-chip-primary-on-icon-pressed};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Intent: Primary, Toggle: Off */
|
|
145
|
+
.tds-chip--intent-primary.tds-chip--toggle-off {
|
|
146
|
+
--tds-chip-bg: #{$interactive-chip-primary-off-fill-default};
|
|
147
|
+
--tds-chip-bg-hover: #{$interactive-chip-primary-off-fill-hover};
|
|
148
|
+
--tds-chip-bg-pressed: #{$interactive-chip-primary-off-fill-pressed};
|
|
149
|
+
--tds-chip-fg: #{$interactive-chip-primary-off-text-default};
|
|
150
|
+
--tds-chip-fg-hover: #{$interactive-chip-primary-off-text-hover};
|
|
151
|
+
--tds-chip-fg-pressed: #{$interactive-chip-primary-off-text-pressed};
|
|
152
|
+
--tds-chip-icon: #{$interactive-chip-primary-off-icon-default};
|
|
153
|
+
--tds-chip-icon-hover: #{$interactive-chip-primary-off-icon-hover};
|
|
154
|
+
--tds-chip-icon-pressed: #{$interactive-chip-primary-off-icon-pressed};
|
|
155
|
+
--tds-chip-border: #{$interactive-chip-primary-off-border-default};
|
|
156
|
+
--tds-chip-border-hover: #{$interactive-chip-primary-off-border-hover};
|
|
157
|
+
--tds-chip-border-pressed: #{$interactive-chip-primary-off-border-pressed};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Intent: Secondary, Toggle: On */
|
|
161
|
+
.tds-chip--intent-secondary.tds-chip--toggle-on {
|
|
162
|
+
--tds-chip-bg: #{$interactive-chip-secondary-on-fill-default};
|
|
163
|
+
--tds-chip-bg-hover: #{$interactive-chip-secondary-on-fill-hover};
|
|
164
|
+
--tds-chip-bg-pressed: #{$interactive-chip-secondary-on-fill-pressed};
|
|
165
|
+
--tds-chip-fg: #{$interactive-chip-secondary-on-text-default};
|
|
166
|
+
--tds-chip-fg-hover: #{$interactive-chip-secondary-on-text-hover};
|
|
167
|
+
--tds-chip-fg-pressed: #{$interactive-chip-secondary-on-text-pressed};
|
|
168
|
+
--tds-chip-icon: #{$interactive-chip-secondary-on-icon-default};
|
|
169
|
+
--tds-chip-icon-hover: #{$interactive-chip-secondary-on-icon-hover};
|
|
170
|
+
--tds-chip-icon-pressed: #{$interactive-chip-secondary-on-icon-pressed};
|
|
171
|
+
--tds-chip-border: #{$interactive-chip-secondary-on-border-default};
|
|
172
|
+
--tds-chip-border-hover: #{$interactive-chip-secondary-on-border-hover};
|
|
173
|
+
--tds-chip-border-pressed: #{$interactive-chip-secondary-on-border-pressed};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Intent: Secondary, Toggle: Off */
|
|
177
|
+
.tds-chip--intent-secondary.tds-chip--toggle-off {
|
|
178
|
+
--tds-chip-bg: #{$interactive-chip-secondary-off-fill-default};
|
|
179
|
+
--tds-chip-bg-hover: #{$interactive-chip-secondary-off-fill-hover};
|
|
180
|
+
--tds-chip-bg-pressed: #{$interactive-chip-secondary-off-fill-pressed};
|
|
181
|
+
--tds-chip-fg: #{$interactive-chip-secondary-off-text-default};
|
|
182
|
+
--tds-chip-fg-hover: #{$interactive-chip-secondary-off-text-hover};
|
|
183
|
+
--tds-chip-fg-pressed: #{$interactive-chip-secondary-off-text-pressed};
|
|
184
|
+
--tds-chip-icon: #{$interactive-chip-secondary-off-icon-default};
|
|
185
|
+
--tds-chip-icon-hover: #{$interactive-chip-secondary-off-icon-hover};
|
|
186
|
+
--tds-chip-icon-pressed: #{$interactive-chip-secondary-off-icon-pressed};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* Channel: True (for filtering), Toggle: On */
|
|
190
|
+
.tds-chip--channel-true.tds-chip--toggle-on {
|
|
191
|
+
--tds-chip-bg: #{$text-secondary};
|
|
192
|
+
--tds-chip-bg-hover: #{$text-secondary};
|
|
193
|
+
--tds-chip-bg-pressed: #{$text-secondary};
|
|
194
|
+
--tds-chip-fg: #{$surface-level-1};
|
|
195
|
+
--tds-chip-fg-hover: #{$surface-channel-100};
|
|
196
|
+
--tds-chip-fg-pressed: #{$surface-channel-100};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Channel: Secondary, Toggle: On */
|
|
200
|
+
.tds-chip--channel-secondary.tds-chip--toggle-on {
|
|
201
|
+
--tds-chip-bg: #{$surface-level-1};
|
|
202
|
+
--tds-chip-bg-hover: #{$surface-channel-100};
|
|
203
|
+
--tds-chip-bg-pressed: #{$surface-channel-100};
|
|
204
|
+
--tds-chip-fg: #{$text-secondary};
|
|
205
|
+
--tds-chip-fg-hover: #{$text-primary};
|
|
206
|
+
--tds-chip-fg-pressed: #{$text-primary};
|
|
207
|
+
--tds-chip-icon: #{$text-secondary};
|
|
208
|
+
--tds-chip-icon-hover: #{$text-primary};
|
|
209
|
+
--tds-chip-icon-pressed: #{$text-primary};
|
|
210
|
+
--tds-chip-border: #{$text-secondary};
|
|
211
|
+
--tds-chip-border-hover: #{$text-secondary};
|
|
212
|
+
--tds-chip-border-pressed: #{$text-secondary};
|
|
213
|
+
}
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Styles for DialogBox Block
|
|
3
|
-
*
|
|
4
|
-
* Reference: packages/components-react/src/DialogBox/
|
|
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-dialog-box--{modifier}
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
.tds-dialog-box {
|
|
14
|
-
/* TODO: Add component styles here */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tds-dialog-box--focus {
|
|
18
|
-
/* TODO: Add focus state styles */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.tds-dialog-box--disabled {
|
|
22
|
-
/* TODO: Add disabled state styles */
|
|
23
|
-
}
|
|
1
|
+
.tds-grid{display:grid;grid-template-columns:repeat(4, 1fr);grid-gap:24px;margin-inline:20px;max-width:100%}@media(min-width: 720px){.tds-grid{grid-template-columns:repeat(12, 1fr);grid-gap:32px;margin-inline:24px;max-width:720px}}@media(min-width: 976px){.tds-grid{max-width:976px}}@media(min-width: 1096px){.tds-grid{max-width:1096px}}.tds-grid.tds-grid--full-width{max-width:100%}:root{--font-size0025: 0.5rem;--font-size005: 0.625rem;--font-size010: 0.75rem;--font-size020: 0.875rem;--font-size025: 0.9375rem;--font-size030: 1rem;--font-size035: 1.0625rem;--font-size040: 1.125rem;--font-size045: 1.1875rem;--font-size050: 1.25rem;--font-size060: 1.375rem;--font-size070: 1.5rem;--font-size080: 1.75rem;--font-size090: 2rem;--font-size095: 2.125rem;--font-size100: 2.25rem;--font-size105: 2.875rem;--font-size110: 2rem;--font-size120: 2.75rem;--font-size125: 2.8125rem;--font-size130: 3rem;--font-size140: 2.5rem;--font-size150: 4rem;--font-size155: 4.375rem;--font-size160: 5rem}@media(min-width: 440px){:root{--font-size090: 3rem;--font-size100: 2.5rem}}@media(min-width: 1024px){:root{--font-size100: 2.875rem}}@media(min-width: 1440px){:root{--font-size090: 3.25rem;--font-size100: 3.5rem;--font-size110: 2.5rem;--font-size140: 3.5rem}}.tds-dialog-box{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:20px;box-sizing:border-box;background:rgba(0,0,0,.45);width:100%;height:100%;color:#1a1a1a}.tds-dialog-box--no-overlay{background:rgba(0,0,0,0)}.tds-dialog-box__overlay{position:absolute;width:100%;height:100%}.tds-dialog-box__surface{position:relative;display:flex;flex-direction:column;width:100%;max-width:var(--tds-dialog-box-surface-width, 353px);max-height:min(85vh,720px);background:#fff;border-radius:4px;outline:none;overflow:hidden;padding-top:8px;padding-bottom:16px;box-sizing:border-box}.tds-dialog-box__header{display:flex;align-items:center;gap:8px;padding-inline:16px;padding-bottom:8px}.tds-dialog-box__title{flex:1 1 auto;margin:0}.tds-dialog-box__dismiss{flex:0 0 auto;margin-left:8px;width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:rgba(0,0,0,0);cursor:pointer;border-radius:4px}.tds-dialog-box__dismiss:hover{background:#fff}.tds-dialog-box__dismiss:focus-visible{outline:2px solid #1a1a1a;outline-offset:-2px}.tds-dialog-box__dismiss>svg{width:24px;height:24px;display:block}.tds-dialog-box__body{flex:1 1 auto;display:flex;flex-direction:column;gap:10px;padding-inline:16px;overflow-y:auto}.tds-dialog-box__footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-inline:16px;padding-top:16px}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for DialogBox Block
|
|
3
|
+
* Uses SCSS variables from @times-design-system/theme-scss
|
|
4
|
+
*
|
|
5
|
+
* Reference: packages/components-react/src/DialogBox/
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@import '@times-design-system/theme-scss/src/palettes/core-light.scss';
|
|
9
|
+
@import '@times-design-system/theme-scss/src/tds-layout.scss';
|
|
10
|
+
@import '@times-design-system/theme-scss/src/tds-typography.scss';
|
|
11
|
+
|
|
12
|
+
.tds-dialog-box {
|
|
13
|
+
position: fixed;
|
|
14
|
+
inset: 0;
|
|
15
|
+
z-index: 1000;
|
|
16
|
+
display: none;
|
|
17
|
+
// display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
padding: $spacing-11;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
background: $surface-overlay;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
color: $text-primary;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tds-dialog-box--no-overlay {
|
|
29
|
+
background: transparent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tds-dialog-box__overlay {
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.tds-dialog-box__surface {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
width: 100%;
|
|
43
|
+
max-width: var(--tds-dialog-box-surface-width, 353px);
|
|
44
|
+
max-height: min(85vh, 720px);
|
|
45
|
+
background: $surface-level-4;
|
|
46
|
+
border-radius: $border-radius-100;
|
|
47
|
+
outline: none;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding-top: $spacing-05;
|
|
50
|
+
padding-bottom: $spacing-09;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tds-dialog-box__header {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: $spacing-05;
|
|
58
|
+
padding-inline: $spacing-09;
|
|
59
|
+
padding-bottom: $spacing-05;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tds-dialog-box__title {
|
|
63
|
+
flex: 1 1 auto;
|
|
64
|
+
margin: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tds-dialog-box__dismiss {
|
|
68
|
+
flex: 0 0 auto;
|
|
69
|
+
margin-left: $spacing-05;
|
|
70
|
+
width: $spacing-17;
|
|
71
|
+
height: $spacing-17;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
padding: 0;
|
|
76
|
+
border: none;
|
|
77
|
+
background: transparent;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
border-radius: $border-radius-100;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.tds-dialog-box__dismiss:hover {
|
|
83
|
+
background: $surface-level-3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.tds-dialog-box__dismiss:focus-visible {
|
|
87
|
+
outline: $spacing-01 solid $text-primary;
|
|
88
|
+
outline-offset: calc($spacing-01 * -1);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.tds-dialog-box__dismiss > svg {
|
|
92
|
+
width: $spacing-13;
|
|
93
|
+
height: $spacing-13;
|
|
94
|
+
display: block;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.tds-dialog-box__body {
|
|
98
|
+
flex: 1 1 auto;
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
gap: $spacing-06;
|
|
102
|
+
padding-inline: $spacing-09;
|
|
103
|
+
overflow-y: auto;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.tds-dialog-box__footer {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: flex-end;
|
|
110
|
+
gap: $spacing-05;
|
|
111
|
+
padding-inline: $spacing-09;
|
|
112
|
+
padding-top: $spacing-09;
|
|
113
|
+
}
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* Using resolved design token values for self-contained styling */
|
|
3
|
-
|
|
4
|
-
.tds-divider {
|
|
5
|
-
box-sizing: content-box;
|
|
6
|
-
border: 0;
|
|
7
|
-
border-top: 1px;
|
|
8
|
-
border-style: solid;
|
|
9
|
-
border-color: #999999;
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
height: 0;
|
|
12
|
-
width: 100%;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.tds-divider.tds-divider--dashed {
|
|
16
|
-
border-style: dashed;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* Vertical */
|
|
20
|
-
.tds-divider--vertical {
|
|
21
|
-
width: 0;
|
|
22
|
-
height: 100%;
|
|
23
|
-
align-self: stretch;
|
|
24
|
-
border-top: none;
|
|
25
|
-
border-left: 1px;
|
|
26
|
-
border-style: solid;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Padding — gutter spacing around the line */
|
|
30
|
-
.tds-divider--horizontal.tds-divider--padding {
|
|
31
|
-
margin-block: 24px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.tds-divider--vertical.tds-divider--padding {
|
|
35
|
-
margin-inline: 24px;
|
|
36
|
-
margin-block: 0;
|
|
37
|
-
}
|
|
1
|
+
.tds-grid{display:grid;grid-template-columns:repeat(4, 1fr);grid-gap:24px;margin-inline:20px;max-width:100%}@media(min-width: 720px){.tds-grid{grid-template-columns:repeat(12, 1fr);grid-gap:32px;margin-inline:24px;max-width:720px}}@media(min-width: 976px){.tds-grid{max-width:976px}}@media(min-width: 1096px){.tds-grid{max-width:1096px}}.tds-grid.tds-grid--full-width{max-width:100%}.tds-divider{box-sizing:content-box;border:0;border-top:1px;border-style:solid;border-color:#b3b3b3;flex-shrink:0;height:0;width:100%}.tds-divider.tds-divider--dashed{border-style:dashed}.tds-divider--vertical{width:0;height:100%;align-self:stretch;border-top:none;border-left:1px;border-style:solid}.tds-divider--horizontal.tds-divider--padding{margin-block:24px}.tds-divider--vertical.tds-divider--padding{margin-inline:24px;margin-block:0}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* Divider Block Frontend Styles */
|
|
2
|
+
/* Uses SCSS variables from @times-design-system/theme-scss */
|
|
3
|
+
|
|
4
|
+
@import '@times-design-system/theme-scss/src/palettes/core-light.scss';
|
|
5
|
+
@import '@times-design-system/theme-scss/src/tds-layout.scss';
|
|
6
|
+
|
|
7
|
+
.tds-divider {
|
|
8
|
+
box-sizing: content-box;
|
|
9
|
+
border: 0;
|
|
10
|
+
border-top: 1px;
|
|
11
|
+
border-style: solid;
|
|
12
|
+
border-color: $border-primary;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
height: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tds-divider.tds-divider--dashed {
|
|
19
|
+
border-style: dashed;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Vertical */
|
|
23
|
+
.tds-divider--vertical {
|
|
24
|
+
width: 0;
|
|
25
|
+
height: 100%;
|
|
26
|
+
align-self: stretch;
|
|
27
|
+
border-top: none;
|
|
28
|
+
border-left: 1px;
|
|
29
|
+
border-style: solid;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Padding — gutter spacing around the line (mirrors Figma padding=true) */
|
|
33
|
+
.tds-divider--horizontal.tds-divider--padding {
|
|
34
|
+
margin-block: $spacing-13;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tds-divider--vertical.tds-divider--padding {
|
|
38
|
+
margin-inline: $spacing-13;
|
|
39
|
+
margin-block: 0;
|
|
40
|
+
}
|
|
@@ -46,5 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"render": "file:./render.php",
|
|
48
48
|
"editorScript": "times-design-system",
|
|
49
|
-
"script": "times-design-system"
|
|
49
|
+
"script": "times-design-system",
|
|
50
|
+
"style": "file:./style.css",
|
|
51
|
+
"preview": {
|
|
52
|
+
"combinations": [
|
|
53
|
+
{ "iconName": "filled_circle", "size": "small" },
|
|
54
|
+
{ "iconName": "filled_circle", "size": "medium" },
|
|
55
|
+
{ "iconName": "filled_circle", "size": "large" },
|
|
56
|
+
{ "iconName": "outlined_check", "size": "medium" },
|
|
57
|
+
{ "iconName": "filled_arrow_right", "size": "medium" }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
50
60
|
}
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Styles for Icon Block
|
|
3
|
-
*
|
|
4
|
-
* Reference: packages/components-react/src/Icon/
|
|
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-icon--{modifier}
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
.tds-icon {
|
|
14
|
-
/* TODO: Add component styles here */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tds-icon--focus {
|
|
18
|
-
/* TODO: Add focus state styles */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.tds-icon--disabled {
|
|
22
|
-
/* TODO: Add disabled state styles */
|
|
23
|
-
}
|
|
1
|
+
.tds-grid{display:grid;grid-template-columns:repeat(4, 1fr);grid-gap:24px;margin-inline:20px;max-width:100%}@media(min-width: 720px){.tds-grid{grid-template-columns:repeat(12, 1fr);grid-gap:32px;margin-inline:24px;max-width:720px}}@media(min-width: 976px){.tds-grid{max-width:976px}}@media(min-width: 1096px){.tds-grid{max-width:1096px}}.tds-grid.tds-grid--full-width{max-width:100%}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for Icon Block
|
|
3
|
+
* Uses SCSS variables from @times-design-system/theme-scss
|
|
4
|
+
*
|
|
5
|
+
* Reference: packages/components-react/src/Icon/
|
|
6
|
+
* Icon component is primarily logic-based; minimal styling needed
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
@import '@times-design-system/theme-scss/src/palettes/core-light.scss';
|
|
10
|
+
@import '@times-design-system/theme-scss/src/tds-layout.scss';
|
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
"type": "boolean",
|
|
38
38
|
"default": false
|
|
39
39
|
},
|
|
40
|
+
"intent": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": ["primary", "secondary", "negative"],
|
|
43
|
+
"default": "primary",
|
|
44
|
+
"description": "Visual style variant matching button intents"
|
|
45
|
+
},
|
|
40
46
|
"isLoading": {
|
|
41
47
|
"type": "boolean",
|
|
42
48
|
"default": false,
|
|
@@ -68,9 +74,45 @@
|
|
|
68
74
|
"type": "object",
|
|
69
75
|
"default": {},
|
|
70
76
|
"description": "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
77
|
+
},
|
|
78
|
+
"onClick": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"default": "",
|
|
81
|
+
"description": "Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and icon button element context."
|
|
71
82
|
}
|
|
72
83
|
},
|
|
84
|
+
"preview": {
|
|
85
|
+
"combinations": [
|
|
86
|
+
{ "iconName": "filled_add", "iconSize": "medium", "intent": "primary" },
|
|
87
|
+
{ "iconName": "filled_add", "iconSize": "medium", "intent": "secondary" },
|
|
88
|
+
{ "iconName": "filled_add", "iconSize": "medium", "intent": "negative" },
|
|
89
|
+
{
|
|
90
|
+
"iconName": "filled_search",
|
|
91
|
+
"iconSize": "medium",
|
|
92
|
+
"intent": "primary"
|
|
93
|
+
},
|
|
94
|
+
{ "iconName": "filled_close", "iconSize": "small", "intent": "primary" },
|
|
95
|
+
{
|
|
96
|
+
"iconName": "filled_settings",
|
|
97
|
+
"iconSize": "large",
|
|
98
|
+
"intent": "primary"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"iconName": "filled_add",
|
|
102
|
+
"iconSize": "medium",
|
|
103
|
+
"intent": "primary",
|
|
104
|
+
"round": true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"iconName": "filled_add",
|
|
108
|
+
"iconSize": "medium",
|
|
109
|
+
"intent": "primary",
|
|
110
|
+
"onClick": "handleIconButtonClick"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
73
114
|
"example": {},
|
|
115
|
+
"style": "file:./style.css",
|
|
74
116
|
"script": "times-design-system",
|
|
75
117
|
"editorScript": "times-design-system"
|
|
76
118
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Button Block Click Handler
|
|
3
|
+
*
|
|
4
|
+
* Initializes click handlers for icon button blocks with onClick attribute.
|
|
5
|
+
* Calls custom onClick callback when icon button is clicked.
|
|
6
|
+
*
|
|
7
|
+
* @package TimesDesignSystem\ComponentsWordPress
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
(function initIconButtonClickHandlers() {
|
|
11
|
+
console.log('[TDS Icon Button] Script loaded and executing');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize click handlers for all icon button blocks
|
|
15
|
+
*/
|
|
16
|
+
function setupIconButtonHandlers() {
|
|
17
|
+
console.log('[TDS Icon Button] Setting up handlers...');
|
|
18
|
+
const iconButtons = document.querySelectorAll('.tds-icon-button');
|
|
19
|
+
console.log(`[TDS Icon Button] Found ${iconButtons.length} icon button(s)`);
|
|
20
|
+
|
|
21
|
+
if (iconButtons.length === 0) {
|
|
22
|
+
console.warn('[TDS Icon Button] No icon buttons found on page');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
iconButtons.forEach((iconButton, index) => {
|
|
27
|
+
console.log(
|
|
28
|
+
`[TDS Icon Button] Attaching listener to icon button #${index}`
|
|
29
|
+
);
|
|
30
|
+
iconButton.addEventListener('click', function handleIconButtonClick(e) {
|
|
31
|
+
console.log(`[TDS Icon Button] Icon button #${index} clicked`);
|
|
32
|
+
|
|
33
|
+
const functionName = this.getAttribute('data-onclick');
|
|
34
|
+
console.log(`[TDS Icon Button] Function name: "${functionName}"`);
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
functionName &&
|
|
38
|
+
window[functionName] &&
|
|
39
|
+
typeof window[functionName] === 'function'
|
|
40
|
+
) {
|
|
41
|
+
console.log(`[TDS Icon Button] Calling function: ${functionName}`);
|
|
42
|
+
window[functionName].call(this, e);
|
|
43
|
+
} else if (functionName) {
|
|
44
|
+
console.warn(`[TDS Icon Button] Function not found: ${functionName}`);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Initialize on DOM ready
|
|
51
|
+
if (document.readyState === 'loading') {
|
|
52
|
+
document.addEventListener('DOMContentLoaded', setupIconButtonHandlers);
|
|
53
|
+
} else {
|
|
54
|
+
setupIconButtonHandlers();
|
|
55
|
+
}
|
|
56
|
+
})();
|
|
@@ -15,12 +15,14 @@ require_once __DIR__ . '/../../utils/render-icon.php';
|
|
|
15
15
|
|
|
16
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
|
+
$intent = isset($attributes['intent']) ? sanitize_text_field($attributes['intent']) : 'primary';
|
|
18
19
|
$round = isset($attributes['round']) ? (bool) $attributes['round'] : false;
|
|
19
20
|
$isLoading = isset($attributes['isLoading']) ? (bool) $attributes['isLoading'] : false;
|
|
20
21
|
$href = isset($attributes['href']) ? esc_url($attributes['href']) : '';
|
|
21
22
|
$target = isset($attributes['target']) ? sanitize_text_field($attributes['target']) : '';
|
|
22
23
|
$rel = isset($attributes['rel']) ? sanitize_text_field($attributes['rel']) : '';
|
|
23
24
|
$aria_label = isset($attributes['ariaLabel']) ? sanitize_text_field($attributes['ariaLabel']) : '';
|
|
25
|
+
$on_click = isset($attributes['onClick']) ? sanitize_text_field($attributes['onClick']) : '';
|
|
24
26
|
$element_class_name = isset($attributes['classes']) ? sanitize_text_field($attributes['classes']) : '';
|
|
25
27
|
|
|
26
28
|
// Sanitize and prepare data-* attributes
|
|
@@ -31,6 +33,7 @@ foreach ($sanitized_data_attributes as $attr_name => $attr_value) {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
$classes = ['tds-icon-button'];
|
|
36
|
+
$classes[] = 'tds-button--intent-' . $intent;
|
|
34
37
|
$classes[] = 'tds-icon-button--size-' . $icon_size;
|
|
35
38
|
if ($round) {
|
|
36
39
|
$classes[] = 'tds-icon-button--is-rounded';
|
|
@@ -53,6 +56,7 @@ $wrapper_attrs = get_block_wrapper_attributes(['class' => implode(' ', $classes)
|
|
|
53
56
|
<?php echo $target ? 'target="' . esc_attr($target) . '"' : ''; ?>
|
|
54
57
|
<?php echo $rel ? 'rel="' . esc_attr($rel) . '"' : ''; ?>
|
|
55
58
|
<?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
|
|
59
|
+
<?php echo $on_click ? 'data-onclick="' . esc_attr($on_click) . '"' : ''; ?>
|
|
56
60
|
<?php echo wp_kses_post($data_attrs_html); ?>
|
|
57
61
|
>
|
|
58
62
|
<span class="tds-icon-button__icon"><?php echo wp_kses_post(tds_render_icon($icon_name, $icon_size)); ?></span>
|
|
@@ -61,6 +65,7 @@ $wrapper_attrs = get_block_wrapper_attributes(['class' => implode(' ', $classes)
|
|
|
61
65
|
<button
|
|
62
66
|
<?php echo wp_kses_post($wrapper_attrs); ?>
|
|
63
67
|
<?php echo $aria_label ? 'aria-label="' . esc_attr($aria_label) . '"' : ''; ?>
|
|
68
|
+
<?php echo $on_click ? 'data-onclick="' . esc_attr($on_click) . '"' : ''; ?>
|
|
64
69
|
<?php echo wp_kses_post($data_attrs_html); ?>
|
|
65
70
|
>
|
|
66
71
|
<span class="tds-icon-button__icon"><?php echo wp_kses_post(tds_render_icon($icon_name, $icon_size)); ?></span>
|