@nationaldesignstudio/react 0.5.2 → 0.5.3

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 (160) hide show
  1. package/package.json +10 -2
  2. package/src/App.css +0 -0
  3. package/src/App.tsx +0 -7
  4. package/src/assets/fonts/PPNeueMontreal-Variable.woff2 +0 -0
  5. package/src/assets/react.svg +0 -1
  6. package/src/components/atoms/accordion/accordion.stories.tsx +0 -228
  7. package/src/components/atoms/accordion/accordion.test.tsx +0 -231
  8. package/src/components/atoms/accordion/index.ts +0 -6
  9. package/src/components/atoms/background/background.test.tsx +0 -213
  10. package/src/components/atoms/background/index.ts +0 -22
  11. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-darwin.png +0 -0
  12. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-linux.png +0 -0
  13. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-darwin.png +0 -0
  14. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-linux.png +0 -0
  15. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-darwin.png +0 -0
  16. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-linux.png +0 -0
  17. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-darwin.png +0 -0
  18. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-linux.png +0 -0
  19. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-darwin.png +0 -0
  20. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-linux.png +0 -0
  21. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-darwin.png +0 -0
  22. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-linux.png +0 -0
  23. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-darwin.png +0 -0
  24. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-linux.png +0 -0
  25. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-darwin.png +0 -0
  26. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-linux.png +0 -0
  27. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-darwin.png +0 -0
  28. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-linux.png +0 -0
  29. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-darwin.png +0 -0
  30. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-linux.png +0 -0
  31. package/src/components/atoms/button/button.stories.tsx +0 -289
  32. package/src/components/atoms/button/button.test.tsx +0 -419
  33. package/src/components/atoms/button/button.visual.test.tsx +0 -98
  34. package/src/components/atoms/button/icon-button.stories.tsx +0 -260
  35. package/src/components/atoms/button/icon-button.test.tsx +0 -186
  36. package/src/components/atoms/button/index.ts +0 -6
  37. package/src/components/atoms/input/index.ts +0 -17
  38. package/src/components/atoms/input/input-group.stories.tsx +0 -646
  39. package/src/components/atoms/input/input-group.test.tsx +0 -362
  40. package/src/components/atoms/input/input.stories.tsx +0 -228
  41. package/src/components/atoms/input/input.test.tsx +0 -167
  42. package/src/components/atoms/ndstudio-footer/index.ts +0 -1
  43. package/src/components/atoms/pager-control/index.ts +0 -5
  44. package/src/components/atoms/pager-control/pager-control.stories.tsx +0 -207
  45. package/src/components/atoms/pager-control/pager-control.test.tsx +0 -130
  46. package/src/components/atoms/popover/index.ts +0 -30
  47. package/src/components/atoms/popover/popover.stories.tsx +0 -531
  48. package/src/components/atoms/popover/popover.test.tsx +0 -486
  49. package/src/components/atoms/select/index.ts +0 -18
  50. package/src/components/atoms/select/select.stories.tsx +0 -455
  51. package/src/components/atoms/tooltip/index.ts +0 -24
  52. package/src/components/atoms/tooltip/tooltip.stories.tsx +0 -348
  53. package/src/components/atoms/tooltip/tooltip.test.tsx +0 -363
  54. package/src/components/dev-tools/dev-toolbar/dev-toolbar.stories.tsx +0 -73
  55. package/src/components/dev-tools/dev-toolbar/index.ts +0 -1
  56. package/src/components/dev-tools/grid-overlay/index.ts +0 -1
  57. package/src/components/dev-tools/index.ts +0 -2
  58. package/src/components/foundation/typography/typography.stories.tsx +0 -401
  59. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-darwin.png +0 -0
  60. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-linux.png +0 -0
  61. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-darwin.png +0 -0
  62. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-linux.png +0 -0
  63. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-darwin.png +0 -0
  64. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-linux.png +0 -0
  65. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-darwin.png +0 -0
  66. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-linux.png +0 -0
  67. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-darwin.png +0 -0
  68. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-linux.png +0 -0
  69. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-darwin.png +0 -0
  70. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-linux.png +0 -0
  71. package/src/components/organisms/card/card.stories.tsx +0 -293
  72. package/src/components/organisms/card/card.test.tsx +0 -247
  73. package/src/components/organisms/card/card.visual.test.tsx +0 -197
  74. package/src/components/organisms/card/index.ts +0 -26
  75. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-darwin.png +0 -0
  76. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-linux.png +0 -0
  77. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-darwin.png +0 -0
  78. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-linux.png +0 -0
  79. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-darwin.png +0 -0
  80. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-linux.png +0 -0
  81. package/src/components/organisms/navbar/index.ts +0 -18
  82. package/src/components/organisms/navbar/navbar.stories.tsx +0 -313
  83. package/src/components/organisms/navbar/navbar.test.tsx +0 -190
  84. package/src/components/organisms/navbar/navbar.visual.test.tsx +0 -85
  85. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-darwin.png +0 -0
  86. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-linux.png +0 -0
  87. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-darwin.png +0 -0
  88. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-linux.png +0 -0
  89. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-darwin.png +0 -0
  90. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-linux.png +0 -0
  91. package/src/components/organisms/us-gov-banner/index.ts +0 -5
  92. package/src/components/organisms/us-gov-banner/us-gov-banner.stories.tsx +0 -35
  93. package/src/components/organisms/us-gov-banner/us-gov-banner.test.tsx +0 -107
  94. package/src/components/organisms/us-gov-banner/us-gov-banner.visual.test.tsx +0 -46
  95. package/src/components/sections/banner/banner.stories.tsx +0 -150
  96. package/src/components/sections/banner/banner.test.tsx +0 -185
  97. package/src/components/sections/banner/index.ts +0 -2
  98. package/src/components/sections/card-grid/card-grid.stories.tsx +0 -351
  99. package/src/components/sections/card-grid/index.ts +0 -1
  100. package/src/components/sections/faq-section/faq-section.stories.tsx +0 -453
  101. package/src/components/sections/faq-section/index.ts +0 -2
  102. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-darwin.png +0 -0
  103. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-linux.png +0 -0
  104. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-darwin.png +0 -0
  105. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-linux.png +0 -0
  106. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-darwin.png +0 -0
  107. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-linux.png +0 -0
  108. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-darwin.png +0 -0
  109. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-linux.png +0 -0
  110. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-darwin.png +0 -0
  111. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-linux.png +0 -0
  112. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-darwin.png +0 -0
  113. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-linux.png +0 -0
  114. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-darwin.png +0 -0
  115. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-linux.png +0 -0
  116. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-darwin.png +0 -0
  117. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-linux.png +0 -0
  118. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-darwin.png +0 -0
  119. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-linux.png +0 -0
  120. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-darwin.png +0 -0
  121. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-linux.png +0 -0
  122. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-default-chromium-linux.png +0 -0
  123. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-darwin.png +0 -0
  124. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-linux.png +0 -0
  125. package/src/components/sections/hero/hero.stories.tsx +0 -397
  126. package/src/components/sections/hero/hero.test.tsx +0 -138
  127. package/src/components/sections/hero/hero.visual.test.tsx +0 -140
  128. package/src/components/sections/hero/index.ts +0 -23
  129. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-darwin.png +0 -0
  130. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-linux.png +0 -0
  131. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-darwin.png +0 -0
  132. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-linux.png +0 -0
  133. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-darwin.png +0 -0
  134. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-linux.png +0 -0
  135. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-darwin.png +0 -0
  136. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-linux.png +0 -0
  137. package/src/components/sections/prose/index.ts +0 -6
  138. package/src/components/sections/prose/prose.stories.tsx +0 -144
  139. package/src/components/sections/prose/prose.test.tsx +0 -178
  140. package/src/components/sections/prose/prose.visual.test.tsx +0 -105
  141. package/src/components/sections/quote-block/index.ts +0 -5
  142. package/src/components/sections/river/index.ts +0 -1
  143. package/src/components/sections/river/river.stories.tsx +0 -237
  144. package/src/components/sections/river/river.test.tsx +0 -268
  145. package/src/components/sections/tout/index.ts +0 -1
  146. package/src/components/sections/tout/tout.stories.tsx +0 -171
  147. package/src/components/sections/tout/tout.test.tsx +0 -242
  148. package/src/components/sections/two-column-section/index.ts +0 -5
  149. package/src/components/sections/two-column-section/two-column-section.stories.tsx +0 -285
  150. package/src/components/shared/index.ts +0 -5
  151. package/src/index.ts +0 -293
  152. package/src/main.tsx +0 -13
  153. package/src/stories/grid-system.stories.tsx +0 -309
  154. package/src/stories/introduction.mdx +0 -128
  155. package/src/stories/theme-provider.stories.tsx +0 -349
  156. package/src/stories/token-showcase.stories.tsx +0 -73
  157. package/src/stories/token-showcase.tsx +0 -777
  158. package/src/styles.css +0 -14
  159. package/src/tests/token-resolution.test.tsx +0 -298
  160. package/src/theme/theme-provider.test.tsx +0 -270
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nationaldesignstudio/react",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -18,7 +18,15 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
- "src"
21
+ "src/components/**/*.tsx",
22
+ "src/lib/**/*.ts",
23
+ "src/hooks/**/*.ts",
24
+ "src/theme/**/*.ts",
25
+ "src/theme/**/*.tsx",
26
+ "!src/**/*.test.tsx",
27
+ "!src/**/*.stories.tsx",
28
+ "!src/**/*.visual.test.tsx",
29
+ "!src/**/__screenshots__/**"
22
30
  ],
