@react-ui-org/react-ui 0.52.1 → 0.53.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. package/CODEOWNERS +23 -0
  2. package/README.md +10 -7
  3. package/dist/react-ui.css +5 -3
  4. package/dist/react-ui.js +1 -1
  5. package/package.json +64 -77
  6. package/src/{lib/components → components}/Alert/Alert.jsx +1 -1
  7. package/src/{lib/components/Alert/README.mdx → components/Alert/README.md} +84 -100
  8. package/src/{lib/components → components}/Badge/Badge.jsx +1 -1
  9. package/src/{lib/components → components}/Badge/Badge.scss +1 -1
  10. package/src/components/Badge/README.md +103 -0
  11. package/src/{lib/components → components}/Button/Button.jsx +1 -1
  12. package/src/components/Button/README.md +580 -0
  13. package/src/{lib/components → components}/ButtonGroup/ButtonGroup.jsx +11 -9
  14. package/src/{lib/components/ButtonGroup/README.mdx → components/ButtonGroup/README.md} +128 -134
  15. package/src/{lib/components → components}/Card/Card.jsx +1 -1
  16. package/src/components/Card/README.md +314 -0
  17. package/src/{lib/components/CheckboxField/README.mdx → components/CheckboxField/README.md} +96 -108
  18. package/src/{lib/components/FileInputField/README.mdx → components/FileInputField/README.md} +83 -95
  19. package/src/{lib/components → components}/FormLayout/FormLayout.jsx +4 -4
  20. package/src/components/FormLayout/README.md +462 -0
  21. package/src/{lib/components → components}/Grid/Grid.jsx +2 -2
  22. package/src/components/Grid/README.md +281 -0
  23. package/src/{lib/components → components}/InputGroup/InputGroup.jsx +20 -19
  24. package/src/{lib/components → components}/InputGroup/InputGroup.scss +0 -5
  25. package/src/{lib/components/InputGroup/README.mdx → components/InputGroup/README.md} +145 -163
  26. package/src/{lib/components → components}/Modal/Modal.jsx +6 -6
  27. package/src/components/Modal/README.md +1090 -0
  28. package/src/components/Modal/_hooks/useModalScrollPrevention.js +37 -0
  29. package/src/{lib/components/Paper/README.mdx → components/Paper/README.md} +18 -30
  30. package/src/{lib/components/Popover/README.mdx → components/Popover/README.md} +102 -132
  31. package/src/{lib/components/Radio/README.mdx → components/Radio/README.md} +122 -134
  32. package/src/{lib/components → components}/Radio/Radio.jsx +11 -12
  33. package/src/{lib/components → components}/Radio/Radio.scss +0 -5
  34. package/src/components/ScrollView/README.md +503 -0
  35. package/src/{lib/components → components}/ScrollView/ScrollView.jsx +12 -3
  36. package/src/components/SelectField/README.md +681 -0
  37. package/src/components/Table/README.md +259 -0
  38. package/src/{lib/components → components}/Table/Table.jsx +4 -1
  39. package/src/{lib/components → components}/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
  40. package/src/{lib/components/Tabs/README.mdx → components/Tabs/README.md} +117 -134
  41. package/src/{lib/components → components}/Tabs/TabsItem.jsx +3 -3
  42. package/src/components/Text/README.md +220 -0
  43. package/src/components/TextArea/README.md +359 -0
  44. package/src/{lib/components/TextField/README.mdx → components/TextField/README.md} +336 -342
  45. package/src/{lib/components/TextLink/README.mdx → components/TextLink/README.md} +19 -31
  46. package/src/{lib/components/Toggle/README.mdx → components/Toggle/README.md} +98 -110
  47. package/src/components/Toolbar/README.md +359 -0
  48. package/src/{lib/components → components}/Toolbar/_helpers/getAlignClassName.js +12 -4
  49. package/src/components/_helpers/getRootPriorityClassName.js +15 -0
  50. package/src/{lib/index.js → index.js} +6 -0
  51. package/src/{lib/provider → provider}/RUIProvider.jsx +17 -11
  52. package/src/{lib/styles → styles}/tools/_caret.scss +1 -1
  53. package/src/{lib/styles → styles}/tools/form-fields/_box-field-elements.scss +1 -1
  54. package/src/{lib/styles → styles}/tools/form-fields/_inline-field-elements.scss +2 -2
  55. package/src/{lib/theme.scss → theme.scss} +4 -3
  56. package/CONTRIBUTING.md +0 -137
  57. package/dist/lib.development.js +0 -3179
  58. package/dist/lib.js +0 -1
  59. package/public/racom.svg +0 -11
  60. package/src/lib/components/Badge/README.mdx +0 -126
  61. package/src/lib/components/Button/README.mdx +0 -581
  62. package/src/lib/components/Card/README.mdx +0 -326
  63. package/src/lib/components/FormLayout/README.mdx +0 -501
  64. package/src/lib/components/Grid/README.mdx +0 -299
  65. package/src/lib/components/Modal/README.mdx +0 -1360
  66. package/src/lib/components/Modal/_hooks/useModalScrollPrevention.js +0 -35
  67. package/src/lib/components/ScrollView/README.mdx +0 -521
  68. package/src/lib/components/SelectField/README.mdx +0 -693
  69. package/src/lib/components/Table/README.mdx +0 -275
  70. package/src/lib/components/Text/README.mdx +0 -241
  71. package/src/lib/components/TextArea/README.mdx +0 -366
  72. package/src/lib/components/Toolbar/README.mdx +0 -386
  73. package/src/{lib/components → components}/Alert/Alert.scss +0 -0
  74. package/src/{lib/components → components}/Alert/_settings.scss +0 -0
  75. package/src/{lib/components → components}/Alert/_theme.scss +0 -0
  76. package/src/{lib/components → components}/Alert/_tools.scss +0 -0
  77. package/src/{lib/components → components}/Alert/index.js +0 -0
  78. package/src/{lib/components → components}/Badge/index.js +0 -0
  79. package/src/{lib/components → components}/Button/Button.scss +0 -0
  80. package/src/{lib/components → components}/Button/_base.scss +0 -0
  81. package/src/{lib/components → components}/Button/_priorities.scss +0 -0
  82. package/src/{lib/components → components}/Button/_settings.scss +0 -0
  83. package/src/{lib/components → components}/Button/_theme.scss +0 -0
  84. package/src/{lib/components → components}/Button/_tools.scss +0 -0
  85. package/src/{lib/components → components}/Button/helpers/getRootLabelVisibilityClassName.js +0 -0
  86. package/src/{lib/components/_helpers → components/Button/helpers}/getRootPriorityClassName.js +0 -0
  87. package/src/{lib/components → components}/Button/index.js +0 -0
  88. package/src/{lib/components → components}/ButtonGroup/ButtonGroup.scss +0 -0
  89. package/src/{lib/components → components}/ButtonGroup/ButtonGroupContext.js +0 -0
  90. package/src/{lib/components → components}/ButtonGroup/_theme.scss +0 -0
  91. package/src/{lib/components → components}/ButtonGroup/index.js +0 -0
  92. package/src/{lib/components → components}/Card/Card.scss +0 -0
  93. package/src/{lib/components → components}/Card/CardBody.jsx +0 -0
  94. package/src/{lib/components → components}/Card/CardFooter.jsx +0 -0
  95. package/src/{lib/components → components}/Card/_theme.scss +0 -0
  96. package/src/{lib/components → components}/Card/_tools.scss +0 -0
  97. package/src/{lib/components → components}/Card/index.js +0 -0
  98. package/src/{lib/components → components}/CheckboxField/CheckboxField.jsx +0 -0
  99. package/src/{lib/components → components}/CheckboxField/CheckboxField.scss +0 -0
  100. package/src/{lib/components → components}/CheckboxField/index.js +0 -0
  101. package/src/{lib/components → components}/FileInputField/FileInputField.jsx +0 -0
  102. package/src/{lib/components → components}/FileInputField/FileInputField.scss +0 -0
  103. package/src/{lib/components → components}/FileInputField/index.js +0 -0
  104. package/src/{lib/components → components}/FormLayout/FormLayout.scss +0 -0
  105. package/src/{lib/components → components}/FormLayout/FormLayoutContext.js +0 -0
  106. package/src/{lib/components → components}/FormLayout/FormLayoutCustomField.jsx +4 -4
  107. package/src/{lib/components → components}/FormLayout/FormLayoutCustomField.scss +0 -0
  108. package/src/{lib/components → components}/FormLayout/_theme.scss +0 -0
  109. package/src/{lib/components → components}/FormLayout/index.js +0 -0
  110. package/src/{lib/components → components}/Grid/Grid.scss +0 -0
  111. package/src/{lib/components → components}/Grid/GridSpan.jsx +0 -0
  112. package/src/{lib/components → components}/Grid/_helpers/generateResponsiveCustomProperties.js +0 -0
  113. package/src/{lib/components → components}/Grid/_settings.scss +0 -0
  114. package/src/{lib/components → components}/Grid/_tools.scss +0 -0
  115. package/src/{lib/components → components}/Grid/index.js +0 -0
  116. package/src/{lib/components → components}/InputGroup/InputGroupContext.js +0 -0
  117. package/src/{lib/components → components}/InputGroup/_theme.scss +0 -0
  118. package/src/{lib/components → components}/InputGroup/index.js +0 -0
  119. package/src/{lib/components → components}/Modal/Modal.scss +0 -0
  120. package/src/{lib/components → components}/Modal/ModalBody.jsx +0 -0
  121. package/src/{lib/components → components}/Modal/ModalBody.scss +0 -0
  122. package/src/{lib/components → components}/Modal/ModalCloseButton.jsx +1 -1
  123. package/src/{lib/components → components}/Modal/ModalCloseButton.scss +0 -0
  124. package/src/{lib/components → components}/Modal/ModalContent.jsx +0 -0
  125. package/src/{lib/components → components}/Modal/ModalContent.scss +0 -0
  126. package/src/{lib/components → components}/Modal/ModalFooter.jsx +0 -0
  127. package/src/{lib/components → components}/Modal/ModalFooter.scss +0 -0
  128. package/src/{lib/components → components}/Modal/ModalHeader.jsx +0 -0
  129. package/src/{lib/components → components}/Modal/ModalHeader.scss +0 -0
  130. package/src/{lib/components → components}/Modal/ModalTitle.jsx +0 -0
  131. package/src/{lib/components → components}/Modal/ModalTitle.scss +0 -0
  132. package/src/{lib/components → components}/Modal/_helpers/getJustifyClassName.js +0 -0
  133. package/src/{lib/components → components}/Modal/_helpers/getPositionClassName.js +0 -0
  134. package/src/{lib/components → components}/Modal/_helpers/getScrollingClassName.js +0 -0
  135. package/src/{lib/components → components}/Modal/_helpers/getSizeClassName.js +0 -0
  136. package/src/{lib/components → components}/Modal/_hooks/useModalFocus.js +0 -0
  137. package/src/{lib/components → components}/Modal/_settings.scss +0 -0
  138. package/src/{lib/components → components}/Modal/_theme.scss +0 -0
  139. package/src/{lib/components → components}/Modal/index.js +0 -0
  140. package/src/{lib/components → components}/Paper/Paper.jsx +0 -0
  141. package/src/{lib/components → components}/Paper/Paper.scss +0 -0
  142. package/src/{lib/components → components}/Paper/_theme.scss +0 -0
  143. package/src/{lib/components → components}/Paper/index.js +0 -0
  144. package/src/{lib/components → components}/Popover/Popover.jsx +0 -0
  145. package/src/{lib/components → components}/Popover/Popover.scss +0 -0
  146. package/src/{lib/components → components}/Popover/PopoverWrapper.jsx +0 -0
  147. package/src/{lib/components → components}/Popover/PopoverWrapper.scss +0 -0
  148. package/src/{lib/components → components}/Popover/_helpers/getRootAlignmentClassName.js +0 -0
  149. package/src/{lib/components → components}/Popover/_helpers/getRootSideClassName.js +0 -0
  150. package/src/{lib/components → components}/Popover/_theme.scss +0 -0
  151. package/src/{lib/components → components}/Popover/index.js +0 -0
  152. package/src/{lib/components → components}/Radio/index.js +0 -0
  153. package/src/{lib/components → components}/ScrollView/ScrollView.scss +0 -0
  154. package/src/{lib/components → components}/ScrollView/_helpers/getElementsPositionDifference.js +0 -0
  155. package/src/{lib/components → components}/ScrollView/_hooks/useLoadResizeHook.js +0 -0
  156. package/src/{lib/components → components}/ScrollView/_hooks/useScrollPositionHook.js +0 -0
  157. package/src/{lib/components → components}/ScrollView/index.js +0 -0
  158. package/src/{lib/components → components}/SelectField/SelectField.jsx +0 -0
  159. package/src/{lib/components → components}/SelectField/SelectField.scss +0 -0
  160. package/src/{lib/components → components}/SelectField/_components/Option/Option.jsx +0 -0
  161. package/src/{lib/components → components}/SelectField/_components/Option/index.js +0 -0
  162. package/src/{lib/components → components}/SelectField/index.js +0 -0
  163. package/src/{lib/components → components}/Table/Table.scss +0 -0
  164. package/src/{lib/components → components}/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -0
  165. package/src/{lib/components → components}/Table/_components/TableBodyCell/index.js +0 -0
  166. package/src/{lib/components → components}/Table/_components/TableCell.scss +0 -0
  167. package/src/{lib/components → components}/Table/_components/TableHeaderCell/index.js +0 -0
  168. package/src/{lib/components → components}/Table/_settings.scss +0 -0
  169. package/src/{lib/components → components}/Table/index.js +0 -0
  170. package/src/{lib/components → components}/Tabs/Tabs.jsx +0 -0
  171. package/src/{lib/components → components}/Tabs/Tabs.scss +0 -0
  172. package/src/{lib/components → components}/Tabs/TabsItem.scss +0 -0
  173. package/src/{lib/components → components}/Tabs/_theme.scss +0 -0
  174. package/src/{lib/components → components}/Tabs/index.js +0 -0
  175. package/src/{lib/components → components}/Text/Text.jsx +0 -0
  176. package/src/{lib/components → components}/Text/Text.scss +0 -0
  177. package/src/{lib/components → components}/Text/_helpers/getRootClampClassName.js +0 -0
  178. package/src/{lib/components → components}/Text/_helpers/getRootHyphensClassName.js +0 -0
  179. package/src/{lib/components → components}/Text/_helpers/getRootWordWrappingClassName.js +0 -0
  180. package/src/{lib/components → components}/Text/index.js +0 -0
  181. package/src/{lib/components → components}/TextArea/TextArea.jsx +0 -0
  182. package/src/{lib/components → components}/TextArea/TextArea.scss +0 -0
  183. package/src/{lib/components → components}/TextArea/index.js +0 -0
  184. package/src/{lib/components → components}/TextField/TextField.jsx +0 -0
  185. package/src/{lib/components → components}/TextField/TextField.scss +0 -0
  186. package/src/{lib/components → components}/TextField/index.js +0 -0
  187. package/src/{lib/components → components}/TextLink/TextLink.jsx +1 -1
  188. /package/src/{lib/components → components}/TextLink/TextLink.scss +0 -0
  189. /package/src/{lib/components → components}/TextLink/_theme.scss +0 -0
  190. /package/src/{lib/components → components}/TextLink/index.js +0 -0
  191. /package/src/{lib/components → components}/Toggle/Toggle.jsx +0 -0
  192. /package/src/{lib/components → components}/Toggle/Toggle.scss +0 -0
  193. /package/src/{lib/components → components}/Toggle/index.js +0 -0
  194. /package/src/{lib/components → components}/Toolbar/Toolbar.jsx +0 -0
  195. /package/src/{lib/components → components}/Toolbar/Toolbar.scss +0 -0
  196. /package/src/{lib/components → components}/Toolbar/ToolbarGroup.jsx +0 -0
  197. /package/src/{lib/components → components}/Toolbar/ToolbarItem.jsx +0 -0
  198. /package/src/{lib/components → components}/Toolbar/_helpers/getJustifyClassName.js +0 -0
  199. /package/src/{lib/components → components}/Toolbar/_theme.scss +0 -0
  200. /package/src/{lib/components → components}/Toolbar/index.js +0 -0
  201. /package/src/{lib/components → components}/_helpers/getRootColorClassName.js +0 -0
  202. /package/src/{lib/components → components}/_helpers/getRootSizeClassName.js +0 -0
  203. /package/src/{lib/components → components}/_helpers/getRootValidationStateClassName.js +0 -0
  204. /package/src/{lib/components → components}/_helpers/isChildrenEmpty.js +0 -0
  205. /package/src/{lib/components → components}/_helpers/resolveContextOrProp.js +0 -0
  206. /package/src/{lib/components → components}/_helpers/transferProps.js +0 -0
  207. /package/src/{lib/foundation.scss → foundation.scss} +0 -0
  208. /package/src/{lib/helpers.scss → helpers.scss} +0 -0
  209. /package/src/{lib/provider → provider}/RUIContext.jsx +0 -0
  210. /package/src/{lib/provider → provider}/index.js +0 -0
  211. /package/src/{lib/provider → provider}/withGlobalProps.jsx +0 -0
  212. /package/src/{lib/styles → styles}/_utilities.scss +0 -0
  213. /package/src/{lib/styles → styles}/elements/_code.scss +0 -0
  214. /package/src/{lib/styles → styles}/elements/_links.scss +0 -0
  215. /package/src/{lib/styles → styles}/elements/_lists.scss +0 -0
  216. /package/src/{lib/styles → styles}/elements/_page.scss +0 -0
  217. /package/src/{lib/styles → styles}/elements/_rulers.scss +0 -0
  218. /package/src/{lib/styles → styles}/elements/_small.scss +0 -0
  219. /package/src/{lib/styles → styles}/generic/_box-sizing.scss +0 -0
  220. /package/src/{lib/styles → styles}/generic/_focus.scss +0 -0
  221. /package/src/{lib/styles → styles}/generic/_forms.scss +0 -0
  222. /package/src/{lib/styles → styles}/generic/_reset.scss +0 -0
  223. /package/src/{lib/styles → styles}/generic/_shared.scss +0 -0
  224. /package/src/{lib/styles → styles}/helpers/_animation.scss +0 -0
  225. /package/src/{lib/styles → styles}/settings/_animations.scss +0 -0
  226. /package/src/{lib/styles → styles}/settings/_breakpoints.scss +0 -0
  227. /package/src/{lib/styles → styles}/settings/_escaped-characters.scss +0 -0
  228. /package/src/{lib/styles → styles}/settings/_form-fields.scss +0 -0
  229. /package/src/{lib/styles → styles}/settings/_forms.scss +0 -0
  230. /package/src/{lib/styles → styles}/settings/_utilities.scss +0 -0
  231. /package/src/{lib/styles → styles}/settings/_z-indexes.scss +0 -0
  232. /package/src/{lib/styles → styles}/theme/_accessibility.scss +0 -0
  233. /package/src/{lib/styles → styles}/theme/_borders.scss +0 -0
  234. /package/src/{lib/styles → styles}/theme/_code.scss +0 -0
  235. /package/src/{lib/styles → styles}/theme/_form-fields.scss +0 -0
  236. /package/src/{lib/styles → styles}/theme/_links.scss +0 -0
  237. /package/src/{lib/styles → styles}/theme/_lists.scss +0 -0
  238. /package/src/{lib/styles → styles}/theme/_page.scss +0 -0
  239. /package/src/{lib/styles → styles}/theme/_spacing.scss +0 -0
  240. /package/src/{lib/styles → styles}/theme/_typography.scss +0 -0
  241. /package/src/{lib/styles → styles}/theme-constants/_breakpoints.scss +0 -0
  242. /package/src/{lib/styles → styles}/theme-constants/_colors.scss +0 -0
  243. /package/src/{lib/styles → styles}/theme-constants/_svg.scss +0 -0
  244. /package/src/{lib/styles → styles}/tools/_accessibility.scss +0 -0
  245. /package/src/{lib/styles → styles}/tools/_breakpoint.scss +0 -0
  246. /package/src/{lib/styles → styles}/tools/_colors.scss +0 -0
  247. /package/src/{lib/styles → styles}/tools/_reset.scss +0 -0
  248. /package/src/{lib/styles → styles}/tools/_scrollbar.scss +0 -0
  249. /package/src/{lib/styles → styles}/tools/_spacing.scss +0 -0
  250. /package/src/{lib/styles → styles}/tools/_string.scss +0 -0
  251. /package/src/{lib/styles → styles}/tools/_svg.scss +0 -0
  252. /package/src/{lib/styles → styles}/tools/_transition.scss +0 -0
  253. /package/src/{lib/styles → styles}/tools/_utilities.scss +0 -0
  254. /package/src/{lib/styles → styles}/tools/form-fields/_box-field-layout.scss +0 -0
  255. /package/src/{lib/styles → styles}/tools/form-fields/_box-field-sizes.scss +0 -0
  256. /package/src/{lib/styles → styles}/tools/form-fields/_foundation.scss +0 -0
  257. /package/src/{lib/styles → styles}/tools/form-fields/_inline-field-layout.scss +0 -0
  258. /package/src/{lib/styles → styles}/tools/form-fields/_variants.scss +0 -0
  259. /package/src/{lib/translations → translations}/en.js +0 -0
  260. /package/src/{lib/utils → utils}/classNames.js +0 -0
