widenarrow-ui 0.1.2
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/.babelrc +11 -0
- package/.eslintrc +105 -0
- package/.prettierrc +7 -0
- package/README.md +3 -0
- package/copyTS.js +15 -0
- package/dist/Box/Box.module.scss +80 -0
- package/dist/Box/Box.tsx +143 -0
- package/dist/index.tsx +3 -0
- package/package.json +69 -0
- package/src/components/Box/Box.module.scss +80 -0
- package/src/components/Box/Box.tsx +143 -0
- package/src/components/index.tsx +3 -0
- package/src/index.tsx +1 -0
- package/src/styles/colors.scss +160 -0
- package/src/styles/icons/Read Me.txt +7 -0
- package/src/styles/icons/demo-files/demo.css +152 -0
- package/src/styles/icons/demo-files/demo.js +29 -0
- package/src/styles/icons/demo.html +758 -0
- package/src/styles/icons/fonts/icomoon.eot +0 -0
- package/src/styles/icons/fonts/icomoon.svg +57 -0
- package/src/styles/icons/fonts/icomoon.ttf +0 -0
- package/src/styles/icons/fonts/icomoon.woff +0 -0
- package/src/styles/icons/selection.json +1606 -0
- package/src/styles/icons/style.css +173 -0
- package/src/styles/keyframes.scss +103 -0
- package/src/styles/libraryOverrides.scss +62 -0
- package/src/styles/main.scss +299 -0
- package/src/styles/mixins.scss +1300 -0
- package/src/styles/normalize.scss +459 -0
- package/src/styles/print.scss +70 -0
- package/src/styles/svg/accountSettings.svg +1 -0
- package/src/styles/svg/addChart.svg +1 -0
- package/src/styles/svg/addFolder.svg +1 -0
- package/src/styles/svg/addOutlined.svg +8 -0
- package/src/styles/svg/addPageBreak.svg +14 -0
- package/src/styles/svg/addPost.svg +1 -0
- package/src/styles/svg/addSectionAbove.svg +3 -0
- package/src/styles/svg/addSectionBelow.svg +3 -0
- package/src/styles/svg/addSolid.svg +6 -0
- package/src/styles/svg/ai.svg +1 -0
- package/src/styles/svg/arrowDown.svg +1 -0
- package/src/styles/svg/arrowFirstPage.svg +1 -0
- package/src/styles/svg/arrowForkRight.svg +1 -0
- package/src/styles/svg/arrowLastPage.svg +1 -0
- package/src/styles/svg/arrowLeft.svg +1 -0
- package/src/styles/svg/arrowRight.svg +1 -0
- package/src/styles/svg/arrowUp.svg +1 -0
- package/src/styles/svg/attachment.svg +1 -0
- package/src/styles/svg/banner.svg +1 -0
- package/src/styles/svg/benchmarks.svg +7 -0
- package/src/styles/svg/block.svg +5 -0
- package/src/styles/svg/cancelTrial.svg +1 -0
- package/src/styles/svg/cardMode.svg +7 -0
- package/src/styles/svg/changeOrder.svg +3 -0
- package/src/styles/svg/check.svg +3 -0
- package/src/styles/svg/checkCircleExtraSmall.svg +1 -0
- package/src/styles/svg/checkCircleLarge.svg +3 -0
- package/src/styles/svg/checkCircleSmall.svg +3 -0
- package/src/styles/svg/checkIndeterminateWhite.svg +5 -0
- package/src/styles/svg/checkWhite.svg +3 -0
- package/src/styles/svg/checkboxCircle.svg +3 -0
- package/src/styles/svg/checkboxCircleChecked.svg +6 -0
- package/src/styles/svg/chevron.svg +1 -0
- package/src/styles/svg/chevronLeft.svg +1 -0
- package/src/styles/svg/chevronRight.svg +1 -0
- package/src/styles/svg/chevronUp.svg +1 -0
- package/src/styles/svg/classification.svg +1 -0
- package/src/styles/svg/clipBoard.svg +1 -0
- package/src/styles/svg/cluster.svg +1 -0
- package/src/styles/svg/cogwheel.svg +1 -0
- package/src/styles/svg/comment.svg +5 -0
- package/src/styles/svg/commentAdd.svg +6 -0
- package/src/styles/svg/compare.svg +6 -0
- package/src/styles/svg/copy.svg +1 -0
- package/src/styles/svg/createNewsletter.svg +1 -0
- package/src/styles/svg/cross.svg +6 -0
- package/src/styles/svg/crossCircleExtraSmall.svg +1 -0
- package/src/styles/svg/crossCircleLarge.svg +3 -0
- package/src/styles/svg/crossCircleSmall.svg +3 -0
- package/src/styles/svg/crossCircleSmallFilled.svg +1 -0
- package/src/styles/svg/dashboard.svg +1 -0
- package/src/styles/svg/dateRange.svg +6 -0
- package/src/styles/svg/description.svg +3 -0
- package/src/styles/svg/desktop.svg +1 -0
- package/src/styles/svg/dot.svg +1 -0
- package/src/styles/svg/dotOutlined.svg +4 -0
- package/src/styles/svg/dots.svg +5 -0
- package/src/styles/svg/dotsBackground.svg +6 -0
- package/src/styles/svg/down.svg +5 -0
- package/src/styles/svg/download.svg +1 -0
- package/src/styles/svg/duplicate.svg +1 -0
- package/src/styles/svg/dynamic_feed.svg +5 -0
- package/src/styles/svg/edit.svg +5 -0
- package/src/styles/svg/embed.svg +1 -0
- package/src/styles/svg/errorOutlined.svg +1 -0
- package/src/styles/svg/ethernet.svg +1 -0
- package/src/styles/svg/exitToApp.svg +1 -0
- package/src/styles/svg/expand.svg +1 -0
- package/src/styles/svg/expandArrows.svg +5 -0
- package/src/styles/svg/feed.svg +1 -0
- package/src/styles/svg/filter.svg +5 -0
- package/src/styles/svg/filterSettings.svg +5 -0
- package/src/styles/svg/findReplace.svg +1 -0
- package/src/styles/svg/folder.svg +1 -0
- package/src/styles/svg/folderFilled.svg +1 -0
- package/src/styles/svg/formatFontSize.svg +1 -0
- package/src/styles/svg/formatImgBottom.svg +1 -0
- package/src/styles/svg/formatImgCenterCenter.svg +1 -0
- package/src/styles/svg/formatImgCrop.svg +1 -0
- package/src/styles/svg/formatImgHero.svg +1 -0
- package/src/styles/svg/formatImgLeft.svg +1 -0
- package/src/styles/svg/formatImgLeftBottom.svg +1 -0
- package/src/styles/svg/formatImgLeftCenter.svg +3 -0
- package/src/styles/svg/formatImgRight.svg +1 -0
- package/src/styles/svg/formatImgRightBottom.svg +1 -0
- package/src/styles/svg/formatImgRightCenter.svg +3 -0
- package/src/styles/svg/formatImgTop.svg +1 -0
- package/src/styles/svg/formatTextAlignCenter.svg +1 -0
- package/src/styles/svg/formatTextAlignLeft.svg +1 -0
- package/src/styles/svg/formatTextAlignRight.svg +1 -0
- package/src/styles/svg/formatTextBold.svg +1 -0
- package/src/styles/svg/formatTextItalic.svg +1 -0
- package/src/styles/svg/formatTextListBulleted.svg +1 -0
- package/src/styles/svg/formatTextListNumbered.svg +1 -0
- package/src/styles/svg/formatTextUnderlined.svg +1 -0
- package/src/styles/svg/gridMode.svg +1 -0
- package/src/styles/svg/handlebar.svg +6 -0
- package/src/styles/svg/help.svg +1 -0
- package/src/styles/svg/history.svg +1 -0
- package/src/styles/svg/icn_infomanagement@2x.svg +81 -0
- package/src/styles/svg/icn_informationtools@2x.svg +71 -0
- package/src/styles/svg/icn_reportlibrary@2x.svg +72 -0
- package/src/styles/svg/icn_teamsetup@2x.svg +87 -0
- package/src/styles/svg/inbox.svg +1 -0
- package/src/styles/svg/info.svg +1 -0
- package/src/styles/svg/keywords.svg +1 -0
- package/src/styles/svg/lightBulb.svg +1 -0
- package/src/styles/svg/like.svg +3 -0
- package/src/styles/svg/likeSolid.svg +7 -0
- package/src/styles/svg/link.svg +1 -0
- package/src/styles/svg/link_off.svg +1 -0
- package/src/styles/svg/list.svg +6 -0
- package/src/styles/svg/listMode.svg +5 -0
- package/src/styles/svg/lock.svg +1 -0
- package/src/styles/svg/mail.svg +1 -0
- package/src/styles/svg/masonry.svg +1 -0
- package/src/styles/svg/menu.svg +1 -0
- package/src/styles/svg/minimizeArrows.svg +5 -0
- package/src/styles/svg/minus.svg +1 -0
- package/src/styles/svg/monitoringLogo.svg +9 -0
- package/src/styles/svg/movie.svg +1 -0
- package/src/styles/svg/navigateDownLarge.svg +3 -0
- package/src/styles/svg/navigateLeftLarge.svg +3 -0
- package/src/styles/svg/navigateRightLarge.svg +4 -0
- package/src/styles/svg/news.svg +4 -0
- package/src/styles/svg/newsletterClosed.svg +3 -0
- package/src/styles/svg/newsletterOpened.svg +3 -0
- package/src/styles/svg/newsletterSender.svg +1 -0
- package/src/styles/svg/nochange.svg +5 -0
- package/src/styles/svg/nodirection.svg +4 -0
- package/src/styles/svg/notification.svg +1 -0
- package/src/styles/svg/openInNew.svg +1 -0
- package/src/styles/svg/palette.svg +4 -0
- package/src/styles/svg/pattern.svg +1 -0
- package/src/styles/svg/pause.svg +1 -0
- package/src/styles/svg/pauseCircle.svg +1 -0
- package/src/styles/svg/pdf.svg +1 -0
- package/src/styles/svg/pencil.svg +1 -0
- package/src/styles/svg/phone.svg +1 -0
- package/src/styles/svg/photo.svg +1 -0
- package/src/styles/svg/photos.svg +1 -0
- package/src/styles/svg/pin.svg +1 -0
- package/src/styles/svg/play.svg +6 -0
- package/src/styles/svg/playCircle.svg +1 -0
- package/src/styles/svg/plus.svg +3 -0
- package/src/styles/svg/portals.svg +1 -0
- package/src/styles/svg/ppt.svg +3 -0
- package/src/styles/svg/present.svg +3 -0
- package/src/styles/svg/previewEye.svg +1 -0
- package/src/styles/svg/previewEyeOff.svg +1 -0
- package/src/styles/svg/profile.svg +1 -0
- package/src/styles/svg/publish.svg +1 -0
- package/src/styles/svg/purchaseInbox.svg +1 -0
- package/src/styles/svg/questionmark.svg +1 -0
- package/src/styles/svg/recurring.svg +1 -0
- package/src/styles/svg/renew.svg +1 -0
- package/src/styles/svg/replay.svg +1 -0
- package/src/styles/svg/report.svg +1 -0
- package/src/styles/svg/reportLibrary.svg +6 -0
- package/src/styles/svg/reset.svg +4 -0
- package/src/styles/svg/robot.svg +1 -0
- package/src/styles/svg/rss.svg +1 -0
- package/src/styles/svg/schedule.svg +1 -0
- package/src/styles/svg/search.svg +1 -0
- package/src/styles/svg/searchPerson.svg +1 -0
- package/src/styles/svg/send.svg +1 -0
- package/src/styles/svg/sendList.svg +9 -0
- package/src/styles/svg/settingsFilled.svg +5 -0
- package/src/styles/svg/settingsOff.svg +7 -0
- package/src/styles/svg/settingsOutlined.svg +5 -0
- package/src/styles/svg/share.svg +1 -0
- package/src/styles/svg/sliderHandle.svg +8 -0
- package/src/styles/svg/sort.svg +5 -0
- package/src/styles/svg/sso.svg +1 -0
- package/src/styles/svg/ssoConfig.svg +1 -0
- package/src/styles/svg/statistics.svg +5 -0
- package/src/styles/svg/strategy.svg +1 -0
- package/src/styles/svg/subscriptions.svg +5 -0
- package/src/styles/svg/suggestion.svg +1 -0
- package/src/styles/svg/sysAdmin.svg +1 -0
- package/src/styles/svg/taxonomy.svg +1 -0
- package/src/styles/svg/translate.svg +5 -0
- package/src/styles/svg/trash.svg +6 -0
- package/src/styles/svg/trial.svg +1 -0
- package/src/styles/svg/undo.svg +1 -0
- package/src/styles/svg/unfoldLess.svg +1 -0
- package/src/styles/svg/unfoldMore.svg +1 -0
- package/src/styles/svg/up.svg +5 -0
- package/src/styles/svg/upload.svg +1 -0
- package/src/styles/svg/user.svg +5 -0
- package/src/styles/svg/userRemove.svg +1 -0
- package/src/styles/svg/users.svg +5 -0
- package/src/styles/svg/usersAdd.svg +1 -0
- package/src/styles/svg/verified.svg +1 -0
- package/src/styles/svg/warning.svg +1 -0
- package/src/styles/svg/warningOutlined.svg +1 -0
- package/src/styles/svg/wide-narrow-logo.svg +1 -0
- package/src/styles/svg/wide-narrow-w-logo.svg +1 -0
- package/src/styles/svg/willBeDeleted.svg +1 -0
- package/src/styles/svg/world.svg +1 -0
- package/src/styles/svg/zoomIn.svg +1 -0
- package/src/styles/svg/zoomOut.svg +1 -0
- package/src/styles/variables.scss +117 -0
- package/src/types/styling.ts +34 -0
- package/tsconfig.json +17 -0
- package/types/classnames/index.d.ts +1 -0
- package/types/declaration.d.ts +1 -0
- package/types/react-router-dom/index.d.ts +1 -0
package/.babelrc
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"presets": ["@babel/react"],
|
|
3
|
+
"ignore": ["**/__snapshots__", "**/*.d.ts", "**/*.test.*"],
|
|
4
|
+
"plugins": [
|
|
5
|
+
"@babel/plugin-transform-typescript",
|
|
6
|
+
"babel-plugin-typescript-to-proptypes",
|
|
7
|
+
"@babel/plugin-proposal-export-default-from",
|
|
8
|
+
"@babel/proposal-class-properties",
|
|
9
|
+
"@babel/proposal-object-rest-spread"
|
|
10
|
+
]
|
|
11
|
+
}
|
package/.eslintrc
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"react-app",
|
|
4
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
5
|
+
"plugin:@typescript-eslint/recommended"
|
|
6
|
+
],
|
|
7
|
+
"plugins": ["react", "import", "@typescript-eslint"],
|
|
8
|
+
"env": {
|
|
9
|
+
"jest": true,
|
|
10
|
+
"browser": true
|
|
11
|
+
},
|
|
12
|
+
"rules": {
|
|
13
|
+
"no-undef": ["warn", { "typeof": true }],
|
|
14
|
+
"function-paren-newline": 0,
|
|
15
|
+
"no-mixed-spaces-and-tabs": 0,
|
|
16
|
+
"no-confusing-arrow": 0,
|
|
17
|
+
"no-return-assign": ["error", "except-parens"],
|
|
18
|
+
"generator-star-spacing": 0,
|
|
19
|
+
"default-param-last": 0,
|
|
20
|
+
"prefer-regex-literals": 0,
|
|
21
|
+
"no-unused-expressions": [
|
|
22
|
+
"error",
|
|
23
|
+
{ "allowTernary": true, "allowShortCircuit": true }
|
|
24
|
+
],
|
|
25
|
+
"class-methods-use-this": 0,
|
|
26
|
+
"prefer-destructuring": 0,
|
|
27
|
+
"no-nested-ternary": 0,
|
|
28
|
+
"no-plusplus": 0,
|
|
29
|
+
"no-restricted-globals": 0,
|
|
30
|
+
"no-restricted-syntax": 0,
|
|
31
|
+
"no-underscore-dangle": 0,
|
|
32
|
+
"no-use-before-define": "warn",
|
|
33
|
+
"no-shadow": 0,
|
|
34
|
+
"object-curly-newline": 0,
|
|
35
|
+
"template-curly-spacing": 0,
|
|
36
|
+
"comma-dangle": ["error", "never"],
|
|
37
|
+
"func-names": 0,
|
|
38
|
+
"space-before-function-paren": 0,
|
|
39
|
+
"no-param-reassign": 0,
|
|
40
|
+
"implicit-arrow-linebreak": 0,
|
|
41
|
+
"arrow-parens": 0,
|
|
42
|
+
"operator-linebreak": 0,
|
|
43
|
+
"consistent-return": 0,
|
|
44
|
+
"no-continue": 0,
|
|
45
|
+
"no-tabs": ["warn", { "allowIndentationTabs": true }],
|
|
46
|
+
"indent": 0,
|
|
47
|
+
"import/no-mutable-exports": "warn",
|
|
48
|
+
"react/no-deprecated": "warn",
|
|
49
|
+
"react/prop-types": 0,
|
|
50
|
+
"react/forbid-prop-types": 0,
|
|
51
|
+
"react/display-name": 0,
|
|
52
|
+
"import/no-extraneous-dependencies": 0,
|
|
53
|
+
"react/react-in-jsx-scope": 0,
|
|
54
|
+
"no-console": "warn",
|
|
55
|
+
"spaced-comment": "warn",
|
|
56
|
+
"@typescript-eslint/rule-name": 0,
|
|
57
|
+
"@typescript-eslint/no-var-requires": 0,
|
|
58
|
+
"@typescript-eslint/no-use-before-define": "warn",
|
|
59
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
60
|
+
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
61
|
+
"max-len": [
|
|
62
|
+
"error",
|
|
63
|
+
{
|
|
64
|
+
"code": 140,
|
|
65
|
+
"tabWidth": 2,
|
|
66
|
+
"ignoreComments": true,
|
|
67
|
+
"ignoreUrls": true,
|
|
68
|
+
"ignoreStrings": true,
|
|
69
|
+
"ignoreTemplateLiterals": true,
|
|
70
|
+
"ignoreRegExpLiterals": true
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"import/no-unresolved": [
|
|
74
|
+
"error",
|
|
75
|
+
{
|
|
76
|
+
"ignore": [
|
|
77
|
+
"components/*",
|
|
78
|
+
"constants/*",
|
|
79
|
+
"pages/*",
|
|
80
|
+
"images/*",
|
|
81
|
+
"normalizers/*",
|
|
82
|
+
"reducers/*",
|
|
83
|
+
"sagas/*",
|
|
84
|
+
"selectors/*",
|
|
85
|
+
"styles/*",
|
|
86
|
+
"utils/*",
|
|
87
|
+
"validators/*",
|
|
88
|
+
"types/*",
|
|
89
|
+
"hooks/*"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"settings": {
|
|
95
|
+
"react": {
|
|
96
|
+
"pragma": "React",
|
|
97
|
+
"version": "18.x"
|
|
98
|
+
},
|
|
99
|
+
"import/resolver": {
|
|
100
|
+
"node": {
|
|
101
|
+
"paths": ["src"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
package/.prettierrc
ADDED
package/README.md
ADDED
package/copyTS.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const glob = require('glob');
|
|
4
|
+
const fse = require('fs-extra');
|
|
5
|
+
/* eslint-enable @typescript-eslint/no-var-requires */
|
|
6
|
+
const srcDir = path.join('./src');
|
|
7
|
+
const distDir = path.join('./dist/js');
|
|
8
|
+
const files = glob.sync('**/*.d.ts', {
|
|
9
|
+
cwd: srcDir
|
|
10
|
+
});
|
|
11
|
+
files.forEach((file) => {
|
|
12
|
+
const from = path.join(srcDir, file);
|
|
13
|
+
const to = path.join(distDir, file);
|
|
14
|
+
fse.copySync(from, to);
|
|
15
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@import "~styles/mixins";
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
height: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@include margin(8);
|
|
8
|
+
@include padding(8);
|
|
9
|
+
@include width;
|
|
10
|
+
@include flexRules;
|
|
11
|
+
@include showHideOnBreakPointRules("flex");
|
|
12
|
+
|
|
13
|
+
@for $i from 1 through 3 {
|
|
14
|
+
.border_#{$i} {
|
|
15
|
+
border: calc(#{$i} * 1px) solid $border-light-grey;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.borderBottom_#{$i} {
|
|
19
|
+
border-bottom: calc(#{$i} * 1px) solid $border-light-grey;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.borderTop_#{$i} {
|
|
23
|
+
border-top: calc(#{$i} * 1px) solid $border-light-grey;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.borderLeft_#{$i} {
|
|
27
|
+
border-left: calc(#{$i} * 1px) solid $border-light-grey;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.borderRight_#{$i} {
|
|
31
|
+
border-right: calc(#{$i} * 1px) solid $border-light-grey;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.backgroundColor_white {
|
|
36
|
+
background-color: $white;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.borderRadius {
|
|
40
|
+
border-radius: $border-radius;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.position_relative {
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.position_absolute {
|
|
48
|
+
position: absolute;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.withSeparatorRight {
|
|
52
|
+
margin-right: $four-base-size;
|
|
53
|
+
position: relative;
|
|
54
|
+
|
|
55
|
+
&:after {
|
|
56
|
+
content: "";
|
|
57
|
+
position: absolute;
|
|
58
|
+
right: -16px;
|
|
59
|
+
height: $two-base-size;
|
|
60
|
+
top: 50%;
|
|
61
|
+
transform: translateY(-50%);
|
|
62
|
+
width: 1px;
|
|
63
|
+
background: $border-grey;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.withSeparatorLeft {
|
|
68
|
+
margin-left: $two-base-size;
|
|
69
|
+
position: relative;
|
|
70
|
+
|
|
71
|
+
&:after {
|
|
72
|
+
content: "";
|
|
73
|
+
position: absolute;
|
|
74
|
+
left: -8px;
|
|
75
|
+
height: 100%;
|
|
76
|
+
top: 0;
|
|
77
|
+
width: 1px;
|
|
78
|
+
background: $border-grey;
|
|
79
|
+
}
|
|
80
|
+
}
|
package/dist/Box/Box.tsx
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { forwardRef, ReactNode } from 'react';
|
|
2
|
+
import classNames from 'classnames/bind';
|
|
3
|
+
import { is } from 'ramda';
|
|
4
|
+
|
|
5
|
+
import { MarginInterface, PaddingInterface, FlexStylingInterface } from 'types/styling';
|
|
6
|
+
|
|
7
|
+
import styles from './Box.module.scss';
|
|
8
|
+
|
|
9
|
+
const s = classNames.bind(styles);
|
|
10
|
+
|
|
11
|
+
interface Props extends MarginInterface, PaddingInterface, FlexStylingInterface {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
position?: string;
|
|
15
|
+
border?: string;
|
|
16
|
+
borderTop?: string;
|
|
17
|
+
borderBottom?: string;
|
|
18
|
+
borderRight?: string;
|
|
19
|
+
backgroundColor?: string;
|
|
20
|
+
showOnBreakpoint?: string;
|
|
21
|
+
borderLeft?: string;
|
|
22
|
+
withBorderRadius?: boolean;
|
|
23
|
+
width?: string;
|
|
24
|
+
minWidth?: string;
|
|
25
|
+
maxWidth?: string;
|
|
26
|
+
withSeparatorRight?: boolean;
|
|
27
|
+
withSeparatorLeft?: boolean;
|
|
28
|
+
style?: Record<string, unknown>;
|
|
29
|
+
onClickCallback?: () => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Box = forwardRef<HTMLDivElement, Props>(
|
|
33
|
+
(
|
|
34
|
+
{
|
|
35
|
+
className,
|
|
36
|
+
alignSelf,
|
|
37
|
+
children, // flex
|
|
38
|
+
displayFlex,
|
|
39
|
+
displayFlexCenter,
|
|
40
|
+
displayFlexCenterSpaceBetween,
|
|
41
|
+
justifyContent,
|
|
42
|
+
flexDirection,
|
|
43
|
+
flexGrow,
|
|
44
|
+
flexWrap,
|
|
45
|
+
alignItems, // margin
|
|
46
|
+
margin,
|
|
47
|
+
marginTop,
|
|
48
|
+
marginBottom,
|
|
49
|
+
marginRight,
|
|
50
|
+
marginLeft, // padding
|
|
51
|
+
padding,
|
|
52
|
+
paddingX,
|
|
53
|
+
paddingY,
|
|
54
|
+
paddingTop,
|
|
55
|
+
paddingBottom,
|
|
56
|
+
paddingRight,
|
|
57
|
+
paddingLeft, // border,
|
|
58
|
+
backgroundColor,
|
|
59
|
+
border,
|
|
60
|
+
borderTop,
|
|
61
|
+
borderBottom,
|
|
62
|
+
borderRight,
|
|
63
|
+
borderLeft,
|
|
64
|
+
withBorderRadius,
|
|
65
|
+
withSeparatorRight,
|
|
66
|
+
withSeparatorLeft,
|
|
67
|
+
showOnBreakpoint,
|
|
68
|
+
width,
|
|
69
|
+
minWidth,
|
|
70
|
+
maxWidth,
|
|
71
|
+
position,
|
|
72
|
+
style, // inline style
|
|
73
|
+
onClickCallback,
|
|
74
|
+
...other
|
|
75
|
+
},
|
|
76
|
+
ref
|
|
77
|
+
) => {
|
|
78
|
+
const onClick = () => {
|
|
79
|
+
if (onClickCallback) {
|
|
80
|
+
onClickCallback();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
className={s('container', {
|
|
87
|
+
// flex
|
|
88
|
+
displayFlex,
|
|
89
|
+
displayFlexCenter,
|
|
90
|
+
displayFlexCenterSpaceBetween,
|
|
91
|
+
[`justifyContent_${justifyContent}`]: is(String, justifyContent),
|
|
92
|
+
[`alignItems_${alignItems}`]: is(String, alignItems),
|
|
93
|
+
[`flexDirection_${flexDirection}`]: is(String, flexDirection),
|
|
94
|
+
[`flexWrap_${flexWrap}`]: is(String, flexWrap),
|
|
95
|
+
[`flexGrow_${flexGrow}`]: is(String, flexGrow),
|
|
96
|
+
[`alignSelf_${alignSelf}`]: is(String, alignSelf),
|
|
97
|
+
// margin
|
|
98
|
+
[`margin_${margin}`]: is(String, margin),
|
|
99
|
+
[`marginTop_${marginTop}`]: is(String, marginTop),
|
|
100
|
+
[`marginBottom_${marginBottom}`]: is(String, marginBottom),
|
|
101
|
+
[`marginRight_${marginRight}`]: is(String, marginRight),
|
|
102
|
+
[`marginLeft_${marginLeft}`]: is(String, marginLeft),
|
|
103
|
+
// padding
|
|
104
|
+
[`padding_${padding}`]: is(String, padding),
|
|
105
|
+
[`paddingX_${paddingX}`]: is(String, paddingX),
|
|
106
|
+
[`paddingY_${paddingY}`]: is(String, paddingY),
|
|
107
|
+
[`paddingTop_${paddingTop}`]: is(String, paddingTop),
|
|
108
|
+
[`paddingBottom_${paddingBottom}`]: is(String, paddingBottom),
|
|
109
|
+
[`paddingRight_${paddingRight}`]: is(String, paddingRight),
|
|
110
|
+
[`paddingLeft_${paddingLeft}`]: is(String, paddingLeft),
|
|
111
|
+
// border
|
|
112
|
+
[`backgroundColor_${backgroundColor}`]: is(String, backgroundColor),
|
|
113
|
+
[`border_${border}`]: is(String, border),
|
|
114
|
+
[`borderTop_${borderTop}`]: is(String, borderTop),
|
|
115
|
+
[`borderBottom_${borderBottom}`]: is(String, borderBottom),
|
|
116
|
+
[`borderRight_${borderRight}`]: is(String, borderRight),
|
|
117
|
+
[`borderLeft_${borderLeft}`]: is(String, borderLeft),
|
|
118
|
+
// Width
|
|
119
|
+
[`width_${width}`]: is(String, width),
|
|
120
|
+
[`minWidth_${minWidth}`]: is(String, minWidth),
|
|
121
|
+
[`maxWidth_${maxWidth}`]: is(String, maxWidth),
|
|
122
|
+
borderRadius: withBorderRadius,
|
|
123
|
+
// position
|
|
124
|
+
position_relative: ref,
|
|
125
|
+
[`position_${position}`]: is(String, position),
|
|
126
|
+
// Responsiveness
|
|
127
|
+
[`showOnBreakpoint_${showOnBreakpoint}`]: is(String, showOnBreakpoint),
|
|
128
|
+
withSeparatorRight,
|
|
129
|
+
withSeparatorLeft,
|
|
130
|
+
[className as string]: className
|
|
131
|
+
})}
|
|
132
|
+
style={style}
|
|
133
|
+
ref={ref}
|
|
134
|
+
onClick={onClick}
|
|
135
|
+
{...other}
|
|
136
|
+
>
|
|
137
|
+
{children}
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
export default Box;
|
package/dist/index.tsx
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "widenarrow-ui",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"main": "dist/js/index.js",
|
|
5
|
+
"module": "dist/esm/index.js",
|
|
6
|
+
"types": "dist/js/index.d.ts",
|
|
7
|
+
"private": false,
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"tag": "prerelease"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@babel/core": "^7.22.20",
|
|
14
|
+
"@testing-library/jest-dom": "5.17.0",
|
|
15
|
+
"@testing-library/react": "13.4.0",
|
|
16
|
+
"@testing-library/user-event": "13.5.0",
|
|
17
|
+
"@types/jest": "27.5.2",
|
|
18
|
+
"@types/node": "16.18.51",
|
|
19
|
+
"@types/ramda": "^0.29.4",
|
|
20
|
+
"@types/react": "18.2.21",
|
|
21
|
+
"@types/react-dom": "18.2.7",
|
|
22
|
+
"classnames": "2.3.2",
|
|
23
|
+
"ramda": "0.29.0",
|
|
24
|
+
"react": "18.2.0",
|
|
25
|
+
"react-dom": "18.2.0",
|
|
26
|
+
"react-scripts": "5.0.1",
|
|
27
|
+
"sass": "1.67.0",
|
|
28
|
+
"typescript": "4.9.5",
|
|
29
|
+
"web-vitals": "2.1.4"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build:lib": "npm run build:babel && npm run build:types && node ./scripts/copyTS.js",
|
|
33
|
+
"build:babel": "concurrently \"npm run build:babel:esm && npm run build:babel:umd\" \"npm run build:babel:cjs\"",
|
|
34
|
+
"build:babel:cjs": "BABEL_ENV=cjs babel --source-maps --extensions \".js,.ts,.tsx\" src --out-dir dist/js --presets=@babel/env",
|
|
35
|
+
"build:babel:esm": "BABEL_ENV=esm babel --source-maps --extensions \".js,.ts,.tsx\" src --out-dir dist/esm",
|
|
36
|
+
"build:babel:umd": "BABEL_ENV=umd babel --source-maps --extensions \".js\" dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd",
|
|
37
|
+
"build:types": "tsc -p tsconfig.gen-dts.json",
|
|
38
|
+
"clean": "rimraf dist",
|
|
39
|
+
"develop": "npm run build:types && npm run build:babel:esm --skip-initial-build --watch --verbose"
|
|
40
|
+
},
|
|
41
|
+
"eslintConfig": {
|
|
42
|
+
"extends": [
|
|
43
|
+
"react-app",
|
|
44
|
+
"react-app/jest"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"browserslist": {
|
|
48
|
+
"production": [
|
|
49
|
+
">0.2%",
|
|
50
|
+
"not dead",
|
|
51
|
+
"not op_mini all"
|
|
52
|
+
],
|
|
53
|
+
"development": [
|
|
54
|
+
"last 1 chrome version",
|
|
55
|
+
"last 1 firefox version",
|
|
56
|
+
"last 1 safari version"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@babel/cli": "^7.22.15",
|
|
61
|
+
"@babel/plugin-proposal-export-default-from": "^7.22.17",
|
|
62
|
+
"babel-plugin-transform-es2015-modules-umd": "^6.24.1",
|
|
63
|
+
"babel-plugin-typescript-to-proptypes": "^2.1.0",
|
|
64
|
+
"babel-preset-env": "^1.7.0",
|
|
65
|
+
"babel-preset-react": "^6.24.1",
|
|
66
|
+
"babel-preset-stage-2": "^6.24.1",
|
|
67
|
+
"concurrently": "^8.2.1"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@import "~styles/mixins";
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
height: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@include margin(8);
|
|
8
|
+
@include padding(8);
|
|
9
|
+
@include width;
|
|
10
|
+
@include flexRules;
|
|
11
|
+
@include showHideOnBreakPointRules("flex");
|
|
12
|
+
|
|
13
|
+
@for $i from 1 through 3 {
|
|
14
|
+
.border_#{$i} {
|
|
15
|
+
border: calc(#{$i} * 1px) solid $border-light-grey;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.borderBottom_#{$i} {
|
|
19
|
+
border-bottom: calc(#{$i} * 1px) solid $border-light-grey;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.borderTop_#{$i} {
|
|
23
|
+
border-top: calc(#{$i} * 1px) solid $border-light-grey;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.borderLeft_#{$i} {
|
|
27
|
+
border-left: calc(#{$i} * 1px) solid $border-light-grey;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.borderRight_#{$i} {
|
|
31
|
+
border-right: calc(#{$i} * 1px) solid $border-light-grey;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.backgroundColor_white {
|
|
36
|
+
background-color: $white;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.borderRadius {
|
|
40
|
+
border-radius: $border-radius;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.position_relative {
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.position_absolute {
|
|
48
|
+
position: absolute;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.withSeparatorRight {
|
|
52
|
+
margin-right: $four-base-size;
|
|
53
|
+
position: relative;
|
|
54
|
+
|
|
55
|
+
&:after {
|
|
56
|
+
content: "";
|
|
57
|
+
position: absolute;
|
|
58
|
+
right: -16px;
|
|
59
|
+
height: $two-base-size;
|
|
60
|
+
top: 50%;
|
|
61
|
+
transform: translateY(-50%);
|
|
62
|
+
width: 1px;
|
|
63
|
+
background: $border-grey;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.withSeparatorLeft {
|
|
68
|
+
margin-left: $two-base-size;
|
|
69
|
+
position: relative;
|
|
70
|
+
|
|
71
|
+
&:after {
|
|
72
|
+
content: "";
|
|
73
|
+
position: absolute;
|
|
74
|
+
left: -8px;
|
|
75
|
+
height: 100%;
|
|
76
|
+
top: 0;
|
|
77
|
+
width: 1px;
|
|
78
|
+
background: $border-grey;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { forwardRef, ReactNode } from 'react';
|
|
2
|
+
import classNames from 'classnames/bind';
|
|
3
|
+
import { is } from 'ramda';
|
|
4
|
+
|
|
5
|
+
import { MarginInterface, PaddingInterface, FlexStylingInterface } from 'types/styling';
|
|
6
|
+
|
|
7
|
+
import styles from './Box.module.scss';
|
|
8
|
+
|
|
9
|
+
const s = classNames.bind(styles);
|
|
10
|
+
|
|
11
|
+
interface Props extends MarginInterface, PaddingInterface, FlexStylingInterface {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
position?: string;
|
|
15
|
+
border?: string;
|
|
16
|
+
borderTop?: string;
|
|
17
|
+
borderBottom?: string;
|
|
18
|
+
borderRight?: string;
|
|
19
|
+
backgroundColor?: string;
|
|
20
|
+
showOnBreakpoint?: string;
|
|
21
|
+
borderLeft?: string;
|
|
22
|
+
withBorderRadius?: boolean;
|
|
23
|
+
width?: string;
|
|
24
|
+
minWidth?: string;
|
|
25
|
+
maxWidth?: string;
|
|
26
|
+
withSeparatorRight?: boolean;
|
|
27
|
+
withSeparatorLeft?: boolean;
|
|
28
|
+
style?: Record<string, unknown>;
|
|
29
|
+
onClickCallback?: () => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Box = forwardRef<HTMLDivElement, Props>(
|
|
33
|
+
(
|
|
34
|
+
{
|
|
35
|
+
className,
|
|
36
|
+
alignSelf,
|
|
37
|
+
children, // flex
|
|
38
|
+
displayFlex,
|
|
39
|
+
displayFlexCenter,
|
|
40
|
+
displayFlexCenterSpaceBetween,
|
|
41
|
+
justifyContent,
|
|
42
|
+
flexDirection,
|
|
43
|
+
flexGrow,
|
|
44
|
+
flexWrap,
|
|
45
|
+
alignItems, // margin
|
|
46
|
+
margin,
|
|
47
|
+
marginTop,
|
|
48
|
+
marginBottom,
|
|
49
|
+
marginRight,
|
|
50
|
+
marginLeft, // padding
|
|
51
|
+
padding,
|
|
52
|
+
paddingX,
|
|
53
|
+
paddingY,
|
|
54
|
+
paddingTop,
|
|
55
|
+
paddingBottom,
|
|
56
|
+
paddingRight,
|
|
57
|
+
paddingLeft, // border,
|
|
58
|
+
backgroundColor,
|
|
59
|
+
border,
|
|
60
|
+
borderTop,
|
|
61
|
+
borderBottom,
|
|
62
|
+
borderRight,
|
|
63
|
+
borderLeft,
|
|
64
|
+
withBorderRadius,
|
|
65
|
+
withSeparatorRight,
|
|
66
|
+
withSeparatorLeft,
|
|
67
|
+
showOnBreakpoint,
|
|
68
|
+
width,
|
|
69
|
+
minWidth,
|
|
70
|
+
maxWidth,
|
|
71
|
+
position,
|
|
72
|
+
style, // inline style
|
|
73
|
+
onClickCallback,
|
|
74
|
+
...other
|
|
75
|
+
},
|
|
76
|
+
ref
|
|
77
|
+
) => {
|
|
78
|
+
const onClick = () => {
|
|
79
|
+
if (onClickCallback) {
|
|
80
|
+
onClickCallback();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
className={s('container', {
|
|
87
|
+
// flex
|
|
88
|
+
displayFlex,
|
|
89
|
+
displayFlexCenter,
|
|
90
|
+
displayFlexCenterSpaceBetween,
|
|
91
|
+
[`justifyContent_${justifyContent}`]: is(String, justifyContent),
|
|
92
|
+
[`alignItems_${alignItems}`]: is(String, alignItems),
|
|
93
|
+
[`flexDirection_${flexDirection}`]: is(String, flexDirection),
|
|
94
|
+
[`flexWrap_${flexWrap}`]: is(String, flexWrap),
|
|
95
|
+
[`flexGrow_${flexGrow}`]: is(String, flexGrow),
|
|
96
|
+
[`alignSelf_${alignSelf}`]: is(String, alignSelf),
|
|
97
|
+
// margin
|
|
98
|
+
[`margin_${margin}`]: is(String, margin),
|
|
99
|
+
[`marginTop_${marginTop}`]: is(String, marginTop),
|
|
100
|
+
[`marginBottom_${marginBottom}`]: is(String, marginBottom),
|
|
101
|
+
[`marginRight_${marginRight}`]: is(String, marginRight),
|
|
102
|
+
[`marginLeft_${marginLeft}`]: is(String, marginLeft),
|
|
103
|
+
// padding
|
|
104
|
+
[`padding_${padding}`]: is(String, padding),
|
|
105
|
+
[`paddingX_${paddingX}`]: is(String, paddingX),
|
|
106
|
+
[`paddingY_${paddingY}`]: is(String, paddingY),
|
|
107
|
+
[`paddingTop_${paddingTop}`]: is(String, paddingTop),
|
|
108
|
+
[`paddingBottom_${paddingBottom}`]: is(String, paddingBottom),
|
|
109
|
+
[`paddingRight_${paddingRight}`]: is(String, paddingRight),
|
|
110
|
+
[`paddingLeft_${paddingLeft}`]: is(String, paddingLeft),
|
|
111
|
+
// border
|
|
112
|
+
[`backgroundColor_${backgroundColor}`]: is(String, backgroundColor),
|
|
113
|
+
[`border_${border}`]: is(String, border),
|
|
114
|
+
[`borderTop_${borderTop}`]: is(String, borderTop),
|
|
115
|
+
[`borderBottom_${borderBottom}`]: is(String, borderBottom),
|
|
116
|
+
[`borderRight_${borderRight}`]: is(String, borderRight),
|
|
117
|
+
[`borderLeft_${borderLeft}`]: is(String, borderLeft),
|
|
118
|
+
// Width
|
|
119
|
+
[`width_${width}`]: is(String, width),
|
|
120
|
+
[`minWidth_${minWidth}`]: is(String, minWidth),
|
|
121
|
+
[`maxWidth_${maxWidth}`]: is(String, maxWidth),
|
|
122
|
+
borderRadius: withBorderRadius,
|
|
123
|
+
// position
|
|
124
|
+
position_relative: ref,
|
|
125
|
+
[`position_${position}`]: is(String, position),
|
|
126
|
+
// Responsiveness
|
|
127
|
+
[`showOnBreakpoint_${showOnBreakpoint}`]: is(String, showOnBreakpoint),
|
|
128
|
+
withSeparatorRight,
|
|
129
|
+
withSeparatorLeft,
|
|
130
|
+
[className as string]: className
|
|
131
|
+
})}
|
|
132
|
+
style={style}
|
|
133
|
+
ref={ref}
|
|
134
|
+
onClick={onClick}
|
|
135
|
+
{...other}
|
|
136
|
+
>
|
|
137
|
+
{children}
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
export default Box;
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|