@discourser/design-system 0.15.1 → 0.17.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 (179) hide show
  1. package/dist/{chunk-UNWXE6UB.cjs → chunk-2P7Z5PVP.cjs} +817 -16
  2. package/dist/chunk-2P7Z5PVP.cjs.map +1 -0
  3. package/dist/{chunk-ABC7N32K.cjs → chunk-PFWU7QSM.cjs} +464 -8
  4. package/dist/chunk-PFWU7QSM.cjs.map +1 -0
  5. package/dist/{chunk-GD6Q2FUE.js → chunk-QC7LGFM3.js} +808 -18
  6. package/dist/chunk-QC7LGFM3.js.map +1 -0
  7. package/dist/{chunk-SBKRSXSZ.js → chunk-SNUJBT5R.js} +464 -8
  8. package/dist/chunk-SNUJBT5R.js.map +1 -0
  9. package/dist/components/Accordion.figma.d.ts +2 -0
  10. package/dist/components/Accordion.figma.d.ts.map +1 -0
  11. package/dist/components/Breadcrumb.d.ts +2 -0
  12. package/dist/components/Breadcrumb.d.ts.map +1 -1
  13. package/dist/components/Breadcrumb.figma.d.ts +2 -0
  14. package/dist/components/Breadcrumb.figma.d.ts.map +1 -0
  15. package/dist/components/ContentCard/ContentCard.d.ts +13 -0
  16. package/dist/components/ContentCard/ContentCard.d.ts.map +1 -0
  17. package/dist/components/ContentCard/ContentCard.figma.d.ts +2 -0
  18. package/dist/components/ContentCard/ContentCard.figma.d.ts.map +1 -0
  19. package/dist/components/ContentCard/index.d.ts +2 -0
  20. package/dist/components/ContentCard/index.d.ts.map +1 -0
  21. package/dist/components/{Heading.d.ts → Header.d.ts} +3 -3
  22. package/dist/components/Header.d.ts.map +1 -0
  23. package/dist/components/Header.figma.d.ts +2 -0
  24. package/dist/components/Header.figma.d.ts.map +1 -0
  25. package/dist/components/Icons/AccountIcon.d.ts +6 -0
  26. package/dist/components/Icons/AccountIcon.d.ts.map +1 -0
  27. package/dist/components/Icons/ChevronUpIcon.d.ts +6 -0
  28. package/dist/components/Icons/ChevronUpIcon.d.ts.map +1 -0
  29. package/dist/components/Icons/ClockIcon.d.ts.map +1 -1
  30. package/dist/components/Icons/DashboardIcon.d.ts +6 -0
  31. package/dist/components/Icons/DashboardIcon.d.ts.map +1 -0
  32. package/dist/components/Icons/DiscourserLogo.d.ts +6 -0
  33. package/dist/components/Icons/DiscourserLogo.d.ts.map +1 -0
  34. package/dist/components/Icons/DiscourserLogo.figma.d.ts +2 -0
  35. package/dist/components/Icons/DiscourserLogo.figma.d.ts.map +1 -0
  36. package/dist/components/Icons/GripDotsVerticalIcon.d.ts.map +1 -1
  37. package/dist/components/Icons/HelpIcon.d.ts +6 -0
  38. package/dist/components/Icons/HelpIcon.d.ts.map +1 -0
  39. package/dist/components/Icons/NotebookIcon.d.ts +6 -0
  40. package/dist/components/Icons/NotebookIcon.d.ts.map +1 -0
  41. package/dist/components/Icons/RightArrowIcon.d.ts +6 -0
  42. package/dist/components/Icons/RightArrowIcon.d.ts.map +1 -0
  43. package/dist/components/Icons/ScenarioIcon.d.ts +6 -0
  44. package/dist/components/Icons/ScenarioIcon.d.ts.map +1 -0
  45. package/dist/components/Icons/index.d.ts +9 -1
  46. package/dist/components/Icons/index.d.ts.map +1 -1
  47. package/dist/components/NavigationMenu/NavigationMenu.d.ts +3 -0
  48. package/dist/components/NavigationMenu/NavigationMenu.d.ts.map +1 -0
  49. package/dist/components/NavigationMenu/NavigationMenu.figma.d.ts +2 -0
  50. package/dist/components/NavigationMenu/NavigationMenu.figma.d.ts.map +1 -0
  51. package/dist/components/NavigationMenu/index.d.ts +3 -0
  52. package/dist/components/NavigationMenu/index.d.ts.map +1 -0
  53. package/dist/components/NavigationMenu/types.d.ts +25 -0
  54. package/dist/components/NavigationMenu/types.d.ts.map +1 -0
  55. package/dist/components/QuickStartPage/QuickStartPage.d.ts +21 -0
  56. package/dist/components/QuickStartPage/QuickStartPage.d.ts.map +1 -0
  57. package/dist/components/QuickStartPage/index.d.ts +3 -0
  58. package/dist/components/QuickStartPage/index.d.ts.map +1 -0
  59. package/dist/components/ScenarioQueue/ScenarioQueue.figma.d.ts +2 -0
  60. package/dist/components/ScenarioQueue/ScenarioQueue.figma.d.ts.map +1 -0
  61. package/dist/components/ScenarioSettings/ScenarioSettings.d.ts +3 -0
  62. package/dist/components/ScenarioSettings/ScenarioSettings.d.ts.map +1 -0
  63. package/dist/components/ScenarioSettings/ScenarioSettings.figma.d.ts +2 -0
  64. package/dist/components/ScenarioSettings/ScenarioSettings.figma.d.ts.map +1 -0
  65. package/dist/components/ScenarioSettings/index.d.ts +3 -0
  66. package/dist/components/ScenarioSettings/index.d.ts.map +1 -0
  67. package/dist/components/ScenarioSettings/types.d.ts +54 -0
  68. package/dist/components/ScenarioSettings/types.d.ts.map +1 -0
  69. package/dist/components/index.cjs +86 -42
  70. package/dist/components/index.d.ts +14 -3
  71. package/dist/components/index.d.ts.map +1 -1
  72. package/dist/components/index.js +1 -1
  73. package/dist/figma-codex/config.d.ts +8 -0
  74. package/dist/figma-codex/config.d.ts.map +1 -0
  75. package/dist/figma-codex/fixtures/CompoundComponent/CompoundComponent.d.ts +6 -0
  76. package/dist/figma-codex/fixtures/CompoundComponent/CompoundComponent.d.ts.map +1 -0
  77. package/dist/figma-codex/fixtures/CompoundComponent/index.d.ts +2 -0
  78. package/dist/figma-codex/fixtures/CompoundComponent/index.d.ts.map +1 -0
  79. package/dist/figma-codex/fixtures/CompoundComponent.figma.d.ts +2 -0
  80. package/dist/figma-codex/fixtures/CompoundComponent.figma.d.ts.map +1 -0
  81. package/dist/figma-codex/fixtures/SimpleComponent.d.ts +8 -0
  82. package/dist/figma-codex/fixtures/SimpleComponent.d.ts.map +1 -0
  83. package/dist/figma-codex/fixtures/SimpleComponent.figma.d.ts +2 -0
  84. package/dist/figma-codex/fixtures/SimpleComponent.figma.d.ts.map +1 -0
  85. package/dist/figma-codex/generate.d.ts +6 -0
  86. package/dist/figma-codex/generate.d.ts.map +1 -0
  87. package/dist/figma-codex/parser.d.ts +18 -0
  88. package/dist/figma-codex/parser.d.ts.map +1 -0
  89. package/dist/figma-codex/resolver.d.ts +5 -0
  90. package/dist/figma-codex/resolver.d.ts.map +1 -0
  91. package/dist/figma-codex/schema.d.ts +60 -0
  92. package/dist/figma-codex/schema.d.ts.map +1 -0
  93. package/dist/figma-codex/writer.d.ts +8 -0
  94. package/dist/figma-codex/writer.d.ts.map +1 -0
  95. package/dist/figma-codex.json +373 -0
  96. package/dist/index.cjs +90 -46
  97. package/dist/index.js +2 -2
  98. package/dist/preset/index.cjs +2 -2
  99. package/dist/preset/index.d.ts.map +1 -1
  100. package/dist/preset/index.js +1 -1
  101. package/dist/preset/recipes/accordion.d.ts.map +1 -1
  102. package/dist/preset/recipes/breadcrumb.d.ts.map +1 -1
  103. package/dist/preset/recipes/content-card.d.ts +2 -0
  104. package/dist/preset/recipes/content-card.d.ts.map +1 -0
  105. package/dist/preset/recipes/index.d.ts +4 -0
  106. package/dist/preset/recipes/index.d.ts.map +1 -1
  107. package/dist/preset/recipes/navigation-menu.d.ts +2 -0
  108. package/dist/preset/recipes/navigation-menu.d.ts.map +1 -0
  109. package/dist/preset/recipes/scenario-settings.d.ts +2 -0
  110. package/dist/preset/recipes/scenario-settings.d.ts.map +1 -0
  111. package/package.json +26 -2
  112. package/src/components/Accordion.figma.tsx +20 -0
  113. package/src/components/Breadcrumb.figma.tsx +18 -0
  114. package/src/components/Breadcrumb.tsx +33 -15
  115. package/src/components/ContentCard/ContentCard.figma.tsx +21 -0
  116. package/src/components/ContentCard/ContentCard.test.tsx +197 -0
  117. package/src/components/ContentCard/ContentCard.tsx +19 -0
  118. package/src/components/ContentCard/index.ts +13 -0
  119. package/src/components/Header.figma.tsx +25 -0
  120. package/src/components/{Heading.tsx → Header.tsx} +2 -2
  121. package/src/components/Icons/AccountIcon.tsx +26 -0
  122. package/src/components/Icons/ChevronUpIcon.tsx +24 -0
  123. package/src/components/Icons/ClockIcon.tsx +6 -6
  124. package/src/components/Icons/DashboardIcon.tsx +47 -0
  125. package/src/components/Icons/Discourser-Logo.svg +14 -0
  126. package/src/components/Icons/DiscourserLogo.figma.tsx +10 -0
  127. package/src/components/Icons/DiscourserLogo.tsx +72 -0
  128. package/src/components/Icons/GripDotsVerticalIcon.tsx +6 -6
  129. package/src/components/Icons/HelpIcon.tsx +26 -0
  130. package/src/components/Icons/NotebookIcon.tsx +26 -0
  131. package/src/components/Icons/RightArrowIcon.tsx +23 -0
  132. package/src/components/Icons/ScenarioIcon.tsx +26 -0
  133. package/src/components/Icons/index.ts +13 -2
  134. package/src/components/NavigationMenu/NavigationMenu.figma.tsx +26 -0
  135. package/src/components/NavigationMenu/NavigationMenu.test.tsx +524 -0
  136. package/src/components/NavigationMenu/NavigationMenu.tsx +102 -0
  137. package/src/components/NavigationMenu/index.ts +2 -0
  138. package/src/components/NavigationMenu/types.ts +27 -0
  139. package/src/components/QuickStartPage/QuickStartPage.tsx +627 -0
  140. package/src/components/QuickStartPage/index.ts +2 -0
  141. package/src/components/ScenarioQueue/ScenarioQueue.figma.tsx +37 -0
  142. package/src/components/ScenarioSettings/ScenarioSettings.figma.tsx +12 -0
  143. package/src/components/ScenarioSettings/ScenarioSettings.test.tsx +406 -0
  144. package/src/components/ScenarioSettings/ScenarioSettings.tsx +386 -0
  145. package/src/components/ScenarioSettings/index.ts +11 -0
  146. package/src/components/ScenarioSettings/types.ts +70 -0
  147. package/src/components/__tests__/Breadcrumb.test.tsx +94 -0
  148. package/src/components/index.ts +38 -4
  149. package/src/figma-codex/README.md +186 -0
  150. package/src/figma-codex/__tests__/config.test.ts +63 -0
  151. package/src/figma-codex/__tests__/generate.test.ts +78 -0
  152. package/src/figma-codex/__tests__/parser.test.ts +138 -0
  153. package/src/figma-codex/__tests__/resolver.test.ts +196 -0
  154. package/src/figma-codex/__tests__/writer.test.ts +111 -0
  155. package/src/figma-codex/config.ts +42 -0
  156. package/src/figma-codex/fixtures/CompoundComponent/CompoundComponent.tsx +17 -0
  157. package/src/figma-codex/fixtures/CompoundComponent/index.ts +1 -0
  158. package/src/figma-codex/fixtures/CompoundComponent.figma.tsx +14 -0
  159. package/src/figma-codex/fixtures/SimpleComponent.figma.tsx +10 -0
  160. package/src/figma-codex/fixtures/SimpleComponent.tsx +10 -0
  161. package/src/figma-codex/fixtures/expected-output.json +78 -0
  162. package/src/figma-codex/generate.ts +106 -0
  163. package/src/figma-codex/parser.ts +138 -0
  164. package/src/figma-codex/resolver.ts +280 -0
  165. package/src/figma-codex/schema.ts +79 -0
  166. package/src/figma-codex/writer.ts +54 -0
  167. package/src/preset/index.ts +6 -0
  168. package/src/preset/recipes/accordion.ts +8 -5
  169. package/src/preset/recipes/breadcrumb.ts +34 -2
  170. package/src/preset/recipes/content-card.ts +124 -0
  171. package/src/preset/recipes/index.ts +4 -0
  172. package/src/preset/recipes/navigation-menu.ts +97 -0
  173. package/src/preset/recipes/scenario-settings.ts +182 -0
  174. package/src/test/setup.ts +12 -9
  175. package/dist/chunk-ABC7N32K.cjs.map +0 -1
  176. package/dist/chunk-GD6Q2FUE.js.map +0 -1
  177. package/dist/chunk-SBKRSXSZ.js.map +0 -1
  178. package/dist/chunk-UNWXE6UB.cjs.map +0 -1
  179. package/dist/components/Heading.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preset/index.ts"],"names":[],"mappings":"AA2DA,eAAO,MAAM,qBAAqB,gCA+IhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preset/index.ts"],"names":[],"mappings":"AA8DA,eAAO,MAAM,qBAAqB,gCAkJhC,CAAC"}
