Skip to content

Commit 2b64726

Browse files
b3008claude
andcommitted
Add attribute reference docs for all custom elements and visual protocol layers to schedule calendar
- Add 15 ATTRIBUTES.mdx files (one per custom element) with comprehensive attribute documentation, DOM API, events, and summary tables - Add 9 visual protocol layers to aa-schedule-calendar (window shading, exclude-times hatching, fixed/random signal styling, signal-expiry height, min-interval buffers, reminder markers, exclude-dates/active-days dimming, fixed-times labels) - Add interactive calendar key panel toggled by ? button - Pass SignalProtocolConfig through calendar component hierarchy - Add helper functions for time parsing, day activity, and duration conversion - Extract calendar sub-components (warnings, stats, week-grid, signal-list, day-column) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a230988 commit 2b64726

82 files changed

Lines changed: 5392 additions & 1227 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
import { Meta } from "@storybook/blocks";
2+
3+
<Meta title="Response Items/Affect Grid/Attribute Reference" />
4+
5+
# `<aa-affect-grid>` Attribute Reference
6+
7+
A two-dimensional grid response item for measuring affect (emotional state) along two axes. Based on the Russell Affect Grid, it presents a square grid where the participant clicks a cell to indicate their current position in a 2D emotion space. Returns `[x, y]` coordinates.
8+
9+
```html
10+
<aa-affect-grid
11+
name="affect"
12+
rows="9"
13+
columns="9"
14+
left-label="Unpleasant"
15+
right-label="Pleasant"
16+
top-label="High arousal"
17+
bottom-label="Low arousal"
18+
center-label="Neutral"
19+
top-left-label="Distress"
20+
top-right-label="Excitement"
21+
bottom-left-label="Depression"
22+
bottom-right-label="Relaxation">
23+
</aa-affect-grid>
24+
```
25+
26+
---
27+
28+
## Grid Dimensions
29+
30+
### `rows`
31+
32+
- **Type:** Number
33+
- **Default:** `11`
34+
35+
The number of rows in the grid. Determines the vertical resolution.
36+
37+
### `columns`
38+
39+
- **Type:** Number
40+
- **Default:** `11`
41+
42+
The number of columns in the grid. Determines the horizontal resolution.
43+
44+
---
45+
46+
## Axis Labels
47+
48+
These labels describe the meaning of each axis and its endpoints.
49+
50+
### `left-label`
51+
52+
- **Type:** String
53+
- **Default:** `""`
54+
55+
Label on the left side of the grid (negative x-axis). Typically describes the unpleasant end of the valence axis.
56+
57+
### `right-label`
58+
59+
- **Type:** String
60+
- **Default:** `""`
61+
62+
Label on the right side of the grid (positive x-axis). Typically describes the pleasant end of the valence axis.
63+
64+
### `top-label`
65+
66+
- **Type:** String
67+
- **Default:** `""`
68+
69+
Label at the top of the grid (positive y-axis). Typically describes high arousal.
70+
71+
### `bottom-label`
72+
73+
- **Type:** String
74+
- **Default:** `""`
75+
76+
Label at the bottom of the grid (negative y-axis). Typically describes low arousal.
77+
78+
### `center-label`
79+
80+
- **Type:** String
81+
- **Default:** `""`
82+
83+
Label at the centre of the grid. Typically "Neutral" or "Average".
84+
85+
---
86+
87+
## Quadrant Labels
88+
89+
These labels describe the four corners of the grid, representing the combinations of the two axes.
90+
91+
### `top-left-label`
92+
93+
- **Type:** String
94+
- **Default:** `""`
95+
96+
Label at the top-left corner (high arousal, unpleasant). Typically "Distress" or "Tense".
97+
98+
### `top-right-label`
99+
100+
- **Type:** String
101+
- **Default:** `""`
102+
103+
Label at the top-right corner (high arousal, pleasant). Typically "Excitement" or "Alert".
104+
105+
### `bottom-left-label`
106+
107+
- **Type:** String
108+
- **Default:** `""`
109+
110+
Label at the bottom-left corner (low arousal, unpleasant). Typically "Depression" or "Sad".
111+
112+
### `bottom-right-label`
113+
114+
- **Type:** String
115+
- **Default:** `""`
116+
117+
Label at the bottom-right corner (low arousal, pleasant). Typically "Relaxation" or "Calm".
118+
119+
---
120+
121+
## Side Labels
122+
123+
Additional labels positioned along the left and right edges, between the corner and centre.
124+
125+
### `left-top-label`
126+
127+
- **Type:** String
128+
- **Default:** `""`
129+
130+
Label on the left side, upper half.
131+
132+
### `left-bottom-label`
133+
134+
- **Type:** String
135+
- **Default:** `""`
136+
137+
Label on the left side, lower half.
138+
139+
### `right-top-label`
140+
141+
- **Type:** String
142+
- **Default:** `""`
143+
144+
Label on the right side, upper half.
145+
146+
### `right-bottom-label`
147+
148+
- **Type:** String
149+
- **Default:** `""`
150+
151+
Label on the right side, lower half.
152+
153+
---
154+
155+
## Other Attributes
156+
157+
### `name`
158+
159+
- **Type:** String
160+
- **Default:**
161+
162+
The variable name under which the selected coordinates are stored in session memory.
163+
164+
### `value`
165+
166+
- **Type:** Array `[x, y]`
167+
- **Default:**
168+
- **User-defined:** No (read-only)
169+
170+
The currently selected grid coordinates as a two-element array. `x` is the column (0-indexed from left), `y` is the row (0-indexed from top).
171+
172+
### `required`
173+
174+
- **Type:** Boolean
175+
- **Default:** `false`
176+
177+
When `true`, the participant must select a cell before the parent screen can be submitted.
178+
179+
---
180+
181+
## Attribute Summary Table
182+
183+
| Attribute | Type | Default | Description |
184+
|---|---|---|---|
185+
| `name` | String || Variable name for data storage |
186+
| `rows` | Number | `11` | Grid row count |
187+
| `columns` | Number | `11` | Grid column count |
188+
| `top-label` | String | `""` | Top axis label |
189+
| `bottom-label` | String | `""` | Bottom axis label |
190+
| `left-label` | String | `""` | Left axis label |
191+
| `right-label` | String | `""` | Right axis label |
192+
| `center-label` | String | `""` | Centre label |
193+
| `top-left-label` | String | `""` | Top-left quadrant label |
194+
| `top-right-label` | String | `""` | Top-right quadrant label |
195+
| `bottom-left-label` | String | `""` | Bottom-left quadrant label |
196+
| `bottom-right-label` | String | `""` | Bottom-right quadrant label |
197+
| `left-top-label` | String | `""` | Left side upper label |
198+
| `left-bottom-label` | String | `""` | Left side lower label |
199+
| `right-top-label` | String | `""` | Right side upper label |
200+
| `right-bottom-label` | String | `""` | Right side lower label |
201+
| `value` | Array || Selected `[x, y]` coordinates (read-only) |
202+
| `required` | Boolean | `false` | Require selection before submit |
203+
204+
---
205+
206+
## DOM API
207+
208+
```js
209+
const grid = document.querySelector('aa-affect-grid');
210+
console.log(grid.value); // e.g. [5, 3]
211+
console.log(grid.x); // column index
212+
console.log(grid.y); // row index
213+
```
214+
215+
| Property | Type | Description |
216+
|---|---|---|
217+
| `value` | `[number, number]` | Selected `[x, y]` coordinates |
218+
| `x` | `number` | Selected column index |
219+
| `y` | `number` | Selected row index |
220+
221+
### Layout
222+
223+
The grid maintains a square aspect ratio using a `ResizeObserver`. It automatically adjusts to fit its container while keeping cells square.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { Meta } from "@storybook/blocks";
2+
3+
<Meta title="Response Items/Checkboxes/Attribute Reference" />
4+
5+
# `<aa-checkboxes>` Attribute Reference
6+
7+
A multi-select response item that renders a group of checkboxes. The participant can select zero or more options. Each option is defined by an `<aa-choice-item>` child element (the same element used in `<aa-multiple-choice>`, but rendered here as checkboxes instead of radio buttons).
8+
9+
```html
10+
<aa-checkboxes name="symptoms" vertical>
11+
<aa-choice-item value="headache">Headache</aa-choice-item>
12+
<aa-choice-item value="fatigue">Fatigue</aa-choice-item>
13+
<aa-choice-item value="nausea">Nausea</aa-choice-item>
14+
<aa-choice-item value="none">None of the above</aa-choice-item>
15+
</aa-checkboxes>
16+
```
17+
18+
---
19+
20+
## Attributes
21+
22+
### `name`
23+
24+
- **Type:** String
25+
- **Default:**
26+
27+
The variable name under which the selected values are stored in session memory. The stored value is an **array** of the `value` attributes of all checked items.
28+
29+
### `horizontal`
30+
31+
- **Type:** Boolean
32+
- **Default:** `false`
33+
34+
When `true`, the checkbox items are laid out in a horizontal row.
35+
36+
### `vertical`
37+
38+
- **Type:** Boolean
39+
- **Default:** `true`
40+
41+
When `true`, the checkbox items are laid out in a vertical stack. This is the default layout.
42+
43+
### `value`
44+
45+
- **Type:** String (array)
46+
- **Default:**
47+
- **User-defined:** No (read-only)
48+
49+
The currently selected values as an array. Each entry is the `value` attribute of a checked `<aa-choice-item>`.
50+
51+
---
52+
53+
## Child Element: `<aa-choice-item>`
54+
55+
See the [`<aa-multiple-choice>` Attribute Reference](?path=/docs/response-items-multiple-choice-attribute-reference--docs) for full `<aa-choice-item>` documentation. Inside `<aa-checkboxes>`, the items render as checkboxes (allowing multiple selections) rather than radio buttons.
56+
57+
---
58+
59+
## Attribute Summary Table
60+
61+
| Attribute | Type | Default | Description |
62+
|---|---|---|---|
63+
| `name` | String || Variable name for data storage |
64+
| `horizontal` | Boolean | `false` | Horizontal layout |
65+
| `vertical` | Boolean | `true` | Vertical layout (default) |
66+
| `value` | Array || Array of checked item values (read-only) |
67+
68+
---
69+
70+
## DOM API
71+
72+
```js
73+
const cb = document.querySelector('aa-checkboxes');
74+
console.log(cb.value); // e.g. ["headache", "fatigue"]
75+
```
76+
77+
### Events
78+
79+
Choice items dispatch `change` events when toggled. The parent `<aa-screen>` collects the final array of values on submission.

0 commit comments

Comments
 (0)