@isahaq/kosh-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 (68) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -2
  3. package/dist/api.d.ts +158 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +216 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/app.d.ts +14 -0
  8. package/dist/app.d.ts.map +1 -0
  9. package/dist/app.js +355 -0
  10. package/dist/app.js.map +1 -0
  11. package/dist/components/primitives.d.ts +60 -0
  12. package/dist/components/primitives.d.ts.map +1 -0
  13. package/dist/components/primitives.js +105 -0
  14. package/dist/components/primitives.js.map +1 -0
  15. package/dist/context.d.ts +34 -0
  16. package/dist/context.d.ts.map +1 -0
  17. package/dist/context.js +58 -0
  18. package/dist/context.js.map +1 -0
  19. package/dist/i18n/index.d.ts +14 -0
  20. package/dist/i18n/index.d.ts.map +1 -0
  21. package/dist/i18n/index.js +43 -0
  22. package/dist/i18n/index.js.map +1 -0
  23. package/dist/i18n/messages.d.ts +104 -0
  24. package/dist/i18n/messages.d.ts.map +1 -0
  25. package/dist/i18n/messages.js +194 -0
  26. package/dist/i18n/messages.js.map +1 -0
  27. package/dist/index.d.ts +31 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +42 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/lib/cn.d.ts +4 -0
  32. package/dist/lib/cn.d.ts.map +1 -0
  33. package/dist/lib/cn.js +7 -0
  34. package/dist/lib/cn.js.map +1 -0
  35. package/dist/lib/format.d.ts +18 -0
  36. package/dist/lib/format.d.ts.map +1 -0
  37. package/dist/lib/format.js +48 -0
  38. package/dist/lib/format.js.map +1 -0
  39. package/dist/registry.d.ts +80 -0
  40. package/dist/registry.d.ts.map +1 -0
  41. package/dist/registry.js +57 -0
  42. package/dist/registry.js.map +1 -0
  43. package/dist/search/SearchBar.d.ts +19 -0
  44. package/dist/search/SearchBar.d.ts.map +1 -0
  45. package/dist/search/SearchBar.js +84 -0
  46. package/dist/search/SearchBar.js.map +1 -0
  47. package/dist/shell/Login.d.ts +7 -0
  48. package/dist/shell/Login.d.ts.map +1 -0
  49. package/dist/shell/Login.js +41 -0
  50. package/dist/shell/Login.js.map +1 -0
  51. package/dist/views/FormView.d.ts +5 -0
  52. package/dist/views/FormView.d.ts.map +1 -0
  53. package/dist/views/FormView.js +276 -0
  54. package/dist/views/FormView.js.map +1 -0
  55. package/dist/views/KanbanView.d.ts +11 -0
  56. package/dist/views/KanbanView.d.ts.map +1 -0
  57. package/dist/views/KanbanView.js +156 -0
  58. package/dist/views/KanbanView.js.map +1 -0
  59. package/dist/views/ListView.d.ts +5 -0
  60. package/dist/views/ListView.d.ts.map +1 -0
  61. package/dist/views/ListView.js +227 -0
  62. package/dist/views/ListView.js.map +1 -0
  63. package/dist/views/widgets.d.ts +15 -0
  64. package/dist/views/widgets.d.ts.map +1 -0
  65. package/dist/views/widgets.js +253 -0
  66. package/dist/views/widgets.js.map +1 -0
  67. package/package.json +75 -3
  68. package/src/styles.css +101 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * What every renderer needs: the API, the registry, the signed-in user and company (for `$env` in conditions), the
