@admin-layout/tailwind-ui 12.2.4-alpha.1 → 12.2.4-alpha.15
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/lib/components/ErrorHandlers/RemixErrorBoundary.d.ts.map +1 -1
- package/lib/components/ErrorHandlers/RemixErrorBoundary.js +4 -0
- package/lib/components/ErrorHandlers/RemixErrorBoundary.js.map +1 -1
- package/lib/components/ErrorHandlers/SPAErrorBoundary.d.ts +18 -0
- package/lib/components/ErrorHandlers/SPAErrorBoundary.d.ts.map +1 -0
- package/lib/components/ErrorHandlers/SPAErrorBoundary.js +114 -0
- package/lib/components/ErrorHandlers/SPAErrorBoundary.js.map +1 -0
- package/lib/components/ErrorHandlers/index.d.ts +1 -0
- package/lib/components/ErrorHandlers/index.d.ts.map +1 -1
- package/lib/components/InputToolBar/InputToolBar.d.ts +10 -0
- package/lib/components/InputToolBar/InputToolBar.d.ts.map +1 -0
- package/lib/components/InputToolBar/InputToolBar.js +225 -0
- package/lib/components/InputToolBar/InputToolBar.js.map +1 -0
- package/lib/components/InputToolBar/defaults.d.ts +14 -0
- package/lib/components/InputToolBar/defaults.d.ts.map +1 -0
- package/lib/components/InputToolBar/defaults.js +51 -0
- package/lib/components/InputToolBar/defaults.js.map +1 -0
- package/lib/components/InputToolBar/index.d.ts +5 -0
- package/lib/components/InputToolBar/index.d.ts.map +1 -0
- package/lib/components/InputToolBar/types.d.ts +61 -0
- package/lib/components/InputToolBar/types.d.ts.map +1 -0
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.d.ts.map +1 -1
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.js +6 -2
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.js.map +1 -1
- package/lib/components/OTP/SingleInput.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/shardui/input-otp.d.ts +2 -2
- package/lib/shardui/resizable.d.ts +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemixErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorHandlers/RemixErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"RemixErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorHandlers/RemixErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,sBAwIjC"}
|
|
@@ -29,6 +29,8 @@ function RemixErrorBoundary() {
|
|
|
29
29
|
className: "flex h-16 w-16 items-center justify-center rounded-full bg-red-100"
|
|
30
30
|
}, React.createElement("svg", {
|
|
31
31
|
className: "h-8 w-8 text-red-500",
|
|
32
|
+
width: "32",
|
|
33
|
+
height: "32",
|
|
32
34
|
fill: "none",
|
|
33
35
|
viewBox: "0 0 24 24",
|
|
34
36
|
stroke: "currentColor"
|
|
@@ -97,6 +99,8 @@ function RemixErrorBoundary() {
|
|
|
97
99
|
className: "flex h-16 w-16 items-center justify-center rounded-full bg-red-100"
|
|
98
100
|
}, React.createElement("svg", {
|
|
99
101
|
className: "h-8 w-8 text-red-500",
|
|
102
|
+
width: "32",
|
|
103
|
+
height: "32",
|
|
100
104
|
fill: "none",
|
|
101
105
|
viewBox: "0 0 24 24",
|
|
102
106
|
stroke: "currentColor"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemixErrorBoundary.js","sources":["../../../src/components/ErrorHandlers/RemixErrorBoundary.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAWG;AACH
|
|
1
|
+
{"version":3,"file":"RemixErrorBoundary.js","sources":["../../../src/components/ErrorHandlers/RemixErrorBoundary.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAWG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SPA/Tauri Root ErrorBoundary Component
|
|
4
|
+
*
|
|
5
|
+
* This error boundary is specifically designed for SPA mode (like Tauri apps)
|
|
6
|
+
* where useLoaderData and useNavigate may not be available in error contexts.
|
|
7
|
+
*
|
|
8
|
+
* Key differences from RemixErrorBoundary:
|
|
9
|
+
* - Does NOT use useLoaderData (causes "Cannot useLoaderData in an errorElement" error)
|
|
10
|
+
* - Does NOT use useNavigate (can fail in root error contexts)
|
|
11
|
+
* - Uses window.location.href for navigation instead
|
|
12
|
+
* - Renders complete HTML document (required for root-level error boundaries)
|
|
13
|
+
*
|
|
14
|
+
* Usage in root.tsx:
|
|
15
|
+
* export { SPAErrorBoundary as ErrorBoundary } from '@admin-layout/tailwind-ui';
|
|
16
|
+
*/
|
|
17
|
+
export declare function SPAErrorBoundary(): React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=SPAErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SPAErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorHandlers/SPAErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,sBAoI/B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import*as React from'react';import {useRouteError,isRouteErrorResponse,Meta,Links,Scripts}from'@remix-run/react';import {logger}from'@cdm-logger/client';/**
|
|
2
|
+
* SPA/Tauri Root ErrorBoundary Component
|
|
3
|
+
*
|
|
4
|
+
* This error boundary is specifically designed for SPA mode (like Tauri apps)
|
|
5
|
+
* where useLoaderData and useNavigate may not be available in error contexts.
|
|
6
|
+
*
|
|
7
|
+
* Key differences from RemixErrorBoundary:
|
|
8
|
+
* - Does NOT use useLoaderData (causes "Cannot useLoaderData in an errorElement" error)
|
|
9
|
+
* - Does NOT use useNavigate (can fail in root error contexts)
|
|
10
|
+
* - Uses window.location.href for navigation instead
|
|
11
|
+
* - Renders complete HTML document (required for root-level error boundaries)
|
|
12
|
+
*
|
|
13
|
+
* Usage in root.tsx:
|
|
14
|
+
* export { SPAErrorBoundary as ErrorBoundary } from '@admin-layout/tailwind-ui';
|
|
15
|
+
*/
|
|
16
|
+
function SPAErrorBoundary() {
|
|
17
|
+
const error = useRouteError();
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
logger.error('Root Route Error:', error);
|
|
20
|
+
console.error('Root Route Error:', error);
|
|
21
|
+
}, [error]);
|
|
22
|
+
const handleGoHome = () => {
|
|
23
|
+
// Use direct location change instead of useNavigate to avoid router context issues
|
|
24
|
+
window.location.href = '/';
|
|
25
|
+
};
|
|
26
|
+
if (isRouteErrorResponse(error)) {
|
|
27
|
+
return React.createElement("html", {
|
|
28
|
+
lang: "en"
|
|
29
|
+
}, React.createElement("head", null, React.createElement("meta", {
|
|
30
|
+
charSet: "utf-8"
|
|
31
|
+
}), React.createElement("meta", {
|
|
32
|
+
name: "viewport",
|
|
33
|
+
content: "width=device-width, initial-scale=1"
|
|
34
|
+
}), React.createElement("title", null, error.status, " - ", error.statusText), React.createElement(Meta, null), React.createElement(Links, null)), React.createElement("body", null, React.createElement("div", {
|
|
35
|
+
className: "flex min-h-screen items-center justify-center bg-gray-50 px-4 py-12 sm:px-6 lg:px-8"
|
|
36
|
+
}, React.createElement("div", {
|
|
37
|
+
className: "w-full max-w-md space-y-8 text-center"
|
|
38
|
+
}, React.createElement("div", {
|
|
39
|
+
className: "mb-4 flex justify-center"
|
|
40
|
+
}, React.createElement("div", {
|
|
41
|
+
className: "flex h-16 w-16 items-center justify-center rounded-full bg-red-100"
|
|
42
|
+
}, React.createElement("svg", {
|
|
43
|
+
className: "h-8 w-8 text-red-500",
|
|
44
|
+
width: "32",
|
|
45
|
+
height: "32",
|
|
46
|
+
fill: "none",
|
|
47
|
+
viewBox: "0 0 24 24",
|
|
48
|
+
stroke: "currentColor"
|
|
49
|
+
}, React.createElement("path", {
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round",
|
|
52
|
+
strokeWidth: 2,
|
|
53
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
54
|
+
})))), React.createElement("div", null, React.createElement("h1", {
|
|
55
|
+
className: "text-6xl font-bold text-gray-900"
|
|
56
|
+
}, error.status), React.createElement("h2", {
|
|
57
|
+
className: "mt-2 text-2xl font-bold tracking-tight text-gray-900"
|
|
58
|
+
}, error.statusText), error.data && React.createElement("p", {
|
|
59
|
+
className: "mt-2 text-sm text-gray-600"
|
|
60
|
+
}, error.data)), React.createElement("div", {
|
|
61
|
+
className: "mt-6"
|
|
62
|
+
}, React.createElement("button", {
|
|
63
|
+
onClick: handleGoHome,
|
|
64
|
+
className: "inline-flex items-center rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors"
|
|
65
|
+
}, "Go back home")))), React.createElement(Scripts, null)));
|
|
66
|
+
}
|
|
67
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
68
|
+
const errorStack = error instanceof Error ? error.stack : undefined;
|
|
69
|
+
return React.createElement("html", {
|
|
70
|
+
lang: "en"
|
|
71
|
+
}, React.createElement("head", null, React.createElement("meta", {
|
|
72
|
+
charSet: "utf-8"
|
|
73
|
+
}), React.createElement("meta", {
|
|
74
|
+
name: "viewport",
|
|
75
|
+
content: "width=device-width, initial-scale=1"
|
|
76
|
+
}), React.createElement("title", null, "Application Error"), React.createElement(Meta, null), React.createElement(Links, null)), React.createElement("body", null, React.createElement("div", {
|
|
77
|
+
className: "flex min-h-screen items-center justify-center bg-gray-50 px-4 py-12 sm:px-6 lg:px-8"
|
|
78
|
+
}, React.createElement("div", {
|
|
79
|
+
className: "w-full max-w-2xl space-y-8"
|
|
80
|
+
}, React.createElement("div", {
|
|
81
|
+
className: "mb-4 flex justify-center"
|
|
82
|
+
}, React.createElement("div", {
|
|
83
|
+
className: "flex h-16 w-16 items-center justify-center rounded-full bg-red-100"
|
|
84
|
+
}, React.createElement("svg", {
|
|
85
|
+
className: "h-8 w-8 text-red-500",
|
|
86
|
+
width: "32",
|
|
87
|
+
height: "32",
|
|
88
|
+
fill: "none",
|
|
89
|
+
viewBox: "0 0 24 24",
|
|
90
|
+
stroke: "currentColor"
|
|
91
|
+
}, React.createElement("path", {
|
|
92
|
+
strokeLinecap: "round",
|
|
93
|
+
strokeLinejoin: "round",
|
|
94
|
+
strokeWidth: 2,
|
|
95
|
+
d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
96
|
+
})))), React.createElement("div", {
|
|
97
|
+
className: "text-center"
|
|
98
|
+
}, React.createElement("h1", {
|
|
99
|
+
className: "text-3xl font-bold tracking-tight text-gray-900"
|
|
100
|
+
}, "Application Error"), React.createElement("p", {
|
|
101
|
+
className: "mt-2 text-lg text-red-600"
|
|
102
|
+
}, errorMessage), errorStack && process.env.NODE_ENV !== 'production' && React.createElement("details", {
|
|
103
|
+
className: "mt-4 text-left"
|
|
104
|
+
}, React.createElement("summary", {
|
|
105
|
+
className: "cursor-pointer text-sm font-medium text-gray-700 hover:text-gray-900"
|
|
106
|
+
}, "Stack trace (development only)"), React.createElement("pre", {
|
|
107
|
+
className: "mt-2 overflow-auto rounded-md bg-gray-100 p-4 text-xs text-gray-800 max-h-96"
|
|
108
|
+
}, errorStack))), React.createElement("div", {
|
|
109
|
+
className: "mt-6 text-center"
|
|
110
|
+
}, React.createElement("button", {
|
|
111
|
+
onClick: handleGoHome,
|
|
112
|
+
className: "inline-flex items-center rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors"
|
|
113
|
+
}, "Go back home")))), React.createElement(Scripts, null)));
|
|
114
|
+
}export{SPAErrorBoundary};//# sourceMappingURL=SPAErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SPAErrorBoundary.js","sources":["../../../src/components/ErrorHandlers/SPAErrorBoundary.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAkBG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorHandlers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorHandlers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputToolBarProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* InputToolBar – horizontal toolbar for text input UIs (e.g. chat/composer).
|
|
5
|
+
* Data and behavior are passed via props; items can be enabled/disabled, and custom left/right content can be injected.
|
|
6
|
+
* Layout: left (mode toggles + template pill), flexible middle, right (attach, capture, mic/send).
|
|
7
|
+
*/
|
|
8
|
+
export declare function InputToolBar({ className, leftItems, rightItems, templateButton, leftCustomRender, rightCustomRender, micSendButton, children, }: InputToolBarProps): React.JSX.Element;
|
|
9
|
+
export default InputToolBar;
|
|
10
|
+
//# sourceMappingURL=InputToolBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputToolBar.d.ts","sourceRoot":"","sources":["../../../src/components/InputToolBar/InputToolBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACR,iBAAiB,EAMpB,MAAM,SAAS,CAAC;AAuMjB;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,SAAS,EACT,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACX,EAAE,iBAAiB,qBAgCnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import {Lightbulb,Zap,Search,Mic,Paperclip,Camera,Tag,ArrowUpRight}from'lucide-react';import React__default from'react';import'../../utils/isBrowser/index.js';import {cn}from'../../utils/util.js';import'fast-deep-equal/react.js';const iconSize = 'h-3.5 w-3.5';
|
|
2
|
+
const iconSizeRight = 'h-4 w-4';
|
|
3
|
+
const defaultLeftIconMap = {
|
|
4
|
+
search: React__default.createElement(Search, {
|
|
5
|
+
className: iconSize
|
|
6
|
+
}),
|
|
7
|
+
zap: React__default.createElement(Zap, {
|
|
8
|
+
className: iconSize
|
|
9
|
+
}),
|
|
10
|
+
lightbulb: React__default.createElement(Lightbulb, {
|
|
11
|
+
className: iconSize
|
|
12
|
+
}),
|
|
13
|
+
template: null // template is rendered as pill, not in icon group
|
|
14
|
+
};
|
|
15
|
+
const defaultRightIconMap = {
|
|
16
|
+
tag: React__default.createElement(Tag, {
|
|
17
|
+
className: iconSizeRight
|
|
18
|
+
}),
|
|
19
|
+
chip: React__default.createElement("svg", {
|
|
20
|
+
className: iconSizeRight,
|
|
21
|
+
viewBox: "0 0 24 24",
|
|
22
|
+
fill: "none",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "2",
|
|
25
|
+
strokeLinecap: "round",
|
|
26
|
+
strokeLinejoin: "round",
|
|
27
|
+
"aria-hidden": true
|
|
28
|
+
}, React__default.createElement("rect", {
|
|
29
|
+
x: "4",
|
|
30
|
+
y: "4",
|
|
31
|
+
width: "16",
|
|
32
|
+
height: "16",
|
|
33
|
+
rx: "2",
|
|
34
|
+
ry: "2"
|
|
35
|
+
}), React__default.createElement("line", {
|
|
36
|
+
x1: "9",
|
|
37
|
+
y1: "9",
|
|
38
|
+
x2: "15",
|
|
39
|
+
y2: "9"
|
|
40
|
+
}), React__default.createElement("line", {
|
|
41
|
+
x1: "9",
|
|
42
|
+
y1: "15",
|
|
43
|
+
x2: "15",
|
|
44
|
+
y2: "15"
|
|
45
|
+
}), React__default.createElement("line", {
|
|
46
|
+
x1: "9",
|
|
47
|
+
y1: "9",
|
|
48
|
+
x2: "9",
|
|
49
|
+
y2: "15"
|
|
50
|
+
}), React__default.createElement("line", {
|
|
51
|
+
x1: "15",
|
|
52
|
+
y1: "9",
|
|
53
|
+
x2: "15",
|
|
54
|
+
y2: "15"
|
|
55
|
+
})),
|
|
56
|
+
camera: React__default.createElement(Camera, {
|
|
57
|
+
className: iconSizeRight
|
|
58
|
+
}),
|
|
59
|
+
attach: React__default.createElement(Paperclip, {
|
|
60
|
+
className: iconSizeRight
|
|
61
|
+
}),
|
|
62
|
+
mic: React__default.createElement(Mic, {
|
|
63
|
+
className: iconSizeRight
|
|
64
|
+
})
|
|
65
|
+
};
|
|
66
|
+
function MicSendButton({
|
|
67
|
+
hasContent,
|
|
68
|
+
onSend,
|
|
69
|
+
onMic,
|
|
70
|
+
disabled
|
|
71
|
+
}) {
|
|
72
|
+
const isSend = hasContent;
|
|
73
|
+
const base = 'inline-flex h-7 w-7 items-center justify-center rounded-2xl transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary';
|
|
74
|
+
return React__default.createElement("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
"aria-label": isSend ? 'Send' : 'Start voice input',
|
|
77
|
+
title: isSend ? 'Send' : 'Start voice input',
|
|
78
|
+
onClick: isSend ? onSend : onMic,
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
className: base
|
|
81
|
+
}, isSend ? React__default.createElement(ArrowUpRight, {
|
|
82
|
+
className: iconSizeRight
|
|
83
|
+
}) : React__default.createElement(Mic, {
|
|
84
|
+
className: iconSizeRight
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
function ToolbarIconButton({
|
|
88
|
+
item,
|
|
89
|
+
getDefaultIcon,
|
|
90
|
+
isLeftGroup
|
|
91
|
+
}) {
|
|
92
|
+
if (item.enabled === false) return null;
|
|
93
|
+
const icon = item.customButton ?? item.icon ?? getDefaultIcon(item.id);
|
|
94
|
+
if (item.customButton) {
|
|
95
|
+
return React__default.createElement(React__default.Fragment, null, item.customButton);
|
|
96
|
+
}
|
|
97
|
+
const isActive = item.active === true;
|
|
98
|
+
const base = 'inline-flex h-7 w-7 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:opacity-50 disabled:pointer-events-none';
|
|
99
|
+
const leftVariant = isActive ? 'rounded-full border border-primary bg-primary text-primary-foreground hover:bg-primary/90' : 'rounded-full border border-primary/50 bg-card text-primary hover:border-primary hover:text-primary';
|
|
100
|
+
const rightVariant = 'rounded-2xl text-muted-foreground hover:bg-secondary/70 active:bg-secondary';
|
|
101
|
+
return React__default.createElement("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
"aria-label": item.label,
|
|
104
|
+
title: item.label,
|
|
105
|
+
onClick: item.onClick,
|
|
106
|
+
className: cn(base, isLeftGroup ? leftVariant : rightVariant)
|
|
107
|
+
}, icon);
|
|
108
|
+
}
|
|
109
|
+
function LeftSection({
|
|
110
|
+
leftItems,
|
|
111
|
+
templateButton,
|
|
112
|
+
leftCustomRender
|
|
113
|
+
}) {
|
|
114
|
+
if (leftCustomRender != null) {
|
|
115
|
+
return React__default.createElement("div", {
|
|
116
|
+
className: "flex items-center gap-2"
|
|
117
|
+
}, leftCustomRender);
|
|
118
|
+
}
|
|
119
|
+
const left = leftItems ?? [];
|
|
120
|
+
const hasTemplate = templateButton != null;
|
|
121
|
+
const hasLeft = left.length > 0 || hasTemplate;
|
|
122
|
+
if (!hasLeft) return null;
|
|
123
|
+
return React__default.createElement("div", {
|
|
124
|
+
className: "flex items-center gap-2"
|
|
125
|
+
}, left.length > 0 && React__default.createElement("div", {
|
|
126
|
+
className: "flex items-center gap-1 rounded-full bg-secondary px-2 py-1"
|
|
127
|
+
}, left.map((item, index) => React__default.createElement(React__default.Fragment, {
|
|
128
|
+
key: item.id
|
|
129
|
+
}, React__default.createElement(ToolbarIconButton, {
|
|
130
|
+
item: item,
|
|
131
|
+
getDefaultIcon: id => defaultLeftIconMap[id] ?? null,
|
|
132
|
+
isLeftGroup: true
|
|
133
|
+
}), index < left.length - 1 && React__default.createElement("span", {
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
className: "mx-1 h-5 w-px bg-border/70"
|
|
136
|
+
})))), hasTemplate && React__default.createElement(TemplatePill, {
|
|
137
|
+
label: templateButton.label,
|
|
138
|
+
count: templateButton.count,
|
|
139
|
+
onClick: templateButton.onClick,
|
|
140
|
+
disabled: templateButton.disabled
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
function TemplatePill({
|
|
144
|
+
label,
|
|
145
|
+
count,
|
|
146
|
+
onClick,
|
|
147
|
+
disabled
|
|
148
|
+
}) {
|
|
149
|
+
const text = count != null && count > 0 ? `${label} (${count})` : label;
|
|
150
|
+
return React__default.createElement("button", {
|
|
151
|
+
type: "button",
|
|
152
|
+
onClick: onClick,
|
|
153
|
+
disabled: disabled,
|
|
154
|
+
className: cn('flex items-center gap-1 rounded-full border border-border bg-card px-2 py-1 text-xs font-medium text-foreground transition-colors hover:border-primary hover:bg-primary/5', disabled && 'opacity-50 cursor-not-allowed' || ''),
|
|
155
|
+
"aria-label": "Select template"
|
|
156
|
+
}, text);
|
|
157
|
+
}
|
|
158
|
+
function RightSection({
|
|
159
|
+
rightItems,
|
|
160
|
+
rightCustomRender,
|
|
161
|
+
micSendButton
|
|
162
|
+
}) {
|
|
163
|
+
if (rightCustomRender != null) {
|
|
164
|
+
return React__default.createElement("div", {
|
|
165
|
+
className: "flex items-center gap-1"
|
|
166
|
+
}, rightCustomRender);
|
|
167
|
+
}
|
|
168
|
+
const right = rightItems ?? [];
|
|
169
|
+
const filteredRight = micSendButton != null ? right.filter(item => item.id !== 'mic') : right;
|
|
170
|
+
const hasRight = filteredRight.length > 0 || micSendButton != null;
|
|
171
|
+
if (!hasRight) return null;
|
|
172
|
+
return React__default.createElement("div", {
|
|
173
|
+
className: "flex flex-wrap items-center gap-1 text-muted-foreground"
|
|
174
|
+
}, filteredRight.map(item => React__default.createElement(ToolbarIconButton, {
|
|
175
|
+
key: item.id,
|
|
176
|
+
item: item,
|
|
177
|
+
getDefaultIcon: id => defaultRightIconMap[id] ?? null
|
|
178
|
+
})), micSendButton != null && React__default.createElement(MicSendButton, {
|
|
179
|
+
hasContent: micSendButton.hasContent,
|
|
180
|
+
onSend: micSendButton.onSend,
|
|
181
|
+
onMic: micSendButton.onMic,
|
|
182
|
+
disabled: micSendButton.disabled
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* InputToolBar – horizontal toolbar for text input UIs (e.g. chat/composer).
|
|
187
|
+
* Data and behavior are passed via props; items can be enabled/disabled, and custom left/right content can be injected.
|
|
188
|
+
* Layout: left (mode toggles + template pill), flexible middle, right (attach, capture, mic/send).
|
|
189
|
+
*/
|
|
190
|
+
function InputToolBar({
|
|
191
|
+
className,
|
|
192
|
+
leftItems,
|
|
193
|
+
rightItems,
|
|
194
|
+
templateButton,
|
|
195
|
+
leftCustomRender,
|
|
196
|
+
rightCustomRender,
|
|
197
|
+
micSendButton,
|
|
198
|
+
children
|
|
199
|
+
}) {
|
|
200
|
+
const hasChildren = children != null;
|
|
201
|
+
return React__default.createElement("section", {
|
|
202
|
+
className: cn('w-full overflow-visible rounded-[24px] border border-border/70 bg-card shadow-md', hasChildren && 'cursor-text', className)
|
|
203
|
+
}, React__default.createElement("div", {
|
|
204
|
+
className: cn('flex px-3 py-2', hasChildren ? 'flex-col gap-2' : 'flex-wrap items-center gap-3')
|
|
205
|
+
}, hasChildren && React__default.createElement("div", {
|
|
206
|
+
className: "min-w-0 flex-1"
|
|
207
|
+
}, children), React__default.createElement("div", {
|
|
208
|
+
className: cn('flex flex-wrap items-center gap-3', hasChildren && 'pt-2')
|
|
209
|
+
}, React__default.createElement("div", {
|
|
210
|
+
className: cn('flex items-center gap-2', hasChildren && 'mb-2')
|
|
211
|
+
}, React__default.createElement(LeftSection, {
|
|
212
|
+
leftItems: leftItems,
|
|
213
|
+
templateButton: templateButton,
|
|
214
|
+
leftCustomRender: leftCustomRender
|
|
215
|
+
})), !hasChildren && React__default.createElement("div", {
|
|
216
|
+
className: "min-w-0 flex-1",
|
|
217
|
+
"aria-hidden": true
|
|
218
|
+
}), React__default.createElement("div", {
|
|
219
|
+
className: "flex flex-1 flex-wrap items-center justify-end gap-2"
|
|
220
|
+
}, React__default.createElement(RightSection, {
|
|
221
|
+
rightItems: rightItems,
|
|
222
|
+
rightCustomRender: rightCustomRender,
|
|
223
|
+
micSendButton: micSendButton
|
|
224
|
+
})))));
|
|
225
|
+
}export{InputToolBar,InputToolBar as default};//# sourceMappingURL=InputToolBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputToolBar.js","sources":["../../../src/components/InputToolBar/InputToolBar.tsx"],"sourcesContent":[null],"names":["React"],"mappings":";;;AAqNG,EAAA,MAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACH,IAAA,SAAA,EAAA;AA2CA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LeftToolbarItemId, RightToolbarItemId, ToolbarItemConfig } from './types';
|
|
2
|
+
export type LeftItemOverrides = Partial<Record<LeftToolbarItemId, Partial<Omit<ToolbarItemConfig<LeftToolbarItemId>, 'id'>>>>;
|
|
3
|
+
export type RightItemOverrides = Partial<Record<RightToolbarItemId, Partial<Omit<ToolbarItemConfig<RightToolbarItemId>, 'id'>>>>;
|
|
4
|
+
/**
|
|
5
|
+
* Build default left toolbar items (search, zap, lightbulb). Omit or set enabled: false to hide.
|
|
6
|
+
* Override label, enabled, active, onClick, icon, customButton per id.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDefaultLeftItems(overrides?: LeftItemOverrides): ToolbarItemConfig<LeftToolbarItemId>[];
|
|
9
|
+
/**
|
|
10
|
+
* Build default right toolbar items (tag, chip, camera, attach, mic). Omit or set enabled: false to hide.
|
|
11
|
+
* Override label, enabled, active, onClick, icon, customButton per id.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDefaultRightItems(overrides?: RightItemOverrides): ToolbarItemConfig<RightToolbarItemId>[];
|
|
14
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/components/InputToolBar/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAoBxF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACnC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CACvF,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACpC,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CACzF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,CAazG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,CAa5G"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const DEFAULT_LEFT_IDS = ['search', 'zap', 'lightbulb'];
|
|
2
|
+
const DEFAULT_RIGHT_IDS = ['tag', 'chip', 'camera', 'attach', 'mic'];
|
|
3
|
+
const DEFAULT_LEFT_LABELS = {
|
|
4
|
+
search: 'Chat mode',
|
|
5
|
+
zap: 'Deep Search',
|
|
6
|
+
lightbulb: 'Build mode',
|
|
7
|
+
template: 'Template'
|
|
8
|
+
};
|
|
9
|
+
const DEFAULT_RIGHT_LABELS = {
|
|
10
|
+
tag: 'Tag',
|
|
11
|
+
chip: 'Module',
|
|
12
|
+
camera: 'Capture image',
|
|
13
|
+
attach: 'Attach file',
|
|
14
|
+
mic: 'Mic / Send'
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Build default left toolbar items (search, zap, lightbulb). Omit or set enabled: false to hide.
|
|
18
|
+
* Override label, enabled, active, onClick, icon, customButton per id.
|
|
19
|
+
*/
|
|
20
|
+
function getDefaultLeftItems(overrides) {
|
|
21
|
+
return DEFAULT_LEFT_IDS.map(id => {
|
|
22
|
+
const o = overrides?.[id];
|
|
23
|
+
return {
|
|
24
|
+
id,
|
|
25
|
+
label: o?.label ?? DEFAULT_LEFT_LABELS[id],
|
|
26
|
+
enabled: o?.enabled ?? true,
|
|
27
|
+
active: o?.active,
|
|
28
|
+
onClick: o?.onClick,
|
|
29
|
+
icon: o?.icon,
|
|
30
|
+
customButton: o?.customButton
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build default right toolbar items (tag, chip, camera, attach, mic). Omit or set enabled: false to hide.
|
|
36
|
+
* Override label, enabled, active, onClick, icon, customButton per id.
|
|
37
|
+
*/
|
|
38
|
+
function getDefaultRightItems(overrides) {
|
|
39
|
+
return DEFAULT_RIGHT_IDS.map(id => {
|
|
40
|
+
const o = overrides?.[id];
|
|
41
|
+
return {
|
|
42
|
+
id,
|
|
43
|
+
label: o?.label ?? DEFAULT_RIGHT_LABELS[id],
|
|
44
|
+
enabled: o?.enabled ?? true,
|
|
45
|
+
active: o?.active,
|
|
46
|
+
onClick: o?.onClick,
|
|
47
|
+
icon: o?.icon,
|
|
48
|
+
customButton: o?.customButton
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}export{getDefaultLeftItems,getDefaultRightItems};//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sources":["../../../src/components/InputToolBar/defaults.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAA,gBAAc,GAAA,CAAA,QAAmB,EAAA,KAAA,EAAA,WAAoB,CAAA;AAoBrD,MAAM,0BAA0B,EAAA,MAC5B,EAAA,QAAO,EAAA,QAAA,EAAA,KAAmB,CAAA;AAE9B,MAAM;AAIN,EAAA,MAAA,EAAA,WAAA;;;AAGG,EAAA,QAAA,EAAA;AACH,CAAA;AAeA,MAAA,oBAAA,GAAA;;;AAGG,EAAA,MAAA,EAAA,eAAA;AACH,EAAA,MAAA,EAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { InputToolBar } from './InputToolBar';
|
|
2
|
+
export { getDefaultLeftItems, getDefaultRightItems } from './defaults';
|
|
3
|
+
export type { InputToolBarProps, LeftToolbarItemId, MicSendButtonConfig, RightToolbarItemId, TemplateButtonConfig, ToolbarItemConfig, } from './types';
|
|
4
|
+
export type { LeftItemOverrides, RightItemOverrides } from './defaults';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InputToolBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvE,YAAY,EACR,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,GACpB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Predefined toolbar action ids for left section (mode toggles, template) */
|
|
3
|
+
export type LeftToolbarItemId = 'search' | 'zap' | 'lightbulb' | 'template';
|
|
4
|
+
/** Predefined toolbar action ids for right section (attach, capture, mic/send) */
|
|
5
|
+
export type RightToolbarItemId = 'tag' | 'chip' | 'camera' | 'attach' | 'mic';
|
|
6
|
+
/** Single toolbar button/item configuration */
|
|
7
|
+
export interface ToolbarItemConfig<TId extends string = string> {
|
|
8
|
+
/** Unique id for the item (used for enable/disable and callbacks) */
|
|
9
|
+
id: TId;
|
|
10
|
+
/** Icon (React node) or custom content for the button */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Accessible label / title */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Whether the item is enabled (default true) */
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
/** Whether the item is in active/selected state (dark background in UI) */
|
|
17
|
+
active?: boolean;
|
|
18
|
+
/** Click handler */
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
/** Optional custom button element; when set, icon/label are ignored and this is rendered */
|
|
21
|
+
customButton?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** When provided, the rightmost button shows Send (arrow) when hasContent is true, else Mic. Replaces any "mic" item in rightItems. */
|
|
24
|
+
export interface MicSendButtonConfig {
|
|
25
|
+
/** True when input has content – show send icon; otherwise show mic icon */
|
|
26
|
+
hasContent: boolean;
|
|
27
|
+
onSend: () => void;
|
|
28
|
+
onMic: () => void;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Configuration for the optional "+ Template (N)" pill button */
|
|
32
|
+
export interface TemplateButtonConfig {
|
|
33
|
+
/** Button label prefix, e.g. "+ Template" */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Count to show in parentheses, e.g. (1) */
|
|
36
|
+
count?: number;
|
|
37
|
+
/** Click handler */
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
/** Disabled state */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Props for the InputToolBar container (UI only; data passed via props) */
|
|
43
|
+
export interface InputToolBarProps {
|
|
44
|
+
/** Optional class name for the toolbar container */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Left section: predefined items (search, zap, lightbulb) + optional template pill. Pass enabled: false to hide/disable. */
|
|
47
|
+
leftItems?: Array<ToolbarItemConfig<LeftToolbarItemId>>;
|
|
48
|
+
/** Right section: tag, chip, camera, attach, mic. Pass enabled: false to hide/disable. */
|
|
49
|
+
rightItems?: Array<ToolbarItemConfig<RightToolbarItemId>>;
|
|
50
|
+
/** Optional template pill button config (e.g. "+ Template (1)") */
|
|
51
|
+
templateButton?: TemplateButtonConfig | null;
|
|
52
|
+
/** Custom content to render in the left section instead of leftItems (takes precedence) */
|
|
53
|
+
leftCustomRender?: ReactNode;
|
|
54
|
+
/** Custom content to render in the right section instead of rightItems (takes precedence) */
|
|
55
|
+
rightCustomRender?: ReactNode;
|
|
56
|
+
/** When set, shows Send (arrow) when input has content, else Mic. Replaces "mic" in rightItems. */
|
|
57
|
+
micSendButton?: MicSendButtonConfig | null;
|
|
58
|
+
/** Optional content in the middle (e.g. text input); can be used with or without left/right */
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/InputToolBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;AAE5E,kFAAkF;AAClF,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9E,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IAC1D,qEAAqE;IACrE,EAAE,EAAE,GAAG,CAAC;IACR,yDAAyD;IACzD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,uIAAuI;AACvI,MAAM,WAAW,mBAAmB;IAChC,4EAA4E;IAC5E,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACjC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAC9B,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6HAA6H;IAC7H,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxD,0FAA0F;IAC1F,UAAU,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC1D,mEAAmE;IACnE,cAAc,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,mGAAmG;IACnG,aAAa,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC3C,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageMenuDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageMenuDropdown/LanguageMenuDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,eAAO,MAAM,oBAAoB,GAAI,2BAA2B;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"LanguageMenuDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageMenuDropdown/LanguageMenuDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,eAAO,MAAM,oBAAoB,GAAI,2BAA2B;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAE,sBAuDvG,CAAC"}
|
|
@@ -23,13 +23,17 @@ import React__default,{useState,useEffect}from'react';import {useTranslation}fro
|
|
|
23
23
|
global: true
|
|
24
24
|
});
|
|
25
25
|
useEffect(() => {
|
|
26
|
-
i18n
|
|
26
|
+
if (i18n?.changeLanguage) {
|
|
27
|
+
i18n.changeLanguage(settings.language);
|
|
28
|
+
}
|
|
27
29
|
}, []);
|
|
28
30
|
const handleLanguageChange = value => {
|
|
29
31
|
const language = filteredLanguages.find(lang => lang.key === value);
|
|
30
32
|
if (language) {
|
|
31
33
|
setCurrentLang(language);
|
|
32
|
-
i18n
|
|
34
|
+
if (i18n?.changeLanguage) {
|
|
35
|
+
i18n.changeLanguage(language.key);
|
|
36
|
+
}
|
|
33
37
|
setSettings(settings, {
|
|
34
38
|
language: language.key
|
|
35
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageMenuDropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LanguageMenuDropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const SingleInput: React.ForwardRefExoticComponent<Omit<Required<Pick<React.InputHTMLAttributes<HTMLInputElement>, "value" | "
|
|
2
|
+
export declare const SingleInput: React.ForwardRefExoticComponent<Omit<Required<Pick<React.InputHTMLAttributes<HTMLInputElement>, "value" | "autoComplete" | "inputMode" | "aria-label" | "onPaste" | "onFocus" | "onBlur" | "onChange" | "onInput" | "onKeyDown"> & {
|
|
3
3
|
ref: React.RefCallback<HTMLInputElement>;
|
|
4
4
|
placeholder: string | undefined;
|
|
5
5
|
className: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as PageLoading}from'./components/PageLoading/index.js';export{ApplicationErrorHandler}from'./components/ErrorHandlers/ApplicationErrorHandler.js';export{ErrorBoundary}from'./components/ErrorHandlers/ErrorBoundary.js';export{LayoutErrorBoundary}from'./components/ErrorHandlers/LayoutErrorBoundary.js';export{RemixErrorBoundary}from'./components/ErrorHandlers/RemixErrorBoundary.js';export{ReactTable}from'./components/ReactTable/Table.js';export{DefaultColumnFilter,SelectColumnFilter}from'./components/ReactTable/TableFilters.js';export{Error404}from'./components/ErrorPages/404.js';export{Error500}from'./components/ErrorPages/500.js';export{Error403}from'./components/ErrorPages/403.js';export{PageContainer}from'./components/PageContainer/PageContainer.js';export{Spin}from'./components/Spin/index.js';export{OTPInput}from'./components/OTP/OTPInput.js';export{SingleInput}from'./components/OTP/SingleInput.js';export{useOTPInput}from'./components/OTP/hooks.js';export{OTPVerification}from'./components/OTP/OTPVerification.js';export{SearchInput}from'./components/Search/SearchInput.js';export{Select,SelectContent,SelectItem,SelectSearch,SelectTrigger,SelectValue}from'./components/Select/Select.js';export{DatePicker}from'./components/DatePicker/DatePicker.js';export{TailwindUiButton}from'./components/Button/Button.js';export{TailwindThemeProvider,ThemeContext,themes}from'./components/ThemeProvider/ThemeProvider.js';export{ThemeToggle}from'./components/ThemeProvider/ThemeToggle.js';export{LanguageMenuDropdown}from'./components/LanguageMenuDropdown/LanguageMenuDropdown.js';export{useTheme}from'./hooks/useTheme.js';export{useWindowSize}from'./hooks/useWindowSize.js';export{ToastContainer,useToast,useToastCloseAll}from'./hooks/useToast.js';export{useMediaQuery}from'./hooks/useMediaQuery.js';export{cn}from'./utils/util.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{default as PageLoading}from'./components/PageLoading/index.js';export{ApplicationErrorHandler}from'./components/ErrorHandlers/ApplicationErrorHandler.js';export{ErrorBoundary}from'./components/ErrorHandlers/ErrorBoundary.js';export{LayoutErrorBoundary}from'./components/ErrorHandlers/LayoutErrorBoundary.js';export{RemixErrorBoundary}from'./components/ErrorHandlers/RemixErrorBoundary.js';export{SPAErrorBoundary}from'./components/ErrorHandlers/SPAErrorBoundary.js';export{ReactTable}from'./components/ReactTable/Table.js';export{DefaultColumnFilter,SelectColumnFilter}from'./components/ReactTable/TableFilters.js';export{Error404}from'./components/ErrorPages/404.js';export{Error500}from'./components/ErrorPages/500.js';export{Error403}from'./components/ErrorPages/403.js';export{PageContainer}from'./components/PageContainer/PageContainer.js';export{Spin}from'./components/Spin/index.js';export{OTPInput}from'./components/OTP/OTPInput.js';export{SingleInput}from'./components/OTP/SingleInput.js';export{useOTPInput}from'./components/OTP/hooks.js';export{OTPVerification}from'./components/OTP/OTPVerification.js';export{SearchInput}from'./components/Search/SearchInput.js';export{Select,SelectContent,SelectItem,SelectSearch,SelectTrigger,SelectValue}from'./components/Select/Select.js';export{DatePicker}from'./components/DatePicker/DatePicker.js';export{TailwindUiButton}from'./components/Button/Button.js';export{TailwindThemeProvider,ThemeContext,themes}from'./components/ThemeProvider/ThemeProvider.js';export{ThemeToggle}from'./components/ThemeProvider/ThemeToggle.js';export{LanguageMenuDropdown}from'./components/LanguageMenuDropdown/LanguageMenuDropdown.js';export{InputToolBar}from'./components/InputToolBar/InputToolBar.js';export{getDefaultLeftItems,getDefaultRightItems}from'./components/InputToolBar/defaults.js';export{useTheme}from'./hooks/useTheme.js';export{useWindowSize}from'./hooks/useWindowSize.js';export{ToastContainer,useToast,useToastCloseAll}from'./hooks/useToast.js';export{useMediaQuery}from'./hooks/useMediaQuery.js';export{cn}from'./utils/util.js';//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "
|
|
2
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "maxLength" | "onChange" | "containerClassName" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "noScriptCSSFallback"> & {
|
|
3
3
|
value?: string;
|
|
4
4
|
onChange?: (newValue: string) => unknown;
|
|
5
5
|
maxLength: number;
|
|
@@ -12,7 +12,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
12
12
|
} & {
|
|
13
13
|
render: (props: import("input-otp").RenderProps) => React.ReactNode;
|
|
14
14
|
children?: never;
|
|
15
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "
|
|
15
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "maxLength" | "onChange" | "containerClassName" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "noScriptCSSFallback"> & {
|
|
16
16
|
value?: string;
|
|
17
17
|
onChange?: (newValue: string) => unknown;
|
|
18
18
|
maxLength: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
3
3
|
declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React.JSX.Element;
|
|
4
|
-
declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLDetailsElement | HTMLPreElement | HTMLSelectElement | HTMLOptionElement | HTMLOptGroupElement | HTMLInputElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableRowElement | HTMLTableCellElement | HTMLSpanElement | HTMLImageElement | HTMLUListElement | HTMLLIElement | HTMLAnchorElement | HTMLObjectElement | HTMLLinkElement | HTMLMapElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement |
|
|
4
|
+
declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLDetailsElement | HTMLPreElement | HTMLHtmlElement | HTMLHeadElement | HTMLBodyElement | HTMLMetaElement | HTMLTitleElement | HTMLScriptElement | HTMLSelectElement | HTMLOptionElement | HTMLOptGroupElement | HTMLInputElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableRowElement | HTMLTableCellElement | HTMLSpanElement | HTMLImageElement | HTMLUListElement | HTMLLIElement | HTMLAnchorElement | HTMLObjectElement | HTMLLinkElement | HTMLMapElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHRElement | HTMLIFrameElement | HTMLLabelElement | HTMLLegendElement | HTMLMeterElement | HTMLOListElement | HTMLOutputElement | HTMLProgressElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
5
5
|
className?: string | undefined;
|
|
6
6
|
collapsedSize?: number | undefined;
|
|
7
7
|
collapsible?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/tailwind-ui",
|
|
3
|
-
"version": "12.2.4-alpha.
|
|
3
|
+
"version": "12.2.4-alpha.15",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"./components/*": "./lib/components/*",
|
|
11
11
|
"./hooks/*": "./lib/hooks/*",
|
|
12
12
|
"./shardui/util": "./lib/utils/util.js",
|
|
13
|
-
"./shardui": "./lib/shardui
|
|
13
|
+
"./shardui": "./lib/shardui/index.js",
|
|
14
14
|
"./shardui/*": "./lib/shardui/*"
|
|
15
15
|
},
|
|
16
16
|
"main": "lib/index.js",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"watch": "npm run build:lib:watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@admin-layout/client": "12.2.4-alpha.
|
|
32
|
+
"@admin-layout/client": "12.2.4-alpha.12",
|
|
33
33
|
"@radix-ui/react-accordion": "^1.2.0",
|
|
34
34
|
"@radix-ui/react-alert-dialog": "^1.1.1",
|
|
35
35
|
"@radix-ui/react-aspect-ratio": "^1.1.0",
|
|
36
36
|
"@radix-ui/react-avatar": "^1.1.0",
|
|
37
37
|
"@radix-ui/react-checkbox": "^1.1.1",
|
|
38
38
|
"@radix-ui/react-collapsible": "^1.1.0",
|
|
39
|
+
"@radix-ui/react-compose-refs": "^1.1.0",
|
|
39
40
|
"@radix-ui/react-context-menu": "^2.2.1",
|
|
40
41
|
"@radix-ui/react-dialog": "^1.1.1",
|
|
41
42
|
"@radix-ui/react-dropdown-menu": "^2.1.1",
|
|
@@ -89,5 +90,5 @@
|
|
|
89
90
|
"typescript": {
|
|
90
91
|
"definition": "lib/index.d.ts"
|
|
91
92
|
},
|
|
92
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "96bfbb71f113f838aef344f84fd76ad2766fd995"
|
|
93
94
|
}
|