@linktr.ee/create-link-app 0.3.0-next.12 → 0.3.0-next.14

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.
@@ -12,7 +12,28 @@
12
12
  --lt-stack-container-radius: 1rem;
13
13
  --lt-stack-thumbnail-radius: 0.65rem;
14
14
 
15
+ --lt-font-family: "Inter";
16
+
15
17
  /* Theme */
16
- --lt-button-color: #d1c4f7;
17
- --lt-primary-color: #070217;
18
+ --lt-color-primary: #d1c4f7;
19
+ --lt-color-secondary: #d1c4f7;
20
+ --lt-color-on-primary: #070217;
21
+ --lt-color-on-secondary: #070217;
22
+
23
+ --lt-color-15: rgb(14, 9, 23);
24
+ --lt-color-14: rgb(27, 17, 47);
25
+ --lt-color-13: rgb(41, 26, 70);
26
+ --lt-color-12: rgb(55, 34, 93);
27
+ --lt-color-11: rgb(69, 43, 117);
28
+ --lt-color-10: rgb(82, 51, 140);
29
+ --lt-color-9: rgb(96, 60, 163);
30
+ --lt-color-8: rgb(110, 68, 187);
31
+ --lt-color-7: rgb(128, 92, 195);
32
+ --lt-color-6: rgb(146, 115, 204);
33
+ --lt-color-5: rgb(164, 138, 212);
34
+ --lt-color-4: rgb(182, 162, 221);
35
+ --lt-color-3: rgb(201, 185, 229);
36
+ --lt-color-2: rgb(219, 208, 238);
37
+ --lt-color-1: rgb(237, 232, 246);
38
+ --lt-color-0: rgb(240, 236, 248);
18
39
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0-next.12",
2
+ "version": "0.3.0-next.14",
3
3
  "commands": {
4
4
  "build": {
5
5
  "id": "build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/create-link-app",
3
- "version": "0.3.0-next.12",
3
+ "version": "0.3.0-next.14",
4
4
  "description": "Create a Link App on Linktr.ee.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Linktree",
@@ -0,0 +1,57 @@
1
+ import { SettingsData } from '../types'
2
+
3
+ const baseStyle = {
4
+ backgroundColor: 'var(--lt-color-primary)',
5
+ color: 'var(--lt-color-on-primary)',
6
+ } as React.CSSProperties
7
+
8
+ const Featured = (props: SettingsData) => {
9
+ return (
10
+ <div
11
+ className="px-6 pt-12 pb-11 h-full"
12
+ style={{
13
+ ...baseStyle,
14
+ borderRadius: 'var(--lt-feature-container-radius)',
15
+ }}
16
+ >
17
+ Featured
18
+ </div>
19
+ )
20
+ }
21
+
22
+ const Carousel = (props: SettingsData) => {
23
+ return (
24
+ <div
25
+ className="px-4 pt-16 pb-10 h-full"
26
+ style={{
27
+ ...baseStyle,
28
+ borderRadius: 'var(--lt-carousel-container-radius)',
29
+ }}
30
+ >
31
+ Carousel
32
+ </div>
33
+ )
34
+ }
35
+
36
+ const Grid = (props: SettingsData) => {
37
+ return (
38
+ <div className="px-3 py-10 h-full" style={{ ...baseStyle, borderRadius: 'var(--lt-grid-container-radius)' }}>
39
+ Grid
40
+ </div>
41
+ )
42
+ }
43
+
44
+ const Stack = (props: SettingsData) => {
45
+ return (
46
+ <div className="flex p-2 h-full gap-2 w-full" style={{ ...baseStyle, borderRadius: 'var(--lt-stack-container-radius)' }}>
47
+ <div className="w-16 aspect-square"></div>
48
+ <h2 className="mr-16">Stack</h2>
49
+ </div>
50
+ )
51
+ }
52
+
53
+ const SheetBody = () => {
54
+ return <div>sheet body</div>
55
+ }
56
+
57
+ export { Featured, Carousel, Grid, Stack, SheetBody }
@@ -1,10 +1,23 @@
1
- import P from '@linktr.ee/component-library/P'
2
- import { SettingsData } from './types'
1
+ import { Featured, Carousel, Grid, Stack, SheetBody } from './components/Layouts'
2
+ import { SettingsData, Layout } from './types'
3
3
 
4
- import './tailwind.css'
4
+ function App(props: SettingsData) {
5
+ const { layout } = props
5
6
 
6
- function App({ title }: SettingsData) {
7
- return <P>{title}</P>
7
+ switch (layout) {
8
+ case Layout.stack:
9
+ return <Stack {...props} />
10
+ case Layout.grid:
11
+ return <Grid {...props} />
12
+ case Layout.carousel:
13
+ return <Carousel {...props} />
14
+ case Layout.featured:
15
+ return <Featured {...props} />
16
+ case Layout.sheetBody:
17
+ return <SheetBody />
18
+ default:
19
+ return <div>Unknown layout: {props.layout}</div>
20
+ }
8
21
  }
9
22
 
10
23
  export default App
@@ -1,9 +1,14 @@
1
1
  import React from 'react'
2
2
  import { ComponentStory, ComponentMeta } from '@storybook/react'
3
3
  import { name } from '../../manifest.json'
4
+ import fixture from '../../common/fixtures/props-data.json'
5
+
6
+ import { Layout } from '../types'
4
7
 
5
8
  import LinkApp from '..'
6
9
 
10
+ import '../tailwind.css'
11
+
7
12
  export default {
8
13
  title: `Link App/${name}`,
9
14
  component: LinkApp,
@@ -11,28 +16,84 @@ export default {
11
16
  parameters: {
12
17
  layout: 'fullscreen',
13
18
  },
19
+ args: {
20
+ ...fixture,
21
+ editing: false,
22
+ },
23
+ argTypes: {
24
+ layout: {
25
+ table: {
26
+ disable: true,
27
+ },
28
+ },
29
+ },
14
30
  } as ComponentMeta<typeof LinkApp>
15
31
 
16
- export const Stack: ComponentStory<typeof LinkApp> = () => (
17
- <div className="bg-marble rounded-lg p-2 m-2 w-[375px]">
18
- <LinkApp layout="STACK" editing={false} title="Test Stack" />
32
+ export const Stack: ComponentStory<typeof LinkApp> = (args) => (
33
+ <div
34
+ className="m-2"
35
+ style={{
36
+ width: 374,
37
+ height: 80,
38
+ }}
39
+ >
40
+ <LinkApp {...args} />
41
+ </div>
42
+ )
43
+ Stack.args = {
44
+ layout: Layout.stack,
45
+ }
46
+
47
+ export const Grid: ComponentStory<typeof LinkApp> = (args) => (
48
+ <div
49
+ className="m-2"
50
+ style={{
51
+ width: 183,
52
+ height: 240,
53
+ }}
54
+ >
55
+ <LinkApp {...args} />
19
56
  </div>
20
57
  )
58
+ Grid.args = {
59
+ layout: Layout.grid,
60
+ }
21
61
 
22
- export const Grid: ComponentStory<typeof LinkApp> = () => (
23
- <div className="bg-marble rounded-lg p-2 m-2 w-[150px]">
24
- <LinkApp layout="GRID" editing={false} title="Test Grid" />
62
+ export const Carousel: ComponentStory<typeof LinkApp> = (args) => (
63
+ <div
64
+ className="m-2"
65
+ style={{
66
+ width: 224,
67
+ height: 296,
68
+ }}
69
+ >
70
+ <LinkApp {...args} />
25
71
  </div>
26
72
  )
73
+ Carousel.args = {
74
+ layout: Layout.carousel,
75
+ }
27
76
 
28
- export const Carousel: ComponentStory<typeof LinkApp> = () => (
29
- <div className="bg-marble rounded-lg p-2 m-2 w-[225px]">
30
- <LinkApp layout="CAROUSEL" editing={false} title="Test Carousel" />
77
+ export const Featured: ComponentStory<typeof LinkApp> = (args) => (
78
+ <div
79
+ className="m-2"
80
+ style={{
81
+ width: 374,
82
+ height: 374,
83
+ }}
84
+ >
85
+ <LinkApp {...args} />
31
86
  </div>
32
87
  )
88
+ Featured.args = {
89
+ layout: Layout.featured,
90
+ }
33
91
 
34
- export const Featured: ComponentStory<typeof LinkApp> = () => (
35
- <div className="bg-marble rounded-lg p-2 m-2 w-[384px]">
36
- <LinkApp layout="FEATURED" editing={false} title="Test Featured" />
92
+ export const SheetBody: ComponentStory<typeof LinkApp> = (args) => (
93
+ <div className="m-2">
94
+ <LinkApp {...args} />
37
95
  </div>
38
96
  )
97
+ SheetBody.args = {
98
+ layout: Layout.sheetBody,
99
+ }
@@ -1,4 +1,8 @@
1
- // @HACK: This file is removed at build time, but we need it for type checking
1
+ // @HACK: These files are removed at build time, but we need it for type checking
2
2
  declare module '*manifest.json' {
3
3
  export const name: string
4
4
  }
5
+
6
+ declare module '*props-data.json' {
7
+ export const name: string
8
+ }
@@ -1,8 +1,23 @@
1
1
  type LinktreeLinkContext = {
2
- layout: 'STACK' | 'CAROUSEL' | 'FEATURED' | 'GRID'
3
- editing: boolean
4
- }
2
+ layout: Layout;
3
+ editing: boolean;
4
+ borderRadius: BorderRadius;
5
+ };
5
6
 
6
7
  export type SettingsData = {
7
- title: string
8
- } & LinktreeLinkContext
8
+ title: string;
9
+ } & LinktreeLinkContext;
10
+
11
+ export enum Layout {
12
+ featured = "FEATURED",
13
+ carousel = "CAROUSEL",
14
+ grid = "GRID",
15
+ stack = "STACK",
16
+ sheetBody = "SHEET_BODY",
17
+ }
18
+
19
+ export enum BorderRadius {
20
+ Full = "FULL",
21
+ Medium = "MEDIUM",
22
+ None = "NONE",
23
+ }