ekm-ui 0.0.6 → 0.0.7

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { a as Button } from './chunk-G676EBCC.mjs';
2
- export { a as FormRow } from './chunk-5PBKUEAL.mjs';
2
+ export { a as FormRow } from './chunk-BYLEIZ7D.mjs';
3
3
  export { a as LoveFooter } from './chunk-PLYG34XT.mjs';
4
4
  import './chunk-FRIXS4BL.mjs';
5
5
  export { a as Navbar } from './chunk-Q6W42FIC.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ekm-ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ],
package/src/form-row.tsx CHANGED
@@ -7,6 +7,7 @@ type Props = {
7
7
  htmlFor: string;
8
8
  helperText?: string;
9
9
  className?: string;
10
+ errorText?: string;
10
11
  };
11
12
 
12
13
  export function FormRow({
@@ -15,16 +16,22 @@ export function FormRow({
15
16
  htmlFor,
16
17
  helperText,
17
18
  className,
19
+ errorText,
18
20
  }: Props) {
19
21
  return (
20
22
  <div className={clsx("grid grid-cols-1 content-start gap-y-2", className)}>
21
- <Label htmlFor={htmlFor}>{label}</Label>
23
+ <Label htmlFor={htmlFor} color={errorText && "failure"} >{label}</Label>
22
24
  {children}
23
- {helperText && (
25
+ {(helperText && !errorText) && (
24
26
  <span className="text-xs font-normal text-gray-500 dark:text-gray-400">
25
27
  {helperText}
26
28
  </span>
27
29
  )}
30
+ {(errorText) && (
31
+ <span className="text-xs font-normal text-red-500 dark:text-red-400">
32
+ {errorText}
33
+ </span>
34
+ )}
28
35
  </div>
29
36
  );
30
37
  }
@@ -1,9 +0,0 @@
1
- import l from 'clsx';
2
- import { Label } from 'flowbite-react';
3
- import { jsxs, jsx } from 'react/jsx-runtime';
4
-
5
- function g({children:a,label:o,htmlFor:s,helperText:t,className:e}){return jsxs("div",{className:l("grid grid-cols-1 content-start gap-y-2",e),children:[jsx(Label,{htmlFor:s,children:o}),a,t&&jsx("span",{className:"text-xs font-normal text-gray-500 dark:text-gray-400",children:t})]})}
6
-
7
- export { g as a };
8
- //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-5PBKUEAL.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/form-row.tsx"],"names":["clsx","Label","jsx","jsxs","FormRow","children","label","htmlFor","helperText","className"],"mappings":"AAAA,OAAOA,MAAU,OACjB,OAAS,SAAAC,MAAa,iBAkBlB,OACE,OAAAC,EADF,QAAAC,MAAA,oBARG,SAASC,EAAQ,CACtB,SAAAC,EACA,MAAAC,EACA,QAAAC,EACA,WAAAC,EACA,UAAAC,CACF,EAAU,CACR,OACEN,EAAC,OAAI,UAAWH,EAAK,yCAA0CS,CAAS,EACtE,UAAAP,EAACD,EAAA,CAAM,QAASM,EAAU,SAAAD,EAAM,EAC/BD,EACAG,GACCN,EAAC,QAAK,UAAU,uDACb,SAAAM,EACH,GAEJ,CAEJ","sourcesContent":["import clsx from \"clsx\";\nimport { Label } from \"flowbite-react\";\n\ntype Props = {\n children: React.ReactNode;\n label: string;\n htmlFor: string;\n helperText?: string;\n className?: string;\n};\n\nexport function FormRow({\n children,\n label,\n htmlFor,\n helperText,\n className,\n}: Props) {\n return (\n <div className={clsx(\"grid grid-cols-1 content-start gap-y-2\", className)}>\n <Label htmlFor={htmlFor}>{label}</Label>\n {children}\n {helperText && (\n <span className=\"text-xs font-normal text-gray-500 dark:text-gray-400\">\n {helperText}\n </span>\n )}\n </div>\n );\n}\n"]}