@pingux/astro 2.52.0-alpha.0 → 2.52.0-alpha.2

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 (48) hide show
  1. package/lib/cjs/components/AccordionGroup/Accordion.styles.d.ts +3 -3
  2. package/lib/cjs/components/Breadcrumbs/Breadcrumb.styles.d.ts +3 -3
  3. package/lib/cjs/components/Button/Buttons.styles.d.ts +51 -51
  4. package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +135 -13
  5. package/lib/cjs/components/FieldHelperText/FieldHelperText.styles.d.ts +3 -3
  6. package/lib/cjs/components/Label/Label.d.ts +13 -0
  7. package/lib/cjs/components/Label/Label.js +8 -26
  8. package/lib/cjs/components/Label/Label.stories.d.ts +7 -0
  9. package/lib/cjs/components/Label/Label.stories.js +3 -3
  10. package/lib/cjs/components/Label/Label.styles.d.ts +2 -0
  11. package/lib/cjs/components/Label/Label.test.d.ts +1 -0
  12. package/lib/cjs/components/Label/index.d.ts +1 -0
  13. package/lib/cjs/components/SelectField/SelectField.stories.js +3 -3
  14. package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +3 -3
  15. package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +2 -2
  16. package/lib/cjs/components/Table/Table.styles.d.ts +6 -6
  17. package/lib/cjs/components/Text/Text.styles.d.ts +91 -90
  18. package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +3 -3
  19. package/lib/cjs/components/TextField/TextField.stories.js +3 -3
  20. package/lib/cjs/hooks/useColumnStyles/useColumnStyles.d.ts +2 -2
  21. package/lib/cjs/hooks/useField/useField.d.ts +22 -21
  22. package/lib/cjs/hooks/useField/useField.js +3 -5
  23. package/lib/cjs/hooks/useField/useField.test.js +4 -4
  24. package/lib/cjs/hooks/useSelectField/useSelectField.d.ts +2 -3
  25. package/lib/cjs/hooks/useSelectField/useSelectField.js +2 -2
  26. package/lib/cjs/types/index.d.ts +1 -0
  27. package/lib/cjs/types/index.js +29 -18
  28. package/lib/cjs/types/label.d.ts +25 -0
  29. package/lib/cjs/types/label.js +6 -0
  30. package/lib/cjs/types/shared/style.d.ts +3 -0
  31. package/lib/cjs/utils/devUtils/constants/labelModes.d.ts +5 -0
  32. package/lib/components/CheckboxField/CheckboxField.stories.js +134 -13
  33. package/lib/components/Label/Label.js +6 -24
  34. package/lib/components/Label/Label.stories.js +1 -1
  35. package/lib/components/Label/Label.styles.js +1 -0
  36. package/lib/components/SelectField/SelectField.stories.js +1 -1
  37. package/lib/components/SelectFieldBase/SelectFieldBase.js +1 -1
  38. package/lib/components/SelectFieldBase/SelectFieldBase.test.js +1 -1
  39. package/lib/components/TextAreaField/TextAreaField.stories.js +1 -1
  40. package/lib/components/TextField/TextField.stories.js +1 -1
  41. package/lib/hooks/useField/useField.js +1 -3
  42. package/lib/hooks/useField/useField.test.js +1 -1
  43. package/lib/hooks/useSelectField/useSelectField.js +1 -1
  44. package/lib/types/index.js +1 -0
  45. package/lib/types/label.js +1 -0
  46. package/package.json +1 -1
  47. /package/lib/cjs/{components/Label/constants.js → utils/devUtils/constants/labelModes.js} +0 -0
  48. /package/lib/{components/Label/constants.js → utils/devUtils/constants/labelModes.js} +0 -0
@@ -21,7 +21,7 @@ var _reactAria = require("react-aria");
21
21
  var _interactions = require("@react-aria/interactions");
22
22
  var _noop = _interopRequireDefault(require("lodash/noop"));
23
23
  var _omit = _interopRequireDefault(require("lodash/omit"));
24
- var _constants = require("../../components/Label/constants");
24
+ var _labelModes = require("../../utils/devUtils/constants/labelModes");
25
25
  var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
26
26
  var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
27
27
  var _ = require("..");
@@ -34,8 +34,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
34
34
  * @returns {{}} Prop objects to be spread into field components.
35
35
  */
36
36
 
37
- // TODO: replace with LabelProps instead of ThemeUILabelProps
38
- // once Label component is rewritten to ts
39
37
  var useField = function useField(props) {
40
38
  var autocomplete = props.autocomplete,
41
39
  autoComplete = props.autoComplete,
@@ -152,8 +150,8 @@ var useField = function useField(props) {
152
150
  onFocusWithinChange: setFocusWithin
153
151
  }),
154
152
  focusWithinProps = _useFocusWithin.focusWithinProps;
