@scattered-light/loomiere-mojave 0.24.0 → 0.25.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.
- package/dist/exports/AGENTS.md +1 -1
- package/dist/exports/catalog.json +6 -0
- package/dist/exports/design-system/README.md +1 -1
- package/dist/exports/design-system/components/Badge/README.md +2 -1
- package/dist/exports/design-system/components/Badge/preview.html +457 -1
- package/dist/exports/design-system/components/ChecklistNotice/README.md +49 -0
- package/dist/exports/design-system/components/ChecklistNotice/preview.html +475 -0
- package/dist/exports/design-system/components/DataList/preview.html +1 -1
- package/dist/exports/design-system/components/DataTable/README.md +2 -1
- package/dist/exports/design-system/components/DataTable/preview.html +101 -101
- package/dist/exports/design-system/components/EmptyState/README.md +16 -2
- package/dist/exports/design-system/components/EmptyState/preview.html +170 -170
- package/dist/exports/design-system/components/LineItemGrid/README.md +50 -0
- package/dist/exports/design-system/components/LineItemGrid/preview.html +475 -0
- package/dist/exports/design-system/components/ParameterBar/README.md +68 -0
- package/dist/exports/design-system/components/ParameterBar/preview.html +475 -0
- package/dist/exports/design-system/components/bundle.css +675 -68
- package/dist/exports/design-system/components/bundle.js +7 -7
- package/dist/exports/design-system/components/index.d.ts +4 -23
- package/package.json +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# ParameterBar
|
|
2
|
+
|
|
3
|
+
The Base UI ParameterBar styled by the theme. Settings for a result, in one wrapping row on the tray: the app's fields at the start, the status line, the Run button and any extra actions at the end. Fields align on their controls (align-items: flex-end), so a field with a description does not push its neighbours' inputs down. When the bar is narrow the end group wraps onto its own line, at the start. data-changed (a setting changed since the last run) turns the status line to the warning text color. The bar itself does not dim anything; the app dims its own stale result. ParameterBarLocked is a fixed setting: the field label over the value as text with a lock, on no box, at the control's height so it lines up with the inputs beside it.
|
|
4
|
+
|
|
5
|
+
Use `Loomiere.ParameterBar` (`import { ParameterBar } from '@base-ui/react/parameter-bar'` in an app) and give each part the class below; the styles target those classes, not Base UI's own markup.
|
|
6
|
+
|
|
7
|
+
Base UI docs: https://base-ui.com/react/components/parameter-bar
|
|
8
|
+
|
|
9
|
+
## Classes
|
|
10
|
+
|
|
11
|
+
| Class | Data attributes it answers to |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `ParameterBar` | `data-changed` |
|
|
14
|
+
| `ParameterBarFields` | |
|
|
15
|
+
| `FieldRoot` | |
|
|
16
|
+
| `ParameterBarEnd` | |
|
|
17
|
+
| `ParameterBarStatus` | |
|
|
18
|
+
| `ParameterBarLocked` | |
|
|
19
|
+
| `ParameterBarLockedValue` | |
|
|
20
|
+
| `ParameterBarLockedText` | |
|
|
21
|
+
|
|
22
|
+
Base UI sets the state attributes (`data-checked`, `data-open`, `data-disabled`...) itself. Set `data-size`, `data-emphasis`, `data-variant` and `data-color` yourself; `data-color` takes any palette name (`primary`, `secondary`, `error`...) and repaints the part in it.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
From the ParameterBar stories (`Default`):
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
args: { label: 'Report settings', onRun: () => undefined },
|
|
31
|
+
render: function Render() {
|
|
32
|
+
const [asOf, setAsOf] = React.useState('2026-10-31');
|
|
33
|
+
const [ran, setRan] = React.useState<string | null>(null);
|
|
34
|
+
const changed = ran !== null && ran !== asOf;
|
|
35
|
+
return (
|
|
36
|
+
<div style={{ display: 'grid', gap: 'var(--sl-space-4)' }}>
|
|
37
|
+
<ParameterBar
|
|
38
|
+
label="Report settings"
|
|
39
|
+
onRun={() => setRan(asOf)}
|
|
40
|
+
runLabel="Run"
|
|
41
|
+
changed={changed}
|
|
42
|
+
status={ran === null ? 'Not run yet' : `Ran for ${ran}`}
|
|
43
|
+
>
|
|
44
|
+
<Field.Root>
|
|
45
|
+
<Field.Label>As of</Field.Label>
|
|
46
|
+
<Input type="date" value={asOf} onChange={(event) => setAsOf(event.target.value)} />
|
|
47
|
+
</Field.Root>
|
|
48
|
+
<Field.Root>
|
|
49
|
+
<Field.Label>Minimum amount</Field.Label>
|
|
50
|
+
<Input inputMode="decimal" placeholder="No minimum" />
|
|
51
|
+
</Field.Root>
|
|
52
|
+
</ParameterBar>
|
|
53
|
+
<div style={{ opacity: changed ? 0.5 : 1 }}>{ran ? `Balance Sheet as of ${ran}` : 'The report appears here.'}</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
play: async ({ canvasElement }) => {
|
|
58
|
+
const canvas = within(canvasElement);
|
|
59
|
+
await expect(canvas.getByRole('status')).toHaveTextContent('Not run yet');
|
|
60
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Run' }));
|
|
61
|
+
await expect(canvas.getByRole('status')).toHaveTextContent('Ran for 2026-10-31');
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** A setting the page fixes, such as an Entity report locked to its Entity: text with a lock, not a disabled control. */
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The preview also shows `LockedField`, `Narrow`.
|