@papillonbits/components 1.13.1 → 1.14.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/build/index.js +1 -12
- package/build/primer/Alert/Alert.js +82 -94
- package/build/primer/Alert/Alert.prop.js +19 -25
- package/build/primer/Alert/index.js +2 -19
- package/build/primer/Blankslate/Blankslate.js +22 -26
- package/build/primer/Blankslate/Blankslate.prop.js +11 -17
- package/build/primer/Blankslate/index.js +2 -19
- package/build/primer/Breadcrumb/Breadcrumb.js +59 -61
- package/build/primer/Breadcrumb/Breadcrumb.prop.js +14 -20
- package/build/primer/Breadcrumb/index.js +2 -19
- package/build/primer/Button/Button.js +63 -72
- package/build/primer/Button/Button.prop.js +27 -33
- package/build/primer/Button/index.js +2 -49
- package/build/primer/Dropdown/Dropdown.js +79 -85
- package/build/primer/Dropdown/Dropdown.prop.js +15 -21
- package/build/primer/Dropdown/index.js +2 -19
- package/build/primer/ErrorBoundary/ErrorBoundary.js +35 -55
- package/build/primer/ErrorBoundary/ErrorBoundary.prop.js +4 -10
- package/build/primer/ErrorBoundary/index.js +1 -12
- package/build/primer/Form/Checkbox/Checkbox.js +29 -39
- package/build/primer/Form/Checkbox/Checkbox.prop.js +15 -21
- package/build/primer/Form/Checkbox/index.js +2 -19
- package/build/primer/Form/Input/Input.js +29 -43
- package/build/primer/Form/Input/Input.prop.js +19 -25
- package/build/primer/Form/Input/index.js +2 -25
- package/build/primer/Form/Radio/Radio.js +26 -38
- package/build/primer/Form/Radio/Radio.prop.js +14 -20
- package/build/primer/Form/Radio/index.js +2 -19
- package/build/primer/Form/index.js +11 -17
- package/build/primer/Grid/DisplayTable/DisplayTable.js +44 -54
- package/build/primer/Grid/DisplayTable/DisplayTable.prop.js +7 -13
- package/build/primer/Grid/DisplayTable/index.js +1 -12
- package/build/primer/Grid/FlexGrid/FlexGrid.js +186 -207
- package/build/primer/Grid/FlexGrid/FlexGrid.prop.js +24 -30
- package/build/primer/Grid/FlexGrid/index.js +2 -25
- package/build/primer/Grid/index.js +7 -13
- package/build/primer/Icon/Icon.js +35 -52
- package/build/primer/Icon/Icon.part.js +1287 -1294
- package/build/primer/Icon/Icon.prop.js +20 -26
- package/build/primer/Icon/index.js +2 -25
- package/build/primer/Label/Label.js +22 -28
- package/build/primer/Label/Label.prop.js +11 -17
- package/build/primer/Label/index.js +1 -12
- package/build/primer/Loader/Loader.js +38 -45
- package/build/primer/Loader/Loader.prop.js +7 -13
- package/build/primer/Loader/index.js +2 -19
- package/build/primer/Navigation/Menu/Menu.js +52 -59
- package/build/primer/Navigation/Menu/Menu.prop.js +16 -22
- package/build/primer/Navigation/Menu/index.js +1 -12
- package/build/primer/Navigation/TabNav/TabNav.js +89 -94
- package/build/primer/Navigation/TabNav/TabNav.prop.js +19 -25
- package/build/primer/Navigation/TabNav/index.js +2 -19
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.js +82 -86
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.js +21 -27
- package/build/primer/Navigation/UnderlineNav/index.js +2 -25
- package/build/primer/Navigation/index.js +10 -16
- package/build/primer/Pagination/PreviousNext/PreviousNext.js +53 -54
- package/build/primer/Pagination/PreviousNext/PreviousNext.prop.js +22 -28
- package/build/primer/Pagination/PreviousNext/index.js +2 -19
- package/build/primer/Pagination/index.js +4 -10
- package/build/primer/Popover/Popover.js +59 -50
- package/build/primer/Popover/Popover.prop.js +16 -22
- package/build/primer/Popover/index.js +2 -25
- package/build/primer/Progress/Progress.js +20 -26
- package/build/primer/Progress/Progress.prop.js +7 -13
- package/build/primer/Progress/index.js +2 -19
- package/build/primer/Select/Select.js +43 -51
- package/build/primer/Select/Select.prop.js +12 -18
- package/build/primer/Select/index.js +2 -19
- package/build/primer/SelectMenu/SelectMenu.js +65 -74
- package/build/primer/SelectMenu/SelectMenu.prop.js +14 -20
- package/build/primer/SelectMenu/index.js +1 -12
- package/build/primer/Subhead/Subhead.js +16 -23
- package/build/primer/Subhead/Subhead.prop.js +6 -12
- package/build/primer/Subhead/index.js +1 -12
- package/build/primer/Toast/Toast.js +39 -46
- package/build/primer/Toast/Toast.prop.js +10 -16
- package/build/primer/Toast/index.js +2 -19
- package/build/primer/index.js +58 -64
- package/package.json +4 -4
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'aria-disabled': 'true'
|
|
36
|
-
}) : null;
|
|
37
|
-
var forwardAriaProps = !canMoveForward ? _objectSpread({}, {
|
|
38
|
-
'aria-disabled': 'true'
|
|
39
|
-
}) : null;
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import displayStyles from '@papillonbits/css/build/primer/utilities/visibility-display.scss';
|
|
3
|
+
import { paginationActionTypes } from '@papillonbits/library/pagination';
|
|
4
|
+
import { propTypes, defaultProps, previousNextState } from './PreviousNext.prop';
|
|
5
|
+
import styles from './PreviousNext.scss';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export function PreviousNext({
|
|
8
|
+
className = defaultProps.className,
|
|
9
|
+
ariaAttr,
|
|
10
|
+
currentPage,
|
|
11
|
+
previous = defaultProps.previous,
|
|
12
|
+
next = defaultProps.next,
|
|
13
|
+
onClick,
|
|
14
|
+
state = defaultProps.state
|
|
15
|
+
}) {
|
|
16
|
+
const {
|
|
17
|
+
label
|
|
18
|
+
} = ariaAttr;
|
|
19
|
+
const {
|
|
20
|
+
indexItems,
|
|
21
|
+
currentIndex,
|
|
22
|
+
canMoveBackwards,
|
|
23
|
+
canMoveForward
|
|
24
|
+
} = currentPage;
|
|
25
|
+
const backwardsAriaProps = !canMoveBackwards ? {
|
|
26
|
+
...{
|
|
27
|
+
'aria-disabled': 'true'
|
|
28
|
+
}
|
|
29
|
+
} : null;
|
|
30
|
+
const forwardAriaProps = !canMoveForward ? {
|
|
31
|
+
...{
|
|
32
|
+
'aria-disabled': 'true'
|
|
33
|
+
}
|
|
34
|
+
} : null;
|
|
40
35
|
if (indexItems === [] || currentIndex === -1) {
|
|
41
36
|
return null;
|
|
42
37
|
}
|
|
43
|
-
return /*#__PURE__*/(
|
|
44
|
-
className: (
|
|
38
|
+
return /*#__PURE__*/_jsx("nav", {
|
|
39
|
+
className: cx(className, styles['paginate-container'], {
|
|
40
|
+
[styles['previousnext-inactive']]: state === previousNextState.inactive
|
|
41
|
+
}),
|
|
45
42
|
"aria-label": label,
|
|
46
|
-
children: /*#__PURE__*/(
|
|
47
|
-
className: (
|
|
48
|
-
children: [!canMoveBackwards ? /*#__PURE__*/(
|
|
43
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
44
|
+
className: cx(styles.pagination, displayStyles['d-flex']),
|
|
45
|
+
children: [!canMoveBackwards ? /*#__PURE__*/_jsx("span", {
|
|
46
|
+
...backwardsAriaProps,
|
|
49
47
|
children: previous.text
|
|
50
|
-
})
|
|
51
|
-
onClick:
|
|
48
|
+
}) : /*#__PURE__*/_jsx("a", {
|
|
49
|
+
onClick: event => {
|
|
52
50
|
event.preventDefault();
|
|
53
|
-
|
|
51
|
+
onClick(paginationActionTypes.onBackwards);
|
|
54
52
|
},
|
|
55
53
|
rel: previous.rel,
|
|
56
54
|
href: previous.href,
|
|
57
55
|
"aria-label": previous.ariaAttr.label,
|
|
58
56
|
children: previous.text
|
|
59
|
-
}), /*#__PURE__*/(
|
|
60
|
-
children:
|
|
61
|
-
}), !canMoveForward ? /*#__PURE__*/(
|
|
57
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
58
|
+
children: `Viewing ${currentIndex + 1} to ${indexItems.length}`
|
|
59
|
+
}), !canMoveForward ? /*#__PURE__*/_jsx("span", {
|
|
60
|
+
...forwardAriaProps,
|
|
62
61
|
children: next.text
|
|
63
|
-
})
|
|
64
|
-
onClick:
|
|
62
|
+
}) : /*#__PURE__*/_jsx("a", {
|
|
63
|
+
onClick: event => {
|
|
65
64
|
event.preventDefault();
|
|
66
|
-
|
|
65
|
+
onClick(paginationActionTypes.onForward);
|
|
67
66
|
},
|
|
68
67
|
rel: next.rel,
|
|
69
68
|
href: next.href,
|
|
@@ -73,4 +72,4 @@ function PreviousNext(_ref) {
|
|
|
73
72
|
})
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
|
-
PreviousNext.propTypes =
|
|
75
|
+
PreviousNext.propTypes = propTypes;
|
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.propTypes = exports.previousNextState = exports.defaultProps = void 0;
|
|
7
|
-
var _propTypes = require("prop-types");
|
|
8
|
-
var previousNextState = exports.previousNextState = {
|
|
1
|
+
import { string, oneOf, shape, object, func } from 'prop-types';
|
|
2
|
+
export const previousNextState = {
|
|
9
3
|
active: 'active',
|
|
10
4
|
inactive: 'inactive'
|
|
11
5
|
};
|
|
12
|
-
|
|
13
|
-
className:
|
|
14
|
-
ariaAttr:
|
|
15
|
-
label:
|
|
6
|
+
export const propTypes = {
|
|
7
|
+
className: string,
|
|
8
|
+
ariaAttr: shape({
|
|
9
|
+
label: string
|
|
16
10
|
}).isRequired,
|
|
17
|
-
currentPage:
|
|
18
|
-
previous:
|
|
19
|
-
rel:
|
|
20
|
-
href:
|
|
21
|
-
ariaAttr:
|
|
22
|
-
label:
|
|
11
|
+
currentPage: object.isRequired,
|
|
12
|
+
previous: shape({
|
|
13
|
+
rel: string,
|
|
14
|
+
href: string,
|
|
15
|
+
ariaAttr: shape({
|
|
16
|
+
label: string
|
|
23
17
|
}).isRequired,
|
|
24
|
-
text:
|
|
18
|
+
text: string
|
|
25
19
|
}),
|
|
26
|
-
next:
|
|
27
|
-
rel:
|
|
28
|
-
href:
|
|
29
|
-
ariaAttr:
|
|
30
|
-
label:
|
|
20
|
+
next: shape({
|
|
21
|
+
rel: string,
|
|
22
|
+
href: string,
|
|
23
|
+
ariaAttr: shape({
|
|
24
|
+
label: string
|
|
31
25
|
}).isRequired,
|
|
32
|
-
text:
|
|
26
|
+
text: string
|
|
33
27
|
}),
|
|
34
|
-
onClick:
|
|
35
|
-
state:
|
|
28
|
+
onClick: func.isRequired,
|
|
29
|
+
state: oneOf(Object.keys(previousNextState))
|
|
36
30
|
};
|
|
37
|
-
|
|
31
|
+
export const defaultProps = {
|
|
38
32
|
className: null,
|
|
39
33
|
previous: {
|
|
40
34
|
rel: 'previous',
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "PreviousNext", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _PreviousNext.PreviousNext;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "previousNextState", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _PreviousNext2.previousNextState;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _PreviousNext = require("./PreviousNext");
|
|
19
|
-
var _PreviousNext2 = require("./PreviousNext.prop");
|
|
1
|
+
export { PreviousNext } from './PreviousNext';
|
|
2
|
+
export { previousNextState } from './PreviousNext.prop';
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.Pagination = void 0;
|
|
7
|
-
var _PreviousNext = require("./PreviousNext");
|
|
8
|
-
var Pagination = exports.Pagination = {
|
|
9
|
-
PreviousNext: _PreviousNext.PreviousNext,
|
|
10
|
-
previousNextState: _PreviousNext.previousNextState
|
|
1
|
+
import { PreviousNext, previousNextState } from './PreviousNext';
|
|
2
|
+
export const Pagination = {
|
|
3
|
+
PreviousNext,
|
|
4
|
+
previousNextState
|
|
11
5
|
};
|
|
@@ -1,63 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
message = _ref.message,
|
|
31
|
-
acknowledge = _ref.acknowledge,
|
|
32
|
-
introOnClick = _ref.introOnClick,
|
|
33
|
-
acknowledgeOnClick = _ref.acknowledgeOnClick;
|
|
34
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
35
|
-
className: (0, _classnames["default"])(className, _layout["default"]['position-relative'], (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _typography["default"]['text-center'], variant === _Popover.popoverVariant["default"] || variant === _Popover.popoverVariant.bottom), (0, _classnames["default"])(_typography["default"]['text-right'], _padding["default"]['pr-2']), variant === _Popover.popoverVariant.bottomRight)),
|
|
36
|
-
children: [variant === _Popover.popoverVariant["default"] && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
37
|
-
variant: _Button.buttonVariant.primary,
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import boxShadowStyles from '@papillonbits/css/build/primer/utilities/box-shadow.scss';
|
|
3
|
+
import layoutStyles from '@papillonbits/css/build/primer/utilities/layout.scss';
|
|
4
|
+
import marginStyles from '@papillonbits/css/build/primer/utilities/margin.scss';
|
|
5
|
+
import paddingStyles from '@papillonbits/css/build/primer/utilities/padding.scss';
|
|
6
|
+
import typographyStyles from '@papillonbits/css/build/primer/utilities/typography.scss';
|
|
7
|
+
import boxStyles from '../Box/box.scss';
|
|
8
|
+
import { propTypes, defaultProps, popoverVariant, popoverSize } from './Popover.prop';
|
|
9
|
+
import styles from './Popover.scss';
|
|
10
|
+
import { Button, buttonVariant } from '../Button';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export function Popover({
|
|
13
|
+
className = defaultProps.className,
|
|
14
|
+
variant = defaultProps.variant,
|
|
15
|
+
size = defaultProps.size,
|
|
16
|
+
intro,
|
|
17
|
+
heading,
|
|
18
|
+
message,
|
|
19
|
+
acknowledge,
|
|
20
|
+
introOnClick,
|
|
21
|
+
acknowledgeOnClick
|
|
22
|
+
}) {
|
|
23
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
24
|
+
className: cx(className, layoutStyles['position-relative'], {
|
|
25
|
+
[typographyStyles['text-center']]: variant === popoverVariant.default || variant === popoverVariant.bottom,
|
|
26
|
+
[cx(typographyStyles['text-right'], paddingStyles['pr-2'])]: variant === popoverVariant.bottomRight
|
|
27
|
+
}),
|
|
28
|
+
children: [variant === popoverVariant.default && /*#__PURE__*/_jsx(Button, {
|
|
29
|
+
variant: buttonVariant.primary,
|
|
38
30
|
text: intro,
|
|
39
31
|
onClick: introOnClick
|
|
40
|
-
}), /*#__PURE__*/(
|
|
41
|
-
className: ((
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
33
|
+
className: (cx(styles.Popover, layoutStyles['position-relative']), {
|
|
34
|
+
[cx(layoutStyles['right-0'], layoutStyles['left-0'])]: variant === popoverVariant.default,
|
|
35
|
+
[paddingStyles['pl-2']]: variant === popoverVariant.bottomLeft
|
|
36
|
+
}),
|
|
37
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
38
|
+
className: cx(styles['Popover-message'], typographyStyles['text-left'], paddingStyles['p-4'], boxStyles.Box, boxShadowStyles['box-shadow-large'], {
|
|
39
|
+
[cx(marginStyles['mx-auto'], marginStyles['mt-2'])]: variant === popoverVariant.default,
|
|
40
|
+
[cx(styles['Popover-message--bottom'], marginStyles['mx-auto'], marginStyles['mb-2'])]: variant === popoverVariant.bottom,
|
|
41
|
+
[cx(styles['Popover-message--bottom-right'], marginStyles['mb-2'])]: variant === popoverVariant.bottomRight,
|
|
42
|
+
[cx(styles['Popover-message--bottom-left'], marginStyles['mb-2'])]: variant === popoverVariant.bottomLeft,
|
|
43
|
+
[styles['Popover-message--left']]: variant === popoverVariant.left,
|
|
44
|
+
[styles['Popover-message--left-bottom']]: variant === popoverVariant.leftBottom,
|
|
45
|
+
[styles['Popover-message--left-top']]: variant === popoverVariant.leftTop,
|
|
46
|
+
[styles['Popover-message--right']]: variant === popoverVariant.right,
|
|
47
|
+
[styles['Popover-message--right-bottom']]: variant === popoverVariant.rightBottom,
|
|
48
|
+
[styles['Popover-message--right-top']]: variant === popoverVariant.rightTop,
|
|
49
|
+
[styles['Popover-message--top-left']]: variant === popoverVariant.topLeft,
|
|
50
|
+
[styles['Popover-message--top-right']]: variant === popoverVariant.topRight,
|
|
51
|
+
[styles['Popover-message--large']]: size === popoverSize.large
|
|
52
|
+
}),
|
|
53
|
+
children: [/*#__PURE__*/_jsx("h4", {
|
|
54
|
+
className: marginStyles['mb-2'],
|
|
46
55
|
children: heading
|
|
47
|
-
}), /*#__PURE__*/(
|
|
56
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
48
57
|
children: message
|
|
49
|
-
}), /*#__PURE__*/(
|
|
50
|
-
className: (
|
|
58
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
59
|
+
className: cx(marginStyles['mt-2'], typographyStyles['text-bold']),
|
|
51
60
|
text: acknowledge,
|
|
52
|
-
variant:
|
|
61
|
+
variant: buttonVariant.outline,
|
|
53
62
|
onClick: acknowledgeOnClick
|
|
54
63
|
})]
|
|
55
64
|
})
|
|
56
|
-
}), (variant ===
|
|
57
|
-
variant:
|
|
65
|
+
}), (variant === popoverVariant.bottom || variant === popoverVariant.bottomRight || variant === popoverVariant.bottomLeft) && /*#__PURE__*/_jsx(Button, {
|
|
66
|
+
variant: buttonVariant.primary,
|
|
58
67
|
text: intro,
|
|
59
68
|
onClick: introOnClick
|
|
60
69
|
})]
|
|
61
70
|
});
|
|
62
71
|
}
|
|
63
|
-
Popover.propTypes =
|
|
72
|
+
Popover.propTypes = propTypes;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.propTypes = exports.popoverVariant = exports.popoverSize = exports.defaultProps = void 0;
|
|
7
|
-
var _propTypes = require("prop-types");
|
|
8
|
-
var popoverVariant = exports.popoverVariant = {
|
|
9
|
-
"default": 'default',
|
|
1
|
+
import { string, oneOf, func } from 'prop-types';
|
|
2
|
+
export const popoverVariant = {
|
|
3
|
+
default: 'default',
|
|
10
4
|
bottom: 'bottom',
|
|
11
5
|
bottomRight: 'bottomRight',
|
|
12
6
|
bottomLeft: 'bottomLeft',
|
|
@@ -19,23 +13,23 @@ var popoverVariant = exports.popoverVariant = {
|
|
|
19
13
|
topLeft: 'topLeft',
|
|
20
14
|
topRight: 'topRight'
|
|
21
15
|
};
|
|
22
|
-
|
|
16
|
+
export const popoverSize = {
|
|
23
17
|
normal: 'normal',
|
|
24
18
|
large: 'large'
|
|
25
19
|
};
|
|
26
|
-
|
|
27
|
-
className:
|
|
28
|
-
variant:
|
|
29
|
-
size:
|
|
30
|
-
intro:
|
|
31
|
-
heading:
|
|
32
|
-
message:
|
|
33
|
-
acknowledge:
|
|
34
|
-
introOnClick:
|
|
35
|
-
acknowledgeOnClick:
|
|
20
|
+
export const propTypes = {
|
|
21
|
+
className: string,
|
|
22
|
+
variant: oneOf(Object.keys(popoverVariant)),
|
|
23
|
+
size: oneOf(Object.keys(popoverSize)),
|
|
24
|
+
intro: string.isRequired,
|
|
25
|
+
heading: string.isRequired,
|
|
26
|
+
message: string.isRequired,
|
|
27
|
+
acknowledge: string.isRequired,
|
|
28
|
+
introOnClick: func.isRequired,
|
|
29
|
+
acknowledgeOnClick: func.isRequired
|
|
36
30
|
};
|
|
37
|
-
|
|
31
|
+
export const defaultProps = {
|
|
38
32
|
className: null,
|
|
39
|
-
variant: popoverVariant
|
|
33
|
+
variant: popoverVariant.default,
|
|
40
34
|
size: popoverSize.normal
|
|
41
35
|
};
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Popover", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Popover.Popover;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "popoverSize", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _Popover2.popoverSize;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "popoverVariant", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _Popover2.popoverVariant;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _Popover = require("./Popover");
|
|
25
|
-
var _Popover2 = require("./Popover.prop");
|
|
1
|
+
export { Popover } from './Popover';
|
|
2
|
+
export { popoverVariant, popoverSize } from './Popover.prop';
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function Progress(_ref) {
|
|
15
|
-
var _ref$className = _ref.className,
|
|
16
|
-
className = _ref$className === void 0 ? _Progress.defaultProps.className : _ref$className,
|
|
17
|
-
_ref$variant = _ref.variant,
|
|
18
|
-
variant = _ref$variant === void 0 ? _Progress.defaultProps.variant : _ref$variant,
|
|
19
|
-
percentage = _ref.percentage;
|
|
20
|
-
var percentageStyle = {
|
|
21
|
-
width: "".concat(percentage, "%")
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import colorStyles from '@papillonbits/css/build/primer/utilities/colors.scss';
|
|
3
|
+
import { propTypes, defaultProps, progressVariant } from './Progress.prop';
|
|
4
|
+
import styles from './Progress.scss';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export function Progress({
|
|
7
|
+
className = defaultProps.className,
|
|
8
|
+
variant = defaultProps.variant,
|
|
9
|
+
percentage
|
|
10
|
+
}) {
|
|
11
|
+
const percentageStyle = {
|
|
12
|
+
width: `${percentage}%`
|
|
22
13
|
};
|
|
23
|
-
return /*#__PURE__*/(
|
|
24
|
-
className: (
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
return /*#__PURE__*/_jsx("span", {
|
|
15
|
+
className: cx(className, styles.Progress, {
|
|
16
|
+
[styles['Progress--large']]: variant === progressVariant.large,
|
|
17
|
+
[styles['Progress--small']]: variant === progressVariant.small === true
|
|
18
|
+
}),
|
|
19
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
20
|
+
className: cx(styles['Progress-item'], colorStyles['bg-green']),
|
|
27
21
|
style: percentageStyle
|
|
28
22
|
})
|
|
29
23
|
});
|
|
30
24
|
}
|
|
31
|
-
Progress.propTypes =
|
|
25
|
+
Progress.propTypes = propTypes;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.propTypes = exports.progressVariant = exports.defaultProps = void 0;
|
|
7
|
-
var _propTypes = require("prop-types");
|
|
8
|
-
var progressVariant = exports.progressVariant = {
|
|
1
|
+
import { string, oneOf, number } from 'prop-types';
|
|
2
|
+
export const progressVariant = {
|
|
9
3
|
small: 'small',
|
|
10
4
|
normal: 'normal',
|
|
11
5
|
large: 'large'
|
|
12
6
|
};
|
|
13
|
-
|
|
14
|
-
className:
|
|
15
|
-
variant:
|
|
16
|
-
percentage:
|
|
7
|
+
export const propTypes = {
|
|
8
|
+
className: string,
|
|
9
|
+
variant: oneOf(Object.keys(progressVariant)),
|
|
10
|
+
percentage: number.isRequired
|
|
17
11
|
};
|
|
18
|
-
|
|
12
|
+
export const defaultProps = {
|
|
19
13
|
className: null,
|
|
20
14
|
variant: progressVariant.normal
|
|
21
15
|
};
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Progress", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Progress.Progress;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "progressVariant", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _Progress2.progressVariant;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _Progress = require("./Progress");
|
|
19
|
-
var _Progress2 = require("./Progress.prop");
|
|
1
|
+
export { Progress } from './Progress';
|
|
2
|
+
export { progressVariant } from './Progress.prop';
|