@stll/workspace-ui 0.10.0 → 0.10.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.
@@ -5,6 +5,7 @@ import { Loader2Icon, SquareMinusIcon } from "lucide-react";
5
5
  import { useFormatter, useLocale, useTranslations } from "use-intl";
6
6
  import { formatMoneyCents } from "@stll/money";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { Temporal } from "temporal-polyfill/full";
8
9
  import { BidiText } from "@stll/ui/bidi-text";
9
10
  import { Skeleton } from "@stll/ui/skeleton";
10
11
  import { cn } from "@stll/ui/utils";
@@ -197,8 +198,9 @@ const TextFieldValue = ({ content, variant }) => {
197
198
  };
198
199
  const DateFieldValue = ({ content, property, variant }) => {
199
200
  const format = useFormatter();
200
- const date = content.value ? new Date(content.value) : null;
201
- if (!date || Number.isNaN(date.getTime())) {
201
+ const value = content.value;
202
+ const date = value !== null && /^\d{4}-\d{2}-\d{2}$/u.test(value) ? Result.try(() => Temporal.PlainDate.from(value)).unwrapOr(null) : null;
203
+ if (date === null) {
202
204
  if (variant === "table") return /* @__PURE__ */ jsx(SelectFieldValue, {
203
205
  property,
204
206
  value: null,
@@ -206,7 +208,10 @@ const DateFieldValue = ({ content, property, variant }) => {
206
208
  });
207
209
  return /* @__PURE__ */ jsx(EmptyFieldValue, { variant });
208
210
  }
209
- const formatted = format.dateTime(date, {
211
+ const formatted = format.dateTime(date.toZonedDateTime({
212
+ plainTime: Temporal.PlainTime.from("00:00"),
213
+ timeZone: "UTC"
214
+ }).epochMilliseconds, {
210
215
  year: "numeric",
211
216
  month: "short",
212
217
  day: "numeric",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/workspace-ui",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Reusable workspace presentation components and view helpers for Stella.",
5
5
  "keywords": [
6
6
  "calculations",
@@ -119,10 +119,11 @@
119
119
  "@stll/calculations": "^0.1.1",
120
120
  "@stll/conditions": "^0.3.1",
121
121
  "@stll/money": "^0.2.0",
122
- "@stll/ui": "^0.25.1",
123
- "better-result": "3.0.0",
124
- "lucide-react": "1.30.0",
125
- "use-intl": "4.13.5"
122
+ "@stll/ui": "^0.26.1",
123
+ "better-result": "3.0.1",
124
+ "lucide-react": "1.39.0",
125
+ "temporal-polyfill": "1.0.4",
126
+ "use-intl": "4.14.2"
126
127
  },
127
128
  "devDependencies": {
128
129
  "@atlaskit/pragmatic-drag-and-drop": "^3.1.0",