@constructive-io/sheets 0.11.0 → 0.13.0

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/advanced.cjs CHANGED
@@ -187,7 +187,6 @@ var init_sheets_i18n = __esm({
187
187
  var date_editor_exports = {};
188
188
  __export(date_editor_exports, {
189
189
  DateEditor: () => DateEditor,
190
- dateOnlyStringFromCalendarValue: () => dateOnlyStringFromCalendarValue,
191
190
  extractDateOnly: () => extractDateOnly,
192
191
  formatDate: () => formatDate,
193
192
  formatForInput: () => formatForInput,
@@ -231,10 +230,6 @@ function resolveDateType(value, explicitType) {
231
230
  }
232
231
  return getDateType(value);
233
232
  }
234
- function dateOnlyStringFromCalendarValue(dateValue) {
235
- const date = dateValueToDate(dateValue);
236
- return date ? toLocalDateString(date) : "";
237
- }
238
233
  var import_react3, import_date, import_button2, import_calendar_rac, import_jsx_runtime4, TIME_RE, MAC_UA_RE2, DATE_ONLY_RE, getDateType, formatDate, formatForInput, dateToDateValue, dateValueToDate, DateEditor;
239
234
  var init_date_editor = __esm({
240
235
  "src/grid/editors/date-editor.tsx"() {
@@ -498,7 +493,7 @@ var init_date_editor = __esm({
498
493
  step: "1",
499
494
  value: formatForInput(dateValue, "time"),
500
495
  onChange: (e) => handleTimeChange(e.target.value),
501
- className: "bg-muted/40 border-border/40 text-foreground w-full rounded-md border px-3 py-2 text-sm outline-none focus:border-primary/60 focus:ring-2 focus:ring-primary/20",
496
+ className: "bg-muted/40 border-border/40 text-foreground w-full rounded-md border px-3 py-2 text-sm outline-none focus-visible:border-ring/60 focus-visible:ring-[3px] focus-visible:ring-ring/35",
502
497
  autoFocus: true
503
498
  }
504
499
  ) })
@@ -521,7 +516,7 @@ var init_date_editor = __esm({
521
516
  step: "1",
522
517
  value: dateValue ? new Date(dateValue).toTimeString().split(" ")[0].slice(0, 8) : "",
523
518
  onChange: (e) => handleTimeChange(e.target.value),
524
- className: "bg-muted/40 border-border/40 text-foreground w-full rounded-md border px-2.5 py-1.5 text-sm outline-none focus:border-primary/60 focus:ring-2 focus:ring-primary/20"
519
+ className: "bg-muted/40 border-border/40 text-foreground w-full rounded-md border px-2.5 py-1.5 text-sm outline-none focus-visible:border-ring/60 focus-visible:ring-[3px] focus-visible:ring-ring/35"
525
520
  }
526
521
  ) })
527
522
  ] })
