@douglasneuroinformatics/libui 2.8.0 → 2.8.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"StringFieldPassword.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/StringField/StringFieldPassword.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AASjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,MAAM,qBAAqB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtD,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,MAAM,CAAC,GACpE,OAAO,CAAC,eAAe,EAAE;IAAE,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AAEpD,eAAO,MAAM,mBAAmB,sFAS7B,wBAAwB,sBAsD1B,CAAC"}
1
+ {"version":3,"file":"StringFieldPassword.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/StringField/StringFieldPassword.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AASjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,MAAM,qBAAqB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtD,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,MAAM,CAAC,GACpE,OAAO,CAAC,eAAe,EAAE;IAAE,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AAEpD,eAAO,MAAM,mBAAmB,sFAS7B,wBAAwB,sBAuD1B,CAAC"}
@@ -22,7 +22,7 @@ export const StringFieldPassword = ({ calculateStrength, description, error, lab
22
22
  React.createElement("button", { className: "absolute right-0 flex h-full w-8 items-center justify-center text-muted-foreground", disabled: readOnly, tabIndex: -1, type: "button", onClick: () => setShow(!show) },
23
23
  React.createElement(EyeIcon, { className: cn('absolute transition-all', show ? '-rotate-90 scale-0' : 'rotate-0 scale-100') }),
24
24
  React.createElement(EyeOffIcon, { className: cn('absolute transition-all', !show ? 'rotate-90 scale-0' : 'rotate-0 scale-100') }))),
25
- strength !== null && (React.createElement(motion.div, { animate: { width: `${strength * 25}%` }, className: "h-1 w-full overflow-hidden rounded", transition: { duration: 0.5 } },
25
+ strength !== null && (React.createElement(motion.div, { animate: { width: `${Math.max(strength, value?.length ? 1 : 0) * 25}%` }, className: "h-1 w-full overflow-hidden rounded", initial: { width: '0%' }, transition: { duration: 0.5 } },
26
26
  React.createElement("div", { className: cn('h-full w-full bg-destructive transition-colors duration-500', strength === 2 && 'bg-yellow-500 dark:bg-yellow-700', strength === 3 && 'bg-sky-500 dark:bg-sky-700', strength === 4 && 'bg-green-500 dark:bg-green-700') }))),
27
27
  React.createElement(FieldGroup.Error, { error: error })));
28
28
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@douglasneuroinformatics/libui",
3
3
  "type": "module",
4
- "version": "2.8.0",
4
+ "version": "2.8.1",
5
5
  "packageManager": "pnpm@9.3.0",
6
6
  "description": "Generic UI components for DNP projects, built using React and TailwindCSS",
7
7
  "author": {
@@ -62,8 +62,9 @@ export const StringFieldPassword = ({
62
62
  </FieldGroup.Row>
63
63
  {strength !== null && (
64
64
  <motion.div
65
- animate={{ width: `${strength * 25}%` }}
65
+ animate={{ width: `${Math.max(strength, value?.length ? 1 : 0) * 25}%` }}
66
66
  className="h-1 w-full overflow-hidden rounded"
67
+ initial={{ width: '0%' }}
67
68
  transition={{ duration: 0.5 }}
68
69
  >
69
70
  <div