@handamade/psi-react 0.8.0 → 0.9.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.
- package/dist/IconButton/IconButton.d.ts +4 -0
- package/dist/IconButton/IconButton.d.ts.map +1 -1
- package/dist/Input/Input.d.ts +8 -2
- package/dist/Input/Input.d.ts.map +1 -1
- package/dist/Menu/Menu.d.ts +7 -0
- package/dist/Menu/Menu.d.ts.map +1 -1
- package/dist/index.js +161 -160
- package/dist/manifest.json +15 -1
- package/dist/patterns.json +455 -5
- package/dist/styles.css +1 -1
- package/docs/IconButton.md +1 -0
- package/docs/Input.md +1 -0
- package/docs/Menu.md +1 -1
- package/llms.txt +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,10 @@ import type { ButtonHTMLAttributes, Ref } from "react";
|
|
|
2
2
|
type Variant = "accent" | "neutral" | "ghost" | "danger";
|
|
3
3
|
type Size = 24 | 32 | 40 | 48;
|
|
4
4
|
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
/** Accessible name for the icon-only control. Required: an IconButton has
|
|
6
|
+
* no text to name it, so omitting this ships an unnameable button (D60).
|
|
7
|
+
* If you also pass `aria-labelledby`, that wins per the accname algorithm. */
|
|
8
|
+
"aria-label": string;
|
|
5
9
|
/** Visual variant. @default "neutral" */
|
|
6
10
|
variant?: Variant;
|
|
7
11
|
/** Square size in px (24 | 32 | 40 | 48). @default 32 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EAEpB,GAAG,EACJ,MAAM,OAAO,CAAC;AAGf,KAAK,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AACzD,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,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;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CAClD;AAgBD;gDACgD;AAChD,wBAAgB,UAAU,CAAC,EACzB,OAAmB,EACnB,IAAS,EACT,IAAI,EACJ,MAAM,EACN,GAAG,EACH,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+BA0CjB"}
|
package/dist/Input/Input.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { InputHTMLAttributes, Ref } from "react";
|
|
2
2
|
type Size = 24 | 32 | 40 | 48;
|
|
3
|
-
|
|
3
|
+
/** Input types Psi's Input supports. Deliberately narrower than the native
|
|
4
|
+
* `HTMLInputTypeAttribute`: checkbox/radio/file/submit are separate controls
|
|
5
|
+
* (Checkbox, Switch, Button), not variants of a text field (D60). */
|
|
6
|
+
export type InputType = "text" | "search" | "email" | "tel" | "url" | "password" | "number" | "date";
|
|
7
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
8
|
+
/** Input type. @default "text" */
|
|
9
|
+
type?: InputType;
|
|
4
10
|
/** Height in px (24 | 32 | 40 | 48). @default 32 */
|
|
5
11
|
size?: Size;
|
|
6
12
|
/** Show error styling. Inside a Field, the Field's error also lights this. @default false */
|
|
@@ -11,6 +17,6 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
11
17
|
/** Single-line text input with pixel-true heights (24–48) and an error state.
|
|
12
18
|
* Inside a Field, id/aria-describedby/aria-invalid/required are wired
|
|
13
19
|
* automatically (D49). */
|
|
14
|
-
export declare function Input({ size, error, className, ref, ...rest }: InputProps): import("react").JSX.Element;
|
|
20
|
+
export declare function Input({ size, error, type, className, ref, ...rest }: InputProps): import("react").JSX.Element;
|
|
15
21
|
export {};
|
|
16
22
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAItD,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9B,MAAM,WAAW,UAAW,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAItD,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9B;;qEAEqE;AACrE,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,QAAQ,GACR,OAAO,GACP,KAAK,GACL,KAAK,GACL,UAAU,GACV,QAAQ,GACR,MAAM,CAAC;AAEX,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACrF,kCAAkC;IAClC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oDAAoD;IACpD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,6FAA6F;IAC7F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AASD;;0BAE0B;AAC1B,wBAAgB,KAAK,CAAC,EAAE,IAAS,EAAE,KAAa,EAAE,IAAa,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,+BAsBrG"}
|
package/dist/Menu/Menu.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export interface MenuProps {
|
|
|
15
15
|
* light dismiss is performed by the browser before it tells us, so by the
|
|
16
16
|
* time that reason is reported the popover is already closed. Flipping
|
|
17
17
|
* `open` to false is still required, to keep React's state in step.
|
|
18
|
+
*
|
|
19
|
+
* Invariant (D58): a dismissal is only ever reported for a menu that is
|
|
20
|
+
* currently open according to its own `open` prop. The platform can close
|
|
21
|
+
* an auto popover before the consumer's state catches up — clicking another
|
|
22
|
+
* menu's trigger light-dismisses this one before the consumer's click
|
|
23
|
+
* handler runs — and a report for an already-closed menu would clear a
|
|
24
|
+
* selection that has since moved on.
|
|
18
25
|
*/
|
|
19
26
|
onClose: (reason: "esc" | "outside" | "item-select") => void;
|
|
20
27
|
/**
|
package/dist/Menu/Menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../src/Menu/Menu.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAK1D,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,WAAW,2CAAuD,CAAC;AAEhF,MAAM,WAAW,SAAS;IACxB,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAC;IACd
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../src/Menu/Menu.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAK1D,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAA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