@govnepal/ui 0.1.0 → 0.2.0
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.
- package/dist/Checkbox.d.ts +17 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +11 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Details.d.ts +21 -0
- package/dist/Details.d.ts.map +1 -0
- package/dist/Details.js +6 -0
- package/dist/Details.js.map +1 -0
- package/dist/Emblem.d.ts +11 -0
- package/dist/Emblem.d.ts.map +1 -0
- package/dist/Emblem.js +25 -0
- package/dist/Emblem.js.map +1 -0
- package/dist/Header.d.ts +7 -2
- package/dist/Header.d.ts.map +1 -1
- package/dist/Header.js +6 -4
- package/dist/Header.js.map +1 -1
- package/dist/LanguageSwitcher.d.ts +25 -0
- package/dist/LanguageSwitcher.d.ts.map +1 -0
- package/dist/LanguageSwitcher.js +19 -0
- package/dist/LanguageSwitcher.js.map +1 -0
- package/dist/PhaseBanner.d.ts +17 -0
- package/dist/PhaseBanner.d.ts.map +1 -0
- package/dist/PhaseBanner.js +6 -0
- package/dist/PhaseBanner.js.map +1 -0
- package/dist/RadioGroup.d.ts +32 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +14 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/Select.d.ts +28 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +13 -0
- package/dist/Select.js.map +1 -0
- package/dist/Stepper.d.ts +23 -0
- package/dist/Stepper.d.ts.map +1 -0
- package/dist/Stepper.js +18 -0
- package/dist/Stepper.js.map +1 -0
- package/dist/WarningText.d.ts +18 -0
- package/dist/WarningText.d.ts.map +1 -0
- package/dist/WarningText.js +6 -0
- package/dist/WarningText.js.map +1 -0
- package/dist/generated/statusTaxonomy.js +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox (components/checkbox.md) — an independent yes/no choice, or one of several from a short
|
|
4
|
+
* list. A legal declaration ("I confirm the information is correct") is the canonical single use,
|
|
5
|
+
* and it is NEVER pre-ticked: an unticked declaration is the legal point.
|
|
6
|
+
*
|
|
7
|
+
* The behavior over the .gov-choice classes: a real <input type="checkbox"> (never a styled div),
|
|
8
|
+
* the whole label clickable and bound with htmlFor, and the checked state surviving a validation
|
|
9
|
+
* error — this component never resets it.
|
|
10
|
+
*/
|
|
11
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
hint?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function Checkbox({ label, hint, id, className, ...rest }: CheckboxProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxE;;;;;;;;GAQG;AAEH,UAAU,aAAc,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACjF,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAwB9E"}
|
package/dist/Checkbox.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { cx } from "./cx.js";
|
|
5
|
+
export function Checkbox({ label, hint, id, className, ...rest }) {
|
|
6
|
+
const generatedId = useId();
|
|
7
|
+
const inputId = id ?? generatedId;
|
|
8
|
+
const hintId = hint ? `${inputId}-hint` : undefined;
|
|
9
|
+
return (_jsxs("label", { className: cx("gov-choice", className), htmlFor: inputId, children: [_jsx("input", { id: inputId, type: "checkbox", className: "gov-choice__input", "aria-describedby": hintId, ...rest }), _jsxs("span", { className: "gov-choice__label", children: [label, hint && (_jsx("span", { className: "gov-choice__hint", id: hintId, children: hint }))] })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAA4C,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAiB7B,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB;IAC7E,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,EAAE,IAAI,WAAW,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAEpD,OAAO,CACL,iBAAO,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,aAC7D,gBACE,EAAE,EAAE,OAAO,EACX,IAAI,EAAC,UAAU,EACf,SAAS,EAAC,mBAAmB,sBACX,MAAM,KACpB,IAAI,GACR,EACF,gBAAM,SAAS,EAAC,mBAAmB,aAChC,KAAK,EACL,IAAI,IAAI,CACP,eAAM,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,MAAM,YAC1C,IAAI,GACA,CACR,IACI,IACD,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Details (components/details.md) — optional explanatory content ("Why we ask this") that would add
|
|
4
|
+
* length without necessity for most readers. Uses native <details>/<summary>, so the disclosure
|
|
5
|
+
* semantics, keyboard operation, and screen-reader announcement come from the platform, never a
|
|
6
|
+
* hand-rolled onClick div. Not a Server/Client distinction issue — no hooks — so it stays a plain
|
|
7
|
+
* (server-capable) component.
|
|
8
|
+
*
|
|
9
|
+
* The label states what is inside, never a bare "More".
|
|
10
|
+
*/
|
|
11
|
+
interface DetailsProps {
|
|
12
|
+
/** What the panel contains, e.g. "Why we ask for your ward number". Never "More info". */
|
|
13
|
+
summary: ReactNode;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/** Collapsed by default; a documented exception may open it. */
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function Details({ summary, children, defaultOpen, className }: DetailsProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=Details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../src/Details.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;GAQG;AAEH,UAAU,YAAY;IACpB,0FAA0F;IAC1F,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAmB,EAAE,SAAS,EAAE,EAAE,YAAY,+BAqB1F"}
|
package/dist/Details.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "./cx.js";
|
|
3
|
+
export function Details({ summary, children, defaultOpen = false, className }) {
|
|
4
|
+
return (_jsxs("details", { className: cx("gov-details", className), open: defaultOpen || undefined, children: [_jsxs("summary", { className: "gov-details__summary", children: [_jsx("svg", { className: "gov-details__chevron", viewBox: "0 0 24 24", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M9 6l6 6-6 6" }) }), summary] }), _jsx("div", { className: "gov-details__content", children: children })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Details.js","sourceRoot":"","sources":["../src/Details.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAqB7B,MAAM,UAAU,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,EAAgB;IACzF,OAAO,CACL,mBAAS,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,IAAI,SAAS,aAC9E,mBAAS,SAAS,EAAC,sBAAsB,aACvC,cACE,SAAS,EAAC,sBAAsB,EAChC,OAAO,EAAC,WAAW,iBACP,MAAM,EAClB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,CAAC,EACd,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,YAEtB,eAAM,CAAC,EAAC,cAAc,GAAG,GACrB,EACL,OAAO,IACA,EACV,cAAK,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAO,IAC9C,CACX,CAAC;AACJ,CAAC"}
|
package/dist/Emblem.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ImgHTMLAttributes } from "react";
|
|
2
|
+
interface MarkProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "alt"> {
|
|
3
|
+
/** Override where the master is served from. Defaults to the web root. */
|
|
4
|
+
src?: string;
|
|
5
|
+
/** Accessible name — the institution, per the identity spec; never "logo". */
|
|
6
|
+
alt?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Emblem({ src, alt, className, ...rest }: MarkProps): import("react").JSX.Element;
|
|
9
|
+
export declare function Flag({ src, alt, className, ...rest }: MarkProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=Emblem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Emblem.d.ts","sourceRoot":"","sources":["../src/Emblem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAmB/C,UAAU,SAAU,SAAQ,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAClF,0EAA0E;IAC1E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,MAAM,CAAC,EAAE,GAAwB,EAAE,GAAyC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAE5H;AAED,wBAAgB,IAAI,CAAC,EAAE,GAAsB,EAAE,GAA8B,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAI7G"}
|
package/dist/Emblem.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "./cx.js";
|
|
3
|
+
/**
|
|
4
|
+
* The national identity marks — the coat of arms and the flag (identity/emblem, identity/flag).
|
|
5
|
+
*
|
|
6
|
+
* Both render as <img> pointing at the verified master shipped in @govnepal/css (and mirrored to
|
|
7
|
+
* the consumer's web root). They are NEVER inlined or redrawn: recreating, recolouring, cropping,
|
|
8
|
+
* or tracing either mark is prohibited (a constitutional/legal error, not a style choice), and the
|
|
9
|
+
* emblem at ~40 KB gzipped would blow the page budget if inlined on every page — as an <img> it is
|
|
10
|
+
* cached media the browser fetches once.
|
|
11
|
+
*
|
|
12
|
+
* No hooks, so these stay usable in a Server Component. `alt` defaults to English; a caller with
|
|
13
|
+
* language context (the Header) passes the localized alternative text.
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_EMBLEM_SRC = "/emblem-of-nepal.svg";
|
|
16
|
+
const DEFAULT_FLAG_SRC = "/flag-of-nepal.svg";
|
|
17
|
+
export function Emblem({ src = DEFAULT_EMBLEM_SRC, alt = "Emblem of the Government of Nepal", className, ...rest }) {
|
|
18
|
+
return _jsx("img", { src: src, alt: alt, className: cx("gov-emblem", className), ...rest });
|
|
19
|
+
}
|
|
20
|
+
export function Flag({ src = DEFAULT_FLAG_SRC, alt = "National flag of Nepal", className, ...rest }) {
|
|
21
|
+
// The flag has no rectangular canvas — its double-pennant silhouette sits on the page background
|
|
22
|
+
// (identity/flag). Never box it; the CSS gives it no border or background plate.
|
|
23
|
+
return _jsx("img", { src: src, alt: alt, className: cx("gov-flag", className), ...rest });
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Emblem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Emblem.js","sourceRoot":"","sources":["../src/Emblem.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B;;;;;;;;;;;GAWG;AAEH,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAS9C,MAAM,UAAU,MAAM,CAAC,EAAE,GAAG,GAAG,kBAAkB,EAAE,GAAG,GAAG,mCAAmC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAa;IAC3H,OAAO,cAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EAAE,GAAG,GAAG,gBAAgB,EAAE,GAAG,GAAG,wBAAwB,EAAE,SAAS,EAAE,GAAG,IAAI,EAAa;IAC5G,iGAAiG;IACjG,iFAAiF;IACjF,OAAO,cAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AACrF,CAAC"}
|
package/dist/Header.d.ts
CHANGED
|
@@ -12,8 +12,13 @@ import { type Language } from "./ThemeProvider.js";
|
|
|
12
12
|
* dev-only placeholder rather than inventing artwork that might look shippable.
|
|
13
13
|
*/
|
|
14
14
|
interface HeaderProps {
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The emblem. Defaults to the verified `<Emblem>` (served from the web root or @govnepal/css).
|
|
17
|
+
* Pass a custom node only to point at a different asset path; pass `null` to opt out entirely.
|
|
18
|
+
*/
|
|
16
19
|
emblem?: ReactNode;
|
|
20
|
+
/** Where the emblem master is served from, if not the default web-root path. */
|
|
21
|
+
emblemSrc?: string;
|
|
17
22
|
/** Office name, Nepali first then English (Article 7). Both are shown; en hides on mobile. */
|
|
18
23
|
officeNe: string;
|
|
19
24
|
officeEn: string;
|
|
@@ -26,6 +31,6 @@ interface HeaderProps {
|
|
|
26
31
|
children?: ReactNode;
|
|
27
32
|
className?: string;
|
|
28
33
|
}
|
|
29
|
-
export declare function Header({ emblem, officeNe, officeEn, serviceName, languageHrefs, skipTargetId, children, className, }: HeaderProps): import("react").JSX.Element;
|
|
34
|
+
export declare function Header({ emblem, emblemSrc, officeNe, officeEn, serviceName, languageHrefs, skipTargetId, children, className, }: HeaderProps): import("react").JSX.Element;
|
|
30
35
|
export {};
|
|
31
36
|
//# sourceMappingURL=Header.d.ts.map
|
package/dist/Header.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../src/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../src/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG7D;;;;;;;;;;GAUG;AAEH,UAAU,WAAW;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,uFAAuF;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,iGAAiG;IACjG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,aAAa,EACb,YAAqB,EACrB,QAAQ,EACR,SAAS,GACV,EAAE,WAAW,+BAiEb"}
|
package/dist/Header.js
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cx } from "./cx.js";
|
|
4
4
|
import { useTheme } from "./ThemeProvider.js";
|
|
5
|
+
import { Emblem } from "./Emblem.js";
|
|
5
6
|
const SKIP_LABEL = { ne: "मुख्य सामग्रीमा जानुहोस्", en: "Skip to main content" };
|
|
6
7
|
const EMBLEM_ALT = { ne: "नेपाल सरकारको निशान छाप", en: "Emblem of the Government of Nepal" };
|
|
7
|
-
export function Header({ emblem, officeNe, officeEn, serviceName, languageHrefs, skipTargetId = "main", children, className, }) {
|
|
8
|
+
export function Header({ emblem, emblemSrc, officeNe, officeEn, serviceName, languageHrefs, skipTargetId = "main", children, className, }) {
|
|
8
9
|
const { language, setLanguage } = useTheme();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Default to the verified emblem; `emblem={null}` opts out. The alt names the institution in the
|
|
11
|
+
// active language (identity/emblem — never "logo").
|
|
12
|
+
const emblemNode = emblem === undefined ? _jsx(Emblem, { src: emblemSrc, alt: EMBLEM_ALT[language] }) : emblem;
|
|
13
|
+
return (_jsxs("header", { className: cx("gov-header", className), role: "banner", children: [_jsx("a", { className: "gov-skip-link", href: `#${skipTargetId}`, children: SKIP_LABEL[language] }), _jsx("div", { className: "gov-container", children: _jsxs("div", { className: "gov-header__inner", children: [_jsxs("span", { className: "gov-header__lockup", children: [emblemNode && _jsx("span", { className: "gov-header__emblem", children: emblemNode }), _jsxs("span", { className: "gov-header__office", children: [_jsx("span", { className: "gov-header__office-ne", lang: "ne", children: officeNe }), _jsx("span", { className: "gov-header__office-en", lang: "en", children: officeEn })] })] }), serviceName && _jsx("span", { className: "gov-header__service", children: serviceName }), _jsxs("nav", { className: "gov-header__language", "aria-label": language === "ne" ? "भाषा" : "Language", children: [_jsx("a", { href: languageHrefs?.ne ?? "#", lang: "ne", hrefLang: "ne", "aria-current": language === "ne" ? "true" : undefined, onClick: (event) => {
|
|
12
14
|
if (!languageHrefs)
|
|
13
15
|
event.preventDefault();
|
|
14
16
|
setLanguage("ne");
|
package/dist/Header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../src/Header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAiB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../src/Header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAiB,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAmCrC,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,0BAA0B,EAAE,EAAE,EAAE,sBAAsB,EAAW,CAAC;AAC3F,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,yBAAyB,EAAE,EAAE,EAAE,mCAAmC,EAAW,CAAC;AAEvG,MAAM,UAAU,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,aAAa,EACb,YAAY,GAAG,MAAM,EACrB,QAAQ,EACR,SAAS,GACG;IACZ,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE7C,iGAAiG;IACjG,oDAAoD;IACpD,MAAM,UAAU,GACd,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAExF,OAAO,CACL,kBAAQ,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CAAC,CAAC,SAAS,EACpD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wCACjB,IAAI,CAAC,aAAa;4CAAE,KAAK,CAAC,cAAc,EAAE,CAAC;wCAC3C,WAAW,CAAC,IAAI,CAAC,CAAC;oCACpB,CAAC,mBAGC,IACA,EAEL,QAAQ,IACL,GACF,IACC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Language } from "./themeCore.js";
|
|
2
|
+
/**
|
|
3
|
+
* Language switcher (components/language-switcher.md) — a compact text toggle, each language shown
|
|
4
|
+
* by its own autonym ("नेपाली", not "Nepali"), the current one distinguished by weight + underline
|
|
5
|
+
* (never colour alone). Each option is a real link with `lang` set and `aria-current` on the
|
|
6
|
+
* active one; switching updates the page's own lang so a screen reader changes pronunciation.
|
|
7
|
+
*
|
|
8
|
+
* The available languages are data-driven, so adding a third (Maithili, …) is a content change,
|
|
9
|
+
* not a rebuild. Switching never triggers a reload that loses in-progress form state — with no
|
|
10
|
+
* `hrefs` given it toggles in place via the theme provider.
|
|
11
|
+
*/
|
|
12
|
+
interface LanguageChoice {
|
|
13
|
+
code: Language | string;
|
|
14
|
+
/** The language's own name — its autonym. */
|
|
15
|
+
autonym: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
}
|
|
18
|
+
interface LanguageSwitcherProps {
|
|
19
|
+
/** Defaults to the v1 two-language set (Nepali, English). */
|
|
20
|
+
languages?: LanguageChoice[];
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function LanguageSwitcher({ languages, className }: LanguageSwitcherProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=LanguageSwitcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageSwitcher.d.ts","sourceRoot":"","sources":["../src/LanguageSwitcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C;;;;;;;;;GASG;AAEH,UAAU,cAAc;IACtB,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,qBAAqB;IAC7B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,SAA6B,EAAE,SAAS,EAAE,EAAE,qBAAqB,+BA6BnG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cx } from "./cx.js";
|
|
4
|
+
import { useTheme } from "./ThemeProvider.js";
|
|
5
|
+
const DEFAULT_LANGUAGES = [
|
|
6
|
+
{ code: "ne", autonym: "नेपाली" },
|
|
7
|
+
{ code: "en", autonym: "English" },
|
|
8
|
+
];
|
|
9
|
+
export function LanguageSwitcher({ languages = DEFAULT_LANGUAGES, className }) {
|
|
10
|
+
const { language, setLanguage } = useTheme();
|
|
11
|
+
return (_jsx("div", { className: cx("gov-language-switcher", className), children: languages.map((choice, i) => (_jsxs("span", { style: { display: "contents" }, children: [i > 0 && (_jsx("span", { className: "gov-language-switcher__divider", "aria-hidden": "true", children: "\u00B7" })), _jsx("a", { href: choice.href ?? "#", lang: choice.code, hrefLang: choice.code, "aria-current": language === choice.code ? "true" : undefined, onClick: (event) => {
|
|
12
|
+
if (!choice.href)
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
// Only the two known app languages drive the provider; others rely on their href.
|
|
15
|
+
if (choice.code === "ne" || choice.code === "en")
|
|
16
|
+
setLanguage(choice.code);
|
|
17
|
+
}, children: choice.autonym })] }, choice.code))) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=L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K,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;4BAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAC7E,CAAC,YAEA,MAAM,CAAC,OAAO,GACb,KAlBK,MAAM,CAAC,IAAI,CAmBf,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Phase banner (components/phase-banner.md) — a single-line band directly below the government
|
|
4
|
+
* header on a service still in pilot. Plain text, never colour alone; reads in document order
|
|
5
|
+
* right after the header landmark, before the main content. Remove it (don't leave "new" stale)
|
|
6
|
+
* once the service reaches official status — so it's driven by the service's status, not hardcoded.
|
|
7
|
+
*/
|
|
8
|
+
interface PhaseBannerProps {
|
|
9
|
+
/** The phase word — "New" / "Pilot". */
|
|
10
|
+
phase: ReactNode;
|
|
11
|
+
/** One clause on what that means, plus a feedback link, e.g. "help us improve it. Give feedback". */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function PhaseBanner({ phase, children, className }: PhaseBannerProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=PhaseBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhaseBanner.d.ts","sourceRoot":"","sources":["../src/PhaseBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;GAKG;AAEH,UAAU,gBAAgB;IACxB,wCAAwC;IACxC,KAAK,EAAE,SAAS,CAAC;IACjB,qGAAqG;IACrG,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAS3E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "./cx.js";
|
|
3
|
+
export function PhaseBanner({ phase, children, className }) {
|
|
4
|
+
return (_jsx("div", { className: cx("gov-phase-banner", className), children: _jsxs("div", { className: "gov-container", children: [_jsx("span", { className: "gov-phase-banner__tag", children: phase }), _jsx("span", { children: children })] }) }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=PhaseBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhaseBanner.js","sourceRoot":"","sources":["../src/PhaseBanner.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAiB7B,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAoB;IAC1E,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,YAC/C,eAAK,SAAS,EAAC,eAAe,aAC5B,eAAM,SAAS,EAAC,uBAAuB,YAAE,KAAK,GAAQ,EACtD,yBAAO,QAAQ,GAAQ,IACnB,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Radio group (components/radio.md) — choose exactly one of 2–7 visible options.
|
|
4
|
+
*
|
|
5
|
+
* Gender is the canonical case: the three legal options (महिला / पुरुष / अन्य) are ALWAYS a radio
|
|
6
|
+
* group, never a select that hides them (§7.1). And when the choice carries legal or personal
|
|
7
|
+
* weight (gender, calendar), there is no default selection — the citizen must choose actively, so
|
|
8
|
+
* this component does not preselect.
|
|
9
|
+
*
|
|
10
|
+
* The behavior over the .gov-choice classes: native radios sharing one `name` (so arrow keys move
|
|
11
|
+
* within the group and Tab moves past it), a <fieldset>/<legend> carrying the question, and the
|
|
12
|
+
* error marking the GROUP, not one option.
|
|
13
|
+
*/
|
|
14
|
+
export interface RadioOption {
|
|
15
|
+
value: string;
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
hint?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
interface RadioGroupProps {
|
|
20
|
+
/** The question, rendered as the fieldset legend. */
|
|
21
|
+
legend: ReactNode;
|
|
22
|
+
name: string;
|
|
23
|
+
options: RadioOption[];
|
|
24
|
+
value?: string;
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
error?: ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function RadioGroup({ legend, name, options, value, defaultValue, onChange, error, className, }: RadioGroupProps): import("react").JSX.Element;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../src/RadioGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,qDAAqD;IACrD,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,IAAI,EACJ,OAAO,EACP,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE,eAAe,+BAgDjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { cx } from "./cx.js";
|
|
5
|
+
export function RadioGroup({ legend, name, options, value, defaultValue, onChange, error, className, }) {
|
|
6
|
+
const groupId = useId();
|
|
7
|
+
const errorId = error ? `${groupId}-error` : undefined;
|
|
8
|
+
return (_jsxs("fieldset", { className: cx("gov-choice-group", error ? "gov-choice-group--error" : undefined, className), "aria-describedby": errorId, "aria-invalid": error ? true : undefined, children: [_jsx("legend", { className: "gov-choice-group__legend", children: legend }), error && (_jsxs("span", { className: "gov-choice-group__error", id: errorId, children: [_jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", "aria-hidden": "true", fill: "currentColor", children: _jsx("path", { d: "M12 2a10 10 0 100 20 10 10 0 000-20zm-1 5h2v6h-2V7zm0 8h2v2h-2v-2z" }) }), error] })), options.map((option) => {
|
|
9
|
+
const optionId = `${groupId}-${option.value}`;
|
|
10
|
+
const hintId = option.hint ? `${optionId}-hint` : undefined;
|
|
11
|
+
return (_jsxs("label", { className: "gov-choice", htmlFor: optionId, children: [_jsx("input", { id: optionId, type: "radio", className: "gov-choice__input", name: name, value: option.value, checked: value !== undefined ? value === option.value : undefined, defaultChecked: defaultValue !== undefined ? defaultValue === option.value : undefined, "aria-describedby": hintId, onChange: (e) => onChange?.(e.target.value) }), _jsxs("span", { className: "gov-choice__label", children: [option.label, option.hint && (_jsx("span", { className: "gov-choice__hint", id: hintId, children: option.hint }))] })] }, option.value));
|
|
12
|
+
})] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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BAAO,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,QAAQ,aAC7C,gBACE,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EACjE,cAAc,EAAE,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,sBACpE,MAAM,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC3C,EACF,gBAAM,SAAS,EAAC,mBAAmB,aAChC,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,IAAI,IAAI,CACd,eAAM,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,MAAM,YAC1C,MAAM,CAAC,IAAI,GACP,CACR,IACI,KAnB6C,MAAM,CAAC,KAAK,CAoB1D,CACT,CAAC;YACJ,CAAC,CAAC,IACO,CACZ,CAAC;AACJ,CAAC"}
|
package/dist/Select.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ReactNode, type SelectHTMLAttributes } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Select (components/select.md) — one choice from a known list (province, district, document type).
|
|
4
|
+
*
|
|
5
|
+
* A native <select>, deliberately: it inherits the OS picker on mobile, which beats any custom
|
|
6
|
+
* dropdown on a small screen and works with every assistive technology. The first option is a real
|
|
7
|
+
* instruction ("Select your province"), disabled and never a value.
|
|
8
|
+
*
|
|
9
|
+
* The behavior over the .gov-select classes: the label binding, aria-describedby joining hint and
|
|
10
|
+
* error, aria-invalid on error, and a stable id the error summary can target — the same form-field
|
|
11
|
+
* contract as TextInput.
|
|
12
|
+
*/
|
|
13
|
+
export interface SelectOption {
|
|
14
|
+
value: string;
|
|
15
|
+
label: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "id"> {
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
id?: string;
|
|
20
|
+
hint?: ReactNode;
|
|
21
|
+
error?: ReactNode;
|
|
22
|
+
/** The disabled leading instruction, e.g. "Select your province". Shown when nothing is chosen. */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
options: SelectOption[];
|
|
25
|
+
}
|
|
26
|
+
export declare function Select({ label, id, hint, error, placeholder, options, className, defaultValue, value, ...rest }: SelectProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAGzE;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;IAC/E,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,EAAE,EACF,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,YAAY,EACZ,KAAK,EACL,GAAG,IAAI,EACR,EAAE,WAAW,+BA+Cb"}
|
package/dist/Select.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { cx } from "./cx.js";
|
|
5
|
+
export function Select({ label, id, hint, error, placeholder, options, className, defaultValue, value, ...rest }) {
|
|
6
|
+
const generatedId = useId();
|
|
7
|
+
const selectId = id ?? generatedId;
|
|
8
|
+
const hintId = hint ? `${selectId}-hint` : undefined;
|
|
9
|
+
const errorId = error ? `${selectId}-error` : undefined;
|
|
10
|
+
const describedBy = [hintId, errorId].filter(Boolean).join(" ") || undefined;
|
|
11
|
+
return (_jsxs("div", { className: cx("gov-field", error ? "gov-field--error" : undefined), children: [_jsx("label", { className: "gov-field__label", htmlFor: selectId, children: label }), hint && (_jsx("span", { className: "gov-field__hint", id: hintId, children: hint })), _jsxs("select", { id: selectId, className: cx("gov-select", className), "aria-describedby": describedBy, "aria-invalid": error ? true : undefined, defaultValue: value === undefined && defaultValue === undefined && placeholder ? "" : defaultValue, value: value, ...rest, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] }), error && (_jsxs("span", { className: "gov-field__error", id: errorId, children: [_jsx("svg", { className: "gov-field__error-icon", viewBox: "0 0 24 24", "aria-hidden": "true", fill: "currentColor", children: _jsx("path", { d: "M12 2a10 10 0 100 20 10 10 0 000-20zm-1 5h2v6h-2V7zm0 8h2v2h-2v-2z" }) }), error] }))] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAA6C,M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AK,KACR,IAAI,aAEP,WAAW,IAAI,CACd,iBAAQ,KAAK,EAAC,EAAE,EAAC,QAAQ,kBACtB,WAAW,GACL,CACV,EACA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAAQ,KAAK,EAAE,MAAM,CAAC,KAAK,YACxB,MAAM,CAAC,KAAK,IADmB,MAAM,CAAC,KAAK,CAErC,CACV,CAAC,IACK,EACR,KAAK,IAAI,CACR,gBAAM,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,OAAO,aAC5C,cAAK,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAC,WAAW,iBAAa,MAAM,EAAC,IAAI,EAAC,cAAc,YAC/F,eAAM,CAAC,EAAC,oEAAoE,GAAG,GAC3E,EACL,KAAK,IACD,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Stepper (components/stepper.md) — 3–7 named steps of a multi-step citizen application.
|
|
4
|
+
*
|
|
5
|
+
* An ordered list (not divs), `aria-current="step"` on the current item, completed steps are links
|
|
6
|
+
* back where the flow allows (data preserved), upcoming steps are not focusable. On mobile it
|
|
7
|
+
* collapses to "Step 2 of 5 / चरण २ मध्ये ५" with the current step name — never a cramped rail. The
|
|
8
|
+
* stepper never owns navigation state; steps and the current index come from the flow.
|
|
9
|
+
*/
|
|
10
|
+
export interface Step {
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/** A link back to a completed step, where revisiting is allowed. Omit for the current/upcoming. */
|
|
13
|
+
href?: string;
|
|
14
|
+
}
|
|
15
|
+
interface StepperProps {
|
|
16
|
+
steps: Step[];
|
|
17
|
+
/** Zero-based index of the current step. */
|
|
18
|
+
current: number;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function Stepper({ steps, current, className }: StepperProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../src/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;GAOG;AAEH,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,YAAY,+BA0ClE"}
|
package/dist/Stepper.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "./cx.js";
|
|
3
|
+
import { useTheme } from "./ThemeProvider.js";
|
|
4
|
+
/** Devanagari numerals for the Nepali condensed label (§3.1 numeral rules). */
|
|
5
|
+
const NE_DIGITS = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"];
|
|
6
|
+
const toNepaliNumber = (n) => String(n).split("").map((d) => NE_DIGITS[Number(d)] ?? d).join("");
|
|
7
|
+
export function Stepper({ steps, current, className }) {
|
|
8
|
+
const { language } = useTheme();
|
|
9
|
+
const currentStep = steps[current];
|
|
10
|
+
const num = (n) => (language === "ne" ? toNepaliNumber(n) : String(n));
|
|
11
|
+
return (_jsxs("div", { className: cx("gov-stepper-wrap", className), children: [_jsxs("p", { className: "gov-stepper__condensed", children: [language === "ne"
|
|
12
|
+
? `चरण ${num(current + 1)} मध्ये ${num(steps.length)}`
|
|
13
|
+
: `Step ${num(current + 1)} of ${num(steps.length)}`, currentStep ? ` — ${""}` : "", currentStep && _jsx("strong", { children: currentStep.label })] }), _jsx("ol", { className: "gov-stepper", children: steps.map((step, i) => {
|
|
14
|
+
const state = i < current ? "complete" : i === current ? "current" : "upcoming";
|
|
15
|
+
return (_jsxs("li", { className: cx("gov-stepper__step", state !== "upcoming" && `gov-stepper__step--${state}`), "aria-current": i === current ? "step" : undefined, children: [_jsx("span", { className: "gov-stepper__marker", "aria-hidden": "true", children: state === "complete" ? "✓" : num(i + 1) }), state === "complete" && step.href ? (_jsx("a", { className: "gov-stepper__link", href: step.href, children: step.label })) : (_jsx("span", { children: step.label }))] }, i));
|
|
16
|
+
}) })] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.js","sourceRoot":"","sources":["../src/Stepper.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAwB9C,+EAA+E;AAC/E,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACrE,MAAM,cAAc,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzG,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAgB;IACjE,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC;IAChC,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AAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GACnC,EAEN,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,YAAG,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,YAC7C,IAAI,CAAC,KAAK,GACT,CACL,CAAC,CAAC,CAAC,CACF,yBAAO,IAAI,CAAC,KAAK,GAAQ,CAC1B,KAbI,CAAC,CAcH,CACN,CAAC;gBACJ,CAAC,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Warning text (components/warning-text.md) — a single fact that changes the consequence of a
|
|
4
|
+
* nearby action ("This cannot be undone", "Fees are non-refundable after submission"). Inline icon
|
|
5
|
+
* + short sentence, no card or fill (that is alert). It is NOT a sufficient safeguard for a
|
|
6
|
+
* destructive action on its own — that needs a confirmation dialog (§9.1); this only warns.
|
|
7
|
+
*
|
|
8
|
+
* The sentence carries the meaning; the icon and colour reinforce it (rules/status-not-color-alone).
|
|
9
|
+
*/
|
|
10
|
+
interface WarningTextProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** Set when the warning appears dynamically in response to input — then it announces politely. */
|
|
13
|
+
live?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function WarningText({ children, live, className }: WarningTextProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=WarningText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WarningText.d.ts","sourceRoot":"","sources":["../src/WarningText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;GAOG;AAEH,UAAU,gBAAgB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,kGAAkG;IAClG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAY,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BASlF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "./cx.js";
|
|
3
|
+
export function WarningText({ children, live = false, className }) {
|
|
4
|
+
return (_jsxs("p", { className: cx("gov-warning-text", className), ...(live ? { "aria-live": "polite" } : {}), children: [_jsx("svg", { className: "gov-warning-text__icon", viewBox: "0 0 24 24", "aria-hidden": "true", fill: "currentColor", children: _jsx("path", { d: "M12 2L1 21h22L12 2zm0 6l7 12H5l7-12zm-1 3v4h2v-4h-2zm0 5v2h2v-2h-2z" }) }), _jsx("span", { children: children })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=WarningText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WarningText.js","sourceRoot":"","sources":["../src/WarningText.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAkB7B,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAoB;IACjF,OAAO,CACL,aAAG,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAC1F,cAAK,SAAS,EAAC,wBAAwB,EAAC,OAAO,EAAC,WAAW,iBAAa,MAAM,EAAC,IAAI,EAAC,cAAc,YAChG,eAAM,CAAC,EAAC,qEAAqE,GAAG,GAC5E,EACN,yBAAO,QAAQ,GAAQ,IACrB,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED from design-guidelines 0.2.0-dev (
|
|
1
|
+
// GENERATED from design-guidelines 0.2.0-dev (816565b5) — do not edit.
|
|
2
2
|
// Source: data/status-taxonomy.yaml (§7.3.2). Regenerate with build/generate.mjs.
|
|
3
3
|
export const STATUS_TAXONOMY = {
|
|
4
4
|
"draft": { label: "Draft", label_ne: "मस्यौदा", badge: "neutral", requiresAction: false },
|
package/dist/index.d.ts
CHANGED
|
@@ -14,9 +14,18 @@ export { Container, Stack, PageSection } from "./layout.js";
|
|
|
14
14
|
export { Button } from "./Button.js";
|
|
15
15
|
export { Link } from "./Link.js";
|
|
16
16
|
export { TextInput } from "./TextInput.js";
|
|
17
|
+
export { Checkbox } from "./Checkbox.js";
|
|
18
|
+
export { RadioGroup, type RadioOption } from "./RadioGroup.js";
|
|
19
|
+
export { Select, type SelectOption } from "./Select.js";
|
|
17
20
|
export { ErrorSummary, type FieldError } from "./ErrorSummary.js";
|
|
18
21
|
export { Alert } from "./Alert.js";
|
|
19
22
|
export { Badge } from "./Badge.js";
|
|
23
|
+
export { Details } from "./Details.js";
|
|
24
|
+
export { WarningText } from "./WarningText.js";
|
|
25
|
+
export { PhaseBanner } from "./PhaseBanner.js";
|
|
26
|
+
export { Stepper, type Step } from "./Stepper.js";
|
|
27
|
+
export { LanguageSwitcher } from "./LanguageSwitcher.js";
|
|
28
|
+
export { Emblem, Flag } from "./Emblem.js";
|
|
20
29
|
export { Header } from "./Header.js";
|
|
21
30
|
export { STATUS_TAXONOMY, type StatusId, type StatusEntry, type BadgeVariant } from "./generated/statusTaxonomy.js";
|
|
22
31
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,UAAU,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AAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,9 +15,18 @@ export { Container, Stack, PageSection } from "./layout.js";
|
|
|
15
15
|
export { Button } from "./Button.js";
|
|
16
16
|
export { Link } from "./Link.js";
|
|
17
17
|
export { TextInput } from "./TextInput.js";
|
|
18
|
+
export { Checkbox } from "./Checkbox.js";
|
|
19
|
+
export { RadioGroup } from "./RadioGroup.js";
|
|
20
|
+
export { Select } from "./Select.js";
|
|
18
21
|
export { ErrorSummary } from "./ErrorSummary.js";
|
|
19
22
|
export { Alert } from "./Alert.js";
|
|
20
23
|
export { Badge } from "./Badge.js";
|
|
24
|
+
export { Details } from "./Details.js";
|
|
25
|
+
export { WarningText } from "./WarningText.js";
|
|
26
|
+
export { PhaseBanner } from "./PhaseBanner.js";
|
|
27
|
+
export { Stepper } from "./Stepper.js";
|
|
28
|
+
export { LanguageSwitcher } from "./LanguageSwitcher.js";
|
|
29
|
+
export { Emblem, Flag } from "./Emblem.js";
|
|
21
30
|
export { Header } from "./Header.js";
|
|
22
31
|
export { STATUS_TAXONOMY } from "./generated/statusTaxonomy.js";
|
|
23
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gGAAgG;AAChG,kGAAkG;AAClG,0FAA0F;AAC1F,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAmB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEr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+BAA+B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@govnepal/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Civic Calm React components — the behavior layer (ARIA, keyboard, focus) over @govnepal/css.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"react-dom": ">=18"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@govnepal/css": "^0.
|
|
41
|
-
"@govnepal/tokens": "^0.
|
|
40
|
+
"@govnepal/css": "^0.2.0",
|
|
41
|
+
"@govnepal/tokens": "^0.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@testing-library/dom": "^10.4.1",
|