@x-plat/design-system 0.5.4 → 0.5.6

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.
@@ -139,6 +139,21 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
139
139
 
140
140
  // src/tokens/svg/action/DownloadIcon.tsx
141
141
  var import_jsx_runtime5 = require("react/jsx-runtime");
142
+ var DownloadIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
143
+ "svg",
144
+ {
145
+ xmlns: "http://www.w3.org/2000/svg",
146
+ width: "1em",
147
+ height: "1em",
148
+ viewBox: "0 0 20 20",
149
+ fill: "none",
150
+ children: [
151
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M17.5 11.75C17.9142 11.75 18.25 12.0858 18.25 12.5V15.833C18.25 16.4739 17.9952 17.0888 17.542 17.542C17.0888 17.9952 16.4739 18.25 15.833 18.25H4.16699C3.52605 18.25 2.91122 17.9952 2.45801 17.542C2.00479 17.0888 1.75 16.4739 1.75 15.833V12.5C1.75 12.0858 2.08579 11.75 2.5 11.75C2.91421 11.75 3.25 12.0858 3.25 12.5V15.833C3.25 16.0761 3.34665 16.3095 3.51855 16.4814C3.69046 16.6534 3.92388 16.75 4.16699 16.75H15.833C16.0761 16.75 16.3095 16.6534 16.4814 16.4814C16.6534 16.3095 16.75 16.0761 16.75 15.833V12.5C16.75 12.0858 17.0858 11.75 17.5 11.75Z", fill: "currentColor" }),
152
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5V10.6885L13.6367 7.80273C13.9296 7.51026 14.4045 7.51013 14.6973 7.80273C14.9899 8.09552 14.9898 8.5704 14.6973 8.86328L10.5312 13.0303C10.4709 13.0906 10.4007 13.1354 10.3281 13.1709C10.3146 13.1776 10.3021 13.1865 10.2881 13.1924C10.253 13.207 10.2163 13.2156 10.1797 13.2246C10.1691 13.2272 10.1592 13.2322 10.1484 13.2344C10.1429 13.2355 10.1374 13.2363 10.1318 13.2373C10.0896 13.2448 10.0463 13.2489 10.002 13.249L10 13.25C9.95423 13.25 9.90972 13.2442 9.86621 13.2363C9.86168 13.2355 9.85706 13.2353 9.85254 13.2344C9.82836 13.2295 9.80551 13.221 9.78223 13.2139C9.76008 13.2071 9.73738 13.2022 9.71582 13.1934C9.68772 13.1818 9.66201 13.1661 9.63574 13.1514C9.5804 13.1204 9.52713 13.0842 9.47949 13.0381C9.47469 13.0334 9.46952 13.0292 9.46484 13.0244L5.30371 8.86328C5.01082 8.57039 5.01082 8.09563 5.30371 7.80273C5.59663 7.51021 6.07149 7.50996 6.36426 7.80273L9.25 10.6885V2.5C9.25 2.08579 9.58579 1.75 10 1.75Z", fill: "currentColor" })
153
+ ]
154
+ }
155
+ );
156
+ var DownloadIcon_default = DownloadIcon;
142
157
 
143
158
  // src/tokens/svg/action/Edit2Icon.tsx
144
159
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -585,6 +600,18 @@ var import_jsx_runtime123 = require("react/jsx-runtime");
585
600
 
586
601
  // src/tokens/svg/edit/TypeIcon.tsx
587
602
  var import_jsx_runtime124 = require("react/jsx-runtime");
603
+ var TypeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
604
+ "svg",
605
+ {
606
+ xmlns: "http://www.w3.org/2000/svg",
607
+ width: "1em",
608
+ height: "1em",
609
+ viewBox: "0 0 20 20",
610
+ fill: "none",
611
+ children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("path", { d: "M16.667 2.58301C17.0809 2.58327 17.4169 2.91907 17.417 3.33301V5.83301C17.417 6.24706 17.081 6.58274 16.667 6.58301C16.2529 6.58283 15.917 6.24711 15.917 5.83301V4.08301H10.75V15.917H12.5C12.9142 15.917 13.25 16.2528 13.25 16.667C13.2499 17.0811 12.9141 17.417 12.5 17.417H7.5C7.08587 17.417 6.75013 17.0811 6.75 16.667C6.75 16.2528 7.08579 15.917 7.5 15.917H9.25V4.08301H4.08398V5.83301C4.08398 6.24706 3.74797 6.58274 3.33398 6.58301C2.91977 6.58301 2.58301 6.24722 2.58301 5.83301V3.33301C2.58314 2.91891 2.91985 2.58301 3.33398 2.58301H16.667Z", fill: "currentColor" })
612
+ }
613
+ );
614
+ var TypeIcon_default = TypeIcon;
588
615
 
