Sha256: 33589ee0ba1dddf67090a0f09e8df30c26ac5657e836f9b83e41e906240684dd

Contents?: true

Size: 1.69 KB

Versions: 31

Compression:

Stored size: 1.69 KB

Contents

import React, { useState } from 'react'
import { Body, Passphrase, TextInput } from '../../'

const PassphraseMeterSettings = (props) => {
  const [input, setInput] = useState('')

  const handleChange = (e) => setInput(e.target.value)

  const [strength, setStrength] = useState(0)
  const handleStrengthChange = (str) => setStrength(str)
  return (
    <>
      <div>
        <Body>
          {'These examples will all share the same input value. Type in any of the inputs to see how the strength meter changes in response to different settings.'}
        </Body>
        <br />
        <TextInput
            disabled
            label="Calculated Strength"
            readOnly
            value={strength}
        />

        <Passphrase
            label="Default settings"
            onChange={handleChange}
            onStrengthChange={handleStrengthChange}
            value={input}
            {...props}
        />

        <Passphrase
            label="Min length = 5"
            minLength={5}
            onChange={handleChange}
            value={input}
            {...props}
        />
        <Passphrase
            label="Min length = 30"
            minLength={30}
            onChange={handleChange}
            value={input}
            {...props}
        />

        <Passphrase
            averageThreshold={1}
            label="Average threshold = 1"
            onChange={handleChange}
            value={input}
            {...props}
        />

        <Passphrase
            label="Strong Threshold = 4"
            onChange={handleChange}
            strongThreshold={4}
            value={input}
            {...props}
        />
      </div>
    </>
  )
}

export default PassphraseMeterSettings

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
playbook_ui-9.19.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.18.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.17.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.16.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.15.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.14.1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.13.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.12.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx