@fibery/ui-kit 1.0.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/index.ts +2 -0
- package/package.json +100 -0
- package/src/Button.d.ts +24 -0
- package/src/Button.js +361 -0
- package/src/FormFieldLoader.js +30 -0
- package/src/Item.tsx +127 -0
- package/src/Loaders.d.ts +16 -0
- package/src/Loaders.js +144 -0
- package/src/Select/components.js +64 -0
- package/src/Select/index.d.ts +11 -0
- package/src/Select/index.js +140 -0
- package/src/Select/lazy.js +35 -0
- package/src/Select/select-loader.tsx +8 -0
- package/src/Select/styles.js +133 -0
- package/src/ThemeProvider.tsx +14 -0
- package/src/create-inline-theme.ts +55 -0
- package/src/designSystem.ts +877 -0
- package/src/icons/Icon.tsx +56 -0
- package/src/icons/IconAsBackground.tsx +15 -0
- package/src/icons/IconAsPaths.ts +50 -0
- package/src/icons/ast/Activity.ts +8 -0
- package/src/icons/ast/ActivityLog.ts +8 -0
- package/src/icons/ast/Add.ts +8 -0
- package/src/icons/ast/AddCompact.ts +8 -0
- package/src/icons/ast/AddReactions.ts +8 -0
- package/src/icons/ast/AntdFilledCheckCircle.ts +8 -0
- package/src/icons/ast/AntdFilledCloseCircle.ts +8 -0
- package/src/icons/ast/AntdFilledExclamationCircle.ts +8 -0
- package/src/icons/ast/AntdFilledInfoCircle.ts +8 -0
- package/src/icons/ast/App.ts +8 -0
- package/src/icons/ast/AppDetails.ts +8 -0
- package/src/icons/ast/AppStore.ts +8 -0
- package/src/icons/ast/AppStoreOneColor.ts +8 -0
- package/src/icons/ast/AppTemplates.ts +8 -0
- package/src/icons/ast/AppTemplatesOneColor.ts +8 -0
- package/src/icons/ast/AppWebhooks.ts +8 -0
- package/src/icons/ast/AppWiki.ts +8 -0
- package/src/icons/ast/ArrowBottom.ts +8 -0
- package/src/icons/ast/ArrowCollapse.ts +8 -0
- package/src/icons/ast/ArrowCollapseVertical.ts +8 -0
- package/src/icons/ast/ArrowLeft.ts +8 -0
- package/src/icons/ast/ArrowRight.ts +8 -0
- package/src/icons/ast/ArrowTop.ts +8 -0
- package/src/icons/ast/AskForInput.ts +8 -0
- package/src/icons/ast/Back.ts +8 -0
- package/src/icons/ast/BacklogIcon.ts +8 -0
- package/src/icons/ast/BatchActionsIcon.ts +8 -0
- package/src/icons/ast/Cards.ts +8 -0
- package/src/icons/ast/Checked.ts +8 -0
- package/src/icons/ast/ClearValue.ts +8 -0
- package/src/icons/ast/Close.ts +8 -0
- package/src/icons/ast/ColorCoding.ts +8 -0
- package/src/icons/ast/Columns.ts +8 -0
- package/src/icons/ast/CopyUrl.ts +8 -0
- package/src/icons/ast/Database.ts +8 -0
- package/src/icons/ast/Delete.ts +8 -0
- package/src/icons/ast/Demo.ts +8 -0
- package/src/icons/ast/DoubleArrowLeft.ts +8 -0
- package/src/icons/ast/DoubleArrowRight.ts +8 -0
- package/src/icons/ast/DragBlockHandle.ts +8 -0
- package/src/icons/ast/DragHandle.ts +8 -0
- package/src/icons/ast/ExtensionAssignments.ts +8 -0
- package/src/icons/ast/ExtensionAvatar.ts +8 -0
- package/src/icons/ast/ExtensionComments.ts +8 -0
- package/src/icons/ast/ExtensionFiles.ts +8 -0
- package/src/icons/ast/ExtensionReferences.ts +8 -0
- package/src/icons/ast/ExtensionWorkflow.ts +8 -0
- package/src/icons/ast/Favorites.ts +8 -0
- package/src/icons/ast/FavoritesChecked.ts +8 -0
- package/src/icons/ast/FavoritesMenu.ts +8 -0
- package/src/icons/ast/Fields.ts +8 -0
- package/src/icons/ast/Filter.ts +8 -0
- package/src/icons/ast/FocusMode.ts +8 -0
- package/src/icons/ast/FocusModeOff.ts +8 -0
- package/src/icons/ast/Globe.ts +8 -0
- package/src/icons/ast/Hide.ts +8 -0
- package/src/icons/ast/Hint.ts +8 -0
- package/src/icons/ast/Home.ts +8 -0
- package/src/icons/ast/Integration.ts +8 -0
- package/src/icons/ast/InvitePeople.ts +8 -0
- package/src/icons/ast/Items.ts +8 -0
- package/src/icons/ast/LeftPanel.ts +8 -0
- package/src/icons/ast/Levels.ts +8 -0
- package/src/icons/ast/Lock.ts +8 -0
- package/src/icons/ast/MenuCollapser.ts +8 -0
- package/src/icons/ast/Milestones.ts +8 -0
- package/src/icons/ast/More.ts +8 -0
- package/src/icons/ast/MoreCompact.ts +8 -0
- package/src/icons/ast/MySpace.ts +8 -0
- package/src/icons/ast/Notifications.ts +8 -0
- package/src/icons/ast/ObjChild.ts +8 -0
- package/src/icons/ast/ObjM2M.ts +8 -0
- package/src/icons/ast/ObjO2O.ts +8 -0
- package/src/icons/ast/ObjParent.ts +8 -0
- package/src/icons/ast/ObjSelf.ts +8 -0
- package/src/icons/ast/OnSchedule.ts +8 -0
- package/src/icons/ast/OpenAsPage.ts +8 -0
- package/src/icons/ast/PageRegularMode.ts +8 -0
- package/src/icons/ast/PageWideMode.ts +8 -0
- package/src/icons/ast/Photo.ts +8 -0
- package/src/icons/ast/Popup.ts +8 -0
- package/src/icons/ast/Posts.ts +8 -0
- package/src/icons/ast/Remove.ts +8 -0
- package/src/icons/ast/Reply.ts +8 -0
- package/src/icons/ast/Restore.ts +8 -0
- package/src/icons/ast/RicheditorActionsMore.ts +8 -0
- package/src/icons/ast/RicheditorBlockCode.ts +8 -0
- package/src/icons/ast/RicheditorBlockEntity.ts +8 -0
- package/src/icons/ast/RicheditorBlockH1.ts +8 -0
- package/src/icons/ast/RicheditorBlockH2.ts +8 -0
- package/src/icons/ast/RicheditorBlockH3.ts +8 -0
- package/src/icons/ast/RicheditorBlockH4.ts +8 -0
- package/src/icons/ast/RicheditorBlockMention.ts +8 -0
- package/src/icons/ast/RicheditorBlockParagraph.ts +8 -0
- package/src/icons/ast/RicheditorBlockQuote.ts +8 -0
- package/src/icons/ast/RicheditorChecklistCreate.ts +8 -0
- package/src/icons/ast/RicheditorCommentCreate.ts +8 -0
- package/src/icons/ast/RicheditorEntityLinkCreate.ts +8 -0
- package/src/icons/ast/RicheditorHistoryRedo.ts +8 -0
- package/src/icons/ast/RicheditorHistoryUndo.ts +8 -0
- package/src/icons/ast/RicheditorImageAlignCenter.ts +8 -0
- package/src/icons/ast/RicheditorImageAlignLeft.ts +8 -0
- package/src/icons/ast/RicheditorImageAlignRight.ts +8 -0
- package/src/icons/ast/RicheditorImageUpload.ts +8 -0
- package/src/icons/ast/RicheditorImageWrapCenter.ts +8 -0
- package/src/icons/ast/RicheditorImageWrapLeft.ts +8 -0
- package/src/icons/ast/RicheditorImageWrapRight.ts +8 -0
- package/src/icons/ast/RicheditorImageZoom.ts +8 -0
- package/src/icons/ast/RicheditorLinkCreate.ts +8 -0
- package/src/icons/ast/RicheditorLinkedhighlightCreate.ts +8 -0
- package/src/icons/ast/RicheditorListBullet.ts +8 -0
- package/src/icons/ast/RicheditorListIndent.ts +8 -0
- package/src/icons/ast/RicheditorListOrdered.ts +8 -0
- package/src/icons/ast/RicheditorListUnindent.ts +8 -0
- package/src/icons/ast/RicheditorMarkCode.ts +8 -0
- package/src/icons/ast/RicheditorMarkEm.ts +8 -0
- package/src/icons/ast/RicheditorMarkHighlight.ts +8 -0
- package/src/icons/ast/RicheditorMarkStrike.ts +8 -0
- package/src/icons/ast/RicheditorMarkStrong.ts +8 -0
- package/src/icons/ast/RicheditorMarkUnderline.ts +8 -0
- package/src/icons/ast/RicheditorOpenLink.ts +8 -0
- package/src/icons/ast/RicheditorTableCreate.ts +8 -0
- package/src/icons/ast/RicheditorUnlink.ts +8 -0
- package/src/icons/ast/RicheditorVideoUpload.ts +8 -0
- package/src/icons/ast/RightPanel.ts +8 -0
- package/src/icons/ast/Rows.ts +8 -0
- package/src/icons/ast/Search.ts +8 -0
- package/src/icons/ast/SelfReferenceOff.ts +8 -0
- package/src/icons/ast/SelfReferenceOn.ts +8 -0
- package/src/icons/ast/Settings.ts +8 -0
- package/src/icons/ast/Share.ts +8 -0
- package/src/icons/ast/Shared.ts +8 -0
- package/src/icons/ast/Sidebar.ts +8 -0
- package/src/icons/ast/Slack.ts +8 -0
- package/src/icons/ast/SmartFolder.ts +8 -0
- package/src/icons/ast/Sort.ts +8 -0
- package/src/icons/ast/SortOnBottom.ts +8 -0
- package/src/icons/ast/SortOnTop.ts +8 -0
- package/src/icons/ast/Spinner.ts +8 -0
- package/src/icons/ast/TypeBoolean.ts +8 -0
- package/src/icons/ast/TypeButton.ts +8 -0
- package/src/icons/ast/TypeCheckbox.ts +8 -0
- package/src/icons/ast/TypeDate.ts +8 -0
- package/src/icons/ast/TypeEmail.ts +8 -0
- package/src/icons/ast/TypeEmoji.ts +8 -0
- package/src/icons/ast/TypeFormula.ts +8 -0
- package/src/icons/ast/TypeFunction.ts +8 -0
- package/src/icons/ast/TypeLookup.ts +8 -0
- package/src/icons/ast/TypeMoney.ts +8 -0
- package/src/icons/ast/TypeMultiSelect.ts +8 -0
- package/src/icons/ast/TypeNumber.ts +8 -0
- package/src/icons/ast/TypePercent.ts +8 -0
- package/src/icons/ast/TypePhone.ts +8 -0
- package/src/icons/ast/TypeRelation.ts +8 -0
- package/src/icons/ast/TypeRichText.ts +8 -0
- package/src/icons/ast/TypeRule.ts +8 -0
- package/src/icons/ast/TypeSingleSelect.ts +8 -0
- package/src/icons/ast/TypeText.ts +8 -0
- package/src/icons/ast/TypeUrl.ts +8 -0
- package/src/icons/ast/Upgrade.ts +8 -0
- package/src/icons/ast/ViewBoard.ts +8 -0
- package/src/icons/ast/ViewCalendar.ts +8 -0
- package/src/icons/ast/ViewCanvas.ts +8 -0
- package/src/icons/ast/ViewChart.ts +8 -0
- package/src/icons/ast/ViewDetails.ts +8 -0
- package/src/icons/ast/ViewDocument.ts +8 -0
- package/src/icons/ast/ViewFeed.ts +8 -0
- package/src/icons/ast/ViewList.ts +8 -0
- package/src/icons/ast/ViewPage.ts +8 -0
- package/src/icons/ast/ViewTable.ts +8 -0
- package/src/icons/ast/ViewTimeline.ts +8 -0
- package/src/icons/ast/Views.ts +8 -0
- package/src/icons/ast/Warning.ts +8 -0
- package/src/icons/ast/index.tsx +174 -0
- package/src/icons/generateIconFromAst.ts +29 -0
- package/src/icons/getIconContainerStyle.tsx +13 -0
- package/src/icons/getShiftStyle.ts +21 -0
- package/src/icons/react/Activity.tsx +12 -0
- package/src/icons/react/ActivityLog.tsx +12 -0
- package/src/icons/react/Add.tsx +12 -0
- package/src/icons/react/AddCompact.tsx +12 -0
- package/src/icons/react/AddReactions.tsx +12 -0
- package/src/icons/react/AntdFilledCheckCircle.tsx +12 -0
- package/src/icons/react/AntdFilledCloseCircle.tsx +12 -0
- package/src/icons/react/AntdFilledExclamationCircle.tsx +12 -0
- package/src/icons/react/AntdFilledInfoCircle.tsx +12 -0
- package/src/icons/react/App.tsx +12 -0
- package/src/icons/react/AppDetails.tsx +12 -0
- package/src/icons/react/AppStore.tsx +12 -0
- package/src/icons/react/AppStoreOneColor.tsx +12 -0
- package/src/icons/react/AppTemplates.tsx +12 -0
- package/src/icons/react/AppTemplatesOneColor.tsx +12 -0
- package/src/icons/react/AppWebhooks.tsx +12 -0
- package/src/icons/react/AppWiki.tsx +12 -0
- package/src/icons/react/ArrowBottom.tsx +12 -0
- package/src/icons/react/ArrowCollapse.tsx +12 -0
- package/src/icons/react/ArrowCollapseVertical.tsx +12 -0
- package/src/icons/react/ArrowLeft.tsx +12 -0
- package/src/icons/react/ArrowRight.tsx +12 -0
- package/src/icons/react/ArrowTop.tsx +12 -0
- package/src/icons/react/AskForInput.tsx +12 -0
- package/src/icons/react/Back.tsx +12 -0
- package/src/icons/react/BacklogIcon.tsx +12 -0
- package/src/icons/react/BatchActionsIcon.tsx +12 -0
- package/src/icons/react/Cards.tsx +12 -0
- package/src/icons/react/Checked.tsx +12 -0
- package/src/icons/react/ClearValue.tsx +12 -0
- package/src/icons/react/Close.tsx +12 -0
- package/src/icons/react/ColorCoding.tsx +12 -0
- package/src/icons/react/Columns.tsx +12 -0
- package/src/icons/react/CopyUrl.tsx +12 -0
- package/src/icons/react/Database.tsx +12 -0
- package/src/icons/react/Delete.tsx +12 -0
- package/src/icons/react/Demo.tsx +12 -0
- package/src/icons/react/DoubleArrowLeft.tsx +12 -0
- package/src/icons/react/DoubleArrowRight.tsx +12 -0
- package/src/icons/react/DragBlockHandle.tsx +12 -0
- package/src/icons/react/DragHandle.tsx +12 -0
- package/src/icons/react/ExtensionAssignments.tsx +12 -0
- package/src/icons/react/ExtensionAvatar.tsx +12 -0
- package/src/icons/react/ExtensionComments.tsx +12 -0
- package/src/icons/react/ExtensionFiles.tsx +12 -0
- package/src/icons/react/ExtensionReferences.tsx +12 -0
- package/src/icons/react/ExtensionWorkflow.tsx +12 -0
- package/src/icons/react/Favorites.tsx +12 -0
- package/src/icons/react/FavoritesChecked.tsx +12 -0
- package/src/icons/react/FavoritesMenu.tsx +12 -0
- package/src/icons/react/Fields.tsx +12 -0
- package/src/icons/react/Filter.tsx +12 -0
- package/src/icons/react/FocusMode.tsx +12 -0
- package/src/icons/react/FocusModeOff.tsx +12 -0
- package/src/icons/react/Globe.tsx +12 -0
- package/src/icons/react/Hide.tsx +12 -0
- package/src/icons/react/Hint.tsx +12 -0
- package/src/icons/react/Home.tsx +12 -0
- package/src/icons/react/Integration.tsx +12 -0
- package/src/icons/react/InvitePeople.tsx +12 -0
- package/src/icons/react/Items.tsx +12 -0
- package/src/icons/react/LeftPanel.tsx +12 -0
- package/src/icons/react/Levels.tsx +12 -0
- package/src/icons/react/Lock.tsx +12 -0
- package/src/icons/react/MenuCollapser.tsx +12 -0
- package/src/icons/react/Milestones.tsx +12 -0
- package/src/icons/react/More.tsx +12 -0
- package/src/icons/react/MoreCompact.tsx +12 -0
- package/src/icons/react/MySpace.tsx +12 -0
- package/src/icons/react/Notifications.tsx +12 -0
- package/src/icons/react/ObjChild.tsx +12 -0
- package/src/icons/react/ObjM2M.tsx +12 -0
- package/src/icons/react/ObjO2O.tsx +12 -0
- package/src/icons/react/ObjParent.tsx +12 -0
- package/src/icons/react/ObjSelf.tsx +12 -0
- package/src/icons/react/OnSchedule.tsx +12 -0
- package/src/icons/react/OpenAsPage.tsx +12 -0
- package/src/icons/react/PageRegularMode.tsx +12 -0
- package/src/icons/react/PageWideMode.tsx +12 -0
- package/src/icons/react/Photo.tsx +12 -0
- package/src/icons/react/Popup.tsx +12 -0
- package/src/icons/react/Posts.tsx +12 -0
- package/src/icons/react/Remove.tsx +12 -0
- package/src/icons/react/Reply.tsx +12 -0
- package/src/icons/react/Restore.tsx +12 -0
- package/src/icons/react/RicheditorActionsMore.tsx +12 -0
- package/src/icons/react/RicheditorBlockCode.tsx +12 -0
- package/src/icons/react/RicheditorBlockEntity.tsx +12 -0
- package/src/icons/react/RicheditorBlockH1.tsx +12 -0
- package/src/icons/react/RicheditorBlockH2.tsx +12 -0
- package/src/icons/react/RicheditorBlockH3.tsx +12 -0
- package/src/icons/react/RicheditorBlockH4.tsx +12 -0
- package/src/icons/react/RicheditorBlockMention.tsx +12 -0
- package/src/icons/react/RicheditorBlockParagraph.tsx +12 -0
- package/src/icons/react/RicheditorBlockQuote.tsx +12 -0
- package/src/icons/react/RicheditorChecklistCreate.tsx +12 -0
- package/src/icons/react/RicheditorCommentCreate.tsx +12 -0
- package/src/icons/react/RicheditorEntityLinkCreate.tsx +12 -0
- package/src/icons/react/RicheditorHistoryRedo.tsx +12 -0
- package/src/icons/react/RicheditorHistoryUndo.tsx +12 -0
- package/src/icons/react/RicheditorImageAlignCenter.tsx +12 -0
- package/src/icons/react/RicheditorImageAlignLeft.tsx +12 -0
- package/src/icons/react/RicheditorImageAlignRight.tsx +12 -0
- package/src/icons/react/RicheditorImageUpload.tsx +12 -0
- package/src/icons/react/RicheditorImageWrapCenter.tsx +12 -0
- package/src/icons/react/RicheditorImageWrapLeft.tsx +12 -0
- package/src/icons/react/RicheditorImageWrapRight.tsx +12 -0
- package/src/icons/react/RicheditorImageZoom.tsx +12 -0
- package/src/icons/react/RicheditorLinkCreate.tsx +12 -0
- package/src/icons/react/RicheditorLinkedhighlightCreate.tsx +12 -0
- package/src/icons/react/RicheditorListBullet.tsx +12 -0
- package/src/icons/react/RicheditorListIndent.tsx +12 -0
- package/src/icons/react/RicheditorListOrdered.tsx +12 -0
- package/src/icons/react/RicheditorListUnindent.tsx +12 -0
- package/src/icons/react/RicheditorMarkCode.tsx +12 -0
- package/src/icons/react/RicheditorMarkEm.tsx +12 -0
- package/src/icons/react/RicheditorMarkHighlight.tsx +12 -0
- package/src/icons/react/RicheditorMarkStrike.tsx +12 -0
- package/src/icons/react/RicheditorMarkStrong.tsx +12 -0
- package/src/icons/react/RicheditorMarkUnderline.tsx +12 -0
- package/src/icons/react/RicheditorOpenLink.tsx +12 -0
- package/src/icons/react/RicheditorTableCreate.tsx +12 -0
- package/src/icons/react/RicheditorUnlink.tsx +12 -0
- package/src/icons/react/RicheditorVideoUpload.tsx +12 -0
- package/src/icons/react/RightPanel.tsx +12 -0
- package/src/icons/react/Rows.tsx +12 -0
- package/src/icons/react/Search.tsx +12 -0
- package/src/icons/react/SelfReferenceOff.tsx +12 -0
- package/src/icons/react/SelfReferenceOn.tsx +12 -0
- package/src/icons/react/Settings.tsx +12 -0
- package/src/icons/react/Share.tsx +12 -0
- package/src/icons/react/Shared.tsx +12 -0
- package/src/icons/react/Sidebar.tsx +12 -0
- package/src/icons/react/Slack.tsx +12 -0
- package/src/icons/react/SmartFolder.tsx +12 -0
- package/src/icons/react/Sort.tsx +12 -0
- package/src/icons/react/SortOnBottom.tsx +12 -0
- package/src/icons/react/SortOnTop.tsx +12 -0
- package/src/icons/react/Spinner.tsx +12 -0
- package/src/icons/react/TypeBoolean.tsx +12 -0
- package/src/icons/react/TypeButton.tsx +12 -0
- package/src/icons/react/TypeCheckbox.tsx +12 -0
- package/src/icons/react/TypeDate.tsx +12 -0
- package/src/icons/react/TypeEmail.tsx +12 -0
- package/src/icons/react/TypeEmoji.tsx +12 -0
- package/src/icons/react/TypeFormula.tsx +12 -0
- package/src/icons/react/TypeFunction.tsx +12 -0
- package/src/icons/react/TypeLookup.tsx +12 -0
- package/src/icons/react/TypeMoney.tsx +12 -0
- package/src/icons/react/TypeMultiSelect.tsx +12 -0
- package/src/icons/react/TypeNumber.tsx +12 -0
- package/src/icons/react/TypePercent.tsx +12 -0
- package/src/icons/react/TypePhone.tsx +12 -0
- package/src/icons/react/TypeRelation.tsx +12 -0
- package/src/icons/react/TypeRichText.tsx +12 -0
- package/src/icons/react/TypeRule.tsx +12 -0
- package/src/icons/react/TypeSingleSelect.tsx +12 -0
- package/src/icons/react/TypeText.tsx +12 -0
- package/src/icons/react/TypeUrl.tsx +12 -0
- package/src/icons/react/Upgrade.tsx +12 -0
- package/src/icons/react/ViewBoard.tsx +12 -0
- package/src/icons/react/ViewCalendar.tsx +12 -0
- package/src/icons/react/ViewCanvas.tsx +12 -0
- package/src/icons/react/ViewChart.tsx +12 -0
- package/src/icons/react/ViewDetails.tsx +12 -0
- package/src/icons/react/ViewDocument.tsx +12 -0
- package/src/icons/react/ViewFeed.tsx +12 -0
- package/src/icons/react/ViewList.tsx +12 -0
- package/src/icons/react/ViewPage.tsx +12 -0
- package/src/icons/react/ViewTable.tsx +12 -0
- package/src/icons/react/ViewTimeline.tsx +12 -0
- package/src/icons/react/Views.tsx +12 -0
- package/src/icons/react/Warning.tsx +12 -0
- package/src/icons/react/index.tsx +174 -0
- package/src/icons/types.ts +29 -0
- package/src/loading-sausage.tsx +171 -0
package/src/Loaders.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {css, cx} from "@linaria/core";
|
|
2
|
+
import {styled} from "@linaria/react";
|
|
3
|
+
import {border, layout, space, textStyles, themeVars} from "./designSystem";
|
|
4
|
+
import {getShiftStyle} from "./icons/getShiftStyle";
|
|
5
|
+
import {LoadingSausage} from "./loading-sausage";
|
|
6
|
+
import {useTheme} from "./ThemeProvider";
|
|
7
|
+
|
|
8
|
+
export const LoadingView = styled.div`
|
|
9
|
+
position: ${(props) => (props.absolute ? "absolute" : "static")};
|
|
10
|
+
height: ${(props) => (props.absolute ? "auto" : "100%")};
|
|
11
|
+
background: ${(props) => props.backgroundColor || themeVars.mainBg};
|
|
12
|
+
${{
|
|
13
|
+
top: layout.viewHeaderHeight,
|
|
14
|
+
left: 0,
|
|
15
|
+
bottom: 0,
|
|
16
|
+
right: 0,
|
|
17
|
+
padding: space.xl,
|
|
18
|
+
}}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const LoadingHeader = styled.div`
|
|
22
|
+
position: ${(props) => (props.absolute ? "absolute" : "static")};
|
|
23
|
+
${{
|
|
24
|
+
top: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
right: 0,
|
|
27
|
+
height: layout.viewHeaderHeight,
|
|
28
|
+
backgroundColor: themeVars.mainBg,
|
|
29
|
+
paddingBottom: space.l,
|
|
30
|
+
paddingLeft: space.l + space.s,
|
|
31
|
+
display: "flex",
|
|
32
|
+
justifyContent: "flex-end",
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
boxSizing: "border-box",
|
|
35
|
+
}};
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
export const LoadingPage = ({absolute = true, contentLoader = true}) => (
|
|
39
|
+
<>
|
|
40
|
+
<LoadingHeader absolute={absolute}>
|
|
41
|
+
<LoadingSausage height={20} minWidth={300} maxWidth={300} animateAppearance />
|
|
42
|
+
</LoadingHeader>
|
|
43
|
+
{contentLoader && <LoadingView absolute={absolute} />}
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export const SidebarLoadingPage = () => (
|
|
48
|
+
<div
|
|
49
|
+
className={css`
|
|
50
|
+
${{
|
|
51
|
+
width: layout.typeEditorWidth,
|
|
52
|
+
minWidth: layout.typeEditorMinWidth,
|
|
53
|
+
paddingBottom: space.xl,
|
|
54
|
+
overflowY: "scroll",
|
|
55
|
+
height: "100%",
|
|
56
|
+
}}
|
|
57
|
+
`}
|
|
58
|
+
>
|
|
59
|
+
<LoadingPage absolute={false} />
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const loaderWrapperStyle = css`
|
|
64
|
+
${{
|
|
65
|
+
padding: space.xxl,
|
|
66
|
+
height: "100%",
|
|
67
|
+
display: "flex",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
flexDirection: "column",
|
|
71
|
+
marginLeft: space.l,
|
|
72
|
+
marginRight: space.l,
|
|
73
|
+
borderRadius: border.radius6,
|
|
74
|
+
}}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
const loaderStyle = css`
|
|
78
|
+
${{paddingBottom: space.s, ...textStyles.regular}}
|
|
79
|
+
`;
|
|
80
|
+
export const LoadingApp = ({backgroundColor = "transparent", appName}) => (
|
|
81
|
+
<div className={loaderWrapperStyle} style={{backgroundColor}}>
|
|
82
|
+
<div className={loaderStyle}>{`Loading ${appName} app…`}</div>
|
|
83
|
+
<LoadingSausage minWidth={100} maxWidth={100} />
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const spinner = css`
|
|
88
|
+
@keyframes spinnerAnimation {
|
|
89
|
+
to {
|
|
90
|
+
transform: rotate(360deg);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
border-style: solid;
|
|
96
|
+
animation: spinnerAnimation 0.6s linear infinite;
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
const ContainerSpinner = styled.div`
|
|
100
|
+
width: ${(props) => props.containerSize}px;
|
|
101
|
+
height: ${(props) => props.containerSize}px;
|
|
102
|
+
line-height: ${(props) => props.containerSize}px;
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
export const Spinner = ({size = 20, containerSize = 15, width = 2, color = "#000000", backgroundColor = "#FFFFFF"}) => {
|
|
106
|
+
const spinnerStyle = {
|
|
107
|
+
width: size,
|
|
108
|
+
height: size,
|
|
109
|
+
...getShiftStyle({elementSize: size, containerSize}),
|
|
110
|
+
borderWidth: width,
|
|
111
|
+
borderColor: backgroundColor,
|
|
112
|
+
borderTopColor: color,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<ContainerSpinner containerSize={containerSize}>
|
|
117
|
+
<div style={spinnerStyle} className={spinner} />
|
|
118
|
+
</ContainerSpinner>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const LoadingTreeMenuItem = ({color, Icon, level, children}) => {
|
|
123
|
+
const theme = useTheme();
|
|
124
|
+
return (
|
|
125
|
+
<div
|
|
126
|
+
className={cx(
|
|
127
|
+
css`
|
|
128
|
+
display: flex;
|
|
129
|
+
gap: 0;
|
|
130
|
+
align-items: center;
|
|
131
|
+
height: ${layout.newMenuItemHeight}px;
|
|
132
|
+
`,
|
|
133
|
+
level === 0 &&
|
|
134
|
+
css`
|
|
135
|
+
padding-left: 5px;
|
|
136
|
+
gap: ${space.s}px;
|
|
137
|
+
`
|
|
138
|
+
)}
|
|
139
|
+
>
|
|
140
|
+
<Icon color={color} containerSize={layout.newMenuItemHeight} iconSize={18} />
|
|
141
|
+
{children || <LoadingSausage height={space.s} inverted={theme.mode === "dark"} />}
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {useCallback} from "react";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
import {components} from "react-windowed-select";
|
|
4
|
+
import RemoveIcon from "../icons/react/Remove";
|
|
5
|
+
import {Button} from "../Button";
|
|
6
|
+
import {themeVars, space} from "../designSystem";
|
|
7
|
+
import ArrowBottom from "../icons/react/ArrowBottom";
|
|
8
|
+
import {dropdownIndicatorSize, expanderStyle} from "./styles";
|
|
9
|
+
|
|
10
|
+
export const Option = ({children, ...props}) => {
|
|
11
|
+
const {onMouseMove, onMouseOver, ...rest} = props.innerProps;
|
|
12
|
+
const newProps = Object.assign(props, {innerProps: rest});
|
|
13
|
+
return <components.Option {...newProps}>{children}</components.Option>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const DropdownIndicator = (props) => (
|
|
17
|
+
<div
|
|
18
|
+
className={expanderStyle}
|
|
19
|
+
style={{
|
|
20
|
+
transform: props.selectProps.menuIsOpen ? "rotate(180deg)" : "",
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<ArrowBottom iconSize={dropdownIndicatorSize} color={themeVars.disabledTextColor} />
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const ClearIndicator = ({innerProps, selectProps}) => {
|
|
28
|
+
const onMouseDown = innerProps.onMouseDown;
|
|
29
|
+
const wrappedOnMouseDown = useCallback(
|
|
30
|
+
(e) => {
|
|
31
|
+
onMouseDown(e);
|
|
32
|
+
// This prevents false positive triggering in rc-trigger
|
|
33
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
34
|
+
},
|
|
35
|
+
[onMouseDown]
|
|
36
|
+
);
|
|
37
|
+
return (
|
|
38
|
+
<Button
|
|
39
|
+
borderless
|
|
40
|
+
Icon={RemoveIcon}
|
|
41
|
+
disabled={selectProps.isDisabled}
|
|
42
|
+
size={":button-size/super-small"}
|
|
43
|
+
{...innerProps}
|
|
44
|
+
onMouseDown={wrappedOnMouseDown}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const NoOptionsMessage = ({children}) => {
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
className={css`
|
|
53
|
+
${{
|
|
54
|
+
paddingLeft: space.l + 2,
|
|
55
|
+
paddingRight: space.l + 2,
|
|
56
|
+
paddingTop: space.m,
|
|
57
|
+
paddingBottom: space.m,
|
|
58
|
+
}}
|
|
59
|
+
`}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {FunctionComponent, ForwardRefRenderFunction} from "react";
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
+
export const Select: ForwardRefRenderFunction<{focus: () => void}, any>;
|
|
4
|
+
export const CreatableSelect: FunctionComponent<any>;
|
|
5
|
+
export const components: {
|
|
6
|
+
GroupHeading: FunctionComponent<any>;
|
|
7
|
+
Option: FunctionComponent<any>;
|
|
8
|
+
SingleValue: FunctionComponent<any>;
|
|
9
|
+
MultiValue: FunctionComponent<any>;
|
|
10
|
+
};
|
|
11
|
+
export const combineStyles: (...args: any[]) => any;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import cn from "classnames";
|
|
2
|
+
import {useCallback, forwardRef} from "react";
|
|
3
|
+
import BaseSelect from "react-select";
|
|
4
|
+
import BaseCreatableSelect from "react-select/creatable";
|
|
5
|
+
import WindowedSelect, {components, WindowedMenuList} from "react-windowed-select";
|
|
6
|
+
import {createInlineTheme} from "../designSystem";
|
|
7
|
+
import {useTheme} from "../ThemeProvider";
|
|
8
|
+
import {ClearIndicator, DropdownIndicator, NoOptionsMessage, Option} from "./components";
|
|
9
|
+
import {componentsStyles, singleLineComponentsStyle} from "./styles";
|
|
10
|
+
|
|
11
|
+
const GroupHeading = (props) => {
|
|
12
|
+
if (!props.children) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return <components.GroupHeading {...props} />;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function Menu(props) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const {innerProps, className} = props;
|
|
21
|
+
const overridedInnerProps = {...innerProps, style: {...innerProps.style, ...createInlineTheme(theme)}};
|
|
22
|
+
return <components.Menu {...props} innerProps={overridedInnerProps} className={cn(className, "react-select-menu")} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {components};
|
|
26
|
+
|
|
27
|
+
export const combineStyles = (stylesArray) => {
|
|
28
|
+
return stylesArray.reduce((acc, style) => {
|
|
29
|
+
Object.keys(style).forEach((key) => {
|
|
30
|
+
if (acc[key]) {
|
|
31
|
+
const temp = acc[key];
|
|
32
|
+
acc[key] = (provided, state) => style[key](temp(provided, state), state);
|
|
33
|
+
} else {
|
|
34
|
+
acc[key] = (provided, state) => style[key](provided, state);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return acc;
|
|
38
|
+
}, {});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function SingleRowSelect({styles = {}, ...rest}) {
|
|
42
|
+
return <Select {...rest} styles={combineStyles([singleLineComponentsStyle, styles])} />;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Select = forwardRef(function Select(
|
|
46
|
+
{components, isCollectionMode, menuPortalTarget, onKeyDown, styles = {}, virtualized = true, ...rest},
|
|
47
|
+
forwardedRef
|
|
48
|
+
) {
|
|
49
|
+
const theme = useTheme();
|
|
50
|
+
const combineThemes = useCallback((providedTheme) => ({...providedTheme, ...theme}), [theme]);
|
|
51
|
+
const handleKeyDown = useCallback(
|
|
52
|
+
(e) => {
|
|
53
|
+
switch (e.key) {
|
|
54
|
+
case "Escape":
|
|
55
|
+
if (rest.menuIsOpen) {
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
case "Home":
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
if (e.shiftKey) {
|
|
62
|
+
e.target.selectionStart = 0;
|
|
63
|
+
} else {
|
|
64
|
+
e.target.setSelectionRange(0, 0);
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "End":
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
const len = e.target.value.length;
|
|
70
|
+
if (e.shiftKey) {
|
|
71
|
+
e.target.selectionEnd = len;
|
|
72
|
+
} else {
|
|
73
|
+
e.target.setSelectionRange(len, len);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
}
|
|
78
|
+
onKeyDown && onKeyDown(e);
|
|
79
|
+
},
|
|
80
|
+
[onKeyDown, rest.menuIsOpen]
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const SelectComponent = virtualized ? WindowedSelect : BaseSelect;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<SelectComponent
|
|
87
|
+
ref={forwardedRef}
|
|
88
|
+
menuPortalTarget={menuPortalTarget}
|
|
89
|
+
menuPlacement={"auto"}
|
|
90
|
+
style={createInlineTheme(theme)}
|
|
91
|
+
styles={combineStyles([componentsStyles, styles])}
|
|
92
|
+
theme={combineThemes}
|
|
93
|
+
isMulti={isCollectionMode}
|
|
94
|
+
backspaceRemovesValue={isCollectionMode}
|
|
95
|
+
tabSelectsValue={false}
|
|
96
|
+
components={{
|
|
97
|
+
Menu,
|
|
98
|
+
DropdownIndicator,
|
|
99
|
+
ClearIndicator,
|
|
100
|
+
Option,
|
|
101
|
+
MultiValueRemove: ClearIndicator,
|
|
102
|
+
NoOptionsMessage,
|
|
103
|
+
GroupHeading,
|
|
104
|
+
...components,
|
|
105
|
+
}}
|
|
106
|
+
{...rest}
|
|
107
|
+
onKeyDown={handleKeyDown}
|
|
108
|
+
isDisabled={rest.disabled}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export function CreatableSelect({components, isCollectionMode, menuPortalTarget, styles = {}, ...rest}) {
|
|
114
|
+
const theme = useTheme();
|
|
115
|
+
const combineThemes = useCallback((providedTheme) => ({...providedTheme, ...theme}), [theme]);
|
|
116
|
+
return (
|
|
117
|
+
<BaseCreatableSelect
|
|
118
|
+
menuPortalTarget={menuPortalTarget}
|
|
119
|
+
menuPlacement={"auto"}
|
|
120
|
+
styles={combineStyles([componentsStyles, styles])}
|
|
121
|
+
theme={combineThemes}
|
|
122
|
+
isMulti={isCollectionMode}
|
|
123
|
+
backspaceRemovesValue={isCollectionMode}
|
|
124
|
+
tabSelectsValue={false}
|
|
125
|
+
components={{
|
|
126
|
+
Menu,
|
|
127
|
+
MenuList: WindowedMenuList,
|
|
128
|
+
DropdownIndicator,
|
|
129
|
+
ClearIndicator,
|
|
130
|
+
Option,
|
|
131
|
+
MultiValueRemove: ClearIndicator,
|
|
132
|
+
NoOptionsMessage,
|
|
133
|
+
GroupHeading,
|
|
134
|
+
...components,
|
|
135
|
+
}}
|
|
136
|
+
{...rest}
|
|
137
|
+
isDisabled={rest.disabled}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {lazy, Suspense, forwardRef} from "react";
|
|
2
|
+
import {SelectLoader} from "./select-loader";
|
|
3
|
+
|
|
4
|
+
const LazySelect = lazy(async () => {
|
|
5
|
+
const {Select} = await import("./index");
|
|
6
|
+
return {default: Select};
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const ReactSelect = forwardRef((props, forwardedRef) => (
|
|
10
|
+
<Suspense fallback={<SelectLoader />}>
|
|
11
|
+
<LazySelect {...props} ref={forwardedRef} />
|
|
12
|
+
</Suspense>
|
|
13
|
+
));
|
|
14
|
+
|
|
15
|
+
const CreatableLazySelect = lazy(async () => {
|
|
16
|
+
const {CreatableSelect} = await import("./index");
|
|
17
|
+
return {default: CreatableSelect};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const CreatableReactSelect = (props) => (
|
|
21
|
+
<Suspense fallback={<SelectLoader />}>
|
|
22
|
+
<CreatableLazySelect {...props} />
|
|
23
|
+
</Suspense>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const SingleRowLazySelect = lazy(async () => {
|
|
27
|
+
const {SingleRowSelect} = await import("./index");
|
|
28
|
+
return {default: SingleRowSelect};
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const SingleRowReactSelect = (props) => (
|
|
32
|
+
<Suspense fallback={<SelectLoader />}>
|
|
33
|
+
<SingleRowLazySelect {...props} />
|
|
34
|
+
</Suspense>
|
|
35
|
+
);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {inputOverrides} from "../antd/styles";
|
|
3
|
+
import {border, layout, space, textStyles, themeVars, transition} from "../designSystem";
|
|
4
|
+
|
|
5
|
+
export const dropdownIndicatorSize = 16;
|
|
6
|
+
|
|
7
|
+
export const expanderStyle = css`
|
|
8
|
+
${{
|
|
9
|
+
transition: `transform ${transition}`,
|
|
10
|
+
width: dropdownIndicatorSize,
|
|
11
|
+
height: dropdownIndicatorSize,
|
|
12
|
+
}}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
function createControlStyle({isSingleLine}) {
|
|
16
|
+
const childDivStyle = {
|
|
17
|
+
padding: 0,
|
|
18
|
+
overflow: "visible",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
if (isSingleLine) {
|
|
22
|
+
childDivStyle.flexWrap = "nowrap";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (provided, state) => ({
|
|
26
|
+
display: "flex",
|
|
27
|
+
flexWrap: isSingleLine ? "nowrap" : "wrap",
|
|
28
|
+
justifyContent: "space-between",
|
|
29
|
+
width: "100%",
|
|
30
|
+
minHeight: layout.inputHeight,
|
|
31
|
+
...inputOverrides.main,
|
|
32
|
+
...(state.isFocused && inputOverrides.focus),
|
|
33
|
+
...(state.isDisabled && inputOverrides.disabled),
|
|
34
|
+
":hover": !state.isFocused && !state.isDisabled && inputOverrides.hover,
|
|
35
|
+
paddingLeft: space.l,
|
|
36
|
+
paddingRight: space.l,
|
|
37
|
+
"& > div": childDivStyle,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const componentsStyles = {
|
|
42
|
+
option: (provided, state) => {
|
|
43
|
+
const disabledStyles = {
|
|
44
|
+
cursor: "not-allowed",
|
|
45
|
+
color: themeVars.disabledTextColor,
|
|
46
|
+
};
|
|
47
|
+
const enabledStyles = {
|
|
48
|
+
":hover": {
|
|
49
|
+
backgroundColor: state.isFocused ? themeVars.actionMenuInnerHover : themeVars.actionMenuInnerHover,
|
|
50
|
+
},
|
|
51
|
+
":active": {
|
|
52
|
+
backgroundColor: themeVars.actionMenuInnerHover,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
...provided,
|
|
57
|
+
...textStyles.regular,
|
|
58
|
+
minHeight: layout.menuItemHeight,
|
|
59
|
+
paddingLeft: space.l,
|
|
60
|
+
paddingRight: space.l,
|
|
61
|
+
paddingTop: 0,
|
|
62
|
+
paddingBottom: 0,
|
|
63
|
+
margin: 0,
|
|
64
|
+
backgroundColor: state.isFocused ? themeVars.actionMenuInnerHover : themeVars.actionMenuInnerBg,
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
display: "flex",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
justifyContent: "stretch",
|
|
69
|
+
...(state.isDisabled ? disabledStyles : enabledStyles),
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
placeholder: (provided) => ({
|
|
73
|
+
...provided,
|
|
74
|
+
color: themeVars.disabledTextColor,
|
|
75
|
+
paddingLeft: 0,
|
|
76
|
+
whiteSpace: "nowrap",
|
|
77
|
+
textOverflow: "ellipsis",
|
|
78
|
+
overflow: "hidden",
|
|
79
|
+
width: "100%",
|
|
80
|
+
}),
|
|
81
|
+
singleValue: (provided) => ({
|
|
82
|
+
...provided,
|
|
83
|
+
overflow: "visible",
|
|
84
|
+
color: themeVars.textColor,
|
|
85
|
+
}),
|
|
86
|
+
multiValue: (provided) => ({
|
|
87
|
+
...provided,
|
|
88
|
+
color: themeVars.textColor,
|
|
89
|
+
backgroundColor: "auto",
|
|
90
|
+
marginTop: 0,
|
|
91
|
+
marginBottom: 0,
|
|
92
|
+
marginLeft: 0,
|
|
93
|
+
marginRight: space.l,
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
height: layout.inputHeight - 2,
|
|
96
|
+
}),
|
|
97
|
+
control: createControlStyle({isSingleLine: false}),
|
|
98
|
+
group: (provided) => ({
|
|
99
|
+
...provided,
|
|
100
|
+
padding: 0,
|
|
101
|
+
margin: 0,
|
|
102
|
+
}),
|
|
103
|
+
multiValueLabel: () => ({}),
|
|
104
|
+
groupHeading: (provided) => ({
|
|
105
|
+
...provided,
|
|
106
|
+
paddingLeft: space.l,
|
|
107
|
+
paddingTop: space.l,
|
|
108
|
+
margin: 0,
|
|
109
|
+
...textStyles.small,
|
|
110
|
+
color: themeVars.disabledTextColor,
|
|
111
|
+
}),
|
|
112
|
+
menuPortal: (provided) => ({
|
|
113
|
+
...provided,
|
|
114
|
+
zIndex: 1050,
|
|
115
|
+
}),
|
|
116
|
+
menu: (provided) => ({
|
|
117
|
+
...provided,
|
|
118
|
+
zIndex: 1050,
|
|
119
|
+
backgroundColor: themeVars.actionMenuInnerBg,
|
|
120
|
+
boxShadow: themeVars.actionMenuShadow,
|
|
121
|
+
borderRadius: border.radius6,
|
|
122
|
+
}),
|
|
123
|
+
container: (provided, state) => ({
|
|
124
|
+
...provided,
|
|
125
|
+
pointerEvents: "auto",
|
|
126
|
+
cursor: state.isDisabled ? "not-allowed" : "default",
|
|
127
|
+
}),
|
|
128
|
+
indicatorSeparator: () => ({}),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const singleLineComponentsStyle = {
|
|
132
|
+
control: createControlStyle({isSingleLine: true}),
|
|
133
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {createContext, useContext, ReactNode} from "react";
|
|
2
|
+
import {ThemeColors, getThemeColors, colors} from "./designSystem";
|
|
3
|
+
|
|
4
|
+
const FiberyThemeContext = createContext<ThemeColors>(getThemeColors(colors.brandColors.blue));
|
|
5
|
+
|
|
6
|
+
function FiberyThemeProvider({theme, children}: {theme: ThemeColors; children: ReactNode}): JSX.Element {
|
|
7
|
+
return <FiberyThemeContext.Provider value={theme}>{children}</FiberyThemeContext.Provider>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function useTheme(): ThemeColors {
|
|
11
|
+
return useContext(FiberyThemeContext);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {FiberyThemeProvider as ThemeProvider};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function createInlineTheme<T extends Record<string, unknown>>(themes: T): Record<string, string> {
|
|
2
|
+
return Object.entries(themes).reduce<Record<string, string>>((inlineTheme, [key, value]) => {
|
|
3
|
+
if (key === "opacity") {
|
|
4
|
+
Object.entries(themes.opacity as Record<string, string>).forEach(([opacityKey, opacityValue]) => {
|
|
5
|
+
inlineTheme[`--fibery-opacity-${opacityKey}`] = opacityValue;
|
|
6
|
+
}, "");
|
|
7
|
+
|
|
8
|
+
return inlineTheme;
|
|
9
|
+
}
|
|
10
|
+
if (key === "stateColors") {
|
|
11
|
+
Object.entries(themes.stateColors as Record<string, string>).forEach(([stateColorKey, stateColorValue]) => {
|
|
12
|
+
inlineTheme[`--fibery-state-colors-${stateColorKey}`] = stateColorValue;
|
|
13
|
+
}, "");
|
|
14
|
+
|
|
15
|
+
return inlineTheme;
|
|
16
|
+
}
|
|
17
|
+
if (key === "brandColors") {
|
|
18
|
+
Object.entries(themes.brandColors as Record<string, string>).forEach(([brandColorKey, brandColorValue]) => {
|
|
19
|
+
inlineTheme[`--fibery-brand-colors-${brandColorKey}`] = brandColorValue;
|
|
20
|
+
}, "");
|
|
21
|
+
|
|
22
|
+
return inlineTheme;
|
|
23
|
+
}
|
|
24
|
+
if (key === "shades") {
|
|
25
|
+
Object.entries(themes.shades as Record<string, string>).forEach(([shadeKey, shadeValue]) => {
|
|
26
|
+
inlineTheme[`--fibery-shades-${shadeKey}`] = shadeValue;
|
|
27
|
+
}, "");
|
|
28
|
+
|
|
29
|
+
return inlineTheme;
|
|
30
|
+
}
|
|
31
|
+
if (key === "lights") {
|
|
32
|
+
Object.entries(themes.lights as Record<string, string>).forEach(([lightKey, lightValue]) => {
|
|
33
|
+
inlineTheme[`--fibery-lights-${lightKey}`] = lightValue;
|
|
34
|
+
}, "");
|
|
35
|
+
|
|
36
|
+
return inlineTheme;
|
|
37
|
+
}
|
|
38
|
+
if (key === "separators") {
|
|
39
|
+
Object.entries(themes.separators as Record<string, string>).forEach(([separatorKey, separatorValue]) => {
|
|
40
|
+
inlineTheme[`--fibery-separator-${separatorKey}`] = separatorValue;
|
|
41
|
+
}, "");
|
|
42
|
+
|
|
43
|
+
return inlineTheme;
|
|
44
|
+
}
|
|
45
|
+
if (key === "inversedSeparators") {
|
|
46
|
+
Object.entries(themes.inversedSeparators as Record<string, string>).forEach(([separatorKey, separatorValue]) => {
|
|
47
|
+
inlineTheme[`--fibery-inversed-separators-${separatorKey}`] = separatorValue;
|
|
48
|
+
}, "");
|
|
49
|
+
|
|
50
|
+
return inlineTheme;
|
|
51
|
+
}
|
|
52
|
+
inlineTheme[`--fibery-color-${key}`] = value as string;
|
|
53
|
+
return inlineTheme;
|
|
54
|
+
}, {});
|
|
55
|
+
}
|