@fibery/ui-kit 1.34.8 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +3 -0
- package/.eslintrc +14 -0
- package/CHANGELOG.md +586 -0
- package/babel.config.js +3 -0
- package/config/jest/testFrameworkSetup.js +1 -0
- package/package.json +7 -41
- package/scripts/generate-icons.mjs +116 -0
- package/src/__mocks__/createInlineTheme.js +3 -0
- package/src/__mocks__/styleMock.js +1 -0
- package/src/a11y-color.ts +1 -1
- package/src/action-badge.tsx +63 -0
- package/src/actions-menu/actions-menu-sub-menu.tsx +3 -0
- package/src/actions-panel.tsx +50 -0
- package/src/ai/max-tokens.tsx +42 -0
- package/src/ai/model.tsx +79 -0
- package/src/ai/temperature.tsx +75 -0
- package/src/animated-height-container.tsx +82 -0
- package/src/animated-number.tsx +38 -0
- package/src/animations.tsx +62 -0
- package/src/antd/AutoComplete.d.ts +1 -0
- package/src/antd/AutoComplete.js +34 -0
- package/src/antd/Tabs.d.ts +5 -0
- package/src/antd/Tabs.js +58 -0
- package/src/antd/ant-modal.tsx +11 -0
- package/src/antd/ant-upload.tsx +73 -0
- package/src/antd/auto-width-transparent-textarea.tsx +56 -0
- package/src/antd/get-wrapper.tsx +11 -0
- package/src/antd/index.tsx +4 -0
- package/src/antd/input-number.tsx +51 -0
- package/src/antd/input.tsx +56 -0
- package/src/antd/styles.ts +6 -6
- package/src/antd/utils.tsx +43 -0
- package/src/app-icon-with-fallback.tsx +147 -0
- package/src/app-icon-wrapper.tsx +44 -0
- package/src/app-icon.tsx +52 -0
- package/src/app-mode.tsx +52 -0
- package/src/appIcons.json +13066 -0
- package/src/avatar.tsx +262 -0
- package/src/axis-header.tsx +160 -0
- package/src/badge.tsx +39 -0
- package/src/board-table-loader.tsx +106 -0
- package/src/box.tsx +444 -0
- package/src/breakpoints.tsx +59 -0
- package/src/button/base-button.tsx +1 -1
- package/src/button/icon-button.tsx +2 -2
- package/src/card-container.tsx +483 -0
- package/src/checkbox-multi-select.tsx +71 -0
- package/src/checkbox.tsx +232 -0
- package/src/collapsible/index.tsx +43 -0
- package/src/collapsible-section.tsx +69 -0
- package/src/color-picker/ColorPickerOrLoader.js +23 -0
- package/src/color-picker/SliderPointer.js +14 -0
- package/src/color-picker/index.js +118 -0
- package/src/color-picker/swatch.tsx +85 -0
- package/src/command-menu/index.tsx +176 -0
- package/src/comment.tsx +218 -0
- package/src/context-menu/index.tsx +134 -0
- package/src/copy-to-clipboard.ts +1 -0
- package/src/country-selector.tsx +29 -0
- package/src/date-picker/autocomplete.tsx +74 -0
- package/src/date-picker/constants.ts +3 -0
- package/src/date-picker/contexts.ts +7 -0
- package/src/date-picker/date-range-input.tsx +346 -0
- package/src/date-picker/date-range-picker-popup-content.tsx +190 -0
- package/src/date-picker/date-range-picker.tsx +124 -0
- package/src/date-picker/day-with-start-end-buttons.tsx +171 -0
- package/src/date-picker/fake-date-input.tsx +40 -0
- package/src/date-picker/get-weekends-for-month.ts +7 -0
- package/src/date-picker/rc-input-types.ts +11 -0
- package/src/date-picker/relative-date-picker.tsx +141 -0
- package/src/date-picker/single-date-input.tsx +239 -0
- package/src/date-picker/single-date-picker-popup-content.tsx +90 -0
- package/src/date-picker/single-date-picker.tsx +243 -0
- package/src/date-picker/styles.ts +262 -0
- package/src/date-picker/types.ts +56 -0
- package/src/date-picker/utils.ts +110 -0
- package/src/date-picker/with-popup-control.tsx +61 -0
- package/src/day-select/day-select.tsx +94 -0
- package/src/day-select/iso-week-day-select.tsx +15 -0
- package/src/day-select/mount-day-select.tsx +11 -0
- package/src/day-select/week-day-select.test.tsx +48 -0
- package/src/day-select/week-day-select.tsx +42 -0
- package/src/delayed.tsx +26 -0
- package/src/design-system.test.ts +24 -0
- package/src/design-system.ts +77 -39
- package/src/dnd.tsx +55 -0
- package/src/dropdown-menu/index.tsx +2 -3
- package/src/emoji-picker/app-icon-picker.tsx +1 -0
- package/src/emoji-picker/primitives/emoji.tsx +4 -2
- package/src/emoji-picker/primitives/render-config-provider.tsx +12 -0
- package/src/emoji.tsx +30 -0
- package/src/empty-state/empty-state-action.tsx +3 -0
- package/src/empty-state/empty-state-emoji.tsx +20 -0
- package/src/empty-state/empty-state.tsx +80 -0
- package/src/empty-value.tsx +21 -0
- package/src/errors.ts +29 -0
- package/src/favorites-icon.tsx +87 -0
- package/src/features.tsx +10 -0
- package/src/fibermoji-placeholder.tsx +180 -0
- package/src/field-container.tsx +213 -0
- package/src/file-item.tsx +151 -0
- package/src/form-utils.ts +7 -0
- package/src/format-date-from-now.ts +33 -0
- package/src/full-fibery-logo.tsx +26 -0
- package/src/get-trigger-node-popup-container.ts +7 -0
- package/src/guide-link.tsx +24 -0
- package/src/header-layout.tsx +33 -0
- package/src/hint.tsx +47 -0
- package/src/hoverable-via-display.tsx +29 -0
- package/src/hoverable.tsx +53 -0
- package/src/html-styles.ts +720 -0
- package/src/icons/ast/AccessTemplate.ts +8 -0
- package/src/icons/ast/AddDatabase.ts +8 -0
- package/src/icons/ast/AddIntegration.ts +8 -0
- package/src/icons/ast/AiSearch.ts +8 -0
- package/src/icons/ast/Asterisk.ts +8 -0
- package/src/icons/ast/Clean.ts +8 -0
- package/src/icons/ast/Copy.ts +1 -1
- package/src/icons/ast/CreditsFilled.ts +8 -0
- package/src/icons/ast/CrossCircle.ts +8 -0
- package/src/icons/ast/Duplicate.ts +1 -1
- package/src/icons/ast/Gift.ts +8 -0
- package/src/icons/ast/LevelPlus.ts +8 -0
- package/src/icons/ast/Markdown.ts +8 -0
- package/src/icons/ast/PeopleCheck.ts +8 -0
- package/src/icons/ast/PresentPlay.ts +8 -0
- package/src/icons/ast/PresentStop.ts +8 -0
- package/src/icons/ast/ResetPassword.ts +8 -0
- package/src/icons/ast/SettingsOff.ts +8 -0
- package/src/icons/ast/Template.ts +8 -0
- package/src/icons/ast/UserCheck.ts +8 -0
- package/src/icons/ast/UserGroupRemove.ts +8 -0
- package/src/icons/ast/UserX.ts +8 -0
- package/src/icons/ast/ViewGantt.ts +8 -0
- package/src/icons/ast/Views.ts +1 -1
- package/src/icons/ast/index.tsx +21 -0
- package/src/icons/react/AccessTemplate.tsx +13 -0
- package/src/icons/react/AddDatabase.tsx +13 -0
- package/src/icons/react/AddIntegration.tsx +13 -0
- package/src/icons/react/AiSearch.tsx +13 -0
- package/src/icons/react/Asterisk.tsx +13 -0
- package/src/icons/react/Clean.tsx +13 -0
- package/src/icons/react/CreditsFilled.tsx +13 -0
- package/src/icons/react/CrossCircle.tsx +13 -0
- package/src/icons/react/Gift.tsx +13 -0
- package/src/icons/react/LevelPlus.tsx +13 -0
- package/src/icons/react/Markdown.tsx +13 -0
- package/src/icons/react/PeopleCheck.tsx +13 -0
- package/src/icons/react/PresentPlay.tsx +13 -0
- package/src/icons/react/PresentStop.tsx +13 -0
- package/src/icons/react/ResetPassword.tsx +13 -0
- package/src/icons/react/SettingsOff.tsx +13 -0
- package/src/icons/react/Template.tsx +13 -0
- package/src/icons/react/UserCheck.tsx +13 -0
- package/src/icons/react/UserGroupRemove.tsx +13 -0
- package/src/icons/react/UserX.tsx +13 -0
- package/src/icons/react/ViewGantt.tsx +13 -0
- package/src/icons/react/index.tsx +21 -0
- package/src/icons/svg/abort.svg +3 -0
- package/src/icons/svg/access-template.svg +4 -0
- package/src/icons/svg/activity-log.svg +4 -0
- package/src/icons/svg/activity.svg +4 -0
- package/src/icons/svg/add-after.svg +4 -0
- package/src/icons/svg/add-before.svg +4 -0
- package/src/icons/svg/add-compact.svg +2 -0
- package/src/icons/svg/add-database.svg +3 -0
- package/src/icons/svg/add-group.svg +4 -0
- package/src/icons/svg/add-integration.svg +3 -0
- package/src/icons/svg/add-reactions.svg +8 -0
- package/src/icons/svg/add.svg +2 -0
- package/src/icons/svg/ai-assistant.svg +3 -0
- package/src/icons/svg/ai-avatar.svg +3 -0
- package/src/icons/svg/ai-search.svg +3 -0
- package/src/icons/svg/alert-triangle.svg +3 -0
- package/src/icons/svg/app-details.svg +7 -0
- package/src/icons/svg/app-store-one-color.svg +4 -0
- package/src/icons/svg/app-store.svg +4 -0
- package/src/icons/svg/app-templates.svg +7 -0
- package/src/icons/svg/app-webhooks.svg +2 -0
- package/src/icons/svg/app-wiki.svg +2 -0
- package/src/icons/svg/app.svg +2 -0
- package/src/icons/svg/appearance-auto.svg +3 -0
- package/src/icons/svg/appearance-dark.svg +3 -0
- package/src/icons/svg/appearance-light.svg +3 -0
- package/src/icons/svg/arrow-bar-left.svg +4 -0
- package/src/icons/svg/arrow-bar-right.svg +4 -0
- package/src/icons/svg/arrow-bottom.svg +3 -0
- package/src/icons/svg/arrow-collapse-vertical.svg +3 -0
- package/src/icons/svg/arrow-collapse.svg +3 -0
- package/src/icons/svg/arrow-forward.svg +3 -0
- package/src/icons/svg/arrow-left.svg +3 -0
- package/src/icons/svg/arrow-right.svg +3 -0
- package/src/icons/svg/arrow-top.svg +3 -0
- package/src/icons/svg/arrow-up-circle.svg +4 -0
- package/src/icons/svg/arrows-right-left.svg +3 -0
- package/src/icons/svg/ask-for-input.svg +6 -0
- package/src/icons/svg/asterisk.svg +3 -0
- package/src/icons/svg/atom.svg +4 -0
- package/src/icons/svg/automations-cancelled.svg +3 -0
- package/src/icons/svg/automations-disabled.svg +3 -0
- package/src/icons/svg/automations-error.svg +3 -0
- package/src/icons/svg/automations-in-progress.svg +3 -0
- package/src/icons/svg/automations-not-started.svg +3 -0
- package/src/icons/svg/automations-success.svg +3 -0
- package/src/icons/svg/back.svg +2 -0
- package/src/icons/svg/backlog-icon.svg +3 -0
- package/src/icons/svg/batch-actions-icon.svg +4 -0
- package/src/icons/svg/bell-circle.svg +4 -0
- package/src/icons/svg/bell-filled.svg +4 -0
- package/src/icons/svg/bell-off.svg +4 -0
- package/src/icons/svg/bell-ringing.svg +5 -0
- package/src/icons/svg/bell-x.svg +4 -0
- package/src/icons/svg/bolt.svg +3 -0
- package/src/icons/svg/bring-forward.svg +8 -0
- package/src/icons/svg/bring-to-front.svg +3 -0
- package/src/icons/svg/cards.svg +3 -0
- package/src/icons/svg/chat-ai.svg +5 -0
- package/src/icons/svg/chat.svg +3 -0
- package/src/icons/svg/check-circle-filled.svg +3 -0
- package/src/icons/svg/check-circle.svg +4 -0
- package/src/icons/svg/checked.svg +3 -0
- package/src/icons/svg/clean.svg +6 -0
- package/src/icons/svg/clear-input-filled.svg +3 -0
- package/src/icons/svg/clear-value.svg +6 -0
- package/src/icons/svg/clear.svg +6 -0
- package/src/icons/svg/clock-alarm.svg +6 -0
- package/src/icons/svg/clock-forward.svg +3 -0
- package/src/icons/svg/clock.svg +4 -0
- package/src/icons/svg/close.svg +4 -0
- package/src/icons/svg/collapse-all.svg +3 -0
- package/src/icons/svg/color-coding-filled.svg +3 -0
- package/src/icons/svg/color-coding.svg +4 -0
- package/src/icons/svg/columns-2.svg +3 -0
- package/src/icons/svg/columns-4.svg +3 -0
- package/src/icons/svg/columns.svg +3 -0
- package/src/icons/svg/comment-bubble.svg +3 -0
- package/src/icons/svg/copy.svg +5 -0
- package/src/icons/svg/create.svg +3 -0
- package/src/icons/svg/credits-filled.svg +3 -0
- package/src/icons/svg/cross-circle.svg +4 -0
- package/src/icons/svg/database-off.svg +3 -0
- package/src/icons/svg/database-stroke.svg +4 -0
- package/src/icons/svg/database.svg +4 -0
- package/src/icons/svg/delete.svg +6 -0
- package/src/icons/svg/demo.svg +2 -0
- package/src/icons/svg/dependency.svg +3 -0
- package/src/icons/svg/double-arrow-left.svg +2 -0
- package/src/icons/svg/double-arrow-right.svg +2 -0
- package/src/icons/svg/drag-block-handle-single.svg +5 -0
- package/src/icons/svg/drag-block-handle.svg +8 -0
- package/src/icons/svg/drag-handle.svg +2 -0
- package/src/icons/svg/duplicate.svg +5 -0
- package/src/icons/svg/dynamic-filter-value.svg +3 -0
- package/src/icons/svg/edit-value.svg +5 -0
- package/src/icons/svg/email.svg +3 -0
- package/src/icons/svg/emoji-delete.svg +5 -0
- package/src/icons/svg/entity-merge.svg +3 -0
- package/src/icons/svg/equation.svg +4 -0
- package/src/icons/svg/export.svg +4 -0
- package/src/icons/svg/extension/assignments.svg +7 -0
- package/src/icons/svg/extension/avatar.svg +2 -0
- package/src/icons/svg/extension/comments.svg +5 -0
- package/src/icons/svg/extension/files.svg +2 -0
- package/src/icons/svg/extension/references.svg +2 -0
- package/src/icons/svg/extension/workflow.svg +2 -0
- package/src/icons/svg/eye.svg +4 -0
- package/src/icons/svg/favorites-checked.svg +4 -0
- package/src/icons/svg/favorites-off.svg +4 -0
- package/src/icons/svg/favorites.svg +4 -0
- package/src/icons/svg/fibery-mono.svg +3 -0
- package/src/icons/svg/field-unit.svg +3 -0
- package/src/icons/svg/fields.svg +4 -0
- package/src/icons/svg/figma.svg +7 -0
- package/src/icons/svg/file-upload.svg +7 -0
- package/src/icons/svg/filter.svg +3 -0
- package/src/icons/svg/fit-to-screen.svg +5 -0
- package/src/icons/svg/focus-mode-off.svg +5 -0
- package/src/icons/svg/focus-mode.svg +5 -0
- package/src/icons/svg/folder.svg +4 -0
- package/src/icons/svg/form-with-cover.svg +7 -0
- package/src/icons/svg/form-without-cover.svg +6 -0
- package/src/icons/svg/fullscreen-mode-off-icon.svg +3 -0
- package/src/icons/svg/fullscreen-mode-on-icon.svg +3 -0
- package/src/icons/svg/fullscreen-mode-on.svg +4 -0
- package/src/icons/svg/gift.svg +3 -0
- package/src/icons/svg/github.svg +1 -0
- package/src/icons/svg/gitlab.svg +3 -0
- package/src/icons/svg/globe-simple.svg +3 -0
- package/src/icons/svg/globe.svg +3 -0
- package/src/icons/svg/go-to.svg +5 -0
- package/src/icons/svg/google-drive.svg +8 -0
- package/src/icons/svg/google-map.svg +7 -0
- package/src/icons/svg/headphones-ai.svg +4 -0
- package/src/icons/svg/headphones.svg +3 -0
- package/src/icons/svg/hide.svg +2 -0
- package/src/icons/svg/highlights.svg +3 -0
- package/src/icons/svg/hint.svg +4 -0
- package/src/icons/svg/home.svg +2 -0
- package/src/icons/svg/image-xmark.svg +2 -0
- package/src/icons/svg/import.svg +4 -0
- package/src/icons/svg/info-circle-filled.svg +3 -0
- package/src/icons/svg/info-circle.svg +6 -0
- package/src/icons/svg/integration.svg +2 -0
- package/src/icons/svg/integrations/integration-discourse-color.svg +8 -0
- package/src/icons/svg/integrations/integration-intercom-color.svg +3 -0
- package/src/icons/svg/integrations/integration-slack-color.svg +10 -0
- package/src/icons/svg/integrations/integration-zendesk-color.svg +6 -0
- package/src/icons/svg/invite-people.svg +6 -0
- package/src/icons/svg/items-timeline.svg +4 -0
- package/src/icons/svg/items.svg +3 -0
- package/src/icons/svg/jira.svg +3 -0
- package/src/icons/svg/key.svg +4 -0
- package/src/icons/svg/lab.svg +6 -0
- package/src/icons/svg/layout-double.svg +3 -0
- package/src/icons/svg/layout-single.svg +3 -0
- package/src/icons/svg/left-panel.svg +11 -0
- package/src/icons/svg/level-plus.svg +4 -0
- package/src/icons/svg/levels.svg +2 -0
- package/src/icons/svg/line-divider.svg +3 -0
- package/src/icons/svg/link.svg +6 -0
- package/src/icons/svg/lock-outline.svg +5 -0
- package/src/icons/svg/lock.svg +4 -0
- package/src/icons/svg/logout.svg +4 -0
- package/src/icons/svg/loom.svg +3 -0
- package/src/icons/svg/loupe-zoom-in.svg +3 -0
- package/src/icons/svg/loupe-zoom-out.svg +1 -0
- package/src/icons/svg/loupe-zoom.svg +3 -0
- package/src/icons/svg/many-people.svg +4 -0
- package/src/icons/svg/map-mode.svg +6 -0
- package/src/icons/svg/markdown.svg +3 -0
- package/src/icons/svg/menu-collapser.svg +2 -0
- package/src/icons/svg/message-plus-square.svg +4 -0
- package/src/icons/svg/milestones.svg +3 -0
- package/src/icons/svg/minus.svg +4 -0
- package/src/icons/svg/miro.svg +4 -0
- package/src/icons/svg/mirror-off.svg +8 -0
- package/src/icons/svg/mirror-on.svg +3 -0
- package/src/icons/svg/mixpanel.svg +3 -0
- package/src/icons/svg/monitor.svg +3 -0
- package/src/icons/svg/more-compact.svg +4 -0
- package/src/icons/svg/more.svg +4 -0
- package/src/icons/svg/move-bottom.svg +3 -0
- package/src/icons/svg/move-left.svg +3 -0
- package/src/icons/svg/move-right.svg +3 -0
- package/src/icons/svg/move-space.svg +5 -0
- package/src/icons/svg/move-top.svg +3 -0
- package/src/icons/svg/network-add.svg +5 -0
- package/src/icons/svg/network.svg +4 -0
- package/src/icons/svg/notifications.svg +2 -0
- package/src/icons/svg/obj-child.svg +2 -0
- package/src/icons/svg/obj-m2m.svg +2 -0
- package/src/icons/svg/obj-o2o.svg +2 -0
- package/src/icons/svg/obj-parent.svg +2 -0
- package/src/icons/svg/obj-self.svg +2 -0
- package/src/icons/svg/on-schedule.svg +3 -0
- package/src/icons/svg/open-as-page.svg +4 -0
- package/src/icons/svg/page-regular-mode.svg +5 -0
- package/src/icons/svg/page-wide-mode.svg +5 -0
- package/src/icons/svg/panel-add.svg +3 -0
- package/src/icons/svg/pencil.svg +5 -0
- package/src/icons/svg/people-check.svg +4 -0
- package/src/icons/svg/people.svg +7 -0
- package/src/icons/svg/photo.svg +2 -0
- package/src/icons/svg/pin-filled.svg +5 -0
- package/src/icons/svg/pin.svg +3 -0
- package/src/icons/svg/popup.svg +5 -0
- package/src/icons/svg/posts.svg +3 -0
- package/src/icons/svg/present-play.svg +4 -0
- package/src/icons/svg/present-stop.svg +3 -0
- package/src/icons/svg/private-items.svg +5 -0
- package/src/icons/svg/question.svg +4 -0
- package/src/icons/svg/refresh.svg +4 -0
- package/src/icons/svg/remove-people.svg +6 -0
- package/src/icons/svg/remove.svg +2 -0
- package/src/icons/svg/reply.svg +2 -0
- package/src/icons/svg/reset-password.svg +6 -0
- package/src/icons/svg/restore.svg +2 -0
- package/src/icons/svg/richeditor/actions/more.svg +2 -0
- package/src/icons/svg/richeditor/block/callout.svg +4 -0
- package/src/icons/svg/richeditor/block/code.svg +7 -0
- package/src/icons/svg/richeditor/block/embed.svg +4 -0
- package/src/icons/svg/richeditor/block/entity.svg +2 -0
- package/src/icons/svg/richeditor/block/file.svg +1 -0
- package/src/icons/svg/richeditor/block/h1.svg +2 -0
- package/src/icons/svg/richeditor/block/h2.svg +2 -0
- package/src/icons/svg/richeditor/block/h3.svg +2 -0
- package/src/icons/svg/richeditor/block/h4.svg +4 -0
- package/src/icons/svg/richeditor/block/mention.svg +2 -0
- package/src/icons/svg/richeditor/block/paragraph.svg +2 -0
- package/src/icons/svg/richeditor/block/quote.svg +2 -0
- package/src/icons/svg/richeditor/checklist/create.svg +2 -0
- package/src/icons/svg/richeditor/comment/create.svg +5 -0
- package/src/icons/svg/richeditor/entity-link/create.svg +2 -0
- package/src/icons/svg/richeditor/history/redo.svg +2 -0
- package/src/icons/svg/richeditor/history/undo.svg +2 -0
- package/src/icons/svg/richeditor/image/align-center.svg +2 -0
- package/src/icons/svg/richeditor/image/align-left.svg +2 -0
- package/src/icons/svg/richeditor/image/align-right.svg +2 -0
- package/src/icons/svg/richeditor/image/upload.svg +2 -0
- package/src/icons/svg/richeditor/image/wrap-center.svg +2 -0
- package/src/icons/svg/richeditor/image/wrap-left.svg +2 -0
- package/src/icons/svg/richeditor/image/wrap-right.svg +2 -0
- package/src/icons/svg/richeditor/image/zoom.svg +5 -0
- package/src/icons/svg/richeditor/link/create.svg +9 -0
- package/src/icons/svg/richeditor/linkedhighlight/create.svg +2 -0
- package/src/icons/svg/richeditor/list/bullet.svg +2 -0
- package/src/icons/svg/richeditor/list/indent.svg +2 -0
- package/src/icons/svg/richeditor/list/ordered.svg +2 -0
- package/src/icons/svg/richeditor/list/unindent.svg +2 -0
- package/src/icons/svg/richeditor/mark/code.svg +6 -0
- package/src/icons/svg/richeditor/mark/em.svg +2 -0
- package/src/icons/svg/richeditor/mark/strike.svg +2 -0
- package/src/icons/svg/richeditor/mark/strong.svg +2 -0
- package/src/icons/svg/richeditor/mark/text-background-color.svg +2 -0
- package/src/icons/svg/richeditor/mark/underline.svg +2 -0
- package/src/icons/svg/richeditor/open-link.svg +4 -0
- package/src/icons/svg/richeditor/table/create.svg +2 -0
- package/src/icons/svg/richeditor/unlink.svg +10 -0
- package/src/icons/svg/richeditor/video/upload.svg +2 -0
- package/src/icons/svg/right-panel.svg +11 -0
- package/src/icons/svg/rows.svg +3 -0
- package/src/icons/svg/rule-scheduled.svg +5 -0
- package/src/icons/svg/search-add.svg +4 -0
- package/src/icons/svg/search-remove.svg +4 -0
- package/src/icons/svg/search.svg +2 -0
- package/src/icons/svg/self-reference-off.svg +2 -0
- package/src/icons/svg/self-reference-on.svg +2 -0
- package/src/icons/svg/send-arrow.svg +3 -0
- package/src/icons/svg/send-backward.svg +8 -0
- package/src/icons/svg/send-to-back.svg +4 -0
- package/src/icons/svg/settings-off.svg +4 -0
- package/src/icons/svg/settings.svg +4 -0
- package/src/icons/svg/share.svg +5 -0
- package/src/icons/svg/shared.svg +7 -0
- package/src/icons/svg/shield-keyhole.svg +4 -0
- package/src/icons/svg/show-author.svg +5 -0
- package/src/icons/svg/sidebar-fields-opened.svg +3 -0
- package/src/icons/svg/sidebar-fields.svg +6 -0
- package/src/icons/svg/sidebar.svg +2 -0
- package/src/icons/svg/simple-compass.svg +5 -0
- package/src/icons/svg/slack-icon.svg +3 -0
- package/src/icons/svg/slack.svg +10 -0
- package/src/icons/svg/slide-menu-close.svg +4 -0
- package/src/icons/svg/slide-menu-open.svg +4 -0
- package/src/icons/svg/slide-menu.svg +5 -0
- package/src/icons/svg/smart-folder.svg +5 -0
- package/src/icons/svg/sort-on-bottom.svg +4 -0
- package/src/icons/svg/sort-on-top.svg +4 -0
- package/src/icons/svg/sort.svg +3 -0
- package/src/icons/svg/spinner.svg +2 -0
- package/src/icons/svg/success.svg +4 -0
- package/src/icons/svg/template.svg +3 -0
- package/src/icons/svg/templates.svg +4 -0
- package/src/icons/svg/terminal.svg +5 -0
- package/src/icons/svg/text-tool-align-bottom.svg +3 -0
- package/src/icons/svg/text-tool-align-middle.svg +3 -0
- package/src/icons/svg/text-tool-align-top.svg +3 -0
- package/src/icons/svg/twitter.svg +4 -0
- package/src/icons/svg/type/boolean.svg +2 -0
- package/src/icons/svg/type/button.svg +4 -0
- package/src/icons/svg/type/checkbox.svg +2 -0
- package/src/icons/svg/type/date.svg +2 -0
- package/src/icons/svg/type/email.svg +2 -0
- package/src/icons/svg/type/emoji.svg +2 -0
- package/src/icons/svg/type/formula.svg +2 -0
- package/src/icons/svg/type/function.svg +2 -0
- package/src/icons/svg/type/location.svg +4 -0
- package/src/icons/svg/type/lookup.svg +2 -0
- package/src/icons/svg/type/money.svg +2 -0
- package/src/icons/svg/type/multi-select.svg +2 -0
- package/src/icons/svg/type/number.svg +2 -0
- package/src/icons/svg/type/percent.svg +2 -0
- package/src/icons/svg/type/phone.svg +2 -0
- package/src/icons/svg/type/relation.svg +2 -0
- package/src/icons/svg/type/rich-text.svg +2 -0
- package/src/icons/svg/type/rule.svg +2 -0
- package/src/icons/svg/type/single-select.svg +2 -0
- package/src/icons/svg/type/text.svg +2 -0
- package/src/icons/svg/type/url.svg +9 -0
- package/src/icons/svg/units/avatar.svg +5 -0
- package/src/icons/svg/units/collection.svg +5 -0
- package/src/icons/svg/units/counter.svg +5 -0
- package/src/icons/svg/units/date.svg +5 -0
- package/src/icons/svg/units/db-badge-abbr.svg +4 -0
- package/src/icons/svg/units/db-badge-full.svg +4 -0
- package/src/icons/svg/units/db-icon.svg +4 -0
- package/src/icons/svg/units/field-icon-button.svg +5 -0
- package/src/icons/svg/units/field.svg +4 -0
- package/src/icons/svg/units/input.svg +5 -0
- package/src/icons/svg/units/progress-bar.svg +5 -0
- package/src/icons/svg/units/rich-text.svg +4 -0
- package/src/icons/svg/units/snippet.svg +5 -0
- package/src/icons/svg/unlink.svg +10 -0
- package/src/icons/svg/unlock-filled.svg +5 -0
- package/src/icons/svg/unlock-outline.svg +5 -0
- package/src/icons/svg/upgrade.svg +2 -0
- package/src/icons/svg/usb-flash-drive.svg +5 -0
- package/src/icons/svg/user-check.svg +3 -0
- package/src/icons/svg/user-group-remove.svg +5 -0
- package/src/icons/svg/user-group.svg +4 -0
- package/src/icons/svg/user-role.svg +4 -0
- package/src/icons/svg/user-x.svg +5 -0
- package/src/icons/svg/view-ai.svg +3 -0
- package/src/icons/svg/view-board.svg +2 -0
- package/src/icons/svg/view-calendar.svg +2 -0
- package/src/icons/svg/view-canvas.svg +2 -0
- package/src/icons/svg/view-chart.svg +2 -0
- package/src/icons/svg/view-details.svg +2 -0
- package/src/icons/svg/view-document.svg +2 -0
- package/src/icons/svg/view-feed.svg +3 -0
- package/src/icons/svg/view-form.svg +4 -0
- package/src/icons/svg/view-gantt.svg +5 -0
- package/src/icons/svg/view-list.svg +2 -0
- package/src/icons/svg/view-map.svg +3 -0
- package/src/icons/svg/view-page.svg +3 -0
- package/src/icons/svg/view-table.svg +2 -0
- package/src/icons/svg/view-timeline.svg +2 -0
- package/src/icons/svg/views.svg +11 -0
- package/src/icons/svg/warning-triangle.svg +4 -0
- package/src/icons/svg/warning.svg +2 -0
- package/src/icons/svg/workspace-map.svg +3 -0
- package/src/icons/svg/youtube.svg +4 -0
- package/src/icons/svg/zoom-in.svg +7 -0
- package/src/icons/svg/zoom-out.svg +7 -0
- package/src/is-android.ts +3 -0
- package/src/is-iOS.ts +8 -0
- package/src/is-in-popup.ts +15 -0
- package/src/layout.tsx +88 -0
- package/src/link-input/components/AntTextAreaWithCustomReadState.js +64 -0
- package/src/link-input/index.js +89 -0
- package/src/link-input/utils.js +13 -0
- package/src/logo.tsx +81 -0
- package/src/menu-item-actions.tsx +6 -0
- package/src/nested-menu-item.tsx +0 -0
- package/src/new-badge.tsx +16 -0
- package/src/new-card-placeholder.tsx +231 -0
- package/src/not-empty.ts +3 -0
- package/src/notification-dot.tsx +23 -0
- package/src/number-input/decimal.js +59 -0
- package/src/number-input/decimal.test.js +71 -0
- package/src/number-input/edit-unit-styles.ts +18 -0
- package/src/number-input/index.js +191 -0
- package/src/number-input/index.test.js +106 -0
- package/src/number-input/number-inline-input-with-autosize.tsx +156 -0
- package/src/number-input/number-input.tsx +152 -0
- package/src/number-input/stack.tsx +25 -0
- package/src/number-input/step-button.tsx +73 -0
- package/src/number-input/styles.ts +50 -0
- package/src/number-input/text-area-with-autosize.tsx +91 -0
- package/src/number-input/text-inline-input-with-autosize.tsx +60 -0
- package/src/online-users.tsx +238 -0
- package/src/palette.ts +2 -30
- package/src/platform.ts +4 -0
- package/src/popup/index.tsx +382 -0
- package/src/popup/modifiers.tsx +70 -0
- package/src/popup/popup-modifiers-context.ts +12 -0
- package/src/popup/popup-stack-context.tsx +44 -0
- package/src/popup/reference.ts +7 -0
- package/src/popup/styles.ts +62 -0
- package/src/popup/use-click-outside.ts +22 -0
- package/src/progress.tsx +14 -0
- package/src/reactions/get-word-divider.tsx +15 -0
- package/src/reactions/reaction-button.tsx +254 -0
- package/src/reactions/reaction-picker.tsx +126 -0
- package/src/reactions/reactions.tsx +30 -0
- package/src/ready-to-scroll-context.tsx +16 -0
- package/src/rich-input-loader.tsx +78 -0
- package/src/rich-text-embed-error.tsx +44 -0
- package/src/select/custom-select-partials/clear-indicator.tsx +4 -0
- package/src/select/custom-select-partials/group-heading.tsx +4 -5
- package/src/select/custom-select-partials/menu-list-virtualized.tsx +22 -4
- package/src/select/custom-select-partials/menu.tsx +5 -6
- package/src/select/index.tsx +39 -28
- package/src/select/select-in-popover.tsx +21 -16
- package/src/select/styles.ts +10 -2
- package/src/styles-utils.tsx +16 -0
- package/src/tab-nav/tab-nav.tsx +208 -0
- package/src/table.tsx +91 -0
- package/src/toast/primitives.tsx +6 -7
- package/src/toast/toast-action.tsx +7 -1
- package/src/toast/toast-queue.ts +2 -2
- package/src/toast/toast.tsx +78 -16
- package/src/toast/toaster.tsx +2 -17
- package/src/toast/utils/toastify-item-name.ts +16 -5
- package/src/tooltip.tsx +9 -0
- package/src/type-badge-box.tsx +42 -0
- package/src/type-badge.tsx +315 -0
- package/src/unit/as-string.tsx +1 -0
- package/src/unit/index.tsx +55 -0
- package/src/unit/loading-unit-value.tsx +13 -0
- package/src/unit/maybe-unit-value.tsx +9 -0
- package/src/unit/primitive.tsx +167 -0
- package/src/unit/required-indicator.svg +3 -0
- package/src/unit/styles.ts +165 -0
- package/src/unit/types.ts +31 -0
- package/src/unit/unit-button-group.tsx +38 -0
- package/src/unit/unit-content-layout.tsx +37 -0
- package/src/unit/unit-content.tsx +37 -0
- package/src/unit/unit-with-title.tsx +8 -0
- package/src/unit/unit-with-tooltip.tsx +60 -0
- package/src/use-is-support-hover.ts +5 -0
- package/src/use-long-press.tsx +79 -0
- package/src/use-me.tsx +11 -0
- package/src/use-navigation.tsx +11 -0
- package/src/use-why-did-you-update.tsx +78 -0
- package/src/utils-dom.ts +26 -0
- package/src/with-data.tsx +78 -0
- package/src/workflow-progress-icon.tsx +73 -0
- package/tsconfig.json +4 -0
- package/src/icons/get-icon-container-style.tsx +0 -13
package/src/toast/toast.tsx
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {useCallbackRef} from "@fibery/react/src/use-callback-ref";
|
|
2
2
|
import {useControllableState} from "@fibery/react/src/use-controllable-state";
|
|
3
|
-
import {css} from "@linaria/core";
|
|
4
|
-
import {useEffect, useRef} from "react";
|
|
3
|
+
import {css, cx} from "@linaria/core";
|
|
4
|
+
import {useEffect, useRef, useCallback} from "react";
|
|
5
5
|
import {space, themeVars} from "../design-system";
|
|
6
6
|
import Spinner from "../icons/react/Spinner";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import CheckCircleFilled from "../icons/react/CheckCircleFilled";
|
|
8
|
+
import AlertTriangle from "../icons/react/AlertTriangle";
|
|
9
9
|
import {ToastClose, ToastRoot, ToastSubtitle, ToastTitle} from "./primitives";
|
|
10
10
|
import type {ToastActionElement} from "./toast-action";
|
|
11
|
+
import {iconSizeVar} from "../icons/Icon";
|
|
11
12
|
|
|
12
13
|
type ToastType = "info" | "error" | "success" | "loading";
|
|
13
14
|
|
|
14
15
|
export type ToastProps = {
|
|
15
16
|
title: React.ReactNode;
|
|
17
|
+
variant?: "line" | "card";
|
|
16
18
|
subTitle?: React.ReactNode;
|
|
17
19
|
icon?: React.ReactNode;
|
|
18
20
|
action?: ToastActionElement;
|
|
@@ -30,7 +32,7 @@ export type ToastProps = {
|
|
|
30
32
|
const defaultPropsPerType: Record<ToastType, Partial<ToastProps>> = {
|
|
31
33
|
info: {},
|
|
32
34
|
error: {
|
|
33
|
-
icon: <
|
|
35
|
+
icon: <AlertTriangle color={themeVars.warning} />,
|
|
34
36
|
duration: 10000,
|
|
35
37
|
dismissable: true,
|
|
36
38
|
},
|
|
@@ -38,7 +40,7 @@ const defaultPropsPerType: Record<ToastType, Partial<ToastProps>> = {
|
|
|
38
40
|
icon: <Spinner color={themeVars.textColor} />,
|
|
39
41
|
},
|
|
40
42
|
success: {
|
|
41
|
-
icon: <
|
|
43
|
+
icon: <CheckCircleFilled color={themeVars.success} />,
|
|
42
44
|
},
|
|
43
45
|
};
|
|
44
46
|
|
|
@@ -46,9 +48,21 @@ const rootCss = css`
|
|
|
46
48
|
box-sizing: border-box;
|
|
47
49
|
min-height: 44px;
|
|
48
50
|
min-width: 320px;
|
|
51
|
+
max-width: min(calc(100vw - 40px), 400px);
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const rootLineCss = css`
|
|
49
55
|
display: flex;
|
|
50
56
|
align-items: center;
|
|
51
57
|
gap: ${space.s12}px;
|
|
58
|
+
padding: ${space.s12}px ${space.s16}px;
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const cartCardCss = css`
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: ${space.s8}px;
|
|
65
|
+
padding: ${space.s12}px;
|
|
52
66
|
`;
|
|
53
67
|
|
|
54
68
|
const messageCss = css`
|
|
@@ -71,10 +85,11 @@ export const Toast: React.FC<ToastProps> = (props) => {
|
|
|
71
85
|
icon,
|
|
72
86
|
action,
|
|
73
87
|
duration = 5000,
|
|
74
|
-
dismissable,
|
|
88
|
+
dismissable = true,
|
|
75
89
|
open,
|
|
76
90
|
onOpenChange,
|
|
77
91
|
onHide,
|
|
92
|
+
variant = "line",
|
|
78
93
|
} = {
|
|
79
94
|
...defaultProps,
|
|
80
95
|
...props,
|
|
@@ -105,17 +120,64 @@ export const Toast: React.FC<ToastProps> = (props) => {
|
|
|
105
120
|
}, [isOpen, onHideCb]);
|
|
106
121
|
|
|
107
122
|
const close = dismissable ? <ToastClose /> : null;
|
|
123
|
+
const onEscapeKeyDown = useCallback((evt: KeyboardEvent) => {
|
|
124
|
+
if (
|
|
125
|
+
evt.target &&
|
|
126
|
+
evt.target instanceof Element &&
|
|
127
|
+
(evt.target.tagName === "INPUT" || evt.target.tagName === "TEXTAREA")
|
|
128
|
+
) {
|
|
129
|
+
evt.preventDefault();
|
|
130
|
+
}
|
|
131
|
+
}, []);
|
|
108
132
|
|
|
109
133
|
return (
|
|
110
|
-
<ToastRoot
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{
|
|
118
|
-
|
|
134
|
+
<ToastRoot
|
|
135
|
+
onEscapeKeyDown={onEscapeKeyDown}
|
|
136
|
+
type="background"
|
|
137
|
+
ref={ref}
|
|
138
|
+
open={open}
|
|
139
|
+
duration={duration}
|
|
140
|
+
className={cx(rootCss, variant === "card" ? cartCardCss : rootLineCss)}
|
|
141
|
+
onOpenChange={setOpen}
|
|
142
|
+
>
|
|
143
|
+
{variant === "card" ? (
|
|
144
|
+
<>
|
|
145
|
+
{icon || close ? (
|
|
146
|
+
<div
|
|
147
|
+
className={css`
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
align-items: center;
|
|
151
|
+
`}
|
|
152
|
+
>
|
|
153
|
+
<div
|
|
154
|
+
className={css`
|
|
155
|
+
${iconSizeVar}: ${space.s16}px;
|
|
156
|
+
`}
|
|
157
|
+
>
|
|
158
|
+
{icon}
|
|
159
|
+
</div>
|
|
160
|
+
<div>{close}</div>
|
|
161
|
+
</div>
|
|
162
|
+
) : null}
|
|
163
|
+
<div className={messageCss}>
|
|
164
|
+
<ToastTitle>{title}</ToastTitle>
|
|
165
|
+
{subTitle ? <ToastSubtitle>{subTitle}</ToastSubtitle> : null}
|
|
166
|
+
</div>
|
|
167
|
+
{action}
|
|
168
|
+
</>
|
|
169
|
+
) : (
|
|
170
|
+
<>
|
|
171
|
+
{icon ? <div className={iconCss}>{icon}</div> : null}
|
|
172
|
+
<div className={messageCss}>
|
|
173
|
+
<ToastTitle>{title}</ToastTitle>
|
|
174
|
+
{subTitle ? <ToastSubtitle>{subTitle}</ToastSubtitle> : null}
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
{action}
|
|
178
|
+
{close}
|
|
179
|
+
</>
|
|
180
|
+
)}
|
|
119
181
|
</ToastRoot>
|
|
120
182
|
);
|
|
121
183
|
};
|
package/src/toast/toaster.tsx
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import {useSyncExternalStore} from "react";
|
|
2
|
-
import {createInlineTheme} from "../create-inline-theme";
|
|
3
|
-
import {colors, getThemeColors} from "../design-system";
|
|
4
|
-
import {ThemeProvider, useThemeMode} from "../theme-provider";
|
|
5
2
|
import {ToastViewport} from "./primitives";
|
|
6
3
|
import {Toast} from "./toast";
|
|
7
4
|
import {useToast} from "./toast-provider";
|
|
8
5
|
|
|
9
|
-
const ToastThemeProvider: React.FC<React.PropsWithChildren> = ({children}) => {
|
|
10
|
-
const themeMode = useThemeMode();
|
|
11
|
-
const theme = getThemeColors(colors.brandColors.blue, themeMode === "dark" ? "light" : "dark");
|
|
12
|
-
const inlineTheme = createInlineTheme(theme, []);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<ThemeProvider theme={theme}>
|
|
16
|
-
<div style={inlineTheme}>{children}</div>
|
|
17
|
-
</ThemeProvider>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
6
|
const viewportId = "toast-viewport";
|
|
22
7
|
|
|
23
8
|
export const Toaster: React.FC = () => {
|
|
@@ -27,7 +12,7 @@ export const Toaster: React.FC = () => {
|
|
|
27
12
|
const bottomOffset = useSyncExternalStore(toastQueue.subscribe, toastQueue.getBottomOffset);
|
|
28
13
|
|
|
29
14
|
return (
|
|
30
|
-
|
|
15
|
+
<>
|
|
31
16
|
{toasts.map(({id, open, type = "info", ...toastProps}) => (
|
|
32
17
|
<Toast
|
|
33
18
|
key={`${id}-${type}`}
|
|
@@ -47,6 +32,6 @@ export const Toaster: React.FC = () => {
|
|
|
47
32
|
))}
|
|
48
33
|
|
|
49
34
|
<ToastViewport id={viewportId} style={{bottom: bottomOffset}} />
|
|
50
|
-
|
|
35
|
+
</>
|
|
51
36
|
);
|
|
52
37
|
};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
const
|
|
1
|
+
const trimDynamicToastText = (str: string, charLimit: number) =>
|
|
2
|
+
str.length > charLimit ? `${str.slice(0, charLimit)}…` : str;
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export const toastifyItemName = ({
|
|
5
|
+
prefix,
|
|
6
|
+
name,
|
|
7
|
+
postfix,
|
|
8
|
+
charLimit = 60,
|
|
9
|
+
}: {
|
|
10
|
+
prefix?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
postfix?: string;
|
|
13
|
+
charLimit?: number;
|
|
14
|
+
}) =>
|
|
15
|
+
`${prefix ? `${prefix} ` : ""}"${name ? trimDynamicToastText(name, charLimit) : "Untitled"}"${
|
|
16
|
+
postfix ? ` ${postfix}` : ""
|
|
17
|
+
}`;
|
package/src/tooltip.tsx
CHANGED
|
@@ -4,6 +4,8 @@ import {forwardRef, type ReactNode, type SyntheticEvent} from "react";
|
|
|
4
4
|
import {border, fontWeight, lineHeight, space, themeVars, tooltipDelay} from "./design-system";
|
|
5
5
|
import {ShortcutBadge} from "./shortcut-badge";
|
|
6
6
|
|
|
7
|
+
const isFlagPresent = (flag: string) => new RegExp(`[?&]${flag}\\b`).test(window.location.search);
|
|
8
|
+
|
|
7
9
|
const preventDefaultAndStopPropagation = (e: SyntheticEvent) => {
|
|
8
10
|
e.preventDefault();
|
|
9
11
|
e.stopPropagation();
|
|
@@ -31,6 +33,9 @@ export const tooltipStyle = css`
|
|
|
31
33
|
padding: ${space.s6}px ${space.s8}px;
|
|
32
34
|
border-radius: ${border.radius6}px;
|
|
33
35
|
box-shadow: ${themeVars.actionMenuShadow};
|
|
36
|
+
white-space: normal;
|
|
37
|
+
word-break: break-word;
|
|
38
|
+
overflow-wrap: break-word;
|
|
34
39
|
@keyframes zoomIn {
|
|
35
40
|
from {
|
|
36
41
|
opacity: 0;
|
|
@@ -175,6 +180,10 @@ export const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(
|
|
|
175
180
|
}
|
|
176
181
|
: null;
|
|
177
182
|
|
|
183
|
+
if (isFlagPresent("no-tooltips")) {
|
|
184
|
+
return <>{children}</>;
|
|
185
|
+
}
|
|
186
|
+
|
|
178
187
|
return (
|
|
179
188
|
<TooltipPrimitive.Root
|
|
180
189
|
delayDuration={instant ? 0 : tooltipDelay.enter}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {makeAbbreviation} from "./type-badge";
|
|
2
|
+
import {css, cx} from "@linaria/core";
|
|
3
|
+
import {space} from "./design-system";
|
|
4
|
+
import {ReactNode} from "react";
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
typeObject: {title: string};
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const TypeBadgeBox = ({width, height, typeObject, children}: Props) => {
|
|
14
|
+
const abbr = makeAbbreviation(typeObject.title);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
style={{width, height}}
|
|
19
|
+
className={cx(
|
|
20
|
+
css`
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
|
|
25
|
+
& > div {
|
|
26
|
+
padding-left: ${space.s2}px;
|
|
27
|
+
padding-right: ${space.s1}px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
`,
|
|
31
|
+
abbr.length > 1 &&
|
|
32
|
+
css`
|
|
33
|
+
& > div {
|
|
34
|
+
mask-image: linear-gradient(90deg, #000 60%, rgba(0, 0, 0, 0.4));
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
import {CSSProperties, forwardRef, memo, ReactNode} from "react";
|
|
5
|
+
import {a11yColor} from "./a11y-color";
|
|
6
|
+
import {
|
|
7
|
+
border,
|
|
8
|
+
colors,
|
|
9
|
+
fontWeight,
|
|
10
|
+
getDarkenColor,
|
|
11
|
+
getTextColor,
|
|
12
|
+
getThemeValue,
|
|
13
|
+
opacity,
|
|
14
|
+
space,
|
|
15
|
+
textStyles,
|
|
16
|
+
transition,
|
|
17
|
+
} from "./design-system";
|
|
18
|
+
import {useTheme} from "./theme-provider";
|
|
19
|
+
import {Tooltip} from "./tooltip";
|
|
20
|
+
|
|
21
|
+
const typeBadgeStaticStyle = {
|
|
22
|
+
display: "inline-grid",
|
|
23
|
+
...textStyles.heading6,
|
|
24
|
+
fontSize: 11,
|
|
25
|
+
letterSpacing: 1.5,
|
|
26
|
+
lineHeight: 1.24,
|
|
27
|
+
outline: "none",
|
|
28
|
+
whiteSpace: "nowrap",
|
|
29
|
+
transition: `box-shadow ${transition}`,
|
|
30
|
+
opacity: 0.95,
|
|
31
|
+
borderWidth: 1,
|
|
32
|
+
borderStyle: "solid",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const normalTypeBadgeStyleObject = {
|
|
36
|
+
...typeBadgeStaticStyle,
|
|
37
|
+
paddingTop: 0,
|
|
38
|
+
paddingBottom: 0,
|
|
39
|
+
paddingLeft: space.s4,
|
|
40
|
+
paddingRight: space.s4,
|
|
41
|
+
borderRadius: border.radius4,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const normalTypeBadgeStaticStyle = css`
|
|
45
|
+
${normalTypeBadgeStyleObject}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const bigTypeBadgeStaticStyle = css`
|
|
49
|
+
${{
|
|
50
|
+
...typeBadgeStaticStyle,
|
|
51
|
+
fontSize: 12,
|
|
52
|
+
lineHeight: 1,
|
|
53
|
+
fontWeight: fontWeight.medium,
|
|
54
|
+
letterSpacing: 2,
|
|
55
|
+
paddingTop: space.s4,
|
|
56
|
+
paddingBottom: space.s4,
|
|
57
|
+
paddingLeft: space.s6 + 2, //compensate letter spacing
|
|
58
|
+
paddingRight: space.s6,
|
|
59
|
+
borderRadius: border.radius6 - 1,
|
|
60
|
+
}}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
const compactTypeBadgeStaticStyle = css`
|
|
64
|
+
${{
|
|
65
|
+
...typeBadgeStaticStyle,
|
|
66
|
+
display: "grid",
|
|
67
|
+
lineHeight: 1.1,
|
|
68
|
+
paddingTop: 1,
|
|
69
|
+
paddingBottom: 1,
|
|
70
|
+
paddingLeft: space.s4 + 1,
|
|
71
|
+
paddingRight: space.s4,
|
|
72
|
+
borderRadius: border.radius4,
|
|
73
|
+
}}
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
const abbrStaticStyle = {
|
|
77
|
+
paddingLeft: space.s2 + 1,
|
|
78
|
+
paddingRight: space.s2,
|
|
79
|
+
textAlign: "center",
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const abbrCompactStyle = css`
|
|
83
|
+
${{
|
|
84
|
+
...abbrStaticStyle,
|
|
85
|
+
minWidth: 16,
|
|
86
|
+
}}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
const abbrVerticalCompactStyle = css`
|
|
90
|
+
padding-right: 1px;
|
|
91
|
+
padding-top: ${space.s2 + 1}px;
|
|
92
|
+
padding-bottom: ${space.s2}px;
|
|
93
|
+
padding-left: 1px;
|
|
94
|
+
writing-mode: vertical-lr;
|
|
95
|
+
text-align: center;
|
|
96
|
+
min-height: 16px;
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
const colorProp = "--fibery-type-badge-color";
|
|
100
|
+
const colorVar = `var(${colorProp})`;
|
|
101
|
+
const colorDarkProp = "--fibery-type-badge-color-dark";
|
|
102
|
+
const colorDarkVar = `var(${colorDarkProp})`;
|
|
103
|
+
const colorBackgroundProp = "--fibery-type-badge-background-color";
|
|
104
|
+
const colorBackgroundVar = `var(${colorBackgroundProp})`;
|
|
105
|
+
const colorBorderProp = "--fibery-type-badge-border-color";
|
|
106
|
+
const colorBorderVar = `var(${colorBorderProp})`;
|
|
107
|
+
|
|
108
|
+
const typeBadgeStyle = css`
|
|
109
|
+
${{
|
|
110
|
+
color: colorVar,
|
|
111
|
+
backgroundColor: colorBackgroundVar,
|
|
112
|
+
borderColor: colorBorderVar,
|
|
113
|
+
}}
|
|
114
|
+
`;
|
|
115
|
+
|
|
116
|
+
const selectedStyle = css`
|
|
117
|
+
box-shadow: 0 0 0 2px ${colorDarkVar};
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
const clickableStyle = css`
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
`;
|
|
123
|
+
const fadedStyle = css`
|
|
124
|
+
opacity: ${opacity.opacity25};
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
export const makeDescription = (typeObject: {description?: string | null}): string | null => {
|
|
128
|
+
return typeObject.description || null;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const makeAbbreviation = (title = "") =>
|
|
132
|
+
title
|
|
133
|
+
.split(" ")
|
|
134
|
+
.map((word) => word[0])
|
|
135
|
+
.join("");
|
|
136
|
+
|
|
137
|
+
type TypeBadgeProps = {
|
|
138
|
+
color: string;
|
|
139
|
+
onMouseDown?: () => void;
|
|
140
|
+
onMouseEnter?: React.MouseEventHandler;
|
|
141
|
+
onMouseLeave?: React.MouseEventHandler;
|
|
142
|
+
onClick?: () => void;
|
|
143
|
+
children: ReactNode;
|
|
144
|
+
selected?: boolean;
|
|
145
|
+
abbr?: boolean;
|
|
146
|
+
compact?: boolean;
|
|
147
|
+
tooltip?: ReactNode;
|
|
148
|
+
faded?: boolean;
|
|
149
|
+
big?: boolean;
|
|
150
|
+
vertical?: boolean;
|
|
151
|
+
className?: string;
|
|
152
|
+
noTooltip?: boolean; // pass true to force disable tooltip for abbr
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const TypeBadge = memo(
|
|
156
|
+
forwardRef<HTMLDivElement | HTMLButtonElement, TypeBadgeProps>(function TypeBadge(
|
|
157
|
+
{
|
|
158
|
+
color,
|
|
159
|
+
onMouseDown,
|
|
160
|
+
onMouseEnter,
|
|
161
|
+
onMouseLeave,
|
|
162
|
+
onClick,
|
|
163
|
+
children,
|
|
164
|
+
selected,
|
|
165
|
+
abbr,
|
|
166
|
+
compact,
|
|
167
|
+
tooltip,
|
|
168
|
+
faded = false,
|
|
169
|
+
big = false,
|
|
170
|
+
vertical = false,
|
|
171
|
+
className,
|
|
172
|
+
noTooltip,
|
|
173
|
+
},
|
|
174
|
+
ref
|
|
175
|
+
) {
|
|
176
|
+
const TagName = onClick ? "button" : "div";
|
|
177
|
+
const title =
|
|
178
|
+
_.isString(children) && abbr ? (
|
|
179
|
+
noTooltip ? (
|
|
180
|
+
makeAbbreviation(children)
|
|
181
|
+
) : (
|
|
182
|
+
<Tooltip title={tooltip || children} side="bottom">
|
|
183
|
+
<span>{makeAbbreviation(children)}</span>
|
|
184
|
+
</Tooltip>
|
|
185
|
+
)
|
|
186
|
+
) : (
|
|
187
|
+
children
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const theme = useTheme();
|
|
191
|
+
|
|
192
|
+
const textBadgeColor = getThemeValue(theme.mode, {
|
|
193
|
+
dark: a11yColor(getTextColor(color), getDarkenColor(color), 12),
|
|
194
|
+
light: a11yColor(getTextColor(color), getDarkenColor(color), 12),
|
|
195
|
+
light2: a11yColor(getTextColor(color), getDarkenColor(color), 12),
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
const backgroundBadgeColor = getThemeValue(theme.mode, {
|
|
199
|
+
dark: getDarkenColor(color),
|
|
200
|
+
light: color,
|
|
201
|
+
light2: color,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
const style = {
|
|
205
|
+
[colorProp]: color ? textBadgeColor : colors.inversedTextColor,
|
|
206
|
+
//[colorProp]: color ? getTextColor(color) : colors.inversedTextColor,
|
|
207
|
+
[colorBackgroundProp]: backgroundBadgeColor || colors.shades.opacity25,
|
|
208
|
+
//[colorBackgroundProp]: color || colors.shades.opacity25,
|
|
209
|
+
[colorBorderProp]: backgroundBadgeColor,
|
|
210
|
+
[colorDarkProp]: getDarkenColor(color),
|
|
211
|
+
} as CSSProperties;
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<TagName
|
|
215
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
216
|
+
// @ts-ignore
|
|
217
|
+
ref={ref}
|
|
218
|
+
style={style}
|
|
219
|
+
className={cx(
|
|
220
|
+
typeBadgeStyle,
|
|
221
|
+
big ? bigTypeBadgeStaticStyle : compact ? compactTypeBadgeStaticStyle : normalTypeBadgeStaticStyle,
|
|
222
|
+
{
|
|
223
|
+
[abbrCompactStyle]: abbr && !vertical,
|
|
224
|
+
[abbrVerticalCompactStyle]: abbr && vertical,
|
|
225
|
+
[selectedStyle]: selected,
|
|
226
|
+
[clickableStyle]: onClick,
|
|
227
|
+
[fadedStyle]: faded,
|
|
228
|
+
},
|
|
229
|
+
className
|
|
230
|
+
)}
|
|
231
|
+
onMouseDown={onMouseDown}
|
|
232
|
+
onClick={onClick}
|
|
233
|
+
onMouseEnter={onMouseEnter}
|
|
234
|
+
onMouseLeave={onMouseLeave}
|
|
235
|
+
>
|
|
236
|
+
{title}
|
|
237
|
+
</TagName>
|
|
238
|
+
);
|
|
239
|
+
})
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
type TypeObjectInfo = {
|
|
243
|
+
title: string;
|
|
244
|
+
pluralTitle?: string;
|
|
245
|
+
singularTitle?: string;
|
|
246
|
+
color: string;
|
|
247
|
+
description?: string | null;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const getTypeObjectTitleForm = (typeObject: TypeObjectInfo, form: "singular" | "plural") =>
|
|
251
|
+
form === "singular" ? typeObject.singularTitle : typeObject.pluralTitle;
|
|
252
|
+
|
|
253
|
+
type TypeObjectBadgeParams = {
|
|
254
|
+
typeObject: TypeObjectInfo;
|
|
255
|
+
onMouseDown?: () => void;
|
|
256
|
+
onMouseEnter?: () => void;
|
|
257
|
+
onMouseLeave?: () => void;
|
|
258
|
+
onClick?: () => void;
|
|
259
|
+
abbr?: boolean;
|
|
260
|
+
compact?: boolean;
|
|
261
|
+
vertical?: boolean;
|
|
262
|
+
form?: "singular" | "plural";
|
|
263
|
+
className?: string;
|
|
264
|
+
big?: boolean;
|
|
265
|
+
selected?: boolean;
|
|
266
|
+
faded?: boolean;
|
|
267
|
+
tooltip?: boolean;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const TypeObjectBadge = forwardRef<HTMLDivElement | HTMLButtonElement, TypeObjectBadgeParams>(
|
|
271
|
+
(
|
|
272
|
+
{
|
|
273
|
+
typeObject,
|
|
274
|
+
onMouseDown,
|
|
275
|
+
onMouseEnter,
|
|
276
|
+
onMouseLeave,
|
|
277
|
+
onClick,
|
|
278
|
+
abbr,
|
|
279
|
+
compact,
|
|
280
|
+
vertical,
|
|
281
|
+
form,
|
|
282
|
+
className,
|
|
283
|
+
big,
|
|
284
|
+
selected,
|
|
285
|
+
faded,
|
|
286
|
+
tooltip = true,
|
|
287
|
+
},
|
|
288
|
+
ref
|
|
289
|
+
) => {
|
|
290
|
+
const typeTitle = String(form ? getTypeObjectTitleForm(typeObject, form) : typeObject.title);
|
|
291
|
+
const caption = abbr ? makeAbbreviation(typeTitle) : typeTitle;
|
|
292
|
+
|
|
293
|
+
return (
|
|
294
|
+
<TypeBadge
|
|
295
|
+
ref={ref}
|
|
296
|
+
color={typeObject.color}
|
|
297
|
+
abbr={abbr}
|
|
298
|
+
compact={compact}
|
|
299
|
+
vertical={vertical}
|
|
300
|
+
className={className}
|
|
301
|
+
big={big}
|
|
302
|
+
selected={selected}
|
|
303
|
+
onClick={onClick}
|
|
304
|
+
onMouseDown={onMouseDown}
|
|
305
|
+
onMouseEnter={onMouseEnter}
|
|
306
|
+
onMouseLeave={onMouseLeave}
|
|
307
|
+
faded={faded}
|
|
308
|
+
>
|
|
309
|
+
<Tooltip title={typeTitle} disabled={!tooltip} description={makeDescription(typeObject)} side="bottom">
|
|
310
|
+
<span>{caption}</span>
|
|
311
|
+
</Tooltip>
|
|
312
|
+
</TypeBadge>
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const asString = (something: unknown) => (typeof something === "string" ? something : JSON.stringify(something));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {CardSize} from "../card-container";
|
|
2
|
+
import {themeVars} from "../design-system";
|
|
3
|
+
import {UnitPrimitive} from "./primitive";
|
|
4
|
+
import {UnitPrimitiveProps} from "./types";
|
|
5
|
+
|
|
6
|
+
// Try not to use UnitPrimitive directly, rather define a pattern of usage, and create own unit with the pattern.
|
|
7
|
+
|
|
8
|
+
export const BasicUnit = ({
|
|
9
|
+
renderAsDiv = false,
|
|
10
|
+
onKeyDown,
|
|
11
|
+
...props
|
|
12
|
+
}: UnitPrimitiveProps & {readOnly: boolean; size: CardSize}) => {
|
|
13
|
+
if (props.size === ":card-size/cell") {
|
|
14
|
+
const bgColor = props.bgColor || themeVars.transparent;
|
|
15
|
+
return (
|
|
16
|
+
<UnitPrimitive
|
|
17
|
+
onKeyDown={onKeyDown}
|
|
18
|
+
bgColor={bgColor}
|
|
19
|
+
border={false}
|
|
20
|
+
button={false}
|
|
21
|
+
header={false}
|
|
22
|
+
tooltip={false}
|
|
23
|
+
setMinWidth={false}
|
|
24
|
+
big
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const bgColor = props.bgColor || props.readOnly ? themeVars.inputDisabledBgColor : themeVars.transparent;
|
|
31
|
+
return (
|
|
32
|
+
<UnitPrimitive
|
|
33
|
+
bgColor={bgColor}
|
|
34
|
+
onKeyDown={onKeyDown}
|
|
35
|
+
border={!props.readOnly}
|
|
36
|
+
button={renderAsDiv === true ? false : !props.readOnly || Boolean(props.onClick)}
|
|
37
|
+
header={props.size === ":card-size/full"}
|
|
38
|
+
tooltip={props.tooltip ?? props.size !== ":card-size/full"}
|
|
39
|
+
clickable={!props.readOnly}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const CellUnit = (props: UnitPrimitiveProps) => {
|
|
46
|
+
return <UnitPrimitive big={true} tooltip={false} {...props} />;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const OptionUnit = (props: UnitPrimitiveProps) => {
|
|
50
|
+
return <UnitPrimitive big={true} tooltip={false} {...props} />;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const HistoryUnit = (props: UnitPrimitiveProps & {size: CardSize}) => {
|
|
54
|
+
return <UnitPrimitive big={props.size === ":card-size/cell"} bgColor={themeVars.unitBg} border={false} {...props} />;
|
|
55
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {LoadingSausage, LoadingSausageProps} from "../loading-sausage";
|
|
3
|
+
|
|
4
|
+
export const unitTextHeight = 8;
|
|
5
|
+
export const LoadingUnitValue = (props: LoadingSausageProps) => (
|
|
6
|
+
<div
|
|
7
|
+
className={css`
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
`}
|
|
10
|
+
>
|
|
11
|
+
<LoadingSausage {...props} height={unitTextHeight} />
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {LoadingUnitValue} from "./loading-unit-value";
|
|
2
|
+
|
|
3
|
+
interface MaybeUnitValueProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const MaybeUnitValue: React.FC<MaybeUnitValueProps> = ({value}) => {
|
|
8
|
+
return value === undefined ? <LoadingUnitValue minWidth={18} maxWidth={18} /> : <>{value}</>;
|
|
9
|
+
};
|