@salutejs/plasma-new-hope 0.197.0-canary.1588.11972699441.0 → 0.197.1-canary.1569.11973386056.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/Switch/Switch.css +2 -2
- package/cjs/components/Switch/Switch.tokens.js +9 -7
- package/cjs/components/Switch/Switch.tokens.js.map +1 -1
- package/cjs/components/Switch/_toggleSize/base.js +1 -1
- package/cjs/components/Switch/_toggleSize/base.js.map +1 -1
- package/cjs/components/Switch/_toggleSize/base_1e2ou53.css +1 -0
- package/cjs/components/Switch/_view/base.js +1 -1
- package/{es/components/Switch/_view/base_15atbyp.css → cjs/components/Switch/_view/base_qbpw2g.css} +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/{es/components/Typography/Old/Paragraph/Paragraph.styles_f6q9s8.css → cjs/components/Typography/Old/Paragraph/Paragraph.styles_179bahu.css} +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.css +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.js +1 -7
- 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_g6d0r2.css → cjs/components/Typography/Old/Subtitle/Subtitle.styles_1plleej.css} +1 -1
- package/cjs/components/Typography/Old/TypographyOld.js +2 -4
- 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/cjs/components/Typography/Old/{TypographyOld.styles_168abbx.css → TypographyOld.styles_17w0rtq.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/cjs/components/Typography/Old/Underline/{Underline.styles_1x2vb5e.css → Underline.styles_vsz834.css} +1 -1
- package/cjs/components/Typography/Typography.js +2 -4
- 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_fa07dt.css → Typography.styles_6mr47g.css} +1 -1
- package/cjs/components/Typography/tokens.js +0 -1
- package/cjs/components/Typography/tokens.js.map +1 -1
- package/cjs/index.css +7 -7
- 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/Switch/Switch.tokens.js +9 -7
- package/emotion/cjs/components/Switch/_toggleSize/base.js +1 -1
- package/emotion/cjs/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/emotion/cjs/components/Typography/Old/Subtitle/Subtitle.js +1 -7
- package/emotion/cjs/components/Typography/Old/Subtitle/Subtitle.styles.js +1 -1
- package/emotion/cjs/components/Typography/Old/TypographyOld.js +2 -4
- 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 +2 -4
- package/emotion/cjs/components/Typography/Typography.styles.js +1 -1
- package/emotion/cjs/components/Typography/Typography.template-doc.mdx +0 -4
- package/emotion/cjs/components/Typography/tokens.js +0 -1
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +8 -8
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.outline.config.js +8 -8
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.config.js +8 -8
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.outline.config.js +8 -8
- package/emotion/cjs/examples/typograpy/components/Body/Body.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Dspl/Dspl.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Heading/Heading.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Body/Body.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Button/Button.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Caption/Caption.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Display/Display.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Headline/Headline.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +1 -11
- package/emotion/cjs/examples/typograpy/components/Old/Underline/Underline.stories.tsx +1 -9
- package/emotion/cjs/examples/typograpy/components/Text/Text.stories.tsx +1 -9
- 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/Switch/Switch.tokens.js +9 -7
- package/emotion/es/components/Switch/_toggleSize/base.js +2 -2
- package/emotion/es/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/emotion/es/components/Typography/Old/Subtitle/Subtitle.js +1 -7
- package/emotion/es/components/Typography/Old/Subtitle/Subtitle.styles.js +2 -2
- package/emotion/es/components/Typography/Old/TypographyOld.js +2 -4
- 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 +2 -4
- package/emotion/es/components/Typography/Typography.styles.js +1 -1
- package/emotion/es/components/Typography/Typography.template-doc.mdx +0 -4
- package/emotion/es/components/Typography/tokens.js +0 -1
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.config.js +8 -8
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.outline.config.js +8 -8
- package/emotion/es/examples/plasma_web/components/Switch/Switch.config.js +8 -8
- package/emotion/es/examples/plasma_web/components/Switch/Switch.outline.config.js +8 -8
- package/emotion/es/examples/typograpy/components/Body/Body.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Dspl/Dspl.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Heading/Heading.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Body/Body.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Button/Button.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Caption/Caption.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Display/Display.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Headline/Headline.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +1 -11
- package/emotion/es/examples/typograpy/components/Old/Underline/Underline.stories.tsx +1 -9
- package/emotion/es/examples/typograpy/components/Text/Text.stories.tsx +1 -9
- 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/Switch/Switch.css +2 -2
- package/es/components/Switch/Switch.tokens.js +9 -7
- package/es/components/Switch/Switch.tokens.js.map +1 -1
- package/es/components/Switch/_toggleSize/base.js +1 -1
- package/es/components/Switch/_toggleSize/base.js.map +1 -1
- package/es/components/Switch/_toggleSize/base_1e2ou53.css +1 -0
- package/es/components/Switch/_view/base.js +1 -1
- package/{cjs/components/Switch/_view/base_15atbyp.css → es/components/Switch/_view/base_qbpw2g.css} +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/{cjs/components/Typography/Old/Paragraph/Paragraph.styles_f6q9s8.css → es/components/Typography/Old/Paragraph/Paragraph.styles_179bahu.css} +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.css +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.js +1 -7
- 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_g6d0r2.css → es/components/Typography/Old/Subtitle/Subtitle.styles_1plleej.css} +1 -1
- package/es/components/Typography/Old/TypographyOld.js +2 -4
- 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/es/components/Typography/Old/{TypographyOld.styles_168abbx.css → TypographyOld.styles_17w0rtq.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/es/components/Typography/Old/Underline/{Underline.styles_1x2vb5e.css → Underline.styles_vsz834.css} +1 -1
- package/es/components/Typography/Typography.js +2 -4
- 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_fa07dt.css → Typography.styles_6mr47g.css} +1 -1
- package/es/components/Typography/tokens.js +0 -1
- package/es/components/Typography/tokens.js.map +1 -1
- package/es/index.css +7 -7
- 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/Switch/Switch.tokens.js +9 -7
- package/styled-components/cjs/components/Switch/_toggleSize/base.js +1 -1
- package/styled-components/cjs/components/Typography/Old/Paragraph/Paragraph.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +1 -7
- package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Old/TypographyOld.js +2 -4
- 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 +2 -4
- package/styled-components/cjs/components/Typography/Typography.styles.js +1 -1
- package/styled-components/cjs/components/Typography/Typography.template-doc.mdx +0 -4
- package/styled-components/cjs/components/Typography/tokens.js +0 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.outline.config.js +3 -3
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.config.js +3 -3
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.outline.config.js +3 -3
- package/styled-components/cjs/examples/typograpy/components/Body/Body.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Dspl/Dspl.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Heading/Heading.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Body/Body.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Button/Button.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Caption/Caption.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Display/Display.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Headline/Headline.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +1 -11
- package/styled-components/cjs/examples/typograpy/components/Old/Underline/Underline.stories.tsx +1 -9
- package/styled-components/cjs/examples/typograpy/components/Text/Text.stories.tsx +1 -9
- 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/Switch/Switch.tokens.js +9 -7
- package/styled-components/es/components/Switch/_toggleSize/base.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 +1 -7
- package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.styles.js +2 -2
- package/styled-components/es/components/Typography/Old/TypographyOld.js +2 -4
- 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 +2 -4
- package/styled-components/es/components/Typography/Typography.styles.js +1 -1
- package/styled-components/es/components/Typography/Typography.template-doc.mdx +0 -4
- package/styled-components/es/components/Typography/tokens.js +0 -1
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.config.js +3 -3
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.outline.config.js +3 -3
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.config.js +3 -3
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.outline.config.js +3 -3
- package/styled-components/es/examples/typograpy/components/Body/Body.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Dspl/Dspl.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Heading/Heading.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Body/Body.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Button/Button.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Caption/Caption.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Display/Display.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Footnote/Footnote.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Headline/Headline.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Paragraph/Paragraph.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Old/Subtitle/Subtitle.stories.tsx +1 -11
- package/styled-components/es/examples/typograpy/components/Old/Underline/Underline.stories.tsx +1 -9
- package/styled-components/es/examples/typograpy/components/Text/Text.stories.tsx +1 -9
- package/types/components/Calendar/store/reducer.d.ts +1 -1
- package/types/components/Calendar/store/reducer.d.ts.map +1 -1
- package/types/components/Switch/Switch.tokens.d.ts +4 -2
- package/types/components/Switch/Switch.tokens.d.ts.map +1 -1
- package/types/components/Switch/_toggleSize/base.d.ts.map +1 -1
- package/types/components/Typography/Body/Body.d.ts +0 -2
- package/types/components/Typography/Body/Body.d.ts.map +1 -1
- package/types/components/Typography/Dspl/Dspl.d.ts +0 -2
- package/types/components/Typography/Dspl/Dspl.d.ts.map +1 -1
- package/types/components/Typography/Heading/Heading.d.ts +0 -2
- 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 +0 -2
- package/types/components/Typography/Text/Text.d.ts.map +1 -1
- package/types/components/Typography/Typography.d.ts +0 -1
- 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 +0 -1
- package/types/components/Typography/Typography.types.d.ts.map +1 -1
- package/types/components/Typography/tokens.d.ts +0 -1
- package/types/components/Typography/tokens.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Editable/Editable.d.ts +0 -4
- package/types/examples/plasma_b2c/components/Editable/Editable.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.outline.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Editable/Editable.d.ts +0 -4
- package/types/examples/plasma_web/components/Editable/Editable.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.outline.config.d.ts.map +1 -1
- package/types/examples/typograpy/components/Body/Body.d.ts +0 -1
- package/types/examples/typograpy/components/Body/Body.d.ts.map +1 -1
- package/types/examples/typograpy/components/Dspl/Dspl.d.ts +0 -1
- package/types/examples/typograpy/components/Dspl/Dspl.d.ts.map +1 -1
- package/types/examples/typograpy/components/Heading/Heading.d.ts +0 -1
- package/types/examples/typograpy/components/Heading/Heading.d.ts.map +1 -1
- package/types/examples/typograpy/components/Text/Text.d.ts +0 -1
- package/types/examples/typograpy/components/Text/Text.d.ts.map +1 -1
- package/cjs/components/Switch/_toggleSize/base_1d0b3t4.css +0 -1
- package/es/components/Switch/_toggleSize/base_1d0b3t4.css +0 -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, type)),
|
69
|
+
var _useReducer = React.useReducer(reducer.reducer, reducer.getInitialState(value, min, 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, 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,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,GAAA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AAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,SAAS,EAAEM,aAAc;AACzBL,MAAAA,YAAY,EAAEM,gBAAiB;AAC/B0G,MAAAA,WAAW,EAAExF,WAAY;AACzByF,MAAAA,YAAY,EAAE7C,kBAAmB;AACjC8B,MAAAA,aAAa,EAAEtC,eAAgB;AAC/BsD,MAAAA,WAAW,EAAEzF,cAAe;AAC5BkC,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KACxB,CAEH,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMsD,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEnI,gBAAgB;AACxBoI,EAAAA,IAAI,EAAEC,kCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD5E,IAAAA,IAAI,EAAE;AACF2E,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNJ,IAAAA,IAAI,EAAE,SAAS;AACf1E,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
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,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;MAChB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BW,MAAAA,aAAa,EAAEA,aAAc;AAC7BhE,MAAAA,GAAG,EAAEA,GAAI;AACTC,MAAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,SAAS,EAAEM,aAAc;AACzBL,MAAAA,YAAY,EAAEM,gBAAiB;AAC/B0G,MAAAA,WAAW,EAAExF,WAAY;AACzByF,MAAAA,YAAY,EAAE7C,kBAAmB;AACjC8B,MAAAA,aAAa,EAAEtC,eAAgB;AAC/BsD,MAAAA,WAAW,EAAEzF,cAAe;AAC5BkC,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KACxB,CAEH,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMsD,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEnI,gBAAgB;AACxBoI,EAAAA,IAAI,EAAEC,kCAAc;AACpBC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD5E,IAAAA,IAAI,EAAE;AACF2E,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNJ,IAAAA,IAAI,EAAE,SAAS;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, type, true)),
|
72
|
+
var _useReducer = React.useReducer(reducer.reducer, reducer.getInitialState(value, min, 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, 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,GAAA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,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, 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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,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, calendarState, isDouble) {
|
28
|
-
var initDate = value || new Date();
|
27
|
+
var getInitialState = function getInitialState(value, min, calendarState, isDouble) {
|
28
|
+
var initDate = value || min || 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 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_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,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;GAChB;AACDG,EAAAA,QAAQ,EAAE;AACNH,IAAAA,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAA,CAAC,CAAC,EAAE,CAAC,CAAA;AACjB,GAAA;AACJ,EAAC;AAEM,IAAMI,eAAe,GAAG,SAAlBA,eAAeA,CACxBC,KAAuB,EACvBC,aAAgC,EAChCC,QAAkB,EACH;AACf,EAAA,IAAMC,QAAQ,GAAGH,KAAK,IA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AAC4B,WAAW;AAAE,MAAA;AACzB,QAAA,IAAAC,gBAAA,GAAsC/B,MAAM,CAACK,OAAO;UAA5CrB,cAAa,GAAA+C,gBAAA,CAAb/C,aAAa;UAAEY,MAAI,GAAAmC,gBAAA,CAAJnC,IAAI;UAAEC,KAAI,GAAAkC,gBAAA,CAAJlC,IAAI,CAAA;AAEjC,QAAA,OAAAN,uCAAA,CAAAA,uCAAA,CAAA,EAAA,EACOQ,KAAK,CAAA,EAAA,EAAA,EAAA;AACRF,UAAAA,IAAI,EAAJA,KAAI;AACJb,UAAAA,aAAa,EAAbA,cAAa;AACbI,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
|
+
{"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;IAC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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,8 +1,8 @@
|
|
1
1
|
.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_s10fscgc__e2c572a3{font-family:var(--plasma-switch-font-family);font-style:var(--plasma-switch-font-style);font-weight:var(--plasma-switch-font-weight);-webkit-letter-spacing:var(--plasma-switch-letter-spacing);-moz-letter-spacing:var(--plasma-switch-letter-spacing);-ms-letter-spacing:var(--plasma-switch-letter-spacing);letter-spacing:var(--plasma-switch-letter-spacing);line-height:var(--plasma-switch-line-height);font-size:var(--plasma-switch-font-size);}.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_sdjnckq__e2c572a3{font-family:var(--plasma-switch-description-font-family);font-style:var(--plasma-switch-description-font-style);font-weight:var(--plasma-switch-description-font-weight);-webkit-letter-spacing:var(--plasma-switch-description-letter-spacing);-moz-letter-spacing:var(--plasma-switch-description-letter-spacing);-ms-letter-spacing:var(--plasma-switch-description-letter-spacing);letter-spacing:var(--plasma-switch-description-letter-spacing);line-height:var(--plasma-switch-description-line-height);font-size:var(--plasma-switch-description-font-size);}.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_s1ilr5eq__e2c572a3{margin:var(--plasma_private-switch__label-offset,0);}
|
2
2
|
|
3
|
-
.
|
3
|
+
.base_1e2ou53_b1wld3h3__301e5c69 .base_1e2ou53_s2cs3kf__301e5c69{box-sizing:border-box;-webkit-flex:0 0 var(--plasma-switch__track-width);-ms-flex:0 0 var(--plasma-switch__track-width);flex:0 0 var(--plasma-switch__track-width);border-style:solid;border-width:var(--plasma-switch__track_checked_false-border-width);border-radius:var(--plasma-switch__track-border-radius);width:var(--plasma-switch__track-width);height:var(--plasma-switch__track-height);}.base_1e2ou53_b1wld3h3__301e5c69 .base_1e2ou53_s2cs3kf__301e5c69::after{width:var(--plasma-switch__thumb-size);height:var(--plasma-switch__thumb-size);border-radius:var(--plasma-switch__thumb-border-radius);margin:auto var(--plasma-switch__thumb_checked_false-offset);}.base_1e2ou53_b1wld3h3__301e5c69 .base_1e2ou53_ssthlx1__301e5c69:checked ~ .base_1e2ou53_s2cs3kf__301e5c69{border-width:var(--plasma-switch__track_checked_true-border-width,var(--plasma-switch__track_checked_false-border-width));}.base_1e2ou53_b1wld3h3__301e5c69 .base_1e2ou53_ssthlx1__301e5c69:checked ~ .base_1e2ou53_s2cs3kf__301e5c69::after{margin:auto var(--plasma-switch__thumb_checked_true-offset);}.base_1e2ou53_b1wld3h3__301e5c69:active:not([disabled]) .base_1e2ou53_s2cs3kf__301e5c69::after{width:calc(var(--plasma-switch__thumb-size) * var(--plasma-switch__thumb-scale,1));}
|
4
4
|
|
5
|
-
.
|
5
|
+
.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_s2cs3kf__f31e8aee{background-color:var(--plasma-switch__track_checked_false-bg-color);border-color:var(--plasma-switch__track_checked_false-border-color);}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_ssthlx1__f31e8aee:not([disabled]) ~ .base_qbpw2g_s2cs3kf__f31e8aee:hover{background-color:var(--plasma-switch__track_checked_false_hovered_true-bg-color,var(--plasma-switch__track_checked_false-bg-color));border-color:var(--plasma-switch__track_checked_false_hovered_true-border-color,var(--plasma-switch__track_checked_false-border-color));}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_ssthlx1__f31e8aee:checked ~ .base_qbpw2g_s2cs3kf__f31e8aee{background-color:var(--plasma-switch__track_checked_true-bg-color);border-color:var(--plasma-switch__track_checked_true-border-color);}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_ssthlx1__f31e8aee:checked:not([disabled]) ~ .base_qbpw2g_s2cs3kf__f31e8aee:hover{background-color:var(--plasma-switch__track_checked_true_hovered_true-bg-color,var(--plasma-switch__track_checked_true-bg-color));border-color:var(--plasma-switch__track_checked_true_hovered_true-border-color,var(--plasma-switch__track_checked_true-border-color));}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_s2cs3kf__f31e8aee::after{background-color:var(--plasma-switch__thumb_checked_false-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow);}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_ssthlx1__f31e8aee:checked ~ .base_qbpw2g_s2cs3kf__f31e8aee::after{background-color:var(--plasma-switch__thumb_checked_true-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow_checked_true,var(--plasma-switch__thumb-box-shadow));}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_s1ilr5eq__f31e8aee{color:var(--plasma-switch__label-color);}.base_qbpw2g_b1g0jmh3__f31e8aee .base_qbpw2g_sdjnckq__f31e8aee{color:var(--plasma-switch__description-color);}
|
6
6
|
|
7
7
|
.base_sz3n0x_bvwxj2r__a36bed54 .base_sz3n0x_s2cs3kf__a36bed54::before{content:'';position:absolute;inset:-0.125rem;display:block;box-sizing:content-box;border-radius:calc(0.125rem + var(--plasma-switch__track-border-radius));border:0.125rem solid transparent;pointer-events:none;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;}.base_sz3n0x_bvwxj2r__a36bed54 .base_sz3n0x_ssthlx1__a36bed54.base_sz3n0x_focusVisible__a36bed54 ~ .base_sz3n0x_s2cs3kf__a36bed54::before{box-shadow:0 0 0 0.125rem var(--plasma-switch__track-focus-color);}
|
8
8
|
|
@@ -27,11 +27,12 @@ var tokens = {
|
|
27
27
|
verticalGap: '--plasma-switch-vertical-gap',
|
28
28
|
trackWidth: '--plasma-switch__track-width',
|
29
29
|
trackHeight: '--plasma-switch__track-height',
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
trackBorderWidthOn: '--plasma-switch__track_checked_true-border-width',
|
31
|
+
trackBorderWidthOff: '--plasma-switch__track_checked_false-border-width',
|
32
|
+
trackBorderColorOn: '--plasma-switch__track_checked_true-border-color',
|
33
|
+
trackBorderColorOnHover: '--plasma-switch__track_checked_true_hovered_true-border-color',
|
34
|
+
trackBorderColorOff: '--plasma-switch__track_checked_false-border-color',
|
35
|
+
trackBorderColorOffHover: '--plasma-switch__track_checked_false_hovered_true-border-color',
|
35
36
|
trackBorderRadius: '--plasma-switch__track-border-radius',
|
36
37
|
// NOTE: could be intersection with checked
|
37
38
|
trackBackgroundColorOn: '--plasma-switch__track_checked_true-bg-color',
|
@@ -40,11 +41,12 @@ var tokens = {
|
|
40
41
|
trackBackgroundColorOffHover: '--plasma-switch__track_checked_false_hovered_true-bg-color',
|
41
42
|
trackFocusColor: '--plasma-switch__track-focus-color',
|
42
43
|
thumbSize: '--plasma-switch__thumb-size',
|
43
|
-
|
44
|
+
thumbOffsetOn: '--plasma-switch__thumb_checked_true-offset',
|
45
|
+
thumbOffsetOff: '--plasma-switch__thumb_checked_false-offset',
|
44
46
|
thumbBorderRadius: '--plasma-switch__thumb-border-radius',
|
45
47
|
thumbPressScale: '--plasma-switch__thumb-scale',
|
46
48
|
thumbBackgroundColorOn: '--plasma-switch__thumb_checked_true-bg-color',
|
47
|
-
thumbBackgroundColorOff: '--plasma-
|
49
|
+
thumbBackgroundColorOff: '--plasma-switch__thumb_checked_false-bg-color',
|
48
50
|
thumbBoxShadow: '--plasma-switch__thumb-box-shadow',
|
49
51
|
thumbBoxShadowOn: '--plasma-switch__thumb-box-shadow_checked_true',
|
50
52
|
labelOffsetPrivate: '--plasma_private-switch__label-offset'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Switch.tokens.js","sources":["../../../src/components/Switch/Switch.tokens.ts"],"sourcesContent":["export const tokens = {\n fontFamily: '--plasma-switch-font-family',\n fontStyle: '--plasma-switch-font-style',\n fontSize: '--plasma-switch-font-size',\n fontWeight: '--plasma-switch-font-weight',\n letterSpacing: '--plasma-switch-letter-spacing',\n lineHeight: '--plasma-switch-line-height',\n\n /* Токены description */\n descriptionFontFamily: '--plasma-switch-description-font-family',\n descriptionFontStyle: '--plasma-switch-description-font-style',\n descriptionFontSize: '--plasma-switch-description-font-size',\n descriptionFontWeight: '--plasma-switch-description-font-weight',\n descriptionLetterSpacing: '--plasma-switch-description-letter-spacing',\n descriptionLineHeight: '--plasma-switch-description-line-height',\n\n /* Цвет подписи */\n labelColor: '--plasma-switch__label-color',\n labelOffset: '--plasma-switch__label-offset',\n\n /* Цвет описания */\n descriptionColor: '--plasma-switch__description-color',\n descriptionOffset: '--plasma-switch__description-offset',\n\n /** Прозрачность для всего компонента в состоянии disabled */\n disabledOpacity: '--plasma-switch-disabled-opacity',\n\n verticalGap: '--plasma-switch-vertical-gap',\n trackWidth: '--plasma-switch__track-width',\n trackHeight: '--plasma-switch__track-height',\n
|
1
|
+
{"version":3,"file":"Switch.tokens.js","sources":["../../../src/components/Switch/Switch.tokens.ts"],"sourcesContent":["export const tokens = {\n fontFamily: '--plasma-switch-font-family',\n fontStyle: '--plasma-switch-font-style',\n fontSize: '--plasma-switch-font-size',\n fontWeight: '--plasma-switch-font-weight',\n letterSpacing: '--plasma-switch-letter-spacing',\n lineHeight: '--plasma-switch-line-height',\n\n /* Токены description */\n descriptionFontFamily: '--plasma-switch-description-font-family',\n descriptionFontStyle: '--plasma-switch-description-font-style',\n descriptionFontSize: '--plasma-switch-description-font-size',\n descriptionFontWeight: '--plasma-switch-description-font-weight',\n descriptionLetterSpacing: '--plasma-switch-description-letter-spacing',\n descriptionLineHeight: '--plasma-switch-description-line-height',\n\n /* Цвет подписи */\n labelColor: '--plasma-switch__label-color',\n labelOffset: '--plasma-switch__label-offset',\n\n /* Цвет описания */\n descriptionColor: '--plasma-switch__description-color',\n descriptionOffset: '--plasma-switch__description-offset',\n\n /** Прозрачность для всего компонента в состоянии disabled */\n disabledOpacity: '--plasma-switch-disabled-opacity',\n\n verticalGap: '--plasma-switch-vertical-gap',\n trackWidth: '--plasma-switch__track-width',\n trackHeight: '--plasma-switch__track-height',\n trackBorderWidthOn: '--plasma-switch__track_checked_true-border-width',\n trackBorderWidthOff: '--plasma-switch__track_checked_false-border-width',\n trackBorderColorOn: '--plasma-switch__track_checked_true-border-color',\n trackBorderColorOnHover: '--plasma-switch__track_checked_true_hovered_true-border-color',\n trackBorderColorOff: '--plasma-switch__track_checked_false-border-color',\n trackBorderColorOffHover: '--plasma-switch__track_checked_false_hovered_true-border-color',\n\n trackBorderRadius: '--plasma-switch__track-border-radius',\n // NOTE: could be intersection with checked\n trackBackgroundColorOn: '--plasma-switch__track_checked_true-bg-color',\n trackBackgroundColorOnHover: '--plasma-switch__track_checked_true_hovered_true-bg-color',\n trackBackgroundColorOff: '--plasma-switch__track_checked_false-bg-color',\n trackBackgroundColorOffHover: '--plasma-switch__track_checked_false_hovered_true-bg-color',\n\n trackFocusColor: '--plasma-switch__track-focus-color',\n\n thumbSize: '--plasma-switch__thumb-size',\n thumbOffsetOn: '--plasma-switch__thumb_checked_true-offset',\n thumbOffsetOff: '--plasma-switch__thumb_checked_false-offset',\n thumbBorderRadius: '--plasma-switch__thumb-border-radius',\n\n thumbPressScale: '--plasma-switch__thumb-scale',\n\n thumbBackgroundColorOn: '--plasma-switch__thumb_checked_true-bg-color',\n thumbBackgroundColorOff: '--plasma-switch__thumb_checked_false-bg-color',\n thumbBoxShadow: '--plasma-switch__thumb-box-shadow',\n thumbBoxShadowOn: '--plasma-switch__thumb-box-shadow_checked_true',\n\n labelOffsetPrivate: '--plasma_private-switch__label-offset',\n};\n\nexport const classes = {\n beforeSwitchLabelPosition: 'switch-label-position-before',\n afterSwitchLabelPosition: 'switch-label-position-after',\n};\n"],"names":["tokens","fontFamily","fontStyle","fontSize","fontWeight","letterSpacing","lineHeight","descriptionFontFamily","descriptionFontStyle","descriptionFontSize","descriptionFontWeight","descriptionLetterSpacing","descriptionLineHeight","labelColor","labelOffset","descriptionColor","descriptionOffset","disabledOpacity","verticalGap","trackWidth","trackHeight","trackBorderWidthOn","trackBorderWidthOff","trackBorderColorOn","trackBorderColorOnHover","trackBorderColorOff","trackBorderColorOffHover","trackBorderRadius","trackBackgroundColorOn","trackBackgroundColorOnHover","trackBackgroundColorOff","trackBackgroundColorOffHover","trackFocusColor","thumbSize","thumbOffsetOn","thumbOffsetOff","thumbBorderRadius","thumbPressScale","thumbBackgroundColorOn","thumbBackgroundColorOff","thumbBoxShadow","thumbBoxShadowOn","labelOffsetPrivate","classes","beforeSwitchLabelPosition","afterSwitchLabelPosition"],"mappings":";;;;AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,SAAS,EAAE,4BAA4B;AACvCC,EAAAA,QAAQ,EAAE,2BAA2B;AACrCC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,aAAa,EAAE,gCAAgC;AAC/CC,EAAAA,UAAU,EAAE,6BAA6B;AAEzC;AACAC,EAAAA,qBAAqB,EAAE,yCAAyC;AAChEC,EAAAA,oBAAoB,EAAE,wCAAwC;AAC9DC,EAAAA,mBAAmB,EAAE,uCAAuC;AAC5DC,EAAAA,qBAAqB,EAAE,yCAAyC;AAChEC,EAAAA,wBAAwB,EAAE,4CAA4C;AACtEC,EAAAA,qBAAqB,EAAE,yCAAyC;AAEhE;AACAC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,WAAW,EAAE,+BAA+B;AAE5C;AACAC,EAAAA,gBAAgB,EAAE,oCAAoC;AACtDC,EAAAA,iBAAiB,EAAE,qCAAqC;AAExD;AACAC,EAAAA,eAAe,EAAE,kCAAkC;AAEnDC,EAAAA,WAAW,EAAE,8BAA8B;AAC3CC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,WAAW,EAAE,+BAA+B;AAC5CC,EAAAA,kBAAkB,EAAE,kDAAkD;AACtEC,EAAAA,mBAAmB,EAAE,mDAAmD;AACxEC,EAAAA,kBAAkB,EAAE,kDAAkD;AACtEC,EAAAA,uBAAuB,EAAE,+DAA+D;AACxFC,EAAAA,mBAAmB,EAAE,mDAAmD;AACxEC,EAAAA,wBAAwB,EAAE,gEAAgE;AAE1FC,EAAAA,iBAAiB,EAAE,sCAAsC;AACzD;AACAC,EAAAA,sBAAsB,EAAE,8CAA8C;AACtEC,EAAAA,2BAA2B,EAAE,2DAA2D;AACxFC,EAAAA,uBAAuB,EAAE,+CAA+C;AACxEC,EAAAA,4BAA4B,EAAE,4DAA4D;AAE1FC,EAAAA,eAAe,EAAE,oCAAoC;AAErDC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,aAAa,EAAE,4CAA4C;AAC3DC,EAAAA,cAAc,EAAE,6CAA6C;AAC7DC,EAAAA,iBAAiB,EAAE,sCAAsC;AAEzDC,EAAAA,eAAe,EAAE,8BAA8B;AAE/CC,EAAAA,sBAAsB,EAAE,8CAA8C;AACtEC,EAAAA,uBAAuB,EAAE,+CAA+C;AACxEC,EAAAA,cAAc,EAAE,mCAAmC;AACnDC,EAAAA,gBAAgB,EAAE,gDAAgD;AAElEC,EAAAA,kBAAkB,EAAE,uCAAA;AACxB,EAAC;AAEM,IAAMC,OAAO,GAAG;AACnBC,EAAAA,yBAAyB,EAAE,8BAA8B;AACzDC,EAAAA,wBAAwB,EAAE,6BAAA;AAC9B;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_toggleSize/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport { StyledTrigger } from '../Switch.styles';\n\nexport const base = css`\n ${StyledTrigger} {\n box-sizing: border-box;\n flex: 0 0 var(${tokens.trackWidth});\n\n border-style: solid;\n border-width: var(${tokens.
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_toggleSize/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport { StyledInput, StyledTrigger } from '../Switch.styles';\n\nexport const base = css`\n ${StyledTrigger} {\n box-sizing: border-box;\n flex: 0 0 var(${tokens.trackWidth});\n\n border-style: solid;\n border-width: var(${tokens.trackBorderWidthOff});\n border-radius: var(${tokens.trackBorderRadius});\n\n width: var(${tokens.trackWidth});\n height: var(${tokens.trackHeight});\n\n &::after {\n width: var(${tokens.thumbSize});\n height: var(${tokens.thumbSize});\n border-radius: var(${tokens.thumbBorderRadius});\n margin: auto var(${tokens.thumbOffsetOff});\n }\n }\n\n ${StyledInput}:checked ~ ${StyledTrigger} {\n border-width: var(${tokens.trackBorderWidthOn}, var(${tokens.trackBorderWidthOff}));\n\n &::after {\n margin: auto var(${tokens.thumbOffsetOn});\n }\n }\n\n :active:not([disabled]) ${StyledTrigger}::after {\n width: calc(var(${tokens.thumbSize}) * var(${tokens.thumbPressScale}, 1));\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GA+BhB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b1wld3h3 .s2cs3kf{box-sizing:border-box;-webkit-flex:0 0 var(--plasma-switch__track-width);-ms-flex:0 0 var(--plasma-switch__track-width);flex:0 0 var(--plasma-switch__track-width);border-style:solid;border-width:var(--plasma-switch__track_checked_false-border-width);border-radius:var(--plasma-switch__track-border-radius);width:var(--plasma-switch__track-width);height:var(--plasma-switch__track-height);}.b1wld3h3 .s2cs3kf::after{width:var(--plasma-switch__thumb-size);height:var(--plasma-switch__thumb-size);border-radius:var(--plasma-switch__thumb-border-radius);margin:auto var(--plasma-switch__thumb_checked_false-offset);}.b1wld3h3 .ssthlx1:checked ~ .s2cs3kf{border-width:var(--plasma-switch__track_checked_true-border-width,var(--plasma-switch__track_checked_false-border-width));}.b1wld3h3 .ssthlx1:checked ~ .s2cs3kf::after{margin:auto var(--plasma-switch__thumb_checked_true-offset);}.b1wld3h3:active:not([disabled]) .s2cs3kf::after{width:calc(var(--plasma-switch__thumb-size) * var(--plasma-switch__thumb-scale,1));}
|
package/{es/components/Switch/_view/base_15atbyp.css → cjs/components/Switch/_view/base_qbpw2g.css}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
.b1g0jmh3 .s2cs3kf{background-color:var(--plasma-switch__track_checked_false-bg-color);border-color:var(--plasma-
|
1
|
+
.b1g0jmh3 .s2cs3kf{background-color:var(--plasma-switch__track_checked_false-bg-color);border-color:var(--plasma-switch__track_checked_false-border-color);}.b1g0jmh3 .ssthlx1:not([disabled]) ~ .s2cs3kf:hover{background-color:var(--plasma-switch__track_checked_false_hovered_true-bg-color,var(--plasma-switch__track_checked_false-bg-color));border-color:var(--plasma-switch__track_checked_false_hovered_true-border-color,var(--plasma-switch__track_checked_false-border-color));}.b1g0jmh3 .ssthlx1:checked ~ .s2cs3kf{background-color:var(--plasma-switch__track_checked_true-bg-color);border-color:var(--plasma-switch__track_checked_true-border-color);}.b1g0jmh3 .ssthlx1:checked:not([disabled]) ~ .s2cs3kf:hover{background-color:var(--plasma-switch__track_checked_true_hovered_true-bg-color,var(--plasma-switch__track_checked_true-bg-color));border-color:var(--plasma-switch__track_checked_true_hovered_true-border-color,var(--plasma-switch__track_checked_true-border-color));}.b1g0jmh3 .s2cs3kf::after{background-color:var(--plasma-switch__thumb_checked_false-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow);}.b1g0jmh3 .ssthlx1:checked ~ .s2cs3kf::after{background-color:var(--plasma-switch__thumb_checked_true-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow_checked_true,var(--plasma-switch__thumb-box-shadow));}.b1g0jmh3 .s1ilr5eq{color:var(--plasma-switch__label-color);}.b1g0jmh3 .sdjnckq{color:var(--plasma-switch__description-color);}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.Typography_styles_6mr47g_b1ru04lg__ff3be7fe{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_6mr47g_b1ru04lg__ff3be7fe.Typography_styles_6mr47g_typographyBold__ff3be7fe{font-weight:var(--typo-font-weight-bold);}.Typography_styles_6mr47g_b1ru04lg__ff3be7fe.Typography_styles_6mr47g_withBreakWord__ff3be7fe{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.TypographyOld_styles_17w0rtq_b9p5ato__18359621{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_17w0rtq_b9p5ato__18359621.TypographyOld_styles_17w0rtq_withBreakWord__18359621{overflow-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
.Paragraph_styles_179bahu_bgybk92__d9a8cadb{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_179bahu_bgybk92__d9a8cadb.Paragraph_styles_179bahu_withBreakWord__d9a8cadb{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 ${String(applyHyphensNormal)};\n\n &.${String(classes.typoWithBreakWord)} {\n ${String(applyHyphens)};\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAchB;;;;"}
|
@@ -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-
|
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 +1 @@
|
|
1
|
-
.
|
1
|
+
.Subtitle_styles_1plleej_b810c19__d9c54bce{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;}
|
@@ -6,25 +6,19 @@ 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');
|
11
9
|
var Subtitle_styles = require('./Subtitle.styles.js');
|
12
10
|
|
13
|
-
var _excluded = ["size", "children", "color", "
|
11
|
+
var _excluded = ["size", "children", "color", "style"];
|
14
12
|
var subtitleRoot = function subtitleRoot(Root) {
|
15
13
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
16
14
|
var size = props.size,
|
17
15
|
children = props.children,
|
18
16
|
color = props.color,
|
19
|
-
noWrap = props.noWrap,
|
20
|
-
className = props.className,
|
21
17
|
style = props.style,
|
22
18
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
23
|
-
var withNoWrap = noWrap ? tokens.classes.typoWithNoWrap : undefined;
|
24
19
|
return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
25
20
|
size: size,
|
26
21
|
ref: ref,
|
27
|
-
className: index.cx(withNoWrap, className),
|
28
22
|
style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
29
23
|
color: color
|
30
24
|
}, style), applySpacing.applySpacing(rest))
|