@primer/components 0.0.0-202191252016 → 0.0.0-2021913173522
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 +5 -1
- package/dist/browser.esm.js +851 -747
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +484 -380
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/List.d.ts +2 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +2 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib/Autocomplete/Autocomplete.d.ts +304 -0
- package/lib/Autocomplete/Autocomplete.js +145 -0
- package/lib/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib/Autocomplete/AutocompleteContext.js +11 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +292 -0
- package/lib/Autocomplete/AutocompleteInput.js +157 -0
- package/lib/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib/Autocomplete/AutocompleteMenu.js +224 -0
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib/Autocomplete/AutocompleteOverlay.js +80 -0
- package/lib/Autocomplete/index.d.ts +2 -0
- package/lib/Autocomplete/index.js +15 -0
- package/lib/FilteredActionList/FilteredActionList.js +5 -31
- package/lib/Overlay.d.ts +1 -0
- package/lib/Overlay.js +3 -1
- package/lib/SelectMenu/SelectMenu.d.ts +10 -10
- package/lib/TextInput.d.ts +5 -13
- package/lib/TextInput.js +4 -46
- package/lib/TextInputWithTokens.d.ts +323 -0
- package/lib/TextInputWithTokens.js +244 -0
- package/lib/Token/AvatarToken.d.ts +7 -0
- package/lib/Token/AvatarToken.js +64 -0
- package/lib/Token/IssueLabelToken.d.ts +14 -0
- package/lib/Token/IssueLabelToken.js +144 -0
- package/lib/Token/Token.d.ts +15 -0
- package/lib/Token/Token.js +94 -0
- package/lib/Token/TokenBase.d.ts +31 -0
- package/lib/Token/TokenBase.js +108 -0
- package/lib/Token/_RemoveTokenButton.d.ts +12 -0
- package/lib/Token/_RemoveTokenButton.js +77 -0
- package/lib/Token/_TokenTextContainer.d.ts +3 -0
- package/lib/Token/_TokenTextContainer.js +17 -0
- package/lib/Token/index.d.ts +3 -0
- package/lib/Token/index.js +31 -0
- package/lib/_TextInputWrapper.d.ts +10 -0
- package/lib/_TextInputWrapper.js +51 -0
- package/lib/_UnstyledTextInput.d.ts +2 -0
- package/lib/_UnstyledTextInput.js +20 -0
- package/lib/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib/behaviors/scrollIntoViewingArea.js +39 -0
- package/lib/hooks/useOpenAndCloseFocus.d.ts +2 -1
- package/lib/hooks/useOpenAndCloseFocus.js +7 -2
- package/lib/hooks/useOverlay.d.ts +2 -1
- package/lib/hooks/useOverlay.js +4 -2
- package/lib/index.d.ts +5 -0
- package/lib/index.js +36 -0
- package/lib/utils/{types.d.ts → types/AriaRole.d.ts} +0 -13
- package/lib/{DatePicker/DatePickerPanel.js → utils/types/AriaRole.js} +0 -0
- package/lib/utils/types/ComponentProps.d.ts +9 -0
- package/lib/utils/{types.js → types/ComponentProps.js} +0 -0
- package/lib/utils/types/Flatten.d.ts +4 -0
- package/lib/utils/types/Flatten.js +1 -0
- package/lib/utils/types/MandateProps.d.ts +3 -0
- package/lib/utils/types/MandateProps.js +1 -0
- package/lib/utils/types/Merge.d.ts +19 -0
- package/lib/utils/types/Merge.js +1 -0
- package/lib/utils/types/index.d.ts +5 -0
- package/lib/utils/types/index.js +70 -0
- package/lib-esm/ActionList/List.d.ts +2 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +2 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib-esm/Autocomplete/Autocomplete.d.ts +304 -0
- package/lib-esm/Autocomplete/Autocomplete.js +123 -0
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib-esm/Autocomplete/AutocompleteContext.js +2 -0
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +292 -0
- package/lib-esm/Autocomplete/AutocompleteInput.js +138 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +205 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +62 -0
- package/lib-esm/Autocomplete/index.d.ts +2 -0
- package/lib-esm/Autocomplete/index.js +1 -0
- package/lib-esm/FilteredActionList/FilteredActionList.js +3 -31
- package/lib-esm/Overlay.d.ts +1 -0
- package/lib-esm/Overlay.js +3 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +10 -10
- package/lib-esm/TextInput.d.ts +5 -13
- package/lib-esm/TextInput.js +4 -37
- package/lib-esm/TextInputWithTokens.d.ts +323 -0
- package/lib-esm/TextInputWithTokens.js +219 -0
- package/lib-esm/Token/AvatarToken.d.ts +7 -0
- package/lib-esm/Token/AvatarToken.js +43 -0
- package/lib-esm/Token/IssueLabelToken.d.ts +14 -0
- package/lib-esm/Token/IssueLabelToken.js +124 -0
- package/lib-esm/Token/Token.d.ts +15 -0
- package/lib-esm/Token/Token.js +73 -0
- package/lib-esm/Token/TokenBase.d.ts +31 -0
- package/lib-esm/Token/TokenBase.js +87 -0
- package/lib-esm/Token/_RemoveTokenButton.d.ts +12 -0
- package/lib-esm/Token/_RemoveTokenButton.js +60 -0
- package/lib-esm/Token/_TokenTextContainer.d.ts +3 -0
- package/lib-esm/Token/_TokenTextContainer.js +6 -0
- package/lib-esm/Token/index.d.ts +3 -0
- package/lib-esm/Token/index.js +3 -0
- package/lib-esm/_TextInputWrapper.d.ts +10 -0
- package/lib-esm/_TextInputWrapper.js +31 -0
- package/lib-esm/_UnstyledTextInput.d.ts +2 -0
- package/lib-esm/_UnstyledTextInput.js +7 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.js +30 -0
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +2 -1
- package/lib-esm/hooks/useOpenAndCloseFocus.js +7 -2
- package/lib-esm/hooks/useOverlay.d.ts +2 -1
- package/lib-esm/hooks/useOverlay.js +4 -2
- package/lib-esm/index.d.ts +5 -0
- package/lib-esm/index.js +3 -0
- package/lib-esm/utils/{types.d.ts → types/AriaRole.d.ts} +0 -13
- package/lib-esm/utils/{types.js → types/AriaRole.js} +0 -0
- package/lib-esm/utils/types/ComponentProps.d.ts +9 -0
- package/lib-esm/utils/types/ComponentProps.js +1 -0
- package/lib-esm/utils/types/Flatten.d.ts +4 -0
- package/lib-esm/utils/types/Flatten.js +1 -0
- package/lib-esm/utils/types/MandateProps.d.ts +3 -0
- package/lib-esm/utils/types/MandateProps.js +1 -0
- package/lib-esm/utils/types/Merge.d.ts +19 -0
- package/lib-esm/utils/types/Merge.js +1 -0
- package/lib-esm/utils/types/index.d.ts +5 -0
- package/lib-esm/utils/types/index.js +5 -0
- package/package.json +2 -2
- package/lib/DatePicker/DatePicker.d.ts +0 -44
- package/lib/DatePicker/DatePicker.js +0 -72
- package/lib/DatePicker/DatePickerAnchor.d.ts +0 -10
- package/lib/DatePicker/DatePickerAnchor.js +0 -83
- package/lib/DatePicker/DatePickerPanel.d.ts +0 -0
- package/lib/DatePicker/Day.d.ts +0 -13
- package/lib/DatePicker/Day.js +0 -126
- package/lib/DatePicker/Month.d.ts +0 -9
- package/lib/DatePicker/Month.js +0 -97
- package/lib/DatePicker/index.d.ts +0 -2
- package/lib/DatePicker/index.js +0 -13
- package/lib-esm/DatePicker/DatePicker.d.ts +0 -44
- package/lib-esm/DatePicker/DatePicker.js +0 -55
- package/lib-esm/DatePicker/DatePickerAnchor.d.ts +0 -10
- package/lib-esm/DatePicker/DatePickerAnchor.js +0 -59
- package/lib-esm/DatePicker/DatePickerPanel.d.ts +0 -0
- package/lib-esm/DatePicker/DatePickerPanel.js +0 -0
- package/lib-esm/DatePicker/Day.d.ts +0 -13
- package/lib-esm/DatePicker/Day.js +0 -104
- package/lib-esm/DatePicker/Month.d.ts +0 -9
- package/lib-esm/DatePicker/Month.js +0 -74
- package/lib-esm/DatePicker/index.d.ts +0 -2
- package/lib-esm/DatePicker/index.js +0 -1
@@ -1,14 +1 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
/**
|
3
|
-
* Extract a component's props
|
4
|
-
*
|
5
|
-
* Source: https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase#wrappingmirroring-a-component
|
6
|
-
*
|
7
|
-
* @example ComponentProps<typeof MyComponent>
|
8
|
-
*/
|
9
|
-
export declare type ComponentProps<T> = T extends React.ComponentType<infer Props> ? Props extends object ? Props : never : never;
|
10
|
-
/**
|
11
|
-
* Contruct a type describing the items in `T`, if `T` is an array.
|
12
|
-
*/
|
13
|
-
export declare type Flatten<T extends unknown> = T extends (infer U)[] ? U : never;
|
14
1
|
export declare type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox ' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
/**
|
3
|
+
* Extract a component's props
|
4
|
+
*
|
5
|
+
* Source: https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase#wrappingmirroring-a-component
|
6
|
+
*
|
7
|
+
* @example ComponentProps<typeof MyComponent>
|
8
|
+
*/
|
9
|
+
export declare type ComponentProps<T> = T extends React.ComponentType<infer Props> ? Props extends object ? Props : never : never;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Given two object types A and B, return a type with all the properties of A that aren't also
|
3
|
+
* properties of B, and all the properties of B.
|
4
|
+
*
|
5
|
+
* Useful when we have a component that spreads a "rest" of its props on a subcomponent:
|
6
|
+
*
|
7
|
+
* ```ts
|
8
|
+
* interface OwnProps {
|
9
|
+
* foo: string
|
10
|
+
* }
|
11
|
+
*
|
12
|
+
* type MyComponentProps = Merge<SubcomponentProps, OwnProps>
|
13
|
+
* const MyComponent = ({foo, ...rest}: MyComponentProps) => {
|
14
|
+
* // ...
|
15
|
+
* return <SubComponent {...rest} />
|
16
|
+
* }
|
17
|
+
* ```
|
18
|
+
*/
|
19
|
+
export declare type Merge<A = {}, B = {}> = Omit<A, keyof B> & B;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/components",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-2021913173522",
|
4
4
|
"description": "Primer react components",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "lib-esm/index.js",
|
@@ -56,7 +56,7 @@
|
|
56
56
|
"@types/styled-system__css": "5.0.16",
|
57
57
|
"@types/styled-system__theme-get": "5.0.1",
|
58
58
|
"classnames": "2.3.1",
|
59
|
-
"
|
59
|
+
"color2k": "1.2.4",
|
60
60
|
"deepmerge": "4.2.2",
|
61
61
|
"focus-visible": "5.2.0",
|
62
62
|
"styled-system": "5.1.5"
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { OverlayProps } from '../Overlay';
|
3
|
-
import { FocusTrapHookSettings } from '../hooks/useFocusTrap';
|
4
|
-
import { FocusZoneHookSettings } from '../hooks/useFocusZone';
|
5
|
-
export interface DatePickerProps {
|
6
|
-
/**
|
7
|
-
* An override to the internal ref that will be spread on to the renderAnchor
|
8
|
-
*/
|
9
|
-
anchorRef?: React.RefObject<HTMLElement>;
|
10
|
-
anchorVariant?: 'full' | 'iconOnly';
|
11
|
-
/**
|
12
|
-
* Settings to apply to the Focus Zone on the internal `Overlay` component.
|
13
|
-
*/
|
14
|
-
focusTrapSettings?: Partial<FocusTrapHookSettings>;
|
15
|
-
/**
|
16
|
-
* Settings to apply to the Focus Zone on the internal `Overlay` component.
|
17
|
-
*/
|
18
|
-
focusZoneSettings?: Partial<FocusZoneHookSettings>;
|
19
|
-
initialValue?: 'today' | Date | string | null;
|
20
|
-
placeholder?: string;
|
21
|
-
/**
|
22
|
-
* Determines whether the overlay portion of the component should be shown or not
|
23
|
-
*/
|
24
|
-
open?: boolean;
|
25
|
-
/**
|
26
|
-
* A callback which is called whenever the overlay is currently closed and an "open gesture" is detected.
|
27
|
-
*/
|
28
|
-
onOpen?: (gesture: 'anchor-click' | 'anchor-key-press') => unknown;
|
29
|
-
/**
|
30
|
-
* A callback which is called whenever the overlay is currently open and a "close gesture" is detected.
|
31
|
-
*/
|
32
|
-
onClose?: (gesture: 'anchor-click' | 'click-outside' | 'escape') => unknown;
|
33
|
-
/**
|
34
|
-
* Props to be spread on the internal `Overlay` component.
|
35
|
-
*/
|
36
|
-
overlayProps?: Partial<OverlayProps>;
|
37
|
-
/**
|
38
|
-
* A custom function component used to render the anchor element.
|
39
|
-
* Will receive the selected text as `children` prop when an item is activated.
|
40
|
-
*/
|
41
|
-
renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element;
|
42
|
-
value?: Date | string | null;
|
43
|
-
}
|
44
|
-
export declare const DatePicker: React.FC<DatePickerProps>;
|
@@ -1,72 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.DatePicker = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
|
-
var _AnchoredOverlay = require("../AnchoredOverlay");
|
11
|
-
|
12
|
-
var _DatePickerAnchor = require("./DatePickerAnchor");
|
13
|
-
|
14
|
-
var _dateFns = require("date-fns");
|
15
|
-
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
-
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
|
-
|
20
|
-
const DatePicker = ({
|
21
|
-
anchorRef: externalAnchorRef,
|
22
|
-
focusTrapSettings,
|
23
|
-
focusZoneSettings,
|
24
|
-
onOpen: onOpenExternal,
|
25
|
-
onClose: onCloseExternal,
|
26
|
-
open,
|
27
|
-
overlayProps,
|
28
|
-
renderAnchor,
|
29
|
-
value
|
30
|
-
}) => {
|
31
|
-
const buttonRef = (0, _react.useRef)(null);
|
32
|
-
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
33
|
-
|
34
|
-
const onOpen = gesture => {
|
35
|
-
setIsOpen(true);
|
36
|
-
onOpenExternal === null || onOpenExternal === void 0 ? void 0 : onOpenExternal(gesture);
|
37
|
-
};
|
38
|
-
|
39
|
-
const onClose = gesture => {
|
40
|
-
setIsOpen(false);
|
41
|
-
onCloseExternal === null || onCloseExternal === void 0 ? void 0 : onCloseExternal(gesture);
|
42
|
-
};
|
43
|
-
|
44
|
-
const toggleIsOpen = () => {
|
45
|
-
if (isOpen) {
|
46
|
-
setIsOpen(false);
|
47
|
-
onCloseExternal === null || onCloseExternal === void 0 ? void 0 : onCloseExternal('anchor-click');
|
48
|
-
} else {
|
49
|
-
setIsOpen(true);
|
50
|
-
onCloseExternal === null || onCloseExternal === void 0 ? void 0 : onCloseExternal('anchor-click');
|
51
|
-
}
|
52
|
-
};
|
53
|
-
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DatePickerAnchor.DatePickerAnchor, {
|
55
|
-
ref: buttonRef,
|
56
|
-
fromDate: new Date(),
|
57
|
-
toDate: (0, _dateFns.addDays)(new Date(), 7),
|
58
|
-
dateFormat: "short",
|
59
|
-
onAction: toggleIsOpen
|
60
|
-
}), /*#__PURE__*/_react.default.createElement(_AnchoredOverlay.AnchoredOverlay, {
|
61
|
-
anchorRef: externalAnchorRef !== null && externalAnchorRef !== void 0 ? externalAnchorRef : buttonRef,
|
62
|
-
renderAnchor: renderAnchor,
|
63
|
-
open: open !== null && open !== void 0 ? open : isOpen,
|
64
|
-
onOpen: onOpen,
|
65
|
-
onClose: onClose,
|
66
|
-
overlayProps: overlayProps,
|
67
|
-
focusTrapSettings: focusTrapSettings,
|
68
|
-
focusZoneSettings: focusZoneSettings
|
69
|
-
}, value));
|
70
|
-
};
|
71
|
-
|
72
|
-
exports.DatePicker = DatePicker;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
export interface DatePickerAnchorProps {
|
3
|
-
dateFormat?: 'short' | 'long' | string;
|
4
|
-
disabled?: boolean;
|
5
|
-
fromDate: Date;
|
6
|
-
iconOnly?: boolean;
|
7
|
-
onAction?: (event?: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
|
8
|
-
toDate?: Date;
|
9
|
-
}
|
10
|
-
export declare const DatePickerAnchor: React.ForwardRefExoticComponent<DatePickerAnchorProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -1,83 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.DatePickerAnchor = void 0;
|
7
|
-
|
8
|
-
var _octiconsReact = require("@primer/octicons-react");
|
9
|
-
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
|
-
|
12
|
-
var _dateFns = require("date-fns");
|
13
|
-
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
15
|
-
|
16
|
-
var _Button = _interopRequireDefault(require("../Button"));
|
17
|
-
|
18
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
19
|
-
|
20
|
-
var _constants = require("../constants");
|
21
|
-
|
22
|
-
var _ = require("..");
|
23
|
-
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
|
-
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
|
-
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
|
-
|
30
|
-
const DatePickerAnchorButton = (0, _styledComponents.default)(_Button.default).withConfig({
|
31
|
-
displayName: "DatePickerAnchor__DatePickerAnchorButton",
|
32
|
-
componentId: "sc-8gpb9d-0"
|
33
|
-
})(["align-items:center;display:flex;flex-direction:row;justify-content:space-between;& ", "{margin-left:", ";}"], _Text.default, (0, _constants.get)('space.2'));
|
34
|
-
|
35
|
-
const DatePickerAnchor = /*#__PURE__*/_react.default.forwardRef(({
|
36
|
-
dateFormat = 'short',
|
37
|
-
disabled,
|
38
|
-
fromDate,
|
39
|
-
iconOnly = false,
|
40
|
-
onAction,
|
41
|
-
toDate
|
42
|
-
}, ref) => {
|
43
|
-
const formattedDate = (0, _react.useMemo)(() => {
|
44
|
-
if (iconOnly) return;
|
45
|
-
|
46
|
-
if (dateFormat === 'short') {
|
47
|
-
return /*#__PURE__*/_react.default.createElement(_Text.default, null, `${(0, _dateFns.format)(fromDate, 'MMM d')}${toDate ? ' - ' : ''}${toDate ? (0, _dateFns.format)(toDate, 'MMM d') : ''}`);
|
48
|
-
} else if (dateFormat === 'long') {
|
49
|
-
return /*#__PURE__*/_react.default.createElement(_Text.default, null, `${(0, _dateFns.format)(fromDate, 'MMM d, yyyy')}${toDate ? ' - ' : ''}${toDate ? (0, _dateFns.format)(toDate, 'MMM d, yyyy') : ''}`);
|
50
|
-
} else {
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_Text.default, null, `${(0, _dateFns.format)(fromDate, dateFormat)}${toDate ? ' - ' : ''}${toDate ? (0, _dateFns.format)(toDate, dateFormat) : ''}`);
|
52
|
-
}
|
53
|
-
}, [dateFormat, fromDate, iconOnly, toDate]);
|
54
|
-
const keyPressHandler = (0, _react.useCallback)(event => {
|
55
|
-
if (disabled) {
|
56
|
-
return;
|
57
|
-
}
|
58
|
-
|
59
|
-
if ([' ', 'Enter'].includes(event.key)) {
|
60
|
-
onAction === null || onAction === void 0 ? void 0 : onAction(event);
|
61
|
-
}
|
62
|
-
}, [disabled, onAction]);
|
63
|
-
const clickHandler = (0, _react.useCallback)(event => {
|
64
|
-
if (disabled) {
|
65
|
-
return;
|
66
|
-
}
|
67
|
-
|
68
|
-
onAction === null || onAction === void 0 ? void 0 : onAction(event);
|
69
|
-
}, [disabled, onAction]);
|
70
|
-
return /*#__PURE__*/_react.default.createElement(DatePickerAnchorButton, {
|
71
|
-
ref: ref,
|
72
|
-
onClick: clickHandler,
|
73
|
-
onKeyPress: keyPressHandler
|
74
|
-
}, /*#__PURE__*/_react.default.createElement(_.StyledOcticon, {
|
75
|
-
icon: _octiconsReact.CalendarIcon,
|
76
|
-
color: "fg.muted",
|
77
|
-
sx: {
|
78
|
-
my: '2px'
|
79
|
-
}
|
80
|
-
}), formattedDate);
|
81
|
-
});
|
82
|
-
|
83
|
-
exports.DatePickerAnchor = DatePickerAnchor;
|
File without changes
|
package/lib/DatePicker/Day.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { FontSizeProps } from 'styled-system';
|
3
|
-
import { SystemCommonProps, SystemLayoutProps } from '../constants';
|
4
|
-
import { SxProp } from '../sx';
|
5
|
-
export interface DayProps extends FontSizeProps, SystemCommonProps, SxProp, SystemLayoutProps {
|
6
|
-
blocked?: boolean;
|
7
|
-
disabled?: boolean;
|
8
|
-
onAction?: (date: Date, event?: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
|
9
|
-
selected?: boolean;
|
10
|
-
date: Date;
|
11
|
-
}
|
12
|
-
export declare const Day: React.FC<DayProps>;
|
13
|
-
export declare const BlankDay: import("styled-components").StyledComponent<"div", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").GridProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ShadowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & SxProp, never>;
|
package/lib/DatePicker/Day.js
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.BlankDay = exports.Day = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
|
-
|
12
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
13
|
-
|
14
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
15
|
-
|
16
|
-
var _constants = require("../constants");
|
17
|
-
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
-
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
23
|
-
|
24
|
-
const DayBaseComponent = (0, _styledComponents.default)(_Box.default).withConfig({
|
25
|
-
displayName: "Day__DayBaseComponent",
|
26
|
-
componentId: "sc-1japneh-0"
|
27
|
-
})(["align-content:center;display:flex;justify-content:center;min-width:38px;min-height:38px;padding:", ";"], (0, _constants.get)('space.1'));
|
28
|
-
const states = {
|
29
|
-
blocked: {
|
30
|
-
background: (0, _constants.get)('colors.neutral.subtle'),
|
31
|
-
color: (0, _constants.get)('colors.fg.subtle')
|
32
|
-
},
|
33
|
-
disabled: {
|
34
|
-
background: (0, _constants.get)('colors.canvas.primary'),
|
35
|
-
color: (0, _constants.get)('colors.fg.subtle')
|
36
|
-
},
|
37
|
-
selected: {
|
38
|
-
background: (0, _constants.get)('colors.accent.emphasis'),
|
39
|
-
color: (0, _constants.get)('colors.fg.onEmphasis')
|
40
|
-
},
|
41
|
-
default: {
|
42
|
-
normal: {
|
43
|
-
background: (0, _constants.get)('colors.canvas.primary'),
|
44
|
-
color: (0, _constants.get)('colors.fg.default')
|
45
|
-
},
|
46
|
-
hover: {
|
47
|
-
background: (0, _constants.get)('colors.neutral.muted'),
|
48
|
-
color: (0, _constants.get)('colors.fg.default')
|
49
|
-
},
|
50
|
-
pressed: {
|
51
|
-
background: (0, _constants.get)('colors.neutral.emphasis'),
|
52
|
-
color: (0, _constants.get)('colors.fg.onEmphasis')
|
53
|
-
}
|
54
|
-
}
|
55
|
-
};
|
56
|
-
|
57
|
-
const getStateColors = (props, prop, state) => {
|
58
|
-
const {
|
59
|
-
blocked,
|
60
|
-
disabled,
|
61
|
-
selected
|
62
|
-
} = props;
|
63
|
-
|
64
|
-
if (blocked) {
|
65
|
-
return states.blocked[prop];
|
66
|
-
} else if (disabled) {
|
67
|
-
return states.disabled[prop];
|
68
|
-
} else if (selected) {
|
69
|
-
return states.selected[prop];
|
70
|
-
} else {
|
71
|
-
return states.default[state][prop];
|
72
|
-
}
|
73
|
-
};
|
74
|
-
|
75
|
-
const DayComponent = (0, _styledComponents.default)(DayBaseComponent).attrs(props => ({
|
76
|
-
background: getStateColors(props, 'background', 'normal'),
|
77
|
-
textColor: getStateColors(props, 'color', 'normal'),
|
78
|
-
backgroundHover: getStateColors(props, 'background', 'hover'),
|
79
|
-
textColorHover: getStateColors(props, 'color', 'hover'),
|
80
|
-
backgroundPressed: getStateColors(props, 'background', 'pressed'),
|
81
|
-
textColorPressed: getStateColors(props, 'color', 'pressed')
|
82
|
-
})).withConfig({
|
83
|
-
displayName: "Day__DayComponent",
|
84
|
-
componentId: "sc-1japneh-1"
|
85
|
-
})(["background-color:", ";border-radius:", ";transition:0.2s background-color ease;& ", "{align-self:center;color:", ";display:flex;font-family:", ";font-size:", ";justify-self:center;user-select:none;transition:0.2s color ease;}&:hover{background-color:", ";cursor:pointer;transition:0.05s background-color ease;& ", "{color:", ";transition:0.1s color ease;}}&:active{background-color:", ";box-shadow:inset ", ";transition:0.1s background-color ease,0.1s box-shadow ease,0.1s color ease;& ", "{color:", ";transition:0.1s color ease;}}"], props => props.background, (0, _constants.get)('radii.2'), _Text.default, props => props.textColor, (0, _constants.get)('fonts.mono'), (0, _constants.get)('fontSizes.0'), props => props.backgroundHover, _Text.default, props => props.textColorHover, props => props.backgroundPressed, (0, _constants.get)('shadows.shadow.medium'), _Text.default, props => props.textColorPressed);
|
86
|
-
|
87
|
-
const Day = ({
|
88
|
-
blocked,
|
89
|
-
disabled,
|
90
|
-
date,
|
91
|
-
onAction,
|
92
|
-
selected
|
93
|
-
}) => {
|
94
|
-
const keyPressHandler = (0, _react.useCallback)(event => {
|
95
|
-
if (disabled) {
|
96
|
-
return;
|
97
|
-
}
|
98
|
-
|
99
|
-
if ([' ', 'Enter'].includes(event.key)) {
|
100
|
-
onAction === null || onAction === void 0 ? void 0 : onAction(date, event);
|
101
|
-
}
|
102
|
-
}, [disabled, onAction, date]);
|
103
|
-
const clickHandler = (0, _react.useCallback)(event => {
|
104
|
-
if (disabled) {
|
105
|
-
return;
|
106
|
-
}
|
107
|
-
|
108
|
-
onAction === null || onAction === void 0 ? void 0 : onAction(date, event);
|
109
|
-
}, [disabled, onAction, date]);
|
110
|
-
return /*#__PURE__*/_react.default.createElement(DayComponent, {
|
111
|
-
role: "button",
|
112
|
-
blocked: blocked,
|
113
|
-
disabled: disabled,
|
114
|
-
selected: selected,
|
115
|
-
onClick: clickHandler,
|
116
|
-
onKeyPress: keyPressHandler
|
117
|
-
}, /*#__PURE__*/_react.default.createElement(_Text.default, null, date.getDate()));
|
118
|
-
};
|
119
|
-
|
120
|
-
exports.Day = Day;
|
121
|
-
Day.displayName = "Day";
|
122
|
-
const BlankDay = (0, _styledComponents.default)(DayBaseComponent).withConfig({
|
123
|
-
displayName: "Day__BlankDay",
|
124
|
-
componentId: "sc-1japneh-2"
|
125
|
-
})(["background-color:", ";"], (0, _constants.get)('colors.canvas.primary'));
|
126
|
-
exports.BlankDay = BlankDay;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { FontSizeProps } from 'styled-system';
|
3
|
-
import { SystemCommonProps, SystemLayoutProps } from '../constants';
|
4
|
-
import { SxProp } from '../sx';
|
5
|
-
export interface MonthProps extends FontSizeProps, SystemCommonProps, SxProp, SystemLayoutProps {
|
6
|
-
month: number;
|
7
|
-
year: number;
|
8
|
-
}
|
9
|
-
export declare const Month: React.FC<MonthProps>;
|
package/lib/DatePicker/Month.js
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Month = void 0;
|
7
|
-
|
8
|
-
var _dateFns = require("date-fns");
|
9
|
-
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
11
|
-
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
13
|
-
|
14
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
15
|
-
|
16
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
17
|
-
|
18
|
-
var _constants = require("../constants");
|
19
|
-
|
20
|
-
var _Day = require("./Day");
|
21
|
-
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
|
-
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
|
-
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
|
-
|
28
|
-
const MonthComponent = (0, _styledComponents.default)(_Box.default).withConfig({
|
29
|
-
displayName: "Month__MonthComponent",
|
30
|
-
componentId: "l6j7o0-0"
|
31
|
-
})(["display:grid;grid-auto-rows:min-content;grid-template-columns:repeat(1fr,7);grid-template-rows:1fr;gap:0px 0px;grid-template-areas:'month month month month month month month' 'sunday monday tuesday wednesday thursday friday saturday';justify-items:stretch;align-items:stretch;"]);
|
32
|
-
const MonthTitle = (0, _styledComponents.default)(_Text.default).withConfig({
|
33
|
-
displayName: "Month__MonthTitle",
|
34
|
-
componentId: "l6j7o0-1"
|
35
|
-
})(["font-size:", ";font-weight:", ";grid-area:month;justify-self:center;"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('fontWeights.bold'));
|
36
|
-
const WeekdayHeader = (0, _styledComponents.default)(_Text.default).withConfig({
|
37
|
-
displayName: "Month__WeekdayHeader",
|
38
|
-
componentId: "l6j7o0-2"
|
39
|
-
})(["color:", ";font-family:", ";font-size:", ";justify-self:center;padding:", " 0 ", ";"], (0, _constants.get)('colors.fg.subtle'), (0, _constants.get)('fonts.mono'), (0, _constants.get)('fontSizes.0'), (0, _constants.get)('space.3'), (0, _constants.get)('space.2'));
|
40
|
-
|
41
|
-
const Month = ({
|
42
|
-
month,
|
43
|
-
year
|
44
|
-
}) => {
|
45
|
-
const [selectedDay, setSelectedDay] = (0, _react.useState)(null);
|
46
|
-
const getTitle = (0, _react.useMemo)(() => `${(0, _dateFns.format)(new Date(year, month), 'MMMM yyyy')}`, [month, year]);
|
47
|
-
const weekdayHeaders = (0, _react.useMemo)(() => {
|
48
|
-
const now = new Date(year, month);
|
49
|
-
return (0, _dateFns.eachDayOfInterval)({
|
50
|
-
start: (0, _dateFns.startOfWeek)(now),
|
51
|
-
end: (0, _dateFns.endOfWeek)(now)
|
52
|
-
}).map(d => /*#__PURE__*/_react.default.createElement(WeekdayHeader, {
|
53
|
-
key: `weekday-${d}-header`
|
54
|
-
}, (0, _dateFns.format)(d, 'EEEEEE')));
|
55
|
-
}, [month, year]);
|
56
|
-
|
57
|
-
const dayAction = date => {
|
58
|
-
setSelectedDay(date);
|
59
|
-
};
|
60
|
-
|
61
|
-
const dayComponents = (0, _react.useMemo)(() => {
|
62
|
-
const components = [];
|
63
|
-
const firstDay = new Date(year, month, 1);
|
64
|
-
|
65
|
-
for (let i = 0; i < firstDay.getDay(); i++) {
|
66
|
-
components.push( /*#__PURE__*/_react.default.createElement(_Day.BlankDay, {
|
67
|
-
key: `month-pre-blank-${i}`
|
68
|
-
}));
|
69
|
-
}
|
70
|
-
|
71
|
-
for (let i = 1; i <= (0, _dateFns.getDaysInMonth)(firstDay); i++) {
|
72
|
-
const date = new Date(year, month, i);
|
73
|
-
components.push( /*#__PURE__*/_react.default.createElement(_Day.Day, {
|
74
|
-
key: `day-component-${date.toString()}`,
|
75
|
-
date: date,
|
76
|
-
selected: selectedDay ? (0, _dateFns.isEqual)(date, selectedDay) : false,
|
77
|
-
onAction: dayAction
|
78
|
-
}));
|
79
|
-
}
|
80
|
-
|
81
|
-
const lastDay = (0, _dateFns.lastDayOfMonth)(firstDay);
|
82
|
-
|
83
|
-
for (let i = 6; i > lastDay.getDay(); i--) {
|
84
|
-
components.push( /*#__PURE__*/_react.default.createElement(_Day.BlankDay, {
|
85
|
-
key: `month-post-blank-${i}`
|
86
|
-
}));
|
87
|
-
}
|
88
|
-
|
89
|
-
return components;
|
90
|
-
}, [month, selectedDay, year]);
|
91
|
-
return /*#__PURE__*/_react.default.createElement(MonthComponent, {
|
92
|
-
role: "grid"
|
93
|
-
}, /*#__PURE__*/_react.default.createElement(MonthTitle, null, getTitle), weekdayHeaders, dayComponents);
|
94
|
-
};
|
95
|
-
|
96
|
-
exports.Month = Month;
|
97
|
-
Month.displayName = "Month";
|
package/lib/DatePicker/index.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "DatePicker", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _DatePicker.DatePicker;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
|
13
|
-
var _DatePicker = require("./DatePicker");
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { OverlayProps } from '../Overlay';
|
3
|
-
import { FocusTrapHookSettings } from '../hooks/useFocusTrap';
|
4
|
-
import { FocusZoneHookSettings } from '../hooks/useFocusZone';
|
5
|
-
export interface DatePickerProps {
|
6
|
-
/**
|
7
|
-
* An override to the internal ref that will be spread on to the renderAnchor
|
8
|
-
*/
|
9
|
-
anchorRef?: React.RefObject<HTMLElement>;
|
10
|
-
anchorVariant?: 'full' | 'iconOnly';
|
11
|
-
/**
|
12
|
-
* Settings to apply to the Focus Zone on the internal `Overlay` component.
|
13
|
-
*/
|
14
|
-
focusTrapSettings?: Partial<FocusTrapHookSettings>;
|
15
|
-
/**
|
16
|
-
* Settings to apply to the Focus Zone on the internal `Overlay` component.
|
17
|
-
*/
|
18
|
-
focusZoneSettings?: Partial<FocusZoneHookSettings>;
|
19
|
-
initialValue?: 'today' | Date | string | null;
|
20
|
-
placeholder?: string;
|
21
|
-
/**
|
22
|
-
* Determines whether the overlay portion of the component should be shown or not
|
23
|
-
*/
|
24
|
-
open?: boolean;
|
25
|
-
/**
|
26
|
-
* A callback which is called whenever the overlay is currently closed and an "open gesture" is detected.
|
27
|
-
*/
|
28
|
-
onOpen?: (gesture: 'anchor-click' | 'anchor-key-press') => unknown;
|
29
|
-
/**
|
30
|
-
* A callback which is called whenever the overlay is currently open and a "close gesture" is detected.
|
31
|
-
*/
|
32
|
-
onClose?: (gesture: 'anchor-click' | 'click-outside' | 'escape') => unknown;
|
33
|
-
/**
|
34
|
-
* Props to be spread on the internal `Overlay` component.
|
35
|
-
*/
|
36
|
-
overlayProps?: Partial<OverlayProps>;
|
37
|
-
/**
|
38
|
-
* A custom function component used to render the anchor element.
|
39
|
-
* Will receive the selected text as `children` prop when an item is activated.
|
40
|
-
*/
|
41
|
-
renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element;
|
42
|
-
value?: Date | string | null;
|
43
|
-
}
|
44
|
-
export declare const DatePicker: React.FC<DatePickerProps>;
|