@zendeskgarden/react-accordions 8.49.2 → 8.50.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.
- package/dist/index.cjs.js +207 -193
- package/dist/index.esm.js +206 -192
- package/dist/typings/elements/accordion/Accordion.d.ts +2 -25
- package/dist/typings/elements/stepper/Stepper.d.ts +2 -7
- package/dist/typings/elements/stepper/components/Label.d.ts +2 -7
- package/dist/typings/elements/timeline/Timeline.d.ts +2 -5
- package/dist/typings/elements/timeline/components/Item.d.ts +2 -7
- package/dist/typings/index.d.ts +4 -6
- package/dist/typings/styled/accordion/StyledButton.d.ts +2 -1
- package/dist/typings/styled/accordion/StyledHeader.d.ts +2 -1
- package/dist/typings/styled/accordion/StyledInnerPanel.d.ts +2 -1
- package/dist/typings/styled/accordion/StyledPanel.d.ts +2 -1
- package/dist/typings/styled/accordion/StyledRotateIcon.d.ts +2 -1
- package/dist/typings/styled/stepper/StyledInnerContent.d.ts +2 -1
- package/dist/typings/styled/stepper/StyledStep.d.ts +2 -1
- package/dist/typings/styled/stepper/StyledStepper.d.ts +2 -1
- package/dist/typings/types/index.d.ts +55 -0
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
|
12
12
|
var React = require('react');
|
|
13
|
+
var containerAccordion = require('@zendeskgarden/container-accordion');
|
|
13
14
|
var styled = require('styled-components');
|
|
14
15
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
15
16
|
var polished = require('polished');
|
|
16
|
-
var PropTypes = require('prop-types');
|
|
17
|
-
var mergeRefs = require('react-merge-refs');
|
|
18
|
-
var debounce = require('lodash.debounce');
|
|
19
|
-
var containerAccordion = require('@zendeskgarden/container-accordion');
|
|
20
17
|
var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
18
|
+
var debounce = require('lodash.debounce');
|
|
19
|
+
var mergeRefs = require('react-merge-refs');
|
|
20
|
+
var PropTypes = require('prop-types');
|
|
21
21
|
|
|
22
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
23
|
|
|
@@ -42,9 +42,9 @@ function _interopNamespace(e) {
|
|
|
42
42
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
43
43
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
44
44
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
45
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
46
|
-
var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
|
|
47
45
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
46
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
|
|
47
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
48
48
|
|
|
49
49
|
function ownKeys(object, enumerableOnly) {
|
|
50
50
|
var keys = Object.keys(object);
|
|
@@ -215,7 +215,7 @@ var sizeStyles$1 = function sizeStyles(props) {
|
|
|
215
215
|
};
|
|
216
216
|
var StyledContent = styled__default["default"].div.attrs({
|
|
217
217
|
'data-garden-id': COMPONENT_ID$k,
|
|
218
|
-
'data-garden-version': '8.
|
|
218
|
+
'data-garden-version': '8.50.0'
|
|
219
219
|
}).withConfig({
|
|
220
220
|
displayName: "StyledContent",
|
|
221
221
|
componentId: "sc-mazvvo-0"
|
|
@@ -231,7 +231,7 @@ StyledContent.defaultProps = {
|
|
|
231
231
|
var COMPONENT_ID$j = 'accordions.step_line';
|
|
232
232
|
var StyledLine = styled__default["default"].div.attrs({
|
|
233
233
|
'data-garden-id': COMPONENT_ID$j,
|
|
234
|
-
'data-garden-version': '8.
|
|
234
|
+
'data-garden-version': '8.50.0'
|
|
235
235
|
}).withConfig({
|
|
236
236
|
displayName: "StyledLine",
|
|
237
237
|
componentId: "sc-1gkpjbr-0"
|
|
@@ -253,7 +253,7 @@ StyledLine.defaultProps = {
|
|
|
253
253
|
var COMPONENT_ID$i = 'accordions.step';
|
|
254
254
|
var StyledStep = styled__default["default"].li.attrs({
|
|
255
255
|
'data-garden-id': COMPONENT_ID$i,
|
|
256
|
-
'data-garden-version': '8.
|
|
256
|
+
'data-garden-version': '8.50.0'
|
|
257
257
|
}).withConfig({
|
|
258
258
|
displayName: "StyledStep",
|
|
259
259
|
componentId: "sc-12fiwtz-0"
|
|
@@ -283,7 +283,7 @@ StyledStep.defaultProps = {
|
|
|
283
283
|
var COMPONENT_ID$h = 'accordions.step_inner_content';
|
|
284
284
|
var StyledInnerContent = styled__default["default"].div.attrs({
|
|
285
285
|
'data-garden-id': COMPONENT_ID$h,
|
|
286
|
-
'data-garden-version': '8.
|
|
286
|
+
'data-garden-version': '8.50.0'
|
|
287
287
|
}).withConfig({
|
|
288
288
|
displayName: "StyledInnerContent",
|
|
289
289
|
componentId: "sc-1xs9fh7-0"
|
|
@@ -305,7 +305,7 @@ StyledInnerContent.defaultProps = {
|
|
|
305
305
|
var COMPONENT_ID$g = 'accordions.stepper';
|
|
306
306
|
var StyledStepper = styled__default["default"].ol.attrs({
|
|
307
307
|
'data-garden-id': COMPONENT_ID$g,
|
|
308
|
-
'data-garden-version': '8.
|
|
308
|
+
'data-garden-version': '8.50.0'
|
|
309
309
|
}).withConfig({
|
|
310
310
|
displayName: "StyledStepper",
|
|
311
311
|
componentId: "sc-dsxw0f-0"
|
|
@@ -333,7 +333,7 @@ var colorStyles$2 = function colorStyles(props) {
|
|
|
333
333
|
};
|
|
334
334
|
var StyledIcon = styled__default["default"].div.attrs({
|
|
335
335
|
'data-garden-id': COMPONENT_ID$f,
|
|
336
|
-
'data-garden-version': '8.
|
|
336
|
+
'data-garden-version': '8.50.0'
|
|
337
337
|
}).withConfig({
|
|
338
338
|
displayName: "StyledIcon",
|
|
339
339
|
componentId: "sc-v20nz9-1"
|
|
@@ -350,7 +350,7 @@ StyledIcon.defaultProps = {
|
|
|
350
350
|
var COMPONENT_ID$e = 'accordions.step_label';
|
|
351
351
|
var StyledLabel = styled__default["default"].div.attrs({
|
|
352
352
|
'data-garden-id': COMPONENT_ID$e,
|
|
353
|
-
'data-garden-version': '8.
|
|
353
|
+
'data-garden-version': '8.50.0'
|
|
354
354
|
}).withConfig({
|
|
355
355
|
displayName: "StyledLabel",
|
|
356
356
|
componentId: "sc-1o82llj-0"
|
|
@@ -378,7 +378,7 @@ StyledLabel.defaultProps = {
|
|
|
378
378
|
var COMPONENT_ID$d = 'accordions.step_label_text';
|
|
379
379
|
var StyledLabelText = styled__default["default"].div.attrs({
|
|
380
380
|
'data-garden-id': COMPONENT_ID$d,
|
|
381
|
-
'data-garden-version': '8.
|
|
381
|
+
'data-garden-version': '8.50.0'
|
|
382
382
|
}).withConfig({
|
|
383
383
|
displayName: "StyledLabelText",
|
|
384
384
|
componentId: "sc-111m5zo-0"
|
|
@@ -396,7 +396,7 @@ StyledLabelText.defaultProps = {
|
|
|
396
396
|
var COMPONENT_ID$c = 'accordions.accordion';
|
|
397
397
|
var StyledAccordion = styled__default["default"].div.attrs({
|
|
398
398
|
'data-garden-id': COMPONENT_ID$c,
|
|
399
|
-
'data-garden-version': '8.
|
|
399
|
+
'data-garden-version': '8.50.0'
|
|
400
400
|
}).withConfig({
|
|
401
401
|
displayName: "StyledAccordion",
|
|
402
402
|
componentId: "sc-niv9ic-0"
|
|
@@ -426,7 +426,7 @@ var paddingStyles = function paddingStyles(props) {
|
|
|
426
426
|
};
|
|
427
427
|
var StyledPanel = styled__default["default"].section.attrs({
|
|
428
428
|
'data-garden-id': COMPONENT_ID$b,
|
|
429
|
-
'data-garden-version': '8.
|
|
429
|
+
'data-garden-version': '8.50.0'
|
|
430
430
|
}).withConfig({
|
|
431
431
|
displayName: "StyledPanel",
|
|
432
432
|
componentId: "sc-1piryze-0"
|
|
@@ -443,7 +443,7 @@ StyledPanel.defaultProps = {
|
|
|
443
443
|
var COMPONENT_ID$a = 'accordions.section';
|
|
444
444
|
var StyledSection = styled__default["default"].div.attrs({
|
|
445
445
|
'data-garden-id': COMPONENT_ID$a,
|
|
446
|
-
'data-garden-version': '8.
|
|
446
|
+
'data-garden-version': '8.50.0'
|
|
447
447
|
}).withConfig({
|
|
448
448
|
displayName: "StyledSection",
|
|
449
449
|
componentId: "sc-v2t9bd-0"
|
|
@@ -457,7 +457,7 @@ StyledSection.defaultProps = {
|
|
|
457
457
|
var COMPONENT_ID$9 = 'accordions.header';
|
|
458
458
|
var StyledHeader = styled__default["default"].div.attrs({
|
|
459
459
|
'data-garden-id': COMPONENT_ID$9,
|
|
460
|
-
'data-garden-version': '8.
|
|
460
|
+
'data-garden-version': '8.50.0'
|
|
461
461
|
}).withConfig({
|
|
462
462
|
displayName: "StyledHeader",
|
|
463
463
|
componentId: "sc-2c6rbr-0"
|
|
@@ -485,7 +485,7 @@ var colorStyles$1 = function colorStyles(props) {
|
|
|
485
485
|
};
|
|
486
486
|
var StyledButton = styled__default["default"].button.attrs({
|
|
487
487
|
'data-garden-id': COMPONENT_ID$8,
|
|
488
|
-
'data-garden-version': '8.
|
|
488
|
+
'data-garden-version': '8.50.0'
|
|
489
489
|
}).withConfig({
|
|
490
490
|
displayName: "StyledButton",
|
|
491
491
|
componentId: "sc-xj3hy7-0"
|
|
@@ -511,7 +511,7 @@ StyledButton.defaultProps = {
|
|
|
511
511
|
var COMPONENT_ID$7 = 'accordions.step_inner_panel';
|
|
512
512
|
var StyledInnerPanel = styled__default["default"].div.attrs({
|
|
513
513
|
'data-garden-id': COMPONENT_ID$7,
|
|
514
|
-
'data-garden-version': '8.
|
|
514
|
+
'data-garden-version': '8.50.0'
|
|
515
515
|
}).withConfig({
|
|
516
516
|
displayName: "StyledInnerPanel",
|
|
517
517
|
componentId: "sc-8nbueg-0"
|
|
@@ -531,7 +531,7 @@ StyledInnerPanel.defaultProps = {
|
|
|
531
531
|
theme: reactTheming.DEFAULT_THEME
|
|
532
532
|
};
|
|
533
533
|
|
|
534
|
-
var _excluded$
|
|
534
|
+
var _excluded$7 = ["children", "isRotated", "isHovered", "isCompact", "isCollapsible"];
|
|
535
535
|
var COMPONENT_ID$6 = 'accordions.rotate_icon';
|
|
536
536
|
var colorStyles = function colorStyles(props) {
|
|
537
537
|
var showColor = props.isCollapsible || !props.isRotated;
|
|
@@ -548,11 +548,11 @@ function (_ref) {
|
|
|
548
548
|
_ref.isHovered;
|
|
549
549
|
_ref.isCompact;
|
|
550
550
|
_ref.isCollapsible;
|
|
551
|
-
var props = _objectWithoutProperties(_ref, _excluded$
|
|
551
|
+
var props = _objectWithoutProperties(_ref, _excluded$7);
|
|
552
552
|
return React.cloneElement(React.Children.only(children), props);
|
|
553
553
|
}).attrs({
|
|
554
554
|
'data-garden-id': COMPONENT_ID$6,
|
|
555
|
-
'data-garden-version': '8.
|
|
555
|
+
'data-garden-version': '8.50.0'
|
|
556
556
|
}).withConfig({
|
|
557
557
|
displayName: "StyledRotateIcon",
|
|
558
558
|
componentId: "sc-hp435q-0"
|
|
@@ -574,7 +574,7 @@ StyledRotateIcon.defaultProps = {
|
|
|
574
574
|
var COMPONENT_ID$5 = 'timeline';
|
|
575
575
|
var StyledTimeline = styled__default["default"].ol.attrs({
|
|
576
576
|
'data-garden-id': COMPONENT_ID$5,
|
|
577
|
-
'data-garden-version': '8.
|
|
577
|
+
'data-garden-version': '8.50.0'
|
|
578
578
|
}).withConfig({
|
|
579
579
|
displayName: "StyledTimeline",
|
|
580
580
|
componentId: "sc-pig5kv-0"
|
|
@@ -588,7 +588,7 @@ StyledTimeline.defaultProps = {
|
|
|
588
588
|
var COMPONENT_ID$4 = 'timeline.content.separator';
|
|
589
589
|
var StyledSeparator = styled__default["default"].div.attrs({
|
|
590
590
|
'data-garden-id': COMPONENT_ID$4,
|
|
591
|
-
'data-garden-version': '8.
|
|
591
|
+
'data-garden-version': '8.50.0'
|
|
592
592
|
}).withConfig({
|
|
593
593
|
displayName: "StyledSeparator",
|
|
594
594
|
componentId: "sc-fki51e-0"
|
|
@@ -606,7 +606,7 @@ StyledSeparator.defaultProps = {
|
|
|
606
606
|
var COMPONENT_ID$3 = 'timeline.content';
|
|
607
607
|
var StyledTimelineContent = styled__default["default"].div.attrs({
|
|
608
608
|
'data-garden-id': COMPONENT_ID$3,
|
|
609
|
-
'data-garden-version': '8.
|
|
609
|
+
'data-garden-version': '8.50.0'
|
|
610
610
|
}).withConfig({
|
|
611
611
|
displayName: "StyledContent__StyledTimelineContent",
|
|
612
612
|
componentId: "sc-19phgu1-0"
|
|
@@ -622,7 +622,7 @@ StyledTimelineContent.defaultProps = {
|
|
|
622
622
|
var COMPONENT_ID$2 = 'timeline.opposite.content';
|
|
623
623
|
var StyledOppositeContent = styled__default["default"].div.attrs({
|
|
624
624
|
'data-garden-id': COMPONENT_ID$2,
|
|
625
|
-
'data-garden-version': '8.
|
|
625
|
+
'data-garden-version': '8.50.0'
|
|
626
626
|
}).withConfig({
|
|
627
627
|
displayName: "StyledOppositeContent",
|
|
628
628
|
componentId: "sc-jurh2k-0"
|
|
@@ -640,11 +640,17 @@ StyledOppositeContent.defaultProps = {
|
|
|
640
640
|
var COMPONENT_ID$1 = 'timeline.item';
|
|
641
641
|
var StyledTimelineItem = styled__default["default"].li.attrs({
|
|
642
642
|
'data-garden-id': COMPONENT_ID$1,
|
|
643
|
-
'data-garden-version': '8.
|
|
643
|
+
'data-garden-version': '8.50.0'
|
|
644
644
|
}).withConfig({
|
|
645
645
|
displayName: "StyledItem__StyledTimelineItem",
|
|
646
646
|
componentId: "sc-5mcnzm-0"
|
|
647
|
-
})(["display:flex;position:relative;&:last-of-type ", "::after{display:none;}", " ", " ", ";"],
|
|
647
|
+
})(["display:flex;position:relative;line-height:", ";color:", ";font-size:", ";&:last-of-type ", "::after{display:none;}", " ", " ", ";"], function (props) {
|
|
648
|
+
return reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
|
|
649
|
+
}, function (props) {
|
|
650
|
+
return props.theme.colors.foreground;
|
|
651
|
+
}, function (props) {
|
|
652
|
+
return props.theme.fontSizes.md;
|
|
653
|
+
}, StyledSeparator, function (props) {
|
|
648
654
|
return !props.hasOppositeContent && props.isAlternate && styled.css(["&:before{flex:1;content:'';padding:", "px;}"], props.theme.space.base * 4);
|
|
649
655
|
}, function (props) {
|
|
650
656
|
return props.isAlternate && styled.css(["&:nth-child(even){flex-direction:row-reverse;", "{text-align:", ";}", "{text-align:", ";}}"], StyledOppositeContent, props.theme.rtl ? 'right' : 'left', StyledTimelineContent, props.theme.rtl ? 'left' : 'right');
|
|
@@ -655,16 +661,16 @@ StyledTimelineItem.defaultProps = {
|
|
|
655
661
|
theme: reactTheming.DEFAULT_THEME
|
|
656
662
|
};
|
|
657
663
|
|
|
658
|
-
var _excluded$
|
|
664
|
+
var _excluded$6 = ["surfaceColor", "children"];
|
|
659
665
|
var COMPONENT_ID = 'timeline.icon';
|
|
660
666
|
var StyledItemIcon = styled__default["default"](function (_ref) {
|
|
661
667
|
_ref.surfaceColor;
|
|
662
668
|
var children = _ref.children,
|
|
663
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
669
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
664
670
|
return React.cloneElement(React.Children.only(children), props);
|
|
665
671
|
}).attrs({
|
|
666
672
|
'data-garden-id': COMPONENT_ID,
|
|
667
|
-
'data-garden-version': '8.
|
|
673
|
+
'data-garden-version': '8.50.0'
|
|
668
674
|
}).withConfig({
|
|
669
675
|
displayName: "StyledItemIcon",
|
|
670
676
|
componentId: "sc-vz2l6e-0"
|
|
@@ -748,155 +754,6 @@ var useTimelineItemContext = function useTimelineItemContext() {
|
|
|
748
754
|
return context;
|
|
749
755
|
};
|
|
750
756
|
|
|
751
|
-
var StepComponent = React.forwardRef(function (props, ref) {
|
|
752
|
-
var _useStepperContext = useStepperContext(),
|
|
753
|
-
currentIndexRef = _useStepperContext.currentIndexRef,
|
|
754
|
-
isHorizontal = _useStepperContext.isHorizontal;
|
|
755
|
-
var _useState = React.useState(currentIndexRef.current),
|
|
756
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
757
|
-
currentStepIndex = _useState2[0],
|
|
758
|
-
setIndex = _useState2[1];
|
|
759
|
-
React.useLayoutEffect(function () {
|
|
760
|
-
setIndex(currentIndexRef.current);
|
|
761
|
-
currentIndexRef.current++;
|
|
762
|
-
var currentIndex = currentIndexRef;
|
|
763
|
-
return function () {
|
|
764
|
-
currentIndex.current--;
|
|
765
|
-
};
|
|
766
|
-
}, [currentIndexRef]);
|
|
767
|
-
var value = React.useMemo(function () {
|
|
768
|
-
return {
|
|
769
|
-
currentStepIndex: currentStepIndex
|
|
770
|
-
};
|
|
771
|
-
}, [currentStepIndex]);
|
|
772
|
-
return React__default["default"].createElement(StepContext.Provider, {
|
|
773
|
-
value: value
|
|
774
|
-
}, React__default["default"].createElement(StyledStep, _extends$3({
|
|
775
|
-
ref: ref,
|
|
776
|
-
isHorizontal: isHorizontal
|
|
777
|
-
}, props), isHorizontal && React__default["default"].createElement(StyledLine, null), props.children));
|
|
778
|
-
});
|
|
779
|
-
StepComponent.displayName = 'Stepper.Step';
|
|
780
|
-
var Step = StepComponent;
|
|
781
|
-
|
|
782
|
-
var _path$1;
|
|
783
|
-
|
|
784
|
-
function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
785
|
-
|
|
786
|
-
var SvgCheckSmStroke = function SvgCheckSmStroke(props) {
|
|
787
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
788
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
789
|
-
width: 16,
|
|
790
|
-
height: 16,
|
|
791
|
-
focusable: "false",
|
|
792
|
-
viewBox: "0 0 16 16",
|
|
793
|
-
"aria-hidden": "true"
|
|
794
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
795
|
-
fill: "none",
|
|
796
|
-
stroke: "currentColor",
|
|
797
|
-
strokeLinecap: "round",
|
|
798
|
-
strokeLinejoin: "round",
|
|
799
|
-
strokeWidth: 1.25,
|
|
800
|
-
d: "M3 9l3 3 7-7"
|
|
801
|
-
})));
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
var LabelComponent$1 = React.forwardRef(function (props, ref) {
|
|
805
|
-
var _useStepContext = useStepContext(),
|
|
806
|
-
currentStepIndex = _useStepContext.currentStepIndex;
|
|
807
|
-
var _useStepperContext = useStepperContext(),
|
|
808
|
-
activeIndex = _useStepperContext.activeIndex,
|
|
809
|
-
isHorizontal = _useStepperContext.isHorizontal;
|
|
810
|
-
var numericStep = currentStepIndex + 1;
|
|
811
|
-
var stepIcon = props.icon || numericStep;
|
|
812
|
-
var isActive = activeIndex === currentStepIndex;
|
|
813
|
-
var isCompleted = activeIndex > currentStepIndex;
|
|
814
|
-
var styledIcon = React__default["default"].createElement(StyledIcon, {
|
|
815
|
-
isActive: isActive,
|
|
816
|
-
isHorizontal: isHorizontal
|
|
817
|
-
}, isCompleted ? React__default["default"].createElement(SvgCheckSmStroke, null) : stepIcon);
|
|
818
|
-
return React__default["default"].createElement(StyledLabel, _extends$3({
|
|
819
|
-
ref: ref,
|
|
820
|
-
isActive: isActive,
|
|
821
|
-
isHorizontal: isHorizontal
|
|
822
|
-
}, props), isHorizontal ? React__default["default"].createElement(StyledIconFlexContainer, null, styledIcon) : styledIcon, React__default["default"].createElement(StyledLabelText, {
|
|
823
|
-
isHidden: props.isHidden,
|
|
824
|
-
isHorizontal: isHorizontal
|
|
825
|
-
}, props.children));
|
|
826
|
-
});
|
|
827
|
-
LabelComponent$1.displayName = 'Stepper.Label';
|
|
828
|
-
LabelComponent$1.propTypes = {
|
|
829
|
-
icon: PropTypes__default["default"].node,
|
|
830
|
-
isHidden: PropTypes__default["default"].bool
|
|
831
|
-
};
|
|
832
|
-
var Label$1 = LabelComponent$1;
|
|
833
|
-
|
|
834
|
-
var ContentComponent$1 = React.forwardRef(function (props, ref) {
|
|
835
|
-
var contentRef = React.useRef();
|
|
836
|
-
var _useStepperContext = useStepperContext(),
|
|
837
|
-
activeIndex = _useStepperContext.activeIndex,
|
|
838
|
-
isHorizontal = _useStepperContext.isHorizontal;
|
|
839
|
-
var _useStepContext = useStepContext(),
|
|
840
|
-
currentStepIndex = _useStepContext.currentStepIndex;
|
|
841
|
-
var isActive = currentStepIndex === activeIndex;
|
|
842
|
-
var updateMaxHeight = React.useCallback(debounce__default["default"](function () {
|
|
843
|
-
if (contentRef.current) {
|
|
844
|
-
var child = contentRef.current.children[0];
|
|
845
|
-
child.style.maxHeight = "".concat(child.scrollHeight, "px");
|
|
846
|
-
}
|
|
847
|
-
}, 100), [contentRef]);
|
|
848
|
-
React.useEffect(function () {
|
|
849
|
-
if (isActive && isHorizontal === false) {
|
|
850
|
-
addEventListener('resize', updateMaxHeight);
|
|
851
|
-
updateMaxHeight();
|
|
852
|
-
return function () {
|
|
853
|
-
removeEventListener('resize', updateMaxHeight);
|
|
854
|
-
};
|
|
855
|
-
}
|
|
856
|
-
return undefined;
|
|
857
|
-
}, [isActive, isHorizontal, props.children, updateMaxHeight]);
|
|
858
|
-
return isHorizontal === false ? React__default["default"].createElement(StyledContent, _extends$3({
|
|
859
|
-
ref: mergeRefs__default["default"]([contentRef, ref]),
|
|
860
|
-
isActive: isActive
|
|
861
|
-
}, props), React__default["default"].createElement(StyledInnerContent, {
|
|
862
|
-
isActive: isActive
|
|
863
|
-
}, props.children)) : null;
|
|
864
|
-
});
|
|
865
|
-
ContentComponent$1.displayName = 'Stepper.Content';
|
|
866
|
-
var Content$1 = ContentComponent$1;
|
|
867
|
-
|
|
868
|
-
var _excluded$4 = ["isHorizontal", "activeIndex"];
|
|
869
|
-
var StepperComponent = React.forwardRef(function (_ref, ref) {
|
|
870
|
-
var isHorizontal = _ref.isHorizontal,
|
|
871
|
-
activeIndex = _ref.activeIndex,
|
|
872
|
-
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
873
|
-
var currentIndexRef = React.useRef(0);
|
|
874
|
-
var stepperContext = React.useMemo(function () {
|
|
875
|
-
return {
|
|
876
|
-
isHorizontal: isHorizontal || false,
|
|
877
|
-
activeIndex: activeIndex,
|
|
878
|
-
currentIndexRef: currentIndexRef
|
|
879
|
-
};
|
|
880
|
-
}, [isHorizontal, activeIndex, currentIndexRef]);
|
|
881
|
-
React.useEffect(function () {
|
|
882
|
-
currentIndexRef.current = 0;
|
|
883
|
-
});
|
|
884
|
-
return React__default["default"].createElement(StepperContext.Provider, {
|
|
885
|
-
value: stepperContext
|
|
886
|
-
}, React__default["default"].createElement(StyledStepper, _extends$3({
|
|
887
|
-
ref: ref,
|
|
888
|
-
isHorizontal: isHorizontal
|
|
889
|
-
}, props)));
|
|
890
|
-
});
|
|
891
|
-
StepperComponent.displayName = 'Stepper';
|
|
892
|
-
StepperComponent.defaultProps = {
|
|
893
|
-
activeIndex: 0
|
|
894
|
-
};
|
|
895
|
-
var Stepper = StepperComponent;
|
|
896
|
-
Stepper.Content = Content$1;
|
|
897
|
-
Stepper.Label = Label$1;
|
|
898
|
-
Stepper.Step = Step;
|
|
899
|
-
|
|
900
757
|
var SectionComponent = React.forwardRef(function (props, ref) {
|
|
901
758
|
var _useAccordionContext = useAccordionContext(),
|
|
902
759
|
currentIndexRef = _useAccordionContext.currentIndexRef;
|
|
@@ -911,25 +768,25 @@ var SectionComponent = React.forwardRef(function (props, ref) {
|
|
|
911
768
|
SectionComponent.displayName = 'Accordion.Section';
|
|
912
769
|
var Section = SectionComponent;
|
|
913
770
|
|
|
914
|
-
var _path;
|
|
771
|
+
var _path$1;
|
|
915
772
|
|
|
916
|
-
function _extends$
|
|
773
|
+
function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
917
774
|
|
|
918
775
|
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
919
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
776
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
920
777
|
xmlns: "http://www.w3.org/2000/svg",
|
|
921
778
|
width: 16,
|
|
922
779
|
height: 16,
|
|
923
780
|
focusable: "false",
|
|
924
781
|
viewBox: "0 0 16 16",
|
|
925
782
|
"aria-hidden": "true"
|
|
926
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
783
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
927
784
|
fill: "currentColor",
|
|
928
785
|
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
929
786
|
})));
|
|
930
787
|
};
|
|
931
788
|
|
|
932
|
-
var _excluded$
|
|
789
|
+
var _excluded$5 = ["onClick", "onFocus", "onBlur", "onMouseOver", "onMouseOut", "children"],
|
|
933
790
|
_excluded2 = ["onClick", "onKeyDown"];
|
|
934
791
|
var HeaderComponent = React.forwardRef(function (props, ref) {
|
|
935
792
|
var _useAccordionContext = useAccordionContext(),
|
|
@@ -945,7 +802,7 @@ var HeaderComponent = React.forwardRef(function (props, ref) {
|
|
|
945
802
|
onMouseOver = props.onMouseOver,
|
|
946
803
|
onMouseOut = props.onMouseOut,
|
|
947
804
|
children = props.children,
|
|
948
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
805
|
+
other = _objectWithoutProperties(props, _excluded$5);
|
|
949
806
|
var sectionIndex = useSectionContext();
|
|
950
807
|
var _useState = React.useState(false),
|
|
951
808
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1015,7 +872,7 @@ var HeaderComponent = React.forwardRef(function (props, ref) {
|
|
|
1015
872
|
HeaderComponent.displayName = 'Accordion.Header';
|
|
1016
873
|
var Header = HeaderComponent;
|
|
1017
874
|
|
|
1018
|
-
var LabelComponent = React.forwardRef(function (props, ref) {
|
|
875
|
+
var LabelComponent$1 = React.forwardRef(function (props, ref) {
|
|
1019
876
|
var sectionIndex = useSectionContext();
|
|
1020
877
|
var _useAccordionContext = useAccordionContext(),
|
|
1021
878
|
isCompact = _useAccordionContext.isCompact,
|
|
@@ -1033,8 +890,8 @@ var LabelComponent = React.forwardRef(function (props, ref) {
|
|
|
1033
890
|
isCollapsible: isCollapsible
|
|
1034
891
|
}, otherTriggerProps, props));
|
|
1035
892
|
});
|
|
1036
|
-
LabelComponent.displayName = 'Accordion.Label';
|
|
1037
|
-
var Label = LabelComponent;
|
|
893
|
+
LabelComponent$1.displayName = 'Accordion.Label';
|
|
894
|
+
var Label$1 = LabelComponent$1;
|
|
1038
895
|
|
|
1039
896
|
var PanelComponent = React.forwardRef(function (props, ref) {
|
|
1040
897
|
var _useAccordionContext = useAccordionContext(),
|
|
@@ -1078,7 +935,7 @@ var PanelComponent = React.forwardRef(function (props, ref) {
|
|
|
1078
935
|
PanelComponent.displayName = 'Accordion.Panel';
|
|
1079
936
|
var Panel = PanelComponent;
|
|
1080
937
|
|
|
1081
|
-
var _excluded$
|
|
938
|
+
var _excluded$4 = ["level", "isBare", "onChange", "isCompact", "isAnimated", "isExpandable", "isCollapsible", "defaultExpandedSections", "expandedSections"];
|
|
1082
939
|
var AccordionComponent = React.forwardRef(function (_ref, ref) {
|
|
1083
940
|
var level = _ref.level,
|
|
1084
941
|
isBare = _ref.isBare,
|
|
@@ -1089,7 +946,7 @@ var AccordionComponent = React.forwardRef(function (_ref, ref) {
|
|
|
1089
946
|
isCollapsible = _ref.isCollapsible,
|
|
1090
947
|
defaultExpandedSections = _ref.defaultExpandedSections,
|
|
1091
948
|
controlledExpandedSections = _ref.expandedSections,
|
|
1092
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
949
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
1093
950
|
var _useAccordion = containerAccordion.useAccordion({
|
|
1094
951
|
collapsible: isCollapsible,
|
|
1095
952
|
expandable: isExpandable || false,
|
|
@@ -1132,10 +989,167 @@ AccordionComponent.defaultProps = {
|
|
|
1132
989
|
};
|
|
1133
990
|
var Accordion = AccordionComponent;
|
|
1134
991
|
Accordion.Header = Header;
|
|
1135
|
-
Accordion.Label = Label;
|
|
992
|
+
Accordion.Label = Label$1;
|
|
1136
993
|
Accordion.Panel = Panel;
|
|
1137
994
|
Accordion.Section = Section;
|
|
1138
995
|
|
|
996
|
+
var StepComponent = React.forwardRef(function (props, ref) {
|
|
997
|
+
var _useStepperContext = useStepperContext(),
|
|
998
|
+
currentIndexRef = _useStepperContext.currentIndexRef,
|
|
999
|
+
isHorizontal = _useStepperContext.isHorizontal;
|
|
1000
|
+
var _useState = React.useState(currentIndexRef.current),
|
|
1001
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1002
|
+
currentStepIndex = _useState2[0],
|
|
1003
|
+
setIndex = _useState2[1];
|
|
1004
|
+
React.useLayoutEffect(function () {
|
|
1005
|
+
setIndex(currentIndexRef.current);
|
|
1006
|
+
currentIndexRef.current++;
|
|
1007
|
+
var currentIndex = currentIndexRef;
|
|
1008
|
+
return function () {
|
|
1009
|
+
currentIndex.current--;
|
|
1010
|
+
};
|
|
1011
|
+
}, [currentIndexRef]);
|
|
1012
|
+
var value = React.useMemo(function () {
|
|
1013
|
+
return {
|
|
1014
|
+
currentStepIndex: currentStepIndex
|
|
1015
|
+
};
|
|
1016
|
+
}, [currentStepIndex]);
|
|
1017
|
+
return React__default["default"].createElement(StepContext.Provider, {
|
|
1018
|
+
value: value
|
|
1019
|
+
}, React__default["default"].createElement(StyledStep, _extends$3({
|
|
1020
|
+
ref: ref,
|
|
1021
|
+
isHorizontal: isHorizontal
|
|
1022
|
+
}, props), isHorizontal && React__default["default"].createElement(StyledLine, null), props.children));
|
|
1023
|
+
});
|
|
1024
|
+
StepComponent.displayName = 'Stepper.Step';
|
|
1025
|
+
var Step = StepComponent;
|
|
1026
|
+
|
|
1027
|
+
var _path;
|
|
1028
|
+
|
|
1029
|
+
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
1030
|
+
|
|
1031
|
+
var SvgCheckSmStroke = function SvgCheckSmStroke(props) {
|
|
1032
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
1033
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1034
|
+
width: 16,
|
|
1035
|
+
height: 16,
|
|
1036
|
+
focusable: "false",
|
|
1037
|
+
viewBox: "0 0 16 16",
|
|
1038
|
+
"aria-hidden": "true"
|
|
1039
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1040
|
+
fill: "none",
|
|
1041
|
+
stroke: "currentColor",
|
|
1042
|
+
strokeLinecap: "round",
|
|
1043
|
+
strokeLinejoin: "round",
|
|
1044
|
+
strokeWidth: 1.25,
|
|
1045
|
+
d: "M3 9l3 3 7-7"
|
|
1046
|
+
})));
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
var _excluded$3 = ["icon", "iconProps", "isHidden", "children"];
|
|
1050
|
+
var LabelComponent = React.forwardRef(function (_ref, ref) {
|
|
1051
|
+
var icon = _ref.icon,
|
|
1052
|
+
iconProps = _ref.iconProps,
|
|
1053
|
+
isHidden = _ref.isHidden,
|
|
1054
|
+
children = _ref.children,
|
|
1055
|
+
other = _objectWithoutProperties(_ref, _excluded$3);
|
|
1056
|
+
var _useStepContext = useStepContext(),
|
|
1057
|
+
currentStepIndex = _useStepContext.currentStepIndex;
|
|
1058
|
+
var _useStepperContext = useStepperContext(),
|
|
1059
|
+
activeIndex = _useStepperContext.activeIndex,
|
|
1060
|
+
isHorizontal = _useStepperContext.isHorizontal;
|
|
1061
|
+
var numericStep = currentStepIndex + 1;
|
|
1062
|
+
var stepIcon = icon || numericStep;
|
|
1063
|
+
var isActive = activeIndex === currentStepIndex;
|
|
1064
|
+
var isCompleted = activeIndex > currentStepIndex;
|
|
1065
|
+
var styledIcon = React__default["default"].createElement(StyledIcon, {
|
|
1066
|
+
isActive: isActive,
|
|
1067
|
+
isHorizontal: isHorizontal
|
|
1068
|
+
}, isCompleted ? React__default["default"].createElement(SvgCheckSmStroke, iconProps) : stepIcon);
|
|
1069
|
+
return React__default["default"].createElement(StyledLabel, _extends$3({
|
|
1070
|
+
ref: ref,
|
|
1071
|
+
isActive: isActive,
|
|
1072
|
+
isHorizontal: isHorizontal
|
|
1073
|
+
}, other), isHorizontal ? React__default["default"].createElement(StyledIconFlexContainer, null, styledIcon) : styledIcon, React__default["default"].createElement(StyledLabelText, {
|
|
1074
|
+
isHidden: isHidden,
|
|
1075
|
+
isHorizontal: isHorizontal
|
|
1076
|
+
}, children));
|
|
1077
|
+
});
|
|
1078
|
+
LabelComponent.displayName = 'Stepper.Label';
|
|
1079
|
+
LabelComponent.propTypes = {
|
|
1080
|
+
icon: PropTypes__default["default"].node,
|
|
1081
|
+
iconProps: PropTypes__default["default"].object,
|
|
1082
|
+
isHidden: PropTypes__default["default"].bool
|
|
1083
|
+
};
|
|
1084
|
+
var Label = LabelComponent;
|
|
1085
|
+
|
|
1086
|
+
var ContentComponent$1 = React.forwardRef(function (props, ref) {
|
|
1087
|
+
var contentRef = React.useRef();
|
|
1088
|
+
var _useStepperContext = useStepperContext(),
|
|
1089
|
+
activeIndex = _useStepperContext.activeIndex,
|
|
1090
|
+
isHorizontal = _useStepperContext.isHorizontal;
|
|
1091
|
+
var _useStepContext = useStepContext(),
|
|
1092
|
+
currentStepIndex = _useStepContext.currentStepIndex;
|
|
1093
|
+
var isActive = currentStepIndex === activeIndex;
|
|
1094
|
+
var updateMaxHeight = React.useCallback(debounce__default["default"](function () {
|
|
1095
|
+
if (contentRef.current) {
|
|
1096
|
+
var child = contentRef.current.children[0];
|
|
1097
|
+
child.style.maxHeight = "".concat(child.scrollHeight, "px");
|
|
1098
|
+
}
|
|
1099
|
+
}, 100), [contentRef]);
|
|
1100
|
+
React.useEffect(function () {
|
|
1101
|
+
if (isActive && isHorizontal === false) {
|
|
1102
|
+
addEventListener('resize', updateMaxHeight);
|
|
1103
|
+
updateMaxHeight();
|
|
1104
|
+
return function () {
|
|
1105
|
+
removeEventListener('resize', updateMaxHeight);
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
return undefined;
|
|
1109
|
+
}, [isActive, isHorizontal, props.children, updateMaxHeight]);
|
|
1110
|
+
return isHorizontal === false ? React__default["default"].createElement(StyledContent, _extends$3({
|
|
1111
|
+
ref: mergeRefs__default["default"]([contentRef, ref]),
|
|
1112
|
+
isActive: isActive
|
|
1113
|
+
}, props), React__default["default"].createElement(StyledInnerContent, {
|
|
1114
|
+
isActive: isActive,
|
|
1115
|
+
"aria-hidden": !isActive
|
|
1116
|
+
}, props.children)) : null;
|
|
1117
|
+
});
|
|
1118
|
+
ContentComponent$1.displayName = 'Stepper.Content';
|
|
1119
|
+
var Content$1 = ContentComponent$1;
|
|
1120
|
+
|
|
1121
|
+
var _excluded$2 = ["isHorizontal", "activeIndex"];
|
|
1122
|
+
var StepperComponent = React.forwardRef(function (_ref, ref) {
|
|
1123
|
+
var isHorizontal = _ref.isHorizontal,
|
|
1124
|
+
activeIndex = _ref.activeIndex,
|
|
1125
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1126
|
+
var currentIndexRef = React.useRef(0);
|
|
1127
|
+
var stepperContext = React.useMemo(function () {
|
|
1128
|
+
return {
|
|
1129
|
+
isHorizontal: isHorizontal || false,
|
|
1130
|
+
activeIndex: activeIndex,
|
|
1131
|
+
currentIndexRef: currentIndexRef
|
|
1132
|
+
};
|
|
1133
|
+
}, [isHorizontal, activeIndex, currentIndexRef]);
|
|
1134
|
+
React.useEffect(function () {
|
|
1135
|
+
currentIndexRef.current = 0;
|
|
1136
|
+
});
|
|
1137
|
+
return React__default["default"].createElement(StepperContext.Provider, {
|
|
1138
|
+
value: stepperContext
|
|
1139
|
+
}, React__default["default"].createElement(StyledStepper, _extends$3({
|
|
1140
|
+
ref: ref,
|
|
1141
|
+
isHorizontal: isHorizontal
|
|
1142
|
+
}, props)));
|
|
1143
|
+
});
|
|
1144
|
+
StepperComponent.displayName = 'Stepper';
|
|
1145
|
+
StepperComponent.defaultProps = {
|
|
1146
|
+
activeIndex: 0
|
|
1147
|
+
};
|
|
1148
|
+
var Stepper = StepperComponent;
|
|
1149
|
+
Stepper.Content = Content$1;
|
|
1150
|
+
Stepper.Label = Label;
|
|
1151
|
+
Stepper.Step = Step;
|
|
1152
|
+
|
|
1139
1153
|
var OppositeContentComponent = React.forwardRef(function (props, ref) {
|
|
1140
1154
|
return React__default["default"].createElement(StyledOppositeContent, _extends$3({
|
|
1141
1155
|
ref: ref
|