@sharadox/graphical-user-interface-web-library 0.2.0-development.11 → 0.2.0-development.16
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 +5 -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/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 +1 -1
package/README.md
CHANGED
|
@@ -96,6 +96,11 @@ 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 |
|
|
99
104
|
|
|
100
105
|
### Box
|
|
101
106
|
|
|
@@ -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,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,EACH,KAAK,GAAG,OAAO,EACf,MAAM,GAAG,QAAQ,EACjB,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,GAAG,IAAI,EACU;IACjB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,GAAG,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC;IAC7C,OAAO,CACL,KAAC,GAAG,IACF,EAAE,EAAC,MAAM,EACT,MAAM,QACN,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,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,11 @@
|
|
|
1
|
+
import type { SeparatorProperties } from "@sharadox/graphical-user-interface-web-library/separator/type";
|
|
2
|
+
/**
|
|
3
|
+
* A line between things: a horizontal rule by default, or vertical between items in a row. It is the color's border
|
|
4
|
+
* color (foreground's by default), in the line style and thickness.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <Separator />
|
|
8
|
+
* <Separator orientation="vertical" line="dashed" />
|
|
9
|
+
*/
|
|
10
|
+
export declare function Separator({ orientation, color, line, className }: SeparatorProperties): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/separator/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAC;AAGzG;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EAAE,WAA0B,EAAE,KAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,mBAAmB,+BASnH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@sharadox/web-library/class-name";
|
|
3
|
+
import { lookAttributes } from "@sharadox/graphical-user-interface-web-library/box";
|
|
4
|
+
import styles from "./index.module.css";
|
|
5
|
+
/**
|
|
6
|
+
* A line between things: a horizontal rule by default, or vertical between items in a row. It is the color's border
|
|
7
|
+
* color (foreground's by default), in the line style and thickness.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Separator />
|
|
11
|
+
* <Separator orientation="vertical" line="dashed" />
|
|
12
|
+
*/
|
|
13
|
+
export function Separator({ orientation = "horizontal", color = "foreground", line, className }) {
|
|
14
|
+
return (_jsx("hr", { ...lookAttributes({ color, line }), ...(orientation === "vertical" && { "aria-orientation": "vertical" }), "data-orientation": orientation, className: classNames(styles.separator, className) }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/separator/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AAEpF,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE,KAAK,GAAG,YAAY,EAAE,IAAI,EAAE,SAAS,EAAuB;IAClH,OAAO,CACL,gBACM,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,KAC/B,CAAC,WAAW,KAAK,UAAU,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC,sBACpD,WAAW,EAC7B,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAClD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:where(.separator){flex:none;align-self:stretch;margin:0;border:0;border-block-start:var(--line-thickness) var(--line-style) var(--current-border-color)}:where(.separator[data-orientation=vertical]){border-block-start:0;border-inline-start:var(--line-thickness) var(--line-style) var(--current-border-color)}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
:where(.separator) {
|
|
2
|
+
flex: none;
|
|
3
|
+
align-self: stretch;
|
|
4
|
+
margin: 0;
|
|
5
|
+
border: 0;
|
|
6
|
+
border-block-start: var(--line-thickness) var(--line-style) var(--current-border-color);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:where(.separator[data-orientation="vertical"]) {
|
|
10
|
+
border-block-start: 0;
|
|
11
|
+
border-inline-start: var(--line-thickness) var(--line-style) var(--current-border-color);
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BoxLook } from "@sharadox/graphical-user-interface-web-library/box/type";
|
|
2
|
+
export interface SeparatorProperties extends Pick<BoxLook, "color" | "line"> {
|
|
3
|
+
/** Across a column (`horizontal`, by default) or between items in a row (`vertical`). */
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/separator/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yDAAyD,CAAC;AAEvF,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1E,yFAAyF;IACzF,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/separator/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WrapperProperties } from "@sharadox/graphical-user-interface-web-library/wrapper/type";
|
|
2
|
+
/**
|
|
3
|
+
* The page's width: a box as wide as its container up to `--wrapper-width` (1280), centered, with
|
|
4
|
+
* `--wrapper-padding` (16) on each side, so content never touches the screen's edges. Any element and box look.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <Wrapper as="main" direction="top-to-bottom" gap={64}>…</Wrapper>
|
|
8
|
+
*/
|
|
9
|
+
export declare function Wrapper({ className, ...box }: WrapperProperties): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/wrapper/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,EAAE,EAAE,iBAAiB,+BAE/D"}
|
|
@@ -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
|
+
* The page's width: a box as wide as its container up to `--wrapper-width` (1280), centered, with
|
|
7
|
+
* `--wrapper-padding` (16) on each side, so content never touches the screen's edges. Any element and box look.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Wrapper as="main" direction="top-to-bottom" gap={64}>…</Wrapper>
|
|
11
|
+
*/
|
|
12
|
+
export function Wrapper({ className, ...box }) {
|
|
13
|
+
return _jsx(Box, { ...box, "data-wrapper": "", className: classNames(styles.wrapper, className) });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/wrapper/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,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,EAAqB;IAC9D,OAAO,KAAC,GAAG,OAAK,GAAG,kBAAe,EAAE,EAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAI,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.wrapper{box-sizing:border-box;inline-size:100%;max-inline-size:calc(var(--wrapper-width) + 2*var(--wrapper-padding));margin-inline:auto;padding-inline:var(--wrapper-padding)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// A plain class, so its width and padding beat the box's own (zero-weight) values.
|
|
2
|
+
.wrapper {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
inline-size: 100%;
|
|
5
|
+
max-inline-size: calc(var(--wrapper-width) + 2 * var(--wrapper-padding));
|
|
6
|
+
margin-inline: auto;
|
|
7
|
+
padding-inline: var(--wrapper-padding);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/wrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAE7F,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/wrapper/type.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/graphical-user-interface-web-library",
|
|
3
|
-
"version": "0.2.0-development.
|
|
3
|
+
"version": "0.2.0-development.16",
|
|
4
4
|
"description": "One generic, accessible, fully configurable component library: every interface piece in every variant, color, corner, line, size and state, styled from a single source of truth that each brand configures.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENCA.md",
|