@planningcenter/tapestry-react 2.6.0-rc.2 → 2.6.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DataTable/components/Icon.js +1 -1
- package/dist/cjs/DragDrop/DragDrop.js +7 -0
- package/dist/cjs/Portal/Portal.js +2 -0
- package/dist/cjs/ThemeProvider/ThemeProvider.js +11 -2
- package/dist/cjs/ThemeProvider/styles.js +1 -1
- package/dist/cjs/index.d.js +70 -25
- package/dist/esm/DataTable/components/Icon.js +1 -1
- package/dist/esm/DragDrop/DragDrop.js +5 -0
- package/dist/esm/Portal/Portal.js +2 -0
- package/dist/esm/ThemeProvider/ThemeProvider.js +8 -2
- package/dist/esm/ThemeProvider/styles.js +1 -1
- package/dist/esm/index.d.js +39 -6
- package/dist/types/Divider/Divider.d.ts +2 -2
- package/dist/types/Spinner/Spinner.d.ts +3 -1
- package/dist/types/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/dist/types/index.d.ts +74 -5
- package/package.json +1 -1
- package/src/DataTable/components/Icon.js +1 -1
- package/src/Divider/Divider.tsx +2 -2
- package/src/DragDrop/DragDrop.js +5 -0
- package/src/Icon/Icon.mdx +45 -47
- package/src/Portal/Portal.tsx +3 -0
- package/src/RangeSlider/RangeSlider.mdx +10 -12
- package/src/Spinner/Spinner.tsx +2 -1
- package/src/ThemeProvider/ThemeProvider.tsx +9 -2
- package/src/ThemeProvider/styles.ts +4 -3
- package/src/index.d.ts +74 -5
- package/src/.DS_Store +0 -0
|
@@ -21,6 +21,10 @@ var RBDND = _interopRequireWildcard(require("@planningcenter/react-beautiful-dnd
|
|
|
21
21
|
|
|
22
22
|
var _mitt = _interopRequireDefault(require("mitt"));
|
|
23
23
|
|
|
24
|
+
var _styles = require("../ThemeProvider/styles");
|
|
25
|
+
|
|
26
|
+
var _system = require("../system");
|
|
27
|
+
|
|
24
28
|
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
25
29
|
|
|
26
30
|
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; }
|
|
@@ -51,10 +55,13 @@ function Provider(_ref) {
|
|
|
51
55
|
_onDragEnd = _ref.onDragEnd,
|
|
52
56
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["onDragStart", "onDragEnd"]);
|
|
53
57
|
var hasParentDragDrop = useDragDrop();
|
|
58
|
+
var themeId = (0, _system.useThemeValue)('id');
|
|
54
59
|
|
|
55
60
|
if (typeof document !== 'undefined' && portalNode === null) {
|
|
56
61
|
portalNode = document.createElement('div');
|
|
57
62
|
portalNode.id = 'rbd-portal';
|
|
63
|
+
portalNode.className = 'tapestry-react-reset';
|
|
64
|
+
portalNode.setAttribute((0, _styles.getThemeDataAttribute)(themeId), 'true');
|
|
58
65
|
document.body.appendChild(portalNode);
|
|
59
66
|
}
|
|
60
67
|
|
|
@@ -130,6 +130,8 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
130
130
|
_this2._portalNode.setAttribute(key, restProps[key]);
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
+
this._portalNode.classList.add('tapestry-react-reset');
|
|
134
|
+
|
|
133
135
|
this._portalNode.setAttribute((0, _styles.getThemeDataAttribute)(this.context.id), 'true');
|
|
134
136
|
|
|
135
137
|
if (style) {
|
|
@@ -8,6 +8,10 @@ exports.__esModule = true;
|
|
|
8
8
|
exports.ThemeProvider = ThemeProvider;
|
|
9
9
|
exports.themeInitializerScript = exports.themeStorage = exports.cache = void 0;
|
|
10
10
|
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
|
|
13
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
14
|
+
|
|
11
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
16
|
|
|
13
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -18,6 +22,8 @@ var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
|
18
22
|
|
|
19
23
|
var _lodash = require("lodash");
|
|
20
24
|
|
|
25
|
+
var _Box = require("../Box");
|
|
26
|
+
|
|
21
27
|
var _defaultTheme = _interopRequireDefault(require("../system/default-theme"));
|
|
22
28
|
|
|
23
29
|
var _system = require("../system");
|
|
@@ -79,7 +85,8 @@ function ThemeProvider(_ref) {
|
|
|
79
85
|
|
|
80
86
|
var _ref$theme = _ref.theme,
|
|
81
87
|
theme = _ref$theme === void 0 ? emptyTheme : _ref$theme,
|
|
82
|
-
children = _ref.children
|
|
88
|
+
children = _ref.children,
|
|
89
|
+
boxProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["theme", "children"]);
|
|
83
90
|
|
|
84
91
|
var _useState = (0, _react.useState)(function () {
|
|
85
92
|
return mergeThemes(_defaultTheme["default"], theme);
|
|
@@ -99,7 +106,9 @@ function ThemeProvider(_ref) {
|
|
|
99
106
|
value: cache
|
|
100
107
|
}, /*#__PURE__*/_react["default"].createElement(_react2.ThemeProvider, {
|
|
101
108
|
theme: mergedTheme
|
|
102
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
109
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box.Box, (0, _extends2["default"])({
|
|
110
|
+
className: "tapestry-react-reset"
|
|
111
|
+
}, boxProps, (_ref2 = {}, _ref2["" + (0, _styles.getThemeDataAttribute)(mergedTheme.id)] = true, _ref2)), children)));
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
ThemeProvider.cache = cache;
|
|
@@ -35,7 +35,7 @@ var setRootStyles = function setRootStyles(themeId, styles) {
|
|
|
35
35
|
exports.setRootStyles = setRootStyles;
|
|
36
36
|
var defaultColorProperties = (0, _utils.objectToCSSProperties)('colors', (0, _system.flattenPalette)(_system.defaultTheme.colors));
|
|
37
37
|
exports.defaultColorProperties = defaultColorProperties;
|
|
38
|
-
var styleReset = ("\n" + getRootStyles(null, defaultColorProperties) + "\n\n
|
|
38
|
+
var styleReset = ("\n" + getRootStyles(null, defaultColorProperties) + "\n\n.tapestry-react-reset * {\n appearance: none;\n background-color: transparent;\n border-width: 0px;\n border-style: solid;\n border-color: transparent;\n box-sizing: border-box;\n color: inherit;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: auto;\n font-weight: 400;\n margin: 0px;\n min-height: 0px;\n min-width: 0px;\n padding: 0px;\n text-decoration: none;\n}\n\n.tapestry-react-reset *::-moz-focus-inner {\n border: none;\n padding: 0px;\n}\n\n.tapestry-react-reset *:focus:not(.focus-visible) {\n outline: 0px;\n}\n" // minify string
|
|
39
39
|
).replace(/\n/g, '').replace(/\s\s+/g, ' '); // we use our own global style implementation in place of Emotion Global
|
|
40
40
|
// so we can have more control over when styles are injected since multiple
|
|
41
41
|
// Providers can be used on a page
|
package/dist/cjs/index.d.js
CHANGED
|
@@ -9,7 +9,6 @@ var _exportNames = {
|
|
|
9
9
|
Avatar: true,
|
|
10
10
|
Badge: true,
|
|
11
11
|
Calendar: true,
|
|
12
|
-
Checkbox: true,
|
|
13
12
|
CheckboxCard: true,
|
|
14
13
|
CheckboxGroup: true,
|
|
15
14
|
ChurchCenterStatus: true,
|
|
@@ -31,11 +30,19 @@ var _exportNames = {
|
|
|
31
30
|
Icon: true,
|
|
32
31
|
Link: true,
|
|
33
32
|
LinkList: true,
|
|
34
|
-
List: true,
|
|
35
33
|
Logo: true,
|
|
36
34
|
Menu: true,
|
|
37
35
|
Modal: true,
|
|
38
36
|
NumberField: true,
|
|
37
|
+
PageActions: true,
|
|
38
|
+
PageBody: true,
|
|
39
|
+
PageButton: true,
|
|
40
|
+
PageDropdown: true,
|
|
41
|
+
PageHeader: true,
|
|
42
|
+
PageTab: true,
|
|
43
|
+
PageTabList: true,
|
|
44
|
+
PageTitle: true,
|
|
45
|
+
PageToolbar: true,
|
|
39
46
|
PagerView: true,
|
|
40
47
|
Pagination: true,
|
|
41
48
|
Progress: true,
|
|
@@ -46,9 +53,7 @@ var _exportNames = {
|
|
|
46
53
|
HeadingUppercase: true,
|
|
47
54
|
SegmentedControl: true,
|
|
48
55
|
SegmentedTabs: true,
|
|
49
|
-
Select: true,
|
|
50
56
|
Sidebar: true,
|
|
51
|
-
Sortable: true,
|
|
52
57
|
StepperField: true,
|
|
53
58
|
StepperProgress: true,
|
|
54
59
|
Summary: true,
|
|
@@ -60,9 +65,14 @@ var _exportNames = {
|
|
|
60
65
|
TokenInput: true,
|
|
61
66
|
Tooltip: true,
|
|
62
67
|
VariantProvider: true,
|
|
63
|
-
Wizard: true
|
|
68
|
+
Wizard: true,
|
|
69
|
+
Checkbox: true,
|
|
70
|
+
Input: true,
|
|
71
|
+
List: true,
|
|
72
|
+
Select: true,
|
|
73
|
+
Sortable: true
|
|
64
74
|
};
|
|
65
|
-
exports.Wizard = exports.VariantProvider = exports.Tooltip = exports.TokenInput = exports.Toolbar = exports.TimeField = exports.TextArea = exports.Tabs = exports.Table = exports.Summary = exports.StepperProgress = exports.StepperField = exports.
|
|
75
|
+
exports.Sortable = exports.Select = exports.List = exports.Input = exports.Checkbox = exports.Wizard = exports.VariantProvider = exports.Tooltip = exports.TokenInput = exports.Toolbar = exports.TimeField = exports.TextArea = exports.Tabs = exports.Table = exports.Summary = exports.StepperProgress = exports.StepperField = exports.Sidebar = exports.SegmentedTabs = exports.SegmentedControl = exports.HeadingUppercase = exports.Section = exports.ScreenReader = exports.RangeSlider = exports.Radio = exports.Progress = exports.Pagination = exports.PagerView = exports.PageToolbar = exports.PageTitle = exports.PageTabList = exports.PageTab = exports.PageHeader = exports.PageDropdown = exports.PageButton = exports.PageBody = exports.PageActions = exports.NumberField = exports.Modal = exports.Menu = exports.Logo = exports.LinkList = exports.Link = exports.Icon = exports.Highlight = exports.HelperDrawer = exports.Heading = exports.FieldSet = exports.Form = exports.Field = exports.EditActions = exports.Dropdown = exports.Drawer = exports.DragDrop = exports.DateField = exports.DataTable = exports.Combobox = exports.ColumnView = exports.Collapse = exports.ChurchCenterStatus = exports.CheckboxGroup = exports.CheckboxCard = exports.Calendar = exports.Badge = exports.Avatar = exports.utils = exports.server = exports.hooks = exports.designSystem = void 0;
|
|
66
76
|
|
|
67
77
|
var _Alert = require("./Alert");
|
|
68
78
|
|
|
@@ -136,15 +146,6 @@ Object.keys(_Group).forEach(function (key) {
|
|
|
136
146
|
exports[key] = _Group[key];
|
|
137
147
|
});
|
|
138
148
|
|
|
139
|
-
var _Input = require("./Input");
|
|
140
|
-
|
|
141
|
-
Object.keys(_Input).forEach(function (key) {
|
|
142
|
-
if (key === "default" || key === "__esModule") return;
|
|
143
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
144
|
-
if (key in exports && exports[key] === _Input[key]) return;
|
|
145
|
-
exports[key] = _Input[key];
|
|
146
|
-
});
|
|
147
|
-
|
|
148
149
|
var _Popover = require("./Popover");
|
|
149
150
|
|
|
150
151
|
Object.keys(_Popover).forEach(function (key) {
|
|
@@ -248,8 +249,6 @@ var Badge;
|
|
|
248
249
|
exports.Badge = Badge;
|
|
249
250
|
var Calendar;
|
|
250
251
|
exports.Calendar = Calendar;
|
|
251
|
-
var Checkbox;
|
|
252
|
-
exports.Checkbox = Checkbox;
|
|
253
252
|
var CheckboxCard;
|
|
254
253
|
exports.CheckboxCard = CheckboxCard;
|
|
255
254
|
var CheckboxGroup;
|
|
@@ -292,8 +291,6 @@ var Link;
|
|
|
292
291
|
exports.Link = Link;
|
|
293
292
|
var LinkList;
|
|
294
293
|
exports.LinkList = LinkList;
|
|
295
|
-
var List;
|
|
296
|
-
exports.List = List;
|
|
297
294
|
var Logo;
|
|
298
295
|
exports.Logo = Logo;
|
|
299
296
|
var Menu;
|
|
@@ -302,6 +299,24 @@ var Modal;
|
|
|
302
299
|
exports.Modal = Modal;
|
|
303
300
|
var NumberField;
|
|
304
301
|
exports.NumberField = NumberField;
|
|
302
|
+
var PageActions;
|
|
303
|
+
exports.PageActions = PageActions;
|
|
304
|
+
var PageBody;
|
|
305
|
+
exports.PageBody = PageBody;
|
|
306
|
+
var PageButton;
|
|
307
|
+
exports.PageButton = PageButton;
|
|
308
|
+
var PageDropdown;
|
|
309
|
+
exports.PageDropdown = PageDropdown;
|
|
310
|
+
var PageHeader;
|
|
311
|
+
exports.PageHeader = PageHeader;
|
|
312
|
+
var PageTab;
|
|
313
|
+
exports.PageTab = PageTab;
|
|
314
|
+
var PageTabList;
|
|
315
|
+
exports.PageTabList = PageTabList;
|
|
316
|
+
var PageTitle;
|
|
317
|
+
exports.PageTitle = PageTitle;
|
|
318
|
+
var PageToolbar;
|
|
319
|
+
exports.PageToolbar = PageToolbar;
|
|
305
320
|
var PagerView;
|
|
306
321
|
exports.PagerView = PagerView;
|
|
307
322
|
var Pagination;
|
|
@@ -322,12 +337,8 @@ var SegmentedControl;
|
|
|
322
337
|
exports.SegmentedControl = SegmentedControl;
|
|
323
338
|
var SegmentedTabs;
|
|
324
339
|
exports.SegmentedTabs = SegmentedTabs;
|
|
325
|
-
var Select;
|
|
326
|
-
exports.Select = Select;
|
|
327
340
|
var Sidebar;
|
|
328
341
|
exports.Sidebar = Sidebar;
|
|
329
|
-
var Sortable;
|
|
330
|
-
exports.Sortable = Sortable;
|
|
331
342
|
var StepperField;
|
|
332
343
|
exports.StepperField = StepperField;
|
|
333
344
|
var StepperProgress;
|
|
@@ -350,5 +361,39 @@ var Tooltip;
|
|
|
350
361
|
exports.Tooltip = Tooltip;
|
|
351
362
|
var VariantProvider;
|
|
352
363
|
exports.VariantProvider = VariantProvider;
|
|
353
|
-
var Wizard;
|
|
354
|
-
|
|
364
|
+
var Wizard; // ============
|
|
365
|
+
// Manual Types
|
|
366
|
+
// ===========
|
|
367
|
+
// These are components written in JS, where we can provide very small (one prop at a time) useful
|
|
368
|
+
// typings for consumers.
|
|
369
|
+
// ============
|
|
370
|
+
|
|
371
|
+
exports.Wizard = Wizard;
|
|
372
|
+
// ========
|
|
373
|
+
// Checkbox
|
|
374
|
+
// ========
|
|
375
|
+
var Checkbox; // =====
|
|
376
|
+
// Input
|
|
377
|
+
// =====
|
|
378
|
+
|
|
379
|
+
exports.Checkbox = Checkbox;
|
|
380
|
+
var Input; // ====
|
|
381
|
+
// List
|
|
382
|
+
// ====
|
|
383
|
+
|
|
384
|
+
exports.Input = Input;
|
|
385
|
+
var List; // ======
|
|
386
|
+
// Select
|
|
387
|
+
// ======
|
|
388
|
+
|
|
389
|
+
exports.List = List;
|
|
390
|
+
var Select; // ========
|
|
391
|
+
// Sortable
|
|
392
|
+
// ========
|
|
393
|
+
|
|
394
|
+
exports.Select = Select;
|
|
395
|
+
var Sortable; // =====================
|
|
396
|
+
// Typescript Components
|
|
397
|
+
// =====================
|
|
398
|
+
|
|
399
|
+
exports.Sortable = Sortable;
|
|
@@ -10,6 +10,8 @@ import React, { Children, Fragment, createElement, createContext, useContext, us
|
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
11
|
import * as RBDND from '@planningcenter/react-beautiful-dnd';
|
|
12
12
|
import mitt from 'mitt';
|
|
13
|
+
import { getThemeDataAttribute } from '../ThemeProvider/styles';
|
|
14
|
+
import { useThemeValue } from '../system';
|
|
13
15
|
import StackView from '../StackView';
|
|
14
16
|
var DragDropContext = /*#__PURE__*/createContext(false);
|
|
15
17
|
var DroppableContext = /*#__PURE__*/createContext(false);
|
|
@@ -36,10 +38,13 @@ function Provider(_ref) {
|
|
|
36
38
|
props = _objectWithoutPropertiesLoose(_ref, ["onDragStart", "onDragEnd"]);
|
|
37
39
|
|
|
38
40
|
var hasParentDragDrop = useDragDrop();
|
|
41
|
+
var themeId = useThemeValue('id');
|
|
39
42
|
|
|
40
43
|
if (typeof document !== 'undefined' && portalNode === null) {
|
|
41
44
|
portalNode = document.createElement('div');
|
|
42
45
|
portalNode.id = 'rbd-portal';
|
|
46
|
+
portalNode.className = 'tapestry-react-reset';
|
|
47
|
+
portalNode.setAttribute(getThemeDataAttribute(themeId), 'true');
|
|
43
48
|
document.body.appendChild(portalNode);
|
|
44
49
|
}
|
|
45
50
|
|
|
@@ -120,6 +120,8 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
120
120
|
_this2._portalNode.setAttribute(key, restProps[key]);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
+
this._portalNode.classList.add('tapestry-react-reset');
|
|
124
|
+
|
|
123
125
|
this._portalNode.setAttribute(getThemeDataAttribute(this.context.id), 'true');
|
|
124
126
|
|
|
125
127
|
if (style) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
4
|
|
|
3
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; }
|
|
@@ -9,6 +11,7 @@ import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
|
|
9
11
|
import { CacheProvider } from '@emotion/react';
|
|
10
12
|
import createCache from '@emotion/cache';
|
|
11
13
|
import { merge } from 'lodash';
|
|
14
|
+
import { Box } from '../Box';
|
|
12
15
|
import defaultTheme from '../system/default-theme';
|
|
13
16
|
import { flattenPalette } from '../system';
|
|
14
17
|
import { objectToCSSProperties, shallowEqual } from '../utils';
|
|
@@ -56,7 +59,8 @@ export function ThemeProvider(_ref) {
|
|
|
56
59
|
|
|
57
60
|
var _ref$theme = _ref.theme,
|
|
58
61
|
theme = _ref$theme === void 0 ? emptyTheme : _ref$theme,
|
|
59
|
-
children = _ref.children
|
|
62
|
+
children = _ref.children,
|
|
63
|
+
boxProps = _objectWithoutPropertiesLoose(_ref, ["theme", "children"]);
|
|
60
64
|
|
|
61
65
|
var _useState = useState(function () {
|
|
62
66
|
return mergeThemes(defaultTheme, theme);
|
|
@@ -76,7 +80,9 @@ export function ThemeProvider(_ref) {
|
|
|
76
80
|
value: cache
|
|
77
81
|
}, /*#__PURE__*/React.createElement(EmotionThemeProvider, {
|
|
78
82
|
theme: mergedTheme
|
|
79
|
-
}, /*#__PURE__*/React.createElement(
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Box, _extends({
|
|
84
|
+
className: "tapestry-react-reset"
|
|
85
|
+
}, boxProps, (_ref2 = {}, _ref2["" + getThemeDataAttribute(mergedTheme.id)] = true, _ref2)), children)));
|
|
80
86
|
}
|
|
81
87
|
ThemeProvider.cache = cache;
|
|
82
88
|
ThemeProvider.setRootStyles = setRootStyles;
|
|
@@ -24,7 +24,7 @@ export var setRootStyles = function setRootStyles(themeId, styles) {
|
|
|
24
24
|
sheet.insertRule(styleString, 0);
|
|
25
25
|
};
|
|
26
26
|
export var defaultColorProperties = objectToCSSProperties('colors', flattenPalette(defaultTheme.colors));
|
|
27
|
-
export var styleReset = ("\n" + getRootStyles(null, defaultColorProperties) + "\n\n
|
|
27
|
+
export var styleReset = ("\n" + getRootStyles(null, defaultColorProperties) + "\n\n.tapestry-react-reset * {\n appearance: none;\n background-color: transparent;\n border-width: 0px;\n border-style: solid;\n border-color: transparent;\n box-sizing: border-box;\n color: inherit;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: auto;\n font-weight: 400;\n margin: 0px;\n min-height: 0px;\n min-width: 0px;\n padding: 0px;\n text-decoration: none;\n}\n\n.tapestry-react-reset *::-moz-focus-inner {\n border: none;\n padding: 0px;\n}\n\n.tapestry-react-reset *:focus:not(.focus-visible) {\n outline: 0px;\n}\n" // minify string
|
|
28
28
|
).replace(/\n/g, '').replace(/\s\s+/g, ' '); // we use our own global style implementation in place of Emotion Global
|
|
29
29
|
// so we can have more control over when styles are injected since multiple
|
|
30
30
|
// Providers can be used on a page
|
package/dist/esm/index.d.js
CHANGED
|
@@ -5,7 +5,6 @@ export var utils;
|
|
|
5
5
|
export var Avatar;
|
|
6
6
|
export var Badge;
|
|
7
7
|
export var Calendar;
|
|
8
|
-
export var Checkbox;
|
|
9
8
|
export var CheckboxCard;
|
|
10
9
|
export var CheckboxGroup;
|
|
11
10
|
export var ChurchCenterStatus;
|
|
@@ -27,11 +26,19 @@ export var Highlight;
|
|
|
27
26
|
export var Icon;
|
|
28
27
|
export var Link;
|
|
29
28
|
export var LinkList;
|
|
30
|
-
export var List;
|
|
31
29
|
export var Logo;
|
|
32
30
|
export var Menu;
|
|
33
31
|
export var Modal;
|
|
34
32
|
export var NumberField;
|
|
33
|
+
export var PageActions;
|
|
34
|
+
export var PageBody;
|
|
35
|
+
export var PageButton;
|
|
36
|
+
export var PageDropdown;
|
|
37
|
+
export var PageHeader;
|
|
38
|
+
export var PageTab;
|
|
39
|
+
export var PageTabList;
|
|
40
|
+
export var PageTitle;
|
|
41
|
+
export var PageToolbar;
|
|
35
42
|
export var PagerView;
|
|
36
43
|
export var Pagination;
|
|
37
44
|
export var Progress;
|
|
@@ -42,9 +49,7 @@ export var Section;
|
|
|
42
49
|
export var HeadingUppercase;
|
|
43
50
|
export var SegmentedControl;
|
|
44
51
|
export var SegmentedTabs;
|
|
45
|
-
export var Select;
|
|
46
52
|
export var Sidebar;
|
|
47
|
-
export var Sortable;
|
|
48
53
|
export var StepperField;
|
|
49
54
|
export var StepperProgress;
|
|
50
55
|
export var Summary;
|
|
@@ -56,7 +61,36 @@ export var Toolbar;
|
|
|
56
61
|
export var TokenInput;
|
|
57
62
|
export var Tooltip;
|
|
58
63
|
export var VariantProvider;
|
|
59
|
-
export var Wizard;
|
|
64
|
+
export var Wizard; // ============
|
|
65
|
+
// Manual Types
|
|
66
|
+
// ===========
|
|
67
|
+
// These are components written in JS, where we can provide very small (one prop at a time) useful
|
|
68
|
+
// typings for consumers.
|
|
69
|
+
// ============
|
|
70
|
+
|
|
71
|
+
// ========
|
|
72
|
+
// Checkbox
|
|
73
|
+
// ========
|
|
74
|
+
export var Checkbox; // =====
|
|
75
|
+
// Input
|
|
76
|
+
// =====
|
|
77
|
+
|
|
78
|
+
export var Input; // ====
|
|
79
|
+
// List
|
|
80
|
+
// ====
|
|
81
|
+
|
|
82
|
+
export var List; // ======
|
|
83
|
+
// Select
|
|
84
|
+
// ======
|
|
85
|
+
|
|
86
|
+
export var Select; // ========
|
|
87
|
+
// Sortable
|
|
88
|
+
// ========
|
|
89
|
+
|
|
90
|
+
export var Sortable; // =====================
|
|
91
|
+
// Typescript Components
|
|
92
|
+
// =====================
|
|
93
|
+
|
|
60
94
|
export * from './Alert';
|
|
61
95
|
export * from './Box';
|
|
62
96
|
export * from './Button';
|
|
@@ -65,7 +99,6 @@ export * from './Divider';
|
|
|
65
99
|
export * from './FilterLayout';
|
|
66
100
|
export * from './GridView';
|
|
67
101
|
export * from './Group';
|
|
68
|
-
export * from './Input';
|
|
69
102
|
export * from './Popover';
|
|
70
103
|
export * from './Portal';
|
|
71
104
|
export * from './Scrim';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorProp } from '../index';
|
|
1
|
+
import { ColorProp, StyleProps } from '../index';
|
|
2
2
|
export declare type DividerProps = {
|
|
3
3
|
/**
|
|
4
4
|
* The direction the dividing line should span.
|
|
@@ -16,7 +16,7 @@ export declare type DividerProps = {
|
|
|
16
16
|
* The size of the line in pixels
|
|
17
17
|
*/
|
|
18
18
|
size?: number;
|
|
19
|
-
};
|
|
19
|
+
} & StyleProps;
|
|
20
20
|
/**
|
|
21
21
|
* Used to break up content
|
|
22
22
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProps } from '../index';
|
|
1
3
|
export declare type SpinnerProps = {
|
|
2
4
|
/**
|
|
3
5
|
* Uses position absolute and transforms to position in the center of a relative parent.
|
|
@@ -19,5 +21,5 @@ export declare type SpinnerProps = {
|
|
|
19
21
|
* Secondary color of spinner.
|
|
20
22
|
*/
|
|
21
23
|
trackColor?: string;
|
|
22
|
-
}
|
|
24
|
+
} & StyleProps & React.HTMLAttributes<HTMLElement>;
|
|
23
25
|
export declare function Spinner({ center, size, thickness, ...props }: SpinnerProps): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
2
3
|
import { Theme } from '../index';
|
|
3
4
|
import { setRootStyles, styleReset } from './styles';
|
|
4
5
|
export declare const cache: import("@emotion/utils").EmotionCache;
|
|
@@ -7,9 +8,10 @@ export declare const themeStorage: {
|
|
|
7
8
|
set: (value: any) => void;
|
|
8
9
|
};
|
|
9
10
|
export declare const themeInitializerScript: string;
|
|
10
|
-
export declare function ThemeProvider({ theme, children, }: {
|
|
11
|
+
export declare function ThemeProvider({ theme, children, ...boxProps }: {
|
|
11
12
|
theme?: Theme;
|
|
12
13
|
children: React.ReactNode;
|
|
14
|
+
boxProps?: BoxProps;
|
|
13
15
|
}): JSX.Element;
|
|
14
16
|
export declare namespace ThemeProvider {
|
|
15
17
|
var cache: import("@emotion/utils").EmotionCache;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -259,6 +259,10 @@ export type CommonProps = React.RefAttributes<any> &
|
|
|
259
259
|
React.HTMLAttributes<any> &
|
|
260
260
|
any
|
|
261
261
|
|
|
262
|
+
export type CommonComponent = React.FC<CommonProps>
|
|
263
|
+
export type CommonPropsWith<T extends object> = Omit<CommonProps, keyof T> & T
|
|
264
|
+
export type CommonComponentWith<T extends object> = React.FC<CommonPropsWith<T>>
|
|
265
|
+
|
|
262
266
|
export const designSystem: any
|
|
263
267
|
export const hooks: any
|
|
264
268
|
export const server: any
|
|
@@ -267,7 +271,6 @@ export const utils: any
|
|
|
267
271
|
export const Avatar: React.FC<CommonProps>
|
|
268
272
|
export const Badge: React.FC<CommonProps>
|
|
269
273
|
export const Calendar: React.FC<CommonProps>
|
|
270
|
-
export const Checkbox: React.FC<CommonProps>
|
|
271
274
|
export const CheckboxCard: React.FC<CommonProps>
|
|
272
275
|
export const CheckboxGroup: React.FC<CommonProps>
|
|
273
276
|
export const ChurchCenterStatus: React.FC<CommonProps>
|
|
@@ -289,11 +292,19 @@ export const Highlight: React.FC<CommonProps>
|
|
|
289
292
|
export const Icon: React.FC<CommonProps>
|
|
290
293
|
export const Link: React.FC<CommonProps>
|
|
291
294
|
export const LinkList: React.FC<CommonProps>
|
|
292
|
-
export const List: React.FC<CommonProps>
|
|
293
295
|
export const Logo: React.FC<CommonProps>
|
|
294
296
|
export const Menu: React.FC<CommonProps>
|
|
295
297
|
export const Modal: React.FC<CommonProps>
|
|
296
298
|
export const NumberField: React.FC<CommonProps>
|
|
299
|
+
export const PageActions: CommonComponent
|
|
300
|
+
export const PageBody: CommonComponent
|
|
301
|
+
export const PageButton: CommonComponent
|
|
302
|
+
export const PageDropdown: CommonComponent
|
|
303
|
+
export const PageHeader: CommonComponent
|
|
304
|
+
export const PageTab: CommonComponent
|
|
305
|
+
export const PageTabList: CommonComponent
|
|
306
|
+
export const PageTitle: CommonComponent
|
|
307
|
+
export const PageToolbar: CommonComponent
|
|
297
308
|
export const PagerView: React.FC<CommonProps>
|
|
298
309
|
export const Pagination: React.FC<CommonProps>
|
|
299
310
|
export const Progress: React.FC<CommonProps>
|
|
@@ -304,9 +315,7 @@ export const Section: React.FC<CommonProps>
|
|
|
304
315
|
export const HeadingUppercase: React.FC<CommonProps>
|
|
305
316
|
export const SegmentedControl: React.FC<CommonProps>
|
|
306
317
|
export const SegmentedTabs: React.FC<CommonProps>
|
|
307
|
-
export const Select: React.FC<CommonProps>
|
|
308
318
|
export const Sidebar: React.FC<CommonProps>
|
|
309
|
-
export const Sortable: React.FC<CommonProps>
|
|
310
319
|
export const StepperField: React.FC<CommonProps>
|
|
311
320
|
export const StepperProgress: React.FC<CommonProps>
|
|
312
321
|
export const Summary: React.FC<CommonProps>
|
|
@@ -320,6 +329,67 @@ export const Tooltip: React.FC<CommonProps>
|
|
|
320
329
|
export const VariantProvider: React.FC<CommonProps>
|
|
321
330
|
export const Wizard: React.FC<CommonProps>
|
|
322
331
|
|
|
332
|
+
// ============
|
|
333
|
+
// Manual Types
|
|
334
|
+
// ===========
|
|
335
|
+
// These are components written in JS, where we can provide very small (one prop at a time) useful
|
|
336
|
+
// typings for consumers.
|
|
337
|
+
// ============
|
|
338
|
+
|
|
339
|
+
type HTMLInputWrapperComponent = CommonComponentWith<{
|
|
340
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
|
341
|
+
}>
|
|
342
|
+
|
|
343
|
+
// ========
|
|
344
|
+
// Checkbox
|
|
345
|
+
// ========
|
|
346
|
+
|
|
347
|
+
export const Checkbox: HTMLInputWrapperComponent
|
|
348
|
+
|
|
349
|
+
// =====
|
|
350
|
+
// Input
|
|
351
|
+
// =====
|
|
352
|
+
|
|
353
|
+
export const Input: CommonComponent & {
|
|
354
|
+
Inline: HTMLInputWrapperComponent
|
|
355
|
+
Input: HTMLInputWrapperComponent
|
|
356
|
+
InputBox: CommonComponent
|
|
357
|
+
InputField: HTMLInputWrapperComponent
|
|
358
|
+
InputLabel: CommonComponent
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ====
|
|
362
|
+
// List
|
|
363
|
+
// ====
|
|
364
|
+
|
|
365
|
+
export const List: CommonComponent & { Item: CommonComponent }
|
|
366
|
+
|
|
367
|
+
// ======
|
|
368
|
+
// Select
|
|
369
|
+
// ======
|
|
370
|
+
|
|
371
|
+
export const Select: CommonComponent & {
|
|
372
|
+
Inline: CommonComponent
|
|
373
|
+
Option: CommonComponent
|
|
374
|
+
OptionGroup: CommonComponent
|
|
375
|
+
Value: CommonComponent
|
|
376
|
+
toggleValue: (...args: unknown) => unknown
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// ========
|
|
380
|
+
// Sortable
|
|
381
|
+
// ========
|
|
382
|
+
|
|
383
|
+
export const Sortable: CommonComponent & {
|
|
384
|
+
SortableManager: CommonComponent
|
|
385
|
+
SortableList: CommonComponent
|
|
386
|
+
SortableItem: CommonComponent
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// =====================
|
|
390
|
+
// Typescript Components
|
|
391
|
+
// =====================
|
|
392
|
+
|
|
323
393
|
export * from './Alert'
|
|
324
394
|
export * from './Box'
|
|
325
395
|
export * from './Button'
|
|
@@ -328,7 +398,6 @@ export * from './Divider'
|
|
|
328
398
|
export * from './FilterLayout'
|
|
329
399
|
export * from './GridView'
|
|
330
400
|
export * from './Group'
|
|
331
|
-
export * from './Input'
|
|
332
401
|
export * from './Popover'
|
|
333
402
|
export * from './Portal'
|
|
334
403
|
export * from './Scrim'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "2.6.0-rc.
|
|
3
|
+
"version": "2.6.0-rc.3",
|
|
4
4
|
"description": "A collection of flexible React components to help you build resilient, accessible user interfaces quickly and effectively.",
|
|
5
5
|
"author": "Front End Systems Engineering <frontend@pco.bz>",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
package/src/Divider/Divider.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import Box from '../Box'
|
|
4
|
-
import { BoxProps, ColorProp } from '../index'
|
|
4
|
+
import { BoxProps, ColorProp, StyleProps } from '../index'
|
|
5
5
|
|
|
6
6
|
export type DividerProps = {
|
|
7
7
|
/**
|
|
@@ -23,7 +23,7 @@ export type DividerProps = {
|
|
|
23
23
|
* The size of the line in pixels
|
|
24
24
|
*/
|
|
25
25
|
size?: number
|
|
26
|
-
}
|
|
26
|
+
} & StyleProps
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Used to break up content
|
package/src/DragDrop/DragDrop.js
CHANGED
|
@@ -9,6 +9,8 @@ import React, {
|
|
|
9
9
|
import { createPortal } from 'react-dom'
|
|
10
10
|
import * as RBDND from '@planningcenter/react-beautiful-dnd'
|
|
11
11
|
import mitt from 'mitt'
|
|
12
|
+
import { getThemeDataAttribute } from '../ThemeProvider/styles'
|
|
13
|
+
import { useThemeValue } from '../system'
|
|
12
14
|
|
|
13
15
|
import StackView from '../StackView'
|
|
14
16
|
|
|
@@ -33,9 +35,12 @@ function useDragDrop() {
|
|
|
33
35
|
|
|
34
36
|
function Provider({ onDragStart, onDragEnd, ...props }) {
|
|
35
37
|
const hasParentDragDrop = useDragDrop()
|
|
38
|
+
const themeId = useThemeValue('id')
|
|
36
39
|
if (typeof document !== 'undefined' && portalNode === null) {
|
|
37
40
|
portalNode = document.createElement('div')
|
|
38
41
|
portalNode.id = 'rbd-portal'
|
|
42
|
+
portalNode.className = 'tapestry-react-reset'
|
|
43
|
+
portalNode.setAttribute(getThemeDataAttribute(themeId), 'true')
|
|
39
44
|
document.body.appendChild(portalNode)
|
|
40
45
|
}
|
|
41
46
|
useEffect(() => {
|
package/src/Icon/Icon.mdx
CHANGED
|
@@ -29,35 +29,35 @@ An "icon set" groups product-specific icon paths together. By default, `tapestry
|
|
|
29
29
|
Additional icon sets can be imported from [libraries like `@planningcenter/icons`](https://github.com/planningcenter/icons) and exported through your app's [ThemeProvider](/theming#themeprovider). (You can import all exports [by using an asterisk](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_an_entire_modules_contents).)
|
|
30
30
|
|
|
31
31
|
```jsx
|
|
32
|
+
{/* import icon sets in local theme definition */}
|
|
32
33
|
import * as calendar from '@planningcenter/icons/paths/calendar'
|
|
33
34
|
import * as giving from '@planningcenter/icons/paths/giving'
|
|
34
35
|
import * as people from '@planningcenter/icons/paths/people'
|
|
35
36
|
|
|
36
37
|
const theme = {
|
|
38
|
+
...themeOptions,
|
|
37
39
|
icons: {
|
|
38
40
|
calendar,
|
|
39
41
|
giving,
|
|
40
|
-
people
|
|
42
|
+
people,
|
|
43
|
+
...designSystem.defaultTheme.icons
|
|
41
44
|
},
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</ThemeProvider>
|
|
47
|
+
{/* prefix Icon instance in component */}
|
|
48
|
+
<Icon name="calendar.reservationBlock" />
|
|
49
|
+
<Icon name="giving.clockCircleO" />
|
|
50
|
+
<Icon name="people.photoOutline" />
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
```jsx live
|
|
52
54
|
render(() => {
|
|
53
55
|
return (
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</StackView>
|
|
60
|
-
</ThemeProvider>
|
|
56
|
+
<StackView axis="horizontal" spacing={2}>
|
|
57
|
+
<Icon name="calendar.reservationBlock" size="xl" />
|
|
58
|
+
<Icon name="giving.clockCircleO" size="xl" />
|
|
59
|
+
<Icon name="people.photoOutline" size="xl" />
|
|
60
|
+
</StackView>
|
|
61
61
|
)
|
|
62
62
|
})
|
|
63
63
|
```
|
|
@@ -72,42 +72,40 @@ render(() => {
|
|
|
72
72
|
const [appName, setAppName] = React.useState('general')
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
|
-
<
|
|
76
|
-
<StackView
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</Select.Option>
|
|
88
|
-
))}
|
|
89
|
-
</Select>
|
|
90
|
-
<Input
|
|
91
|
-
grow={1}
|
|
92
|
-
autoFocus
|
|
93
|
-
renderLeft={<Icon name="general.search" />}
|
|
94
|
-
placeholder="Search by icon name"
|
|
95
|
-
value={value}
|
|
96
|
-
onChange={(e) => setValue(e.target.value)}
|
|
97
|
-
/>
|
|
98
|
-
</StackView>
|
|
99
|
-
<TileView minCellWidth={16} spacing={4} margin={4}>
|
|
100
|
-
{matchSorter(Object.keys(icons[appName]), value).map((iconName) => (
|
|
101
|
-
<StackView key={iconName} alignment="center" spacing={1}>
|
|
102
|
-
<Icon key={iconName} name={`${appName}.${iconName}`} size="xl" />
|
|
103
|
-
<Text fontSize={5} color="foregroundSecondary">
|
|
104
|
-
{iconName}
|
|
105
|
-
</Text>
|
|
106
|
-
</StackView>
|
|
75
|
+
<StackView grow={1}>
|
|
76
|
+
<StackView axis="horizontal" spacing={2}>
|
|
77
|
+
<Select
|
|
78
|
+
basis={26}
|
|
79
|
+
emptyValue="Choose icon set"
|
|
80
|
+
onChange={(event) => setAppName(event.value)}
|
|
81
|
+
defaultValue={appName}
|
|
82
|
+
>
|
|
83
|
+
{appNames.map((appName) => (
|
|
84
|
+
<Select.Option key={appName} value={appName}>
|
|
85
|
+
{appName}
|
|
86
|
+
</Select.Option>
|
|
107
87
|
))}
|
|
108
|
-
</
|
|
88
|
+
</Select>
|
|
89
|
+
<Input
|
|
90
|
+
grow={1}
|
|
91
|
+
autoFocus
|
|
92
|
+
renderLeft={<Icon name="general.search" />}
|
|
93
|
+
placeholder="Search by icon name"
|
|
94
|
+
value={value}
|
|
95
|
+
onChange={(e) => setValue(e.target.value)}
|
|
96
|
+
/>
|
|
109
97
|
</StackView>
|
|
110
|
-
|
|
98
|
+
<TileView minCellWidth={16} spacing={4} margin={4}>
|
|
99
|
+
{matchSorter(Object.keys(icons[appName]), value).map((iconName) => (
|
|
100
|
+
<StackView key={iconName} alignment="center" spacing={1}>
|
|
101
|
+
<Icon key={iconName} name={`${appName}.${iconName}`} size="xl" />
|
|
102
|
+
<Text fontSize={5} color="foregroundSecondary">
|
|
103
|
+
{iconName}
|
|
104
|
+
</Text>
|
|
105
|
+
</StackView>
|
|
106
|
+
))}
|
|
107
|
+
</TileView>
|
|
108
|
+
</StackView>
|
|
111
109
|
)
|
|
112
110
|
})
|
|
113
111
|
```
|
package/src/Portal/Portal.tsx
CHANGED
|
@@ -111,6 +111,9 @@ class Portal extends React.Component<PortalProps> {
|
|
|
111
111
|
Object.keys(restProps).forEach((key) => {
|
|
112
112
|
this._portalNode.setAttribute(key, restProps[key])
|
|
113
113
|
})
|
|
114
|
+
|
|
115
|
+
this._portalNode.classList.add('tapestry-react-reset')
|
|
116
|
+
|
|
114
117
|
this._portalNode.setAttribute(
|
|
115
118
|
getThemeDataAttribute(this.context.id),
|
|
116
119
|
'true'
|
|
@@ -11,18 +11,16 @@ render(() => {
|
|
|
11
11
|
const [volume, setVolume] = React.useState(50)
|
|
12
12
|
const muted = volume === 0
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
<Icon
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</StackView>
|
|
25
|
-
</ThemeProvider>
|
|
14
|
+
<StackView axis="horizontal" alignment="center" width="25%" spacing={1}>
|
|
15
|
+
<Icon>
|
|
16
|
+
<Icon.Path name="services.volume0" />
|
|
17
|
+
<Icon.Path name="services.volume1" visible={muted} />
|
|
18
|
+
<Icon.Path name="services.volume2" visible={!muted} />
|
|
19
|
+
<Icon.Path name="services.volume3" visible={!muted && volume > 50} />
|
|
20
|
+
</Icon>
|
|
21
|
+
<RangeSlider value={volume} onChange={setVolume} />
|
|
22
|
+
<Text>{volume}</Text>
|
|
23
|
+
</StackView>
|
|
26
24
|
)
|
|
27
25
|
})
|
|
28
26
|
```
|
package/src/Spinner/Spinner.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { keyframes } from '@emotion/react'
|
|
|
3
3
|
|
|
4
4
|
import { Box } from '../Box'
|
|
5
5
|
import { useThemeProps } from '../system'
|
|
6
|
+
import { StyleProps } from '../index'
|
|
6
7
|
|
|
7
8
|
const rotate = keyframes({
|
|
8
9
|
'100%': { transform: 'rotate(360deg)' },
|
|
@@ -37,7 +38,7 @@ export type SpinnerProps = {
|
|
|
37
38
|
* Secondary color of spinner.
|
|
38
39
|
*/
|
|
39
40
|
trackColor?: string
|
|
40
|
-
}
|
|
41
|
+
} & StyleProps & React.HTMLAttributes<HTMLElement>
|
|
41
42
|
|
|
42
43
|
export function Spinner({
|
|
43
44
|
center,
|
|
@@ -3,6 +3,7 @@ import { ThemeProvider as EmotionThemeProvider } from '@emotion/react'
|
|
|
3
3
|
import { CacheProvider } from '@emotion/react'
|
|
4
4
|
import createCache from '@emotion/cache'
|
|
5
5
|
import { merge } from 'lodash'
|
|
6
|
+
import { Box, BoxProps } from '../Box'
|
|
6
7
|
|
|
7
8
|
import defaultTheme from '../system/default-theme'
|
|
8
9
|
import { flattenPalette } from '../system'
|
|
@@ -56,9 +57,11 @@ function mergeThemes(a: Theme = {}, b: Theme = {}) {
|
|
|
56
57
|
export function ThemeProvider({
|
|
57
58
|
theme = emptyTheme,
|
|
58
59
|
children,
|
|
60
|
+
...boxProps
|
|
59
61
|
}: {
|
|
60
62
|
theme?: Theme
|
|
61
63
|
children: React.ReactNode
|
|
64
|
+
boxProps?: BoxProps
|
|
62
65
|
}) {
|
|
63
66
|
const [mergedTheme, setMergedTheme] = useState(() =>
|
|
64
67
|
mergeThemes(defaultTheme, theme)
|
|
@@ -76,9 +79,13 @@ export function ThemeProvider({
|
|
|
76
79
|
return (
|
|
77
80
|
<CacheProvider value={cache}>
|
|
78
81
|
<EmotionThemeProvider theme={mergedTheme}>
|
|
79
|
-
<
|
|
82
|
+
<Box
|
|
83
|
+
className="tapestry-react-reset"
|
|
84
|
+
{...boxProps}
|
|
85
|
+
{...{ [`${getThemeDataAttribute(mergedTheme.id)}`]: true }}
|
|
86
|
+
>
|
|
80
87
|
{children}
|
|
81
|
-
</
|
|
88
|
+
</Box>
|
|
82
89
|
</EmotionThemeProvider>
|
|
83
90
|
</CacheProvider>
|
|
84
91
|
)
|
|
@@ -37,8 +37,9 @@ export const defaultColorProperties = objectToCSSProperties(
|
|
|
37
37
|
export const styleReset = `
|
|
38
38
|
${getRootStyles(null, defaultColorProperties)}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
.tapestry-react-reset * {
|
|
41
41
|
appearance: none;
|
|
42
|
+
background-color: transparent;
|
|
42
43
|
border-width: 0px;
|
|
43
44
|
border-style: solid;
|
|
44
45
|
border-color: transparent;
|
|
@@ -56,12 +57,12 @@ ${getRootStyles(null, defaultColorProperties)}
|
|
|
56
57
|
text-decoration: none;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
.tapestry-react-reset *::-moz-focus-inner {
|
|
60
61
|
border: none;
|
|
61
62
|
padding: 0px;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
.tapestry-react-reset *:focus:not(.focus-visible) {
|
|
65
66
|
outline: 0px;
|
|
66
67
|
}
|
|
67
68
|
`
|
package/src/index.d.ts
CHANGED
|
@@ -259,6 +259,10 @@ export type CommonProps = React.RefAttributes<any> &
|
|
|
259
259
|
React.HTMLAttributes<any> &
|
|
260
260
|
any
|
|
261
261
|
|
|
262
|
+
export type CommonComponent = React.FC<CommonProps>
|
|
263
|
+
export type CommonPropsWith<T extends object> = Omit<CommonProps, keyof T> & T
|
|
264
|
+
export type CommonComponentWith<T extends object> = React.FC<CommonPropsWith<T>>
|
|
265
|
+
|
|
262
266
|
export const designSystem: any
|
|
263
267
|
export const hooks: any
|
|
264
268
|
export const server: any
|
|
@@ -267,7 +271,6 @@ export const utils: any
|
|
|
267
271
|
export const Avatar: React.FC<CommonProps>
|
|
268
272
|
export const Badge: React.FC<CommonProps>
|
|
269
273
|
export const Calendar: React.FC<CommonProps>
|
|
270
|
-
export const Checkbox: React.FC<CommonProps>
|
|
271
274
|
export const CheckboxCard: React.FC<CommonProps>
|
|
272
275
|
export const CheckboxGroup: React.FC<CommonProps>
|
|
273
276
|
export const ChurchCenterStatus: React.FC<CommonProps>
|
|
@@ -289,11 +292,19 @@ export const Highlight: React.FC<CommonProps>
|
|
|
289
292
|
export const Icon: React.FC<CommonProps>
|
|
290
293
|
export const Link: React.FC<CommonProps>
|
|
291
294
|
export const LinkList: React.FC<CommonProps>
|
|
292
|
-
export const List: React.FC<CommonProps>
|
|
293
295
|
export const Logo: React.FC<CommonProps>
|
|
294
296
|
export const Menu: React.FC<CommonProps>
|
|
295
297
|
export const Modal: React.FC<CommonProps>
|
|
296
298
|
export const NumberField: React.FC<CommonProps>
|
|
299
|
+
export const PageActions: CommonComponent
|
|
300
|
+
export const PageBody: CommonComponent
|
|
301
|
+
export const PageButton: CommonComponent
|
|
302
|
+
export const PageDropdown: CommonComponent
|
|
303
|
+
export const PageHeader: CommonComponent
|
|
304
|
+
export const PageTab: CommonComponent
|
|
305
|
+
export const PageTabList: CommonComponent
|
|
306
|
+
export const PageTitle: CommonComponent
|
|
307
|
+
export const PageToolbar: CommonComponent
|
|
297
308
|
export const PagerView: React.FC<CommonProps>
|
|
298
309
|
export const Pagination: React.FC<CommonProps>
|
|
299
310
|
export const Progress: React.FC<CommonProps>
|
|
@@ -304,9 +315,7 @@ export const Section: React.FC<CommonProps>
|
|
|
304
315
|
export const HeadingUppercase: React.FC<CommonProps>
|
|
305
316
|
export const SegmentedControl: React.FC<CommonProps>
|
|
306
317
|
export const SegmentedTabs: React.FC<CommonProps>
|
|
307
|
-
export const Select: React.FC<CommonProps>
|
|
308
318
|
export const Sidebar: React.FC<CommonProps>
|
|
309
|
-
export const Sortable: React.FC<CommonProps>
|
|
310
319
|
export const StepperField: React.FC<CommonProps>
|
|
311
320
|
export const StepperProgress: React.FC<CommonProps>
|
|
312
321
|
export const Summary: React.FC<CommonProps>
|
|
@@ -320,6 +329,67 @@ export const Tooltip: React.FC<CommonProps>
|
|
|
320
329
|
export const VariantProvider: React.FC<CommonProps>
|
|
321
330
|
export const Wizard: React.FC<CommonProps>
|
|
322
331
|
|
|
332
|
+
// ============
|
|
333
|
+
// Manual Types
|
|
334
|
+
// ===========
|
|
335
|
+
// These are components written in JS, where we can provide very small (one prop at a time) useful
|
|
336
|
+
// typings for consumers.
|
|
337
|
+
// ============
|
|
338
|
+
|
|
339
|
+
type HTMLInputWrapperComponent = CommonComponentWith<{
|
|
340
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
|
341
|
+
}>
|
|
342
|
+
|
|
343
|
+
// ========
|
|
344
|
+
// Checkbox
|
|
345
|
+
// ========
|
|
346
|
+
|
|
347
|
+
export const Checkbox: HTMLInputWrapperComponent
|
|
348
|
+
|
|
349
|
+
// =====
|
|
350
|
+
// Input
|
|
351
|
+
// =====
|
|
352
|
+
|
|
353
|
+
export const Input: CommonComponent & {
|
|
354
|
+
Inline: HTMLInputWrapperComponent
|
|
355
|
+
Input: HTMLInputWrapperComponent
|
|
356
|
+
InputBox: CommonComponent
|
|
357
|
+
InputField: HTMLInputWrapperComponent
|
|
358
|
+
InputLabel: CommonComponent
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ====
|
|
362
|
+
// List
|
|
363
|
+
// ====
|
|
364
|
+
|
|
365
|
+
export const List: CommonComponent & { Item: CommonComponent }
|
|
366
|
+
|
|
367
|
+
// ======
|
|
368
|
+
// Select
|
|
369
|
+
// ======
|
|
370
|
+
|
|
371
|
+
export const Select: CommonComponent & {
|
|
372
|
+
Inline: CommonComponent
|
|
373
|
+
Option: CommonComponent
|
|
374
|
+
OptionGroup: CommonComponent
|
|
375
|
+
Value: CommonComponent
|
|
376
|
+
toggleValue: (...args: unknown) => unknown
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// ========
|
|
380
|
+
// Sortable
|
|
381
|
+
// ========
|
|
382
|
+
|
|
383
|
+
export const Sortable: CommonComponent & {
|
|
384
|
+
SortableManager: CommonComponent
|
|
385
|
+
SortableList: CommonComponent
|
|
386
|
+
SortableItem: CommonComponent
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// =====================
|
|
390
|
+
// Typescript Components
|
|
391
|
+
// =====================
|
|
392
|
+
|
|
323
393
|
export * from './Alert'
|
|
324
394
|
export * from './Box'
|
|
325
395
|
export * from './Button'
|
|
@@ -328,7 +398,6 @@ export * from './Divider'
|
|
|
328
398
|
export * from './FilterLayout'
|
|
329
399
|
export * from './GridView'
|
|
330
400
|
export * from './Group'
|
|
331
|
-
export * from './Input'
|
|
332
401
|
export * from './Popover'
|
|
333
402
|
export * from './Portal'
|
|
334
403
|
export * from './Scrim'
|
package/src/.DS_Store
DELETED
|
Binary file
|