@times-design-system/components-wordpress 0.4.0 → 1.2.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.
Files changed (189) hide show
  1. package/BLOCK_CREATION_CHECKLIST.md +160 -0
  2. package/BUILD.md +411 -0
  3. package/CHANGELOG.md +32 -0
  4. package/LICENSE +29 -0
  5. package/README.md +972 -5
  6. package/TRANSFORMATION_GUIDE.md +635 -0
  7. package/block.json +10 -0
  8. package/dist/block.json +10 -0
  9. package/dist/blocks/ad-container/block.json +28 -0
  10. package/dist/blocks/ad-container/edit.js +42 -0
  11. package/dist/blocks/ad-container/index.js +10 -0
  12. package/dist/blocks/ad-container/save.js +16 -0
  13. package/dist/blocks/ad-container/style-editor.css +4 -0
  14. package/dist/blocks/ad-container/style.css +27 -0
  15. package/dist/blocks/button/block.json +89 -0
  16. package/dist/blocks/button/edit.js +187 -0
  17. package/dist/blocks/button/index.js +11 -0
  18. package/dist/blocks/button/save.js +52 -0
  19. package/dist/blocks/button/style-editor.css +15 -0
  20. package/dist/blocks/button/style.css +37 -0
  21. package/dist/blocks/chip/block.json +57 -0
  22. package/dist/blocks/chip/edit.js +113 -0
  23. package/dist/blocks/chip/index.js +10 -0
  24. package/dist/blocks/chip/save.js +36 -0
  25. package/dist/blocks/chip/style-editor.css +5 -0
  26. package/dist/blocks/chip/style.css +48 -0
  27. package/dist/blocks/divider/block.json +31 -0
  28. package/dist/blocks/divider/edit.js +42 -0
  29. package/dist/blocks/divider/index.js +10 -0
  30. package/dist/blocks/divider/save.js +18 -0
  31. package/dist/blocks/divider/style-editor.css +4 -0
  32. package/dist/blocks/divider/style.css +25 -0
  33. package/dist/blocks/flag/block.json +48 -0
  34. package/dist/blocks/flag/edit.js +82 -0
  35. package/dist/blocks/flag/index.js +10 -0
  36. package/dist/blocks/flag/save.js +25 -0
  37. package/dist/blocks/flag/style-editor.css +5 -0
  38. package/dist/blocks/flag/style.css +45 -0
  39. package/dist/blocks/icon-button/block.json +43 -0
  40. package/dist/blocks/icon-button/edit.js +82 -0
  41. package/dist/blocks/icon-button/index.js +10 -0
  42. package/dist/blocks/icon-button/save.js +29 -0
  43. package/dist/blocks/icon-button/style-editor.css +5 -0
  44. package/dist/blocks/icon-button/style.css +32 -0
  45. package/dist/blocks/input/block.json +47 -0
  46. package/dist/blocks/input/edit.js +78 -0
  47. package/dist/blocks/input/index.js +10 -0
  48. package/dist/blocks/input/save.js +27 -0
  49. package/dist/blocks/input/style-editor.css +8 -0
  50. package/dist/blocks/input/style.css +30 -0
  51. package/dist/blocks/link/block.json +71 -0
  52. package/dist/blocks/link/edit.js +151 -0
  53. package/dist/blocks/link/index.js +10 -0
  54. package/dist/blocks/link/save.js +46 -0
  55. package/dist/blocks/link/style-editor.css +5 -0
  56. package/dist/blocks/link/style.css +66 -0
  57. package/dist/blocks/text/block.json +32 -0
  58. package/dist/blocks/text/edit.js +56 -0
  59. package/dist/blocks/text/index.js +10 -0
  60. package/dist/blocks/text/save.js +18 -0
  61. package/dist/blocks/text/style-editor.css +4 -0
  62. package/dist/blocks/text/style.css +20 -0
  63. package/dist/blocks/toast/block.json +39 -0
  64. package/dist/blocks/toast/edit.js +85 -0
  65. package/dist/blocks/toast/index.js +10 -0
  66. package/dist/blocks/toast/save.js +29 -0
  67. package/dist/blocks/toast/style-editor.css +4 -0
  68. package/dist/blocks/toast/style.css +51 -0
  69. package/dist/index.cjs +2232 -0
  70. package/dist/index.cjs.map +1 -0
  71. package/dist/index.css +2 -0
  72. package/dist/index.css.map +1 -0
  73. package/dist/index.js +2196 -255
  74. package/dist/index.js.map +1 -1
  75. package/dist/plugin.php +79 -0
  76. package/dist/utils/classBuilder.js +53 -0
  77. package/package.json +39 -7
  78. package/plugin.php +79 -0
  79. package/rollup.config.js +39 -22
  80. package/scripts/build-plugin.cjs +121 -0
  81. package/scripts/create-block.sh +141 -0
  82. package/src/blocks/ad-container/block.json +28 -0
  83. package/src/blocks/ad-container/edit.js +42 -0
  84. package/src/blocks/ad-container/index.js +10 -0
  85. package/src/blocks/ad-container/save.js +16 -0
  86. package/src/blocks/ad-container/style-editor.css +4 -0
  87. package/src/blocks/ad-container/style.css +27 -0
  88. package/src/blocks/button/block.json +89 -0
  89. package/src/blocks/button/edit.js +187 -0
  90. package/src/blocks/button/index.js +11 -0
  91. package/src/blocks/button/save.js +52 -0
  92. package/src/blocks/button/style-editor.css +15 -0
  93. package/src/blocks/button/style.css +37 -0
  94. package/src/blocks/chip/block.json +57 -0
  95. package/src/blocks/chip/edit.js +113 -0
  96. package/src/blocks/chip/index.js +10 -0
  97. package/src/blocks/chip/save.js +36 -0
  98. package/src/blocks/chip/style-editor.css +5 -0
  99. package/src/blocks/chip/style.css +48 -0
  100. package/src/blocks/divider/block.json +31 -0
  101. package/src/blocks/divider/edit.js +42 -0
  102. package/src/blocks/divider/index.js +10 -0
  103. package/src/blocks/divider/save.js +18 -0
  104. package/src/blocks/divider/style-editor.css +4 -0
  105. package/src/blocks/divider/style.css +25 -0
  106. package/src/blocks/flag/block.json +48 -0
  107. package/src/blocks/flag/edit.js +82 -0
  108. package/src/blocks/flag/index.js +10 -0
  109. package/src/blocks/flag/save.js +25 -0
  110. package/src/blocks/flag/style-editor.css +5 -0
  111. package/src/blocks/flag/style.css +45 -0
  112. package/src/blocks/icon-button/block.json +43 -0
  113. package/src/blocks/icon-button/edit.js +82 -0
  114. package/src/blocks/icon-button/index.js +10 -0
  115. package/src/blocks/icon-button/save.js +29 -0
  116. package/src/blocks/icon-button/style-editor.css +5 -0
  117. package/src/blocks/icon-button/style.css +32 -0
  118. package/src/blocks/input/block.json +47 -0
  119. package/src/blocks/input/edit.js +78 -0
  120. package/src/blocks/input/index.js +10 -0
  121. package/src/blocks/input/save.js +27 -0
  122. package/src/blocks/input/style-editor.css +8 -0
  123. package/src/blocks/input/style.css +30 -0
  124. package/src/blocks/link/block.json +71 -0
  125. package/src/blocks/link/edit.js +151 -0
  126. package/src/blocks/link/index.js +10 -0
  127. package/src/blocks/link/save.js +46 -0
  128. package/src/blocks/link/style-editor.css +5 -0
  129. package/src/blocks/link/style.css +66 -0
  130. package/src/blocks/text/block.json +32 -0
  131. package/src/blocks/text/edit.js +56 -0
  132. package/src/blocks/text/index.js +10 -0
  133. package/src/blocks/text/save.js +18 -0
  134. package/src/blocks/text/style-editor.css +4 -0
  135. package/src/blocks/text/style.css +20 -0
  136. package/src/blocks/toast/block.json +39 -0
  137. package/src/blocks/toast/edit.js +85 -0
  138. package/src/blocks/toast/index.js +10 -0
  139. package/src/blocks/toast/save.js +29 -0
  140. package/src/blocks/toast/style-editor.css +4 -0
  141. package/src/blocks/toast/style.css +51 -0
  142. package/src/index.js +15 -12
  143. package/src/utils/classBuilder.js +53 -0
  144. package/tsconfig.json +4 -4
  145. package/__tests__/wordpress.test.js +0 -0
  146. package/dist/AdContainer/AdContainer.d.ts +0 -9
  147. package/dist/Article/ArticleMetaContainer/ArticleMetaContainer.d.ts +0 -8
  148. package/dist/Article/UpNextArticles/UpNextArticles.d.ts +0 -13
  149. package/dist/Button/Button.d.ts +0 -15
  150. package/dist/CommentsDisabled/CommentsDisabled.d.ts +0 -10
  151. package/dist/CommentsDisabled/CommentsDisabled.stories.d.ts +0 -44
  152. package/dist/CommentsDisabled/index.d.ts +0 -2
  153. package/dist/Divider/Divider.d.ts +0 -15
  154. package/dist/Input/Input.d.ts +0 -25
  155. package/dist/Link/Link.d.ts +0 -18
  156. package/dist/Text/Text.d.ts +0 -14
  157. package/dist/index.cjs.js +0 -299
  158. package/dist/index.cjs.js.map +0 -1
  159. package/dist/styles.css +0 -151
  160. package/dist/typographyStyles.css +0 -30
  161. package/dist/utils/cn.d.ts +0 -1
  162. package/dist/utils/hooks.d.ts +0 -8
  163. package/src/AdContainer/AdContainer.tsx +0 -31
  164. package/src/AdContainer/styles.css +0 -58
  165. package/src/Article/ArticleMetaContainer/ArticleMetaContainer.tsx +0 -14
  166. package/src/Article/ArticleMetaContainer/styles.css +0 -151
  167. package/src/Article/UpNextArticles/UpNextArticles.tsx +0 -69
  168. package/src/Article/UpNextArticles/styles.css +0 -151
  169. package/src/Button/Button.tsx +0 -36
  170. package/src/Button/styles.css +0 -30
  171. package/src/CommentsDisabled/CommentsDisabled.stories.tsx +0 -178
  172. package/src/CommentsDisabled/CommentsDisabled.tsx +0 -63
  173. package/src/CommentsDisabled/IMPLEMENTATION_SUMMARY.md +0 -305
  174. package/src/CommentsDisabled/README.md +0 -284
  175. package/src/CommentsDisabled/TOKEN_MAPPING.md +0 -269
  176. package/src/CommentsDisabled/index.ts +0 -2
  177. package/src/CommentsDisabled/styles.css +0 -82
  178. package/src/Divider/Divider.tsx +0 -41
  179. package/src/Divider/styles.css +0 -80
  180. package/src/Input/Input.tsx +0 -62
  181. package/src/Input/styles.css +0 -69
  182. package/src/Link/Link.tsx +0 -49
  183. package/src/Link/styles.css +0 -111
  184. package/src/Text/Text.tsx +0 -38
  185. package/src/Text/styles.css +0 -30
  186. package/src/Text/typographyStyles.css +0 -30
  187. package/src/utils/cn.js +0 -3
  188. package/src/utils/cn.tsx +0 -3
  189. package/src/utils/hooks.ts +0 -34
