@nationaldesignstudio/react 0.0.15 → 0.0.16

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 (164) hide show
  1. package/package.json +3 -2
  2. package/src/App.css +0 -0
  3. package/src/App.tsx +7 -0
  4. package/src/assets/fonts/PPNeueMontreal-Variable.woff2 +0 -0
  5. package/src/assets/react.svg +1 -0
  6. package/src/components/atoms/accordion/accordion.stories.tsx +228 -0
  7. package/src/components/atoms/accordion/accordion.tsx +219 -0
  8. package/src/components/atoms/accordion/index.ts +6 -0
  9. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-darwin.png +0 -0
  10. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-linux.png +0 -0
  11. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-darwin.png +0 -0
  12. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-linux.png +0 -0
  13. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-darwin.png +0 -0
  14. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-linux.png +0 -0
  15. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-darwin.png +0 -0
  16. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-linux.png +0 -0
  17. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-darwin.png +0 -0
  18. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-linux.png +0 -0
  19. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-darwin.png +0 -0
  20. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-linux.png +0 -0
  21. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-darwin.png +0 -0
  22. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-linux.png +0 -0
  23. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-darwin.png +0 -0
  24. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-linux.png +0 -0
  25. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-darwin.png +0 -0
  26. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-linux.png +0 -0
  27. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-darwin.png +0 -0
  28. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-linux.png +0 -0
  29. package/src/components/atoms/button/button.stories.tsx +102 -0
  30. package/src/components/atoms/button/button.test.tsx +135 -0
  31. package/src/components/atoms/button/button.tsx +139 -0
  32. package/src/components/atoms/button/button.visual.test.tsx +102 -0
  33. package/src/components/atoms/button/icon-button.stories.tsx +166 -0
  34. package/src/components/atoms/button/icon-button.tsx +120 -0
  35. package/src/components/atoms/button/index.ts +6 -0
  36. package/src/components/atoms/ndstudio-footer/index.ts +1 -0
  37. package/src/components/atoms/ndstudio-footer/ndstudio-footer.tsx +55 -0
  38. package/src/components/atoms/pager-control/index.ts +5 -0
  39. package/src/components/atoms/pager-control/pager-control.stories.tsx +209 -0
  40. package/src/components/atoms/pager-control/pager-control.test.tsx +130 -0
  41. package/src/components/atoms/pager-control/pager-control.tsx +329 -0
  42. package/src/components/dev-tools/dev-toolbar/dev-toolbar.stories.tsx +82 -0
  43. package/src/components/dev-tools/dev-toolbar/dev-toolbar.tsx +196 -0
  44. package/src/components/dev-tools/dev-toolbar/index.ts +1 -0
  45. package/src/components/dev-tools/grid-overlay/grid-overlay.tsx +41 -0
  46. package/src/components/dev-tools/grid-overlay/index.ts +1 -0
  47. package/src/components/dev-tools/index.ts +2 -0
  48. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-darwin.png +0 -0
  49. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-linux.png +0 -0
  50. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-darwin.png +0 -0
  51. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-linux.png +0 -0
  52. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-darwin.png +0 -0
  53. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-linux.png +0 -0
  54. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-darwin.png +0 -0
  55. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-linux.png +0 -0
  56. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-darwin.png +0 -0
  57. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-linux.png +0 -0
  58. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-darwin.png +0 -0
  59. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-linux.png +0 -0
  60. package/src/components/organisms/card/card.stories.tsx +293 -0
  61. package/src/components/organisms/card/card.test.tsx +245 -0
  62. package/src/components/organisms/card/card.tsx +225 -0
  63. package/src/components/organisms/card/card.visual.test.tsx +197 -0
  64. package/src/components/organisms/card/index.ts +19 -0
  65. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-darwin.png +0 -0
  66. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-linux.png +0 -0
  67. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-darwin.png +0 -0
  68. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-linux.png +0 -0
  69. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-darwin.png +0 -0
  70. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-linux.png +0 -0
  71. package/src/components/organisms/navbar/index.ts +18 -0
  72. package/src/components/organisms/navbar/navbar.stories.tsx +313 -0
  73. package/src/components/organisms/navbar/navbar.test.tsx +190 -0
  74. package/src/components/organisms/navbar/navbar.tsx +323 -0
  75. package/src/components/organisms/navbar/navbar.visual.test.tsx +85 -0
  76. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-darwin.png +0 -0
  77. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-linux.png +0 -0
  78. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-darwin.png +0 -0
  79. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-linux.png +0 -0
  80. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-darwin.png +0 -0
  81. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-linux.png +0 -0
  82. package/src/components/organisms/us-gov-banner/index.ts +1 -0
  83. package/src/components/organisms/us-gov-banner/us-gov-banner.stories.tsx +35 -0
  84. package/src/components/organisms/us-gov-banner/us-gov-banner.test.tsx +107 -0
  85. package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +73 -0
  86. package/src/components/organisms/us-gov-banner/us-gov-banner.visual.test.tsx +46 -0
  87. package/src/components/sections/banner/banner.stories.tsx +150 -0
  88. package/src/components/sections/banner/banner.test.tsx +185 -0
  89. package/src/components/sections/banner/banner.tsx +130 -0
  90. package/src/components/sections/banner/index.ts +2 -0
  91. package/src/components/sections/card-grid/card-grid.stories.tsx +351 -0
  92. package/src/components/sections/card-grid/card-grid.tsx +116 -0
  93. package/src/components/sections/card-grid/index.ts +1 -0
  94. package/src/components/sections/faq-section/faq-section.stories.tsx +453 -0
  95. package/src/components/sections/faq-section/faq-section.tsx +84 -0
  96. package/src/components/sections/faq-section/index.ts +2 -0
  97. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-darwin.png +0 -0
  98. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-linux.png +0 -0
  99. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-darwin.png +0 -0
  100. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-linux.png +0 -0
  101. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-darwin.png +0 -0
  102. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-linux.png +0 -0
  103. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-darwin.png +0 -0
  104. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-linux.png +0 -0
  105. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-darwin.png +0 -0
  106. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-linux.png +0 -0
  107. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-darwin.png +0 -0
  108. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-linux.png +0 -0
  109. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-darwin.png +0 -0
  110. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-linux.png +0 -0
  111. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-darwin.png +0 -0
  112. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-linux.png +0 -0
  113. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-darwin.png +0 -0
  114. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-linux.png +0 -0
  115. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-darwin.png +0 -0
  116. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-linux.png +0 -0
  117. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-default-chromium-linux.png +0 -0
  118. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-darwin.png +0 -0
  119. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-linux.png +0 -0
  120. package/src/components/sections/hero/hero.stories.tsx +274 -0
  121. package/src/components/sections/hero/hero.test.tsx +135 -0
  122. package/src/components/sections/hero/hero.tsx +453 -0
  123. package/src/components/sections/hero/hero.visual.test.tsx +140 -0
  124. package/src/components/sections/hero/index.ts +10 -0
  125. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-darwin.png +0 -0
  126. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-linux.png +0 -0
  127. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-darwin.png +0 -0
  128. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-linux.png +0 -0
  129. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-darwin.png +0 -0
  130. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-linux.png +0 -0
  131. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-darwin.png +0 -0
  132. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-linux.png +0 -0
  133. package/src/components/sections/prose/index.ts +6 -0
  134. package/src/components/sections/prose/prose.stories.tsx +144 -0
  135. package/src/components/sections/prose/prose.test.tsx +178 -0
  136. package/src/components/sections/prose/prose.tsx +88 -0
  137. package/src/components/sections/prose/prose.visual.test.tsx +105 -0
  138. package/src/components/sections/river/index.ts +1 -0
  139. package/src/components/sections/river/river.stories.tsx +237 -0
  140. package/src/components/sections/river/river.test.tsx +268 -0
  141. package/src/components/sections/river/river.tsx +173 -0
  142. package/src/components/sections/tout/index.ts +1 -0
  143. package/src/components/sections/tout/tout.stories.tsx +171 -0
  144. package/src/components/sections/tout/tout.test.tsx +242 -0
  145. package/src/components/sections/tout/tout.tsx +270 -0
  146. package/src/components/sections/two-column-section/index.ts +5 -0
  147. package/src/components/sections/two-column-section/two-column-section.stories.tsx +285 -0
  148. package/src/components/sections/two-column-section/two-column-section.tsx +162 -0
  149. package/src/hooks/index.ts +1 -0
  150. package/src/hooks/use-event-listener.ts +73 -0
  151. package/src/index.ts +155 -0
  152. package/src/lib/theme.ts +1000 -0
  153. package/src/lib/utils.ts +6 -0
  154. package/src/main.tsx +13 -0
  155. package/src/stories/GridSystem.stories.tsx +84 -0
  156. package/src/stories/Introduction.mdx +114 -0
  157. package/src/stories/ThemeProvider.stories.tsx +357 -0
  158. package/src/stories/TokenShowcase.stories.tsx +92 -0
  159. package/src/stories/TokenShowcase.tsx +1429 -0
  160. package/src/styles.css +11 -0
  161. package/src/theme/ThemeProvider.tsx +297 -0
  162. package/src/theme/hooks.ts +40 -0
  163. package/src/theme/index.ts +43 -0
  164. package/src/theme/utils.ts +104 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nationaldesignstudio/react",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -17,7 +17,8 @@
