glchat-a2ui-react-renderer 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.
Files changed (78) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/src/Provider.d.ts +2 -0
  4. package/dist/src/Provider.d.ts.map +1 -1
  5. package/dist/src/Provider.js +15 -4
  6. package/dist/src/components/a2ui/Button/Button.d.ts.map +1 -0
  7. package/dist/src/components/{Button → a2ui/Button}/Button.js +1 -1
  8. package/dist/src/components/a2ui/Button/theme.d.ts.map +1 -0
  9. package/dist/src/components/a2ui/Card/Card.d.ts.map +1 -0
  10. package/dist/src/components/a2ui/Card/theme.d.ts.map +1 -0
  11. package/dist/src/components/a2ui/CheckBox/CheckBox.d.ts +4 -0
  12. package/dist/src/components/a2ui/CheckBox/CheckBox.d.ts.map +1 -0
  13. package/dist/src/components/a2ui/CheckBox/CheckBox.js +26 -0
  14. package/dist/src/components/a2ui/CheckBox/theme.d.ts +11 -0
  15. package/dist/src/components/a2ui/CheckBox/theme.d.ts.map +1 -0
  16. package/dist/src/components/a2ui/CheckBox/theme.js +17 -0
  17. package/dist/src/components/a2ui/DateTimeInput/theme.d.ts +8 -0
  18. package/dist/src/components/a2ui/DateTimeInput/theme.d.ts.map +1 -0
  19. package/dist/src/components/a2ui/DateTimeInput/theme.js +11 -0
  20. package/dist/src/components/a2ui/MultipleChoice/CheckboxList.d.ts +12 -0
  21. package/dist/src/components/a2ui/MultipleChoice/CheckboxList.d.ts.map +1 -0
  22. package/dist/src/components/a2ui/MultipleChoice/CheckboxList.js +45 -0
  23. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.d.ts +4 -0
  24. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.d.ts.map +1 -0
  25. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.js +72 -0
  26. package/dist/src/components/a2ui/MultipleChoice/theme.d.ts +13 -0
  27. package/dist/src/components/a2ui/MultipleChoice/theme.d.ts.map +1 -0
  28. package/dist/src/components/a2ui/MultipleChoice/theme.js +35 -0
  29. package/dist/src/components/a2ui/TextField/TextField.d.ts +4 -0
  30. package/dist/src/components/a2ui/TextField/TextField.d.ts.map +1 -0
  31. package/dist/src/components/a2ui/TextField/TextField.js +54 -0
  32. package/dist/src/components/a2ui/TextField/theme.d.ts +28 -0
  33. package/dist/src/components/a2ui/TextField/theme.d.ts.map +1 -0
  34. package/dist/src/components/a2ui/TextField/theme.js +82 -0
  35. package/dist/src/components/a2ui/Timeout/Timeout.d.ts.map +1 -0
  36. package/dist/src/components/{Timeout → a2ui/Timeout}/Timeout.js +1 -1
  37. package/dist/src/components/a2ui/Timeout/theme.d.ts.map +1 -0
  38. package/dist/src/components/ui/Checkbox/Checkbox.d.ts +8 -0
  39. package/dist/src/components/ui/Checkbox/Checkbox.d.ts.map +1 -0
  40. package/dist/src/components/ui/Checkbox/Checkbox.js +9 -0
  41. package/dist/src/components/ui/Checkbox/theme.d.ts +5 -0
  42. package/dist/src/components/ui/Checkbox/theme.d.ts.map +1 -0
  43. package/dist/src/components/ui/Checkbox/theme.js +26 -0
  44. package/dist/src/components/ui/MultiSelect/MultiSelect.d.ts +15 -0
  45. package/dist/src/components/ui/MultiSelect/MultiSelect.d.ts.map +1 -0
  46. package/dist/src/components/ui/MultiSelect/MultiSelect.js +137 -0
  47. package/dist/src/components/ui/MultiSelect/theme.d.ts +18 -0
  48. package/dist/src/components/ui/MultiSelect/theme.d.ts.map +1 -0
  49. package/dist/src/components/ui/MultiSelect/theme.js +130 -0
  50. package/dist/src/components/ui/Select/Select.d.ts +19 -0
  51. package/dist/src/components/ui/Select/Select.d.ts.map +1 -0
  52. package/dist/src/components/ui/Select/Select.js +27 -0
  53. package/dist/src/components/ui/Select/theme.d.ts +29 -0
  54. package/dist/src/components/ui/Select/theme.d.ts.map +1 -0
  55. package/dist/src/components/ui/Select/theme.js +99 -0
  56. package/dist/src/utils/catalog.d.ts +1 -1
  57. package/dist/src/utils/catalog.d.ts.map +1 -1
  58. package/dist/src/utils/catalog.js +13 -4
  59. package/dist/src/utils/theme.d.ts.map +1 -1
  60. package/dist/src/utils/theme.js +27 -2
  61. package/package.json +5 -3
  62. package/styles/globals.css +122 -0
  63. package/dist/src/components/Button/Button.d.ts.map +0 -1
  64. package/dist/src/components/Button/theme.d.ts.map +0 -1
  65. package/dist/src/components/Card/Card.d.ts.map +0 -1
  66. package/dist/src/components/Card/theme.d.ts.map +0 -1
  67. package/dist/src/components/Timeout/Timeout.d.ts.map +0 -1
  68. package/dist/src/components/Timeout/theme.d.ts.map +0 -1
  69. /package/dist/src/components/{Button → a2ui/Button}/Button.d.ts +0 -0
  70. /package/dist/src/components/{Button → a2ui/Button}/theme.d.ts +0 -0
  71. /package/dist/src/components/{Button → a2ui/Button}/theme.js +0 -0
  72. /package/dist/src/components/{Card → a2ui/Card}/Card.d.ts +0 -0
  73. /package/dist/src/components/{Card → a2ui/Card}/Card.js +0 -0
  74. /package/dist/src/components/{Card → a2ui/Card}/theme.d.ts +0 -0
  75. /package/dist/src/components/{Card → a2ui/Card}/theme.js +0 -0
  76. /package/dist/src/components/{Timeout → a2ui/Timeout}/Timeout.d.ts +0 -0
  77. /package/dist/src/components/{Timeout → a2ui/Timeout}/theme.d.ts +0 -0
  78. /package/dist/src/components/{Timeout → a2ui/Timeout}/theme.js +0 -0
