@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/index.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fibery/ui-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.ts",
|
|
5
|
+
"private": false,
|
|
6
|
+
"files": [
|
|
7
|
+
"src/Button.d.ts",
|
|
8
|
+
"src/Button.js",
|
|
9
|
+
"src/designSystem.ts",
|
|
10
|
+
"src/create-inline-theme.ts",
|
|
11
|
+
"src/FormFieldLoader.js",
|
|
12
|
+
"src/ThemeProvider.tsx",
|
|
13
|
+
"src/Item.tsx",
|
|
14
|
+
"src/Loaders.d.ts",
|
|
15
|
+
"src/Loaders.js",
|
|
16
|
+
"src/loading-sausage.tsx",
|
|
17
|
+
"src/icons/**/*.ts*",
|
|
18
|
+
"src/Select"
|
|
19
|
+
],
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "TZ=Europe/Minsk jest",
|
|
23
|
+
"test:ci": "yarn test --coverage --reporters=default --reporters=jest-junit",
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"generate-icons": "node scripts/generate-icons.mjs"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@fibery/helpers": "1.0.0",
|
|
29
|
+
"@fibery/react": "1.0.0",
|
|
30
|
+
"@linaria/core": "3.0.0-beta.15",
|
|
31
|
+
"@linaria/react": "3.0.0-beta.15",
|
|
32
|
+
"@popperjs/core": "2.9.3",
|
|
33
|
+
"@radix-ui/react-dropdown-menu": "0.1.1",
|
|
34
|
+
"antd": "4.18.8",
|
|
35
|
+
"chroma-js": "2.1.2",
|
|
36
|
+
"classnames": "2.3.1",
|
|
37
|
+
"color-hash": "1.0.3",
|
|
38
|
+
"d3-shape": "1.3.7",
|
|
39
|
+
"emoji-mart": "3.0.1",
|
|
40
|
+
"lodash": "4.17.21",
|
|
41
|
+
"md5": "2.2.1",
|
|
42
|
+
"moment": "2.20.1",
|
|
43
|
+
"prop-types": "15.7.2",
|
|
44
|
+
"rc-menu": "9.3.2",
|
|
45
|
+
"rc-progress": "3.2.4",
|
|
46
|
+
"react-color": "2.13.8",
|
|
47
|
+
"react-day-picker": "7.4.8",
|
|
48
|
+
"react-popper": "2.2.5",
|
|
49
|
+
"react-select": "3.0.8",
|
|
50
|
+
"react-select-country-list": "2.2.1",
|
|
51
|
+
"react-windowed-select": "2.0.5",
|
|
52
|
+
"screenfull": "6.0.1"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^16.14.0",
|
|
56
|
+
"react-dom": "^16.14.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@fibery/babel-preset": "7.2.0",
|
|
60
|
+
"@fibery/eslint-config": "7.1.0",
|
|
61
|
+
"@fibery/text-editor": "1.0.0",
|
|
62
|
+
"@linaria/babel-preset": "3.0.0-beta.15",
|
|
63
|
+
"@types/chroma-js": "2.1.3",
|
|
64
|
+
"@types/color-hash": "1.0.2",
|
|
65
|
+
"@types/emoji-mart": "3.0.8",
|
|
66
|
+
"enzyme": "3.11.0",
|
|
67
|
+
"enzyme-adapter-react-16": "1.15.6",
|
|
68
|
+
"fs-extra": "10.0.0",
|
|
69
|
+
"glob": "7.1.7",
|
|
70
|
+
"jest": "27.5.1",
|
|
71
|
+
"jest-junit": "13.0.0",
|
|
72
|
+
"svg-parser": "2.0.4",
|
|
73
|
+
"svgo": "2.8.0",
|
|
74
|
+
"unist-util-reduce": "0.2.2"
|
|
75
|
+
},
|
|
76
|
+
"jest": {
|
|
77
|
+
"testEnvironment": "jsdom",
|
|
78
|
+
"coveragePathIgnorePatterns": [
|
|
79
|
+
"/node_modules/"
|
|
80
|
+
],
|
|
81
|
+
"collectCoverageFrom": [
|
|
82
|
+
"src/**/*.{js,jsx,ts,tsx}",
|
|
83
|
+
"!src/**/*.d.ts"
|
|
84
|
+
],
|
|
85
|
+
"coverageReporters": [
|
|
86
|
+
"text",
|
|
87
|
+
"cobertura"
|
|
88
|
+
],
|
|
89
|
+
"moduleNameMapper": {
|
|
90
|
+
"\\.(css)$": "<rootDir>/src/__mocks__/styleMock.js",
|
|
91
|
+
"createInlineTheme\\.js$": "<rootDir>/src/__mocks__/createInlineTheme.js"
|
|
92
|
+
},
|
|
93
|
+
"transform": {
|
|
94
|
+
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest"
|
|
95
|
+
},
|
|
96
|
+
"setupFilesAfterEnv": [
|
|
97
|
+
"<rootDir>/config/jest/testFrameworkSetup.js"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
package/src/Button.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type {ComponentPropsWithRef, FunctionComponent} from "react";
|
|
2
|
+
import {IconBaseProps} from "./icons/types";
|
|
3
|
+
type Size = ":button-size/super-small" | ":button-size/small" | ":button-size/normal" | ":button-size/big";
|
|
4
|
+
type Props = {
|
|
5
|
+
size?: Size;
|
|
6
|
+
borderless?: boolean;
|
|
7
|
+
Icon?: ((props: IconBaseProps) => JSX.Element) | null;
|
|
8
|
+
color?: string;
|
|
9
|
+
primary?: boolean;
|
|
10
|
+
pending?: boolean;
|
|
11
|
+
width?: string | number;
|
|
12
|
+
height?: string | number;
|
|
13
|
+
} & Omit<ComponentPropsWithRef<"button">, "size" | "width" | "height">;
|
|
14
|
+
|
|
15
|
+
export const Button: FunctionComponent<Props>;
|
|
16
|
+
export const buttonClassName: string;
|
|
17
|
+
|
|
18
|
+
export const ActionsButton: FunctionComponent<{
|
|
19
|
+
inverted?: boolean;
|
|
20
|
+
label?: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
onClick?: Props["onClick"];
|
|
23
|
+
}>;
|
|
24
|
+
export const ActionsButtonCompact: FunctionComponent<{inverted?: boolean; onClick?: Props["onClick"]}>;
|
package/src/Button.js
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import {hasNonEmptyChild} from "@fibery/react/src/has-non-empty-child";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
import {styled} from "@linaria/react";
|
|
4
|
+
import cx from "classnames";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
import PropTypes from "prop-types";
|
|
7
|
+
import {forwardRef} from "react";
|
|
8
|
+
import {border, colors, fontWeight, getDarkenColor, getOpacities, opacity, textStyles, themeVars} from "./designSystem";
|
|
9
|
+
import MoreIcon from "./icons/react/More";
|
|
10
|
+
import MoreCompactIcon from "./icons/react/MoreCompact";
|
|
11
|
+
import {Item} from "./Item";
|
|
12
|
+
import {Spinner} from "./Loaders";
|
|
13
|
+
import {useTheme} from "./ThemeProvider";
|
|
14
|
+
|
|
15
|
+
const baseSize = 14;
|
|
16
|
+
|
|
17
|
+
const fontSizes = {
|
|
18
|
+
":button-size/super-small": baseSize - 4,
|
|
19
|
+
":button-size/small": baseSize - 2,
|
|
20
|
+
":button-size/normal": baseSize,
|
|
21
|
+
":button-size/big": baseSize + 2,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const sizeShifts = {
|
|
25
|
+
":button-size/super-small": -2,
|
|
26
|
+
":button-size/small": -1,
|
|
27
|
+
":button-size/normal": 0,
|
|
28
|
+
":button-size/big": 1,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const buttonBorderWidth = 1;
|
|
32
|
+
|
|
33
|
+
const staticButtonStyle = css`
|
|
34
|
+
${{
|
|
35
|
+
boxSizing: "border-box",
|
|
36
|
+
display: "flex",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
verticalAlign: "middle",
|
|
40
|
+
fontWeight: fontWeight.bold,
|
|
41
|
+
lineHeight: 1,
|
|
42
|
+
margin: 0,
|
|
43
|
+
borderRadius: border.radius6,
|
|
44
|
+
borderWidth: buttonBorderWidth,
|
|
45
|
+
borderStyle: "solid",
|
|
46
|
+
outline: "none",
|
|
47
|
+
position: "relative",
|
|
48
|
+
}}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const ordersInGroup = {
|
|
52
|
+
first: css`
|
|
53
|
+
&.${staticButtonStyle} {
|
|
54
|
+
${{
|
|
55
|
+
display: "inline-flex",
|
|
56
|
+
borderRadius: `${border.radius6}px 0 0 ${border.radius6}px`,
|
|
57
|
+
marginRight: -1,
|
|
58
|
+
}}
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
middle: css`
|
|
62
|
+
&.${staticButtonStyle} {
|
|
63
|
+
${{
|
|
64
|
+
display: "inline-flex",
|
|
65
|
+
borderRadius: border.radius0,
|
|
66
|
+
marginRight: -1,
|
|
67
|
+
}}
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
last: css`
|
|
71
|
+
&.${staticButtonStyle} {
|
|
72
|
+
${{
|
|
73
|
+
display: "inline-flex",
|
|
74
|
+
borderRadius: `0 ${border.radius6}px ${border.radius6}px 0`,
|
|
75
|
+
}}
|
|
76
|
+
}
|
|
77
|
+
`,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const getMainColor = ({color, dangerous, theme}) => {
|
|
81
|
+
if (color) {
|
|
82
|
+
return color;
|
|
83
|
+
}
|
|
84
|
+
if (dangerous) {
|
|
85
|
+
return colors.danger;
|
|
86
|
+
}
|
|
87
|
+
if (!theme) {
|
|
88
|
+
return colors.primary;
|
|
89
|
+
}
|
|
90
|
+
if (theme.mode === "old") {
|
|
91
|
+
return theme.primary;
|
|
92
|
+
}
|
|
93
|
+
return theme.iconColor;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const getBorderColor = ({mainColor, borderless, primary}) => {
|
|
97
|
+
if (borderless) {
|
|
98
|
+
return colors.transparent;
|
|
99
|
+
}
|
|
100
|
+
if (primary) {
|
|
101
|
+
return mainColor;
|
|
102
|
+
}
|
|
103
|
+
return getOpacities(mainColor).notSoThin;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const getHoverBorderColor = ({mainColor, borderless, primary, hoverBgColor}) => {
|
|
107
|
+
if (borderless) {
|
|
108
|
+
return colors.transparent;
|
|
109
|
+
}
|
|
110
|
+
if (primary) {
|
|
111
|
+
return hoverBgColor;
|
|
112
|
+
}
|
|
113
|
+
return mainColor;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const getTextColor = ({mainColor, primary}) => {
|
|
117
|
+
if (primary) {
|
|
118
|
+
return colors.inversedTextColor;
|
|
119
|
+
}
|
|
120
|
+
return mainColor;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const getBgColor = ({mainColor, primary}) => {
|
|
124
|
+
if (primary) {
|
|
125
|
+
return mainColor;
|
|
126
|
+
}
|
|
127
|
+
return colors.transparent;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const getHoverBgColor = ({mainColor, borderless, primary}) => {
|
|
131
|
+
if (primary) {
|
|
132
|
+
return getDarkenColor(mainColor);
|
|
133
|
+
}
|
|
134
|
+
if (borderless) {
|
|
135
|
+
return getOpacities(mainColor).opacity15;
|
|
136
|
+
}
|
|
137
|
+
return colors.transparent;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const getSpinnerColor = ({mainColor, primary}) => {
|
|
141
|
+
if (primary) {
|
|
142
|
+
return themeVars.inversedTextColor;
|
|
143
|
+
}
|
|
144
|
+
return mainColor;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const getButtonMagicConstants = _.memoize((size) => {
|
|
148
|
+
const sizeShift = sizeShifts[size];
|
|
149
|
+
|
|
150
|
+
const fontSize = fontSizes[size];
|
|
151
|
+
const minSize = fontSize * 2;
|
|
152
|
+
const horizontalPadding = baseSize - 2 + sizeShift * 4;
|
|
153
|
+
|
|
154
|
+
return {fontSize, minSize, horizontalPadding};
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const getIconMagicConstants = _.memoize((size) => {
|
|
158
|
+
const sizeShift = sizeShifts[size];
|
|
159
|
+
|
|
160
|
+
const iconSize = baseSize + 2 + sizeShift * 2;
|
|
161
|
+
const leftContainerSize = 8;
|
|
162
|
+
const leftContainerMarginRight = iconSize - leftContainerSize;
|
|
163
|
+
|
|
164
|
+
return {iconSize, leftContainerSize, leftContainerMarginRight};
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const StyledButton = styled.button`
|
|
168
|
+
font-size: ${({buttonSize}) => getButtonMagicConstants(buttonSize).fontSize}px;
|
|
169
|
+
min-height: ${({buttonSize}) => getButtonMagicConstants(buttonSize).minSize}px;
|
|
170
|
+
min-width: ${({buttonSize}) => getButtonMagicConstants(buttonSize).minSize}px;
|
|
171
|
+
padding-top: 0;
|
|
172
|
+
padding-bottom: 0;
|
|
173
|
+
padding-left: ${({buttonSize}) => getButtonMagicConstants(buttonSize).horizontalPadding}px;
|
|
174
|
+
padding-right: ${({buttonSize}) => getButtonMagicConstants(buttonSize).horizontalPadding}px;
|
|
175
|
+
opacity: ${({disabled}) => (disabled ? opacity.regular : 1)};
|
|
176
|
+
width: ${({buttonWidth = "auto"}) => (typeof buttonWidth === "string" ? buttonWidth : `${buttonWidth}px`)};
|
|
177
|
+
height: ${({buttonHeight = "auto"}) => (typeof buttonHeight === "string" ? buttonHeight : `${buttonHeight}px`)};
|
|
178
|
+
color: ${({textColor}) => textColor};
|
|
179
|
+
background-color: ${({bgColor}) => bgColor};
|
|
180
|
+
border-color: ${({borderColor}) => borderColor};
|
|
181
|
+
cursor: ${({clickable}) => (clickable ? "pointer" : "default")};
|
|
182
|
+
transition: all 150ms ease-out;
|
|
183
|
+
|
|
184
|
+
&:focus {
|
|
185
|
+
box-shadow: ${({borderColor, activeStyle}) =>
|
|
186
|
+
activeStyle ? `0 0 0 3px ${getOpacities(borderColor).light}` : "none"};
|
|
187
|
+
background-color: ${({hoverBgColor}) => hoverBgColor};
|
|
188
|
+
border-color: ${({hoverBorderColor}) => hoverBorderColor};
|
|
189
|
+
transition: all 150ms ease-out;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&:focus:not(:focus-visible) {
|
|
193
|
+
box-shadow: none;
|
|
194
|
+
background-color: ${({bgColor}) => bgColor};
|
|
195
|
+
border-color: ${({borderColor}) => borderColor};
|
|
196
|
+
transition: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:focus-visible {
|
|
200
|
+
box-shadow: ${({borderColor, activeStyle}) =>
|
|
201
|
+
activeStyle ? `0 0 0 3px ${getOpacities(borderColor).light}` : "none"};
|
|
202
|
+
background-color: ${({hoverBgColor}) => hoverBgColor};
|
|
203
|
+
border-color: ${({hoverBorderColor}) => hoverBorderColor};
|
|
204
|
+
transition: all 150ms ease-out;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&:hover,
|
|
208
|
+
&:focus:hover:not(:focus-visible) {
|
|
209
|
+
background-color: ${({hoverBgColor}) => hoverBgColor};
|
|
210
|
+
border-color: ${({hoverBorderColor}) => hoverBorderColor};
|
|
211
|
+
transition: all 150ms ease-out;
|
|
212
|
+
}
|
|
213
|
+
`;
|
|
214
|
+
|
|
215
|
+
export const buttonClassName = StyledButton;
|
|
216
|
+
|
|
217
|
+
const shortcutStyle = css`
|
|
218
|
+
${{
|
|
219
|
+
...textStyles.small,
|
|
220
|
+
color: themeVars.whiteColor,
|
|
221
|
+
border: "solid 1px",
|
|
222
|
+
borderRadius: border.radius4,
|
|
223
|
+
paddingLeft: 4,
|
|
224
|
+
paddingRight: 4,
|
|
225
|
+
marginLeft: 4,
|
|
226
|
+
opacity: 0.7,
|
|
227
|
+
}}
|
|
228
|
+
`;
|
|
229
|
+
|
|
230
|
+
const leftContainerMarginRightVar = "--fibery-button-left-container-margin-right";
|
|
231
|
+
|
|
232
|
+
const leftContainerClassName = css`
|
|
233
|
+
margin-right: var(${leftContainerMarginRightVar});
|
|
234
|
+
`;
|
|
235
|
+
|
|
236
|
+
export const Button = forwardRef(
|
|
237
|
+
(
|
|
238
|
+
{
|
|
239
|
+
children,
|
|
240
|
+
color,
|
|
241
|
+
dangerous,
|
|
242
|
+
borderless,
|
|
243
|
+
primary,
|
|
244
|
+
pending,
|
|
245
|
+
icon,
|
|
246
|
+
Icon,
|
|
247
|
+
size = ":button-size/normal",
|
|
248
|
+
type = "button",
|
|
249
|
+
disabled,
|
|
250
|
+
width,
|
|
251
|
+
height,
|
|
252
|
+
inGroup,
|
|
253
|
+
onClick,
|
|
254
|
+
className,
|
|
255
|
+
shortcut,
|
|
256
|
+
...rest
|
|
257
|
+
},
|
|
258
|
+
forwardedRef
|
|
259
|
+
) => {
|
|
260
|
+
const theme = useTheme();
|
|
261
|
+
const mainColor = getMainColor({color, dangerous, theme});
|
|
262
|
+
const textColor = getTextColor({mainColor, primary});
|
|
263
|
+
const spinnerBgColor = getOpacities(textColor).light;
|
|
264
|
+
const spinnerColor = getSpinnerColor({mainColor, primary});
|
|
265
|
+
const bgColor = getBgColor({mainColor, primary});
|
|
266
|
+
const hoverBgColor = getHoverBgColor({mainColor, borderless, primary});
|
|
267
|
+
const borderColor = getBorderColor({mainColor, borderless, primary});
|
|
268
|
+
const hoverBorderColor = getHoverBorderColor({
|
|
269
|
+
mainColor,
|
|
270
|
+
borderless,
|
|
271
|
+
primary,
|
|
272
|
+
hoverBgColor,
|
|
273
|
+
});
|
|
274
|
+
if (icon) {
|
|
275
|
+
// eslint-disable-next-line no-console
|
|
276
|
+
console.warn("'icon' props doesn't support anymore. Please use 'Icon' prop with explicit Icon Component");
|
|
277
|
+
}
|
|
278
|
+
const {iconSize, leftContainerSize, leftContainerMarginRight} = getIconMagicConstants(size);
|
|
279
|
+
|
|
280
|
+
const leftContainer = pending ? (
|
|
281
|
+
<Spinner
|
|
282
|
+
backgroundColor={spinnerBgColor}
|
|
283
|
+
color={spinnerColor}
|
|
284
|
+
size={iconSize}
|
|
285
|
+
containerSize={leftContainerSize}
|
|
286
|
+
/>
|
|
287
|
+
) : Icon ? (
|
|
288
|
+
<Icon color={textColor} size={iconSize} containerSize={leftContainerSize} />
|
|
289
|
+
) : null;
|
|
290
|
+
const styleVariable = {
|
|
291
|
+
buttonSize: size,
|
|
292
|
+
disabled,
|
|
293
|
+
pending,
|
|
294
|
+
buttonWidth: width,
|
|
295
|
+
buttonHeight: height,
|
|
296
|
+
textColor,
|
|
297
|
+
clickable: !disabled && !pending,
|
|
298
|
+
hoverBgColor: !disabled && !pending ? hoverBgColor : bgColor,
|
|
299
|
+
hoverBorderColor: !disabled && !pending ? hoverBorderColor : borderColor,
|
|
300
|
+
borderColor,
|
|
301
|
+
bgColor,
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
return (
|
|
305
|
+
<StyledButton
|
|
306
|
+
{...styleVariable}
|
|
307
|
+
ref={forwardedRef}
|
|
308
|
+
type={type}
|
|
309
|
+
onClick={!disabled && !pending && onClick ? onClick : _.noop}
|
|
310
|
+
disabled={disabled}
|
|
311
|
+
className={cx(className, staticButtonStyle, ordersInGroup[inGroup])}
|
|
312
|
+
{...rest}
|
|
313
|
+
>
|
|
314
|
+
<Item
|
|
315
|
+
leftContainer={leftContainer}
|
|
316
|
+
style={{
|
|
317
|
+
[leftContainerMarginRightVar]: `${leftContainerMarginRight}px`,
|
|
318
|
+
}}
|
|
319
|
+
containerClassName={cx({[leftContainerClassName]: leftContainer && hasNonEmptyChild(children)})}
|
|
320
|
+
rightContainer={shortcut && <span className={cx(shortcutStyle)}>{shortcut}</span>}
|
|
321
|
+
noOverflow
|
|
322
|
+
>
|
|
323
|
+
{children}
|
|
324
|
+
</Item>
|
|
325
|
+
</StyledButton>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
Button.propTypes = {
|
|
331
|
+
size: PropTypes.oneOf(Object.keys(fontSizes)),
|
|
332
|
+
type: PropTypes.string,
|
|
333
|
+
primary: PropTypes.bool,
|
|
334
|
+
dangerous: PropTypes.bool,
|
|
335
|
+
disabled: PropTypes.bool,
|
|
336
|
+
pending: PropTypes.bool,
|
|
337
|
+
borderless: PropTypes.bool,
|
|
338
|
+
icon: PropTypes.string,
|
|
339
|
+
color: PropTypes.string,
|
|
340
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
341
|
+
onClick: PropTypes.func,
|
|
342
|
+
inGroup: PropTypes.oneOf(Object.keys(ordersInGroup)),
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
// TODO can be inlined
|
|
346
|
+
export function ActionsButton({onClick, label = ``, disabled}) {
|
|
347
|
+
return <Button Icon={MoreIcon} onClick={onClick} borderless aria-label={label} disabled={disabled} />;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function ActionsButtonCompact({inverted, onClick}) {
|
|
351
|
+
const theme = useTheme();
|
|
352
|
+
return (
|
|
353
|
+
<Button
|
|
354
|
+
size={":button-size/small"}
|
|
355
|
+
Icon={MoreCompactIcon}
|
|
356
|
+
onClick={onClick}
|
|
357
|
+
color={inverted ? colors.inversedTextColor : theme.primary}
|
|
358
|
+
borderless
|
|
359
|
+
/>
|
|
360
|
+
);
|
|
361
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {PureComponent} from "react";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
import * as PropTypes from "prop-types";
|
|
4
|
+
import cn from "classnames";
|
|
5
|
+
import {space, border, themeVars} from "./designSystem";
|
|
6
|
+
|
|
7
|
+
const loaderStyle = css`
|
|
8
|
+
border-radius: ${border.radius6}px;
|
|
9
|
+
padding-top: ${space.m}px;
|
|
10
|
+
padding-bottom: ${space.m}px;
|
|
11
|
+
padding-left: ${space.l}px;
|
|
12
|
+
padding-right: 0;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
border: none;
|
|
15
|
+
color: ${themeVars.accentTextColor};
|
|
16
|
+
box-shadow: ${themeVars.inputBorderColor};
|
|
17
|
+
background-color: ${themeVars.inputBgColor};
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export class FormFieldLoader extends PureComponent {
|
|
21
|
+
render() {
|
|
22
|
+
const {additionClassname, children} = this.props;
|
|
23
|
+
return <div className={cn(loaderStyle, additionClassname)}>{children}</div>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
FormFieldLoader.propTypes = {
|
|
28
|
+
additionClassname: PropTypes.string,
|
|
29
|
+
children: PropTypes.node,
|
|
30
|
+
};
|
package/src/Item.tsx
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import {forwardRef, ReactNode, MouseEvent, CSSProperties} from "react";
|
|
4
|
+
import {themeVars} from "./designSystem";
|
|
5
|
+
|
|
6
|
+
const getGridStyle = ({
|
|
7
|
+
multiline,
|
|
8
|
+
leftContainer,
|
|
9
|
+
children,
|
|
10
|
+
rightContainer,
|
|
11
|
+
onItemClick,
|
|
12
|
+
inline,
|
|
13
|
+
}: {
|
|
14
|
+
multiline?: boolean;
|
|
15
|
+
leftContainer?: ReactNode;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
rightContainer?: ReactNode;
|
|
18
|
+
onItemClick?: (event: MouseEvent<HTMLDivElement>) => unknown;
|
|
19
|
+
inline?: boolean;
|
|
20
|
+
}) => ({
|
|
21
|
+
display: inline ? "inline-grid" : "grid",
|
|
22
|
+
gridTemplateColumns: [leftContainer ? "auto" : null, children ? "1fr" : null, rightContainer ? "auto" : null]
|
|
23
|
+
.filter((container) => container !== null)
|
|
24
|
+
.join(" "),
|
|
25
|
+
alignItems: multiline ? "start" : "center",
|
|
26
|
+
...(onItemClick ? {cursor: "pointer"} : null),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const hoverClass = css`
|
|
30
|
+
&:hover {
|
|
31
|
+
background-color: ${themeVars.opacity.thin};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const singleLineTextStyleNoOverflow: CSSProperties = {
|
|
36
|
+
whiteSpace: "nowrap",
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const singleLineTextStyle: CSSProperties = {
|
|
40
|
+
...singleLineTextStyleNoOverflow,
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
textOverflow: "ellipsis",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type Props = {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
leftContainer?: ReactNode;
|
|
49
|
+
rightContainer?: ReactNode;
|
|
50
|
+
textClassName?: string;
|
|
51
|
+
itemClassName?: string;
|
|
52
|
+
containerClassName?: string;
|
|
53
|
+
multiline?: boolean;
|
|
54
|
+
inline?: boolean;
|
|
55
|
+
noOverflow?: boolean;
|
|
56
|
+
hoverable?: boolean;
|
|
57
|
+
title?: string;
|
|
58
|
+
dataId?: string;
|
|
59
|
+
onItemClick?: (event: MouseEvent<HTMLDivElement>) => unknown;
|
|
60
|
+
onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => unknown;
|
|
61
|
+
onMouseLeave?: (event: MouseEvent<HTMLDivElement>) => unknown;
|
|
62
|
+
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => unknown;
|
|
63
|
+
style?: CSSProperties;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated The component should not be used. Just use css for desired layout `display: flex` or `display: grid; grid-auto-flow:column`
|
|
68
|
+
*/
|
|
69
|
+
export const Item = forwardRef<HTMLDivElement, Props>(function Item(
|
|
70
|
+
{
|
|
71
|
+
className,
|
|
72
|
+
leftContainer,
|
|
73
|
+
rightContainer,
|
|
74
|
+
children,
|
|
75
|
+
multiline,
|
|
76
|
+
textClassName,
|
|
77
|
+
itemClassName,
|
|
78
|
+
containerClassName,
|
|
79
|
+
onMouseEnter,
|
|
80
|
+
onMouseLeave,
|
|
81
|
+
onMouseDown,
|
|
82
|
+
onItemClick,
|
|
83
|
+
inline,
|
|
84
|
+
noOverflow,
|
|
85
|
+
hoverable,
|
|
86
|
+
title,
|
|
87
|
+
dataId,
|
|
88
|
+
style = {},
|
|
89
|
+
},
|
|
90
|
+
ref
|
|
91
|
+
) {
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
data-testid={dataId}
|
|
95
|
+
data-id={dataId}
|
|
96
|
+
ref={ref}
|
|
97
|
+
onMouseDown={onMouseDown}
|
|
98
|
+
onMouseEnter={onMouseEnter}
|
|
99
|
+
onMouseLeave={onMouseLeave}
|
|
100
|
+
onClick={onItemClick}
|
|
101
|
+
className={cx(className, {[hoverClass]: hoverable}, itemClassName)}
|
|
102
|
+
style={{
|
|
103
|
+
...style,
|
|
104
|
+
...getGridStyle({
|
|
105
|
+
multiline,
|
|
106
|
+
leftContainer,
|
|
107
|
+
children,
|
|
108
|
+
rightContainer,
|
|
109
|
+
onItemClick,
|
|
110
|
+
inline,
|
|
111
|
+
}),
|
|
112
|
+
}}
|
|
113
|
+
title={title}
|
|
114
|
+
>
|
|
115
|
+
{leftContainer && <div className={cx(containerClassName)}>{leftContainer}</div>}
|
|
116
|
+
{children ? (
|
|
117
|
+
<div
|
|
118
|
+
className={cx(textClassName)}
|
|
119
|
+
style={multiline ? {} : noOverflow ? singleLineTextStyleNoOverflow : singleLineTextStyle}
|
|
120
|
+
>
|
|
121
|
+
{children}
|
|
122
|
+
</div>
|
|
123
|
+
) : null}
|
|
124
|
+
{rightContainer && <div className={cx(containerClassName)}>{rightContainer}</div>}
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
});
|
package/src/Loaders.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const LoadingPage: () => JSX.Element;
|
|
2
|
+
export const LoadingTreeMenuItem: (props: {
|
|
3
|
+
color?: string;
|
|
4
|
+
Icon: () => JSX.Element;
|
|
5
|
+
level: number;
|
|
6
|
+
children?: JSX.Element;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export const SidebarLoadingPage: () => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export const Spinner: (props: {
|
|
11
|
+
size?: number;
|
|
12
|
+
containerSize?: number;
|
|
13
|
+
width?: number;
|
|
14
|
+
color?: string;
|
|
15
|
+
backgroundColor?: string;
|
|
16
|
+
}) => JSX.Element;
|