@fortanix/baklava 1.0.0-beta-20241114

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 (454) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +373 -0
  3. package/README.md +43 -0
  4. package/app/Demo.tsx +33 -0
  5. package/app/index.html +12 -0
  6. package/app/lib.ts +54 -0
  7. package/app/main.tsx +32 -0
  8. package/dist/baklava.d.ts +752 -0
  9. package/dist/baklava.js +4962 -0
  10. package/dist/lib.css +1 -0
  11. package/package.json +102 -0
  12. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-100.woff2 +0 -0
  13. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-200.woff2 +0 -0
  14. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-300.woff2 +0 -0
  15. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-500.woff2 +0 -0
  16. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-600.woff2 +0 -0
  17. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-700.woff2 +0 -0
  18. package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-regular.woff2 +0 -0
  19. package/src/assets/fonts/open-sans/open-sans-v23-latin-600.woff2 +0 -0
  20. package/src/assets/fonts/open-sans/open-sans-v23-latin-700.woff2 +0 -0
  21. package/src/assets/fonts/open-sans/open-sans-v23-latin-regular.woff2 +0 -0
  22. package/src/assets/fonts/source-code-pro/source-code-pro-v14-latin-regular.woff2 +0 -0
  23. package/src/assets/icons/_icons.ts +58 -0
  24. package/src/assets/icons/accounts.svg +11 -0
  25. package/src/assets/icons/alert.svg +3 -0
  26. package/src/assets/icons/apache.svg +3 -0
  27. package/src/assets/icons/apps.svg +5 -0
  28. package/src/assets/icons/assessment.svg +11 -0
  29. package/src/assets/icons/audit-log.svg +12 -0
  30. package/src/assets/icons/authentication.svg +12 -0
  31. package/src/assets/icons/calendar.svg +10 -0
  32. package/src/assets/icons/caret-down.svg +3 -0
  33. package/src/assets/icons/check.svg +3 -0
  34. package/src/assets/icons/cloud-accounts.svg +15 -0
  35. package/src/assets/icons/copy.svg +4 -0
  36. package/src/assets/icons/cross.svg +4 -0
  37. package/src/assets/icons/dashboard.svg +12 -0
  38. package/src/assets/icons/dataverse.svg +12 -0
  39. package/src/assets/icons/delete.svg +5 -0
  40. package/src/assets/icons/docs.svg +10 -0
  41. package/src/assets/icons/download.svg +11 -0
  42. package/src/assets/icons/edit-params.svg +3 -0
  43. package/src/assets/icons/edit.svg +10 -0
  44. package/src/assets/icons/email.svg +3 -0
  45. package/src/assets/icons/eye.svg +11 -0
  46. package/src/assets/icons/file-error.svg +17 -0
  47. package/src/assets/icons/file.svg +15 -0
  48. package/src/assets/icons/folder.svg +14 -0
  49. package/src/assets/icons/fortanix-ki.svg +13 -0
  50. package/src/assets/icons/graph.svg +9 -0
  51. package/src/assets/icons/groups.svg +10 -0
  52. package/src/assets/icons/hide.svg +3 -0
  53. package/src/assets/icons/home.svg +11 -0
  54. package/src/assets/icons/iam.svg +11 -0
  55. package/src/assets/icons/info.svg +4 -0
  56. package/src/assets/icons/infrastructure.svg +5 -0
  57. package/src/assets/icons/integrations.svg +3 -0
  58. package/src/assets/icons/key-link.svg +12 -0
  59. package/src/assets/icons/key.svg +4 -0
  60. package/src/assets/icons/no-login.svg +10 -0
  61. package/src/assets/icons/page-forward.svg +4 -0
  62. package/src/assets/icons/plugins.svg +4 -0
  63. package/src/assets/icons/policy.svg +13 -0
  64. package/src/assets/icons/print.svg +11 -0
  65. package/src/assets/icons/scripts.svg +4 -0
  66. package/src/assets/icons/search.svg +3 -0
  67. package/src/assets/icons/security-object.svg +5 -0
  68. package/src/assets/icons/services.svg +10 -0
  69. package/src/assets/icons/settings.svg +12 -0
  70. package/src/assets/icons/solutions.svg +3 -0
  71. package/src/assets/icons/success.svg +3 -0
  72. package/src/assets/icons/tasks.svg +10 -0
  73. package/src/assets/icons/user-profile.svg +3 -0
  74. package/src/assets/icons/user.svg +10 -0
  75. package/src/assets/icons/warning.svg +3 -0
  76. package/src/assets/icons/workflows.svg +11 -0
  77. package/src/assets/icons_new/Accounts.svg +11 -0
  78. package/src/assets/icons_new/Alert.svg +3 -0
  79. package/src/assets/icons_new/Apache.svg +3 -0
  80. package/src/assets/icons_new/Apps.svg +5 -0
  81. package/src/assets/icons_new/Assessment.svg +11 -0
  82. package/src/assets/icons_new/Audit Log.svg +12 -0
  83. package/src/assets/icons_new/Authentication.svg +12 -0
  84. package/src/assets/icons_new/Calendar.svg +10 -0
  85. package/src/assets/icons_new/Carrot Down.svg +3 -0
  86. package/src/assets/icons_new/Cloud Accounts.svg +15 -0
  87. package/src/assets/icons_new/Copy.svg +4 -0
  88. package/src/assets/icons_new/Dashboard.svg +12 -0
  89. package/src/assets/icons_new/Dataverse.svg +12 -0
  90. package/src/assets/icons_new/Delete.svg +5 -0
  91. package/src/assets/icons_new/Docs.svg +10 -0
  92. package/src/assets/icons_new/Download.svg +11 -0
  93. package/src/assets/icons_new/Edit Params.svg +3 -0
  94. package/src/assets/icons_new/Edit.svg +10 -0
  95. package/src/assets/icons_new/Email.svg +3 -0
  96. package/src/assets/icons_new/Eye.svg +11 -0
  97. package/src/assets/icons_new/Groups.svg +10 -0
  98. package/src/assets/icons_new/Hide.svg +3 -0
  99. package/src/assets/icons_new/Home.svg +11 -0
  100. package/src/assets/icons_new/IAM.svg +11 -0
  101. package/src/assets/icons_new/Info.svg +4 -0
  102. package/src/assets/icons_new/Infrastructure.svg +5 -0
  103. package/src/assets/icons_new/Integrations.svg +3 -0
  104. package/src/assets/icons_new/KI.svg +13 -0
  105. package/src/assets/icons_new/Key Link.svg +12 -0
  106. package/src/assets/icons_new/Key.svg +4 -0
  107. package/src/assets/icons_new/No Login.svg +10 -0
  108. package/src/assets/icons_new/Page FWD.svg +4 -0
  109. package/src/assets/icons_new/Plugins.svg +4 -0
  110. package/src/assets/icons_new/Policy.svg +13 -0
  111. package/src/assets/icons_new/Print.svg +11 -0
  112. package/src/assets/icons_new/Scripts.svg +4 -0
  113. package/src/assets/icons_new/Search.svg +3 -0
  114. package/src/assets/icons_new/Security Objects.svg +5 -0
  115. package/src/assets/icons_new/Services.svg +10 -0
  116. package/src/assets/icons_new/Settings.svg +12 -0
  117. package/src/assets/icons_new/Solutions.svg +3 -0
  118. package/src/assets/icons_new/Tasks.svg +10 -0
  119. package/src/assets/icons_new/User Account.svg +3 -0
  120. package/src/assets/icons_new/Users.svg +10 -0
  121. package/src/assets/icons_new/Workflows.svg +11 -0
  122. package/src/assets/icons_old/_icons.ts +172 -0
  123. package/src/assets/icons_old/account.svg +4 -0
  124. package/src/assets/icons_old/accounts.svg +4 -0
  125. package/src/assets/icons_old/add.svg +4 -0
  126. package/src/assets/icons_old/alert.svg +4 -0
  127. package/src/assets/icons_old/app.svg +4 -0
  128. package/src/assets/icons_old/arrow-drop-down.svg +4 -0
  129. package/src/assets/icons_old/arrow-drop-up.svg +4 -0
  130. package/src/assets/icons_old/arrow-expand.svg +4 -0
  131. package/src/assets/icons_old/arrow-left.svg +5 -0
  132. package/src/assets/icons_old/arrow-right.svg +4 -0
  133. package/src/assets/icons_old/audit-log.svg +4 -0
  134. package/src/assets/icons_old/bell.svg +4 -0
  135. package/src/assets/icons_old/billing.svg +4 -0
  136. package/src/assets/icons_old/bug.svg +4 -0
  137. package/src/assets/icons_old/builds.svg +4 -0
  138. package/src/assets/icons_old/calendar.svg +4 -0
  139. package/src/assets/icons_old/certificate.svg +4 -0
  140. package/src/assets/icons_old/check.svg +4 -0
  141. package/src/assets/icons_old/checkbox-checked.svg +4 -0
  142. package/src/assets/icons_old/checkbox-disabled.svg +4 -0
  143. package/src/assets/icons_old/checkbox-unchecked.svg +4 -0
  144. package/src/assets/icons_old/chevron-left.svg +4 -0
  145. package/src/assets/icons_old/chevron-right.svg +4 -0
  146. package/src/assets/icons_old/clear-all.svg +4 -0
  147. package/src/assets/icons_old/color-picker.svg +10 -0
  148. package/src/assets/icons_old/connection.svg +4 -0
  149. package/src/assets/icons_old/copy.svg +4 -0
  150. package/src/assets/icons_old/cross-thin.svg +4 -0
  151. package/src/assets/icons_old/cross.svg +4 -0
  152. package/src/assets/icons_old/crypto-policy.svg +4 -0
  153. package/src/assets/icons_old/customers.svg +4 -0
  154. package/src/assets/icons_old/dashboard.svg +4 -0
  155. package/src/assets/icons_old/data-center.svg +4 -0
  156. package/src/assets/icons_old/data-connector-read.svg +6 -0
  157. package/src/assets/icons_old/data-connector-write.svg +6 -0
  158. package/src/assets/icons_old/dataset.svg +3 -0
  159. package/src/assets/icons_old/dataverse.svg +6 -0
  160. package/src/assets/icons_old/delete.svg +4 -0
  161. package/src/assets/icons_old/deployment-deployed.svg +4 -0
  162. package/src/assets/icons_old/deployment-none.svg +4 -0
  163. package/src/assets/icons_old/derive.svg +4 -0
  164. package/src/assets/icons_old/docs.svg +4 -0
  165. package/src/assets/icons_old/document-blank.svg +4 -0
  166. package/src/assets/icons_old/domain.svg +4 -0
  167. package/src/assets/icons_old/download-cloud.svg +4 -0
  168. package/src/assets/icons_old/download.svg +4 -0
  169. package/src/assets/icons_old/edit-params.svg +4 -0
  170. package/src/assets/icons_old/edit.svg +4 -0
  171. package/src/assets/icons_old/em-app.svg +4 -0
  172. package/src/assets/icons_old/em-dashboard.svg +4 -0
  173. package/src/assets/icons_old/email.svg +4 -0
  174. package/src/assets/icons_old/empty-credential.svg +4 -0
  175. package/src/assets/icons_old/enterprise-badge.svg +6 -0
  176. package/src/assets/icons_old/environment-production.svg +4 -0
  177. package/src/assets/icons_old/environment-test.svg +4 -0
  178. package/src/assets/icons_old/event-critical.svg +4 -0
  179. package/src/assets/icons_old/event-error.svg +4 -0
  180. package/src/assets/icons_old/event-success.svg +4 -0
  181. package/src/assets/icons_old/event-warning.svg +4 -0
  182. package/src/assets/icons_old/expiration.svg +4 -0
  183. package/src/assets/icons_old/export.svg +4 -0
  184. package/src/assets/icons_old/external.svg +4 -0
  185. package/src/assets/icons_old/eye-closed.svg +4 -0
  186. package/src/assets/icons_old/eye.svg +4 -0
  187. package/src/assets/icons_old/file.svg +7 -0
  188. package/src/assets/icons_old/flag.svg +4 -0
  189. package/src/assets/icons_old/forbid.svg +4 -0
  190. package/src/assets/icons_old/fortanix-app-aci.svg +6 -0
  191. package/src/assets/icons_old/fortanix-app-edp.svg +4 -0
  192. package/src/assets/icons_old/fortanix-app-enclave-os.svg +4 -0
  193. package/src/assets/icons_old/frame-expand.svg +4 -0
  194. package/src/assets/icons_old/fresh.svg +4 -0
  195. package/src/assets/icons_old/generated.svg +4 -0
  196. package/src/assets/icons_old/gift.svg +4 -0
  197. package/src/assets/icons_old/global.svg +4 -0
  198. package/src/assets/icons_old/group.svg +4 -0
  199. package/src/assets/icons_old/help.svg +4 -0
  200. package/src/assets/icons_old/home-info.svg +5 -0
  201. package/src/assets/icons_old/home.svg +4 -0
  202. package/src/assets/icons_old/horizontal-collapse.svg +5 -0
  203. package/src/assets/icons_old/horizontal-expand.svg +5 -0
  204. package/src/assets/icons_old/hsm.svg +4 -0
  205. package/src/assets/icons_old/info.svg +4 -0
  206. package/src/assets/icons_old/install.svg +4 -0
  207. package/src/assets/icons_old/integration.svg +7 -0
  208. package/src/assets/icons_old/key-clone.svg +4 -0
  209. package/src/assets/icons_old/key-custodian-policy.svg +10 -0
  210. package/src/assets/icons_old/key-destroy.svg +4 -0
  211. package/src/assets/icons_old/key-download.svg +4 -0
  212. package/src/assets/icons_old/key-justification-policy.svg +5 -0
  213. package/src/assets/icons_old/key-link.svg +4 -0
  214. package/src/assets/icons_old/key-metadata-policy.svg +5 -0
  215. package/src/assets/icons_old/key-primary.svg +11 -0
  216. package/src/assets/icons_old/key-remove.svg +4 -0
  217. package/src/assets/icons_old/key-rotation.svg +4 -0
  218. package/src/assets/icons_old/key-undo-policy.svg +10 -0
  219. package/src/assets/icons_old/key-wrapping.svg +6 -0
  220. package/src/assets/icons_old/key.svg +4 -0
  221. package/src/assets/icons_old/leave-account.svg +4 -0
  222. package/src/assets/icons_old/link.svg +4 -0
  223. package/src/assets/icons_old/lock-closed.svg +4 -0
  224. package/src/assets/icons_old/lock.svg +4 -0
  225. package/src/assets/icons_old/locked-user.svg +4 -0
  226. package/src/assets/icons_old/marketplace.svg +4 -0
  227. package/src/assets/icons_old/minus.svg +4 -0
  228. package/src/assets/icons_old/monitoring.svg +4 -0
  229. package/src/assets/icons_old/no-logging.svg +4 -0
  230. package/src/assets/icons_old/node-cluster.svg +4 -0
  231. package/src/assets/icons_old/node.svg +4 -0
  232. package/src/assets/icons_old/operations.svg +13 -0
  233. package/src/assets/icons_old/options.svg +4 -0
  234. package/src/assets/icons_old/play.svg +4 -0
  235. package/src/assets/icons_old/plug.svg +4 -0
  236. package/src/assets/icons_old/plugin-clone.svg +4 -0
  237. package/src/assets/icons_old/plugin.svg +4 -0
  238. package/src/assets/icons_old/plugins.svg +4 -0
  239. package/src/assets/icons_old/pod.svg +4 -0
  240. package/src/assets/icons_old/print.svg +4 -0
  241. package/src/assets/icons_old/projects.svg +11 -0
  242. package/src/assets/icons_old/python.svg +4 -0
  243. package/src/assets/icons_old/quorum.svg +4 -0
  244. package/src/assets/icons_old/refresh.svg +4 -0
  245. package/src/assets/icons_old/regenerate.svg +4 -0
  246. package/src/assets/icons_old/region.svg +4 -0
  247. package/src/assets/icons_old/reports.svg +3 -0
  248. package/src/assets/icons_old/request-approve.svg +4 -0
  249. package/src/assets/icons_old/request-decline.svg +4 -0
  250. package/src/assets/icons_old/reseller.svg +4 -0
  251. package/src/assets/icons_old/script.svg +7 -0
  252. package/src/assets/icons_old/search.svg +4 -0
  253. package/src/assets/icons_old/service-account.svg +4 -0
  254. package/src/assets/icons_old/settings.svg +4 -0
  255. package/src/assets/icons_old/sidebar-closed.svg +8 -0
  256. package/src/assets/icons_old/sidebar-open.svg +8 -0
  257. package/src/assets/icons_old/sign-out.svg +4 -0
  258. package/src/assets/icons_old/sign.svg +4 -0
  259. package/src/assets/icons_old/software.svg +4 -0
  260. package/src/assets/icons_old/sql-aggregate.svg +7 -0
  261. package/src/assets/icons_old/sql.svg +7 -0
  262. package/src/assets/icons_old/stack.svg +4 -0
  263. package/src/assets/icons_old/star-empty.svg +4 -0
  264. package/src/assets/icons_old/star-fill.svg +4 -0
  265. package/src/assets/icons_old/subscription.svg +5 -0
  266. package/src/assets/icons_old/support.svg +11 -0
  267. package/src/assets/icons_old/switcher.svg +4 -0
  268. package/src/assets/icons_old/sysadmin.svg +4 -0
  269. package/src/assets/icons_old/tag.svg +4 -0
  270. package/src/assets/icons_old/target.svg +4 -0
  271. package/src/assets/icons_old/tasks.svg +4 -0
  272. package/src/assets/icons_old/tfa-user.svg +4 -0
  273. package/src/assets/icons_old/tfa.svg +4 -0
  274. package/src/assets/icons_old/tokenization.svg +4 -0
  275. package/src/assets/icons_old/tools.svg +4 -0
  276. package/src/assets/icons_old/transition-from.svg +4 -0
  277. package/src/assets/icons_old/transition-to.svg +4 -0
  278. package/src/assets/icons_old/upload.svg +4 -0
  279. package/src/assets/icons_old/user-remove.svg +3 -0
  280. package/src/assets/icons_old/user.svg +4 -0
  281. package/src/assets/icons_old/view-type-cards.svg +4 -0
  282. package/src/assets/icons_old/view-type-list.svg +4 -0
  283. package/src/assets/icons_old/view-type-table.svg +4 -0
  284. package/src/assets/icons_old/warning.svg +4 -0
  285. package/src/assets/icons_old/workflow.svg +3 -0
  286. package/src/assets/icons_old/wrap.svg +4 -0
  287. package/src/assets/icons_old/wrench.svg +4 -0
  288. package/src/assets/images/fortanix_logo_icon.svg +20 -0
  289. package/src/components/actions/Button/Button.module.scss +81 -0
  290. package/src/components/actions/Button/Button.stories.tsx +262 -0
  291. package/src/components/actions/Button/Button.tsx +133 -0
  292. package/src/components/actions/ButtonAsLink/ButtonAsLink.module.scss +13 -0
  293. package/src/components/actions/ButtonAsLink/ButtonAsLink.stories.tsx +49 -0
  294. package/src/components/actions/ButtonAsLink/ButtonAsLink.tsx +56 -0
  295. package/src/components/actions/Link/Link.module.scss +38 -0
  296. package/src/components/actions/Link/Link.stories.tsx +54 -0
  297. package/src/components/actions/Link/Link.tsx +59 -0
  298. package/src/components/actions/LinkAsButton/LinkAsButton.stories.tsx +70 -0
  299. package/src/components/actions/LinkAsButton/LinkAsButton.tsx +59 -0
  300. package/src/components/containers/Alert/Alert.module.scss +41 -0
  301. package/src/components/containers/Alert/Alert.stories.tsx +47 -0
  302. package/src/components/containers/Alert/Alert.tsx +65 -0
  303. package/src/components/containers/Banner/Banner.module.scss +100 -0
  304. package/src/components/containers/Banner/Banner.stories.tsx +198 -0
  305. package/src/components/containers/Banner/Banner.tsx +121 -0
  306. package/src/components/containers/Card/Card.module.scss +32 -0
  307. package/src/components/containers/Card/Card.stories.tsx +67 -0
  308. package/src/components/containers/Card/Card.tsx +48 -0
  309. package/src/components/containers/Dialog/Dialog.module.scss +166 -0
  310. package/src/components/containers/Dialog/Dialog.stories.tsx +32 -0
  311. package/src/components/containers/Dialog/Dialog.tsx +130 -0
  312. package/src/components/containers/Panel/Panel.module.scss +32 -0
  313. package/src/components/containers/Panel/Panel.stories.tsx +46 -0
  314. package/src/components/containers/Panel/Panel.tsx +48 -0
  315. package/src/components/forms/context/Form/Form.module.scss +11 -0
  316. package/src/components/forms/context/Form/Form.stories.tsx +99 -0
  317. package/src/components/forms/context/Form/Form.tsx +106 -0
  318. package/src/components/forms/context/Form/FormOptics.tsx +109 -0
  319. package/src/components/forms/context/SubmitButton/SubmitButton.module.scss +9 -0
  320. package/src/components/forms/context/SubmitButton/SubmitButton.stories.tsx +132 -0
  321. package/src/components/forms/context/SubmitButton/SubmitButton.tsx +98 -0
  322. package/src/components/forms/controls/Checkbox/Checkbox.module.scss +67 -0
  323. package/src/components/forms/controls/Checkbox/Checkbox.stories.tsx +119 -0
  324. package/src/components/forms/controls/Checkbox/Checkbox.tsx +53 -0
  325. package/src/components/forms/controls/Input/Input.module.scss +40 -0
  326. package/src/components/forms/controls/Input/Input.stories.tsx +55 -0
  327. package/src/components/forms/controls/Input/Input.tsx +44 -0
  328. package/src/components/forms/controls/SegmentedControl/SegmentedControl.module.scss +76 -0
  329. package/src/components/forms/controls/SegmentedControl/SegmentedControl.stories.tsx +92 -0
  330. package/src/components/forms/controls/SegmentedControl/SegmentedControl.tsx +103 -0
  331. package/src/components/forms/controls/Select/Select.module.scss +105 -0
  332. package/src/components/forms/controls/Select/Select.stories.tsx +43 -0
  333. package/src/components/forms/controls/Select/Select.tsx +166 -0
  334. package/src/components/forms/controls/Switch/Switch.module.scss +63 -0
  335. package/src/components/forms/controls/Switch/Switch.stories.tsx +50 -0
  336. package/src/components/forms/controls/Switch/Switch.tsx +46 -0
  337. package/src/components/forms/fields/CheckboxField/CheckboxField.module.scss +46 -0
  338. package/src/components/forms/fields/CheckboxField/CheckboxField.stories.tsx +74 -0
  339. package/src/components/forms/fields/CheckboxField/CheckboxField.tsx +118 -0
  340. package/src/components/forms/fields/CheckboxGroup/CheckboxGroup.module.scss +22 -0
  341. package/src/components/forms/fields/CheckboxGroup/CheckboxGroup.stories.tsx +36 -0
  342. package/src/components/forms/fields/CheckboxGroup/CheckboxGroup.tsx +37 -0
  343. package/src/components/forms/fields/InputField/InputField.module.scss +24 -0
  344. package/src/components/forms/fields/InputField/InputField.stories.tsx +57 -0
  345. package/src/components/forms/fields/InputField/InputField.tsx +72 -0
  346. package/src/components/graphics/Icon/Icon.module.scss +42 -0
  347. package/src/components/graphics/Icon/Icon.stories.tsx +67 -0
  348. package/src/components/graphics/Icon/Icon.tsx +50 -0
  349. package/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.module.scss +76 -0
  350. package/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.stories.tsx +101 -0
  351. package/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.tsx +91 -0
  352. package/src/components/graphics/ProgressBar/ProgressBar.module.scss +43 -0
  353. package/src/components/graphics/ProgressBar/ProgressBar.stories.tsx +70 -0
  354. package/src/components/graphics/ProgressBar/ProgressBar.tsx +58 -0
  355. package/src/components/graphics/Spinner/Spinner.module.scss +61 -0
  356. package/src/components/graphics/Spinner/Spinner.stories.tsx +56 -0
  357. package/src/components/graphics/Spinner/Spinner.tsx +41 -0
  358. package/src/components/lists/PropertyList/PropertyList.module.scss +33 -0
  359. package/src/components/lists/PropertyList/PropertyList.stories.tsx +45 -0
  360. package/src/components/lists/PropertyList/PropertyList.tsx +60 -0
  361. package/src/components/navigations/Stepper/Stepper.module.scss +88 -0
  362. package/src/components/navigations/Stepper/Stepper.stories.tsx +68 -0
  363. package/src/components/navigations/Stepper/Stepper.tsx +95 -0
  364. package/src/components/navigations/Tabs/Tabs.module.scss +71 -0
  365. package/src/components/navigations/Tabs/Tabs.stories.tsx +106 -0
  366. package/src/components/navigations/Tabs/Tabs.tsx +121 -0
  367. package/src/components/overlays/DropdownMenu/DropdownMenu.module.scss +113 -0
  368. package/src/components/overlays/DropdownMenu/DropdownMenu.stories.tsx +91 -0
  369. package/src/components/overlays/DropdownMenu/DropdownMenu.tsx +155 -0
  370. package/src/components/overlays/DropdownMenu/DropdownMenuProvider.module.scss +105 -0
  371. package/src/components/overlays/DropdownMenu/DropdownMenuProvider.stories.tsx +71 -0
  372. package/src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx +168 -0
  373. package/src/components/overlays/Modal/Modal.module.scss +185 -0
  374. package/src/components/overlays/Modal/Modal.stories.tsx +144 -0
  375. package/src/components/overlays/Modal/Modal.tsx +202 -0
  376. package/src/components/overlays/Toast/Toast.module.scss +123 -0
  377. package/src/components/overlays/Toast/Toast.stories.tsx +219 -0
  378. package/src/components/overlays/Toast/Toast.tsx +233 -0
  379. package/src/components/overlays/Toast/ToastyOverride.scss +27 -0
  380. package/src/components/overlays/Tooltip/Tooltip.module.scss +162 -0
  381. package/src/components/overlays/Tooltip/Tooltip.stories.tsx +115 -0
  382. package/src/components/overlays/Tooltip/Tooltip.tsx +75 -0
  383. package/src/components/overlays/Tooltip/TooltipProvider.stories.tsx +169 -0
  384. package/src/components/overlays/Tooltip/TooltipProvider.tsx +164 -0
  385. package/src/components/util/Clipboard/Clipboard.tsx +11 -0
  386. package/src/components/util/Popover/Popover.tsx +219 -0
  387. package/src/docs/Changelog.mdx +7 -0
  388. package/src/docs/Colors.mdx +113 -0
  389. package/src/docs/Colors.module.scss +56 -0
  390. package/src/docs/Iconography.mdx +70 -0
  391. package/src/docs/Iconography.module.scss +37 -0
  392. package/src/docs/Introduction.mdx +26 -0
  393. package/src/docs/Typography.mdx +109 -0
  394. package/src/docs/Typography.module.scss +22 -0
  395. package/src/layouts/AppLayout/AppLayout.module.scss +110 -0
  396. package/src/layouts/AppLayout/AppLayout.stories.tsx +112 -0
  397. package/src/layouts/AppLayout/AppLayout.tsx +31 -0
  398. package/src/layouts/AppLayout/Breadcrumbs/Breadcrumbs.module.scss +47 -0
  399. package/src/layouts/AppLayout/Breadcrumbs/Breadcrumbs.stories.tsx +66 -0
  400. package/src/layouts/AppLayout/Breadcrumbs/Breadcrumbs.tsx +63 -0
  401. package/src/layouts/AppLayout/Header/AccountSelector.module.scss +24 -0
  402. package/src/layouts/AppLayout/Header/AccountSelector.stories.tsx +31 -0
  403. package/src/layouts/AppLayout/Header/AccountSelector.tsx +51 -0
  404. package/src/layouts/AppLayout/Header/Header.module.scss +74 -0
  405. package/src/layouts/AppLayout/Header/Header.stories.tsx +30 -0
  406. package/src/layouts/AppLayout/Header/Header.tsx +31 -0
  407. package/src/layouts/AppLayout/Header/SolutionSelector.module.scss +24 -0
  408. package/src/layouts/AppLayout/Header/SolutionSelector.stories.tsx +31 -0
  409. package/src/layouts/AppLayout/Header/SolutionSelector.tsx +50 -0
  410. package/src/layouts/AppLayout/Header/UserMenu.module.scss +31 -0
  411. package/src/layouts/AppLayout/Header/UserMenu.stories.tsx +32 -0
  412. package/src/layouts/AppLayout/Header/UserMenu.tsx +67 -0
  413. package/src/layouts/AppLayout/Logo/Logo.module.scss +78 -0
  414. package/src/layouts/AppLayout/Logo/Logo.tsx +38 -0
  415. package/src/layouts/AppLayout/Nav/Nav.module.scss +73 -0
  416. package/src/layouts/AppLayout/Nav/Nav.stories.tsx +32 -0
  417. package/src/layouts/AppLayout/Nav/Nav.tsx +75 -0
  418. package/src/layouts/AppLayout/Sidebar/Sidebar.module.scss +46 -0
  419. package/src/layouts/AppLayout/Sidebar/Sidebar.stories.tsx +30 -0
  420. package/src/layouts/AppLayout/Sidebar/Sidebar.tsx +33 -0
  421. package/src/layouts/FormLayout/FormLayout.module.scss +19 -0
  422. package/src/layouts/FormLayout/FormLayout.stories.tsx +64 -0
  423. package/src/layouts/FormLayout/FormLayout.tsx +32 -0
  424. package/src/styling/accessibility.css +24 -0
  425. package/src/styling/context/theming.scss +26 -0
  426. package/src/styling/context/theming_mixins.scss +79 -0
  427. package/src/styling/defs.scss +60 -0
  428. package/src/styling/fonts.css +126 -0
  429. package/src/styling/fonts_mixins.scss +16 -0
  430. package/src/styling/global.scss +49 -0
  431. package/src/styling/lib/normalize.css +78 -0
  432. package/src/styling/lib/reset-custom.css +58 -0
  433. package/src/styling/lib/reset.css +115 -0
  434. package/src/styling/main.scss +29 -0
  435. package/src/styling/variables.css +18 -0
  436. package/src/styling/variables.scss +928 -0
  437. package/src/styling/variables.ts +64 -0
  438. package/src/types/globals.d.ts +14 -0
  439. package/src/types/vite-env.d.ts +1 -0
  440. package/src/typography/BodyText/BodyText.mixins.scss +224 -0
  441. package/src/typography/BodyText/BodyText.module.scss +28 -0
  442. package/src/typography/BodyText/BodyText.stories.tsx +109 -0
  443. package/src/typography/BodyText/BodyText.tsx +30 -0
  444. package/src/typography/Heading/Heading.mixins.scss +42 -0
  445. package/src/typography/Heading/Heading.module.scss +15 -0
  446. package/src/typography/Heading/Heading.stories.tsx +112 -0
  447. package/src/typography/Heading/Heading.tsx +57 -0
  448. package/src/util/componentUtil.ts +19 -0
  449. package/src/util/drag.ts +197 -0
  450. package/src/util/reactUtil.ts +40 -0
  451. package/src/util/storybook/OverflowTester.css +13 -0
  452. package/src/util/storybook/OverflowTester.tsx +30 -0
  453. package/src/util/time.ts +12 -0
  454. package/src/util/types.ts +8 -0
