@repobit/dex-system-design 0.25.12 → 0.26.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 +187 -0
  2. package/README.md +131 -8
  3. package/package.json +95 -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,302 +1,230 @@
1
1
  import { html } from 'lit';
2
2
  import './badge.js';
3
3
 
4
+ const TONES = ['default', 'primary', 'success', 'warning', 'error', 'info'];
5
+ const SIZES = ['sm', 'md', 'lg'];
6
+ const VARIANTS = ['shade', 'fill'];
7
+
8
+ /* flex-wrap, because a row of chips is wider than a phone. Measured at 320:
9
+ Tones pushed the page 156px wide, Count 22px and With icon 4px, and the
10
+ badges themselves were correct -- inline-flex with white-space: nowrap, which
11
+ is what a chip label should do. The overflow was this container refusing to
12
+ wrap, so it is fixed here rather than in the component. */
13
+ const row = (label, cells) => html`
14
+ <div style="display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-16);margin-bottom:var(--spacing-12)">
15
+ <code style="min-width:7ch;font-size:var(--typography-fontSize-xs);color:var(--color-neutral-600)">${label}</code>
16
+ ${cells}
17
+ </div>
18
+ `;
19
+
4
20
  export default {
5
- title : 'Components/Badge',
21
+ title : 'Atoms/Badge',
6
22
  tags : ['autodocs'],
7
23
  parameters: {
8
24
  docs: {
9
25
  description: {
10
26
  component: `
11
- **BdBadge** is a Lit web component that renders a styled pill/badge with optional icon, size, color, and variant support.
27
+ **BdBadge** renders a pill that labels or counts something. It has four
28
+ independent axes — \`mode\`, \`size\`, \`tone\` and \`variant\` — which together
29
+ cover the full \`ds-badge\` set.
30
+
31
+ Every value comes from \`src/tokens/tokens.js\`. Nothing is hardcoded and
32
+ nothing was copied out of the design tool as a literal: each measurement was
33
+ matched to the token that already carries it.
12
34
 
13
35
  ### Usage
14
36
  \`\`\`html
15
- <bd-badge color="#026DFF" size="md">New</bd-badge>
16
- <bd-badge size="lg" icon="individual">Personal</bd-badge>
17
- <bd-badge size="sm" icon="family">Family</bd-badge>
37
+ <bd-badge tone="success" variant="shade">Save 44%</bd-badge>
38
+ <bd-badge tone="primary" variant="fill" size="sm">New</bd-badge>
39
+ <bd-badge mode="count" tone="error" variant="fill">3</bd-badge>
40
+ <bd-badge mode="dot" tone="warning" variant="fill"></bd-badge>
41
+ <bd-badge tone="primary" variant="fill" icon="family">Family Pack</bd-badge>
18
42
  \`\`\`
19
43
 
20
44
  ### Props
21
45
  | Prop | Values | Default |
22
46
  |---|---|---|
23
- | \`color\` | Any hex or CSS color | \`#026DFF\` |
24
- | \`variant\` | Any string class name | \`''\` |
47
+ | \`mode\` | \`text\`, \`dot\`, \`count\` | \`text\` |
25
48
  | \`size\` | \`sm\`, \`md\`, \`lg\` | \`md\` |
26
- | \`fontsize\` | \`12\`, \`14\`, \`16\` | \`14\` |
49
+ | \`tone\` | \`default\`, \`primary\`, \`success\`, \`warning\`, \`error\`, \`info\` | \`default\` |
50
+ | \`variant\` | \`shade\`, \`fill\` | \`shade\` |
27
51
  | \`icon\` | \`individual\`, \`family\`, \`''\` | \`''\` |
52
+ | \`label\` | any string — accessible name for \`mode="dot"\` | tone name |
53
+
54
+ ### Tokens
55
+ | | token |
56
+ |---|---|
57
+ | radius | \`--radius-full\` |
58
+ | weight | \`--typography-fontWeight-medium\` |
59
+ | line-height | \`--typography-lineHeight-tight\` |
60
+ | type, sm / md / lg | \`--typography-fontSize-xxs\` / \`-xs\` / \`-sm\` |
61
+ | padding, sm & md | \`--spacing-4\` \`--spacing-8\` |
62
+ | padding, lg | \`--spacing-8\` \`--spacing-12\` |
63
+ | dot | \`--spacing-8\` |
64
+ | icon gap | \`--spacing-4\` |
28
65
 
29
66
  ### Notes
30
- - \`color\` sets the \`--badge-bg\` CSS custom property via \`updated()\`
31
- - \`size\` controls padding, border-radius, and default font size
32
- - \`fontsize\` overrides the font size independently from \`size\`
33
- - \`icon\` renders an SVG icon span before the slotted text
67
+ - \`size\` has no effect in \`mode="dot"\` — the design keeps the dot at one
68
+ size across all three, so that is reproduced rather than invented around.
69
+ - \`variant\` has no effect in \`mode="dot"\` either. A dot has no text, so
70
+ there is no foreground/background pair for shade and fill to describe — the
71
+ colour *is* the content, and it has to carry itself on the page. WCAG 1.4.11
72
+ asks 3:1 of a graphical object whose colour conveys meaning, and the tint a
73
+ shade badge sits on measures 1.08 to 1.33, so each tone uses a saturated
74
+ step instead: success is \`green-700\` and warning \`yellow-700\`, the
75
+ lightest steps in those families that clear 3:1 while still reading as
76
+ green and yellow.
77
+ - \`success\` deviates from the design in both variants, and both are
78
+ deliberate. In \`shade\` it uses \`green-800\` on \`green-100\` (5.93:1) where
79
+ the design specifies \`green-700\`, which measures 4.17:1 and fails WCAG
80
+ 1.4.3. In \`fill\` it is a \`green-700\` background with a white label, where
81
+ the design specifies \`green-500\` with a dark one — \`green-700\` is the
82
+ lightest green that carries white text at 4.5:1, measuring 4.75 against
83
+ \`green-600\`'s 3.20. Both should be reflected back into the design file.
84
+ - \`mode="count"\` sets \`font-variant-numeric: tabular-nums\`, so a counter
85
+ does not change width as it counts — "12" and "99" measure the same.
86
+ - \`variant="bd-light-blue"\` and \`variant="bd-light-green"\` still work; they
87
+ map onto \`primary\`/\`fill\` and \`success\`/\`shade\` respectively.
88
+ - \`icon\` uses \`currentColor\`, so it follows the tone with nothing to sync.
34
89
  `
35
90
  }
36
91
  }
37
92
  },
38
93
  argTypes: {
39
- color: {
40
- control : 'color',
41
- description: 'Background color of the badge. Sets the `--badge-bg` CSS variable.',
42
- table : {
43
- type : { summary: 'string' },
44
- defaultValue: { summary: '#026DFF' },
45
- category : 'Appearance'
46
- }
47
- },
48
- variant: {
49
- control : 'text',
50
- description: 'Additional CSS class applied to the inner `<span>` for custom variants.',
51
- table : {
52
- type : { summary: 'string' },
53
- defaultValue: { summary: '' },
54
- category : 'Appearance'
55
- }
94
+ mode: {
95
+ control : { type: 'inline-radio' },
96
+ options : ['text', 'dot', 'count'],
97
+ description: 'What the badge carries: slotted text, a bare dot, or a numeral.',
98
+ table : { type: { summary: 'string' }, defaultValue: { summary: 'text' }, category: 'Structure' }
56
99
  },
57
100
  size: {
58
- control : { type: 'select' },
59
- options : ['sm', 'md', 'lg'],
60
- description: 'Controls padding, border-radius, and default font size.',
61
- table : {
62
- type : { summary: "'sm' | 'md' | 'lg'" },
63
- defaultValue: { summary: 'md' },
64
- category : 'Size'
65
- }
101
+ control : { type: 'inline-radio' },
102
+ options : SIZES,
103
+ description: 'Type size and padding. No effect when `mode="dot"`.',
104
+ table : { type: { summary: 'string' }, defaultValue: { summary: 'md' }, category: 'Structure' }
66
105
  },
67
- fontsize: {
106
+ tone: {
68
107
  control : { type: 'select' },
69
- options : ['12', '14', '16'],
70
- description: 'Explicitly overrides the font size, independent of `size`.',
71
- table : {
72
- type : { summary: "'12' | '14' | '16'" },
73
- defaultValue: { summary: '14' },
74
- category : 'Size'
75
- }
108
+ options : TONES,
109
+ description: 'Semantic colour pairing.',
110
+ table : { type: { summary: 'string' }, defaultValue: { summary: 'default' }, category: 'Appearance' }
111
+ },
112
+ variant: {
113
+ control : { type: 'inline-radio' },
114
+ options : VARIANTS,
115
+ description: '`shade` tints the background and keeps dark text; `fill` saturates it.',
116
+ table : { type: { summary: 'string' }, defaultValue: { summary: 'shade' }, category: 'Appearance' }
76
117
  },
77
118
  icon: {
78
- control : { type: 'select' },
119
+ control : { type: 'inline-radio' },
79
120
  options : ['', 'individual', 'family'],
80
- description: 'Renders an icon before the slotted text. Empty string means no icon.',
81
- table : {
82
- type : { summary: "'individual' | 'family' | ''" },
83
- defaultValue: { summary: '' },
84
- category : 'Icon'
85
- }
121
+ description: 'Optional leading icon. Inherits the tone via `currentColor`.',
122
+ table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Appearance' }
86
123
  },
87
124
  label: {
88
125
  control : 'text',
89
- description: 'Slotted text content displayed inside the badge.',
90
- table : {
91
- type : { summary: 'string' },
92
- defaultValue: { summary: 'Badge' },
93
- category : 'Content'
94
- }
95
- }
96
- }
97
- };
98
-
99
- const render = (args) => html`
100
- <bd-badge
101
- color="${args.color}"
102
- variant="${args.variant}"
103
- size="${args.size}"
104
- fontsize="${args.fontsize}"
105
- icon="${args.icon}"
106
- >${args.label}</bd-badge>
107
- `;
108
-
109
- const defaultArgs = {
110
- color : '#026DFF',
111
- variant : '',
112
- size : 'md',
113
- fontsize: '14',
114
- icon : '',
115
- label : 'Badge'
116
- };
117
-
118
- // ─── Size Stories ──────────────────────────────────────────────────────────
119
-
120
- export const SizeSmall = {
121
- name : 'Size — Small (sm)',
122
- render : () => html`<bd-badge size="sm">Small Badge</bd-badge>`,
123
- parameters: {
124
- docs: {
125
- description: {
126
- story: 'Small badge with compact padding and smallest border-radius.'
127
- }
128
- }
129
- }
130
- };
131
-
132
- export const SizeMedium = {
133
- name : 'Size — Medium (md)',
134
- render : () => html`<bd-badge size="md">Medium Badge</bd-badge>`,
135
- parameters: {
136
- docs: {
137
- description: {
138
- story: 'Default medium size badge.'
139
- }
140
- }
141
- }
142
- };
143
-
144
- export const SizeLarge = {
145
- name : 'Size — Large (lg)',
146
- render : () => html`<bd-badge size="lg">Large Badge</bd-badge>`,
147
- parameters: {
148
- docs: {
149
- description: {
150
- story: 'Large badge with more padding and a larger border-radius.'
151
- }
152
- }
153
- }
154
- };
155
-
156
- export const AllSizes = {
157
- name : 'All Sizes',
158
- render: () => html`
159
- <div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
160
- <bd-badge size="sm">Small</bd-badge>
161
- <bd-badge size="md">Medium</bd-badge>
162
- <bd-badge size="lg">Large</bd-badge>
163
- </div>
164
- `,
165
- parameters: {
166
- docs: {
167
- description: {
168
- story: 'All three sizes rendered side by side for visual comparison.'
169
- }
126
+ description: 'Accessible name used when `mode="dot"`. Falls back to the tone name.',
127
+ table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Content' }
128
+ },
129
+ text: {
130
+ control : 'text',
131
+ description: 'Slotted content.',
132
+ table : { category: 'Content' }
170
133
  }
171
- }
134
+ },
135
+ args: {
136
+ mode : 'text',
137
+ size : 'md',
138
+ tone : 'default',
139
+ variant: 'shade',
140
+ icon : '',
141
+ label : '',
142
+ text : 'Badge'
143
+ },
144
+ render: ({ mode, size, tone, variant, icon, label, text }) => html`
145
+ <bd-badge mode="${mode}" size="${size}" tone="${tone}" variant="${variant}" icon="${icon}" label="${label}">${text}</bd-badge>
146
+ `
172
147
  };
173
148
 
174
- // ─── Color Stories ─────────────────────────────────────────────────────────
175
-
176
- export const DefaultColor = {
177
- name : 'Color — Default Blue',
178
- render : () => html`<bd-badge color="#026DFF">Default</bd-badge>`,
179
- parameters: {
180
- docs: {
181
- description: { story: 'Default blue badge using the `#026DFF` color.' }
182
- }
149
+ export const Playground = {
150
+ args: {
151
+ size : "lg",
152
+ label: "40% OFF"
183
153
  }
184
154
  };
185
155
 
186
- export const CustomColors = {
187
- name : 'Color — Custom Colors',
188
- render: () => html`
189
- <div style="display: flex; gap: 12px; flex-wrap: wrap;">
190
- <bd-badge color="#026DFF">Blue</bd-badge>
191
- <bd-badge color="#E53935">Red</bd-badge>
192
- <bd-badge color="#43A047">Green</bd-badge>
193
- <bd-badge color="#FB8C00">Orange</bd-badge>
194
- <bd-badge color="#8E24AA">Purple</bd-badge>
195
- <bd-badge color="#333333">Dark</bd-badge>
196
- </div>
197
- `,
198
- parameters: {
199
- docs: {
200
- description: {
201
- story: 'Multiple badges with different `color` values applied via the `--badge-bg` CSS variable.'
202
- }
203
- }
204
- }
156
+ export const Tones = {
157
+ parameters: { docs: { description: { story: 'Every tone in both variants.' } } },
158
+ render : () => html`
159
+ ${VARIANTS.map(variant => html`
160
+ <p style="font:var(--typography-fontWeight-semibold) var(--typography-fontSize-sm)/1.4 var(--typography-fontFamily-sans);margin:var(--spacing-24) 0 var(--spacing-12)">
161
+ variant="${variant}"
162
+ </p>
163
+ ${row(variant, TONES.map(tone => html`
164
+ <bd-badge tone="${tone}" variant="${variant}">${tone}</bd-badge>
165
+ `))}
166
+ `)}
167
+ `
205
168
  };
206
169
 
207
- // ─── Font Size Stories ─────────────────────────────────────────────────────
208
-
209
- export const FontSizes = {
210
- name : 'Font Sizes (12 / 14 / 16)',
211
- render: () => html`
212
- <div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
213
- <bd-badge fontsize="12">Font 12</bd-badge>
214
- <bd-badge fontsize="14">Font 14</bd-badge>
215
- <bd-badge fontsize="16">Font 16</bd-badge>
216
- </div>
217
- `,
218
- parameters: {
219
- docs: {
220
- description: {
221
- story: 'All three `fontsize` values rendered. Font size overrides the default derived from `size`.'
222
- }
223
- }
224
- }
170
+ export const Sizes = {
171
+ parameters: { docs: { description: { story: 'The three sizes, in both variants.' } } },
172
+ render : () => html`
173
+ ${VARIANTS.map(variant => html`
174
+ ${row(variant, SIZES.map(size => html`
175
+ <bd-badge size="${size}" tone="primary" variant="${variant}">${size}</bd-badge>
176
+ `))}
177
+ `)}
178
+ `
225
179
  };
226
180
 
227
- // ─── Icon Stories ──────────────────────────────────────────────────────────
228
-
229
- export const IconIndividual = {
230
- name : 'Icon — Individual',
231
- render : () => html`<bd-badge icon="individual" size="md">Individual</bd-badge>`,
232
- parameters: {
233
- docs: {
234
- description: {
235
- story: '`icon="individual"` renders the individual user icon before the slotted text.'
236
- }
237
- }
238
- }
181
+ export const Counts = {
182
+ name : 'Count',
183
+ parameters: { docs: { description: { story: 'Tabular numerals and a min-width keep a counter stable as it changes.' } } },
184
+ render : () => html`
185
+ ${SIZES.map(size => html`
186
+ ${row(size, ['1', '9', '12', '99', '999'].map(n => html`
187
+ <bd-badge mode="count" size="${size}" tone="error" variant="fill">${n}</bd-badge>
188
+ `))}
189
+ `)}
190
+ `
239
191
  };
240
192
 
241
- export const IconFamily = {
242
- name : 'Icon — Family',
243
- render : () => html`<bd-badge icon="family" size="md">Family</bd-badge>`,
244
- parameters: {
245
- docs: {
246
- description: {
247
- story: '`icon="family"` renders the family icon before the slotted text.'
248
- }
249
- }
250
- }
193
+ export const Dots = {
194
+ name : 'Dot',
195
+ parameters: { docs: { description: { story: 'A dot in every tone. Neither `size` nor `variant` affects a dot — both rows below are identical by design, because a dot has no foreground/background pair and needs a colour that carries 3:1 on the page.' } } },
196
+ render : () => html`
197
+ ${row('any tone', TONES.map(tone => html`
198
+ <bd-badge mode="dot" tone="${tone}" label="${tone}"></bd-badge>
199
+ `))}
200
+ ${row('+ fill', TONES.map(tone => html`
201
+ <bd-badge mode="dot" tone="${tone}" variant="fill" label="${tone}"></bd-badge>
202
+ `))}
203
+ `
251
204
  };
252
205
 
253
- export const AllIcons = {
254
- name : 'All Icons',
255
- render: () => html`
256
- <div style="display: flex; gap: 12px; flex-wrap: wrap;">
257
- <bd-badge>No Icon</bd-badge>
206
+ export const WithIcon = {
207
+ name : 'With icon',
208
+ parameters: { docs: { description: { story: 'The icon takes its colour from the tone via `currentColor`.' } } },
209
+ render : () => html`
210
+ ${row('shade', html`
258
211
  <bd-badge icon="individual">Individual</bd-badge>
259
- <bd-badge icon="family">Family</bd-badge>
260
- </div>
261
- `,
262
- parameters: {
263
- docs: {
264
- description: {
265
- story: 'All three icon states: no icon, individual, and family — displayed side by side.'
266
- }
267
- }
268
- }
212
+ <bd-badge tone="success" icon="family">Family Pack</bd-badge>
213
+ `)}
214
+ ${row('fill', html`
215
+ <bd-badge variant="fill" tone="primary" icon="individual">Individual</bd-badge>
216
+ <bd-badge variant="fill" tone="success" icon="family">Family Pack</bd-badge>
217
+ `)}
218
+ `
269
219
  };
270
220
 
271
- // ─── Combined Stories ──────────────────────────────────────────────────────
272
-
273
- export const CombinedVariants = {
274
- name : 'Combined Variants',
275
- render: () => html`
276
- <div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
277
- <bd-badge size="sm" color="#E53935">Sale</bd-badge>
278
- <bd-badge size="md" color="#43A047" icon="individual">Personal Plan</bd-badge>
279
- <bd-badge size="lg" color="#026DFF" icon="family" fontsize="16">Family Plan</bd-badge>
280
- </div>
281
- `,
282
- parameters: {
283
- docs: {
284
- description: {
285
- story: 'Three badges combining different sizes, colors, icons, and font sizes for a real-world usage example.'
286
- }
287
- }
288
- }
221
+ export const Legacy = {
222
+ name : 'Legacy variants',
223
+ parameters: { docs: { description: { story: 'Pre-`ds-badge` markup still renders, mapped onto the new axes.' } } },
224
+ render : () => html`
225
+ ${row('mapped', html`
226
+ <bd-badge variant="bd-light-blue">bd-light-blue</bd-badge>
227
+ <bd-badge variant="bd-light-green">bd-light-green</bd-badge>
228
+ `)}
229
+ `
289
230
  };
290
-
291
- export const Playground = {
292
- name : '🛝 Playground',
293
- args : { ...defaultArgs },
294
- render,
295
- parameters: {
296
- docs: {
297
- description: {
298
- story: 'Fully interactive. Use Controls to adjust color, size, fontsize, icon, variant, and slotted label in real time.'
299
- }
300
- }
301
- }
302
- };
@@ -1,21 +1,19 @@
1
1
  import { css } from "lit";
2
2
 
3
3
  export default css`
4
- :host {
4
+ :host {
5
5
  display: block;
6
6
  width: 100%;
7
7
  box-sizing: border-box;
8
- max-width: 1290px;
9
- margin-inline: auto;
10
8
  }
11
9
 
12
- /* === BACKGROUND VARIANT — section-level tint, applied to the whole
13
- component (header + track), not per-card. Padding compensates so the
14
- tinted area doesn't hug the header/cards edge-to-edge. === */
15
- :host([background="tint"]) {
16
- background-color: var(--color-blue-50, #f0f6ff);
17
- border-radius: var(--radius-2xl, 24px);
18
- padding: var(--spacing-40, 40px) var(--spacing-32, 32px);
10
+ /* === BACKGROUND VARIANT — section-level tint on the column (header +
11
+ track), not per-card, so the panel lands on the page edges every other
12
+ section uses. === */
13
+ :host([background="tint"]) .bd-ensemble {
14
+ background-color: var(--status-brand-surface);
15
+ border-radius: var(--radius-2xl);
16
+ padding-block: var(--spacing-40);
19
17
  }
20
18
 
21
19
  /* === HEADER (eyebrow / title / description) === */
@@ -31,28 +29,35 @@ export default css`
31
29
  .bd-bentogrid-eyebrow {
32
30
  display: block;
33
31
  margin: 0;
34
- color: var(--color-blue-500);
35
- --typography-body-regular-fontWeight: var(--typography-fontWeight-bold, 700);
32
+ /* The brand text role, not the brand primitive. This is a visible change and
33
+ not a refactor: the role is blue-600, so the eyebrow darkens and its
34
+ contrast on white goes 4.53:1 -> 6.18:1. blue-500 is the step CLAUDE.md
35
+ says is not for text, and no text role exists at blue-500's value -- the
36
+ roles sitting there are surface, border, action and indicator. */
37
+ color: var(--color-text-brand);
36
38
  }
37
39
 
38
40
  .bd-bentogrid-title {
39
41
  display: block;
40
42
  margin: 0;
41
- color: var(--color-neutral-1000);
42
- line-height: var(--typography-lineHeight-tight, 1.1);
43
43
  }
44
44
 
45
45
  .bd-bentogrid-description {
46
46
  display: block;
47
47
  margin: 0;
48
- color: var(--color-neutral-600);
48
+ color: var(--color-text-muted);
49
49
  }
50
50
 
51
51
  /* === GRID === */
52
52
  .bd-bentogrid-track {
53
53
  display: grid;
54
54
  grid-template-columns: repeat(var(--bd-bento-total-units, 24), minmax(0, 1fr));
55
- gap: var(--bd-bento-gap, 24px);
55
+ /* The fallback names the step rather than repeating its value: --spacing-24
56
+ IS 24px at the default root size, but in rem, so it grows when the reader
57
+ enlarges their text and 24px does not. Identical at 16px root, which is
58
+ why nothing looked wrong and no rule could see it -- the declaration
59
+ reads a legitimate var(). */
60
+ gap: var(--bd-bento-gap, var(--spacing-24));
56
61
  width: 100%;
57
62
  }
58
63
 
@@ -3,6 +3,7 @@ import { tokens } from "../../tokens/tokens.js";
3
3
  import "../heading/heading.js";
4
4
  import "../paragraph/paragraph.js";
5
5
  import bentoGridCSS from "./bento-grid.css.js";
6
+ import { ensembleCSS } from "../shared/ensemble.css.js";
6
7
  import "./bento-item.js";
7
8
 
8
9
  const BREAKPOINT_WIDTHS = { xl: 1280, lg: 960, md: 640 };
@@ -78,7 +79,7 @@ class BentoGrid extends LitElement {
78
79
  _gap : { state: true }
79
80
  };
80
81
 
81
- static styles = [tokens, bentoGridCSS];
82
+ static styles = [tokens, ensembleCSS, bentoGridCSS];
82
83
 
83
84
  constructor() {
84
85
  super();
@@ -191,10 +192,19 @@ class BentoGrid extends LitElement {
191
192
  this.style.setProperty("--bd-bento-gap", `${gap}px`);
192
193
 
193
194
  if (columns <= 1) {
194
- this._items.forEach((item) => item.style.setProperty("--bd-bento-span", String(TOTAL_UNITS)));
195
+ /* Collapse the subdivision, not just the spans. A 24-unit track carries
196
+ 23 internal gaps, so its own minimum width is 23 * gap -- 368px at the
197
+ small gap -- whatever the viewport is: measured, the grid overflowed
198
+ 320px by 64px and 375px by 9px for that reason alone. In one column
199
+ the units buy nothing, because every item spans the whole row either
200
+ way, so the track becomes a single column and the floor goes with it. */
201
+ this.style.setProperty("--bd-bento-total-units", "1");
202
+ this._items.forEach((item) => item.style.setProperty("--bd-bento-span", "1"));
195
203
  return;
196
204
  }
197
205
 
206
+ this.style.setProperty("--bd-bento-total-units", String(TOTAL_UNITS));
207
+
198
208
  this._applyWeights();
199
209
  }
200
210
 
@@ -204,12 +214,13 @@ class BentoGrid extends LitElement {
204
214
 
205
215
  render() {
206
216
  return html`
217
+ <div class="bd-ensemble">
207
218
  ${this.eyebrow || this.title || this.description
208
219
  ? html`
209
220
  <div class="bd-bentogrid-header">
210
221
  ${this.eyebrow
211
222
  ? html`
212
- <bd-p kind="regular" class="bd-bentogrid-eyebrow">
223
+ <bd-p variant="regular" class="bd-bentogrid-eyebrow">
213
224
  <slot name="eyebrow">${this.eyebrow}</slot>
214
225
  </bd-p>
215
226
  `
@@ -225,7 +236,7 @@ class BentoGrid extends LitElement {
225
236
 
226
237
  ${this.description
227
238
  ? html`
228
- <bd-p kind="regular" class="bd-bentogrid-description">
239
+ <bd-p variant="regular" class="bd-bentogrid-description">
229
240
  <slot name="description">${this.description}</slot>
230
241
  </bd-p>
231
242
  `
@@ -237,6 +248,7 @@ class BentoGrid extends LitElement {
237
248
  <div class="bd-bentogrid-track" role="list">
238
249
  <slot @slotchange=${this._onSlotChange}></slot>
239
250
  </div>
251
+ </div>
240
252
  `;
241
253
  }
242
254
  }