@soyfri/shared-library 1.1.12 → 1.1.14
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/cjs/components/DatePicker/DatePicker.cjs +1 -1
- package/cjs/components/DateTimePicker/DateTimePicker.cjs +1 -1
- package/cjs/components/Flyout/Flyout.cjs +2 -0
- package/cjs/components/Flyout/Flyout.cjs.map +1 -0
- package/cjs/components/Flyout.cjs +2 -0
- package/cjs/components/Flyout.cjs.map +1 -0
- package/cjs/components/Input/Input.cjs +1 -1
- package/cjs/components/InputGroup/InputGroup.cjs +2 -0
- package/cjs/components/InputGroup/InputGroup.cjs.map +1 -0
- package/cjs/components/InputGroup.cjs +2 -0
- package/cjs/components/InputGroup.cjs.map +1 -0
- package/cjs/components/Select/Select.cjs +1 -1
- package/cjs/components/Table/Table.cjs +1 -1
- package/cjs/components/timeline/Timeline.cjs +2 -0
- package/cjs/components/timeline/Timeline.cjs.map +1 -0
- package/cjs/components/timeline/TimelineItem.cjs +2 -0
- package/cjs/components/timeline/TimelineItem.cjs.map +1 -0
- package/cjs/components/timeline.cjs +2 -0
- package/cjs/components/timeline.cjs.map +1 -0
- package/cjs/node_modules/@mui/icons-material/esm/Check.cjs +2 -0
- package/cjs/node_modules/@mui/icons-material/esm/Check.cjs.map +1 -0
- package/cjs/node_modules/@mui/icons-material/esm/Close.cjs +2 -0
- package/cjs/node_modules/@mui/icons-material/esm/Close.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/Timeline/Timeline.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/Timeline/Timeline.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/Timeline/TimelineContext.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/Timeline/TimelineContext.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/Timeline/timelineClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/Timeline/timelineClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineConnector/TimelineConnector.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineConnector/TimelineConnector.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineConnector/timelineConnectorClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineConnector/timelineConnectorClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineContent/TimelineContent.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineContent/TimelineContent.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineContent/timelineContentClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineContent/timelineContentClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineDot/TimelineDot.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineDot/TimelineDot.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineDot/timelineDotClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineDot/timelineDotClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineItem/TimelineItem.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineItem/TimelineItem.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineItem/timelineItemClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineItem/timelineItemClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineOppositeContent/timelineOppositeContentClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineOppositeContent/timelineOppositeContentClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineSeparator/TimelineSeparator.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineSeparator/TimelineSeparator.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineSeparator/timelineSeparatorClasses.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/TimelineSeparator/timelineSeparatorClasses.cjs.map +1 -0
- package/cjs/node_modules/@mui/lab/esm/internal/convertTimelinePositionToClass.cjs +2 -0
- package/cjs/node_modules/@mui/lab/esm/internal/convertTimelinePositionToClass.cjs.map +1 -0
- package/cjs/node_modules/@mui/material/esm/Alert/Alert.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Alert/Alert.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/Backdrop/Backdrop.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Backdrop/Backdrop.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/Button/Button.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Button/Button.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/Chip/Chip.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Chip/Chip.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/Divider/Divider.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Divider/Divider.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/FilledInput/FilledInput.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/FilledInput/FilledInput.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/IconButton/IconButton.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/IconButton/IconButton.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/Input/Input.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Input/Input.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/MenuItem/MenuItem.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/MenuItem/MenuItem.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/NativeSelect/NativeSelectInput.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/NativeSelect/NativeSelectInput.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/OutlinedInput/NotchedOutline.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/OutlinedInput/NotchedOutline.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/Paper/Paper.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Select/SelectInput.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/Select/SelectInput.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createColorScheme.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createColorScheme.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createPalette.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createPalette.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createThemeNoVars.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createThemeNoVars.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createThemeWithVars.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/createThemeWithVars.cjs.map +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/shouldSkipGeneratingVar.cjs +1 -1
- package/cjs/node_modules/@mui/material/esm/styles/shouldSkipGeneratingVar.cjs.map +1 -1
- package/cjs/node_modules/@mui/styled-engine/esm/index.cjs +1 -1
- package/cjs/node_modules/@mui/styled-engine/esm/index.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.cjs +1 -1
- package/cjs/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.cjs +1 -1
- package/cjs/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/colorManipulator/colorManipulator.cjs +1 -1
- package/cjs/node_modules/@mui/system/esm/colorManipulator/colorManipulator.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/createStyled/createStyled.cjs +1 -1
- package/cjs/node_modules/@mui/system/esm/createStyled/createStyled.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/cssVars/prepareCssVars.cjs +1 -1
- package/cjs/node_modules/@mui/system/esm/cssVars/prepareCssVars.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.cjs +1 -1
- package/cjs/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.cjs.map +1 -1
- package/cjs/node_modules/@mui/system/esm/styled/styled.cjs +2 -0
- package/cjs/node_modules/@mui/system/esm/styled/styled.cjs.map +1 -0
- package/cjs/node_modules/@mui/utils/esm/resolveProps/resolveProps.cjs +1 -1
- package/cjs/node_modules/@mui/utils/esm/resolveProps/resolveProps.cjs.map +1 -1
- package/components/Flyout/index.ts +1 -0
- package/components/InputGroup/index.ts +1 -0
- package/components/timeline/index.ts +1 -0
- package/esm/components/DatePicker/DatePicker.js +1 -1
- package/esm/components/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/esm/components/DateTimePicker/DateTimePicker.js +1 -1
- package/esm/components/Flyout/Flyout.d.ts +13 -0
- package/esm/components/Flyout/Flyout.js +2 -0
- package/esm/components/Flyout/Flyout.js.map +1 -0
- package/esm/components/Flyout/Flyout.stories.d.ts +12 -0
- package/esm/components/Flyout/index.d.ts +1 -0
- package/esm/components/Flyout.js +2 -0
- package/esm/components/Flyout.js.map +1 -0
- package/esm/components/Input/Input.d.ts +0 -7
- package/esm/components/Input/Input.js +1 -1
- package/esm/components/Input/Input.stories.d.ts +1 -0
- package/esm/components/InputGroup/InputGroup.d.ts +6 -0
- package/esm/components/InputGroup/InputGroup.js +2 -0
- package/esm/components/InputGroup/InputGroup.js.map +1 -0
- package/esm/components/InputGroup/InputGroup.stories.d.ts +8 -0
- package/esm/components/InputGroup/index.d.ts +1 -0
- package/esm/components/InputGroup.js +2 -0
- package/esm/components/InputGroup.js.map +1 -0
- package/esm/components/Select/Select.js +1 -1
- package/esm/components/Table/Table.js +1 -1
- package/esm/components/timeline/Timeline.d.ts +11 -0
- package/esm/components/timeline/Timeline.definition.d.ts +1 -0
- package/esm/components/timeline/Timeline.js +2 -0
- package/esm/components/timeline/Timeline.js.map +1 -0
- package/esm/components/timeline/Timeline.stories.d.ts +6 -0
- package/esm/components/timeline/TimelineItem.d.ts +7 -0
- package/esm/components/timeline/TimelineItem.js +2 -0
- package/esm/components/timeline/TimelineItem.js.map +1 -0
- package/esm/components/timeline/index.d.ts +2 -0
- package/esm/components/timeline.js +2 -0
- package/esm/components/timeline.js.map +1 -0
- package/esm/node_modules/@mui/icons-material/esm/Check.js +2 -0
- package/esm/node_modules/@mui/icons-material/esm/Check.js.map +1 -0
- package/esm/node_modules/@mui/icons-material/esm/Close.js +2 -0
- package/esm/node_modules/@mui/icons-material/esm/Close.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/Timeline/Timeline.js +2 -0
- package/esm/node_modules/@mui/lab/esm/Timeline/Timeline.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/Timeline/TimelineContext.js +2 -0
- package/esm/node_modules/@mui/lab/esm/Timeline/TimelineContext.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/Timeline/timelineClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/Timeline/timelineClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineConnector/TimelineConnector.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineConnector/TimelineConnector.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineConnector/timelineConnectorClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineConnector/timelineConnectorClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineContent/TimelineContent.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineContent/TimelineContent.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineContent/timelineContentClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineContent/timelineContentClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineDot/TimelineDot.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineDot/TimelineDot.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineDot/timelineDotClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineDot/timelineDotClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineItem/TimelineItem.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineItem/TimelineItem.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineItem/timelineItemClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineItem/timelineItemClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineOppositeContent/timelineOppositeContentClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineOppositeContent/timelineOppositeContentClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineSeparator/TimelineSeparator.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineSeparator/TimelineSeparator.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/TimelineSeparator/timelineSeparatorClasses.js +2 -0
- package/esm/node_modules/@mui/lab/esm/TimelineSeparator/timelineSeparatorClasses.js.map +1 -0
- package/esm/node_modules/@mui/lab/esm/internal/convertTimelinePositionToClass.js +2 -0
- package/esm/node_modules/@mui/lab/esm/internal/convertTimelinePositionToClass.js.map +1 -0
- package/esm/node_modules/@mui/material/esm/Alert/Alert.js +1 -1
- package/esm/node_modules/@mui/material/esm/Alert/Alert.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/Backdrop/Backdrop.js +1 -1
- package/esm/node_modules/@mui/material/esm/Backdrop/Backdrop.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/Button/Button.js +1 -1
- package/esm/node_modules/@mui/material/esm/Button/Button.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/Chip/Chip.js +1 -1
- package/esm/node_modules/@mui/material/esm/Chip/Chip.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/Divider/Divider.js +1 -1
- package/esm/node_modules/@mui/material/esm/Divider/Divider.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/FilledInput/FilledInput.js +1 -1
- package/esm/node_modules/@mui/material/esm/FilledInput/FilledInput.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/IconButton/IconButton.js +1 -1
- package/esm/node_modules/@mui/material/esm/IconButton/IconButton.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/Input/Input.js +1 -1
- package/esm/node_modules/@mui/material/esm/Input/Input.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/MenuItem/MenuItem.js +1 -1
- package/esm/node_modules/@mui/material/esm/MenuItem/MenuItem.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/NativeSelect/NativeSelectInput.js +1 -1
- package/esm/node_modules/@mui/material/esm/NativeSelect/NativeSelectInput.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/OutlinedInput/NotchedOutline.js +1 -1
- package/esm/node_modules/@mui/material/esm/OutlinedInput/NotchedOutline.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.js +1 -1
- package/esm/node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/Paper/Paper.js +1 -1
- package/esm/node_modules/@mui/material/esm/Select/SelectInput.js +1 -1
- package/esm/node_modules/@mui/material/esm/Select/SelectInput.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createColorScheme.js +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createColorScheme.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createPalette.js +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createPalette.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createThemeNoVars.js +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createThemeNoVars.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createThemeWithVars.js +1 -1
- package/esm/node_modules/@mui/material/esm/styles/createThemeWithVars.js.map +1 -1
- package/esm/node_modules/@mui/material/esm/styles/shouldSkipGeneratingVar.js +1 -1
- package/esm/node_modules/@mui/material/esm/styles/shouldSkipGeneratingVar.js.map +1 -1
- package/esm/node_modules/@mui/styled-engine/esm/index.js +1 -1
- package/esm/node_modules/@mui/styled-engine/esm/index.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js +1 -1
- package/esm/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js +1 -1
- package/esm/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/colorManipulator/colorManipulator.js +1 -1
- package/esm/node_modules/@mui/system/esm/colorManipulator/colorManipulator.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/createStyled/createStyled.js +1 -1
- package/esm/node_modules/@mui/system/esm/createStyled/createStyled.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/cssVars/prepareCssVars.js +1 -1
- package/esm/node_modules/@mui/system/esm/cssVars/prepareCssVars.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js +1 -1
- package/esm/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js.map +1 -1
- package/esm/node_modules/@mui/system/esm/styled/styled.js +2 -0
- package/esm/node_modules/@mui/system/esm/styled/styled.js.map +1 -0
- package/esm/node_modules/@mui/utils/esm/resolveProps/resolveProps.js +1 -1
- package/esm/node_modules/@mui/utils/esm/resolveProps/resolveProps.js.map +1 -1
- package/package.json +17 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorManipulator.js","sources":["../../../../../../../node_modules/@mui/system/esm/colorManipulator/colorManipulator.js"],"sourcesContent":["import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n/* eslint-disable @typescript-eslint/naming-convention */\nimport clamp from '@mui/utils/clamp';\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return clamp(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nexport function hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (color.length !== color.trim().length) {\n console.error(`MUI: The color: \"${color}\" is invalid. Make sure the color input doesn't contain leading/trailing space.`);\n }\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (!['rgb', 'rgba', 'hsl', 'hsla', 'color'].includes(type)) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\\n` + 'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().' : _formatErrorMessage(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (!['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].includes(colorSpace)) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\\n` + 'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.' : _formatErrorMessage(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nexport const colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.includes('hsl') && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexport const private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexport function recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.includes('rgb')) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.includes('hsl')) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.includes('color')) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nexport function rgbToHex(color) {\n // Idempotent\n if (color.startsWith('#')) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nexport function getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nexport function getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nexport function private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.includes('hsl')) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.includes('rgb') || color.type.includes('color')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.includes('hsl')) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.includes('rgb')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.includes('color')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nexport function private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nexport function blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}"],"names":["clampWrapper","value","min","max","process","env","NODE_ENV","console","error","clamp","hexToRgb","color","slice","re","RegExp","length","colors","match","map","n","trim","index","parseInt","Math","round","join","decomposeColor","type","charAt","marker","indexOf","substring","includes","Error","_formatErrorMessage","colorSpace","values","split","shift","parseFloat","colorChannel","decomposedColor","val","idx","private_safeColorChannel","warning","warn","recomposeColor","i","hslToRgb","h","s","l","a","f","k","rgb","push","getLuminance","Number","toFixed","getContrastRatio","foreground","background","lumA","lumB","alpha","private_safeAlpha","darken","coefficient","private_safeDarken","lighten","private_safeLighten","emphasize","private_safeEmphasize"],"mappings":"kIAWA,SAASA,EAAaC,EAAOC,EAAM,EAAGC,EAAM,GAM1C,MAL6B,eAAzBC,QAAQC,IAAIC,WACVL,EAAQC,GAAOD,EAAQE,IACzBI,QAAQC,MAAM,2BAA2BP,sBAA0BC,MAAQC,OAGxEM,EAAMR,EAAOC,EAAKC,EAC3B,CAOO,SAASO,EAASC,GACvBA,EAAQA,EAAMC,MAAM,GACpB,MAAMC,EAAK,IAAIC,OAAO,OAAOH,EAAMI,QAAU,EAAI,EAAI,KAAM,KAC3D,IAAIC,EAASL,EAAMM,MAAMJ,GASzB,OARIG,GAA+B,IAArBA,EAAO,GAAGD,SACtBC,EAASA,EAAOE,KAAIC,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,IAAM,EAAIqB,EAG3B,OAAOtB,EAAepC,EACxB,CACO,SAAS2D,EAAmB3D,EAAO0D,EAAaxB,GACrD,IACE,OAAOuB,EAAOzD,EAAO0D,EACtB,CAAC,MAAO7D,GAIP,OAAOG,CACX,CACA,CAQO,SAAS4D,EAAQ5D,EAAO0D,GAG7B,GAFA1D,EAAQe,EAAef,GACvB0D,EAAcrE,EAAaqE,GACvB1D,EAAMgB,KAAKK,SAAS,OACtBrB,EAAMyB,OAAO,KAAO,IAAMzB,EAAMyB,OAAO,IAAMiC,OACxC,GAAI1D,EAAMgB,KAAKK,SAAS,OAC7B,IAAK,IAAIgB,EAAI,EAAGA,EAAI,EAAGA,GAAK,EAC1BrC,EAAMyB,OAAOY,KAAO,IAAMrC,EAAMyB,OAAOY,IAAMqB,OAE1C,GAAI1D,EAAMgB,KAAKK,SAAS,SAC7B,IAAK,IAAIgB,EAAI,EAAGA,EAAI,EAAGA,GAAK,EAC1BrC,EAAMyB,OAAOY,KAAO,EAAIrC,EAAMyB,OAAOY,IAAMqB,EAG/C,OAAOtB,EAAepC,EACxB,CACO,SAAS6D,EAAoB7D,EAAO0D,EAAaxB,GACtD,IACE,OAAO0B,EAAQ5D,EAAO0D,EACvB,CAAC,MAAO7D,GAIP,OAAOG,CACX,CACA,CASO,SAAS8D,EAAU9D,EAAO0D,EAAc,KAC7C,OAAOX,EAAa/C,GAAS,GAAMyD,EAAOzD,EAAO0D,GAAeE,EAAQ5D,EAAO0D,EACjF,CACO,SAASK,EAAsB/D,EAAO0D,EAAaxB,GACxD,IACE,OAAO4B,EAAU9D,EAAO0D,EACzB,CAAC,MAAO7D,GAIP,OAAOG,CACX,CACA","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"colorManipulator.js","sources":["../../../../../../../node_modules/@mui/system/esm/colorManipulator/colorManipulator.js"],"sourcesContent":["import _formatErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n/* eslint-disable @typescript-eslint/naming-convention */\nimport clamp from '@mui/utils/clamp';\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return clamp(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nexport function hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (color.length !== color.trim().length) {\n console.error(`MUI: The color: \"${color}\" is invalid. Make sure the color input doesn't contain leading/trailing space.`);\n }\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (!['rgb', 'rgba', 'hsl', 'hsla', 'color'].includes(type)) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\\n` + 'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().' : _formatErrorMessage(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (!['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].includes(colorSpace)) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\\n` + 'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.' : _formatErrorMessage(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nexport const colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.includes('hsl') && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexport const private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexport function recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.includes('rgb')) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.includes('hsl')) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.includes('color')) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nexport function rgbToHex(color) {\n // Idempotent\n if (color.startsWith('#')) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nexport function getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nexport function getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nexport function private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.includes('hsl')) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.includes('rgb') || color.type.includes('color')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.includes('hsl')) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.includes('rgb')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.includes('color')) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nexport function private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nexport function blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}"],"names":["clampWrapper","value","min","max","process","env","NODE_ENV","console","error","clamp","hexToRgb","color","slice","re","RegExp","length","colors","match","map","n","trim","index","parseInt","Math","round","join","decomposeColor","type","charAt","marker","indexOf","substring","includes","Error","_formatErrorMessage","colorSpace","values","split","shift","parseFloat","colorChannel","decomposedColor","val","idx","private_safeColorChannel","warning","warn","recomposeColor","i","hslToRgb","h","s","l","a","f","k","rgb","push","getLuminance","Number","toFixed","getContrastRatio","foreground","background","lumA","lumB","alpha","private_safeAlpha","darken","coefficient","private_safeDarken","lighten","private_safeLighten","emphasize","private_safeEmphasize"],"mappings":"kIAWA,SAASA,EAAaC,EAAOC,EAAM,EAAGC,EAAM,GAM1C,MAL6B,eAAzBC,QAAQC,IAAIC,WACVL,EAAQC,GAAOD,EAAQE,IACzBI,QAAQC,MAAM,2BAA2BP,sBAA0BC,MAAQC,OAGxEM,EAAMR,EAAOC,EAAKC,EAC3B,CAOO,SAASO,EAASC,GACvBA,EAAQA,EAAMC,MAAM,GACpB,MAAMC,EAAK,IAAIC,OAAO,OAAOH,EAAMI,QAAU,EAAI,EAAI,KAAM,KAC3D,IAAIC,EAASL,EAAMM,MAAMJ,GASzB,OARIG,GAA+B,IAArBA,EAAO,GAAGD,SACtBC,EAASA,EAAOE,KAAIC,GAAKA,EAAIA,KAEF,eAAzBf,QAAQC,IAAIC,UACVK,EAAMI,SAAWJ,EAAMS,OAAOL,QAChCR,QAA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import
|
|
1
|
+
import t,{internal_mutateStyles as e,internal_serializeStyles as r}from"../../../styled-engine/esm/index.js";import o from"../preprocessStyles.js";import n from"../createTheme/createTheme.js";import s from"../styleFunctionSx/styleFunctionSx.js";import i from"../../../utils/esm/capitalize/capitalize.js";import u from"../../../utils/esm/getDisplayName/getDisplayName.js";import{isPlainObject as a}from"../../../utils/esm/deepmerge/deepmerge.js";const l=n();function c(t){return"ownerState"!==t&&"theme"!==t&&"sx"!==t&&"as"!==t}function f(t,e){return e&&t&&"object"==typeof t&&t.styles&&!t.styles.startsWith("@layer")&&(t.styles=`@layer ${e}{${String(t.styles)}}`),t}function m(t){return t?(e,r)=>r[t]:null}function p(t,e,o){const n="function"==typeof e?e(t):e;if(Array.isArray(n))return n.flatMap((e=>p(t,e,o)));if(Array.isArray(n?.variants)){let e;if(n.isProcessed)e=o?f(n.style,o):n.style;else{const{variants:t,...s}=n;e=o?f(r(s),o):s}return y(t,n.variants,[e],o)}return n?.isProcessed?o?f(r(n.style),o):n.style:o?f(r(n),o):n}function y(t,e,o=[],n=void 0){let s;t:for(let i=0;i<e.length;i+=1){const u=e[i];if("function"==typeof u.props){if(s??={...t,...t.ownerState,ownerState:t.ownerState},!u.props(s))continue}else for(const e in u.props)if(t[e]!==u.props[e]&&t.ownerState?.[e]!==u.props[e])continue t;"function"==typeof u.style?(s??={...t,...t.ownerState,ownerState:t.ownerState},o.push(n?f(r(u.style(s)),n):u.style(s))):o.push(n?f(r(u.style),n):u.style)}return o}function h(r={}){const{themeId:n,defaultTheme:h=l,rootShouldForwardProp:v=c,slotShouldForwardProp:S=c}=r;function g(t){!function(t,e,r){t.theme=function(t){for(const e in t)return!1;return!0}(t.theme)?r:t.theme[e]||t.theme}(t,n,h)}return(r,n={})=>{e(r,(t=>t.filter((t=>t!==s))));const{name:l,slot:h,skipVariantsResolver:A,skipSx:C,overridesResolver:N=m(w(h)),...j}=n,$=l&&l.startsWith("Mui")||h?"components":"custom",x=void 0!==A?A:h&&"Root"!==h&&"root"!==h||!1,L=C||!1;let F=c;"Root"===h||"root"===h?F=v:h?F=S:function(t){return"string"==typeof t&&t.charCodeAt(0)>96}(r)&&(F=void 0);const P=t(r,{shouldForwardProp:F,label:d(l,h),...j}),R=t=>{if(t.__emotion_real===t)return t;if("function"==typeof t)return function(e){return p(e,t,e.theme.modularCssLayers?$:void 0)};if(a(t)){const e=o(t);return function(t){return e.variants?p(t,e,t.theme.modularCssLayers?$:void 0):t.theme.modularCssLayers?f(e.style,$):e.style}}return t},_=(...t)=>{const e=[],o=t.map(R),n=[];if(e.push(g),l&&N&&n.push((function(t){const e=t.theme,r=e.components?.[l]?.styleOverrides;if(!r)return null;const o={};for(const e in r)o[e]=p(t,r[e],t.theme.modularCssLayers?"theme":void 0);return N(t,o)})),l&&!x&&n.push((function(t){const e=t.theme,r=e?.components?.[l]?.variants;return r?y(t,r,[],t.theme.modularCssLayers?"theme":void 0):null})),L||n.push(s),Array.isArray(o[0])){const t=o.shift(),r=new Array(e.length).fill(""),s=new Array(n.length).fill("");let i;i=[...r,...t,...s],i.raw=[...r,...t.raw,...s],e.unshift(i)}const a=[...e,...o,...n],c=P(...a);return r.muiName&&(c.muiName=r.muiName),"production"!==process.env.NODE_ENV&&(c.displayName=function(t,e,r){if(t)return`${t}${i(e||"")}`;return`Styled(${u(r)})`}(l,h,r)),c};return P.withConfig&&(_.withConfig=P.withConfig),_}}function d(t,e){let r;return"production"!==process.env.NODE_ENV&&t&&(r=`${t}-${w(e||"Root")}`),r}function w(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}export{h as default,c as shouldForwardProp,l as systemDefaultTheme};
|
|
2
2
|
//# sourceMappingURL=createStyled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStyled.js","sources":["../../../../../../../node_modules/@mui/system/esm/createStyled/createStyled.js"],"sourcesContent":["import styledEngineStyled, { internal_mutateStyles as mutateStyles } from '@mui/styled-engine';\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport capitalize from '@mui/utils/capitalize';\nimport getDisplayName from '@mui/utils/getDisplayName';\nimport createTheme from \"../createTheme/index.js\";\nimport styleFunctionSx from \"../styleFunctionSx/index.js\";\nimport preprocessStyles from \"../preprocessStyles.js\";\n\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable no-labels */\n/* eslint-disable no-lone-blocks */\n\nexport const systemDefaultTheme = createTheme();\n\n// Update /system/styled/#api in case if this changes\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (_props, styles) => styles[slot];\n}\nfunction attachTheme(props, themeId, defaultTheme) {\n props.theme = isObjectEmpty(props.theme) ? defaultTheme : props.theme[themeId] || props.theme;\n}\nfunction processStyle(props, style) {\n /*\n * Style types:\n * - null/undefined\n * - string\n * - CSS style object: { [cssKey]: [cssValue], variants }\n * - Processed style object: { style, variants, isProcessed: true }\n * - Array of any of the above\n */\n\n const resolvedStyle = typeof style === 'function' ? style(props) : style;\n if (Array.isArray(resolvedStyle)) {\n return resolvedStyle.flatMap(subStyle => processStyle(props, subStyle));\n }\n if (Array.isArray(resolvedStyle?.variants)) {\n let rootStyle;\n if (resolvedStyle.isProcessed) {\n rootStyle = resolvedStyle.style;\n } else {\n const {\n variants,\n ...otherStyles\n } = resolvedStyle;\n rootStyle = otherStyles;\n }\n return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);\n }\n if (resolvedStyle?.isProcessed) {\n return resolvedStyle.style;\n }\n return resolvedStyle;\n}\nfunction processStyleVariants(props, variants, results = []) {\n let mergedState; // We might not need it, initialized lazily\n\n variantLoop: for (let i = 0; i < variants.length; i += 1) {\n const variant = variants[i];\n if (typeof variant.props === 'function') {\n mergedState ??= {\n ...props,\n ...props.ownerState,\n ownerState: props.ownerState\n };\n if (!variant.props(mergedState)) {\n continue;\n }\n } else {\n for (const key in variant.props) {\n if (props[key] !== variant.props[key] && props.ownerState?.[key] !== variant.props[key]) {\n continue variantLoop;\n }\n }\n }\n if (typeof variant.style === 'function') {\n mergedState ??= {\n ...props,\n ...props.ownerState,\n ownerState: props.ownerState\n };\n results.push(variant.style(mergedState));\n } else {\n results.push(variant.style);\n }\n }\n return results;\n}\nexport default function createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n function styleAttachTheme(props) {\n attachTheme(props, themeId, defaultTheme);\n }\n const styled = (tag, inputOptions = {}) => {\n // If `tag` is already a styled component, filter out the `sx` style function\n // to prevent unnecessary styles generated by the composite components.\n mutateStyles(tag, styles => styles.filter(style => style !== styleFunctionSx));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),\n ...options\n } = inputOptions;\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = styledEngineStyled(tag, {\n shouldForwardProp: shouldForwardPropOption,\n label: generateStyledLabel(componentName, componentSlot),\n ...options\n });\n const transformStyle = style => {\n // - On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n // - `style` could be a styled component from a babel plugin for component selectors, This condition\n // makes sure that we do not interpolate them.\n if (style.__emotion_real === style) {\n return style;\n }\n if (typeof style === 'function') {\n return function styleFunctionProcessor(props) {\n return processStyle(props, style);\n };\n }\n if (isPlainObject(style)) {\n const serialized = preprocessStyles(style);\n if (!serialized.variants) {\n return serialized.style;\n }\n return function styleObjectProcessor(props) {\n return processStyle(props, serialized);\n };\n }\n return style;\n };\n const muiStyledResolver = (...expressionsInput) => {\n const expressionsHead = [];\n const expressionsBody = expressionsInput.map(transformStyle);\n const expressionsTail = [];\n\n // Preprocess `props` to set the scoped theme value.\n // This must run before any other expression.\n expressionsHead.push(styleAttachTheme);\n if (componentName && overridesResolver) {\n expressionsTail.push(function styleThemeOverrides(props) {\n const theme = props.theme;\n const styleOverrides = theme.components?.[componentName]?.styleOverrides;\n if (!styleOverrides) {\n return null;\n }\n const resolvedStyleOverrides = {};\n\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n // eslint-disable-next-line guard-for-in\n for (const slotKey in styleOverrides) {\n resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);\n }\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsTail.push(function styleThemeVariants(props) {\n const theme = props.theme;\n const themeVariants = theme?.components?.[componentName]?.variants;\n if (!themeVariants) {\n return null;\n }\n return processStyleVariants(props, themeVariants);\n });\n }\n if (!skipSx) {\n expressionsTail.push(styleFunctionSx);\n }\n\n // This function can be called as a tagged template, so the first argument would contain\n // CSS `string[]` values.\n if (Array.isArray(expressionsBody[0])) {\n const inputStrings = expressionsBody.shift();\n\n // We need to add placeholders in the tagged template for the custom functions we have\n // possibly added (attachTheme, overrides, variants, and sx).\n const placeholdersHead = new Array(expressionsHead.length).fill('');\n const placeholdersTail = new Array(expressionsTail.length).fill('');\n let outputStrings;\n // prettier-ignore\n {\n outputStrings = [...placeholdersHead, ...inputStrings, ...placeholdersTail];\n outputStrings.raw = [...placeholdersHead, ...inputStrings.raw, ...placeholdersTail];\n }\n\n // The only case where we put something before `attachTheme`\n expressionsHead.unshift(outputStrings);\n }\n const expressions = [...expressionsHead, ...expressionsBody, ...expressionsTail];\n const Component = defaultStyledResolver(...expressions);\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n if (process.env.NODE_ENV !== 'production') {\n Component.displayName = generateDisplayName(componentName, componentSlot, tag);\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n return styled;\n}\nfunction generateDisplayName(componentName, componentSlot, tag) {\n if (componentName) {\n return `${componentName}${capitalize(componentSlot || '')}`;\n }\n return `Styled(${getDisplayName(tag)})`;\n}\nfunction generateStyledLabel(componentName, componentSlot) {\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n return label;\n}\nfunction isObjectEmpty(object) {\n // eslint-disable-next-line\n for (const _ in object) {\n return false;\n }\n return true;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\nfunction lowercaseFirstLetter(string) {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n}"],"names":["systemDefaultTheme","createTheme","shouldForwardProp","prop","defaultOverridesResolver","slot","_props","styles","processStyle","props","style","resolvedStyle","Array","isArray","flatMap","subStyle","variants","rootStyle","isProcessed","otherStyles","processStyleVariants","results","mergedState","variantLoop","i","length","variant","ownerState","key","push","createStyled","input","themeId","defaultTheme","rootShouldForwardProp","slotShouldForwardProp","styleAttachTheme","theme","object","_","isObjectEmpty","attachTheme","tag","inputOptions","mutateStyles","filter","styleFunctionSx","name","componentName","componentSlot","skipVariantsResolver","inputSkipVariantsResolver","skipSx","inputSkipSx","overridesResolver","lowercaseFirstLetter","options","undefined","shouldForwardPropOption","charCodeAt","isStringTag","defaultStyledResolver","styledEngineStyled","label","generateStyledLabel","transformStyle","__emotion_real","isPlainObject","serialized","preprocessStyles","muiStyledResolver","expressionsInput","expressionsHead","expressionsBody","map","expressionsTail","styleOverrides","components","resolvedStyleOverrides","slotKey","themeVariants","inputStrings","shift","placeholdersHead","fill","placeholdersTail","outputStrings","raw","unshift","expressions","Component","muiName","process","env","NODE_ENV","displayName","capitalize","getDisplayName","generateDisplayName","withConfig","string","charAt","toLowerCase","slice"],"mappings":"+ZAYY,MAACA,EAAqBC,IAG3B,SAASC,EAAkBC,GAChC,MAAgB,eAATA,GAAkC,UAATA,GAA6B,OAATA,GAA0B,OAATA,CACvE,CACA,SAASC,EAAyBC,GAChC,OAAKA,EAGE,CAACC,EAAQC,IAAWA,EAAOF,GAFzB,IAGX,CAIA,SAASG,EAAaC,EAAOC,GAU3B,MAAMC,EAAiC,mBAAVD,EAAuBA,EAAMD,GAASC,EACnE,GAAIE,MAAMC,QAAQF,GAChB,OAAOA,EAAcG,SAAQC,GAAYP,EAAaC,EAAOM,KAE/D,GAAIH,MAAMC,QAAQF,GAAeK,UAAW,CAC1C,IAAIC,EACJ,GAAIN,EAAcO,YAChBD,EAAYN,EAAcD,UACrB,CACL,MAAMM,SACJA,KACGG,GACDR,EACJM,EAAYE,CAClB,CACI,OAAOC,EAAqBX,EAAOE,EAAcK,SAAU,CAACC,GAChE,CACE,OAAIN,GAAeO,YACVP,EAAc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1D,OAAKgE,EAGE5D,EAAqBX,EAAOuE,GAF1B,IAGnB,IAEW5B,GACHuB,EAAgB9C,KAAKiB,GAKnBlC,MAAMC,QAAQ4D,EAAgB,IAAK,CACrC,MAAMQ,EAAeR,EAAgBS,QAI/BC,EAAmB,IAAIvE,MAAM4D,EAAgB/C,QAAQ2D,KAAK,IAC1DC,EAAmB,IAAIzE,MAAM+D,EAAgBlD,QAAQ2D,KAAK,IAChE,IAAIE,EAGFA,EAAgB,IAAIH,KAAqBF,KAAiBI,GAC1DC,EAAcC,IAAM,IAAIJ,KAAqBF,EAAaM,OAAQF,GAIpEb,EAAgBgB,QAAQF,EAChC,CACM,MAAMG,EAAc,IAAIjB,KAAoBC,KAAoBE,GAC1De,EAAY7B,KAAyB4B,GAO3C,OANI/C,EAAIiD,UACND,EAAUC,QAAUjD,EAAIiD,SAEG,eAAzBC,QAAQC,IAAIC,WACdJ,EAAUK,YAWlB,SAA6B/C,EAAeC,EAAeP,GACzD,GAAIM,EACF,MAAO,GAAGA,IAAgBgD,EAAW/C,GAAiB,MAExD,MAAO,UAAUgD,EAAevD,KAClC,CAhBgCwD,CAAoBlD,EAAeC,EAAeP,IAErEgD,GAKT,OAHI7B,EAAsBsC,aACxB7B,EAAkB6B,WAAatC,EAAsBsC,YAEhD7B,EAGX,CAOA,SAASN,EAAoBhB,EAAeC,GAC1C,IAAIc,EAQJ,MAP6B,eAAzB6B,QAAQC,IAAIC,UACV9C,IAGFe,EAAQ,GAAGf,KAAiBO,EAAqBN,GAAiB,WAG/Dc,CACT,CAiBA,SAASR,EAAqB6C,GAC5B,OAAKA,EAGEA,EAAOC,OAAO,GAAGC,cAAgBF,EAAOG,MAAM,GAF5CH,CAGX","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"createStyled.js","sources":["../../../../../../../node_modules/@mui/system/esm/createStyled/createStyled.js"],"sourcesContent":["import styledEngineStyled, { internal_mutateStyles as mutateStyles, internal_serializeStyles as serializeStyles } from '@mui/styled-engine';\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport capitalize from '@mui/utils/capitalize';\nimport getDisplayName from '@mui/utils/getDisplayName';\nimport createTheme from \"../createTheme/index.js\";\nimport styleFunctionSx from \"../styleFunctionSx/index.js\";\nimport preprocessStyles from \"../preprocessStyles.js\";\n\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable no-labels */\n/* eslint-disable no-lone-blocks */\n\nexport const systemDefaultTheme = createTheme();\n\n// Update /system/styled/#api in case if this changes\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nfunction shallowLayer(serialized, layerName) {\n if (layerName && serialized && typeof serialized === 'object' && serialized.styles && !serialized.styles.startsWith('@layer') // only add the layer if it is not already there.\n ) {\n serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;\n }\n return serialized;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (_props, styles) => styles[slot];\n}\nfunction attachTheme(props, themeId, defaultTheme) {\n props.theme = isObjectEmpty(props.theme) ? defaultTheme : props.theme[themeId] || props.theme;\n}\nfunction processStyle(props, style, layerName) {\n /*\n * Style types:\n * - null/undefined\n * - string\n * - CSS style object: { [cssKey]: [cssValue], variants }\n * - Processed style object: { style, variants, isProcessed: true }\n * - Array of any of the above\n */\n\n const resolvedStyle = typeof style === 'function' ? style(props) : style;\n if (Array.isArray(resolvedStyle)) {\n return resolvedStyle.flatMap(subStyle => processStyle(props, subStyle, layerName));\n }\n if (Array.isArray(resolvedStyle?.variants)) {\n let rootStyle;\n if (resolvedStyle.isProcessed) {\n rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;\n } else {\n const {\n variants,\n ...otherStyles\n } = resolvedStyle;\n rootStyle = layerName ? shallowLayer(serializeStyles(otherStyles), layerName) : otherStyles;\n }\n return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);\n }\n if (resolvedStyle?.isProcessed) {\n return layerName ? shallowLayer(serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;\n }\n return layerName ? shallowLayer(serializeStyles(resolvedStyle), layerName) : resolvedStyle;\n}\nfunction processStyleVariants(props, variants, results = [], layerName = undefined) {\n let mergedState; // We might not need it, initialized lazily\n\n variantLoop: for (let i = 0; i < variants.length; i += 1) {\n const variant = variants[i];\n if (typeof variant.props === 'function') {\n mergedState ??= {\n ...props,\n ...props.ownerState,\n ownerState: props.ownerState\n };\n if (!variant.props(mergedState)) {\n continue;\n }\n } else {\n for (const key in variant.props) {\n if (props[key] !== variant.props[key] && props.ownerState?.[key] !== variant.props[key]) {\n continue variantLoop;\n }\n }\n }\n if (typeof variant.style === 'function') {\n mergedState ??= {\n ...props,\n ...props.ownerState,\n ownerState: props.ownerState\n };\n results.push(layerName ? shallowLayer(serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));\n } else {\n results.push(layerName ? shallowLayer(serializeStyles(variant.style), layerName) : variant.style);\n }\n }\n return results;\n}\nexport default function createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n function styleAttachTheme(props) {\n attachTheme(props, themeId, defaultTheme);\n }\n const styled = (tag, inputOptions = {}) => {\n // If `tag` is already a styled component, filter out the `sx` style function\n // to prevent unnecessary styles generated by the composite components.\n mutateStyles(tag, styles => styles.filter(style => style !== styleFunctionSx));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),\n ...options\n } = inputOptions;\n const layerName = componentName && componentName.startsWith('Mui') || !!componentSlot ? 'components' : 'custom';\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = styledEngineStyled(tag, {\n shouldForwardProp: shouldForwardPropOption,\n label: generateStyledLabel(componentName, componentSlot),\n ...options\n });\n const transformStyle = style => {\n // - On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n // - `style` could be a styled component from a babel plugin for component selectors, This condition\n // makes sure that we do not interpolate them.\n if (style.__emotion_real === style) {\n return style;\n }\n if (typeof style === 'function') {\n return function styleFunctionProcessor(props) {\n return processStyle(props, style, props.theme.modularCssLayers ? layerName : undefined);\n };\n }\n if (isPlainObject(style)) {\n const serialized = preprocessStyles(style);\n return function styleObjectProcessor(props) {\n if (!serialized.variants) {\n return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;\n }\n return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : undefined);\n };\n }\n return style;\n };\n const muiStyledResolver = (...expressionsInput) => {\n const expressionsHead = [];\n const expressionsBody = expressionsInput.map(transformStyle);\n const expressionsTail = [];\n\n // Preprocess `props` to set the scoped theme value.\n // This must run before any other expression.\n expressionsHead.push(styleAttachTheme);\n if (componentName && overridesResolver) {\n expressionsTail.push(function styleThemeOverrides(props) {\n const theme = props.theme;\n const styleOverrides = theme.components?.[componentName]?.styleOverrides;\n if (!styleOverrides) {\n return null;\n }\n const resolvedStyleOverrides = {};\n\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n // eslint-disable-next-line guard-for-in\n for (const slotKey in styleOverrides) {\n resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? 'theme' : undefined);\n }\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsTail.push(function styleThemeVariants(props) {\n const theme = props.theme;\n const themeVariants = theme?.components?.[componentName]?.variants;\n if (!themeVariants) {\n return null;\n }\n return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? 'theme' : undefined);\n });\n }\n if (!skipSx) {\n expressionsTail.push(styleFunctionSx);\n }\n\n // This function can be called as a tagged template, so the first argument would contain\n // CSS `string[]` values.\n if (Array.isArray(expressionsBody[0])) {\n const inputStrings = expressionsBody.shift();\n\n // We need to add placeholders in the tagged template for the custom functions we have\n // possibly added (attachTheme, overrides, variants, and sx).\n const placeholdersHead = new Array(expressionsHead.length).fill('');\n const placeholdersTail = new Array(expressionsTail.length).fill('');\n let outputStrings;\n // prettier-ignore\n {\n outputStrings = [...placeholdersHead, ...inputStrings, ...placeholdersTail];\n outputStrings.raw = [...placeholdersHead, ...inputStrings.raw, ...placeholdersTail];\n }\n\n // The only case where we put something before `attachTheme`\n expressionsHead.unshift(outputStrings);\n }\n const expressions = [...expressionsHead, ...expressionsBody, ...expressionsTail];\n const Component = defaultStyledResolver(...expressions);\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n if (process.env.NODE_ENV !== 'production') {\n Component.displayName = generateDisplayName(componentName, componentSlot, tag);\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n return styled;\n}\nfunction generateDisplayName(componentName, componentSlot, tag) {\n if (componentName) {\n return `${componentName}${capitalize(componentSlot || '')}`;\n }\n return `Styled(${getDisplayName(tag)})`;\n}\nfunction generateStyledLabel(componentName, componentSlot) {\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n return label;\n}\nfunction isObjectEmpty(object) {\n // eslint-disable-next-line\n for (const _ in object) {\n return false;\n }\n return true;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\nfunction lowercaseFirstLetter(string) {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n}"],"names":["systemDefaultTheme","createTheme","shouldForwardProp","prop","shallowLayer","serialized","layerName","styles","startsWith","String","defaultOverridesResolver","slot","_props","processStyle","props","style","resolvedStyle","Array","isArray","flatMap","subStyle","variants","rootStyle","isProcessed","otherStyles","serializeStyles","processStyleVariants","results","undefined","mergedState","variantLoop","i","length","variant","ownerState","key","push","createStyled","input","themeId","defaultTheme","rootShouldForwardProp","slotShouldForwardProp","styleAttachTheme","theme","object","_","isObjectEmpty","attachTheme","tag","inputOptions","mutateStyles","filter","styleFunctionSx","name","componentName","componentSlot","skipVariantsResolver","inputSkipVariantsResolver","skipSx","inputSkipSx","overridesResolver","lowercaseFirstLetter","options","shouldForwardPropOption","charCodeAt","isStringTag","defaultStyledResolver","styledEngineStyled","label","generateStyledLabel","transformStyle","__emotion_real","modularCssLayers","isPlainObject","preprocessStyles","muiStyledResolver","expressionsInput","expressionsHead","expressionsBody","map","expressionsTail","styleOverrides","components","resolvedStyleOverrides","slotKey","themeVariants","inputStrings","shift","placeholdersHead","fill","placeholdersTail","outputStrings","raw","unshift","expressions","Component","muiName","process","env","NODE_ENV","displayName","capitalize","getDisplayName","generateDisplayName","withConfig","string","charAt","toLowerCase","slice"],"mappings":"6bAYY,MAACA,EAAqBC,IAG3B,SAASC,EAAkBC,GAChC,MAAgB,eAATA,GAAkC,UAATA,GAA6B,OAATA,GAA0B,OAATA,CACvE,CACA,SAASC,EAAaC,EAAYC,GAKhC,OAJIA,GAAaD,GAAoC,iBAAfA,GAA2BA,EAAWE,SAAWF,EAAWE,OAAOC,WAAW,YAElHH,EAAWE,OAAS,UAAUD,KAAaG,OAAOJ,EAAWE,YAExDF,CACT,CACA,SAASK,EAAyBC,GAChC,OAAKA,EAGE,CAACC,EAAQL,IAAWA,EAAOI,GAFzB,IAGX,CAIA,SAASE,EAAaC,EAAOC,EAAOT,GAUlC,MAAMU,EAAiC,mBAAVD,EAAuBA,EAAMD,GAASC,EACnE,GAAIE,MAAMC,QAAQF,GAChB,OAAOA,EAAcG,SAAQC,GAAYP,EAAaC,EAAOM,EAAUd,KAEzE,GAAIW,MAAMC,QAAQF,GAAeK,UAAW,CAC1C,IAAIC,EACJ,GAAIN,EAAcO,YAChBD,EAAYhB,EAAYF,EAAaY,EAAcD,MAAOT,GAAaU,EAAcD,UAChF,CACL,MAAMM,SACJA,KACGG,GACDR,EACJM,EAAYhB,EAAYF,EAAaqB,EAAgBD,GAAclB,GAAakB,CACtF,CACI,OAAOE,EAAqBZ,EAAOE,EAAcK,SAAU,CAACC,GAAYhB,EAC5E,CACE,OAAIU,GAAeO,YACVjB,EAAYF,EAAaqB,EAAgBT,EAAcD,OAAQT,GAAaU,EAAcD,MAE5FT,EAAYF,EAAaqB,EAAgBT,GAAgBV,GAAaU,CAC/E,CACA,SAASU,EAAqBZ,EAAOO,EAAUM,EAAU,GAAIrB,OAAYsB,GACvE,IAAIC,EAEJC,EAAa,IAAK,IAAIC,EAAI,EAAGA,EAAIV,EAASW,OAAQD,GAAK,EAAG,CACxD,MAAME,EAAUZ,EAASU,GAC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GEA,EAAOC,OAAO,GAAGC,cAAgBF,EAAOG,MAAM,GAF5CH,CAGX","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./cssVarsParser.js";import t from"../../../utils/esm/deepmerge/deepmerge.js";function s(s,r={}){const{getSelector:o=
|
|
1
|
+
import e from"./cssVarsParser.js";import t from"../../../utils/esm/deepmerge/deepmerge.js";function s(s,r={}){const{getSelector:o=_,disableCssColorScheme:a,colorSchemeSelector:c,enableContrastVars:l}=r,{colorSchemes:n={},components:i,defaultColorScheme:h="light",...f}=s,{vars:m,css:u,varsWithDefaults:d}=e(f,r);let p=d;const S={},{[h]:v,...g}=n;if(Object.entries(g||{}).forEach((([s,o])=>{const{vars:a,css:c,varsWithDefaults:l}=e(o,r);p=t(p,l),S[s]={css:c,vars:a}})),v){const{css:s,vars:o,varsWithDefaults:a}=e(v,r);p=t(p,a),S[h]={css:s,vars:o}}function _(e,t){let r=c;if("class"===c&&(r=".%s"),"data"===c&&(r="[data-%s]"),c?.startsWith("data-")&&!c.includes("%s")&&(r=`[${c}="%s"]`),e){if("media"===r){if(s.defaultColorScheme===e)return":root";const r=n[e]?.palette?.mode||e;return{[`@media (prefers-color-scheme: ${r})`]:{":root":t}}}if(r)return s.defaultColorScheme===e?`:root, ${r.replace("%s",String(e))}`:r.replace("%s",String(e))}return":root"}return{vars:p,generateThemeVars:()=>{let e={...m};return Object.entries(S).forEach((([,{vars:s}])=>{e=t(e,s)})),e},generateStyleSheets:()=>{const e=[],t=s.defaultColorScheme||"light";function r(t,s){Object.keys(s).length&&e.push("string"==typeof t?{[t]:{...s}}:t)}r(o(void 0,{...u}),u);const{[t]:c,...i}=S;if(c){const{css:e}=c,s=n[t]?.palette?.mode,l=!a&&s?{colorScheme:s,...e}:{...e};r(o(t,{...l}),l)}return Object.entries(i).forEach((([e,{css:t}])=>{const s=n[e]?.palette?.mode,c=!a&&s?{colorScheme:s,...t}:{...t};r(o(e,{...c}),c)})),l&&e.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),e}}}export{s as default};
|
|
2
2
|
//# sourceMappingURL=prepareCssVars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareCssVars.js","sources":["../../../../../../../node_modules/@mui/system/esm/cssVars/prepareCssVars.js"],"sourcesContent":["import deepmerge from '@mui/utils/deepmerge';\nimport cssVarsParser from \"./cssVarsParser.js\";\nfunction prepareCssVars(theme, parserConfig = {}) {\n const {\n getSelector = defaultGetSelector,\n disableCssColorScheme,\n colorSchemeSelector: selector\n } = parserConfig;\n // @ts-ignore - ignore components do not exist\n const {\n colorSchemes = {},\n components,\n defaultColorScheme = 'light',\n ...otherTheme\n } = theme;\n const {\n vars: rootVars,\n css: rootCss,\n varsWithDefaults: rootVarsWithDefaults\n } = cssVarsParser(otherTheme, parserConfig);\n let themeVars = rootVarsWithDefaults;\n const colorSchemesMap = {};\n const {\n [defaultColorScheme]: defaultScheme,\n ...otherColorSchemes\n } = colorSchemes;\n Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {\n const {\n vars,\n css,\n varsWithDefaults\n } = cssVarsParser(scheme, parserConfig);\n themeVars = deepmerge(themeVars, varsWithDefaults);\n colorSchemesMap[key] = {\n css,\n vars\n };\n });\n if (defaultScheme) {\n // default color scheme vars should be merged last to set as default\n const {\n css,\n vars,\n varsWithDefaults\n } = cssVarsParser(defaultScheme, parserConfig);\n themeVars = deepmerge(themeVars, varsWithDefaults);\n colorSchemesMap[defaultColorScheme] = {\n css,\n vars\n };\n }\n function defaultGetSelector(colorScheme, cssObject) {\n let rule = selector;\n if (selector === 'class') {\n rule = '.%s';\n }\n if (selector === 'data') {\n rule = '[data-%s]';\n }\n if (selector?.startsWith('data-') && !selector.includes('%s')) {\n // 'data-joy-color-scheme' -> '[data-joy-color-scheme=\"%s\"]'\n rule = `[${selector}=\"%s\"]`;\n }\n if (colorScheme) {\n if (rule === 'media') {\n if (theme.defaultColorScheme === colorScheme) {\n return ':root';\n }\n const mode = colorSchemes[colorScheme]?.palette?.mode || colorScheme;\n return {\n [`@media (prefers-color-scheme: ${mode})`]: {\n ':root': cssObject\n }\n };\n }\n if (rule) {\n if (theme.defaultColorScheme === colorScheme) {\n return `:root, ${rule.replace('%s', String(colorScheme))}`;\n }\n return rule.replace('%s', String(colorScheme));\n }\n }\n return ':root';\n }\n const generateThemeVars = () => {\n let vars = {\n ...rootVars\n };\n Object.entries(colorSchemesMap).forEach(([, {\n vars: schemeVars\n }]) => {\n vars = deepmerge(vars, schemeVars);\n });\n return vars;\n };\n const generateStyleSheets = () => {\n const stylesheets = [];\n const colorScheme = theme.defaultColorScheme || 'light';\n function insertStyleSheet(key, css) {\n if (Object.keys(css).length) {\n stylesheets.push(typeof key === 'string' ? {\n [key]: {\n ...css\n }\n } : key);\n }\n }\n insertStyleSheet(getSelector(undefined, {\n ...rootCss\n }), rootCss);\n const {\n [colorScheme]: defaultSchemeVal,\n ...other\n } = colorSchemesMap;\n if (defaultSchemeVal) {\n // default color scheme has to come before other color schemes\n const {\n css\n } = defaultSchemeVal;\n const cssColorSheme = colorSchemes[colorScheme]?.palette?.mode;\n const finalCss = !disableCssColorScheme && cssColorSheme ? {\n colorScheme: cssColorSheme,\n ...css\n } : {\n ...css\n };\n insertStyleSheet(getSelector(colorScheme, {\n ...finalCss\n }), finalCss);\n }\n Object.entries(other).forEach(([key, {\n css\n }]) => {\n const cssColorSheme = colorSchemes[key]?.palette?.mode;\n const finalCss = !disableCssColorScheme && cssColorSheme ? {\n colorScheme: cssColorSheme,\n ...css\n } : {\n ...css\n };\n insertStyleSheet(getSelector(key, {\n ...finalCss\n }), finalCss);\n });\n return stylesheets;\n };\n return {\n vars: themeVars,\n generateThemeVars,\n generateStyleSheets\n };\n}\nexport default prepareCssVars;"],"names":["prepareCssVars","theme","parserConfig","getSelector","defaultGetSelector","disableCssColorScheme","colorSchemeSelector","selector","colorSchemes","components","defaultColorScheme","otherTheme","vars","rootVars","css","rootCss","varsWithDefaults","rootVarsWithDefaults","cssVarsParser","themeVars","colorSchemesMap","defaultScheme","otherColorSchemes","Object","entries","forEach","key","scheme","deepmerge","colorScheme","cssObject","rule","startsWith","includes","mode","palette","replace","String","generateThemeVars","schemeVars","generateStyleSheets","stylesheets","insertStyleSheet","keys","length","push","undefined","defaultSchemeVal","other","cssColorSheme","finalCss"],"mappings":"2FAEA,SAASA,EAAeC,EAAOC,EAAe,IAC5C,MAAMC,YACJA,EAAcC,EAAkBC,sBAChCA,EACAC,oBAAqBC,
|
|
1
|
+
{"version":3,"file":"prepareCssVars.js","sources":["../../../../../../../node_modules/@mui/system/esm/cssVars/prepareCssVars.js"],"sourcesContent":["import deepmerge from '@mui/utils/deepmerge';\nimport cssVarsParser from \"./cssVarsParser.js\";\nfunction prepareCssVars(theme, parserConfig = {}) {\n const {\n getSelector = defaultGetSelector,\n disableCssColorScheme,\n colorSchemeSelector: selector,\n enableContrastVars\n } = parserConfig;\n // @ts-ignore - ignore components do not exist\n const {\n colorSchemes = {},\n components,\n defaultColorScheme = 'light',\n ...otherTheme\n } = theme;\n const {\n vars: rootVars,\n css: rootCss,\n varsWithDefaults: rootVarsWithDefaults\n } = cssVarsParser(otherTheme, parserConfig);\n let themeVars = rootVarsWithDefaults;\n const colorSchemesMap = {};\n const {\n [defaultColorScheme]: defaultScheme,\n ...otherColorSchemes\n } = colorSchemes;\n Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {\n const {\n vars,\n css,\n varsWithDefaults\n } = cssVarsParser(scheme, parserConfig);\n themeVars = deepmerge(themeVars, varsWithDefaults);\n colorSchemesMap[key] = {\n css,\n vars\n };\n });\n if (defaultScheme) {\n // default color scheme vars should be merged last to set as default\n const {\n css,\n vars,\n varsWithDefaults\n } = cssVarsParser(defaultScheme, parserConfig);\n themeVars = deepmerge(themeVars, varsWithDefaults);\n colorSchemesMap[defaultColorScheme] = {\n css,\n vars\n };\n }\n function defaultGetSelector(colorScheme, cssObject) {\n let rule = selector;\n if (selector === 'class') {\n rule = '.%s';\n }\n if (selector === 'data') {\n rule = '[data-%s]';\n }\n if (selector?.startsWith('data-') && !selector.includes('%s')) {\n // 'data-joy-color-scheme' -> '[data-joy-color-scheme=\"%s\"]'\n rule = `[${selector}=\"%s\"]`;\n }\n if (colorScheme) {\n if (rule === 'media') {\n if (theme.defaultColorScheme === colorScheme) {\n return ':root';\n }\n const mode = colorSchemes[colorScheme]?.palette?.mode || colorScheme;\n return {\n [`@media (prefers-color-scheme: ${mode})`]: {\n ':root': cssObject\n }\n };\n }\n if (rule) {\n if (theme.defaultColorScheme === colorScheme) {\n return `:root, ${rule.replace('%s', String(colorScheme))}`;\n }\n return rule.replace('%s', String(colorScheme));\n }\n }\n return ':root';\n }\n const generateThemeVars = () => {\n let vars = {\n ...rootVars\n };\n Object.entries(colorSchemesMap).forEach(([, {\n vars: schemeVars\n }]) => {\n vars = deepmerge(vars, schemeVars);\n });\n return vars;\n };\n const generateStyleSheets = () => {\n const stylesheets = [];\n const colorScheme = theme.defaultColorScheme || 'light';\n function insertStyleSheet(key, css) {\n if (Object.keys(css).length) {\n stylesheets.push(typeof key === 'string' ? {\n [key]: {\n ...css\n }\n } : key);\n }\n }\n insertStyleSheet(getSelector(undefined, {\n ...rootCss\n }), rootCss);\n const {\n [colorScheme]: defaultSchemeVal,\n ...other\n } = colorSchemesMap;\n if (defaultSchemeVal) {\n // default color scheme has to come before other color schemes\n const {\n css\n } = defaultSchemeVal;\n const cssColorSheme = colorSchemes[colorScheme]?.palette?.mode;\n const finalCss = !disableCssColorScheme && cssColorSheme ? {\n colorScheme: cssColorSheme,\n ...css\n } : {\n ...css\n };\n insertStyleSheet(getSelector(colorScheme, {\n ...finalCss\n }), finalCss);\n }\n Object.entries(other).forEach(([key, {\n css\n }]) => {\n const cssColorSheme = colorSchemes[key]?.palette?.mode;\n const finalCss = !disableCssColorScheme && cssColorSheme ? {\n colorScheme: cssColorSheme,\n ...css\n } : {\n ...css\n };\n insertStyleSheet(getSelector(key, {\n ...finalCss\n }), finalCss);\n });\n if (enableContrastVars) {\n stylesheets.push({\n ':root': {\n // use double underscore to indicate that these are private variables\n '--__l-threshold': '0.7',\n '--__l': 'clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)',\n '--__a': 'clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)' // 0.87 is the default alpha value for black text.\n }\n });\n }\n return stylesheets;\n };\n return {\n vars: themeVars,\n generateThemeVars,\n generateStyleSheets\n };\n}\nexport default prepareCssVars;"],"names":["prepareCssVars","theme","parserConfig","getSelector","defaultGetSelector","disableCssColorScheme","colorSchemeSelector","selector","enableContrastVars","colorSchemes","components","defaultColorScheme","otherTheme","vars","rootVars","css","rootCss","varsWithDefaults","rootVarsWithDefaults","cssVarsParser","themeVars","colorSchemesMap","defaultScheme","otherColorSchemes","Object","entries","forEach","key","scheme","deepmerge","colorScheme","cssObject","rule","startsWith","includes","mode","palette","replace","String","generateThemeVars","schemeVars","generateStyleSheets","stylesheets","insertStyleSheet","keys","length","push","undefined","defaultSchemeVal","other","cssColorSheme","finalCss"],"mappings":"2FAEA,SAASA,EAAeC,EAAOC,EAAe,IAC5C,MAAMC,YACJA,EAAcC,EAAkBC,sBAChCA,EACAC,oBAAqBC,EAAQC,mBAC7BA,GACEN,GAEEO,aACJA,EAAe,CAAE,EAAAC,WACjBA,EAAUC,mBACVA,EAAqB,WAClBC,GACDX,GAEFY,KAAMC,EACNC,IAAKC,EACLC,iBAAkBC,GAChBC,EAAcP,EAAYV,GAC9B,IAAIkB,EAAYF,EAChB,MAAMG,EAAkB,CAAE,GAExBV,CAACA,GAAqBW,KACnBC,GACDd,EAaJ,GAZAe,OAAOC,QAAQF,GAAqB,CAAE,GAAEG,SAAQ,EAAEC,EAAKC,MACrD,MAAMf,KACJA,EAAIE,IACJA,EAAGE,iBACHA,GACEE,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ACJ,GAAI2B,EAAkB,CAEpB,MAAMjC,IACJA,GACEiC,EACEE,EAAgBzC,EAAaqB,IAAcM,SAASD,KACpDgB,GAAY9C,GAAyB6C,EAAgB,CACzDpB,YAAaoB,KACVnC,GACD,IACCA,GAEL4B,EAAiBxC,EAAY2B,EAAa,IACrCqB,IACDA,EACV,CAyBI,OAxBA3B,OAAOC,QAAQwB,GAAOvB,SAAQ,EAAEC,GAC9BZ,WAEA,MAAMmC,EAAgBzC,EAAakB,IAAMS,SAASD,KAC5CgB,GAAY9C,GAAyB6C,EAAgB,CACzDpB,YAAaoB,KACVnC,GACD,IACCA,GAEL4B,EAAiBxC,EAAYwB,EAAK,IAC7BwB,IACDA,MAEF3C,GACFkC,EAAYI,KAAK,CACf,QAAS,CAEP,kBAAmB,MACnB,QAAS,0DACT,QAAS,gEAIRJ,GAOX","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./defaultSxConfig.js";import{createEmptyBreakpointObject as t,handleBreakpoints as r,removeUnusedBreakpoints as n}from"../breakpoints/breakpoints.js";import
|
|
1
|
+
import e from"./defaultSxConfig.js";import{createEmptyBreakpointObject as t,handleBreakpoints as r,removeUnusedBreakpoints as n}from"../breakpoints/breakpoints.js";import s from"../merge/merge.js";import{sortContainerQueries as o}from"../cssContainerQueries/cssContainerQueries.js";import{getPath as i,getStyleValue as f}from"../style/style.js";import u from"../../../utils/esm/capitalize/capitalize.js";function c(){function c(e,t,n,s){const o={[e]:t,theme:n},c=s[e];if(!c)return{[e]:t};const{cssProperty:l=e,themeKey:a,transform:m,style:p}=c;if(null==t)return null;if("typography"===a&&"inherit"===t)return{[e]:t};const y=i(n,a)||{};if(p)return p(o);return r(o,t,(t=>{let r=f(y,m,t);return t===r&&"string"==typeof t&&(r=f(y,m,`${e}${"default"===t?"":u(t)}`,t)),!1===l?r:{[l]:r}}))}return function i(f){const{sx:u,theme:l={},nested:a}=f||{};if(!u)return null;const m=l.unstable_sxConfig??e;function p(e){let f=e;if("function"==typeof e)f=e(l);else if("object"!=typeof e)return e;if(!f)return null;const u=t(l.breakpoints),p=Object.keys(u);let y=u;return Object.keys(f).forEach((e=>{const t=(n=f[e],o=l,"function"==typeof n?n(o):n);var n,o;if(null!=t)if("object"==typeof t)if(m[e])y=s(y,c(e,t,l,m));else{const n=r({theme:l},t,(t=>({[e]:t})));!function(...e){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]),r=new Set(t);return e.every((e=>r.size===Object.keys(e).length))}(n,t)?y=s(y,n):y[e]=i({sx:t,theme:l,nested:!0})}else y=s(y,c(e,t,l,m))})),!a&&l.modularCssLayers?{"@layer sx":o(l,n(p,y))}:o(l,n(p,y))}return Array.isArray(u)?u.map(p):p(u)}}const l=c();l.filterProps=["sx"];export{l as default,c as unstable_createStyleFunctionSx};
|
|
2
2
|
//# sourceMappingURL=styleFunctionSx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleFunctionSx.js","sources":["../../../../../../../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js"],"sourcesContent":["import capitalize from '@mui/utils/capitalize';\nimport merge from \"../merge/index.js\";\nimport { getPath, getStyleValue as getValue } from \"../style/index.js\";\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from \"../breakpoints/index.js\";\nimport { sortContainerQueries } from \"../cssContainerQueries/index.js\";\nimport defaultSxConfig from \"./defaultSxConfig.js\";\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && val === 'inherit') {\n return {\n [prop]: val\n };\n }\n const themeMapping = getPath(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n const {\n sx,\n theme = {}\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n const config = theme.unstable_sxConfig ?? defaultSxConfig;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;"],"names":["unstable_createStyleFunctionSx","getThemeValue","prop","val","theme","config","props","options","cssProperty","themeKey","transform","style","themeMapping","getPath","handleBreakpoints","propValueFinal","value","getValue","capitalize","styleFunctionSx","sx","unstable_sxConfig","defaultSxConfig","traverse","sxInput","sxObject","emptyBreakpoints","createEmptyBreakpointObject","breakpoints","breakpointsKeys","Object","keys","css","forEach","styleKey","maybeFn","arg","merge","breakpointsValues","x","objects","allKeys","reduce","object","concat","union","Set","every","size","length","objectsHaveSameKeys","sortContainerQueries","removeUnusedBreakpoints","Array","isArray","map","filterProps"],"mappings":"oZAgBO,SAASA,IACd,SAASC,EAAcC,EAAMC,EAAKC,EAAOC,GACvC,MAAMC,EAAQ,CACZJ,CAACA,GAAOC,EACRC,SAEIG,EAAUF,EAAOH,GACvB,IAAKK,EACH,MAAO,CACLL,CAACA,GAAOC,GAGZ,MAAMK,YACJA,EAAcN,EAAIO,SAClBA,EAAQC,UACRA,EAASC,MACTA,GACEJ,EACJ,GAAW,MAAPJ,EACF,OAAO,KAIT,GAAiB,eAAbM,GAAqC,YAARN,EAC/B,MAAO,CACLD,CAACA,GAAOC,GAGZ,MAAMS,EAAeC,EAAQT,EAAOK,IAAa,CAAE,EACnD,GAAIE,EACF,OAAOA,EAAML,GAef,OAAOQ,EAAkBR,EAAOH,GAbLY,IACzB,IAAIC,EAAQC,EAASL,EAAcF,EAAWK,GAK9C,OAJIA,IAAmBC,GAAmC,iBAAnBD,IAErCC,EAAQC,EAASL,EAAcF,EAAW,GAAGR,IAA0B,YAAnBa,EAA+B,GAAKG,EAAWH,KAAmBA,KAEpG,IAAhBP,EACKQ,EAEF,CACLR,CAACA,GAAcQ,KAIvB,
|
|
1
|
+
{"version":3,"file":"styleFunctionSx.js","sources":["../../../../../../../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js"],"sourcesContent":["import capitalize from '@mui/utils/capitalize';\nimport merge from \"../merge/index.js\";\nimport { getPath, getStyleValue as getValue } from \"../style/index.js\";\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from \"../breakpoints/index.js\";\nimport { sortContainerQueries } from \"../cssContainerQueries/index.js\";\nimport defaultSxConfig from \"./defaultSxConfig.js\";\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && val === 'inherit') {\n return {\n [prop]: val\n };\n }\n const themeMapping = getPath(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n const {\n sx,\n theme = {},\n nested\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n const config = theme.unstable_sxConfig ?? defaultSxConfig;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme,\n nested: true\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n if (!nested && theme.modularCssLayers) {\n return {\n '@layer sx': sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css))\n };\n }\n return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;"],"names":["unstable_createStyleFunctionSx","getThemeValue","prop","val","theme","config","props","options","cssProperty","themeKey","transform","style","themeMapping","getPath","handleBreakpoints","propValueFinal","value","getValue","capitalize","styleFunctionSx","sx","nested","unstable_sxConfig","defaultSxConfig","traverse","sxInput","sxObject","emptyBreakpoints","createEmptyBreakpointObject","breakpoints","breakpointsKeys","Object","keys","css","forEach","styleKey","maybeFn","arg","merge","breakpointsValues","x","objects","allKeys","reduce","object","concat","union","Set","every","size","length","objectsHaveSameKeys","modularCssLayers","sortContainerQueries","removeUnusedBreakpoints","Array","isArray","map","filterProps"],"mappings":"oZAgBO,SAASA,IACd,SAASC,EAAcC,EAAMC,EAAKC,EAAOC,GACvC,MAAMC,EAAQ,CACZJ,CAACA,GAAOC,EACRC,SAEIG,EAAUF,EAAOH,GACvB,IAAKK,EACH,MAAO,CACLL,CAACA,GAAOC,GAGZ,MAAMK,YACJA,EAAcN,EAAIO,SAClBA,EAAQC,UACRA,EAASC,MACTA,GACEJ,EACJ,GAAW,MAAPJ,EACF,OAAO,KAIT,GAAiB,eAAbM,GAAqC,YAARN,EAC/B,MAAO,CACLD,CAACA,GAAOC,GAGZ,MAAMS,EAAeC,EAAQT,EAAOK,IAAa,CAAE,EACnD,GAAIE,EACF,OAAOA,EAAML,GAef,OAAOQ,EAAkBR,EAAOH,GAbLY,IACzB,IAAIC,EAAQC,EAASL,EAAcF,EAAWK,GAK9C,OAJIA,IAAmBC,GAAmC,iBAAnBD,IAErCC,EAAQC,EAASL,EAAcF,EAAW,GAAGR,IAA0B,YAAnBa,EAA+B,GAAKG,EAAWH,KAAmBA,KAEpG,IAAhBP,EACKQ,EAEF,CACLR,CAACA,GAAcQ,KAIvB,CAmEE,OAlEA,SAASG,EAAgBb,GACvB,MAAMc,GACJA,EAAEhB,MACFA,EAAQ,CAAE,EAAAiB,OACVA,GACEf,GAAS,CAAE,EACf,IAAKc,EACH,OAAO,KAET,MAAMf,EAASD,EAAMkB,mBAAqBC,EAO1C,SAASC,EAASC,GAChB,IAAIC,EAAWD,EACf,GAAuB,mBAAZA,EACTC,EAAWD,EAAQrB,QACd,GAAuB,iBAAZqB,EAEhB,OAAOA,EAET,IAAKC,EACH,OAAO,KAET,MAAMC,EAAmBC,EAA4BxB,EAAMyB,aACrDC,EAAkBC,OAAOC,KAAKL,GACpC,IAAIM,EAAMN,EA4BV,OA3BAI,OAAOC,KAAKN,GAAUQ,SAAQC,IAC5B,MAAMnB,GAnFIoB,EAmFaV,EAASS,GAnFbE,EAmFwBjC,EAlFvB,mBAAZgC,EAAyBA,EAAQC,GAAOD,GADxD,IAAkBA,EAASC,EAoFnB,GAAIrB,QACF,GAAqB,iBAAVA,EACT,GAAIX,EAAO8B,GACTF,EAAMK,EAAML,EAAKhC,EAAckC,EAAUnB,EAAOZ,EAAOC,QAClD,CACL,MAAMkC,EAAoBzB,EAAkB,CAC1CV,SACCY,GAAOwB,IAAM,CACdL,CAACA,GAAWK,OAjG5B,YAAgCC,GAC9B,MAAMC,EAAUD,EAAQE,QAAO,CAACX,EAAMY,IAAWZ,EAAKa,OAAOd,OAAOC,KAAKY,KAAU,IAC7EE,EAAQ,IAAIC,IAAIL,GACtB,OAAOD,EAAQO,OAAMJ,GAAUE,EAAMG,OAASlB,OAAOC,KAAKY,GAAQM,QACpE,CA+FkBC,CAAoBZ,EAAmBvB,GAOzCiB,EAAMK,EAAML,EAAKM,GANjBN,EAAIE,GAAYhB,EAAgB,CAC9BC,GAAIJ,EACJZ,QACAiB,QAAQ,GAK1B,MAEYY,EAAMK,EAAML,EAAKhC,EAAckC,EAAUnB,EAAOZ,EAAOC,QAIxDgB,GAAUjB,EAAMgD,iBACZ,CACL,YAAaC,EAAqBjD,EAAOkD,EAAwBxB,EAAiBG,KAG/EoB,EAAqBjD,EAAOkD,EAAwBxB,EAAiBG,GAClF,CACI,OAAOsB,MAAMC,QAAQpC,GAAMA,EAAGqC,IAAIjC,GAAYA,EAASJ,EAC3D,CAEA,CACK,MAACD,EAAkBnB,IACxBmB,EAAgBuC,YAAc,CAAC","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../../../../node_modules/@mui/system/esm/styled/styled.js"],"sourcesContent":["import createStyled from \"../createStyled/index.js\";\nconst styled = createStyled();\nexport default styled;"],"names":["styled","createStyled"],"mappings":"+CACK,MAACA,EAASC","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
import{clsx as s}from"../../../../clsx/dist/clsx.js";function e(t,o,l=!1){const c={...o};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const a=n;if("components"===a||"slots"===a)c[a]={...t[a],...c[a]};else if("componentsProps"===a||"slotProps"===a){const s=t[a],n=o[a];if(n)if(s){c[a]={...n};for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)){const o=t;c[a][o]=e(s[o],n[o],l)}}else c[a]=n;else c[a]=s||{}}else"className"===a&&l&&o.className?c.className=s(t?.className,o?.className):"style"===a&&l&&o.style?c.style={...t?.style,...o?.style}:void 0===c[a]&&(c[a]=t[a])}return c}export{e as default};
|
|
2
2
|
//# sourceMappingURL=resolveProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveProps.js","sources":["../../../../../../../node_modules/@mui/utils/esm/resolveProps/resolveProps.js"],"sourcesContent":["/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param defaultProps\n * @param props\n * @returns resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = {\n ...props\n };\n for (const key in defaultProps) {\n if (Object.prototype.hasOwnProperty.call(defaultProps, key)) {\n const propName = key;\n if (propName === 'components' || propName === 'slots') {\n output[propName] = {\n ...defaultProps[propName],\n ...output[propName]\n };\n } else if (propName === 'componentsProps' || propName === 'slotProps') {\n const defaultSlotProps = defaultProps[propName];\n const slotProps = props[propName];\n if (!slotProps) {\n output[propName] = defaultSlotProps || {};\n } else if (!defaultSlotProps) {\n output[propName] = slotProps;\n } else {\n output[propName] = {\n ...slotProps\n };\n for (const slotKey in defaultSlotProps) {\n if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {\n const slotPropName = slotKey;\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n }\n }\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n }\n }\n return output;\n}"],"names":["resolveProps","defaultProps","props","output","key","Object","prototype","hasOwnProperty","call","propName","defaultSlotProps","slotProps","slotKey","slotPropName","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveProps.js","sources":["../../../../../../../node_modules/@mui/utils/esm/resolveProps/resolveProps.js"],"sourcesContent":["import clsx from 'clsx';\n\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param defaultProps\n * @param props\n * @param mergeClassNameAndStyle If `true`, merges `className` and `style` props instead of overriding them.\n * When `false` (default), props override defaultProps. When `true`, `className` values are concatenated\n * and `style` objects are merged with props taking precedence.\n * @returns resolved props\n */\nexport default function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {\n const output = {\n ...props\n };\n for (const key in defaultProps) {\n if (Object.prototype.hasOwnProperty.call(defaultProps, key)) {\n const propName = key;\n if (propName === 'components' || propName === 'slots') {\n output[propName] = {\n ...defaultProps[propName],\n ...output[propName]\n };\n } else if (propName === 'componentsProps' || propName === 'slotProps') {\n const defaultSlotProps = defaultProps[propName];\n const slotProps = props[propName];\n if (!slotProps) {\n output[propName] = defaultSlotProps || {};\n } else if (!defaultSlotProps) {\n output[propName] = slotProps;\n } else {\n output[propName] = {\n ...slotProps\n };\n for (const slotKey in defaultSlotProps) {\n if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {\n const slotPropName = slotKey;\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName], mergeClassNameAndStyle);\n }\n }\n }\n } else if (propName === 'className' && mergeClassNameAndStyle && props.className) {\n output.className = clsx(defaultProps?.className, props?.className);\n } else if (propName === 'style' && mergeClassNameAndStyle && props.style) {\n output.style = {\n ...defaultProps?.style,\n ...props?.style\n };\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n }\n }\n return output;\n}"],"names":["resolveProps","defaultProps","props","mergeClassNameAndStyle","output","key","Object","prototype","hasOwnProperty","call","propName","defaultSlotProps","slotProps","slotKey","slotPropName","className","clsx","style","undefined"],"mappings":"qDAWe,SAASA,EAAaC,EAAcC,EAAOC,GAAyB,GACjF,MAAMC,EAAS,IACVF,GAEL,IAAK,MAAMG,KAAOJ,EAChB,GAAIK,OAAOC,UAAUC,eAAeC,KAAKR,EAAcI,GAAM,CAC3D,MAAMK,EAAWL,EACjB,GAAiB,eAAbK,GAA0C,UAAbA,EAC/BN,EAAOM,GAAY,IACdT,EAAaS,MACbN,EAAOM,SAEP,GAAiB,oBAAbA,GAA+C,cAAbA,EAA0B,CACrE,MAAMC,EAAmBV,EAAaS,GAChCE,EAAYV,EAAMQ,GACxB,GAAKE,EAEE,GAAKD,EAEL,CACLP,EAAOM,GAAY,IACdE,GAEL,IAAK,MAAMC,KAAWF,EACpB,GAAIL,OAAOC,UAAUC,eAAeC,KAAKE,EAAkBE,GAAU,CACnE,MAAMC,EAAeD,EACrBT,EAAOM,GAAUI,GAAgBd,EAAaW,EAAiBG,GAAeF,EAAUE,GAAeX,EACrH,CAEA,MAXUC,EAAOM,GAAYE,OAFnBR,EAAOM,GAAYC,GAAoB,CAAE,CAc5C,KAAuB,cAAbD,GAA4BP,GAA0BD,EAAMa,UACrEX,EAAOW,UAAYC,EAAKf,GAAcc,UAAWb,GAAOa,WAClC,UAAbL,GAAwBP,GAA0BD,EAAMe,MACjEb,EAAOa,MAAQ,IACVhB,GAAcgB,SACdf,GAAOe,YAEkBC,IAArBd,EAAOM,KAChBN,EAAOM,GAAYT,EAAaS,GAExC,CAEE,OAAON,CACT","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyfri/shared-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@emotion/react": "^11.14.0",
|
|
13
13
|
"@emotion/styled": "^11.14.0",
|
|
14
14
|
"@mui/icons-material": "^7.1.0",
|
|
15
|
+
"@mui/lab": "^7.0.0-beta.16",
|
|
15
16
|
"@mui/material": "^7.1.2",
|
|
16
17
|
"@mui/x-date-pickers": "^8.5.3",
|
|
17
18
|
"@mui/x-date-pickers-pro": "^8.5.3",
|
|
@@ -33,6 +34,11 @@
|
|
|
33
34
|
"types": "./esm/index.d.ts"
|
|
34
35
|
},
|
|
35
36
|
"./package.json": "./package.json",
|
|
37
|
+
"./components/timeline": {
|
|
38
|
+
"import": "./esm/components/timeline.js",
|
|
39
|
+
"require": "./cjs/components/timeline.cjs",
|
|
40
|
+
"types": "./esm/components/timeline/timeline.d.ts"
|
|
41
|
+
},
|
|
36
42
|
"./components/Table": {
|
|
37
43
|
"import": "./esm/components/Table.js",
|
|
38
44
|
"require": "./cjs/components/Table.cjs",
|
|
@@ -48,6 +54,11 @@
|
|
|
48
54
|
"require": "./cjs/components/Select.cjs",
|
|
49
55
|
"types": "./esm/components/Select/Select.d.ts"
|
|
50
56
|
},
|
|
57
|
+
"./components/InputGroup": {
|
|
58
|
+
"import": "./esm/components/InputGroup.js",
|
|
59
|
+
"require": "./cjs/components/InputGroup.cjs",
|
|
60
|
+
"types": "./esm/components/InputGroup/InputGroup.d.ts"
|
|
61
|
+
},
|
|
51
62
|
"./components/Input": {
|
|
52
63
|
"import": "./esm/components/Input.js",
|
|
53
64
|
"require": "./cjs/components/Input.cjs",
|
|
@@ -58,6 +69,11 @@
|
|
|
58
69
|
"require": "./cjs/components/Icon.cjs",
|
|
59
70
|
"types": "./esm/components/Icon/Icon.d.ts"
|
|
60
71
|
},
|
|
72
|
+
"./components/Flyout": {
|
|
73
|
+
"import": "./esm/components/Flyout.js",
|
|
74
|
+
"require": "./cjs/components/Flyout.cjs",
|
|
75
|
+
"types": "./esm/components/Flyout/Flyout.d.ts"
|
|
76
|
+
},
|
|
61
77
|
"./components/DateTimePicker": {
|
|
62
78
|
"import": "./esm/components/DateTimePicker.js",
|
|
63
79
|
"require": "./cjs/components/DateTimePicker.cjs",
|