picocrank 1.6.0 → 1.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocrank",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A set of zero dependency Vue components built on the Femtocrank global CSS theme.",
5
5
  "main": "vite.config.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@
7
7
  <div class = "fg1" />
8
8
 
9
9
  <button id = "sidebar-toggler-button" aria-label = "Open sidebar navigation" aria-pressed = "false" aria-haspopup = "menu" class = "neutral">
10
- <HugeiconsIcon :icon = "Menu01Icon" width = "1em" height = "1em" />
10
+ <HugeiconsIcon :icon = "Menu01Icon" width = "1em" height = "1em" :strokeWidth = 3 />
11
11
  </button>
12
12
  </div>
13
13
 
@@ -55,6 +55,11 @@
55
55
 
56
56
  <style scoped>
57
57
  button {
58
- color: #bbb;
58
+ border: 0;
59
+ color: #fff;
59
60
  }
60
- </style>
61
+
62
+ button:hover {
63
+ background-color: transparent;
64
+ }
65
+ </style>
@@ -39,3 +39,35 @@ const props = defineProps({
39
39
  },
40
40
  });
41
41
  </script>
42
+
43
+ <style scoped>
44
+ :slotted(button):not(.good),
45
+ :slotted(.button):not(.good)
46
+ {
47
+ background-color: white;
48
+ }
49
+
50
+ :slotted(button:hover):not(.good),
51
+ :slotted(.button:hover):not(.good)
52
+ {
53
+ background-color: #f0f0f0;
54
+ }
55
+
56
+ @media (prefers-color-scheme: dark) {
57
+ :slotted(button):not(.good),
58
+ :slotted(.button):not(.good)
59
+ {
60
+ background-color: #111;
61
+ border: 1px solid #222;
62
+ color: #fff;
63
+ }
64
+
65
+ :slotted(button:hover):not(.good),
66
+ :slotted(.button:hover):not(.good)
67
+ {
68
+ background-color: #222;
69
+ border: 1px solid #333;
70
+ color: #fff;
71
+ }
72
+ }
73
+ </style>
@@ -5,10 +5,10 @@
5
5
  <div class = "fg1" />
6
6
  <button class="stick-toggle" :aria-pressed="isStuck" :title="isStuck ? 'Unstick sidebar' : 'Stick sidebar'" @click="toggleStick">
7
7
  <span v-if="isStuck">
8
- <HugeiconsIcon :icon="Pin02Icon" width = "1em" height = "1em" />
8
+ <HugeiconsIcon :icon="Pin02Icon" width = "1em" height = "1em" :strokeWidth = 3 />
9
9
  </span>
10
10
  <span v-else>
11
- <HugeiconsIcon :icon="PinIcon" width = "1em" height = "1em" />
11
+ <HugeiconsIcon :icon="PinIcon" width = "1em" height = "1em" :strokeWidth = 3 />
12
12
  </span>
13
13
  </button>
14
14
  </div>
@@ -24,6 +24,7 @@
24
24
  <span>{{ link.title }}</span>
25
25
  </a>
26
26
  </div>
27
+ <div v-else-if="link.type === 'html'" v-html="link.html"></div>
27
28
  <router-link v-else :to="link.path" :class="{ active: isActive(link.path) }">
28
29
  <HugeiconsIcon :icon="link.icon" />
29
30
  <span>{{ link.title }}</span>
@@ -94,6 +95,16 @@ function addSeparator(id) {
94
95
  addNavigationLink(separator)
95
96
  }
96
97
 
98
+ function addHtml(html, options = {}) {
99
+ const htmlLink = {
100
+ name: options.name || `html-item-${Date.now()}`,
101
+ type: 'html',
102
+ html: html,
103
+ title: options.title || 'HTML Item'
104
+ }
105
+ addNavigationLink(htmlLink)
106
+ }
107
+
97
108
  function removeNavigationLink(linkId) {
98
109
  navigationLinks.value = navigationLinks.value.filter(link => link.id !== linkId)
99
110
  }
@@ -150,6 +161,7 @@ defineExpose({
150
161
  addRouterLink,
151
162
  addCallback,
152
163
  addSeparator,
164
+ addHtml,
153
165
  removeNavigationLink,
154
166
  clearNavigationLinks,
155
167
  getNavigationLinks,
@@ -171,6 +183,10 @@ li {
171
183
  padding: 0;
172
184
  }
173
185
 
186
+ button {
187
+ border: 0;
188
+ }
189
+
174
190
  .navigation-links a {
175
191
  display: flex;
176
192
  align-items: center;
package/vue/views/App.vue CHANGED
@@ -51,6 +51,7 @@
51
51
  sidebar.value.addSeparator('separator-2');
52
52
  sidebar.value.addCallback('Hello World', helloWorld, { icon: Pin02Icon })
53
53
  sidebar.value.addSeparator('separator-3');
54
+ sidebar.value.addHtml('<h2 style = "padding: 0.75em;">Administration</h2>', { name: 'admin-heading' })
54
55
  sidebar.value.addRouterLink('Admin')
55
56
  sidebar.value.open();
56
57
  sidebar.value.stick();
@@ -10,6 +10,14 @@
10
10
  </Section>
11
11
 
12
12
  <Section title = "Lorum" id = "lorem">
13
+ <template #toolbar>
14
+ <button>
15
+ <HugeiconsIcon :icon = "HighlighterIcon" width = "1em" height = "1em" />
16
+ Highlight</button>
17
+ <button>Quote</button>
18
+ <button class = "good">Add</button>
19
+ </template>
20
+
13
21
  <p>
14
22
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
15
23
  Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
@@ -52,4 +60,6 @@
52
60
 
53
61
  <script setup>
54
62
  import Section from '../components/Section.vue';
63
+ import { HugeiconsIcon } from '@hugeicons/vue';
64
+ import { HighlighterIcon } from '@hugeicons/core-free-icons';
55
65
  </script>