@@ -1,4 +1,4 @@
1
- export { discourserPandaPreset } from '../chunk-SBKRSXSZ.js';
1
+ export { discourserPandaPreset } from '../chunk-SNUJBT5R.js';
2
2
  import '../chunk-WR5Z5QMQ.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/accordion.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,0CAwFpB,CAAA"}
1
+ {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/accordion.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,0CA2FpB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/breadcrumb.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,0CA0ErB,CAAA"}
1
+ {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/breadcrumb.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,0CA0GrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const contentCard: import("@pandacss/dev").SlotRecipeConfig;
2
+ //# sourceMappingURL=content-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-card.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/content-card.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,0CAyHtB,CAAC"}
@@ -8,6 +8,7 @@ export * from './accordion';
8
8
  export * from './drawer';
9
9
  export * from './tabs';
10
10
  export * from './breadcrumb';
11
+ export * from './navigation-menu';
11
12
  export * from './switch';
12
13
  export * from './checkbox';
13
14
  export * from './radio-group';
@@ -26,6 +27,9 @@ export * from './tooltip';
26
27
  export * from './heading';
27
28
  export * from './absolute-center';
28
29
  export * from './group';
30
+ export * from './stepper';
31
+ export * from './content-card';
29
32
  export * from './scenario-card';
30
33
  export * from './scenario-queue';
34
+ export * from './scenario-settings';
31
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AAGxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const navigationMenu: import("@pandacss/dev").SlotRecipeConfig;
2
+ //# sourceMappingURL=navigation-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/navigation-menu.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,0CA8FzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const scenarioSettings: import("@pandacss/dev").SlotRecipeConfig;
2
+ //# sourceMappingURL=scenario-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scenario-settings.d.ts","sourceRoot":"","sources":["../../../src/preset/recipes/scenario-settings.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,0CAmL3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discourser/design-system",
3
- "version": "0.15.1",
3
+ "version": "0.17.0",
4
4
  "description": "Aesthetic-agnostic design system with Panda CSS and Ark UI",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -150,13 +150,29 @@
150
150
  "types": "./src/components/Stepper/index.ts",
151
151
  "import": "./src/components/Stepper/index.ts"
152
152
  },
153
+ "./NavigationMenu": {
154
+ "types": "./src/components/NavigationMenu/index.ts",
155
+ "import": "./src/components/NavigationMenu/index.ts"
156
+ },
153
157
  "./ScenarioQueue": {
154
158
  "types": "./src/components/ScenarioQueue/index.ts",
155
159
  "import": "./src/components/ScenarioQueue/index.ts"
156
160
  },
161
+ "./ScenarioSettings": {
162
+ "types": "./src/components/ScenarioSettings/index.ts",
163
+ "import": "./src/components/ScenarioSettings/index.ts"
164
+ },
157
165
  "./Breadcrumb": {
158
166
  "types": "./src/components/Breadcrumb.tsx",
159
167
  "import": "./src/components/Breadcrumb.tsx"
168
+ },
169
+ "./ContentCard": {
170
+ "types": "./src/components/ContentCard/index.ts",
171
+ "import": "./src/components/ContentCard/index.ts"
172
+ },
173
+ "./figma-codex": {
174
+ "import": "./dist/figma-codex.json",
175
+ "require": "./dist/figma-codex.json"
160
176
  }
161
177
  },
