@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,9 @@
1
+ import type { CopyButtonProperties } from "@sharadox/interface-web-library/copy-button/type";
2
+ /**
3
+ * Copies a value to the clipboard (a key, a set of recovery codes) and says so for two seconds, with a tick.
4
+ *
5
+ * @example
6
+ * <CopyButton value={secret} label="Copy" copiedLabel="Copied." />
7
+ */
8
+ export declare function CopyButton({ value, label, copiedLabel, onCopied }: CopyButtonProperties): import("react").JSX.Element;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/copy-button/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAE7F;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,oBAAoB,+BAqBvF"}
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { Icon } from "@sharadox/icon-web-library/icon";
5
+ import styles from "./index.module.css";
6
+ /**
7
+ * Copies a value to the clipboard (a key, a set of recovery codes) and says so for two seconds, with a tick.
8
+ *
9
+ * @example
10
+ * <CopyButton value={secret} label="Copy" copiedLabel="Copied." />
11
+ */
12
+ export function CopyButton({ value, label, copiedLabel, onCopied }) {
13
+ const [copied, setCopied] = useState(false);
14
+ useEffect(() => {
15
+ if (!copied)
16
+ return;
17
+ const timer = setTimeout(() => setCopied(false), 2000);
18
+ return () => clearTimeout(timer);
19
+ }, [copied]);
20
+ return (_jsxs("button", { type: "button", className: styles.button, onClick: async () => {
21
+ await navigator.clipboard.writeText(value);
22
+ setCopied(true);
23
+ onCopied?.();
24
+ }, children: [_jsx(Icon, { name: copied ? "check" : "copy" }), _jsx("span", { "aria-live": "polite", children: copied ? copiedLabel : label })] }));
25
+ }
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/copy-button/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAwB;IACtF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC3C,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,QAAQ,EAAE,EAAE,CAAC;QACf,CAAC,aAED,KAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAI,EACzC,4BAAgB,QAAQ,YAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,GAAQ,IACvD,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 10px;border:1px solid var(--interface-line, #e5e5e5);border-radius:var(--interface-small-radius, 8px);background:rgba(0,0,0,0);color:var(--interface-text, #111111);font:inherit;font-size:13px;font-weight:600;cursor:pointer}.button:focus-visible{outline:2px solid var(--interface-accent, #111111);outline-offset:2px}.button:hover{border-color:var(--interface-text-soft, #5e5e5e)}.button svg{font-size:16px}
@@ -0,0 +1,24 @@
1
+ @use "style/interface" as *;
2
+
3
+ .button {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: 6px;
7
+ min-height: 32px;
8
+ padding: 0 10px;
9
+ border: 1px solid $line;
10
+ border-radius: $small-radius;
11
+ background: transparent;
12
+ color: $text;
13
+ font: inherit;
14
+ font-size: 13px;
15
+ font-weight: 600;
16
+ cursor: pointer;
17
+ @include focus;
18
+ &:hover {
19
+ border-color: $soft;
20
+ }
21
+ svg {
22
+ font-size: 16px;
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ export interface CopyButtonProperties {
2
+ /** What is copied. */
3
+ value: string;
4
+ /** The button's words ("Copy", "Copy all"). */
5
+ label: string;
6
+ /** Said for 2 seconds once copied ("Copied."). */
7
+ copiedLabel: string;
8
+ /** After copying (to show a notification). */
9
+ onCopied?: () => void;
10
+ }
11
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/copy-button/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,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/copy-button/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { DialogProperties } from "@sharadox/interface-web-library/dialog/type";
2
+ /**
3
+ * A pop-up over the page (the browser's own modal dialog: focus stays inside, the page behind is inert), named by its
4
+ * title, closed by Escape, its close button or a click on the backdrop.
5
+ *
6
+ * @example
7
+ * <Dialog open={asking} onClose={() => setAsking(false)} title="Check your email" closeLabel="Close">…</Dialog>
8
+ */
9
+ export declare function Dialog({ open, onClose, title, closeLabel, children }: DialogProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/dialog/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAoCtF"}
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useId, useRef } from "react";
4
+ import { Icon } from "@sharadox/icon-web-library/icon";
5
+ import styles from "./index.module.css";
6
+ /**
7
+ * A pop-up over the page (the browser's own modal dialog: focus stays inside, the page behind is inert), named by its
8
+ * title, closed by Escape, its close button or a click on the backdrop.
9
+ *
10
+ * @example
11
+ * <Dialog open={asking} onClose={() => setAsking(false)} title="Check your email" closeLabel="Close">…</Dialog>
12
+ */
13
+ export function Dialog({ open, onClose, title, closeLabel, children }) {
14
+ const dialog = useRef(null);
15
+ const titleId = useId();
16
+ useEffect(() => {
17
+ const element = dialog.current;
18
+ if (open && !element.open)
19
+ element.showModal();
20
+ if (!open && element.open)
21
+ element.close();
22
+ }, [open]);
23
+ return (_jsx("dialog", { ref: dialog, className: styles.dialog, "aria-labelledby": titleId, onCancel: (event) => {
24
+ event.preventDefault();
25
+ onClose();
26
+ }, onClick: (event) => {
27
+ if (event.target === dialog.current)
28
+ onClose();
29
+ }, children: open && (_jsxs("div", { className: styles.inside, children: [_jsxs("header", { className: styles.header, children: [_jsx("h2", { id: titleId, className: styles.title, children: title }), _jsx("button", { type: "button", className: styles.close, "aria-label": closeLabel, onClick: onClose, children: _jsx(Icon, { name: "close" }) })] }), children] })) }));
30
+ }
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/dialog/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAoB;IACrF,MAAM,MAAM,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,MAAM,CAAC,OAAQ,CAAC;QAChC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;YAAE,OAAO,CAAC,SAAS,EAAE,CAAC;QAC/C,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI;YAAE,OAAO,CAAC,KAAK,EAAE,CAAC;IAC7C,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACX,OAAO,CACL,iBACE,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,CAAC,MAAM,qBACP,OAAO,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO;gBAAE,OAAO,EAAE,CAAC;QACjD,CAAC,YAEA,IAAI,IAAI,CACP,eAAK,SAAS,EAAE,MAAM,CAAC,MAAM,aAC3B,kBAAQ,SAAS,EAAE,MAAM,CAAC,MAAM,aAC9B,aAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,YACrC,KAAK,GACH,EACL,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,KAAK,gBAAc,UAAU,EAAE,OAAO,EAAE,OAAO,YACrF,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,IACF,EACR,QAAQ,IACL,CACP,GACM,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .dialog{position:fixed;inset:0;width:min(440px,100vw - 32px);height:fit-content;margin:auto;max-height:calc(100dvh - 32px);padding:0;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-family:var(--interface-font, inherit);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--interface-line, #e5e5e5) rgba(0,0,0,0)}.dialog::-webkit-scrollbar{width:8px;height:8px}.dialog::-webkit-scrollbar-track{background:rgba(0,0,0,0)}.dialog::-webkit-scrollbar-thumb{border:2px solid rgba(0,0,0,0);border-radius:999px;background:var(--interface-line, #e5e5e5);background-clip:padding-box}.dialog::-webkit-scrollbar-thumb:hover{background-color:var(--interface-text-soft, #5e5e5e)}.dialog::backdrop{background:rgba(0,0,0,.5);backdrop-filter:blur(4px)}.dialog[open]{animation:rise .3s cubic-bezier(0.22, 1, 0.36, 1)}.inside{display:grid;gap:16px;padding:20px}.header{display:flex;align-items:start;justify-content:space-between;gap:16px}.title{margin:0;font-family:var(--interface-font-display, inherit);font-size:20px;font-weight:600;line-height:1.3}.close{display:grid;flex:none;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,0);color:var(--interface-text-soft, #5e5e5e);font-size:18px;cursor:pointer}.close:focus-visible{outline:2px solid var(--interface-accent, #111111);outline-offset:2px}.close:hover{background:var(--interface-surface, #f6f6f6);color:var(--interface-text, #111111)}@keyframes rise{from{opacity:0;transform:translateY(8px) scale(0.98)}}@media(prefers-reduced-motion: reduce){.dialog[open]{animation:none}}
@@ -0,0 +1,75 @@
1
+ @use "style/interface" as *;
2
+
3
+ .dialog {
4
+ /* Always in the middle of the screen, whatever a site resets margins and positions to. */
5
+ position: fixed;
6
+ inset: 0;
7
+ width: min(440px, calc(100vw - 32px));
8
+ height: fit-content;
9
+ margin: auto;
10
+ max-height: calc(100dvh - 32px);
11
+ padding: 0;
12
+ border: 1px solid $line;
13
+ border-radius: $radius;
14
+ background: $raised;
15
+ box-shadow: $shadow;
16
+ color: $text;
17
+ font-family: $font;
18
+ overflow: auto;
19
+ @include scrollbar;
20
+ &::backdrop {
21
+ background: rgb(0 0 0 / 50%);
22
+ backdrop-filter: blur(4px);
23
+ }
24
+ &[open] {
25
+ animation: rise 0.3s $ease;
26
+ }
27
+ }
28
+ .inside {
29
+ display: grid;
30
+ gap: 16px;
31
+ padding: 20px;
32
+ }
33
+ .header {
34
+ display: flex;
35
+ align-items: start;
36
+ justify-content: space-between;
37
+ gap: 16px;
38
+ }
39
+ .title {
40
+ margin: 0;
41
+ font-family: $display;
42
+ font-size: 20px;
43
+ font-weight: 600;
44
+ line-height: 1.3;
45
+ }
46
+ .close {
47
+ display: grid;
48
+ flex: none;
49
+ place-items: center;
50
+ width: 32px;
51
+ height: 32px;
52
+ padding: 0;
53
+ border: 0;
54
+ border-radius: 50%;
55
+ background: transparent;
56
+ color: $soft;
57
+ font-size: 18px;
58
+ cursor: pointer;
59
+ @include focus;
60
+ &:hover {
61
+ background: $surface;
62
+ color: $text;
63
+ }
64
+ }
65
+ @keyframes rise {
66
+ from {
67
+ opacity: 0;
68
+ transform: translateY(8px) scale(0.98);
69
+ }
70
+ }
71
+ @media (prefers-reduced-motion: reduce) {
72
+ .dialog[open] {
73
+ animation: none;
74
+ }
75
+ }
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from "react";
2
+ export interface DialogProperties {
3
+ open: boolean;
4
+ /** Escape, the close button or a click on the backdrop. */
5
+ onClose: () => void;
6
+ title: string;
7
+ /** The close button's name ("Close"). */
8
+ closeLabel: string;
9
+ children: ReactNode;
10
+ }
11
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/dialog/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,2DAA2D;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/dialog/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { CSSProperties } from "react";
2
+ import type { InterfaceThemeProperties, InterfaceThemeValues } from "@sharadox/interface-web-library/interface-theme/type";
3
+ /**
4
+ * The custom properties that dress the interface in a company's look.
5
+ *
6
+ * @example
7
+ * interfaceThemeStyle({ accent: "var(--gold)" }); // { "--interface-accent": "var(--gold)" }
8
+ */
9
+ export declare function interfaceThemeStyle(theme: Partial<InterfaceThemeValues>): CSSProperties;
10
+ /**
11
+ * Wraps the interface in a company's look (colors, corners, fonts), with no global stylesheet: the values sit
12
+ * on this element as custom properties, which every piece of this library reads.
13
+ *
14
+ * @example
15
+ * <InterfaceTheme theme={{ accent: "var(--gold)", font: "var(--font-body)" }}>{children}</InterfaceTheme>
16
+ */
17
+ export declare function InterfaceTheme({ theme, children, className }: InterfaceThemeProperties): import("react").JSX.Element;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/interface-theme/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,sDAAsD,CAAC;AAK9D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAEvF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,wBAAwB,+BAMtF"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /** `surfaceRaised` → `--interface-surface-raised`. */
3
+ const property = (key) => `--interface-${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
4
+ /**
5
+ * The custom properties that dress the interface in a company's look.
6
+ *
7
+ * @example
8
+ * interfaceThemeStyle({ accent: "var(--gold)" }); // { "--interface-accent": "var(--gold)" }
9
+ */
10
+ export function interfaceThemeStyle(theme) {
11
+ return Object.fromEntries(Object.entries(theme).map(([key, value]) => [property(key), value]));
12
+ }
13
+ /**
14
+ * Wraps the interface in a company's look (colors, corners, fonts), with no global stylesheet: the values sit
15
+ * on this element as custom properties, which every piece of this library reads.
16
+ *
17
+ * @example
18
+ * <InterfaceTheme theme={{ accent: "var(--gold)", font: "var(--font-body)" }}>{children}</InterfaceTheme>
19
+ */
20
+ export function InterfaceTheme({ theme, children, className }) {
21
+ return (_jsx("div", { className: className, style: interfaceThemeStyle(theme), children: children }));
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/interface-theme/index.tsx"],"names":[],"mappings":";AAMA,sDAAsD;AACtD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,eAAe,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC;AAEjH;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAoC;IACtE,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAkB,CAAC;AAClH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAA4B;IACrF,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,YACzD,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { ReactNode } from "react";
2
+ /** A company's look for the interface ; anything left out keeps its plain default. */
3
+ export interface InterfaceThemeValues {
4
+ background: string;
5
+ /** Behind cards and panels. */
6
+ surface: string;
7
+ /** Cards, menus, dialogs. */
8
+ surfaceRaised: string;
9
+ text: string;
10
+ /** Labels, hints, secondary text. */
11
+ textSoft: string;
12
+ line: string;
13
+ /** Buttons, links, focus rings, selection. */
14
+ accent: string;
15
+ /** Text on the accent. */
16
+ accentText: string;
17
+ danger: string;
18
+ success: string;
19
+ radius: string;
20
+ smallRadius: string;
21
+ font: string;
22
+ /** Headings. */
23
+ fontDisplay: string;
24
+ /** The height of the site's fixed bar: notifications sit just below it. */
25
+ barHeight: string;
26
+ shadow: string;
27
+ /** Inside a field. */
28
+ fieldBackground: string;
29
+ fieldBorder: string;
30
+ fieldHeight: string;
31
+ /** The ring around a field being typed in (a box-shadow). */
32
+ fieldFocus: string;
33
+ /** Field labels: their size, letter spacing and case (`uppercase`). */
34
+ labelSize: string;
35
+ labelSpacing: string;
36
+ labelCase: string;
37
+ }
38
+ export interface InterfaceThemeProperties {
39
+ theme: Partial<InterfaceThemeValues>;
40
+ children: ReactNode;
41
+ className?: string;
42
+ }
43
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/interface-theme/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,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/interface-theme/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { PendingMarkProperties } from "@sharadox/interface-web-library/pending-mark/type";
2
+ /**
3
+ * A small spinner with what is happening ("Saving…"), beside a value already shown as it will be: the change is on
4
+ * its way. Read out politely by screen readers.
5
+ *
6
+ * @example
7
+ * <span>{name} <PendingMark label="Saving…" /></span>
8
+ */
9
+ export declare function PendingMark({ label }: PendingMarkProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/pending-mark/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAE/F;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE,qBAAqB,+BAO3D"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styles from "./index.module.css";
3
+ /**
4
+ * A small spinner with what is happening ("Saving…"), beside a value already shown as it will be: the change is on
5
+ * its way. Read out politely by screen readers.
6
+ *
7
+ * @example
8
+ * <span>{name} <PendingMark label="Saving…" /></span>
9
+ */
10
+ export function PendingMark({ label }) {
11
+ return (_jsxs("span", { className: styles.mark, role: "status", children: [_jsx("span", { className: styles.spinner, "aria-hidden": "true" }), label] }));
12
+ }
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/pending-mark/index.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAyB;IAC1D,OAAO,CACL,gBAAM,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,QAAQ,aACzC,eAAM,SAAS,EAAE,MAAM,CAAC,OAAO,iBAAc,MAAM,GAAG,EACrD,KAAK,IACD,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .mark{display:inline-flex;align-items:center;gap:6px;margin-left:10px;color:var(--interface-text-soft, #5e5e5e);font-size:13px;font-weight:500;vertical-align:middle}.spinner{width:12px;height:12px;border:2px solid var(--interface-accent, #111111);border-right-color:rgba(0,0,0,0);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion: reduce){.spinner{animation-duration:2.4s}}
@@ -0,0 +1,30 @@
1
+ @use "style/interface" as *;
2
+
3
+ .mark {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: 6px;
7
+ margin-left: 10px;
8
+ color: $soft;
9
+ font-size: 13px;
10
+ font-weight: 500;
11
+ vertical-align: middle;
12
+ }
13
+ .spinner {
14
+ width: 12px;
15
+ height: 12px;
16
+ border: 2px solid $accent;
17
+ border-right-color: transparent;
18
+ border-radius: 50%;
19
+ animation: spin 0.8s linear infinite;
20
+ }
21
+ @keyframes spin {
22
+ to {
23
+ transform: rotate(360deg);
24
+ }
25
+ }
26
+ @media (prefers-reduced-motion: reduce) {
27
+ .spinner {
28
+ animation-duration: 2.4s;
29
+ }
30
+ }
@@ -0,0 +1,5 @@
1
+ export interface PendingMarkProperties {
2
+ /** What is happening ("Saving…"). */
3
+ label: string;
4
+ }
5
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/pending-mark/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,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/pending-mark/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { SkeletonProperties } from "@sharadox/interface-web-library/skeleton/type";
2
+ /**
3
+ * Where data is still loading: soft gray shapes like what will come (lines, a card, a list of rows, a profile, a grid
4
+ * of cards), gently shimmering, so a page shows at once and fills in. Screen readers hear `label` once.
5
+ *
6
+ * @example
7
+ * <Suspense fallback={<Skeleton label="Loading devices…" shape="list" rows={3} />}><DeviceList /></Suspense>
8
+ */
9
+ export declare function Skeleton({ label, shape, lines, rows, height }: SkeletonProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/skeleton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAMxF;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAe,EAAE,KAAS,EAAE,IAAQ,EAAE,MAAM,EAAE,EAAE,kBAAkB,+BA+CnG"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styles from "./index.module.css";
3
+ const Line = ({ short }) => (_jsx("span", { "data-part": "line", className: short ? `${styles.line} ${styles.short}` : styles.line }));
4
+ /**
5
+ * Where data is still loading: soft gray shapes like what will come (lines, a card, a list of rows, a profile, a grid
6
+ * of cards), gently shimmering, so a page shows at once and fills in. Screen readers hear `label` once.
7
+ *
8
+ * @example
9
+ * <Suspense fallback={<Skeleton label="Loading devices…" shape="list" rows={3} />}><DeviceList /></Suspense>
10
+ */
11
+ export function Skeleton({ label, shape = "lines", lines = 3, rows = 3, height }) {
12
+ const text = Array.from({ length: lines }, (_, index) => (_jsx(Line, { short: index === lines - 1 && index > 0 }, index)));
13
+ return (_jsx("div", { className: styles.skeleton, role: "status", "aria-label": label, children: height ? (_jsx("span", { className: styles.block, style: { height } })) : shape === "lines" ? (text) : shape === "card" ? (_jsx("span", { "data-part": "card", className: styles.card, children: text })) : shape === "profile" ? (_jsxs("span", { "data-part": "card", className: `${styles.card} ${styles.profile}`, children: [_jsx("span", { "data-part": "circle", className: styles.circle }), _jsxs("span", { className: styles.stack, children: [_jsx(Line, { short: true }), _jsx(Line, {})] })] })) : shape === "cards" ? (_jsx("span", { className: styles.grid, children: Array.from({ length: rows }, (_, index) => (_jsxs("span", { "data-part": "card", className: styles.card, children: [_jsx(Line, { short: true }), _jsx(Line, {})] }, index))) })) : (_jsx("span", { "data-part": "card", className: styles.card, children: Array.from({ length: rows }, (_, index) => (_jsxs("span", { "data-part": "row", className: styles.row, children: [_jsx("span", { className: styles.dot }), _jsxs("span", { className: styles.stack, children: [_jsx(Line, {}), _jsx(Line, { short: true })] }), _jsx("span", { className: styles.button })] }, index))) })) }));
14
+ }
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/skeleton/index.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,EAAuB,EAAE,EAAE,CAAC,CAC/C,4BAAgB,MAAM,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,GAAI,CAC7F,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,MAAM,EAAsB;IAClG,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACvD,KAAC,IAAI,IAAa,KAAK,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAA9C,KAAK,CAA6C,CAC9D,CAAC,CAAC;IACH,OAAO,CACL,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAC,QAAQ,gBAAa,KAAK,YAC7D,MAAM,CAAC,CAAC,CAAC,CACR,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,GAAI,CACrD,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,CACtB,IAAI,CACL,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CACrB,4BAAgB,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,YAC1C,IAAI,GACA,CACR,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CACxB,6BAAgB,MAAM,EAAC,SAAS,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,aAClE,4BAAgB,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,MAAM,GAAI,EACrD,gBAAM,SAAS,EAAE,MAAM,CAAC,KAAK,aAC3B,KAAC,IAAI,IAAC,KAAK,SAAG,EACd,KAAC,IAAI,KAAG,IACH,IACF,CACR,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,CACtB,eAAM,SAAS,EAAE,MAAM,CAAC,IAAI,YACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,6BAA4B,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,aACvD,KAAC,IAAI,IAAC,KAAK,SAAG,EACd,KAAC,IAAI,KAAG,KAFC,KAAK,CAGT,CACR,CAAC,GACG,CACR,CAAC,CAAC,CAAC,CACF,4BAAgB,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,YAC1C,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,6BAA4B,KAAK,EAAC,SAAS,EAAE,MAAM,CAAC,GAAG,aACrD,eAAM,SAAS,EAAE,MAAM,CAAC,GAAG,GAAI,EAC/B,gBAAM,SAAS,EAAE,MAAM,CAAC,KAAK,aAC3B,KAAC,IAAI,KAAG,EACR,KAAC,IAAI,IAAC,KAAK,SAAG,IACT,EACP,eAAM,SAAS,EAAE,MAAM,CAAC,MAAM,GAAI,KANzB,KAAK,CAOT,CACR,CAAC,GACG,CACR,GACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .skeleton{display:grid;gap:12px}.line,.block,.circle,.dot,.button{display:block;border-radius:var(--interface-small-radius, 8px);background:linear-gradient(90deg, var(--interface-surface, #f6f6f6) 25%, var(--interface-line, #e5e5e5) 50%, var(--interface-surface, #f6f6f6) 75%);background-size:300% 100%;animation:shimmer 1.6s ease-in-out infinite}.line{height:14px}.short{width:60%}.card{display:grid;gap:12px;padding:20px;border:1px solid var(--interface-line, #e5e5e5);border-radius:var(--interface-radius, 12px);background:var(--interface-surface-raised, #ffffff)}.profile{grid-template-columns:auto minmax(0, 1fr);align-items:center;gap:20px}.circle{width:72px;height:72px;border-radius:50%}.stack{display:grid;gap:10px;min-width:0}.grid{display:grid;grid-template-columns:minmax(0, 1fr);gap:12px}@media(min-width: 640px){.grid{grid-template-columns:repeat(2, minmax(0, 1fr))}}.row{display:grid;grid-template-columns:auto minmax(0, 1fr) auto;align-items:center;gap:14px;padding:6px 0}.dot{width:32px;height:32px;border-radius:50%}.button{width:84px;height:32px;border-radius:999px}@keyframes shimmer{from{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion: reduce){.line,.block,.circle,.dot,.button{animation:none}}
@@ -0,0 +1,86 @@
1
+ @use "style/interface" as *;
2
+
3
+ .skeleton {
4
+ display: grid;
5
+ gap: 12px;
6
+ }
7
+ .line,
8
+ .block,
9
+ .circle,
10
+ .dot,
11
+ .button {
12
+ display: block;
13
+ border-radius: $small-radius;
14
+ background: linear-gradient(90deg, $surface 25%, $line 50%, $surface 75%);
15
+ background-size: 300% 100%;
16
+ animation: shimmer 1.6s ease-in-out infinite;
17
+ }
18
+ .line {
19
+ height: 14px;
20
+ }
21
+ .short {
22
+ width: 60%;
23
+ }
24
+ .card {
25
+ display: grid;
26
+ gap: 12px;
27
+ padding: 20px;
28
+ @include card;
29
+ }
30
+ .profile {
31
+ grid-template-columns: auto minmax(0, 1fr);
32
+ align-items: center;
33
+ gap: 20px;
34
+ }
35
+ .circle {
36
+ width: 72px;
37
+ height: 72px;
38
+ border-radius: 50%;
39
+ }
40
+ .stack {
41
+ display: grid;
42
+ gap: 10px;
43
+ min-width: 0;
44
+ }
45
+ .grid {
46
+ display: grid;
47
+ grid-template-columns: minmax(0, 1fr);
48
+ gap: 12px;
49
+ @media (min-width: 640px) {
50
+ grid-template-columns: repeat(2, minmax(0, 1fr));
51
+ }
52
+ }
53
+ .row {
54
+ display: grid;
55
+ grid-template-columns: auto minmax(0, 1fr) auto;
56
+ align-items: center;
57
+ gap: 14px;
58
+ padding: 6px 0;
59
+ }
60
+ .dot {
61
+ width: 32px;
62
+ height: 32px;
63
+ border-radius: 50%;
64
+ }
65
+ .button {
66
+ width: 84px;
67
+ height: 32px;
68
+ border-radius: 999px;
69
+ }
70
+ @keyframes shimmer {
71
+ from {
72
+ background-position: 100% 0;
73
+ }
74
+ to {
75
+ background-position: 0 0;
76
+ }
77
+ }
78
+ @media (prefers-reduced-motion: reduce) {
79
+ .line,
80
+ .block,
81
+ .circle,
82
+ .dot,
83
+ .button {
84
+ animation: none;
85
+ }
86
+ }
@@ -0,0 +1,16 @@
1
+ export interface SkeletonProperties {
2
+ /** What is loading, read aloud once ("Loading devices…"). */
3
+ label: string;
4
+ /**
5
+ * What it stands for: `lines` of text (the default), a `card` of lines, a `list` of rows (an icon, two lines and a
6
+ * button each), a `profile` (a picture and a name), or a grid of `cards`.
7
+ */
8
+ shape?: "lines" | "card" | "list" | "profile" | "cards";
9
+ /** How many lines of text (3 by default). */
10
+ lines?: number;
11
+ /** How many rows or cards (3 by default). */
12
+ rows?: number;
13
+ /** A block (a picture, a card) instead of lines, this many pixels tall. */
14
+ height?: number;
15
+ }
16
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/skeleton/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACxD,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/skeleton/type.ts"],"names":[],"mappings":""}