@haatlabs-core/ui 0.29.2 → 0.30.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.
@@ -0,0 +1,21 @@
1
+ import type { OrganizationCountry } from '@haatlabs-core/auth-contracts';
2
+ import type { ReactElement } from 'react';
3
+ import type { Transport } from './transport.js';
4
+ /** The organization's country, as the dashboard reads and sets it. */
5
+ export interface CountryClient {
6
+ country(): Promise<OrganizationCountry>;
7
+ setCountry(country: string): Promise<OrganizationCountry>;
8
+ }
9
+ /** `GET` and `PUT /api/v1/organization/country`, through the app's transport. */
10
+ export declare function countryClient(transport: Pick<Transport, 'call'>): CountryClient;
11
+ /**
12
+ * "Where is your business?" once, for an administrator of an organization whose country no
13
+ * person has said (unknown, or only the IP's): announcements can be aimed at a country. Save
14
+ * records it; Skip hides the card on this browser. Until then the IP's country stands.
15
+ */
16
+ export declare function CountryPrompt(props: {
17
+ client: CountryClient;
18
+ organizationId: string;
19
+ /** Only an owner or administrator may say (the API refuses anyone else). */
20
+ canSet: boolean;
21
+ }): ReactElement | null;
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { COUNTRY_CODES, OrganizationCountrySchema } from '@haatlabs-core/auth-contracts';
3
+ import { useEffect, useMemo, useState } from 'react';
4
+ /** `GET` and `PUT /api/v1/organization/country`, through the app's transport. */
5
+ export function countryClient(transport) {
6
+ return {
7
+ country: () => transport.call('GET', '/api/v1/organization/country', OrganizationCountrySchema),
8
+ setCountry: (country) => transport.call('PUT', '/api/v1/organization/country', OrganizationCountrySchema, { country }),
9
+ };
10
+ }
11
+ const skippedKey = (organizationId) => `hl-country-skipped:${organizationId}`;
12
+ const wasSkipped = (organizationId) => {
13
+ try {
14
+ return localStorage.getItem(skippedKey(organizationId)) === '1';
15
+ }
16
+ catch {
17
+ return false;
18
+ }
19
+ };
20
+ /** Every country by name in the viewer's language, sorted; the code where there is no name. */
21
+ function useCountryOptions() {
22
+ return useMemo(() => {
23
+ let names = null;
24
+ try {
25
+ names = new Intl.DisplayNames(undefined, { type: 'region' });
26
+ }
27
+ catch {
28
+ names = null;
29
+ }
30
+ return COUNTRY_CODES.map((code) => ({ code, name: names?.of(code) ?? code })).sort((a, b) => a.name.localeCompare(b.name));
31
+ }, []);
32
+ }
33
+ /**
34
+ * "Where is your business?" once, for an administrator of an organization whose country no
35
+ * person has said (unknown, or only the IP's): announcements can be aimed at a country. Save
36
+ * records it; Skip hides the card on this browser. Until then the IP's country stands.
37
+ */
38
+ export function CountryPrompt(props) {
39
+ const options = useCountryOptions();
40
+ const [current, setCurrent] = useState(null);
41
+ const [choice, setChoice] = useState('');
42
+ const [hidden, setHidden] = useState(() => wasSkipped(props.organizationId));
43
+ const [saving, setSaving] = useState(false);
44
+ const [error, setError] = useState(null);
45
+ const { client, canSet } = props;
46
+ useEffect(() => {
47
+ if (!canSet || hidden)
48
+ return;
49
+ let live = true;
50
+ client.country().then((answer) => {
51
+ if (!live)
52
+ return;
53
+ setCurrent(answer);
54
+ setChoice(answer.country ?? '');
55
+ }, () => undefined);
56
+ return () => {
57
+ live = false;
58
+ };
59
+ }, [client, canSet, hidden]);
60
+ if (!canSet || hidden || !current)
61
+ return null;
62
+ if (current.source === 'user' || current.source === 'billing')
63
+ return null;
64
+ const skip = () => {
65
+ try {
66
+ localStorage.setItem(skippedKey(props.organizationId), '1');
67
+ }
68
+ catch {
69
+ // A browser that keeps nothing asks again next time.
70
+ }
71
+ setHidden(true);
72
+ };
73
+ const save = async () => {
74
+ if (!choice)
75
+ return;
76
+ setSaving(true);
77
+ setError(null);
78
+ try {
79
+ setCurrent(await client.setCountry(choice));
80
+ }
81
+ catch (failure) {
82
+ setError(failure instanceof Error ? failure.message : 'Saving failed. Try again.');
83
+ }
84
+ finally {
85
+ setSaving(false);
86
+ }
87
+ };
88
+ return (_jsxs("section", { className: "hl-country-prompt", "aria-label": "Your business's country", children: [_jsxs("div", { className: "hl-country-prompt__text", children: [_jsx("strong", { children: "Where is your business?" }), _jsx("span", { children: "So news and notices meant for your country reach you." })] }), _jsx("label", { className: "hl-country-prompt__field", children: _jsxs("select", { "aria-label": "Country", value: choice, onChange: (event) => setChoice(event.target.value), children: [_jsx("option", { value: "", children: "Choose a country" }), options.map((option) => (_jsx("option", { value: option.code, children: option.name }, option.code)))] }) }), _jsx("button", { type: "button", disabled: !choice || saving, onClick: () => void save(), children: saving ? 'Saving…' : 'Save' }), _jsx("button", { type: "button", className: "hl-country-prompt__skip", onClick: skip, children: "Skip" }), error && _jsx("p", { role: "alert", children: error })] }));
89
+ }
90
+ //# sourceMappingURL=country-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-prompt.js","sourceRoot":"","sources":["../../src/client/country-prompt.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUrD,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,SAAkC;IAC9D,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,8BAA8B,EAAE,yBAAyB,CAAC;QAC/F,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CACtB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,EAAE,OAAO,EAAE,CAAC;KAChG,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,cAAsB,EAAU,EAAE,CAAC,sBAAsB,cAAc,EAAE,CAAC;AAC9F,MAAM,UAAU,GAAG,CAAC,cAAsB,EAAW,EAAE;IACrD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,KAAK,GAAG,CAAC;IAClE,CAAC;IAAC,MAA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
25
25
  export type { NotificationStreamState } from '../notifications/use-notification-stream.js';
