@the-story/standard-core 1.0.3
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/README.md +47 -0
- package/dist/NextIntlClientInheritor/NextIntlClientInheritor.d.ts +8 -0
- package/dist/NextIntlClientInheritor/NextIntlClientInheritor.js +45 -0
- package/dist/NextIntlClientInheritor/index.d.ts +1 -0
- package/dist/NextIntlClientInheritor/index.js +1 -0
- package/dist/ThemeInheritor/ThemeInheritor.d.ts +4 -0
- package/dist/ThemeInheritor/ThemeInheritor.js +17 -0
- package/dist/ThemeInheritor/index.d.ts +1 -0
- package/dist/ThemeInheritor/index.js +1 -0
- package/dist/ThemeInheritor/types.d.ts +7 -0
- package/dist/ThemeInheritor/types.js +1 -0
- package/dist/atoms/Accordion/Accordion.d.ts +6 -0
- package/dist/atoms/Accordion/Accordion.js +9 -0
- package/dist/atoms/Accordion/AccordionIcon.d.ts +2 -0
- package/dist/atoms/Accordion/AccordionIcon.js +19 -0
- package/dist/atoms/Accordion/AccordionList.d.ts +10 -0
- package/dist/atoms/Accordion/AccordionList.js +45 -0
- package/dist/atoms/Accordion/index.d.ts +3 -0
- package/dist/atoms/Accordion/index.js +1 -0
- package/dist/atoms/Accordion/types.d.ts +12 -0
- package/dist/atoms/Accordion/types.js +1 -0
- package/dist/atoms/Avatar/Avatar.d.ts +3 -0
- package/dist/atoms/Avatar/Avatar.js +30 -0
- package/dist/atoms/Avatar/index.d.ts +2 -0
- package/dist/atoms/Avatar/index.js +1 -0
- package/dist/atoms/Avatar/types.d.ts +5 -0
- package/dist/atoms/Avatar/types.js +1 -0
- package/dist/atoms/BackToTopButton/BackToTopButton.d.ts +5 -0
- package/dist/atoms/BackToTopButton/BackToTopButton.js +53 -0
- package/dist/atoms/BackToTopButton/index.d.ts +1 -0
- package/dist/atoms/BackToTopButton/index.js +1 -0
- package/dist/atoms/Button/Button.d.ts +21 -0
- package/dist/atoms/Button/Button.js +9 -0
- package/dist/atoms/Button/index.d.ts +1 -0
- package/dist/atoms/Button/index.js +1 -0
- package/dist/atoms/CmsCroppedImage/CmsCroppedImage.d.ts +18 -0
- package/dist/atoms/CmsCroppedImage/CmsCroppedImage.js +41 -0
- package/dist/atoms/CmsCroppedImage/index.d.ts +1 -0
- package/dist/atoms/CmsCroppedImage/index.js +1 -0
- package/dist/atoms/CmsImage/CmsImage.d.ts +18 -0
- package/dist/atoms/CmsImage/CmsImage.js +61 -0
- package/dist/atoms/CmsImage/index.d.ts +1 -0
- package/dist/atoms/CmsImage/index.js +1 -0
- package/dist/atoms/CmsRichText/CmsRichText.d.ts +14 -0
- package/dist/atoms/CmsRichText/CmsRichText.js +96 -0
- package/dist/atoms/CmsRichText/index.d.ts +1 -0
- package/dist/atoms/CmsRichText/index.js +1 -0
- package/dist/atoms/CopyToClipboard/CopyToClipboard.d.ts +12 -0
- package/dist/atoms/CopyToClipboard/CopyToClipboard.js +39 -0
- package/dist/atoms/CopyToClipboard/index.d.ts +1 -0
- package/dist/atoms/CopyToClipboard/index.js +1 -0
- package/dist/atoms/CopyToClipboard/useCopyToClipboard.d.ts +4 -0
- package/dist/atoms/CopyToClipboard/useCopyToClipboard.js +70 -0
- package/dist/atoms/CroppedImage/CroppedImage.d.ts +16 -0
- package/dist/atoms/CroppedImage/CroppedImage.js +65 -0
- package/dist/atoms/CroppedImage/index.d.ts +2 -0
- package/dist/atoms/CroppedImage/index.js +2 -0
- package/dist/atoms/CroppedImage/utils.d.ts +12 -0
- package/dist/atoms/CroppedImage/utils.js +16 -0
- package/dist/atoms/CtaButton/CtaButton.d.ts +12 -0
- package/dist/atoms/CtaButton/CtaButton.js +44 -0
- package/dist/atoms/CtaButton/index.d.ts +2 -0
- package/dist/atoms/CtaButton/index.js +1 -0
- package/dist/atoms/Divider/Divider.d.ts +4 -0
- package/dist/atoms/Divider/Divider.js +15 -0
- package/dist/atoms/Divider/index.d.ts +1 -0
- package/dist/atoms/Divider/index.js +1 -0
- package/dist/atoms/Form/Checkbox.d.ts +9 -0
- package/dist/atoms/Form/Checkbox.js +44 -0
- package/dist/atoms/Form/TermsLabel.d.ts +2 -0
- package/dist/atoms/Form/TermsLabel.js +12 -0
- package/dist/atoms/Form/TextField.d.ts +7 -0
- package/dist/atoms/Form/TextField.js +45 -0
- package/dist/atoms/Form/index.d.ts +3 -0
- package/dist/atoms/Form/index.js +3 -0
- package/dist/atoms/FormatedData/FormatedData.d.ts +4 -0
- package/dist/atoms/FormatedData/FormatedData.js +17 -0
- package/dist/atoms/FormatedData/index.d.ts +1 -0
- package/dist/atoms/FormatedData/index.js +1 -0
- package/dist/atoms/Link/Link.d.ts +5 -0
- package/dist/atoms/Link/Link.js +59 -0
- package/dist/atoms/Link/index.d.ts +2 -0
- package/dist/atoms/Link/index.js +2 -0
- package/dist/atoms/Map/Map.d.ts +7 -0
- package/dist/atoms/Map/Map.js +35 -0
- package/dist/atoms/Map/Root.d.ts +6 -0
- package/dist/atoms/Map/Root.js +14 -0
- package/dist/atoms/Map/index.d.ts +1 -0
- package/dist/atoms/Map/index.js +1 -0
- package/dist/atoms/Map/types.d.ts +3 -0
- package/dist/atoms/Map/types.js +1 -0
- package/dist/atoms/Pagination/Pagination.d.ts +9 -0
- package/dist/atoms/Pagination/Pagination.js +60 -0
- package/dist/atoms/Pagination/index.d.ts +1 -0
- package/dist/atoms/Pagination/index.js +1 -0
- package/dist/atoms/SvgIcon/SvgIcon.d.ts +31 -0
- package/dist/atoms/SvgIcon/SvgIcon.js +65 -0
- package/dist/atoms/SvgIcon/index.d.ts +2 -0
- package/dist/atoms/SvgIcon/index.js +2 -0
- package/dist/atoms/VideoPlayer/VideoPlayer.d.ts +27 -0
- package/dist/atoms/VideoPlayer/VideoPlayer.js +146 -0
- package/dist/atoms/VideoPlayer/index.d.ts +1 -0
- package/dist/atoms/VideoPlayer/index.js +1 -0
- package/dist/atoms/exports.d.ts +14 -0
- package/dist/atoms/exports.js +14 -0
- package/dist/config/i18n.d.ts +5 -0
- package/dist/config/i18n.js +5 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +1 -0
- package/dist/config/navigation.d.ts +358 -0
- package/dist/config/navigation.js +10 -0
- package/dist/exports.d.ts +6 -0
- package/dist/exports.js +6 -0
- package/dist/molecules/Crumbs/Crumbs.d.ts +12 -0
- package/dist/molecules/Crumbs/Crumbs.js +80 -0
- package/dist/molecules/Crumbs/index.d.ts +1 -0
- package/dist/molecules/Crumbs/index.js +1 -0
- package/dist/molecules/LanguageSelector/LanguageSelector.d.ts +5 -0
- package/dist/molecules/LanguageSelector/LanguageSelector.js +82 -0
- package/dist/molecules/LanguageSelector/index.d.ts +1 -0
- package/dist/molecules/LanguageSelector/index.js +1 -0
- package/dist/molecules/exports.d.ts +2 -0
- package/dist/molecules/exports.js +2 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +1 -0
- package/dist/types/strapi.d.ts +32 -0
- package/dist/types/strapi.js +1 -0
- package/dist/utils/cmsMediaUrl.d.ts +1 -0
- package/dist/utils/cmsMediaUrl.js +5 -0
- package/dist/utils/exports.d.ts +2 -0
- package/dist/utils/exports.js +2 -0
- package/dist/utils/extractUrlFromText.d.ts +1 -0
- package/dist/utils/extractUrlFromText.js +11 -0
- package/dist/utils/svgFontSizeValues.d.ts +9 -0
- package/dist/utils/svgFontSizeValues.js +11 -0
- package/package.json +364 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Standard Core by The Story
|
|
2
|
+
|
|
3
|
+
A set of core UI components, configuration, and utilities to be reused across other projects. The library is developed in isolation in Storybook and then verified inside external applications.
|
|
4
|
+
|
|
5
|
+
## How to use the library in a project
|
|
6
|
+
|
|
7
|
+
During development, we use yalc for local linking (a lightweight alternative to a private npm registry).
|
|
8
|
+
- yalc repository: https://github.com/wclr/yalc
|
|
9
|
+
|
|
10
|
+
### Quick start (local link via yalc) — using PyCharm Run configurations
|
|
11
|
+
1. In the library (this repository):
|
|
12
|
+
- In PyCharm, use the already added Run configurations: "build", "yalc:publish" (optionally also "yalc:push").
|
|
13
|
+
- Run "yalc:publish".
|
|
14
|
+
2. In the consuming application:
|
|
15
|
+
- Use the existing project configuration that adds the package via yalc (e.g., "yalc:add" or a "Shell Script" configuration with: yalc add @thestory/standard-core).
|
|
16
|
+
- Run the prepared configuration that installs dependencies (e.g., NPM "install"/"yarn install").
|
|
17
|
+
- Start the application using its dedicated Run configuration and verify it works.
|
|
18
|
+
3. Updating when the library changes:
|
|
19
|
+
- In the library: run "yalc:publish" to push the update to all consumers.
|
|
20
|
+
- In the app: run the "yalc:update" configuration to update the package; optionally restart the dev server.
|
|
21
|
+
4. Removing the yalc package in the app: run the existing configuration that removes the package (e.g., a "Shell Script" with: yalc remove @thestory/standard-core).
|
|
22
|
+
|
|
23
|
+
Note: Eventually the package may be published to an npm registry (public or private). yalc is intended only for local development.
|
|
24
|
+
|
|
25
|
+
## Component development (Storybook)
|
|
26
|
+
|
|
27
|
+
We use Storybook to build and preview components. Every component MUST have at least one story that demonstrates its basic usage and state variants.
|
|
28
|
+
|
|
29
|
+
- Launching Storybook: in PyCharm run the existing NPM configuration "storybook" from the Run toolbar.
|
|
30
|
+
- Building a static version: in PyCharm run the existing NPM configuration "build-storybook".
|
|
31
|
+
|
|
32
|
+
Guidelines:
|
|
33
|
+
- In this project, stories live in the `src/stories` directory, grouped into categories (e.g., `Atoms`, `Molecules`) and mirroring component structure, e.g., `src/stories/Atoms/Button/Button.stories.tsx`.
|
|
34
|
+
- Use the `*.stories.ts(x)` naming and include multiple usage variants of the component.
|
|
35
|
+
- Add different prop variants and states (loading/disabled/error), including edge cases.
|
|
36
|
+
- If a component has external dependencies or requires context (Theme/Intl/Router), prepare appropriate Storybook decorators.
|
|
37
|
+
|
|
38
|
+
## Verification in an external application
|
|
39
|
+
|
|
40
|
+
After confirming the component works in Storybook:
|
|
41
|
+
1. In the library, run the NPM "build" configuration in PyCharm.
|
|
42
|
+
2. Next run the "yalc:publish" configuration.
|
|
43
|
+
3. In the consuming app, use its prepared PyCharm configurations (e.g., "yalc add", "install", "dev") and test the integration (styles, interactions, SSR/CSR, etc.).
|
|
44
|
+
|
|
45
|
+
## Environment variables
|
|
46
|
+
|
|
47
|
+
These variables should be configured in the application that uses the library (in its `.env` file), not in this package.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
import type { Timezone } from "use-intl";
|
|
3
|
+
declare const NextIntlClientInheritor: ({ locale, messages, timeZone, children, }: PropsWithChildren<{
|
|
4
|
+
locale: string;
|
|
5
|
+
messages: any;
|
|
6
|
+
timeZone: Timezone;
|
|
7
|
+
}>) => Promise<import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export default NextIntlClientInheritor;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
+
import { NextIntlClientProvider } from "next-intl";
|
|
39
|
+
var NextIntlClientInheritor = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
40
|
+
var locale = _b.locale, messages = _b.messages, timeZone = _b.timeZone, children = _b.children;
|
|
41
|
+
return __generator(this, function (_c) {
|
|
42
|
+
return [2 /*return*/, (_jsx(NextIntlClientProvider, { locale: locale, messages: messages, timeZone: timeZone, children: children }))];
|
|
43
|
+
});
|
|
44
|
+
}); };
|
|
45
|
+
export default NextIntlClientInheritor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NextIntlClientInheritor } from "./NextIntlClientInheritor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NextIntlClientInheritor } from "./NextIntlClientInheritor";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThemeProviderProps } from "@mui/material/styles/ThemeProvider";
|
|
2
|
+
import type { DefaultTheme } from "@mui/system";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export default function ThemeInheritor<Theme = DefaultTheme>({ theme, ...props }: ThemeProviderProps<Theme>): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { ThemeProvider } from "@mui/material/styles";
|
|
14
|
+
export default function ThemeInheritor(_a) {
|
|
15
|
+
var theme = _a.theme, props = __rest(_a, ["theme"]);
|
|
16
|
+
return _jsx(ThemeProvider, { theme: theme, children: props.children });
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ThemeInheritor } from "./ThemeInheritor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ThemeInheritor } from "./ThemeInheritor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CtaButtonProps } from "../CtaButton";
|
|
2
|
+
import { type AccordionListProps } from "./AccordionList";
|
|
3
|
+
export interface AccordionProps extends AccordionListProps, CtaButtonProps {
|
|
4
|
+
}
|
|
5
|
+
declare const Accordion: ({ button, items, disableIcon, disableGutters, sx, useContrastColors, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default Accordion;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CtaButton } from "../CtaButton";
|
|
3
|
+
import Stack from "@mui/material/Stack";
|
|
4
|
+
import { AccordionList } from "./AccordionList";
|
|
5
|
+
var Accordion = function (_a) {
|
|
6
|
+
var button = _a.button, items = _a.items, disableIcon = _a.disableIcon, disableGutters = _a.disableGutters, sx = _a.sx, useContrastColors = _a.useContrastColors;
|
|
7
|
+
return (_jsxs(Stack, { direction: "column", spacing: 4, children: [_jsx(AccordionList, { items: items, disableIcon: disableIcon, disableGutters: disableGutters, sx: sx, useContrastColors: useContrastColors }), button && _jsx(CtaButton, { button: button })] }));
|
|
8
|
+
};
|
|
9
|
+
export default Accordion;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
3
|
+
import RemoveIcon from "@mui/icons-material/Remove";
|
|
4
|
+
import Box from "@mui/material/Box";
|
|
5
|
+
import IconButton from "@mui/material/IconButton";
|
|
6
|
+
export var ExpandIcon = function (_a) {
|
|
7
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b;
|
|
8
|
+
return (_jsx(Box, { sx: {
|
|
9
|
+
".Mui-expanded & > * > .collapsIconWrapper": {
|
|
10
|
+
display: "none",
|
|
11
|
+
},
|
|
12
|
+
".expandIconWrapper": {
|
|
13
|
+
display: "none",
|
|
14
|
+
},
|
|
15
|
+
".Mui-expanded & > * > .expandIconWrapper": {
|
|
16
|
+
display: "block",
|
|
17
|
+
},
|
|
18
|
+
}, children: _jsxs(IconButton, { children: [_jsx(RemoveIcon, { className: "expandIconWrapper", color: color }), _jsx(AddIcon, { className: "collapsIconWrapper", color: color })] }) }));
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SxProps } from "@mui/system";
|
|
2
|
+
import type { ContrastAware } from "@the-story/standard-core/types";
|
|
3
|
+
import type { AccordionItem } from "./types";
|
|
4
|
+
export interface AccordionListProps extends ContrastAware {
|
|
5
|
+
items: AccordionItem[];
|
|
6
|
+
disableIcon?: boolean;
|
|
7
|
+
disableGutters?: boolean;
|
|
8
|
+
sx?: SxProps;
|
|
9
|
+
}
|
|
10
|
+
export declare const AccordionList: ({ items, disableIcon, disableGutters, useContrastColors, sx, }: AccordionListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import MuiAccordion from "@mui/material/Accordion";
|
|
14
|
+
import AccordionDetails from "@mui/material/AccordionDetails";
|
|
15
|
+
import AccordionSummary from "@mui/material/AccordionSummary";
|
|
16
|
+
import Box from "@mui/material/Box";
|
|
17
|
+
import Stack from "@mui/material/Stack";
|
|
18
|
+
import Typography from "@mui/material/Typography";
|
|
19
|
+
import { alpha } from "@mui/material/styles";
|
|
20
|
+
import Link from "@the-story/standard-core/atoms/Link/Link";
|
|
21
|
+
import { ExpandIcon } from "./AccordionIcon";
|
|
22
|
+
export var AccordionList = function (_a) {
|
|
23
|
+
var items = _a.items, _b = _a.disableIcon, disableIcon = _b === void 0 ? false : _b, _c = _a.disableGutters, disableGutters = _c === void 0 ? true : _c, useContrastColors = _a.useContrastColors, sx = _a.sx;
|
|
24
|
+
return (_jsx(Box, { children: items.map(function (item, index) {
|
|
25
|
+
var _a;
|
|
26
|
+
return (_jsxs(MuiAccordion, { defaultExpanded: index === 0, disableGutters: disableGutters, elevation: 0, square: true, sx: __assign({ mx: "auto", color: useContrastColors ? "primary.contrastText" : "text.primary", backgroundColor: "transparent", "&.MuiAccordion-root:before": {
|
|
27
|
+
backgroundColor: useContrastColors ? alpha("#FFF", 0.3) : "divider",
|
|
28
|
+
height: 2,
|
|
29
|
+
} }, sx), children: [_jsxs(AccordionSummary, { component: "div", sx: {
|
|
30
|
+
height: "66px",
|
|
31
|
+
my: 0,
|
|
32
|
+
px: 0,
|
|
33
|
+
"& .MuiAccordionSummary-content": {
|
|
34
|
+
gap: 1,
|
|
35
|
+
},
|
|
36
|
+
}, expandIcon: !disableIcon && (_jsx(ExpandIcon, { color: useContrastColors ? "secondary" : "primary" })), children: [_jsx(Typography, { variant: "h6", children: item.label }), item.overline && (_jsx(Typography, { variant: "overline", alignSelf: "center", sx: {
|
|
37
|
+
ml: "auto",
|
|
38
|
+
mr: 1,
|
|
39
|
+
}, children: item.overline }))] }), _jsx(AccordionDetails, { sx: {
|
|
40
|
+
pt: 0,
|
|
41
|
+
px: 0,
|
|
42
|
+
maxWidth: "648px",
|
|
43
|
+
}, children: item.content }), _jsx(Stack, { flexDirection: "row", flexWrap: "wrap", columnGap: 1, children: (_a = item === null || item === void 0 ? void 0 : item.links) === null || _a === void 0 ? void 0 : _a.map(function (link, index) { return (_jsx(Link, { href: link.url || "", children: link.label }, "link-".concat(index))); }) })] }, "accordion-".concat(index)));
|
|
44
|
+
}) }));
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Accordion } from "./Accordion";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { APIString } from "@the-story/standard-core/types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export interface AccordionItem {
|
|
4
|
+
label?: ReactNode | APIString;
|
|
5
|
+
overline?: APIString;
|
|
6
|
+
content?: ReactNode | APIString;
|
|
7
|
+
links?: {
|
|
8
|
+
label?: APIString;
|
|
9
|
+
url?: APIString;
|
|
10
|
+
overline?: APIString;
|
|
11
|
+
}[] | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import MuiAvatar from "@mui/material/Avatar";
|
|
4
|
+
import Typography from "@mui/material/Typography";
|
|
5
|
+
import { amber, deepPurple } from "@mui/material/colors";
|
|
6
|
+
function getColor(backgroundColor) {
|
|
7
|
+
switch (backgroundColor) {
|
|
8
|
+
case "amber":
|
|
9
|
+
return amber[400];
|
|
10
|
+
case "purple":
|
|
11
|
+
return deepPurple[600];
|
|
12
|
+
case "amberDark":
|
|
13
|
+
return amber[800];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
var Avatar = function (_a) {
|
|
17
|
+
var backgroundColor = _a.backgroundColor, _b = _a.disableBorder, disableBorder = _b === void 0 ? false : _b, value = _a.value;
|
|
18
|
+
return (_jsx(MuiAvatar, { sx: {
|
|
19
|
+
border: disableBorder ? 0 : function (theme) { return "2px solid white"; },
|
|
20
|
+
width: "40px",
|
|
21
|
+
height: "40px",
|
|
22
|
+
textTransform: "uppercase",
|
|
23
|
+
backgroundColor: getColor(backgroundColor),
|
|
24
|
+
}, variant: "circular", children: _jsx(Typography, { sx: {
|
|
25
|
+
fontFamily: "Epilogue",
|
|
26
|
+
fontSize: 20,
|
|
27
|
+
fontWeight: 400,
|
|
28
|
+
}, children: value }) }));
|
|
29
|
+
};
|
|
30
|
+
export default Avatar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Avatar } from "./Avatar";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
|
|
15
|
+
import Fab from "@mui/material/Fab";
|
|
16
|
+
import { motion, useMotionValueEvent, useScroll } from "motion/react";
|
|
17
|
+
import { useTranslations } from "next-intl";
|
|
18
|
+
import { useState } from "react";
|
|
19
|
+
var FMFab = motion(Fab);
|
|
20
|
+
var BackToTopButton = function (_a) {
|
|
21
|
+
var sx = _a.sx;
|
|
22
|
+
var _b = useState(true), hidden = _b[0], setHidden = _b[1];
|
|
23
|
+
var scrollYProgress = useScroll().scrollYProgress;
|
|
24
|
+
var t = useTranslations("common");
|
|
25
|
+
useMotionValueEvent(scrollYProgress, "change", function (latest) {
|
|
26
|
+
if (latest > 0.1) {
|
|
27
|
+
setHidden(false);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
setHidden(true);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return (_jsxs(FMFab, { layout: true, initial: "hidden", animate: hidden ? "hidden" : "visible", transition: {
|
|
34
|
+
duration: 0.3,
|
|
35
|
+
type: "spring",
|
|
36
|
+
bounce: 0.3,
|
|
37
|
+
}, variants: {
|
|
38
|
+
visible: {
|
|
39
|
+
opacity: 1,
|
|
40
|
+
scale: 1,
|
|
41
|
+
},
|
|
42
|
+
hidden: {
|
|
43
|
+
opacity: 0,
|
|
44
|
+
scale: 0,
|
|
45
|
+
},
|
|
46
|
+
}, sx: __assign({ fontWeight: 600, fontSize: 16, position: "fixed", bottom: 24, right: 24, textTransform: "none" }, sx), onClick: function () {
|
|
47
|
+
return window.scrollTo({
|
|
48
|
+
top: 0,
|
|
49
|
+
behavior: "smooth",
|
|
50
|
+
});
|
|
51
|
+
}, size: "large", color: "primary", variant: "extended", children: [t("backToTop"), _jsx(ArrowUpwardIcon, { sx: { ml: 1 } })] }));
|
|
52
|
+
};
|
|
53
|
+
export default BackToTopButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BackToTopButton } from "./BackToTopButton";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BackToTopButton } from "./BackToTopButton";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ButtonOwnProps } from "@mui/material/Button";
|
|
2
|
+
import type { SxProps, Theme } from "@mui/material/styles";
|
|
3
|
+
import type { APIString } from "@the-story/standard-core/types";
|
|
4
|
+
import type { ButtonHTMLAttributes, ElementType, ReactNode } from "react";
|
|
5
|
+
declare const Button: ({ type, href, target, children, variant, color, size, disabled, onClick, onMouseEnter, component, endIcon, startIcon, sx, }: {
|
|
6
|
+
type?: ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
|
7
|
+
href?: APIString;
|
|
8
|
+
target?: string;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
variant?: ButtonOwnProps["variant"];
|
|
11
|
+
color?: ButtonOwnProps["color"];
|
|
12
|
+
size?: ButtonOwnProps["size"];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onClick?: (e: any) => void;
|
|
15
|
+
onMouseEnter?: (e: any) => void;
|
|
16
|
+
component?: ElementType;
|
|
17
|
+
endIcon?: ReactNode;
|
|
18
|
+
startIcon?: ReactNode;
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default Button;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import MuiButton from "@mui/material/Button";
|
|
4
|
+
import { LocalizedLink } from "@the-story/standard-core/config/navigation";
|
|
5
|
+
var Button = function (_a) {
|
|
6
|
+
var _b = _a.type, type = _b === void 0 ? "button" : _b, href = _a.href, target = _a.target, children = _a.children, _c = _a.variant, variant = _c === void 0 ? "contained" : _c, _d = _a.color, color = _d === void 0 ? "primary" : _d, _e = _a.size, size = _e === void 0 ? "large" : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.onClick, onClick = _g === void 0 ? function (e) { } : _g, _h = _a.onMouseEnter, onMouseEnter = _h === void 0 ? function (e) { } : _h, _j = _a.component, component = _j === void 0 ? LocalizedLink : _j, _k = _a.endIcon, endIcon = _k === void 0 ? null : _k, _l = _a.startIcon, startIcon = _l === void 0 ? null : _l, sx = _a.sx;
|
|
7
|
+
return (_jsx(MuiButton, { type: type, href: href || undefined, component: href ? component : "button", target: target, variant: variant, color: color, size: size, disabled: disabled, onClick: onClick, onMouseEnter: onMouseEnter, sx: sx, endIcon: endIcon, startIcon: startIcon, children: children }));
|
|
8
|
+
};
|
|
9
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from "./Button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from "./Button";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SxProps } from "@mui/material/styles";
|
|
2
|
+
import type { Data } from "@strapi/strapi";
|
|
3
|
+
import type { ImageResizeOption } from "@the-story/standard-core/types";
|
|
4
|
+
type DifferentWidths = number | {
|
|
5
|
+
xs: number;
|
|
6
|
+
lg: number;
|
|
7
|
+
} | null;
|
|
8
|
+
interface CmsCroppedImageProps {
|
|
9
|
+
image?: Data.ContentType<"plugin::upload.file"> | null;
|
|
10
|
+
width?: DifferentWidths;
|
|
11
|
+
height?: DifferentWidths;
|
|
12
|
+
cover?: boolean;
|
|
13
|
+
resizingType?: ImageResizeOption;
|
|
14
|
+
sx?: SxProps;
|
|
15
|
+
loading?: "lazy" | "eager";
|
|
16
|
+
}
|
|
17
|
+
declare const CmsCroppedImage: ({ image, width, height, cover, resizingType, sx, loading, }: CmsCroppedImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export default CmsCroppedImage;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CroppedImage } from "@the-story/standard-core/atoms/CroppedImage";
|
|
3
|
+
import { cmsMediaUrl } from "@the-story/standard-core/utils/cmsMediaUrl";
|
|
4
|
+
var CmsCroppedImage = function (_a) {
|
|
5
|
+
var image = _a.image, width = _a.width, height = _a.height, _b = _a.cover, cover = _b === void 0 ? false : _b, _c = _a.resizingType, resizingType = _c === void 0 ? "fill" : _c, sx = _a.sx, loading = _a.loading;
|
|
6
|
+
if (!image)
|
|
7
|
+
return null;
|
|
8
|
+
var _d = image, url = _d.url, alternativeText = _d.alternativeText;
|
|
9
|
+
var safeUrl = typeof url === "string" ? url : null;
|
|
10
|
+
var safeAlt = typeof alternativeText === "string" ? alternativeText : undefined;
|
|
11
|
+
var setMobileWidth;
|
|
12
|
+
var setDesktopWidth;
|
|
13
|
+
var setDesktopHeight;
|
|
14
|
+
var setMobileHeight;
|
|
15
|
+
if (width) {
|
|
16
|
+
if (typeof width === "object") {
|
|
17
|
+
setMobileWidth = width.xs;
|
|
18
|
+
setDesktopWidth = width.lg;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
setMobileWidth = width;
|
|
22
|
+
setDesktopWidth = width;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (height) {
|
|
26
|
+
if (typeof height === "object") {
|
|
27
|
+
setMobileHeight = height.xs;
|
|
28
|
+
setDesktopHeight = height.lg;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
setMobileHeight = height || setMobileWidth;
|
|
32
|
+
setDesktopHeight = height || setDesktopWidth;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (setMobileWidth !== setDesktopWidth ||
|
|
36
|
+
setMobileHeight !== setDesktopHeight) {
|
|
37
|
+
return (_jsxs(_Fragment, { children: [_jsx(CroppedImage, { src: cmsMediaUrl(safeUrl), width: setMobileWidth, height: setMobileHeight, cover: cover, alt: safeAlt, resizingType: resizingType, sx: sx, loading: loading, mobileOnly: true }), _jsx(CroppedImage, { src: cmsMediaUrl(safeUrl), width: setDesktopWidth, height: setDesktopHeight, cover: cover, alt: safeAlt, resizingType: resizingType, sx: sx, loading: loading, desktopOnly: true })] }));
|
|
38
|
+
}
|
|
39
|
+
return (_jsx(CroppedImage, { src: cmsMediaUrl(safeUrl), width: setMobileWidth, height: setMobileHeight, cover: cover, alt: safeAlt, resizingType: resizingType, sx: sx, loading: loading }));
|
|
40
|
+
};
|
|
41
|
+
export default CmsCroppedImage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CmsCroppedImage } from "./CmsCroppedImage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CmsCroppedImage } from "./CmsCroppedImage";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Data } from "@strapi/strapi";
|
|
2
|
+
import type { APINumber, APIString } from "@the-story/standard-core/types";
|
|
3
|
+
import { type ImageProps } from "next/image";
|
|
4
|
+
type BaseUploadImageProps = {
|
|
5
|
+
url?: APIString;
|
|
6
|
+
alternativeText?: APIString;
|
|
7
|
+
width?: APINumber;
|
|
8
|
+
height?: APINumber;
|
|
9
|
+
fill?: boolean;
|
|
10
|
+
} & Omit<ImageProps, "src" | "alt" | "width" | "height" | "id">;
|
|
11
|
+
export declare const BaseUploadedImage: ({ url, alternativeText, width, height, fill, ...props }: BaseUploadImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
type UploadedImageProps = {
|
|
13
|
+
image: Data.ContentType<"plugin::upload.file"> | null;
|
|
14
|
+
fill?: boolean;
|
|
15
|
+
sizes?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const CmsImage: ({ image, fill, sizes }: UploadedImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export default CmsImage;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { cmsMediaUrl } from "@the-story/standard-core/utils/cmsMediaUrl";
|
|
25
|
+
import Image from "next/image";
|
|
26
|
+
export var BaseUploadedImage = function (_a) {
|
|
27
|
+
var url = _a.url, alternativeText = _a.alternativeText, width = _a.width, height = _a.height, _b = _a.fill, fill = _b === void 0 ? false : _b, props = __rest(_a, ["url", "alternativeText", "width", "height", "fill"]);
|
|
28
|
+
if (!url)
|
|
29
|
+
return null;
|
|
30
|
+
var baseProps = __assign({}, props);
|
|
31
|
+
if (!width || !height || fill) {
|
|
32
|
+
baseProps = {
|
|
33
|
+
src: cmsMediaUrl(url),
|
|
34
|
+
sizes: baseProps.sizes,
|
|
35
|
+
fill: fill,
|
|
36
|
+
style: {
|
|
37
|
+
objectFit: "cover",
|
|
38
|
+
objectPosition: "center",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
baseProps = {
|
|
44
|
+
src: cmsMediaUrl(url),
|
|
45
|
+
width: width,
|
|
46
|
+
height: height,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (!baseProps.src)
|
|
50
|
+
return null;
|
|
51
|
+
var src = baseProps.src, restProps = __rest(baseProps, ["src"]);
|
|
52
|
+
return _jsx(Image, __assign({ src: src }, restProps, { alt: alternativeText || "" }));
|
|
53
|
+
};
|
|
54
|
+
var CmsImage = function (_a) {
|
|
55
|
+
var image = _a.image, _b = _a.fill, fill = _b === void 0 ? false : _b, sizes = _a.sizes;
|
|
56
|
+
if (!image || !image.url) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return _jsx(BaseUploadedImage, __assign({ sizes: sizes }, image, { fill: fill }));
|
|
60
|
+
};
|
|
61
|
+
export default CmsImage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CmsImage } from "./CmsImage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CmsImage } from "./CmsImage";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type TypographyProps } from "@mui/material/Typography";
|
|
2
|
+
import { type BlocksContent } from "@strapi/blocks-react-renderer";
|
|
3
|
+
import type { APINullable } from "@the-story/standard-core/types";
|
|
4
|
+
type BlockElements = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "blockquote" | "list";
|
|
5
|
+
export interface CmsRichTextProps {
|
|
6
|
+
blocks: BlocksContent | APINullable;
|
|
7
|
+
globalDisableHeadings?: boolean;
|
|
8
|
+
exclude?: BlockElements[];
|
|
9
|
+
componentProps?: Partial<{
|
|
10
|
+
[key in BlockElements]: TypographyProps;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
declare const CmsRichText: ({ blocks, globalDisableHeadings, componentProps, exclude, }: CmsRichTextProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export default CmsRichText;
|