@wallarm-org/design-system 0.85.1 → 0.86.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/DropdownMenu/DropdownMenu.d.ts +8 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +2 -1
- package/dist/components/Popover/Popover.d.ts +9 -0
- package/dist/components/Popover/Popover.js +2 -1
- package/dist/components/Table/TableColumnMenu/TableColumnMenu.js +8 -1
- package/dist/components/Tooltip/Tooltip.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.js +2 -1
- package/dist/metadata/components.json +18 -2
- package/package.json +1 -1
|
@@ -20,6 +20,14 @@ interface DropdownMenuProps extends TestableProps {
|
|
|
20
20
|
onHighlightChange?: (details: Menu.HighlightChangeDetails) => void;
|
|
21
21
|
/** Whether selecting an item closes the menu (default true) */
|
|
22
22
|
closeOnSelect?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Override the trigger element's id. Pass the same id to another
|
|
25
|
+
* compound component's `ids.trigger` (e.g. `Tooltip`, `Popover`) to
|
|
26
|
+
* compose their triggers on one element via nested `asChild` without an
|
|
27
|
+
* extra wrapper node — otherwise the outer trigger's id wins and the
|
|
28
|
+
* other component can't find its own anchor.
|
|
29
|
+
*/
|
|
30
|
+
ids?: Menu.RootProps['ids'];
|
|
23
31
|
}
|
|
24
32
|
export declare const DropdownMenu: FC<DropdownMenuProps>;
|
|
25
33
|
export {};
|
|
@@ -15,7 +15,7 @@ const SUB_POSITIONING = {
|
|
|
15
15
|
crossAxis: -9
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
const DropdownMenu = ({ children, open, defaultOpen, onOpenChange, anchorPoint, positioning, highlightedValue, onHighlightChange, closeOnSelect, 'data-testid': testIdProp, ...props })=>{
|
|
18
|
+
const DropdownMenu = ({ children, open, defaultOpen, onOpenChange, anchorPoint, positioning, highlightedValue, onHighlightChange, closeOnSelect, ids, 'data-testid': testIdProp, ...props })=>{
|
|
19
19
|
const inheritedTestId = useTestId();
|
|
20
20
|
const testId = testIdProp ?? inheritedTestId;
|
|
21
21
|
const parent = useDropdownMenuContext();
|
|
@@ -45,6 +45,7 @@ const DropdownMenu = ({ children, open, defaultOpen, onOpenChange, anchorPoint,
|
|
|
45
45
|
open: open,
|
|
46
46
|
defaultOpen: defaultOpen,
|
|
47
47
|
onOpenChange: handleOpenChange,
|
|
48
|
+
ids: ids,
|
|
48
49
|
lazyMount: true,
|
|
49
50
|
unmountOnExit: true,
|
|
50
51
|
children: children
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { Popover as ArkUiPopover } from '@ark-ui/react';
|
|
2
3
|
import { type TestableProps } from '../../utils/testId';
|
|
3
4
|
export interface PopoverProps extends TestableProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
open?: boolean;
|
|
6
7
|
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Override the trigger element's id. Pass the same id to another
|
|
10
|
+
* compound component's `ids.trigger` (e.g. `Tooltip`, `DropdownMenu`) to
|
|
11
|
+
* compose their triggers on one element via nested `asChild` without an
|
|
12
|
+
* extra wrapper node — otherwise the outer trigger's id wins and the
|
|
13
|
+
* other component can't find its own anchor.
|
|
14
|
+
*/
|
|
15
|
+
ids?: ArkUiPopover.RootProps['ids'];
|
|
7
16
|
}
|
|
8
17
|
export declare const Popover: FC<PopoverProps>;
|
|
@@ -7,7 +7,7 @@ const POPOVER_POSITIONING_DEFAULT = {
|
|
|
7
7
|
mainAxis: 12
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
const Popover_Popover = ({ children, open, onOpenChange, 'data-testid': testIdProp })=>{
|
|
10
|
+
const Popover_Popover = ({ children, open, onOpenChange, ids, 'data-testid': testIdProp })=>{
|
|
11
11
|
const inheritedTestId = useTestId();
|
|
12
12
|
const testId = testIdProp ?? inheritedTestId;
|
|
13
13
|
const handleOpenChange = ({ open })=>{
|
|
@@ -19,6 +19,7 @@ const Popover_Popover = ({ children, open, onOpenChange, 'data-testid': testIdPr
|
|
|
19
19
|
positioning: POPOVER_POSITIONING_DEFAULT,
|
|
20
20
|
open: open,
|
|
21
21
|
onOpenChange: handleOpenChange,
|
|
22
|
+
ids: ids,
|
|
22
23
|
lazyMount: true,
|
|
23
24
|
unmountOnExit: true,
|
|
24
25
|
children: children
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useState } from "react";
|
|
2
|
+
import { createContext, useContext, useId, useState } from "react";
|
|
3
3
|
import { Check, ChevronsDown, Ellipsis } from "../../../icons/index.js";
|
|
4
4
|
import { cn } from "../../../utils/cn.js";
|
|
5
5
|
import { useTestId } from "../../../utils/testId.js";
|
|
@@ -22,6 +22,7 @@ const TableColumnMenu = ({ column, children, className, 'data-testid': testIdPro
|
|
|
22
22
|
const ctx = useTableContext();
|
|
23
23
|
const testId = useTestId('column-menu', testIdProp);
|
|
24
24
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
25
|
+
const triggerId = useId();
|
|
25
26
|
const isAlwaysPinned = ctx.alwaysPinnedLeft.includes(column.id);
|
|
26
27
|
const canSort = ctx.sortingEnabled && column.getCanSort();
|
|
27
28
|
const canPin = ctx.pinningEnabled && column.getCanPin() && !isAlwaysPinned;
|
|
@@ -36,9 +37,15 @@ const TableColumnMenu = ({ column, children, className, 'data-testid': testIdPro
|
|
|
36
37
|
className: "shrink-0 inline-flex opacity-0 group-hover:opacity-100 has-[>_[data-state=open]]:opacity-100 transition-opacity",
|
|
37
38
|
children: /*#__PURE__*/ jsxs(Tooltip, {
|
|
38
39
|
disabled: menuOpen,
|
|
40
|
+
ids: {
|
|
41
|
+
trigger: triggerId
|
|
42
|
+
},
|
|
39
43
|
children: [
|
|
40
44
|
/*#__PURE__*/ jsxs(DropdownMenu, {
|
|
41
45
|
onOpenChange: setMenuOpen,
|
|
46
|
+
ids: {
|
|
47
|
+
trigger: triggerId
|
|
48
|
+
},
|
|
42
49
|
children: [
|
|
43
50
|
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
44
51
|
asChild: true,
|
|
@@ -14,5 +14,13 @@ export interface TooltipProps extends TestableProps {
|
|
|
14
14
|
interactive?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
positioning?: ArkUiTooltip.RootProps['positioning'];
|
|
17
|
+
/**
|
|
18
|
+
* Override the trigger element's id. Pass the same id to another
|
|
19
|
+
* compound component's `ids.trigger` (e.g. `Popover`, `DropdownMenu`) to
|
|
20
|
+
* compose their triggers on one element via nested `asChild` without an
|
|
21
|
+
* extra wrapper node — otherwise the outer trigger's id wins and this
|
|
22
|
+
* tooltip can't find its anchor, mispositioning at the viewport origin.
|
|
23
|
+
*/
|
|
24
|
+
ids?: ArkUiTooltip.RootProps['ids'];
|
|
17
25
|
}
|
|
18
26
|
export declare const Tooltip: FC<TooltipProps>;
|
|
@@ -7,7 +7,7 @@ const TOOLTIP_POSITIONING_DEFAULT = {
|
|
|
7
7
|
},
|
|
8
8
|
overflowPadding: 8
|
|
9
9
|
};
|
|
10
|
-
const Tooltip_Tooltip = ({ children, open, defaultOpen, onOpenChange, openDelay, closeDelay, closeOnPointerDown, closeOnEscape, closeOnScroll, interactive, disabled, positioning, 'data-testid': testIdProp })=>{
|
|
10
|
+
const Tooltip_Tooltip = ({ children, open, defaultOpen, onOpenChange, openDelay, closeDelay, closeOnPointerDown, closeOnEscape, closeOnScroll, interactive, disabled, positioning, ids, 'data-testid': testIdProp })=>{
|
|
11
11
|
const inheritedTestId = useTestId();
|
|
12
12
|
const testId = testIdProp ?? inheritedTestId;
|
|
13
13
|
const handleOpenChange = (details)=>{
|
|
@@ -27,6 +27,7 @@ const Tooltip_Tooltip = ({ children, open, defaultOpen, onOpenChange, openDelay,
|
|
|
27
27
|
interactive: interactive,
|
|
28
28
|
disabled: disabled,
|
|
29
29
|
positioning: positioning ?? TOOLTIP_POSITIONING_DEFAULT,
|
|
30
|
+
ids: ids,
|
|
30
31
|
lazyMount: true,
|
|
31
32
|
unmountOnExit: true,
|
|
32
33
|
children: children
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.85.
|
|
3
|
-
"generatedAt": "2026-08-
|
|
2
|
+
"version": "0.85.1",
|
|
3
|
+
"generatedAt": "2026-08-07T06:49:22.264Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -5665,6 +5665,12 @@
|
|
|
5665
5665
|
"type": "boolean | undefined",
|
|
5666
5666
|
"required": false,
|
|
5667
5667
|
"description": "Whether selecting an item closes the menu (default true)"
|
|
5668
|
+
},
|
|
5669
|
+
{
|
|
5670
|
+
"name": "ids",
|
|
5671
|
+
"type": "complex",
|
|
5672
|
+
"required": false,
|
|
5673
|
+
"description": "Override the trigger element's id. Pass the same id to another\ncompound component's `ids.trigger` (e.g. `Tooltip`, `Popover`) to\ncompose their triggers on one element via nested `asChild` without an\nextra wrapper node — otherwise the outer trigger's id wins and the\nother component can't find its own anchor."
|
|
5668
5674
|
}
|
|
5669
5675
|
]
|
|
5670
5676
|
},
|
|
@@ -48333,6 +48339,10 @@
|
|
|
48333
48339
|
"name": "Basic",
|
|
48334
48340
|
"code": "() => (\n <Popover data-testid='popover'>\n <PopoverTrigger asChild>\n <Button variant='outline' color='neutral'>\n Click me\n </Button>\n </PopoverTrigger>\n <PopoverContent>\n <VStack gap={12}>\n <Text size='sm'>This action will remove all and every bit!</Text>\n\n <Alert color='warning'>\n <AlertIcon />\n <AlertContent>\n <AlertTitle>Message goes here</AlertTitle>\n <AlertDescription>\n {'Description goes here \\nDescription goes here \\nDescription goes here'}\n </AlertDescription>\n <AlertControls>\n <Button variant='secondary' color='neutral' size='small'>\n Button\n </Button>\n <Button variant='secondary' color='neutral' size='small'>\n Button\n </Button>\n </AlertControls>\n </AlertContent>\n </Alert>\n </VStack>\n </PopoverContent>\n </Popover>\n)"
|
|
48335
48341
|
},
|
|
48342
|
+
{
|
|
48343
|
+
"name": "WithTooltip",
|
|
48344
|
+
"code": "() => {\n const triggerId = useId();\n const [open, setOpen] = useState(false);\n\n return (\n <Popover\n data-testid='with-tooltip-popover'\n open={open}\n onOpenChange={setOpen}\n ids={{ trigger: triggerId }}\n >\n {/* Sharing `ids.trigger` lets both machines resolve the same DOM node as\n their own anchor, so the tooltip positions correctly with no wrapper. */}\n <Tooltip data-testid='with-tooltip-tooltip' disabled={open} ids={{ trigger: triggerId }}>\n <PopoverTrigger asChild>\n <TooltipTrigger asChild>\n <Button data-testid='popover-tooltip-trigger' variant='outline' color='neutral'>\n Actions\n </Button>\n </TooltipTrigger>\n </PopoverTrigger>\n <TooltipContent>More actions</TooltipContent>\n </Tooltip>\n <PopoverContent>\n <Text size='sm'>Popover content</Text>\n </PopoverContent>\n </Popover>\n );\n}"
|
|
48345
|
+
},
|
|
48336
48346
|
{
|
|
48337
48347
|
"name": "MinMaxWidth",
|
|
48338
48348
|
"code": "() => (\n <VStack gap={32}>\n <Popover>\n <PopoverTrigger asChild>\n <Button variant='outline' color='neutral'>\n Min Width\n </Button>\n </PopoverTrigger>\n <PopoverContent>\n <Text size='xs' weight='medium'>\n Lorem Ipsum\n </Text>\n </PopoverContent>\n </Popover>\n\n <Popover>\n <PopoverTrigger asChild>\n <Button variant='outline' color='neutral'>\n Max Width\n </Button>\n </PopoverTrigger>\n <PopoverContent>\n <Text size='xs' weight='medium'>\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has\n been the industry's standard dummy text ever since the 1500s, when an unknown printer took\n a galley of type and scrambled it to make a type specimen book. It has survived not only\n five centuries, but also the leap into electronic typesetting, remaining essentially\n unchanged. It was popularised in the 1960s with the release of Letraset sheets containing\n Lorem Ipsum passages, and more recently with desktop publishing software like Aldus\n PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established\n fact that a reader will be distracted by the readable content of a page when looking at\n its layout.\n </Text>\n </PopoverContent>\n </Popover>\n </VStack>\n)"
|
|
@@ -82150,6 +82160,12 @@
|
|
|
82150
82160
|
"name": "positioning",
|
|
82151
82161
|
"type": "PositioningOptions | undefined",
|
|
82152
82162
|
"required": false
|
|
82163
|
+
},
|
|
82164
|
+
{
|
|
82165
|
+
"name": "ids",
|
|
82166
|
+
"type": "Partial<{ trigger: string | ((value?: string | undefined) => string); content: string; arrow: string; positioner: string; }> | undefined",
|
|
82167
|
+
"required": false,
|
|
82168
|
+
"description": "Override the trigger element's id. Pass the same id to another\ncompound component's `ids.trigger` (e.g. `Popover`, `DropdownMenu`) to\ncompose their triggers on one element via nested `asChild` without an\nextra wrapper node — otherwise the outer trigger's id wins and this\ntooltip can't find its anchor, mispositioning at the viewport origin."
|
|
82153
82169
|
}
|
|
82154
82170
|
],
|
|
82155
82171
|
"variants": [],
|