@blerp/design 1.2.36 → 1.2.37

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.esm.js CHANGED
@@ -56,7 +56,7 @@ import SearchRoundedIcon from '@mui/icons-material/SearchRounded';
56
56
  import BookmarkRemoveOutlinedIcon from '@mui/icons-material/BookmarkRemoveOutlined';
57
57
  import VisibilityOffRoundedIcon from '@mui/icons-material/VisibilityOffRounded';
58
58
 
59
- var _templateObject$j, _templateObject2$b, _templateObject3$8, _templateObject4$7;
59
+ var _templateObject$j, _templateObject2$b, _templateObject3$9, _templateObject4$7;
60
60
  var BlerpImage$3 = styled.div(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n height: 150px;\n width: 150px;\n background-image: url(", ");\n background-size: cover;\n border-radius: 50%;\n position: relative;\n transition: 0.2s;\n\n &:hover {\n transform: scale(1.1);\n }\n"])), function (props) {
61
61
  return props.url;
62
62
  });
@@ -67,7 +67,7 @@ var SaveContainer$2 = styled.div(_templateObject2$b || (_templateObject2$b = _ta
67
67
  }, function (props) {
68
68
  return props.theme.colors.white;
69
69
  });
70
- var BlerpImageScrim$2 = styled.div(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteral(["\n height: 150px;\n width: 150px;\n background-color: ", "70;\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n transition: 0.4s;\n\n &:hover {\n background-color: ", "98;\n }\n\n &:hover ", " {\n opacity: 1;\n }\n"])), function (props) {
70
+ var BlerpImageScrim$2 = styled.div(_templateObject3$9 || (_templateObject3$9 = _taggedTemplateLiteral(["\n height: 150px;\n width: 150px;\n background-color: ", "70;\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n transition: 0.4s;\n\n &:hover {\n background-color: ", "98;\n }\n\n &:hover ", " {\n opacity: 1;\n }\n"])), function (props) {
71
71
  return props.theme.colors.grey6Override;
72
72
  }, function (props) {
73
73
  return props.theme.colors.grey6Override;
@@ -1701,284 +1701,12 @@ var UsernameWithPopout$1 = function UsernameWithPopout(_ref) {
1701
1701
  }, user === null || user === void 0 ? void 0 : user.username));
1702
1702
  };
1703
1703
 
1704
- var _templateObject$g, _templateObject2$a;
1704
+ var _templateObject$g, _templateObject2$a, _templateObject3$8;
1705
1705
  var PremiumContainer = styled.div(_templateObject$g || (_templateObject$g = _taggedTemplateLiteral(["\n background: transparent;\n overflow: hidden;\n min-width: 210px;\n max-width: 260px;\n width: 100%;\n max-height: 322px;\n flex: 1;\n min-height: 272px;\n aspect-ratio: 260 / 322;\n gap: 10px;\n border-radius: 18px;\n box-sizing: border-box;\n padding: 2px;\n position: relative;\n transition: 0.3s;\n"])));
