@ebay/ui-core-react 6.0.0 → 6.1.0
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/ebay-button/button.d.ts +1 -1
- package/ebay-button/button.d.ts.map +1 -1
- package/ebay-button/button.js +1 -0
- package/ebay-button/types.d.ts +1 -1
- package/ebay-button/types.d.ts.map +1 -1
- package/ebay-calendar/README.md +34 -0
- package/ebay-calendar/calendar.d.ts +35 -0
- package/ebay-calendar/calendar.d.ts.map +1 -0
- package/ebay-calendar/calendar.js +323 -0
- package/ebay-calendar/date-utils.d.ts +13 -0
- package/ebay-calendar/date-utils.d.ts.map +1 -0
- package/ebay-calendar/date-utils.js +54 -0
- package/ebay-calendar/index.d.ts +2 -0
- package/ebay-calendar/index.d.ts.map +1 -0
- package/ebay-calendar/index.js +8 -0
- package/ebay-cta-button/cta-button.d.ts +1 -1
- package/ebay-icon-button/README.md +1 -0
- package/ebay-icon-button/icon-button.d.ts +3 -1
- package/ebay-icon-button/icon-button.d.ts.map +1 -1
- package/ebay-icon-button/icon-button.js +2 -2
- package/ebay-infotip/ebay-infotip-host.d.ts +1 -1
- package/ebay-lightbox-dialog/lightbox-dialog.d.ts +4 -2
- package/ebay-lightbox-dialog/lightbox-dialog.d.ts.map +1 -1
- package/ebay-lightbox-dialog/lightbox-dialog.js +2 -2
- package/package.json +1 -1
package/ebay-button/button.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export type EbayButtonProps = {
|
|
|
18
18
|
fixedHeight?: boolean;
|
|
19
19
|
};
|
|
20
20
|
type Props = ComponentProps<'button'> & ComponentProps<'a'> & EbayButtonProps;
|
|
21
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "split" | "form" | "slot" | "style" | "title" | "forwardedRef" | "type" | "key" | "value" | "className" | "disabled" | "placeholder" | "children" | "name" | "size" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "autoFocus" | "download" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "hrefLang" | "media" | "rel" | "target" | "
|
|
21
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "split" | "form" | "slot" | "style" | "title" | "forwardedRef" | "type" | "key" | "value" | "className" | "disabled" | "placeholder" | "children" | "name" | "size" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "autoFocus" | "download" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "hrefLang" | "media" | "rel" | "target" | "priority" | "variant" | "bodyState" | "transparent" | "fluid" | "partiallyDisabled" | "onEscape" | "truncate" | "borderless" | "fixedHeight" | "ping" | "referrerPolicy"> & React.RefAttributes<React.FC<Props>>>;
|
|
22
22
|
export default _default;
|
|
23
23
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ebay-button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEV,cAAc,EAEd,aAAa,EACb,UAAU,EAGV,SAAS,EACZ,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKnE,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7E,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAA;AAED,KAAK,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ebay-button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEV,cAAc,EAEd,aAAa,EACb,UAAU,EAGV,SAAS,EACZ,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKnE,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7E,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAA;AAED,KAAK,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;;AAsH9E,wBAAyC"}
|
package/ebay-button/button.js
CHANGED
package/ebay-button/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Priority = 'primary' | 'secondary' | 'tertiary' | 'none';
|
|
2
2
|
export type Variant = 'standard' | 'destructive' | 'form';
|
|
3
|
-
export type Size = 'default' | 'regular' | 'large';
|
|
3
|
+
export type Size = 'default' | 'regular' | 'small' | 'large';
|
|
4
4
|
export type BodyState = 'loading' | 'expand' | 'reset' | 'none';
|
|
5
5
|
export type Split = 'start' | 'end';
|
|
6
6
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-button/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;AAEpE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAA;AAEzD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAoB,SAAS,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-button/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;AAEpE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAA;AAEzD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAoB,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAE7E,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AAE/D,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# EbayCalendar
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
```react
|
|
6
|
+
<EbayCalendar />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Attributes
|
|
10
|
+
|
|
11
|
+
| Name | Type | Stateful | Description | Data |
|
|
12
|
+
| ---------------------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | --- |
|
|
13
|
+
| `navigable` | Boolean | No | If true, a header is included that allows for navigation between months |
|
|
14
|
+
| `interactive` | Boolean | No | Date cells are contained in buttons for interactive calendars, and spans otherwise |
|
|
15
|
+
| `numMonths` | Number | No | Number of months to be displayed at once |
|
|
16
|
+
| `range` | Boolean | No | True if selecting a range, false if a single value |
|
|
17
|
+
| `selected` | Date, Date[] | No | Date or list of dates that are selected, represented as an ISO string or an array of ISO strings |
|
|
18
|
+
| `locale` | String | No | Locale of the date picker, default to `navigator.language` |
|
|
19
|
+
| `disableBefore` | Date | No | First date that may be selected |
|
|
20
|
+
| `disableAfter` | Date | No | Last date that may be selected |
|
|
21
|
+
| `disableWeekdays` | Number[] | No | List of weekdays that are disabled. Must be an array of numbers, where Sunday is `0` and Saturday is `6` |
|
|
22
|
+
| `disableList` | String[], Date[] | No | List of specific days that are disabled. Should be a list of ISO strings, but also accepts timestamps or `Date` objects |
|
|
23
|
+
| `linkBuilder` | Function | No | Function used to build the href for each date. The function is passed the date as a `Date` object, and should return a url string. For dates that don't have a link, the function should return a falsy value |
|
|
24
|
+
| `getA11yShowMonthText` | Function | No | Function used to get the text for showing previous and next months, defaults to `Show ${monthName}` |
|
|
25
|
+
| `a11ySelectedText` | String | No | Text to be read by screen readers when a date is selected, defaults to `Selected` |
|
|
26
|
+
| `a11yRangeStartText` | String | No | Text to be read by screen readers when a date is the start of a range, defaults to `Start of range` |
|
|
27
|
+
| `a11yInRangeText` | String | No | Text to be read by screen readers when a date is in a range, defaults to `in range` |
|
|
28
|
+
| `a11yRangeEndText` | String | No | Text to be read by screen readers when a date is the end of a range, defaults to `End of range` |
|
|
29
|
+
| `a11yTodayText` | String | No | Text to be read by screen readers when a date is the current date, defaults to `Today` |
|
|
30
|
+
| `a11yDisabledText` | String | No | Text to be read by screen readers when a date is disabled, defaults to `inactive` |
|
|
31
|
+
| `a11ySeparator` | String | No | Text to be read by screen readers to separate properties, defaults to `-` |
|
|
32
|
+
| `onFocus` | Function | - | Triggered when a day is focused on, typically via keyboard events | `(event: FocusEvent, { iso })` | |
|
|
33
|
+
| `onSelect` | Function | - | Triggered when a day is selected | `(event: Event, { iso })` | |
|
|
34
|
+
| `onMonthChange` | Function | - | Triggered during month navigation | `(event: Event, { iso })` | |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FC, FocusEvent, KeyboardEvent, MouseEvent } from 'react';
|
|
2
|
+
import { DayISO } from './date-utils';
|
|
3
|
+
export type EbayCalendarProps = {
|
|
4
|
+
selected?: DayISO | DayISO[];
|
|
5
|
+
numMonths?: number;
|
|
6
|
+
navigable?: boolean;
|
|
7
|
+
interactive?: boolean;
|
|
8
|
+
range?: boolean;
|
|
9
|
+
locale?: string;
|
|
10
|
+
disableBefore?: DayISO;
|
|
11
|
+
disableAfter?: DayISO;
|
|
12
|
+
disableWeekdays?: number[];
|
|
13
|
+
disableList?: DayISO[];
|
|
14
|
+
getA11yShowMonthText?: (monthTitle: string) => string;
|
|
15
|
+
a11ySelectedText?: string;
|
|
16
|
+
a11yRangeStartText?: string;
|
|
17
|
+
a11yInRangeText?: string;
|
|
18
|
+
a11yRangeEndText?: string;
|
|
19
|
+
a11ySeparator?: string;
|
|
20
|
+
a11yTodayText?: string;
|
|
21
|
+
a11yDisabledText?: string;
|
|
22
|
+
linkBuilder?: (iso: DayISO) => string;
|
|
23
|
+
onMonthChange?: ({ iso }: {
|
|
24
|
+
iso: DayISO;
|
|
25
|
+
}) => void;
|
|
26
|
+
onFocus?: (event: MouseEvent | KeyboardEvent | FocusEvent, { iso }: {
|
|
27
|
+
iso: DayISO;
|
|
28
|
+
}) => void;
|
|
29
|
+
onSelect?: (event: MouseEvent, { iso }: {
|
|
30
|
+
iso: DayISO;
|
|
31
|
+
}) => void;
|
|
32
|
+
};
|
|
33
|
+
declare const EbayCalendar: FC<EbayCalendarProps>;
|
|
34
|
+
export default EbayCalendar;
|
|
35
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/ebay-calendar/calendar.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAA+B,MAAM,OAAO,CAAA;AAErG,OAAO,EAAE,MAAM,EAA6D,MAAM,cAAc,CAAA;AAGhG,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,GAAG,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7F,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACpE,CAAA;AASD,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqavC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
+
if (ar || !(i in from)) {
|
|
28
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
+
ar[i] = from[i];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
39
|
+
var ebay_icon_button_1 = require("../ebay-icon-button");
|
|
40
|
+
var date_utils_1 = require("./date-utils");
|
|
41
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
42
|
+
var DAY_UPDATE_KEYMAP = {
|
|
43
|
+
ArrowRight: 1,
|
|
44
|
+
ArrowLeft: -1,
|
|
45
|
+
ArrowDown: 7,
|
|
46
|
+
ArrowUp: -7
|
|
47
|
+
};
|
|
48
|
+
var EbayCalendar = function (_a) {
|
|
49
|
+
var selected = _a.selected, _b = _a.numMonths, numMonths = _b === void 0 ? 1 : _b, navigable = _a.navigable, interactive = _a.interactive, range = _a.range, locale = _a.locale, disableBefore = _a.disableBefore, disableAfter = _a.disableAfter, disableWeekdays = _a.disableWeekdays, disableList = _a.disableList, _c = _a.a11ySelectedText, a11ySelectedText = _c === void 0 ? 'selected' : _c, _d = _a.a11yRangeStartText, a11yRangeStartText = _d === void 0 ? 'start of range' : _d, _e = _a.a11yInRangeText, a11yInRangeText = _e === void 0 ? 'in range' : _e, _f = _a.a11yRangeEndText, a11yRangeEndText = _f === void 0 ? 'end of range' : _f, _g = _a.a11ySeparator, a11ySeparator = _g === void 0 ? '-' : _g, _h = _a.a11yTodayText, a11yTodayText = _h === void 0 ? 'today' : _h, _j = _a.a11yDisabledText, a11yDisabledText = _j === void 0 ? 'inactive' : _j, _k = _a.getA11yShowMonthText, getA11yShowMonthText = _k === void 0 ? function (monthTitle) { return "Show ".concat(monthTitle); } : _k, linkBuilder = _a.linkBuilder, _l = _a.onMonthChange, onMonthChange = _l === void 0 ? function () { } : _l, _m = _a.onFocus, onFocus = _m === void 0 ? function () { } : _m, _o = _a.onSelect, onSelect = _o === void 0 ? function () { } : _o;
|
|
50
|
+
var todayISO = (0, date_utils_1.toISO)(new Date());
|
|
51
|
+
var _p = (0, date_utils_1.getWeekdayInfo)((0, date_utils_1.localeOverride)(locale)), firstDayOfWeek = _p.firstDayOfWeek, weekdayLabels = _p.weekdayLabels;
|
|
52
|
+
var containerRef = (0, react_1.useRef)(null);
|
|
53
|
+
var _q = (0, react_1.useState)(0), offset = _q[0], setOffset = _q[1];
|
|
54
|
+
var _r = (0, react_1.useState)(null), focusISO = _r[0], setFocusISO = _r[1];
|
|
55
|
+
var _s = (0, react_1.useState)(todayISO), tabIndexISO = _s[0], setTabIndexISO = _s[1];
|
|
56
|
+
var baseISO = (0, react_1.useRef)(todayISO);
|
|
57
|
+
var getMonthDate = function (monthOffset) {
|
|
58
|
+
var baseDate = (0, date_utils_1.fromISO)(baseISO.current);
|
|
59
|
+
var date = new Date(Date.UTC(baseDate.getUTCFullYear(), baseDate.getUTCMonth() + monthOffset));
|
|
60
|
+
return date;
|
|
61
|
+
};
|
|
62
|
+
var getFirstVisibleISO = function () {
|
|
63
|
+
return (0, date_utils_1.toISO)(getMonthDate(offset));
|
|
64
|
+
};
|
|
65
|
+
var getLastVisibleISO = function () {
|
|
66
|
+
var baseDate = (0, date_utils_1.fromISO)(baseISO.current);
|
|
67
|
+
return (0, date_utils_1.toISO)(new Date(Date.UTC(baseDate.getUTCFullYear(), baseDate.getUTCMonth() + offset + (numMonths || 1), 0)));
|
|
68
|
+
};
|
|
69
|
+
(0, react_1.useEffect)(function () {
|
|
70
|
+
if (selected) {
|
|
71
|
+
var selectedISOs = Array.isArray(selected) ? selected : [selected];
|
|
72
|
+
var currFirstISO_1 = getFirstVisibleISO();
|
|
73
|
+
var currLastISO_1 = getLastVisibleISO();
|
|
74
|
+
var selectedTimeInView = selectedISOs.find(function (iso) { return iso >= currFirstISO_1 && iso <= currLastISO_1; });
|
|
75
|
+
if (selectedTimeInView === undefined) {
|
|
76
|
+
baseISO.current = selectedISOs[0];
|
|
77
|
+
setOffset(0);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, [selected]);
|
|
81
|
+
var calculateRangeDisplay = function () {
|
|
82
|
+
if (selected && range) {
|
|
83
|
+
var iso1 = void 0;
|
|
84
|
+
var iso2 = void 0;
|
|
85
|
+
if (Array.isArray(selected)) {
|
|
86
|
+
// Two elements are selected, we can use them as the ends of the range.
|
|
87
|
+
iso1 = selected[0], iso2 = selected[1];
|
|
88
|
+
}
|
|
89
|
+
else if (focusISO) {
|
|
90
|
+
// One element is selected and the user is focused on a date,
|
|
91
|
+
// so we use the selected component and the focus date instead
|
|
92
|
+
iso1 = selected;
|
|
93
|
+
iso2 = focusISO;
|
|
94
|
+
}
|
|
95
|
+
if (iso1 && iso2) {
|
|
96
|
+
var _a = [iso1, iso2].sort(), start = _a[0], end = _a[1];
|
|
97
|
+
return {
|
|
98
|
+
rangeStart: start,
|
|
99
|
+
rangeEnd: end
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
rangeStart: null,
|
|
105
|
+
rangeEnd: null
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
var monthTitle = function (date) {
|
|
109
|
+
var formatter = new Intl.DateTimeFormat((0, date_utils_1.localeOverride)(locale), {
|
|
110
|
+
month: 'long',
|
|
111
|
+
year: 'numeric'
|
|
112
|
+
});
|
|
113
|
+
return formatter.format(new Date(date.getUTCFullYear(), date.getUTCMonth()));
|
|
114
|
+
};
|
|
115
|
+
var isDayDisabled = function (iso) {
|
|
116
|
+
return (disableBefore && iso < disableBefore) ||
|
|
117
|
+
(disableAfter && iso > disableAfter) ||
|
|
118
|
+
(disableWeekdays && disableWeekdays.includes((0, date_utils_1.fromISO)(iso).getUTCDay())) ||
|
|
119
|
+
(disableList && disableList.includes(iso));
|
|
120
|
+
};
|
|
121
|
+
var getFirstActiveISO = function () {
|
|
122
|
+
var iso = getFirstVisibleISO();
|
|
123
|
+
var lastVisible = getLastVisibleISO();
|
|
124
|
+
while (iso <= lastVisible && isDayDisabled(iso)) {
|
|
125
|
+
iso = (0, date_utils_1.offsetISO)(iso, 1);
|
|
126
|
+
}
|
|
127
|
+
return iso > lastVisible ? null : iso;
|
|
128
|
+
};
|
|
129
|
+
var getLastActiveISO = function () {
|
|
130
|
+
var iso = getLastVisibleISO();
|
|
131
|
+
var firstVisible = getFirstVisibleISO();
|
|
132
|
+
while (iso >= firstVisible && isDayDisabled(iso)) {
|
|
133
|
+
iso = (0, date_utils_1.offsetISO)(iso, -1);
|
|
134
|
+
}
|
|
135
|
+
return iso < firstVisible ? null : iso;
|
|
136
|
+
};
|
|
137
|
+
var setTabindexAndFocus = function (iso) {
|
|
138
|
+
setTabIndexISO(iso);
|
|
139
|
+
setTimeout(function () {
|
|
140
|
+
var _a;
|
|
141
|
+
var elementToFocus = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("[data-iso=\"".concat(iso, "\"]"));
|
|
142
|
+
elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var prevMonth = function (focus) {
|
|
146
|
+
if (disableBefore && getFirstVisibleISO() <= disableBefore) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
setOffset(function (currentOffset) { return currentOffset - 1; });
|
|
150
|
+
var newTabIndexISO = tabIndexISO;
|
|
151
|
+
var lastActiveISO = getLastActiveISO();
|
|
152
|
+
if (lastActiveISO && lastActiveISO < tabIndexISO) {
|
|
153
|
+
newTabIndexISO = lastActiveISO;
|
|
154
|
+
setTabIndexISO(lastActiveISO);
|
|
155
|
+
}
|
|
156
|
+
if (focus) {
|
|
157
|
+
setTabindexAndFocus(newTabIndexISO);
|
|
158
|
+
}
|
|
159
|
+
onMonthChange({
|
|
160
|
+
iso: (0, date_utils_1.toISO)(getMonthDate(offset))
|
|
161
|
+
});
|
|
162
|
+
return true;
|
|
163
|
+
};
|
|
164
|
+
var nextMonth = function (focus) {
|
|
165
|
+
if (disableAfter && getLastVisibleISO() >= disableAfter) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
setOffset(function (currentOffset) { return currentOffset + 1; });
|
|
169
|
+
var newTabIndexISO = tabIndexISO;
|
|
170
|
+
var firstActiveISO = getFirstActiveISO();
|
|
171
|
+
if (firstActiveISO && firstActiveISO > tabIndexISO) {
|
|
172
|
+
newTabIndexISO = firstActiveISO;
|
|
173
|
+
setTabIndexISO(firstActiveISO);
|
|
174
|
+
}
|
|
175
|
+
if (focus) {
|
|
176
|
+
setTabindexAndFocus(newTabIndexISO);
|
|
177
|
+
}
|
|
178
|
+
onMonthChange({
|
|
179
|
+
iso: (0, date_utils_1.toISO)(getMonthDate(offset + (numMonths || 1)))
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
var onKeyDown = function (event) {
|
|
183
|
+
var dayChange = DAY_UPDATE_KEYMAP[event.key];
|
|
184
|
+
if (dayChange) {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
var tries = 7;
|
|
187
|
+
var iso = tabIndexISO;
|
|
188
|
+
do {
|
|
189
|
+
iso = (0, date_utils_1.offsetISO)(iso, dayChange);
|
|
190
|
+
} while (tries-- > 0 && isDayDisabled(iso));
|
|
191
|
+
if (tries > 0) {
|
|
192
|
+
var firstVisible = getFirstVisibleISO();
|
|
193
|
+
var lastVisible = getLastVisibleISO();
|
|
194
|
+
if (iso < firstVisible) {
|
|
195
|
+
if (navigable) {
|
|
196
|
+
prevMonth();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
iso = firstVisible;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else if (iso > lastVisible) {
|
|
203
|
+
if (navigable) {
|
|
204
|
+
nextMonth();
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
iso = lastVisible;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
setTabindexAndFocus(iso);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
switch (event.key) {
|
|
215
|
+
case 'PageUp':
|
|
216
|
+
prevMonth(true);
|
|
217
|
+
break;
|
|
218
|
+
case 'PageDown':
|
|
219
|
+
nextMonth(true);
|
|
220
|
+
break;
|
|
221
|
+
case 'Home':
|
|
222
|
+
setTabindexAndFocus(getFirstActiveISO());
|
|
223
|
+
break;
|
|
224
|
+
case 'End':
|
|
225
|
+
setTabindexAndFocus(getLastActiveISO());
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var onDaySelect = function (event, iso) {
|
|
232
|
+
onSelect(event, { iso: iso });
|
|
233
|
+
};
|
|
234
|
+
var onDayFocus = function (event, day) {
|
|
235
|
+
setFocusISO(day);
|
|
236
|
+
setTabIndexISO(day);
|
|
237
|
+
onFocus(event, { iso: day });
|
|
238
|
+
};
|
|
239
|
+
var onDayBlur = function () {
|
|
240
|
+
setFocusISO(null);
|
|
241
|
+
};
|
|
242
|
+
var _t = calculateRangeDisplay(), rangeStart = _t.rangeStart, rangeEnd = _t.rangeEnd;
|
|
243
|
+
var isDayInRange = function (iso) {
|
|
244
|
+
if (!rangeStart || !rangeEnd) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
if (iso < rangeStart || iso > rangeEnd) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
};
|
|
252
|
+
var monthDates = __spreadArray([], Array(numMonths), true).map(function (_, i) { return getMonthDate(offset + i); });
|
|
253
|
+
return (react_1.default.createElement("div", { className: "calendar", ref: containerRef },
|
|
254
|
+
navigable && (react_1.default.createElement("div", { className: "calendar__header" },
|
|
255
|
+
react_1.default.createElement("div", { className: "calendar__header--inner" },
|
|
256
|
+
react_1.default.createElement(ebay_icon_button_1.EbayIconButton, { transparent: true, size: "small", icon: "chevronLeft24", disabled: disableBefore && getFirstVisibleISO() <= disableBefore, "aria-label": getA11yShowMonthText(monthTitle(getMonthDate(offset - 1))), onClick: function () { return prevMonth(); } }),
|
|
257
|
+
monthDates.map(function (monthDate, i) { return (react_1.default.createElement("h3", { key: i }, monthTitle(monthDate))); }),
|
|
258
|
+
react_1.default.createElement(ebay_icon_button_1.EbayIconButton, { transparent: true, size: "small", icon: "chevronRight24", disabled: disableAfter && getLastVisibleISO() >= disableAfter, "aria-label": getA11yShowMonthText(monthTitle(getMonthDate(offset + numMonths))), onClick: function () { return nextMonth(); } })))),
|
|
259
|
+
react_1.default.createElement("div", { className: "calendar__body" }, monthDates.map(function (monthDate, i) {
|
|
260
|
+
var numBlankDays = (monthDate.getUTCDay() - firstDayOfWeek + 7) % 7;
|
|
261
|
+
var year = monthDate.getUTCFullYear();
|
|
262
|
+
var month = monthDate.getUTCMonth();
|
|
263
|
+
var daysInMont = new Date(year, month + 1, 0).getDate();
|
|
264
|
+
var calendarRows = __spreadArray([], Array(Math.ceil((numBlankDays + daysInMont) / 7)), true);
|
|
265
|
+
return (react_1.default.createElement("div", { key: i, className: "calendar__month" },
|
|
266
|
+
react_1.default.createElement("table", { onKeyDown: onKeyDown },
|
|
267
|
+
react_1.default.createElement("caption", null, monthTitle(monthDate)),
|
|
268
|
+
react_1.default.createElement("thead", null,
|
|
269
|
+
react_1.default.createElement("tr", null, weekdayLabels.map(function (dayName) { return (react_1.default.createElement("th", { key: dayName, scope: "col" }, dayName)); }))),
|
|
270
|
+
react_1.default.createElement("tbody", null, calendarRows.map(function (_, row) {
|
|
271
|
+
var startDate = row * 7 - numBlankDays + 1;
|
|
272
|
+
var endDate = startDate + 6;
|
|
273
|
+
var columns = [];
|
|
274
|
+
if (row === 0 && numBlankDays !== 0) {
|
|
275
|
+
startDate = 1;
|
|
276
|
+
columns.push(react_1.default.createElement("td", { key: "pre-column", colSpan: numBlankDays }));
|
|
277
|
+
}
|
|
278
|
+
else if (endDate > daysInMont) {
|
|
279
|
+
endDate = daysInMont;
|
|
280
|
+
}
|
|
281
|
+
var _loop_1 = function (day) {
|
|
282
|
+
var dayISO = (0, date_utils_1.toISO)(new Date(Date.UTC(year, month, day)));
|
|
283
|
+
var isToday = dayISO === todayISO;
|
|
284
|
+
var isSelected = Array.isArray(selected)
|
|
285
|
+
? selected.some(function (iso) { return iso === dayISO; })
|
|
286
|
+
: selected === dayISO;
|
|
287
|
+
var isRangeStart = dayISO === rangeStart;
|
|
288
|
+
var isInRange = isDayInRange(dayISO);
|
|
289
|
+
var isRangeEnd = dayISO === rangeEnd;
|
|
290
|
+
var isDisabled = isDayDisabled(dayISO);
|
|
291
|
+
var a11yTexts = [
|
|
292
|
+
'',
|
|
293
|
+
isSelected && a11ySelectedText,
|
|
294
|
+
isRangeStart && a11yRangeStartText,
|
|
295
|
+
!isRangeStart && !isRangeEnd && isInRange && a11yInRangeText,
|
|
296
|
+
isRangeEnd && a11yRangeEndText,
|
|
297
|
+
!interactive && isToday && a11yTodayText,
|
|
298
|
+
!interactive && isDisabled && a11yDisabledText
|
|
299
|
+
].filter(function (value) { return typeof value !== 'boolean' || value !== false; });
|
|
300
|
+
var link = !interactive && !isDisabled && linkBuilder && linkBuilder(dayISO);
|
|
301
|
+
var NonInteractiveTag = link ? 'a' : 'span';
|
|
302
|
+
columns.push(react_1.default.createElement("td", { key: day, className: (0, classnames_1.default)({
|
|
303
|
+
'calendar__cell--selected': isSelected,
|
|
304
|
+
'calendar__range--start': isRangeStart,
|
|
305
|
+
'calendar__range': isInRange,
|
|
306
|
+
'calendar__range--end': isRangeEnd
|
|
307
|
+
}) }, interactive ? (react_1.default.createElement("button", { disabled: isDisabled, "aria-label": a11yTexts.length > 1
|
|
308
|
+
? "".concat(day).concat(a11yTexts.join(a11ySeparator))
|
|
309
|
+
: undefined, tabIndex: tabIndexISO !== dayISO ? -1 : undefined, "aria-current": isToday ? 'date' : undefined, "aria-pressed": isSelected ? 'true' : undefined, onClick: function (event) { return onDaySelect(event, dayISO); }, onFocus: function (event) { return onDayFocus(event, dayISO); }, onMouseOver: function (event) { return onDayFocus(event, dayISO); }, onMouseOut: function (event) { return onDayBlur(); }, onBlur: function () { return onDayBlur(); }, "data-iso": dayISO }, day)) : (react_1.default.createElement(NonInteractiveTag, { className: (0, classnames_1.default)({
|
|
310
|
+
'calendar__cell--disabled': isDisabled,
|
|
311
|
+
'calendar__cell--current': isToday
|
|
312
|
+
}), href: link },
|
|
313
|
+
day,
|
|
314
|
+
a11yTexts.length > 1 && (react_1.default.createElement("span", { className: "clipped" }, a11yTexts.join(a11ySeparator)))))));
|
|
315
|
+
};
|
|
316
|
+
for (var day = startDate; day <= endDate; day++) {
|
|
317
|
+
_loop_1(day);
|
|
318
|
+
}
|
|
319
|
+
return (react_1.default.createElement("tr", { key: row }, columns));
|
|
320
|
+
})))));
|
|
321
|
+
}))));
|
|
322
|
+
};
|
|
323
|
+
exports.default = EbayCalendar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type DayISO = `${number}-${number}-${number}`;
|
|
2
|
+
export declare function findFirstDayOfWeek(localeName: string): number;
|
|
3
|
+
type WeekdayInfo = {
|
|
4
|
+
firstDayOfWeek: number;
|
|
5
|
+
weekdayLabels: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function getWeekdayInfo(localeName: string): WeekdayInfo;
|
|
8
|
+
export declare function toISO(date: Date): DayISO;
|
|
9
|
+
export declare function fromISO(iso: DayISO): Date;
|
|
10
|
+
export declare function offsetISO(iso: DayISO, days: number): DayISO;
|
|
11
|
+
export declare function localeOverride(locale?: string): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=date-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-utils.d.ts","sourceRoot":"","sources":["../../src/ebay-calendar/date-utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAErD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAW7D;AAED,KAAK,WAAW,GAAG;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAA;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAc9D;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAExC;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEzC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.localeOverride = exports.offsetISO = exports.fromISO = exports.toISO = exports.getWeekdayInfo = exports.findFirstDayOfWeek = void 0;
|
|
13
|
+
function findFirstDayOfWeek(localeName) {
|
|
14
|
+
// weekInfo only exists on some browsers, so we default to Sunday otherwise
|
|
15
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/weekInfo
|
|
16
|
+
var locale = new Intl.Locale(localeName);
|
|
17
|
+
if (locale.weekInfo) {
|
|
18
|
+
return locale.weekInfo.firstDay;
|
|
19
|
+
}
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
exports.findFirstDayOfWeek = findFirstDayOfWeek;
|
|
23
|
+
function getWeekdayInfo(localeName) {
|
|
24
|
+
var firstDayOfWeek = findFirstDayOfWeek(localeName);
|
|
25
|
+
var weekdayLabelFormatter = new Intl.DateTimeFormat(localeName, {
|
|
26
|
+
weekday: 'short'
|
|
27
|
+
});
|
|
28
|
+
var weekday = new Date(2022, 9, 2 + firstDayOfWeek); // October 2, 2022 was a Sunday
|
|
29
|
+
var weekdayLabels = __spreadArray([], Array(7), true).map(function () {
|
|
30
|
+
var dayLabel = weekdayLabelFormatter.format(weekday);
|
|
31
|
+
weekday.setDate(weekday.getDate() + 1);
|
|
32
|
+
return dayLabel;
|
|
33
|
+
});
|
|
34
|
+
return { firstDayOfWeek: firstDayOfWeek, weekdayLabels: weekdayLabels };
|
|
35
|
+
}
|
|
36
|
+
exports.getWeekdayInfo = getWeekdayInfo;
|
|
37
|
+
function toISO(date) {
|
|
38
|
+
return date.toISOString().slice(0, 10);
|
|
39
|
+
}
|
|
40
|
+
exports.toISO = toISO;
|
|
41
|
+
function fromISO(iso) {
|
|
42
|
+
return new Date(iso);
|
|
43
|
+
}
|
|
44
|
+
exports.fromISO = fromISO;
|
|
45
|
+
function offsetISO(iso, days) {
|
|
46
|
+
var date = fromISO(iso);
|
|
47
|
+
date.setUTCDate(date.getUTCDate() + days);
|
|
48
|
+
return toISO(date);
|
|
49
|
+
}
|
|
50
|
+
exports.offsetISO = offsetISO;
|
|
51
|
+
function localeOverride(locale) {
|
|
52
|
+
return locale || navigator.language;
|
|
53
|
+
}
|
|
54
|
+
exports.localeOverride = localeOverride;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EbayCalendar = void 0;
|
|
7
|
+
var calendar_1 = require("./calendar");
|
|
8
|
+
Object.defineProperty(exports, "EbayCalendar", { enumerable: true, get: function () { return __importDefault(calendar_1).default; } });
|
|
@@ -7,6 +7,6 @@ type Props = HTMLAnchorProps & {
|
|
|
7
7
|
size?: Size;
|
|
8
8
|
forwardedRef?: RefObject<HTMLAnchorElement>;
|
|
9
9
|
};
|
|
10
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "forwardedRef" | "key" | "size" |
|
|
10
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "forwardedRef" | "key" | "size" | "fluid" | "truncate" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>> & React.RefAttributes<React.FC<Props>>>;
|
|
11
11
|
export default _default;
|
|
12
12
|
//# sourceMappingURL=cta-button.d.ts.map
|
|
@@ -39,6 +39,7 @@ Name | Type | Stateful | Required | Description | Data
|
|
|
39
39
|
`bageNumber` | Number | No | No | number on the badge
|
|
40
40
|
`bageAriaLabel` | String | No | No | aria label of the badge
|
|
41
41
|
`transparent` | Boolean | No | No | for transparent background
|
|
42
|
+
`size` | String | No | No | alternative size for the icon button, 'large' or 'small'
|
|
42
43
|
|
|
43
44
|
## Callbacks
|
|
44
45
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import React, { ComponentProps, RefObject } from 'react';
|
|
2
2
|
import { Icon } from '../ebay-icon';
|
|
3
3
|
import { EbayKeyboardEventHandler } from '../common/event-utils/types';
|
|
4
|
+
import { Size } from '../ebay-button';
|
|
4
5
|
export type EbayIconButtonProps = {
|
|
5
6
|
href?: string;
|
|
6
7
|
icon: Icon;
|
|
7
8
|
badgeNumber?: number;
|
|
8
9
|
badgeAriaLabel?: string;
|
|
9
10
|
transparent?: boolean;
|
|
11
|
+
size?: Size;
|
|
10
12
|
forwardedRef?: RefObject<HTMLAnchorElement & HTMLButtonElement>;
|
|
11
13
|
onEscape?: EbayKeyboardEventHandler;
|
|
12
14
|
};
|
|
13
15
|
type HTMLButtonProps = ComponentProps<'button'>;
|
|
14
16
|
type HTMLAnchorProps = ComponentProps<'a'>;
|
|
15
17
|
type Props = EbayIconButtonProps & HTMLButtonProps & HTMLAnchorProps;
|
|
16
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "form" | "slot" | "style" | "title" | "forwardedRef" | "type" | "key" | "value" | "className" | "disabled" | "placeholder" | "children" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "autoFocus" | "download" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "hrefLang" | "media" | "rel" | "target" | "icon" | "
|
|
18
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "form" | "slot" | "style" | "title" | "forwardedRef" | "type" | "key" | "value" | "className" | "disabled" | "placeholder" | "children" | "name" | "size" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "autoFocus" | "download" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "hrefLang" | "media" | "rel" | "target" | "icon" | "transparent" | "onEscape" | "ping" | "referrerPolicy" | "badgeNumber" | "badgeAriaLabel"> & React.RefAttributes<React.FC<Props>>>;
|
|
17
19
|
export default _default;
|
|
18
20
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/ebay-icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAqB,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAA;AAG7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/ebay-icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAqB,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAA;AAG7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAErC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IAChE,QAAQ,CAAC,EAAE,wBAAwB,CAAC;CACvC,CAAA;AAED,KAAK,eAAe,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAChD,KAAK,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAC3C,KAAK,KAAK,GAAG,mBAAmB,GAAG,eAAe,GAAG,eAAe,CAAC;;AA8DrE,wBAA6C"}
|
|
@@ -32,9 +32,9 @@ var ebay_badge_1 = require("../ebay-badge");
|
|
|
32
32
|
var component_utils_1 = require("../common/component-utils");
|
|
33
33
|
var EbayIconButton = function (_a) {
|
|
34
34
|
var _b;
|
|
35
|
-
var href = _a.href, icon = _a.icon, badgeNumber = _a.badgeNumber, badgeAriaLabel = _a.badgeAriaLabel, transparent = _a.transparent, extraClasses = _a.className, forwardedRef = _a.forwardedRef, _c = _a.onEscape, onEscape = _c === void 0 ? function () { } : _c, _d = _a.onKeyDown, onKeyDown = _d === void 0 ? function () { } : _d, rest = __rest(_a, ["href", "icon", "badgeNumber", "badgeAriaLabel", "transparent", "className", "forwardedRef", "onEscape", "onKeyDown"]);
|
|
35
|
+
var href = _a.href, icon = _a.icon, badgeNumber = _a.badgeNumber, badgeAriaLabel = _a.badgeAriaLabel, transparent = _a.transparent, extraClasses = _a.className, forwardedRef = _a.forwardedRef, size = _a.size, _c = _a.onEscape, onEscape = _c === void 0 ? function () { } : _c, _d = _a.onKeyDown, onKeyDown = _d === void 0 ? function () { } : _d, rest = __rest(_a, ["href", "icon", "badgeNumber", "badgeAriaLabel", "transparent", "className", "forwardedRef", "size", "onEscape", "onKeyDown"]);
|
|
36
36
|
var classPrefix = href ? 'icon-link' : 'icon-btn';
|
|
37
|
-
var className = (0, classnames_1.default)(extraClasses, classPrefix, (_b = {},
|
|
37
|
+
var className = (0, classnames_1.default)(extraClasses, classPrefix, size && "".concat(classPrefix, "--").concat(size), (_b = {},
|
|
38
38
|
_b["".concat(classPrefix, "--badged")] = badgeNumber,
|
|
39
39
|
_b["".concat(classPrefix, "--transparent")] = transparent,
|
|
40
40
|
_b));
|
|
@@ -9,6 +9,6 @@ type InfotipHostProps = ComponentProps<'button'> & {
|
|
|
9
9
|
icon: any;
|
|
10
10
|
}) => ReactNode) | ReactNode;
|
|
11
11
|
};
|
|
12
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<InfotipHostProps, "forwardedRef" | "key" | "icon" | keyof React.ButtonHTMLAttributes<HTMLButtonElement
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<InfotipHostProps, "forwardedRef" | "key" | "icon" | "variant" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & React.RefAttributes<React.FC<InfotipHostProps>>>;
|
|
13
13
|
export default _default;
|
|
14
14
|
//# sourceMappingURL=ebay-infotip-host.d.ts.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { DialogBaseProps } from '../ebay-dialog-base';
|
|
3
3
|
type Mode = 'default' | 'mini';
|
|
4
|
-
|
|
4
|
+
type Size = 'wide' | 'narrow';
|
|
5
|
+
export type Props<T = any> = Omit<DialogBaseProps<T>, 'size'> & {
|
|
5
6
|
open?: boolean;
|
|
6
7
|
mode?: Mode;
|
|
8
|
+
size?: Size;
|
|
7
9
|
onClose?: () => void;
|
|
8
|
-
}
|
|
10
|
+
};
|
|
9
11
|
declare const EbayLightboxDialog: FC<Props>;
|
|
10
12
|
export default EbayLightboxDialog;
|
|
11
13
|
//# sourceMappingURL=lightbox-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightbox-dialog.d.ts","sourceRoot":"","sources":["../../src/ebay-lightbox-dialog/lightbox-dialog.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,eAAe,EAAuB,MAAM,qBAAqB,CAAA;AAI1E,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"lightbox-dialog.d.ts","sourceRoot":"","sources":["../../src/ebay-lightbox-dialog/lightbox-dialog.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,eAAe,EAAuB,MAAM,qBAAqB,CAAA;AAI1E,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAA;AAC9B,KAAK,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE7B,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAA;AAED,QAAA,MAAM,kBAAkB,EAAE,EAAE,CAAC,KAAK,CAmBjC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -31,8 +31,8 @@ var ebay_dialog_base_1 = require("../ebay-dialog-base");
|
|
|
31
31
|
var classPrefix = 'lightbox-dialog';
|
|
32
32
|
var EbayLightboxDialog = function (_a) {
|
|
33
33
|
var _b;
|
|
34
|
-
var open = _a.open, mode = _a.mode, _c = _a.onClose, onClose = _c === void 0 ? function () { } : _c, rest = __rest(_a, ["open", "mode", "onClose"]);
|
|
35
|
-
return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, __assign({ buttonPosition: "right" }, rest, { classPrefix: classPrefix, onCloseBtnClick: onClose, onBackgroundClick: onClose, className: (0, classnames_1.default)(rest.className, "".concat(classPrefix, "--mask-fade")), windowClass: (0, classnames_1.default)('lightbox-dialog__window--fade', (_b = {},
|
|
34
|
+
var open = _a.open, mode = _a.mode, size = _a.size, _c = _a.onClose, onClose = _c === void 0 ? function () { } : _c, rest = __rest(_a, ["open", "mode", "size", "onClose"]);
|
|
35
|
+
return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, __assign({ buttonPosition: "right" }, rest, { classPrefix: classPrefix, onCloseBtnClick: onClose, onBackgroundClick: onClose, className: (0, classnames_1.default)(rest.className, "".concat(classPrefix, "--mask-fade"), size && "".concat(classPrefix, "--").concat(size)), windowClass: (0, classnames_1.default)('lightbox-dialog__window--fade', (_b = {},
|
|
36
36
|
_b["".concat(classPrefix, "__window--mini")] = mode === 'mini',
|
|
37
37
|
_b)), open: open })));
|
|
38
38
|
};
|