@repobit/dex-system-design 0.25.11 → 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 +195 -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,168 +1,75 @@
1
1
  import { css } from "lit";
2
2
 
3
+ /**
4
+ * What the clipboard field adds to the shared field chrome: a paste button
5
+ * sitting over the right-hand end of the input.
6
+ *
7
+ * Everything else — label, sizes, states, help text — comes from
8
+ * shared/form-field.css.js.
9
+ */
3
10
  export default css`
4
- :host {
5
- display: block;
6
- width: 90%;
7
- }
8
-
9
- .input-container {
10
- display: flex;
11
- flex-direction: column;
12
- }
13
-
14
- label {
15
- margin-bottom: 4px;
16
- font-weight: 500;
17
- color: var(--color-neutral-900);
18
- }
19
-
20
- .form-label__required {
21
- color: var(--color-red-500);
22
- margin-left: var(--spacing-4);
23
- }
24
-
25
- .label-sm {
26
- font-size: var(--typography-fontSize-xs);
27
- font-weight: var(--typography-fontWeight-bold);
28
- line-height: var(--typography-lineHeight-normal);
29
- letter-spacing: var(--typography-letterSpacing-wide);
30
- margin-bottom: var(--spacing-4);
31
- }
32
-
33
- .label-md {
34
- font-size: var(--typography-fontSize-sm);
35
- font-weight: var(--typography-fontWeight-bold);
36
- line-height: var(--typography-lineHeight-normal);
37
- margin-bottom: var(--spacing-4);
38
- }
39
-
40
- .label-lg {
41
- font-size: var(--typography-fontSize-lg);
42
- font-weight: var(--typography-fontWeight-bold);
43
- line-height: var(--typography-lineHeight-normal);
44
- margin-bottom: var(--spacing-8);
45
- }
46
-
47
- .form-input-bd {
48
- width: 100%;
49
- border: var(--border-width-1, 1px) solid var(--color-neutral-300);
50
- font-family: var(--typography-fontFamily-sans, sans-serif);
51
- line-height: var(--typography-lineHeight-normal, 1.5);
52
- transition: border-color 0.3s ease, background-color 0.3s ease,
53
- box-shadow 0.3s ease;
54
- background-color: var(--color-neutral-0);
55
- color: var(--color-neutral-900);
56
- outline: none;
57
- }
58
-
59
- input:focus {
60
- border-color: var(--color-blue-500);
61
- box-shadow: var(--focus-outline-primary, 0 0 0 2px rgba(0, 109, 255, 0.3));
62
- }
63
-
64
- .input-sm {
65
- padding: var(--spacing-8) var(--spacing-12);
66
- font-size: var(--typography-fontSize-sm);
67
- height: var(--dimension-34px);
68
- border-radius: var(--form-input-medium-borderRadius);
69
- }
70
-
71
- .input-md {
72
- padding: var(--spacing-12) var(--spacing-16);
73
- font-size: var(--typography-fontSize-base);
74
- height: var(--dimension-45px);
75
- border-radius: var(--form-input-large-borderRadius);
76
- }
77
-
78
- .input-lg {
79
- padding: var(--spacing-16) var(--spacing-20);
80
- font-size: var(--typography-fontSize-lg);
81
- height: var(--dimension-55px);
82
- border-radius: var(--form-input-large-borderRadius);
83
- }
84
-
85
- ::placeholder {
86
- color: var(--color-neutral-500);
87
- opacity: 1;
88
- }
89
-
90
- .form-label {
91
- display: block;
92
- font-family: var(--typography-fontFamily-sans);
93
- color: var(--color-neutral-900);
94
- letter-spacing: var(--typography-letterSpacing-normal);
95
- }
96
-
97
- .form-input-bd:focus,
98
- .form-input-bd.focused {
99
- border-color: var(--color-blue-500);
100
- box-shadow: var(--focus-outline-primary, 0 0 0 2px rgba(0, 109, 255, 0.3));
101
- background: none;
102
- }
103
-
104
- .form-help-text {
105
- font-size: var(--typography-fontSize-xs);
106
- font-weight: var(--typography-fontWeight-normal);
107
- line-height: var(--typography-lineHeight-normal);
108
- letter-spacing: var(--typography-letterSpacing-normal);
109
- font-family: var(--typography-fontFamily-sans);
110
- margin-top: var(--spacing-4);
111
- }
112
-
113
- .form-help-text--default {
114
- color: var(--color-neutral-600);
115
- }
116
-
117
- .form-input--error {
118
- background-color: var(--color-red-50);
119
- border-color: var(--color-red-500);
120
- }
121
-
122
- .form-help-text--error {
123
- color: var(--color-red-600);
124
- }
125
-
126
- .form-input--success {
127
- background-color: var(--color-green-50);
128
- border-color: var(--color-green-500);
129
- }
130
-
131
- .form-help-text--success {
132
- color: var(--color-green-600);
133
- }
134
-
135
- .form-input--disabled {
136
- background-color: var(--color-neutral-100);
137
- border-color: var(--color-neutral-300);
138
- color: var(--color-neutral-500);
139
- cursor: not-allowed;
140
- }
141
-
142
11
  .input-with-button {
143
12
  position: relative;
144
13
  display: flex;
145
14
  align-items: center;
146
15
  }
147
16
 
17
+ /* Clearance for the button. Typed so it outranks the .input-* size classes,
18
+ which set the padding shorthand. */
148
19
  input.form-input-bd {
149
20
  flex: 1;
150
- padding-right: 2.5rem; /* space for button */
21
+ padding-inline-end: var(--spacing-40);
151
22
  }
152
23
 
153
24
  .paste-button {
154
25
  position: absolute;
155
- right: 0.5rem;
26
+ right: var(--spacing-8);
27
+ display: inline-flex;
28
+ align-items: center;
156
29
  background: transparent;
157
30
  border: none;
158
- cursor: pointer;
159
- font-size: 1rem;
160
31
  padding: 0;
161
- color: var(--color-gray-700);
32
+ cursor: pointer;
33
+ font-family: var(--typography-fontFamily-sans);
34
+ /* no role: this button holds one 20x20 svg and no text, so there is no
35
+ text-content type for a role to describe -- the same glyph-box category
36
+ as .bd-arrow's fallback typography.
37
+ .
38
+ Unlike the other rows closed in this pass, this declaration is NOT
39
+ redundant and is marked rather than removed. Measured: at "revert" the
40
+ button falls to the UA's 13.333px, so the line does real work in
41
+ normalising a <button> to the inherited step; it simply has nothing to
42
+ act on today, since the box measures 20x20 at either value. Deleting it
43
+ would let the UA size surface the day the button gains a label. */
44
+ font-size: var(--typography-fontSize-base);
45
+ color: var(--color-text-secondary);
46
+ }
47
+
48
+ /* It is a real button and had no focus indicator at all, which is a 2.4.7
49
+ failure — reachable by keyboard, invisible once reached. The ring is the
50
+ shared one; the radius is the default for an element with no radius of its
51
+ own, so the ring is not a hard rectangle. */
52
+ .paste-button:focus-visible {
53
+ outline: none;
54
+ box-shadow: var(--focus-outline-primary);
55
+ border-radius: var(--focus-outline-radius);
56
+ }
57
+
58
+ .paste-button:hover {
59
+ color: var(--color-text-primary);
162
60
  }
163
61
 
164
62
  .paste-button:disabled {
165
63
  cursor: not-allowed;
166
- opacity: 0.5;
64
+ /* the field expresses disabled with the neutral ramp, not with opacity.
65
+
66
+ The same token the field beside it disables to. This was
67
+ --color-text-disabled, which is neutral-400 and measures 3.23:1 on white
68
+ where every other disabled label in the family -- both text inputs, all
69
+ three selection controls, and bd-button -- measures 4.67:1. Disabled text
70
+ is exempt under 1.4.3, so neither reading was a failure; they were two
71
+ answers to one question inside one component, since the field this button
72
+ sits in already disables to --form-input-disabled-color. */
73
+ color: var(--form-input-disabled-color);
167
74
  }
168
75
  `;
