@carissa-io/theme-default 0.3.10 → 0.3.11

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
@@ -418,6 +418,15 @@ From [components-color-picker](components/components-color-picker): `ColorPicker
418
418
  ## Async autocomplete
419
419
  From [components-async-autocomplete](components/components-async-autocomplete): `AsyncAutocomplete`. The field, the panel and the options are the Combobox's (reused figures, no new contrast). While a request is pending the field shows a 16px spinner at the arrow's place: a 2px `--c-primary` arc (21:1 / 19.8:1) over a `--c-surface-active` track, slowed down under `prefers-reduced-motion`. The states are written in the panel: `loading` and `empty` in `--c-muted` (5.74:1 / 7.85:1, the Listbox's empty message color) and `error` in `--c-error` (4.53:1 / 7.16:1 on the background, which is the panel's); the state is also exposed as `aria-busy` and `data-state`, so colour is never the only signal. Open takes the `--c-focus` border.
420
420
 
421
+ ## Section and container
422
+ From [components-section](components/components-section): `Container` and `Section`. Layout only: gutters of 1rem growing to 2rem at 40rem, container widths of 40, 48, 64 and 80rem, and vertical rhythms of 2, 4 and 6rem. The section title is `--c-text` in the h2 style (17.93:1 / 18.16:1 on the background) and the lead paragraph is `--c-muted` at the lead size (5.74:1 / 7.85:1 on the background, 5.27:1 / 7.11:1 on `--c-surface`), so both pass AA on either ground. A section with a title is a landmark named by it.
423
+
424
+ ## Faq
425
+ From [components-faq](components/components-faq): `Faq`. It is the Accordion (the box, the `--c-muted` rules, the `--c-surface` header hover and the 1px `--c-focus` ring documented in the Accordion section), so no new figure for the questions. The answers are `--c-text` (17.93:1 / 18.16:1) at a 1.6 line height and the list is capped at 48rem. The block must stay after the accordion block, because the FAQ stylesheet forwards the accordion's.
426
+
427
+ ## Carousel
428
+ 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`.
429
+
421
430
  ## Keyboard focus (all controls)
