@jamsrui/textarea 0.0.13 → 0.0.14

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.
@@ -0,0 +1 @@
1
+ import{a as t,b as x}from"./chunk-YP53ICJD.mjs";import{useCallback as P,useMemo as V}from"react";import{useControlledState as d}from"@jamsrui/hooks";import{useInputGroupContextOpt as T}from"@jamsrui/input-group";import{cn as h,mapPropsVariants as y}from"@jamsrui/utils";import{useFieldA11yContext as G}from"@jamsrui/context";var b=c=>{let[f,a]=y(c,t.variantKeys),r=T(),o=G(),{value:g,defaultValue:C,onValueChange:v,className:s,...n}=f,[p="",u]=d({defaultProp:C,onChange:v,prop:g}),l=r?x({...r.variantProps,...a}):t(a),i=P(e=>{u(e.target.value)},[u]),m=P(e=>({...o?.getInputProps(),...n,...e,className:h(l,s),value:p,onChange:i}),[o,n,l,s,p,i]);return V(()=>({getTextareaProps:m}),[m])};export{b as a};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-5QY2R22I.mjs";import{jsx as t}from"react/jsx-runtime";var x=r=>{let{getTextareaProps:a}=e(r);return t("textarea",{...a({})})};export{x as a};
@@ -0,0 +1 @@
1
+ import{radiusBaseVariant as r,tv as e}from"@jamsrui/utils";var t=e({base:["textarea focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 placeholder:text-foreground-secondary bg-transparent font-normal"],variants:{variant:{bordered:"border border-divider hover:border-divider-light focus:border-focus",solid:"bg-surface hover:bg-surface/90"},size:{sm:"textarea--sm px-3 py-1.5 text-sm placeholder:text-sm",md:"textarea--md px-3 py-2 text-sm placeholder:text-sm",lg:"textarea--lg px-3 py-2 text-base placeholder:text-base"},radius:r,isInvalid:{true:"border-danger!"}},defaultVariants:{radius:"md",size:"md",variant:"bordered"}}),o=e({base:"textarea-group__textarea w-full px-3 py-2 text-sm placeholder:text-sm focus:outline-none",variants:{variant:{bordered:"border border-divider focus:border-focus",solid:"bg-surface hover:bg-surface/90"}}});export{t as a,o as b};
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { Textarea } from './textarea.mjs';
2
- export { TextareaConfig, useTextareaConfig } from './textarea-config.mjs';
3
2
  import 'react/jsx-runtime';
3
+ import './use-textarea.mjs';
4
4
  import '@jamsrui/utils';
5
- import '@jamsrui/core';
5
+ import './styles.mjs';
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a as r,b as a}from"./chunk-NYATKGAI.mjs";import{a as e}from"./chunk-OFLUCZWX.mjs";export{e as Textarea,r as TextareaConfig,a as useTextareaConfig};
1
+ "use client";import{a as e}from"./chunk-ADM6W5SQ.mjs";import"./chunk-5QY2R22I.mjs";import"./chunk-YP53ICJD.mjs";export{e as Textarea};
package/dist/styles.d.mts CHANGED
@@ -1,2 +1,92 @@
1
+ import * as _jamsrui_utils from '@jamsrui/utils';
2
+ import { VariantProps } from '@jamsrui/utils';
1
3
 
2
- export { }
4
+ declare const textareaVariants: _jamsrui_utils.TVReturnType<{
5
+ variant: {
6
+ bordered: string;
7
+ solid: string;
8
+ };
9
+ size: {
10
+ sm: string;
11
+ md: string;
12
+ lg: string;
13
+ };
14
+ radius: {
15
+ readonly sm: "rounded";
16
+ readonly md: "rounded-md";
17
+ readonly lg: "rounded-lg";
18
+ readonly xl: "rounded-xl";
19
+ readonly "2xl": "rounded-2xl";
20
+ readonly "3xl": "rounded-3xl";
21
+ readonly full: "rounded-full";
22
+ readonly none: "rounded-none";
23
+ };
24
+ isInvalid: {
25
+ true: string;
26
+ };
27
+ }, undefined, string[], {
28
+ variant: {
29
+ bordered: string;
30
+ solid: string;
31
+ };
32
+ size: {
33
+ sm: string;
34
+ md: string;
35
+ lg: string;
36
+ };
37
+ radius: {
38
+ readonly sm: "rounded";
39
+ readonly md: "rounded-md";
40
+ readonly lg: "rounded-lg";
41
+ readonly xl: "rounded-xl";
42
+ readonly "2xl": "rounded-2xl";
43
+ readonly "3xl": "rounded-3xl";
44
+ readonly full: "rounded-full";
45
+ readonly none: "rounded-none";
46
+ };
47
+ isInvalid: {
48
+ true: string;
49
+ };
50
+ }, undefined, _jamsrui_utils.TVReturnType<{
51
+ variant: {
52
+ bordered: string;
53
+ solid: string;
54
+ };
55
+ size: {
56
+ sm: string;
57
+ md: string;
58
+ lg: string;
59
+ };
60
+ radius: {
61
+ readonly sm: "rounded";
62
+ readonly md: "rounded-md";
63
+ readonly lg: "rounded-lg";
64
+ readonly xl: "rounded-xl";
65
+ readonly "2xl": "rounded-2xl";
66
+ readonly "3xl": "rounded-3xl";
67
+ readonly full: "rounded-full";
68
+ readonly none: "rounded-none";
69
+ };
70
+ isInvalid: {
71
+ true: string;
72
+ };
73
+ }, undefined, string[], unknown, unknown, undefined>>;
74
+ declare const textareaGroupVariants: _jamsrui_utils.TVReturnType<{
75
+ variant: {
76
+ bordered: string;
77
+ solid: string;
78
+ };
79
+ }, undefined, "textarea-group__textarea w-full px-3 py-2 text-sm placeholder:text-sm focus:outline-none", {
80
+ variant: {
81
+ bordered: string;
82
+ solid: string;
83
+ };
84
+ }, undefined, _jamsrui_utils.TVReturnType<{
85
+ variant: {
86
+ bordered: string;
87
+ solid: string;
88
+ };
89
+ }, undefined, "textarea-group__textarea w-full px-3 py-2 text-sm placeholder:text-sm focus:outline-none", unknown, unknown, undefined>>;
90
+ type TextareaVariantProps = VariantProps<typeof textareaVariants>;
91
+
92
+ export { type TextareaVariantProps, textareaGroupVariants, textareaVariants };
package/dist/styles.mjs CHANGED
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-YP53ICJD.mjs";export{b as textareaGroupVariants,a as textareaVariants};
@@ -1,9 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { UIProps } from '@jamsrui/utils';
2
+ import { useTextarea } from './use-textarea.mjs';
3
+ import '@jamsrui/utils';
4
+ import './styles.mjs';
3
5
 
