@planningcenter/tapestry-react 2.9.1 → 2.9.2
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/TimeField/TimeField.js +7 -2
- package/dist/cjs/system/button-themes.js +21 -21
- package/dist/cjs/system/colors/utils.js +3 -1
- package/dist/esm/TimeField/TimeField.js +7 -2
- package/dist/esm/system/button-themes.js +21 -21
- package/dist/esm/system/colors/utils.js +2 -1
- package/package.json +1 -1
- package/src/Button/Button.mdx +1 -0
- package/src/TimeField/TimeField.tsx +7 -2
- package/src/system/button-themes.js +21 -21
- package/src/system/colors/utils.js +2 -1
|
@@ -188,8 +188,13 @@ var TimeField = function TimeField(_ref) {
|
|
|
188
188
|
setHours(updatedHoursValue);
|
|
189
189
|
setHoursDisplay(updatedHoursValue);
|
|
190
190
|
} else {
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
if (updatedHoursValue === 12) {
|
|
192
|
+
setHours(12);
|
|
193
|
+
setHoursDisplay(12);
|
|
194
|
+
} else {
|
|
195
|
+
setHours(updatedHoursValue + 12);
|
|
196
|
+
setHoursDisplay(updatedHoursValue);
|
|
197
|
+
}
|
|
193
198
|
}
|
|
194
199
|
} else {
|
|
195
200
|
setHours(updatedHoursValue);
|
|
@@ -191,63 +191,63 @@ var buttonThemes = {
|
|
|
191
191
|
},
|
|
192
192
|
error: {
|
|
193
193
|
fill: {
|
|
194
|
-
color: '
|
|
195
|
-
backgroundColor: '
|
|
194
|
+
color: 'white',
|
|
195
|
+
backgroundColor: 'error',
|
|
196
196
|
hover: {
|
|
197
|
-
backgroundColor: '
|
|
197
|
+
backgroundColor: 'error-dark'
|
|
198
198
|
},
|
|
199
199
|
active: {
|
|
200
|
-
backgroundColor: '
|
|
200
|
+
backgroundColor: 'error-darker'
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
outline: {
|
|
204
|
-
stroke: '
|
|
205
|
-
color: '
|
|
204
|
+
stroke: 'error',
|
|
205
|
+
color: 'error',
|
|
206
206
|
hover: {
|
|
207
|
-
backgroundColor: '
|
|
207
|
+
backgroundColor: 'error-lightest'
|
|
208
208
|
},
|
|
209
209
|
active: {
|
|
210
|
-
backgroundColor: '
|
|
210
|
+
backgroundColor: 'error-lighter'
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
213
|
naked: {
|
|
214
214
|
color: 'error',
|
|
215
215
|
hover: {
|
|
216
|
-
backgroundColor: '
|
|
216
|
+
backgroundColor: 'error-lightest'
|
|
217
217
|
},
|
|
218
218
|
active: {
|
|
219
|
-
backgroundColor: '
|
|
219
|
+
backgroundColor: 'error-lighter'
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
},
|
|
223
223
|
success: {
|
|
224
224
|
fill: {
|
|
225
|
-
color: '
|
|
226
|
-
backgroundColor: '
|
|
225
|
+
color: 'white',
|
|
226
|
+
backgroundColor: 'success',
|
|
227
227
|
hover: {
|
|
228
|
-
backgroundColor: '
|
|
228
|
+
backgroundColor: 'success-dark'
|
|
229
229
|
},
|
|
230
230
|
active: {
|
|
231
|
-
backgroundColor: '
|
|
231
|
+
backgroundColor: 'success-darker'
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
234
|
outline: {
|
|
235
|
-
stroke: '
|
|
236
|
-
color: '
|
|
235
|
+
stroke: 'success',
|
|
236
|
+
color: 'success',
|
|
237
237
|
hover: {
|
|
238
|
-
backgroundColor: '
|
|
238
|
+
backgroundColor: 'success-lightest'
|
|
239
239
|
},
|
|
240
240
|
active: {
|
|
241
|
-
backgroundColor: '
|
|
241
|
+
backgroundColor: 'success-lighter'
|
|
242
242
|
}
|
|
243
243
|
},
|
|
244
244
|
naked: {
|
|
245
|
-
color: '
|
|
245
|
+
color: 'success',
|
|
246
246
|
hover: {
|
|
247
|
-
backgroundColor: '
|
|
247
|
+
backgroundColor: 'success-lightest'
|
|
248
248
|
},
|
|
249
249
|
active: {
|
|
250
|
-
backgroundColor: '
|
|
250
|
+
backgroundColor: 'success-lighter'
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
},
|
|
@@ -19,6 +19,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
19
19
|
|
|
20
20
|
var _polished = require("polished");
|
|
21
21
|
|
|
22
|
+
var _utils = require("../../utils");
|
|
23
|
+
|
|
22
24
|
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; }
|
|
23
25
|
|
|
24
26
|
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) { (0, _defineProperty2["default"])(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; }
|
|
@@ -101,7 +103,7 @@ function flattenPalette(palette) {
|
|
|
101
103
|
|
|
102
104
|
var value = parsedPalette[key];
|
|
103
105
|
var aliasValue = parsedPalette[value];
|
|
104
|
-
return _objectSpread(_objectSpread({}, collection), {}, (_objectSpread5 = {}, _objectSpread5[key] = aliasValue ?
|
|
106
|
+
return _objectSpread(_objectSpread({}, collection), {}, (_objectSpread5 = {}, _objectSpread5[key] = aliasValue ? (0, _utils.getCSSProperty)('colors', value) : value, _objectSpread5));
|
|
105
107
|
}, {});
|
|
106
108
|
} // ported from ChromaJS
|
|
107
109
|
// https://github.com/gka/chroma.js/blob/d2c6d917df4ba2b87d8a740de116a0656bcbdfd5/src/io/lightness.coffee
|
|
@@ -177,8 +177,13 @@ var TimeField = function TimeField(_ref) {
|
|
|
177
177
|
setHours(updatedHoursValue);
|
|
178
178
|
setHoursDisplay(updatedHoursValue);
|
|
179
179
|
} else {
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
if (updatedHoursValue === 12) {
|
|
181
|
+
setHours(12);
|
|
182
|
+
setHoursDisplay(12);
|
|
183
|
+
} else {
|
|
184
|
+
setHours(updatedHoursValue + 12);
|
|
185
|
+
setHoursDisplay(updatedHoursValue);
|
|
186
|
+
}
|
|
182
187
|
}
|
|
183
188
|
} else {
|
|
184
189
|
setHours(updatedHoursValue);
|
|
@@ -187,63 +187,63 @@ export var buttonThemes = {
|
|
|
187
187
|
},
|
|
188
188
|
error: {
|
|
189
189
|
fill: {
|
|
190
|
-
color: '
|
|
191
|
-
backgroundColor: '
|
|
190
|
+
color: 'white',
|
|
191
|
+
backgroundColor: 'error',
|
|
192
192
|
hover: {
|
|
193
|
-
backgroundColor: '
|
|
193
|
+
backgroundColor: 'error-dark'
|
|
194
194
|
},
|
|
195
195
|
active: {
|
|
196
|
-
backgroundColor: '
|
|
196
|
+
backgroundColor: 'error-darker'
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
outline: {
|
|
200
|
-
stroke: '
|
|
201
|
-
color: '
|
|
200
|
+
stroke: 'error',
|
|
201
|
+
color: 'error',
|
|
202
202
|
hover: {
|
|
203
|
-
backgroundColor: '
|
|
203
|
+
backgroundColor: 'error-lightest'
|
|
204
204
|
},
|
|
205
205
|
active: {
|
|
206
|
-
backgroundColor: '
|
|
206
|
+
backgroundColor: 'error-lighter'
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
209
|
naked: {
|
|
210
210
|
color: 'error',
|
|
211
211
|
hover: {
|
|
212
|
-
backgroundColor: '
|
|
212
|
+
backgroundColor: 'error-lightest'
|
|
213
213
|
},
|
|
214
214
|
active: {
|
|
215
|
-
backgroundColor: '
|
|
215
|
+
backgroundColor: 'error-lighter'
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
219
|
success: {
|
|
220
220
|
fill: {
|
|
221
|
-
color: '
|
|
222
|
-
backgroundColor: '
|
|
221
|
+
color: 'white',
|
|
222
|
+
backgroundColor: 'success',
|
|
223
223
|
hover: {
|
|
224
|
-
backgroundColor: '
|
|
224
|
+
backgroundColor: 'success-dark'
|
|
225
225
|
},
|
|
226
226
|
active: {
|
|
227
|
-
backgroundColor: '
|
|
227
|
+
backgroundColor: 'success-darker'
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
outline: {
|
|
231
|
-
stroke: '
|
|
232
|
-
color: '
|
|
231
|
+
stroke: 'success',
|
|
232
|
+
color: 'success',
|
|
233
233
|
hover: {
|
|
234
|
-
backgroundColor: '
|
|
234
|
+
backgroundColor: 'success-lightest'
|
|
235
235
|
},
|
|
236
236
|
active: {
|
|
237
|
-
backgroundColor: '
|
|
237
|
+
backgroundColor: 'success-lighter'
|
|
238
238
|
}
|
|
239
239
|
},
|
|
240
240
|
naked: {
|
|
241
|
-
color: '
|
|
241
|
+
color: 'success',
|
|
242
242
|
hover: {
|
|
243
|
-
backgroundColor: '
|
|
243
|
+
backgroundColor: 'success-lightest'
|
|
244
244
|
},
|
|
245
245
|
active: {
|
|
246
|
-
backgroundColor: '
|
|
246
|
+
backgroundColor: 'success-lighter'
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
},
|
|
@@ -5,6 +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 { darken, setLightness, parseToRgb, parseToHsl, rgba, mix, getLuminance, toColorString } from 'polished';
|
|
8
|
+
import { getCSSProperty } from '../../utils';
|
|
8
9
|
|
|
9
10
|
function capitalizeFirstLetter(string) {
|
|
10
11
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
@@ -81,7 +82,7 @@ export function flattenPalette(palette) {
|
|
|
81
82
|
|
|
82
83
|
var value = parsedPalette[key];
|
|
83
84
|
var aliasValue = parsedPalette[value];
|
|
84
|
-
return _objectSpread(_objectSpread({}, collection), {}, (_objectSpread5 = {}, _objectSpread5[key] = aliasValue ?
|
|
85
|
+
return _objectSpread(_objectSpread({}, collection), {}, (_objectSpread5 = {}, _objectSpread5[key] = aliasValue ? getCSSProperty('colors', value) : value, _objectSpread5));
|
|
85
86
|
}, {});
|
|
86
87
|
} // ported from ChromaJS
|
|
87
88
|
// https://github.com/gka/chroma.js/blob/d2c6d917df4ba2b87d8a740de116a0656bcbdfd5/src/io/lightness.coffee
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
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/Button/Button.mdx
CHANGED
|
@@ -10,6 +10,7 @@ isParent: true
|
|
|
10
10
|
const themes = [
|
|
11
11
|
{ title: 'Default' },
|
|
12
12
|
{ title: 'Primary', theme: 'primary' },
|
|
13
|
+
{ title: 'Success', theme: 'success' },
|
|
13
14
|
{ title: 'Warning', theme: 'warning' },
|
|
14
15
|
{ title: 'Error', theme: 'error' },
|
|
15
16
|
{ title: 'Info', theme: 'info' },
|
|
@@ -198,8 +198,13 @@ const TimeField = ({
|
|
|
198
198
|
setHours(updatedHoursValue)
|
|
199
199
|
setHoursDisplay(updatedHoursValue)
|
|
200
200
|
} else {
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
if (updatedHoursValue === 12) {
|
|
202
|
+
setHours(12)
|
|
203
|
+
setHoursDisplay(12)
|
|
204
|
+
} else {
|
|
205
|
+
setHours(updatedHoursValue + 12)
|
|
206
|
+
setHoursDisplay(updatedHoursValue)
|
|
207
|
+
}
|
|
203
208
|
}
|
|
204
209
|
} else {
|
|
205
210
|
setHours(updatedHoursValue)
|
|
@@ -115,40 +115,40 @@ export const buttonThemes = {
|
|
|
115
115
|
},
|
|
116
116
|
error: {
|
|
117
117
|
fill: {
|
|
118
|
-
color: '
|
|
119
|
-
backgroundColor: '
|
|
120
|
-
hover: { backgroundColor: '
|
|
121
|
-
active: { backgroundColor: '
|
|
118
|
+
color: 'white',
|
|
119
|
+
backgroundColor: 'error',
|
|
120
|
+
hover: { backgroundColor: 'error-dark' },
|
|
121
|
+
active: { backgroundColor: 'error-darker' },
|
|
122
122
|
},
|
|
123
123
|
outline: {
|
|
124
|
-
stroke: '
|
|
125
|
-
color: '
|
|
126
|
-
hover: { backgroundColor: '
|
|
127
|
-
active: { backgroundColor: '
|
|
124
|
+
stroke: 'error',
|
|
125
|
+
color: 'error',
|
|
126
|
+
hover: { backgroundColor: 'error-lightest' },
|
|
127
|
+
active: { backgroundColor: 'error-lighter' },
|
|
128
128
|
},
|
|
129
129
|
naked: {
|
|
130
130
|
color: 'error',
|
|
131
|
-
hover: { backgroundColor: '
|
|
132
|
-
active: { backgroundColor: '
|
|
131
|
+
hover: { backgroundColor: 'error-lightest' },
|
|
132
|
+
active: { backgroundColor: 'error-lighter' },
|
|
133
133
|
},
|
|
134
134
|
},
|
|
135
135
|
success: {
|
|
136
136
|
fill: {
|
|
137
|
-
color: '
|
|
138
|
-
backgroundColor: '
|
|
139
|
-
hover: { backgroundColor: '
|
|
140
|
-
active: { backgroundColor: '
|
|
137
|
+
color: 'white',
|
|
138
|
+
backgroundColor: 'success',
|
|
139
|
+
hover: { backgroundColor: 'success-dark' },
|
|
140
|
+
active: { backgroundColor: 'success-darker' },
|
|
141
141
|
},
|
|
142
142
|
outline: {
|
|
143
|
-
stroke: '
|
|
144
|
-
color: '
|
|
145
|
-
hover: { backgroundColor: '
|
|
146
|
-
active: { backgroundColor: '
|
|
143
|
+
stroke: 'success',
|
|
144
|
+
color: 'success',
|
|
145
|
+
hover: { backgroundColor: 'success-lightest' },
|
|
146
|
+
active: { backgroundColor: 'success-lighter' },
|
|
147
147
|
},
|
|
148
148
|
naked: {
|
|
149
|
-
color: '
|
|
150
|
-
hover: { backgroundColor: '
|
|
151
|
-
active: { backgroundColor: '
|
|
149
|
+
color: 'success',
|
|
150
|
+
hover: { backgroundColor: 'success-lightest' },
|
|
151
|
+
active: { backgroundColor: 'success-lighter' },
|
|
152
152
|
},
|
|
153
153
|
},
|
|
154
154
|
info: {
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getLuminance,
|
|
9
9
|
toColorString,
|
|
10
10
|
} from 'polished'
|
|
11
|
+
import { getCSSProperty } from '../../utils'
|
|
11
12
|
|
|
12
13
|
function capitalizeFirstLetter(string) {
|
|
13
14
|
return string.charAt(0).toUpperCase() + string.slice(1)
|
|
@@ -91,7 +92,7 @@ export function flattenPalette(palette) {
|
|
|
91
92
|
const aliasValue = parsedPalette[value]
|
|
92
93
|
return {
|
|
93
94
|
...collection,
|
|
94
|
-
[key]: aliasValue ?
|
|
95
|
+
[key]: aliasValue ? getCSSProperty('colors', value) : value,
|
|
95
96
|
}
|
|
96
97
|
}, {})
|
|
97
98
|
}
|