@livo-tv/blocks 1.6.0 → 1.6.1

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.js CHANGED
@@ -4757,79 +4757,85 @@ function FileDropzone({
4757
4757
  inputRef.current?.click();
4758
4758
  }
4759
4759
  }
4760
- return /* @__PURE__ */ jsxs("div", { className: cn("grid gap-2", className), children: [
4761
- /* @__PURE__ */ jsxs(
4762
- "div",
4763
- {
4764
- role: "button",
4765
- tabIndex: disabled ? -1 : 0,
4766
- "aria-disabled": disabled,
4767
- "aria-describedby": message ? `${inputId}-message` : `${inputId}-hint`,
4768
- "aria-controls": inputId,
4769
- "data-dragging": dragging || void 0,
4770
- className: cn(
4771
- "border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 rounded-lg border border-dashed px-4 py-8 text-center outline-none focus-visible:ring-[3px]",
4772
- dragging && "border-primary bg-primary/5",
4773
- disabled && "pointer-events-none opacity-50"
4774
- ),
4775
- onClick: () => {
4776
- if (!disabled) inputRef.current?.click();
4777
- },
4778
- onKeyDown,
4779
- onDragEnter: (event) => {
4780
- event.preventDefault();
4781
- if (!disabled) setDragging(true);
4782
- },
4783
- onDragOver: (event) => {
4784
- event.preventDefault();
4785
- },
4786
- onDragLeave: (event) => {
4787
- if (event.currentTarget.contains(event.relatedTarget)) {
4788
- return;
4760
+ return /* @__PURE__ */ jsxs(
4761
+ "div",
4762
+ {
4763
+ className: cn("relative flex w-full min-w-0 flex-col gap-2", className),
4764
+ children: [
4765
+ /* @__PURE__ */ jsxs(
4766
+ "div",
4767
+ {
4768
+ role: "button",
4769
+ tabIndex: disabled ? -1 : 0,
4770
+ "aria-disabled": disabled,
4771
+ "aria-describedby": message ? `${inputId}-message` : `${inputId}-hint`,
4772
+ "aria-controls": inputId,
4773
+ "data-dragging": dragging || void 0,
4774
+ className: cn(
4775
+ "border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-lg border border-dashed px-4 py-8 text-center outline-none focus-visible:ring-[3px]",
4776
+ dragging && "border-primary bg-primary/5",
4777
+ disabled && "pointer-events-none opacity-50"
4778
+ ),
4779
+ onClick: () => {
4780
+ if (!disabled) inputRef.current?.click();
4781
+ },
4782
+ onKeyDown,
4783
+ onDragEnter: (event) => {
4784
+ event.preventDefault();
4785
+ if (!disabled) setDragging(true);
4786
+ },
4787
+ onDragOver: (event) => {
4788
+ event.preventDefault();
4789
+ },
4790
+ onDragLeave: (event) => {
4791
+ if (event.currentTarget.contains(event.relatedTarget)) {
4792
+ return;
4793
+ }
4794
+ setDragging(false);
4795
+ },
4796
+ onDrop,
4797
+ children: [
4798
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: labels.idle }),
4799
+ /* @__PURE__ */ jsx(
4800
+ "p",
4801
+ {
4802
+ id: `${inputId}-hint`,
4803
+ className: "text-muted-foreground mt-1 text-xs",
4804
+ children: labels.hint
4805
+ }
4806
+ ),
4807
+ /* @__PURE__ */ jsx("span", { className: "text-primary mt-3 inline-flex text-sm font-medium underline-offset-4", children: labels.browse })
4808
+ ]
4789
4809
  }
4790
- setDragging(false);
4791
- },
4792
- onDrop,
4793
- children: [
4794
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: labels.idle }),
4795
- /* @__PURE__ */ jsx(
4796
- "p",
4797
- {
4798
- id: `${inputId}-hint`,
4799
- className: "text-muted-foreground mt-1 text-xs",
4800
- children: labels.hint
4810
+ ),
4811
+ /* @__PURE__ */ jsx(
4812
+ "input",
4813
+ {
4814
+ id: inputId,
4815
+ ref: inputRef,
4816
+ type: "file",
4817
+ accept,
4818
+ disabled,
4819
+ "aria-label": labels.browse,
4820
+ className: "sr-only",
4821
+ onChange: (event) => {
4822
+ takeFile(event.target.files?.[0]);
4823
+ event.target.value = "";
4801
4824
  }
4802
- ),
4803
- /* @__PURE__ */ jsx("span", { className: "text-primary mt-3 inline-flex text-sm font-medium underline-offset-4", children: labels.browse })
4804
- ]
4805
- }
4806
- ),
4807
- /* @__PURE__ */ jsx(
4808
- "input",
4809
- {
4810
- id: inputId,
4811
- ref: inputRef,
4812
- type: "file",
4813
- accept,
4814
- disabled,
4815
- "aria-label": labels.browse,
4816
- className: "sr-only",
4817
- onChange: (event) => {
4818
- takeFile(event.target.files?.[0]);
4819
- event.target.value = "";
4820
- }
4821
- }
4822
- ),
4823
- message ? /* @__PURE__ */ jsx(
4824
- "p",
4825
- {
4826
- id: `${inputId}-message`,
4827
- role: "alert",
4828
- className: "text-destructive text-sm",
4829
- children: message
4830
- }
4831
- ) : null
4832
- ] });
4825
+ }
4826
+ ),
4827
+ message ? /* @__PURE__ */ jsx(
4828
+ "p",
4829
+ {
4830
+ id: `${inputId}-message`,
4831
+ role: "alert",
4832
+ className: "text-destructive text-sm",
4833
+ children: message
4834
+ }
4835
+ ) : null
4836
+ ]
4837
+ }
4838
+ );
4833
4839
  }
