หน้าเข้าสู่ระบบ
SignInLayout
The sign-in page and the other pages before sign-in, such as the first-login password change. On wide screens the page splits in two: a brand panel with the logo, the system's name and a headline, and a white side with the form centred. On phones the brand panel becomes a compact header above the form. Its title is the page's one level 1 heading. Pass the fields and the button as children. Don't put it inside AppShell.
ใช้กับหน้าก่อนเข้าสู่ระบบ ได้แก่ หน้าเข้าสู่ระบบ และหน้าตั้งรหัสผ่านใหม่เมื่อเข้าสู่ระบบครั้งแรก จอกว้างแบ่งครึ่ง ซ้ายเป็นแผงสีหลักของแอปมีตรา ชื่อระบบ และหัวข้อ ขวาเป็นฟอร์มสีขาวอยู่กลางจอ บนโทรศัพท์แผงสีหลักของแอปย่อเป็นหัวหน้าเล็ก ๆ เหนือฟอร์ม ส่งช่องกรอกและปุ่มเป็น children ไม่ใช้ใน AppShell ดูวิธีใช้ทั้งหน้าที่หน้าตัวอย่างเข้าสู่ระบบ
import { SignInLayout } from "@bsru/ui";ตัวอย่าง
เข้าสู่ระบบ
brand ให้ตรา ชื่อระบบ และชื่อมหาวิทยาลัย headline และ description อยู่ล่างแผงสีหลักของแอป title เป็น h1 หนึ่งเดียวของหน้า topAction วางปุ่มภาษาที่มุมขวาบน notice แสดงแถบระบบจำลอง
ระบบจำลอง ใช้ข้อมูลทดสอบเท่านั้น
BSRU ERPมหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยาระบบบริหารมหาวิทยาลัย
ระบบบริหารมหาวิทยาลัย
งบประมาณ พัสดุ บุคลากร ในที่เดียว
เข้าสู่ระบบ
ใช้อีเมลของมหาวิทยาลัยและรหัสผ่านของคุณ
<SignInLayout
brand={{ name: "BSRU ERP", caption: t("brand.university"), logo: "/bsru-logo.png", alt: t("brand.seal") }}
headline={t("signIn.headline")}
description={t("signIn.tagline")}
title={t("signIn.title")}
subtitle={t("signIn.subtitle")}
topAction={<LanguageSwitch />}
footer={t("signIn.forgot")}
notice={demo ? t("shell.demo") : undefined}
>
<form action={signIn} className="flex flex-col gap-4">
<TextInput label="อีเมล" name="email" type="email" icon={Mail} autoComplete="username" required />
<PasswordInput label="รหัสผ่าน" name="password" autoComplete="current-password" required />
<Button tone="primary" type="submit" icon={LogIn} label="เข้าสู่ระบบ" wide />
</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| headline | "ระบบบริหารมหาวิทยาลัย" | string | The brand panel's large headline, such as ระบบบริหารมหาวิทยาลัย. Ignored when slides is passed. |
| description | "งบประมาณ พัสดุ บุคลากร ในที่เดียว" | string | One line under the headline, such as งบประมาณ พัสดุ บุคลากร ในที่เดียว. Ignored when slides is passed. |
| title* จำเป็น | "เข้าสู่ระบบ" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
| subtitle | "ใช้อีเมลของมหาวิทยาลัยและรหัสผ่านของคุณ" | string | A short line under the title, such as what to sign in with. |
| footer | "ลืมรหัสผ่าน? ติดต่อผู้ดูแลระบบของหน่วยงาน" | ReactNode | Small text below the form, such as who to contact when the password is forgotten. |
| notice | "ระบบจำลอง ใช้ข้อมูลทดสอบเท่านั้น" | string | The gold strip across the top of the page, for demo and test systems, such as ระบบจำลอง. |
หลายข้อความ
slides แทน headline และ description เมื่อมีมากกว่าหนึ่งข้อความ จุดด้านล่างสลับข้อความ ข้อความเลื่อนเองทุกเก้าวินาทีเฉพาะเมื่อผู้ใช้ไม่ได้ขอลดการเคลื่อนไหว และหยุดเมื่อกดจุด ถ้ามีภาพมหาวิทยาลัยที่ได้รับอนุญาต image วางภาพไว้ใต้สีหลักของแอปแบบโปร่ง
BSRU ERPมหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยาระบบบริหารมหาวิทยาลัย
ระบบบริหารมหาวิทยาลัย
งบประมาณ พัสดุ บุคลากร ในที่เดียว
เข้าสู่ระบบ
<SignInLayout
brand={brand}
slides={[
{ headline: t("signIn.slide1"), description: t("signIn.slide1Text") },
{ headline: t("signIn.slide2"), description: t("signIn.slide2Text") },
{ headline: t("signIn.slide3"), description: t("signIn.slide3Text") },
]}
title={t("signIn.title")}
>
<form action={signIn} className="flex flex-col gap-4">
<TextInput label="อีเมล" name="email" type="email" icon={Mail} autoComplete="username" required />
<PasswordInput label="รหัสผ่าน" name="password" autoComplete="current-password" required />
<Button tone="primary" type="submit" icon={LogIn} label="เข้าสู่ระบบ" wide />
</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| slides | รายการ 4 รายการ[
{
headline: "ระบบบริหารมหาวิทยาลัย",
description: "งบประมาณ พัสดุ บุคลากร ในที่เดียว",
},
{
headline: "อนุมัติได้ทุกที่",
description: "ตรวจและอนุมัติคำขอจากโทรศัพท์ได้ทันที",
},
{
headline: "ตรวจสอบได้ทุกขั้นตอน",
description: "ทุกการเปลี่ยนแปลงมีผู้รับผิดชอบและเวลาบันทึกไว้",
},
{
headline: "เชื่อมต่อ AI ผ่าน MCP",
description: "ผู้ช่วย AI ทำงานกับข้อมูล ERP ด้วยสิทธิ์ของคุณเท่านั้น",
},
] | readonly SignInSlide[] | Several headlines for the brand panel, in order. With more than one, dots below them switch between them. They move on by themselves every nine seconds only when the person hasn't asked for reduced motion, and stop once a dot is pressed or while the pointer or focus is on the panel. |
| title* จำเป็น | "เข้าสู่ระบบ" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
หลายข้อความ พร้อมภาพประกอบ
art ของแต่ละข้อความวางภาพประกอบไว้ระหว่างตรากับหัวข้อ บนจอกว้างเท่านั้น SignInFigure เป็นภาพสามมิติแบบไอโซเมตริกสี่แบบ connected คืองบประมาณ พัสดุ และบุคลากรส่งงานเข้าอาคารเดียว approval คือคำขอที่อนุมัติจากโทรศัพท์ไปถึงมหาวิทยาลัย audit คือบันทึกใหม่ที่ซ้อนเข้าสมุดบันทึก assistant คือผู้ช่วย AI ที่เชื่อมต่อ ERP ผ่าน MCP กดส่วนต่าง ๆ ของภาพได้ และลากเพื่อหมุนเล็กน้อย ภาพนำเข้าจาก ui/src/signin-figures ไม่ใช่จาก @bsru/ui
BSRU ERPมหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยาระบบบริหารมหาวิทยาลัย
ระบบบริหารมหาวิทยาลัย
งบประมาณ พัสดุ บุคลากร ในที่เดียว
เข้าสู่ระบบ
import { SignInFigure } from "@bsru/ui/src/signin-figures";
<SignInLayout
brand={brand}
slides={[
{ headline: t("signIn.slide1"), description: t("signIn.slide1Text"), art: <SignInFigure figure="connected" /> },
{ headline: t("signIn.slide2"), description: t("signIn.slide2Text"), art: <SignInFigure figure="approval" /> },
{ headline: t("signIn.slide3"), description: t("signIn.slide3Text"), art: <SignInFigure figure="audit" /> },
{ headline: t("signIn.slide4"), description: t("signIn.slide4Text"), art: <SignInFigure figure="assistant" /> },
]}
title={t("signIn.title")}
>
<form action={signIn} className="flex flex-col gap-4">
<TextInput label="อีเมล" name="email" type="email" icon={Mail} autoComplete="username" required />
<PasswordInput label="รหัสผ่าน" name="password" autoComplete="current-password" required />
<Button tone="primary" type="submit" icon={LogIn} label="เข้าสู่ระบบ" wide />
</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| slides | รายการ 4 รายการ[
{
headline: "ระบบบริหารมหาวิทยาลัย",
description: "งบประมาณ พัสดุ บุคลากร ในที่เดียว",
},
{
headline: "อนุมัติได้ทุกที่",
description: "ตรวจและอนุมัติคำขอจากโทรศัพท์ได้ทันที",
},
{
headline: "ตรวจสอบได้ทุกขั้นตอน",
description: "ทุกการเปลี่ยนแปลงมีผู้รับผิดชอบและเวลาบันทึกไว้",
},
{
headline: "เชื่อมต่อ AI ผ่าน MCP",
description: "ผู้ช่วย AI ทำงานกับข้อมูล ERP ด้วยสิทธิ์ของคุณเท่านั้น",
},
] | readonly SignInSlide[] | Several headlines for the brand panel, in order. With more than one, dots below them switch between them. They move on by themselves every nine seconds only when the person hasn't asked for reduced motion, and stop once a dot is pressed or while the pointer or focus is on the panel. |
| title* จำเป็น | "เข้าสู่ระบบ" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
props ทั้งหมด
ตัวอย่างด้านบนใช้ props เพียงบางตัว ตารางนี้แสดงทุกตัวที่คอมโพเนนต์รับ พร้อมค่าเริ่มต้นและค่าที่ใช้ได้
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | PageBrand | — | The logo, the system's name and a caption, at the top of the brand panel. |
| headline | string | — | The brand panel's large headline, such as ระบบบริหารมหาวิทยาลัย. Ignored when slides is passed. |
| description | string | — | One line under the headline, such as งบประมาณ พัสดุ บุคลากร ในที่เดียว. Ignored when slides is passed. |
| slides | readonly SignInSlide[] | — | Several headlines for the brand panel, in order. With more than one, dots below them switch between them. They move on by themselves every nine seconds only when the person hasn't asked for reduced motion, and stop once a dot is pressed or while the pointer or focus is on the panel. |
| image | string | — | A picture for the brand panel, such as a campus photo. It sits under a wash of the brand colour, so the text stays readable. |
| imageAlt | string | "" | The picture's alternative text. Leave it empty when the picture is only decoration, the default. |
| title* จำเป็น | string | — | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
| subtitle | string | — | A short line under the title, such as what to sign in with. |
| children* จำเป็น | ReactNode | — | The form: an Alert for a failed attempt, the fields and the primary Button. |
| alternatives | ReactNode | — | Other ways to sign in, such as a secondary Button for the university account (SSO), shown below the form after an "or" divider. |
| footer | ReactNode | — | Small text below the form, such as who to contact when the password is forgotten. |
| topAction | ReactNode | — | One control at the top right, such as the language switch or a link back to the main site. |
| notice | string | — | The gold strip across the top of the page, for demo and test systems, such as ระบบจำลอง. |
ชนิดข้อมูล
PageBrand
The system's logo and name, at the top of a page that has no app frame, such as the sign-in page.
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| name* จำเป็น | string | — | The system's name, such as BSRU ERP or BSRU ERP คอนโซลผู้ดูแลระบบ. |
| caption | string | — | A small line under the name, such as the university's name. |
| logo* จำเป็น | string | — | The logo image's URL, such as /bsru-logo.png. |
| alt* จำเป็น | string | — | The logo's alternative text, such as ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา. |
| href | string | — | Makes the logo and name a link, such as to the home page. Leave it out on the sign-in page. |
SignInSlide
One message on the sign-in page's brand panel.
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| headline* จำเป็น | string | — | A short headline about the system, such as ระบบบริหารมหาวิทยาลัย. |
| description | string | — | One line under the headline, such as งบประมาณ พัสดุ บุคลากร ในที่เดียว. |
| art | ReactNode | — | A figure for this message, shown in the brand panel between the logo and the headline on wide screens, such as a SignInFigure from ui/src/signin-figures. It is decoration, hidden from screen readers. Leave it out for none. |
ข้อควรปฏิบัติ
- ใช้ภาษาของหน้าจอกับทุกข้อความ แอปแปลเองด้วยไฟล์ข้อความ ส่วนคำของ SignInLayout เอง เช่น คำว่า หรือ และชื่อจุดสลับข้อความ เปลี่ยนตาม LangProvider
- มี h1 หนึ่งเดียวคือ title แผงสีหลักของแอปไม่มีหัวข้อ ส่วนฟอร์มอยู่ใน main และเป็น region ที่ชื่อตาม title
- จุดสลับข้อความสูง 44 พิกเซลเพื่อกดด้วยนิ้วได้ และใช้ aria-pressed บอกข้อความที่แสดงอยู่
- ภาพประกอบเป็นของตกแต่ง ซ่อนจากโปรแกรมอ่านหน้าจอ ข้อความทุกอย่างอยู่ในหัวข้อและคำอธิบาย ภาพเคลื่อนไหวเองเฉพาะเมื่อผู้ใช้ไม่ได้ขอลดการเคลื่อนไหว
- อย่าใส่ภาพที่มีบุคคลจริงในตัวอย่าง ภาพจริงของมหาวิทยาลัยต้องได้รับอนุญาตก่อน
ซอร์สโค้ด: ui/src/pages.tsx