@pingux/astro 2.84.0-alpha.0 → 2.84.0-alpha.10
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.
- package/lib/cjs/components/Avatar/Avatar.js +43 -8
- package/lib/cjs/components/Avatar/Avatar.test.js +10 -1
- package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +5 -3
- package/lib/cjs/components/CodeView/CodeView.js +5 -2
- package/lib/cjs/components/CodeView/CodeView.styles.d.ts +2 -1
- package/lib/cjs/components/CodeView/CodeView.styles.js +4 -3
- package/lib/cjs/components/Link/Link.js +3 -1
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +3 -6
- package/lib/cjs/components/ListBox/ListBox.styles.js +6 -3
- package/lib/cjs/components/Menu/Menu.js +15 -3
- package/lib/cjs/components/Menu/Menu.test.js +23 -0
- package/lib/cjs/components/MenuItem/MenuItem.styles.d.ts +1 -0
- package/lib/cjs/components/MenuItem/MenuItem.styles.js +2 -1
- package/lib/cjs/components/MenuSection/MenuSection.d.ts +9 -0
- package/lib/cjs/components/MenuSection/MenuSection.js +76 -0
- package/lib/cjs/components/MenuSection/MenuSection.styles.d.ts +21 -0
- package/lib/cjs/components/MenuSection/MenuSection.styles.js +35 -0
- package/lib/cjs/components/MenuSection/MenuSection.test.d.ts +1 -0
- package/lib/cjs/components/MenuSection/MenuSection.test.js +100 -0
- package/lib/cjs/components/MenuSection/index.d.ts +1 -0
- package/lib/cjs/components/MenuSection/index.js +14 -0
- package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.d.ts +2 -0
- package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +73 -5
- package/lib/cjs/components/SelectField/SelectField.stories.js +3 -6
- package/lib/cjs/components/SwitchField/SwitchField.d.ts +4 -0
- package/lib/cjs/components/SwitchField/SwitchField.js +12 -32
- package/lib/cjs/components/SwitchField/SwitchField.stories.d.ts +11 -0
- package/lib/cjs/components/SwitchField/SwitchField.stories.js +4 -2
- package/lib/cjs/components/SwitchField/SwitchField.test.d.ts +1 -0
- package/lib/cjs/components/SwitchField/index.d.ts +1 -0
- package/lib/cjs/components/SwitchField/switchFieldAttributes.d.ts +94 -0
- package/lib/cjs/components/SwitchField/switchFieldAttributes.js +2 -30
- package/lib/cjs/components/Tabs/Tabs.js +0 -1
- package/lib/cjs/components/Tabs/Tabs.style.d.ts +1 -0
- package/lib/cjs/components/Tabs/Tabs.style.js +2 -1
- package/lib/cjs/components/TimeField/TimeField.stories.js +2 -2
- package/lib/cjs/styles/theme.js +5 -1
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.d.ts +105 -0
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.js +134 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +344 -36
- package/lib/cjs/styles/themes/next-gen/next-gen.js +24 -4
- package/lib/cjs/styles/themes/next-gen/sizes.d.ts +18 -0
- package/lib/cjs/styles/themes/next-gen/sizes.js +27 -0
- package/lib/cjs/styles/themes/next-gen/spacing.d.ts +9 -0
- package/lib/cjs/styles/themes/next-gen/spacing.js +17 -0
- package/lib/cjs/styles/themes/next-gen/text.d.ts +8 -2
- package/lib/cjs/styles/themes/next-gen/text.js +16 -13
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +36 -3
- package/lib/cjs/styles/themes/next-gen/variants/button.js +25 -5
- package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +20 -0
- package/lib/cjs/styles/themes/next-gen/variants/cards.js +28 -0
- package/lib/cjs/styles/themes/next-gen/variants/images.d.ts +4 -0
- package/lib/cjs/styles/themes/next-gen/variants/images.js +12 -0
- package/lib/cjs/styles/themes/next-gen/variants/links.d.ts +56 -0
- package/lib/cjs/styles/themes/next-gen/variants/links.js +62 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +7 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.js +9 -2
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +82 -31
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +91 -30
- package/lib/cjs/styles/variants/variants.js +2 -0
- package/lib/cjs/types/avatar.d.ts +5 -1
- package/lib/cjs/types/checkboxField.d.ts +3 -1
- package/lib/cjs/types/codeView.d.ts +1 -0
- package/lib/cjs/types/index.d.ts +2 -0
- package/lib/cjs/types/index.js +43 -21
- package/lib/cjs/types/link.d.ts +1 -0
- package/lib/cjs/types/menu.d.ts +1 -1
- package/lib/cjs/types/menuItem.d.ts +1 -1
- package/lib/cjs/types/menuSection.d.ts +24 -0
- package/lib/cjs/types/menuSection.js +6 -0
- package/lib/cjs/types/switchField.d.ts +29 -0
- package/lib/cjs/types/switchField.js +6 -0
- package/lib/components/Avatar/Avatar.js +44 -7
- package/lib/components/Avatar/Avatar.test.js +10 -1
- package/lib/components/CheckboxField/CheckboxField.stories.js +5 -3
- package/lib/components/CodeView/CodeView.js +5 -2
- package/lib/components/CodeView/CodeView.styles.js +4 -3
- package/lib/components/Link/Link.js +3 -1
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +4 -7
- package/lib/components/ListBox/ListBox.styles.js +6 -3
- package/lib/components/Menu/Menu.js +15 -3
- package/lib/components/Menu/Menu.test.js +24 -1
- package/lib/components/MenuItem/MenuItem.styles.js +2 -1
- package/lib/components/MenuSection/MenuSection.js +64 -0
- package/lib/components/MenuSection/MenuSection.styles.js +27 -0
- package/lib/components/MenuSection/MenuSection.test.js +97 -0
- package/lib/components/MenuSection/index.js +1 -0
- package/lib/components/PopoverMenu/PopoverMenu.stories.js +70 -4
- package/lib/components/SelectField/SelectField.stories.js +4 -7
- package/lib/components/SwitchField/SwitchField.js +14 -34
- package/lib/components/SwitchField/SwitchField.stories.js +4 -2
- package/lib/components/SwitchField/switchFieldAttributes.js +1 -28
- package/lib/components/Tabs/Tabs.js +0 -1
- package/lib/components/Tabs/Tabs.style.js +2 -1
- package/lib/components/TimeField/TimeField.stories.js +2 -2
- package/lib/styles/theme.js +5 -1
- package/lib/styles/themes/next-gen/codeView/codeView.js +126 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/styles/themes/next-gen/next-gen.js +24 -4
- package/lib/styles/themes/next-gen/sizes.js +19 -0
- package/lib/styles/themes/next-gen/spacing.js +9 -0
- package/lib/styles/themes/next-gen/text.js +16 -13
- package/lib/styles/themes/next-gen/variants/button.js +25 -5
- package/lib/styles/themes/next-gen/variants/cards.js +20 -0
- package/lib/styles/themes/next-gen/variants/images.js +4 -0
- package/lib/styles/themes/next-gen/variants/links.js +54 -0
- package/lib/styles/themes/next-gen/variants/text.js +9 -2
- package/lib/styles/themes/next-gen/variants/variants.js +91 -30
- package/lib/styles/variants/variants.js +2 -0
- package/lib/types/index.js +2 -0
- package/lib/types/menuSection.js +1 -0
- package/lib/types/switchField.js +1 -0
- package/package.json +1 -1
- package/lib/cjs/recipes/NextGen/DefaultAvatar.stories.d.ts +0 -6
- package/lib/cjs/recipes/NextGen/DefaultAvatar.stories.js +0 -41
- package/lib/recipes/NextGen/DefaultAvatar.stories.js +0 -31
@@ -8,7 +8,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
8
8
|
_Object$defineProperty(exports, "__esModule", {
|
9
9
|
value: true
|
10
10
|
});
|
11
|
-
exports["default"] = exports.Placement = exports.NotFlippable = exports.NotClosedOnSelect = exports.DefaultOpen = exports.Default = exports.Controlled = void 0;
|
11
|
+
exports["default"] = exports.WithSeparator = exports.WithSections = exports.Placement = exports.NotFlippable = exports.NotClosedOnSelect = exports.DefaultOpen = exports.Default = exports.Controlled = void 0;
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
14
14
|
var _DotsVerticalIcon = _interopRequireDefault(require("@pingux/mdi-react/DotsVerticalIcon"));
|
@@ -103,12 +103,12 @@ var DefaultOpen = function DefaultOpen() {
|
|
103
103
|
}
|
104
104
|
})), (0, _react2.jsx)(_index.Menu, {
|
105
105
|
onAction: (0, _addonActions.action)('onAction'),
|
106
|
-
disabledKeys: ['
|
106
|
+
disabledKeys: ['disabledItem']
|
107
107
|
}, (0, _react2.jsx)(_index.Item, {
|
108
108
|
key: "edit"
|
109
109
|
}, "Edit"), (0, _react2.jsx)(_index.Item, {
|
110
|
-
key: "
|
111
|
-
}, "
|
110
|
+
key: "disabledItem"
|
111
|
+
}, "Disabled Item"), (0, _react2.jsx)(_index.Item, {
|
112
112
|
key: "delete",
|
113
113
|
textValue: "delete"
|
114
114
|
}, (0, _react2.jsx)(_index.Text, {
|
@@ -242,4 +242,72 @@ var NotClosedOnSelect = function NotClosedOnSelect() {
|
|
242
242
|
}, "Delete")))))
|
243
243
|
);
|
244
244
|
};
|
245
|
-
exports.NotClosedOnSelect = NotClosedOnSelect;
|
245
|
+
exports.NotClosedOnSelect = NotClosedOnSelect;
|
246
|
+
var WithSeparator = function WithSeparator(args) {
|
247
|
+
return (
|
248
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
249
|
+
// readers when an overlay opens.
|
250
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.PopoverMenu, args, (0, _react2.jsx)(_index.IconButton, {
|
251
|
+
"aria-label": "more options",
|
252
|
+
variant: "inverted"
|
253
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
254
|
+
icon: _DotsVerticalIcon["default"],
|
255
|
+
size: "md",
|
256
|
+
title: {
|
257
|
+
name: 'Dots Vertical Icon'
|
258
|
+
}
|
259
|
+
})), (0, _react2.jsx)(_index.Menu, {
|
260
|
+
onAction: (0, _addonActions.action)('onAction'),
|
261
|
+
disabledKeys: ['disabledItem']
|
262
|
+
}, (0, _react2.jsx)(_index.Section, null, (0, _react2.jsx)(_index.Item, {
|
263
|
+
key: "edit"
|
264
|
+
}, "Edit")), (0, _react2.jsx)(_index.Section, null, (0, _react2.jsx)(_index.Item, {
|
265
|
+
key: "disabledItem"
|
266
|
+
}, "Disabled Item"), (0, _react2.jsx)(_index.Item, {
|
267
|
+
key: "delete",
|
268
|
+
textValue: "delete"
|
269
|
+
}, (0, _react2.jsx)(_index.Text, {
|
270
|
+
color: "critical.bright"
|
271
|
+
}, "Delete"))))))
|
272
|
+
);
|
273
|
+
};
|
274
|
+
exports.WithSeparator = WithSeparator;
|
275
|
+
var WithSections = function WithSections(args) {
|
276
|
+
return (
|
277
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
278
|
+
// readers when an overlay opens.
|
279
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.PopoverMenu, args, (0, _react2.jsx)(_index.IconButton, {
|
280
|
+
"aria-label": "more options",
|
281
|
+
variant: "inverted"
|
282
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
283
|
+
icon: _DotsVerticalIcon["default"],
|
284
|
+
size: "md",
|
285
|
+
title: {
|
286
|
+
name: 'Dots Vertical Icon'
|
287
|
+
}
|
288
|
+
})), (0, _react2.jsx)(_index.Menu, {
|
289
|
+
onAction: (0, _addonActions.action)('onAction'),
|
290
|
+
disabledKeys: ['disabledItem']
|
291
|
+
}, (0, _react2.jsx)(_index.Section, {
|
292
|
+
key: "section 1",
|
293
|
+
title: "Section 1"
|
294
|
+
}, (0, _react2.jsx)(_index.Item, {
|
295
|
+
key: "edit"
|
296
|
+
}, "Edit"), (0, _react2.jsx)(_index.Item, {
|
297
|
+
key: "disabledItem"
|
298
|
+
}, "Disabled Item"), (0, _react2.jsx)(_index.Item, {
|
299
|
+
key: "copy"
|
300
|
+
}, "Copy")), (0, _react2.jsx)(_index.Section, {
|
301
|
+
key: "section 2",
|
302
|
+
title: "Section 2"
|
303
|
+
}, (0, _react2.jsx)(_index.Item, {
|
304
|
+
key: "duplicate"
|
305
|
+
}, "Duplicate"), (0, _react2.jsx)(_index.Item, {
|
306
|
+
key: "delete",
|
307
|
+
textValue: "delete"
|
308
|
+
}, (0, _react2.jsx)(_index.Text, {
|
309
|
+
color: "critical.bright"
|
310
|
+
}, "Delete"))))))
|
311
|
+
);
|
312
|
+
};
|
313
|
+
exports.WithSections = WithSections;
|
@@ -264,18 +264,15 @@ exports.Controlled = Controlled;
|
|
264
264
|
var WithNoneOption = function WithNoneOption() {
|
265
265
|
return (0, _react2.jsx)(_index.SelectField, {
|
266
266
|
label: "What's your favorite color?"
|
267
|
-
}, (0, _react2.jsx)(_index.Item, {
|
267
|
+
}, (0, _react2.jsx)(_index.Section, null, (0, _react2.jsx)(_index.Item, {
|
268
268
|
key: "none"
|
269
|
-
}, "None"), (0, _react2.jsx)(_index.Item, {
|
270
|
-
isSeparator: true,
|
271
|
-
textValue: "-"
|
272
|
-
}, (0, _react2.jsx)(_index.Separator, null)), (0, _react2.jsx)(_index.Item, {
|
269
|
+
}, "None")), (0, _react2.jsx)(_index.Section, null, (0, _react2.jsx)(_index.Item, {
|
273
270
|
key: "red"
|
274
271
|
}, "Red"), (0, _react2.jsx)(_index.Item, {
|
275
272
|
key: "blue"
|
276
273
|
}, "Blue"), (0, _react2.jsx)(_index.Item, {
|
277
274
|
key: "yellow"
|
278
|
-
}, "Yellow"));
|
275
|
+
}, "Yellow")));
|
279
276
|
};
|
280
277
|
exports.WithNoneOption = WithNoneOption;
|
281
278
|
var WithSlots = function WithSlots() {
|
@@ -27,47 +27,25 @@ var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
27
27
|
var _ = require("../..");
|
28
28
|
var _hooks = require("../../hooks");
|
29
29
|
var _pendoID = require("../../utils/devUtils/constants/pendoID");
|
30
|
-
var
|
31
|
-
var _switchFieldAttributes = require("./switchFieldAttributes");
|
30
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
32
31
|
var _react2 = require("@emotion/react");
|
33
|
-
var _excluded = ["label", "helperText", "isDefaultSelected", "
|
34
|
-
/* eslint-disable no-unused-vars */
|
32
|
+
var _excluded = ["label", "helperText", "isDefaultSelected", "isDisabled", "status", "controlProps"];
|
35
33
|
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); }
|
36
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
37
35
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(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; }
|
38
36
|
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) { (0, _defineProperty2["default"])(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; }
|
39
37
|
var displayName = 'SwitchField';
|
40
38
|
var SwitchField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
39
|
+
var _inputProps$checked;
|
41
40
|
var label = props.label,
|
42
41
|
helperText = props.helperText,
|
43
42
|
isDefaultSelected = props.isDefaultSelected,
|
44
|
-
|
45
|
-
onChange = props.onChange,
|
46
|
-
value = props.value,
|
47
|
-
name = props.name,
|
48
|
-
id = props.id,
|
49
|
-
_props$isDisabled = props.isDisabled,
|
50
|
-
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
51
|
-
_props$isReadOnly = props.isReadOnly,
|
52
|
-
isReadOnly = _props$isReadOnly === void 0 ? false : _props$isReadOnly,
|
53
|
-
_props$isRequired = props.isRequired,
|
54
|
-
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
55
|
-
_props$hasAutoFocus = props.hasAutoFocus,
|
56
|
-
hasAutoFocus = _props$hasAutoFocus === void 0 ? false : _props$hasAutoFocus,
|
57
|
-
onFocus = props.onFocus,
|
58
|
-
onBlur = props.onBlur,
|
59
|
-
onFocusChange = props.onFocusChange,
|
60
|
-
onKeyDown = props.onKeyDown,
|
61
|
-
onKeyUp = props.onKeyUp,
|
43
|
+
isDisabled = props.isDisabled,
|
62
44
|
status = props.status,
|
63
45
|
controlProps = props.controlProps,
|
64
46
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
65
|
-
var switchRef = (0, _react.useRef)();
|
66
47
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
67
|
-
|
68
|
-
(0, _react.useImperativeHandle)(ref, function () {
|
69
|
-
return switchRef.current;
|
70
|
-
});
|
48
|
+
var switchRef = (0, _hooks.useLocalOrForwardRef)(ref);
|
71
49
|
var state = (0, _reactStately.useToggleState)(_objectSpread({
|
72
50
|
defaultSelected: isDefaultSelected
|
73
51
|
}, props));
|
@@ -79,11 +57,11 @@ var SwitchField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
79
57
|
var _useSwitch = (0, _reactAria.useSwitch)(_objectSpread(_objectSpread({
|
80
58
|
children: label
|
81
59
|
}, whitelistedProps), {}, {
|
82
|
-
'aria-label': 'switch-field'
|
60
|
+
'aria-label': others['aria-label'] || 'switch-field'
|
83
61
|
}), state, switchRef),
|
84
62
|
inputProps = _useSwitch.inputProps;
|
85
63
|
var statusClasses = {
|
86
|
-
isSelected: inputProps.checked
|
64
|
+
isSelected: (_inputProps$checked = inputProps.checked) !== null && _inputProps$checked !== void 0 ? _inputProps$checked : false
|
87
65
|
};
|
88
66
|
var _useField = (0, _hooks.useField)(_objectSpread(_objectSpread(_objectSpread({
|
89
67
|
statusClasses: statusClasses
|
@@ -103,12 +81,14 @@ var SwitchField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
103
81
|
}, fieldLabelProps), (0, _react2.jsx)(_.Box, fieldControlWrapperProps, (0, _react2.jsx)(_.Switch, (0, _extends2["default"])({
|
104
82
|
ref: switchRef,
|
105
83
|
inputProps: fieldControlInputProps
|
106
|
-
}, unhandledAriaProps, (0, _omit["default"])(others, 'data-pendo-id')))), label), helperText && (0, _react2.jsx)(_.FieldHelperText, {
|
84
|
+
}, unhandledAriaProps, (0, _omit["default"])(others, 'data-pendo-id', 'aria-label')))), label), helperText && (0, _react2.jsx)(_.FieldHelperText, {
|
107
85
|
status: status
|
108
86
|
}, helperText));
|
109
87
|
});
|
110
|
-
SwitchField.
|
111
|
-
|
88
|
+
SwitchField.defaultProps = {
|
89
|
+
status: _statuses["default"].DEFAULT,
|
90
|
+
isDisabled: false
|
91
|
+
};
|
112
92
|
SwitchField.displayName = displayName;
|
113
93
|
var _default = SwitchField;
|
114
94
|
exports["default"] = _default;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { StoryFn } from '@storybook/react';
|
2
|
+
import { SwitchFieldProps } from '../../types';
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
4
|
+
export default _default;
|
5
|
+
export declare const Default: StoryFn<SwitchFieldProps>;
|
6
|
+
export declare const Controlled: StoryFn<SwitchFieldProps>;
|
7
|
+
export declare const DefaultSelected: StoryFn<SwitchFieldProps>;
|
8
|
+
export declare const Disabled: StoryFn<SwitchFieldProps>;
|
9
|
+
export declare const NoVisibleLabel: StoryFn<SwitchFieldProps>;
|
10
|
+
export declare const Required: StoryFn<SwitchFieldProps>;
|
11
|
+
export declare const WithTooltip: StoryFn<SwitchFieldProps>;
|
@@ -60,7 +60,9 @@ var Controlled = function Controlled() {
|
|
60
60
|
return (0, _react2.jsx)(_index.SwitchField, {
|
61
61
|
isSelected: isSelected,
|
62
62
|
label: "Controlled",
|
63
|
-
onChange:
|
63
|
+
onChange: function onChange() {
|
64
|
+
return setIsSelected(!isSelected);
|
65
|
+
},
|
64
66
|
value: "my-switch"
|
65
67
|
});
|
66
68
|
};
|
@@ -97,7 +99,7 @@ var Required = function Required() {
|
|
97
99
|
};
|
98
100
|
exports.Required = Required;
|
99
101
|
var WithTooltip = function WithTooltip() {
|
100
|
-
var tooltipTrigger = (0, _react.useRef)();
|
102
|
+
var tooltipTrigger = (0, _react.useRef)(null);
|
101
103
|
return (0, _react2.jsx)(_index.TooltipTrigger, {
|
102
104
|
crossOffset: 15,
|
103
105
|
offset: 20,
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './SwitchField';
|
@@ -0,0 +1,94 @@
|
|
1
|
+
export declare const switchFieldArgTypes: {
|
2
|
+
className: {
|
3
|
+
type: {
|
4
|
+
summary: string;
|
5
|
+
};
|
6
|
+
description: string;
|
7
|
+
};
|
8
|
+
hasAutoFocus: any;
|
9
|
+
helperText: {
|
10
|
+
control: {
|
11
|
+
type: any;
|
12
|
+
};
|
13
|
+
type: {
|
14
|
+
summary: any;
|
15
|
+
};
|
16
|
+
description: string;
|
17
|
+
};
|
18
|
+
hintText: {
|
19
|
+
control: {
|
20
|
+
type: any;
|
21
|
+
};
|
22
|
+
type: {
|
23
|
+
summary: any;
|
24
|
+
};
|
25
|
+
description: string;
|
26
|
+
};
|
27
|
+
id: {
|
28
|
+
control: {
|
29
|
+
type: any;
|
30
|
+
};
|
31
|
+
type: {
|
32
|
+
summary: any;
|
33
|
+
};
|
34
|
+
description: string;
|
35
|
+
};
|
36
|
+
isDefaultSelected: any;
|
37
|
+
isDisabled: any;
|
38
|
+
isReadOnly: any;
|
39
|
+
isRequired: any;
|
40
|
+
isSelected: {
|
41
|
+
control: {
|
42
|
+
type: string;
|
43
|
+
};
|
44
|
+
type: {
|
45
|
+
summary: any;
|
46
|
+
};
|
47
|
+
description: string;
|
48
|
+
};
|
49
|
+
label: {
|
50
|
+
control: {
|
51
|
+
type: any;
|
52
|
+
};
|
53
|
+
type: {
|
54
|
+
summary: any;
|
55
|
+
};
|
56
|
+
description: string;
|
57
|
+
};
|
58
|
+
name: {
|
59
|
+
control: {
|
60
|
+
type: any;
|
61
|
+
};
|
62
|
+
type: {
|
63
|
+
summary: any;
|
64
|
+
};
|
65
|
+
description: string;
|
66
|
+
};
|
67
|
+
onBlur: any;
|
68
|
+
onChange: any;
|
69
|
+
onFocus: any;
|
70
|
+
onFocusChange: any;
|
71
|
+
onKeyDown: any;
|
72
|
+
onKeyUp: any;
|
73
|
+
value: {
|
74
|
+
control: {
|
75
|
+
type: any;
|
76
|
+
};
|
77
|
+
type: {
|
78
|
+
summary: any;
|
79
|
+
};
|
80
|
+
description: string;
|
81
|
+
};
|
82
|
+
status: {
|
83
|
+
control: {
|
84
|
+
type: string;
|
85
|
+
options: any;
|
86
|
+
};
|
87
|
+
description: string;
|
88
|
+
};
|
89
|
+
};
|
90
|
+
export declare const switchFieldArgs: {
|
91
|
+
label: string;
|
92
|
+
value: string;
|
93
|
+
status: any;
|
94
|
+
};
|
@@ -12,16 +12,11 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
12
12
|
_Object$defineProperty(exports, "__esModule", {
|
13
13
|
value: true
|
14
14
|
});
|
15
|
-
exports.
|
15
|
+
exports.switchFieldArgs = exports.switchFieldArgTypes = void 0;
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
17
17
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
18
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
19
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
20
18
|
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
21
|
-
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
22
19
|
var _docArgTypes = require("../../utils/docUtils/docArgTypes");
|
23
|
-
var _fieldAttributes = require("../../utils/docUtils/fieldAttributes");
|
24
|
-
var _statusProp = require("../../utils/docUtils/statusProp");
|
25
20
|
var _context;
|
26
21
|
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; }
|
27
22
|
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) { (0, _defineProperty2["default"])(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; }
|
@@ -168,27 +163,4 @@ var switchFieldArgs = {
|
|
168
163
|
value: 'my-switch',
|
169
164
|
status: _statuses["default"].DEFAULT
|
170
165
|
};
|
171
|
-
exports.switchFieldArgs = switchFieldArgs;
|
172
|
-
var switchFieldPropTypes = _objectSpread(_objectSpread(_objectSpread({
|
173
|
-
className: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].arrayOf(_propTypes["default"].string)]),
|
174
|
-
hasAutoFocus: _propTypes["default"].bool,
|
175
|
-
helperText: _propTypes["default"].node,
|
176
|
-
hintText: _propTypes["default"].string,
|
177
|
-
id: _propTypes["default"].string,
|
178
|
-
isDefaultSelected: _propTypes["default"].bool,
|
179
|
-
isDisabled: _propTypes["default"].bool,
|
180
|
-
isReadOnly: _propTypes["default"].bool,
|
181
|
-
isRequired: _propTypes["default"].bool,
|
182
|
-
isSelected: _propTypes["default"].bool,
|
183
|
-
label: _propTypes["default"].node,
|
184
|
-
name: _propTypes["default"].string,
|
185
|
-
onBlur: _propTypes["default"].func,
|
186
|
-
onChange: _propTypes["default"].func,
|
187
|
-
onFocus: _propTypes["default"].func,
|
188
|
-
onFocusChange: _propTypes["default"].func,
|
189
|
-
onKeyDown: _propTypes["default"].func,
|
190
|
-
onKeyUp: _propTypes["default"].func,
|
191
|
-
status: _propTypes["default"].oneOf((0, _values["default"])(_statuses["default"])),
|
192
|
-
value: _propTypes["default"].string
|
193
|
-
}, _ariaAttributes.ariaAttributesBasePropTypes), _fieldAttributes.inputFieldAttributesBasePropTypes), _statusProp.statusPropTypes);
|
194
|
-
exports.switchFieldPropTypes = switchFieldPropTypes;
|
166
|
+
exports.switchFieldArgs = switchFieldArgs;
|
@@ -96,7 +96,6 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
96
96
|
value: state
|
97
97
|
}, (0, _react2.jsx)(_Box["default"], others, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
98
98
|
variant: "tabs",
|
99
|
-
gap: "25px",
|
100
99
|
isRow: orientation === _orientation["default"].HORIZONTAL
|
101
100
|
}, tabListProps, raTabListProps, {
|
102
101
|
ref: tabListRef,
|
@@ -91,13 +91,13 @@ var Required = function Required(args) {
|
|
91
91
|
return (0, _react2.jsx)(_index.TimeField, (0, _extends2["default"])({}, args, {
|
92
92
|
"aria-label": "timefield-default",
|
93
93
|
isRequired: true,
|
94
|
-
label: "
|
94
|
+
label: "Lorem Ipsum"
|
95
95
|
}));
|
96
96
|
};
|
97
97
|
exports.Required = Required;
|
98
98
|
var WithLabel = function WithLabel(args) {
|
99
99
|
return (0, _react2.jsx)(_index.TimeField, (0, _extends2["default"])({}, args, {
|
100
|
-
label: "
|
100
|
+
label: "Lorem Ipsum",
|
101
101
|
"aria-label": "timefield-default"
|
102
102
|
}));
|
103
103
|
};
|
package/lib/cjs/styles/theme.js
CHANGED
@@ -37,10 +37,14 @@ var _default = {
|
|
37
37
|
},
|
38
38
|
breakpoints: _breakpoints["default"],
|
39
39
|
fonts: {
|
40
|
-
standard: '"Helvetica Neue", Helvetica, sans-serif'
|
40
|
+
standard: '"Helvetica Neue", Helvetica, sans-serif',
|
41
|
+
codeView: '"Roboto Mono", "Lucida Console", Courier, monospace'
|
41
42
|
},
|
42
43
|
fontSizes: _text.fontSizes,
|
43
44
|
fontWeights: _text.fontWeights,
|
45
|
+
lineHeights: {
|
46
|
+
md: '1.5'
|
47
|
+
},
|
44
48
|
sizes: {
|
45
49
|
buttonHeight: 36,
|
46
50
|
column: 400,
|
@@ -0,0 +1,105 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
theme: {
|
3
|
+
plain: {
|
4
|
+
color: string;
|
5
|
+
backgroundColor: string;
|
6
|
+
};
|
7
|
+
styles: ({
|
8
|
+
types: string[];
|
9
|
+
style: {
|
10
|
+
color: string;
|
11
|
+
background?: undefined;
|
12
|
+
fontWeight?: undefined;
|
13
|
+
cursor?: undefined;
|
14
|
+
};
|
15
|
+
} | {
|
16
|
+
types: string[];
|
17
|
+
style: {
|
18
|
+
color: string;
|
19
|
+
background: string;
|
20
|
+
fontWeight?: undefined;
|
21
|
+
cursor?: undefined;
|
22
|
+
};
|
23
|
+
} | {
|
24
|
+
types: string[];
|
25
|
+
style: {
|
26
|
+
fontWeight: string;
|
27
|
+
color?: undefined;
|
28
|
+
background?: undefined;
|
29
|
+
cursor?: undefined;
|
30
|
+
};
|
31
|
+
} | {
|
32
|
+
types: string[];
|
33
|
+
style: {
|
34
|
+
cursor: string;
|
35
|
+
color?: undefined;
|
36
|
+
background?: undefined;
|
37
|
+
fontWeight?: undefined;
|
38
|
+
};
|
39
|
+
})[];
|
40
|
+
};
|
41
|
+
wrapper: {
|
42
|
+
bg: string;
|
43
|
+
border: string;
|
44
|
+
borderColor: string;
|
45
|
+
width: number;
|
46
|
+
height: number;
|
47
|
+
my: string;
|
48
|
+
overflow: string;
|
49
|
+
alignItems: string;
|
50
|
+
'&.is-focused, &:focus': {
|
51
|
+
boxShadow: string;
|
52
|
+
outline: string;
|
53
|
+
};
|
54
|
+
pre: {
|
55
|
+
backgroundColor: string;
|
56
|
+
padding: string;
|
57
|
+
height: string;
|
58
|
+
width: string;
|
59
|
+
overflowX: string;
|
60
|
+
overflowY: string;
|
61
|
+
fontSize: string;
|
62
|
+
'& .token-line': {
|
63
|
+
display: string;
|
64
|
+
alignItems: string;
|
65
|
+
'& .token': {
|
66
|
+
whiteSpace: string;
|
67
|
+
wordBreak: string;
|
68
|
+
};
|
69
|
+
};
|
70
|
+
fontFamily: string;
|
71
|
+
lineHeight: string;
|
72
|
+
};
|
73
|
+
'&.has-no-copy-button': {
|
74
|
+
pre: {
|
75
|
+
p: string;
|
76
|
+
};
|
77
|
+
};
|
78
|
+
'&.has-line-numbers': {
|
79
|
+
pre: {
|
80
|
+
p: string;
|
81
|
+
overflow: string;
|
82
|
+
'& .token-line:first-of-type *': {
|
83
|
+
pt: string;
|
84
|
+
};
|
85
|
+
'& .token-line': {
|
86
|
+
display: string;
|
87
|
+
'& .token': {
|
88
|
+
whiteSpace: string;
|
89
|
+
};
|
90
|
+
};
|
91
|
+
};
|
92
|
+
};
|
93
|
+
};
|
94
|
+
lineNo: {
|
95
|
+
display: string;
|
96
|
+
userSelect: string;
|
97
|
+
px: string;
|
98
|
+
m: string;
|
99
|
+
bg: string;
|
100
|
+
minWidth: number;
|
101
|
+
color: string;
|
102
|
+
lineHeight: string;
|
103
|
+
};
|
104
|
+
};
|
105
|
+
export default _default;
|