@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,110 @@
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
+ /* stylelint-disable no-duplicate-selectors */
5
+
6
+ @use '../../styling/defs.scss' as bk;
7
+
8
+ @layer baklava.base {
9
+ :root {
10
+ /* Height of the header needs to be known at root level so we can use it for things like `scroll-padding-top` */
11
+ --bk-app-layout-header-height: var(--bk-sizing-5);
12
+ }
13
+ }
14
+
15
+ @layer baklava.components {
16
+ .bk-app-layout {
17
+ @include bk.component-base(bk-app-layout);
18
+ container-type: inline-size;
19
+
20
+ --bk-app-layout-sidebar-width-open: 220px;
21
+ --bk-app-layout-sidebar-width: var(--bk-app-layout-sidebar-width-open);
22
+
23
+ /* Note: do not use vw/vh, because we may want to show the layout in a container (e.g. story) */
24
+ min-width: 100cqw;
25
+ min-height: 100cqh;
26
+
27
+ display: grid;
28
+ // Note: use `minmax(0, 1fr)` to prevent blowout: https://css-tricks.com/preventing-a-grid-blowout
29
+ grid:
30
+ 'header header' var(--bk-app-layout-header-height)
31
+ 'sidebar content' 1fr
32
+ 'sidebar footer' max-content
33
+ / var(--bk-app-layout-sidebar-width) minmax(0, 1fr);
34
+
35
+ > [slot='header'] { grid-area: header; }
36
+ > [slot='sidebar'] { grid-area: sidebar; }
37
+ > [slot='content'] { grid-area: content; }
38
+ > [slot='footer'] { grid-area: footer; }
39
+
40
+ > [slot='header'] {
41
+ container: bk-app-layout__header / inline-size;
42
+ overflow: hidden;
43
+
44
+ background: bk.$theme-header-background-default;
45
+
46
+ position: sticky;
47
+ top: 0;
48
+ z-index: 1; /* Higher than content */
49
+
50
+ display: grid;
51
+ grid:
52
+ 'logo account-actions user-actions' 1fr
53
+ / var(--bk-app-layout-sidebar-width-open) max-content 1fr;
54
+
55
+ > [slot='logo'] { grid-area: logo; }
56
+ > [slot='actions'] { grid-column: account-actions-start / user-actions-end; }
57
+
58
+ > [slot='logo'] {
59
+ &:focus-visible {
60
+ @include bk.focus-inset;
61
+ }
62
+ }
63
+ }
64
+
65
+ > [slot='sidebar'] {
66
+ container: bk-app-layout__sidebar / inline-size;
67
+
68
+ background: bk.$theme-side-nav-background-default;
69
+
70
+ > aside {
71
+ position: sticky;
72
+ top: var(--bk-app-layout-header-height);
73
+ /*
74
+ Note: if the sidebar itself overflows (in height), then we might want to make this scrollable, but this is hard:
75
+ - https://stackoverflow.com/questions/16094785/fixed-position-div-that-needs-to-scroll-if-content-overflows
76
+ However, the user can still scroll the fixed sidebar by just scrolling to the bottom of the content.
77
+ */
78
+ }
79
+ }
80
+
81
+ > [slot='content'] {
82
+ container: bk-app-layout__content / inline-size;
83
+ padding: var(--bk-sizing-4);
84
+ }
85
+
86
+ > [slot='footer'] {
87
+ container: bk-app-layout__footer / inline-size;
88
+
89
+ // overflow: clip;
90
+ padding: var(--bk-sizing-2) var(--bk-sizing-4);
91
+
92
+ display: flex;
93
+ font-size: 0.8rem;
94
+ }
95
+
96
+ @container (width <= 768px) { /* Tablet size */
97
+ grid:
98
+ 'header' max-content
99
+ 'sidebar' max-content
100
+ 'content' 1fr
101
+ 'footer' max-content
102
+ / 1fr;
103
+ }
104
+
105
+ //&:has([slot='sidebar']:hover) { --bk-app-layout-sidebar-width: 80px; } // TEST
106
+ @media (prefers-reduced-motion: no-preference) {
107
+ transition: grid 300ms;
108
+ }
109
+ }
110
+ }
@@ -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 cx, { type Argument as ClassNameArgument } from 'classnames';
6
+ import * as React from 'react';
7
+
8
+ import type { Meta, StoryObj } from '@storybook/react';
9
+ import { userEvent, within } from '@storybook/test';
10
+
11
+ import { OverflowTester } from '../../util/storybook/OverflowTester.tsx';
12
+ import { Header } from './Header/Header.tsx';
13
+ import { Sidebar } from './Sidebar/Sidebar.tsx';
14
+ import { Logo } from './Logo/Logo.tsx';
15
+ import { Nav } from './Nav/Nav.tsx';
16
+
17
+ import { Button } from '../../components/actions/Button/Button.tsx';
18
+ import { Link } from '../../components/actions/Link/Link.tsx';
19
+ import { Panel } from '../../components/containers/Panel/Panel.tsx';
20
+ import { Modal } from '../../components/overlays/Modal/Modal.tsx';
21
+ import { UserMenu } from './Header/UserMenu.tsx';
22
+
23
+ import { AppLayout } from './AppLayout.tsx';
24
+ import { SolutionSelector } from './Header/SolutionSelector.tsx';
25
+ import { AccountSelector } from './Header/AccountSelector.tsx';
26
+ import { Breadcrumbs } from './Breadcrumbs/Breadcrumbs.tsx';
27
+
28
+
29
+ type AppLayoutArgs = React.ComponentProps<typeof AppLayout>;
30
+ type Story = StoryObj<AppLayoutArgs>;
31
+
32
+ export default {
33
+ component: AppLayout,
34
+ parameters: {
35
+ layout: 'fullscreen',
36
+ },
37
+ tags: ['autodocs'],
38
+ argTypes: {
39
+ },
40
+ render: args => <AppLayout {...args}/>,
41
+ } satisfies Meta<AppLayoutArgs>;
42
+
43
+
44
+ type ModalWithTriggerProps = Omit<React.ComponentProps<typeof Modal>, 'active' | 'onClose'> & {
45
+ triggerLabel?: string,
46
+ content?: React.ComponentProps<typeof Modal>['children'],
47
+ };
48
+ const ModalWithTrigger = ({ triggerLabel = 'Open modal', content, ...modalProps }: ModalWithTriggerProps) => {
49
+ const [active, setActive] = React.useState(false);
50
+ const onClose = React.useCallback(() => { setActive(false); }, [setActive]);
51
+ return (
52
+ <>
53
+ <Button variant="primary" onPress={() => { setActive(true); }}>{triggerLabel}</Button>
54
+ <Modal children={content} {...modalProps} active={active} onClose={onClose}/>
55
+ </>
56
+ );
57
+ };
58
+
59
+ export const Standard: Story = {
60
+ args: {
61
+ children: (
62
+ <>
63
+ <header slot="header" className="bk-theme--dark">
64
+ <Link unstyled href="#" slot="logo">
65
+ <Logo/>
66
+ </Link>
67
+ <Header slot="actions">
68
+ <UserMenu userName="Anand Kashyap"/>
69
+ {/* <UserMenu userName="Anand Kashyap – Very Long Name That Will Overflow"/> */}
70
+ <AccountSelector className="select-action"/>
71
+ <SolutionSelector className="select-action"/>
72
+ </Header>
73
+ </header>
74
+ {/* Container around the sidebar that grows to full height, allowing the sidebar to be sticky */}
75
+ <div slot="sidebar" className="bk-theme--dark">
76
+ <Sidebar className="bk-app-layout__sidebar">
77
+ <Nav>
78
+ <Nav.NavItem active icon="dashboard" label="Dashboard" href="#"/>
79
+ <Nav.NavItem icon="dashboard" label="Groups" href="#"/>
80
+ </Nav>
81
+ <OverflowTester lines={45}/>
82
+ </Sidebar>
83
+ </div>
84
+ <main slot="content">
85
+ <Breadcrumbs
86
+ items={[
87
+ {
88
+ title: 'Data Security Manager',
89
+ href: '#',
90
+ },
91
+ {
92
+ title: 'Dashboard',
93
+ href: '#',
94
+ }
95
+ ]}
96
+ />
97
+ <Panel>
98
+ <Panel.Heading>Panel</Panel.Heading>
99
+
100
+ <ModalWithTrigger>
101
+ <ModalWithTrigger/>
102
+ </ModalWithTrigger>
103
+ </Panel>
104
+ <OverflowTester/>
105
+ </main>
106
+ <footer slot="footer">
107
+ <span className="version">Version: 4.24.2343</span>
108
+ </footer>
109
+ </>
110
+ ),
111
+ },
112
+ };
@@ -0,0 +1,31 @@
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 './AppLayout.module.scss';
9
+
10
+
11
+ type AppLayoutProps = React.PropsWithChildren<ComponentProps<'div'> & {
12
+ /** Whether this component should be unstyled. */
13
+ unstyled?: undefined | boolean,
14
+ }>;
15
+
16
+ /**
17
+ * AppLayout component.
18
+ */
19
+ export const AppLayout = (props: AppLayoutProps) => {
20
+ const { unstyled = false, ...propsRest } = props;
21
+ return (
22
+ <div
23
+ {...propsRest}
24
+ className={cx(
25
+ 'bk',
26
+ { [cl['bk-app-layout']]: !unstyled },
27
+ propsRest.className,
28
+ )}
29
+ />
30
+ );
31
+ };
@@ -0,0 +1,47 @@
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
+ @layer baklava.components {
8
+ .bk-breadcrumbs {
9
+ @include bk.component-base(bk-breadcrumbs);
10
+
11
+ .bk-breadcrumb {
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ gap: bk.$spacing-1;
15
+ }
16
+
17
+ .bk-breadcrumb-item {
18
+ @include bk.font(bk.$font-family-display, bk.$font-weight-regular, bk.$font-size-s);
19
+ color: bk.$theme-breadcrumb-text-default;
20
+
21
+ &:last-child:not(.bk-breadcrumb-item--with-trailing-slash) {
22
+ &::after {
23
+ content: '';
24
+ margin-left: 0;
25
+ }
26
+ }
27
+
28
+ &::after {
29
+ content: '/';
30
+ font-size: bk.$font-size-s;
31
+ margin-left: bk.$spacing-1;
32
+ }
33
+
34
+ .bk-breadcrumb-link {
35
+ font-size: bk.$font-size-s;
36
+ text-decoration: none;
37
+ color: bk.$theme-breadcrumb-text-link;
38
+ }
39
+
40
+ :is(.bk-breadcrumb-link:focus-visible, :global(.pseudo-focus-visible) .bk-breadcrumb-link) {
41
+ --bk-focus-outline-color: #{bk.$theme-breadcrumb-border-focus};
42
+ @include bk.focus-outline-close;
43
+ border-radius: 2px;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,66 @@
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 React from 'react';
8
+
9
+ import { Breadcrumbs, type BreadcrumbItem } from './Breadcrumbs.tsx';
10
+
11
+
12
+ type BreadcrumbsArgs = React.ComponentProps<typeof Breadcrumbs>;
13
+ type Story = StoryObj<BreadcrumbsArgs>;
14
+
15
+ export default {
16
+ component: Breadcrumbs,
17
+ parameters: {
18
+ layout: 'centered',
19
+ },
20
+ tags: ['autodocs'],
21
+ argTypes: {
22
+ },
23
+ args: {
24
+ },
25
+ render: (args) => <Breadcrumbs {...args}/>,
26
+ } satisfies Meta<BreadcrumbsArgs>;
27
+
28
+ const defaultBreadcrumbsItems: BreadcrumbItem[] = [1,2,3,4].map(item => {
29
+ return {
30
+ title: `Test${item}`,
31
+ href: '#',
32
+ }
33
+ });
34
+
35
+ const BaseStory: Story = {
36
+ args: {},
37
+ render: (args) => <Breadcrumbs {...args}/>,
38
+ };
39
+
40
+ export const StandardStory: Story = {
41
+ ...BaseStory,
42
+ name: 'Standard',
43
+ args: { items: defaultBreadcrumbsItems },
44
+ };
45
+
46
+ export const StandardFocus: Story = {
47
+ ...BaseStory,
48
+ name: 'Standard [focus]',
49
+ args: {
50
+ items: defaultBreadcrumbsItems.map((item, index) => {
51
+ if (index === 1) {
52
+ return {
53
+ ...item,
54
+ className: 'pseudo-focus-visible',
55
+ }
56
+ }
57
+ return item;
58
+ }),
59
+ }
60
+ };
61
+
62
+ export const StandardTrailingSlash: Story = {
63
+ ...BaseStory,
64
+ name: 'Standard [trailing slash]',
65
+ args: { items: defaultBreadcrumbsItems, hasTrailingSlash: true },
66
+ };
@@ -0,0 +1,63 @@
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 { classNames as cx, type ComponentProps } from '../../../util/componentUtil.ts';
7
+
8
+ import cl from './Breadcrumbs.module.scss';
9
+ import { Link } from '../../../components/actions/Link/Link.tsx';
10
+
11
+ export { cl as BreadcrumbsClassNames };
12
+
13
+ export type BreadcrumbItem = ComponentProps<'li'> & {
14
+ title: string,
15
+ href: string,
16
+ };
17
+ export type BreadcrumbsProps = React.PropsWithChildren<ComponentProps<'nav'> & {
18
+ /** Whether this component should be unstyled. */
19
+ unstyled?: undefined | boolean,
20
+
21
+ /** The routing informations */
22
+ items: BreadcrumbItem[],
23
+
24
+ /** Whether the last breadcrumb item has slash or not. */
25
+ hasTrailingSlash?: boolean,
26
+ }>;
27
+ /**
28
+ * A breadcrumbs component
29
+ */
30
+ export const Breadcrumbs = (props: BreadcrumbsProps) => {
31
+ const { children, unstyled = false, items = [], hasTrailingSlash, ...propsRest } = props;
32
+ return (
33
+ <nav
34
+ {...propsRest}
35
+ aria-label="Breadcrumbs"
36
+ className={cx({
37
+ bk: true,
38
+ [cl['bk-breadcrumbs']]: !unstyled,
39
+ }, propsRest.className)}
40
+ >
41
+ <ol className={cx([cl['bk-breadcrumb']])}>
42
+ {items.map((item, index) => {
43
+ const isLast = index === items.length - 1;
44
+ return (
45
+ <li
46
+ key={index}
47
+ className={cx({
48
+ [cl['bk-breadcrumb-item']]: true,
49
+ [cl['bk-breadcrumb-item--with-trailing-slash']]: hasTrailingSlash,
50
+ }, item.className)}
51
+ >
52
+ {item.href && !isLast
53
+ ? <Link href={item.href} className={cx([cl['bk-breadcrumb-link']])}>{item.title}</Link>
54
+ : item.title
55
+ }
56
+ </li>
57
+ );
58
+ })}
59
+ {children}
60
+ </ol>
61
+ </nav>
62
+ );
63
+ };
@@ -0,0 +1,24 @@
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
+ @layer baklava.components {
8
+ .bk-account-selector {
9
+ @include bk.component-base(bk-account-selector);
10
+
11
+ // Allow the element to shrink down to just the icon
12
+ overflow: hidden;
13
+ flex-shrink: 4; // Shrink relatively fast (since there is no important information besides the icon)
14
+ min-width: 3rem;
15
+
16
+ display: flex;
17
+ gap: bk.$spacing-2;
18
+ align-items: center;
19
+
20
+ .bk-account-selector__icon {
21
+ --bk-icon-accent-color: #{bk.$theme-header-icon-background-default};
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,31 @@
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 React from 'react';
8
+
9
+ import { AccountSelector } from './AccountSelector.tsx';
10
+
11
+
12
+ type AccountSelectorArgs = React.ComponentProps<typeof AccountSelector>;
13
+ type Story = StoryObj<AccountSelectorArgs>;
14
+
15
+ export default {
16
+ component: AccountSelector,
17
+ parameters: {
18
+ layout: 'centered',
19
+ },
20
+ tags: ['autodocs'],
21
+ argTypes: {
22
+ },
23
+ args: {
24
+ },
25
+ render: (args) => <AccountSelector {...args}/>,
26
+ } satisfies Meta<AccountSelectorArgs>;
27
+
28
+
29
+ export const Standard: Story = {
30
+ name: 'AccountSelector',
31
+ };
@@ -0,0 +1,51 @@
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 { Icon } from '../../../components/graphics/Icon/Icon.tsx';
9
+ import { Button } from '../../../components/actions/Button/Button.tsx';
10
+ import { DropdownMenuProvider } from '../../../components/overlays/DropdownMenu/DropdownMenuProvider.tsx';
11
+
12
+ import cl from './AccountSelector.module.scss';
13
+
14
+
15
+ export { cl as AccountSelectorClassNames };
16
+
17
+ export type AccountSelectorProps = Omit<ComponentProps<typeof Button>, 'label'> & {
18
+ /** Whether this component should be unstyled. */
19
+ unstyled?: undefined | boolean,
20
+ };
21
+ export const AccountSelector = (props: AccountSelectorProps) => {
22
+ const { unstyled = false, children, ...propsRest } = props;
23
+
24
+ return (
25
+ <DropdownMenuProvider
26
+ placement="bottom-start"
27
+ items={
28
+ <>
29
+ <DropdownMenuProvider.Option optionKey="account-1" icon="accounts" label="Account 1"/>
30
+ <DropdownMenuProvider.Option optionKey="account-2" icon="accounts" label="Account 2"/>
31
+ <DropdownMenuProvider.Option optionKey="account-3" icon="accounts" label="Account 3"/>
32
+ </>
33
+ }
34
+ >
35
+ {({ props, state }) =>
36
+ <Button unstyled
37
+ {...props({
38
+ ...propsRest,
39
+ className: cx('bk', { [cl['bk-account-selector']]: !unstyled }, propsRest.className),
40
+ })}
41
+ >
42
+ <Icon icon="groups" className={cl['bk-account-selector__icon']}
43
+ decoration={{ type: 'background-circle' }}
44
+ />
45
+ {state.selectedOption === null ? 'Accounts' : state.selectedOption}
46
+ <Icon icon="caret-down"/>
47
+ </Button>
48
+ }
49
+ </DropdownMenuProvider>
50
+ );
51
+ };
@@ -0,0 +1,74 @@
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
+ @layer baklava.components {
8
+ .bk-app-layout-header {
9
+ @include bk.component-base(bk-app-layout-header);
10
+
11
+ --header-height: var(--bk-app-layout-header-height, var(--bk-sizing-5));
12
+
13
+ /* Necessary despite the `sticky`, because the page content is a container, which generates a stacking context:
14
+ https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context */
15
+ z-index: 1;
16
+
17
+ height: var(--header-height);
18
+ padding: var(--bk-sizing-2) var(--bk-sizing-3);
19
+
20
+ background: bk.$theme-header-background-default;
21
+ --header-box-shadow-size: var(--bk-sizing-1);
22
+ box-shadow: 0 0 var(--header-box-shadow-size) rgba(0 0 0 / 10%);
23
+ clip-path: inset(0 0 calc(-1 * var(--header-box-shadow-size)) 0); /* Only show shadow at bottom */
24
+
25
+ display: flex;
26
+ flex-direction: row-reverse;
27
+ gap: bk.$spacing-3;
28
+
29
+ .user-profile-trigger {
30
+ cursor: pointer;
31
+ }
32
+
33
+ .popover-user-profile {
34
+ position: fixed;
35
+ top: calc(var(--header-height) + var(--bk-sizing-1));
36
+ right: var(--bk-sizing-1);
37
+
38
+ width: var(--bk-sizing-7);
39
+ padding: var(--bk-sizing-3);
40
+ border-radius: var(--bk-sizing-1);
41
+
42
+ background: bk.$color-grape-300;
43
+
44
+ nav li {
45
+ cursor: pointer;
46
+
47
+ padding: var(--bk-sizing-3) var(--bk-sizing-3);
48
+ border-radius: var(--bk-sizing-1);
49
+
50
+ &:hover {
51
+ background: color-mix(in hsl, bk.$color-grape-300 60%, black);
52
+ }
53
+ }
54
+
55
+ transition: all 150ms ease-in-out;
56
+ transition-property: opacity, transform;
57
+ transform-origin: 50% 0;
58
+ &:popover-open {
59
+ opacity: 1;
60
+ transform: scaleY(1);
61
+
62
+ @starting-style {
63
+ opacity: 0;
64
+ transform: scaleY(0);
65
+ }
66
+ }
67
+ }
68
+
69
+ // Add space between the select actions (on the left) and the rest of the items (on the right)
70
+ > :nth-child(1 of :global(.select-action)) {
71
+ margin-inline-end: auto;
72
+ }
73
+ }
74
+ }
@@ -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 type { Meta, StoryObj } from '@storybook/react';
6
+ import { userEvent, within } from '@storybook/test';
7
+
8
+ import { Header } from './Header.tsx';
9
+
10
+
11
+ type HeaderArgs = React.ComponentProps<typeof Header>;
12
+ type Story = StoryObj<HeaderArgs>;
13
+
14
+ export default {
15
+ component: Header,
16
+ parameters: {
17
+ layout: 'fullscreen',
18
+ },
19
+ tags: ['autodocs'],
20
+ argTypes: {
21
+ },
22
+ } satisfies Meta<HeaderArgs>;
23
+
24
+
25
+ export const Standard: Story = {
26
+ render: () => <Header>Content</Header>,
27
+ play: async ({ canvasElement }) => {
28
+ const canvas = within(canvasElement);
29
+ },
30
+ };
@@ -0,0 +1,31 @@
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 './Header.module.scss';
9
+
10
+
11
+ export type HeaderProps = React.PropsWithChildren<ComponentProps<'header'> & {
12
+ /** Whether this component should be unstyled. */
13
+ unstyled?: undefined | boolean,
14
+ }>;
15
+ /**
16
+ * Header component (for app layout).
17
+ */
18
+ export const Header = ({ children, unstyled, ...propsRest }: HeaderProps) => {
19
+ return (
20
+ <header
21
+ role="banner"
22
+ {...propsRest}
23
+ className={cx(
24
+ 'bk',
25
+ { [cl['bk-app-layout-header']]: !unstyled },
26
+ )}
27
+ >
28
+ {children}
29
+ </header>
30
+ );
31
+ };