grommet 2.46.1 → 2.47.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.
Files changed (221) hide show
  1. package/components/Accordion/index.d.ts +7 -1
  2. package/components/AccordionPanel/index.d.ts +4 -1
  3. package/components/Anchor/index.d.ts +7 -1
  4. package/components/Avatar/Avatar.js +4 -3
  5. package/components/Avatar/index.d.ts +9 -1
  6. package/components/Avatar/propTypes.js +2 -1
  7. package/components/Box/StyledBox.js +9 -1
  8. package/components/Box/index.d.ts +9 -2
  9. package/components/Button/index.d.ts +14 -2
  10. package/components/Calendar/Calendar.js +43 -32
  11. package/components/Calendar/StyledCalendar.js +86 -32
  12. package/components/Calendar/index.d.ts +15 -2
  13. package/components/Calendar/propTypes.js +1 -0
  14. package/components/Cards/index.d.ts +7 -1
  15. package/components/Carousel/index.d.ts +4 -1
  16. package/components/Chart/index.d.ts +7 -1
  17. package/components/CheckBox/index.d.ts +7 -1
  18. package/components/CheckBoxGroup/index.d.ts +15 -2
  19. package/components/Clock/index.d.ts +14 -2
  20. package/components/Collapsible/index.d.ts +4 -1
  21. package/components/Data/index.d.ts +4 -1
  22. package/components/DataFilter/index.d.ts +4 -1
  23. package/components/DataFilters/index.d.ts +4 -1
  24. package/components/DataTable/Body.js +13 -7
  25. package/components/DataTable/DataTable.js +6 -1
  26. package/components/DataTable/index.d.ts +11 -2
  27. package/components/DataTable/propTypes.js +5 -1
  28. package/components/DataTable/stories/rowDetails.stories.js +174 -66
  29. package/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
  30. package/components/DataTableGroupBy/index.d.ts +4 -1
  31. package/components/DataView/index.d.ts +4 -1
  32. package/components/DateInput/index.d.ts +4 -1
  33. package/components/Diagram/index.d.ts +4 -1
  34. package/components/Distribution/index.d.ts +4 -1
  35. package/components/Drop/StyledDrop.js +3 -1
  36. package/components/Drop/index.d.ts +6 -2
  37. package/components/DropButton/index.d.ts +8 -1
  38. package/components/FileInput/index.d.ts +8 -2
  39. package/components/Form/index.d.ts +7 -1
  40. package/components/FormField/index.d.ts +4 -1
  41. package/components/Grid/index.d.ts +4 -1
  42. package/components/Grommet/index.d.ts +18 -1
  43. package/components/Grommet/propTypes.js +11 -0
  44. package/components/Header/stories/typescript/Ref.stories.tsx +1 -1
  45. package/components/Heading/index.d.ts +7 -7
  46. package/components/Image/index.d.ts +4 -1
  47. package/components/InfiniteScroll/index.d.ts +2 -2
  48. package/components/Layer/index.d.ts +4 -1
  49. package/components/List/index.d.ts +9 -3
  50. package/components/Markdown/index.d.ts +5 -1
  51. package/components/MaskedInput/MaskedInput.js +49 -4
  52. package/components/MaskedInput/index.d.ts +7 -1
  53. package/components/MaskedInput/stories/CustomBox.stories.js +1 -0
  54. package/components/MaskedInput/stories/Date.stories.js +1 -0
  55. package/components/MaskedInput/stories/DateRange.stories.js +1 -0
  56. package/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
  57. package/components/MaskedInput/stories/Filtered.stories.js +1 -0
  58. package/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
  59. package/components/MaskedInput/stories/Time.stories.js +1 -0
  60. package/components/NameValueList/index.d.ts +8 -1
  61. package/components/Notification/index.d.ts +1 -0
  62. package/components/PageHeader/index.d.ts +5 -1
  63. package/components/Pagination/PaginationStep.js +4 -0
  64. package/components/Pagination/index.d.ts +5 -0
  65. package/components/Pagination/propTypes.js +6 -1
  66. package/components/Paragraph/index.d.ts +7 -1
  67. package/components/RadioButton/index.d.ts +7 -1
  68. package/components/RadioButtonGroup/index.d.ts +7 -1
  69. package/components/RangeInput/index.d.ts +7 -1
  70. package/components/RangeSelector/index.d.ts +15 -2
  71. package/components/RoutedAnchor/index.d.ts +3 -2
  72. package/components/RoutedButton/index.d.ts +3 -2
  73. package/components/Select/Select.js +2 -4
  74. package/components/Select/index.d.ts +7 -1
  75. package/components/Select/utils.js +12 -3
  76. package/components/SelectMultiple/SelectMultiple.js +5 -10
  77. package/components/SelectMultiple/SelectMultipleContainer.js +2 -4
  78. package/components/SelectMultiple/SelectMultipleValue.js +1 -2
  79. package/components/SelectMultiple/index.d.ts +7 -1
  80. package/components/Sidebar/index.d.ts +4 -1
  81. package/components/Stack/index.d.ts +4 -1
  82. package/components/Tab/index.d.ts +7 -1
  83. package/components/Table/index.d.ts +4 -1
  84. package/components/TableBody/index.d.ts +4 -1
  85. package/components/TableCell/index.d.ts +10 -3
  86. package/components/TableFooter/index.d.ts +4 -1
  87. package/components/TableHeader/index.d.ts +4 -1
  88. package/components/TableRow/index.d.ts +4 -1
  89. package/components/Tabs/index.d.ts +4 -1
  90. package/components/Tag/Tag.js +15 -1
  91. package/components/Tag/index.d.ts +6 -0
  92. package/components/Tag/propTypes.js +6 -0
  93. package/components/Text/Text.js +3 -2
  94. package/components/Text/index.d.ts +7 -1
  95. package/components/TextArea/index.d.ts +7 -1
  96. package/components/TextInput/TextInput.js +6 -2
  97. package/components/TextInput/index.d.ts +6 -3
  98. package/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
  99. package/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
  100. package/components/TextInput/stories/OnSelect.stories.js +1 -0
  101. package/components/TextInput/stories/WithTags.stories.js +1 -0
  102. package/components/Tip/Tip.js +16 -1
  103. package/components/ToggleGroup/index.d.ts +7 -1
  104. package/components/Toolbar/index.d.ts +5 -2
  105. package/components/Video/index.d.ts +7 -1
  106. package/components/WorldMap/index.d.ts +7 -1
  107. package/es6/components/Accordion/index.d.ts +7 -1
  108. package/es6/components/AccordionPanel/index.d.ts +4 -1
  109. package/es6/components/Anchor/index.d.ts +7 -1
  110. package/es6/components/Avatar/Avatar.js +4 -3
  111. package/es6/components/Avatar/index.d.ts +9 -1
  112. package/es6/components/Avatar/propTypes.js +2 -1
  113. package/es6/components/Box/StyledBox.js +8 -1
  114. package/es6/components/Box/index.d.ts +9 -2
  115. package/es6/components/Button/index.d.ts +14 -2
  116. package/es6/components/Calendar/Calendar.js +44 -32
  117. package/es6/components/Calendar/StyledCalendar.js +86 -32
  118. package/es6/components/Calendar/index.d.ts +15 -2
  119. package/es6/components/Calendar/propTypes.js +1 -0
  120. package/es6/components/Cards/index.d.ts +7 -1
  121. package/es6/components/Carousel/index.d.ts +4 -1
  122. package/es6/components/Chart/index.d.ts +7 -1
  123. package/es6/components/CheckBox/index.d.ts +7 -1
  124. package/es6/components/CheckBoxGroup/index.d.ts +15 -2
  125. package/es6/components/Clock/index.d.ts +14 -2
  126. package/es6/components/Collapsible/index.d.ts +4 -1
  127. package/es6/components/Data/index.d.ts +4 -1
  128. package/es6/components/DataFilter/index.d.ts +4 -1
  129. package/es6/components/DataFilters/index.d.ts +4 -1
  130. package/es6/components/DataTable/Body.js +13 -7
  131. package/es6/components/DataTable/DataTable.js +6 -1
  132. package/es6/components/DataTable/index.d.ts +11 -2
  133. package/es6/components/DataTable/propTypes.js +5 -1
  134. package/es6/components/DataTable/stories/rowDetails.stories.js +172 -66
  135. package/es6/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
  136. package/es6/components/DataTableGroupBy/index.d.ts +4 -1
  137. package/es6/components/DataView/index.d.ts +4 -1
  138. package/es6/components/DateInput/index.d.ts +4 -1
  139. package/es6/components/Diagram/index.d.ts +4 -1
  140. package/es6/components/Distribution/index.d.ts +4 -1
  141. package/es6/components/Drop/StyledDrop.js +3 -1
  142. package/es6/components/Drop/index.d.ts +6 -2
  143. package/es6/components/DropButton/index.d.ts +8 -1
  144. package/es6/components/FileInput/index.d.ts +8 -2
  145. package/es6/components/Form/index.d.ts +7 -1
  146. package/es6/components/FormField/index.d.ts +4 -1
  147. package/es6/components/Grid/index.d.ts +4 -1
  148. package/es6/components/Grommet/index.d.ts +18 -1
  149. package/es6/components/Grommet/propTypes.js +11 -0
  150. package/es6/components/Header/stories/typescript/Ref.stories.tsx +1 -1
  151. package/es6/components/Heading/index.d.ts +7 -7
  152. package/es6/components/Image/index.d.ts +4 -1
  153. package/es6/components/InfiniteScroll/index.d.ts +2 -2
  154. package/es6/components/Layer/index.d.ts +4 -1
  155. package/es6/components/List/index.d.ts +9 -3
  156. package/es6/components/Markdown/index.d.ts +5 -1
  157. package/es6/components/MaskedInput/MaskedInput.js +49 -4
  158. package/es6/components/MaskedInput/index.d.ts +7 -1
  159. package/es6/components/MaskedInput/stories/CustomBox.stories.js +1 -0
  160. package/es6/components/MaskedInput/stories/Date.stories.js +1 -0
  161. package/es6/components/MaskedInput/stories/DateRange.stories.js +1 -0
  162. package/es6/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
  163. package/es6/components/MaskedInput/stories/Filtered.stories.js +1 -0
  164. package/es6/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
  165. package/es6/components/MaskedInput/stories/Time.stories.js +1 -0
  166. package/es6/components/NameValueList/index.d.ts +8 -1
  167. package/es6/components/Notification/index.d.ts +1 -0
  168. package/es6/components/PageHeader/index.d.ts +5 -1
  169. package/es6/components/Pagination/PaginationStep.js +4 -0
  170. package/es6/components/Pagination/index.d.ts +5 -0
  171. package/es6/components/Pagination/propTypes.js +6 -1
  172. package/es6/components/Paragraph/index.d.ts +7 -1
  173. package/es6/components/RadioButton/index.d.ts +7 -1
  174. package/es6/components/RadioButtonGroup/index.d.ts +7 -1
  175. package/es6/components/RangeInput/index.d.ts +7 -1
  176. package/es6/components/RangeSelector/index.d.ts +15 -2
  177. package/es6/components/RoutedAnchor/index.d.ts +3 -2
  178. package/es6/components/RoutedButton/index.d.ts +3 -2
  179. package/es6/components/Select/Select.js +3 -5
  180. package/es6/components/Select/index.d.ts +7 -1
  181. package/es6/components/Select/utils.js +9 -2
  182. package/es6/components/SelectMultiple/SelectMultiple.js +6 -11
  183. package/es6/components/SelectMultiple/SelectMultipleContainer.js +3 -5
  184. package/es6/components/SelectMultiple/SelectMultipleValue.js +2 -3
  185. package/es6/components/SelectMultiple/index.d.ts +7 -1
  186. package/es6/components/Sidebar/index.d.ts +4 -1
  187. package/es6/components/Stack/index.d.ts +4 -1
  188. package/es6/components/Tab/index.d.ts +7 -1
  189. package/es6/components/Table/index.d.ts +4 -1
  190. package/es6/components/TableBody/index.d.ts +4 -1
  191. package/es6/components/TableCell/index.d.ts +10 -3
  192. package/es6/components/TableFooter/index.d.ts +4 -1
  193. package/es6/components/TableHeader/index.d.ts +4 -1
  194. package/es6/components/TableRow/index.d.ts +4 -1
  195. package/es6/components/Tabs/index.d.ts +4 -1
  196. package/es6/components/Tag/Tag.js +16 -2
  197. package/es6/components/Tag/index.d.ts +6 -0
  198. package/es6/components/Tag/propTypes.js +6 -0
  199. package/es6/components/Text/Text.js +3 -2
  200. package/es6/components/Text/index.d.ts +7 -1
  201. package/es6/components/TextArea/index.d.ts +7 -1
  202. package/es6/components/TextInput/TextInput.js +6 -2
  203. package/es6/components/TextInput/index.d.ts +6 -3
  204. package/es6/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
  205. package/es6/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
  206. package/es6/components/TextInput/stories/OnSelect.stories.js +1 -0
  207. package/es6/components/TextInput/stories/WithTags.stories.js +1 -0
  208. package/es6/components/Tip/Tip.js +17 -1
  209. package/es6/components/ToggleGroup/index.d.ts +7 -1
  210. package/es6/components/Toolbar/index.d.ts +5 -2
  211. package/es6/components/Video/index.d.ts +7 -1
  212. package/es6/components/WorldMap/index.d.ts +7 -1
  213. package/es6/languages/default.json +6 -0
  214. package/es6/utils/mixins.js +2 -1
  215. package/grommet.min.js +1 -1
  216. package/grommet.min.js.map +1 -1
  217. package/languages/default.json +6 -0
  218. package/package.json +9 -9
  219. package/utils/mixins.js +2 -1
  220. package/components/Drop/stories/TrapFocus.stories.js +0 -86
  221. package/es6/components/Drop/stories/TrapFocus.stories.js +0 -82
