@carissa-io/theme-default 0.3.18 → 0.3.20
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/DESIGN.md +9 -0
- package/README.md +1 -1
- package/dist/index.css +107 -0
- package/package.json +18 -2
- package/scss/index.scss +52 -0
package/DESIGN.md
CHANGED
|
@@ -477,6 +477,15 @@ From [components-message](components/components-message): `Message`. The roles a
|
|
|
477
477
|
## Message list
|
|
478
478
|
From [components-message-list](components/components-message-list): `MessageList`. A scrolling log with no fill of its own: it sits on the page background and the bubbles carry the contrast. Messages are 1rem apart inside 1rem of padding. The log takes keyboard focus so it can be scrolled, and its ring is the theme's 1px `--c-focus` outline drawn inside the box (21:1 / 19.8:1 on the background). The "Jump to latest" button is the secondary Button (see [Buttons](#buttons)) centred on the bottom edge and floating 1rem above it; it appears only when the reader scrolled up. The `empty` slot is an `EmptyState` with 2rem of padding (keep the list on `--c-background`, see [Empty state](#empty-state)). No scroll shadow: the component has no variable for it.
|
|
479
479
|
|
|
480
|
+
## Prompt input
|
|
481
|
+
From [components-prompt-input](components/components-prompt-input): `PromptInput`. The composer is a `--c-surface` panel with a 1px `--c-muted` frame (5.27:1 / 7.11:1 on `--c-surface`, 5.74:1 / 7.85:1 on the background, so 3:1 or more as a graphic), square, with 0.5rem of padding and 0.5rem between the attachments row and the field row. The field is the Input, so it stays on `--c-background` inside the panel and keeps its own states: `--c-muted` border, `--c-primary` on hover, and the thick `--c-focus` ring on keyboard focus (21:1 / 19.8:1), which is the focus ring of the composer (the panel has no ring of its own). The send button is the primary Button with an arrow icon, and while an answer streams it becomes the same button with a stop icon, so the control never moves. The buttons sit at the last line (`flex-end`) while the field grows, the field never shows a resize handle, and `min-width: 0` lets it shrink in a narrow column, so growing to `max_rows` shifts nothing around it. Known limit: the Input's textarea minimum height (6rem) applies to the field, so the composer starts about four lines tall whatever `rows` says; a theme cannot lower it for the composer alone. A disabled composer relies on the Input's disabled colours (`--c-disabled-text` on `--c-surface`, exempt from contrast), so the panel keeps full opacity.
|
|
482
|
+
|
|
483
|
+
## Suggested prompts
|
|
484
|
+
From [components-suggested-prompts](components/components-suggested-prompts): `SuggestedPrompts`. Each suggestion is a secondary Button (see [Buttons](#buttons)): `--c-text` label on `--c-background` (17.93:1 / 18.16:1) with a 1px `--c-muted` border, `--c-primary` on hover. Horizontal suggestions are 0.5rem apart and wrap onto as many lines as needed, starting at the start edge; vertical ones stack at full width with the label at the start. Each keeps the 44px touch target of the Button. The group has no fill or frame of its own.
|
|
485
|
+
|
|
486
|
+
## Message actions
|
|
487
|
+
From [components-message-actions](components/components-message-actions): `MessageActions`. Quiet ghost icon buttons (transparent, a `--c-surface` fill on hover, `--c-surface-active` while pressed), 0.25rem apart, 16px icons in the `--c-text` colour (14.23:1 / 13.88:1 or more on the bubbles). Keyboard focus is the Button's `--c-focus` ring on the item that holds the roving focus. A chosen thumb takes `--c-info` (6.15:1 / 7.05:1 on `--c-surface`, 6.70:1 / 7.79:1 on the background) and a copied action `--c-success` (4.60:1 / 10.29:1 on `--c-surface`, 5.02:1 / 11.36:1 on the background; 3.98:1 on `--c-surface-active` in light, which is above the 3:1 an icon needs). Neither state is colour alone: the thumb carries `aria-pressed` and the copied action swaps the copy icon for a check and takes the `Copied` name, which is also announced. The component has no variable for a fill on the chosen thumb, so the visible cue of the chosen thumb is its colour; a filled icon or a background would be a component release.
|
|
488
|
+
|
|
480
489
|
## Keyboard focus (all controls)
|
|
481
490
|
One rule keeps the controls coherent: **an outlined control thickens its own border from 1px to 2px, black** (text fields,
|
|
482
491
|
select, combobox, date picker, textarea, upload, empty checkbox, off switch, radio, secondary and ghost buttons); **a filled
|
package/README.md
CHANGED
|
@@ -169,7 +169,7 @@ it: check the names against the theme's `scss/_tokens.scss` before you switch.
|
|
|
169
169
|
|
|
170
170
|
## What it configures
|
|
171
171
|
`components-input`, `-button`, `-checkbox`, `-switch`, `-radio-group`, `-slider`, `-popover`, `-listbox`, `-select`,
|
|
172
|
-
`-combobox`, `-upload`, `-calendar`, `-date-picker`, `-search`, `-typography`, `-card`, `-alert`, `-spinner`, `-modal`, `-toast`, `-divider`, `-badge`, `-tag`, `-link`, `-avatar`, `-skeleton`, `-progress`, `-tooltip`, `-prose`, `-tabs`, `-accordion`, `-breadcrumb`, `-pagination`, `-stepper`, `-sidebar`, `-navbar`, `-drawer`, `-menu`, `-table`, `-list`, `-description-list`, `-stat`, `-empty-state`, `-timeline`, `-tree`, `-code`, `-field`, `-number-input`, `-otp-input`, `-phone`, `-tag-input`, `-time-picker`, `-date-range`, `-rating`, `-color-picker`, `-async-autocomplete`, `-section`, `-faq`, `-carousel`, `-visually-hidden`, `-live-region`, `-theme-switch`, `-icon`, `-ai-label`, `-thinking-indicator`, `-streaming-text`, `-message` and `-message-
|
|
172
|
+
`-combobox`, `-upload`, `-calendar`, `-date-picker`, `-search`, `-typography`, `-card`, `-alert`, `-spinner`, `-modal`, `-toast`, `-divider`, `-badge`, `-tag`, `-link`, `-avatar`, `-skeleton`, `-progress`, `-tooltip`, `-prose`, `-tabs`, `-accordion`, `-breadcrumb`, `-pagination`, `-stepper`, `-sidebar`, `-navbar`, `-drawer`, `-menu`, `-table`, `-list`, `-description-list`, `-stat`, `-empty-state`, `-timeline`, `-tree`, `-code`, `-field`, `-number-input`, `-otp-input`, `-phone`, `-tag-input`, `-time-picker`, `-date-range`, `-rating`, `-color-picker`, `-async-autocomplete`, `-section`, `-faq`, `-carousel`, `-visually-hidden`, `-live-region`, `-theme-switch`, `-icon`, `-ai-label`, `-thinking-indicator`, `-streaming-text`, `-message`, `-message-list`, `-prompt-input`, `-suggested-prompts` and `-message-actions`. `components-email`, `-password`, `-url` and `-textarea`
|
|
173
173
|
are styled through the input.
|
|
174
174
|
|
|
175
175
|
The checkbox's mixed state (`indeterminate`, from the next `components-checkbox` release, class `c-checkbox--indeterminate`) is the checked box with a 10px dash in `--c-on-primary`; on an older checkbox the rule is simply unused.
|
package/dist/index.css
CHANGED
|
@@ -5787,3 +5787,110 @@ button.c-theme-switch:focus-visible {
|
|
|
5787
5787
|
.c-message-list__jump > * {
|
|
5788
5788
|
pointer-events: auto;
|
|
5789
5789
|
}
|
|
5790
|
+
|
|
5791
|
+
.c-prompt-input {
|
|
5792
|
+
box-sizing: border-box;
|
|
5793
|
+
display: flex;
|
|
5794
|
+
flex-direction: column;
|
|
5795
|
+
gap: 0.5rem;
|
|
5796
|
+
padding: 0.5rem;
|
|
5797
|
+
border: 1px solid var(--c-muted);
|
|
5798
|
+
border-radius: 0;
|
|
5799
|
+
background: var(--c-surface);
|
|
5800
|
+
}
|
|
5801
|
+
|
|
5802
|
+
.c-prompt-input--disabled {
|
|
5803
|
+
opacity: 1;
|
|
5804
|
+
}
|
|
5805
|
+
|
|
5806
|
+
.c-prompt-input__attachments {
|
|
5807
|
+
display: flex;
|
|
5808
|
+
flex-wrap: wrap;
|
|
5809
|
+
gap: 0.5rem;
|
|
5810
|
+
}
|
|
5811
|
+
|
|
5812
|
+
.c-prompt-input__row {
|
|
5813
|
+
display: flex;
|
|
5814
|
+
align-items: flex-end;
|
|
5815
|
+
gap: 0.5rem;
|
|
5816
|
+
}
|
|
5817
|
+
|
|
5818
|
+
.c-prompt-input__actions {
|
|
5819
|
+
display: flex;
|
|
5820
|
+
align-items: center;
|
|
5821
|
+
gap: 0.25rem;
|
|
5822
|
+
}
|
|
5823
|
+
|
|
5824
|
+
.c-prompt-input__input {
|
|
5825
|
+
flex: 1 1 auto;
|
|
5826
|
+
min-width: 0;
|
|
5827
|
+
}
|
|
5828
|
+
.c-prompt-input__input .c-input__control {
|
|
5829
|
+
resize: none;
|
|
5830
|
+
min-height: 0;
|
|
5831
|
+
}
|
|
5832
|
+
|
|
5833
|
+
.c-prompt-input .c-prompt-input__input .c-input__box {
|
|
5834
|
+
border: 0;
|
|
5835
|
+
background: transparent;
|
|
5836
|
+
padding-top: 0.8125rem;
|
|
5837
|
+
padding-bottom: 0.8125rem;
|
|
5838
|
+
padding-left: 0.25rem;
|
|
5839
|
+
padding-right: 0.25rem;
|
|
5840
|
+
min-height: 0;
|
|
5841
|
+
}
|
|
5842
|
+
.c-prompt-input .c-prompt-input__input .c-input__box:focus-within {
|
|
5843
|
+
box-shadow: none;
|
|
5844
|
+
}
|
|
5845
|
+
|
|
5846
|
+
.c-prompt-input:focus-within {
|
|
5847
|
+
border-color: var(--c-focus);
|
|
5848
|
+
box-shadow: 0 0 0 1px var(--c-focus);
|
|
5849
|
+
}
|
|
5850
|
+
|
|
5851
|
+
.c-prompt-input__send,
|
|
5852
|
+
.c-prompt-input__stop {
|
|
5853
|
+
flex: 0 0 auto;
|
|
5854
|
+
}
|
|
5855
|
+
|
|
5856
|
+
.c-suggested-prompts {
|
|
5857
|
+
box-sizing: border-box;
|
|
5858
|
+
display: flex;
|
|
5859
|
+
gap: 0.5rem;
|
|
5860
|
+
padding: 0;
|
|
5861
|
+
}
|
|
5862
|
+
|
|
5863
|
+
.c-suggested-prompts--horizontal {
|
|
5864
|
+
flex-flow: row wrap;
|
|
5865
|
+
justify-content: flex-start;
|
|
5866
|
+
}
|
|
5867
|
+
|
|
5868
|
+
.c-suggested-prompts--vertical {
|
|
5869
|
+
flex-direction: column;
|
|
5870
|
+
align-items: stretch;
|
|
5871
|
+
}
|
|
5872
|
+
.c-suggested-prompts--vertical .c-suggested-prompts__item {
|
|
5873
|
+
justify-content: start;
|
|
5874
|
+
text-align: start;
|
|
5875
|
+
}
|
|
5876
|
+
|
|
5877
|
+
.c-message-actions {
|
|
5878
|
+
box-sizing: border-box;
|
|
5879
|
+
display: flex;
|
|
5880
|
+
flex-wrap: wrap;
|
|
5881
|
+
align-items: center;
|
|
5882
|
+
gap: 0.25rem;
|
|
5883
|
+
padding: 0;
|
|
5884
|
+
}
|
|
5885
|
+
|
|
5886
|
+
.c-message-actions__action--pressed {
|
|
5887
|
+
color: var(--c-info);
|
|
5888
|
+
}
|
|
5889
|
+
|
|
5890
|
+
.c-message-actions__action[aria-pressed=true] {
|
|
5891
|
+
background: transparent;
|
|
5892
|
+
}
|
|
5893
|
+
|
|
5894
|
+
.c-message-actions__action--copied {
|
|
5895
|
+
color: var(--c-success);
|
|
5896
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carissa-io/theme-default",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "Carissa UI: the default theme (Swiss minimalism) as SCSS variable overrides of the Carissa components, with a compiled CSS build",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "dist/index.css",
|
|
@@ -105,7 +105,10 @@
|
|
|
105
105
|
"@carissa-io/components-thinking-indicator": "^0.1.0",
|
|
106
106
|
"@carissa-io/components-streaming-text": "^0.1.0",
|
|
107
107
|
"@carissa-io/components-message": "^0.1.0",
|
|
108
|
-
"@carissa-io/components-message-list": "^0.1.0"
|
|
108
|
+
"@carissa-io/components-message-list": "^0.1.0",
|
|
109
|
+
"@carissa-io/components-prompt-input": "^0.1.2",
|
|
110
|
+
"@carissa-io/components-suggested-prompts": "^0.1.0",
|
|
111
|
+
"@carissa-io/components-message-actions": "^0.1.0"
|
|
109
112
|
},
|
|
110
113
|
"peerDependenciesMeta": {
|
|
111
114
|
"@carissa-io/components-input": {
|
|
@@ -323,6 +326,15 @@
|
|
|
323
326
|
},
|
|
324
327
|
"@carissa-io/components-message-list": {
|
|
325
328
|
"optional": true
|
|
329
|
+
},
|
|
330
|
+
"@carissa-io/components-prompt-input": {
|
|
331
|
+
"optional": true
|
|
332
|
+
},
|
|
333
|
+
"@carissa-io/components-suggested-prompts": {
|
|
334
|
+
"optional": true
|
|
335
|
+
},
|
|
336
|
+
"@carissa-io/components-message-actions": {
|
|
337
|
+
"optional": true
|
|
326
338
|
}
|
|
327
339
|
},
|
|
328
340
|
"devDependencies": {
|
|
@@ -357,6 +369,7 @@
|
|
|
357
369
|
"@carissa-io/components-live-region": "^0.1.0",
|
|
358
370
|
"@carissa-io/components-menu": "^0.1.0",
|
|
359
371
|
"@carissa-io/components-message": "^0.1.0",
|
|
372
|
+
"@carissa-io/components-message-actions": "^0.1.0",
|
|
360
373
|
"@carissa-io/components-message-list": "^0.1.0",
|
|
361
374
|
"@carissa-io/components-modal": "^0.1.3",
|
|
362
375
|
"@carissa-io/components-navbar": "^0.1.0",
|
|
@@ -366,6 +379,7 @@
|
|
|
366
379
|
"@carissa-io/components-phone": "^0.1.0",
|
|
367
380
|
"@carissa-io/components-popover": "^0.1.1",
|
|
368
381
|
"@carissa-io/components-progress": "^0.1.0",
|
|
382
|
+
"@carissa-io/components-prompt-input": "^0.1.2",
|
|
369
383
|
"@carissa-io/components-prose": "^0.1.0",
|
|
370
384
|
"@carissa-io/components-radio-group": "^0.1.1",
|
|
371
385
|
"@carissa-io/components-rating": "^0.1.0",
|
|
@@ -379,11 +393,13 @@
|
|
|
379
393
|
"@carissa-io/components-stat": "^0.1.0",
|
|
380
394
|
"@carissa-io/components-stepper": "^0.1.0",
|
|
381
395
|
"@carissa-io/components-streaming-text": "^0.1.0",
|
|
396
|
+
"@carissa-io/components-suggested-prompts": "^0.1.0",
|
|
382
397
|
"@carissa-io/components-switch": "^0.1.1",
|
|
383
398
|
"@carissa-io/components-table": "^0.1.0",
|
|
384
399
|
"@carissa-io/components-tabs": "^0.1.0",
|
|
385
400
|
"@carissa-io/components-tag": "^0.1.0",
|
|
386
401
|
"@carissa-io/components-tag-input": "^0.1.0",
|
|
402
|
+
"@carissa-io/components-textarea": "^0.1.1",
|
|
387
403
|
"@carissa-io/components-theme-switch": "^0.1.0",
|
|
388
404
|
"@carissa-io/components-thinking-indicator": "^0.1.0",
|
|
389
405
|
"@carissa-io/components-time-picker": "^0.1.0",
|
package/scss/index.scss
CHANGED
|
@@ -1809,3 +1809,55 @@
|
|
|
1809
1809
|
$c-message-list-jump-bottom: 1rem,
|
|
1810
1810
|
$c-message-list-jump-z-index: 1
|
|
1811
1811
|
);
|
|
1812
|
+
|
|
1813
|
+
// Prompt input: the composer is a --c-surface panel with a 1px --c-muted frame (5.27:1 / 7.11:1 on --c-surface, 3:1 or more as a
|
|
1814
|
+
// graphic) around the attachments, the actions, the field and the send button. The field is the Input (configured above), so it
|
|
1815
|
+
// stays white on the panel and keeps its own hover border and --c-focus ring (the thick one of every outlined control). The send
|
|
1816
|
+
// and stop button is the primary Button. Corners are square and the buttons sit on the last line while the field grows, so
|
|
1817
|
+
// nothing shifts. The textarea minimum height of the Input (6rem) also applies to the field. The prompt input forwards the
|
|
1818
|
+
// textarea (so the input), button and icon styles: this block comes after those. No other block forwards it.
|
|
1819
|
+
@use '@carissa-io/components-prompt-input/scss' as prompt-input with (
|
|
1820
|
+
$c-prompt-input-gap: 0.5rem,
|
|
1821
|
+
$c-prompt-input-padding: 0.5rem,
|
|
1822
|
+
$c-prompt-input-background: $var-surface,
|
|
1823
|
+
$c-prompt-input-border: 1px solid $var-muted,
|
|
1824
|
+
$c-prompt-input-radius: $radius,
|
|
1825
|
+
$c-prompt-input-row-gap: 0.5rem,
|
|
1826
|
+
$c-prompt-input-row-align: flex-end,
|
|
1827
|
+
$c-prompt-input-attachments-gap: 0.5rem,
|
|
1828
|
+
$c-prompt-input-actions-gap: 0.25rem,
|
|
1829
|
+
$c-prompt-input-input-min-width: 0,
|
|
1830
|
+
$c-prompt-input-input-resize: none,
|
|
1831
|
+
// One box, not a box in a box: the field inside is flat, as tall as the 44px send button on one line, and the composer's own
|
|
1832
|
+
// border shows the focus (the Input's ring is turned off inside it).
|
|
1833
|
+
$c-prompt-input-input-border: 0,
|
|
1834
|
+
$c-prompt-input-input-background: transparent,
|
|
1835
|
+
$c-prompt-input-input-padding-y: 0.8125rem,
|
|
1836
|
+
$c-prompt-input-input-padding-x: 0.25rem,
|
|
1837
|
+
$c-prompt-input-input-box-min-height: 0,
|
|
1838
|
+
$c-prompt-input-input-focus-shadow: none,
|
|
1839
|
+
$c-prompt-input-border-color-focus: $var-focus,
|
|
1840
|
+
$c-prompt-input-focus-shadow: 0 0 0 $focus-width $var-focus,
|
|
1841
|
+
$c-prompt-input-disabled-opacity: 1
|
|
1842
|
+
);
|
|
1843
|
+
|
|
1844
|
+
// Suggested prompts: the starter questions are secondary Buttons (configured above; the index forwards their styles, so this block
|
|
1845
|
+
// comes after the Button one): a 1px --c-muted border and --c-text label, black on hover. 0.5rem apart, they wrap onto several
|
|
1846
|
+
// lines when horizontal and stack at full width, label at the start, when vertical.
|
|
1847
|
+
@use '@carissa-io/components-suggested-prompts/scss' as suggested-prompts with (
|
|
1848
|
+
$c-suggested-prompts-gap: 0.5rem,
|
|
1849
|
+
$c-suggested-prompts-padding: 0,
|
|
1850
|
+
$c-suggested-prompts-justify: flex-start,
|
|
1851
|
+
$c-suggested-prompts-item-text-align: start
|
|
1852
|
+
);
|
|
1853
|
+
|
|
1854
|
+
// Message actions: quiet ghost icon buttons (transparent, a --c-surface fill on hover) 0.25rem apart, each with the Button's
|
|
1855
|
+
// --c-focus ring on the one that holds the roving focus. A chosen thumb takes --c-info (6.15:1 / 7.05:1 on --c-surface) and a
|
|
1856
|
+
// copied one --c-success (4.60:1 / 10.29:1), and the copied one also swaps to a check icon; the thumbs also carry aria-pressed.
|
|
1857
|
+
// The index forwards the button, icon and live-region styles: this block comes after those.
|
|
1858
|
+
@use '@carissa-io/components-message-actions/scss' as message-actions with (
|
|
1859
|
+
$c-message-actions-gap: 0.25rem,
|
|
1860
|
+
$c-message-actions-padding: 0,
|
|
1861
|
+
$c-message-actions-pressed-color: $var-info,
|
|
1862
|
+
$c-message-actions-copied-color: $var-success
|
|
1863
|
+
);
|