@citizenplane/pimp 18.9.12 → 18.9.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "18.9.12",
3
+ "version": "18.9.14",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -218,9 +218,17 @@ const dynamicClasses = computed(() => [
218
218
 
219
219
  &--isInline {
220
220
  .cpAlert__body {
221
- flex-direction: row;
221
+ flex-flow: row wrap;
222
222
  align-items: center;
223
223
  }
224
+
225
+ .cpAlert__content {
226
+ flex: 0 1 auto;
227
+ }
228
+
229
+ .cpAlert__actions {
230
+ flex-shrink: 0;
231
+ }
224
232
  }
225
233
 
226
234
  &--isNeutral {
@@ -78,6 +78,7 @@ interface InputsOptions {
78
78
  type DateField = 'day' | 'month'
79
79
 
80
80
  interface Props {
81
+ allowEmpty?: boolean
81
82
  autocompleteBirthday?: boolean
82
83
  disabled?: boolean
83
84
  displayErrorMessage?: boolean
@@ -99,6 +100,7 @@ const props = withDefaults(defineProps<Props>(), {
99
100
  maxDate: () => DateTime.now().toISO(),
100
101
  label: '',
101
102
  required: false,
103
+ allowEmpty: false,
102
104
  disabled: false,
103
105
  isInvalid: false,
104
106
  errorMessage: '',
@@ -179,7 +181,7 @@ const areInputsEmpty = computed(() => {
179
181
  })
180
182
 
181
183
  const isDateValid = computed(() => {
182
- if (areInputsEmpty.value && !props.required) return true
184
+ if (areInputsEmpty.value && (!props.required || props.allowEmpty)) return true
183
185
 
184
186
  return (
185
187
  !props.isInvalid &&
@@ -476,7 +478,7 @@ watch(year, handleUpdate)
476
478
  opacity: 0.4;
477
479
  }
478
480
  }
479
-
481
+
480
482
  &--isInvalid {
481
483
  .cpDate__inputs,
482
484
  .cpDate__inputs:hover {