@xyo-network/react-shared 2.26.32 → 2.26.35
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 +2 -1
- package/dist/docs.json +10 -1
- package/package.json +5 -5
- package/babel.config.json +0 -5
- package/dist/cjs/components/CardEx.d.ts +0 -6
- package/dist/cjs/components/CardEx.js +0 -15
- package/dist/cjs/components/CardEx.js.map +0 -1
- package/dist/cjs/components/DarkModeIconButton.d.ts +0 -3
- package/dist/cjs/components/DarkModeIconButton.js +0 -18
- package/dist/cjs/components/DarkModeIconButton.js.map +0 -1
- package/dist/cjs/components/FullWidthCard/FullWidthCard.d.ts +0 -14
- package/dist/cjs/components/FullWidthCard/FullWidthCard.js +0 -32
- package/dist/cjs/components/FullWidthCard/FullWidthCard.js.map +0 -1
- package/dist/cjs/components/FullWidthCard/index.d.ts +0 -1
- package/dist/cjs/components/FullWidthCard/index.js +0 -5
- package/dist/cjs/components/FullWidthCard/index.js.map +0 -1
- package/dist/cjs/components/SimpleCard/SimpleCard.d.ts +0 -15
- package/dist/cjs/components/SimpleCard/SimpleCard.js +0 -33
- package/dist/cjs/components/SimpleCard/SimpleCard.js.map +0 -1
- package/dist/cjs/components/SimpleCard/index.d.ts +0 -1
- package/dist/cjs/components/SimpleCard/index.js +0 -5
- package/dist/cjs/components/SimpleCard/index.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/Context.d.ts +0 -8
- package/dist/cjs/contexts/AppSettings/Context.js +0 -7
- package/dist/cjs/contexts/AppSettings/Context.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/Provider.d.ts +0 -8
- package/dist/cjs/contexts/AppSettings/Provider.js +0 -27
- package/dist/cjs/contexts/AppSettings/Provider.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/Slug.d.ts +0 -4
- package/dist/cjs/contexts/AppSettings/Slug.js +0 -9
- package/dist/cjs/contexts/AppSettings/Slug.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/Storage.d.ts +0 -8
- package/dist/cjs/contexts/AppSettings/Storage.js +0 -25
- package/dist/cjs/contexts/AppSettings/Storage.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/StorageBase.d.ts +0 -15
- package/dist/cjs/contexts/AppSettings/StorageBase.js +0 -78
- package/dist/cjs/contexts/AppSettings/StorageBase.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/appSettingDefault.d.ts +0 -1
- package/dist/cjs/contexts/AppSettings/appSettingDefault.js +0 -12
- package/dist/cjs/contexts/AppSettings/appSettingDefault.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/index.d.ts +0 -6
- package/dist/cjs/contexts/AppSettings/index.js +0 -10
- package/dist/cjs/contexts/AppSettings/index.js.map +0 -1
- package/dist/cjs/contexts/AppSettings/useAppSettings.d.ts +0 -1
- package/dist/cjs/contexts/AppSettings/useAppSettings.js +0 -10
- package/dist/cjs/contexts/AppSettings/useAppSettings.js.map +0 -1
- package/dist/cjs/lib/ExplorerMapHashes.d.ts +0 -4
- package/dist/cjs/lib/ExplorerMapHashes.js +0 -20
- package/dist/cjs/lib/ExplorerMapHashes.js.map +0 -1
- package/dist/cjs/lib/archivistPresets.d.ts +0 -9
- package/dist/cjs/lib/archivistPresets.js +0 -44
- package/dist/cjs/lib/archivistPresets.js.map +0 -1
- package/dist/cjs/lib/divinerPresets.d.ts +0 -3
- package/dist/cjs/lib/divinerPresets.js +0 -38
- package/dist/cjs/lib/divinerPresets.js.map +0 -1
- package/dist/esm/components/CardEx.d.ts +0 -6
- package/dist/esm/components/CardEx.js +0 -12
- package/dist/esm/components/CardEx.js.map +0 -1
- package/dist/esm/components/DarkModeIconButton.d.ts +0 -3
- package/dist/esm/components/DarkModeIconButton.js +0 -13
- package/dist/esm/components/DarkModeIconButton.js.map +0 -1
- package/dist/esm/components/FullWidthCard/FullWidthCard.d.ts +0 -14
- package/dist/esm/components/FullWidthCard/FullWidthCard.js +0 -26
- package/dist/esm/components/FullWidthCard/FullWidthCard.js.map +0 -1
- package/dist/esm/components/FullWidthCard/index.d.ts +0 -1
- package/dist/esm/components/FullWidthCard/index.js +0 -2
- package/dist/esm/components/FullWidthCard/index.js.map +0 -1
- package/dist/esm/components/PageCard.d.ts +0 -9
- package/dist/esm/components/PageCard.js +0 -9
- package/dist/esm/components/PageCard.js.map +0 -1
- package/dist/esm/components/SimpleCard/SimpleCard.d.ts +0 -15
- package/dist/esm/components/SimpleCard/SimpleCard.js +0 -27
- package/dist/esm/components/SimpleCard/SimpleCard.js.map +0 -1
- package/dist/esm/components/SimpleCard/index.d.ts +0 -1
- package/dist/esm/components/SimpleCard/index.js +0 -2
- package/dist/esm/components/SimpleCard/index.js.map +0 -1
- package/dist/esm/contexts/AppSettings/Context.d.ts +0 -8
- package/dist/esm/contexts/AppSettings/Context.js +0 -4
- package/dist/esm/contexts/AppSettings/Context.js.map +0 -1
- package/dist/esm/contexts/AppSettings/Provider.d.ts +0 -8
- package/dist/esm/contexts/AppSettings/Provider.js +0 -24
- package/dist/esm/contexts/AppSettings/Provider.js.map +0 -1
- package/dist/esm/contexts/AppSettings/Slug.d.ts +0 -4
- package/dist/esm/contexts/AppSettings/Slug.js +0 -6
- package/dist/esm/contexts/AppSettings/Slug.js.map +0 -1
- package/dist/esm/contexts/AppSettings/Storage.d.ts +0 -8
- package/dist/esm/contexts/AppSettings/Storage.js +0 -21
- package/dist/esm/contexts/AppSettings/Storage.js.map +0 -1
- package/dist/esm/contexts/AppSettings/StorageBase.d.ts +0 -15
- package/dist/esm/contexts/AppSettings/StorageBase.js +0 -73
- package/dist/esm/contexts/AppSettings/StorageBase.js.map +0 -1
- package/dist/esm/contexts/AppSettings/appSettingDefault.d.ts +0 -1
- package/dist/esm/contexts/AppSettings/appSettingDefault.js +0 -8
- package/dist/esm/contexts/AppSettings/appSettingDefault.js.map +0 -1
- package/dist/esm/contexts/AppSettings/index.d.ts +0 -6
- package/dist/esm/contexts/AppSettings/index.js +0 -7
- package/dist/esm/contexts/AppSettings/index.js.map +0 -1
- package/dist/esm/contexts/AppSettings/useAppSettings.d.ts +0 -1
- package/dist/esm/contexts/AppSettings/useAppSettings.js +0 -6
- package/dist/esm/contexts/AppSettings/useAppSettings.js.map +0 -1
- package/dist/esm/lib/ExplorerMapHashes.d.ts +0 -4
- package/dist/esm/lib/ExplorerMapHashes.js +0 -17
- package/dist/esm/lib/ExplorerMapHashes.js.map +0 -1
- package/dist/esm/lib/archivistPresets.d.ts +0 -9
- package/dist/esm/lib/archivistPresets.js +0 -39
- package/dist/esm/lib/archivistPresets.js.map +0 -1
- package/dist/esm/lib/divinerPresets.d.ts +0 -3
- package/dist/esm/lib/divinerPresets.js +0 -33
- package/dist/esm/lib/divinerPresets.js.map +0 -1
- package/src/SizeProp.ts +0 -1
- package/src/components/Ampersand.tsx +0 -9
- package/src/components/BasicHero/BasicHero.stories.tsx +0 -58
- package/src/components/BasicHero/BasicHero.tsx +0 -162
- package/src/components/BasicHero/default-desktop.svg +0 -1
- package/src/components/BasicHero/index.ts +0 -1
- package/src/components/ErrorBoundry.tsx +0 -42
- package/src/components/JsonRouteWrapper/JsonApiButton.tsx +0 -19
- package/src/components/JsonRouteWrapper/JsonFromUrl.stories.tsx +0 -48
- package/src/components/JsonRouteWrapper/JsonFromUrl.tsx +0 -52
- package/src/components/JsonRouteWrapper/JsonRouteWrapper.stories.tsx +0 -68
- package/src/components/JsonRouteWrapper/JsonRouteWrapper.tsx +0 -78
- package/src/components/JsonRouteWrapper/index.ts +0 -3
- package/src/components/ListItemButtonEx.tsx +0 -29
- package/src/components/Pipe.tsx +0 -9
- package/src/components/ScrollTableOnSm.tsx +0 -14
- package/src/components/SectionSpacingRow/SectionSpacingRow.stories.tsx +0 -36
- package/src/components/SectionSpacingRow/SectionSpacingRow.tsx +0 -19
- package/src/components/SectionSpacingRow/index.ts +0 -1
- package/src/components/StyleGuide/AppBars.example.tsx +0 -26
- package/src/components/StyleGuide/Buttons.example.tsx +0 -41
- package/src/components/StyleGuide/Papers.example.tsx +0 -19
- package/src/components/StyleGuide/StyleGuide.example.tsx +0 -19
- package/src/components/StyleGuide/StyleGuide.stories.tsx +0 -25
- package/src/components/StyleGuide/Texts.example.tsx +0 -16
- package/src/components/StyleGuide/VariantContext.example.tsx +0 -3
- package/src/components/TableCell/AddressTableCell.tsx +0 -13
- package/src/components/TableCell/EllipsisTableCell.tsx +0 -100
- package/src/components/TableCell/HashTableCell.tsx +0 -13
- package/src/components/TableCell/findParent.ts +0 -10
- package/src/components/TableCell/getRemainingRowWidth.ts +0 -14
- package/src/components/TableCell/getSmallestParentWidth.ts +0 -13
- package/src/components/TableCell/index.ts +0 -3
- package/src/components/TypographyEx.tsx +0 -12
- package/src/components/index.ts +0 -10
- package/src/contexts/Pixel/Context.ts +0 -4
- package/src/contexts/Pixel/Provider.tsx +0 -24
- package/src/contexts/Pixel/State.ts +0 -7
- package/src/contexts/Pixel/index.ts +0 -4
- package/src/contexts/Pixel/use.ts +0 -7
- package/src/contexts/contextEx/State.ts +0 -3
- package/src/contexts/contextEx/create.ts +0 -5
- package/src/contexts/contextEx/index.ts +0 -3
- package/src/contexts/contextEx/use.ts +0 -11
- package/src/contexts/index.ts +0 -2
- package/src/hooks/GradientStyles/GradientStyle.stories.tsx +0 -68
- package/src/hooks/GradientStyles/GradientStyles.tsx +0 -60
- package/src/hooks/GradientStyles/index.ts +0 -1
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useIsMobile.ts +0 -8
- package/src/hooks/useMediaQuery.ts +0 -7
- package/src/index.ts +0 -5
- package/src/lib/assertDefinedEx.ts +0 -4
- package/src/lib/getActualPaddingX.ts +0 -61
- package/src/lib/index.ts +0 -3
- package/src/lib/networkComponents.tsx +0 -29
- package/src/types/images.d.ts +0 -5
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { XyoNetworkNodePayload } from '@xyo-network/network';
|
|
2
|
-
export interface XyoArchivistPreset extends XyoNetworkNodePayload {
|
|
3
|
-
explorerMapHashes?: {
|
|
4
|
-
staticAnswerHash: string;
|
|
5
|
-
animatedAnswerHashes: string[];
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export declare const findArchivistPreset: (slug: string) => XyoArchivistPreset;
|
|
9
|
-
export declare const archivistPresets: XyoArchivistPreset[];
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { XyoNetworkNodePayloadSchema } from '@xyo-network/network';
|
|
2
|
-
import { ExplorerMapHashes } from './ExplorerMapHashes';
|
|
3
|
-
export const findArchivistPreset = (slug) => {
|
|
4
|
-
return (archivistPresets.find((item) => {
|
|
5
|
-
return item.slug === slug;
|
|
6
|
-
}) ?? archivistPresets[0]);
|
|
7
|
-
};
|
|
8
|
-
export const archivistPresets = [
|
|
9
|
-
{
|
|
10
|
-
docs: 'https://beta.archivist.xyo.network/api',
|
|
11
|
-
explorerMapHashes: ExplorerMapHashes,
|
|
12
|
-
name: 'XYO Shared Archivist (kerplunk)',
|
|
13
|
-
schema: XyoNetworkNodePayloadSchema,
|
|
14
|
-
slug: 'kerplunk-archivist-xyo-network',
|
|
15
|
-
type: 'archivist',
|
|
16
|
-
uri: 'https://beta.api.archivist.xyo.network',
|
|
17
|
-
web: 'https://beta.archivist.xyo.network',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
docs: 'https://archivist.xyo.network/api',
|
|
21
|
-
explorerMapHashes: ExplorerMapHashes,
|
|
22
|
-
name: 'XYO Shared Archivist (main)',
|
|
23
|
-
schema: XyoNetworkNodePayloadSchema,
|
|
24
|
-
slug: 'main-archivist-xyo-network',
|
|
25
|
-
type: 'archivist',
|
|
26
|
-
uri: 'https://api.archivist.xyo.network',
|
|
27
|
-
web: 'https://archivist.xyo.network',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
docs: 'http://localhost:8080/api',
|
|
31
|
-
name: 'XYO Shared Archivist (local)',
|
|
32
|
-
schema: XyoNetworkNodePayloadSchema,
|
|
33
|
-
slug: 'local-archivist-xyo-network',
|
|
34
|
-
type: 'archivist',
|
|
35
|
-
uri: 'http://localhost:8080',
|
|
36
|
-
web: 'http://localhost:8081',
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
//# sourceMappingURL=archivistPresets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"archivistPresets.js","sourceRoot":"","sources":["../../../src/lib/archivistPresets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAEzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AASvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAClD,OAAO,CACL,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7B,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAA;IAC3B,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAC1B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAyB;IACpD;QACE,IAAI,EAAE,wCAAwC;QAC9C,iBAAiB,EAAE,iBAAiB;QACpC,IAAI,EAAE,iCAAiC;QACvC,MAAM,EAAE,2BAA2B;QACnC,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,wCAAwC;QAC7C,GAAG,EAAE,oCAAoC;KAC1C;IACD;QACE,IAAI,EAAE,mCAAmC;QACzC,iBAAiB,EAAE,iBAAiB;QACpC,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE,2BAA2B;QACnC,IAAI,EAAE,4BAA4B;QAClC,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,mCAAmC;QACxC,GAAG,EAAE,+BAA+B;KACrC;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,IAAI,EAAE,8BAA8B;QACpC,MAAM,EAAE,2BAA2B;QACnC,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,uBAAuB;QAC5B,GAAG,EAAE,uBAAuB;KAC7B;CACF,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { XyoNetworkNodePayloadSchema } from '@xyo-network/network';
|
|
2
|
-
export const findDivinerPreset = (slug) => {
|
|
3
|
-
return (divinerPresets.find((item) => {
|
|
4
|
-
return item.slug === slug;
|
|
5
|
-
}) ?? divinerPresets[0]);
|
|
6
|
-
};
|
|
7
|
-
export const divinerPresets = [
|
|
8
|
-
{
|
|
9
|
-
name: 'XYO Location (beta)',
|
|
10
|
-
schema: XyoNetworkNodePayloadSchema,
|
|
11
|
-
slug: 'beta-location-diviner-xyo-network',
|
|
12
|
-
type: 'diviner',
|
|
13
|
-
uri: 'https://beta.api.location.diviner.xyo.network',
|
|
14
|
-
web: 'https://beta.explore.xyo.network',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: 'XYO Location',
|
|
18
|
-
schema: XyoNetworkNodePayloadSchema,
|
|
19
|
-
slug: 'location-diviner-xyo-network',
|
|
20
|
-
type: 'diviner',
|
|
21
|
-
uri: 'https://api.location.diviner.xyo.network',
|
|
22
|
-
web: 'https://explore.xyo.network',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'XYO Location (local)',
|
|
26
|
-
schema: XyoNetworkNodePayloadSchema,
|
|
27
|
-
slug: 'local-location-diviner-xyo-network',
|
|
28
|
-
type: 'diviner',
|
|
29
|
-
uri: 'http://localhost:8082',
|
|
30
|
-
web: 'http://localhost:3000',
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
//# sourceMappingURL=divinerPresets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"divinerPresets.js","sourceRoot":"","sources":["../../../src/lib/divinerPresets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAEzF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;IAChD,OAAO,CACL,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAA;IAC3B,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CACxB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD;QACE,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,2BAA2B;QACnC,IAAI,EAAE,mCAAmC;QACzC,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,+CAA+C;QACpD,GAAG,EAAE,kCAAkC;KACxC;IACD;QACE,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,2BAA2B;QACnC,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,0CAA0C;QAC/C,GAAG,EAAE,6BAA6B;KACnC;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,2BAA2B;QACnC,IAAI,EAAE,oCAAoC;QAC1C,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,uBAAuB;QAC5B,GAAG,EAAE,uBAAuB;KAC7B;CACF,CAAA"}
|
package/src/SizeProp.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type SizeProp = 'small' | 'medium' | 'large'
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
-
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
-
|
|
4
|
-
import { BasicHero } from './BasicHero'
|
|
5
|
-
import BackgroundImage from './default-desktop.svg'
|
|
6
|
-
const StorybookEntry = {
|
|
7
|
-
argTypes: {},
|
|
8
|
-
component: BasicHero,
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
page: null,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
title: 'shared/BasicHero',
|
|
15
|
-
} as ComponentMeta<typeof BasicHero>
|
|
16
|
-
|
|
17
|
-
const Template: ComponentStory<typeof BasicHero> = (args) => (
|
|
18
|
-
<BrowserRouter>
|
|
19
|
-
<BasicHero {...args}></BasicHero>
|
|
20
|
-
</BrowserRouter>
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
const Default = Template.bind({})
|
|
24
|
-
Default.args = {
|
|
25
|
-
button1Text: 'Button 1',
|
|
26
|
-
button1To: '',
|
|
27
|
-
button2Text: 'Button 2',
|
|
28
|
-
button2To: '',
|
|
29
|
-
desc: ' Ipsam illo molestiae nisi perferendis a error, eum repellendus voluptatibus, provident, voluptatum qui laborum assumenda minus!',
|
|
30
|
-
gradientTitle: 'dolor',
|
|
31
|
-
subLinkPath: 'https://medium.com/xyonetwork/xyo-2-0-has-arrived-fe160f8b2928',
|
|
32
|
-
subLinkText1: 'We just announced XYO 2.0',
|
|
33
|
-
subLinkText2: 'Read more here.',
|
|
34
|
-
title: 'Lorem ipsum',
|
|
35
|
-
}
|
|
36
|
-
const WithBackgroundImage = Template.bind({})
|
|
37
|
-
WithBackgroundImage.args = {
|
|
38
|
-
backgroundImage: BackgroundImage,
|
|
39
|
-
button1Text: 'Button 1',
|
|
40
|
-
button1To: '',
|
|
41
|
-
button2Text: 'Button 2',
|
|
42
|
-
button2To: '',
|
|
43
|
-
desc: ' Ipsam illo molestiae nisi perferendis a error, eum repellendus voluptatibus, provident, voluptatum qui laborum assumenda minus!',
|
|
44
|
-
gradientTitle: 'dolor',
|
|
45
|
-
subLinkPath: 'https://medium.com/xyonetwork/xyo-2-0-has-arrived-fe160f8b2928',
|
|
46
|
-
subLinkText1: 'We just announced XYO 2.0',
|
|
47
|
-
subLinkText2: 'Read more here.',
|
|
48
|
-
title: 'Lorem ipsum',
|
|
49
|
-
title2: 'adipisicing elit.',
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
53
|
-
//@ts-ignore
|
|
54
|
-
|
|
55
|
-
export { Default, WithBackgroundImage }
|
|
56
|
-
|
|
57
|
-
// eslint-disable-next-line import/no-default-export
|
|
58
|
-
export default StorybookEntry
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { Container, Grid, Typography } from '@mui/material'
|
|
2
|
-
import { ButtonEx } from '@xylabs/react-button'
|
|
3
|
-
import { FlexBoxProps, FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox'
|
|
4
|
-
import { LinkEx } from '@xylabs/react-link'
|
|
5
|
-
import { ReactElement } from 'react'
|
|
6
|
-
|
|
7
|
-
import { useGradientStyles, useIsMobile } from '../../hooks'
|
|
8
|
-
|
|
9
|
-
export interface BasicHeroProps extends FlexBoxProps {
|
|
10
|
-
title: string
|
|
11
|
-
gradientTitle?: string
|
|
12
|
-
title2?: string
|
|
13
|
-
desc: string
|
|
14
|
-
button1Text?: string
|
|
15
|
-
button2Text?: string
|
|
16
|
-
button1To?: string
|
|
17
|
-
button2To?: string
|
|
18
|
-
button1Href?: string
|
|
19
|
-
button2Href?: string
|
|
20
|
-
subLinkText1?: string
|
|
21
|
-
subLinkText2?: string
|
|
22
|
-
heroImage?: string
|
|
23
|
-
subLinkPath?: string
|
|
24
|
-
subLinkIcon?: ReactElement
|
|
25
|
-
backgroundColor?: string
|
|
26
|
-
textColor?: string
|
|
27
|
-
backgroundImage?: string
|
|
28
|
-
sx?: Record<string, string>
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface SubLinkSectionProps {
|
|
32
|
-
subLinkText1?: string
|
|
33
|
-
subLinkText2?: string
|
|
34
|
-
subLinkPath?: string
|
|
35
|
-
subLinkIcon?: ReactElement
|
|
36
|
-
backgroundImageAlignment?: boolean
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface ButtonSectionProps {
|
|
40
|
-
href?: string
|
|
41
|
-
to?: string
|
|
42
|
-
buttonText?: string
|
|
43
|
-
}
|
|
44
|
-
const SubLinkSection: React.FC<SubLinkSectionProps> = ({ subLinkText1, subLinkText2, subLinkPath, subLinkIcon, backgroundImageAlignment }) => {
|
|
45
|
-
return (
|
|
46
|
-
<FlexGrowRow width="100%" sx={{ flexDirection: { md: 'row', xs: 'column' }, justifyContent: { md: backgroundImageAlignment ? 'flex-start' : 'center', xs: 'center' } }}>
|
|
47
|
-
{subLinkIcon ? <span>{subLinkIcon} </span> : null}
|
|
48
|
-
<Typography>{subLinkText1} </Typography>
|
|
49
|
-
<LinkEx href={subLinkPath} underline="always" target="_blank" color="inherit">
|
|
50
|
-
<Typography>{subLinkText2}</Typography>
|
|
51
|
-
</LinkEx>
|
|
52
|
-
</FlexGrowRow>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const ButtonSection: React.FC<ButtonSectionProps> = ({ href, to, buttonText }) => {
|
|
57
|
-
const isMobile = useIsMobile()
|
|
58
|
-
return (
|
|
59
|
-
<ButtonEx
|
|
60
|
-
fullWidth={true}
|
|
61
|
-
marginTop={1}
|
|
62
|
-
marginBottom={1}
|
|
63
|
-
marginRight={isMobile ? 2 : 1}
|
|
64
|
-
marginLeft={isMobile ? 2 : 0}
|
|
65
|
-
target={href ?? '_blank'}
|
|
66
|
-
to={to}
|
|
67
|
-
href={href}
|
|
68
|
-
color="primary"
|
|
69
|
-
variant="contained"
|
|
70
|
-
paddingX={3}
|
|
71
|
-
sx={{ display: href || to ? 'flex' : 'none' }}
|
|
72
|
-
>
|
|
73
|
-
{buttonText}
|
|
74
|
-
</ButtonEx>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const BasicHero: React.FC<BasicHeroProps> = ({
|
|
79
|
-
backgroundImage,
|
|
80
|
-
title,
|
|
81
|
-
gradientTitle,
|
|
82
|
-
backgroundColor,
|
|
83
|
-
textColor,
|
|
84
|
-
desc,
|
|
85
|
-
heroImage,
|
|
86
|
-
title2,
|
|
87
|
-
subLinkText1,
|
|
88
|
-
subLinkText2,
|
|
89
|
-
subLinkPath,
|
|
90
|
-
button1Text,
|
|
91
|
-
button2Text,
|
|
92
|
-
button2To,
|
|
93
|
-
button1To,
|
|
94
|
-
button2Href,
|
|
95
|
-
button1Href,
|
|
96
|
-
subLinkIcon,
|
|
97
|
-
sx,
|
|
98
|
-
...props
|
|
99
|
-
}) => {
|
|
100
|
-
const isMobile = useIsMobile()
|
|
101
|
-
const { classes } = useGradientStyles()
|
|
102
|
-
return (
|
|
103
|
-
<FlexGrowCol
|
|
104
|
-
sx={{
|
|
105
|
-
backgroundImage: `url(${backgroundImage})`,
|
|
106
|
-
backgroundPosition: { lg: 'bottom', md: 'center left', xs: 'top left' },
|
|
107
|
-
minHeight: {
|
|
108
|
-
md: '500px',
|
|
109
|
-
sm: '400px',
|
|
110
|
-
xs: '200px',
|
|
111
|
-
},
|
|
112
|
-
...(sx ?? {}),
|
|
113
|
-
}}
|
|
114
|
-
style={{
|
|
115
|
-
backgroundColor: backgroundColor ?? '',
|
|
116
|
-
backgroundRepeat: 'no-repeat',
|
|
117
|
-
backgroundSize: 'cover',
|
|
118
|
-
color: textColor ?? '',
|
|
119
|
-
}}
|
|
120
|
-
{...props}
|
|
121
|
-
>
|
|
122
|
-
<Container>
|
|
123
|
-
<Grid
|
|
124
|
-
container
|
|
125
|
-
justifyContent="center"
|
|
126
|
-
alignItems="center"
|
|
127
|
-
sx={{
|
|
128
|
-
alignItems: { xs: 'center' },
|
|
129
|
-
justifyContent: { xs: 'center' },
|
|
130
|
-
}}
|
|
131
|
-
>
|
|
132
|
-
<Grid item xs={12} sm={8} md={backgroundImage ? 6 : 8} lg={backgroundImage ? 6 : 8}>
|
|
133
|
-
<FlexGrowCol paddingY={2} sx={{ alignItems: { xs: backgroundImage && !isMobile ? 'flex-start' : 'center' } }}>
|
|
134
|
-
<Typography variant="h1" component="h1" gutterBottom textAlign={backgroundImage && !isMobile ? 'left' : 'center'}>
|
|
135
|
-
{title ? <span>{`${title} `}</span> : null}
|
|
136
|
-
{gradientTitle ? <span className={classes().heading}> {` ${gradientTitle}`}</span> : null}
|
|
137
|
-
{title2 ? <span>{` ${title2}`}</span> : null}
|
|
138
|
-
</Typography>
|
|
139
|
-
<Typography variant="body1" component="h2" gutterBottom textAlign={backgroundImage && !isMobile ? 'left' : 'center'}>
|
|
140
|
-
{desc}
|
|
141
|
-
</Typography>
|
|
142
|
-
<FlexGrowRow sx={{ flexDirection: { lg: 'row', xs: 'column' } }} width="100%" marginTop={1}>
|
|
143
|
-
<ButtonSection href={button1Href} to={button1To} buttonText={button1Text} />
|
|
144
|
-
<ButtonSection href={button2Href} to={button2To} buttonText={button2Text} />
|
|
145
|
-
</FlexGrowRow>
|
|
146
|
-
<SubLinkSection
|
|
147
|
-
subLinkIcon={subLinkIcon}
|
|
148
|
-
subLinkText1={subLinkText1}
|
|
149
|
-
subLinkText2={subLinkText2}
|
|
150
|
-
subLinkPath={subLinkPath}
|
|
151
|
-
backgroundImageAlignment={backgroundImage ? true : false}
|
|
152
|
-
/>
|
|
153
|
-
</FlexGrowCol>
|
|
154
|
-
</Grid>
|
|
155
|
-
<Grid item xs={12} md={6}>
|
|
156
|
-
{heroImage ? <img src={heroImage} width="100%" /> : null}
|
|
157
|
-
</Grid>
|
|
158
|
-
</Grid>
|
|
159
|
-
</Container>
|
|
160
|
-
</FlexGrowCol>
|
|
161
|
-
)
|
|
162
|
-
}
|