@salutejs/plasma-new-hope 0.197.0-canary.1572.11972038908.0 → 0.197.0-canary.1588.11972699441.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/store/reducer.js +2 -2
- package/cjs/components/Calendar/store/reducer.js.map +1 -1
- package/cjs/components/Typography/Body/Body.css +1 -1
- package/cjs/components/Typography/Old/Button/Button.css +1 -1
- package/cjs/components/Typography/Old/Paragraph/Paragraph.css +1 -1
- package/cjs/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/cjs/components/Typography/Old/Paragraph/Paragraph.styles.js.map +1 -1
- package/cjs/components/Typography/Old/Paragraph/{Paragraph.styles_179bahu.css → Paragraph.styles_f6q9s8.css} +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.css +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.js +7 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.js.map +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.styles.js +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.styles.js.map +1 -1
- package/{es/components/Typography/Old/Subtitle/Subtitle.styles_1plleej.css → cjs/components/Typography/Old/Subtitle/Subtitle.styles_g6d0r2.css} +1 -1
- package/cjs/components/Typography/Old/TypographyOld.js +4 -2
- package/cjs/components/Typography/Old/TypographyOld.js.map +1 -1
- package/cjs/components/Typography/Old/TypographyOld.styles.js +1 -1
- package/cjs/components/Typography/Old/TypographyOld.styles.js.map +1 -1
- package/{es/components/Typography/Old/TypographyOld.styles_17w0rtq.css → cjs/components/Typography/Old/TypographyOld.styles_168abbx.css} +1 -1
- package/cjs/components/Typography/Old/Underline/Underline.css +1 -1
- package/cjs/components/Typography/Old/Underline/Underline.styles.js +1 -1
- package/cjs/components/Typography/Old/Underline/Underline.styles.js.map +1 -1
- package/{es/components/Typography/Old/Underline/Underline.styles_vsz834.css → cjs/components/Typography/Old/Underline/Underline.styles_1x2vb5e.css} +1 -1
- package/cjs/components/Typography/Typography.js +4 -2
- package/cjs/components/Typography/Typography.js.map +1 -1
- package/cjs/components/Typography/Typography.styles.js +1 -1
- package/cjs/components/Typography/Typography.styles.js.map +1 -1
- package/cjs/components/Typography/{Typography.styles_6mr47g.css → Typography.styles_fa07dt.css} +1 -1
- package/cjs/components/Typography/tokens.js +1 -0
- package/cjs/components/Typography/tokens.js.map +1 -1
- package/cjs/index.css +5 -5
- package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/emotion/cjs/components/Calendar/store/reducer.js +2 -2
- package/emotion/cjs/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/emotion/cjs/components/Typography/Old/Subtitle/Subtitle.js +7 -1
- package/emotion/cjs/components/Typography/Old/Subtitle/Subtitle.styles.js +1 -1
- package/emotion/cjs/components/Typography/Old/TypographyOld.js +4 -2
- package/emotion/cjs/components/Typography/Old/TypographyOld.styles.js +1 -1
- package/emotion/cjs/components/Typography/Old/Underline/Underline.styles.js +1 -1
- package/emotion/cjs/components/Typography/Typography.js +4 -2
- package/emotion/cjs/components/Typography/Typography.styles.js +1 -1
- package/emotion/cjs/components/Typography/Typography.template-doc.mdx +4 -0
- package/emotion/cjs/components/Typography/tokens.js +1 -0
- package/emotion/cjs/examples/typograpy/components/Body/Body.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Dspl/Dspl.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Heading/Heading.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Body/Body.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Button/Button.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Caption/Caption.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Display/Display.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Headline/Headline.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +11 -1
- package/emotion/cjs/examples/typograpy/components/Old/Underline/Underline.stories.tsx +9 -1
- package/emotion/cjs/examples/typograpy/components/Text/Text.stories.tsx +9 -1
- package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/emotion/es/components/Calendar/store/reducer.js +2 -2
- package/emotion/es/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/emotion/es/components/Typography/Old/Subtitle/Subtitle.js +7 -1
- package/emotion/es/components/Typography/Old/Subtitle/Subtitle.styles.js +2 -2
- package/emotion/es/components/Typography/Old/TypographyOld.js +4 -2
- package/emotion/es/components/Typography/Old/TypographyOld.styles.js +1 -1
- package/emotion/es/components/Typography/Old/Underline/Underline.styles.js +1 -1
- package/emotion/es/components/Typography/Typography.js +4 -2
- package/emotion/es/components/Typography/Typography.styles.js +1 -1
- package/emotion/es/components/Typography/Typography.template-doc.mdx +4 -0
- package/emotion/es/components/Typography/tokens.js +1 -0
- package/emotion/es/examples/typograpy/components/Body/Body.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Dspl/Dspl.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Heading/Heading.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Body/Body.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Button/Button.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Caption/Caption.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Display/Display.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Headline/Headline.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +11 -1
- package/emotion/es/examples/typograpy/components/Old/Underline/Underline.stories.tsx +9 -1
- package/emotion/es/examples/typograpy/components/Text/Text.stories.tsx +9 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/store/reducer.js +2 -2
- package/es/components/Calendar/store/reducer.js.map +1 -1
- package/es/components/Typography/Body/Body.css +1 -1
- package/es/components/Typography/Old/Button/Button.css +1 -1
- package/es/components/Typography/Old/Paragraph/Paragraph.css +1 -1
- package/es/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/es/components/Typography/Old/Paragraph/Paragraph.styles.js.map +1 -1
- package/es/components/Typography/Old/Paragraph/{Paragraph.styles_179bahu.css → Paragraph.styles_f6q9s8.css} +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.css +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.js +7 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.js.map +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.styles.js +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.styles.js.map +1 -1
- package/{cjs/components/Typography/Old/Subtitle/Subtitle.styles_1plleej.css → es/components/Typography/Old/Subtitle/Subtitle.styles_g6d0r2.css} +1 -1
- package/es/components/Typography/Old/TypographyOld.js +4 -2
- package/es/components/Typography/Old/TypographyOld.js.map +1 -1
- package/es/components/Typography/Old/TypographyOld.styles.js +1 -1
- package/es/components/Typography/Old/TypographyOld.styles.js.map +1 -1
- package/{cjs/components/Typography/Old/TypographyOld.styles_17w0rtq.css → es/components/Typography/Old/TypographyOld.styles_168abbx.css} +1 -1
- package/es/components/Typography/Old/Underline/Underline.css +1 -1
- package/es/components/Typography/Old/Underline/Underline.styles.js +1 -1
- package/es/components/Typography/Old/Underline/Underline.styles.js.map +1 -1
- package/{cjs/components/Typography/Old/Underline/Underline.styles_vsz834.css → es/components/Typography/Old/Underline/Underline.styles_1x2vb5e.css} +1 -1
- package/es/components/Typography/Typography.js +4 -2
- package/es/components/Typography/Typography.js.map +1 -1
- package/es/components/Typography/Typography.styles.js +1 -1
- package/es/components/Typography/Typography.styles.js.map +1 -1
- package/es/components/Typography/{Typography.styles_6mr47g.css → Typography.styles_fa07dt.css} +1 -1
- package/es/components/Typography/tokens.js +1 -0
- package/es/components/Typography/tokens.js.map +1 -1
- package/es/index.css +5 -5
- package/package.json +2 -2
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/styled-components/cjs/components/Calendar/store/reducer.js +2 -2
- package/styled-components/cjs/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +7 -1
- package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Old/TypographyOld.js +4 -2
- package/styled-components/cjs/components/Typography/Old/TypographyOld.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Old/Underline/Underline.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Typography.js +4 -2
- package/styled-components/cjs/components/Typography/Typography.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Typography.template-doc.mdx +4 -0
- package/styled-components/cjs/components/Typography/tokens.js +1 -0
- package/styled-components/cjs/examples/typograpy/components/Body/Body.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Dspl/Dspl.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Heading/Heading.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Body/Body.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Button/Button.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Caption/Caption.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Display/Display.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Headline/Headline.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +11 -1
- package/styled-components/cjs/examples/typograpy/components/Old/Underline/Underline.stories.tsx +9 -1
- package/styled-components/cjs/examples/typograpy/components/Text/Text.stories.tsx +9 -1
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/styled-components/es/components/Calendar/store/reducer.js +2 -2
- package/styled-components/es/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +7 -1
- package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.styles.js +2 -2
- package/styled-components/es/components/Typography/Old/TypographyOld.js +4 -2
- package/styled-components/es/components/Typography/Old/TypographyOld.styles.js +1 -1
- package/styled-components/es/components/Typography/Old/Underline/Underline.styles.js +1 -1
- package/styled-components/es/components/Typography/Typography.js +4 -2
- package/styled-components/es/components/Typography/Typography.styles.js +1 -1
- package/styled-components/es/components/Typography/Typography.template-doc.mdx +4 -0
- package/styled-components/es/components/Typography/tokens.js +1 -0
- package/styled-components/es/examples/typograpy/components/Body/Body.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Dspl/Dspl.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Heading/Heading.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Body/Body.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Button/Button.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Caption/Caption.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Display/Display.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Headline/Headline.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +11 -1
- package/styled-components/es/examples/typograpy/components/Old/Underline/Underline.stories.tsx +9 -1
- package/styled-components/es/examples/typograpy/components/Text/Text.stories.tsx +9 -1
- package/types/components/Calendar/store/reducer.d.ts +1 -1
- package/types/components/Calendar/store/reducer.d.ts.map +1 -1
- package/types/components/Typography/Body/Body.d.ts +2 -0
- package/types/components/Typography/Body/Body.d.ts.map +1 -1
- package/types/components/Typography/Dspl/Dspl.d.ts +2 -0
- package/types/components/Typography/Dspl/Dspl.d.ts.map +1 -1
- package/types/components/Typography/Heading/Heading.d.ts +2 -0
- package/types/components/Typography/Heading/Heading.d.ts.map +1 -1
- package/types/components/Typography/Old/Paragraph/Paragraph.styles.d.ts.map +1 -1
- package/types/components/Typography/Old/Subtitle/Subtitle.d.ts.map +1 -1
- package/types/components/Typography/Old/Subtitle/Subtitle.styles.d.ts.map +1 -1
- package/types/components/Typography/Old/TypographyOld.d.ts.map +1 -1
- package/types/components/Typography/Old/TypographyOld.styles.d.ts.map +1 -1
- package/types/components/Typography/Old/Underline/Underline.styles.d.ts.map +1 -1
- package/types/components/Typography/Text/Text.d.ts +2 -0
- package/types/components/Typography/Text/Text.d.ts.map +1 -1
- package/types/components/Typography/Typography.d.ts +1 -0
- package/types/components/Typography/Typography.d.ts.map +1 -1
- package/types/components/Typography/Typography.styles.d.ts.map +1 -1
- package/types/components/Typography/Typography.types.d.ts +1 -0
- package/types/components/Typography/Typography.types.d.ts.map +1 -1
- package/types/components/Typography/tokens.d.ts +1 -0
- package/types/components/Typography/tokens.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Editable/Editable.d.ts +4 -0
- package/types/examples/plasma_b2c/components/Editable/Editable.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Editable/Editable.d.ts +4 -0
- package/types/examples/plasma_web/components/Editable/Editable.d.ts.map +1 -1
- package/types/examples/typograpy/components/Body/Body.d.ts +1 -0
- package/types/examples/typograpy/components/Body/Body.d.ts.map +1 -1
- package/types/examples/typograpy/components/Dspl/Dspl.d.ts +1 -0
- package/types/examples/typograpy/components/Dspl/Dspl.d.ts.map +1 -1
- package/types/examples/typograpy/components/Heading/Heading.d.ts +1 -0
- package/types/examples/typograpy/components/Heading/Heading.d.ts.map +1 -1
- package/types/examples/typograpy/components/Text/Text.d.ts +1 -0
- package/types/examples/typograpy/components/Text/Text.d.ts.map +1 -1
@@ -66,7 +66,7 @@ var calendarBaseRoot = function calendarBaseRoot(Root) {
|
|
66
66
|
_useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
|
67
67
|
outOfRangeKey = _useState8[0],
|
68
68
|
setOutOfRangeKey = _useState8[1];
|
69
|
-
var _useReducer = React.useReducer(reducer.reducer, reducer.getInitialState(value,
|
69
|
+
var _useReducer = React.useReducer(reducer.reducer, reducer.getInitialState(value, type)),
|
70
70
|
_useReducer2 = _rollupPluginBabelHelpers.slicedToArray(_useReducer, 2),
|
71
71
|
state = _useReducer2[0],
|
72
72
|
dispatch = _useReducer2[1];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarBase.js","sources":["../../../../src/components/Calendar/CalendarBase/CalendarBase.tsx"],"sourcesContent":["import React, {\n useCallback,\n useMemo,\n useReducer,\n useState,\n KeyboardEvent,\n HTMLAttributes,\n forwardRef,\n useEffect,\n} from 'react';\n\nimport type { Calendar, CalendarConfigProps, DateObject } from '../Calendar.types';\nimport { getInitialState, reducer, sizeMap } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { isValueUpdate } from '../utils';\nimport { useKeyNavigation, useCalendarNavigation, useCalendarDateChange } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarQuarters, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { IsOutOfRange, StyledCalendar } from './CalendarBase.styles';\n\nexport type CalendarBaseProps = Calendar & CalendarConfigProps;\n\n/**\n * Компонент календаря.\n */\nexport const calendarBaseRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarBaseProps>(\n (\n {\n value: externalValue,\n min,\n max,\n includeEdgeDates,\n type = 'Days',\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n onChangeValue,\n locale = 'ru',\n ...rest\n },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n\n const [hoveredItem, setHoveredItem] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, min, type));\n\n const { date, calendarState, startYear, size } = state;\n\n const { handleNext, handlePrev } = useCalendarNavigation({\n calendarState,\n date,\n dispatch,\n });\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n size,\n calendarState,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const {\n handleOnChangeDay,\n handleOnChangeMonth,\n handleOnChangeQuarter,\n handleOnChangeYear,\n handleUpdateCalendarState,\n } = useCalendarDateChange({ type, onChangeValue, onSelectIndexes, dispatch });\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n useEffect(() => {\n if (prevType !== calendarState) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState, size: sizeMap[calendarState].single },\n });\n\n setPrevType(calendarState);\n }\n }, [calendarState]);\n\n useEffect(() => {\n if (!prevValue) {\n setPrevValue(value);\n }\n\n if ((value && prevValue && isValueUpdate(value, prevValue)) || (value && !prevValue)) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n\n setPrevValue(value);\n }\n }, [value, prevValue]);\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n size={rest.size}\n firstDate={date}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n locale={locale}\n />\n {calendarState === CalendarState.Days && (\n <CalendarDays\n value={externalValue}\n date={date}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onSetSelected={onSelectIndexes}\n onHoverDay={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n />\n )}\n {calendarState === CalendarState.Months && (\n <CalendarMonths\n value={externalValue}\n date={date}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n />\n )}\n {calendarState === CalendarState.Quarters && (\n <CalendarQuarters\n value={externalValue}\n date={date}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n {calendarState === CalendarState.Years && (\n <CalendarYears\n value={externalValue}\n date={date}\n startYear={startYear}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n </Root>\n );\n },\n );\n\nexport const calendarBaseConfig = {\n name: 'CalendarBase',\n tag: 'div',\n layout: calendarBaseRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarBaseRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","includeEdgeDates","_ref$type","type","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","onChangeValue","_ref$locale","locale","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredItem","setHoveredItem","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","_useCalendarNavigatio","useCalendarNavigation","handleNext","handlePrev","_useKeyNavigation","useKeyNavigation","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","_useCalendarDateChang","useCalendarDateChange","handleOnChangeDay","handleOnChangeMonth","handleOnChangeQuarter","handleOnChangeYear","handleUpdateCalendarState","handleKeyDown","useCallback","event","previousState","Number","useEffect","ActionType","UPDATE_CALENDAR_STATE","payload","sizeMap","single","isValueUpdate","UPDATE_DATE","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","firstDate","onUpdateCalendarState","CalendarState","Days","CalendarDays","hoveredDay","onChangeDay","onSetSelected","onHoverDay","Months","CalendarMonths","hoveredMonth","onChangeMonth","onHoverMonth","Quarters","CalendarQuarters","hoveredQuarter","onChangeQuarter","onHoverQuarter","Years","CalendarYears","hoveredYear","onChangeYear","onHoverYear","calendarBaseConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC5FC,gBAAU,CACN,UAAAC,IAAA,EAmBIC,YAAY,EACX;AAAA,IAAA,IAlBUC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MACLC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,gBAAgB,GAAAN,IAAA,CAAhBM,gBAA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"}
|
1
|
+
{"version":3,"file":"CalendarBase.js","sources":["../../../../src/components/Calendar/CalendarBase/CalendarBase.tsx"],"sourcesContent":["import React, {\n useCallback,\n useMemo,\n useReducer,\n useState,\n KeyboardEvent,\n HTMLAttributes,\n forwardRef,\n useEffect,\n} from 'react';\n\nimport type { Calendar, CalendarConfigProps, DateObject } from '../Calendar.types';\nimport { getInitialState, reducer, sizeMap } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { isValueUpdate } from '../utils';\nimport { useKeyNavigation, useCalendarNavigation, useCalendarDateChange } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarQuarters, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { IsOutOfRange, StyledCalendar } from './CalendarBase.styles';\n\nexport type CalendarBaseProps = Calendar & CalendarConfigProps;\n\n/**\n * Компонент календаря.\n */\nexport const calendarBaseRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarBaseProps>(\n (\n {\n value: externalValue,\n min,\n max,\n includeEdgeDates,\n type = 'Days',\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n onChangeValue,\n locale = 'ru',\n ...rest\n },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n\n const [hoveredItem, setHoveredItem] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, type));\n\n const { date, calendarState, startYear, size } = state;\n\n const { handleNext, handlePrev } = useCalendarNavigation({\n calendarState,\n date,\n dispatch,\n });\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n size,\n calendarState,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const {\n handleOnChangeDay,\n handleOnChangeMonth,\n handleOnChangeQuarter,\n handleOnChangeYear,\n handleUpdateCalendarState,\n } = useCalendarDateChange({ type, onChangeValue, onSelectIndexes, dispatch });\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n useEffect(() => {\n if (prevType !== calendarState) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState, size: sizeMap[calendarState].single },\n });\n\n setPrevType(calendarState);\n }\n }, [calendarState]);\n\n useEffect(() => {\n if (!prevValue) {\n setPrevValue(value);\n }\n\n if ((value && prevValue && isValueUpdate(value, prevValue)) || (value && !prevValue)) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n\n setPrevValue(value);\n }\n }, [value, prevValue]);\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n size={rest.size}\n firstDate={date}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n locale={locale}\n />\n {calendarState === CalendarState.Days && (\n <CalendarDays\n value={externalValue}\n date={date}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onSetSelected={onSelectIndexes}\n onHoverDay={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n />\n )}\n {calendarState === CalendarState.Months && (\n <CalendarMonths\n value={externalValue}\n date={date}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n />\n )}\n {calendarState === CalendarState.Quarters && (\n <CalendarQuarters\n value={externalValue}\n date={date}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n {calendarState === CalendarState.Years && (\n <CalendarYears\n value={externalValue}\n date={date}\n startYear={startYear}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={onKeyDown}\n outerRefs={outerRefs}\n />\n )}\n </Root>\n );\n },\n );\n\nexport const calendarBaseConfig = {\n name: 'CalendarBase',\n tag: 'div',\n layout: calendarBaseRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarBaseRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","includeEdgeDates","_ref$type","type","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","onChangeValue","_ref$locale","locale","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredItem","setHoveredItem","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","_useCalendarNavigatio","useCalendarNavigation","handleNext","handlePrev","_useKeyNavigation","useKeyNavigation","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","_useCalendarDateChang","useCalendarDateChange","handleOnChangeDay","handleOnChangeMonth","handleOnChangeQuarter","handleOnChangeYear","handleUpdateCalendarState","handleKeyDown","useCallback","event","previousState","Number","useEffect","ActionType","UPDATE_CALENDAR_STATE","payload","sizeMap","single","isValueUpdate","UPDATE_DATE","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","firstDate","onUpdateCalendarState","CalendarState","Days","CalendarDays","hoveredDay","onChangeDay","onSetSelected","onHoverDay","Months","CalendarMonths","hoveredMonth","onChangeMonth","onHoverMonth","Quarters","CalendarQuarters","hoveredQuarter","onChangeQuarter","onHoverQuarter","Years","CalendarYears","hoveredYear","onChangeYear","onHoverYear","calendarBaseConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC5FC,gBAAU,CACN,UAAAC,IAAA,EAmBIC,YAAY,EACX;AAAA,IAAA,IAlBUC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MACLC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GA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S;AACf1E,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -69,7 +69,7 @@ var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
|
69
69
|
_useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
|
70
70
|
outOfRangeKey = _useState8[0],
|
71
71
|
setOutOfRangeKey = _useState8[1];
|
72
|
-
var _useReducer = React.useReducer(reducer.reducer, reducer.getInitialState(value,
|
72
|
+
var _useReducer = React.useReducer(reducer.reducer, reducer.getInitialState(value, type, true)),
|
73
73
|
_useReducer2 = _rollupPluginBabelHelpers.slicedToArray(_useReducer, 2),
|
74
74
|
state = _useReducer2[0],
|
75
75
|
dispatch = _useReducer2[1];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarDouble.js","sources":["../../../../src/components/Calendar/CalendarDouble/CalendarDouble.tsx"],"sourcesContent":["import React, {\n useState,\n useCallback,\n useMemo,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n useEffect,\n useReducer,\n} from 'react';\n\nimport type { Calendar, CalendarConfigProps, DateObject } from '../Calendar.types';\nimport { YEAR_RENDER_COUNT, getNextDate, isValueUpdate } from '../utils';\nimport { useKeyNavigation, useCalendarNavigation, useCalendarDateChange } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarQuarters, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines/types';\nimport { getInitialState, reducer, sizeMap } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { IsOutOfRange } from '../CalendarBase/CalendarBase.styles';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble.styles';\n\nexport type CalendarDoubleProps = Calendar & CalendarConfigProps;\n\n/**\n * Компонент двойного календаря.\n */\nexport const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarDoubleProps>(\n (\n {\n value: externalValue,\n min,\n max,\n includeEdgeDates,\n type = 'Days',\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n onChangeValue,\n locale = 'ru',\n ...rest\n },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n\n const [hoveredItem, setHoveredItem] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, min, type, true));\n\n const { date, calendarState, startYear, size } = state;\n\n const [firstDate, setFirstDate] = useState<DateObject>(date);\n const [secondDate, setSecondDate] = useState<DateObject>(date);\n\n const { handleNext, handlePrev } = useCalendarNavigation({\n calendarState,\n date,\n dispatch,\n });\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n isDouble: true,\n size,\n calendarState,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const {\n handleOnChangeDay,\n handleOnChangeMonth,\n handleOnChangeQuarter,\n handleOnChangeYear,\n handleUpdateCalendarState,\n } = useCalendarDateChange({ type, onChangeValue, onSelectIndexes, dispatch });\n\n const updateSecondDate = () => {\n if (calendarState === CalendarState.Days) {\n const [nextYear, nextMonthIndex] = getNextDate(date.year, date.monthIndex);\n setSecondDate({ year: nextYear, monthIndex: nextMonthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n setSecondDate({ year: date.year + 1, monthIndex: date.monthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Years) {\n setSecondDate({ year: startYear + YEAR_RENDER_COUNT, monthIndex: date.monthIndex, day: date.day });\n }\n };\n\n const getBoundaryDates = () => {\n // NOTE: Если установить индекс дня равным \"0\", то берется последнее число предыдущего месяца\n if (calendarState === CalendarState.Days) {\n return [\n new Date(firstDate.year, firstDate.monthIndex, 1),\n new Date(secondDate.year, secondDate.monthIndex + 1, 0),\n ];\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n return [new Date(firstDate.year, 0), new Date(secondDate.year, 12, 0)];\n }\n\n const endVisibleYear = startYear + YEAR_RENDER_COUNT * 2 - 1;\n return [new Date(startYear, 0), new Date(endVisibleYear, 11)];\n };\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n useEffect(() => {\n if (prevType !== calendarState) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState, size: sizeMap[calendarState].double },\n });\n\n setPrevType(calendarState);\n }\n }, [calendarState]);\n\n useEffect(() => {\n if (!prevValue) {\n setPrevValue(value);\n }\n\n if ((value && prevValue && isValueUpdate(value, prevValue)) || (value && !prevValue)) {\n const [minVisibleDate, maxVisibleDate] = getBoundaryDates();\n\n if (value > maxVisibleDate || value < minVisibleDate) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n }\n\n setPrevValue(value);\n }\n }, [value, prevValue]);\n\n useEffect(() => {\n setFirstDate(date);\n\n updateSecondDate();\n }, [date, calendarState]);\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n isDouble\n size={rest.size}\n firstDate={firstDate}\n secondDate={secondDate}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n locale={locale}\n />\n\n <StyledWrapper>\n {calendarState === CalendarState.Days && (\n <>\n <CalendarDays\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarDays\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Months && (\n <>\n <CalendarMonths\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarMonths\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Quarters && (\n <>\n <CalendarQuarters\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarQuarters\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Years && (\n <>\n <CalendarYears\n value={externalValue}\n date={firstDate}\n startYear={startYear}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarYears\n value={externalValue}\n date={secondDate}\n startYear={startYear + YEAR_RENDER_COUNT}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n </StyledWrapper>\n </Root>\n );\n },\n );\n\nexport const calendarDoubleConfig = {\n name: 'CalendarDouble',\n tag: 'div',\n layout: calendarDoubleRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarDoubleRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","includeEdgeDates","_ref$type","type","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","onChangeValue","_ref$locale","locale","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredItem","setHoveredItem","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","_useState9","_useState10","firstDate","setFirstDate","_useState11","_useState12","secondDate","setSecondDate","_useCalendarNavigatio","useCalendarNavigation","handleNext","handlePrev","_useKeyNavigation","useKeyNavigation","isDouble","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","_useCalendarDateChang","useCalendarDateChange","handleOnChangeDay","handleOnChangeMonth","handleOnChangeQuarter","handleOnChangeYear","handleUpdateCalendarState","updateSecondDate","CalendarState","Days","_getNextDate","getNextDate","year","monthIndex","_getNextDate2","nextYear","nextMonthIndex","day","Months","Quarters","Years","YEAR_RENDER_COUNT","getBoundaryDates","Date","endVisibleYear","handleKeyDown","useCallback","event","previousState","Number","useEffect","ActionType","UPDATE_CALENDAR_STATE","payload","sizeMap","isValueUpdate","_getBoundaryDates","_getBoundaryDates2","minVisibleDate","maxVisibleDate","UPDATE_DATE","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","onUpdateCalendarState","StyledWrapper","Fragment","CalendarDays","hoveredDay","onChangeDay","onHoverDay","onSetSelected","_StyledSeparator","StyledSeparator","isSecond","CalendarMonths","hoveredMonth","onChangeMonth","onHoverMonth","_StyledSeparator2","CalendarQuarters","hoveredQuarter","onChangeQuarter","onHoverQuarter","_StyledSeparator3","CalendarYears","hoveredYear","onChangeYear","onHoverYear","_StyledSeparator4","calendarDoubleConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC9FC,gBAAU,CACN,UAAAC,IAAA,EAmBIC,YAAY,EACX;AAAA,IAAA,IAlBUC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MACLC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,gBAAgB,GAAAN,IAAA,CAAhBM,gBAAgB;MAAAC,SAAA,GAAAP,IAAA,CAChBQ,IAAI;AAAJA,MAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;MACbE,SAAS,GAAAT,IAAA,CAATS,SAAS;MACTC,YAAY,GAAAV,IAAA,CAAZU,YAAY;MACZC,cAAc,GAAAX,IAAA,CAAdW,cAAc;MACdC,iBAAiB,GAAAZ,IAAA,CAAjBY,iBAAiB;MACjBC,gBAAgB,GAAAb,IAAA,CAAhBa,gBAAgB;MAChBC,mBAAmB,GAAAd,IAAA,CAAnBc,mBAAmB;MACnBC,aAAa,GAAAf,IAAA,CAAbe,aAAa;MACbC,gBAAgB,GAAAhB,IAAA,CAAhBgB,gBAAgB;MAChBC,aAAa,GAAAjB,IAAA,CAAbiB,aAAa;MAAAC,WAAA,GAAAlB,IAAA,CACbmB,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,WAAA;AACVE,MAAAA,IAAI,GAAAC,iDAAA,CAAArB,IAAA,EAAAsB,SAAA,CAAA,CAAA;IAIX,IAAAC,QAA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2C,MAAAA,SAAS,EAAE6B,aAAc;AACzB3B,MAAAA,SAAS,EAAEA,SAAU;MACrBP,QAAQ,EAAA,IAAA;MACRoE,QAAQ,EAAA,IAAA;KACX,CACH,CAEK,CACb,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMgB,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEnK,kBAAkB;AAC1BoK,EAAAA,IAAI,EAAEC,oCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNH,IAAAA,IAAI,EAAE,SAAS;AACf1G,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
1
|
+
{"version":3,"file":"CalendarDouble.js","sources":["../../../../src/components/Calendar/CalendarDouble/CalendarDouble.tsx"],"sourcesContent":["import React, {\n useState,\n useCallback,\n useMemo,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n useEffect,\n useReducer,\n} from 'react';\n\nimport type { Calendar, CalendarConfigProps, DateObject } from '../Calendar.types';\nimport { YEAR_RENDER_COUNT, getNextDate, isValueUpdate } from '../utils';\nimport { useKeyNavigation, useCalendarNavigation, useCalendarDateChange } from '../hooks';\nimport { CalendarDays, CalendarHeader, CalendarMonths, CalendarQuarters, CalendarYears } from '../ui';\nimport { RootProps } from '../../../engines/types';\nimport { getInitialState, reducer, sizeMap } from '../store/reducer';\nimport { ActionType, CalendarState } from '../store/types';\nimport { IsOutOfRange } from '../CalendarBase/CalendarBase.styles';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble.styles';\n\nexport type CalendarDoubleProps = Calendar & CalendarConfigProps;\n\n/**\n * Компонент двойного календаря.\n */\nexport const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<HTMLDivElement>>) =>\n forwardRef<HTMLDivElement, CalendarDoubleProps>(\n (\n {\n value: externalValue,\n min,\n max,\n includeEdgeDates,\n type = 'Days',\n eventList,\n disabledList,\n eventMonthList,\n disabledMonthList,\n eventQuarterList,\n disabledQuarterList,\n eventYearList,\n disabledYearList,\n onChangeValue,\n locale = 'ru',\n ...rest\n },\n outerRootRef,\n ) => {\n const [firstValue, secondValue] = useMemo(\n () => (Array.isArray(externalValue) ? externalValue : [externalValue]),\n [externalValue],\n );\n const value = secondValue || firstValue;\n\n const [hoveredItem, setHoveredItem] = useState<DateObject | undefined>();\n const [prevType, setPrevType] = useState(type);\n const [prevValue, setPrevValue] = useState(value);\n const [outOfRangeKey, setOutOfRangeKey] = useState<number>(0);\n\n const [state, dispatch] = useReducer(reducer, getInitialState(value, type, true));\n\n const { date, calendarState, startYear, size } = state;\n\n const [firstDate, setFirstDate] = useState<DateObject>(date);\n const [secondDate, setSecondDate] = useState<DateObject>(date);\n\n const { handleNext, handlePrev } = useCalendarNavigation({\n calendarState,\n date,\n dispatch,\n });\n\n const [selectIndexes, onKeyDown, onSelectIndexes, outerRefs, isOutOfRange] = useKeyNavigation({\n isDouble: true,\n size,\n calendarState,\n onNext: handleNext,\n onPrev: handlePrev,\n });\n\n const {\n handleOnChangeDay,\n handleOnChangeMonth,\n handleOnChangeQuarter,\n handleOnChangeYear,\n handleUpdateCalendarState,\n } = useCalendarDateChange({ type, onChangeValue, onSelectIndexes, dispatch });\n\n const updateSecondDate = () => {\n if (calendarState === CalendarState.Days) {\n const [nextYear, nextMonthIndex] = getNextDate(date.year, date.monthIndex);\n setSecondDate({ year: nextYear, monthIndex: nextMonthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n setSecondDate({ year: date.year + 1, monthIndex: date.monthIndex, day: date.day });\n }\n\n if (calendarState === CalendarState.Years) {\n setSecondDate({ year: startYear + YEAR_RENDER_COUNT, monthIndex: date.monthIndex, day: date.day });\n }\n };\n\n const getBoundaryDates = () => {\n // NOTE: Если установить индекс дня равным \"0\", то берется последнее число предыдущего месяца\n if (calendarState === CalendarState.Days) {\n return [\n new Date(firstDate.year, firstDate.monthIndex, 1),\n new Date(secondDate.year, secondDate.monthIndex + 1, 0),\n ];\n }\n\n if (calendarState === CalendarState.Months || calendarState === CalendarState.Quarters) {\n return [new Date(firstDate.year, 0), new Date(secondDate.year, 12, 0)];\n }\n\n const endVisibleYear = startYear + YEAR_RENDER_COUNT * 2 - 1;\n return [new Date(startYear, 0), new Date(endVisibleYear, 11)];\n };\n\n // Изменяем ключ каждый раз как пытаемся перейти на даты которые находятся за пределами min/max ограничений.\n // Это необходимо для того чтобы screen-reader корректно озвучивал уведомление aria-live=\"assertive\"\n // о том что нет доступных дат\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setOutOfRangeKey((previousState) => Number(!previousState));\n\n onKeyDown(event);\n },\n [onKeyDown],\n );\n\n useEffect(() => {\n if (prevType !== calendarState) {\n dispatch({\n type: ActionType.UPDATE_CALENDAR_STATE,\n payload: { calendarState, size: sizeMap[calendarState].double },\n });\n\n setPrevType(calendarState);\n }\n }, [calendarState]);\n\n useEffect(() => {\n if (!prevValue) {\n setPrevValue(value);\n }\n\n if ((value && prevValue && isValueUpdate(value, prevValue)) || (value && !prevValue)) {\n const [minVisibleDate, maxVisibleDate] = getBoundaryDates();\n\n if (value > maxVisibleDate || value < minVisibleDate) {\n dispatch({\n type: ActionType.UPDATE_DATE,\n payload: { value },\n });\n }\n\n setPrevValue(value);\n }\n }, [value, prevValue]);\n\n useEffect(() => {\n setFirstDate(date);\n\n updateSecondDate();\n }, [date, calendarState]);\n\n return (\n <Root ref={outerRootRef} aria-label=\"Выбор даты\" {...rest}>\n {isOutOfRange && (\n <IsOutOfRange\n key={outOfRangeKey}\n aria-atomic=\"true\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-relevant=\"additions\"\n >\n Далее нет доступных дат.\n </IsOutOfRange>\n )}\n <CalendarHeader\n isDouble\n size={rest.size}\n firstDate={firstDate}\n secondDate={secondDate}\n startYear={startYear}\n type={calendarState}\n onPrev={handlePrev}\n onNext={handleNext}\n onUpdateCalendarState={handleUpdateCalendarState}\n locale={locale}\n />\n\n <StyledWrapper>\n {calendarState === CalendarState.Days && (\n <>\n <CalendarDays\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarDays\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventList}\n disabledList={disabledList}\n includeEdgeDates={includeEdgeDates}\n hoveredDay={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeDay={handleOnChangeDay}\n onHoverDay={setHoveredItem}\n onSetSelected={onSelectIndexes}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Months && (\n <>\n <CalendarMonths\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n />\n <StyledSeparator />\n <CalendarMonths\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventMonthList}\n disabledList={disabledMonthList}\n hoveredMonth={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeMonth={handleOnChangeMonth}\n onSetSelected={onSelectIndexes}\n onHoverMonth={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n locale={locale}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Quarters && (\n <>\n <CalendarQuarters\n value={externalValue}\n date={firstDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarQuarters\n value={externalValue}\n date={secondDate}\n min={min}\n max={max}\n eventList={eventQuarterList}\n disabledList={disabledQuarterList}\n hoveredQuarter={hoveredItem}\n selectIndexes={selectIndexes}\n onChangeQuarter={handleOnChangeQuarter}\n onSetSelected={onSelectIndexes}\n onHoverQuarter={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n {calendarState === CalendarState.Years && (\n <>\n <CalendarYears\n value={externalValue}\n date={firstDate}\n startYear={startYear}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n />\n <StyledSeparator />\n <CalendarYears\n value={externalValue}\n date={secondDate}\n startYear={startYear + YEAR_RENDER_COUNT}\n selectIndexes={selectIndexes}\n min={min}\n max={max}\n eventList={eventYearList}\n disabledList={disabledYearList}\n hoveredYear={hoveredItem}\n onChangeYear={handleOnChangeYear}\n onSetSelected={onSelectIndexes}\n onHoverYear={setHoveredItem}\n onKeyDown={handleKeyDown}\n outerRefs={outerRefs}\n isDouble\n isSecond\n />\n </>\n )}\n </StyledWrapper>\n </Root>\n );\n },\n );\n\nexport const calendarDoubleConfig = {\n name: 'CalendarDouble',\n tag: 'div',\n layout: calendarDoubleRoot,\n base: StyledCalendar,\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["calendarDoubleRoot","Root","forwardRef","_ref","outerRootRef","externalValue","value","min","max","includeEdgeDates","_ref$type","type","eventList","disabledList","eventMonthList","disabledMonthList","eventQuarterList","disabledQuarterList","eventYearList","disabledYearList","onChangeValue","_ref$locale","locale","rest","_objectWithoutProperties","_excluded","_useMemo","useMemo","Array","isArray","_useMemo2","_slicedToArray","firstValue","secondValue","_useState","useState","_useState2","hoveredItem","setHoveredItem","_useState3","_useState4","prevType","setPrevType","_useState5","_useState6","prevValue","setPrevValue","_useState7","_useState8","outOfRangeKey","setOutOfRangeKey","_useReducer","useReducer","reducer","getInitialState","_useReducer2","state","dispatch","date","calendarState","startYear","size","_useState9","_useState10","firstDate","setFirstDate","_useState11","_useState12","secondDate","setSecondDate","_useCalendarNavigatio","useCalendarNavigation","handleNext","handlePrev","_useKeyNavigation","useKeyNavigation","isDouble","onNext","onPrev","_useKeyNavigation2","selectIndexes","onKeyDown","onSelectIndexes","outerRefs","isOutOfRange","_useCalendarDateChang","useCalendarDateChange","handleOnChangeDay","handleOnChangeMonth","handleOnChangeQuarter","handleOnChangeYear","handleUpdateCalendarState","updateSecondDate","CalendarState","Days","_getNextDate","getNextDate","year","monthIndex","_getNextDate2","nextYear","nextMonthIndex","day","Months","Quarters","Years","YEAR_RENDER_COUNT","getBoundaryDates","Date","endVisibleYear","handleKeyDown","useCallback","event","previousState","Number","useEffect","ActionType","UPDATE_CALENDAR_STATE","payload","sizeMap","isValueUpdate","_getBoundaryDates","_getBoundaryDates2","minVisibleDate","maxVisibleDate","UPDATE_DATE","React","createElement","_extends","ref","IsOutOfRange","key","role","CalendarHeader","onUpdateCalendarState","StyledWrapper","Fragment","CalendarDays","hoveredDay","onChangeDay","onHoverDay","onSetSelected","_StyledSeparator","StyledSeparator","isSecond","CalendarMonths","hoveredMonth","onChangeMonth","onHoverMonth","_StyledSeparator2","CalendarQuarters","hoveredQuarter","onChangeQuarter","onHoverQuarter","_StyledSeparator3","CalendarYears","hoveredYear","onChangeYear","onHoverYear","_StyledSeparator4","calendarDoubleConfig","name","tag","layout","base","StyledCalendar","variations","view","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA+D,EAAA;AAAA,EAAA,oBAC9FC,gBAAU,CACN,UAAAC,IAAA,EAmBIC,YAAY,EACX;AAAA,IAAA,IAlBUC,aAAa,GAAAF,IAAA,CAApBG,KAAK;MACLC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;MACHC,GAAG,GAAAL,IAAA,CAAHK,GAAG;MACHC,gBAAgB,GAAAN,IAAA,CAAhBM,gBAAgB;MAAAC,SAAA,GAAAP,IAAA,CAChBQ,IAAI;AAAJA,MAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;MACbE,SAAS,GAAAT,IAAA,CAATS,SAAS;MACTC,YAAY,GAAAV,IAAA,CAAZU,YAAY;MACZC,cAAc,GAAAX,IAAA,CAAdW,cAAc;MACdC,iBAAiB,GAAAZ,IAAA,CAAjBY,iBAAiB;MACjBC,gBAAgB,GAAAb,IAAA,CAAhBa,gBAAgB;MAChBC,mBAAmB,GAAAd,IAAA,CAAnBc,mBAAmB;MACnBC,aAAa,GAAAf,IAAA,CAAbe,aAAa;MACbC,gBAAgB,GAAAhB,IAAA,CAAhBgB,gBAAgB;MAChBC,aAAa,GAAAjB,IAAA,CAAbiB,aAAa;MAAAC,WAAA,GAAAlB,IAAA,CACbmB,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA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AmB;AACjCmD,MAAAA,aAAa,EAAE3D,eAAgB;AAC/B4E,MAAAA,WAAW,EAAExH,cAAe;AAC5B2C,MAAAA,SAAS,EAAE6B,aAAc;AACzB3B,MAAAA,SAAS,EAAEA,SAAU;MACrBP,QAAQ,EAAA,IAAA;MACRoE,QAAQ,EAAA,IAAA;KACX,CACH,CAEK,CACb,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMgB,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEnK,kBAAkB;AAC1BoK,EAAAA,IAAI,EAAEC,oCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNH,IAAAA,IAAI,EAAE,SAAS;AACf1G,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -24,8 +24,8 @@ var sizeMap = {
|
|
24
24
|
"double": [3, 1]
|
25
25
|
}
|
26
26
|
};
|
27
|
-
var getInitialState = function getInitialState(value,
|
28
|
-
var initDate = value ||
|
27
|
+
var getInitialState = function getInitialState(value, calendarState, isDouble) {
|
28
|
+
var initDate = value || new Date();
|
29
29
|
var date = calendarGridHelper.getDateFromValue(initDate);
|
30
30
|
var resSize = isDouble ? sizeMap[calendarState]["double"] : sizeMap[calendarState].single;
|
31
31
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reducer.js","sources":["../../../../src/components/Calendar/store/reducer.ts"],"sourcesContent":["import { getDateFromValue, getNextDate, getPrevDate, getStartYear } from '../utils';\n\nimport { CalendarStateType, Action, ActionType, InitialState, SizeMap } from './types';\n\nexport const sizeMap: SizeMap = {\n Days: {\n single: [5, 6],\n double: [11, 6],\n },\n Months: {\n single: [3, 2],\n double: [7, 2],\n },\n Years: {\n single: [3, 2],\n double: [7, 2],\n },\n Quarters: {\n single: [1, 1],\n double: [3, 1],\n },\n};\n\nexport const getInitialState = (\n value: Date | undefined,\n min: Date | undefined,\n calendarState: CalendarStateType,\n isDouble?: boolean,\n): InitialState => {\n const initDate = value || min || new Date();\n const date = getDateFromValue(initDate);\n\n const resSize: [number, number] = isDouble ? sizeMap[calendarState].double : sizeMap[calendarState].single;\n\n return {\n date: { ...date, day: value !== undefined ? date.day : 0 },\n startYear: getStartYear(date.year),\n calendarState,\n size: resSize,\n };\n};\n\nexport const reducer = (state: InitialState, action: Action): InitialState => {\n switch (action.type) {\n case ActionType.PREVIOUS_MONTH: {\n const { year, monthIndex } = action.payload;\n const [prevYear, prevMonthIndex] = getPrevDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: prevMonthIndex,\n year: prevYear,\n },\n };\n }\n case ActionType.NEXT_MONTH: {\n const { monthIndex, year } = action.payload;\n const [nextYear, nextMonthIndex] = getNextDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: nextMonthIndex,\n year: nextYear,\n },\n };\n }\n case ActionType.PREVIOUS_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year - step,\n },\n };\n }\n case ActionType.NEXT_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year + step,\n },\n };\n }\n case ActionType.PREVIOUS_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - yearsCount,\n };\n }\n case ActionType.NEXT_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + yearsCount,\n };\n }\n case ActionType.UPDATE_DATE: {\n const { value } = action.payload;\n const date = getDateFromValue(value);\n const startYear = getStartYear(value.getFullYear());\n\n return {\n ...state,\n date,\n startYear,\n };\n }\n case ActionType.UPDATE_MONTH: {\n const { calendarState, monthIndex, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex,\n year: state.date.year,\n },\n };\n }\n case ActionType.UPDATE_YEAR: {\n const { calendarState, year, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year,\n },\n };\n }\n case ActionType.UPDATE_CALENDAR_STATE: {\n const { calendarState, size } = action.payload;\n\n return {\n ...state,\n calendarState,\n size: size || state.size,\n };\n }\n default:\n return state;\n }\n};\n"],"names":["sizeMap","Days","single","Months","Years","Quarters","getInitialState","value","min","calendarState","isDouble","initDate","Date","date","getDateFromValue","resSize","_objectSpread","day","undefined","startYear","getStartYear","year","size","reducer","state","action","type","ActionType","PREVIOUS_MONTH","_action$payload","payload","monthIndex","_getPrevDate","getPrevDate","_getPrevDate2","_slicedToArray","prevYear","prevMonthIndex","NEXT_MONTH","_action$payload2","_getNextDate","getNextDate","_getNextDate2","nextYear","nextMonthIndex","PREVIOUS_YEAR","step","NEXT_YEAR","PREVIOUS_START_YEAR","yearsCount","NEXT_START_YEAR","UPDATE_DATE","getFullYear","UPDATE_MONTH","_action$payload3","UPDATE_YEAR","_action$payload4","UPDATE_CALENDAR_STATE","_action$payload5"],"mappings":";;;;;;;;AAIO,IAAMA,OAAgB,GAAG;AAC5BC,EAAAA,IAAI,EAAE;AACFC,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,EAAE,EAAE,CAAC,CAAA;GACjB;AACDC,EAAAA,MAAM,EAAE;AACJD,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;GAChB;AACDE,EAAAA,KAAK,EAAE;AACHF,IAAAA,MAA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AA,CAAA,EAAA,EACOQ,KAAK,CAAA,EAAA,EAAA,EAAA;AACRf,UAAAA,aAAa,EAAbA,eAAa;AACba,UAAAA,IAAI,EAAEA,MAAI,IAAIE,KAAK,CAACF,IAAAA;AAAI,SAAA,CAAA,CAAA;AAEhC,OAAA;AACA,IAAA;AACI,MAAA,OAAOE,KAAK,CAAA;AACpB,GAAA;AACJ;;;;;;"}
|
1
|
+
{"version":3,"file":"reducer.js","sources":["../../../../src/components/Calendar/store/reducer.ts"],"sourcesContent":["import { getDateFromValue, getNextDate, getPrevDate, getStartYear } from '../utils';\n\nimport { CalendarStateType, Action, ActionType, InitialState, SizeMap } from './types';\n\nexport const sizeMap: SizeMap = {\n Days: {\n single: [5, 6],\n double: [11, 6],\n },\n Months: {\n single: [3, 2],\n double: [7, 2],\n },\n Years: {\n single: [3, 2],\n double: [7, 2],\n },\n Quarters: {\n single: [1, 1],\n double: [3, 1],\n },\n};\n\nexport const getInitialState = (\n value: Date | undefined,\n calendarState: CalendarStateType,\n isDouble?: boolean,\n): InitialState => {\n const initDate = value || new Date();\n const date = getDateFromValue(initDate);\n\n const resSize: [number, number] = isDouble ? sizeMap[calendarState].double : sizeMap[calendarState].single;\n\n return {\n date: { ...date, day: value !== undefined ? date.day : 0 },\n startYear: getStartYear(date.year),\n calendarState,\n size: resSize,\n };\n};\n\nexport const reducer = (state: InitialState, action: Action): InitialState => {\n switch (action.type) {\n case ActionType.PREVIOUS_MONTH: {\n const { year, monthIndex } = action.payload;\n const [prevYear, prevMonthIndex] = getPrevDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: prevMonthIndex,\n year: prevYear,\n },\n };\n }\n case ActionType.NEXT_MONTH: {\n const { monthIndex, year } = action.payload;\n const [nextYear, nextMonthIndex] = getNextDate(year, monthIndex);\n\n return {\n ...state,\n date: {\n day: state.date.day,\n monthIndex: nextMonthIndex,\n year: nextYear,\n },\n };\n }\n case ActionType.PREVIOUS_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year - step,\n },\n };\n }\n case ActionType.NEXT_YEAR: {\n const { step } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + step,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year: state.date.year + step,\n },\n };\n }\n case ActionType.PREVIOUS_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear - yearsCount,\n };\n }\n case ActionType.NEXT_START_YEAR: {\n const { yearsCount } = action.payload;\n\n return {\n ...state,\n startYear: state.startYear + yearsCount,\n };\n }\n case ActionType.UPDATE_DATE: {\n const { value } = action.payload;\n const date = getDateFromValue(value);\n const startYear = getStartYear(value.getFullYear());\n\n return {\n ...state,\n date,\n startYear,\n };\n }\n case ActionType.UPDATE_MONTH: {\n const { calendarState, monthIndex, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex,\n year: state.date.year,\n },\n };\n }\n case ActionType.UPDATE_YEAR: {\n const { calendarState, year, size } = action.payload;\n\n return {\n ...state,\n size,\n calendarState,\n date: {\n day: state.date.day,\n monthIndex: state.date.monthIndex,\n year,\n },\n };\n }\n case ActionType.UPDATE_CALENDAR_STATE: {\n const { calendarState, size } = action.payload;\n\n return {\n ...state,\n calendarState,\n size: size || state.size,\n };\n }\n default:\n return state;\n }\n};\n"],"names":["sizeMap","Days","single","Months","Years","Quarters","getInitialState","value","calendarState","isDouble","initDate","Date","date","getDateFromValue","resSize","_objectSpread","day","undefined","startYear","getStartYear","year","size","reducer","state","action","type","ActionType","PREVIOUS_MONTH","_action$payload","payload","monthIndex","_getPrevDate","getPrevDate","_getPrevDate2","_slicedToArray","prevYear","prevMonthIndex","NEXT_MONTH","_action$payload2","_getNextDate","getNextDate","_getNextDate2","nextYear","nextMonthIndex","PREVIOUS_YEAR","step","NEXT_YEAR","PREVIOUS_START_Y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UAAAA,IAAI,EAAE;AACFI,YAAAA,GAAG,EAAEO,KAAK,CAACX,IAAI,CAACI,GAAG;AACnBc,YAAAA,UAAU,EAAEP,KAAK,CAACX,IAAI,CAACkB,UAAU;AACjCV,YAAAA,IAAI,EAAJA,MAAAA;AACJ,WAAA;AAAC,SAAA,CAAA,CAAA;AAET,OAAA;IACA,KAAKM,gBAAU,CAAC8B,qBAAqB;AAAE,MAAA;AACnC,QAAA,IAAAC,gBAAA,GAAgCjC,MAAM,CAACK,OAAO;UAAtCrB,eAAa,GAAAiD,gBAAA,CAAbjD,aAAa;UAAEa,MAAI,GAAAoC,gBAAA,CAAJpC,IAAI,CAAA;AAE3B,QAAA,OAAAN,uCAAA,CAAAA,uCAAA,CAAA,EAAA,EACOQ,KAAK,CAAA,EAAA,EAAA,EAAA;AACRf,UAAAA,aAAa,EAAbA,eAAa;AACba,UAAAA,IAAI,EAAEA,MAAI,IAAIE,KAAK,CAACF,IAAAA;AAAI,SAAA,CAAA,CAAA;AAEhC,OAAA;AACA,IAAA;AACI,MAAA,OAAOE,KAAK,CAAA;AACpB,GAAA;AACJ;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.Typography_styles_fa07dt_b1ru04lg__867729cb{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.Typography_styles_fa07dt_b1ru04lg__867729cb.Typography_styles_fa07dt_typographyBold__867729cb{font-weight:var(--typo-font-weight-bold);}.Typography_styles_fa07dt_b1ru04lg__867729cb.Typography_styles_fa07dt_withNoWrap__867729cb{white-space:nowrap;}.Typography_styles_fa07dt_b1ru04lg__867729cb.Typography_styles_fa07dt_withBreakWord__867729cb{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.TypographyOld_styles_168abbx_b9p5ato__094dcd73{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.TypographyOld_styles_168abbx_b9p5ato__094dcd73.TypographyOld_styles_168abbx_withNoWrap__094dcd73{white-space:nowrap;}.TypographyOld_styles_168abbx_b9p5ato__094dcd73.TypographyOld_styles_168abbx_withBreakWord__094dcd73{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.Paragraph_styles_f6q9s8_bgybk92__e9eeb09f{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);margin:0;overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.Paragraph_styles_f6q9s8_bgybk92__e9eeb09f.Paragraph_styles_f6q9s8_withNoWrap__e9eeb09f{white-space:nowrap;}.Paragraph_styles_f6q9s8_bgybk92__e9eeb09f.Paragraph_styles_f6q9s8_withBreakWord__e9eeb09f{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Paragraph.styles.js","sources":["../../../../../src/components/Typography/Old/Paragraph/Paragraph.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../tokens';\nimport { applyHyphens, applyHyphensNormal } from '../../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n margin: 0;\n\n ${
|
1
|
+
{"version":3,"file":"Paragraph.styles.js","sources":["../../../../../src/components/Typography/Old/Paragraph/Paragraph.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../tokens';\nimport { applyHyphens, applyHyphensNormal } from '../../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n margin: 0;\n\n &.${classes.typoWithNoWrap} {\n white-space: nowrap;\n }\n\n ${applyHyphensNormal};\n\n &.${classes.typoWithBreakWord} {\n ${applyHyphens};\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAkBhB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.bgybk92{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);margin:0;overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.bgybk92.with-break-word{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
1
|
+
.bgybk92{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);margin:0;overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.bgybk92.with-no-wrap{white-space:nowrap;}.bgybk92.with-break-word{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.Subtitle_styles_g6d0r2_b810c19__dce1fd86{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}.Subtitle_styles_g6d0r2_b810c19__dce1fd86.Subtitle_styles_g6d0r2_withNoWrap__dce1fd86{white-space:nowrap;}
|
@@ -6,19 +6,25 @@ var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabel
|
|
6
6
|
var React = require('react');
|
7
7
|
var applySpacing = require('../../../../mixins/applySpacing.js');
|
8
8
|
var base = require('../../variations/_size/base.js');
|
9
|
+
var tokens = require('../../tokens.js');
|
10
|
+
var index = require('../../../../utils/index.js');
|
9
11
|
var Subtitle_styles = require('./Subtitle.styles.js');
|
10
12
|
|
11
|
-
var _excluded = ["size", "children", "color", "style"];
|
13
|
+
var _excluded = ["size", "children", "color", "noWrap", "className", "style"];
|
12
14
|
var subtitleRoot = function subtitleRoot(Root) {
|
13
15
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
14
16
|
var size = props.size,
|
15
17
|
children = props.children,
|
16
18
|
color = props.color,
|
19
|
+
noWrap = props.noWrap,
|
20
|
+
className = props.className,
|
17
21
|
style = props.style,
|
18
22
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
23
|
+
var withNoWrap = noWrap ? tokens.classes.typoWithNoWrap : undefined;
|
19
24
|
return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
20
25
|
size: size,
|
21
26
|
ref: ref,
|
27
|
+
className: index.cx(withNoWrap, className),
|
22
28
|
style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
23
29
|
color: color
|
24
30
|
}, style), applySpacing.applySpacing(rest))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Subtitle.js","sources":["../../../../../src/components/Typography/Old/Subtitle/Subtitle.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { applySpacing } from '../../../../mixins/applySpacing';\nimport type { RootProps } from '../../../../engines';\nimport { base as sizeCSS } from '../../variations/_size/base';\nimport type { FontProps } from '../../Typography.types';\n\nimport { base } from './Subtitle.styles';\n\nexport type SubtitleProps = Omit<FontProps, 'bold' | 'breakWord'>;\n\nexport const subtitleRoot = (Root: RootProps<HTMLDivElement, SubtitleProps>) =>\n forwardRef<HTMLDivElement, SubtitleProps>((props, ref) => {\n const { size, children, color, style, ...rest } = props;\n\n return (\n <Root
|
1
|
+
{"version":3,"file":"Subtitle.js","sources":["../../../../../src/components/Typography/Old/Subtitle/Subtitle.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { applySpacing } from '../../../../mixins/applySpacing';\nimport type { RootProps } from '../../../../engines';\nimport { base as sizeCSS } from '../../variations/_size/base';\nimport type { FontProps } from '../../Typography.types';\nimport { classes } from '../../tokens';\nimport { cx } from '../../../../utils';\n\nimport { base } from './Subtitle.styles';\n\nexport type SubtitleProps = Omit<FontProps, 'bold' | 'breakWord'>;\n\nexport const subtitleRoot = (Root: RootProps<HTMLDivElement, SubtitleProps>) =>\n forwardRef<HTMLDivElement, SubtitleProps>((props, ref) => {\n const { size, children, color, noWrap, className, style, ...rest } = props;\n\n const withNoWrap = noWrap ? classes.typoWithNoWrap : undefined;\n\n return (\n <Root\n size={size}\n ref={ref}\n className={cx(withNoWrap, className)}\n style={{ color, ...style, ...applySpacing(rest) }}\n {...rest}\n >\n {children}\n </Root>\n );\n });\n\nexport const subtitleConfig = {\n name: 'Subtitle',\n tag: 'div',\n layout: subtitleRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["subtitleRoot","Root","forwardRef","props","ref","size","children","color","noWrap","className","style","rest","_objectWithoutProperties","_excluded","withNoWrap","classes","typoWithNoWrap","undefined","React","createElement","_extends","cx","_objectSpread","applySpacing","subtitleConfig","name","tag","layout","base","variations","css","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;IAaaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA8C,EAAA;AAAA,EAAA,oBACvEC,gBAAU,CAAgC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACtD,IAAA,IAAQC,IAAI,GAAyDF,KAAK,CAAlEE,IAAI;MAAEC,QAAQ,GAA+CH,KAAK,CAA5DG,QAAQ;MAAEC,KAAK,GAAwCJ,KAAK,CAAlDI,KAAK;MAAEC,MAAM,GAAgCL,KAAK,CAA3CK,MAAM;MAAEC,SAAS,GAAqBN,KAAK,CAAnCM,SAAS;MAAEC,KAAK,GAAcP,KAAK,CAAxBO,KAAK;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAKT,KAAK,EAAAU,SAAA,CAAA,CAAA;IAE1E,IAAMC,UAAU,GAAGN,MAAM,GAAGO,cAAO,CAACC,cAAc,GAAGC,SAAS,CAAA;AAE9D,IAAA,oBACIC,KAAA,CAAAC,aAAA,CAAClB,IAAI,EAAAmB,iCAAA,CAAA;AACDf,MAAAA,IAAI,EAAEA,IAAK;AACXD,MAAAA,GAAG,EAAEA,GAAI;AACTK,MAAAA,SAAS,EAAEY,QAAE,CAACP,UAAU,EAAEL,SAAS,CAAE;MACrCC,KAAK,EAAAY,uCAAA,CAAAA,uCAAA,CAAA;AAAIf,QAAAA,KAAK,EAALA,KAAAA;AAAK,OAAA,EAAKG,KAAK,CAAA,EAAKa,yBAAY,CAACZ,IAAI,CAAC,CAAA;KAC3CA,EAAAA,IAAI,CAEPL,EAAAA,QACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMkB,cAAc,GAAG;AAC1BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE3B,YAAY;AACpB4B,EAAAA,IAAI,EAAJA,oBAAI;AACJC,EAAAA,UAAU,EAAE;AACRxB,IAAAA,IAAI,EAAE;AACFyB,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3B,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Subtitle.styles.js","sources":["../../../../../src/components/Typography/Old/Subtitle/Subtitle.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../tokens';\nimport { applyHyphens } from '../../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n\n ${
|
1
|
+
{"version":3,"file":"Subtitle.styles.js","sources":["../../../../../src/components/Typography/Old/Subtitle/Subtitle.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../tokens';\nimport { applyHyphens } from '../../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n\n &.${classes.typoWithNoWrap} {\n white-space: nowrap;\n }\n\n ${applyHyphens};\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAahB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.b810c19{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
1
|
+
.b810c19{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}.b810c19.with-no-wrap{white-space:nowrap;}
|
@@ -8,21 +8,23 @@ var applySpacing = require('../../../mixins/applySpacing.js');
|
|
8
8
|
var tokens = require('../tokens.js');
|
9
9
|
var index = require('../../../utils/index.js');
|
10
10
|
|
11
|
-
var _excluded = ["size", "children", "breakWord", "color", "className", "style"];
|
11
|
+
var _excluded = ["size", "children", "breakWord", "noWrap", "color", "className", "style"];
|
12
12
|
var typographyOldRoot = function typographyOldRoot(Root) {
|
13
13
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
14
14
|
var size = props.size,
|
15
15
|
children = props.children,
|
16
16
|
breakWord = props.breakWord,
|
17
|
+
noWrap = props.noWrap,
|
17
18
|
color = props.color,
|
18
19
|
className = props.className,
|
19
20
|
style = props.style,
|
20
21
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
22
|
+
var withNoWrap = noWrap ? tokens.classes.typoWithNoWrap : undefined;
|
21
23
|
var withBreakWord = breakWord ? tokens.classes.typoWithBreakWord : undefined;
|
22
24
|
return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
23
25
|
size: size,
|
24
26
|
ref: ref,
|
25
|
-
className: index.cx(withBreakWord, className),
|
27
|
+
className: index.cx(withNoWrap, withBreakWord, className),
|
26
28
|
style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
27
29
|
color: color
|
28
30
|
}, style), applySpacing.applySpacing(rest))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TypographyOld.js","sources":["../../../../src/components/Typography/Old/TypographyOld.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { applySpacing } from '../../../mixins/applySpacing';\nimport type { RootProps } from '../../../engines';\nimport { classes } from '../tokens';\nimport type { FontProps } from '../Typography.types';\nimport { cx } from '../../../utils';\n\nexport type TypographyOldProps = Omit<FontProps, 'bold'>;\n\nexport const typographyOldRoot = (Root: RootProps<HTMLDivElement, TypographyOldProps>) =>\n forwardRef<HTMLDivElement, TypographyOldProps>((props, ref) => {\n const { size, children, breakWord, color, className, style, ...rest } = props;\n\n const withBreakWord = breakWord ? classes.typoWithBreakWord : undefined;\n\n return (\n <Root\n size={size}\n ref={ref}\n className={cx(withBreakWord, className)}\n style={{ color, ...style, ...applySpacing(rest) }}\n {...rest}\n >\n {children}\n </Root>\n );\n });\n"],"names":["typographyOldRoot","Root","forwardRef","props","ref","size","children","breakWord","color","className","style","rest","_objectWithoutProperties","_excluded","
|
1
|
+
{"version":3,"file":"TypographyOld.js","sources":["../../../../src/components/Typography/Old/TypographyOld.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { applySpacing } from '../../../mixins/applySpacing';\nimport type { RootProps } from '../../../engines';\nimport { classes } from '../tokens';\nimport type { FontProps } from '../Typography.types';\nimport { cx } from '../../../utils';\n\nexport type TypographyOldProps = Omit<FontProps, 'bold'>;\n\nexport const typographyOldRoot = (Root: RootProps<HTMLDivElement, TypographyOldProps>) =>\n forwardRef<HTMLDivElement, TypographyOldProps>((props, ref) => {\n const { size, children, breakWord, noWrap, color, className, style, ...rest } = props;\n\n const withNoWrap = noWrap ? classes.typoWithNoWrap : undefined;\n const withBreakWord = breakWord ? classes.typoWithBreakWord : undefined;\n\n return (\n <Root\n size={size}\n ref={ref}\n className={cx(withNoWrap, withBreakWord, className)}\n style={{ color, ...style, ...applySpacing(rest) }}\n {...rest}\n >\n {children}\n </Root>\n );\n });\n"],"names":["typographyOldRoot","Root","forwardRef","props","ref","size","children","breakWord","noWrap","color","className","style","rest","_objectWithoutProperties","_excluded","withNoWrap","classes","typoWithNoWrap","undefined","withBreakWord","typoWithBreakWord","React","createElement","_extends","cx","_objectSpread","applySpacing"],"mappings":";;;;;;;;;;;IAUaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,IAAmD,EAAA;AAAA,EAAA,oBACjFC,gBAAU,CAAqC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAC3D,IAAA,IAAQC,IAAI,GAAoEF,KAAK,CAA7EE,IAAI;MAAEC,QAAQ,GAA0DH,KAAK,CAAvEG,QAAQ;MAAEC,SAAS,GAA+CJ,KAAK,CAA7DI,SAAS;MAAEC,MAAM,GAAuCL,KAAK,CAAlDK,MAAM;MAAEC,KAAK,GAAgCN,KAAK,CAA1CM,KAAK;MAAEC,SAAS,GAAqBP,KAAK,CAAnCO,SAAS;MAAEC,KAAK,GAAcR,KAAK,CAAxBQ,KAAK;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAKV,KAAK,EAAAW,SAAA,CAAA,CAAA;IAErF,IAAMC,UAAU,GAAGP,MAAM,GAAGQ,cAAO,CAACC,cAAc,GAAGC,SAAS,CAAA;IAC9D,IAAMC,aAAa,GAAGZ,SAAS,GAAGS,cAAO,CAACI,iBAAiB,GAAGF,SAAS,CAAA;AAEvE,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAACrB,IAAI,EAAAsB,iCAAA,CAAA;AACDlB,MAAAA,IAAI,EAAEA,IAAK;AACXD,MAAAA,GAAG,EAAEA,GAAI;MACTM,SAAS,EAAEc,QAAE,CAACT,UAAU,EAAEI,aAAa,EAAET,SAAS,CAAE;MACpDC,KAAK,EAAAc,uCAAA,CAAAA,uCAAA,CAAA;AAAIhB,QAAAA,KAAK,EAALA,KAAAA;AAAK,OAAA,EAAKE,KAAK,CAAA,EAAKe,yBAAY,CAACd,IAAI,CAAC,CAAA;KAC3CA,EAAAA,IAAI,CAEPN,EAAAA,QACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TypographyOld.styles.js","sources":["../../../../src/components/Typography/Old/TypographyOld.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../tokens';\nimport { applyHyphens, applyHyphensNormal } from '../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n\n ${
|
1
|
+
{"version":3,"file":"TypographyOld.styles.js","sources":["../../../../src/components/Typography/Old/TypographyOld.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../tokens';\nimport { applyHyphens, applyHyphensNormal } from '../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n\n &.${classes.typoWithNoWrap} {\n white-space: nowrap;\n }\n\n ${applyHyphensNormal};\n\n &.${classes.typoWithBreakWord} {\n ${applyHyphens};\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAiBhB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.b9p5ato{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.b9p5ato.with-break-word{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
1
|
+
.b9p5ato{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.b9p5ato.with-no-wrap{white-space:nowrap;}.b9p5ato.with-break-word{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.Underline_styles_1x2vb5e_b1uxesuf__34404c4e{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);text-transform:uppercase;overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.Underline_styles_1x2vb5e_b1uxesuf__34404c4e.Underline_styles_1x2vb5e_withNoWrap__34404c4e{white-space:nowrap;}.Underline_styles_1x2vb5e_b1uxesuf__34404c4e.Underline_styles_1x2vb5e_withBreakWord__34404c4e{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Underline.styles.js","sources":["../../../../../src/components/Typography/Old/Underline/Underline.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../tokens';\nimport { applyHyphens, applyHyphensNormal } from '../../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n\n text-transform: uppercase;\n\n ${
|
1
|
+
{"version":3,"file":"Underline.styles.js","sources":["../../../../../src/components/Typography/Old/Underline/Underline.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../tokens';\nimport { applyHyphens, applyHyphensNormal } from '../../../../mixins';\n\nexport const base = css`\n font-family: var(${tokens.typoFontFamily});\n font-size: var(${tokens.typoFontSize});\n font-style: var(${tokens.typoFontStyle});\n letter-spacing: var(${tokens.typoFontLetterSpacing});\n line-height: var(${tokens.typoFontLineHeight});\n font-weight: var(${tokens.typoFontWeight});\n\n text-transform: uppercase;\n\n &.${classes.typoWithNoWrap} {\n white-space: nowrap;\n }\n\n ${applyHyphensNormal};\n\n &.${classes.typoWithBreakWord} {\n ${applyHyphens};\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAmBhB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.b1uxesuf{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);text-transform:uppercase;overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.b1uxesuf.with-break-word{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
1
|
+
.b1uxesuf{font-family:var(--typo-font-family);font-size:var(--typo-font-size);font-style:var(--typo-font-style);-webkit-letter-spacing:var(--typo-font-letter-spacing);-moz-letter-spacing:var(--typo-font-letter-spacing);-ms-letter-spacing:var(--typo-font-letter-spacing);letter-spacing:var(--typo-font-letter-spacing);line-height:var(--typo-font-line-height);font-weight:var(--typo-font-weight);text-transform:uppercase;overflow-wrap:normal;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual;hyphens:manual;}.b1uxesuf.with-no-wrap{white-space:nowrap;}.b1uxesuf.with-break-word{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|