4834
4840
  function statusLabel(status, labels) {
4835
4841
  switch (status) {
@@ -4862,73 +4868,90 @@ function FileUploadTray({
4862
4868
  const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
4863
4869
  const visible = jobs.filter((job) => job.status !== "cancelled");
4864
4870
  if (visible.length === 0) return null;
4865
- return /* @__PURE__ */ jsx("section", { "aria-label": labels.title, className: cn("grid gap-3", className), children: /* @__PURE__ */ jsx("ul", { className: "grid gap-3", children: visible.map((job) => {
4866
- const active = job.status === "uploading" || job.status === "completing";
4867
- const canPause = job.status === "uploading";
4868
- const canResume = job.status === "paused";
4869
- const canCancel = job.status === "uploading" || job.status === "paused" || job.status === "error";
4870
- return /* @__PURE__ */ jsxs("li", { className: "grid gap-1.5", children: [
4871
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
4872
- /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: job.name }),
4873
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: statusLabel(job.status, labels) }),
4874
- canPause ? /* @__PURE__ */ jsx(
4875
- Button,
4876
- {
4877
- type: "button",
4878
- variant: "ghost",
4879
- size: "icon-sm",
4880
- "aria-label": `${labels.pause} ${job.name}`,
4881
- onClick: () => onPause(job.id),
4882
- children: /* @__PURE__ */ jsx(Pause, {})
4883
- }
4884
- ) : null,
4885
- canResume ? /* @__PURE__ */ jsx(
4886
- Button,
4887
- {
4888
- type: "button",
4889
- variant: "ghost",
4890
- size: "icon-sm",
4891
- "aria-label": `${labels.resume} ${job.name}`,
4892
- onClick: () => onResume(job.id),
4893
- children: /* @__PURE__ */ jsx(Play, {})
4894
- }
4895
- ) : null,
4896
- canCancel ? /* @__PURE__ */ jsx(
4897
- Button,
4898
- {
4899
- type: "button",
4900
- variant: "ghost",
4901
- size: "icon-sm",
4902
- "aria-label": `${labels.cancel} ${job.name}`,
4903
- onClick: () => onCancel(job.id),
4904
- children: /* @__PURE__ */ jsx(X, {})
4905
- }
4906
- ) : null
4907
- ] }),
4908
- /* @__PURE__ */ jsx(
4909
- "div",
4910
- {
4911
- role: "progressbar",
4912
- "aria-valuemin": 0,
4913
- "aria-valuemax": 100,
4914
- "aria-valuenow": job.percent,
4915
- "aria-label": job.name,
4916
- className: "bg-muted h-2 overflow-hidden rounded-full",
4917
- children: /* @__PURE__ */ jsx(
4871
+ return /* @__PURE__ */ jsx(
4872
+ "section",
4873
+ {
4874
+ "aria-label": labels.title,
4875
+ className: cn("grid min-w-0 gap-3", className),
4876
+ children: /* @__PURE__ */ jsx("ul", { className: "grid min-w-0 gap-3", children: visible.map((job) => {
4877
+ const active = job.status === "uploading" || job.status === "completing";
4878
+ const canPause = job.status === "uploading";
4879
+ const canResume = job.status === "paused";
4880
+ const canCancel = job.status === "uploading" || job.status === "paused" || job.status === "error";
4881
+ return /* @__PURE__ */ jsxs("li", { className: "grid min-w-0 gap-1.5", children: [
4882
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
4883
+ /* @__PURE__ */ jsx(
4884
+ "p",
4885
+ {
4886
+ className: "min-w-0 flex-1 truncate text-sm font-medium",
4887
+ title: job.name,
4888
+ children: job.name
4889
+ }
4890
+ ),
4891
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground shrink-0 text-xs", children: statusLabel(job.status, labels) }),
4892
+ canPause ? /* @__PURE__ */ jsx(
4893
+ Button,
4894
+ {
4895
+ type: "button",
4896
+ variant: "ghost",
4897
+ size: "icon-sm",
4898
+ className: "shrink-0",
4899
+ "aria-label": `${labels.pause} ${job.name}`,
4900
+ onClick: () => onPause(job.id),
4901
+ children: /* @__PURE__ */ jsx(Pause, {})
4902
+ }
4903
+ ) : null,
4904
+ canResume ? /* @__PURE__ */ jsx(
4905
+ Button,
4906
+ {
4907
+ type: "button",
4908
+ variant: "ghost",
4909
+ size: "icon-sm",
4910
+ className: "shrink-0",
4911
+ "aria-label": `${labels.resume} ${job.name}`,
4912
+ onClick: () => onResume(job.id),
4913
+ children: /* @__PURE__ */ jsx(Play, {})
4914
+ }
4915
+ ) : null,
4916
+ canCancel ? /* @__PURE__ */ jsx(
4917
+ Button,
4918
+ {
4919
+ type: "button",
4920
+ variant: "ghost",
4921
+ size: "icon-sm",
4922
+ className: "shrink-0",
4923
+ "aria-label": `${labels.cancel} ${job.name}`,
4924
+ onClick: () => onCancel(job.id),
4925
+ children: /* @__PURE__ */ jsx(X, {})
4926
+ }
4927
+ ) : null
4928
+ ] }),
4929
+ /* @__PURE__ */ jsx(
4918
4930
  "div",
4919
4931
  {
4920
- className: cn(
4921
- "bg-primary h-full",
4922
- active && "motion-safe:transition-[width]"
4923
- ),
4924
- style: { width: `${job.percent}%` }
4932
+ role: "progressbar",
4933
+ "aria-valuemin": 0,
4934
+ "aria-valuemax": 100,
4935
+ "aria-valuenow": job.percent,
4936
+ "aria-label": job.name,
4937
+ className: "bg-muted h-2 overflow-hidden rounded-full",
4938
+ children: /* @__PURE__ */ jsx(
4939
+ "div",
4940
+ {
4941
+ className: cn(
4942
+ "bg-primary h-full",
4943
+ active && "motion-safe:transition-[width]"
4944
+ ),
4945
+ style: { width: `${job.percent}%` }
4946
+ }
4947
+ )
4925
4948
  }
4926
- )
4927
- }
4928
- ),
4929
- job.error ? /* @__PURE__ */ jsx("p", { role: "alert", className: "text-destructive text-xs", children: job.error }) : null
4930
- ] }, job.id);
4931
- }) }) });
4949
+ ),
4950
+ job.error ? /* @__PURE__ */ jsx("p", { role: "alert", className: "text-destructive text-xs", children: job.error }) : null
4951
+ ] }, job.id);
4952
+ }) })
4953
+ }
4954
+ );
4932
4955
  }
