المكوّنات · قسم خطوات مرقّمة
قسم خطوات مرقّمة
مسار أفقي بخطّ يصل بين المراحل ولا يتجاوز آخرها
12 تصاميم من هذه العائلة
<div class="bk bkst"><section>
<div class="head">
<span class="eyebrow" data-ar="كيف نعمل" data-en="HOW IT WORKS">كيف نعمل</span>
<h3 data-ar="من الفاتورة الأولى إلى الإقرار الضريبي" data-en="From first invoice to tax filing">من الفاتورة الأولى إلى الإقرار الضريبي</h3>
</div>
<ol class="steps"></ol>
</section></div>
/* pt-scoped */
/* block-steps — نظام محاسبة */
.bkst{width:100%;height:100%;display:flex;flex-direction:column;
font-size:10px;color:var(--pt-text-secondary);overflow:hidden}
.bkst h2{margin:0;font-size:19px;line-height:1.35;color:var(--pt-text-primary);
font-weight:700;letter-spacing:-.01em}
.bkst h3{margin:0;font-size:12px;line-height:1.4;color:var(--pt-text-primary);font-weight:600}
.bkst h4{margin:0;font-size:10px;color:var(--pt-text-primary);font-weight:600}
.bkst p{margin:0;font-size:9.5px;line-height:1.85;color:var(--pt-text-muted)}
.bkst .eyebrow{font-size:8px;letter-spacing:.14em;color:var(--pt-accent);font-weight:700}
.bkst .num{font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.bkst button, .bkst a{font:inherit;cursor:pointer;text-decoration:none}
.bkst button:focus-visible, .bkst a:focus-visible, .bkst input:focus-visible, .bkst summary:focus-visible{outline:2px solid var(--pt-focus-ring);outline-offset:2px}
/* الأقسام تمتدّ من حافّة إلى حافّة — هذا ما يميّزها عن المكوّنات */
.bkst > section{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:0}
@media(pointer:coarse){.bkst button, .bkst a{min-height:44px;display:inline-flex;
align-items:center;justify-content:center}
}
/* شخصية: أرقام دائرية موصولة بخطّ، انحناء كامل للأرقام */
.bkst > section{gap:12px;padding:15px 26px;background:var(--pt-surface)}
.bkst .head{display:flex;flex-direction:column;gap:2px;align-items:center;text-align:center}
.bkst .steps{list-style:none;margin:0;padding:0;display:grid;
grid-template-columns:repeat(4,1fr);gap:8px}
.bkst .steps li{position:relative;display:flex;flex-direction:column;align-items:center;
gap:4px;text-align:center}
/* الخطّ يُرسم بين الخطوات لا خلالها: الأخيرة بلا خطّ بعدها */
.bkst .steps li:not(:last-child)::before{content:'';position:absolute;
inset-block-start:11px;inset-inline-start:calc(50% + 15px);
width:calc(100% - 30px);height:1px;background:var(--pt-border-default)}
.bkst .no{width:23px;height:23px;flex:none;border-radius:50%;display:grid;place-items:center;
background:var(--pt-bg-inset);border:1px solid var(--pt-border-default);
color:var(--pt-accent);font-size:9.5px;font-weight:700;
font-variant-numeric:tabular-nums;position:relative;z-index:1}
.bkst .steps li.on .no{background:var(--pt-accent);border-color:var(--pt-accent);
color:var(--pt-color-ink-900)}
.bkst .t{font-size:9px;color:var(--pt-text-primary);font-weight:600}
.bkst .d{font-size:7.5px;color:var(--pt-text-muted);line-height:1.7;max-width:110px}
/* يعمل داخل إطار معزول — لا يعتمد على شيء خارجه */
/* pt-remount — يعاد التركيب عند تبديل اللغة */
(function () {
var host = document.querySelector('.bkst');
if (!host) return;
var snapshot = host.innerHTML;
var timers = [];
var ac = null;
/* الجسم كما كتبه المولِّد. يستقبل بدائل مظلَّلة لـ root وdocument
والمؤقّتات، فينظّف نفسه دون أن يعرف أنه قابل لإعادة التركيب. */
function run(root, document, setTimeout, setInterval) {
var ar = document.documentElement.lang !== 'en';
var n = function (v, d) { return Number(v).toLocaleString('en-US', {
minimumFractionDigits: d || 0, maximumFractionDigits: d || 0 }); };
var STEPS = [
{ t: { ar: 'اربط حساباتك', en: 'Connect accounts' },
d: { ar: 'حسابك البنكي وبوّابة الدفع في خطوة واحدة.', en: 'Bank and payment gateway in one step.' } },
{ t: { ar: 'استورد الفواتير', en: 'Import invoices' },
d: { ar: 'من ملفّ أو مباشرةً من متجرك.', en: 'From a file or straight from your store.' } },
{ t: { ar: 'راجع التصنيف', en: 'Review categories' },
d: { ar: 'نقترح والتصنيف النهائي قرارك.', en: 'We suggest; the final call is yours.' } },
{ t: { ar: 'قدّم الإقرار', en: 'File the return' },
d: { ar: 'ملفّ جاهز بصيغة الهيئة.', en: 'A file in the authority’s format.' } }
];
/* أوّل خطوة مفعّلة لتوضّح شكل الحالة النشطة */
root.querySelector('.steps').innerHTML = STEPS.map(function (s, i) {
return '<li class="' + (i === 0 ? 'on' : '') + '">' +
'<span class="no num">' + (i + 1) + '</span>' +
'<span class="t">' + (ar ? s.t.ar : s.t.en) + '</span>' +
'<span class="d">' + (ar ? s.d.ar : s.d.en) + '</span></li>';
}).join('');
}
function mount() {
ac = new AbortController();
var real = window.document;
/* وسيط يمرّر كل شيء إلى المستند الحقيقي، ويعلّق كل مستمع بإشارة
تُقطع عند إعادة التركيب — فلا يبقى مستمع من نسخة ماتت. */
var doc = new Proxy(real, {
get: function (t, k) {
if (k === 'addEventListener') {
return function (type, fn, opts) {
var o = (opts && typeof opts === 'object') ? Object.assign({}, opts)
: { capture: !!opts };
o.signal = ac.signal;
return t.addEventListener(type, fn, o);
};
}
var v = t[k];
return typeof v === 'function' ? v.bind(t) : v;
}
});
function track(fn) {
return function (f, ms) { var id = fn(f, ms); timers.push(id); return id; };
}
run(host, doc, track(window.setTimeout.bind(window)),
track(window.setInterval.bind(window)));
}
function unmount() {
if (ac) ac.abort();
// المعرّفان يتشاركان فضاءً واحدًا في المتصفّح، فالإلغاء المزدوج آمن
timers.forEach(function (id) { window.clearTimeout(id); window.clearInterval(id); });
timers = [];
host.innerHTML = snapshot;
}
mount();
addEventListener('pt-lang', function () { unmount(); mount(); });
})();
# Numbered Steps
**Role:** You are an Arabic-first UI designer and front-end engineer. Read the whole
specification before writing a single line, then follow it literally. If two requirements
conflict, favour usability over visual effect.
**Goal:** Numbered Steps — A horizontal path whose connector stops at the last step instead of overshooting
**Why this component matters:** Draw the connector between steps, not through them: a line that runs past the final step reads as an unfinished process.
**Direction:** Genuine RTL — not a mirrored Latin layout. Use logical properties
(`margin-inline-start`, `padding-inline`, `inset-inline-start`, `text-align: start`),
never physical ones (`margin-left`, `left`). The layout must flip with `dir` on its own,
with no duplicated rules.
**Typography:** Cairo for Arabic, IBM Plex Sans for Latin. Arabic line-height must be
`0.18` higher than the Latin equivalent — dots, hamzas and maddas need more vertical room.
Arabic font-size runs `1.06×` the Latin size at the same optical weight.
**Numerals:** Western digits in both languages (`1,234.50`). Only the currency changes:
`ر.س` **after** the number in Arabic, `$` **before** it in English. Jordanian dinar
uses **three** decimal places, not two.
**Colors:** Dark mode — background `#0D142B` · surfaces `#211F54` · borders `#545C91` · text `#918FC2`.
Accent `#ADA9E8` must never exceed 8% of the screen area.
**Language:** Bilingual — every string carries both Arabic and English, and the layout
flips with `dir` automatically.
**States:** `default` · `hover` · `focus` · `active` · `disabled` · `loading` · `error`.
Do not design the resting state alone.
**Accessibility:** Contrast ratio at least `4.5:1`, complete keyboard navigation,
visible focus rings, and honour `prefers-reduced-motion`.
**Output:** Clean HTML and CSS in two separate files. No frameworks, no libraries,
no external dependencies.