162
178
  "files": [
@@ -165,7 +181,7 @@
165
181
  ],
166
182
  "scripts": {
167
183
  "dev": "pnpm docs:generate && storybook dev -p 6006",
168
- "build": "pnpm build:panda && pnpm typecheck && pnpm build:lib && pnpm build:types",
184
+ "build": "pnpm build:panda && pnpm typecheck && pnpm build:lib && pnpm build:types && pnpm codex:generate",
169
185
  "build:panda": "panda codegen",
170
186
  "build:css": "panda cssgen --outfile dist/styles.css",
171
187
  "build:lib": "tsup",
@@ -190,6 +206,10 @@
190
206
  "verify:lint": "pnpm lint",
191
207
  "verify:test": "pnpm test run",
192
208
  "verify:build": "pnpm build",
209
+ "codex:generate": "tsx src/figma-codex/generate.ts",
210
+ "codex:watch": "tsx --watch src/figma-codex/generate.ts",
211
+ "figma:connect": "figma connect publish",
212
+ "figma:connect:dry": "figma connect publish --dry-run",
193
213
  "changeset": "changeset",
194
214
  "version": "changeset version",
195
215
  "ci:version": "pnpm exec changeset version",
@@ -209,6 +229,7 @@
209
229
  "@changesets/changelog-github": "^0.5.2",
210
230
  "@changesets/cli": "^2.29.8",
211
231
  "@eslint/js": "^9.39.2",
232
+ "@figma/code-connect": "^1.4.1",
212
233
  "@material/material-color-utilities": "^0.3.0",
213
234
  "@pandacss/dev": "^1.8.1",
214
235
  "@storybook/addon-a11y": "^10.2.8",
@@ -267,6 +288,9 @@
267
288
  ],