4933
4956
  function formatActiveBadge(count) {
4934
4957
  return count > 9 ? "9+" : String(count);
@@ -4981,19 +5004,26 @@ function FileUploadMenu({
4981
5004
  ]
4982
5005
  }
4983
5006
  ) }),
4984
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align, className: "w-80 p-0", children: [
4985
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: labels.title }) }),
4986
- /* @__PURE__ */ jsx("div", { className: "max-h-80 overflow-y-auto p-3", children: /* @__PURE__ */ jsx(
4987
- FileUploadTray,
4988
- {
4989
- jobs: visible,
4990
- labels,
4991
- onPause,
4992
- onResume,
4993
- onCancel
4994
- }
4995
- ) })
4996
- ] })
5007
+ /* @__PURE__ */ jsxs(
5008
+ DropdownMenuContent,
5009
+ {
5010
+ align,
5011
+ className: "w-80 min-w-0 max-w-[calc(100vw-2rem)] overflow-x-hidden p-0",
5012
+ children: [
5013
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: labels.title }) }),
5014
+ /* @__PURE__ */ jsx("div", { className: "max-h-80 min-w-0 overflow-x-hidden overflow-y-auto p-3", children: /* @__PURE__ */ jsx(
5015
+ FileUploadTray,
5016
+ {
5017
+ jobs: visible,
5018
+ labels,
5019
+ onPause,
5020
+ onResume,
5021
+ onCancel
5022
+ }
5023
+ ) })
5024
+ ]
5025
+ }
5026
+ )
4997
5027
  ]
4998
5028
  }
4999
5029
  );