422
431
  One rule keeps the controls coherent: **an outlined control thickens its own border from 1px to 2px, black** (text fields,
423
432
  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` and `-async-autocomplete`. `components-email`, `-password`, `-url` and `-textarea`
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
148
  ## Change a value
package/dist/index.css CHANGED
@@ -4407,6 +4407,10 @@ ol.c-list {
4407
4407
  outline-offset: -2px;
4408
4408
  }
4409
4409
 
4410
+ .c-code-block--has-copy .c-code-block__pre {
4411
+ padding-top: 2.5rem;
4412
+ }
4413
+
4410
4414
  .c-code-block__code {
4411
4415
  font-size: inherit;
4412
4416
  }
@@ -5042,3 +5046,222 @@ ol.c-list {
5042
5046
  animation-duration: 2s;
5043
5047
  }
5044
5048
  }
5049
+ .c-container {
5050
+ box-sizing: border-box;
5051
+ width: 100%;
5052
+ margin-inline: auto;
5053
+ padding-inline: 1rem;
5054
+ }
5055
+ @media (min-width: 40rem) {
5056
+ .c-container {
5057
+ padding-inline: 2rem;
5058
+ }
5059
+ }
5060
+
5061
+ .c-container--sm {
5062
+ max-width: 40rem;
5063
+ }
5064
+
5065
+ .c-container--md {
5066
+ max-width: 48rem;
5067
+ }
5068
+
5069
+ .c-container--lg {
5070
+ max-width: 64rem;
5071
+ }
5072
+
5073
+ .c-container--xl {
5074
+ max-width: 80rem;
5075
+ }
5076
+
5077
+ .c-container--full {
5078
+ max-width: none;
5079
+ }
5080
+
5081
+ .c-section {
5082
+ box-sizing: border-box;
5083
+ }
5084
+
5085
+ .c-section--sm {
5086
+ padding-block: 2rem;
5087
+ }
5088
+
5089
+ .c-section--md {
5090
+ padding-block: 4rem;
5091
+ }
5092
+
5093
+ .c-section--lg {
5094
+ padding-block: 6rem;
5095
+ }
5096
+
5097
+ .c-section__header {
5098
+ display: flex;
5099
+ flex-direction: column;
5100
+ gap: 0.75rem;
5101
+ max-width: 40rem;
5102
+ margin-bottom: 2rem;
5103
+ }
5104
+
5105
+ .c-section__title {
5106
+ margin: 0;
5107
+ font-size: 1.75rem;
5108
+ font-weight: 900;
5109
+ line-height: 1.2;
5110
+ color: var(--c-text);
5111
+ }
5112
+
5113
+ .c-section__description {
5114
+ margin: 0;
5115
+ font-size: 1.25rem;
5116
+ line-height: 1.6;
5117
+ color: var(--c-muted);
5118
+ }
5119
+
5120
+ .c-faq {
5121
+ max-width: 48rem;
5122
+ }
5123
+
5124
+ .c-faq .c-accordion__content {
5125
+ line-height: 1.6;
5126
+ color: var(--c-text);
5127
+ }
5128
+
5129
+ .c-carousel {
5130
+ box-sizing: border-box;
5131
+ }
5132
+
5133
+ .c-carousel__viewport {
5134
+ overflow: hidden;
5135
+ }
5136
+
5137
+ .c-carousel__track {
5138
+ position: relative;
5139
+ display: flex;
5140
+ gap: 1rem;
5141
+ overflow-x: auto;
5142
+ overscroll-behavior-x: contain;
5143
+ scroll-snap-type: x mandatory;
5144
+ scrollbar-width: none;
5145
+ touch-action: pan-x pan-y pinch-zoom;
5146
+ }
5147
+ .c-carousel__track::-webkit-scrollbar {
5148
+ display: none;
5149
+ }
5150
+
5151
+ .c-carousel__slide {
5152
+ box-sizing: border-box;
5153
+ flex: 0 0 calc((100% - 1rem * (var(--c-carousel-per-view, 1) - 1)) / var(--c-carousel-per-view, 1));
5154
+ min-width: 0;
5155
+ scroll-snap-align: start;
5156
+ }
5157
+
5158
+ .c-carousel__controls {
5159
+ display: flex;
5160
+ gap: 1rem;
5161
+ align-items: center;
5162
+ justify-content: center;
5163
+ margin-top: 1rem;
5164
+ }
5165
+
5166
+ .c-carousel__arrow,
5167
+ .c-carousel__toggle {
5168
+ position: relative;
5169
+ box-sizing: border-box;
5170
+ flex: none;
5171
+ width: 2.75rem;
5172
+ height: 2.75rem;
5173
+ padding: 0;
5174
+ color: var(--c-text);
5175
+ cursor: pointer;
5176
+ background: var(--c-background);
5177
+ border: 1px solid var(--c-muted);
5178
+ border-radius: 0;
5179
+ transition: background-color 0.2s ease-out;
5180
+ }
5181
+ .c-carousel__arrow:hover:not(:disabled),
5182
+ .c-carousel__toggle:hover:not(:disabled) {
5183
+ background: var(--c-surface-active);
5184
+ }
5185
+ .c-carousel__arrow:focus-visible,
5186
+ .c-carousel__toggle:focus-visible {
5187
+ outline: 1px solid var(--c-focus);
5188
+ outline-offset: 2px;
5189
+ }
5190
+ .c-carousel__arrow:disabled,
5191
+ .c-carousel__toggle:disabled {
5192
+ cursor: not-allowed;
5193
+ opacity: 0.5;
5194
+ }
5195
+ .c-carousel__arrow::before,
5196
+ .c-carousel__toggle::before {
5197
+ position: absolute;
5198
+ top: 50%;
5199
+ left: 50%;
5200
+ box-sizing: border-box;
5201
+ content: "";
5202
+ }
5203
+
5204
+ .c-carousel__arrow::before {
5205
+ width: 0.5rem;
5206
+ height: 0.5rem;
5207
+ border-top: 2px solid currentColor;
5208
+ border-right: 2px solid currentColor;
5209
+ }
5210
+
5211
+ .c-carousel__arrow--next::before {
5212
+ transform: translate(-65%, -50%) rotate(45deg);
5213
+ }
5214
+
5215
+ .c-carousel__arrow--prev::before {
5216
+ transform: translate(-35%, -50%) rotate(-135deg);
5217
+ }
5218
+
5219
+ .c-carousel__toggle--playing::before {
5220
+ width: 0.5rem;
5221
+ height: 0.75rem;
5222
+ border-right: 3px solid currentColor;
5223
+ border-left: 3px solid currentColor;
5224
+ transform: translate(-50%, -50%);
5225
+ }
5226
+
5227
+ .c-carousel__toggle--paused::before {
5228
+ border-top: 0.375rem solid transparent;
5229
+ border-bottom: 0.375rem solid transparent;
5230
+ border-left: 0.625rem solid currentColor;
5231
+ transform: translate(-35%, -50%);
5232
+ }
5233
+
5234
+ .c-carousel__dots {
5235
+ display: flex;
5236
+ gap: 0.5rem;
5237
+ align-items: center;
5238
+ }
5239
+
5240
+ .c-carousel__dot {
5241
+ box-sizing: border-box;
5242
+ width: 0.625rem;
5243
+ height: 0.625rem;
5244
+ padding: 0;
5245
+ cursor: pointer;
5246
+ background: var(--c-muted);
5247
+ border: 0;
5248
+ border-radius: 0;
5249
+ transition: width 0.2s ease-out, background-color 0.2s ease-out;
5250
+ }
5251
+ .c-carousel__dot:focus-visible {
5252
+ outline: 1px solid var(--c-focus);
5253
+ outline-offset: 2px;
5254
+ }
5255
+
5256
+ .c-carousel__dot--current {
5257
+ width: 1.5rem;
5258
+ background: var(--c-primary);
5259
+ }
5260
+
5261
+ @media (prefers-reduced-motion: reduce) {
5262
+ .c-carousel__arrow,
5263
+ .c-carousel__toggle,
5264
+ .c-carousel__dot {
5265
+ transition: none;
5266
+ }
5267
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carissa-io/theme-default",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
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",
@@ -93,7 +93,10 @@
93
93
  "@carissa-io/components-date-range": "^0.1.0",
94
94
  "@carissa-io/components-rating": "^0.1.0",
95
95
  "@carissa-io/components-color-picker": "^0.1.0",
96
- "@carissa-io/components-async-autocomplete": "^0.1.0"
96
+ "@carissa-io/components-async-autocomplete": "^0.1.0",
97
+ "@carissa-io/components-section": "^0.1.0",
98
+ "@carissa-io/components-faq": "^0.1.0",
99
+ "@carissa-io/components-carousel": "^0.1.0"
97
100
  },
98
101
  "peerDependenciesMeta": {
99
102
  "@carissa-io/components-input": {
@@ -275,6 +278,15 @@
275
278
  },
276
279
  "@carissa-io/components-async-autocomplete": {
277
280
  "optional": true
281
+ },
282
+ "@carissa-io/components-section": {
283
+ "optional": true
284
+ },
285
+ "@carissa-io/components-faq": {
286
+ "optional": true
287
+ },
288
+ "@carissa-io/components-carousel": {
289
+ "optional": true
278
290
  }
279
291
  },
280
292
  "devDependencies": {
@@ -287,6 +299,7 @@
287
299
  "@carissa-io/components-button": "^0.1.1",
288
300
  "@carissa-io/components-calendar": "^0.1.1",
289
301
  "@carissa-io/components-card": "^0.1.0",
302
+ "@carissa-io/components-carousel": "^0.1.0",
290
303
  "@carissa-io/components-checkbox": "^0.1.1",
291
304
  "@carissa-io/components-code": "^0.1.0",
292
305
  "@carissa-io/components-color-picker": "^0.1.0",
@@ -297,6 +310,7 @@
297
310
  "@carissa-io/components-divider": "^0.1.0",
298
311
  "@carissa-io/components-drawer": "^0.1.0",
299
312
  "@carissa-io/components-empty-state": "^0.1.0",
313
+ "@carissa-io/components-faq": "^0.1.0",
300
314
  "@carissa-io/components-field": "^0.1.0",
301
315
  "@carissa-io/components-input": "^0.2.1",
302
316
  "@carissa-io/components-link": "^0.1.0",
@@ -315,6 +329,7 @@
315
329
  "@carissa-io/components-radio-group": "^0.1.1",
316
330
  "@carissa-io/components-rating": "^0.1.0",
317
331
  "@carissa-io/components-search": "^0.1.1",
332
+ "@carissa-io/components-section": "^0.1.0",
318
333
  "@carissa-io/components-select": "^0.1.1",
319
334
  "@carissa-io/components-sidebar": "^0.1.0",
320
335
  "@carissa-io/components-skeleton": "^0.1.0",
package/scss/index.scss CHANGED
@@ -1597,3 +1597,58 @@
1597
1597
  $c-async-autocomplete-empty-color: $var-muted,
1598
1598
  $c-async-autocomplete-error-color: $var-error
1599
1599
  );
1600
+
1601
+ // Section and container: layout only. Gutters of 1rem growing to 2rem and the three vertical rhythms are plain lengths; the
1602
+ // section title is --c-text (17.93:1 / 18.16:1) in the theme's h2 style and the lead paragraph is --c-muted (5.74:1 / 7.85:1).
1603
+ @use '@carissa-io/components-section/scss' as section with (
1604
+ $c-container-gutter: 1rem,
1605
+ $c-container-gutter-wide: 2rem,
1606
+ $c-section-spacing-sm: 2rem,
1607
+ $c-section-spacing-md: 4rem,
1608
+ $c-section-spacing-lg: 6rem,
1609
+ $c-section-header-gap: 0.75rem,
1610
+ $c-section-header-margin-bottom: 2rem,
1611
+ $c-section-title-font-size: $font-size-h2,
1612
+ $c-section-title-font-weight: $font-weight-black,
1613
+ $c-section-title-line-height: 1.2,
1614
+ $c-section-title-color: $var-text,
1615
+ $c-section-description-font-size: $font-size-lead,
1616
+ $c-section-description-line-height: 1.6,
1617
+ $c-section-description-color: $var-muted
1618
+ );
1619
+
1620
+ // FAQ: the accordion block above does the look (its stylesheet is forwarded by the faq one, so keep this block after it); the
1621
+ // answers are --c-text (17.93:1 / 18.16:1) at a 1.6 line height and the list is capped at a readable measure.
1622
+ @use '@carissa-io/components-faq/scss' as faq with (
1623
+ $c-faq-max-width: 48rem,
1624
+ $c-faq-answer-color: $var-text,
1625
+ $c-faq-answer-line-height: 1.6
1626
+ );
1627
+
1628
+ // Carousel: the arrows and the pause / play button are the secondary button (--c-muted border, --c-text glyph at 17.93:1 / 18.16:1, a
1629
+ // --c-surface-active hover), square like every control of the theme. Inactive dots are --c-muted and the
1630
+ // current one is --c-primary and longer (1.5rem against 0.625rem), so position is not told by colour alone. The ring is the
1631
+ // theme's --c-focus.
1632
+ @use '@carissa-io/components-carousel/scss' as carousel with (
1633
+ $c-carousel-gap: 1rem,
1634
+ $c-carousel-transition-duration: $transition-duration,
1635
+ $c-carousel-controls-gap: 1rem,
1636
+ $c-carousel-controls-margin-top: 1rem,
1637
+ $c-carousel-button-size: $min-height,
1638
+ $c-carousel-button-radius: $radius,
1639
+ $c-carousel-button-border-width: 1px,
1640
+ $c-carousel-button-border-color: $var-muted,
1641
+ $c-carousel-button-color: $var-text,
1642
+ $c-carousel-button-background: $var-background,
1643
+ $c-carousel-button-background-hover: $var-surface-active,
1644
+ $c-carousel-button-disabled-opacity: 0.5,
1645
+ $c-carousel-icon-size: 0.5rem,
1646
+ $c-carousel-icon-thickness: 2px,
1647
+ $c-carousel-dot-size: 0.625rem,
1648
+ $c-carousel-dot-size-current: 1.5rem,
1649
+ $c-carousel-dot-gap: 0.5rem,
1650
+ $c-carousel-dot-color: $var-muted,
1651
+ $c-carousel-dot-color-current: $var-primary,
1652
+ $c-carousel-focus-outline: $focus-width solid $var-focus,
1653
+ $c-carousel-focus-outline-offset: 2px
1654
+ );