@stokr/components-library 3.3.0 → 4.0.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/components/AdminDashboard/Table/Table.styles.js +7 -13
- package/dist/components/BasicTable/BasicTable.js +1 -3
- package/dist/components/BlogPost/BlogPost.styles.js +2 -2
- package/dist/components/Button/Button.styles.d.ts +28 -0
- package/dist/components/Button/Button.styles.js +27 -38
- package/dist/components/Button/GlareButton.js +2 -2
- package/dist/components/CardTabs/CardTabs.d.ts +41 -0
- package/dist/components/CardTabs/CardTabs.js +130 -0
- package/dist/components/CardTabs/CardTabs.styles.d.ts +56 -0
- package/dist/components/CardTabs/CardTabs.styles.js +171 -0
- package/dist/components/Chips/Chip.js +32 -8
- package/dist/components/Chips/Chip.styles.js +24 -28
- package/dist/components/Collapsible/Collapsible.d.ts +18 -0
- package/dist/components/Collapsible/Collapsible.js +44 -0
- package/dist/components/Collapsible/Collapsible.styles.d.ts +18 -0
- package/dist/components/Collapsible/Collapsible.styles.js +94 -0
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.d.ts +31 -0
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +107 -109
- package/dist/components/Copy/Copy.d.ts +20 -0
- package/dist/components/Copy/Copy.js +0 -9
- package/dist/components/Copy/copySource.d.ts +20 -0
- package/dist/components/Copy/flatten.d.ts +3 -0
- package/dist/components/CopyToClipboardTooltip/CopyToClipboardTooltip.d.ts +15 -0
- package/dist/components/CopyToClipboardTooltip/CopyToClipboardTooltip.styles.d.ts +6 -0
- package/dist/components/CryptoAddress/CryptoAddress.js +3 -3
- package/dist/components/InfoIcon/InfoIcon.d.ts +33 -0
- package/dist/components/InfoIcon/InfoIcon.styles.d.ts +12 -0
- package/dist/components/Input/Input.d.ts +23 -0
- package/dist/components/Input/Input.js +17 -27
- package/dist/components/Input/Input.styles.d.ts +15 -0
- package/dist/components/Input/InputPassword.js +1 -0
- package/dist/components/Input/InputPassword.styles.js +4 -1
- package/dist/components/Input/MultiSelect.js +1 -0
- package/dist/components/Input/RangeInput.js +49 -53
- package/dist/components/Input/Textarea.styles.js +1 -1
- package/dist/components/MaterialIcon/MaterialIcon.d.ts +41 -0
- package/dist/components/MaterialIcon/MaterialIcon.js +55 -0
- package/dist/components/MaterialIcon/MaterialIcon.styles.d.ts +14 -0
- package/dist/components/MaterialIcon/MaterialIcon.styles.js +31 -0
- package/dist/components/MaterialIcon/iconConfig.d.ts +24 -0
- package/dist/components/MaterialIcon/iconConfig.js +11 -0
- package/dist/components/Modal/Modal.d.ts +26 -0
- package/dist/components/Modal/Modal.js +1 -18
- package/dist/components/Modal/Modal.styles.d.ts +59 -0
- package/dist/components/Modal/Modal.styles.js +18 -3
- package/dist/components/Modal/PaymentModal.js +16 -19
- package/dist/components/Modal/SideModal.d.ts +47 -0
- package/dist/components/Modal/SideModal.js +197 -73
- package/dist/components/Modal/SideModal.styles.d.ts +28 -0
- package/dist/components/Modal/SideModal.styles.js +56 -16
- package/dist/components/Modal/SideModalContext.d.ts +12 -0
- package/dist/components/Modal/SideModalContext.js +10 -0
- package/dist/components/Modal/SideModalParts.d.ts +20 -0
- package/dist/components/Modal/SideModalParts.js +95 -0
- package/dist/components/Pagination/Pagination.js +2 -2
- package/dist/components/Pagination/PaginationControls.js +2 -2
- package/dist/components/Payment/TimerComponent.js +1 -2
- package/dist/components/RefreshButton/RefreshButton.styles.js +2 -2
- package/dist/components/RequestDataBox/RequestDataBox.js +2 -2
- package/dist/components/Section/Section.d.ts +32 -0
- package/dist/components/Section/Section.js +83 -0
- package/dist/components/Section/Section.styles.d.ts +34 -0
- package/dist/components/Section/Section.styles.js +143 -0
- package/dist/components/Skeleton/Skeleton.d.ts +44 -0
- package/dist/components/Skeleton/Skeleton.js +48 -0
- package/dist/components/Skeleton/Skeleton.styles.d.ts +14 -0
- package/dist/components/Skeleton/Skeleton.styles.js +51 -0
- package/dist/components/StokrLoader/StokrLoader.d.ts +21 -0
- package/dist/components/StokrLoader/StokrLoader.js +22 -23
- package/dist/components/Tabs/Tabs.styles.js +3 -1
- package/dist/components/TabsNav/TabsNav.js +1 -1
- package/dist/components/TabsNav/TabsNav.styles.js +1 -1
- package/dist/components/Text/Text.styles.d.ts +20 -0
- package/dist/components/Text/Text.styles.js +2 -2
- package/dist/components/TextLink/TextLink.styles.js +1 -2
- package/dist/components/Tooltip/Tooltip.d.ts +42 -0
- package/dist/components/Tooltip/Tooltip.styles.d.ts +10 -0
- package/dist/constants/globalVariables.js +1 -39
- package/dist/hooks/useMediaQuery.d.ts +7 -0
- package/dist/hooks/useMediaQuery.js +19 -0
- package/dist/index.d.ts +299 -0
- package/dist/index.js +97 -213
- package/dist/styles/colors.d.ts +68 -0
- package/dist/styles/colors.js +13 -1
- package/dist/styles/elevation.d.ts +13 -0
- package/dist/styles/elevation.js +15 -0
- package/dist/styles/fonts.js +0 -65
- package/dist/styles/global.js +0 -2
- package/dist/styles/grid.d.ts +27 -0
- package/dist/styles/grid.js +8 -1
- package/dist/styles/rwd.d.ts +48 -0
- package/dist/styles/rwd.js +33 -17
- package/dist/styles/spacing.d.ts +36 -0
- package/dist/styles/spacing.js +30 -0
- package/dist/styles/theme.d.ts +92 -0
- package/dist/styles/theme.js +2 -0
- package/dist/styles/typography.d.ts +42 -0
- package/dist/styles/typography.js +56 -0
- package/dist/utils/capitalize.d.ts +2 -0
- package/dist/utils/capitalize.js +4 -0
- package/dist/utils/copy-text-to-clipboard.d.ts +10 -0
- package/dist/utils/copyToClipboard.d.ts +37 -0
- package/dist/utils/copyToClipboard.js +3 -3
- package/dist/utils/csv.d.ts +14 -0
- package/dist/utils/csv.js +25 -0
- package/dist/utils/customHooks.d.ts +20 -0
- package/dist/utils/customHooks.js +16 -11
- package/dist/utils/fix-decimals.d.ts +14 -0
- package/dist/utils/formatAmount.d.ts +109 -0
- package/dist/utils/formatAmount.js +170 -0
- package/dist/utils/formatCurrencyValue.d.ts +46 -0
- package/dist/utils/formatCurrencyValue.js +6 -21
- package/dist/utils/formatDate.d.ts +19 -0
- package/dist/utils/formatDate.js +44 -0
- package/dist/utils/get-short-address.d.ts +13 -0
- package/dist/utils/get-short-address.js +9 -2
- package/dist/utils/inertProp.d.ts +5 -0
- package/dist/utils/inertProp.js +6 -0
- package/dist/utils/isUSInvestor.d.ts +4 -0
- package/dist/utils/km_ify.d.ts +5 -0
- package/dist/utils/km_ify.js +19 -18
- package/dist/utils/password-validation.d.ts +16 -0
- package/dist/utils/saveAs.d.ts +2 -0
- package/dist/utils/saveAs.js +5 -2
- package/dist/utils/scrollUtils.d.ts +25 -0
- package/dist/utils/scrollUtils.js +13 -10
- package/dist/utils/transition.d.ts +45 -0
- package/dist/utils/transition.js +0 -28
- package/package.json +12 -12
- package/dist/components/AccountBalance/AccountBalance.js +0 -35
- package/dist/components/AccountBalance/AccountBalance.styles.js +0 -48
- package/dist/components/AdminDashboard/Table/Table.js +0 -123
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +0 -51
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +0 -34
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +0 -125
- package/dist/components/DoubleButton/DoubleButton.styles.js +0 -27
- package/dist/components/ErrorMessage/ErrorMessage.styles.js +0 -9
- package/dist/components/Icon/Icon2.js +0 -12
- package/dist/components/Input/InputUsername.js +0 -92
- package/dist/components/Input/RangeInput.styles.js +0 -129
- package/dist/components/InvestmentStat/InvestmentStat.js +0 -24
- package/dist/components/InvestmentStat/InvestmentStat.styles.js +0 -62
- package/dist/components/LatestUpdate/LatestUpdate.js +0 -24
- package/dist/components/LatestUpdate/LatestUpdate.styles.js +0 -90
- package/dist/components/MultiProgressBar/MultiProgressBar.js +0 -28
- package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +0 -105
- package/dist/components/PageTransition/PageTransition.js +0 -51
- package/dist/components/ProfileStat/ProfileStat.js +0 -29
- package/dist/components/ProfileStat/ProfileStat.styles.js +0 -90
- package/dist/components/SEO/SEO.js +0 -66
- package/dist/components/SideLine/SideLine.js +0 -7
- package/dist/components/SideLine/SideLine.styles.js +0 -33
- package/dist/components/Slider/Slider.js +0 -31
- package/dist/components/Slider/Slider.styles.js +0 -120
- package/dist/components/StatusBadge/StatusBadge.styles.js +0 -18
- package/dist/components/StokrLoader/media.js +0 -23
- package/dist/components/SvgIcons/CameraSvg.js +0 -31
- package/dist/components/SvgIcons/DocumentBackSvg.js +0 -20
- package/dist/components/SvgIcons/DocumentSmallSvg.js +0 -41
- package/dist/components/SvgIcons/DocumentSvg.js +0 -39
- package/dist/components/SvgIcons/EthSvg.js +0 -28
- package/dist/components/SvgIcons/EurSvg.js +0 -27
- package/dist/components/SvgIcons/FaceScanIconSvg.js +0 -17
- package/dist/components/SvgIcons/FourSvg.js +0 -7
- package/dist/components/SvgIcons/Glassess.js +0 -26
- package/dist/components/SvgIcons/OneSvg.js +0 -10
- package/dist/components/SvgIcons/PassportSvg.js +0 -37
- package/dist/components/SvgIcons/SocialInstagram.js +0 -13
- package/dist/components/SvgIcons/SocialMedium.js +0 -21
- package/dist/components/SvgIcons/SocialReddit.js +0 -21
- package/dist/components/SvgIcons/SocialYoutube.js +0 -22
- package/dist/components/SvgIcons/ThreeSvg.js +0 -7
- package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +0 -48
- package/dist/components/SvgIcons/TwoSvg.js +0 -10
- package/dist/components/SvgIcons/UpdateDefaultSvg.js +0 -12
- package/dist/components/SvgIcons/UpdateHardSvg.js +0 -10
- package/dist/components/SvgIcons/UpdateSoftSvg.js +0 -11
- package/dist/components/SvgIcons/UploadSvg.js +0 -12
- package/dist/components/TeamOverview/TeamOverview.js +0 -79
- package/dist/components/TeamOverview/TeamOverview.styles.js +0 -167
- package/dist/components/TransactionDetails/TransactionDetails.js +0 -27
- package/dist/components/TransactionDetails/TransactionDetails.styles.js +0 -38
- package/dist/components/TransactionInfo/TransactionInfo.js +0 -41
- package/dist/components/TransactionInfo/TransactionInfo.styles.js +0 -75
- package/dist/components/icons/Arrow.js +0 -38
- package/dist/components/icons/Check.js +0 -16
- package/dist/components/icons/Facebook.js +0 -10
- package/dist/components/icons/Info.js +0 -27
- package/dist/components/icons/Instagram.js +0 -10
- package/dist/components/icons/LinkIcon.js +0 -49
- package/dist/components/icons/LinkedIn.js +0 -13
- package/dist/components/icons/Medium.js +0 -13
- package/dist/components/icons/Reddit.js +0 -16
- package/dist/components/icons/Share.js +0 -31
- package/dist/components/icons/Telegram.js +0 -13
- package/dist/components/icons/Twitter.js +0 -10
- package/dist/components/icons/X.js +0 -10
- package/dist/components/icons/Youtube.js +0 -10
- package/dist/components/icons/index.js +0 -32
- package/dist/components/landing-page/List.js +0 -51
- package/dist/components/landing-page/PageContent.js +0 -65
- package/dist/components/landing-page/PageText.js +0 -171
- package/dist/components/landing-page/PageTitle.js +0 -259
- package/dist/constants/style.js +0 -48
- package/dist/favicon.ico +0 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/manifest.json +0 -25
- package/dist/robots.txt +0 -3
- package/dist/static/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.ttf.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff2 +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff2.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.ttf +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.ttf.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff2 +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff2.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Light.ttf +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.ttf.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff2 +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff2.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Regular.ttf +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.ttf.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff2 +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff2.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.ttf +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.ttf.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff.js +0 -4
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff2 +0 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff2.js +0 -4
- package/dist/static/images/avatar-placeholder.png.js +0 -4
- package/dist/styles/reactTippy.js +0 -5
- package/dist/styles/semanticUi.js +0 -84
- package/dist/utils/check-sale-time-left.js +0 -85
- package/dist/utils/moment.js +0 -26
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { radius as radii } from '../../styles/spacing';
|
|
3
|
+
export interface SkeletonProps {
|
|
4
|
+
/** px when a number, any CSS length otherwise. */
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
/** Fully rounded: a circle when width = height (avatars, icons), a pill otherwise (buttons, badges). */
|
|
8
|
+
round?: boolean;
|
|
9
|
+
/** Corner radius: a `radius` token name, px, or CSS length. Overrides `round`. Default `sm` (4px). */
|
|
10
|
+
radius?: keyof typeof radii | number | string;
|
|
11
|
+
/** Set false for a still block (e.g. many skeletons at once). Reduced-motion users never see the shimmer. */
|
|
12
|
+
animate?: boolean;
|
|
13
|
+
/** Block colour; change both colours on dark or coloured backgrounds. */
|
|
14
|
+
baseColor?: string;
|
|
15
|
+
/** Colour of the moving shine. */
|
|
16
|
+
highlightColor?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Shimmering placeholder for content that is still loading. Size it like the real content, so nothing jumps when
|
|
21
|
+
* the data arrives. Hidden from screen readers: wrap a loading area in one `SkeletonStatus` to announce it.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Skeleton: ({ width, height, round, radius, animate, baseColor, highlightColor, className, }: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export interface SkeletonLinesProps extends Pick<SkeletonProps, 'radius' | 'animate' | 'baseColor' | 'highlightColor'> {
|
|
25
|
+
lines?: number;
|
|
26
|
+
/** Height of each line in px. */
|
|
27
|
+
height?: number;
|
|
28
|
+
/** Space between lines in px. */
|
|
29
|
+
gap?: number;
|
|
30
|
+
/** Line widths, repeated when there are more lines than widths. */
|
|
31
|
+
widths?: Array<number | string>;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/** A stack of lines: a paragraph, a list or a table body still loading. */
|
|
35
|
+
export declare const SkeletonLines: ({ lines, height, gap, widths, className, ...lineProps }: SkeletonLinesProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export interface SkeletonStatusProps {
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
/** Read by screen readers instead of the (silent) skeletons. */
|
|
39
|
+
label?: string;
|
|
40
|
+
className?: string;
|
|
41
|
+
dataCy?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Marks an area as loading: screen readers read `label`, the skeletons inside stay silent. */
|
|
44
|
+
export declare const SkeletonStatus: ({ children, label, className, dataCy }: SkeletonStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SkeletonBlock, SkeletonLinesRoot, VisuallyHidden } from "./Skeleton.styles.js";
|
|
3
|
+
import { colors } from "../../styles/colors.js";
|
|
4
|
+
import { radius } from "../../styles/spacing.js";
|
|
5
|
+
const toRadius = (value, round) => {
|
|
6
|
+
if (value === void 0) return round ? radius.full : radius.sm;
|
|
7
|
+
if (typeof value === "number") return `${value}px`;
|
|
8
|
+
return value in radius ? radius[value] : value;
|
|
9
|
+
};
|
|
10
|
+
const Skeleton = ({
|
|
11
|
+
width = "100%",
|
|
12
|
+
height = 14,
|
|
13
|
+
round = false,
|
|
14
|
+
radius: radius2,
|
|
15
|
+
animate = true,
|
|
16
|
+
baseColor = colors.grey3,
|
|
17
|
+
highlightColor = colors.lightGrey,
|
|
18
|
+
className
|
|
19
|
+
}) => /* @__PURE__ */ jsx(
|
|
20
|
+
SkeletonBlock,
|
|
21
|
+
{
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
className,
|
|
24
|
+
$width: width,
|
|
25
|
+
$height: height,
|
|
26
|
+
$radius: toRadius(radius2, round),
|
|
27
|
+
$animate: animate,
|
|
28
|
+
$baseColor: baseColor,
|
|
29
|
+
$highlightColor: highlightColor
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
const SkeletonLines = ({
|
|
33
|
+
lines = 3,
|
|
34
|
+
height = 14,
|
|
35
|
+
gap = 12,
|
|
36
|
+
widths = ["100%"],
|
|
37
|
+
className,
|
|
38
|
+
...lineProps
|
|
39
|
+
}) => /* @__PURE__ */ jsx(SkeletonLinesRoot, { "aria-hidden": "true", className, $gap: gap, children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx(Skeleton, { width: widths[index % widths.length], height, ...lineProps }, index)) });
|
|
40
|
+
const SkeletonStatus = ({ children, label = "Loading", className, dataCy }) => /* @__PURE__ */ jsxs("div", { role: "status", className, "data-cy": dataCy, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: label }),
|
|
42
|
+
children
|
|
43
|
+
] });
|
|
44
|
+
export {
|
|
45
|
+
Skeleton,
|
|
46
|
+
SkeletonLines,
|
|
47
|
+
SkeletonStatus
|
|
48
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface BlockProps {
|
|
2
|
+
$width: number | string;
|
|
3
|
+
$height: number | string;
|
|
4
|
+
$radius: string;
|
|
5
|
+
$animate: boolean;
|
|
6
|
+
$baseColor: string;
|
|
7
|
+
$highlightColor: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SkeletonBlock: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, BlockProps>> & string;
|
|
10
|
+
export declare const SkeletonLinesRoot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
11
|
+
$gap: number;
|
|
12
|
+
}>> & string;
|
|
13
|
+
export declare const VisuallyHidden: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import styled, { css, keyframes } from "styled-components";
|
|
2
|
+
const shimmer = keyframes`
|
|
3
|
+
from {
|
|
4
|
+
background-position: 100% 0;
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
background-position: -100% 0;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
const toCss = (size) => /^\d+(\.\d+)?$/.test(String(size)) ? `${size}px` : size;
|
|
11
|
+
const SkeletonBlock = styled.span`
|
|
12
|
+
display: inline-block;
|
|
13
|
+
vertical-align: middle;
|
|
14
|
+
width: ${({ $width }) => toCss($width)};
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
height: ${({ $height }) => toCss($height)};
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
border-radius: ${({ $radius }) => $radius};
|
|
19
|
+
background: ${({ $baseColor, $highlightColor }) => `linear-gradient(90deg, ${$baseColor} 25%, ${$highlightColor} 50%, ${$baseColor} 75%)`};
|
|
20
|
+
background-size: 200% 100%;
|
|
21
|
+
animation: ${({ $animate }) => $animate ? css`
|
|
22
|
+
${shimmer} 1.4s ease-in-out infinite
|
|
23
|
+
` : "none"};
|
|
24
|
+
|
|
25
|
+
@media (prefers-reduced-motion: reduce) {
|
|
26
|
+
animation: none;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const SkeletonLinesRoot = styled.span`
|
|
30
|
+
display: flex;
|
|
31
|
+
flex: 1;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: ${({ $gap }) => $gap}px;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
`;
|
|
36
|
+
const VisuallyHidden = styled.span`
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
height: 1px;
|
|
40
|
+
margin: -1px;
|
|
41
|
+
padding: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
clip: rect(0 0 0 0);
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
border: 0;
|
|
46
|
+
`;
|
|
47
|
+
export {
|
|
48
|
+
SkeletonBlock,
|
|
49
|
+
SkeletonLinesRoot,
|
|
50
|
+
VisuallyHidden
|
|
51
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
/** The loading animation as animated WebP (~18 KB, the GIF is ~580 KB); a stable URL so browsers cache it. */
|
|
3
|
+
export declare const loaderGif = "https://res.cloudinary.com/stokr/image/upload/f_webp,fl_awebp,q_auto/v1575035788/Static/stokr_loader_white_400x400_egnhgb.gif";
|
|
4
|
+
export interface StokrLoaderProps {
|
|
5
|
+
/** Leaves the top 97px (the header) visible instead of covering the whole screen. */
|
|
6
|
+
noFullscreen?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Full-screen STOKR loading animation, shown while a page loads. */
|
|
9
|
+
export declare function StokrLoader({ noFullscreen }: StokrLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/** The loading animation centred in its container, for a loading area inside a page. */
|
|
11
|
+
export declare const StokrLoaderBox: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const AnimatedSpan: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
13
|
+
fontSize?: number;
|
|
14
|
+
}>> & string;
|
|
15
|
+
export type LoadingDotsProps = HTMLAttributes<HTMLSpanElement> & {
|
|
16
|
+
/** Dot size in px. Default 20. */
|
|
17
|
+
fontSize?: number;
|
|
18
|
+
};
|
|
19
|
+
/** Three blinking dots, e.g. after "Waiting for payment". */
|
|
20
|
+
export declare const LoadingDots: (props: LoadingDotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default StokrLoader;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import styled, { keyframes } from "styled-components";
|
|
4
|
-
|
|
5
|
-
const loaderGif = `https://res.cloudinary.com/stokr/image/upload/f_auto,q_auto/v1575035788/Static/stokr_loader_white_400x400_egnhgb.gif?a=${Math.random()}`;
|
|
3
|
+
const loaderGif = "https://res.cloudinary.com/stokr/image/upload/f_webp,fl_awebp,q_auto/v1575035788/Static/stokr_loader_white_400x400_egnhgb.gif";
|
|
6
4
|
const CenterFullWidth = styled.div`
|
|
7
5
|
width: 100%;
|
|
8
6
|
height: 100%;
|
|
@@ -44,39 +42,40 @@ const StyledStokrLoader = styled.div.withConfig({
|
|
|
44
42
|
top: unset;
|
|
45
43
|
`}
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
/* 320px, 375px and 768px at the 16px base. */
|
|
46
|
+
@media (min-width: 20em) {
|
|
47
|
+
img {
|
|
48
|
+
height: 15rem;
|
|
49
|
+
width: 15rem;
|
|
50
|
+
}
|
|
51
51
|
}
|
|
52
|
-
`};
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
@media (min-width: 23.4375em) {
|
|
54
|
+
img {
|
|
55
|
+
height: 18rem;
|
|
56
|
+
width: 18rem;
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
|
-
`};
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
@media (min-width: 48em) {
|
|
61
|
+
img {
|
|
62
|
+
height: 30rem;
|
|
63
|
+
width: 30rem;
|
|
64
|
+
}
|
|
65
65
|
}
|
|
66
|
-
`};
|
|
67
66
|
`;
|
|
68
|
-
function StokrLoader() {
|
|
69
|
-
return /* @__PURE__ */ jsx(StyledStokrLoader, { children: /* @__PURE__ */ jsx("img", { src: loaderGif, alt: " " }) });
|
|
67
|
+
function StokrLoader({ noFullscreen }) {
|
|
68
|
+
return /* @__PURE__ */ jsx(StyledStokrLoader, { noFullscreen, children: /* @__PURE__ */ jsx("img", { src: loaderGif, alt: " " }) });
|
|
70
69
|
}
|
|
71
|
-
const StokrLoaderBox = (
|
|
72
|
-
return /* @__PURE__ */ jsx(CenterFullWidth, {
|
|
70
|
+
const StokrLoaderBox = () => {
|
|
71
|
+
return /* @__PURE__ */ jsx(CenterFullWidth, { children: /* @__PURE__ */ jsx("img", { src: loaderGif, alt: " " }) });
|
|
73
72
|
};
|
|
74
73
|
const fadeInOut = keyframes`
|
|
75
74
|
50% {
|
|
76
75
|
color: transparent;
|
|
77
76
|
}
|
|
78
77
|
`;
|
|
79
|
-
const AnimatedSpan = styled.
|
|
78
|
+
const AnimatedSpan = styled.span.withConfig({
|
|
80
79
|
shouldForwardProp: (props) => !["fontSize"].includes(props)
|
|
81
80
|
})`
|
|
82
81
|
margin: 0;
|
|
@@ -5,7 +5,7 @@ import { StyledTabs, Scroll, TabsWrapper } from "./TabsNav.styles.js";
|
|
|
5
5
|
import { LinkText, StyledTab } from "./TabsNav.styles.js";
|
|
6
6
|
const TabsNav = ({ children, activeTab = 0, noBorderBottom, noWrapperPadding }) => /* @__PURE__ */ jsx(StyledTabs, { noBorderBottom, children: /* @__PURE__ */ jsx(Scroll, { children: /* @__PURE__ */ jsx(TabsWrapper, { noWrapperPadding, children: React__default.Children.map(children, (child) => {
|
|
7
7
|
if (!React__default.isValidElement(child)) return null;
|
|
8
|
-
return React__default.
|
|
8
|
+
return React__default.cloneElement(child, {
|
|
9
9
|
...child.props,
|
|
10
10
|
isActive: child.props.tabId === activeTab
|
|
11
11
|
});
|
|
@@ -53,7 +53,7 @@ const LinkText = styled.span`
|
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
55
|
const StyledTab = styled.button.withConfig({
|
|
56
|
-
shouldForwardProp: (props) => !["isActive", "customStyles"].includes(props)
|
|
56
|
+
shouldForwardProp: (props) => !["isActive", "customStyles", "tabId"].includes(props)
|
|
57
57
|
})`
|
|
58
58
|
display: inline-block;
|
|
59
59
|
position: relative;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TextProps {
|
|
2
|
+
fullWidth?: boolean;
|
|
3
|
+
center?: boolean;
|
|
4
|
+
withMarginBottom?: boolean;
|
|
5
|
+
withMarginRight?: boolean;
|
|
6
|
+
blockchainLoadingMsg?: boolean;
|
|
7
|
+
responsiveFont?: boolean;
|
|
8
|
+
small?: boolean;
|
|
9
|
+
success?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface TextCaptionProps {
|
|
12
|
+
center?: boolean;
|
|
13
|
+
/** Extra space above, for a caption under a link or button. */
|
|
14
|
+
link?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Text block for rich content (headings, paragraphs, lists); `Text.Caption` is the small print style. */
|
|
17
|
+
export declare const Text: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TextProps>> & string & {
|
|
18
|
+
Caption: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, TextCaptionProps>> & string;
|
|
19
|
+
};
|
|
20
|
+
export default Text;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import rwd from "../../styles/rwd.js";
|
|
3
3
|
import theme from "../../styles/theme.js";
|
|
4
|
-
const
|
|
4
|
+
const TextBase = styled.div.withConfig({
|
|
5
5
|
shouldForwardProp: (props) => ![
|
|
6
6
|
"fullWidth",
|
|
7
7
|
"center",
|
|
@@ -213,7 +213,7 @@ const Caption = styled.p.withConfig({
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
`;
|
|
216
|
-
Text
|
|
216
|
+
const Text = Object.assign(TextBase, { Caption });
|
|
217
217
|
export {
|
|
218
218
|
Text,
|
|
219
219
|
Text as default
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export type VirtualReference = {
|
|
4
|
+
getBoundingClientRect: () => DOMRect;
|
|
5
|
+
};
|
|
6
|
+
export type TooltipProps = {
|
|
7
|
+
/** Tooltip body. When empty, `children` render untouched with no listeners. */
|
|
8
|
+
content?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
placement?: TooltipPlacement;
|
|
11
|
+
/** Render `children` untouched, no tooltip at all. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
delay?: number | {
|
|
14
|
+
open?: number;
|
|
15
|
+
close?: number;
|
|
16
|
+
};
|
|
17
|
+
showArrow?: boolean;
|
|
18
|
+
/** Arrow fill. Defaults to the theme primary, falling back to STOKR blue. */
|
|
19
|
+
arrowColor?: string;
|
|
20
|
+
maxWidth?: number | string;
|
|
21
|
+
/**
|
|
22
|
+
* Allow pointer events on the bubble and keep it open while the pointer travels
|
|
23
|
+
* there. Needed only when the content has links or selectable text — matches
|
|
24
|
+
* react-tippy, which was non-interactive (`pointer-events: none`) by default.
|
|
25
|
+
*/
|
|
26
|
+
interactive?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Controlled mode — when set, internal hover/tap/dismiss wiring is bypassed and
|
|
29
|
+
* the caller owns visibility entirely. `onOpenChange` is therefore never called
|
|
30
|
+
* in this mode; it only fires when the tooltip manages its own state.
|
|
31
|
+
*/
|
|
32
|
+
open?: boolean;
|
|
33
|
+
onOpenChange?: (open: boolean) => void;
|
|
34
|
+
/** Position against an arbitrary rect instead of `children` (charts, cursors). */
|
|
35
|
+
reference?: VirtualReference | null;
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Applied to the bubble. */
|
|
38
|
+
style?: CSSProperties;
|
|
39
|
+
zIndex?: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const Tooltip: ({ content, children, placement, disabled, delay, showArrow, arrowColor, maxWidth, interactive, open: controlledOpen, onOpenChange, reference, className, style, zIndex, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export default Tooltip;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrapper used when the trigger can't carry the listeners itself — a child that
|
|
3
|
+
* doesn't forward refs, or a disabled element (which fires no pointer events).
|
|
4
|
+
* react-tippy always rendered a wrapper, so this matches the old DOM shape.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TriggerWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
7
|
+
export declare const Bubble: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
8
|
+
$maxWidth: number | string;
|
|
9
|
+
$interactive: boolean;
|
|
10
|
+
}>> & string;
|
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
const walletTypes = {
|
|
2
|
-
LIQUID: "liquid"
|
|
3
|
-
};
|
|
4
1
|
const ProjectTypes = {
|
|
5
2
|
FUND: "fund",
|
|
6
3
|
COMPANY: "company",
|
|
7
4
|
TRANCHES: "tranches",
|
|
8
5
|
EQUITY: "equity"
|
|
9
6
|
};
|
|
10
|
-
const ProjectStatus = {
|
|
11
|
-
ACTIVE: "Active",
|
|
12
|
-
INACTIVE: "Inactive",
|
|
13
|
-
ON_HOLD: "On_hold"
|
|
14
|
-
};
|
|
15
|
-
const ProjectStates = {
|
|
16
|
-
ON_HOLD: "ON HOLD",
|
|
17
|
-
LIVE: "LIVE",
|
|
18
|
-
OPEN: "OPEN",
|
|
19
|
-
CLOSED: "CLOSED",
|
|
20
|
-
CLOSED_SUCCESSFULLY: "CLOSED SUCCESSFULLY",
|
|
21
|
-
UPCOMING: "UPCOMING"
|
|
22
|
-
};
|
|
23
|
-
const UserTypes = {
|
|
24
|
-
investor: "investor",
|
|
25
|
-
investor_entity: "investor_entity"
|
|
26
|
-
};
|
|
27
|
-
const ProfessionalInvestorStatuses = {
|
|
28
|
-
PROFESSIONAL: "professional",
|
|
29
|
-
NOT_PROFESSIONAL: "not professional",
|
|
30
|
-
NOT_CLASIFIED: "not classified"
|
|
31
|
-
};
|
|
32
|
-
const USInvestorAcreditationStatuses = {
|
|
33
|
-
US_ACCREDITED: "US accredited",
|
|
34
|
-
NOT_US_ACCREDITED: "not US accredited",
|
|
35
|
-
NOT_CLASIFIED: "not classified"
|
|
36
|
-
};
|
|
37
7
|
const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
|
|
38
8
|
const LoanActivityTypes = {
|
|
39
9
|
PRINCIPAL_DEPOSIT: "principal_deposit",
|
|
@@ -69,15 +39,7 @@ const transactionTypeDisplayNames = {
|
|
|
69
39
|
[TransactionTypes.SUBSCRIPTION]: "Issuance"
|
|
70
40
|
};
|
|
71
41
|
export {
|
|
72
|
-
LoanActivityTypes,
|
|
73
|
-
ProfessionalInvestorStatuses,
|
|
74
|
-
ProjectStates,
|
|
75
|
-
ProjectStatus,
|
|
76
42
|
ProjectTypes,
|
|
77
|
-
TransactionTypes,
|
|
78
|
-
USInvestorAcreditationStatuses,
|
|
79
|
-
UserTypes,
|
|
80
43
|
emailRegex,
|
|
81
|
-
transactionTypeDisplayNames
|
|
82
|
-
walletTypes
|
|
44
|
+
transactionTypeDisplayNames
|
|
83
45
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a media query matches, kept in sync with resizes. Returns `serverValue` on the server and during
|
|
3
|
+
* hydration, so the first client render matches the server markup (no flash, no hydration warning).
|
|
4
|
+
*
|
|
5
|
+
* const isDesktop = useMediaQuery(mediaQuery.desktopUp)
|
|
6
|
+
*/
|
|
7
|
+
export declare const useMediaQuery: (query: string, serverValue?: boolean) => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
2
|
+
const useMediaQuery = (query, serverValue = false) => {
|
|
3
|
+
const subscribe = useCallback(
|
|
4
|
+
(onChange) => {
|
|
5
|
+
const list = window.matchMedia(query);
|
|
6
|
+
list.addEventListener("change", onChange);
|
|
7
|
+
return () => list.removeEventListener("change", onChange);
|
|
8
|
+
},
|
|
9
|
+
[query]
|
|
10
|
+
);
|
|
11
|
+
return useSyncExternalStore(
|
|
12
|
+
subscribe,
|
|
13
|
+
() => window.matchMedia(query).matches,
|
|
14
|
+
() => serverValue
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
useMediaQuery
|
|
19
|
+
};
|