@soul-refiner/design-system 1.1.5 → 1.1.7

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.
@@ -14,6 +14,7 @@ export interface UploadProps extends React.PropsWithChildren {
14
14
  subtext?: string;
15
15
  text?: React.ReactNode;
16
16
  type: UploadTypes;
17
+ height?: number;
17
18
  }
18
- export declare const Upload: ({ background, borderColor, children, iconColor, multiple, onDrop, size, subtext, text, type, }: UploadProps) => React.JSX.Element;
19
+ export declare const Upload: ({ background, borderColor, children, iconColor, multiple, onDrop, size, subtext, text, type, height, }: UploadProps) => React.JSX.Element;
19
20
  export {};
@@ -4,7 +4,7 @@ import styled from 'styled-components';
4
4
  import { COLORS } from '../../../common';
5
5
  import { Box, Button, P } from '../../';
6
6
  import { UploadAudio, UploadFile, UploadImage, UploadVideo, } from '../../../icons';
7
- export const Upload = ({ background = 'hue-blue-3', borderColor = 'hue-blue-2', children, iconColor = 'primary-blue-2', multiple, onDrop, size = 'large', subtext, text, type, }) => {
7
+ export const Upload = ({ background = 'hue-blue-3', borderColor = 'hue-blue-2', children, iconColor = 'primary-blue-2', multiple, onDrop, size = 'large', subtext, text, type, height, }) => {
8
8
  const filesRef = React.useRef(null);
9
9
  const [draggingOver, setDraggingOver] = React.useState(false);
10
10
  const fileTypeLookup = {
@@ -113,7 +113,7 @@ export const Upload = ({ background = 'hue-blue-3', borderColor = 'hue-blue-2',
113
113
  filesRef.current.value = '';
114
114
  };
115
115
  return (React.createElement(React.Fragment, null,
116
- React.createElement(Wrapper, { "$background": background, "$borderColor": borderColor, "$draggingOver": draggingOver, "$height": heightLookup[type].height[size], "$size": size, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop },
116
+ React.createElement(Wrapper, { "$background": background, "$borderColor": borderColor, "$draggingOver": draggingOver, "$height": height || heightLookup[type].height[size], "$size": size, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop },
117
117
  React.createElement(Box, { "$align": "center", "$borderRadius": "medium", "$dir": "column", "$display": "flex", "$gap": 16, "$justify": "center", sx: "height: 100%; width: 100%; svg { flex-shrink: 0; };" },
118
118
  iconLookup[type],
119
119
  size !== 'small' && (React.createElement(Box, { "$align": "center", "$dir": "column", "$display": "flex", "$gap": 8, "$justify": "center", sx: "width: 100%;" },
@@ -6,7 +6,7 @@ type NativeProps = Pick<React.HTMLAttributes<SVGElement>, 'children' | 'classNam
6
6
  export interface IconProps extends NativeProps {
7
7
  as?: React.ElementType;
8
8
  color?: (typeof COLORS)[number];
9
- size?: 16 | 20 | 24;
9
+ size?: 16 | 20 | 24 | 40;
10
10
  sx?: string;
11
11
  }
12
12
  export declare const Icon: ({ as, children, color, size, sx, ...rest }: IconProps) => React.JSX.Element;
@@ -17,9 +17,9 @@ export type Props = {
17
17
  size?: TextInputSize;
18
18
  sx?: string;
19
19
  value: string | string[];
20
- isNumber?: boolean;
21
20
  placeIconAtTheEnd?: boolean;
22
21
  inputSx?: string;
22
+ type?: 'number' | 'password' | 'text';
23
23
  };
24
24
  interface DisabledProps extends Props {
25
25
  disabled?: true;
@@ -37,5 +37,5 @@ interface WarningProps extends Props {
37
37
  warning?: true;
38
38
  }
39
39
  export type TextInputProps = DisabledProps | SuccessfulProps | WarningProps;
40
- export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, isNumber, placeIconAtTheEnd, inputSx, }: TextInputProps) => React.JSX.Element;
40
+ export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, type, placeIconAtTheEnd, inputSx, }: TextInputProps) => React.JSX.Element;
41
41
  export {};
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Chip } from '../../feedback/chip/chip';
5
5
  import { CheckmarkCircle, AlertCircle } from '../../../icons';
6
- export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size = 'large', successful, sx, value, warning, isNumber, placeIconAtTheEnd = false, inputSx, }) => {
6
+ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size = 'large', successful, sx, value, warning, type = 'text', placeIconAtTheEnd = false, inputSx, }) => {
7
7
  const id = React.useId();
8
8
  const isMultiple = multiple;
9
9
  const [multipleValueToAdd, setMultipleValueToAdd] = React.useState('');
@@ -49,12 +49,12 @@ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, i
49
49
  isMultiple && (React.createElement(MultipleInputWrapper, { onSubmit: handleMultipleAdd },
50
50
  value.filter(Boolean).map((item, index) => (React.createElement(Chip, { key: id + item + index, color: "blue", size: "small", onDismiss: () => handleMultipleItemRemoval(item) }, item))),
51
51
  React.createElement(Input, { onChange: handleMultipleValueToAdd, onKeyDown: handleMultipleValueDelete, value: multipleValueToAdd, "$size": size, "$sx": inputSx }))),
52
- !isMultiple && (React.createElement(Input, { disabled: disabled, name: name, onChange: onChange, placeholder: placeholder, value: isNumber
52
+ !isMultiple && (React.createElement(Input, { disabled: disabled, name: name, onChange: onChange, placeholder: placeholder, value: type === 'number'
53
53
  ? value
54
54
  : maxCharacters
55
55
  ? value?.slice(0, maxCharacters - 1) || ''
56
- : value, "$size": size, type: isNumber ? 'number' : 'text', "$sx": inputSx })),
57
- maxCharacters && !isNumber && !placeIconAtTheEnd && (React.createElement(MaxCharactersText, { "$size": size },
56
+ : value, "$size": size, type: type, "$sx": inputSx })),
57
+ maxCharacters && type !== 'number' && !placeIconAtTheEnd && (React.createElement(MaxCharactersText, { "$size": size },
58
58
  value?.length || 0,
59
59
  " / ",
60
60
  maxCharacters)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {