@synopackageland/ui 0.17.4 → 0.17.6

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.
@@ -24,6 +24,7 @@ are in [dsm-native-metrics.md](dsm-native-metrics.md).
24
24
  | Notification | `Notification` `confirm` / `cancel` | capsule | Cancel `secondary`, then the action `primary` |
25
25
  | Toolbar | `AppToolbar`, a row above a list | tool | `secondary`; `SplitButton` for Create and its variants |
26
26
  | Page header | `PageHeader` `#actions` | tool | one refresh `IconButton` per page |
27
+ | Tab row | `SectionTabs` `#actions` | tool | `secondary`, for the shown section (Export, Check again) |
27
28
  | Section or card | `SettingsSection` / `Card` body, `#actions`, `#footer` | tool | `secondary`; a Save / Cancel row there goes in `FormActions` |
28
29
  | Beside a field | `InputGroup` | tool | `secondary` (Open, Copy, Test) |
29
30
  | Row of a list or grid | `ListItem` `#actions`, an `actions` column | tool | `IconButton` with a `label` |
@@ -66,6 +66,8 @@ These rules keep pages built from `@synopackageland/ui` consistent. The componen
66
66
  ## Status
67
67
 
68
68
  - Show a headline number (space freed, files moved) with `Statistic`: `label`, `value`, optional `note`; `size="lg"` for the one number a page leads with. Put several in `Surface`s in a grid. Do not set font sizes for figures.
69
+ - A row of counts that also filters the page (Online, Outdated, Failed) is a `StatTileGroup` of `StatTile`s, each with a `filter` key; the group's model is the filters that are on. A single filter tile takes `v-model`. Do not style buttons as tiles.
70
+ - Show how a whole splits up (a volume by content, devices by read status) with `StackedBar`: one bar, a legend with the sizes, and one accessible name for all of it.
69
71
  - Colour a usage bar by meaning with `Progress tone` (`warning` when nearly full) rather than drawing your own bar.
70
72
  - Show a state as a `Badge` in a `KeyValueRow`, not as a sentence. A toned badge leads with a dot; keep `neutral` for plain values such as a version.
71
73
  - A passing result ("Settings applied") is a toast; a Callout is for something the user has to act on or a short risk note, with one title, one line and one action ([callout](callout.md)).
@@ -1,8 +1,9 @@
1
- # SplitPane, SizeBar and StorageMeter
1
+ # SplitPane, SizeBar, StorageMeter and StackedBar
2
2
 
3
- Three building blocks for storage pages: two panes the user resizes, a size
4
- bar for a list row, and a "free now → free after" projection. All three are
5
- styled with classes only and work inside the DSM-embedded theme.
3
+ Building blocks for storage pages: two panes the user resizes, a size bar for
4
+ a list row, a "free now → free after" projection, and a bar of the parts of a
5
+ whole. All are styled with classes only and work inside the DSM-embedded
6
+ theme.
6
7
 
7
8
  ## SplitPane
8
9
 
@@ -94,3 +95,43 @@ part use `--ui-primary`. Hooks: `data-ui-storage-meter`,
94
95
  `data-ui-storage-meter-now`, `data-ui-storage-meter-after`,
95
96
  `data-ui-storage-meter-used`, `data-ui-storage-meter-freeing`
96
97
  (`data-at-least`).