23
31
  "scripts": {
24
32
  "dev": "storybook dev -p 6006",
package/src/App.css DELETED
File without changes
package/src/App.tsx DELETED
@@ -1,7 +0,0 @@
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;
@@ -1 +0,0 @@
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>
@@ -1,228 +0,0 @@
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-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
- };
@@ -1,231 +0,0 @@
1
- import { describe, expect, test } from "vitest";
2
- import { page, userEvent } from "vitest/browser";
3
- import { render } from "vitest-browser-react";
4
- import { Accordion, AccordionItem } from "./accordion";
5
-
6
- describe("Accordion", () => {
7
- describe("Rendering", () => {
8
- test("renders accordion with items", async () => {
9
- render(
10
- <Accordion>
11
- <AccordionItem id="item-1" title="Question 1">
12
- Answer 1
13
- </AccordionItem>
14
- <AccordionItem id="item-2" title="Question 2">
15
- Answer 2
16
- </AccordionItem>
17
- </Accordion>,
18
- );
19
- await expect
20
- .element(page.getByRole("button", { name: "Question 1" }))
21
- .toBeInTheDocument();
22
- await expect
23
- .element(page.getByRole("button", { name: "Question 2" }))
24
- .toBeInTheDocument();
25
- });
26
-
27
- test("renders with default expanded item", async () => {
28
- render(
29
- <Accordion defaultExpanded="item-1">
30
- <AccordionItem id="item-1" title="Question 1">
31
- Answer 1
32
- </AccordionItem>
33
- <AccordionItem id="item-2" title="Question 2">
34
- Answer 2
35
- </AccordionItem>
36
- </Accordion>,
37
- );
38
- // The first item should be expanded (has data-open attribute)
39
- await expect
40
- .element(page.getByRole("button", { name: "Question 1" }))
41
- .toHaveAttribute("aria-expanded", "true");
42
- });
43
-
44
- test("renders with multiple default expanded items", async () => {
45
- render(
46
- <Accordion allowMultiple defaultExpanded={["item-1", "item-2"]}>
47
- <AccordionItem id="item-1" title="Question 1">
48
- Answer 1
49
- </AccordionItem>
50
- <AccordionItem id="item-2" title="Question 2">
51
- Answer 2
52
- </AccordionItem>
53
- </Accordion>,
54
- );
55
- await expect
56
- .element(page.getByRole("button", { name: "Question 1" }))
57
- .toHaveAttribute("aria-expanded", "true");
58
- await expect
59
- .element(page.getByRole("button", { name: "Question 2" }))
60
- .toHaveAttribute("aria-expanded", "true");
61
- });
62
- });
63
-
64
- describe("Keyboard Navigation", () => {
65
- test("items are focusable via Tab", async () => {
66
- render(
67
- <Accordion>
68
- <AccordionItem id="item-1" title="Question 1">
69
- Answer 1
70
- </AccordionItem>
71
- <AccordionItem id="item-2" title="Question 2">
72
- Answer 2
73
- </AccordionItem>
74
- </Accordion>,
75
- );
76
- await userEvent.keyboard("{Tab}");
77
- await expect
78
- .element(page.getByRole("button", { name: "Question 1" }))
79
- .toHaveFocus();
80
- });
81
-
82
- test("Enter key expands/collapses item", async () => {
83
- render(
84
- <Accordion>
85
- <AccordionItem id="item-1" title="Question 1">
86
- Answer 1
87
- </AccordionItem>
88
- </Accordion>,
89
- );
90
- const trigger = page.getByRole("button", { name: "Question 1" });
91
- trigger.element().focus();
92
- await userEvent.keyboard("{Enter}");
93
- await expect.element(trigger).toHaveAttribute("aria-expanded", "true");
94
- });
95
-
96
- test("Space key expands/collapses item", async () => {
97
- render(
98
- <Accordion>
99
- <AccordionItem id="item-1" title="Question 1">
100
- Answer 1
101
- </AccordionItem>
102
- </Accordion>,
103
- );
104
- const trigger = page.getByRole("button", { name: "Question 1" });
105
- trigger.element().focus();
106
- await userEvent.keyboard(" ");
107
- await expect.element(trigger).toHaveAttribute("aria-expanded", "true");
108
- });
109
- });
110
-
111
- describe("Click Interactions", () => {
112
- test("clicking trigger expands item", async () => {
113
- render(
114
- <Accordion>
115
- <AccordionItem id="item-1" title="Question 1">
116
- Answer 1
117
- </AccordionItem>
118
- </Accordion>,
119
- );
120
- const trigger = page.getByRole("button", { name: "Question 1" });
121
- await trigger.click();
122
- await expect.element(trigger).toHaveAttribute("aria-expanded", "true");
123
- });
124
-
125
- test("clicking expanded trigger collapses item", async () => {
126
- render(
127
- <Accordion defaultExpanded="item-1">
128
- <AccordionItem id="item-1" title="Question 1">
129
- Answer 1
130
- </AccordionItem>
131
- </Accordion>,
132
- );
133
- const trigger = page.getByRole("button", { name: "Question 1" });
134
- await expect.element(trigger).toHaveAttribute("aria-expanded", "true");
135
- await trigger.click();
136
- await expect.element(trigger).toHaveAttribute("aria-expanded", "false");
137
- });
138
-
139
- test("single mode collapses other items when opening new one", async () => {
140
- render(
141
- <Accordion defaultExpanded="item-1">
142
- <AccordionItem id="item-1" title="Question 1">
143
- Answer 1
144
- </AccordionItem>
145
- <AccordionItem id="item-2" title="Question 2">
146
- Answer 2
147
- </AccordionItem>
148
- </Accordion>,
149
- );
150
- const trigger1 = page.getByRole("button", { name: "Question 1" });
151
- const trigger2 = page.getByRole("button", { name: "Question 2" });
152
-
153
- await expect.element(trigger1).toHaveAttribute("aria-expanded", "true");
154
- await trigger2.click();
155
- await expect.element(trigger2).toHaveAttribute("aria-expanded", "true");
156
- await expect.element(trigger1).toHaveAttribute("aria-expanded", "false");
157
- });
158
-
159
- test("multiple mode allows multiple items open", async () => {
160
- render(
161
- <Accordion allowMultiple defaultExpanded="item-1">
162
- <AccordionItem id="item-1" title="Question 1">
163
- Answer 1
164
- </AccordionItem>
165
- <AccordionItem id="item-2" title="Question 2">
166
- Answer 2
167
- </AccordionItem>
168
- </Accordion>,
169
- );
170
- const trigger1 = page.getByRole("button", { name: "Question 1" });
171
- const trigger2 = page.getByRole("button", { name: "Question 2" });
172
-
173
- await expect.element(trigger1).toHaveAttribute("aria-expanded", "true");
174
- await trigger2.click();
175
- await expect.element(trigger1).toHaveAttribute("aria-expanded", "true");
176
- await expect.element(trigger2).toHaveAttribute("aria-expanded", "true");
177
- });
178
- });
179
-
180
- describe("Color Schemes", () => {
181
- test("applies light colorScheme by default", async () => {
182
- render(
183
- <Accordion>
184
- <AccordionItem id="item-1" title="Question 1">
185
- Answer 1
186
- </AccordionItem>
187
- </Accordion>,
188
- );
189
- const trigger = page.getByRole("button", { name: "Question 1" });
190
- await expect.element(trigger).toHaveClass(/text-gray-800/);
191
- });
192
-
193
- test("applies dark colorScheme classes", async () => {
194
- render(
195
- <Accordion colorScheme="dark">
196
- <AccordionItem id="item-1" title="Question 1">
197
- Answer 1
198
- </AccordionItem>
199
- </Accordion>,
200
- );
201
- const trigger = page.getByRole("button", { name: "Question 1" });
202
- await expect.element(trigger).toHaveClass(/text-gray-100/);
203
- });
204
- });
205
-
206
- describe("Content", () => {
207
- test("displays title text in trigger", async () => {
208
- render(
209
- <Accordion>
210
- <AccordionItem id="item-1" title="Custom Title">
211
- Content here
212
- </AccordionItem>
213
- </Accordion>,
214
- );
215
- await expect.element(page.getByText("Custom Title")).toBeInTheDocument();
216
- });
217
-
218
- test("displays content when expanded", async () => {
219
- render(
220
- <Accordion defaultExpanded="item-1">
221
- <AccordionItem id="item-1" title="Question 1">
222
- Answer content here
223
- </AccordionItem>
224
- </Accordion>,
225
- );
226
- await expect
227
- .element(page.getByText("Answer content here"))
228
- .toBeInTheDocument();
229
- });
230
- });
231
- });
@@ -1,6 +0,0 @@
1
- export {
2
- Accordion,
3
- AccordionItem,
4
- type AccordionItemProps,
5
- type AccordionProps,
6
- } from "./accordion";