26
26
  export { isAppPath } from '../notifications/types.js';
27
27
  export type { NotificationChannel, NotificationChannelState, NotificationItemData, NotificationPreferenceChange, NotificationPreferenceData, NotificationStreamEvent, NotificationsClient, PreferencesData, } from '../notifications/types.js';
28
+ export { CountryPrompt, countryClient } from './country-prompt.js';
29
+ export type { CountryClient } from './country-prompt.js';
@@ -21,4 +21,5 @@ export { NotificationPreferences } from '../notifications/NotificationPreference
21
21
  export { NOTIFICATIONS_CSS } from '../notifications/notifications-css.js';
22
22
  export { useNotificationStream } from '../notifications/use-notification-stream.js';
23
23
  export { isAppPath } from '../notifications/types.js';
24
+ export { CountryPrompt, countryClient } from './country-prompt.js';
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,8FAA8F;AAC9F,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACjE,iFAAiF;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BA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AAO,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEpG,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAS3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAWtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,2 +1,2 @@
1
1
  /** The alert bar and the maintenance screen. CRITICAL red, WARN amber, INFO the app's accent. */
2
- export declare const STATUS_CSS = "\n.hl-alerts { display: flex; flex-direction: column; }\n.hl-alert { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 44px 8px 16px; font-size: 14px; }\n.hl-alert__text { margin: 0; flex: 1; min-width: 0; }\n.hl-alert__text a { color: inherit; font-weight: 700; text-decoration: underline; }\n.hl-alert__close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.75; }\n.hl-alert__close:hover, .hl-alert__close:focus-visible { opacity: 1; }\n.hl-alert[data-severity=\"CRITICAL\"] { background: var(--hl-danger); color: #FFFFFF; }\n.hl-alert[data-severity=\"WARN\"] { background: var(--hl-amber-bg); color: var(--hl-amber-text); border-bottom: 1px solid var(--hl-amber-border); }\n.hl-alert[data-severity=\"INFO\"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); }\n.hl-maintenance { max-width: 560px; margin: 0 auto; padding: 15vh 16px 40px; text-align: center; color: var(--hl-text); }\n.hl-maintenance h1 { margin: 0 0 12px; font-size: 24px; }\n.hl-maintenance__muted { color: var(--hl-muted); font-size: 14px; }\n.hl-form { display: flex; flex-direction: column; gap: 14px; }\n.hl-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }\n.hl-form label:has(> input[type=\"checkbox\"]) { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }\n.hl-form fieldset { border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; }\n.hl-form input:not([type=\"checkbox\"]), .hl-form textarea, .hl-form select { font: inherit; padding: 8px 10px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-control); background: var(--hl-surface); color: var(--hl-text); }\n.hl-form textarea { min-height: 96px; resize: vertical; }\n.hl-admin-announcements__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }\n.hl-admin-announcements__head h1 { margin: 0; flex: 1; }\n.hl-admin-announcements__list, .hl-admin-maintenance__list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }\n.hl-admin-announcements__list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); }\n.hl-admin-announcements__meta { color: var(--hl-muted); font-size: 13px; margin-top: 4px; }\n";
2
+ export declare const STATUS_CSS = "\n.hl-alerts { display: flex; flex-direction: column; }\n.hl-alert { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 44px 8px 16px; font-size: 14px; }\n.hl-alert__text { margin: 0; flex: 1; min-width: 0; }\n.hl-alert__text a { color: inherit; font-weight: 700; text-decoration: underline; }\n.hl-alert__close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.75; }\n.hl-alert__close:hover, .hl-alert__close:focus-visible { opacity: 1; }\n.hl-alert[data-severity=\"CRITICAL\"] { background: var(--hl-danger); color: #FFFFFF; }\n.hl-alert[data-severity=\"WARN\"] { background: var(--hl-amber-bg); color: var(--hl-amber-text); border-bottom: 1px solid var(--hl-amber-border); }\n.hl-alert[data-severity=\"INFO\"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); }\n.hl-maintenance { max-width: 560px; margin: 0 auto; padding: 15vh 16px 40px; text-align: center; color: var(--hl-text); }\n.hl-maintenance h1 { margin: 0 0 12px; font-size: 24px; }\n.hl-maintenance__muted { color: var(--hl-muted); font-size: 14px; }\n.hl-form { display: flex; flex-direction: column; gap: 14px; }\n.hl-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }\n.hl-form label:has(> input[type=\"checkbox\"]) { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }\n.hl-form fieldset { border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; }\n.hl-form input:not([type=\"checkbox\"]), .hl-form textarea, .hl-form select { font: inherit; padding: 8px 10px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-control); background: var(--hl-surface); color: var(--hl-text); }\n.hl-form textarea { min-height: 96px; resize: vertical; }\n.hl-admin-announcements__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }\n.hl-admin-announcements__head h1 { margin: 0; flex: 1; }\n.hl-admin-announcements__list, .hl-admin-maintenance__list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }\n.hl-admin-announcements__list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); }\n.hl-admin-announcements__meta { color: var(--hl-muted); font-size: 13px; margin-top: 4px; }\n.hl-country-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); color: var(--hl-text); }\n.hl-country-prompt__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; }\n.hl-country-prompt__text span { color: var(--hl-muted); font-size: 13px; }\n.hl-country-prompt select { height: 36px; min-width: 200px; padding: 0 10px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); color: var(--hl-text); font: inherit; }\n.hl-country-prompt button { height: 36px; padding: 0 14px; border-radius: var(--hl-radius-control); border: 0; background: var(--hl-accent); color: var(--hl-on-accent); font: inherit; font-weight: 600; cursor: pointer; }\n.hl-country-prompt button:disabled { opacity: 0.6; cursor: default; }\n.hl-country-prompt .hl-country-prompt__skip { background: transparent; color: var(--hl-muted); }\n.hl-country-prompt [role=\"alert\"] { flex-basis: 100%; margin: 0; color: var(--hl-danger); font-size: 13px; }\n";
@@ -23,5 +23,13 @@ export const STATUS_CSS = `
23
23
  .hl-admin-announcements__list, .hl-admin-maintenance__list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
24
24
  .hl-admin-announcements__list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); }
25
25
  .hl-admin-announcements__meta { color: var(--hl-muted); font-size: 13px; margin-top: 4px; }
26
+ .hl-country-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); color: var(--hl-text); }
27
+ .hl-country-prompt__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; }
28
+ .hl-country-prompt__text span { color: var(--hl-muted); font-size: 13px; }
29
+ .hl-country-prompt select { height: 36px; min-width: 200px; padding: 0 10px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); color: var(--hl-text); font: inherit; }
30
+ .hl-country-prompt button { height: 36px; padding: 0 14px; border-radius: var(--hl-radius-control); border: 0; background: var(--hl-accent); color: var(--hl-on-accent); font: inherit; font-weight: 600; cursor: pointer; }
31
+ .hl-country-prompt button:disabled { opacity: 0.6; cursor: default; }
32
+ .hl-country-prompt .hl-country-prompt__skip { background: transparent; color: var(--hl-muted); }
33
+ .hl-country-prompt [role="alert"] { flex-basis: 100%; margin: 0; color: var(--hl-danger); font-size: 13px; }
26
34
  `;