4
6
  declare const Textarea: (props: Textarea.Props) => react_jsx_runtime.JSX.Element;
5
7
  declare namespace Textarea {
6
- interface Props extends UIProps<"textarea"> {
8
+ interface Props extends useTextarea.Props {
7
9
  }
8
10
  }
9
11
 
package/dist/textarea.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-OFLUCZWX.mjs";export{a as Textarea};
1
+ import{a}from"./chunk-ADM6W5SQ.mjs";import"./chunk-5QY2R22I.mjs";import"./chunk-YP53ICJD.mjs";export{a as Textarea};
@@ -1,6 +1,14 @@
1
- declare const useTextarea: (props: useTextarea.Props) => void;
1
+ import { PropGetter, UIProps } from '@jamsrui/utils';
2
+ import { TextareaVariantProps } from './styles.mjs';
3
+
4
+ declare const useTextarea: (props: useTextarea.Props) => {
5
+ getTextareaProps: PropGetter<UIProps<"textarea">>;
6
+ };
2
7
  declare namespace useTextarea {
3
- interface Props {
8
+ interface Props extends UIProps<"textarea">, TextareaVariantProps {
9
+ value?: string;
10
+ defaultValue?: string;
11
+ onValueChange?: (value: string) => void;
4
12
  }
5
13
  }
6
14
 
@@ -1 +1 @@
1
- var r=e=>{};export{r as useTextarea};
1
+ import{a}from"./chunk-5QY2R22I.mjs";import"./chunk-YP53ICJD.mjs";export{a as useTextarea};
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@jamsrui/textarea",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
- "@jamsrui/hooks": "^0.0.12",
9
- "@jamsrui/utils": "^0.0.12",
10
- "@jamsrui/core": "^0.0.10",
11
- "@jamsrui/input": "^0.0.13"
8
+ "@jamsrui/context": "^0.0.2",
9
+ "@jamsrui/textfield": "^0.0.2",
10
+ "@jamsrui/core": "^0.0.11",
11
+ "@jamsrui/utils": "^0.0.13",
12
+ "@jamsrui/hooks": "^0.0.13",
13
+ "@jamsrui/input-group": "^0.0.2"
12
14
  },
13
15
  "exports": {
14
16
  ".": {
@@ -1 +0,0 @@
1
- import{createConfigContext as e}from"@jamsrui/utils";var[o,a]=e({displayName:"TextareaContext"});export{o as a,a as b};
@@ -1 +0,0 @@
1
- import{jsx as r}from"react/jsx-runtime";var t=e=>r("textarea",{...e});export{t as a};
@@ -1,15 +0,0 @@
1
- import { Textarea } from './textarea.mjs';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { WithGlobalConfig } from '@jamsrui/core';
4
- import '@jamsrui/utils';
5
-
6
- declare const useTextareaConfig: () => Record<string, any>;
7
- declare const TextareaConfig: (props: Omit<Partial<Record<string, any>>, "children"> & {
8
- merge?: boolean;
9
- children: React.ReactNode;
10
- }) => react_jsx_runtime.JSX.Element;
11
- declare namespace TextareaConfig {
12
- type Props = WithGlobalConfig<Textarea.Props>;
13
- }
14
-
15
- export { TextareaConfig, useTextareaConfig };
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-NYATKGAI.mjs";export{a as TextareaConfig,b as useTextareaConfig};