@manafishrov/ui 1.3.3 → 1.3.5

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.
Files changed (59) hide show
  1. package/dist/components/form/AutoSubmit.js +9 -9
  2. package/dist/components/form/AutoSubmit.js.map +1 -1
  3. package/dist/components/form/ComboboxField.d.ts +2 -1
  4. package/dist/components/form/ComboboxField.js +55 -47
  5. package/dist/components/form/ComboboxField.js.map +1 -1
  6. package/dist/components/form/DatePickerField.d.ts +2 -1
  7. package/dist/components/form/DatePickerField.js +36 -28
  8. package/dist/components/form/DatePickerField.js.map +1 -1
  9. package/dist/components/form/Form.js +37 -37
  10. package/dist/components/form/Form.js.map +1 -1
  11. package/dist/components/form/NumberInputField.d.ts +2 -1
  12. package/dist/components/form/NumberInputField.js +63 -55
  13. package/dist/components/form/NumberInputField.js.map +1 -1
  14. package/dist/components/form/PasswordInputField.d.ts +2 -1
  15. package/dist/components/form/PasswordInputField.js +72 -60
  16. package/dist/components/form/PasswordInputField.js.map +1 -1
  17. package/dist/components/form/PinInputField.d.ts +2 -1
  18. package/dist/components/form/PinInputField.js +48 -40
  19. package/dist/components/form/PinInputField.js.map +1 -1
  20. package/dist/components/form/RadioGroupField.d.ts +2 -1
  21. package/dist/components/form/RadioGroupField.js +50 -34
  22. package/dist/components/form/RadioGroupField.js.map +1 -1
  23. package/dist/components/form/SelectField.d.ts +2 -1
  24. package/dist/components/form/SelectField.js +43 -35
  25. package/dist/components/form/SelectField.js.map +1 -1
  26. package/dist/components/form/SliderField.d.ts +2 -1
  27. package/dist/components/form/SliderField.js +42 -34
  28. package/dist/components/form/SliderField.js.map +1 -1
  29. package/dist/components/form/TagsInputField.d.ts +2 -1
  30. package/dist/components/form/TagsInputField.js +45 -37
  31. package/dist/components/form/TagsInputField.js.map +1 -1
  32. package/dist/components/form/TextInputField.d.ts +2 -1
  33. package/dist/components/form/TextInputField.js +38 -30
  34. package/dist/components/form/TextInputField.js.map +1 -1
  35. package/dist/components/form/TextareaField.d.ts +2 -1
  36. package/dist/components/form/TextareaField.js +36 -28
  37. package/dist/components/form/TextareaField.js.map +1 -1
  38. package/dist/components/form/WithTrailingAddon.d.ts +6 -0
  39. package/dist/components/form/WithTrailingAddon.js +18 -0
  40. package/dist/components/form/WithTrailingAddon.js.map +1 -0
  41. package/dist/components/form/index.d.ts +2 -0
  42. package/dist/components/form/index.js +42 -40
  43. package/dist/components/form/index.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/components/form/AutoSubmit.tsx +6 -11
  46. package/src/components/form/ComboboxField.tsx +27 -22
  47. package/src/components/form/DatePickerField.tsx +25 -20
  48. package/src/components/form/Form.tsx +3 -2
  49. package/src/components/form/NumberInputField.tsx +25 -20
  50. package/src/components/form/PasswordInputField.tsx +53 -33
  51. package/src/components/form/PinInputField.tsx +24 -19
  52. package/src/components/form/RadioGroupField.tsx +32 -17
  53. package/src/components/form/SelectField.tsx +21 -16
  54. package/src/components/form/SliderField.tsx +24 -19
  55. package/src/components/form/TagsInputField.tsx +26 -21
  56. package/src/components/form/TextInputField.tsx +18 -13
  57. package/src/components/form/TextareaField.tsx +18 -13
  58. package/src/components/form/WithTrailingAddon.tsx +15 -0
  59. package/src/components/form/index.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInputField.js","sources":["../../../src/components/form/TagsInputField.tsx"],"sourcesContent":["import { type Component, type ComponentProps, splitProps, For } from 'solid-js';\n\nimport { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';\nimport {\n TagsInput,\n TagsInputClearTrigger,\n TagsInputContext,\n TagsInputControl,\n TagsInputHiddenInput,\n TagsInputInput,\n TagsInputItemInput,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n} from '@/components/TagsInput';\n\nimport { useFieldContext } from './context';\n\nconst TAGS_INPUT_ROOT_PROPS = [\n 'max',\n 'maxLength',\n 'delimiter',\n 'addOnPaste',\n 'blurBehavior',\n 'validate',\n 'autoFocus',\n 'editable',\n 'allowOverflow',\n 'translations',\n 'ids',\n 'onFocusOutside',\n 'onHighlightChange',\n 'onInputValueChange',\n 'onInteractOutside',\n 'onPointerDownOutside',\n 'onValueInvalid',\n] as const;\n\nexport type TagsInputFieldProps = ComponentProps<typeof TagsInputInput> &\n Pick<ComponentProps<typeof TagsInput>, (typeof TAGS_INPUT_ROOT_PROPS)[number]> & {\n label?: string;\n description?: string;\n showClearTrigger?: boolean;\n };\n\nconst TagsInputGroup: Component<\n { showClearTrigger?: boolean } & ComponentProps<typeof TagsInputInput>\n> = (props) => {\n const [local, others] = splitProps(props, ['children', 'showClearTrigger']);\n\n return (\n <>\n <TagsInputContext>\n {(context) => (\n <TagsInputControl>\n <For each={context().value}>\n {(value, index) => (\n <TagsInputItem index={index()} value={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger />\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n )}\n </For>\n <TagsInputInput {...others} />\n <Show when={local.showClearTrigger !== false}>\n <TagsInputClearTrigger />\n </Show>\n {local.children}\n </TagsInputControl>\n )}\n </TagsInputContext>\n <TagsInputHiddenInput />\n </>\n );\n};\n\nconst TAGS_INPUT_FIELD_PROPS = [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'showClearTrigger',\n] as const;\n\nexport const TagsInputField: Component<TagsInputFieldProps> = (props) => {\n const field = useFieldContext<string[]>();\n const [local, others] = splitProps(props, TAGS_INPUT_FIELD_PROPS);\n const [rootProps, inputProps] = splitProps(others, TAGS_INPUT_ROOT_PROPS);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <TagsInput\n value={field().state.value}\n onValueChange={(details) => {\n field().handleChange(details.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n {...rootProps}\n >\n <TagsInputGroup\n {...inputProps}\n {...(typeof local.showClearTrigger === 'boolean' && {\n showClearTrigger: local.showClearTrigger,\n })}\n />\n </TagsInput>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TAGS_INPUT_ROOT_PROPS","TagsInputGroup","props","local","others","splitProps","_$createComponent","TagsInputContext","children","context","TagsInputControl","For","each","value","index","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","TagsInputItemInput","TagsInputInput","_$Show","when","showClearTrigger","TagsInputClearTrigger","_$memo","TagsInputHiddenInput","TAGS_INPUT_FIELD_PROPS","TagsInputField","field","useFieldContext","rootProps","inputProps","Field","invalid","state","meta","errors","length","disabled","readOnly","required","FieldLabel","label","FieldContent","TagsInput","_$mergeProps","onValueChange","details","handleChange","onBlur","handleBlur","FieldError","FieldDescription","description"],"mappings":";;;;;AAmBA,MAAMA,IAAwB,CAC5B,OACA,aACA,aACA,cACA,gBACA,YACA,aACA,YACA,iBACA,gBACA,OACA,kBACA,qBACA,sBACA,qBACA,wBACA,gBAAgB,GAUZC,IAEDC,CAAAA,MAAU;AACb,QAAM,CAACC,GAAOC,CAAM,IAAIC,EAAWH,GAAO,CAAC,YAAY,kBAAkB,CAAC;AAE1E,SAAA,CAAAI,EAEKC,GAAgB;AAAA,IAAAC,UACbC,CAAAA,MAAOH,EACNI,GAAgB;AAAA,MAAA,IAAAF,WAAA;AAAA,eAAA,CAAAF,EACdK,GAAG;AAAA,UAAA,IAACC,OAAI;AAAA,mBAAEH,IAAUI;AAAAA,UAAK;AAAA,UAAAL,UACvBA,CAACK,GAAOC,MAAKR,EACXS,GAAa;AAAA,YAAA,IAACD,QAAK;AAAA,qBAAEA,EAAAA;AAAAA,YAAO;A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AAA,EAAA,CAAA;AAI5C;"}
1
+ {"version":3,"file":"TagsInputField.js","sources":["../../../src/components/form/TagsInputField.tsx"],"sourcesContent":["import type { Component, ComponentProps, JSXElement } from 'solid-js';\n\nimport { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';\nimport {\n TagsInput,\n TagsInputClearTrigger,\n TagsInputContext,\n TagsInputControl,\n TagsInputHiddenInput,\n TagsInputInput,\n TagsInputItemInput,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n} from '@/components/TagsInput';\n\nimport { useFieldContext } from './context';\nimport { WithTrailingAddon } from './WithTrailingAddon';\n\nconst TAGS_INPUT_ROOT_PROPS = [\n 'max',\n 'maxLength',\n 'delimiter',\n 'addOnPaste',\n 'blurBehavior',\n 'validate',\n 'autoFocus',\n 'editable',\n 'allowOverflow',\n 'translations',\n 'ids',\n 'onFocusOutside',\n 'onHighlightChange',\n 'onInputValueChange',\n 'onInteractOutside',\n 'onPointerDownOutside',\n 'onValueInvalid',\n] as const;\n\nexport type TagsInputFieldProps = ComponentProps<typeof TagsInputInput> &\n Pick<ComponentProps<typeof TagsInput>, (typeof TAGS_INPUT_ROOT_PROPS)[number]> & {\n label?: string;\n description?: string;\n showClearTrigger?: boolean;\n trailingAddon?: JSXElement;\n };\n\nconst TagsInputGroup: Component<\n { showClearTrigger?: boolean } & ComponentProps<typeof TagsInputInput>\n> = (props) => {\n const [local, others] = splitProps(props, ['children', 'showClearTrigger']);\n\n return (\n <>\n <TagsInputContext>\n {(context) => (\n <TagsInputControl>\n <For each={context().value}>\n {(value, index) => (\n <TagsInputItem index={index()} value={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger />\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n )}\n </For>\n <TagsInputInput {...others} />\n <Show when={local.showClearTrigger !== false}>\n <TagsInputClearTrigger />\n </Show>\n {local.children}\n </TagsInputControl>\n )}\n </TagsInputContext>\n <TagsInputHiddenInput />\n </>\n );\n};\n\nconst TAGS_INPUT_FIELD_PROPS = [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'showClearTrigger',\n 'trailingAddon',\n] as const;\n\nexport const TagsInputField: Component<TagsInputFieldProps> = (props) => {\n const field = useFieldContext<string[]>();\n const [local, others] = splitProps(props, TAGS_INPUT_FIELD_PROPS);\n const [rootProps, inputProps] = splitProps(others, TAGS_INPUT_ROOT_PROPS);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <WithTrailingAddon addon={local.trailingAddon}>\n <TagsInput\n value={field().state.value}\n onValueChange={(details) => {\n field().handleChange(details.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n {...rootProps}\n >\n <TagsInputGroup\n {...inputProps}\n {...(typeof local.showClearTrigger === 'boolean' && {\n showClearTrigger: local.showClearTrigger,\n })}\n />\n </TagsInput>\n </WithTrailingAddon>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TAGS_INPUT_ROOT_PROPS","TagsInputGroup","props","local","others","splitProps","_$createComponent","TagsInputContext","children","context","TagsInputControl","_$For","each","value","index","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","TagsInputItemInput","TagsInputInput","_$Show","when","showClearTrigger","TagsInputClearTrigger","_$memo","TagsInputHiddenInput","TAGS_INPUT_FIELD_PROPS","TagsInputField","field","useFieldContext","rootProps","inputProps","Field","invalid","state","meta","errors","length","disabled","readOnly","required","FieldLabel","label","FieldContent","WithTrailingAddon","addon","trailingAddon","TagsInput","_$mergeProps","onValueChange","details","handleChange","onBlur","handleBlur","FieldError","FieldDescription","description"],"mappings":";;;;;;AAoBA,MAAMA,IAAwB,CAC5B,OACA,aACA,aACA,cACA,gBACA,YACA,aACA,YACA,iBACA,gBACA,OACA,kBACA,qBACA,sBACA,qBACA,wBACA,gBAAgB,GAWZC,IAEDC,CAAAA,MAAU;AACb,QAAM,CAACC,GAAOC,CAAM,IAAIC,EAAWH,GAAO,CAAC,YAAY,kBAAkB,CAAC;AAE1E,SAAA,CAAAI,EAEKC,GAAgB;AAAA,IAAAC,UACbC,CAAAA,MAAOH,EACNI,GAAgB;AAAA,MAAA,IAAAF,WAAA;AAAA,eAAA,CAAAF,EACdK,GAAG;AAAA,UAAA,IAACC,OAAI;AAAA,mBAAEH,IAAUI;AAAAA,UAAK;AAAA,UAAAL,UACvBA,CAACK,GAAOC,MAAKR,EACXS,GAAa;AAAA,YAAA,IAACD,QAAK;AAAA,qBAAEA,EAAAA;AAAAA,YAAO;AAAA,YAAED,OAAAA;AAAAA,YAAY,IAAAL,WAAA;AAAA,qBAAA,CAAAF,EACxCU,GAAoB;AAAA,gBAAA,IAAAR,WAAA;AAAA,yBAAA,CAAAF,EAClBW,GAAiB;AAAA,oBAAAT,UAAEK;AAAAA,kBAAAA,CAAK,GAAAP,EACxBY,GAA0B,CAAA,CAAA,CAAA;AAAA,gBAAA;AAAA,cAAA,CAAA,GAAAZ,EAE5Ba,GAAkB,CAAA,CAAA,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA;AAAA,QAAA,CAEtB,GAAAb,EAEFc,GAAmBhB,CAAM,GAAAE,EACzBe,GAAI;AAAA,UAAA,IAACC,OAAI;AAAA,mBAAEnB,EAAMoB,qBAAqB;AAAA,UAAK;AAAA,UAAA,IAAAf,WAAA;AAAA,mBAAAF,EACzCkB,GAAqB,EAAA;AAAA,UAAA;AAAA,QAAA,CAAA,GAAAC,EAAA,MAEvBtB,EAAMK,QAAQ,CAAA;AAAA,MAAA;AAAA,IAAA,CAA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gBAAC,IACDpB,UAAO;AAAA,yBAAEL,EAAAA,EAAQM,MAAMC,KAAKC,OAAOC,SAAS;AAAA,gBAAC;AAAA,gBAAA,IAC7CC,WAAQ;AAAA,yBAAEpC,EAAMoC,YAAY;AAAA,gBAAK;AAAA,gBAAA,IACjCC,WAAQ;AAAA,yBAAErC,EAAMqC,YAAY;AAAA,gBAAK;AAAA,cAAA,GAC7BT,GAAS;AAAA,gBAAA,IAAAvB,WAAA;AAAA,yBAAAF,EAEZL,GAAcgD,EACTjB,GAAU,MACT,OAAO7B,EAAMoB,oBAAqB,aAAa;AAAA,oBAClDA,kBAAkBpB,EAAMoB;AAAAA,kBAAAA,CACzB,CAAA;AAAA,gBAAA;AAAA,cAAA,CAAA,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA,GAAAjB,EAINiD,GAAU;AAAA,YAAA,IAAClB,SAAM;AAAA,qBAAER,EAAAA,EAAQM,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAA/B,EAC5CkD,GAAgB;AAAA,YAAA,IAAAhD,WAAA;AAAA,qBAAEL,EAAMsD;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
@@ -1,7 +1,8 @@
1
- import { Component, ComponentProps } from 'solid-js';
1
+ import { Component, ComponentProps, JSXElement } from 'solid-js';
2
2
  import { TextInputInput } from '../TextInput';
3
3
  export type TextInputFieldProps = ComponentProps<typeof TextInputInput> & {
4
4
  label?: string;
5
5
  description?: string;
6
+ trailingAddon?: JSXElement;
6
7
  };
7
8
  export declare const TextInputField: Component<TextInputFieldProps>;
@@ -1,51 +1,59 @@
1
- import { createComponent as e, mergeProps as o } from "solid-js/web";
2
- import { splitProps as d } from "solid-js";
3
- import { Field as a, FieldLabel as u, FieldContent as s, FieldError as p, FieldDescription as g } from "../Field.js";
4
- import { TextInputControl as m, TextInputInput as c } from "../TextInput.js";
5
- import { useFieldContext as h } from "./context.js";
6
- const I = (n) => {
7
- const r = h(), [t, l] = d(n, ["label", "description", "required", "disabled", "readOnly"]);
8
- return e(a, {
1
+ import { createComponent as e, mergeProps as d } from "solid-js/web";
2
+ import { Field as o, FieldLabel as a, FieldContent as u, FieldError as s, FieldDescription as g } from "../Field.js";
3
+ import { TextInputControl as p, TextInputInput as m } from "../TextInput.js";
4
+ import { useFieldContext as c } from "./context.js";
5
+ import { WithTrailingAddon as h } from "./WithTrailingAddon.js";
6
+ import { splitProps as f } from "solid-js";
7
+ const T = (n) => {
8
+ const t = c(), [r, l] = f(n, ["label", "description", "trailingAddon", "required", "disabled", "readOnly"]);
9
+ return e(o, {
9
10
  get invalid() {
10
- return r().state.meta.errors.length > 0;
11
+ return t().state.meta.errors.length > 0;
11
12
  },
12
13
  get disabled() {
13
- return t.disabled ?? !1;
14
+ return r.disabled ?? !1;
14
15
  },
15
16
  get readOnly() {
16
- return t.readOnly ?? !1;
17
+ return r.readOnly ?? !1;
17
18
  },
18
19
  get required() {
19
- return t.required ?? !1;
20
+ return r.required ?? !1;
20
21
  },
21
22
  get children() {
22
- return [e(u, {
23
+ return [e(a, {
23
24
  get children() {
24
- return t.label;
25
+ return r.label;
25
26
  }
26
- }), e(s, {
27
+ }), e(u, {
27
28
  get children() {
28
- return [e(m, {
29
+ return [e(h, {
30
+ get addon() {
31
+ return r.trailingAddon;
32
+ },
29
33
  get children() {
30
- return e(c, o({
31
- get value() {
32
- return r().state.value;
33
- },
34
- onInput: (i) => {
35
- r().handleChange(i.target.value);
36
- },
37
- onBlur: () => {
38
- r().handleBlur();
34
+ return e(p, {
35
+ get children() {
36
+ return e(m, d({
37
+ get value() {
38
+ return t().state.value;
39
+ },
40
+ onInput: (i) => {
41
+ t().handleChange(i.target.value);
42
+ },
43
+ onBlur: () => {
44
+ t().handleBlur();
45
+ }
46
+ }, l));
39
47
  }
40
- }, l));
48
+ });
41
49
  }
42
- }), e(p, {
50
+ }), e(s, {
43
51
  get errors() {
44
- return r().state.meta.errors;
52
+ return t().state.meta.errors;
45
53
  }
46
54
  }), e(g, {
47
55
  get children() {
48
- return t.description;
56
+ return r.description;
49
57
  }
50
58
  })];
51
59
  }
@@ -54,6 +62,6 @@ const I = (n) => {
54
62
  });
55
63
  };
56
64
  export {
57
- I as TextInputField
65
+ T as TextInputField
58
66
  };
59
67
  //# sourceMappingURL=TextInputField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextInputField.js","sources":["../../../src/components/form/TextInputField.tsx"],"sourcesContent":["import { type Component, type ComponentProps, splitProps } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport { TextInputControl, TextInputInput } from '@/components/TextInput';\n\nimport { useFieldContext } from './context';\n\nexport type TextInputFieldProps = ComponentProps<typeof TextInputInput> & {\n label?: string;\n description?: string;\n};\n\nexport const TextInputField: Component<TextInputFieldProps> = (props) => {\n const field = useFieldContext<string>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <TextInputControl>\n <TextInputInput\n value={field().state.value}\n onInput={(event) => {\n field().handleChange(event.target.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n {...others}\n />\n </TextInputControl>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TextInputField","props","field","useFieldContext","local","others","splitProps","_$createComponent","Field","invalid","state","meta","errors","length","disabled","readOnly","required","children","FieldLabel","label","FieldContent","TextInputControl","TextInputInput","_$mergeProps","value","onInput","event","handleChange","target","onBlur","handleBlur","FieldError","FieldDescription","description"],"mappings":";;;;;AAYO,MAAMA,IAAkDC,CAAAA,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AAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
1
+ {"version":3,"file":"TextInputField.js","sources":["../../../src/components/form/TextInputField.tsx"],"sourcesContent":["import type { Component, ComponentProps, JSXElement } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport { TextInputControl, TextInputInput } from '@/components/TextInput';\n\nimport { useFieldContext } from './context';\nimport { WithTrailingAddon } from './WithTrailingAddon';\n\nexport type TextInputFieldProps = ComponentProps<typeof TextInputInput> & {\n label?: string;\n description?: string;\n trailingAddon?: JSXElement;\n};\n\nexport const TextInputField: Component<TextInputFieldProps> = (props) => {\n const field = useFieldContext<string>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'trailingAddon',\n 'required',\n 'disabled',\n 'readOnly',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <WithTrailingAddon addon={local.trailingAddon}>\n <TextInputControl>\n <TextInputInput\n value={field().state.value}\n onInput={(event) => {\n field().handleChange(event.target.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n {...others}\n />\n </TextInputControl>\n </WithTrailingAddon>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TextInputField","props","field","useFieldContext","local","others","splitProps","_$createComponent","Field","invalid","state","meta","errors","length","disabled","readOnly","required","children","FieldLabel","label","FieldContent","WithTrailingAddon","addon","trailingAddon","TextInputControl","TextInputInput","_$mergeProps","value","onInput","event","handleChange","target","onBlur","handleBlur","FieldError","FieldDescription","description"],"mappings":";;;;;;AAcO,MAAMA,IAAkDC,CAAAA,MAAU;AACvE,QAAMC,IAAQC,EA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A,EAAQQ,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAAL,EAC5C4B,GAAgB;AAAA,YAAA,IAAAlB,WAAA;AAAA,qBAAEb,EAAMgC;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
@@ -1,7 +1,8 @@
1
- import { Component, ComponentProps } from 'solid-js';
1
+ import { Component, ComponentProps, JSXElement } from 'solid-js';
2
2
  import { TextInputArea } from '../TextInput';
3
3
  export type TextareaFieldProps = ComponentProps<typeof TextInputArea> & {
4
4
  label?: string;
5
5
  description?: string;
6
+ trailingAddon?: JSXElement;
6
7
  };
7
8
  export declare const TextareaField: Component<TextareaFieldProps>;
@@ -1,51 +1,59 @@
1
- import { createComponent as e, mergeProps as o } from "solid-js/web";
2
- import { Field as a, FieldLabel as d, FieldContent as u, FieldError as s, FieldDescription as p } from "../Field.js";
3
- import { TextInputControl as g, TextInputArea as m } from "../TextInput.js";
1
+ import { createComponent as e, mergeProps as d } from "solid-js/web";
2
+ import { Field as o, FieldLabel as a, FieldContent as u, FieldError as s, FieldDescription as g } from "../Field.js";
3
+ import { TextInputControl as p, TextInputArea as m } from "../TextInput.js";
4
4
  import { useFieldContext as c } from "./context.js";
5
- import { splitProps as h } from "solid-js";
6
- const v = (n) => {
7
- const r = c(), [t, l] = h(n, ["label", "description", "required", "disabled", "readOnly"]);
8
- return e(a, {
5
+ import { WithTrailingAddon as h } from "./WithTrailingAddon.js";
6
+ import { splitProps as f } from "solid-js";
7
+ const T = (n) => {
8
+ const t = c(), [r, l] = f(n, ["label", "description", "required", "disabled", "readOnly", "trailingAddon"]);
9
+ return e(o, {
9
10
  get invalid() {
10
- return r().state.meta.errors.length > 0;
11
+ return t().state.meta.errors.length > 0;
11
12
  },
12
13
  get disabled() {
13
- return t.disabled ?? !1;
14
+ return r.disabled ?? !1;
14
15
  },
15
16
  get readOnly() {
16
- return t.readOnly ?? !1;
17
+ return r.readOnly ?? !1;
17
18
  },
18
19
  get required() {
19
- return t.required ?? !1;
20
+ return r.required ?? !1;
20
21
  },
21
22
  get children() {
22
- return [e(d, {
23
+ return [e(a, {
23
24
  get children() {
24
- return t.label;
25
+ return r.label;
25
26
  }
26
27
  }), e(u, {
27
28
  get children() {
28
- return [e(g, {
29
+ return [e(h, {
30
+ get addon() {
31
+ return r.trailingAddon;
32
+ },
29
33
  get children() {
30
- return e(m, o({
31
- get value() {
32
- return r().state.value;
33
- },
34
- onInput: (i) => {
35
- r().handleChange(i.target.value);
36
- },
37
- onBlur: () => {
38
- r().handleBlur();
34
+ return e(p, {
35
+ get children() {
36
+ return e(m, d({
37
+ get value() {
38
+ return t().state.value;
39
+ },
40
+ onInput: (i) => {
41
+ t().handleChange(i.target.value);
42
+ },
43
+ onBlur: () => {
44
+ t().handleBlur();
45
+ }
46
+ }, l));
39
47
  }
40
- }, l));
48
+ });
41
49
  }
42
50
  }), e(s, {
43
51
  get errors() {
44
- return r().state.meta.errors;
52
+ return t().state.meta.errors;
45
53
  }
46
- }), e(p, {
54
+ }), e(g, {
47
55
  get children() {
48
- return t.description;
56
+ return r.description;
49
57
  }
50
58
  })];
51
59
  }
@@ -54,6 +62,6 @@ const v = (n) => {
54
62
  });
55
63
  };
56
64
  export {
57
- v as TextareaField
65
+ T as TextareaField
58
66
  };
59
67
  //# sourceMappingURL=TextareaField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaField.js","sources":["../../../src/components/form/TextareaField.tsx"],"sourcesContent":["import type { Component, ComponentProps } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport { TextInputControl, TextInputArea } from '@/components/TextInput';\n\nimport { useFieldContext } from './context';\n\nexport type TextareaFieldProps = ComponentProps<typeof TextInputArea> & {\n label?: string;\n description?: string;\n};\n\nexport const TextareaField: Component<TextareaFieldProps> = (props) => {\n const field = useFieldContext<string>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <TextInputControl>\n <TextInputArea\n value={field().state.value}\n onInput={(event) => {\n field().handleChange(event.target.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n {...others}\n />\n </TextInputControl>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TextareaField","props","field","useFieldContext","local","others","splitProps","_$createComponent","Field","invalid","state","meta","errors","length","disabled","readOnly","required","children","FieldLabel","label","FieldContent","TextInputControl","TextInputArea","_$mergeProps","value","onInput","event","handleChange","target","onBlur","handleBlur","FieldError","FieldDescription","description"],"mappings":";;;;;AAYO,MAAMA,IAAgDC,CAAAA,MAAU;AACrE,QAAMC,IAAQC,EAAAA,GACR,CAACC,GAAOC,CAAM,IAAIC,EAAWL,GAAO,CACxC,SACA,eACA,YACA,YACA,UAAU,CACX;AAED,SAAAM,EACGC,GAAK;AAAA,IAAA,IACJC,UAAO;AAAA,aAAEP,EAAAA,EAAQQ,MAAMC,KAAKC,OAAOC,SAAS;AAAA,IAAC;AAAA,IAAA,IAC7CC,WAAQ;AAAA,aAAEV,EAAMU,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;AAAA,aAAEX,EAAMW,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;AAAA,aAAEZ,EAAMY,YAAY;AAAA,IAAK;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAA,CAAAV,EAEhCW,GAAU;AAAA,QAAA,IAAAD,WAAA;AAAA,iBAAEb,EAAMe;AAAAA,QAAK;AAAA,MAAA,CAAA,GAAAZ,EACvBa,GAAY;AAAA,QAAA,IAAAH,WAAA;AAAA,iBAAA,CAAAV,EACVc,GAAgB;AAAA,YAAA,IAAAJ,WAAA;AAAA,qBAAAV,EACde,GAAaC,EAAA;AAAA,gBAAA,IACZC,QAAK;AAAA,yBAAEtB,EAAAA,EAAQQ,MAAMc;AAAAA,gBAAK;AAAA,gBAC1BC,SAAUC,CAAAA,MAAU;AAClBxB,kBAAAA,EAAAA,EAAQyB,aAAaD,EAAME,OAAOJ,KAAK;AAAA,gBACzC;AAAA,gBACAK,QAAQA,MAAM;AACZ3B,kBAAAA,EAAAA,EAAQ4B,WAAAA;AAAAA,gBACV;AAAA,cAAA,GACIzB,CAAM,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA,GAAAE,EAGbwB,GAAU;AAAA,YAAA,IAACnB,SAAM;AAAA,qBAAEV,EAAAA,EAAQQ,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAAL,EAC5CyB,GAAgB;AAAA,YAAA,IAAAf,WAAA;AAAA,qBAAEb,EAAM6B;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
1
+ {"version":3,"file":"TextareaField.js","sources":["../../../src/components/form/TextareaField.tsx"],"sourcesContent":["import type { Component, ComponentProps, JSXElement } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport { TextInputControl, TextInputArea } from '@/components/TextInput';\n\nimport { useFieldContext } from './context';\nimport { WithTrailingAddon } from './WithTrailingAddon';\n\nexport type TextareaFieldProps = ComponentProps<typeof TextInputArea> & {\n label?: string;\n description?: string;\n trailingAddon?: JSXElement;\n};\n\nexport const TextareaField: Component<TextareaFieldProps> = (props) => {\n const field = useFieldContext<string>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'trailingAddon',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <WithTrailingAddon addon={local.trailingAddon}>\n <TextInputControl>\n <TextInputArea\n value={field().state.value}\n onInput={(event) => {\n field().handleChange(event.target.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n {...others}\n />\n </TextInputControl>\n </WithTrailingAddon>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TextareaField","props","field","useFieldContext","local","others","splitProps","_$createComponent","Field","invalid","state","meta","errors","length","disabled","readOnly","required","children","FieldLabel","label","FieldContent","WithTrailingAddon","addon","trailingAddon","TextInputControl","TextInputArea","_$mergeProps","value","onInput","event","handleChange","target","onBlur","handleBlur","FieldError","FieldDescription","description"],"mappings":";;;;;;AAcO,MAAMA,IAAgDC,CAAAA,MAAU;AACrE,QAAMC,IAAQC,EAAAA,GACR,CAACC,GAAOC,CAAM,IAAIC,EAAWL,GAAO,CACxC,SACA,eACA,YACA,YACA,YACA,eAAe,CAChB;AAED,SAAAM,EACGC,GAAK;AAAA,IAAA,IACJC,UAAO;AAAA,aAAEP,EAAAA,EAAQQ,MAAMC,KAAKC,OAAOC,SAAS;AAAA,IAAC;AAAA,IAAA,IAC7CC,WAAQ;AAAA,aAAEV,EAAMU,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;AAAA,aAAEX,EAAMW,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;AAAA,aAAEZ,EAAMY,YAAY;AAAA,IAAK;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAA,CAAAV,EAEhCW,GAAU;AAAA,QAAA,IAAAD,WAAA;AAAA,iBAAEb,EAAMe;AAAAA,QAAK;AAAA,MAAA,CAAA,GAAAZ,EACvBa,GAAY;AAAA,QAAA,IAAAH,WAAA;AAAA,iBAAA,CAAAV,EACVc,GAAiB;AAAA,YAAA,IAACC,QAAK;AAAA,qBAAElB,EAAMmB;AAAAA,YAAa;AAAA,YAAA,IAAAN,WAAA;AAAA,qBAAAV,EAC1CiB,GAAgB;AAAA,gBAAA,IAAAP,WAAA;AAAA,yBAAAV,EACdkB,GAAaC,EAAA;AAAA,oBAAA,IACZC,QAAK;AAAA,6BAAEzB,EAAAA,EAAQQ,MAAMiB;AAAAA,oBAAK;AAAA,oBAC1BC,SAAUC,CAAAA,MAAU;AAClB3B,sBAAAA,EAAAA,EAAQ4B,aAAaD,EAAME,OAAOJ,KAAK;AAAA,oBACzC;AAAA,oBACAK,QAAQA,MAAM;AACZ9B,sBAAAA,EAAAA,EAAQ+B,WAAAA;AAAAA,oBACV;AAAA,kBAAA,GACI5B,CAAM,CAAA;AAAA,gBAAA;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA,GAAAE,EAIf2B,GAAU;AAAA,YAAA,IAACtB,SAAM;AAAA,qBAAEV,EAAAA,EAAQQ,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAAL,EAC5C4B,GAAgB;AAAA,YAAA,IAAAlB,WAAA;AAAA,qBAAEb,EAAMgC;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
@@ -0,0 +1,6 @@
1
+ import { Component, JSXElement } from 'solid-js';
2
+ export type WithTrailingAddonProps = {
3
+ addon?: JSXElement;
4
+ children: JSXElement;
5
+ };
6
+ export declare const WithTrailingAddon: Component<WithTrailingAddonProps>;
@@ -0,0 +1,18 @@
1
+ import { createComponent as l, Show as r, insert as t, template as a } from "solid-js/web";
2
+ var d = /* @__PURE__ */ a('<div class="gap-2 flex items-center">');
3
+ const c = (e) => l(r, {
4
+ get when() {
5
+ return e.addon;
6
+ },
7
+ get fallback() {
8
+ return e.children;
9
+ },
10
+ get children() {
11
+ var n = d();
12
+ return t(n, () => e.children, null), t(n, () => e.addon, null), n;
13
+ }
14
+ });
15
+ export {
16
+ c as WithTrailingAddon
17
+ };
18
+ //# sourceMappingURL=WithTrailingAddon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithTrailingAddon.js","sources":["../../../src/components/form/WithTrailingAddon.tsx"],"sourcesContent":["import type { Component, JSXElement } from 'solid-js';\n\nexport type WithTrailingAddonProps = {\n addon?: JSXElement;\n children: JSXElement;\n};\n\nexport const WithTrailingAddon: Component<WithTrailingAddonProps> = (props) => (\n <Show when={props.addon} fallback={props.children}>\n <div class='gap-2 flex items-center'>\n {props.children}\n {props.addon}\n </div>\n </Show>\n);\n"],"names":["WithTrailingAddon","props","_$createComponent","_$Show","when","addon","fallback","children","_el$","_tmpl$","_$insert"],"mappings":";;AAOO,MAAMA,IAAwDC,CAAAA,MAAKC,EACvEC,GAAI;AAAA,EAAA,IAACC,OAAI;AAAA,WAAEH,EAAMI;AAAAA,EAAK;AAAA,EAAA,IAAEC,WAAQ;AAAA,WAAEL,EAAMM;AAAAA,EAAQ;AAAA,EAAA,IAAAA,WAAA;AAAA,QAAAC,IAAAC,EAAAA;AAAAC,WAAAA,EAAAF,GAAA,MAE5CP,EAAMM,UAAQ,IAAA,GAAAG,EAAAF,GAAA,MACdP,EAAMI,OAAK,IAAA,GAAAG;AAAAA,EAAA;AAAA,CAAA;"}
@@ -1,3 +1,4 @@
1
+ export * from './WithTrailingAddon';
1
2
  export * from './Form';
2
3
  export * from './context';
3
4
  export * from './TextInputField';
@@ -15,3 +16,4 @@ export * from './ComboboxField';
15
16
  export * from './TagsInputField';
16
17
  export * from './SubmitButton';
17
18
  export * from './AutoSubmit';
19
+ export * from './WithTrailingAddon';
@@ -1,43 +1,45 @@
1
- import { Form as r, useAppForm as t, withFieldGroup as m, withForm as p } from "./Form.js";
2
- import { fieldContext as x, formContext as d, useFieldContext as f, useFormContext as F } from "./context.js";
3
- import { TextInputField as u } from "./TextInputField.js";
4
- import { TextareaField as a } from "./TextareaField.js";
5
- import { NumberInputField as s } from "./NumberInputField.js";
6
- import { PasswordInputField as I } from "./PasswordInputField.js";
7
- import { PinInputField as c } from "./PinInputField.js";
8
- import { SelectField as w } from "./SelectField.js";
9
- import { CheckboxField as T } from "./CheckboxField.js";
10
- import { SwitchField as A } from "./SwitchField.js";
11
- import { RadioGroupField as g } from "./RadioGroupField.js";
12
- import { SliderField as D } from "./SliderField.js";
13
- import { DatePickerField as R } from "./DatePickerField.js";
14
- import { ComboboxField as q } from "./ComboboxField.js";
15
- import { TagsInputField as y } from "./TagsInputField.js";
16
- import { SubmitButton as E } from "./SubmitButton.js";
17
- import { AutoSubmit as J } from "./AutoSubmit.js";
1
+ import { WithTrailingAddon as r } from "./WithTrailingAddon.js";
2
+ import { Form as i, useAppForm as m, withFieldGroup as p, withForm as x } from "./Form.js";
3
+ import { fieldContext as f, formContext as l, useFieldContext as F, useFormContext as u } from "./context.js";
4
+ import { TextInputField as a } from "./TextInputField.js";
5
+ import { TextareaField as s } from "./TextareaField.js";
6
+ import { NumberInputField as h } from "./NumberInputField.js";
7
+ import { PasswordInputField as S } from "./PasswordInputField.js";
8
+ import { PinInputField as w } from "./PinInputField.js";
9
+ import { SelectField as A } from "./SelectField.js";
10
+ import { CheckboxField as g } from "./CheckboxField.js";
11
+ import { SwitchField as G } from "./SwitchField.js";
12
+ import { RadioGroupField as D } from "./RadioGroupField.js";
13
+ import { SliderField as R } from "./SliderField.js";
14
+ import { DatePickerField as j } from "./DatePickerField.js";
15
+ import { ComboboxField as v } from "./ComboboxField.js";
16
+ import { TagsInputField as z } from "./TagsInputField.js";
17
+ import { SubmitButton as H } from "./SubmitButton.js";
18
+ import { AutoSubmit as K } from "./AutoSubmit.js";
18
19
  export {
19
- J as AutoSubmit,
20
- T as CheckboxField,
21
- q as ComboboxField,
22
- R as DatePickerField,
23
- r as Form,
24
- s as NumberInputField,
25
- I as PasswordInputField,
26
- c as PinInputField,
27
- g as RadioGroupField,
28
- w as SelectField,
29
- D as SliderField,
30
- E as SubmitButton,
31
- A as SwitchField,
32
- y as TagsInputField,
33
- u as TextInputField,
34
- a as TextareaField,
35
- x as fieldContext,
36
- d as formContext,
37
- t as useAppForm,
38
- f as useFieldContext,
39
- F as useFormContext,
40
- m as withFieldGroup,
41
- p as withForm
20
+ K as AutoSubmit,
21
+ g as CheckboxField,
22
+ v as ComboboxField,
23
+ j as DatePickerField,
24
+ i as Form,
25
+ h as NumberInputField,
26
+ S as PasswordInputField,
27
+ w as PinInputField,
28
+ D as RadioGroupField,
29
+ A as SelectField,
30
+ R as SliderField,
31
+ H as SubmitButton,
32
+ G as SwitchField,
33
+ z as TagsInputField,
34
+ a as TextInputField,
35
+ s as TextareaField,
36
+ r as WithTrailingAddon,
37
+ f as fieldContext,
38
+ l as formContext,
39
+ m as useAppForm,
40
+ F as useFieldContext,
41
+ u as useFormContext,
42
+ p as withFieldGroup,
43
+ x as withForm
42
44
  };
43
45
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@manafishrov/ui",
4
- "version": "1.3.3",
4
+ "version": "1.3.5",
5
5
  "description": "Styled component library for Manafish interfaces ",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "repository": {
@@ -1,9 +1,7 @@
1
- import { createEffect, onCleanup, type Component } from 'solid-js';
1
+ import type { Component } from 'solid-js';
2
2
 
3
3
  import { useFormContext } from './context';
4
4
 
5
- const DEFAULT_DEBOUNCE_MS = 300;
6
-
7
5
  export type AutoSubmitProps = {
8
6
  debounce?: number;
9
7
  };
@@ -20,14 +18,11 @@ export const AutoSubmit: Component<AutoSubmitProps> = (props) => {
20
18
  return;
21
19
  }
22
20
 
23
- const debounceTimer = setTimeout(
24
- () => {
25
- form.handleSubmit().catch((error: unknown) => {
26
- throw error;
27
- });
28
- },
29
- Math.max(0, props.debounce ?? DEFAULT_DEBOUNCE_MS),
30
- );
21
+ const debounceTimer = setTimeout(() => {
22
+ form.handleSubmit().catch((error: unknown) => {
23
+ throw error;
24
+ });
25
+ }, props.debounce ?? 0);
31
26
 
32
27
  onCleanup(() => {
33
28
  clearTimeout(debounceTimer);
@@ -1,5 +1,5 @@
1
1
  import type { ComboboxRootProps } from '@ark-ui/solid';
2
- import type { Component, ComponentProps } from 'solid-js';
2
+ import type { Component, ComponentProps, JSXElement } from 'solid-js';
3
3
 
4
4
  import {
5
5
  Combobox,
@@ -14,6 +14,7 @@ import {
14
14
  import { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';
15
15
 
16
16
  import { useFieldContext } from './context';
17
+ import { WithTrailingAddon } from './WithTrailingAddon';
17
18
 
18
19
  const COMBOBOX_ROOT_PROPS = [
19
20
  'placeholder',
@@ -64,6 +65,7 @@ export type ComboboxFieldProps = ComponentProps<typeof ComboboxInput> &
64
65
  description?: string;
65
66
  showTrigger?: boolean;
66
67
  showClearTrigger?: boolean;
68
+ trailingAddon?: JSXElement;
67
69
  } & { class?: string };
68
70
 
69
71
  const ComboboxInputGroup: Component<
@@ -102,6 +104,7 @@ const COMBOBOX_FIELD_PROPS = [
102
104
  'showTrigger',
103
105
  'showClearTrigger',
104
106
  'children',
107
+ 'trailingAddon',
105
108
  ] as const;
106
109
 
107
110
  export const ComboboxField: Component<ComboboxFieldProps> = (props) => {
@@ -118,28 +121,30 @@ export const ComboboxField: Component<ComboboxFieldProps> = (props) => {
118
121
  >
119
122
  <FieldLabel>{local.label}</FieldLabel>
120
123
  <FieldContent>
121
- <Combobox<string>
122
- collection={local.collection}
123
- value={field().state.value}
124
- onValueChange={(details) => {
125
- field().handleChange(details.value);
126
- }}
127
- onBlur={() => {
128
- field().handleBlur();
129
- }}
130
- invalid={field().state.meta.errors.length > 0}
131
- disabled={local.disabled ?? false}
132
- readOnly={local.readOnly ?? false}
133
- {...rootProps}
134
- >
135
- <ComboboxInputGroup
136
- showTrigger={local.showTrigger}
137
- showClearTrigger={local.showClearTrigger}
138
- {...inputProps}
124
+ <WithTrailingAddon addon={local.trailingAddon}>
125
+ <Combobox<string>
126
+ collection={local.collection}
127
+ value={field().state.value}
128
+ onValueChange={(details) => {
129
+ field().handleChange(details.value);
130
+ }}
131
+ onBlur={() => {
132
+ field().handleBlur();
133
+ }}
134
+ invalid={field().state.meta.errors.length > 0}
135
+ disabled={local.disabled ?? false}
136
+ readOnly={local.readOnly ?? false}
137
+ {...rootProps}
139
138
  >
140
- {local.children}
141
- </ComboboxInputGroup>
142
- </Combobox>
139
+ <ComboboxInputGroup
140
+ showTrigger={local.showTrigger}
141
+ showClearTrigger={local.showClearTrigger}
142
+ {...inputProps}
143
+ >
144
+ {local.children}
145
+ </ComboboxInputGroup>
146
+ </Combobox>
147
+ </WithTrailingAddon>
143
148
  <FieldError errors={field().state.meta.errors} />
144
149
  <FieldDescription>{local.description}</FieldDescription>
145
150
  </FieldContent>