@ceed/cds 0.0.187-treeshaking.1 → 0.0.187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordions/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.d.ts +2 -2
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Box/index.d.ts +2 -2
- package/dist/components/Breadcrumbs/index.d.ts +2 -2
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Calendar/hooks/use-calendar-props.d.ts +3 -3
- package/dist/components/Calendar/hooks/use-calendar.d.ts +1 -1
- package/dist/components/Calendar/index.d.ts +2 -2
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/Chip/index.d.ts +2 -2
- package/dist/components/Container/index.d.ts +2 -2
- package/dist/components/CurrencyInput/index.d.ts +2 -2
- package/dist/components/DataTable/DataTable.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts +2 -2
- package/dist/components/DataTable/types.d.ts +7 -7
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts +2 -2
- package/dist/components/DialogActions/index.d.ts +2 -2
- package/dist/components/DialogContent/index.d.ts +2 -2
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogFrame/index.d.ts +2 -2
- package/dist/components/DialogTitle/index.d.ts +2 -2
- package/dist/components/Divider/index.d.ts +2 -2
- package/dist/components/Drawer/index.d.ts +2 -2
- package/dist/components/Dropdown/index.d.ts +2 -2
- package/dist/components/FormControl/index.d.ts +2 -2
- package/dist/components/FormHelperText/index.d.ts +2 -2
- package/dist/components/FormLabel/index.d.ts +2 -2
- package/dist/components/Grid/index.d.ts +2 -2
- package/dist/components/IconButton/index.d.ts +2 -2
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/index.d.ts +2 -2
- package/dist/components/InsetDrawer/index.d.ts +2 -2
- package/dist/components/Markdown/Markdown.d.ts +22 -6
- package/dist/components/Markdown/index.d.ts +2 -2
- package/dist/components/Menu/index.d.ts +2 -2
- package/dist/components/MenuButton/MenuButton.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +4 -4
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/MonthPicker/MonthPicker.d.ts +1 -1
- package/dist/components/MonthPicker/index.d.ts +2 -2
- package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +1 -1
- package/dist/components/MonthRangePicker/index.d.ts +2 -2
- package/dist/components/NavigationGroup/index.d.ts +2 -2
- package/dist/components/NavigationItem/index.d.ts +2 -2
- package/dist/components/Navigator/index.d.ts +2 -2
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/Pagination/index.d.ts +2 -2
- package/dist/components/PercentageInput/index.d.ts +2 -2
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/RadioList/RadioList.d.ts +1 -1
- package/dist/components/RadioList/index.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Sheet/index.d.ts +2 -2
- package/dist/components/Stack/index.d.ts +2 -2
- package/dist/components/Stepper/index.d.ts +2 -2
- package/dist/components/Switch/index.d.ts +2 -2
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Textarea/Textarea.d.ts +17 -3
- package/dist/components/Textarea/index.d.ts +2 -2
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +7 -7
- package/dist/components/ThemeProvider/index.d.ts +2 -2
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/components/Uploader/Uploader.d.ts +3 -4
- package/dist/components/Uploader/index.d.ts +2 -2
- package/dist/components/index.d.ts +53 -53
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -52
- package/framer/index.js +30 -30
- package/package.json +4 -8
- package/dist/_virtual/_commonjsHelpers.js +0 -30
- package/dist/_virtual/bind-all.js +0 -3
- package/dist/_virtual/bind.js +0 -3
- package/dist/_virtual/colorManipulator.js +0 -5
- package/dist/_virtual/colorManipulator2.js +0 -3
- package/dist/_virtual/createStyled.js +0 -7
- package/dist/_virtual/createStyled2.js +0 -3
- package/dist/_virtual/extends.js +0 -3
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index10.js +0 -6
- package/dist/_virtual/index11.js +0 -6
- package/dist/_virtual/index12.js +0 -6
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/index3.js +0 -7
- package/dist/_virtual/index4.js +0 -3
- package/dist/_virtual/index5.js +0 -6
- package/dist/_virtual/index6.js +0 -6
- package/dist/_virtual/index7.js +0 -6
- package/dist/_virtual/index8.js +0 -6
- package/dist/_virtual/index9.js +0 -6
- package/dist/_virtual/interopRequireDefault.js +0 -3
- package/dist/_virtual/objectWithoutPropertiesLoose.js +0 -3
- package/dist/components/Accordions/Accordions.js +0 -43
- package/dist/components/Autocomplete/Autocomplete.js +0 -196
- package/dist/components/Autocomplete/index.js +0 -5
- package/dist/components/Avatar/Avatar.js +0 -42
- package/dist/components/Box/Box.js +0 -8
- package/dist/components/Box/index.js +0 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -47
- package/dist/components/Button/Button.js +0 -20
- package/dist/components/Button/index.js +0 -5
- package/dist/components/Calendar/Calendar.js +0 -333
- package/dist/components/Calendar/hooks/use-calendar-props.js +0 -74
- package/dist/components/Calendar/hooks/use-calendar.js +0 -247
- package/dist/components/Calendar/index.js +0 -5
- package/dist/components/Calendar/utils/index.js +0 -74
- package/dist/components/Card/Card.js +0 -20
- package/dist/components/Checkbox/Checkbox.js +0 -19
- package/dist/components/Checkbox/index.js +0 -5
- package/dist/components/Chip/Chip.js +0 -8
- package/dist/components/Chip/index.js +0 -5
- package/dist/components/Container/Container.js +0 -49
- package/dist/components/CurrencyInput/CurrencyInput.js +0 -91
- package/dist/components/CurrencyInput/hooks/use-currency-setting.js +0 -167
- package/dist/components/CurrencyInput/index.js +0 -5
- package/dist/components/DataTable/DataTable.js +0 -568
- package/dist/components/DatePicker/DatePicker.js +0 -210
- package/dist/components/DatePicker/index.js +0 -5
- package/dist/components/DateRangePicker/DateRangePicker.js +0 -213
- package/dist/components/DialogActions/DialogActions.js +0 -14
- package/dist/components/DialogActions/index.js +0 -5
- package/dist/components/DialogContent/DialogContent.js +0 -11
- package/dist/components/DialogContent/index.js +0 -5
- package/dist/components/DialogFrame/DialogFrame.js +0 -31
- package/dist/components/DialogTitle/DialogTitle.js +0 -11
- package/dist/components/DialogTitle/index.js +0 -5
- package/dist/components/Divider/Divider.js +0 -19
- package/dist/components/Drawer/Drawer.js +0 -40
- package/dist/components/Dropdown/Dropdown.js +0 -8
- package/dist/components/Dropdown/index.js +0 -5
- package/dist/components/FormControl/FormControl.js +0 -15
- package/dist/components/FormControl/index.js +0 -5
- package/dist/components/FormHelperText/FormHelperText.js +0 -8
- package/dist/components/FormHelperText/index.js +0 -5
- package/dist/components/FormLabel/FormLabel.js +0 -8
- package/dist/components/FormLabel/index.js +0 -5
- package/dist/components/IconButton/IconButton.js +0 -20
- package/dist/components/IconButton/index.js +0 -5
- package/dist/components/Input/Input.js +0 -60
- package/dist/components/Input/index.js +0 -5
- package/dist/components/InsetDrawer/InsetDrawer.js +0 -30
- package/dist/components/Markdown/Markdown.js +0 -36
- package/dist/components/Menu/Menu.js +0 -43
- package/dist/components/Menu/index.js +0 -6
- package/dist/components/MenuButton/MenuButton.js +0 -26
- package/dist/components/Modal/Modal.js +0 -43
- package/dist/components/MonthPicker/MonthPicker.js +0 -162
- package/dist/components/MonthRangePicker/MonthRangePicker.js +0 -172
- package/dist/components/NavigationGroup/NavigationGroup.js +0 -42
- package/dist/components/NavigationItem/NavigationItem.js +0 -45
- package/dist/components/Navigator/Navigator.js +0 -30
- package/dist/components/Pagination/Pagination.js +0 -117
- package/dist/components/Pagination/index.js +0 -5
- package/dist/components/PercentageInput/PercentageInput.js +0 -85
- package/dist/components/Radio/Radio.js +0 -11
- package/dist/components/RadioList/RadioList.js +0 -18
- package/dist/components/Select/Select.js +0 -56
- package/dist/components/Select/index.js +0 -6
- package/dist/components/Sheet/Sheet.js +0 -8
- package/dist/components/Sheet/index.js +0 -5
- package/dist/components/Stack/index.js +0 -2
- package/dist/components/Stepper/Stepper.js +0 -66
- package/dist/components/Switch/Switch.js +0 -46
- package/dist/components/Table/Table.js +0 -64
- package/dist/components/Tabs/Tabs.js +0 -17
- package/dist/components/Textarea/Textarea.js +0 -31
- package/dist/components/Textarea/index.js +0 -5
- package/dist/components/ThemeProvider/ThemeProvider.js +0 -240
- package/dist/components/Tooltip/Tooltip.js +0 -19
- package/dist/components/Tooltip/index.js +0 -5
- package/dist/components/Typography/Typography.js +0 -19
- package/dist/components/Typography/index.js +0 -5
- package/dist/components/Uploader/Uploader.js +0 -402
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js +0 -8
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/external-adapter.js +0 -245
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js +0 -1
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/adapter.js +0 -1
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/file.js +0 -1
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js +0 -1
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js +0 -19
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js +0 -5
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js +0 -7
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js +0 -128
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js +0 -340
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js +0 -33
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js +0 -60
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js +0 -312
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js +0 -96
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js +0 -13
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/external/file.js +0 -23
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js +0 -18
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/prevent-unhandled.js +0 -102
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js +0 -10
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js +0 -3
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js +0 -123
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-entering-window.js +0 -55
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js +0 -18
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js +0 -55
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js +0 -49
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js +0 -16
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js +0 -15
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js +0 -18
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js +0 -8
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -7
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -5
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -7
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/defineProperty.js +0 -18
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/iterableToArray.js +0 -5
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -26
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/nonIterableRest.js +0 -5
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -5
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/slicedToArray.js +0 -10
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/toConsumableArray.js +0 -10
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/toPrimitive.js +0 -14
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/toPropertyKey.js +0 -9
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/typeof.js +0 -11
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -12
- package/dist/external/@babel/runtime/helpers/esm/extends.js +0 -16
- package/dist/external/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -14
- package/dist/external/@babel/runtime/helpers/extends.js +0 -28
- package/dist/external/@babel/runtime/helpers/interopRequireDefault.js +0 -19
- package/dist/external/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -26
- package/dist/external/@emotion/cache/dist/emotion-cache.esm.js +0 -653
- package/dist/external/@emotion/memoize/dist/emotion-memoize.esm.js +0 -9
- package/dist/external/@emotion/sheet/dist/emotion-sheet.esm.js +0 -154
- package/dist/external/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js +0 -16
- package/dist/external/@mui/icons-material/esm/ArrowUpwardRounded.js +0 -8
- package/dist/external/@mui/icons-material/esm/CalendarToday.js +0 -8
- package/dist/external/@mui/icons-material/esm/Check.js +0 -8
- package/dist/external/@mui/icons-material/esm/ChevronLeft.js +0 -8
- package/dist/external/@mui/icons-material/esm/ChevronRight.js +0 -8
- package/dist/external/@mui/icons-material/esm/ClearRounded.js +0 -8
- package/dist/external/@mui/icons-material/esm/Close.js +0 -8
- package/dist/external/@mui/icons-material/esm/CloudUploadRounded.js +0 -8
- package/dist/external/@mui/icons-material/esm/ExpandMore.js +0 -8
- package/dist/external/@mui/icons-material/esm/Info.js +0 -8
- package/dist/external/@mui/icons-material/esm/UploadFileRounded.js +0 -8
- package/dist/external/@mui/material/SvgIcon/SvgIcon.js +0 -186
- package/dist/external/@mui/material/SvgIcon/svgIconClasses.js +0 -9
- package/dist/external/@mui/material/colors/blue.js +0 -18
- package/dist/external/@mui/material/colors/common.js +0 -6
- package/dist/external/@mui/material/colors/green.js +0 -18
- package/dist/external/@mui/material/colors/grey.js +0 -18
- package/dist/external/@mui/material/colors/lightBlue.js +0 -18
- package/dist/external/@mui/material/colors/orange.js +0 -18
- package/dist/external/@mui/material/colors/purple.js +0 -18
- package/dist/external/@mui/material/colors/red.js +0 -18
- package/dist/external/@mui/material/styles/createMixins.js +0 -19
- package/dist/external/@mui/material/styles/createPalette.js +0 -308
- package/dist/external/@mui/material/styles/createTheme.js +0 -82
- package/dist/external/@mui/material/styles/createTransitions.js +0 -91
- package/dist/external/@mui/material/styles/createTypography.js +0 -93
- package/dist/external/@mui/material/styles/defaultTheme.js +0 -5
- package/dist/external/@mui/material/styles/identifier.js +0 -3
- package/dist/external/@mui/material/styles/rootShouldForwardProp.js +0 -5
- package/dist/external/@mui/material/styles/shadows.js +0 -11
- package/dist/external/@mui/material/styles/slotShouldForwardProp.js +0 -6
- package/dist/external/@mui/material/styles/styled.js +0 -12
- package/dist/external/@mui/material/styles/useThemeProps.js +0 -17
- package/dist/external/@mui/material/styles/zIndex.js +0 -14
- package/dist/external/@mui/material/utils/capitalize.js +0 -5
- package/dist/external/@mui/material/utils/createSvgIcon.js +0 -24
- package/dist/external/@mui/styled-engine/GlobalStyles/GlobalStyles.js +0 -24
- package/dist/external/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js +0 -37
- package/dist/external/@mui/styled-engine/index.js +0 -38
- package/dist/external/@mui/system/colorManipulator.js +0 -385
- package/dist/external/@mui/system/createStyled.js +0 -270
- package/dist/external/@mui/system/esm/borders.js +0 -51
- package/dist/external/@mui/system/esm/breakpoints.js +0 -66
- package/dist/external/@mui/system/esm/compose.js +0 -26
- package/dist/external/@mui/system/esm/createTheme/applyStyles.js +0 -76
- package/dist/external/@mui/system/esm/createTheme/createBreakpoints.js +0 -82
- package/dist/external/@mui/system/esm/createTheme/createSpacing.js +0 -34
- package/dist/external/@mui/system/esm/createTheme/createTheme.js +0 -45
- package/dist/external/@mui/system/esm/createTheme/index.js +0 -3
- package/dist/external/@mui/system/esm/createTheme/shape.js +0 -5
- package/dist/external/@mui/system/esm/cssGrid.js +0 -86
- package/dist/external/@mui/system/esm/memoize.js +0 -11
- package/dist/external/@mui/system/esm/merge.js +0 -12
- package/dist/external/@mui/system/esm/palette.js +0 -28
- package/dist/external/@mui/system/esm/responsivePropType.js +0 -5
- package/dist/external/@mui/system/esm/sizing.js +0 -67
- package/dist/external/@mui/system/esm/spacing.js +0 -144
- package/dist/external/@mui/system/esm/style.js +0 -77
- package/dist/external/@mui/system/esm/styleFunctionSx/defaultSxConfig.js +0 -293
- package/dist/external/@mui/system/esm/styleFunctionSx/extendSxProp.js +0 -51
- package/dist/external/@mui/system/esm/styleFunctionSx/index.js +0 -3
- package/dist/external/@mui/system/esm/styleFunctionSx/styleFunctionSx.js +0 -129
- package/dist/external/@mui/system/esm/useTheme.js +0 -9
- package/dist/external/@mui/system/esm/useThemeProps/getThemeProps.js +0 -15
- package/dist/external/@mui/system/esm/useThemeProps/useThemeProps.js +0 -22
- package/dist/external/@mui/system/esm/useThemeWithoutDefault.js +0 -12
- package/dist/external/@mui/utils/ClassNameGenerator/ClassNameGenerator.js +0 -18
- package/dist/external/@mui/utils/capitalize/capitalize.js +0 -14
- package/dist/external/@mui/utils/capitalize/index.js +0 -1
- package/dist/external/@mui/utils/clamp/clamp.js +0 -5
- package/dist/external/@mui/utils/clamp/index.js +0 -1
- package/dist/external/@mui/utils/composeClasses/composeClasses.js +0 -23
- package/dist/external/@mui/utils/deepmerge/deepmerge.js +0 -44
- package/dist/external/@mui/utils/deepmerge/index.js +0 -1
- package/dist/external/@mui/utils/formatMuiErrorMessage/formatMuiErrorMessage.js +0 -21
- package/dist/external/@mui/utils/formatMuiErrorMessage/index.js +0 -1
- package/dist/external/@mui/utils/generateUtilityClass/generateUtilityClass.js +0 -22
- package/dist/external/@mui/utils/generateUtilityClasses/generateUtilityClasses.js +0 -11
- package/dist/external/@mui/utils/getDisplayName/getDisplayName.js +0 -49
- package/dist/external/@mui/utils/getDisplayName/index.js +0 -1
- package/dist/external/@mui/utils/resolveProps/resolveProps.js +0 -37
- package/dist/external/bind-event-listener/dist/bind-all.js +0 -54
- package/dist/external/bind-event-listener/dist/bind.js +0 -21
- package/dist/external/bind-event-listener/dist/index.js +0 -21
- package/dist/external/clsx/dist/clsx.js +0 -3
- package/dist/external/object-assign/index.js +0 -99
- package/dist/external/prop-types/checkPropTypes.js +0 -115
- package/dist/external/prop-types/factoryWithThrowingShims.js +0 -74
- package/dist/external/prop-types/factoryWithTypeCheckers.js +0 -625
- package/dist/external/prop-types/index.js +0 -33
- package/dist/external/prop-types/lib/ReactPropTypesSecret.js +0 -21
- package/dist/external/prop-types/lib/has.js +0 -11
- package/dist/external/raf-schd/dist/raf-schd.esm.js +0 -34
- package/dist/external/stylis/src/Enum.js +0 -12
- package/dist/external/stylis/src/Middleware.js +0 -32
- package/dist/external/stylis/src/Parser.js +0 -193
- package/dist/external/stylis/src/Serializer.js +0 -38
- package/dist/external/stylis/src/Tokenizer.js +0 -223
- package/dist/external/stylis/src/Utility.js +0 -117
- package/dist/hooks/use-controlled-state/index.js +0 -23
- package/dist/libs/rehype-accent/index.js +0 -39
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import React__default, { forwardRef, useMemo, Fragment } from 'react';
|
|
2
|
-
import { styled } from '@mui/joy';
|
|
3
|
-
import PreviousIcon from '../../external/@mui/icons-material/esm/ChevronLeft.js';
|
|
4
|
-
import NextIcon from '../../external/@mui/icons-material/esm/ChevronRight.js';
|
|
5
|
-
import { motion, AnimatePresence } from 'framer-motion';
|
|
6
|
-
import { Button } from '../Button/Button.js';
|
|
7
|
-
import { Typography } from '../Typography/Typography.js';
|
|
8
|
-
import { getCalendarDates, getWeekdayNames, getMonthNameFromIndex } from './utils/index.js';
|
|
9
|
-
import { IconButton } from '../IconButton/IconButton.js';
|
|
10
|
-
import { useCalendarProps } from './hooks/use-calendar-props.js';
|
|
11
|
-
import { useCalendar } from './hooks/use-calendar.js';
|
|
12
|
-
|
|
13
|
-
const CalendarRoot = styled("div", {
|
|
14
|
-
name: "Calendar",
|
|
15
|
-
slot: "root",
|
|
16
|
-
})({
|
|
17
|
-
maxWidth: "264px",
|
|
18
|
-
});
|
|
19
|
-
const CalendarHeader = styled("div", {
|
|
20
|
-
name: "Calendar",
|
|
21
|
-
slot: "calendarHeader",
|
|
22
|
-
})(({ theme }) => ({
|
|
23
|
-
display: "flex",
|
|
24
|
-
justifyContent: "space-between",
|
|
25
|
-
alignItems: "center",
|
|
26
|
-
padding: theme.spacing(2),
|
|
27
|
-
}));
|
|
28
|
-
const CalendarViewContainer = styled("div", {
|
|
29
|
-
name: "Calendar",
|
|
30
|
-
slot: "viewContainer",
|
|
31
|
-
shouldForwardProp: (prop) => prop !== "calendarType",
|
|
32
|
-
})(({ theme, calendarType }) => ({
|
|
33
|
-
paddingLeft: theme.spacing(2),
|
|
34
|
-
paddingRight: theme.spacing(2),
|
|
35
|
-
position: "relative",
|
|
36
|
-
overflow: "hidden",
|
|
37
|
-
minHeight: calendarType === "datePicker" ? "250px" : "unset",
|
|
38
|
-
}));
|
|
39
|
-
const CalendarViewTable = styled(motion.table, {
|
|
40
|
-
name: "Calendar",
|
|
41
|
-
slot: "viewTable",
|
|
42
|
-
})(({ theme }) => ({
|
|
43
|
-
borderSpacing: 0,
|
|
44
|
-
"& td, & th": {
|
|
45
|
-
padding: 0,
|
|
46
|
-
},
|
|
47
|
-
"& th": {
|
|
48
|
-
paddingTop: theme.spacing(2),
|
|
49
|
-
paddingBottom: theme.spacing(2),
|
|
50
|
-
},
|
|
51
|
-
}));
|
|
52
|
-
const CalendarWeekHeaderContainer = styled("thead", {
|
|
53
|
-
name: "Calendar",
|
|
54
|
-
slot: "weekHeaderContainer",
|
|
55
|
-
})({});
|
|
56
|
-
const CalendarDayPickerContainer = styled("tbody", {
|
|
57
|
-
name: "Calendar",
|
|
58
|
-
slot: "dayPickerContainer",
|
|
59
|
-
})({});
|
|
60
|
-
const CalendarSwitchViewButton = styled(Button, {
|
|
61
|
-
name: "Calendar",
|
|
62
|
-
slot: "switchViewButton",
|
|
63
|
-
})(({ ownerState }) => [
|
|
64
|
-
ownerState.view === "month" && {
|
|
65
|
-
pointerEvents: "none",
|
|
66
|
-
},
|
|
67
|
-
]);
|
|
68
|
-
const CalendarDayCell = styled("td", {
|
|
69
|
-
name: "Calendar",
|
|
70
|
-
slot: "dayCell",
|
|
71
|
-
})(({ theme }) => ({
|
|
72
|
-
// aria-current=date === range에 포함된 버튼
|
|
73
|
-
"&[aria-current=date]": {
|
|
74
|
-
position: "relative",
|
|
75
|
-
"& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)": {
|
|
76
|
-
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
|
|
77
|
-
},
|
|
78
|
-
'& + td[aria-hidden] + td[aria-current="date"]::before': {
|
|
79
|
-
content: '""',
|
|
80
|
-
position: "absolute",
|
|
81
|
-
top: 0,
|
|
82
|
-
left: "-10px",
|
|
83
|
-
bottom: 0,
|
|
84
|
-
width: "16px",
|
|
85
|
-
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
|
|
86
|
-
zIndex: -1,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
}));
|
|
90
|
-
const CalendarMonthCell = styled("td", {
|
|
91
|
-
name: "Calendar",
|
|
92
|
-
slot: "monthCell",
|
|
93
|
-
})(({ theme }) => ({
|
|
94
|
-
// aria-current=date === range에 포함된 버튼
|
|
95
|
-
"&[aria-current=date]": {
|
|
96
|
-
position: "relative",
|
|
97
|
-
"& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)": {
|
|
98
|
-
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
|
|
99
|
-
},
|
|
100
|
-
'& + td[aria-hidden] + td[aria-current="date"]::before': {
|
|
101
|
-
content: '""',
|
|
102
|
-
position: "absolute",
|
|
103
|
-
top: 0,
|
|
104
|
-
left: "-10px",
|
|
105
|
-
bottom: 0,
|
|
106
|
-
width: "16px",
|
|
107
|
-
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
|
|
108
|
-
zIndex: -1,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
}));
|
|
112
|
-
const CalendarMonth = styled(Button, {
|
|
113
|
-
name: "Calendar",
|
|
114
|
-
slot: "month",
|
|
115
|
-
shouldForwardProp: (prop) => prop !== "isSelected",
|
|
116
|
-
})(({ theme, isSelected, disabled }) => [
|
|
117
|
-
{
|
|
118
|
-
width: "59px",
|
|
119
|
-
// height: "32px",
|
|
120
|
-
textAlign: "center",
|
|
121
|
-
"&:hover": {
|
|
122
|
-
color: theme.palette.primary.softColor,
|
|
123
|
-
backgroundColor: theme.palette.primary.softHoverBg,
|
|
124
|
-
},
|
|
125
|
-
"&:active": {
|
|
126
|
-
color: theme.palette.primary.softColor,
|
|
127
|
-
backgroundColor: theme.palette.primary.softActiveBg,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
isSelected && {
|
|
131
|
-
backgroundColor: theme.palette.primary.solidBg,
|
|
132
|
-
color: theme.palette.primary.solidColor,
|
|
133
|
-
"&:hover": {
|
|
134
|
-
color: theme.palette.primary.solidColor,
|
|
135
|
-
backgroundColor: theme.palette.primary.solidHoverBg,
|
|
136
|
-
},
|
|
137
|
-
"&:active": {
|
|
138
|
-
color: theme.palette.primary.solidColor,
|
|
139
|
-
backgroundColor: theme.palette.primary.solidActiveBg,
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
disabled && {
|
|
143
|
-
color: theme.palette.neutral.solidDisabledColor,
|
|
144
|
-
backgroundColor: theme.palette.neutral.solidDisabledBg,
|
|
145
|
-
},
|
|
146
|
-
]);
|
|
147
|
-
const CalendarDay = styled(Button, {
|
|
148
|
-
name: "Calendar",
|
|
149
|
-
slot: "day",
|
|
150
|
-
shouldForwardProp: (prop) => !["isToday", "isSelected"].includes(prop),
|
|
151
|
-
})(({ theme, isToday, isSelected, disabled }) => [
|
|
152
|
-
{
|
|
153
|
-
width: "32px",
|
|
154
|
-
height: "32px",
|
|
155
|
-
textAlign: "center",
|
|
156
|
-
"&:hover": {
|
|
157
|
-
color: theme.palette.primary.softColor,
|
|
158
|
-
backgroundColor: theme.palette.primary.softHoverBg,
|
|
159
|
-
},
|
|
160
|
-
"&:active": {
|
|
161
|
-
color: theme.palette.primary.softColor,
|
|
162
|
-
backgroundColor: theme.palette.primary.softActiveBg,
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
// NOTE: enabled, disabled 일때만 border 적용
|
|
166
|
-
isToday &&
|
|
167
|
-
!isSelected && {
|
|
168
|
-
"&:not([aria-current=date]):not(:hover)": {
|
|
169
|
-
border: `1px solid ${theme.palette.neutral.outlinedBorder}`,
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
isSelected && {
|
|
173
|
-
backgroundColor: theme.palette.primary.solidBg,
|
|
174
|
-
color: theme.palette.primary.solidColor,
|
|
175
|
-
"&:hover": {
|
|
176
|
-
color: theme.palette.primary.solidColor,
|
|
177
|
-
backgroundColor: theme.palette.primary.solidHoverBg,
|
|
178
|
-
},
|
|
179
|
-
"&:active": {
|
|
180
|
-
color: theme.palette.primary.solidColor,
|
|
181
|
-
backgroundColor: theme.palette.primary.solidActiveBg,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
disabled && {
|
|
185
|
-
color: theme.palette.neutral.solidDisabledColor,
|
|
186
|
-
backgroundColor: theme.palette.neutral.solidDisabledBg,
|
|
187
|
-
},
|
|
188
|
-
]);
|
|
189
|
-
const variants = {
|
|
190
|
-
enter: (direction) => {
|
|
191
|
-
return {
|
|
192
|
-
x: direction > 0 ? 300 : -300,
|
|
193
|
-
opacity: 0,
|
|
194
|
-
};
|
|
195
|
-
},
|
|
196
|
-
center: {
|
|
197
|
-
position: "relative",
|
|
198
|
-
zIndex: 1,
|
|
199
|
-
x: 0,
|
|
200
|
-
opacity: 1,
|
|
201
|
-
},
|
|
202
|
-
exit: (direction) => {
|
|
203
|
-
return {
|
|
204
|
-
position: "absolute",
|
|
205
|
-
zIndex: 0,
|
|
206
|
-
x: direction < 0 ? 300 : -300,
|
|
207
|
-
opacity: 0,
|
|
208
|
-
};
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
const swipeConfidenceThreshold = 10000;
|
|
212
|
-
const swipePower = (offset, velocity) => {
|
|
213
|
-
return Math.abs(offset) * velocity;
|
|
214
|
-
};
|
|
215
|
-
const PickerDays = (props) => {
|
|
216
|
-
// prop destruction
|
|
217
|
-
const { ownerState } = props;
|
|
218
|
-
// lib hooks
|
|
219
|
-
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
220
|
-
// state, ref, querystring hooks
|
|
221
|
-
// form hooks
|
|
222
|
-
// query hooks
|
|
223
|
-
// calculated values
|
|
224
|
-
const calendarDates = useMemo(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
225
|
-
const weekdayNames = useMemo(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
226
|
-
// effects
|
|
227
|
-
// handlers
|
|
228
|
-
return (React__default.createElement(CalendarViewContainer, { calendarType: "datePicker" },
|
|
229
|
-
React__default.createElement(AnimatePresence, { initial: false, custom: ownerState.direction },
|
|
230
|
-
React__default.createElement(CalendarViewTable
|
|
231
|
-
// #region framer-motion
|
|
232
|
-
, {
|
|
233
|
-
// #region framer-motion
|
|
234
|
-
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`, custom: ownerState.direction, variants: variants, initial: "enter", animate: "center", exit: "exit", transition: {
|
|
235
|
-
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
236
|
-
opacity: { duration: 0.2 },
|
|
237
|
-
}, drag: "x", dragConstraints: { left: 0, right: 0 }, dragElastic: 1, onDragEnd: (e, { offset, velocity }) => {
|
|
238
|
-
const swipe = swipePower(offset.x, velocity.x);
|
|
239
|
-
if (swipe < -1e4) {
|
|
240
|
-
const date = new Date(ownerState.viewMonth || new Date());
|
|
241
|
-
date.setMonth(date.getMonth() + 1);
|
|
242
|
-
ownerState.onMonthChange?.(date);
|
|
243
|
-
}
|
|
244
|
-
else if (swipe > swipeConfidenceThreshold) {
|
|
245
|
-
const date = new Date(ownerState.viewMonth || new Date());
|
|
246
|
-
date.setMonth(date.getMonth() - 1);
|
|
247
|
-
ownerState.onMonthChange?.(date);
|
|
248
|
-
}
|
|
249
|
-
} },
|
|
250
|
-
React__default.createElement(CalendarWeekHeaderContainer, null,
|
|
251
|
-
React__default.createElement("tr", null, weekdayNames.map((name, i) => (React__default.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` },
|
|
252
|
-
React__default.createElement("th", null,
|
|
253
|
-
React__default.createElement(Typography, { level: "body-xs", textAlign: "center" }, name)),
|
|
254
|
-
i < 6 && (React__default.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))))),
|
|
255
|
-
React__default.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => (React__default.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` },
|
|
256
|
-
React__default.createElement("tr", null, weekDates.map((date, i) => date ? (React__default.createElement(Fragment, { key: i },
|
|
257
|
-
React__default.createElement(CalendarDayCell, { ...getDayCellProps(date) },
|
|
258
|
-
React__default.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)),
|
|
259
|
-
i < 6 && (React__default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })))) : (React__default.createElement(Fragment, { key: i },
|
|
260
|
-
React__default.createElement("td", null),
|
|
261
|
-
i < 6 && (React__default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })))))),
|
|
262
|
-
rowIndex < calendarDates.length - 1 && (React__default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" },
|
|
263
|
-
React__default.createElement("td", { colSpan: 13, style: { height: 4 } })))))))))));
|
|
264
|
-
};
|
|
265
|
-
const PickerMonths = (props) => {
|
|
266
|
-
const { ownerState } = props;
|
|
267
|
-
const { getPickerMonthProps, getMonthCellProps } = useCalendar(ownerState);
|
|
268
|
-
const chunkedMonths = Array.from({ length: 12 }, (_, i) => i).reduce((acc, month) => {
|
|
269
|
-
if (acc[acc.length - 1].length === 4) {
|
|
270
|
-
acc.push([]);
|
|
271
|
-
}
|
|
272
|
-
acc[acc.length - 1].push(month);
|
|
273
|
-
return acc;
|
|
274
|
-
}, [[]]);
|
|
275
|
-
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
276
|
-
return (React__default.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" },
|
|
277
|
-
React__default.createElement(AnimatePresence, { initial: false, custom: ownerState.direction },
|
|
278
|
-
React__default.createElement(CalendarViewTable
|
|
279
|
-
// #region framer-motion
|
|
280
|
-
, {
|
|
281
|
-
// #region framer-motion
|
|
282
|
-
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`, custom: ownerState.direction, variants: variants, initial: "enter", animate: "center", exit: "exit", transition: {
|
|
283
|
-
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
284
|
-
opacity: { duration: 0.2 },
|
|
285
|
-
}, drag: "x", dragConstraints: { left: 0, right: 0 }, dragElastic: 1, onDragEnd: (e, { offset, velocity }) => {
|
|
286
|
-
const swipe = swipePower(offset.x, velocity.x);
|
|
287
|
-
if (swipe < -1e4) {
|
|
288
|
-
const date = new Date(ownerState.viewMonth || new Date());
|
|
289
|
-
date.setMonth(date.getMonth() + 1);
|
|
290
|
-
ownerState.onMonthChange?.(date);
|
|
291
|
-
}
|
|
292
|
-
else if (swipe > swipeConfidenceThreshold) {
|
|
293
|
-
const date = new Date(ownerState.viewMonth || new Date());
|
|
294
|
-
date.setMonth(date.getMonth() - 1);
|
|
295
|
-
ownerState.onMonthChange?.(date);
|
|
296
|
-
}
|
|
297
|
-
} },
|
|
298
|
-
React__default.createElement("tbody", null, chunkedMonths.map((months, i) => (React__default.createElement(Fragment, { key: i },
|
|
299
|
-
React__default.createElement("tr", null, months.map((monthIndex, j) => (React__default.createElement(Fragment, { key: monthIndex },
|
|
300
|
-
React__default.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) },
|
|
301
|
-
React__default.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))),
|
|
302
|
-
j < 3 && (React__default.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))))),
|
|
303
|
-
i < chunkedMonths.length - 1 && (React__default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" },
|
|
304
|
-
React__default.createElement("td", { colSpan: 7, style: { height: 4 } })))))))))));
|
|
305
|
-
};
|
|
306
|
-
/**
|
|
307
|
-
* @see https://mui.com/x/api/date-pickers/date-calendar/ 인터페이스 참고
|
|
308
|
-
*/
|
|
309
|
-
const Calendar = forwardRef((inProps, ref) => {
|
|
310
|
-
// prop destruction
|
|
311
|
-
const [props, ownerState] = useCalendarProps(inProps);
|
|
312
|
-
const { value, defaultValue, onChange, locale, onViewChange, onMonthChange, view, views, rangeSelection, minDate, maxDate, disableFuture, disablePast, ...others } = props;
|
|
313
|
-
// lib hooks
|
|
314
|
-
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
315
|
-
// state, ref, querystring hooks
|
|
316
|
-
// form hooks
|
|
317
|
-
// query hooks
|
|
318
|
-
// calculated values
|
|
319
|
-
// effects
|
|
320
|
-
// handlers
|
|
321
|
-
return (React__default.createElement(CalendarRoot, { ref: ref, ...others },
|
|
322
|
-
React__default.createElement(CalendarHeader, null,
|
|
323
|
-
React__default.createElement(IconButton, { size: "sm", onClick: onPrev, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` },
|
|
324
|
-
React__default.createElement(PreviousIcon, null)),
|
|
325
|
-
React__default.createElement(CalendarSwitchViewButton, { ownerState: ownerState, variant: "plain", color: "neutral", onClick: onViewChange, "aria-label": "Switch Calendar View" }, calendarTitle),
|
|
326
|
-
React__default.createElement(IconButton, { size: "sm", onClick: onNext, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` },
|
|
327
|
-
React__default.createElement(NextIcon, null))),
|
|
328
|
-
view === "day" && React__default.createElement(PickerDays, { ownerState: ownerState }),
|
|
329
|
-
view === "month" && React__default.createElement(PickerMonths, { ownerState: ownerState })));
|
|
330
|
-
});
|
|
331
|
-
Calendar.displayName = "Calendar";
|
|
332
|
-
|
|
333
|
-
export { Calendar };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
2
|
-
import { useThemeProps } from '@mui/joy';
|
|
3
|
-
|
|
4
|
-
const resolveView = (view, views) => {
|
|
5
|
-
return views.includes(view) ? view : views[0];
|
|
6
|
-
};
|
|
7
|
-
const useCalendarProps = (inProps) => {
|
|
8
|
-
const [uncontrolledView, setUncontrolledView] = useState(() => resolveView(inProps.view || "day", inProps.views || ["day", "month"]));
|
|
9
|
-
const [uncontrolledValue, setUncontrolledValue] = useState(inProps.defaultValue);
|
|
10
|
-
const [viewMonth, setViewMonth] = useState(() => {
|
|
11
|
-
const today = new Date();
|
|
12
|
-
today.setDate(1);
|
|
13
|
-
today.setHours(0, 0, 0, 0);
|
|
14
|
-
return inProps.value?.[0] || inProps.defaultValue?.[0] || today;
|
|
15
|
-
});
|
|
16
|
-
const [[page, direction], setPage] = useState([0, 0]);
|
|
17
|
-
const resolvedView = inProps.view ?? uncontrolledView;
|
|
18
|
-
const paginate = (newDirection) => {
|
|
19
|
-
setPage([page + newDirection, newDirection]);
|
|
20
|
-
};
|
|
21
|
-
const handleViewMonthChange = useCallback((newMonth) => {
|
|
22
|
-
setViewMonth(newMonth);
|
|
23
|
-
if (resolvedView === "month") {
|
|
24
|
-
if (viewMonth.getFullYear() !== newMonth.getFullYear()) {
|
|
25
|
-
paginate(newMonth > viewMonth ? 1 : -1);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
paginate(newMonth > viewMonth ? 1 : -1);
|
|
30
|
-
}
|
|
31
|
-
inProps.onMonthChange?.(newMonth);
|
|
32
|
-
}, [inProps.onMonthChange, viewMonth, resolvedView]);
|
|
33
|
-
const props = useThemeProps({
|
|
34
|
-
props: {
|
|
35
|
-
locale: "default",
|
|
36
|
-
views: ["day", "month"],
|
|
37
|
-
view: resolvedView,
|
|
38
|
-
value: inProps.value ?? uncontrolledValue,
|
|
39
|
-
...inProps,
|
|
40
|
-
// overrides
|
|
41
|
-
onChange: inProps.value
|
|
42
|
-
? // Controlled
|
|
43
|
-
inProps.onChange
|
|
44
|
-
: // Uncontrolled
|
|
45
|
-
(value) => {
|
|
46
|
-
setUncontrolledValue(value);
|
|
47
|
-
inProps.onChange?.(value);
|
|
48
|
-
},
|
|
49
|
-
onMonthChange: handleViewMonthChange,
|
|
50
|
-
onViewChange: () => {
|
|
51
|
-
const newView = resolvedView === "month" ? "day" : "month";
|
|
52
|
-
const isAllowedView = !inProps.views
|
|
53
|
-
? true
|
|
54
|
-
: inProps.views.includes(newView);
|
|
55
|
-
if (!isAllowedView || inProps.view === newView)
|
|
56
|
-
return;
|
|
57
|
-
if (inProps.onViewChange) {
|
|
58
|
-
inProps.onViewChange(newView);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
setUncontrolledView(newView);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
name: "Calendar",
|
|
66
|
-
});
|
|
67
|
-
/**
|
|
68
|
-
* For ownerState
|
|
69
|
-
*/
|
|
70
|
-
const ownerState = useMemo(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
71
|
-
return [props, ownerState];
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { useCalendarProps };
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
import { getYearName, getMonthName, isWithinRange, isSameDay, isToday, isSameMonth } from '../utils/index.js';
|
|
3
|
-
|
|
4
|
-
const useCalendar = (ownerState) => {
|
|
5
|
-
const [hoverDay, setHoverDay] = useState(null);
|
|
6
|
-
const [hoverMonth, setHoverMonth] = useState(null);
|
|
7
|
-
return {
|
|
8
|
-
calendarTitle: ownerState.view === "month"
|
|
9
|
-
? getYearName(ownerState.viewMonth, ownerState.locale || "default")
|
|
10
|
-
: getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
|
|
11
|
-
onPrev: useCallback(() => {
|
|
12
|
-
if (ownerState.view === "day") {
|
|
13
|
-
const prevMonth = new Date(ownerState.viewMonth || new Date());
|
|
14
|
-
prevMonth.setMonth(prevMonth.getMonth() - 1);
|
|
15
|
-
ownerState.onMonthChange?.(prevMonth);
|
|
16
|
-
}
|
|
17
|
-
else if (ownerState.view === "month") {
|
|
18
|
-
const prevYear = new Date(ownerState.viewMonth || new Date());
|
|
19
|
-
prevYear.setFullYear(prevYear.getFullYear() - 1);
|
|
20
|
-
ownerState.onMonthChange?.(prevYear);
|
|
21
|
-
}
|
|
22
|
-
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
23
|
-
onNext: useCallback(() => {
|
|
24
|
-
if (ownerState.view === "day") {
|
|
25
|
-
const nextMonth = new Date(ownerState.viewMonth || new Date());
|
|
26
|
-
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
|
27
|
-
ownerState.onMonthChange?.(nextMonth);
|
|
28
|
-
}
|
|
29
|
-
else if (ownerState.view === "month") {
|
|
30
|
-
const nextYear = new Date(ownerState.viewMonth || new Date());
|
|
31
|
-
nextYear.setFullYear(nextYear.getFullYear() + 1);
|
|
32
|
-
ownerState.onMonthChange?.(nextYear);
|
|
33
|
-
}
|
|
34
|
-
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
35
|
-
getDayCellProps: useCallback((day) => {
|
|
36
|
-
const thisDay = new Date(ownerState.viewMonth || new Date());
|
|
37
|
-
thisDay.setHours(0, 0, 0, 0);
|
|
38
|
-
thisDay.setDate(day);
|
|
39
|
-
const inRange = ownerState.rangeSelection &&
|
|
40
|
-
ownerState.value &&
|
|
41
|
-
ownerState.value[0] &&
|
|
42
|
-
// NOTE: hover day is not included in the range
|
|
43
|
-
((hoverDay &&
|
|
44
|
-
isWithinRange(ownerState.value[0], hoverDay, thisDay)) ||
|
|
45
|
-
// NOTE: Selected range is included in the range
|
|
46
|
-
(ownerState.value[1] &&
|
|
47
|
-
isWithinRange(ownerState.value[0], ownerState.value[1], thisDay)));
|
|
48
|
-
return {
|
|
49
|
-
"aria-label": thisDay.toLocaleDateString(),
|
|
50
|
-
"aria-current": inRange ? "date" : undefined,
|
|
51
|
-
};
|
|
52
|
-
}, [
|
|
53
|
-
ownerState.rangeSelection,
|
|
54
|
-
ownerState.value,
|
|
55
|
-
ownerState.viewMonth,
|
|
56
|
-
hoverDay,
|
|
57
|
-
]),
|
|
58
|
-
getMonthCellProps: useCallback((monthIndex) => {
|
|
59
|
-
const thisMonth = new Date(ownerState.viewMonth || new Date());
|
|
60
|
-
thisMonth.setDate(1);
|
|
61
|
-
thisMonth.setHours(0, 0, 0, 0);
|
|
62
|
-
thisMonth.setMonth(monthIndex);
|
|
63
|
-
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") &&
|
|
64
|
-
ownerState.rangeSelection;
|
|
65
|
-
const inRange = isMonthRangeSelection &&
|
|
66
|
-
ownerState.value &&
|
|
67
|
-
ownerState.value[0] &&
|
|
68
|
-
// NOTE: hover day is not included in the range
|
|
69
|
-
((hoverMonth &&
|
|
70
|
-
isWithinRange(ownerState.value[0], hoverMonth, thisMonth)) ||
|
|
71
|
-
// NOTE: Selected range is included in the range
|
|
72
|
-
(ownerState.value[1] &&
|
|
73
|
-
isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth)));
|
|
74
|
-
return {
|
|
75
|
-
"aria-label": thisMonth.toLocaleDateString(),
|
|
76
|
-
"aria-current": inRange ? "date" : undefined,
|
|
77
|
-
};
|
|
78
|
-
}, [
|
|
79
|
-
ownerState.rangeSelection,
|
|
80
|
-
ownerState.value,
|
|
81
|
-
ownerState.viewMonth,
|
|
82
|
-
hoverMonth,
|
|
83
|
-
]),
|
|
84
|
-
getPickerDayProps: useCallback((day) => {
|
|
85
|
-
const thisDay = new Date(ownerState.viewMonth || new Date());
|
|
86
|
-
thisDay.setHours(0, 0, 0, 0);
|
|
87
|
-
thisDay.setDate(day);
|
|
88
|
-
const isSelected = !!ownerState.value &&
|
|
89
|
-
(isSameDay(thisDay, ownerState.value[0]) ||
|
|
90
|
-
(ownerState.value[1] && isSameDay(thisDay, ownerState.value[1])));
|
|
91
|
-
const inRange = ownerState.rangeSelection &&
|
|
92
|
-
ownerState.value &&
|
|
93
|
-
ownerState.value[0] &&
|
|
94
|
-
// NOTE: hover day is not included in the range
|
|
95
|
-
((hoverDay &&
|
|
96
|
-
isWithinRange(ownerState.value[0], hoverDay, thisDay)) ||
|
|
97
|
-
// NOTE: Selected range is included in the range
|
|
98
|
-
(ownerState.value[1] &&
|
|
99
|
-
isWithinRange(ownerState.value[0], ownerState.value[1], thisDay)));
|
|
100
|
-
const handleDayClick = () => {
|
|
101
|
-
if (ownerState.rangeSelection) {
|
|
102
|
-
if (!ownerState.value) {
|
|
103
|
-
ownerState.onChange?.([thisDay, undefined]);
|
|
104
|
-
}
|
|
105
|
-
else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
106
|
-
ownerState.onChange?.([
|
|
107
|
-
new Date(Math.min(ownerState.value[0].getTime(), thisDay.getTime())),
|
|
108
|
-
new Date(Math.max(ownerState.value[0].getTime(), thisDay.getTime())),
|
|
109
|
-
]);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
ownerState.onChange?.([thisDay, undefined]);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
ownerState.onChange?.([thisDay, undefined]);
|
|
117
|
-
}
|
|
118
|
-
setHoverDay(null);
|
|
119
|
-
};
|
|
120
|
-
return {
|
|
121
|
-
isToday: isToday(thisDay),
|
|
122
|
-
isSelected,
|
|
123
|
-
onClick: handleDayClick,
|
|
124
|
-
onMouseEnter: ownerState.rangeSelection &&
|
|
125
|
-
ownerState.value?.[0] &&
|
|
126
|
-
!ownerState.value?.[1]
|
|
127
|
-
? () => setHoverDay(thisDay)
|
|
128
|
-
: undefined,
|
|
129
|
-
disabled: (ownerState.minDate && thisDay < ownerState.minDate) ||
|
|
130
|
-
(ownerState.maxDate && thisDay > ownerState.maxDate) ||
|
|
131
|
-
(ownerState.disableFuture && thisDay > new Date()) ||
|
|
132
|
-
(ownerState.disablePast &&
|
|
133
|
-
thisDay <
|
|
134
|
-
(() => {
|
|
135
|
-
const today = new Date();
|
|
136
|
-
today.setHours(0, 0, 0, 0);
|
|
137
|
-
return today;
|
|
138
|
-
})()),
|
|
139
|
-
tabIndex: -1,
|
|
140
|
-
"aria-label": thisDay.toLocaleDateString(),
|
|
141
|
-
"aria-selected": isSelected ? "true" : undefined,
|
|
142
|
-
"aria-current": inRange ? "date" : undefined,
|
|
143
|
-
};
|
|
144
|
-
}, [
|
|
145
|
-
ownerState.onChange,
|
|
146
|
-
ownerState.value,
|
|
147
|
-
ownerState.viewMonth,
|
|
148
|
-
ownerState.rangeSelection,
|
|
149
|
-
ownerState.minDate,
|
|
150
|
-
ownerState.maxDate,
|
|
151
|
-
ownerState.disableFuture,
|
|
152
|
-
ownerState.disablePast,
|
|
153
|
-
hoverDay,
|
|
154
|
-
]),
|
|
155
|
-
getPickerMonthProps: useCallback((monthIndex) => {
|
|
156
|
-
const thisMonth = new Date(ownerState.viewMonth || new Date());
|
|
157
|
-
thisMonth.setDate(1);
|
|
158
|
-
thisMonth.setHours(0, 0, 0, 0);
|
|
159
|
-
thisMonth.setMonth(monthIndex);
|
|
160
|
-
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
161
|
-
const isMonthRangeSelection = isMonthPicker && ownerState.rangeSelection;
|
|
162
|
-
const isSelected = !!ownerState.value &&
|
|
163
|
-
(isSameMonth(thisMonth, ownerState.value[0]) ||
|
|
164
|
-
(ownerState.value[1] &&
|
|
165
|
-
isSameMonth(thisMonth, ownerState.value[1])));
|
|
166
|
-
const inRange = isMonthRangeSelection &&
|
|
167
|
-
ownerState.value &&
|
|
168
|
-
ownerState.value[0] &&
|
|
169
|
-
// NOTE: hover day is not included in the range
|
|
170
|
-
((hoverMonth &&
|
|
171
|
-
isWithinRange(ownerState.value[0], hoverMonth, thisMonth)) ||
|
|
172
|
-
// NOTE: Selected range is included in the range
|
|
173
|
-
(ownerState.value[1] &&
|
|
174
|
-
isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth)));
|
|
175
|
-
const handleMonthClick = () => {
|
|
176
|
-
if (isMonthRangeSelection) {
|
|
177
|
-
if (!ownerState.value) {
|
|
178
|
-
ownerState.onChange?.([thisMonth, undefined]);
|
|
179
|
-
}
|
|
180
|
-
else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
181
|
-
ownerState.onChange?.([
|
|
182
|
-
new Date(Math.min(ownerState.value[0].getTime(), thisMonth.getTime())),
|
|
183
|
-
new Date(Math.max(ownerState.value[0].getTime(), thisMonth.getTime())),
|
|
184
|
-
]);
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
ownerState.onChange?.([thisMonth, undefined]);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
else if (isMonthPicker) {
|
|
191
|
-
ownerState.onChange?.([thisMonth, undefined]);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
ownerState.onViewChange?.("day");
|
|
195
|
-
ownerState.onMonthChange?.(thisMonth);
|
|
196
|
-
}
|
|
197
|
-
setHoverMonth(null);
|
|
198
|
-
};
|
|
199
|
-
return {
|
|
200
|
-
isSelected,
|
|
201
|
-
onMouseEnter: isMonthRangeSelection &&
|
|
202
|
-
ownerState.value?.[0] &&
|
|
203
|
-
!ownerState.value?.[1]
|
|
204
|
-
? () => setHoverMonth(thisMonth)
|
|
205
|
-
: undefined,
|
|
206
|
-
disabled: (ownerState.minDate &&
|
|
207
|
-
(() => {
|
|
208
|
-
// check all days disabled in this month
|
|
209
|
-
const lastDay = new Date(thisMonth);
|
|
210
|
-
lastDay.setMonth(lastDay.getMonth() + 1);
|
|
211
|
-
lastDay.setDate(0);
|
|
212
|
-
return lastDay < ownerState.minDate;
|
|
213
|
-
})()) ||
|
|
214
|
-
(ownerState.maxDate &&
|
|
215
|
-
(() => {
|
|
216
|
-
// check all days disabled in this month
|
|
217
|
-
const lastDay = new Date(thisMonth);
|
|
218
|
-
lastDay.setDate(0);
|
|
219
|
-
return lastDay > ownerState.maxDate;
|
|
220
|
-
})()) ||
|
|
221
|
-
(ownerState.disableFuture && thisMonth > new Date()) ||
|
|
222
|
-
(ownerState.disablePast &&
|
|
223
|
-
thisMonth < new Date() &&
|
|
224
|
-
!isSameMonth(thisMonth, new Date())),
|
|
225
|
-
onClick: handleMonthClick,
|
|
226
|
-
tabIndex: -1,
|
|
227
|
-
"aria-label": getMonthName(thisMonth, ownerState.locale || "default"),
|
|
228
|
-
"aria-selected": isSelected ? "true" : undefined,
|
|
229
|
-
"aria-current": inRange ? "date" : undefined,
|
|
230
|
-
};
|
|
231
|
-
}, [
|
|
232
|
-
ownerState.onMonthChange,
|
|
233
|
-
ownerState.onViewChange,
|
|
234
|
-
ownerState.onChange,
|
|
235
|
-
ownerState.viewMonth,
|
|
236
|
-
ownerState.locale,
|
|
237
|
-
ownerState.value,
|
|
238
|
-
ownerState.minDate,
|
|
239
|
-
ownerState.maxDate,
|
|
240
|
-
ownerState.disableFuture,
|
|
241
|
-
ownerState.disablePast,
|
|
242
|
-
hoverMonth,
|
|
243
|
-
]),
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
export { useCalendar };
|