-
Notifications
You must be signed in to change notification settings - Fork 1
/
accordion.html
96 lines (89 loc) · 4.5 KB
/
accordion.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>accordion and accordion-item</title>
<script type="module" src="https://js.arcgis.com/calcite-components/1.0.0-beta.91/calcite.esm.js"></script>
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/1.0.0-beta.91/calcite.css" />
<style>
h1,
calcite-accordion {
margin-bottom: 5rem;
}
h2 {
margin: 3rem 0rem;
}
body {
font-family: var(--calcite-sans-family);
font-size: var(--calcite-font-size-0);
color: var(--calcite-ui-text-1);
max-width: 1024px;
min-width: 280px;
width: 70vw;
padding: 0 var(--calcite-spacing-double);
margin: 0 auto;
background-color: var(--calcite-ui-background);
}
/* Theme Switcher */
#theme-label {
position: fixed;
top: 20px;
right: 20px;
z-index: 2;
background-color: var(--calcite-ui-background);
border: 1px solid;
border-color: var(--calcite-ui-border-1);
border-radius: var(--calcite-border-radius);
margin: 0;
padding: 10px;
}
#theme-label label {
margin: 0;
}
</style>
</head>
<body>
<main>
<h1><code>accordion and accordion-item</code></h1>
<!-- calcite-switch -->
<div id="theme-label">
<calcite-label layout="inline">
Toggle theme
<calcite-switch id="theme-switch"></calcite-switch>
</calcite-label>
</div>
<p>Navigate through each individual sample. Each sample includes different properties but similar content, including three accordion items.</p>
<h2>Test 1. Accordion single selection mode</h2>
<!-- appearance: default, selection-mode: single -->
<calcite-accordion appearance="default" icon-position="end" icon-type="chevron" scale="m" selection-mode="single">
<calcite-accordion-item icon="embark" item-title="Watercraft" item-subtitle="Yachts, boats, and dinghies" active>Yachts, boats, and dinghies content</calcite-accordion-item>
<calcite-accordion-item icon="car" item-title="Automobiles" item-subtitle="Cars, trucks, and busses">Cars, trucks, and busses content</calcite-accordion-item>
<calcite-accordion-item icon="plane" item-title="Aircraft" item-subtitle="Planes, helicopters, and jets">Planes, helicopters, and jets content</calcite-accordion-item>
</calcite-accordion>
<h2> Test 2. Accordion multi selection mode</h2>
<!-- appearance: minimal, selection-mode: multi -->
<calcite-accordion appearance="minimal" icon-position="end" icon-type="chevron" scale="m" selection-mode="multi">
<calcite-accordion-item icon="embark" item-title="Watercraft 2" item-subtitle="Yachts, boats, and dinghies" active>Yachts, boats, and dinghies content</calcite-accordion-item>
<calcite-accordion-item icon="car" item-title="Automobiles 2" item-subtitle="Cars, trucks, and busses" active>Cars, trucks, and busses content</calcite-accordion-item>
<calcite-accordion-item icon="plane" item-title="Aircraft 2" item-subtitle="Planes, helicopters, and jets">Planes, helicopters, and jets content</calcite-accordion-item>
</calcite-accordion>
<h2>Test 3. Accordion single persist selection mode and small scale </h2>
<!-- scale: small, appearance: transparent, selection-mode: single-persist -->
<calcite-accordion appearance="transparent" icon-position="end" icon-type="chevron" scale="s" selection-mode="single-persist">
<calcite-accordion-item icon="embark" item-title="Watercraft 3" item-subtitle="Yachts, boats, and dinghies" active>Yachts, boats, and dinghies content</calcite-accordion-item>
<calcite-accordion-item icon="car" item-title="Automobiles 3" item-subtitle="Cars, trucks, and busses">Cars, trucks, and busses content</calcite-accordion-item>
<calcite-accordion-item icon="plane" item-title="Aircraft 3" item-subtitle="Planes, helicopters, and jets">Planes, helicopters, and jets content</calcite-accordion-item>
</calcite-accordion>
</main>
</body>
<script>
window.onload = () => {
// Theme Switcher
const themeSwitch = document.getElementById("theme-switch");
themeSwitch.addEventListener("calciteSwitchChange", () => {
document.body.classList.toggle("calcite-theme-dark");
});
};
</script>
</html>