origam 2.18.7 → 2.18.9

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.
@@ -2086,7 +2086,10 @@
2086
2086
  --origam-date-picker-month__weeks---font-size: 0.85rem;
2087
2087
  --origam-date-picker-month__weekday---font-size: 0.85rem;
2088
2088
  --origam-date-picker-month__day---font-size: 0.85rem;
2089
- --origam-code---background-color: var(--origam-color__surface---sunken);
2089
+ /* #535 — was `surface---sunken`. See the matching comment in light.css:
2090
+ * `surface---raised` clears WCAG AA against Shiki's fixed token colours
2091
+ * with margin in dark mode too (measured worst case 5.79:1, #535 PR). */
2092
+ --origam-code---background-color: var(--origam-color__surface---raised);
2090
2093
  --origam-code---color: var(--origam-color__text---primary);
2091
2094
  --origam-code---border-color: var(--origam-color__border---subtle);
2092
2095
  --origam-code---border-width: var(--origam-border__width---thin);
@@ -4822,7 +4825,9 @@
4822
4825
  --origam-date-picker-month__weeks---font-size: 0.85rem;
4823
4826
  --origam-date-picker-month__weekday---font-size: 0.85rem;
4824
4827
  --origam-date-picker-month__day---font-size: 0.85rem;
4825
- --origam-code---background-color: var(--origam-color__surface---sunken);
4828
+ /* #535 — was `surface---sunken`; see light.css / the top of this file
4829
+ * for the AA rationale (`surface---raised`, measured worst 5.79:1). */
4830
+ --origam-code---background-color: var(--origam-color__surface---raised);
4826
4831
  --origam-code---color: var(--origam-color__text---primary);
4827
4832
  --origam-code---border-color: var(--origam-color__border---subtle);
4828
4833
  --origam-code---border-width: var(--origam-border__width---thin);
@@ -1990,7 +1990,12 @@
1990
1990
  --origam-date-picker-month__weeks---font-size: 0.85rem;
1991
1991
  --origam-date-picker-month__weekday---font-size: 0.85rem;
1992
1992
  --origam-date-picker-month__day---font-size: 0.85rem;
1993
- --origam-code---background-color: var(--origam-color__surface---sunken);
1993
+ /* #535 — was `surface---sunken`. Shiki's fixed per-token colours (see
1994
+ * `code.const.ts`) cannot reach 4.5:1 against several brand `sunken`
1995
+ * surfaces no matter how dark the theme goes; `surface---raised` is the
1996
+ * lightest surface already defined by every theme (own palette, no new
1997
+ * token) and clears AA with margin everywhere it was measured (#535 PR). */
1998
+ --origam-code---background-color: var(--origam-color__surface---raised);
1994
1999
  --origam-code---color: var(--origam-color__text---primary);
1995
2000
  --origam-code---border-color: var(--origam-color__border---subtle);
1996
2001
  --origam-code---border-width: var(--origam-border__width---thin);
@@ -2086,7 +2086,10 @@
2086
2086
  --origam-date-picker-month__weeks---font-size: 0.85rem;
2087
2087
  --origam-date-picker-month__weekday---font-size: 0.85rem;
2088
2088
  --origam-date-picker-month__day---font-size: 0.85rem;
2089
- --origam-code---background-color: var(--origam-color__surface---sunken);
2089
+ /* #535 — was `surface---sunken`. See the matching comment in light.css:
2090
+ * `surface---raised` clears WCAG AA against Shiki's fixed token colours
2091
+ * with margin in dark mode too (measured worst case 5.79:1, #535 PR). */
2092
+ --origam-code---background-color: var(--origam-color__surface---raised);
2090
2093
  --origam-code---color: var(--origam-color__text---primary);
2091
2094
  --origam-code---border-color: var(--origam-color__border---subtle);
2092
2095
  --origam-code---border-width: var(--origam-border__width---thin);
@@ -4822,7 +4825,9 @@
4822
4825
  --origam-date-picker-month__weeks---font-size: 0.85rem;
4823
4826
  --origam-date-picker-month__weekday---font-size: 0.85rem;
4824
4827
  --origam-date-picker-month__day---font-size: 0.85rem;
4825
- --origam-code---background-color: var(--origam-color__surface---sunken);
4828
+ /* #535 — was `surface---sunken`; see light.css / the top of this file
4829
+ * for the AA rationale (`surface---raised`, measured worst 5.79:1). */
4830
+ --origam-code---background-color: var(--origam-color__surface---raised);
4826
4831
  --origam-code---color: var(--origam-color__text---primary);
