@commercetools-uikit/calendar-utils 12.2.1 → 12.2.5

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.
@@ -0,0 +1,47 @@
1
+ import { LegacyRef, FocusEventHandler, KeyboardEvent } from 'react';
2
+ import { Theme } from '@emotion/react';
3
+ export declare type TClearSection = {
4
+ isDisabled?: boolean;
5
+ hasError?: boolean;
6
+ hasWarning?: boolean;
7
+ onClear?: () => void;
8
+ theme?: Theme;
9
+ isFocused?: boolean;
10
+ isOpen?: boolean;
11
+ };
12
+ export declare const ClearSection: {
13
+ (props: TClearSection): import("@emotion/react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ export declare type TInputProps = {
17
+ onBlur?: FocusEventHandler;
18
+ onFocus?: FocusEventHandler;
19
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement | HTMLButtonElement>) => void;
20
+ };
21
+ export declare type TCalendarBody = {
22
+ inputRef: LegacyRef<HTMLInputElement>;
23
+ icon?: string;
24
+ id?: string;
25
+ inputProps?: TInputProps;
26
+ isClearable?: boolean;
27
+ toggleButtonProps?: Pick<TInputProps, 'onBlur' | 'onFocus'>;
28
+ value?: string;
29
+ isDisabled?: boolean;
30
+ isReadOnly?: boolean;
31
+ isOpen?: boolean;
32
+ hasSelection?: boolean;
33
+ hasWarning?: boolean;
34
+ hasError?: boolean;
35
+ onClear?: () => void;
36
+ placeholder?: string;
37
+ theme?: Theme;
38
+ };
39
+ declare type TDefaultProps = {
40
+ isClearable: boolean;
41
+ };
42
+ export declare const CalendarBody: {
43
+ (props: TCalendarBody): import("@emotion/react/jsx-runtime").JSX.Element;
44
+ displayName: string;
45
+ defaultProps: TDefaultProps;
46
+ };
47
+ export default CalendarBody;
@@ -0,0 +1,10 @@
1
+ import { Theme } from '@emotion/react';
2
+ import type { TCalendarBody } from './calendar-body';
3
+ declare const getClearSectionStyles: (theme: Theme) => import("@emotion/utils").SerializedStyles;
4
+ declare type TState = {
5
+ isFocused: boolean;
6
+ };
7
+ declare const getCalendarIconContainerStyles: (props: TCalendarBody, state: TState, theme: Theme) => import("@emotion/utils").SerializedStyles;
8
+ declare const getInputContainerStyles: (props: TCalendarBody, state: TState, theme: Theme) => import("@emotion/utils").SerializedStyles;
9
+ declare const getDateTimeInputStyles: (props: TCalendarBody, theme: Theme) => import("@emotion/utils").SerializedStyles[];
10
+ export { getClearSectionStyles, getInputContainerStyles, getDateTimeInputStyles, getCalendarIconContainerStyles, };
@@ -0,0 +1 @@
1
+ export { default } from './calendar-body';
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const CalendarContent: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
6
+ export default CalendarContent;
@@ -0,0 +1 @@
1
+ export { default } from './calendar-content';
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ declare type TCalendarDay = {
3
+ children?: ReactNode;
4
+ type?: 'heading' | 'spacing' | 'day';
5
+ isHighlighted?: boolean;
6
+ isSelected?: boolean;
7
+ isRangeStart?: boolean;
8
+ isRangeBetween?: boolean;
9
+ isRangeEnd?: boolean;
10
+ isToday?: boolean;
11
+ disabled?: boolean;
12
+ };
13
+ declare const CalendarDay: {
14
+ (props: TCalendarDay): import("@emotion/react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ export default CalendarDay;
@@ -0,0 +1 @@
1
+ export { default } from './calendar-day';
@@ -0,0 +1,14 @@
1
+ declare type TCalendarHeader = {
2
+ monthLabel: string;
3
+ yearLabel: string;
4
+ onPrevMonthClick: () => void;
5
+ onTodayClick: () => void;
6
+ onNextMonthClick: () => void;
7
+ onPrevYearClick: () => void;
8
+ onNextYearClick: () => void;
9
+ };
10
+ declare const CalendarHeader: {
11
+ (props: TCalendarHeader): import("@emotion/react/jsx-runtime").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ export default CalendarHeader;
@@ -0,0 +1 @@
1
+ export { default } from './calendar-header';
@@ -0,0 +1,28 @@
1
+ declare const _default: {
2
+ todayTooltip: {
3
+ id: string;
4
+ description: string;
5
+ defaultMessage: string;
6
+ };
7
+ previousMonthTooltip: {
8
+ id: string;
9
+ description: string;
10
+ defaultMessage: string;
11
+ };
12
+ nextMonthTooltip: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
17
+ previousYearTooltip: {
18
+ id: string;
19
+ description: string;
20
+ defaultMessage: string;
21
+ };
22
+ nextYearTooltip: {
23
+ id: string;
24
+ description: string;
25
+ defaultMessage: string;
26
+ };
27
+ };
28
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { Component, ReactNode } from 'react';
2
+ declare type TCalendarMenu = {
3
+ children: ReactNode;
4
+ hasFooter?: boolean;
5
+ hasError?: boolean;
6
+ hasWarning?: boolean;
7
+ footer?: ReactNode;
8
+ };
9
+ export default class CalendarMenu extends Component<TCalendarMenu> {
10
+ static displayName: string;
11
+ render(): import("@emotion/react/jsx-runtime").JSX.Element;
12
+ }
13
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './calendar-menu';
@@ -0,0 +1,27 @@
1
+ import type { MomentInput, DurationInputArg1 } from 'moment';
2
+ export declare const getDaysInMonth: (day: MomentInput) => number;
3
+ export declare const getDateInMonth: (day: MomentInput) => number;
4
+ export declare const getToday: () => string;
5
+ export declare const formatDate: (day: MomentInput, locale: string) => string;
6
+ export declare const changeMonth: (day: MomentInput, delta: DurationInputArg1) => string;
7
+ export declare const getNextDay: (day: MomentInput) => string;
8
+ export declare const getPreviousDay: (day: MomentInput) => string;
9
+ export declare const getPaddingDayCount: (day: MomentInput, locale: string) => number;
10
+ export declare const getWeekdayNames: (locale: string) => string[];
11
+ export declare const getMonthCalendarLabel: (day: MomentInput, locale: string) => string;
12
+ export declare const getYearCalendarLabel: (day: MomentInput, locale: string) => string;
13
+ export declare const isSameDay: (a: MomentInput, b: MomentInput) => boolean;
14
+ export declare const getCalendarDayLabel: (day: MomentInput) => string;
15
+ export declare const isBetween: (item: MomentInput, start: MomentInput, end: MomentInput) => boolean;
16
+ export declare const createCalendarItems: (day: MomentInput) => string[];
17
+ export declare const createItemRangeToString: (locale: string) => (item: MomentInput) => string;
18
+ export declare const createItemToString: (locale: string) => (item: MomentInput) => string;
19
+ export declare const formatRange: (range: string[], locale: string) => string;
20
+ export declare const parseInputToDate: (text: MomentInput, locale: string) => string;
21
+ export declare const getIsDateInRange: (item: MomentInput, min: MomentInput, max: MomentInput) => boolean;
22
+ export declare const getExampleDateStrings: () => {
23
+ currentDate: string;
24
+ preselectedDate: string;
25
+ minDate: string;
26
+ maxDate: string;
27
+ };
@@ -0,0 +1,7 @@
1
+ export * from './calendar';
2
+ export { default as CalendarBody } from './calendar-body';
3
+ export { default as CalendarContent } from './calendar-content';
4
+ export { default as CalendarDay } from './calendar-day';
5
+ export { default as CalendarHeader } from './calendar-header';
6
+ export { default as CalendarMenu } from './calendar-menu';
7
+ export { default as version } from './version';
@@ -0,0 +1,2 @@
1
+ declare const _default: "__@UI_KIT_PACKAGE/VERSION_OF_RELEASE__";
2
+ export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/calendar-utils",
3
3
  "description": "Utilities to work with values for a calendar.",
4
- "version": "12.2.1",
4
+ "version": "12.2.5",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -9,32 +9,35 @@
9
9
  "directory": "packages/calendar-utils"
10
10
  },
11
11
  "homepage": "https://uikit.commercetools.com",
12
- "keywords": ["javascript", "design system", "react", "uikit"],
12
+ "keywords": [
13
+ "javascript",
14
+ "design system",
15
+ "react",
16
+ "uikit"
17
+ ],
13
18
  "license": "MIT",
14
- "private": false,
15
19
  "publishConfig": {
16
20
  "access": "public"
17
21
  },
18
22
  "sideEffects": false,
19
23
  "main": "dist/commercetools-uikit-calendar-utils.cjs.js",
20
24
  "module": "dist/commercetools-uikit-calendar-utils.esm.js",
21
- "files": ["dist"],
22
- "scripts": {
23
- "prepare": "../../scripts/version.js replace"
24
- },
25
+ "files": [
26
+ "dist"
27
+ ],
25
28
  "dependencies": {
26
- "@babel/runtime": "7.14.6",
27
- "@babel/runtime-corejs3": "7.14.7",
28
- "@commercetools-uikit/accessible-button": "12.2.0",
29
- "@commercetools-uikit/design-system": "12.1.0",
30
- "@commercetools-uikit/hooks": "12.2.0",
31
- "@commercetools-uikit/icons": "12.2.1",
32
- "@commercetools-uikit/input-utils": "12.2.1",
33
- "@commercetools-uikit/secondary-icon-button": "12.2.1",
34
- "@commercetools-uikit/spacings-inline": "12.2.0",
35
- "@commercetools-uikit/text": "12.2.0",
36
- "@commercetools-uikit/tooltip": "12.2.0",
37
- "@commercetools-uikit/utils": "12.2.0",
29
+ "@babel/runtime": "7.16.3",
30
+ "@babel/runtime-corejs3": "7.16.3",
31
+ "@commercetools-uikit/accessible-button": "12.2.5",
32
+ "@commercetools-uikit/design-system": "12.2.5",
33
+ "@commercetools-uikit/hooks": "12.2.5",
34
+ "@commercetools-uikit/icons": "12.2.5",
35
+ "@commercetools-uikit/input-utils": "12.2.5",
36
+ "@commercetools-uikit/secondary-icon-button": "12.2.5",
37
+ "@commercetools-uikit/spacings-inline": "12.2.5",
38
+ "@commercetools-uikit/text": "12.2.5",
39
+ "@commercetools-uikit/tooltip": "12.2.5",
40
+ "@commercetools-uikit/utils": "12.2.5",
38
41
  "@emotion/react": "^11.4.0",
39
42
  "@emotion/styled": "^11.3.0",
40
43
  "prop-types": "15.7.2",
@@ -43,7 +46,7 @@
43
46
  "devDependencies": {
44
47
  "moment": "2.29.1",
45
48
  "react": "17.0.2",
46
- "react-intl": "5.20.4"
49
+ "react-intl": "5.21.2"
47
50
  },
48
51
  "peerDependencies": {
49
52
  "moment": "2.x",