@poodle64/ui 2026.11.10 → 2026.11.11
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" generics="G extends string">
|
|
2
2
|
/**
|
|
3
3
|
* The list's Columns menu, the one place a viewer reshapes a list: every
|
|
4
|
-
* column it offers as a tick, then how its rows group. The Ledger's groups
|
|
4
|
+
* column it offers as a tick, then how its rows group, one choice a row as the ticks above are, so no label truncates or overlaps. A choice is named for what it groups by ("Letter"): the heading says "Group by". The Ledger's groups
|
|
5
5
|
* are periods (and its running balance one more column, always last); a
|
|
6
6
|
* RecordList's are the groupings its module offers. Sort is the heads'. An
|
|
7
7
|
* icon button named by its tooltip.
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
import { Button, buttonVariants } from '../button/index.js';
|
|
11
11
|
import { Checkbox } from '../checkbox/index.js';
|
|
12
12
|
import * as Popover from '../popover/index.js';
|
|
13
|
-
import {
|
|
13
|
+
import { RadioGroup } from 'bits-ui';
|
|
14
|
+
import Check from '@lucide/svelte/icons/check';
|
|
14
15
|
import * as Tooltip from '../tooltip/index.js';
|
|
15
16
|
import { cn } from '../../../utils.js';
|
|
16
17
|
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
columns: string[];
|
|
31
32
|
/** How the rows group: the choices, the one in force, and what it does. */
|
|
32
33
|
grouping?: {
|
|
33
|
-
options: readonly
|
|
34
|
+
options: readonly { value: G; label: string }[];
|
|
34
35
|
value: G;
|
|
35
36
|
hint?: string;
|
|
36
37
|
onchange: (value: G) => void;
|
|
@@ -52,8 +53,13 @@
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
const eyebrow = 'text-muted-foreground text-2xs tracking-eyebrow font-semibold uppercase';
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// The heading says "Group by", so a choice that repeats it reads twice.
|
|
57
|
+
$effect(() => {
|
|
58
|
+
if (grouping?.options.some((o) => /^group by\b/i.test(o.label)))
|
|
59
|
+
console.warn(
|
|
60
|
+
'Columns menu: grouping labels sit under a "Group by" heading; name the grouping ("Letter"), not "Group by letter".'
|
|
61
|
+
);
|
|
62
|
+
});
|
|
57
63
|
</script>
|
|
58
64
|
|
|
59
65
|
<Popover.Root bind:open>
|
|
@@ -104,12 +110,23 @@
|
|
|
104
110
|
data-slot="{owner}-grouping"
|
|
105
111
|
>
|
|
106
112
|
<span class={eyebrow}>Group by</span>
|
|
107
|
-
<
|
|
108
|
-
label="Group by"
|
|
109
|
-
|
|
110
|
-
bind:value={() => g.value, (value) => g.onchange(value)}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
<RadioGroup.Root
|
|
114
|
+
aria-label="Group by"
|
|
115
|
+
class="-mx-1.5 flex flex-col"
|
|
116
|
+
bind:value={() => g.value, (value) => g.onchange(value as G)}
|
|
117
|
+
>
|
|
118
|
+
{#each g.options as o (o.value)}
|
|
119
|
+
<RadioGroup.Item
|
|
120
|
+
value={o.value}
|
|
121
|
+
class="hover:bg-accent/50 data-[state=checked]:text-foreground text-muted-foreground flex min-h-8 cursor-pointer items-center gap-2.5 rounded-md px-1.5 py-1 text-left text-sm break-words data-[state=checked]:font-medium"
|
|
122
|
+
>
|
|
123
|
+
<span class="flex size-4 shrink-0 items-center justify-center">
|
|
124
|
+
{#if g.value === o.value}<Check class="size-4" />{/if}
|
|
125
|
+
</span>
|
|
126
|
+
<span class="min-w-0 flex-1">{o.label}</span>
|
|
127
|
+
</RadioGroup.Item>
|
|
128
|
+
{/each}
|
|
129
|
+
</RadioGroup.Root>
|
|
113
130
|
{#if g.hint}<span class="text-muted-foreground text-xs">{g.hint}</span>{/if}
|
|
114
131
|
</div>
|
|
115
132
|
{/if}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type SegmentedOption } from '../segmented/index.js';
|
|
2
1
|
declare function $$render<G extends string>(): {
|
|
3
2
|
props: {
|
|
4
3
|
/** The columns to tick; none, and the menu holds only the grouping. */
|
|
@@ -11,7 +10,10 @@ declare function $$render<G extends string>(): {
|
|
|
11
10
|
columns: string[];
|
|
12
11
|
/** How the rows group: the choices, the one in force, and what it does. */
|
|
13
12
|
grouping?: {
|
|
14
|
-
options: readonly
|
|
13
|
+
options: readonly {
|
|
14
|
+
value: G;
|
|
15
|
+
label: string;
|
|
16
|
+
}[];
|
|
15
17
|
value: G;
|
|
16
18
|
hint?: string;
|
|
17
19
|
onchange: (value: G) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poodle64/ui",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.11",
|
|
4
4
|
"description": "Household shared component layer: shadcn-svelte primitives (bits-ui) plus the composed page chrome every app builds its routes from, restyled by each app's @poodle64/design-tokens alias layer. One fix reaches every app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @poodle64/ui — situation → component map
|
|
2
2
|
|
|
3
3
|
<!-- GENERATED by scripts/generate-registry.mjs from scripts/situations.json + package source. DO NOT EDIT. -->
|
|
4
|
-
Generated from `@poodle64/ui@2026.11.
|
|
4
|
+
Generated from `@poodle64/ui@2026.11.11`. 76 components, 20 situations.
|
|
5
5
|
|
|
6
6
|
**Read this before writing a `<div>`.** Find the SITUATION you are in below, then compose the component named for it — do not hand-build it from raw `Card` or utility classes. Import is `import { Name } from '<import path>'`. Props marked `?` are optional. This map is the retrieval step the [`design-frontend` skill] makes mandatory; the [CHI 2026 study] measured composing-from-a-registry at 95% design-system compliance against 71% for writing the CSS from a prose style guide.
|
|
7
7
|
|