@@ -1,6 +1,14 @@
1
1
  import styled, { css, keyframes } from 'styled-components';
2
+ import { Button } from '../Button';
2
3
  import { backgroundStyle, focusStyle, genericStyles, kindPartStyles, normalizeColor, parseMetricToNum, roundStyle, styledComponentsConfig } from '../../utils';
3
4
  import { activeStyle } from '../../utils/background';
5
+ import { breakpointStyle } from '../../utils/mixins';
6
+ var responsiveSizeStyle = function responsiveSizeStyle(props) {
7
+ var breakpoint = props.theme.global.size[props.sizeProp];
8
+ return breakpointStyle({
9
+ value: breakpoint
10
+ }, "\n width: 100vw;\n max-width: " + breakpoint + ";\n ", true);
11
+ };
4
12
  var sizeStyle = function sizeStyle(props) {
5
13
  var data = props.theme.calendar[props.sizeProp];
6
14
  var width = props.fillContainer ? '100%' : props.theme.global.size[props.sizeProp];
@@ -11,8 +19,10 @@ var sizeStyle = function sizeStyle(props) {
11
19
  var StyledCalendar = styled.div.withConfig(styledComponentsConfig).withConfig({
12
20
  displayName: "StyledCalendar",
13
21
  componentId: "sc-1y4xhmp-0"
14
- })(["", " ", " ", ""], genericStyles, function (props) {
22
+ })(["", " ", " ", " ", ""], genericStyles, function (props) {
15
23
  return sizeStyle(props);
24
+ }, function (props) {
25
+ return props.responsive && responsiveSizeStyle(props);
16
26
  }, function (props) {
17
27
  return props.theme.calendar && props.theme.calendar.extend;
18
28
  });
@@ -20,11 +30,20 @@ var weeksContainerSizeStyle = function weeksContainerSizeStyle(props) {
20
30
  var height = props.fillContainer ? '100%' : parseMetricToNum(props.theme.calendar[props.sizeProp].daySize) * 6 + "px";
21
31
  return "\n height: " + height + ";\n\n ";
22
32
  };
33
+ var weeksContainerResponsiveSizeStyle = function weeksContainerResponsiveSizeStyle(props) {
34
+ var breakpoint = props.theme.global.size[props.sizeProp];
35
+ // set aspect-ratio to 7 days by 6 weeks
36
+ return breakpointStyle({
37
+ value: breakpoint
38
+ }, "\n height: auto;\n aspect-ratio: 7/6;\n ", true);
39
+ };
23
40
  var StyledWeeksContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
24
41
  displayName: "StyledCalendar__StyledWeeksContainer",
25
42
  componentId: "sc-1y4xhmp-1"
26
- })(["overflow:hidden;", " ", ";"], function (props) {
43
+ })(["overflow:hidden;", " ", " ", ";"], function (props) {
27
44
  return weeksContainerSizeStyle(props);
45
+ }, function (props) {
46
+ return props.responsive && weeksContainerResponsiveSizeStyle(props);
28
47
  }, function (props) {
29
48
  return props.focus && !props.plain && focusStyle();
30
49
  });
