@pingux/astro 2.78.0-alpha.1 → 2.78.0-alpha.3
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/Icon/Icon.js +1 -1
- package/lib/cjs/components/Messages/Messages.stories.d.ts +27 -6
- package/lib/cjs/components/Messages/Messages.stories.js +61 -33
- package/lib/cjs/components/Stepper/Stepper.js +6 -3
- package/lib/cjs/components/Stepper/Stepper.stories.js +41 -1
- package/lib/cjs/components/Tab/Tab.js +3 -5
- package/lib/cjs/hooks/useField/useField.d.ts +4 -0
- package/lib/cjs/types/box.d.ts +6 -0
- package/lib/cjs/types/tab.d.ts +2 -0
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +2 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +3 -1
- package/lib/components/Icon/Icon.js +1 -1
- package/lib/components/Messages/Messages.stories.js +59 -32
- package/lib/components/Stepper/Stepper.js +6 -3
- package/lib/components/Stepper/Stepper.stories.js +39 -0
- package/lib/components/Tab/Tab.js +3 -5
- package/lib/utils/designUtils/figmaLinks.js +3 -1
- package/package.json +1 -1
@@ -34,7 +34,7 @@ var Icon = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
34
34
|
sizeProps = _useTShirtSize.sizeProps;
|
35
35
|
var title = props.title || ((0, _typeof2["default"])(IconComponent) === 'object' && 'type' in IconComponent ? {
|
36
36
|
name: IconComponent.type.name
|
37
|
-
} :
|
37
|
+
} : '');
|
38
38
|
return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
39
39
|
as: IconComponent,
|
40
40
|
ref: ref,
|
@@ -74,8 +74,8 @@ export declare const ControlledWithButton: {
|
|
74
74
|
};
|
75
75
|
};
|
76
76
|
};
|
77
|
-
export declare const
|
78
|
-
(
|
77
|
+
export declare const UseReducer: {
|
78
|
+
(): React.JSX.Element;
|
79
79
|
parameters: {
|
80
80
|
a11y: {
|
81
81
|
config: {
|
@@ -87,7 +87,7 @@ export declare const WithCustomColorsAndIcons: {
|
|
87
87
|
};
|
88
88
|
};
|
89
89
|
};
|
90
|
-
export declare const
|
90
|
+
export declare const UseReducerWithMultipleContainers: {
|
91
91
|
(): React.JSX.Element;
|
92
92
|
parameters: {
|
93
93
|
a11y: {
|
@@ -100,9 +100,13 @@ export declare const UseReducer: {
|
|
100
100
|
};
|
101
101
|
};
|
102
102
|
};
|
103
|
-
export declare const
|
104
|
-
(): React.JSX.Element;
|
103
|
+
export declare const WithTextStyling: {
|
104
|
+
(args: any): React.JSX.Element;
|
105
105
|
parameters: {
|
106
|
+
design: {
|
107
|
+
type: string;
|
108
|
+
url: string;
|
109
|
+
};
|
106
110
|
a11y: {
|
107
111
|
config: {
|
108
112
|
rules: {
|
@@ -113,7 +117,24 @@ export declare const UseReducerWithMultipleContainers: {
|
|
113
117
|
};
|
114
118
|
};
|
115
119
|
};
|
116
|
-
export declare const
|
120
|
+
export declare const WithLink: {
|
121
|
+
(args: any): React.JSX.Element;
|
122
|
+
parameters: {
|
123
|
+
design: {
|
124
|
+
type: string;
|
125
|
+
url: string;
|
126
|
+
};
|
127
|
+
a11y: {
|
128
|
+
config: {
|
129
|
+
rules: {
|
130
|
+
id: string;
|
131
|
+
enabled: boolean;
|
132
|
+
}[];
|
133
|
+
};
|
134
|
+
};
|
135
|
+
};
|
136
|
+
};
|
137
|
+
export declare const Customization: {
|
117
138
|
(args: any): React.JSX.Element;
|
118
139
|
parameters: {
|
119
140
|
a11y: {
|
@@ -14,7 +14,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
14
14
|
_Object$defineProperty(exports, "__esModule", {
|
15
15
|
value: true
|
16
16
|
});
|
17
|
-
exports["default"] = exports.WithTextStyling = exports.
|
17
|
+
exports["default"] = exports.WithTextStyling = exports.WithLink = exports.UseReducerWithMultipleContainers = exports.UseReducer = exports.DefaultDynamic = exports.Default = exports.Customization = exports.ControlledWithButton = exports.Controlled = void 0;
|
18
18
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
19
19
|
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
20
20
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
@@ -66,7 +66,7 @@ var _default = {
|
|
66
66
|
}
|
67
67
|
};
|
68
68
|
exports["default"] = _default;
|
69
|
-
var loremText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
69
|
+
var loremText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
70
70
|
var messages = [{
|
71
71
|
key: 'message1',
|
72
72
|
text: loremText
|
@@ -86,11 +86,19 @@ var messages = [{
|
|
86
86
|
var Default = function Default(args) {
|
87
87
|
return (0, _react2.jsx)(_index.Messages, args, (0, _react2.jsx)(_reactStately.Item, {
|
88
88
|
key: "message1",
|
89
|
-
"data-id": "message1"
|
89
|
+
"data-id": "message1",
|
90
|
+
status: _statuses["default"].SUCCESS
|
90
91
|
}, loremText), (0, _react2.jsx)(_reactStately.Item, {
|
91
92
|
key: "message2",
|
92
93
|
"data-id": "message2",
|
93
|
-
status: _statuses["default"].
|
94
|
+
status: _statuses["default"].WARNING
|
95
|
+
}, loremText), (0, _react2.jsx)(_reactStately.Item, {
|
96
|
+
key: "message2",
|
97
|
+
"data-id": "message3",
|
98
|
+
status: _statuses["default"].ERROR
|
99
|
+
}, loremText), (0, _react2.jsx)(_reactStately.Item, {
|
100
|
+
key: "message2",
|
101
|
+
"data-id": "message4"
|
94
102
|
}, loremText));
|
95
103
|
};
|
96
104
|
exports.Default = Default;
|
@@ -207,26 +215,6 @@ ControlledWithButton.parameters = {
|
|
207
215
|
}
|
208
216
|
}
|
209
217
|
};
|
210
|
-
var WithCustomColorsAndIcons = function WithCustomColorsAndIcons(args) {
|
211
|
-
return (0, _react2.jsx)(_index.Messages, args, (0, _react2.jsx)(_reactStately.Item, {
|
212
|
-
bg: "accent.99",
|
213
|
-
color: "active",
|
214
|
-
icon: _AccountIcon["default"]
|
215
|
-
}, loremText));
|
216
|
-
};
|
217
|
-
|
218
|
-
// Added to bypass color contrast in safari
|
219
|
-
exports.WithCustomColorsAndIcons = WithCustomColorsAndIcons;
|
220
|
-
WithCustomColorsAndIcons.parameters = {
|
221
|
-
a11y: {
|
222
|
-
config: {
|
223
|
-
rules: [{
|
224
|
-
id: 'color-contrast',
|
225
|
-
enabled: false
|
226
|
-
}]
|
227
|
-
}
|
228
|
-
}
|
229
|
-
};
|
230
218
|
var UseReducer = function UseReducer() {
|
231
219
|
// import { messagesReducer as messagesReducerCore } from '@pingux/astro';
|
232
220
|
// const messagesReducer = messagesReducerCore;
|
@@ -352,15 +340,7 @@ var WithTextStyling = function WithTextStyling(args) {
|
|
352
340
|
node: (0, _react2.jsx)("strong", null, loremText)
|
353
341
|
}, {
|
354
342
|
key: 'message2',
|
355
|
-
|
356
|
-
status: 'success'
|
357
|
-
}, {
|
358
|
-
key: 'message3',
|
359
|
-
text: loremText,
|
360
|
-
status: 'warning'
|
361
|
-
}, {
|
362
|
-
key: 'message4',
|
363
|
-
node: (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)("b", null, "Lorem Ipsum! "), loremText),
|
343
|
+
node: (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)("b", null, "Lorem Ipsum! "), "dolor sit amet, consectetur adipiscing elit"),
|
364
344
|
status: 'error'
|
365
345
|
}];
|
366
346
|
return (0, _react2.jsx)(_index.Messages, (0, _extends2["default"])({}, args, {
|
@@ -373,6 +353,54 @@ var WithTextStyling = function WithTextStyling(args) {
|
|
373
353
|
// Added to bypass color contrast in safari
|
374
354
|
exports.WithTextStyling = WithTextStyling;
|
375
355
|
WithTextStyling.parameters = {
|
356
|
+
design: {
|
357
|
+
type: 'figma',
|
358
|
+
url: _figmaLinks.FIGMA_LINKS.messages.withTextStyling
|
359
|
+
},
|
360
|
+
a11y: {
|
361
|
+
config: {
|
362
|
+
rules: [{
|
363
|
+
id: 'color-contrast',
|
364
|
+
enabled: false
|
365
|
+
}]
|
366
|
+
}
|
367
|
+
}
|
368
|
+
};
|
369
|
+
var WithLink = function WithLink(args) {
|
370
|
+
return (0, _react2.jsx)(_index.Messages, args, (0, _react2.jsx)(_reactStately.Item, {
|
371
|
+
key: "message1"
|
372
|
+
}, loremText, ' ', (0, _react2.jsx)(_index.Link, {
|
373
|
+
href: "https://lorem.ipsum"
|
374
|
+
}, "Learn More")));
|
375
|
+
};
|
376
|
+
|
377
|
+
// Added to bypass color contrast in safari
|
378
|
+
exports.WithLink = WithLink;
|
379
|
+
WithLink.parameters = {
|
380
|
+
design: {
|
381
|
+
type: 'figma',
|
382
|
+
url: _figmaLinks.FIGMA_LINKS.messages.withLink
|
383
|
+
},
|
384
|
+
a11y: {
|
385
|
+
config: {
|
386
|
+
rules: [{
|
387
|
+
id: 'color-contrast',
|
388
|
+
enabled: false
|
389
|
+
}]
|
390
|
+
}
|
391
|
+
}
|
392
|
+
};
|
393
|
+
var Customization = function Customization(args) {
|
394
|
+
return (0, _react2.jsx)(_index.Messages, args, (0, _react2.jsx)(_reactStately.Item, {
|
395
|
+
bg: "accent.99",
|
396
|
+
color: "active",
|
397
|
+
icon: _AccountIcon["default"]
|
398
|
+
}, loremText));
|
399
|
+
};
|
400
|
+
|
401
|
+
// Added to bypass color contrast in safari
|
402
|
+
exports.Customization = Customization;
|
403
|
+
Customization.parameters = {
|
376
404
|
a11y: {
|
377
405
|
config: {
|
378
406
|
rules: [{
|
@@ -29,7 +29,7 @@ var _isValidPositiveInt = _interopRequireDefault(require("../../utils/devUtils/p
|
|
29
29
|
var _Line = _interopRequireDefault(require("./Line"));
|
30
30
|
var _Stepper = require("./Stepper.constants");
|
31
31
|
var _react2 = require("@emotion/react");
|
32
|
-
var _excluded = ["activeStep", "onStepChange", "tabListProps"];
|
32
|
+
var _excluded = ["activeStep", "onStepChange", "tabListProps", "tooltipProps"];
|
33
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); }
|
34
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; }
|
35
35
|
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; }
|
@@ -41,6 +41,7 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
41
41
|
var activeStep = props.activeStep,
|
42
42
|
onStepChange = props.onStepChange,
|
43
43
|
tabListProps = props.tabListProps,
|
44
|
+
tooltipProps = props.tooltipProps,
|
44
45
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
45
46
|
var state = (0, _list.useSingleSelectListState)(props);
|
46
47
|
var getStatus = function getStatus(i) {
|
@@ -88,7 +89,8 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
88
89
|
title: step,
|
89
90
|
"aria-label": textValue,
|
90
91
|
content: item.rendered,
|
91
|
-
separator: !isFirst && line
|
92
|
+
separator: !isFirst && line,
|
93
|
+
tooltipTriggerProps: tooltipProps
|
92
94
|
});
|
93
95
|
isFirst = isFirst && !container;
|
94
96
|
return container;
|
@@ -124,7 +126,8 @@ Stepper.propTypes = {
|
|
124
126
|
*/
|
125
127
|
onStepChange: _propTypes["default"].func,
|
126
128
|
/** A props object that is subsequently spread into the rendered tablist. */
|
127
|
-
tabListProps: _propTypes["default"].shape({})
|
129
|
+
tabListProps: _propTypes["default"].shape({}),
|
130
|
+
tooltipProps: _propTypes["default"].shape({})
|
128
131
|
};
|
129
132
|
Stepper.defaultProps = {
|
130
133
|
activeStep: 1
|
@@ -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.Panel = exports.DisabledToolTips = exports.Default = exports.ControlledStepper = void 0;
|
11
|
+
exports["default"] = exports.WithCustomTooltip = exports.Panel = exports.DisabledToolTips = exports.Default = exports.ControlledStepper = void 0;
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
@@ -180,6 +180,46 @@ Default.parameters = {
|
|
180
180
|
url: _figmaLinks.FIGMA_LINKS.stepper["default"]
|
181
181
|
}
|
182
182
|
};
|
183
|
+
var WithCustomTooltip = function WithCustomTooltip(args) {
|
184
|
+
return (0, _react2.jsx)(_index.Stepper, (0, _extends2["default"])({}, args, {
|
185
|
+
items: steps,
|
186
|
+
tooltipProps: {
|
187
|
+
direction: 'left',
|
188
|
+
offset: 15
|
189
|
+
}
|
190
|
+
}), (0, _react2.jsx)(_reactStately.Item, {
|
191
|
+
key: "step1",
|
192
|
+
textValue: "Duis Aute"
|
193
|
+
}, (0, _react2.jsx)(_index.Box, {
|
194
|
+
sx: sx.contentContainer
|
195
|
+
}, (0, _react2.jsx)(_index.Text, {
|
196
|
+
fontSize: "md",
|
197
|
+
fontWeight: "3"
|
198
|
+
}, "Duis Aute"), (0, _react2.jsx)(_index.Text, {
|
199
|
+
fontSize: "md"
|
200
|
+
}, "Quis autem vel eum iure reprehenderit qui in ea voluptate"))), (0, _react2.jsx)(_reactStately.Item, {
|
201
|
+
key: "step2",
|
202
|
+
textValue: "Lorem Ipsum"
|
203
|
+
}, (0, _react2.jsx)(_index.Box, {
|
204
|
+
sx: sx.contentContainer
|
205
|
+
}, (0, _react2.jsx)(_index.Text, {
|
206
|
+
fontSize: "md",
|
207
|
+
fontWeight: "3"
|
208
|
+
}, "Lorem Ipsum"), (0, _react2.jsx)(_index.Text, {
|
209
|
+
fontSize: "md"
|
210
|
+
}, "Sed ut perspiciatis unde omnis"))), (0, _react2.jsx)(_reactStately.Item, {
|
211
|
+
key: "step3",
|
212
|
+
textValue: "Excepteur Sint"
|
213
|
+
}, (0, _react2.jsx)(_index.Box, {
|
214
|
+
sx: sx.contentContainer
|
215
|
+
}, (0, _react2.jsx)(_index.Text, {
|
216
|
+
fontSize: "md",
|
217
|
+
fontWeight: "3"
|
218
|
+
}, "Excepteur Sint"), (0, _react2.jsx)(_index.Text, {
|
219
|
+
fontSize: "md"
|
220
|
+
}, "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam"))));
|
221
|
+
};
|
222
|
+
exports.WithCustomTooltip = WithCustomTooltip;
|
183
223
|
var ControlledStepper = function ControlledStepper() {
|
184
224
|
var _useState = (0, _react.useState)(2),
|
185
225
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -34,8 +34,7 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
34
34
|
tabsDisabled = props.isDisabled,
|
35
35
|
orientation = props.orientation,
|
36
36
|
mode = props.mode,
|
37
|
-
slots = props.slots
|
38
|
-
tooltipTriggerProps = props.tooltipTriggerProps;
|
37
|
+
slots = props.slots;
|
39
38
|
var key = item.key,
|
40
39
|
rendered = item.rendered,
|
41
40
|
itemProps = item.props;
|
@@ -69,11 +68,10 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
69
68
|
}, slots === null || slots === void 0 ? void 0 : slots.beforeTab, (0, _react2.jsx)(_.Box, (0, _extends2["default"])({
|
70
69
|
className: classNames,
|
71
70
|
variant: "tab"
|
72
|
-
// title={itemProps?.titleAttr || undefined}
|
73
71
|
}, (0, _reactAria.mergeProps)(focusProps, hoverProps, tabProps), (0, _pendoID.getPendoID)('Tab'), {
|
74
|
-
// {...otherItemProps}
|
75
72
|
ref: tabRef
|
76
73
|
}, itemProps, {
|
74
|
+
title: itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue,
|
77
75
|
role: "tab"
|
78
76
|
}), (0, _react2.jsx)(_react["default"].Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.icon, (0, _react2.jsx)(_.Text, (0, _extends2["default"])({
|
79
77
|
variant: "tabLabel"
|
@@ -88,7 +86,7 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
88
86
|
}, (0, _reactAria.mergeProps)(focusProps, hoverProps, tabProps), itemProps));
|
89
87
|
}
|
90
88
|
if (mode === 'tooltip') {
|
91
|
-
return (0, _react2.jsx)(_react["default"].Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, (0, _react2.jsx)(_.TooltipTrigger, (0, _extends2["default"])({}, tooltipTriggerProps, {
|
89
|
+
return (0, _react2.jsx)(_react["default"].Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, (0, _react2.jsx)(_.TooltipTrigger, (0, _extends2["default"])({}, itemProps === null || itemProps === void 0 ? void 0 : itemProps.tooltipTriggerProps, {
|
92
90
|
isOpen: isHovered || isFocusVisible
|
93
91
|
}), (0, _react2.jsx)(_interactions.Pressable, null, (0, _react2.jsx)("span", null, tab)), (0, _react2.jsx)(_.Tooltip, null, (itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue) || (itemProps === null || itemProps === void 0 ? void 0 : itemProps.title))));
|
94
92
|
}
|
@@ -142,6 +142,10 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
142
142
|
isSelected?: boolean | undefined;
|
143
143
|
isUnavailable?: boolean | undefined;
|
144
144
|
hidden?: boolean | undefined;
|
145
|
+
title?: string | {
|
146
|
+
id?: string | undefined;
|
147
|
+
name: string;
|
148
|
+
} | undefined;
|
145
149
|
variant?: string | undefined;
|
146
150
|
as?: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | React.ComponentClass<any, any> | React.FunctionComponent<any> | null | undefined;
|
147
151
|
style?: string | React.CSSProperties | undefined;
|
package/lib/cjs/types/box.d.ts
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
import { StylePropertyValue } from 'theme-ui';
|
2
2
|
import { DOMAttributes, StyleProps } from './shared';
|
3
|
+
type BoxIconTitleProps = {
|
4
|
+
id?: string;
|
5
|
+
name: string;
|
6
|
+
};
|
3
7
|
export interface BoxProps extends StyleProps, DOMAttributes {
|
4
8
|
id?: string;
|
5
9
|
/** The background color of the box. */
|
@@ -14,4 +18,6 @@ export interface BoxProps extends StyleProps, DOMAttributes {
|
|
14
18
|
isSelected?: boolean;
|
15
19
|
isUnavailable?: boolean;
|
16
20
|
hidden?: boolean;
|
21
|
+
title?: string | BoxIconTitleProps;
|
17
22
|
}
|
23
|
+
export {};
|
package/lib/cjs/types/tab.d.ts
CHANGED
@@ -2,6 +2,7 @@ import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { ThemeUICSSProperties } from 'theme-ui';
|
3
3
|
import { TestingAttributes } from './shared/test';
|
4
4
|
import { DOMAttributes, OrientationProps, StyleProps } from './shared';
|
5
|
+
import { TooltipTriggerProps } from './tooltipTrigger';
|
5
6
|
export interface TabProps extends StyleProps, DOMAttributes, OrientationProps, TestingAttributes {
|
6
7
|
isDisabled?: boolean;
|
7
8
|
item: {
|
@@ -17,6 +18,7 @@ export interface TabProps extends StyleProps, DOMAttributes, OrientationProps, T
|
|
17
18
|
title: string;
|
18
19
|
separator: Element | boolean;
|
19
20
|
list: object[];
|
21
|
+
tooltipTriggerProps?: TooltipTriggerProps;
|
20
22
|
};
|
21
23
|
rendered?: string | ReactNode;
|
22
24
|
};
|
@@ -121,7 +121,9 @@ var FIGMA_LINKS = {
|
|
121
121
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=12726-41720&t=8Wwd3tIBh3GEjCJB-0'
|
122
122
|
},
|
123
123
|
messages: {
|
124
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
124
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=52857-6582&t=hqi8rId3S2ABv1E0-4',
|
125
|
+
withTextStyling: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=52857-9032&t=LVprZy9fVRpCA9Jd-4',
|
126
|
+
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=52857-9074&t=LVprZy9fVRpCA9Jd-4'
|
125
127
|
},
|
126
128
|
modal: {
|
127
129
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=7513-27244&t=8Wwd3tIBh3GEjCJB-0'
|
@@ -23,7 +23,7 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
23
23
|
sizeProps = _useTShirtSize.sizeProps;
|
24
24
|
var title = props.title || (_typeof(IconComponent) === 'object' && 'type' in IconComponent ? {
|
25
25
|
name: IconComponent.type.name
|
26
|
-
} :
|
26
|
+
} : '');
|
27
27
|
return ___EmotionJSX(Box, _extends({
|
28
28
|
as: IconComponent,
|
29
29
|
ref: ref,
|
@@ -20,7 +20,7 @@ import { Item } from 'react-stately';
|
|
20
20
|
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
21
21
|
import { withDesign } from 'storybook-addon-designs';
|
22
22
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
23
|
-
import { Box, Button, Messages } from '../../index';
|
23
|
+
import { Box, Button, Link, Messages } from '../../index';
|
24
24
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
25
25
|
import statuses from '../../utils/devUtils/constants/statuses';
|
26
26
|
import { messagesReducerStory as messagesReducer, multiMessagesReducerStory as multiMessagesReducer } from './index';
|
@@ -53,7 +53,7 @@ export default {
|
|
53
53
|
}
|
54
54
|
}
|
55
55
|
};
|
56
|
-
var loremText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
56
|
+
var loremText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
57
57
|
var messages = [{
|
58
58
|
key: 'message1',
|
59
59
|
text: loremText
|
@@ -73,11 +73,19 @@ var messages = [{
|
|
73
73
|
export var Default = function Default(args) {
|
74
74
|
return ___EmotionJSX(Messages, args, ___EmotionJSX(Item, {
|
75
75
|
key: "message1",
|
76
|
-
"data-id": "message1"
|
76
|
+
"data-id": "message1",
|
77
|
+
status: statuses.SUCCESS
|
77
78
|
}, loremText), ___EmotionJSX(Item, {
|
78
79
|
key: "message2",
|
79
80
|
"data-id": "message2",
|
80
|
-
status: statuses.
|
81
|
+
status: statuses.WARNING
|
82
|
+
}, loremText), ___EmotionJSX(Item, {
|
83
|
+
key: "message2",
|
84
|
+
"data-id": "message3",
|
85
|
+
status: statuses.ERROR
|
86
|
+
}, loremText), ___EmotionJSX(Item, {
|
87
|
+
key: "message2",
|
88
|
+
"data-id": "message4"
|
81
89
|
}, loremText));
|
82
90
|
};
|
83
91
|
Default.parameters = {
|
@@ -190,25 +198,6 @@ ControlledWithButton.parameters = {
|
|
190
198
|
}
|
191
199
|
}
|
192
200
|
};
|
193
|
-
export var WithCustomColorsAndIcons = function WithCustomColorsAndIcons(args) {
|
194
|
-
return ___EmotionJSX(Messages, args, ___EmotionJSX(Item, {
|
195
|
-
bg: "accent.99",
|
196
|
-
color: "active",
|
197
|
-
icon: AccountIcon
|
198
|
-
}, loremText));
|
199
|
-
};
|
200
|
-
|
201
|
-
// Added to bypass color contrast in safari
|
202
|
-
WithCustomColorsAndIcons.parameters = {
|
203
|
-
a11y: {
|
204
|
-
config: {
|
205
|
-
rules: [{
|
206
|
-
id: 'color-contrast',
|
207
|
-
enabled: false
|
208
|
-
}]
|
209
|
-
}
|
210
|
-
}
|
211
|
-
};
|
212
201
|
export var UseReducer = function UseReducer() {
|
213
202
|
// import { messagesReducer as messagesReducerCore } from '@pingux/astro';
|
214
203
|
// const messagesReducer = messagesReducerCore;
|
@@ -332,15 +321,7 @@ export var WithTextStyling = function WithTextStyling(args) {
|
|
332
321
|
node: ___EmotionJSX("strong", null, loremText)
|
333
322
|
}, {
|
334
323
|
key: 'message2',
|
335
|
-
|
336
|
-
status: 'success'
|
337
|
-
}, {
|
338
|
-
key: 'message3',
|
339
|
-
text: loremText,
|
340
|
-
status: 'warning'
|
341
|
-
}, {
|
342
|
-
key: 'message4',
|
343
|
-
node: ___EmotionJSX(React.Fragment, null, ___EmotionJSX("b", null, "Lorem Ipsum! "), loremText),
|
324
|
+
node: ___EmotionJSX(React.Fragment, null, ___EmotionJSX("b", null, "Lorem Ipsum! "), "dolor sit amet, consectetur adipiscing elit"),
|
344
325
|
status: 'error'
|
345
326
|
}];
|
346
327
|
return ___EmotionJSX(Messages, _extends({}, args, {
|
@@ -352,6 +333,52 @@ export var WithTextStyling = function WithTextStyling(args) {
|
|
352
333
|
|
353
334
|
// Added to bypass color contrast in safari
|
354
335
|
WithTextStyling.parameters = {
|
336
|
+
design: {
|
337
|
+
type: 'figma',
|
338
|
+
url: FIGMA_LINKS.messages.withTextStyling
|
339
|
+
},
|
340
|
+
a11y: {
|
341
|
+
config: {
|
342
|
+
rules: [{
|
343
|
+
id: 'color-contrast',
|
344
|
+
enabled: false
|
345
|
+
}]
|
346
|
+
}
|
347
|
+
}
|
348
|
+
};
|
349
|
+
export var WithLink = function WithLink(args) {
|
350
|
+
return ___EmotionJSX(Messages, args, ___EmotionJSX(Item, {
|
351
|
+
key: "message1"
|
352
|
+
}, loremText, ' ', ___EmotionJSX(Link, {
|
353
|
+
href: "https://lorem.ipsum"
|
354
|
+
}, "Learn More")));
|
355
|
+
};
|
356
|
+
|
357
|
+
// Added to bypass color contrast in safari
|
358
|
+
WithLink.parameters = {
|
359
|
+
design: {
|
360
|
+
type: 'figma',
|
361
|
+
url: FIGMA_LINKS.messages.withLink
|
362
|
+
},
|
363
|
+
a11y: {
|
364
|
+
config: {
|
365
|
+
rules: [{
|
366
|
+
id: 'color-contrast',
|
367
|
+
enabled: false
|
368
|
+
}]
|
369
|
+
}
|
370
|
+
}
|
371
|
+
};
|
372
|
+
export var Customization = function Customization(args) {
|
373
|
+
return ___EmotionJSX(Messages, args, ___EmotionJSX(Item, {
|
374
|
+
bg: "accent.99",
|
375
|
+
color: "active",
|
376
|
+
icon: AccountIcon
|
377
|
+
}, loremText));
|
378
|
+
};
|
379
|
+
|
380
|
+
// Added to bypass color contrast in safari
|
381
|
+
Customization.parameters = {
|
355
382
|
a11y: {
|
356
383
|
config: {
|
357
384
|
rules: [{
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
4
|
-
var _excluded = ["activeStep", "onStepChange", "tabListProps"];
|
4
|
+
var _excluded = ["activeStep", "onStepChange", "tabListProps", "tooltipProps"];
|
5
5
|
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; }
|
6
6
|
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; }
|
7
7
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
@@ -30,6 +30,7 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
30
|
var activeStep = props.activeStep,
|
31
31
|
onStepChange = props.onStepChange,
|
32
32
|
tabListProps = props.tabListProps,
|
33
|
+
tooltipProps = props.tooltipProps,
|
33
34
|
others = _objectWithoutProperties(props, _excluded);
|
34
35
|
var state = useSingleSelectListState(props);
|
35
36
|
var getStatus = function getStatus(i) {
|
@@ -77,7 +78,8 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
77
78
|
title: step,
|
78
79
|
"aria-label": textValue,
|
79
80
|
content: item.rendered,
|
80
|
-
separator: !isFirst && line
|
81
|
+
separator: !isFirst && line,
|
82
|
+
tooltipTriggerProps: tooltipProps
|
81
83
|
});
|
82
84
|
isFirst = isFirst && !container;
|
83
85
|
return container;
|
@@ -113,7 +115,8 @@ Stepper.propTypes = {
|
|
113
115
|
*/
|
114
116
|
onStepChange: PropTypes.func,
|
115
117
|
/** A props object that is subsequently spread into the rendered tablist. */
|
116
|
-
tabListProps: PropTypes.shape({})
|
118
|
+
tabListProps: PropTypes.shape({}),
|
119
|
+
tooltipProps: PropTypes.shape({})
|
117
120
|
};
|
118
121
|
Stepper.defaultProps = {
|
119
122
|
activeStep: 1
|
@@ -164,6 +164,45 @@ Default.parameters = {
|
|
164
164
|
url: FIGMA_LINKS.stepper["default"]
|
165
165
|
}
|
166
166
|
};
|
167
|
+
export var WithCustomTooltip = function WithCustomTooltip(args) {
|
168
|
+
return ___EmotionJSX(Stepper, _extends({}, args, {
|
169
|
+
items: steps,
|
170
|
+
tooltipProps: {
|
171
|
+
direction: 'left',
|
172
|
+
offset: 15
|
173
|
+
}
|
174
|
+
}), ___EmotionJSX(Item, {
|
175
|
+
key: "step1",
|
176
|
+
textValue: "Duis Aute"
|
177
|
+
}, ___EmotionJSX(Box, {
|
178
|
+
sx: sx.contentContainer
|
179
|
+
}, ___EmotionJSX(Text, {
|
180
|
+
fontSize: "md",
|
181
|
+
fontWeight: "3"
|
182
|
+
}, "Duis Aute"), ___EmotionJSX(Text, {
|
183
|
+
fontSize: "md"
|
184
|
+
}, "Quis autem vel eum iure reprehenderit qui in ea voluptate"))), ___EmotionJSX(Item, {
|
185
|
+
key: "step2",
|
186
|
+
textValue: "Lorem Ipsum"
|
187
|
+
}, ___EmotionJSX(Box, {
|
188
|
+
sx: sx.contentContainer
|
189
|
+
}, ___EmotionJSX(Text, {
|
190
|
+
fontSize: "md",
|
191
|
+
fontWeight: "3"
|
192
|
+
}, "Lorem Ipsum"), ___EmotionJSX(Text, {
|
193
|
+
fontSize: "md"
|
194
|
+
}, "Sed ut perspiciatis unde omnis"))), ___EmotionJSX(Item, {
|
195
|
+
key: "step3",
|
196
|
+
textValue: "Excepteur Sint"
|
197
|
+
}, ___EmotionJSX(Box, {
|
198
|
+
sx: sx.contentContainer
|
199
|
+
}, ___EmotionJSX(Text, {
|
200
|
+
fontSize: "md",
|
201
|
+
fontWeight: "3"
|
202
|
+
}, "Excepteur Sint"), ___EmotionJSX(Text, {
|
203
|
+
fontSize: "md"
|
204
|
+
}, "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam"))));
|
205
|
+
};
|
167
206
|
export var ControlledStepper = function ControlledStepper() {
|
168
207
|
var _useState = useState(2),
|
169
208
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -21,8 +21,7 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
21
|
tabsDisabled = props.isDisabled,
|
22
22
|
orientation = props.orientation,
|
23
23
|
mode = props.mode,
|
24
|
-
slots = props.slots
|
25
|
-
tooltipTriggerProps = props.tooltipTriggerProps;
|
24
|
+
slots = props.slots;
|
26
25
|
var key = item.key,
|
27
26
|
rendered = item.rendered,
|
28
27
|
itemProps = item.props;
|
@@ -56,11 +55,10 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
56
55
|
}, slots === null || slots === void 0 ? void 0 : slots.beforeTab, ___EmotionJSX(Box, _extends({
|
57
56
|
className: classNames,
|
58
57
|
variant: "tab"
|
59
|
-
// title={itemProps?.titleAttr || undefined}
|
60
58
|
}, mergeProps(focusProps, hoverProps, tabProps), getPendoID('Tab'), {
|
61
|
-
// {...otherItemProps}
|
62
59
|
ref: tabRef
|
63
60
|
}, itemProps, {
|
61
|
+
title: itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue,
|
64
62
|
role: "tab"
|
65
63
|
}), ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.icon, ___EmotionJSX(Text, _extends({
|
66
64
|
variant: "tabLabel"
|
@@ -75,7 +73,7 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
75
73
|
}, mergeProps(focusProps, hoverProps, tabProps), itemProps));
|
76
74
|
}
|
77
75
|
if (mode === 'tooltip') {
|
78
|
-
return ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, ___EmotionJSX(TooltipTrigger, _extends({}, tooltipTriggerProps, {
|
76
|
+
return ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.separator, ___EmotionJSX(TooltipTrigger, _extends({}, itemProps === null || itemProps === void 0 ? void 0 : itemProps.tooltipTriggerProps, {
|
79
77
|
isOpen: isHovered || isFocusVisible
|
80
78
|
}), ___EmotionJSX(Pressable, null, ___EmotionJSX("span", null, tab)), ___EmotionJSX(Tooltip, null, (itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue) || (itemProps === null || itemProps === void 0 ? void 0 : itemProps.title))));
|
81
79
|
}
|
@@ -114,7 +114,9 @@ export var FIGMA_LINKS = {
|
|
114
114
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=12726-41720&t=8Wwd3tIBh3GEjCJB-0'
|
115
115
|
},
|
116
116
|
messages: {
|
117
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
117
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=52857-6582&t=hqi8rId3S2ABv1E0-4',
|
118
|
+
withTextStyling: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=52857-9032&t=LVprZy9fVRpCA9Jd-4',
|
119
|
+
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=52857-9074&t=LVprZy9fVRpCA9Jd-4'
|
118
120
|
},
|
119
121
|
modal: {
|
120
122
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=7513-27244&t=8Wwd3tIBh3GEjCJB-0'
|