diff --git a/library/components/info/MapInfo.vue b/library/components/info/MapInfo.vue index f58736732..fb54bd61f 100644 --- a/library/components/info/MapInfo.vue +++ b/library/components/info/MapInfo.vue @@ -68,9 +68,9 @@ const props = defineProps({ /** * The map's STRATEGY, as a catalogue key PREFIX (e.g. 'mapInfo.tab.upg-100.strategy'): .bottom is * the bottom line, .p1, .p2 … the points, read in order until the first one that is missing. So - * the number of points is the catalogue's business, never a count kept here. With a strategy the popup - * shows the intro (the lead), then the strategy; a map that also has examples gets two tabs, EXAMPLES - * first. The takeaway is not shown beside a strategy, which supersedes it. + * the number of points is the catalogue's business, never a count kept here. The popup shows the short + * description (the lead) first, then the strategy as a collapsed disclosure, then the examples. The + * takeaway is not shown beside a strategy, which supersedes it. */ strategyKey: { type: String, default: '' }, note: { type: String, default: '' }, @@ -130,19 +130,7 @@ function strategyPoints() { return out } const hasStrategy = () => !!strategyBottom() -// Two tabs only where there is something on both sides: examples AND a strategy. -const hasTabs = () => hasStrategy() && (props.examples || []).length > 0 -const view = ref('examples') -// The ARIA tabs pattern: Left/Right move between the tabs and focus follows. With two tabs either key simply -// switches, so a right-to-left reader needs no mirrored mapping. -const tabIds = () => ({ ex: 'mi-tab-ex-' + props.storageKey, st: 'mi-tab-st-' + props.storageKey, panel: 'mi-panel-' + props.storageKey }) -function onTabKey(e) { - if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return - e.preventDefault() - const list = e.currentTarget // null once dispatch ends, so take it now, not inside nextTick - view.value = view.value === 'examples' ? 'strategy' : 'examples' - nextTick(() => { const btn = list && list.querySelector('[aria-selected="true"]'); if (btn) btn.focus() }) -} + const num = (n) => { try { return new Intl.NumberFormat(lang()).format(n) } catch { return String(n) } } const isRtl = () => lang() === 'ar' @@ -199,7 +187,6 @@ const failed = reactive({}) async function show() { opens.value++ open.value = true - view.value = 'examples' // A page-load pointer is done for this load once the popup has been opened (in memory only). if (pageLoad()) pointerDoneThisLoad.add(props.storageKey) await nextTick() @@ -449,17 +436,24 @@ useShadowStyles(` .mi-close:focus-visible, .mi-toggle:focus-visible, .mi-hit:focus-visible, .mi-full:focus-visible{ outline:3px solid #2563eb; outline-offset:2px; } .mi-body{ overflow-y:auto; padding:16px 20px 20px; -webkit-overflow-scrolling:touch; } - .mi-lead{ margin:0 0 6px; font-size:16px; } + /* The short description is the first thing the eye should find: the Rudder blue (#38bdf8) as the ACCENT + (a left bar on a pale band of the same hue), and the text in a darker shade of that hue (#0369a1), since + the accent itself is only ~2.1:1 on white and would be hard to read as text. */ + .mi-bluf{ margin:0 0 12px; padding:10px 12px; background:#f0f9ff; border-inline-start:4px solid #38bdf8; border-radius:6px; } + .mi-bluf-h{ margin:0 0 4px; font-size:13px; font-weight:700; color:#0c4a6e; } + .mi-lead{ margin:0; font-size:16px; font-weight:500; color:#0369a1; } .mi-takeaway{ margin:0 0 14px; color:#3b4256; } .mi-takeaway b{ color:#1b1f2a; } .mi-ex{ margin:18px 0 0; } - .mi-tabs{ display:flex; gap:4px; margin:14px 0 0; border-bottom:1px solid #e6e8ee; } - .mi-tab{ min-height:44px; padding:0 16px; border:none; background:none; color:#3b4256; font:inherit; font-weight:600; - cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-1px; } - .mi-tab[aria-selected="true"]{ color:#1b1f2a; border-bottom-color:#3b463d; } - .mi-tab:focus-visible{ outline:3px solid #2563eb; outline-offset:-3px; } - .mi-strategy{ margin:16px 0 0; } - .mi-strategy h3{ margin:0 0 6px; } + .mi-strategy{ margin:14px 0 0; border:1px solid #e6e8ee; border-radius:10px; } + .mi-strategy-sum{ display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; + padding:0 14px; cursor:pointer; font-weight:700; color:#1b1f2a; list-style:none; } + .mi-strategy-sum::-webkit-details-marker{ display:none; } + .mi-strategy-sum:focus-visible{ outline:3px solid #2563eb; outline-offset:2px; border-radius:10px; } + .mi-chev{ transition:transform .15s; } + .mi-strategy[open] .mi-chev{ transform:rotate(180deg); } + .mi-strategy > .mi-bottom, .mi-strategy > .mi-points{ margin-inline:14px; } + .mi-strategy > :last-child{ margin-bottom:14px; } .mi-bottom{ margin:0 0 8px; font-weight:600; color:#1b1f2a; } .mi-points{ margin:0; padding-inline-start:20px; } .mi-points li{ margin:0 0 6px; } @@ -554,6 +548,7 @@ useShadowStyles(` styles are injected: a page-level rule cannot reach into a shadow root. */ @media (prefers-reduced-motion: reduce){ .mi-pointer, .mi .mi-pointer.mi-ctl{ animation:none; } + .mi-chev{ transition:none; } } `, 'map-info') @@ -594,27 +589,22 @@ useShadowStyles(`
-

{{ text(leadKey, lead) }}

+ +
+

{{ t('mapInfo.shortDescription') }}

+

{{ text(leadKey, lead) }}

+

{{ t('mapInfo.takeaway') }} {{ text(takeawayKey, takeaway) }}

-
- - -
-
- -
-

{{ t('mapInfo.tabStrategy') }}

+ +
+ {{ t('mapInfo.tabStrategy') }}

{{ strategyBottom() }}

  • {{ p }}
-
- - - -
-

{{ text(noteKey, note) }}

diff --git a/library/i18n/locales/ar/mapInfo.json b/library/i18n/locales/ar/mapInfo.json index 13564a40b..800b9bd23 100644 --- a/library/i18n/locales/ar/mapInfo.json +++ b/library/i18n/locales/ar/mapInfo.json @@ -1,6 +1,7 @@ { "open": "ماذا يمكن أن تقدّم لك هذه الخريطة؟", "title": "ماذا يمكن أن تقدّم لك هذه الخريطة؟", + "shortDescription": "وصف موجز", "pointer": "ماذا تفعل هذه الخريطة؟", "close": "إغلاق", "takeaway": "ما تحصل عليه:", diff --git a/library/i18n/locales/de/mapInfo.json b/library/i18n/locales/de/mapInfo.json index 98061fb2f..b1659a33e 100644 --- a/library/i18n/locales/de/mapInfo.json +++ b/library/i18n/locales/de/mapInfo.json @@ -1,6 +1,7 @@ { "open": "Was kann diese Karte für Sie tun?", "title": "Was kann diese Karte für Sie tun?", + "shortDescription": "Kurzbeschreibung", "pointer": "Was kann diese Karte?", "close": "Schließen", "takeaway": "Was Sie mitnehmen:", diff --git a/library/i18n/locales/en/mapInfo.json b/library/i18n/locales/en/mapInfo.json index c06b3228b..3ae726f40 100644 --- a/library/i18n/locales/en/mapInfo.json +++ b/library/i18n/locales/en/mapInfo.json @@ -1,6 +1,7 @@ { "open": "What can this map do for you?", "title": "What can this map do for you?", + "shortDescription": "Short description", "pointer": "What can this map do?", "close": "Close", "takeaway": "What you take away:", diff --git a/library/i18n/locales/es/mapInfo.json b/library/i18n/locales/es/mapInfo.json index 6e20e9d74..7067ddf62 100644 --- a/library/i18n/locales/es/mapInfo.json +++ b/library/i18n/locales/es/mapInfo.json @@ -1,6 +1,7 @@ { "open": "¿Qué puede hacer este mapa por usted?", "title": "¿Qué puede hacer este mapa por usted?", + "shortDescription": "Descripción breve", "pointer": "¿Qué hace este mapa?", "close": "Cerrar", "takeaway": "Lo que se lleva:", diff --git a/library/i18n/locales/fr/mapInfo.json b/library/i18n/locales/fr/mapInfo.json index a096ee0dc..ae7ed9182 100644 --- a/library/i18n/locales/fr/mapInfo.json +++ b/library/i18n/locales/fr/mapInfo.json @@ -1,6 +1,7 @@ { "open": "Que peut faire cette carte pour vous ?", "title": "Que peut faire cette carte pour vous ?", + "shortDescription": "Description courte", "pointer": "Que fait cette carte ?", "close": "Fermer", "takeaway": "Ce que vous emportez :", diff --git a/library/i18n/locales/hi/mapInfo.json b/library/i18n/locales/hi/mapInfo.json index 38d431c96..0efbab720 100644 --- a/library/i18n/locales/hi/mapInfo.json +++ b/library/i18n/locales/hi/mapInfo.json @@ -1,6 +1,7 @@ { "open": "यह नक्शा आपके लिए क्या कर सकता है?", "title": "यह नक्शा आपके लिए क्या कर सकता है?", + "shortDescription": "संक्षिप्त विवरण", "pointer": "यह नक्शा क्या करता है?", "close": "बंद करें", "takeaway": "आपको क्या मिलता है:", diff --git a/library/i18n/locales/it/mapInfo.json b/library/i18n/locales/it/mapInfo.json index 7e527ad40..24fab46b3 100644 --- a/library/i18n/locales/it/mapInfo.json +++ b/library/i18n/locales/it/mapInfo.json @@ -1,6 +1,7 @@ { "open": "Che cosa può fare questa mappa per te?", "title": "Che cosa può fare questa mappa per te?", + "shortDescription": "Breve descrizione", "pointer": "Che cosa fa questa mappa?", "close": "Chiudi", "takeaway": "Che cosa ottieni:", diff --git a/library/i18n/locales/pt/mapInfo.json b/library/i18n/locales/pt/mapInfo.json index 1c2d1f842..bc9358ca2 100644 --- a/library/i18n/locales/pt/mapInfo.json +++ b/library/i18n/locales/pt/mapInfo.json @@ -1,6 +1,7 @@ { "open": "O que este mapa pode fazer por você?", "title": "O que este mapa pode fazer por você?", + "shortDescription": "Descrição breve", "pointer": "O que este mapa faz?", "close": "Fechar", "takeaway": "O que você leva:", diff --git a/library/i18n/locales/ro/mapInfo.json b/library/i18n/locales/ro/mapInfo.json index 319ddd2aa..d683d6ffc 100644 --- a/library/i18n/locales/ro/mapInfo.json +++ b/library/i18n/locales/ro/mapInfo.json @@ -1,6 +1,7 @@ { "open": "Ce poate face această hartă pentru tine?", "title": "Ce poate face această hartă pentru tine?", + "shortDescription": "Descriere scurtă", "pointer": "Ce face această hartă?", "close": "Închide", "takeaway": "Ce primești:", diff --git a/library/i18n/locales/ru/mapInfo.json b/library/i18n/locales/ru/mapInfo.json index ac6262b19..207b6a8fd 100644 --- a/library/i18n/locales/ru/mapInfo.json +++ b/library/i18n/locales/ru/mapInfo.json @@ -1,6 +1,7 @@ { "open": "Чем эта карта может быть вам полезна?", "title": "Чем эта карта может быть вам полезна?", + "shortDescription": "Краткое описание", "pointer": "Что умеет эта карта?", "close": "Закрыть", "takeaway": "Что вы получаете:", diff --git a/library/i18n/locales/zh/mapInfo.json b/library/i18n/locales/zh/mapInfo.json index efdca9bea..c3ed0425b 100644 --- a/library/i18n/locales/zh/mapInfo.json +++ b/library/i18n/locales/zh/mapInfo.json @@ -1,6 +1,7 @@ { "open": "这张地图能为你做什么?", "title": "这张地图能为你做什么?", + "shortDescription": "简要说明", "pointer": "这张地图能做什么?", "close": "关闭", "takeaway": "你能带走的:",