inline-chat-kit 0.59.0 → 0.60.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/theming.md CHANGED
@@ -245,6 +245,75 @@ paper and one acid yellow. Six tokens turn that into a palette:
245
245
  The markdown gaps are in `em` rather than pixels, so they scale with whatever
246
246
  size the answer is set at instead of drifting away from it.
247
247
 
248
+ ## Buttons
249
+
250
+ Every button the kit draws is one of five variants, and each variant is painted
251
+ from its own `--ick-btn-<variant>-*` tokens — so a host's primary is set once,
252
+ in its own stylesheet, rather than matched by a hashed class name:
253
+
254
+ ```css
255
+ :root {
256
+ --ick-btn-radius: 10px;
257
+ --ick-btn-primary-bg: #1d4ed8;
258
+ --ick-btn-primary-ink: #fff;
259
+ --ick-btn-primary-border: transparent;
260
+ --ick-btn-primary-shadow: none;
261
+ --ick-btn-primary-shadow-hover: 0 2px 6px rgb(29 78 216 / 0.35);
262
+ --ick-btn-primary-shadow-press: none;
263
+ }
264
+ ```
265
+
266
+ | Variant | Tokens |
267
+ | --- | --- |
268
+ | `primary` | `-bg` `-ink` `-border` `-shadow` `-shadow-hover` `-shadow-press` |
269
+ | `secondary` | `-bg` `-ink` `-bg-hover` `-border-hover` `-shadow-hover` `-shadow-press` |
270
+ | `outline` | `-bg` `-ink` `-border` `-bg-hover` `-border-hover` `-bg-press` |
271
+ | `ghost` | `-ink` `-ink-hover` `-bg-hover` `-bg-press` |
272
+ | `glass` | `-bg` `-ink` `-bg-hover` `-ink-hover` `-bg-press` — its rim and shadows are the glass tokens |
273
+
274
+ A state that does not change a property by default has no token for it, and
275
+ keeps the resting value: set `--ick-btn-primary-bg` and the hover is that
276
+ colour too, rather than turning back into glass.
277
+
278
+ **Every button also says what it is for**, in `data-ick-role`, and what it is
279
+ in `data-ick-variant`. Set the same tokens on a role and only that role
280
+ changes:
281
+
282
+ ```css
283
+ [data-ick-role="stop"] { --ick-btn-primary-bg: #dc2626; }
284
+ ```
285
+
286
+ | Role | Where |
287
+ | --- | --- |
288
+ | `send`, `stop`, `save` | The composer's glyph — three roles, not one button with three labels |
289
+ | `add`, `dictate`, `cancel-edit`, `add-close` | The composer's other controls |
290
+ | `read-more`, `message-action` | On a sent message (`data-ick-action`: `copy`, `edit`) |
291
+ | `answer-action` | Under an answer (`data-ick-action`: `copy`, `regenerate`, `up`, `down`) |
292
+ | `suggestion` | The openers in an empty conversation |
293
+ | `back`, `header-action`, `header-more`, `header-menu-item` | The header; an action carries its `id` as `data-ick-action` |
294
+ | `approval-once`, `approval-always`, `approval-deny` | An approval |
295
+ | `question-next` | A question card |
296
+ | `highlight-action` | The highlight menu (`data-ick-action`: `reply`, `remove`) |
297
+ | `thread-save`, `thread-close` | A thread |
298
+ | `pane-expand`, `pane-close` | The artifact pane |
299
+ | `remove-attachment` | An attachment's X |
300
+
301
+ A header action can be drawn as a primary with `variant: "primary"` on it.
302
+
303
+ **Bigger buttons on a phone.** Heights are `--ick-control-xs` … `-xl`. On a
304
+ coarse pointer the kit already raises them a step and gives every control an
305
+ invisible 44px hit area, so a 38px header button already answers to a 44px
306
+ thumb. A product that wants the buttons themselves drawn at 44 says so:
307
+
308
+ ```css
309
+ @media (pointer: coarse) {
310
+ :root { --ick-control-m: 44px; }
311
+ }
312
+ ```
313
+
314
+ The composer's own three controls are 28px in a row whose layout is animated,
315
+ and are not sized from these yet.
316
+
248
317
  ## Motion
249
318
 
250
319
  `--ick-ease`, `--ick-ease-overshoot`, and the `--ick-duration-*` scale. The kit