@fibery/ui-kit 1.35.0 → 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 +6 -40
- 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-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/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/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 +23 -9
- package/src/dnd.tsx +55 -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/Asterisk.ts +8 -0
- package/src/icons/ast/Copy.ts +1 -1
- package/src/icons/ast/CrossCircle.ts +8 -0
- package/src/icons/ast/Duplicate.ts +1 -1
- package/src/icons/ast/Gift.ts +1 -1
- package/src/icons/ast/LevelPlus.ts +8 -0
- package/src/icons/ast/ResetPassword.ts +8 -0
- package/src/icons/ast/ViewGantt.ts +8 -0
- package/src/icons/ast/index.tsx +6 -0
- package/src/icons/react/AccessTemplate.tsx +13 -0
- package/src/icons/react/Asterisk.tsx +13 -0
- package/src/icons/react/CrossCircle.tsx +13 -0
- package/src/icons/react/LevelPlus.tsx +13 -0
- package/src/icons/react/ResetPassword.tsx +13 -0
- package/src/icons/react/ViewGantt.tsx +13 -0
- package/src/icons/react/index.tsx +6 -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/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/select-in-popover.tsx +3 -0
- 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 +1 -1
- 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 +3 -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/antd/Tabs.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Tabs from "antd/lib/tabs";
|
|
2
|
+
import {forwardRef} from "react";
|
|
3
|
+
import {css, cx} from "@linaria/core";
|
|
4
|
+
import "antd/lib/tabs/style/css";
|
|
5
|
+
import {wrapWith} from "./utils";
|
|
6
|
+
import {textStyles, space, themeVars} from "../design-system";
|
|
7
|
+
|
|
8
|
+
export const tabsStyles = css`
|
|
9
|
+
${{
|
|
10
|
+
width: "100%",
|
|
11
|
+
"& .ant-tabs-bar": {
|
|
12
|
+
margin: 0,
|
|
13
|
+
},
|
|
14
|
+
"& .ant-tabs-nav-wrap": {
|
|
15
|
+
marginBottom: 1,
|
|
16
|
+
marginLeft: space.s12,
|
|
17
|
+
marginRight: space.s12,
|
|
18
|
+
},
|
|
19
|
+
"& .ant-tabs": {
|
|
20
|
+
overflow: "visible",
|
|
21
|
+
},
|
|
22
|
+
"& .ant-tabs-ink-bar": {
|
|
23
|
+
backgroundColor: themeVars.primary,
|
|
24
|
+
height: 2,
|
|
25
|
+
},
|
|
26
|
+
"& .ant-tabs-nav": {
|
|
27
|
+
margin: 0,
|
|
28
|
+
width: "100%",
|
|
29
|
+
},
|
|
30
|
+
"& .ant-tabs-tab, & .ant-tabs-tab:hover, & .ant-tabs-tab-btn:active, & .ant-tabs-tabpane, & .ant-tabs-tab-active .ant-tabs-tab-btn":
|
|
31
|
+
{
|
|
32
|
+
...textStyles.regular,
|
|
33
|
+
textShadow: "none",
|
|
34
|
+
},
|
|
35
|
+
"& .ant-tabs-tab": {
|
|
36
|
+
padding: "12px 12px",
|
|
37
|
+
margin: `0 ${space.s8}px 0 0`,
|
|
38
|
+
},
|
|
39
|
+
"& .ant-tabs-tab + .ant-tabs-tab": {
|
|
40
|
+
margin: `0 ${space.s8}px 0 0`,
|
|
41
|
+
},
|
|
42
|
+
".ant-tabs-top > .ant-tabs-nav::before": {
|
|
43
|
+
borderBottom: `1px solid ${themeVars.filterGroupBorder}`,
|
|
44
|
+
},
|
|
45
|
+
}}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
function getWrapper() {
|
|
49
|
+
return forwardRef(function TabWrapper({children, className}, ref) {
|
|
50
|
+
return (
|
|
51
|
+
<div className={cx(className, tabsStyles)} ref={ref}>
|
|
52
|
+
{children}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const AntTabs = wrapWith(getWrapper(tabsStyles), Tabs);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Modal from "antd/lib/modal";
|
|
2
|
+
import {ModalProps} from "antd/lib/modal/Modal";
|
|
3
|
+
import "antd/lib/modal/style/css";
|
|
4
|
+
import {createInlineTheme} from "../design-system";
|
|
5
|
+
import {useTheme} from "../theme-provider";
|
|
6
|
+
|
|
7
|
+
export function AntModal({bodyStyle = {}, className, ...restProps}: ModalProps) {
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const inlineTheme = createInlineTheme(theme);
|
|
10
|
+
return <Modal bodyStyle={{...bodyStyle, ...inlineTheme}} className={className} {...restProps} />;
|
|
11
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Upload, {UploadProps} from "antd/lib/upload";
|
|
2
|
+
import {ComponentPropsWithoutRef, forwardRef, FunctionComponent, PropsWithChildren} from "react";
|
|
3
|
+
import {css, cx} from "@linaria/core";
|
|
4
|
+
import "antd/lib/upload/style/css";
|
|
5
|
+
|
|
6
|
+
import {border, space, themeVars, transition} from "../design-system";
|
|
7
|
+
import {wrapWith} from "./utils";
|
|
8
|
+
import {UploadFile} from "antd/lib/upload/interface";
|
|
9
|
+
|
|
10
|
+
function getWrapper(wrapperClassName: string) {
|
|
11
|
+
return forwardRef<HTMLDivElement, ComponentPropsWithoutRef<"div">>(function UploadWrapper(
|
|
12
|
+
{className, ...props},
|
|
13
|
+
ref: React.ForwardedRef<HTMLDivElement>
|
|
14
|
+
) {
|
|
15
|
+
return <div className={cx(className, wrapperClassName)} ref={ref} {...props} />;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const antUploadStyle = css`
|
|
20
|
+
${{
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "stretch",
|
|
23
|
+
alignContent: "stretch",
|
|
24
|
+
"& > span": {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flex: 1,
|
|
27
|
+
alignItems: "stretch",
|
|
28
|
+
alignContent: "stretch",
|
|
29
|
+
},
|
|
30
|
+
"& .ant-upload.ant-upload-drag, .ant-upload.ant-upload-select-picture-card": {
|
|
31
|
+
border: `1px dashed ${themeVars.separator}`,
|
|
32
|
+
position: "relative",
|
|
33
|
+
backgroundColor: themeVars.transparent,
|
|
34
|
+
borderRadius: border.radius6,
|
|
35
|
+
transition: `border-color ${transition}`,
|
|
36
|
+
margin: 0,
|
|
37
|
+
flex: 1,
|
|
38
|
+
alignSelf: "stretch",
|
|
39
|
+
display: "flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
alignContent: "center",
|
|
42
|
+
width: "auto",
|
|
43
|
+
height: "auto",
|
|
44
|
+
"&.ant-upload-disabled": {
|
|
45
|
+
cursor: "not-allowed",
|
|
46
|
+
"&:hover": {
|
|
47
|
+
border: `1px dashed ${themeVars.separator}`,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
"& > .ant-upload": {
|
|
51
|
+
display: "flex",
|
|
52
|
+
flex: 1,
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
alignItems: "stretch",
|
|
55
|
+
alignContent: "stretch",
|
|
56
|
+
padding: space.s8,
|
|
57
|
+
},
|
|
58
|
+
"&.ant-upload-drag-hover": {
|
|
59
|
+
border: `1px dashed ${themeVars.primary}`,
|
|
60
|
+
transition: "none",
|
|
61
|
+
},
|
|
62
|
+
"&:hover": {
|
|
63
|
+
border: `1px dashed ${themeVars.primary}`,
|
|
64
|
+
transition: "none",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}}
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
export const AntUpload = wrapWith(getWrapper(antUploadStyle), Upload) as FunctionComponent<
|
|
71
|
+
PropsWithChildren<UploadProps>
|
|
72
|
+
>;
|
|
73
|
+
export type {UploadFile};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import TextArea from "antd/lib/input/TextArea";
|
|
2
|
+
import {TransparentInputWrapper} from "./input";
|
|
3
|
+
import {forwardRef, useRef} from "react";
|
|
4
|
+
import {css, cx} from "@linaria/core";
|
|
5
|
+
import {useComposedRefs} from "@fibery/react/src/use-composed-refs";
|
|
6
|
+
|
|
7
|
+
type AutoWidthTransparentTextAreaProps = React.ComponentPropsWithoutRef<typeof TextArea> & {
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
bypassedRef?: React.ForwardedRef<React.ElementRef<typeof TextArea>>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const wrapper = css`
|
|
13
|
+
display: inline-grid;
|
|
14
|
+
|
|
15
|
+
/* TODO: can be replaced with field-sizing: content; once we get better browser support */
|
|
16
|
+
&::after {
|
|
17
|
+
content: attr(data-value);
|
|
18
|
+
white-space: pre-wrap;
|
|
19
|
+
word-wrap: break-word;
|
|
20
|
+
visibility: hidden;
|
|
21
|
+
display: block;
|
|
22
|
+
grid-area: 1 / 1;
|
|
23
|
+
min-width: 0;
|
|
24
|
+
|
|
25
|
+
/* height auto-size is managed by antd */
|
|
26
|
+
height: 1px;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const textArea = css`
|
|
30
|
+
grid-area: 1 / 1;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const AutoWidthTransparentTextArea = forwardRef<HTMLDivElement, AutoWidthTransparentTextAreaProps>(
|
|
34
|
+
function AutoWidthTransparentTextArea({onChange, style, className, wrapperClassName, ...props}, ref) {
|
|
35
|
+
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
36
|
+
const composedRef = useComposedRefs(ref, wrapperRef);
|
|
37
|
+
|
|
38
|
+
const handleChange: React.ChangeEventHandler<HTMLTextAreaElement> = (e) => {
|
|
39
|
+
if (wrapperRef.current) {
|
|
40
|
+
wrapperRef.current.dataset.value = e.target.value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onChange?.(e);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<TransparentInputWrapper
|
|
48
|
+
className={cx(wrapper, wrapperClassName)}
|
|
49
|
+
data-value={props.value || props.placeholder}
|
|
50
|
+
ref={composedRef}
|
|
51
|
+
>
|
|
52
|
+
<TextArea className={cx(textArea, className)} style={style} onChange={handleChange} cols={1} {...props} />
|
|
53
|
+
</TransparentInputWrapper>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {cx} from "@linaria/core";
|
|
2
|
+
import {forwardRef} from "react";
|
|
3
|
+
|
|
4
|
+
export function getWrapper(wrapperClassName: string) {
|
|
5
|
+
return forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<"div">>(function InputWrapper(
|
|
6
|
+
{className, ...props},
|
|
7
|
+
ref
|
|
8
|
+
) {
|
|
9
|
+
return <div ref={ref} className={cx(className, wrapperClassName)} {...props} />;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import InputNumber from "antd/lib/input-number";
|
|
2
|
+
import "antd/lib/input-number/style/css";
|
|
3
|
+
import {css} from "@linaria/core";
|
|
4
|
+
import {textStyles, themeVars} from "../design-system";
|
|
5
|
+
import {getWrapper} from "./get-wrapper";
|
|
6
|
+
import {wrapWith} from "./utils";
|
|
7
|
+
import {inputOverrides} from "./styles";
|
|
8
|
+
|
|
9
|
+
const inputNumberStyles = css`
|
|
10
|
+
${{
|
|
11
|
+
"& .ant-input-number": {
|
|
12
|
+
height: "auto",
|
|
13
|
+
border: "none",
|
|
14
|
+
...textStyles.regular,
|
|
15
|
+
backgroundColor: themeVars.transparent,
|
|
16
|
+
},
|
|
17
|
+
"& .ant-input-number-handler-wrap": {
|
|
18
|
+
top: 1,
|
|
19
|
+
bottom: 1,
|
|
20
|
+
right: 1,
|
|
21
|
+
height: "auto",
|
|
22
|
+
backgroundColor: themeVars.transparent,
|
|
23
|
+
background: themeVars.transparent,
|
|
24
|
+
},
|
|
25
|
+
"& .ant-input-number-focused": {boxShadow: "none"},
|
|
26
|
+
"& .ant-input-number-handler-down": {borderTop: `1px solid ${themeVars.separatorColor} !important`},
|
|
27
|
+
"& .ant-input-number-input:hover": inputOverrides.hover,
|
|
28
|
+
"& .ant-input-number-input:focus, & .ant-input-number-input:active, & .ant-input-number-focused .ant-input-number-input":
|
|
29
|
+
inputOverrides.focus,
|
|
30
|
+
"& .ant-input-number-input": inputOverrides.main,
|
|
31
|
+
"& .ant-input-number-disabled": {backgroundColor: themeVars.transparent},
|
|
32
|
+
"& .ant-input-number-disabled .ant-input-number-input": inputOverrides.disabled,
|
|
33
|
+
"& .ant-input-number-handler-up-inner, & .ant-input-number-handler-down-inner": {
|
|
34
|
+
color: themeVars.iconColor,
|
|
35
|
+
},
|
|
36
|
+
"& .ant-input-number-handler": {
|
|
37
|
+
color: themeVars.iconColor,
|
|
38
|
+
borderLeft: `1px solid ${themeVars.separatorColor}`,
|
|
39
|
+
"&:active": {
|
|
40
|
+
backgroundColor: themeVars.transparent,
|
|
41
|
+
},
|
|
42
|
+
"&:hover": {
|
|
43
|
+
"& .ant-input-number-handler-up-inner, & .ant-input-number-handler-down-inner": {
|
|
44
|
+
color: themeVars.textColor,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export const AntInputNumber = wrapWith(getWrapper(inputNumberStyles), InputNumber);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {getWrapper} from "./get-wrapper";
|
|
2
|
+
import Input from "antd/lib/input";
|
|
3
|
+
import "antd/lib/input/style/css";
|
|
4
|
+
import {css} from "@linaria/core";
|
|
5
|
+
import {opacity, textStyles, themeVars} from "../design-system";
|
|
6
|
+
|
|
7
|
+
import {inputStyles} from "./styles";
|
|
8
|
+
import {wrapWith} from "./utils";
|
|
9
|
+
|
|
10
|
+
const TextArea = Input.TextArea;
|
|
11
|
+
|
|
12
|
+
export const transparentInputStyle = css`
|
|
13
|
+
${{
|
|
14
|
+
"& input, & textarea, & .ant-input-affix-wrapper": {
|
|
15
|
+
padding: 0,
|
|
16
|
+
border: "none",
|
|
17
|
+
width: "100%",
|
|
18
|
+
resize: "none",
|
|
19
|
+
borderRadius: 0,
|
|
20
|
+
backgroundColor: themeVars.transparent,
|
|
21
|
+
transition: "none",
|
|
22
|
+
...textStyles.regular,
|
|
23
|
+
...textStyles.numeric.tabularOff,
|
|
24
|
+
},
|
|
25
|
+
"& textarea.ant-input": {
|
|
26
|
+
fontVariant: "inherit",
|
|
27
|
+
},
|
|
28
|
+
"& input.ant-input-disabled, & textarea.ant-input-disabled": {
|
|
29
|
+
WebkitTextFillColor: "currentColor",
|
|
30
|
+
opacity: opacity.opacity40,
|
|
31
|
+
backgroundColor: themeVars.transparent,
|
|
32
|
+
cursor: "default",
|
|
33
|
+
},
|
|
34
|
+
"& input:focus, & textarea:focus, & .ant-input-affix-wrapper-focused": {
|
|
35
|
+
boxShadow: "none",
|
|
36
|
+
},
|
|
37
|
+
"& input::placeholder, & textarea::placeholder": {
|
|
38
|
+
color: themeVars.inputPlaceholderTextColor,
|
|
39
|
+
},
|
|
40
|
+
}}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const InputWrapper = getWrapper(inputStyles);
|
|
44
|
+
|
|
45
|
+
export const StyledInput = wrapWith(InputWrapper, Input);
|
|
46
|
+
|
|
47
|
+
export const StyledTextArea = wrapWith(InputWrapper, TextArea);
|
|
48
|
+
|
|
49
|
+
export const TransparentInputWrapper = getWrapper(transparentInputStyle);
|
|
50
|
+
export const StyledTransparentInput = wrapWith(TransparentInputWrapper, Input);
|
|
51
|
+
|
|
52
|
+
export type TextAreaRef = React.ElementRef<typeof TextArea>;
|
|
53
|
+
export const AntTransparentTextArea = wrapWith(TransparentInputWrapper, TextArea);
|
|
54
|
+
|
|
55
|
+
export type InputRef = React.ElementRef<typeof Input>;
|
|
56
|
+
export const AntTransparentInput = StyledTransparentInput;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {ElementType, forwardRef, useCallback, useRef} from "react";
|
|
2
|
+
|
|
3
|
+
export const createBodyNode = (className: string) => {
|
|
4
|
+
const node = document.createElement("div");
|
|
5
|
+
node.className = className;
|
|
6
|
+
document.body.appendChild(node);
|
|
7
|
+
return node;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const removeBodyNode = (node: Node) => {
|
|
11
|
+
document.body.removeChild(node);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const wrapWith = <C extends React.ElementType>(
|
|
15
|
+
WrapperComponent: ElementType,
|
|
16
|
+
Component: C
|
|
17
|
+
): React.FC<
|
|
18
|
+
React.ComponentPropsWithoutRef<C> & {bypassedRef?: React.ForwardedRef<React.ElementRef<C>>; wrapClassName?: string}
|
|
19
|
+
> => {
|
|
20
|
+
return function WrapWith({bypassedRef, className, wrapClassName, ...props}) {
|
|
21
|
+
return (
|
|
22
|
+
<WrapperComponent className={wrapClassName}>
|
|
23
|
+
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
24
|
+
<Component ref={bypassedRef} className={className} {...(props as any)} />
|
|
25
|
+
</WrapperComponent>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const wrapWithPopupContainer = <C extends React.ElementType>(Wrapper: ElementType, WrappedComponent: C) => {
|
|
31
|
+
return forwardRef(function ProvidePopupContainerGetter(props, forwardedRef) {
|
|
32
|
+
const wrapperRef = useRef();
|
|
33
|
+
const getPopupContainer = useCallback(() => {
|
|
34
|
+
return wrapperRef.current;
|
|
35
|
+
}, []);
|
|
36
|
+
return (
|
|
37
|
+
<Wrapper ref={wrapperRef}>
|
|
38
|
+
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
39
|
+
<WrappedComponent ref={forwardedRef} getPopupContainer={getPopupContainer} {...(props as any)} />
|
|
40
|
+
</Wrapper>
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import {FC, Suspense, lazy} from "react";
|
|
4
|
+
import {a11yColor} from "./a11y-color";
|
|
5
|
+
import {AppIconWrapper} from "./app-icon-wrapper";
|
|
6
|
+
import {getAppIconBackgroundColor, getOpacities, getThemeValue, iconSize, layout} from "./design-system";
|
|
7
|
+
import {Icon} from "./icons/Icon";
|
|
8
|
+
import {useTheme} from "./theme-provider";
|
|
9
|
+
|
|
10
|
+
type AppIcon = {
|
|
11
|
+
name: string;
|
|
12
|
+
short_names: string[];
|
|
13
|
+
customCategory: string;
|
|
14
|
+
text: string;
|
|
15
|
+
emoticons: string[];
|
|
16
|
+
keywords: string[];
|
|
17
|
+
imageUrl: string;
|
|
18
|
+
file: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const IconLoader: FC<{containerSize?: number}> = ({containerSize = iconSize}) => {
|
|
22
|
+
return (
|
|
23
|
+
<div
|
|
24
|
+
style={{
|
|
25
|
+
width: containerSize,
|
|
26
|
+
height: containerSize,
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function getImageUrl(emoji: AppIcon) {
|
|
33
|
+
if (emoji.file) {
|
|
34
|
+
// svg use does not support CORS so we can't use CDN here
|
|
35
|
+
return `/images/app-icons/${emoji.file}#${emoji.file.replace(".svg", "")}`;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface UglyExternalIconImplProps {
|
|
41
|
+
color?: string | null;
|
|
42
|
+
name: string;
|
|
43
|
+
iconSize?: number;
|
|
44
|
+
containerSize?: number;
|
|
45
|
+
appIconsLookup: Record<string, AppIcon>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const UglyExternalIconImpl: FC<UglyExternalIconImplProps> = ({
|
|
49
|
+
color,
|
|
50
|
+
iconSize = 16,
|
|
51
|
+
name,
|
|
52
|
+
containerSize,
|
|
53
|
+
appIconsLookup,
|
|
54
|
+
}) => {
|
|
55
|
+
const icon = appIconsLookup[name] || appIconsLookup["question-circle"];
|
|
56
|
+
|
|
57
|
+
const imageUrl = getImageUrl(icon);
|
|
58
|
+
|
|
59
|
+
return imageUrl ? (
|
|
60
|
+
<Icon
|
|
61
|
+
viewBox="0 0 24 24"
|
|
62
|
+
className={css`
|
|
63
|
+
${{
|
|
64
|
+
"& *[stroke]": {
|
|
65
|
+
stroke: "currentColor",
|
|
66
|
+
strokeWidth: 3,
|
|
67
|
+
},
|
|
68
|
+
"& *": {
|
|
69
|
+
fill: "currentColor",
|
|
70
|
+
},
|
|
71
|
+
"& *[fill='none']": {
|
|
72
|
+
fill: "none",
|
|
73
|
+
},
|
|
74
|
+
}}
|
|
75
|
+
`}
|
|
76
|
+
containerSize={containerSize}
|
|
77
|
+
iconSize={iconSize}
|
|
78
|
+
color={color}
|
|
79
|
+
>
|
|
80
|
+
<use href={imageUrl} />
|
|
81
|
+
</Icon>
|
|
82
|
+
) : (
|
|
83
|
+
<IconLoader containerSize={containerSize} />
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
type UglyExternalIconProps = Omit<UglyExternalIconImplProps, "appIconsLookup">;
|
|
88
|
+
|
|
89
|
+
const UglyExternalIcon = lazy(async () => {
|
|
90
|
+
const appIcons = await import("./appIcons.json");
|
|
91
|
+
const appIconsLookup = _.fromPairs(
|
|
92
|
+
appIcons.default.flatMap((appIcon) => appIcon.short_names.map((shortName) => [shortName, appIcon]))
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
default: function UglyExternalIcon(props: UglyExternalIconProps) {
|
|
97
|
+
return <UglyExternalIconImpl appIconsLookup={appIconsLookup} {...props} />;
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export interface AppIconWithFallbackProps {
|
|
103
|
+
name: string;
|
|
104
|
+
color?: string | null;
|
|
105
|
+
iconSize?: number;
|
|
106
|
+
containerSize?: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const AppIconWithFallback: FC<AppIconWithFallbackProps> = ({containerSize, name, color, iconSize}) => {
|
|
110
|
+
return (
|
|
111
|
+
<Suspense fallback={<IconLoader containerSize={containerSize} />}>
|
|
112
|
+
<UglyExternalIcon containerSize={containerSize} color={color} name={name} iconSize={iconSize} />
|
|
113
|
+
</Suspense>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
interface AppIconProps {
|
|
118
|
+
icon: string;
|
|
119
|
+
color: string;
|
|
120
|
+
iconSize?: number;
|
|
121
|
+
isSelected?: boolean;
|
|
122
|
+
containerSize?: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const AppIcon: FC<AppIconProps> = ({
|
|
126
|
+
icon,
|
|
127
|
+
iconSize = 18,
|
|
128
|
+
color,
|
|
129
|
+
isSelected,
|
|
130
|
+
containerSize = layout.newMenuIconSize,
|
|
131
|
+
}) => {
|
|
132
|
+
const theme = useTheme();
|
|
133
|
+
|
|
134
|
+
const iconColor = getThemeValue(theme.mode, {
|
|
135
|
+
dark: a11yColor(getOpacities(color).opacity95, theme.menuBg, 5),
|
|
136
|
+
light: a11yColor(getOpacities(color).opacity95, theme.whiteColor, 3),
|
|
137
|
+
light2: a11yColor(getOpacities(color).opacity95, theme.menuBg, 5),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const bgColor = getAppIconBackgroundColor(theme.mode, color);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<AppIconWrapper color={bgColor as string} borderless={isSelected} containerSize={containerSize}>
|
|
144
|
+
<AppIconWithFallback name={icon} color={iconColor as string} containerSize={containerSize} iconSize={iconSize} />
|
|
145
|
+
</AppIconWrapper>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import cn from "classnames";
|
|
3
|
+
import {ReactNode} from "react";
|
|
4
|
+
import {border, getThemeValue, layout} from "./design-system";
|
|
5
|
+
import {useTheme} from "./theme-provider";
|
|
6
|
+
|
|
7
|
+
export const appIconSize = layout.newMenuIconSize;
|
|
8
|
+
|
|
9
|
+
const appIconContainerStyle = css`
|
|
10
|
+
border-radius: ${border.radius4}px;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const appIconGradientStyle = css`
|
|
14
|
+
${{
|
|
15
|
+
backgroundImage: "linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0))",
|
|
16
|
+
}}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const AppIconWrapper = ({
|
|
20
|
+
children,
|
|
21
|
+
color,
|
|
22
|
+
borderless,
|
|
23
|
+
containerSize = layout.newMenuIconSize,
|
|
24
|
+
}: {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
color: string;
|
|
27
|
+
borderless?: boolean;
|
|
28
|
+
containerSize?: number;
|
|
29
|
+
}) => {
|
|
30
|
+
const theme = useTheme();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
style={{backgroundColor: borderless ? "transparent" : color, width: containerSize, height: containerSize}}
|
|
35
|
+
className={cn(
|
|
36
|
+
appIconContainerStyle,
|
|
37
|
+
!borderless &&
|
|
38
|
+
getThemeValue(theme.mode, {light2: appIconGradientStyle, dark: appIconGradientStyle, light: null})
|
|
39
|
+
)}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
package/src/app-icon.tsx
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import {FC} from "react";
|
|
4
|
+
import {a11yColor} from "./a11y-color";
|
|
5
|
+
import {AppIconWithFallback} from "./app-icon-with-fallback";
|
|
6
|
+
import {border, getAppIconBackgroundColor, getOpacities, getThemeValue} from "./design-system";
|
|
7
|
+
import {useTheme} from "./theme-provider";
|
|
8
|
+
|
|
9
|
+
interface AppIconProps {
|
|
10
|
+
color: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
iconSize?: number;
|
|
13
|
+
containerSize?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const AppIcon: FC<AppIconProps> = ({color, icon, containerSize = 54, iconSize = 36, className}) => {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const iconColor = getThemeValue(theme.mode, {
|
|
20
|
+
dark: a11yColor(getOpacities(color).opacity95, theme.menuBg, 5),
|
|
21
|
+
light: a11yColor(getOpacities(color).opacity95, theme.whiteColor, 3),
|
|
22
|
+
light2: a11yColor(getOpacities(color).opacity95, theme.menuBg, 5),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const bgColor = getAppIconBackgroundColor(theme.mode, color);
|
|
26
|
+
|
|
27
|
+
const appIconGradientStyle = getThemeValue(theme.mode, {
|
|
28
|
+
dark: "linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0))",
|
|
29
|
+
light: "none",
|
|
30
|
+
light2: "linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0))",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
className={cx(
|
|
36
|
+
css`
|
|
37
|
+
display: flex;
|
|
38
|
+
border-radius: ${border.radius4}px;
|
|
39
|
+
`,
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
style={{
|
|
43
|
+
backgroundColor: bgColor,
|
|
44
|
+
backgroundImage: appIconGradientStyle,
|
|
45
|
+
width: containerSize,
|
|
46
|
+
height: containerSize,
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<AppIconWithFallback containerSize={containerSize} color={iconColor as string} name={icon} iconSize={iconSize} />
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
package/src/app-mode.tsx
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {createContext, useState, useLayoutEffect, useContext} from "react";
|
|
2
|
+
import {getMediaQueryList, subscribeOnChange} from "./media-query-utils";
|
|
3
|
+
|
|
4
|
+
export const appModes = {
|
|
5
|
+
l: 3,
|
|
6
|
+
xl: 4,
|
|
7
|
+
} as const;
|
|
8
|
+
export type AppMode = 3 | 4;
|
|
9
|
+
const lSize = 1024;
|
|
10
|
+
export const lQuery = `(max-width: ${lSize}px)`;
|
|
11
|
+
|
|
12
|
+
const mediaQueryList = getMediaQueryList(lQuery);
|
|
13
|
+
function getMode(mql: MediaQueryList | MediaQueryListEvent): AppMode {
|
|
14
|
+
return mql.matches ? appModes.l : appModes.xl;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getCurrentAppMode(): AppMode {
|
|
18
|
+
return getMode(getMediaQueryList(lQuery));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const initialMode = getMode(mediaQueryList);
|
|
22
|
+
|
|
23
|
+
const appModeContext = createContext<AppMode>(initialMode);
|
|
24
|
+
|
|
25
|
+
export function useAppMode(): AppMode {
|
|
26
|
+
return useContext(appModeContext);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function AppModeProvider({children}: {children: React.ReactNode}): JSX.Element {
|
|
30
|
+
const [mode, setMode] = useState<AppMode>(initialMode);
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
if (initialMode < appModes.xl) {
|
|
33
|
+
document.body.classList.add("small-mode");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const listener = (evt: MediaQueryListEvent) => {
|
|
37
|
+
const mode = getMode(evt);
|
|
38
|
+
setMode(mode);
|
|
39
|
+
if (mode < appModes.xl) {
|
|
40
|
+
document.body.classList.add("small-mode");
|
|
41
|
+
} else {
|
|
42
|
+
document.body.classList.remove("small-mode");
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const unsubscribe = subscribeOnChange(mediaQueryList, listener);
|
|
46
|
+
|
|
47
|
+
return () => {
|
|
48
|
+
unsubscribe();
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return <appModeContext.Provider value={mode}>{children}</appModeContext.Provider>;
|
|
52
|
+
}
|