@repobit/dex-system-design 0.25.12 → 1.0.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 (336) hide show
  1. package/CHANGELOG.md +204 -0
  2. package/README.md +131 -8
  3. package/package.json +96 -13
  4. package/schemas/component-manifest.json +3294 -405
  5. package/schemas/manifest-omissions.json +173 -0
  6. package/src/blog/src/breakpoints.js +6 -6
  7. package/src/blog/src/content/blog-atoms-showcase.js +1 -1
  8. package/src/blog/src/content/blog-page-layout.js +2 -2
  9. package/src/blog/src/lib/article-toc.js +7 -7
  10. package/src/blog/src/shell/blog-shell.js +1 -1
  11. package/src/blog/src/tokens/blog.js +2 -2
  12. package/src/blog/src/tokens/core.js +34 -35
  13. package/src/blog/src/tokens/legacy.js +0 -9
  14. package/src/blog/tokens/blog.js +2 -2
  15. package/src/blog/tokens/core.js +34 -35
  16. package/src/blog/tokens/legacy.js +0 -9
  17. package/src/blog/tokens.css +36 -46
  18. package/src/components/accordion/accordion-bg.css.js +83 -59
  19. package/src/components/accordion/accordion-bg.js +29 -10
  20. package/src/components/accordion/accordion-bg.stories.js +67 -67
  21. package/src/components/accordion/accordion-keyboard.js +80 -0
  22. package/src/components/accordion/accordion.css.js +142 -80
  23. package/src/components/accordion/accordion.js +37 -10
  24. package/src/components/accordion/accordion.stories.js +7 -7
  25. package/src/components/agent-endpoints/agent-endpoints.css.js +36 -39
  26. package/src/components/agent-endpoints/agent-endpoints.js +30 -20
  27. package/src/components/agent-endpoints/agent-endpoints.stories.js +1 -1
  28. package/src/components/ai-guardian-demo.stories.js +91 -91
  29. package/src/components/alert/alert.css.js +198 -0
  30. package/src/components/alert/alert.js +103 -0
  31. package/src/components/alert/alert.stories.js +206 -0
  32. package/src/components/anchor/anchor-nav.css.js +213 -101
  33. package/src/components/anchor/anchor-nav.js +26 -40
  34. package/src/components/anchor/anchor.stories.js +22 -12
  35. package/src/components/annotation/annotation.css.js +58 -0
  36. package/src/components/annotation/annotation.js +67 -0
  37. package/src/components/annotation/annotation.stories.js +63 -0
  38. package/src/components/architecture.stories.js +285 -0
  39. package/src/components/atoms.stories.js +342 -0
  40. package/src/components/avatar/avatar.css.js +67 -0
  41. package/src/components/avatar/avatar.js +42 -0
  42. package/src/components/avatar/avatar.stories.js +95 -0
  43. package/src/components/awards/awards-flex.css.js +209 -23
  44. package/src/components/awards/awards-flex.js +66 -7
  45. package/src/components/awards/awards-flex.stories.js +1 -1
  46. package/src/components/awards/{awards-light.stories.js → awards-summary.stories.js} +54 -64
  47. package/src/components/awards/awards.css.js +116 -58
  48. package/src/components/awards/awards.js +102 -28
  49. package/src/components/awards/awards.stories.js +1 -1
  50. package/src/components/back/back.css.js +51 -22
  51. package/src/components/back/back.js +28 -7
  52. package/src/components/back/back.stories.js +9 -3
  53. package/src/components/badge/badge.css.js +158 -46
  54. package/src/components/badge/badge.js +62 -74
  55. package/src/components/badge/badge.stories.js +176 -248
  56. package/src/components/bento-grid/bento-grid.css.js +21 -16
  57. package/src/components/bento-grid/bento-grid.js +16 -4
  58. package/src/components/bento-grid/bento-grid.stories.js +19 -18
  59. package/src/components/bento-grid/bento-item.css.js +52 -28
  60. package/src/components/bento-grid/bento-item.js +2 -2
  61. package/src/components/blockquote/blockquote.css.js +47 -0
  62. package/src/components/blockquote/blockquote.js +29 -0
  63. package/src/components/blockquote/blockquote.stories.js +62 -0
  64. package/src/components/breadcrumb/breadcrumb.css.js +92 -22
  65. package/src/components/breadcrumb/breadcrumb.js +56 -11
  66. package/src/components/button/button.css.js +531 -161
  67. package/src/components/button/button.js +206 -214
  68. package/src/components/button/button.stories.js +322 -174
  69. package/src/components/caption/caption.css.js +21 -0
  70. package/src/components/caption/caption.js +31 -0
  71. package/src/components/caption/caption.stories.js +62 -0
  72. package/src/components/card-features/card-features.css.js +14 -22
  73. package/src/components/card-features/card-features.js +68 -9
  74. package/src/components/card-features/card-features.stories.js +11 -11
  75. package/src/components/cards/card.css.js +60 -81
  76. package/src/components/cards/card.js +56 -25
  77. package/src/components/cards/card.stories.js +39 -39
  78. package/src/components/carousel/carousel.css.js +93 -99
  79. package/src/components/carousel/carousel.js +32 -4
  80. package/src/components/checkbox/checkbox.css.js +111 -93
  81. package/src/components/checkbox/checkbox.js +64 -90
  82. package/src/components/checkbox/checkbox.stories.js +96 -29
  83. package/src/components/code/code.css.js +70 -0
  84. package/src/components/code/code.js +40 -0
  85. package/src/components/code/code.stories.js +73 -0
  86. package/src/components/compare/compare.css.js +179 -43
  87. package/src/components/compare/compare.js +52 -25
  88. package/src/components/compare/compare.stories.js +61 -4
  89. package/src/components/comparison-panel/comparison-panel.css.js +38 -51
  90. package/src/components/comparison-panel/comparison-panel.js +5 -4
  91. package/src/components/comparison-panel/comparison-panel.stories.js +1 -1
  92. package/src/components/compatibility-table/compatibility-table.css.js +180 -80
  93. package/src/components/compatibility-table/compatibility-table.js +37 -9
  94. package/src/components/control-alignment.stories.js +393 -0
  95. package/src/components/cta-banner/cta-banner.css.js +41 -13
  96. package/src/components/cta-banner/cta-banner.js +6 -5
  97. package/src/components/cta-banner/cta-banner.stories.js +43 -98
  98. package/src/components/display/display.css.js +25 -1
  99. package/src/components/display/display.js +46 -13
  100. package/src/components/display/display.stories.js +270 -40
  101. package/src/components/divider/divider-horizontal.js +21 -5
  102. package/src/components/divider/divider-vertical.js +15 -7
  103. package/src/components/divider/divider.css.js +2 -2
  104. package/src/components/divider/divider.stories.js +38 -34
  105. package/src/components/dropdown/dropdown.css.js +93 -126
  106. package/src/components/dropdown/dropdown.js +114 -34
  107. package/src/components/dropdown/dropdown.stories.js +56 -24
  108. package/src/components/features/features.css.js +24 -11
  109. package/src/components/features/features.js +7 -3
  110. package/src/components/features/features.stories.js +37 -37
  111. package/src/components/features-tab/features-tab.css.js +19 -8
  112. package/src/components/features-tab/features-tab.js +6 -5
  113. package/src/components/features-tab/features-tab.stories.js +23 -23
  114. package/src/components/fieldset/fieldset.css.js +30 -0
  115. package/src/components/fieldset/fieldset.js +28 -0
  116. package/src/components/fieldset/fieldset.stories.js +84 -0
  117. package/src/components/footer/footer-links-group.css.js +10 -14
  118. package/src/components/footer/footer-links-group.js +4 -3
  119. package/src/components/footer/footer-lp.css.js +59 -30
  120. package/src/components/footer/footer-lp.js +17 -12
  121. package/src/components/footer/footer-lp.stories.js +63 -75
  122. package/src/components/footer/footer-nav-menu.css.js +26 -4
  123. package/src/components/footer/footer-nav-menu.js +3 -2
  124. package/src/components/footer/footer.css.js +146 -264
  125. package/src/components/footer/footer.js +176 -106
  126. package/src/components/footer/footer.stories.js +9 -9
  127. package/src/components/footer/localeMap.js +1 -1
  128. package/src/components/grid/grid.css.js +1 -1
  129. package/src/components/grid/grid.js +49 -7
  130. package/src/components/grid/grid.stories.js +111 -0
  131. package/src/components/header/header-code.css.js +61 -51
  132. package/src/components/header/header-code.js +28 -14
  133. package/src/components/header/header-code.stories.js +5 -5
  134. package/src/components/header/header.css.js +655 -176
  135. package/src/components/header/header.js +269 -36
  136. package/src/components/header/header.stories.js +841 -18
  137. package/src/components/heading/heading.css.js +14 -17
  138. package/src/components/heading/heading.js +48 -33
  139. package/src/components/heading/heading.stories.js +27 -25
  140. package/src/components/help-text/help-text.css.js +21 -0
  141. package/src/components/help-text/help-text.js +25 -0
  142. package/src/components/help-text/help-text.stories.js +66 -0
  143. package/src/components/highlight/highlight.css.js +86 -64
  144. package/src/components/highlight/highlight.js +18 -27
  145. package/src/components/highlight/highlight.stories.js +14 -3
  146. package/src/components/icons/analysis-icon.js +6 -16
  147. package/src/components/icons/arrow-down-icon.js +6 -19
  148. package/src/components/icons/arrow-icon.js +44 -0
  149. package/src/components/icons/arrow-right-icon.js +30 -23
  150. package/src/components/icons/arrow-up-icon.js +19 -18
  151. package/src/components/icons/bd-ai-icon.js +1 -1
  152. package/src/components/icons/brand-marks.stories.js +279 -0
  153. package/src/components/icons/brand-signature-icon.js +42 -0
  154. package/src/components/icons/check-icon.js +27 -0
  155. package/src/components/icons/circle-info-icon.js +33 -0
  156. package/src/components/icons/close-icon.js +6 -18
  157. package/src/components/icons/family-icon.js +8 -20
  158. package/src/components/icons/globe-icon.js +6 -18
  159. package/src/components/icons/guide-icon.js +6 -18
  160. package/src/components/icons/icon-element.js +99 -0
  161. package/src/components/icons/icons.js +36 -0
  162. package/src/components/icons/icons.stories.js +184 -52
  163. package/src/components/icons/individual-icon.js +6 -18
  164. package/src/components/icons/laurel-icon.js +9 -19
  165. package/src/components/icons/machine-learning-icon.js +6 -17
  166. package/src/components/icons/marks.js +41 -0
  167. package/src/components/icons/minus-icon.js +7 -21
  168. package/src/components/icons/missing-icon.js +52 -0
  169. package/src/components/icons/plus-icon.js +7 -21
  170. package/src/components/icons/quote-icon.js +19 -19
  171. package/src/components/image/image.css.js +72 -25
  172. package/src/components/image/image.js +11 -6
  173. package/src/components/image/image.stories.js +2 -2
  174. package/src/components/input/custom-form.stories.js +214 -62
  175. package/src/components/input/input-clipboard.css.js +51 -144
  176. package/src/components/input/input-clipboard.js +31 -15
  177. package/src/components/input/input.css.js +8 -146
  178. package/src/components/input/input.js +93 -38
  179. package/src/components/install-options/install-options.css.js +84 -77
  180. package/src/components/install-options/install-options.js +33 -30
  181. package/src/components/install-options/install-options.stories.js +3 -3
  182. package/src/components/label/label.css.js +35 -0
  183. package/src/components/label/label.js +38 -0
  184. package/src/components/label/label.stories.js +82 -0
  185. package/src/components/light-carousel/light-carousel.css.js +111 -63
  186. package/src/components/light-carousel/light-carousel.js +85 -11
  187. package/src/components/light-carousel/light-carousel.stories.js +126 -82
  188. package/src/components/link/link.css.js +150 -99
  189. package/src/components/link/link.js +86 -11
  190. package/src/components/link/link.stories.js +124 -30
  191. package/src/components/list/list-item/list-item.css.js +74 -22
  192. package/src/components/list/list-item/list-item.js +32 -10
  193. package/src/components/list/list-item/list-item.stories.js +23 -23
  194. package/src/components/list/list.css.js +8 -2
  195. package/src/components/list/list.js +3 -2
  196. package/src/components/list/list.stories.js +222 -0
  197. package/src/components/modal/modal.css.js +114 -24
  198. package/src/components/modal/modal.js +83 -7
  199. package/src/components/modal/modal.stories.js +9 -9
  200. package/src/components/overview/overview.css.js +19 -14
  201. package/src/components/overview/overview.js +6 -5
  202. package/src/components/overview/overview.stories.js +10 -10
  203. package/src/components/page-switcher/page-switcher.css.js +97 -40
  204. package/src/components/page-switcher/page-switcher.js +28 -5
  205. package/src/components/page-switcher/page-switcher.stories.js +95 -0
  206. package/src/components/paragraph/paragraph.css.js +15 -10
  207. package/src/components/paragraph/paragraph.js +41 -44
  208. package/src/components/paragraph/paragraph.stories.js +56 -21
  209. package/src/components/picture/picture.css.js +103 -44
  210. package/src/components/picture/picture.js +100 -30
  211. package/src/components/picture/picture.stories.js +1 -1
  212. package/src/components/pricing-cards/new-pricing-card.js +3 -3
  213. package/src/components/pricing-cards/new-pricing.css.js +24 -15
  214. package/src/components/pricing-cards/pricing-card-actions.css.js +1 -1
  215. package/src/components/pricing-cards/pricing-card-actions.js +3 -4
  216. package/src/components/pricing-cards/pricing-card-container.css.js +3 -3
  217. package/src/components/pricing-cards/pricing-card-container.js +3 -2
  218. package/src/components/pricing-cards/pricing-card-header.css.js +10 -8
  219. package/src/components/pricing-cards/pricing-card-header.js +6 -7
  220. package/src/components/pricing-cards/pricing-card-pricing.css.js +16 -9
  221. package/src/components/pricing-cards/pricing-card-pricing.js +8 -6
  222. package/src/components/pricing-cards/pricing-card-show-more.css.js +11 -3
  223. package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
  224. package/src/components/pricing-cards/pricing-card.css.js +244 -190
  225. package/src/components/pricing-cards/pricing-card.js +54 -70
  226. package/src/components/pricing-cards/pricing-feature-item.css.js +25 -8
  227. package/src/components/pricing-cards/pricing-feature-item.js +8 -3
  228. package/src/components/process-steps/process-steps.css.js +26 -14
  229. package/src/components/process-steps/process-steps.js +23 -6
  230. package/src/components/process-steps/process-steps.stories.js +1 -1
  231. package/src/components/progress/progress.css.js +80 -0
  232. package/src/components/progress/progress.js +42 -0
  233. package/src/components/progress/progress.stories.js +79 -0
  234. package/src/components/quick-answer/quick-answer.css.js +75 -13
  235. package/src/components/quick-answer/quick-answer.js +8 -3
  236. package/src/components/radio/radio.css.js +92 -128
  237. package/src/components/radio/radio.js +106 -127
  238. package/src/components/radio/radio.stories.js +54 -19
  239. package/src/components/review/review-grid.css.js +5 -6
  240. package/src/components/review/review-grid.js +14 -11
  241. package/src/components/review/review.css.js +11 -6
  242. package/src/components/review/review.js +3 -8
  243. package/src/components/shared/ensemble.css.js +93 -0
  244. package/src/components/shared/form-field.css.js +206 -0
  245. package/src/components/shared/prop-vocabulary.js +48 -0
  246. package/src/components/shared/token-scales.js +306 -0
  247. package/src/components/skeleton/skeleton.css.js +34 -0
  248. package/src/components/skeleton/skeleton.js +32 -0
  249. package/src/components/skeleton/skeleton.stories.js +70 -0
  250. package/src/components/spinner/spinner.css.js +62 -0
  251. package/src/components/spinner/spinner.js +38 -0
  252. package/src/components/spinner/spinner.stories.js +92 -0
  253. package/src/components/spotlight-section/spotlight-section.css.js +14 -13
  254. package/src/components/spotlight-section/spotlight-section.js +42 -39
  255. package/src/components/switch/switch.css.js +103 -0
  256. package/src/components/switch/switch.js +44 -0
  257. package/src/components/switch/switch.stories.js +86 -0
  258. package/src/components/tab-list/content-switcher.stories.js +189 -0
  259. package/src/components/tab-list/tab-list.css.js +250 -0
  260. package/src/components/tab-list/tab-list.js +184 -0
  261. package/src/components/tab-list/tab-list.stories.js +221 -0
  262. package/src/components/tabs/tabs.css.js +14 -123
  263. package/src/components/tabs/tabs.js +16 -19
  264. package/src/components/tabs/tabs.stories.js +95 -95
  265. package/src/components/tag/tag.css.js +54 -0
  266. package/src/components/tag/tag.js +32 -0
  267. package/src/components/tag/tag.stories.js +126 -0
  268. package/src/components/terminal/terminal-message.css.js +164 -60
  269. package/src/components/terminal/terminal-message.js +5 -5
  270. package/src/components/terminal/terminal-message.stories.js +70 -1
  271. package/src/components/termsOfUse/terms.css.js +25 -20
  272. package/src/components/termsOfUse/terms.js +13 -9
  273. package/src/components/termsOfUse/terms.stories.js +1 -1
  274. package/src/components/textarea/textarea.css.js +51 -0
  275. package/src/components/textarea/textarea.js +136 -0
  276. package/src/components/textarea/textarea.stories.js +191 -0
  277. package/src/components/tooltip/tooltip.css.js +75 -0
  278. package/src/components/tooltip/tooltip.js +156 -0
  279. package/src/components/tooltip/tooltip.stories.js +161 -0
  280. package/src/components/trust-panel/trust-panel.css.js +85 -33
  281. package/src/components/trust-panel/trust-panel.js +18 -10
  282. package/src/components/trust-panel/trust-panel.stories.js +1 -1
  283. package/src/components/ultimate-security-demo.stories.js +431 -0
  284. package/src/components/video/video.css.js +17 -0
  285. package/src/components/video/video.js +40 -0
  286. package/src/components/video/video.stories.js +106 -0
  287. package/src/components/video-player/video-player.css.js +67 -11
  288. package/src/components/video-player/video-player.js +35 -4
  289. package/src/components/video-player/video-player.stories.js +1 -1
  290. package/src/components/visual-alignment.stories.js +411 -0
  291. package/src/components/visually-hidden/visually-hidden.css.js +24 -0
  292. package/src/components/visually-hidden/visually-hidden.js +16 -0
  293. package/src/components/visually-hidden/visually-hidden.stories.js +56 -0
  294. package/src/stories/Button.stories.js +17 -17
  295. package/src/stories/Header.stories.js +10 -10
  296. package/src/stories/Page.js +1 -1
  297. package/src/stories/Page.stories.js +6 -6
  298. package/src/tokens/borders.stories.js +339 -0
  299. package/src/tokens/color-responsibilities.stories.js +227 -0
  300. package/src/tokens/dark-derivation.js +309 -0
  301. package/src/tokens/dark-findings.js +197 -0
  302. package/src/tokens/dark-mode.stories.js +207 -0
  303. package/src/tokens/dimension.stories.js +251 -0
  304. package/src/tokens/elevation.stories.js +143 -0
  305. package/src/tokens/focus.stories.js +276 -0
  306. package/src/tokens/fonts.css +20 -20
  307. package/src/tokens/fonts.stories.js +354 -374
  308. package/src/tokens/layout.css +25 -11
  309. package/src/tokens/motion.stories.js +231 -0
  310. package/src/tokens/shape.stories.js +272 -0
  311. package/src/tokens/spacing-rhythm.stories.js +359 -0
  312. package/src/tokens/spacing.stories.js +208 -703
  313. package/src/tokens/story-chrome.js +503 -0
  314. package/src/tokens/surfaces.stories.js +224 -0
  315. package/src/tokens/text-on-surface.stories.js +164 -0
  316. package/src/tokens/token-map.js +220 -0
  317. package/src/tokens/token-map.stories.js +257 -0
  318. package/src/tokens/token-purposes.js +266 -0
  319. package/src/tokens/tokens-grid.stories.js +388 -900
  320. package/src/tokens/tokens.css +1633 -1045
  321. package/src/tokens/tokens.js +1130 -492
  322. package/src/tokens/tokens.stories.js +137 -47
  323. package/src/tokens/type-ceiling-words.js +299 -0
  324. package/src/tokens/typography.stories.js +1003 -965
  325. package/src/tokens/vertical-rhythm.stories.js +224 -0
  326. package/src/components/awards/awards-icon.js +0 -56
  327. package/src/components/awards/awards-light.js +0 -240
  328. package/src/components/banner/banner.js +0 -60
  329. package/src/components/banner/banner.stories.js +0 -51
  330. package/src/components/button/icons.js +0 -24
  331. package/src/components/input/index.js +0 -0
  332. package/src/components/light-carousel/light-carousel-simple.css.js +0 -183
  333. package/src/components/light-carousel/light-carousel-simple.js +0 -74
  334. package/src/tokens/colors.js +0 -121
  335. package/src/tokens/typography.css.js +0 -207
  336. package/src/tokens/typography.js +0 -0