@@ -75,45 +94,78 @@ var StyledWeek = styled.div.withConfig(styledComponentsConfig).withConfig({
75
94
  })(["display:flex;justify-content:space-between;", ""], function (props) {
76
95
  return props.fillContainer && 'flex: 1;';
77
96
  });
97
+ var responsiveDayContainerStyle = function responsiveDayContainerStyle(props) {
98
+ var breakpoint = props.theme.global.size[props.sizeProp];
99
+ return breakpointStyle({
100
+ value: breakpoint
101
+ }, "\n width: 14.3%;\n ", true);
102
+ };
78
103
 
79
104
  // The width of 14.3% is derived from dividing 100/7. We want the
80
105
  // widths of 7 days to equally fill 100% of the row.
81
106
  var StyledDayContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
82
107
  displayName: "StyledCalendar__StyledDayContainer",
83
108
  componentId: "sc-1y4xhmp-4"
84
- })(["flex:0 1 auto;", " ", " ", ""], function (props) {
109
+ })(["flex:0 1 auto;", " ", " ", " ", ""], function (props) {
85
110
  return props.fillContainer && 'width: 14.3%;';
86
111
  }, function (props) {
87
112
  var _props$theme$calendar7;
88
113
  return (props.inRange || props.isSelected && props.rangePosition) && ((_props$theme$calendar7 = props.theme.calendar) == null || (_props$theme$calendar7 = _props$theme$calendar7.range) == null ? void 0 : _props$theme$calendar7.background) && backgroundStyle(props.theme.calendar.range.background, props.theme);
89
114
  }, function (props) {
90
115
  return rangeRoundStyle(props);
116
+ }, function (props) {
117
+ return props.responsive && responsiveDayContainerStyle(props);
118
+ });
119
+ var responsiveDayButtonStyle = function responsiveDayButtonStyle(props) {
120
+ var breakpoint = props.theme.global.size[props.sizeProp];
121
+ return breakpointStyle({
122
+ value: breakpoint
123
+ }, "\n width: 100%;\n ", true);
124
+ };
125
+
126
+ // when caller opts in to day hover styling, apply all state styles
127
+ // on CalendarDay instead of active state on CalendarDayButton
128
+ var StyledDayButton = styled(Button).withConfig({
129
+ displayName: "StyledCalendar__StyledDayButton",
130
+ componentId: "sc-1y4xhmp-5"
131
+ })(["", " ", ""], function (props) {
132
+ var _props$theme$calendar8;
133
+ return ((_props$theme$calendar8 = props.theme.calendar) == null || (_props$theme$calendar8 = _props$theme$calendar8.day) == null || (_props$theme$calendar8 = _props$theme$calendar8.hover) == null ? void 0 : _props$theme$calendar8.background) && 'background: inherit;';
134
+ }, function (props) {
135
+ return props.responsive && responsiveDayButtonStyle(props);
91
136
  });
