@adea-ai/ui 0.110.0 → 0.111.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/components/composites/account-menu/account-menu.js +1 -1
- package/dist/components/composites/action-button/action-button.js +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +17 -2
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +47 -122
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +0 -4
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +60 -68
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/index.js +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +5 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +0 -3
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +1 -1
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +17 -11
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js +1 -1
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +22 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +79 -30
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar/menubar.js +2 -2
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/select/index.d.ts +1 -0
- package/dist/components/ui/select/index.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts +7 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +34 -20
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js +1 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts +16 -6
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +17 -6
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/overlay.d.ts +30 -1
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +37 -2
- package/dist/lib/overlay.js.map +1 -1
- package/dist/r/dialog.json +1 -0
- package/dist/r/registry.json +2 -1
- package/dist/r/split-layout.json +1 -1
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +4 -3
- package/dist/r/src/components/theme/appearance-panel.tsx +0 -1
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
- package/dist/r/src/components/ui/combobox/combobox.tsx +3 -1
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +6 -2
- package/dist/r/src/components/ui/dialog/dialog.tsx +19 -12
- package/dist/r/src/components/ui/drawer/drawer.tsx +1 -1
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
- package/dist/r/src/components/ui/dropdown-menu/index.ts +1 -0
- package/dist/r/src/components/ui/menubar/menubar.tsx +6 -2
- package/dist/r/src/components/ui/select/index.ts +1 -0
- package/dist/r/src/components/ui/select/select.tsx +31 -6
- package/dist/r/src/components/ui/sheet/sheet.tsx +1 -1
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +34 -3
- package/dist/r/src/lib/overlay.ts +45 -1
- package/package.json +1 -1
- package/registry.json +2 -1
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
- package/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
- package/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
- package/src/components/layout/split-layout/split-layout.tsx +4 -3
- package/src/components/theme/appearance-panel.tsx +0 -1
- package/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
- package/src/components/ui/combobox/combobox.tsx +3 -1
- package/src/components/ui/context-menu/context-menu.tsx +6 -2
- package/src/components/ui/dialog/dialog.tsx +19 -12
- package/src/components/ui/drawer/drawer.tsx +1 -1
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
- package/src/components/ui/dropdown-menu/index.ts +1 -0
- package/src/components/ui/menubar/menubar.tsx +6 -2
- package/src/components/ui/select/index.ts +1 -0
- package/src/components/ui/select/select.tsx +31 -6
- package/src/components/ui/sheet/sheet.tsx +1 -1
- package/src/components/ui/tooltip/tooltip.tsx +34 -3
- package/src/lib/overlay.ts +45 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'
|
|
2
|
-
import type { ComponentProps } from 'solid-js'
|
|
2
|
+
import type { ComponentProps, JSX } from 'solid-js'
|
|
3
3
|
import {
|
|
4
4
|
createContext,
|
|
5
5
|
createEffect,
|
|
6
6
|
createSignal,
|
|
7
7
|
createUniqueId,
|
|
8
8
|
onCleanup,
|
|
9
|
+
Show,
|
|
9
10
|
splitProps,
|
|
10
11
|
useContext,
|
|
11
12
|
} from 'solid-js'
|
|
12
13
|
import { isServer } from 'solid-js/web'
|
|
13
|
-
import { tooltipTip } from '#lib/overlay'
|
|
14
|
+
import { tooltipTip, topLayerProps } from '#lib/overlay'
|
|
14
15
|
import { cn } from '#lib/utils'
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -349,13 +350,24 @@ export function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigg
|
|
|
349
350
|
)
|
|
350
351
|
}
|
|
351
352
|
|
|
352
|
-
export type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content>
|
|
353
|
+
export type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {
|
|
354
|
+
/**
|
|
355
|
+
* A leading icon, repeating the trigger's glyph inside the tip — the side
|
|
356
|
+
* rail's icon+label treatment, offered so a toolbar or rail tooltip does not
|
|
357
|
+
* have to hand-roll it. Decorative by contract: the tip is `aria-hidden`
|
|
358
|
+
* while closed and never the accessible name, so the icon must not be the
|
|
359
|
+
* only carrier of meaning. Size it by leaving the svg bare; the slot fixes
|
|
360
|
+
* it to the system's control size.
|
|
361
|
+
*/
|
|
362
|
+
icon?: JSX.Element
|
|
363
|
+
}
|
|
353
364
|
|
|
354
365
|
export function TooltipContent(props: TooltipContentProps) {
|
|
355
366
|
const interaction = useContext(TooltipInteractionContext)
|
|
356
367
|
const [local, rest] = splitProps(props, [
|
|
357
368
|
'class',
|
|
358
369
|
'children',
|
|
370
|
+
'icon',
|
|
359
371
|
'aria-hidden',
|
|
360
372
|
'onEscapeKeyDown',
|
|
361
373
|
'onPointerDownOutside',
|
|
@@ -380,6 +392,9 @@ export function TooltipContent(props: TooltipContentProps) {
|
|
|
380
392
|
'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
|
|
381
393
|
'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
382
394
|
'data-expanded:duration-150 data-closed:duration-100',
|
|
395
|
+
// An icon+label tip is one row that reads as a unit, so the label
|
|
396
|
+
// never wraps under the glyph.
|
|
397
|
+
{ 'flex items-center gap-2 whitespace-nowrap': !!local.icon },
|
|
383
398
|
local.class
|
|
384
399
|
)}
|
|
385
400
|
// A tooltip is never interactive: the content is plain text, and the
|
|
@@ -397,8 +412,24 @@ export function TooltipContent(props: TooltipContentProps) {
|
|
|
397
412
|
invokeEventHandler(local.onPointerDownOutside, event)
|
|
398
413
|
if (!event.defaultPrevented) interaction?.markCloseIntent()
|
|
399
414
|
}}
|
|
415
|
+
// A tooltip opened from inside a modal dialog is part of that dialog's
|
|
416
|
+
// surface, so it carries the same top-layer exemption as a menu or a
|
|
417
|
+
// popover — without it the dialog's hide-outside observer aria-hides
|
|
418
|
+
// the tip while it is on screen.
|
|
419
|
+
{...topLayerProps}
|
|
400
420
|
{...rest}
|
|
401
421
|
>
|
|
422
|
+
<Show when={local.icon}>
|
|
423
|
+
{(icon) => (
|
|
424
|
+
<span
|
|
425
|
+
data-slot="tooltip-icon"
|
|
426
|
+
aria-hidden="true"
|
|
427
|
+
class="flex size-4 shrink-0 items-center justify-center [&_svg]:size-4"
|
|
428
|
+
>
|
|
429
|
+
{icon()}
|
|
430
|
+
</span>
|
|
431
|
+
)}
|
|
432
|
+
</Show>
|
|
402
433
|
{local.children}
|
|
403
434
|
</KobalteTooltip.Content>
|
|
404
435
|
</KobalteTooltip.Portal>
|
package/src/lib/overlay.ts
CHANGED
|
@@ -10,10 +10,29 @@
|
|
|
10
10
|
* "an overlay looks like this" a fact rather than a convention.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
import { cva, type VariantProps } from '#lib/variants'
|
|
14
|
+
|
|
15
|
+
/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers
|
|
16
|
+
* and the command palette float on the elevated overlay rung (`--popover`). */
|
|
14
17
|
export const overlaySurface =
|
|
15
18
|
'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'
|
|
16
19
|
|
|
20
|
+
/**
|
|
21
|
+
* The modal panel: the same hairline edge, radius and elevation, painted on the
|
|
22
|
+
* *neutral* theme surface instead of the elevated overlay rung.
|
|
23
|
+
*
|
|
24
|
+
* `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies
|
|
25
|
+
* the canvas hue's chroma on the elevated step. On the dark default's violet
|
|
26
|
+
* canvas that makes the dialog the most chromatic surface in the ladder —
|
|
27
|
+
* `oklch(0.2406 0.0088 300.91)`, red above green in sRGB — and on a full dialog
|
|
28
|
+
* panel that cast reads as a warm tint the canvas never has. shadcn's own
|
|
29
|
+
* convention already splits the two: a Dialog paints `bg-background`, menus and
|
|
30
|
+
* popovers paint `bg-popover`. The veil, the hairline and the elevation shadow
|
|
31
|
+
* carry the separation the lighter fill no longer provides.
|
|
32
|
+
*/
|
|
33
|
+
export const dialogSurface =
|
|
34
|
+
'bg-background text-foreground rounded-xl border border-border shadow-lg'
|
|
35
|
+
|
|
17
36
|
/**
|
|
18
37
|
* Overlay titles have one fixed typography role. Keep this small recipe shared
|
|
19
38
|
* without loading the configurable Heading component into every dialog.
|
|
@@ -85,6 +104,31 @@ export const menuLabel =
|
|
|
85
104
|
/** The rule between menu groups. */
|
|
86
105
|
export const menuSeparator = 'bg-border -mx-1 my-1 h-px'
|
|
87
106
|
|
|
107
|
+
/**
|
|
108
|
+
* A leading colour swatch on a menu or select row: the sanctioned way to carry
|
|
109
|
+
* a card-tone colour into a list of options. The tones are the system's accent
|
|
110
|
+
* and status roles — the vocabulary a Badge already speaks — so the colour an
|
|
111
|
+
* option shows in a menu is the colour its badge carries on a card, and a
|
|
112
|
+
* caller never passes a raw colour into a list. The dot is `aria-hidden`; the
|
|
113
|
+
* label carries the meaning, so a tone is never the only signal.
|
|
114
|
+
*/
|
|
115
|
+
export const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {
|
|
116
|
+
variants: {
|
|
117
|
+
tone: {
|
|
118
|
+
neutral: 'bg-muted-foreground',
|
|
119
|
+
primary: 'bg-primary',
|
|
120
|
+
success: 'bg-success',
|
|
121
|
+
warning: 'bg-warning',
|
|
122
|
+
destructive: 'bg-destructive',
|
|
123
|
+
info: 'bg-info',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
defaultVariants: { tone: 'neutral' },
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
/** The tones a menu row's swatch can take. */
|
|
130
|
+
export type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>
|
|
131
|
+
|
|
88
132
|
/** Padding shared by every menu-list surface. */
|
|
89
133
|
export const menuContentPadding = 'p-1'
|
|
90
134
|
|