@pingux/astro 2.81.0 → 2.82.0-alpha.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.
@@ -106,6 +106,13 @@ SelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
106
106
|
*/
|
107
107
|
onSelectionChange: _propTypes["default"].func
|
108
108
|
}, _fieldAttributes.inputFieldAttributesBasePropTypes), {}, {
|
109
|
+
/** Provides a way to insert markup in specified places. */
|
110
|
+
slots: _propTypes["default"].shape({
|
111
|
+
/** The given node will be inserted before the text in field container. */
|
112
|
+
leftOfData: _propTypes["default"].node,
|
113
|
+
/** The given node will be inserted into the field container. */
|
114
|
+
inContainer: _propTypes["default"].node
|
115
|
+
}),
|
109
116
|
/**
|
110
117
|
* Props object passed along to `useSelect` from React Aria, `useSelectState` from React Stately,
|
111
118
|
* and/or the visible button representation for the select input.
|
@@ -21,7 +21,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
21
21
|
_Object$defineProperty(exports, "__esModule", {
|
22
22
|
value: true
|
23
23
|
});
|
24
|
-
exports["default"] = exports.WithoutStatusIndicator = exports.WithSections = exports.WithNoneOption = exports.WithCustomHeight = exports.NoOptionsAvailable = exports.HelperText = exports.FloatLabel = exports.DynamicItems = exports.DisabledOptions = exports.DisabledField = exports.Default = exports.Controlled = exports.AsyncLoading = void 0;
|
24
|
+
exports["default"] = exports.WithoutStatusIndicator = exports.WithSlots = exports.WithSections = exports.WithNoneOption = exports.WithCustomHeight = exports.NoOptionsAvailable = exports.HelperText = exports.FloatLabel = exports.DynamicItems = exports.DisabledOptions = exports.DisabledField = exports.Default = exports.Controlled = exports.AsyncLoading = void 0;
|
25
25
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
26
26
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
27
27
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
@@ -34,6 +34,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
34
34
|
var _react = _interopRequireWildcard(require("react"));
|
35
35
|
var _reactAria = require("react-aria");
|
36
36
|
var _reactStately = require("react-stately");
|
37
|
+
var _CalendarRangeIcon = _interopRequireDefault(require("@pingux/mdi-react/CalendarRangeIcon"));
|
37
38
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
38
39
|
var _index = require("../../index");
|
39
40
|
var _labelModes = require("../../utils/devUtils/constants/labelModes");
|
@@ -277,6 +278,35 @@ var WithNoneOption = function WithNoneOption() {
|
|
277
278
|
}, "Yellow"));
|
278
279
|
};
|
279
280
|
exports.WithNoneOption = WithNoneOption;
|
281
|
+
var WithSlots = function WithSlots() {
|
282
|
+
return (0, _react2.jsx)(_index.SelectField, {
|
283
|
+
slots: {
|
284
|
+
leftOfData: (0, _react2.jsx)(_index.Icon, {
|
285
|
+
icon: _CalendarRangeIcon["default"],
|
286
|
+
color: "accent.40",
|
287
|
+
mr: "xs",
|
288
|
+
title: {
|
289
|
+
name: 'Calendar Icon'
|
290
|
+
}
|
291
|
+
})
|
292
|
+
}
|
293
|
+
}, (0, _react2.jsx)(_index.Item, {
|
294
|
+
key: "today"
|
295
|
+
}, "Today"), (0, _react2.jsx)(_index.Item, {
|
296
|
+
key: "fromYesterday"
|
297
|
+
}, "From Yesterday"), (0, _react2.jsx)(_index.Item, {
|
298
|
+
key: "last7days"
|
299
|
+
}, "Last 7 Days"), (0, _react2.jsx)(_index.Item, {
|
300
|
+
key: "last30days"
|
301
|
+
}, "Last 30 Days"), (0, _react2.jsx)(_index.Item, {
|
302
|
+
key: "thisMonth"
|
303
|
+
}, "This Month"), (0, _react2.jsx)(_index.Item, {
|
304
|
+
key: "lastMonth"
|
305
|
+
}, "Last Month"), (0, _react2.jsx)(_index.Item, {
|
306
|
+
key: "customRange"
|
307
|
+
}, "Custom Range"));
|
308
|
+
};
|
309
|
+
exports.WithSlots = WithSlots;
|
280
310
|
var DisabledField = function DisabledField() {
|
281
311
|
return (0, _react2.jsx)(_index.SelectField, {
|
282
312
|
label: "What's your favorite color?",
|
@@ -95,6 +95,13 @@ SelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
95
95
|
*/
|
96
96
|
onSelectionChange: PropTypes.func
|
97
97
|
}, inputFieldAttributesBasePropTypes), {}, {
|
98
|
+
/** Provides a way to insert markup in specified places. */
|
99
|
+
slots: PropTypes.shape({
|
100
|
+
/** The given node will be inserted before the text in field container. */
|
101
|
+
leftOfData: PropTypes.node,
|
102
|
+
/** The given node will be inserted into the field container. */
|
103
|
+
inContainer: PropTypes.node
|
104
|
+
}),
|
98
105
|
/**
|
99
106
|
* Props object passed along to `useSelect` from React Aria, `useSelectState` from React Stately,
|
100
107
|
* and/or the visible button representation for the select input.
|
@@ -29,8 +29,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
29
29
|
import React, { useState } from 'react';
|
30
30
|
import { OverlayProvider } from 'react-aria';
|
31
31
|
import { useAsyncList } from 'react-stately';
|
32
|
+
import CalendarRangeIcon from '@pingux/mdi-react/CalendarRangeIcon';
|
32
33
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
33
|
-
import { Item, Section, SelectField, Separator } from '../../index';
|
34
|
+
import { Icon, Item, Section, SelectField, Separator } from '../../index';
|
34
35
|
import { modes as labelModes } from '../../utils/devUtils/constants/labelModes';
|
35
36
|
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
36
37
|
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
@@ -259,6 +260,34 @@ export var WithNoneOption = function WithNoneOption() {
|
|
259
260
|
key: "yellow"
|
260
261
|
}, "Yellow"));
|
261
262
|
};
|
263
|
+
export var WithSlots = function WithSlots() {
|
264
|
+
return ___EmotionJSX(SelectField, {
|
265
|
+
slots: {
|
266
|
+
leftOfData: ___EmotionJSX(Icon, {
|
267
|
+
icon: CalendarRangeIcon,
|
268
|
+
color: "accent.40",
|
269
|
+
mr: "xs",
|
270
|
+
title: {
|
271
|
+
name: 'Calendar Icon'
|
272
|
+
}
|
273
|
+
})
|
274
|
+
}
|
275
|
+
}, ___EmotionJSX(Item, {
|
276
|
+
key: "today"
|
277
|
+
}, "Today"), ___EmotionJSX(Item, {
|
278
|
+
key: "fromYesterday"
|
279
|
+
}, "From Yesterday"), ___EmotionJSX(Item, {
|
280
|
+
key: "last7days"
|
281
|
+
}, "Last 7 Days"), ___EmotionJSX(Item, {
|
282
|
+
key: "last30days"
|
283
|
+
}, "Last 30 Days"), ___EmotionJSX(Item, {
|
284
|
+
key: "thisMonth"
|
285
|
+
}, "This Month"), ___EmotionJSX(Item, {
|
286
|
+
key: "lastMonth"
|
287
|
+
}, "Last Month"), ___EmotionJSX(Item, {
|
288
|
+
key: "customRange"
|
289
|
+
}, "Custom Range"));
|
290
|
+
};
|
262
291
|
export var DisabledField = function DisabledField() {
|
263
292
|
return ___EmotionJSX(SelectField, {
|
264
293
|
label: "What's your favorite color?",
|