Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plasma-new-hope): add DatePicker component #1224

Merged
merged 22 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8193120
feat(plasma-new-hope): add DatePicker
TitanKuzmich May 31, 2024
95b7cf5
feat(plasma-new-hope): refactor Calendar tokens & mixins
TitanKuzmich Jun 5, 2024
9d8c953
feat(plasma-new-hope): add range double DatePicker
TitanKuzmich Jun 6, 2024
c209781
feat(plasma-new-hope): add DatePicker examples
TitanKuzmich Jun 7, 2024
c99fa14
docs: regenerate api reports
TitanKuzmich Jun 7, 2024
aeff093
feat(plasma-b2c/web): update Calendar configs
TitanKuzmich Jun 7, 2024
ee6e121
feat(plasma-new-hope): fix Range LeftContent margin
TitanKuzmich Jun 11, 2024
a7557c8
feat(plasma-new-hope): fix DatePicker tokens
TitanKuzmich Jun 11, 2024
f82ea1c
feat(plasma-b2c/web): update Range configs
TitanKuzmich Jun 13, 2024
36f1df9
feat(plasma-b2c): add DatePicker component
TitanKuzmich Jun 13, 2024
7fff31c
feat(plasma-new-hope): refactor DatePicker flow
TitanKuzmich Jun 13, 2024
dafe952
docs: add DatePicker docs
TitanKuzmich Jun 13, 2024
6c4430f
feat(plasma-web/b2c): add DatePicker component
TitanKuzmich Jun 13, 2024
ecbd167
feat(sdds-serv): add DatePicker component
TitanKuzmich Jun 13, 2024
f36115e
test(plasma-web/b2c): add snapshots for DatePicker
TitanKuzmich Jun 13, 2024
1556c1c
test(plasma-b2c/web): update Calendar snapshots
TitanKuzmich Jun 13, 2024
6ba15e0
test(plasma-b2c/web): update Range snapshots
TitanKuzmich Jun 13, 2024
cf79397
feat(plasma-web): update Calendar test
TitanKuzmich Jun 13, 2024
84f1ceb
test(plasma-web/b2c): update snapshots depending on Disclosure Icons
TitanKuzmich Jun 14, 2024
6acb358
feat(plasma-new-hope): fix dropdown disclosure icon
TitanKuzmich Jun 14, 2024
e901f60
feat(plasma-new-hope): refactor range props
TitanKuzmich Jun 14, 2024
664a739
feat(plasma-new-hope): rename DatePicker folders
TitanKuzmich Jun 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 120 additions & 7 deletions packages/plasma-b2c/api/plasma-b2c.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ import { counterTokens } from '@salutejs/plasma-new-hope/styled-components';
import { CustomComboboxProps } from '@salutejs/plasma-new-hope/types/components/Combobox/Combobox.types';
import { CustomPopoverProps } from '@salutejs/plasma-new-hope/types/components/Popover/Popover.types';
import { CustomToastProps } from '@salutejs/plasma-new-hope/types/components/Toast/Toast.types';
import { DatePickerCalendarProps } from '@salutejs/plasma-new-hope/types/components/DatePicker/SingleDate/SingleDate.types';
import { DatePickerCalendarProps as DatePickerCalendarProps_2 } from '@salutejs/plasma-new-hope/types/components/DatePicker/RangeDate/RangeDate.types';
import { datePickerClasses } from '@salutejs/plasma-new-hope/styled-components';
import { DatePickerdVariationProps } from '@salutejs/plasma-new-hope/types/components/DatePicker/DatePickerBase.types';
import { DatePickerPlacement } from '@salutejs/plasma-new-hope/styled-components';
import { DatePickerPlacementBasic } from '@salutejs/plasma-new-hope/styled-components';
import { DatePickerPopoverProps } from '@salutejs/plasma-new-hope/types/components/DatePicker/SingleDate/SingleDate.types';
import { DatePickerProps } from '@salutejs/plasma-new-hope/styled-components';
import { DatePickerRangePlacement } from '@salutejs/plasma-new-hope/styled-components';
import { DatePickerRangeProps } from '@salutejs/plasma-new-hope/styled-components';
import { DatePickerTextFieldProps } from '@salutejs/plasma-new-hope/types/components/DatePicker/SingleDate/SingleDate.types';
import { datePickerTokens } from '@salutejs/plasma-new-hope/styled-components';
import { defaultValidate } from '@salutejs/plasma-hope';
import { DisabledProps } from '@salutejs/plasma-core';
import { DividerProps } from '@salutejs/plasma-new-hope/styled-components';
Expand Down Expand Up @@ -181,6 +193,7 @@ import { ProgressProps } from '@salutejs/plasma-new-hope/styled-components';
import { PropsType } from '@salutejs/plasma-new-hope/types/engines/types';
import { RadioGroup } from '@salutejs/plasma-new-hope/styled-components';
import { radiuses } from '@salutejs/plasma-core';
import { RangeInputRefs } from '@salutejs/plasma-new-hope/styled-components';
import { RangeProps } from '@salutejs/plasma-new-hope/styled-components';
import { rangeTokens } from '@salutejs/plasma-new-hope/styled-components';
import { Ratio } from '@salutejs/plasma-new-hope/styled-components';
Expand Down Expand Up @@ -653,13 +666,17 @@ export const Calendar: FC<CalendarProps>;
export const CalendarBase: FunctionComponent<PropsType< {
view: {
default: string;
primary: string;
};
size: {
l: string;
m: string;
s: string;
xs: string;
};
}> & HTMLAttributes<HTMLDivElement> & Calendar_2 & {
}> & Calendar_2 & {
type?: "Days" | "Months" | "Years" | undefined;
size?: string | undefined;
view?: string | undefined;
} & RefAttributes<HTMLDivElement>>;

