@pingux/astro 2.2.0-alpha.6 → 2.2.0-alpha.7

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 (129) hide show
  1. package/lib/cjs/components/ArrayField/ArrayField.js +4 -6
  2. package/lib/cjs/components/ArrayField/ArrayField.stories.js +1 -1
  3. package/lib/cjs/components/Callout/Callout.js +12 -9
  4. package/lib/cjs/components/Callout/Callout.stories.js +12 -9
  5. package/lib/cjs/components/CheckboxField/CheckboxField.js +5 -8
  6. package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +5 -13
  7. package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +3 -307
  8. package/lib/cjs/components/ColorField/ColorField.js +5 -8
  9. package/lib/cjs/components/ColorField/ColorField.stories.js +5 -12
  10. package/lib/cjs/components/ComboBox/ComboBoxInput.js +4 -5
  11. package/lib/cjs/components/ComboBoxField/ComboBoxField.js +4 -5
  12. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +1 -1
  13. package/lib/cjs/components/DataTable/DataTable.stories.js +1 -1
  14. package/lib/cjs/components/FieldHelperText/FieldHelperText.js +14 -11
  15. package/lib/cjs/components/FieldHelperText/FieldHelperText.stories.js +12 -10
  16. package/lib/cjs/components/FileInputField/FileInputField.js +14 -19
  17. package/lib/cjs/components/FileInputField/FileInputField.stories.js +5 -11
  18. package/lib/cjs/components/FileInputField/FileItem.js +14 -6
  19. package/lib/cjs/components/FileInputField/FileSelect.js +1 -1
  20. package/lib/cjs/components/Icon/NoticeIcon.js +11 -5
  21. package/lib/cjs/components/ImageUploadField/ImageUploadField.js +6 -9
  22. package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +5 -12
  23. package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.js +4 -5
  24. package/lib/cjs/components/LinkSelectField/LinkSelectField.js +7 -10
  25. package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +5 -12
  26. package/lib/cjs/components/ListItem/ListItem.js +1 -1
  27. package/lib/cjs/components/ListItem/ListItem.stories.js +1 -1
  28. package/lib/cjs/components/Menu/Menu.js +1 -1
  29. package/lib/cjs/components/Menu/Menu.stories.js +1 -1
  30. package/lib/cjs/components/Messages/Message.js +13 -7
  31. package/lib/cjs/components/Messages/Messages.js +14 -7
  32. package/lib/cjs/components/MultivaluesField/MultivaluesField.js +9 -13
  33. package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +5 -12
  34. package/lib/cjs/components/NumberField/NumberField.js +5 -8
  35. package/lib/cjs/components/NumberField/NumberField.stories.js +5 -12
  36. package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +15 -117
  37. package/lib/cjs/components/PasswordField/PasswordField.js +10 -14
  38. package/lib/cjs/components/PasswordField/PasswordField.stories.js +5 -11
  39. package/lib/cjs/components/RadioField/RadioField.js +4 -7
  40. package/lib/cjs/components/RadioGroupField/RadioGroupField.js +5 -8
  41. package/lib/cjs/components/RadioGroupField/RadioGroupField.stories.js +4 -11
  42. package/lib/cjs/components/RequirementsList/RequirementsList.js +15 -6
  43. package/lib/cjs/components/SearchField/SearchField.js +2 -2
  44. package/lib/cjs/components/SearchField/SearchField.stories.js +2 -2
  45. package/lib/cjs/components/SelectField/SelectField.js +7 -11
  46. package/lib/cjs/components/SelectField/SelectField.stories.js +5 -12
  47. package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +4 -6
  48. package/lib/cjs/components/SwitchField/SwitchField.js +8 -12
  49. package/lib/cjs/components/SwitchField/SwitchField.stories.js +5 -12
  50. package/lib/cjs/components/TextAreaField/TextAreaField.js +8 -12
  51. package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +5 -12
  52. package/lib/cjs/components/TextField/TextField.js +8 -12
  53. package/lib/cjs/components/TextField/TextField.stories.js +5 -12
  54. package/lib/cjs/hooks/useField/useField.js +1 -1
  55. package/lib/cjs/utils/docUtils/statusProp.js +55 -0
  56. package/lib/components/ArrayField/ArrayField.js +4 -6
  57. package/lib/components/ArrayField/ArrayField.stories.js +1 -1
  58. package/lib/components/Callout/Callout.js +13 -9
  59. package/lib/components/Callout/Callout.stories.js +13 -9
  60. package/lib/components/CheckboxField/CheckboxField.js +5 -8
  61. package/lib/components/CheckboxField/CheckboxField.stories.js +5 -13
  62. package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +2 -301
  63. package/lib/components/ColorField/ColorField.js +5 -8
  64. package/lib/components/ColorField/ColorField.stories.js +5 -12
  65. package/lib/components/ComboBox/ComboBoxInput.js +4 -5
  66. package/lib/components/ComboBoxField/ComboBoxField.js +4 -5
  67. package/lib/components/ComboBoxField/ComboBoxField.stories.js +1 -1
  68. package/lib/components/DataTable/DataTable.stories.js +1 -1
  69. package/lib/components/FieldHelperText/FieldHelperText.js +14 -9
  70. package/lib/components/FieldHelperText/FieldHelperText.stories.js +13 -10
  71. package/lib/components/FileInputField/FileInputField.js +14 -19
  72. package/lib/components/FileInputField/FileInputField.stories.js +5 -11
  73. package/lib/components/FileInputField/FileItem.js +14 -4
  74. package/lib/components/FileInputField/FileSelect.js +1 -1
  75. package/lib/components/Icon/NoticeIcon.js +12 -5
  76. package/lib/components/ImageUploadField/ImageUploadField.js +6 -9
  77. package/lib/components/ImageUploadField/ImageUploadField.stories.js +5 -12
  78. package/lib/components/ImageUploadField/ImageUploadFieldBase.js +4 -5
  79. package/lib/components/LinkSelectField/LinkSelectField.js +7 -10
  80. package/lib/components/LinkSelectField/LinkSelectField.stories.js +5 -12
  81. package/lib/components/ListItem/ListItem.js +1 -1
  82. package/lib/components/ListItem/ListItem.stories.js +1 -1
  83. package/lib/components/ListView/{ListView.stories.js → ListView.stories.hidden.js} +1 -0
  84. package/lib/components/Menu/Menu.js +1 -1
  85. package/lib/components/Menu/Menu.stories.js +1 -1
  86. package/lib/components/Messages/Message.js +13 -5
  87. package/lib/components/Messages/Messages.js +14 -5
  88. package/lib/components/MultivaluesField/MultivaluesField.js +9 -13
  89. package/lib/components/MultivaluesField/MultivaluesField.stories.js +5 -12
  90. package/lib/components/NumberField/NumberField.js +5 -8
  91. package/lib/components/NumberField/NumberField.stories.js +5 -12
  92. package/lib/components/OverlayPanel/OverlayPanel.stories.js +15 -116
  93. package/lib/components/PasswordField/PasswordField.js +10 -14
  94. package/lib/components/PasswordField/PasswordField.stories.js +5 -11
  95. package/lib/components/RadioField/RadioField.js +4 -7
  96. package/lib/components/RadioGroupField/RadioGroupField.js +5 -8
  97. package/lib/components/RadioGroupField/RadioGroupField.stories.js +4 -11
  98. package/lib/components/RequirementsList/RequirementsList.js +15 -4
  99. package/lib/components/SearchField/SearchField.js +2 -2
  100. package/lib/components/SearchField/SearchField.stories.js +2 -2
  101. package/lib/components/SelectField/SelectField.js +7 -11
  102. package/lib/components/SelectField/SelectField.stories.js +5 -12
  103. package/lib/components/SelectFieldBase/SelectFieldBase.js +4 -6
  104. package/lib/components/SwitchField/SwitchField.js +8 -12
  105. package/lib/components/SwitchField/SwitchField.stories.js +5 -12
  106. package/lib/components/TextAreaField/TextAreaField.js +8 -12
  107. package/lib/components/TextAreaField/TextAreaField.stories.js +5 -12
  108. package/lib/components/TextField/TextField.js +8 -12
  109. package/lib/components/TextField/TextField.stories.js +5 -12
  110. package/lib/hooks/useField/useField.js +1 -1
  111. package/lib/recipes/{ApplicationSearchDropdown.stories.js → ApplicationSearchDropdown.stories.hidden.js} +1 -0
  112. package/lib/utils/docUtils/statusProp.js +44 -0
  113. package/package.json +1 -1
  114. package/lib/cjs/recipes/PanelHeader.stories.js +0 -80
  115. package/lib/recipes/PanelHeader.stories.js +0 -70
  116. /package/lib/cjs/components/ListView/{ListView.stories.js → ListView.stories.hidden.js} +0 -0
  117. /package/lib/cjs/recipes/{ApplicationSearchDropdown.stories.js → ApplicationSearchDropdown.stories.hidden.js} +0 -0
  118. /package/lib/cjs/recipes/{CollapsiblePanel.stories.js → CollapsiblePanel.stories.hidden.js} +0 -0
  119. /package/lib/cjs/recipes/{ScrollableListView.stories.js → ScrollableListView.stories.hidden.js} +0 -0
  120. /package/lib/cjs/utils/{devUtils/props → docUtils}/ariaAttributes.js +0 -0
  121. /package/lib/cjs/utils/{devUtils/props → docUtils}/ariaAttributes.test.js +0 -0
  122. /package/lib/cjs/utils/{devUtils/props → docUtils}/fieldAttributes.js +0 -0
  123. /package/lib/cjs/utils/{devUtils/props → docUtils}/hoverProps.js +0 -0
  124. /package/lib/recipes/{CollapsiblePanel.stories.js → CollapsiblePanel.stories.hidden.js} +0 -0
  125. /package/lib/recipes/{ScrollableListView.stories.js → ScrollableListView.stories.hidden.js} +0 -0
  126. /package/lib/utils/{devUtils/props → docUtils}/ariaAttributes.js +0 -0
  127. /package/lib/utils/{devUtils/props → docUtils}/ariaAttributes.test.js +0 -0
  128. /package/lib/utils/{devUtils/props → docUtils}/fieldAttributes.js +0 -0
  129. /package/lib/utils/{devUtils/props → docUtils}/hoverProps.js +0 -0
