@stoker-platform/web-app 0.5.41 → 0.5.42

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.42
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: add clear button to month picker
8
+
3
9
  ## 0.5.41
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.41",
3
+ "version": "0.5.42",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
package/src/Form.tsx CHANGED
@@ -1247,20 +1247,33 @@ function TimestampField({
1247
1247
  form={form}
1248
1248
  />
1249
1249
  <FormControl>
1250
- <div className="flex w-fit flex-col gap-2 rounded-md border border-input">
1251
- <MonthPicker
1252
- currentMonth={
1253
- currentValue
1254
- ? keepTimezone(currentValue.toJSDate(), timezone)
1255
- : keepTimezone(new Date(), timezone)
1256
- }
1257
- onMonthChange={(date: Date | undefined) => {
1258
- if (!date) return
1259
- const newDate = DateTime.fromJSDate(date).setZone(timezone)
1260
- formField.onChange(Timestamp.fromDate(newDate.toJSDate()))
1261
- }}
1262
- disabled={isDisabled}
1263
- />
1250
+ <div className="flex flex-col gap-2">
1251
+ <div className="flex w-fit flex-col gap-2 rounded-md border border-input">
1252
+ <MonthPicker
1253
+ currentMonth={
1254
+ currentValue
1255
+ ? keepTimezone(currentValue.toJSDate(), timezone)
1256
+ : keepTimezone(new Date(), timezone)
1257
+ }
1258
+ onMonthChange={(date: Date | undefined) => {
1259
+ if (!date) return
1260
+ const newDate = DateTime.fromJSDate(date).setZone(timezone)
1261
+ formField.onChange(Timestamp.fromDate(newDate.toJSDate()))
1262
+ }}
1263
+ disabled={isDisabled}
1264
+ />
1265
+ </div>
1266
+ {formField.value && (
1267
+ <Button
1268
+ type="button"
1269
+ variant="outline"
1270
+ onClick={() => formField.onChange(null)}
1271
+ disabled={isDisabled}
1272
+ className="w-fit"
1273
+ >
1274
+ Clear
1275
+ </Button>
1276
+ )}
1264
1277
  </div>
1265
1278
  </FormControl>
1266
1279
  {description && <FormDescription>{description}</FormDescription>}