1706
1706
  var Container$1 = styled.div(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n position: relative;\n height: 100%;\n padding: 10px;\n border-radius: 17px;\n box-sizing: border-box;\n"])), function (props) {
1707
1707
  return props.theme.colors.grey7;
1708
- }); // const AddContentDropdown = ({
1709
- // item,
1710
- // active,
1711
- // onOptionClicked,
1712
- // selectedOption,
1713
- // }) => {
1714
- // const options = [
1715
- // {
1716
- // name: "Channel Points",
1717
- // value: "CHANNEL_POINTS",
1718
- // added: item?.channelPointsContext?._id,
1719
- // },
1720
- // { name: "Bits", value: "BITS", added: item?.whitelistContext?._id },
1721
- // { name: "WalkOn", value: "WALK_ON", added: item?.walkOnContext?._id },
1722
- // { name: "Discord", value: "DISCORD", added: item?.discordContext?._id },
1723
- // {
1724
- // name: "Sound Emotes",
1725
- // value: "SOUND_EMOTES",
1726
- // added: item?.soundEmotesContext?._id,
1727
- // },
1728
- // {
1729
- // name: "Add To Group",
1730
- // value: "ADD_TO_GROUP",
1731
- // added: false,
1732
- // },
1733
- // {
1734
- // name: "Suggest To...",
1735
- // value: "SUGGEST",
1736
- // added: false,
1737
- // },
1738
- // ];
1739
- // const anchorRef = useRef(null);
1740
- // const [anchor, setAnchor] = useState(null);
1741
- // const open = Boolean(anchor);
1742
- // return (
1743
- // <>
1744
- // <Button
1745
- // ref={anchorRef}
1746
- // color="whiteOverride"
1747
- // variant="outlined"
1748
- // onClick={(e) => {
1749
- // if (active) setAnchor(anchorRef?.current);
1750
- // }}
1751
- // sx={{
1752
- // width: "100%",
1753
- // height: "30px",
1754
- // transition: "0.3s",
1755
- // cursor: active ? "pointer" : "default",
1756
- // justifyContent: "space-between",
1757
- // marginRight: "10px",
1758
- // backgroundColor: "#2C323380",
1759
- // opacity: active ? "1" : "0",
1760
- // whiteSpace: "nowrap",
1761
- // "&:hover": {
1762
- // backgroundColor: "grey3.main",
1763
- // },
1764
- // }}
1765
- // endIcon={
1766
- // <ArrowDropDownRoundedIcon sx={{ pointerEvents: "none" }} />
1767
- // }
1768
- // >
1769
- // {selectedOption?.name || options[0]?.name}
1770
- // </Button>
1771
- // <Popover
1772
- // open={open}
1773
- // anchorEl={anchor}
1774
- // anchorOrigin={{
1775
- // vertical: "top",
1776
- // horizontal: "left",
1777
- // }}
1778
- // transformOrigin={{
1779
- // vertical: "top",
1780
- // horizontal: "left",
1781
- // }}
1782
- // onClose={() => {
1783
- // setAnchor(null);
1784
- // }}
1785
- // PaperProps={{
1786
- // sx: {
1787
- // width: anchor?.getBoundingClientRect().width,
1788
- // backgroundColor: "#2C323380",
1789
- // borderRadius: "18px",
1790
- // padding: "35px 0 0 0",
1791
- // boxSizing: "border-box",
1792
- // maxHeight: "160px",
1793
- // overflowY: "hidden",
1794
- // },
1795
- // }}
1796
- // >
1797
- // <Stack sx={{ maxHeight: "120px", overflowY: "scroll" }}>
1798
- // {options?.map((option) => (
1799
- // <Stack
1800
- // direction="row"
1801
- // sx={{
1802
- // boxSizing: "border-box",
1803
- // justifyContent: "space-between",
1804
- // alignItems: "center",
1805
- // width: "100%",
1806
- // height: "100%",
1807
- // padding: "6px 5px 6px 10px",
1808
- // cursor: "pointer",
1809
- // transition: "0.3s",
1810
- // "&:hover": {
1811
- // backgroundColor: "#474D4F80",
1812
- // },
1813
- // "&:hover #added-to-content-icon": {
1814
- // display: option?.added ? "none" : "block",
1815
- // opacity: "1",
1816
- // },
1817
- // "&:hover #remove-from-content-icon": {
1818
- // display: option?.added ? "block" : "none",
1819
- // opacity: option?.added ? "1" : "0",
1820
- // },
1821
- // }}
1822
- // onClick={() => {
1823
- // if (onOptionClicked) onOptionClicked(option);
1824
- // setAnchor(null);
1825
- // }}
1826
- // >
1827
- // <Text
1828
- // sx={{
1829
- // fontSize: "14px",
1830
- // fontWeight: "400",
1831
- // }}
1832
- // >
1833
- // {option.name}
1834
- // </Text>
1835
- // <CheckRounded
1836
- // id="added-to-content-icon"
1837
- // sx={{
1838
- // transition: "0.3s",
1839
- // opacity: option.added ? "1" : "0",
1840
- // }}
1841
- // />
1842
- // <CloseRounded
1843
- // id="remove-from-content-icon"
1844
- // sx={{
1845
- // transition: "0.3s",
1846
- // display: "none",
1847
- // opacity: "0",
1848
- // }}
1849
- // />
1850
- // </Stack>
1851
- // ))}
1852
- // </Stack>
1853
- // </Popover>
1854
- // </>
1855
- // );
1856
- // };
1857
- // const AddContentButton = ({
1858
- // item,
1859
- // hovering,
1860
- // hoveringAddTo,
1861
- // setHoveringAddTo,
1862
- // openPremiumModal,
1863
- // onOptionClicked,
1864
- // onPlusClick,
1865
- // selectedOption,
1866
- // isUnownedPremium,
1867
- // }) => {
1868
- // let added = false;
1869
- // if (item?.whitelistContext?._id && selectedOption?.value === "BITS") {
1870
- // added = true;
1871
- // } else if (
1872
- // item?.channelPointsContext?._id &&
1873
- // selectedOption?.value === "CHANNEL_POINTS"
1874
- // ) {
1875
- // added = true;
1876
- // } else if (
1877
- // item?.walkOnContext?._id &&
1878
- // selectedOption?.value === "WALK_ON"
1879
- // ) {
1880
- // added = true;
1881
- // } else if (
1882
- // item?.discordContext?._id &&
1883
- // selectedOption?.value === "DISCORD"
1884
- // ) {
1885
- // added = true;
1886
- // }
1887
- // return (
1888
- // <Stack
1889
- // direction="row"
1890
- // width={hoveringAddTo ? "100%" : "60%"}
1891
- // sx={{
1892
- // justifyContent: "end",
1893
- // transition: "0.5s",
1894
- // boxSizing: "border-box",
1895
- // opacity: hovering ? "1" : "0",
1896
- // }}
1897
- // onMouseLeave={() => {
1898
- // setHoveringAddTo(false);
1899
- // }}
1900
- // >
1901
- // <AddContentDropdown
1902
- // item={item}
1903
- // active={hoveringAddTo}
1904
- // onOptionClicked={onOptionClicked}
1905
- // selectedOption={selectedOption}
1906
- // />
1907
- // {isUnownedPremium ? (
1908
- // <IconButton
1909
- // sx={{
1910
- // width: "30px",
1911
- // height: "30px",
1912
- // backgroundColor: "white.override",
1913
- // "&:hover .open-lock-icon": {
1914
- // display: "flex !important",
1915
- // opacity: "1 !important",
1916
- // },
1917
- // "&:hover .lock-icon": {
1918
- // display: "none !important",
1919
- // opacity: "0 !important",
1920
- // },
1921
- // "&:hover": {
1922
- // backgroundColor: "grey7.main",
1923
- // },
1924
- // }}
1925
- // onClick={(e) => {
1926
- // e.stopPropagation();
1927
- // openPremiumModal();
1928
- // }}
1929
- // >
1930
- // <LockRoundedIcon
1931
- // className="lock-icon"
1932
- // sx={{
1933
- // transition: "0.3s",
1934
- // color: "notBlack.override",
1935
- // display: "flex",
1936
- // opacity: "1",
1937
- // fontSize: "17px",
1938
- // }}
1939
- // />
1940
- // <div
1941
- // className="open-lock-icon"
1942
- // style={{ display: "none", opacity: "0" }}
1943
- // >
1944
- // <OpenLockIcon
1945
- // sx={{
1946
- // transition: "0.3s",
1947
- // color: "notBlack.override",
1948
- // fontSize: "17px",
1949
- // }}
1950
- // />
1951
- // </div>
1952
- // </IconButton>
1953
- // ) : (
1954
- // <IconButton
1955
- // sx={{
1956
- // width: "30px",
1957
- // height: "30px",
1958
- // backgroundColor: "white.override",
1959
- // "&:hover": {
1960
- // backgroundColor: "grey7.main",
1961
- // },
1962
- // }}
1963
- // onMouseEnter={(e) => {
1964
- // e.stopPropagation();
1965
- // setHoveringAddTo(true);
1966
- // }}
1967
- // onClick={() => onPlusClick(added)}
1968
- // >
1969
- // <AddRoundedIcon
1970
- // sx={{
1971
- // transition: "0.3s",
1972
- // color: "notBlack.override",
1973
- // transform: added && "rotate(45deg)",
1974
- // }}
1975
- // />
1976
- // </IconButton>
1977
- // )}
1978
- // </Stack>
1979
- // );
1980
- // };
1981
-
1708
+ });
1709
+ var HoverScrollText = styled.div(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteral(["\n width: 100%;\n max-width: 280px;\n min-width: 210px;\n height: 23px;\n overflow: hidden;\n line-height: 30px;\n box-sizing: border-box;\n position: relative;\n margin: 10px 0 5px 0;\n cursor: pointer;\n & p {\n cursor: default;\n position: absolute;\n white-space: nowrap;\n transform: translateX(0);\n transition: 1s;\n }\n &:hover p {\n transform: translateX(calc(180px - 100%));\n text-decoration: underline;\n cursor: pointer;\n }\n"])));
1982
1710
  var FavoriteIconWithCounter = function FavoriteIconWithCounter(_ref) {
1983
1711
  var saved = _ref.saved,
1984
1712
  count = _ref.count,
@@ -2099,126 +1827,7 @@ var RatingInfo = function RatingInfo(_ref3) {
2099
1827
  default:
2100
1828
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
2101
1829
  }
2102
- }; // const BlerpWaveform = ({ hovering, bite }) => {
2103
- // const id = bite?._id;
2104
- // const audio = bite?.audio?.mp3?.url;
2105
- // const { play, getPlayState, selectedBlerp } = useContext(BlerpAudioContext);
2106
- // const [hasRendered, setHasRendered] = useState(false);
2107
- // const [wavesurfer, setWavesurfer] = useState(null);
2108
- // useEffect(() => {
2109
- // const create = async () => {
2110
- // console.log("creating", hovering, wavesurfer, hasRendered);
2111
- // if (hovering && wavesurfer) {
2112
- // wavesurfer.load(audio);
2113
- // } else if (
2114
- // hovering &&
2115
- // !wavesurfer &&
2116
- // !hasRendered &&
2117
- // document.querySelector(`#blerp-waveform-${id}`) &&
2118
- // document.querySelector(`#blerp-waveform-${id}`).children
2119
- // .length === 0
2120
- // ) {
2121
- // const WaveSurfer = (await import("@blerp/wavesurfer")).default;
2122
- // const CursorPlugin = (
2123
- // await import("@blerp/wavesurfer/src/plugin/cursor")
2124
- // ).default;
2125
- // let mWavesurfer = WaveSurfer.create({
2126
- // container: document.querySelector(`#blerp-waveform-${id}`),
2127
- // barWidth: 2,
2128
- // barHeight: 1.5, // the height of the wave
2129
- // barGap: 2, // the optional spacing between bars of the wave, if not provided will be calculated in legacy format
2130
- // progressColor: "#ffffff",
2131
- // hoverColor: "#ffffff99",
2132
- // barRadius: 2,
2133
- // height: 30,
2134
- // hideScrollBar: true,
2135
- // plugins: [
2136
- // CursorPlugin.create({
2137
- // showTime: false,
2138
- // opacity: 0,
2139
- // customShowTimeStyle: {
2140
- // "background-color": "#000",
2141
- // color: "#fff",
2142
- // padding: "2px",
2143
- // "font-size": "10px",
2144
- // },
2145
- // }),
2146
- // ],
2147
- // });
2148
- // mWavesurfer.on("error", function (e) {
2149
- // console.warn(e);
2150
- // });
2151
- // mWavesurfer?.on("seek", (prog) => {
2152
- // if (prog) {
2153
- // console.log("SEEEEEEK", prog, bite);
2154
- // mWavesurfer?.setMute(true);
2155
- // mWavesurfer?.play();
2156
- // play({
2157
- // bite: bite,
2158
- // startTime: mWavesurfer?.getCurrentTime(),
2159
- // forcePlay: true,
2160
- // });
2161
- // }
2162
- // });
2163
- // // Load audio from URL
2164
- // // mWavesurfer.load(audio);
2165
- // setWavesurfer(mWavesurfer);
2166
- // setHasRendered(true);
2167
- // }
2168
- // };
2169
- // create();
2170
- // }, [wavesurfer, bite, play, audio, hovering, hasRendered, id]);
2171
- // useEffect(() => {
2172
- // // if (wavesurfer && selectedBlerp?._id === bite?._id) {
2173
- // // wavesurfer?.on("seek", (prog) => {
2174
- // // if (prog) {
2175
- // // console.log("SEEEEEEK", prog, selectedBlerp);
2176
- // // play({
2177
- // // bite: bite,
2178
- // // startTime: wavesurfer?.getCurrentTime(),
2179
- // // });
2180
- // // wavesurfer?.setMute(true);
2181
- // // wavesurfer?.play();
2182
- // // }
2183
- // // });
2184
- // // } else {
2185
- // // wavesurfer?.un("seek");
2186
- // // }
2187
- // if (getPlayState({ biteId: bite?._id }) === "playing") {
2188
- // wavesurfer?.setMute(true);
2189
- // wavesurfer?.play();
2190
- // // Play button
2191
- // // console.log(wavesurfer.play());
2192
- // }
2193
- // if (getPlayState({ biteId: bite?._id }) === "paused") {
2194
- // wavesurfer?.setMute(true);
2195
- // wavesurfer?.pause();
2196
- // // Play button
2197
- // // console.log(wavesurfer.play());
2198
- // }
2199
- // if (getPlayState({ biteId: bite?._id }) === "stopped") {
2200
- // wavesurfer?.setMute(true);
2201
- // console.log("stop");
2202
- // wavesurfer?.stop();
2203
- // // Play button
2204
- // // console.log(wavesurfer.play());
2205
- // }
2206
- // }, [bite, getPlayState, wavesurfer]);
2207
- // return (
2208
- // <div
2209
- // id={`blerp-waveform-${id}`}
2210
- // style={{
2211
- // height: "30px",
2212
- // width: "100%",
2213
- // transition: "0.3s",
2214
- // opacity: hovering ? "1" : "0",
2215
- // }}
2216
- // >
2217
- // {/* <!-- Here be the waveform --> */}
2218
- // </div>
2219
- // );
2220
- // };
2221
-
1830
+ };
2222
1831
 
