grommet 2.35.0 → 2.36.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 (145) hide show
  1. package/components/Anchor/Anchor.js +1 -4
  2. package/components/Anchor/StyledAnchor.js +1 -1
  3. package/components/Box/Box.js +2 -2
  4. package/components/Box/StyledBox.js +18 -1
  5. package/components/Box/index.d.ts +1 -1
  6. package/components/Box/propTypes.js +4 -1
  7. package/components/Cards/stories/Simple.js +1 -4
  8. package/components/Data/stories/Cards.js +9 -19
  9. package/components/Data/stories/Complex.js +1 -4
  10. package/components/Data/stories/ComposedToolbar.js +74 -0
  11. package/components/Data/stories/Infinite.js +29 -64
  12. package/components/Data/stories/Inline.js +1 -9
  13. package/components/Data/stories/List.js +3 -9
  14. package/components/Data/stories/Properties.js +17 -22
  15. package/components/Data/stories/Simple.js +4 -10
  16. package/components/Data/stories/SpaceX.js +8 -7
  17. package/components/Data/stories/StarWars.js +6 -12
  18. package/components/Data/stories/Views.js +4 -11
  19. package/components/DataFilter/DataFilter.js +1 -0
  20. package/components/DataFilter/stories/Simple.js +2 -6
  21. package/components/DataFilters/stories/Drop.js +2 -6
  22. package/components/DataFilters/stories/Layer.js +2 -6
  23. package/components/DataFilters/stories/Simple.js +2 -6
  24. package/components/DataSearch/stories/Drop.js +6 -11
  25. package/components/DataSearch/stories/Responsive.js +6 -12
  26. package/components/DataSearch/stories/Simple.js +5 -10
  27. package/components/DataSearch/stories/UpdateOnSubmit.js +5 -7
  28. package/components/DataSort/stories/Drop.js +2 -6
  29. package/components/DataSort/stories/Simple.js +2 -6
  30. package/components/DataSummary/stories/Simple.js +2 -6
  31. package/components/DataTableColumns/stories/Simple.js +2 -6
  32. package/components/DataTableGroupBy/stories/Simple.js +5 -7
  33. package/components/DataView/stories/Simple.js +4 -6
  34. package/components/DateInput/DateInput.js +61 -17
  35. package/components/DateInput/index.d.ts +1 -0
  36. package/components/DateInput/propTypes.js +1 -0
  37. package/components/DateInput/stories/ReadOnly.js +36 -0
  38. package/components/DateInput/utils.js +2 -2
  39. package/components/Form/Form.js +34 -1
  40. package/components/FormField/FormField.js +20 -1
  41. package/components/FormField/README.md +1 -644
  42. package/components/FormField/index.d.ts +5 -1
  43. package/components/FormField/propTypes.js +4 -1
  44. package/components/FormField/stories/ThresholdValidation.js +51 -0
  45. package/components/Grommet/Grommet.js +1 -1
  46. package/components/Grommet/index.d.ts +12 -0
  47. package/components/Grommet/propTypes.js +12 -0
  48. package/components/Layer/LayerContainer.js +1 -1
  49. package/components/List/List.js +33 -30
  50. package/components/Pagination/Pagination.js +52 -9
  51. package/components/Pagination/PaginationStep.js +41 -0
  52. package/components/Pagination/PaginationSummary.js +33 -0
  53. package/components/Pagination/index.d.ts +2 -0
  54. package/components/Pagination/propTypes.js +3 -1
  55. package/components/Pagination/stories/Steps.js +40 -0
  56. package/components/RangeInput/RangeInput.js +19 -12
  57. package/components/TextInput/CopyButton.js +53 -0
  58. package/components/TextInput/StyledTextInput.js +13 -2
  59. package/components/TextInput/TextInput.js +46 -12
  60. package/components/TextInput/index.d.ts +1 -0
  61. package/components/TextInput/propTypes.js +1 -0
  62. package/components/TextInput/stories/ReadOnly.js +43 -0
  63. package/components/Toolbar/stories/Simple.js +1 -4
  64. package/es6/components/Anchor/Anchor.js +1 -4
  65. package/es6/components/Anchor/StyledAnchor.js +1 -1
  66. package/es6/components/Box/Box.js +2 -2
  67. package/es6/components/Box/StyledBox.js +18 -1
  68. package/es6/components/Box/index.d.ts +1 -1
  69. package/es6/components/Box/propTypes.js +4 -1
  70. package/es6/components/Cards/stories/Simple.js +2 -5
  71. package/es6/components/Data/stories/Cards.js +10 -20
  72. package/es6/components/Data/stories/Complex.js +2 -5
  73. package/es6/components/Data/stories/ComposedToolbar.js +69 -0
  74. package/es6/components/Data/stories/Infinite.js +32 -66
  75. package/es6/components/Data/stories/Inline.js +2 -10
  76. package/es6/components/Data/stories/List.js +4 -10
  77. package/es6/components/Data/stories/Properties.js +18 -23
  78. package/es6/components/Data/stories/Simple.js +5 -11
  79. package/es6/components/Data/stories/SpaceX.js +9 -8
  80. package/es6/components/Data/stories/StarWars.js +7 -13
  81. package/es6/components/Data/stories/Views.js +5 -12
  82. package/es6/components/DataFilter/DataFilter.js +1 -0
  83. package/es6/components/DataFilter/stories/Simple.js +2 -6
  84. package/es6/components/DataFilters/stories/Drop.js +2 -6
  85. package/es6/components/DataFilters/stories/Layer.js +2 -6
  86. package/es6/components/DataFilters/stories/Simple.js +2 -6
  87. package/es6/components/DataSearch/stories/Drop.js +7 -12
  88. package/es6/components/DataSearch/stories/Responsive.js +7 -13
  89. package/es6/components/DataSearch/stories/Simple.js +6 -11
  90. package/es6/components/DataSearch/stories/UpdateOnSubmit.js +6 -8
  91. package/es6/components/DataSort/stories/Drop.js +2 -6
  92. package/es6/components/DataSort/stories/Simple.js +2 -6
  93. package/es6/components/DataSummary/stories/Simple.js +2 -6
  94. package/es6/components/DataTableColumns/stories/Simple.js +2 -6
  95. package/es6/components/DataTableGroupBy/stories/Simple.js +5 -7
  96. package/es6/components/DataView/stories/Simple.js +6 -8
  97. package/es6/components/DateInput/DateInput.js +61 -17
  98. package/es6/components/DateInput/index.d.ts +1 -0
  99. package/es6/components/DateInput/propTypes.js +1 -0
  100. package/es6/components/DateInput/stories/ReadOnly.js +31 -0
  101. package/es6/components/DateInput/utils.js +2 -2
  102. package/es6/components/Form/Form.js +34 -1
  103. package/es6/components/FormField/FormField.js +21 -2
  104. package/es6/components/FormField/README.md +1 -644
  105. package/es6/components/FormField/index.d.ts +5 -1
  106. package/es6/components/FormField/propTypes.js +4 -1
  107. package/es6/components/FormField/stories/ThresholdValidation.js +46 -0
  108. package/es6/components/Grommet/Grommet.js +1 -1
  109. package/es6/components/Grommet/index.d.ts +12 -0
  110. package/es6/components/Grommet/propTypes.js +12 -0
  111. package/es6/components/Layer/LayerContainer.js +1 -1
  112. package/es6/components/List/List.js +33 -30
  113. package/es6/components/Pagination/Pagination.js +52 -9
  114. package/es6/components/Pagination/PaginationStep.js +35 -0
  115. package/es6/components/Pagination/PaginationSummary.js +27 -0
  116. package/es6/components/Pagination/index.d.ts +2 -0
  117. package/es6/components/Pagination/propTypes.js +3 -1
  118. package/es6/components/Pagination/stories/Steps.js +35 -0
  119. package/es6/components/RangeInput/RangeInput.js +19 -12
  120. package/es6/components/TextInput/CopyButton.js +48 -0
  121. package/es6/components/TextInput/StyledTextInput.js +14 -3
  122. package/es6/components/TextInput/TextInput.js +46 -12
  123. package/es6/components/TextInput/index.d.ts +1 -0
  124. package/es6/components/TextInput/propTypes.js +1 -0
  125. package/es6/components/TextInput/stories/ReadOnly.js +38 -0
  126. package/es6/components/Toolbar/stories/Simple.js +2 -5
  127. package/es6/languages/default.json +23 -0
  128. package/es6/themes/base.d.ts +8 -0
  129. package/es6/themes/base.js +12 -1
  130. package/es6/utils/index.js +1 -0
  131. package/es6/utils/readOnly.js +10 -0
  132. package/grommet.min.js +1 -1
  133. package/grommet.min.js.map +1 -1
  134. package/languages/default.json +23 -0
  135. package/package.json +31 -32
  136. package/themes/base.d.ts +8 -0
  137. package/themes/base.js +12 -1
  138. package/utils/index.js +6 -0
  139. package/utils/readOnly.js +14 -0
  140. package/components/Data/stories/Controlled.js +0 -92
  141. package/components/Data/stories/DataTable.js +0 -49
  142. package/components/DataFilters/stories/Inline.js +0 -53
  143. package/es6/components/Data/stories/Controlled.js +0 -86
  144. package/es6/components/Data/stories/DataTable.js +0 -44
  145. package/es6/components/DataFilters/stories/Inline.js +0 -48
