@soul-refiner/design-system 0.2.104 → 0.2.105

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.
@@ -19,6 +19,7 @@ export type Props = {
19
19
  value: string | string[];
20
20
  isNumber?: boolean;
21
21
  placeIconAtTheEnd?: boolean;
22
+ inputSx?: string;
22
23
  };
23
24
  interface DisabledProps extends Props {
24
25
  disabled?: true;
@@ -36,5 +37,5 @@ interface WarningProps extends Props {
36
37
  warning?: true;
37
38
  }
38
39
  export type TextInputProps = DisabledProps | SuccessfulProps | WarningProps;
39
- export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, isNumber, placeIconAtTheEnd, }: 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, isNumber, placeIconAtTheEnd, inputSx, }: TextInputProps) => React.JSX.Element;
40
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, }) => {
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, }) => {
7
7
  const id = React.useId();
8
8
  const isMultiple = multiple;
9
9
  const [multipleValueToAdd, setMultipleValueToAdd] = React.useState('');
@@ -48,12 +48,12 @@ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, i
48
48
  !placeIconAtTheEnd && icon,
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
- React.createElement(Input, { onChange: handleMultipleValueToAdd, onKeyDown: handleMultipleValueDelete, value: multipleValueToAdd, "$size": size }))),
51
+ React.createElement(Input, { onChange: handleMultipleValueToAdd, onKeyDown: handleMultipleValueDelete, value: multipleValueToAdd, "$size": size, "$sx": inputSx }))),
52
52
  !isMultiple && (React.createElement(Input, { disabled: disabled, name: name, onChange: onChange, placeholder: placeholder, value: isNumber
53
53
  ? value
54
54
  : maxCharacters
55
55
  ? value.slice(0, maxCharacters - 1)
56
- : value, "$size": size, type: isNumber ? 'number' : 'text' })),
56
+ : value, "$size": size, type: isNumber ? 'number' : 'text', "$sx": inputSx })),
57
57
  maxCharacters && !isNumber && !placeIconAtTheEnd && (React.createElement(MaxCharactersText, { "$size": size },
58
58
  value.length,
59
59
  " / ",
@@ -123,6 +123,8 @@ const Input = styled.input `
123
123
  &::placeholder {
124
124
  color: var(--color-grey-6);
125
125
  }
126
+
127
+ ${({ $sx }) => ($sx ? $sx : '')}
126
128
  `;
127
129
  const HelperText = styled.span `
128
130
  color: var(--color-grey-4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.104",
3
+ "version": "0.2.105",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {