@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.cjs CHANGED
@@ -4783,79 +4783,85 @@ function FileDropzone({
4783
4783
  inputRef.current?.click();
4784
4784
  }
4785
4785
  }
4786
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid gap-2", className), children: [
4787
- /* @__PURE__ */ jsxRuntime.jsxs(
4788
- "div",
4789
- {
4790
- role: "button",
4791
- tabIndex: disabled ? -1 : 0,
4792
- "aria-disabled": disabled,
4793
- "aria-describedby": message ? `${inputId}-message` : `${inputId}-hint`,
4794
- "aria-controls": inputId,
4795
- "data-dragging": dragging || void 0,
4796
- className: cn(
4797
- "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]",
4798
- dragging && "border-primary bg-primary/5",
4799
- disabled && "pointer-events-none opacity-50"
4800
- ),
4801
- onClick: () => {
4802
- if (!disabled) inputRef.current?.click();
4803
- },
4804
- onKeyDown,
4805
- onDragEnter: (event) => {
4806
- event.preventDefault();
4807
- if (!disabled) setDragging(true);
4808
- },
4809
- onDragOver: (event) => {
4810
- event.preventDefault();
4811
- },
4812
- onDragLeave: (event) => {
4813
- if (event.currentTarget.contains(event.relatedTarget)) {
4814
- return;
4786
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4787
+ "div",
4788
+ {
4789
+ className: cn("relative flex w-full min-w-0 flex-col gap-2", className),
4790
+ children: [
4791
+ /* @__PURE__ */ jsxRuntime.jsxs(
4792
+ "div",
4793
+ {
4794
+ role: "button",
4795
+ tabIndex: disabled ? -1 : 0,
4796
+ "aria-disabled": disabled,
4797
+ "aria-describedby": message ? `${inputId}-message` : `${inputId}-hint`,
4798
+ "aria-controls": inputId,
4799
+ "data-dragging": dragging || void 0,
4800
+ className: cn(
4801
+ "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]",
4802
+ dragging && "border-primary bg-primary/5",
4803
+ disabled && "pointer-events-none opacity-50"
4804
+ ),
4805
+ onClick: () => {
4806
+ if (!disabled) inputRef.current?.click();
4807
+ },
4808
+ onKeyDown,
4809
+ onDragEnter: (event) => {
4810
+ event.preventDefault();
4811
+ if (!disabled) setDragging(true);
4812
+ },
4813
+ onDragOver: (event) => {
4814
+ event.preventDefault();
4815
+ },
4816
+ onDragLeave: (event) => {
4817
+ if (event.currentTarget.contains(event.relatedTarget)) {
4818
+ return;
4819
+ }
4820
+ setDragging(false);
4821
+ },
4822
+ onDrop,
4823
+ children: [
4824
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: labels.idle }),
4825
+ /* @__PURE__ */ jsxRuntime.jsx(
4826
+ "p",
4827
+ {
4828
+ id: `${inputId}-hint`,
4829
+ className: "text-muted-foreground mt-1 text-xs",
4830
+ children: labels.hint
4831
+ }
4832
+ ),
4833
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary mt-3 inline-flex text-sm font-medium underline-offset-4", children: labels.browse })
4834
+ ]
4815
4835
  }
4816
- setDragging(false);
4817
- },
4818
- onDrop,
4819
- children: [
4820
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: labels.idle }),
4821
- /* @__PURE__ */ jsxRuntime.jsx(
4822
- "p",
4823
- {
4824
- id: `${inputId}-hint`,
4825
- className: "text-muted-foreground mt-1 text-xs",
4826
- children: labels.hint
4836
+ ),
4837
+ /* @__PURE__ */ jsxRuntime.jsx(
4838
+ "input",
4839
+ {
4840
+ id: inputId,
4841
+ ref: inputRef,
4842
+ type: "file",
4843
+ accept,
4844
+ disabled,
4845
+ "aria-label": labels.browse,
4846
+ className: "sr-only",
4847
+ onChange: (event) => {
4848
+ takeFile(event.target.files?.[0]);
4849
+ event.target.value = "";
4827
4850
  }
4828
- ),
4829
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary mt-3 inline-flex text-sm font-medium underline-offset-4", children: labels.browse })
4830
- ]
4831
- }
4832
- ),
4833
- /* @__PURE__ */ jsxRuntime.jsx(
4834
- "input",
4835
- {
4836
- id: inputId,
4837
- ref: inputRef,
4838
- type: "file",
4839
- accept,
4840
- disabled,
4841
- "aria-label": labels.browse,
4842
- className: "sr-only",
4843
- onChange: (event) => {
4844
- takeFile(event.target.files?.[0]);
4845
- event.target.value = "";
4846
- }
4847
- }
4848
- ),
4849
- message ? /* @__PURE__ */ jsxRuntime.jsx(
4850
- "p",
4851
- {
4852
- id: `${inputId}-message`,
4853
- role: "alert",
4854
- className: "text-destructive text-sm",
4855
- children: message
4856
- }
4857
- ) : null
4858
- ] });
4851
+ }
4852
+ ),
4853
+ message ? /* @__PURE__ */ jsxRuntime.jsx(
4854
+ "p",
4855
+ {
4856
+ id: `${inputId}-message`,
4857
+ role: "alert",
4858
+ className: "text-destructive text-sm",
4859
+ children: message
4860
+ }
4861
+ ) : null
4862
+ ]
4863
+ }
4864
+ );
4859
4865
  }