98
+
99
+ ## StackedBar
100
+
101
+ One 6px bar of the parts of a whole, with a legend of their sizes under it.
102
+ With `total` it shows capacity: the parts against the volume's size, the rest
103
+ as free space. Without it, it shows composition: the parts fill the bar.
104
+
105
+ ```vue
106
+ <StackedBar
107
+ label="Volume 1"
108
+ :total="volume.size"
109
+ :segments="[
110
+ { label: 'Photos', value: photos, tone: 'primary' },
111
+ { label: 'Backups', value: backups, color: 'var(--ui-accent-7)' },
112
+ { label: 'Snapshots', value: snapshots, tone: 'warning' },
113
+ ]"
114
+ />
115
+ <StackedBar label="Read coverage" :segments="coverage" :format="n => `${n} devices`" />
116
+ ```
117
+
118
+ | Prop | Default | Meaning |
119
+ | --- | --- | --- |
120
+ | `segments` | required | `{ label, value, tone?, color?, key? }[]`. `tone` is `primary` (default), `info`, `success`, `warning`, `danger` or `neutral`; `color` (any CSS colour) wins over it; `key` names the part in its hooks (default: the label). A value that is 0, negative or not a number draws nothing and counts as 0. |
121
+ | `total` | unset | The whole. What the parts leave is the free part; a total smaller than the parts grows to them. |
122
+ | `label` | unset | Names the bar before its parts in the accessible name: `Volume 1: …`. |
123
+ | `remainderLabel` | "Free" | The free part's word; an empty string leaves it out of the legend and the name. |
124
+ | `legend` | `true` | The legend under the bar. |
125
+ | `format` | `formatFileSize` | Value formatter (DSM's 1024 base). |
126
+
127
+ The whole is one `role="img"` named by every part and its size, then the free
128
+ part and "Total" when there is a `total`, joined as the UI language lists
129
+ them: "Volume 1: Photos 820 GB, Backups 1.4 TB, Free 1.7 TB, Total 4 TB". The
130
+ bar and legend are hidden from assistive technology, so nothing is read
131
+ twice. `primary` and `info` are the same blue in DSM: give neighbouring parts
132
+ different tones, or a lighter shade such as `var(--ui-accent-7)` through
133
+ `color`. A non-zero part is at least 2px wide, and a 1px surface line separates
134
+ neighbouring parts. The track colour is `--ui-stacked-bar-track` (default
135
+ `--ui-gray-a3`). Hooks: `data-ui-stacked-bar`, `data-ui-stacked-bar-track`,
136
+ `data-ui-stacked-bar-segment` (`data-key`, `data-tone`),
137
+ `data-ui-stacked-bar-legend`, `data-ui-stacked-bar-remainder`.
@@ -90,6 +90,11 @@ here stay implementation details and can change in any release.
90
90
  | `data-ui-dialog`, `data-ui-sheet` | `Dialog` / `Sheet` panels | present |
91
91
  | `data-ui-list-item-title`, `-description`, `-meta`, `-actions`, `-leading` | `ListItem` parts | present |
92
92
  | `data-ui-statistic-label`, `-value`, `-note` | `Statistic` parts | present |
93
+ | `data-ui-stat-tile` | `StatTile` (`data-tone`; a filter tile also `data-state` `on` / `off`) | present |
94
+ | `data-ui-stat-tile-label`, `-value`, `-unit`, `-note` | `StatTile` parts | present |
95
+ | `data-ui-stat-tile-group` | `StatTileGroup` | present |
96
+ | `data-ui-stacked-bar`, `-track`, `-segment`, `-legend`, `-remainder` | `StackedBar` parts (a segment has `data-key` and `data-tone`) | present |
97
+ | `data-ui-section-tabs-row`, `data-ui-section-tabs-actions` | `SectionTabs` with `#actions`: the row and the actions | present |
93
98
  | `data-tone` | `Callout` | `info`, `success`, `warning`, `danger` |
94
99
  | `data-variant` | `Callout` | `soft`, `inline` |
95
100
  | `data-fill` | `Callout` | present when it spans its container |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/ui",
3
- "version": "0.17.4",
3
+ "version": "0.17.6",
4
4
  "description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "docs/wizard.md"
27
27
  ],
28
28
  "bin": {
29
- "syno-pkg-land-ui": "./dist/cli.js"
29
+ "syno-pkg-land-ui": "dist/cli.js"
30
30
  },
31
31
  "main": "./dist/index.js",
32
32
  "module": "./dist/index.js",