@@ -1,166 +1,217 @@
1
1
  import { css } from "lit";
2
2
 
3
+ /**
4
+ * bd-link.
5
+ *
6
+ * The base rule reads --typography-link-default-*, which had fourteen tokens
7
+ * and no consumer: the component re-spelled every one of them in primitives.
8
+ * The underline offset was a 2px literal in seven places, on a property the
9
+ * length rule does not check, so nothing could see it and nothing could change
10
+ * it in one move.
11
+ *
12
+ * Colour comes from the semantic text roles. The default was --color-blue-500,
13
+ * which is 4.53:1 on white — the step CLAUDE.md names as the one to avoid for
14
+ * text, and the atom's own bold variant already avoided it.
15
+ */
3
16
  export default css`
4
17
  .bd-link {
5
18
  display: inline-flex;
6
19
  align-items: center;
7
20
  gap: var(--spacing-4);
8
- color: var(--color-blue-500);
9
- text-decoration: none;
10
21
  font-family: var(--typography-fontFamily-sans);
11
- font-size: var(--typography-fontSize-base);
12
- font-weight: var(--typography-fontWeight-normal);
13
- line-height: var(--typography-lineHeight-normal);
14
- transition: all 0.15s ease-in-out;
22
+ font-size: var(--typography-link-standalone-fontSize);
23
+ font-weight: var(--typography-link-default-fontWeight);
24
+ line-height: var(--typography-link-standalone-lineHeight);
25
+ color: var(--bd-link-color, var(--color-text-brand));
26
+ text-decoration: none;
27
+ text-underline-offset: var(--typography-link-underlineOffset);
15
28
  cursor: pointer;
16
- }
17
-
18
- /* Primary (default) */
29
+ /* the properties that actually change, rather than all: a link that
30
+ animates every property also animates the ones it inherits */
31
+ transition: color var(--transition-duration-fast) var(--transition-easing-smooth),
32
+ text-decoration-color var(--transition-duration-fast) var(--transition-easing-smooth);
33
+ }
34
+
35
+ /* ---- inline ------------------------------------------------------------
36
+ A link in a sentence is that sentence's text, so it takes its type from
37
+ the sentence. --typography-link-default-* is the role that says so: size,
38
+ leading, tracking and family are all inherit. Four of those axes had no
39
+ consumer, because the base rule above reads the standalone role instead --
40
+ 1rem and 1.5 regardless of context -- which is why an inline link measured
41
+ 16px inside a 12px caption and inside a 32px lede alike.
42
+
43
+ display returns to inline as well. An inline-flex box does not hug its
44
+ own text: in a 220px column the same link measured the full 220px where a
45
+ plain <a> measured 209px, so it does not sit in the line the way a real
46
+ inline element does. The gap and align-items above go inert with it, which
47
+ is correct here -- an inline link is a run of text, not a row. */
48
+ :host([inline]) .bd-link {
49
+ display: inline;
50
+ font-size: var(--typography-link-default-fontSize);
51
+ line-height: var(--typography-link-default-lineHeight);
52
+ letter-spacing: var(--typography-link-default-letterSpacing);
53
+ font-family: var(--typography-link-default-fontFamily);
54
+ }
55
+
56
+ /* ---- kinds ------------------------------------------------------------ */
19
57
  .bd-link--primary {
20
- color: var(--color-blue-500);
58
+ color: var(--bd-link-color, var(--color-text-brand));
21
59
  }
22
-
23
60
  .bd-link--primary:hover {
24
- color: var(--color-blue-700);
61
+ color: var(--color-text-brand-hover);
25
62
  text-decoration: underline;
26
- text-underline-offset: 2px;
27
63
  }
28
64
 
29
- /* Secondary */
30
65
  .bd-link--secondary {
31
- color: var(--color-neutral-600);
66
+ color: var(--bd-link-color, var(--color-text-muted));
32
67
  }
33
-
34
68
  .bd-link--secondary:hover {
35
- color: var(--color-neutral-800);
69
+ color: var(--color-text-secondary);
36
70
  text-decoration: underline;
37
- text-underline-offset: 2px;
38
- }
39
-
40
- /* ============================================
41
- ACTIVE STATE - FONT WEIGHT 700
42
- ============================================ */
43
-
44
- .bd-link--active {
45
- font-weight: 700 !important;
46
- }
47
-
48
- /* Poți adăuga și alte stiluri pentru active dacă dorești */
49
- .bd-link--active.bd-link--primary {
50
- color: var(--color-neutral-900);
51
- }
52
-
53
- .bd-link--active.bd-link--secondary {
54
- color: var(--color-neutral-900);
55
- }
56
-
57
-
58
- .bd-link--no-underline:hover,
59
- .bd-link--no-underline.bd-link--primary:hover,
60
- .bd-link--no-underline.bd-link--secondary:hover,
61
- .bd-link--no-underline.bd-link--danger:hover,
62
- .bd-link--no-underline.bd-link--bold:hover,
63
- .bd-link--no-underline.bd-link--subtle:hover {
64
- text-decoration: none !important;
65
71
  }
66
72
 
67
-
68
-
69
- .bd-link--no-underline.bd-link--secondary:hover {
70
- color: var(--color-neutral-800) !important;
73
+ .bd-link--subtle {
74
+ color: var(--bd-link-color, var(--color-text-subtle));
75
+ text-decoration: none;
71
76
  }
72
-
73
- /* Light variant for dark backgrounds */
74
- .bd-link--light {
75
- color: var(--color-neutral-0);
77
+ .bd-link--subtle:hover {
78
+ color: var(--color-text-secondary);
79
+ text-decoration: underline;
76
80
  }
77
81
 
78
- .bd-link--light:hover {
79
- color: var(--color-neutral-0);
82
+ .bd-link--bold {
83
+ color: var(--bd-link-color, var(--color-text-brand));
84
+ /* no role: the bold modifier on a link -- a state or modifier weight, not a text-content
85
+ type. See button.css.js's .button--bold for the argument. */
86
+ font-weight: var(--typography-fontWeight-semibold);
80
87
  text-decoration: none;
81
88
  }
89
+ .bd-link--bold:hover {
90
+ color: var(--color-text-brand-hover);
91
+ text-decoration: underline;
92
+ }
82
93
 
83
- /* Danger */
94
+ /* Red on a link is the error role, not bd-button's accent. The button's red
95
+ is this system's conversion colour and it deliberately has no danger kind;
96
+ a link is the opposite case — red text reads as a warning about where the
97
+ link goes, so it takes --color-text-error and says so. */
84
98
  .bd-link--danger {
85
- color: var(--color-red-500);
99
+ color: var(--bd-link-color, var(--color-text-error));
86
100
  }
87
-
88
101
  .bd-link--danger:hover {
89
- color: var(--color-red-700);
102
+ color: var(--color-text-error);
90
103
  text-decoration: underline;
91
- text-underline-offset: 2px;
92
104
  }
93
105
 
94
- /* Subtle */
95
- .bd-link--subtle {
96
- color: var(--color-neutral-500);
97
- text-decoration: none;
106
+ /* ---- surface ----------------------------------------------------------
107
+ The same attribute bd-button uses to say the same thing. It replaces the
108
+ light kind, which described the surface rather than the link and could
109
+ not be combined with any of the kinds above. */
110
+ :host([surface="dark"]) .bd-link,
111
+ :host([surface="dark"]) .bd-link--primary,
112
+ :host([surface="dark"]) .bd-link--secondary,
113
+ :host([surface="dark"]) .bd-link--subtle,
114
+ :host([surface="dark"]) .bd-link--bold {
115
+ color: var(--color-text-inverse);
98
116
  }
99
117
 
100
- .bd-link--subtle:hover {
101
- color: var(--color-neutral-700);
118
+ /* Colour only. This rule used to carry text-decoration: underline as well,
119
+ and at (0,4,0) it outweighed .bd-link--no-underline:hover at (0,2,0) --
120
+ so a link explicitly asking for no underline got one anyway, but only on a
121
+ dark surface. Measured: dark/primary/no-underline went none -> underline on
122
+ hover, where the same link on a light surface stayed none.
123
+
124
+ The underline is the kinds' business, and every kind already declares it. */
125
+ :host([surface="dark"]) .bd-link:hover {
126
+ color: var(--color-text-inverse);
127
+ }
128
+
129
+ /* ---- modifiers --------------------------------------------------------
130
+ Ordered after the kinds rather than marked !important. Four declarations
131
+ carried it before, which made the atom unoverridable by a consuming page —
132
+ the exact failure the cascade-layer token work was done to avoid. */
133
+ .bd-link--underline {
102
134
  text-decoration: underline;
103
- text-underline-offset: 2px;
135
+ }
136
+ .bd-link--underline:hover {
137
+ text-decoration-thickness: var(--typography-link-underlineThickness);
104
138
  }
105
139
 
106
- /* Bold */
107
- .bd-link--bold {
108
- color: var(--color-blue-600);
109
- font-weight: var(--typography-fontWeight-semibold);
140
+ .bd-link--no-underline,
141
+ .bd-link--no-underline:hover {
110
142
  text-decoration: none;
111
143
  }
112
144
 
113
- .bd-link--bold:hover {
114
- color: var(--color-blue-800);
115
- text-decoration: underline;
116
- text-underline-offset: 2px;
145
+ .bd-link--active {
146
+ /* no role: a link in its active state -- a state or modifier weight, not a text-content
147
+ type. See button.css.js's .button--bold for the argument. */
148
+ font-weight: var(--typography-fontWeight-bold);
149
+ color: var(--color-text-primary);
117
150
  }
118
151
 
119
- /* Underline modifier */
120
- .bd-link--underline {
121
- text-decoration: underline;
122
- text-underline-offset: 2px;
123
- }
152
+ /* The current item does not move under the pointer.
124
153
 
125
- .bd-link--underline:hover {
126
- text-decoration-thickness: 2px;
154
+ --active and --primary are both present on a current nav item, and
155
+ .bd-link--primary:hover at (0,2,0) outweighs .bd-link--active at (0,1,0)
156
+ -- so without this rule hovering the page you are already on turned it
157
+ back to the brand ink, which is the one thing that colour is not supposed
158
+ to mean here. Measured on bd-page-switcher before the wayfinding family
159
+ review: current + hover reported action/primary-active, the only one of
160
+ the three that recoloured an item the reader had already arrived at.
161
+
162
+ Same specificity as the kind hovers and declared after them, so it wins
163
+ on order. */
164
+ .bd-link--active:hover {
165
+ color: var(--color-text-primary);
127
166
  }
128
167
 
129
- /* Disabled state */
130
- .bd-link--disabled {
131
- color: var(--color-neutral-400);
168
+ /* ---- states ----------------------------------------------------------- */
169
+ .bd-link--disabled,
170
+ span.bd-link--disabled {
171
+ color: var(--color-text-disabled);
132
172
  cursor: not-allowed;
133
173
  text-decoration: none;
134
174
  pointer-events: none;
135
175
  }
136
176
 
137
- /* Focus styles */
138
177
  .bd-link:focus {
139
178
  outline: none;
140
179
  }
141
180
 
142
181
  .bd-link:focus-visible {
143
- outline: 2px solid var(--color-blue-300);
144
- outline-offset: 2px;
145
- border-radius: 2px;
146
- }
147
-
148
- /* Ensure disabled span has same display */
149
- .bd-link.bd-link--disabled {
150
- display: inline-flex;
151
- align-items: center;
182
+ /* the one focus ring — see Foundations/Focus. A two-colour ring whose
183
+ white inner band keeps it visible on a coloured or dark surface, which a
184
+ single-colour outline cannot do. */
185
+ outline: none;
186
+ box-shadow: var(--focus-outline-primary);
187
+ border-radius: var(--focus-outline-radius);
152
188
  }
153
189
 
154
- /* Additional specificity for edge cases */
155
190
  a.bd-link {
156
191
  cursor: pointer;
157
192
  }
158
193
 
194
+ /* There is no element-qualified reset here, and that is the point.
195
+
196
+ The anchor's underline is already off: .bd-link sets text-decoration none,
197
+ and an author rule beats the UA stylesheet whatever its specificity. What
198
+ the old a.bd-link:not(.bd-link--underline) rule added was weight -- (0,2,1)
199
+ against the (0,2,0) of every .bd-link--<kind>:hover -- so the hover
200
+ underline each of the five kinds declares lost the cascade and never
201
+ painted. Measured on light surfaces: primary, secondary, subtle, bold and
202
+ danger all went none -> none across a hover. On a dark surface the same
203
+ hover underlined, because that rule is (0,4,0) and outweighed the reset.
204
+
205
+ The kinds and the modifiers sort themselves out on class weight alone, in
206
+ source order: --underline and --no-underline are declared after the kinds,
207
+ so they still win. */
159
208
  span.bd-link {
160
209
  cursor: default;
161
210
  }
162
211
 
163
- span.bd-link--disabled {
164
- cursor: not-allowed;
212
+ @media (prefers-reduced-motion: reduce) {
213
+ .bd-link {
214
+ transition: none;
215
+ }
165
216
  }
166
- `;
217
+ `;
@@ -1,39 +1,87 @@
1
1
  import { LitElement, html } from "lit";
2
- import { tokens } from "../../tokens/tokens.js";
2
+ // Installs the design tokens into document scope; see src/tokens/tokens.js
3
+ import "../../tokens/tokens.js";
3
4
  import linkCSS from "./link.css.js";
5
+ import { fontSize, color } from "../shared/token-scales.js";
6
+
7
+ /**
8
+ * The anchor -- or, when disabled, the span -- is exposed as `part="link"`.
9
+ *
10
+ * It is the element that carries the ink, the padding and the focus ring, and
11
+ * until now nothing outside this shadow root could reach it. That is not a
12
+ * theoretical gap: bd-breadcrumb's mobile layout put a full-width padded pill
13
+ * on the bd-link HOST, and the anchor inside stayed the width of its own text,
14
+ * so a 343x40 row offered a 43x24 target -- 7.5% of what it looked like. A
15
+ * part is the seam for the cases where the box a consumer needs to style and
16
+ * the box the browser makes focusable have to be the same box.
17
+ *
18
+ * It is a seam, not a licence to restyle the atom: reach for a variant first.
19
+ */
20
+
21
+ /**
22
+ * kind values that described something else, mapped onto what they meant so
23
+ * existing markup keeps working. `light` said "on a dark surface", which is
24
+ * what the surface attribute says now.
25
+ */
26
+ const LEGACY_KINDS = { light: "primary" };
27
+ const VARIANTS = ["primary", "secondary", "subtle", "bold", "danger"];
4
28
 
5
29
  class BdLink extends LitElement {
6
30
  static properties = {
7
31
  href : { type: String },
8
32
  target : { type: String },
9
- kind : { type: String, reflect: true },
33
+ variant : { type: String, reflect: true },
34
+ /** @deprecated pass `variant`. */
35
+ kind : { type: String },
10
36
  underline : { type: Boolean, reflect: true },
11
37
  noUnderline: { type: Boolean, attribute: "no-underline" },
12
38
  disabled : { type: Boolean, reflect: true },
13
39
  fontSize : { type: String, attribute: "font-size" },
40
+ /* The link is a run of text in a sentence and takes its type from that
41
+ sentence. Off by default: 62 of the 66 bd-link usages in this package
42
+ rely on the standalone role's 1rem, so inheriting cannot be the default
43
+ without repositioning all of them. */
44
+ inline : { type: Boolean, reflect: true },
14
45
  color : { type: String },
15
- active : { type: Boolean, reflect: true }
46
+ active : { type: Boolean, reflect: true },
47
+ /* The surface the link sits on, the same attribute bd-button uses. It
48
+ replaces kind="light", which described the surface rather than the link
49
+ and so could not be combined with any of the real kinds. */
50
+ surface : { type: String, reflect: true }
16
51
  };
17
52
 
18
53
  constructor() {
19
54
  super();
20
55
  this.href = "#";
21
56
  this.target = "_self";
22
- this.kind = "primary";
57
+ this.variant = "primary";
58
+ this.kind = "";
23
59
  this.underline = false;
24
60
  this.noUnderline = false;
25
61
  this.disabled = false;
26
62
  this.fontSize = "";
63
+ this.inline = false;
27
64
  this.color = "";
28
65
  this.active = false;
66
+ this.surface = "light";
29
67
  }
30
68
 
31
- static styles = [tokens, linkCSS];
69
+ willUpdate(changed) {
70
+ if (!changed.has("kind") && !changed.has("variant")) return;
71
+ if (changed.has("kind") && this.kind) this.variant = this.kind;
72
+ // light meant "this link is on a dark surface", which the surface
73
+ // attribute says now
74
+ if (this.variant === "light") this.surface = "dark";
75
+ if (LEGACY_KINDS[this.variant]) this.variant = LEGACY_KINDS[this.variant];
76
+ if (!VARIANTS.includes(this.variant)) this.variant = "primary";
77
+ }
78
+
79
+ static styles = [linkCSS];
32
80
 
33
81
  get _classes() {
34
82
  return [
35
83
  "bd-link",
36
- `bd-link--${this.kind}`,
84
+ `bd-link--${this.variant}`,
37
85
  this.underline ? "bd-link--underline" : "",
38
86
  this.noUnderline ? "bd-link--no-underline" : "",
39
87
  this.active ? "bd-link--active" : "",
@@ -41,17 +89,43 @@ class BdLink extends LitElement {
41
89
  ].filter(Boolean).join(" ");
42
90
  }
43
91
 
92
+ /**
93
+ * font-size is a type-scale step and color is a semantic role; both are
94
+ * resolved to token references by shared/token-scales.js, and anything off
95
+ * the scale is dropped.
96
+ *
97
+ * `color` is emitted as --bd-link-color rather than as `color`, and that is
98
+ * the whole of the fix. A style attribute beats every rule in this
99
+ * stylesheet, so a link with a colour prop had NO hover, NO active and NO
100
+ * disabled appearance -- the resting ink won in all four states. Measured on
101
+ * bd-anchor-nav, which passes color="strong": rest, hover and mouse-down all
102
+ * reported neutral-900 at weight 400, so the links were inert under the
103
+ * pointer. Four sites pass the prop today and all four were affected.
104
+ *
105
+ * As a custom property it is the *resting* colour instead: the kind rules
106
+ * below read it through a var() fallback, and the :hover, --active and
107
+ * --disabled rules keep plain `color` declarations, so they win the way they
108
+ * were always meant to.
109
+ *
110
+ * font-size is not emitted at all when inline is set, because the two ask
111
+ * contradictory questions: inline means the sentence decides the size. It is
112
+ * dropped here rather than left to lose a specificity argument in the
113
+ * stylesheet -- this is a style attribute, so it would beat
114
+ * :host([inline]) and pull the link back out of the line box that mode
115
+ * exists to keep it in.
116
+ */
44
117
  get _inlineStyle() {
45
- const styles = [];
46
- if (this.fontSize) styles.push(`font-size: ${this.fontSize}`);
47
- if (this.color) styles.push(`color: ${this.color}`);
48
- return styles.join("; ");
118
+ return [
119
+ ["font-size", this.inline ? "" : fontSize(this.fontSize)],
120
+ ["--bd-link-color", color(this.color)]
121
+ ].filter(([, v]) => v).map(([prop, v]) => `${prop}: ${v}`)
122
+ .join("; ");
49
123
  }
50
124
 
51
125
  render() {
52
126
  if (this.disabled) {
53
127
  return html`
54
- <span class="${this._classes}" style="${this._inlineStyle}">
128
+ <span part="link" class="${this._classes}" style="${this._inlineStyle}">
55
129
  <slot></slot>
56
130
  </span>
57
131
  `;
@@ -59,6 +133,7 @@ class BdLink extends LitElement {
59
133
 
60
134
  return html`
61
135
  <a
136
+ part="link"
62
137
  class="${this._classes}"
63
138
  style="${this._inlineStyle}"
64
139
  href="${this.href}"