@godxjp/ui 31.30.0 → 31.30.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.
- package/agent/START-HERE.md +1 -1
- package/agent/components/PasswordStrength.json +6 -0
- package/agent/components.json +6 -0
- package/agent/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/dist/components/data-entry/password-strength.d.ts +7 -2
- package/dist/components/data-entry/password-strength.js +5 -4
- package/dist/contracts/measurement.json +1 -1
- package/dist/i18n/messages/en.json +1 -1
- package/dist/i18n/messages/ja.json +1 -1
- package/dist/i18n/messages/vi.json +1 -1
- package/dist/styles/layers.json +1 -1
- package/package.json +2 -2
package/agent/START-HERE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
You are about to write code against a design system you did not author. This file is the whole
|
|
4
4
|
contract. Read it before you write JSX.
|
|
5
5
|
|
|
6
|
-
**This catalog describes `@godxjp/ui` 31.30.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 31.30.1.** If the project you are editing has a different
|
|
7
7
|
version in its `package.json`, read the pinned catalog for THAT version instead
|
|
8
8
|
(`…/v<their-version>/agent/…`). A catalog newer than the installed package describes props that do
|
|
9
9
|
not exist yet; older, and it hides props that do. Neither failure announces itself.
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"name": "showChecklist",
|
|
22
22
|
"type": "boolean"
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"defaultValue": "8",
|
|
26
|
+
"description": "The length rule's threshold (gh#1193): drives the check, the score and the localized rule text (\"{n} 文字以上\" / \"{n}+ characters\"). Match the server's policy, e.g. 12 for Laravel Password::min(12), so the checklist never shows a password the server rejects as met.",
|
|
27
|
+
"name": "minLength",
|
|
28
|
+
"type": "number"
|
|
29
|
+
},
|
|
24
30
|
{
|
|
25
31
|
"description": "Every visible and screen-reader string, each optional (gh#1191). Unset entries come from the kit's own ja / en / vi catalogue for the active locale, so most apps pass nothing: the score words, the checklist line per rule (length / upper / lower / number / symbol), the sr-only passed / failed prefixes, and the polite live-region sentence (`announcement(strength)`). Pass only the ones your product words differently.",
|
|
26
32
|
"name": "labels",
|
package/agent/components.json
CHANGED
|
@@ -13037,6 +13037,12 @@
|
|
|
13037
13037
|
"name": "showChecklist",
|
|
13038
13038
|
"type": "boolean"
|
|
13039
13039
|
},
|
|
13040
|
+
{
|
|
13041
|
+
"defaultValue": "8",
|
|
13042
|
+
"description": "The length rule's threshold (gh#1193): drives the check, the score and the localized rule text (\"{n} 文字以上\" / \"{n}+ characters\"). Match the server's policy, e.g. 12 for Laravel Password::min(12), so the checklist never shows a password the server rejects as met.",
|
|
13043
|
+
"name": "minLength",
|
|
13044
|
+
"type": "number"
|
|
13045
|
+
},
|
|
13040
13046
|
{
|
|
13041
13047
|
"description": "Every visible and screen-reader string, each optional (gh#1191). Unset entries come from the kit's own ja / en / vi catalogue for the active locale, so most apps pass nothing: the score words, the checklist line per rule (length / upper / lower / number / symbol), the sr-only passed / failed prefixes, and the polite live-region sentence (`announcement(strength)`). Pass only the ones your product words differently.",
|
|
13042
13048
|
"name": "labels",
|
package/agent/index.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"note": "Pin to the tag that matches the @godxjp/ui version you installed. A catalog newer than your package describes props you do not have; older, and it hides props you do.",
|
|
49
49
|
"read": {
|
|
50
50
|
"live": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/index.json",
|
|
51
|
-
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.30.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.30.1/agent/index.json"
|
|
52
52
|
},
|
|
53
53
|
"source": "mcp/src/data — the same data @godxjp/ui-mcp serves — plus the foundation and semantic token tiers, read from src/tokens/*.css",
|
|
54
54
|
"start": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/START-HERE.md",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"foundation": "the seeds a consumer is invited to set — --primary, --background, --radius",
|
|
63
63
|
"semantic": "named roles that follow the seeds — --ring, --text-link, --overlay-background"
|
|
64
64
|
},
|
|
65
|
-
"version": "31.30.
|
|
65
|
+
"version": "31.30.1"
|
|
66
66
|
}
|
package/agent/llms.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @godxjp/ui
|
|
2
2
|
|
|
3
3
|
> A Japanese-enterprise React design system: 185 components, 2176 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.30.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.30.1.
|
|
5
5
|
|
|
6
6
|
If your client can run a process, do not read these files — run the MCP server instead
|
|
7
|
-
(`npx @godxjp/ui-mcp@31.30.
|
|
7
|
+
(`npx @godxjp/ui-mcp@31.30.1`). It is searchable and version-locked. These files exist for agents
|
|
8
8
|
that can only fetch URLs.
|
|
9
9
|
|
|
10
10
|
## Start
|
|
@@ -26,7 +26,7 @@ that can only fetch URLs.
|
|
|
26
26
|
## Pinning
|
|
27
27
|
|
|
28
28
|
Every URL above tracks `main`. To pin to the release a project actually installed, swap `main` for
|
|
29
|
-
the tag: `.../godx-jp/godxjp-ui/v31.30.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v31.30.1/agent/...`. A catalog that does not match the installed
|
|
30
30
|
package describes props that are absent, or hides props that are present, and says nothing either way.
|
|
31
31
|
|
|
32
32
|
Pinned catalogs only exist for releases whose tag actually contains `agent/`. If `…/v<version>/agent/index.json` returns 404, that release predates this catalog: read `…/main/…` instead and compare `index.json` → `version` against the package you have, so you at least know which way it drifted.
|
|
@@ -19,6 +19,11 @@ export type PasswordStrengthLabels = {
|
|
|
19
19
|
};
|
|
20
20
|
export type PasswordStrengthProps = {
|
|
21
21
|
value: string;
|
|
22
|
+
/**
|
|
23
|
+
* The length rule's threshold (gh#1193), so the checklist matches the server's policy, e.g. 12 for
|
|
24
|
+
* Laravel `Password::min(12)`. Default 8. It drives the check, the score and the rule text.
|
|
25
|
+
*/
|
|
26
|
+
minLength?: number;
|
|
22
27
|
rules?: PasswordRule[];
|
|
23
28
|
showChecklist?: boolean;
|
|
24
29
|
labels?: PasswordStrengthLabels;
|
|
@@ -27,6 +32,6 @@ export type PasswordStrengthReturn = {
|
|
|
27
32
|
score: 0 | 1 | 2 | 3 | 4;
|
|
28
33
|
checks: Record<PasswordRule, boolean>;
|
|
29
34
|
};
|
|
30
|
-
export declare function usePasswordStrength(value: string, rules?: PasswordRule[]): PasswordStrengthReturn;
|
|
31
|
-
export declare function PasswordStrength({ value, rules, showChecklist, labels, }: PasswordStrengthProps): import("react").JSX.Element;
|
|
35
|
+
export declare function usePasswordStrength(value: string, rules?: PasswordRule[], minLength?: number): PasswordStrengthReturn;
|
|
36
|
+
export declare function PasswordStrength({ value, minLength, rules, showChecklist, labels, }: PasswordStrengthProps): import("react").JSX.Element;
|
|
32
37
|
export {};
|
|
@@ -3,10 +3,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Check, X } from "lucide-react";
|
|
4
4
|
import { useTranslation } from "../../i18n/use-translation.js";
|
|
5
5
|
const DEFAULT_PASSWORD_RULES = ["length", "upper", "lower", "number", "symbol"];
|
|
6
|
-
function usePasswordStrength(value, rules = [...DEFAULT_PASSWORD_RULES]) {
|
|
6
|
+
function usePasswordStrength(value, rules = [...DEFAULT_PASSWORD_RULES], minLength = 8) {
|
|
7
7
|
const uniqueRules = [...new Set(rules)];
|
|
8
8
|
const checks = {
|
|
9
|
-
length: value.length >=
|
|
9
|
+
length: value.length >= minLength,
|
|
10
10
|
upper: /[A-Z]/.test(value),
|
|
11
11
|
lower: /[a-z]/.test(value),
|
|
12
12
|
number: /\d/.test(value),
|
|
@@ -28,18 +28,19 @@ function scoreKey(score) {
|
|
|
28
28
|
}
|
|
29
29
|
function PasswordStrength({
|
|
30
30
|
value,
|
|
31
|
+
minLength = 8,
|
|
31
32
|
rules = [...DEFAULT_PASSWORD_RULES],
|
|
32
33
|
showChecklist = true,
|
|
33
34
|
labels = {}
|
|
34
35
|
}) {
|
|
35
36
|
const { t } = useTranslation();
|
|
36
37
|
const normalizedRules = [...new Set(rules)];
|
|
37
|
-
const { score, checks } = usePasswordStrength(value, normalizedRules);
|
|
38
|
+
const { score, checks } = usePasswordStrength(value, normalizedRules, minLength);
|
|
38
39
|
const tone = scoreTone(score);
|
|
39
40
|
const segments = Array.from({ length: 5 });
|
|
40
41
|
const key = scoreKey(score);
|
|
41
42
|
const strength = labels[key] ?? t(`dataEntry.passwordStrength.${key}`);
|
|
42
|
-
const ruleLabel = (rule) => labels.rules?.[rule] ?? t(`dataEntry.passwordStrength.rules.${rule}
|
|
43
|
+
const ruleLabel = (rule) => labels.rules?.[rule] ?? t(`dataEntry.passwordStrength.rules.${rule}`, { n: String(minLength) });
|
|
43
44
|
const announcement = labels.announcement ? labels.announcement(strength) : t("dataEntry.passwordStrength.announcement", { strength });
|
|
44
45
|
return /* @__PURE__ */ jsxs("div", { className: "ui-password-strength", children: [
|
|
45
46
|
/* @__PURE__ */ jsx(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "AUTO-GENERATED by scripts/gen-measurement-contract.mjs — do not edit. Read this instead of guessing: docs/MEASUREMENT-CONTRACT.md.",
|
|
3
|
-
"version": "31.30.
|
|
3
|
+
"version": "31.30.1",
|
|
4
4
|
"targetSize": {
|
|
5
5
|
"standard": "WCAG 2.2 SC 2.5.8 Target Size (Minimum), level AA — 24×24 CSS px",
|
|
6
6
|
"min": 24,
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"failed": "Not yet: ",
|
|
251
251
|
"announcement": "Password strength: {strength}",
|
|
252
252
|
"rules": {
|
|
253
|
-
"length": "
|
|
253
|
+
"length": "{n}+ characters",
|
|
254
254
|
"upper": "Contains uppercase letter",
|
|
255
255
|
"lower": "Contains lowercase letter",
|
|
256
256
|
"number": "Contains number",
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
"failed": "Chưa đạt: ",
|
|
248
248
|
"announcement": "Độ mạnh mật khẩu: {strength}",
|
|
249
249
|
"rules": {
|
|
250
|
-
"length": "Tối thiểu
|
|
250
|
+
"length": "Tối thiểu {n} ký tự",
|
|
251
251
|
"upper": "Có chữ in hoa",
|
|
252
252
|
"lower": "Có chữ thường",
|
|
253
253
|
"number": "Có chữ số",
|
package/dist/styles/layers.json
CHANGED