@papillonbits/components 1.13.1 → 1.14.1
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,46 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.propTypes = exports.flexGridState = exports.flexGridSelection = exports.defaultProps = void 0;
|
|
7
|
-
var _propTypes = require("prop-types");
|
|
8
|
-
var flexGridState = exports.flexGridState = {
|
|
1
|
+
import { string, array, shape, number, oneOf, func } from 'prop-types';
|
|
2
|
+
export const flexGridState = {
|
|
9
3
|
active: 'active',
|
|
10
4
|
inactive: 'inactive'
|
|
11
5
|
};
|
|
12
|
-
|
|
6
|
+
export const flexGridSelection = {
|
|
13
7
|
checkbox: 'checkbox',
|
|
14
8
|
radio: 'radio'
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
className:
|
|
18
|
-
items:
|
|
19
|
-
idIndex:
|
|
20
|
-
isSelectedIndex:
|
|
21
|
-
selection:
|
|
22
|
-
sort:
|
|
23
|
-
index:
|
|
24
|
-
value:
|
|
25
|
-
order:
|
|
10
|
+
export const propTypes = {
|
|
11
|
+
className: string,
|
|
12
|
+
items: array.isRequired,
|
|
13
|
+
idIndex: number,
|
|
14
|
+
isSelectedIndex: number,
|
|
15
|
+
selection: oneOf(Object.keys(flexGridSelection)),
|
|
16
|
+
sort: shape({
|
|
17
|
+
index: number,
|
|
18
|
+
value: string,
|
|
19
|
+
order: string
|
|
26
20
|
}).isRequired,
|
|
27
|
-
onChange:
|
|
28
|
-
onClick:
|
|
29
|
-
onDoubleClick:
|
|
30
|
-
iconColor:
|
|
31
|
-
sort:
|
|
32
|
-
object:
|
|
21
|
+
onChange: func,
|
|
22
|
+
onClick: func,
|
|
23
|
+
onDoubleClick: func,
|
|
24
|
+
iconColor: shape({
|
|
25
|
+
sort: string,
|
|
26
|
+
object: string
|
|
33
27
|
}),
|
|
34
|
-
state:
|
|
28
|
+
state: oneOf(Object.keys(flexGridState))
|
|
35
29
|
};
|
|
36
|
-
|
|
30
|
+
export const defaultProps = {
|
|
37
31
|
className: null,
|
|
38
32
|
idIndex: -1,
|
|
39
33
|
isSelectedIndex: -1,
|
|
40
34
|
selection: flexGridSelection.checkbox,
|
|
41
|
-
onChange:
|
|
42
|
-
onClick:
|
|
43
|
-
onDoubleClick:
|
|
35
|
+
onChange: () => {},
|
|
36
|
+
onClick: () => {},
|
|
37
|
+
onDoubleClick: () => {},
|
|
44
38
|
iconColor: {
|
|
45
39
|
sort: '#990000',
|
|
46
40
|
object: '#79b8ff'
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "FlexGrid", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _FlexGrid.FlexGrid;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "flexGridSelection", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _FlexGrid2.flexGridSelection;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "flexGridState", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _FlexGrid2.flexGridState;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _FlexGrid = require("./FlexGrid");
|
|
25
|
-
var _FlexGrid2 = require("./FlexGrid.prop");
|
|
1
|
+
export { FlexGrid } from './FlexGrid';
|
|
2
|
+
export { flexGridSelection, flexGridState } from './FlexGrid.prop';
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _FlexGrid = require("./FlexGrid");
|
|
9
|
-
var Grid = exports.Grid = {
|
|
10
|
-
DisplayTable: _DisplayTable.DisplayTable,
|
|
11
|
-
FlexGrid: _FlexGrid.FlexGrid,
|
|
12
|
-
flexGridSelection: _FlexGrid.flexGridSelection,
|
|
13
|
-
flexGridState: _FlexGrid.flexGridState
|
|
1
|
+
import { DisplayTable } from './DisplayTable';
|
|
2
|
+
import { FlexGrid, flexGridSelection, flexGridState } from './FlexGrid';
|
|
3
|
+
export const Grid = {
|
|
4
|
+
DisplayTable,
|
|
5
|
+
FlexGrid,
|
|
6
|
+
flexGridSelection,
|
|
7
|
+
flexGridState
|
|
14
8
|
};
|
|
@@ -1,70 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _ref$className = _ref.className,
|
|
20
|
-
className = _ref$className === void 0 ? _Icon.defaultProps.className : _ref$className,
|
|
21
|
-
_ref$ariaLabel = _ref.ariaLabel,
|
|
22
|
-
ariaLabel = _ref$ariaLabel === void 0 ? _Icon.defaultProps.ariaLabel : _ref$ariaLabel,
|
|
23
|
-
icon = _ref.icon,
|
|
24
|
-
_ref$height = _ref.height,
|
|
25
|
-
height = _ref$height === void 0 ? _Icon.defaultProps.height : _ref$height,
|
|
26
|
-
_ref$width = _ref.width,
|
|
27
|
-
width = _ref$width === void 0 ? _Icon.defaultProps.width : _ref$width,
|
|
28
|
-
_ref$size = _ref.size,
|
|
29
|
-
size = _ref$size === void 0 ? _Icon.defaultProps.size : _ref$size,
|
|
30
|
-
_ref$fill = _ref.fill,
|
|
31
|
-
fill = _ref$fill === void 0 ? _Icon.defaultProps.fill : _ref$fill,
|
|
32
|
-
_ref$verticalAlign = _ref.verticalAlign,
|
|
33
|
-
verticalAlign = _ref$verticalAlign === void 0 ? _Icon.defaultProps.verticalAlign : _ref$verticalAlign,
|
|
34
|
-
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
35
|
-
var widthHeight = defaultSize;
|
|
36
|
-
var attrs = {
|
|
37
|
-
className: className,
|
|
1
|
+
import { propTypes, defaultProps, iconSize, iconAlign } from './Icon.prop';
|
|
2
|
+
import { iconComponents } from './Icon.part';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const defaultSize = [16, 16];
|
|
5
|
+
export function Icon({
|
|
6
|
+
className = defaultProps.className,
|
|
7
|
+
ariaLabel = defaultProps.ariaLabel,
|
|
8
|
+
icon,
|
|
9
|
+
height = defaultProps.height,
|
|
10
|
+
width = defaultProps.width,
|
|
11
|
+
size = defaultProps.size,
|
|
12
|
+
fill = defaultProps.fill,
|
|
13
|
+
verticalAlign = defaultProps.verticalAlign,
|
|
14
|
+
...otherProps
|
|
15
|
+
}) {
|
|
16
|
+
const widthHeight = defaultSize;
|
|
17
|
+
const attrs = {
|
|
18
|
+
className,
|
|
38
19
|
'aria-hidden': ariaLabel ? 'false' : 'true',
|
|
39
20
|
'aria-label': ariaLabel,
|
|
40
|
-
height
|
|
21
|
+
height,
|
|
41
22
|
role: 'img',
|
|
42
|
-
viewBox: [0, 0
|
|
23
|
+
viewBox: [0, 0, ...widthHeight].join(' ')
|
|
43
24
|
};
|
|
44
25
|
if (width && height) {
|
|
45
26
|
Object.assign(attrs, {
|
|
46
|
-
width
|
|
47
|
-
height
|
|
27
|
+
width,
|
|
28
|
+
height
|
|
48
29
|
});
|
|
49
30
|
} else {
|
|
50
|
-
|
|
31
|
+
const dims = {
|
|
51
32
|
width: widthHeight[0],
|
|
52
33
|
height: widthHeight[1]
|
|
53
34
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
attrs[given] = width || height ||
|
|
35
|
+
const given = width ? 'width' : 'height';
|
|
36
|
+
const computed = given === 'width' ? 'height' : 'width';
|
|
37
|
+
attrs[given] = width || height || iconSize[size] || size;
|
|
57
38
|
attrs[computed] = attrs[given] * (dims[computed] / dims[given]);
|
|
58
39
|
}
|
|
59
40
|
attrs.style = {
|
|
60
41
|
display: 'inline-block',
|
|
61
|
-
fill
|
|
42
|
+
fill,
|
|
62
43
|
userSelect: 'none',
|
|
63
|
-
verticalAlign:
|
|
44
|
+
verticalAlign: iconAlign[verticalAlign] || verticalAlign
|
|
64
45
|
};
|
|
65
|
-
|
|
66
|
-
return Element != null ? /*#__PURE__*/(
|
|
67
|
-
className: className
|
|
68
|
-
|
|
46
|
+
const Element = iconComponents[icon];
|
|
47
|
+
return Element != null ? /*#__PURE__*/_jsx(Element, {
|
|
48
|
+
className: className,
|
|
49
|
+
...attrs,
|
|
50
|
+
...otherProps
|
|
51
|
+
}) : null;
|
|
69
52
|
}
|
|
70
|
-
Icon.propTypes =
|
|
53
|
+
Icon.propTypes = propTypes;
|