@@ -1,12 +1,17 @@
1
- import { LitElement, html } from "lit";
2
- import { tokens } from "../../tokens/tokens.js";
1
+ import { LitElement, html, nothing } from "lit";
2
+ // Installs the design tokens into document scope; see src/tokens/tokens.js
3
+ import "../../tokens/tokens.js";
4
+ import { formFieldCSS } from "../shared/form-field.css.js";
3
5
  import inputClipboardCSS from "../input/input-clipboard.css.js";
6
+ import { resolveSize } from '../shared/prop-vocabulary.js';
4
7
 
5
8
  class CustomInputClipboard extends LitElement {
6
9
  static properties = {
7
10
  label : { type: String },
8
11
  type : { type: String },
9
- kind : { type: String }, // sm, md, lg
12
+ size : { type: String, reflect: true },
13
+ /** @deprecated pass `size`. It named the size, not the kind. */
14
+ kind : { type: String },
10
15
  placeholder: { type: String },
11
16
  required : { type: Boolean },
12
17
  focused : { type: Boolean },
@@ -19,10 +24,12 @@ class CustomInputClipboard extends LitElement {
19
24
 
20
25
  constructor() {
21
26
  super();
22
- this.label = "Default Label";
27
+ /* No default copy — see the note in input.js. */
28
+ this.label = "";
23
29
  this.type = "text";
24
- this.kind = "md";
25
- this.placeholder = "Paste something...";
30
+ this.size = "md";
31
+ this.kind = "";
32
+ this.placeholder = "";
26
33
  this.required = false;
27
34
  this.focused = false;
28
35
  this.tooltip = "";
@@ -47,18 +54,25 @@ class CustomInputClipboard extends LitElement {
47
54
  this.dispatchEvent(new CustomEvent("input", { detail: this.value }));
48
55
  }
49
56
 
57
+ willUpdate(changed) {
58
+ // kind said "size" on these three and nothing else in the system,
59
+ // so it moved; see shared/prop-vocabulary.js
60
+ if (changed.has("kind") && this.kind) this.size = this.kind;
61
+ if (changed.has("size") || changed.has("kind")) this.size = resolveSize(this.size);
62
+ }
63
+
50
64
  render() {
51
65
  const inputClass = {
52
66
  sm: "input-sm",
53
67
  md: "input-md",
54
68
  lg: "input-lg"
55
- }[this.kind];
69
+ }[this.size];
56
70
 
57
71
  const labelClass = {
58
72
  sm: "label-sm",
59
73
  md: "label-md",
60
74
  lg: "label-lg"
61
- }[this.kind];
75
+ }[this.size];
62
76
 
63
77
  const inputStateClass = this.disabled
64
78
  ? "form-input--disabled"
@@ -76,12 +90,14 @@ class CustomInputClipboard extends LitElement {
76
90
 
77
91
  return html`
78
92
  <div class="input-container">
79
- <label for="clipboard-input" class="form-label ${labelClass}">
80
- ${this.label}
81
- ${this.required
82
- ? html`<span class="form-label__required">*</span>`
83
- : ""}
84
- </label>
93
+ ${this.label
94
+ ? html`<label for="clipboard-input" class="form-label ${labelClass}">
95
+ ${this.label}
96
+ ${this.required
97
+ ? html`<span class="form-label__required" aria-hidden="true">*</span>`
98
+ : ""}
99
+ </label>`
100
+ : nothing}
85
101
  <div class="input-with-button">
86
102
  <input
87
103
  id="clipboard-input"
@@ -132,6 +148,6 @@ class CustomInputClipboard extends LitElement {
132
148
  }
133
149
 
134
150
  }
135
- CustomInputClipboard.styles = [tokens, inputClipboardCSS];
151
+ CustomInputClipboard.styles = [formFieldCSS, inputClipboardCSS];
136
152
 
137
153
  customElements.define("bd-custom-input-clipboard", CustomInputClipboard);
@@ -1,148 +1,10 @@
1
1
  import { css } from "lit";
2
2
 
3
- export default css`
4
- :host {
5
- display: block;
6
- width: 90%;
7
- }
8
-
9
- .input-container {
10
- display: flex;
11
- flex-direction: column;
12
- }
13
-
14
- label {
15
- margin-bottom: 4px;
16
- font-weight: 500;
17
- color: var(--color-neutral-900);
18
- }
19
-
20
- .form-label__required {
21
- color: var(--color-red-500);
22
- margin-left: var(--spacing-4);
23
- }
24
-
25
- .label-sm {
26
- font-size: var(--typography-fontSize-xs);
27
- font-weight: var(--typography-fontWeight-bold);
28
- line-height: var(--typography-lineHeight-normal);
29
- letter-spacing: var(--typography-letterSpacing-wide);
30
- margin-bottom: var(--spacing-4);
31
- }
32
-
33
- .label-md {
34
- font-size: var(--typography-fontSize-sm);
35
- font-weight: var(--typography-fontWeight-bold);
36
- line-height: var(--typography-lineHeight-normal);
37
- margin-bottom: var(--spacing-4);
38
- }
39
-
40
- .label-lg {
41
- font-size: var(--typography-fontSize-lg);
42
- font-weight: var(--typography-fontWeight-bold);
43
- line-height: var(--typography-lineHeight-normal);
44
- margin-bottom: var(--spacing-8);
45
- }
46
-
47
- .form-input-bd {
48
- width: 100%;
49
- border: var(--border-width-1, 1px) solid var(--color-neutral-300);
50
- font-family: var(--typography-fontFamily-sans, sans-serif);
51
- line-height: var(--typography-lineHeight-normal, 1.5);
52
- transition: border-color 0.3s ease, background-color 0.3s ease,
53
- box-shadow 0.3s ease;
54
- background-color: var(--color-neutral-0);
55
- color: var(--color-neutral-900);
56
- outline: none;
57
- }
58
-
59
- input:focus {
60
- border-color: var(--color-blue-500);
61
- box-shadow: var(
62
- --focus-outline-primary,
63
- 0 0 0 2px rgba(0, 109, 255, 0.3)
64
- );
65
- }
66
-
67
- .input-sm {
68
- padding: var(--spacing-8) var(--spacing-12);
69
- font-size: var(--typography-fontSize-sm);
70
- height: var(--dimension-34px);
71
- border-radius: var(--form-input-medium-borderRadius);
72
- }
73
-
74
- .input-md {
75
- padding: var(--spacing-12) var(--spacing-16);
76
- font-size: var(--typography-fontSize-base);
77
- height: var(--dimension-45px);
78
- border-radius: var(--form-input-large-borderRadius);
79
- }
80
-
81
- .input-lg {
82
- padding: var(--spacing-16) var(--spacing-20);
83
- font-size: var(--typography-fontSize-lg);
84
- height: var(--dimension-55px);
85
- border-radius: var(--form-input-large-borderRadius);
86
- }
87
-
88
- ::placeholder {
89
- color: var(--color-neutral-500);
90
- opacity: 1;
91
- }
92
-
93
- .form-label {
94
- display: block;
95
- font-family: var(--typography-fontFamily-sans);
96
- color: var(--color-neutral-900);
97
- letter-spacing: var(--typography-letterSpacing-normal);
98
- }
99
-
100
- .form-input-bd:focus,
101
- .form-input-bd.focused {
102
- border-color: var(--color-blue-500);
103
- box-shadow: var(
104
- --focus-outline-primary,
105
- 0 0 0 2px rgba(0, 109, 255, 0.3)
106
- );
107
- background: none;
108
- }
109
-
110
- .form-help-text {
111
- font-size: var(--typography-fontSize-xs);
112
- font-weight: var(--typography-fontWeight-normal);
113
- line-height: var(--typography-lineHeight-normal);
114
- letter-spacing: var(--typography-letterSpacing-normal);
115
- font-family: var(--typography-fontFamily-sans);
116
- margin-top: var(--spacing-4);
117
- }
118
-
119
- .form-help-text--default {
120
- color: var(--color-neutral-600);
121
- }
122
-
123
- .form-input--error {
124
- background-color: var(--color-red-50);
125
- border-color: var(--color-red-500);
126
- }
127
-
128
- .form-help-text--error {
129
- color: var(--color-red-600);
130
- }
131
-
132
- .form-input--success {
133
- background-color: var(--color-green-50);
134
- border-color: var(--color-green-500);
135
- }
136
-
137
- .form-help-text--success {
138
- color: var(--color-green-600);
139
- }
140
-
141
- .form-input--disabled {
142
- background-color: var(--color-neutral-100);
143
- border-color: var(--color-neutral-300);
144
- color: var(--color-neutral-500);
145
- cursor: not-allowed;
146
- }
147
-
148
- `;
3
+ /**
4
+ * bd-custom-input adds nothing to the shared field chrome — a text input is
5
+ * the plain case that shared/form-field.css.js was written around. The file
6
+ * stays so the component's `static styles` reads the same as its two
7
+ * siblings', and so there is somewhere obvious to put an input-only rule if
8
+ * one is ever needed.
9
+ */
10
+ export default css``;
@@ -1,48 +1,94 @@
1
- import { LitElement, html } from "lit";
2
- import { tokens } from "../../tokens/tokens.js";
1
+ import { LitElement, html, nothing } from "lit";
2
+ // Installs the design tokens into document scope; see src/tokens/tokens.js
3
+ import "../../tokens/tokens.js";
4
+ import { formFieldCSS } from "../shared/form-field.css.js";
3
5
  import inputCSS from "./input.css.js";
6
+ import { resolveSize } from '../shared/prop-vocabulary.js';
7
+
8
+ // ids are scoped to the shadow root, so fixed ones are safe here
9
+ const INPUT_ID = "custom-input";
10
+ const HELP_ID = "custom-input-help";
4
11
 
5
12
  class CustomInput extends LitElement {
6
13
  static properties = {
7
- label : { type: String },
8
- type : { type: String },
9
- kind : { type: String }, // sm, md, lg
10
- placeholder: { type: String },
11
- required : { type: Boolean },
12
- focused : { type: Boolean },
13
- tooltip : { type: String },
14
- invalid : { type: Boolean },
15
- validated : { type: Boolean, reflect: true },
16
- disabled : { type: Boolean, reflect: true }
14
+ label : { type: String },
15
+ type : { type: String },
16
+ size : { type: String, reflect: true },
17
+ /** @deprecated pass `size`. It named the size, not the kind. */
18
+ kind : { type: String },
19
+ placeholder : { type: String },
20
+ required : { type: Boolean },
21
+ focused : { type: Boolean },
22
+ tooltip : { type: String },
23
+ invalid : { type: Boolean },
24
+ validated : { type: Boolean, reflect: true },
25
+ disabled : { type: Boolean, reflect: true },
26
+ value : { type: String },
27
+ name : { type: String },
28
+ // mobile keyboard controls — see the story
29
+ inputmode : { type: String },
30
+ autocomplete: { type: String },
31
+ enterkeyhint: { type: String }
17
32
  };
18
33
 
19
34
  constructor() {
20
35
  super();
21
- this.label = "Default Label";
36
+ /* No default copy. A field that ships "Default Label" to production
37
+ when a consumer forgets the prop is worse than one that ships no label,
38
+ and the string cannot be translated. Empty means the label element is
39
+ not rendered at all — see render(). */
40
+ this.label = "";
22
41
  this.type = "text";
23
- this.kind = "md";
24
- this.placeholder = "Enter something...";
42
+ this.size = "md";
43
+ this.kind = "";
44
+ this.placeholder = "";
25
45
  this.required = false;
26
46
  this.focused = false;
27
47
  this.tooltip = "";
28
48
  this.invalid = false;
29
49
  this.validated = false;
30
50
  this.disabled = false;
51
+ this.value = "";
52
+ this.name = "";
53
+ this.inputmode = "";
54
+ this.autocomplete = "";
55
+ this.enterkeyhint = "";
31
56
  }
32
57
 
58
+ /**
59
+ * The value used to be unreachable. The native input event escapes the
60
+ * shadow root, but it retargets to the host, and the host had no value
61
+ * property — so `e.target.value` was undefined and the only way to read what
62
+ * someone typed was to reach through the shadow root.
63
+ */
64
+ _onInput(e) {
65
+ this.value = e.target.value;
66
+ this.dispatchEvent(new CustomEvent("bd-input", {
67
+ detail : { value: this.value, name: this.name },
68
+ bubbles : true,
69
+ composed: true
70
+ }));
71
+ }
33
72
 
34
- render() {
35
- const inputClass = {
36
- sm: "input-sm",
37
- md: "input-md",
38
- lg: "input-lg"
39
- }[this.kind];
73
+ _onChange(e) {
74
+ this.value = e.target.value;
75
+ this.dispatchEvent(new CustomEvent("bd-change", {
76
+ detail : { value: this.value, name: this.name },
77
+ bubbles : true,
78
+ composed: true
79
+ }));
80
+ }
40
81
 
41
- const labelClass = {
42
- sm: "label-sm",
43
- md: "label-md",
44
- lg: "label-lg"
45
- }[this.kind];
82
+ willUpdate(changed) {
83
+ // kind said "size" on these three and nothing else in the system,
84
+ // so it moved; see shared/prop-vocabulary.js
85
+ if (changed.has("kind") && this.kind) this.size = this.kind;
86
+ if (changed.has("size") || changed.has("kind")) this.size = resolveSize(this.size);
87
+ }
88
+
89
+ render() {
90
+ const inputClass = { sm: "input-sm", md: "input-md", lg: "input-lg" }[this.size];
91
+ const labelClass = { sm: "label-sm", md: "label-md", lg: "label-lg" }[this.size];
46
92
 
47
93
  const inputStateClass = this.disabled
48
94
  ? "form-input--disabled"
@@ -60,24 +106,33 @@ class CustomInput extends LitElement {
60
106
 
61
107
  return html`
62
108
  <div class="input-container">
63
- <label for="custom-input" class="form-label ${labelClass}">
64
- ${this.label}
65
- ${this.required
66
- ? html`<span class="form-label__required">*</span>`
67
- : ""}
68
- </label>
109
+ ${this.label
110
+ ? html`<label for="${INPUT_ID}" class="form-label ${labelClass}">
111
+ ${this.label}
112
+ ${this.required
113
+ ? html`<span class="form-label__required" aria-hidden="true">*</span>`
114
+ : ""}
115
+ </label>`
116
+ : nothing}
69
117
  <input
70
- id="custom-input"
71
- class="form-input-bd ${inputClass} ${this.focused
72
- ? "focused"
73
- : ""} ${inputStateClass}"
118
+ id="${INPUT_ID}"
119
+ class="form-input-bd ${inputClass} ${this.focused ? "focused" : ""} ${inputStateClass}"
74
120
  type="${this.type}"
121
+ name="${this.name || nothing}"
75
122
  placeholder="${this.placeholder}"
123
+ .value="${this.value}"
124
+ inputmode="${this.inputmode || nothing}"
125
+ autocomplete="${this.autocomplete || nothing}"
126
+ enterkeyhint="${this.enterkeyhint || nothing}"
76
127
  ?required="${this.required}"
77
128
  ?disabled="${this.disabled}"
129
+ aria-invalid="${this.invalid ? "true" : nothing}"
130
+ aria-describedby="${this.tooltip ? HELP_ID : nothing}"
131
+ @input="${this._onInput}"
132
+ @change="${this._onChange}"
78
133
  />
79
134
  ${this.tooltip
80
- ? html`<div class="form-help-text ${helpTextClass}">
135
+ ? html`<div id="${HELP_ID}" class="form-help-text ${helpTextClass}">
81
136
  ${this.tooltip}
82
137
  </div>`
83
138
  : ""}
@@ -85,6 +140,6 @@ class CustomInput extends LitElement {
85
140
  `;
86
141
  }
87
142
  }
88
- CustomInput.styles = [tokens, inputCSS];
143
+ CustomInput.styles = [formFieldCSS, inputCSS];
89
144
 
90
145
  customElements.define("bd-custom-input", CustomInput);