hazo_auth 10.7.0 → 10.7.1
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/components/layouts/create_firm/index.d.ts +13 -1
- package/dist/components/layouts/create_firm/index.d.ts.map +1 -1
- package/dist/components/layouts/create_firm/index.js +2 -2
- package/dist/page_components/create_firm.d.ts.map +1 -1
- package/dist/page_components/create_firm.js +23 -10
- package/package.json +1 -1
|
@@ -4,10 +4,22 @@ import { type ButtonPaletteOverrides } from "../shared/config/layout_customizati
|
|
|
4
4
|
export type CreateFirmLayoutProps = {
|
|
5
5
|
/** Image source for the left panel */
|
|
6
6
|
image_src: string | StaticImageData;
|
|
7
|
+
/**
|
|
8
|
+
* Capitalised singular noun for the organisation entity (e.g. "Firm",
|
|
9
|
+
* "Business", "Company"). Drives the default heading, field labels, button
|
|
10
|
+
* and banner text so a consumer can re-label the whole page from one value.
|
|
11
|
+
*/
|
|
12
|
+
keyword?: string;
|
|
13
|
+
/** Lowercase form of {@link keyword} used mid-sentence (e.g. "firm"). */
|
|
14
|
+
keyword_lower?: string;
|
|
15
|
+
/** Capitalised verb for the primary action (e.g. "Create", "Setup"). */
|
|
16
|
+
verb?: string;
|
|
7
17
|
/** Alt text for the image */
|
|
8
18
|
image_alt?: string;
|
|
9
19
|
/** Background color for the image panel */
|
|
10
20
|
image_background_color?: string;
|
|
21
|
+
/** Banner body text shown in the info callout */
|
|
22
|
+
banner_body?: string;
|
|
11
23
|
/** Page heading */
|
|
12
24
|
heading?: string;
|
|
13
25
|
/** Page sub-heading */
|
|
@@ -40,6 +52,6 @@ export type CreateFirmLayoutProps = {
|
|
|
40
52
|
error: (message: string, data?: Record<string, unknown>) => void;
|
|
41
53
|
};
|
|
42
54
|
};
|
|
43
|
-
export default function CreateFirmLayout({ image_src, image_alt, image_background_color, heading, sub_heading, firm_name_label, firm_name_placeholder, org_structure_label, org_structure_placeholder, default_org_structure, submit_button_label, success_message, redirect_route, apiBasePath, onSuccess, button_colors, logger, }: CreateFirmLayoutProps): React.JSX.Element;
|
|
55
|
+
export default function CreateFirmLayout({ image_src, keyword, keyword_lower, verb, image_alt, image_background_color, banner_body, heading, sub_heading, firm_name_label, firm_name_placeholder, org_structure_label, org_structure_placeholder, default_org_structure, submit_button_label, success_message, redirect_route, apiBasePath, onSuccess, button_colors, logger, }: CreateFirmLayoutProps): React.JSX.Element;
|
|
44
56
|
export { CreateFirmLayout };
|
|
45
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/create_firm/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EACL,KAAK,sBAAsB,EAC5B,MAAM,uCAAuC,CAAC;AAQ/C,MAAM,MAAM,qBAAqB,GAAG;IAClC,sCAAsC;IACtC,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oCAAoC;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0CAA0C;IAC1C,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,sCAAsC;IACtC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gDAAgD;IAChD,eAAe,C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A0D,EAC1D,mBAA8C,EAC9C,yBAA6D,EAC7D,qBAAsC,EACtC,mBAA0C,EAC1C,eAAwE,EACxE,cAAoB,EACpB,WAAW,EACX,SAAS,EACT,aAAa,EACb,MAAM,GACP,EAAE,qBAAqB,qBAuJvB;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { CheckCircle, Building2 } from "lucide-react";
|
|
|
11
11
|
import { use_create_firm_form, } from "./hooks/use_create_firm_form.js";
|
|
12
12
|
import { useHazoAuthConfig } from "../../../contexts/hazo_auth_provider.js";
|
|
13
13
|
// section: component
|
|
14
|
-
export default function CreateFirmLayout({ image_src,
|
|
14
|
+
export default function CreateFirmLayout({ image_src, keyword = "Firm", keyword_lower = "firm", verb = "Create", image_alt = `${verb} your ${keyword_lower}`, image_background_color = "#f1f5f9", banner_body = `${verb} your ${keyword_lower} to start using the application. You'll become the administrator of your ${keyword_lower} and can invite team members later.`, heading = `${verb} Your ${keyword}`, sub_heading = "Set up your organisation to get started", firm_name_label = `${keyword} Name`, firm_name_placeholder = `Enter your ${keyword_lower} name`, org_structure_label = "Organisation Structure", org_structure_placeholder = "e.g., Headquarters, Head Office", default_org_structure = "Headquarters", submit_button_label = `${verb} ${keyword}`, success_message = `Your ${keyword_lower} has been created successfully!`, redirect_route = "/", apiBasePath, onSuccess, button_colors, logger, }) {
|
|
15
15
|
const { apiBasePath: contextApiBasePath } = useHazoAuthConfig();
|
|
16
16
|
const resolvedApiBasePath = apiBasePath || contextApiBasePath;
|
|
17
17
|
const form = use_create_firm_form({
|
|
@@ -39,7 +39,7 @@ export default function CreateFirmLayout({ image_src, image_alt = "Create your f
|
|
|
39
39
|
if (form.isSuccess) {
|
|
40
40
|
return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: heading, subHeading: sub_heading }), _jsxs("div", { className: "cls_create_firm_layout_success flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(CheckCircle, { className: "cls_create_firm_layout_success_icon h-16 w-16 text-green-600", "aria-hidden": "true" }), _jsx("p", { className: "cls_create_firm_layout_success_message text-lg font-medium text-slate-900", children: success_message }), _jsx("p", { className: "cls_create_firm_layout_redirect_message text-sm text-muted-foreground", children: "Redirecting you to the application..." })] })] }) }));
|
|
41
41
|
}
|
|
42
|
-
return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: heading, subHeading: sub_heading }), _jsxs("div", { className: "cls_create_firm_layout_info mb-6 flex items-start gap-3 rounded-lg border border-blue-200 bg-blue-50 p-4", children: [_jsx(Building2, { className: "mt-0.5 h-5 w-5 flex-shrink-0 text-blue-600" }), _jsxs("div", { className: "text-sm text-blue-800", children: [_jsx("p", { className: "font-medium", children: "Welcome!" }), _jsx("p", { children:
|
|
42
|
+
return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: heading, subHeading: sub_heading }), _jsxs("div", { className: "cls_create_firm_layout_info mb-6 flex items-start gap-3 rounded-lg border border-blue-200 bg-blue-50 p-4", children: [_jsx(Building2, { className: "mt-0.5 h-5 w-5 flex-shrink-0 text-blue-600" }), _jsxs("div", { className: "text-sm text-blue-800", children: [_jsx("p", { className: "font-medium", children: "Welcome!" }), _jsx("p", { children: banner_body })] })] }), _jsxs("form", { className: "cls_create_firm_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": `${verb} ${keyword_lower} form`, children: [renderFields(form), form.errors.form && (_jsx("div", { className: "cls_create_firm_layout_form_error rounded-md bg-red-50 p-3 text-sm text-red-600", children: form.errors.form })), form.hasAutofillPreview && !form.values.firm_name && (_jsxs("div", { className: "cls_create_firm_layout_autofill_hint rounded-md bg-amber-50 p-3 text-sm text-amber-700", children: ["Click in the ", keyword_lower, " name field to confirm the autofilled value"] })), _jsx(FormActionButtons, { submitLabel: submit_button_label, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, submitAriaLabel: image_alt, hideCancel: true })] })] }) }));
|
|
43
43
|
}
|
|
44
44
|
// section: exports
|
|
45
45
|
export { CreateFirmLayout };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_firm.d.ts","sourceRoot":"","sources":["../../src/page_components/create_firm.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"create_firm.d.ts","sourceRoot":"","sources":["../../src/page_components/create_firm.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAQrB,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAyCF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,aAAa,EAAE,GAAE,mBAAwB,+BAyBjF;AAGD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -7,23 +7,36 @@ import CreateFirmLayout from "../components/layouts/create_firm/index.js";
|
|
|
7
7
|
import { AuthPageShell } from "../components/layouts/shared/components/auth_page_shell.js";
|
|
8
8
|
import { get_config_value } from "../lib/config/config_loader.server.js";
|
|
9
9
|
// section: config_loader
|
|
10
|
+
const CREATE_FIRM_SECTION = "hazo_auth__create_firm";
|
|
11
|
+
// Reads an optional label override: returns the configured string, or undefined
|
|
12
|
+
// when the key is absent/empty so the layout can derive it from `keyword`/`verb`.
|
|
13
|
+
function get_optional_config_value(key) {
|
|
14
|
+
return get_config_value(CREATE_FIRM_SECTION, key, "") || undefined;
|
|
15
|
+
}
|
|
10
16
|
function get_create_firm_config() {
|
|
11
17
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
// Configurable entity keyword + action verb. These drive every default
|
|
19
|
+
// label in the layout, so a consumer can re-brand the whole page (e.g.
|
|
20
|
+
// "Business"/"Setup") from three config values.
|
|
21
|
+
keyword: get_config_value(CREATE_FIRM_SECTION, "keyword", "Firm"),
|
|
22
|
+
keyword_lower: get_config_value(CREATE_FIRM_SECTION, "keyword_lower", "firm"),
|
|
23
|
+
verb: get_config_value(CREATE_FIRM_SECTION, "verb", "Create"),
|
|
24
|
+
image_src: get_config_value(CREATE_FIRM_SECTION, "image_src", "/hazo_auth/images/new_firm_default.jpg"),
|
|
25
|
+
// Explicit per-label overrides (undefined → keyword-derived default).
|
|
26
|
+
heading: get_optional_config_value("heading"),
|
|
27
|
+
sub_heading: get_optional_config_value("sub_heading"),
|
|
28
|
+
firm_name_label: get_optional_config_value("firm_name_label"),
|
|
29
|
+
org_structure_label: get_optional_config_value("org_structure_label"),
|
|
30
|
+
org_structure_default: get_config_value(CREATE_FIRM_SECTION, "org_structure_default", "Headquarters"),
|
|
31
|
+
submit_button_label: get_optional_config_value("submit_button_label"),
|
|
32
|
+
success_message: get_optional_config_value("success_message"),
|
|
33
|
+
redirect_route: get_config_value(CREATE_FIRM_SECTION, "redirect_route", "/"),
|
|
21
34
|
};
|
|
22
35
|
}
|
|
23
36
|
// section: component
|
|
24
37
|
export default function CreateFirmPage({ disableNavbar } = {}) {
|
|
25
38
|
const config = get_create_firm_config();
|
|
26
|
-
const layoutContent = (_jsx(CreateFirmLayout, { image_src: config.image_src, heading: config.heading, sub_heading: config.sub_heading, firm_name_label: config.firm_name_label, org_structure_label: config.org_structure_label, default_org_structure: config.org_structure_default, submit_button_label: config.submit_button_label, success_message: config.success_message, redirect_route: config.redirect_route }));
|
|
39
|
+
const layoutContent = (_jsx(CreateFirmLayout, { image_src: config.image_src, keyword: config.keyword, keyword_lower: config.keyword_lower, verb: config.verb, heading: config.heading, sub_heading: config.sub_heading, firm_name_label: config.firm_name_label, org_structure_label: config.org_structure_label, default_org_structure: config.org_structure_default, submit_button_label: config.submit_button_label, success_message: config.success_message, redirect_route: config.redirect_route }));
|
|
27
40
|
if (disableNavbar) {
|
|
28
41
|
return layoutContent;
|
|
29
42
|
}
|
package/package.json
CHANGED