268
289
  "*.{json,md}": [
269
290
  "prettier --write"
291
+ ],
292
+ "*.figma.tsx": [
293
+ "tsx src/figma-codex/generate.ts"
270
294
  ]
271
295
  }
272
296
  }
@@ -0,0 +1,20 @@
1
+ import figma from '@figma/code-connect';
2
+ import * as Accordion from './Accordion';
3
+
4
+ figma.connect(
5
+ Accordion.Root,
6
+ 'https://www.figma.com/design/GaHmFfmvO4loUzuZS4TgEz/Discourser.AI--V1?node-id=38-8232',
7
+ {
8
+ example: () => (
9
+ <Accordion.Root collapsible>
10
+ <Accordion.Item value="item-1">
11
+ <Accordion.ItemTrigger>
12
+ <span>Trigger</span>
13
+ <Accordion.ItemIndicator />
14
+ </Accordion.ItemTrigger>
15
+ <Accordion.ItemContent>Content</Accordion.ItemContent>
16
+ </Accordion.Item>
17
+ </Accordion.Root>
18
+ ),
19
+ },
20
+ );
@@ -0,0 +1,18 @@
1
+ import figma from '@figma/code-connect'
2
+ import * as Breadcrumb from './Breadcrumb'
3
+
4
+ figma.connect(Breadcrumb.Root, 'https://www.figma.com/design/GaHmFfmvO4loUzuZS4TgEz/Discourser.AI--V1?node-id=38-7978', {
5
+ example: () => (
6
+ <Breadcrumb.Root>
7
+ <Breadcrumb.List>
8
+ <Breadcrumb.Item>
9
+ <Breadcrumb.Link href="#">Home</Breadcrumb.Link>
10
+ </Breadcrumb.Item>
11
+ <Breadcrumb.Separator />
12
+ <Breadcrumb.Item>
13
+ <Breadcrumb.CurrentLink>Current</Breadcrumb.CurrentLink>
14
+ </Breadcrumb.Item>
15
+ </Breadcrumb.List>
16
+ </Breadcrumb.Root>
17
+ ),
18
+ })
@@ -1,34 +1,52 @@
1
- 'use client'
2
- import { ark } from '@ark-ui/react/factory'
3
- import type { ComponentProps } from 'react'
4
- import { createStyleContext } from 'styled-system/jsx'
5
- import { breadcrumb } from 'styled-system/recipes'
1
+ 'use client';
2
+ import { ark } from '@ark-ui/react/factory';
3
+ import type { ComponentProps } from 'react';
4
+ import { createStyleContext } from 'styled-system/jsx';
5
+ import { breadcrumb } from 'styled-system/recipes';
6
6
 