export { CalendarBaseProps }
Expand All @@ -671,12 +688,17 @@ export const CalendarBaseRange: ({ value, disabledList, eventList, min, max, onC
export const CalendarDouble: FunctionComponent<PropsType< {
view: {
default: string;
primary: string;
};
size: {
l: string;
m: string;
s: string;
xs: string;
};
}> & HTMLAttributes<HTMLDivElement> & Calendar_2 & RefAttributes<HTMLDivElement>>;
}> & HTMLAttributes<HTMLDivElement> & Calendar_2 & {
size?: string | undefined;
view?: string | undefined;
} & RefAttributes<HTMLDivElement>>;

export { CalendarDoubleProps }

Expand Down Expand Up @@ -963,6 +985,97 @@ export { CounterProps }

export { counterTokens }

// @public (undocumented)
export const DatePicker: FunctionComponent<PropsType< {
view: {
default: string;
};
size: {
l: string;
m: string;
s: string;
xs: string;
};
disabled: {
true: string;
};
readOnly: {
true: string;
};
}> & DatePickerdVariationProps & DatePickerTextFieldProps & DatePickerCalendarProps & DatePickerPopoverProps & Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & RefAttributes<HTMLInputElement>>;

export { datePickerClasses }

export { DatePickerPlacement }

export { DatePickerPlacementBasic }

export { DatePickerProps }

// @public (undocumented)
export const DatePickerRange: FunctionComponent<PropsType< {
view: {
default: string;
};
size: {
l: string;
m: string;
s: string;
xs: string;
};
disabled: {
true: string;
};
readOnly: {
true: string;
};
}> & DatePickerdVariationProps & {
defaultFirstDate?: Date | undefined;
defaultSecondDate?: Date | undefined;
onCommitFirstDate?: ((value: string | Date, error?: boolean | undefined, success?: boolean | undefined) => void) | undefined;
onCommitSecondDate?: ((value: string | Date, error?: boolean | undefined, success?: boolean | undefined) => void) | undefined;
} & {
label?: string | undefined;
view?: string | undefined;
disabled?: boolean | undefined;
readOnly?: boolean | undefined;
size?: string | undefined;
contentLeft?: ReactNode;
contentRight?: ReactNode;
leftHelper?: string | undefined;
dividerVariant?: "none" | "icon" | "dash" | undefined;
dividerIcon?: ReactNode;
firstValueError?: boolean | undefined;
secondValueError?: boolean | undefined;
firstValueSuccess?: boolean | undefined;
secondValueSuccess?: boolean | undefined;
firstPlaceholder?: string | undefined;
secondPlaceholder?: string | undefined;
firstTextfieldContentLeft?: ReactElement<any, string | JSXElementConstructor<any>> | undefined;
firstTextfieldContentRight?: ReactElement<any, string | JSXElementConstructor<any>> | undefined;
secondTextfieldContentLeft?: ReactElement<any, string | JSXElementConstructor<any>> | undefined;
secondTextfieldContentRight?: ReactElement<any, string | JSXElementConstructor<any>> | undefined;
firstTextfieldTextBefore?: string | undefined;
secondTextfieldTextBefore?: string | undefined;
firstTextfieldTextAfter?: string | undefined;
secondTextfieldTextAfter?: string | undefined;
onChangeFirstValue?: BaseCallbackChangeInstance | undefined;
onChangeSecondValue?: BaseCallbackChangeInstance | undefined;
onFocusFirstTextfield?: ((event: ChangeEvent<HTMLInputElement>) => void) | undefined;
onFocusSecondTextfield?: ((event: ChangeEvent<HTMLInputElement>) => void) | undefined;
onBlurFirstTextfield?: ((event: ChangeEvent<HTMLInputElement>) => void) | undefined;
onBlurSecondTextfield?: ((event: ChangeEvent<HTMLInputElement>) => void) | undefined;
} & DatePickerCalendarProps_2 & Omit<DatePickerPopoverProps, "placement"> & {
placement?: DatePickerRangePlacement | DatePickerRangePlacement[] | undefined;
isDoubleCalendar?: boolean | undefined;
} & HTMLAttributes<HTMLDivElement> & RefAttributes<RangeInputRefs>>;

export { DatePickerRangePlacement }

export { DatePickerRangeProps }

export { datePickerTokens }

export { defaultValidate }

export { DisabledProps }
Expand Down Expand Up @@ -1671,7 +1784,7 @@ firstTextfieldTextBefore: string;
secondTextfieldTextBefore: string;
dividerVariant?: "none" | undefined;
dividerIcon?: undefined;
} & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLInputElement>) | ({
} & HTMLAttributes<HTMLDivElement> & RefAttributes<RangeInputRefs>) | ({
label?: string | undefined;
leftHelper?: string | undefined;
contentLeft?: ReactNode;
Expand Down Expand Up @@ -1707,7 +1820,7 @@ dividerVariant?: "dash" | undefined;
dividerIcon?: undefined;
firstTextfieldTextBefore?: string | undefined;
secondTextfieldTextBefore?: string | undefined;
} & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLInputElement>) | ({
} & HTMLAttributes<HTMLDivElement> & RefAttributes<RangeInputRefs>) | ({
label?: string | undefined;
leftHelper?: string | undefined;
contentLeft?: ReactNode;
Expand Down Expand Up @@ -1743,7 +1856,7 @@ dividerIcon?: ReactNode;
dividerVariant?: "icon" | undefined;
firstTextfieldTextBefore?: string | undefined;
secondTextfieldTextBefore?: string | undefined;
} & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLInputElement>))>;
} & HTMLAttributes<HTMLDivElement> & RefAttributes<RangeInputRefs>))>;
export { Range_2 as Range }

export { RangeProps }
Expand Down
5 changes: 3 additions & 2 deletions packages/plasma-b2c/src/components/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
mergeConfig,
} from '@salutejs/plasma-new-hope/styled-components';
import type { CalendarBaseProps, CalendarDoubleProps } from '@salutejs/plasma-new-hope/styled-components';
import type { FC } from 'react';

import { config as baseConfig } from './CalendarBase.config';
import { config as doubleConfig } from './CalendarDouble.config';
Expand All @@ -20,8 +21,8 @@ export const CalendarBaseRange = withRange<CalendarBaseProps>(CalendarBase);
export const CalendarDoubleRange = withRange<CalendarDoubleProps>(CalendarDouble);

export const Calendar = boundCalendar({
base: CalendarBase,
base: CalendarBase as FC<CalendarBaseProps>,
baseRange: CalendarBaseRange,
double: CalendarDouble,
double: CalendarDouble as FC<CalendarDoubleProps>,
doubleRange: CalendarDoubleRange,
});
Loading
Loading