@ctlyst.id/internal-ui 2.1.4 → 2.1.5

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.
@@ -4,7 +4,7 @@ export interface LoaderProps {
4
4
  variant?: string;
5
5
  thickness?: string;
6
6
  }
7
- export interface CustomBadgeProps extends HTMLChakraProps<'span'>, ThemingProps {
7
+ export interface CustomLoaderProps extends HTMLChakraProps<'span'>, ThemingProps {
8
8
  }
9
- declare const Loader: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"div", CustomBadgeProps>;
9
+ declare const Loader: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"div", CustomLoaderProps>;
10
10
  export default Loader;
@@ -4125,6 +4125,7 @@ const Input = /*#__PURE__*/defineMultiStyleConfig$2({
4125
4125
  }
4126
4126
  });
4127
4127
 
4128
+ /* eslint-disable prefer-destructuring */
4128
4129
  const rotate = /*#__PURE__*/react$1.keyframes({
4129
4130
  '0%': {
4130
4131
  transform: 'rotate(0deg)'
@@ -4134,10 +4135,23 @@ const rotate = /*#__PURE__*/react$1.keyframes({
4134
4135
  }
4135
4136
  });
4136
4137
  const getLoaderColor = color => {
4137
- if (color === 'primary') return '--chakra-colors-primary-600';
4138
- if (color === 'danger') return '--chakra-colors-danger-500';
4139
- if (color === 'warning') return '--chakra-colors-warning-700';
4140
- return '--chakra-colors-white-high';
4138
+ const colorValue = color.split('.');
4139
+ let backgroundColor;
4140
+ switch (colorValue.length) {
4141
+ case 1:
4142
+ backgroundColor = colorValue[0];
4143
+ break;
4144
+ case 2:
4145
+ backgroundColor = `var(--chakra-colors-${colorValue[0]}-${colorValue[1]})`;
4146
+ break;
4147
+ default:
4148
+ backgroundColor = 'var(--chakra-colors-white-high)';
4149
+ break;
4150
+ }
4151
+ if (color === 'primary') return 'var(--chakra-colors-primary-600)';
4152
+ if (color === 'danger') return 'var(--chakra-colors-danger-500)';
4153
+ if (color === 'warning') return 'var(--chakra-colors-warning-700)';
4154
+ return backgroundColor;
4141
4155
  };
4142
4156
  const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
4143
4157
  baseStyle: props => {
@@ -4148,7 +4162,7 @@ const LoaderStyle = /*#__PURE__*/styledSystem.defineStyleConfig({
4148
4162
  justifyContent: 'center',
4149
4163
  alignItems: 'center',
4150
4164
  animation: `${rotate} 1s linear infinite`,
4151
- background: `conic-gradient(from 180deg at 50% 50%, var(${colors}) 0deg, rgba(217, 217, 217, 0) 360deg);`,
4165
+ background: `conic-gradient(from 180deg at 50% 50%, ${colors} 0deg, rgba(217, 217, 217, 0) 360deg);`,
4152
4166
  ':before': {
4153
4167
  content: `''`,
4154
4168
  display: 'block',