@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,64 @@
|
|
|
1
|
+
import {useCallback, useRef, useState} from "react";
|
|
2
|
+
import {AntTextArea} from "../../antd";
|
|
3
|
+
import {css} from "@linaria/core";
|
|
4
|
+
|
|
5
|
+
const wrapperStyle = css`
|
|
6
|
+
${{
|
|
7
|
+
// Trying to match Ant's input text position
|
|
8
|
+
position: "absolute",
|
|
9
|
+
left: "12px",
|
|
10
|
+
right: "13px",
|
|
11
|
+
top: "8px",
|
|
12
|
+
bottom: "9px",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
wordBreak: "break-word",
|
|
15
|
+
}}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const inputStyle = css`
|
|
19
|
+
position: relative;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export const AntTextAreaWithCustomReadState = ({value, onBlur, onFocus, style = {}, renderReadState, ...rest}) => {
|
|
23
|
+
const [focus, setFocus] = useState(false);
|
|
24
|
+
const input = useRef(null);
|
|
25
|
+
|
|
26
|
+
const handleFocus = useCallback(
|
|
27
|
+
(e) => {
|
|
28
|
+
setFocus(true);
|
|
29
|
+
onFocus && onFocus(e);
|
|
30
|
+
},
|
|
31
|
+
[onFocus]
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const handleBlur = useCallback(
|
|
35
|
+
(e) => {
|
|
36
|
+
setFocus(false);
|
|
37
|
+
onBlur && onBlur(e);
|
|
38
|
+
},
|
|
39
|
+
[onBlur]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const handleWrapperClick = useCallback(() => {
|
|
43
|
+
input.current.focus();
|
|
44
|
+
}, [input]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className={inputStyle}>
|
|
48
|
+
<AntTextArea
|
|
49
|
+
autoSize={{minRows: 1, maxRows: 10}}
|
|
50
|
+
{...rest}
|
|
51
|
+
bypassedRef={input}
|
|
52
|
+
onFocus={handleFocus}
|
|
53
|
+
onBlur={handleBlur}
|
|
54
|
+
value={value}
|
|
55
|
+
style={{...style, color: !focus && "transparent"}}
|
|
56
|
+
/>
|
|
57
|
+
{!focus && (
|
|
58
|
+
<div className={wrapperStyle} onClick={handleWrapperClick}>
|
|
59
|
+
{renderReadState()}
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {useCallback} from "react";
|
|
3
|
+
import {AntTextAreaWithCustomReadState} from "./components/AntTextAreaWithCustomReadState";
|
|
4
|
+
import {getURL} from "./utils";
|
|
5
|
+
|
|
6
|
+
const urlLinkClassname = css`
|
|
7
|
+
word-break: break-word;
|
|
8
|
+
margin-right: 20px;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const UrlInputLink = ({value, children, ...rest}) => {
|
|
12
|
+
const normalizedUrl = getURL(value);
|
|
13
|
+
if (!normalizedUrl) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (
|
|
17
|
+
<a
|
|
18
|
+
draggable={false}
|
|
19
|
+
target="_blank"
|
|
20
|
+
className={urlLinkClassname}
|
|
21
|
+
rel="noopener noreferrer nofollow"
|
|
22
|
+
href={normalizedUrl}
|
|
23
|
+
{...rest}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</a>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const UrlInput = (props) => {
|
|
31
|
+
const handleClick = useCallback((e) => e.stopPropagation(), []);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<AntTextAreaWithCustomReadState
|
|
35
|
+
{...props}
|
|
36
|
+
renderReadState={() => (
|
|
37
|
+
<UrlInputLink value={props.value} onClick={handleClick}>
|
|
38
|
+
{props.value}
|
|
39
|
+
</UrlInputLink>
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const PhoneInputLink = ({value, children, ...rest}) => {
|
|
46
|
+
return (
|
|
47
|
+
<a draggable={false} href={`tel:${value}`} {...rest}>
|
|
48
|
+
{children}
|
|
49
|
+
</a>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const PhoneInput = (props) => {
|
|
54
|
+
const handleClick = useCallback((e) => e.stopPropagation(), []);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<AntTextAreaWithCustomReadState
|
|
58
|
+
{...props}
|
|
59
|
+
renderReadState={() => (
|
|
60
|
+
<PhoneInputLink value={props.value} onClick={handleClick}>
|
|
61
|
+
{props.value}
|
|
62
|
+
</PhoneInputLink>
|
|
63
|
+
)}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const EmailInputLink = ({value, children, ...rest}) => {
|
|
69
|
+
return (
|
|
70
|
+
<a draggable={false} href={`mailto:${value}`} {...rest}>
|
|
71
|
+
{children}
|
|
72
|
+
</a>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const EmailInput = (props) => {
|
|
77
|
+
const handleClick = useCallback((e) => e.stopPropagation(), []);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<AntTextAreaWithCustomReadState
|
|
81
|
+
{...props}
|
|
82
|
+
renderReadState={() => (
|
|
83
|
+
<EmailInputLink value={props.value} onClick={handleClick}>
|
|
84
|
+
{props.value}
|
|
85
|
+
</EmailInputLink>
|
|
86
|
+
)}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infers actual URL from the input's value.
|
|
3
|
+
* @param value
|
|
4
|
+
* @returns {null|string} null for invalid URL
|
|
5
|
+
*/
|
|
6
|
+
export const getURL = (value) => {
|
|
7
|
+
if (!value) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
// Add https if no protocol is given.
|
|
11
|
+
const [, protocol] = value.match(/^(\w+):/) || [];
|
|
12
|
+
return protocol ? value : "https://" + value;
|
|
13
|
+
};
|
package/src/logo.tsx
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {FC} from "react";
|
|
3
|
+
import {layout} from "./design-system";
|
|
4
|
+
|
|
5
|
+
interface LogoProps {
|
|
6
|
+
size?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Logo: FC<LogoProps> = ({size = 40}) => {
|
|
10
|
+
return (
|
|
11
|
+
<svg width={size} height={size} viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg" fill="none">
|
|
12
|
+
<path
|
|
13
|
+
d="M13.6154 52.6718C12.389 52.6687 11.1866 52.3283 10.1369 51.6871C9.08722 51.0459 8.22981 50.128 7.65652 49.0318C7.08322 47.9356 6.81564 46.7024 6.88243 45.4641C6.94922 44.2259 7.34787 43.0294 8.03568 42.0028L33.1308 4.75593C34.1722 3.34127 35.7137 2.38797 37.4335 2.09504C39.1534 1.80211 40.9186 2.19219 42.3609 3.18384C43.8031 4.17549 44.8108 5.69208 45.1736 7.41703C45.5364 9.14198 45.2263 10.942 44.3081 12.4413L19.2129 49.6881C18.5917 50.6097 17.7567 51.3635 16.781 51.8836C15.8052 52.4038 14.7184 52.6744 13.6154 52.6718Z"
|
|
14
|
+
fill="url(#paint0_linear_2845_2276)"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M44.3295 17.0422L51.7048 16.4831C52.0797 16.4548 52.4554 16.4581 52.8281 16.4926C53.2167 16.5272 53.6042 16.596 53.9861 16.6995C55.7192 17.1692 57.1968 18.3158 58.0938 19.8871C58.9909 21.4584 59.2338 23.3256 58.7693 25.078C58.3048 26.8305 57.1709 28.3245 55.617 29.2316L23.4864 47.9779L44.3295 17.0422Z"
|
|
18
|
+
fill="url(#paint1_linear_2845_2276)"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M32.0811 60C30.6331 60.0024 29.2224 59.5352 28.0563 58.667C26.8903 57.7987 26.0303 56.5753 25.6028 55.1763L24.1999 50.5716L31.5632 46.2755L37.8433 48.7708L38.5684 51.1438C39.0963 52.8775 38.9219 54.7522 38.0836 56.356C37.2453 57.9598 35.8116 59.1615 34.0975 59.6971C33.444 59.8989 32.7644 60.001 32.0811 60Z"
|
|
22
|
+
fill="url(#paint2_linear_2845_2276)"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M49.4289 35.852L34.419 44.6094L46.7804 49.521C47.569 49.8278 48.4078 49.9812 49.2528 49.973C50.8279 49.9722 52.3533 49.411 53.566 48.3946C54.7787 47.3782 55.6026 45.9658 55.8956 44.4009C56.1886 42.836 55.9323 41.2168 55.171 39.8225C54.4096 38.4282 53.191 37.3463 51.7252 36.7633L49.4289 35.852Z"
|
|
26
|
+
fill="url(#paint3_linear_2845_2276)"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d="M20.5155 18.8473L10.7738 33.3061L8.28343 33.4949C8.11353 33.5084 7.94364 33.5129 7.77374 33.5129C6.02147 33.5154 4.33664 32.8302 3.07402 31.6016C1.81141 30.373 1.06954 28.6969 1.00465 26.9263C0.939748 25.1557 1.55688 23.4287 2.7261 22.109C3.89531 20.7893 5.52536 19.9798 7.273 19.8511L20.5155 18.8473Z"
|
|
30
|
+
fill="url(#paint4_linear_2845_2276)"
|
|
31
|
+
/>
|
|
32
|
+
<path
|
|
33
|
+
d="M23.9081 5.45218L27.1559 8.99151L22.208 16.3352L15.8715 16.8295L13.9782 14.7605C12.7575 13.429 12.1098 11.6617 12.1777 9.84741C12.2457 8.03309 13.0236 6.32036 14.3404 5.086C15.6571 3.85164 17.4049 3.19677 19.1992 3.26544C20.9935 3.33411 22.6873 4.12071 23.9081 5.45218Z"
|
|
34
|
+
fill="url(#paint5_linear_2845_2276)"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
d="M32.081 59.9018H32.0813C32.7547 59.9028 33.4245 59.8022 34.0686 59.6033C35.7574 59.0755 37.1703 57.8914 37.9966 56.3106C38.823 54.7296 38.9949 52.8816 38.4745 51.1724L32.081 59.9018ZM32.081 59.9018C30.6542 59.9042 29.2641 59.4439 28.115 58.5882M32.081 59.9018L28.115 58.5882M51.6889 36.8545C53.1333 37.4289 54.3344 38.4952 55.0848 39.8695C55.8353 41.2439 56.0879 42.8401 55.7991 44.3828C55.5103 45.9255 54.6981 47.3177 53.503 48.3194C52.3077 49.3212 50.8045 49.8741 49.2527 49.8749L49.2518 49.8749C48.4196 49.8829 47.5933 49.7319 46.8164 49.4297L46.8166 49.4297L46.7804 49.521C47.569 49.8278 48.4078 49.9812 49.2528 49.973C50.8279 49.9722 52.3533 49.411 53.566 48.3946C54.7787 47.3782 55.6026 45.9658 55.8956 44.4009C56.1886 42.836 55.9323 41.2168 55.171 39.8225C54.4096 38.4282 53.191 37.3463 51.7252 36.7633M51.6889 36.8545L51.689 36.8545L51.7252 36.7633M51.6889 36.8545L51.7252 36.7633M51.6889 36.8545L49.4371 35.9608M51.7252 36.7633L49.4289 35.852L49.4783 35.9367L49.4371 35.9608M49.4371 35.9608L34.6426 44.5926M49.4371 35.9608L34.6426 44.5926M34.6426 44.5926L46.816 49.4295L34.6426 44.5926ZM20.3208 18.9605L20.3907 18.8568L7.273 19.8511C5.52536 19.9798 3.89531 20.7893 2.7261 22.109C1.55688 23.4287 0.939748 25.1557 1.00465 26.9263C1.06954 28.6969 1.81141 30.373 3.07402 31.6016C4.33664 32.8302 6.02147 33.5154 7.77374 33.5129L20.4456 18.951L20.3208 18.9605ZM20.3208 18.9605L7.28042 19.949L7.28021 19.949C5.55826 20.0758 3.95193 20.8734 2.79956 22.1741C1.64717 23.4748 1.03875 25.1772 1.10273 26.9227C1.16671 28.6683 1.89807 30.3204 3.14247 31.5312C4.38684 32.7421 6.0471 33.4172 7.77361 33.4148H7.77374C7.94196 33.4148 8.10911 33.4103 8.27562 33.397L8.27601 33.397L10.719 33.2118M20.3208 18.9605L10.719 33.2118M10.719 33.2118L10.6924 33.2512L10.7738 33.3061L10.7664 33.2082L10.719 33.2118ZM28.115 58.5882C26.9658 57.7326 26.1182 56.5268 25.6967 55.1477L28.115 58.5882ZM52.819 16.5904L52.8194 16.5904C53.2023 16.6245 53.5841 16.6923 53.9605 16.7943C55.6681 17.2571 57.1244 18.387 58.0086 19.9358C58.8928 21.4846 59.1324 23.3253 58.6745 25.0529C58.2166 26.7804 57.0988 28.253 55.5675 29.1468L23.8076 47.6769L44.3843 17.1365L51.7122 16.581C52.0816 16.553 52.4518 16.5563 52.819 16.5904ZM52.8281 16.4926C53.2167 16.5272 53.6042 16.596 53.9861 16.6995C55.7192 17.1692 57.1968 18.3158 58.0938 19.8871C58.9909 21.4584 59.2338 23.3256 58.7693 25.078C58.3048 26.8305 57.1709 28.3245 55.617 29.2316L52.8281 16.4926ZM37.7633 48.8446L38.4745 51.1723L25.6967 55.1476L24.3164 50.6173L31.5714 46.3844L37.7633 48.8446ZM23.8357 5.51852L23.8358 5.51855L27.0312 9.00085L22.1531 16.2411L15.9116 16.728L14.0506 14.6942L14.0506 14.6942C12.8474 13.3818 12.2089 11.6397 12.2758 9.85108C12.3428 8.06243 13.1097 6.37417 14.4075 5.15761C15.7052 3.94109 17.4275 3.29586 19.1955 3.36352C20.9634 3.43118 22.6326 4.20622 23.8357 5.51852ZM13.6156 52.5737C12.4073 52.5706 11.2225 52.2352 10.1881 51.6033C9.15366 50.9715 8.30859 50.0669 7.74349 48.9863C7.17839 47.9058 6.9146 46.6901 6.98044 45.4694C7.04628 44.2488 7.43925 43.0694 8.11715 42.0575C8.11717 42.0575 8.1172 42.0574 8.11722 42.0574L33.2111 4.81244C34.2375 3.41902 35.7561 2.48031 37.45 2.1918C39.1446 1.90318 40.884 2.28749 42.3052 3.26472C43.7265 4.24198 44.7199 5.73676 45.0775 7.43724C45.4351 9.13704 45.1298 10.9107 44.2255 12.3882L19.1315 49.6333C18.5192 50.5416 17.6963 51.2845 16.7348 51.797C15.7733 52.3096 14.7024 52.5762 13.6156 52.5737Z"
|
|
38
|
+
stroke="white"
|
|
39
|
+
strokeOpacity={0.1}
|
|
40
|
+
strokeWidth={0.196305}
|
|
41
|
+
/>
|
|
42
|
+
<defs>
|
|
43
|
+
<linearGradient id="paint0_linear_2845_2276" x1={30} y1={2} x2={30} y2={60} gradientUnits="userSpaceOnUse">
|
|
44
|
+
<stop stopColor="#7FE8D4" />
|
|
45
|
+
<stop offset={1} stopColor="#1FA192" />
|
|
46
|
+
</linearGradient>
|
|
47
|
+
<linearGradient id="paint1_linear_2845_2276" x1={30} y1={2} x2={30} y2={60} gradientUnits="userSpaceOnUse">
|
|
48
|
+
<stop stopColor="#7FE8D4" />
|
|
49
|
+
<stop offset={1} stopColor="#1FA192" />
|
|
50
|
+
</linearGradient>
|
|
51
|
+
<linearGradient id="paint2_linear_2845_2276" x1={30} y1={2} x2={30} y2={60} gradientUnits="userSpaceOnUse">
|
|
52
|
+
<stop stopColor="#7FE8D4" />
|
|
53
|
+
<stop offset={1} stopColor="#1FA192" />
|
|
54
|
+
</linearGradient>
|
|
55
|
+
<linearGradient id="paint3_linear_2845_2276" x1={30} y1={2} x2={30} y2={60} gradientUnits="userSpaceOnUse">
|
|
56
|
+
<stop stopColor="#7FE8D4" />
|
|
57
|
+
<stop offset={1} stopColor="#1FA192" />
|
|
58
|
+
</linearGradient>
|
|
59
|
+
<linearGradient id="paint4_linear_2845_2276" x1={30} y1={2} x2={30} y2={60} gradientUnits="userSpaceOnUse">
|
|
60
|
+
<stop stopColor="#7FE8D4" />
|
|
61
|
+
<stop offset={1} stopColor="#1FA192" />
|
|
62
|
+
</linearGradient>
|
|
63
|
+
<linearGradient id="paint5_linear_2845_2276" x1={30} y1={2} x2={30} y2={60} gradientUnits="userSpaceOnUse">
|
|
64
|
+
<stop stopColor="#7FE8D4" />
|
|
65
|
+
<stop offset={1} stopColor="#1FA192" />
|
|
66
|
+
</linearGradient>
|
|
67
|
+
</defs>
|
|
68
|
+
</svg>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const logoPadding = (layout.newMenuIconSize - layout.logoSize) / 2;
|
|
73
|
+
|
|
74
|
+
export const logoContainerStyle = css`
|
|
75
|
+
${{
|
|
76
|
+
padding: logoPadding,
|
|
77
|
+
width: layout.newMenuIconSize,
|
|
78
|
+
height: layout.newMenuIconSize,
|
|
79
|
+
lineHeight: 0,
|
|
80
|
+
}}
|
|
81
|
+
`;
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {space, textStyles, themeVars} from "./design-system";
|
|
3
|
+
|
|
4
|
+
const newBadgeStyle = css`
|
|
5
|
+
${textStyles.heading7}
|
|
6
|
+
display: inline-block;
|
|
7
|
+
padding: ${space.s1}px ${space.s4}px;
|
|
8
|
+
color: ${themeVars.colorTextButtonOutlineAccent};
|
|
9
|
+
background-color: ${themeVars.colorBgButtonOutlineAccentDefault};
|
|
10
|
+
border: 1px solid ${themeVars.colorBorderButtonOutlineAccentDefault};
|
|
11
|
+
vertical-align: text-top;
|
|
12
|
+
border-radius: 20px;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
type Props = {children: React.ReactNode};
|
|
16
|
+
export const NewBadge: React.FC<Props> = ({children}) => <span className={newBadgeStyle}>{children}</span>;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import {useFocusOutside} from "@fibery/react/src/use-focus-outside";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
import {styled} from "@linaria/react";
|
|
4
|
+
import cx from "classnames";
|
|
5
|
+
import {CSSProperties, FC, ReactNode, RefObject, useCallback, useEffect, useState} from "react";
|
|
6
|
+
import {AntTransparentInput, AntTransparentTextArea} from "./antd/input";
|
|
7
|
+
import {Box} from "./box";
|
|
8
|
+
import {Button} from "./button/button";
|
|
9
|
+
import {CardContainer, CardSize, titleUnitsContainerClassName} from "./card-container";
|
|
10
|
+
import {space, textStyles, themeVars} from "./design-system";
|
|
11
|
+
import {ignoreEnter} from "./form-utils";
|
|
12
|
+
import {$TSFixMe} from "./tsfixme";
|
|
13
|
+
|
|
14
|
+
const disabledTextClassName = css`
|
|
15
|
+
${{color: themeVars.disabledTextColor}}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const titleAreaContainerClassName = css`
|
|
19
|
+
${{
|
|
20
|
+
width: "100%",
|
|
21
|
+
}}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const AuxWrapper = styled.div<{backgroundColor?: string}>`
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: ${space.s4}px;
|
|
27
|
+
background-color: ${({backgroundColor}) => backgroundColor || ""};
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const singleLineClassName = css`
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const autosize = {
|
|
37
|
+
minRows: 1,
|
|
38
|
+
maxRows: 10,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const outlineNoneClassName = css`
|
|
42
|
+
${{outline: "none"}}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
interface NewCardPlaceholderProps {
|
|
46
|
+
typeTitle?: string;
|
|
47
|
+
size: CardSize;
|
|
48
|
+
containerClassName?: string;
|
|
49
|
+
inputStyle?: CSSProperties;
|
|
50
|
+
leftContainer?: ReactNode;
|
|
51
|
+
scrollToInput?: boolean;
|
|
52
|
+
bypassedRef: RefObject<HTMLDivElement>;
|
|
53
|
+
referenceSelector?: ReactNode;
|
|
54
|
+
selectorOpen?: boolean;
|
|
55
|
+
readOnly?: boolean;
|
|
56
|
+
onSubmit: (v: {event: $TSFixMe; title: string}) => Promise<void>;
|
|
57
|
+
onHide: () => void;
|
|
58
|
+
onHideByEsc?: () => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const NewCardPlaceholder: FC<NewCardPlaceholderProps> = (props) => {
|
|
62
|
+
const {
|
|
63
|
+
leftContainer,
|
|
64
|
+
typeTitle,
|
|
65
|
+
containerClassName,
|
|
66
|
+
inputStyle,
|
|
67
|
+
bypassedRef,
|
|
68
|
+
onSubmit,
|
|
69
|
+
onHide,
|
|
70
|
+
onHideByEsc = onHide,
|
|
71
|
+
referenceSelector,
|
|
72
|
+
selectorOpen,
|
|
73
|
+
readOnly,
|
|
74
|
+
scrollToInput = true,
|
|
75
|
+
size,
|
|
76
|
+
} = props;
|
|
77
|
+
const [title, setTitle] = useState<string>("");
|
|
78
|
+
|
|
79
|
+
const multiline = size !== ":card-size/timeline" && size !== ":card-size/list" && size !== ":card-size/cell";
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (readOnly) {
|
|
82
|
+
bypassedRef.current?.focus();
|
|
83
|
+
}
|
|
84
|
+
}, [bypassedRef, readOnly]);
|
|
85
|
+
|
|
86
|
+
const onChange = useCallback((e: $TSFixMe) => {
|
|
87
|
+
setTitle(e.target.value);
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
}, []);
|
|
90
|
+
|
|
91
|
+
const submit = useCallback(
|
|
92
|
+
async (event: $TSFixMe) => {
|
|
93
|
+
setTitle("");
|
|
94
|
+
try {
|
|
95
|
+
await onSubmit({event, title});
|
|
96
|
+
} catch (e) {
|
|
97
|
+
// pass
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
[onSubmit, title]
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const onPressEnter = useCallback(
|
|
104
|
+
async (e: $TSFixMe) => {
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
submit(e);
|
|
107
|
+
},
|
|
108
|
+
[submit]
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const onBlur = useCallback(
|
|
112
|
+
async (e: $TSFixMe) => {
|
|
113
|
+
if (!selectorOpen) {
|
|
114
|
+
if (title) {
|
|
115
|
+
submit(e);
|
|
116
|
+
}
|
|
117
|
+
onHide();
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
[onHide, selectorOpen, submit, title]
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const hasTitle = title.length > 0;
|
|
124
|
+
|
|
125
|
+
const onKeyDown = useCallback(
|
|
126
|
+
(e: $TSFixMe) => {
|
|
127
|
+
ignoreEnter(e);
|
|
128
|
+
if (e.key === "Escape") {
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
if (hasTitle) {
|
|
131
|
+
setTitle("");
|
|
132
|
+
} else {
|
|
133
|
+
onHideByEsc();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
[hasTitle, onHideByEsc]
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const onAddCardButtonClick = useCallback(
|
|
141
|
+
(e: $TSFixMe) => {
|
|
142
|
+
submit(e);
|
|
143
|
+
},
|
|
144
|
+
[submit]
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const [containerElement, setContainerElement] = useState<HTMLElement | null>(null);
|
|
148
|
+
|
|
149
|
+
const isTitleEmpty = title === "";
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (containerElement && scrollToInput) {
|
|
152
|
+
containerElement.scrollIntoView({
|
|
153
|
+
behavior: "smooth",
|
|
154
|
+
block: "center",
|
|
155
|
+
inline: "nearest",
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, [containerElement, isTitleEmpty, scrollToInput]);
|
|
159
|
+
|
|
160
|
+
const {onBlurCapture, onFocusCapture} = useFocusOutside(onBlur);
|
|
161
|
+
|
|
162
|
+
const InputComponent = multiline ? AntTransparentTextArea : AntTransparentInput;
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<Box
|
|
166
|
+
focused
|
|
167
|
+
hovered={false}
|
|
168
|
+
ref={setContainerElement}
|
|
169
|
+
className={containerClassName}
|
|
170
|
+
onBlurCapture={onBlurCapture}
|
|
171
|
+
onFocusCapture={onFocusCapture}
|
|
172
|
+
>
|
|
173
|
+
<CardContainer
|
|
174
|
+
before={leftContainer && <div>{leftContainer}</div>}
|
|
175
|
+
title={
|
|
176
|
+
readOnly ? (
|
|
177
|
+
<div ref={bypassedRef} tabIndex={0} className={titleUnitsContainerClassName}>
|
|
178
|
+
<div
|
|
179
|
+
className={cx(disabledTextClassName, outlineNoneClassName, {
|
|
180
|
+
[singleLineClassName]: !multiline,
|
|
181
|
+
})}
|
|
182
|
+
>
|
|
183
|
+
Name will be generated by a formula
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
) : (
|
|
187
|
+
<div className={titleAreaContainerClassName}>
|
|
188
|
+
<InputComponent
|
|
189
|
+
// @ts-expect-error fix types for ref
|
|
190
|
+
bypassedRef={bypassedRef}
|
|
191
|
+
value={title}
|
|
192
|
+
readOnly={false}
|
|
193
|
+
onChange={onChange}
|
|
194
|
+
onPressEnter={onPressEnter}
|
|
195
|
+
autoFocus={true}
|
|
196
|
+
onKeyDown={onKeyDown}
|
|
197
|
+
placeholder={readOnly ? "" : `New ${typeTitle}`}
|
|
198
|
+
style={{
|
|
199
|
+
...textStyles.regular,
|
|
200
|
+
...inputStyle,
|
|
201
|
+
}}
|
|
202
|
+
{...(multiline
|
|
203
|
+
? {
|
|
204
|
+
autoSize: autosize,
|
|
205
|
+
}
|
|
206
|
+
: {})}
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
size={size}
|
|
212
|
+
after={
|
|
213
|
+
(referenceSelector || readOnly) && (
|
|
214
|
+
<AuxWrapper>
|
|
215
|
+
{referenceSelector && <div>{referenceSelector}</div>}
|
|
216
|
+
{readOnly && (
|
|
217
|
+
<div>
|
|
218
|
+
<Button style={{width: 40}} size="small" onClick={onAddCardButtonClick}>
|
|
219
|
+
Add
|
|
220
|
+
</Button>
|
|
221
|
+
</div>
|
|
222
|
+
)}
|
|
223
|
+
{multiline && <div />}
|
|
224
|
+
</AuxWrapper>
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
input={!readOnly}
|
|
228
|
+
/>
|
|
229
|
+
</Box>
|
|
230
|
+
);
|
|
231
|
+
};
|
package/src/not-empty.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {space, themeVars} from "./design-system";
|
|
3
|
+
|
|
4
|
+
const activityIndicatorStyle = css`
|
|
5
|
+
${{
|
|
6
|
+
backgroundColor: themeVars.active,
|
|
7
|
+
borderRadius: "50%",
|
|
8
|
+
position: "absolute",
|
|
9
|
+
top: 0,
|
|
10
|
+
}}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const NotificationDot = ({big = true, color = themeVars.active}: {big: boolean; color: string}) => {
|
|
14
|
+
const size = big ? space.s6 : space.s4;
|
|
15
|
+
const marginTop = big ? -6 : -1;
|
|
16
|
+
const marginRight = big ? -1 : 0;
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className={activityIndicatorStyle}
|
|
20
|
+
style={{backgroundColor: color, width: size, height: size, marginTop, marginRight}}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
|
|
3
|
+
const isEmpty = (value) => _.isNil(value) || value === "";
|
|
4
|
+
|
|
5
|
+
const getPrecision = (value) => {
|
|
6
|
+
if (isEmpty(value)) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
const [, decimalPart = ""] = String(value).split(".");
|
|
10
|
+
return decimalPart.length;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const removeTrailingZeros = (value) => {
|
|
14
|
+
if (isEmpty(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
const hasDecimalPart = value.indexOf(".") > 0;
|
|
18
|
+
return hasDecimalPart ? _.trimEnd(_.trimEnd(value, "0"), ".") : value;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const add = _.flow([
|
|
22
|
+
(first, second) => {
|
|
23
|
+
const result = Number(first) + Number(second);
|
|
24
|
+
const maxPrecision = Math.max(getPrecision(first), getPrecision(second));
|
|
25
|
+
return result.toFixed(maxPrecision);
|
|
26
|
+
},
|
|
27
|
+
removeTrailingZeros,
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export const sub = _.flow([
|
|
31
|
+
(first, second) => {
|
|
32
|
+
return add(first, -second);
|
|
33
|
+
},
|
|
34
|
+
removeTrailingZeros,
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
export const multiplyByHundred = _.flow([
|
|
38
|
+
(value) => {
|
|
39
|
+
if (isEmpty(value)) {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
const result = value * 100;
|
|
43
|
+
const precision = Math.max(0, getPrecision(value) - 2);
|
|
44
|
+
return result.toFixed(precision);
|
|
45
|
+
},
|
|
46
|
+
removeTrailingZeros,
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
export const divideByHundred = _.flow([
|
|
50
|
+
(value) => {
|
|
51
|
+
if (isEmpty(value)) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
const result = value / 100;
|
|
55
|
+
const precision = getPrecision(value) + 2;
|
|
56
|
+
return result.toFixed(precision);
|
|
57
|
+
},
|
|
58
|
+
removeTrailingZeros,
|
|
59
|
+
]);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {divideByHundred, multiplyByHundred, add, sub} from "./decimal";
|
|
2
|
+
|
|
3
|
+
describe("decimal", () => {
|
|
4
|
+
it("multiplyByHundred", () => {
|
|
5
|
+
expect(multiplyByHundred("")).toEqual("");
|
|
6
|
+
expect(multiplyByHundred(null)).toEqual(null);
|
|
7
|
+
expect(multiplyByHundred(undefined)).toEqual(undefined);
|
|
8
|
+
expect(multiplyByHundred("0")).toEqual("0");
|
|
9
|
+
expect(multiplyByHundred("1")).toEqual("100");
|
|
10
|
+
expect(multiplyByHundred("1.1")).toEqual("110");
|
|
11
|
+
expect(multiplyByHundred("0.1")).toEqual("10");
|
|
12
|
+
expect(multiplyByHundred("0.1111")).toEqual("11.11");
|
|
13
|
+
|
|
14
|
+
// Negative
|
|
15
|
+
expect(multiplyByHundred("-0")).toEqual("0");
|
|
16
|
+
expect(multiplyByHundred("-1")).toEqual("-100");
|
|
17
|
+
expect(multiplyByHundred("-0.1")).toEqual("-10");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("divideByHundred", () => {
|
|
21
|
+
expect(divideByHundred("")).toEqual("");
|
|
22
|
+
expect(divideByHundred(null)).toEqual(null);
|
|
23
|
+
expect(divideByHundred(undefined)).toEqual(undefined);
|
|
24
|
+
expect(divideByHundred("0")).toEqual("0");
|
|
25
|
+
expect(divideByHundred("1")).toEqual("0.01");
|
|
26
|
+
expect(divideByHundred("1.1")).toEqual("0.011");
|
|
27
|
+
expect(divideByHundred("0.1")).toEqual("0.001");
|
|
28
|
+
expect(divideByHundred("0.7")).toEqual("0.007");
|
|
29
|
+
|
|
30
|
+
// Negative
|
|
31
|
+
expect(divideByHundred("-1")).toEqual("-0.01");
|
|
32
|
+
expect(divideByHundred("-0.1")).toEqual("-0.001");
|
|
33
|
+
expect(divideByHundred("-100")).toEqual("-1");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("add", () => {
|
|
37
|
+
expect(add("1", "1")).toEqual("2");
|
|
38
|
+
expect(add("1", "1.1")).toEqual("2.1");
|
|
39
|
+
expect(add("0.01", "0.99")).toEqual("1");
|
|
40
|
+
expect(add("0.1", "1.01")).toEqual("1.11");
|
|
41
|
+
|
|
42
|
+
// Precision
|
|
43
|
+
expect(add("0.09", "0.01")).toEqual("0.1");
|
|
44
|
+
expect(add("0.06", "0.01")).toEqual("0.07");
|
|
45
|
+
|
|
46
|
+
// Negative
|
|
47
|
+
expect(add("-1128", "-9.3")).toEqual("-1137.3");
|
|
48
|
+
expect(add("11.28", "-9.3")).toEqual("1.98");
|
|
49
|
+
expect(add("1128", "-0.93")).toEqual("1127.07");
|
|
50
|
+
expect(add("11.28", "-93")).toEqual("-81.72");
|
|
51
|
+
expect(add("-11.28", "9.3")).toEqual("-1.98");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("sub", () => {
|
|
55
|
+
expect(sub("1", "1")).toEqual("0");
|
|
56
|
+
expect(sub("1.1", "1")).toEqual("0.1");
|
|
57
|
+
expect(sub("1.1", "0.1")).toEqual("1");
|
|
58
|
+
expect(sub("2.2", "1.1")).toEqual("1.1");
|
|
59
|
+
|
|
60
|
+
// Precision
|
|
61
|
+
expect(sub("0.04", "0.03")).toEqual("0.01");
|
|
62
|
+
expect(sub("0.03", "0.01")).toEqual("0.02");
|
|
63
|
+
|
|
64
|
+
// Negative
|
|
65
|
+
expect(sub("-1128", "-9.3")).toEqual("-1118.7");
|
|
66
|
+
expect(sub("11.28", "-9.3")).toEqual("20.58");
|
|
67
|
+
expect(sub("1128", "-0.93")).toEqual("1128.93");
|
|
68
|
+
expect(sub("11.28", "-93")).toEqual("104.28");
|
|
69
|
+
expect(sub("-11.28", "9.3")).toEqual("-20.58");
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {themeVars} from "../design-system";
|
|
3
|
+
|
|
4
|
+
export const invalidInputStyle = {
|
|
5
|
+
boxShadow: `0 0 0 1px ${themeVars.warning} inset`,
|
|
6
|
+
|
|
7
|
+
"&:hover": {
|
|
8
|
+
boxShadow: `0 0 0 1px ${themeVars.warning} inset`,
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
"&:focus": {
|
|
12
|
+
boxShadow: `0 0 0 1px ${themeVars.warning} inset`,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const invalidInputClass = css`
|
|
17
|
+
${invalidInputStyle}
|
|
18
|
+
`;
|