17
17
  "./tailwind.css": "./dist/tailwind.css"
18
18
  },
19
19
  "files": [
20
- "dist"
20
+ "dist",
21
+ "src"
21
22
  ],
22
23
  "scripts": {
23
24
  "dev": "storybook dev -p 6006",
package/src/App.css ADDED
File without changes
package/src/App.tsx ADDED
@@ -0,0 +1,7 @@
1
+ import "./App.css";
2
+
3
+ function App() {
4
+ return <h1 className="text-3xl font-bold underline">Hello world!</h1>;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -0,0 +1,228 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { Accordion, AccordionItem } from ".";
3
+
4
+ const meta: Meta<typeof Accordion> = {
5
+ title: "Atoms/Accordion",
6
+ component: Accordion,
7
+ parameters: {
8
+ layout: "padded",
9
+ },
10
+ argTypes: {
11
+ allowMultiple: {
12
+ control: "boolean",
13
+ description: "Allow multiple items to be expanded at once",
14
+ },
15
+ defaultExpanded: {
16
+ control: "text",
17
+ description: "ID of item to expand by default",
18
+ },
19
+ },
20
+ decorators: [
21
+ (Story) => (
22
+ <div className="p-spacing-56 max-w-[746px]">
23
+ <Story />
24
+ </div>
25
+ ),
26
+ ],
27
+ } as Meta<typeof Accordion>;
28
+
29
+ export default meta;
30
+ type Story = StoryObj<typeof Accordion>;
31
+
32
+ // =============================================================================
33
+ // Default
34
+ // =============================================================================
35
+
36
+ export const Default: Story = {
37
+ render: (args) => (
38
+ <Accordion {...args}>
39
+ <AccordionItem
40
+ id="item-1"
41
+ title="What is the US Tech Force (Tech Force)?"
42
+ >
43
+ Tech Force will be an elite group of ~1,000 technology specialists hired
44
+ by agencies to accelerate artificial intelligence (AI) implementation
45
+ and solve the federal government's most critical technological
46
+ challenges.
47
+ </AccordionItem>
48
+ <AccordionItem
49
+ id="item-2"
50
+ title="What are the key steps in the recruiting process?"
51
+ >
52
+ The recruiting process includes an initial application, technical
53
+ assessment, interviews with agency leadership, and a background check.
54
+ Selected candidates will receive an offer within 4-6 weeks of completing
55
+ all steps.
56
+ </AccordionItem>
57
+ <AccordionItem id="item-3" title="What skills are required?">
58
+ We're looking for expertise in software engineering, artificial
59
+ intelligence, cybersecurity, data analytics, or technical project
60
+ management. Strong problem-solving abilities and a passion for public
61
+ service are essential.
62
+ </AccordionItem>
63
+ </Accordion>
64
+ ),
65
+ };
66
+ Default.args = {
67
+ defaultExpanded: "item-1",
68
+ };
69
+
70
+ // =============================================================================
71
+ // With First Item Expanded
72
+ // =============================================================================
73
+
74
+ export const FirstItemExpanded: Story = {
75
+ render: () => (
76
+ <Accordion defaultExpanded="item-1">
77
+ <AccordionItem
78
+ id="item-1"
79
+ title="What is the US Tech Force (Tech Force)?"
80
+ >
81
+ Tech Force will be an elite group of ~1,000 technology specialists hired
82
+ by agencies to accelerate artificial intelligence (AI) implementation
83
+ and solve the federal government's most critical technological
84
+ challenges. Tech Force will primarily recruit early-career technologists
85
+ from traditional recruiting channels, along with experienced engineering
86
+ managers from private sector partners, to serve two-year employment
87
+ terms in the federal government.
88
+ </AccordionItem>
89
+ <AccordionItem
90
+ id="item-2"
91
+ title="What are the key steps in the recruiting process?"
92
+ >
93
+ The recruiting process includes an initial application, technical
94
+ assessment, interviews with agency leadership, and a background check.
95
+ </AccordionItem>
96
+ <AccordionItem id="item-3" title="What skills are required?">
97
+ We're looking for expertise in software engineering, AI, cybersecurity,
98
+ data analytics, or technical project management.
99
+ </AccordionItem>
100
+ </Accordion>
101
+ ),
102
+ };
103
+
104
+ // =============================================================================
105
+ // Allow Multiple
106
+ // =============================================================================
107
+
108
+ export const AllowMultiple: Story = {
109
+ render: () => (
110
+ <Accordion allowMultiple defaultExpanded={["item-1", "item-2"]}>
111
+ <AccordionItem
112
+ id="item-1"
113
+ title="What is the US Tech Force (Tech Force)?"
114
+ >
115
+ Tech Force will be an elite group of ~1,000 technology specialists hired
116
+ by agencies to accelerate artificial intelligence (AI) implementation
117
+ and solve the federal government's most critical technological
118
+ challenges.
119
+ </AccordionItem>
120
+ <AccordionItem
121
+ id="item-2"
122
+ title="What are the key steps in the recruiting process?"
123
+ >
124
+ The recruiting process includes an initial application, technical
125
+ assessment, interviews with agency leadership, and a background check.
126
+ </AccordionItem>
127
+ <AccordionItem id="item-3" title="What skills are required?">
128
+ We're looking for expertise in software engineering, AI, cybersecurity,
129
+ data analytics, or technical project management.
130
+ </AccordionItem>
131
+ </Accordion>
132
+ ),
133
+ };
134
+
135
+ // =============================================================================
136
+ // All Collapsed
137
+ // =============================================================================
138
+
139
+ export const AllCollapsed: Story = {
140
+ render: () => (
141
+ <Accordion>
142
+ <AccordionItem
143
+ id="item-1"
144
+ title="What is the US Tech Force (Tech Force)?"
145
+ >
146
+ Tech Force will be an elite group of ~1,000 technology specialists.
147
+ </AccordionItem>
148
+ <AccordionItem
149
+ id="item-2"
150
+ title="What are the key steps in the recruiting process?"
151
+ >
152
+ The recruiting process includes an initial application and interviews.
153
+ </AccordionItem>
154
+ <AccordionItem id="item-3" title="What skills are required?">
155
+ Software engineering, AI, cybersecurity, data analytics.
156
+ </AccordionItem>
157
+ </Accordion>
158
+ ),
159
+ };
160
+
161
+ // =============================================================================
162
+ // FAQ Example (Full)
163
+ // =============================================================================
164
+
165
+ export const FAQExample: Story = {
166
+ render: () => (
167
+ <Accordion defaultExpanded="faq-1">
168
+ <AccordionItem id="faq-1" title="What is the US Tech Force (Tech Force)?">
169
+ Tech Force will be an elite group of ~1,000 technology specialists hired
170
+ by agencies to accelerate artificial intelligence (AI) implementation
171
+ and solve the federal government's most critical technological
172
+ challenges. Tech Force will primarily recruit early-career technologists
173
+ from traditional recruiting channels, along with experienced engineering
174
+ managers from private sector partners, to serve two-year employment
175
+ terms in the federal government. Tech Force will include centralized
176
+ organization and programming and serve as a recruiting platform
177
+ post-employment.
178
+ </AccordionItem>
179
+ <AccordionItem
180
+ id="faq-2"
181
+ title="What are the key steps in the recruiting process?"
182
+ >
183
+ The recruiting process includes an initial application, technical
184
+ assessment, interviews with agency leadership, and a background check.
185
+ Selected candidates will receive an offer within 4-6 weeks of completing
186
+ all steps.
187
+ </AccordionItem>
188
+ <AccordionItem id="faq-3" title="What skills are required?">
189
+ We're looking for expertise in software engineering, artificial
190
+ intelligence, cybersecurity, data analytics, or technical project
191
+ management. Strong problem-solving abilities and a passion for public
192
+ service are essential.
193
+ </AccordionItem>
194
+ <AccordionItem
195
+ id="faq-4"
196
+ title="Are specific educational credentials required to participate?"
197
+ >
198
+ While we value diverse educational backgrounds, candidates should
199
+ demonstrate strong technical skills through their work experience,
200
+ projects, or certifications. A traditional degree is not strictly
201
+ required.
202
+ </AccordionItem>
203
+ <AccordionItem
204
+ id="faq-5"
205
+ title="Is there a minimum experience level required to apply?"
206
+ >
207
+ We welcome applications from early-career technologists with 1-3 years
208
+ of experience as well as experienced professionals. What matters most is
209
+ your ability to contribute to critical government technology challenges.
210
+ </AccordionItem>
211
+ <AccordionItem id="faq-6" title="Is this a political appointment?">
212
+ No, Tech Force positions are not political appointments. Participants
213
+ are hired as federal employees based on their technical qualifications
214
+ and serve in non-partisan roles focused on technology implementation.
215
+ </AccordionItem>
216
+ <AccordionItem id="faq-7" title="When am I expected to start?">
217
+ Start dates vary by cohort. Most participants begin within 2-3 months of
218
+ receiving their offer, pending completion of background checks and
219
+ onboarding requirements.
220
+ </AccordionItem>
221
+ <AccordionItem id="faq-8" title="Where will the employment be located?">
222
+ Positions are primarily based in Washington, D.C., though some roles may
223
+ be available at agency locations across the country. Remote work options
224
+ vary by agency and role.
225
+ </AccordionItem>
226
+ </Accordion>
227
+ ),
228
+ };
@@ -0,0 +1,219 @@
1
+ "use client";
2
+
3
+ import { Accordion as BaseAccordion } from "@base-ui-components/react/accordion";
4
+ import * as React from "react";
5
+ import { tv, type VariantProps } from "tailwind-variants";
6
+ import { cn } from "@/lib/utils";
7
+
8
+ // =============================================================================
9
+ // Accordion Variants
10
+ // =============================================================================
11
+
12
+ const accordionVariants = tv({
13
+ base: "flex flex-col",
14
+ variants: {
15
+ variant: {
16
+ dark: "",
17
+ light: "",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "dark",
22
+ },
23
+ });
24
+
25
+ const accordionItemVariants = tv({
26
+ base: "border-b overflow-hidden",
27
+ variants: {
28
+ variant: {
29
+ dark: "border-gray-300",
30
+ light: "border-gray-500",
31
+ },
32
+ },
33
+ defaultVariants: {
34
+ variant: "dark",
35
+ },
36
+ });
37
+
38
+ const accordionTriggerVariants = tv({
39
+ base: [
40
+ // Uses primitive spacing tokens
41
+ "flex w-full items-center justify-between py-spacing-24 text-left",
42
+ "typography-body-large transition-colors cursor-pointer",
43
+ ],
44
+ variants: {
45
+ variant: {
46
+ dark: "text-gray-100 data-[open]:text-white",
47
+ light: "text-gray-800 data-[open]:text-gray-900",
48
+ },
49
+ },
50
+ defaultVariants: {
51
+ variant: "dark",
52
+ },
53
+ });
54
+
55
+ const accordionPanelVariants = tv({
56
+ // Uses primitive spacing tokens
57
+ base: "typography-body-large pb-spacing-24",
58
+ variants: {
59
+ variant: {
60
+ dark: "text-gray-100",
61
+ light: "text-gray-800",
62
+ },
63
+ },
64
+ defaultVariants: {
65
+ variant: "dark",
66
+ },
67
+ });
68
+
69
+ // =============================================================================
70
+ // Accordion Context
71
+ // =============================================================================
72
+
73
+ const AccordionContext = React.createContext<{
74
+ variant: "dark" | "light";
75
+ }>({
76
+ variant: "dark",
77
+ });
78
+
79
+ // =============================================================================
80
+ // Accordion
81
+ // =============================================================================
82
+
83
+ export interface AccordionProps
84
+ extends React.HTMLAttributes<HTMLDivElement>,
85
+ VariantProps<typeof accordionVariants> {
86
+ /**
87
+ * Allow multiple items to be expanded at once
88
+ * @default false
89
+ */
90
+ allowMultiple?: boolean;
91
+ /**
92
+ * The ID(s) of items that should be expanded by default
93
+ */
94
+ defaultExpanded?: string | string[];
95
+ children: React.ReactNode;
96
+ }
97
+
98
+ /**
99
+ * Accordion component for expandable/collapsible content sections.
100
+ * Built on Base UI's Accordion primitive.
101
+ *
102
+ * Variants:
103
+ * - dark: Dark theme styling (default)
104
+ * - light: Light theme styling
105
+ *
106
+ * @example
107
+ * ```tsx
108
+ * <Accordion defaultExpanded="item-1" variant="dark">
109
+ * <AccordionItem id="item-1" title="Question 1">
110
+ * Answer to question 1
111
+ * </AccordionItem>
112
+ * <AccordionItem id="item-2" title="Question 2">
113
+ * Answer to question 2
114
+ * </AccordionItem>
115
+ * </Accordion>
116
+ * ```
117
+ */
118
+ const Accordion = React.forwardRef<HTMLDivElement, AccordionProps>(
119
+ (
120
+ {
121
+ className,
122
+ allowMultiple = false,
123
+ defaultExpanded,
124
+ variant = "light",
125
+ children,
126
+ },
127
+ ref,
128
+ ) => {
129
+ // Normalize defaultExpanded to array format for Base UI
130
+ const defaultValue = React.useMemo((): string[] | undefined => {
131
+ if (!defaultExpanded) return undefined;
132
+ if (Array.isArray(defaultExpanded)) return defaultExpanded;
133
+ return [defaultExpanded];
134
+ }, [defaultExpanded]);
135
+
136
+ return (
137
+ <AccordionContext.Provider value={{ variant: variant ?? "dark" }}>
138
+ <BaseAccordion.Root
139
+ ref={ref}
140
+ className={accordionVariants({ variant, class: className })}
141
+ defaultValue={defaultValue}
142
+ multiple={allowMultiple}
143
+ >
144
+ {children}
145
+ </BaseAccordion.Root>
146
+ </AccordionContext.Provider>
147
+ );
148
+ },
149
+ );
150
+ Accordion.displayName = "Accordion";
151
+
152
+ // =============================================================================
153
+ // AccordionItem
154
+ // =============================================================================
155
+
156
+ export interface AccordionItemProps
157
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
158
+ /**
159
+ * Unique identifier for this item
160
+ */
161
+ id: string;
162
+ /**
163
+ * The question/title displayed in the header
164
+ */
165
+ title: string;
166
+ /**
167
+ * The answer/content revealed when expanded
168
+ */
169
+ children: React.ReactNode;
170
+ }
171
+
172
+ /**
173
+ * Individual accordion item with collapsible content.
174
+ * Must be used within an Accordion component.
175
+ */
176
+ const AccordionItem = React.forwardRef<HTMLDivElement, AccordionItemProps>(
177
+ ({ className, id, title, children }, ref) => {
178
+ const { variant } = React.useContext(AccordionContext);
179
+
180
+ return (
181
+ <BaseAccordion.Item
182
+ ref={ref}
183
+ value={id}
184
+ className={accordionItemVariants({ variant, class: className })}
185
+ >
186
+ {/* Header - always visible */}
187
+ <BaseAccordion.Header>
188
+ <BaseAccordion.Trigger
189
+ className={accordionTriggerVariants({ variant })}
190
+ >
191
+ <span>{title}</span>
192
+ <span
193
+ className={cn(
194
+ "text-base transition-transform duration-200",
195
+ "[[data-open]_&]:rotate-45",
196
+ )}
197
+ >
198
+ +
199
+ </span>
200
+ </BaseAccordion.Trigger>
201
+ </BaseAccordion.Header>
202
+
203
+ {/* Content - collapsible */}
204
+ <BaseAccordion.Panel
205
+ className={cn(
206
+ "h-[var(--accordion-panel-height)] overflow-hidden",
207
+ "transition-[height] duration-300 ease-out",
208
+ "[&[data-starting-style]]:h-0 [&[data-ending-style]]:h-0",
209
+ )}
210
+ >
211
+ <div className={accordionPanelVariants({ variant })}>{children}</div>
212
+ </BaseAccordion.Panel>
213
+ </BaseAccordion.Item>
214
+ );
215
+ },
216
+ );
217
+ AccordionItem.displayName = "AccordionItem";
218
+
219
+ export { Accordion, AccordionItem, accordionVariants };
@@ -0,0 +1,6 @@
1
+ export {
2
+ Accordion,
3
+ AccordionItem,
4
+ type AccordionItemProps,
5
+ type AccordionProps,
6
+ } from "./accordion";
@@ -0,0 +1,102 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { Button } from ".";
3
+
4
+ const meta: Meta<typeof Button> = {
5
+ title: "Atoms/Button",
6
+ } as Meta<typeof Button>;
7
+
8
+ export default meta;
9
+ type Story = StoryObj<typeof Button>;
10
+
11
+ export const Playground: Story = {
12
+ render: (args) => <Button {...args}>Button</Button>,
13
+ };
14
+ Playground.argTypes = {
15
+ size: {
16
+ control: {
17
+ type: "radio",
18
+ },
19
+ options: ["sm", "default", "lg"],
20
+ },
21
+ disabled: {
22
+ control: {
23
+ type: "boolean",
24
+ },
25
+ },
26
+ variant: {
27
+ control: {
28
+ type: "radio",
29
+ },
30
+ options: [
31
+ "primary",
32
+ "primaryOutline",
33
+ "secondary",
34
+ "charcoal",
35
+ "charcoalOutline",
36
+ "charcoalOutlineQuiet",
37
+ "ivory",
38
+ "ivoryOutline",
39
+ "ivoryOutlineQuiet",
40
+ "gray",
41
+ ],
42
+ },
43
+ };
44
+ Playground.args = {
45
+ size: "default",
46
+ disabled: false,
47
+ variant: "primary",
48
+ };
49
+
50
+ // =============================================================================
51
+ // Semantic Variants (recommended)
52
+ // =============================================================================
53
+
54
+ export const Primary = () => <Button variant="primary">Primary</Button>;
55
+
56
+ export const PrimaryOutline = () => (
57
+ <Button variant="primaryOutline">Primary Outline</Button>
58
+ );
59
+
60
+ export const Secondary = () => <Button variant="secondary">Secondary</Button>;
61
+
62
+ // =============================================================================
63
+ // Legacy Variants
64
+ // =============================================================================
65
+
66
+ export const Charcoal = () => <Button variant="charcoal">Charcoal</Button>;
67
+
68
+ export const CharcoalOutline = () => (
69
+ <Button variant="charcoalOutline">Charcoal Outline</Button>
70
+ );
71
+
72
+ export const CharcoalOutlineQuiet = () => (
73
+ <Button variant="charcoalOutlineQuiet">Charcoal Outline Quiet</Button>
74
+ );
75
+
76
+ export const Ivory = () => <Button variant="ivory">Ivory</Button>;
77
+
78
+ export const IvoryOutline = () => (
79
+ <Button variant="ivoryOutline">Ivory Outline</Button>
80
+ );
81
+
82
+ export const IvoryOutlineQuiet = () => (
83
+ <Button variant="ivoryOutlineQuiet">Ivory Outline Quiet</Button>
84
+ );
85
+
86
+ export const Gray = () => <Button variant="gray">Gray</Button>;
87
+
88
+ // =============================================================================
89
+ // Sizes
90
+ // =============================================================================
91
+
92
+ export const Small = () => <Button size="sm">Small</Button>;
93
+
94
+ export const Medium = () => <Button size="default">Medium</Button>;
95
+
96
+ export const Large = () => <Button size="lg">Large</Button>;
97
+
98
+ // =============================================================================
99
+ // States
100
+ // =============================================================================
101
+
102
+ export const Disabled = () => <Button disabled>Disabled</Button>;