@primer/react 0.0.0-20260626043720 → 0.0.0-20260626204956
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/CHANGELOG.md +7 -3
- package/dist/ActionBar/ActionBar.d.ts +24 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +96 -4
- package/dist/ActionBar/index.d.ts +21 -1
- package/dist/ActionBar/index.d.ts.map +1 -1
- package/dist/ActionBar/index.js +2 -1
- package/dist/ActionList/Heading.d.ts.map +1 -1
- package/dist/ActionList/Heading.js +37 -27
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +45 -46
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +6 -4
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +23 -23
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +10 -13
- package/dist/Dialog/Dialog.js +4 -6
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +6 -4
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +30 -31
- package/dist/SelectPanel/SelectPanel.d.ts +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +4 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +6 -7
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +4 -4
- package/dist/UnderlineNav/UnderlineNav-47547980.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-47547980.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +1 -2
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +91 -331
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +1 -11
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +1 -4
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css +2 -0
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItem.d.ts +1 -44
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +33 -38
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts +51 -0
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.js +8 -0
- package/dist/UnderlineNav/index.d.ts +1 -1
- package/dist/UnderlineNav/index.d.ts.map +1 -1
- package/dist/UnderlineNav/utils.d.ts +2 -0
- package/dist/UnderlineNav/utils.d.ts.map +1 -1
- package/dist/UnderlineNav/utils.js +2 -1
- package/dist/experimental/Tabs/useTabList.d.ts.map +1 -1
- package/dist/experimental/Tabs/useTabList.js +15 -15
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css +2 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css.map +1 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +8 -11
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
- package/dist/hooks/useMergedRefs.d.ts.map +1 -1
- package/dist/hooks/useMergedRefs.js +6 -2
- package/dist/hooks/useProvidedRefOrCreate.d.ts +7 -10
- package/dist/hooks/useProvidedRefOrCreate.d.ts.map +1 -1
- package/dist/hooks/useProvidedRefOrCreate.js +10 -10
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.d.ts +0 -1
- package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
- package/dist/internal/components/UnderlineTabbedInterface.js +66 -60
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/generated/components.json +30 -2
- package/package.json +1 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +0 -2
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +0 -1
- package/dist/UnderlineNav/styles.d.ts +0 -16
- package/dist/UnderlineNav/styles.d.ts.map +0 -1
- package/dist/UnderlineNav/styles.js +0 -19
- package/dist/UnderlineNav/types.d.ts +0 -10
- package/dist/UnderlineNav/types.d.ts.map +0 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +0 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260626204956
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- [#8048](https://github.com/primer/react/pull/8048) [`0add561`](https://github.com/primer/react/commit/0add5615720d17d69c77b014786c5e17e4337bb0) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - ActionBar: Add `ActionBar.Button` for rendering text buttons that overflow into the menu, alongside the existing `ActionBar.IconButton`
|
|
8
|
+
|
|
7
9
|
- [#8031](https://github.com/primer/react/pull/8031) [`cb79351`](https://github.com/primer/react/commit/cb79351f29b9a1aea7bacf890eca97a5c9d97590) Thanks [@janmaarten-a11y](https://github.com/janmaarten-a11y)! - Add a `NavList.Heading` slot that names the navigation region. It renders an `h2`
|
|
8
10
|
by default (configurable to `h3` via `as`), supports a `visuallyHidden` variant,
|
|
9
11
|
labels the `nav` landmark via `aria-labelledby`, and makes `NavList.Group`
|
|
@@ -24,9 +26,11 @@
|
|
|
24
26
|
SkeletonText
|
|
25
27
|
Spinner
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
- [#8026](https://github.com/primer/react/pull/8026) [`73a45df`](https://github.com/primer/react/commit/73a45dfe11c3a297e4f2f8317caa4a535a70ce80) Thanks [@TylerJDev](https://github.com/TylerJDev)! - SelectPanel: Add `cssAnchorPositioningSettings` prop to customize CSS anchor positioning behavior
|
|
28
30
|
|
|
29
|
-
- [#
|
|
31
|
+
- [#7506](https://github.com/primer/react/pull/7506) [`e58907c`](https://github.com/primer/react/commit/e58907c5559f5ef8133a1d98a05e2e4a6c1ca6cb) Thanks [@iansan5653](https://github.com/iansan5653)! - Refactors `UnderlineNav` overflow handling to use CSS-based overflow detection instead of JavaScript width measurements, eliminating layout shift (CLS) issues and improving performance. The overflow menu is now implemented with `ActionMenu`, and item registration uses a descendant registry instead of the `React.Children` API. Consumer-facing changes: items can now be wrapped in fragments or wrapper components; the current item may appear in the overflow menu when the viewport is narrow; and the overflow menu button is right-aligned.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
30
34
|
|
|
31
35
|
- [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Announce, AriaStatus, AriaAlert: Avoid an extra React render on every content change (e.g. per keystroke when tied to an input)
|
|
32
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ActionListItemProps } from '../ActionList';
|
|
3
|
-
import type { IconButtonProps } from '../Button';
|
|
3
|
+
import type { ButtonProps, IconButtonProps } from '../Button';
|
|
4
4
|
type Size = 'small' | 'medium' | 'large';
|
|
5
5
|
type A11yProps = {
|
|
6
6
|
/** When provided, a label is added to the action bar */
|
|
@@ -38,6 +38,9 @@ export type ActionBarProps = {
|
|
|
38
38
|
export type ActionBarIconButtonProps = {
|
|
39
39
|
disabled?: boolean;
|
|
40
40
|
} & IconButtonProps;
|
|
41
|
+
export type ActionBarButtonProps = {
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
} & ButtonProps;
|
|
41
44
|
export type ActionBarMenuItemProps = ({
|
|
42
45
|
/**
|
|
43
46
|
* Type of menu item to be rendered in the menu (action | group).
|
|
@@ -91,6 +94,26 @@ export type ActionBarMenuProps = {
|
|
|
91
94
|
} & IconButtonProps;
|
|
92
95
|
export declare const ActionBar: React.FC<React.PropsWithChildren<ActionBarProps>>;
|
|
93
96
|
export declare const ActionBarIconButton: React.ForwardRefExoticComponent<ActionBarIconButtonProps & React.RefAttributes<unknown>>;
|
|
97
|
+
export declare const ActionBarButton: React.ForwardRefExoticComponent<{
|
|
98
|
+
disabled?: boolean;
|
|
99
|
+
} & {
|
|
100
|
+
alignContent?: import("../Button/types").AlignContent;
|
|
101
|
+
icon?: React.FunctionComponent<import("@primer/octicons-react").IconProps> | React.ElementType | React.ReactElement<any> | null;
|
|
102
|
+
leadingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
103
|
+
trailingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
104
|
+
trailingAction?: React.ElementType | null;
|
|
105
|
+
children?: React.ReactNode;
|
|
106
|
+
count?: number | string;
|
|
107
|
+
} & {
|
|
108
|
+
variant?: import("../Button/types").VariantType;
|
|
109
|
+
size?: import("../Button/types").Size;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
block?: boolean;
|
|
112
|
+
loading?: boolean;
|
|
113
|
+
loadingAnnouncement?: string;
|
|
114
|
+
inactive?: boolean;
|
|
115
|
+
labelWrap?: boolean;
|
|
116
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<unknown>>;
|
|
94
117
|
export declare const ActionBarGroup: React.ForwardRefExoticComponent<{
|
|
95
118
|
children?: React.ReactNode | undefined;
|
|
96
119
|
} & React.RefAttributes<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../src/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiF,MAAM,OAAO,CAAA;AAErG,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAElE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../src/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiF,MAAM,OAAO,CAAA;AAErG,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAElE,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,WAAW,CAAA;AAmC3D,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExC,KAAK,SAAS,GACV;IACE,wDAAwD;IACxD,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAChD,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAC9B,GACD;IACE,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC3D,CAAA;AAEL,KAAK,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAEpC,MAAM,MAAM,cAAc,GAAG;IAC3B;;;SAGK;IACL,IAAI,CAAC,EAAE,IAA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CAAC,GAAG,MAAM,CAAA;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;CAC9C,GAAG,eAAe,CAAA;AAwDnB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAiHvE,CAAA;AAyCD,eAAO,MAAM,mBAAmB,0FA2C/B,CAAA;AAED,eAAO,MAAM,eAAe;eAtTmB,OAAO;;;;;;;;;;;;;;;;;;iFAiWpD,CAAA;AAMF,eAAO,MAAM,cAAc;;iCAezB,CAAA;AAEF,eAAO,MAAM,aAAa;IA/UxB,2CAA2C;kBAC7B,MAAM;IACpB,+BAA+B;UACzB,wBAAwB,CAAC,MAAM,CAAC;WAC/B,sBAAsB,EAAE;IAC/B;;;OAGG;mBACY,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM;IACxD;;OAEG;qBACc,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;wGA6W9C,CAAA;AAED,eAAO,MAAM,eAAe,yBAgB3B,CAAA"}
|
|
@@ -3,6 +3,7 @@ import React, { forwardRef, useRef, useState, useMemo, useCallback, useContext,
|
|
|
3
3
|
import { KebabHorizontalIcon } from '@primer/octicons-react';
|
|
4
4
|
import { ActionList } from '../ActionList/index.js';
|
|
5
5
|
import { IconButton } from '../Button/IconButton.js';
|
|
6
|
+
import { ButtonComponent } from '../Button/Button.js';
|
|
6
7
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
7
8
|
import styles from './ActionBar.module.css.js';
|
|
8
9
|
import { clsx } from 'clsx';
|
|
@@ -359,6 +360,97 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
359
360
|
"data-overflowing": dataOverflowingAttr
|
|
360
361
|
});
|
|
361
362
|
});
|
|
363
|
+
const ActionBarButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
364
|
+
const $ = c(19);
|
|
365
|
+
let disabled;
|
|
366
|
+
let onClick;
|
|
367
|
+
let props;
|
|
368
|
+
if ($[0] !== t0) {
|
|
369
|
+
({
|
|
370
|
+
disabled,
|
|
371
|
+
onClick,
|
|
372
|
+
...props
|
|
373
|
+
} = t0);
|
|
374
|
+
$[0] = t0;
|
|
375
|
+
$[1] = disabled;
|
|
376
|
+
$[2] = onClick;
|
|
377
|
+
$[3] = props;
|
|
378
|
+
} else {
|
|
379
|
+
disabled = $[1];
|
|
380
|
+
onClick = $[2];
|
|
381
|
+
props = $[3];
|
|
382
|
+
}
|
|
383
|
+
const ref = useRef(null);
|
|
384
|
+
const mergedRef = useMergedRefs(forwardedRef, ref);
|
|
385
|
+
const {
|
|
386
|
+
size
|
|
387
|
+
} = React.useContext(ActionBarContext);
|
|
388
|
+
const {
|
|
389
|
+
children,
|
|
390
|
+
leadingVisual
|
|
391
|
+
} = props;
|
|
392
|
+
const t1 = typeof leadingVisual === "function" ? leadingVisual : undefined;
|
|
393
|
+
const t2 = !!disabled;
|
|
394
|
+
const t3 = onClick;
|
|
395
|
+
let t4;
|
|
396
|
+
if ($[4] !== children || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
|
|
397
|
+
t4 = {
|
|
398
|
+
type: "action",
|
|
399
|
+
label: children,
|
|
400
|
+
icon: t1,
|
|
401
|
+
disabled: t2,
|
|
402
|
+
onClick: t3
|
|
403
|
+
};
|
|
404
|
+
$[4] = children;
|
|
405
|
+
$[5] = t1;
|
|
406
|
+
$[6] = t2;
|
|
407
|
+
$[7] = t3;
|
|
408
|
+
$[8] = t4;
|
|
409
|
+
} else {
|
|
410
|
+
t4 = $[8];
|
|
411
|
+
}
|
|
412
|
+
const {
|
|
413
|
+
dataOverflowingAttr
|
|
414
|
+
} = useActionBarItem(ref, t4);
|
|
415
|
+
let t5;
|
|
416
|
+
if ($[9] !== disabled || $[10] !== onClick) {
|
|
417
|
+
t5 = event => {
|
|
418
|
+
var _onClick;
|
|
419
|
+
if (disabled) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
(_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
423
|
+
};
|
|
424
|
+
$[9] = disabled;
|
|
425
|
+
$[10] = onClick;
|
|
426
|
+
$[11] = t5;
|
|
427
|
+
} else {
|
|
428
|
+
t5 = $[11];
|
|
429
|
+
}
|
|
430
|
+
const clickHandler = t5;
|
|
431
|
+
let t6;
|
|
432
|
+
if ($[12] !== clickHandler || $[13] !== dataOverflowingAttr || $[14] !== disabled || $[15] !== mergedRef || $[16] !== props || $[17] !== size) {
|
|
433
|
+
t6 = /*#__PURE__*/jsx(ButtonComponent, {
|
|
434
|
+
"aria-disabled": disabled,
|
|
435
|
+
ref: mergedRef,
|
|
436
|
+
size: size,
|
|
437
|
+
onClick: clickHandler,
|
|
438
|
+
...props,
|
|
439
|
+
variant: "invisible",
|
|
440
|
+
"data-overflowing": dataOverflowingAttr
|
|
441
|
+
});
|
|
442
|
+
$[12] = clickHandler;
|
|
443
|
+
$[13] = dataOverflowingAttr;
|
|
444
|
+
$[14] = disabled;
|
|
445
|
+
$[15] = mergedRef;
|
|
446
|
+
$[16] = props;
|
|
447
|
+
$[17] = size;
|
|
448
|
+
$[18] = t6;
|
|
449
|
+
} else {
|
|
450
|
+
t6 = $[18];
|
|
451
|
+
}
|
|
452
|
+
return t6;
|
|
453
|
+
});
|
|
362
454
|
const ActionBarGroupContext = /*#__PURE__*/React.createContext(null);
|
|
363
455
|
const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
364
456
|
const $ = c(10);
|
|
@@ -611,10 +703,10 @@ function _temp4(t0) {
|
|
|
611
703
|
typeof onClick === "function" && onClick(event);
|
|
612
704
|
},
|
|
613
705
|
disabled: disabled,
|
|
614
|
-
children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
706
|
+
children: [Icon ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
615
707
|
children: /*#__PURE__*/jsx(Icon, {})
|
|
616
|
-
}), label]
|
|
617
|
-
},
|
|
708
|
+
}) : null, label]
|
|
709
|
+
}, id);
|
|
618
710
|
}
|
|
619
711
|
if (menuItem.type === "menu") {
|
|
620
712
|
const menuItems = menuItem.items;
|
|
@@ -645,4 +737,4 @@ function _temp7(item, index) {
|
|
|
645
737
|
return renderMenuItem(item, index);
|
|
646
738
|
}
|
|
647
739
|
|
|
648
|
-
export { ActionBar, ActionBarGroup, ActionBarIconButton, ActionBarMenu, VerticalDivider };
|
|
740
|
+
export { ActionBar, ActionBarButton, ActionBarGroup, ActionBarIconButton, ActionBarMenu, VerticalDivider };
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
export type { ActionBarProps, ActionBarMenuProps, ActionBarMenuItemProps } from './ActionBar';
|
|
1
|
+
export type { ActionBarProps, ActionBarButtonProps, ActionBarMenuProps, ActionBarMenuItemProps } from './ActionBar';
|
|
2
2
|
declare const ActionBar: import("react").FC<import("react").PropsWithChildren<import("./ActionBar").ActionBarProps>> & {
|
|
3
3
|
IconButton: import("react").ForwardRefExoticComponent<import("./ActionBar").ActionBarIconButtonProps & import("react").RefAttributes<unknown>>;
|
|
4
|
+
Button: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
} & {
|
|
7
|
+
alignContent?: import("../Button/types").AlignContent;
|
|
8
|
+
icon?: React.FunctionComponent<import("@primer/octicons-react").IconProps> | React.ElementType | React.ReactElement<any> | null;
|
|
9
|
+
leadingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
10
|
+
trailingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
11
|
+
trailingAction?: React.ElementType | null;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
count?: number | string;
|
|
14
|
+
} & {
|
|
15
|
+
variant?: import("../Button/types").VariantType;
|
|
16
|
+
size?: import("../Button/types").Size;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
block?: boolean;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
loadingAnnouncement?: string;
|
|
21
|
+
inactive?: boolean;
|
|
22
|
+
labelWrap?: boolean;
|
|
23
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<unknown>>;
|
|
4
24
|
Divider: () => import("react").JSX.Element;
|
|
5
25
|
Group: import("react").ForwardRefExoticComponent<{
|
|
6
26
|
children?: import("react").ReactNode | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionBar/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionBar/index.ts"],"names":[],"mappings":"AAQA,YAAY,EAAC,cAAc,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAA;AAEjH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMb,CAAA;AAEF,eAAe,SAAS,CAAA;AACxB,OAAO,EAAC,SAAS,EAAC,CAAA"}
|
package/dist/ActionBar/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBar as ActionBar$1, ActionBarMenu, ActionBarGroup, VerticalDivider, ActionBarIconButton } from './ActionBar.js';
|
|
1
|
+
import { ActionBar as ActionBar$1, ActionBarMenu, ActionBarGroup, VerticalDivider, ActionBarButton, ActionBarIconButton } from './ActionBar.js';
|
|
2
2
|
|
|
3
3
|
const ActionBar = Object.assign(ActionBar$1, {
|
|
4
4
|
IconButton: ActionBarIconButton,
|
|
5
|
+
Button: ActionBarButton,
|
|
5
6
|
Divider: VerticalDivider,
|
|
6
7
|
Group: ActionBarGroup,
|
|
7
8
|
Menu: ActionBarMenu
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/ActionList/Heading.tsx"],"names":[],"mapp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
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { ListContext } from './shared.js';
|
|
4
|
+
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
4
5
|
import { ActionListContainerContext } from './ActionListContainerContext.js';
|
|
5
6
|
import { invariant } from '../utils/invariant.js';
|
|
6
7
|
import { clsx } from 'clsx';
|
|
7
8
|
import classes from './Heading.module.css.js';
|
|
8
|
-
import visuallyHiddenClasses from '../_VisuallyHidden.module.css.js';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
11
11
|
import Heading$1 from '../Heading/Heading.js';
|
|
12
12
|
|
|
13
13
|
const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
14
14
|
var _props$id;
|
|
15
|
-
const $ = c(
|
|
15
|
+
const $ = c(21);
|
|
16
16
|
let as;
|
|
17
17
|
let children;
|
|
18
18
|
let className;
|
|
@@ -54,44 +54,54 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
54
54
|
container
|
|
55
55
|
} = React.useContext(ActionListContainerContext);
|
|
56
56
|
!(container !== "ActionMenu") ? process.env.NODE_ENV !== "production" ? invariant(false, "ActionList.Heading shouldn't be used within an ActionMenu container. Menus are labelled by the menu button's name.") : invariant(false) : void 0;
|
|
57
|
-
const t2 =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
57
|
+
const t2 = !visuallyHidden;
|
|
58
|
+
const t3 = (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : headingId;
|
|
59
|
+
let t4;
|
|
60
|
+
if ($[7] !== className) {
|
|
61
|
+
t4 = clsx(className, classes.ActionListHeader);
|
|
63
62
|
$[7] = className;
|
|
64
|
-
$[8] =
|
|
65
|
-
$[9] = t3;
|
|
63
|
+
$[8] = t4;
|
|
66
64
|
} else {
|
|
67
|
-
|
|
65
|
+
t4 = $[8];
|
|
68
66
|
}
|
|
69
|
-
let
|
|
70
|
-
if ($[
|
|
71
|
-
|
|
67
|
+
let t5;
|
|
68
|
+
if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !== mergedRef || $[13] !== props || $[14] !== size || $[15] !== t3 || $[16] !== t4) {
|
|
69
|
+
t5 = /*#__PURE__*/jsx(Heading$1, {
|
|
72
70
|
as: as,
|
|
73
71
|
variant: size,
|
|
74
72
|
ref: mergedRef,
|
|
75
|
-
id:
|
|
76
|
-
className:
|
|
73
|
+
id: t3,
|
|
74
|
+
className: t4,
|
|
77
75
|
"data-component": "ActionList.Heading",
|
|
78
76
|
"data-list-variant": listVariant,
|
|
79
77
|
...props,
|
|
80
78
|
children: children
|
|
81
79
|
});
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
80
|
+
$[9] = as;
|
|
81
|
+
$[10] = children;
|
|
82
|
+
$[11] = listVariant;
|
|
83
|
+
$[12] = mergedRef;
|
|
84
|
+
$[13] = props;
|
|
85
|
+
$[14] = size;
|
|
86
|
+
$[15] = t3;
|
|
87
|
+
$[16] = t4;
|
|
88
|
+
$[17] = t5;
|
|
89
|
+
} else {
|
|
90
|
+
t5 = $[17];
|
|
91
|
+
}
|
|
92
|
+
let t6;
|
|
93
|
+
if ($[18] !== t2 || $[19] !== t5) {
|
|
94
|
+
t6 = /*#__PURE__*/jsx(VisuallyHidden, {
|
|
95
|
+
isVisible: t2,
|
|
96
|
+
children: t5
|
|
97
|
+
});
|
|
98
|
+
$[18] = t2;
|
|
99
|
+
$[19] = t5;
|
|
100
|
+
$[20] = t6;
|
|
91
101
|
} else {
|
|
92
|
-
|
|
102
|
+
t6 = $[20];
|
|
93
103
|
}
|
|
94
|
-
return
|
|
104
|
+
return t6;
|
|
95
105
|
});
|
|
96
106
|
Heading.displayName = 'ActionList.Heading';
|
|
97
107
|
Heading.__SLOT__ = Symbol('ActionList.Heading');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAwH7C,QAAA,MAAM,IAAI,GA1Ga,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;oDA0GR,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
package/dist/ActionList/List.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
4
4
|
import { ActionListContainerContext } from './ActionListContainerContext.js';
|
|
5
5
|
import { useSlots } from '../hooks/useSlots.js';
|
|
@@ -11,13 +11,13 @@ import { clsx } from 'clsx';
|
|
|
11
11
|
import classes from './ActionList.module.css.js';
|
|
12
12
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
13
13
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
|
-
import {
|
|
14
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
15
15
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
16
16
|
import { FocusKeys } from '@primer/behaviors';
|
|
17
17
|
|
|
18
18
|
const UnwrappedList = (props, forwardedRef) => {
|
|
19
19
|
var _slots$heading$props$;
|
|
20
|
-
const $ = c(
|
|
20
|
+
const $ = c(38);
|
|
21
21
|
let className;
|
|
22
22
|
let restProps;
|
|
23
23
|
let role;
|
|
@@ -80,7 +80,8 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
80
80
|
} = React.useContext(ActionListContainerContext);
|
|
81
81
|
const ariaLabelledBy = slots.heading ? (_slots$heading$props$ = slots.heading.props.id) !== null && _slots$heading$props$ !== void 0 ? _slots$heading$props$ : headingId : listLabelledBy;
|
|
82
82
|
const listRole = role || listRoleFromContainer;
|
|
83
|
-
const listRef =
|
|
83
|
+
const listRef = useRef(null);
|
|
84
|
+
const mergedRef = useMergedRefs(forwardedRef, listRef);
|
|
84
85
|
const itemGapEnabled = useFeatureFlag("primer_react_action_list_item_gap") && container === "NavList";
|
|
85
86
|
let enableFocusZone = false;
|
|
86
87
|
if (enableFocusZoneFromContainer !== undefined) {
|
|
@@ -100,24 +101,23 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
100
101
|
const t5 = !enableFocusZone;
|
|
101
102
|
const t6 = listRole === "menu" || container === "SelectPanel" || container === "FilteredActionList" ? "wrap" : undefined;
|
|
102
103
|
let t7;
|
|
103
|
-
if ($[11] !==
|
|
104
|
+
if ($[11] !== t5 || $[12] !== t6) {
|
|
104
105
|
t7 = {
|
|
105
106
|
disabled: t5,
|
|
106
107
|
containerRef: listRef,
|
|
107
108
|
bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
|
|
108
109
|
focusOutBehavior: t6
|
|
109
110
|
};
|
|
110
|
-
$[11] =
|
|
111
|
-
$[12] =
|
|
112
|
-
$[13] =
|
|
113
|
-
$[14] = t7;
|
|
111
|
+
$[11] = t5;
|
|
112
|
+
$[12] = t6;
|
|
113
|
+
$[13] = t7;
|
|
114
114
|
} else {
|
|
115
|
-
t7 = $[
|
|
115
|
+
t7 = $[13];
|
|
116
116
|
}
|
|
117
117
|
useFocusZone(t7);
|
|
118
118
|
const t8 = selectionVariant || containerSelectionVariant;
|
|
119
119
|
let t9;
|
|
120
|
-
if ($[
|
|
120
|
+
if ($[14] !== headingId || $[15] !== listRole || $[16] !== showDividers || $[17] !== t8 || $[18] !== variant) {
|
|
121
121
|
t9 = {
|
|
122
122
|
variant,
|
|
123
123
|
selectionVariant: t8,
|
|
@@ -125,18 +125,18 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
125
125
|
role: listRole,
|
|
126
126
|
headingId
|
|
127
127
|
};
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
128
|
+
$[14] = headingId;
|
|
129
|
+
$[15] = listRole;
|
|
130
|
+
$[16] = showDividers;
|
|
131
|
+
$[17] = t8;
|
|
132
|
+
$[18] = variant;
|
|
133
|
+
$[19] = t9;
|
|
134
134
|
} else {
|
|
135
|
-
t9 = $[
|
|
135
|
+
t9 = $[19];
|
|
136
136
|
}
|
|
137
137
|
const listContextValue = t9;
|
|
138
138
|
let t10;
|
|
139
|
-
if ($[
|
|
139
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
140
140
|
t10 = () => {
|
|
141
141
|
const list = listRef.current;
|
|
142
142
|
if (!list) {
|
|
@@ -152,29 +152,28 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
|
-
$[
|
|
156
|
-
$[22] = t10;
|
|
155
|
+
$[20] = t10;
|
|
157
156
|
} else {
|
|
158
|
-
t10 = $[
|
|
157
|
+
t10 = $[20];
|
|
159
158
|
}
|
|
160
159
|
useIsomorphicLayoutEffect(t10);
|
|
161
160
|
const t11 = slots.heading;
|
|
162
161
|
let t12;
|
|
163
|
-
if ($[
|
|
162
|
+
if ($[21] !== className) {
|
|
164
163
|
t12 = clsx(classes.ActionList, className);
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
164
|
+
$[21] = className;
|
|
165
|
+
$[22] = t12;
|
|
167
166
|
} else {
|
|
168
|
-
t12 = $[
|
|
167
|
+
t12 = $[22];
|
|
169
168
|
}
|
|
170
169
|
const t13 = itemGapEnabled ? "" : undefined;
|
|
171
170
|
let t14;
|
|
172
|
-
if ($[
|
|
171
|
+
if ($[23] !== Component || $[24] !== ariaLabelledBy || $[25] !== childrenWithoutSlots || $[26] !== listRole || $[27] !== mergedRef || $[28] !== restProps || $[29] !== showDividers || $[30] !== t12 || $[31] !== t13 || $[32] !== variant) {
|
|
173
172
|
t14 = /*#__PURE__*/jsx(Component, {
|
|
174
173
|
className: t12,
|
|
175
174
|
role: listRole,
|
|
176
175
|
"aria-labelledby": ariaLabelledBy,
|
|
177
|
-
ref:
|
|
176
|
+
ref: mergedRef,
|
|
178
177
|
"data-component": "ActionList",
|
|
179
178
|
"data-dividers": showDividers,
|
|
180
179
|
"data-variant": variant,
|
|
@@ -182,32 +181,32 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
182
181
|
...restProps,
|
|
183
182
|
children: childrenWithoutSlots
|
|
184
183
|
});
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
184
|
+
$[23] = Component;
|
|
185
|
+
$[24] = ariaLabelledBy;
|
|
186
|
+
$[25] = childrenWithoutSlots;
|
|
187
|
+
$[26] = listRole;
|
|
188
|
+
$[27] = mergedRef;
|
|
189
|
+
$[28] = restProps;
|
|
190
|
+
$[29] = showDividers;
|
|
191
|
+
$[30] = t12;
|
|
192
|
+
$[31] = t13;
|
|
193
|
+
$[32] = variant;
|
|
194
|
+
$[33] = t14;
|
|
196
195
|
} else {
|
|
197
|
-
t14 = $[
|
|
196
|
+
t14 = $[33];
|
|
198
197
|
}
|
|
199
198
|
let t15;
|
|
200
|
-
if ($[
|
|
199
|
+
if ($[34] !== listContextValue || $[35] !== slots.heading || $[36] !== t14) {
|
|
201
200
|
t15 = /*#__PURE__*/jsxs(ListContext.Provider, {
|
|
202
201
|
value: listContextValue,
|
|
203
202
|
children: [t11, t14]
|
|
204
203
|
});
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
204
|
+
$[34] = listContextValue;
|
|
205
|
+
$[35] = slots.heading;
|
|
206
|
+
$[36] = t14;
|
|
207
|
+
$[37] = t15;
|
|
209
208
|
} else {
|
|
210
|
-
t15 = $[
|
|
209
|
+
t15 = $[37];
|
|
211
210
|
}
|
|
212
211
|
return t15;
|
|
213
212
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAmC,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AAChE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AAEhE,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AAIhE,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAa,KAAK,eAAe,EAAC,MAAM,WAAW,CAAA;AAQ1D,UAAU,8BAA8B;IACtC;;;OAGG;IACH,YAAY,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,EAChG,KAAK,EAAE,CAAC,KACL,GAAG,CAAC,OAAO,CAAA;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAE/C;;OAEG;IACH,QAAQ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AC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAElD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,YAAY,CAAC,CAAA;IAChE;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE;QAAC,QAAQ,EAAE,cAAc,CAAA;KAAC,KAAK,IAAI,CAAA;IACnE;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC/B;;;;;;;;;;OAUG;IACH,4BAA4B,CAAC,EAAE;QAAC,gBAAgB,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,eAAe,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAC,CAAA;CAC5G;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACzD,CAAC,8BAA8B,GAAG,iCAAiC,CAAC,GACpE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAA;AAS9G;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CA2TnF,CAAA"}
|
|
@@ -12,6 +12,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
12
12
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
13
13
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
14
14
|
import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
|
|
15
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
15
16
|
import { useAnchoredPosition } from '../hooks/useAnchoredPosition.js';
|
|
16
17
|
import Overlay from '../Overlay/Overlay.js';
|
|
17
18
|
|
|
@@ -67,6 +68,7 @@ const AnchoredOverlay = ({
|
|
|
67
68
|
setAnchorElement(anchorRef.current);
|
|
68
69
|
}
|
|
69
70
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
71
|
+
const mergedOverlayRef = useMergedRefs(updateOverlayRef, overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.ref);
|
|
70
72
|
const [overlayElement, setOverlayElement] = useState(null);
|
|
71
73
|
const anchorId = useId(externalAnchorId);
|
|
72
74
|
const onClickOutside = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('click-outside'), [onClose]);
|
|
@@ -265,12 +267,12 @@ const AnchoredOverlay = ({
|
|
|
265
267
|
...(shouldRenderAsPopover ? {
|
|
266
268
|
id: popoverId
|
|
267
269
|
} : {}),
|
|
270
|
+
...(cssAnchorPositioning ? {
|
|
271
|
+
id: popoverId
|
|
272
|
+
} : {}),
|
|
268
273
|
ref: node => {
|
|
269
|
-
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) {
|
|
270
|
-
assignRef(overlayProps.ref, node);
|
|
271
|
-
}
|
|
272
|
-
updateOverlayRef(node);
|
|
273
274
|
setOverlayElement(node);
|
|
275
|
+
assignRef(mergedOverlayRef, node);
|
|
274
276
|
},
|
|
275
277
|
"data-anchor-position": cssAnchorPositioning,
|
|
276
278
|
"data-side": cssAnchorPositioning ? side : position === null || position === void 0 ? void 0 : position.anchorSide,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAS,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAK3D,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,WAAW,EA8BX,8BAA8B,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAA;AAI7D,eAAe,WAAW,CAAA"}
|