picocrank 1.25.0 → 1.25.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.
@@ -62,6 +62,17 @@
62
62
  />
63
63
  </FormField>
64
64
 
65
+ <FormField label="Theme switcher" fake>
66
+ <RadioGroup
67
+ name="ps-theme-switcher"
68
+ variant="boolean"
69
+ aria-label="Theme switcher"
70
+ :model-value="themeSwitcherEnabled"
71
+ :options="showHideOptions"
72
+ @update:model-value="setThemeSwitcherEnabled"
73
+ />
74
+ </FormField>
75
+
65
76
  <FormField label="Top bar" fake>
66
77
  <div>
67
78
  <RadioGroup
@@ -170,6 +181,8 @@ const dummySearchFetchEnabled = inject('dummySearchFetchEnabled')
170
181
  const toggleDummySearchFetchEnabled = inject('toggleDummySearchFetchEnabled')
171
182
  const themeToggleEnabled = inject('themeToggleEnabled')
172
183
  const toggleThemeToggleEnabled = inject('toggleThemeToggleEnabled')
184
+ const themeSwitcherEnabled = inject('themeSwitcherEnabled')
185
+ const toggleThemeSwitcherEnabled = inject('toggleThemeSwitcherEnabled')
173
186
  const topBarEnabled = inject('topBarEnabled')
174
187
  const toggleTopBarEnabled = inject('toggleTopBarEnabled')
175
188
  const breadcrumbsEnabled = inject('breadcrumbsEnabled')
@@ -200,6 +213,10 @@ function setThemeToggleEnabled(want) {
200
213
  setFlag(themeToggleEnabled, toggleThemeToggleEnabled, want)
201
214
  }
202
215
 
216
+ function setThemeSwitcherEnabled(want) {
217
+ setFlag(themeSwitcherEnabled, toggleThemeSwitcherEnabled, want)
218
+ }
219
+
203
220
  function setTopBarEnabled(want) {
204
221
  setFlag(topBarEnabled, toggleTopBarEnabled, want)
205
222
  }
@@ -8,24 +8,24 @@
8
8
  optionally <code>supplemental-themes/</code> (Catppuccin, Dracula / Alucard, Gruvbox, waffles). Drop a folder
9
9
  in and restart the dev server (or rebuild); PicoCrank discovers themes from
10
10
  <code>index.json</code> and applies them with <code>useCustomTheme()</code> or
11
- <code>ThemeSwitcher</code>. Supplemental themes are bundled by default but only
11
+ <code>ThemeSwitcher</code> in the examples app header toolbar. Supplemental themes are bundled by default but only
12
12
  listed when <code>include-supplemental-themes</code> is enabled.
13
13
  </p>
14
14
 
15
- <ThemeSwitcher
16
- class="theme-switcher-block"
17
- :include-supplemental-themes="true"
18
- @change="onThemeChange"
19
- />
20
-
21
- <p v-if="availableThemes.length === 0" class="subtle">
22
- No drop-in themes found. Add <code>public/themes/&lt;name&gt;/theme.css</code>
23
- or enable supplemental themes on <code>ThemeSwitcher</code>.
24
- </p>
25
- <p v-else class="subtle">
15
+ <p class="subtle">
16
+ Use the theme dropdown in the header (next to the light/dark toggle) to switch drop-in themes.
26
17
  Preference is stored in localStorage and applies across the whole examples site.
27
- Light/dark mode (header sun/moon) switches Femtocrank defaults, or the dual-variant supplemental themes when active.
18
+ Light/dark mode switches Femtocrank defaults, or the dual-variant supplemental themes when active.
28
19
  </p>
20
+
21
+ <button
22
+ type="button"
23
+ class="neutral open-theme-switcher-button"
24
+ :disabled="!themeSwitcherEnabled"
25
+ @click="openThemeSwitcher"
26
+ >
27
+ Open theme switcher
28
+ </button>
29
29
  </Section>
30
30
 
31
31
  <Section title="Buttons" subtitle="Default and karma variants">
@@ -106,28 +106,49 @@
106
106
  <td><code>--karma-*</code></td>
107
107
  <td>Status backgrounds and accents</td>
108
108
  </tr>
109
+ <tr>
110
+ <td><code>--link-color</code></td>
111
+ <td>Links, active tabs, sort/filter column headers</td>
112
+ </tr>
113
+ <tr>
114
+ <td><code>--muted-text-color</code></td>
115
+ <td>Secondary text and inactive tab labels</td>
116
+ </tr>
117
+ <tr>
118
+ <td><code>--header-fg-color</code></td>
119
+ <td>Header chrome text and icons</td>
120
+ </tr>
121
+ <tr>
122
+ <td><code>--input-bg-color</code> / <code>--input-fg-color</code></td>
123
+ <td>Form fields</td>
124
+ </tr>
109
125
  </tbody>
110
126
  </table>
111
127
  </Section>
112
128
  </template>
113
129
 
114
130
  <script setup>
131
+ import { inject } from 'vue'
115
132
  import Section from '../components/Section.vue'
116
- import ThemeSwitcher from '../components/ThemeSwitcher.vue'
117
133
  import FormLayout from '../components/FormLayout.vue'
118
134
  import FormField from '../components/FormField.vue'
119
- import { useCustomTheme } from '../composables/useCustomTheme.js'
135
+ import { HEADER_THEME_SWITCHER_SELECT_ID } from '../components/ThemeSwitcher.vue'
120
136
 
121
- const { availableThemes } = useCustomTheme()
137
+ const themeSwitcherEnabled = inject('themeSwitcherEnabled')
122
138
 
123
- function onThemeChange() {
124
- // ThemeSwitcher updates shared useCustomTheme state.
139
+ function openThemeSwitcher() {
140
+ const select = document.getElementById(HEADER_THEME_SWITCHER_SELECT_ID)
141
+ if (!(select instanceof HTMLSelectElement)) {
142
+ return
143
+ }
144
+ select.focus()
145
+ select.scrollIntoView({ block: 'nearest', inline: 'nearest' })
125
146
  }
126
147
  </script>
127
148
 
128
149
  <style scoped>
129
- .theme-switcher-block {
130
- margin: 1rem 0;
150
+ .open-theme-switcher-button {
151
+ margin-top: 0.75rem;
131
152
  }
132
153
 
133
154
  .preview-row {