@primer/components 0.0.0-20211040541 → 0.0.0-2021104151625

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 (158) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/browser.esm.js +473 -474
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +97 -98
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList2/Description.d.ts +12 -0
  7. package/lib/ActionList2/Description.js +53 -0
  8. package/lib/ActionList2/Divider.d.ts +5 -0
  9. package/lib/ActionList2/Divider.js +35 -0
  10. package/lib/ActionList2/Group.d.ts +11 -0
  11. package/lib/ActionList2/Group.js +57 -0
  12. package/lib/ActionList2/Header.d.ts +26 -0
  13. package/lib/ActionList2/Header.js +55 -0
  14. package/lib/ActionList2/Item.d.ts +67 -0
  15. package/lib/ActionList2/Item.js +221 -0
  16. package/lib/ActionList2/LinkItem.d.ts +17 -0
  17. package/lib/ActionList2/LinkItem.js +57 -0
  18. package/lib/ActionList2/List.d.ts +26 -0
  19. package/lib/ActionList2/List.js +51 -0
  20. package/lib/ActionList2/Selection.d.ts +5 -0
  21. package/lib/ActionList2/Selection.js +70 -0
  22. package/lib/ActionList2/Visuals.d.ts +11 -0
  23. package/lib/ActionList2/Visuals.js +90 -0
  24. package/lib/ActionList2/index.d.ts +40 -0
  25. package/lib/ActionList2/index.js +47 -0
  26. package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +2 -4
  27. package/lib/Autocomplete/Autocomplete.d.ts +28 -30
  28. package/lib/Autocomplete/AutocompleteInput.d.ts +28 -30
  29. package/lib/Button/Button.d.ts +24 -24
  30. package/lib/Button/Button.js +1 -1
  31. package/lib/Button/ButtonClose.d.ts +43 -43
  32. package/lib/Button/ButtonDanger.d.ts +24 -24
  33. package/lib/Button/ButtonInvisible.d.ts +24 -24
  34. package/lib/Button/ButtonOutline.d.ts +24 -24
  35. package/lib/Button/ButtonPrimary.d.ts +24 -24
  36. package/lib/CircleOcticon.d.ts +40 -40
  37. package/lib/Dialog.d.ts +43 -43
  38. package/lib/Dropdown.d.ts +168 -168
  39. package/lib/DropdownMenu/DropdownButton.d.ts +44 -44
  40. package/lib/FilterList.d.ts +40 -40
  41. package/lib/Position.d.ts +4 -4
  42. package/lib/SelectMenu/SelectMenu.d.ts +237 -239
  43. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  44. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  45. package/lib/TextInputWithTokens.d.ts +28 -30
  46. package/lib/Timeline.d.ts +41 -41
  47. package/lib/Token/AvatarToken.d.ts +1 -1
  48. package/lib/Token/IssueLabelToken.d.ts +1 -1
  49. package/lib/Token/Token.d.ts +1 -1
  50. package/lib/experiments.d.ts +1 -0
  51. package/lib/experiments.js +18 -0
  52. package/lib/hooks/useResizeObserver.d.ts +1 -1
  53. package/lib/hooks/useResizeObserver.js +1 -1
  54. package/lib/sx.d.ts +2 -0
  55. package/lib/sx.js +8 -0
  56. package/lib/theme-preval.js +79 -0
  57. package/lib/utils/create-slots.d.ts +17 -0
  58. package/lib/utils/create-slots.js +105 -0
  59. package/lib/utils/testing.d.ts +13 -0
  60. package/lib/utils/use-force-update.d.ts +1 -0
  61. package/lib/utils/use-force-update.js +19 -0
  62. package/lib-esm/ActionList2/Description.d.ts +12 -0
  63. package/lib-esm/ActionList2/Description.js +37 -0
  64. package/lib-esm/ActionList2/Divider.d.ts +5 -0
  65. package/lib-esm/ActionList2/Divider.js +23 -0
  66. package/lib-esm/ActionList2/Group.d.ts +11 -0
  67. package/lib-esm/ActionList2/Group.js +40 -0
  68. package/lib-esm/ActionList2/Header.d.ts +26 -0
  69. package/lib-esm/ActionList2/Header.js +44 -0
  70. package/lib-esm/ActionList2/Item.d.ts +67 -0
  71. package/lib-esm/ActionList2/Item.js +195 -0
  72. package/lib-esm/ActionList2/LinkItem.d.ts +17 -0
  73. package/lib-esm/ActionList2/LinkItem.js +43 -0
  74. package/lib-esm/ActionList2/List.d.ts +26 -0
  75. package/lib-esm/ActionList2/List.js +34 -0
  76. package/lib-esm/ActionList2/Selection.d.ts +5 -0
  77. package/lib-esm/ActionList2/Selection.js +52 -0
  78. package/lib-esm/ActionList2/Visuals.d.ts +11 -0
  79. package/lib-esm/ActionList2/Visuals.js +68 -0
  80. package/lib-esm/ActionList2/index.d.ts +40 -0
  81. package/lib-esm/ActionList2/index.js +33 -0
  82. package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +2 -4
  83. package/lib-esm/Autocomplete/Autocomplete.d.ts +28 -30
  84. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +28 -30
  85. package/lib-esm/Button/Button.d.ts +24 -24
  86. package/lib-esm/Button/Button.js +1 -1
  87. package/lib-esm/Button/ButtonClose.d.ts +43 -43
  88. package/lib-esm/Button/ButtonDanger.d.ts +24 -24
  89. package/lib-esm/Button/ButtonInvisible.d.ts +24 -24
  90. package/lib-esm/Button/ButtonOutline.d.ts +24 -24
  91. package/lib-esm/Button/ButtonPrimary.d.ts +24 -24
  92. package/lib-esm/CircleOcticon.d.ts +40 -40
  93. package/lib-esm/Dialog.d.ts +43 -43
  94. package/lib-esm/Dropdown.d.ts +168 -168
  95. package/lib-esm/DropdownMenu/DropdownButton.d.ts +44 -44
  96. package/lib-esm/FilterList.d.ts +40 -40
  97. package/lib-esm/Position.d.ts +4 -4
  98. package/lib-esm/SelectMenu/SelectMenu.d.ts +237 -239
  99. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  100. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  101. package/lib-esm/TextInputWithTokens.d.ts +28 -30
  102. package/lib-esm/Timeline.d.ts +41 -41
  103. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  104. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  105. package/lib-esm/Token/Token.d.ts +1 -1
  106. package/lib-esm/experiments.d.ts +1 -0
  107. package/lib-esm/experiments.js +2 -0
  108. package/lib-esm/hooks/useResizeObserver.d.ts +1 -1
  109. package/lib-esm/hooks/useResizeObserver.js +1 -1
  110. package/lib-esm/sx.d.ts +2 -0
  111. package/lib-esm/sx.js +3 -1
  112. package/lib-esm/theme-preval.js +79 -0
  113. package/lib-esm/utils/create-slots.d.ts +17 -0
  114. package/lib-esm/utils/create-slots.js +84 -0
  115. package/lib-esm/utils/testing.d.ts +13 -0
  116. package/lib-esm/utils/use-force-update.d.ts +1 -0
  117. package/lib-esm/utils/use-force-update.js +6 -0
  118. package/package.json +10 -9
  119. package/lib/DatePicker/DatePicker.d.ts +0 -52
  120. package/lib/DatePicker/DatePicker.js +0 -109
  121. package/lib/DatePicker/DatePickerAnchor.d.ts +0 -5
  122. package/lib/DatePicker/DatePickerAnchor.js +0 -202
  123. package/lib/DatePicker/DatePickerOverlay.d.ts +0 -3
  124. package/lib/DatePicker/DatePickerOverlay.js +0 -55
  125. package/lib/DatePicker/DatePickerPanel.d.ts +0 -2
  126. package/lib/DatePicker/DatePickerPanel.js +0 -363
  127. package/lib/DatePicker/Day.d.ts +0 -15
  128. package/lib/DatePicker/Day.js +0 -206
  129. package/lib/DatePicker/Month.d.ts +0 -8
  130. package/lib/DatePicker/Month.js +0 -122
  131. package/lib/DatePicker/dateParser.d.ts +0 -12
  132. package/lib/DatePicker/dateParser.js +0 -192
  133. package/lib/DatePicker/index.d.ts +0 -2
  134. package/lib/DatePicker/index.js +0 -13
  135. package/lib/DatePicker/useDatePicker.d.ts +0 -107
  136. package/lib/DatePicker/useDatePicker.js +0 -558
  137. package/lib/hooks/useDebounce.d.ts +0 -2
  138. package/lib/hooks/useDebounce.js +0 -24
  139. package/lib-esm/DatePicker/DatePicker.d.ts +0 -52
  140. package/lib-esm/DatePicker/DatePicker.js +0 -92
  141. package/lib-esm/DatePicker/DatePickerAnchor.d.ts +0 -5
  142. package/lib-esm/DatePicker/DatePickerAnchor.js +0 -174
  143. package/lib-esm/DatePicker/DatePickerOverlay.d.ts +0 -3
  144. package/lib-esm/DatePicker/DatePickerOverlay.js +0 -40
  145. package/lib-esm/DatePicker/DatePickerPanel.d.ts +0 -2
  146. package/lib-esm/DatePicker/DatePickerPanel.js +0 -332
  147. package/lib-esm/DatePicker/Day.d.ts +0 -15
  148. package/lib-esm/DatePicker/Day.js +0 -182
  149. package/lib-esm/DatePicker/Month.d.ts +0 -8
  150. package/lib-esm/DatePicker/Month.js +0 -98
  151. package/lib-esm/DatePicker/dateParser.d.ts +0 -12
  152. package/lib-esm/DatePicker/dateParser.js +0 -178
  153. package/lib-esm/DatePicker/index.d.ts +0 -2
  154. package/lib-esm/DatePicker/index.js +0 -1
  155. package/lib-esm/DatePicker/useDatePicker.d.ts +0 -107
  156. package/lib-esm/DatePicker/useDatePicker.js +0 -523
  157. package/lib-esm/hooks/useDebounce.d.ts +0 -2
  158. package/lib-esm/hooks/useDebounce.js +0 -16
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.List = exports.ListContext = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Box = _interopRequireDefault(require("../Box"));
11
+
12
+ var _sx = require("../sx");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
18
+ const ListContext = /*#__PURE__*/_react.default.createContext({});
19
+
20
+ exports.ListContext = ListContext;
21
+
22
+ const List = /*#__PURE__*/_react.default.forwardRef(({
23
+ variant = 'inset',
24
+ selectionVariant,
25
+ showDividers = false,
26
+ sx = {},
27
+ ...props
28
+ }, forwardedRef) => {
29
+ const styles = {
30
+ margin: 0,
31
+ paddingInlineStart: 0,
32
+ // reset ul styles
33
+ paddingY: variant === 'inset' ? 2 : 0
34
+ };
35
+ return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
36
+ as: "ul",
37
+ sx: (0, _sx.merge)(styles, sx),
38
+ "aria-multiselectable": selectionVariant === 'multiple' ? true : undefined
39
+ }, props, {
40
+ ref: forwardedRef
41
+ }), /*#__PURE__*/_react.default.createElement(ListContext.Provider, {
42
+ value: {
43
+ variant,
44
+ selectionVariant,
45
+ showDividers
46
+ }
47
+ }, props.children));
48
+ });
49
+
50
+ exports.List = List;
51
+ List.displayName = 'ActionList';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ItemProps } from './Item';
3
+ declare type SelectionProps = Pick<ItemProps, 'selected' | 'disabled'>;
4
+ export declare const Selection: React.FC<SelectionProps>;
5
+ export {};
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Selection = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _octiconsReact = require("@primer/octicons-react");
11
+
12
+ var _List = require("./List");
13
+
14
+ var _Group = require("./Group");
15
+
16
+ var _Visuals = require("./Visuals");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const Selection = ({
21
+ selected,
22
+ disabled
23
+ }) => {
24
+ const {
25
+ selectionVariant: listSelectionVariant
26
+ } = _react.default.useContext(_List.ListContext);
27
+
28
+ const {
29
+ selectionVariant: groupSelectionVariant
30
+ } = _react.default.useContext(_Group.GroupContext);
31
+ /** selectionVariant in Group can override the selectionVariant in List root */
32
+
33
+
34
+ const selectionVariant = typeof groupSelectionVariant !== 'undefined' ? groupSelectionVariant : listSelectionVariant; // if selectionVariant is not set on List, don't show selection
35
+
36
+ if (!selectionVariant) {
37
+ // to avoid confusion, fail loudly instead of silently ignoring
38
+ if (selected) throw new Error('For Item to be selected, ActionList or ActionList.Group needs to have a selectionVariant defined');
39
+ return null;
40
+ }
41
+
42
+ if (selectionVariant === 'single') {
43
+ return /*#__PURE__*/_react.default.createElement(_Visuals.LeadingVisualContainer, null, selected && /*#__PURE__*/_react.default.createElement(_octiconsReact.CheckIcon, null));
44
+ }
45
+ /**
46
+ * selectionVariant is multiple
47
+ * readOnly is required because we are doing a one-way bind to `checked`
48
+ * aria-readonly="false" tells screen that they can still interact with the checkbox
49
+ */
50
+
51
+
52
+ return /*#__PURE__*/_react.default.createElement(_Visuals.LeadingVisualContainer, {
53
+ sx: {
54
+ input: {
55
+ margin: 0,
56
+ pointerEvents: 'none'
57
+ }
58
+ }
59
+ }, /*#__PURE__*/_react.default.createElement("input", {
60
+ type: "checkbox",
61
+ checked: selected,
62
+ disabled: disabled,
63
+ tabIndex: -1,
64
+ readOnly: true,
65
+ "aria-readonly": "false"
66
+ }));
67
+ };
68
+
69
+ exports.Selection = Selection;
70
+ Selection.displayName = "Selection";
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { SxProp } from '../sx';
3
+ declare type VisualProps = SxProp & {
4
+ children: React.ReactNode;
5
+ };
6
+ export declare const LeadingVisualContainer: React.FC<SxProp>;
7
+ export declare type LeadingVisualProps = VisualProps;
8
+ export declare const LeadingVisual: React.FC<VisualProps>;
9
+ export declare type TrailingVisualProps = VisualProps;
10
+ export declare const TrailingVisual: React.FC<VisualProps>;
11
+ export {};
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TrailingVisual = exports.LeadingVisual = exports.LeadingVisualContainer = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Box = _interopRequireDefault(require("../Box"));
11
+
12
+ var _sx = require("../sx");
13
+
14
+ var _constants = require("../constants");
15
+
16
+ var _Item = require("./Item");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
+
22
+ const LeadingVisualContainer = ({
23
+ sx = {},
24
+ ...props
25
+ }) => {
26
+ return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
27
+ as: "span",
28
+ sx: (0, _sx.merge)({
29
+ height: _Item.TEXT_ROW_HEIGHT,
30
+ // match height of text row
31
+ minWidth: (0, _constants.get)('space.3'),
32
+ maxWidth: _Item.TEXT_ROW_HEIGHT,
33
+ // square (same as height)
34
+ display: 'flex',
35
+ justifyContent: 'center',
36
+ alignItems: 'center',
37
+ flexShrink: 0,
38
+ marginRight: 2
39
+ }, sx)
40
+ }, props));
41
+ };
42
+
43
+ exports.LeadingVisualContainer = LeadingVisualContainer;
44
+ LeadingVisualContainer.displayName = "LeadingVisualContainer";
45
+
46
+ const LeadingVisual = ({
47
+ sx = {},
48
+ ...props
49
+ }) => {
50
+ return /*#__PURE__*/_react.default.createElement(_Item.Slot, {
51
+ name: "LeadingVisual"
52
+ }, ({
53
+ variant,
54
+ disabled
55
+ }) => /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, _extends({
56
+ sx: (0, _sx.merge)({
57
+ color: (0, _Item.getVariantStyles)(variant, disabled).iconColor,
58
+ svg: {
59
+ fontSize: 0
60
+ }
61
+ }, sx)
62
+ }, props), props.children));
63
+ };
64
+
65
+ exports.LeadingVisual = LeadingVisual;
66
+ LeadingVisual.displayName = "LeadingVisual";
67
+
68
+ const TrailingVisual = ({
69
+ sx = {},
70
+ ...props
71
+ }) => {
72
+ return /*#__PURE__*/_react.default.createElement(_Item.Slot, {
73
+ name: "TrailingVisual"
74
+ }, ({
75
+ variant,
76
+ disabled
77
+ }) => /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
78
+ as: "span",
79
+ sx: (0, _sx.merge)({
80
+ height: '20px',
81
+ // match height of text row
82
+ flexShrink: 0,
83
+ color: (0, _Item.getVariantStyles)(variant, disabled).annotationColor,
84
+ marginLeft: 2
85
+ }, sx)
86
+ }, props), props.children));
87
+ };
88
+
89
+ exports.TrailingVisual = TrailingVisual;
90
+ TrailingVisual.displayName = "TrailingVisual";
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import { Divider } from './Divider';
3
+ export type { ListProps as ActionListProps } from './List';
4
+ export type { GroupProps } from './Group';
5
+ export type { ItemProps } from './Item';
6
+ export type { DescriptionProps } from './Description';
7
+ export type { LeadingVisualProps, TrailingVisualProps } from './Visuals';
8
+ /**
9
+ * Collection of list-related components.
10
+ */
11
+ export declare const ActionList: import("@radix-ui/react-polymorphic").ForwardRefComponent<"ul", import("./List").ListProps> & {
12
+ /** Collects related `Items` in an `ActionList`. */
13
+ Group: import("react").FC<import("./Group").GroupProps>;
14
+ /** An actionable or selectable `Item` */
15
+ Item: import("@radix-ui/react-polymorphic").ForwardRefComponent<"li", import("./Item").ItemProps>;
16
+ /** A `Item` that renders a full-size anchor inside ListItem */
17
+ LinkItem: import("@radix-ui/react-polymorphic").ForwardRefComponent<"a", Pick<import("./Item").ItemProps, "children" | "sx"> & {
18
+ download?: string | undefined;
19
+ href?: string | undefined;
20
+ hrefLang?: string | undefined;
21
+ media?: string | undefined;
22
+ ping?: string | undefined;
23
+ rel?: string | undefined;
24
+ target?: string | undefined;
25
+ type?: string | undefined;
26
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
27
+ }>;
28
+ /** Visually separates `Item`s or `Group`s in an `ActionList`. */
29
+ Divider: typeof Divider;
30
+ /** Secondary text which provides additional information about an `Item`. */
31
+ Description: import("react").FC<import("./Description").DescriptionProps>;
32
+ /** Icon (or similar) positioned before `Item` text. */
33
+ LeadingVisual: import("react").FC<import("../sx").SxProp & {
34
+ children: import("react").ReactNode;
35
+ }>;
36
+ /** Icon (or similar) positioned after `Item` text. */
37
+ TrailingVisual: import("react").FC<import("../sx").SxProp & {
38
+ children: import("react").ReactNode;
39
+ }>;
40
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ActionList = void 0;
7
+
8
+ var _List = require("./List");
9
+
10
+ var _Group = require("./Group");
11
+
12
+ var _Item = require("./Item");
13
+
14
+ var _LinkItem = require("./LinkItem");
15
+
16
+ var _Divider = require("./Divider");
17
+
18
+ var _Description = require("./Description");
19
+
20
+ var _Visuals = require("./Visuals");
21
+
22
+ /**
23
+ * Collection of list-related components.
24
+ */
25
+ const ActionList = Object.assign(_List.List, {
26
+ /** Collects related `Items` in an `ActionList`. */
27
+ Group: _Group.Group,
28
+
29
+ /** An actionable or selectable `Item` */
30
+ Item: _Item.Item,
31
+
32
+ /** A `Item` that renders a full-size anchor inside ListItem */
33
+ LinkItem: _LinkItem.LinkItem,
34
+
35
+ /** Visually separates `Item`s or `Group`s in an `ActionList`. */
36
+ Divider: _Divider.Divider,
37
+
38
+ /** Secondary text which provides additional information about an `Item`. */
39
+ Description: _Description.Description,
40
+
41
+ /** Icon (or similar) positioned before `Item` text. */
42
+ LeadingVisual: _Visuals.LeadingVisual,
43
+
44
+ /** Icon (or similar) positioned after `Item` text. */
45
+ TrailingVisual: _Visuals.TrailingVisual
46
+ });
47
+ exports.ActionList = ActionList;
@@ -26,8 +26,6 @@ interface AnchoredOverlayPropsWithoutAnchor {
26
26
  */
27
27
  anchorRef: React.RefObject<HTMLElement>;
28
28
  }
29
- export declare type OverlayOpenGesture = 'anchor-click' | 'anchor-key-press';
30
- export declare type OverlayCloseGesture = 'anchor-click' | 'click-outside' | 'escape';
31
29
  export declare type AnchoredOverlayWrapperAnchorProps = Partial<AnchoredOverlayPropsWithAnchor> | AnchoredOverlayPropsWithoutAnchor;
32
30
  interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width'> {
33
31
  /**
@@ -37,11 +35,11 @@ interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width'
37
35
  /**
38
36
  * A callback which is called whenever the overlay is currently closed and an "open gesture" is detected.
39
37
  */
40
- onOpen?: (gesture: OverlayOpenGesture) => unknown;
38
+ onOpen?: (gesture: 'anchor-click' | 'anchor-key-press') => unknown;
41
39
  /**
42
40
  * A callback which is called whenever the overlay is currently open and a "close gesture" is detected.
43
41
  */
44
- onClose?: (gesture: OverlayCloseGesture) => unknown;
42
+ onClose?: (gesture: 'anchor-click' | 'click-outside' | 'escape') => unknown;
45
43
  /**
46
44
  * Props to be spread on the internal `Overlay` component.
47
45
  */
@@ -12,17 +12,15 @@ export type { AutocompleteOverlayProps } from './AutocompleteOverlay';
12
12
  declare const _default: React.FC<{
13
13
  id?: string | undefined;
14
14
  }> & {
15
- Input: import("@radix-ui/react-polymorphic").ForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<({
15
+ Input: import("@radix-ui/react-polymorphic").ForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<{
16
16
  [x: string]: any;
17
17
  [x: number]: any;
18
18
  } & {
19
19
  theme?: any;
20
- } & ({} | {
21
- children?: React.ReactNode;
22
- })) & {
20
+ } & {
23
21
  as?: string | React.ComponentType<any> | undefined;
24
22
  forwardedAs?: string | React.ComponentType<any> | undefined;
25
- }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
23
+ }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "className" | "sx" | "variant" | "disabled" | "contrast"> & {
26
24
  className?: string | undefined;
27
25
  icon?: React.ComponentType<{
28
26
  className?: string | undefined;
@@ -39,6 +37,7 @@ declare const _default: React.FC<{
39
37
  slot?: string | undefined;
40
38
  style?: React.CSSProperties | undefined;
41
39
  title?: string | undefined;
40
+ block?: boolean | undefined;
42
41
  key?: React.Key | null | undefined;
43
42
  defaultChecked?: boolean | undefined;
44
43
  defaultValue?: string | number | readonly string[] | undefined;
@@ -46,14 +45,14 @@ declare const _default: React.FC<{
46
45
  suppressHydrationWarning?: boolean | undefined;
47
46
  accessKey?: string | undefined;
48
47
  className?: string | undefined;
49
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
48
+ contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
50
49
  contextMenu?: string | undefined;
51
50
  dir?: string | undefined;
52
- draggable?: (boolean | "true" | "false") | undefined;
51
+ draggable?: (boolean | "false" | "true") | undefined;
53
52
  id?: string | undefined;
54
53
  lang?: string | undefined;
55
54
  placeholder?: string | undefined;
56
- spellCheck?: (boolean | "true" | "false") | undefined;
55
+ spellCheck?: (boolean | "false" | "true") | undefined;
57
56
  tabIndex?: number | undefined;
58
57
  radioGroup?: string | undefined;
59
58
  role?: React.AriaRole | undefined;
@@ -79,47 +78,47 @@ declare const _default: React.FC<{
79
78
  inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
80
79
  is?: string | undefined;
81
80
  'aria-activedescendant'?: string | undefined;
82
- 'aria-atomic'?: boolean | "true" | "false" | undefined;
83
- 'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
84
- 'aria-busy'?: boolean | "true" | "false" | undefined;
85
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
81
+ 'aria-atomic'?: boolean | "false" | "true" | undefined;
82
+ 'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
83
+ 'aria-busy'?: boolean | "false" | "true" | undefined;
84
+ 'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
86
85
  'aria-colcount'?: number | undefined;
87
86
  'aria-colindex'?: number | undefined;
88
87
  'aria-colspan'?: number | undefined;
89
88
  'aria-controls'?: string | undefined;
90
- 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
89
+ 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
91
90
  'aria-describedby'?: string | undefined;
92
91
  'aria-details'?: string | undefined;
93
- 'aria-disabled'?: boolean | "true" | "false" | undefined;
94
- 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
92
+ 'aria-disabled'?: boolean | "false" | "true" | undefined;
93
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
95
94
  'aria-errormessage'?: string | undefined;
96
- 'aria-expanded'?: boolean | "true" | "false" | undefined;
95
+ 'aria-expanded'?: boolean | "false" | "true" | undefined;
97
96
  'aria-flowto'?: string | undefined;
98
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
99
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
100
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
101
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
97
+ 'aria-grabbed'?: boolean | "false" | "true" | undefined;
98
+ 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree" | undefined;
99
+ 'aria-hidden'?: boolean | "false" | "true" | undefined;
100
+ 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
102
101
  'aria-keyshortcuts'?: string | undefined;
103
102
  'aria-label'?: string | undefined;
104
103
  'aria-labelledby'?: string | undefined;
105
104
  'aria-level'?: number | undefined;
106
105
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
107
- 'aria-modal'?: boolean | "true" | "false" | undefined;
108
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
109
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
106
+ 'aria-modal'?: boolean | "false" | "true" | undefined;
107
+ 'aria-multiline'?: boolean | "false" | "true" | undefined;
108
+ 'aria-multiselectable'?: boolean | "false" | "true" | undefined;
110
109
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
111
110
  'aria-owns'?: string | undefined;
112
111
  'aria-placeholder'?: string | undefined;
113
112
  'aria-posinset'?: number | undefined;
114
- 'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
115
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
113
+ 'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
114
+ 'aria-readonly'?: boolean | "false" | "true" | undefined;
116
115
  'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
117
- 'aria-required'?: boolean | "true" | "false" | undefined;
116
+ 'aria-required'?: boolean | "false" | "true" | undefined;
118
117
  'aria-roledescription'?: string | undefined;
119
118
  'aria-rowcount'?: number | undefined;
120
119
  'aria-rowindex'?: number | undefined;
121
120
  'aria-rowspan'?: number | undefined;
122
- 'aria-selected'?: boolean | "true" | "false" | undefined;
121
+ 'aria-selected'?: boolean | "false" | "true" | undefined;
123
122
  'aria-setsize'?: number | undefined;
124
123
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
125
124
  'aria-valuemax'?: number | undefined;
@@ -289,15 +288,14 @@ declare const _default: React.FC<{
289
288
  onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
290
289
  onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
291
290
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
292
- block?: boolean | undefined;
293
291
  sx?: import("../sx").BetterSystemStyleObject | undefined;
294
- disabled?: boolean | undefined;
295
292
  variant?: "small" | "large" | undefined;
293
+ disabled?: boolean | undefined;
296
294
  hasIcon?: boolean | undefined;
297
295
  contrast?: boolean | undefined;
298
296
  } & {
299
297
  theme?: any;
300
- }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, {
298
+ }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "variant" | "disabled" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, {
301
299
  as?: React.ComponentType<any> | undefined;
302
300
  }>;
303
301
  Menu: typeof AutocompleteMenu;
@@ -4,17 +4,15 @@ import { ComponentProps } from '../utils/types';
4
4
  declare type InternalAutocompleteInputProps = {
5
5
  as?: React.ComponentType<any>;
6
6
  };
7
- declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<({
7
+ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<{
8
8
  [x: string]: any;
9
9
  [x: number]: any;
10
10
  } & {
11
11
  theme?: any;
12
- } & ({} | {
13
- children?: React.ReactNode;
14
- })) & {
12
+ } & {
15
13
  as?: string | React.ComponentType<any> | undefined;
16
14
  forwardedAs?: string | React.ComponentType<any> | undefined;
17
- }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
15
+ }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "className" | "sx" | "variant" | "disabled" | "contrast"> & {
18
16
  className?: string | undefined;
19
17
  icon?: React.ComponentType<{
20
18
  className?: string | undefined;
@@ -31,6 +29,7 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
31
29
  slot?: string | undefined;
32
30
  style?: React.CSSProperties | undefined;
33
31
  title?: string | undefined;
32
+ block?: boolean | undefined;
34
33
  key?: React.Key | null | undefined;
35
34
  defaultChecked?: boolean | undefined;
36
35
  defaultValue?: string | number | readonly string[] | undefined;
@@ -38,14 +37,14 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
38
37
  suppressHydrationWarning?: boolean | undefined;
39
38
  accessKey?: string | undefined;
40
39
  className?: string | undefined;
41
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
40
+ contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
42
41
  contextMenu?: string | undefined;
43
42
  dir?: string | undefined;
44
- draggable?: (boolean | "true" | "false") | undefined;
43
+ draggable?: (boolean | "false" | "true") | undefined;
45
44
  id?: string | undefined;
46
45
  lang?: string | undefined;
47
46
  placeholder?: string | undefined;
48
- spellCheck?: (boolean | "true" | "false") | undefined;
47
+ spellCheck?: (boolean | "false" | "true") | undefined;
49
48
  tabIndex?: number | undefined;
50
49
  radioGroup?: string | undefined;
51
50
  role?: React.AriaRole | undefined;
@@ -71,47 +70,47 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
71
70
  inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
72
71
  is?: string | undefined;
73
72
  'aria-activedescendant'?: string | undefined;
74
- 'aria-atomic'?: boolean | "true" | "false" | undefined;
75
- 'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
76
- 'aria-busy'?: boolean | "true" | "false" | undefined;
77
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
73
+ 'aria-atomic'?: boolean | "false" | "true" | undefined;
74
+ 'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
75
+ 'aria-busy'?: boolean | "false" | "true" | undefined;
76
+ 'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
78
77
  'aria-colcount'?: number | undefined;
79
78
  'aria-colindex'?: number | undefined;
80
79
  'aria-colspan'?: number | undefined;
81
80
  'aria-controls'?: string | undefined;
82
- 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
81
+ 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
83
82
  'aria-describedby'?: string | undefined;
84
83
  'aria-details'?: string | undefined;
85
- 'aria-disabled'?: boolean | "true" | "false" | undefined;
86
- 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
84
+ 'aria-disabled'?: boolean | "false" | "true" | undefined;
85
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
87
86
  'aria-errormessage'?: string | undefined;
88
- 'aria-expanded'?: boolean | "true" | "false" | undefined;
87
+ 'aria-expanded'?: boolean | "false" | "true" | undefined;
89
88
  'aria-flowto'?: string | undefined;
90
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
91
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
92
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
93
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
89
+ 'aria-grabbed'?: boolean | "false" | "true" | undefined;
90
+ 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree" | undefined;
91
+ 'aria-hidden'?: boolean | "false" | "true" | undefined;
92
+ 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
94
93
  'aria-keyshortcuts'?: string | undefined;
95
94
  'aria-label'?: string | undefined;
96
95
  'aria-labelledby'?: string | undefined;
97
96
  'aria-level'?: number | undefined;
98
97
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
99
- 'aria-modal'?: boolean | "true" | "false" | undefined;
100
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
101
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
98
+ 'aria-modal'?: boolean | "false" | "true" | undefined;
99
+ 'aria-multiline'?: boolean | "false" | "true" | undefined;
100
+ 'aria-multiselectable'?: boolean | "false" | "true" | undefined;
102
101
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
103
102
  'aria-owns'?: string | undefined;
104
103
  'aria-placeholder'?: string | undefined;
105
104
  'aria-posinset'?: number | undefined;
106
- 'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
107
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
105
+ 'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
106
+ 'aria-readonly'?: boolean | "false" | "true" | undefined;
108
107
  'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
109
- 'aria-required'?: boolean | "true" | "false" | undefined;
108
+ 'aria-required'?: boolean | "false" | "true" | undefined;
110
109
  'aria-roledescription'?: string | undefined;
111
110
  'aria-rowcount'?: number | undefined;
112
111
  'aria-rowindex'?: number | undefined;
113
112
  'aria-rowspan'?: number | undefined;
114
- 'aria-selected'?: boolean | "true" | "false" | undefined;
113
+ 'aria-selected'?: boolean | "false" | "true" | undefined;
115
114
  'aria-setsize'?: number | undefined;
116
115
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
117
116
  'aria-valuemax'?: number | undefined;
@@ -281,14 +280,13 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
281
280
  onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
282
281
  onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
283
282
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
284
- block?: boolean | undefined;
285
283
  sx?: import("../sx").BetterSystemStyleObject | undefined;
286
- disabled?: boolean | undefined;
287
284
  variant?: "small" | "large" | undefined;
285
+ disabled?: boolean | undefined;
288
286
  hasIcon?: boolean | undefined;
289
287
  contrast?: boolean | undefined;
290
288
  } & {
291
289
  theme?: any;
292
- }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, InternalAutocompleteInputProps>;
290
+ }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "variant" | "disabled" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, InternalAutocompleteInputProps>;
293
291
  export declare type AutocompleteInputProps = ComponentProps<typeof AutocompleteInput>;
294
292
  export default AutocompleteInput;