@@ -707,7 +702,7 @@ function MapPicker({
707
702
  {
708
703
  onClick: () => handleResultSelect(result),
709
704
  disabled,
710
- className: "hover:bg-accent hover:text-accent-foreground w-full px-3 py-2 text-left text-sm\n disabled:cursor-not-allowed disabled:opacity-50",
705
+ className: "hover:bg-accent hover:text-accent-foreground w-full px-3 py-2 text-left text-sm\n disabled:cursor-not-allowed disabled:opacity-64",
711
706
  children: result.display_name
712
707
  },
713
708
  result.place_id
@@ -845,7 +840,7 @@ var init_map_picker = __esm({
845
840
  center: position || defaultCenter,
846
841
  zoom: position ? 15 : 10,
847
842
  style: { height: "100%", width: "100%" },
848
- className: cn("z-0", disabled && "pointer-events-none opacity-50"),
843
+ className: cn("z-0", disabled && "pointer-events-none opacity-64"),
849
844
  children: [
850
845
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
851
846
  TileLayer,
@@ -3088,7 +3083,18 @@ function ImageWithFallback({
3088
3083
  return maybeJSX ?? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-muted h-full w-full animate-pulse rounded-md" });
3089
3084
  }
3090
3085
  case "loaded": {
3091
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: currentSrc, alt, className: cn("object-cover", className), ...imgProps });
3086
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3087
+ "img",
3088
+ {
3089
+ src: currentSrc,
3090
+ alt,
3091
+ className: cn(
3092
+ "object-cover outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10",
3093
+ className
3094
+ ),
3095
+ ...imgProps
3096
+ }
3097
+ );
3092
3098
  }
3093
3099
  case "error": {
3094
3100
  const jsxFallback = fallbacks.find((f) => typeof f !== "string");
@@ -3112,7 +3118,7 @@ function RemoveButton({ onClick, label }) {
3112
3118
  "button",
3113
3119
  {
3114
3120
  type: "button",
3115
- className: "flex size-7 cursor-pointer items-center justify-center rounded-full\n border border-black/10 bg-white/70 text-black/50 shadow-xs backdrop-blur-sm\n transition-all outline-hidden hover:bg-white/90 hover:text-black/70\n dark:border-white/10 dark:bg-black/50 dark:text-white/70\n dark:hover:bg-black/70 dark:hover:text-white/90\n focus-visible:ring-ring/50 focus-visible:ring-[3px]",
3121
+ className: "flex size-7 cursor-pointer items-center justify-center rounded-full\n border border-black/10 bg-white/70 text-black/50 shadow-xs backdrop-blur-sm\n transition-[color,background-color,border-color,box-shadow] outline-hidden hover:bg-white/90 hover:text-black/70\n dark:border-white/10 dark:bg-black/50 dark:text-white/70\n dark:hover:bg-black/70 dark:hover:text-white/90\n focus-visible:ring-ring/50 focus-visible:ring-[3px]",
3116
3122
  onClick: (e) => {
3117
3123
  e.stopPropagation();
3118
3124
  onClick();
@@ -3374,7 +3380,7 @@ var ImageEditor = ({
3374
3380
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "bg-muted h-1.5 overflow-hidden rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3375
3381
  "div",
3376
3382
  {
3377
- className: "bg-primary h-1.5 rounded-full transition-all duration-300",
3383
+ className: "bg-primary h-1.5 rounded-full transition-[width] duration-(--duration-slow)",
3378
3384
  style: { width: `${uploadProgress.percentage}%` }
3379
3385
  }
3380
3386
  ) }),
@@ -3738,7 +3744,7 @@ var InetEditor = ({ value, onFinishedEditing }) => {
3738
3744
  value: editingValue,
3739
3745
  onChange: handleInputChange,
3740
3746
  placeholder: "192.168.1.1 or 10.0.0.0/24",
3741
- className: "bg-muted/40 border-border/40 text-foreground w-full rounded-md border px-3 py-2 font-mono text-sm outline-none focus:border-primary/60 focus:ring-2 focus:ring-primary/20",
3747
+ className: "bg-muted/40 border-border/40 text-foreground w-full rounded-md border px-3 py-2 font-mono text-sm outline-none focus-visible:border-ring/60 focus-visible:ring-[3px] focus-visible:ring-ring/35",
3742
3748
  autoFocus: true
3743
3749
  }
3744
3750
  ) }),
@@ -4846,14 +4852,14 @@ var RelationEditor = ({
4846
4852
  className: cn(
4847
4853
  "w-full rounded-md px-2 py-1.5 text-left",
4848
4854
  !disabled && "hover:bg-accent/50 cursor-pointer",
4849
- disabled && "cursor-not-allowed opacity-50",
4855
+ disabled && "cursor-not-allowed opacity-64",
4850
4856
  active3 && "bg-accent/60"
4851
4857
  ),
4852
4858
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
4853
4859
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RelationRecordTooltip, { record: row }),
4854
4860
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
4855
4861
  active3 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react6.Check, { className: "text-primary h-3.5 w-3.5 shrink-0" }),
4856
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_badge2.Badge, { variant: "outline", className: cn("text-2xs shrink-0", active3 && "border-primary/40 text-primary"), children: String(row?.id ?? "\u2014").slice(0, 8) })
4862
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_badge2.Badge, { variant: "outline", className: cn("text-2xs shrink-0", active3 && "border-primary/40 text-link"), children: String(row?.id ?? "\u2014").slice(0, 8) })
4857
4863
  ] })
4858
4864
  },
4859
4865
  id
@@ -5019,7 +5025,7 @@ var TsvectorEditor = ({ value, onFinishedEditing }) => {
5019
5025
  ] }),
5020
5026
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-muted flex max-h-[120px] flex-wrap gap-1 overflow-y-auto rounded p-2 text-sm", children: parsedTokens.map((t, index) => {
5021
5027
  const weight = t.weights[0];
5022
- const color = weight === "A" ? "bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-200" : weight === "B" ? "bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-200" : weight === "C" ? "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-200" : weight === "D" ? "bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-200" : "bg-primary/10 text-primary";
5028
+ const color = weight === "A" ? "bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-200" : weight === "B" ? "bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-200" : weight === "C" ? "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-200" : weight === "D" ? "bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-200" : "bg-primary/10 text-link";
5023
5029
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: cn("inline-flex items-center rounded px-2 py-1 text-xs", color), children: [
5024
5030
  t.lexeme,
5025
5031
  t.weights.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "ml-1 font-mono opacity-80", children: t.weights.join(",") })
@@ -5149,14 +5155,14 @@ var UrlEditor = ({ value, onFinishedEditing }) => {
5149
5155
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "bg-muted flex items-center gap-2 rounded p-2 text-sm", children: [
5150
5156
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react8.Link, { className: "text-muted-foreground h-3 w-3 flex-shrink-0" }),
5151
5157
  isValid ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
5152
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-primary truncate", children: displayText }),
5158
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-link truncate", children: displayText }),
5153
5159
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5154
5160
  import_button13.Button,
5155
5161
  {
5156
5162
  variant: "ghost",
5157
5163
  size: "sm",
5158
5164
  onClick: handleTestUrl,
5159
- className: "text-muted-foreground hover:text-primary h-6 w-6 p-0",
5165
+ className: "text-muted-foreground hover:text-link h-6 w-6 p-0",
5160
5166
  title: "Test URL",
5161
5167
  children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react8.ExternalLink, { className: "h-3 w-3" })
5162
5168
  }