@@ -30,9 +30,9 @@ import React, { useState } from 'react';
30
30
  import { OverlayProvider } from 'react-aria';
31
31
  import { useAsyncList } from 'react-stately';
32
32
  import { Item, Section, SelectField, Separator } from '../../index';
33
- import statuses from '../../utils/devUtils/constants/statuses';
34
- import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
35
- import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
33
+ import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
34
+ import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
35
+ import { statusArgTypes } from '../../utils/docUtils/statusProp';
36
36
  import { modes as labelModes } from '../Label/constants';
37
37
  import { jsx as ___EmotionJSX } from "@emotion/react";
38
38
  var animals = [{
@@ -122,7 +122,7 @@ export default {
122
122
  }
123
123
  }
124
124
  },
125
- argTypes: _objectSpread(_objectSpread({
125
+ argTypes: _objectSpread(_objectSpread(_objectSpread({
126
126
  label: {
127
127
  control: {
128
128
  type: 'text'
@@ -148,13 +148,6 @@ export default {
148
148
  },
149
149
  defaultValue: _Object$values(labelModes)[0]
150
150
  },
151
- status: {
152
- control: {
153
- type: 'select',
154
- options: statuses
155
- },
156
- defaultValue: statuses.DEFAULT
157
- },
158
151
  defaultSelectedKey: {},
159
152
  disabledKeys: {},
160
153
  name: {},
@@ -170,7 +163,7 @@ export default {
170
163
  type: 'none'
171
164
  }
172
165
  }
173
- }, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
166
+ }, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
174
167
  };
175
168
  export var Default = function Default(args) {
176
169
  return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(SelectField, _extends({}, args, {
@@ -18,8 +18,8 @@ import { HiddenSelect } from 'react-aria';
18
18
  import MenuDown from 'mdi-react/MenuDownIcon';
19
19
  import PropTypes from 'prop-types';
20
20
  import { v4 as uuid } from 'uuid';
21
- import statuses from '../../utils/devUtils/constants/statuses';
22
- import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/devUtils/props/ariaAttributes';
21
+ import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
22
+ import { statusPropTypes } from '../../utils/docUtils/statusProp';
23
23
  import Box from '../Box';
24
24
  import Button from '../Button';
25
25
  import FieldHelperText from '../FieldHelperText';
@@ -105,7 +105,7 @@ var SelectFieldBase = /*#__PURE__*/forwardRef(function (_ref, ref) {
105
105
  id: helperTextId
106
106
  }, helperText));
107
107
  });
108
- SelectFieldBase.propTypes = _objectSpread({
108
+ SelectFieldBase.propTypes = _objectSpread(_objectSpread({
109
109
  /** Default text rendered if no option is selected. Deprecated. */
110
110
  defaultText: PropTypes.string,
111
111
  /** Text rendered below the input. */
@@ -118,8 +118,6 @@ SelectFieldBase.propTypes = _objectSpread({
118
118
  name: PropTypes.string,
119
119
  /** Temporary text that occupies the text input when it is empty. */
120
120
  placeholder: PropTypes.string,
121
- /** Determines the type of label applied to the component. */
122
- status: PropTypes.oneOf(_Object$values(statuses)),
123
121
  /** Determines whether to use column styles. */
124
122
  columnStyleProps: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({})]),
125
123
  /** Determines props that applied to root container. */
@@ -156,5 +154,5 @@ SelectFieldBase.propTypes = _objectSpread({
156
154
  triggerRef: PropTypes.shape({}),
157
155
  /** Props for the element representing the selected value. */
158
156
  valueProps: PropTypes.shape({})
159
- }, ariaAttributesBasePropTypes);
157
+ }, statusPropTypes), ariaAttributesBasePropTypes);
160
158
  export default SelectFieldBase;
@@ -10,7 +10,6 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
10
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
11
11
  var _excluded = ["label", "helperText", "isDefaultSelected", "isSelected", "onChange", "value", "name", "id", "isDisabled", "isReadOnly", "isRequired", "hasAutoFocus", "onFocus", "onBlur", "onFocusChange", "onKeyDown", "onKeyUp", "status", "controlProps"];
12
12
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
13
- import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
14
13
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
16
15
  import React, { forwardRef, useImperativeHandle, useRef } from 'react';
@@ -21,9 +20,9 @@ import omit from 'lodash/omit';
21
20
  import PropTypes from 'prop-types';
22
21
  import { Box, FieldHelperText, Label, Switch } from '../..';
23
22
  import { useField, usePropWarning } from '../../hooks';
24
- import statuses from '../../utils/devUtils/constants/statuses';
25
- import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
26
- import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
23
+ import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
24
+ import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
25
+ import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
27
26
 
28
27
  /**
29
28
  * Combines a switch, label, and helper text for a complete, form-ready solution.
@@ -98,7 +97,7 @@ var SwitchField = /*#__PURE__*/forwardRef(function (props, ref) {
98
97
  status: status
99
98
  }, helperText));
100
99
  });
101
- SwitchField.propTypes = _objectSpread(_objectSpread({
100
+ SwitchField.propTypes = _objectSpread(_objectSpread(_objectSpread({
102
101
  /** A list of class names to apply to the input element. */
103
102
  className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
104
103
  /** Whether the element should receive focus on render. */
@@ -135,17 +134,14 @@ SwitchField.propTypes = _objectSpread(_objectSpread({
135
134
  onKeyDown: PropTypes.func,
136
135
  /** Handler that is called when a key is released. */
137
136
  onKeyUp: PropTypes.func,
138
- /** Determines the textarea status indicator and helper text styling. */
139
- status: PropTypes.oneOf(_Object$values(statuses)),
140
137
  /** The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue). */
141
138
  value: PropTypes.string
142
- }, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
143
- SwitchField.defaultProps = {
139
+ }, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
140
+ SwitchField.defaultProps = _objectSpread({
144
141
  isDisabled: false,
145
142
  isReadOnly: false,
146
143
  isRequired: false,
147
- hasAutoFocus: false,
148
- status: statuses.DEFAULT
149
- };
144
+ hasAutoFocus: false
145
+ }, statusDefaultProp);
150
146
  SwitchField.displayName = 'SwitchField';
151
147
  export default SwitchField;
@@ -13,9 +13,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
13
13
  import React, { useRef, useState } from 'react';
14
14
  import { Pressable } from '@react-aria/interactions';
15
15
  import { SwitchField, Tooltip, TooltipTrigger } from '../../index';
16
- import statuses from '../../utils/devUtils/constants/statuses';
17
- import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
18
- import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
16
+ import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
17
+ import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
18
+ import { statusArgTypes } from '../../utils/docUtils/statusProp';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
20
  export default {
21
21
  title: 'Form/SwitchField',
@@ -27,7 +27,7 @@ export default {
27
27
  }
28
28
  }
29
29
  },
30
- argTypes: _objectSpread(_objectSpread({
30
+ argTypes: _objectSpread(_objectSpread(_objectSpread({
31
31
  label: {
32
32
  control: {
33
33
  type: 'text'
@@ -49,13 +49,6 @@ export default {
49
49
  },
50
50
  name: {},
51
51
  className: {},
52
- status: {
53
- control: {
54
- type: 'select',
55
- options: statuses
56
- },
57
- defaultValue: statuses.DEFAULT
58
- },
59
52
  isDisabled: {},
60
53
  isRequired: {},
61
54
  isReadOnly: {},
@@ -67,7 +60,7 @@ export default {
67
60
  type: 'none'
68
61
  }
69
62
  }
70
- }, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
63
+ }, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
71
64
  };
72
65
  export var Default = function Default(args) {
73
66
  return ___EmotionJSX(SwitchField, args);
@@ -8,7 +8,6 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
8
8
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
9
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
- import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
12
11
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
14
13
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
@@ -17,9 +16,9 @@ import PropTypes from 'prop-types';
17
16
  import { v4 as uuid } from 'uuid';
18
17
  import { Box, FieldHelperText, Label, TextArea } from '../..';
19
18
  import { useColumnStyles, useField, useLabelHeight, usePropWarning } from '../../hooks';
20
- import statuses from '../../utils/devUtils/constants/statuses';
21
- import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
22
- import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
19
+ import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
20
+ import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
21
+ import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
23
22
 
24
23
  /**
25
24
  * Combines a textarea, label, and helper text for a complete, form-ready solution.
@@ -137,7 +136,7 @@ var TextAreaField = /*#__PURE__*/forwardRef(function (props, ref) {
137
136
  id: helperTextId
138
137
  }, helperText));
139
138
  });
140
- TextAreaField.propTypes = _objectSpread(_objectSpread({
139
+ TextAreaField.propTypes = _objectSpread(_objectSpread(_objectSpread({
141
140
  /** The rendered label for the field. */
142
141
  label: PropTypes.node,
143
142
  /** Text rendered below the textarea. */
@@ -197,22 +196,19 @@ TextAreaField.propTypes = _objectSpread(_objectSpread({
197
196
  placeholder: PropTypes.string,
198
197
  /** The number of rows to display for the textarea. Controls the default height. */
199
198
  rows: PropTypes.number,
200
- /** Determines the textarea status indicator and helper text styling. */
201
- status: PropTypes.oneOf(_Object$values(statuses)),
202
199
  /** Provides a way to insert markup in specified places. */
203
200
  slots: PropTypes.shape({
204
201
  /** The given node will be inserted into the field container. */
205
202
  inContainer: PropTypes.node
206
203
  })
207
- }, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
208
- TextAreaField.defaultProps = {
204
+ }, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
205
+ TextAreaField.defaultProps = _objectSpread({
209
206
  hasAutoFocus: false,
210
207
  isDisabled: false,
211
208
  isReadOnly: false,
212
209
  isRequired: false,
213
210
  isUnresizable: false,
214
- rows: 4,
215
- status: statuses.DEFAULT
216
- };
211
+ rows: 4
212
+ }, statusDefaultProp);
217
213
  TextAreaField.displayName = 'TextAreaField';
218
214
  export default TextAreaField;
@@ -15,9 +15,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
15
  import React, { useState } from 'react';
16
16
  import SearchIcon from 'mdi-react/SearchIcon';
17
17
  import { Box, Icon, TextAreaField } from '../../index';
18
- import statuses from '../../utils/devUtils/constants/statuses';
19
- import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
20
- import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
18
+ import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
19
+ import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
20
+ import { statusArgTypes } from '../../utils/docUtils/statusProp';
21
21
  import { modes as labelModes } from '../Label/constants';
22
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
23
  export default {
@@ -30,7 +30,7 @@ export default {
30
30
  }
31
31
  }
32
32
  },
33
- argTypes: _objectSpread(_objectSpread({
33
+ argTypes: _objectSpread(_objectSpread(_objectSpread({
34
34
  label: {
35
35
  control: {
36
36
  type: 'text'
@@ -58,13 +58,6 @@ export default {
58
58
  }
59
59
  },
60
60
  rows: {},
61
- status: {
62
- control: {
63
- type: 'select',
64
- options: statuses
65
- },
66
- defaultValue: statuses.DEFAULT
67
- },
68
61
  isDisabled: {},
69
62
  isRequired: {},
70
63
  isReadOnly: {},
@@ -78,7 +71,7 @@ export default {
78
71
  type: 'none'
79
72
  }
80
73
  }
81
- }, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
74
+ }, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
82
75
  };
83
76
  var IconSlot = ___EmotionJSX(Box, {
84
77
  isRow: true
@@ -8,7 +8,6 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
8
8
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
9
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
- import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
12
11
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
14
13
  import React, { forwardRef, useImperativeHandle, useRef } from 'react';
@@ -17,9 +16,9 @@ import { v4 as uuid } from 'uuid';
17
16
  import { Box, FieldHelperText, Input, Label } from '../..';
18
17
  import { useField, useLabelHeight, usePropWarning } from '../../hooks';
19
18
  import useColumnStyles from '../../hooks/useColumnStyles';
20
- import statuses from '../../utils/devUtils/constants/statuses';
21
- import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
22
- import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
19
+ import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
20
+ import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
21
+ import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
23
22
 
24
23
  /**
25
24
  * Combines a text input, label, and helper text for a complete, form-ready solution.
@@ -71,7 +70,7 @@ var TextField = /*#__PURE__*/forwardRef(function (props, ref) {
71
70
  id: helperTextId
72
71
  }, helperText));
73
72
  });
74
- TextField.propTypes = _objectSpread(_objectSpread({
73
+ TextField.propTypes = _objectSpread(_objectSpread(_objectSpread({
75
74
  /** The rendered label for the field. */
76
75
  label: PropTypes.node,
77
76
  /** A string designating whether or not the label is a float label. */
@@ -130,19 +129,16 @@ TextField.propTypes = _objectSpread(_objectSpread({
130
129
  /** The given node will be inserted into the field container. */
131
130
  inContainer: PropTypes.node
132
131
  }),
133
- /** Determines the input status indicator and helper text styling. */
134
- status: PropTypes.oneOf(_Object$values(statuses)),
135
132
  /** Determines the type of input to use. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype). */
136
133
  type: PropTypes.string,
137
134
  /** Props object that is spread directly into the input wrapper element. */
138
135
  wrapperProps: PropTypes.shape({})
139
- }, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
140
- TextField.defaultProps = {
136
+ }, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
137
+ TextField.defaultProps = _objectSpread({
141
138
  hasAutoFocus: false,
142
139
  isDisabled: false,
143
140
  isReadOnly: false,
144
- isRequired: false,
145
- status: statuses.DEFAULT
146
- };
141
+ isRequired: false
142
+ }, statusDefaultProp);
147
143
  TextField.displayName = 'TextField';
148
144
  export default TextField;
@@ -18,9 +18,9 @@ import React, { useState } from 'react';
18
18
  import isEmpty from 'lodash/isEmpty';
19
19
  import useCopyToClipboard from '../../hooks/useCopyToClipboard';
20
20
  import { Box, TextField } from '../../index';
21
- import statuses from '../../utils/devUtils/constants/statuses.js';
22
- import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
23
- import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
21
+ import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
22
+ import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
23
+ import { statusArgTypes } from '../../utils/docUtils/statusProp';
24
24
  import CopyButton from '../CopyText/CopyButton';
25
25
  import { modes as labelModes } from '../Label/constants';
26
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -34,7 +34,7 @@ export default {
34
34
  }
35
35
  }
36
36
  },
37
- argTypes: _objectSpread(_objectSpread({
37
+ argTypes: _objectSpread(_objectSpread(_objectSpread({
38
38
  labelMode: {
39
39
  control: {
40
40
  type: 'select',
@@ -46,15 +46,8 @@ export default {
46
46
  control: {
47
47
  type: 'text'
48
48
  }
49
- },
50
- status: {
51
- control: {
52
- type: 'select',
53
- options: statuses
54
- },
55
- defaultValue: statuses.DEFAULT
56
49
  }
57
- }, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
50
+ }, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
58
51
  };
59
52
  export var Default = function Default(_ref) {
60
53
  var variant = _ref.variant,
@@ -19,7 +19,7 @@ import noop from 'lodash/noop';
19
19
  import omit from 'lodash/omit';
20
20
  import { modes as labelModes } from '../../components/Label/constants';
21
21
  import statuses from '../../utils/devUtils/constants/statuses';
22
- import { getAriaAttributeProps } from '../../utils/devUtils/props/ariaAttributes';
22
+ import { getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
23
23
  import { useStatusClasses } from '..';
24
24
 
25
25
  /**
@@ -11,6 +11,7 @@ import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/i
11
11
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
12
12
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
14
+ /* eslint-disable react/prop-types */
14
15
  import React, { useMemo, useRef, useState } from 'react';
15
16
  import { FocusScope, useOverlayPosition } from 'react-aria';
16
17
  import { createFocusManager } from '@react-aria/focus';
@@ -0,0 +1,44 @@
1
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
2
+ var _context;
3
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
6
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
7
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
8
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
9
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
10
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
11
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
12
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
13
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
14
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
15
+ import PropTypes from 'prop-types';
16
+ import statuses from '../devUtils/constants/statuses';
17
+ var descriptions = {
18
+ status: 'Determines any status related styling.'
19
+ };
20
+ export var statusBaseDocSettings = {
21
+ control: {
22
+ type: 'radio',
23
+ options: _Object$values(statuses)
24
+ },
25
+ defaultValue: statuses.DEFAULT,
26
+ table: {
27
+ type: {
28
+ summary: _mapInstanceProperty(_context = _Object$values(statuses)).call(_context, function (status) {
29
+ return "'".concat(status, "'");
30
+ }).join('|')
31
+ }
32
+ }
33
+ };
34
+ export var statusArgTypes = {
35
+ 'status': _objectSpread({
36
+ description: descriptions.status
37
+ }, statusBaseDocSettings)
38
+ };
39
+ export var statusPropTypes = {
40
+ status: PropTypes.oneOf(_Object$values(statuses))
41
+ };
42
+ export var statusDefaultProp = {
43
+ status: statuses.DEFAULT
44
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.2.0-alpha.6",
3
+ "version": "2.2.0-alpha.7",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,80 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.Default = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _AccountIcon = _interopRequireDefault(require("mdi-react/AccountIcon"));
11
- var _CloseIcon = _interopRequireDefault(require("mdi-react/CloseIcon"));
12
- var _DotsVerticalIcon = _interopRequireDefault(require("mdi-react/DotsVerticalIcon"));
13
- var _index = require("../index");
14
- var _react2 = require("@emotion/react");
15
- var _default = {
16
- title: 'Recipes/Panel Header'
17
- };
18
- exports["default"] = _default;
19
- var sx = {
20
- wrapper: {
21
- width: 'fit-content',
22
- alignItems: 'center',
23
- bg: 'accent.99',
24
- py: 'sm',
25
- pl: 'md'
26
- },
27
- title: {
28
- fontSize: 'md',
29
- lineHeight: '18px'
30
- },
31
- subtitle: {
32
- fontSize: 'sm',
33
- my: '1px',
34
- lineHeight: '16px'
35
- }
36
- };
37
- var Default = function Default() {
38
- return (0, _react2.jsx)(_index.Box, {
39
- isRow: true,
40
- sx: sx.wrapper
41
- }, (0, _react2.jsx)(_index.Icon, {
42
- icon: _AccountIcon["default"],
43
- size: 25,
44
- color: "accent.40"
45
- }), (0, _react2.jsx)(_index.Box, {
46
- ml: "sm",
47
- mr: "xx"
48
- }, (0, _react2.jsx)(_index.Text, {
49
- sx: sx.title,
50
- variant: "bodyStrong"
51
- }, "Fons Vernall"), (0, _react2.jsx)(_index.Text, {
52
- sx: sx.subtitle,
53
- variant: "subtitle"
54
- }, "fvernall0@google.it")), (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.PopoverMenu, null, (0, _react2.jsx)(_index.IconButton, {
55
- "aria-label": "Menu Button"
56
- }, (0, _react2.jsx)(_index.Icon, {
57
- icon: _DotsVerticalIcon["default"],
58
- size: "xs",
59
- color: "Neutral.40",
60
- m: "0.61px"
61
- })), (0, _react2.jsx)(_index.Menu, null, (0, _react2.jsx)(_index.Item, {
62
- key: "edit"
63
- }, "Edit"), (0, _react2.jsx)(_index.Item, {
64
- key: "duplicate"
65
- }, "Duplicate"), (0, _react2.jsx)(_index.Item, {
66
- key: "delete",
67
- textValue: "delete"
68
- }, (0, _react2.jsx)(_index.Text, {
69
- color: "critical.bright"
70
- }, "Delete"))))), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.IconButton, {
71
- "aria-label": "Close Button",
72
- mx: "10px"
73
- }, (0, _react2.jsx)(_index.Icon, {
74
- icon: _CloseIcon["default"],
75
- size: "xs",
76
- color: "Neutral.40",
77
- m: "0.61px"
78
- }))));
79
- };
80
- exports.Default = Default;
@@ -1,70 +0,0 @@
1
- import React from 'react';
2
- import AccountIcon from 'mdi-react/AccountIcon';
3
- import CloseIcon from 'mdi-react/CloseIcon';
4
- import DotsVerticalIcon from 'mdi-react/DotsVerticalIcon';
5
- import { Box, Icon, IconButton, Item, Menu, OverlayProvider, PopoverMenu, Text } from '../index';
6
- import { jsx as ___EmotionJSX } from "@emotion/react";
7
- export default {
8
- title: 'Recipes/Panel Header'
9
- };
10
- var sx = {
11
- wrapper: {
12
- width: 'fit-content',
13
- alignItems: 'center',
14
- bg: 'accent.99',
15
- py: 'sm',
16
- pl: 'md'
17
- },
18
- title: {
19
- fontSize: 'md',
20
- lineHeight: '18px'
21
- },
22
- subtitle: {
23
- fontSize: 'sm',
24
- my: '1px',
25
- lineHeight: '16px'
26
- }
27
- };
28
- export var Default = function Default() {
29
- return ___EmotionJSX(Box, {
30
- isRow: true,
31
- sx: sx.wrapper
32
- }, ___EmotionJSX(Icon, {
33
- icon: AccountIcon,
34
- size: 25,
35
- color: "accent.40"
36
- }), ___EmotionJSX(Box, {
37
- ml: "sm",
38
- mr: "xx"
39
- }, ___EmotionJSX(Text, {
40
- sx: sx.title,
41
- variant: "bodyStrong"
42
- }, "Fons Vernall"), ___EmotionJSX(Text, {
43
- sx: sx.subtitle,
44
- variant: "subtitle"
45
- }, "fvernall0@google.it")), ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(IconButton, {
46
- "aria-label": "Menu Button"
47
- }, ___EmotionJSX(Icon, {
48
- icon: DotsVerticalIcon,
49
- size: "xs",
50
- color: "Neutral.40",
51
- m: "0.61px"
52
- })), ___EmotionJSX(Menu, null, ___EmotionJSX(Item, {
53
- key: "edit"
54
- }, "Edit"), ___EmotionJSX(Item, {
55
- key: "duplicate"
56
- }, "Duplicate"), ___EmotionJSX(Item, {
57
- key: "delete",
58
- textValue: "delete"
59
- }, ___EmotionJSX(Text, {
60
- color: "critical.bright"
61
- }, "Delete"))))), ___EmotionJSX(Box, null, ___EmotionJSX(IconButton, {
62
- "aria-label": "Close Button",
63
- mx: "10px"
64
- }, ___EmotionJSX(Icon, {
65
- icon: CloseIcon,
66
- size: "xs",
67
- color: "Neutral.40",
68
- m: "0.61px"
69
- }))));
70
- };