@adea-ai/ui 0.151.0 → 0.151.7
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/README.md +5 -0
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +8 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +39 -36
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +28 -4
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.d.ts.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +127 -37
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/scroll-follow-core.d.ts +13 -0
- package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow-core.js +12 -1
- package/dist/components/conversation/scroll-follow-core.js.map +1 -1
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +52 -21
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar/calendar.js +109 -115
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/lib.json +1 -1
- package/dist/r/registry.json +3 -3
- package/dist/r/src/components/composites/action-button/action-button.tsx +11 -1
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +112 -105
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +36 -2
- package/dist/r/src/components/conversation/paste-token-editor.tsx +191 -49
- package/dist/r/src/components/conversation/scroll-follow-core.ts +23 -0
- package/dist/r/src/components/conversation/scroll-follow.ts +69 -17
- package/dist/r/src/components/ui/calendar/calendar.tsx +99 -104
- package/dist/r/theming.json +1 -1
- package/package.json +9 -3
- package/registry.json +3 -3
- package/src/components/composites/action-button/action-button.tsx +11 -1
- package/src/components/composites/inline-citation/inline-citation.tsx +112 -105
- package/src/components/conversation/internal/chat-composer-shell.tsx +36 -2
- package/src/components/conversation/paste-token-editor.tsx +191 -49
- package/src/components/conversation/scroll-follow-core.ts +23 -0
- package/src/components/conversation/scroll-follow.ts +69 -17
- package/src/components/ui/calendar/calendar.tsx +99 -104
- package/src/index.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { For, Show, splitProps, type ComponentProps, type JSX } from 'solid-js'
|
|
1
|
+
import { createMemo, For, Show, splitProps, type ComponentProps, type JSX } from 'solid-js'
|
|
2
2
|
import Calendar, {
|
|
3
3
|
type RootProps as CorvuCalendarProps,
|
|
4
4
|
type RootSingleProps,
|
|
@@ -73,22 +73,6 @@ const EXTRAS = ['weekdayLabels', 'previousLabel', 'nextLabel', 'formatMonth', 'c
|
|
|
73
73
|
|
|
74
74
|
const MONTH_FORMAT: Intl.DateTimeFormatOptions = { month: 'long', year: 'numeric' }
|
|
75
75
|
|
|
76
|
-
function monthLabel(month: Date, format?: (month: Date) => string): string {
|
|
77
|
-
return format ? format(month) : new Intl.DateTimeFormat(undefined, MONTH_FORMAT).format(month)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* A day's accessible name: the full date, because the visible number is only
|
|
82
|
-
* meaningful next to its column heading.
|
|
83
|
-
*/
|
|
84
|
-
function dayLabel(day: Date): string {
|
|
85
|
-
return new Intl.DateTimeFormat(undefined, {
|
|
86
|
-
day: 'numeric',
|
|
87
|
-
month: 'long',
|
|
88
|
-
year: 'numeric',
|
|
89
|
-
}).format(day)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
76
|
/** The locale's short weekday names, Sunday first — which is the order corvu's `weeks` use. */
|
|
93
77
|
function defaultWeekdays(): string[] {
|
|
94
78
|
const format = new Intl.DateTimeFormat(undefined, { weekday: 'short' })
|
|
@@ -108,82 +92,92 @@ function CalendarGrid(props: {
|
|
|
108
92
|
formatMonth?: (month: Date) => string
|
|
109
93
|
}) {
|
|
110
94
|
const context = Calendar.useContext()
|
|
111
|
-
const weekdays = () => props.weekdayLabels ?? defaultWeekdays()
|
|
112
|
-
|
|
113
95
|
return (
|
|
114
96
|
<For each={context.months()}>
|
|
115
|
-
{(month, index) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
97
|
+
{(month, index) => {
|
|
98
|
+
const weekdays = createMemo(() => props.weekdayLabels ?? defaultWeekdays())
|
|
99
|
+
// Recreate per month so navigation picks up changed locale and time-zone defaults.
|
|
100
|
+
const dayFormatter = new Intl.DateTimeFormat(undefined, {
|
|
101
|
+
day: 'numeric',
|
|
102
|
+
month: 'long',
|
|
103
|
+
year: 'numeric',
|
|
104
|
+
})
|
|
105
|
+
const monthLabel = (date: Date) =>
|
|
106
|
+
props.formatMonth
|
|
107
|
+
? props.formatMonth(date)
|
|
108
|
+
: new Intl.DateTimeFormat(undefined, MONTH_FORMAT).format(date)
|
|
109
|
+
return (
|
|
110
|
+
<div class="flex flex-col gap-2">
|
|
111
|
+
<div class="flex items-center justify-between gap-2">
|
|
112
|
+
<Calendar.Nav
|
|
113
|
+
action="prev-month"
|
|
114
|
+
as={Button}
|
|
115
|
+
variant="ghost"
|
|
116
|
+
size="icon-sm"
|
|
117
|
+
aria-label={props.previousLabel}
|
|
118
|
+
>
|
|
119
|
+
<ChevronLeft aria-hidden="true" />
|
|
120
|
+
</Calendar.Nav>
|
|
121
|
+
<Calendar.Label index={index()} class="text-sm font-semibold text-foreground">
|
|
122
|
+
{monthLabel(month.month)}
|
|
123
|
+
</Calendar.Label>
|
|
124
|
+
<Calendar.Nav
|
|
125
|
+
action="next-month"
|
|
126
|
+
as={Button}
|
|
127
|
+
variant="ghost"
|
|
128
|
+
size="icon-sm"
|
|
129
|
+
aria-label={props.nextLabel}
|
|
130
|
+
>
|
|
131
|
+
<ChevronRight aria-hidden="true" />
|
|
132
|
+
</Calendar.Nav>
|
|
133
|
+
</div>
|
|
134
|
+
<Calendar.Table class="w-full border-collapse">
|
|
135
|
+
<thead>
|
|
136
|
+
<tr>
|
|
137
|
+
<For each={weekdays()}>
|
|
138
|
+
{(label) => (
|
|
139
|
+
<Calendar.HeadCell
|
|
140
|
+
as="th"
|
|
141
|
+
scope="col"
|
|
142
|
+
class="pb-1 text-2xs font-medium text-muted-foreground"
|
|
143
|
+
>
|
|
144
|
+
{label}
|
|
145
|
+
</Calendar.HeadCell>
|
|
146
|
+
)}
|
|
147
|
+
</For>
|
|
148
|
+
</tr>
|
|
149
|
+
</thead>
|
|
150
|
+
<tbody>
|
|
151
|
+
<For each={month.weeks}>
|
|
152
|
+
{(week) => (
|
|
153
|
+
<tr>
|
|
154
|
+
<For each={week}>
|
|
155
|
+
{(day) => (
|
|
156
|
+
<Calendar.Cell as="td" class="p-0.5 text-center">
|
|
157
|
+
<Calendar.CellTrigger
|
|
158
|
+
as="button"
|
|
159
|
+
day={day}
|
|
160
|
+
month={month.month}
|
|
161
|
+
class={cn(
|
|
162
|
+
'w-full rounded-md text-xs text-foreground transition-colors',
|
|
163
|
+
'min-h-control-xs',
|
|
164
|
+
'hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',
|
|
165
|
+
// Styled from data states, so a day can be a range
|
|
166
|
+
// end and today at once without a prop per pair.
|
|
167
|
+
'data-selected:bg-primary data-selected:text-primary-foreground',
|
|
168
|
+
// corvu marks every day of a range selected, so the
|
|
169
|
+
// span between the ends steps back to the subtle
|
|
170
|
+
// fill and the ends take the solid one again.
|
|
171
|
+
'data-in-range:bg-primary-subtle data-in-range:text-foreground',
|
|
172
|
+
'data-range-start:bg-primary data-range-start:text-primary-foreground',
|
|
173
|
+
'data-range-end:bg-primary data-range-end:text-primary-foreground',
|
|
174
|
+
'data-range-start:rounded-r-none data-range-end:rounded-l-none',
|
|
175
|
+
'data-today:ring-1 data-today:ring-ring',
|
|
176
|
+
'data-disabled:text-muted-foreground data-disabled:line-through',
|
|
177
|
+
'data-disabled:hover:bg-transparent'
|
|
178
|
+
)}
|
|
179
|
+
>
|
|
180
|
+
{/*
|
|
187
181
|
The trigger renders no children of its own, so the
|
|
188
182
|
day number is the caller's — without it every cell
|
|
189
183
|
is an unnamed button (`button-name`).
|
|
@@ -194,19 +188,20 @@ function CalendarGrid(props: {
|
|
|
194
188
|
is hidden from the accessibility tree and the date
|
|
195
189
|
supplies the name.
|
|
196
190
|
*/}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
191
|
+
<span aria-hidden="true">{day.getDate()}</span>
|
|
192
|
+
<span class="visually-hidden">{dayFormatter.format(day)}</span>
|
|
193
|
+
</Calendar.CellTrigger>
|
|
194
|
+
</Calendar.Cell>
|
|
195
|
+
)}
|
|
196
|
+
</For>
|
|
197
|
+
</tr>
|
|
198
|
+
)}
|
|
199
|
+
</For>
|
|
200
|
+
</tbody>
|
|
201
|
+
</Calendar.Table>
|
|
202
|
+
</div>
|
|
203
|
+
)
|
|
204
|
+
}}
|
|
210
205
|
</For>
|
|
211
206
|
)
|
|
212
207
|
}
|
package/src/index.ts
CHANGED
|
@@ -95,6 +95,7 @@ export * from './components/layout/virtual-window'
|
|
|
95
95
|
export * from './components/layout/app-shell'
|
|
96
96
|
export * from './components/layout/page'
|
|
97
97
|
export * from './components/layout/panel'
|
|
98
|
+
export * from './components/layout/pixel-pane'
|
|
98
99
|
export * from './components/layout/side-rail'
|
|
99
100
|
export * from './components/layout/sidebar-nav'
|
|
100
101
|
export * from './components/layout/contextual-sidebar'
|