المكوّنات · تسجيل بمزوّد خارجي
تسجيل بمزوّد خارجي
أزرار مزوّدين وفاصل وبديل بالبريد، بترتيب تركيز صحيح
12 تصاميم من هذه العائلة
<div class="sg sgc">
<h5 data-ar="ابدأ في دقيقة" data-en="Start in a minute">ابدأ في دقيقة</h5>
<div class="prov">
<button class="p" data-ar="المتابعة بحساب نفاذ" data-en="Continue with Nafath">المتابعة بحساب نفاذ</button>
<button class="p" data-ar="المتابعة بـ Google" data-en="Continue with Google">المتابعة بـ Google</button>
<button class="p" data-ar="المتابعة بـ Apple" data-en="Continue with Apple">المتابعة بـ Apple</button>
</div>
<div class="div" aria-hidden="true"><span data-ar="أو" data-en="or">أو</span></div>
<label><span data-ar="البريد الإلكتروني" data-en="Email">البريد الإلكتروني</span>
<input class="em" type="email" placeholder="name@company.com" dir="ltr">
<span class="err"></span></label>
<button class="go" data-ar="المتابعة بالبريد" data-en="Continue with email">المتابعة بالبريد</button>
</div>
/* pt-scoped */
/* signup-social — منصّة عقارية */
.sgc{width:100%;height:100%;display:flex;flex-direction:column;
font-size:10px;color:var(--pt-text-secondary);overflow:hidden}
.sgc h5{margin:0;font-size:11px;color:var(--pt-text-primary);font-weight:600}
.sgc .sub{margin:0;font-size:8.5px;color:var(--pt-text-muted)}
.sgc label{display:flex;flex-direction:column;gap:3px}
.sgc label > span{font-size:8.5px;color:var(--pt-text-muted)}
.sgc input, .sgc select{width:100%;font:inherit;font-size:9.5px;
color:var(--pt-text-primary);outline:none}
.sgc input::placeholder{color:var(--pt-text-muted)}
.sgc .err{font-size:8px;color:var(--pt-color-danger-400);min-height:0}
.sgc .ok{color:var(--pt-accent)}
.sgc button{font:inherit;cursor:pointer}
.sgc button:focus-visible, .sgc input:focus-visible{outline:2px solid var(--pt-focus-ring);
outline-offset:1px}
/* شخصية: أزرار عريضة متساوية، فاصل بخطّين، انحناء متوسّط */
.sgc{padding:10px;gap:6px;justify-content:center;
border:1px solid var(--pt-border-subtle);border-radius:var(--pt-radius-md);
background:var(--pt-surface)}
.sgc .prov{display:flex;flex-direction:column;gap:4px}
.sgc .p{padding:7px 9px;border-radius:var(--pt-radius-md);
border:1px solid var(--pt-border-default);background:var(--pt-bg-raised);
color:var(--pt-text-secondary);font-size:9.5px;text-align:center;
transition:border-color var(--pt-motion-duration-fast) var(--pt-motion-easing-standard),
color var(--pt-motion-duration-fast) var(--pt-motion-easing-standard)}
.sgc .p:hover{border-color:var(--pt-accent);color:var(--pt-accent)}
.sgc .p:first-child{border-color:color-mix(in srgb,var(--pt-accent) 45%,transparent);
color:var(--pt-accent)}
.sgc .div{display:flex;align-items:center;gap:7px;font-size:8px;color:var(--pt-text-muted)}
.sgc .div::before, .sgc .div::after{content:'';flex:1;height:1px;background:var(--pt-border-subtle)}
.sgc input{padding:6px 9px;border-radius:var(--pt-radius-md);
border:1px solid var(--pt-border-default);background:var(--pt-bg-inset)}
.sgc input[aria-invalid=true]{border-color:var(--pt-color-danger-400)}
.sgc .go{padding:7px;border-radius:var(--pt-radius-md);border:0;
background:var(--pt-accent);color:var(--pt-color-ink-900);font-size:9.5px;font-weight:600}
.sgc .go:disabled{opacity:.45;cursor:not-allowed}
/* يعمل داخل إطار معزول — لا يعتمد على شيء خارجه */
/* pt-remount — يعاد التركيب عند تبديل اللغة */
(function () {
var host = document.querySelector('.sgc');
if (!host) return;
var snapshot = host.innerHTML;
var timers = [];
var ac = null;
/* الجسم كما كتبه المولِّد. يستقبل بدائل مظلَّلة لـ root وdocument
والمؤقّتات، فينظّف نفسه دون أن يعرف أنه قابل لإعادة التركيب. */
function run(root, document, setTimeout, setInterval) {
/* الخطأ يظهر بعد مغادرة الحقل لا مع كل حرف: القراءة أثناء الكتابة
تُشعر المستخدم بالفشل قبل أن ينتهي من الإدخال. */
function bind(input, check, msg) {
var box = input.closest('label') || input.parentElement;
var err = box.querySelector('.err') || box.parentElement.querySelector('.err');
var touched = false;
function paint() {
var good = check(input.value);
input.setAttribute('aria-invalid', String(touched && !good));
if (err) err.textContent = touched && !good ? msg : '';
return good;
}
input.addEventListener('blur', function () { touched = true; paint(); });
input.addEventListener('input', function () { if (touched) paint(); });
return paint;
}
var em = root.querySelector('.em'), go = root.querySelector('.go');
function okEmail(v) { return /^[^@\s]+@[^@\s]+\.[a-z]{2,}$/i.test(v); }
bind(em, okEmail, 'صيغة البريد غير صحيحة');
function refresh() { go.disabled = !okEmail(em.value); }
em.addEventListener('input', refresh);
root.querySelectorAll('.p').forEach(function (b) {
b.addEventListener('click', function () {
b.textContent = '… ' + b.textContent;
setTimeout(function () { b.textContent = b.textContent.replace('… ', ''); }, 900);
});
});
refresh();
}
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(); });
})();
# Sign-up with Providers
**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:** Sign-up with Providers — Provider buttons, a divider and an email fallback — in correct focus order
**Why this component matters:** The divider between providers and the email form must be decorative for assistive tech (aria-hidden), or a screen reader reads the word “or” as if it were a control in the tab order.
**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.