@umami/react-zen 0.13.0 → 0.14.0

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/dist/index.css CHANGED
@@ -1215,10 +1215,6 @@
1215
1215
  }
1216
1216
 
1217
1217
  /* src/components/TextField.module.css */
1218
- .TextField_textarea {
1219
- font-family: inherit;
1220
- min-height: 60px;
1221
- }
1222
1218
  .TextField_allowCopy {
1223
1219
  padding-right: 32px;
1224
1220
  }
package/dist/index.d.ts CHANGED
@@ -684,8 +684,8 @@ declare module '@umami/react-zen/TextField' {
684
684
  interface TextFieldProps extends AriaTextFieldProps {
685
685
  label?: string;
686
686
  placeholder?: string;
687
- asTextArea?: boolean;
688
687
  allowCopy?: boolean;
688
+ asChild?: boolean;
689
689
  onChange?: (e: any) => void;
690
690
  }
691
691
  const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -697,6 +697,7 @@ declare module '@umami/react-zen/TextArea' {
697
697
  import { TextFieldProps } from '@umami/react-zen/TextField';
698
698
  interface TextAreaProps extends TextFieldProps {
699
699
  resize?: 'none' | 'vertical' | 'horizontal';
700
+ children?: React.ReactNode;
700
701
  }
701
702
  const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<any>>;
702
703
  export { TextArea };
package/dist/index.js CHANGED
@@ -26732,7 +26732,6 @@ var Input_default = {
26732
26732
 
26733
26733
  // src/components/TextField.module.css
26734
26734
  var TextField_default = {
26735
- textarea: "TextField_textarea",
26736
26735
  allowCopy: "TextField_allowCopy",
26737
26736
  icon: "TextField_icon"
26738
26737
  };
@@ -26745,14 +26744,15 @@ var TextField = (0, import_react161.forwardRef)(
26745
26744
  defaultValue,
26746
26745
  label,
26747
26746
  placeholder,
26748
- asTextArea,
26749
26747
  allowCopy,
26748
+ asChild,
26750
26749
  className,
26751
26750
  onChange,
26751
+ children,
26752
26752
  ...props
26753
26753
  }, ref) => {
26754
26754
  const [inputValue, setInputValue] = (0, import_react161.useState)(defaultValue || value);
26755
- const Component = asTextArea ? $216918bed6669f72$export$f5c9f3c2c4054eec : $3985021b0ad6602f$export$f5b8910cec6cf069;
26755
+ const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : $3985021b0ad6602f$export$f5b8910cec6cf069;
26756
26756
  const handleChange = (e) => {
26757
26757
  setInputValue(e.target.value);
26758
26758
  return onChange?.(e);
@@ -26760,6 +26760,7 @@ var TextField = (0, import_react161.forwardRef)(
26760
26760
  (0, import_react161.useEffect)(() => {
26761
26761
  setInputValue(value);
26762
26762
  }, [value]);
26763
+ console.log(asChild && { Component, asChild });
26763
26764
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
26764
26765
  $bcdf0525bf22703d$export$2c73285ae9390cec,
26765
26766
  {
@@ -26773,13 +26774,10 @@ var TextField = (0, import_react161.forwardRef)(
26773
26774
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
26774
26775
  Component,
26775
26776
  {
26776
- className: (0, import_classnames22.default)(
26777
- TextField_default.input,
26778
- Input_default.input,
26779
- asTextArea && TextField_default.textarea,
26780
- allowCopy && TextField_default.allowCopy
26781
- ),
26782
- onChange: handleChange
26777
+ className: (0, import_classnames22.default)(TextField_default.input, Input_default.input, allowCopy && TextField_default.allowCopy),
26778
+ placeholder,
26779
+ onChange: handleChange,
26780
+ children
26783
26781
  }
26784
26782
  ),
26785
26783
  allowCopy && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CopyButton, { className: (0, import_classnames22.default)(TextField_default.icon, Input_default.icon), value: inputValue })
@@ -27627,17 +27625,20 @@ var TextArea_default = {
27627
27625
 
27628
27626
  // src/components/TextArea.tsx
27629
27627
  var import_jsx_runtime52 = require("react/jsx-runtime");
27630
- var TextArea = (0, import_react173.forwardRef)(({ resize, className, ...props }, ref) => {
27631
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
27632
- TextField,
27633
- {
27634
- ...props,
27635
- ref,
27636
- className: (0, import_classnames45.default)(resize && TextArea_default[`resize-${resize}`]),
27637
- asTextArea: true
27638
- }
27639
- );
27640
- });
27628
+ var TextArea = (0, import_react173.forwardRef)(
27629
+ ({ resize, className, children, ...props }, ref) => {
27630
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
27631
+ TextField,
27632
+ {
27633
+ ...props,
27634
+ ref,
27635
+ className: (0, import_classnames45.default)(resize && TextArea_default[`resize-${resize}`]),
27636
+ asChild: true,
27637
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)($216918bed6669f72$export$f5c9f3c2c4054eec, { children })
27638
+ }
27639
+ );
27640
+ }
27641
+ );
27641
27642
 
27642
27643
  // src/components/Toast.tsx
27643
27644
  var import_classnames46 = __toESM(require_classnames());
package/dist/index.mjs CHANGED
@@ -26748,7 +26748,6 @@ var Input_default = {
26748
26748
 
26749
26749
  // src/components/TextField.module.css
26750
26750
  var TextField_default = {
26751
- textarea: "TextField_textarea",
26752
26751
  allowCopy: "TextField_allowCopy",
26753
26752
  icon: "TextField_icon"
26754
26753
  };
@@ -26761,14 +26760,15 @@ var TextField = forwardRef4(
26761
26760
  defaultValue,
26762
26761
  label,
26763
26762
  placeholder,
26764
- asTextArea,
26765
26763
  allowCopy,
26764
+ asChild,
26766
26765
  className,
26767
26766
  onChange,
26767
+ children,
26768
26768
  ...props
26769
26769
  }, ref) => {
26770
26770
  const [inputValue, setInputValue] = useState4(defaultValue || value);
26771
- const Component = asTextArea ? $216918bed6669f72$export$f5c9f3c2c4054eec : $3985021b0ad6602f$export$f5b8910cec6cf069;
26771
+ const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : $3985021b0ad6602f$export$f5b8910cec6cf069;
26772
26772
  const handleChange = (e) => {
26773
26773
  setInputValue(e.target.value);
26774
26774
  return onChange?.(e);
@@ -26776,6 +26776,7 @@ var TextField = forwardRef4(
26776
26776
  useEffect3(() => {
26777
26777
  setInputValue(value);
26778
26778
  }, [value]);
26779
+ console.log(asChild && { Component, asChild });
26779
26780
  return /* @__PURE__ */ jsxs14(
26780
26781
  $bcdf0525bf22703d$export$2c73285ae9390cec,
26781
26782
  {
@@ -26789,13 +26790,10 @@ var TextField = forwardRef4(
26789
26790
  /* @__PURE__ */ jsx27(
26790
26791
  Component,
26791
26792
  {
26792
- className: (0, import_classnames22.default)(
26793
- TextField_default.input,
26794
- Input_default.input,
26795
- asTextArea && TextField_default.textarea,
26796
- allowCopy && TextField_default.allowCopy
26797
- ),
26798
- onChange: handleChange
26793
+ className: (0, import_classnames22.default)(TextField_default.input, Input_default.input, allowCopy && TextField_default.allowCopy),
26794
+ placeholder,
26795
+ onChange: handleChange,
26796
+ children
26799
26797
  }
26800
26798
  ),
26801
26799
  allowCopy && /* @__PURE__ */ jsx27(CopyButton, { className: (0, import_classnames22.default)(TextField_default.icon, Input_default.icon), value: inputValue })
@@ -27643,17 +27641,20 @@ var TextArea_default = {
27643
27641
 
27644
27642
  // src/components/TextArea.tsx
27645
27643
  import { jsx as jsx52 } from "react/jsx-runtime";
27646
- var TextArea = forwardRef11(({ resize, className, ...props }, ref) => {
27647
- return /* @__PURE__ */ jsx52(
27648
- TextField,
27649
- {
27650
- ...props,
27651
- ref,
27652
- className: (0, import_classnames45.default)(resize && TextArea_default[`resize-${resize}`]),
27653
- asTextArea: true
27654
- }
27655
- );
27656
- });
27644
+ var TextArea = forwardRef11(
27645
+ ({ resize, className, children, ...props }, ref) => {
27646
+ return /* @__PURE__ */ jsx52(
27647
+ TextField,
27648
+ {
27649
+ ...props,
27650
+ ref,
27651
+ className: (0, import_classnames45.default)(resize && TextArea_default[`resize-${resize}`]),
27652
+ asChild: true,
27653
+ children: /* @__PURE__ */ jsx52($216918bed6669f72$export$f5c9f3c2c4054eec, { children })
27654
+ }
27655
+ );
27656
+ }
27657
+ );
27657
27658
 
27658
27659
  // src/components/Toast.tsx
27659
27660
  var import_classnames46 = __toESM(require_classnames());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "React components built by Umami",
5
5
  "author": "Umami <hello@umami.is>",
6
6
  "license": "MIT",
@@ -132,7 +132,7 @@
132
132
  "rollup-plugin-postcss": "^4.0.2",
133
133
  "stylelint": "^16.7.0",
134
134
  "stylelint-config-prettier": "^9.0.5",
135
- "tsup": "^8.3.0",
135
+ "stylelint-config-recommended": "^14.0.1",
136
136
  "typescript": "^5.6.3"
137
137
  }
138
138
  }