@team6083/ui 0.0.0-stage → 0.1.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.
Files changed (91) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +211 -2
  3. package/dist/blocks/api-error-message.d.ts +11 -0
  4. package/dist/blocks/api-error-message.d.ts.map +1 -0
  5. package/dist/blocks/api-error-message.js +29 -0
  6. package/dist/blocks/api-error-message.js.map +1 -0
  7. package/dist/blocks/app-commit.d.ts +35 -0
  8. package/dist/blocks/app-commit.d.ts.map +1 -0
  9. package/dist/blocks/app-commit.js +66 -0
  10. package/dist/blocks/app-commit.js.map +1 -0
  11. package/dist/blocks/app-shell.d.ts +99 -0
  12. package/dist/blocks/app-shell.d.ts.map +1 -0
  13. package/dist/blocks/app-shell.js +56 -0
  14. package/dist/blocks/app-shell.js.map +1 -0
  15. package/dist/blocks/config-error-page.d.ts +8 -0
  16. package/dist/blocks/config-error-page.d.ts.map +1 -0
  17. package/dist/blocks/config-error-page.js +21 -0
  18. package/dist/blocks/config-error-page.js.map +1 -0
  19. package/dist/blocks/data-parts.d.ts +57 -0
  20. package/dist/blocks/data-parts.d.ts.map +1 -0
  21. package/dist/blocks/data-parts.js +30 -0
  22. package/dist/blocks/data-parts.js.map +1 -0
  23. package/dist/blocks/data-table.d.ts +56 -0
  24. package/dist/blocks/data-table.d.ts.map +1 -0
  25. package/dist/blocks/data-table.js +93 -0
  26. package/dist/blocks/data-table.js.map +1 -0
  27. package/dist/blocks/member-avatar.d.ts +12 -0
  28. package/dist/blocks/member-avatar.d.ts.map +1 -0
  29. package/dist/blocks/member-avatar.js +14 -0
  30. package/dist/blocks/member-avatar.js.map +1 -0
  31. package/dist/blocks/no-access-page.d.ts +9 -0
  32. package/dist/blocks/no-access-page.d.ts.map +1 -0
  33. package/dist/blocks/no-access-page.js +15 -0
  34. package/dist/blocks/no-access-page.js.map +1 -0
  35. package/dist/blocks/page-parts.d.ts +41 -0
  36. package/dist/blocks/page-parts.d.ts.map +1 -0
  37. package/dist/blocks/page-parts.js +24 -0
  38. package/dist/blocks/page-parts.js.map +1 -0
  39. package/dist/blocks/runtime-config.d.ts +20 -0
  40. package/dist/blocks/runtime-config.d.ts.map +1 -0
  41. package/dist/blocks/runtime-config.js +39 -0
  42. package/dist/blocks/runtime-config.js.map +1 -0
  43. package/dist/blocks/status-page.d.ts +12 -0
  44. package/dist/blocks/status-page.d.ts.map +1 -0
  45. package/dist/blocks/status-page.js +8 -0
  46. package/dist/blocks/status-page.js.map +1 -0
  47. package/dist/chakra/color-mode.d.ts +26 -0
  48. package/dist/chakra/color-mode.d.ts.map +1 -0
  49. package/dist/chakra/color-mode.js +55 -0
  50. package/dist/chakra/color-mode.js.map +1 -0
  51. package/dist/chakra/toaster.d.ts +3 -0
  52. package/dist/chakra/toaster.d.ts.map +1 -0
  53. package/dist/chakra/toaster.js +11 -0
  54. package/dist/chakra/toaster.js.map +1 -0
  55. package/dist/chakra/toggle-tip.d.ts +15 -0
  56. package/dist/chakra/toggle-tip.d.ts.map +1 -0
  57. package/dist/chakra/toggle-tip.js +14 -0
  58. package/dist/chakra/toggle-tip.js.map +1 -0
  59. package/dist/chakra/tooltip.d.ts +12 -0
  60. package/dist/chakra/tooltip.d.ts.map +1 -0
  61. package/dist/chakra/tooltip.js +11 -0
  62. package/dist/chakra/tooltip.js.map +1 -0
  63. package/dist/i18n.d.ts +50 -0
  64. package/dist/i18n.d.ts.map +1 -0
  65. package/dist/i18n.js +107 -0
  66. package/dist/i18n.js.map +1 -0
  67. package/dist/index.d.ts +22 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +28 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/lib/api-error.d.ts +25 -0
  72. package/dist/lib/api-error.d.ts.map +1 -0
  73. package/dist/lib/api-error.js +77 -0
  74. package/dist/lib/api-error.js.map +1 -0
  75. package/dist/lib/commit.d.ts +11 -0
  76. package/dist/lib/commit.d.ts.map +1 -0
  77. package/dist/lib/commit.js +27 -0
  78. package/dist/lib/commit.js.map +1 -0
  79. package/dist/lib/runtime-config.d.ts +33 -0
  80. package/dist/lib/runtime-config.d.ts.map +1 -0
  81. package/dist/lib/runtime-config.js +78 -0
  82. package/dist/lib/runtime-config.js.map +1 -0
  83. package/dist/provider.d.ts +11 -0
  84. package/dist/provider.d.ts.map +1 -0
  85. package/dist/provider.js +11 -0
  86. package/dist/provider.js.map +1 -0
  87. package/dist/theme.d.ts +2 -0
  88. package/dist/theme.d.ts.map +1 -0
  89. package/dist/theme.js +38 -0
  90. package/dist/theme.js.map +1 -0
  91. package/package.json +74 -4
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ // Theme and provider
2
+ export { system } from "./theme.js";
3
+ export { UiProvider } from "./provider.js";
4
+ export { resolveUiLocale, uiMessages, useUiLocale, useUiMessages } from "./i18n.js";
5
+ // Chakra snippets every app used to copy
6
+ export * from "./chakra/color-mode.js";
7
+ export { Toaster, toaster } from "./chakra/toaster.js";
8
+ export { Tooltip } from "./chakra/tooltip.js";
9
+ export { InfoTip, ToggleTip } from "./chakra/toggle-tip.js";
10
+ // Standard blocks
11
+ export { StatusPage } from "./blocks/status-page.js";
12
+ export { NoAccessPage } from "./blocks/no-access-page.js";
13
+ export { ConfigErrorPage } from "./blocks/config-error-page.js";
14
+ export { createRuntimeConfig } from "./blocks/runtime-config.js";
15
+ export { AppCommitProvider, AppOutdatedBanner, useAppOutdated, useCommitCheckedFetch, } from "./blocks/app-commit.js";
16
+ export { apiErrorMessage, useApiErrorMessage } from "./blocks/api-error-message.js";
17
+ // Framework-free helpers
18
+ export { ApiError, isApiError, isMissingRole, readApiError, STANDARD_ERROR_CODES, } from "./lib/api-error.js";
19
+ export { COMMIT_HEADER, commitsDiffer, isWriteMethod } from "./lib/commit.js";
20
+ export { baseConfigIssues, ConfigError, loadRuntimeConfig, parseBaseConfig, } from "./lib/runtime-config.js";
21
+ // Layout, from OverHours
22
+ export { AccountMenu, AppShell, BuildInfo, LanguageMenu, SignInButton, SignOutMenuItem, } from "./blocks/app-shell.js";
23
+ export { avatarPaletteFor, MemberAvatar } from "./blocks/member-avatar.js";
24
+ export { EmptyState, PageColumn, PageHeader, SectionHeader, } from "./blocks/page-parts.js";
25
+ // Data pages: tables people pick from and act on
26
+ export { DataTable } from "./blocks/data-table.js";
27
+ export { FactList, FilterBar, SelectionBar, Totals, } from "./blocks/data-parts.js";
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAkC,MAAM,WAAW,CAAA;AAEnH,yCAAyC;AACzC,cAAc,wBAAwB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAqB,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,SAAS,EAA0C,MAAM,wBAAwB,CAAA;AAEnG,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAwB,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EAAE,YAAY,EAA0B,MAAM,4BAA4B,CAAA;AACjF,OAAO,EAAE,eAAe,EAA6B,MAAM,+BAA+B,CAAA;AAC1F,OAAO,EAAE,mBAAmB,EAAmC,MAAM,4BAA4B,CAAA;AACjG,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,GAGtB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEnF,yBAAyB;AACzB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aAAa,EACb,YAAY,EACZ,oBAAoB,GAGrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,eAAe,GAGhB,MAAM,yBAAyB,CAAA;AAEhC,yBAAyB;AACzB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,eAAe,GAOhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAA0B,MAAM,2BAA2B,CAAA;AAClG,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,aAAa,GAId,MAAM,wBAAwB,CAAA;AAE/B,iDAAiD;AACjD,OAAO,EAAE,SAAS,EAAiF,MAAM,wBAAwB,CAAA;AACjI,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,MAAM,GAOP,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,25 @@
1
+ export declare const STANDARD_ERROR_CODES: readonly ["invalid_request", "unauthenticated", "forbidden", "missing_role", "not_found", "version_conflict", "invalid_transition", "payload_too_large", "rate_limited", "internal_error", "config_error", "upstream_unavailable", "upstream_timeout"];
2
+ export type StandardErrorCode = (typeof STANDARD_ERROR_CODES)[number];
3
+ /** Client-side codes for failures that never reached a standard error body. */
4
+ export type ClientErrorCode = "network_error" | "app_outdated";
5
+ export declare class ApiError extends Error {
6
+ /** HTTP status; 0 when the request never got a response. */
7
+ readonly status: number;
8
+ /** A standard code, an app's own business code, or a client code. */
9
+ readonly code: StandardErrorCode | ClientErrorCode | (string & {});
10
+ readonly details: Record<string, unknown>;
11
+ readonly name = "ApiError";
12
+ constructor(
13
+ /** HTTP status; 0 when the request never got a response. */
14
+ status: number,
15
+ /** A standard code, an app's own business code, or a client code. */
16
+ code: StandardErrorCode | ClientErrorCode | (string & {}),
17
+ /** The server's English fallback text; not for display in other locales. */
18
+ message: string, details?: Record<string, unknown>);
19
+ }
20
+ /** Reads a failed response into an ApiError, falling back to the status when the body is not standard. */
21
+ export declare function readApiError(response: Response): Promise<ApiError>;
22
+ export declare function isApiError(error: unknown, code?: string): error is ApiError;
23
+ /** The 403 that means "show the no-access page", per the auth standard. */
24
+ export declare function isMissingRole(error: unknown): error is ApiError;
25
+ //# sourceMappingURL=api-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../src/lib/api-error.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,wPAcvB,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,cAAc,CAAA;AAiB9D,qBAAa,QAAS,SAAQ,KAAK;IAI/B,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAGlE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAT3C,SAAkB,IAAI,cAAa;;IAGjC,4DAA4D;IACnD,MAAM,EAAE,MAAM;IACvB,qEAAqE;IAC5D,IAAI,EAAE,iBAAiB,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAClE,4EAA4E;IAC5E,OAAO,EAAE,MAAM,EACN,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAIjD;AAUD,0GAA0G;AAC1G,wBAAsB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAaxE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAE3E;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE/D"}
@@ -0,0 +1,77 @@
1
+ // The team's error body: {"error":{"code":"...","message":"...","details":{...}}}.
2
+ export const STANDARD_ERROR_CODES = [
3
+ "invalid_request",
4
+ "unauthenticated",
5
+ "forbidden",
6
+ "missing_role",
7
+ "not_found",
8
+ "version_conflict",
9
+ "invalid_transition",
10
+ "payload_too_large",
11
+ "rate_limited",
12
+ "internal_error",
13
+ "config_error",
14
+ "upstream_unavailable",
15
+ "upstream_timeout",
16
+ ];
17
+ // Used when a response has no standard body (a proxy's HTML page, an empty 502).
18
+ const CODE_BY_STATUS = {
19
+ 400: "invalid_request",
20
+ 401: "unauthenticated",
21
+ 403: "forbidden",
22
+ 404: "not_found",
23
+ 409: "version_conflict",
24
+ 413: "payload_too_large",
25
+ 429: "rate_limited",
26
+ 500: "internal_error",
27
+ 502: "upstream_unavailable",
28
+ 503: "upstream_unavailable",
29
+ 504: "upstream_timeout",
30
+ };
31
+ export class ApiError extends Error {
32
+ status;
33
+ code;
34
+ details;
35
+ name = "ApiError";
36
+ constructor(
37
+ /** HTTP status; 0 when the request never got a response. */
38
+ status,
39
+ /** A standard code, an app's own business code, or a client code. */
40
+ code,
41
+ /** The server's English fallback text; not for display in other locales. */
42
+ message, details = {}) {
43
+ super(message);
44
+ this.status = status;
45
+ this.code = code;
46
+ this.details = details;
47
+ }
48
+ }
49
+ function codeForStatus(status) {
50
+ return CODE_BY_STATUS[status] ?? (status >= 500 ? "internal_error" : "invalid_request");
51
+ }
52
+ function isRecord(value) {
53
+ return typeof value === "object" && value !== null && !Array.isArray(value);
54
+ }
55
+ /** Reads a failed response into an ApiError, falling back to the status when the body is not standard. */
56
+ export async function readApiError(response) {
57
+ let body;
58
+ try {
59
+ body = await response.json();
60
+ }
61
+ catch {
62
+ body = undefined;
63
+ }
64
+ const error = isRecord(body) && isRecord(body.error) ? body.error : undefined;
65
+ const code = typeof error?.code === "string" && error.code !== "" ? error.code : codeForStatus(response.status);
66
+ const message = typeof error?.message === "string" ? error.message : response.statusText;
67
+ const details = isRecord(error?.details) ? error.details : {};
68
+ return new ApiError(response.status, code, message, details);
69
+ }
70
+ export function isApiError(error, code) {
71
+ return error instanceof ApiError && (code === undefined || error.code === code);
72
+ }
73
+ /** The 403 that means "show the no-access page", per the auth standard. */
74
+ export function isMissingRole(error) {
75
+ return isApiError(error, "missing_role");
76
+ }
77
+ //# sourceMappingURL=api-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-error.js","sourceRoot":"","sources":["../../src/lib/api-error.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ export declare const COMMIT_HEADER = "X-App-Commit";
2
+ /**
3
+ * Whether two commits differ. Short and full SHAs compare by prefix, and an
4
+ * image tag (sha-abc1234) counts as its SHA. Returns false when either side is
5
+ * missing or not a SHA (a dev build, a server without the header), so an
6
+ * unknown build is never reported as outdated.
7
+ */
8
+ export declare function commitsDiffer(build: string | null | undefined, server: string | null | undefined): boolean;
9
+ /** Writes are blocked while the app is outdated; reads still go through. */
10
+ export declare function isWriteMethod(method: string | undefined): boolean;
11
+ //# sourceMappingURL=commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/lib/commit.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,iBAAiB,CAAA;AAS3C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAK1G;AAID,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEjE"}
@@ -0,0 +1,27 @@
1
+ // Every API response carries X-App-Commit; the front end compares it with the
2
+ // commit it was built from.
3
+ export const COMMIT_HEADER = "X-App-Commit";
4
+ const SHORT_SHA = 7;
5
+ function normalize(commit) {
6
+ const value = commit?.trim().toLowerCase().replace(/^sha-/, "");
7
+ return value && /^[0-9a-f]+$/.test(value) && value.length >= SHORT_SHA ? value : undefined;
8
+ }
9
+ /**
10
+ * Whether two commits differ. Short and full SHAs compare by prefix, and an
11
+ * image tag (sha-abc1234) counts as its SHA. Returns false when either side is
12
+ * missing or not a SHA (a dev build, a server without the header), so an
13
+ * unknown build is never reported as outdated.
14
+ */
15
+ export function commitsDiffer(build, server) {
16
+ const a = normalize(build);
17
+ const b = normalize(server);
18
+ if (!a || !b)
19
+ return false;
20
+ return !(a.startsWith(b) || b.startsWith(a));
21
+ }
22
+ const SAFE_METHODS = new Set(["GET", "HEAD", "OPTIONS"]);
23
+ /** Writes are blocked while the app is outdated; reads still go through. */
24
+ export function isWriteMethod(method) {
25
+ return !SAFE_METHODS.has((method ?? "GET").toUpperCase());
26
+ }
27
+ //# sourceMappingURL=commit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.js","sourceRoot":"","sources":["../../src/lib/commit.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4BAA4B;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAA;AAE3C,MAAM,SAAS,GAAG,CAAC,CAAA;AAEnB,SAAS,SAAS,CAAC,MAAiC;IAClD,MAAM,KAAK,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAC/D,OAAO,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAC5F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgC,EAAE,MAAiC;IAC/F,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAC1B,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC1B,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;AAExD,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,MAA0B;IACtD,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;AAC3D,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** The fields every app's config.json has; apps add their own after these. */
2
+ export interface BaseRuntimeConfig {
3
+ apiBaseUrl: string;
4
+ oidc: {
5
+ authority: string;
6
+ clientId: string;
7
+ scope: string;
8
+ };
9
+ }
10
+ /** Every problem found in config.json, so they can be fixed in one pass. */
11
+ export declare class ConfigError extends Error {
12
+ readonly issues: string[];
13
+ readonly name = "ConfigError";
14
+ constructor(issues: string[]);
15
+ }
16
+ /**
17
+ * Checks the common fields and returns the problems found (empty when valid).
18
+ * Use it inside an app's own parser so the app's fields are reported together
19
+ * with these.
20
+ */
21
+ export declare function baseConfigIssues(raw: unknown): string[];
22
+ /** Parser for apps whose config.json has only the common fields. */
23
+ export declare function parseBaseConfig(raw: unknown): BaseRuntimeConfig;
24
+ export interface LoadRuntimeConfigOptions<T> {
25
+ /** Validates the parsed JSON; throw a ConfigError listing every problem. */
26
+ parse: (raw: unknown) => T;
27
+ /** The app's base path (Vite's import.meta.env.BASE_URL). Defaults to "/". */
28
+ basePath?: string;
29
+ fetch?: typeof fetch;
30
+ }
31
+ /** Fetches and validates config.json; throws a ConfigError on any failure. */
32
+ export declare function loadRuntimeConfig<T>({ parse, basePath, fetch: fetchFn }: LoadRuntimeConfigOptions<T>): Promise<T>;
33
+ //# sourceMappingURL=runtime-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-config.d.ts","sourceRoot":"","sources":["../../src/lib/runtime-config.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7D;AAED,4EAA4E;AAC5E,qBAAa,WAAY,SAAQ,KAAK;IAGxB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE;IAFrC,SAAkB,IAAI,iBAAgB;gBAEjB,MAAM,EAAE,MAAM,EAAE;CAGtC;AAMD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CAiBvD;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAI/D;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,4EAA4E;IAC5E,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,CAAA;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB;AAED,8EAA8E;AAC9E,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,QAAc,EAAE,KAAK,EAAE,OAAe,EAAE,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CA4BrI"}
@@ -0,0 +1,78 @@
1
+ // SPAs read their environment from /config.json at start-up instead of baking
2
+ // it into the build.
3
+ /** Every problem found in config.json, so they can be fixed in one pass. */
4
+ export class ConfigError extends Error {
5
+ issues;
6
+ name = "ConfigError";
7
+ constructor(issues) {
8
+ super(issues.join("\n"));
9
+ this.issues = issues;
10
+ }
11
+ }
12
+ function isRecord(value) {
13
+ return typeof value === "object" && value !== null && !Array.isArray(value);
14
+ }
15
+ /**
16
+ * Checks the common fields and returns the problems found (empty when valid).
17
+ * Use it inside an app's own parser so the app's fields are reported together
18
+ * with these.
19
+ */
20
+ export function baseConfigIssues(raw) {
21
+ if (!isRecord(raw))
22
+ return ["config.json is not a JSON object"];
23
+ const issues = [];
24
+ const requireString = (value, path) => {
25
+ if (typeof value !== "string" || value.trim() === "")
26
+ issues.push(`${path} is missing or empty`);
27
+ };
28
+ requireString(raw.apiBaseUrl, "apiBaseUrl");
29
+ if (!isRecord(raw.oidc)) {
30
+ issues.push("oidc is missing");
31
+ }
32
+ else {
33
+ requireString(raw.oidc.authority, "oidc.authority");
34
+ requireString(raw.oidc.clientId, "oidc.clientId");
35
+ requireString(raw.oidc.scope, "oidc.scope");
36
+ }
37
+ return issues;
38
+ }
39
+ /** Parser for apps whose config.json has only the common fields. */
40
+ export function parseBaseConfig(raw) {
41
+ const issues = baseConfigIssues(raw);
42
+ if (issues.length > 0)
43
+ throw new ConfigError(issues);
44
+ return raw;
45
+ }
46
+ /** Fetches and validates config.json; throws a ConfigError on any failure. */
47
+ export async function loadRuntimeConfig({ parse, basePath = "/", fetch: fetchFn = fetch }) {
48
+ const url = `${basePath.endsWith("/") ? basePath : `${basePath}/`}config.json`;
49
+ let response;
50
+ try {
51
+ response = await fetchFn(url, { cache: "no-cache" });
52
+ }
53
+ catch (error) {
54
+ throw new ConfigError([`could not fetch ${url}: ${error instanceof Error ? error.message : String(error)}`]);
55
+ }
56
+ if (!response.ok)
57
+ throw new ConfigError([`could not fetch ${url}: HTTP ${response.status}`]);
58
+ // A static host's SPA fallback answers a missing config.json with index.html.
59
+ if (/text\/html/i.test(response.headers.get("Content-Type") ?? "")) {
60
+ throw new ConfigError([`${url} was answered with an HTML page; is config.json deployed?`]);
61
+ }
62
+ let raw;
63
+ try {
64
+ raw = await response.json();
65
+ }
66
+ catch {
67
+ throw new ConfigError([`${url} is not valid JSON`]);
68
+ }
69
+ try {
70
+ return parse(raw);
71
+ }
72
+ catch (error) {
73
+ if (error instanceof ConfigError)
74
+ throw error;
75
+ throw new ConfigError([error instanceof Error ? error.message : String(error)]);
76
+ }
77
+ }
78
+ //# sourceMappingURL=runtime-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-config.js","sourceRoot":"","sources":["../../src/lib/runtime-config.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ import { type SystemContext } from "@chakra-ui/react";
2
+ import { type ColorModeProviderProps } from "./chakra/color-mode.js";
3
+ export interface UiProviderProps extends ColorModeProviderProps {
4
+ /** The app's current locale (any BCP 47 tag); picks the package's own strings. */
5
+ locale?: string;
6
+ /** Defaults to the team theme; pass a system built on it to extend it. */
7
+ system?: SystemContext;
8
+ }
9
+ /** Chakra with the team theme, color mode (next-themes) and the package's locale. */
10
+ export declare function UiProvider({ locale, system, ...colorModeProps }: UiProviderProps): import("react").JSX.Element;
11
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErE,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAIvF,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0EAA0E;IAC1E,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAmB,EAAE,GAAG,cAAc,EAAE,EAAE,eAAe,+BAQ7F"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { ChakraProvider } from "@chakra-ui/react";
4
+ import { ColorModeProvider } from "./chakra/color-mode.js";
5
+ import { resolveUiLocale, UiLocaleProvider } from "./i18n.js";
6
+ import { system as teamSystem } from "./theme.js";
7
+ /** Chakra with the team theme, color mode (next-themes) and the package's locale. */
8
+ export function UiProvider({ locale, system = teamSystem, ...colorModeProps }) {
9
+ return (_jsx(ChakraProvider, { value: system, children: _jsx(UiLocaleProvider, { value: resolveUiLocale(locale), children: _jsx(ColorModeProvider, { ...colorModeProps }) }) }));
10
+ }
11
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,cAAc,EAAsB,MAAM,kBAAkB,CAAA;AAErE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,wBAAwB,CAAA;AACvF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AASjD,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,GAAG,cAAc,EAAmB;IAC5F,OAAO,CACL,KAAC,cAAc,IAAC,KAAK,EAAE,MAAM,YAC3B,KAAC,gBAAgB,IAAC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,YAC9C,KAAC,iBAAiB,OAAK,cAAc,GAAI,GACxB,GACJ,CAClB,CAAA;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const system: import("@chakra-ui/react").SystemContext;
2
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,MAAM,0CAAsC,CAAA"}
package/dist/theme.js ADDED
@@ -0,0 +1,38 @@
1
+ import { createSystem, defaultConfig, defineConfig } from "@chakra-ui/react";
2
+ // Team theme on top of Chakra's defaults. Anything not defined here stays
3
+ // Chakra's default; only override a token once the team has decided on it.
4
+ // Fonts stay Chakra's system stack: no web font to load, nothing to add to font-src.
5
+ // `brand` is the primary color: use colorPalette="brand" for the app's own
6
+ // emphasis (today, the current user, primary actions) instead of naming a hue.
7
+ // The team has no brand color yet, so it points at Chakra's blue; changing
8
+ // BRAND_HUE (or replacing the scale with real values) re-colors every app.
9
+ const BRAND_HUE = "blue";
10
+ const SHADES = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
11
+ const ref = (shade) => `{colors.${BRAND_HUE}.${shade}}`;
12
+ const modes = (light, dark) => ({ value: { _light: light, _dark: dark } });
13
+ const config = defineConfig({
14
+ theme: {
15
+ tokens: {
16
+ colors: {
17
+ brand: Object.fromEntries(SHADES.map((s) => [s, { value: ref(s) }])),
18
+ },
19
+ },
20
+ semanticTokens: {
21
+ colors: {
22
+ // The slots every colorPalette needs, mirroring Chakra's own palettes.
23
+ brand: {
24
+ contrast: modes("white", "white"),
25
+ fg: modes("{colors.brand.700}", "{colors.brand.300}"),
26
+ subtle: modes("{colors.brand.100}", "{colors.brand.900}"),
27
+ muted: modes("{colors.brand.200}", "{colors.brand.800}"),
28
+ emphasized: modes("{colors.brand.300}", "{colors.brand.700}"),
29
+ solid: modes("{colors.brand.600}", "{colors.brand.600}"),
30
+ focusRing: modes("{colors.brand.500}", "{colors.brand.500}"),
31
+ border: modes("{colors.brand.500}", "{colors.brand.400}"),
32
+ },
33
+ },
34
+ },
35
+ },
36
+ });
37
+ export const system = createSystem(defaultConfig, config);
38
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE5E,0EAA0E;AAC1E,2EAA2E;AAC3E,qFAAqF;AAErF,2EAA2E;AAC3E,+EAA+E;AAC/E,2EAA2E;AAC3E,2EAA2E;AAC3E,MAAM,SAAS,GAAG,MAAM,CAAA;AACxB,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;AAEpG,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,WAAW,SAAS,IAAI,KAAK,GAAG,CAAA;AAC/D,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;AAE1F,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACrE;SACF;QACD,cAAc,EAAE;YACd,MAAM,EAAE;gBACN,uEAAuE;gBACvE,KAAK,EAAE;oBACL,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;oBACjC,EAAE,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;oBACrD,MAAM,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;oBACzD,KAAK,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;oBACxD,UAAU,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;oBAC7D,KAAK,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;oBACxD,SAAS,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;oBAC5D,MAAM,EAAE,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;iBAC1D;aACF;SACF;KACF;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,76 @@
1
1
  {
2
2
  "name": "@team6083/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "The team's Chakra UI theme and the standard blocks every web app needs",
5
+ "keywords": [
6
+ "chakra-ui",
7
+ "react",
8
+ "design-system",
9
+ "components",
10
+ "theme"
11
+ ],
12
+ "license": "Apache-2.0",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/Team6083/ui.git"
16
+ },
17
+ "homepage": "https://github.com/Team6083/ui#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/Team6083/ui/issues"
20
+ },
21
+ "type": "module",
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "sideEffects": false,
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ }
34
+ },
35
+ "scripts": {
36
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
37
+ "typecheck": "tsc --noEmit && tsc --noEmit -p demo",
38
+ "lint": "eslint .",
39
+ "test": "vitest run",
40
+ "prepack": "npm run build",
41
+ "demo": "vite --config demo/vite.config.ts",
42
+ "demo:build": "vite build --config demo/vite.config.ts"
43
+ },
44
+ "peerDependencies": {
45
+ "@chakra-ui/react": "^3.37.0",
46
+ "next-themes": "^0.4.6",
47
+ "react": "^19.0.0",
48
+ "react-dom": "^19.0.0"
49
+ },
50
+ "dependencies": {
51
+ "react-icons": "^5.7.0"
52
+ },
53
+ "devDependencies": {
54
+ "@chakra-ui/react": "^3.38.0",
55
+ "@eslint/js": "^10.0.1",
56
+ "@testing-library/jest-dom": "^7.0.1",
57
+ "@testing-library/react": "^16.3.3",
58
+ "@testing-library/user-event": "^14.6.10",
59
+ "@types/node": "^26.6.6",
60
+ "@types/react": "^19.3.0",
61
+ "@types/react-dom": "^19.3.0",
62
+ "eslint": "^10.15.0",
63
+ "eslint-plugin-react-hooks": "^7.1.1",
64
+ "jsdom": "^31.0.1",
65
+ "next-themes": "^0.4.6",
66
+ "react": "^19.3.1",
67
+ "react-dom": "^19.3.1",
68
+ "typescript": "~6.0.2",
69
+ "typescript-eslint": "^8.72.2",
70
+ "vite": "^8.3.8",
71
+ "vitest": "^5.1.0"
72
+ },
73
+ "publishConfig": {
74
+ "registry": "https://npm.pkg.github.com"
75
+ }
76
+ }