589
616
  // src/tokens/svg/edit/UnderlineIcon.tsx
590
617
  var import_jsx_runtime125 = require("react/jsx-runtime");
@@ -732,6 +759,23 @@ var import_jsx_runtime152 = require("react/jsx-runtime");
732
759
 
733
760
  // src/tokens/svg/layout/MaximizeIcon.tsx
734
761
  var import_jsx_runtime153 = require("react/jsx-runtime");
762
+ var MaximizeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
763
+ "svg",
764
+ {
765
+ xmlns: "http://www.w3.org/2000/svg",
766
+ width: "1em",
767
+ height: "1em",
768
+ viewBox: "0 0 20 20",
769
+ fill: "none",
770
+ children: [
771
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("path", { d: "M2.5 12.583C2.91411 12.583 3.24982 12.9189 3.25 13.333V15.833C3.25 16.0761 3.34665 16.3095 3.51855 16.4814C3.69046 16.6534 3.92388 16.75 4.16699 16.75H6.66699C7.08106 16.7502 7.41699 17.0859 7.41699 17.5C7.41699 17.9141 7.08106 18.2498 6.66699 18.25H4.16699C3.52605 18.25 2.91122 17.9952 2.45801 17.542C2.00479 17.0888 1.75 16.4739 1.75 15.833V13.333C1.75018 12.9189 2.08589 12.583 2.5 12.583Z", fill: "currentColor" }),
772
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("path", { d: "M17.5 12.583C17.9141 12.583 18.2498 12.9189 18.25 13.333V15.833C18.25 16.4739 17.9952 17.0888 17.542 17.542C17.0888 17.9952 16.4739 18.25 15.833 18.25H13.333C12.9189 18.2498 12.583 17.9141 12.583 17.5C12.583 17.0859 12.9189 16.7502 13.333 16.75H15.833C16.0761 16.75 16.3095 16.6534 16.4814 16.4814C16.6534 16.3095 16.75 16.0761 16.75 15.833V13.333C16.7502 12.9189 17.0859 12.583 17.5 12.583Z", fill: "currentColor" }),
773
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("path", { d: "M6.66699 1.75C7.08106 1.75018 7.41699 2.08589 7.41699 2.5C7.41699 2.91411 7.08106 3.24982 6.66699 3.25H4.16699C3.92388 3.25 3.69046 3.34665 3.51855 3.51855C3.34665 3.69046 3.25 3.92388 3.25 4.16699V6.66699C3.24982 7.08106 2.91411 7.41699 2.5 7.41699C2.08589 7.41699 1.75018 7.08106 1.75 6.66699V4.16699C1.75 3.52605 2.00479 2.91122 2.45801 2.45801C2.91122 2.00479 3.52605 1.75 4.16699 1.75H6.66699Z", fill: "currentColor" }),
774
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("path", { d: "M15.833 1.75C16.4739 1.75 17.0888 2.00479 17.542 2.45801C17.9952 2.91122 18.25 3.52605 18.25 4.16699V6.66699C18.2498 7.08106 17.9141 7.41699 17.5 7.41699C17.0859 7.41699 16.7502 7.08106 16.75 6.66699V4.16699C16.75 3.92388 16.6534 3.69046 16.4814 3.51855C16.3095 3.34665 16.0761 3.25 15.833 3.25H13.333C12.9189 3.24982 12.583 2.91411 12.583 2.5C12.583 2.08589 12.9189 1.75018 13.333 1.75H15.833Z", fill: "currentColor" })
775
+ ]
776
+ }
777
+ );
778
+ var MaximizeIcon_default = MaximizeIcon;
735
779
 
736
780
  // src/tokens/svg/layout/MenuIcon.tsx
737
781
  var import_jsx_runtime154 = require("react/jsx-runtime");
@@ -741,6 +785,23 @@ var import_jsx_runtime155 = require("react/jsx-runtime");
741
785
 
742
786
  // src/tokens/svg/layout/MinimizeIcon.tsx
743
787
  var import_jsx_runtime156 = require("react/jsx-runtime");
