@estiva-app/ui 0.21.1 → 0.22.0
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/dist/Avatar.d.ts +3 -0
- package/dist/Avatar.d.ts.map +1 -1
- package/dist/ChipInput.d.ts +3 -0
- package/dist/ChipInput.d.ts.map +1 -1
- package/dist/CommandPalette.d.ts +6 -0
- package/dist/CommandPalette.d.ts.map +1 -1
- package/dist/IdentityMenu.d.ts +3 -0
- package/dist/IdentityMenu.d.ts.map +1 -1
- package/dist/Menu.d.ts +7 -0
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Skeleton.d.ts +2 -0
- package/dist/Skeleton.d.ts.map +1 -1
- package/dist/Toast.d.ts +5 -0
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toolbar.d.ts +4 -0
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Tooltip.d.ts +4 -0
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/index.js.map +2 -2
- package/dist/registry/build-GOVLABI6.js +13 -0
- package/dist/registry/build-GOVLABI6.js.map +7 -0
- package/dist/registry/build.d.ts +29 -0
- package/dist/registry/build.d.ts.map +1 -0
- package/dist/registry/chunk-IJNCYVH4.js +163 -0
- package/dist/registry/chunk-IJNCYVH4.js.map +7 -0
- package/dist/registry/chunk-MRSBS5OP.js +99 -0
- package/dist/registry/chunk-MRSBS5OP.js.map +7 -0
- package/dist/registry/chunk-QDYGB3QN.js +352 -0
- package/dist/registry/chunk-QDYGB3QN.js.map +7 -0
- package/dist/registry/cli.d.ts +2 -0
- package/dist/registry/cli.d.ts.map +1 -0
- package/dist/registry/cli.js +121 -0
- package/dist/registry/cli.js.map +7 -0
- package/dist/registry/find.d.ts +43 -0
- package/dist/registry/find.d.ts.map +1 -0
- package/dist/registry/index.d.ts +14 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +26 -0
- package/dist/registry/index.js.map +7 -0
- package/dist/registry/schema.d.ts +147 -0
- package/dist/registry/schema.d.ts.map +1 -0
- package/package.json +15 -2
- package/registry.json +4470 -0
- package/src/Avatar.tsx +3 -0
- package/src/ChipInput.tsx +3 -0
- package/src/CommandPalette.tsx +6 -0
- package/src/IdentityMenu.tsx +3 -0
- package/src/Menu.tsx +7 -0
- package/src/Skeleton.tsx +2 -0
- package/src/Toast.tsx +5 -0
- package/src/Toolbar.tsx +4 -0
- package/src/Tooltip.tsx +4 -0
- package/src/registry/build.ts +590 -0
- package/src/registry/cli.ts +141 -0
- package/src/registry/find.ts +195 -0
- package/src/registry/index.ts +24 -0
- package/src/registry/registry.test.ts +448 -0
- package/src/registry/schema.ts +268 -0
package/src/Avatar.tsx
CHANGED
|
@@ -29,6 +29,9 @@ import { cn } from './cn'
|
|
|
29
29
|
*/
|
|
30
30
|
const HUES = ['#56c8ff', '#ff8f6b', '#4ade8c', '#b18cff', '#ffc94d', '#ff7eb0', '#7ea8ff', '#5fdfd6']
|
|
31
31
|
|
|
32
|
+
/** The colour a person's initials sit on, chosen from a key: the same key
|
|
33
|
+
* always gives the same hue, so a face reads as theirs in every app. The
|
|
34
|
+
* eight are a fallback palette, not tokens — see the note above `HUES`. */
|
|
32
35
|
export const hueFor = (key: string) => {
|
|
33
36
|
let h = 0
|
|
34
37
|
for (let i = 0; i < key.length; i++) h = (h * 31 + key.charCodeAt(i)) | 0
|
package/src/ChipInput.tsx
CHANGED
|
@@ -54,6 +54,9 @@ export interface InputChipProps {
|
|
|
54
54
|
className?: string
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/** A chip standing on its own: a label, an optional leading icon, an optional
|
|
58
|
+
* ✕. For a caller that keeps its own list. Inside a `ChipInput` the same look
|
|
59
|
+
* goes onto Base UI's `Combobox.Chip`, which joins the field's keyboard. */
|
|
57
60
|
export function InputChip({ label, leading, onRemove, removeLabel, truncate, className }: InputChipProps) {
|
|
58
61
|
return (
|
|
59
62
|
<div className={cn(CHIP_BOX, chipPadding(!!leading, !!onRemove), className)}>
|
package/src/CommandPalette.tsx
CHANGED
|
@@ -237,6 +237,9 @@ export interface CommandPaletteSearchProps {
|
|
|
237
237
|
|
|
238
238
|
type ListGroup = { value: string; items: CommandPaletteRow[] }
|
|
239
239
|
|
|
240
|
+
/** The palette as a search: a query field, rows in labelled groups walked with
|
|
241
|
+
* the arrow keys, and what to show while nothing has arrived and when nothing
|
|
242
|
+
* matches. */
|
|
240
243
|
export function CommandPaletteSearch({ query, onQueryChange, placeholder, groups, chip, pending, notes = [], empty, children }: CommandPaletteSearchProps) {
|
|
241
244
|
const { modKey, popupRef } = usePalette('CommandPaletteSearch')
|
|
242
245
|
const back = useBack(chip, popupRef)
|
|
@@ -478,6 +481,9 @@ function isTextField(el: Element | null): el is HTMLInputElement | HTMLTextAreaE
|
|
|
478
481
|
return el instanceof HTMLInputElement && TEXT_TYPES.has(el.getAttribute('type') ?? '') && el.getAttribute('role') !== 'combobox' && el.tabIndex >= 0
|
|
479
482
|
}
|
|
480
483
|
|
|
484
|
+
/** The palette as a form: fields, one submit button, and Ctrl+Enter — both ways
|
|
485
|
+
* in run Base UI's field check. It shows what it is working on and what failed,
|
|
486
|
+
* and sends focus to the first field that needs something. */
|
|
481
487
|
export function CommandPaletteForm({ chip, icon, submitLabel, onSubmit, submitWaits, working, error, children }: CommandPaletteFormProps) {
|
|
482
488
|
const { modKey, popupRef } = usePalette('CommandPaletteForm')
|
|
483
489
|
const back = useBack(chip, popupRef)
|
package/src/IdentityMenu.tsx
CHANGED
|
@@ -62,6 +62,9 @@ export interface IdentityPanelProps extends Omit<IdentityMenuProps, 'compact'> {
|
|
|
62
62
|
onClose?: () => void
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/** The identity rows on a panel of their own, with no menu around them — for a
|
|
66
|
+
* docs page, or anywhere the panel is already placed. `IdentityMenu` is the
|
|
67
|
+
* same rows inside a real menu. */
|
|
65
68
|
export function IdentityPanel({ className, onClose = () => {}, ...rest }: IdentityPanelProps) {
|
|
66
69
|
return (
|
|
67
70
|
<MenuPanel className={cn('w-72', className)}>
|
package/src/Menu.tsx
CHANGED
|
@@ -86,6 +86,10 @@ export interface MenuPanelProps extends Omit<ComponentPropsWithRef<'div'>, 'chil
|
|
|
86
86
|
children?: ReactNode
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/** The menu's surface without the menu: the elevated box, the rows' padding,
|
|
90
|
+
* and a divider that runs the full width of what it separates. `Menu` renders
|
|
91
|
+
* its popup as one. On its own it is for the places that draw a menu's look
|
|
92
|
+
* but not its behaviour — a docs page, Peek's `@`, `/` and `[` pickers. */
|
|
89
93
|
export function MenuPanel({ children, className, ...props }: MenuPanelProps) {
|
|
90
94
|
return (
|
|
91
95
|
<div
|
|
@@ -277,6 +281,9 @@ export interface MenuSubProps {
|
|
|
277
281
|
className?: string
|
|
278
282
|
}
|
|
279
283
|
|
|
284
|
+
/** A row that opens another menu beside it; its rows are this row's children.
|
|
285
|
+
* Never inside a menu opened on hover — leaving the submenu strands both open,
|
|
286
|
+
* measured below. */
|
|
280
287
|
export function MenuSub({ label, leading, selected, children, className }: MenuSubProps) {
|
|
281
288
|
/*
|
|
282
289
|
* A submenu inside a hover-opened menu strands it.
|
package/src/Skeleton.tsx
CHANGED
|
@@ -10,6 +10,8 @@ import { cn } from './cn'
|
|
|
10
10
|
* A list reveals after 150ms (`animate-skeleton-in`, in the preset) so a
|
|
11
11
|
* fast load never flashes a skeleton — Peek's rule.
|
|
12
12
|
*/
|
|
13
|
+
/** One pulsing bar at the inset colour: the piece every placeholder here is
|
|
14
|
+
* built from. It draws nothing of its own — give it a width and a height. */
|
|
13
15
|
export function SkeletonBar({ className, style }: { className?: string; style?: CSSProperties }) {
|
|
14
16
|
return <div className={cn('bg-bg-inset rounded-sm animate-pulse', className)} style={style} />
|
|
15
17
|
}
|
package/src/Toast.tsx
CHANGED
|
@@ -153,6 +153,9 @@ const ToastContext = createContext<ToastValue | null>(null)
|
|
|
153
153
|
/** D7: three on screen at once. */
|
|
154
154
|
const VISIBLE_TOASTS = 3
|
|
155
155
|
|
|
156
|
+
/** Mount once, near the top of an app. It owns the stack, the timers and the
|
|
157
|
+
* portal every toast goes through, and it is what `useToast` talks to. Three
|
|
158
|
+
* show at once; a fourth waits for one of them to close. */
|
|
156
159
|
export function ToastProvider({ children }: { children: ReactNode }) {
|
|
157
160
|
// One manager per provider, so `useToast` can add and close without
|
|
158
161
|
// re-rendering every caller each time the list changes.
|
|
@@ -227,6 +230,8 @@ function ToastList() {
|
|
|
227
230
|
})
|
|
228
231
|
}
|
|
229
232
|
|
|
233
|
+
/** How anything under a `ToastProvider` raises a toast (`showToast`) or takes
|
|
234
|
+
* one away (`dismissToast`). Throws outside a provider. */
|
|
230
235
|
export function useToast(): ToastValue {
|
|
231
236
|
const ctx = useContext(ToastContext)
|
|
232
237
|
if (!ctx) throw new Error('useToast must be used within ToastProvider')
|
package/src/Toolbar.tsx
CHANGED
|
@@ -104,6 +104,8 @@ export interface ToolbarButtonProps extends IconButtonProps {
|
|
|
104
104
|
ref?: Ref<HTMLButtonElement>
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/** An `IconButton` that is an item of a `Toolbar`: the arrow keys reach it, and
|
|
108
|
+
* a disabled one stays in the walk so its reason can still be read. */
|
|
107
109
|
export function ToolbarButton({ ref, disabled, disabledReason, ...props }: ToolbarButtonProps) {
|
|
108
110
|
return (
|
|
109
111
|
<BaseToolbar.Button
|
|
@@ -137,6 +139,8 @@ export function ToolbarButton({ ref, disabled, disabledReason, ...props }: Toolb
|
|
|
137
139
|
*/
|
|
138
140
|
export type ToolbarInputProps = TextInputProps
|
|
139
141
|
|
|
142
|
+
/** A `TextInput` that is an item of a `Toolbar`, so the arrow keys walk into the
|
|
143
|
+
* field and out of it again. */
|
|
140
144
|
export function ToolbarInput({ size, ...props }: ToolbarInputProps) {
|
|
141
145
|
// `size` is TextInput's own (default or small), not the native attribute
|
|
142
146
|
// Base UI's part would take, so it goes to the field it draws.
|
package/src/Tooltip.tsx
CHANGED
|
@@ -146,6 +146,10 @@ function TooltipSurface({ label, shortcut, placement }: { label: string; shortcu
|
|
|
146
146
|
)
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
/** A tooltip on something that cannot be its own trigger — a span, a `Chip`,
|
|
150
|
+
* an icon. It wraps what it is given in an element that carries the handlers.
|
|
151
|
+
* A control that can be the trigger does it itself: `IconButton` takes a
|
|
152
|
+
* `tooltip` prop, and `Button` shows a `disabledReason` the same way. */
|
|
149
153
|
export function WithTooltip({ label, shortcut, placement = 'top', wrapperClassName, children }: WithTooltipProps) {
|
|
150
154
|
return (
|
|
151
155
|
<BaseTooltip.Root disableHoverablePopup>
|