4860
4866
  function statusLabel(status, labels) {
4861
4867
  switch (status) {
@@ -4888,73 +4894,90 @@ function FileUploadTray({
4888
4894
  const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
4889
4895
  const visible = jobs.filter((job) => job.status !== "cancelled");
4890
4896
  if (visible.length === 0) return null;
4891
- return /* @__PURE__ */ jsxRuntime.jsx("section", { "aria-label": labels.title, className: cn("grid gap-3", className), children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid gap-3", children: visible.map((job) => {
4892
- const active = job.status === "uploading" || job.status === "completing";
4893
- const canPause = job.status === "uploading";
4894
- const canResume = job.status === "paused";
4895
- const canCancel = job.status === "uploading" || job.status === "paused" || job.status === "error";
4896
- return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "grid gap-1.5", children: [
4897
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4898
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: job.name }),
4899
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs", children: statusLabel(job.status, labels) }),
4900
- canPause ? /* @__PURE__ */ jsxRuntime.jsx(
4901
- Button,
4902
- {
4903
- type: "button",
4904
- variant: "ghost",
4905
- size: "icon-sm",
4906
- "aria-label": `${labels.pause} ${job.name}`,
4907
- onClick: () => onPause(job.id),
4908
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, {})
4909
- }
4910
- ) : null,
4911
- canResume ? /* @__PURE__ */ jsxRuntime.jsx(
4912
- Button,
4913
- {
4914
- type: "button",
4915
- variant: "ghost",
4916
- size: "icon-sm",
4917
- "aria-label": `${labels.resume} ${job.name}`,
4918
- onClick: () => onResume(job.id),
4919
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, {})
4920
- }
4921
- ) : null,
4922
- canCancel ? /* @__PURE__ */ jsxRuntime.jsx(
4923
- Button,
4924
- {
4925
- type: "button",
4926
- variant: "ghost",
4927
- size: "icon-sm",
4928
- "aria-label": `${labels.cancel} ${job.name}`,
4929
- onClick: () => onCancel(job.id),
4930
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {})
4931
- }
4932
- ) : null
4933
- ] }),
4934
- /* @__PURE__ */ jsxRuntime.jsx(
4935
- "div",
4936
- {
4937
- role: "progressbar",
4938
- "aria-valuemin": 0,
4939
- "aria-valuemax": 100,
4940
- "aria-valuenow": job.percent,
4941
- "aria-label": job.name,
4942
- className: "bg-muted h-2 overflow-hidden rounded-full",
4943
- children: /* @__PURE__ */ jsxRuntime.jsx(
4897
+ return /* @__PURE__ */ jsxRuntime.jsx(
4898
+ "section",
4899
+ {
4900
+ "aria-label": labels.title,
4901
+ className: cn("grid min-w-0 gap-3", className),
4902
+ children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid min-w-0 gap-3", children: visible.map((job) => {
4903
+ const active = job.status === "uploading" || job.status === "completing";
4904
+ const canPause = job.status === "uploading";
4905
+ const canResume = job.status === "paused";
4906
+ const canCancel = job.status === "uploading" || job.status === "paused" || job.status === "error";
4907
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "grid min-w-0 gap-1.5", children: [
4908
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
4909
+ /* @__PURE__ */ jsxRuntime.jsx(
4910
+ "p",
4911
+ {
4912
+ className: "min-w-0 flex-1 truncate text-sm font-medium",
4913
+ title: job.name,
4914
+ children: job.name
4915
+ }
4916
+ ),
4917
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground shrink-0 text-xs", children: statusLabel(job.status, labels) }),
4918
+ canPause ? /* @__PURE__ */ jsxRuntime.jsx(
4919
+ Button,
4920
+ {
4921
+ type: "button",
4922
+ variant: "ghost",
4923
+ size: "icon-sm",
4924
+ className: "shrink-0",
4925
+ "aria-label": `${labels.pause} ${job.name}`,
4926
+ onClick: () => onPause(job.id),
4927
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, {})
4928
+ }
4929
+ ) : null,
4930
+ canResume ? /* @__PURE__ */ jsxRuntime.jsx(
4931
+ Button,
4932
+ {
4933
+ type: "button",
4934
+ variant: "ghost",
4935
+ size: "icon-sm",
4936
+ className: "shrink-0",
4937
+ "aria-label": `${labels.resume} ${job.name}`,
4938
+ onClick: () => onResume(job.id),
4939
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, {})
4940
+ }
4941
+ ) : null,
4942
+ canCancel ? /* @__PURE__ */ jsxRuntime.jsx(
4943
+ Button,
4944
+ {
4945
+ type: "button",
4946
+ variant: "ghost",
4947
+ size: "icon-sm",
4948
+ className: "shrink-0",
4949
+ "aria-label": `${labels.cancel} ${job.name}`,
4950
+ onClick: () => onCancel(job.id),
4951
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {})
4952
+ }
4953
+ ) : null
4954
+ ] }),
4955
+ /* @__PURE__ */ jsxRuntime.jsx(
4944
4956
  "div",
4945
4957
  {
4946
- className: cn(
4947
- "bg-primary h-full",
4948
- active && "motion-safe:transition-[width]"
4949
- ),
4950
- style: { width: `${job.percent}%` }
4958
+ role: "progressbar",
4959
+ "aria-valuemin": 0,
4960
+ "aria-valuemax": 100,
4961
+ "aria-valuenow": job.percent,
4962
+ "aria-label": job.name,
4963
+ className: "bg-muted h-2 overflow-hidden rounded-full",
4964
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4965
+ "div",
4966
+ {
4967
+ className: cn(
4968
+ "bg-primary h-full",
4969
+ active && "motion-safe:transition-[width]"
4970
+ ),
4971
+ style: { width: `${job.percent}%` }
4972
+ }
4973
+ )
4951
4974
  }