788
+ var MinimizeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
789
+ "svg",
790
+ {
791
+ xmlns: "http://www.w3.org/2000/svg",
792
+ width: "1em",
793
+ height: "1em",
794
+ viewBox: "0 0 20 20",
795
+ fill: "none",
796
+ children: [
797
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("path", { d: "M5 12.583C5.64094 12.583 6.25577 12.8378 6.70898 13.291C7.1622 13.7442 7.41699 14.3591 7.41699 15V17.5C7.41699 17.9141 7.08106 18.2498 6.66699 18.25C6.25278 18.25 5.91699 17.9142 5.91699 17.5V15C5.91699 14.7569 5.82035 14.5235 5.64844 14.3516C5.47653 14.1797 5.24311 14.083 5 14.083H2.5C2.08579 14.083 1.75 13.7472 1.75 13.333C1.75018 12.9189 2.08589 12.583 2.5 12.583H5Z", fill: "currentColor" }),
798
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("path", { d: "M17.5 12.583C17.9141 12.583 18.2498 12.9189 18.25 13.333C18.25 13.7472 17.9142 14.083 17.5 14.083H15C14.7569 14.083 14.5235 14.1797 14.3516 14.3516C14.1797 14.5235 14.083 14.7569 14.083 15V17.5C14.083 17.9142 13.7472 18.25 13.333 18.25C12.9189 18.2498 12.583 17.9141 12.583 17.5V15C12.583 14.3591 12.8378 13.7442 13.291 13.291C13.7442 12.8378 14.3591 12.583 15 12.583H17.5Z", fill: "currentColor" }),
799
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("path", { d: "M6.66699 1.75C7.08106 1.75018 7.41699 2.08589 7.41699 2.5V5C7.41699 5.64094 7.1622 6.25577 6.70898 6.70898C6.25577 7.1622 5.64094 7.41699 5 7.41699H2.5C2.08589 7.41699 1.75018 7.08106 1.75 6.66699C1.75 6.25278 2.08579 5.91699 2.5 5.91699H5C5.24312 5.91699 5.47653 5.82035 5.64844 5.64844C5.82035 5.47653 5.91699 5.24312 5.91699 5V2.5C5.91699 2.08579 6.25278 1.75 6.66699 1.75Z", fill: "currentColor" }),
800
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("path", { d: "M13.333 1.75C13.7472 1.75 14.083 2.08579 14.083 2.5V5C14.083 5.24311 14.1797 5.47653 14.3516 5.64844C14.5235 5.82035 14.7569 5.91699 15 5.91699H17.5C17.9142 5.91699 18.25 6.25278 18.25 6.66699C18.2498 7.08106 17.9141 7.41699 17.5 7.41699H15C14.3591 7.41699 13.7442 7.1622 13.291 6.70898C12.8378 6.25577 12.583 5.64094 12.583 5V2.5C12.583 2.08589 12.9189 1.75018 13.333 1.75Z", fill: "currentColor" })
801
+ ]
802
+ }
803
+ );
804
+ var MinimizeIcon_default = MinimizeIcon;
744
805
 
745
806
  // src/tokens/svg/layout/MoreHorizontalIcon.tsx
746
807
  var import_jsx_runtime157 = require("react/jsx-runtime");
@@ -862,6 +923,18 @@ var PlayCircleIcon_default = PlayCircleIcon;
862
923
 
863
924
  // src/tokens/svg/media/PlayIcon.tsx
864
925
  var import_jsx_runtime175 = require("react/jsx-runtime");
926
+ var PlayIcon = () => /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
927
+ "svg",
928
+ {
929
+ xmlns: "http://www.w3.org/2000/svg",
930
+ width: "1em",
931
+ height: "1em",
932
+ viewBox: "0 0 20 20",
933
+ fill: "none",
934
+ children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.80762 1.84203C4.0483 1.71076 4.3416 1.72119 4.57227 1.86937L16.2393 9.36937C16.4536 9.50742 16.584 9.74522 16.584 10.0002C16.5839 10.2552 16.4537 10.4931 16.2393 10.6311L4.57227 18.1311C4.34166 18.2792 4.04826 18.2896 3.80762 18.1584C3.56689 18.027 3.4161 17.7745 3.41602 17.5002V2.50023C3.41602 2.22588 3.56682 1.9735 3.80762 1.84203ZM4.91699 16.1262L14.4463 10.0002L4.91699 3.87328V16.1262Z", fill: "currentColor" })
935
+ }
936
+ );
937
+ var PlayIcon_default = PlayIcon;
865
938
 
866
939
  // src/tokens/svg/media/RepeatIcon.tsx
867
940
  var import_jsx_runtime176 = require("react/jsx-runtime");
@@ -892,12 +965,55 @@ var import_jsx_runtime184 = require("react/jsx-runtime");
892
965
 
893
966
  // src/tokens/svg/media/Volume2Icon.tsx