@@ -0,0 +1,5 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const glchatCheckboxRootStyles: CSSProperties;
3
+ export declare const glchatCheckboxIndicatorStyles: CSSProperties;
4
+ export declare const glchatCheckboxLabelStyles: CSSProperties;
5
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Checkbox/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,wBAAwB,EAAE,aActC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,aAK3C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAIvC,CAAC"}
@@ -0,0 +1,26 @@
1
+ export const glchatCheckboxRootStyles = {
2
+ height: '1rem',
3
+ width: '1rem',
4
+ flexShrink: 0,
5
+ borderRadius: 'var(--radius-sm)',
6
+ borderWidth: '1px',
7
+ borderStyle: 'solid',
8
+ borderColor: 'hsl(var(--primary))',
9
+ backgroundColor: 'hsl(var(--background))',
10
+ display: 'inline-flex',
11
+ alignItems: 'center',
12
+ justifyContent: 'center',
13
+ cursor: 'pointer',
14
+ boxSizing: 'border-box',
15
+ };
16
+ export const glchatCheckboxIndicatorStyles = {
17
+ display: 'flex',
18
+ alignItems: 'center',
19
+ justifyContent: 'center',
20
+ color: 'hsl(var(--primary-foreground))',
21
+ };
22
+ export const glchatCheckboxLabelStyles = {
23
+ fontSize: '0.875rem',
24
+ color: 'hsl(var(--foreground))',
25
+ lineHeight: '1.25rem',
26
+ };
@@ -0,0 +1,15 @@
1
+ import type { CSSProperties } from 'react';
2
+ import { type MultiSelectOption } from './theme.js';
3
+ export type MultiSelectProps = {
4
+ options: MultiSelectOption[];
5
+ value: string[];
6
+ onValueChange: (value: string[]) => void;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ filterable?: boolean;
10
+ maxSelections?: number;
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ };
14
+ export declare function MultiSelect({ options, value, onValueChange, placeholder, disabled, filterable, maxSelections, className, style, }: Readonly<MultiSelectProps>): import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=MultiSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM3C,OAAO,EAaL,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAMF,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAA8B,EAC9B,QAAgB,EAChB,UAAkB,EAClB,aAAa,EACb,SAAS,EACT,KAAK,GACN,EAAE,QAAQ,CAAC,gBAAgB,CAAC,2CAyS5B"}
@@ -0,0 +1,137 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
4
+ import { Check, ChevronDown, X } from 'lucide-react';
5
+ import { useCallback, useMemo, useState } from 'react';
6
+ const optionHoverStyle = {
7
+ backgroundColor: 'hsl(var(--foreground) / 0.1)',
8
+ };
9
+ import { glchatMultiSelectBadgeStyles, glchatMultiSelectCheckboxCheckedStyles, glchatMultiSelectCheckboxStyles, glchatMultiSelectContentStyles, glchatMultiSelectFooterButtonStyles, glchatMultiSelectFooterStyles, glchatMultiSelectListStyles, glchatMultiSelectOptionStyles, glchatMultiSelectPlaceholderStyles, glchatMultiSelectSearchInputStyles, glchatMultiSelectSeparatorStyles, glchatMultiSelectTriggerStyles, } from './theme.js';
10
+ function mergeStyles(base, override) {
11
+ return override ? { ...base, ...override } : base;
12
+ }
13
+ export function MultiSelect({ options, value, onValueChange, placeholder = 'Select options', disabled = false, filterable = false, maxSelections, className, style, }) {
14
+ const [open, setOpen] = useState(false);
15
+ const [search, setSearch] = useState('');
16
+ const [hoveredOption, setHoveredOption] = useState(null);
17
+ const filteredOptions = useMemo(() => {
18
+ if (!filterable || !search.trim())
19
+ return options;
20
+ const query = search.toLocaleLowerCase();
21
+ return options.filter((opt) => opt.label.toLocaleLowerCase().includes(query));
22
+ }, [filterable, options, search]);
23
+ const isAllSelected = options.length > 0 && value.length === options.length;
24
+ const toggleOption = useCallback((optionValue) => {
25
+ if (value.includes(optionValue)) {
26
+ onValueChange(value.filter((v) => v !== optionValue));
27
+ return;
28
+ }
29
+ if (maxSelections !== void 0 && value.length >= maxSelections) {
30
+ return;
31
+ }
32
+ onValueChange([...value, optionValue]);
33
+ }, [maxSelections, onValueChange, value]);
34
+ const handleClear = useCallback(() => {
35
+ onValueChange([]);
36
+ }, [onValueChange]);
37
+ const toggleAll = useCallback(() => {
38
+ if (isAllSelected) {
39
+ handleClear();
40
+ return;
41
+ }
42
+ const allValues = options.map((o) => o.value);
43
+ if (maxSelections !== void 0) {
44
+ onValueChange(allValues.slice(0, maxSelections));
45
+ return;
46
+ }
47
+ onValueChange(allValues);
48
+ }, [handleClear, isAllSelected, maxSelections, onValueChange, options]);
49
+ const triggerClassName = ['glchat-a2ui-multiselect-trigger', className]
50
+ .filter(Boolean)
51
+ .join(' ');
52
+ return (_jsxs(PopoverPrimitive.Root, { open: open, onOpenChange: (next) => {
53
+ if (disabled && next)
54
+ return;
55
+ setOpen(next);
56
+ if (!next)
57
+ setSearch('');
58
+ }, children: [_jsx(PopoverPrimitive.Trigger, { type: "button", disabled: disabled, className: triggerClassName, style: mergeStyles(glchatMultiSelectTriggerStyles, style), children: value.length > 0 ? (_jsxs("div", { style: {
59
+ display: 'flex',
60
+ minHeight: 0,
61
+ width: '100%',
62
+ alignItems: 'center',
63
+ justifyContent: 'space-between',
64
+ gap: '0.5rem',
65
+ }, children: [_jsx("div", { style: {
66
+ display: 'flex',
67
+ minHeight: 0,
68
+ minWidth: 0,
69
+ flex: 1,
70
+ flexWrap: 'wrap',
71
+ alignItems: 'center',
72
+ gap: '0.5rem',
73
+ maxHeight: '6rem',
74
+ overflowY: 'auto',
75
+ overflowX: 'hidden',
76
+ }, children: value.map((selectedValue) => {
77
+ const option = options.find((o) => o.value === selectedValue);
78
+ return (_jsxs("div", { style: glchatMultiSelectBadgeStyles, children: [_jsx("span", { style: {
79
+ overflow: 'hidden',
80
+ textOverflow: 'ellipsis',
81
+ whiteSpace: 'nowrap',
82
+ }, children: option?.label ?? selectedValue }), _jsx(X, { style: {
83
+ marginLeft: '0.5rem',
84
+ height: '0.75rem',
85
+ width: '0.75rem',
86
+ flexShrink: 0,
87
+ cursor: disabled ? 'not-allowed' : 'pointer',
88
+ }, strokeWidth: 1.5, onClick: (event) => {
89
+ event.stopPropagation();
90
+ if (!disabled)
91
+ toggleOption(selectedValue);
92
+ }, "aria-hidden": true })] }, selectedValue));
93
+ }) }), _jsxs("div", { style: { display: 'flex', flexShrink: 0, alignItems: 'center', gap: '0.5rem' }, children: [_jsx(X, { style: {
94
+ height: '1rem',
95
+ width: '1rem',
96
+ flexShrink: 0,
97
+ cursor: disabled ? 'not-allowed' : 'pointer',
98
+ opacity: 0.5,
99
+ }, strokeWidth: 1.5, onClick: (event) => {
100
+ event.stopPropagation();
101
+ if (!disabled)
102
+ handleClear();
103
+ }, "aria-hidden": true }), _jsx("div", { style: glchatMultiSelectSeparatorStyles }), _jsx(ChevronDown, { style: { height: '1rem', width: '1rem', flexShrink: 0, opacity: 0.5 }, strokeWidth: 1.5, "aria-hidden": true })] })] })) : (_jsxs("div", { style: {
104
+ display: 'flex',
105
+ width: '100%',
106
+ alignItems: 'center',
107
+ justifyContent: 'space-between',
108
+ }, children: [_jsx("span", { style: glchatMultiSelectPlaceholderStyles, children: placeholder }), _jsx(ChevronDown, { style: { height: '1rem', width: '1rem', opacity: 0.5 }, strokeWidth: 1.5, "aria-hidden": true })] })) }), _jsx(PopoverPrimitive.Portal, { children: _jsxs(PopoverPrimitive.Content, { align: "start", sideOffset: 4, className: "glchat-a2ui-multiselect-content", style: glchatMultiSelectContentStyles, onEscapeKeyDown: () => setOpen(false), children: [filterable && (_jsx("input", { type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search...", style: glchatMultiSelectSearchInputStyles })), _jsxs("div", { style: glchatMultiSelectListStyles, children: [options.length > 0 && (_jsxs("button", { type: "button", className: "glchat-a2ui-multiselect-option", style: {
109
+ ...glchatMultiSelectOptionStyles,
110
+ ...(hoveredOption === '__all__' ? optionHoverStyle : {}),
111
+ }, onMouseEnter: () => setHoveredOption('__all__'), onMouseLeave: () => setHoveredOption(null), onClick: toggleAll, children: [_jsx("span", { style: isAllSelected
112
+ ? glchatMultiSelectCheckboxCheckedStyles
113
+ : glchatMultiSelectCheckboxStyles, children: isAllSelected && (_jsx(Check, { style: { height: '1rem', width: '1rem' }, strokeWidth: 1.5 })) }), _jsx("span", { children: "Select all" })] })), filteredOptions.length === 0 ? (_jsx("div", { style: {
114
+ padding: '0.5rem 0.75rem',
115
+ fontSize: '0.875rem',
116
+ color: 'hsl(var(--foreground) / 0.5)',
117
+ }, children: "No results" })) : (filteredOptions.map((option) => {
118
+ const isSelected = value.includes(option.value);
119
+ const atMax = maxSelections !== void 0 &&
120
+ value.length >= maxSelections &&
121
+ !isSelected;
122
+ return (_jsxs("button", { type: "button", className: "glchat-a2ui-multiselect-option", disabled: atMax, style: {
123
+ ...glchatMultiSelectOptionStyles,
124
+ ...(hoveredOption === option.value ? optionHoverStyle : {}),
125
+ opacity: atMax ? 0.5 : 1,
126
+ cursor: atMax ? 'not-allowed' : 'pointer',
127
+ }, onMouseEnter: () => setHoveredOption(option.value), onMouseLeave: () => setHoveredOption(null), onClick: () => toggleOption(option.value), children: [_jsx("span", { style: isSelected
128
+ ? glchatMultiSelectCheckboxCheckedStyles
129
+ : glchatMultiSelectCheckboxStyles, children: isSelected && (_jsx(Check, { style: { height: '1rem', width: '1rem' }, strokeWidth: 1.5 })) }), _jsx("span", { style: {
130
+ overflow: 'hidden',
131
+ display: '-webkit-box',
132
+ WebkitLineClamp: 2,
133
+ WebkitBoxOrient: 'vertical',
134
+ width: '100%',
135
+ }, children: option.label })] }, option.value));
136
+ }))] }), _jsxs("div", { style: glchatMultiSelectFooterStyles, children: [value.length > 0 && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", style: glchatMultiSelectFooterButtonStyles, onClick: handleClear, children: "Clear" }), _jsx("div", { style: glchatMultiSelectSeparatorStyles })] })), _jsx("button", { type: "button", style: glchatMultiSelectFooterButtonStyles, onClick: () => setOpen(false), children: "Close" })] })] }) })] }));
137
+ }
@@ -0,0 +1,18 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type MultiSelectOption = {
3
+ label: string;
4
+ value: string;
5
+ };
6
+ export declare const glchatMultiSelectTriggerStyles: CSSProperties;
7
+ export declare const glchatMultiSelectBadgeStyles: CSSProperties;
8
+ export declare const glchatMultiSelectPlaceholderStyles: CSSProperties;
9
+ export declare const glchatMultiSelectContentStyles: CSSProperties;
10
+ export declare const glchatMultiSelectSearchInputStyles: CSSProperties;
11
+ export declare const glchatMultiSelectListStyles: CSSProperties;
12
+ export declare const glchatMultiSelectOptionStyles: CSSProperties;
13
+ export declare const glchatMultiSelectCheckboxStyles: CSSProperties;
14
+ export declare const glchatMultiSelectCheckboxCheckedStyles: CSSProperties;
15
+ export declare const glchatMultiSelectFooterStyles: CSSProperties;
16
+ export declare const glchatMultiSelectFooterButtonStyles: CSSProperties;
17
+ export declare const glchatMultiSelectSeparatorStyles: CSSProperties;
18
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/MultiSelect/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,aAgB5C,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAc1C,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,aAIhD,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,aAW5C,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,aAWhD,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,aAKzC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,aAgB3C,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,aAY7C,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,aAKpD,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,aAS3C,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,aASjD,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,aAM9C,CAAC"}
@@ -0,0 +1,130 @@
1
+ export const glchatMultiSelectTriggerStyles = {
2
+ display: 'flex',
3
+ minHeight: '2.5rem',
4
+ width: '100%',
5
+ alignItems: 'center',
6
+ justifyContent: 'space-between',
7
+ borderRadius: 'var(--radius-md)',
8
+ borderWidth: '1px',
9
+ borderStyle: 'solid',
10
+ borderColor: 'hsl(var(--border))',
11
+ backgroundColor: 'hsl(var(--background))',
12
+ padding: '0.5rem',
13
+ fontSize: '0.875rem',
14
+ color: 'hsl(var(--foreground))',
15
+ boxSizing: 'border-box',
16
+ cursor: 'pointer',
17
+ };
18
+ export const glchatMultiSelectBadgeStyles = {
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'space-between',
22
+ borderRadius: 'var(--radius-sm)',
23
+ paddingTop: '0.125rem',
24
+ paddingBottom: '0.125rem',
25
+ paddingLeft: '0.375rem',
26
+ paddingRight: '0.375rem',
27
+ backgroundColor: 'hsl(var(--primary-subtle))',
28
+ color: 'hsl(var(--primary-subtle-foreground))',
29
+ fontSize: '0.875rem',
30
+ fontWeight: 400,
31
+ maxWidth: '9rem',
32
+ };
33
+ export const glchatMultiSelectPlaceholderStyles = {
34
+ fontSize: '0.875rem',
35
+ fontWeight: 400,
36
+ color: 'hsl(var(--foreground) / 0.5)',
37
+ };
38
+ export const glchatMultiSelectContentStyles = {
39
+ zIndex: 50,
40
+ width: 'var(--radix-popover-trigger-width)',
41
+ borderRadius: 'var(--radius-md)',
42
+ borderWidth: '1px',
43
+ borderStyle: 'solid',
44
+ borderColor: 'hsl(var(--border))',
45
+ backgroundColor: 'hsl(var(--background))',
46
+ color: 'hsl(var(--foreground))',
47
+ padding: 0,
48
+ boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
49
+ };
50
+ export const glchatMultiSelectSearchInputStyles = {
51
+ width: '100%',
52
+ borderWidth: 0,
53
+ borderBottomWidth: '1px',
54
+ borderBottomStyle: 'solid',
55
+ borderBottomColor: 'hsl(var(--border))',
56
+ backgroundColor: 'transparent',
57
+ padding: '0.5rem 0.75rem',
58
+ fontSize: '0.875rem',
59
+ color: 'hsl(var(--foreground))',
60
+ outline: 'none',
61
+ };
62
+ export const glchatMultiSelectListStyles = {
63
+ maxHeight: '250px',
64
+ overflowY: 'auto',
65
+ paddingTop: '0.25rem',
66
+ paddingBottom: '0.25rem',
67
+ };
68
+ export const glchatMultiSelectOptionStyles = {
69
+ display: 'flex',
70
+ width: '100%',
71
+ cursor: 'pointer',
72
+ userSelect: 'none',
73
+ alignItems: 'center',
74
+ borderRadius: 'var(--radius-sm)',
75
+ paddingTop: '0.375rem',
76
+ paddingBottom: '0.375rem',
77
+ paddingLeft: '0.5rem',
78
+ paddingRight: '0.5rem',
79
+ fontSize: '0.875rem',
80
+ outline: 'none',
81
+ border: 'none',
82
+ color: 'hsl(var(--foreground))',
83
+ textAlign: 'left',
84
+ };
85
+ export const glchatMultiSelectCheckboxStyles = {
86
+ display: 'flex',
87
+ height: '1rem',
88
+ width: '1rem',
89
+ flexShrink: 0,
90
+ alignItems: 'center',
91
+ justifyContent: 'center',
92
+ marginRight: '0.5rem',
93
+ borderRadius: 'var(--radius-sm)',
94
+ borderWidth: '1px',
95
+ borderStyle: 'solid',
96
+ borderColor: 'hsl(var(--foreground))',
97
+ };
98
+ export const glchatMultiSelectCheckboxCheckedStyles = {
99
+ ...glchatMultiSelectCheckboxStyles,
100
+ borderColor: 'hsl(var(--primary))',
101
+ backgroundColor: 'hsl(var(--primary))',
102
+ color: 'hsl(var(--primary-foreground))',
103
+ };
104
+ export const glchatMultiSelectFooterStyles = {
105
+ display: 'flex',
106
+ alignItems: 'center',
107
+ justifyContent: 'space-between',
108
+ borderTopWidth: '1px',
109
+ borderTopStyle: 'solid',
110
+ borderTopColor: 'hsl(var(--border))',
111
+ padding: '0.25rem',
112
+ fontSize: '0.875rem',
113
+ };
114
+ export const glchatMultiSelectFooterButtonStyles = {
115
+ flex: 1,
116
+ height: '2rem',
117
+ cursor: 'pointer',
118
+ borderRadius: 'var(--radius-sm)',
119
+ border: 'none',
120
+ backgroundColor: 'transparent',
121
+ color: 'hsl(var(--foreground))',
122
+ fontSize: '0.875rem',
123
+ };
124
+ export const glchatMultiSelectSeparatorStyles = {
125
+ width: '1px',
126
+ minHeight: '1.5rem',
127
+ backgroundColor: 'hsl(var(--border))',
128
+ marginLeft: '0.25rem',
129
+ marginRight: '0.25rem',
130
+ };
@@ -0,0 +1,19 @@
1
+ import * as SelectPrimitive from '@radix-ui/react-select';
2
+ import * as React from 'react';
3
+ import type { CSSProperties } from 'react';
4
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
5
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
7
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
8
+ style?: CSSProperties;
9
+ } & React.RefAttributes<HTMLButtonElement>>;
10
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
13
+ style?: CSSProperties;
14
+ } & React.RefAttributes<HTMLDivElement>>;
15
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
16
+ style?: CSSProperties;
17
+ } & React.RefAttributes<HTMLDivElement>>;
18
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, };
19
+ //# sourceMappingURL=Select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAW3C,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAM1C,QAAA,MAAM,aAAa;YAHT,aAAa;2CAqBrB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAOH,QAAA,MAAM,aAAa;YAHT,aAAa;wCAiCrB,CAAC;AAOH,QAAA,MAAM,UAAU;YAHN,aAAa;wCAoBrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as SelectPrimitive from '@radix-ui/react-select';
4
+ import { Check, ChevronDown, ChevronUp } from 'lucide-react';
5
+ import * as React from 'react';
6
+ import { glchatSelectContentStyles, glchatSelectItemIndicatorStyles, glchatSelectItemStyles, glchatSelectScrollButtonStyles, glchatSelectTriggerStyles, glchatSelectViewportStyles, } from './theme.js';
7
+ const Select = SelectPrimitive.Root;
8
+ const SelectGroup = SelectPrimitive.Group;
9
+ const SelectValue = SelectPrimitive.Value;
10
+ const SelectTrigger = React.forwardRef(({ className, style, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: className, style: { ...glchatSelectTriggerStyles, ...style }, ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { style: { height: '1rem', width: '1rem', opacity: 0.5, flexShrink: 0 }, "aria-hidden": true }) })] })));
11
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
12
+ const SelectScrollUpButton = React.forwardRef(({ style, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, style: { ...glchatSelectScrollButtonStyles, ...style }, ...props, children: _jsx(ChevronUp, { style: { height: '1rem', width: '1rem' }, "aria-hidden": true }) })));
13
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
14
+ const SelectScrollDownButton = React.forwardRef(({ style, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, style: { ...glchatSelectScrollButtonStyles, ...style }, ...props, children: _jsx(ChevronDown, { style: { height: '1rem', width: '1rem' }, "aria-hidden": true }) })));
15
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
16
+ const SelectContent = React.forwardRef(({ className, children, position = 'popper', style, ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: className, position: position, style: { ...glchatSelectContentStyles, ...style }, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { style: position === 'popper'
17
+ ? {
18
+ ...glchatSelectViewportStyles,
19
+ height: 'var(--radix-select-trigger-height)',
20
+ width: '100%',
21
+ minWidth: 'var(--radix-select-trigger-width)',
22
+ }
23
+ : glchatSelectViewportStyles, children: children }), _jsx(SelectScrollDownButton, {})] }) })));
24
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
25
+ const SelectItem = React.forwardRef(({ className, children, style, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: ['glchat-a2ui-select-item', className].filter(Boolean).join(' '), style: { ...glchatSelectItemStyles, ...style }, ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx("span", { style: glchatSelectItemIndicatorStyles, children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { style: { height: '1rem', width: '1rem', color: 'hsl(var(--primary))' }, "aria-hidden": true }) }) })] })));
26
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
27
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, };
@@ -0,0 +1,29 @@
1
+ import type { CSSProperties } from 'react';
2
+ /**
3
+ * SelectTrigger inline styles — glchat-ui Select baseline.
4
+ */
5
+ /** Label text inside SelectTrigger (not Radix SelectValue). */
6
+ export declare const glchatSelectTriggerLabelStyles: CSSProperties;
7
+ export declare const glchatSelectTriggerPlaceholderStyles: CSSProperties;
8
+ export declare const glchatSelectTriggerStyles: CSSProperties;
9
+ /**
10
+ * SelectContent inline styles — dropdown panel.
11
+ */
12
+ export declare const glchatSelectContentStyles: CSSProperties;
13
+ /**
14
+ * SelectViewport padding wrapper.
15
+ */
16
+ export declare const glchatSelectViewportStyles: CSSProperties;
17
+ /**
18
+ * SelectItem inline styles.
19
+ */
20
+ export declare const glchatSelectItemStyles: CSSProperties;
21
+ /**
22
+ * SelectItem check indicator container.
23
+ */
24
+ export declare const glchatSelectItemIndicatorStyles: CSSProperties;
25
+ /**
26
+ * Scroll button styles.
27
+ */
28
+ export declare const glchatSelectScrollButtonStyles: CSSProperties;
29
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Select/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;GAEG;AACH,+DAA+D;AAC/D,eAAO,MAAM,8BAA8B,EAAE,aAO5C,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,aAElD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAmBvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,aAcvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,aAExC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAcpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,aAO7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,aAO5C,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * SelectTrigger inline styles — glchat-ui Select baseline.
3
+ */
4
+ /** Label text inside SelectTrigger (not Radix SelectValue). */
5
+ export const glchatSelectTriggerLabelStyles = {
6
+ flex: 1,
7
+ minWidth: 0,
8
+ overflow: 'hidden',
9
+ textOverflow: 'ellipsis',
10
+ whiteSpace: 'nowrap',
11
+ textAlign: 'left',
12
+ };
13
+ export const glchatSelectTriggerPlaceholderStyles = {
14
+ color: 'hsl(var(--foreground) / 0.5)',
15
+ };
16
+ export const glchatSelectTriggerStyles = {
17
+ display: 'flex',
18
+ height: '2.5rem',
19
+ width: '100%',
20
+ alignItems: 'center',
21
+ justifyContent: 'space-between',
22
+ borderRadius: 'var(--radius-md)',
23
+ borderWidth: '1px',
24
+ borderStyle: 'solid',
25
+ borderColor: 'hsl(var(--border))',
26
+ backgroundColor: 'hsl(var(--background))',
27
+ paddingTop: '0.5rem',
28
+ paddingBottom: '0.5rem',
29
+ paddingLeft: '0.75rem',
30
+ paddingRight: '0.75rem',
31
+ fontSize: '0.875rem',
32
+ color: 'hsl(var(--foreground))',
33
+ boxSizing: 'border-box',
34
+ cursor: 'pointer',
35
+ };
36
+ /**
37
+ * SelectContent inline styles — dropdown panel.
38
+ */
39
+ export const glchatSelectContentStyles = {
40
+ position: 'relative',
41
+ zIndex: 50,
42
+ maxHeight: 'var(--radix-select-content-available-height)',
43
+ minWidth: '8rem',
44
+ overflowY: 'auto',
45
+ overflowX: 'hidden',
46
+ borderRadius: 'var(--radius-md)',
47
+ borderWidth: '1px',
48
+ borderStyle: 'solid',
49
+ borderColor: 'hsl(var(--border))',
50
+ backgroundColor: 'hsl(var(--background))',
51
+ color: 'hsl(var(--foreground))',
52
+ boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
53
+ };
54
+ /**
55
+ * SelectViewport padding wrapper.
56
+ */
57
+ export const glchatSelectViewportStyles = {
58
+ padding: '0.25rem',
59
+ };
60
+ /**
61
+ * SelectItem inline styles.
62
+ */
63
+ export const glchatSelectItemStyles = {
64
+ position: 'relative',
65
+ display: 'flex',
66
+ width: '100%',
67
+ cursor: 'default',
68
+ userSelect: 'none',
69
+ alignItems: 'center',
70
+ borderRadius: 'var(--radius-sm)',
71
+ paddingTop: '0.375rem',
72
+ paddingBottom: '0.375rem',
73
+ paddingLeft: '0.5rem',
74
+ paddingRight: '0.5rem',
75
+ fontSize: '0.875rem',
76
+ outline: 'none',
77
+ };
78
+ /**
79
+ * SelectItem check indicator container.
80
+ */
81
+ export const glchatSelectItemIndicatorStyles = {
82
+ marginLeft: 'auto',
83
+ display: 'flex',
84
+ height: '0.875rem',
85
+ width: '0.875rem',
86
+ alignItems: 'center',
87
+ justifyContent: 'center',
88
+ };
89
+ /**
90
+ * Scroll button styles.
91
+ */
92
+ export const glchatSelectScrollButtonStyles = {
93
+ display: 'flex',
94
+ cursor: 'default',
95
+ alignItems: 'center',
96
+ justifyContent: 'center',
97
+ paddingTop: '0.25rem',
98
+ paddingBottom: '0.25rem',
99
+ };
@@ -1,7 +1,7 @@
1
1
  import { type ComponentRegistry } from '@a2ui/react';
