@mesob/ui 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.d.ts +1112 -0
- package/dist/components.js +9460 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks.d.ts +6 -0
- package/dist/hooks.js +85 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/locale.d.ts +37 -0
- package/dist/lib/locale.js +55 -0
- package/dist/lib/locale.js.map +1 -0
- package/dist/providers.d.ts +20 -0
- package/dist/providers.js +61 -0
- package/dist/providers.js.map +1 -0
- package/dist/use-entity-params-nqD69tdX.d.ts +82 -0
- package/package.json +34 -27
- package/dist/components/accordion.d.ts +0 -10
- package/dist/components/accordion.js +0 -74
- package/dist/components/accordion.js.map +0 -1
- package/dist/components/alert-dialog.d.ts +0 -17
- package/dist/components/alert-dialog.js +0 -187
- package/dist/components/alert-dialog.js.map +0 -1
- package/dist/components/alert.d.ts +0 -13
- package/dist/components/alert.js +0 -74
- package/dist/components/alert.js.map +0 -1
- package/dist/components/animated-tabs.d.ts +0 -26
- package/dist/components/animated-tabs.js +0 -290
- package/dist/components/animated-tabs.js.map +0 -1
- package/dist/components/app-breadcrumbs-context.d.ts +0 -19
- package/dist/components/app-breadcrumbs-context.js +0 -19
- package/dist/components/app-breadcrumbs-context.js.map +0 -1
- package/dist/components/app-breadcrumbs.d.ts +0 -25
- package/dist/components/app-breadcrumbs.js +0 -175
- package/dist/components/app-breadcrumbs.js.map +0 -1
- package/dist/components/app-header-actions.d.ts +0 -39
- package/dist/components/app-header-actions.js +0 -644
- package/dist/components/app-header-actions.js.map +0 -1
- package/dist/components/app-sidebar.d.ts +0 -24
- package/dist/components/app-sidebar.js +0 -667
- package/dist/components/app-sidebar.js.map +0 -1
- package/dist/components/aspect-ratio.d.ts +0 -6
- package/dist/components/aspect-ratio.js +0 -14
- package/dist/components/aspect-ratio.js.map +0 -1
- package/dist/components/avatar.d.ts +0 -9
- package/dist/components/avatar.js +0 -63
- package/dist/components/avatar.js.map +0 -1
- package/dist/components/badge.d.ts +0 -13
- package/dist/components/badge.js +0 -48
- package/dist/components/badge.js.map +0 -1
- package/dist/components/breadcrumb.d.ts +0 -14
- package/dist/components/breadcrumb.js +0 -110
- package/dist/components/breadcrumb.js.map +0 -1
- package/dist/components/button-group.d.ts +0 -17
- package/dist/components/button-group.js +0 -106
- package/dist/components/button-group.js.map +0 -1
- package/dist/components/button.d.ts +0 -17
- package/dist/components/button.js +0 -68
- package/dist/components/button.js.map +0 -1
- package/dist/components/calendar.d.ts +0 -13
- package/dist/components/calendar.js +0 -262
- package/dist/components/calendar.js.map +0 -1
- package/dist/components/card.d.ts +0 -12
- package/dist/components/card.js +0 -98
- package/dist/components/card.js.map +0 -1
- package/dist/components/carousel.d.ts +0 -24
- package/dist/components/carousel.js +0 -268
- package/dist/components/carousel.js.map +0 -1
- package/dist/components/chart.d.ts +0 -43
- package/dist/components/chart.js +0 -271
- package/dist/components/chart.js.map +0 -1
- package/dist/components/checkbox.d.ts +0 -7
- package/dist/components/checkbox.js +0 -41
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/collapsible.d.ts +0 -8
- package/dist/components/collapsible.js +0 -38
- package/dist/components/collapsible.js.map +0 -1
- package/dist/components/command.d.ts +0 -22
- package/dist/components/command.js +0 -281
- package/dist/components/command.js.map +0 -1
- package/dist/components/context-menu.d.ts +0 -28
- package/dist/components/context-menu.js +0 -233
- package/dist/components/context-menu.js.map +0 -1
- package/dist/components/data-table/index.d.ts +0 -53
- package/dist/components/data-table/index.js +0 -823
- package/dist/components/data-table/index.js.map +0 -1
- package/dist/components/dialog.d.ts +0 -18
- package/dist/components/dialog.js +0 -146
- package/dist/components/dialog.js.map +0 -1
- package/dist/components/drawer.d.ts +0 -16
- package/dist/components/drawer.js +0 -138
- package/dist/components/drawer.js.map +0 -1
- package/dist/components/dropdown-menu.d.ts +0 -28
- package/dist/components/dropdown-menu.js +0 -241
- package/dist/components/dropdown-menu.js.map +0 -1
- package/dist/components/empty.d.ts +0 -15
- package/dist/components/empty.js +0 -110
- package/dist/components/empty.js.map +0 -1
- package/dist/components/entity/index.d.ts +0 -236
- package/dist/components/entity/index.js +0 -1796
- package/dist/components/entity/index.js.map +0 -1
- package/dist/components/field.d.ts +0 -30
- package/dist/components/field.js +0 -279
- package/dist/components/field.js.map +0 -1
- package/dist/components/form.d.ts +0 -28
- package/dist/components/form.js +0 -150
- package/dist/components/form.js.map +0 -1
- package/dist/components/hover-card.d.ts +0 -9
- package/dist/components/hover-card.js +0 -48
- package/dist/components/hover-card.js.map +0 -1
- package/dist/components/input-group.d.ts +0 -20
- package/dist/components/input-group.js +0 -265
- package/dist/components/input-group.js.map +0 -1
- package/dist/components/input-otp.d.ts +0 -14
- package/dist/components/input-otp.js +0 -76
- package/dist/components/input-otp.js.map +0 -1
- package/dist/components/input.d.ts +0 -6
- package/dist/components/input.js +0 -29
- package/dist/components/input.js.map +0 -1
- package/dist/components/item.d.ts +0 -28
- package/dist/components/item.js +0 -220
- package/dist/components/item.js.map +0 -1
- package/dist/components/kbd.d.ts +0 -6
- package/dist/components/kbd.js +0 -39
- package/dist/components/kbd.js.map +0 -1
- package/dist/components/label.d.ts +0 -7
- package/dist/components/label.js +0 -32
- package/dist/components/label.js.map +0 -1
- package/dist/components/link.d.ts +0 -12
- package/dist/components/link.js +0 -51
- package/dist/components/link.js.map +0 -1
- package/dist/components/menubar.d.ts +0 -29
- package/dist/components/menubar.js +0 -261
- package/dist/components/menubar.js.map +0 -1
- package/dist/components/mesob-context.d.ts +0 -34
- package/dist/components/mesob-context.js +0 -53
- package/dist/components/mesob-context.js.map +0 -1
- package/dist/components/mesob-logo.d.ts +0 -13
- package/dist/components/mesob-logo.js +0 -80
- package/dist/components/mesob-logo.js.map +0 -1
- package/dist/components/navigation-menu.d.ts +0 -18
- package/dist/components/navigation-menu.js +0 -178
- package/dist/components/navigation-menu.js.map +0 -1
- package/dist/components/page/index.d.ts +0 -46
- package/dist/components/page/index.js +0 -205
- package/dist/components/page/index.js.map +0 -1
- package/dist/components/pagination.d.ts +0 -18
- package/dist/components/pagination.js +0 -160
- package/dist/components/pagination.js.map +0 -1
- package/dist/components/popover.d.ts +0 -10
- package/dist/components/popover.js +0 -54
- package/dist/components/popover.js.map +0 -1
- package/dist/components/powered-by.d.ts +0 -8
- package/dist/components/powered-by.js +0 -114
- package/dist/components/powered-by.js.map +0 -1
- package/dist/components/progress.d.ts +0 -7
- package/dist/components/progress.js +0 -41
- package/dist/components/progress.js.map +0 -1
- package/dist/components/radio-group.d.ts +0 -8
- package/dist/components/radio-group.js +0 -55
- package/dist/components/radio-group.js.map +0 -1
- package/dist/components/resizable.d.ts +0 -11
- package/dist/components/resizable.js +0 -58
- package/dist/components/resizable.js.map +0 -1
- package/dist/components/scroll-area.d.ts +0 -8
- package/dist/components/scroll-area.js +0 -70
- package/dist/components/scroll-area.js.map +0 -1
- package/dist/components/section/index.d.ts +0 -14
- package/dist/components/section/index.js +0 -147
- package/dist/components/section/index.js.map +0 -1
- package/dist/components/select.d.ts +0 -18
- package/dist/components/select.js +0 -181
- package/dist/components/select.js.map +0 -1
- package/dist/components/separator.d.ts +0 -7
- package/dist/components/separator.js +0 -36
- package/dist/components/separator.js.map +0 -1
- package/dist/components/sheet.d.ts +0 -16
- package/dist/components/sheet.js +0 -136
- package/dist/components/sheet.js.map +0 -1
- package/dist/components/shell.d.ts +0 -13
- package/dist/components/shell.js +0 -548
- package/dist/components/shell.js.map +0 -1
- package/dist/components/sidebar-context.d.ts +0 -19
- package/dist/components/sidebar-context.js +0 -17
- package/dist/components/sidebar-context.js.map +0 -1
- package/dist/components/sidebar.d.ts +0 -66
- package/dist/components/sidebar.js +0 -943
- package/dist/components/sidebar.js.map +0 -1
- package/dist/components/skeleton.d.ts +0 -5
- package/dist/components/skeleton.js +0 -23
- package/dist/components/skeleton.js.map +0 -1
- package/dist/components/slider.d.ts +0 -7
- package/dist/components/slider.js +0 -76
- package/dist/components/slider.js.map +0 -1
- package/dist/components/sonner.d.ts +0 -7
- package/dist/components/sonner.js +0 -43
- package/dist/components/sonner.js.map +0 -1
- package/dist/components/spinner.d.ts +0 -6
- package/dist/components/spinner.js +0 -28
- package/dist/components/spinner.js.map +0 -1
- package/dist/components/spotlight-search.d.ts +0 -25
- package/dist/components/spotlight-search.js +0 -395
- package/dist/components/spotlight-search.js.map +0 -1
- package/dist/components/switch.d.ts +0 -7
- package/dist/components/switch.js +0 -41
- package/dist/components/switch.js.map +0 -1
- package/dist/components/table.d.ts +0 -13
- package/dist/components/table.js +0 -124
- package/dist/components/table.js.map +0 -1
- package/dist/components/tabs.d.ts +0 -10
- package/dist/components/tabs.js +0 -77
- package/dist/components/tabs.js.map +0 -1
- package/dist/components/textarea.d.ts +0 -6
- package/dist/components/textarea.js +0 -26
- package/dist/components/textarea.js.map +0 -1
- package/dist/components/theme-toggle.d.ts +0 -8
- package/dist/components/theme-toggle.js +0 -94
- package/dist/components/theme-toggle.js.map +0 -1
- package/dist/components/toggle-group.d.ts +0 -14
- package/dist/components/toggle-group.js +0 -102
- package/dist/components/toggle-group.js.map +0 -1
- package/dist/components/toggle.d.ts +0 -13
- package/dist/components/toggle.js +0 -53
- package/dist/components/toggle.js.map +0 -1
- package/dist/components/tooltip.d.ts +0 -10
- package/dist/components/tooltip.js +0 -66
- package/dist/components/tooltip.js.map +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -3
- package/dist/hooks/use-mobile.js +0 -22
- package/dist/hooks/use-mobile.js.map +0 -1
- package/dist/hooks/use-router.d.ts +0 -7
- package/dist/hooks/use-router.js +0 -36
- package/dist/hooks/use-router.js.map +0 -1
- package/dist/hooks/use-translation.d.ts +0 -5
- package/dist/hooks/use-translation.js +0 -42
- package/dist/hooks/use-translation.js.map +0 -1
package/dist/hooks.d.ts
ADDED
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/components/entity/use-entity-pagination.ts
|
|
2
|
+
function useEntityPagination({
|
|
3
|
+
items,
|
|
4
|
+
total,
|
|
5
|
+
pageSize
|
|
6
|
+
}) {
|
|
7
|
+
const totalCount = Number(total ?? items.length);
|
|
8
|
+
const pageCount = Math.ceil(totalCount / pageSize);
|
|
9
|
+
return {
|
|
10
|
+
total: totalCount,
|
|
11
|
+
pageCount,
|
|
12
|
+
hasData: items.length > 0,
|
|
13
|
+
isEmpty: totalCount === 0
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/components/entity/use-entity-params.ts
|
|
18
|
+
import { parseAsInteger, parseAsString, useQueryStates } from "nuqs";
|
|
19
|
+
import { useMemo } from "react";
|
|
20
|
+
function useEntityParams(config = {}) {
|
|
21
|
+
const {
|
|
22
|
+
searchKey = "search",
|
|
23
|
+
searchParamName,
|
|
24
|
+
defaultSort = "createdAt",
|
|
25
|
+
defaultOrder = "desc",
|
|
26
|
+
defaultPageSize = 10
|
|
27
|
+
} = config;
|
|
28
|
+
const [params, setParams] = useQueryStates({
|
|
29
|
+
...searchKey && {
|
|
30
|
+
[searchKey]: parseAsString.withDefault("")
|
|
31
|
+
},
|
|
32
|
+
view: parseAsString.withDefault("table"),
|
|
33
|
+
page: parseAsInteger.withDefault(1),
|
|
34
|
+
pageSize: parseAsInteger.withDefault(defaultPageSize),
|
|
35
|
+
filter: parseAsString,
|
|
36
|
+
sort: parseAsString.withDefault(defaultSort),
|
|
37
|
+
order: parseAsString.withDefault(defaultOrder)
|
|
38
|
+
});
|
|
39
|
+
const queryConfig = useMemo(
|
|
40
|
+
() => ({
|
|
41
|
+
params: {
|
|
42
|
+
query: {
|
|
43
|
+
page: params.page,
|
|
44
|
+
limit: params.pageSize,
|
|
45
|
+
...searchKey && params[searchKey] && {
|
|
46
|
+
[searchParamName || (searchKey === "search" ? "search" : "handle")]: params[searchKey]
|
|
47
|
+
},
|
|
48
|
+
...params.filter && { filter: params.filter },
|
|
49
|
+
...params.sort && { sort: params.sort, order: params.order }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
[params, searchKey, searchParamName]
|
|
54
|
+
);
|
|
55
|
+
return {
|
|
56
|
+
params,
|
|
57
|
+
setParams,
|
|
58
|
+
queryConfig
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/hooks/use-mobile.ts
|
|
63
|
+
import * as React from "react";
|
|
64
|
+
var MOBILE_BREAKPOINT = 768;
|
|
65
|
+
function useIsMobile() {
|
|
66
|
+
const [isMobile, setIsMobile] = React.useState(
|
|
67
|
+
void 0
|
|
68
|
+
);
|
|
69
|
+
React.useEffect(() => {
|
|
70
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
71
|
+
const onChange = () => {
|
|
72
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
73
|
+
};
|
|
74
|
+
mql.addEventListener("change", onChange);
|
|
75
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
76
|
+
return () => mql.removeEventListener("change", onChange);
|
|
77
|
+
}, []);
|
|
78
|
+
return !!isMobile;
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
useEntityPagination,
|
|
82
|
+
useEntityParams,
|
|
83
|
+
useIsMobile
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/entity/use-entity-pagination.ts","../src/components/entity/use-entity-params.ts","../src/hooks/use-mobile.ts"],"sourcesContent":["type PaginationData = {\n items: unknown[];\n total?: number | string | null;\n pageSize: number;\n};\n\nexport function useEntityPagination({\n items,\n total,\n pageSize,\n}: PaginationData) {\n const totalCount = Number(total ?? items.length);\n const pageCount = Math.ceil(totalCount / pageSize);\n\n return {\n total: totalCount,\n pageCount,\n hasData: items.length > 0,\n isEmpty: totalCount === 0,\n };\n}\n","'use client';\n\nimport { parseAsInteger, parseAsString, useQueryStates } from 'nuqs';\nimport { useMemo } from 'react';\n\ntype EntityParamsConfig = {\n searchKey?: string;\n searchParamName?: string;\n defaultSort?: string;\n defaultOrder?: 'asc' | 'desc';\n defaultPageSize?: number;\n};\n\nexport function useEntityParams(config: EntityParamsConfig = {}) {\n const {\n searchKey = 'search',\n searchParamName,\n defaultSort = 'createdAt',\n defaultOrder = 'desc',\n defaultPageSize = 10,\n } = config;\n\n const [params, setParams] = useQueryStates({\n ...(searchKey && {\n [searchKey]: parseAsString.withDefault(''),\n }),\n view: parseAsString.withDefault('table'),\n page: parseAsInteger.withDefault(1),\n pageSize: parseAsInteger.withDefault(defaultPageSize),\n filter: parseAsString,\n sort: parseAsString.withDefault(defaultSort),\n order: parseAsString.withDefault(defaultOrder),\n });\n\n const queryConfig = useMemo(\n () => ({\n params: {\n query: {\n page: params.page,\n limit: params.pageSize,\n ...(searchKey &&\n (params as Record<string, string | number | null | undefined>)[\n searchKey\n ] && {\n [searchParamName ||\n (searchKey === 'search' ? 'search' : 'handle')]: (\n params as Record<string, string | number | null | undefined>\n )[searchKey],\n }),\n ...(params.filter && { filter: params.filter }),\n ...(params.sort && { sort: params.sort, order: params.order }),\n },\n },\n }),\n [params, searchKey, searchParamName],\n );\n\n return {\n params,\n setParams,\n queryConfig,\n };\n}\n","import * as React from 'react';\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined,\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener('change', onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener('change', onChange);\n }, []);\n\n return !!isMobile;\n}\n"],"mappings":";AAMO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,QAAM,aAAa,OAAO,SAAS,MAAM,MAAM;AAC/C,QAAM,YAAY,KAAK,KAAK,aAAa,QAAQ;AAEjD,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,IACA,SAAS,MAAM,SAAS;AAAA,IACxB,SAAS,eAAe;AAAA,EAC1B;AACF;;;AClBA,SAAS,gBAAgB,eAAe,sBAAsB;AAC9D,SAAS,eAAe;AAUjB,SAAS,gBAAgB,SAA6B,CAAC,GAAG;AAC/D,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA,cAAc;AAAA,IACd,eAAe;AAAA,IACf,kBAAkB;AAAA,EACpB,IAAI;AAEJ,QAAM,CAAC,QAAQ,SAAS,IAAI,eAAe;AAAA,IACzC,GAAI,aAAa;AAAA,MACf,CAAC,SAAS,GAAG,cAAc,YAAY,EAAE;AAAA,IAC3C;AAAA,IACA,MAAM,cAAc,YAAY,OAAO;AAAA,IACvC,MAAM,eAAe,YAAY,CAAC;AAAA,IAClC,UAAU,eAAe,YAAY,eAAe;AAAA,IACpD,QAAQ;AAAA,IACR,MAAM,cAAc,YAAY,WAAW;AAAA,IAC3C,OAAO,cAAc,YAAY,YAAY;AAAA,EAC/C,CAAC;AAED,QAAM,cAAc;AAAA,IAClB,OAAO;AAAA,MACL,QAAQ;AAAA,QACN,OAAO;AAAA,UACL,MAAM,OAAO;AAAA,UACb,OAAO,OAAO;AAAA,UACd,GAAI,aACD,OACC,SACF,KAAK;AAAA,YACH,CAAC,oBACE,cAAc,WAAW,WAAW,SAAS,GAC9C,OACA,SAAS;AAAA,UACb;AAAA,UACF,GAAI,OAAO,UAAU,EAAE,QAAQ,OAAO,OAAO;AAAA,UAC7C,GAAI,OAAO,QAAQ,EAAE,MAAM,OAAO,MAAM,OAAO,OAAO,MAAM;AAAA,QAC9D;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,WAAW,eAAe;AAAA,EACrC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;AC9DA,YAAY,WAAW;AAEvB,IAAM,oBAAoB;AAEnB,SAAS,cAAc;AAC5B,QAAM,CAAC,UAAU,WAAW,IAAU;AAAA,IACpC;AAAA,EACF;AAEA,EAAM,gBAAU,MAAM;AACpB,UAAM,MAAM,OAAO,WAAW,eAAe,oBAAoB,CAAC,KAAK;AACvE,UAAM,WAAW,MAAM;AACrB,kBAAY,OAAO,aAAa,iBAAiB;AAAA,IACnD;AACA,QAAI,iBAAiB,UAAU,QAAQ;AACvC,gBAAY,OAAO,aAAa,iBAAiB;AACjD,WAAO,MAAM,IAAI,oBAAoB,UAAU,QAAQ;AAAA,EACzD,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,CAAC;AACX;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { DEFAULT_LANGUAGE, LOCALE_INPUT_DEFAULT, LOCALE_OPTIONAL_INPUT_SCHEMA, LOCALE_REQUIRED_INPUT_SCHEMA, Locale, LocaleKey, SUPPORTED_LANGUAGES, Translation, createLocalInputSchema, createLocalRequiredInputSchema } from './lib/locale.js';
|
|
1
2
|
export { REQUIRED_THEME_VARS, THEME_VAR_NAMES, ThemeValidation, ThemeVarName, validateTheme } from './lib/theme-schema.js';
|
|
2
3
|
export { cn } from './lib/utils.js';
|
|
4
|
+
import 'zod';
|
|
3
5
|
import 'clsx';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
// src/lib/locale.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var DEFAULT_LANGUAGE = "en";
|
|
4
|
+
var SUPPORTED_LANGUAGES = [
|
|
5
|
+
{ value: "en", label: "English", key: "En" },
|
|
6
|
+
{ value: "am", label: "\u12A0\u121B\u122D\u129B", key: "\u12A0\u121B" },
|
|
7
|
+
{ value: "ar", label: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", key: "\u0627\u0644" }
|
|
8
|
+
];
|
|
9
|
+
var LOCALE_INPUT_DEFAULT = Object.fromEntries(
|
|
10
|
+
SUPPORTED_LANGUAGES.map(({ value }) => [value, ""])
|
|
11
|
+
);
|
|
12
|
+
function createLocalInputSchema(defaultValidation, otherValidation) {
|
|
13
|
+
const schemaDefinition = SUPPORTED_LANGUAGES.reduce((acc, { value }) => {
|
|
14
|
+
acc[value] = value === DEFAULT_LANGUAGE ? defaultValidation : otherValidation;
|
|
15
|
+
return acc;
|
|
16
|
+
}, {});
|
|
17
|
+
return z.object(schemaDefinition);
|
|
18
|
+
}
|
|
19
|
+
function createLocalRequiredInputSchema(validation) {
|
|
20
|
+
const schemaDefinition = SUPPORTED_LANGUAGES.reduce((acc, { value }) => {
|
|
21
|
+
acc[value] = validation;
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
return z.object(schemaDefinition).superRefine((data, ctx) => {
|
|
25
|
+
const hasValue = Object.values(data).some(
|
|
26
|
+
(value) => typeof value === "string" && value.trim().length > 0
|
|
27
|
+
);
|
|
28
|
+
if (!hasValue) {
|
|
29
|
+
for (const { value } of SUPPORTED_LANGUAGES) {
|
|
30
|
+
ctx.addIssue({
|
|
31
|
+
code: z.ZodIssueCode.custom,
|
|
32
|
+
message: "field is required",
|
|
33
|
+
path: [value]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var LOCALE_REQUIRED_INPUT_SCHEMA = createLocalRequiredInputSchema(
|
|
40
|
+
z.string().optional()
|
|
41
|
+
);
|
|
42
|
+
var LOCALE_OPTIONAL_INPUT_SCHEMA = createLocalInputSchema(
|
|
43
|
+
z.string().optional(),
|
|
44
|
+
z.string().optional()
|
|
45
|
+
);
|
|
46
|
+
|
|
1
47
|
// src/lib/theme-schema.ts
|
|
2
48
|
var SHADE_KEYS = [
|
|
3
49
|
50,
|
|
@@ -95,9 +141,16 @@ function cn(...inputs) {
|
|
|
95
141
|
return twMerge(clsx(inputs));
|
|
96
142
|
}
|
|
97
143
|
export {
|
|
144
|
+
DEFAULT_LANGUAGE,
|
|
145
|
+
LOCALE_INPUT_DEFAULT,
|
|
146
|
+
LOCALE_OPTIONAL_INPUT_SCHEMA,
|
|
147
|
+
LOCALE_REQUIRED_INPUT_SCHEMA,
|
|
98
148
|
REQUIRED_THEME_VARS,
|
|
149
|
+
SUPPORTED_LANGUAGES,
|
|
99
150
|
THEME_VAR_NAMES,
|
|
100
151
|
cn,
|
|
152
|
+
createLocalInputSchema,
|
|
153
|
+
createLocalRequiredInputSchema,
|
|
101
154
|
validateTheme
|
|
102
155
|
};
|
|
103
156
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/theme-schema.ts","../src/lib/utils.ts"],"sourcesContent":["/**\n * Canonical theme variable names for consumer theme (theme.css or generateTheme).\n * UI components depend on these CSS vars; consumer defines them.\n */\n\nconst SHADE_KEYS = [\n 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950,\n] as const;\n\nexport const THEME_VAR_NAMES = [\n '--background',\n '--foreground',\n '--card',\n '--card-foreground',\n '--popover',\n '--popover-foreground',\n '--primary',\n '--primary-foreground',\n ...SHADE_KEYS.map((s) => `--primary-${s}`),\n '--secondary',\n '--secondary-foreground',\n ...SHADE_KEYS.map((s) => `--secondary-${s}`),\n '--accent',\n '--accent-foreground',\n ...SHADE_KEYS.map((s) => `--accent-${s}`),\n '--muted',\n '--muted-foreground',\n '--destructive',\n '--destructive-foreground',\n '--border',\n '--input',\n '--ring',\n '--chart-1',\n '--chart-2',\n '--chart-3',\n '--chart-4',\n '--chart-5',\n '--radius',\n '--spacing',\n '--sidebar',\n '--sidebar-foreground',\n '--sidebar-primary',\n '--sidebar-primary-foreground',\n '--sidebar-accent',\n '--sidebar-accent-foreground',\n '--sidebar-active',\n '--sidebar-border',\n '--sidebar-ring',\n '--overlay',\n] as const;\n\nexport type ThemeVarName = (typeof THEME_VAR_NAMES)[number];\n\nconst THEME_VAR_SET = new Set<string>(THEME_VAR_NAMES);\n\n/** Vars that a minimal theme (e.g. generateTheme) should provide for primary/secondary/accent. */\nexport const REQUIRED_THEME_VARS: readonly string[] = [\n '--primary',\n '--primary-foreground',\n ...SHADE_KEYS.map((s) => `--primary-${s}`),\n '--secondary',\n '--secondary-foreground',\n ...SHADE_KEYS.map((s) => `--secondary-${s}`),\n '--accent',\n '--accent-foreground',\n ...SHADE_KEYS.map((s) => `--accent-${s}`),\n '--radius',\n '--spacing',\n];\n\nexport type ThemeValidation = {\n valid: boolean;\n unknown: string[];\n missing: string[];\n};\n\n/**\n * Validates a theme object against the consumer theme contract.\n * - unknown: keys not in THEME_VAR_NAMES (typos / unsupported).\n * - missing: required vars absent (for full theme override).\n */\nexport function validateTheme(theme: Record<string, string>): ThemeValidation {\n const keys = new Set(Object.keys(theme));\n const unknown: string[] = [];\n const missing: string[] = [];\n\n for (const key of keys) {\n if (!THEME_VAR_SET.has(key)) {\n unknown.push(key);\n }\n }\n for (const key of REQUIRED_THEME_VARS) {\n if (!keys.has(key)) {\n missing.push(key);\n }\n }\n\n return {\n valid: unknown.length === 0 && missing.length === 0,\n unknown,\n missing,\n };\n}\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/lib/locale.ts","../src/lib/theme-schema.ts","../src/lib/utils.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport type LocaleKey = 'am' | 'en' | 'om' | 'ti' | 'so' | 'sw' | 'fr' | 'ar';\n\nexport type Locale = {\n [key in LocaleKey | string]?: string;\n};\n\nexport type Translation = (key: string) => string;\n\nexport const DEFAULT_LANGUAGE = 'en';\n\nexport const SUPPORTED_LANGUAGES = [\n { value: 'en', label: 'English', key: 'En' },\n { value: 'am', label: 'አማርኛ', key: 'አማ' },\n { value: 'ar', label: 'العربية', key: 'ال' },\n];\n\nexport const LOCALE_INPUT_DEFAULT = Object.fromEntries(\n SUPPORTED_LANGUAGES.map(({ value }) => [value, '']),\n);\n\ntype SchemaAccumulator = {\n [key: string]: z.ZodTypeAny;\n};\n\nexport function createLocalInputSchema(\n defaultValidation: z.ZodTypeAny,\n otherValidation: z.ZodTypeAny,\n): z.ZodObject<SchemaAccumulator> {\n const schemaDefinition: { [key: string]: z.ZodTypeAny } =\n SUPPORTED_LANGUAGES.reduce((acc: SchemaAccumulator, { value }) => {\n acc[value] =\n value === DEFAULT_LANGUAGE ? defaultValidation : otherValidation;\n return acc;\n }, {});\n\n return z.object(schemaDefinition);\n}\n\nexport function createLocalRequiredInputSchema(\n validation: z.ZodTypeAny,\n): z.ZodEffects<z.ZodObject<SchemaAccumulator>> {\n const schemaDefinition: { [key: string]: z.ZodTypeAny } =\n SUPPORTED_LANGUAGES.reduce((acc: SchemaAccumulator, { value }) => {\n acc[value] = validation;\n return acc;\n }, {});\n\n return z.object(schemaDefinition).superRefine((data, ctx) => {\n const hasValue = Object.values(data).some(\n (value) => typeof value === 'string' && value.trim().length > 0,\n );\n\n if (!hasValue) {\n for (const { value } of SUPPORTED_LANGUAGES) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'field is required',\n path: [value],\n });\n }\n }\n });\n}\n\nexport const LOCALE_REQUIRED_INPUT_SCHEMA = createLocalRequiredInputSchema(\n z.string().optional(),\n);\n\nexport const LOCALE_OPTIONAL_INPUT_SCHEMA = createLocalInputSchema(\n z.string().optional(),\n z.string().optional(),\n);\n","/**\n * Canonical theme variable names for consumer theme (theme.css or generateTheme).\n * UI components depend on these CSS vars; consumer defines them.\n */\n\nconst SHADE_KEYS = [\n 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950,\n] as const;\n\nexport const THEME_VAR_NAMES = [\n '--background',\n '--foreground',\n '--card',\n '--card-foreground',\n '--popover',\n '--popover-foreground',\n '--primary',\n '--primary-foreground',\n ...SHADE_KEYS.map((s) => `--primary-${s}`),\n '--secondary',\n '--secondary-foreground',\n ...SHADE_KEYS.map((s) => `--secondary-${s}`),\n '--accent',\n '--accent-foreground',\n ...SHADE_KEYS.map((s) => `--accent-${s}`),\n '--muted',\n '--muted-foreground',\n '--destructive',\n '--destructive-foreground',\n '--border',\n '--input',\n '--ring',\n '--chart-1',\n '--chart-2',\n '--chart-3',\n '--chart-4',\n '--chart-5',\n '--radius',\n '--spacing',\n '--sidebar',\n '--sidebar-foreground',\n '--sidebar-primary',\n '--sidebar-primary-foreground',\n '--sidebar-accent',\n '--sidebar-accent-foreground',\n '--sidebar-active',\n '--sidebar-border',\n '--sidebar-ring',\n '--overlay',\n] as const;\n\nexport type ThemeVarName = (typeof THEME_VAR_NAMES)[number];\n\nconst THEME_VAR_SET = new Set<string>(THEME_VAR_NAMES);\n\n/** Vars that a minimal theme (e.g. generateTheme) should provide for primary/secondary/accent. */\nexport const REQUIRED_THEME_VARS: readonly string[] = [\n '--primary',\n '--primary-foreground',\n ...SHADE_KEYS.map((s) => `--primary-${s}`),\n '--secondary',\n '--secondary-foreground',\n ...SHADE_KEYS.map((s) => `--secondary-${s}`),\n '--accent',\n '--accent-foreground',\n ...SHADE_KEYS.map((s) => `--accent-${s}`),\n '--radius',\n '--spacing',\n];\n\nexport type ThemeValidation = {\n valid: boolean;\n unknown: string[];\n missing: string[];\n};\n\n/**\n * Validates a theme object against the consumer theme contract.\n * - unknown: keys not in THEME_VAR_NAMES (typos / unsupported).\n * - missing: required vars absent (for full theme override).\n */\nexport function validateTheme(theme: Record<string, string>): ThemeValidation {\n const keys = new Set(Object.keys(theme));\n const unknown: string[] = [];\n const missing: string[] = [];\n\n for (const key of keys) {\n if (!THEME_VAR_SET.has(key)) {\n unknown.push(key);\n }\n }\n for (const key of REQUIRED_THEME_VARS) {\n if (!keys.has(key)) {\n missing.push(key);\n }\n }\n\n return {\n valid: unknown.length === 0 && missing.length === 0,\n unknown,\n missing,\n };\n}\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
type LocaleKey = 'am' | 'en' | 'om' | 'ti' | 'so' | 'sw' | 'fr' | 'ar';
|
|
4
|
+
type Locale = {
|
|
5
|
+
[key in LocaleKey | string]?: string;
|
|
6
|
+
};
|
|
7
|
+
type Translation = (key: string) => string;
|
|
8
|
+
declare const DEFAULT_LANGUAGE = "en";
|
|
9
|
+
declare const SUPPORTED_LANGUAGES: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}[];
|
|
14
|
+
declare const LOCALE_INPUT_DEFAULT: {
|
|
15
|
+
[k: string]: string;
|
|
16
|
+
};
|
|
17
|
+
type SchemaAccumulator = {
|
|
18
|
+
[key: string]: z.ZodTypeAny;
|
|
19
|
+
};
|
|
20
|
+
declare function createLocalInputSchema(defaultValidation: z.ZodTypeAny, otherValidation: z.ZodTypeAny): z.ZodObject<SchemaAccumulator>;
|
|
21
|
+
declare function createLocalRequiredInputSchema(validation: z.ZodTypeAny): z.ZodEffects<z.ZodObject<SchemaAccumulator>>;
|
|
22
|
+
declare const LOCALE_REQUIRED_INPUT_SCHEMA: z.ZodEffects<z.ZodObject<SchemaAccumulator, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}, {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
}>, {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
}, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}>;
|
|
31
|
+
declare const LOCALE_OPTIONAL_INPUT_SCHEMA: z.ZodObject<SchemaAccumulator, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
}, {
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
export { DEFAULT_LANGUAGE, LOCALE_INPUT_DEFAULT, LOCALE_OPTIONAL_INPUT_SCHEMA, LOCALE_REQUIRED_INPUT_SCHEMA, type Locale, type LocaleKey, SUPPORTED_LANGUAGES, type Translation, createLocalInputSchema, createLocalRequiredInputSchema };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// src/lib/locale.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var DEFAULT_LANGUAGE = "en";
|
|
4
|
+
var SUPPORTED_LANGUAGES = [
|
|
5
|
+
{ value: "en", label: "English", key: "En" },
|
|
6
|
+
{ value: "am", label: "\u12A0\u121B\u122D\u129B", key: "\u12A0\u121B" },
|
|
7
|
+
{ value: "ar", label: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", key: "\u0627\u0644" }
|
|
8
|
+
];
|
|
9
|
+
var LOCALE_INPUT_DEFAULT = Object.fromEntries(
|
|
10
|
+
SUPPORTED_LANGUAGES.map(({ value }) => [value, ""])
|
|
11
|
+
);
|
|
12
|
+
function createLocalInputSchema(defaultValidation, otherValidation) {
|
|
13
|
+
const schemaDefinition = SUPPORTED_LANGUAGES.reduce((acc, { value }) => {
|
|
14
|
+
acc[value] = value === DEFAULT_LANGUAGE ? defaultValidation : otherValidation;
|
|
15
|
+
return acc;
|
|
16
|
+
}, {});
|
|
17
|
+
return z.object(schemaDefinition);
|
|
18
|
+
}
|
|
19
|
+
function createLocalRequiredInputSchema(validation) {
|
|
20
|
+
const schemaDefinition = SUPPORTED_LANGUAGES.reduce((acc, { value }) => {
|
|
21
|
+
acc[value] = validation;
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
return z.object(schemaDefinition).superRefine((data, ctx) => {
|
|
25
|
+
const hasValue = Object.values(data).some(
|
|
26
|
+
(value) => typeof value === "string" && value.trim().length > 0
|
|
27
|
+
);
|
|
28
|
+
if (!hasValue) {
|
|
29
|
+
for (const { value } of SUPPORTED_LANGUAGES) {
|
|
30
|
+
ctx.addIssue({
|
|
31
|
+
code: z.ZodIssueCode.custom,
|
|
32
|
+
message: "field is required",
|
|
33
|
+
path: [value]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var LOCALE_REQUIRED_INPUT_SCHEMA = createLocalRequiredInputSchema(
|
|
40
|
+
z.string().optional()
|
|
41
|
+
);
|
|
42
|
+
var LOCALE_OPTIONAL_INPUT_SCHEMA = createLocalInputSchema(
|
|
43
|
+
z.string().optional(),
|
|
44
|
+
z.string().optional()
|
|
45
|
+
);
|
|
46
|
+
export {
|
|
47
|
+
DEFAULT_LANGUAGE,
|
|
48
|
+
LOCALE_INPUT_DEFAULT,
|
|
49
|
+
LOCALE_OPTIONAL_INPUT_SCHEMA,
|
|
50
|
+
LOCALE_REQUIRED_INPUT_SCHEMA,
|
|
51
|
+
SUPPORTED_LANGUAGES,
|
|
52
|
+
createLocalInputSchema,
|
|
53
|
+
createLocalRequiredInputSchema
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/locale.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport type LocaleKey = 'am' | 'en' | 'om' | 'ti' | 'so' | 'sw' | 'fr' | 'ar';\n\nexport type Locale = {\n [key in LocaleKey | string]?: string;\n};\n\nexport type Translation = (key: string) => string;\n\nexport const DEFAULT_LANGUAGE = 'en';\n\nexport const SUPPORTED_LANGUAGES = [\n { value: 'en', label: 'English', key: 'En' },\n { value: 'am', label: 'አማርኛ', key: 'አማ' },\n { value: 'ar', label: 'العربية', key: 'ال' },\n];\n\nexport const LOCALE_INPUT_DEFAULT = Object.fromEntries(\n SUPPORTED_LANGUAGES.map(({ value }) => [value, '']),\n);\n\ntype SchemaAccumulator = {\n [key: string]: z.ZodTypeAny;\n};\n\nexport function createLocalInputSchema(\n defaultValidation: z.ZodTypeAny,\n otherValidation: z.ZodTypeAny,\n): z.ZodObject<SchemaAccumulator> {\n const schemaDefinition: { [key: string]: z.ZodTypeAny } =\n SUPPORTED_LANGUAGES.reduce((acc: SchemaAccumulator, { value }) => {\n acc[value] =\n value === DEFAULT_LANGUAGE ? defaultValidation : otherValidation;\n return acc;\n }, {});\n\n return z.object(schemaDefinition);\n}\n\nexport function createLocalRequiredInputSchema(\n validation: z.ZodTypeAny,\n): z.ZodEffects<z.ZodObject<SchemaAccumulator>> {\n const schemaDefinition: { [key: string]: z.ZodTypeAny } =\n SUPPORTED_LANGUAGES.reduce((acc: SchemaAccumulator, { value }) => {\n acc[value] = validation;\n return acc;\n }, {});\n\n return z.object(schemaDefinition).superRefine((data, ctx) => {\n const hasValue = Object.values(data).some(\n (value) => typeof value === 'string' && value.trim().length > 0,\n );\n\n if (!hasValue) {\n for (const { value } of SUPPORTED_LANGUAGES) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'field is required',\n path: [value],\n });\n }\n }\n });\n}\n\nexport const LOCALE_REQUIRED_INPUT_SCHEMA = createLocalRequiredInputSchema(\n z.string().optional(),\n);\n\nexport const LOCALE_OPTIONAL_INPUT_SCHEMA = createLocalInputSchema(\n z.string().optional(),\n z.string().optional(),\n);\n"],"mappings":";AAAA,SAAS,SAAS;AAUX,IAAM,mBAAmB;AAEzB,IAAM,sBAAsB;AAAA,EACjC,EAAE,OAAO,MAAM,OAAO,WAAW,KAAK,KAAK;AAAA,EAC3C,EAAE,OAAO,MAAM,OAAO,4BAAQ,KAAK,eAAK;AAAA,EACxC,EAAE,OAAO,MAAM,OAAO,8CAAW,KAAK,eAAK;AAC7C;AAEO,IAAM,uBAAuB,OAAO;AAAA,EACzC,oBAAoB,IAAI,CAAC,EAAE,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;AACpD;AAMO,SAAS,uBACd,mBACA,iBACgC;AAChC,QAAM,mBACJ,oBAAoB,OAAO,CAAC,KAAwB,EAAE,MAAM,MAAM;AAChE,QAAI,KAAK,IACP,UAAU,mBAAmB,oBAAoB;AACnD,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAEP,SAAO,EAAE,OAAO,gBAAgB;AAClC;AAEO,SAAS,+BACd,YAC8C;AAC9C,QAAM,mBACJ,oBAAoB,OAAO,CAAC,KAAwB,EAAE,MAAM,MAAM;AAChE,QAAI,KAAK,IAAI;AACb,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAEP,SAAO,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAC,MAAM,QAAQ;AAC3D,UAAM,WAAW,OAAO,OAAO,IAAI,EAAE;AAAA,MACnC,CAAC,UAAU,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,SAAS;AAAA,IAChE;AAEA,QAAI,CAAC,UAAU;AACb,iBAAW,EAAE,MAAM,KAAK,qBAAqB;AAC3C,YAAI,SAAS;AAAA,UACX,MAAM,EAAE,aAAa;AAAA,UACrB,SAAS;AAAA,UACT,MAAM,CAAC,KAAK;AAAA,QACd,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,IAAM,+BAA+B;AAAA,EAC1C,EAAE,OAAO,EAAE,SAAS;AACtB;AAEO,IAAM,+BAA+B;AAAA,EAC1C,EAAE,OAAO,EAAE,SAAS;AAAA,EACpB,EAAE,OAAO,EAAE,SAAS;AACtB;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { createNavigation } from 'next-intl/navigation';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
type Navigation = ReturnType<typeof createNavigation>;
|
|
6
|
+
type MesobContextValue = {
|
|
7
|
+
navigation: Navigation;
|
|
8
|
+
linkComponent: Navigation['Link'];
|
|
9
|
+
locale: string;
|
|
10
|
+
t?: (key: string, params?: Record<string, string | number>) => string;
|
|
11
|
+
};
|
|
12
|
+
type MesobProviderProps = {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
routing: Parameters<typeof createNavigation>[0];
|
|
15
|
+
linkComponent?: Navigation['Link'];
|
|
16
|
+
};
|
|
17
|
+
declare function MesobProvider({ children, routing, linkComponent: linkComponentProp, }: MesobProviderProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function useMesob(): MesobContextValue | null;
|
|
19
|
+
|
|
20
|
+
export { MesobProvider, type MesobProviderProps, useMesob };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/provider/mesob-provider.tsx
|
|
2
|
+
import { useLocale } from "next-intl";
|
|
3
|
+
import { createNavigation } from "next-intl/navigation";
|
|
4
|
+
import { createContext, useContext, useMemo } from "react";
|
|
5
|
+
|
|
6
|
+
// src/components/ui/tooltip.tsx
|
|
7
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
8
|
+
|
|
9
|
+
// src/lib/utils.ts
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { twMerge } from "tailwind-merge";
|
|
12
|
+
|
|
13
|
+
// src/components/ui/tooltip.tsx
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
function TooltipProvider({
|
|
16
|
+
delayDuration = 0,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
TooltipPrimitive.Provider,
|
|
21
|
+
{
|
|
22
|
+
"data-slot": "tooltip-provider",
|
|
23
|
+
delayDuration,
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/provider/mesob-provider.tsx
|
|
30
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
31
|
+
var MesobContext = createContext(null);
|
|
32
|
+
var MESOB_ERR = "[MesobProvider]";
|
|
33
|
+
function MesobProvider({
|
|
34
|
+
children,
|
|
35
|
+
routing,
|
|
36
|
+
linkComponent: linkComponentProp
|
|
37
|
+
}) {
|
|
38
|
+
if (!routing) {
|
|
39
|
+
throw new Error(`${MESOB_ERR} routing is required`);
|
|
40
|
+
}
|
|
41
|
+
const locale = useLocale();
|
|
42
|
+
const navigation = useMemo(() => createNavigation(routing), [routing]);
|
|
43
|
+
const value = useMemo(() => {
|
|
44
|
+
const linkComponent = linkComponentProp ?? navigation?.Link;
|
|
45
|
+
if (!linkComponent) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`${MESOB_ERR} linkComponent or valid createNavigation required`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return { navigation, linkComponent, locale };
|
|
51
|
+
}, [navigation, linkComponentProp, locale]);
|
|
52
|
+
return /* @__PURE__ */ jsx2(MesobContext.Provider, { value, children: /* @__PURE__ */ jsx2(TooltipProvider, { delayDuration: 0, children }) });
|
|
53
|
+
}
|
|
54
|
+
function useMesob() {
|
|
55
|
+
return useContext(MesobContext);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
MesobProvider,
|
|
59
|
+
useMesob
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/provider/mesob-provider.tsx","../src/components/ui/tooltip.tsx","../src/lib/utils.ts"],"sourcesContent":["'use client';\n\nimport { useLocale } from 'next-intl';\nimport { createNavigation } from 'next-intl/navigation';\nimport { createContext, type ReactNode, useContext, useMemo } from 'react';\nimport { TooltipProvider } from '../components/ui/tooltip';\n\ntype Navigation = ReturnType<typeof createNavigation>;\n\ntype MesobContextValue = {\n navigation: Navigation;\n linkComponent: Navigation['Link'];\n locale: string;\n t?: (key: string, params?: Record<string, string | number>) => string;\n};\n\nconst MesobContext = createContext<MesobContextValue | null>(null);\n\nconst MESOB_ERR = '[MesobProvider]';\n\nexport type MesobProviderProps = {\n children: ReactNode;\n routing: Parameters<typeof createNavigation>[0];\n linkComponent?: Navigation['Link'];\n};\n\nexport function MesobProvider({\n children,\n routing,\n linkComponent: linkComponentProp,\n}: MesobProviderProps) {\n if (!routing) {\n throw new Error(`${MESOB_ERR} routing is required`);\n }\n\n const locale = useLocale();\n const navigation = useMemo(() => createNavigation(routing), [routing]);\n\n const value = useMemo(() => {\n const linkComponent = linkComponentProp ?? navigation?.Link;\n if (!linkComponent) {\n throw new Error(\n `${MESOB_ERR} linkComponent or valid createNavigation required`,\n );\n }\n return { navigation, linkComponent, locale };\n }, [navigation, linkComponentProp, locale]);\n\n return (\n <MesobContext.Provider value={value}>\n <TooltipProvider delayDuration={0}>{children}</TooltipProvider>\n </MesobContext.Provider>\n );\n}\n\nexport function useMesob(): MesobContextValue | null {\n return useContext(MesobContext);\n}\n","'use client';\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport type * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props}>\n {children}\n </TooltipPrimitive.Root>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n className,\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";AAEA,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AACjC,SAAS,eAA+B,YAAY,eAAe;;;ACFnE,YAAY,sBAAsB;;;ACFlC,SAA0B,YAAY;AACtC,SAAS,eAAe;;;ADUpB,cAiCE,YAjCF;AALJ,SAAS,gBAAgB;AAAA,EACvB,gBAAgB;AAAA,EAChB,GAAG;AACL,GAA2D;AACzD,SACE;AAAA,IAAkB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;;;ADiCM,gBAAAA,YAAA;AAlCN,IAAM,eAAe,cAAwC,IAAI;AAEjE,IAAM,YAAY;AAQX,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAAuB;AACrB,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,GAAG,SAAS,sBAAsB;AAAA,EACpD;AAEA,QAAM,SAAS,UAAU;AACzB,QAAM,aAAa,QAAQ,MAAM,iBAAiB,OAAO,GAAG,CAAC,OAAO,CAAC;AAErE,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,gBAAgB,qBAAqB,YAAY;AACvD,QAAI,CAAC,eAAe;AAClB,YAAM,IAAI;AAAA,QACR,GAAG,SAAS;AAAA,MACd;AAAA,IACF;AACA,WAAO,EAAE,YAAY,eAAe,OAAO;AAAA,EAC7C,GAAG,CAAC,YAAY,mBAAmB,MAAM,CAAC;AAE1C,SACE,gBAAAA,KAAC,aAAa,UAAb,EAAsB,OACrB,0BAAAA,KAAC,mBAAgB,eAAe,GAAI,UAAS,GAC/C;AAEJ;AAEO,SAAS,WAAqC;AACnD,SAAO,WAAW,YAAY;AAChC;","names":["jsx"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as nuqs from 'nuqs';
|
|
2
|
+
|
|
3
|
+
type PaginationData = {
|
|
4
|
+
items: unknown[];
|
|
5
|
+
total?: number | string | null;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
};
|
|
8
|
+
declare function useEntityPagination({ items, total, pageSize, }: PaginationData): {
|
|
9
|
+
total: number;
|
|
10
|
+
pageCount: number;
|
|
11
|
+
hasData: boolean;
|
|
12
|
+
isEmpty: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type EntityParamsConfig = {
|
|
16
|
+
searchKey?: string;
|
|
17
|
+
searchParamName?: string;
|
|
18
|
+
defaultSort?: string;
|
|
19
|
+
defaultOrder?: 'asc' | 'desc';
|
|
20
|
+
defaultPageSize?: number;
|
|
21
|
+
};
|
|
22
|
+
declare function useEntityParams(config?: EntityParamsConfig): {
|
|
23
|
+
params: nuqs.Values<{
|
|
24
|
+
view: Omit<nuqs.SingleParserBuilder<string>, "parseServerSide"> & {
|
|
25
|
+
readonly defaultValue: string;
|
|
26
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
27
|
+
};
|
|
28
|
+
page: Omit<nuqs.SingleParserBuilder<number>, "parseServerSide"> & {
|
|
29
|
+
readonly defaultValue: number;
|
|
30
|
+
parseServerSide(value: string | string[] | undefined): number;
|
|
31
|
+
};
|
|
32
|
+
pageSize: Omit<nuqs.SingleParserBuilder<number>, "parseServerSide"> & {
|
|
33
|
+
readonly defaultValue: number;
|
|
34
|
+
parseServerSide(value: string | string[] | undefined): number;
|
|
35
|
+
};
|
|
36
|
+
filter: nuqs.SingleParserBuilder<string>;
|
|
37
|
+
sort: Omit<nuqs.SingleParserBuilder<string>, "parseServerSide"> & {
|
|
38
|
+
readonly defaultValue: string;
|
|
39
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
40
|
+
};
|
|
41
|
+
order: Omit<nuqs.SingleParserBuilder<string>, "parseServerSide"> & {
|
|
42
|
+
readonly defaultValue: string;
|
|
43
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
setParams: nuqs.SetValues<{
|
|
47
|
+
view: Omit<nuqs.SingleParserBuilder<string>, "parseServerSide"> & {
|
|
48
|
+
readonly defaultValue: string;
|
|
49
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
50
|
+
};
|
|
51
|
+
page: Omit<nuqs.SingleParserBuilder<number>, "parseServerSide"> & {
|
|
52
|
+
readonly defaultValue: number;
|
|
53
|
+
parseServerSide(value: string | string[] | undefined): number;
|
|
54
|
+
};
|
|
55
|
+
pageSize: Omit<nuqs.SingleParserBuilder<number>, "parseServerSide"> & {
|
|
56
|
+
readonly defaultValue: number;
|
|
57
|
+
parseServerSide(value: string | string[] | undefined): number;
|
|
58
|
+
};
|
|
59
|
+
filter: nuqs.SingleParserBuilder<string>;
|
|
60
|
+
sort: Omit<nuqs.SingleParserBuilder<string>, "parseServerSide"> & {
|
|
61
|
+
readonly defaultValue: string;
|
|
62
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
63
|
+
};
|
|
64
|
+
order: Omit<nuqs.SingleParserBuilder<string>, "parseServerSide"> & {
|
|
65
|
+
readonly defaultValue: string;
|
|
66
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
queryConfig: {
|
|
70
|
+
params: {
|
|
71
|
+
query: {
|
|
72
|
+
sort?: string | undefined;
|
|
73
|
+
order?: string | undefined;
|
|
74
|
+
filter?: string | undefined;
|
|
75
|
+
page: number;
|
|
76
|
+
limit: number;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export { useEntityParams as a, useEntityPagination as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesob/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,34 +10,22 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./components": {
|
|
14
|
+
"types": "./dist/components.d.ts",
|
|
15
|
+
"default": "./dist/components.js"
|
|
16
|
+
},
|
|
17
|
+
"./providers": {
|
|
18
|
+
"types": "./dist/providers.d.ts",
|
|
19
|
+
"default": "./dist/providers.js"
|
|
20
|
+
},
|
|
21
|
+
"./hooks": {
|
|
22
|
+
"types": "./dist/hooks.d.ts",
|
|
23
|
+
"default": "./dist/hooks.js"
|
|
24
|
+
},
|
|
13
25
|
"./postcss.config": "./postcss.config.mjs",
|
|
14
26
|
"./lib/*": {
|
|
15
27
|
"types": "./dist/lib/*.d.ts",
|
|
16
28
|
"default": "./dist/lib/*.js"
|
|
17
|
-
},
|
|
18
|
-
"./components/*": {
|
|
19
|
-
"types": "./dist/components/*.d.ts",
|
|
20
|
-
"default": "./dist/components/*.js"
|
|
21
|
-
},
|
|
22
|
-
"./hooks/*": {
|
|
23
|
-
"types": "./dist/hooks/*.d.ts",
|
|
24
|
-
"default": "./dist/hooks/*.js"
|
|
25
|
-
},
|
|
26
|
-
"./components/data-table": {
|
|
27
|
-
"types": "./dist/components/data-table/index.d.ts",
|
|
28
|
-
"default": "./dist/components/data-table/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./components/entity": {
|
|
31
|
-
"types": "./dist/components/entity/index.d.ts",
|
|
32
|
-
"default": "./dist/components/entity/index.js"
|
|
33
|
-
},
|
|
34
|
-
"./components/page": {
|
|
35
|
-
"types": "./dist/components/page/index.d.ts",
|
|
36
|
-
"default": "./dist/components/page/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./components/section": {
|
|
39
|
-
"types": "./dist/components/section/index.d.ts",
|
|
40
|
-
"default": "./dist/components/section/index.js"
|
|
41
29
|
}
|
|
42
30
|
},
|
|
43
31
|
"files": [
|
|
@@ -71,13 +59,33 @@
|
|
|
71
59
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
72
60
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
73
61
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
62
|
+
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
74
63
|
"@tabler/icons-react": "^3.35.0",
|
|
75
64
|
"@tanstack/react-table": "^8.21.3",
|
|
65
|
+
"@tiptap/core": "^3.18.0",
|
|
66
|
+
"@tiptap/extension-hard-break": "^3.18.0",
|
|
67
|
+
"@tiptap/extension-heading": "^3.18.0",
|
|
68
|
+
"@tiptap/extension-highlight": "^3.18.0",
|
|
69
|
+
"@tiptap/extension-image": "^3.18.0",
|
|
70
|
+
"@tiptap/extension-link": "^3.18.0",
|
|
71
|
+
"@tiptap/extension-placeholder": "^3.18.0",
|
|
72
|
+
"@tiptap/extension-subscript": "^3.18.0",
|
|
73
|
+
"@tiptap/extension-superscript": "^3.18.0",
|
|
74
|
+
"@tiptap/extension-table": "^3.18.0",
|
|
75
|
+
"@tiptap/extension-table-cell": "^3.18.0",
|
|
76
|
+
"@tiptap/extension-table-header": "^3.18.0",
|
|
77
|
+
"@tiptap/extension-table-row": "^3.18.0",
|
|
78
|
+
"@tiptap/extension-text-align": "^3.18.0",
|
|
79
|
+
"@tiptap/extension-underline": "^3.18.0",
|
|
80
|
+
"@tiptap/extension-youtube": "^3.18.0",
|
|
81
|
+
"@tiptap/react": "^3.18.0",
|
|
82
|
+
"@tiptap/starter-kit": "^3.18.0",
|
|
76
83
|
"class-variance-authority": "^0.7.1",
|
|
77
84
|
"clsx": "^2.1.1",
|
|
78
85
|
"cmdk": "^1.1.1",
|
|
79
86
|
"date-fns": "^4.1.0",
|
|
80
87
|
"embla-carousel-react": "^8.6.0",
|
|
88
|
+
"html-react-parser": "^5.2.16",
|
|
81
89
|
"input-otp": "^1.4.2",
|
|
82
90
|
"motion": "^12.23.25",
|
|
83
91
|
"next-themes": "^0.4.6",
|
|
@@ -113,8 +121,7 @@
|
|
|
113
121
|
"access": "public"
|
|
114
122
|
},
|
|
115
123
|
"scripts": {
|
|
116
|
-
"build": "tsup",
|
|
117
|
-
"prebuild": "tsx scripts/generate-exports.ts",
|
|
124
|
+
"build": "tsup && node scripts/prepend-use-client.mjs",
|
|
118
125
|
"dev": "tsup --watch",
|
|
119
126
|
"lint": "biome check --write .",
|
|
120
127
|
"check-types": "tsc --noEmit"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
6
|
-
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): react_jsx_runtime.JSX.Element;
|
|
7
|
-
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
8
|
-
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
9
|
-
|
|
10
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|