@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,61 @@
|
|
|
1
|
+
import {stopPropagation} from "@fibery/react/src/stop-propagation";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
import {useCallback, useEffect, useRef, useState} from "react";
|
|
4
|
+
import {ControlledDatePickerProps} from "./types";
|
|
5
|
+
|
|
6
|
+
const noOutline = css`
|
|
7
|
+
outline: none;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const withPopupControl = <P extends object>(Component: React.ComponentType<P & ControlledDatePickerProps>) =>
|
|
11
|
+
function WithPopupControl(props: P) {
|
|
12
|
+
const [open, setOpen] = useState(false);
|
|
13
|
+
const timeoutIdRef = useRef<ReturnType<typeof setTimeout>>();
|
|
14
|
+
|
|
15
|
+
const onOpen = useCallback(() => {
|
|
16
|
+
timeoutIdRef.current = setTimeout(() => {
|
|
17
|
+
setOpen(true);
|
|
18
|
+
}, 0);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
const onClose = useCallback(() => {
|
|
22
|
+
timeoutIdRef.current = setTimeout(() => {
|
|
23
|
+
setOpen(false);
|
|
24
|
+
// Input needs to fire onBlur before unmounting
|
|
25
|
+
}, 0);
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
return () => {
|
|
30
|
+
if (timeoutIdRef.current) {
|
|
31
|
+
clearTimeout(timeoutIdRef.current);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
37
|
+
const cmdKeyPressed = event.metaKey || event.ctrlKey;
|
|
38
|
+
if (event.key === "Enter" && cmdKeyPressed) {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
}
|
|
41
|
+
if (event.key === "Escape" && open) {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
setOpen(false);
|
|
44
|
+
} else if (((event.key === "Enter" && !cmdKeyPressed) || event.key === " ") && !open) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
setOpen(true);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
onKeyDown={onKeyDown}
|
|
53
|
+
className={noOutline}
|
|
54
|
+
onClick={stopPropagation}
|
|
55
|
+
onMouseDown={stopPropagation}
|
|
56
|
+
onMouseUp={stopPropagation}
|
|
57
|
+
>
|
|
58
|
+
<Component {...props} open={open} onOpen={onOpen} onClose={onClose} />
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {ChangeEvent} from "react";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
import {colors, themeVars} from "../design-system";
|
|
4
|
+
import {inputOverrides} from "../antd/styles";
|
|
5
|
+
|
|
6
|
+
export type Props<T extends number> = {
|
|
7
|
+
value: Array<T>;
|
|
8
|
+
onChange: (v: Array<T>) => void;
|
|
9
|
+
days: Array<{key: string; title: string; value: T}>;
|
|
10
|
+
allowEmpty?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const daySize = "28px";
|
|
14
|
+
|
|
15
|
+
const checkboxInput = css`
|
|
16
|
+
position: absolute;
|
|
17
|
+
appearance: none;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const checkbox = css`
|
|
21
|
+
position: absolute;
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
width: ${daySize};
|
|
25
|
+
height: ${daySize};
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
color: ${themeVars.accentTextColor};
|
|
30
|
+
background-color: ${themeVars.unitBg};
|
|
31
|
+
.${checkboxInput}:checked + & {
|
|
32
|
+
color: ${colors.inversedTextColor};
|
|
33
|
+
background-color: ${themeVars.primary};
|
|
34
|
+
}
|
|
35
|
+
.${checkboxInput}:focus-visible + & {
|
|
36
|
+
${inputOverrides.focus}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
function Day<T extends number>({
|
|
41
|
+
value,
|
|
42
|
+
onChange,
|
|
43
|
+
checked,
|
|
44
|
+
title,
|
|
45
|
+
}: {
|
|
46
|
+
value: T;
|
|
47
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
48
|
+
checked: boolean;
|
|
49
|
+
title: string;
|
|
50
|
+
}): JSX.Element {
|
|
51
|
+
return (
|
|
52
|
+
<label
|
|
53
|
+
className={css`
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
position: relative;
|
|
56
|
+
width: ${daySize};
|
|
57
|
+
height: ${daySize};
|
|
58
|
+
`}
|
|
59
|
+
>
|
|
60
|
+
<input className={checkboxInput} onChange={onChange} checked={checked} type="checkbox" value={value} />
|
|
61
|
+
<div className={checkbox}>{title}</div>
|
|
62
|
+
</label>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function DaySelect<T extends number>({value = [], onChange, days, allowEmpty = false}: Props<T>): JSX.Element {
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
className={css`
|
|
70
|
+
grid-template-columns: repeat(7, min-content);
|
|
71
|
+
gap: 4px;
|
|
72
|
+
display: grid;
|
|
73
|
+
`}
|
|
74
|
+
>
|
|
75
|
+
{days.map(({key, value: v, title}) => {
|
|
76
|
+
return (
|
|
77
|
+
<Day
|
|
78
|
+
checked={value.includes(v)}
|
|
79
|
+
onChange={({currentTarget: {checked}}) => {
|
|
80
|
+
if (checked) {
|
|
81
|
+
onChange(value.concat(v));
|
|
82
|
+
} else if (allowEmpty || value.length > 1) {
|
|
83
|
+
onChange(value.filter((val) => val !== v));
|
|
84
|
+
}
|
|
85
|
+
}}
|
|
86
|
+
key={key}
|
|
87
|
+
title={title}
|
|
88
|
+
value={v}
|
|
89
|
+
/>
|
|
90
|
+
);
|
|
91
|
+
})}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import {DaySelect, Props} from "./day-select";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
const isoWeekDays = _.range(1, 8).map((day) => {
|
|
6
|
+
return {
|
|
7
|
+
key: String(day),
|
|
8
|
+
title: moment().isoWeekday(day).format("dd").charAt(0),
|
|
9
|
+
value: day,
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export function IsoWeekdaySelect({value, onChange, allowEmpty}: Omit<Props<number>, "days">): JSX.Element {
|
|
14
|
+
return <DaySelect value={value} onChange={onChange} days={isoWeekDays} allowEmpty={allowEmpty} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {DaySelect, Props} from "./day-select";
|
|
2
|
+
|
|
3
|
+
const days = Array.from({length: 28}).map((_, index) => {
|
|
4
|
+
const value = index + 1;
|
|
5
|
+
const key = String(value);
|
|
6
|
+
return {key: String(value), title: key, value};
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export function MonthdaySelect({value = [], onChange}: Omit<Props<number>, "days">): JSX.Element {
|
|
10
|
+
return <DaySelect value={value} onChange={onChange} days={days} />;
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {getDays} from "./week-day-select";
|
|
2
|
+
|
|
3
|
+
describe("getDays", () => {
|
|
4
|
+
it("monday", () => {
|
|
5
|
+
expect(getDays(0)).toEqual([
|
|
6
|
+
{key: "MO", title: "M", value: 0},
|
|
7
|
+
{key: "TU", title: "T", value: 1},
|
|
8
|
+
{key: "WE", title: "W", value: 2},
|
|
9
|
+
{key: "TH", title: "T", value: 3},
|
|
10
|
+
{key: "FR", title: "F", value: 4},
|
|
11
|
+
{key: "SA", title: "S", value: 5},
|
|
12
|
+
{key: "SU", title: "S", value: 6},
|
|
13
|
+
]);
|
|
14
|
+
});
|
|
15
|
+
it("wednesday", () => {
|
|
16
|
+
expect(getDays(2)).toEqual([
|
|
17
|
+
{key: "WE", title: "W", value: 2},
|
|
18
|
+
{key: "TH", title: "T", value: 3},
|
|
19
|
+
{key: "FR", title: "F", value: 4},
|
|
20
|
+
{key: "SA", title: "S", value: 5},
|
|
21
|
+
{key: "SU", title: "S", value: 6},
|
|
22
|
+
{key: "MO", title: "M", value: 0},
|
|
23
|
+
{key: "TU", title: "T", value: 1},
|
|
24
|
+
]);
|
|
25
|
+
});
|
|
26
|
+
it("saturday", () => {
|
|
27
|
+
expect(getDays(5)).toEqual([
|
|
28
|
+
{key: "SA", title: "S", value: 5},
|
|
29
|
+
{key: "SU", title: "S", value: 6},
|
|
30
|
+
{key: "MO", title: "M", value: 0},
|
|
31
|
+
{key: "TU", title: "T", value: 1},
|
|
32
|
+
{key: "WE", title: "W", value: 2},
|
|
33
|
+
{key: "TH", title: "T", value: 3},
|
|
34
|
+
{key: "FR", title: "F", value: 4},
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
it("sunday", () => {
|
|
38
|
+
expect(getDays(6)).toEqual([
|
|
39
|
+
{key: "SU", title: "S", value: 6},
|
|
40
|
+
{key: "MO", title: "M", value: 0},
|
|
41
|
+
{key: "TU", title: "T", value: 1},
|
|
42
|
+
{key: "WE", title: "W", value: 2},
|
|
43
|
+
{key: "TH", title: "T", value: 3},
|
|
44
|
+
{key: "FR", title: "F", value: 4},
|
|
45
|
+
{key: "SA", title: "S", value: 5},
|
|
46
|
+
]);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import {DaySelect, Props} from "./day-select";
|
|
3
|
+
|
|
4
|
+
export enum Days {
|
|
5
|
+
MO = 0,
|
|
6
|
+
TU = 1,
|
|
7
|
+
WE = 2,
|
|
8
|
+
TH = 3,
|
|
9
|
+
FR = 4,
|
|
10
|
+
SA = 5,
|
|
11
|
+
SU = 6,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const WeekDayMap = {
|
|
15
|
+
MO: Days.MO,
|
|
16
|
+
TU: Days.TU,
|
|
17
|
+
WE: Days.WE,
|
|
18
|
+
TH: Days.TH,
|
|
19
|
+
FR: Days.FR,
|
|
20
|
+
SA: Days.SA,
|
|
21
|
+
SU: Days.SU,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const getDays = _.memoize((firstDay) => {
|
|
25
|
+
const entries = Object.entries(WeekDayMap);
|
|
26
|
+
const firstDayIndex = entries.findIndex((entry) => entry[1] === firstDay);
|
|
27
|
+
const partA = entries.slice(firstDayIndex);
|
|
28
|
+
const partB = firstDayIndex === 0 ? [] : entries.slice(0, firstDayIndex);
|
|
29
|
+
const sortedArr = [...partA, ...partB];
|
|
30
|
+
return sortedArr.map(([key, v]) => {
|
|
31
|
+
return {key: key, title: key[0], value: v};
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function WeekdaySelect({
|
|
36
|
+
value = [],
|
|
37
|
+
onChange,
|
|
38
|
+
firstDay,
|
|
39
|
+
}: Omit<Props<Days>, "days"> & {firstDay: number}): JSX.Element {
|
|
40
|
+
const days = getDays(firstDay);
|
|
41
|
+
return <DaySelect value={value} onChange={onChange} days={days} />;
|
|
42
|
+
}
|
package/src/delayed.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, {useEffect, useState} from "react";
|
|
2
|
+
|
|
3
|
+
export const defaultLoaderDelay = 1000;
|
|
4
|
+
|
|
5
|
+
export const Delayed: React.FC<React.PropsWithChildren<{delayMs: number}>> = ({children, delayMs}) => {
|
|
6
|
+
const [isVisible, setVisible] = useState(delayMs === 0);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!delayMs) {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
11
|
+
return () => {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const timeout = window.setTimeout(() => {
|
|
15
|
+
setVisible(true);
|
|
16
|
+
}, delayMs);
|
|
17
|
+
|
|
18
|
+
return () => {
|
|
19
|
+
window.clearTimeout(timeout);
|
|
20
|
+
};
|
|
21
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33006
|
|
25
|
+
return isVisible ? (children as React.ReactElement) : null;
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {getLightColors, getDarkColors, getLight2Colors} from "./design-system";
|
|
2
|
+
|
|
3
|
+
function getKeys(colors: Record<string, string | Record<string, string>>) {
|
|
4
|
+
const keys = [];
|
|
5
|
+
for (const [key, value] of Object.entries(colors)) {
|
|
6
|
+
if (typeof value === "string") {
|
|
7
|
+
keys.push(key);
|
|
8
|
+
} else {
|
|
9
|
+
const nestedKeys: Record<string, string[]> = {[key]: []};
|
|
10
|
+
for (const [nestedKey] of Object.entries(value)) {
|
|
11
|
+
nestedKeys[key].push(nestedKey);
|
|
12
|
+
}
|
|
13
|
+
keys.push(nestedKeys);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return keys.sort();
|
|
17
|
+
}
|
|
18
|
+
it("dark and light color should have the same keys", () => {
|
|
19
|
+
const lKeys = getKeys(getLightColors());
|
|
20
|
+
const dKeys = getKeys(getDarkColors());
|
|
21
|
+
const l2Keys = getKeys(getLight2Colors());
|
|
22
|
+
expect(lKeys).toEqual(dKeys);
|
|
23
|
+
expect(l2Keys).toEqual(dKeys);
|
|
24
|
+
});
|
package/src/design-system.ts
CHANGED
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
} from "./palette";
|
|
23
23
|
import {ThemeMode} from "./theme-settings";
|
|
24
24
|
|
|
25
|
-
export const typeSizes = [
|
|
25
|
+
export const typeSizes = [30, 24, 18, 16, 14, 12, 10, 8] as const;
|
|
26
26
|
|
|
27
27
|
export const fontWeight = {
|
|
28
|
-
light: 300,
|
|
29
|
-
regular: 400,
|
|
28
|
+
light: 310, // 300 basic, 310 experiment with a variable Inter
|
|
29
|
+
regular: 410, // 400 basic, 410 experiment with a variable Inter
|
|
30
30
|
medium: 500,
|
|
31
31
|
semibold: 600,
|
|
32
32
|
bold: 700,
|
|
@@ -106,15 +106,15 @@ const shades = getOpacities("#000000");
|
|
|
106
106
|
const lights = getOpacities("#FFFFFF");
|
|
107
107
|
|
|
108
108
|
export const separators = {
|
|
109
|
-
..._.mapValues(shades, (shade) => `
|
|
109
|
+
..._.mapValues(shades, (shade) => `0.5px solid ${shade}`),
|
|
110
110
|
} as const;
|
|
111
111
|
|
|
112
112
|
export const inversedSeparators = {
|
|
113
|
-
..._.mapValues(lights, (light) => `
|
|
113
|
+
..._.mapValues(lights, (light) => `0.5px solid ${light}`),
|
|
114
114
|
} as const;
|
|
115
115
|
|
|
116
116
|
export const fontFamily =
|
|
117
|
-
"
|
|
117
|
+
'"Inter Variable", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif';
|
|
118
118
|
|
|
119
119
|
const stateColors = {
|
|
120
120
|
success: "rgba(8, 189, 159, 1)",
|
|
@@ -143,6 +143,12 @@ export const themeColors = {
|
|
|
143
143
|
colorSubtleBgAI: ["hsla(271, 57%, 61%, 0.05)", "hsla(272, 43%, 50%, 0.1)"],
|
|
144
144
|
|
|
145
145
|
// Shadows and effects / Elevation
|
|
146
|
+
shadow50: [
|
|
147
|
+
`
|
|
148
|
+
0px 0px 0px 0.5px ${getOpacities(slate.slate12).opacity5}
|
|
149
|
+
`,
|
|
150
|
+
`0px 0px 0px 0.5px ${getOpacities(slateDark.slate12).opacity15}`,
|
|
151
|
+
],
|
|
146
152
|
shadow100: [
|
|
147
153
|
`
|
|
148
154
|
0px 1px 4px 0px ${getOpacities(slate.slate12).opacity5}
|
|
@@ -226,15 +232,15 @@ export const themeColors = {
|
|
|
226
232
|
primaryBlue: [indigo.indigo9, indigoDark.indigo9],
|
|
227
233
|
whiteColor: [whiteA.whiteA0, whiteA.whiteA0],
|
|
228
234
|
blackColor: [blackA.blackA0, blackA.blackA0],
|
|
229
|
-
mainBg: [slate.slate3, slateDark.
|
|
230
|
-
panelBg: [whiteA.whiteA0, slateDark.
|
|
231
|
-
panelContentBg: [slate.slate2, slateDark.
|
|
235
|
+
mainBg: [slate.slate3, slateDark.slateBase],
|
|
236
|
+
panelBg: [whiteA.whiteA0, slateDark.slate1],
|
|
237
|
+
panelContentBg: [slate.slate2, slateDark.slate1],
|
|
232
238
|
colorBgRelationContainer: [slate.slate2, slateDark.slate1],
|
|
233
239
|
pageBg: [whiteA.whiteA0, slateDark.slate1],
|
|
234
240
|
pageContentBg: [whiteA.whiteA0, slateDark.slate2],
|
|
235
241
|
colorBgPopup: [whiteA.whiteA0, slateDark.slate4],
|
|
236
242
|
colorBgSidebar: [whiteA.whiteA0, slateDark.slate3],
|
|
237
|
-
menuBg: [slate.slate3, slateDark.
|
|
243
|
+
menuBg: [slate.slate3, slateDark.slateBase],
|
|
238
244
|
menuTextColor: [slateDark.slate5, slate.slate8],
|
|
239
245
|
menuItemHoverColor: [slate.slate5, slateDark.slate6],
|
|
240
246
|
menuSelectedTextColor: [slate.slate2, slate.slate2],
|
|
@@ -322,7 +328,7 @@ export const themeColors = {
|
|
|
322
328
|
colorBorderBlockQuote: [slate.slate11, slateDark.slate11],
|
|
323
329
|
|
|
324
330
|
// Actions menu
|
|
325
|
-
colorBgActionsMenu: [
|
|
331
|
+
colorBgActionsMenu: [whiteA.whiteA0, slateDark.slate3],
|
|
326
332
|
colorBgActionsMenuItemHover: [getOpacities(slate.slate11).opacity10, getOpacities(slateDark.slate11).opacity10],
|
|
327
333
|
colorBgActionsMenuItemSelected: [getOpacities(indigo.indigo4).opacity80, getOpacities(indigoDark.indigo4).opacity80],
|
|
328
334
|
colorBgActionsMenuItemSelectedHover: [
|
|
@@ -332,10 +338,10 @@ export const themeColors = {
|
|
|
332
338
|
colorBgActionsMenuItemDangerHover: [getOpacities(red.red9).opacity10, getOpacities(redDark.red10).opacity10],
|
|
333
339
|
|
|
334
340
|
colorBgActionsMenuItemDangerActive: [getOpacities(red.red9).opacity80, getOpacities(redDark.red10).opacity80],
|
|
335
|
-
actionMenuBg: [whiteA.whiteA0, slateDark.
|
|
336
|
-
actionMenuInnerBg: [whiteA.whiteA0, slateDark.
|
|
337
|
-
actionMenuHover: [slate.slate4, slateDark.
|
|
338
|
-
actionMenuInnerHover: [slate.slate4, getOpacities(slateDark.
|
|
341
|
+
actionMenuBg: [whiteA.whiteA0, slateDark.slate3],
|
|
342
|
+
actionMenuInnerBg: [whiteA.whiteA0, slateDark.slate4],
|
|
343
|
+
actionMenuHover: [slate.slate4, slateDark.slate5],
|
|
344
|
+
actionMenuInnerHover: [slate.slate4, getOpacities(slateDark.slate6).opacity50],
|
|
339
345
|
actionMenuButtonColor: [whiteA.whiteA0, slateDark.slate2],
|
|
340
346
|
actionMenuButtonHoverColor: [slate.slate1, slateDark.slate3],
|
|
341
347
|
actionMenuButtonShadow: [
|
|
@@ -346,7 +352,8 @@ export const themeColors = {
|
|
|
346
352
|
`0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${getOpacities(slate.slate10).opacity30}`,
|
|
347
353
|
`0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 6px 8px -4px ${getOpacities(slateDark.slate2).opacity30}`,
|
|
348
354
|
],
|
|
349
|
-
|
|
355
|
+
actionMenuSeparatorColor: [getOpacities(blackA.blackA0).opacity10, getOpacities(whiteA.whiteA0).opacity15],
|
|
356
|
+
separatorColor: [getOpacities(blackA.blackA0).opacity10, getOpacities(whiteA.whiteA0).opacity10],
|
|
350
357
|
separatorBreadcrumbsColor: [slate.slate8, slateDark.slate8],
|
|
351
358
|
iconColor: [slate.slate10, slateDark.slate10],
|
|
352
359
|
appIconColor: [getOpacities(slate.slate2).opacity90, getOpacities(slate.slate2).opacity70],
|
|
@@ -463,17 +470,17 @@ export const themeColors = {
|
|
|
463
470
|
colorTextMenuItem: [slateDark.slate5, getOpacities(slateDark.slate12).opacity90],
|
|
464
471
|
colorBgMenuItem: [transparent, transparent],
|
|
465
472
|
// :hover
|
|
466
|
-
colorBgMenuItemHover: [slate.slate5, slateDark.
|
|
473
|
+
colorBgMenuItemHover: [slate.slate5, slateDark.slate2],
|
|
467
474
|
// :focus
|
|
468
|
-
colorBgMenuItemFocus: [slate.slate6, slateDark.
|
|
475
|
+
colorBgMenuItemFocus: [slate.slate6, slateDark.slate5],
|
|
469
476
|
// Selected
|
|
470
|
-
colorBgMenuItemSelected: [indigo.indigo5, indigoDark.
|
|
477
|
+
colorBgMenuItemSelected: [indigo.indigo5, indigoDark.indigo3],
|
|
471
478
|
// :hover
|
|
472
|
-
colorBgMenuItemSelectedHover: [indigo.indigo6, indigoDark.
|
|
479
|
+
colorBgMenuItemSelectedHover: [indigo.indigo6, indigoDark.indigo5],
|
|
473
480
|
// :focus, :focus:hover
|
|
474
481
|
colorBgPinnedFieldsLabel: [slate.slate11, slateDark.slate11],
|
|
475
482
|
colorBgObjectEditorSeparator: [slate.slate12, slateDark.slate12],
|
|
476
|
-
colorBgMenuItemSelectedFocused: [indigo.indigo6, indigoDark.
|
|
483
|
+
colorBgMenuItemSelectedFocused: [indigo.indigo6, indigoDark.indigo5],
|
|
477
484
|
colorBgFieldEditorContainer: [slate.slate2, slateDark.slate3],
|
|
478
485
|
colorBgFieldEditorLinkEqualSign: [slate.slate6, slateDark.slate2],
|
|
479
486
|
allowedDropColor: [getOpacities(slate.slate3).opacity80, getOpacities(slateDark.slate3).opacity80],
|
|
@@ -540,7 +547,7 @@ export const themeColors = {
|
|
|
540
547
|
success: [teal.teal9, tealDark.teal9],
|
|
541
548
|
danger: [red.red9, redDark.red10],
|
|
542
549
|
active: [red.red9, redDark.red10],
|
|
543
|
-
warning: [
|
|
550
|
+
warning: [yellow.yellow9, yellowDark.yellow8],
|
|
544
551
|
cardBg: ["#FFFFFF", slateDark.slate6],
|
|
545
552
|
cardSelected: ["#FFFB8F", slateDark.slate5],
|
|
546
553
|
cardSelectedHover: ["rgba(240, 244, 247, 0.6)", slateDark.slate5],
|
|
@@ -568,7 +575,6 @@ export const themeColors = {
|
|
|
568
575
|
gridHeaderTextColor: [slate.slate10, slateDark.slate11],
|
|
569
576
|
gridCellBgColor: [whiteA.whiteA0, slateDark.slate2],
|
|
570
577
|
gridCellBorderColor: [slate.slate5, slateDark.slate6],
|
|
571
|
-
gridPinnedCellBorderColor: [slate.slate8, slateDark.slate8],
|
|
572
578
|
gridDisabledCellBgColor: [slate.slate2, slateDark.slate3],
|
|
573
579
|
gridSelectedCellBgColor: [indigo.indigo3, indigoDark.indigo3],
|
|
574
580
|
gridHighlightedCellBgColor: [indigo.indigo4, indigoDark.indigo5],
|
|
@@ -582,6 +588,9 @@ export const themeColors = {
|
|
|
582
588
|
timelineDependencyHoverBgColor: [indigo.indigo8, indigoDark.indigo8],
|
|
583
589
|
timelineDependencyOverlapBgColor: [red.red9, redDark.red9],
|
|
584
590
|
timelineDependencyOverlapHoverBgColor: [red.red11, redDark.red11],
|
|
591
|
+
timelineCellBgColor: [slate.slate1, slateDark.slate1],
|
|
592
|
+
timelineCellWeekendBgColor: [slate.slate2, slateDark.slate2],
|
|
593
|
+
timelineCellTodayBgColor: [indigo.indigo2, indigoDark.indigo2],
|
|
585
594
|
|
|
586
595
|
// #region buttons
|
|
587
596
|
// solid
|
|
@@ -600,9 +609,12 @@ export const themeColors = {
|
|
|
600
609
|
getOpacities(whiteA.whiteA0).opacity80,
|
|
601
610
|
getOpacities(whiteA.whiteA0).opacity80,
|
|
602
611
|
],
|
|
612
|
+
colorIconButtonSolidAccent: [whiteA.whiteA0, whiteA.whiteA0],
|
|
613
|
+
colorIconButtonSolidNeutral: [whiteA.whiteA0, slateDark.slate8],
|
|
614
|
+
colorIconButtonSolidDestructive: [whiteA.whiteA0, whiteA.whiteA0],
|
|
603
615
|
// outline
|
|
604
616
|
colorBorderButtonOutlineAccentDefault: [indigo.indigo8, indigoDark.indigo8],
|
|
605
|
-
colorBorderButtonOutlineNeutralDefault: [slate.slate8, slateDark.
|
|
617
|
+
colorBorderButtonOutlineNeutralDefault: [slate.slate8, slateDark.slate7],
|
|
606
618
|
colorBorderButtonOutlineDestructiveDefault: [red.red7, redDark.red7],
|
|
607
619
|
colorBgButtonOutlineAccentDefault: [whiteA.whiteA0, slateDark.slate1],
|
|
608
620
|
colorBgButtonOutlineAccentHover: [indigo.indigo3, indigoDark.indigo3],
|
|
@@ -622,6 +634,9 @@ export const themeColors = {
|
|
|
622
634
|
],
|
|
623
635
|
colorTextButtonOutlineDestructive: [red.red11, redDark.red11],
|
|
624
636
|
colorTextButtonOutlineDestructiveActive: [getOpacities(red.red11).opacity80, getOpacities(redDark.red11).opacity80],
|
|
637
|
+
colorIconButtonOutlineAccent: [indigo.indigo11, indigoDark.indigo11],
|
|
638
|
+
colorIconButtonOutlineNeutral: [slate.slate11, slateDark.slate11],
|
|
639
|
+
colorIconButtonOutlineDestructive: [red.red11, redDark.red11],
|
|
625
640
|
// soft
|
|
626
641
|
colorBgButtonSoftAccentDefault: [indigo.indigo3, indigoDark.indigo4],
|
|
627
642
|
colorBgButtonSoftAccentHover: [indigo.indigo5, indigoDark.indigo6],
|
|
@@ -638,11 +653,14 @@ export const themeColors = {
|
|
|
638
653
|
colorTextButtonSoftNeutralActive: [getOpacities(slate.slate12).opacity80, getOpacities(slateDark.slate12).opacity80],
|
|
639
654
|
colorTextButtonSoftDestructive: [red.red11, redDark.red11],
|
|
640
655
|
colorTextButtonSoftDestructiveActive: [getOpacities(red.red11).opacity80, getOpacities(redDark.red11).opacity80],
|
|
656
|
+
colorIconButtonSoftAccent: [indigo.indigo11, indigoDark.indigo11],
|
|
657
|
+
colorIconButtonSoftNeutral: [slate.slate11, slateDark.slate11],
|
|
658
|
+
colorIconButtonSoftDestructive: [red.red11, redDark.red11],
|
|
641
659
|
// ghost
|
|
642
660
|
colorBgButtonGhostAccentDefault: [transparent, transparent],
|
|
643
|
-
colorBgButtonGhostAccentHover: [indigo.
|
|
661
|
+
colorBgButtonGhostAccentHover: [getOpacities(indigo.indigo4).opacity80, getOpacities(indigoDark.indigo4).opacity80],
|
|
644
662
|
colorBgButtonGhostNeutralDefault: [transparent, transparent],
|
|
645
|
-
colorBgButtonGhostNeutralHover: [getOpacities(slate.
|
|
663
|
+
colorBgButtonGhostNeutralHover: [getOpacities(slate.slate7).opacity50, getOpacities(slateDark.slate6).opacity80],
|
|
646
664
|
colorBgButtonGhostDestructiveDefault: [transparent, transparent],
|
|
647
665
|
colorBgButtonGhostDestructiveHover: [red.red4, redDark.red4],
|
|
648
666
|
colorTextButtonGhostAccent: [indigo.indigo11, indigoDark.indigo11],
|
|
@@ -654,6 +672,9 @@ export const themeColors = {
|
|
|
654
672
|
colorTextButtonGhostNeutralActive: [getOpacities(slate.slate11).opacity80, getOpacities(slateDark.slate11).opacity80],
|
|
655
673
|
colorTextButtonGhostDestructive: [red.red11, redDark.red11],
|
|
656
674
|
colorTextButtonGhostDestructiveActive: [getOpacities(red.red11).opacity80, getOpacities(redDark.red11).opacity80],
|
|
675
|
+
colorIconButtonGhostAccent: [indigo.indigo11, indigoDark.indigo11],
|
|
676
|
+
colorIconButtonGhostNeutral: [slate.slate11, slateDark.slate11],
|
|
677
|
+
colorIconButtonGhostDestructive: [red.red11, redDark.red11],
|
|
657
678
|
// #endregion
|
|
658
679
|
|
|
659
680
|
colorBorderAccentFocusRing: [getOpacities(indigo.indigo9).opacity30, getOpacities(indigo.indigo9).opacity30],
|
|
@@ -685,14 +706,20 @@ export const themeColors = {
|
|
|
685
706
|
colorBgEditorImageZoomed: [getOpacities(slate.slate3).opacity90, getOpacities(slateDark.slate6).opacity90],
|
|
686
707
|
|
|
687
708
|
//Whiteboard
|
|
688
|
-
instrumentsMenuBg: [getOpacities(whiteA.whiteA0).
|
|
709
|
+
instrumentsMenuBg: [getOpacities(whiteA.whiteA0).opacity100, getOpacities(slateDark.slate4).opacity100],
|
|
689
710
|
instrumentsMenuShadow: [
|
|
690
|
-
`
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}
|
|
711
|
+
`0px 0px 1px 0px ${getOpacities(slate.slate11).opacity20}, 0px 4px 6px 0px ${
|
|
712
|
+
getOpacities(slate.slate11).opacity5
|
|
713
|
+
}, 0px 3px 12px 0px ${getOpacities(slate.slate11).opacity10}`,
|
|
714
|
+
`0px 0px 1px 0px ${getOpacities(slateDark.slate6).opacity100}, 0px 4px 6px 0px ${
|
|
715
|
+
getOpacities(slateDark.slate1).opacity5
|
|
716
|
+
}, 0px 3px 12px 0px ${getOpacities(slateDark.slate1).opacity15}`,
|
|
694
717
|
],
|
|
695
718
|
commentBubbleBg: [whiteA.whiteA0, slateDark.slate6],
|
|
719
|
+
commentsPanelShadow: [
|
|
720
|
+
`0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${getOpacities(slate.slate10).opacity20}`,
|
|
721
|
+
`0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${getOpacities(slateDark.slate2).opacity20}`,
|
|
722
|
+
],
|
|
696
723
|
|
|
697
724
|
// SegmentedControl
|
|
698
725
|
colorBgSegmentedControlDefault: [slate.slate3, slateDark.slate1],
|
|
@@ -828,14 +855,15 @@ const colorsByTheme: Record<string, DesignColor> = {
|
|
|
828
855
|
};
|
|
829
856
|
|
|
830
857
|
export const getThemeColors: (themeColor: string, theme: ThemeMode) => ThemeColors = _.memoize(
|
|
831
|
-
(
|
|
858
|
+
(_themeColor: string, theme: ThemeMode = getDefaultTheme()): ThemeColors => {
|
|
859
|
+
const cl = brandColors.blue;
|
|
832
860
|
const colors = colorsByTheme[theme];
|
|
833
861
|
return {
|
|
834
|
-
...getTypeColors(
|
|
862
|
+
...getTypeColors(cl, theme),
|
|
835
863
|
...colors,
|
|
836
864
|
};
|
|
837
865
|
},
|
|
838
|
-
(
|
|
866
|
+
(_themeColor, theme) => theme
|
|
839
867
|
);
|
|
840
868
|
|
|
841
869
|
export const getTextColor = _.memoize((color: string): string => {
|
|
@@ -947,7 +975,7 @@ export const layout = {
|
|
|
947
975
|
desktopToolbarHeight: 32,
|
|
948
976
|
desktopMenuMinWidth: 240,
|
|
949
977
|
collapsedMenuMinWidth: 47,
|
|
950
|
-
menuMinWidth:
|
|
978
|
+
menuMinWidth: 284,
|
|
951
979
|
menuMaxWidth: 480,
|
|
952
980
|
menuItemMinWidth: 80,
|
|
953
981
|
menuGroupHeaderIndent: 28, // I'm ok
|
|
@@ -971,9 +999,9 @@ export const layout = {
|
|
|
971
999
|
viewSetupMinWidth: 380,
|
|
972
1000
|
inputHeight: 36, //TODO: merge input and item height?
|
|
973
1001
|
timelineToolbarHeight: 48,
|
|
974
|
-
timelineLineHeight:
|
|
1002
|
+
timelineLineHeight: 40,
|
|
975
1003
|
timelineGroupPadding: 0,
|
|
976
|
-
timelineItemHeightRatio:
|
|
1004
|
+
timelineItemHeightRatio: 32 / 40,
|
|
977
1005
|
timelineHeaderHeight: 48,
|
|
978
1006
|
calendarEventHeight: 30,
|
|
979
1007
|
calendarHeaderHeight: 30,
|
|
@@ -1053,7 +1081,7 @@ export const getObjectColorMemoized = _.memoize((name) => {
|
|
|
1053
1081
|
return colorHash.hex(name);
|
|
1054
1082
|
});
|
|
1055
1083
|
|
|
1056
|
-
export const themeVars = Object.keys(getThemeColors(brandColors.
|
|
1084
|
+
export const themeVars = Object.keys(getThemeColors(brandColors.blue, "light")).reduce((vars, key) => {
|
|
1057
1085
|
if (key === "opacity") {
|
|
1058
1086
|
vars[key] = Object.fromEntries(
|
|
1059
1087
|
Object.keys(opacity).map((opacityKey) => [opacityKey, `var(--${varPrefix}-opacity-${opacityKey})`])
|
|
@@ -1114,7 +1142,7 @@ export const textStyles = {
|
|
|
1114
1142
|
fontSize: typeSizes[0],
|
|
1115
1143
|
letterSpacing: "-0.01em",
|
|
1116
1144
|
lineHeight: lineHeight.heading,
|
|
1117
|
-
fontWeight: fontWeight.
|
|
1145
|
+
fontWeight: fontWeight.semibold,
|
|
1118
1146
|
color: themeVars.textColor,
|
|
1119
1147
|
},
|
|
1120
1148
|
heading2: {
|
|
@@ -1226,4 +1254,14 @@ export const textStyles = {
|
|
|
1226
1254
|
border: `1px solid ${themeVars.active}`,
|
|
1227
1255
|
borderRadius: border.radius6,
|
|
1228
1256
|
},
|
|
1257
|
+
numeric: {
|
|
1258
|
+
tabularOn: {
|
|
1259
|
+
fontVariantNumeric: "tabular-nums",
|
|
1260
|
+
fontFeatureSettings: '"tnum" 1',
|
|
1261
|
+
},
|
|
1262
|
+
tabularOff: {
|
|
1263
|
+
fontVariantNumeric: "normal",
|
|
1264
|
+
fontFeatureSettings: '"tnum" 0',
|
|
1265
|
+
},
|
|
1266
|
+
},
|
|
1229
1267
|
} as const;
|
package/src/dnd.tsx
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {css, cx} from "@linaria/core";
|
|
2
|
+
import {FC, HTMLAttributes, PropsWithChildren} from "react";
|
|
3
|
+
import {border, space, themeVars} from "./design-system";
|
|
4
|
+
import DragHandleIcon from "./icons/react/DragHandle";
|
|
5
|
+
|
|
6
|
+
export const draggingStyle = {
|
|
7
|
+
backgroundColor: themeVars.actionMenuBg,
|
|
8
|
+
borderRadius: border.radius6,
|
|
9
|
+
boxShadow: themeVars.entityCardShadowHover,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const dragHandlerStyle = css`
|
|
13
|
+
${{
|
|
14
|
+
paddingTop: space.s2,
|
|
15
|
+
paddingBottom: space.s2,
|
|
16
|
+
borderRadius: border.radius4,
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
"&:focus-visible": {outline: "none", backgroundColor: themeVars.opacity.opacity15},
|
|
20
|
+
}}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export const DragHandler: FC<{disabled?: boolean; preserveOnHide?: boolean} & HTMLAttributes<HTMLDivElement>> = ({
|
|
24
|
+
disabled = false,
|
|
25
|
+
preserveOnHide = false,
|
|
26
|
+
className,
|
|
27
|
+
...rest
|
|
28
|
+
}) => {
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
style={{visibility: disabled ? "hidden" : "visible", width: disabled && !preserveOnHide ? "0" : "auto"}}
|
|
32
|
+
className={cx(dragHandlerStyle, className)}
|
|
33
|
+
{...rest}
|
|
34
|
+
>
|
|
35
|
+
<DragHandleIcon containerSize={16} color={themeVars.iconColor} />
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
const dragContainerStyle = css`
|
|
40
|
+
${{
|
|
41
|
+
padding: space.s6,
|
|
42
|
+
}}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const DragContainer: FC<PropsWithChildren<{isDragging: boolean; className?: string}>> = ({
|
|
46
|
+
isDragging,
|
|
47
|
+
children,
|
|
48
|
+
className,
|
|
49
|
+
}) => {
|
|
50
|
+
return (
|
|
51
|
+
<div className={cx(dragContainerStyle, className)} style={isDragging ? draggingStyle : undefined}>
|
|
52
|
+
{children}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|