@@ -1,4 +1,4 @@
1
- var _excluded = ["a11yTitle", "defaultSuggestion", "defaultValue", "dropAlign", "dropHeight", "dropTarget", "dropProps", "focusIndicator", "icon", "id", "messages", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onSuggestionSelect", "onSuggestionsClose", "onSuggestionsOpen", "placeholder", "plain", "readOnly", "reverse", "suggestions", "textAlign", "value", "width"];
1
+ var _excluded = ["a11yTitle", "defaultSuggestion", "defaultValue", "dropAlign", "dropHeight", "dropTarget", "dropProps", "focusIndicator", "icon", "id", "messages", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onSuggestionSelect", "onSuggestionsClose", "onSuggestionsOpen", "placeholder", "plain", "readOnly", "readOnlyCopy", "reverse", "suggestions", "textAlign", "value", "width"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
4
  import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
@@ -15,6 +15,7 @@ import { isNodeAfterScroll, isNodeBeforeScroll, sizeStyle, useForwardedRef, useS
15
15
  import { StyledTextInput, StyledTextInputContainer, StyledPlaceholder, StyledIcon, StyledSuggestions } from './StyledTextInput';
16
16
  import { MessageContext } from '../../contexts/MessageContext';
17
17
  import { TextInputPropTypes } from './propTypes';
18
+ import { CopyButton } from './CopyButton';
18
19
  var renderLabel = function renderLabel(suggestion) {
19
20
  if (suggestion && typeof suggestion === 'object') {
20
21
  return suggestion.label || suggestion.value;
@@ -66,7 +67,8 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
66
67
  onSuggestionsOpen = _ref.onSuggestionsOpen,
67
68
  placeholder = _ref.placeholder,
68
69
  plain = _ref.plain,
69
- readOnly = _ref.readOnly,
70
+ readOnlyProp = _ref.readOnly,
71
+ readOnlyCopy = _ref.readOnlyCopy,
70
72
  reverse = _ref.reverse,
71
73
  suggestions = _ref.suggestions,
72
74
  textAlign = _ref.textAlign,
@@ -81,6 +83,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
81
83
  var inputRef = useForwardedRef(ref);
82
84
  var dropRef = useRef();
83
85
  var suggestionsRef = useRef();
86
+ var readOnly = readOnlyProp || readOnlyCopy;
84
87
  // if this is a readOnly property, don't set a name with the form context
85
88
  // this allows Select to control the form context for the name.
86
89
  var _formContext$useFormI = formContext.useFormInput({
@@ -104,6 +107,25 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
104
107
  var _useState3 = useState(),
105
108
  suggestionsAtClose = _useState3[0],
106
109
  setSuggestionsAtClose = _useState3[1];
110
+ var readOnlyCopyValidation = format({
111
+ id: 'input.readOnlyCopy.validation',
112
+ messages: messages
113
+ });
114
+ var readOnlyCopyPrompt = format({
115
+ id: 'input.readOnlyCopy.prompt',
116
+ messages: messages
117
+ });
118
+ var _useState4 = useState(readOnlyCopyPrompt),
119
+ tip = _useState4[0],
120
+ setTip = _useState4[1];
121
+ var onClickCopy = function onClickCopy() {
122
+ global.navigator.clipboard.writeText(value);
123
+ announce(readOnlyCopyValidation, 'assertive');
124
+ setTip(readOnlyCopyValidation);
125
+ };
126
+ var onBlurCopy = function onBlurCopy() {
127
+ if (tip === readOnlyCopyValidation) setTip(readOnlyCopyPrompt);
128
+ };
107
129
  var openDrop = useCallback(function () {
108
130
  setShowDrop(true);
109
131
  announce(format({
@@ -160,15 +182,15 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
160
182
 
161
183
  // activeSuggestionIndex unifies mouse and keyboard interaction of
162
184
  // the suggestions
163
- var _useState4 = useState(resetSuggestionIndex),
164
- activeSuggestionIndex = _useState4[0],
165
- setActiveSuggestionIndex = _useState4[1];
185
+ var _useState5 = useState(resetSuggestionIndex),
186
+ activeSuggestionIndex = _useState5[0],
187
+ setActiveSuggestionIndex = _useState5[1];
166
188
 
167
189
  // Only update active suggestion index when the mouse actually moves,
168
190
  // not when suggestions are moving under the mouse.
169
- var _useState5 = useState(),
170
- mouseMovedSinceLastKey = _useState5[0],
171
- setMouseMovedSinceLastKey = _useState5[1];
191
+ var _useState6 = useState(),
192
+ mouseMovedSinceLastKey = _useState6[0],
193
+ setMouseMovedSinceLastKey = _useState6[1];
172
194
 
173
195
  // set activeSuggestionIndex when value changes
174
196
  useEffect(function () {
@@ -346,9 +368,20 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
346
368
  // primarily for tests.
347
369
 
348
370
  var textInputIcon = useSizedIcon(icon, rest.size, theme);
371
+ var ReadOnlyCopyButton = /*#__PURE__*/React.createElement(CopyButton, {
372
+ onBlurCopy: onBlurCopy,
373
+ onClickCopy: onClickCopy,
374
+ readOnlyCopyPrompt: readOnlyCopyPrompt,
375
+ tip: tip,
376
+ value: value
377
+ });
349
378
  return /*#__PURE__*/React.createElement(StyledTextInputContainer, {
350
- plain: plain
351
- }, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder, null, placeholder), textInputIcon && /*#__PURE__*/React.createElement(StyledIcon, {
379
+ readOnlyProp: readOnly // readOnlyProp to avoid passing to DOM
380
+ ,
381
+ readOnlyCopy: readOnlyCopy,
382
+ plain: plain,
383
+ border: !plain
384
+ }, reverse && readOnlyCopy && ReadOnlyCopyButton, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder, null, placeholder), textInputIcon && !readOnly && /*#__PURE__*/React.createElement(StyledIcon, {
352
385
  reverse: reverse,
353
386
  theme: theme
354
387
  }, textInputIcon), /*#__PURE__*/React.createElement(Keyboard, _extends({
@@ -361,7 +394,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
361
394
  autoComplete: "off",
362
395
  plain: plain,
363
396
  placeholder: typeof placeholder === 'string' ? placeholder : undefined,
364
- icon: icon,
397
+ icon: !readOnly && icon,
365
398
  reverse: reverse,
366
399
  focus: focus,
367
400
  focusIndicator: focusIndicator,
@@ -371,6 +404,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
371
404
  defaultValue: renderLabel(defaultValue),
372
405
  value: renderLabel(value),
373
406
  readOnly: readOnly,
407
+ readOnlyCopy: readOnlyCopy,
374
408
  onFocus: function onFocus(event) {
375
409
  // Don't do anything if we are acting like we already have
376
410
  // focus. This can happen when this input loses focus temporarily
@@ -409,7 +443,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
409
443
  setActiveSuggestionIndex(resetSuggestionIndex);
410
444
  if (onChange) onChange(event);
411
445
  }
412
- }))), drop);
446
+ }))), !reverse && readOnlyCopy && ReadOnlyCopyButton, !readOnly && drop);
413
447
  });
414
448
  TextInput.displayName = 'TextInput';
415
449
  TextInput.propTypes = TextInputPropTypes;
@@ -46,6 +46,7 @@ export interface TextInputProps
46
46
  onSuggestionsClose?: () => void;
47
47
  placeholder?: PlaceHolderType;
48
48
  plain?: boolean | 'full';
49
+ readOnlyCopy?: boolean;
49
50
  reverse?: boolean;
50
51
  size?: 'small' | 'medium' | 'large' | 'xlarge' | string;
51
52
  suggestions?: ({ label?: React.ReactNode; value?: any } | string)[];
@@ -31,6 +31,7 @@ if (process.env.NODE_ENV !== 'production') {
31
31
  onSuggestionsClose: PropTypes.func,
32
32
  placeholder: PropTypes.node,
33
33
  plain: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['full'])]),
34
+ readOnlyCopy: PropTypes.bool,
34
35
  reverse: PropTypes.bool,
35
36
  size: PropTypes.oneOfType([PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', '2xl', '3xl', '4xl', '5xl', '6xl']), PropTypes.string]),
36
37
  suggestions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { Box, TextInput, Form, FormField } from 'grommet';
3
+ export var ReadOnly = function ReadOnly() {
4
+ return (
5
+ /*#__PURE__*/
6
+ // Uncomment <Grommet> lines when using outside of storybook
7
+ // <Grommet theme={...}>
8
+ React.createElement(Box, {
9
+ fill: true,
10
+ align: "center",
11
+ justify: "start",
12
+ pad: "large"
13
+ }, /*#__PURE__*/React.createElement(Box, {
14
+ width: "medium",
15
+ gap: "medium"
16
+ }, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(TextInput, {
17
+ readOnlyCopy: true,
18
+ value: "Read only with copy button",
19
+ "aria-label": "read only"
20
+ })), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(TextInput, {
21
+ readOnly: true,
22
+ value: "Read only",
23
+ "aria-label": "read only"
24
+ }))), /*#__PURE__*/React.createElement(TextInput, {
25
+ readOnlyCopy: true,
26
+ value: "Read only with copy button",
27
+ "aria-label": "read only"
28
+ }), /*#__PURE__*/React.createElement(TextInput, {
29
+ readOnly: true,
30
+ value: "Read only",
31
+ "aria-label": "read only"
32
+ })))
33
+ // </Grommet>
34
+ );
35
+ };
36
+ export default {
37
+ title: 'Input/TextInput/ReadOnly'
38
+ };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Box, Button, Data, DataFilters, DataSearch, Notification } from 'grommet';
2
+ import { Box, Button, Data, DataFilters, DataSearch } from 'grommet';
3
3
  import { Toolbar } from '../Toolbar';
4
4
  import { DATA } from '../../DataTable/stories/data';
5
5
  export var Simple = function Simple() {
@@ -13,10 +13,7 @@ export var Simple = function Simple() {
13
13
  justify: "start",
14
14
  pad: "large",
15
15
  gap: "large"
16
- }, /*#__PURE__*/React.createElement(Notification, {
17
- status: "info",
18
- message: "Toolbar is in 'beta'. The API surface is subject to change."
19
- }), /*#__PURE__*/React.createElement(Box, {
16
+ }, /*#__PURE__*/React.createElement(Box, {
20
17
  width: "large"
21
18
  }, /*#__PURE__*/React.createElement(Data, {
22
19
  data: DATA
@@ -82,10 +82,33 @@
82
82
  "invalid": "invalid",
83
83
  "required": "required"
84
84
  },
85
+ "formField": {
86
+ "maxCharacters": {
87
+ "remaining": {
88
+ "singular": "{number} character left",
89
+ "plural": "{number} characters left"
90
+ },
91
+ "overLimit": {
92
+ "singular": "{number} character over limit",
93
+ "plural": "{number} characters over limit"
94
+ }
95
+ }
96
+ },
97
+ "input": {
98
+ "readOnlyCopy": {
99
+ "prompt": "Copy to clipboard",
100
+ "validation": "Copied"
101
+ }
102
+ },
85
103
  "menu": {
86
104
  "openMenu": "Open Menu",
87
105
  "closeMenu": "Close Menu"
88
106
  },
107
+ "pagination": {
108
+ "stepLabel": "Items per page",
109
+ "summary": "Showing {start}-{end} of {total}",
110
+ "summaryNoItems": "0 items"
111
+ },
89
112
  "rangeSelector": {
90
113
  "lower": "Lower Bounds",
91
114
  "upper": "Upper Bounds"
@@ -438,6 +438,12 @@ export interface ThemeType {
438
438
  size?: string;
439
439
  weight?: number | string;
440
440
  };
441
+ readOnly?: {
442
+ background?: BackgroundType;
443
+ border?: {
444
+ color?: ColorType;
445
+ };
446
+ };
441
447
  weight?: number | string;
442
448
  };
443
449
  opacity?: {
@@ -1076,6 +1082,7 @@ export interface ThemeType {
1076
1082
  pad?: PadType;
1077
1083
  extend?: ExtendType;
1078
1084
  };
1085
+ primaryKey?: TextProps;
1079
1086
  icons?: {
1080
1087
  down?: React.ReactNode | Icon;
1081
1088
  up?: React.ReactNode | Icon;
@@ -1415,6 +1422,7 @@ export interface ThemeType {
1415
1422
  color?: ColorType;
1416
1423
  extend?: ExtendType;
1417
1424
  };
1425
+ wheel?: boolean;
1418
1426
  extend?: ExtendType;
1419
1427
  };
1420
1428
  rangeSelector?: {
@@ -314,9 +314,15 @@ export var generate = function generate(baseSpacing, scale) {
314
314
  // size: undefined,
315
315
  // height: undefined,
316
316
  weight: 600
317
- }
317
+ },
318
318
  // deprecate in v3
319
319
  // weight: undefined,
320
+ readOnly: {
321
+ // background: undefined,
322
+ // border: {
323
+ // color: undefined,
324
+ // },
325
+ }
320
326
  },
321
327
  opacity: {
322
328
  strong: 0.8,
@@ -1198,6 +1204,10 @@ export var generate = function generate(baseSpacing, scale) {
1198
1204
  }
1199
1205
  // extend: undefined,
1200
1206
  },
1207
+ primaryKey: {
1208
+ // any text props
1209
+ weight: 'bold'
1210
+ },
1201
1211
  icons: {
1202
1212
  down: FormDown,
1203
1213
  up: FormUp,
@@ -1765,6 +1775,7 @@ export var generate = function generate(baseSpacing, scale) {
1765
1775
  // color: { dark: undefined, light: undefined },
1766
1776
  // extend: undefined
1767
1777
  }
1778
+ // wheel: undefined
1768
1779
  },
1769
1780
  rangeSelector: {
1770
1781
  background: {
@@ -11,6 +11,7 @@ export * from './styles';
11
11
  export * from './object';
12
12
  export * from './pagination';
13
13
  export * from './PortalContext';
14
+ export * from './readOnly';
14
15
  export * from './refs';
15
16
  export * from './responsive';
16
17
  export * from './use-keyboard';
@@ -0,0 +1,10 @@
1
+ import { css } from 'styled-components';
2
+ import { backgroundStyle } from './background';
3
+ import { normalizeColor } from './colors';
4
+ export var readOnlyStyle = function readOnlyStyle(theme) {
5
+ var _theme$global$input$r, _theme$global$input$r2, _theme$global$input$r3;
6
+ var styles = [];
7
+ if (theme != null && (_theme$global$input$r = theme.global.input.readOnly) != null && (_theme$global$input$r = _theme$global$input$r.border) != null && _theme$global$input$r.color) styles.push(css(["border-color:", ";"], normalizeColor(theme.global.input.readOnly.border.color, theme)));
8
+ if (theme != null && (_theme$global$input$r2 = theme.global.input.readOnly) != null && _theme$global$input$r2.background) styles.push(backgroundStyle((_theme$global$input$r3 = theme.global.input.readOnly) == null ? void 0 : _theme$global$input$r3.background, theme));
9
+ return styles;
10
+ };