@haatlabs-core/ui 0.30.0 → 0.30.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.
@@ -9,9 +9,10 @@ export interface CountryClient {
9
9
  /** `GET` and `PUT /api/v1/organization/country`, through the app's transport. */
10
10
  export declare function countryClient(transport: Pick<Transport, 'call'>): CountryClient;
11
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.
12
+ * "Where is your business?" once, in a popup, for an administrator of an organization whose
13
+ * country no person has said (unknown, or only the IP's): announcements can be aimed at a
14
+ * country. Save records it; Skip (or Escape) puts it off on this browser. Until then the IP's
15
+ * country stands.
15
16
  */
16
17
  export declare function CountryPrompt(props: {
17
18
  client: CountryClient;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { COUNTRY_CODES, OrganizationCountrySchema } from '@haatlabs-core/auth-contracts';
3
- import { useEffect, useMemo, useState } from 'react';
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
4
  /** `GET` and `PUT /api/v1/organization/country`, through the app's transport. */
5
5
  export function countryClient(transport) {
6
6
  return {
@@ -31,9 +31,10 @@ function useCountryOptions() {
31
31
  }, []);
32
32
  }
33
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.
34
+ * "Where is your business?" once, in a popup, for an administrator of an organization whose
35
+ * country no person has said (unknown, or only the IP's): announcements can be aimed at a
36
+ * country. Save records it; Skip (or Escape) puts it off on this browser. Until then the IP's
37
+ * country stands.
37
38
  */
38
39
  export function CountryPrompt(props) {
39
40
  const options = useCountryOptions();
@@ -57,19 +58,36 @@ export function CountryPrompt(props) {
57
58
  live = false;
58
59
  };
59
60
  }, [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 = () => {
61
+ const open = canSet &&
62
+ !hidden &&
63
+ current !== null &&
64
+ current.source !== 'user' &&
65
+ current.source !== 'billing';
66
+ const { organizationId } = props;
67
+ const skip = useCallback(() => {
65
68
  try {
66
- localStorage.setItem(skippedKey(props.organizationId), '1');
69
+ localStorage.setItem(skippedKey(organizationId), '1');
67
70
  }
68
71
  catch {
69
72
  // A browser that keeps nothing asks again next time.
70
73
  }
71
74
  setHidden(true);
72
- };
75
+ }, [organizationId]);
76
+ // A popup: the picker has the focus as it opens, and Escape puts it off like Skip.
77
+ const picker = useRef(null);
78
+ useEffect(() => {
79
+ if (!open)
80
+ return;
81
+ picker.current?.focus();
82
+ const onKey = (event) => {
83
+ if (event.key === 'Escape')
84
+ skip();
85
+ };
86
+ document.addEventListener('keydown', onKey);
87
+ return () => document.removeEventListener('keydown', onKey);
88
+ }, [open, skip]);
89
+ if (!open)
90
+ return null;
73
91
  const save = async () => {
74
92
  if (!choice)
75
93
  return;
@@ -85,6 +103,6 @@ export function CountryPrompt(props) {
85
103
  setSaving(false);
86
104
  }
87
105
  };
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 })] }));
106
+ return (_jsx("div", { className: "hl-country-prompt__backdrop", children: _jsxs("section", { className: "hl-country-prompt", role: "dialog", "aria-modal": "true", "aria-labelledby": "hl-country-prompt-title", children: [_jsx("h2", { id: "hl-country-prompt-title", children: "Where is your business?" }), _jsx("p", { children: "So news and notices meant for your country reach you." }), _jsxs("select", { ref: picker, "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)))] }), error && _jsx("p", { role: "alert", children: error }), _jsxs("div", { className: "hl-country-prompt__actions", children: [_jsx("button", { type: "button", className: "hl-country-prompt__skip", onClick: skip, children: "Skip" }), _jsx("button", { type: "button", disabled: !choice || saving, onClick: () => void save(), children: saving ? 'Saving…' : 'Save' })] })] }) }));
89
107
  }
90
108
  //# sourceMappingURL=country-prompt.js.map
@@ -1 +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,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Q,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,IAAI,qBAE9D,EACT,iBAAQ,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE,YAC1E,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GACrB,IACL,IACE,GACN,CACP,CAAC;AACJ,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.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";
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__backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 10, 20, 0.55); }\n.hl-country-prompt { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); color: var(--hl-text); box-shadow: 0 24px 64px rgba(8, 10, 20, 0.35); }\n.hl-country-prompt h2 { margin: 0; font-size: 20px; font-weight: 700; }\n.hl-country-prompt p { margin: 0; color: var(--hl-muted); font-size: 14px; }\n.hl-country-prompt select { height: 44px; width: 100%; padding: 0 12px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-ground); color: var(--hl-text); font: inherit; font-size: 15px; }\n.hl-country-prompt select:focus { outline: none; border-color: var(--hl-accent); box-shadow: 0 0 0 3px var(--hl-accent-soft); }\n.hl-country-prompt__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }\n.hl-country-prompt button { height: 40px; padding: 0 18px; 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\"] { color: var(--hl-danger); font-size: 13px; }\n";
@@ -23,13 +23,16 @@ 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; }
26
+ .hl-country-prompt__backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 10, 20, 0.55); }
27
+ .hl-country-prompt { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); background: var(--hl-surface); color: var(--hl-text); box-shadow: 0 24px 64px rgba(8, 10, 20, 0.35); }
28
+ .hl-country-prompt h2 { margin: 0; font-size: 20px; font-weight: 700; }
29
+ .hl-country-prompt p { margin: 0; color: var(--hl-muted); font-size: 14px; }
30
+ .hl-country-prompt select { height: 44px; width: 100%; padding: 0 12px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-ground); color: var(--hl-text); font: inherit; font-size: 15px; }
31
+ .hl-country-prompt select:focus { outline: none; border-color: var(--hl-accent); box-shadow: 0 0 0 3px var(--hl-accent-soft); }
32
+ .hl-country-prompt__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
33
+ .hl-country-prompt button { height: 40px; padding: 0 18px; 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
34
  .hl-country-prompt button:disabled { opacity: 0.6; cursor: default; }
32
35
  .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; }
36
+ .hl-country-prompt [role="alert"] { color: var(--hl-danger); font-size: 13px; }
34
37
  `;
35
38
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCzB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haatlabs-core/ui",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
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/tsconfig": "0.30.0",
71
- "@haatlabs-core/vitest-config": "0.30.0"
70
+ "@haatlabs-core/vitest-config": "0.30.1",
71
+ "@haatlabs-core/tsconfig": "0.30.1"
72
72
  },
73
73
  "dependencies": {
74
- "@haatlabs-core/announcements-contracts": "0.30.0",
75
- "@haatlabs-core/auth-contracts": "0.30.0"
74
+ "@haatlabs-core/announcements-contracts": "0.30.1",
75
+ "@haatlabs-core/auth-contracts": "0.30.1"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "rm -rf dist && tsc -p tsconfig.build.json",