3
+ * formatter for the user's language and time zone, and the theme.
4
+ */
5
+ import { type ReactElement, type ReactNode } from 'react';
6
+ import type { KoshApi } from './api.js';
7
+ import { type Formatter } from './lib/format.js';
8
+ import type { Registry } from './registry.js';
9
+ export type ThemeChoice = 'light' | 'dark' | 'system';
10
+ export interface KoshContextValue {
11
+ readonly api: KoshApi;
12
+ readonly registry: Registry;
13
+ readonly uid: number;
14
+ readonly companyId: number;
15
+ readonly format: Formatter;
16
+ readonly theme: ThemeChoice;
17
+ setTheme(theme: ThemeChoice): void;
18
+ }
19
+ /** The renderer context. @throws outside {@link KoshProvider} */
20
+ export declare function useKosh(): KoshContextValue;
21
+ /** Applies the theme to `<html>` (the `dark` class) and follows the system when asked to. */
22
+ declare function useTheme(): [ThemeChoice, (t: ThemeChoice) => void];
23
+ export declare function KoshProvider({ api, registry, uid, companyId, lang, tz, children, }: {
24
+ readonly api: KoshApi;
25
+ readonly registry: Registry;
26
+ readonly uid: number;
27
+ readonly companyId: number;
28
+ readonly lang: string;
29
+ readonly tz: string;
30
+ readonly children: ReactNode;
31
+ }): ReactElement;
32
+ /** Theme switching without a signed-in user (the sign-in page). */
33
+ export { useTheme };
34
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CACpC;AAID,iEAAiE;AACjE,wBAAgB,OAAO,IAAI,gBAAgB,CAI1C;AAaD,6FAA6F;AAC7F,iBAAS,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAmB3D;AAED,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,QAAQ,EACR,GAAG,EACH,SAAS,EACT,IAAI,EACJ,EAAE,EACF,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,GAAG,YAAY,CAQf;AAED,mEAAmE;AACnE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * What every renderer needs: the API, the registry, the signed-in user and company (for `$env` in conditions), the
4
+ * formatter for the user's language and time zone, and the theme.
5
+ */
6
+ import { createContext, useContext, useEffect, useMemo, useState, } from 'react';
7
+ import { createFormatter } from './lib/format.js';
8
+ const Context = createContext(null);
9
+ /** The renderer context. @throws outside {@link KoshProvider} */
10
+ export function useKosh() {
11
+ const value = useContext(Context);
12
+ if (value === null)
13
+ throw new Error('useKosh() needs a <KoshProvider>.');
14
+ return value;
15
+ }
16
+ const THEME_KEY = 'kosh.theme';
17
+ function readTheme() {
18
+ try {
19
+ const stored = localStorage.getItem(THEME_KEY);
20
+ return stored === 'light' || stored === 'dark' ? stored : 'system';
21
+ }
22
+ catch {
23
+ return 'system';
24
+ }
25
+ }
26
+ /** Applies the theme to `<html>` (the `dark` class) and follows the system when asked to. */
27
+ function useTheme() {
28
+ const [theme, setTheme] = useState(readTheme);
29
+ useEffect(() => {
30
+ const media = window.matchMedia('(prefers-color-scheme: dark)');
31
+ const apply = () => {
32
+ const dark = theme === 'dark' || (theme === 'system' && media.matches);
33
+ document.documentElement.classList.toggle('dark', dark);
34
+ };
35
+ apply();
36
+ media.addEventListener('change', apply);
37
+ try {
38
+ if (theme === 'system')
39
+ localStorage.removeItem(THEME_KEY);
40
+ else
41
+ localStorage.setItem(THEME_KEY, theme);
42
+ }
43
+ catch {
44
+ // storage unavailable (private mode): the choice lasts for this page only
45
+ }
46
+ return () => media.removeEventListener('change', apply);
47
+ }, [theme]);
48
+ return [theme, setTheme];
49
+ }
50
+ export function KoshProvider({ api, registry, uid, companyId, lang, tz, children, }) {
51
+ const [theme, setTheme] = useTheme();
52
+ const format = useMemo(() => createFormatter(lang, tz), [lang, tz]);
53
+ const value = useMemo(() => ({ api, registry, uid, companyId, format, theme, setTheme }), [api, registry, uid, companyId, format, theme, setTheme]);
54
+ return _jsx(Context.Provider, { value: value, children: children });
55
+ }
56
+ /** Theme switching without a signed-in user (the sign-in page). */
57
+ export { useTheme };
58
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,EACL,aAAa,EAGb,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAelE,MAAM,OAAO,GAAG,aAAa,CAA0B,IAAI,CAAC,CAAC;AAE7D,iEAAiE;AACjE,MAAM,UAAU,OAAO;IACrB,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,KAAK,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACzE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,SAAS,GAAG,YAAY,CAAC;AAE/B,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/C,O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J,EAAE,EACF,QAAQ,GAST;IACC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAClE,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CACzD,CAAC;IACF,OAAO,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAoB,CAAC;AACvE,CAAC;AAED,mEAAmE;AACnE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * i18next setup (RFC 0007): one instance per app, the `kosh` namespace for the UI, module namespaces added with
3
+ * {@link addMessages}. Languages use Kosh codes (`bn_BD`); i18next sees BCP 47 (`bn-BD`) and falls back to `bn`,
4
+ * then English. The document's `lang` and `dir` follow the language (Arabic is right-to-left).
5
+ */
6
+ import { type i18n } from 'i18next';
7
+ export declare const NAMESPACE = "kosh";
8
+ /** Creates and initializes an i18next instance for `lang`. */
9
+ export declare function createI18n(lang: string): Promise<i18n>;
10
+ /** Adds a module's messages (`addMessages(i18n, 'purchase', { en: {...}, bn: {...} })`). */
11
+ export declare function addMessages(instance: i18n, namespace: string, messages: Readonly<Record<string, object>>): void;
12
+ /** Text direction of a language. */
13
+ export declare function directionOf(lang: string): 'ltr' | 'rtl';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAgB,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,8DAA8D;AAC9D,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAc5D;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CACzB,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACzC,IAAI,CAGN;AAED,oCAAoC;AACpC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAEvD"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * i18next setup (RFC 0007): one instance per app, the `kosh` namespace for the UI, module namespaces added with
3
+ * {@link addMessages}. Languages use Kosh codes (`bn_BD`); i18next sees BCP 47 (`bn-BD`) and falls back to `bn`,
4
+ * then English. The document's `lang` and `dir` follow the language (Arabic is right-to-left).
5
+ */
6
+ import i18next, {} from 'i18next';
7
+ import { initReactI18next } from 'react-i18next';
8
+ import { bcp47 } from '../lib/format.js';
9
+ import { ar, bn, en } from './messages.js';
10
+ export const NAMESPACE = 'kosh';
11
+ /** Creates and initializes an i18next instance for `lang`. */
12
+ export async function createI18n(lang) {
13
+ const instance = i18next.createInstance();
14
+ await instance.use(initReactI18next).init({
15
+ lng: bcp47(lang),
16
+ fallbackLng: { 'bn-BD': ['bn', 'en'], default: ['en'] },
17
+ ns: [NAMESPACE],
18
+ defaultNS: NAMESPACE,
19
+ resources: { en: { [NAMESPACE]: en }, bn: { [NAMESPACE]: bn }, ar: { [NAMESPACE]: ar } },
20
+ interpolation: { escapeValue: false }, // React escapes
21
+ returnNull: false,
22
+ });
23
+ applyDocumentLanguage(instance);
24
+ instance.on('languageChanged', () => applyDocumentLanguage(instance));
25
+ return instance;
26
+ }
27
+ /** Adds a module's messages (`addMessages(i18n, 'purchase', { en: {...}, bn: {...} })`). */
28
+ export function addMessages(instance, namespace, messages) {
29
+ for (const [lang, bundle] of Object.entries(messages))
30
+ instance.addResourceBundle(lang, namespace, bundle, true, true);
31
+ }
32
+ /** Text direction of a language. */
33
+ export function directionOf(lang) {
34
+ return /^(ar|fa|he|ur|ps|dv|ckb)([-_]|$)/.test(lang) ? 'rtl' : 'ltr';
35
+ }
36
+ function applyDocumentLanguage(instance) {
37
+ if (typeof document === 'undefined')
38
+ return;
39
+ const lang = instance.language;
40
+ document.documentElement.lang = lang;
41
+ document.documentElement.dir = directionOf(lang);
42
+ }
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,OAAO,EAAE,EAAa,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEhC,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAC1C,MAAM,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;QACxC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC;QAChB,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;QACvD,EAAE,EAAE,CAAC,SAAS,CAAC;QACf,SAAS,EAAE,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104 @@
1
+ /**
2
+ * The UI's own messages (namespace `kosh`), in English, Bangla and Arabic (Arabic verifies RTL, RFC 0007 §6).
3
+ * Modules ship their own namespaces; labels from model metadata come translated by the server (`Accept-Language`).
4
+ */
5
+ export declare const en: {
6
+ app: {
7
+ name: string;
8
+ loading: string;
9
+ error: string;
10
+ retry: string;
11
+ notFound: string;
12
+ };
13
+ auth: {
14
+ signIn: string;
15
+ login: string;
16
+ password: string;
17
+ code: string;
18
+ codeHint: string;
19
+ verify: string;
20
+ signOut: string;
21
+ invalid: string;
22
+ adminNeeds2fa: string;
23
+ };
24
+ shell: {
25
+ apps: string;
26
+ menu: string;
27
+ theme: string;
28
+ light: string;
29
+ dark: string;
30
+ system: string;
31
+ language: string;
32
+ company: string;
33
+ noApps: string;
34
+ skip: string;
35
+ };
36
+ views: {
37
+ list: string;
38
+ kanban: string;
39
+ form: string;
40
+ pivot: string;
41
+ graph: string;
42
+ calendar: string;
43
+ gantt: string;
44
+ map: string;
45
+ hierarchy: string;
46
+ cohort: string;
47
+ spreadsheet: string;
48
+ dashboard: string;
49
+ new: string;
50
+ save: string;
51
+ discard: string;
52
+ edit: string;
53
+ delete: string;
54
+ confirmDelete: string;
55
+ saved: string;
56
+ total: string;
57
+ records: string;
58
+ record_one: string;
59
+ record_other: string;
60
+ empty: string;
61
+ previous: string;
62
+ next: string;
63
+ range: string;
64
+ stale: string;
65
+ reload: string;
66
+ readonly: string;
67
+ back: string;
68
+ quickCreate: string;
69
+ moveRefused: string;
70
+ yes: string;
71
+ no: string;
72
+ none: string;
73
+ lines: string;
74
+ addLine: string;
75
+ removeLine: string;
76
+ choose: string;
77
+ };
78
+ search: {
79
+ placeholder: string;
80
+ searchFor: string;
81
+ filters: string;
82
+ groupBy: string;
83
+ favorites: string;
84
+ saveCurrent: string;
85
+ name: string;
86
+ share: string;
87
+ clear: string;
88
+ remove: string;
89
+ or: string;
90
+ };
91
+ };
92
+ type Messages = typeof en;
93
+ type DeepPartial<T> = {
94
+ [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : string;
95
+ };
96
+ export declare const bn: DeepPartial<Messages>;
97
+ export declare const ar: DeepPartial<Messages>;
98
+ /** The languages the UI ships, with their names in their own script. */
99
+ export declare const LANGUAGES: readonly {
100
+ readonly code: string;
101
+ readonly name: string;
102
+ }[];
103
+ export type { Messages };
104
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE;IACb,GAAG;QACD,IAAI;QACJ,OAAO;QACP,KAAK;QACL,KAAK;QACL,QAAQ;;IAEV,IAAI;QACF,MAAM;QACN,KAAK;QACL,QAAQ;QACR,IAAI;QACJ,QAAQ;QACR,MAAM;QACN,OAAO;QACP,OAAO;QACP,aAAa;;IAEf,KAAK;QACH,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,KAAK;QACL,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,OAAO;QACP,MAAM;QACN,IAAI;;IAEN,KAAK;QACH,IAAI;QACJ,MAAM;QACN,IAAI;QACJ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,KAAK;QACL,GAAG;QACH,SAAS;QACT,MAAM;QACN,WAAW;QACX,SAAS;QACT,GAAG;QACH,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,MAAM;QACN,aAAa;QACb,KAAK;QACL,KAAK;QACL,OAAO;QACP,UAAU;QACV,YAAY;QACZ,KAAK;QACL,QAAQ;QACR,IAAI;QACJ,KAAK;QACL,KAAK;QACL,MAAM;QACN,QAAQ;QACR,IAAI;QACJ,WAAW;QACX,WAAW;QACX,GAAG;QACH,EAAE;QACF,IAAI;QACJ,KAAK;QACL,OAAO;QACP,UAAU;QACV,MAAM;;IAER,MAAM;QACJ,WAAW;QACX,SAAS;QACT,OAAO;QACP,OAAO;QACP,SAAS;QACT,WAAW;QACX,IAAI;QACJ,KAAK;QACL,KAAK;QACL,MAAM;QACN,EAAE;;CAEL,CAAC;AAEF,KAAK,QAAQ,GAAG,OAAO,EAAE,CAAC;AAC1B,KAAK,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM;CAAE,CAAC;AAE5F,eAAO,MAAM,EAAE,EAAE,WAAW,CAAC,QAAQ,CAmFpC,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,WAAW,CAAC,QAAQ,CAWpC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,SAAS,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAIhF,CAAC;AAEF,YAAY,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * The UI's own messages (namespace `kosh`), in English, Bangla and Arabic (Arabic verifies RTL, RFC 0007 §6).
3
+ * Modules ship their own namespaces; labels from model metadata come translated by the server (`Accept-Language`).
4
+ */
5
+ export const en = {
6
+ app: {
7
+ name: 'Kosh',
8
+ loading: 'Loading…',
9
+ error: 'Something went wrong.',
10
+ retry: 'Retry',
11
+ notFound: 'Nothing here.',
12
+ },
13
+ auth: {
14
+ signIn: 'Sign in',
15
+ login: 'Login',
16
+ password: 'Password',
17
+ code: 'Authentication code',
18
+ codeHint: 'Enter the 6-digit code from your authenticator app, or a recovery code.',
19
+ verify: 'Verify',
20
+ signOut: 'Sign out',
21
+ invalid: 'The login or password is wrong.',
22
+ adminNeeds2fa: 'Administrator rights apply after you verify a second factor.',
23
+ },
24
+ shell: {
25
+ apps: 'Apps',
26
+ menu: 'Main menu',
27
+ theme: 'Theme',
28
+ light: 'Light',
29
+ dark: 'Dark',
30
+ system: 'System',
31
+ language: 'Language',
32
+ company: 'Company',
33
+ noApps: 'No apps are available to you yet. Ask an administrator for a role.',
34
+ skip: 'Skip to content',
35
+ },
36
+ views: {
37
+ list: 'List',
38
+ kanban: 'Kanban',
39
+ form: 'Form',
40
+ pivot: 'Pivot',
41
+ graph: 'Graph',
42
+ calendar: 'Calendar',
43
+ gantt: 'Gantt',
44
+ map: 'Map',
45
+ hierarchy: 'Hierarchy',
46
+ cohort: 'Cohort',
47
+ spreadsheet: 'Spreadsheet',
48
+ dashboard: 'Dashboard',
49
+ new: 'New',
50
+ save: 'Save',
51
+ discard: 'Discard',
52
+ edit: 'Edit',
53
+ delete: 'Delete',
54
+ confirmDelete: 'Delete this record?',
55
+ saved: 'Saved',
56
+ total: 'Total',
57
+ records: '{{count}} records',
58
+ record_one: '{{count}} record',
59
+ record_other: '{{count}} records',
60
+ empty: 'No records yet.',
61
+ previous: 'Previous',
62
+ next: 'Next',
63
+ range: '{{from}}–{{to}} of {{total}}',
64
+ stale: 'Someone changed this record since you opened it.',
65
+ reload: 'Reload',
66
+ readonly: 'Read-only',
67
+ back: 'Back',
68
+ quickCreate: 'Quick create',
69
+ moveRefused: 'This move is not allowed.',
70
+ yes: 'Yes',
71
+ no: 'No',
72
+ none: 'None',
73
+ lines: 'Lines',
74
+ addLine: 'Add a line',
75
+ removeLine: 'Remove line',
76
+ choose: 'Choose…',
77
+ },
78
+ search: {
79
+ placeholder: 'Search…',
80
+ searchFor: 'Search {{field}} for: {{value}}',
81
+ filters: 'Filters',
82
+ groupBy: 'Group by',
83
+ favorites: 'Favorites',
84
+ saveCurrent: 'Save current search',
85
+ name: 'Name',
86
+ share: 'Share with everyone',
87
+ clear: 'Clear',
88
+ remove: 'Remove {{facet}}',
89
+ or: 'or',
90
+ },
91
+ };
92
+ export const bn = {
93
+ app: {
94
+ name: 'কোষ',
95
+ loading: 'লোড হচ্ছে…',
96
+ error: 'কিছু একটা ভুল হয়েছে।',
97
+ retry: 'আবার চেষ্টা করুন',
98
+ notFound: 'এখানে কিছু নেই।',
99
+ },
100
+ auth: {
101
+ signIn: 'সাইন ইন',
102
+ login: 'লগইন',
103
+ password: 'পাসওয়ার্ড',
104
+ code: 'প্রমাণীকরণ কোড',
105
+ codeHint: 'অথেনটিকেটর অ্যাপের ৬-সংখ্যার কোড বা একটি রিকভারি কোড দিন।',
106
+ verify: 'যাচাই করুন',
107
+ signOut: 'সাইন আউট',
108
+ invalid: 'লগইন বা পাসওয়ার্ড ভুল।',
109
+ adminNeeds2fa: 'দ্বিতীয় ধাপ যাচাইয়ের পর অ্যাডমিনিস্ট্রেটরের অধিকার কার্যকর হবে।',
110
+ },
111
+ shell: {
112
+ apps: 'অ্যাপস',
113
+ menu: 'প্রধান মেনু',
114
+ theme: 'থিম',
115
+ light: 'লাইট',
116
+ dark: 'ডার্ক',
117
+ system: 'সিস্টেম',
118
+ language: 'ভাষা',
119
+ company: 'কোম্পানি',
120
+ noApps: 'আপনার জন্য এখনো কোনো অ্যাপ নেই। একজন অ্যাডমিনিস্ট্রেটরের কাছে রোল চান।',
121
+ skip: 'মূল অংশে যান',
122
+ },
123
+ views: {
124
+ list: 'তালিকা',
125
+ kanban: 'কানবান',
126
+ form: 'ফর্ম',
127
+ pivot: 'পিভট',
128
+ graph: 'গ্রাফ',
129
+ calendar: 'ক্যালেন্ডার',
130
+ gantt: 'গ্যান্ট',
131
+ map: 'মানচিত্র',
132
+ hierarchy: 'শ্রেণিবিন্যাস',
133
+ cohort: 'কোহর্ট',
134
+ spreadsheet: 'স্প্রেডশিট',
135
+ dashboard: 'ড্যাশবোর্ড',
136
+ new: 'নতুন',
137
+ save: 'সংরক্ষণ',
138
+ discard: 'বাতিল',
139
+ edit: 'সম্পাদনা',
140
+ delete: 'মুছুন',
141
+ confirmDelete: 'এই রেকর্ডটি মুছবেন?',
142
+ saved: 'সংরক্ষিত',
143
+ total: 'মোট',
144
+ empty: 'এখনো কোনো রেকর্ড নেই।',
145
+ previous: 'আগের',
146
+ next: 'পরের',
147
+ range: '{{total}}টির মধ্যে {{from}}–{{to}}',
148
+ stale: 'আপনি খোলার পর অন্য কেউ রেকর্ডটি পরিবর্তন করেছেন।',
149
+ reload: 'আবার লোড করুন',
150
+ readonly: 'শুধু পড়ার জন্য',
151
+ back: 'ফিরে যান',
152
+ quickCreate: 'দ্রুত তৈরি',
153
+ moveRefused: 'এই পরিবর্তনের অনুমতি নেই।',
154
+ yes: 'হ্যাঁ',
155
+ no: 'না',
156
+ none: 'কিছু না',
157
+ lines: 'লাইন',
158
+ addLine: 'লাইন যোগ করুন',
159
+ removeLine: 'লাইন সরান',
160
+ choose: 'বেছে নিন…',
161
+ },
162
+ search: {
163
+ placeholder: 'খুঁজুন…',
164
+ searchFor: '{{field}}-এ খুঁজুন: {{value}}',
165
+ filters: 'ফিল্টার',
166
+ groupBy: 'গ্রুপ করুন',
167
+ favorites: 'প্রিয়',
168
+ saveCurrent: 'এই অনুসন্ধান সংরক্ষণ করুন',
169
+ name: 'নাম',
170
+ share: 'সবার সাথে শেয়ার করুন',
171
+ clear: 'মুছে ফেলুন',
172
+ remove: '{{facet}} সরান',
173
+ or: 'অথবা',
174
+ },
175
+ };
176
+ export const ar = {
177
+ app: { name: 'كوش', loading: 'جارٍ التحميل…' },
178
+ auth: {
179
+ signIn: 'تسجيل الدخول',
180
+ login: 'اسم المستخدم',
181
+ password: 'كلمة المرور',
182
+ signOut: 'تسجيل الخروج',
183
+ },
184
+ shell: { apps: 'التطبيقات', language: 'اللغة', theme: 'المظهر' },
185
+ views: { new: 'جديد', save: 'حفظ', discard: 'تجاهل', list: 'قائمة', kanban: 'كانبان' },
186
+ search: { placeholder: 'بحث…', filters: 'عوامل التصفية', groupBy: 'تجميع حسب' },
187
+ };
188
+ /** The languages the UI ships, with their names in their own script. */
189
+ export const LANGUAGES = [
190
+ { code: 'en_US', name: 'English' },
191
+ { code: 'bn_BD', name: 'বাংলা' },
192
+ { code: 'ar', name: 'العربية' },
193
+ ];
194
+ //# sourceMappingURL=mess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* @packageDocumentation
3
+ * `@isahaq/kosh-ui` (RFC 0007): the design system (tokens, light/dark themes, RTL, Radix-based primitives), the app shell
4
+ * and router, i18n (English, Bangla, Arabic for RTL), and the view renderers (list, form, kanban) driven by
5
+ * `@isahaq/kosh-views` definitions and the `@isahaq/kosh-search` layer. Renderers, widgets and components are registered by name:
6
+ * modules add their own and replace defaults explicitly.
7
+ */
8
+ import { Registry } from './registry.js';
9
+ export { ApiError, type ApiOptions, type AppEntry, type CurrentUser, createKoshApi, type KoshApi, type ListQuery, type MenuNode, type Problem, type Row, type ServedView, type Versioned, type ViewField, } from './api.js';
10
+ export { KoshApp, type KoshAppProps } from './app.js';
11
+ export * from './components/primitives.js';
12
+ export { type KoshContextValue, KoshProvider, type ThemeChoice, useKosh } from './context.js';
13
+ export { addMessages, createI18n, directionOf, NAMESPACE } from './i18n/index.js';
14
+ export { LANGUAGES } from './i18n/messages.js';
15
+ export { cn } from './lib/cn.js';
16
+ export { bcp47, createFormatter, type Formatter } from './lib/format.js';
17
+ export { type FormProps, type NodeComponentProps, Registry, RegistryError, type ViewProps, type WidgetProps, } from './registry.js';
18
+ export { SearchBar, type SearchBarProps } from './search/SearchBar.js';
19
+ export { Login } from './shell/Login.js';
20
+ export { FormView } from './views/FormView.js';
21
+ export { KanbanView } from './views/KanbanView.js';
22
+ export { ListView } from './views/ListView.js';
23
+ export { PrefetchedNames, registerDefaultWidgets, useDisplayNames, useRowNames, } from './views/widgets.js';
24
+ /** A registry with the default renderers and widgets; modules register theirs on top. */
25
+ export declare function createDefaultRegistry(): Registry;
26
+ /** Package identity. */
27
+ export declare const PACKAGE: {
28
+ readonly name: string;
29
+ readonly rfc: string;
30
+ };
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OA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AAI,QAAQ,CAOhD;AAED,wBAAwB;AACxB,eAAO,MAAM,OAAO,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAGjE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * `@isahaq/kosh-ui` (RFC 0007): the design system (tokens, light/dark themes, RTL, Radix-based primitives), the app shell
4
+ * and router, i18n (English, Bangla, Arabic for RTL), and the view renderers (list, form, kanban) driven by
5
+ * `@isahaq/kosh-views` definitions and the `@isahaq/kosh-search` layer. Renderers, widgets and components are registered by name:
6
+ * modules add their own and replace defaults explicitly.
7
+ */
8
+ import { Registry } from './registry.js';
9
+ import { FormView } from './views/FormView.js';
10
+ import { KanbanView } from './views/KanbanView.js';
11
+ import { ListView } from './views/ListView.js';
12
+ import { registerDefaultWidgets } from './views/widgets.js';
13
+ export { ApiError, createKoshApi, } from './api.js';
14
+ export { KoshApp } from './app.js';
15
+ export * from './components/primitives.js';
16
+ export { KoshProvider, useKosh } from './context.js';
17
+ export { addMessages, createI18n, directionOf, NAMESPACE } from './i18n/index.js';
18
+ export { LANGUAGES } from './i18n/messages.js';
19
+ export { cn } from './lib/cn.js';
20
+ export { bcp47, createFormatter } from './lib/format.js';
21
+ export { Registry, RegistryError, } from './registry.js';
22
+ export { SearchBar } from './search/SearchBar.js';
23
+ export { Login } from './shell/Login.js';
24
+ export { FormView } from './views/FormView.js';
25
+ export { KanbanView } from './views/KanbanView.js';
26
+ export { ListView } from './views/ListView.js';
27
+ export { PrefetchedNames, registerDefaultWidgets, useDisplayNames, useRowNames, } from './views/widgets.js';
28
+ /** A registry with the default renderers and widgets; modules register theirs on top. */
29
+ export function createDefaultRegistry() {
30
+ const registry = new Registry();
31
+ registry
32
+ .registerView('list', ListView)
33
+ .registerView('kanban', KanbanView)
34
+ .registerView('form', FormView);
35
+ return registerDefaultWidgets(registry);
36
+ }
37
+ /** Package identity. */
38
+ export const PACKAGE = Object.freeze({
39
+ name: '@isahaq/kosh-ui',
40
+ rfc: 'RFC 0007',
41
+ });
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EACL,QAAQ,EAIR,aAAa,GASd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAqB,MAAM,UAAU,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAyB,YAAY,EAAoB,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAGL,QAAQ,EACR,aAAa,GAGd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAuB,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,yFAAyF;AACzF,MAAM,UAAU,qBAAqB;IACnC,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,QAAQ;SACL,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;SAC9B,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC;SAClC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,wBAAwB;AACxB,MAAM,CAAC,MAAM,OAAO,GAAoD,MAAM,CAAC,MAAM,CAAC;IACpF,IAAI,EAAE,iBAAiB;IACvB,GAAG,EAAE,UAAU;CAChB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /** Joins class names, later Tailwind utilities winning over earlier conflicting ones (shadcn/ui convention). */
3
+ export declare function cn(...inputs: ClassValue[]): string;
4
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,gHAAgH;AAChH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAElD"}
package/dist/lib/cn.js ADDED
@@ -0,0 +1,7 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ /** Joins class names, later Tailwind utilities winning over earlier conflicting ones (shadcn/ui convention). */
4
+ export function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+ //# sourceMappingURL=cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,gHAAgH;AAChH,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Locale-aware formatting (RFC 0007 i18n): numbers, exact decimals (strings, never floats), dates and datetimes from
3
+ * the user's language and time zone, through `Intl`. Bangla can use Bengali digits (`bn` with `nu-beng`).
4
+ */
5
+ /** Kosh language codes (`bn_BD`) → BCP 47 (`bn-BD`). */
6
+ export declare function bcp47(lang: string): string;
7
+ export interface Formatter {
8
+ readonly locale: string;
9
+ number(value: number | null | undefined): string;
10
+ /** An exact decimal string (`'750000.00'`), grouped per locale without float rounding. */
11
+ decimal(value: string | null | undefined, scale?: number): string;
12
+ date(value: string | null | undefined): string;
13
+ datetime(value: string | null | undefined): string;
14
+ }
15
+ export declare function createFormatter(lang: string, tz: string, options?: {
16
+ readonly nativeDigits?: boolean;
17
+ }): Formatter;
18
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wDAAwD;AACxD,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;IACjD,0FAA0F;IAC1F,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;CACpD;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,GAAE;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GAChD,SAAS,CA0CX"}