@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.
@@ -188,8 +188,13 @@ var TimeField = function TimeField(_ref) {
188
188
  setHours(updatedHoursValue);
189
189
  setHoursDisplay(updatedHoursValue);
190
190
  } else {
191
- setHours(updatedHoursValue + 12);
192
- setHoursDisplay(updatedHoursValue);
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: 'light-9',
195
- backgroundColor: 'red-5',
194
+ color: 'white',
195
+ backgroundColor: 'error',
196
196
  hover: {
197
- backgroundColor: 'red-4'
197
+ backgroundColor: 'error-dark'
198
198
  },
199
199
  active: {
200
- backgroundColor: 'red-3'
200
+ backgroundColor: 'error-darker'
201
201
  }
202
202
  },
203
203
  outline: {
204
- stroke: 'red-5',
205
- color: 'red-5',
204
+ stroke: 'error',
205
+ color: 'error',
206
206
  hover: {
207
- backgroundColor: 'red-0'
207
+ backgroundColor: 'error-lightest'
208
208
  },
209
209
  active: {
210
- backgroundColor: 'red-1'
210
+ backgroundColor: 'error-lighter'
211
211
  }
212
212
  },
213
213
  naked: {
214
214
  color: 'error',
215
215
  hover: {
216
- backgroundColor: 'red-0'
216
+ backgroundColor: 'error-lightest'
217
217
  },
218
218
  active: {
219
- backgroundColor: 'red-1'
219
+ backgroundColor: 'error-lighter'
220
220
  }
221
221
  }
222
222
  },
223
223
  success: {
224
224
  fill: {
225
- color: 'light-9',
226
- backgroundColor: 'green-5',
225
+ color: 'white',
226
+ backgroundColor: 'success',
227
227
  hover: {
228
- backgroundColor: 'green-4'
228
+ backgroundColor: 'success-dark'
229
229
  },
230
230
  active: {
231
- backgroundColor: 'green-3'
231
+ backgroundColor: 'success-darker'
232
232
  }
233
233
  },
234
234
  outline: {
235
- stroke: 'green-5',
236
- color: 'green-5',
235
+ stroke: 'success',
236
+ color: 'success',
237
237
  hover: {
238
- backgroundColor: 'green-0'
238
+ backgroundColor: 'success-lightest'
239
239
  },
240
240
  active: {
241
- backgroundColor: 'green-1'
241
+ backgroundColor: 'success-lighter'
242
242
  }
243
243
  },
244
244
  naked: {
245
- color: 'green',
245
+ color: 'success',
246
246
  hover: {
247
- backgroundColor: 'green-0'
247
+ backgroundColor: 'success-lightest'
248
248
  },
249
249
  active: {
250
- backgroundColor: 'green-1'
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 ? "var(--colors-" + value + ")" : value, _objectSpread5));
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
- setHours(updatedHoursValue + 12);
181
- setHoursDisplay(updatedHoursValue);
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: 'light-9',
191
- backgroundColor: 'red-5',
190
+ color: 'white',
191
+ backgroundColor: 'error',
192
192
  hover: {
193
- backgroundColor: 'red-4'
193
+ backgroundColor: 'error-dark'
194
194
  },
195
195
  active: {
196
- backgroundColor: 'red-3'
196
+ backgroundColor: 'error-darker'
197
197
  }
198
198
  },
199
199
  outline: {
200
- stroke: 'red-5',
201
- color: 'red-5',
200
+ stroke: 'error',
201
+ color: 'error',
202
202
  hover: {
203
- backgroundColor: 'red-0'
203
+ backgroundColor: 'error-lightest'
204
204
  },
205
205
  active: {
206
- backgroundColor: 'red-1'
206
+ backgroundColor: 'error-lighter'
207
207
  }
208
208
  },
209
209
  naked: {
210
210
  color: 'error',
211
211
  hover: {
212
- backgroundColor: 'red-0'
212
+ backgroundColor: 'error-lightest'
213
213
  },
214
214
  active: {
215
- backgroundColor: 'red-1'
215
+ backgroundColor: 'error-lighter'
216
216
  }
217
217
  }
218
218
  },
219
219
  success: {
220
220
  fill: {
221
- color: 'light-9',
222
- backgroundColor: 'green-5',
221
+ color: 'white',
222
+ backgroundColor: 'success',
223
223
  hover: {
224
- backgroundColor: 'green-4'
224
+ backgroundColor: 'success-dark'
225
225
  },
226
226
  active: {
227
- backgroundColor: 'green-3'
227
+ backgroundColor: 'success-darker'
228
228
  }
229
229
  },
230
230
  outline: {
231
- stroke: 'green-5',
232
- color: 'green-5',
231
+ stroke: 'success',
232
+ color: 'success',
233
233
  hover: {
234
- backgroundColor: 'green-0'
234
+ backgroundColor: 'success-lightest'
235
235
  },
236
236
  active: {
237
- backgroundColor: 'green-1'
237
+ backgroundColor: 'success-lighter'
238
238
  }
239
239
  },
240
240
  naked: {
241
- color: 'green',
241
+ color: 'success',
242
242
  hover: {
243
- backgroundColor: 'green-0'
243
+ backgroundColor: 'success-lightest'
244
244
  },
245
245
  active: {
246
- backgroundColor: 'green-1'
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 ? "var(--colors-" + value + ")" : value, _objectSpread5));
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.1",
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",
@@ -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
- setHours(updatedHoursValue + 12)
202
- setHoursDisplay(updatedHoursValue)
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: 'light-9',
119
- backgroundColor: 'red-5',
120
- hover: { backgroundColor: 'red-4' },
121
- active: { backgroundColor: 'red-3' },
118
+ color: 'white',
119
+ backgroundColor: 'error',
120
+ hover: { backgroundColor: 'error-dark' },
121
+ active: { backgroundColor: 'error-darker' },
122
122
  },
123
123
  outline: {
124
- stroke: 'red-5',
125
- color: 'red-5',
126
- hover: { backgroundColor: 'red-0' },
127
- active: { backgroundColor: 'red-1' },
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: 'red-0' },
132
- active: { backgroundColor: 'red-1' },
131
+ hover: { backgroundColor: 'error-lightest' },
132
+ active: { backgroundColor: 'error-lighter' },
133
133
  },
134
134
  },
135
135
  success: {
136
136
  fill: {
137
- color: 'light-9',
138
- backgroundColor: 'green-5',
139
- hover: { backgroundColor: 'green-4' },
140
- active: { backgroundColor: 'green-3' },
137
+ color: 'white',
138
+ backgroundColor: 'success',
139
+ hover: { backgroundColor: 'success-dark' },
140
+ active: { backgroundColor: 'success-darker' },
141
141
  },
142
142
  outline: {
143
- stroke: 'green-5',
144
- color: 'green-5',
145
- hover: { backgroundColor: 'green-0' },
146
- active: { backgroundColor: 'green-1' },
143
+ stroke: 'success',
144
+ color: 'success',
145
+ hover: { backgroundColor: 'success-lightest' },
146
+ active: { backgroundColor: 'success-lighter' },
147
147
  },
148
148
  naked: {
149
- color: 'green',
150
- hover: { backgroundColor: 'green-0' },
151
- active: { backgroundColor: 'green-1' },
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 ? `var(--colors-${value})` : value,
95
+ [key]: aliasValue ? getCSSProperty('colors', value) : value,
95
96
  }
96
97
  }, {})
97
98
  }