@sharadox/graphical-user-interface-web-library 0.2.0-development.11 → 0.2.0-development.21
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/README.md +9 -0
- package/distribution/avatar/index.d.ts +20 -0
- package/distribution/avatar/index.d.ts.map +1 -0
- package/distribution/avatar/index.js +35 -0
- package/distribution/avatar/index.js.map +1 -0
- package/distribution/avatar/index.module.css +1 -0
- package/distribution/avatar/index.module.scss +16 -0
- package/distribution/avatar/type.d.ts +9 -0
- package/distribution/avatar/type.d.ts.map +1 -0
- package/distribution/avatar/type.js +2 -0
- package/distribution/avatar/type.js.map +1 -0
- package/distribution/badge/index.d.ts +10 -0
- package/distribution/badge/index.d.ts.map +1 -0
- package/distribution/badge/index.js +15 -0
- package/distribution/badge/index.js.map +1 -0
- package/distribution/badge/index.module.css +1 -0
- package/distribution/badge/index.module.scss +7 -0
- package/distribution/badge/type.d.ts +4 -0
- package/distribution/badge/type.d.ts.map +1 -0
- package/distribution/badge/type.js +2 -0
- package/distribution/badge/type.js.map +1 -0
- package/distribution/card/index.d.ts +11 -0
- package/distribution/card/index.d.ts.map +1 -0
- package/distribution/card/index.js +18 -0
- package/distribution/card/index.js.map +1 -0
- package/distribution/card/index.module.css +1 -0
- package/distribution/card/index.module.scss +22 -0
- package/distribution/card/type.d.ts +15 -0
- package/distribution/card/type.d.ts.map +1 -0
- package/distribution/card/type.js +2 -0
- package/distribution/card/type.js.map +1 -0
- package/distribution/combobox/index.d.ts +18 -0
- package/distribution/combobox/index.d.ts.map +1 -0
- package/distribution/combobox/index.js +105 -0
- package/distribution/combobox/index.js.map +1 -0
- package/distribution/combobox/index.module.css +1 -0
- package/distribution/combobox/index.module.scss +25 -0
- package/distribution/combobox/type.d.ts +8 -0
- package/distribution/combobox/type.d.ts.map +1 -0
- package/distribution/combobox/type.js +2 -0
- package/distribution/combobox/type.js.map +1 -0
- package/distribution/field/index.d.ts +1 -1
- package/distribution/field/index.d.ts.map +1 -1
- package/distribution/field/index.js +2 -2
- package/distribution/field/index.js.map +1 -1
- package/distribution/listbox/index.d.ts +11 -0
- package/distribution/listbox/index.d.ts.map +1 -0
- package/distribution/listbox/index.js +21 -0
- package/distribution/listbox/index.js.map +1 -0
- package/distribution/listbox/index.module.css +1 -0
- package/distribution/listbox/index.module.scss +38 -0
- package/distribution/listbox/type.d.ts +22 -0
- package/distribution/listbox/type.d.ts.map +1 -0
- package/distribution/listbox/type.js +2 -0
- package/distribution/listbox/type.js.map +1 -0
- package/distribution/number-field/index.d.ts +10 -0
- package/distribution/number-field/index.d.ts.map +1 -0
- package/distribution/number-field/index.js +46 -0
- package/distribution/number-field/index.js.map +1 -0
- package/distribution/number-field/index.module.css +1 -0
- package/distribution/number-field/index.module.scss +29 -0
- package/distribution/number-field/type.d.ts +29 -0
- package/distribution/number-field/type.d.ts.map +1 -0
- package/distribution/number-field/type.js +2 -0
- package/distribution/number-field/type.js.map +1 -0
- package/distribution/select/index.d.ts +13 -0
- package/distribution/select/index.d.ts.map +1 -0
- package/distribution/select/index.js +102 -0
- package/distribution/select/index.js.map +1 -0
- package/distribution/select/index.module.css +1 -0
- package/distribution/select/index.module.scss +42 -0
- package/distribution/select/type.d.ts +25 -0
- package/distribution/select/type.d.ts.map +1 -0
- package/distribution/select/type.js +2 -0
- package/distribution/select/type.js.map +1 -0
- package/distribution/separator/index.d.ts +11 -0
- package/distribution/separator/index.d.ts.map +1 -0
- package/distribution/separator/index.js +16 -0
- package/distribution/separator/index.js.map +1 -0
- package/distribution/separator/index.module.css +1 -0
- package/distribution/separator/index.module.scss +12 -0
- package/distribution/separator/type.d.ts +7 -0
- package/distribution/separator/type.d.ts.map +1 -0
- package/distribution/separator/type.js +2 -0
- package/distribution/separator/type.js.map +1 -0
- package/distribution/wrapper/index.d.ts +10 -0
- package/distribution/wrapper/index.d.ts.map +1 -0
- package/distribution/wrapper/index.js +15 -0
- package/distribution/wrapper/index.js.map +1 -0
- package/distribution/wrapper/index.module.css +1 -0
- package/distribution/wrapper/index.module.scss +8 -0
- package/distribution/wrapper/type.d.ts +4 -0
- package/distribution/wrapper/type.d.ts.map +1 -0
- package/distribution/wrapper/type.js +2 -0
- package/distribution/wrapper/type.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -96,6 +96,15 @@ everything below it: on the page, in one part of it, or on one piece.
|
|
|
96
96
|
| `…/checkbox` | `Checkbox({ label, checked?, defaultChecked?, onChange? })` | Outlined, filled once checked, the check growing in |
|
|
97
97
|
| `…/radio-group` | `RadioGroup({ label, options, value?, defaultValue?, onChange?, error? })` | Native radios sharing a name, round, filled once chosen |
|
|
98
98
|
| `…/switch` | `Switch({ label, checked?, defaultChecked?, onChange? })` | On/off; flips at once, busy while an async change runs, back if refused |
|
|
99
|
+
| `…/wrapper` | `Wrapper(box)` | The page's width: up to 1280, centered, 16 a side |
|
|
100
|
+
| `…/card` | `Card({ title?, headingLevel?, description?, action?, children })` | One thing: content on one side, its actions centered on the other |
|
|
101
|
+
| `…/separator` | `Separator({ orientation?, color?, line? })` | A horizontal (or vertical) line in the line style |
|
|
102
|
+
| `…/badge` | `Badge(box)` | A short label in running text: small, filled, brand |
|
|
103
|
+
| `…/avatar` | `Avatar({ name, src?, size?, color?, corner? })`, `initials(name)` | A picture, or the initials when there is none; round |
|
|
104
|
+
| `…/listbox` | `Listbox({ id, labelledBy, options, chosen, active, onActive, onChoose, empty? })` | The list a select or combobox opens: a glass panel, the chosen one checked |
|
|
105
|
+
| `…/select` | `Select({ label, options, value?, defaultValue?, onChange?, name?, placeholder? })` | A select drawn by the interface, with a native select's keyboard |
|
|
106
|
+
| `…/combobox` | `Combobox({ label, options, … , empty? })`, `matches(label, typed)` | A text field that filters its options as you type |
|
|
107
|
+
| `…/number-field` | `NumberField({ label, value?, min?, max?, step?, decreaseLabel, increaseLabel })` | A number between a minus and a plus section |
|
|
99
108
|
|
|
100
109
|
### Box
|
|
101
110
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AvatarProperties } from "@sharadox/graphical-user-interface-web-library/avatar/type";
|
|
2
|
+
/**
|
|
3
|
+
* A name's initials: the first letter of its first and last words, upper case.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* initials("Ana Maria Silva"); // "AS"
|
|
7
|
+
*/
|
|
8
|
+
export declare function initials(name: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* A person's (or a company's) picture: a square box of the size's height, round by default. Without a picture, or
|
|
11
|
+
* when it can't load, their initials on a filled box (brand by default). Either way it is an image named by `name`.
|
|
12
|
+
*
|
|
13
|
+
* The picture is a plain `img`: avatars come from anywhere (uploads, other services), which next/image would need
|
|
14
|
+
* each site to allow by address.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Avatar name="Ana Silva" src={account.picture} size="large" />
|
|
18
|
+
*/
|
|
19
|
+
export declare function Avatar({ name, src, color, corner, size, className, ...look }: AvatarProperties): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/avatar/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAGnG;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,EACH,KAAe,EACf,MAAiB,EACjB,IAAe,EACf,SAAS,EACT,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAsBlB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { classNames } from "@sharadox/web-library/class-name";
|
|
5
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
6
|
+
import styles from "./index.module.css";
|
|
7
|
+
/**
|
|
8
|
+
* A name's initials: the first letter of its first and last words, upper case.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* initials("Ana Maria Silva"); // "AS"
|
|
12
|
+
*/
|
|
13
|
+
export function initials(name) {
|
|
14
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
15
|
+
if (words.length === 0)
|
|
16
|
+
return "";
|
|
17
|
+
const letters = words.length === 1 ? [words[0]] : [words[0], words.at(-1)];
|
|
18
|
+
return letters.map((word) => [...word][0].toLocaleUpperCase()).join("");
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A person's (or a company's) picture: a square box of the size's height, round by default. Without a picture, or
|
|
22
|
+
* when it can't load, their initials on a filled box (brand by default). Either way it is an image named by `name`.
|
|
23
|
+
*
|
|
24
|
+
* The picture is a plain `img`: avatars come from anywhere (uploads, other services), which next/image would need
|
|
25
|
+
* each site to allow by address.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <Avatar name="Ana Silva" src={account.picture} size="large" />
|
|
29
|
+
*/
|
|
30
|
+
export function Avatar({ name, src, color = "brand", corner = "circle", size = "medium", className, ...look }) {
|
|
31
|
+
const [failed, setFailed] = useState(false);
|
|
32
|
+
const picture = src !== undefined && !failed;
|
|
33
|
+
return (_jsx(Box, { as: "span", square: true, corner: corner, size: size, color: color, ...look, ...(picture ? {} : { variant: "filled", role: "img", "aria-label": name }), className: classNames(styles.avatar, className), children: picture ? (_jsx("img", { src: src, alt: name, className: styles.picture, onError: () => setFailed(true) })) : (initials(name)) }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/avatar/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,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E,KAAK,KACR,IAAI,KACJ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAC3E,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAE9C,OAAO,CAAC,CAAC,CAAC,CAET,cAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,GAAI,CACxF,CAAC,CAAC,CAAC,CACF,QAAQ,CAAC,IAAI,CAAC,CACf,GACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:where(.avatar){overflow:hidden;inline-size:var(--current-minimum-size);block-size:var(--current-minimum-size);font-size:calc(var(--current-minimum-size)*.4);font-weight:600;line-height:1}:where(.picture){display:block;inline-size:100%;block-size:100%;object-fit:cover}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
:where(.avatar) {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
inline-size: var(--current-minimum-size);
|
|
4
|
+
block-size: var(--current-minimum-size);
|
|
5
|
+
// Two letters always fit: the initials grow with the avatar.
|
|
6
|
+
font-size: calc(var(--current-minimum-size) * 0.4);
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
line-height: 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where(.picture) {
|
|
12
|
+
display: block;
|
|
13
|
+
inline-size: 100%;
|
|
14
|
+
block-size: 100%;
|
|
15
|
+
object-fit: cover;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BoxLook } from "@sharadox/graphical-user-interface-web-library/box/type";
|
|
2
|
+
export interface AvatarProperties extends Pick<BoxLook, "color" | "colorStyle" | "corner" | "line" | "size"> {
|
|
3
|
+
/** Whose picture: its accessible name, and the initials without a picture. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** The picture's address; without one (or when it fails) the initials show. */
|
|
6
|
+
src?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/avatar/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yDAAyD,CAAC;AAEvF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1G,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/avatar/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BadgeProperties } from "@sharadox/graphical-user-interface-web-library/badge/type";
|
|
2
|
+
/**
|
|
3
|
+
* A badge: a short label (a status, a count, "New") sitting in running text. A small filled brand box by default,
|
|
4
|
+
* with every box look, a prefix and a suffix.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <Badge color="success" variant="outlined">Online</Badge>
|
|
8
|
+
*/
|
|
9
|
+
export declare function Badge({ className, ...box }: BadgeProperties): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/badge/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAGjG;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,EAAE,EAAE,eAAe,+BAY3D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@sharadox/web-library/class-name";
|
|
3
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
4
|
+
import styles from "./index.module.css";
|
|
5
|
+
/**
|
|
6
|
+
* A badge: a short label (a status, a count, "New") sitting in running text. A small filled brand box by default,
|
|
7
|
+
* with every box look, a prefix and a suffix.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Badge color="success" variant="outlined">Online</Badge>
|
|
11
|
+
*/
|
|
12
|
+
export function Badge({ className, ...box }) {
|
|
13
|
+
return (_jsx(Box, { as: "span", variant: "filled", color: "brand", size: "small", ...box, "data-badge": "", className: classNames(styles.badge, className) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/badge/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,EAAmB;IAC1D,OAAO,CACL,KAAC,GAAG,IACF,EAAE,EAAC,MAAM,EACT,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO,KACR,GAAG,gBACI,EAAE,EACb,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAC9C,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.badge{display:inline-flex;vertical-align:middle;padding-inline:var(--scale-8);white-space:nowrap}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/badge/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAE7F,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/badge/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CardProperties } from "@sharadox/graphical-user-interface-web-library/card/type";
|
|
2
|
+
/**
|
|
3
|
+
* A card: one thing on its own (a picture, a name, an identifier). Its title, description and content on one side,
|
|
4
|
+
* its action buttons on the other, centered on the card's height; they wrap under it when there is no room. An
|
|
5
|
+
* outlined foreground article by default (see-through, so glass), with every box look.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Card title="Email" description="Where sign-in codes go." action={<Button variant="outlined">Edit</Button>}>ana@example.com</Card>
|
|
9
|
+
*/
|
|
10
|
+
export declare function Card(properties: CardProperties): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/card/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAG/F;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,UAAU,EAAE,cAAc,+BA4B9C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@sharadox/web-library/class-name";
|
|
3
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
4
|
+
import styles from "./index.module.css";
|
|
5
|
+
/**
|
|
6
|
+
* A card: one thing on its own (a picture, a name, an identifier). Its title, description and content on one side,
|
|
7
|
+
* its action buttons on the other, centered on the card's height; they wrap under it when there is no room. An
|
|
8
|
+
* outlined foreground article by default (see-through, so glass), with every box look.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <Card title="Email" description="Where sign-in codes go." action={<Button variant="outlined">Edit</Button>}>ana@example.com</Card>
|
|
12
|
+
*/
|
|
13
|
+
export function Card(properties) {
|
|
14
|
+
const { title, headingLevel = 2, description, action, children, className, ...box } = properties;
|
|
15
|
+
const Heading = `h${headingLevel}`;
|
|
16
|
+
return (_jsxs(Box, { as: "article", variant: "outlined", color: "foreground", padding: 24, gap: 16, justify: "space-between", wrap: "wrap", textAlign: "start", ...box, className: classNames(styles.card, className), children: [_jsxs(Box, { direction: "top-to-bottom", align: "start", textAlign: "start", gap: 8, className: styles.body, children: [title !== undefined && _jsx(Heading, { className: styles.title, children: title }), description !== undefined && _jsx("p", { className: styles.description, children: description }), children] }), action !== undefined && (_jsx(Box, { gap: 8, wrap: "wrap", className: styles.action, children: action }))] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/card/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,UAA0B;IAC7C,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,GAAG,EAAE,GAAG,UAAU,CAAC;IACjG,MAAM,OAAO,GAAG,IAAI,YAAY,EAAW,CAAC;IAC5C,OAAO,CACL,MAAC,GAAG,IACF,EAAE,EAAC,SAAS,EACZ,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,YAAY,EAClB,OAAO,EAAE,EAAE,EACX,GAAG,EAAE,EAAE,EACP,OAAO,EAAC,eAAe,EACvB,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,OAAO,KACb,GAAG,EACP,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,aAE7C,MAAC,GAAG,IAAC,SAAS,EAAC,eAAe,EAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,aAC1F,KAAK,KAAK,SAAS,IAAI,KAAC,OAAO,IAAC,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAW,EAC1E,WAAW,KAAK,SAAS,IAAI,YAAG,SAAS,EAAE,MAAM,CAAC,WAAW,YAAG,WAAW,GAAK,EAChF,QAAQ,IACL,EACL,MAAM,KAAK,SAAS,IAAI,CACvB,KAAC,GAAG,IAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,MAAM,YAC9C,MAAM,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:where(.body){flex:1 1 240px;min-inline-size:0}:where(.title){margin:0;font-size:var(--scale-16);font-weight:600}:where(.description){margin:0;color:inherit;opacity:.7;font-size:var(--scale-14)}:where(.action){flex:none}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
:where(.body) {
|
|
2
|
+
flex: 1 1 240px;
|
|
3
|
+
min-inline-size: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:where(.title) {
|
|
7
|
+
margin: 0;
|
|
8
|
+
font-size: var(--scale-16);
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where(.description) {
|
|
13
|
+
margin: 0;
|
|
14
|
+
// The card's own text, softened, so it reads on any fill.
|
|
15
|
+
color: inherit;
|
|
16
|
+
opacity: 0.7;
|
|
17
|
+
font-size: var(--scale-14);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where(.action) {
|
|
21
|
+
flex: none;
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { BoxProperties } from "@sharadox/graphical-user-interface-web-library/box/type";
|
|
3
|
+
export interface CardProperties extends Omit<BoxProperties, "title"> {
|
|
4
|
+
/** The card's heading. */
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
/** Its level (`h2` by default), to fit the page's outline. */
|
|
7
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
8
|
+
/** A line under the title. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** Buttons beside the content, centered on the card's height. */
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/card/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAE7F,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IAClE,0BAA0B;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,8BAA8B;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,iEAAiE;IACjE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/card/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComboboxProperties } from "@sharadox/graphical-user-interface-web-library/combobox/type";
|
|
2
|
+
/**
|
|
3
|
+
* Whether an option's words contain what was typed, ignoring case and accents.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* matches("Loulé", "loule"); // true
|
|
7
|
+
*/
|
|
8
|
+
export declare function matches(label: string, typed: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A combobox: a text field that filters its options as you type (ignoring case and accents) and opens a `Listbox`
|
|
11
|
+
* of the ones that match. The arrows, Home and End move, Enter chooses, Escape closes and puts back the chosen
|
|
12
|
+
* option's words, and a click outside closes. With a `name`, the chosen value goes in a hidden field for forms.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Combobox label="City" name="city" options={cities} empty="No city found." />
|
|
16
|
+
*/
|
|
17
|
+
export declare function Combobox(properties: ComboboxProperties): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/combobox/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAUvG;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,+BAqItD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { Icon } from "@sharadox/icon-web-library/icon";
|
|
5
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
6
|
+
import { Field } from "@sharadox/graphical-user-interface-web-library/field";
|
|
7
|
+
import { Listbox } from "@sharadox/graphical-user-interface-web-library/listbox";
|
|
8
|
+
import styles from "./index.module.css";
|
|
9
|
+
/** Lower case without accents, so "Loulé" is found by "loule". */
|
|
10
|
+
const plain = (text) => text
|
|
11
|
+
.normalize("NFD")
|
|
12
|
+
.replace(/\p{Diacritic}/gu, "")
|
|
13
|
+
.toLowerCase();
|
|
14
|
+
/**
|
|
15
|
+
* Whether an option's words contain what was typed, ignoring case and accents.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* matches("Loulé", "loule"); // true
|
|
19
|
+
*/
|
|
20
|
+
export function matches(label, typed) {
|
|
21
|
+
return plain(label).includes(plain(typed));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A combobox: a text field that filters its options as you type (ignoring case and accents) and opens a `Listbox`
|
|
25
|
+
* of the ones that match. The arrows, Home and End move, Enter chooses, Escape closes and puts back the chosen
|
|
26
|
+
* option's words, and a click outside closes. With a `name`, the chosen value goes in a hidden field for forms.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <Combobox label="City" name="city" options={cities} empty="No city found." />
|
|
30
|
+
*/
|
|
31
|
+
export function Combobox(properties) {
|
|
32
|
+
const { label, hideLabel, hint, error, options, value, defaultValue, onChange, name, placeholder, empty, disabled, state, id, className, color, ...look } = properties;
|
|
33
|
+
const [own, setOwn] = useState(defaultValue ?? "");
|
|
34
|
+
const chosen = value ?? own;
|
|
35
|
+
const words = (chosenValue) => options.find((option) => option.value === chosenValue)?.label ?? "";
|
|
36
|
+
const [typed, setTyped] = useState(() => words(chosen));
|
|
37
|
+
const [open, setOpen] = useState(false);
|
|
38
|
+
const [active, setActive] = useState(0);
|
|
39
|
+
const root = useRef(null);
|
|
40
|
+
// Until something new is typed, every option shows; then only those that match.
|
|
41
|
+
const shown = typed === words(chosen) ? options : options.filter((option) => matches(option.label, typed));
|
|
42
|
+
const show = () => {
|
|
43
|
+
if (disabled)
|
|
44
|
+
return;
|
|
45
|
+
setActive(0);
|
|
46
|
+
setOpen(true);
|
|
47
|
+
};
|
|
48
|
+
const close = () => {
|
|
49
|
+
setOpen(false);
|
|
50
|
+
setTyped(words(chosen));
|
|
51
|
+
};
|
|
52
|
+
const choose = (index) => {
|
|
53
|
+
const option = shown[index];
|
|
54
|
+
if (value === undefined)
|
|
55
|
+
setOwn(option.value);
|
|
56
|
+
onChange?.(option.value);
|
|
57
|
+
setTyped(option.label);
|
|
58
|
+
setOpen(false);
|
|
59
|
+
};
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!open)
|
|
62
|
+
return;
|
|
63
|
+
const outside = (event) => {
|
|
64
|
+
if (!root.current.contains(event.target))
|
|
65
|
+
close();
|
|
66
|
+
};
|
|
67
|
+
document.addEventListener("pointerdown", outside);
|
|
68
|
+
return () => document.removeEventListener("pointerdown", outside);
|
|
69
|
+
});
|
|
70
|
+
const keyDown = (event) => {
|
|
71
|
+
const { key } = event;
|
|
72
|
+
if (!open) {
|
|
73
|
+
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
show();
|
|
76
|
+
}
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const moves = {
|
|
80
|
+
ArrowDown: Math.min(shown.length - 1, active + 1),
|
|
81
|
+
ArrowUp: Math.max(0, active - 1),
|
|
82
|
+
Home: 0,
|
|
83
|
+
End: shown.length - 1,
|
|
84
|
+
};
|
|
85
|
+
if (key in moves) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
setActive(moves[key]);
|
|
88
|
+
}
|
|
89
|
+
else if (key === "Enter") {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
if (shown.length > 0)
|
|
92
|
+
choose(active);
|
|
93
|
+
}
|
|
94
|
+
else if (key === "Escape") {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
close();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return (_jsx(Field, { label: label, hideLabel: hideLabel, hint: hint, error: error, id: id, className: className, children: (control) => (_jsxs("div", { ref: root, className: styles.anchor, children: [name && _jsx("input", { type: "hidden", name: name, value: chosen }), _jsx(Box, { field: true, variant: "outlined", color: color ?? (error === undefined ? "middleground" : "error"), state: state ?? (disabled ? "disabled" : "enabled"), suffix: _jsx(Icon, { name: "chevron-down" }), ...look, children: _jsx("input", { ...control, type: "text", role: "combobox", autoComplete: "off", "aria-autocomplete": "list", "aria-expanded": open, "aria-controls": `${control.id}-list`, "aria-activedescendant": open && shown.length > 0 ? `${control.id}-list-${active}` : undefined, placeholder: placeholder, value: typed, disabled: disabled, onFocus: show, onChange: (event) => {
|
|
100
|
+
setTyped(event.target.value);
|
|
101
|
+
setActive(0);
|
|
102
|
+
setOpen(true);
|
|
103
|
+
}, onKeyDown: keyDown, className: styles.input }) }), open && (_jsx(Listbox, { id: `${control.id}-list`, labelledBy: `${control.id}-label`, options: shown, chosen: chosen, active: active, onActive: setActive, onChoose: choose, empty: empty }))] })) }));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/combobox/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC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AC;4BAC7B,SAAS,CAAC,CAAC,CAAC,CAAC;4BACb,OAAO,CAAC,IAAI,CAAC,CAAC;wBAChB,CAAC,EACD,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,MAAM,CAAC,KAAK,GACvB,GACE,EACL,IAAI,IAAI,CACP,KAAC,OAAO,IACN,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,OAAO,EACxB,UAAU,EAAE,GAAG,OAAO,CAAC,EAAE,QAAQ,EACjC,OAAO,EAAE,KAAK,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,GACZ,CACH,IACG,CACP,GACK,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:where(.anchor){position:relative;display:flex;flex-direction:column}:where(.input){box-sizing:border-box;inline-size:100%;min-inline-size:0;min-block-size:var(--section-minimum-size);margin:0;padding:0;border:0;outline:0;background:rgba(0,0,0,0);color:inherit;font:inherit;text-align:start}:where(.input)::placeholder{color:inherit;opacity:.6}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:where(.anchor) {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:where(.input) {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
inline-size: 100%;
|
|
10
|
+
min-inline-size: 0;
|
|
11
|
+
min-block-size: var(--section-minimum-size);
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
border: 0;
|
|
15
|
+
outline: 0;
|
|
16
|
+
background: transparent;
|
|
17
|
+
color: inherit;
|
|
18
|
+
font: inherit;
|
|
19
|
+
text-align: start;
|
|
20
|
+
|
|
21
|
+
&::placeholder {
|
|
22
|
+
color: inherit;
|
|
23
|
+
opacity: 0.6;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SelectProperties } from "@sharadox/graphical-user-interface-web-library/select/type";
|
|
2
|
+
export interface ComboboxProperties extends Omit<SelectProperties, "placeholder"> {
|
|
3
|
+
/** Shown in the empty input. */
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
/** Shown in the list when nothing matches what was typed. */
|
|
6
|
+
empty?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/combobox/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAEnG,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC;IAC/E,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/combobox/type.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import type { FieldProperties } from "@sharadox/graphical-user-interface-web-lib
|
|
|
2
2
|
/**
|
|
3
3
|
* A form control with its label above it and its hint and error under it, all linked for assistive technology: the
|
|
4
4
|
* label names the control, the hint and error describe it, and an error marks it invalid. The control is drawn by
|
|
5
|
-
* `children`, which receives the attributes to spread on it.
|
|
5
|
+
* `children`, which receives the attributes to spread on it. The label's id is the control's plus `-label`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* <Field label="Email" hint="We never share it." error={error}>{(control) => <input {...control} type="email" />}</Field>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAG/G;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAG/G;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAkChG"}
|
|
@@ -5,7 +5,7 @@ import styles from "./index.module.css";
|
|
|
5
5
|
/**
|
|
6
6
|
* A form control with its label above it and its hint and error under it, all linked for assistive technology: the
|
|
7
7
|
* label names the control, the hint and error describe it, and an error marks it invalid. The control is drawn by
|
|
8
|
-
* `children`, which receives the attributes to spread on it.
|
|
8
|
+
* `children`, which receives the attributes to spread on it. The label's id is the control's plus `-label`.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* <Field label="Email" hint="We never share it." error={error}>{(control) => <input {...control} type="email" />}</Field>
|
|
@@ -21,6 +21,6 @@ export function Field({ label, hideLabel, hint, error, id, className, children }
|
|
|
21
21
|
...(describedBy && { "aria-describedby": describedBy }),
|
|
22
22
|
...(error !== undefined && { "aria-invalid": true }),
|
|
23
23
|
};
|
|
24
|
-
return (_jsxs(Box, { direction: "top-to-bottom", align: "stretch", textAlign: "start", gap: 8, className: className, children: [_jsx("label", { htmlFor: controlId, className: styles.label, ...(hideLabel && { "data-hidden": "" }), children: label }), children(control), hint !== undefined && (_jsx(Box, { as: "p", id: hintId, color: "middleground", justify: "start", textAlign: "start", className: styles.message, children: hint })), error !== undefined && (_jsx(Box, { as: "p", id: errorId, color: "error", justify: "start", textAlign: "start", className: styles.message, children: error }))] }));
|
|
24
|
+
return (_jsxs(Box, { direction: "top-to-bottom", align: "stretch", textAlign: "start", gap: 8, className: className, children: [_jsx("label", { id: `${controlId}-label`, htmlFor: controlId, className: styles.label, ...(hideLabel && { "data-hidden": "" }), children: label }), children(control), hint !== undefined && (_jsx(Box, { as: "p", id: hintId, color: "middleground", justify: "start", textAlign: "start", className: styles.message, children: hint })), error !== undefined && (_jsx(Box, { as: "p", id: errorId, color: "error", justify: "start", textAlign: "start", className: styles.message, children: error }))] }));
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/field/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAmB;IAC/F,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC;IACrB,MAAM,SAAS,GAAG,EAAE,IAAI,IAAI,CAAC;IAC7B,MAAM,MAAM,GAAG,GAAG,SAAS,OAAO,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,SAAS,QAAQ,CAAC;IACrC,MAAM,WAAW,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7G,MAAM,OAAO,GAAiB;QAC5B,EAAE,EAAE,SAAS;QACb,GAAG,CAAC,WAAW,IAAI,EAAE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AAC,SAAS,EAAC,eAAe,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,OAAO,EAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,aAC3F,gBACE,EAAE,EAAE,GAAG,SAAS,QAAQ,EACxB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,MAAM,CAAC,KAAK,KACnB,CAAC,SAAS,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,YAEvC,KAAK,GACA,EACP,QAAQ,CAAC,OAAO,CAAC,EACjB,IAAI,KAAK,SAAS,IAAI,CACrB,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAC,SAAS,EAAE,MAAM,CAAC,OAAO,YACrG,IAAI,GACD,CACP,EACA,KAAK,KAAK,SAAS,IAAI,CACtB,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAC,SAAS,EAAE,MAAM,CAAC,OAAO,YAC/F,KAAK,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ListboxProperties } from "@sharadox/graphical-user-interface-web-library/listbox/type";
|
|
2
|
+
/**
|
|
3
|
+
* The list a select or a combobox opens, under its field: an outlined glass panel of options, the chosen one with a
|
|
4
|
+
* check, the keyboard's one lit (`aria-activedescendant` points at it, and it scrolls into view). The pointer moves
|
|
5
|
+
* the light; a click chooses. Focus stays on the field.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Listbox id={listId} labelledBy={labelId} options={options} chosen={value} active={active} onActive={setActive} onChoose={choose} />
|
|
9
|
+
*/
|
|
10
|
+
export declare function Listbox({ id, labelledBy, options, chosen, active, onActive, onChoose, empty }: ListboxProperties): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/listbox/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,+BAuChH"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { Icon } from "@sharadox/icon-web-library/icon";
|
|
4
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
5
|
+
import styles from "./index.module.css";
|
|
6
|
+
/**
|
|
7
|
+
* The list a select or a combobox opens, under its field: an outlined glass panel of options, the chosen one with a
|
|
8
|
+
* check, the keyboard's one lit (`aria-activedescendant` points at it, and it scrolls into view). The pointer moves
|
|
9
|
+
* the light; a click chooses. Focus stays on the field.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Listbox id={listId} labelledBy={labelId} options={options} chosen={value} active={active} onActive={setActive} onChoose={choose} />
|
|
13
|
+
*/
|
|
14
|
+
export function Listbox({ id, labelledBy, options, chosen, active, onActive, onChoose, empty }) {
|
|
15
|
+
const list = useRef(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
list.current?.querySelector("[data-active]")?.scrollIntoView?.({ block: "nearest" });
|
|
18
|
+
}, [active]);
|
|
19
|
+
return (_jsxs(Box, { as: "ul", ref: list, id: id, role: "listbox", "aria-labelledby": labelledBy, tabIndex: -1, variant: "outlined", color: "foreground", direction: "top-to-bottom", align: "stretch", padding: 4, className: styles.list, children: [options.length === 0 && empty !== undefined && _jsx("li", { className: styles.empty, children: empty }), options.map((option, index) => (_jsxs("li", { id: `${id}-${index}`, role: "option", "aria-selected": option.value === chosen, ...(index === active && { "data-active": "" }), className: styles.option, onPointerMove: () => onActive(index), onPointerDown: (event) => event.preventDefault(), onClick: () => onChoose(index), children: [option.label, option.value === chosen && _jsx(Icon, { name: "check" })] }, option.value)))] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/listbox/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAqB;IAC/G,MAAM,IAAI,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC5C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACvF,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,OAAO,CACL,MAAC,GAAG,IACF,EAAE,EAAC,IAAI,EACP,GAAG,EAAE,IAAI,EACT,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,SAAS,qBACG,UAAU,EAC3B,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,eAAe,EACzB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,MAAM,CAAC,IAAI,aAErB,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,SAAS,IAAI,aAAI,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAM,EACxF,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,cAEE,EAAE,EAAE,GAAG,EAAE,IAAI,KAAK,EAAE,EACpB,IAAI,EAAC,QAAQ,mBACE,MAAM,CAAC,KAAK,KAAK,MAAM,KAClC,CAAC,KAAK,KAAK,MAAM,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,EAC/C,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,aAAa,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EAChD,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAE7B,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,KAAK,MAAM,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,KAX5C,MAAM,CAAC,KAAK,CAYd,CACN,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.list{position:absolute;z-index:20;inset-block-start:calc(100% + var(--scale-4));inset-inline:0;max-block-size:280px;margin:0;overflow-y:auto;list-style:none;background:rgb(var(--background-color-rgb)/85%);scrollbar-width:thin;scrollbar-color:var(--foreground-border-color) rgba(0,0,0,0);overscroll-behavior:contain}:where(.option){display:flex;justify-content:space-between;align-items:center;gap:var(--scale-8);min-block-size:var(--current-minimum-size);padding-inline:var(--current-section-padding);border-radius:var(--corner-radius);cursor:pointer;text-align:start;transition:background-color var(--quick-duration) var(--easing)}:where(.option[data-active]){background:var(--current-transparent-hover-color)}:where(.empty){padding:var(--scale-8);color:var(--middleground-color);text-align:start}
|