@tangible/ui 0.2.46 → 0.2.48

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.
@@ -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(); }
@@ -18,7 +18,7 @@
18
18
  // =============================================================================
19
19
 
20
20
  @mixin styles() {
21
- :where(.#{sys.$prefix}interface) .#{sys.$prefix}password-input__reveal {
21
+ .#{sys.$prefix}interface .#{sys.$prefix}password-input__reveal {
22
22
  @include sys.reveal-button(--#{sys.$prefix}password-input-button-radius);
23
23
  }
24
24
  }
@@ -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
+ }
@@ -30,8 +30,8 @@
30
30
 
31
31
  @mixin styles() {
32
32
  // Shared reset for both in-field buttons.
33
- :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__clear,
34
- :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__submit {
33
+ .#{sys.$prefix}interface .#{sys.$prefix}search-input__clear,
34
+ .#{sys.$prefix}interface .#{sys.$prefix}search-input__submit {
35
35
  display: inline-flex;
36
36
  align-items: center;
37
37
  justify-content: center;
@@ -73,7 +73,7 @@
73
73
  }
74
74
 
75
75
  // Clear (×): secondary affordance — muted at rest, brightens on interaction.
76
- :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__clear {
76
+ .#{sys.$prefix}interface .#{sys.$prefix}search-input__clear {
77
77
  opacity: 0.65;
78
78
 
79
79
  .#{sys.$prefix}icon {
@@ -96,7 +96,7 @@
96
96
  // Submit: the leading magnifier turned interactive. It should read like the
97
97
  // decorative prefix icon it replaces (same muted colour, full opacity), just
98
98
  // darkening on hover/focus to signal it's actionable.
99
- :where(.#{sys.$prefix}interface) .#{sys.$prefix}search-input__submit {
99
+ .#{sys.$prefix}interface .#{sys.$prefix}search-input__submit {
100
100
  color: var(--#{sys.$prefix}color-fg-secondary);
101
101
 
102
102
  .#{sys.$prefix}icon {
@@ -86,7 +86,7 @@
86
86
  }
87
87
 
88
88
  // Reveal toggle. Mirrors SearchInput's owned in-field buttons.
89
- :where(.#{sys.$prefix}interface) .#{sys.$prefix}secret-input__reveal {
89
+ .#{sys.$prefix}interface .#{sys.$prefix}secret-input__reveal {
90
90
  @include sys.reveal-button(--#{sys.$prefix}secret-input-button-radius);
91
91
  }
92
92
  }
@@ -32,7 +32,7 @@
32
32
  // buttons still have the 34px version — tracked as a follow-up.)
33
33
  margin-block: calc(-1 * var(--_py, var(--#{sys.$prefix}spacing-xxs)));
34
34
  border: 0;
35
- border-radius: var(#{$radius-token}, var(--#{sys.$prefix}radius-full, 999px));
35
+ border-radius: var(#{$radius-token}, var(--#{sys.$prefix}radius-full, 9999px));
36
36
  background: transparent;
37
37
  color: var(--#{sys.$prefix}color-fg-secondary);
38
38
  cursor: pointer;
package/tui-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.2.46",
3
- "generated": "2026-11-22T21:47:49.879Z",
2
+ "version": "0.2.48",
3
+ "generated": "2026-11-23T00:22:02.038Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -1235,7 +1235,7 @@
1235
1235
  "type": "ReactNode",
1236
1236
  "required": false,
1237
1237
  "defaultValue": "No results",
1238
- "description": "Shown in place of rows when `data` is empty."
1238
+ "description": "Shown in place of rows when `data` is empty. Plain text, or a small empty\nstate (a line and a \"Clear search\" button). It isn't a live region: when\nthe rows run out, the table's own status says so once, as `emptyMessage`\nif it's a string, else `labels.empty`. A full-page empty state belongs\noutside the table, in its place."
1239
1239
  },
1240
1240
  "labels": {
1241
1241
  "type": "DataTableLabels",
@@ -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": {