@platformatic/ui-components 0.15.3 → 0.15.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@platformatic/ui-components",
3
3
  "description": "Platformatic UI Components",
4
- "version": "0.15.3",
4
+ "version": "0.15.4",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -14,12 +14,13 @@ function SearchBarV2 ({
14
14
  dataAttrName = '',
15
15
  dataAttrValue = '',
16
16
  inputTextClassName = '',
17
- paddingClass = ''
17
+ paddingClass = '',
18
+ disabled = false
18
19
  }) {
19
20
  const inputRef = useRef()
20
21
  const baseClassName = `${styles.container} ${paddingClass || styles.defaultPaddingClass} ` + commonStyles[`background-color-${backgroundColor}`]
21
22
  const [wrapperClassName, setWrapperClassName] = useState(normalClassName())
22
- const inputClassName = `${styles.input} ${inputTextClassName} `
23
+ const inputClassName = `${styles.input} ${inputTextClassName} ${disabled ? styles.disabled : ''} `
23
24
  const [isOnFocus, setIsOnFocus] = useState(false)
24
25
  const [showClear, setShowClear] = useState(false)
25
26
  const dataProps = {}
@@ -70,7 +71,16 @@ function SearchBarV2 ({
70
71
  return (
71
72
  <div className={wrapperClassName} {...dataProps}>
72
73
  <PlatformaticIcon iconName='LensIcon' color={color} disabled={!isOnFocus} size={SMALL} onClick={handleSearch} />
73
- <input type='text' placeholder={placeholder} className={inputClassName} ref={inputRef} onChange={handleChange} onFocus={onFocus} onBlur={onBlur} />
74
+ <input
75
+ type='text'
76
+ placeholder={placeholder}
77
+ className={inputClassName}
78
+ ref={inputRef}
79
+ onChange={handleChange}
80
+ onFocus={onFocus}
81
+ onBlur={onBlur}
82
+ disabled={disabled}
83
+ />
74
84
  {showClear && (
75
85
  <div className={styles.clearContainer}>
76
86
  <PlatformaticIcon iconName='CircleCloseIcon' color={color} size={SMALL} onClick={handleClear} />
@@ -28,3 +28,6 @@
28
28
  @apply px-2 py-1.5 md:px-3 md:py-[8.5px];
29
29
  }
30
30
 
31
+ .disabled::placeholder {
32
+ @apply text-white/30;
33
+ }
@@ -11,7 +11,6 @@ const Template = (args) => {
11
11
  )
12
12
  }
13
13
  export const Standard = Template.bind({})
14
-
15
14
  Standard.args = {
16
15
  onChange: (value) => {
17
16
  console.log('Current search: ' + value)
@@ -20,3 +19,9 @@ Standard.args = {
20
19
  alert('Query value: ' + value)
21
20
  }
22
21
  }
22
+
23
+ export const Disabled = Template.bind({})
24
+ Disabled.args = {
25
+ disabled: true,
26
+ placeholder: 'Disabled'
27
+ }