@planningcenter/tapestry-react 2.6.0-rc.4 → 2.6.0-rc.9
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/DataTable.js +3 -3
- package/dist/cjs/DataTable/components/BodyRows.js +2 -2
- package/dist/cjs/DataTable/components/BodySubRows.js +2 -2
- package/dist/cjs/DataTable/components/CheckboxCell.js +4 -4
- package/dist/cjs/ThemeProvider/ThemeProvider.js +13 -4
- package/dist/cjs/ThemeProvider/styles.js +1 -1
- package/dist/cjs/system/split-styles.js +1 -1
- package/dist/esm/DataTable/DataTable.js +3 -3
- package/dist/esm/DataTable/components/BodyRows.js +2 -2
- package/dist/esm/DataTable/components/BodySubRows.js +2 -2
- package/dist/esm/DataTable/components/CheckboxCell.js +4 -4
- package/dist/esm/ThemeProvider/ThemeProvider.js +13 -4
- package/dist/esm/ThemeProvider/styles.js +1 -1
- package/dist/esm/system/split-styles.js +1 -1
- package/package.json +1 -1
- package/src/DataTable/DataTable.js +9 -3
- package/src/DataTable/components/BodyRows.js +5 -2
- package/src/DataTable/components/BodySubRows.js +5 -2
- package/src/DataTable/components/CheckboxCell.js +4 -4
- package/src/ThemeProvider/ThemeProvider.tsx +8 -4
- package/src/ThemeProvider/styles.ts +18 -8
- package/src/system/split-styles.js +3 -1
|
@@ -205,7 +205,7 @@ var DataTable = function DataTable(props) {
|
|
|
205
205
|
style: isLoadingOrEmpty ? {
|
|
206
206
|
display: 'none'
|
|
207
207
|
} : undefined,
|
|
208
|
-
className: css({
|
|
208
|
+
className: "tapestry-react-reset " + css({
|
|
209
209
|
position: 'relative'
|
|
210
210
|
})
|
|
211
211
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -226,7 +226,7 @@ var DataTable = function DataTable(props) {
|
|
|
226
226
|
column: column,
|
|
227
227
|
columnIndex: columnIndex,
|
|
228
228
|
columnSort: columnSort,
|
|
229
|
-
className: css([].concat(cellVariantClassName, [column.css]))
|
|
229
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantClassName, [column.css]))
|
|
230
230
|
});
|
|
231
231
|
}))), bodyToRender, hasFooterColumns && /*#__PURE__*/_react["default"].createElement("div", {
|
|
232
232
|
ref: footerRef,
|
|
@@ -244,7 +244,7 @@ var DataTable = function DataTable(props) {
|
|
|
244
244
|
key: columnIndex,
|
|
245
245
|
role: "cell",
|
|
246
246
|
ref: getColumnRef(columnIndex + "." + (data.length + 1)),
|
|
247
|
-
className: css([].concat(cellVariantClassName, [column.css]))
|
|
247
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantClassName, [column.css]))
|
|
248
248
|
}, typeof column.footer === 'string' || /*#__PURE__*/_react["default"].isValidElement(column.footer) ? column.footer : column.footer ? /*#__PURE__*/_react["default"].createElement(column.footer, {
|
|
249
249
|
columnIndex: columnIndex
|
|
250
250
|
}) : null);
|
|
@@ -57,7 +57,7 @@ function BodyRows(_ref) {
|
|
|
57
57
|
ref: getColumnRef(columnIndex + "." + (rowIndex + 1)) // offset by 1 to account for header row
|
|
58
58
|
,
|
|
59
59
|
role: "cell",
|
|
60
|
-
className: css([].concat(cellVariantStyles, [column.css]))
|
|
60
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantStyles, [column.css]))
|
|
61
61
|
}, (0, _utils.getCell)(column.cell, {
|
|
62
62
|
columnIndex: columnIndex,
|
|
63
63
|
rowData: rowData,
|
|
@@ -83,7 +83,7 @@ function BodyRows(_ref) {
|
|
|
83
83
|
rowIndex: rowIndex,
|
|
84
84
|
keyboardShortcuts: keyboardShortcuts,
|
|
85
85
|
onRowClick: onRowClick,
|
|
86
|
-
className: css(rowVariantClassName)
|
|
86
|
+
className: "tapestry-react-reset " + css(rowVariantClassName)
|
|
87
87
|
}, (0, _utils.getRowLinkProps)({
|
|
88
88
|
getRowLink: getRowLink,
|
|
89
89
|
data: rowData,
|
|
@@ -71,7 +71,7 @@ var BodySubRows = function BodySubRows(_ref2) {
|
|
|
71
71
|
rowIndex: rowIndex,
|
|
72
72
|
keyboardShortcuts: keyboardShortcuts,
|
|
73
73
|
onRowClick: onRowClick,
|
|
74
|
-
className: css(rowVariantClassName)
|
|
74
|
+
className: "tapestry-react-reset " + css(rowVariantClassName)
|
|
75
75
|
}, (0, _utils.getRowLinkProps)({
|
|
76
76
|
getRowLink: getRowLink,
|
|
77
77
|
data: rowData,
|
|
@@ -90,7 +90,7 @@ var BodySubRows = function BodySubRows(_ref2) {
|
|
|
90
90
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
91
|
key: columnIndex,
|
|
92
92
|
ref: getColumnRef(columnIndex + "." + (parentRowIndex + 1) + "." + rowIndex),
|
|
93
|
-
className: css([].concat(cellVariantClassName, [column.css]))
|
|
93
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantClassName, [column.css]))
|
|
94
94
|
}, (0, _utils.getCell)(column.subCell !== undefined ? column.subCell : column.cell, {
|
|
95
95
|
columnIndex: columnIndex,
|
|
96
96
|
rowData: rowData,
|
|
@@ -96,19 +96,19 @@ function CheckboxCell(_ref) {
|
|
|
96
96
|
onKeyDown: function onKeyDown(event) {
|
|
97
97
|
return event.key === ' ' && handleChange(event);
|
|
98
98
|
},
|
|
99
|
-
className: "tapestry-react-Checkbox",
|
|
99
|
+
className: "tapestry-react-reset tapestry-react-Checkbox",
|
|
100
100
|
css: cssStyles
|
|
101
101
|
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"].Path, {
|
|
102
102
|
name: iconPaths.fill,
|
|
103
|
-
className: "tapestry-react-Checkbox-Fill",
|
|
103
|
+
className: "tapestry-react-reset tapestry-react-Checkbox-Fill",
|
|
104
104
|
fill: checked || indeterminate ? 'primary' : 'surfaceTertiary',
|
|
105
105
|
stroke: checked || indeterminate ? 'primary' : 'separatorSecondary'
|
|
106
106
|
}), /*#__PURE__*/_react["default"].createElement(_Icon["default"].Path, {
|
|
107
107
|
name: iconPaths.minus,
|
|
108
|
-
className: "tapestry-react-Checkbox-
|
|
108
|
+
className: "tapestry-react-reset tapestry-react-Checkbox-Fill"
|
|
109
109
|
}), /*#__PURE__*/_react["default"].createElement(_Icon["default"].Path, {
|
|
110
110
|
name: iconPaths.checked,
|
|
111
|
-
className: "tapestry-react-Checkbox-Checked"
|
|
111
|
+
className: "tapestry-react-reset tapestry-react-Checkbox-Checked"
|
|
112
112
|
}));
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -44,6 +44,15 @@ var cache = (0, _cache["default"])({
|
|
|
44
44
|
key: 'tapestry-react'
|
|
45
45
|
});
|
|
46
46
|
exports.cache = cache;
|
|
47
|
+
|
|
48
|
+
function mergeIntoNewObject() {
|
|
49
|
+
for (var _len = arguments.length, merges = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
+
merges[_key] = arguments[_key];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return _lodash.merge.apply(void 0, [{}].concat(merges));
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
var themeStorage = {
|
|
48
57
|
get: function get() {
|
|
49
58
|
return window.localStorage.getItem(STORAGE_KEY);
|
|
@@ -70,12 +79,12 @@ function mergeThemes(a, b) {
|
|
|
70
79
|
|
|
71
80
|
return _objectSpread(_objectSpread(_objectSpread({}, a), b), {}, {
|
|
72
81
|
button: _objectSpread(_objectSpread(_objectSpread({}, a.button), b.button), {}, {
|
|
73
|
-
themes: (
|
|
82
|
+
themes: mergeIntoNewObject(((_a$button = a.button) == null ? void 0 : _a$button.themes) || {}, ((_b$button = b.button) == null ? void 0 : _b$button.themes) || {})
|
|
74
83
|
}),
|
|
75
|
-
colors: (
|
|
84
|
+
colors: mergeIntoNewObject((0, _system.flattenPalette)(a.colors || {}), (0, _system.flattenPalette)(b.colors || {})),
|
|
76
85
|
spinner: _objectSpread(_objectSpread(_objectSpread({}, a.spinner), b.spinner), {}, {
|
|
77
|
-
sizes: (
|
|
78
|
-
thickness: (
|
|
86
|
+
sizes: mergeIntoNewObject(((_a$spinner = a.spinner) == null ? void 0 : _a$spinner.sizes) || {}, ((_b$spinner = b.spinner) == null ? void 0 : _b$spinner.sizes) || {}),
|
|
87
|
+
thickness: mergeIntoNewObject(((_a$spinner2 = a.spinner) == null ? void 0 : _a$spinner2.thickness) || {}, ((_b$spinner2 = b.spinner) == null ? void 0 : _b$spinner2.thickness) || {})
|
|
79
88
|
})
|
|
80
89
|
});
|
|
81
90
|
}
|
|
@@ -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.tapestry-react-reset
|
|
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 box-sizing: border-box;\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: auto;\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 font-weight: 400;\n margin-top: 0;\n margin-right: 0;\n margin-bottom: 0;\n margin-left: 0;\n min-width: 0px;\n min-height: 0px;\n padding-top: 0;\n padding-right: 0;\n padding-bottom: 0;\n padding-left: 0;\n text-decoration: none;\n}\n\n.tapestry-react-reset::-moz-focus-inner {\n padding-top: 0;\n padding-right: 0;\n padding-bottom: 0;\n padding-left: 0;\n border: none;\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
|
|
@@ -46,7 +46,7 @@ function SplitStyles(_ref) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
49
|
-
className: className,
|
|
49
|
+
className: className ? "tapestry-react-reset " + className : "tapestry-react-reset",
|
|
50
50
|
css: function css(theme) {
|
|
51
51
|
var propStyles = {};
|
|
52
52
|
|
|
@@ -182,7 +182,7 @@ var DataTable = function DataTable(props) {
|
|
|
182
182
|
style: isLoadingOrEmpty ? {
|
|
183
183
|
display: 'none'
|
|
184
184
|
} : undefined,
|
|
185
|
-
className: css({
|
|
185
|
+
className: "tapestry-react-reset " + css({
|
|
186
186
|
position: 'relative'
|
|
187
187
|
})
|
|
188
188
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -203,7 +203,7 @@ var DataTable = function DataTable(props) {
|
|
|
203
203
|
column: column,
|
|
204
204
|
columnIndex: columnIndex,
|
|
205
205
|
columnSort: columnSort,
|
|
206
|
-
className: css([].concat(cellVariantClassName, [column.css]))
|
|
206
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantClassName, [column.css]))
|
|
207
207
|
});
|
|
208
208
|
}))), bodyToRender, hasFooterColumns && /*#__PURE__*/React.createElement("div", {
|
|
209
209
|
ref: footerRef,
|
|
@@ -221,7 +221,7 @@ var DataTable = function DataTable(props) {
|
|
|
221
221
|
key: columnIndex,
|
|
222
222
|
role: "cell",
|
|
223
223
|
ref: getColumnRef(columnIndex + "." + (data.length + 1)),
|
|
224
|
-
className: css([].concat(cellVariantClassName, [column.css]))
|
|
224
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantClassName, [column.css]))
|
|
225
225
|
}, typeof column.footer === 'string' || /*#__PURE__*/React.isValidElement(column.footer) ? column.footer : column.footer ? /*#__PURE__*/React.createElement(column.footer, {
|
|
226
226
|
columnIndex: columnIndex
|
|
227
227
|
}) : null);
|
|
@@ -42,7 +42,7 @@ function BodyRows(_ref) {
|
|
|
42
42
|
ref: getColumnRef(columnIndex + "." + (rowIndex + 1)) // offset by 1 to account for header row
|
|
43
43
|
,
|
|
44
44
|
role: "cell",
|
|
45
|
-
className: css([].concat(cellVariantStyles, [column.css]))
|
|
45
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantStyles, [column.css]))
|
|
46
46
|
}, getCell(column.cell, {
|
|
47
47
|
columnIndex: columnIndex,
|
|
48
48
|
rowData: rowData,
|
|
@@ -68,7 +68,7 @@ function BodyRows(_ref) {
|
|
|
68
68
|
rowIndex: rowIndex,
|
|
69
69
|
keyboardShortcuts: keyboardShortcuts,
|
|
70
70
|
onRowClick: onRowClick,
|
|
71
|
-
className: css(rowVariantClassName)
|
|
71
|
+
className: "tapestry-react-reset " + css(rowVariantClassName)
|
|
72
72
|
}, getRowLinkProps({
|
|
73
73
|
getRowLink: getRowLink,
|
|
74
74
|
data: rowData,
|
|
@@ -58,7 +58,7 @@ var BodySubRows = function BodySubRows(_ref2) {
|
|
|
58
58
|
rowIndex: rowIndex,
|
|
59
59
|
keyboardShortcuts: keyboardShortcuts,
|
|
60
60
|
onRowClick: onRowClick,
|
|
61
|
-
className: css(rowVariantClassName)
|
|
61
|
+
className: "tapestry-react-reset " + css(rowVariantClassName)
|
|
62
62
|
}, getRowLinkProps({
|
|
63
63
|
getRowLink: getRowLink,
|
|
64
64
|
data: rowData,
|
|
@@ -77,7 +77,7 @@ var BodySubRows = function BodySubRows(_ref2) {
|
|
|
77
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
78
78
|
key: columnIndex,
|
|
79
79
|
ref: getColumnRef(columnIndex + "." + (parentRowIndex + 1) + "." + rowIndex),
|
|
80
|
-
className: css([].concat(cellVariantClassName, [column.css]))
|
|
80
|
+
className: "tapestry-react-reset " + css([].concat(cellVariantClassName, [column.css]))
|
|
81
81
|
}, getCell(column.subCell !== undefined ? column.subCell : column.cell, {
|
|
82
82
|
columnIndex: columnIndex,
|
|
83
83
|
rowData: rowData,
|
|
@@ -85,19 +85,19 @@ function CheckboxCell(_ref) {
|
|
|
85
85
|
onKeyDown: function onKeyDown(event) {
|
|
86
86
|
return event.key === ' ' && handleChange(event);
|
|
87
87
|
},
|
|
88
|
-
className: "tapestry-react-Checkbox",
|
|
88
|
+
className: "tapestry-react-reset tapestry-react-Checkbox",
|
|
89
89
|
css: cssStyles
|
|
90
90
|
}, /*#__PURE__*/React.createElement(Icon.Path, {
|
|
91
91
|
name: iconPaths.fill,
|
|
92
|
-
className: "tapestry-react-Checkbox-Fill",
|
|
92
|
+
className: "tapestry-react-reset tapestry-react-Checkbox-Fill",
|
|
93
93
|
fill: checked || indeterminate ? 'primary' : 'surfaceTertiary',
|
|
94
94
|
stroke: checked || indeterminate ? 'primary' : 'separatorSecondary'
|
|
95
95
|
}), /*#__PURE__*/React.createElement(Icon.Path, {
|
|
96
96
|
name: iconPaths.minus,
|
|
97
|
-
className: "tapestry-react-Checkbox-
|
|
97
|
+
className: "tapestry-react-reset tapestry-react-Checkbox-Fill"
|
|
98
98
|
}), /*#__PURE__*/React.createElement(Icon.Path, {
|
|
99
99
|
name: iconPaths.checked,
|
|
100
|
-
className: "tapestry-react-Checkbox-Checked"
|
|
100
|
+
className: "tapestry-react-reset tapestry-react-Checkbox-Checked"
|
|
101
101
|
}));
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -20,6 +20,15 @@ var STORAGE_KEY = 'tapestry-react-theme';
|
|
|
20
20
|
export var cache = createCache({
|
|
21
21
|
key: 'tapestry-react'
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
function mergeIntoNewObject() {
|
|
25
|
+
for (var _len = arguments.length, merges = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
merges[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return merge.apply(void 0, [{}].concat(merges));
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
export var themeStorage = {
|
|
24
33
|
get: function get() {
|
|
25
34
|
return window.localStorage.getItem(STORAGE_KEY);
|
|
@@ -44,12 +53,12 @@ function mergeThemes(a, b) {
|
|
|
44
53
|
|
|
45
54
|
return _objectSpread(_objectSpread(_objectSpread({}, a), b), {}, {
|
|
46
55
|
button: _objectSpread(_objectSpread(_objectSpread({}, a.button), b.button), {}, {
|
|
47
|
-
themes:
|
|
56
|
+
themes: mergeIntoNewObject(((_a$button = a.button) == null ? void 0 : _a$button.themes) || {}, ((_b$button = b.button) == null ? void 0 : _b$button.themes) || {})
|
|
48
57
|
}),
|
|
49
|
-
colors:
|
|
58
|
+
colors: mergeIntoNewObject(flattenPalette(a.colors || {}), flattenPalette(b.colors || {})),
|
|
50
59
|
spinner: _objectSpread(_objectSpread(_objectSpread({}, a.spinner), b.spinner), {}, {
|
|
51
|
-
sizes:
|
|
52
|
-
thickness:
|
|
60
|
+
sizes: mergeIntoNewObject(((_a$spinner = a.spinner) == null ? void 0 : _a$spinner.sizes) || {}, ((_b$spinner = b.spinner) == null ? void 0 : _b$spinner.sizes) || {}),
|
|
61
|
+
thickness: mergeIntoNewObject(((_a$spinner2 = a.spinner) == null ? void 0 : _a$spinner2.thickness) || {}, ((_b$spinner2 = b.spinner) == null ? void 0 : _b$spinner2.thickness) || {})
|
|
53
62
|
})
|
|
54
63
|
});
|
|
55
64
|
}
|
|
@@ -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.tapestry-react-reset
|
|
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 box-sizing: border-box;\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: auto;\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 font-weight: 400;\n margin-top: 0;\n margin-right: 0;\n margin-bottom: 0;\n margin-left: 0;\n min-width: 0px;\n min-height: 0px;\n padding-top: 0;\n padding-right: 0;\n padding-bottom: 0;\n padding-left: 0;\n text-decoration: none;\n}\n\n.tapestry-react-reset::-moz-focus-inner {\n padding-top: 0;\n padding-right: 0;\n padding-bottom: 0;\n padding-left: 0;\n border: none;\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
|
|
@@ -37,7 +37,7 @@ export default function SplitStyles(_ref) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
40
|
-
className: className,
|
|
40
|
+
className: className ? "tapestry-react-reset " + className : "tapestry-react-reset",
|
|
41
41
|
css: function css(theme) {
|
|
42
42
|
var propStyles = {};
|
|
43
43
|
|
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.9",
|
|
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",
|
|
@@ -480,7 +480,7 @@ const DataTable = (props: Props) => {
|
|
|
480
480
|
<div
|
|
481
481
|
role={getRowLink ? undefined : 'grid'}
|
|
482
482
|
style={isLoadingOrEmpty ? { display: 'none' } : undefined}
|
|
483
|
-
className={css({ position: 'relative' })}
|
|
483
|
+
className={`tapestry-react-reset ${css({ position: 'relative' })}`}
|
|
484
484
|
>
|
|
485
485
|
<div
|
|
486
486
|
ref={headerRef}
|
|
@@ -500,7 +500,10 @@ const DataTable = (props: Props) => {
|
|
|
500
500
|
column={column}
|
|
501
501
|
columnIndex={columnIndex}
|
|
502
502
|
columnSort={columnSort}
|
|
503
|
-
className={css([
|
|
503
|
+
className={`tapestry-react-reset ${css([
|
|
504
|
+
...cellVariantClassName,
|
|
505
|
+
column.css,
|
|
506
|
+
])}`}
|
|
504
507
|
/>
|
|
505
508
|
)
|
|
506
509
|
})}
|
|
@@ -524,7 +527,10 @@ const DataTable = (props: Props) => {
|
|
|
524
527
|
key={columnIndex}
|
|
525
528
|
role="cell"
|
|
526
529
|
ref={getColumnRef(`${columnIndex}.${data.length + 1}`)}
|
|
527
|
-
className={css([
|
|
530
|
+
className={`tapestry-react-reset ${css([
|
|
531
|
+
...cellVariantClassName,
|
|
532
|
+
column.css,
|
|
533
|
+
])}`}
|
|
528
534
|
>
|
|
529
535
|
{typeof column.footer === 'string' ||
|
|
530
536
|
React.isValidElement(column.footer)
|
|
@@ -38,7 +38,10 @@ function BodyRows({
|
|
|
38
38
|
key={columnIndex}
|
|
39
39
|
ref={getColumnRef(`${columnIndex}.${rowIndex + 1}`)} // offset by 1 to account for header row
|
|
40
40
|
role="cell"
|
|
41
|
-
className={css([
|
|
41
|
+
className={`tapestry-react-reset ${css([
|
|
42
|
+
...cellVariantStyles,
|
|
43
|
+
column.css,
|
|
44
|
+
])}`}
|
|
42
45
|
>
|
|
43
46
|
{getCell(column.cell, {
|
|
44
47
|
columnIndex,
|
|
@@ -64,7 +67,7 @@ function BodyRows({
|
|
|
64
67
|
rowIndex,
|
|
65
68
|
keyboardShortcuts,
|
|
66
69
|
onRowClick,
|
|
67
|
-
className: css(rowVariantClassName)
|
|
70
|
+
className: `tapestry-react-reset ${css(rowVariantClassName)}`,
|
|
68
71
|
...getRowLinkProps({ getRowLink, data: rowData, isSubRow: false }),
|
|
69
72
|
}
|
|
70
73
|
const subRowData = getSubData ? getSubData(rowData) : null
|
|
@@ -57,7 +57,7 @@ const BodySubRows = ({
|
|
|
57
57
|
rowIndex={rowIndex}
|
|
58
58
|
keyboardShortcuts={keyboardShortcuts}
|
|
59
59
|
onRowClick={onRowClick}
|
|
60
|
-
className={css(rowVariantClassName)}
|
|
60
|
+
className={`tapestry-react-reset ${css(rowVariantClassName)}`}
|
|
61
61
|
{...getRowLinkProps({ getRowLink, data: rowData, isSubRow: true })}
|
|
62
62
|
>
|
|
63
63
|
{columns.map((column, columnIndex) => {
|
|
@@ -77,7 +77,10 @@ const BodySubRows = ({
|
|
|
77
77
|
ref={getColumnRef(
|
|
78
78
|
`${columnIndex}.${parentRowIndex + 1}.${rowIndex}`
|
|
79
79
|
)}
|
|
80
|
-
className={css([
|
|
80
|
+
className={`tapestry-react-reset ${css([
|
|
81
|
+
...cellVariantClassName,
|
|
82
|
+
column.css,
|
|
83
|
+
])}`}
|
|
81
84
|
>
|
|
82
85
|
{getCell(
|
|
83
86
|
column.subCell !== undefined ? column.subCell : column.cell,
|
|
@@ -87,22 +87,22 @@ function CheckboxCell({
|
|
|
87
87
|
onFocus={onFocus}
|
|
88
88
|
onClick={handleChange}
|
|
89
89
|
onKeyDown={(event) => event.key === ' ' && handleChange(event)}
|
|
90
|
-
className="tapestry-react-Checkbox"
|
|
90
|
+
className="tapestry-react-reset tapestry-react-Checkbox"
|
|
91
91
|
css={cssStyles}
|
|
92
92
|
>
|
|
93
93
|
<Icon.Path
|
|
94
94
|
name={iconPaths.fill}
|
|
95
|
-
className="tapestry-react-Checkbox-Fill"
|
|
95
|
+
className="tapestry-react-reset tapestry-react-Checkbox-Fill"
|
|
96
96
|
fill={checked || indeterminate ? 'primary' : 'surfaceTertiary'}
|
|
97
97
|
stroke={checked || indeterminate ? 'primary' : 'separatorSecondary'}
|
|
98
98
|
/>
|
|
99
99
|
<Icon.Path
|
|
100
100
|
name={iconPaths.minus}
|
|
101
|
-
className="tapestry-react-Checkbox-
|
|
101
|
+
className="tapestry-react-reset tapestry-react-Checkbox-Fill"
|
|
102
102
|
/>
|
|
103
103
|
<Icon.Path
|
|
104
104
|
name={iconPaths.checked}
|
|
105
|
-
className="tapestry-react-Checkbox-Checked"
|
|
105
|
+
className="tapestry-react-reset tapestry-react-Checkbox-Checked"
|
|
106
106
|
/>
|
|
107
107
|
</Icon>
|
|
108
108
|
)
|
|
@@ -17,6 +17,10 @@ export const cache = createCache({
|
|
|
17
17
|
key: 'tapestry-react',
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
+
function mergeIntoNewObject(...merges: object[]) {
|
|
21
|
+
return merge({}, ...merges)
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
export const themeStorage = {
|
|
21
25
|
get: () => window.localStorage.getItem(STORAGE_KEY),
|
|
22
26
|
set: (value) => window.localStorage.setItem(STORAGE_KEY, value),
|
|
@@ -39,17 +43,17 @@ function mergeThemes(a: Theme = {}, b: Theme = {}) {
|
|
|
39
43
|
button: {
|
|
40
44
|
...a.button,
|
|
41
45
|
...b.button,
|
|
42
|
-
themes:
|
|
46
|
+
themes: mergeIntoNewObject(a.button?.themes || {}, b.button?.themes || {}),
|
|
43
47
|
},
|
|
44
|
-
colors:
|
|
48
|
+
colors: mergeIntoNewObject(
|
|
45
49
|
flattenPalette(a.colors || {}),
|
|
46
50
|
flattenPalette(b.colors || {})
|
|
47
51
|
),
|
|
48
52
|
spinner: {
|
|
49
53
|
...a.spinner,
|
|
50
54
|
...b.spinner,
|
|
51
|
-
sizes:
|
|
52
|
-
thickness:
|
|
55
|
+
sizes: mergeIntoNewObject(a.spinner?.sizes || {}, b.spinner?.sizes || {}),
|
|
56
|
+
thickness: mergeIntoNewObject(a.spinner?.thickness || {}, b.spinner?.thickness || {}),
|
|
53
57
|
},
|
|
54
58
|
}
|
|
55
59
|
}
|
|
@@ -37,7 +37,7 @@ export const defaultColorProperties = objectToCSSProperties(
|
|
|
37
37
|
export const styleReset = `
|
|
38
38
|
${getRootStyles(null, defaultColorProperties)}
|
|
39
39
|
|
|
40
|
-
.tapestry-react-reset
|
|
40
|
+
.tapestry-react-reset {
|
|
41
41
|
appearance: none;
|
|
42
42
|
background-color: transparent;
|
|
43
43
|
border-width: 0px;
|
|
@@ -45,24 +45,34 @@ ${getRootStyles(null, defaultColorProperties)}
|
|
|
45
45
|
border-color: transparent;
|
|
46
46
|
box-sizing: border-box;
|
|
47
47
|
color: inherit;
|
|
48
|
-
|
|
48
|
+
box-sizing: border-box;
|
|
49
49
|
flex-grow: 0;
|
|
50
50
|
flex-shrink: 0;
|
|
51
51
|
flex-basis: auto;
|
|
52
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
52
53
|
font-weight: 400;
|
|
53
|
-
margin:
|
|
54
|
-
|
|
54
|
+
margin-top: 0;
|
|
55
|
+
margin-right: 0;
|
|
56
|
+
margin-bottom: 0;
|
|
57
|
+
margin-left: 0;
|
|
55
58
|
min-width: 0px;
|
|
56
|
-
|
|
59
|
+
min-height: 0px;
|
|
60
|
+
padding-top: 0;
|
|
61
|
+
padding-right: 0;
|
|
62
|
+
padding-bottom: 0;
|
|
63
|
+
padding-left: 0;
|
|
57
64
|
text-decoration: none;
|
|
58
65
|
}
|
|
59
66
|
|
|
60
|
-
.tapestry-react-reset
|
|
67
|
+
.tapestry-react-reset::-moz-focus-inner {
|
|
68
|
+
padding-top: 0;
|
|
69
|
+
padding-right: 0;
|
|
70
|
+
padding-bottom: 0;
|
|
71
|
+
padding-left: 0;
|
|
61
72
|
border: none;
|
|
62
|
-
padding: 0px;
|
|
63
73
|
}
|
|
64
74
|
|
|
65
|
-
.tapestry-react-reset
|
|
75
|
+
.tapestry-react-reset:focus:not(.focus-visible) {
|
|
66
76
|
outline: 0px;
|
|
67
77
|
}
|
|
68
78
|
`
|
|
@@ -26,7 +26,9 @@ export default function SplitStyles({
|
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
28
|
...restProps,
|
|
29
|
-
className
|
|
29
|
+
className: className
|
|
30
|
+
? `tapestry-react-reset ${className}`
|
|
31
|
+
: `tapestry-react-reset`,
|
|
30
32
|
css: (theme) => {
|
|
31
33
|
const propStyles = {}
|
|
32
34
|
for (const prop in styleProps) {
|