@cladd-ui/react 0.0.52 → 0.0.54

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.54 (2026-05-12)
4
+
5
+ ### Features
6
+
7
+ - readOnly and disabled for SearchField (0e1d77f)
8
+
9
+ ## 0.0.53 (2026-05-12)
10
+
11
+ ### Bug Fixes
12
+
13
+ - NumberField to hold its width (3152741)
14
+
3
15
  ## 0.0.52 (2026-05-12)
4
16
 
5
17
  ### Bug Fixes
@@ -67,6 +67,6 @@ export const NumberField = (props) => {
67
67
  cancelDraft();
68
68
  inputElRef.current?.blur();
69
69
  }
70
- } })) : (_jsx(SurfaceCut, { "data-part": "control", className: cn('w-auto min-w-9 self-stretch text-center', itemRoundedClasses), contentClassName: cn('flex items-center justify-center text-cladd-xs', inputPaddingNoIcon[size]), children: value })), _jsx(Button, { "data-part": "increase", size: size, color: color, variant: buttonVariantComputed, outline: buttonOutline, rounded: rounded, readOnly: readOnly, disabled: value >= max || disabled, onClick: increase, className: cn(size === 'xl' && 'min-w-11', size === '2xl' && 'min-w-13'), children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", children: _jsxs("g", { fill: "currentColor", children: [_jsx("path", { d: "M14.75,9.75H3.25c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75H14.75c.414,0,.75,.336,.75,.75s-.336,.75-.75,.75Z" }), _jsx("path", { d: "M9,15.5c-.414,0-.75-.336-.75-.75V3.25c0-.414,.336-.75,.75-.75s.75,.336,.75,.75V14.75c0,.414-.336,.75-.75,.75Z" })] }) }) })] }));
70
+ } })) : (_jsx(SurfaceCut, { "data-part": "control", className: cn('w-full min-w-9 self-stretch text-center', itemRoundedClasses), contentClassName: cn('flex items-center justify-center text-cladd-xs', inputPaddingNoIcon[size]), children: value })), _jsx(Button, { "data-part": "increase", size: size, color: color, variant: buttonVariantComputed, outline: buttonOutline, rounded: rounded, readOnly: readOnly, disabled: value >= max || disabled, onClick: increase, className: cn(size === 'xl' && 'min-w-11', size === '2xl' && 'min-w-13'), children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", children: _jsxs("g", { fill: "currentColor", children: [_jsx("path", { d: "M14.75,9.75H3.25c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75H14.75c.414,0,.75,.336,.75,.75s-.336,.75-.75,.75Z" }), _jsx("path", { d: "M9,15.5c-.414,0-.75-.336-.75-.75V3.25c0-.414,.336-.75,.75-.75s.75,.336,.75,.75V14.75c0,.414-.336,.75-.75,.75Z" })] }) }) })] }));
71
71
  };
72
72
  //# sourceMappingURL=NumberField.js.map
@@ -16,6 +16,10 @@ interface SearchFieldOwnProps {
16
16
  size?: InputSize;
17
17
  /** Default `'Search'`. */
18
18
  placeholder?: string;
19
+ /** Make the input non-editable but still focusable for value display/copying. */
20
+ readOnly?: boolean;
21
+ /** Disable the input. */
22
+ disabled?: boolean;
19
23
  /** Extra classes for the search field `Surface`. */
20
24
  className?: string;
21
25
  /** Fires on every keystroke. Also fires with `''` when the clear button is pressed. */
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../../../src/components/SearchField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAS,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAW,YAAY,EAAE,MAAM,WAAW,CAAC;AAElD,UAAU,mBAAmB;IAC3B,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0BAA0B;IAC1B,WAAW,CAAC,E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,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAChD,IAAI,CAAC,YAAY,EAAE,MAAM,mBAAmB,CAAC,CAAC;AAEhD,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CA0DlD,CAAC"}
@@ -4,7 +4,7 @@ import { SearchIcon } from './icons/SearchIcon.js';
4
4
  import { Input } from './Input.js';
5
5
  import { Surface } from './Surface.js';
6
6
  export const SearchField = (props) => {
7
- const { value = '', inset = false, size = 'md', placeholder = 'Search', className = '', onChange = () => { }, ref, ...rest } = props;
8
- return (_jsx(Surface, { level: inset ? '+0' : '+1', className: cn('cladd-search-field sticky z-20', !inset && 'top-0 ml-px rounded-t-cladd-popover', inset && 'top-2 mx-2 w-auto rounded-full', className), outline: !inset, ref: ref, ...rest, children: _jsxs("div", { "data-part": "wrapper", className: cn('flex items-center', !inset && 'p-1.5'), children: [_jsx(Input, { className: "w-full", placeholder: placeholder, onChange: (v, e) => onChange(v, e), contentClassName: "pl-6.5", value: value, clearButton: true, rounded: true, size: size, onClear: () => onChange('') }), _jsx(SearchIcon, { "data-part": "icon", className: cn('pointer-events-none absolute top-1/2 left-2 size-4 -translate-y-1/2 text-cladd-fg-softer', inset ? 'left-2' : 'left-4') })] }) }));
7
+ const { value = '', inset = false, size = 'md', placeholder = 'Search', className = '', readOnly = false, disabled = false, onChange = () => { }, ref, ...rest } = props;
8
+ return (_jsx(Surface, { "data-disabled": disabled || undefined, "data-readonly": readOnly || undefined, level: inset ? '+0' : '+1', className: cn('cladd-search-field sticky z-20', !inset && 'top-0 ml-px rounded-t-cladd-popover', inset && 'top-2 mx-2 w-auto rounded-full', className), outline: !inset, ref: ref, ...rest, children: _jsxs("div", { "data-part": "wrapper", className: cn('flex items-center', !inset && 'p-1.5'), children: [_jsx(Input, { className: "w-full", placeholder: placeholder, onChange: (v, e) => onChange(v, e), contentClassName: "pl-6.5", value: value, clearButton: true, rounded: true, size: size, readOnly: readOnly, disabled: disabled, onClear: () => onChange('') }), _jsx(SearchIcon, { "data-part": "icon", className: cn('pointer-events-none absolute top-1/2 left-2 size-4 -translate-y-1/2 text-cladd-fg-softer', inset ? 'left-2' : 'left-4') })] }) }));
9
9
  };
10
10
  //# sourceMappingURL=SearchField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.js","sourceRoot":"","sources":["../../../src/components/SearchField.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AA4BlD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACrD,MAAM,EACJ,KAAK,GAAG,EAAE,EACV,KAAK,GAAG,KAAK,EACb,IAAI,GAAG,IAAI,EACX,WAAW,GAAG,QAAQ,EACtB,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,GAAG,EACH,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,KAAC,OAAO,IACN,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAC1B,SAAS,EAAE,EAAE,CACX,gCAAgC,EAChC,CAAC,KAAK,IAAI,qCAAqC,EAC/C,KAAK,IAAI,gCAAgC,EACzC,SAAS,CACV,EACD,OAAO,EAAE,CAAC,KAAK,EACf,GAAG,EAAE,GAAG,KACJ,IAAI,YAER,4BACY,SAAS,EACnB,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,IAAI,OAAO,CAAC,aAErD,KAAC,KAAK,IACJ,SAAS,EAAC,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,CAAS,EAAE,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AI,qCAAqC,EAC/C,KAAK,IAAI,gCAAgC,EACzC,SAAS,CACV,EACD,OAAO,EAAE,CAAC,KAAK,EACf,GAAG,EAAE,GAAG,KACJ,IAAI,YAER,4BACY,SAAS,EACnB,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,IAAI,OAAO,CAAC,aAErD,KAAC,KAAK,IACJ,SAAS,EAAC,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,CAAS,EAAE,CAAgC,EAAE,EAAE,CACxD,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAEhB,gBAAgB,EAAC,QAAQ,EACzB,KAAK,EAAE,KAAK,EACZ,WAAW,QACX,OAAO,QACP,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAC3B,EACF,KAAC,UAAU,iBACC,MAAM,EAChB,SAAS,EAAE,EAAE,CACX,0FAA0F,EAC1F,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAC5B,GACD,IACE,GACE,CACX,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cladd-ui/react",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "description": "",
5
5
  "homepage": "https://cladd.io",
6
6
  "bugs": {