@soul-refiner/design-system 0.2.93 → 0.2.95

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.
@@ -30,7 +30,7 @@ export const Button = ({ as = 'button', children, disabled, fluid = false, href,
30
30
  },
31
31
  };
32
32
  })?.[0];
33
- const dropdownIcon = showChevron ? (isDropdownOpen === true ? (React.createElement(ChevronUp, { size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : isDropdownOpen === false ? (React.createElement(ChevronDown, { size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : undefined) : undefined;
33
+ const dropdownIcon = showChevron ? (isDropdownOpen === true ? (React.createElement(ChevronUp, { sx: "margin-left:auto;", size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : isDropdownOpen === false ? (React.createElement(ChevronDown, { sx: "margin-left:auto;", size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : undefined) : undefined;
34
34
  const padding = !!children
35
35
  ? size === 'large'
36
36
  ? LG_PADDING
@@ -17,6 +17,7 @@ export type Props = {
17
17
  size?: TextInputSize;
18
18
  sx?: string;
19
19
  value: string | string[];
20
+ isNumber?: boolean;
20
21
  };
21
22
  interface DisabledProps extends Props {
22
23
  disabled?: true;
@@ -34,5 +35,5 @@ interface WarningProps extends Props {
34
35
  warning?: true;
35
36
  }
36
37
  export type TextInputProps = DisabledProps | SuccessfulProps | WarningProps;
37
- export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, }: TextInputProps) => React.JSX.Element;
38
+ export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, isNumber, }: TextInputProps) => React.JSX.Element;
38
39
  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, }) => {
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, }) => {
7
7
  const id = React.useId();
8
8
  const isMultiple = multiple;
9
9
  const [multipleValueToAdd, setMultipleValueToAdd] = React.useState('');
@@ -49,10 +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 }))),
52
- !isMultiple && (React.createElement(Input, { disabled: disabled, name: name, onChange: onChange, placeholder: placeholder, value: maxCharacters
53
- ? value.slice(0, maxCharacters - 1)
54
- : value, "$size": size })),
55
- maxCharacters && (React.createElement(MaxCharactersText, { "$size": size },
52
+ !isMultiple && (React.createElement(Input, { disabled: disabled, name: name, onChange: onChange, placeholder: placeholder, value: isNumber
53
+ ? value
54
+ : maxCharacters
55
+ ? value.slice(0, maxCharacters - 1)
56
+ : value, "$size": size, type: isNumber ? 'number' : 'text' })),
57
+ maxCharacters && !isNumber && (React.createElement(MaxCharactersText, { "$size": size },
56
58
  value.length,
57
59
  " / ",
58
60
  maxCharacters)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.93",
3
+ "version": "0.2.95",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {