@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.
- package/CHANGELOG.md +6 -0
- package/LICENSE +373 -0
- package/README.md +43 -0
- package/app/Demo.tsx +33 -0
- package/app/index.html +12 -0
- package/app/lib.ts +54 -0
- package/app/main.tsx +32 -0
- package/dist/baklava.d.ts +752 -0
- package/dist/baklava.js +4962 -0
- package/dist/lib.css +1 -0
- package/package.json +102 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-100.woff2 +0 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-200.woff2 +0 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-300.woff2 +0 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-500.woff2 +0 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-600.woff2 +0 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-700.woff2 +0 -0
- package/src/assets/fonts/montserrat/montserrat-v25-latin_latin-ext-regular.woff2 +0 -0
- package/src/assets/fonts/open-sans/open-sans-v23-latin-600.woff2 +0 -0
- package/src/assets/fonts/open-sans/open-sans-v23-latin-700.woff2 +0 -0
- package/src/assets/fonts/open-sans/open-sans-v23-latin-regular.woff2 +0 -0
- package/src/assets/fonts/source-code-pro/source-code-pro-v14-latin-regular.woff2 +0 -0
- package/src/assets/icons/_icons.ts +58 -0
- package/src/assets/icons/accounts.svg +11 -0
- package/src/assets/icons/alert.svg +3 -0
- package/src/assets/icons/apache.svg +3 -0
- package/src/assets/icons/apps.svg +5 -0
- package/src/assets/icons/assessment.svg +11 -0
- package/src/assets/icons/audit-log.svg +12 -0
- package/src/assets/icons/authentication.svg +12 -0
- package/src/assets/icons/calendar.svg +10 -0
- package/src/assets/icons/caret-down.svg +3 -0
- package/src/assets/icons/check.svg +3 -0
- package/src/assets/icons/cloud-accounts.svg +15 -0
- package/src/assets/icons/copy.svg +4 -0
- package/src/assets/icons/cross.svg +4 -0
- package/src/assets/icons/dashboard.svg +12 -0
- package/src/assets/icons/dataverse.svg +12 -0
- package/src/assets/icons/delete.svg +5 -0
- package/src/assets/icons/docs.svg +10 -0
- package/src/assets/icons/download.svg +11 -0
- package/src/assets/icons/edit-params.svg +3 -0
- package/src/assets/icons/edit.svg +10 -0
- package/src/assets/icons/email.svg +3 -0
- package/src/assets/icons/eye.svg +11 -0
- package/src/assets/icons/file-error.svg +17 -0
- package/src/assets/icons/file.svg +15 -0
- package/src/assets/icons/folder.svg +14 -0
- package/src/assets/icons/fortanix-ki.svg +13 -0
- package/src/assets/icons/graph.svg +9 -0
- package/src/assets/icons/groups.svg +10 -0
- package/src/assets/icons/hide.svg +3 -0
- package/src/assets/icons/home.svg +11 -0
- package/src/assets/icons/iam.svg +11 -0
- package/src/assets/icons/info.svg +4 -0
- package/src/assets/icons/infrastructure.svg +5 -0
- package/src/assets/icons/integrations.svg +3 -0
- package/src/assets/icons/key-link.svg +12 -0
- package/src/assets/icons/key.svg +4 -0
- package/src/assets/icons/no-login.svg +10 -0
- package/src/assets/icons/page-forward.svg +4 -0
- package/src/assets/icons/plugins.svg +4 -0
- package/src/assets/icons/policy.svg +13 -0
- package/src/assets/icons/print.svg +11 -0
- package/src/assets/icons/scripts.svg +4 -0
- package/src/assets/icons/search.svg +3 -0
- package/src/assets/icons/security-object.svg +5 -0
- package/src/assets/icons/services.svg +10 -0
- package/src/assets/icons/settings.svg +12 -0
- package/src/assets/icons/solutions.svg +3 -0
- package/src/assets/icons/success.svg +3 -0
- package/src/assets/icons/tasks.svg +10 -0
- package/src/assets/icons/user-profile.svg +3 -0
- package/src/assets/icons/user.svg +10 -0
- package/src/assets/icons/warning.svg +3 -0
- package/src/assets/icons/workflows.svg +11 -0
- package/src/assets/icons_new/Accounts.svg +11 -0
- package/src/assets/icons_new/Alert.svg +3 -0
- package/src/assets/icons_new/Apache.svg +3 -0
- package/src/assets/icons_new/Apps.svg +5 -0
- package/src/assets/icons_new/Assessment.svg +11 -0
- package/src/assets/icons_new/Audit Log.svg +12 -0
- package/src/assets/icons_new/Authentication.svg +12 -0
- package/src/assets/icons_new/Calendar.svg +10 -0
- package/src/assets/icons_new/Carrot Down.svg +3 -0
- package/src/assets/icons_new/Cloud Accounts.svg +15 -0
- package/src/assets/icons_new/Copy.svg +4 -0
- package/src/assets/icons_new/Dashboard.svg +12 -0
- package/src/assets/icons_new/Dataverse.svg +12 -0
- package/src/assets/icons_new/Delete.svg +5 -0
- package/src/assets/icons_new/Docs.svg +10 -0
- package/src/assets/icons_new/Download.svg +11 -0
- package/src/assets/icons_new/Edit Params.svg +3 -0
- package/src/assets/icons_new/Edit.svg +10 -0
- package/src/assets/icons_new/Email.svg +3 -0
- package/src/assets/icons_new/Eye.svg +11 -0
- package/src/assets/icons_new/Groups.svg +10 -0
- package/src/assets/icons_new/Hide.svg +3 -0
- package/src/assets/icons_new/Home.svg +11 -0
- package/src/assets/icons_new/IAM.svg +11 -0
- package/src/assets/icons_new/Info.svg +4 -0
- package/src/assets/icons_new/Infrastructure.svg +5 -0
- package/src/assets/icons_new/Integrations.svg +3 -0
- package/src/assets/icons_new/KI.svg +13 -0
- package/src/assets/icons_new/Key Link.svg +12 -0
- package/src/assets/icons_new/Key.svg +4 -0
- package/src/assets/icons_new/No Login.svg +10 -0
- package/src/assets/icons_new/Page FWD.svg +4 -0
- package/src/assets/icons_new/Plugins.svg +4 -0
- package/src/assets/icons_new/Policy.svg +13 -0
- package/src/assets/icons_new/Print.svg +11 -0
- package/src/assets/icons_new/Scripts.svg +4 -0
- package/src/assets/icons_new/Search.svg +3 -0
- package/src/assets/icons_new/Security Objects.svg +5 -0
- package/src/assets/icons_new/Services.svg +10 -0
- package/src/assets/icons_new/Settings.svg +12 -0
- package/src/assets/icons_new/Solutions.svg +3 -0
- package/src/assets/icons_new/Tasks.svg +10 -0
- package/src/assets/icons_new/User Account.svg +3 -0
- package/src/assets/icons_new/Users.svg +10 -0
- package/src/assets/icons_new/Workflows.svg +11 -0
- package/src/assets/icons_old/_icons.ts +172 -0
- package/src/assets/icons_old/account.svg +4 -0
- package/src/assets/icons_old/accounts.svg +4 -0
- package/src/assets/icons_old/add.svg +4 -0
- package/src/assets/icons_old/alert.svg +4 -0
- package/src/assets/icons_old/app.svg +4 -0
- package/src/assets/icons_old/arrow-drop-down.svg +4 -0
- package/src/assets/icons_old/arrow-drop-up.svg +4 -0
- package/src/assets/icons_old/arrow-expand.svg +4 -0
- package/src/assets/icons_old/arrow-left.svg +5 -0
- package/src/assets/icons_old/arrow-right.svg +4 -0
- package/src/assets/icons_old/audit-log.svg +4 -0
- package/src/assets/icons_old/bell.svg +4 -0
- package/src/assets/icons_old/billing.svg +4 -0
- package/src/assets/icons_old/bug.svg +4 -0
- package/src/assets/icons_old/builds.svg +4 -0
- package/src/assets/icons_old/calendar.svg +4 -0
- package/src/assets/icons_old/certificate.svg +4 -0
- package/src/assets/icons_old/check.svg +4 -0
- package/src/assets/icons_old/checkbox-checked.svg +4 -0
- package/src/assets/icons_old/checkbox-disabled.svg +4 -0
- package/src/assets/icons_old/checkbox-unchecked.svg +4 -0
- package/src/assets/icons_old/chevron-left.svg +4 -0
- package/src/assets/icons_old/chevron-right.svg +4 -0
- package/src/assets/icons_old/clear-all.svg +4 -0
- package/src/assets/icons_old/color-picker.svg +10 -0
- package/src/assets/icons_old/connection.svg +4 -0
- package/src/assets/icons_old/copy.svg +4 -0
- package/src/assets/icons_old/cross-thin.svg +4 -0
- package/src/assets/icons_old/cross.svg +4 -0
- package/src/assets/icons_old/crypto-policy.svg +4 -0
- package/src/assets/icons_old/customers.svg +4 -0
- package/src/assets/icons_old/dashboard.svg +4 -0
- package/src/assets/icons_old/data-center.svg +4 -0
- package/src/assets/icons_old/data-connector-read.svg +6 -0
- package/src/assets/icons_old/data-connector-write.svg +6 -0
- package/src/assets/icons_old/dataset.svg +3 -0
- package/src/assets/icons_old/dataverse.svg +6 -0
- package/src/assets/icons_old/delete.svg +4 -0
- package/src/assets/icons_old/deployment-deployed.svg +4 -0
- package/src/assets/icons_old/deployment-none.svg +4 -0
- package/src/assets/icons_old/derive.svg +4 -0
- package/src/assets/icons_old/docs.svg +4 -0
- package/src/assets/icons_old/document-blank.svg +4 -0
- package/src/assets/icons_old/domain.svg +4 -0
- package/src/assets/icons_old/download-cloud.svg +4 -0
- package/src/assets/icons_old/download.svg +4 -0
- package/src/assets/icons_old/edit-params.svg +4 -0
- package/src/assets/icons_old/edit.svg +4 -0
- package/src/assets/icons_old/em-app.svg +4 -0
- package/src/assets/icons_old/em-dashboard.svg +4 -0
- package/src/assets/icons_old/email.svg +4 -0
- package/src/assets/icons_old/empty-credential.svg +4 -0
- package/src/assets/icons_old/enterprise-badge.svg +6 -0
- package/src/assets/icons_old/environment-production.svg +4 -0
- package/src/assets/icons_old/environment-test.svg +4 -0
- package/src/assets/icons_old/event-critical.svg +4 -0
- package/src/assets/icons_old/event-error.svg +4 -0
- package/src/assets/icons_old/event-success.svg +4 -0
- package/src/assets/icons_old/event-warning.svg +4 -0
- package/src/assets/icons_old/expiration.svg +4 -0
- package/src/assets/icons_old/export.svg +4 -0
- package/src/assets/icons_old/external.svg +4 -0
- package/src/assets/icons_old/eye-closed.svg +4 -0
- package/src/assets/icons_old/eye.svg +4 -0
- package/src/assets/icons_old/file.svg +7 -0
- package/src/assets/icons_old/flag.svg +4 -0
- package/src/assets/icons_old/forbid.svg +4 -0
- package/src/assets/icons_old/fortanix-app-aci.svg +6 -0
- package/src/assets/icons_old/fortanix-app-edp.svg +4 -0
- package/src/assets/icons_old/fortanix-app-enclave-os.svg +4 -0
- package/src/assets/icons_old/frame-expand.svg +4 -0
- package/src/assets/icons_old/fresh.svg +4 -0
- package/src/assets/icons_old/generated.svg +4 -0
- package/src/assets/icons_old/gift.svg +4 -0
- package/src/assets/icons_old/global.svg +4 -0
- package/src/assets/icons_old/group.svg +4 -0
- package/src/assets/icons_old/help.svg +4 -0
- package/src/assets/icons_old/home-info.svg +5 -0
- package/src/assets/icons_old/home.svg +4 -0
- package/src/assets/icons_old/horizontal-collapse.svg +5 -0
- package/src/assets/icons_old/horizontal-expand.svg +5 -0
- package/src/assets/icons_old/hsm.svg +4 -0
- package/src/assets/icons_old/info.svg +4 -0
- package/src/assets/icons_old/install.svg +4 -0
- package/src/assets/icons_old/integration.svg +7 -0
- package/src/assets/icons_old/key-clone.svg +4 -0
- package/src/assets/icons_old/key-custodian-policy.svg +10 -0
- package/src/assets/icons_old/key-destroy.svg +4 -0
- package/src/assets/icons_old/key-download.svg +4 -0
- package/src/assets/icons_old/key-justification-policy.svg +5 -0
- package/src/assets/icons_old/key-link.svg +4 -0
- package/src/assets/icons_old/key-metadata-policy.svg +5 -0
- package/src/assets/icons_old/key-primary.svg +11 -0
- package/src/assets/icons_old/key-remove.svg +4 -0
- package/src/assets/icons_old/key-rotation.svg +4 -0
- package/src/assets/icons_old/key-undo-policy.svg +10 -0
- package/src/assets/icons_old/key-wrapping.svg +6 -0
- package/src/assets/icons_old/key.svg +4 -0
- package/src/assets/icons_old/leave-account.svg +4 -0
- package/src/assets/icons_old/link.svg +4 -0
- package/src/assets/icons_old/lock-closed.svg +4 -0
- package/src/assets/icons_old/lock.svg +4 -0
- package/src/assets/icons_old/locked-user.svg +4 -0
- package/src/assets/icons_old/marketplace.svg +4 -0
- package/src/assets/icons_old/minus.svg +4 -0
- package/src/assets/icons_old/monitoring.svg +4 -0
- package/src/assets/icons_old/no-logging.svg +4 -0
- package/src/assets/icons_old/node-cluster.svg +4 -0
- package/src/assets/icons_old/node.svg +4 -0
- package/src/assets/icons_old/operations.svg +13 -0
- package/src/assets/icons_old/options.svg +4 -0
- package/src/assets/icons_old/play.svg +4 -0
- package/src/assets/icons_old/plug.svg +4 -0
- package/src/assets/icons_old/plugin-clone.svg +4 -0
- package/src/assets/icons_old/plugin.svg +4 -0
- package/src/assets/icons_old/plugins.svg +4 -0
- package/src/assets/icons_old/pod.svg +4 -0
- package/src/assets/icons_old/print.svg +4 -0
- package/src/assets/icons_old/projects.svg +11 -0
- package/src/assets/icons_old/python.svg +4 -0
- package/src/assets/icons_old/quorum.svg +4 -0
- package/src/assets/icons_old/refresh.svg +4 -0
- package/src/assets/icons_old/regenerate.svg +4 -0
- package/src/assets/icons_old/region.svg +4 -0
- package/src/assets/icons_old/reports.svg +3 -0
- package/src/assets/icons_old/request-approve.svg +4 -0
- package/src/assets/icons_old/request-decline.svg +4 -0
- package/src/assets/icons_old/reseller.svg +4 -0
- package/src/assets/icons_old/script.svg +7 -0
- package/src/assets/icons_old/search.svg +4 -0
- package/src/assets/icons_old/service-account.svg +4 -0
- package/src/assets/icons_old/settings.svg +4 -0
- package/src/assets/icons_old/sidebar-closed.svg +8 -0
- package/src/assets/icons_old/sidebar-open.svg +8 -0
- package/src/assets/icons_old/sign-out.svg +4 -0
- package/src/assets/icons_old/sign.svg +4 -0
- package/src/assets/icons_old/software.svg +4 -0
- package/src/assets/icons_old/sql-aggregate.svg +7 -0
- package/src/assets/icons_old/sql.svg +7 -0
- package/src/assets/icons_old/stack.svg +4 -0
- package/src/assets/icons_old/star-empty.svg +4 -0
- package/src/assets/icons_old/star-fill.svg +4 -0
- package/src/assets/icons_old/subscription.svg +5 -0
- package/src/assets/icons_old/support.svg +11 -0
- package/src/assets/icons_old/switcher.svg +4 -0
- package/src/assets/icons_old/sysadmin.svg +4 -0
- package/src/assets/icons_old/tag.svg +4 -0
- package/src/assets/icons_old/target.svg +4 -0
- package/src/assets/icons_old/tasks.svg +4 -0
- package/src/assets/icons_old/tfa-user.svg +4 -0
- package/src/assets/icons_old/tfa.svg +4 -0
- package/src/assets/icons_old/tokenization.svg +4 -0
- package/src/assets/icons_old/tools.svg +4 -0
- package/src/assets/icons_old/transition-from.svg +4 -0
- package/src/assets/icons_old/transition-to.svg +4 -0
- package/src/assets/icons_old/upload.svg +4 -0
- package/src/assets/icons_old/user-remove.svg +3 -0
- package/src/assets/icons_old/user.svg +4 -0
- package/src/assets/icons_old/view-type-cards.svg +4 -0
- package/src/assets/icons_old/view-type-list.svg +4 -0
- package/src/assets/icons_old/view-type-table.svg +4 -0
- package/src/assets/icons_old/warning.svg +4 -0
- package/src/assets/icons_old/workflow.svg +3 -0
- package/src/assets/icons_old/wrap.svg +4 -0
- package/src/assets/icons_old/wrench.svg +4 -0
- package/src/assets/images/fortanix_logo_icon.svg +20 -0
- package/src/components/actions/Button/Button.module.scss +81 -0
- package/src/components/actions/Button/Button.stories.tsx +262 -0
- package/src/components/actions/Button/Button.tsx +133 -0
- package/src/components/actions/ButtonAsLink/ButtonAsLink.module.scss +13 -0
- package/src/components/actions/ButtonAsLink/ButtonAsLink.stories.tsx +49 -0
- package/src/components/actions/ButtonAsLink/ButtonAsLink.tsx +56 -0
- package/src/components/actions/Link/Link.module.scss +38 -0
- package/src/components/actions/Link/Link.stories.tsx +54 -0
- package/src/components/actions/Link/Link.tsx +59 -0
- package/src/components/actions/LinkAsButton/LinkAsButton.stories.tsx +70 -0
- package/src/components/actions/LinkAsButton/LinkAsButton.tsx +59 -0
- package/src/components/containers/Alert/Alert.module.scss +41 -0
- package/src/components/containers/Alert/Alert.stories.tsx +47 -0
- package/src/components/containers/Alert/Alert.tsx +65 -0
- package/src/components/containers/Banner/Banner.module.scss +100 -0
- package/src/components/containers/Banner/Banner.stories.tsx +198 -0
- package/src/components/containers/Banner/Banner.tsx +121 -0
- package/src/components/containers/Card/Card.module.scss +32 -0
- package/src/components/containers/Card/Card.stories.tsx +67 -0
- package/src/components/containers/Card/Card.tsx +48 -0
- package/src/components/containers/Dialog/Dialog.module.scss +166 -0
- package/src/components/containers/Dialog/Dialog.stories.tsx +32 -0
- package/src/components/containers/Dialog/Dialog.tsx +130 -0
- package/src/components/containers/Panel/Panel.module.scss +32 -0
- package/src/components/containers/Panel/Panel.stories.tsx +46 -0
- package/src/components/containers/Panel/Panel.tsx +48 -0
- package/src/components/forms/context/Form/Form.module.scss +11 -0
- package/src/components/forms/context/Form/Form.stories.tsx +99 -0
- package/src/components/forms/context/Form/Form.tsx +106 -0
- package/src/components/forms/context/Form/FormOptics.tsx +109 -0
- package/src/components/forms/context/SubmitButton/SubmitButton.module.scss +9 -0
- package/src/components/forms/context/SubmitButton/SubmitButton.stories.tsx +132 -0
- package/src/components/forms/context/SubmitButton/SubmitButton.tsx +98 -0
- package/src/components/forms/controls/Checkbox/Checkbox.module.scss +67 -0
- package/src/components/forms/controls/Checkbox/Checkbox.stories.tsx +119 -0
- package/src/components/forms/controls/Checkbox/Checkbox.tsx +53 -0
- package/src/components/forms/controls/Input/Input.module.scss +40 -0
- package/src/components/forms/controls/Input/Input.stories.tsx +55 -0
- package/src/components/forms/controls/Input/Input.tsx +44 -0
- package/src/components/forms/controls/SegmentedControl/SegmentedControl.module.scss +76 -0
- package/src/components/forms/controls/SegmentedControl/SegmentedControl.stories.tsx +92 -0
- package/src/components/forms/controls/SegmentedControl/SegmentedControl.tsx +103 -0
- package/src/components/forms/controls/Select/Select.module.scss +105 -0
- package/src/components/forms/controls/Select/Select.stories.tsx +43 -0
- package/src/components/forms/controls/Select/Select.tsx +166 -0
- package/src/components/forms/controls/Switch/Switch.module.scss +63 -0
- package/src/components/forms/controls/Switch/Switch.stories.tsx +50 -0
- package/src/components/forms/controls/Switch/Switch.tsx +46 -0
- package/src/components/forms/fields/CheckboxField/CheckboxField.module.scss +46 -0
- package/src/components/forms/fields/CheckboxField/CheckboxField.stories.tsx +74 -0
- package/src/components/forms/fields/CheckboxField/CheckboxField.tsx +118 -0
- package/src/components/forms/fields/CheckboxGroup/CheckboxGroup.module.scss +22 -0
- package/src/components/forms/fields/CheckboxGroup/CheckboxGroup.stories.tsx +36 -0
- package/src/components/forms/fields/CheckboxGroup/CheckboxGroup.tsx +37 -0
- package/src/components/forms/fields/InputField/InputField.module.scss +24 -0
- package/src/components/forms/fields/InputField/InputField.stories.tsx +57 -0
- package/src/components/forms/fields/InputField/InputField.tsx +72 -0
- package/src/components/graphics/Icon/Icon.module.scss +42 -0
- package/src/components/graphics/Icon/Icon.stories.tsx +67 -0
- package/src/components/graphics/Icon/Icon.tsx +50 -0
- package/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.module.scss +76 -0
- package/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.stories.tsx +101 -0
- package/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.tsx +91 -0
- package/src/components/graphics/ProgressBar/ProgressBar.module.scss +43 -0
- package/src/components/graphics/ProgressBar/ProgressBar.stories.tsx +70 -0
- package/src/components/graphics/ProgressBar/ProgressBar.tsx +58 -0
- package/src/components/graphics/Spinner/Spinner.module.scss +61 -0
- package/src/components/graphics/Spinner/Spinner.stories.tsx +56 -0
- package/src/components/graphics/Spinner/Spinner.tsx +41 -0
- package/src/components/lists/PropertyList/PropertyList.module.scss +33 -0
- package/src/components/lists/PropertyList/PropertyList.stories.tsx +45 -0
- package/src/components/lists/PropertyList/PropertyList.tsx +60 -0
- package/src/components/navigations/Stepper/Stepper.module.scss +88 -0
- package/src/components/navigations/Stepper/Stepper.stories.tsx +68 -0
- package/src/components/navigations/Stepper/Stepper.tsx +95 -0
- package/src/components/navigations/Tabs/Tabs.module.scss +71 -0
- package/src/components/navigations/Tabs/Tabs.stories.tsx +106 -0
- package/src/components/navigations/Tabs/Tabs.tsx +121 -0
- package/src/components/overlays/DropdownMenu/DropdownMenu.module.scss +113 -0
- package/src/components/overlays/DropdownMenu/DropdownMenu.stories.tsx +91 -0
- package/src/components/overlays/DropdownMenu/DropdownMenu.tsx +155 -0
- package/src/components/overlays/DropdownMenu/DropdownMenuProvider.module.scss +105 -0
- package/src/components/overlays/DropdownMenu/DropdownMenuProvider.stories.tsx +71 -0
- package/src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx +168 -0
- package/src/components/overlays/Modal/Modal.module.scss +185 -0
- package/src/components/overlays/Modal/Modal.stories.tsx +144 -0
- package/src/components/overlays/Modal/Modal.tsx +202 -0
- package/src/components/overlays/Toast/Toast.module.scss +123 -0
- package/src/components/overlays/Toast/Toast.stories.tsx +219 -0
- package/src/components/overlays/Toast/Toast.tsx +233 -0
- package/src/components/overlays/Toast/ToastyOverride.scss +27 -0
- package/src/components/overlays/Tooltip/Tooltip.module.scss +162 -0
- package/src/components/overlays/Tooltip/Tooltip.stories.tsx +115 -0
- package/src/components/overlays/Tooltip/Tooltip.tsx +75 -0
- package/src/components/overlays/Tooltip/TooltipProvider.stories.tsx +169 -0
- package/src/components/overlays/Tooltip/TooltipProvider.tsx +164 -0
- package/src/components/util/Clipboard/Clipboard.tsx +11 -0
- package/src/components/util/Popover/Popover.tsx +219 -0
- package/src/docs/Changelog.mdx +7 -0
- package/src/docs/Colors.mdx +113 -0
- package/src/docs/Colors.module.scss +56 -0
- package/src/docs/Iconography.mdx +70 -0
- package/src/docs/Iconography.module.scss +37 -0
- package/src/docs/Introduction.mdx +26 -0
- package/src/docs/Typography.mdx +109 -0
- package/src/docs/Typography.module.scss +22 -0
- package/src/layouts/AppLayout/AppLayout.module.scss +110 -0
- package/src/layouts/AppLayout/AppLayout.stories.tsx +112 -0
- package/src/layouts/AppLayout/AppLayout.tsx +31 -0
- package/src/layouts/AppLayout/Breadcrumbs/Breadcrumbs.module.scss +47 -0
- package/src/layouts/AppLayout/Breadcrumbs/Breadcrumbs.stories.tsx +66 -0
- package/src/layouts/AppLayout/Breadcrumbs/Breadcrumbs.tsx +63 -0
- package/src/layouts/AppLayout/Header/AccountSelector.module.scss +24 -0
- package/src/layouts/AppLayout/Header/AccountSelector.stories.tsx +31 -0
- package/src/layouts/AppLayout/Header/AccountSelector.tsx +51 -0
- package/src/layouts/AppLayout/Header/Header.module.scss +74 -0
- package/src/layouts/AppLayout/Header/Header.stories.tsx +30 -0
- package/src/layouts/AppLayout/Header/Header.tsx +31 -0
- package/src/layouts/AppLayout/Header/SolutionSelector.module.scss +24 -0
- package/src/layouts/AppLayout/Header/SolutionSelector.stories.tsx +31 -0
- package/src/layouts/AppLayout/Header/SolutionSelector.tsx +50 -0
- package/src/layouts/AppLayout/Header/UserMenu.module.scss +31 -0
- package/src/layouts/AppLayout/Header/UserMenu.stories.tsx +32 -0
- package/src/layouts/AppLayout/Header/UserMenu.tsx +67 -0
- package/src/layouts/AppLayout/Logo/Logo.module.scss +78 -0
- package/src/layouts/AppLayout/Logo/Logo.tsx +38 -0
- package/src/layouts/AppLayout/Nav/Nav.module.scss +73 -0
- package/src/layouts/AppLayout/Nav/Nav.stories.tsx +32 -0
- package/src/layouts/AppLayout/Nav/Nav.tsx +75 -0
- package/src/layouts/AppLayout/Sidebar/Sidebar.module.scss +46 -0
- package/src/layouts/AppLayout/Sidebar/Sidebar.stories.tsx +30 -0
- package/src/layouts/AppLayout/Sidebar/Sidebar.tsx +33 -0
- package/src/layouts/FormLayout/FormLayout.module.scss +19 -0
- package/src/layouts/FormLayout/FormLayout.stories.tsx +64 -0
- package/src/layouts/FormLayout/FormLayout.tsx +32 -0
- package/src/styling/accessibility.css +24 -0
- package/src/styling/context/theming.scss +26 -0
- package/src/styling/context/theming_mixins.scss +79 -0
- package/src/styling/defs.scss +60 -0
- package/src/styling/fonts.css +126 -0
- package/src/styling/fonts_mixins.scss +16 -0
- package/src/styling/global.scss +49 -0
- package/src/styling/lib/normalize.css +78 -0
- package/src/styling/lib/reset-custom.css +58 -0
- package/src/styling/lib/reset.css +115 -0
- package/src/styling/main.scss +29 -0
- package/src/styling/variables.css +18 -0
- package/src/styling/variables.scss +928 -0
- package/src/styling/variables.ts +64 -0
- package/src/types/globals.d.ts +14 -0
- package/src/types/vite-env.d.ts +1 -0
- package/src/typography/BodyText/BodyText.mixins.scss +224 -0
- package/src/typography/BodyText/BodyText.module.scss +28 -0
- package/src/typography/BodyText/BodyText.stories.tsx +109 -0
- package/src/typography/BodyText/BodyText.tsx +30 -0
- package/src/typography/Heading/Heading.mixins.scss +42 -0
- package/src/typography/Heading/Heading.module.scss +15 -0
- package/src/typography/Heading/Heading.stories.tsx +112 -0
- package/src/typography/Heading/Heading.tsx +57 -0
- package/src/util/componentUtil.ts +19 -0
- package/src/util/drag.ts +197 -0
- package/src/util/reactUtil.ts +40 -0
- package/src/util/storybook/OverflowTester.css +13 -0
- package/src/util/storybook/OverflowTester.tsx +30 -0
- package/src/util/time.ts +12 -0
- package/src/util/types.ts +8 -0
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
|
|
7
|
+
import {
|
|
8
|
+
type Side,
|
|
9
|
+
type Alignment,
|
|
10
|
+
type Placement,
|
|
11
|
+
autoUpdate,
|
|
12
|
+
offset,
|
|
13
|
+
shift,
|
|
14
|
+
limitShift,
|
|
15
|
+
flip,
|
|
16
|
+
arrow,
|
|
17
|
+
type ElementProps,
|
|
18
|
+
type UseFloatingOptions,
|
|
19
|
+
type FlipOptions,
|
|
20
|
+
type FloatingContext,
|
|
21
|
+
useFloating,
|
|
22
|
+
useRole,
|
|
23
|
+
useFocus,
|
|
24
|
+
useClick,
|
|
25
|
+
useDismiss,
|
|
26
|
+
useDelayGroup,
|
|
27
|
+
useHover,
|
|
28
|
+
useInteractions,
|
|
29
|
+
useTransitionStatus,
|
|
30
|
+
hide,
|
|
31
|
+
} from '@floating-ui/react';
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export { type Placement };
|
|
35
|
+
|
|
36
|
+
export type UsePopoverOptions = {
|
|
37
|
+
floatingUiOptions?: UseFloatingOptions,
|
|
38
|
+
floatingUiFlipOptions?: FlipOptions,
|
|
39
|
+
floatingUiInteractions?: (context: FloatingContext) => Array<undefined | ElementProps>,
|
|
40
|
+
action?: undefined | 'hover' | 'click',
|
|
41
|
+
placement?: undefined | Placement,
|
|
42
|
+
offset?: undefined | number,
|
|
43
|
+
enablePreciseTracking?: boolean, // Enable more precise tracking of the anchor, at the cost of performance
|
|
44
|
+
boundary?: undefined | Element,
|
|
45
|
+
arrowRef?: React.RefObject<Element>, // Reference to the arrow element, if any
|
|
46
|
+
hasDelayGroup?: undefined | boolean,
|
|
47
|
+
};
|
|
48
|
+
export const usePopover = (options: UsePopoverOptions = {}) => {
|
|
49
|
+
const optionsWithDefaults = {
|
|
50
|
+
...options,
|
|
51
|
+
floatingUiOptions: options.floatingUiOptions ?? {},
|
|
52
|
+
floatingUiFlipOptions: options.floatingUiFlipOptions ?? {},
|
|
53
|
+
floatingUiInteractions: options.floatingUiInteractions ?? (() => []),
|
|
54
|
+
action: options.action ?? 'click',
|
|
55
|
+
placement: options.placement ?? 'top',
|
|
56
|
+
offset: options.offset ?? 0,
|
|
57
|
+
enablePreciseTracking: options.enablePreciseTracking ?? false,
|
|
58
|
+
arrowRef: options.arrowRef ?? null,
|
|
59
|
+
hasDelayGroup: options.hasDelayGroup ?? false,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Memoize `action` to make sure it doesn't change, to prevent conditional use of hooks
|
|
63
|
+
const action = React.useMemo(() => optionsWithDefaults.action, []);
|
|
64
|
+
|
|
65
|
+
const middleware: UseFloatingOptions['middleware'] = [
|
|
66
|
+
offset(optionsWithDefaults.offset),
|
|
67
|
+
flip({
|
|
68
|
+
fallbackAxisSideDirection: 'end',
|
|
69
|
+
//fallbackStrategy: 'initialPlacement',
|
|
70
|
+
crossAxis: false, // Useful with `shift()`, see: https://floating-ui.com/docs/flip
|
|
71
|
+
...(optionsWithDefaults.boundary ? { boundary: optionsWithDefaults.boundary } : {}),
|
|
72
|
+
...optionsWithDefaults.floatingUiFlipOptions,
|
|
73
|
+
}),
|
|
74
|
+
shift({
|
|
75
|
+
limiter: limitShift({ offset: 10 }),
|
|
76
|
+
...(optionsWithDefaults.boundary ? { boundary: optionsWithDefaults.boundary } : {}),
|
|
77
|
+
}),
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
if (action === 'hover') {
|
|
81
|
+
middleware.push(hide({
|
|
82
|
+
strategy: 'escaped',
|
|
83
|
+
...(optionsWithDefaults.boundary ? { boundary: optionsWithDefaults.boundary } : {}),
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
if (optionsWithDefaults.arrowRef) {
|
|
87
|
+
middleware.push(arrow({ element: optionsWithDefaults.arrowRef }));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
91
|
+
|
|
92
|
+
const { context, refs, placement, floatingStyles } = useFloating({
|
|
93
|
+
open: isOpen,
|
|
94
|
+
onOpenChange: setIsOpen,
|
|
95
|
+
placement: optionsWithDefaults.placement,
|
|
96
|
+
strategy: 'fixed', // Use `fixed` to contain within the viewport (as opposed to containing block with `absolute`)
|
|
97
|
+
whileElementsMounted(referenceEl, floatingEl, update) {
|
|
98
|
+
const cleanup = autoUpdate(referenceEl, floatingEl, update, {
|
|
99
|
+
animationFrame: optionsWithDefaults.enablePreciseTracking,
|
|
100
|
+
});
|
|
101
|
+
return cleanup;
|
|
102
|
+
},
|
|
103
|
+
...optionsWithDefaults.floatingUiOptions,
|
|
104
|
+
middleware: [
|
|
105
|
+
...middleware,
|
|
106
|
+
...(optionsWithDefaults.floatingUiOptions.middleware ?? []),
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Note: for `role="tooltip", no `aria-haspop` is necessary on the anchor because it is not interactive:
|
|
111
|
+
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup
|
|
112
|
+
const role = useRole(context, { role: 'tooltip' });
|
|
113
|
+
|
|
114
|
+
const interactions: Array<ElementProps> = [
|
|
115
|
+
role,
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
if (action === 'click') {
|
|
119
|
+
interactions.push(useClick(context, { toggle: true }));
|
|
120
|
+
interactions.push(useDismiss(context));
|
|
121
|
+
} else if (action === 'hover') {
|
|
122
|
+
interactions.push(useFocus(context));
|
|
123
|
+
const { delay: groupDelay } = useDelayGroup(context);
|
|
124
|
+
const delay = optionsWithDefaults.hasDelayGroup ? groupDelay : {
|
|
125
|
+
open: 500/*ms*/, // Fallback time to open after if the cursor never "rests"
|
|
126
|
+
close: 200/*ms*/, // Allows the user to move the cursor from anchor to tooltip without closing
|
|
127
|
+
};
|
|
128
|
+
interactions.push(useHover(context, {
|
|
129
|
+
restMs: 20/*ms*/, // User's cursor must be at rest before opening
|
|
130
|
+
delay,
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([
|
|
135
|
+
...interactions,
|
|
136
|
+
...optionsWithDefaults.floatingUiInteractions(context),
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
// Keep the tooltip mounted for a little while after close to allow exit animations to occur
|
|
140
|
+
const { isMounted } = useTransitionStatus(context, { duration: { open: 0, close: 500 } });
|
|
141
|
+
|
|
142
|
+
// Sync the `isOpen` state with browser `popover` state
|
|
143
|
+
React.useEffect(() => {
|
|
144
|
+
const floatingElement = refs.floating.current;
|
|
145
|
+
if (!floatingElement) { return; }
|
|
146
|
+
|
|
147
|
+
const isPopoverShown = floatingElement.matches(':popover-open');
|
|
148
|
+
if (isOpen && !isPopoverShown) {
|
|
149
|
+
floatingElement.showPopover();
|
|
150
|
+
} else if (!isOpen && isPopoverShown) {
|
|
151
|
+
floatingElement.hidePopover();
|
|
152
|
+
}
|
|
153
|
+
}, [isOpen, refs.floating]);
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
context,
|
|
157
|
+
isOpen,
|
|
158
|
+
setIsOpen,
|
|
159
|
+
isMounted,
|
|
160
|
+
refs,
|
|
161
|
+
placement,
|
|
162
|
+
floatingStyles,
|
|
163
|
+
getReferenceProps,
|
|
164
|
+
getFloatingProps,
|
|
165
|
+
getItemProps,
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
// Derived from:
|
|
171
|
+
// https://github.com/floating-ui/floating-ui/blob/master/packages/react/src/components/FloatingArrow.tsx
|
|
172
|
+
type PopoverArrowOptions = {
|
|
173
|
+
context: FloatingContext,
|
|
174
|
+
// Forces a static offset over dynamic positioning under a certain condition.
|
|
175
|
+
staticOffset?: string | number | null;
|
|
176
|
+
};
|
|
177
|
+
type PopoverArrowResult = null | {
|
|
178
|
+
side: Side,
|
|
179
|
+
arrowX: undefined | number | string,
|
|
180
|
+
arrowY: undefined | number | string,
|
|
181
|
+
};
|
|
182
|
+
export const usePopoverArrow = (options: PopoverArrowOptions): PopoverArrowResult => {
|
|
183
|
+
const {
|
|
184
|
+
context: {
|
|
185
|
+
placement,
|
|
186
|
+
elements: { floating },
|
|
187
|
+
middlewareData: { arrow },
|
|
188
|
+
},
|
|
189
|
+
staticOffset,
|
|
190
|
+
} = options;
|
|
191
|
+
|
|
192
|
+
if (!floating) { return null; }
|
|
193
|
+
|
|
194
|
+
const [tooltopSide, tooltipAlignment] = placement.split('-') as [Side, Alignment];
|
|
195
|
+
// const isVerticalSide = side === 'top' || side === 'bottom';
|
|
196
|
+
//
|
|
197
|
+
// const isRTL = platform.isRTL(floating);
|
|
198
|
+
// const yOffsetProp = staticOffset && alignment === 'end' ? 'bottom' : 'top';
|
|
199
|
+
// let xOffsetProp = staticOffset && alignment === 'end' ? 'right' : 'left';
|
|
200
|
+
// if (staticOffset && isRTL) {
|
|
201
|
+
// xOffsetProp = alignment === 'end' ? 'left' : 'right';
|
|
202
|
+
// }
|
|
203
|
+
|
|
204
|
+
const invertSide = (side: Side) => {
|
|
205
|
+
switch (side) {
|
|
206
|
+
case 'top': return 'bottom';
|
|
207
|
+
case 'bottom': return 'top';
|
|
208
|
+
case 'left': return 'right';
|
|
209
|
+
case 'right': return 'left';
|
|
210
|
+
default: return side;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
return {
|
|
215
|
+
side: invertSide(tooltopSide),
|
|
216
|
+
arrowX: staticOffset || (typeof arrow?.x === 'number' ? `${arrow.x}px` : undefined),
|
|
217
|
+
arrowY: staticOffset || (typeof arrow?.y === 'number' ? `${arrow.y}px` : undefined),
|
|
218
|
+
};
|
|
219
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
|
|
2
|
+
import cx from 'classnames/dedupe';
|
|
3
|
+
import { Meta, Unstyled } from '@storybook/blocks';
|
|
4
|
+
|
|
5
|
+
import colorContrast from 'postcss-color-contrast/js';
|
|
6
|
+
import { colorsByCategory } from '../styling/variables.ts';
|
|
7
|
+
|
|
8
|
+
import { H4, H5 } from '../typography/Heading/Heading.tsx';
|
|
9
|
+
import { TooltipProvider } from '../components/overlays/Tooltip/TooltipProvider.tsx';
|
|
10
|
+
import { Panel } from '../components/containers/Panel/Panel.tsx';
|
|
11
|
+
|
|
12
|
+
import cl from './Colors.module.scss';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<Meta title="Docs/Colors"/>
|
|
16
|
+
|
|
17
|
+
# Colors
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
All color tokens are available as static variables of the form `bk.$color-<token>`.
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
.my-component {
|
|
25
|
+
color: bk.$color-neutral-500;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Primitive Color Tokens
|
|
30
|
+
|
|
31
|
+
Primitive color tokens are the basic color definitions which are not dependent on any particular theme or semantics. Other color tokens may be defined in terms of these.
|
|
32
|
+
|
|
33
|
+
<Unstyled>
|
|
34
|
+
<div className={cl['primitive-colors']}>
|
|
35
|
+
{Object.entries(colorsByCategory).map(([colorCategoryName, colorCategory]) =>
|
|
36
|
+
<section key={colorCategoryName} className={cl['color-category']}>
|
|
37
|
+
<H4>{colorCategoryName}</H4>
|
|
38
|
+
<dl className={cl['colors-list']}>
|
|
39
|
+
{Object.entries(colorCategory).map(([colorName, { weight, color }]) =>
|
|
40
|
+
<TooltipProvider key={colorName} tooltip={<code className="bk-body-text">{`bk.$color-${colorName}`}</code>}>
|
|
41
|
+
<div className={cl['color']} tabIndex="1"
|
|
42
|
+
style={{ '--color': color, '--contrast': colorContrast(color, ['#e5e5e5', '#171717']) }}
|
|
43
|
+
>
|
|
44
|
+
<dt>{weight}</dt>
|
|
45
|
+
<dd>{color}</dd>
|
|
46
|
+
</div>
|
|
47
|
+
</TooltipProvider>
|
|
48
|
+
)}
|
|
49
|
+
</dl>
|
|
50
|
+
</section>
|
|
51
|
+
)}
|
|
52
|
+
</div>
|
|
53
|
+
</Unstyled>
|
|
54
|
+
|
|
55
|
+
{/*
|
|
56
|
+
## Spectrum (experiment)
|
|
57
|
+
|
|
58
|
+
{/* https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl * /}
|
|
59
|
+
[/* https://www.youtube.com/watch?v=gPacarD9NuA * /}
|
|
60
|
+
<section className={cl['color-category']}>
|
|
61
|
+
<dl className={cx(cl['colors-list'], cl['color-spectrum'])} style={{ '--item-size': '4rem', gap: 0 }}>
|
|
62
|
+
{Array.from({ length: 10 }).map((_, i) =>
|
|
63
|
+
<div key={i} className={cl['color']} style={{ background: `oklab(calc(20% + ${i/9} * 60%) -50% 0)` }}>
|
|
64
|
+
<dt></dt>
|
|
65
|
+
<dd></dd>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
</dl>
|
|
69
|
+
<dl className={cx(cl['colors-list'], cl['color-spectrum'])} style={{ '--item-size': '4rem', gap: 0 }}>
|
|
70
|
+
{Array.from({ length: 10 }).map((_, i) =>
|
|
71
|
+
<div key={i} className={cl['color']} style={{ background: `oklab(calc(20% + ${i/9} * 60%) 0% -60%)` }}>
|
|
72
|
+
<dt></dt>
|
|
73
|
+
<dd></dd>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</dl>
|
|
77
|
+
<dl className={cx(cl['colors-list'], cl['color-spectrum'])} style={{ '--item-size': '4rem', gap: 0 }}>
|
|
78
|
+
{Array.from({ length: 10 }).map((_, i) =>
|
|
79
|
+
<div key={i} className={cl['color']} style={{ background: `oklab(calc(20% + ${i/9} * 60%) 0% 0%)` }}>
|
|
80
|
+
<dt></dt>
|
|
81
|
+
<dd></dd>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
</dl>
|
|
85
|
+
</section>
|
|
86
|
+
*/}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## Theming
|
|
90
|
+
|
|
91
|
+
Baklava supports both light and dark themes. By default, the user's preferred color scheme is chosen.
|
|
92
|
+
|
|
93
|
+
<Unstyled>
|
|
94
|
+
<div className={cl['theme-demo']}>
|
|
95
|
+
<Panel className="bk-theme--dark">
|
|
96
|
+
<Panel.Heading>
|
|
97
|
+
This is a panel in dark theme: <code className="bk-body-text">.bk-theme--dark</code>
|
|
98
|
+
</Panel.Heading>
|
|
99
|
+
|
|
100
|
+
<Panel className="bk-theme--light">
|
|
101
|
+
<Panel.Heading>
|
|
102
|
+
This is a panel in light theme: <code className="bk-body-text">.bk-theme--light</code>
|
|
103
|
+
</Panel.Heading>
|
|
104
|
+
|
|
105
|
+
{/* XXX this doesn't work without `@scope`, light wins over dark due to the order in which they were defined
|
|
106
|
+
<Panel className="bk-theme--invert">
|
|
107
|
+
<Panel.Heading>This panel inverts the theme of the parent.</Panel.Heading>
|
|
108
|
+
</Panel>
|
|
109
|
+
*/}
|
|
110
|
+
</Panel>
|
|
111
|
+
</Panel>
|
|
112
|
+
</div>
|
|
113
|
+
</Unstyled>
|
|
@@ -0,0 +1,56 @@
|
|
|
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/context/theming_mixins.scss' as theming;
|
|
6
|
+
|
|
7
|
+
@layer storybook {
|
|
8
|
+
.primitive-colors {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 1lh;
|
|
12
|
+
|
|
13
|
+
.color-category {
|
|
14
|
+
.colors-list {
|
|
15
|
+
--item-size: 5rem;
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--item-size), 100%), 1fr));
|
|
18
|
+
gap: 2ch;
|
|
19
|
+
|
|
20
|
+
.color {
|
|
21
|
+
min-height: 4rem;
|
|
22
|
+
padding: 0.5rem;
|
|
23
|
+
background: var(--color);
|
|
24
|
+
border: 1px solid color-mix(in sRGB, var(--color) 90%, black);
|
|
25
|
+
box-shadow: 1px 1px 3px color-mix(in sRGB, var(--color) 90%, black);
|
|
26
|
+
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
justify-content: end;
|
|
30
|
+
|
|
31
|
+
color: black;
|
|
32
|
+
font-size: 0.8rem;
|
|
33
|
+
|
|
34
|
+
dt, dd {
|
|
35
|
+
all: unset;
|
|
36
|
+
/* color: color-contrast(var(--color) vs black, white); // Insufficient browser support */
|
|
37
|
+
/* color: white; mix-blend-mode: difference; */
|
|
38
|
+
|
|
39
|
+
color: var(--contrast);
|
|
40
|
+
}
|
|
41
|
+
dt {
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.color-spectrum .color {
|
|
47
|
+
background: color-mix(in sRGB, var(--color) calc(var(--lightness) / 9 * 100%), black);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.theme-demo {
|
|
54
|
+
@include theming.theme-invert;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
import cx from 'classnames/dedupe';
|
|
3
|
+
import { Meta, Unstyled, IconGallery, IconItem } from '@storybook/blocks';
|
|
4
|
+
|
|
5
|
+
import { TooltipProvider } from '../components/overlays/Tooltip/TooltipProvider.tsx';
|
|
6
|
+
import { icons } from '../assets/icons/_icons.ts';
|
|
7
|
+
import { Icon } from '../components/graphics/Icon/Icon.tsx';
|
|
8
|
+
|
|
9
|
+
import cl from './Iconography.module.scss';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<Meta title="Docs/Iconography"/>
|
|
13
|
+
|
|
14
|
+
# Iconography
|
|
15
|
+
|
|
16
|
+
Baklava comes with an icon pack using SVG sprite images. The `Icon` component is used to render a given icon by name:
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<Icon icon="assessment"/>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will render:
|
|
23
|
+
|
|
24
|
+
<Icon icon="assessment" style={{ fontSize: '2rem' }}/>
|
|
25
|
+
|
|
26
|
+
Icons by default will adapt to the current text styling. To resize an icon, change the `font-size` in CSS. Similarly, you can change the CSS `color` property to update the icon's color.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
|
|
31
|
+
<IconGallery>
|
|
32
|
+
{Object.keys(icons).map(iconName =>
|
|
33
|
+
<IconItem key={iconName} name={iconName}>
|
|
34
|
+
<Icon icon={iconName} className="icon"/>
|
|
35
|
+
</IconItem>
|
|
36
|
+
)}
|
|
37
|
+
</IconGallery>
|
|
38
|
+
|
|
39
|
+
{/*
|
|
40
|
+
<Unstyled>
|
|
41
|
+
<ul className={cl['icons-overview']}>
|
|
42
|
+
{Object.entries(icons).map(([iconName, iconDef]) =>
|
|
43
|
+
<TooltipProvider key={iconName} tooltip={iconName}>
|
|
44
|
+
<li><Icon icon={iconName} className="icon"/></li>
|
|
45
|
+
</TooltipProvider>
|
|
46
|
+
)}
|
|
47
|
+
</ul>
|
|
48
|
+
</Unstyled>
|
|
49
|
+
*/}
|
|
50
|
+
|
|
51
|
+
## Details
|
|
52
|
+
|
|
53
|
+
<table className={cl['icons-table']}>
|
|
54
|
+
<thead>
|
|
55
|
+
<tr>
|
|
56
|
+
<th>Name</th>
|
|
57
|
+
<th>Icon</th>
|
|
58
|
+
<th>Code</th>
|
|
59
|
+
</tr>
|
|
60
|
+
</thead>
|
|
61
|
+
<tbody>
|
|
62
|
+
{Object.entries(icons).map(([iconName, iconDef]) =>
|
|
63
|
+
<tr key={iconName}>
|
|
64
|
+
<td className={cx(cl['cell'], cl['cell-name'])}>{iconName}</td>
|
|
65
|
+
<td className={cx(cl['cell'], cl['cell-icon'])}><Icon icon={iconName}/></td>
|
|
66
|
+
<td className={cx(cl['cell'], cl['cell-code'])}><code>{`<Icon icon=${JSON.stringify(iconName)}/>`}</code></td>
|
|
67
|
+
</tr>
|
|
68
|
+
)}
|
|
69
|
+
</tbody>
|
|
70
|
+
</table>
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
@layer storybook {
|
|
6
|
+
.icons-overview {
|
|
7
|
+
max-width: 40rem;
|
|
8
|
+
margin-block: 1.2rem;
|
|
9
|
+
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-flow: row wrap;
|
|
12
|
+
gap: 0.8rem;
|
|
13
|
+
|
|
14
|
+
:global(.icon) {
|
|
15
|
+
font-size: 1.8em;
|
|
16
|
+
|
|
17
|
+
outline: 1px solid transparent;
|
|
18
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
19
|
+
transition: outline-color 200ms ease-in-out;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
:global(.icon) {
|
|
25
|
+
outline-color: color-mix(in sRGB, currentColor 10%, transparent);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.icons-table {
|
|
31
|
+
//.cell {}
|
|
32
|
+
|
|
33
|
+
.cell-icon {
|
|
34
|
+
font-size: 1.4em;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { Meta, Markdown } from '@storybook/blocks';
|
|
3
|
+
|
|
4
|
+
<Meta title="Docs/Introduction"/>
|
|
5
|
+
|
|
6
|
+
# Baklava,<br/>The Fortanix Design System
|
|
7
|
+
|
|
8
|
+
Baklava is the design system created by [Fortanix](https://fortanix.com) to build user interfaces. It provides the design guidelines and components to ensure a consistent user experience across our products and marketing material.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
1. Clone Baklava
|
|
14
|
+
```
|
|
15
|
+
git clone https://github.com/fortanix/baklava
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Install dependencies
|
|
19
|
+
```
|
|
20
|
+
npm run install-project
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. Run Baklava
|
|
24
|
+
```
|
|
25
|
+
npm start
|
|
26
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
import { Meta, Unstyled } from '@storybook/blocks';
|
|
3
|
+
import { linkTo } from '@storybook/addon-links';
|
|
4
|
+
|
|
5
|
+
import { fontSizes } from '../styling/variables.ts';
|
|
6
|
+
|
|
7
|
+
import * as Heading from '../typography/Heading/Heading.tsx';
|
|
8
|
+
import { ButtonAsLink } from '../components/actions/ButtonAsLink/ButtonAsLink.tsx';
|
|
9
|
+
|
|
10
|
+
import cl from './Typography.module.scss';
|
|
11
|
+
|
|
12
|
+
<Meta title="Docs/Typography"/>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Typography
|
|
16
|
+
|
|
17
|
+
## Font families
|
|
18
|
+
|
|
19
|
+
<div className={cl['font-family-list']}>
|
|
20
|
+
<table>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Font: <code>body</code></th>
|
|
24
|
+
</tr>
|
|
25
|
+
</thead>
|
|
26
|
+
<tbody>
|
|
27
|
+
{[400, 600,700].map(weight =>
|
|
28
|
+
<tr key={weight} style={{ fontFamily: 'Open Sans', fontWeight: weight, fontSize: fontSizes.m }}>
|
|
29
|
+
<td>Open Sans {weight}</td>
|
|
30
|
+
</tr>
|
|
31
|
+
)}
|
|
32
|
+
</tbody>
|
|
33
|
+
</table>
|
|
34
|
+
|
|
35
|
+
<table>
|
|
36
|
+
<thead>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>Font: <code>display</code></th>
|
|
39
|
+
</tr>
|
|
40
|
+
</thead>
|
|
41
|
+
<tbody>
|
|
42
|
+
{[100, 200, 300, 400, 500, 600, 700].map(weight =>
|
|
43
|
+
<tr key={weight} style={{ fontFamily: 'Montserrat', fontWeight: weight, fontSize: fontSizes.m }}>
|
|
44
|
+
<td>Montserrat {weight}</td>
|
|
45
|
+
</tr>
|
|
46
|
+
)}
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
<table>
|
|
50
|
+
<thead>
|
|
51
|
+
<tr>
|
|
52
|
+
<th>Font: <code>code</code></th>
|
|
53
|
+
</tr>
|
|
54
|
+
</thead>
|
|
55
|
+
<tbody>
|
|
56
|
+
{[400].map(weight =>
|
|
57
|
+
<tr key={weight} style={{ fontFamily: 'Source Code Pro', fontWeight: weight, fontSize: fontSizes.m }}>
|
|
58
|
+
<td>Source Code Pro {weight}</td>
|
|
59
|
+
</tr>
|
|
60
|
+
)}
|
|
61
|
+
</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Font sizes
|
|
67
|
+
|
|
68
|
+
Font sizes are defined in units of `rem`. The exact pixel value of `rem` varies, the table below lists an approximation
|
|
69
|
+
based on 1rem = 16px. Baklava sets a dynamic font size such that the actual font size changes slightly depending on the
|
|
70
|
+
width of the viewport: on smaller devices (e.g. mobile), font sizes will be smaller.
|
|
71
|
+
|
|
72
|
+
<div className={cl['font-size-list']}>
|
|
73
|
+
<table>
|
|
74
|
+
<thead>
|
|
75
|
+
<tr>
|
|
76
|
+
<th>Font size</th>
|
|
77
|
+
<th>Example text</th>
|
|
78
|
+
<th>rem</th>
|
|
79
|
+
<th>px (approximate)</th>
|
|
80
|
+
</tr>
|
|
81
|
+
</thead>
|
|
82
|
+
<tbody>
|
|
83
|
+
{Object.entries(fontSizes).map(([fontSizeName, fontSize]) =>
|
|
84
|
+
<tr key={fontSizeName}>
|
|
85
|
+
<td><code>bk.${fontSizeName}</code></td>
|
|
86
|
+
<td style={{ fontSize: `${fontSize.sizeInRem}rem` }}>This text has font size {fontSize.sizeQualifier}</td>
|
|
87
|
+
<td>{fontSize.sizeInRem}rem</td>
|
|
88
|
+
<td>~{(fontSize.sizeInRem * 16).toFixed(2)}px</td>
|
|
89
|
+
</tr>
|
|
90
|
+
)}
|
|
91
|
+
</tbody>
|
|
92
|
+
</table>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Headings
|
|
97
|
+
|
|
98
|
+
<Unstyled>
|
|
99
|
+
<Heading.H1>Heading 1</Heading.H1>
|
|
100
|
+
<Heading.H2>Heading 2</Heading.H2>
|
|
101
|
+
<Heading.H3>Heading 3</Heading.H3>
|
|
102
|
+
<Heading.H4>Heading 4</Heading.H4>
|
|
103
|
+
<Heading.H5>Heading 5</Heading.H5>
|
|
104
|
+
<Heading.H6>Heading 6</Heading.H6>
|
|
105
|
+
</Unstyled>
|
|
106
|
+
|
|
107
|
+
## See also
|
|
108
|
+
|
|
109
|
+
- <ButtonAsLink onClick={linkTo(`typography/BodyText`)}>Body text</ButtonAsLink>
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
@layer storybook {
|
|
6
|
+
.font-family-list {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-flow: row wrap;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
align-items: start;
|
|
11
|
+
|
|
12
|
+
> * {
|
|
13
|
+
min-width: fit-content;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.font-size-list {
|
|
18
|
+
tr {
|
|
19
|
+
line-height: 1.6; /* Override Storybook's fixed line-height */
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|