@spaced-out/ui-design-system 0.0.1-alpha.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/.commitlintrc.json +3 -0
- package/.cspell/custom-words.txt +22 -0
- package/.editorconfig +9 -0
- package/.eslintignore +1 -0
- package/.eslintrc.yml +122 -0
- package/.flowconfig +45 -0
- package/.github/workflows/pages.yml +52 -0
- package/.prettierrc +11 -0
- package/.storybook/SenseTheme.js +12 -0
- package/.storybook/main.js +73 -0
- package/.storybook/manager-head.html +41 -0
- package/.storybook/manager.js +14 -0
- package/.storybook/preview-head.html +130 -0
- package/.storybook/preview.js +128 -0
- package/.storybook/public/favicon.ico +0 -0
- package/.storybook/public/favicon.svg +6 -0
- package/.storybook/public/fonts/CentraNo2-Book.woff +0 -0
- package/.storybook/public/fonts/CentraNo2-Book.woff2 +0 -0
- package/.storybook/public/fonts/CentraNo2-BookItalic.woff +0 -0
- package/.storybook/public/fonts/CentraNo2-BookItalic.woff2 +0 -0
- package/.storybook/public/fonts/CentraNo2-Medium.woff +0 -0
- package/.storybook/public/fonts/CentraNo2-Medium.woff2 +0 -0
- package/.vscode/extensions.json +3 -0
- package/CHANGELOG.md +73 -0
- package/README.md +178 -0
- package/babel.config.js +24 -0
- package/config.js +58 -0
- package/cspell.json +26 -0
- package/design-tokens/border/app-border.json +41 -0
- package/design-tokens/border/base-border.json +41 -0
- package/design-tokens/color/app-color.json +226 -0
- package/design-tokens/color/base-color.json +265 -0
- package/design-tokens/elevation/app-elevation.json +22 -0
- package/design-tokens/elevation/base-elevation.json +19 -0
- package/design-tokens/font/base-font.json +98 -0
- package/design-tokens/index.js +5 -0
- package/design-tokens/motion/app.motion.json +24 -0
- package/design-tokens/motion/base-motion.json +40 -0
- package/design-tokens/opacity/base-opacity.json +49 -0
- package/design-tokens/shadow/base-shadow.json +86 -0
- package/design-tokens/size/base-size.json +94 -0
- package/design-tokens/space/app-space.json +40 -0
- package/design-tokens/space/base-space.json +40 -0
- package/flow-typed/npm/lodash_v4.x.x.js +6407 -0
- package/git-conventional-commits.json +43 -0
- package/gulpfile.js +48 -0
- package/jest.config.js +9 -0
- package/lib/assets/fontawesome/LICENSE.txt +18 -0
- package/lib/assets/fontawesome/css/all.min.css +27184 -0
- package/lib/assets/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-duotone-900.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-duotone-900.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-light-300.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-light-300.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-thin-100.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-thin-100.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-v4compatibility.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-v4compatibility.woff2 +0 -0
- package/lib/components/Button/Button.js +120 -0
- package/lib/components/Button/Button.js.flow +166 -0
- package/lib/components/Button/Button.module.css +226 -0
- package/lib/components/Button/index.js +24 -0
- package/lib/components/Button/index.js.flow +4 -0
- package/lib/components/ButtonDropdown/ButtonDropdown.js +89 -0
- package/lib/components/ButtonDropdown/ButtonDropdown.js.flow +119 -0
- package/lib/components/ButtonDropdown/ButtonDropdown.module.css +4 -0
- package/lib/components/ButtonDropdown/index.js +12 -0
- package/lib/components/ButtonDropdown/index.js.flow +4 -0
- package/lib/components/Checkbox/Checkbox.js +99 -0
- package/lib/components/Checkbox/Checkbox.js.flow +133 -0
- package/lib/components/Checkbox/Checkbox.module.css +160 -0
- package/lib/components/Checkbox/CheckboxGroup.js +85 -0
- package/lib/components/Checkbox/CheckboxGroup.js.flow +105 -0
- package/lib/components/Checkbox/CheckboxGroup.module.css +47 -0
- package/lib/components/Checkbox/index.js +19 -0
- package/lib/components/Checkbox/index.js.flow +3 -0
- package/lib/components/CircularLoader/CircularLoader.js +44 -0
- package/lib/components/CircularLoader/CircularLoader.js.flow +44 -0
- package/lib/components/CircularLoader/CircularLoader.module.css +81 -0
- package/lib/components/CircularLoader/index.js +12 -0
- package/lib/components/CircularLoader/index.js.flow +3 -0
- package/lib/components/CodeBlock.js +26 -0
- package/lib/components/CodeBlock.js.flow +19 -0
- package/lib/components/Dialog/Dialog.js +148 -0
- package/lib/components/Dialog/Dialog.js.flow +165 -0
- package/lib/components/Dialog/Dialog.module.css +87 -0
- package/lib/components/Dialog/index.js +36 -0
- package/lib/components/Dialog/index.js.flow +14 -0
- package/lib/components/Dropdown/Dropdown.js +108 -0
- package/lib/components/Dropdown/Dropdown.js.flow +129 -0
- package/lib/components/Dropdown/Dropdown.module.css +14 -0
- package/lib/components/Dropdown/index.js +18 -0
- package/lib/components/Dropdown/index.js.flow +4 -0
- package/lib/components/Grid/Grid.js +82 -0
- package/lib/components/Grid/Grid.js.flow +88 -0
- package/lib/components/Grid/Grid.module.css +30 -0
- package/lib/components/Grid/index.js +16 -0
- package/lib/components/Grid/index.js.flow +3 -0
- package/lib/components/Icon/ClickableIcon.js +51 -0
- package/lib/components/Icon/ClickableIcon.js.flow +51 -0
- package/lib/components/Icon/ClickableIcon.module.css +50 -0
- package/lib/components/Icon/FontAwesomeLibrary.js +3 -0
- package/lib/components/Icon/FontAwesomeLibrary.js.flow +3 -0
- package/lib/components/Icon/Icon.js +38 -0
- package/lib/components/Icon/Icon.js.flow +51 -0
- package/lib/components/Icon/index.js +25 -0
- package/lib/components/Icon/index.js.flow +6 -0
- package/lib/components/InContextAlert/InContextAlert.js +121 -0
- package/lib/components/InContextAlert/InContextAlert.js.flow +173 -0
- package/lib/components/InContextAlert/InContextAlert.module.css +54 -0
- package/lib/components/InContextAlert/index.js +18 -0
- package/lib/components/InContextAlert/index.js.flow +3 -0
- package/lib/components/Input/Input.js +172 -0
- package/lib/components/Input/Input.js.flow +246 -0
- package/lib/components/Input/Input.module.css +122 -0
- package/lib/components/Input/index.js +12 -0
- package/lib/components/Input/index.js.flow +4 -0
- package/lib/components/LinearLoader/LinearLoader.js +35 -0
- package/lib/components/LinearLoader/LinearLoader.js.flow +34 -0
- package/lib/components/LinearLoader/LinearLoader.module.css +43 -0
- package/lib/components/LinearLoader/index.js +12 -0
- package/lib/components/LinearLoader/index.js.flow +3 -0
- package/lib/components/Menu/Menu.js +76 -0
- package/lib/components/Menu/Menu.js.flow +85 -0
- package/lib/components/Menu/Menu.module.css +124 -0
- package/lib/components/Menu/index.js +12 -0
- package/lib/components/Menu/index.js.flow +4 -0
- package/lib/components/Modal/Modal.js +121 -0
- package/lib/components/Modal/Modal.js.flow +157 -0
- package/lib/components/Modal/Modal.module.css +62 -0
- package/lib/components/Modal/index.js +12 -0
- package/lib/components/Modal/index.js.flow +3 -0
- package/lib/components/Notification/Notification.js +89 -0
- package/lib/components/Notification/Notification.js.flow +136 -0
- package/lib/components/Notification/Notification.module.css +54 -0
- package/lib/components/Notification/index.js +18 -0
- package/lib/components/Notification/index.js.flow +3 -0
- package/lib/components/Panel/Panel.js +96 -0
- package/lib/components/Panel/Panel.js.flow +109 -0
- package/lib/components/Panel/Panel.module.css +77 -0
- package/lib/components/Panel/index.js +30 -0
- package/lib/components/Panel/index.js.flow +10 -0
- package/lib/components/RadioButton/RadioButton.js +76 -0
- package/lib/components/RadioButton/RadioButton.js.flow +102 -0
- package/lib/components/RadioButton/RadioButton.module.css +122 -0
- package/lib/components/RadioButton/RadioGroup.js +60 -0
- package/lib/components/RadioButton/RadioGroup.js.flow +85 -0
- package/lib/components/RadioButton/RadioGroup.module.css +47 -0
- package/lib/components/RadioButton/index.js +19 -0
- package/lib/components/RadioButton/index.js.flow +3 -0
- package/lib/components/SearchInput/SearchInput.js +47 -0
- package/lib/components/SearchInput/SearchInput.js.flow +73 -0
- package/lib/components/SearchInput/SearchInput.module.css +11 -0
- package/lib/components/SearchInput/index.js +12 -0
- package/lib/components/SearchInput/index.js.flow +4 -0
- package/lib/components/Text/Text.js +195 -0
- package/lib/components/Text/Text.js.flow +160 -0
- package/lib/components/Text/index.js +103 -0
- package/lib/components/Text/index.js.flow +21 -0
- package/lib/components/Textarea/Textarea.js +95 -0
- package/lib/components/Textarea/Textarea.js.flow +133 -0
- package/lib/components/Textarea/Textarea.module.css +110 -0
- package/lib/components/Textarea/index.js +12 -0
- package/lib/components/Textarea/index.js.flow +4 -0
- package/lib/components/Toast/Toast.js +187 -0
- package/lib/components/Toast/Toast.js.flow +210 -0
- package/lib/components/Toast/Toast.module.css +52 -0
- package/lib/components/Toast/ToastContainer.js +129 -0
- package/lib/components/Toast/ToastContainer.js.flow +125 -0
- package/lib/components/Toast/ToastContainer.module.css +41 -0
- package/lib/components/Toast/ToastManager.js +62 -0
- package/lib/components/Toast/ToastManager.js.flow +67 -0
- package/lib/components/Toast/index.js +56 -0
- package/lib/components/Toast/index.js.flow +12 -0
- package/lib/components/Toggle/Toggle.js +69 -0
- package/lib/components/Toggle/Toggle.js.flow +94 -0
- package/lib/components/Toggle/Toggle.module.css +144 -0
- package/lib/components/Toggle/index.js +12 -0
- package/lib/components/Toggle/index.js.flow +2 -0
- package/lib/components/Tooltip/Tooltip.js +81 -0
- package/lib/components/Tooltip/Tooltip.js.flow +110 -0
- package/lib/components/Tooltip/Tooltip.module.css +16 -0
- package/lib/components/Tooltip/index.js +12 -0
- package/lib/components/Tooltip/index.js.flow +4 -0
- package/lib/components/Truncate/Truncate.js +28 -0
- package/lib/components/Truncate/Truncate.js.flow +22 -0
- package/lib/components/Truncate/Truncate.module.css +6 -0
- package/lib/components/Truncate/index.js +12 -0
- package/lib/components/Truncate/index.js.flow +4 -0
- package/lib/components/Typeahead/Typeahead.js +124 -0
- package/lib/components/Typeahead/Typeahead.js.flow +153 -0
- package/lib/components/Typeahead/Typeahead.module.css +10 -0
- package/lib/components/Typeahead/index.js +12 -0
- package/lib/components/Typeahead/index.js.flow +4 -0
- package/lib/hooks/index.js +27 -0
- package/lib/hooks/index.js.flow +4 -0
- package/lib/hooks/useMountTransition.js +25 -0
- package/lib/hooks/useMountTransition.js.flow +27 -0
- package/lib/hooks/useToastPortal.js +32 -0
- package/lib/hooks/useToastPortal.js.flow +30 -0
- package/lib/styles/animation.module.css +9 -0
- package/lib/styles/border.module.css +27 -0
- package/lib/styles/shadow.module.css +42 -0
- package/lib/styles/typography.module.css +227 -0
- package/lib/styles/variables/_border.css +21 -0
- package/lib/styles/variables/_border.js +29 -0
- package/lib/styles/variables/_border.js.flow +23 -0
- package/lib/styles/variables/_color.css +131 -0
- package/lib/styles/variables/_color.js +139 -0
- package/lib/styles/variables/_color.js.flow +133 -0
- package/lib/styles/variables/_elevation.css +11 -0
- package/lib/styles/variables/_elevation.js +19 -0
- package/lib/styles/variables/_elevation.js.flow +13 -0
- package/lib/styles/variables/_font.css +51 -0
- package/lib/styles/variables/_font.js +59 -0
- package/lib/styles/variables/_font.js.flow +53 -0
- package/lib/styles/variables/_motion.css +11 -0
- package/lib/styles/variables/_motion.js +19 -0
- package/lib/styles/variables/_motion.js.flow +13 -0
- package/lib/styles/variables/_opacity.css +29 -0
- package/lib/styles/variables/_opacity.js +37 -0
- package/lib/styles/variables/_opacity.js.flow +31 -0
- package/lib/styles/variables/_shadow.css +47 -0
- package/lib/styles/variables/_shadow.js +55 -0
- package/lib/styles/variables/_shadow.js.flow +49 -0
- package/lib/styles/variables/_size.css +59 -0
- package/lib/styles/variables/_size.js +67 -0
- package/lib/styles/variables/_size.js.flow +61 -0
- package/lib/styles/variables/_space.css +23 -0
- package/lib/styles/variables/_space.js +31 -0
- package/lib/styles/variables/_space.js.flow +25 -0
- package/lib/types/common.js +1 -0
- package/lib/types/common.js.flow +3 -0
- package/lib/types/toast.js +24 -0
- package/lib/types/toast.js.flow +41 -0
- package/lib/types/typography.js +22 -0
- package/lib/types/typography.js.flow +18 -0
- package/lib/utils/classify.js +33 -0
- package/lib/utils/classify.js.flow +29 -0
- package/lib/utils/click-away.js +110 -0
- package/lib/utils/click-away.js.flow +134 -0
- package/lib/utils/dom.js +202 -0
- package/lib/utils/dom.js.flow +238 -0
- package/lib/utils/helpers.js +16 -0
- package/lib/utils/helpers.js.flow +11 -0
- package/lib/utils/makeClassNameComponent.js +58 -0
- package/lib/utils/makeClassNameComponent.js.flow +71 -0
- package/lib/utils/merge-refs.js +17 -0
- package/lib/utils/merge-refs.js.flow +14 -0
- package/lint-staged.config.js +5 -0
- package/package.json +114 -0
- package/postcss.config.js +3 -0
- package/pull_request_template.md +48 -0
- package/settings.json +3 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
@value (
|
|
2
|
+
size42,
|
|
3
|
+
size34,
|
|
4
|
+
sizeFluid
|
|
5
|
+
) from '../../styles/variables/_size.css';
|
|
6
|
+
|
|
7
|
+
@value (
|
|
8
|
+
spaceNone,
|
|
9
|
+
spaceXSmall,
|
|
10
|
+
spaceSmall,
|
|
11
|
+
spaceXXSmall
|
|
12
|
+
) from '../../styles/variables/_space.css';
|
|
13
|
+
|
|
14
|
+
@value (
|
|
15
|
+
borderRadiusMedium,
|
|
16
|
+
borderRadiusSmall,
|
|
17
|
+
borderWidthSecondary,
|
|
18
|
+
borderWidthTertiary,
|
|
19
|
+
borderWidthNone
|
|
20
|
+
) from '../../styles/variables/_border.css';
|
|
21
|
+
|
|
22
|
+
@value (
|
|
23
|
+
colorTextPrimary,
|
|
24
|
+
colorTextSecondary,
|
|
25
|
+
colorBorderPrimary,
|
|
26
|
+
colorFillPrimary,
|
|
27
|
+
colorFocusPrimary,
|
|
28
|
+
colorFocusDanger,
|
|
29
|
+
colorTextDisabled,
|
|
30
|
+
colorFillDisabled,
|
|
31
|
+
colorTextDanger
|
|
32
|
+
) from '../../styles/variables/_color.css';
|
|
33
|
+
|
|
34
|
+
.container {
|
|
35
|
+
color: colorTextPrimary;
|
|
36
|
+
width: sizeFluid;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.box {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
color: colorTextPrimary;
|
|
43
|
+
gap: spaceXSmall;
|
|
44
|
+
height: size42;
|
|
45
|
+
padding: spaceNone spaceSmall;
|
|
46
|
+
border: borderWidthSecondary solid colorBorderPrimary;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.locked {
|
|
50
|
+
border-style: dashed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.medium {
|
|
54
|
+
composes: formInputMedium from '../../styles/typography.module.css';
|
|
55
|
+
height: size42;
|
|
56
|
+
border-radius: borderRadiusMedium;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.small {
|
|
60
|
+
composes: formInputSmall from '../../styles/typography.module.css';
|
|
61
|
+
height: size34;
|
|
62
|
+
border-radius: borderRadiusSmall;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.wrapper.withError .box {
|
|
66
|
+
border-color: colorTextDanger;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.wrapper.withError:focus-within .box {
|
|
70
|
+
box-shadow: borderWidthNone borderWidthNone borderWidthNone
|
|
71
|
+
borderWidthTertiary colorFocusDanger;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.box input {
|
|
75
|
+
width: sizeFluid;
|
|
76
|
+
height: sizeFluid;
|
|
77
|
+
cursor: inherit;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.wrapper:not(.inputDisabled):not(.withError):focus-within .box {
|
|
81
|
+
border-color: colorFillPrimary;
|
|
82
|
+
box-shadow: borderWidthNone borderWidthNone borderWidthNone
|
|
83
|
+
borderWidthTertiary colorFocusPrimary;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.inputDisabled {
|
|
87
|
+
color: colorTextDisabled;
|
|
88
|
+
border-color: colorBorderPrimary;
|
|
89
|
+
background-color: colorFillDisabled;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
input::placeholder {
|
|
93
|
+
color: colorTextSecondary;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.inputDisabled input::placeholder {
|
|
97
|
+
color: inherit;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.wrapper {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
width: sizeFluid;
|
|
104
|
+
gap: spaceXXSmall;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.info {
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: space-between;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.infoContent {
|
|
113
|
+
display: flex;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.rightClickableIcon {
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.rightClickableIcon.disabled {
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LinearLoader = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classify = require("../../utils/classify");
|
|
9
|
+
var _LinearLoaderModule = _interopRequireDefault(require("./LinearLoader.module.css"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
|
|
15
|
+
const LinearLoader = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
value,
|
|
18
|
+
size = 'medium',
|
|
19
|
+
className
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.js)("div", {
|
|
22
|
+
className: (0, _classify.classify)(_LinearLoaderModule.default.lineContainer, {
|
|
23
|
+
[_LinearLoaderModule.default.large]: size === 'large',
|
|
24
|
+
[_LinearLoaderModule.default.medium]: size === 'medium',
|
|
25
|
+
[_LinearLoaderModule.default.small]: size === 'small'
|
|
26
|
+
}, className),
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.js)("div", {
|
|
28
|
+
className: _LinearLoaderModule.default.progressBar,
|
|
29
|
+
style: {
|
|
30
|
+
width: `${value + '%'}`
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
exports.LinearLoader = LinearLoader;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import {classify} from '../../utils/classify';
|
|
6
|
+
|
|
7
|
+
import css from './LinearLoader.module.css';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export type LinearLoaderProps = {
|
|
11
|
+
value: number,
|
|
12
|
+
size?: 'large' | 'medium' | 'small',
|
|
13
|
+
className?: string,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const LinearLoader = ({
|
|
17
|
+
value,
|
|
18
|
+
size = 'medium',
|
|
19
|
+
className,
|
|
20
|
+
}: LinearLoaderProps): React.Node => (
|
|
21
|
+
<div
|
|
22
|
+
className={classify(
|
|
23
|
+
css.lineContainer,
|
|
24
|
+
{
|
|
25
|
+
[css.large]: size === 'large',
|
|
26
|
+
[css.medium]: size === 'medium',
|
|
27
|
+
[css.small]: size === 'small',
|
|
28
|
+
},
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
<div className={css.progressBar} style={{width: `${value + '%'}`}}></div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@value (
|
|
2
|
+
borderRadiusSmall
|
|
3
|
+
) from '../../styles/variables/_border.css';
|
|
4
|
+
@value (colorFillPrimary, colorBorderPrimary) from '../../styles/variables/_color.css';
|
|
5
|
+
|
|
6
|
+
@value (
|
|
7
|
+
size4,
|
|
8
|
+
size8,
|
|
9
|
+
size12,
|
|
10
|
+
sizeFluid
|
|
11
|
+
) from '../../styles/variables/_size.css';
|
|
12
|
+
|
|
13
|
+
@value (
|
|
14
|
+
motionDurationSlow
|
|
15
|
+
) from '../../styles/variables/_motion.css';
|
|
16
|
+
|
|
17
|
+
.lineContainer {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: flex-start;
|
|
20
|
+
align-items: center;
|
|
21
|
+
width: sizeFluid;
|
|
22
|
+
background: colorBorderPrimary;
|
|
23
|
+
border-radius: borderRadiusSmall;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.large {
|
|
27
|
+
height: size12;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.medium {
|
|
31
|
+
height: size8;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.small {
|
|
35
|
+
height: size4;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.progressBar {
|
|
39
|
+
background: colorFillPrimary;
|
|
40
|
+
border-radius: borderRadiusSmall;
|
|
41
|
+
height: sizeFluid;
|
|
42
|
+
transition: motionDurationSlow;
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "LinearLoader", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _LinearLoader.LinearLoader;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _LinearLoader = require("./LinearLoader");
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Menu = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classify = require("../../utils/classify");
|
|
9
|
+
var _Button = require("../Button");
|
|
10
|
+
var _Icon = require("../Icon");
|
|
11
|
+
var _MenuModule = _interopRequireDefault(require("./Menu.module.css"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
|
|
17
|
+
const Menu = props => {
|
|
18
|
+
const {
|
|
19
|
+
options,
|
|
20
|
+
onSelect,
|
|
21
|
+
selectedOption,
|
|
22
|
+
classNames,
|
|
23
|
+
size = 'medium',
|
|
24
|
+
width,
|
|
25
|
+
menuDisabled,
|
|
26
|
+
isFluid = true
|
|
27
|
+
} = props;
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.js)("div", {
|
|
29
|
+
className: (0, _classify.classify)(_MenuModule.default.menuCard, classNames?.wrapper, {
|
|
30
|
+
[_MenuModule.default.fluid]: isFluid,
|
|
31
|
+
[_MenuModule.default.medium]: size === 'medium',
|
|
32
|
+
[_MenuModule.default.small]: size === 'small'
|
|
33
|
+
}),
|
|
34
|
+
style: {
|
|
35
|
+
width
|
|
36
|
+
},
|
|
37
|
+
children: options.map(_ref => {
|
|
38
|
+
let {
|
|
39
|
+
key,
|
|
40
|
+
label,
|
|
41
|
+
iconLeft,
|
|
42
|
+
iconRight,
|
|
43
|
+
disabled
|
|
44
|
+
} = _ref;
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jss)(_Button.UnstyledButton, {
|
|
46
|
+
className: (0, _classify.classify)(_MenuModule.default.option, {
|
|
47
|
+
[_MenuModule.default.selected]: key === selectedOption?.key,
|
|
48
|
+
[_MenuModule.default.optionSmall]: size === 'small',
|
|
49
|
+
[_MenuModule.default.optionMedium]: size === 'medium',
|
|
50
|
+
[_MenuModule.default.disabled]: menuDisabled || disabled,
|
|
51
|
+
[_MenuModule.default.withIconLeft]: !!iconLeft,
|
|
52
|
+
[_MenuModule.default.withIconRight]: !!iconRight
|
|
53
|
+
}),
|
|
54
|
+
disabled: menuDisabled || disabled,
|
|
55
|
+
onClick: () => onSelect && onSelect({
|
|
56
|
+
key,
|
|
57
|
+
label
|
|
58
|
+
}),
|
|
59
|
+
autoFocus: selectedOption?.key === key,
|
|
60
|
+
children: [!!iconLeft && /*#__PURE__*/(0, _jsxRuntime.js)(_Icon.Icon, {
|
|
61
|
+
name: iconLeft,
|
|
62
|
+
size: "small",
|
|
63
|
+
className: _MenuModule.default.icon
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.js)("span", {
|
|
65
|
+
className: _MenuModule.default.optionText,
|
|
66
|
+
children: label
|
|
67
|
+
}), !!iconRight && /*#__PURE__*/(0, _jsxRuntime.js)(_Icon.Icon, {
|
|
68
|
+
name: iconRight,
|
|
69
|
+
size: "small",
|
|
70
|
+
className: (0, _classify.classify)(_MenuModule.default.icon, _MenuModule.default.rightIcon)
|
|
71
|
+
})]
|
|
72
|
+
}, key);
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
exports.Menu = Menu;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
import {classify} from '../../utils/classify';
|
|
5
|
+
import {UnstyledButton} from '../Button';
|
|
6
|
+
import {Icon} from '../Icon';
|
|
7
|
+
|
|
8
|
+
import css from './Menu.module.css';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
12
|
+
|
|
13
|
+
export type MenuOption = {
|
|
14
|
+
key?: string,
|
|
15
|
+
label: string,
|
|
16
|
+
iconLeft?: string,
|
|
17
|
+
iconRight?: string,
|
|
18
|
+
disabled?: boolean,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type MenuProps = {
|
|
22
|
+
options: Array<MenuOption>,
|
|
23
|
+
onSelect?: (option: MenuOption) => mixed,
|
|
24
|
+
selectedOption?: MenuOption,
|
|
25
|
+
classNames?: ClassNames,
|
|
26
|
+
size?: 'medium' | 'small',
|
|
27
|
+
width?: string,
|
|
28
|
+
menuDisabled?: boolean,
|
|
29
|
+
isFluid?: boolean,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Menu = (props: MenuProps): React.Node => {
|
|
33
|
+
const {
|
|
34
|
+
options,
|
|
35
|
+
onSelect,
|
|
36
|
+
selectedOption,
|
|
37
|
+
classNames,
|
|
38
|
+
size = 'medium',
|
|
39
|
+
width,
|
|
40
|
+
menuDisabled,
|
|
41
|
+
isFluid = true,
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div
|
|
46
|
+
className={classify(css.menuCard, classNames?.wrapper, {
|
|
47
|
+
[css.fluid]: isFluid,
|
|
48
|
+
[css.medium]: size === 'medium',
|
|
49
|
+
[css.small]: size === 'small',
|
|
50
|
+
})}
|
|
51
|
+
style={{width}}
|
|
52
|
+
>
|
|
53
|
+
{options.map(({key, label, iconLeft, iconRight, disabled}) => (
|
|
54
|
+
<UnstyledButton
|
|
55
|
+
className={classify(css.option, {
|
|
56
|
+
[css.selected]: key === selectedOption?.key,
|
|
57
|
+
[css.optionSmall]: size === 'small',
|
|
58
|
+
[css.optionMedium]: size === 'medium',
|
|
59
|
+
[css.disabled]: menuDisabled || disabled,
|
|
60
|
+
[css.withIconLeft]: !!iconLeft,
|
|
61
|
+
[css.withIconRight]: !!iconRight,
|
|
62
|
+
})}
|
|
63
|
+
key={key}
|
|
64
|
+
disabled={menuDisabled || disabled}
|
|
65
|
+
onClick={() => onSelect && onSelect({key, label})}
|
|
66
|
+
autoFocus={selectedOption?.key === key}
|
|
67
|
+
>
|
|
68
|
+
{!!iconLeft && (
|
|
69
|
+
<Icon name={iconLeft} size="small" className={css.icon} />
|
|
70
|
+
)}
|
|
71
|
+
|
|
72
|
+
<span className={css.optionText}>{label}</span>
|
|
73
|
+
|
|
74
|
+
{!!iconRight && (
|
|
75
|
+
<Icon
|
|
76
|
+
name={iconRight}
|
|
77
|
+
size="small"
|
|
78
|
+
className={classify(css.icon, css.rightIcon)}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
</UnstyledButton>
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
@value (
|
|
2
|
+
borderWidthPrimary,
|
|
3
|
+
borderRadiusMedium,
|
|
4
|
+
borderRadiusSmall
|
|
5
|
+
) from '../../styles/variables/_border.css';
|
|
6
|
+
|
|
7
|
+
@value (
|
|
8
|
+
colorBackgroundSecondary,
|
|
9
|
+
colorFillSecondary,
|
|
10
|
+
colorTextDisabled,
|
|
11
|
+
colorTextPrimary,
|
|
12
|
+
colorTextSecondary,
|
|
13
|
+
colorBackgroundTertiary
|
|
14
|
+
) from '../../styles/variables/_color.css';
|
|
15
|
+
|
|
16
|
+
@value (
|
|
17
|
+
colorBorderPrimary
|
|
18
|
+
) from '../../styles/variables/_color.css';
|
|
19
|
+
|
|
20
|
+
@value (
|
|
21
|
+
size160,
|
|
22
|
+
size42,
|
|
23
|
+
size34,
|
|
24
|
+
size300,
|
|
25
|
+
size240,
|
|
26
|
+
size228,
|
|
27
|
+
size276,
|
|
28
|
+
sizeFluid
|
|
29
|
+
) from '../../styles/variables/_size.css';
|
|
30
|
+
|
|
31
|
+
@value (
|
|
32
|
+
spaceNone,
|
|
33
|
+
spaceSmall,
|
|
34
|
+
spaceXSmall
|
|
35
|
+
) from '../../styles/variables/_space.css';
|
|
36
|
+
|
|
37
|
+
.menuCard {
|
|
38
|
+
composes: boxShadow2 from '../../styles/shadow.module.css';
|
|
39
|
+
composes: borderPrimary from '../../styles/border.module.css';
|
|
40
|
+
background-color: colorBackgroundTertiary;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-flow: column;
|
|
43
|
+
padding: spaceSmall spaceXSmall;
|
|
44
|
+
min-width: size160;
|
|
45
|
+
border-radius: borderRadiusMedium;
|
|
46
|
+
overflow: auto;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.medium {
|
|
50
|
+
width: size300;
|
|
51
|
+
min-width: size300;
|
|
52
|
+
max-height: size276;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.small {
|
|
56
|
+
width: size240;
|
|
57
|
+
min-width: size240;
|
|
58
|
+
max-height: size228;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.fluid {
|
|
62
|
+
width: sizeFluid;
|
|
63
|
+
min-width: size160;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.option {
|
|
67
|
+
composes: motionEaseInEaseOut from '../../styles/animation.module.css';
|
|
68
|
+
flex: 0 0 auto;
|
|
69
|
+
width: sizeFluid;
|
|
70
|
+
display: flex;
|
|
71
|
+
border-radius: borderRadiusSmall;
|
|
72
|
+
padding: spaceNone spaceSmall;
|
|
73
|
+
align-items: center;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
column-gap: spaceSmall;
|
|
76
|
+
color: colorTextSecondary;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.optionText {
|
|
80
|
+
composes: truncate from '../../styles/typography.module.css';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.withIconLeft {
|
|
84
|
+
padding-left: spaceXSmall;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.withIconRight {
|
|
88
|
+
padding-right: spaceXSmall;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.icon {
|
|
92
|
+
color: inherit;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.rightIcon {
|
|
96
|
+
margin-left: auto;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.optionSmall {
|
|
100
|
+
composes: buttonTextSmall from '../../styles/typography.module.css';
|
|
101
|
+
height: size34;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.optionMedium {
|
|
105
|
+
composes: buttonTextMedium from '../../styles/typography.module.css';
|
|
106
|
+
height: size42;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.option:hover,
|
|
110
|
+
.option:active {
|
|
111
|
+
background: colorBackgroundSecondary;
|
|
112
|
+
color: colorTextPrimary;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.option:focus {
|
|
116
|
+
background: colorFillSecondary;
|
|
117
|
+
outline: none;
|
|
118
|
+
color: colorTextPrimary;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.disabled {
|
|
122
|
+
color: colorTextDisabled;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|