894
967
  var import_jsx_runtime185 = require("react/jsx-runtime");
968
+ var Volume2Icon = () => /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
969
+ "svg",
970
+ {
971
+ xmlns: "http://www.w3.org/2000/svg",
972
+ width: "1em",
973
+ height: "1em",
974
+ viewBox: "0 0 20 20",
975
+ fill: "none",
976
+ children: [
977
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("path", { d: "M15.3613 3.57827C15.6542 3.28549 16.129 3.28554 16.4219 3.57827C18.1247 5.28162 19.082 7.59163 19.082 10.0001C19.082 12.4087 18.1247 14.7187 16.4219 16.422C16.129 16.7147 15.6542 16.7147 15.3613 16.422C15.0687 16.1292 15.0687 15.6543 15.3613 15.3615C16.7829 13.9394 17.582 12.0109 17.582 10.0001C17.582 7.98938 16.7829 6.06088 15.3613 4.63882C15.0686 4.34597 15.0687 3.87112 15.3613 3.57827Z", fill: "currentColor" }),
978
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.69824 3.5812C8.92336 3.40117 9.23238 3.36648 9.49219 3.49135C9.75153 3.61641 9.91699 3.87916 9.91699 4.16714V15.8341C9.91671 16.122 9.75157 16.385 9.49219 16.5099C9.23253 16.6347 8.92333 16.5988 8.69824 16.4191L4.7373 13.2501H1.66699C1.25291 13.2501 0.916235 12.9142 0.916016 12.5001V7.50014C0.916192 7.08608 1.25289 6.75014 1.66699 6.75014H4.73828L8.69824 3.5812ZM5.46875 8.08608C5.3359 8.19235 5.17011 8.25003 5 8.25014H2.41699V11.7501H5C5.17013 11.7503 5.33589 11.8089 5.46875 11.9152L8.41699 14.2726V5.72768L5.46875 8.08608Z", fill: "currentColor" }),
979
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("path", { d: "M12.4199 6.51967C12.7128 6.22695 13.1876 6.22696 13.4805 6.51967C14.4022 7.44168 14.9199 8.69255 14.9199 9.99624C14.9198 11.2998 14.4021 12.5499 13.4805 13.4718C13.1876 13.7647 12.7128 13.7646 12.4199 13.4718C12.1273 13.179 12.1272 12.7041 12.4199 12.4113C13.0602 11.7707 13.4198 10.902 13.4199 9.99624C13.4199 9.0903 13.0604 8.22093 12.4199 7.58022C12.1271 7.28731 12.1271 6.81251 12.4199 6.51967Z", fill: "currentColor" })
980
+ ]
981
+ }
982
+ );
983
+ var Volume2Icon_default = Volume2Icon;
895
984
 
896
985
  // src/tokens/svg/media/VolumeIcon.tsx
897
986
  var import_jsx_runtime186 = require("react/jsx-runtime");
987
+ var VolumeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
988
+ "svg",
989
+ {
990
+ xmlns: "http://www.w3.org/2000/svg",
991
+ width: "1em",
992
+ height: "1em",
993
+ viewBox: "0 0 20 20",
994
+ fill: "none",
995
+ children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.69824 3.58112C8.92336 3.40111 9.23239 3.36641 9.49219 3.49127C9.75155 3.61632 9.91699 3.87906 9.91699 4.16705V15.834C9.91675 16.1219 9.75157 16.3849 9.49219 16.5098C9.23251 16.6346 8.92333 16.5988 8.69824 16.419L4.7373 13.2501H1.66699C1.25288 13.2501 0.916186 12.9141 0.916016 12.5001V7.50006C0.916192 7.086 1.25289 6.75006 1.66699 6.75006H4.73828L8.69824 3.58112ZM5.46875 8.086C5.3359 8.19226 5.17011 8.24995 5 8.25006H2.41699V11.7501H5C5.17013 11.7502 5.33589 11.8088 5.46875 11.9151L8.41699 14.2725V5.7276L5.46875 8.086Z", fill: "currentColor" })
996
+ }
997
+ );
998
+ var VolumeIcon_default = VolumeIcon;
898
999
 
899
1000
  // src/tokens/svg/media/VolumeXIcon.tsx
900
1001
  var import_jsx_runtime187 = require("react/jsx-runtime");