@@ -1,269 +0,0 @@
1
- # CommentsDisabled Component - Token Mapping Reference
2
-
3
- This document provides a comprehensive mapping between the CommentsDisabled component's design elements and the Times Design System tokens.
4
-
5
- ## Component Structure
6
-
7
- The CommentsDisabled component consists of four main elements:
8
-
9
- ```
10
- .tds-comments-disabled
11
- ├── .tds-comments-disabled__heading (h3)
12
- ├── .tds-comments-disabled__divider (hr)
13
- └── .tds-comments-disabled__content (p)
14
- └── .tds-comments-disabled__link (a)
15
- ```
16
-
17
- ## Token Mapping
18
-
19
- ### Container (`.tds-comments-disabled`)
20
-
21
- | Property | Token | Value | Fallback |
22
- | ---------------- | -------------------------------- | ----- | -------- |
23
- | `margin-inline` | auto | - | - |
24
- | `padding-inline` | `--tds-foundation-dimension-500` | 20px | - |
25
- | `width` | - | 100% | - |
26
-
27
- **Token Details:**
28
-
29
- - `--tds-foundation-dimension-500` is the responsive horizontal padding
30
- - Used for balanced spacing on all viewports
31
-
32
- ### Heading (`.tds-comments-disabled__heading`)
33
-
34
- | Property | Token | Value | Usage |
35
- | ---------------- | ----------------------------------------- | --------------- | ----------------------- |
36
- | `font-family` | `--tds-foundation-font-family040` | Roboto | Primary UI font |
37
- | `font-size` | `--tds-foundation-font-size040` | 1.125rem (18px) | Readable heading |
38
- | `font-weight` | `--tds-foundation-font-weight050` | 500 (Medium) | Emphasis |
39
- | `line-height` | `--tds-foundation-font-line-height030` | 1.25 | Comfortable reading |
40
- | `color` | `--tds-foundation-foundation-brand-black` | #000000 | High contrast |
41
- | `margin` | - | 0 | Reset |
42
- | `padding-top` | `--tds-foundation-dimension-750` | 30px | Top spacing |
43
- | `padding-bottom` | `--tds-foundation-dimension-125` | 5px | Separation from divider |
44
- | `text-align` | - | center | Visual emphasis |
45
-
46
- **Token Details:**
47
-
48
- - Font scale starts at foundation level
49
- - Weight 050 (500) provides hierarchy without being too bold
50
- - Line height 030 (1.25) ensures readability
51
- - Dimensions follow 4px base unit system
52
-
53
- ### Divider (`.tds-comments-disabled__divider`)
54
-
55
- | Property | Token | Value | Purpose |
56
- | -------------------- | ----------------------------------------- | ----------------- | --------------------- |
57
- | `border-top` | `--tds-foundation-foundation-brand-black` | #000000 1px solid | Visual separator |
58
- | `border-top` opacity | - | 10% | Subtle, non-intrusive |
59
- | `margin` | `--tds-foundation-dimension-100` | 4px auto | Balanced spacing |
60
- | `max-width` | - | 522px | Content width limit |
61
- | `width` | - | 100% | Responsive width |
62
- | `border` | - | none | Override default |
63
-
64
- **Token Details:**
65
-
66
- - Black with 10% opacity creates subtle visual separation
67
- - Dimensions use base 4px unit: `dimension-100` = 4px
68
- - 522px max-width provides visual balance with heading
69
-
70
- ### Content Text (`.tds-comments-disabled__content`)
71
-
72
- | Property | Token | Value | Usage |
73
- | ---------------- | ----------------------------------------- | ------------- | ----------------------- |
74
- | `font-family` | `--tds-foundation-font-family040` | Roboto | Consistent UI font |
75
- | `font-size` | `--tds-foundation-font-size030` | 1rem (16px) | Body text size |
76
- | `font-weight` | `--tds-foundation-font-weight040` | 400 (Regular) | Normal weight |
77
- | `line-height` | `--tds-foundation-font-line-height030` | 1.25 | Readable spacing |
78
- | `color` | `--tds-foundation-foundation-brand-black` | #000000 | High contrast |
79
- | `margin` | - | 0 | Reset |
80
- | `padding-bottom` | `--tds-foundation-dimension-750` | 30px | Bottom spacing |
81
- | `padding-top` | `--tds-foundation-dimension-125` | 5px | Separation from divider |
82
- | `text-align` | - | center | Visual balance |
83
-
84
- **Token Details:**
85
-
86
- - `font-size030` is standard body text size
87
- - `font-weight040` ensures readability
88
- - Padding mirrors heading for symmetry
89
-
90
- ### Link (`.tds-comments-disabled__link`)
91
-
92
- | State | Property | Token | Value | Purpose |
93
- | ----------- | ------------------ | ----------------------------------------------------------- | ---------------------- | -------------------------- |
94
- | **Default** | `color` | `--tds-foundation-foundation-brand-digital-blue` | #005c8a | Brand identity |
95
- | **Default** | `font-weight` | `--tds-foundation-font-weight050` | 500 | Visual emphasis |
96
- | **Default** | `text-decoration` | - | underline | Link indication |
97
- | **Default** | `transition` | - | color 0.2s ease-in-out | Smooth interaction |
98
- | **Hover** | `color` | `--tds-foundation-foundation-brand-digital-blue` (darkened) | ~#003d5a | Interactive feedback |
99
- | **Hover** | darkening modifier | `--tds-foundation-colour-modifier-interactive-hover` | 0.15 (15%) | Consistent hover treatment |
100
- | **Active** | `color` | `--tds-foundation-foundation-brand-digital-blue` (darkened) | ~#003147 | Pressed feedback |
101
- | **Active** | darkening modifier | `--tds-foundation-colour-modifier-interactive-pressed` | 0.25 (25%) | Clear active state |
102
- | **Focus** | `outline` | `--tds-foundation-foundation-brand-digital-blue` | 2px solid #005c8a | Keyboard accessible |
103
- | **Focus** | `outline-offset` | - | 2px | Visible focus ring |
104
-
105
- **Token Details:**
106
-
107
- - Brand digital blue is primary call-to-action color
108
- - Hover uses `colour-modifier-interactive-hover` for consistent interaction
109
- - Active uses `colour-modifier-interactive-pressed` for distinction
110
- - Focus outline uses brand blue for visibility
111
-
112
- #### Link Color Mix Formula
113
-
114
- **Hover State:**
115
-
116
- ```css
117
- color-mix(
118
- in srgb,
119
- var(--tds-foundation-foundation-brand-digital-blue) calc(100% - 0.15 * 100%),
120
- var(--tds-foundation-foundation-brand-black)
121
- )
122
- ```
123
-
124
- Results in ~15% darker blue
125
-
126
- **Active State:**
127
-
128
- ```css
129
- color-mix(
130
- in srgb,
131
- var(--tds-foundation-foundation-brand-digital-blue) calc(100% - 0.25 * 100%),
132
- var(--tds-foundation-foundation-brand-black)
133
- )
134
- ```
135
-
136
- Results in ~25% darker blue
137
-
138
- ## Responsive Behavior
139
-
140
- ### Viewport Modifiers
141
-
142
- The component uses viewport multipliers for responsive sizing:
143
-
144
- - **Small Viewport (< 768px)**
145
- - Heading: `calc(font-size040 * viewport-multiplier-small)` = 1.125rem × 1.0 = 1.125rem
146
- - Content: `calc(font-size030 * viewport-multiplier-small)` = 1rem × 1.0 = 1rem
147
- - **Large Viewport (≥ 768px)**
148
- - Heading: Full size (1.125rem)
149
- - Content: Full size (1rem)
150
-
151
- **Token Values:**
152
-
153
- - `--tds-foundation-viewport-multiplier-small` = 1.0
154
- - Base font sizes are already optimized for readability
155
-
156
- ## Color Palette Reference
157
-
158
- ### Brand Colors Used
159
-
160
- | Color Name | Token | Hex Value | Usage |
161
- | ------------ | ------------------------------------------------ | --------- | ------------------------ |
162
- | Digital Blue | `--tds-foundation-foundation-brand-digital-blue` | #005c8a | Link color, interactions |
163
- | Black | `--tds-foundation-foundation-brand-black` | #000000 | Text, heading, divider |
164
-
165
- ### Color Accessibility
166
-
167
- - **Text to Background:** Black (#000000) on white background
168
- - Contrast Ratio: 21:1 (WCAG AAA)
169
- - **Link to Background:** Digital Blue (#005c8a) on white background
170
- - Contrast Ratio: 8.5:1 (WCAG AAA)
171
- - **Link Hover:** ~#003d5a on white background
172
- - Contrast Ratio: 14:1 (WCAG AAA)
173
-
174
- ## Font Scale Reference
175
-
176
- | Token | Size (rem) | Size (px) | Usage |
177
- | -------------- | ---------- | --------- | ------------ |
178
- | `font-size030` | 1 | 16 | Content text |
179
- | `font-size040` | 1.125 | 18 | Heading |
180
-
181
- ### Font Family Reference
182
-
183
- | Token | Family | Usage |
184
- | ---------------- | ------ | ------------------ |
185
- | `font-family040` | Roboto | All component text |
186
-
187
- ### Font Weight Reference
188
-
189
- | Token | Weight | Usage |
190
- | ---------------- | ------ | ------------- |
191
- | `font-weight040` | 400 | Content text |
192
- | `font-weight050` | 500 | Heading, link |
193
-
194
- ### Line Height Reference
195
-
196
- | Token | Value | Usage |
197
- | --------------------- | ----- | -------- |
198
- | `font-line-height030` | 1.25 | All text |
199
-
200
- ## Dimension Reference
201
-
202
- | Token | Value (px) | Usage |
203
- | --------------- | ---------- | ------------------ |
204
- | `dimension-50` | 2 | - |
205
- | `dimension-100` | 4 | Divider margin |
206
- | `dimension-125` | 5 | - |
207
- | `dimension-500` | 20 | Container padding |
208
- | `dimension-750` | 30 | Top/bottom padding |
209
-
210
- ## Colour Modifier Reference
211
-
212
- | Token | Value | Usage |
213
- | ------------------------------------- | ----- | --------------------- |
214
- | `colour-modifier-interactive-hover` | 0.15 | Link hover darkening |
215
- | `colour-modifier-interactive-pressed` | 0.25 | Link active darkening |
216
-
217
- ## Implementation Notes
218
-
219
- ### Why These Tokens?
220
-
221
- 1. **Consistency:** All tokens come from the foundation set, ensuring visual consistency across the design system
222
- 2. **Accessibility:** Color choices ensure WCAG AAA compliance
223
- 3. **Scalability:** Dimension tokens use 4px base unit for predictable spacing
224
- 4. **Responsiveness:** Viewport multipliers allow for one component definition across all screen sizes
225
- 5. **Maintainability:** Using tokens instead of hard-coded values makes theme changes simple
226
-
227
- ### Token Hierarchy
228
-
229
- ```
230
- Foundation Tokens (Base values)
231
- ├── Brand Colors (digital-blue, black, white)
232
- ├── Typography (fonts, sizes, weights, line-heights)
233
- ├── Spacing (dimensions)
234
- └── Modifiers (colour-modifier-interactive-*)
235
- ```
236
-
237
- ### CSS Variable Usage
238
-
239
- All tokens are accessed via CSS custom properties (variables):
240
-
241
- ```css
242
- .tds-comments-disabled__link {
243
- color: var(--tds-foundation-foundation-brand-digital-blue);
244
- font-weight: var(--tds-foundation-font-weight050);
245
- }
246
- ```
247
-
248
- This allows for:
249
-
250
- - Runtime theme switching
251
- - Easy dark mode support in future updates
252
- - Consistent token naming across the design system
253
- - Clear token traceability in browser DevTools
254
-
255
- ## Maintenance
256
-
257
- When updating this component:
258
-
259
- 1. Always check if tokens exist before using hard-coded values
260
- 2. Use the most specific token available (e.g., prefer `font-family040` over generic "sans-serif")
261
- 3. Document any new token usage in this reference
262
- 4. Test on multiple viewports to ensure responsive design works correctly
263
- 5. Verify contrast ratios when changing colors
264
-
265
- ## Related Documentation
266
-
267
- - Design Token Framework: `/packages/tokens/design-token-framework.md`
268
- - CSS Variables File: `/build/css/variables.css`
269
- - Design System Guidelines: `/packages/tokens/README.md`
@@ -1,2 +0,0 @@
1
- export { CommentsDisabled } from './CommentsDisabled';
2
- export type { CommentsDisabledProps } from './CommentsDisabled';
@@ -1,82 +0,0 @@
1
-
2
-
3
- /**
4
- * CommentsDisabled Component Styles
5
- * Maps Times Design System tokens to semantic styles
6
- */
7
-
8
- /* Base Container */
9
- .tds-comments-disabled {
10
- margin-inline: auto;
11
- padding-inline: var(--tds-dimension-500);
12
- width: 100%;
13
- }
14
-
15
- /* Heading */
16
- .tds-comments-disabled__heading {
17
- margin: 0;
18
- padding-top: var(--tds-dimension-750);
19
- padding-bottom: var(--tds-dimension-125);
20
- text-align: center;
21
- color: var(--tds-light-core-light-text-primary);
22
- }
23
-
24
- /* Divider */
25
- .tds-comments-disabled__divider {
26
- margin: var(--tds-dimension-100) auto;
27
- max-width: 522px;
28
- width: 100%;
29
- border: none;
30
- border-top: 1px solid var(--tds-light-core-border-secondary);
31
- opacity: 0.1;
32
- }
33
-
34
- /* Content Text */
35
- .tds-comments-disabled__content {
36
- margin: 0;
37
- padding-bottom: var(--tds-dimension-750);
38
- padding-top: var(--tds-dimension-125);
39
- text-align: center;
40
- color: var(--tds-light-brand-brand-core-ramp-core-neutral-700);
41
- }
42
-
43
- /* Guidelines Link */
44
- .tds-comments-disabled__link {
45
- text-decoration: underline;
46
- color: var(--tds-foundation-brand-digital-blue);
47
- transition: color 0.2s ease-in-out;
48
- cursor: pointer;
49
- }
50
-
51
- .tds-comments-disabled__link:hover {
52
- color: color-mix(
53
- in srgb,
54
- var(--tds-foundation-brand-digital-blue) calc(100% - var(--tds-colour-modifier-interactive-hover) * 100%),
55
- var(--tds-foundation-brand-black)
56
- );
57
- }
58
-
59
- .tds-comments-disabled__link:active {
60
- color: color-mix(
61
- in srgb,
62
- var(--tds-foundation-brand-digital-blue) calc(100% - var(--tds-colour-modifier-interactive-pressed) * 100%),
63
- var(--tds-foundation-brand-black)
64
- );
65
- }
66
-
67
- /* Focus State */
68
- .tds-comments-disabled__link:focus-visible {
69
- outline: 2px solid var(--tds-foundation-brand-digital-blue);
70
- outline-offset: 2px;
71
- }
72
-
73
- /* Responsive */
74
- /* @media (max-width: 768px) {
75
- .tds-comments-disabled__heading {
76
- font-size: calc(var(--tds-font-size040) * var(--tds-viewport-multiplier-small));
77
- }
78
-
79
- .tds-comments-disabled__content {
80
- font-size: calc(var(--tds-font-size030) * var(--tds-viewport-multiplier-small));
81
- }
82
- } */
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
- import './styles.css';
3
-
4
- interface DividerProps {
5
- /** Whether the divider should span full width of its container */
6
- fullWidth?: boolean;
7
- /** Orientation of the divider */
8
- orientation?: 'horizontal' | 'vertical';
9
- /** Custom spacing/margin */
10
- spacing?: 'small' | 'medium' | 'large';
11
- /** CSS class for additional styling */
12
- className?: string;
13
- }
14
-
15
- /** Divider component that uses design tokens for styling */
16
- export const Divider: React.FC<DividerProps> = ({
17
- fullWidth = true,
18
- orientation = 'horizontal',
19
- spacing = 'medium',
20
- className = '',
21
- ...props
22
- }) => {
23
- const baseClass = 'tds-divider';
24
- const orientationClass = `tds-divider--${orientation}`;
25
- const spacingClass = `tds-divider--spacing-${spacing}`;
26
- const widthClass = fullWidth
27
- ? 'tds-divider--full-width'
28
- : 'tds-divider--constrained';
29
-
30
- const classes = [
31
- baseClass,
32
- orientationClass,
33
- spacingClass,
34
- widthClass,
35
- className
36
- ]
37
- .filter(Boolean)
38
- .join(' ');
39
-
40
- return <div className={classes} data-node-id="4042:14179" {...props} />;
41
- };
@@ -1,80 +0,0 @@
1
- /* Divider component styles using design tokens */
2
-
3
- /* Base divider styles */
4
- .tds-divider {
5
- background-color: transparent;
6
- box-sizing: border-box;
7
- }
8
-
9
- /* Horizontal divider (default) */
10
- .tds-divider--horizontal {
11
- height: 1px;
12
- width: 100%;
13
- border-top: 1px solid var(--border-primary, #999999);
14
- border-right: none;
15
- border-bottom: none;
16
- border-left: none;
17
- }
18
-
19
- /* Vertical divider */
20
- .tds-divider--vertical {
21
- width: 1px;
22
- height: 100%;
23
- border-left: 1px solid var(--border-primary, #999999);
24
- border-top: none;
25
- border-right: none;
26
- border-bottom: none;
27
- }
28
-
29
- /* Full width divider */
30
- .tds-divider--full-width {
31
- width: 100%;
32
- margin-left: 0;
33
- margin-right: 0;
34
- }
35
-
36
- /* Constrained width divider */
37
- .tds-divider--constrained {
38
- width: auto;
39
- margin-left: auto;
40
- margin-right: auto;
41
- flex-shrink: 0;
42
- }
43
-
44
- /* Spacing variants */
45
- .tds-divider--spacing-small {
46
- margin-top: var(--tds-dimension-200, 8px);
47
- margin-bottom: var(--tds-dimension-200, 8px);
48
- }
49
-
50
- .tds-divider--spacing-medium {
51
- margin-top: var(--tds-dimension-400, 16px);
52
- margin-bottom: var(--tds-dimension-400, 16px);
53
- }
54
-
55
- .tds-divider--spacing-large {
56
- margin-top: var(--tds-dimension-600, 24px);
57
- margin-bottom: var(--tds-dimension-600, 24px);
58
- }
59
-
60
- /* Vertical spacing for vertical dividers */
61
- .tds-divider--vertical.tds-divider--spacing-small {
62
- margin-left: var(--tds-dimension-200, 8px);
63
- margin-right: var(--tds-dimension-200, 8px);
64
- margin-top: 0;
65
- margin-bottom: 0;
66
- }
67
-
68
- .tds-divider--vertical.tds-divider--spacing-medium {
69
- margin-left: var(--tds-dimension-400, 16px);
70
- margin-right: var(--tds-dimension-400, 16px);
71
- margin-top: 0;
72
- margin-bottom: 0;
73
- }
74
-
75
- .tds-divider--vertical.tds-divider--spacing-large {
76
- margin-left: var(--tds-dimension-600, 24px);
77
- margin-right: var(--tds-dimension-600, 24px);
78
- margin-top: 0;
79
- margin-bottom: 0;
80
- }
@@ -1,62 +0,0 @@
1
- import React from 'react';
2
- import './styles.css';
3
-
4
- interface InputProps {
5
- /** Label text for the input */
6
- label?: string;
7
- /** Input placeholder text */
8
- placeholder?: string;
9
- /** Input type */
10
- type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
11
- /** Input value */
12
- value?: string;
13
- /** Change handler */
14
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
15
- /** Disabled state */
16
- disabled?: boolean;
17
- /** Required state */
18
- required?: boolean;
19
- /** Input name attribute */
20
- name?: string;
21
- /** Input id attribute */
22
- id?: string;
23
- }
24
-
25
- /** Input component with label using design tokens */
26
- export const Input: React.FC<InputProps> = ({
27
- label,
28
- placeholder,
29
- type = 'text',
30
- value,
31
- onChange,
32
- disabled = false,
33
- required = false,
34
- name,
35
- id,
36
- ...props
37
- }) => {
38
- const inputId = id || name;
39
-
40
- return (
41
- <div className="tds-input-wrapper">
42
- {label && (
43
- <label htmlFor={inputId} className="tds-input-label">
44
- {label}
45
- {required && <span className="tds-input-required">*</span>}
46
- </label>
47
- )}
48
- <input
49
- id={inputId}
50
- type={type}
51
- name={name}
52
- className="tds-input"
53
- placeholder={placeholder}
54
- value={value}
55
- onChange={onChange}
56
- disabled={disabled}
57
- required={required}
58
- {...props}
59
- />
60
- </div>
61
- );
62
- };
@@ -1,69 +0,0 @@
1
- /* Input component styles using design tokens */
2
-
3
- .tds-input-wrapper {
4
- display: flex;
5
- flex-direction: column;
6
- gap: var(--tds-dimension-200);
7
- }
8
-
9
- /* Label styles */
10
- .tds-input-label {
11
- font: var(--tds-typography-styles-utility-label-medium);
12
- color: var(--tds-palette-light-core-light-text-primary, #1a1a1a);
13
- display: flex;
14
- align-items: center;
15
- gap: var(--tds-dimension-50);
16
- }
17
-
18
- /* Required asterisk */
19
- .tds-input-required {
20
- color: var(--tds-palette-light-core-light-text-error, #cc0000);
21
- }
22
-
23
- /* Input field styles */
24
- .tds-input {
25
- width: 100%;
26
- padding: var(--tds-dimension-200, 8px) var(--tds-dimension-300, 12px);
27
- font: var(--tds-typography-styles-utility-body-regular-medium);
28
- color: var(--tds-palette-light-core-light-text-primary, #1a1a1a);
29
- background-color: var(--tds-palette-light-core-light-interactive-background-default, #ffffff);
30
- border: 1px solid var(--tds-palette-light-core-light-border-primary, #999999);
31
- border-radius: 0;
32
- transition: all 0.2s ease-in-out;
33
- box-sizing: border-box;
34
- }
35
-
36
- /* Input focus state */
37
- .tds-input:focus {
38
- outline: none;
39
- border-color: var(--text-interactive-primary, #0f4aa2);
40
- box-shadow: 0 0 0 2px rgba(15, 74, 162, 0.1);
41
- }
42
-
43
- /* Input hover state */
44
- .tds-input:hover:not(:disabled) {
45
- border-color: var(--text-interactive-primary, #0f4aa2);
46
- }
47
-
48
- /* Input disabled state */
49
- .tds-input:disabled {
50
- background-color: var(--interactive-background-disabled, #f2f2f2);
51
- color: var(--text-disabled, #999999);
52
- border-color: var(--border-disabled, #cccccc);
53
- cursor: not-allowed;
54
- }
55
-
56
- /* Input placeholder */
57
- .tds-input::placeholder {
58
- color: var(--text-secondary, #666666);
59
- }
60
-
61
- /* Input error state (optional class to apply) */
62
- .tds-input.error {
63
- border-color: var(--text-error, #cc0000);
64
- }
65
-
66
- .tds-input.error:focus {
67
- border-color: var(--text-error, #cc0000);
68
- box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
69
- }
package/src/Link/Link.tsx DELETED
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import './styles.css';
3
- import { cn } from '../utils/cn';
4
-
5
- interface LinkProps {
6
- href: string;
7
- variant?: 'primary' | 'secondary' | 'danger';
8
- onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
9
- target?: '_self' | '_blank' | '_parent' | '_top';
10
- rel?: string;
11
- className?: string;
12
- classes?: string;
13
- styles?: { [key: string]: string };
14
- children?: React.ReactNode;
15
- }
16
-
17
- /** Link UI component for navigation and interactive linking */
18
- export const Link: React.FC<LinkProps> = ({
19
- href,
20
- variant = 'primary',
21
- onClick,
22
- target,
23
- rel,
24
- className,
25
- classes,
26
- styles,
27
- children
28
- }) => {
29
- // If target is _blank, set rel to noopener noreferrer for security
30
- const linkRel =
31
- target === '_blank'
32
- ? rel
33
- ? `${rel} noopener noreferrer`
34
- : 'noopener noreferrer'
35
- : rel;
36
-
37
- return (
38
- <a
39
- href={href}
40
- onClick={onClick}
41
- target={target}
42
- rel={linkRel}
43
- className={cn('tds-link', `tds-link--${variant}`, className || classes)}
44
- style={styles ? styles : undefined}
45
- >
46
- {children}
47
- </a>
48
- );
49
- };