7
7
  const ChevronRightIcon = () => (
8
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
8
+ <svg
9
+ width="16"
10
+ height="16"
11
+ viewBox="0 0 24 24"
12
+ fill="none"
13
+ stroke="currentColor"
14
+ strokeWidth="2"
15
+ strokeLinecap="round"
16
+ strokeLinejoin="round"
17
+ >
9
18
  <path d="m9 18 6-6-6-6"></path>
10
19
  </svg>
11
- )
20
+ );
12
21
 
13
- const { withProvider, withContext } = createStyleContext(breadcrumb)
22
+ const { withProvider, withContext } = createStyleContext(breadcrumb);
14
23
 
15
- export type RootProps = ComponentProps<typeof Root>
24
+ export type RootProps = ComponentProps<typeof Root>;
16
25
 
17
- export const Root = withProvider(ark.nav, 'root', { defaultProps: { 'aria-label': 'breadcrumb' } })
18
- export const List = withContext(ark.ol, 'list')
19
- export const Item = withContext(ark.li, 'item')
20
- export const Link = withContext(ark.a, 'link')
26
+ export const Root = withProvider(ark.nav, 'root', {
27
+ defaultProps: { 'aria-label': 'breadcrumb' },
28
+ });
29
+ export const List = withContext(ark.ol, 'list');
30
+ export const Item = withContext(ark.li, 'item');
31
+ export const Link = withContext(ark.a, 'link');
21
32
  export const Ellipsis = withContext(ark.li, 'ellipsis', {
22
33
  defaultProps: {
23
34
  role: 'presentation',
24
35
  'aria-hidden': true,
25
36
  children: '...',
26
37
  },
27
- })
38
+ });
28
39
 
