@react-ui-org/react-ui 0.64.1 → 0.65.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/README.md +3 -6
- package/dist/react-ui.css +16 -16
- package/dist/react-ui.d.ts +1928 -0
- package/dist/react-ui.development.css +2916 -2915
- package/dist/react-ui.development.js +2019 -1051
- package/dist/react-ui.js +1 -1
- package/package.json +74 -70
- package/src/components/Alert/{Alert.jsx → Alert.tsx} +8 -43
- package/src/components/Alert/Alert.types.ts +34 -0
- package/src/components/Alert/README.md +1 -1
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Badge/Badge.tsx +30 -0
- package/src/components/Badge/Badge.types.ts +24 -0
- package/src/components/Badge/README.md +1 -1
- package/src/components/Badge/index.ts +5 -0
- package/src/components/Button/Button.tsx +110 -0
- package/src/components/Button/Button.types.ts +93 -0
- package/src/components/Button/README.md +1 -1
- package/src/components/Button/helpers/{getRootLabelVisibilityClassName.js → getRootLabelVisibilityClassName.ts} +4 -1
- package/src/components/Button/index.ts +6 -0
- package/src/components/ButtonGroup/{ButtonGroup.jsx → ButtonGroup.tsx} +9 -40
- package/src/components/ButtonGroup/ButtonGroup.types.ts +45 -0
- package/src/components/ButtonGroup/ButtonGroupContext.ts +4 -0
- package/src/components/ButtonGroup/README.md +1 -1
- package/src/components/ButtonGroup/{index.js → index.ts} +4 -0
- package/src/components/Card/Card.tsx +33 -0
- package/src/components/Card/Card.types.ts +46 -0
- package/src/components/Card/{CardBody.jsx → CardBody.tsx} +4 -11
- package/src/components/Card/{CardFooter.jsx → CardFooter.tsx} +4 -15
- package/src/components/Card/README.md +6 -7
- package/src/components/Card/{index.js → index.ts} +5 -0
- package/src/components/CheckboxField/CheckboxField.tsx +81 -0
- package/src/components/CheckboxField/CheckboxField.types.ts +63 -0
- package/src/components/CheckboxField/README.md +67 -42
- package/src/components/CheckboxField/index.ts +5 -0
- package/src/components/FileInputField/{FileInputField.jsx → FileInputField.tsx} +42 -128
- package/src/components/FileInputField/FileInputField.types.ts +100 -0
- package/src/components/FileInputField/README.md +1 -1
- package/src/components/FileInputField/index.ts +6 -0
- package/src/components/FormLayout/FormLayout.module.scss +1 -1
- package/src/components/FormLayout/{FormLayout.jsx → FormLayout.tsx} +15 -50
- package/src/components/FormLayout/FormLayout.types.ts +55 -0
- package/src/components/FormLayout/FormLayoutContext.ts +4 -0
- package/src/components/FormLayout/{FormLayoutCustomField.jsx → FormLayoutCustomField.tsx} +10 -65
- package/src/components/FormLayout/FormLayoutCustomField.types.ts +59 -0
- package/src/components/FormLayout/FormLayoutCustomFieldContext.ts +4 -0
- package/src/components/FormLayout/README.md +4 -6
- package/src/components/FormLayout/index.ts +14 -0
- package/src/components/Grid/Grid.module.scss +1 -1
- package/src/components/Grid/Grid.tsx +50 -0
- package/src/components/Grid/Grid.types.ts +108 -0
- package/src/components/Grid/GridSpan.tsx +36 -0
- package/src/components/Grid/README.md +2 -2
- package/src/components/Grid/_helpers/generateResponsiveCustomProperties.ts +32 -0
- package/src/components/Grid/index.ts +9 -0
- package/src/components/InputGroup/{InputGroup.jsx → InputGroup.tsx} +25 -89
- package/src/components/InputGroup/InputGroup.types.ts +80 -0
- package/src/components/InputGroup/InputGroupContext.ts +4 -0
- package/src/components/InputGroup/README.md +5 -1
- package/src/components/InputGroup/{index.js → index.ts} +4 -0
- package/src/components/Modal/Modal.tsx +172 -0
- package/src/components/Modal/Modal.types.ts +181 -0
- package/src/components/Modal/ModalBody.tsx +34 -0
- package/src/components/Modal/{ModalCloseButton.jsx → ModalCloseButton.tsx} +6 -19
- package/src/components/Modal/{ModalContent.jsx → ModalContent.tsx} +4 -15
- package/src/components/Modal/ModalFooter.tsx +27 -0
- package/src/components/Modal/ModalHeader.tsx +27 -0
- package/src/components/Modal/ModalTitle.tsx +29 -0
- package/src/components/Modal/README.md +9 -9
- package/src/components/Modal/_helpers/{dialogOnCancelHandler.js → dialogOnCancelHandler.ts} +11 -1
- package/src/components/Modal/_helpers/{dialogOnClickHandler.js → dialogOnClickHandler.ts} +13 -7
- package/src/components/Modal/_helpers/{dialogOnCloseHandler.js → dialogOnCloseHandler.ts} +11 -1
- package/src/components/Modal/_helpers/{dialogOnKeyDownHandler.js → dialogOnKeyDownHandler.ts} +19 -6
- package/src/components/Modal/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
- package/src/components/Modal/_helpers/getPositionClassName.ts +10 -0
- package/src/components/Modal/_helpers/getScrollingClassName.ts +14 -0
- package/src/components/Modal/_helpers/{getSizeClassName.js → getSizeClassName.ts} +4 -1
- package/src/components/Modal/_hooks/{useModalFocus.js → useModalFocus.ts} +9 -5
- package/src/components/Modal/_hooks/{useModalScrollPrevention.js → useModalScrollPrevention.ts} +4 -1
- package/src/components/Modal/{index.js → index.ts} +14 -0
- package/src/components/Paper/{Paper.jsx → Paper.tsx} +6 -26
- package/src/components/Paper/Paper.types.ts +19 -0
- package/src/components/Paper/README.md +3 -4
- package/src/components/Paper/index.ts +2 -0
- package/src/components/Popover/Popover.module.scss +1 -1
- package/src/components/Popover/Popover.tsx +61 -0
- package/src/components/Popover/Popover.types.ts +75 -0
- package/src/components/Popover/PopoverWrapper.tsx +27 -0
- package/src/components/Popover/README.md +34 -22
- package/src/components/Popover/_helpers/{cleanPlacementStyle.js → cleanPlacementStyle.ts} +4 -1
- package/src/components/Popover/_helpers/{getRootAlignmentClassName.js → getRootAlignmentClassName.ts} +4 -1
- package/src/components/Popover/_helpers/{getRootSideClassName.js → getRootSideClassName.ts} +4 -1
- package/src/components/Popover/index.ts +8 -0
- package/src/components/Radio/README.md +85 -45
- package/src/components/Radio/{Radio.jsx → Radio.tsx} +11 -107
- package/src/components/Radio/Radio.types.ts +90 -0
- package/src/components/Radio/index.ts +5 -0
- package/src/components/ScrollView/README.md +1 -1
- package/src/components/ScrollView/ScrollView.module.scss +5 -0
- package/src/components/ScrollView/{ScrollView.jsx → ScrollView.tsx} +55 -166
- package/src/components/ScrollView/ScrollView.types.ts +121 -0
- package/src/components/ScrollView/_helpers/getElementsPositionDifference.ts +17 -0
- package/src/components/ScrollView/_hooks/{useLoadResizeHook.js → useLoadResizeHook.ts} +14 -3
- package/src/components/ScrollView/_hooks/{useScrollPositionHook.js → useScrollPositionHook.ts} +11 -4
- package/src/components/ScrollView/index.ts +6 -0
- package/src/components/SelectField/README.md +84 -45
- package/src/components/SelectField/SelectField.tsx +139 -0
- package/src/components/SelectField/SelectField.types.ts +120 -0
- package/src/components/SelectField/_components/Option/Option.tsx +19 -0
- package/src/components/SelectField/_components/Option/Option.types.ts +21 -0
- package/src/components/SelectField/_components/Option/index.ts +2 -0
- package/src/components/SelectField/index.ts +7 -0
- package/src/components/Table/README.md +1 -1
- package/src/components/Table/{Table.jsx → Table.tsx} +4 -43
- package/src/components/Table/Table.types.ts +51 -0
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.tsx +20 -0
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.types.ts +20 -0
- package/src/components/Table/_components/TableBodyCell/index.ts +2 -0
- package/src/components/Table/_components/TableHeaderCell/{TableHeaderCell.jsx → TableHeaderCell.tsx} +3 -34
- package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.types.ts +20 -0
- package/src/components/Table/_components/TableHeaderCell/index.ts +2 -0
- package/src/components/Table/index.ts +8 -0
- package/src/components/Tabs/README.md +2 -2
- package/src/components/Tabs/{Tabs.jsx → Tabs.tsx} +4 -20
- package/src/components/Tabs/Tabs.types.ts +19 -0
- package/src/components/Tabs/TabsItem.tsx +49 -0
- package/src/components/Tabs/TabsItem.types.ts +42 -0
- package/src/components/Tabs/index.ts +4 -0
- package/src/components/Text/README.md +1 -1
- package/src/components/Text/Text.module.scss +5 -7
- package/src/components/Text/Text.tsx +46 -0
- package/src/components/Text/Text.types.ts +31 -0
- package/src/components/Text/_helpers/getRootClampClassName.ts +13 -0
- package/src/components/Text/_helpers/getRootHyphensClassName.ts +14 -0
- package/src/components/Text/_helpers/getRootWordWrappingClassName.ts +14 -0
- package/src/components/Text/index.ts +6 -0
- package/src/components/TextArea/README.md +5 -8
- package/src/components/TextArea/TextArea.tsx +95 -0
- package/src/components/TextArea/TextArea.types.ts +75 -0
- package/src/components/TextArea/index.ts +5 -0
- package/src/components/TextField/README.md +5 -7
- package/src/components/TextField/TextField.tsx +112 -0
- package/src/components/TextField/TextField.types.ts +94 -0
- package/src/components/TextField/index.ts +6 -0
- package/src/components/TextLink/README.md +1 -1
- package/src/components/TextLink/{TextLink.jsx → TextLink.tsx} +4 -15
- package/src/components/TextLink/TextLink.types.ts +12 -0
- package/src/components/TextLink/index.ts +2 -0
- package/src/components/Toggle/README.md +67 -42
- package/src/components/Toggle/Toggle.tsx +82 -0
- package/src/components/Toggle/Toggle.types.ts +58 -0
- package/src/components/Toggle/index.ts +5 -0
- package/src/components/Toolbar/README.md +3 -3
- package/src/components/Toolbar/Toolbar.tsx +41 -0
- package/src/components/Toolbar/Toolbar.types.ts +74 -0
- package/src/components/Toolbar/ToolbarGroup.tsx +38 -0
- package/src/components/Toolbar/{ToolbarItem.jsx → ToolbarItem.tsx} +5 -21
- package/src/components/Toolbar/_helpers/{getAlignClassName.js → getAlignClassName.ts} +8 -1
- package/src/components/Toolbar/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
- package/src/components/Toolbar/{index.js → index.ts} +7 -0
- package/src/components/_helpers/{getRootColorClassName.js → getRootColorClassName.ts} +6 -1
- package/src/components/_helpers/{getRootPriorityClassName.js → getRootPriorityClassName.ts} +6 -1
- package/src/components/_helpers/{getRootSizeClassName.js → getRootSizeClassName.ts} +6 -1
- package/src/components/_helpers/{getRootValidationStateClassName.js → getRootValidationStateClassName.ts} +6 -1
- package/src/components/_helpers/resolveContextOrProp.ts +13 -0
- package/src/helpers/classNames/{classNames.js → classNames.ts} +2 -2
- package/src/helpers/isChildrenEmpty/isChildrenEmpty.ts +5 -0
- package/src/helpers/transferProps/transferProps.ts +50 -0
- package/src/helpers/transferProps/transferProps.types.ts +11 -0
- package/src/index.ts +211 -0
- package/src/providers/globalProps/GlobalProps.types.ts +30 -0
- package/src/providers/globalProps/GlobalPropsContext.ts +6 -0
- package/src/providers/globalProps/{GlobalPropsProvider.jsx → GlobalPropsProvider.tsx} +8 -15
- package/src/providers/globalProps/{index.js → index.ts} +4 -0
- package/src/providers/globalProps/withGlobalProps.tsx +36 -0
- package/src/providers/translations/Translations.types.ts +26 -0
- package/src/providers/translations/TranslationsContext.ts +7 -0
- package/src/providers/translations/{TranslationsProvider.jsx → TranslationsProvider.tsx} +8 -15
- package/src/providers/translations/{index.js → index.ts} +5 -0
- package/src/styles/tools/_accessibility.scss +2 -2
- package/src/translations/{en.js → en.ts} +3 -1
- package/src/types/breakpoints.ts +1 -0
- package/src/types/colors.ts +7 -0
- package/src/types/index.ts +13 -0
- package/src/types/labelPositions.ts +1 -0
- package/src/types/layouts.ts +1 -0
- package/src/types/modules.d.ts +16 -0
- package/src/types/priorities.ts +1 -0
- package/src/types/sizes.ts +1 -0
- package/src/types/styles.ts +4 -0
- package/src/types/validationStates.ts +1 -0
- package/src/utils/mergeDeep.ts +34 -0
- package/src/utils/mergeDeep.types.ts +4 -0
- package/.claude/agents/code-reviewer.md +0 -122
- package/.claude/rules/code.md +0 -22
- package/.claude/rules/docs.md +0 -35
- package/.claude/rules/frontend.md +0 -72
- package/.claude/rules/git.md +0 -13
- package/.claude/rules/safety-guards.md +0 -9
- package/.claude/rules/styling.md +0 -32
- package/.claude/rules/testing.md +0 -59
- package/.claude/settings.json +0 -32
- package/.claude/skills/commit/SKILL.md +0 -54
- package/.devcontainer/devcontainer.json +0 -23
- package/.eslintrc-ts +0 -40
- package/.mcp.json +0 -8
- package/.nvmrc +0 -1
- package/CLAUDE.md +0 -82
- package/docker-compose.base.yml +0 -93
- package/docker-compose.yml.dist +0 -41
- package/jest.config-ts.js +0 -34
- package/opencode.json +0 -10
- package/playwright-ct.config.ts +0 -68
- package/scripts/auto-start-mkdocs.sh +0 -5
- package/scripts/auto-start-node.sh +0 -33
- package/scripts/mcps/chrome-host/README.md +0 -118
- package/scripts/mcps/chrome-host/cdp_proxy.py +0 -90
- package/scripts/mcps/chrome-host/mcp-entry.sh +0 -33
- package/scripts/mcps/chrome-host/mcp-launch.sh +0 -36
- package/scripts/mcps/chrome-host/mcp-setup.sh +0 -70
- package/scripts/mcps/chrome-host/start-host-chrome.sh +0 -267
- package/setup.sh +0 -107
- package/src/CNAME +0 -1
- package/src/components/Alert/index.js +0 -1
- package/src/components/Badge/Badge.jsx +0 -51
- package/src/components/Badge/index.js +0 -1
- package/src/components/Button/Button.jsx +0 -203
- package/src/components/Button/helpers/getRootPriorityClassName.js +0 -15
- package/src/components/Button/index.js +0 -1
- package/src/components/ButtonGroup/ButtonGroupContext.js +0 -3
- package/src/components/Card/Card.jsx +0 -67
- package/src/components/CheckboxField/CheckboxField.jsx +0 -144
- package/src/components/CheckboxField/index.js +0 -1
- package/src/components/FileInputField/index.js +0 -1
- package/src/components/FormLayout/FormLayoutContext.js +0 -3
- package/src/components/FormLayout/FormLayoutCustomFieldContext.js +0 -3
- package/src/components/FormLayout/index.js +0 -4
- package/src/components/Grid/Grid.jsx +0 -225
- package/src/components/Grid/GridSpan.jsx +0 -88
- package/src/components/Grid/_helpers/generateResponsiveCustomProperties.js +0 -22
- package/src/components/Grid/index.js +0 -2
- package/src/components/InputGroup/InputGroupContext.js +0 -3
- package/src/components/Modal/Modal.jsx +0 -262
- package/src/components/Modal/ModalBody.jsx +0 -60
- package/src/components/Modal/ModalFooter.jsx +0 -42
- package/src/components/Modal/ModalHeader.jsx +0 -42
- package/src/components/Modal/ModalTitle.jsx +0 -42
- package/src/components/Modal/_helpers/getPositionClassName.js +0 -7
- package/src/components/Modal/_helpers/getScrollingClassName.js +0 -11
- package/src/components/Paper/index.js +0 -1
- package/src/components/Popover/Popover.jsx +0 -124
- package/src/components/Popover/PopoverWrapper.jsx +0 -38
- package/src/components/Popover/index.js +0 -2
- package/src/components/Radio/index.js +0 -1
- package/src/components/ScrollView/_helpers/getElementsPositionDifference.js +0 -11
- package/src/components/ScrollView/index.js +0 -1
- package/src/components/SelectField/SelectField.jsx +0 -272
- package/src/components/SelectField/_components/Option/Option.jsx +0 -46
- package/src/components/SelectField/_components/Option/index.js +0 -1
- package/src/components/SelectField/index.js +0 -1
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -46
- package/src/components/Table/_components/TableBodyCell/index.js +0 -1
- package/src/components/Table/_components/TableHeaderCell/index.js +0 -1
- package/src/components/Table/index.js +0 -1
- package/src/components/Tabs/TabsItem.jsx +0 -91
- package/src/components/Tabs/index.js +0 -2
- package/src/components/Text/Text.jsx +0 -76
- package/src/components/Text/_helpers/getRootClampClassName.js +0 -11
- package/src/components/Text/_helpers/getRootHyphensClassName.js +0 -11
- package/src/components/Text/_helpers/getRootWordWrappingClassName.js +0 -11
- package/src/components/Text/index.js +0 -1
- package/src/components/TextArea/TextArea.jsx +0 -174
- package/src/components/TextArea/index.js +0 -1
- package/src/components/TextField/TextField.jsx +0 -208
- package/src/components/TextField/index.js +0 -1
- package/src/components/TextLink/index.js +0 -1
- package/src/components/Toggle/Toggle.jsx +0 -144
- package/src/components/Toggle/index.js +0 -1
- package/src/components/Toolbar/Toolbar.jsx +0 -76
- package/src/components/Toolbar/ToolbarGroup.jsx +0 -64
- package/src/components/_helpers/resolveContextOrProp.js +0 -10
- package/src/helpers/isChildrenEmpty/isChildrenEmpty.js +0 -3
- package/src/helpers/transferProps/transferProps.js +0 -38
- package/src/index.js +0 -67
- package/src/providers/globalProps/GlobalPropsContext.jsx +0 -5
- package/src/providers/globalProps/withGlobalProps.jsx +0 -38
- package/src/providers/translations/TranslationsContext.jsx +0 -6
- package/src/utils/mergeDeep.js +0 -28
- package/tsconfig.json +0 -27
- /package/src/helpers/classNames/{index.js → index.ts} +0 -0
- /package/src/helpers/isChildrenEmpty/{index.js → index.ts} +0 -0
- /package/src/helpers/transferProps/{index.js → index.ts} +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { withGlobalProps } from '../../providers/globalProps';
|
|
4
|
-
import { classNames } from '../../helpers/classNames/classNames';
|
|
5
|
-
import { transferProps } from '../../helpers/transferProps';
|
|
6
|
-
import { isChildrenEmpty } from '../../helpers/isChildrenEmpty/isChildrenEmpty';
|
|
7
|
-
import { getAlignClassName } from './_helpers/getAlignClassName';
|
|
8
|
-
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
|
9
|
-
import styles from './Toolbar.module.scss';
|
|
10
|
-
|
|
11
|
-
export const Toolbar = ({
|
|
12
|
-
align,
|
|
13
|
-
children,
|
|
14
|
-
dense,
|
|
15
|
-
justify,
|
|
16
|
-
nowrap,
|
|
17
|
-
...restProps
|
|
18
|
-
}) => {
|
|
19
|
-
if (isChildrenEmpty(children)) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div
|
|
25
|
-
{...transferProps(restProps)}
|
|
26
|
-
className={classNames(
|
|
27
|
-
styles.toolbar,
|
|
28
|
-
dense && styles.isToolbarDense,
|
|
29
|
-
nowrap && styles.isToolbarNowrap,
|
|
30
|
-
getAlignClassName(align, styles, 'toolbar'),
|
|
31
|
-
getJustifyClassName(justify, styles),
|
|
32
|
-
)}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
Toolbar.defaultProps = {
|
|
40
|
-
align: 'top',
|
|
41
|
-
children: undefined,
|
|
42
|
-
dense: false,
|
|
43
|
-
justify: 'start',
|
|
44
|
-
nowrap: false,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
Toolbar.propTypes = {
|
|
48
|
-
/**
|
|
49
|
-
* Vertical alignment of toolbar items and groups.
|
|
50
|
-
*/
|
|
51
|
-
align: PropTypes.oneOf(['top', 'middle', 'bottom', 'baseline']),
|
|
52
|
-
/**
|
|
53
|
-
* Nested elements. Supported types are:
|
|
54
|
-
* * `ToolbarItems`
|
|
55
|
-
* * `ToolbarGroups`
|
|
56
|
-
*
|
|
57
|
-
* If none are provided nothing is rendered.
|
|
58
|
-
*/
|
|
59
|
-
children: PropTypes.node,
|
|
60
|
-
/**
|
|
61
|
-
* If `true`, spacing of all toolbar items in the toolbar will be reduced.
|
|
62
|
-
*/
|
|
63
|
-
dense: PropTypes.bool,
|
|
64
|
-
/**
|
|
65
|
-
* Horizontal alignment (distribution) of toolbar items and groups.
|
|
66
|
-
*/
|
|
67
|
-
justify: PropTypes.oneOf(['start', 'center', 'end', 'space-between']),
|
|
68
|
-
/**
|
|
69
|
-
* If set, the toolbar will not wrap.
|
|
70
|
-
*/
|
|
71
|
-
nowrap: PropTypes.bool,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const ToolbarWithGlobalProps = withGlobalProps(Toolbar, 'Toolbar');
|
|
75
|
-
|
|
76
|
-
export default ToolbarWithGlobalProps;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { withGlobalProps } from '../../providers/globalProps';
|
|
4
|
-
import { classNames } from '../../helpers/classNames/classNames';
|
|
5
|
-
import { transferProps } from '../../helpers/transferProps';
|
|
6
|
-
import { isChildrenEmpty } from '../../helpers/isChildrenEmpty/isChildrenEmpty';
|
|
7
|
-
import { getAlignClassName } from './_helpers/getAlignClassName';
|
|
8
|
-
import styles from './Toolbar.module.scss';
|
|
9
|
-
|
|
10
|
-
export const ToolbarGroup = ({
|
|
11
|
-
align,
|
|
12
|
-
children,
|
|
13
|
-
dense,
|
|
14
|
-
nowrap,
|
|
15
|
-
...restProps
|
|
16
|
-
}) => {
|
|
17
|
-
if (isChildrenEmpty(children)) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div
|
|
23
|
-
{...transferProps(restProps)}
|
|
24
|
-
className={classNames(
|
|
25
|
-
styles.group,
|
|
26
|
-
dense && styles.isGroupDense,
|
|
27
|
-
nowrap && styles.isGroupNowrap,
|
|
28
|
-
getAlignClassName(align, styles, 'group'),
|
|
29
|
-
)}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
ToolbarGroup.defaultProps = {
|
|
37
|
-
align: 'top',
|
|
38
|
-
children: undefined,
|
|
39
|
-
dense: false,
|
|
40
|
-
nowrap: false,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
ToolbarGroup.propTypes = {
|
|
44
|
-
/**
|
|
45
|
-
* Vertical alignment of toolbar items in the group.
|
|
46
|
-
*/
|
|
47
|
-
align: PropTypes.oneOf(['top', 'middle', 'bottom', 'baseline']),
|
|
48
|
-
/**
|
|
49
|
-
* Grouped ToolbarItems. If none are provided nothing is rendered.
|
|
50
|
-
*/
|
|
51
|
-
children: PropTypes.node,
|
|
52
|
-
/**
|
|
53
|
-
* If `true`, spacing of toolbar items in the group will be reduced.
|
|
54
|
-
*/
|
|
55
|
-
dense: PropTypes.bool,
|
|
56
|
-
/**
|
|
57
|
-
* If set, the toolbar group will not wrap.
|
|
58
|
-
*/
|
|
59
|
-
nowrap: PropTypes.bool,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const ToolbarGroupWithGlobalProps = withGlobalProps(ToolbarGroup, 'ToolbarGroup');
|
|
63
|
-
|
|
64
|
-
export default ToolbarGroupWithGlobalProps;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const resolveContextOrProp = (contextValue, propValue) => {
|
|
2
|
-
// We need to test:
|
|
3
|
-
// * `false` - for when the `contextValue` is boolean
|
|
4
|
-
// * `null` - for when the `contextValue` is non-boolean
|
|
5
|
-
if (contextValue === false || contextValue === null) {
|
|
6
|
-
return propValue;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return contextValue;
|
|
10
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param props The props that were passed to the React component and were not used by it
|
|
3
|
-
* @returns The props to be passed to the HTML element
|
|
4
|
-
*/
|
|
5
|
-
export const transferProps = (props) => {
|
|
6
|
-
const {
|
|
7
|
-
children,
|
|
8
|
-
className,
|
|
9
|
-
contentEditable,
|
|
10
|
-
dangerouslySetInnerHTML,
|
|
11
|
-
ref,
|
|
12
|
-
staticContext,
|
|
13
|
-
style,
|
|
14
|
-
suppressContentEditableWarning,
|
|
15
|
-
...restProps
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
18
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
19
|
-
const invalidProps = [
|
|
20
|
-
'children', // It is always either handled by the component itself or not supported.
|
|
21
|
-
'className', // Classes are set by component authors, changing it arbitrarily might break things.
|
|
22
|
-
'contentEditable', // Components are either interactive or not, changing it arbitrarily might break things.
|
|
23
|
-
'dangerouslySetInnerHTML', // This might break things and allow for XSS attacks.
|
|
24
|
-
'ref', // Forwarding `ref` is hardcoded and documented for each component.
|
|
25
|
-
'staticContext', // In `react-router` (v4, v5) this is used during server side rendering, it makes no sense to pass it to a component.
|
|
26
|
-
'style', // Styles are set by component authors, changing it arbitrarily might break things.
|
|
27
|
-
'suppressContentEditableWarning', // Since setting `contentEditable` is not allowed, this is not needed.
|
|
28
|
-
]
|
|
29
|
-
.filter((key) => props[key] !== undefined);
|
|
30
|
-
|
|
31
|
-
if (invalidProps.length > 0) {
|
|
32
|
-
// eslint-disable-next-line no-console
|
|
33
|
-
console.error(`Invalid prop(s) supplied to the "transferProps" function: "${invalidProps.join('", "')}"`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return restProps;
|
|
38
|
-
};
|
package/src/index.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Global definitions
|
|
2
|
-
// The styles need to be imported here to be placed in the distribution CSS file.
|
|
3
|
-
// Component styles are imported in the components themselves below.
|
|
4
|
-
import './index.scss';
|
|
5
|
-
|
|
6
|
-
// Components
|
|
7
|
-
export { Alert } from './components/Alert';
|
|
8
|
-
export { Badge } from './components/Badge';
|
|
9
|
-
export { Button } from './components/Button';
|
|
10
|
-
export { ButtonGroup } from './components/ButtonGroup';
|
|
11
|
-
export {
|
|
12
|
-
Card,
|
|
13
|
-
CardBody,
|
|
14
|
-
CardFooter,
|
|
15
|
-
} from './components/Card';
|
|
16
|
-
export { CheckboxField } from './components/CheckboxField';
|
|
17
|
-
export { FileInputField } from './components/FileInputField';
|
|
18
|
-
export {
|
|
19
|
-
FormLayout,
|
|
20
|
-
FormLayoutCustomField,
|
|
21
|
-
} from './components/FormLayout';
|
|
22
|
-
export {
|
|
23
|
-
Grid,
|
|
24
|
-
GridSpan,
|
|
25
|
-
} from './components/Grid';
|
|
26
|
-
export { InputGroup } from './components/InputGroup';
|
|
27
|
-
export {
|
|
28
|
-
Modal,
|
|
29
|
-
ModalBody,
|
|
30
|
-
ModalCloseButton,
|
|
31
|
-
ModalContent,
|
|
32
|
-
ModalFooter,
|
|
33
|
-
ModalHeader,
|
|
34
|
-
ModalTitle,
|
|
35
|
-
} from './components/Modal';
|
|
36
|
-
export { Paper } from './components/Paper';
|
|
37
|
-
export {
|
|
38
|
-
Popover,
|
|
39
|
-
PopoverWrapper,
|
|
40
|
-
} from './components/Popover';
|
|
41
|
-
export { Radio } from './components/Radio';
|
|
42
|
-
export { ScrollView } from './components/ScrollView';
|
|
43
|
-
export { SelectField } from './components/SelectField';
|
|
44
|
-
export {
|
|
45
|
-
Tabs,
|
|
46
|
-
TabsItem,
|
|
47
|
-
} from './components/Tabs';
|
|
48
|
-
export { Table } from './components/Table';
|
|
49
|
-
export { Text } from './components/Text';
|
|
50
|
-
export { TextArea } from './components/TextArea';
|
|
51
|
-
export { TextField } from './components/TextField';
|
|
52
|
-
export { TextLink } from './components/TextLink';
|
|
53
|
-
export { Toggle } from './components/Toggle';
|
|
54
|
-
export {
|
|
55
|
-
Toolbar,
|
|
56
|
-
ToolbarGroup,
|
|
57
|
-
ToolbarItem,
|
|
58
|
-
} from './components/Toolbar';
|
|
59
|
-
|
|
60
|
-
// Providers
|
|
61
|
-
export { GlobalPropsProvider } from './providers/globalProps';
|
|
62
|
-
export { TranslationsProvider } from './providers/translations';
|
|
63
|
-
|
|
64
|
-
// Helpers
|
|
65
|
-
export { classNames } from './helpers/classNames';
|
|
66
|
-
export { transferProps } from './helpers/transferProps';
|
|
67
|
-
export { isChildrenEmpty } from './helpers/isChildrenEmpty';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React, {
|
|
3
|
-
useContext,
|
|
4
|
-
} from 'react';
|
|
5
|
-
import GlobalPropsContext from './GlobalPropsContext';
|
|
6
|
-
|
|
7
|
-
export default (Component, componentName) => {
|
|
8
|
-
const WithGlobalPropsComponent = ({
|
|
9
|
-
forwardedRef,
|
|
10
|
-
...rest
|
|
11
|
-
}) => {
|
|
12
|
-
const contextGlobalProps = useContext(GlobalPropsContext);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Component
|
|
16
|
-
{...contextGlobalProps[componentName] || {}}
|
|
17
|
-
{...rest}
|
|
18
|
-
ref={forwardedRef}
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
WithGlobalPropsComponent.defaultProps = {
|
|
24
|
-
forwardedRef: undefined,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
WithGlobalPropsComponent.propTypes = {
|
|
28
|
-
forwardedRef: PropTypes.oneOfType([
|
|
29
|
-
PropTypes.func,
|
|
30
|
-
|
|
31
|
-
// The props can be of any type and here we need to support them all
|
|
32
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
33
|
-
PropTypes.shape({ current: PropTypes.any }),
|
|
34
|
-
]),
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return React.forwardRef((props, ref) => (<WithGlobalPropsComponent {...props} forwardedRef={ref} />));
|
|
38
|
-
};
|
package/src/utils/mergeDeep.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const isObject = (obj) => obj && typeof obj === 'object' && !Array.isArray(obj);
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Performs a deep merge of objects and returns new object.
|
|
5
|
-
*
|
|
6
|
-
* @param {...object} objects
|
|
7
|
-
* @returns {object}
|
|
8
|
-
*/
|
|
9
|
-
export const mergeDeep = (...objects) => objects.reduce((prev, obj) => {
|
|
10
|
-
if (obj == null) {
|
|
11
|
-
return prev;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const newObject = { ...prev };
|
|
15
|
-
|
|
16
|
-
Object.keys(obj).forEach((key) => {
|
|
17
|
-
const previousVal = prev[key];
|
|
18
|
-
const currentVal = obj[key];
|
|
19
|
-
|
|
20
|
-
if (isObject(previousVal) && isObject(currentVal)) {
|
|
21
|
-
newObject[key] = mergeDeep(previousVal, currentVal);
|
|
22
|
-
} else {
|
|
23
|
-
newObject[key] = currentVal;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return newObject;
|
|
28
|
-
}, {});
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"lib": [
|
|
5
|
-
"dom",
|
|
6
|
-
"dom.iterable",
|
|
7
|
-
"esnext"
|
|
8
|
-
],
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"allowSyntheticDefaultImports": true,
|
|
13
|
-
"strict": false,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"noFallthroughCasesInSwitch": true,
|
|
16
|
-
"module": "esnext",
|
|
17
|
-
"moduleResolution": "node",
|
|
18
|
-
"resolveJsonModule": true,
|
|
19
|
-
"isolatedModules": true,
|
|
20
|
-
"noEmit": false,
|
|
21
|
-
"jsx": "react-jsx"
|
|
22
|
-
},
|
|
23
|
-
"include": [
|
|
24
|
-
"src",
|
|
25
|
-
"tests"
|
|
26
|
-
]
|
|
27
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|