@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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import {ComponentProps} from "react";
|
|
4
|
+
import {inputOverrides} from "../antd/styles";
|
|
5
|
+
import {border, themeVars} from "../design-system";
|
|
6
|
+
import {
|
|
7
|
+
basicUnitClassName,
|
|
8
|
+
bigSizeUnitClassName,
|
|
9
|
+
bigSizeUnitMinWidthClassName,
|
|
10
|
+
borderClassName,
|
|
11
|
+
clickableClassName,
|
|
12
|
+
fullUnitWrapperClassName,
|
|
13
|
+
invalidUnitClassName,
|
|
14
|
+
positionUnitClass,
|
|
15
|
+
regularSizeUnitClassName,
|
|
16
|
+
regularSizeUnitMinWidthClassName,
|
|
17
|
+
textEllipsisClassName,
|
|
18
|
+
unitDescriptionClassName,
|
|
19
|
+
unitTitleClassName,
|
|
20
|
+
unitTooltipTitleClassName,
|
|
21
|
+
unitWithTitleClassName,
|
|
22
|
+
} from "./styles";
|
|
23
|
+
import {UnitPrimitiveProps} from "./types";
|
|
24
|
+
import {UnitButtonGroup} from "./unit-button-group";
|
|
25
|
+
import {UnitContent} from "./unit-content";
|
|
26
|
+
import {UnitWithTooltip} from "./unit-with-tooltip";
|
|
27
|
+
|
|
28
|
+
const resetButtonStylesClassName = css`
|
|
29
|
+
all: unset;
|
|
30
|
+
background-color: ${themeVars.transparent};
|
|
31
|
+
--input-focus-border: ${inputOverrides.main["--input-focus-border"]};
|
|
32
|
+
--input-focus-shadow: ${inputOverrides.main["--input-focus-shadow"]};
|
|
33
|
+
border-radius: ${border.radius6}px;
|
|
34
|
+
&:focus {
|
|
35
|
+
outline: none;
|
|
36
|
+
${inputOverrides.focus}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:focus:not(:focus-visible) {
|
|
40
|
+
outline: none;
|
|
41
|
+
box-shadow: none !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:focus-visible {
|
|
45
|
+
outline: none;
|
|
46
|
+
${inputOverrides.focus}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const ButtonComponent = (props: ComponentProps<"button">) => {
|
|
51
|
+
return <button type={"button"} {...props} className={cx(props.className, resetButtonStylesClassName)} />;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const DivComponent = (props: ComponentProps<"div">) => <div {...props} />;
|
|
55
|
+
|
|
56
|
+
export const UnitPrimitive = ({
|
|
57
|
+
// Markup
|
|
58
|
+
overflow = true,
|
|
59
|
+
inline = true,
|
|
60
|
+
button = false,
|
|
61
|
+
multiline = false,
|
|
62
|
+
// Content
|
|
63
|
+
children,
|
|
64
|
+
title,
|
|
65
|
+
description = null,
|
|
66
|
+
hint = null,
|
|
67
|
+
icons,
|
|
68
|
+
navButton,
|
|
69
|
+
// Appearance
|
|
70
|
+
big = false,
|
|
71
|
+
tooltip = true,
|
|
72
|
+
header = false,
|
|
73
|
+
border = true,
|
|
74
|
+
bgColor = themeVars.transparent,
|
|
75
|
+
shrinkable = true,
|
|
76
|
+
clickable = border,
|
|
77
|
+
setMinWidth = true,
|
|
78
|
+
// Callback
|
|
79
|
+
onClick,
|
|
80
|
+
onKeyDown,
|
|
81
|
+
invalid,
|
|
82
|
+
tooltipContent: tooltipChildren,
|
|
83
|
+
}: UnitPrimitiveProps) => {
|
|
84
|
+
const cutTextInUnit = !multiline && overflow;
|
|
85
|
+
const unitWrapperStyle = {
|
|
86
|
+
backgroundColor: bgColor || themeVars.inputDisabledBgColor,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const unitWrapperClassName = cx(
|
|
90
|
+
basicUnitClassName,
|
|
91
|
+
big ? bigSizeUnitClassName : regularSizeUnitClassName,
|
|
92
|
+
setMinWidth && (big ? bigSizeUnitMinWidthClassName : regularSizeUnitMinWidthClassName),
|
|
93
|
+
border && borderClassName,
|
|
94
|
+
invalid && invalidUnitClassName,
|
|
95
|
+
clickable && clickableClassName
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const UnitContentComponent = button ? ButtonComponent : DivComponent;
|
|
99
|
+
|
|
100
|
+
const content = (
|
|
101
|
+
<UnitButtonGroup
|
|
102
|
+
big={big}
|
|
103
|
+
inline={inline}
|
|
104
|
+
style={unitWrapperStyle}
|
|
105
|
+
className={unitWrapperClassName}
|
|
106
|
+
unitButton={
|
|
107
|
+
<UnitContentComponent onKeyDown={onKeyDown} onClick={onClick}>
|
|
108
|
+
<UnitContent
|
|
109
|
+
big={big}
|
|
110
|
+
icons={icons}
|
|
111
|
+
children={children}
|
|
112
|
+
contentClassName={cx({[textEllipsisClassName]: cutTextInUnit})}
|
|
113
|
+
shrinkable={shrinkable}
|
|
114
|
+
/>
|
|
115
|
+
</UnitContentComponent>
|
|
116
|
+
}
|
|
117
|
+
navButton={navButton}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const contentWithTitle = header ? (
|
|
122
|
+
<div className={unitWithTitleClassName}>
|
|
123
|
+
<div className={unitTitleClassName}>{title}</div>
|
|
124
|
+
{content}
|
|
125
|
+
</div>
|
|
126
|
+
) : (
|
|
127
|
+
content
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (tooltip) {
|
|
131
|
+
const tooltipContent = (
|
|
132
|
+
<UnitButtonGroup
|
|
133
|
+
big={big}
|
|
134
|
+
inline={inline}
|
|
135
|
+
style={unitWrapperStyle}
|
|
136
|
+
className={unitWrapperClassName}
|
|
137
|
+
unitButton={
|
|
138
|
+
<UnitContentComponent onClick={onClick}>
|
|
139
|
+
<UnitContent big={big} icons={icons}>
|
|
140
|
+
{tooltipChildren || children}
|
|
141
|
+
</UnitContent>
|
|
142
|
+
</UnitContentComponent>
|
|
143
|
+
}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
const renderedDescription = (
|
|
147
|
+
<div>
|
|
148
|
+
{description && <div className={unitDescriptionClassName}>{description}</div>}
|
|
149
|
+
<div className={fullUnitWrapperClassName}>{tooltipContent}</div>
|
|
150
|
+
{hint}
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<div className={positionUnitClass}>
|
|
156
|
+
<UnitWithTooltip
|
|
157
|
+
title={<div className={unitTooltipTitleClassName}>{title}</div>}
|
|
158
|
+
description={renderedDescription}
|
|
159
|
+
>
|
|
160
|
+
{contentWithTitle}
|
|
161
|
+
</UnitWithTooltip>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
} else {
|
|
165
|
+
return <div className={positionUnitClass}>{contentWithTitle}</div>;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.6 11.4C8.6 11.7314 8.33136 12 8 12C7.66863 12 7.4 11.7314 7.4 11.4V9.44852L6.02009 10.8284C5.78578 11.0627 5.40587 11.0627 5.17157 10.8284C4.93725 10.5941 4.93725 10.2142 5.17157 9.9799L6.55147 8.6H4.6C4.26863 8.6 4 8.33136 4 8C4 7.66863 4.26863 7.4 4.6 7.4H6.55147L5.17157 6.0201C4.93725 5.78579 4.93725 5.40589 5.17157 5.17157C5.40587 4.93727 5.78578 4.93726 6.02009 5.17157L7.4 6.55148V4.6C7.4 4.26863 7.66863 4 8 4C8.33136 4 8.6 4.26863 8.6 4.6V6.55147L9.97989 5.17157C10.2142 4.93727 10.5941 4.93726 10.8284 5.17157C11.0627 5.40588 11.0627 5.78579 10.8284 6.0201L9.44852 7.4H11.4C11.7314 7.4 12 7.66863 12 8C12 8.33136 11.7314 8.6 11.4 8.6H9.44852L10.8284 9.9799C11.0627 10.2142 11.0627 10.5941 10.8284 10.8284C10.5941 11.0627 10.2142 11.0627 9.97989 10.8284L8.6 9.44853V11.4Z" fill="#4065DD"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {space, textStyles, themeVars} from "../../src/design-system";
|
|
3
|
+
|
|
4
|
+
export const textEllipsisClassName = css`
|
|
5
|
+
white-space: nowrap;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
text-overflow: ellipsis;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const basicUnitClassName = css`
|
|
11
|
+
border-radius: ${space.s4 + space.s1}px;
|
|
12
|
+
border: none;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const alignCenterClassName = css`
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
line-height: 0;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export const regularTextUnitSize = textStyles.regular.fontSize + space.s8;
|
|
23
|
+
export const smallTextUnitSize = textStyles.small.fontSize + space.s8;
|
|
24
|
+
|
|
25
|
+
export const bigSizeUnitClassName = css`
|
|
26
|
+
${textStyles.regular}
|
|
27
|
+
line-height: ${regularTextUnitSize}px;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const bigSizeUnitMinWidthClassName = css`
|
|
31
|
+
min-width: ${regularTextUnitSize + space.s4}px;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const regularSizeUnitClassName = css`
|
|
36
|
+
${textStyles.small}
|
|
37
|
+
line-height: ${smallTextUnitSize}px;
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const regularSizeUnitMinWidthClassName = css`
|
|
41
|
+
min-width: ${smallTextUnitSize + space.s4}px;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const unitTitleClassName = css`
|
|
46
|
+
${textStyles.heading7}
|
|
47
|
+
padding-bottom: ${space.s2}px;
|
|
48
|
+
padding-top: ${space.s6}px;
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export const unitTooltipTitleClassName = css`
|
|
52
|
+
margin-bottom: ${space.s4}px;
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export const unitWithTitleClassName = css`
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
justify-content: flex-start;
|
|
60
|
+
line-height: 1.2;
|
|
61
|
+
width: 100%;
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export const invalidUnitClassName = css``;
|
|
65
|
+
export const invalidUnitClassNameInForm = css``;
|
|
66
|
+
|
|
67
|
+
export const borderClassName = css`
|
|
68
|
+
position: relative;
|
|
69
|
+
|
|
70
|
+
&:focus {
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&::before {
|
|
75
|
+
content: "";
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: 0;
|
|
78
|
+
left: 0;
|
|
79
|
+
right: 0;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
box-shadow: ${themeVars.inputBorderColor} inset;
|
|
82
|
+
mix-blend-mode: ${themeVars.inputBorderBlendMode};
|
|
83
|
+
border-radius: ${space.s4 + space.s1}px;
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:hover::before {
|
|
88
|
+
box-shadow: ${themeVars.inputBorderHoverColor} inset;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:focus::before {
|
|
92
|
+
box-shadow: ${themeVars.inputBorderFocusColor} inset;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.${invalidUnitClassName} {
|
|
96
|
+
padding-left: 20px;
|
|
97
|
+
&:has(button) {
|
|
98
|
+
padding-left: 0;
|
|
99
|
+
}
|
|
100
|
+
& button {
|
|
101
|
+
padding-left: 20px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&::before {
|
|
105
|
+
box-shadow: none;
|
|
106
|
+
border: 1px solid ${themeVars.colorBorderButtonOutlineAccentDefault};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:hover::before {
|
|
110
|
+
box-shadow: none;
|
|
111
|
+
border: 1px solid ${themeVars.colorBorderReactionsSelectedHover};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:focus::before {
|
|
115
|
+
box-shadow: ${themeVars.inputBorderFocusColor} inset;
|
|
116
|
+
border: none;
|
|
117
|
+
}
|
|
118
|
+
&::after {
|
|
119
|
+
content: "";
|
|
120
|
+
position: absolute;
|
|
121
|
+
top: 0;
|
|
122
|
+
width: 20px;
|
|
123
|
+
left: 4px;
|
|
124
|
+
right: 0;
|
|
125
|
+
bottom: 0;
|
|
126
|
+
background-image: url("./required-indicator.svg");
|
|
127
|
+
background-repeat: no-repeat;
|
|
128
|
+
background-size: 16px 16px;
|
|
129
|
+
background-position: center;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
|
|
135
|
+
export const clickableClassName = css`
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
`;
|
|
138
|
+
|
|
139
|
+
export const basicUnitContentClassName = css`
|
|
140
|
+
padding-left: ${space.s4}px;
|
|
141
|
+
padding-right: ${space.s4}px;
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
export const unitContentContainerClassName = css`
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
`;
|
|
147
|
+
|
|
148
|
+
export const unitDescriptionClassName = css`
|
|
149
|
+
margin-bottom: ${space.s4}px;
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
export const fullUnitWrapperClassName = css`
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
padding: ${space.s6}px;
|
|
156
|
+
border-radius: ${space.s4 + space.s1}px;
|
|
157
|
+
background-color: ${themeVars.cardBg};
|
|
158
|
+
margin-bottom: ${space.s4}px;
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
// Makes unit shown on top of card link(see CardContainer) thus allows to interact with unit. E.g. show tooltip or hidden link.
|
|
162
|
+
export const positionUnitClass = css`
|
|
163
|
+
line-height: 0;
|
|
164
|
+
position: relative;
|
|
165
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {KeyboardEvent, ReactNode} from "react";
|
|
2
|
+
|
|
3
|
+
export type UnitPrimitiveProps = {
|
|
4
|
+
// Markup
|
|
5
|
+
overflow?: boolean;
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
button?: boolean;
|
|
8
|
+
multiline?: boolean; // Not sure if we need it
|
|
9
|
+
renderAsDiv?: boolean;
|
|
10
|
+
// Content
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
icons?: React.ReactNodeArray;
|
|
15
|
+
hint?: ReactNode;
|
|
16
|
+
navButton?: ReactNode;
|
|
17
|
+
// Appearance
|
|
18
|
+
big?: boolean;
|
|
19
|
+
tooltip?: boolean;
|
|
20
|
+
header?: boolean;
|
|
21
|
+
border?: boolean;
|
|
22
|
+
bgColor?: string | null | undefined;
|
|
23
|
+
shrinkable?: boolean;
|
|
24
|
+
clickable?: boolean;
|
|
25
|
+
setMinWidth?: boolean;
|
|
26
|
+
// Callbacks
|
|
27
|
+
onKeyDown?: (e: KeyboardEvent<HTMLButtonElement | HTMLDivElement>) => void;
|
|
28
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
29
|
+
invalid?: boolean;
|
|
30
|
+
tooltipContent?: ReactNode;
|
|
31
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {Children, cloneElement, ReactNode} from "react";
|
|
2
|
+
import {space} from "../design-system";
|
|
3
|
+
import {IconButtonProps} from "../button/icon-button";
|
|
4
|
+
import {getHeight} from "./unit-content-layout";
|
|
5
|
+
|
|
6
|
+
export const UnitButtonGroup = ({
|
|
7
|
+
big,
|
|
8
|
+
inline,
|
|
9
|
+
style,
|
|
10
|
+
className,
|
|
11
|
+
unitButton,
|
|
12
|
+
navButton,
|
|
13
|
+
}: {
|
|
14
|
+
big: boolean;
|
|
15
|
+
inline: boolean;
|
|
16
|
+
style: React.CSSProperties;
|
|
17
|
+
className: string;
|
|
18
|
+
unitButton?: ReactNode;
|
|
19
|
+
navButton?: ReactNode;
|
|
20
|
+
}) => {
|
|
21
|
+
const navButtonNode = navButton && (Children.only(navButton) as React.ReactElement<IconButtonProps>);
|
|
22
|
+
const navButtonSize = getHeight(big) + 2 * space.s2;
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
style={{
|
|
26
|
+
display: inline ? `inline-flex` : `flex`,
|
|
27
|
+
...style,
|
|
28
|
+
}}
|
|
29
|
+
className={className}
|
|
30
|
+
>
|
|
31
|
+
{unitButton}
|
|
32
|
+
{navButtonNode &&
|
|
33
|
+
cloneElement(navButtonNode, {
|
|
34
|
+
style: {...navButtonNode.props.style, width: navButtonSize, height: navButtonSize},
|
|
35
|
+
})}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {styled} from "@linaria/react";
|
|
2
|
+
import {space} from "../design-system";
|
|
3
|
+
import {regularTextUnitSize, smallTextUnitSize} from "./styles";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
big: boolean;
|
|
7
|
+
iconsLength: number;
|
|
8
|
+
hasChildren: boolean;
|
|
9
|
+
shrinkable?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const getHeight = (big: boolean) => {
|
|
13
|
+
return big ? regularTextUnitSize : smallTextUnitSize;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const getUnitGridTemplateRows = ({big, iconsLength}: Props) => {
|
|
17
|
+
if (iconsLength === 0) {
|
|
18
|
+
return "auto";
|
|
19
|
+
}
|
|
20
|
+
return `minmax(${getHeight(big)}px, max-content)`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getUnitGridTemplateColumns = ({big, iconsLength, shrinkable = true, hasChildren}: Props) => {
|
|
24
|
+
if (iconsLength === 0) {
|
|
25
|
+
return shrinkable ? "auto" : "minmax(max-content, max-content)";
|
|
26
|
+
}
|
|
27
|
+
return `repeat(${iconsLength}, minmax(${getHeight(big)}px, max-content)) ${
|
|
28
|
+
hasChildren ? (shrinkable ? `minmax(auto, 1fr)` : `minmax(max-content, max-content)`) : ""
|
|
29
|
+
}`;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const UnitContentLayout = styled.div<Props>`
|
|
33
|
+
padding: ${space.s2}px;
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-rows: ${getUnitGridTemplateRows};
|
|
36
|
+
grid-template-columns: ${getUnitGridTemplateColumns};
|
|
37
|
+
`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {alignCenterClassName, basicUnitContentClassName, unitContentContainerClassName} from "./styles";
|
|
2
|
+
import {ReactNode} from "react";
|
|
3
|
+
import {cx} from "@linaria/core";
|
|
4
|
+
import {UnitContentLayout} from "./unit-content-layout";
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
big: boolean;
|
|
8
|
+
icons?: React.ReactNodeArray;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
contentClassName?: string;
|
|
11
|
+
shrinkable?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const UnitContent = ({big, icons, children, contentClassName, shrinkable}: Props) => {
|
|
15
|
+
return (
|
|
16
|
+
<UnitContentLayout
|
|
17
|
+
big={big}
|
|
18
|
+
hasChildren={Boolean(children)}
|
|
19
|
+
iconsLength={icons ? icons.length : 0}
|
|
20
|
+
shrinkable={shrinkable}
|
|
21
|
+
>
|
|
22
|
+
{icons
|
|
23
|
+
? icons.map((icon, index) => (
|
|
24
|
+
<div key={index} className={alignCenterClassName}>
|
|
25
|
+
{icon}
|
|
26
|
+
</div>
|
|
27
|
+
))
|
|
28
|
+
: null}
|
|
29
|
+
|
|
30
|
+
{children && (
|
|
31
|
+
<div className={unitContentContainerClassName}>
|
|
32
|
+
<div className={cx(basicUnitContentClassName, contentClassName)}>{children}</div>
|
|
33
|
+
</div>
|
|
34
|
+
)}
|
|
35
|
+
</UnitContentLayout>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {unitTitleClassName, unitWithTitleClassName} from "./styles";
|
|
2
|
+
|
|
3
|
+
export const UnitWithTitle = ({children, title}: {title: React.ReactNode; children: React.ReactElement}) => (
|
|
4
|
+
<div className={unitWithTitleClassName}>
|
|
5
|
+
<div className={unitTitleClassName}>{title}</div>
|
|
6
|
+
{children}
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {tooltipDelay} from "../../src/design-system";
|
|
2
|
+
import {Tooltip} from "../tooltip";
|
|
3
|
+
import {useRef, useState} from "react";
|
|
4
|
+
|
|
5
|
+
export const UnitWithTooltip = ({
|
|
6
|
+
children,
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactElement;
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
description: React.ReactNode;
|
|
13
|
+
}) => {
|
|
14
|
+
const [shouldDisplayTooltip, setShouldDisplayTooltip] = useState(false);
|
|
15
|
+
const unitElementRef = useRef<HTMLDivElement>(null);
|
|
16
|
+
const isHoveredRef = useRef(false);
|
|
17
|
+
const checkHoveredStateTimeoutId = useRef<ReturnType<typeof setTimeout> | null>();
|
|
18
|
+
|
|
19
|
+
const onMouseEnter = () => {
|
|
20
|
+
isHoveredRef.current = true;
|
|
21
|
+
|
|
22
|
+
checkHoveredStateTimeoutId.current = setTimeout(() => {
|
|
23
|
+
checkHoveredStateTimeoutId.current = null;
|
|
24
|
+
// onMouseLeave works unreliably in Safari, IE on scroll
|
|
25
|
+
// Sometimes it was not fired leaving tooltip displayed
|
|
26
|
+
// Had to use additional way to validate if we are still over unit
|
|
27
|
+
if (isHoveredRef.current && unitElementRef.current && unitElementRef.current.matches(":hover")) {
|
|
28
|
+
setShouldDisplayTooltip(true);
|
|
29
|
+
const intervalId = setInterval(() => {
|
|
30
|
+
if (isHoveredRef.current && unitElementRef.current) {
|
|
31
|
+
if (!unitElementRef.current.matches(":hover")) {
|
|
32
|
+
isHoveredRef.current = false;
|
|
33
|
+
setShouldDisplayTooltip(false);
|
|
34
|
+
clearInterval(intervalId);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
clearInterval(intervalId);
|
|
38
|
+
}
|
|
39
|
+
}, 250);
|
|
40
|
+
}
|
|
41
|
+
}, tooltipDelay.enter);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onMouseLeave = () => {
|
|
45
|
+
isHoveredRef.current = false;
|
|
46
|
+
if (checkHoveredStateTimeoutId.current) {
|
|
47
|
+
clearTimeout(checkHoveredStateTimeoutId.current);
|
|
48
|
+
checkHoveredStateTimeoutId.current = null;
|
|
49
|
+
}
|
|
50
|
+
setShouldDisplayTooltip(false);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Tooltip visible={shouldDisplayTooltip} title={title} description={description} side="bottom" align="start">
|
|
55
|
+
<div ref={unitElementRef} onMouseDown={onMouseLeave} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
|
|
56
|
+
{children}
|
|
57
|
+
</div>
|
|
58
|
+
</Tooltip>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {useCallback, useRef} from "react";
|
|
2
|
+
import {$TSFixMe} from "./tsfixme";
|
|
3
|
+
|
|
4
|
+
function on<T extends Window | Document | HTMLElement | EventTarget>(
|
|
5
|
+
obj: T | null,
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/ban-types,@typescript-eslint/no-explicit-any
|
|
7
|
+
...args: Parameters<T["addEventListener"]> | [string, Function | null, ...any]
|
|
8
|
+
): void {
|
|
9
|
+
if (obj && obj.addEventListener) {
|
|
10
|
+
obj.addEventListener(...(args as Parameters<HTMLElement["addEventListener"]>));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function off<T extends Window | Document | HTMLElement | EventTarget>(
|
|
15
|
+
obj: T | null,
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-types,@typescript-eslint/no-explicit-any
|
|
17
|
+
...args: Parameters<T["removeEventListener"]> | [string, Function | null, ...any]
|
|
18
|
+
): void {
|
|
19
|
+
if (obj && obj.removeEventListener) {
|
|
20
|
+
obj.removeEventListener(...(args as Parameters<HTMLElement["removeEventListener"]>));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface Options {
|
|
25
|
+
isPreventDefault?: boolean;
|
|
26
|
+
delay?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const preventContextMenu = (e: Event) => {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const useLongPress = (
|
|
34
|
+
callback: (e: TouchEvent | MouseEvent) => void,
|
|
35
|
+
{isPreventDefault = true, delay = 300}: Options = {}
|
|
36
|
+
) => {
|
|
37
|
+
const timeout = useRef<number | undefined>();
|
|
38
|
+
const target = useRef<EventTarget>();
|
|
39
|
+
const called = useRef<boolean>(false);
|
|
40
|
+
|
|
41
|
+
const start = useCallback(
|
|
42
|
+
(event: TouchEvent | MouseEvent) => {
|
|
43
|
+
// prevent ghost click on mobile devices
|
|
44
|
+
if (isPreventDefault && event.target) {
|
|
45
|
+
on(document, "contextmenu", preventContextMenu);
|
|
46
|
+
target.current = event.target;
|
|
47
|
+
}
|
|
48
|
+
timeout.current = window.setTimeout(() => {
|
|
49
|
+
called.current = true;
|
|
50
|
+
callback(event);
|
|
51
|
+
}, delay);
|
|
52
|
+
},
|
|
53
|
+
[callback, delay, isPreventDefault]
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const clear = useCallback(
|
|
57
|
+
(e: $TSFixMe) => {
|
|
58
|
+
// clearTimeout and removeEventListener
|
|
59
|
+
timeout.current && window.clearTimeout(timeout.current);
|
|
60
|
+
|
|
61
|
+
if (isPreventDefault && target.current) {
|
|
62
|
+
if (called.current) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
}
|
|
65
|
+
off(document, "contextmenu", preventContextMenu);
|
|
66
|
+
}
|
|
67
|
+
called.current = false;
|
|
68
|
+
},
|
|
69
|
+
[isPreventDefault]
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
onMouseDown: (e: $TSFixMe) => start(e),
|
|
74
|
+
onTouchStart: (e: $TSFixMe) => start(e),
|
|
75
|
+
onMouseUp: clear,
|
|
76
|
+
onMouseLeave: clear,
|
|
77
|
+
onTouchEnd: clear,
|
|
78
|
+
} as const;
|
|
79
|
+
};
|
package/src/use-me.tsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {createContext} from "@fibery/react/src/create-context";
|
|
2
|
+
import type {History} from "history";
|
|
3
|
+
|
|
4
|
+
type Navigation = {
|
|
5
|
+
resolveUpgradeLocation: () => {href: string; state: unknown};
|
|
6
|
+
history: History;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const [NavigationProvider, useNavigation] = createContext<Navigation>("Navigation");
|
|
10
|
+
|
|
11
|
+
export {NavigationProvider, useNavigation};
|