@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
|
@@ -1,66 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* Using resolved design token values for self-contained styling */
|
|
3
|
-
/* Icon buttons inherit base button styles for colors, intents, etc. */
|
|
4
|
-
|
|
5
|
-
.tds-icon-button--size-small,
|
|
6
|
-
.tds-icon-button--size-medium,
|
|
7
|
-
.tds-icon-button--size-large,
|
|
8
|
-
.tds-icon-button--size-xlarge {
|
|
9
|
-
padding: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.tds-icon-button--size-small {
|
|
13
|
-
width: 40px;
|
|
14
|
-
height: 40px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tds-icon-button--size-medium {
|
|
18
|
-
width: 48px;
|
|
19
|
-
height: 48px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.tds-icon-button--size-large {
|
|
23
|
-
width: 56px;
|
|
24
|
-
height: 56px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.tds-icon-button--size-xlarge {
|
|
28
|
-
width: 64px;
|
|
29
|
-
height: 64px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.tds-icon-button--is-rounded.tds-button {
|
|
33
|
-
border-radius: 9999px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.tds-icon-button--loading {
|
|
37
|
-
cursor: wait;
|
|
38
|
-
gap: 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.tds-icon-button__icon {
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.tds-icon-button__spinner {
|
|
48
|
-
display: inline-flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.tds-icon-button__spinner svg {
|
|
54
|
-
animation: tds-icon-button-spin 1.8s linear infinite;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@keyframes tds-icon-button-spin {
|
|
58
|
-
0% {
|
|
59
|
-
transform: rotate(0deg);
|
|
60
|
-
transform-origin: center;
|
|
61
|
-
}
|
|
62
|
-
100% {
|
|
63
|
-
transform: rotate(360deg);
|
|
64
|
-
transform-origin: center;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
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-icon-button{--tds-button-bg: #005c8a;--tds-button-fg: #ffffff;--tds-button-border: transparent;--tds-button-bg-hover: #004e75;--tds-button-fg-hover: #ffffff;--tds-button-border-hover: transparent;--tds-button-bg-pressed: #00496e;--tds-button-fg-pressed: #ffffff;--tds-button-border-pressed: transparent;--tds-button-border-focus: transparent;--tds-button-focus-ring: #737373;position:relative;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid var(--tds-button-border);background-color:var(--tds-button-bg);color:var(--tds-button-fg);cursor:pointer;text-decoration:none;transition:.15s ease}.tds-icon-button:hover:not(:disabled){background-color:var(--tds-button-bg-hover);border-color:var(--tds-button-border-hover);color:var(--tds-button-fg-hover)}.tds-icon-button:active:not(:disabled){background-color:var(--tds-button-bg-pressed);border-color:var(--tds-button-border-pressed);color:var(--tds-button-fg-pressed)}.tds-icon-button:focus-visible{outline:none;background-color:var(--tds-button-bg-hover);border-color:var(--tds-button-border-focus);color:var(--tds-button-fg-hover)}.tds-icon-button:focus-visible::after{content:"";position:absolute;inset:calc(4px*-1);border:2px solid var(--tds-button-focus-ring);pointer-events:none}.tds-button:hover:not(:disabled){background-color:var(--tds-button-bg-hover);border-color:var(--tds-button-border-hover);color:var(--tds-button-fg-hover)}.tds-button:active:not(:disabled){background-color:var(--tds-button-bg-pressed);border-color:var(--tds-button-border-pressed);color:var(--tds-button-fg-pressed)}.tds-button:focus-visible{outline:none;background-color:var(--tds-button-bg-hover);border-color:var(--tds-button-border-focus);color:var(--tds-button-fg-hover)}.tds-button:focus-visible::after{content:"";position:absolute;inset:calc(4px*-1);border:2px solid var(--tds-button-focus-ring);pointer-events:none}.tds-button--intent-primary{--tds-button-bg: #005c8a;--tds-button-fg: #ffffff;--tds-button-border: transparent;--tds-button-bg-hover: #004e75;--tds-button-fg-hover: #ffffff;--tds-button-border-hover: transparent;--tds-button-bg-pressed: #00496e;--tds-button-fg-pressed: #ffffff;--tds-button-border-pressed: transparent}.tds-button--intent-secondary{--tds-button-bg: #ffffff;--tds-button-fg: #1a1a1a;--tds-button-border: #8c8c8c;--tds-button-bg-hover: #d9d9d9;--tds-button-fg-hover: #161616;--tds-button-border-hover: #777777;--tds-button-bg-pressed: #cccccc;--tds-button-fg-pressed: #151515;--tds-button-border-pressed: #707070;--tds-button-border-focus: #8c8c8c}.tds-button--intent-negative{--tds-button-bg: #ffffff;--tds-button-fg: #cb0705;--tds-button-border: #cb0705;--tds-button-bg-hover: #d9d9d9;--tds-button-fg-hover: #ad0604;--tds-button-border-hover: #ad0604;--tds-button-bg-pressed: #cccccc;--tds-button-fg-pressed: #a20604;--tds-button-border-pressed: #a20604}.tds-icon-button--size-small,.tds-icon-button--size-medium,.tds-icon-button--size-large,.tds-icon-button--size-xlarge{padding:0}.tds-icon-button--size-small{width:40px;height:40px}.tds-icon-button--size-medium{width:48px;height:48px}.tds-icon-button--size-large{width:56px;height:56px}.tds-icon-button--size-xlarge{width:64px;height:64px}.tds-icon-button.tds-icon-button--is-rounded{border-radius:9999px}.tds-icon-button--loading{cursor:wait;gap:0}.tds-icon-button__icon{display:inline-flex;align-items:center;justify-content:center}.tds-icon-button__spinner{display:inline-flex;align-items:center;justify-content:center}.tds-icon-button__spinner svg{animation:tds-icon-button-spin 1.8s linear infinite}@keyframes tds-icon-button-spin{0%{transform:rotate(0deg);transform-origin:center}100%{transform:rotate(360deg);transform-origin:center}}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/* Icon Button Block Frontend Styles */
|
|
2
|
+
/* Uses SCSS variables from @times-design-system/theme-scss */
|
|
3
|
+
/* Icon buttons inherit base button styles for colors, intents, etc. */
|
|
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
|
+
|
|
8
|
+
/* Icon button base styling - applies button variables and states */
|
|
9
|
+
.tds-icon-button {
|
|
10
|
+
--tds-button-bg: #{$interactive-primary-fill-default};
|
|
11
|
+
--tds-button-fg: #{$interactive-primary-text-default};
|
|
12
|
+
--tds-button-border: transparent;
|
|
13
|
+
--tds-button-bg-hover: #{$interactive-primary-fill-hover};
|
|
14
|
+
--tds-button-fg-hover: #{$interactive-primary-text-hover};
|
|
15
|
+
--tds-button-border-hover: transparent;
|
|
16
|
+
--tds-button-bg-pressed: #{$interactive-primary-fill-pressed};
|
|
17
|
+
--tds-button-fg-pressed: #{$interactive-primary-text-pressed};
|
|
18
|
+
--tds-button-border-pressed: transparent;
|
|
19
|
+
--tds-button-border-focus: transparent;
|
|
20
|
+
--tds-button-focus-ring: #{$text-tertiary};
|
|
21
|
+
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
border-radius: 0;
|
|
27
|
+
border: 1px solid var(--tds-button-border);
|
|
28
|
+
background-color: var(--tds-button-bg);
|
|
29
|
+
color: var(--tds-button-fg);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
transition: 0.15s ease;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tds-icon-button:hover:not(:disabled) {
|
|
36
|
+
background-color: var(--tds-button-bg-hover);
|
|
37
|
+
border-color: var(--tds-button-border-hover);
|
|
38
|
+
color: var(--tds-button-fg-hover);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.tds-icon-button:active:not(:disabled) {
|
|
42
|
+
background-color: var(--tds-button-bg-pressed);
|
|
43
|
+
border-color: var(--tds-button-border-pressed);
|
|
44
|
+
color: var(--tds-button-fg-pressed);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tds-icon-button:focus-visible {
|
|
48
|
+
outline: none;
|
|
49
|
+
background-color: var(--tds-button-bg-hover);
|
|
50
|
+
border-color: var(--tds-button-border-focus);
|
|
51
|
+
color: var(--tds-button-fg-hover);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tds-icon-button:focus-visible::after {
|
|
55
|
+
content: '';
|
|
56
|
+
position: absolute;
|
|
57
|
+
inset: calc(#{$spacing-03} * -1);
|
|
58
|
+
border: $spacing-01 solid var(--tds-button-focus-ring);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tds-button:hover:not(:disabled) {
|
|
63
|
+
background-color: var(--tds-button-bg-hover);
|
|
64
|
+
border-color: var(--tds-button-border-hover);
|
|
65
|
+
color: var(--tds-button-fg-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.tds-button:active:not(:disabled) {
|
|
69
|
+
background-color: var(--tds-button-bg-pressed);
|
|
70
|
+
border-color: var(--tds-button-border-pressed);
|
|
71
|
+
color: var(--tds-button-fg-pressed);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tds-button:focus-visible {
|
|
75
|
+
outline: none;
|
|
76
|
+
background-color: var(--tds-button-bg-hover);
|
|
77
|
+
border-color: var(--tds-button-border-focus);
|
|
78
|
+
color: var(--tds-button-fg-hover);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.tds-button:focus-visible::after {
|
|
82
|
+
content: '';
|
|
83
|
+
position: absolute;
|
|
84
|
+
inset: calc(#{$spacing-03} * -1);
|
|
85
|
+
border: $spacing-01 solid var(--tds-button-focus-ring);
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Intent variants - shared with button block */
|
|
90
|
+
.tds-button--intent-primary {
|
|
91
|
+
--tds-button-bg: #{$interactive-primary-fill-default};
|
|
92
|
+
--tds-button-fg: #{$interactive-primary-text-default};
|
|
93
|
+
--tds-button-border: transparent;
|
|
94
|
+
--tds-button-bg-hover: #{$interactive-primary-fill-hover};
|
|
95
|
+
--tds-button-fg-hover: #{$interactive-primary-text-hover};
|
|
96
|
+
--tds-button-border-hover: transparent;
|
|
97
|
+
--tds-button-bg-pressed: #{$interactive-primary-fill-pressed};
|
|
98
|
+
--tds-button-fg-pressed: #{$interactive-primary-text-pressed};
|
|
99
|
+
--tds-button-border-pressed: transparent;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.tds-button--intent-secondary {
|
|
103
|
+
--tds-button-bg: #{$interactive-secondary-fill-default};
|
|
104
|
+
--tds-button-fg: #{$interactive-secondary-text-default};
|
|
105
|
+
--tds-button-border: #{$interactive-secondary-border-default};
|
|
106
|
+
--tds-button-bg-hover: #{$interactive-secondary-fill-hover};
|
|
107
|
+
--tds-button-fg-hover: #{$interactive-secondary-text-hover};
|
|
108
|
+
--tds-button-border-hover: #{$interactive-secondary-border-hover};
|
|
109
|
+
--tds-button-bg-pressed: #{$interactive-secondary-fill-pressed};
|
|
110
|
+
--tds-button-fg-pressed: #{$interactive-secondary-text-pressed};
|
|
111
|
+
--tds-button-border-pressed: #{$interactive-secondary-border-pressed};
|
|
112
|
+
--tds-button-border-focus: #{$interactive-secondary-border-default};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.tds-button--intent-negative {
|
|
116
|
+
--tds-button-bg: #{$interactive-negative-fill-default};
|
|
117
|
+
--tds-button-fg: #{$interactive-negative-text-default};
|
|
118
|
+
--tds-button-border: #{$interactive-negative-border-default};
|
|
119
|
+
--tds-button-bg-hover: #{$interactive-negative-fill-hover};
|
|
120
|
+
--tds-button-fg-hover: #{$interactive-negative-text-hover};
|
|
121
|
+
--tds-button-border-hover: #{$interactive-negative-border-hover};
|
|
122
|
+
--tds-button-bg-pressed: #{$interactive-negative-fill-pressed};
|
|
123
|
+
--tds-button-fg-pressed: #{$interactive-negative-text-pressed};
|
|
124
|
+
--tds-button-border-pressed: #{$interactive-negative-border-pressed};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Icon button specific sizing */
|
|
128
|
+
.tds-icon-button--size-small,
|
|
129
|
+
.tds-icon-button--size-medium,
|
|
130
|
+
.tds-icon-button--size-large,
|
|
131
|
+
.tds-icon-button--size-xlarge {
|
|
132
|
+
padding: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.tds-icon-button--size-small {
|
|
136
|
+
width: $spacing-17;
|
|
137
|
+
height: $spacing-17;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.tds-icon-button--size-medium {
|
|
141
|
+
width: $spacing-18;
|
|
142
|
+
height: $spacing-18;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.tds-icon-button--size-large {
|
|
146
|
+
width: $spacing-19;
|
|
147
|
+
height: $spacing-19;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.tds-icon-button--size-xlarge {
|
|
151
|
+
width: $spacing-20;
|
|
152
|
+
height: $spacing-20;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.tds-icon-button.tds-icon-button--is-rounded {
|
|
156
|
+
border-radius: $border-radius-full;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.tds-icon-button--loading {
|
|
160
|
+
cursor: wait;
|
|
161
|
+
gap: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.tds-icon-button__icon {
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.tds-icon-button__spinner {
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: center;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.tds-icon-button__spinner svg {
|
|
177
|
+
animation: tds-icon-button-spin 1.8s linear infinite;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@keyframes tds-icon-button-spin {
|
|
181
|
+
0% {
|
|
182
|
+
transform: rotate(0deg);
|
|
183
|
+
transform-origin: center;
|
|
184
|
+
}
|
|
185
|
+
100% {
|
|
186
|
+
transform: rotate(360deg);
|
|
187
|
+
transform-origin: center;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.tds-input-wrapper {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
gap: var(--spacing-05);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/* Label styles */
|
|
10
|
-
.tds-input-label {
|
|
11
|
-
color: var(--text-primary, #1a1a1a);
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
gap: var(--spacing-03);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* Required asterisk */
|
|
18
|
-
.tds-input-required {
|
|
19
|
-
color: var(--text-error, #cc0000);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Input field styles */
|
|
23
|
-
.tds-input {
|
|
24
|
-
width: 100%;
|
|
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);
|
|
29
|
-
border-radius: 0;
|
|
30
|
-
transition: all 0.2s ease-in-out;
|
|
31
|
-
box-sizing: border-box;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Input focus state */
|
|
35
|
-
.tds-input:focus {
|
|
36
|
-
outline: none;
|
|
37
|
-
border-color: var(--text-interactive-primary, #0f4aa2);
|
|
38
|
-
box-shadow: 0 0 0 var(--spacing-01) rgba(15, 74, 162, 0.1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* Input hover state */
|
|
42
|
-
.tds-input:hover:not(:disabled) {
|
|
43
|
-
border-color: var(--text-interactive-primary, #0f4aa2);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Input disabled state */
|
|
47
|
-
.tds-input:disabled {
|
|
48
|
-
background-color: var(--interactive-background-disabled, #f2f2f2);
|
|
49
|
-
color: var(--text-disabled, #999999);
|
|
50
|
-
border-color: var(--border-disabled, #cccccc);
|
|
51
|
-
cursor: not-allowed;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Input placeholder */
|
|
55
|
-
.tds-input::placeholder {
|
|
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);
|
|
67
|
-
}
|
|
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-input-wrapper{display:flex;flex-direction:column;gap:8px}.tds-input-label{color:#1a1a1a;display:flex;align-items:center;gap:4px}.tds-input-required{color:#cb0705}.tds-input{width:100%;padding:8px 12px;color:#1a1a1a;background-color:#fff;border:1px solid #8c8c8c;border-radius:0;transition:all .2s ease-in-out;box-sizing:border-box}.tds-input:focus{outline:none;border-color:#266d95;box-shadow:0 0 0 2px rgba(15,74,162,.1)}.tds-input:hover:not(:disabled){border-color:#266d95}.tds-input:disabled{background-color:#f2f2f2;color:#404040;border-color:#ccc;cursor:not-allowed}.tds-input::placeholder{color:#737373}.tds-input.error{border-color:#b20908}.tds-input.error:focus{border-color:#b20908;box-shadow:0 0 0 2px rgba(204,0,0,.1)}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* Input component styles using design tokens */
|
|
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
|
+
@import '@times-design-system/theme-scss/src/tds-typography.scss';
|
|
7
|
+
|
|
8
|
+
.tds-input-wrapper {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: $spacing-05;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Label styles */
|
|
15
|
+
.tds-input-label {
|
|
16
|
+
color: $text-primary;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: $spacing-03;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Required asterisk */
|
|
23
|
+
.tds-input-required {
|
|
24
|
+
color: $messaging-icon-error;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Input field styles */
|
|
28
|
+
.tds-input {
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: $spacing-05 $spacing-07;
|
|
31
|
+
color: $text-primary;
|
|
32
|
+
background-color: $input-fill-default;
|
|
33
|
+
border: 1px solid $input-border-default;
|
|
34
|
+
border-radius: 0;
|
|
35
|
+
transition: all 0.2s ease-in-out;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Input focus state */
|
|
40
|
+
.tds-input:focus {
|
|
41
|
+
outline: none;
|
|
42
|
+
border-color: $interactive-link-primary-text-default;
|
|
43
|
+
box-shadow: 0 0 0 $spacing-01 rgba(15, 74, 162, 0.1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Input hover state */
|
|
47
|
+
.tds-input:hover:not(:disabled) {
|
|
48
|
+
border-color: $interactive-link-primary-text-default;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Input disabled state */
|
|
52
|
+
.tds-input:disabled {
|
|
53
|
+
background-color: $input-fill-hover;
|
|
54
|
+
color: $text-secondary;
|
|
55
|
+
border-color: $border-secondary;
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Input placeholder */
|
|
60
|
+
.tds-input::placeholder {
|
|
61
|
+
color: $text-tertiary;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Input error state (optional class to apply) */
|
|
65
|
+
.tds-input.error {
|
|
66
|
+
border-color: $messaging-border-error;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.tds-input.error:focus {
|
|
70
|
+
border-color: $messaging-border-error;
|
|
71
|
+
box-shadow: 0 0 0 $spacing-01 rgba(204, 0, 0, 0.1);
|
|
72
|
+
}
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Styles for InputHelperMessage Block
|
|
3
|
-
*
|
|
4
|
-
* Reference: packages/components-react/src/InputHelperMessage/
|
|
5
|
-
* Token Reference: packages/tokens/data/resolved-hexes.json
|
|
6
|
-
*
|
|
7
|
-
* TODO: Adapt styles from React component
|
|
8
|
-
* - Copy relevant CSS from React component
|
|
9
|
-
* - Map CSS custom properties to resolved hex values
|
|
10
|
-
* - Use BEM naming: .tds-input-helper-message--{modifier}
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
.tds-input-helper-message {
|
|
14
|
-
/* TODO: Add component styles here */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tds-input-helper-message--focus {
|
|
18
|
-
/* TODO: Add focus state styles */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.tds-input-helper-message--disabled {
|
|
22
|
-
/* TODO: Add disabled state styles */
|
|
23
|
-
}
|
|
1
|
+
.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-input-helper-message{display:inline-flex;align-items:center;gap:8px;color:#1a1a1a}.tds-input-helper-message__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.tds-input-helper-message__text{font:400 var(--font-size030)/1.5 Times Roboto}.tds-input-helper-message--error .tds-input-helper-message__icon{color:#cb0705}.tds-input-helper-message--success .tds-input-helper-message__icon{color:#31a46f}.tds-input-helper-message--info .tds-input-helper-message__icon{color:#0f4aa2}.tds-input-helper-message--warning .tds-input-helper-message__icon{color:#e49307}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for InputHelperMessage Block
|
|
3
|
+
* Uses SCSS variables from @times-design-system/theme-scss
|
|
4
|
+
*
|
|
5
|
+
* Reference: packages/components-react/src/InputHelperMessage/
|
|
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-input-helper-message {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: $spacing-05;
|
|
16
|
+
color: $text-primary;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.tds-input-helper-message__icon {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
flex: 0 0 auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tds-input-helper-message__text {
|
|
27
|
+
@include utility-body-regular-medium;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Intent icon colours */
|
|
31
|
+
.tds-input-helper-message--error .tds-input-helper-message__icon {
|
|
32
|
+
color: $messaging-icon-error;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tds-input-helper-message--success .tds-input-helper-message__icon {
|
|
36
|
+
color: $messaging-icon-success;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tds-input-helper-message--info .tds-input-helper-message__icon {
|
|
40
|
+
color: $messaging-icon-info;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.tds-input-helper-message--warning .tds-input-helper-message__icon {
|
|
44
|
+
color: $messaging-icon-warning;
|
|
45
|
+
}
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"intent": {
|
|
26
26
|
"type": "string",
|
|
27
27
|
"default": "primary",
|
|
28
|
-
"enum": ["primary", "secondary", "
|
|
28
|
+
"enum": ["primary", "secondary", "danger"],
|
|
29
|
+
"description": "Link color and style variant"
|
|
29
30
|
},
|
|
30
31
|
"sentiment": {
|
|
31
32
|
"type": "string",
|
|
@@ -35,7 +36,8 @@
|
|
|
35
36
|
"size": {
|
|
36
37
|
"type": "string",
|
|
37
38
|
"default": "medium",
|
|
38
|
-
"enum": ["small", "medium", "large"]
|
|
39
|
+
"enum": ["xsmall", "small", "medium", "large"],
|
|
40
|
+
"description": "Link size variant"
|
|
39
41
|
},
|
|
40
42
|
"iconLeft": {
|
|
41
43
|
"type": "string",
|
|
@@ -73,9 +75,91 @@
|
|
|
73
75
|
"type": "object",
|
|
74
76
|
"default": {},
|
|
75
77
|
"description": "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
78
|
+
},
|
|
79
|
+
"isDisabled": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"default": false,
|
|
82
|
+
"description": "Disables the link and prevents navigation"
|
|
83
|
+
},
|
|
84
|
+
"onClick": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"default": "",
|
|
87
|
+
"description": "Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and link element context."
|
|
76
88
|
}
|
|
77
89
|
},
|
|
78
90
|
"example": {},
|
|
91
|
+
"style": "file:./style.css",
|
|
79
92
|
"script": "times-design-system",
|
|
80
|
-
"editorScript": "times-design-system"
|
|
93
|
+
"editorScript": "times-design-system",
|
|
94
|
+
"preview": {
|
|
95
|
+
"combinations": [
|
|
96
|
+
{
|
|
97
|
+
"content": "Primary",
|
|
98
|
+
"href": "#",
|
|
99
|
+
"intent": "primary",
|
|
100
|
+
"size": "medium"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"content": "Primary",
|
|
104
|
+
"href": "#",
|
|
105
|
+
"intent": "primary",
|
|
106
|
+
"size": "medium",
|
|
107
|
+
"iconLeft": "filled_arrow_left"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"content": "Primary",
|
|
111
|
+
"href": "#",
|
|
112
|
+
"intent": "primary",
|
|
113
|
+
"size": "medium",
|
|
114
|
+
"iconRight": "filled_arrow_right"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"content": "Secondary",
|
|
118
|
+
"href": "#",
|
|
119
|
+
"intent": "secondary",
|
|
120
|
+
"size": "medium"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"content": "Danger",
|
|
124
|
+
"href": "#",
|
|
125
|
+
"intent": "danger",
|
|
126
|
+
"size": "medium"
|
|
127
|
+
},
|
|
128
|
+
{ "content": "XSmall", "href": "#", "size": "xsmall" },
|
|
129
|
+
{ "content": "Small", "href": "#", "size": "small" },
|
|
130
|
+
{ "content": "Large", "href": "#", "size": "large" },
|
|
131
|
+
{
|
|
132
|
+
"content": "Brand",
|
|
133
|
+
"href": "#",
|
|
134
|
+
"sentiment": "brand",
|
|
135
|
+
"size": "medium"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"content": "Utility",
|
|
139
|
+
"href": "#",
|
|
140
|
+
"sentiment": "utility",
|
|
141
|
+
"size": "medium"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"content": "External",
|
|
145
|
+
"href": "#",
|
|
146
|
+
"target": "_blank",
|
|
147
|
+
"size": "medium"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"content": "With onClick",
|
|
151
|
+
"href": "#",
|
|
152
|
+
"intent": "primary",
|
|
153
|
+
"size": "medium",
|
|
154
|
+
"onClick": "handleLinkClick"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"content": "Disabled",
|
|
158
|
+
"href": "#",
|
|
159
|
+
"intent": "primary",
|
|
160
|
+
"size": "medium",
|
|
161
|
+
"isDisabled": true
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
81
165
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link Block Click Handler
|
|
3
|
+
*
|
|
4
|
+
* Initializes click handlers for link blocks with onClick attribute.
|
|
5
|
+
* Calls custom onClick callback when link is clicked.
|
|
6
|
+
*
|
|
7
|
+
* @package TimesDesignSystem\ComponentsWordPress
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
(function initLinkClickHandlers() {
|
|
11
|
+
console.log('[TDS Link] Script loaded and executing');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize click handlers for all link blocks
|
|
15
|
+
*/
|
|
16
|
+
function setupLinkHandlers() {
|
|
17
|
+
console.log('[TDS Link] Setting up handlers...');
|
|
18
|
+
const links = document.querySelectorAll('.tds-link');
|
|
19
|
+
console.log(`[TDS Link] Found ${links.length} link(s)`);
|
|
20
|
+
|
|
21
|
+
if (links.length === 0) {
|
|
22
|
+
console.warn('[TDS Link] No links found on page');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
links.forEach((link, index) => {
|
|
27
|
+
console.log(`[TDS Link] Attaching listener to link #${index}`);
|
|
28
|
+
link.addEventListener('click', function handleLinkClick(e) {
|
|
29
|
+
console.log(`[TDS Link] Link #${index} clicked`);
|
|
30
|
+
|
|
31
|
+
const functionName = this.getAttribute('data-onclick');
|
|
32
|
+
console.log(`[TDS Link] Function name: "${functionName}"`);
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
functionName &&
|
|
36
|
+
window[functionName] &&
|
|
37
|
+
typeof window[functionName] === 'function'
|
|
38
|
+
) {
|
|
39
|
+
console.log(`[TDS Link] Calling function: ${functionName}`);
|
|
40
|
+
window[functionName].call(this, e);
|
|
41
|
+
} else if (functionName) {
|
|
42
|
+
console.warn(`[TDS Link] Function not found: ${functionName}`);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Initialize on DOM ready
|
|
49
|
+
if (document.readyState === 'loading') {
|
|
50
|
+
document.addEventListener('DOMContentLoaded', setupLinkHandlers);
|
|
51
|
+
} else {
|
|
52
|
+
setupLinkHandlers();
|
|
53
|
+
}
|
|
54
|
+
})();
|