@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,46 @@
|
|
|
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-checkbox-field {
|
|
9
|
+
@include bk.component-base(bk-checkbox-field);
|
|
10
|
+
|
|
11
|
+
.bk-checkbox-field__title {
|
|
12
|
+
color: bk.$theme-text-label-default;
|
|
13
|
+
font-weight: bk.$font-weight-semibold;
|
|
14
|
+
margin-bottom: bk.$spacing-1;
|
|
15
|
+
|
|
16
|
+
.bk-checkbox-field__title__icon {
|
|
17
|
+
font-size: 18px;
|
|
18
|
+
margin-left: bk.$spacing-1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.bk-checkbox-field__title__optional {
|
|
22
|
+
font-size: bk.$font-size-xs;
|
|
23
|
+
font-weight: bk.$font-weight-regular;
|
|
24
|
+
margin-left: bk.$spacing-1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bk-checkbox-field__label {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bk-checkbox-field__label__content {
|
|
34
|
+
color: bk.$theme-text-label-default;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
position: relative;
|
|
37
|
+
margin-left: bk.$spacing-2;
|
|
38
|
+
top: -2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bk-checkbox-field__sublabel {
|
|
42
|
+
font-size: bk.$font-size-xs;
|
|
43
|
+
padding-left: 26px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -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
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
+
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
import { CheckboxField } from './CheckboxField.tsx';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
type CheckboxFieldArgs = React.ComponentProps<typeof CheckboxField>;
|
|
13
|
+
type Story = StoryObj<CheckboxFieldArgs>;
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
component: CheckboxField,
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'centered',
|
|
19
|
+
},
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
argTypes: {
|
|
22
|
+
},
|
|
23
|
+
args: {},
|
|
24
|
+
decorators: [
|
|
25
|
+
Story => <form onSubmit={event => { event.preventDefault(); }}><Story/></form>,
|
|
26
|
+
],
|
|
27
|
+
render: (args) => <CheckboxField {...args}/>,
|
|
28
|
+
} satisfies Meta<CheckboxFieldArgs>;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export const CheckboxFieldWithLabel: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
label: 'Label',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const CheckboxFieldWithLabelAndTitle: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
title: 'Title',
|
|
40
|
+
label: 'Label',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const CheckboxFieldWithLabelWithTitleWithTooltip: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
title: 'Title',
|
|
47
|
+
label: 'Label',
|
|
48
|
+
titleTooltip: 'This is a tooltip',
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const CheckboxFieldWithLabelWithTitleWithOptional: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
title: 'Title',
|
|
55
|
+
label: 'Label',
|
|
56
|
+
titleOptional: true,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const CheckboxFieldWithLabelWithTitleWithTooltipWithOptional: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
title: 'Title',
|
|
63
|
+
label: 'Label',
|
|
64
|
+
titleTooltip: 'This is a tooltip',
|
|
65
|
+
titleOptional: true,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const CheckboxFieldWithLabelAndSublabel: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
label: 'Label',
|
|
72
|
+
sublabel: 'Supporting copy',
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
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, type ClassNameArgument } from '../../../../util/componentUtil.ts';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Checkbox } from '../../controls/Checkbox/Checkbox.tsx';
|
|
9
|
+
import { Icon } from '../../../graphics/Icon/Icon.tsx';
|
|
10
|
+
import { TooltipProvider } from '../../../overlays/Tooltip/TooltipProvider.tsx';
|
|
11
|
+
|
|
12
|
+
import cl from './CheckboxField.module.scss';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export { cl as CheckboxFieldClassNames };
|
|
16
|
+
|
|
17
|
+
export type CheckboxFieldTitleProps = React.PropsWithChildren<{
|
|
18
|
+
className?: ClassNameArgument;
|
|
19
|
+
|
|
20
|
+
/** Whether to display the optional observation on title. */
|
|
21
|
+
titleOptional?: undefined | boolean,
|
|
22
|
+
|
|
23
|
+
/** An optional tooltip to be displayed on an info icon next to the title. */
|
|
24
|
+
titleTooltip?: undefined | string,
|
|
25
|
+
}>;
|
|
26
|
+
|
|
27
|
+
export const CheckboxFieldTitle = ({ className, children, titleOptional, titleTooltip }: CheckboxFieldTitleProps) => (
|
|
28
|
+
<h1 className={cx(
|
|
29
|
+
'bk',
|
|
30
|
+
cl['bk-checkbox-field__title'],
|
|
31
|
+
className,
|
|
32
|
+
)}>
|
|
33
|
+
{children}
|
|
34
|
+
{titleTooltip && (
|
|
35
|
+
<TooltipProvider tooltip={titleTooltip}>
|
|
36
|
+
<Icon icon="info" className={cl['bk-checkbox-field__title__icon']}/>
|
|
37
|
+
</TooltipProvider>
|
|
38
|
+
)}
|
|
39
|
+
{titleOptional && (
|
|
40
|
+
<small className={cl['bk-checkbox-field__title__optional']}>(Optional)</small>
|
|
41
|
+
)}
|
|
42
|
+
</h1>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export type CheckboxFieldProps = ComponentProps<'div'> & {
|
|
46
|
+
/** Whether this component should be unstyled. */
|
|
47
|
+
unstyled?: undefined | boolean,
|
|
48
|
+
|
|
49
|
+
/** A label to be displayed after the checkbox. */
|
|
50
|
+
label: string,
|
|
51
|
+
|
|
52
|
+
/** An optional supporting copy to be displayed under the label. */
|
|
53
|
+
sublabel?: undefined | string,
|
|
54
|
+
|
|
55
|
+
/** An optional title. */
|
|
56
|
+
title?: undefined | string,
|
|
57
|
+
|
|
58
|
+
/** An optional tooltip to be displayed on an info icon next to the title. */
|
|
59
|
+
titleTooltip?: undefined | string,
|
|
60
|
+
|
|
61
|
+
/** Whether to display the optional observation on title. */
|
|
62
|
+
titleOptional?: undefined | boolean,
|
|
63
|
+
|
|
64
|
+
/** Whether the checkbox is checked by default. Passed down to Checkbox component. */
|
|
65
|
+
defaultChecked?: undefined | boolean,
|
|
66
|
+
|
|
67
|
+
/** Whether the checkbox is checked. Passed down to Checkbox component. */
|
|
68
|
+
checked?: undefined | boolean,
|
|
69
|
+
|
|
70
|
+
/** Whether the checkbox is disabled. Passed down to Checkbox component. */
|
|
71
|
+
disabled?: undefined | boolean,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A full-fledged Checkbox field, with optional label, title, icon etc.
|
|
76
|
+
*/
|
|
77
|
+
export const CheckboxField = (props: CheckboxFieldProps) => {
|
|
78
|
+
const {
|
|
79
|
+
unstyled = false,
|
|
80
|
+
label = '',
|
|
81
|
+
sublabel,
|
|
82
|
+
title,
|
|
83
|
+
titleOptional,
|
|
84
|
+
titleTooltip,
|
|
85
|
+
className,
|
|
86
|
+
} = props;
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className={cx(
|
|
90
|
+
'bk',
|
|
91
|
+
{ [cl['bk-checkbox-field']]: !unstyled },
|
|
92
|
+
className,
|
|
93
|
+
)}>
|
|
94
|
+
{title && (
|
|
95
|
+
<CheckboxFieldTitle
|
|
96
|
+
titleOptional={titleOptional}
|
|
97
|
+
titleTooltip={titleTooltip}
|
|
98
|
+
>
|
|
99
|
+
{title}
|
|
100
|
+
</CheckboxFieldTitle>
|
|
101
|
+
)}
|
|
102
|
+
{/* biome ignore lint/a11y/noLabelWithoutControl: the `<Checkbox>` will resolve to an `<input>` */}
|
|
103
|
+
<label className={cl['bk-checkbox-field__label']}>
|
|
104
|
+
<Checkbox
|
|
105
|
+
checked={props.checked}
|
|
106
|
+
defaultChecked={props.defaultChecked}
|
|
107
|
+
disabled={props.disabled}
|
|
108
|
+
/>
|
|
109
|
+
<span className={cl['bk-checkbox-field__label__content']}>
|
|
110
|
+
{label}
|
|
111
|
+
</span>
|
|
112
|
+
</label>
|
|
113
|
+
{sublabel && (
|
|
114
|
+
<div className={cl['bk-checkbox-field__sublabel']}>{sublabel}</div>
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
@@ -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
|
+
@use '../../../../styling/defs.scss' as bk;
|
|
6
|
+
|
|
7
|
+
@layer baklava.components {
|
|
8
|
+
.bk-checkbox-group {
|
|
9
|
+
@include bk.component-base(bk-checkbox-group);
|
|
10
|
+
display: flex;
|
|
11
|
+
|
|
12
|
+
&.bk-checkbox-group--vertical {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
row-gap: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.bk-checkbox-group--horizontal {
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
column-gap: bk.$spacing-7;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
|
|
9
|
+
import { CheckboxGroup } from './CheckboxGroup.tsx';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
type CheckboxGroupArgs = React.ComponentProps<typeof CheckboxGroup>;
|
|
13
|
+
type Story = StoryObj<CheckboxGroupArgs>;
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
component: CheckboxGroup,
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'centered',
|
|
19
|
+
},
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
argTypes: {
|
|
22
|
+
},
|
|
23
|
+
render: (args) => <CheckboxGroup {...args}>
|
|
24
|
+
<CheckboxGroup.CheckboxField label='Label'/>
|
|
25
|
+
<CheckboxGroup.CheckboxField label='Label'/>
|
|
26
|
+
<CheckboxGroup.CheckboxField label='Label'/>
|
|
27
|
+
</CheckboxGroup>,
|
|
28
|
+
} satisfies Meta<CheckboxGroupArgs>;
|
|
29
|
+
|
|
30
|
+
export const CheckboxGroupVertical: Story = {};
|
|
31
|
+
|
|
32
|
+
export const CheckboxGroupHorizontal: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
direction: 'horizontal',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -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
|
+
import { classNames as cx } from '../../../../util/componentUtil.ts';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
|
|
8
|
+
import cl from './CheckboxGroup.module.scss';
|
|
9
|
+
|
|
10
|
+
import { CheckboxField } from '../CheckboxField/CheckboxField.tsx';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export { cl as CheckboxGroupClassNames };
|
|
14
|
+
|
|
15
|
+
export type CheckboxGroupProps = React.PropsWithChildren<{
|
|
16
|
+
direction?: undefined | "vertical" | "horizontal";
|
|
17
|
+
}>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Checkbox group component, wrapping multiple CheckboxField components vertically or horizontally.
|
|
21
|
+
*/
|
|
22
|
+
export const CheckboxGroup = Object.assign(
|
|
23
|
+
(props: CheckboxGroupProps) => {
|
|
24
|
+
const { children, direction = 'vertical' } = props;
|
|
25
|
+
return (
|
|
26
|
+
<div className={cx(
|
|
27
|
+
'bk',
|
|
28
|
+
cl['bk-checkbox-group'],
|
|
29
|
+
{ [cl['bk-checkbox-group--horizontal']]: direction === 'horizontal' },
|
|
30
|
+
{ [cl['bk-checkbox-group--vertical']]: direction === 'vertical' },
|
|
31
|
+
)}>
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
{ CheckboxField },
|
|
37
|
+
);
|
|
@@ -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-input-field {
|
|
9
|
+
@include bk.component-base(bk-input-field);
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: 6px;
|
|
14
|
+
|
|
15
|
+
.bk-input-field__label {
|
|
16
|
+
@include bk.font(bk.$font-family-body, bk.$font-weight-semibold);
|
|
17
|
+
cursor: default;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bk-input-field__control {
|
|
21
|
+
--empty: ; // Prevent empty class from being removed
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { delay } from '../../../../util/time.ts';
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
import { userEvent, fireEvent, within } from '@storybook/test';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
|
|
11
|
+
import { Form } from '../../context/Form/Form.tsx';
|
|
12
|
+
|
|
13
|
+
import { InputField } from './InputField.tsx';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
type InputArgs = React.ComponentProps<typeof InputField>;
|
|
17
|
+
type Story = StoryObj<InputArgs>;
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
component: InputField,
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: 'centered',
|
|
23
|
+
},
|
|
24
|
+
tags: ['autodocs'],
|
|
25
|
+
argTypes: {
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
label: 'Test',
|
|
29
|
+
placeholder: 'Example',
|
|
30
|
+
},
|
|
31
|
+
decorators: [
|
|
32
|
+
Story => <Form><Story/></Form>,
|
|
33
|
+
],
|
|
34
|
+
render: (args) => <InputField {...args}/>,
|
|
35
|
+
} satisfies Meta<InputArgs>;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export const Standard: Story = {
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const InvalidInput: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
required: true,
|
|
44
|
+
pattern: '\d+',
|
|
45
|
+
placeholder: 'Invalid input',
|
|
46
|
+
className: 'invalid',
|
|
47
|
+
},
|
|
48
|
+
async play({ canvasElement }) {
|
|
49
|
+
const canvas = within(canvasElement);
|
|
50
|
+
const input = canvas.getByPlaceholderText('Invalid input');
|
|
51
|
+
await delay(100);
|
|
52
|
+
await userEvent.type(input, 'invalid');
|
|
53
|
+
await delay(100);
|
|
54
|
+
await userEvent.keyboard('{Enter}');
|
|
55
|
+
await fireEvent.submit(input.closest('form')!);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
import { useFormStatus } from 'react-dom';
|
|
8
|
+
|
|
9
|
+
import { useFormContext } from '../../context/Form/Form.tsx';
|
|
10
|
+
import { Input } from '../../controls/Input/Input.tsx';
|
|
11
|
+
|
|
12
|
+
import cl from './InputField.module.scss';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export { cl as InputFieldClassNames };
|
|
16
|
+
|
|
17
|
+
export type InputFieldProps = ComponentProps<'input'> & {
|
|
18
|
+
/** Whether this component should be unstyled. */
|
|
19
|
+
unstyled?: undefined | boolean,
|
|
20
|
+
|
|
21
|
+
/** Label for the input. */
|
|
22
|
+
label?: undefined | React.ReactNode,
|
|
23
|
+
|
|
24
|
+
/** Props for the `<label>` element, if `label` is defined. */
|
|
25
|
+
labelProps?: undefined | ComponentProps<'label'>,
|
|
26
|
+
|
|
27
|
+
/** Props for the wrapper element. */
|
|
28
|
+
wrapperProps?: undefined | ComponentProps<'div'>,
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Input field.
|
|
32
|
+
*/
|
|
33
|
+
export const InputField = (props: InputFieldProps) => {
|
|
34
|
+
const {
|
|
35
|
+
unstyled = false,
|
|
36
|
+
label,
|
|
37
|
+
labelProps = {},
|
|
38
|
+
wrapperProps = {},
|
|
39
|
+
...inputProps
|
|
40
|
+
} = props;
|
|
41
|
+
|
|
42
|
+
const controlId = React.useId();
|
|
43
|
+
const formContext = useFormContext();
|
|
44
|
+
//const formStatus = useFormStatus();
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
{...wrapperProps}
|
|
49
|
+
className={cx(
|
|
50
|
+
'bk',
|
|
51
|
+
{ [cl['bk-input-field']]: !unstyled },
|
|
52
|
+
wrapperProps.className,
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
{label &&
|
|
56
|
+
<label
|
|
57
|
+
htmlFor={controlId}
|
|
58
|
+
{...labelProps}
|
|
59
|
+
className={cx(cl['bk-input-field__label'], labelProps.className)}
|
|
60
|
+
>
|
|
61
|
+
{label}
|
|
62
|
+
</label>
|
|
63
|
+
}
|
|
64
|
+
<Input
|
|
65
|
+
{...inputProps}
|
|
66
|
+
id={controlId}
|
|
67
|
+
form={formContext.formId}
|
|
68
|
+
className={cx(cl['bk-input-field__control'], inputProps.className)}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* Copyright (c) Fortanix, Inc.
|
|
2
|
+
|* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
|
|
3
|
+
|* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4
|
+
|
|
5
|
+
@use '../../../styling/defs.scss' as bk;
|
|
6
|
+
|
|
7
|
+
@layer baklava.components {
|
|
8
|
+
.bk-icon {
|
|
9
|
+
@include bk.component-base(bk-icon);
|
|
10
|
+
|
|
11
|
+
--bk-icon-accent-color: color-mix(in sRGB, currentColor 30%, transparent);
|
|
12
|
+
--bk-icon-size: 1em; /* TEMP: keep old size for now, until components are properly migrated */
|
|
13
|
+
|
|
14
|
+
box-sizing: content-box; /* Use content-box so that we can set a padding on an icon without it shrinking the width */
|
|
15
|
+
|
|
16
|
+
vertical-align: -25%; /* In inline flow, position the icon on the baseline, shifted downwards by 20% */
|
|
17
|
+
align-self: center;
|
|
18
|
+
flex: none; /* Prevent icons from shrinking or growing in flexbox */
|
|
19
|
+
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
width: var(--bk-icon-size);
|
|
22
|
+
aspect-ratio: 1 / 1.2;
|
|
23
|
+
fill: currentColor; /* Use the current font color by default */
|
|
24
|
+
|
|
25
|
+
/* By default, use a stroke width of `0`. Most icons rely on `fill` instead, because apps like IcoMoon rely on
|
|
26
|
+
`fill` to generate fonts from SVG. If we do have an icon with stroke then we at least want to set the color to
|
|
27
|
+
current. */
|
|
28
|
+
stroke: currentColor;
|
|
29
|
+
stroke-width: 0;
|
|
30
|
+
|
|
31
|
+
&.bk-icon--background-circle {
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
|
|
35
|
+
background: var(--bk-icon-accent-color);
|
|
36
|
+
padding: 12px;
|
|
37
|
+
aspect-ratio: 1;
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
overflow: visible; /* Prevent the border-radius from cutting off part of the icon */
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
|
|
9
|
+
import { Icon } from './Icon.tsx';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
type IconArgs = React.ComponentProps<typeof Icon>;
|
|
13
|
+
type Story = StoryObj<typeof Icon>;
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
component: Icon,
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'centered',
|
|
19
|
+
//design: { type: 'figma', url: '' },
|
|
20
|
+
},
|
|
21
|
+
decorators: [
|
|
22
|
+
Story => (
|
|
23
|
+
<div style={{ fontSize: '5rem' }}>
|
|
24
|
+
<Story/>
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
tags: ['autodocs'],
|
|
29
|
+
argTypes: {},
|
|
30
|
+
args: {
|
|
31
|
+
icon: 'dashboard',
|
|
32
|
+
},
|
|
33
|
+
render: args => (
|
|
34
|
+
<Icon {...args}/>
|
|
35
|
+
),
|
|
36
|
+
} satisfies Meta<IconArgs>;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export const Standard: Story = {
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Inline: Story = {
|
|
43
|
+
render: args => (
|
|
44
|
+
<article
|
|
45
|
+
style={{
|
|
46
|
+
maxWidth: '50rem',
|
|
47
|
+
fontSize: '1.6rem',
|
|
48
|
+
textAlign: 'center',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
flexDirection: 'column',
|
|
51
|
+
gap: '1lh',
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<p style={{ color: 'light-dark(#645EC3, #BDB9F3)' }}>
|
|
55
|
+
Icons <Icon {...args} icon="assessment"/> automatically adjust to the font size and color of the text.
|
|
56
|
+
</p>
|
|
57
|
+
<p>
|
|
58
|
+
Another icon <Icon {...args} icon="integrations" style={{ fontSize: '2em' }}/>, with a large size to
|
|
59
|
+
demonstrate vertical alignment within the text.
|
|
60
|
+
</p>
|
|
61
|
+
<p style={{ fontSize: '1em', display: 'flex', alignItems: 'center', gap: '0.5ch', textAlign: 'start' }}>
|
|
62
|
+
<Icon {...args} icon="info"/>
|
|
63
|
+
Use flex layout instead of inline if the icon should be aligned to anything other than baseline.
|
|
64
|
+
</p>
|
|
65
|
+
</article>
|
|
66
|
+
),
|
|
67
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { icons } from '../../../assets/icons/_icons.ts';
|
|
9
|
+
import cl from './Icon.module.scss';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export type IconName = keyof typeof icons;
|
|
13
|
+
export { cl as IconClassNames };
|
|
14
|
+
|
|
15
|
+
export type Decoration = (
|
|
16
|
+
| { type: 'background-circle' }
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export type IconProps = React.PropsWithChildren<ComponentProps<'svg'> & {
|
|
20
|
+
/** Whether this component should be unstyled. */
|
|
21
|
+
unstyled?: boolean,
|
|
22
|
+
|
|
23
|
+
/** The name of the icon to display */
|
|
24
|
+
icon: IconName,
|
|
25
|
+
|
|
26
|
+
/** The color to apply to the icon */
|
|
27
|
+
color?: undefined | string,
|
|
28
|
+
|
|
29
|
+
/** Visual decoration to apply */
|
|
30
|
+
decoration?: undefined | Decoration,
|
|
31
|
+
}>;
|
|
32
|
+
export const Icon = ({ unstyled, icon, color = 'currentColor', decoration, ...props }: IconProps) => {
|
|
33
|
+
const symbolId = `#baklava-icon-${icon}`;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<svg
|
|
37
|
+
role="img"
|
|
38
|
+
aria-label={`${icon} icon`}
|
|
39
|
+
aria-hidden // https://stackoverflow.com/questions/61048356/why-do-we-use-aria-hidden-with-icons
|
|
40
|
+
{...props}
|
|
41
|
+
className={cx({
|
|
42
|
+
bk: true,
|
|
43
|
+
[cl['bk-icon']]: !unstyled,
|
|
44
|
+
[cl['bk-icon--background-circle']]: decoration?.type === 'background-circle',
|
|
45
|
+
}, props.className)}
|
|
46
|
+
>
|
|
47
|
+
<use href={symbolId} fill={color}/>
|
|
48
|
+
</svg>
|
|
49
|
+
);
|
|
50
|
+
};
|