@dorsk/tsumikit 0.67.1 → 0.68.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/README.md +96 -3
- package/dist/components/atoms/Button.svelte +111 -3
- package/dist/components/atoms/Button.svelte.d.ts +4 -0
- package/dist/components/layouts/NavBar.svelte +184 -30
- package/dist/components/layouts/NavBar.svelte.d.ts +19 -3
- package/dist/components/molecules/GlyphStack.svelte +12 -19
- package/dist/components/molecules/RadialMenu.svelte +579 -0
- package/dist/components/molecules/RadialMenu.svelte.d.ts +42 -0
- package/dist/components/molecules/SegmentedControl.svelte +6 -3
- package/dist/components/molecules/SegmentedControl.svelte.d.ts +4 -2
- package/dist/components/molecules/SortableList.svelte +720 -0
- package/dist/components/molecules/SortableList.svelte.d.ts +116 -0
- package/dist/components/molecules/segmented-control-count.d.ts +2 -0
- package/dist/components/molecules/segmented-control-count.js +6 -0
- package/dist/components/molecules/sortable-list-order.d.ts +68 -0
- package/dist/components/molecules/sortable-list-order.js +133 -0
- package/dist/floating.d.ts +38 -0
- package/dist/floating.js +38 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/slide-select.d.ts +26 -0
- package/dist/slide-select.js +53 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface RadialArc {
|
|
2
|
+
/** Degrees, 0 = right, counter-clockwise. */
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
}
|
|
6
|
+
import { type Snippet } from 'svelte';
|
|
7
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
8
|
+
import { type IconName } from '../atoms/Icon.svelte';
|
|
9
|
+
import type { MenuItem } from './Menu.svelte';
|
|
10
|
+
import { type Tone } from '../../tone';
|
|
11
|
+
type Own = {
|
|
12
|
+
items: MenuItem[];
|
|
13
|
+
/** Accessible name of the trigger and the menu. */
|
|
14
|
+
label: string;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
onopen?: () => void;
|
|
17
|
+
onclose?: () => void;
|
|
18
|
+
/** Replaces the default FAB content. */
|
|
19
|
+
trigger?: Snippet<[{
|
|
20
|
+
open: boolean;
|
|
21
|
+
}]>;
|
|
22
|
+
icon?: IconName;
|
|
23
|
+
closeIcon?: IconName;
|
|
24
|
+
/** Small line under the FAB glyph ("● bot"). */
|
|
25
|
+
caption?: Snippet | string;
|
|
26
|
+
/** Colour of the FAB ring. */
|
|
27
|
+
tone?: Tone;
|
|
28
|
+
arc?: RadialArc;
|
|
29
|
+
/** Preferred arc radius; defaults to `--radial-radius`, else 8.5rem. */
|
|
30
|
+
radius?: string;
|
|
31
|
+
/** Petal diameter; defaults to `--radial-petal-size`, else 3.5rem. */
|
|
32
|
+
petalSize?: string;
|
|
33
|
+
scrim?: boolean;
|
|
34
|
+
/** A line centred above the arc while open. */
|
|
35
|
+
status?: Snippet;
|
|
36
|
+
class?: string;
|
|
37
|
+
style?: string;
|
|
38
|
+
};
|
|
39
|
+
type $$ComponentProps = Omit<HTMLButtonAttributes, keyof Own> & Own;
|
|
40
|
+
declare const RadialMenu: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
41
|
+
type RadialMenu = ReturnType<typeof RadialMenu>;
|
|
42
|
+
export default RadialMenu;
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
value: string;
|
|
4
4
|
/** Visible text. Optional in `icon` mode where the icon carries the meaning. */
|
|
5
5
|
label?: string;
|
|
6
|
-
/** Optional count badge rendered after the label (filter-pill use).
|
|
7
|
-
|
|
6
|
+
/** Optional count badge rendered after the label (filter-pill use). Numbers
|
|
7
|
+
* get thousands separators (`11178` → `11,178`, fixed en-US so SSR and
|
|
8
|
+
* hydration agree); strings render verbatim (`'99+'`, another locale). */
|
|
9
|
+
count?: number | string;
|
|
8
10
|
/** Icon glyph — required for icon-toggle mode, optional alongside a label. */
|
|
9
11
|
icon?: import('../atoms/Icon.svelte').IconName;
|
|
10
12
|
/** Greyed out, not selectable, skipped by keyboard navigation. */
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
// Space/Enter (or click) activate. `value` is bindable.
|
|
24
26
|
import type { Snippet } from 'svelte';
|
|
25
27
|
import Icon from '../atoms/Icon.svelte';
|
|
28
|
+
import { formatSegmentCount } from './segmented-control-count.js';
|
|
26
29
|
import { nextEnabledSegment } from './segmented-control-keyboard.js';
|
|
27
30
|
|
|
28
31
|
let {
|
|
@@ -143,7 +146,7 @@
|
|
|
143
146
|
{:else}
|
|
144
147
|
{#if o.icon}<Icon name={o.icon} />{/if}
|
|
145
148
|
{#if o.label}<span class="seg-label">{o.label}</span>{/if}
|
|
146
|
-
{#if o.count !== undefined}<span class="seg-count">{o.count}</span>{/if}
|
|
149
|
+
{#if o.count !== undefined}<span class="seg-count">{formatSegmentCount(o.count)}</span>{/if}
|
|
147
150
|
{/if}
|
|
148
151
|
</button>
|
|
149
152
|
{/each}
|
|
@@ -2,8 +2,10 @@ export interface SegmentOption {
|
|
|
2
2
|
value: string;
|
|
3
3
|
/** Visible text. Optional in `icon` mode where the icon carries the meaning. */
|
|
4
4
|
label?: string;
|
|
5
|
-
/** Optional count badge rendered after the label (filter-pill use).
|
|
6
|
-
|
|
5
|
+
/** Optional count badge rendered after the label (filter-pill use). Numbers
|
|
6
|
+
* get thousands separators (`11178` → `11,178`, fixed en-US so SSR and
|
|
7
|
+
* hydration agree); strings render verbatim (`'99+'`, another locale). */
|
|
8
|
+
count?: number | string;
|
|
7
9
|
/** Icon glyph — required for icon-toggle mode, optional alongside a label. */
|
|
8
10
|
icon?: import('../atoms/Icon.svelte').IconName;
|
|
9
11
|
/** Greyed out, not selectable, skipped by keyboard navigation. */
|