@eqtylab/equality 2.1.2 → 2.1.4

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/index.d.cts CHANGED
@@ -437,8 +437,9 @@ interface FilterDropdownProps {
437
437
  onClearAll: () => void;
438
438
  buttonClassName?: string;
439
439
  contentClassName?: string;
440
+ disabled?: boolean;
440
441
  }
441
- declare const FilterDropdown: ({ label, options, selectedFilters, onToggleFilter, onClearAll, buttonClassName, contentClassName, }: FilterDropdownProps) => react_jsx_runtime.JSX.Element;
442
+ declare const FilterDropdown: ({ label, options, selectedFilters, onToggleFilter, onClearAll, buttonClassName, contentClassName, disabled, }: FilterDropdownProps) => react_jsx_runtime.JSX.Element;
442
443
 
443
444
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
444
445
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
@@ -781,8 +782,8 @@ declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedH
781
782
 
782
783
  type FormatDateDisplayMode = 'relative' | 'absolute';
783
784
  interface FormatDateProps extends Omit<React$1.TimeHTMLAttributes<HTMLTimeElement>, 'dateTime' | 'children'> {
784
- /** The date to display. Accepts an ISO 8601 string, epoch milliseconds, or a Date. */
785
- date: string | number | Date;
785
+ /** The date to display. Accepts an ISO 8601 string, epoch milliseconds, or a Date. A missing value (null, undefined, or empty string) renders a placeholder. */
786
+ date: string | number | Date | null | undefined;
786
787
  /** Render relative ("2 weeks ago") or absolute ("Jun 9 2026, 18:42:03 UTC") time. */
787
788
  displayAs?: FormatDateDisplayMode;
788
789
  /** Time zone used for absolute formatting. Defaults to "UTC". */
package/dist/index.d.ts CHANGED
@@ -437,8 +437,9 @@ interface FilterDropdownProps {
437
437
  onClearAll: () => void;
438
438
  buttonClassName?: string;
439
439
  contentClassName?: string;
440
+ disabled?: boolean;
440
441
  }
441
- declare const FilterDropdown: ({ label, options, selectedFilters, onToggleFilter, onClearAll, buttonClassName, contentClassName, }: FilterDropdownProps) => react_jsx_runtime.JSX.Element;
442
+ declare const FilterDropdown: ({ label, options, selectedFilters, onToggleFilter, onClearAll, buttonClassName, contentClassName, disabled, }: FilterDropdownProps) => react_jsx_runtime.JSX.Element;
442
443
 
443
444
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
444
445
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
@@ -781,8 +782,8 @@ declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedH
781
782
 
782
783
  type FormatDateDisplayMode = 'relative' | 'absolute';
783
784
  interface FormatDateProps extends Omit<React$1.TimeHTMLAttributes<HTMLTimeElement>, 'dateTime' | 'children'> {
784
- /** The date to display. Accepts an ISO 8601 string, epoch milliseconds, or a Date. */
785
- date: string | number | Date;
785
+ /** The date to display. Accepts an ISO 8601 string, epoch milliseconds, or a Date. A missing value (null, undefined, or empty string) renders a placeholder. */
786
+ date: string | number | Date | null | undefined;
786
787
  /** Render relative ("2 weeks ago") or absolute ("Jun 9 2026, 18:42:03 UTC") time. */
787
788
  displayAs?: FormatDateDisplayMode;
788
789
  /** Time zone used for absolute formatting. Defaults to "UTC". */
package/dist/index.js CHANGED
@@ -1910,20 +1910,29 @@ var FilterDropdown = ({
1910
1910
  onToggleFilter,
1911
1911
  onClearAll,
1912
1912
  buttonClassName,
1913
- contentClassName
1913
+ contentClassName,
1914
+ disabled = false
1914
1915
  }) => {
1915
1916
  const hasSelectedFilters = selectedFilters.length > 0;
1916
1917
  const filteredOptions = options.filter(
1917
1918
  (option) => option.value && option.value.trim() !== "" && option.label && option.label.trim() !== ""
1918
1919
  );
1919
1920
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
1920
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "tertiary", className: cn(styles24["selector-button"], buttonClassName), children: [
1921
- /* @__PURE__ */ jsxs("span", { className: styles24["selector-button-content"], children: [
1922
- label,
1923
- hasSelectedFilters && /* @__PURE__ */ jsx(Badge, { variant: "primary", children: selectedFilters.length })
1924
- ] }),
1925
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: styles24["chevron-icon"] })
1926
- ] }) }),
1921
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1922
+ Button,
1923
+ {
1924
+ variant: "tertiary",
1925
+ disabled,
1926
+ className: cn(styles24["selector-button"], buttonClassName),
1927
+ children: [
1928
+ /* @__PURE__ */ jsxs("span", { className: styles24["selector-button-content"], children: [
1929
+ label,
1930
+ hasSelectedFilters && /* @__PURE__ */ jsx(Badge, { variant: "primary", children: selectedFilters.length })
1931
+ ] }),
1932
+ /* @__PURE__ */ jsx(ChevronDownIcon, { className: styles24["chevron-icon"] })
1933
+ ]
1934
+ }
1935
+ ) }),
1927
1936
  /* @__PURE__ */ jsxs(
1928
1937
  DropdownMenuContent,
1929
1938
  {
@@ -3185,6 +3194,10 @@ var RELATIVE_DIVISIONS = [
3185
3194
  { amount: Number.POSITIVE_INFINITY, unit: "year" }
3186
3195
  ];
3187
3196
  var LIVE_INTERVAL_MS = 3e4;
3197
+ var NO_DATE_PLACEHOLDER = "---";
3198
+ function isMissing(value) {
3199
+ return value == null || typeof value === "string" && value.trim() === "";
3200
+ }
3188
3201
  function toDate(value) {
3189
3202
  const date = value instanceof Date ? value : new Date(value);
3190
3203
  return Number.isNaN(date.getTime()) ? null : date;
@@ -3215,7 +3228,8 @@ function FormatDate({
3215
3228
  className,
3216
3229
  ...props
3217
3230
  }) {
3218
- const parsed = React16.useMemo(() => toDate(date), [date]);
3231
+ const missing = isMissing(date);
3232
+ const parsed = React16.useMemo(() => isMissing(date) ? null : toDate(date), [date]);
3219
3233
  const [now, setNow] = React16.useState(() => /* @__PURE__ */ new Date());
3220
3234
  const [mounted, setMounted] = React16.useState(false);
3221
3235
  const isRelative = displayAs === "relative";
@@ -3225,8 +3239,11 @@ function FormatDate({
3225
3239
  const id = setInterval(() => setNow(/* @__PURE__ */ new Date()), LIVE_INTERVAL_MS);
3226
3240
  return () => clearInterval(id);
3227
3241
  }, [isRelative, live]);
3242
+ if (missing) {
3243
+ return /* @__PURE__ */ jsx("span", { className: cn(styles56["format-date"], className), "aria-label": "No date", ...props, children: NO_DATE_PLACEHOLDER });
3244
+ }
3228
3245
  if (!parsed) {
3229
- return /* @__PURE__ */ jsx("time", { className: cn(styles56["format-date"], className), ...props, children: "Invalid date" });
3246
+ return /* @__PURE__ */ jsx("span", { className: cn(styles56["format-date"], className), ...props, children: "Invalid date" });
3230
3247
  }
3231
3248
  const machineValue = parsed.toISOString();
3232
3249
  const absolute = formatAbsolute(