4952
- )
4953
- }
4954
- ),
4955
- job.error ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-destructive text-xs", children: job.error }) : null
4956
- ] }, job.id);
4957
- }) }) });
4975
+ ),
4976
+ job.error ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-destructive text-xs", children: job.error }) : null
4977
+ ] }, job.id);
4978
+ }) })
4979
+ }
4980
+ );
4958
4981
  }
4959
4982
  function formatActiveBadge(count) {
4960
4983
  return count > 9 ? "9+" : String(count);
@@ -5007,19 +5030,26 @@ function FileUploadMenu({
5007
5030
  ]
5008
5031
  }
5009
5032
  ) }),
5010
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align, className: "w-80 p-0", children: [
5011
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold", children: labels.title }) }),
5012
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-80 overflow-y-auto p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
5013
- FileUploadTray,
5014
- {
5015
- jobs: visible,
5016
- labels,
5017
- onPause,
5018
- onResume,
5019
- onCancel
5020
- }
5021
- ) })
5022
- ] })
5033
+ /* @__PURE__ */ jsxRuntime.jsxs(
5034
+ DropdownMenuContent,
5035
+ {
5036
+ align,
5037
+ className: "w-80 min-w-0 max-w-[calc(100vw-2rem)] overflow-x-hidden p-0",
5038
+ children: [
5039
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold", children: labels.title }) }),
5040
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-80 min-w-0 overflow-x-hidden overflow-y-auto p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
5041
+ FileUploadTray,
5042
+ {
5043
+ jobs: visible,
5044
+ labels,
5045
+ onPause,
5046
+ onResume,
5047
+ onCancel
5048
+ }
5049
+ ) })
5050
+ ]
5051
+ }
5052
+ )
5023
5053
  ]
5024
5054
  }
5025
5055
  );