@carissa-io/theme-default 0.3.12 → 0.3.13
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 +12 -0
- package/README.md +1 -1
- package/dist/index.css +154 -0
- package/package.json +22 -2
- package/scss/index.scss +56 -0
package/DESIGN.md
CHANGED
|
@@ -428,6 +428,18 @@ From [components-faq](components/components-faq): `Faq`. It is the Accordion (th
|
|
|
428
428
|
## Carousel
|
|
429
429
|
From [components-carousel](components/components-carousel): `Carousel`. The arrows and the pause / play button are the secondary button's: square, 2.75rem, a 1px `--c-muted` border (5.74:1 / 7.85:1 on the background), a `--c-surface-active` hover and a `--c-text` glyph (17.93:1 / 18.16:1; 14.23:1 / 13.88:1 on the hover). The glyphs (corner, bars, triangle) are drawn with borders in `currentColor`, so they follow the mode and need no new colour. Disabled arrows are at half opacity (exempt). The dots are 0.625rem circles in `--c-muted` (5.74:1 / 7.85:1 on the background, 5.27:1 / 7.11:1 on `--c-surface`, above the 3:1 minimum for graphics) and the current one is `--c-primary` (21:1 / 19.8:1) and 1.5rem long. Colour is not the only cue: the current dot is a bar against circles, and it also carries `aria-current`; the lightness gap between the two colours is 3.66:1 in light and 2.52:1 in dark (below 3:1 there, which the shape makes up for). The keyboard ring is the theme's 1px `--c-focus` outline offset by 2px (21:1 / 19.8:1). Transitions run at 0.2s and stop under `prefers-reduced-motion`.
|
|
430
430
|
|
|
431
|
+
## Visually hidden
|
|
432
|
+
From [components-visually-hidden](components/components-visually-hidden): `VisuallyHidden`. The hidden state is the clip pattern and has no look. The revealed state (`focusable`, a skip link) is `--c-text` on `--c-background` (17.93:1 / 18.16:1) with a 0.75rem 1rem padding at the top-left corner; it is only shown while it has keyboard focus, so the browser's focus indicator still marks it and the pair stays well above 4.5:1 in both modes. No new colour.
|
|
433
|
+
|
|
434
|
+
## Live region
|
|
435
|
+
From [components-live-region](components/components-live-region): `LiveRegion`. Hidden regions have no look (they are announced, not seen). The visible variant is a square box: `--c-text` on `--c-surface` (16.44:1 / 16.44:1) with a 1px `--c-muted` border (5.27:1 / 7.11:1 on the surface, above the 3:1 non-text minimum), 0.75rem 1rem padding; an empty region takes no space.
|
|
436
|
+
|
|
437
|
+
## Theme switch
|
|
438
|
+
From [components-theme-switch](components/components-theme-switch): `ThemeSwitch`. A segmented control built like the stepper and tabs: square, a 1px `--c-muted` border (5.74:1 / 7.85:1 on the background) and 2.75rem options with 1.25rem icons (`currentColor`, so `--c-text` at 17.93:1 / 18.16:1 on the background). The current option is filled `--c-primary` with an `--c-on-primary` icon (21:1 / 21:1) and a 2px `--c-on-primary` underline, so it is told apart by shape as well as by colour; it also carries `aria-checked`. Hover is a `--c-surface-active` fill (`--c-text` 14.23:1 / 13.88:1). The keyboard ring is the theme's 1px `--c-focus` outline offset by 2px (21:1 / 19.8:1 on the background). The text labels stay visually hidden (the icons are the visible cue). The `cycle` variant is one bordered button of the same height showing the current mode icon (`--c-text` on `--c-background`, same hover and ring).
|
|
439
|
+
|
|
440
|
+
## Icon
|
|
441
|
+
From [components-icon](components/components-icon): `Icon`. No colour of its own: the stroke is `currentColor`, so an icon has the contrast of the text it sits in (17.93:1 / 18.16:1 for `--c-text`, 5.74:1 / 7.85:1 for `--c-muted`, both above the 3:1 non-text minimum). Sizes are pinned in rem (1, 1.25, 1.5 and 2rem) so they do not drift with the font size around them. A decorative icon is `aria-hidden`; a lone one needs a `label`.
|
|
442
|
+
|
|
431
443
|
## Keyboard focus (all controls)
|
|
432
444
|
One rule keeps the controls coherent: **an outlined control thickens its own border from 1px to 2px, black** (text fields,
|
|
433
445
|
select, combobox, date picker, textarea, upload, empty checkbox, off switch, radio, secondary and ghost buttons); **a filled
|
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ it: check the names against the theme's `scss/_tokens.scss` before you switch.
|
|
|
142
142
|
|
|
143
143
|
## What it configures
|
|
144
144
|
`components-input`, `-button`, `-checkbox`, `-switch`, `-radio-group`, `-slider`, `-popover`, `-listbox`, `-select`,
|
|
145
|
-
`-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` and `-
|
|
145
|
+
`-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` and `-icon`. `components-email`, `-password`, `-url` and `-textarea`
|
|
146
146
|
are styled through the input.
|
|
147
147
|
|
|
148
148
|
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
|
@@ -5282,3 +5282,157 @@ ol.c-list {
|
|
|
5282
5282
|
transition: none;
|
|
5283
5283
|
}
|
|
5284
5284
|
}
|
|
5285
|
+
.c-visually-hidden {
|
|
5286
|
+
position: absolute;
|
|
5287
|
+
width: 1px;
|
|
5288
|
+
height: 1px;
|
|
5289
|
+
padding: 0;
|
|
5290
|
+
margin: -1px;
|
|
5291
|
+
overflow: hidden;
|
|
5292
|
+
white-space: nowrap;
|
|
5293
|
+
border: 0;
|
|
5294
|
+
clip-path: inset(50%);
|
|
5295
|
+
}
|
|
5296
|
+
|
|
5297
|
+
.c-visually-hidden--focusable:focus,
|
|
5298
|
+
.c-visually-hidden--focusable:focus-within {
|
|
5299
|
+
position: fixed;
|
|
5300
|
+
top: 0.5rem;
|
|
5301
|
+
left: 0.5rem;
|
|
5302
|
+
z-index: 1000;
|
|
5303
|
+
width: auto;
|
|
5304
|
+
height: auto;
|
|
5305
|
+
padding: 0.75rem 1rem;
|
|
5306
|
+
margin: 0;
|
|
5307
|
+
overflow: visible;
|
|
5308
|
+
color: var(--c-text);
|
|
5309
|
+
white-space: normal;
|
|
5310
|
+
background: var(--c-background);
|
|
5311
|
+
clip-path: none;
|
|
5312
|
+
}
|
|
5313
|
+
|
|
5314
|
+
.c-live-region--hidden {
|
|
5315
|
+
position: absolute;
|
|
5316
|
+
width: 1px;
|
|
5317
|
+
height: 1px;
|
|
5318
|
+
padding: 0;
|
|
5319
|
+
margin: -1px;
|
|
5320
|
+
overflow: hidden;
|
|
5321
|
+
white-space: nowrap;
|
|
5322
|
+
border: 0;
|
|
5323
|
+
clip-path: inset(50%);
|
|
5324
|
+
}
|
|
5325
|
+
|
|
5326
|
+
.c-live-region:not(.c-live-region--hidden) {
|
|
5327
|
+
padding: 0.75rem 1rem;
|
|
5328
|
+
color: var(--c-text);
|
|
5329
|
+
background: var(--c-surface);
|
|
5330
|
+
border: 1px solid var(--c-muted);
|
|
5331
|
+
border-radius: 0;
|
|
5332
|
+
}
|
|
5333
|
+
.c-live-region:not(.c-live-region--hidden):empty {
|
|
5334
|
+
display: none;
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5337
|
+
.c-theme-switch {
|
|
5338
|
+
box-sizing: border-box;
|
|
5339
|
+
display: inline-flex;
|
|
5340
|
+
align-items: center;
|
|
5341
|
+
gap: 0;
|
|
5342
|
+
padding: 0;
|
|
5343
|
+
color: var(--c-text);
|
|
5344
|
+
vertical-align: middle;
|
|
5345
|
+
background: var(--c-background);
|
|
5346
|
+
border: 1px solid var(--c-muted);
|
|
5347
|
+
border-radius: 0;
|
|
5348
|
+
}
|
|
5349
|
+
|
|
5350
|
+
.c-theme-switch__option,
|
|
5351
|
+
button.c-theme-switch {
|
|
5352
|
+
font: inherit;
|
|
5353
|
+
color: inherit;
|
|
5354
|
+
cursor: pointer;
|
|
5355
|
+
background: transparent;
|
|
5356
|
+
border: 0;
|
|
5357
|
+
transition: background-color 0.2s;
|
|
5358
|
+
}
|
|
5359
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5360
|
+
.c-theme-switch__option,
|
|
5361
|
+
button.c-theme-switch {
|
|
5362
|
+
transition: none;
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
.c-theme-switch__option:hover,
|
|
5366
|
+
button.c-theme-switch:hover {
|
|
5367
|
+
background: var(--c-surface-active);
|
|
5368
|
+
}
|
|
5369
|
+
.c-theme-switch__option:focus-visible,
|
|
5370
|
+
button.c-theme-switch:focus-visible {
|
|
5371
|
+
outline: 1px solid var(--c-focus);
|
|
5372
|
+
outline-offset: 2px;
|
|
5373
|
+
}
|
|
5374
|
+
|
|
5375
|
+
.c-theme-switch__option {
|
|
5376
|
+
display: inline-flex;
|
|
5377
|
+
align-items: center;
|
|
5378
|
+
gap: 0.5rem;
|
|
5379
|
+
padding: 0.75rem 0.875rem;
|
|
5380
|
+
border-radius: 0;
|
|
5381
|
+
}
|
|
5382
|
+
|
|
5383
|
+
.c-theme-switch__option--current,
|
|
5384
|
+
.c-theme-switch__option--current:hover {
|
|
5385
|
+
color: var(--c-on-primary);
|
|
5386
|
+
background: var(--c-primary);
|
|
5387
|
+
box-shadow: inset 0 -2px 0 var(--c-on-primary);
|
|
5388
|
+
}
|
|
5389
|
+
|
|
5390
|
+
.c-theme-switch--cycle {
|
|
5391
|
+
padding: 0.75rem 0.875rem;
|
|
5392
|
+
}
|
|
5393
|
+
|
|
5394
|
+
.c-theme-switch__icon {
|
|
5395
|
+
display: inline-flex;
|
|
5396
|
+
flex: none;
|
|
5397
|
+
width: 1.25rem;
|
|
5398
|
+
height: 1.25rem;
|
|
5399
|
+
}
|
|
5400
|
+
|
|
5401
|
+
.c-theme-switch__label {
|
|
5402
|
+
position: absolute;
|
|
5403
|
+
width: 1px;
|
|
5404
|
+
height: 1px;
|
|
5405
|
+
padding: 0;
|
|
5406
|
+
margin: -1px;
|
|
5407
|
+
overflow: hidden;
|
|
5408
|
+
white-space: nowrap;
|
|
5409
|
+
border: 0;
|
|
5410
|
+
clip-path: inset(50%);
|
|
5411
|
+
}
|
|
5412
|
+
|
|
5413
|
+
.c-icon {
|
|
5414
|
+
flex-shrink: 0;
|
|
5415
|
+
width: 1.25rem;
|
|
5416
|
+
height: 1.25rem;
|
|
5417
|
+
vertical-align: -0.2em;
|
|
5418
|
+
}
|
|
5419
|
+
|
|
5420
|
+
.c-icon--sm {
|
|
5421
|
+
width: 1rem;
|
|
5422
|
+
height: 1rem;
|
|
5423
|
+
}
|
|
5424
|
+
|
|
5425
|
+
.c-icon--md {
|
|
5426
|
+
width: 1.25rem;
|
|
5427
|
+
height: 1.25rem;
|
|
5428
|
+
}
|
|
5429
|
+
|
|
5430
|
+
.c-icon--lg {
|
|
5431
|
+
width: 1.5rem;
|
|
5432
|
+
height: 1.5rem;
|
|
5433
|
+
}
|
|
5434
|
+
|
|
5435
|
+
.c-icon--xl {
|
|
5436
|
+
width: 2rem;
|
|
5437
|
+
height: 2rem;
|
|
5438
|
+
}
|
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.13",
|
|
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",
|
|
@@ -96,7 +96,11 @@
|
|
|
96
96
|
"@carissa-io/components-async-autocomplete": "^0.1.0",
|
|
97
97
|
"@carissa-io/components-section": "^0.1.0",
|
|
98
98
|
"@carissa-io/components-faq": "^0.1.0",
|
|
99
|
-
"@carissa-io/components-carousel": "^0.1.0"
|
|
99
|
+
"@carissa-io/components-carousel": "^0.1.0",
|
|
100
|
+
"@carissa-io/components-visually-hidden": "^0.1.0",
|
|
101
|
+
"@carissa-io/components-live-region": "^0.1.0",
|
|
102
|
+
"@carissa-io/components-theme-switch": "^0.1.0",
|
|
103
|
+
"@carissa-io/components-icon": "^0.1.0"
|
|
100
104
|
},
|
|
101
105
|
"peerDependenciesMeta": {
|
|
102
106
|
"@carissa-io/components-input": {
|
|
@@ -287,6 +291,18 @@
|
|
|
287
291
|
},
|
|
288
292
|
"@carissa-io/components-carousel": {
|
|
289
293
|
"optional": true
|
|
294
|
+
},
|
|
295
|
+
"@carissa-io/components-visually-hidden": {
|
|
296
|
+
"optional": true
|
|
297
|
+
},
|
|
298
|
+
"@carissa-io/components-live-region": {
|
|
299
|
+
"optional": true
|
|
300
|
+
},
|
|
301
|
+
"@carissa-io/components-theme-switch": {
|
|
302
|
+
"optional": true
|
|
303
|
+
},
|
|
304
|
+
"@carissa-io/components-icon": {
|
|
305
|
+
"optional": true
|
|
290
306
|
}
|
|
291
307
|
},
|
|
292
308
|
"devDependencies": {
|
|
@@ -312,10 +328,12 @@
|
|
|
312
328
|
"@carissa-io/components-empty-state": "^0.1.0",
|
|
313
329
|
"@carissa-io/components-faq": "^0.1.0",
|
|
314
330
|
"@carissa-io/components-field": "^0.1.0",
|
|
331
|
+
"@carissa-io/components-icon": "^0.1.0",
|
|
315
332
|
"@carissa-io/components-input": "^0.2.1",
|
|
316
333
|
"@carissa-io/components-link": "^0.1.0",
|
|
317
334
|
"@carissa-io/components-list": "^0.1.0",
|
|
318
335
|
"@carissa-io/components-listbox": "^0.1.1",
|
|
336
|
+
"@carissa-io/components-live-region": "^0.1.0",
|
|
319
337
|
"@carissa-io/components-menu": "^0.1.0",
|
|
320
338
|
"@carissa-io/components-modal": "^0.1.0",
|
|
321
339
|
"@carissa-io/components-navbar": "^0.1.0",
|
|
@@ -342,6 +360,7 @@
|
|
|
342
360
|
"@carissa-io/components-tabs": "^0.1.0",
|
|
343
361
|
"@carissa-io/components-tag": "^0.1.0",
|
|
344
362
|
"@carissa-io/components-tag-input": "^0.1.0",
|
|
363
|
+
"@carissa-io/components-theme-switch": "^0.1.0",
|
|
345
364
|
"@carissa-io/components-time-picker": "^0.1.0",
|
|
346
365
|
"@carissa-io/components-timeline": "^0.1.0",
|
|
347
366
|
"@carissa-io/components-toast": "^0.1.0",
|
|
@@ -349,6 +368,7 @@
|
|
|
349
368
|
"@carissa-io/components-tree": "^0.1.0",
|
|
350
369
|
"@carissa-io/components-typography": "^0.1.0",
|
|
351
370
|
"@carissa-io/components-upload": "^0.1.1",
|
|
371
|
+
"@carissa-io/components-visually-hidden": "^0.1.0",
|
|
352
372
|
"sass-embedded": "^1.105.1",
|
|
353
373
|
"vitest": "^4.1.11"
|
|
354
374
|
},
|
package/scss/index.scss
CHANGED
|
@@ -1660,3 +1660,59 @@
|
|
|
1660
1660
|
$c-carousel-focus-outline: $focus-width solid $var-focus,
|
|
1661
1661
|
$c-carousel-focus-outline-offset: 2px
|
|
1662
1662
|
);
|
|
1663
|
+
|
|
1664
|
+
// Visually hidden: the hidden state is the clip pattern and has no look. The revealed (focusable) state, a skip link, is
|
|
1665
|
+
// --c-text on --c-background (17.93:1 / 18.16:1) with comfortable padding; the browser's focus ring still marks it. No
|
|
1666
|
+
// component stylesheet is forwarded here, so the order does not matter.
|
|
1667
|
+
@use '@carissa-io/components-visually-hidden/scss' as visually-hidden with (
|
|
1668
|
+
$c-visually-hidden-focus-top: 0.5rem,
|
|
1669
|
+
$c-visually-hidden-focus-left: 0.5rem,
|
|
1670
|
+
$c-visually-hidden-focus-padding: 0.75rem 1rem,
|
|
1671
|
+
$c-visually-hidden-focus-background: $var-background,
|
|
1672
|
+
$c-visually-hidden-focus-color: $var-text
|
|
1673
|
+
);
|
|
1674
|
+
|
|
1675
|
+
// Live region: only the visible variant has a look, a square box like the theme's alerts and cards: --c-text on
|
|
1676
|
+
// --c-surface (16.44:1 / 16.44:1) with a 1px --c-muted border (5.27:1 / 7.11:1 on the surface, above the 3:1 minimum). An empty
|
|
1677
|
+
// region takes no space (the component hides it).
|
|
1678
|
+
@use '@carissa-io/components-live-region/scss' as live-region with (
|
|
1679
|
+
$c-live-region-visible-padding: 0.75rem 1rem,
|
|
1680
|
+
$c-live-region-visible-radius: $radius,
|
|
1681
|
+
$c-live-region-visible-color: $var-text,
|
|
1682
|
+
$c-live-region-visible-background: $var-surface,
|
|
1683
|
+
$c-live-region-visible-border: 1px solid $var-muted
|
|
1684
|
+
);
|
|
1685
|
+
|
|
1686
|
+
// Theme switch: a segmented control like the stepper and tabs: a square box with a 1px --c-muted border (5.74:1 / 7.85:1 on the
|
|
1687
|
+
// background) and 2.75rem options. The current option is filled --c-primary with --c-on-primary (21:1 / 21:1) and a 2px
|
|
1688
|
+
// --c-on-primary underline, so it is told apart by shape as well as by colour. Hover is --c-surface-active (--c-text 14.23:1 /
|
|
1689
|
+
// 13.88:1) and the keyboard ring is the theme's 1px --c-focus outline offset by 2px (21:1 / 19.8:1). The labels stay visually hidden.
|
|
1690
|
+
@use '@carissa-io/components-theme-switch/scss' as theme-switch with (
|
|
1691
|
+
$c-theme-switch-gap: 0,
|
|
1692
|
+
$c-theme-switch-padding: 0,
|
|
1693
|
+
$c-theme-switch-radius: $radius,
|
|
1694
|
+
$c-theme-switch-option-radius: $radius,
|
|
1695
|
+
$c-theme-switch-icon-size: 1.25rem,
|
|
1696
|
+
$c-theme-switch-option-padding: 0.75rem 0.875rem,
|
|
1697
|
+
$c-theme-switch-option-gap: 0.5rem,
|
|
1698
|
+
$c-theme-switch-show-label: false,
|
|
1699
|
+
$c-theme-switch-color: $var-text,
|
|
1700
|
+
$c-theme-switch-background: $var-background,
|
|
1701
|
+
$c-theme-switch-border: 1px solid $var-muted,
|
|
1702
|
+
$c-theme-switch-hover-background: $var-surface-active,
|
|
1703
|
+
$c-theme-switch-current-color: $var-on-primary,
|
|
1704
|
+
$c-theme-switch-current-background: $var-primary,
|
|
1705
|
+
$c-theme-switch-current-marker: inset 0 -2px 0 $var-on-primary,
|
|
1706
|
+
$c-theme-switch-focus-outline: $focus-width solid $var-focus,
|
|
1707
|
+
$c-theme-switch-focus-offset: 2px,
|
|
1708
|
+
$c-theme-switch-transition: $transition-duration
|
|
1709
|
+
);
|
|
1710
|
+
|
|
1711
|
+
// Icon: pinned sizes (1, 1.25, 1.5 and 2rem) so a glyph does not change with the font size around it; the colour is the
|
|
1712
|
+
// text colour of the parent (currentColor), so it follows both modes with no colour of its own.
|
|
1713
|
+
@use '@carissa-io/components-icon/scss' as icon with (
|
|
1714
|
+
$c-icon-size-sm: 1rem,
|
|
1715
|
+
$c-icon-size-md: 1.25rem,
|
|
1716
|
+
$c-icon-size-lg: 1.5rem,
|
|
1717
|
+
$c-icon-size-xl: 2rem
|
|
1718
|
+
);
|