@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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-ui-org/react-ui",
|
|
3
3
|
"description": "React UI is a themeable UI library for React apps.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.65.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"ui",
|
|
@@ -24,6 +24,21 @@
|
|
|
24
24
|
"url": "https://github.com/react-ui-org/react-ui/issues"
|
|
25
25
|
},
|
|
26
26
|
"main": "dist/react-ui.js",
|
|
27
|
+
"types": "dist/react-ui.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/react-ui.css",
|
|
30
|
+
"dist/react-ui.d.ts",
|
|
31
|
+
"dist/react-ui.development.css",
|
|
32
|
+
"dist/react-ui.development.js",
|
|
33
|
+
"dist/react-ui.js",
|
|
34
|
+
"scripts/write-lockfile-hash.sh",
|
|
35
|
+
"src",
|
|
36
|
+
"!src/**/__tests__",
|
|
37
|
+
"!src/CNAME",
|
|
38
|
+
"!src/docs",
|
|
39
|
+
"!src/docsCustomProperties.ts",
|
|
40
|
+
"!src/index.md"
|
|
41
|
+
],
|
|
27
42
|
"repository": {
|
|
28
43
|
"type": "git",
|
|
29
44
|
"url": "https://github.com/react-ui-org/react-ui"
|
|
@@ -34,105 +49,94 @@
|
|
|
34
49
|
"devEngines": {
|
|
35
50
|
"runtime": {
|
|
36
51
|
"name": "node",
|
|
37
|
-
"version": "^22.
|
|
52
|
+
"version": "^22.23.0 || ^24.17.0",
|
|
38
53
|
"onFail": "error"
|
|
39
54
|
},
|
|
40
55
|
"packageManager": {
|
|
41
56
|
"name": "npm",
|
|
42
|
-
"version": "^11.
|
|
57
|
+
"version": "^11.13.0",
|
|
43
58
|
"onFail": "error"
|
|
44
59
|
}
|
|
45
60
|
},
|
|
46
61
|
"scripts": {
|
|
47
62
|
"build": "webpack --mode=production && webpack --mode=development",
|
|
63
|
+
"build:types": "node node_modules/@typescript/native/bin/tsc -p tsconfig.build.json && dts-bundle-generator --project tsconfig.build.json --no-check -o dist/react-ui.d.ts dist/types/index.d.ts",
|
|
48
64
|
"copy": "npm run copy:css && npm run copy:js",
|
|
49
65
|
"copy:css": "cp src/docs/_assets/generated/react-ui.css dist && cp src/docs/_assets/generated/react-ui.development.css dist",
|
|
50
66
|
"copy:js": "cp src/docs/_assets/generated/react-ui.js dist && cp src/docs/_assets/generated/react-ui.development.js dist",
|
|
51
|
-
"eslint": "
|
|
52
|
-
"
|
|
53
|
-
"eslint:ts": "eslint --ext ts,tsx -c .eslintrc-ts src tests",
|
|
54
|
-
"lint": "npm run eslint && npm run markdownlint && npm run stylelint",
|
|
67
|
+
"eslint": "eslint src tests",
|
|
68
|
+
"lint": "npm run eslint && npm run markdownlint && npm run stylelint && npm run typecheck",
|
|
55
69
|
"markdownlint": "markdownlint-cli2 \"README.md\" \"src/**/*.md\"",
|
|
56
|
-
"postbuild": "npm run copy",
|
|
70
|
+
"postbuild": "npm run copy && npm run build:types",
|
|
57
71
|
"postinstall": "sh scripts/write-lockfile-hash.sh",
|
|
58
72
|
"precopy": "rm -rf dist && mkdir dist",
|
|
59
73
|
"prepublishOnly": "npm run build",
|
|
60
74
|
"start": "webpack --watch --mode=development",
|
|
61
75
|
"start:chrome": "sh scripts/mcps/chrome-host/start-host-chrome.sh",
|
|
62
|
-
"stylelint": "stylelint \"src/**/*.{css,scss}\" \"!src/docs/_assets/generated/**\" --config stylelint.config.
|
|
76
|
+
"stylelint": "stylelint \"src/**/*.{css,scss}\" \"!src/docs/_assets/generated/**\" --config stylelint.config.mjs",
|
|
63
77
|
"test": "npm run test:jest",
|
|
64
|
-
"test:jest": "
|
|
65
|
-
"test:jest:js": "jest --coverage",
|
|
66
|
-
"test:jest:ts": "jest -c jest.config-ts.js --coverage",
|
|
78
|
+
"test:jest": "jest --coverage",
|
|
67
79
|
"test:playwright-ct:all": "playwright test -c playwright-ct.config.ts",
|
|
68
80
|
"test:playwright-ct:all-with-update": "playwright test -c playwright-ct.config.ts --update-snapshots",
|
|
69
|
-
"test:playwright-ct:show-report": "playwright show-report --host=0.0.0.0 --port=9323"
|
|
81
|
+
"test:playwright-ct:show-report": "playwright show-report --host=0.0.0.0 --port=9323",
|
|
82
|
+
"typecheck": "node node_modules/@typescript/native/bin/tsc --noEmit"
|
|
70
83
|
},
|
|
71
84
|
"dependencies": {
|
|
72
85
|
"normalize.css": "^8.0.1"
|
|
73
86
|
},
|
|
74
87
|
"peerDependencies": {
|
|
75
|
-
"
|
|
76
|
-
"react": "
|
|
77
|
-
"react-dom": "~18.2.0"
|
|
88
|
+
"react": "^18.2.0",
|
|
89
|
+
"react-dom": "^18.2.0"
|
|
78
90
|
},
|
|
79
91
|
"devDependencies": {
|
|
80
|
-
"@babel/
|
|
81
|
-
"@babel/
|
|
82
|
-
"@babel/
|
|
83
|
-
"@babel/
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
90
|
-
"@
|
|
91
|
-
"@
|
|
92
|
-
"@testing-library/jest-dom": "^6.9.1",
|
|
93
|
-
"@testing-library/react": "^16.3.0",
|
|
94
|
-
"@testing-library/user-event": "^14.6.1",
|
|
92
|
+
"@babel/core": "^8.0.5",
|
|
93
|
+
"@babel/preset-env": "^8.0.5",
|
|
94
|
+
"@babel/preset-react": "^8.0.1",
|
|
95
|
+
"@babel/preset-typescript": "^8.0.1",
|
|
96
|
+
"@happy-dom/jest-environment": "^20.14.5",
|
|
97
|
+
"@playwright/test": "~1.63.0",
|
|
98
|
+
"@react-ui-org/eslint-config": "^1.1.0",
|
|
99
|
+
"@react-ui-org/stylelint-config": "^1.0.0",
|
|
100
|
+
"@testing-library/dom": "^10.4.2",
|
|
101
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
102
|
+
"@testing-library/react": "^16.3.3",
|
|
103
|
+
"@testing-library/user-event": "^14.6.7",
|
|
95
104
|
"@types/jest": "^30.0.0",
|
|
96
|
-
"@types/node": "^
|
|
97
|
-
"@types/react": "^19.
|
|
98
|
-
"@types/react-dom": "^19.
|
|
99
|
-
"@typescript
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"eslint": "^8.57.0",
|
|
110
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
111
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
112
|
-
"eslint-plugin-deprecation": "^3.0.0",
|
|
113
|
-
"eslint-plugin-import": "^2.29.1",
|
|
114
|
-
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
115
|
-
"eslint-plugin-markdown": "^3.0.1",
|
|
116
|
-
"eslint-plugin-react": "^7.34.3",
|
|
117
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
118
|
-
"eslint-plugin-typescript-sort-keys": "^3.3.0",
|
|
105
|
+
"@types/node": "^26.5.1",
|
|
106
|
+
"@types/react": "^19.3.0",
|
|
107
|
+
"@types/react-dom": "^19.3.0",
|
|
108
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
109
|
+
"autoprefixer": "^10.6.0",
|
|
110
|
+
"babel-jest": "^30.5.1",
|
|
111
|
+
"babel-loader": "^10.1.1",
|
|
112
|
+
"babel-plugin-polyfill-corejs3": "^1.0.0",
|
|
113
|
+
"core-js": "^3.50.0",
|
|
114
|
+
"css-loader": "^7.1.5",
|
|
115
|
+
"dotenv": "^17.4.2",
|
|
116
|
+
"dts-bundle-generator": "^9.5.1",
|
|
117
|
+
"eslint": "^9.39.5",
|
|
119
118
|
"identity-obj-proxy": "^3.0.0",
|
|
120
|
-
"jest": "^30.
|
|
121
|
-
"markdownlint-cli2": "^0.
|
|
122
|
-
"mini-css-extract-plugin": "^2.
|
|
123
|
-
"postcss": "^8.5.
|
|
124
|
-
"postcss-loader": "^8.2.
|
|
125
|
-
"
|
|
126
|
-
"react": "
|
|
127
|
-
"
|
|
128
|
-
"sass": "^
|
|
129
|
-
"
|
|
130
|
-
"stylelint": "^
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"webpack": "^
|
|
135
|
-
"webpack-
|
|
119
|
+
"jest": "^30.5.1",
|
|
120
|
+
"markdownlint-cli2": "^0.23.3",
|
|
121
|
+
"mini-css-extract-plugin": "^2.10.2",
|
|
122
|
+
"postcss": "^8.5.28",
|
|
123
|
+
"postcss-loader": "^8.2.1",
|
|
124
|
+
"react": "^18.3.1",
|
|
125
|
+
"react-dom": "^18.3.1",
|
|
126
|
+
"sass": "^1.104.1",
|
|
127
|
+
"sass-loader": "^17.0.1",
|
|
128
|
+
"stylelint": "^17.15.0",
|
|
129
|
+
"stylelint-webpack-plugin": "^5.1.0",
|
|
130
|
+
"terser-webpack-plugin": "^5.6.1",
|
|
131
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
132
|
+
"webpack": "^5.111.0",
|
|
133
|
+
"webpack-cli": "^7.2.3",
|
|
134
|
+
"webpack-dev-server": "^6.0.0",
|
|
136
135
|
"webpack-visualizer-plugin2": "^2.0.0"
|
|
136
|
+
},
|
|
137
|
+
"overrides": {
|
|
138
|
+
"babel-preset-current-node-syntax": {
|
|
139
|
+
"@babel/core": "$@babel/core"
|
|
140
|
+
}
|
|
137
141
|
}
|
|
138
142
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React, { useContext } from 'react';
|
|
3
2
|
import { withGlobalProps } from '../../providers/globalProps';
|
|
4
3
|
import { TranslationsContext } from '../../providers/translations';
|
|
@@ -6,15 +5,16 @@ import { classNames } from '../../helpers/classNames/classNames';
|
|
|
6
5
|
import { transferProps } from '../../helpers/transferProps';
|
|
7
6
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
|
8
7
|
import styles from './Alert.module.scss';
|
|
8
|
+
import type { AlertProps } from './Alert.types';
|
|
9
9
|
|
|
10
|
-
export const Alert = ({
|
|
10
|
+
export const Alert: React.FunctionComponent<AlertProps> = ({
|
|
11
11
|
children,
|
|
12
|
-
color,
|
|
12
|
+
color = 'note',
|
|
13
13
|
icon,
|
|
14
14
|
id,
|
|
15
15
|
onClose,
|
|
16
16
|
...restProps
|
|
17
|
-
}) => {
|
|
17
|
+
}: AlertProps) => {
|
|
18
18
|
const translations = useContext(TranslationsContext);
|
|
19
19
|
|
|
20
20
|
return (
|
|
@@ -22,7 +22,7 @@ export const Alert = ({
|
|
|
22
22
|
{...transferProps(restProps)}
|
|
23
23
|
className={classNames(
|
|
24
24
|
styles.root,
|
|
25
|
-
getRootColorClassName(
|
|
25
|
+
getRootColorClassName(styles, color),
|
|
26
26
|
)}
|
|
27
27
|
id={id}
|
|
28
28
|
role="alert"
|
|
@@ -44,8 +44,9 @@ export const Alert = ({
|
|
|
44
44
|
{...(id && { id: `${id}__close` })}
|
|
45
45
|
className={styles.close}
|
|
46
46
|
onClick={() => onClose()}
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
47
48
|
onKeyPress={() => onClose()}
|
|
48
|
-
tabIndex=
|
|
49
|
+
tabIndex={0}
|
|
49
50
|
title={translations.Alert.close}
|
|
50
51
|
>
|
|
51
52
|
<span className={styles.closeSign}>×</span>
|
|
@@ -55,42 +56,6 @@ export const Alert = ({
|
|
|
55
56
|
);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
color: 'note',
|
|
60
|
-
icon: undefined,
|
|
61
|
-
id: undefined,
|
|
62
|
-
onClose: undefined,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
Alert.propTypes = {
|
|
66
|
-
/**
|
|
67
|
-
* Alert body.
|
|
68
|
-
*/
|
|
69
|
-
children: PropTypes.node.isRequired,
|
|
70
|
-
/**
|
|
71
|
-
* Color variant to clarify importance and meaning of the alert. Implements
|
|
72
|
-
* [Feedback color collection](/docs/foundation/collections#colors).
|
|
73
|
-
*/
|
|
74
|
-
color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note']),
|
|
75
|
-
/**
|
|
76
|
-
* Optional element to be displayed next to the alert body.
|
|
77
|
-
*/
|
|
78
|
-
icon: PropTypes.node,
|
|
79
|
-
/**
|
|
80
|
-
* ID of the root HTML element.
|
|
81
|
-
*
|
|
82
|
-
* Also serves as base for ids of nested elements:
|
|
83
|
-
* * `<ID>__close`
|
|
84
|
-
* * `<ID>__content`
|
|
85
|
-
*/
|
|
86
|
-
id: PropTypes.string,
|
|
87
|
-
/**
|
|
88
|
-
* Function to call when the close button is clicked. If not provided, close buttons will be
|
|
89
|
-
* hidden.
|
|
90
|
-
*/
|
|
91
|
-
onClose: PropTypes.func,
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const AlertWithGlobalProps = withGlobalProps(Alert, 'Alert');
|
|
59
|
+
export const AlertWithGlobalProps = withGlobalProps<AlertProps, never>(Alert, 'Alert');
|
|
95
60
|
|
|
96
61
|
export default AlertWithGlobalProps;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HTMLAttributes,
|
|
3
|
+
ReactNode,
|
|
4
|
+
} from 'react';
|
|
5
|
+
import type { FeedbackColor } from '../../types';
|
|
6
|
+
|
|
7
|
+
export type AlertProps = Omit<HTMLAttributes<HTMLDivElement>, 'color'> & {
|
|
8
|
+
/**
|
|
9
|
+
* Alert body.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Color variant to clarify importance and meaning of the alert. Implements
|
|
14
|
+
* [Feedback color collection](/docs/foundation/collections#colors).
|
|
15
|
+
*/
|
|
16
|
+
color?: FeedbackColor;
|
|
17
|
+
/**
|
|
18
|
+
* Optional element to be displayed next to the alert body.
|
|
19
|
+
*/
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* ID of the root HTML element.
|
|
23
|
+
*
|
|
24
|
+
* Also serves as base for ids of nested elements:
|
|
25
|
+
* * `<ID>__close`
|
|
26
|
+
* * `<ID>__content`
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Function to call when the close button is clicked. If not provided, close buttons will be
|
|
31
|
+
* hidden.
|
|
32
|
+
*/
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
|
6
|
+
import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
|
|
7
|
+
import styles from './Badge.module.scss';
|
|
8
|
+
import type { BadgeProps } from './Badge.types';
|
|
9
|
+
|
|
10
|
+
export const Badge: React.FunctionComponent<BadgeProps> = ({
|
|
11
|
+
color = 'note',
|
|
12
|
+
label,
|
|
13
|
+
priority = 'filled',
|
|
14
|
+
...restProps
|
|
15
|
+
}: BadgeProps) => (
|
|
16
|
+
<div
|
|
17
|
+
{...transferProps(restProps)}
|
|
18
|
+
className={classNames(
|
|
19
|
+
styles.root,
|
|
20
|
+
getRootPriorityClassName(styles, priority),
|
|
21
|
+
getRootColorClassName(styles, color),
|
|
22
|
+
)}
|
|
23
|
+
>
|
|
24
|
+
{label}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const BadgeWithGlobalProps = withGlobalProps<BadgeProps, never>(Badge, 'Badge');
|
|
29
|
+
|
|
30
|
+
export default BadgeWithGlobalProps;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
FeedbackColor,
|
|
4
|
+
NeutralColor,
|
|
5
|
+
Priority,
|
|
6
|
+
} from '../../types';
|
|
7
|
+
|
|
8
|
+
export type BadgePriority = Exclude<Priority, 'flat'>;
|
|
9
|
+
|
|
10
|
+
export type BadgeProps = Omit<HTMLAttributes<HTMLDivElement>, 'color'> & {
|
|
11
|
+
/**
|
|
12
|
+
* Color to clarify importance and meaning of the badge. Implements
|
|
13
|
+
* [Feedback and Neutral color collections](/docs/foundation/collections#colors).
|
|
14
|
+
*/
|
|
15
|
+
color?: FeedbackColor | NeutralColor;
|
|
16
|
+
/**
|
|
17
|
+
* Text to be displayed.
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Visual priority to highlight or suppress the badge.
|
|
22
|
+
*/
|
|
23
|
+
priority?: BadgePriority;
|
|
24
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { withGlobalProps } from '../../providers/globalProps';
|
|
3
|
+
import { classNames } from '../../helpers/classNames/classNames';
|
|
4
|
+
import { transferProps } from '../../helpers/transferProps';
|
|
5
|
+
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
|
6
|
+
import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
|
|
7
|
+
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
|
8
|
+
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
|
9
|
+
import { ButtonGroupContext } from '../ButtonGroup/ButtonGroupContext';
|
|
10
|
+
import { FormLayoutContext } from '../FormLayout/FormLayoutContext';
|
|
11
|
+
import { InputGroupContext } from '../InputGroup/InputGroupContext';
|
|
12
|
+
import getRootLabelVisibilityClassName from './helpers/getRootLabelVisibilityClassName';
|
|
13
|
+
import styles from './Button.module.scss';
|
|
14
|
+
import type { ButtonProps } from './Button.types';
|
|
15
|
+
|
|
16
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({
|
|
17
|
+
afterLabel,
|
|
18
|
+
beforeLabel,
|
|
19
|
+
block = false,
|
|
20
|
+
disabled = false,
|
|
21
|
+
endCorner,
|
|
22
|
+
feedbackIcon,
|
|
23
|
+
id,
|
|
24
|
+
label,
|
|
25
|
+
labelVisibility = 'xs',
|
|
26
|
+
priority = 'filled',
|
|
27
|
+
size = 'medium',
|
|
28
|
+
startCorner,
|
|
29
|
+
color = 'primary',
|
|
30
|
+
type = 'button',
|
|
31
|
+
...restProps
|
|
32
|
+
}, ref) => {
|
|
33
|
+
const buttonGroupContext = useContext(ButtonGroupContext);
|
|
34
|
+
const formLayoutContext = useContext(FormLayoutContext);
|
|
35
|
+
const inputGroupContext = useContext(InputGroupContext);
|
|
36
|
+
|
|
37
|
+
if (buttonGroupContext && inputGroupContext) {
|
|
38
|
+
throw new Error('Button cannot be placed both in `ButtonGroup` and `InputGroup`.');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const primaryContext = buttonGroupContext ?? inputGroupContext;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
/* No worries, `type` is always assigned correctly through props. */
|
|
45
|
+
/* eslint-disable react/button-has-type */
|
|
46
|
+
<button
|
|
47
|
+
{...transferProps(restProps)}
|
|
48
|
+
className={classNames(
|
|
49
|
+
styles.root,
|
|
50
|
+
getRootPriorityClassName(
|
|
51
|
+
styles,
|
|
52
|
+
resolveContextOrProp(buttonGroupContext && buttonGroupContext.priority, priority),
|
|
53
|
+
),
|
|
54
|
+
getRootColorClassName(styles, color),
|
|
55
|
+
getRootSizeClassName(
|
|
56
|
+
styles,
|
|
57
|
+
resolveContextOrProp(primaryContext && primaryContext.size, size),
|
|
58
|
+
),
|
|
59
|
+
getRootLabelVisibilityClassName(styles, labelVisibility),
|
|
60
|
+
resolveContextOrProp(buttonGroupContext && buttonGroupContext.block, block) && styles.isRootBlock,
|
|
61
|
+
buttonGroupContext && styles.isRootInButtonGroup,
|
|
62
|
+
inputGroupContext && styles.isRootInInputGroup,
|
|
63
|
+
formLayoutContext && styles.isRootInFormLayout,
|
|
64
|
+
formLayoutContext && formLayoutContext.layout === 'horizontal' && styles.isRootLayoutHorizontal,
|
|
65
|
+
feedbackIcon && styles.hasRootFeedback,
|
|
66
|
+
)}
|
|
67
|
+
disabled={resolveContextOrProp(primaryContext && primaryContext.disabled, disabled) || !!feedbackIcon}
|
|
68
|
+
id={id}
|
|
69
|
+
ref={ref}
|
|
70
|
+
type={type}
|
|
71
|
+
>
|
|
72
|
+
{startCorner && (
|
|
73
|
+
<span className={styles.startCorner}>
|
|
74
|
+
{startCorner}
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
77
|
+
{beforeLabel && (
|
|
78
|
+
<span className={styles.beforeLabel}>
|
|
79
|
+
{beforeLabel}
|
|
80
|
+
</span>
|
|
81
|
+
)}
|
|
82
|
+
<span
|
|
83
|
+
className={styles.label}
|
|
84
|
+
{...(id && { id: `${id}__labelText` })}
|
|
85
|
+
>
|
|
86
|
+
{label}
|
|
87
|
+
</span>
|
|
88
|
+
{afterLabel && (
|
|
89
|
+
<span className={styles.afterLabel}>
|
|
90
|
+
{afterLabel}
|
|
91
|
+
</span>
|
|
92
|
+
)}
|
|
93
|
+
{endCorner && (
|
|
94
|
+
<span className={styles.endCorner}>
|
|
95
|
+
{endCorner}
|
|
96
|
+
</span>
|
|
97
|
+
)}
|
|
98
|
+
{feedbackIcon && (
|
|
99
|
+
<span className={styles.feedbackIcon}>
|
|
100
|
+
{feedbackIcon}
|
|
101
|
+
</span>
|
|
102
|
+
)}
|
|
103
|
+
</button>
|
|
104
|
+
/* eslint-enable react/button-has-type */
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export const ButtonWithGlobalProps = withGlobalProps<ButtonProps, HTMLButtonElement>(Button, 'Button');
|
|
109
|
+
|
|
110
|
+
export default ButtonWithGlobalProps;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ButtonHTMLAttributes,
|
|
3
|
+
ReactNode,
|
|
4
|
+
} from 'react';
|
|
5
|
+
import type {
|
|
6
|
+
Breakpoint,
|
|
7
|
+
Color,
|
|
8
|
+
Priority,
|
|
9
|
+
Size,
|
|
10
|
+
} from '../../types';
|
|
11
|
+
|
|
12
|
+
export type ButtonLabelVisibility = Breakpoint | 'none';
|
|
13
|
+
|
|
14
|
+
export type ButtonType = 'button' | 'submit';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props of the `Button` component.
|
|
18
|
+
*/
|
|
19
|
+
export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'type'> & {
|
|
20
|
+
/**
|
|
21
|
+
* Element to be displayed after label, eg. an icon.
|
|
22
|
+
*/
|
|
23
|
+
afterLabel?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Element to be displayed before label, eg. an icon.
|
|
26
|
+
*/
|
|
27
|
+
beforeLabel?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* If `true`, the button will span the full width of its parent.
|
|
30
|
+
*
|
|
31
|
+
* Ignored if the component is rendered within `ButtonGroup` component
|
|
32
|
+
* as the value is inherited in such case.
|
|
33
|
+
*/
|
|
34
|
+
block?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Color variant to clarify importance and meaning of the alert. Implements
|
|
37
|
+
* [Action, Feedback and Neutral color collections](/docs/foundation/collections#colors).
|
|
38
|
+
*/
|
|
39
|
+
color?: Color;
|
|
40
|
+
/**
|
|
41
|
+
* If `true`, the button will be disabled.
|
|
42
|
+
*
|
|
43
|
+
* Ignored if the component is rendered within `ButtonGroup` component
|
|
44
|
+
* as the value is inherited in such case.
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Element to be displayed in the top right corner.
|
|
49
|
+
*/
|
|
50
|
+
endCorner?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Element to be displayed as a feedback icon on top of button label. When defined, it implies the
|
|
53
|
+
* button is in feedback state.
|
|
54
|
+
*/
|
|
55
|
+
feedbackIcon?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* ID of the root HTML element.
|
|
58
|
+
*
|
|
59
|
+
* Also serves as base for ids of nested elements:
|
|
60
|
+
* * `<ID>__labelText`
|
|
61
|
+
*/
|
|
62
|
+
id?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Button label.
|
|
65
|
+
*/
|
|
66
|
+
label: string;
|
|
67
|
+
/**
|
|
68
|
+
* Defines minimum breakpoint from which the button label will be visible.
|
|
69
|
+
*/
|
|
70
|
+
labelVisibility?: ButtonLabelVisibility;
|
|
71
|
+
/**
|
|
72
|
+
* Visual priority to highlight or suppress the button.
|
|
73
|
+
*
|
|
74
|
+
* Ignored if the component is rendered within `ButtonGroup` component
|
|
75
|
+
* as the value is inherited in such case.
|
|
76
|
+
*/
|
|
77
|
+
priority?: Priority;
|
|
78
|
+
/**
|
|
79
|
+
* Size of the button.
|
|
80
|
+
*
|
|
81
|
+
* Ignored if the component is rendered within `ButtonGroup` or `InputGroup` component as the value is inherited in
|
|
82
|
+
* such case.
|
|
83
|
+
*/
|
|
84
|
+
size?: Size;
|
|
85
|
+
/**
|
|
86
|
+
* Element to be displayed in the top left corner.
|
|
87
|
+
*/
|
|
88
|
+
startCorner?: ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* Set the HTML `type` attribute of the `button` element.
|
|
91
|
+
*/
|
|
92
|
+
type?: ButtonType;
|
|
93
|
+
};
|
|
@@ -407,7 +407,7 @@ If you provide [ref], it is forwarded to the native HTML `<button>` element.
|
|
|
407
407
|
|
|
408
408
|
## API
|
|
409
409
|
|
|
410
|
-
<docoff-react-props src="/components/Button/Button.
|
|
410
|
+
<docoff-react-props src="/components/Button/Button.tsx" name="Button"></docoff-react-props>
|
|
411
411
|
|
|
412
412
|
## Theming
|
|
413
413
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CssModuleClasses } from '../../../types';
|
|
2
|
+
import type { ButtonLabelVisibility } from '../Button.types';
|
|
3
|
+
|
|
4
|
+
export default (styles: CssModuleClasses, labelVisibility?: ButtonLabelVisibility) => {
|
|
2
5
|
// Intentionally omitting `xs` which means label is visible on all screen sizes.
|
|
3
6
|
|
|
4
7
|
if (labelVisibility === 'sm') {
|