92
137
  var daySizeStyle = function daySizeStyle(props) {
93
138
  var data = props.theme.calendar[props.sizeProp];
94
139
  return css(["width:", ";height:", ";"], props.fillContainer ? '100%' : data.daySize, props.fillContainer ? '100%' : data.daySize);
95
140
  };
141
+ var responsiveDaySizeStyle = function responsiveDaySizeStyle(props) {
142
+ var breakpoint = props.theme.global.size[props.sizeProp];
143
+ var data = props.theme.calendar[props.sizeProp];
144
+ return breakpointStyle({
145
+ value: breakpoint
146
+ }, "\n width: 100%;\n max-width: " + data.daySize + ";\n height: auto;\n aspect-ratio: 1;\n ", true);
147
+ };
96
148
  var dayStyle = function dayStyle(props) {
97
149
  var backgroundObj;
98
150
  var colorObj;
99
151
  if (props.isSelected) {
100
- var _props$theme$calendar8, _props$theme$calendar9;
101
- backgroundObj = ((_props$theme$calendar8 = props.theme.calendar.day) == null || (_props$theme$calendar8 = _props$theme$calendar8.selected) == null ? void 0 : _props$theme$calendar8.background) || 'control';
102
- colorObj = (_props$theme$calendar9 = props.theme.calendar.day) == null || (_props$theme$calendar9 = _props$theme$calendar9.selected) == null ? void 0 : _props$theme$calendar9.color;
152
+ var _props$theme$calendar9, _props$theme$calendar10;
153
+ backgroundObj = ((_props$theme$calendar9 = props.theme.calendar.day) == null || (_props$theme$calendar9 = _props$theme$calendar9.selected) == null ? void 0 : _props$theme$calendar9.background) || 'control';
154
+ colorObj = (_props$theme$calendar10 = props.theme.calendar.day) == null || (_props$theme$calendar10 = _props$theme$calendar10.selected) == null ? void 0 : _props$theme$calendar10.color;
103
155
  } else if (props.inRange) {
104
- var _props$theme$calendar10, _props$theme$calendar11, _props$theme$calendar12, _props$theme$calendar13;
156
+ var _props$theme$calendar11, _props$theme$calendar12, _props$theme$calendar13, _props$theme$calendar14;
105
157
  // for backwards compatability, only apply this if caller hasn't specified
106
158
  // range specific rounding
107
159
  // if they have, background will be applied to StyledDayContainer
108
- backgroundObj = !((_props$theme$calendar10 = props.theme.calendar) != null && (_props$theme$calendar10 = _props$theme$calendar10[props.sizeProp]) != null && (_props$theme$calendar10 = _props$theme$calendar10.range) != null && _props$theme$calendar10.round) && !((_props$theme$calendar11 = props.theme.calendar) != null && (_props$theme$calendar11 = _props$theme$calendar11.medium.range) != null && _props$theme$calendar11.round) && (((_props$theme$calendar12 = props.theme.calendar.day) == null || (_props$theme$calendar12 = _props$theme$calendar12.inRange) == null ? void 0 : _props$theme$calendar12.background) || {
160
+ backgroundObj = !((_props$theme$calendar11 = props.theme.calendar) != null && (_props$theme$calendar11 = _props$theme$calendar11[props.sizeProp]) != null && (_props$theme$calendar11 = _props$theme$calendar11.range) != null && _props$theme$calendar11.round) && !((_props$theme$calendar12 = props.theme.calendar) != null && (_props$theme$calendar12 = _props$theme$calendar12.medium.range) != null && _props$theme$calendar12.round) && (((_props$theme$calendar13 = props.theme.calendar.day) == null || (_props$theme$calendar13 = _props$theme$calendar13.inRange) == null ? void 0 : _props$theme$calendar13.background) || {
109
161
  color: 'control',
110
162
  opacity: 'weak'
111
163
  });
112
- colorObj = (_props$theme$calendar13 = props.theme.calendar.day) == null || (_props$theme$calendar13 = _props$theme$calendar13.inRange) == null ? void 0 : _props$theme$calendar13.color;
164
+ colorObj = (_props$theme$calendar14 = props.theme.calendar.day) == null || (_props$theme$calendar14 = _props$theme$calendar14.inRange) == null ? void 0 : _props$theme$calendar14.color;
113
165
  } else {
114
- var _props$theme$calendar14, _props$theme$calendar15;
115
- backgroundObj = (_props$theme$calendar14 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar14.background;
116
- colorObj = (_props$theme$calendar15 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar15.color;
166
+ var _props$theme$calendar15, _props$theme$calendar16;
167
+ backgroundObj = (_props$theme$calendar15 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar15.background;
168
+ colorObj = (_props$theme$calendar16 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar16.color;
117
169
  }
118
170
  if (colorObj && !backgroundObj) return "color: " + normalizeColor(colorObj, props.theme) + ";";
119
171
  return backgroundStyle(backgroundObj, props.theme, colorObj);
@@ -122,17 +174,17 @@ var dayHoverStyle = function dayHoverStyle(props) {
122
174
  var backgroundObj;
123
175
  var colorObj;
124
176
  if (props.isSelected) {
125
- var _props$theme$calendar16, _props$theme$calendar17;
126
- backgroundObj = (_props$theme$calendar16 = props.theme.calendar.day) == null || (_props$theme$calendar16 = _props$theme$calendar16.selected) == null || (_props$theme$calendar16 = _props$theme$calendar16.hover) == null ? void 0 : _props$theme$calendar16.background;
127
- colorObj = (_props$theme$calendar17 = props.theme.calendar.day) == null || (_props$theme$calendar17 = _props$theme$calendar17.selected) == null || (_props$theme$calendar17 = _props$theme$calendar17.hover) == null ? void 0 : _props$theme$calendar17.color;
177
+ var _props$theme$calendar17, _props$theme$calendar18;
178
+ backgroundObj = (_props$theme$calendar17 = props.theme.calendar.day) == null || (_props$theme$calendar17 = _props$theme$calendar17.selected) == null || (_props$theme$calendar17 = _props$theme$calendar17.hover) == null ? void 0 : _props$theme$calendar17.background;
179
+ colorObj = (_props$theme$calendar18 = props.theme.calendar.day) == null || (_props$theme$calendar18 = _props$theme$calendar18.selected) == null || (_props$theme$calendar18 = _props$theme$calendar18.hover) == null ? void 0 : _props$theme$calendar18.color;
128
180
  } else if (props.inRange) {
129
- var _props$theme$calendar18, _props$theme$calendar19;
130
- backgroundObj = (_props$theme$calendar18 = props.theme.calendar.day) == null || (_props$theme$calendar18 = _props$theme$calendar18.inRange) == null || (_props$theme$calendar18 = _props$theme$calendar18.hover) == null ? void 0 : _props$theme$calendar18.background;
131
- colorObj = (_props$theme$calendar19 = props.theme.calendar.day) == null || (_props$theme$calendar19 = _props$theme$calendar19.inRange) == null || (_props$theme$calendar19 = _props$theme$calendar19.hover) == null ? void 0 : _props$theme$calendar19.color;
181
+ var _props$theme$calendar19, _props$theme$calendar20;
182
+ backgroundObj = (_props$theme$calendar19 = props.theme.calendar.day) == null || (_props$theme$calendar19 = _props$theme$calendar19.inRange) == null || (_props$theme$calendar19 = _props$theme$calendar19.hover) == null ? void 0 : _props$theme$calendar19.background;
183
+ colorObj = (_props$theme$calendar20 = props.theme.calendar.day) == null || (_props$theme$calendar20 = _props$theme$calendar20.inRange) == null || (_props$theme$calendar20 = _props$theme$calendar20.hover) == null ? void 0 : _props$theme$calendar20.color;
132
184
  } else {
133
- var _props$theme$calendar20, _props$theme$calendar21;
134
- backgroundObj = (_props$theme$calendar20 = props.theme.calendar.day) == null || (_props$theme$calendar20 = _props$theme$calendar20.hover) == null ? void 0 : _props$theme$calendar20.background;
135
- colorObj = (_props$theme$calendar21 = props.theme.calendar.day) == null || (_props$theme$calendar21 = _props$theme$calendar21.hover) == null ? void 0 : _props$theme$calendar21.color;
185
+ var _props$theme$calendar21, _props$theme$calendar22;
186
+ backgroundObj = (_props$theme$calendar21 = props.theme.calendar.day) == null || (_props$theme$calendar21 = _props$theme$calendar21.hover) == null ? void 0 : _props$theme$calendar21.background;
187
+ colorObj = (_props$theme$calendar22 = props.theme.calendar.day) == null || (_props$theme$calendar22 = _props$theme$calendar22.hover) == null ? void 0 : _props$theme$calendar22.color;
136
188
  }
137
189
  if (colorObj && !backgroundObj) return "color: " + normalizeColor(colorObj, props.theme) + ";";
138
190
  return backgroundStyle(backgroundObj, props.theme, colorObj);
@@ -140,30 +192,32 @@ var dayHoverStyle = function dayHoverStyle(props) {
140
192
  var dayFontStyle = function dayFontStyle(props) {
141
193
  var fontWeight;
142
194
  if (props.isSelected) {
143
- var _props$theme$calendar22;
144
- fontWeight = (_props$theme$calendar22 = props.theme.calendar.day) == null || (_props$theme$calendar22 = _props$theme$calendar22.selected) == null || (_props$theme$calendar22 = _props$theme$calendar22.font) == null ? void 0 : _props$theme$calendar22.weight;
145
- } else if (props.inRange) {
146
195
  var _props$theme$calendar23;
147
- fontWeight = (_props$theme$calendar23 = props.theme.calendar.day) == null || (_props$theme$calendar23 = _props$theme$calendar23.inRange) == null || (_props$theme$calendar23 = _props$theme$calendar23.font) == null ? void 0 : _props$theme$calendar23.weight;
196
+ fontWeight = (_props$theme$calendar23 = props.theme.calendar.day) == null || (_props$theme$calendar23 = _props$theme$calendar23.selected) == null || (_props$theme$calendar23 = _props$theme$calendar23.font) == null ? void 0 : _props$theme$calendar23.weight;
197
+ } else if (props.inRange) {
198
+ var _props$theme$calendar24;
199
+ fontWeight = (_props$theme$calendar24 = props.theme.calendar.day) == null || (_props$theme$calendar24 = _props$theme$calendar24.inRange) == null || (_props$theme$calendar24 = _props$theme$calendar24.font) == null ? void 0 : _props$theme$calendar24.weight;
148
200
  }
149
201
  return fontWeight && "font-weight: " + fontWeight + ";";
150
202
  };
151
203
  var StyledDay = styled.div.withConfig(styledComponentsConfig).withConfig({
152
204
  displayName: "StyledCalendar__StyledDay",
153
- componentId: "sc-1y4xhmp-5"
154
- })(["display:flex;justify-content:center;align-items:center;color:", ";", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
155
- var _props$theme$calendar24;
156
- return normalizeColor(props.otherMonth ? ((_props$theme$calendar24 = props.theme.calendar) == null || (_props$theme$calendar24 = _props$theme$calendar24.day) == null || (_props$theme$calendar24 = _props$theme$calendar24.adjacent) == null ? void 0 : _props$theme$calendar24.color) || 'text-xweak' : 'text-strong', props.theme);
205
+ componentId: "sc-1y4xhmp-6"
206
+ })(["display:flex;justify-content:center;align-items:center;color:", ";", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
207
+ var _props$theme$calendar25;
208
+ return normalizeColor(props.otherMonth ? ((_props$theme$calendar25 = props.theme.calendar) == null || (_props$theme$calendar25 = _props$theme$calendar25.day) == null || (_props$theme$calendar25 = _props$theme$calendar25.adjacent) == null ? void 0 : _props$theme$calendar25.color) || 'text-xweak' : 'text-strong', props.theme);
157
209
  }, function (props) {
158
210
  return daySizeStyle(props);
211
+ }, function (props) {
212
+ return props.responsive && responsiveDaySizeStyle(props);
159
213
  }, function (props) {
160
214
  return dayStyle(props);
161
215
  }, function (props) {
162
216
  return dayFontStyle(props);
163
217
  }, function (props) {
164
- var _props$theme$calendar25, _props$theme$calendar26;
218
+ var _props$theme$calendar26, _props$theme$calendar27;
165
219
  // fallback to medium if no size-specific styles
166
- var round = ((_props$theme$calendar25 = props.theme.calendar) == null || (_props$theme$calendar25 = _props$theme$calendar25[props.sizeProp]) == null || (_props$theme$calendar25 = _props$theme$calendar25.day) == null ? void 0 : _props$theme$calendar25.round) || ((_props$theme$calendar26 = props.theme.calendar) == null || (_props$theme$calendar26 = _props$theme$calendar26.medium) == null || (_props$theme$calendar26 = _props$theme$calendar26.day) == null ? void 0 : _props$theme$calendar26.round);
220
+ var round = ((_props$theme$calendar26 = props.theme.calendar) == null || (_props$theme$calendar26 = _props$theme$calendar26[props.sizeProp]) == null || (_props$theme$calendar26 = _props$theme$calendar26.day) == null ? void 0 : _props$theme$calendar26.round) || ((_props$theme$calendar27 = props.theme.calendar) == null || (_props$theme$calendar27 = _props$theme$calendar27.medium) == null || (_props$theme$calendar27 = _props$theme$calendar27.day) == null ? void 0 : _props$theme$calendar27.round);
167
221
  return round && roundStyle(round, props.responsive, props.theme);
168
222
  }, function (props) {
169
223
  return props.active && activeStyle;
@@ -178,4 +232,4 @@ var StyledDay = styled.div.withConfig(styledComponentsConfig).withConfig({
178
232
  }, function (props) {
179
233
  return props.theme.calendar && props.theme.calendar.day && props.theme.calendar.day.extend;
180
234
  });
181
- export { StyledCalendar, StyledWeeksContainer, StyledWeeks, StyledWeek, StyledDayContainer, StyledDay };
235
+ export { StyledCalendar, StyledWeeksContainer, StyledWeeks, StyledWeek, StyledDayContainer, StyledDayButton, StyledDay };
@@ -49,17 +49,30 @@ export interface CalendarProps {
49
49
  onSelect?: (select: string | string[]) => any;
50
50
  range?: boolean | 'array';
51
51
  reference?: string;
52
+ responsive?: boolean;
52
53
  showAdjacentDays?: boolean | 'trim';
53
54
  size?: 'small' | 'medium' | 'large' | string;
54
55
  }
55
56
 
56
57
  export interface CalendarExtendedProps
57
58
  extends CalendarProps,
58
- Omit<JSX.IntrinsicElements['div'], keyof CalendarProps> {}
59
+ Omit<
60
+ React.DetailedHTMLProps<
61
+ React.HTMLAttributes<HTMLDivElement>,
62
+ HTMLDivElement
63
+ >,
64
+ keyof CalendarProps
65
+ > {}
59
66
 
60
67
  // Keep type alias for backwards compatibility.
61
68
  export type CalendarType = CalendarProps &
62
- Omit<JSX.IntrinsicElements['div'], 'onSelect'>;
69
+ Omit<
70
+ React.DetailedHTMLProps<
71
+ React.HTMLAttributes<HTMLDivElement>,
72
+ HTMLDivElement
73
+ >,
74
+ 'onSelect'
75
+ >;
63
76
 
64
77
  declare const Calendar: React.ComponentClass<CalendarExtendedProps>;
65
78
 
@@ -25,6 +25,7 @@ if (process.env.NODE_ENV !== 'production') {
25
25
  onSelect: PropTypes.func,
26
26
  range: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['array'])]),
27
27
  reference: PropTypes.string,
28
+ responsive: PropTypes.bool,
28
29
  showAdjacentDays: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['trim'])]),
29
30
  size: PropTypes.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string])
30
31
  });
@@ -25,7 +25,13 @@ export interface CardsProps<CardType = any> {
25
25
  step?: number;
26
26
  }
27
27
 
28
- type ulProps = Omit<JSX.IntrinsicElements['ul'], 'children'>;
28
+ type ulProps = Omit<
29
+ React.DetailedHTMLProps<
30
+ React.HTMLAttributes<HTMLUListElement>,
31
+ HTMLUListElement
32
+ >,
33
+ 'children'
34
+ >;
29
35
 
30
36
  export interface CardsExtendedProps<CardType>
31
37
  extends CardsProps<CardType>,
@@ -24,7 +24,10 @@ export interface CarouselProps {
24
24
  onChild?: (...args: any[]) => void;
25
25
  }
26
26
 
27
- type divType = JSX.IntrinsicElements['div'];
27
+ type divType = React.DetailedHTMLProps<
28
+ React.HTMLAttributes<HTMLDivElement>,
29
+ HTMLDivElement
30
+ >;
28
31
 
29
32
  export interface CarouselExtendedProps extends CarouselProps, divType {}
30
33
 
@@ -104,7 +104,13 @@ export interface ChartProps {
104
104
 
105
105
  export interface ChartExtendedProps
106
106
  extends ChartProps,
107
- Omit<JSX.IntrinsicElements['svg'], keyof ChartProps> {}
107
+ Omit<
108
+ React.DetailedHTMLProps<
109
+ React.SVGAttributes<SVGSVGElement>,
110
+ SVGSVGElement
111
+ >,
112
+ keyof ChartProps
113
+ > {}
108
114
 
109
115
  declare const Chart: React.FC<ChartExtendedProps>;
110
116
 
@@ -16,7 +16,13 @@ export interface CheckBoxProps {
16
16
  indeterminate?: boolean;
17
17
  }
18
18
 
19
- type inputType = Omit<JSX.IntrinsicElements['input'], 'children'>;
19
+ type inputType = Omit<
20
+ React.DetailedHTMLProps<
21
+ React.InputHTMLAttributes<HTMLInputElement>,
22
+ HTMLInputElement
23
+ >,
24
+ 'children'
25
+ >;
20
26
 
21
27
  export interface CheckBoxExtendedProps extends CheckBoxProps, inputType {}
22
28
 
@@ -9,7 +9,14 @@ interface OnChangeEvent {
9
9
  }
10
10
 
11
11
  export interface CheckBoxType
12
- extends Omit<CheckBoxProps & JSX.IntrinsicElements['input'], 'checked'> {
12
+ extends Omit<
13
+ CheckBoxProps &
14
+ React.DetailedHTMLProps<
15
+ React.InputHTMLAttributes<HTMLInputElement>,
16
+ HTMLInputElement
17
+ >,
18
+ 'checked'
19
+ > {
13
20
  [key: string]: any;
14
21
  }
15
22
 
@@ -27,7 +34,13 @@ export interface CheckBoxGroupProps {
27
34
  export interface CheckBoxGroupExtendedProps
28
35
  extends CheckBoxGroupProps,
29
36
  BoxProps,
30
- Omit<JSX.IntrinsicElements['div'], keyof CheckBoxGroupProps> {}
37
+ Omit<
38
+ React.DetailedHTMLProps<
39
+ React.HTMLAttributes<HTMLDivElement>,
40
+ HTMLDivElement
41
+ >,
42
+ keyof CheckBoxGroupProps
43
+ > {}
31
44
 
32
45
  declare const CheckBoxGroup: React.FC<CheckBoxGroupExtendedProps>;
33
46
 
@@ -35,8 +35,20 @@ export interface ClockProps {
35
35
  */
36
36
  export type ClockExtendedProps = ClockProps &
37
37
  (
38
- | Omit<JSX.IntrinsicElements['svg'], 'onChange' | 'type'>
39
- | Omit<JSX.IntrinsicElements['div'], 'onChange'>
38
+ | Omit<
39
+ React.DetailedHTMLProps<
40
+ React.SVGAttributes<SVGSVGElement>,
41
+ SVGSVGElement
42
+ >,
43
+ 'onChange' | 'type'
44
+ >
45
+ | Omit<
46
+ React.DetailedHTMLProps<
47
+ React.HTMLAttributes<HTMLDivElement>,
48
+ HTMLDivElement
49
+ >,
50
+ 'onChange'
51
+ >
40
52
  );
41
53
 
42
54
  declare const Clock: React.FC<ClockExtendedProps>;
@@ -5,7 +5,10 @@ export interface CollapsibleProps {
5
5
  direction?: 'horizontal' | 'vertical';
6
6
  }
7
7
 
8
- type divProps = JSX.IntrinsicElements['div'];
8
+ type divProps = React.DetailedHTMLProps<
9
+ React.HTMLAttributes<HTMLDivElement>,
10
+ HTMLDivElement
11
+ >;
9
12
 
10
13
  export interface CollapsibleExtendedProps extends CollapsibleProps, divProps {}
11
14
 
@@ -125,7 +125,10 @@ export interface DataProps {
125
125
  // onDeleteView?: (string) => void;
126
126
  }
127
127
 
128
- type divProps = Omit<JSX.IntrinsicElements['div'], 'onClick'>;
128
+ type divProps = Omit<
129
+ React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
130
+ 'onClick'
131
+ >;
129
132
 
130
133
  export interface DataExtendedProps extends BoxProps, DataProps, divProps {}
131
134
 
@@ -18,7 +18,10 @@ export interface DataFilterProps {
18
18
  };
19
19
  }
20
20
 
21
- type divProps = Omit<JSX.IntrinsicElements['div'], 'onClick' | 'property'>;
21
+ type divProps = Omit<
22
+ React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
23
+ 'onClick' | 'property'
24
+ >;
22
25
 
23
26
  export interface DataFilterExtendedProps
24
27
  extends BoxProps,
@@ -10,7 +10,10 @@ export interface DataFiltersProps {
10
10
  updateOn?: 'change' | 'submit';
11
11
  }
12
12
 
13
- type divProps = Omit<JSX.IntrinsicElements['div'], 'onClick'>;
13
+ type divProps = Omit<
14
+ React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
15
+ 'onClick'
16
+ >;
14
17
 
15
18
  export interface DataFiltersExtendedProps
16
19
  extends BoxProps,
@@ -35,7 +35,6 @@ var Row = /*#__PURE__*/memo(function (_ref) {
35
35
  columns = _ref.columns,
36
36
  pinnedOffset = _ref.pinnedOffset,
37
37
  primaryProperty = _ref.primaryProperty,
38
- data = _ref.data,
39
38
  verticalAlign = _ref.verticalAlign;
40
39
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledDataTableRow, {
41
40
  ref: rowRef,
@@ -98,12 +97,19 @@ var Row = /*#__PURE__*/memo(function (_ref) {
98
97
  context: isRowExpanded ? 'groupHeader' : 'body',
99
98
  expanded: isRowExpanded,
100
99
  onToggle: function onToggle() {
100
+ var nextRowExpand;
101
+ var rowKey = primaryValue || index;
101
102
  if (isRowExpanded) {
102
- setRowExpand(rowExpand.filter(function (s) {
103
- return s !== index;
104
- }));
103
+ nextRowExpand = rowExpand.filter(function (s) {
104
+ return s !== rowKey;
105
+ });
106
+ } else {
107
+ nextRowExpand = [].concat(rowExpand, [rowKey]);
108
+ }
109
+ if (rowDetails.onExpand) {
110
+ rowDetails.onExpand(nextRowExpand, datum);
105
111
  } else {
106
- setRowExpand([].concat(rowExpand, [index]));
112
+ setRowExpand(nextRowExpand);
107
113
  }
108
114
  },
109
115
  pad: cellProps.pad,
@@ -127,7 +133,7 @@ var Row = /*#__PURE__*/memo(function (_ref) {
127
133
  key: index.toString() + "_expand"
128
134
  }, (selected || onSelect) && /*#__PURE__*/React.createElement(TableCell, null), /*#__PURE__*/React.createElement(TableCell, {
129
135
  colSpan: columns.length + 1
130
- }, rowDetails(data[index]))));
136
+ }, rowDetails.render ? rowDetails.render(datum) : rowDetails(datum))));
131
137
  });
132
138
  var Body = /*#__PURE__*/forwardRef(function (_ref2, ref) {
133
139
  var _ref3;
@@ -245,7 +251,7 @@ var Body = /*#__PURE__*/forwardRef(function (_ref2, ref) {
245
251
  var primaryValue = primaryProperty ? datumValue(datum, primaryProperty) : undefined;
246
252
  var isSelected = selected && selected.includes(primaryValue);
247
253
  var isDisabled = disabled && disabled.includes(primaryValue);
248
- var isRowExpanded = rowExpand && rowExpand.includes(index);
254
+ var isRowExpanded = rowExpand && rowExpand.includes(primaryValue || index);
249
255
  var cellProps = normalizeRowCellProps(rowProps, cellPropsProp, primaryValue, index);
250
256
  return /*#__PURE__*/React.createElement(Row, {
251
257
  key: primaryValue != null ? primaryValue : index,
@@ -184,9 +184,14 @@ var DataTable = function DataTable(_ref) {
184
184
  setSelectedDataContext(select.length);
185
185
  }
186
186
  }, [select, setSelectedDataContext]);
187
- var _useState8 = useState([]),
187
+ var _useState8 = useState((rowDetails == null ? void 0 : rowDetails.expand) || []),
188
188
  rowExpand = _useState8[0],
189
189
  setRowExpand = _useState8[1];
190
+ useEffect(function () {
191
+ if (rowDetails != null && rowDetails.expand) {
192
+ setRowExpand(rowDetails.expand);
193
+ }
194
+ }, [rowDetails == null ? void 0 : rowDetails.expand]);
190
195
 
191
196
  // any customized column widths
192
197
  var _useState9 = useState({}),
@@ -99,7 +99,13 @@ export interface DataTableProps<TRowType = any> {
99
99
  pad?: PadType;
100
100
  };
101
101
  };
102
- rowDetails?: (row: TRowType) => React.ReactNode;
102
+ rowDetails?:
103
+ | ((row: TRowType) => React.ReactNode)
104
+ | {
105
+ render: (row: TRowType) => React.ReactNode;
106
+ expand?: (string | number)[];
107
+ onExpand?: (expandedKeys: (string | number)[], datum: TRowType) => void;
108
+ };
103
109
  show?: number | { page?: number };
104
110
  size?: 'small' | 'medium' | 'large' | 'xlarge' | string;
105
111
 
@@ -152,7 +158,10 @@ export interface DataTableProps<TRowType = any> {
152
158
  export interface DataTableExtendedProps<TRowType = any>
153
159
  extends DataTableProps<TRowType>,
154
160
  Omit<
155
- JSX.IntrinsicElements['table'],
161
+ React.DetailedHTMLProps<
162
+ React.HTMLAttributes<HTMLTableElement>,
163
+ HTMLTableElement
164
+ >,
156
165
  'onSelect' | 'placeholder' | 'border'
157
166
  > {}
158
167
 
@@ -73,7 +73,11 @@ if (process.env.NODE_ENV !== 'production') {
73
73
  onSelect: PropTypes.func
74
74
  })]),
75
75
  onClickRow: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOf(['select'])]),
76
- rowDetails: PropTypes.func,
76
+ rowDetails: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
77
+ render: PropTypes.func.isRequired,
78
+ expand: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
79
+ onExpand: PropTypes.func
80
+ })]),
77
81
  onMore: PropTypes.func,
78
82
  onSearch: PropTypes.func,
79
83
  onSelect: PropTypes.func,