29
40
  export const Separator = withContext(ark.li, 'separator', {
30
41
  defaultProps: {
31
42
  'aria-hidden': true,
32
43
  children: <ChevronRightIcon />,
33
44
  },
34
- })
45
+ });
46
+
47
+ /** The current/active page crumb — renders as a span (not a link) with aria-current="page" */
48
+ export const CurrentLink = withContext(ark.span, 'link', {
49
+ defaultProps: {
50
+ 'aria-current': 'page',
51
+ },
52
+ });
@@ -0,0 +1,21 @@
1
+ import figma from '@figma/code-connect'
2
+ import * as ContentCard from './index'
3
+
4
+ figma.connect(ContentCard.Root, 'https://www.figma.com/design/GaHmFfmvO4loUzuZS4TgEz/Discourser.AI--V1?node-id=478-5957', {
5
+ example: () => (
6
+ <ContentCard.Root>
7
+ <ContentCard.Header>
8
+ <ContentCard.Title>Title</ContentCard.Title>
9
+ <ContentCard.BadgeBar>badges</ContentCard.BadgeBar>
10
+ </ContentCard.Header>
11
+ <ContentCard.Body>Content</ContentCard.Body>
12
+ <ContentCard.Separator />
13
+ <ContentCard.Section>
14
+ <ContentCard.SectionTitle>Section</ContentCard.SectionTitle>
15
+ <ContentCard.List>
16
+ <ContentCard.ListItem>Item</ContentCard.ListItem>
17
+ </ContentCard.List>
18
+ </ContentCard.Section>
19
+ </ContentCard.Root>
20
+ ),
21
+ })
@@ -0,0 +1,197 @@
1
+ /* global describe, it, expect */
2
+ import React from 'react'
3
+ import { render, screen } from '@testing-library/react'
4
+ import * as ContentCard from './ContentCard'
5
+ import { Badge } from '../Badge'
6
+
7
+ function renderDefault() {
8
+ return render(
9
+ <ContentCard.Root>
10
+ <ContentCard.Header>
11
+ <ContentCard.Title>UX Research &amp; Design Interview</ContentCard.Title>
12
+ <ContentCard.BadgeBar>
13
+ <Badge colorPalette="primary" variant="subtle">Beginner</Badge>
14
+ <Badge colorPalette="neutral" variant="subtle">Professional</Badge>
15
+ </ContentCard.BadgeBar>
16
+ </ContentCard.Header>
17
+ <ContentCard.Body>
18
+ <p>Practice explaining your UX research process.</p>
19
+ </ContentCard.Body>
20
+ <ContentCard.Separator />
21
+ <ContentCard.Section>
22
+ <ContentCard.SectionTitle>Sample Questions:</ContentCard.SectionTitle>
23
+ <ContentCard.List>
24
+ <ContentCard.ListItem>Walk me through your research methodology.</ContentCard.ListItem>
25
+ <ContentCard.ListItem>Describe a challenging project you worked on.</ContentCard.ListItem>
26
+ </ContentCard.List>
27
+ </ContentCard.Section>
28
+ <ContentCard.Section>
29
+ <ContentCard.SectionTitle>Topics Covered:</ContentCard.SectionTitle>
30
+ </ContentCard.Section>
31
+ </ContentCard.Root>,
32
+ )
33
+ }
34
+
35
+ describe('ContentCard', () => {
36
+ describe('Rendering', () => {
37
+ it('renders root container', () => {
38
+ const { container } = renderDefault()
39
+ expect(container.firstChild).toBeDefined()
40
+ })
41
+
42
+ it('renders title as h2 element', () => {
43
+ renderDefault()
44
+ const title = screen.getByRole('heading', { level: 2 })
45
+ expect(title.textContent).toBe('UX Research & Design Interview')
46
+ })
47
+
48
+ it('renders badge bar with children', () => {
49
+ renderDefault()
50
+ expect(screen.getByText('Beginner')).toBeDefined()
51
+ expect(screen.getByText('Professional')).toBeDefined()
52
+ })
53
+
54
+ it('renders body content', () => {
55
+ renderDefault()
56
+ expect(screen.getByText('Practice explaining your UX research process.')).toBeDefined()
57
+ })
58
+
59
+ it('renders sections with section titles as h3', () => {
60
+ renderDefault()
61
+ const sectionTitles = screen.getAllByRole('heading', { level: 3 })
62
+ expect(sectionTitles.length).toBe(2)
63
+ expect(sectionTitles[0].textContent).toBe('Sample Questions:')
64
+ expect(sectionTitles[1].textContent).toBe('Topics Covered:')
65
+ })
66
+
67
+ it('renders separator as hr element', () => {
68
+ const { container } = renderDefault()
69
+ expect(container.querySelector('hr')).toBeDefined()
70
+ })
71
+
72
+ it('renders list with list items', () => {
73
+ renderDefault()
74
+ const items = screen.getAllByRole('listitem')
75
+ expect(items.length).toBeGreaterThanOrEqual(2)
76
+ expect(screen.getByText('Walk me through your research methodology.')).toBeDefined()
77
+ })
78
+ })
79
+
80
+ describe('Variants', () => {
81
+ it('applies outline variant by default', () => {
82
+ const { container } = renderDefault()
83
+ const root = container.firstChild as HTMLElement
84
+ expect(root.className).toContain('content-card')
85
+ })
86
+
87
+ it('applies elevated variant when specified', () => {
88
+ const { container } = render(
89
+ <ContentCard.Root variant="elevated">
90
+ <ContentCard.Title>Elevated</ContentCard.Title>
91
+ </ContentCard.Root>,
92
+ )
93
+ expect(container.firstChild).toBeDefined()
94
+ })
95
+
96
+ it('applies flat variant when specified', () => {
97
+ const { container } = render(
98
+ <ContentCard.Root variant="flat">
99
+ <ContentCard.Title>Flat</ContentCard.Title>
100
+ </ContentCard.Root>,
101
+ )
102
+ expect(container.firstChild).toBeDefined()
103
+ })
104
+
105
+ it('applies size md by default', () => {
106
+ const { container } = renderDefault()
107
+ expect(container.firstChild).toBeDefined()
108
+ })
109
+
110
+ it('applies size sm when specified', () => {
111
+ const { container } = render(
112
+ <ContentCard.Root size="sm">
113
+ <ContentCard.Title>Small</ContentCard.Title>
114
+ </ContentCard.Root>,
115
+ )
116
+ expect(container.firstChild).toBeDefined()
117
+ })
118
+ })
119
+
120
+ describe('Composition', () => {
121
+ it('renders Badge components inside BadgeBar', () => {
122
+ render(
123
+ <ContentCard.Root>
124
+ <ContentCard.BadgeBar>
125
+ <Badge colorPalette="primary" variant="subtle">Tag 1</Badge>
126
+ <Badge colorPalette="neutral" variant="subtle">Tag 2</Badge>
127
+ </ContentCard.BadgeBar>
128
+ </ContentCard.Root>,
129
+ )
130
+ expect(screen.getByText('Tag 1')).toBeDefined()
131
+ expect(screen.getByText('Tag 2')).toBeDefined()
132
+ })
133
+
134
+ it('renders arbitrary content in Body slot', () => {
135
+ render(
136
+ <ContentCard.Root>
137
+ <ContentCard.Body>
138
+ <p data-testid="custom-content">Custom paragraph</p>
139
+ </ContentCard.Body>
140
+ </ContentCard.Root>,
141
+ )
142
+ expect(screen.getByTestId('custom-content')).toBeDefined()
143
+ })
144
+
145
+ it('renders multiple Sections', () => {
146
+ render(
147
+ <ContentCard.Root>
148
+ <ContentCard.Section>
149
+ <ContentCard.SectionTitle>Section 1</ContentCard.SectionTitle>
150
+ </ContentCard.Section>
151
+ <ContentCard.Section>
152
+ <ContentCard.SectionTitle>Section 2</ContentCard.SectionTitle>
153
+ </ContentCard.Section>
154
+ </ContentCard.Root>,
155
+ )
156
+ const headings = screen.getAllByRole('heading', { level: 3 })
157
+ expect(headings.length).toBe(2)
158
+ })
159
+
160
+ it('renders Separator between sections', () => {
161
+ const { container } = render(
162
+ <ContentCard.Root>
163
+ <ContentCard.Body><p>Body</p></ContentCard.Body>
164
+ <ContentCard.Separator />
165
+ <ContentCard.Section>
166
+ <ContentCard.SectionTitle>Section</ContentCard.SectionTitle>
167
+ </ContentCard.Section>
168
+ </ContentCard.Root>,
169
+ )
170
+ expect(container.querySelector('hr')).toBeDefined()
171
+ })
172
+ })
173
+
174
+ describe('Accessibility', () => {
175
+ it('Title renders as h2 for proper heading hierarchy', () => {
176
+ renderDefault()
177
+ expect(screen.getByRole('heading', { level: 2 })).toBeDefined()
178
+ })
179
+
180
+ it('SectionTitle renders as h3 for proper heading hierarchy', () => {
181
+ renderDefault()
182
+ const h3s = screen.getAllByRole('heading', { level: 3 })
183
+ expect(h3s.length).toBeGreaterThan(0)
184
+ })
185
+
186
+ it('List renders as ul with li children', () => {
187
+ const { container } = renderDefault()
188
+ expect(container.querySelector('ul')).toBeDefined()
189
+ expect(container.querySelector('li')).toBeDefined()
190
+ })
191
+
192
+ it('Separator renders as hr', () => {
193
+ const { container } = renderDefault()
194
+ expect(container.querySelector('hr')).toBeDefined()
195
+ })
196
+ })
197
+ })
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { ark } from '@ark-ui/react/factory';
3
+ import type { ComponentProps } from 'react';
4
+ import { createStyleContext } from 'styled-system/jsx';
5
+ import { contentCard } from 'styled-system/recipes';
6
+
7
+ const { withProvider, withContext } = createStyleContext(contentCard);
8
+
9
+ export type RootProps = ComponentProps<typeof Root>;
10
+ export const Root = withProvider(ark.div, 'root');
11
+ export const Header = withContext(ark.div, 'header');
12
+ export const Title = withContext(ark.h2, 'title');
13
+ export const BadgeBar = withContext(ark.div, 'badgeBar');
14
+ export const Body = withContext(ark.div, 'body');
15
+ export const Section = withContext(ark.section, 'section');
16
+ export const SectionTitle = withContext(ark.h3, 'sectionTitle');
17
+ export const Separator = withContext(ark.hr, 'separator');
18
+ export const List = withContext(ark.ul, 'list');
19
+ export const ListItem = withContext(ark.li, 'listItem');
@@ -0,0 +1,13 @@
1
+ export {
2
+ Root,
3
+ Header,
4
+ Title,
5
+ BadgeBar,
6
+ Body,
7
+ Section,
8
+ SectionTitle,
9
+ Separator,
10
+ List,
11
+ ListItem,
12
+ type RootProps,
13
+ } from './ContentCard';
@@ -0,0 +1,25 @@
1
+ import figma from '@figma/code-connect';
2
+ import { Header } from './Header';
3
+
4
+ // Figma size values → DDS heading recipe sizes
5
+ figma.connect(
6
+ Header,
7
+ 'https://www.figma.com/design/GaHmFfmvO4loUzuZS4TgEz/Discourser.AI--V1?node-id=485-4697',
8
+ {
9
+ props: {
10
+ size: figma.enum('size', {
11
+ xSm: 'xs',
12
+ Mdm: 'md',
13
+ Lg: 'lg',
14
+ xLg: 'xl',
15
+ '2xLg': '2xl',
16
+ '3xLg': '3xl',
17
+ '4xLg': '4xl',
18
+ '5xLg': '5xl',
19
+ '6xLg': '6xl',
20
+ '7xlg': '7xl',
21
+ }),
22
+ },
23
+ example: ({ size }) => <Header size={size}>Heading Text</Header>,
24
+ },
25
+ );
@@ -5,5 +5,5 @@ import type { StyledComponent } from 'styled-system/types'
5
5
 
