@enigmax/primitives 0.23.0 → 0.24.0

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 (39) hide show
  1. package/dist/{chunk-DSBYVA7V.js → chunk-DZMHY3SU.js} +73 -9
  2. package/dist/{chunk-KEVZ5XQV.js → chunk-QJJ34E4G.js} +33 -9
  3. package/dist/chunk-S2FPN5ID.js +115 -0
  4. package/dist/chunk-S7EE57YB.js +9 -0
  5. package/dist/{chunk-3BQVOOAM.js → chunk-Z3VDE7OA.js} +145 -1
  6. package/dist/{context-menu-D3FtTn7v.d.ts → clipboard-menu-B_ouitfS.d.ts} +91 -1
  7. package/dist/color-D_rZ83Oc.d.ts +152 -0
  8. package/dist/color-OPV3BJV6.js +452 -0
  9. package/dist/{index-DQNnohoo.d.ts → index-ZPvlf9vs.d.ts} +52 -4
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.js +2 -1
  12. package/dist/next/index.d.ts +3 -3
  13. package/dist/next/index.js +6 -4
  14. package/dist/react/context-menu.d.ts +23 -6
  15. package/dist/react/context-menu.js +2 -2
  16. package/dist/react/index.d.ts +5 -5
  17. package/dist/react/index.js +6 -4
  18. package/dist/react/input.d.ts +2 -2
  19. package/dist/react/input.js +2 -1
  20. package/dist/react-router/index.d.ts +3 -3
  21. package/dist/react-router/index.js +6 -4
  22. package/package.json +3 -1
  23. package/recipes/color/styles.css +143 -0
  24. package/recipes/context-menu/styles.css +8 -0
  25. package/registry.json +77 -7
  26. package/src/core/clipboard-menu.ts +270 -0
  27. package/src/core/color.ts +248 -0
  28. package/src/index.ts +32 -0
  29. package/src/react/context-menu/context.ts +9 -2
  30. package/src/react/context-menu/index.tsx +14 -0
  31. package/src/react/context-menu/root.tsx +132 -8
  32. package/src/react/context-menu/styles.ts +8 -0
  33. package/src/react/index.ts +32 -0
  34. package/src/react/input/color-styles.ts +156 -0
  35. package/src/react/input/color.tsx +466 -0
  36. package/src/react/input/index.tsx +54 -6
  37. package/src/react/input/types.ts +59 -3
  38. package/dist/password-C8lG4Zm9.d.ts +0 -71
  39. /package/dist/{chunk-3HDEZ2E7.js → chunk-MSOCCQGH.js} +0 -0
@@ -1,71 +0,0 @@
1
- /**
2
- * Making a password, and judging one.
3
- *
4
- * Both are opt-in. A sign-in form wants neither: offering to generate a password where one
5
- * already exists is noise, and scoring one the visitor cannot change is worse. They belong
6
- * on a registration form and a change-password form, which is where an agent should switch
7
- * them on.
8
- */
9
- /** Character classes a generated password can draw from. */
10
- interface PasswordAlphabet {
11
- lowercase?: boolean;
12
- uppercase?: boolean;
13
- digits?: boolean;
14
- symbols?: boolean;
15
- }
16
- interface GeneratePasswordOptions extends PasswordAlphabet {
17
- /** Default 20. Long beats clever: length is the only term that scales. */
18
- length?: number;
19
- /**
20
- * Drop the characters that are read wrong off a screen or off paper - I l 1 O 0.
21
- * Worth it when the password will be typed by hand, not worth the entropy otherwise.
22
- */
23
- excludeAmbiguous?: boolean;
24
- /** Characters to remove from every class, e.g. ones your backend rejects. */
25
- exclude?: string;
26
- /**
27
- * Guarantee at least one character from every class asked for. Most password policies
28
- * demand it; it costs a little entropy, because it removes every password that happens
29
- * to lack one.
30
- */
31
- requireEachClass?: boolean;
32
- }
33
- /**
34
- * A random password from the classes asked for.
35
- *
36
- * @throws when the runtime has no CSPRNG, or when the options ask for something impossible
37
- * (every class excluded, or a length too short to hold one of each).
38
- */
39
- declare function generatePassword(options?: GeneratePasswordOptions): string;
40
- type PasswordScore = 0 | 1 | 2 | 3 | 4;
41
- interface PasswordStrengthReport {
42
- /** 0 worst, 4 best. What the bars under the field render. */
43
- score: PasswordScore;
44
- /** Estimated bits of entropy after the penalties below. */
45
- bits: number;
46
- /**
47
- * Why it scored what it scored, worst first. Show the first one; showing all of them
48
- * turns a hint into a lecture.
49
- */
50
- warnings: string[];
51
- /** Empty field. Render nothing rather than a zero score, which reads as a failure. */
52
- empty: boolean;
53
- }
54
- interface EstimateOptions {
55
- /**
56
- * Values the visitor has already typed elsewhere - email, name, company. A password
57
- * containing one of them is guessable by anyone who has the sign-up form in front of
58
- * them, and no character-class rule catches it.
59
- */
60
- userInputs?: string[];
61
- }
62
- /**
63
- * Score a password.
64
- *
65
- * The bits are an estimate and the bands are a convention, not a measurement - they exist
66
- * to move a bar, not to certify anything. Swap this out for zxcvbn where the number has to
67
- * mean something, and check the breach corpus for the cases no estimator can see.
68
- */
69
- declare function estimatePasswordStrength(password: string, options?: EstimateOptions): PasswordStrengthReport;
70
-
71
- export { type EstimateOptions as E, type GeneratePasswordOptions as G, type PasswordAlphabet as P, type PasswordScore as a, type PasswordStrengthReport as b, estimatePasswordStrength as e, generatePassword as g };
File without changes