4827
4832
  --origam-code---border-color: var(--origam-color__border---subtle);
4828
4833
  --origam-code---border-width: var(--origam-border__width---thin);
@@ -1990,7 +1990,12 @@
1990
1990
  --origam-date-picker-month__weeks---font-size: 0.85rem;
1991
1991
  --origam-date-picker-month__weekday---font-size: 0.85rem;
1992
1992
  --origam-date-picker-month__day---font-size: 0.85rem;
1993
- --origam-code---background-color: var(--origam-color__surface---sunken);
1993
+ /* #535 — was `surface---sunken`. Shiki's fixed per-token colours (see
1994
+ * `code.const.ts`) cannot reach 4.5:1 against several brand `sunken`
1995
+ * surfaces no matter how dark the theme goes; `surface---raised` is the
1996
+ * lightest surface already defined by every theme (own palette, no new
1997
+ * token) and clears AA with margin everywhere it was measured (#535 PR). */
1998
+ --origam-code---background-color: var(--origam-color__surface---raised);
1994
1999
  --origam-code---color: var(--origam-color__text---primary);
1995
2000
  --origam-code---border-color: var(--origam-color__border---subtle);
1996
2001
  --origam-code---border-width: var(--origam-border__width---thin);
@@ -458,7 +458,7 @@ defineExpose({
458
458
  padding: 0 calc(16px + var(--origam-btn---density-padding-x, 0px));
459
459
 
460
460
  width: var(--origam-btn---width, auto);
461
- min-width: var(--origam-btn---min-width, calc(var(--origam-btn---width, 64px) + var(--origam-btn---density, 0px)));
461
+ min-width: calc(var(--origam-btn---min-width, 64px) + var(--origam-btn---density, 0px));
462
462
  max-width: var(--origam-btn---max-width, 100%);
463
463
  height: calc(var(--origam-btn---height, 36px) + var(--origam-btn---density, 0px));
464
464
  min-height: var(--origam-btn---min-height, calc(var(--origam-btn---height, 36px) + var(--origam-btn---density, 0px)));
@@ -697,7 +697,7 @@ defineExpose({
697
697
  &--icon {
698
698
  --origam-btn---border-radius: var(--origam-btn---border-radius-icon, 50%);
699
699
 
700
- --origam-btn---min-width: 0;
700
+ --origam-btn---min-width: 0px;
701
701
  --origam-btn---width: calc(var(--origam-btn---height, 36px) + var(--origam-btn---density, 0px));
702
702
 
703
703
  padding: 0;
@@ -1137,8 +1137,5 @@ defineExpose({
1137
1137
 
1138
1138
  --origam-btn__prepend---margin-inline-start: calc(var(--origam-btn---height) / -9);
1139
1139
  --origam-btn__prepend---margin-inline-end: calc(var(--origam-btn---height) / 4.5);
1140
-
1141
- --origam-btn---min-width: calc(var(--origam-btn---width, 36px) + var(--origam-btn---density, 0px));
1142
- --origam-btn---min-height: calc(var(--origam-btn---height, 36px) + var(--origam-btn---density, 0px));
1143
1140
  }
1144
1141
  </style>
@@ -79,7 +79,7 @@
79
79
  'origam-chart__map-country--active': hoveredCode === country.code
80
80
  }"
81
81
  :d="country.d"
82
- :style="{ fill: country.fill, stroke: borderColor }"
82
+ :style="{ fill: country.fill, stroke: resolveColor(borderColor) }"
83
83
  :data-cy="`origam-chart-map-country-${ country.code }`"
84
84
  :tabindex="country.hasData ? 0 : -1"
85
85
  :role="country.hasData ? 'button' : undefined"
@@ -223,8 +223,8 @@ defineOptions({
223
223
  const props = defineProps({
224
224
  mode: { type: null, required: false, default: "choropleth" },
225
225
  colorRange: { type: Array, required: false, default: () => ["info", "danger"] },
226
- defaultCountryFill: { type: String, required: false, default: "rgba(0,0,0,0.08)" },
227
- borderColor: { type: String, required: false, default: "rgba(0,0,0,0.2)" },
226
+ defaultCountryFill: { type: null, required: false, default: "rgba(0,0,0,0.08)" },
227
+ borderColor: { type: null, required: false, default: "neutral" },
228
228
  lineColor: { type: null, required: false, default: "primary" },
229
229
  nodeRadius: { type: Number, required: false, default: 4 },
230
230
  routeCurvature: { type: Number, required: false, default: 0.3 },
@@ -371,7 +371,7 @@ const allCountries = computed(() => {
371
371
  if (hasData && datum !== void 0) {
372
372
  fill = choroplethColorFor(datum.value, min, max);
373
373
  } else {
374
- fill = props.defaultCountryFill;
374
+ fill = resolveColor(props.defaultCountryFill);
375
375
  }
376
376
  return {
377
377
  code,
@@ -402,7 +402,7 @@ defineExpose({ rebuild, copied, codeRef });
402
402
  .origam-code__copy--compact {
403
403
  flex: none;
404
404
  --origam-btn---min-height: 0;
405
- --origam-btn---min-width: 0;
405
+ --origam-btn---min-width: 0px;
406
406
  --origam-btn---height: auto;
407
407
  --origam-btn---padding-block: var(--origam-code__compact-copy---padding-block);
408
408
  --origam-btn---padding-inline: var(--origam-code__compact-copy---padding-inline);
@@ -445,7 +445,7 @@ defineExpose({ rebuild, copied, codeRef });
445
445
 
446
446
  .origam-code__copy {
447
447
  --origam-btn---min-height: 0;
448
- --origam-btn---min-width: 0;
448
+ --origam-btn---min-width: 0px;
449
449
  --origam-btn---border-radius: var(--origam-code__copy---border-radius);
450
450
  --origam-btn---font-size: var(--origam-code__copy---font-size);
451
451
  --origam-btn---color: var(--origam-code__copy---color);
@@ -80,6 +80,7 @@ import { SCROLL_STRATEGIES } from "../../enums/Commons/scroll.enum";
80
80
  import { animate } from "../../utils/Commons/animation.util";
81
81
  import { convertToUnit } from "../../utils/Commons/commons.util";
82
82
  import { getScrollParent } from "../../utils/Commons/scroll.util";
83
+ defineOptions({ inheritAttrs: false });
83
84
  const props = defineProps({
84
85
  absolute: { type: Boolean, required: false },
85
86
  attach: { type: [Boolean, String], required: false, skipCheck: true },
@@ -7,8 +7,8 @@ exports.SUPPORTED_LANGS = exports.CODE_LIGHT_THEME = exports.CODE_DEFAULTS = exp
7
7
  var _enums = require("../../enums/index.cjs");
8
8
  const SUPPORTED_LANGS = exports.SUPPORTED_LANGS = Object.freeze([_enums.CODE_LANG.PLAINTEXT, _enums.CODE_LANG.VUE, _enums.CODE_LANG.TS, _enums.CODE_LANG.JS, _enums.CODE_LANG.TSX, _enums.CODE_LANG.JSX, _enums.CODE_LANG.SCSS, _enums.CODE_LANG.CSS, _enums.CODE_LANG.JSON, _enums.CODE_LANG.BASH, _enums.CODE_LANG.HTML, _enums.CODE_LANG.XML, _enums.CODE_LANG.YAML, _enums.CODE_LANG.MD]);
9
9
  const CODE_CACHE_MAX_ENTRIES = exports.CODE_CACHE_MAX_ENTRIES = 64;
10
- const CODE_LIGHT_THEME = exports.CODE_LIGHT_THEME = "github-light";
11
- const CODE_DARK_THEME = exports.CODE_DARK_THEME = "github-dark";
10
+ const CODE_LIGHT_THEME = exports.CODE_LIGHT_THEME = "github-light-high-contrast";
11
+ const CODE_DARK_THEME = exports.CODE_DARK_THEME = "github-dark-high-contrast";
12
12
  const CODE_DEFAULTS = exports.CODE_DEFAULTS = Object.freeze({
13
13
  lang: _enums.CODE_LANG.PLAINTEXT,
14
14
  lineNumbers: false,
@@ -12,12 +12,29 @@ export declare const SUPPORTED_LANGS: ReadonlyArray<CODE_LANG>;
12
12
  */
13
13
  export declare const CODE_CACHE_MAX_ENTRIES = 64;
14
14
  /**
15
- * Shiki themes used by `useCode`. Light + dark map to the GitHub themes
16
- * (best contrast / nicest defaults on both modes). Override at the
17
- * composable level if you need a different palette per app.
15
+ * Shiki themes used by `useCode`.
16
+ *
17
+ * ⛔ #535 — `github-light` / `github-dark` (the previous pair) fail WCAG AA
18
+ * (4.5:1) on several token categories REGARDLESS of the surface they sit on:
19
+ * measured against a background as light as pure `#ffffff`, the `github-light`
20
+ * "parameter/property" hue (`#e36209`) tops out at 3.49:1 — it cannot reach
21
+ * 4.5:1 by darkening or lightening the background alone, because the DS has
22
+ * no per-syntax-category token to recolour it (Shiki paints via its own
23
+ * `--shiki-light`/`--shiki-dark` inline vars, see `code.composable.ts`).
24
+ * `keyword`/`comment`/`tag` were close misses (~3.9–4.4:1) for the same
25
+ * reason. `github-light-high-contrast` / `github-dark-high-contrast` are
26
+ * shiki's own accessibility-tuned variants of the same GitHub palette
27
+ * (bundled by shiki, zero extra bytes — swapping one theme name for another).
28
+ * Re-measured (Node, shiki 4.3.1, `codeToHtml` output — no DOM/var()
29
+ * involved, these are the theme's literal per-token hex, see #535 PR):
30
+ * worst case across all 8 token categories × 7 marketing brand surfaces ×
31
+ * both modes is 4.23:1 (light, "comment" on 3 tinted brand backgrounds) —
32
+ * closed by the companion `--origam-color__surface---raised` background fix
33
+ * below (worst case then 4.77:1 light / 5.79:1 dark, Playwright-verified
34
+ * against the built Histoire `OrigamCode` story).
18
35
  */
19
- export declare const CODE_LIGHT_THEME = "github-light";
20
- export declare const CODE_DARK_THEME = "github-dark";
36
+ export declare const CODE_LIGHT_THEME = "github-light-high-contrast";
37
+ export declare const CODE_DARK_THEME = "github-dark-high-contrast";
21
38
  /**
22
39
  * Default values used by `OrigamCode`. Centralised so the story / docs /
23
40
  * tests pull the same constants and any future drift stays visible.
@@ -16,8 +16,8 @@ export const SUPPORTED_LANGS = Object.freeze([
16
16
  CODE_LANG.MD
17
17
  ]);
18
18
  export const CODE_CACHE_MAX_ENTRIES = 64;
19
- export const CODE_LIGHT_THEME = "github-light";
20
- export const CODE_DARK_THEME = "github-dark";
19
+ export const CODE_LIGHT_THEME = "github-light-high-contrast";
20
+ export const CODE_DARK_THEME = "github-dark-high-contrast";
21
21
  export const CODE_DEFAULTS = Object.freeze({
22
22
  lang: CODE_LANG.PLAINTEXT,
23
23
  lineNumbers: false,
@@ -91,14 +91,26 @@ export interface IChartMapProps extends IChartBaseProps {
91
91
  colorRange?: [TIntent | string, TIntent | string];
92
92
  /**
93
93
  * Fill colour for countries that have no value in the dataset.
94
- * Default `'rgba(0,0,0,0.08)'`.
94
+ * Supports intent names and raw CSS strings, resolved the same way as
95
+ * `borderColor` / `lineColor` (#411 — was applied to `fill` verbatim,
96
+ * an intent keyword is invalid CSS there and the browser dropped the
97
+ * declaration, making dataless countries disappear under a theme).
98
+ * Default stays the literal `'rgba(0,0,0,0.08)'` — no intent token
99
+ * reproduces it: the literal is a semi-transparent SCRIM composited
100
+ * over whatever `bgColor` the chart itself renders on top of (so it
101
+ * self-adjusts to light/dark and to a custom `bgColor`), whereas an
102
+ * intent resolves to a fixed OPAQUE colour unrelated to the chart's
103
+ * own background. Swapping the default would trade an adaptive
104
+ * behaviour for a fixed one, not just move a pixel.
95
105
  */
96
- defaultCountryFill?: string;
106
+ defaultCountryFill?: TIntent | string;
97
107
  /**
98
108
  * Stroke colour applied to all country path outlines.
99
- * Default `'rgba(0,0,0,0.2)'`.
109
+ * Supports intent names and raw CSS strings, resolved the same way as
110
+ * `lineColor` (#411 — was a hardcoded literal the theme could not reach).
111
+ * Default `'neutral'`.
100
112
  */
101
- borderColor?: string;
113
+ borderColor?: TIntent | string;
102
114
  /**
103
115
  * Default stroke colour for flight-route arcs.
104
116
  * Overridden per route via `IChartMapRouteDatum.color`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.18.7",
3
+ "version": "2.18.9",
4
4
  "type": "module",
5
5
  "description": "origam — a Vue 3 design system with multi-theme design tokens, CSS-first components and TypeScript types.",
6
6
  "keywords": [