@sharadox/interface-web-library 0.0.0-stage → 0.1.0-development.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.
Files changed (124) hide show
  1. package/LICENCA.md +76 -0
  2. package/LICENSE.md +76 -0
  3. package/NOTICE.md +3 -0
  4. package/README.md +68 -2
  5. package/distribution/button/index.d.ts +10 -0
  6. package/distribution/button/index.d.ts.map +1 -0
  7. package/distribution/button/index.js +15 -0
  8. package/distribution/button/index.js.map +1 -0
  9. package/distribution/button/index.module.css +1 -0
  10. package/distribution/button/index.module.scss +78 -0
  11. package/distribution/button/type.d.ts +12 -0
  12. package/distribution/button/type.d.ts.map +1 -0
  13. package/distribution/button/type.js +2 -0
  14. package/distribution/button/type.js.map +1 -0
  15. package/distribution/card/index.d.ts +10 -0
  16. package/distribution/card/index.d.ts.map +1 -0
  17. package/distribution/card/index.js +14 -0
  18. package/distribution/card/index.js.map +1 -0
  19. package/distribution/card/index.module.css +1 -0
  20. package/distribution/card/index.module.scss +31 -0
  21. package/distribution/card/type.d.ts +9 -0
  22. package/distribution/card/type.d.ts.map +1 -0
  23. package/distribution/card/type.js +2 -0
  24. package/distribution/card/type.js.map +1 -0
  25. package/distribution/code-boxes/index.d.ts +11 -0
  26. package/distribution/code-boxes/index.d.ts.map +1 -0
  27. package/distribution/code-boxes/index.js +57 -0
  28. package/distribution/code-boxes/index.js.map +1 -0
  29. package/distribution/code-boxes/index.module.css +1 -0
  30. package/distribution/code-boxes/index.module.scss +35 -0
  31. package/distribution/code-boxes/type.d.ts +17 -0
  32. package/distribution/code-boxes/type.d.ts.map +1 -0
  33. package/distribution/code-boxes/type.js +2 -0
  34. package/distribution/code-boxes/type.js.map +1 -0
  35. package/distribution/copy-button/index.d.ts +9 -0
  36. package/distribution/copy-button/index.d.ts.map +1 -0
  37. package/distribution/copy-button/index.js +26 -0
  38. package/distribution/copy-button/index.js.map +1 -0
  39. package/distribution/copy-button/index.module.css +1 -0
  40. package/distribution/copy-button/index.module.scss +24 -0
  41. package/distribution/copy-button/type.d.ts +11 -0
  42. package/distribution/copy-button/type.d.ts.map +1 -0
  43. package/distribution/copy-button/type.js +2 -0
  44. package/distribution/copy-button/type.js.map +1 -0
  45. package/distribution/dialog/index.d.ts +10 -0
  46. package/distribution/dialog/index.d.ts.map +1 -0
  47. package/distribution/dialog/index.js +31 -0
  48. package/distribution/dialog/index.js.map +1 -0
  49. package/distribution/dialog/index.module.css +1 -0
  50. package/distribution/dialog/index.module.scss +75 -0
  51. package/distribution/dialog/type.d.ts +11 -0
  52. package/distribution/dialog/type.d.ts.map +1 -0
  53. package/distribution/dialog/type.js +2 -0
  54. package/distribution/dialog/type.js.map +1 -0
  55. package/distribution/interface-theme/index.d.ts +18 -0
  56. package/distribution/interface-theme/index.d.ts.map +1 -0
  57. package/distribution/interface-theme/index.js +23 -0
  58. package/distribution/interface-theme/index.js.map +1 -0
  59. package/distribution/interface-theme/type.d.ts +43 -0
  60. package/distribution/interface-theme/type.d.ts.map +1 -0
  61. package/distribution/interface-theme/type.js +2 -0
  62. package/distribution/interface-theme/type.js.map +1 -0
  63. package/distribution/pending-mark/index.d.ts +10 -0
  64. package/distribution/pending-mark/index.d.ts.map +1 -0
  65. package/distribution/pending-mark/index.js +13 -0
  66. package/distribution/pending-mark/index.js.map +1 -0
  67. package/distribution/pending-mark/index.module.css +1 -0
  68. package/distribution/pending-mark/index.module.scss +30 -0
  69. package/distribution/pending-mark/type.d.ts +5 -0
  70. package/distribution/pending-mark/type.d.ts.map +1 -0
  71. package/distribution/pending-mark/type.js +2 -0
  72. package/distribution/pending-mark/type.js.map +1 -0
  73. package/distribution/skeleton/index.d.ts +10 -0
  74. package/distribution/skeleton/index.d.ts.map +1 -0
  75. package/distribution/skeleton/index.js +15 -0
  76. package/distribution/skeleton/index.js.map +1 -0
  77. package/distribution/skeleton/index.module.css +1 -0
  78. package/distribution/skeleton/index.module.scss +86 -0
  79. package/distribution/skeleton/type.d.ts +16 -0
  80. package/distribution/skeleton/type.d.ts.map +1 -0
  81. package/distribution/skeleton/type.js +2 -0
  82. package/distribution/skeleton/type.js.map +1 -0
  83. package/distribution/style/_interface.scss +108 -0
  84. package/distribution/switch/index.d.ts +10 -0
  85. package/distribution/switch/index.d.ts.map +1 -0
  86. package/distribution/switch/index.js +28 -0
  87. package/distribution/switch/index.js.map +1 -0
  88. package/distribution/switch/index.module.css +1 -0
  89. package/distribution/switch/index.module.scss +69 -0
  90. package/distribution/switch/type.d.ts +12 -0
  91. package/distribution/switch/type.d.ts.map +1 -0
  92. package/distribution/switch/type.js +2 -0
  93. package/distribution/switch/type.js.map +1 -0
  94. package/distribution/text-field/index.d.ts +11 -0
  95. package/distribution/text-field/index.d.ts.map +1 -0
  96. package/distribution/text-field/index.js +23 -0
  97. package/distribution/text-field/index.js.map +1 -0
  98. package/distribution/text-field/index.module.css +1 -0
  99. package/distribution/text-field/index.module.scss +81 -0
  100. package/distribution/text-field/type.d.ts +18 -0
  101. package/distribution/text-field/type.d.ts.map +1 -0
  102. package/distribution/text-field/type.js +2 -0
  103. package/distribution/text-field/type.js.map +1 -0
  104. package/distribution/tip/index.d.ts +10 -0
  105. package/distribution/tip/index.d.ts.map +1 -0
  106. package/distribution/tip/index.js +21 -0
  107. package/distribution/tip/index.js.map +1 -0
  108. package/distribution/tip/index.module.css +1 -0
  109. package/distribution/tip/index.module.scss +47 -0
  110. package/distribution/tip/type.d.ts +7 -0
  111. package/distribution/tip/type.d.ts.map +1 -0
  112. package/distribution/tip/type.js +2 -0
  113. package/distribution/tip/type.js.map +1 -0
  114. package/distribution/toast/index.d.ts +18 -0
  115. package/distribution/toast/index.d.ts.map +1 -0
  116. package/distribution/toast/index.js +45 -0
  117. package/distribution/toast/index.js.map +1 -0
  118. package/distribution/toast/index.module.css +1 -0
  119. package/distribution/toast/index.module.scss +74 -0
  120. package/distribution/toast/type.d.ts +20 -0
  121. package/distribution/toast/type.d.ts.map +1 -0
  122. package/distribution/toast/type.js +2 -0
  123. package/distribution/toast/type.js.map +1 -0
  124. package/package.json +99 -4
