@primer/react 0.0.0-20260615170731 → 0.0.0-20260615171201
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 +6 -3
- package/dist/ActionList/LinkItem.d.ts +1 -1
- package/dist/ActionList/List.d.ts +2 -11
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/index.d.ts +4 -24
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/BranchName/BranchName.d.ts +2 -4
- package/dist/BranchName/BranchName.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +4 -10
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Card/Card.d.ts +2 -20
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/index.d.ts +2 -8
- package/dist/Card/index.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css +2 -0
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +2 -2
- package/dist/Link/Link.d.ts +1 -1
- package/dist/NavList/NavList.d.ts +2 -8
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/Text/Text.d.ts +2 -7
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/TreeView/TreeView.d.ts +11 -2
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +109 -86
- package/dist/utils/modern-polymorphic.d.ts +1 -1
- package/dist/utils/modern-polymorphic.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css +0 -2
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260615171201
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- [#7867](https://github.com/primer/react/pull/7867) [`4ec4248`](https://github.com/primer/react/commit/4ec4248b9c1ae662b761385110f1fd7ad7480a2f) Thanks [@llastflowers](https://github.com/llastflowers)! - Add data-component attributes and associated tests for ActionMenu, AnchoredOverlay, Autocomplete, and NavList
|
|
8
8
|
|
|
9
|
+
- [#7897](https://github.com/primer/react/pull/7897) [`dea9ea7`](https://github.com/primer/react/commit/dea9ea7908d3d9fe935c42311952fa5cbd7a17e4) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Add support for the `as` prop on `TreeView.Item`. This enables rendering the
|
|
10
|
+
treeitem as a different element (e.g. `as="a"` for native anchors, or a custom
|
|
11
|
+
router-link component) while preserving all existing keyboard, focus, and ARIA
|
|
12
|
+
behavior. Defaults to `'li'`, so existing usage is unchanged.
|
|
13
|
+
|
|
9
14
|
### Patch Changes
|
|
10
15
|
|
|
11
16
|
- [#7976](https://github.com/primer/react/pull/7976) [`1fac927`](https://github.com/primer/react/commit/1fac9270c497c1904acbb3eb60805630aab82a97) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - NavList: add a small gap between items for readability, including before expanded sub-navs, behind the `primer_react_action_list_item_gap` feature flag
|
|
12
17
|
|
|
13
|
-
- [#7929](https://github.com/primer/react/pull/7929) [`77323e7`](https://github.com/primer/react/commit/77323e76658d576a583c5cb04993a57e12fa17db) Thanks [@joshblack](https://github.com/joshblack)! - FilteredActionList: Make body skeleton widths stable for server rendering
|
|
14
|
-
|
|
15
18
|
- Fake entry to force publishing
|
|
16
19
|
|
|
17
20
|
- [#7978](https://github.com/primer/react/pull/7978) [`e3f655c`](https://github.com/primer/react/commit/e3f655c6735ffd1bd105b8e7599e273bb1eee4d1) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - PageHeader.ParentLink: Forward unknown props (e.g. `to`) to the underlying element, enabling client-side routing with polymorphic `as`.
|
|
@@ -14,7 +14,7 @@ type LinkProps = {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
};
|
|
16
16
|
export type ActionListLinkItemProps = Pick<ActionListItemProps, 'active' | 'children' | 'inactiveText' | 'variant' | 'size'> & LinkProps;
|
|
17
|
-
declare const LinkItemComponent: <As extends React.ElementType = "a">(props: (
|
|
17
|
+
declare const LinkItemComponent: <As extends React.ElementType = "a">(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & Pick<ActionListItemProps, "active" | "children" | "inactiveText" | "size" | "variant"> & LinkProps, "as"> & {
|
|
18
18
|
as?: As | undefined;
|
|
19
19
|
} & React.RefAttributes<unknown>) => React.ReactNode;
|
|
20
20
|
export declare const LinkItem: WithSlotMarker<typeof LinkItemComponent>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const List: <As extends React.ElementType = "ul">(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "ul" : As> & {
|
|
2
|
+
declare const List: <As extends React.ElementType = "ul">(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "ul" : As> & {
|
|
3
3
|
variant?: "inset" | "horizontal-inset" | "full";
|
|
4
4
|
selectionVariant?: "single" | "radio" | "multiple";
|
|
5
5
|
showDividers?: boolean;
|
|
@@ -8,16 +8,7 @@ declare const List: <As extends React.ElementType = "ul">(props: (React.Componen
|
|
|
8
8
|
className?: string;
|
|
9
9
|
} & {
|
|
10
10
|
children?: React.ReactNode | undefined;
|
|
11
|
-
}
|
|
12
|
-
variant?: "inset" | "horizontal-inset" | "full";
|
|
13
|
-
selectionVariant?: "single" | "radio" | "multiple";
|
|
14
|
-
showDividers?: boolean;
|
|
15
|
-
role?: import("../utils/types").AriaRole;
|
|
16
|
-
disableFocusZone?: boolean;
|
|
17
|
-
className?: string;
|
|
18
|
-
} & {
|
|
19
|
-
children?: React.ReactNode | undefined;
|
|
20
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
11
|
+
}, "as"> & {
|
|
21
12
|
as?: As | undefined;
|
|
22
13
|
} & React.RefAttributes<unknown>) => React.ReactNode;
|
|
23
14
|
export { List };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAwHrC,QAAA,MAAM,IAAI,GA1Ga,EAAE,SAAS,KAAK,CAAC,WAAW
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAwHrC,QAAA,MAAM,IAAI,GA1Ga,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;oDA0GR,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
|
@@ -11,7 +11,7 @@ export type { ActionListGroupHeadingTrailingActionProps } from './GroupHeadingTr
|
|
|
11
11
|
/**
|
|
12
12
|
* Collection of list-related components.
|
|
13
13
|
*/
|
|
14
|
-
export declare const ActionList: (<As extends React.ElementType = "ul">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "ul" : As> & {
|
|
14
|
+
export declare const ActionList: (<As extends React.ElementType = "ul">(props: import("../utils/modern-polymorphic").DistributiveOmit<import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "ul" : As> & {
|
|
15
15
|
variant?: "inset" | "horizontal-inset" | "full";
|
|
16
16
|
selectionVariant?: "single" | "radio" | "multiple";
|
|
17
17
|
showDividers?: boolean;
|
|
@@ -20,16 +20,7 @@ export declare const ActionList: (<As extends React.ElementType = "ul">(props: (
|
|
|
20
20
|
className?: string;
|
|
21
21
|
} & {
|
|
22
22
|
children?: import("react").ReactNode | undefined;
|
|
23
|
-
}
|
|
24
|
-
variant?: "inset" | "horizontal-inset" | "full";
|
|
25
|
-
selectionVariant?: "single" | "radio" | "multiple";
|
|
26
|
-
showDividers?: boolean;
|
|
27
|
-
role?: import("../utils/types").AriaRole;
|
|
28
|
-
disableFocusZone?: boolean;
|
|
29
|
-
className?: string;
|
|
30
|
-
} & {
|
|
31
|
-
children?: import("react").ReactNode | undefined;
|
|
32
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
23
|
+
}, "as"> & {
|
|
33
24
|
as?: As | undefined;
|
|
34
25
|
} & import("react").RefAttributes<unknown>) => React.ReactNode) & {
|
|
35
26
|
/** Context for the `ActionList` container. */
|
|
@@ -96,18 +87,7 @@ export declare const ActionList: (<As extends React.ElementType = "ul">(props: (
|
|
|
96
87
|
__SLOT__: symbol;
|
|
97
88
|
};
|
|
98
89
|
/** A `Item` that renders a full-size anchor inside ListItem */
|
|
99
|
-
LinkItem: import("..").WithSlotMarker<(<As extends React.ElementType = "a">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "a" : As> & Pick<import("./shared").ActionListItemProps, "active" | "children" | "inactiveText" | "size" | "variant"> & {
|
|
100
|
-
download?: string;
|
|
101
|
-
href?: string;
|
|
102
|
-
hrefLang?: string;
|
|
103
|
-
media?: string;
|
|
104
|
-
ping?: string;
|
|
105
|
-
rel?: string;
|
|
106
|
-
target?: string;
|
|
107
|
-
type?: string;
|
|
108
|
-
referrerPolicy?: React.AnchorHTMLAttributes<HTMLAnchorElement>["referrerPolicy"];
|
|
109
|
-
className?: string;
|
|
110
|
-
} extends infer T ? T extends import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "a" : As> & Pick<import("./shared").ActionListItemProps, "active" | "children" | "inactiveText" | "size" | "variant"> & {
|
|
90
|
+
LinkItem: import("..").WithSlotMarker<(<As extends React.ElementType = "a">(props: import("../utils/modern-polymorphic").DistributiveOmit<import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "a" : As> & Pick<import("./shared").ActionListItemProps, "active" | "children" | "inactiveText" | "size" | "variant"> & {
|
|
111
91
|
download?: string;
|
|
112
92
|
href?: string;
|
|
113
93
|
hrefLang?: string;
|
|
@@ -118,7 +98,7 @@ export declare const ActionList: (<As extends React.ElementType = "ul">(props: (
|
|
|
118
98
|
type?: string;
|
|
119
99
|
referrerPolicy?: React.AnchorHTMLAttributes<HTMLAnchorElement>["referrerPolicy"];
|
|
120
100
|
className?: string;
|
|
121
|
-
}
|
|
101
|
+
}, "as"> & {
|
|
122
102
|
as?: As | undefined;
|
|
123
103
|
} & import("react").RefAttributes<unknown>) => React.ReactNode)>;
|
|
124
104
|
/** Visually separates `Item`s or `Group`s in an `ActionList`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionList/index.ts"],"names":[],"mappings":"AAYA,YAAY,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AAC7C,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,SAAS,CAAA;AAC9E,YAAY,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AACjD,YAAY,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAA;AACvD,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,0BAA0B,EAAC,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAC,4BAA4B,EAAE,6BAA6B,EAAC,MAAM,WAAW,CAAA;AAC1F,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,6BAA6B,EAAC,MAAM,kBAAkB,CAAA;AACnE,YAAY,EAAC,yCAAyC,EAAC,MAAM,8BAA8B,CAAA;AAE3F;;GAEG;AACH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionList/index.ts"],"names":[],"mappings":"AAYA,YAAY,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AAC7C,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,SAAS,CAAA;AAC9E,YAAY,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AACjD,YAAY,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAA;AACvD,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,0BAA0B,EAAC,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAC,4BAA4B,EAAE,6BAA6B,EAAC,MAAM,WAAW,CAAA;AAC1F,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,6BAA6B,EAAC,MAAM,kBAAkB,CAAA;AACnE,YAAY,EAAC,yCAAyC,EAAC,MAAM,8BAA8B,CAAA;AAE3F;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;IACrB,8CAA8C;;;;;;;;;;;IAE9C,mDAAmD;;IAGnD,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGzC,+DAA+D;;;;;;;;;;;;;;;IAG/D,iEAAiE;;IAGjE,4EAA4E;;IAG5E,uDAAuD;;IAGvD,sDAAsD;;IAGtD,mCAAmC;;IAGnC,gGAAgG;;;;IAGhG,qCAAqC;;;;;;;IAGrC,uBAAuB;;CAEvB,CAAA"}
|
|
@@ -3,11 +3,9 @@ import { type PolymorphicProps } from '../utils/modern-polymorphic';
|
|
|
3
3
|
export type BranchNameProps<As extends React.ElementType> = PolymorphicProps<As, 'a', {
|
|
4
4
|
className?: string;
|
|
5
5
|
}>;
|
|
6
|
-
declare const _default: <As extends React.ElementType>(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
6
|
+
declare const _default: <As extends React.ElementType>(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
7
7
|
className?: string;
|
|
8
|
-
}
|
|
9
|
-
className?: string;
|
|
10
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
8
|
+
}, "as"> & {
|
|
11
9
|
as?: As | undefined;
|
|
12
10
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
13
11
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchName.d.ts","sourceRoot":"","sources":["../../src/BranchName/BranchName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,gBAAgB,CAC1E,EAAE,EACF,GAAG,EACH;IACE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;yBAGmB,EAAE,SAAS,KAAK,CAAC,WAAW;gBALhC,MAAM
|
|
1
|
+
{"version":3,"file":"BranchName.d.ts","sourceRoot":"","sources":["../../src/BranchName/BranchName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,gBAAgB,CAC1E,EAAE,EACF,GAAG,EACH;IACE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;yBAGmB,EAAE,SAAS,KAAK,CAAC,WAAW;gBALhC,MAAM;;;;AAgBtB,wBAA0C"}
|
|
@@ -34,13 +34,10 @@ type StyledBreadcrumbsItemProps<As extends React.ElementType = 'a'> = Polymorphi
|
|
|
34
34
|
}>;
|
|
35
35
|
export type BreadcrumbsItemProps<As extends React.ElementType = 'a'> = StyledBreadcrumbsItemProps<As>;
|
|
36
36
|
declare const _default: typeof Breadcrumbs & {
|
|
37
|
-
Item: (<As extends React.ElementType = "a">(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
37
|
+
Item: (<As extends React.ElementType = "a">(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
38
38
|
to?: To;
|
|
39
39
|
selected?: boolean;
|
|
40
|
-
}
|
|
41
|
-
to?: To;
|
|
42
|
-
selected?: boolean;
|
|
43
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
40
|
+
}, "as"> & {
|
|
44
41
|
as?: As | undefined;
|
|
45
42
|
} & React.RefAttributes<any>) => React.ReactNode) & {
|
|
46
43
|
displayName: string;
|
|
@@ -51,13 +48,10 @@ export default _default;
|
|
|
51
48
|
* @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
|
|
52
49
|
*/
|
|
53
50
|
export declare const Breadcrumb: typeof Breadcrumbs & {
|
|
54
|
-
Item: <As extends React.ElementType = "a">(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
55
|
-
to?: To;
|
|
56
|
-
selected?: boolean;
|
|
57
|
-
} extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
51
|
+
Item: <As extends React.ElementType = "a">(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
58
52
|
to?: To;
|
|
59
53
|
selected?: boolean;
|
|
60
|
-
}
|
|
54
|
+
}, "as"> & {
|
|
61
55
|
as?: As | undefined;
|
|
62
56
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
63
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM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outRef<'div'> & {
|
|
|
66
66
|
*/
|
|
67
67
|
children: React.ReactNode;
|
|
68
68
|
};
|
|
69
|
-
declare const CardImpl: <As extends CardAs>(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "div" : As> & {
|
|
69
|
+
declare const CardImpl: <As extends CardAs>(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "div" : As> & {
|
|
70
70
|
/** Optional className for the root element. */
|
|
71
71
|
className?: string;
|
|
72
72
|
/** Internal padding. @default 'normal' */
|
|
@@ -84,25 +84,7 @@ declare const CardImpl: <As extends CardAs>(props: (React.ComponentPropsWithRef<
|
|
|
84
84
|
* `Card.Description`, `Card.Metadata`) or custom content.
|
|
85
85
|
*/
|
|
86
86
|
children: React.ReactNode;
|
|
87
|
-
}
|
|
88
|
-
/** Optional className for the root element. */
|
|
89
|
-
className?: string;
|
|
90
|
-
/** Internal padding. @default 'normal' */
|
|
91
|
-
padding?: "none" | "condensed" | "normal";
|
|
92
|
-
/** Border radius. @default 'large' */
|
|
93
|
-
borderRadius?: "medium" | "large";
|
|
94
|
-
/**
|
|
95
|
-
* Layout of the card. `compact` uses tighter spacing, removes the icon
|
|
96
|
-
* background container, and renders a smaller title.
|
|
97
|
-
* @default 'default'
|
|
98
|
-
*/
|
|
99
|
-
layout?: "default" | "compact";
|
|
100
|
-
/**
|
|
101
|
-
* Card contents. Provide either `Card.*` subcomponents (e.g. `Card.Heading`,
|
|
102
|
-
* `Card.Description`, `Card.Metadata`) or custom content.
|
|
103
|
-
*/
|
|
104
|
-
children: React.ReactNode;
|
|
105
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
87
|
+
}, "as"> & {
|
|
106
88
|
as?: As | undefined;
|
|
107
89
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
108
90
|
declare function CardIcon({ icon: IconComponent, 'aria-label': ariaLabel, className }: IconProps): React.JSX.Element;
|
package/dist/Card/Card.d.ts.map
CHANGED
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} from './Card';
|
|
2
2
|
import type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardActionProps, CardMetadataProps } from './Card';
|
|
3
|
-
declare const Card: (<As extends "div" | "section">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
|
|
3
|
+
declare const Card: (<As extends "div" | "section">(props: import("../utils/modern-polymorphic").DistributiveOmit<import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
|
|
4
4
|
className?: string;
|
|
5
5
|
padding?: "none" | "condensed" | "normal";
|
|
6
6
|
borderRadius?: "medium" | "large";
|
|
7
7
|
layout?: "default" | "compact";
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
className?: string;
|
|
11
|
-
padding?: "none" | "condensed" | "normal";
|
|
12
|
-
borderRadius?: "medium" | "large";
|
|
13
|
-
layout?: "default" | "compact";
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
9
|
+
}, "as"> & {
|
|
16
10
|
as?: As | undefined;
|
|
17
11
|
} & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
18
12
|
Icon: typeof CardIcon;
|
package/dist/Card/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,SAAS,EAAgC,UAAU,EAAe,MAAM,QAAQ,CAAA;AAC5G,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAClB,MAAM,QAAQ,CAAA;AAEf,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,SAAS,EAAgC,UAAU,EAAe,MAAM,QAAQ,CAAA;AAC5G,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAClB,MAAM,QAAQ,CAAA;AAEf,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;CAOR,CAAA;AAEF,OAAO,EAAC,IAAI,EAAC,CAAA;AACb,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,GAClB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-FilteredActionList-LoadingSkeleton-VKyQq{border-radius:4px}.prc-FilteredActionList-LoadingSpinner-I3a7Y{align-content:center;flex-grow:1;height:100%;padding:var(--base-size-16,1rem);text-align:center}.prc-FilteredActionList-LoadingSkeletonContainer-FMeRG{display:flex;flex-direction:column;flex-grow:1;padding:var(--base-size-8,.5rem)}
|
|
2
|
+
/*# sourceMappingURL=FilteredActionListLoaders-a46a8ea4.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/FilteredActionList/FilteredActionListLoaders.module.css.js"],"names":[],"mappings":"AAAA,8CAEE,iBACF,CAEA,6CAGE,oBAAqB,CADrB,WAAY,CAGZ,WAAY,CAJZ,gCAA4B,CAG5B,iBAEF,CAEA,uDAEE,YAAa,CAEb,qBAAsB,CADtB,WAAY,CAFZ,gCAIF","file":"FilteredActionListLoaders-a46a8ea4.css","sourcesContent":[".LoadingSkeleton {\n /* stylelint-disable-next-line primer/borders */\n border-radius: 4px;\n}\n\n.LoadingSpinner {\n padding: var(--base-size-16);\n flex-grow: 1;\n align-content: center;\n text-align: center;\n height: 100%;\n}\n\n.LoadingSkeletonContainer {\n padding: var(--base-size-8);\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n}\n"]}
|
|
@@ -139,12 +139,12 @@ function _temp(_, i) {
|
|
|
139
139
|
direction: "horizontal",
|
|
140
140
|
gap: "condensed",
|
|
141
141
|
align: "center",
|
|
142
|
-
className: classes.LoadingSkeletonRow,
|
|
143
142
|
children: [/*#__PURE__*/jsx(SkeletonBox, {
|
|
144
143
|
width: "16px",
|
|
145
144
|
height: "16px"
|
|
146
145
|
}), /*#__PURE__*/jsx(SkeletonBox, {
|
|
147
146
|
height: "10px",
|
|
147
|
+
width: `${Math.random() * 60 + 20}%`,
|
|
148
148
|
className: classes.LoadingSkeleton
|
|
149
149
|
})]
|
|
150
150
|
}, i);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './FilteredActionListLoaders-
|
|
1
|
+
import './FilteredActionListLoaders-a46a8ea4.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"LoadingSkeleton":"prc-FilteredActionList-LoadingSkeleton-VKyQq","
|
|
3
|
+
var classes = {"LoadingSkeleton":"prc-FilteredActionList-LoadingSkeleton-VKyQq","LoadingSpinner":"prc-FilteredActionList-LoadingSpinner-I3a7Y","LoadingSkeletonContainer":"prc-FilteredActionList-LoadingSkeletonContainer-FMeRG"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
package/dist/Link/Link.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ type StyledLinkProps<As extends React.ElementType = 'a'> = {
|
|
|
9
9
|
inline?: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const UnwrappedLink: <As extends React.ElementType = "a">(props: PolymorphicProps<As, "a", StyledLinkProps>, ref: ForwardedRef<unknown>) => React.JSX.Element;
|
|
12
|
-
declare const Link: (<As extends React.ElementType = "a">(props: (
|
|
12
|
+
declare const Link: (<As extends React.ElementType = "a">(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & StyledLinkProps<"a">, "as"> & {
|
|
13
13
|
as?: As | undefined;
|
|
14
14
|
} & React.RefAttributes<unknown>) => React.ReactNode) & {
|
|
15
15
|
displayName: string;
|
|
@@ -41,19 +41,13 @@ export declare const GroupExpand: React.ForwardRefExoticComponent<NavListGroupEx
|
|
|
41
41
|
export type NavListGroupHeadingProps = ActionListGroupHeadingProps;
|
|
42
42
|
export declare const NavList: React.ForwardRefExoticComponent<Omit<NavListProps, "ref"> & React.RefAttributes<HTMLElement>> & {
|
|
43
43
|
Description: import("..").FCWithSlotMarker<React.PropsWithChildren<import("..").ActionListDescriptionProps>>;
|
|
44
|
-
Item: (<As extends React.ElementType = "a">(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
44
|
+
Item: (<As extends React.ElementType = "a">(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
45
45
|
children: React.ReactNode;
|
|
46
46
|
defaultOpen?: boolean;
|
|
47
47
|
href?: string;
|
|
48
48
|
'aria-current'?: "page" | "step" | "location" | "date" | "time" | "true" | "false" | boolean;
|
|
49
49
|
inactiveText?: string;
|
|
50
|
-
}
|
|
51
|
-
children: React.ReactNode;
|
|
52
|
-
defaultOpen?: boolean;
|
|
53
|
-
href?: string;
|
|
54
|
-
'aria-current'?: "page" | "step" | "location" | "date" | "time" | "true" | "false" | boolean;
|
|
55
|
-
inactiveText?: string;
|
|
56
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
50
|
+
}, "as"> & {
|
|
57
51
|
as?: As | undefined;
|
|
58
52
|
} & React.RefAttributes<unknown>) => React.ReactNode) & {
|
|
59
53
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavList.d.ts","sourceRoot":"","sources":["../../src/NavList/NavList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAC3E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAuB,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK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M,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,CAAA;CAClD,CAAA;AAED,eAAO,MAAM,WAAW,mGAgFvB,CAAA;AAKD,MAAM,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAqBlE,eAAO,MAAM,OAAO;;YA7WjB,EAAE,SAAS,KAAK,CAAC,WAAW;kBATjB,KAAK,CAAC,SAAS;sBACX,OAAO;eACd,MAAM;yBACI,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO;uBAC7E,MAAM;;;;;;;;;;;;;;CA6XvB,CAAA"}
|
package/dist/Text/Text.d.ts
CHANGED
|
@@ -6,17 +6,12 @@ export type TextProps<As extends React.ElementType = 'span'> = PolymorphicProps<
|
|
|
6
6
|
whiteSpace?: 'pre' | 'normal' | 'nowrap' | 'pre-wrap' | 'pre-line';
|
|
7
7
|
className?: string;
|
|
8
8
|
}>;
|
|
9
|
-
declare const _default: <As extends React.ElementType>(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "span" : As> & {
|
|
9
|
+
declare const _default: <As extends React.ElementType>(props: import("../utils/modern-polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "span" : As> & {
|
|
10
10
|
size?: "large" | "medium" | "small";
|
|
11
11
|
weight?: "light" | "normal" | "medium" | "semibold";
|
|
12
12
|
whiteSpace?: "pre" | "normal" | "nowrap" | "pre-wrap" | "pre-line";
|
|
13
13
|
className?: string;
|
|
14
|
-
}
|
|
15
|
-
size?: "large" | "medium" | "small";
|
|
16
|
-
weight?: "light" | "normal" | "medium" | "semibold";
|
|
17
|
-
whiteSpace?: "pre" | "normal" | "nowrap" | "pre-wrap" | "pre-line";
|
|
18
|
-
className?: string;
|
|
19
|
-
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
14
|
+
}, "as"> & {
|
|
20
15
|
as?: As | undefined;
|
|
21
16
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
22
17
|
export default _default;
|
package/dist/Text/Text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,SAAS,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E,EAAE,EACF,MAAM,EACN;IACE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IACnD,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAA;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;yBAGa,EAAE,SAAS,KAAK,CAAC,WAAW;WAR/B,OAAO,GAAG,QAAQ,GAAG,OAAO;aAC1B,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU;iBACtC,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU;gBACtD,MAAM
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,SAAS,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E,EAAE,EACF,MAAM,EACN;IACE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IACnD,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAA;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;yBAGa,EAAE,SAAS,KAAK,CAAC,WAAW;WAR/B,OAAO,GAAG,QAAQ,GAAG,OAAO;aAC1B,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU;iBACtC,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU;gBACtD,MAAM;;;;AAsBtB,wBAAoC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Icon } from '@primer/octicons-react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { FCWithSlotMarker } from '../utils/types';
|
|
4
|
+
import { type DistributiveOmit } from '../utils/modern-polymorphic';
|
|
4
5
|
export type TreeViewProps = {
|
|
5
6
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
6
7
|
'aria-labelledby'?: React.AriaAttributes['aria-labelledby'];
|
|
@@ -17,7 +18,7 @@ export type TreeViewSecondaryActions = {
|
|
|
17
18
|
count?: number | string;
|
|
18
19
|
className?: string;
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
+
type TreeViewItemBaseProps = {
|
|
21
22
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
22
23
|
'aria-labelledby'?: React.AriaAttributes['aria-labelledby'];
|
|
23
24
|
id: string;
|
|
@@ -31,6 +32,9 @@ export type TreeViewItemProps = {
|
|
|
31
32
|
className?: string;
|
|
32
33
|
secondaryActions?: TreeViewSecondaryActions[];
|
|
33
34
|
};
|
|
35
|
+
export type TreeViewItemProps<As extends React.ElementType = 'li'> = DistributiveOmit<React.ComponentPropsWithoutRef<React.ElementType extends As ? 'li' : As>, 'as' | 'onSelect'> & TreeViewItemBaseProps & {
|
|
36
|
+
as?: As;
|
|
37
|
+
};
|
|
34
38
|
export type SubTreeState = 'initial' | 'loading' | 'done' | 'error';
|
|
35
39
|
export type TreeViewSubTreeProps = {
|
|
36
40
|
children?: React.ReactNode;
|
|
@@ -62,7 +66,11 @@ export type TreeViewErrorDialogProps = {
|
|
|
62
66
|
onDismiss?: () => void;
|
|
63
67
|
};
|
|
64
68
|
export declare const TreeView: React.FC<TreeViewProps> & {
|
|
65
|
-
Item: React.
|
|
69
|
+
Item: (<As extends React.ElementType = "li">(props: DistributiveOmit<React.PropsWithoutRef<React.ComponentProps<React.ElementType<any, keyof React.JSX.IntrinsicElements> extends As ? "li" : As>>, "as" | "onSelect"> & TreeViewItemBaseProps & {
|
|
70
|
+
as?: As | undefined;
|
|
71
|
+
} & React.RefAttributes<unknown>) => React.ReactNode) & {
|
|
72
|
+
displayName: string;
|
|
73
|
+
};
|
|
66
74
|
SubTree: FCWithSlotMarker<TreeViewSubTreeProps>;
|
|
67
75
|
LeadingAction: React.FC<TreeViewVisualProps>;
|
|
68
76
|
LeadingVisual: React.FC<TreeViewVisualProps>;
|
|
@@ -70,4 +78,5 @@ export declare const TreeView: React.FC<TreeViewProps> & {
|
|
|
70
78
|
DirectoryIcon: () => React.JSX.Element;
|
|
71
79
|
ErrorDialog: React.FC<TreeViewErrorDialogProps>;
|
|
72
80
|
};
|
|
81
|
+
export {};
|
|
73
82
|
//# sourceMappingURL=TreeView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../src/TreeView/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAA+B,MAAM,OAAO,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M,CAAA;CACf,CAAA;AAqED,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AA0ED,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAwED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AA4CD,eAAO,MAAM,QAAQ;YA9vBlB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;CAswB7B,CAAA"}
|
|
@@ -17,6 +17,7 @@ import { ButtonComponent } from '../Button/Button.js';
|
|
|
17
17
|
import { ActionList } from '../ActionList/index.js';
|
|
18
18
|
import { usePlatform } from '../KeybindingHint/platform.js';
|
|
19
19
|
import { isSlot } from '../utils/is-slot.js';
|
|
20
|
+
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
20
21
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
21
22
|
import { getAccessibleKeybindingHintString } from '../KeybindingHint/utils.js';
|
|
22
23
|
import { AriaStatus } from '../live-region/AriaStatus.js';
|
|
@@ -265,7 +266,17 @@ Root.displayName = 'TreeView';
|
|
|
265
266
|
// ----------------------------------------------------------------------------
|
|
266
267
|
// TreeView.Item
|
|
267
268
|
|
|
268
|
-
|
|
269
|
+
// We build this type manually (instead of using `PolymorphicProps`) so we can omit
|
|
270
|
+
// `ref` and `onSelect` from the underlying element's props:
|
|
271
|
+
// - `ref` is provided solely by `fixedForwardRef` (typed as `Ref<unknown>`), preserving
|
|
272
|
+
// backward compatibility with consumers that pass `Ref<HTMLElement>` rather than the
|
|
273
|
+
// intrinsic element's ref type (e.g. `Ref<HTMLLIElement>` for the default `<li>`).
|
|
274
|
+
// - Our custom `onSelect` (typed against `HTMLElement`) replaces the native
|
|
275
|
+
// `ReactEventHandler<HTMLLIElement>` that would otherwise be intersected in
|
|
276
|
+
// and conflict with existing consumers.
|
|
277
|
+
// `DistributiveOmit` keeps the omit distributing over `as` union types.
|
|
278
|
+
|
|
279
|
+
const ItemImpl = fixedForwardRef(({
|
|
269
280
|
id: itemId,
|
|
270
281
|
containIntrinsicSize,
|
|
271
282
|
current: isCurrentItem = false,
|
|
@@ -277,8 +288,16 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
277
288
|
className,
|
|
278
289
|
'aria-label': ariaLabel,
|
|
279
290
|
'aria-labelledby': ariaLabelledby,
|
|
280
|
-
secondaryActions
|
|
291
|
+
secondaryActions,
|
|
292
|
+
as: Component,
|
|
293
|
+
...restProps
|
|
281
294
|
}, ref) => {
|
|
295
|
+
// Note: when `as` swaps the element from `<li>`, the resulting markup
|
|
296
|
+
// (e.g. `<a>` as a direct child of `<ul role="tree">`) is technically
|
|
297
|
+
// not valid HTML. This mirrors the trade-off made by other polymorphic
|
|
298
|
+
// Primer components (e.g. `Breadcrumbs.Item`, `ActionList.LinkItem`)
|
|
299
|
+
// to support router-link integrations.
|
|
300
|
+
const ItemElement = Component !== null && Component !== void 0 ? Component : 'li';
|
|
282
301
|
const [slots, rest] = useSlots(children, {
|
|
283
302
|
leadingAction: LeadingAction,
|
|
284
303
|
leadingVisual: LeadingVisual,
|
|
@@ -320,9 +339,7 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
320
339
|
const platform = usePlatform();
|
|
321
340
|
|
|
322
341
|
// Set the expanded state and cache it
|
|
323
|
-
const setIsExpandedWithCache = React.useCallback(
|
|
324
|
-
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
325
|
-
newIsExpanded => {
|
|
342
|
+
const setIsExpandedWithCache = React.useCallback(newIsExpanded => {
|
|
326
343
|
var _expandedStateCache$c3;
|
|
327
344
|
setIsExpanded(newIsExpanded);
|
|
328
345
|
(_expandedStateCache$c3 = expandedStateCache.current) === null || _expandedStateCache$c3 === void 0 ? void 0 : _expandedStateCache$c3.set(itemId, newIsExpanded);
|
|
@@ -345,34 +362,34 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
345
362
|
action();
|
|
346
363
|
}
|
|
347
364
|
}, [secondaryActions]);
|
|
348
|
-
const handleKeyDown = React.useCallback(
|
|
349
|
-
switch (
|
|
365
|
+
const handleKeyDown = React.useCallback(event => {
|
|
366
|
+
switch (event.key) {
|
|
350
367
|
case 'Enter':
|
|
351
368
|
case ' ':
|
|
352
369
|
if (onSelect) {
|
|
353
|
-
onSelect(
|
|
370
|
+
onSelect(event);
|
|
354
371
|
} else {
|
|
355
|
-
toggle(
|
|
372
|
+
toggle(event);
|
|
356
373
|
}
|
|
357
|
-
|
|
374
|
+
event.stopPropagation();
|
|
358
375
|
break;
|
|
359
376
|
case 'ArrowRight':
|
|
360
377
|
// Ignore if modifier keys are pressed
|
|
361
|
-
if (
|
|
362
|
-
|
|
363
|
-
|
|
378
|
+
if (event.altKey || event.metaKey) return;
|
|
379
|
+
event.preventDefault();
|
|
380
|
+
event.stopPropagation();
|
|
364
381
|
setIsExpandedWithCache(true);
|
|
365
382
|
break;
|
|
366
383
|
case 'ArrowLeft':
|
|
367
384
|
// Ignore if modifier keys are pressed
|
|
368
|
-
if (
|
|
369
|
-
|
|
370
|
-
|
|
385
|
+
if (event.altKey || event.metaKey) return;
|
|
386
|
+
event.preventDefault();
|
|
387
|
+
event.stopPropagation();
|
|
371
388
|
setIsExpandedWithCache(false);
|
|
372
389
|
break;
|
|
373
390
|
case 'U':
|
|
374
391
|
case 'u':
|
|
375
|
-
if (!(
|
|
392
|
+
if (!(event.shiftKey && (event.metaKey || event.ctrlKey))) return;
|
|
376
393
|
activateActionsDialog();
|
|
377
394
|
break;
|
|
378
395
|
}
|
|
@@ -392,7 +409,7 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
392
409
|
trailingVisualId,
|
|
393
410
|
trailingActionId
|
|
394
411
|
},
|
|
395
|
-
children: /*#__PURE__*/jsxs(
|
|
412
|
+
children: /*#__PURE__*/jsxs(ItemElement, {
|
|
396
413
|
className: clsx('PRIVATE_TreeView-item', className, classes.TreeViewItem),
|
|
397
414
|
ref: ref,
|
|
398
415
|
tabIndex: 0,
|
|
@@ -408,32 +425,33 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
408
425
|
"data-has-leading-action": slots.leadingAction ? true : undefined,
|
|
409
426
|
"data-loading": isLoadingPlaceholder ? true : undefined,
|
|
410
427
|
onKeyDown: handleKeyDown,
|
|
411
|
-
onFocus:
|
|
428
|
+
onFocus: event => {
|
|
412
429
|
// Defer scroll to the next animation frame so that rapid keyboard
|
|
413
430
|
// navigation (held key) coalesces into a single reflow per frame
|
|
414
|
-
scrollElementIntoView(
|
|
431
|
+
scrollElementIntoView(event.currentTarget.firstElementChild);
|
|
415
432
|
|
|
416
433
|
// Set the focused state
|
|
417
434
|
setIsFocused(true);
|
|
418
435
|
|
|
419
436
|
// Prevent focus event from bubbling up to parent items
|
|
420
|
-
|
|
437
|
+
event.stopPropagation();
|
|
421
438
|
},
|
|
422
439
|
onBlur: () => setIsFocused(false),
|
|
423
|
-
onClick:
|
|
440
|
+
onClick: event => {
|
|
424
441
|
if (onSelect) {
|
|
425
|
-
onSelect(
|
|
442
|
+
onSelect(event);
|
|
426
443
|
} else {
|
|
427
|
-
toggle(
|
|
444
|
+
toggle(event);
|
|
428
445
|
}
|
|
429
|
-
|
|
446
|
+
event.stopPropagation();
|
|
430
447
|
},
|
|
431
|
-
onAuxClick:
|
|
432
|
-
if (onSelect &&
|
|
433
|
-
onSelect(
|
|
448
|
+
onAuxClick: event => {
|
|
449
|
+
if (onSelect && event.button === 1) {
|
|
450
|
+
onSelect(event);
|
|
434
451
|
}
|
|
435
|
-
|
|
452
|
+
event.stopPropagation();
|
|
436
453
|
},
|
|
454
|
+
...restProps,
|
|
437
455
|
children: [/*#__PURE__*/jsxs("div", {
|
|
438
456
|
className: clsx('PRIVATE_TreeView-item-container', classes.TreeViewItemContainer),
|
|
439
457
|
style: {
|
|
@@ -458,9 +476,9 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
458
476
|
// If they take up a button role, they become unnecessary and numerous tab stops.
|
|
459
477
|
jsx("div", {
|
|
460
478
|
className: clsx('PRIVATE_TreeView-item-toggle', onSelect && 'PRIVATE_TreeView-item-toggle--hover', level === 1 && 'PRIVATE_TreeView-item-toggle--end', classes.TreeViewItemToggle, classes.TreeViewItemToggleHover, classes.TreeViewItemToggleEnd),
|
|
461
|
-
onClick:
|
|
479
|
+
onClick: event => {
|
|
462
480
|
if (onSelect) {
|
|
463
|
-
toggle(
|
|
481
|
+
toggle(event);
|
|
464
482
|
}
|
|
465
483
|
},
|
|
466
484
|
children: isExpanded ? /*#__PURE__*/jsx(ChevronDownIcon, {
|
|
@@ -488,6 +506,9 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
488
506
|
})
|
|
489
507
|
});
|
|
490
508
|
});
|
|
509
|
+
const Item = Object.assign(ItemImpl, {
|
|
510
|
+
displayName: 'TreeView.Item'
|
|
511
|
+
});
|
|
491
512
|
|
|
492
513
|
/** Lines to indicate the depth of an item in a TreeView */
|
|
493
514
|
const LevelIndicatorLines = t0 => {
|
|
@@ -520,7 +541,6 @@ const LevelIndicatorLines = t0 => {
|
|
|
520
541
|
}
|
|
521
542
|
return t2;
|
|
522
543
|
};
|
|
523
|
-
Item.displayName = 'TreeView.Item';
|
|
524
544
|
|
|
525
545
|
// ----------------------------------------------------------------------------
|
|
526
546
|
// TreeView.SubTree
|
|
@@ -755,118 +775,121 @@ const LoadingItem = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
755
775
|
} = t0;
|
|
756
776
|
const itemId = useId();
|
|
757
777
|
if (count) {
|
|
758
|
-
|
|
778
|
+
const t1 = ref;
|
|
779
|
+
let t2;
|
|
759
780
|
if ($[0] !== count) {
|
|
760
|
-
|
|
781
|
+
t2 = Array.from({
|
|
761
782
|
length: count
|
|
762
783
|
}).map(_temp3);
|
|
763
784
|
$[0] = count;
|
|
764
|
-
$[1] =
|
|
785
|
+
$[1] = t2;
|
|
765
786
|
} else {
|
|
766
|
-
|
|
787
|
+
t2 = $[1];
|
|
767
788
|
}
|
|
768
|
-
let
|
|
789
|
+
let t3;
|
|
769
790
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
770
|
-
|
|
771
|
-
$[2] =
|
|
791
|
+
t3 = clsx("PRIVATE_VisuallyHidden", classes.TreeViewVisuallyHidden);
|
|
792
|
+
$[2] = t3;
|
|
772
793
|
} else {
|
|
773
|
-
|
|
794
|
+
t3 = $[2];
|
|
774
795
|
}
|
|
775
|
-
let
|
|
796
|
+
let t4;
|
|
776
797
|
if ($[3] !== count) {
|
|
777
|
-
|
|
778
|
-
className:
|
|
798
|
+
t4 = /*#__PURE__*/jsxs("div", {
|
|
799
|
+
className: t3,
|
|
779
800
|
children: ["Loading ", count, " items"]
|
|
780
801
|
});
|
|
781
802
|
$[3] = count;
|
|
782
|
-
$[4] =
|
|
803
|
+
$[4] = t4;
|
|
783
804
|
} else {
|
|
784
|
-
|
|
805
|
+
t4 = $[4];
|
|
785
806
|
}
|
|
786
|
-
let
|
|
787
|
-
if ($[5] !== itemId || $[6] !==
|
|
788
|
-
|
|
807
|
+
let t5;
|
|
808
|
+
if ($[5] !== itemId || $[6] !== t1 || $[7] !== t2 || $[8] !== t4) {
|
|
809
|
+
t5 = /*#__PURE__*/jsx(LoadingPlaceholderContext.Provider, {
|
|
789
810
|
value: true,
|
|
790
811
|
children: /*#__PURE__*/jsxs(Item, {
|
|
791
812
|
id: itemId,
|
|
792
|
-
ref:
|
|
793
|
-
children: [
|
|
813
|
+
ref: t1,
|
|
814
|
+
children: [t2, t4]
|
|
794
815
|
})
|
|
795
816
|
});
|
|
796
817
|
$[5] = itemId;
|
|
797
|
-
$[6] =
|
|
798
|
-
$[7] =
|
|
799
|
-
$[8] =
|
|
800
|
-
$[9] =
|
|
818
|
+
$[6] = t1;
|
|
819
|
+
$[7] = t2;
|
|
820
|
+
$[8] = t4;
|
|
821
|
+
$[9] = t5;
|
|
801
822
|
} else {
|
|
802
|
-
|
|
823
|
+
t5 = $[9];
|
|
803
824
|
}
|
|
804
|
-
return
|
|
825
|
+
return t5;
|
|
805
826
|
}
|
|
806
|
-
|
|
827
|
+
const t1 = ref;
|
|
807
828
|
let t2;
|
|
829
|
+
let t3;
|
|
808
830
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
809
|
-
|
|
831
|
+
t2 = /*#__PURE__*/jsx(LeadingVisual, {
|
|
810
832
|
children: /*#__PURE__*/jsx(Spinner, {
|
|
811
833
|
size: "small"
|
|
812
834
|
})
|
|
813
835
|
});
|
|
814
|
-
|
|
836
|
+
t3 = /*#__PURE__*/jsx(Text, {
|
|
815
837
|
className: "fgColor-muted",
|
|
816
838
|
children: "Loading..."
|
|
817
839
|
});
|
|
818
|
-
$[10] =
|
|
819
|
-
$[11] =
|
|
840
|
+
$[10] = t2;
|
|
841
|
+
$[11] = t3;
|
|
820
842
|
} else {
|
|
821
|
-
|
|
822
|
-
|
|
843
|
+
t2 = $[10];
|
|
844
|
+
t3 = $[11];
|
|
823
845
|
}
|
|
824
|
-
let
|
|
825
|
-
if ($[12] !== itemId || $[13] !==
|
|
826
|
-
|
|
846
|
+
let t4;
|
|
847
|
+
if ($[12] !== itemId || $[13] !== t1) {
|
|
848
|
+
t4 = /*#__PURE__*/jsx(LoadingPlaceholderContext.Provider, {
|
|
827
849
|
value: true,
|
|
828
850
|
children: /*#__PURE__*/jsxs(Item, {
|
|
829
851
|
id: itemId,
|
|
830
|
-
ref:
|
|
831
|
-
children: [
|
|
852
|
+
ref: t1,
|
|
853
|
+
children: [t2, t3]
|
|
832
854
|
})
|
|
833
855
|
});
|
|
834
856
|
$[12] = itemId;
|
|
835
|
-
$[13] =
|
|
836
|
-
$[14] =
|
|
857
|
+
$[13] = t1;
|
|
858
|
+
$[14] = t4;
|
|
837
859
|
} else {
|
|
838
|
-
|
|
860
|
+
t4 = $[14];
|
|
839
861
|
}
|
|
840
|
-
return
|
|
862
|
+
return t4;
|
|
841
863
|
});
|
|
842
864
|
const EmptyItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
843
865
|
const $ = c(4);
|
|
844
866
|
const t0 = useId();
|
|
845
|
-
|
|
867
|
+
const t1 = ref;
|
|
868
|
+
let t2;
|
|
846
869
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
847
|
-
|
|
870
|
+
t2 = /*#__PURE__*/jsx(Text, {
|
|
848
871
|
className: "fgColor-muted",
|
|
849
872
|
children: "No items found"
|
|
850
873
|
});
|
|
851
|
-
$[0] =
|
|
874
|
+
$[0] = t2;
|
|
852
875
|
} else {
|
|
853
|
-
|
|
876
|
+
t2 = $[0];
|
|
854
877
|
}
|
|
855
|
-
let
|
|
856
|
-
if ($[1] !==
|
|
857
|
-
|
|
878
|
+
let t3;
|
|
879
|
+
if ($[1] !== t0 || $[2] !== t1) {
|
|
880
|
+
t3 = /*#__PURE__*/jsx(Item, {
|
|
858
881
|
expanded: null,
|
|
859
882
|
id: t0,
|
|
860
|
-
ref:
|
|
861
|
-
children:
|
|
883
|
+
ref: t1,
|
|
884
|
+
children: t2
|
|
862
885
|
});
|
|
863
|
-
$[1] =
|
|
864
|
-
$[2] =
|
|
865
|
-
$[3] =
|
|
886
|
+
$[1] = t0;
|
|
887
|
+
$[2] = t1;
|
|
888
|
+
$[3] = t3;
|
|
866
889
|
} else {
|
|
867
|
-
|
|
890
|
+
t3 = $[3];
|
|
868
891
|
}
|
|
869
|
-
return
|
|
892
|
+
return t3;
|
|
870
893
|
});
|
|
871
894
|
function useSubTree(children) {
|
|
872
895
|
const $ = c(8);
|
|
@@ -2,7 +2,7 @@ import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Distributive Omit utility type that works correctly with union types
|
|
4
4
|
*/
|
|
5
|
-
type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends unknown ? Omit<T, TOmitted> : never;
|
|
5
|
+
export type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends unknown ? Omit<T, TOmitted> : never;
|
|
6
6
|
/**
|
|
7
7
|
* Fixed version of forwardRef that provides better type inference for polymorphic components
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modern-polymorphic.d.ts","sourceRoot":"","sources":["../../src/utils/modern-polymorphic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,WAAW,EAAC,MAAM,OAAO,CAAA;AAE7D;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"modern-polymorphic.d.ts","sourceRoot":"","sources":["../../src/utils/modern-polymorphic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,WAAW,EAAC,MAAM,OAAO,CAAA;AAE7D;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,QAAQ,SAAS,WAAW,IAAI,CAAC,SAAS,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAA;AAE7G;;GAEG;AAGH,KAAK,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,EACnC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,KACrD,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;AAE3D;;GAEG;AACH,eAAO,MAAM,eAAe,EAAiB,eAAe,CAAA;AAE5D;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAC1B,GAAG,SAAS,WAAW,EACvB,eAAe,SAAS,WAAW,GAAG,KAAK,EAC3C,KAAK,GAAG,MAAM,IACZ,gBAAgB,CAAC,qBAAqB,CAAC,WAAW,SAAS,GAAG,GAAG,eAAe,GAAG,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,GAAG;IAC3G,EAAE,CAAC,EAAE,GAAG,CAAA;CACT,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-FilteredActionList-LoadingSkeleton-VKyQq{border-radius:4px;width:var(--loading-skeleton-width)}.prc-FilteredActionList-LoadingSkeletonRow-yQoJ-{--loading-skeleton-width:80%}.prc-FilteredActionList-LoadingSkeletonRow-yQoJ-:nth-of-type(5n+2){--loading-skeleton-width:52.5%}.prc-FilteredActionList-LoadingSkeletonRow-yQoJ-:nth-of-type(5n+3){--loading-skeleton-width:67.5%}.prc-FilteredActionList-LoadingSkeletonRow-yQoJ-:nth-of-type(5n+4){--loading-skeleton-width:40%}.prc-FilteredActionList-LoadingSkeletonRow-yQoJ-:nth-of-type(5n+5){--loading-skeleton-width:72.5%}.prc-FilteredActionList-LoadingSpinner-I3a7Y{align-content:center;flex-grow:1;height:100%;padding:var(--base-size-16,1rem);text-align:center}.prc-FilteredActionList-LoadingSkeletonContainer-FMeRG{display:flex;flex-direction:column;flex-grow:1;padding:var(--base-size-8,.5rem)}
|
|
2
|
-
/*# sourceMappingURL=FilteredActionListLoaders-bdda3d7e.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/FilteredActionList/FilteredActionListLoaders.module.css.js"],"names":[],"mappings":"AAAA,8CAGE,iBAAkB,CAFlB,mCAGF,CAEA,iDACE,4BAiBF,CAfE,mEACE,8BACF,CAEA,mEACE,8BACF,CAEA,mEACE,4BACF,CAEA,mEACE,8BACF,CAGF,6CAGE,oBAAqB,CADrB,WAAY,CAGZ,WAAY,CAJZ,gCAA4B,CAG5B,iBAEF,CAEA,uDAEE,YAAa,CAEb,qBAAsB,CADtB,WAAY,CAFZ,gCAIF","file":"FilteredActionListLoaders-bdda3d7e.css","sourcesContent":[".LoadingSkeleton {\n width: var(--loading-skeleton-width);\n /* stylelint-disable-next-line primer/borders */\n border-radius: 4px;\n}\n\n.LoadingSkeletonRow {\n --loading-skeleton-width: 80%;\n\n &:nth-of-type(5n + 2) {\n --loading-skeleton-width: 52.5%;\n }\n\n &:nth-of-type(5n + 3) {\n --loading-skeleton-width: 67.5%;\n }\n\n &:nth-of-type(5n + 4) {\n --loading-skeleton-width: 40%;\n }\n\n &:nth-of-type(5n + 5) {\n --loading-skeleton-width: 72.5%;\n }\n}\n\n.LoadingSpinner {\n padding: var(--base-size-16);\n flex-grow: 1;\n align-content: center;\n text-align: center;\n height: 100%;\n}\n\n.LoadingSkeletonContainer {\n padding: var(--base-size-8);\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n}\n"]}
|