@egen-civitas/esm-styleguide 5.2.2 → 5.2.4
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/CHANGELOG.md +12 -0
- package/dist/ui/password-input.d.ts +6 -2
- package/dist/ui/password-input.d.ts.map +1 -1
- package/dist/ui/password-input.js +3 -2
- package/dist/ui/search-input.d.ts +12 -2
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +3 -2
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @egen-civitas/esm-styleguide
|
|
2
2
|
|
|
3
|
+
## 5.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 99d1025: `@egen-civitas/esm-framework/mock` (et `mock-jest`) ré-exportent les composants de base du module style (`Button`, `Tile`, `Dialog`, `Table`…) : les tests des apps rendent les vrais composants (Tailwind, sans effet de bord). Pour cela, `@egen-civitas/esm-styleguide` expose un sous-chemin `./ui`.
|
|
8
|
+
|
|
9
|
+
## 5.2.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 939b9aa: `PasswordInput` et `SearchInput` transmettent leur `ref` à l'`<input>` (compatibilité `react-hook-form`, focus programmatique).
|
|
14
|
+
|
|
3
15
|
## 5.2.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type TextInputProps } from './text-input.js';
|
|
3
|
-
type PasswordInputProps = Omit<TextInputProps, 'type'> & {
|
|
3
|
+
type PasswordInputProps = Omit<TextInputProps, 'type' | 'ref'> & {
|
|
4
4
|
/** Libellés (déjà traduits) du bouton qui affiche / masque le mot de passe. */
|
|
5
5
|
showPasswordLabel?: string;
|
|
6
6
|
hidePasswordLabel?: string;
|
|
7
7
|
};
|
|
8
8
|
/** Champ mot de passe : `TextInput` avec un bouton œil pour afficher ou masquer la saisie. */
|
|
9
|
-
declare
|
|
9
|
+
declare const PasswordInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref" | "type"> & {
|
|
10
|
+
/** Libellés (déjà traduits) du bouton qui affiche / masque le mot de passe. */
|
|
11
|
+
showPasswordLabel?: string;
|
|
12
|
+
hidePasswordLabel?: string;
|
|
13
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
10
14
|
export { PasswordInput, type PasswordInputProps };
|
|
11
15
|
//# sourceMappingURL=password-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../src/ui/password-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../src/ui/password-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG;IAC/D,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,8FAA8F;AAC9F,QAAA,MAAM,aAAa;IANjB,+EAA+E;wBAC3D,MAAM;wBACN,MAAM;0CAwB1B,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,CAAC"}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
4
4
|
import { cn } from "./cn.js";
|
|
5
5
|
import { TextInput } from "./text-input.js";
|
|
6
|
-
/** Champ mot de passe : `TextInput` avec un bouton œil pour afficher ou masquer la saisie. */ function PasswordInput({ showPasswordLabel = 'Show password', hidePasswordLabel = 'Hide password', containerClassName, className, ...props }) {
|
|
6
|
+
/** Champ mot de passe : `TextInput` avec un bouton œil pour afficher ou masquer la saisie. */ const PasswordInput = /*#__PURE__*/ React.forwardRef(function PasswordInput({ showPasswordLabel = 'Show password', hidePasswordLabel = 'Hide password', containerClassName, className, ...props }, ref) {
|
|
7
7
|
const [visible, setVisible] = React.useState(false);
|
|
8
8
|
const toggleLabel = visible ? hidePasswordLabel : showPasswordLabel;
|
|
9
9
|
return /*#__PURE__*/ _jsxs("div", {
|
|
@@ -11,6 +11,7 @@ import { TextInput } from "./text-input.js";
|
|
|
11
11
|
children: [
|
|
12
12
|
/*#__PURE__*/ _jsx(TextInput, {
|
|
13
13
|
...props,
|
|
14
|
+
ref: ref,
|
|
14
15
|
containerClassName: "w-full",
|
|
15
16
|
type: visible ? 'text' : 'password',
|
|
16
17
|
className: cn('pr-10', className)
|
|
@@ -31,5 +32,5 @@ import { TextInput } from "./text-input.js";
|
|
|
31
32
|
})
|
|
32
33
|
]
|
|
33
34
|
});
|
|
34
|
-
}
|
|
35
|
+
});
|
|
35
36
|
export { PasswordInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type SearchInputProps = Omit<React.ComponentProps<'input'>, 'type' | 'value' | 'defaultValue' | 'onChange'> & {
|
|
2
|
+
type SearchInputProps = Omit<React.ComponentProps<'input'>, 'ref' | 'type' | 'value' | 'defaultValue' | 'onChange'> & {
|
|
3
3
|
/** Libellé accessible du champ (obligatoire : pas de libellé visible). */
|
|
4
4
|
label: string;
|
|
5
5
|
value?: string;
|
|
@@ -11,6 +11,16 @@ type SearchInputProps = Omit<React.ComponentProps<'input'>, 'type' | 'value' | '
|
|
|
11
11
|
containerClassName?: string;
|
|
12
12
|
};
|
|
13
13
|
/** Champ de recherche : icône loupe, bouton « effacer » dès qu'il y a une saisie, `Échap` vide le champ. */
|
|
14
|
-
declare
|
|
14
|
+
declare const SearchInput: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref" | "value" | "type" | "defaultValue" | "onChange"> & {
|
|
15
|
+
/** Libellé accessible du champ (obligatoire : pas de libellé visible). */
|
|
16
|
+
label: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** Reçoit la valeur saisie (pas l'événement). */
|
|
20
|
+
onValueChange?: (value: string) => void;
|
|
21
|
+
/** Libellé du bouton qui vide le champ. */
|
|
22
|
+
clearLabel?: string;
|
|
23
|
+
containerClassName?: string;
|
|
24
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
15
25
|
export { SearchInput, type SearchInputProps };
|
|
16
26
|
//# sourceMappingURL=search-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-input.d.ts","sourceRoot":"","sources":["../../src/ui/search-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"search-input.d.ts","sourceRoot":"","sources":["../../src/ui/search-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC,GAAG;IACpH,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,4GAA4G;AAC5G,QAAA,MAAM,WAAW;IAZf,0EAA0E;WACnE,MAAM;YACL,MAAM;mBACC,MAAM;IACrB,iDAAiD;oBACjC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IACvC,2CAA2C;iBAC9B,MAAM;yBACE,MAAM;0CAmD3B,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAC"}
|
package/dist/ui/search-input.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { SearchIcon, XIcon } from "lucide-react";
|
|
4
4
|
import { cn } from "./cn.js";
|
|
5
|
-
/** Champ de recherche : icône loupe, bouton « effacer » dès qu'il y a une saisie, `Échap` vide le champ. */ function SearchInput({ label, value, defaultValue = '', onValueChange, clearLabel = 'Clear search', className, containerClassName, onKeyDown, ...props }) {
|
|
5
|
+
/** Champ de recherche : icône loupe, bouton « effacer » dès qu'il y a une saisie, `Échap` vide le champ. */ const SearchInput = /*#__PURE__*/ React.forwardRef(function SearchInput({ label, value, defaultValue = '', onValueChange, clearLabel = 'Clear search', className, containerClassName, onKeyDown, ...props }, ref) {
|
|
6
6
|
const [inner, setInner] = React.useState(defaultValue);
|
|
7
7
|
const controlled = value !== undefined;
|
|
8
8
|
const current = controlled ? value : inner;
|
|
@@ -19,6 +19,7 @@ import { cn } from "./cn.js";
|
|
|
19
19
|
"aria-hidden": "true"
|
|
20
20
|
}),
|
|
21
21
|
/*#__PURE__*/ _jsx("input", {
|
|
22
|
+
ref: ref,
|
|
22
23
|
type: "search",
|
|
23
24
|
role: "searchbox",
|
|
24
25
|
"aria-label": label,
|
|
@@ -47,5 +48,5 @@ import { cn } from "./cn.js";
|
|
|
47
48
|
}) : null
|
|
48
49
|
]
|
|
49
50
|
});
|
|
50
|
-
}
|
|
51
|
+
});
|
|
51
52
|
export { SearchInput };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egen-civitas/esm-styleguide",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.4",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The styleguide for Egen SPA",
|
|
6
6
|
"main": "dist/internal.js",
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"./styles.css": {
|
|
39
39
|
"default": "./dist/styles.css"
|
|
40
|
+
},
|
|
41
|
+
"./ui": {
|
|
42
|
+
"types": "./dist/ui/index.d.ts",
|
|
43
|
+
"default": "./dist/ui/index.js"
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
46
|
"source": true,
|