@@ -0,0 +1,108 @@
1
+ // The interface's look, from custom properties an application sets (`InterfaceTheme`), each with a plain default, so
2
+ // any application wears its own colors, corners and fonts without touching these styles.
3
+
4
+ $background: var(--interface-background, #ffffff);
5
+ $surface: var(--interface-surface, #f6f6f6);
6
+ $raised: var(--interface-surface-raised, #ffffff);
7
+ $text: var(--interface-text, #111111);
8
+ $soft: var(--interface-text-soft, #5e5e5e);
9
+ $line: var(--interface-line, #e5e5e5);
10
+ $accent: var(--interface-accent, #111111);
11
+ $accent-text: var(--interface-accent-text, #ffffff);
12
+ $danger: var(--interface-danger, #c0392b);
13
+ $success: var(--interface-success, #2e7d32);
14
+ $radius: var(--interface-radius, 12px);
15
+ $small-radius: var(--interface-small-radius, 8px);
16
+ $font: var(--interface-font, inherit);
17
+ $display: var(--interface-font-display, inherit);
18
+ $bar: var(--interface-bar-height, 64px);
19
+ $shadow: var(--interface-shadow, 0 12px 40px -12px rgb(0 0 0 / 25%));
20
+ // Fields and their labels, so a company can make them look like its own forms.
21
+ $field-background: var(--interface-field-background, #{$raised});
22
+ $field-border: var(--interface-field-border, #{$line});
23
+ $field-height: var(--interface-field-height, 42px);
24
+ $field-focus: var(--interface-field-focus, 0 0 0 1px #{$accent});
25
+ $label-size: var(--interface-label-size, 13px);
26
+ $label-spacing: var(--interface-label-spacing, normal);
27
+ $label-case: var(--interface-label-case, none);
28
+ $ease: cubic-bezier(0.22, 1, 0.36, 1);
29
+
30
+ /** Thin scrollbars in the line color, the same in every browser that styles them. */
31
+ @mixin scrollbar {
32
+ scrollbar-width: thin;
33
+ scrollbar-color: $line transparent;
34
+ &::-webkit-scrollbar {
35
+ width: 8px;
36
+ height: 8px;
37
+ }
38
+ &::-webkit-scrollbar-track {
39
+ background: transparent;
40
+ }
41
+ &::-webkit-scrollbar-thumb {
42
+ border: 2px solid transparent;
43
+ border-radius: 999px;
44
+ background: $line;
45
+ background-clip: padding-box;
46
+ }
47
+ &::-webkit-scrollbar-thumb:hover {
48
+ background-color: $soft;
49
+ }
50
+ }
51
+
52
+ /** The keyboard's focus ring. */
53
+ @mixin focus {
54
+ &:focus-visible {
55
+ outline: 2px solid $accent;
56
+ outline-offset: 2px;
57
+ }
58
+ }
59
+
60
+ /** A card: the surface every panel sits on. */
61
+ @mixin card {
62
+ border: 1px solid $line;
63
+ border-radius: $radius;
64
+ background: $raised;
65
+ }
66
+
67
+ /** Hidden but read aloud. */
68
+ @mixin visually-hidden {
69
+ position: absolute;
70
+ width: 1px;
71
+ height: 1px;
72
+ overflow: hidden;
73
+ clip-path: inset(50%);
74
+ white-space: nowrap;
75
+ }
76
+
77
+ /** A labelled control that isn't a text field (a select, a text area, a date): label above, outlined box. */
78
+ @mixin control-field {
79
+ display: grid;
80
+ gap: 6px;
81
+ min-width: 0;
82
+ > span {
83
+ color: $soft;
84
+ font-size: 13px;
85
+ font-weight: 600;
86
+ }
87
+ select,
88
+ textarea,
89
+ input {
90
+ min-height: 42px;
91
+ padding: 8px 12px;
92
+ border: 1px solid $line;
93
+ border-radius: $small-radius;
94
+ background: $raised;
95
+ color: $text;
96
+ font: inherit;
97
+ font-size: 15px;
98
+ &:focus {
99
+ border-color: $accent;
100
+ outline: 0;
101
+ box-shadow: 0 0 0 1px $accent;
102
+ }
103
+ }
104
+ textarea {
105
+ resize: vertical;
106
+ @include scrollbar;
107
+ }
108
+ }
@@ -0,0 +1,10 @@
1
+ import type { SwitchProperties } from "@sharadox/interface-web-library/switch/type";
2
+ /**
3
+ * An on/off switch (a button with the switch role, read as on or off). It flips the moment it's pressed, with a loader
4
+ * on its knob while the change runs, and flips back if the change fails (`onChange` answering false).
5
+ *
6
+ * @example
7
+ * <Switch label="Required at every sign-in" checked={required} onChange={(on) => save(on)} />
8
+ */
9
+ export declare function Switch({ label, checked, onChange, disabled }: SwitchProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/switch/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BA6B9E"}
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import styles from "./index.module.css";
5
+ /**
6
+ * An on/off switch (a button with the switch role, read as on or off). It flips the moment it's pressed, with a loader
7
+ * on its knob while the change runs, and flips back if the change fails (`onChange` answering false).
8
+ *
9
+ * @example
10
+ * <Switch label="Required at every sign-in" checked={required} onChange={(on) => save(on)} />
11
+ */
12
+ export function Switch({ label, checked, onChange, disabled }) {
13
+ const [pending, setPending] = useState(false);
14
+ // The value it was flipped to, kept until the page's own value changes (then that one is shown).
15
+ const [flipped, setFlipped] = useState(null);
16
+ const shown = flipped && flipped.from === checked ? flipped.value : checked;
17
+ return (_jsxs("button", { type: "button", role: "switch", "aria-checked": shown, "aria-busy": pending || undefined, className: styles.switch, disabled: disabled || pending, onClick: async () => {
18
+ const before = flipped;
19
+ setFlipped({ value: !shown, from: checked });
20
+ setPending(true);
21
+ const applied = await onChange(!shown);
22
+ setPending(false);
23
+ // Failed: back to what it showed before.
24
+ if (applied === false)
25
+ setFlipped(before);
26
+ }, children: [_jsx("span", { className: styles.track, "aria-hidden": "true", children: _jsx("span", { className: styles.thumb }) }), _jsx("span", { children: label })] }));
27
+ }
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/switch/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM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0;border:0;background:none;color:var(--interface-text, #111111);font:inherit;font-size:14px;text-align:left;cursor:pointer}.switch:focus-visible{outline:2px solid var(--interface-accent, #111111);outline-offset:2px}.switch:disabled{cursor:default;opacity:.6}.switch:disabled[aria-busy]{opacity:1;cursor:progress}.switch[aria-busy] .thumb::after{content:"";position:absolute;inset:2px;border:2px solid var(--interface-accent, #111111);border-right-color:rgba(0,0,0,0);border-radius:50%;animation:spin .7s linear infinite}.track{position:relative;flex:none;width:40px;height:22px;border-radius:999px;background:var(--interface-line, #e5e5e5);transition:background-color .2s}[aria-checked=true]>.track{background:var(--interface-accent, #111111)}.thumb{position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .25s cubic-bezier(0.22, 1, 0.36, 1)}[aria-checked=true]>.track>.thumb{transform:translateX(18px)}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion: reduce){.switch[aria-busy] .thumb::after{animation-duration:2s}}
@@ -0,0 +1,69 @@
1
+ @use "style/interface" as *;
2
+
3
+ .switch {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: 10px;
7
+ padding: 4px 0;
8
+ border: 0;
9
+ background: none;
10
+ color: $text;
11
+ font: inherit;
12
+ font-size: 14px;
13
+ text-align: left;
14
+ cursor: pointer;
15
+ @include focus;
16
+ &:disabled {
17
+ cursor: default;
18
+ opacity: 0.6;
19
+ }
20
+ &:disabled[aria-busy] {
21
+ opacity: 1;
22
+ cursor: progress;
23
+ }
24
+ &[aria-busy] .thumb::after {
25
+ content: "";
26
+ position: absolute;
27
+ inset: 2px;
28
+ border: 2px solid $accent;
29
+ border-right-color: transparent;
30
+ border-radius: 50%;
31
+ animation: spin 0.7s linear infinite;
32
+ }
33
+ }
34
+ .track {
35
+ position: relative;
36
+ flex: none;
37
+ width: 40px;
38
+ height: 22px;
39
+ border-radius: 999px;
40
+ background: $line;
41
+ transition: background-color 0.2s;
42
+ [aria-checked="true"] > & {
43
+ background: $accent;
44
+ }
45
+ }
46
+ .thumb {
47
+ position: absolute;
48
+ top: 3px;
49
+ left: 3px;
50
+ width: 16px;
51
+ height: 16px;
52
+ border-radius: 50%;
53
+ background: #ffffff;
54
+ box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
55
+ transition: transform 0.25s $ease;
56
+ [aria-checked="true"] > .track > & {
57
+ transform: translateX(18px);
58
+ }
59
+ }
60
+ @keyframes spin {
61
+ to {
62
+ transform: rotate(360deg);
63
+ }
64
+ }
65
+ @media (prefers-reduced-motion: reduce) {
66
+ .switch[aria-busy] .thumb::after {
67
+ animation-duration: 2s;
68
+ }
69
+ }
@@ -0,0 +1,12 @@
1
+ export interface SwitchProperties {
2
+ /** What it switches ("Required at every sign-in"). */
3
+ label: string;
4
+ checked: boolean;
5
+ /**
6
+ * Runs the change (the switch already shows the new value, with a loader): false when it failed, so the switch flips
7
+ * back; anything else keeps it.
8
+ */
9
+ onChange: (checked: boolean) => Promise<boolean | unknown>;
10
+ disabled?: boolean;
11
+ }
12
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/switch/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/switch/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { TextFieldProperties } from "@sharadox/interface-web-library/text-field/type";
2
+ /**
3
+ * A labelled text field whose prefix and suffix are sections of their own, side by side with the typing area, so long
4
+ * values never run under them: `[@][identifier…][suffix]`. With a tip beside the label, a hint and an error below,
5
+ * all tied to the input for screen readers.
6
+ *
7
+ * @example
8
+ * <TextField label="Identifier" prefix="@" name="identifier" tip={{ label: "What's this?", text: "…" }} />
9
+ */
10
+ export declare function TextField({ label, tip, prefix, suffix, hint, error, className, id, ...input }: TextFieldProperties): import("react").JSX.Element;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/text-field/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAE3F;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAuClH"}
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId } from "react";
4
+ import { classNames } from "@sharadox/web-library/class-name";
5
+ import { Tip } from "@sharadox/interface-web-library/tip";
6
+ import styles from "./index.module.css";
7
+ /**
8
+ * A labelled text field whose prefix and suffix are sections of their own, side by side with the typing area, so long
9
+ * values never run under them: `[@][identifier…][suffix]`. With a tip beside the label, a hint and an error below,
10
+ * all tied to the input for screen readers.
11
+ *
12
+ * @example
13
+ * <TextField label="Identifier" prefix="@" name="identifier" tip={{ label: "What's this?", text: "…" }} />
14
+ */
15
+ export function TextField({ label, tip, prefix, suffix, hint, error, className, id, ...input }) {
16
+ const generated = useId();
17
+ const inputId = id ?? generated;
18
+ const hintId = `${inputId}-hint`;
19
+ const errorId = `${inputId}-error`;
20
+ const describedBy = [hint && hintId, error && errorId].filter(Boolean).join(" ") || undefined;
21
+ return (_jsxs("div", { className: classNames(styles.field, className), children: [_jsxs("span", { className: styles.label, children: [_jsx("label", { htmlFor: inputId, children: label }), tip && _jsx(Tip, { text: tip.text, label: tip.label })] }), _jsxs("span", { className: classNames(styles.group, error && styles.invalid), children: [prefix && (_jsx("span", { className: styles.prefix, "aria-hidden": "true", children: prefix })), _jsx("input", { ...input, id: inputId, className: styles.input, "aria-invalid": error ? true : undefined, "aria-describedby": describedBy }), suffix && _jsx("span", { className: styles.suffix, children: suffix })] }), hint && (_jsx("span", { id: hintId, className: styles.hint, children: hint })), error && (_jsx("span", { id: errorId, className: styles.error, role: "alert", children: error }))] }));
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/text-field/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAC1D,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,KAAK,EAAuB;IACjH,MAAM,SAAS,GAAG,KAAK,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAG,EAAE,IAAI,SAAS,CAAC;IAChC,MAAM,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC;IACjC,MAAM,OAAO,GAAG,GAAG,OAAO,QAAQ,CAAC;IACnC,MAAM,WAAW,GAAG,CAAC,IAAI,IAAI,MAAM,EAAE,KAAK,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IAC9F,OAAO,CACL,eAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,aACjD,gBAAM,SAAS,EAAE,MAAM,CAAC,KAAK,aAC3B,gBAAO,OAAO,EAAE,OAAO,YAAG,KAAK,GAAS,EACvC,GAAG,IAAI,KAAC,GAAG,IAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAI,IAC5C,EACP,gBAAM,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,aAC/D,MAAM,IAAI,CACT,eAAM,SAAS,EAAE,MAAM,CAAC,MAAM,iBAAc,MAAM,YAC/C,MAAM,GACF,CACR,EACD,mBACM,KAAK,EACT,EAAE,EAAE,OAAO,EACX,SAAS,EAAE,MAAM,CAAC,KAAK,kBACT,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,sBACpB,WAAW,GAC7B,EACD,MAAM,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,MAAM,YAAG,MAAM,GAAQ,IACrD,EACN,IAAI,IAAI,CACP,eAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,YACrC,IAAI,GACA,CACR,EACA,KAAK,IAAI,CACR,eAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAC,OAAO,YACrD,KAAK,GACD,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ :where(.field){display:grid;gap:6px;min-width:0}.label{display:inline-flex;align-items:center;gap:6px;color:var(--interface-text-soft, #5e5e5e);font-size:var(--interface-label-size, 13px);font-weight:600;letter-spacing:var(--interface-label-spacing, normal);text-transform:var(--interface-label-case, none)}.group{display:flex;align-items:stretch;min-width:0;border:1px solid var(--interface-field-border, var(--interface-line, #e5e5e5));border-radius:var(--interface-small-radius, 8px);background:var(--interface-field-background, var(--interface-surface-raised, #ffffff));overflow:hidden;transition:border-color .3s,box-shadow .4s}.group:hover{border-color:color-mix(in srgb, var(--interface-accent, #111111) 45%, transparent)}.group:focus-within{border-color:var(--interface-accent, #111111);box-shadow:var(--interface-field-focus, 0 0 0 1px var(--interface-accent, #111111))}.invalid{border-color:var(--interface-danger, #c0392b)}.prefix,.suffix{display:flex;flex:none;align-items:center;padding:0 12px;background:var(--interface-surface, #f6f6f6);color:var(--interface-text-soft, #5e5e5e);font-size:15px;user-select:none}.prefix{border-right:1px solid var(--interface-line, #e5e5e5)}.suffix{border-left:1px solid var(--interface-line, #e5e5e5)}.input{flex:1;min-width:0;min-height:var(--interface-field-height, 42px);padding:0 12px;border:0;outline:0;background:rgba(0,0,0,0);color:var(--interface-text, #111111);font:inherit;font-size:15px}.input::placeholder{color:var(--interface-text-soft, #5e5e5e)}.hint{color:var(--interface-text-soft, #5e5e5e);font-size:13px;line-height:1.5}.error{color:var(--interface-danger, #c0392b);font-size:13px;line-height:1.5}
@@ -0,0 +1,81 @@
1
+ @use "style/interface" as *;
2
+
3
+ :where(.field) {
4
+ display: grid;
5
+ gap: 6px;
6
+ min-width: 0;
7
+ }
8
+ .label {
9
+ display: inline-flex;
10
+ align-items: center;
11
+ gap: 6px;
12
+ color: $soft;
13
+ font-size: $label-size;
14
+ font-weight: 600;
15
+ letter-spacing: $label-spacing;
16
+ text-transform: $label-case;
17
+ }
18
+ .group {
19
+ display: flex;
20
+ align-items: stretch;
21
+ min-width: 0;
22
+ border: 1px solid $field-border;
23
+ border-radius: $small-radius;
24
+ background: $field-background;
25
+ overflow: hidden;
26
+ transition:
27
+ border-color 0.3s,
28
+ box-shadow 0.4s;
29
+ &:hover {
30
+ border-color: color-mix(in srgb, #{$accent} 45%, transparent);
31
+ }
32
+ &:focus-within {
33
+ border-color: $accent;
34
+ box-shadow: $field-focus;
35
+ }
36
+ }
37
+ .invalid {
38
+ border-color: $danger;
39
+ }
40
+ .prefix,
41
+ .suffix {
42
+ display: flex;
43
+ flex: none;
44
+ align-items: center;
45
+ padding: 0 12px;
46
+ background: $surface;
47
+ color: $soft;
48
+ font-size: 15px;
49
+ user-select: none;
50
+ }
51
+ .prefix {
52
+ border-right: 1px solid $line;
53
+ }
54
+ .suffix {
55
+ border-left: 1px solid $line;
56
+ }
57
+ .input {
58
+ flex: 1;
59
+ min-width: 0;
60
+ min-height: $field-height;
61
+ padding: 0 12px;
62
+ border: 0;
63
+ outline: 0;
64
+ background: transparent;
65
+ color: $text;
66
+ font: inherit;
67
+ font-size: 15px;
68
+ &::placeholder {
69
+ color: $soft;
70
+ }
71
+ }
72
+ .hint {
73
+ color: $soft;
74
+ font-size: 13px;
75
+ line-height: 1.5;
76
+ }
77
+ .error {
78
+ color: $danger;
79
+ font-size: 13px;
80
+ line-height: 1.5;
81
+ }
@@ -0,0 +1,18 @@
1
+ import type { InputHTMLAttributes, ReactNode } from "react";
2
+ export interface TextFieldProperties extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix"> {
3
+ label: string;
4
+ /** A tip beside the label (a question mark), with the words of its button. */
5
+ tip?: {
6
+ text: string;
7
+ label: string;
8
+ };
9
+ /** A fixed part before the typing, its own section of the field ("@"): never part of the value. */
10
+ prefix?: ReactNode;
11
+ /** A fixed part after the typing ("@example.com", a unit, a button). */
12
+ suffix?: ReactNode;
13
+ /** A line under the field. */
14
+ hint?: string;
15
+ /** What's wrong with the value; marks the field invalid. */
16
+ error?: string | null;
17
+ }
18
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/text-field/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAChG,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,mGAAmG;IACnG,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/text-field/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { TipProperties } from "@sharadox/interface-web-library/tip/type";
2
+ /**
3
+ * A small question mark beside a label that shows a tip on hover, on keyboard focus, or on a tap (phones). Escape
4
+ * hides it. The button is described by the tip, so screen readers hear it too.
5
+ *
6
+ * @example
7
+ * <label>Identifier <Tip label="What's this?" text="Like a username…" /></label>
8
+ */
9
+ export declare function Tip({ text, label }: TipProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/tip/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,aAAa,+BAyBjD"}
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId, useState } from "react";
4
+ import { Icon } from "@sharadox/icon-web-library/icon";
5
+ import styles from "./index.module.css";
6
+ /**
7
+ * A small question mark beside a label that shows a tip on hover, on keyboard focus, or on a tap (phones). Escape
8
+ * hides it. The button is described by the tip, so screen readers hear it too.
9
+ *
10
+ * @example
11
+ * <label>Identifier <Tip label="What's this?" text="Like a username…" /></label>
12
+ */
13
+ export function Tip({ text, label }) {
14
+ const [open, setOpen] = useState(false);
15
+ const id = useId();
16
+ return (_jsxs("span", { className: styles.tip, onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false), children: [_jsx("button", { type: "button", className: styles.button, "aria-label": label, "aria-describedby": id, "aria-expanded": open, onClick: () => setOpen(!open), onFocus: () => setOpen(true), onBlur: () => setOpen(false), onKeyDown: (event) => {
17
+ if (event.key === "Escape")
18
+ setOpen(false);
19
+ }, children: _jsx(Icon, { name: "question" }) }), _jsx("span", { id: id, role: "tooltip", className: styles.bubble, hidden: !open, children: text })] }));
20
+ }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/tip/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAiB;IAChD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,CACL,gBAAM,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,aAChG,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,gBACZ,KAAK,sBACC,EAAE,mBACL,IAAI,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC5B,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;oBACnB,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ;wBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC7C,CAAC,YAED,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,GAAG,GACjB,EACT,eAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,SAAS,EAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,YACjE,IAAI,GACA,IACF,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .tip{position:relative;display:inline-flex;vertical-align:middle}.button{display:inline-grid;place-items:center;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,0);color:var(--interface-text-soft, #5e5e5e);font-size:16px;cursor:help}.button:focus-visible{outline:2px solid var(--interface-accent, #111111);outline-offset:2px}.button:hover{color:var(--interface-text, #111111)}.bubble{position:absolute;bottom:calc(100% + 8px);left:50%;z-index:20;width:max-content;max-width:min(280px,80vw);padding:8px 12px;border:1px solid var(--interface-line, #e5e5e5);border-radius:var(--interface-small-radius, 8px);background:var(--interface-surface-raised, #ffffff);box-shadow:var(--interface-shadow, 0 12px 40px -12px rgba(0, 0, 0, 0.25));color:var(--interface-text, #111111);font-size:13px;font-weight:400;line-height:1.5;text-transform:none;letter-spacing:normal;transform:translateX(-50%)}.bubble[hidden]{display:none}
@@ -0,0 +1,47 @@
1
+ @use "style/interface" as *;
2
+
3
+ .tip {
4
+ position: relative;
5
+ display: inline-flex;
6
+ vertical-align: middle;
7
+ }
8
+ .button {
9
+ display: inline-grid;
10
+ place-items: center;
11
+ width: 20px;
12
+ height: 20px;
13
+ padding: 0;
14
+ border: 0;
15
+ border-radius: 50%;
16
+ background: transparent;
17
+ color: $soft;
18
+ font-size: 16px;
19
+ cursor: help;
20
+ @include focus;
21
+ &:hover {
22
+ color: $text;
23
+ }
24
+ }
25
+ .bubble {
26
+ position: absolute;
27
+ bottom: calc(100% + 8px);
28
+ left: 50%;
29
+ z-index: 20;
30
+ width: max-content;
31
+ max-width: min(280px, 80vw);
32
+ padding: 8px 12px;
33
+ border: 1px solid $line;
34
+ border-radius: $small-radius;
35
+ background: $raised;
36
+ box-shadow: $shadow;
37
+ color: $text;
38
+ font-size: 13px;
39
+ font-weight: 400;
40
+ line-height: 1.5;
41
+ text-transform: none;
42
+ letter-spacing: normal;
43
+ transform: translateX(-50%);
44
+ &[hidden] {
45
+ display: none;
46
+ }
47
+ }
@@ -0,0 +1,7 @@
1
+ export interface TipProperties {
2
+ /** The tip itself. */
3
+ text: string;
4
+ /** The button's name ("What's this?"). */
5
+ label: string;
6
+ }
7
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/tip/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/tip/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { ToastContextValue, ToastProviderProperties } from "@sharadox/interface-web-library/toast/type";
2
+ /**
3
+ * The notifications shown after each action, from anywhere under `ToastProvider`.
4
+ *
5
+ * @example
6
+ * const { notify } = useToast();
7
+ * notify("Saved.");
8
+ */
9
+ export declare function useToast(): ToastContextValue;
10
+ /**
11
+ * Shows a notification after every action, at the top right just below the site's bar (inside the page, under the
12
+ * profile picture): it goes after a few seconds, or when closed. At most four at once, newest last.
13
+ *
14
+ * @example
15
+ * <ToastProvider label="Notifications" dismissLabel="Dismiss">{children}</ToastProvider>
16
+ */
17
+ export declare function ToastProvider({ label, dismissLabel, duration, children }: ToastProviderProperties): import("react").JSX.Element;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/toast/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAS,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAIpH;;;;;;GAMG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAE5C;AAoCD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,QAAe,EAAE,QAAQ,EAAE,EAAE,uBAAuB,+BAqBxG"}
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
4
+ import { Icon } from "@sharadox/icon-web-library/icon";
5
+ import { classNames } from "@sharadox/web-library/class-name";
6
+ import styles from "./index.module.css";
7
+ const ToastContext = createContext({ notify: () => { } });
8
+ /**
9
+ * The notifications shown after each action, from anywhere under `ToastProvider`.
10
+ *
11
+ * @example
12
+ * const { notify } = useToast();
13
+ * notify("Saved.");
14
+ */
15
+ export function useToast() {
16
+ return useContext(ToastContext);
17
+ }
18
+ /** One notification: hides itself after `duration` (not while the pointer is on it), or with its close button. */
19
+ function ToastItem({ toast, duration, dismissLabel, onDismiss, }) {
20
+ const [paused, setPaused] = useState(false);
21
+ useEffect(() => {
22
+ if (paused)
23
+ return;
24
+ const timer = setTimeout(() => onDismiss(toast.id), toast.tone === "error" ? duration * 2 : duration);
25
+ return () => clearTimeout(timer);
26
+ }, [paused, toast, duration, onDismiss]);
27
+ return (_jsxs("div", { className: classNames(styles.toast, styles[toast.tone]), role: toast.tone === "error" ? "alert" : "status", onMouseEnter: () => setPaused(true), onMouseLeave: () => setPaused(false), children: [_jsx(Icon, { name: toast.tone === "error" ? "warning" : "check" }), _jsx("p", { children: toast.message }), _jsx("button", { type: "button", className: styles.close, "aria-label": dismissLabel, onClick: () => onDismiss(toast.id), children: _jsx(Icon, { name: "close" }) })] }));
28
+ }
29
+ /**
30
+ * Shows a notification after every action, at the top right just below the site's bar (inside the page, under the
31
+ * profile picture): it goes after a few seconds, or when closed. At most four at once, newest last.
32
+ *
33
+ * @example
34
+ * <ToastProvider label="Notifications" dismissLabel="Dismiss">{children}</ToastProvider>
35
+ */
36
+ export function ToastProvider({ label, dismissLabel, duration = 5000, children }) {
37
+ const [toasts, setToasts] = useState([]);
38
+ const next = useRef(0);
39
+ const dismiss = useCallback((id) => setToasts((all) => all.filter((toast) => toast.id !== id)), []);
40
+ const value = useMemo(() => ({
41
+ notify: (message, tone = "success") => setToasts((all) => [...all, { id: ++next.current, message, tone }].slice(-4)),
42
+ }), []);
43
+ return (_jsxs(ToastContext.Provider, { value: value, children: [children, _jsx("section", { className: styles.region, "aria-label": label, children: toasts.map((toast) => (_jsx(ToastItem, { toast: toast, duration: duration, dismissLabel: dismissLabel, onDismiss: dismiss }, toast.id))) })] }));
44
+ }
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/toast/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrG,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;A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AE,MAAM,CAAC,MAAM,gBAAc,KAAK,YACjD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,KAAC,SAAS,IAAgB,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,IAA1F,KAAK,CAAC,EAAE,CAAsF,CAC/G,CAAC,GACM,IACY,CACzB,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .region{position:fixed;top:calc(var(--interface-bar-height, 64px) + 12px);right:16px;z-index:60;display:grid;gap:8px;width:min(360px,100vw - 32px);pointer-events:none}.toast{display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:10px;padding:12px 12px 12px 14px;border:1px solid var(--interface-line, #e5e5e5);border-radius:var(--interface-radius, 12px);background:var(--interface-surface-raised, #ffffff);box-shadow:var(--interface-shadow, 0 12px 40px -12px rgba(0, 0, 0, 0.25));color:var(--interface-text, #111111);font-size:14px;line-height:1.5;pointer-events:auto;animation:arrive .35s cubic-bezier(0.22, 1, 0.36, 1)}.toast>svg{margin-top:2px;font-size:18px}.toast p{margin:0}.success>svg{color:var(--interface-success, #2e7d32)}.info>svg{color:var(--interface-accent, #111111)}.error{border-color:var(--interface-danger, #c0392b)}.error>svg{color:var(--interface-danger, #c0392b)}.close{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,0);color:var(--interface-text-soft, #5e5e5e);cursor:pointer}.close:focus-visible{outline:2px solid var(--interface-accent, #111111);outline-offset:2px}.close:hover{color:var(--interface-text, #111111)}@keyframes arrive{from{opacity:0;transform:translateY(-8px)}}@media(prefers-reduced-motion: reduce){.toast{animation:none}}