2223
1832
  var ReportedWarning = function ReportedWarning(_ref4) {
2224
1833
  var showWarning = _ref4.showWarning,
@@ -2567,27 +2176,24 @@ var NewBlerp$1 = function NewBlerp(_ref6) {
2567
2176
  }
2568
2177
  }, renderPlayStateIcon()), Waveform({
2569
2178
  hovering: hovering
2570
- })), /*#__PURE__*/React__default.createElement(Text, {
2179
+ })), /*#__PURE__*/React__default.createElement(HoverScrollText, {
2180
+ onClick: onTitleClick
2181
+ }, /*#__PURE__*/React__default.createElement(Text, {
2571
2182
  sx: {
2572
2183
  fontSize: "16px",
2573
2184
  fontWeight: "400",
2574
- maxWidth: "260px",
2575
- minWidth: "180px",
2576
- width: "100%",
2577
- whiteSpace: "nowrap",
2578
- overflowX: "hidden",
2579
- overflowY: "auto",
2580
- lineHeight: "1",
2581
- height: "23px",
2582
- margin: "10px 0 5px 0",
2583
- cursor: "pointer",
2584
- transition: "0.3s",
2585
- "&:hover": {
2586
- textDecoration: "underline"
2587
- }
2588
- },
2589
- onClick: onTitleClick
2185
+ lineHeight: "1"
2186
+ }
2590
2187
  }, bite === null || bite === void 0 ? void 0 : bite.title), /*#__PURE__*/React__default.createElement(Stack, {
2188
+ sx: {
2189
+ position: "absolute",
2190
+ right: "0",
2191
+ top: "0",
2192
+ width: "30px",
2193
+ height: "100%",
2194
+ background: "linear-gradient(270deg, rgba(40,50,51,1) 0%, rgba(0,0,0,0) 100%)"
2195
+ }
2196
+ })), /*#__PURE__*/React__default.createElement(Stack, {
2591
2197
  direction: "row",
2592
2198
  alignItems: "center",
2593
2199
  sx: {