@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.
Files changed (47) hide show
  1. package/README.md +5 -0
  2. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  3. package/dist/components/composites/action-button/action-button.js +8 -2
  4. package/dist/components/composites/action-button/action-button.js.map +1 -1
  5. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
  6. package/dist/components/composites/inline-citation/inline-citation.js +39 -36
  7. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  8. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  9. package/dist/components/conversation/internal/chat-composer-shell.js +28 -4
  10. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  11. package/dist/components/conversation/paste-token-editor.d.ts.map +1 -1
  12. package/dist/components/conversation/paste-token-editor.js +127 -37
  13. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  14. package/dist/components/conversation/scroll-follow-core.d.ts +13 -0
  15. package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
  16. package/dist/components/conversation/scroll-follow-core.js +12 -1
  17. package/dist/components/conversation/scroll-follow-core.js.map +1 -1
  18. package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
  19. package/dist/components/conversation/scroll-follow.js +52 -21
  20. package/dist/components/conversation/scroll-follow.js.map +1 -1
  21. package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
  22. package/dist/components/ui/calendar/calendar.js +109 -115
  23. package/dist/components/ui/calendar/calendar.js.map +1 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +2 -1
  27. package/dist/r/appearance-editor.json +1 -1
  28. package/dist/r/lib.json +1 -1
  29. package/dist/r/registry.json +3 -3
  30. package/dist/r/src/components/composites/action-button/action-button.tsx +11 -1
  31. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +112 -105
  32. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +36 -2
  33. package/dist/r/src/components/conversation/paste-token-editor.tsx +191 -49
  34. package/dist/r/src/components/conversation/scroll-follow-core.ts +23 -0
  35. package/dist/r/src/components/conversation/scroll-follow.ts +69 -17
  36. package/dist/r/src/components/ui/calendar/calendar.tsx +99 -104
  37. package/dist/r/theming.json +1 -1
  38. package/package.json +9 -3
  39. package/registry.json +3 -3
  40. package/src/components/composites/action-button/action-button.tsx +11 -1
  41. package/src/components/composites/inline-citation/inline-citation.tsx +112 -105
  42. package/src/components/conversation/internal/chat-composer-shell.tsx +36 -2
  43. package/src/components/conversation/paste-token-editor.tsx +191 -49
  44. package/src/components/conversation/scroll-follow-core.ts +23 -0
  45. package/src/components/conversation/scroll-follow.ts +69 -17
  46. package/src/components/ui/calendar/calendar.tsx +99 -104
  47. 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
- <div class="flex flex-col gap-2">
117
- <div class="flex items-center justify-between gap-2">
118
- <Calendar.Nav
119
- action="prev-month"
120
- as={Button}
121
- variant="ghost"
122
- size="icon-sm"
123
- aria-label={props.previousLabel}
124
- >
125
- <ChevronLeft aria-hidden="true" />
126
- </Calendar.Nav>
127
- <Calendar.Label index={index()} class="text-sm font-semibold text-foreground">
128
- {monthLabel(month.month, props.formatMonth)}
129
- </Calendar.Label>
130
- <Calendar.Nav
131
- action="next-month"
132
- as={Button}
133
- variant="ghost"
134
- size="icon-sm"
135
- aria-label={props.nextLabel}
136
- >
137
- <ChevronRight aria-hidden="true" />
138
- </Calendar.Nav>
139
- </div>
140
- <Calendar.Table class="w-full border-collapse">
141
- <thead>
142
- <tr>
143
- <For each={weekdays()}>
144
- {(label) => (
145
- <Calendar.HeadCell
146
- as="th"
147
- scope="col"
148
- class="pb-1 text-2xs font-medium text-muted-foreground"
149
- >
150
- {label}
151
- </Calendar.HeadCell>
152
- )}
153
- </For>
154
- </tr>
155
- </thead>
156
- <tbody>
157
- <For each={month.weeks}>
158
- {(week) => (
159
- <tr>
160
- <For each={week}>
161
- {(day) => (
162
- <Calendar.Cell as="td" class="p-0.5 text-center">
163
- <Calendar.CellTrigger
164
- as="button"
165
- day={day}
166
- month={month.month}
167
- class={cn(
168
- 'w-full rounded-md text-xs text-foreground transition-colors',
169
- 'min-h-control-xs',
170
- 'hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',
171
- // Styled from data states, so a day can be a range
172
- // end and today at once without a prop per pair.
173
- 'data-selected:bg-primary data-selected:text-primary-foreground',
174
- // corvu marks every day of a range selected, so the
175
- // span between the ends steps back to the subtle
176
- // fill and the ends take the solid one again.
177
- 'data-in-range:bg-primary-subtle data-in-range:text-foreground',
178
- 'data-range-start:bg-primary data-range-start:text-primary-foreground',
179
- 'data-range-end:bg-primary data-range-end:text-primary-foreground',
180
- 'data-range-start:rounded-r-none data-range-end:rounded-l-none',
181
- 'data-today:ring-1 data-today:ring-ring',
182
- 'data-disabled:text-muted-foreground data-disabled:line-through',
183
- 'data-disabled:hover:bg-transparent'
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
- <span aria-hidden="true">{day.getDate()}</span>
198
- <span class="visually-hidden">{dayLabel(day)}</span>
199
- </Calendar.CellTrigger>
200
- </Calendar.Cell>
201
- )}
202
- </For>
203
- </tr>
204
- )}
205
- </For>
206
- </tbody>
207
- </Calendar.Table>
208
- </div>
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'