@planningcenter/tapestry-react 2.0.0 → 2.1.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/cjs/Avatar/Avatar.js +3 -1
- package/dist/cjs/Box/Box.js +2 -2
- package/dist/cjs/Button/Button.js +2 -2
- package/dist/cjs/Calendar/Day.js +1 -0
- package/dist/cjs/Card/Card.js +14 -24
- package/dist/cjs/Card/Section.js +28 -0
- package/dist/cjs/Checkbox/Checkbox.js +1 -1
- package/dist/cjs/Collapse/Collapse.js +10 -9
- package/dist/cjs/Collapse/Collapse.test.js +56 -0
- package/dist/cjs/DataTable/components/Icon.js +4 -4
- package/dist/cjs/DragDrop/DragDrop.js +1 -1
- package/dist/cjs/GridView/GridView.js +2 -2
- package/dist/cjs/HelperDrawer/HelperDrawer.js +8 -8
- package/dist/cjs/Icon/Path.js +1 -0
- package/dist/cjs/Icon/Status.js +24 -17
- package/dist/cjs/Pagination/Pagination.js +99 -83
- package/dist/cjs/Scrim/Scrim.js +1 -1
- package/dist/cjs/Select/Inline.js +1 -0
- package/dist/cjs/Select/Option.js +1 -1
- package/dist/cjs/Select/OptionGroup.js +1 -3
- package/dist/cjs/Select/Value.js +1 -0
- package/dist/cjs/Select/constants.js +2 -2
- package/dist/cjs/Sidebar/Sidebar.js +5 -5
- package/dist/cjs/Spinner/Spinner.js +3 -3
- package/dist/cjs/StackView/StackView.js +2 -2
- package/dist/cjs/Table/Table.js +2 -2
- package/dist/cjs/Text/Text.js +2 -2
- package/dist/cjs/ThemeProvider/ThemeProvider.js +4 -18
- package/dist/cjs/TileView/TileView.js +2 -2
- package/dist/cjs/system/box-sizes.js +6 -3
- package/dist/cjs/system/use-css.js +2 -2
- package/dist/cjs/system/utils.js +2 -2
- package/dist/esm/Avatar/Avatar.js +3 -3
- package/dist/esm/Box/Box.js +1 -1
- package/dist/esm/Button/Button.js +2 -2
- package/dist/esm/Calendar/Day.js +1 -0
- package/dist/esm/Card/Card.js +12 -22
- package/dist/esm/Card/Section.js +15 -0
- package/dist/esm/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Collapse/Collapse.js +3 -2
- package/dist/esm/Collapse/Collapse.test.js +53 -0
- package/dist/esm/DataTable/components/Icon.js +1 -1
- package/dist/esm/DragDrop/DragDrop.js +1 -1
- package/dist/esm/GridView/GridView.js +1 -1
- package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
- package/dist/esm/Icon/Path.js +1 -0
- package/dist/esm/Icon/Status.js +24 -17
- package/dist/esm/Pagination/Pagination.js +96 -78
- package/dist/esm/Scrim/Scrim.js +1 -1
- package/dist/esm/Select/Inline.js +1 -0
- package/dist/esm/Select/Option.js +1 -1
- package/dist/esm/Select/OptionGroup.js +1 -2
- package/dist/esm/Select/Value.js +1 -0
- package/dist/esm/Select/constants.js +2 -2
- package/dist/esm/Sidebar/Sidebar.js +1 -1
- package/dist/esm/Spinner/Spinner.js +1 -1
- package/dist/esm/StackView/StackView.js +1 -1
- package/dist/esm/Table/Table.js +1 -1
- package/dist/esm/Text/Text.js +1 -1
- package/dist/esm/ThemeProvider/ThemeProvider.js +3 -15
- package/dist/esm/TileView/TileView.js +1 -1
- package/dist/esm/system/box-sizes.js +6 -3
- package/dist/esm/system/use-css.js +1 -1
- package/dist/esm/system/utils.js +1 -1
- package/dist/types/Avatar/Avatar.d.ts +19 -0
- package/dist/types/Box/Box.d.ts +5 -2
- package/dist/types/Button/Button.d.ts +22 -14
- package/dist/types/Button/Input.d.ts +1 -1
- package/dist/types/Card/Card.d.ts +2 -8
- package/dist/types/Card/Section.d.ts +11 -0
- package/dist/types/ChurchCenterStatus/ChurchCenterStatus.d.ts +0 -1
- package/dist/types/Collapse/Collapse.test.d.ts +1 -0
- package/dist/types/Divider/Divider.d.ts +0 -1
- package/dist/types/FilterLayout/FilterLayout.d.ts +0 -1
- package/dist/types/GridView/GridView.d.ts +4 -1
- package/dist/types/Pagination/Pagination.d.ts +23 -0
- package/dist/types/Popover/Popover.d.ts +3 -3
- package/dist/types/Portal/Portal.d.ts +4 -3
- package/dist/types/Spinner/Spinner.d.ts +0 -1
- package/dist/types/StackView/StackView.d.ts +4 -1
- package/dist/types/Tab/Tab.d.ts +0 -1
- package/dist/types/Text/Text.d.ts +4 -1
- package/dist/types/TileView/TileView.d.ts +4 -1
- package/package.json +12 -15
- package/src/Avatar/Avatar.mdx +2 -2
- package/src/Avatar/{Avatar.js → Avatar.tsx} +10 -5
- package/src/Badge/Badge.mdx +2 -0
- package/src/Badge/Status.mdx +1 -0
- package/src/Box/Box.tsx +2 -1
- package/src/Button/Button.mdx +1 -0
- package/src/Button/Button.tsx +13 -5
- package/src/Button/Input.mdx +1 -0
- package/src/Calendar/Calendar.mdx +1 -0
- package/src/Calendar/Day.js +42 -2
- package/src/Calendar/Day.mdx +6 -0
- package/src/Card/Card.mdx +1 -10
- package/src/Card/Card.tsx +8 -16
- package/src/Card/Section.mdx +19 -0
- package/src/Card/Section.tsx +25 -0
- package/src/Checkbox/Checkbox.js +1 -1
- package/src/Collapse/Collapse.js +5 -2
- package/src/Collapse/Collapse.test.tsx +42 -0
- package/src/Combobox/Combobox.mdx +1 -1
- package/src/DataTable/components/Icon.js +1 -1
- package/src/DragDrop/DragDrop.js +1 -1
- package/src/Drawer/Drawer.mdx +1 -0
- package/src/EditActions/EditActions.mdx +1 -0
- package/src/FieldSet/FieldSet.mdx +1 -0
- package/src/GridView/GridView.tsx +1 -1
- package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
- package/src/HelperDrawer/HelperDrawer.js +1 -1
- package/src/Highlight/Highlight.mdx +1 -0
- package/src/Icon/Icon.mdx +65 -35
- package/src/Icon/Path.js +2 -0
- package/src/Icon/Path.mdx +34 -0
- package/src/Icon/Status.js +23 -14
- package/src/Icon/Status.mdx +17 -0
- package/src/Input/Inline.mdx +1 -0
- package/src/Input/Input.mdx +1 -0
- package/src/Input/InputBox.mdx +1 -0
- package/src/Input/InputField.mdx +1 -0
- package/src/Input/InputLabel.mdx +1 -0
- package/src/PagerView/PagerView.mdx +1 -1
- package/src/Pagination/Pagination.mdx +0 -1
- package/src/Pagination/Pagination.tsx +163 -0
- package/src/Popover/Popover.tsx +1 -1
- package/src/Portal/Portal.tsx +2 -0
- package/src/Progress/Progress.mdx +1 -0
- package/src/RangeSlider/RangeSlider.mdx +1 -0
- package/src/Scrim/Scrim.tsx +1 -1
- package/src/Section/Section.mdx +1 -0
- package/src/Select/Inline.js +21 -1
- package/src/Select/Inline.mdx +27 -0
- package/src/Select/Option.js +1 -1
- package/src/Select/Option.mdx +30 -0
- package/src/Select/OptionGroup.js +9 -3
- package/src/Select/OptionGroup.mdx +25 -0
- package/src/Select/Select.mdx +2 -99
- package/src/Select/Value.js +2 -0
- package/src/Select/Value.mdx +67 -0
- package/src/Select/constants.js +2 -2
- package/src/Sidebar/Sidebar.js +1 -1
- package/src/Spinner/Spinner.mdx +1 -0
- package/src/Spinner/Spinner.tsx +1 -1
- package/src/StackView/StackView.tsx +1 -1
- package/src/StepperField/StepperField.mdx +1 -0
- package/src/StepperProgress/StepperProgress.mdx +1 -0
- package/src/Table/Table.js +1 -1
- package/src/Text/Text.mdx +1 -0
- package/src/Text/Text.tsx +1 -1
- package/src/ThemeProvider/ThemeProvider.tsx +2 -13
- package/src/TileView/TileView.tsx +1 -1
- package/src/system/README.md +1 -1
- package/src/system/box-sizes.js +6 -3
- package/src/system/use-css.js +1 -1
- package/src/system/utils.js +1 -1
- package/src/Pagination/Pagination.js +0 -145
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { StackView } from '../StackView';
|
|
5
|
+
export function Section(_ref) {
|
|
6
|
+
var subdued = _ref.subdued,
|
|
7
|
+
restProps = _objectWithoutPropertiesLoose(_ref, ["subdued"]);
|
|
8
|
+
|
|
9
|
+
return /*#__PURE__*/React.createElement(StackView, _extends({
|
|
10
|
+
width: "100%",
|
|
11
|
+
padding: 1,
|
|
12
|
+
backgroundColor: subdued ? 'surfaceSecondary' : undefined
|
|
13
|
+
}, restProps));
|
|
14
|
+
}
|
|
15
|
+
Section.displayName = 'Card.Section';
|
|
@@ -20,7 +20,7 @@ var iconPaths = {
|
|
|
20
20
|
|
|
21
21
|
var _ref2 = /*#__PURE__*/React.createElement(Link, {
|
|
22
22
|
external: true,
|
|
23
|
-
to: "https://
|
|
23
|
+
to: "https://planningcenter.github.io/tapestry-react/checkbox#label",
|
|
24
24
|
weight: 700
|
|
25
25
|
}, "label");
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
/** @jsxRuntime classic */
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { jsx } from '@emotion/
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
8
|
import { useLayoutEffect, useRef, useState } from 'react';
|
|
9
9
|
var transition = 'height 200ms ease-out';
|
|
10
10
|
|
|
@@ -104,7 +104,8 @@ function Collapse(props) {
|
|
|
104
104
|
return jsx("div", _extends({
|
|
105
105
|
ref: ref,
|
|
106
106
|
css: {
|
|
107
|
-
transition: instantRender ? undefined : transition
|
|
107
|
+
transition: instantRender ? undefined : transition,
|
|
108
|
+
visibility: open ? 'visible' : 'hidden'
|
|
108
109
|
}
|
|
109
110
|
}, restProps), renderChildren ? children : null);
|
|
110
111
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { isInaccessible } from '@testing-library/dom';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
6
|
+
import { Box, Button, Collapse } from '..';
|
|
7
|
+
|
|
8
|
+
var _ref = /*#__PURE__*/React.createElement(Button, {
|
|
9
|
+
"data-testid": "child"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('Collapse', function () {
|
|
13
|
+
describe('Render children', function () {
|
|
14
|
+
var Component = function Component() {
|
|
15
|
+
var _useState = useState(false),
|
|
16
|
+
open = _useState[0],
|
|
17
|
+
setOpen = _useState[1];
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Button, {
|
|
20
|
+
"data-testid": "toggle",
|
|
21
|
+
onClick: function onClick() {
|
|
22
|
+
return setOpen(!open);
|
|
23
|
+
}
|
|
24
|
+
}, "Toggle"), /*#__PURE__*/React.createElement(Collapse, {
|
|
25
|
+
open: open
|
|
26
|
+
}, _ref));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var _ref2 = /*#__PURE__*/React.createElement(Component, null);
|
|
30
|
+
|
|
31
|
+
it('should render collapsed children', function () {
|
|
32
|
+
render(_ref2);
|
|
33
|
+
expect(screen.getByTestId('child')).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
var _ref3 = /*#__PURE__*/React.createElement(Component, null);
|
|
37
|
+
|
|
38
|
+
it('should hide children from accessibility tree when collapsed', function () {
|
|
39
|
+
render(_ref3);
|
|
40
|
+
expect(isInaccessible(screen.getByTestId('toggle'))).toBe(false);
|
|
41
|
+
expect(isInaccessible(screen.getByTestId('child'))).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
var _ref4 = /*#__PURE__*/React.createElement(Component, null);
|
|
45
|
+
|
|
46
|
+
it('should include children in accessibility tree when open', function () {
|
|
47
|
+
render(_ref4);
|
|
48
|
+
userEvent.click(screen.getByTestId('toggle'));
|
|
49
|
+
expect(isInaccessible(screen.getByTestId('toggle'))).toBe(false);
|
|
50
|
+
expect(isInaccessible(screen.getByTestId('child'))).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -4,7 +4,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
/** @jsxRuntime classic */
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { jsx } from '@emotion/
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
8
|
import { useThemeValue } from '../../system';
|
|
9
9
|
var sizes = {
|
|
10
10
|
xxs: '8px',
|
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
import React, { Children, Fragment, createElement, createContext, useContext, useEffect } from 'react';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
|
-
import * as RBDND from 'react-beautiful-dnd';
|
|
11
|
+
import * as RBDND from '@planningcenter/react-beautiful-dnd';
|
|
12
12
|
import mitt from 'mitt';
|
|
13
13
|
import StackView from '../StackView';
|
|
14
14
|
var DragDropContext = /*#__PURE__*/createContext(false);
|
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
/** @jsxRuntime classic */
|
|
10
10
|
|
|
11
11
|
/** @jsx jsx */
|
|
12
|
-
import { jsx } from '@emotion/
|
|
12
|
+
import { jsx } from '@emotion/react';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import splitStyles from '../system/split-styles';
|
|
15
15
|
import { spacingValue } from '../system';
|
|
@@ -4,7 +4,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
/** @jsxRuntime classic */
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { jsx } from '@emotion/
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
8
|
import { useCallback, useEffect, useState } from 'react';
|
|
9
9
|
import Button from '../Button';
|
|
10
10
|
import Card from '../Card';
|
package/dist/esm/Icon/Path.js
CHANGED
package/dist/esm/Icon/Status.js
CHANGED
|
@@ -4,9 +4,21 @@ import React from 'react';
|
|
|
4
4
|
import Icon from './Icon';
|
|
5
5
|
import Path from './Path';
|
|
6
6
|
var STATUS_VARIANTS = {
|
|
7
|
-
confirmed:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
confirmed: {
|
|
8
|
+
iconColor: 'success',
|
|
9
|
+
iconFilled: 'general.checkCircle',
|
|
10
|
+
iconOutlined: 'general.outlinedCircleCheck'
|
|
11
|
+
},
|
|
12
|
+
unconfirmed: {
|
|
13
|
+
iconColor: 'warning',
|
|
14
|
+
iconFilled: 'general.questionCircle',
|
|
15
|
+
iconOutlined: 'general.outlinedQuestionCircle'
|
|
16
|
+
},
|
|
17
|
+
declined: {
|
|
18
|
+
iconColor: 'error',
|
|
19
|
+
iconFilled: 'general.xCircle',
|
|
20
|
+
iconOutlined: 'general.outlinedXCircle'
|
|
21
|
+
}
|
|
10
22
|
};
|
|
11
23
|
|
|
12
24
|
function Status(props) {
|
|
@@ -15,25 +27,20 @@ function Status(props) {
|
|
|
15
27
|
variantFilled = props.variantFilled,
|
|
16
28
|
restProps = _objectWithoutPropertiesLoose(props, ["color", "variant", "variantFilled"]);
|
|
17
29
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
if (variantName && variantFilled) {
|
|
27
|
-
variantName += '-filled';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
+
var _STATUS_VARIANTS$vari = STATUS_VARIANTS[variant],
|
|
31
|
+
iconOutlined = _STATUS_VARIANTS$vari.iconOutlined,
|
|
32
|
+
iconFilled = _STATUS_VARIANTS$vari.iconFilled,
|
|
33
|
+
iconColor = _STATUS_VARIANTS$vari.iconColor;
|
|
34
|
+
var variantColor = color || iconColor;
|
|
35
|
+
var variantIcon = variantFilled ? iconFilled : iconOutlined;
|
|
30
36
|
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
31
|
-
name:
|
|
32
|
-
color:
|
|
37
|
+
name: variantIcon,
|
|
38
|
+
color: variantColor
|
|
33
39
|
}, restProps), /*#__PURE__*/React.createElement(Path, {
|
|
34
40
|
name: "tapestry.radio0",
|
|
35
41
|
color: color
|
|
36
42
|
}));
|
|
37
43
|
}
|
|
38
44
|
|
|
45
|
+
Status.displayName = 'Icon.Status';
|
|
39
46
|
export default Status;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
6
10
|
import Box from '../Box';
|
|
7
11
|
import Button from '../Button';
|
|
12
|
+
import Group from '../Group';
|
|
8
13
|
import StackView from '../StackView';
|
|
9
14
|
import { range } from '../utils';
|
|
15
|
+
import { useWindowWidth } from '@react-hook/window-size';
|
|
16
|
+
import { useThemeValue } from '../system';
|
|
10
17
|
|
|
11
18
|
function getVisiblePages(currentPage, totalPages, visiblePages) {
|
|
12
|
-
var start = Math.max(1, Math.min(totalPages - visiblePages + 1, currentPage - visiblePages / 2 + 1));
|
|
19
|
+
var start = Math.max(1, Math.min(totalPages - visiblePages + 1, Math.floor(currentPage - visiblePages / 2 + 1)));
|
|
13
20
|
var stop = Math.min(totalPages, start + visiblePages - 1);
|
|
14
21
|
var primaryWindow = range(start, stop + 1);
|
|
15
22
|
var showFirstPage = start > 1;
|
|
@@ -30,104 +37,115 @@ function getVisiblePages(currentPage, totalPages, visiblePages) {
|
|
|
30
37
|
return first.concat(primaryWindow).concat(last);
|
|
31
38
|
}
|
|
32
39
|
|
|
33
|
-
var
|
|
34
|
-
|
|
40
|
+
var NavButton = function NavButton(_ref) {
|
|
41
|
+
var disabled = _ref.disabled,
|
|
42
|
+
iconName = _ref.iconName,
|
|
43
|
+
props = _objectWithoutPropertiesLoose(_ref, ["disabled", "iconName"]);
|
|
44
|
+
|
|
45
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
46
|
+
backgroundColor: disabled ? '#f7f7f7' : '#f2f2f2',
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
icon: {
|
|
49
|
+
color: disabled ? '#cfcfcf' : undefined,
|
|
50
|
+
name: iconName,
|
|
51
|
+
size: 'xs'
|
|
52
|
+
},
|
|
53
|
+
opacity: 1,
|
|
54
|
+
shrink: 0,
|
|
55
|
+
square: true,
|
|
56
|
+
variant: "fill"
|
|
57
|
+
}, props));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default function Pagination(_ref2) {
|
|
61
|
+
var _ref2$activeColor = _ref2.activeColor,
|
|
62
|
+
activeColor = _ref2$activeColor === void 0 ? '#5b8bf7' : _ref2$activeColor,
|
|
63
|
+
currentPage = _ref2.currentPage,
|
|
64
|
+
_ref2$onPageChange = _ref2.onPageChange,
|
|
65
|
+
onPageChange = _ref2$onPageChange === void 0 ? function () {
|
|
66
|
+
return null;
|
|
67
|
+
} : _ref2$onPageChange,
|
|
68
|
+
visiblePages = _ref2.visiblePages,
|
|
69
|
+
_ref2$totalPages = _ref2.totalPages,
|
|
70
|
+
totalPages = _ref2$totalPages === void 0 ? 0 : _ref2$totalPages,
|
|
71
|
+
restProps = _objectWithoutPropertiesLoose(_ref2, ["activeColor", "currentPage", "onPageChange", "visiblePages", "totalPages"]);
|
|
35
72
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
73
|
+
var _useThemeValue = useThemeValue('breakpoints'),
|
|
74
|
+
xsBreakpoint = _useThemeValue.xs;
|
|
39
75
|
|
|
40
|
-
var
|
|
76
|
+
var currentWidth = useWindowWidth();
|
|
41
77
|
|
|
42
|
-
|
|
78
|
+
function renderGap(key) {
|
|
43
79
|
return /*#__PURE__*/React.createElement(Box, {
|
|
44
80
|
key: key,
|
|
45
81
|
userSelect: "none",
|
|
46
82
|
cursor: "default",
|
|
47
83
|
children: "\u2026"
|
|
48
84
|
});
|
|
49
|
-
}
|
|
85
|
+
}
|
|
50
86
|
|
|
51
|
-
|
|
52
|
-
var isActive =
|
|
53
|
-
|
|
87
|
+
function renderPageLink(number) {
|
|
88
|
+
var isActive = currentPage === number;
|
|
89
|
+
var outlineStyle = {
|
|
90
|
+
border: '1px solid #5b8bf7',
|
|
91
|
+
color: '#5b8bf7'
|
|
92
|
+
};
|
|
93
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
54
94
|
key: number,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
95
|
+
focus: _objectSpread({
|
|
96
|
+
backgroundColor: '#f4f8fd'
|
|
97
|
+
}, outlineStyle),
|
|
98
|
+
fontWeight: 500,
|
|
99
|
+
hover: _objectSpread({
|
|
100
|
+
backgroundColor: '#ffffff'
|
|
101
|
+
}, outlineStyle),
|
|
102
|
+
onClick: onPageChange.bind(null, number),
|
|
59
103
|
shrink: 0,
|
|
60
|
-
square: true
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
104
|
+
square: true,
|
|
105
|
+
title: number,
|
|
106
|
+
variant: isActive ? 'fill' : 'naked'
|
|
107
|
+
}, isActive && {
|
|
108
|
+
backgroundColor: '#5b8bf7',
|
|
109
|
+
color: 'white'
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
66
112
|
|
|
67
|
-
|
|
113
|
+
function renderPageLinks() {
|
|
114
|
+
var visiblePagesToShow = currentWidth <= xsBreakpoint ? visiblePages || 5 : visiblePages || 7;
|
|
115
|
+
var pages = getVisiblePages(currentPage, totalPages, visiblePagesToShow);
|
|
68
116
|
return pages.map(function (page, index) {
|
|
69
|
-
return page === '...' ?
|
|
117
|
+
return page === '...' ? renderGap(page + index) : renderPageLink(page);
|
|
70
118
|
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
_proto.render = function render() {
|
|
74
|
-
var _this$props = this.props,
|
|
75
|
-
activeColor = _this$props.activeColor,
|
|
76
|
-
currentPage = _this$props.currentPage,
|
|
77
|
-
totalPages = _this$props.totalPages,
|
|
78
|
-
visiblePages = _this$props.visiblePages,
|
|
79
|
-
onPageChange = _this$props.onPageChange,
|
|
80
|
-
restProps = _objectWithoutPropertiesLoose(_this$props, ["activeColor", "currentPage", "totalPages", "visiblePages", "onPageChange"]);
|
|
81
|
-
|
|
82
|
-
if (totalPages <= 1) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
119
|
+
}
|
|
85
120
|
|
|
121
|
+
if (totalPages <= 1) {
|
|
122
|
+
return null;
|
|
123
|
+
} else {
|
|
86
124
|
return /*#__PURE__*/React.createElement(StackView, _extends({
|
|
87
|
-
axis: "horizontal",
|
|
88
125
|
alignment: "center",
|
|
126
|
+
axis: "horizontal",
|
|
89
127
|
distribution: "center",
|
|
90
|
-
|
|
128
|
+
overflow: "auto",
|
|
91
129
|
paddingVertical: 1,
|
|
92
130
|
shrink: 0,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
131
|
+
spacing: 0.5,
|
|
132
|
+
width: "100%"
|
|
133
|
+
}, restProps), /*#__PURE__*/React.createElement(Group, {
|
|
134
|
+
spacing: 0.5
|
|
135
|
+
}, /*#__PURE__*/React.createElement(NavButton, {
|
|
96
136
|
disabled: currentPage === 1,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
size: 'xs'
|
|
100
|
-
},
|
|
137
|
+
iconName: "general.leftChevron",
|
|
138
|
+
onClick: onPageChange.bind(null, currentPage - 1),
|
|
101
139
|
tooltip: {
|
|
102
140
|
title: 'Previous Page'
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
shrink: 0
|
|
106
|
-
}), this.renderPageLinks(), /*#__PURE__*/React.createElement(Button, {
|
|
107
|
-
onClick: onPageChange.bind(null, currentPage + 1),
|
|
141
|
+
}
|
|
142
|
+
}), /*#__PURE__*/React.createElement(NavButton, {
|
|
108
143
|
disabled: currentPage === totalPages,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
size: 'xs'
|
|
112
|
-
},
|
|
144
|
+
iconName: "general.rightChevron",
|
|
145
|
+
onClick: onPageChange.bind(null, currentPage + 1),
|
|
113
146
|
tooltip: {
|
|
114
147
|
title: 'Next Page'
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
return Pagination;
|
|
122
|
-
}(Component);
|
|
123
|
-
|
|
124
|
-
_defineProperty(Pagination, "defaultProps", {
|
|
125
|
-
activeColor: 'primary',
|
|
126
|
-
onPageChange: function onPageChange() {
|
|
127
|
-
return null;
|
|
128
|
-
},
|
|
129
|
-
visiblePages: 8,
|
|
130
|
-
totalPages: 0
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
export default Pagination;
|
|
148
|
+
}
|
|
149
|
+
})), renderPageLinks());
|
|
150
|
+
}
|
|
151
|
+
}
|
package/dist/esm/Scrim/Scrim.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import StackView from '../StackView';
|
|
4
|
-
var Scrim = /*#__PURE__*/React.forwardRef(function (props) {
|
|
4
|
+
var Scrim = /*#__PURE__*/React.forwardRef(function (props, _ref) {
|
|
5
5
|
React.useLayoutEffect(function () {
|
|
6
6
|
document.body.style.overflow = 'hidden';
|
|
7
7
|
return function () {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import { Component } from 'react';
|
|
4
|
-
import { OPTIONGROUP_DISPLAY_NAME } from './constants';
|
|
5
4
|
|
|
6
5
|
var OptionGroup = /*#__PURE__*/function (_Component) {
|
|
7
6
|
_inheritsLoose(OptionGroup, _Component);
|
|
@@ -19,6 +18,6 @@ var OptionGroup = /*#__PURE__*/function (_Component) {
|
|
|
19
18
|
return OptionGroup;
|
|
20
19
|
}(Component);
|
|
21
20
|
|
|
22
|
-
_defineProperty(OptionGroup, "displayName",
|
|
21
|
+
_defineProperty(OptionGroup, "displayName", 'Select.OptionGroup');
|
|
23
22
|
|
|
24
23
|
export default OptionGroup;
|
package/dist/esm/Select/Value.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export var SELECT_DISPLAY_NAME = 'Select';
|
|
2
|
-
export var OPTIONGROUP_DISPLAY_NAME = 'OptionGroup';
|
|
3
|
-
export var OPTION_DISPLAY_NAME = 'Option';
|
|
2
|
+
export var OPTIONGROUP_DISPLAY_NAME = 'Select.OptionGroup';
|
|
3
|
+
export var OPTION_DISPLAY_NAME = 'Select.Option';
|
|
@@ -4,7 +4,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
/** @jsxRuntime classic */
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { jsx } from '@emotion/
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
8
|
import { Children } from 'react';
|
|
9
9
|
import StickyBox from 'react-sticky-box';
|
|
10
10
|
import { css } from '../system';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { keyframes } from '@emotion/
|
|
4
|
+
import { keyframes } from '@emotion/react';
|
|
5
5
|
import { Box } from '../Box';
|
|
6
6
|
import { useThemeProps } from '../system';
|
|
7
7
|
var rotate = keyframes({
|
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
/** @jsxRuntime classic */
|
|
10
10
|
|
|
11
11
|
/** @jsx jsx */
|
|
12
|
-
import { jsx } from '@emotion/
|
|
12
|
+
import { jsx } from '@emotion/react';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import splitStyles from '../system/split-styles';
|
|
15
15
|
import { spacingValue } from '../system';
|
package/dist/esm/Table/Table.js
CHANGED
|
@@ -9,7 +9,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
10
10
|
|
|
11
11
|
import React, { PureComponent, Children, Fragment } from 'react';
|
|
12
|
-
import { Global } from '@emotion/
|
|
12
|
+
import { Global } from '@emotion/react';
|
|
13
13
|
import { camelCase, snakeCase } from 'lodash';
|
|
14
14
|
import Button from '../Button';
|
|
15
15
|
import DragDrop from '../DragDrop';
|
package/dist/esm/Text/Text.js
CHANGED
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
/** @jsxRuntime classic */
|
|
10
10
|
|
|
11
11
|
/** @jsx jsx */
|
|
12
|
-
import { jsx } from '@emotion/
|
|
12
|
+
import { jsx } from '@emotion/react';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useThemeProps } from '../system';
|
|
15
15
|
import splitStyles from '../system/split-styles';
|
|
@@ -5,8 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
6
|
|
|
7
7
|
import React, { useLayoutEffect, useState } from 'react';
|
|
8
|
-
import { ThemeProvider as EmotionThemeProvider } from 'emotion
|
|
9
|
-
import { CacheProvider } from '@emotion/
|
|
8
|
+
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
|
9
|
+
import { CacheProvider } from '@emotion/react';
|
|
10
10
|
import createCache from '@emotion/cache';
|
|
11
11
|
import { merge } from 'lodash';
|
|
12
12
|
import defaultTheme from '../system/default-theme';
|
|
@@ -15,19 +15,7 @@ import { objectToCSSProperties, shallowEqual } from '../utils';
|
|
|
15
15
|
import { setRootStyles, styleReset } from './styles';
|
|
16
16
|
var STORAGE_KEY = 'tapestry-react-theme';
|
|
17
17
|
export var cache = createCache({
|
|
18
|
-
key: 'tapestry-react'
|
|
19
|
-
prefix: function prefix(key) {
|
|
20
|
-
switch (key) {
|
|
21
|
-
case 'appearance':
|
|
22
|
-
case 'user-select':
|
|
23
|
-
case 'position':
|
|
24
|
-
case ':placeholder':
|
|
25
|
-
return true;
|
|
26
|
-
|
|
27
|
-
default:
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
18
|
+
key: 'tapestry-react'
|
|
31
19
|
});
|
|
32
20
|
export var themeStorage = {
|
|
33
21
|
get: function get() {
|
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
/** @jsxRuntime classic */
|
|
10
10
|
|
|
11
11
|
/** @jsx jsx */
|
|
12
|
-
import { jsx } from '@emotion/
|
|
12
|
+
import { jsx } from '@emotion/react';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import splitStyles from '../system/split-styles';
|
|
15
15
|
import { spacingValue } from '../system';
|
|
@@ -18,7 +18,7 @@ export var boxSizes = {
|
|
|
18
18
|
radius: 3
|
|
19
19
|
},
|
|
20
20
|
md: {
|
|
21
|
-
boxSize: 4,
|
|
21
|
+
boxSize: 4.5,
|
|
22
22
|
fontSize: 4,
|
|
23
23
|
lineHeight: 3,
|
|
24
24
|
paddingHorizontalDense: 1,
|
|
@@ -27,7 +27,7 @@ export var boxSizes = {
|
|
|
27
27
|
radius: 4
|
|
28
28
|
},
|
|
29
29
|
lg: {
|
|
30
|
-
boxSize:
|
|
30
|
+
boxSize: 6,
|
|
31
31
|
fontSize: 3,
|
|
32
32
|
lineHeight: 4,
|
|
33
33
|
paddingHorizontalDense: 1,
|
|
@@ -36,13 +36,16 @@ export var boxSizes = {
|
|
|
36
36
|
radius: 5
|
|
37
37
|
},
|
|
38
38
|
xl: {
|
|
39
|
-
boxSize:
|
|
39
|
+
boxSize: 9,
|
|
40
40
|
fontSize: 1,
|
|
41
41
|
lineHeight: 5,
|
|
42
42
|
paddingHorizontalDense: 2,
|
|
43
43
|
paddingHorizontal: 2.25,
|
|
44
44
|
paddingVertical: 1.5,
|
|
45
45
|
radius: 6
|
|
46
|
+
},
|
|
47
|
+
xxl: {
|
|
48
|
+
boxSize: 14
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
51
|
export function getBoxSize(size) {
|
package/dist/esm/system/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
6
|
|
|
7
7
|
import { useContext, useCallback } from 'react';
|
|
8
|
-
import { ThemeContext } from '@emotion/
|
|
8
|
+
import { ThemeContext } from '@emotion/react';
|
|
9
9
|
import { darken, getLuminance, lighten, parseToRgb } from 'polished';
|
|
10
10
|
import { get } from 'lodash';
|
|
11
11
|
import { getColor } from './colors';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare type AvatarProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Controls the size of the avatar.
|
|
4
|
+
*/
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
6
|
+
/**
|
|
7
|
+
* The source of the image to display.
|
|
8
|
+
*/
|
|
9
|
+
source?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Adds a colored ring with padding around the avatar. Accepts a valid color string.
|
|
12
|
+
*/
|
|
13
|
+
status?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Displays a user's avatar in a circle.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Avatar({ size, source, status, ...restProps }: AvatarProps): JSX.Element;
|
|
19
|
+
export default Avatar;
|