1002
+ var VolumeXIcon = () => /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
1003
+ "svg",
1004
+ {
1005
+ xmlns: "http://www.w3.org/2000/svg",
1006
+ width: "1em",
1007
+ height: "1em",
1008
+ viewBox: "0 0 20 20",
1009
+ fill: "none",
1010
+ children: [
1011
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.69824 3.58112C8.92336 3.40111 9.23239 3.36641 9.49219 3.49127C9.75155 3.61632 9.91699 3.87906 9.91699 4.16705V15.834C9.91675 16.1219 9.75157 16.3849 9.49219 16.5098C9.23251 16.6346 8.92333 16.5988 8.69824 16.419L4.7373 13.2501H1.66699C1.25288 13.2501 0.916186 12.9141 0.916016 12.5001V7.50006C0.916192 7.086 1.25289 6.75006 1.66699 6.75006H4.73828L8.69824 3.58112ZM5.46875 8.086C5.3359 8.19226 5.17011 8.24995 5 8.25006H2.41699V11.7501H5C5.17013 11.7502 5.33589 11.8088 5.46875 11.9151L8.41699 14.2725V5.7276L5.46875 8.086Z", fill: "currentColor" }),
1012
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("path", { d: "M18.6367 6.96979C18.9296 6.6771 19.4044 6.67696 19.6973 6.96979C19.9898 7.26263 19.9899 7.73752 19.6973 8.03033L17.7275 10.0001L19.6973 11.9698C19.9898 12.2626 19.9899 12.7375 19.6973 13.0303C19.4045 13.3231 18.9296 13.3229 18.6367 13.0303L16.667 11.0606L14.6973 13.0303C14.4045 13.3231 13.9296 13.3229 13.6367 13.0303C13.3438 12.7374 13.3438 12.2627 13.6367 11.9698L15.6064 10.0001L13.6367 8.03033C13.3438 7.73744 13.3438 7.26268 13.6367 6.96979C13.9296 6.6771 14.4044 6.67696 14.6973 6.96979L16.667 8.93951L18.6367 6.96979Z", fill: "currentColor" })
1013
+ ]
1014
+ }
1015
+ );
1016
+ var VolumeXIcon_default = VolumeXIcon;
901
1017
 
902
1018
  // src/tokens/svg/misc/AnchorIcon.tsx
903
1019
  var import_jsx_runtime188 = require("react/jsx-runtime");
