@admin-layout/tailwind-ui 12.2.4-alpha.12 → 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/DatePicker/DatePicker.js +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/Select/Select.js +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/package.json +2 -2
|
@@ -197,4 +197,4 @@ import React__default,{useRef,useEffect}from'react';import {useActor}from'@xstat
|
|
|
197
197
|
className: "px-2 py-0.5 text-xs text-blue-600 hover:bg-blue-50 transition-colors",
|
|
198
198
|
onClick: () => handleDateSelect(new Date())
|
|
199
199
|
}, "Today"))));
|
|
200
|
-
};export{DatePicker};//# sourceMappingURL=DatePicker.js.map
|
|
200
|
+
};export{DatePicker,DatePicker as default};//# sourceMappingURL=DatePicker.js.map
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import*as React from'react';import {Search
|
|
1
|
+
import*as React from'react';import {ChevronDown,Search}from'lucide-react';import {cn}from'../../utils/util.js';const SelectContext = React.createContext(undefined);
|
|
2
2
|
const SelectProvider = ({
|
|
3
3
|
children,
|
|
4
4
|
value,
|
|
@@ -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{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{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
|
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",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"typescript": {
|
|
91
91
|
"definition": "lib/index.d.ts"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "96bfbb71f113f838aef344f84fd76ad2766fd995"
|
|
94
94
|
}
|