155
- var isFloatLabel = labelMode === _constants.modes.FLOAT || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.labelMode) === _constants.modes.FLOAT;
156
- var isLeftLabel = labelMode === _constants.modes.LEFT || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.labelMode) === _constants.modes.LEFT;
153
+ var isFloatLabel = labelMode === _labelModes.modes.FLOAT || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.labelMode) === _labelModes.modes.FLOAT;
154
+ var isLeftLabel = labelMode === _labelModes.modes.LEFT || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.labelMode) === _labelModes.modes.LEFT;
157
155
  var isFloatLabelActive = isFloatLabel && (hasValue || (containerProps === null || containerProps === void 0 ? void 0 : containerProps.isFloatLabelActive));
158
156
  var _useStatusClasses4 = (0, _.useStatusClasses)(containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, _objectSpread(_objectSpread({
159
157
  'field-container': true,
@@ -12,7 +12,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
13
13
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
14
14
  var _reactHooks = require("@testing-library/react-hooks");
15
- var _constants = require("../../components/Label/constants");
15
+ var _labelModes = require("../../utils/devUtils/constants/labelModes");
16
16
  var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
17
17
  var _useField = _interopRequireDefault(require("./useField"));
18
18
  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; }
@@ -166,7 +166,7 @@ test('should return isFloatLabelActive class for container', function () {
166
166
 
167
167
  // Has the class if the value is valid and label mode is float
168
168
  rerender(_objectSpread(_objectSpread({}, defaultProps), {}, {
169
- labelMode: _constants.modes.FLOAT
169
+ labelMode: _labelModes.modes.FLOAT
170
170
  }));
171
171
  expect(result.current.fieldContainerProps.className).toContain('is-float-label-active');
172
172
 
@@ -198,7 +198,7 @@ test('should return isFloatLabelActive class for container', function () {
198
198
 
199
199
  // Has the class if the mode is float and the isFloatLabelActive containerProp is passed in
200
200
  rerender(_objectSpread(_objectSpread({}, defaultProps), {}, {
201
- labelMode: _constants.modes.FLOAT,
201
+ labelMode: _labelModes.modes.FLOAT,
202
202
  containerProps: {
203
203
  isFloatLabelActive: true
204
204
  }
@@ -218,7 +218,7 @@ test('should return isLeftLabel class for container', function () {
218
218
 
219
219
  // Has the class if the value is valid and label mode is left
220
220
  rerender(_objectSpread(_objectSpread({}, defaultProps), {}, {
221
- labelMode: _constants.modes.LEFT
221
+ labelMode: _labelModes.modes.LEFT
222
222
  }));
223
223
  expect(result.current.fieldContainerProps.className).toContain('is-left-label');
224
224
  });
@@ -3,8 +3,7 @@ import { AriaButtonProps } from 'react-aria';
3
3
  import { SelectState } from 'react-stately';
4
4
  import { CollectionChildren } from '@react-types/shared';
5
5
  import { LabelProps as ThemeUILabelProps } from 'theme-ui';
6
- import { Axis, BoxProps, FocusableElement, ListBoxProps, PlacementAxis, ReactRef, StyleProps } from '../../types';
7
- import { LabelMode } from '../useColumnStyles/useColumnStyles';
6
+ import { Axis, BoxProps, FocusableElement, LabelModeProps, ListBoxProps, PlacementAxis, ReactRef, StyleProps } from '../../types';
8
7
  import { FieldControlInputProps } from '../useField/useField';
9
8
  interface UseSelectFieldProps<T> {
10
9
  children: CollectionChildren<T>;
@@ -35,7 +34,7 @@ interface UseSelectFieldProps<T> {
35
34
  listBoxProps?: ListBoxProps;
36
35
  labelProps?: ThemeUILabelProps;
37
36
  containerProps?: BoxProps;
38
- labelMode: LabelMode;
37
+ labelMode: LabelModeProps;
39
38
  }
40
39
  interface UseSelectFieldReturnProps {
41
40
  columnStyleProps: StyleProps;
@@ -23,10 +23,10 @@ var _react = _interopRequireWildcard(require("react"));
23
23
  var _reactAria = require("react-aria");
24
24
  var _reactStately = require("react-stately");
25
25
  var _utils = require("@react-aria/utils");
26
- var _constants = require("../../components/Label/constants");
27
26
  var _ListBox = _interopRequireDefault(require("../../components/ListBox/ListBox"));
28
27
  var _PopoverContainer = _interopRequireDefault(require("../../components/PopoverContainer"));
29
28
  var _ScrollBox = _interopRequireDefault(require("../../components/ScrollBox"));
29
+ var _labelModes = require("../../utils/devUtils/constants/labelModes");
30
30
  var _ = require("..");
31
31
  var _react2 = require("@emotion/react");
32
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -117,7 +117,7 @@ var useSelectField = function useSelectField(props, ref) {
117
117
  delete menuProps.shouldFocusOnHover;
118
118
  delete menuProps.disallowEmptySelection;
119
119
  var _useField = (0, _.useField)(_objectSpread(_objectSpread({}, props), {}, {
120
- placeholder: props.labelMode === _constants.modes.FLOAT ? '' : placeholder,
120
+ placeholder: props.labelMode === _labelModes.modes.FLOAT ? '' : placeholder,
121
121
  labelProps: _objectSpread(_objectSpread({}, props.labelProps), labelProps),
122
122
  containerProps: _objectSpread({
123
123
  isFloatLabelActive: !!state.selectedItem
@@ -12,6 +12,7 @@ export * from './iconBadge';
12
12
  export * from './iconButton';
13
13
  export * from './input';
14
14
  export * from './item';
15
+ export * from './label';
15
16
  export * from './link';
16
17
  export * from './listBox';
17
18
  export * from './listItem';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31;
3
+ var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32;
4
4
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
5
  var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6
6
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
@@ -161,8 +161,19 @@ _forEachInstanceProperty(_context14 = _Object$keys(_item)).call(_context14, func
161
161
  }
162
162
  });
163
163
  });
164
+ var _label = require("./label");
165
+ _forEachInstanceProperty(_context15 = _Object$keys(_label)).call(_context15, function (key) {
166
+ if (key === "default" || key === "__esModule") return;
167
+ if (key in exports && exports[key] === _label[key]) return;
168
+ _Object$defineProperty(exports, key, {
169
+ enumerable: true,
170
+ get: function get() {
171
+ return _label[key];
172
+ }
173
+ });
174
+ });
164
175
  var _link = require("./link");
165
- _forEachInstanceProperty(_context15 = _Object$keys(_link)).call(_context15, function (key) {
176
+ _forEachInstanceProperty(_context16 = _Object$keys(_link)).call(_context16, function (key) {
166
177
  if (key === "default" || key === "__esModule") return;
167
178
  if (key in exports && exports[key] === _link[key]) return;
168
179
  _Object$defineProperty(exports, key, {
@@ -173,7 +184,7 @@ _forEachInstanceProperty(_context15 = _Object$keys(_link)).call(_context15, func
173
184
  });
174
185
  });
175
186
  var _listBox = require("./listBox");
176
- _forEachInstanceProperty(_context16 = _Object$keys(_listBox)).call(_context16, function (key) {
187
+ _forEachInstanceProperty(_context17 = _Object$keys(_listBox)).call(_context17, function (key) {
177
188
  if (key === "default" || key === "__esModule") return;
178
189
  if (key in exports && exports[key] === _listBox[key]) return;
179
190
  _Object$defineProperty(exports, key, {
@@ -184,7 +195,7 @@ _forEachInstanceProperty(_context16 = _Object$keys(_listBox)).call(_context16, f
184
195
  });
185
196
  });
186
197
  var _listItem = require("./listItem");
187
- _forEachInstanceProperty(_context17 = _Object$keys(_listItem)).call(_context17, function (key) {
198
+ _forEachInstanceProperty(_context18 = _Object$keys(_listItem)).call(_context18, function (key) {
188
199
  if (key === "default" || key === "__esModule") return;
189
200
  if (key in exports && exports[key] === _listItem[key]) return;
190
201
  _Object$defineProperty(exports, key, {
@@ -195,7 +206,7 @@ _forEachInstanceProperty(_context17 = _Object$keys(_listItem)).call(_context17,
195
206
  });
196
207
  });
197
208
  var _loader = require("./loader");
198
- _forEachInstanceProperty(_context18 = _Object$keys(_loader)).call(_context18, function (key) {
209
+ _forEachInstanceProperty(_context19 = _Object$keys(_loader)).call(_context19, function (key) {
199
210
  if (key === "default" || key === "__esModule") return;
200
211
  if (key in exports && exports[key] === _loader[key]) return;
201
212
  _Object$defineProperty(exports, key, {
@@ -206,7 +217,7 @@ _forEachInstanceProperty(_context18 = _Object$keys(_loader)).call(_context18, fu
206
217
  });
207
218
  });
208
219
  var _menu = require("./menu");
209
- _forEachInstanceProperty(_context19 = _Object$keys(_menu)).call(_context19, function (key) {
220
+ _forEachInstanceProperty(_context20 = _Object$keys(_menu)).call(_context20, function (key) {
210
221
  if (key === "default" || key === "__esModule") return;
211
222
  if (key in exports && exports[key] === _menu[key]) return;
212
223
  _Object$defineProperty(exports, key, {
@@ -217,7 +228,7 @@ _forEachInstanceProperty(_context19 = _Object$keys(_menu)).call(_context19, func
217
228
  });
218
229
  });
219
230
  var _menuItem = require("./menuItem");
220
- _forEachInstanceProperty(_context20 = _Object$keys(_menuItem)).call(_context20, function (key) {
231
+ _forEachInstanceProperty(_context21 = _Object$keys(_menuItem)).call(_context21, function (key) {
221
232
  if (key === "default" || key === "__esModule") return;
222
233
  if (key in exports && exports[key] === _menuItem[key]) return;
223
234
  _Object$defineProperty(exports, key, {
@@ -228,7 +239,7 @@ _forEachInstanceProperty(_context20 = _Object$keys(_menuItem)).call(_context20,
228
239
  });
229
240
  });
230
241
  var _overlayPanel = require("./overlayPanel");
231
- _forEachInstanceProperty(_context21 = _Object$keys(_overlayPanel)).call(_context21, function (key) {
242
+ _forEachInstanceProperty(_context22 = _Object$keys(_overlayPanel)).call(_context22, function (key) {
232
243
  if (key === "default" || key === "__esModule") return;
233
244
  if (key in exports && exports[key] === _overlayPanel[key]) return;
234
245
  _Object$defineProperty(exports, key, {
@@ -239,7 +250,7 @@ _forEachInstanceProperty(_context21 = _Object$keys(_overlayPanel)).call(_context
239
250
  });
240
251
  });
241
252
  var _popoverContainer = require("./popoverContainer");
242
- _forEachInstanceProperty(_context22 = _Object$keys(_popoverContainer)).call(_context22, function (key) {
253
+ _forEachInstanceProperty(_context23 = _Object$keys(_popoverContainer)).call(_context23, function (key) {
243
254
  if (key === "default" || key === "__esModule") return;
244
255
  if (key in exports && exports[key] === _popoverContainer[key]) return;
245
256
  _Object$defineProperty(exports, key, {
@@ -250,7 +261,7 @@ _forEachInstanceProperty(_context22 = _Object$keys(_popoverContainer)).call(_con
250
261
  });
251
262
  });
252
263
  var _popoverMenu = require("./popoverMenu");
253
- _forEachInstanceProperty(_context23 = _Object$keys(_popoverMenu)).call(_context23, function (key) {
264
+ _forEachInstanceProperty(_context24 = _Object$keys(_popoverMenu)).call(_context24, function (key) {
254
265
  if (key === "default" || key === "__esModule") return;
255
266
  if (key in exports && exports[key] === _popoverMenu[key]) return;
256
267
  _Object$defineProperty(exports, key, {
@@ -261,7 +272,7 @@ _forEachInstanceProperty(_context23 = _Object$keys(_popoverMenu)).call(_context2
261
272
  });
262
273
  });
263
274
  var _requirementsList = require("./requirementsList");
264
- _forEachInstanceProperty(_context24 = _Object$keys(_requirementsList)).call(_context24, function (key) {
275
+ _forEachInstanceProperty(_context25 = _Object$keys(_requirementsList)).call(_context25, function (key) {
265
276
  if (key === "default" || key === "__esModule") return;
266
277
  if (key in exports && exports[key] === _requirementsList[key]) return;
267
278
  _Object$defineProperty(exports, key, {
@@ -272,7 +283,7 @@ _forEachInstanceProperty(_context24 = _Object$keys(_requirementsList)).call(_con
272
283
  });
273
284
  });
274
285
  var _rockerButtonGroup = require("./rockerButtonGroup");
275
- _forEachInstanceProperty(_context25 = _Object$keys(_rockerButtonGroup)).call(_context25, function (key) {
286
+ _forEachInstanceProperty(_context26 = _Object$keys(_rockerButtonGroup)).call(_context26, function (key) {
276
287
  if (key === "default" || key === "__esModule") return;
277
288
  if (key in exports && exports[key] === _rockerButtonGroup[key]) return;
278
289
  _Object$defineProperty(exports, key, {
@@ -283,7 +294,7 @@ _forEachInstanceProperty(_context25 = _Object$keys(_rockerButtonGroup)).call(_co
283
294
  });
284
295
  });
285
296
  var _scrollBox = require("./scrollBox");
286
- _forEachInstanceProperty(_context26 = _Object$keys(_scrollBox)).call(_context26, function (key) {
297
+ _forEachInstanceProperty(_context27 = _Object$keys(_scrollBox)).call(_context27, function (key) {
287
298
  if (key === "default" || key === "__esModule") return;
288
299
  if (key in exports && exports[key] === _scrollBox[key]) return;
289
300
  _Object$defineProperty(exports, key, {
@@ -294,7 +305,7 @@ _forEachInstanceProperty(_context26 = _Object$keys(_scrollBox)).call(_context26,
294
305
  });
295
306
  });
296
307
  var _separator = require("./separator");
297
- _forEachInstanceProperty(_context27 = _Object$keys(_separator)).call(_context27, function (key) {
308
+ _forEachInstanceProperty(_context28 = _Object$keys(_separator)).call(_context28, function (key) {
298
309
  if (key === "default" || key === "__esModule") return;
299
310
  if (key in exports && exports[key] === _separator[key]) return;
300
311
  _Object$defineProperty(exports, key, {
@@ -305,7 +316,7 @@ _forEachInstanceProperty(_context27 = _Object$keys(_separator)).call(_context27,
305
316
  });
306
317
  });
307
318
  var _shared = require("./shared");
308
- _forEachInstanceProperty(_context28 = _Object$keys(_shared)).call(_context28, function (key) {
319
+ _forEachInstanceProperty(_context29 = _Object$keys(_shared)).call(_context29, function (key) {
309
320
  if (key === "default" || key === "__esModule") return;
310
321
  if (key in exports && exports[key] === _shared[key]) return;
311
322
  _Object$defineProperty(exports, key, {
@@ -316,7 +327,7 @@ _forEachInstanceProperty(_context28 = _Object$keys(_shared)).call(_context28, fu
316
327
  });
317
328
  });
318
329
  var _table = require("./table");
319
- _forEachInstanceProperty(_context29 = _Object$keys(_table)).call(_context29, function (key) {
330
+ _forEachInstanceProperty(_context30 = _Object$keys(_table)).call(_context30, function (key) {
320
331
  if (key === "default" || key === "__esModule") return;
321
332
  if (key in exports && exports[key] === _table[key]) return;
322
333
  _Object$defineProperty(exports, key, {
@@ -327,7 +338,7 @@ _forEachInstanceProperty(_context29 = _Object$keys(_table)).call(_context29, fun
327
338
  });
328
339
  });
329
340
  var _text = require("./text");
330
- _forEachInstanceProperty(_context30 = _Object$keys(_text)).call(_context30, function (key) {
341
+ _forEachInstanceProperty(_context31 = _Object$keys(_text)).call(_context31, function (key) {
331
342
  if (key === "default" || key === "__esModule") return;
332
343
  if (key in exports && exports[key] === _text[key]) return;
333
344
  _Object$defineProperty(exports, key, {
@@ -338,7 +349,7 @@ _forEachInstanceProperty(_context30 = _Object$keys(_text)).call(_context30, func
338
349
  });
339
350
  });
340
351
  var _tooltipTrigger = require("./tooltipTrigger");
341
- _forEachInstanceProperty(_context31 = _Object$keys(_tooltipTrigger)).call(_context31, function (key) {
352
+ _forEachInstanceProperty(_context32 = _Object$keys(_tooltipTrigger)).call(_context32, function (key) {
342
353
  if (key === "default" || key === "__esModule") return;
343
354
  if (key in exports && exports[key] === _tooltipTrigger[key]) return;
344
355
  _Object$defineProperty(exports, key, {
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import { LabelProps as ThemeUILabelProps } from 'theme-ui';
3
+ import { TestingAttributes } from './shared/test';
4
+ import { HelpHintProps } from './helpHint';
5
+ export type LabelModeProps = 'default' | 'float' | 'left';
6
+ export interface LabelProps extends ThemeUILabelProps, TestingAttributes {
7
+ children?: React.ReactNode;
8
+ className?: string;
9
+ /** Whether the label has disabled styling applied. */
10
+ isDisabled?: boolean;
11
+ /** Whether the label has required indicator styling applied. */
12
+ isRequired?: boolean;
13
+ /** Determines the behavior pattern for the label. */
14
+ mode?: LabelModeProps;
15
+ labelMode?: LabelModeProps;
16
+ /** The visual component used to mark an input as required within the label. */
17
+ requiredIndicator?: React.ReactNode;
18
+ /** If present this prop will cause a help hint to render in the label. */
19
+ hintText?: string;
20
+ /** Props object that is spread directly into the helphint element. */
21
+ helpHintProps?: HelpHintProps;
22
+ statusClasses?: {
23
+ [className: string]: boolean;
24
+ };
25
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -20,4 +20,7 @@ export type PanelSize = 'small' | 'medium' | 'large' | 'full' | 'custom';
20
20
  type IconTShirtSize = 'xs' | 'sm' | 'md';
21
21
  type pixelSize = 'em' | 'px' | 'rem';
22
22
  export type IconSize = IconTShirtSize | number | `${number}${pixelSize}`;
23
+ export type overflowWrap = 'normal' | 'break-word' | 'anywhere' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset';
24
+ export type wordBreak = 'normal' | 'break-all' | 'keep-all' | 'break-word' | 'initial' | 'inherit';
25
+ export type wordWrap = 'normal' | 'break-word' | 'initial' | 'inherit';
23
26
  export {};
@@ -0,0 +1,5 @@
1
+ export declare const modes: {
2
+ DEFAULT: string;
3
+ FLOAT: string;
4
+ LEFT: string;
5
+ };
@@ -13,8 +13,10 @@ import _everyInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
13
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; }
14
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; }
15
15
  import React, { useEffect, useState } from 'react';
16
+ import MenuDown from '@pingux/mdi-react/MenuDownIcon';
17
+ import MenuRight from '@pingux/mdi-react/MenuRightIcon';
16
18
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
17
- import { Box, CheckboxField, Link, Text } from '../../index';
19
+ import { Badge, Box, CheckboxField, IconButtonToggle, Link, SwitchField, Text } from '../../index';
18
20
  import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
19
21
  import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
20
22
  import { statusArgTypes } from '../../utils/docUtils/statusProp';
@@ -104,19 +106,138 @@ export var HelperText = function HelperText() {
104
106
  label: "Click me"
105
107
  });
106
108
  };
109
+ export var ExpandableAndToggleableIndeterminate = function ExpandableAndToggleableIndeterminate() {
110
+ var _useState = useState(false),
111
+ _useState2 = _slicedToArray(_useState, 2),
112
+ isReadOnly = _useState2[0],
113
+ setIsReadOnly = _useState2[1];
114
+ var _useState3 = useState(true),
115
+ _useState4 = _slicedToArray(_useState3, 2),
116
+ isExpanded = _useState4[0],
117
+ setIsExpanded = _useState4[1];
118
+ // Whether the parent checkbox is indeterminate (default is true for our example)
119
+ var _useState5 = useState(true),
120
+ _useState6 = _slicedToArray(_useState5, 2),
121
+ isIndeterminate = _useState6[0],
122
+ setIsIndeterminate = _useState6[1];
123
+ // Whether the parent checkbox should be checked, this is set independently from indeterminism
124
+ var _useState7 = useState(false),
125
+ _useState8 = _slicedToArray(_useState7, 2),
126
+ isCompleted = _useState8[0],
127
+ setIsCompleted = _useState8[1];
128
+ // The state of the sub-checkboxes
129
+ var _useState9 = useState([{
130
+ label: 'Apple Chunks',
131
+ isSelected: true
132
+ }, {
133
+ label: 'Blueberries',
134
+ isSelected: false
135
+ }, {
136
+ label: 'Grapes',
137
+ isSelected: false
138
+ }, {
139
+ label: 'Strawberry Slices',
140
+ isSelected: true
141
+ }]),
142
+ _useState10 = _slicedToArray(_useState9, 2),
143
+ subCheckboxes = _useState10[0],
144
+ setSubCheckboxes = _useState10[1];
145
+
146
+ // Determine which checkbox needs its state updated
147
+ var handleSubCheckboxChange = function handleSubCheckboxChange(isSelected, changedIndex) {
148
+ var changeAll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
149
+ var newSubCheckboxes = _mapInstanceProperty(subCheckboxes).call(subCheckboxes, function (checkbox, index) {
150
+ if (changeAll || index === changedIndex) return _objectSpread(_objectSpread({}, checkbox), {}, {
151
+ isSelected: isSelected
152
+ });
153
+ return checkbox;
154
+ });
155
+ setSubCheckboxes(newSubCheckboxes);
156
+ };
157
+
158
+ // Update all sub-checkbox states when the parent checkbox is pressed
159
+ var handleParentCheckboxChange = function handleParentCheckboxChange(isSelected) {
160
+ handleSubCheckboxChange(isSelected, null, true);
161
+ };
162
+ useEffect(function () {
163
+ // Determine if all sub-checkboxes are selected / unselected or if there is a mix
164
+ // and update the parent checkbox
165
+ if (_everyInstanceProperty(subCheckboxes).call(subCheckboxes, function (item) {
166
+ return item.isSelected;
167
+ })) {
168
+ setIsIndeterminate(false);
169
+ setIsCompleted(true);
170
+ } else if (_everyInstanceProperty(subCheckboxes).call(subCheckboxes, function (item) {
171
+ return !item.isSelected;
172
+ })) {
173
+ setIsIndeterminate(false);
174
+ setIsCompleted(false);
175
+ } else {
176
+ setIsIndeterminate(true);
177
+ setIsCompleted(false);
178
+ }
179
+ }, [isIndeterminate, subCheckboxes]);
180
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(SwitchField, {
181
+ isSelected: isReadOnly,
182
+ label: "Is Read Only",
183
+ onChange: setIsReadOnly,
184
+ value: "my-switch"
185
+ }), ___EmotionJSX("br", null), ___EmotionJSX(Box, {
186
+ isRow: true,
187
+ alignItems: "center"
188
+ }, ___EmotionJSX(IconButtonToggle, {
189
+ toggledIcon: MenuDown,
190
+ defaultIcon: MenuRight,
191
+ onToggle: setIsExpanded,
192
+ isToggled: isExpanded,
193
+ buttonProps: {
194
+ 'aria-label': isExpanded ? 'menu down' : 'menu up',
195
+ 'aria-controls': 'expanded-checkboxes',
196
+ 'aria-expanded': isExpanded
197
+ },
198
+ iconProps: {
199
+ size: 'sm'
200
+ }
201
+ }), isReadOnly ? ___EmotionJSX(Text, null, "Fruit Salad Recipe") : ___EmotionJSX(CheckboxField, {
202
+ label: "Fruit Salad Recipe",
203
+ isIndeterminate: isIndeterminate,
204
+ isSelected: isCompleted,
205
+ onChange: handleParentCheckboxChange
206
+ }), ___EmotionJSX(Box, null, ___EmotionJSX(Badge, {
207
+ ml: "sm",
208
+ label: subCheckboxes.length,
209
+ variant: "countNeutral"
210
+ }))), ___EmotionJSX(Box, {
211
+ ml: "50px",
212
+ id: "expanded-checkboxes"
213
+ }, isExpanded && _mapInstanceProperty(subCheckboxes).call(subCheckboxes, function (checkbox, index) {
214
+ return ___EmotionJSX(Box, {
215
+ isRow: true,
216
+ alignItems: "center",
217
+ height: "24px"
218
+ }, isReadOnly ? ___EmotionJSX(Text, null, checkbox.label) : ___EmotionJSX(CheckboxField, {
219
+ key: checkbox.label,
220
+ label: checkbox.label,
221
+ isSelected: checkbox.isSelected,
222
+ onChange: function onChange(isSelected) {
223
+ return handleSubCheckboxChange(isSelected, index);
224
+ }
225
+ }));
226
+ })));
227
+ };
107
228
  export var Indeterminate = function Indeterminate() {
108
229
  // Whether the parent checkbox is indeterminate (default is true for our example)
109
- var _useState = useState(true),
110
- _useState2 = _slicedToArray(_useState, 2),
111
- isIndeterminate = _useState2[0],
112
- setIsIndeterminate = _useState2[1];
230
+ var _useState11 = useState(true),
231
+ _useState12 = _slicedToArray(_useState11, 2),
232
+ isIndeterminate = _useState12[0],
233
+ setIsIndeterminate = _useState12[1];
113
234
  // Whether the parent checkbox should be checked, this is set independently from indeterminism
114
- var _useState3 = useState(false),
115
- _useState4 = _slicedToArray(_useState3, 2),
116
- isCompleted = _useState4[0],
117
- setIsCompleted = _useState4[1];
235
+ var _useState13 = useState(false),
236
+ _useState14 = _slicedToArray(_useState13, 2),
237
+ isCompleted = _useState14[0],
238
+ setIsCompleted = _useState14[1];
118
239
  // The state of the sub-checkboxes
119
- var _useState5 = useState([{
240
+ var _useState15 = useState([{
120
241
  label: 'Apple Chunks',
121
242
  isSelected: true
122
243
  }, {
@@ -129,9 +250,9 @@ export var Indeterminate = function Indeterminate() {
129
250
  label: 'Strawberry Slices',
130
251
  isSelected: true
131
252
  }]),
132
- _useState6 = _slicedToArray(_useState5, 2),
133
- subCheckboxes = _useState6[0],
134
- setSubCheckboxes = _useState6[1];
253
+ _useState16 = _slicedToArray(_useState15, 2),
254
+ subCheckboxes = _useState16[0],
255
+ setSubCheckboxes = _useState16[1];
135
256
 
136
257
  // Determine which checkbox needs its state updated
137
258
  var handleSubCheckboxChange = function handleSubCheckboxChange(isSelected, changedIndex) {
@@ -2,22 +2,20 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
3
  import _styled from "@emotion/styled/base";
4
4
  var _excluded = ["children", "className", "isDisabled", "isRequired", "mode", "requiredIndicator", "hintText", "helpHintProps"];
5
- import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
6
5
  import React, { forwardRef } from 'react';
7
- import PropTypes from 'prop-types';
8
6
  import { flexbox, layout } from 'styled-system';
9
7
  import { Label as ThemeUILabel } from 'theme-ui';
10
8
  import { usePropWarning, useStatusClasses } from '../../hooks';
9
+ import { modes } from '../../utils/devUtils/constants/labelModes';
11
10
  import Box from '../Box';
12
11
  import HelpHint from '../HelpHint';
13
- import { modes } from './constants';
14
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
13
  var ExtendedLabel = /*#__PURE__*/_styled(ThemeUILabel, process.env.NODE_ENV === "production" ? {
16
- target: "e172msu10"
14
+ target: "e19mxf30"
17
15
  } : {
18
- target: "e172msu10",
16
+ target: "e19mxf30",
19
17
  label: "ExtendedLabel"
20
- })(layout, flexbox, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0xhYmVsL0xhYmVsLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVlzQiIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9MYWJlbC9MYWJlbC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IGZsZXhib3gsIGxheW91dCB9IGZyb20gJ3N0eWxlZC1zeXN0ZW0nO1xuaW1wb3J0IHsgTGFiZWwgYXMgVGhlbWVVSUxhYmVsIH0gZnJvbSAndGhlbWUtdWknO1xuXG5pbXBvcnQgeyB1c2VQcm9wV2FybmluZywgdXNlU3RhdHVzQ2xhc3NlcyB9IGZyb20gJy4uLy4uL2hvb2tzJztcbmltcG9ydCBCb3ggZnJvbSAnLi4vQm94JztcbmltcG9ydCBIZWxwSGludCBmcm9tICcuLi9I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gYmVoYXZpb3IgcGF0dGVybiBmb3IgdGhlIGxhYmVsLiAqL1xuICBtb2RlOiBQcm9wVHlwZXMub25lT2YoT2JqZWN0LnZhbHVlcyhtb2RlcykpLFxuICAvKiogVGhlIHZpc3VhbCBjb21wb25lbnQgdXNlZCB0byBtYXJrIGFuIGlucHV0IGFzIHJlcXVpcmVkIHdpdGhpbiB0aGUgbGFiZWwuICovXG4gIHJlcXVpcmVkSW5kaWNhdG9yOiBQcm9wVHlwZXMubm9kZSxcbiAgLyoqIElmIHByZXNlbnQgdGhpcyBwcm9wIHdpbGwgY2F1c2UgYSBoZWxwIGhpbnQgdG8gcmVuZGVyIGluIHRoZSBsYWJlbC4gKi9cbiAgaGludFRleHQ6IFByb3BUeXBlcy5zdHJpbmcsXG4gIC8qKiBQcm9wcyBvYmplY3QgdGhhdCBpcyBzcHJlYWQgZGlyZWN0bHkgaW50byB0aGUgaGVscGhpbnQgZWxlbWVudC4gKi9cbiAgaGVscEhpbnRQcm9wczogUHJvcFR5cGVzLnNoYXBlKHt9KSxcbn07XG5cbkxhYmVsLmRlZmF1bHRQcm9wcyA9IHtcbiAgbW9kZTogbW9kZXMuREVGQVVMVCxcbn07XG5cbkxhYmVsLmRpc3BsYXlOYW1lID0gJ0xhYmVsJztcbmV4cG9ydCBkZWZhdWx0IExhYmVsO1xuIl19 */");
18
+ })(layout, flexbox, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0xhYmVsL0xhYmVsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXc0IiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvTGFiZWwvTGFiZWwudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdC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tcbiAgICAgICAgaXNSZXF1aXJlZFxuICAgICAgICAmJiAocmVxdWlyZWRJbmRpY2F0b3IgfHwgZGVmYXVsdEluZGljYXRvcilcbiAgICAgIH1cbiAgICAgIHtcbiAgICAgICAgaGludFRleHRcbiAgICAgICAgJiYgPEhlbHBIaW50IHsuLi5oZWxwSGludFByb3BzfT57aGludFRleHR9PC9IZWxwSGludD5cbiAgICAgIH1cbiAgICA8L0V4dGVuZGVkTGFiZWw+XG4gICk7XG59KTtcblxuTGFiZWwuZGlzcGxheU5hbWUgPSAnTGFiZWwnO1xuZXhwb3J0IGRlZmF1bHQgTGFiZWw7XG4iXX0= */");
21
19
  var defaultIndicator = ___EmotionJSX(Box, {
22
20
  variant: "forms.label.indicator"
23
21
  }, "*");
@@ -37,7 +35,8 @@ var Label = /*#__PURE__*/forwardRef(function (props, ref) {
37
35
  className = props.className,
38
36
  isDisabled = props.isDisabled,
39
37
  isRequired = props.isRequired,
40
- mode = props.mode,
38
+ _props$mode = props.mode,
39
+ mode = _props$mode === void 0 ? modes.DEFAULT : _props$mode,
41
40
  requiredIndicator = props.requiredIndicator,
42
41
  hintText = props.hintText,
43
42
  helpHintProps = props.helpHintProps,
@@ -56,22 +55,5 @@ var Label = /*#__PURE__*/forwardRef(function (props, ref) {
56
55
  className: classNames
57
56
  }, others), children, isRequired && (requiredIndicator || defaultIndicator), hintText && ___EmotionJSX(HelpHint, helpHintProps, hintText));
58
57
  });
59
- Label.propTypes = {
60
- /** Whether the label has disabled styling applied. */
61
- isDisabled: PropTypes.bool,
62
- /** Whether the label has required indicator styling applied. */
63
- isRequired: PropTypes.bool,
64
- /** Determines the behavior pattern for the label. */
65
- mode: PropTypes.oneOf(_Object$values(modes)),
66
- /** The visual component used to mark an input as required within the label. */
67
- requiredIndicator: PropTypes.node,
68
- /** If present this prop will cause a help hint to render in the label. */
69
- hintText: PropTypes.string,
70
- /** Props object that is spread directly into the helphint element. */
71
- helpHintProps: PropTypes.shape({})
72
- };
73
- Label.defaultProps = {
74
- mode: modes.DEFAULT
75
- };
76
58
  Label.displayName = 'Label';
77
59
  export default Label;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
3
  import { Label } from '../../index';
4
- import { modes } from './constants';
4
+ import { modes } from '../../utils/devUtils/constants/labelModes';
5
5
  import { jsx as ___EmotionJSX } from "@emotion/react";
6
6
  export default {
7
7
  title: 'Form/Base Components/Label',
@@ -10,6 +10,7 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
10
  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; }
11
11
  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; }
12
12
  // Styles for default label and variants go here.
13
+
13
14
  import { text } from '../Text/Text.styles';
14
15
  var activeFloatLabel = {
15
16
  fontWeight: 0,
@@ -31,10 +31,10 @@ import { OverlayProvider } from 'react-aria';
31
31
  import { useAsyncList } from 'react-stately';
32
32
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
33
33
  import { Item, Section, SelectField, Separator } from '../../index';
34
+ import { modes as labelModes } from '../../utils/devUtils/constants/labelModes';
34
35
  import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
35
36
  import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
36
37
  import { statusArgTypes } from '../../utils/docUtils/statusProp';
37
- import { modes as labelModes } from '../Label/constants';
38
38
  import SelectFieldReadme from './SelectField.mdx';
39
39
  import { jsx as ___EmotionJSX } from "@emotion/react";
40
40
  var animals = [{
@@ -18,6 +18,7 @@ import { HiddenSelect } from 'react-aria';
18
18
  import MenuDown from '@pingux/mdi-react/MenuDownIcon';
19
19
  import PropTypes from 'prop-types';
20
20
  import { v4 as uuid } from 'uuid';
21
+ import { modes } from '../../utils/devUtils/constants/labelModes';
21
22
  import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
22
23
  import { statusPropTypes } from '../../utils/docUtils/statusProp';
23
24
  import Box from '../Box';
@@ -25,7 +26,6 @@ import Button from '../Button';
25
26
  import FieldHelperText from '../FieldHelperText';
26
27
  import Icon from '../Icon';
27
28
  import Label from '../Label';
28
- import { modes } from '../Label/constants';
29
29
  import Loader from '../Loader';
30
30
  import Text from '../Text';
31
31