@monimesl/dot-cli 0.1.0-alpha.16 → 0.1.0-alpha.19
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/cli.js +16 -9
- package/dist/cli.js.map +1 -1
- package/dist/templates/showcase/dot.ts +32 -17
- package/dist/templates/showcase/pages/basics/bars/controller.ts +36 -0
- package/dist/templates/showcase/pages/basics/bars/state.ts +6 -0
- package/dist/templates/showcase/pages/basics/bars/view.dml +28 -0
- package/dist/templates/showcase/pages/{text → basics/bindings}/controller.ts +5 -0
- package/dist/templates/showcase/pages/basics/bindings/state.ts +14 -0
- package/dist/templates/showcase/pages/basics/bindings/view.dml +41 -0
- package/dist/templates/showcase/pages/basics/control-flow/controller.ts +18 -0
- package/dist/templates/showcase/pages/basics/control-flow/state.ts +16 -0
- package/dist/templates/showcase/pages/basics/control-flow/view.dml +55 -0
- package/dist/templates/showcase/pages/basics/events/controller.ts +43 -0
- package/dist/templates/showcase/pages/basics/events/state.ts +11 -0
- package/dist/templates/showcase/pages/basics/events/view.dml +51 -0
- package/dist/templates/showcase/pages/basics/hooks/controller.ts +37 -0
- package/dist/templates/showcase/pages/basics/hooks/state.ts +10 -0
- package/dist/templates/showcase/pages/basics/hooks/view.dml +32 -0
- package/dist/templates/showcase/pages/basics/navigation/controller.ts +34 -0
- package/dist/templates/showcase/pages/basics/navigation/state.ts +9 -0
- package/dist/templates/showcase/pages/basics/navigation/view.dml +37 -0
- package/dist/templates/showcase/pages/{state → basics/state}/controller.ts +1 -0
- package/dist/templates/showcase/pages/basics/state/view.dml +46 -0
- package/dist/templates/showcase/pages/{carousel → components/carousel}/controller.ts +1 -0
- package/dist/templates/showcase/pages/{carousel → components/carousel}/view.dml +7 -5
- package/dist/templates/showcase/pages/{feedback → components/feedback}/controller.ts +1 -0
- package/dist/templates/showcase/pages/{feedback → components/feedback}/view.dml +18 -9
- package/dist/templates/showcase/pages/{forms → components/forms}/controller.ts +5 -1
- package/dist/templates/showcase/pages/{forms → components/forms}/state.ts +3 -0
- package/dist/templates/showcase/pages/components/forms/view.dml +90 -0
- package/dist/templates/showcase/pages/components/icons/controller.ts +15 -0
- package/dist/templates/showcase/pages/components/icons/state.ts +75 -0
- package/dist/templates/showcase/pages/components/icons/view.dml +36 -0
- package/dist/templates/showcase/pages/{images → components/images}/controller.ts +1 -0
- package/dist/templates/showcase/pages/components/images/view.dml +70 -0
- package/dist/templates/showcase/pages/{layout → components/layout}/controller.ts +1 -0
- package/dist/templates/showcase/pages/components/layout/view.dml +143 -0
- package/dist/templates/showcase/pages/components/lists/controller.ts +18 -0
- package/dist/templates/showcase/pages/{lists → components/lists}/state.ts +43 -30
- package/dist/templates/showcase/pages/components/lists/view.dml +70 -0
- package/dist/templates/showcase/pages/{payments → components/money}/controller.ts +1 -0
- package/dist/templates/showcase/pages/{payments → components/money}/view.dml +17 -8
- package/dist/templates/showcase/pages/components/reading/controller.ts +6 -0
- package/dist/templates/showcase/pages/components/reading/state.ts +23 -0
- package/dist/templates/showcase/pages/components/reading/view.dml +42 -0
- package/dist/templates/showcase/pages/{lists → components/sheets}/controller.ts +9 -10
- package/dist/templates/showcase/pages/components/sheets/state.ts +26 -0
- package/dist/templates/showcase/pages/components/sheets/view.dml +38 -0
- package/dist/templates/showcase/pages/{styles → components/styles}/controller.ts +1 -0
- package/dist/templates/showcase/pages/components/styles/view.dml +101 -0
- package/dist/templates/showcase/pages/{filters → components/tabs}/controller.ts +2 -0
- package/dist/templates/showcase/pages/{filters → components/tabs}/state.ts +1 -0
- package/dist/templates/showcase/pages/components/tabs/view.dml +56 -0
- package/dist/templates/showcase/pages/components/text/controller.ts +10 -0
- package/dist/templates/showcase/pages/components/text/state.ts +3 -0
- package/dist/templates/showcase/pages/components/text/view.dml +95 -0
- package/dist/templates/showcase/pages/{cache → dash/cache}/controller.ts +5 -0
- package/dist/templates/showcase/pages/dash/cache/view.dml +48 -0
- package/dist/templates/showcase/pages/dash/calls/controller.ts +49 -0
- package/dist/templates/showcase/pages/dash/calls/state.ts +6 -0
- package/dist/templates/showcase/pages/dash/calls/view.dml +51 -0
- package/dist/templates/showcase/pages/{files → dash/files}/controller.ts +1 -0
- package/dist/templates/showcase/pages/dash/files/view.dml +79 -0
- package/dist/templates/showcase/pages/dash/media/controller.ts +33 -0
- package/dist/templates/showcase/pages/dash/media/state.ts +8 -0
- package/dist/templates/showcase/pages/dash/media/view.dml +34 -0
- package/dist/templates/showcase/pages/{network → dash/network}/controller.ts +14 -5
- package/dist/templates/showcase/pages/{network → dash/network}/state.ts +4 -1
- package/dist/templates/showcase/pages/dash/network/view.dml +80 -0
- package/dist/templates/showcase/pages/{secrets → dash/secrets}/controller.ts +1 -0
- package/dist/templates/showcase/pages/dash/secrets/view.dml +26 -0
- package/dist/templates/showcase/pages/dash/system/controller.ts +62 -0
- package/dist/templates/showcase/pages/dash/system/state.ts +9 -0
- package/dist/templates/showcase/pages/dash/system/view.dml +59 -0
- package/dist/templates/showcase/pages/dash/ui/controller.ts +70 -0
- package/dist/templates/showcase/pages/dash/ui/state.ts +8 -0
- package/dist/templates/showcase/pages/dash/ui/view.dml +31 -0
- package/dist/templates/showcase/pages/index/state.ts +135 -64
- package/dist/templates/showcase/pages/index/view.dml +6 -3
- package/package.json +6 -6
- package/dist/templates/showcase/pages/cache/view.dml +0 -36
- package/dist/templates/showcase/pages/device/controller.ts +0 -105
- package/dist/templates/showcase/pages/device/state.ts +0 -16
- package/dist/templates/showcase/pages/device/view.dml +0 -69
- package/dist/templates/showcase/pages/files/view.dml +0 -64
- package/dist/templates/showcase/pages/filters/view.dml +0 -44
- package/dist/templates/showcase/pages/forms/view.dml +0 -49
- package/dist/templates/showcase/pages/images/view.dml +0 -53
- package/dist/templates/showcase/pages/layout/view.dml +0 -103
- package/dist/templates/showcase/pages/lists/view.dml +0 -59
- package/dist/templates/showcase/pages/navigation/controller.ts +0 -65
- package/dist/templates/showcase/pages/navigation/state.ts +0 -17
- package/dist/templates/showcase/pages/navigation/view.dml +0 -34
- package/dist/templates/showcase/pages/network/view.dml +0 -67
- package/dist/templates/showcase/pages/secrets/view.dml +0 -24
- package/dist/templates/showcase/pages/state/view.dml +0 -33
- package/dist/templates/showcase/pages/styles/view.dml +0 -61
- package/dist/templates/showcase/pages/text/state.ts +0 -8
- package/dist/templates/showcase/pages/text/view.dml +0 -58
- /package/dist/templates/showcase/pages/{state → basics/state}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{carousel → components/carousel}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{feedback → components/feedback}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{images → components/images}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{layout → components/layout}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{payments → components/money}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{styles → components/styles}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{cache → dash/cache}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{files → dash/files}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{secrets → dash/secrets}/state.ts +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Text variant="title">Forms</Text>
|
|
3
|
+
<Text>Buy tickets for a show. Each field sends onChange as you use it, and the page keeps its value in state. The page checks the form when you send it.</Text>
|
|
4
|
+
|
|
5
|
+
<View gap="small">
|
|
6
|
+
<Text variant="subtitle">Select</Text>
|
|
7
|
+
<View variant="card">
|
|
8
|
+
<Select label="Show" placeholder="Choose a show" hint="Every show has the same prices" value="{{ show }}" error="{{ errors.show }}" disabled="{{ sending }}" onChange="setShow">
|
|
9
|
+
<Option value="freetown" label="Salone Sounds Live · Freetown" />
|
|
10
|
+
<Option value="bo" label="Palm-wine evening · Bo" />
|
|
11
|
+
<Option value="kenema" label="Gospel night · Kenema" />
|
|
12
|
+
</Select>
|
|
13
|
+
</View>
|
|
14
|
+
</View>
|
|
15
|
+
|
|
16
|
+
<View gap="small">
|
|
17
|
+
<Text variant="subtitle">Input</Text>
|
|
18
|
+
<Text variant="caption" tone="muted">type sets the keyboard: text, email, phone, number or password. prefix and suffix sit inside the field. error shows under it.</Text>
|
|
19
|
+
<View variant="card">
|
|
20
|
+
<Input label="Name" placeholder="Mariama Kamara" value="{{ name }}" maxLength="40" onChange="setName" />
|
|
21
|
+
<Input label="Email" type="email" placeholder="mariama@example.com" hint="{{ eTickets ? 'For the e-tickets' : 'Turn on e-tickets below to use it' }}" value="{{ email }}" disabled="{{ !eTickets }}" onChange="setEmail" />
|
|
22
|
+
<Input label="Phone" type="phone" prefix="+232" placeholder="76 123456" value="{{ phone }}" error="{{ errors.phone }}" onChange="setPhone" />
|
|
23
|
+
<Input label="Tickets" type="number" placeholder="2" suffix="at most 10" value="{{ tickets }}" error="{{ errors.tickets }}" onChange="setTickets" />
|
|
24
|
+
<Input label="Promo code" type="password" placeholder="Hidden as you type" value="{{ promo }}" onChange="setPromo" onSubmit="send" />
|
|
25
|
+
</View>
|
|
26
|
+
</View>
|
|
27
|
+
|
|
28
|
+
<View gap="small">
|
|
29
|
+
<Text variant="subtitle">RadioGroup and Radio</Text>
|
|
30
|
+
<Text variant="caption" tone="muted">One choice from a few. A Radio, or the whole group, can be disabled.</Text>
|
|
31
|
+
<View variant="card">
|
|
32
|
+
<RadioGroup label="Ticket" value="{{ ticket }}" disabled="{{ sending }}" onChange="setTicket">
|
|
33
|
+
<Radio value="regular" label="Regular · Le 150" />
|
|
34
|
+
<Radio value="vip" label="VIP, near the stage · Le 400" />
|
|
35
|
+
<Radio value="table" label="Table for four · Le 1,200" />
|
|
36
|
+
<Radio value="backstage" label="Backstage · sold out" disabled />
|
|
37
|
+
</RadioGroup>
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
|
|
41
|
+
<View gap="small">
|
|
42
|
+
<Text variant="subtitle">TextArea</Text>
|
|
43
|
+
<View variant="card">
|
|
44
|
+
<TextArea label="Shout-out" placeholder="A message for the band, read out on the night" rows="3" maxLength="140" hint="{{ ticket === 'regular' ? 'Shout-outs come with VIP and table tickets' : shoutOut.length + ' of 140' }}" value="{{ shoutOut }}" error="{{ errors.shoutOut }}" disabled="{{ ticket === 'regular' }}" onChange="setShoutOut" />
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
|
|
48
|
+
<View gap="small">
|
|
49
|
+
<Text variant="subtitle">Slider</Text>
|
|
50
|
+
<Text variant="caption" tone="muted">A number between min and max, in steps. showValue shows it beside the label.</Text>
|
|
51
|
+
<View variant="card">
|
|
52
|
+
<Slider label="Chairs near the stage" min="0" max="10" showValue value="{{ chairs }}" disabled="{{ ticket === 'regular' }}" hint="{{ ticket === 'regular' ? 'Chairs come with VIP and table tickets' : '' }}" onChange="setChairs" />
|
|
53
|
+
<Slider label="Tip for the band, in leones" min="0" max="100" step="10" showValue value="{{ tip }}" onChange="setTip" />
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
|
|
57
|
+
<View gap="small">
|
|
58
|
+
<Text variant="subtitle">Switch and Checkbox</Text>
|
|
59
|
+
<View variant="card">
|
|
60
|
+
<Switch label="Email me the e-tickets" checked="{{ eTickets }}" onChange="setETickets" />
|
|
61
|
+
<Switch label="Text me on the night" disabled />
|
|
62
|
+
<Checkbox label="I agree to the terms" checked="{{ agreed }}" onChange="setAgreed" />
|
|
63
|
+
<Checkbox label="I'm over 18" checked disabled />
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
|
|
67
|
+
<View gap="small">
|
|
68
|
+
<Text variant="subtitle">Your order</Text>
|
|
69
|
+
<View variant="card" gap="none">
|
|
70
|
+
<DetailRow label="Show" value="{{ showName }}" />
|
|
71
|
+
<DetailRow label="Ticket" value="{{ ticketName }}" />
|
|
72
|
+
<DetailRow label="How many" value="{{ tickets || '0' }}" />
|
|
73
|
+
<Divider />
|
|
74
|
+
<DetailRow label="Total" value="{{ total }}" weight="bold" paddingTop="medium" />
|
|
75
|
+
<DetailRow label="Paid" value="{{ sent ? 'Yes' : 'Not yet' }}" tone="{{ sent ? 'success' : 'warning' }}" />
|
|
76
|
+
</View>
|
|
77
|
+
</View>
|
|
78
|
+
|
|
79
|
+
<If condition="{{ sent }}">
|
|
80
|
+
<Notice tone="success" title="Booked">{{ sent }}</Notice>
|
|
81
|
+
</If>
|
|
82
|
+
<If condition="{{ failure }}">
|
|
83
|
+
<Notice tone="danger" title="Not booked">{{ failure }}</Notice>
|
|
84
|
+
</If>
|
|
85
|
+
|
|
86
|
+
<Text variant="caption" tone="muted">A Footer keeps its buttons at the bottom of the screen.</Text>
|
|
87
|
+
<Footer>
|
|
88
|
+
<Button onClick="send" loading="{{ sending }}" disabled="{{ !agreed }}">Buy tickets</Button>
|
|
89
|
+
</Footer>
|
|
90
|
+
</View>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import state from './state';
|
|
2
|
+
|
|
3
|
+
export default definePage({
|
|
4
|
+
initialState: state,
|
|
5
|
+
configs: { navigationBar: { title: 'Icons' } },
|
|
6
|
+
mutations: {
|
|
7
|
+
clearToast: () => ({ toast: '' }),
|
|
8
|
+
},
|
|
9
|
+
actions: {
|
|
10
|
+
async copyName(_state, event: DotEvent<unknown, { name: string }>) {
|
|
11
|
+
await this.dash.system.copyText(event.data.name);
|
|
12
|
+
this.setState({ toast: `Copied "${event.data.name}"` });
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
// Every icon name, as Icon's name, and ListItem's, Chip's, GridItem's and EmptyState's icon take.
|
|
3
|
+
names: [
|
|
4
|
+
'arrow-down',
|
|
5
|
+
'arrow-left',
|
|
6
|
+
'arrow-right',
|
|
7
|
+
'arrow-up',
|
|
8
|
+
'bank',
|
|
9
|
+
'bell',
|
|
10
|
+
'bolt',
|
|
11
|
+
'calendar',
|
|
12
|
+
'card',
|
|
13
|
+
'cart',
|
|
14
|
+
'cash',
|
|
15
|
+
'check',
|
|
16
|
+
'chevron-down',
|
|
17
|
+
'chevron-left',
|
|
18
|
+
'chevron-right',
|
|
19
|
+
'chevron-up',
|
|
20
|
+
'clock',
|
|
21
|
+
'close',
|
|
22
|
+
'copy',
|
|
23
|
+
'download',
|
|
24
|
+
'edit',
|
|
25
|
+
'error',
|
|
26
|
+
'external-link',
|
|
27
|
+
'eye',
|
|
28
|
+
'eye-off',
|
|
29
|
+
'file',
|
|
30
|
+
'gift',
|
|
31
|
+
'globe',
|
|
32
|
+
'grid',
|
|
33
|
+
'headphones',
|
|
34
|
+
'heart',
|
|
35
|
+
'help',
|
|
36
|
+
'history',
|
|
37
|
+
'home',
|
|
38
|
+
'image',
|
|
39
|
+
'info',
|
|
40
|
+
'link',
|
|
41
|
+
'list',
|
|
42
|
+
'location',
|
|
43
|
+
'lock',
|
|
44
|
+
'logout',
|
|
45
|
+
'mail',
|
|
46
|
+
'microphone',
|
|
47
|
+
'minus',
|
|
48
|
+
'mobile',
|
|
49
|
+
'more',
|
|
50
|
+
'music',
|
|
51
|
+
'phone',
|
|
52
|
+
'playlist',
|
|
53
|
+
'plus',
|
|
54
|
+
'qr-code',
|
|
55
|
+
'receipt',
|
|
56
|
+
'refresh',
|
|
57
|
+
'search',
|
|
58
|
+
'send',
|
|
59
|
+
'settings',
|
|
60
|
+
'share',
|
|
61
|
+
'star',
|
|
62
|
+
'success',
|
|
63
|
+
'ticket',
|
|
64
|
+
'trash',
|
|
65
|
+
'upload',
|
|
66
|
+
'user',
|
|
67
|
+
'users',
|
|
68
|
+
'video',
|
|
69
|
+
'wallet',
|
|
70
|
+
'warning',
|
|
71
|
+
'water',
|
|
72
|
+
'wifi',
|
|
73
|
+
],
|
|
74
|
+
toast: '',
|
|
75
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Text variant="title">Icons</Text>
|
|
3
|
+
<Text>Icon shows a small picture by its name. Lists, chips, grids and empty states take the same names.</Text>
|
|
4
|
+
|
|
5
|
+
<View gap="small">
|
|
6
|
+
<Text variant="subtitle">size and tone</Text>
|
|
7
|
+
<View variant="card" direction="row" wrap gap="large" align="center">
|
|
8
|
+
<Icon name="music" size="small" />
|
|
9
|
+
<Icon name="music" size="medium" />
|
|
10
|
+
<Icon name="music" size="large" />
|
|
11
|
+
<Icon name="info" tone="info" />
|
|
12
|
+
<Icon name="success" tone="success" />
|
|
13
|
+
<Icon name="warning" tone="warning" />
|
|
14
|
+
<Icon name="error" tone="danger" />
|
|
15
|
+
<Icon name="star" tone="muted" />
|
|
16
|
+
<Icon name="heart" tone="default" />
|
|
17
|
+
</View>
|
|
18
|
+
</View>
|
|
19
|
+
|
|
20
|
+
<View gap="small">
|
|
21
|
+
<Text variant="subtitle">Every name</Text>
|
|
22
|
+
<Text variant="caption" tone="muted">Tap one to copy its name.</Text>
|
|
23
|
+
<View variant="card">
|
|
24
|
+
<Grid columns="3" gap="medium">
|
|
25
|
+
<For each="{{ names }}" item="name" key="*this">
|
|
26
|
+
<View align="center" gap="small" padding="small" data-name="{{ name }}" onTap="copyName">
|
|
27
|
+
<Icon name="{{ name }}" />
|
|
28
|
+
<Text variant="caption" tone="muted" align="center">{{ name }}</Text>
|
|
29
|
+
</View>
|
|
30
|
+
</For>
|
|
31
|
+
</Grid>
|
|
32
|
+
</View>
|
|
33
|
+
</View>
|
|
34
|
+
|
|
35
|
+
<Toast message="{{ toast }}" tone="success" onHide="clearToast" />
|
|
36
|
+
</View>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Text variant="title">Images</Text>
|
|
3
|
+
<Text>Image shows a picture from the dot's statics/ folder or from the web. Give it alt text, which screen readers say aloud.</Text>
|
|
4
|
+
|
|
5
|
+
<View gap="small">
|
|
6
|
+
<Text variant="subtitle">From statics/</Text>
|
|
7
|
+
<Text variant="caption" tone="muted">These pictures come with the dot, and the build checks each one exists.</Text>
|
|
8
|
+
<View variant="card" direction="row" align="end" gap="large">
|
|
9
|
+
<Image src="statics/logo.png" alt="Small logo" width="24" height="24" />
|
|
10
|
+
<Image src="statics/logo.png" alt="Medium logo" width="48" height="48" />
|
|
11
|
+
<Image src="statics/logo.png" alt="Large logo" width="96" height="96" />
|
|
12
|
+
</View>
|
|
13
|
+
</View>
|
|
14
|
+
|
|
15
|
+
<View gap="small">
|
|
16
|
+
<Text variant="subtitle">From the web</Text>
|
|
17
|
+
<Text variant="caption" tone="muted">The cover of Drizilik's album AUDACITY. With aspect="1:1" and no width, it fills the card.</Text>
|
|
18
|
+
<View variant="card" gap="small">
|
|
19
|
+
<If condition="{{ cover }}">
|
|
20
|
+
<Image src="{{ cover }}" alt="The cover of AUDACITY, by Drizilik" aspect="1:1" />
|
|
21
|
+
<Text weight="medium">AUDACITY</Text>
|
|
22
|
+
<Text variant="caption" tone="muted">Drizilik raps mostly in Krio, in a style called Kriofusion. He won Best Male Artist at the 2026 SLeDU awards.</Text>
|
|
23
|
+
</If>
|
|
24
|
+
<ElseIf condition="{{ coverNote }}">
|
|
25
|
+
<Text variant="caption" tone="muted">{{ coverNote }}</Text>
|
|
26
|
+
</ElseIf>
|
|
27
|
+
<Else>
|
|
28
|
+
<Skeleton shape="box" height="280" />
|
|
29
|
+
</Else>
|
|
30
|
+
</View>
|
|
31
|
+
</View>
|
|
32
|
+
|
|
33
|
+
<View gap="small">
|
|
34
|
+
<Text variant="subtitle">shape and fit</Text>
|
|
35
|
+
<Text variant="caption" tone="muted">Rounded, square or circle. fit="contain" shows the whole picture; cover, the default, fills the box.</Text>
|
|
36
|
+
<View variant="card" direction="row" align="center" gap="large">
|
|
37
|
+
<Image src="statics/logo.png" alt="Rounded" width="56" height="56" shape="rounded" />
|
|
38
|
+
<Image src="statics/logo.png" alt="Square" width="56" height="56" shape="square" />
|
|
39
|
+
<Image src="statics/logo.png" alt="Circle" width="56" height="56" shape="circle" />
|
|
40
|
+
<Image src="statics/logo.png" alt="Contained" width="96" height="56" fit="contain" />
|
|
41
|
+
<Image src="statics/logo.png" alt="Covered" width="96" height="56" fit="cover" />
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
44
|
+
|
|
45
|
+
<View gap="small">
|
|
46
|
+
<Text variant="subtitle">onLoad</Text>
|
|
47
|
+
<Text variant="caption" tone="muted">Tells the page the picture's own size once it loads. The size on screen comes from state here.</Text>
|
|
48
|
+
<View variant="card" gap="small">
|
|
49
|
+
<Image src="statics/logo.png" alt="Logo" width="{{ size }}" height="{{ size }}" onLoad="logoLoaded" />
|
|
50
|
+
<Text>{{ size }} × {{ size }} on screen, {{ loaded }} in the file</Text>
|
|
51
|
+
<View direction="row" gap="small">
|
|
52
|
+
<Button variant="secondary" onClick="shrink" disabled="{{ size <= 16 }}">Smaller</Button>
|
|
53
|
+
<Button variant="secondary" onClick="grow" disabled="{{ size >= 128 }}">Bigger</Button>
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
</View>
|
|
57
|
+
|
|
58
|
+
<View gap="small">
|
|
59
|
+
<Text variant="subtitle">onError</Text>
|
|
60
|
+
<Text variant="caption" tone="muted">Tells the page why a picture didn't load.</Text>
|
|
61
|
+
<View variant="card">
|
|
62
|
+
<If condition="{{ failure }}">
|
|
63
|
+
<Text>{{ failure }}</Text>
|
|
64
|
+
</If>
|
|
65
|
+
<Else>
|
|
66
|
+
<Image src="{{ missing }}" alt="" width="48" height="48" onError="missingFailed" />
|
|
67
|
+
</Else>
|
|
68
|
+
</View>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Text variant="title">Layout</Text>
|
|
3
|
+
<Text>Views hold other components and lay them out. Every page starts with one.</Text>
|
|
4
|
+
|
|
5
|
+
<View gap="small">
|
|
6
|
+
<Text variant="subtitle">View</Text>
|
|
7
|
+
<Text variant="caption" tone="muted">A View puts its items in a column or a row. variant="card" gives it a card's look. Change the one below.</Text>
|
|
8
|
+
<View variant="card" direction="{{ direction }}" justify="{{ justify }}" align="{{ align }}" gap="{{ gap }}" wrap="{{ wrap }}">
|
|
9
|
+
<Button variant="secondary">Palm-wine</Button>
|
|
10
|
+
<Button variant="secondary">Gumbe</Button>
|
|
11
|
+
<Text variant="title">Afropop</Text>
|
|
12
|
+
<Button variant="secondary">Bubu</Button>
|
|
13
|
+
<Text variant="caption" tone="muted">Milo jazz</Text>
|
|
14
|
+
</View>
|
|
15
|
+
<View gap="small">
|
|
16
|
+
<View direction="row" align="center">
|
|
17
|
+
<Text>direction="{{ direction }}"</Text>
|
|
18
|
+
<View grow />
|
|
19
|
+
<Button variant="secondary" onClick="nextDirection">Change</Button>
|
|
20
|
+
</View>
|
|
21
|
+
<View direction="row" align="center">
|
|
22
|
+
<Text>justify="{{ justify }}"</Text>
|
|
23
|
+
<View grow />
|
|
24
|
+
<Button variant="secondary" onClick="nextJustify">Change</Button>
|
|
25
|
+
</View>
|
|
26
|
+
<View direction="row" align="center">
|
|
27
|
+
<Text>align="{{ align }}"</Text>
|
|
28
|
+
<View grow />
|
|
29
|
+
<Button variant="secondary" onClick="nextAlign">Change</Button>
|
|
30
|
+
</View>
|
|
31
|
+
<View direction="row" align="center">
|
|
32
|
+
<Text>gap="{{ gap }}"</Text>
|
|
33
|
+
<View grow />
|
|
34
|
+
<Button variant="secondary" onClick="nextGap">Change</Button>
|
|
35
|
+
</View>
|
|
36
|
+
<View direction="row" align="center">
|
|
37
|
+
<Text>wrap="{{ wrap }}"</Text>
|
|
38
|
+
<View grow />
|
|
39
|
+
<Button variant="secondary" onClick="toggleWrap">Change</Button>
|
|
40
|
+
</View>
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
|
|
44
|
+
<View gap="small">
|
|
45
|
+
<Text variant="subtitle">grow and onTap</Text>
|
|
46
|
+
<Text variant="caption" tone="muted">grow fills the space left over: the song grows, the year does not. A View can be tapped: tap the song.</Text>
|
|
47
|
+
<View direction="row" gap="small">
|
|
48
|
+
<View variant="card" grow onTap="playSong">
|
|
49
|
+
<Text>{{ playing ? 'Playing Exodus, by Drizilik' : 'Exodus, by Drizilik' }}</Text>
|
|
50
|
+
</View>
|
|
51
|
+
<View variant="card">
|
|
52
|
+
<Text>2021</Text>
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
|
|
57
|
+
<View gap="small">
|
|
58
|
+
<Text variant="subtitle">padding</Text>
|
|
59
|
+
<Text variant="caption" tone="muted">The space inside the edges, on every side or on one side. Most components take it.</Text>
|
|
60
|
+
<View direction="row" gap="small">
|
|
61
|
+
<View variant="card" padding="small">
|
|
62
|
+
<Text>small</Text>
|
|
63
|
+
</View>
|
|
64
|
+
<View variant="card" padding="large">
|
|
65
|
+
<Text>large</Text>
|
|
66
|
+
</View>
|
|
67
|
+
<View variant="card" padding="small" paddingStart="large">
|
|
68
|
+
<Text>start</Text>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
|
|
73
|
+
<View gap="small">
|
|
74
|
+
<Text variant="subtitle">Stack</Text>
|
|
75
|
+
<Text variant="caption" tone="muted">A Stack lays its children on top of each other, such as words over a picture.</Text>
|
|
76
|
+
<Stack radius="large" aspect="16:9">
|
|
77
|
+
<View background="gold" />
|
|
78
|
+
<View justify="end" padding="large">
|
|
79
|
+
<Text variant="subtitle" tone="ink">Bo market day</Text>
|
|
80
|
+
<Text tone="ink">Every Saturday, from 7 am</Text>
|
|
81
|
+
</View>
|
|
82
|
+
<View align="end" padding="medium">
|
|
83
|
+
<View background="primary" radius="full" paddingStart="small" paddingEnd="small">
|
|
84
|
+
<Text variant="caption" tone="onPrimary" weight="bold">New</Text>
|
|
85
|
+
</View>
|
|
86
|
+
</View>
|
|
87
|
+
</Stack>
|
|
88
|
+
</View>
|
|
89
|
+
|
|
90
|
+
<View gap="small">
|
|
91
|
+
<Text variant="subtitle">Scroll</Text>
|
|
92
|
+
<Text variant="caption" tone="muted">A Scroll moves a row sideways. It stops at the start of each release. The buttons scroll it too.</Text>
|
|
93
|
+
<Scroll gap="medium" snap="start" index="{{ first }}" onChange="showFirst">
|
|
94
|
+
<For each="{{ releases }}" item="release" key="id">
|
|
95
|
+
<View gap="small">
|
|
96
|
+
<If condition="{{ release.cover }}">
|
|
97
|
+
<Image src="{{ release.cover }}" alt="{{ release.title }}" width="128" height="128" />
|
|
98
|
+
</If>
|
|
99
|
+
<Else>
|
|
100
|
+
<Skeleton shape="box" height="128" />
|
|
101
|
+
</Else>
|
|
102
|
+
<Text weight="medium" maxLines="2">{{ release.title }}</Text>
|
|
103
|
+
<Text variant="caption" tone="muted">{{ release.year }}</Text>
|
|
104
|
+
</View>
|
|
105
|
+
</For>
|
|
106
|
+
</Scroll>
|
|
107
|
+
<Text tone="muted">First on the shelf: {{ releases[first].title }}</Text>
|
|
108
|
+
<View direction="row" gap="small">
|
|
109
|
+
<Button variant="secondary" onClick="shelfStart" disabled="{{ first === 0 }}">To the start</Button>
|
|
110
|
+
<Button variant="secondary" onClick="shelfEnd" disabled="{{ first === releases.length - 1 }}">To the end</Button>
|
|
111
|
+
</View>
|
|
112
|
+
</View>
|
|
113
|
+
|
|
114
|
+
<View gap="small">
|
|
115
|
+
<Text variant="subtitle">Grid</Text>
|
|
116
|
+
<Text variant="caption" tone="muted">A Grid keeps its columns the same width. A GridItem shows an icon or a picture, with a label.</Text>
|
|
117
|
+
<View variant="card" gap="medium">
|
|
118
|
+
<Grid columns="4" gap="small">
|
|
119
|
+
<GridItem icon="microphone" label="Artists" data-name="Artists" onTap="openSection" />
|
|
120
|
+
<GridItem icon="music" label="Albums" data-name="Albums" onTap="openSection" />
|
|
121
|
+
<GridItem icon="playlist" label="Playlists" data-name="Playlists" onTap="openSection" />
|
|
122
|
+
<GridItem icon="star" label="Charts" badge="New" data-name="Charts" onTap="openSection" />
|
|
123
|
+
<GridItem icon="calendar" label="Shows" data-name="Shows" onTap="openSection" />
|
|
124
|
+
<GridItem icon="ticket" label="Tickets" data-name="Tickets" onTap="openSection" />
|
|
125
|
+
<GridItem icon="headphones" label="Library" data-name="Library" onTap="openSection" />
|
|
126
|
+
<GridItem image="statics/logo.png" label="Salone" data-name="Salone" onTap="openSection" />
|
|
127
|
+
</Grid>
|
|
128
|
+
<If condition="{{ section }}">
|
|
129
|
+
<Text tone="muted">You tapped {{ section }}</Text>
|
|
130
|
+
</If>
|
|
131
|
+
</View>
|
|
132
|
+
</View>
|
|
133
|
+
|
|
134
|
+
<View gap="small">
|
|
135
|
+
<Text variant="subtitle">Divider</Text>
|
|
136
|
+
<Text variant="caption" tone="muted">A line between parts.</Text>
|
|
137
|
+
<View variant="card">
|
|
138
|
+
<Text>Side A</Text>
|
|
139
|
+
<Divider />
|
|
140
|
+
<Text>Side B</Text>
|
|
141
|
+
</View>
|
|
142
|
+
</View>
|
|
143
|
+
</View>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import state, { CHART } from './state';
|
|
2
|
+
|
|
3
|
+
// Rows to add each time the list's end comes into view.
|
|
4
|
+
const MORE = 5;
|
|
5
|
+
|
|
6
|
+
export default definePage({
|
|
7
|
+
initialState: state,
|
|
8
|
+
configs: { navigationBar: { title: 'Lists' } },
|
|
9
|
+
mutations: {
|
|
10
|
+
choose: (state, event: DotEvent<unknown, { id: string }>) => {
|
|
11
|
+
const artist = state.artists.find((candidate) => candidate.id === event.data.id);
|
|
12
|
+
return { chosen: artist?.name ?? '' };
|
|
13
|
+
},
|
|
14
|
+
showMore: (state) => ({ chart: CHART.slice(0, state.chart.length + MORE) }),
|
|
15
|
+
saveSome: () => ({ saved: ['Exodus, by Drizilik', 'Control, by ApreeL'] }),
|
|
16
|
+
clearSaved: () => ({ saved: [] }),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -3,7 +3,6 @@ export interface Artist {
|
|
|
3
3
|
name: string;
|
|
4
4
|
song: string;
|
|
5
5
|
genre: string;
|
|
6
|
-
icon: string;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
export interface Release {
|
|
@@ -15,6 +14,42 @@ export interface Release {
|
|
|
15
14
|
tone: string;
|
|
16
15
|
}
|
|
17
16
|
|
|
17
|
+
export interface ChartSong {
|
|
18
|
+
id: number;
|
|
19
|
+
title: string;
|
|
20
|
+
plays: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const TITLES = [
|
|
24
|
+
'Lemonade',
|
|
25
|
+
'Control',
|
|
26
|
+
'Love Na Scam',
|
|
27
|
+
'Hannah',
|
|
28
|
+
'Nack',
|
|
29
|
+
'Exodus',
|
|
30
|
+
'Ashobi',
|
|
31
|
+
'Send Money',
|
|
32
|
+
'Blunt',
|
|
33
|
+
"O'way",
|
|
34
|
+
'Shadow',
|
|
35
|
+
'Leader',
|
|
36
|
+
'Kenyatta',
|
|
37
|
+
'Shock',
|
|
38
|
+
'Leh Wi Make Salone',
|
|
39
|
+
'Borbor Bele',
|
|
40
|
+
'Let Me Love You',
|
|
41
|
+
'Cry Africa',
|
|
42
|
+
'Corruption',
|
|
43
|
+
'Ghetto Struggle',
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
// This week's chart. The list shows the first few, and more as you scroll.
|
|
47
|
+
export const CHART: ChartSong[] = TITLES.map((title, index) => ({
|
|
48
|
+
id: index + 1,
|
|
49
|
+
title,
|
|
50
|
+
plays: `${(20 - index) * 1000} plays`,
|
|
51
|
+
}));
|
|
52
|
+
|
|
18
53
|
export default {
|
|
19
54
|
artists: [
|
|
20
55
|
{
|
|
@@ -22,32 +57,28 @@ export default {
|
|
|
22
57
|
name: 'Drizilik',
|
|
23
58
|
song: 'Lemonade, with The Therapist',
|
|
24
59
|
genre: 'Kriofusion',
|
|
25
|
-
icon: 'microphone',
|
|
26
60
|
},
|
|
27
|
-
{ id: 'boii', name: 'Boii', song: 'Love Na Scam', genre: 'Afrobeats'
|
|
28
|
-
{ id: 'apreel', name: 'ApreeL', song: 'Control', genre: 'Afropop'
|
|
29
|
-
{ id: 'donii-major', name: 'Donii Major', song: 'Hannah', genre: 'R&B'
|
|
61
|
+
{ id: 'boii', name: 'Boii', song: 'Love Na Scam', genre: 'Afrobeats' },
|
|
62
|
+
{ id: 'apreel', name: 'ApreeL', song: 'Control', genre: 'Afropop' },
|
|
63
|
+
{ id: 'donii-major', name: 'Donii Major', song: 'Hannah', genre: 'R&B' },
|
|
30
64
|
{
|
|
31
65
|
id: 'star-zee',
|
|
32
66
|
name: 'Star Zee',
|
|
33
67
|
song: 'Leader, with Stonebwoy',
|
|
34
68
|
genre: 'Hip hop',
|
|
35
|
-
icon: 'microphone',
|
|
36
69
|
},
|
|
37
70
|
{
|
|
38
71
|
id: 'kao-denero',
|
|
39
72
|
name: 'Kao Denero',
|
|
40
73
|
song: 'Kenyatta',
|
|
41
74
|
genre: 'Hip hop',
|
|
42
|
-
icon: 'microphone',
|
|
43
75
|
},
|
|
44
|
-
{ id: 'laj', name: 'LAJ', song: 'Shock, with Cassidy', genre: 'Hip hop'
|
|
76
|
+
{ id: 'laj', name: 'LAJ', song: 'Shock, with Cassidy', genre: 'Hip hop' },
|
|
45
77
|
{
|
|
46
78
|
id: 'k-man',
|
|
47
79
|
name: 'K-Man',
|
|
48
80
|
song: 'Leh Wi Make Salone',
|
|
49
81
|
genre: 'Hip hop',
|
|
50
|
-
icon: 'microphone',
|
|
51
82
|
},
|
|
52
83
|
] as Artist[],
|
|
53
84
|
releases: [
|
|
@@ -93,25 +124,7 @@ export default {
|
|
|
93
124
|
},
|
|
94
125
|
] as Release[],
|
|
95
126
|
chosen: '',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
icons: [
|
|
100
|
-
'music',
|
|
101
|
-
'playlist',
|
|
102
|
-
'microphone',
|
|
103
|
-
'headphones',
|
|
104
|
-
'ticket',
|
|
105
|
-
'video',
|
|
106
|
-
'globe',
|
|
107
|
-
'link',
|
|
108
|
-
'external-link',
|
|
109
|
-
'heart',
|
|
110
|
-
'star',
|
|
111
|
-
'share',
|
|
112
|
-
'download',
|
|
113
|
-
'calendar',
|
|
114
|
-
'location',
|
|
115
|
-
'search',
|
|
116
|
-
],
|
|
127
|
+
chart: CHART.slice(0, 8),
|
|
128
|
+
chartSize: CHART.length,
|
|
129
|
+
saved: [] as string[],
|
|
117
130
|
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Text variant="title">Lists</Text>
|
|
3
|
+
<Text>A List shows rows in a card. A ListItem can show an icon or a picture, a subtitle, and a value or a badge at its end. A row you can tap shows an arrow.</Text>
|
|
4
|
+
|
|
5
|
+
<View gap="small">
|
|
6
|
+
<Text variant="subtitle">List and ListItem</Text>
|
|
7
|
+
<Text variant="caption" tone="muted">Artists in a small list. Tap one: its data-id tells the page which one.</Text>
|
|
8
|
+
<List>
|
|
9
|
+
<For each="{{ artists }}" item="artist" key="id">
|
|
10
|
+
<ListItem icon="microphone" title="{{ artist.name }}" subtitle="{{ artist.song }}" value="{{ artist.genre }}" data-id="{{ artist.id }}" onTap="choose" />
|
|
11
|
+
</For>
|
|
12
|
+
</List>
|
|
13
|
+
<If condition="{{ chosen }}">
|
|
14
|
+
<Text>You chose {{ chosen }}</Text>
|
|
15
|
+
</If>
|
|
16
|
+
</View>
|
|
17
|
+
|
|
18
|
+
<View gap="small">
|
|
19
|
+
<Text variant="subtitle">size="md", with a picture and a badge</Text>
|
|
20
|
+
<Text variant="caption" tone="muted">Medium lists have more room. A ListItem's children show at its end, in place of value.</Text>
|
|
21
|
+
<List size="md">
|
|
22
|
+
<For each="{{ releases }}" item="release" key="id">
|
|
23
|
+
<ListItem image="statics/logo.png" title="{{ release.title }}" subtitle="{{ release.artist }} · {{ release.year }}">
|
|
24
|
+
<Badge tone="{{ release.tone }}">{{ release.note }}</Badge>
|
|
25
|
+
</ListItem>
|
|
26
|
+
</For>
|
|
27
|
+
</List>
|
|
28
|
+
</View>
|
|
29
|
+
|
|
30
|
+
<View gap="small">
|
|
31
|
+
<Text variant="subtitle">onEndReached</Text>
|
|
32
|
+
<Text variant="caption" tone="muted">Comes when the last row scrolls into view, so the page can add more. {{ chart.length }} of {{ chartSize }} songs so far.</Text>
|
|
33
|
+
<List onEndReached="showMore">
|
|
34
|
+
<For each="{{ chart }}" item="song" key="id">
|
|
35
|
+
<ListItem title="{{ song.id }}. {{ song.title }}" value="{{ song.plays }}" />
|
|
36
|
+
</For>
|
|
37
|
+
</List>
|
|
38
|
+
</View>
|
|
39
|
+
|
|
40
|
+
<View gap="small">
|
|
41
|
+
<Text variant="subtitle">DetailRow</Text>
|
|
42
|
+
<Text variant="caption" tone="muted">A label with its value, such as on a receipt. tone and weight change the value.</Text>
|
|
43
|
+
<View variant="card" gap="none">
|
|
44
|
+
<DetailRow label="Show" value="Salone Sounds Live" />
|
|
45
|
+
<DetailRow label="Seats" value="2, near the stage" tone="muted" />
|
|
46
|
+
<DetailRow label="Doors open" value="18:00" tone="info" />
|
|
47
|
+
<DetailRow label="Status" value="Paid" tone="success" />
|
|
48
|
+
<DetailRow label="Refunds" value="Not after Friday" tone="warning" />
|
|
49
|
+
<DetailRow label="Total" value="SLE 800" weight="bold" />
|
|
50
|
+
</View>
|
|
51
|
+
</View>
|
|
52
|
+
|
|
53
|
+
<View gap="small">
|
|
54
|
+
<Text variant="subtitle">EmptyState</Text>
|
|
55
|
+
<Text variant="caption" tone="muted">Shows when a list has nothing in it, with a way forward.</Text>
|
|
56
|
+
<View variant="card">
|
|
57
|
+
<If condition="{{ saved.length > 0 }}">
|
|
58
|
+
<For each="{{ saved }}" item="title" key="*this">
|
|
59
|
+
<Text>{{ title }}</Text>
|
|
60
|
+
</For>
|
|
61
|
+
<Button variant="secondary" onClick="clearSaved">Clear</Button>
|
|
62
|
+
</If>
|
|
63
|
+
<Else>
|
|
64
|
+
<EmptyState icon="heart" title="No saved songs" text="Save a song to find it here later.">
|
|
65
|
+
<Button variant="secondary" onClick="saveSome">Save two songs</Button>
|
|
66
|
+
</EmptyState>
|
|
67
|
+
</Else>
|
|
68
|
+
</View>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|