@primer/react-brand 0.14.0 → 0.15.0-rc.0f3d5ea

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.
Files changed (134) hide show
  1. package/lib/ActionMenu/ActionMenu.d.ts +155 -0
  2. package/lib/ActionMenu/ActionMenu.visual.spec.d.ts +1 -0
  3. package/lib/ActionMenu/index.d.ts +1 -0
  4. package/lib/Avatar/Avatar.d.ts +2 -2
  5. package/lib/Card/Card.d.ts +9 -6
  6. package/lib/SubdomainNavBar/SubdomainNavBar.d.ts +1 -1
  7. package/lib/css/main.css +232 -26
  8. package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
  9. package/lib/design-tokens/css/tokens/base/colors/color-scales.css +1 -1
  10. package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
  11. package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
  12. package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
  13. package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
  14. package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
  15. package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +21 -0
  16. package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
  17. package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
  18. package/lib/design-tokens/css/tokens/functional/components/card/base.css +2 -2
  19. package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
  20. package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
  21. package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
  22. package/lib/design-tokens/css/tokens/functional/components/control/base.css +1 -1
  23. package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
  24. package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
  25. package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
  26. package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
  27. package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
  28. package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
  29. package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
  30. package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
  31. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
  32. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
  33. package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
  34. package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
  35. package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
  36. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
  37. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
  38. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
  39. package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
  40. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
  41. package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
  42. package/lib/design-tokens/js/module/tokens/base/colors/color-scales.js +1 -1
  43. package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
  44. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
  45. package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
  46. package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +15 -18
  47. package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
  48. package/lib/design-tokens/js/module/tokens/functional/components/control/base.js +1 -1
  49. package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
  50. package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
  51. package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
  52. package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
  53. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
  54. package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
  55. package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
  56. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
  57. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
  58. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
  59. package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
  60. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
  61. package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
  62. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
  63. package/lib/design-tokens/js/tokens/base/colors/color-scales.js +1 -1
  64. package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
  65. package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
  66. package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
  67. package/lib/design-tokens/js/tokens/functional/components/card/base.js +2 -2
  68. package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
  69. package/lib/design-tokens/js/tokens/functional/components/control/base.js +1 -1
  70. package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
  71. package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
  72. package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
  73. package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
  74. package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
  75. package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
  76. package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
  77. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
  78. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
  79. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
  80. package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
  81. package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
  82. package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
  83. package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
  84. package/lib/design-tokens/ts/tokens/base/colors/color-scales.d.ts +1 -1
  85. package/lib/design-tokens/ts/tokens/base/colors/color-scales.js +1 -1
  86. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
  87. package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
  88. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
  89. package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
  90. package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
  91. package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
  92. package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +2 -4
  93. package/lib/design-tokens/ts/tokens/functional/components/card/base.js +2 -4
  94. package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
  95. package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
  96. package/lib/design-tokens/ts/tokens/functional/components/control/base.d.ts +1 -1
  97. package/lib/design-tokens/ts/tokens/functional/components/control/base.js +1 -1
  98. package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
  99. package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
  100. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
  101. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
  102. package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
  103. package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
  104. package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
  105. package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
  106. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
  107. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
  108. package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
  109. package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
  110. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
  111. package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
  112. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  113. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
  114. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  115. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
  116. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
  117. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
  118. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
  119. package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
  120. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
  121. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
  122. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
  123. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
  124. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
  125. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
  126. package/lib/hooks/useAnchoredPosition.d.ts +20 -0
  127. package/lib/hooks/useOnClickOutside.d.ts +2 -1
  128. package/lib/hooks/useRef.d.ts +10 -0
  129. package/lib/hooks/useResizeObserver.d.ts +6 -0
  130. package/lib/index.d.ts +1 -0
  131. package/lib/index.js +1 -1
  132. package/lib/test-utils/fixtures/data.d.ts +1 -0
  133. package/lib/test-utils/setupTests.d.ts +1 -0
  134. package/package.json +3 -1
