@marianmeres/stuic 3.80.1 → 3.82.0

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.
@@ -104,6 +104,8 @@ Only one item can be open at a time:
104
104
  | `--stuic-accordion-trigger-font-weight` | `--font-weight-medium` | Trigger text weight |
105
105
  | `--stuic-accordion-trigger-bg` | `transparent` | Trigger background |
106
106
  | `--stuic-accordion-trigger-bg-hover` | muted mix | Trigger hover background |
107
+ | `--stuic-accordion-chevron-size` | `16px` | Chevron icon size |
108
+ | `--stuic-accordion-chevron-color` | `currentColor` | Chevron icon color |
107
109
  | `--stuic-accordion-content-padding-x` | `1rem` | Content horizontal padding |
108
110
  | `--stuic-accordion-content-padding-y` | `0.75rem` | Content vertical padding |
109
111
  | `--stuic-accordion-ring-width` | `2px` | Focus ring width |
@@ -21,6 +21,10 @@
21
21
  transparent
22
22
  );
23
23
 
24
+ /* Chevron */
25
+ --stuic-accordion-chevron-size: 16px;
26
+ --stuic-accordion-chevron-color: currentColor;
27
+
24
28
  /* Content */
25
29
  --stuic-accordion-content-padding-x: 1rem;
26
30
  --stuic-accordion-content-padding-y: 0.75rem;
@@ -89,6 +93,9 @@
89
93
 
90
94
  .stuic-accordion-chevron {
91
95
  flex-shrink: 0;
96
+ width: var(--stuic-accordion-chevron-size);
97
+ height: var(--stuic-accordion-chevron-size);
98
+ color: var(--stuic-accordion-chevron-color);
92
99
  transition: transform var(--stuic-accordion-transition, var(--stuic-transition));
93
100
  }
94
101
 
@@ -38,7 +38,7 @@
38
38
  import type { AssetPreviewNormalized } from "../AssetsPreview/_internal/assets-preview-types.js";
39
39
  import AssetsPreviewInline from "../AssetsPreview/AssetsPreviewInline.svelte";
40
40
  import Button from "../Button/Button.svelte";
41
- import IconSwap from "../IconSwap/IconSwap.svelte";
41
+ import ButtonGroupRadio from "../ButtonGroupRadio/ButtonGroupRadio.svelte";
42
42
  import { bookPagesToAssets } from "./_internal/book-pages-to-assets.js";
43
43
  import Book, {
44
44
  buildSpreads,
@@ -105,15 +105,6 @@
105
105
  );
106
106
 
107
107
  const MODE_SWITCH_ICON_SIZE = 19;
108
- const modeSwitchStates = [
109
- iconBookOpen({ size: MODE_SWITCH_ICON_SIZE, strokeWidth: 2 }),
110
- iconFileImage({ size: MODE_SWITCH_ICON_SIZE, strokeWidth: 2 }),
111
- ];
112
- let modeSwitchActive = $derived(useInline ? 1 : 0);
113
-
114
- function toggleMode() {
115
- manualMode = useInline ? "book" : "inline";
116
- }
117
108
 
118
109
  let inlineAssets = $derived(useInline ? bookPagesToAssets(pages, baseUrl) : []);
119
110
 
@@ -393,17 +384,27 @@
393
384
  {/if}
394
385
  {/if}
395
386
  {#if !noModeSwitch && !forceInline && !belowThreshold && pages.length > 0}
396
- <Button
397
- type="button"
398
- iconButton
399
- class="absolute bottom-4 right-4 border-0"
400
- onclick={toggleMode}
401
- tooltip={() => ({
402
- content: useInline ? "Switch to book view" : "Switch to inline view",
387
+ <ButtonGroupRadio
388
+ size="sm"
389
+ class="absolute bottom-4 right-4 w-auto"
390
+ value={useInline ? "inline" : "book"}
391
+ options={[
392
+ {
393
+ label: iconBookOpen({ size: MODE_SWITCH_ICON_SIZE, strokeWidth: 2 }),
394
+ value: "book",
395
+ },
396
+ {
397
+ label: iconFileImage({ size: MODE_SWITCH_ICON_SIZE, strokeWidth: 2 }),
398
+ value: "inline",
399
+ },
400
+ ]}
401
+ buttonProps={(i) => ({
402
+ tooltip: () => ({ content: i === 0 ? "Book view" : "Inline view" }),
403
403
  })}
404
- >
405
- <IconSwap states={modeSwitchStates} active={modeSwitchActive} duration={200} />
406
- </Button>
404
+ onButtonClick={(i) => {
405
+ manualMode = i === 0 ? "book" : "inline";
406
+ }}
407
+ />
407
408
  {/if}
408
409
  </div>
409
410
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "3.80.1",
3
+ "version": "3.82.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && pnpm run prepack",
@@ -79,7 +79,7 @@
79
79
  "vitest": "^3.2.4"
80
80
  },
81
81
  "dependencies": {
82
- "@marianmeres/clog": "^3.18.1",
82
+ "@marianmeres/clog": "^3.19.0",
83
83
  "@marianmeres/cron": "^2.0.0",
84
84
  "@marianmeres/design-tokens": "^1.4.1",
85
85
  "@marianmeres/icons-fns": "^5.0.0",
@@ -88,7 +88,7 @@
88
88
  "@marianmeres/parse-boolean": "^2.1.0",
89
89
  "@marianmeres/ticker": "^1.17.1",
90
90
  "@marianmeres/tree": "^2.3.0",
91
- "libphonenumber-js": "^1.13.0",
91
+ "libphonenumber-js": "^1.13.1",
92
92
  "runed": "^0.23.4",
93
93
  "tailwind-merge": "^3.6.0"
94
94
  }