@@ -1,23 +1,7 @@
1
- ---
2
- name: ButtonGroup
3
- menu: 'Layouts'
4
- route: /components/button-group
5
- ---
6
-
7
1
  # ButtonGroup
8
2
 
9
3
  ButtonGroup visually groups related buttons together.
10
4
 
11
- import {
12
- Playground,
13
- Props,
14
- } from 'docz'
15
- import Icon from '../../../docs/_components/Icon'
16
- import {
17
- Button,
18
- ButtonGroup,
19
- } from '../..'
20
-
21
5
  ## Basic Usage
22
6
 
23
7
  To implement the ButtonGroup component, you need to import it first:
@@ -28,13 +12,13 @@ import { ButtonGroup } from '@react-ui-org/react-ui';
28
12
 
29
13
  And use it:
30
14
 
31
- <Playground>
32
- <ButtonGroup>
33
- <Button label="Week" />
34
- <Button label="Month" />
35
- <Button label="Year" />
36
- </ButtonGroup>
37
- </Playground>
15
+ ```docoff-react-preview
16
+ <ButtonGroup>
17
+ <Button label="Week" />
18
+ <Button label="Month" />
19
+ <Button label="Year" />
20
+ </ButtonGroup>
21
+ ```
38
22
 
39
23
  See [API](#api) for all available options.
40
24
 
@@ -53,11 +37,11 @@ See [API](#api) for all available options.
53
37
  - Use **short labels or icons** so the buttons can fit small screens.
54
38
 
55
39
  - For toggling between on/off states, use rather the
56
- [Toggle](/components/toggle) component.
40
+ [Toggle](/components/Toggle) component.
57
41
 
58
42
  - For switching between options in a form that needs to be submitted, use rather
59
- the [SelectField](/components/select-field) or
60
- [Radio](/components/radio) components.
43
+ the [SelectField](/components/SelectField) or
44
+ [Radio](/components/Radio) components.
61
45
 
62
46
  - In the background, ButtonGroup uses the [`fieldset`][fieldset] element. Not
63
47
  only it improves the [accessibility] of the group, it also allows you to make
@@ -85,7 +69,7 @@ buttons of totally different types or sizes.
85
69
  ## Priorities
86
70
 
87
71
  There are three **visual priorities** of buttons which exactly copy the
88
- priorities of the [Button](/components/button) component:
72
+ priorities of the [Button](/components/Button/) component:
89
73
 
90
74
  1. filled
91
75
  2. outline
@@ -99,72 +83,72 @@ priorities of the [Button](/components/button) component:
99
83
  The default, high-emphasis priority should be used for primary actions of your
100
84
  app.
101
85
 
102
- <Playground>
103
- <ButtonGroup>
104
- <Button color="secondary" label="Week" />
105
- <Button color="secondary" label="Month" />
106
- <Button color="secondary" label="Year" />
107
- </ButtonGroup>
108
- </Playground>
86
+ ```docoff-react-preview
87
+ <ButtonGroup>
88
+ <Button color="secondary" label="Week" />
89
+ <Button color="secondary" label="Month" />
90
+ <Button color="secondary" label="Year" />
91
+ </ButtonGroup>
92
+ ```
109
93
 
110
94
  ### Outline
111
95
 
112
96
  Medium-emphasis buttons to contain actions that are important but not primary
113
97
  in your app.
114
98
 
115
- <Playground>
116
- <ButtonGroup priority="outline">
117
- <Button color="secondary" label="Week" />
118
- <Button color="secondary" label="Month" />
119
- <Button color="secondary" label="Year" />
120
- </ButtonGroup>
121
- </Playground>
99
+ ```docoff-react-preview
100
+ <ButtonGroup priority="outline">
101
+ <Button color="secondary" label="Week" />
102
+ <Button color="secondary" label="Month" />
103
+ <Button color="secondary" label="Year" />
104
+ </ButtonGroup>
105
+ ```
122
106
 
123
107
  ### Flat
124
108
 
125
109
  Flat buttons are designed for less pronounced actions to help maintain focus on
126
110
  the content.
127
111
 
128
- <Playground>
129
- <ButtonGroup priority="flat">
130
- <Button color="secondary" label="Week" />
131
- <Button color="secondary" label="Month" />
132
- <Button color="secondary" label="Year" />
133
- </ButtonGroup>
134
- </Playground>
112
+ ```docoff-react-preview
113
+ <ButtonGroup priority="flat">
114
+ <Button color="secondary" label="Week" />
115
+ <Button color="secondary" label="Month" />
116
+ <Button color="secondary" label="Year" />
117
+ </ButtonGroup>
118
+ ```
135
119
 
136
120
  ## Sizes
137
121
 
138
122
  All existing button sizes are also available on the button group level: small,
139
123
  medium, and large.
140
124
 
141
- <Playground>
142
- <ButtonGroup size="small">
143
- <Button color="secondary" label="Week" />
144
- <Button color="secondary" label="Month" />
145
- <Button color="secondary" label="Year" />
146
- </ButtonGroup>
147
- <ButtonGroup>
148
- <Button color="secondary" label="Week" />
149
- <Button color="secondary" label="Month" />
150
- <Button color="secondary" label="Year" />
151
- </ButtonGroup>
152
- <ButtonGroup size="large">
153
- <Button color="secondary" label="Week" />
154
- <Button color="secondary" label="Month" />
155
- <Button color="secondary" label="Year" />
156
- </ButtonGroup>
157
- </Playground>
125
+ ```docoff-react-preview
126
+ <ButtonGroup size="small">
127
+ <Button color="secondary" label="Week" />
128
+ <Button color="secondary" label="Month" />
129
+ <Button color="secondary" label="Year" />
130
+ </ButtonGroup>
131
+ <ButtonGroup>
132
+ <Button color="secondary" label="Week" />
133
+ <Button color="secondary" label="Month" />
134
+ <Button color="secondary" label="Year" />
135
+ </ButtonGroup>
136
+ <ButtonGroup size="large">
137
+ <Button color="secondary" label="Week" />
138
+ <Button color="secondary" label="Month" />
139
+ <Button color="secondary" label="Year" />
140
+ </ButtonGroup>
141
+ ```
158
142
 
159
143
  Block button groups span the full width of a parent:
160
144
 
161
- <Playground>
162
- <ButtonGroup block>
163
- <Button color="secondary" label="Week" />
164
- <Button color="secondary" label="Month" />
165
- <Button color="secondary" label="Year" />
166
- </ButtonGroup>
167
- </Playground>
145
+ ```docoff-react-preview
146
+ <ButtonGroup block>
147
+ <Button color="secondary" label="Week" />
148
+ <Button color="secondary" label="Month" />
149
+ <Button color="secondary" label="Year" />
150
+ </ButtonGroup>
151
+ ```
168
152
 
169
153
  ## States
170
154
 
@@ -172,85 +156,95 @@ Block button groups span the full width of a parent:
172
156
 
173
157
  Disables all buttons inside the group.
174
158
 
175
- <Playground>
176
- <ButtonGroup disabled>
177
- <Button color="secondary" label="Week" />
178
- <Button color="secondary" label="Month" />
179
- <Button color="secondary" label="Year" />
180
- </ButtonGroup>
181
- <ButtonGroup priority="outline" disabled>
182
- <Button color="secondary" label="Week" />
183
- <Button color="secondary" label="Month" />
184
- <Button color="secondary" label="Year" />
185
- </ButtonGroup>
186
- <ButtonGroup priority="flat" disabled>
187
- <Button color="secondary" label="Week" />
188
- <Button color="secondary" label="Month" />
189
- <Button color="secondary" label="Year" />
190
- </ButtonGroup>
191
- </Playground>
159
+ ```docoff-react-preview
160
+ <ButtonGroup disabled>
161
+ <Button color="secondary" label="Week" />
162
+ <Button color="secondary" label="Month" />
163
+ <Button color="secondary" label="Year" />
164
+ </ButtonGroup>
165
+ <ButtonGroup priority="outline" disabled>
166
+ <Button color="secondary" label="Week" />
167
+ <Button color="secondary" label="Month" />
168
+ <Button color="secondary" label="Year" />
169
+ </ButtonGroup>
170
+ <ButtonGroup priority="flat" disabled>
171
+ <Button color="secondary" label="Week" />
172
+ <Button color="secondary" label="Month" />
173
+ <Button color="secondary" label="Year" />
174
+ </ButtonGroup>
175
+ ```
192
176
 
193
177
  ### Feedback State
194
178
 
195
179
  When user's action triggers an asynchronous process on background, feedback
196
180
  state of individual buttons can be indicated by showing an icon.
197
181
 
198
- <Playground>
199
- <ButtonGroup>
200
- <Button color="success" label="Week" feedbackIcon={<Icon icon="success" />} />
201
- <Button color="secondary" label="Month" />
202
- <Button color="secondary" label="Year" />
203
- </ButtonGroup>
204
- <ButtonGroup priority="outline">
205
- <Button color="success" label="Week" feedbackIcon={<Icon icon="success" />} />
206
- <Button color="secondary" label="Month" />
207
- <Button color="secondary" label="Year" />
208
- </ButtonGroup>
209
- <ButtonGroup priority="flat">
210
- <Button color="success" label="Week" feedbackIcon={<Icon icon="success" />} />
211
- <Button color="secondary" label="Month" />
212
- <Button color="secondary" label="Year" />
213
- </ButtonGroup>
214
- </Playground>
182
+ ```docoff-react-preview
183
+ <ButtonGroup>
184
+ <Button
185
+ color="success"
186
+ label="Week"
187
+ feedbackIcon={<rui-icon icon="success" />}
188
+ />
189
+ <Button color="secondary"label="Month" />
190
+ <Button color="secondary"label="Year" />
191
+ </ButtonGroup>
192
+ <ButtonGroup priority="outline">
193
+ <Button
194
+ color="success"
195
+ label="Week"
196
+ feedbackIcon={<rui-icon icon="success" />}
197
+ />
198
+ <Button color="secondary"label="Month" />
199
+ <Button color="secondary"label="Year" />
200
+ </ButtonGroup>
201
+ <ButtonGroup priority="flat">
202
+ <Button
203
+ color="success"
204
+ label="Week"
205
+ feedbackIcon={<rui-icon icon="success" />}
206
+ />
207
+ <Button color="secondary"label="Month" />
208
+ <Button color="secondary"label="Year" />
209
+ </ButtonGroup>
210
+ ```
215
211
 
216
212
  ### Selected State
217
213
 
218
214
  To highlight the selected option, just apply the selected color variant for
219
215
  the desired item.
220
216
 
221
- <Playground>
222
- <ButtonGroup>
223
- <Button color="selected" label="Week" />
224
- <Button color="secondary" label="Month" />
225
- <Button color="secondary" label="Year" />
226
- </ButtonGroup>
227
- <ButtonGroup priority="outline">
228
- <Button color="selected" label="Week" />
229
- <Button color="secondary" label="Month" />
230
- <Button color="secondary" label="Year" />
231
- </ButtonGroup>
232
- <ButtonGroup priority="flat">
233
- <Button color="selected" label="Week" />
234
- <Button color="secondary" label="Month" />
235
- <Button color="secondary" label="Year" />
236
- </ButtonGroup>
237
- </Playground>
217
+ ```docoff-react-preview
218
+ <ButtonGroup>
219
+ <Button color="selected" label="Week" />
220
+ <Button color="secondary" label="Month" />
221
+ <Button color="secondary" label="Year" />
222
+ </ButtonGroup>
223
+ <ButtonGroup priority="outline">
224
+ <Button color="selected" label="Week" />
225
+ <Button color="secondary" label="Month" />
226
+ <Button color="secondary" label="Year" />
227
+ </ButtonGroup>
228
+ <ButtonGroup priority="flat">
229
+ <Button color="selected" label="Week" />
230
+ <Button color="secondary" label="Month" />
231
+ <Button color="secondary" label="Year" />
232
+ </ButtonGroup>
233
+ ```
238
234
 
239
235
  ## Accessibility
240
236
 
241
237
  You can improve the accessibility of your ButtonGroup by linking it to a label
242
238
  and communicating the state of individual options.
243
239
 
244
- <Playground>
245
- <>
246
- <span id="period-label">Period:</span>
247
- <ButtonGroup aria-labelledby="period-label">
248
- <Button color="selected" label="Week" aria-pressed />
249
- <Button color="secondary" label="Month" aria-pressed={false} />
250
- <Button color="secondary" label="Year" aria-pressed={false} />
251
- </ButtonGroup>
252
- </>
253
- </Playground>
240
+ ```docoff-react-preview
241
+ <span id="period-label">Period:</span>
242
+ <ButtonGroup aria-labelledby="period-label">
243
+ <Button color="selected" label="Week" aria-pressed />
244
+ <Button color="secondary" label="Month" aria-pressed={false} />
245
+ <Button color="secondary" label="Year" aria-pressed={false} />
246
+ </ButtonGroup>
247
+ ```
254
248
 
255
249
  ## Forwarding HTML Attributes
256
250
 
@@ -265,7 +259,7 @@ its accessibility.
265
259
 
266
260
  ## API
267
261
 
268
- <Props table of={ButtonGroup} />
262
+ <docoff-react-props src="/components/ButtonGroup/ButtonGroup.jsx"></docoff-react-props>
269
263
 
270
264
  ## Theming
271
265
 
@@ -44,7 +44,7 @@ Card.propTypes = {
44
44
  */
45
45
  children: PropTypes.node.isRequired,
46
46
  /**
47
- * [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the card.
47
+ * [Color variant](/docs/foundation/colors#component-colors) to clarify importance and meaning of the card.
48
48
  */
49
49
  color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
50
50
  /**
@@ -0,0 +1,314 @@
1
+ # Card
2
+
3
+ Cards contain content and actions about a single subject.
4
+
5
+ ## Basic Usage
6
+
7
+ To implement the Card component, you need to import at least Card and
8
+ [CardBody](#cardbody) components:
9
+
10
+ ```js
11
+ import { Card, CardBody } from '@react-ui-org/react-ui';
12
+ ```
13
+
14
+ And use it:
15
+
16
+ ```docoff-react-preview
17
+ <Card>
18
+ <CardBody>
19
+ Hello!
20
+ </CardBody>
21
+ </Card>
22
+ ```
23
+
24
+ See [API](#api) for all available options.
25
+
26
+ ## General Guidelines
27
+
28
+ - Default card is **designed for non-white background.** You may want to either
29
+ use the [raised variant](#raised-card) or
30
+ [customize](/docs/customize/theming/overview) the default appearance to make the
31
+ card stand out on white surfaces.
32
+
33
+ - Use optional [CardBody](#cardbody) and [CardFooter](#cardfooter) components to
34
+ provide your content with expected spacing.
35
+
36
+ - Use **medium or low-emphasis buttons** when there are more cards, e.g. in a
37
+ grid. It will help you keep the UI clean and easy to scan.
38
+
39
+ - **Card, or Paper?** Card is a versatile surface for displaying content.
40
+ However, there is also the [Paper](/components/Paper) component. While Card
41
+ is designed for displaying items (and also supports more visual options),
42
+ Paper is usually used to hold larger content areas like lists, grids, or
43
+ forms.
44
+
45
+ ## Composition
46
+
47
+ Card is decomposed into the following components:
48
+
49
+ - [Card](#api)
50
+ - [CardBody](#cardbody)
51
+ - [CardFooter](#cardfooter)
52
+
53
+ Aside from the [CardBody](#cardbody) element, you can add a
54
+ [CardFooter](#cardfooter) to better separate your card's actions from the rest
55
+ of the content.
56
+
57
+ Import all necessary components:
58
+
59
+ ```js
60
+ import { Card, CardBody, CardFooter } from '@react-ui-org/react-ui';
61
+ ```
62
+
63
+ And use them:
64
+
65
+ ```docoff-react-preview
66
+ <Card>
67
+ <CardBody>
68
+ Hello! I&apos;m card with footer.
69
+ </CardBody>
70
+ <CardFooter>
71
+ <Button label="Read more" priority="outline" />
72
+ </CardFooter>
73
+ </Card>
74
+ ```
75
+
76
+ 👉 CardFooter is required in case you need to align the actions of multiple
77
+ cards with varying height of content.
78
+
79
+ ## Raised Card
80
+
81
+ Add optional shadow to lift the card above surface.
82
+
83
+ ```docoff-react-preview
84
+ <Card raised>
85
+ <CardBody>
86
+ Hello! I&apos;m raised card with footer.
87
+ </CardBody>
88
+ <CardFooter>
89
+ <Button label="Read more" priority="outline" />
90
+ </CardFooter>
91
+ </Card>
92
+ ```
93
+
94
+ ## Dense Card
95
+
96
+ Use a dense card when you need to save space on screen. Other elements in the
97
+ card should be also smaller to keep the card contained and easy to scan.
98
+
99
+ ```docoff-react-preview
100
+ <Card dense raised>
101
+ <CardBody>
102
+ <small>Hello! I&apos;m dense card. Everything is smaller here.</small>
103
+ </CardBody>
104
+ <CardFooter>
105
+ <Button label="Read more" priority="outline" size="small" />
106
+ </CardFooter>
107
+ </Card>
108
+ ```
109
+
110
+ ## Scrollable Card
111
+
112
+ Combine Card with [ScrollView](/components/ScrollView) to enable scrolling
113
+ for card content.
114
+
115
+ ```docoff-react-preview
116
+ <div
117
+ style={{
118
+ display: 'flex',
119
+ height: '200px',
120
+ }}
121
+ >
122
+ <Card raised>
123
+ <ScrollView>
124
+ <CardBody>
125
+ Hello! I&apos;m scrollable card.
126
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
127
+ ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis
128
+ dis parturient montes, nascetur ridiculus mus. Donec quam felis,
129
+ ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa
130
+ quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget,
131
+ arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.
132
+ Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras
133
+ dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend
134
+ tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac,
135
+ enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.
136
+ Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean
137
+ imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper
138
+ ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus
139
+ eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing
140
+ sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar,
141
+ hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus.
142
+ </CardBody>
143
+ </ScrollView>
144
+ </Card>
145
+ </div>
146
+ ```
147
+
148
+ ## Color Variants
149
+
150
+ Card supports all
151
+ [component colors](/docs/foundation/colors#component-colors) to cover different needs
152
+ of your app.
153
+
154
+ ```docoff-react-preview
155
+ <Card color="success">
156
+ <CardBody>
157
+ Hello! I&apos;m success variant of card.
158
+ </CardBody>
159
+ <CardFooter>
160
+ <Button label="Read more" priority="outline" color="success" />
161
+ </CardFooter>
162
+ </Card>
163
+ <Card color="warning">
164
+ <CardBody>
165
+ Hello! I&apos;m warning variant of card.
166
+ </CardBody>
167
+ <CardFooter>
168
+ <Button label="Read more" priority="outline" color="warning" />
169
+ </CardFooter>
170
+ </Card>
171
+ <Card color="danger">
172
+ <CardBody>
173
+ Hello! I&apos;m danger variant of card.
174
+ </CardBody>
175
+ <CardFooter>
176
+ <Button label="Read more" priority="outline" color="danger" />
177
+ </CardFooter>
178
+ </Card>
179
+ <Card color="help">
180
+ <CardBody>
181
+ Hello! I&apos;m help variant of card.
182
+ </CardBody>
183
+ <CardFooter>
184
+ <Button label="Read more" priority="outline" color="help" />
185
+ </CardFooter>
186
+ </Card>
187
+ <Card color="info">
188
+ <CardBody>
189
+ Hello! I&apos;m info variant of card.
190
+ </CardBody>
191
+ <CardFooter>
192
+ <Button label="Read more" priority="outline" color="info" />
193
+ </CardFooter>
194
+ </Card>
195
+ <Card color="note">
196
+ <CardBody>
197
+ Hello! I&apos;m note variant of card.
198
+ </CardBody>
199
+ <CardFooter>
200
+ <Button label="Read more" priority="outline" color="note" />
201
+ </CardFooter>
202
+ </Card>
203
+ <Card>
204
+ <CardBody>
205
+ Hello! I&apos;m light (default) variant of card.
206
+ </CardBody>
207
+ <CardFooter>
208
+ <Button label="Read more" priority="outline" color="dark" />
209
+ </CardFooter>
210
+ </Card>
211
+ <Card color="dark">
212
+ <CardBody>
213
+ Hello! I&apos;m dark variant of card.
214
+ </CardBody>
215
+ <CardFooter>
216
+ <Button label="Read more" priority="outline" color="light" />
217
+ </CardFooter>
218
+ </Card>
219
+ ```
220
+
221
+ ## States
222
+
223
+ ### Disabled State
224
+
225
+ Entire card can appear disabled. However, you'll still need to manually disable
226
+ its interactive elements to disallow user's interaction.
227
+
228
+ ```docoff-react-preview
229
+ <Card disabled>
230
+ <CardBody>
231
+ Hello! I&apos;m a disabled card.
232
+ </CardBody>
233
+ <CardFooter>
234
+ <Button label="Read more" priority="outline" disabled />
235
+ </CardFooter>
236
+ </Card>
237
+ <Card disabled raised>
238
+ <CardBody>
239
+ Hello! I&apos;m a disabled raised card.
240
+ </CardBody>
241
+ <CardFooter>
242
+ <Button label="Read more" priority="outline" disabled />
243
+ </CardFooter>
244
+ </Card>
245
+ <Card color="success" disabled>
246
+ <CardBody>
247
+ Hello! I&apos;m a disabled success variant of card.
248
+ </CardBody>
249
+ <CardFooter>
250
+ <Button label="Read more" priority="outline" color="success" disabled />
251
+ </CardFooter>
252
+ </Card>
253
+ ```
254
+
255
+ ## Forwarding HTML Attributes
256
+
257
+ In addition to the options below in the [component's API](#api) section, you
258
+ can specify [React synthetic events] or **any HTML attribute you like.** All
259
+ attributes that don't interfere with the API are forwarded to the root `<div>`
260
+ HTML element. This enables making the component interactive and helps to improve
261
+ its accessibility.
262
+
263
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
264
+ [div] element.
265
+
266
+ ## API
267
+
268
+ <docoff-react-props src="/components/Card/Card.jsx"></docoff-react-props>
269
+
270
+ ### CardBody
271
+
272
+ Space your content with CardBody. See [Composition](#composition) for
273
+ all details.
274
+
275
+ <docoff-react-props src="/components/Card/CardBody.jsx"></docoff-react-props>
276
+
277
+ ### CardFooter
278
+
279
+ Separate your card actions with CardFooter. See
280
+ [Composition](#composition) for all details.
281
+
282
+ <docoff-react-props src="/components/Card/CardFooter.jsx"></docoff-react-props>
283
+
284
+ ## Theming
285
+
286
+ ### Common Theming Options
287
+
288
+ | Custom Property | Description |
289
+ |------------------------------------------------------|--------------------------------------------------------------|
290
+ | `--rui-Card__padding` | Padding shared by card header, body and footer |
291
+ | `--rui-Card__border-width` | Border width |
292
+ | `--rui-Card__border-radius` | Corner radius |
293
+ | `--rui-Card--dense__padding` | Padding of dense card |
294
+ | `--rui-Card--raised__box-shadow` | Box shadow of raised card |
295
+ | `--rui-Card--disabled__background-color` | Card background color in disabled state |
296
+ | `--rui-Card--disabled__opacity` | Card opacity in disabled state |
297
+
298
+ ### Theming Variants
299
+
300
+ It's possible to adjust the theme of specific color variant. Naming convention
301
+ looks as follows:
302
+
303
+ `--rui-Card--<COLOR>__<PROPERTY>`
304
+
305
+ Where:
306
+
307
+ - `<COLOR>` is one of supported
308
+ [component colors](/docs/foundation/colors#component-colors)
309
+ (see [color variants](#color-variants) and [API](#api)),
310
+ - `<PROPERTY>` is one of `color` (color of text), `border-color`, or
311
+ `background-color`.
312
+
313
+ [React synthetic events]: https://reactjs.org/docs/events.html
314
+ [div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes