Skip to content

Commit 18fba0e

Browse files
author
Simon Dold
committed
adding attractions components
1 parent ca9e45f commit 18fba0e

File tree

3 files changed

+94
-11
lines changed

3 files changed

+94
-11
lines changed

src/components/Frameworks/AgnosticUI/AgnosticUI.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
isInline
107107
options={[
108108
{
109-
label: "On",
109+
label: "Check me",
110110
},
111111
]}
112112
/>

src/components/Frameworks/Attractions/Attractions.svelte

Lines changed: 92 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
// @ts-nocheck
33
import { primaryColor, secondaryColor } from "../../../store/stores";
4-
import { Button, Accordion, AccordionSection, Badge } from "attractions";
4+
import { Button, Accordion, AccordionSection, Badge, Switch, Checkbox, CheckboxGroup, RadioChip, Tabs, Dialog, Modal, TextField, Table } from "attractions";
55
66
let colorP;
77
let colorS;
@@ -16,24 +16,94 @@
1616
1717
let open = false;
1818
19-
let selectedTab = "Main dishes";
19+
let selectedTab = "Tab 2";
20+
21+
const colors = [
22+
{ value: '#ffffff' },
23+
{ value: '#000000' },
24+
];
25+
26+
let modalOpen = false;
27+
let cardNumber = '';
28+
29+
const headers = [
30+
{ text: '#', value: '#' },
31+
{ text: 'Elements', value: 'Elements' },
32+
];
33+
const items = [
34+
{ "#": '0', Elements: 'List Element 0', },
35+
{ "#": '1', Elements: 'List Element 1'},
36+
{ "#": '2', Elements: 'List Element 2'},
37+
];
2038
</script>
2139

2240
<div class="container-ui-comparison">
23-
<p>
24-
Very bad svelte kit support, <br />so no Integration of attractions
25-
</p>
2641
<div class="sub-container-button">
27-
<Button round neutral outline style={"background-color:" + colorP + "; color:" + colorS}
28-
>Click me</Button
42+
<Button filled style={"background-color:" + colorP + "; color:" + colorS}>Click me</Button>
43+
</div>
44+
<div class="sub-container-button">
45+
<Switch />
46+
</div>
47+
<div class="sub-container-button">
48+
<div style="display: flex">
49+
<CheckboxGroup
50+
class="flex"
51+
color
52+
round
53+
items={colors}
54+
name="colors[]"
55+
max={1}
56+
/>
57+
</div>
58+
</div>
59+
<div class="sub-container-button">
60+
<div style="display:flex">
61+
<Checkbox
62+
name="subscribe"
63+
value="newsletter"
64+
title="Check me"
2965
>
66+
</Checkbox>
67+
Check me
68+
</div>
3069
</div>
70+
3171
<div class="sub-container-button">
32-
<Badge>used on some text</Badge>
72+
<RadioChip value="Morning" name="selection" outline>Morning</RadioChip>
73+
<RadioChip value="Afternoon" name="selection" outline>Afternoon</RadioChip>
74+
<RadioChip value="Evening" name="selection" outline>Evening</RadioChip>
75+
</div>
76+
77+
<div class="sub-container-button">
78+
<Tabs
79+
name="menu"
80+
items={['Tab 1', 'Tab 2', 'Tab 3']}
81+
bind:value={selectedTab}
82+
/>
83+
</div>
84+
85+
<div class="sub-container-button">
86+
<Button on:click={() => modalOpen = true}>click me</Button>
87+
<Modal bind:open={modalOpen} let:closeCallback>
88+
<Dialog title="Attractions Modal" {closeCallback}>
89+
<div>
90+
<br/>
91+
<p>Hello from Attractions Modal</p>
92+
</div>
93+
</Dialog>
94+
</Modal>
95+
</div>
96+
97+
<div class="sub-container-button" style="width: 100%; height: 100%; margin-top: 1em; margin-bottom: 1em">
98+
<TextField
99+
placeholder="Your Email"
100+
bind:value={cardNumber}
101+
error={cardNumber.startsWith('2') && 'We do not serve your bank.'}
102+
/>
33103
</div>
34104

35105
<Accordion let:closeOtherPanels>
36-
{#each [0, 1, 2, 3, 4] as idx}
106+
{#each [0, 1, 2, 3] as idx}
37107
<AccordionSection on:panel-open={closeOtherPanels}>
38108
<div slot="handle" let:toggle>
39109
<Button on:click={toggle}>
@@ -46,3 +116,16 @@
46116
{/each}
47117
</Accordion>
48118
</div>
119+
120+
<div class="sub-container-button" style="width: 100%; height: 100%; margin-top: 1em; margin-bottom: 1em">
121+
<Table {headers} {items} />
122+
</div>
123+
124+
<style>
125+
.flex{
126+
display: "flex";
127+
margin: 1em;
128+
padding: 1em;
129+
130+
}
131+
</style>

svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const config = {
1616
base: dev ? '' : '/svelte-ui-frameworks'
1717
}
1818
},
19-
preprocess: [vitePreprocess(), sveltePreprocess()]
19+
preprocess: [sveltePreprocess(), vitePreprocess()]
2020
};
2121

2222
export default config;

0 commit comments

Comments
 (0)