@tangible/ui 0.2.46 → 0.2.47
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/components/PasswordStrength/PasswordStrength.d.ts +7 -0
- package/components/PasswordStrength/PasswordStrength.js +73 -0
- package/components/PasswordStrength/index.d.ts +3 -0
- package/components/PasswordStrength/index.js +2 -0
- package/components/PasswordStrength/types.d.ts +36 -0
- package/components/PasswordStrength/types.js +4 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -0
- package/figma-tokens.json +1 -1
- package/icons/icons.svg +1 -1
- package/icons/sprite-version.js +1 -1
- package/icons/sprite.php +1 -1
- package/package.json +5 -1
- package/skills/building-with-tui/SKILL.md +3 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +57 -0
- package/styles/all.expanded.unlayered.css +57 -0
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +2 -0
- package/styles/components/password-strength.scss +95 -0
- package/tui-manifest.json +76 -2
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
@use "./notice" as notice;
|
|
29
29
|
@use "./overlap-stack" as overlapstack;
|
|
30
30
|
@use "./password-input" as passwordinput;
|
|
31
|
+
@use "./password-strength" as passwordstrength;
|
|
31
32
|
@use "./pager" as pager;
|
|
32
33
|
@use "./popover" as popover;
|
|
33
34
|
@use "./radio" as radio;
|
|
@@ -122,6 +123,7 @@ $-input-dependents: (input, field, text-input, textarea, pager, search-input, se
|
|
|
122
123
|
// password-input wears .tui-input-group (pulled in above) and its reveal
|
|
123
124
|
// button is a system mixin, so it needs nothing else requested.
|
|
124
125
|
@if -wants($only, password-input) { @include passwordinput.styles(); }
|
|
126
|
+
@if -wants($only, password-strength) { @include passwordstrength.styles(); }
|
|
125
127
|
@if -wants($only, popover) { @include popover.styles(); }
|
|
126
128
|
@if -wants($only, radio) { @include radio.styles(); }
|
|
127
129
|
@if -wants($only, rating) { @include rating.styles(); }
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-password-strength-track
|
|
5
|
+
--tui-password-strength-weak
|
|
6
|
+
--tui-password-strength-fair
|
|
7
|
+
--tui-password-strength-strong
|
|
8
|
+
--tui-password-strength-bar-size
|
|
9
|
+
--tui-password-strength-gap
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// PasswordStrength Styles
|
|
14
|
+
// =============================================================================
|
|
15
|
+
//
|
|
16
|
+
// Four bars and a line of text. The bars are decoration: the words carry the
|
|
17
|
+
// score, so colour is never the only signal. `data-score` (0 to 4, absent
|
|
18
|
+
// when there's none) is the styling hook.
|
|
19
|
+
//
|
|
20
|
+
// Component API tokens (never defined here, only read via fallback):
|
|
21
|
+
// --tui-password-strength-track Unlit bar
|
|
22
|
+
// --tui-password-strength-weak Lit bars at scores 0 and 1
|
|
23
|
+
// --tui-password-strength-fair Lit bars at score 2
|
|
24
|
+
// --tui-password-strength-strong Lit bars at scores 3 and 4
|
|
25
|
+
// --tui-password-strength-bar-size Bar thickness
|
|
26
|
+
// --tui-password-strength-gap Between bars
|
|
27
|
+
//
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
@mixin styles() {
|
|
31
|
+
.#{sys.$prefix}interface .#{sys.$prefix}password-strength {
|
|
32
|
+
--_fill: var(--#{sys.$prefix}password-strength-weak, var(--#{sys.$prefix}theme-danger-base));
|
|
33
|
+
|
|
34
|
+
// No margin of its own: where it sits is the consumer's (className), and
|
|
35
|
+
// inside a Field the field's own gap spaces it
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: var(--#{sys.$prefix}spacing-xxs);
|
|
39
|
+
|
|
40
|
+
// Scores 0 and 1 are weak (the default above), 2 fair, 3 and 4 strong
|
|
41
|
+
&[data-score="2"] {
|
|
42
|
+
--_fill: var(--#{sys.$prefix}password-strength-fair, var(--#{sys.$prefix}theme-warning-base));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[data-score="3"],
|
|
46
|
+
&[data-score="4"] {
|
|
47
|
+
--_fill: var(--#{sys.$prefix}password-strength-strong, var(--#{sys.$prefix}theme-success-base));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.#{sys.$prefix}interface .#{sys.$prefix}password-strength__bars {
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
54
|
+
gap: var(--#{sys.$prefix}password-strength-gap, var(--#{sys.$prefix}spacing-xxs));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.#{sys.$prefix}interface .#{sys.$prefix}password-strength__bar {
|
|
58
|
+
block-size: var(--#{sys.$prefix}password-strength-bar-size, var(--#{sys.$prefix}spacing-xxs));
|
|
59
|
+
border-radius: var(--#{sys.$prefix}radius-full, 9999px);
|
|
60
|
+
background: var(--#{sys.$prefix}password-strength-track, var(--#{sys.$prefix}color-fill));
|
|
61
|
+
transition: background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
62
|
+
|
|
63
|
+
&[data-lit="true"] {
|
|
64
|
+
background: var(--_fill);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Backgrounds vanish under forced colours: draw the bars in system colours
|
|
68
|
+
@media (forced-colors: active) {
|
|
69
|
+
forced-color-adjust: none;
|
|
70
|
+
background: Canvas;
|
|
71
|
+
border: var(--#{sys.$prefix}border-width) solid GrayText;
|
|
72
|
+
|
|
73
|
+
&[data-lit="true"] {
|
|
74
|
+
background: CanvasText;
|
|
75
|
+
border-color: CanvasText;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.#{sys.$prefix}interface .#{sys.$prefix}password-strength__text {
|
|
81
|
+
margin: 0;
|
|
82
|
+
color: var(--#{sys.$prefix}color-fg-secondary);
|
|
83
|
+
font-size: var(--#{sys.$prefix}typography-size-sm);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.#{sys.$prefix}interface .#{sys.$prefix}password-strength__score {
|
|
87
|
+
color: var(--#{sys.$prefix}color-fg);
|
|
88
|
+
font-weight: var(--#{sys.$prefix}typography-weight-semibold);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Its own line under the score
|
|
92
|
+
.#{sys.$prefix}interface .#{sys.$prefix}password-strength__feedback {
|
|
93
|
+
display: block;
|
|
94
|
+
}
|
|
95
|
+
}
|
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
3
|
-
"generated": "2026-11-
|
|
2
|
+
"version": "0.2.47",
|
|
3
|
+
"generated": "2026-11-22T22:31:06.685Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -2868,6 +2868,80 @@
|
|
|
2868
2868
|
"use": null,
|
|
2869
2869
|
"notFor": null
|
|
2870
2870
|
},
|
|
2871
|
+
"PasswordStrength": {
|
|
2872
|
+
"props": {
|
|
2873
|
+
"className": {
|
|
2874
|
+
"type": "string",
|
|
2875
|
+
"required": false
|
|
2876
|
+
},
|
|
2877
|
+
"id": {
|
|
2878
|
+
"type": "string",
|
|
2879
|
+
"required": false
|
|
2880
|
+
},
|
|
2881
|
+
"style": {
|
|
2882
|
+
"type": "CSSProperties",
|
|
2883
|
+
"required": false
|
|
2884
|
+
},
|
|
2885
|
+
"title": {
|
|
2886
|
+
"type": "string",
|
|
2887
|
+
"required": false
|
|
2888
|
+
},
|
|
2889
|
+
"role": {
|
|
2890
|
+
"type": "AriaRole",
|
|
2891
|
+
"required": false
|
|
2892
|
+
},
|
|
2893
|
+
"rel": {
|
|
2894
|
+
"type": "string",
|
|
2895
|
+
"required": false
|
|
2896
|
+
},
|
|
2897
|
+
"onChange": {
|
|
2898
|
+
"type": "FormEventHandler<HTMLDivElement>",
|
|
2899
|
+
"required": false
|
|
2900
|
+
},
|
|
2901
|
+
"onClick": {
|
|
2902
|
+
"type": "MouseEventHandler<HTMLDivElement>",
|
|
2903
|
+
"required": false
|
|
2904
|
+
},
|
|
2905
|
+
"score": {
|
|
2906
|
+
"type": "0 | 1 | 2 | 3 | 4",
|
|
2907
|
+
"required": false,
|
|
2908
|
+
"description": "The estimate, 0 to 4. Leave it out while the field is empty, or while an\nestimator is still loading: the meter then shows no score and says\nnothing. Anything but a whole number from 0 to 4 counts as no score."
|
|
2909
|
+
},
|
|
2910
|
+
"feedback": {
|
|
2911
|
+
"type": "string",
|
|
2912
|
+
"required": false,
|
|
2913
|
+
"description": "What would make it stronger: \"Add another word or two.\""
|
|
2914
|
+
},
|
|
2915
|
+
"announce": {
|
|
2916
|
+
"type": "boolean",
|
|
2917
|
+
"required": false,
|
|
2918
|
+
"defaultValue": "true",
|
|
2919
|
+
"description": "Say the score through a polite live region a second after it settles on\na new value. Only the score: the hint is read with the field. Off, both\nare still read with the field, through `aria-describedby` on the input.\nRender the meter from the first paint, even with no score, so the region\nexists before it has anything to say."
|
|
2920
|
+
}
|
|
2921
|
+
},
|
|
2922
|
+
"cssTokens": [
|
|
2923
|
+
"--tui-password-strength-track",
|
|
2924
|
+
"--tui-password-strength-weak",
|
|
2925
|
+
"--tui-password-strength-fair",
|
|
2926
|
+
"--tui-password-strength-strong",
|
|
2927
|
+
"--tui-password-strength-bar-size",
|
|
2928
|
+
"--tui-password-strength-gap"
|
|
2929
|
+
],
|
|
2930
|
+
"story": {
|
|
2931
|
+
"title": "Forms/PasswordStrength",
|
|
2932
|
+
"tags": [
|
|
2933
|
+
"autodocs",
|
|
2934
|
+
"stable"
|
|
2935
|
+
]
|
|
2936
|
+
},
|
|
2937
|
+
"subcomponents": null,
|
|
2938
|
+
"description": null,
|
|
2939
|
+
"gotchas": null,
|
|
2940
|
+
"examples": null,
|
|
2941
|
+
"related": null,
|
|
2942
|
+
"use": null,
|
|
2943
|
+
"notFor": null
|
|
2944
|
+
},
|
|
2871
2945
|
"Popover": {
|
|
2872
2946
|
"props": {
|
|
2873
2947
|
"open": {
|