@react-ui-org/react-ui 0.64.1 → 0.66.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 +1936 -0
- package/dist/react-ui.development.css +3591 -3003
- package/dist/react-ui.development.js +2028 -1060
- 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} +5 -2
- 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.module.scss +7 -3
- package/src/components/CheckboxField/CheckboxField.tsx +81 -0
- package/src/components/CheckboxField/CheckboxField.types.ts +64 -0
- package/src/components/CheckboxField/README.md +92 -45
- package/src/components/CheckboxField/index.ts +5 -0
- package/src/components/FileInputField/FileInputField.module.scss +7 -3
- package/src/components/FileInputField/{FileInputField.jsx → FileInputField.tsx} +43 -129
- package/src/components/FileInputField/FileInputField.types.ts +101 -0
- package/src/components/FileInputField/README.md +21 -4
- package/src/components/FileInputField/index.ts +6 -0
- package/src/components/FormLayout/FormLayout.module.scss +5 -7
- 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.module.scss +7 -3
- package/src/components/FormLayout/{FormLayoutCustomField.jsx → FormLayoutCustomField.tsx} +12 -67
- package/src/components/FormLayout/FormLayoutCustomField.types.ts +60 -0
- package/src/components/FormLayout/FormLayoutCustomFieldContext.ts +4 -0
- package/src/components/FormLayout/README.md +6 -15
- 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 +33 -0
- package/src/components/Grid/index.ts +9 -0
- package/src/components/InputGroup/InputGroup.module.scss +7 -3
- package/src/components/InputGroup/{InputGroup.jsx → InputGroup.tsx} +25 -95
- package/src/components/InputGroup/InputGroup.types.ts +80 -0
- package/src/components/InputGroup/InputGroupContext.ts +4 -0
- package/src/components/InputGroup/README.md +40 -8
- 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 +125 -48
- package/src/components/Radio/Radio.module.scss +7 -3
- package/src/components/Radio/Radio.tsx +116 -0
- package/src/components/Radio/Radio.types.ts +91 -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 +137 -51
- package/src/components/SelectField/SelectField.module.scss +7 -3
- package/src/components/SelectField/SelectField.tsx +139 -0
- package/src/components/SelectField/SelectField.types.ts +121 -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 +35 -14
- package/src/components/TextArea/TextArea.module.scss +7 -3
- package/src/components/TextArea/TextArea.tsx +95 -0
- package/src/components/TextArea/TextArea.types.ts +76 -0
- package/src/components/TextArea/index.ts +5 -0
- package/src/components/TextField/README.md +35 -13
- package/src/components/TextField/TextField.module.scss +7 -3
- package/src/components/TextField/TextField.tsx +112 -0
- package/src/components/TextField/TextField.types.ts +95 -0
- package/src/components/TextField/index.ts +6 -0
- package/src/components/TextLink/README.md +2 -2
- 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 +92 -45
- package/src/components/Toggle/Toggle.module.scss +7 -3
- package/src/components/Toggle/Toggle.tsx +82 -0
- package/src/components/Toggle/Toggle.types.ts +59 -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} +7 -2
- package/src/components/_helpers/{getRootPriorityClassName.js → getRootPriorityClassName.ts} +7 -2
- package/src/components/_helpers/{getRootSizeClassName.js → getRootSizeClassName.ts} +7 -2
- package/src/components/_helpers/getRootStateClassName.ts +24 -0
- 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/settings/_form-fields.scss +2 -1
- package/src/styles/theme/_form-fields.scss +16 -11
- package/src/styles/theme-constants/_colors.scss +21 -0
- package/src/styles/tools/_accessibility.scss +2 -2
- package/src/styles/tools/form-fields/_box-field-layout.scss +5 -8
- package/src/styles/tools/form-fields/_inline-field-elements.scss +0 -7
- package/src/styles/tools/form-fields/_inline-field-layout.scss +0 -8
- package/src/styles/tools/form-fields/_variants.scss +7 -7
- package/src/theme.scss +37 -12
- 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/states.ts +1 -0
- package/src/types/styles.ts +4 -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/Radio.jsx +0 -212
- 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/getRootValidationStateClassName.js +0 -15
- 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
|
@@ -256,7 +256,7 @@ helps to improve its accessibility.
|
|
|
256
256
|
|
|
257
257
|
## API
|
|
258
258
|
|
|
259
|
-
<docoff-react-props src="/components/Table/Table.
|
|
259
|
+
<docoff-react-props src="/components/Table/Table.tsx" name="Table"></docoff-react-props>
|
|
260
260
|
|
|
261
261
|
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
|
262
262
|
[table-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#attributes
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { withGlobalProps } from '../../providers/globalProps';
|
|
4
3
|
import { transferProps } from '../../helpers/transferProps';
|
|
5
4
|
import { TableHeaderCell } from './_components/TableHeaderCell';
|
|
6
5
|
import { TableBodyCell } from './_components/TableBodyCell';
|
|
7
6
|
import styles from './Table.module.scss';
|
|
7
|
+
import type { TableProps } from './Table.types';
|
|
8
8
|
|
|
9
|
-
export const Table = ({
|
|
9
|
+
export const Table: React.FunctionComponent<TableProps> = ({
|
|
10
10
|
columns,
|
|
11
11
|
id,
|
|
12
12
|
rows,
|
|
13
13
|
sort,
|
|
14
14
|
...restProps
|
|
15
|
-
}) => (
|
|
15
|
+
}: TableProps) => (
|
|
16
16
|
<table
|
|
17
17
|
{...transferProps(restProps)}
|
|
18
18
|
className={styles.table}
|
|
@@ -51,45 +51,6 @@ export const Table = ({
|
|
|
51
51
|
</table>
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
id: undefined,
|
|
56
|
-
sort: undefined,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
Table.propTypes = {
|
|
60
|
-
/**
|
|
61
|
-
* Table data columns, optionally sortable. The `format` function can be used to process the
|
|
62
|
-
* column data before displaying them.
|
|
63
|
-
*/
|
|
64
|
-
columns: PropTypes.arrayOf(PropTypes.shape({
|
|
65
|
-
format: PropTypes.func,
|
|
66
|
-
isSortable: PropTypes.bool,
|
|
67
|
-
label: PropTypes.string,
|
|
68
|
-
name: PropTypes.string.isRequired,
|
|
69
|
-
})).isRequired,
|
|
70
|
-
/**
|
|
71
|
-
* ID of the root HTML element. It also serves as base for nested elements:
|
|
72
|
-
* * `<ID>__headerCell__<COLUMN_NAME>`
|
|
73
|
-
* * `<ID>__headerCell__<COLUMN_NAME>__sortButton`
|
|
74
|
-
* * `<ID>__bodyCell__<COLUMN_NAME>__<ROW_ID>`
|
|
75
|
-
*/
|
|
76
|
-
id: PropTypes.string,
|
|
77
|
-
/**
|
|
78
|
-
* Table data rows, each object key must match a column `name`
|
|
79
|
-
*/
|
|
80
|
-
rows: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
|
81
|
-
/**
|
|
82
|
-
* Sorting configuration required to make columns sortable.
|
|
83
|
-
*/
|
|
84
|
-
sort: PropTypes.shape({
|
|
85
|
-
ascendingIcon: PropTypes.node.isRequired,
|
|
86
|
-
column: PropTypes.string.isRequired,
|
|
87
|
-
descendingIcon: PropTypes.node.isRequired,
|
|
88
|
-
direction: PropTypes.oneOf(['asc', 'desc']).isRequired,
|
|
89
|
-
onClick: PropTypes.func.isRequired,
|
|
90
|
-
}),
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const TableWithGlobalProps = withGlobalProps(Table, 'Table');
|
|
54
|
+
export const TableWithGlobalProps = withGlobalProps<TableProps, never>(Table, 'Table');
|
|
94
55
|
|
|
95
56
|
export default TableWithGlobalProps;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ReactNode,
|
|
3
|
+
TableHTMLAttributes,
|
|
4
|
+
} from 'react';
|
|
5
|
+
|
|
6
|
+
export type TableColumn = {
|
|
7
|
+
format?: (value: unknown) => ReactNode;
|
|
8
|
+
isSortable?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type TableRow = Record<string, unknown> & {
|
|
14
|
+
id: string | number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type TableSortDirection = 'asc' | 'desc';
|
|
18
|
+
|
|
19
|
+
export type TableSort = {
|
|
20
|
+
ascendingIcon: ReactNode;
|
|
21
|
+
column: string;
|
|
22
|
+
descendingIcon: ReactNode;
|
|
23
|
+
direction: TableSortDirection;
|
|
24
|
+
onClick: (column: string, direction: TableSortDirection) => void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Props of the `Table` component.
|
|
29
|
+
*/
|
|
30
|
+
export type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
31
|
+
/**
|
|
32
|
+
* Table data columns, optionally sortable. The `format` function can be used to process the
|
|
33
|
+
* column data before displaying them.
|
|
34
|
+
*/
|
|
35
|
+
columns: TableColumn[];
|
|
36
|
+
/**
|
|
37
|
+
* ID of the root HTML element. It also serves as base for nested elements:
|
|
38
|
+
* * `<ID>__headerCell__<COLUMN_NAME>`
|
|
39
|
+
* * `<ID>__headerCell__<COLUMN_NAME>__sortButton`
|
|
40
|
+
* * `<ID>__bodyCell__<COLUMN_NAME>__<ROW_ID>`
|
|
41
|
+
*/
|
|
42
|
+
id?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Table data rows, each object key must match a column `name`
|
|
45
|
+
*/
|
|
46
|
+
rows: TableRow[];
|
|
47
|
+
/**
|
|
48
|
+
* Sorting configuration required to make columns sortable.
|
|
49
|
+
*/
|
|
50
|
+
sort?: TableSort;
|
|
51
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import styles from '../TableCell.module.scss';
|
|
4
|
+
import type { TableBodyCellProps } from './TableBodyCell.types';
|
|
5
|
+
|
|
6
|
+
export const TableBodyCell: React.FunctionComponent<TableBodyCellProps> = ({
|
|
7
|
+
format,
|
|
8
|
+
id,
|
|
9
|
+
isSortingActive = false,
|
|
10
|
+
value,
|
|
11
|
+
}: TableBodyCellProps) => (
|
|
12
|
+
<td
|
|
13
|
+
className={isSortingActive ? styles.isTableCellSortingActive : styles.tableCell}
|
|
14
|
+
id={id}
|
|
15
|
+
>
|
|
16
|
+
{format ? format(value) : value as ReactNode}
|
|
17
|
+
</td>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default TableBodyCell;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TableColumn } from '../../Table.types';
|
|
2
|
+
|
|
3
|
+
export type TableBodyCellProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Function that can be used to process the column data before displaying them.
|
|
6
|
+
*/
|
|
7
|
+
format?: TableColumn['format'];
|
|
8
|
+
/**
|
|
9
|
+
* ID of the HTML <td> element:
|
|
10
|
+
*/
|
|
11
|
+
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, cell is gray marked as sorted.
|
|
14
|
+
*/
|
|
15
|
+
isSortingActive?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Cell value.
|
|
18
|
+
*/
|
|
19
|
+
value?: unknown;
|
|
20
|
+
};
|
package/src/components/Table/_components/TableHeaderCell/{TableHeaderCell.jsx → TableHeaderCell.tsx}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Button } from '../../../Button';
|
|
4
3
|
import styles from '../TableCell.module.scss';
|
|
4
|
+
import type { TableHeaderCellProps } from './TableHeaderCell.types';
|
|
5
5
|
|
|
6
|
-
export const TableHeaderCell = ({
|
|
6
|
+
export const TableHeaderCell: React.FunctionComponent<TableHeaderCellProps> = ({
|
|
7
7
|
column,
|
|
8
8
|
id,
|
|
9
9
|
sort,
|
|
10
|
-
}) => {
|
|
10
|
+
}: TableHeaderCellProps) => {
|
|
11
11
|
const sortDirection = sort && column.name === sort.column ? sort.direction : 'asc';
|
|
12
12
|
const isSortingActive = sort && column.name === sort.column;
|
|
13
13
|
|
|
@@ -40,35 +40,4 @@ export const TableHeaderCell = ({
|
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
TableHeaderCell.defaultProps = {
|
|
44
|
-
id: undefined,
|
|
45
|
-
sort: undefined,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
TableHeaderCell.propTypes = {
|
|
49
|
-
/**
|
|
50
|
-
* Table data column, optionally sortable. The `format` function can be used to process the
|
|
51
|
-
* column data before displaying them.
|
|
52
|
-
*/
|
|
53
|
-
column: PropTypes.shape({
|
|
54
|
-
isSortable: PropTypes.bool,
|
|
55
|
-
label: PropTypes.string,
|
|
56
|
-
name: PropTypes.string.isRequired,
|
|
57
|
-
}).isRequired,
|
|
58
|
-
/**
|
|
59
|
-
* ID of the HTML <th> element and nested button for sorting.
|
|
60
|
-
*/
|
|
61
|
-
id: PropTypes.string,
|
|
62
|
-
/**
|
|
63
|
-
* Sorting configuration required to make columns sortable.
|
|
64
|
-
*/
|
|
65
|
-
sort: PropTypes.shape({
|
|
66
|
-
ascendingIcon: PropTypes.node.isRequired,
|
|
67
|
-
column: PropTypes.string.isRequired,
|
|
68
|
-
descendingIcon: PropTypes.node.isRequired,
|
|
69
|
-
direction: PropTypes.oneOf(['asc', 'desc']).isRequired,
|
|
70
|
-
onClick: PropTypes.func.isRequired,
|
|
71
|
-
}),
|
|
72
|
-
};
|
|
73
|
-
|
|
74
43
|
export default TableHeaderCell;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TableColumn,
|
|
3
|
+
TableSort,
|
|
4
|
+
} from '../../Table.types';
|
|
5
|
+
|
|
6
|
+
export type TableHeaderCellProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Table data column, optionally sortable. The `format` function can be used to process the
|
|
9
|
+
* column data before displaying them.
|
|
10
|
+
*/
|
|
11
|
+
column: Omit<TableColumn, 'format'>;
|
|
12
|
+
/**
|
|
13
|
+
* ID of the HTML <th> element and nested button for sorting.
|
|
14
|
+
*/
|
|
15
|
+
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Sorting configuration required to make columns sortable.
|
|
18
|
+
*/
|
|
19
|
+
sort?: TableSort;
|
|
20
|
+
};
|
|
@@ -175,11 +175,11 @@ accessibility.
|
|
|
175
175
|
|
|
176
176
|
## API
|
|
177
177
|
|
|
178
|
-
<docoff-react-props src="/components/Tabs/Tabs.
|
|
178
|
+
<docoff-react-props src="/components/Tabs/Tabs.tsx" name="Tabs"></docoff-react-props>
|
|
179
179
|
|
|
180
180
|
### TabsItem
|
|
181
181
|
|
|
182
|
-
<docoff-react-props src="/components/Tabs/TabsItem.
|
|
182
|
+
<docoff-react-props src="/components/Tabs/TabsItem.tsx" name="TabsItem"></docoff-react-props>
|
|
183
183
|
|
|
184
184
|
## Theming
|
|
185
185
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { withGlobalProps } from '../../providers/globalProps';
|
|
4
3
|
import { transferProps } from '../../helpers/transferProps';
|
|
5
4
|
import styles from './Tabs.module.scss';
|
|
5
|
+
import type { TabsProps } from './Tabs.types';
|
|
6
6
|
|
|
7
|
-
export const Tabs = ({
|
|
7
|
+
export const Tabs: React.FunctionComponent<TabsProps> = ({
|
|
8
8
|
children,
|
|
9
9
|
id,
|
|
10
10
|
...restProps
|
|
11
|
-
}) => (
|
|
11
|
+
}: TabsProps) => (
|
|
12
12
|
<nav
|
|
13
13
|
{...transferProps(restProps)}
|
|
14
14
|
id={id}
|
|
@@ -22,22 +22,6 @@ export const Tabs = ({
|
|
|
22
22
|
</nav>
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
id: undefined,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
Tabs.propTypes = {
|
|
30
|
-
/**
|
|
31
|
-
* Nested `TabsItem` elements.
|
|
32
|
-
*/
|
|
33
|
-
children: PropTypes.node.isRequired,
|
|
34
|
-
/**
|
|
35
|
-
* ID of the root HTML element. It also serves as base for nested element:
|
|
36
|
-
* * `<ID>__list`
|
|
37
|
-
*/
|
|
38
|
-
id: PropTypes.string,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const TabsWithGlobalProps = withGlobalProps(Tabs, 'Tabs');
|
|
25
|
+
export const TabsWithGlobalProps = withGlobalProps<TabsProps, HTMLElement>(Tabs, 'Tabs');
|
|
42
26
|
|
|
43
27
|
export default TabsWithGlobalProps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HTMLAttributes,
|
|
3
|
+
ReactNode,
|
|
4
|
+
} from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props of the `Tabs` component.
|
|
8
|
+
*/
|
|
9
|
+
export type TabsProps = HTMLAttributes<HTMLElement> & {
|
|
10
|
+
/**
|
|
11
|
+
* Nested `TabsItem` elements.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* ID of the root HTML element. It also serves as base for nested element:
|
|
16
|
+
* * `<ID>__list`
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withGlobalProps } from '../../providers/globalProps';
|
|
3
|
+
import { classNames } from '../../helpers/classNames/classNames';
|
|
4
|
+
import { transferProps } from '../../helpers/transferProps';
|
|
5
|
+
import styles from './TabsItem.module.scss';
|
|
6
|
+
import type { TabsItemProps } from './TabsItem.types';
|
|
7
|
+
|
|
8
|
+
export const TabsItem: React.FunctionComponent<TabsItemProps> = ({
|
|
9
|
+
afterLabel,
|
|
10
|
+
beforeLabel,
|
|
11
|
+
href,
|
|
12
|
+
id,
|
|
13
|
+
isActive = false,
|
|
14
|
+
label,
|
|
15
|
+
onClick,
|
|
16
|
+
...restProps
|
|
17
|
+
}: TabsItemProps) => (
|
|
18
|
+
<li
|
|
19
|
+
className={classNames(
|
|
20
|
+
styles.root,
|
|
21
|
+
isActive && styles.isRootActive,
|
|
22
|
+
)}
|
|
23
|
+
id={id}
|
|
24
|
+
key={href}
|
|
25
|
+
>
|
|
26
|
+
<a
|
|
27
|
+
{...transferProps(restProps)}
|
|
28
|
+
className={styles.link}
|
|
29
|
+
href={href}
|
|
30
|
+
id={id && `${id}__link`}
|
|
31
|
+
onClick={onClick}
|
|
32
|
+
>
|
|
33
|
+
<span className={styles.linkContent}>
|
|
34
|
+
{beforeLabel}
|
|
35
|
+
<span
|
|
36
|
+
className={styles.label}
|
|
37
|
+
id={id && `${id}__label`}
|
|
38
|
+
>
|
|
39
|
+
{label}
|
|
40
|
+
</span>
|
|
41
|
+
{afterLabel}
|
|
42
|
+
</span>
|
|
43
|
+
</a>
|
|
44
|
+
</li>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export const TabsItemWithGlobalProps = withGlobalProps<TabsItemProps, never>(TabsItem, 'TabsItem');
|
|
48
|
+
|
|
49
|
+
export default TabsItemWithGlobalProps;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AnchorHTMLAttributes,
|
|
3
|
+
MouseEventHandler,
|
|
4
|
+
ReactNode,
|
|
5
|
+
} from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props of the `TabsItem` component.
|
|
9
|
+
*/
|
|
10
|
+
export type TabsItemProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
11
|
+
/**
|
|
12
|
+
* Optional element shown after item's label, e.g. an icon.
|
|
13
|
+
*/
|
|
14
|
+
afterLabel?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Optional element shown before item's label, e.g. an icon.
|
|
17
|
+
*/
|
|
18
|
+
beforeLabel?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Item's link URL. Optionally add custom routing function to the `onClick` option to bypass
|
|
21
|
+
* browser's default navigation.
|
|
22
|
+
*/
|
|
23
|
+
href: string;
|
|
24
|
+
/**
|
|
25
|
+
* ID of the root HTML element. It also serves as base for nested elements:
|
|
26
|
+
* * `<ID>__link`
|
|
27
|
+
* * `<ID>__label`
|
|
28
|
+
*/
|
|
29
|
+
id?: string;
|
|
30
|
+
/**
|
|
31
|
+
* If `true`, item is marked as active.
|
|
32
|
+
*/
|
|
33
|
+
isActive?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Item's label.
|
|
36
|
+
*/
|
|
37
|
+
label: string;
|
|
38
|
+
/**
|
|
39
|
+
* Function to call on item click, e.g. custom routing function.
|
|
40
|
+
*/
|
|
41
|
+
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
42
|
+
};
|
|
@@ -220,7 +220,7 @@ accessibility.
|
|
|
220
220
|
|
|
221
221
|
## API
|
|
222
222
|
|
|
223
|
-
<docoff-react-props src="/components/Text/Text.
|
|
223
|
+
<docoff-react-props src="/components/Text/Text.tsx" name="Text"></docoff-react-props>
|
|
224
224
|
|
|
225
225
|
[div-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
|
226
226
|
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// 1. `word-break: break-word` is deprecated
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// 1. `word-break: break-word` is deprecated, `word-break: normal` with `overflow-wrap: anywhere` is
|
|
2
|
+
// its standard equivalent.
|
|
3
|
+
// https://drafts.csswg.org/css-text-3/#valdef-word-break-break-word
|
|
4
4
|
//
|
|
5
5
|
// 2. Different approaches are used for single and multiline texts because the latter approach
|
|
6
6
|
// doesn't always work for single-line texts.
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
white-space: nowrap;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// stylelint-disable property-no-vendor-prefix, value-no-vendor-prefix
|
|
17
16
|
.isRootClampMultiLine {
|
|
18
17
|
display: -webkit-box; // 2.
|
|
19
18
|
-webkit-line-clamp: var(--rui-custom-lines);
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
overflow: hidden;
|
|
22
21
|
text-overflow: ellipsis;
|
|
23
22
|
}
|
|
24
|
-
// stylelint-enable property-no-vendor-prefix, value-no-vendor-prefix
|
|
25
23
|
|
|
26
24
|
.isRootHyphensAuto {
|
|
27
25
|
hyphens: auto;
|
|
@@ -36,7 +34,7 @@
|
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
.isRootWordWrappingLongWords {
|
|
39
|
-
word-break:
|
|
40
|
-
overflow-wrap: anywhere;
|
|
37
|
+
word-break: normal; // 1.
|
|
38
|
+
overflow-wrap: anywhere; // 1.
|
|
41
39
|
}
|
|
42
40
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CSSProperties } 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 { getRootClampClassName } from './_helpers/getRootClampClassName';
|
|
8
|
+
import { getRootHyphensClassName } from './_helpers/getRootHyphensClassName';
|
|
9
|
+
import { getRootWordWrappingClassName } from './_helpers/getRootWordWrappingClassName';
|
|
10
|
+
import styles from './Text.module.scss';
|
|
11
|
+
import type { TextProps } from './Text.types';
|
|
12
|
+
|
|
13
|
+
export const Text: React.FunctionComponent<TextProps> = ({
|
|
14
|
+
blockLevel = false,
|
|
15
|
+
children,
|
|
16
|
+
hyphens = 'none',
|
|
17
|
+
lines,
|
|
18
|
+
wordWrapping = 'normal',
|
|
19
|
+
...restProps
|
|
20
|
+
}: TextProps) => {
|
|
21
|
+
if (isChildrenEmpty(children)) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const HtmlElement = blockLevel ? 'div' : 'span';
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<HtmlElement
|
|
29
|
+
{...transferProps(restProps)}
|
|
30
|
+
className={(hyphens !== 'none' || (lines !== undefined && lines > 0) || wordWrapping !== 'normal')
|
|
31
|
+
? classNames(
|
|
32
|
+
getRootClampClassName(styles, lines),
|
|
33
|
+
getRootHyphensClassName(styles, hyphens),
|
|
34
|
+
getRootWordWrappingClassName(styles, wordWrapping),
|
|
35
|
+
)
|
|
36
|
+
: undefined}
|
|
37
|
+
style={(lines !== undefined && lines > 1) ? { '--rui-custom-lines': lines } as CSSProperties : undefined}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</HtmlElement>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const TextWithGlobalProps = withGlobalProps<TextProps, HTMLElement>(Text, 'Text');
|
|
45
|
+
|
|
46
|
+
export default TextWithGlobalProps;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HTMLAttributes,
|
|
3
|
+
ReactNode,
|
|
4
|
+
} from 'react';
|
|
5
|
+
|
|
6
|
+
export type TextHyphens = 'none' | 'auto' | 'manual';
|
|
7
|
+
|
|
8
|
+
export type TextWordWrapping = 'normal' | 'long-words' | 'anywhere';
|
|
9
|
+
|
|
10
|
+
export type TextProps = HTMLAttributes<HTMLElement> & {
|
|
11
|
+
/**
|
|
12
|
+
* If true, the root HTML element renders as `<div>` instead of `<span>`.
|
|
13
|
+
*/
|
|
14
|
+
blockLevel?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Text content to be sanitized. Can contain HTML.
|
|
17
|
+
*/
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Turn on hyphenation. Head to [Hyphens](#hyphens) to learn more.
|
|
21
|
+
*/
|
|
22
|
+
hyphens?: TextHyphens;
|
|
23
|
+
/**
|
|
24
|
+
* Optional number of lines. If exceeded, the content is truncated and appended by an ellipsis (`…`).
|
|
25
|
+
*/
|
|
26
|
+
lines?: number;
|
|
27
|
+
/**
|
|
28
|
+
* How to deal with long words. Head to [Word Wrapping](#word-wrapping) for detailed explanation.
|
|
29
|
+
*/
|
|
30
|
+
wordWrapping?: TextWordWrapping;
|
|
31
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CssModuleClasses } from '../../../types';
|
|
2
|
+
|
|
3
|
+
export const getRootClampClassName = (styles: CssModuleClasses, lines?: number) => {
|
|
4
|
+
if (lines === 1) {
|
|
5
|
+
return styles.isRootClampSingleLine;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (lines !== undefined && lines > 1) {
|
|
9
|
+
return styles.isRootClampMultiLine;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return undefined;
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CssModuleClasses } from '../../../types';
|
|
2
|
+
import type { TextHyphens } from '../Text.types';
|
|
3
|
+
|
|
4
|
+
export const getRootHyphensClassName = (styles: CssModuleClasses, hyphens?: TextHyphens) => {
|
|
5
|
+
if (hyphens === 'auto') {
|
|
6
|
+
return styles.isRootHyphensAuto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (hyphens === 'manual') {
|
|
10
|
+
return styles.isRootHyphensManual;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return undefined;
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CssModuleClasses } from '../../../types';
|
|
2
|
+
import type { TextWordWrapping } from '../Text.types';
|
|
3
|
+
|
|
4
|
+
export const getRootWordWrappingClassName = (styles: CssModuleClasses, wordWrapping?: TextWordWrapping) => {
|
|
5
|
+
if (wordWrapping === 'anywhere') {
|
|
6
|
+
return styles.isRootWordWrappingAnywhere;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (wordWrapping === 'long-words') {
|
|
10
|
+
return styles.isRootWordWrappingLongWords;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return undefined;
|
|
14
|
+
};
|