2
2
  /**
3
3
  * Ensures the registry has the official default A2UI components
4
- * extended with GLChat-specific components (Button/Card/Timeout).
4
+ * extended with GLChat-specific components (Button/Card/CheckBox/TextField/MultipleChoice/Timeout).
5
5
  */
6
6
  export declare function ensureGlchatComponentsRegistered(registry: ComponentRegistry): void;
7
7
  //# sourceMappingURL=catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/utils/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AAQ7E;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,iBAAiB,QAc3E"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/utils/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AAW7E;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,iBAAiB,QAoB3E"}
@@ -1,11 +1,14 @@
1
1
  import { registerDefaultCatalog } from '@a2ui/react';
2
- import { CustomButtonComponent } from '../components/Button/Button.js';
3
- import { CustomCardComponent } from '../components/Card/Card.js';
4
- import { CustomTimeoutComponent } from '../components/Timeout/Timeout.js';
2
+ import { CustomButtonComponent } from '../components/a2ui/Button/Button.js';
3
+ import { CustomCardComponent } from '../components/a2ui/Card/Card.js';
4
+ import { CustomCheckBoxComponent } from '../components/a2ui/CheckBox/CheckBox.js';
5
+ import { CustomMultipleChoiceComponent } from '../components/a2ui/MultipleChoice/MultipleChoice.js';
6
+ import { CustomTextFieldComponent } from '../components/a2ui/TextField/TextField.js';
7
+ import { CustomTimeoutComponent } from '../components/a2ui/Timeout/Timeout.js';
5
8
  const registeredRegistries = new WeakSet();
