@carissa-io/theme-default 0.3.11 → 0.3.12

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 CHANGED
@@ -126,10 +126,11 @@ From [components-checkbox](components/components-checkbox): the whole row (box a
126
126
  least 44px tall. The label is body text (1rem, `#171717`), not the uppercase field-label style.
127
127
  - **Box:** 20px square, square corners, 1px `#666666` border; the border turns black on hover.
128
128
  - **Checked:** black background with a white Lucide `check` mark.
129
+ - **Indeterminate (mixed):** the checked box (`--c-primary` fill and border) with a 10px by 2px square dash in `--c-on-primary` instead of the check, drawn with CSS, so it follows the mode: 21.00:1 in both modes for the dash on the box (above the 4.5:1 text figure), and the box border on the background is 21.00:1 light, 19.80:1 dark (3:1 minimum). It sits after "checked" and before invalid, disabled and focus, so an invalid box keeps its red border, a disabled one turns `--c-disabled-text` on `--c-surface` (the dash follows, exempt from contrast) and the keyboard focus is the filled-box ring below (1px `--c-focus`, offset 2px). Hover only changes the border, which is already `--c-primary`. A test asserts the dash contrast in both modes.
129
130
  - **Disabled:** `#a3a3a3` label and mark on a `#f5f5f5` box with a `#d4d4d4` border; no hover.
130
131
  - **Error:** `#dc3545`, 13px, under the row; the box border turns red too. The built-in error shows after the first
131
132
  interaction, an error passed by the parent shows at once.
132
- - **Focus:** keyboard focus (`:focus-visible`): an empty box thickens its border to 2px; a checked (black) box draws a 1px
133
+ - **Focus:** keyboard focus (`:focus-visible`): an empty box thickens its border to 2px; a checked or indeterminate (black) box draws a 1px
133
134
  black ring offset by 2px.
134
135
 
135
136
  ## Switch
@@ -431,7 +432,7 @@ From [components-carousel](components/components-carousel): `Carousel`. The arro
431
432
  One rule keeps the controls coherent: **an outlined control thickens its own border from 1px to 2px, black** (text fields,
432
433
  select, combobox, date picker, textarea, upload, empty checkbox, off switch, radio, secondary and ghost buttons); **a filled
433
434
  (black) control draws a separate 1px black ring offset by 2px**, because a thicker border would be invisible on a black fill
434
- (primary button, checked checkbox, on switch, slider thumb). Calendar days and the upload remove button use an inset 1px ring.
435
+ (primary button, checked or indeterminate checkbox, on switch, slider thumb). Calendar days and the upload remove button use an inset 1px ring.
435
436
 
436
437
  ## Guidelines
437
438
  - **Accessibility:** 4.5:1 contrast for body text; interactive elements are at least 44px tall.
package/README.md CHANGED
@@ -145,6 +145,8 @@ it: check the names against the theme's `scss/_tokens.scss` before you switch.
145
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 `-carousel`. `components-email`, `-password`, `-url` and `-textarea`
146
146
  are styled through the input.
147
147
 
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.
149
+
148
150
  ## Change a value
149
151
  The palette and the values shared by every component (fonts, radius, minimum height, focus ring, transition, label style, dropdown
150
152
  arrow) are the Sass variables of `scss/_tokens.scss` (the [tokens](#tokens)); each component has one `@use ... with (...)` block of overrides
package/dist/index.css CHANGED
@@ -364,6 +364,8 @@
364
364
  }
365
365
  .c-checkbox__mark {
366
366
  display: inline-flex;
367
+ align-items: center;
368
+ justify-content: center;
367
369
  width: 1rem;
368
370
  height: 1rem;
369
371
  opacity: 0;
@@ -373,6 +375,13 @@
373
375
  width: 100%;
374
376
  height: 100%;
375
377
  }
378
+ .c-checkbox__dash {
379
+ display: block;
380
+ width: 0.625rem;
381
+ height: 2px;
382
+ background: currentcolor;
383
+ border-radius: 0;
384
+ }
376
385
  .c-checkbox__label {
377
386
  min-width: 0;
378
387
  }
@@ -391,6 +400,14 @@
391
400
  .c-checkbox__control:checked + .c-checkbox__box .c-checkbox__mark {
392
401
  opacity: 1;
393
402
  }
403
+ .c-checkbox--indeterminate .c-checkbox__control + .c-checkbox__box {
404
+ color: var(--c-on-primary);
405
+ background: var(--c-primary);
406
+ border-color: var(--c-primary);
407
+ }
408
+ .c-checkbox--indeterminate .c-checkbox__control + .c-checkbox__box .c-checkbox__mark {
409
+ opacity: 1;
410
+ }
394
411
  .c-checkbox--invalid .c-checkbox__control + .c-checkbox__box {
395
412
  border-color: var(--c-error);
396
413
  }
@@ -409,7 +426,7 @@
409
426
  border-color: var(--c-focus);
410
427
  box-shadow: inset 0 0 0 1px var(--c-focus);
411
428
  }
412
- .c-checkbox__control:checked:focus-visible + .c-checkbox__box {
429
+ .c-checkbox__control:checked:focus-visible + .c-checkbox__box, .c-checkbox--indeterminate .c-checkbox__control:focus-visible + .c-checkbox__box {
413
430
  outline: 1px solid var(--c-focus);
414
431
  outline-offset: 2px;
415
432
  box-shadow: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carissa-io/theme-default",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
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",
package/scss/index.scss CHANGED
@@ -138,6 +138,14 @@
138
138
  $c-checkbox-mark-color: $var-on-primary,
139
139
  $c-checkbox-mark-size: 1rem,
140
140
 
141
+ // Indeterminate: the checked box, with a 10px by 2px dash in the mark colour
142
+ $c-checkbox-indeterminate-background: $var-primary,
143
+ $c-checkbox-indeterminate-border-color: $var-primary,
144
+ $c-checkbox-indeterminate-mark-color: $var-on-primary,
145
+ $c-checkbox-indeterminate-mark-width: 0.625rem,
146
+ $c-checkbox-indeterminate-mark-thickness: 2px,
147
+ $c-checkbox-indeterminate-mark-radius: 0,
148
+
141
149
  // Disabled: #a3a3a3 on #f5f5f5
142
150
  $c-checkbox-disabled-color: $var-disabled-text,
143
151
  $c-checkbox-disabled-background: $var-surface,