27
35
  //# sourceMappingURL=status-css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-css.js","sourceRoot":"","sources":["../../src/status/status-css.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBzB,CAAC"}
1
+ {"version":3,"file":"status-css.js","sourceRoot":"","sources":["../../src/status/status-css.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haatlabs-core/ui",
3
- "version": "0.29.2",
3
+ "version": "0.30.0",
4
4
  "description": "React components for an app's dashboard, styled by the app.",
5
5
  "keywords": [
6
6
  "haatlabs",
@@ -67,12 +67,12 @@
67
67
  "react-router-dom": "^7.18.4",
68
68
  "@tanstack/react-query": "^5.104.1",
69
69
  "zod": "^4.6.5",
70
- "@haatlabs-core/vitest-config": "0.29.2",
71
- "@haatlabs-core/tsconfig": "0.29.2"
70
+ "@haatlabs-core/tsconfig": "0.30.0",
71
+ "@haatlabs-core/vitest-config": "0.30.0"
72
72
  },
73
73
  "dependencies": {
74
- "@haatlabs-core/auth-contracts": "0.29.2",
75
- "@haatlabs-core/announcements-contracts": "0.29.2"
74
+ "@haatlabs-core/announcements-contracts": "0.30.0",
75
+ "@haatlabs-core/auth-contracts": "0.30.0"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "rm -rf dist && tsc -p tsconfig.build.json",