6
9
  /**
7
10
  * Ensures the registry has the official default A2UI components
8
- * extended with GLChat-specific components (Button/Card/Timeout).
11
+ * extended with GLChat-specific components (Button/Card/CheckBox/TextField/MultipleChoice/Timeout).
9
12
  */
10
13
  export function ensureGlchatComponentsRegistered(registry) {
11
14
  if (registeredRegistries.has(registry))
@@ -13,9 +16,15 @@ export function ensureGlchatComponentsRegistered(registry) {
13
16
  registerDefaultCatalog(registry);
14
17
  registry.unregister('Button');
15
18
  registry.unregister('Card');
19
+ registry.unregister('CheckBox');
20
+ registry.unregister('TextField');
21
+ registry.unregister('MultipleChoice');
16
22
  registry.unregister('Timeout');
17
23
  registry.register('Button', { component: CustomButtonComponent });
18
24
  registry.register('Card', { component: CustomCardComponent });
25
+ registry.register('CheckBox', { component: CustomCheckBoxComponent });
26
+ registry.register('TextField', { component: CustomTextFieldComponent });
27
+ registry.register('MultipleChoice', { component: CustomMultipleChoiceComponent });
19
28
  registry.register('Timeout', { component: CustomTimeoutComponent });
20
29
  registeredRegistries.add(registry);
21
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAQxD,eAAO,MAAM,kBAAkB,EAAE,KAYhC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAwDjE"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAexD,eAAO,MAAM,kBAAkB,EAAE,KAiBhC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAwEjE"}