@@ -0,0 +1,64 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ import variablesText from './variables.scss?raw';
6
+
7
+
8
+ type Variables = Record<string, string>;
9
+ const variables = [...variablesText.matchAll(/\$(.+):(.+)(?:!default).*;/g)].reduce<Variables>(
10
+ (variables, [match, variableName, variableValue]) => {
11
+ if (!match.includes('/* ignore */') && variableName && variableValue) {
12
+ variables[variableName.trim()] = variableValue.trim();
13
+ }
14
+ return variables;
15
+ },
16
+ {},
17
+ );
18
+
19
+
20
+ type VariableName = string;
21
+
22
+ type Color = { category: string, weight: number, color: string };
23
+ type Colors = Record<VariableName, Color>;
24
+ export const colors = Object.entries(variables).reduce<Colors>(
25
+ (colors, [variableName, value]) => {
26
+ const match = variableName.match(/^color-(.+)-(\d+)$/);
27
+ if (!match) { return colors; }
28
+
29
+ const [_, category, weight] = match;
30
+ if (typeof category === 'undefined' || typeof weight === 'undefined') { throw new Error(`Expected match`); }
31
+
32
+ colors[variableName] = { category, weight: Number(weight), color: value };
33
+ return colors;
34
+ },
35
+ {},
36
+ );
37
+
38
+ // Group colors by category
39
+ type ColorsByCategory = Record<VariableName, Record<string, Color>>;
40
+ export const colorsByCategory = Object.values(colors).reduce<ColorsByCategory>(
41
+ (colorsByCategory, { category, weight, color }) => {
42
+ colorsByCategory[category] = Object.assign(
43
+ colorsByCategory[category] ?? {},
44
+ { [`${category}-${weight}`]: { category, weight: Number(weight), color } },
45
+ );
46
+ return colorsByCategory;
47
+ },
48
+ {},
49
+ );
50
+
51
+ type FontSizes = Record<string, { sizeQualifier: string, sizeInRem: number }>;
52
+ export const fontSizes = Object.entries(variables).reduce<FontSizes>(
53
+ (fontSizes, [variableName, value]) => {
54
+ const match = variableName.match(/^font-size-(.+)$/);
55
+ if (!match) { return fontSizes; }
56
+
57
+ const [_, sizeQualifier] = match;
58
+ if (typeof sizeQualifier === 'undefined') { throw new Error(`Expected match`); }
59
+
60
+ fontSizes[variableName] = { sizeQualifier, sizeInRem: Number(value.replace('rem', '')) };
61
+ return fontSizes;
62
+ },
63
+ {},
64
+ );
@@ -0,0 +1,14 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ declare module "*.module.css" {
6
+ //const classes: Record<string, string>;
7
+ const classes: any; // Must be `any` rather than `Record<>`, because with record index returns `string | undefined`
8
+ export default classes;
9
+ }
10
+ declare module "*.module.scss" {
11
+ //const classes: Record<string, string>;
12
+ const classes: any; // Must be `any` rather than `Record<>`, because with record index returns `string | undefined`
13
+ export default classes;
14
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,224 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ @use '../Heading/Heading.mixins.scss' as Heading;
6
+
7
+
8
+ /* Match either the current context (&), or a descendent of it */
9
+ /* Note: only use this on single-element selectors (e.g. `p`), not on descendent selectors like `p a`. */
10
+ @mixin self-or-descendent($selector) {
11
+ #{$selector}#{&}, & #{$selector} {
12
+ @content;
13
+ }
14
+ }
15
+
16
+ @mixin bk-body-text {
17
+ --bk-body-text-line-height: 1.6;
18
+ --bk-body-block-spacing: 0.8lh;
19
+
20
+ font-family: var(--bk-font-family-body);
21
+ font-size: 1rem;
22
+
23
+ overflow-wrap: break-word; /* Prevent long words causing overflow */
24
+ text-wrap: pretty; /* Favor better typography for text wrapping (e.g. prevent orphans */
25
+ hyphens: auto;
26
+ line-height: var(--bk-body-text-line-height);
27
+
28
+ @include self-or-descendent(h1) { @include Heading.h1; }
29
+ @include self-or-descendent(h2) { @include Heading.h2; }
30
+ @include self-or-descendent(h3) { @include Heading.h3; }
31
+ @include self-or-descendent(h4) { @include Heading.h4; }
32
+ @include self-or-descendent(h5) { @include Heading.h5; }
33
+ @include self-or-descendent(h6) { @include Heading.h6; }
34
+
35
+ @include self-or-descendent(p) { margin-block-start: var(--bk-body-block-spacing); }
36
+
37
+ @include self-or-descendent(hr) {
38
+ margin-block: var(--bk-sizing-3);
39
+ border: none;
40
+ border-top: 1px solid #dbdbdb;
41
+ }
42
+
43
+ @include self-or-descendent(":is(button, input, textarea)") {
44
+ transition:
45
+ background-color 0.1s linear,
46
+ border-color 0.1s linear,
47
+ color 0.1s linear,
48
+ box-shadow 0.1s linear,
49
+ transform 0.1s ease;
50
+ }
51
+ @include self-or-descendent(":is(b, strong, th)") {
52
+ font-weight: 600;
53
+ }
54
+ @include self-or-descendent(":is(u)") {
55
+ text-decoration: underline;
56
+ }
57
+ @include self-or-descendent(":is(i, em)") {
58
+ font-style: italic;
59
+ }
60
+
61
+ @include self-or-descendent(blockquote) {
62
+ border-left: 4px solid #0096bfab;
63
+ margin: 1.5em 0;
64
+ padding: 0.5em 1em;
65
+ font-style: italic;
66
+
67
+ & > footer, & cite {
68
+ font-style: normal;
69
+ }
70
+ }
71
+
72
+ @include self-or-descendent(#{address}) {
73
+ font-style: normal;
74
+ }
75
+
76
+ @include self-or-descendent(':is(button, input[type=submit], input[type=button], input[type=checkbox])') {
77
+ cursor: pointer;
78
+ }
79
+
80
+ @include self-or-descendent(':is(input:not([type=checkbox]):not([type=radio]), select)') {
81
+ display: block;
82
+ }
83
+
84
+ @include self-or-descendent(':is(input, select, button, textarea)') {
85
+ color: #000000;
86
+ background-color: #efefef;
87
+ font-family: inherit;
88
+ font-size: inherit;
89
+ margin-right: 6px;
90
+ margin-bottom: 6px;
91
+ padding: 10px;
92
+ border: none;
93
+ border-radius: 6px;
94
+ outline: none;
95
+ }
96
+
97
+ /* @include self-or-descendent :is(
98
+ input:not([type=checkbox]):not([type=radio]),
99
+ select,
100
+ button,
101
+ textarea,
102
+ ) {
103
+ -webkit-appearance: none;
104
+ } */
105
+
106
+ @include self-or-descendent(textarea) {
107
+ margin-right: 0;
108
+ width: 100%;
109
+ box-sizing: border-box;
110
+ resize: vertical;
111
+ }
112
+
113
+ @include self-or-descendent(':is(button, input[type=submit], input[type=button])') {
114
+ padding-right: 30px;
115
+ padding-left: 30px;
116
+ }
117
+
118
+ @include self-or-descendent(':is(button:hover, input[type=submit]:hover, input[type=button]:hover)') {
119
+ background: #dddddd;
120
+ }
121
+
122
+ @include self-or-descendent(':is(input:disabled, select:disabled, button:disabled, textarea:disabled)') {
123
+ cursor: not-allowed;
124
+ opacity: .5;
125
+ }
126
+
127
+ & ::-webkit-input-placeholder {
128
+ color: #949494;
129
+ }
130
+
131
+ & ::placeholder {
132
+ color: #949494;
133
+ }
134
+
135
+ @include self-or-descendent(a) {
136
+ text-decoration: none;
137
+ color: #0076d1;
138
+
139
+ &:hover {
140
+ text-decoration: underline;
141
+ }
142
+ }
143
+
144
+ @include self-or-descendent(':is(code, kbd)') {
145
+ background: light-dark(#ccc, #333);
146
+ padding: 5px;
147
+ border-radius: 3px;
148
+ font-family: var(--bk-font-family-code, monospace);
149
+ }
150
+
151
+ @include self-or-descendent(':is(pre)') {
152
+ > code {
153
+ padding: 10px;
154
+ display: block;
155
+ overflow-x: auto;
156
+ }
157
+ }
158
+
159
+ @include self-or-descendent(img) {
160
+ max-width: 100%;
161
+ }
162
+
163
+ @include self-or-descendent(':is(ul, ol, dl)') {
164
+ --list-indent: 1.5ch;
165
+ margin-block-start: var(--bk-body-block-spacing);
166
+ }
167
+ @include self-or-descendent(':is(li)') {
168
+ /* Nested lists */
169
+ > :is(ul, ol, dl) {
170
+ margin-left: var(--list-indent);
171
+ }
172
+ }
173
+ @include self-or-descendent(ul) {
174
+ display: block;
175
+ /* Note: do not use list-style: none, this causes accessibility issues:
176
+ https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#aa-newer-accessibility-concerns-with-lists */
177
+ list-style: disc inside;
178
+
179
+ > li::marker {
180
+ /* Override the marker style so we customize the gap size */
181
+ /* https://css-tricks.com/everything-you-need-to-know-about-the-gap-after-the-list-marker/ */
182
+ content: '\2022' ' ';
183
+ margin: 0; /* Margin and padding are not supported by `::marker` currently */
184
+ }
185
+ > li:not(:first-of-type) { /* Note: in the future we could use `margin-trim` instead */
186
+ margin-block-start: calc(var(--bk-body-block-spacing) / 4);
187
+ }
188
+ }
189
+ @include self-or-descendent(ol) {
190
+ display: block;
191
+ /* Note: do not use list-style: none, this causes accessibility issues:
192
+ https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#aa-newer-accessibility-concerns-with-lists */
193
+ list-style: decimal inside;
194
+
195
+ > li:not(:first-of-type) {
196
+ margin-block-start: calc(var(--bk-body-block-spacing) / 4);
197
+ }
198
+ }
199
+
200
+ @include self-or-descendent(table) {
201
+ border-collapse: collapse;
202
+ margin-bottom: 10px;
203
+ width: 100%;
204
+ }
205
+
206
+ @include self-or-descendent(':is(td, th)') {
207
+ padding: 6px;
208
+ text-align: left;
209
+ }
210
+
211
+ @include self-or-descendent(th) {
212
+ border-bottom: 1px solid #dbdbdb;
213
+ }
214
+
215
+ @include self-or-descendent(tbody) {
216
+ tr:nth-child(even) {
217
+ background-color: #efefef;
218
+ }
219
+ }
220
+
221
+ > :first-child {
222
+ margin-block-start: 0;
223
+ }
224
+ }
@@ -0,0 +1,28 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ @use '../../styling/defs.scss' as bk;
6
+ @use './BodyText.mixins.scss' as bodytext;
7
+
8
+ /* Use a separate layer for body-text so that we can `revert-layer` */
9
+ @layer baklava.body-text {
10
+ /*
11
+ XXX `@scope` does not yet have browser support
12
+ @scope (.bk-body-text) to (.bk, .isolate) { /* Do not leak .bk-body-text styling into components * /
13
+ :scope {
14
+ @include bk.component-base(bk-body-text);
15
+ @mixin bk-body-text;
16
+ }
17
+ }
18
+ */
19
+
20
+ .bk-body-text {
21
+ @include bk.component-base(bk-body-text);
22
+ @include bodytext.bk-body-text;
23
+ }
24
+
25
+ .bk-body-text .bk {
26
+ all: revert-layer;
27
+ }
28
+ }
@@ -0,0 +1,109 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ import * as React from 'react';
6
+ import type { Meta, StoryObj } from '@storybook/react';
7
+
8
+ import { Button } from '../../components/actions/Button/Button.tsx';
9
+ import { Panel } from '../../components/containers/Panel/Panel.tsx';
10
+
11
+ import { BodyText } from './BodyText.tsx';
12
+
13
+
14
+ type BodyTextArgs = React.ComponentProps<typeof BodyText>;
15
+ type Story = StoryObj<typeof BodyText>;
16
+
17
+ export default {
18
+ component: BodyText,
19
+ parameters: {
20
+ layout: 'centered',
21
+ },
22
+ tags: ['autodocs'],
23
+ argTypes: {
24
+ },
25
+ args: {
26
+ },
27
+ render: (args) => <BodyText {...args}/>,
28
+ } satisfies Meta<BodyTextArgs>;
29
+
30
+
31
+ const SampleBodyText = () => {
32
+ const id = React.useId();
33
+ return (
34
+ <>
35
+ <h1>Example of body text</h1>
36
+ <h2>Example of body text</h2>
37
+ <p>
38
+ Lorem ipsum dolor sit amet, <a href="#">consectetur</a> adipiscing elit. Pellentesque eget sem ut neque lobortis pharetra nec vel quam. Etiam sem neque, gravida sed pharetra ut, vehicula quis lectus. Donec ac rhoncus purus. Proin ultricies augue vitae purus feugiat, in ultrices lorem aliquet. Donec eleifend ac dolor a auctor. Cras ac suscipit nibh. Fusce tincidunt iaculis dapibus. Vivamus sit amet neque eu velit tincidunt semper. Donec at magna aliquam mi consectetur imperdiet. Donec pretium placerat quam, in sodales purus porta vitae. Phasellus nisl justo, luctus vel mi vel, sollicitudin euismod neque.
39
+ </p>
40
+ <p>
41
+ Duis mollis, justo vel pretium luctus, risus sem eleifend lectus, ac convallis dolor nibh id sapien. Donec vestibulum tellus non rutrum convallis. Aenean venenatis enim in egestas lobortis. Donec mollis elit in turpis imperdiet congue vel at magna. Vestibulum bibendum, ipsum quis lobortis lobortis, lorem libero mollis sapien, sed tempus lacus nibh a nunc. Vivamus sed sem eleifend, rutrum erat eget, ultricies neque. Morbi condimentum dolor vel ipsum consectetur iaculis. Donec ornare diam at orci luctus, sed placerat quam dictum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Curabitur condimentum molestie augue. Ut vel nisl a augue ornare volutpat. Phasellus et enim in mi maximus ultricies. Integer dignissim ipsum mauris, id bibendum eros euismod et.
42
+ </p>
43
+ <p>An unordered list:</p>
44
+ <ul>
45
+ <li>List item 1</li>
46
+ <li>List item 2</li>
47
+ <li> Nested list:
48
+ <ol>
49
+ <li>Nested list item 1</li>
50
+ <li>Nested list item 2</li>
51
+ </ol>
52
+ </li>
53
+ </ul>
54
+ <p>An ordered list:</p>
55
+ <ol>
56
+ <li>List item 1</li>
57
+ <li>List item 2</li>
58
+ <li> Nested list:
59
+ <ul>
60
+ <li>Nested list item 1</li>
61
+ <li>Nested list item 2</li>
62
+ </ul>
63
+ </li>
64
+ </ol>
65
+ <hr/>
66
+ <h2>Forms</h2>
67
+
68
+ <form>
69
+ <fieldset>
70
+ <legend>Test</legend>
71
+
72
+ <label htmlFor={`${id}-input-1`}>Text input:</label>
73
+ <input id={`${id}-input-1`} type="text"/>
74
+ </fieldset>
75
+ </form>
76
+ </>
77
+ );
78
+ };
79
+
80
+ export const Standard: Story = {
81
+ args: {
82
+ children: <SampleBodyText/>,
83
+ },
84
+ };
85
+
86
+ export const WithComponents: Story = {
87
+ args: {
88
+ children: (
89
+ <>
90
+ <h1>Body text with embedded components</h1>
91
+ <p>
92
+ Body text can include Baklava components. Those components should not be affected by any styling inherited
93
+ from the body text styling.
94
+ </p>
95
+ <p>Here is a button component:</p>
96
+ <Button variant="primary" label="Button"/>
97
+
98
+ <Panel>
99
+ <Panel.Heading>This panel contains a nested a bk-body-text</Panel.Heading>
100
+
101
+ <div className="bk-body-text">
102
+ <p>The following should be bold and underlined:</p>
103
+ <p><strong><u>This is body text embedded within a component.</u></strong></p>
104
+ </div>
105
+ </Panel>
106
+ </>
107
+ ),
108
+ },
109
+ };
@@ -0,0 +1,30 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ import { classNames as cx, type ComponentProps } from '../../util/componentUtil.ts';
6
+ import * as React from 'react';
7
+
8
+ import cl from './BodyText.module.scss';
9
+
10
+
11
+ export { cl as BodyTextClassNames };
12
+
13
+ export type BodyTextProps = React.PropsWithChildren<ComponentProps<'article'> & {
14
+ /** Whether this component should be unstyled. */
15
+ unstyled?: undefined | boolean,
16
+ }>;
17
+ /**
18
+ * BodyText component.
19
+ */
20
+ export const BodyText = ({ unstyled, ...propsRest }: BodyTextProps) => {
21
+ return (
22
+ <article
23
+ {...propsRest}
24
+ className={cx({
25
+ bk: true,
26
+ ['bk-body-text']: !unstyled,
27
+ }, propsRest.className)}
28
+ />
29
+ );
30
+ };
@@ -0,0 +1,42 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ @use '../../styling/defs.scss' as bk;
6
+
7
+ @mixin heading {
8
+ @include bk.font(bk.$font-family-display);
9
+ text-wrap: balance;
10
+ line-height: 1.6;
11
+ }
12
+
13
+ @mixin h1 {
14
+ @include heading;
15
+ font-size: 42px;
16
+ font-weight: 300;
17
+ }
18
+ @mixin h2 {
19
+ @include heading;
20
+ font-size: 30px;
21
+ font-weight: 400;
22
+ }
23
+ @mixin h3 {
24
+ @include heading;
25
+ font-size: 24px;
26
+ font-weight: 400;
27
+ }
28
+ @mixin h4 {
29
+ @include heading;
30
+ font-size: 20px;
31
+ font-weight: 400;
32
+ }
33
+ @mixin h5 {
34
+ @include heading;
35
+ font-size: 16px;
36
+ font-weight: 600;
37
+ }
38
+ @mixin h6 {
39
+ @include heading;
40
+ font-size: 16px;
41
+ font-weight: 500;
42
+ }
@@ -0,0 +1,15 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ @use '../../styling/defs.scss' as bk;
6
+ @use './Heading.mixins.scss' as Heading;
7
+
8
+ @layer baklava.components {
9
+ .bk-h1 { @include bk.component-base(bk-h1); @include Heading.h1; }
10
+ .bk-h2 { @include bk.component-base(bk-h2); @include Heading.h2; }
11
+ .bk-h3 { @include bk.component-base(bk-h3); @include Heading.h3; }
12
+ .bk-h4 { @include bk.component-base(bk-h4); @include Heading.h4; }
13
+ .bk-h5 { @include bk.component-base(bk-h5); @include Heading.h5; }
14
+ .bk-h6 { @include bk.component-base(bk-h6); @include Heading.h6; }
15
+ }
@@ -0,0 +1,112 @@
1
+ /* Copyright (c) Fortanix, Inc.
2
+ |* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
3
+ |* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+ import type { Meta, StoryObj } from '@storybook/react';
6
+
7
+ import * as Heading from './Heading.tsx';
8
+
9
+
10
+ export default {
11
+ component: Heading.H1,
12
+ parameters: {
13
+ layout: 'centered',
14
+ },
15
+ tags: ['autodocs'],
16
+ argTypes: {
17
+ },
18
+ args: {
19
+ },
20
+ } satisfies Meta<Heading.H1Props>;
21
+
22
+
23
+ const BaseStory = {
24
+ parameters: {
25
+ design: { type: 'figma', url: 'https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fdesign%2FnOF5w9LfPiJabQD5yPzCEp%2F2024-Design-System-UX%3Fnode-id%3D473%253A73818%26t%3DjsTF1ykn6P4yp2et-1' },
26
+ },
27
+ } as const;
28
+
29
+ export const H1: StoryObj<typeof Heading.H1> = {
30
+ ...BaseStory,
31
+ name: 'H1',
32
+ args: { children: `H1 - Montserrat Light 42` },
33
+ render: (args) => <Heading.H1 {...args}/>,
34
+ };
35
+
36
+ export const H1TextWrap: StoryObj<typeof Heading.H1> = {
37
+ ...BaseStory,
38
+ name: 'H1 [text wrap]',
39
+ args: { children: `Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines.` },
40
+ render: (args) => <Heading.H1 {...args}/>,
41
+ };
42
+
43
+ export const H2: StoryObj<typeof Heading.H2> = {
44
+ ...BaseStory,
45
+ name: 'H2',
46
+ args: { children: `H2 - Montserrat Regular 30` },
47
+ render: (args) => <Heading.H2 {...args}/>,
48
+ };
49
+
50
+ export const H2TextWrap: StoryObj<typeof Heading.H2> = {
51
+ ...BaseStory,
52
+ name: 'H2 [text wrap]',
53
+ args: { children: `Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines.` },
54
+ render: (args) => <Heading.H2 {...args}/>,
55
+ };
56
+
57
+ export const H3: StoryObj<typeof Heading.H3> = {
58
+ ...BaseStory,
59
+ name: 'H3',
60
+ args: { children: `H3 - Montserrat Regular 24` },
61
+ render: (args) => <Heading.H3 {...args}/>,
62
+ };
63
+
64
+ export const H3TextWrap: StoryObj<typeof Heading.H3> = {
65
+ ...BaseStory,
66
+ name: 'H3 [text wrap]',
67
+ args: { children: `Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines.` },
68
+ render: (args) => <Heading.H3 {...args}/>,
69
+ };
70
+
71
+ export const H4: StoryObj<typeof Heading.H4> = {
72
+ ...BaseStory,
73
+ name: 'H4',
74
+ args: { children: `H4 - Montserrat Regular 20` },
75
+ render: (args) => <Heading.H4 {...args}/>,
76
+ };
77
+
78
+ export const H4TextWrap: StoryObj<typeof Heading.H4> = {
79
+ ...BaseStory,
80
+ name: 'H4 [text wrap]',
81
+ args: { children: `Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines.` },
82
+ render: (args) => <Heading.H4 {...args}/>,
83
+ };
84
+
85
+ export const H5: StoryObj<typeof Heading.H5> = {
86
+ ...BaseStory,
87
+ name: 'H5',
88
+ args: { children: `H5 - Montserrat Semi-Bold 16` },
89
+ render: (args) => <Heading.H5 {...args}/>,
90
+ };
91
+
92
+ export const H5TextWrap: StoryObj<typeof Heading.H5> = {
93
+ ...BaseStory,
94
+ name: 'H5 [text wrap]',
95
+ args: { children: `Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines.` },
96
+ render: (args) => <Heading.H5 {...args}/>,
97
+ };
98
+
99
+ export const H6: StoryObj<typeof Heading.H6> = {
100
+ ...BaseStory,
101
+ name: 'H6',
102
+ args: { children: `H6 - Montserrat Medium 16` },
103
+ render: (args) => <Heading.H6 {...args}/>,
104
+ };
105
+
106
+ export const H6TextWrap: StoryObj<typeof Heading.H6> = {
107
+ ...BaseStory,
108
+ name: 'H6 [text wrap]',
109
+ args: { children: `Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines. Some really long text to demonstrate text wrapping over multiple lines.` },
110
+ render: (args) => <Heading.H6 {...args}/>,
111
+ };
112
+