@@ -4434,6 +4550,8 @@ var TableCell = import_react34.default.memo((props) => {
4434
4550
  children,
4435
4551
  align = "center",
4436
4552
  isSticky = false,
4553
+ width,
4554
+ nowrap = false,
4437
4555
  onClick
4438
4556
  } = props;
4439
4557
  const { registerStickyCell, stickyCells } = useTableRowContext();
@@ -4477,9 +4595,13 @@ var TableCell = import_react34.default.memo((props) => {
4477
4595
  isSticky && "table-sticky",
4478
4596
  isLastSticky && stickyShadow && "right-shadow",
4479
4597
  onClick && "clickable",
4480
- enableHover && "cell-hover"
4598
+ enableHover && "cell-hover",
4599
+ nowrap && "nowrap"
4481
4600
  ),
4482
- style: isSticky ? { left } : void 0,
4601
+ style: {
4602
+ ...isSticky ? { left } : null,
4603
+ ...width != null ? { width: typeof width === "number" ? `${width}px` : width } : null
4604
+ },
4483
4605
  onClick,
4484
4606
  children
4485
4607
  }
@@ -4735,6 +4857,16 @@ var Tooltip_default = Tooltip;
4735
4857
  // src/components/Video/Video.tsx
4736
4858
  var import_react39 = __toESM(require("react"), 1);
4737
4859
  var import_jsx_runtime346 = require("react/jsx-runtime");
4860
+ var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
4861
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
4862
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
4863
+ ] });
4864
+ var formatTime = (sec) => {
4865
+ if (!Number.isFinite(sec) || sec < 0) return "0:00";
4866
+ const m = Math.floor(sec / 60);
4867
+ const s = Math.floor(sec % 60);
4868
+ return `${m}:${s.toString().padStart(2, "0")}`;
4869
+ };
4738
4870
  var Video = import_react39.default.forwardRef((props, ref) => {
4739
4871
  const {
4740
4872
  src,
@@ -4743,13 +4875,36 @@ var Video = import_react39.default.forwardRef((props, ref) => {
4743
4875
  muted,
4744
4876
  loop,
4745
4877
  playsInline,
4878
+ showControls = true,
4879
+ showCenterPlay = true,
4880
+ playbackRates,
4881
+ showCaptions = false,
4882
+ showPip = false,
4883
+ showDownload = false,
4884
+ downloadFileName,
4746
4885
  onPlay,
4747
4886
  onPause,
4887
+ onTimeUpdate,
4888
+ onVolumeChange,
4889
+ onLoadedMetadata,
4890
+ onRateChange,
4891
+ children,
4748
4892
  ...rest
4749
4893
  } = props;
4894
+ const containerRef = import_react39.default.useRef(null);
4750
4895
  const videoRef = import_react39.default.useRef(null);
4751
4896
  const [isPlaying, setIsPlaying] = import_react39.default.useState(Boolean(autoPlay));
4752
4897
  const [isLoaded, setIsLoaded] = import_react39.default.useState(false);
4898
+ const [currentTime, setCurrentTime] = import_react39.default.useState(0);
4899
+ const [duration, setDuration] = import_react39.default.useState(0);
4900
+ const [buffered, setBuffered] = import_react39.default.useState(0);
4901
+ const [volume, setVolume] = import_react39.default.useState(1);
4902
+ const [isMuted, setIsMuted] = import_react39.default.useState(Boolean(muted));
4903
+ const [isFullscreen, setIsFullscreen] = import_react39.default.useState(false);
4904
+ const [playbackRate, setPlaybackRate] = import_react39.default.useState(1);
4905
+ const [rateMenuOpen, setRateMenuOpen] = import_react39.default.useState(false);
4906
+ const [captionsOn, setCaptionsOn] = import_react39.default.useState(false);
4907
+ const [isPip, setIsPip] = import_react39.default.useState(false);
4753
4908
  const setRefs = import_react39.default.useCallback(
4754
4909
  (el) => {
4755
4910
  videoRef.current = el;
@@ -4758,6 +4913,25 @@ var Video = import_react39.default.forwardRef((props, ref) => {
4758
4913
  },
4759
4914
  [ref]
4760
4915
  );
4916
+ import_react39.default.useEffect(() => {
4917
+ const onFsChange = () => {
4918
+ setIsFullscreen(document.fullscreenElement === containerRef.current);
4919
+ };
4920
+ document.addEventListener("fullscreenchange", onFsChange);
4921
+ return () => document.removeEventListener("fullscreenchange", onFsChange);
4922
+ }, []);
4923
+ import_react39.default.useEffect(() => {
4924
+ const v = videoRef.current;
4925
+ if (!v) return;
4926
+ const onEnter = () => setIsPip(true);
4927
+ const onLeave = () => setIsPip(false);
4928
+ v.addEventListener("enterpictureinpicture", onEnter);
4929
+ v.addEventListener("leavepictureinpicture", onLeave);
4930
+ return () => {
4931
+ v.removeEventListener("enterpictureinpicture", onEnter);
4932
+ v.removeEventListener("leavepictureinpicture", onLeave);
4933
+ };
4934
+ }, []);
4761
4935
  const handlePlay = (e) => {
4762
4936
  setIsPlaying(true);
4763
4937
  onPlay?.(e);
@@ -4766,50 +4940,278 @@ var Video = import_react39.default.forwardRef((props, ref) => {
4766
4940
  setIsPlaying(false);
4767
4941
  onPause?.(e);
4768
4942
  };
4769
- const handleLoadedData = () => {
4943
+ const handleLoadedMetadata = (e) => {
4944
+ const v = e.currentTarget;
4945
+ setDuration(v.duration);
4770
4946
  setIsLoaded(true);
4947
+ onLoadedMetadata?.(e);
4948
+ };
4949
+ const handleTimeUpdate = (e) => {
4950
+ const v = e.currentTarget;
4951
+ setCurrentTime(v.currentTime);
4952
+ if (v.buffered.length > 0) {
4953
+ setBuffered(v.buffered.end(v.buffered.length - 1));
4954
+ }
4955
+ onTimeUpdate?.(e);
4956
+ };
4957
+ const handleVolumeChange = (e) => {
4958
+ const v = e.currentTarget;
4959
+ setVolume(v.volume);
4960
+ setIsMuted(v.muted);
4961
+ onVolumeChange?.(e);
4962
+ };
4963
+ const handleRateChange = (e) => {
4964
+ setPlaybackRate(e.currentTarget.playbackRate);
4965
+ onRateChange?.(e);
4771
4966
  };
4772
4967
  const togglePlay = () => {
4773
- if (!videoRef.current) return;
4774
- if (isPlaying) {
4775
- videoRef.current.pause();
4968
+ const v = videoRef.current;
4969
+ if (!v) return;
4970
+ if (v.paused) v.play();
4971
+ else v.pause();
4972
+ };
4973
+ const toggleMute = () => {
4974
+ const v = videoRef.current;
4975
+ if (!v) return;
4976
+ v.muted = !v.muted;
4977
+ };
4978
+ const toggleFullscreen = () => {
4979
+ const el = containerRef.current;
4980
+ if (!el) return;
4981
+ if (document.fullscreenElement === el) {
4982
+ document.exitFullscreen();
4776
4983
  } else {
4777
- videoRef.current.play();
4984
+ el.requestFullscreen?.();
4778
4985
  }
4779
4986
  };
4780
- return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "lib-xplat-video custom-overlay", children: [
4781
- /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
4782
- "video",
4783
- {
4784
- ref: setRefs,
4785
- src,
4786
- poster,
4787
- autoPlay,
4788
- muted,
4789
- loop,
4790
- playsInline: playsInline ?? true,
4791
- onPlay: handlePlay,
4792
- onPause: handlePause,
4793
- onLoadedData: handleLoadedData,
4794
- onClick: togglePlay,
4795
- ...rest
4987
+ const togglePip = async () => {
4988
+ const v = videoRef.current;
4989
+ if (!v) return;
4990
+ try {
4991
+ if (document.pictureInPictureElement === v) {
4992
+ await document.exitPictureInPicture?.();
4993
+ } else {
4994
+ await v.requestPictureInPicture?.();
4796
4995
  }
4797
- ),
4798
- /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
4799
- "button",
4800
- {
4801
- type: "button",
4802
- className: clsx_default(
4803
- "play-overlay",
4804
- isPlaying && "is-playing",
4805
- !isLoaded && "is-loading"
4806
- ),
4807
- onClick: togglePlay,
4808
- "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
4809
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PlayCircleIcon_default, {}) })
4996
+ } catch {
4997
+ }
4998
+ };
4999
+ const toggleCaptions = () => {
5000
+ const v = videoRef.current;
5001
+ if (!v) return;
5002
+ const next = !captionsOn;
5003
+ for (let i = 0; i < v.textTracks.length; i++) {
5004
+ const t = v.textTracks[i];
5005
+ if (t.kind === "captions" || t.kind === "subtitles") {
5006
+ t.mode = next ? "showing" : "hidden";
4810
5007
  }
4811
- )
4812
- ] });
5008
+ }
5009
+ setCaptionsOn(next);
5010
+ };
5011
+ const selectRate = (rate) => {
5012
+ const v = videoRef.current;
5013
+ if (!v) return;
5014
+ v.playbackRate = rate;
5015
+ setRateMenuOpen(false);
5016
+ };
5017
+ const handleSeek = (e) => {
5018
+ const v = videoRef.current;
5019
+ if (!v) return;
5020
+ const next = Number(e.target.value);
5021
+ v.currentTime = next;
5022
+ setCurrentTime(next);
5023
+ };
5024
+ const handleVolumeSlider = (e) => {
5025
+ const v = videoRef.current;
5026
+ if (!v) return;
5027
+ const next = Number(e.target.value);
5028
+ v.volume = next;
5029
+ if (next > 0 && v.muted) v.muted = false;
5030
+ if (next === 0) v.muted = true;
5031
+ };
5032
+ const progressPct = duration > 0 ? currentTime / duration * 100 : 0;
5033
+ const bufferedPct = duration > 0 ? buffered / duration * 100 : 0;
5034
+ const volumePct = (isMuted ? 0 : volume) * 100;
5035
+ const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
5036
+ const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
5037
+ return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(
5038
+ "div",
5039
+ {
5040
+ ref: containerRef,
5041
+ className: clsx_default("lib-xplat-video", showControls && "has-controls"),
5042
+ children: [
5043
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5044
+ "video",
5045
+ {
5046
+ ref: setRefs,
5047
+ src,
5048
+ poster,
5049
+ autoPlay,
5050
+ muted,
5051
+ loop,
5052
+ playsInline: playsInline ?? true,
5053
+ onPlay: handlePlay,
5054
+ onPause: handlePause,
5055
+ onLoadedMetadata: handleLoadedMetadata,
5056
+ onTimeUpdate: handleTimeUpdate,
5057
+ onVolumeChange: handleVolumeChange,
5058
+ onRateChange: handleRateChange,
5059
+ onClick: togglePlay,
5060
+ ...rest,
5061
+ children
5062
+ }
5063
+ ),
5064
+ showCenterPlay && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5065
+ "button",
5066
+ {
5067
+ type: "button",
5068
+ className: clsx_default(
5069
+ "center-play",
5070
+ isPlaying && "is-playing",
5071
+ !isLoaded && "is-loading"
5072
+ ),
5073
+ onClick: togglePlay,
5074
+ "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
5075
+ tabIndex: -1,
5076
+ children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "center-play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PlayCircleIcon_default, {}) })
5077
+ }
5078
+ ),
5079
+ showControls && /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
5080
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5081
+ "input",
5082
+ {
5083
+ type: "range",
5084
+ className: "seekbar",
5085
+ min: 0,
5086
+ max: duration || 0,
5087
+ step: 0.1,
5088
+ value: currentTime,
5089
+ onChange: handleSeek,
5090
+ "aria-label": "\uC7AC\uC0DD \uC704\uCE58",
5091
+ style: {
5092
+ ["--progress"]: `${progressPct}%`,
5093
+ ["--buffered"]: `${bufferedPct}%`
5094
+ }
5095
+ }
5096
+ ),
5097
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "controls-row", children: [
5098
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5099
+ "button",
5100
+ {
5101
+ type: "button",
5102
+ className: "control-btn",
5103
+ onClick: togglePlay,
5104
+ "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
5105
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PlayIcon_default, {})
5106
+ }
5107
+ ),
5108
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "volume-group", children: [
5109
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5110
+ "button",
5111
+ {
5112
+ type: "button",
5113
+ className: "control-btn",
5114
+ onClick: toggleMute,
5115
+ "aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
5116
+ children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(VolumeGlyph, {})
5117
+ }
5118
+ ),
5119
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5120
+ "input",
5121
+ {
5122
+ type: "range",
5123
+ className: "volume-slider",
5124
+ min: 0,
5125
+ max: 1,
5126
+ step: 0.05,
5127
+ value: isMuted ? 0 : volume,
5128
+ onChange: handleVolumeSlider,
5129
+ "aria-label": "\uBCFC\uB968",
5130
+ style: { ["--volume"]: `${volumePct}%` }
5131
+ }
5132
+ )
5133
+ ] }),
5134
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("span", { className: "time", children: [
5135
+ formatTime(currentTime),
5136
+ " / ",
5137
+ formatTime(duration)
5138
+ ] }),
5139
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: "controls-spacer" }),
5140
+ playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
5141
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(
5142
+ "button",
5143
+ {
5144
+ type: "button",
5145
+ className: "control-btn rate-btn",
5146
+ onClick: () => setRateMenuOpen((o) => !o),
5147
+ "aria-label": "\uC7AC\uC0DD \uC18D\uB3C4",
5148
+ "aria-expanded": rateMenuOpen,
5149
+ children: [
5150
+ playbackRate,
5151
+ "x"
5152
+ ]
5153
+ }
5154
+ ),
5155
+ rateMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(
5156
+ "button",
5157
+ {
5158
+ type: "button",
5159
+ role: "menuitem",
5160
+ className: clsx_default("rate-item", r2 === playbackRate && "is-active"),
5161
+ onClick: () => selectRate(r2),
5162
+ children: [
5163
+ r2,
5164
+ "x"
5165
+ ]
5166
+ }
5167
+ ) }, r2)) })
5168
+ ] }),
5169
+ showCaptions && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5170
+ "button",
5171
+ {
5172
+ type: "button",
5173
+ className: clsx_default("control-btn", captionsOn && "is-active"),
5174
+ onClick: toggleCaptions,
5175
+ "aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
5176
+ "aria-pressed": captionsOn,
5177
+ children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(TypeIcon_default, {})
5178
+ }
5179
+ ),
5180
+ showPip && pipSupported && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5181
+ "button",
5182
+ {
5183
+ type: "button",
5184
+ className: clsx_default("control-btn", isPip && "is-active"),
5185
+ onClick: togglePip,
5186
+ "aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
5187
+ children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PipIcon, {})
5188
+ }
5189
+ ),
5190
+ showDownload && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5191
+ "a",
5192
+ {
5193
+ className: "control-btn",
5194
+ href: src,
5195
+ download: downloadFileName ?? true,
5196
+ "aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
5197
+ children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(DownloadIcon_default, {})
5198
+ }
5199
+ ),
5200
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
5201
+ "button",
5202
+ {
5203
+ type: "button",
5204
+ className: "control-btn",
5205
+ onClick: toggleFullscreen,
5206
+ "aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
5207
+ children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(MinimizeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(MaximizeIcon_default, {})
5208
+ }
5209
+ )
5210
+ ] })
5211
+ ] })
5212
+ ]
5213
+ }
5214
+ );
4813
5215
  });
4814
5216
  Video.displayName = "Video";
4815
5217
  var Video_default = Video;