@mojawork/ui-docs 2.6.1 → 2.7.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/README.md +2 -2
- package/catalog/atoms/inline-spinner.md +188 -0
- package/catalog/atoms/reader-doc.md +25 -0
- package/catalog/forms/chip.md +285 -0
- package/catalog/guide.json +62 -5
- package/catalog/layout/spinner.md +7 -0
- package/catalog/manifest.json +28 -4
- package/catalog/version.json +2 -2
- package/package.json +1 -1
- package/storybook/4555.0f383313.iframe.bundle.js +1 -0
- package/storybook/atoms-_electrons-loader-docs-mdx.1176957f.iframe.bundle.js +1 -0
- package/storybook/atoms-_electrons-loader-loader-component-stories.8edadc42.iframe.bundle.js +1 -0
- package/storybook/atoms-inline-spinner-docs-mdx.a98163b8.iframe.bundle.js +1 -0
- package/storybook/atoms-inline-spinner-inline-spinner-component-stories.76f59aa8.iframe.bundle.js +1 -0
- package/storybook/atoms-reader-doc-docs-mdx.1860338f.iframe.bundle.js +1 -0
- package/storybook/atoms-reader-doc-reader-doc-component-stories.8ccd618b.iframe.bundle.js +1 -0
- package/storybook/forms-chip-chip-component-stories.90a45ea4.iframe.bundle.js +1 -0
- package/storybook/forms-chip-docs-mdx.01e1b518.iframe.bundle.js +1 -0
- package/storybook/{home-overview-mdx.0d4ede52.iframe.bundle.js → home-overview-mdx.3b40bdbd.iframe.bundle.js} +1 -1
- package/storybook/iframe.html +2 -2
- package/storybook/index.json +1 -1
- package/storybook/layout-spinner-docs-mdx.03741741.iframe.bundle.js +1 -0
- package/storybook/layout-spinner-spinner-component-stories.69ae1389.iframe.bundle.js +1 -0
- package/storybook/main.4f406815.iframe.bundle.js +1 -0
- package/storybook/project.json +1 -1
- package/storybook/runtime~main.4072cb65.iframe.bundle.js +1 -0
- package/storybook/version.json +2 -2
- package/version.json +2 -2
- package/storybook/4555.251b232c.iframe.bundle.js +0 -1
- package/storybook/atoms-reader-doc-docs-mdx.0688c3b9.iframe.bundle.js +0 -1
- package/storybook/atoms-reader-doc-reader-doc-component-stories.a6fec57d.iframe.bundle.js +0 -1
- package/storybook/layout-spinner-docs-mdx.4be572c0.iframe.bundle.js +0 -1
- package/storybook/layout-spinner-spinner-component-stories.ab8245c6.iframe.bundle.js +0 -1
- package/storybook/main.1f12809e.iframe.bundle.js +0 -1
- package/storybook/runtime~main.52ba2f02.iframe.bundle.js +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @mojawork/ui-docs
|
|
2
2
|
|
|
3
|
-
The documentation of `@mojawork/ui` 2.
|
|
3
|
+
The documentation of `@mojawork/ui` 2.7.0, version-true and offline:
|
|
4
4
|
the built Storybook plus the cooked catalog. Install nothing — start it:
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
npx @mojawork/ui-docs@2.
|
|
7
|
+
npx @mojawork/ui-docs@2.7.0
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
and open the printed URL. The Storybook you see is exactly the one this
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
### Inline Spinner
|
|
2
|
+
|
|
3
|
+
A loading indicator for one area of a page.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### What it does, and what it does not
|
|
8
|
+
|
|
9
|
+
It turns, where it is put. That is the whole component: no backdrop, no focus
|
|
10
|
+
trap, no service, no message, nothing blocked. A panel waiting for its record,
|
|
11
|
+
a tile waiting for a picture, a list waiting for a page — the indicator sits in
|
|
12
|
+
the flow and the layout around it stays where it is.
|
|
13
|
+
|
|
14
|
+
It is the counterpart to `ui-layout-spinner`, which is the application's single
|
|
15
|
+
global overlay and says of itself that it is not the spinner for one
|
|
16
|
+
component's own loading state. This one is that spinner.
|
|
17
|
+
|
|
18
|
+
**It shows whenever it is in the DOM.** Whether something is loading is the
|
|
19
|
+
consumer's question, and an `@if` around the tag is the honest answer to it —
|
|
20
|
+
a `loading` input would only move the same boolean one level down and add a
|
|
21
|
+
state the component would have to be trusted with.
|
|
22
|
+
|
|
23
|
+
Both draw the same animation: it lives in an internal electron that the global
|
|
24
|
+
spinner builds in as well, so there is one set of keyframes in the library and
|
|
25
|
+
not two that drift.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
> **Guide:** recommendations for `ui-inline-spinner` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-inline-spinner`). The section above is the truth; the guide is the offer.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Default
|
|
34
|
+
|
|
35
|
+
#### Story: Default
|
|
36
|
+
|
|
37
|
+
https://moja.work/storybook/?path=/story/atoms-inline-spinner--default
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
export const Default: Story = {
|
|
41
|
+
args: { type: 'ring', label: 'Loading' },
|
|
42
|
+
render: (args) => ({
|
|
43
|
+
props: { ...args },
|
|
44
|
+
template: `<ui-inline-spinner [type]="type" [label]="label" />`,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* All three visuals side by side. All three read `--ui-spinner-size`: for the
|
|
50
|
+
* two discs it is the diameter, for the bar its length. A utility class on the
|
|
51
|
+
* tag widens the wrapper, not the animation — the variable is the handle.
|
|
52
|
+
*/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### The three visuals
|
|
58
|
+
|
|
59
|
+
`ring` and `disco` are discs, `linear` is a bar. They are the same three the
|
|
60
|
+
global spinner offers, because it is the same drawing.
|
|
61
|
+
|
|
62
|
+
#### Story: Types
|
|
63
|
+
|
|
64
|
+
https://moja.work/storybook/?path=/story/atoms-inline-spinner--types
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
export const Types: Story = {
|
|
68
|
+
parameters: { controls: { disable: true } },
|
|
69
|
+
render: () => ({
|
|
70
|
+
template: `
|
|
71
|
+
<div class="flex flex-wrap items-center gap-16">
|
|
72
|
+
<ui-inline-spinner type="ring" />
|
|
73
|
+
<ui-inline-spinner type="disco" />
|
|
74
|
+
<ui-inline-spinner type="linear" style="--ui-spinner-size: 16rem" />
|
|
75
|
+
</div>
|
|
76
|
+
`,
|
|
77
|
+
}),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Size rides on `--ui-spinner-size`, the stroke on `--ui-spinner-stroke` —
|
|
82
|
+
* set from the outside, so the tag needs no input per dimension and a caller
|
|
83
|
+
* can drive them from their own tokens.
|
|
84
|
+
*/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Size
|
|
90
|
+
|
|
91
|
+
Size is a named hook, not an input: `--ui-spinner-size` is the diameter of the
|
|
92
|
+
discs and the length of the bar, `--ui-spinner-stroke` is how thick the line is
|
|
93
|
+
drawn — the ring's annulus and the bar's height. Set them on the tag, or
|
|
94
|
+
inherit them from a container, and the same component serves a spinner beside a
|
|
95
|
+
line of text and one filling a panel.
|
|
96
|
+
|
|
97
|
+
Two consequences worth knowing. A width utility on the tag widens the wrapper,
|
|
98
|
+
not the animation — the variable is the handle. And unset, both fall back to
|
|
99
|
+
what the global spinner has always drawn (26rem), which is why moving the
|
|
100
|
+
animation into the shared electron changed nothing about the overlay.
|
|
101
|
+
|
|
102
|
+
#### Story: Sizes
|
|
103
|
+
|
|
104
|
+
https://moja.work/storybook/?path=/story/atoms-inline-spinner--sizes
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
export const Sizes: Story = {
|
|
108
|
+
parameters: { controls: { disable: true } },
|
|
109
|
+
render: () => ({
|
|
110
|
+
template: `
|
|
111
|
+
<div class="flex flex-wrap items-center gap-16">
|
|
112
|
+
<ui-inline-spinner style="--ui-spinner-size: 2rem; --ui-spinner-stroke: 0.3rem" />
|
|
113
|
+
<ui-inline-spinner style="--ui-spinner-size: 4rem; --ui-spinner-stroke: 0.4rem" />
|
|
114
|
+
<ui-inline-spinner style="--ui-spinner-size: 8rem; --ui-spinner-stroke: 0.8rem" />
|
|
115
|
+
</div>
|
|
116
|
+
`,
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* In its place: a panel waiting for its content. The spinner sits in the flow
|
|
122
|
+
* and takes the width it is given — nothing is covered, nothing is blocked,
|
|
123
|
+
* and the page around it stays where it is.
|
|
124
|
+
*/
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### In place
|
|
130
|
+
|
|
131
|
+
Nothing is covered and nothing is blocked. The tag takes exactly the room the
|
|
132
|
+
animation needs and sits where it is put — it does not stretch across the line
|
|
133
|
+
and centre itself, so placing it is the container's decision and not a
|
|
134
|
+
behaviour to work around. In the panel below, one pair of utility classes on
|
|
135
|
+
the panel does the centring.
|
|
136
|
+
|
|
137
|
+
#### Story: InAPanel
|
|
138
|
+
|
|
139
|
+
https://moja.work/storybook/?path=/story/atoms-inline-spinner--in-a-panel
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
export const InAPanel: Story = {
|
|
143
|
+
parameters: { controls: { disable: true } },
|
|
144
|
+
render: () => ({
|
|
145
|
+
template: `
|
|
146
|
+
<div class="flex h-64 w-96 items-center justify-center border">
|
|
147
|
+
<ui-inline-spinner label="Loading" />
|
|
148
|
+
</div>
|
|
149
|
+
`,
|
|
150
|
+
}),
|
|
151
|
+
};
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### Arguments (Props)
|
|
157
|
+
|
|
158
|
+
#### Inputs
|
|
159
|
+
|
|
160
|
+
<table>
|
|
161
|
+
<thead>
|
|
162
|
+
<tr>
|
|
163
|
+
<th>Name</th>
|
|
164
|
+
<th>Type</th>
|
|
165
|
+
<th>Default</th>
|
|
166
|
+
<th>Description</th>
|
|
167
|
+
</tr>
|
|
168
|
+
</thead>
|
|
169
|
+
<tbody>
|
|
170
|
+
<tr>
|
|
171
|
+
<td>`type`</td>
|
|
172
|
+
<td>`'ring' | 'linear' | 'disco'`</td>
|
|
173
|
+
<td>`'ring'`</td>
|
|
174
|
+
<td>Which of the three visuals is drawn.</td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr>
|
|
177
|
+
<td>`label`</td>
|
|
178
|
+
<td>`string | null`</td>
|
|
179
|
+
<td>`null`</td>
|
|
180
|
+
<td>
|
|
181
|
+
What a screen reader is told while this is on screen. The animation is
|
|
182
|
+
`aria-hidden`, so without a word here the wait is silent. The sentence
|
|
183
|
+
belongs to the consumer — the library does not know what is loading and
|
|
184
|
+
has no dictionary for it.
|
|
185
|
+
</td>
|
|
186
|
+
</tr>
|
|
187
|
+
</tbody>
|
|
188
|
+
</table>
|
|
@@ -128,6 +128,31 @@ export const Figure: Story = {
|
|
|
128
128
|
render,
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Emphasis stays in the line. The house sheet sets `strong` like a fourth
|
|
133
|
+
* heading — the reader takes size, line height and colour back, so a bold
|
|
134
|
+
* word mid-sentence is a bold word and not a blue subheading.
|
|
135
|
+
*/
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The same rule, turned inward: the library's own sheet sets `strong` like a
|
|
139
|
+
fourth heading — its size, its line height, the default colour — which is
|
|
140
|
+
right for the house's surfaces and would be wrong here. A `**word**` in the
|
|
141
|
+
middle of a sentence is a bold word, not a subheading, so the reader takes
|
|
142
|
+
the three back and leaves only the weight. The rule is pinned by a test
|
|
143
|
+
against the stylesheet.
|
|
144
|
+
|
|
145
|
+
#### Story: Emphasis
|
|
146
|
+
|
|
147
|
+
https://moja.work/storybook/?path=/story/atoms-readerdoc--emphasis
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
export const Emphasis: Story = {
|
|
151
|
+
parameters: noControls,
|
|
152
|
+
args: { ...base, markdown: WITH_EMPHASIS },
|
|
153
|
+
render,
|
|
154
|
+
};
|
|
155
|
+
|
|
131
156
|
/**
|
|
132
157
|
* Inline code in a squeezed table cell: the hyphenated names stay on one line
|
|
133
158
|
* each, the description column takes the break.
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
### Chip
|
|
2
|
+
|
|
3
|
+
A small label that reports what is done to it.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### What it does, and what it does not
|
|
8
|
+
|
|
9
|
+
It shows the text it is given and emits — a set filter, a chosen genre, a tag
|
|
10
|
+
on a record. What a press MEANS is the consumer's answer: the chip does not
|
|
11
|
+
select itself, does not mark itself active, and above all **does not remove
|
|
12
|
+
itself**. It says the cross was pressed; taking it out of the list is the job
|
|
13
|
+
of whoever holds the list.
|
|
14
|
+
|
|
15
|
+
That is the whole component. It has no active state, no group, no selection
|
|
16
|
+
model and no keyboard walk across a row — a set of chips that behave as one
|
|
17
|
+
choice is a different thing, and it is not this one.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
> **Guide:** recommendations for `ui-chip` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-chip`). The section above is the truth; the guide is the offer.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
### Two buttons, never nested
|
|
26
|
+
|
|
27
|
+
The label is one button and the remove cross is another, side by side inside
|
|
28
|
+
the chip's frame. This is the one decision worth knowing about, because from
|
|
29
|
+
the outside it looks like a single control.
|
|
30
|
+
|
|
31
|
+
A clickable chip containing a clickable cross would be a button inside a
|
|
32
|
+
button. With the mouse you would have to hit pixels; with the keyboard you
|
|
33
|
+
land on two targets of which one swallows the other, and the outer one fires
|
|
34
|
+
when the inner one is pressed. As siblings both are reachable, in order, and
|
|
35
|
+
no `stopPropagation` is needed anywhere — the cross simply is not inside the
|
|
36
|
+
thing it would otherwise trigger.
|
|
37
|
+
|
|
38
|
+
It also means focus is drawn on the control that has it, not around the whole
|
|
39
|
+
chip: two stops must look like two stops.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### Default
|
|
44
|
+
|
|
45
|
+
#### Story: Default
|
|
46
|
+
|
|
47
|
+
https://moja.work/storybook/?path=/story/forms-chip--default
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
export const Default: Story = {
|
|
51
|
+
args: { removable: true, removeLabel: 'Remove' },
|
|
52
|
+
render: (args) => ({
|
|
53
|
+
props: { ...args },
|
|
54
|
+
template: `
|
|
55
|
+
<ui-chip
|
|
56
|
+
[removable]="removable"
|
|
57
|
+
[removeLabel]="removeLabel"
|
|
58
|
+
(chipClick)="chipClick()"
|
|
59
|
+
(chipRemove)="chipRemove()"
|
|
60
|
+
>Label</ui-chip>
|
|
61
|
+
`,
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* With and without the cross. The same component either way — the input says
|
|
67
|
+
* whether the chip can be thrown away, and nothing else changes.
|
|
68
|
+
*/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### With and without the cross
|
|
74
|
+
|
|
75
|
+
`removable` decides whether the chip can be thrown away. Nothing else changes
|
|
76
|
+
with it — the same component, one control more.
|
|
77
|
+
|
|
78
|
+
#### Story: Removable
|
|
79
|
+
|
|
80
|
+
https://moja.work/storybook/?path=/story/forms-chip--removable
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
export const Removable: Story = {
|
|
84
|
+
parameters: { controls: { disable: true } },
|
|
85
|
+
render: () => ({
|
|
86
|
+
template: `
|
|
87
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
88
|
+
<ui-chip>Plain</ui-chip>
|
|
89
|
+
<ui-chip [removable]="true" removeLabel="Remove">Removable</ui-chip>
|
|
90
|
+
</div>
|
|
91
|
+
`,
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* A row of them, as a filter bar collects itself. The chips do not remove
|
|
97
|
+
* themselves — the parent takes them out of its list when `chipRemove` says
|
|
98
|
+
* so, which is why they can be a plain list here.
|
|
99
|
+
*/
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### A row of them
|
|
105
|
+
|
|
106
|
+
How a filter bar collects itself. The chips are a plain list because they do
|
|
107
|
+
not remove themselves: the parent drops the entry when `chipRemove` says so,
|
|
108
|
+
and the row re-renders.
|
|
109
|
+
|
|
110
|
+
#### Story: ARow
|
|
111
|
+
|
|
112
|
+
https://moja.work/storybook/?path=/story/forms-chip--a-row
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
export const ARow: Story = {
|
|
116
|
+
parameters: { controls: { disable: true } },
|
|
117
|
+
render: () => ({
|
|
118
|
+
template: `
|
|
119
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
120
|
+
<ui-chip [removable]="true" removeLabel="Remove">Genre</ui-chip>
|
|
121
|
+
<ui-chip [removable]="true" removeLabel="Remove">Year</ui-chip>
|
|
122
|
+
<ui-chip [removable]="true" removeLabel="Remove">Publisher</ui-chip>
|
|
123
|
+
</div>
|
|
124
|
+
`,
|
|
125
|
+
}),
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A label longer than the room it has shortens rather than pushing the row
|
|
130
|
+
* apart, and the cross keeps its place at the end.
|
|
131
|
+
*/
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### A long label
|
|
137
|
+
|
|
138
|
+
A label longer than the room it has shortens rather than pushing the row
|
|
139
|
+
apart, and the cross keeps its place at the end — so a row of chips holds one
|
|
140
|
+
flight line whatever their labels do.
|
|
141
|
+
|
|
142
|
+
#### Story: LongLabel
|
|
143
|
+
|
|
144
|
+
https://moja.work/storybook/?path=/story/forms-chip--long-label
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
export const LongLabel: Story = {
|
|
148
|
+
parameters: { controls: { disable: true } },
|
|
149
|
+
render: () => ({
|
|
150
|
+
template: `
|
|
151
|
+
<div class="w-64">
|
|
152
|
+
<ui-chip [removable]="true" removeLabel="Remove"
|
|
153
|
+
>A label longer than the room it is given</ui-chip
|
|
154
|
+
>
|
|
155
|
+
</div>
|
|
156
|
+
`,
|
|
157
|
+
}),
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Colours are custom properties, not inputs: set them on the tag, or once on
|
|
162
|
+
* a container so a whole row follows.
|
|
163
|
+
*/
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Colours
|
|
169
|
+
|
|
170
|
+
Custom properties, not inputs: set them on the tag, or once on a container so
|
|
171
|
+
a whole row follows. Every one falls back to a library token, so an unset chip
|
|
172
|
+
is a chip in the house colours.
|
|
173
|
+
|
|
174
|
+
<table class="ui">
|
|
175
|
+
<tr>
|
|
176
|
+
<th>variable</th>
|
|
177
|
+
<th>fallback</th>
|
|
178
|
+
</tr>
|
|
179
|
+
<tr>
|
|
180
|
+
<td>`--ui-chip-bg`</td>
|
|
181
|
+
<td>`var(--ui-c-fourthly)`</td>
|
|
182
|
+
</tr>
|
|
183
|
+
<tr>
|
|
184
|
+
<td>`--ui-chip-text`</td>
|
|
185
|
+
<td>`var(--ui-c-default)`</td>
|
|
186
|
+
</tr>
|
|
187
|
+
<tr>
|
|
188
|
+
<td>`--ui-chip-hover`</td>
|
|
189
|
+
<td>the text colour at 10%</td>
|
|
190
|
+
</tr>
|
|
191
|
+
<tr>
|
|
192
|
+
<td>`--ui-chip-radius`</td>
|
|
193
|
+
<td>`999px` — a pill; set the library radius for a square one</td>
|
|
194
|
+
</tr>
|
|
195
|
+
<tr>
|
|
196
|
+
<td>`--ui-chip-icon-size`</td>
|
|
197
|
+
<td>`1.6rem`</td>
|
|
198
|
+
</tr>
|
|
199
|
+
</table>
|
|
200
|
+
|
|
201
|
+
#### Story: Colours
|
|
202
|
+
|
|
203
|
+
https://moja.work/storybook/?path=/story/forms-chip--colours
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
export const Colours: Story = {
|
|
207
|
+
parameters: { controls: { disable: true } },
|
|
208
|
+
render: () => ({
|
|
209
|
+
template: `
|
|
210
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
211
|
+
<ui-chip [removable]="true" removeLabel="Remove">Default</ui-chip>
|
|
212
|
+
<ui-chip
|
|
213
|
+
[removable]="true"
|
|
214
|
+
removeLabel="Remove"
|
|
215
|
+
style="--ui-chip-bg: var(--ui-c-focus); --ui-chip-text: var(--ui-c-static)"
|
|
216
|
+
>Accent</ui-chip
|
|
217
|
+
>
|
|
218
|
+
<ui-chip style="--ui-chip-radius: var(--ui-border-radius)">Square</ui-chip>
|
|
219
|
+
<ui-chip
|
|
220
|
+
[removable]="true"
|
|
221
|
+
removeLabel="Remove"
|
|
222
|
+
style="--ui-chip-radius: var(--ui-border-radius)"
|
|
223
|
+
>Square</ui-chip
|
|
224
|
+
>
|
|
225
|
+
</div>
|
|
226
|
+
`,
|
|
227
|
+
}),
|
|
228
|
+
};
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### Arguments (Props)
|
|
234
|
+
|
|
235
|
+
#### Inputs
|
|
236
|
+
|
|
237
|
+
<table class="ui">
|
|
238
|
+
<tr>
|
|
239
|
+
<th>Name</th>
|
|
240
|
+
<th>Type</th>
|
|
241
|
+
<th>Default</th>
|
|
242
|
+
<th>Description</th>
|
|
243
|
+
</tr>
|
|
244
|
+
<tr>
|
|
245
|
+
<td>`removable`</td>
|
|
246
|
+
<td>`boolean`</td>
|
|
247
|
+
<td>`false`</td>
|
|
248
|
+
<td>Whether the remove cross is offered.</td>
|
|
249
|
+
</tr>
|
|
250
|
+
<tr>
|
|
251
|
+
<td>`removeLabel`</td>
|
|
252
|
+
<td>`string | null`</td>
|
|
253
|
+
<td>`null`</td>
|
|
254
|
+
<td>
|
|
255
|
+
What a screen reader is told the cross does. It carries no text of its
|
|
256
|
+
own, and "close" says nothing about which chip — the sentence belongs to
|
|
257
|
+
the consumer, who knows both the word and the language.
|
|
258
|
+
</td>
|
|
259
|
+
</tr>
|
|
260
|
+
</table>
|
|
261
|
+
|
|
262
|
+
#### Outputs
|
|
263
|
+
|
|
264
|
+
<table class="ui">
|
|
265
|
+
<tr>
|
|
266
|
+
<th>Name</th>
|
|
267
|
+
<th>Payload</th>
|
|
268
|
+
<th>Description</th>
|
|
269
|
+
</tr>
|
|
270
|
+
<tr>
|
|
271
|
+
<td>`chipClick`</td>
|
|
272
|
+
<td>`void`</td>
|
|
273
|
+
<td>The label was pressed.</td>
|
|
274
|
+
</tr>
|
|
275
|
+
<tr>
|
|
276
|
+
<td>`chipRemove`</td>
|
|
277
|
+
<td>`void`</td>
|
|
278
|
+
<td>The cross was pressed. The chip stays; removing it is the parent's.</td>
|
|
279
|
+
</tr>
|
|
280
|
+
</table>
|
|
281
|
+
|
|
282
|
+
#### Content
|
|
283
|
+
|
|
284
|
+
The label is projected: `<ui-chip>Genre</ui-chip>`. Whatever a chip is a chip
|
|
285
|
+
of goes inside — a word, a number, an icon beside a word.
|
package/catalog/guide.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "an agent — the Claude Code session of the library workspace, writing from the sources each entry names; not a person",
|
|
3
3
|
"disclaimer": "Recommendations, not truth. Every entry was written by an agent from the sources it names, and only for what demonstrably runs somewhere in the house (shownIn). The component page — get_component_doc — is the truth; where the two disagree, the page wins. The house rules are read verbatim from the usage contract of the library (usage.md).",
|
|
4
|
-
"uiVersion": "2.
|
|
5
|
-
"commit": "
|
|
4
|
+
"uiVersion": "2.7.0",
|
|
5
|
+
"commit": "6c2d0619",
|
|
6
6
|
"entries": [
|
|
7
7
|
{
|
|
8
8
|
"kind": "situation",
|
|
@@ -452,6 +452,33 @@
|
|
|
452
452
|
],
|
|
453
453
|
"reviewed": "69197b72"
|
|
454
454
|
},
|
|
455
|
+
{
|
|
456
|
+
"kind": "component",
|
|
457
|
+
"component": "ui-chip",
|
|
458
|
+
"useFor": [
|
|
459
|
+
"A small label that reports presses — a set filter above a table, a genre on a record, a tag that can be thrown away.",
|
|
460
|
+
"Rows of them: the parent holds the list, the chip only says the cross was pressed."
|
|
461
|
+
],
|
|
462
|
+
"notFor": [
|
|
463
|
+
"Removing itself: chipRemove is a message, and the list belongs to whoever holds it.",
|
|
464
|
+
"A selection: it has no active state and no group — a set of chips behaving as one choice is a different component.",
|
|
465
|
+
"A form control: it takes no value, no ngModel and no validation."
|
|
466
|
+
],
|
|
467
|
+
"shownIn": [
|
|
468
|
+
{
|
|
469
|
+
"story": "Forms/Chip/ARow",
|
|
470
|
+
"url": "https://moja.work/storybook/?path=/story/forms-chip--a-row"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"story": "Forms/Chip/Removable",
|
|
474
|
+
"url": "https://moja.work/storybook/?path=/story/forms-chip--removable"
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
"sources": [
|
|
478
|
+
"libs/ui/src/lib/forms/chip/docs.mdx"
|
|
479
|
+
],
|
|
480
|
+
"reviewed": "8e6e0c56"
|
|
481
|
+
},
|
|
455
482
|
{
|
|
456
483
|
"kind": "component",
|
|
457
484
|
"component": "ui-clock",
|
|
@@ -591,6 +618,32 @@
|
|
|
591
618
|
],
|
|
592
619
|
"reviewed": "592c82aa"
|
|
593
620
|
},
|
|
621
|
+
{
|
|
622
|
+
"kind": "component",
|
|
623
|
+
"component": "ui-inline-spinner",
|
|
624
|
+
"useFor": [
|
|
625
|
+
"The loading state of ONE area — a panel waiting for its record, a tile waiting for a picture. It sits in the flow, blocks nothing and covers nothing."
|
|
626
|
+
],
|
|
627
|
+
"notFor": [
|
|
628
|
+
"The application's global wait: that is ui-layout-spinner, placed once at the root and switched through its service.",
|
|
629
|
+
"Holding the loading state: it shows while it is in the DOM, so an @if around the tag is the switch.",
|
|
630
|
+
"Progress: all three visuals are indeterminate, none of them can show how far along something is."
|
|
631
|
+
],
|
|
632
|
+
"shownIn": [
|
|
633
|
+
{
|
|
634
|
+
"story": "Atoms/Inline Spinner/Types",
|
|
635
|
+
"url": "https://moja.work/storybook/?path=/story/atoms-inline-spinner--types"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"story": "Atoms/Inline Spinner/InAPanel",
|
|
639
|
+
"url": "https://moja.work/storybook/?path=/story/atoms-inline-spinner--in-a-panel"
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"sources": [
|
|
643
|
+
"libs/ui/src/lib/atoms/inline-spinner/docs.mdx"
|
|
644
|
+
],
|
|
645
|
+
"reviewed": "8e6e0c56"
|
|
646
|
+
},
|
|
594
647
|
{
|
|
595
648
|
"kind": "component",
|
|
596
649
|
"component": "ui-input",
|
|
@@ -810,7 +863,7 @@
|
|
|
810
863
|
"The one global loading indicator at the app root, driven by UiLayoutSpinnerService from an HTTP interceptor."
|
|
811
864
|
],
|
|
812
865
|
"notFor": [
|
|
813
|
-
"A component's own loading state — the
|
|
866
|
+
"A component's own loading state — that is ui-inline-spinner, which sits in the flow and blocks nothing; the table wrapper brings its own skeleton."
|
|
814
867
|
],
|
|
815
868
|
"shownIn": [
|
|
816
869
|
{
|
|
@@ -824,7 +877,7 @@
|
|
|
824
877
|
"sources": [
|
|
825
878
|
"libs/ui/src/lib/layout/spinner/docs.mdx"
|
|
826
879
|
],
|
|
827
|
-
"reviewed": "
|
|
880
|
+
"reviewed": "8e6e0c56"
|
|
828
881
|
},
|
|
829
882
|
{
|
|
830
883
|
"kind": "component",
|
|
@@ -1012,6 +1065,10 @@
|
|
|
1012
1065
|
"story": "Atoms/ReaderDoc/DroppedMarkup",
|
|
1013
1066
|
"url": "https://moja.work/storybook/?path=/story/atoms-readerdoc--dropped-markup"
|
|
1014
1067
|
},
|
|
1068
|
+
{
|
|
1069
|
+
"story": "Atoms/ReaderDoc/Emphasis",
|
|
1070
|
+
"url": "https://moja.work/storybook/?path=/story/atoms-readerdoc--emphasis"
|
|
1071
|
+
},
|
|
1015
1072
|
{
|
|
1016
1073
|
"file": "apps/website/src/app/content/content.component.html"
|
|
1017
1074
|
}
|
|
@@ -1019,7 +1076,7 @@
|
|
|
1019
1076
|
"sources": [
|
|
1020
1077
|
"libs/ui/src/lib/atoms/reader-doc/docs.mdx"
|
|
1021
1078
|
],
|
|
1022
|
-
"reviewed": "
|
|
1079
|
+
"reviewed": "2ae02124"
|
|
1023
1080
|
},
|
|
1024
1081
|
{
|
|
1025
1082
|
"kind": "component",
|
|
@@ -12,6 +12,13 @@ It shows, animates out and hides; it does not count requests, time out or block
|
|
|
12
12
|
input on its own, and it is not the spinner for one component's own loading
|
|
13
13
|
state.
|
|
14
14
|
|
|
15
|
+
That last sentence now has an address: `ui-inline-spinner` is the one for a
|
|
16
|
+
single area. Both draw the same animation — it lives in an internal electron
|
|
17
|
+
that each of them builds in, so the library holds one set of keyframes rather
|
|
18
|
+
than two that drift. What stays here is what makes this one global: the
|
|
19
|
+
backdrop, the message box with its OK button, and the state coming from the
|
|
20
|
+
service.
|
|
21
|
+
|
|
15
22
|
---
|
|
16
23
|
|
|
17
24
|
> **Guide:** recommendations for `ui-layout-spinner` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-layout-spinner`). The section above is the truth; the guide is the offer.
|