@@ -0,0 +1,155 @@
1
+ import React, { PropsWithChildren, Ref, ReactElement } from 'react';
2
+ import type { BaseProps } from '../component-helpers';
3
+ /**
4
+ * Design tokens
5
+ */
6
+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css';
7
+ declare type ActionMenuProps = {
8
+ /**
9
+ * The content of the ActionMenu. Must be an ActionMenu.Button and an ActionMenu.Overlay
10
+ */
11
+ children: ReactElement<ActionMenuButtonProps> | ReactElement<ActionMenuOverlayProps> | Array<ReactElement<ActionMenuButtonProps> | ReactElement<ActionMenuOverlayProps>>;
12
+ /**
13
+ * Determines whether the ActionMenu is disabled
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Determines whether the ActionMenu is open by default
18
+ */
19
+ open?: boolean;
20
+ /**
21
+ * Callback that is called when an item is selected.
22
+ * The value of the selected item is passed as an argument.
23
+ */
24
+ onSelect?: (newValue: string) => void;
25
+ /**
26
+ * The selection variant of the ActionMenu.
27
+ * - `single`: Only one item can be selected at a time. Menu items as a menuitemradio.
28
+ * - `none`: No items can be selected. Menu items as a menuitem.
29
+ */
30
+ selectionVariant?: 'single' | 'none';
31
+ /**
32
+ * Test id for the ActionMenu
33
+ */
34
+ 'data-testid'?: string;
35
+ /**
36
+ * Horizontal alignment of the menu relative to the bottom of the button
37
+ */
38
+ menuAlignment?: 'start' | 'end';
39
+ } & BaseProps<HTMLDivElement>;
40
+ declare type ActionMenuButtonProps = PropsWithChildren<Ref<HTMLButtonElement>> & {
41
+ id?: string;
42
+ ref?: React.RefObject<HTMLButtonElement>;
43
+ className?: string;
44
+ menuOpen?: boolean;
45
+ disabled?: boolean;
46
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
47
+ 'data-testid'?: string;
48
+ };
49
+ declare type ActionMenuItemProps = {
50
+ value: string;
51
+ handler?: (newValue: string) => void;
52
+ selected?: boolean;
53
+ type?: 'none' | 'single';
54
+ disabled?: boolean;
55
+ } & PropsWithChildren<React.HTMLProps<HTMLLIElement>>;
56
+ declare type ActionMenuOverlayProps = PropsWithChildren<Ref<HTMLUListElement>> & {
57
+ 'aria-label': string;
58
+ id?: string;
59
+ ref?: React.RefObject<HTMLUListElement>;
60
+ className?: string;
61
+ 'data-testid'?: string;
62
+ menuOpen?: boolean;
63
+ style?: React.CSSProperties;
64
+ };
65
+ /**
66
+ * Use ActionMenu to display a list of actions or selections that expand through a trigger button.
67
+ * @see https://primer.style/brand/components/ActionMenu
68
+ */
69
+ export declare const ActionMenu: React.NamedExoticComponent<{
70
+ /**
71
+ * The content of the ActionMenu. Must be an ActionMenu.Button and an ActionMenu.Overlay
72
+ */
73
+ children: ReactElement<ActionMenuButtonProps> | ReactElement<ActionMenuOverlayProps> | Array<ReactElement<ActionMenuButtonProps> | ReactElement<ActionMenuOverlayProps>>;
74
+ /**
75
+ * Determines whether the ActionMenu is disabled
76
+ */
77
+ disabled?: boolean | undefined;
78
+ /**
79
+ * Determines whether the ActionMenu is open by default
80
+ */
81
+ open?: boolean | undefined;
82
+ /**
83
+ * Callback that is called when an item is selected.
84
+ * The value of the selected item is passed as an argument.
85
+ */
86
+ onSelect?: ((newValue: string) => void) | undefined;
87
+ /**
88
+ * The selection variant of the ActionMenu.
89
+ * - `single`: Only one item can be selected at a time. Menu items as a menuitemradio.
90
+ * - `none`: No items can be selected. Menu items as a menuitem.
91
+ */
92
+ selectionVariant?: "none" | "single" | undefined;
93
+ /**
94
+ * Test id for the ActionMenu
95
+ */
96
+ 'data-testid'?: string | undefined;
97
+ /**
98
+ * Horizontal alignment of the menu relative to the bottom of the button
99
+ */
100
+ menuAlignment?: "start" | "end" | undefined;
101
+ } & BaseProps<HTMLDivElement>> & {
102
+ readonly type: ({ id, children, "data-testid": testId, disabled, open, selectionVariant, menuAlignment, onSelect }: ActionMenuProps) => JSX.Element;
103
+ } & {
104
+ Button: React.ForwardRefExoticComponent<(Pick<((instance: HTMLButtonElement | null) => void) & {
105
+ children?: React.ReactNode;
106
+ } & {
107
+ id?: string | undefined;
108
+ ref?: React.RefObject<HTMLButtonElement> | undefined;
109
+ className?: string | undefined;
110
+ menuOpen?: boolean | undefined;
111
+ disabled?: boolean | undefined;
112
+ onClick?: ((event: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
113
+ 'data-testid'?: string | undefined;
114
+ }, "children" | "className" | "id" | "onClick" | "disabled" | "data-testid" | "menuOpen"> | Pick<React.RefObject<HTMLButtonElement> & {
115
+ children?: React.ReactNode;
116
+ } & {
117
+ id?: string | undefined;
118
+ ref?: React.RefObject<HTMLButtonElement> | undefined;
119
+ className?: string | undefined;
120
+ menuOpen?: boolean | undefined;
121
+ disabled?: boolean | undefined;
122
+ onClick?: ((event: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
123
+ 'data-testid'?: string | undefined;
124
+ }, "children" | "className" | "id" | "onClick" | "disabled" | "current" | "data-testid" | "menuOpen">) & React.RefAttributes<HTMLButtonElement>>;
125
+ Item: ({ children, className, disabled, handler, selected, type, value, ...props }: ActionMenuItemProps) => JSX.Element;
126
+ Overlay: React.ForwardRefExoticComponent<(Pick<((instance: HTMLUListElement | null) => void) & {
127
+ children?: React.ReactNode;
128
+ } & {
129
+ 'aria-label': string;
130
+ id?: string | undefined;
131
+ ref?: React.RefObject<HTMLUListElement> | undefined;
132
+ className?: string | undefined;
133
+ 'data-testid'?: string | undefined;
134
+ menuOpen?: boolean | undefined;
135
+ style?: React.CSSProperties | undefined;
136
+ }, "children" | "className" | "id" | "style" | "aria-label" | "data-testid" | "menuOpen"> | Pick<React.RefObject<HTMLUListElement> & {
137
+ children?: React.ReactNode;
138
+ } & {
139
+ 'aria-label': string;
140
+ id?: string | undefined;
141
+ ref?: React.RefObject<HTMLUListElement> | undefined;
142
+ className?: string | undefined;
143
+ 'data-testid'?: string | undefined;
144
+ menuOpen?: boolean | undefined;
145
+ style?: React.CSSProperties | undefined;
146
+ }, "children" | "className" | "id" | "style" | "aria-label" | "current" | "data-testid" | "menuOpen">) & React.RefAttributes<HTMLUListElement>>;
147
+ testIds: {
148
+ root: string;
149
+ readonly button: string;
150
+ readonly overlay: string;
151
+ readonly list: string;
152
+ readonly item: string;
153
+ };
154
+ };
155
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ActionMenu';
@@ -14,8 +14,8 @@ export declare type AvatarProps = BaseProps<HTMLImageElement> & {
14
14
  src: string;
15
15
  alt: string;
16
16
  ['data-testid']?: string;
17
- } & React.HTMLAttributes<HTMLImageElement>;
18
- export declare const Avatar: React.ForwardRefExoticComponent<Pick<AvatarProps, "children" | "className" | "id" | "slot" | "style" | "title" | "size" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "alt" | "src" | "data-testid" | "shape"> & React.RefAttributes<HTMLImageElement>> & {
17
+ } & React.ImgHTMLAttributes<HTMLImageElement>;
18
+ export declare const Avatar: React.ForwardRefExoticComponent<Pick<AvatarProps, "children" | "className" | "id" | "slot" | "style" | "title" | "size" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "referrerPolicy" | "alt" | "src" | "data-testid" | "crossOrigin" | "height" | "width" | "shape" | "decoding" | "loading" | "sizes" | "srcSet" | "useMap"> & React.RefAttributes<HTMLImageElement>> & {
19
19
  testIds: {
20
20
  root: string;
21
21
  readonly image: string;
@@ -10,20 +10,22 @@ export declare type CardProps = {
10
10
  /**
11
11
  * Valid children include Card.Image, Card.Heading, and Card.Description
12
12
  */
13
- children: React.ReactNode | React.ReactElement<CardHeadingProps> | React.ReactElement<CardDescriptionProps>;
13
+ children: React.ReactNode | React.ReactElement<CardLabelProps> | React.ReactElement<CardHeadingProps> | React.ReactElement<CardDescriptionProps>;
14
14
  /**
15
15
  * The href of the link
16
16
  * */
17
17
  href: string;
18
18
  /**
19
- * Changes the link label of the card
20
- * * @default 'Learn more'
19
+ * Changes the cta text of the card
21
20
  * */
22
- label?: string;
21
+ ctaText?: string;
23
22
  } & BaseProps<HTMLAnchorElement> & React.ComponentPropsWithoutRef<'a'>;
23
+ declare type CardLabelProps = BaseProps<HTMLSpanElement> & {
24
+ children: React.ReactNode | React.ReactNode[];
25
+ };
24
26
  declare type CardHeadingProps = BaseProps<HTMLHeadingElement> & {
25
27
  children: React.ReactNode | React.ReactNode[];
26
- as?: typeof HeadingTags[number];
28
+ as?: Exclude<HeadingTags['as'], 'h1'>;
27
29
  };
28
30
  declare type CardDescriptionProps = BaseProps<HTMLParagraphElement> & {
29
31
  children: React.ReactNode | React.ReactNode[];
@@ -32,7 +34,8 @@ declare type CardDescriptionProps = BaseProps<HTMLParagraphElement> & {
32
34
  * Card component:
33
35
  * {@link https://primer.style/brand/components/Card/ See usage examples}.
34
36
  */
35
- export declare const Card: React.ForwardRefExoticComponent<Pick<CardProps, "children" | "className" | "id" | "label" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "type" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy" | "key"> & React.RefAttributes<HTMLAnchorElement>> & {
37
+ export declare const Card: React.ForwardRefExoticComponent<Pick<CardProps, "children" | "className" | "id" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "type" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy" | "key" | "ctaText"> & React.RefAttributes<HTMLAnchorElement>> & {
38
+ Label: React.ForwardRefExoticComponent<Pick<CardLabelProps, "children" | "className" | "id"> & React.RefAttributes<HTMLSpanElement>>;
36
39
  Heading: React.ForwardRefExoticComponent<Pick<CardHeadingProps, "children" | "className" | "id" | "as"> & React.RefAttributes<HTMLHeadingElement>>;
37
40
  Description: React.ForwardRefExoticComponent<Pick<CardDescriptionProps, "children" | "className" | "id"> & React.RefAttributes<HTMLParagraphElement>>;
38
41
  };
@@ -52,7 +52,7 @@ declare type SearchProps = {
52
52
  ref: React.RefObject<HTMLInputElement>;
53
53
  active?: boolean;
54
54
  title?: string;
55
- handlerFn?: () => void;
55
+ handlerFn?: (event: MouseEvent | TouchEvent | FocusEvent) => void;
56
56
  autoComplete?: boolean;
57
57
  searchResults?: SubdomainNavBarSearchResultProps[];
58
58
  searchTerm?: string;