6
6
  type Props = HeadingVariantProps & { as?: ElementType };
7
7
 
8
- export type HeadingProps = ComponentProps<typeof Heading>;
9
- export const Heading = styled('h2', heading) as StyledComponent<'h2', Props>;
8
+ export type HeadingProps = ComponentProps<typeof Header>;
9
+ export const Header = styled('h2', heading) as StyledComponent<'h2', Props>;
@@ -0,0 +1,26 @@
1
+ import { ark } from '@ark-ui/react/factory';
2
+ import type { ComponentProps } from 'react';
3
+ import { styled } from 'styled-system/jsx';
4
+
5
+ const StyledSvg = styled(ark.svg);
6
+
7
+ export type AccountIconProps = ComponentProps<typeof StyledSvg>;
8
+
9
+ export const AccountIcon = (props: AccountIconProps) => (
10
+ <StyledSvg
11
+ viewBox="0 0 20 20"
12
+ fill="none"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ width="1em"
15
+ height="1em"
16
+ {...props}
17
+ >
18
+ <path
19
+ d="M10 10.8333C12.3012 10.8333 14.1667 8.96785 14.1667 6.66667C14.1667 4.36548 12.3012 2.5 10 2.5C7.69885 2.5 5.83337 4.36548 5.83337 6.66667C5.83337 8.96785 7.69885 10.8333 10 10.8333ZM10 10.8333C11.7682 10.8333 13.4638 11.5357 14.7141 12.786C15.9643 14.0362 16.6667 15.7319 16.6667 17.5M10 10.8333C8.23193 10.8333 6.53624 11.5357 5.286 12.786C4.03575 14.0362 3.33337 15.7319 3.33337 17.5"
20
+ stroke="currentColor"
21
+ strokeWidth="2"
22
+ strokeLinecap="round"
23
+ strokeLinejoin="round"
24
+ />
25
+ </StyledSvg>
26
+ );
@@ -0,0 +1,24 @@
1
+ import { ark } from '@ark-ui/react/factory';
2
+ import type { ComponentProps } from 'react';
3
+ import { styled } from 'styled-system/jsx';
4
+
5
+ const StyledSvg = styled(ark.svg);
6
+
7
+ export type ChevronUpIconProps = ComponentProps<typeof StyledSvg>;
8
+
9
+ export const ChevronUpIcon = (props: ChevronUpIconProps) => (
10
+ <StyledSvg
11
+ viewBox="0 0 24 15"
12
+ fill="none"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ width="1em"
15
+ height="1em"
16
+ {...props}
17
+ >
18
+ <path
19
+ transform="translate(-521, -1202)"
20
+ d="M544.345,1213.39 L534.615,1202.6 C534.167,1202.15 533.57,1201.95 532.984,1201.99 C532.398,1201.95 531.802,1202.15 531.354,1202.6 L521.624,1213.39 C520.797,1214.22 520.797,1215.57 521.624,1216.4 C522.452,1217.23 523.793,1217.23 524.621,1216.4 L532.984,1207.13 L541.349,1216.4 C542.176,1217.23 543.518,1217.23 544.345,1216.4 C545.172,1215.57 545.172,1214.22 544.345,1213.39"
21
+ fill="currentColor"
22
+ />
23
+ </StyledSvg>
24
+ );
@@ -1,10 +1,10 @@
1
- import { ark } from '@ark-ui/react/factory'
2
- import type { ComponentProps } from 'react'
3
- import { styled } from 'styled-system/jsx'
1
+ import { ark } from '@ark-ui/react/factory';
2
+ import type { ComponentProps } from 'react';
3
+ import { styled } from 'styled-system/jsx';
4
4
 
5
- const StyledSvg = styled(ark.svg)
5
+ const StyledSvg = styled(ark.svg);
6
6
 
7
- export type ClockIconProps = ComponentProps<typeof StyledSvg>
7
+ export type ClockIconProps = ComponentProps<typeof StyledSvg>;
8
8
 
9
9
  export const ClockIcon = (props: ClockIconProps) => (
10
10
  <StyledSvg
@@ -37,4 +37,4 @@ export const ClockIcon = (props: ClockIconProps) => (
37
37
  strokeLinejoin="round"
38
38
  />
39
39
  </StyledSvg>
40
- )
40
+ );